Followup r86763, and also fix ancient revision from SpecialProtectedpages (Aaron...
authorSam Reed <reedy@users.mediawiki.org>
Sat, 23 Apr 2011 14:24:42 +0000 (14:24 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sat, 23 Apr 2011 14:24:42 +0000 (14:24 +0000)
includes/api/ApiQueryAllpages.php
includes/specials/SpecialProtectedpages.php

index 7136778..eeb4b83 100644 (file)
@@ -138,9 +138,9 @@ class ApiQueryAllpages extends ApiQueryGeneratorBase {
                        $forceNameTitleIndex = false;
 
                        if ( $params['prexpiry'] == 'indefinite' ) {
-                               $this->addWhere( "pr_expiry = 'infinity' OR pr_expiry IS NULL" );
+                               $this->addWhere( "pr_expiry = {$db->addQuotes( $db->getInfinity() )} OR pr_expiry IS NULL" );
                        } elseif ( $params['prexpiry'] == 'definite' ) {
-                               $this->addWhere( "pr_expiry != 'infinity'" );
+                               $this->addWhere( "pr_expiry != {$db->addQuotes( $db->getInfinity() )}" );
                        }
 
                } elseif ( isset( $params['prlevel'] ) ) {
index 5039dfd..a67b7e2 100644 (file)
@@ -337,7 +337,8 @@ class ProtectedPagesPager extends AlphabeticPager {
                }
 
                if( $this->indefonly ) {
-                       $conds[] = "pr_expiry = 'infinity' OR pr_expiry IS NULL";
+                       $db = wfGetDB( DB_SLAVE );
+                       $conds[] = "pr_expiry = {$db->addQuotes( $db->getInfinity() )} OR pr_expiry IS NULL";
                }
                if( $this->cascadeonly ) {
                        $conds[] = "pr_cascade = '1'";