From 0c6dedb907850b125403dfd779515646692ddc0f Mon Sep 17 00:00:00 2001 From: Rotem Liss Date: Tue, 2 Aug 2011 11:43:26 +0000 Subject: [PATCH] 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. --- includes/specials/SpecialProtectedtitles.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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__ ); -- 2.20.1