r50882 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50881‎ | r50882 | r50883 >
Date:09:35, 22 May 2009
Author:nikerabbit
Status:ok (Comments)
Tags:
Comment:
Escaping fixes
Modified paths:
  • /trunk/phase3/includes/Block.php (modified) (history)
  • /trunk/phase3/includes/ChangesList.php (modified) (history)
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/includes/Linker.php (modified) (history)
  • /trunk/phase3/includes/LogEventsList.php (modified) (history)
  • /trunk/phase3/includes/LogPage.php (modified) (history)
  • /trunk/phase3/includes/OutputPage.php (modified) (history)
  • /trunk/phase3/includes/PageHistory.php (modified) (history)
  • /trunk/phase3/includes/Pager.php (modified) (history)
  • /trunk/phase3/includes/Preferences.php (modified) (history)
  • /trunk/phase3/includes/QueryPage.php (modified) (history)
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/includes/diff/DifferenceEngine.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialAncientpages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialContributions.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialDeletedContributions.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialDoubleRedirects.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialFewestrevisions.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialIpblocklist.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialListfiles.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialListgrouprights.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialListusers.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialNewimages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialNewpages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialPrefixindex.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialProtectedpages.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialRecentchangeslinked.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialResetpass.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialRevisiondelete.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUndelete.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUserrights.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/PageHistory.php
@@ -373,6 +373,7 @@
374374 function revLink( $rev ) {
375375 global $wgLang;
376376 $date = $wgLang->timeanddate( wfTimestamp(TS_MW, $rev->getTimestamp()), true );
 377+ $date = htmlspecialchars( $date );
377378 if( !$rev->isDeleted( Revision::DELETED_TEXT ) ) {
378379 $link = $this->mSkin->makeKnownLinkObj( $this->mTitle, $date, "oldid=" . $rev->getId() );
379380 } else {
Index: trunk/phase3/includes/Preferences.php
@@ -122,7 +122,7 @@
123123 'type' => 'info',
124124 'label' => wfMsgExt( 'prefs-memberingroups', 'parseinline',
125125 count($userEffectiveGroupsArray) ),
126 - 'default' => $wgLang->commaList( $userEffectiveGroupsArray ),
 126+ 'default' => htmlspecialchars( $wgLang->commaList( $userEffectiveGroupsArray ) ),
127127 'raw' => true,
128128 'section' => 'personal/info',
129129 );
@@ -301,19 +301,19 @@
302302 $time = $wgLang->timeAndDate( $user->getEmailAuthenticationTimestamp(), true );
303303 $d = $wgLang->date( $user->getEmailAuthenticationTimestamp(), true );
304304 $t = $wgLang->time( $user->getEmailAuthenticationTimestamp(), true );
305 - $emailauthenticated = wfMsg('emailauthenticated', $time, $d, $t ).'<br />';
 305+ $emailauthenticated = htmlspecialchars(wfMsg('emailauthenticated', $time, $d, $t )).'<br />';
306306 $disableEmailPrefs = false;
307307 } else {
308308 $disableEmailPrefs = true;
309309 global $wgUser; // wgUser is okay here, it's for display
310310 $skin = $wgUser->getSkin();
311 - $emailauthenticated = wfMsg('emailnotauthenticated').'<br />' .
 311+ $emailauthenticated = wfMsgHtml('emailnotauthenticated').'<br />' .
312312 $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Confirmemail' ),
313313 wfMsg( 'emailconfirmlink' ) ) . '<br />';
314314 }
315315 } else {
316316 $disableEmailPrefs = true;
317 - $emailauthenticated = wfMsg( 'noemailprefs' );
 317+ $emailauthenticated = wfMsgHtml( 'noemailprefs' );
318318 }
319319
320320 $defaultPreferences['emailauthentication'] =
@@ -413,7 +413,7 @@
414414 array(
415415 'type' => 'radio',
416416 'options' =>
417 - array_flip( array_map( 'wfMsg', $wgLang->getMathNames() ) ),
 417+ array_flip( array_map( 'wfMsgHtml', $wgLang->getMathNames() ) ),
418418 'label' => '&nbsp;',
419419 'section' => 'rendering/math',
420420 );
@@ -848,6 +848,7 @@
849849
850850 if (!$displayNs) $displayNs = wfMsg( 'blanknamespace' );
851851
 852+ $displayNs = htmlspecialchars( $displayNs );
852853 $nsOptions[$displayNs] = $ns;
853854 }
854855
@@ -882,7 +883,7 @@
883884 $ret = array();
884885
885886 $mptitle = Title::newMainPage();
886 - $previewtext = wfMsg( 'skin-preview' );
 887+ $previewtext = wfMsgHtml( 'skin-preview' );
