r113444 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r113443‎ | r113444 | r113445 >
Date:01:32, 9 March 2012
Author:awjrichards
Status:ok (Comments)
Tags:
Comment:
Followup r113442, using internal message array and escaping button messages
Modified paths:
  • /trunk/extensions/MobileFrontend/MobileFrontend.body.php (modified) (history)
  • /trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/MobileFrontend.body.php
@@ -1218,8 +1218,8 @@
12191219 'wgScriptPath' => $wgScriptPath,
12201220 'isFilePage' => self::$isFilePage,
12211221 'zeroRatedBanner' => self::$zeroRatedBanner,
1222 - 'showText' => wfMessage( 'mobile-frontend-show-button' ),
1223 - 'hideText' => wfMessage( 'mobile-frontend-hide-button' ),
 1222+ 'showText' => self::$messages[ 'mobile-frontend-show-button' ],
 1223+ 'hideText' => self::$messages[ 'mobile-frontend-hide-button' ],
12241224 );
12251225 $applicationTemplate->setByArray( $options );
12261226 wfProfileOut( __METHOD__ );
Index: trunk/extensions/MobileFrontend/templates/ApplicationTemplate.php
@@ -40,7 +40,10 @@
4141 $startLinkTag = "<link href='{$this->data['wgExtensionAssetsPath']}/MobileFrontend/stylesheets/";
4242 $endLinkTag = "' media='all' rel='Stylesheet' type='text/css' />";
4343 $filePageStyle = ( $this->data['isFilePage'] ) ? $startLinkTag . 'filepage.css' . $endLinkTag : '';
 44+ $buttonHideText = htmlentities( $this->data['hideText'], ENT_QUOTES );
 45+ $buttonShowText = htmlentities( $this->data['showText'], ENT_QUOTES );
4446
 47+
4548 $applicationHtml = <<<HTML
4649 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4750 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -59,8 +62,8 @@
6063 var title = "{$this->data['htmlTitle']}";
6164 var scriptPath = "{$this->data['wgScriptPath']}";
6265 var placeholder = "{$this->data['placeholder']}";
63 - var showText = "{$this->data['showText']}";
64 - var hideText = "{$this->data['hideText']}";
 66+ var showText = "{$buttonShowText}";
 67+ var hideText = "{$buttonHideText}";
6568 //]]>
6669 </script>
6770 </head>

Follow-up revisions

RevisionCommit summaryAuthorDate
r113445MFT r113442, r113444awjrichards01:35, 9 March 2012
r113488Bug 35086 - Expand brokens show bad labels on non-western alphabetsmaxsem17:30, 9 March 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r113442Making show/hide buttons translatableawjrichards01:21, 9 March 2012

Comments

#Comment by Nikerabbit (talk | contribs)   07:17, 9 March 2012

Why are you using htmlentities instead of htmlspecialchars? The latter is used almost always in core and other extensions and doesn't increase the length of text so much.

#Comment by Awjrichards (talk | contribs)   18:22, 9 March 2012

It was suggested by someone else, but regardless, was changed in r113488

Status & tagging log