From: Rotem Liss Date: Tue, 2 Aug 2011 11:43:26 +0000 (+0000) Subject: Fixing Special:Protectedtitles to match Special:Protectedpages. This prevents an... X-Git-Tag: 1.31.0-rc.0~28495 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=0c6dedb907850b125403dfd779515646692ddc0f;p=lhc%2Fweb%2Fwiklou.git 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. --- diff --git a/includes/specials/SpecialProtectedtitles.php b/includes/specials/SpecialProtectedtitles.php index dfe356ea87..5fb91af7a6 100644 --- a/includes/specials/SpecialProtectedtitles.php +++ b/includes/specials/SpecialProtectedtitles.php @@ -78,10 +78,12 @@ class SpecialProtectedtitles extends SpecialPage { 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 @@ class SpecialProtectedtitles extends SpecialPage { $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__ );