r93726 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93725‎ | r93726 | r93727 >
Date:11:43, 2 August 2011
Author:rotem
Status:ok (Comments)
Tags:
Comment:
Fixing Special:Protectedtitles to match Special:Protectedpages. This prevents an internal error (caused by timestamp translation), probably since r84258, and possibly some incompatibility to different databases.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialProtectedtitles.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialProtectedtitles.php
@@ -78,10 +78,12 @@
7979
8080 wfProfileIn( __METHOD__ );
8181
82 - static $skin = null;
 82+ static $skin = null, $infinity = null;
8383
84 - if( is_null( $skin ) )
 84+ if( is_null( $skin ) ){
8585 $skin = $this->getSkin();
 86+ $infinity = wfGetDB( DB_SLAVE )->getInfinity();
 87+ }
8688
8789 $title = Title::makeTitleSafe( $row->pt_namespace, $row->pt_title );
8890 $link = $skin->link( $title );
@@ -92,12 +94,12 @@
9395
9496 $description_items[] = $protType;
9597
96 - if ( $row->pt_expiry != 'infinity' && strlen($row->pt_expiry) ) {
97 - $expiry = $wgLang->formatExpiry( $row->pt_expiry );
 98+ $expiry = strlen( $row->pt_expiry ) ? $wgLang->formatExpiry( $row->pt_expiry, TS_MW ) : $infinity;
 99+ if( $expiry != $infinity ) {
98100
99101 $expiry_description = wfMsg( 'protect-expiring', $wgLang->timeanddate( $expiry ) , $wgLang->date( $expiry ) , $wgLang->time( $expiry ) );
100102
101 - $description_items[] = $expiry_description;
 103+ $description_items[] = htmlspecialchars($expiry_description);
102104 }
103105
104106 wfProfileOut( __METHOD__ );

Follow-up revisions

RevisionCommit summaryAuthorDate
r99976MFT r93726demon22:06, 16 October 2011
r99980REL1_18 MFT r93726, r94199, r96437, r96438, r696579, r98235, r98734reedy22:13, 16 October 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r84258More cleanup in Block.php. Push Block::encodeExpiry() and Block::decodeExpir...happy-melon19:15, 18 March 2011

Comments

#Comment by Siebrand (talk | contribs)   16:39, 8 October 2011

Bug 31528 was reported because this was not backported.

Status & tagging log