X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryAllPages.php;h=d718b9673f6408df7c947b8283961a6355dd72fe;hb=493b766fdb99ef03efc1db3cd500af07b408a00a;hp=b180572bf858ddcc905a199731c7e8438d8f0173;hpb=529b809c6908f49f5d89daace0d8778dac7cf550;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryAllPages.php b/includes/api/ApiQueryAllPages.php index b180572bf8..d718b9673f 100644 --- a/includes/api/ApiQueryAllPages.php +++ b/includes/api/ApiQueryAllPages.php @@ -117,7 +117,7 @@ class ApiQueryAllPages extends ApiQueryGeneratorBase { if ( count( $params['prtype'] ) || $params['prexpiry'] != 'all' ) { $this->addTables( 'page_restrictions' ); $this->addWhere( 'page_id=pr_page' ); - $this->addWhere( 'pr_expiry>' . $db->addQuotes( $db->timestamp() ) ); + $this->addWhere( "pr_expiry > {$db->addQuotes( $db->timestamp() )} OR pr_expiry IS NULL" ); if ( count( $params['prtype'] ) ) { $this->addWhereFld( 'pr_type', $params['prtype'] ); @@ -135,8 +135,6 @@ class ApiQueryAllPages extends ApiQueryGeneratorBase { } elseif ( $params['prfiltercascade'] == 'noncascading' ) { $this->addWhereFld( 'pr_cascade', 0 ); } - - $this->addOption( 'DISTINCT' ); } $forceNameTitleIndex = false; @@ -146,6 +144,8 @@ class ApiQueryAllPages extends ApiQueryGeneratorBase { $this->addWhere( "pr_expiry != {$db->addQuotes( $db->getInfinity() )}" ); } + $this->addOption( 'DISTINCT' ); + } elseif ( isset( $params['prlevel'] ) ) { $this->dieUsage( 'prlevel may not be used without prtype', 'params' ); } @@ -347,7 +347,7 @@ class ApiQueryAllPages extends ApiQueryGeneratorBase { 'Show info about 4 pages starting at the letter "T"', ), 'api.php?action=query&generator=allpages&gaplimit=2&gapfilterredir=nonredirects&gapfrom=Re&prop=revisions&rvprop=content' => array( - 'Show content of first 2 non-redirect pages begining at "Re"', + 'Show content of first 2 non-redirect pages beginning at "Re"', ) ); } @@ -355,8 +355,4 @@ class ApiQueryAllPages extends ApiQueryGeneratorBase { public function getHelpUrls() { return 'https://www.mediawiki.org/wiki/API:Allpages'; } - - public function getVersion() { - return __CLASS__ . ': $Id$'; - } }