http://www.mediawiki.org/wiki/Special:Code/MediaWiki/93726

Revision: 93726
Author:   rotem
Date:     2011-08-02 11:43:26 +0000 (Tue, 02 Aug 2011)
Log Message:
-----------
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: trunk/phase3/includes/specials/SpecialProtectedtitles.php
===================================================================
--- trunk/phase3/includes/specials/SpecialProtectedtitles.php   2011-08-02 
11:01:01 UTC (rev 93725)
+++ trunk/phase3/includes/specials/SpecialProtectedtitles.php   2011-08-02 
11:43:26 UTC (rev 93726)
@@ -78,10 +78,12 @@
 
                wfProfileIn( __METHOD__ );
 
-               static $skin =  null;
+               static $skin =  null, $infinity = null;
 
-               if( is_null( $skin ) )
+               if( is_null( $skin ) ){
                        $skin = $this->getSkin();
+                       $infinity = wfGetDB( DB_SLAVE )->getInfinity();
+               }
 
                $title = Title::makeTitleSafe( $row->pt_namespace, 
$row->pt_title );
                $link = $skin->link( $title );
@@ -92,12 +94,12 @@
 
                $description_items[] = $protType;
 
-               if ( $row->pt_expiry != 'infinity' && strlen($row->pt_expiry) ) 
{
-                       $expiry = $wgLang->formatExpiry( $row->pt_expiry );
+               $expiry = strlen( $row->pt_expiry ) ? $wgLang->formatExpiry( 
$row->pt_expiry, TS_MW ) : $infinity;
+               if( $expiry != $infinity ) {
 
                        $expiry_description = wfMsg( 'protect-expiring', 
$wgLang->timeanddate( $expiry ) , $wgLang->date( $expiry ) , $wgLang->time( 
$expiry ) );
 
-                       $description_items[] = $expiry_description;
+                       $description_items[] = 
htmlspecialchars($expiry_description);
                }
 
                wfProfileOut( __METHOD__ );


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to