r93561 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93560‎ | r93561 | r93562 >
Date:00:00, 31 July 2011
Author:reedy
Status:deferred
Tags:
Comment:
htmlspecialchars() on urls outputted to pages
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php (modified) (history)
  • /trunk/extensions/MobileFrontend/MobileFrontend.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/MobileFrontend.php
@@ -110,6 +110,7 @@
111111 $mobileViewUrl = $wgRequest->getRequestURL();
112112 $delimiter = ( strpos( $mobileViewUrl, "?" ) !== false ) ? "&" : "?";
113113 $mobileViewUrl .= $delimiter . 'useFormat=mobile';
 114+ $mobileViewUrl = htmlspecialchars( $mobileViewUrl );
114115
115116 $tpl->set('mobileview', "<a href='{$mobileViewUrl}'>{wfMsg( 'mobile-frontend-view' )}</a>");
116117 $footerlinks['places'][] = 'mobileview';
@@ -239,7 +240,7 @@
240241 // ajax_support_javascript
241242 // html_preferred_dtd
242243
243 - // Determine
 244+ // Determine
244245
245246 if (self::$useFormat === 'mobile' ||
246247 self::$useFormat === 'mobile-wap' ) {
@@ -517,7 +518,7 @@
518519 // TODO: Content transformations required
519520 // WML Validator:
520521 // http://validator.w3.org
521 - //
 522+ //
522523 // div -> p
523524 // no style, no class, no h1-h6, sup, sub, ol, ul, li etc.
524525 // table requires "columns" property
Index: branches/wmf/1.17wmf1/extensions/MobileFrontend/MobileFrontend.php
@@ -110,7 +110,7 @@
111111 $mobileViewUrl = $wgRequest->getRequestURL();
112112 $delimiter = ( strpos( $mobileViewUrl, "?" ) !== false ) ? "&" : "?";
113113 $mobileViewUrl .= $delimiter . 'useFormat=mobile';
114 - $mobileViewUrl = urlencode( $mobileViewUrl );
 114+ $mobileViewUrl = htmlspecialchars( $mobileViewUrl );
115115
116116 $tpl->set('mobileview', "<a href='{$mobileViewUrl}'>Mobile View</a>");
117117 $footerlinks['places'][] = 'mobileview';

Follow-up revisions

RevisionCommit summaryAuthorDate
r93650Wow, apparently WebRequest has it's own versions of these appendQuery().hartman20:42, 1 August 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r93560Per validation errors reported in #wikimedia-tech, urlencode the urlreedy23:31, 30 July 2011

Status & tagging log