Merge "tooltip-ca-edit: Simplify wording to align with others"
[lhc/web/wiklou.git] / includes / specials / SpecialProtectedtitles.php
index d25c2c8..85ce78f 100644 (file)
@@ -38,11 +38,6 @@ class SpecialProtectedtitles extends SpecialPage {
                $this->setHeaders();
                $this->outputHeader();
 
-               // Purge expired entries on one in every 10 queries
-               if ( !mt_rand( 0, 10 ) ) {
-                       Title::purgeExpiredRestrictions();
-               }
-
                $request = $this->getRequest();
                $type = $request->getVal( $this->IdType );
                $level = $request->getVal( $this->IdLevel );
@@ -72,16 +67,8 @@ class SpecialProtectedtitles extends SpecialPage {
         * @return string
         */
        function formatRow( $row ) {
-
-               static $infinity = null;
-
-               if ( is_null( $infinity ) ) {
-                       $infinity = wfGetDB( DB_SLAVE )->getInfinity();
-               }
-
                $title = Title::makeTitleSafe( $row->pt_namespace, $row->pt_title );
                if ( !$title ) {
-
                        return Html::rawElement(
                                'li',
                                array(),
@@ -105,9 +92,9 @@ class SpecialProtectedtitles extends SpecialPage {
                $lang = $this->getLanguage();
                $expiry = strlen( $row->pt_expiry ) ?
                        $lang->formatExpiry( $row->pt_expiry, TS_MW ) :
-                       $infinity;
+                       'infinity';
 
-               if ( $expiry != $infinity ) {
+               if ( $expiry !== 'infinity' ) {
                        $user = $this->getUser();
                        $description_items[] = $this->msg(
                                'protect-expiring-local',
@@ -252,7 +239,8 @@ class ProtectedTitlesPager extends AlphabeticPager {
         */
        function getQueryInfo() {
                $conds = $this->mConds;
-               $conds[] = 'pt_expiry>' . $this->mDb->addQuotes( $this->mDb->timestamp() );
+               $conds[] = 'pt_expiry > ' . $this->mDb->addQuotes( $this->mDb->timestamp() ) .
+                       ' OR pt_expiry IS NULL';
                if ( $this->level ) {
                        $conds['pt_create_perm'] = $this->level;
                }