887888 # Only show members of Skin::getSkinNames() rather than
888889 # $skinNames (skins is all skin names from Language.php)
889890 $validSkinNames = Skin::getUsableSkins();
@@ -892,7 +893,7 @@
893894 $msgName = "skinname-{$skinkey}";
894895 $localisedSkinName = wfMsg( $msgName );
895896 if ( !wfEmptyMsg( $msgName, $localisedSkinName ) ) {
896 - $skinname = $localisedSkinName;
 897+ $skinname = htmlspecialchars($localisedSkinName);
897898 }
898899 }
899900 asort($validSkinNames);
@@ -905,7 +906,7 @@
906907 global $wgAllowUserCss, $wgAllowUserJs;
907908 if( $wgAllowUserCss ) {
908909 $cssPage = Title::makeTitleSafe( NS_USER, $user->getName().'/'.$skinkey.'.css' );
909 - $customCSS = $sk->link( $cssPage, wfMsgExt( 'prefs-custom-css', array() ) );
 910+ $customCSS = $sk->link( $cssPage, wfMsgHtml( 'prefs-custom-css' ) );
910911 $extraLinks .= " ($customCSS)";
911912 }
912913 if( $wgAllowUserJs ) {
@@ -914,7 +915,7 @@
915916 $extraLinks .= " ($customJS)";
916917 }
917918 if( $skinkey == $wgDefaultSkin )
918 - $sn .= ' (' . wfMsg( 'default' ) . ')';
 919+ $sn .= ' (' . wfMsgHtml( 'default' ) . ')';
919920 $display = "$sn $previewlink{$extraLinks}";
920921 $ret[$display] = $skinkey;
921922 }
@@ -933,9 +934,9 @@
934935 $epoch = '20010115161234'; # Wikipedia day
935936 foreach( $dateopts as $key ) {
936937 if( $key == 'default' ) {
937 - $formatted = wfMsg( 'datedefault' );
 938+ $formatted = wfMsgHtml( 'datedefault' );
938939 } else {
939 - $formatted = $wgLang->timeanddate( $epoch, false, $key );
 940+ $formatted = htmlspecialchars($wgLang->timeanddate( $epoch, false, $key ));
940941 }
941942 $ret[$formatted] = $key;
942943 }
@@ -1222,7 +1223,7 @@
12231224 $sk = $wgUser->getSkin();
12241225 $t = SpecialPage::getTitleFor( 'Preferences', 'reset' );
12251226
1226 - $html .= "\n" . $sk->link( $t, wfMsg( 'restoreprefs' ) );
 1227+ $html .= "\n" . $sk->link( $t, wfMsgHtml( 'restoreprefs' ) );
