In the query to find only protected pages, ApiQueryAllPages includes a
clause to make sure it doesn't find expired protections. But it doesn't
take into account the possibility that the protection might be an old
infinite protection where the expiry is represented as NULL instead of
'infinity'.
Note this may not close the whole bug; that remains to be determined.
Bug: 33304
Change-Id: If85591986a19bf78f7d56ad60d251fbc450ac451
* (bug 44244) prop=info may now return the number of people watching each page.
* (bug 33304) list=allpages will no longer return duplicate entries when
querying protection.
+* (bug 33304) list=allpages will now find really old indefinite protections.
=== API internal changes in 1.21 ===
* For debugging only, a new global $wgDebugAPI removes many API restrictions when true.
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'] );