X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryAllPages.php;h=5cf0c0b7b26ebf65e09f8a92aa5b42a71e3fadf4;hb=c8543fe0bffafec21f2d2774ecc25cdfdcd44c84;hp=0c6692a3e75db8351c6c51c47917e7cadad52d2c;hpb=c8ddc2ab37639803ff5987b57179e4967d33063d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryAllPages.php b/includes/api/ApiQueryAllPages.php index 0c6692a3e7..5cf0c0b7b2 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' ); }