12271228
12281229 $html = Xml::tags( 'div', array( 'class' => 'mw-prefs-buttons' ), $html );
12291230
Index: trunk/phase3/includes/specials/SpecialUserrights.php
@@ -421,7 +421,7 @@
422422 private static function buildGroupLink( $group ) {
423423 static $cache = array();
424424 if( !isset( $cache[$group] ) )
425 - $cache[$group] = User::makeGroupLinkHtml( $group, User::getGroupName( $group ) );
 425+ $cache[$group] = User::makeGroupLinkHtml( $group, htmlspecialchars( User::getGroupName( $group ) ) );
426426 return $cache[$group];
427427 }
428428
Index: trunk/phase3/includes/specials/SpecialFewestrevisions.php
@@ -57,9 +57,9 @@
5858
5959 $plink = $skin->makeKnownLinkObj( $nt, $text );
6060
61 - $nl = wfMsgExt( 'nrevisions', array( 'parsemag', 'escape'),
 61+ $nl = wfMsgExt( 'nrevisions', array( 'parsemag', 'escape' ),
6262 $wgLang->formatNum( $result->value ) );
63 - $redirect = $result->redirect ? ' - ' . wfMsg( 'isredirect' ) : '';
 63+ $redirect = $result->redirect ? ' - ' . wfMsgHtml( 'isredirect' ) : '';
6464 $nlink = $skin->makeKnownLinkObj( $nt, $nl, 'action=history' ) . $redirect;
6565
6666
Index: trunk/phase3/includes/specials/SpecialRecentchangeslinked.php
@@ -171,7 +171,7 @@
172172 $opts->consumeValues( array( 'showlinkedto', 'target' ) );
173173 $extraOpts = array();
174174 $extraOpts['namespace'] = $this->namespaceFilterForm( $opts );
175 - $extraOpts['target'] = array( wfMsg( 'recentchangeslinked-page' ),
 175+ $extraOpts['target'] = array( wfMsgHtml( 'recentchangeslinked-page' ),
176176 Xml::input( 'target', 40, str_replace('_',' ',$opts['target']) ) .
177177 Xml::check( 'showlinkedto', $opts['showlinkedto'], array('id' => 'showlinkedto') ) . ' ' .
178178 Xml::label( wfMsg("recentchangeslinked-to"), 'showlinkedto' ) );
Index: trunk/phase3/includes/specials/SpecialUndelete.php
@@ -897,7 +897,7 @@
898898 $targetPage,
899899 wfMsgHtml(
900900 'revisionasof',
901 - $wgLang->timeanddate( $rev->getTimestamp(), true )
 901+ htmlspecialchars( $wgLang->timeanddate( $rev->getTimestamp(), true ) )
902902 ),
903903 array(),
904904 $targetQuery
@@ -1150,7 +1150,7 @@
11511151 }
11521152 } else {
11531153 $checkBox = '';
1154 - $pageLink = $wgLang->timeanddate( $ts, true );
 1154+ $pageLink = htmlspecialchars( $wgLang->timeanddate( $ts, true ) );
11551155 $last = wfMsgHtml('diff');
11561156 }
11571157 $userLink = $sk->revUserTools( $rev );
@@ -1224,10 +1224,12 @@
12251225 function getPageLink( $rev, $titleObj, $ts, $sk ) {
12261226 global $wgLang;
12271227
 1228+ $time = htmlspecialchars( $wgLang->timeanddate( $ts, true ) );
 1229+
12281230 if( !$rev->userCan(Revision::DELETED_TEXT) ) {
1229 - return '<span class="history-deleted">' . $wgLang->timeanddate( $ts, true ) . '</span>';
 1231+ return '<span class="history-deleted">' . $time . '</span>';
12301232 } else {
1231 - $link = $sk->makeKnownLinkObj( $titleObj, $wgLang->timeanddate( $ts, true ),
 1233+ $link = $sk->makeKnownLinkObj( $titleObj, $time,
12321234 "target=".$this->mTargetObj->getPrefixedUrl()."&timestamp=$ts" );
12331235 if( $rev->isDeleted(Revision::DELETED_TEXT) )
12341236 $link = '<span class="history-deleted">' . $link . '</span>';
Index: trunk/phase3/includes/specials/SpecialNewpages.php
@@ -254,7 +254,7 @@
255255 $dm = $wgContLang->getDirMark();
256256
257257 $title = Title::makeTitleSafe( $result->rc_namespace, $result->rc_title );
258 - $time = $wgLang->timeAndDate( $result->rc_timestamp, true );
 258+ $time = htmlspecialchars( $wgLang->timeAndDate( $result->rc_timestamp, true ) );
259259 $query = $this->patrollable( $result ) ? "rcid={$result->rc_id}&redirect=no" : 'redirect=no';
260260 $plink = $this->skin->makeKnownLinkObj( $title, '', $query );
261261 $hist = $this->skin->makeKnownLinkObj( $title, wfMsgHtml( 'hist' ), 'action=history' );
Index: trunk/phase3/includes/specials/SpecialIpblocklist.php
@@ -384,11 +384,10 @@
385385 if( is_null( $msg ) ) {
386386 $msg = array();
387387 $keys = array( 'infiniteblock', 'expiringblock', 'unblocklink', 'change-blocklink',
388 - 'anononlyblock', 'createaccountblock', 'noautoblockblock', 'emailblock', 'blocklist-nousertalk' );
 388+ 'anononlyblock', 'createaccountblock', 'noautoblockblock', 'emailblock', 'blocklist-nousertalk', 'blocklistline' );
389389 foreach( $keys as $key ) {
390390 $msg[$key] = wfMsgHtml( $key );
391391 }
392 - $msg['blocklistline'] = wfMsg( 'blocklistline' );
393392 }
394393
395394 # Prepare links to the blocker's user and talk pages
@@ -405,7 +404,7 @@
406405 . $sk->userToolLinks( $block->mUser, $block->mAddress, false, Linker::TOOL_LINKS_NOBLOCK );
407406 }
408407
409 - $formattedTime = $wgLang->timeanddate( $block->mTimestamp, true );
 408+ $formattedTime = htmlspecialchars( $wgLang->timeanddate( $block->mTimestamp, true ) );
410409
411410 $properties = array();
412411 $properties[] = Block::formatExpiry( $block->mExpiry );
@@ -443,7 +442,7 @@
444443
445444 # Create changeblocklink for all blocks with exception of autoblocks
446445 if( !$block->mAuto ) {
447 - $changeblocklink = wfMsg( 'pipe-separator' ) .
 446+ $changeblocklink = wfMsgExt( 'pipe-separator', 'escapenoentities' ) .
448447 $sk->link( SpecialPage::getTitleFor( 'Blockip', $block->mAddress ),
449448 $msg['change-blocklink'],
450449 array(), array(), 'known' );
@@ -451,7 +450,7 @@
452451 $toolLinks = "($unblocklink$changeblocklink)";
453452 }
454453
455 - $comment = $sk->commentBlock( $block->mReason );
 454+ $comment = $sk->commentBlock( htmlspecialchars($block->mReason) );
456455
457456 $s = "{$line} $comment";
458457 if ( $block->mHideName )
Index: trunk/phase3/includes/specials/SpecialListfiles.php
@@ -127,7 +127,7 @@
128128 global $wgLang;
129129 switch ( $field ) {
130130 case 'img_timestamp':
131 - return $wgLang->timeanddate( $value, true );
 131+ return htmlspecialchars( $wgLang->timeanddate( $value, true ) );
132132 case 'img_name':
133133 static $imgfile = null;
134134 if ( $imgfile === null ) $imgfile = wfMsg( 'imgfile' );
Index: trunk/phase3/includes/specials/SpecialRevisiondelete.php
@@ -701,7 +701,7 @@
702702 private function logLine( $row ) {
703703 global $wgLang;
704704
705 - $date = $wgLang->timeanddate( $row->log_timestamp );
 705+ $date = htmlspecialchars( $wgLang->timeanddate( $row->log_timestamp ) );
706706 $paramArray = LogPage::extractParams( $row->log_params );
707707 $title = Title::makeTitle( $row->log_namespace, $row->log_title );
708708
Index: trunk/phase3/includes/specials/SpecialPrefixindex.php
@@ -170,7 +170,7 @@
171171 $nsForm .
172172 '</td>
173173 <td id="mw-prefixindex-nav-form">' .
174 - $sk->makeKnownLinkObj( $self, wfMsg ( 'allpages' ) );
 174+ $sk->makeKnownLinkObj( $self, wfMsgHtml( 'allpages' ) );
175175
176176 if( isset( $res ) && $res && ( $n == $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) {
177177 $namespaceparam = $namespace ? "&namespace=$namespace" : "";
Index: trunk/phase3/includes/specials/SpecialContributions.php
@@ -513,7 +513,7 @@
514514
515515 $comment = $wgContLang->getDirMark() . $sk->revComment( $rev, false, true );
516516 $date = $wgLang->timeanddate( wfTimestamp( TS_MW, $row->rev_timestamp ), true );
517 - $d = $sk->makeKnownLinkObj( $page, $date, 'oldid='.intval($row->rev_id) );
 517+ $d = $sk->makeKnownLinkObj( $page, htmlspecialchars($date), 'oldid='.intval($row->rev_id) );
518518
519519 if( $this->target == 'newbies' ) {
520520 $userlink = ' . . ' . $sk->userLink( $row->rev_user, $row->rev_user_text );
Index: trunk/phase3/includes/specials/SpecialListgrouprights.php
@@ -41,7 +41,7 @@
4242 );
4343
4444 foreach( $wgGroupPermissions as $group => $permissions ) {
45 - $groupname = ( $group == '*' ) ? 'all' : htmlspecialchars( $group ); // Replace * with a more descriptive groupname
 45+ $groupname = ( $group == '*' ) ? 'all' : $group; // Replace * with a more descriptive groupname
4646
4747 $msg = wfMsg( 'group-' . $groupname );
4848 if ( wfEmptyMsg( 'group-' . $groupname, $msg ) || $msg == '' ) {
@@ -59,9 +59,9 @@
6060
6161 if( $group == '*' ) {
6262 // Do not make a link for the generic * group
63 - $grouppage = $groupnameLocalized;
 63+ $grouppage = htmlspecialchars($groupnameLocalized);
6464 } else {
65 - $grouppage = $this->skin->makeLink( $grouppageLocalized, $groupnameLocalized );
 65+ $grouppage = $this->skin->makeLink( $grouppageLocalized, htmlspecialchars($groupnameLocalized) );
6666 }
6767
6868 if ( $group === 'user' ) {
Index: trunk/phase3/includes/specials/SpecialDeletedContributions.php
@@ -83,7 +83,7 @@
8484 $limits = $wgLang->pipeList( $limitLinks );
8585
8686 $this->mNavigationBar = "(" . $wgLang->pipeList( array( $pagingLinks['first'], $pagingLinks['last'] ) ) . ") " .
87 - wfMsgExt( 'viewprevnext', array( 'parsemag' ), $pagingLinks['prev'], $pagingLinks['next'], $limits );
 87+ wfMsgExt( 'viewprevnext', array( 'parsemag', 'escape', 'replaceafter' ), $pagingLinks['prev'], $pagingLinks['next'], $limits );
8888 return $this->mNavigationBar;
8989 }
9090
@@ -145,7 +145,7 @@
146146 "&diff=prev" );
147147
148148 $comment = $sk->revComment( $rev );
149 - $d = $wgLang->timeanddate( $rev->getTimestamp(), true );
 149+ $d = htmlspecialchars( $wgLang->timeanddate( $rev->getTimestamp(), true ) );
150150
151151 if( $rev->isDeleted( Revision::DELETED_TEXT ) ) {
152152 $d = '<span class="history-deleted">' . $d . '</span>';
Index: trunk/phase3/includes/specials/SpecialListusers.php
@@ -135,7 +135,7 @@
136136 global $wgEdititis;
137137 if ( $wgEdititis ) {
138138 $editCount = $wgLang->formatNum( $row->edits );
139 - $edits = ' [' . wfMsgExt( 'usereditcount', 'parsemag', $editCount ) . ']';
 139+ $edits = ' [' . wfMsgExt( 'usereditcount', array( 'parsemag', 'escape' ), $editCount ) . ']';
140140 } else {
141141 $edits = '';
142142 }
@@ -145,7 +145,8 @@
146146 if( $row->creation ) {
147147 $d = $wgLang->date( wfTimestamp( TS_MW, $row->creation ), true );
148148 $t = $wgLang->time( wfTimestamp( TS_MW, $row->creation ), true );
149 - $created = ' (' . wfMsgHtml( 'usercreated', $d, $t ) . ')';
 149+ $created = ' (' . wfMsg( 'usercreated', $d, $t ) . ')';
 150+ $created = htmlspecialchars( $created );
150151 }
151152
152153 wfRunHooks( 'SpecialListusersFormatRow', array( &$item, $row ) );
@@ -251,7 +252,7 @@
252253 protected static function buildGroupLink( $group ) {
253254 static $cache = array();
254255 if( !isset( $cache[$group] ) )
255 - $cache[$group] = User::makeGroupLinkHtml( $group, User::getGroupMember( $group ) );
 256+ $cache[$group] = User::makeGroupLinkHtml( $group, htmlspecialchars( User::getGroupMember( $group ) ) );
256257 return $cache[$group];
257258 }
258259 }
Index: trunk/phase3/includes/specials/SpecialAncientpages.php
@@ -47,7 +47,7 @@
4848 $d = $wgLang->timeanddate( wfTimestamp( TS_MW, $result->value ), true );
4949 $title = Title::makeTitle( $result->namespace, $result->title );
5050 $link = $skin->makeKnownLinkObj( $title, htmlspecialchars( $wgContLang->convert( $title->getPrefixedText() ) ) );
51 - return wfSpecialList($link, $d);
 51+ return wfSpecialList($link, htmlspecialchars($d) );
5252 }
5353 }
5454
Index: trunk/phase3/includes/specials/SpecialResetpass.php
@@ -142,7 +142,7 @@
143143 if ( $type != 'text' )
144144 $out .= Xml::label( wfMsg( $label ), $name );
145145 else
146 - $out .= wfMsg( $label );
 146+ $out .= wfMsgHtml( $label );
147147 $out .= '</td>';
148148 $out .= "<td class='mw-input'>";
149149 $out .= $field;
Index: trunk/phase3/includes/specials/SpecialProtectedpages.php
@@ -86,7 +86,7 @@
8787 $expiry_description = wfMsg( 'protect-expiring' , $wgLang->timeanddate( $expiry ) ,
8888 $wgLang->date( $expiry ) , $wgLang->time( $expiry ) );
8989
90 - $description_items[] = $expiry_description;
 90+ $description_items[] = htmlspecialchars($expiry_description);
9191 }
9292
9393 if(!is_null($size = $row->page_len)) {
Index: trunk/phase3/includes/specials/SpecialNewimages.php
@@ -128,7 +128,7 @@
129129 $nt = Title::newFromText( $name, NS_FILE );
130130 $ul = $sk->link( Title::makeTitle( NS_USER, $ut ), $ut );
131131
132 - $gallery->add( $nt, "$ul<br />\n<i>".$wgLang->timeanddate( $s->img_timestamp, true )."</i><br />\n" );
 132+ $gallery->add( $nt, "$ul<br />\n<i>".htmlspecialchars($wgLang->timeanddate( $s->img_timestamp, true ))."</i><br />\n" );
133133
134134 $timestamp = wfTimestamp( TS_MW, $s->img_timestamp );
135135 if( empty( $firstTimestamp ) ) {
@@ -170,7 +170,7 @@
171171 $now = wfTimestampNow();
172172 $d = $wgLang->date( $now, true );
173173 $t = $wgLang->time( $now, true );
174 - $dateLink = $sk->makeKnownLinkObj( $titleObj, wfMsgHtml( 'sp-newimages-showfrom', $d, $t ),
 174+ $dateLink = $sk->makeKnownLinkObj( $titleObj, htmlspecialchars( wfMsg( 'sp-newimages-showfrom', $d, $t ) ),
175175 'from='.$now.$botpar.$searchpar );
176176
177177 $botLink = $sk->makeKnownLinkObj($titleObj, wfMsgHtml( 'showhidebots',
Index: trunk/phase3/includes/specials/SpecialDoubleRedirects.php
@@ -81,7 +81,7 @@
8282 $titleC = Title::makeTitle( $result->nsc, $result->tc );
8383
8484 $linkA = $skin->makeKnownLinkObj( $titleA, '', 'redirect=no' );
85 - $edit = $skin->makeBrokenLinkObj( $titleA, "(".wfMsg("qbedit").")" , 'redirect=no');
 85+ $edit = $skin->makeBrokenLinkObj( $titleA, "(".wfMsgHtml("qbedit").")" , 'redirect=no');
8686 $linkB = $skin->makeKnownLinkObj( $titleB, '', 'redirect=no' );
8787 $linkC = $skin->makeKnownLinkObj( $titleC );
8888 $arr = $wgContLang->getArrow() . $wgContLang->getDirMark();
Index: trunk/phase3/includes/Skin.php
@@ -1634,20 +1634,20 @@
16351635 }
16361636
16371637 function historyLink() {
1638 - return $this->link( $this->mTitle, wfMsg( 'history' ),
 1638+ return $this->link( $this->mTitle, wfMsgHtml( 'history' ),
16391639 array( 'rel' => 'archives' ), array( 'action' => 'history' ) );
16401640 }
16411641
16421642 function whatLinksHere() {
16431643 return $this->makeKnownLinkObj(
16441644 SpecialPage::getTitleFor( 'Whatlinkshere', $this->mTitle->getPrefixedDBkey() ),
1645 - wfMsg( 'whatlinkshere' ) );
 1645+ wfMsgHtml( 'whatlinkshere' ) );
16461646 }
16471647
16481648 function userContribsLink() {
16491649 return $this->makeKnownLinkObj(
16501650 SpecialPage::getTitleFor( 'Contributions', $this->mTitle->getDBkey() ),
1651 - wfMsg( 'contributions' ) );
 1651+ wfMsgHtml( 'contributions' ) );
16521652 }
16531653
16541654 function showEmailUser( $id ) {
Index: trunk/phase3/includes/EditPage.php
@@ -1286,8 +1286,8 @@
12871287 #if ( "no" == $redirect ) { $q .= "&redirect=no"; }
12881288 $action = $wgTitle->escapeLocalURL( $q );
12891289
1290 - $summary = wfMsg( 'summary' );
1291 - $subject = wfMsg( 'subject' );
 1290+ $summary = wfMsgExt( 'summary', 'parseinline' );
 1291+ $subject = wfMsgExt( 'subject', 'parseinline' );
12921292
12931293 $cancel = $sk->makeKnownLink( $wgTitle->getPrefixedText(),
12941294 wfMsgExt('cancel', array('parseinline')) );
@@ -1384,7 +1384,8 @@
13851385 $editsummary = "<div class='editOptions'>\n";
13861386 global $wgParser;
13871387 $formattedSummary = wfMsgForContent( 'newsectionsummary', $wgParser->stripSectionName( $this->summary ) );
1388 - $subjectpreview = $summarytext && $this->preview ? "<div class=\"mw-summary-preview\">". wfMsg('subject-preview') . $sk->commentBlock( $formattedSummary, $this->mTitle, true )."</div>\n" : '';
 1388+ $subjectpreview = $summarytext && $this->preview ?
 1389+ "<div class=\"mw-summary-preview\">". wfMsgExt('subject-preview', 'parseinline') . $sk->commentBlock( $formattedSummary, $this->mTitle, true )."</div>\n" : '';
13891390 $summarypreview = '';
13901391 } else {
13911392 $commentsubject = '';
@@ -1414,7 +1415,7 @@
14151416 $summarypreview =
14161417 Xml::tags( 'div',
14171418 array( 'class' => 'mw-summary-preview' ),
1418 - wfMsg( 'summary-preview' ) .
 1419+ wfMsgExt( 'summary-preview', 'parseinline' ) .
14191420 $sk->commentBlock( $this->summary, $this->mTitle )
14201421 );
14211422 }
Index: trunk/phase3/includes/Block.php
@@ -826,7 +826,7 @@
827827 * Convert a DB-encoded expiry into a real string that humans can read.
828828 *
829829 * @param $encoded_expiry String: Database encoded expiry time
830 - * @return String
 830+ * @return Html-escaped String
831831 */
832832 public static function formatExpiry( $encoded_expiry ) {
833833 static $msg = null;
@@ -844,7 +844,7 @@
845845 $expirystr = $msg['infiniteblock'];
846846 } else {
847847 global $wgLang;
848 - $expiretimestr = $wgLang->timeanddate( $expiry, true );
 848+ $expiretimestr = htmlspecialchars($wgLang->timeanddate( $expiry, true ));
849849 $expirystr = wfMsgReplaceArgs( $msg['expiringblock'], array($expiretimestr) );
850850 }
851851 return $expirystr;
Index: trunk/phase3/includes/Pager.php
@@ -607,8 +607,8 @@
608608 }
609609 $nicenumber = $wgLang->formatNum( $this->mLimit );
610610 $linkTexts = array(
611 - 'prev' => wfMsgExt( 'pager-newer-n', array( 'parsemag' ), $nicenumber ),
612 - 'next' => wfMsgExt( 'pager-older-n', array( 'parsemag' ), $nicenumber ),
 611+ 'prev' => wfMsgExt( 'pager-newer-n', array( 'parsemag', 'escape' ), $nicenumber ),
 612+ 'next' => wfMsgExt( 'pager-older-n', array( 'parsemag', 'escape' ), $nicenumber ),
613613 'first' => wfMsgHtml( 'histlast' ),
614614 'last' => wfMsgHtml( 'histfirst' )
615615 );
Index: trunk/phase3/includes/OutputPage.php
@@ -1444,7 +1444,7 @@
14451445 public function addReturnTo( $title ) {
14461446 global $wgUser;
14471447 $this->addLink( array( 'rel' => 'next', 'href' => $title->getFullUrl() ) );
1448 - $link = wfMsg( 'returnto', $wgUser->getSkin()->link( $title ) );
 1448+ $link = wfMsgHtml( 'returnto', $wgUser->getSkin()->link( $title ) );
14491449 $this->addHTML( "<p>{$link}</p>\n" );
14501450 }
14511451
Index: trunk/phase3/includes/LogPage.php
@@ -173,7 +173,7 @@
174174 }
175175 if( isset( $wgLogActions[$key] ) ) {
176176 if( is_null( $title ) ) {
177 - $rv = wfMsg( $wgLogActions[$key] );
 177+ $rv = wfMsgHtml( $wgLogActions[$key] );
178178 } else {
179179 $titleLink = self::getTitleLink( $type, $skin, $title, $params );
180180 if( $key == 'rights/rights' ) {
@@ -194,9 +194,9 @@
195195 }
196196 if( count( $params ) == 0 ) {
197197 if ( $skin ) {
198 - $rv = wfMsg( $wgLogActions[$key], $titleLink );
 198+ $rv = wfMsgHtml( $wgLogActions[$key], $titleLink );
199199 } else {
200 - $rv = wfMsgForContent( $wgLogActions[$key], $titleLink );
 200+ $rv = wfMsgExt( $wgLogActions[$key], array( 'parsemag', 'escape', 'replaceafter', 'content' ), $titleLink );
201201 }
202202 } else {
203203 $details = '';
@@ -243,7 +243,11 @@
244244 $nfield = intval( substr( $params[3], 7 ) ); // <nfield=x>
245245 $details .= ': '.RevisionDeleter::getLogMessage( $count, $nfield, $ofield, true );
246246 }
247 - $rv = wfMsgReal( $wgLogActions[$key], $params, true, !$skin ) . $details;
 247+ if ( $skin ) {
 248+ $rv = wfMsgHtml( $wgLogActions[$key], $params ) . $details;
 249+ } else {
 250+ $rv = wfMsgExt( $wgLogActions[$key], array( 'parsemag', 'escape', 'replaceafter', 'content' ), $params ) . $details;
 251+ }
248252 }
249253 }
250254 } else {
Index: trunk/phase3/includes/QueryPage.php
@@ -585,7 +585,7 @@
586586 return wfSpecialList( $pageLink, $this->makeWlhLink( $title, $skin, $result ) );
587587 } else {
588588 $tsafe = htmlspecialchars( $result->title );
589 - return wfMsg( 'wantedpages-badtitle', $tsafe );
 589+ return wfMsgHtml( 'wantedpages-badtitle', $tsafe );
590590 }
591591 }
592592
Index: trunk/phase3/includes/ChangesList.php
@@ -176,7 +176,7 @@
177177 if( '' != $this->lastdate ) {
178178 $s .= "</ul>\n";
179179 }
180 - $s .= '<h4>'.$date."</h4>\n<ul class=\"special\">";
 180+ $s .= Xml::element( 'h4', null, $date ) . "\n<ul class=\"special\">";
181181 $this->lastdate = $date;
182182 $this->rclistOpen = true;
183183 }
@@ -517,7 +517,7 @@
518518 # Process current cache
519519 $ret = $this->recentChangesBlock();
520520 $this->rc_cache = array();
521 - $ret .= "<h4>{$date}</h4>\n";
 521+ $ret .= Xml::element( 'h4', null, $date );
522522 $this->lastdate = $date;
523523 }
524524
Index: trunk/phase3/includes/Linker.php
@@ -1276,7 +1276,7 @@
12771277 }
12781278 if ( $sectionTitle ) {
12791279 $link = $this->link( $sectionTitle,
1280 - wfMsgForContent( 'sectionlink' ), array(), array(),
 1280+ htmlspecialchars( wfMsgForContent( 'sectionlink' ) ), array(), array(),
12811281 'noclasses' );
12821282 } else {
12831283 $link = '';
Index: trunk/phase3/includes/LogEventsList.php
@@ -355,6 +355,8 @@
356356 $revert = '<span class="mw-logevent-actionlink">' . $revert . '</span>';
357357 }
358358
 359+ $time = htmlspecialchars( $time );
 360+
