From: Sam Reed Date: Tue, 19 Jan 2010 17:23:31 +0000 (+0000) Subject: Move position of $prlevel array stripping, and check isset X-Git-Tag: 1.31.0-rc.0~38201 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=8cb4dda772cc892ca08d6486899019f78becb610;p=lhc%2Fweb%2Fwiklou.git Move position of $prlevel array stripping, and check isset action=query&list=allpages&apfrom=B&apprtype=edit Gave Warning: array_diff() [function.array-diff]: Argument #1 is not an array in /home/reedy/mediawiki/trunk/phase3/includes/api/ApiQueryAllpages.php on line 99 --- diff --git a/includes/api/ApiQueryAllpages.php b/includes/api/ApiQueryAllpages.php index 39bc360d53..4f8fe40dca 100644 --- a/includes/api/ApiQueryAllpages.php +++ b/includes/api/ApiQueryAllpages.php @@ -95,10 +95,13 @@ class ApiQueryAllpages extends ApiQueryGeneratorBase { $this->addWhere( 'pr_expiry>' . $db->addQuotes( $db->timestamp() ) ); $this->addWhereFld( 'pr_type', $params['prtype'] ); - // Remove the empty string and '*' from the prlevel array - $prlevel = array_diff( $params['prlevel'], array( '', '*' ) ); - if ( !empty( $prlevel ) ) - $this->addWhereFld( 'pr_level', $prlevel ); + if ( isset ( $params['prlevel'] ) ) { + // Remove the empty string and '*' from the prlevel array + $prlevel = array_diff( $params['prlevel'], array( '', '*' ) ); + + if ( !empty( $prlevel ) ) + $this->addWhereFld( 'pr_level', $prlevel ); + } if ( $params['prfiltercascade'] == 'cascading' ) $this->addWhereFld( 'pr_cascade', 1 ); else if ( $params['prfiltercascade'] == 'noncascading' )