359361 return Xml::tags( 'li', array( "class" => implode( ' ', $classes ) ),
360362 $del . $time . ' ' . $userLink . ' ' . $action . ' ' . $comment . ' ' . $revert . " $tagDisplay" ) . "\n";
361363 }
Index: trunk/phase3/includes/diff/DifferenceEngine.php
@@ -737,7 +737,7 @@
738738
739739 function localiseLineNumbersCb( $matches ) {
740740 global $wgLang;
741 - return wfMsgExt( 'lineno', array (), $wgLang->formatNum( $matches[1] ) );
 741+ return wfMsgExt( 'lineno', 'escape', $wgLang->formatNum( $matches[1] ) );
742742 }
743743
744744
@@ -840,7 +840,7 @@
841841 $this->mNewPage = $this->mNewRev->getTitle();
842842 if( $this->mNewRev->isCurrent() ) {
843843 $newLink = $this->mNewPage->escapeLocalUrl( 'oldid=' . $this->mNewid );
844 - $this->mPagetitle = wfMsgHTML( 'currentrev-asof', $timestamp );
 844+ $this->mPagetitle = htmlspecialchars( wfMsg( 'currentrev-asof', $timestamp ) );
845845 $newEdit = $this->mNewPage->escapeLocalUrl( 'action=edit' );
846846
847847 $this->mNewtitle = "<a href='$newLink'>{$this->mPagetitle}</a>";
@@ -848,7 +848,7 @@
849849 } else {
850850 $newLink = $this->mNewPage->escapeLocalUrl( 'oldid=' . $this->mNewid );
851851 $newEdit = $this->mNewPage->escapeLocalUrl( 'action=edit&oldid=' . $this->mNewid );
852 - $this->mPagetitle = wfMsgHTML( 'revisionasof', $timestamp );
 852+ $this->mPagetitle = htmlspecialchars( wfMsg( 'revisionasof', $timestamp ) );
853853
854854 $this->mNewtitle = "<a href='$newLink'>{$this->mPagetitle}</a>";
855855 $this->mNewtitle .= " (<a href='$newEdit'>" . wfMsgHtml( $editable ? 'editold' : 'viewsourceold' ) . "</a>)";

Comments

#Comment by Nikerabbit (talk | contribs)   12:03, 22 May 2009

This changes summary, subject, summary-preview and subject-preview from html to wikitext. Should probably be notified somewhere.

#Comment by Mormegil (talk | contribs)   12:57, 22 May 2009

Special:Preferences is now broken, you can’t escape $userEffectiveGroupsArray in Preferences.php (entry for 'usergroups' on line 125), it contains HTML links to the respective group pages (see a few lines above).

#Comment by Nikerabbit (talk | contribs)   16:16, 22 May 2009

I noticed that too, fixed in r50895.

#Comment by Roberto Mura (talk | contribs)   10:50, 15 June 2009

A bad white line just on the top of the page. So titles and contents go down.

#Comment by Siebrand (talk | contribs)   11:46, 15 June 2009

Can you provide more information? Sample URL, for example.

#Comment by Platonides (talk | contribs)   15:00, 10 February 2011

Add release notes

Status & tagging log