diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2015-12-17 09:15:42 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2015-12-17 09:44:51 +0100 |
commit | a1789ddde42033f1b05cc4929491214ee6e79383 (patch) | |
tree | 63615735c4ddffaaabf2428946bb26f90899f7bf /includes/api/ApiQueryInfo.php | |
parent | 9e06a62f265e3a2aaabecc598d4bc617e06fa32d (diff) |
Update to MediaWiki 1.26.0
Diffstat (limited to 'includes/api/ApiQueryInfo.php')
-rw-r--r-- | includes/api/ApiQueryInfo.php | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index 66178d4f..b05c75c3 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -37,7 +37,7 @@ class ApiQueryInfo extends ApiQueryBase { $fld_notificationtimestamp = false, $fld_preload = false, $fld_displaytitle = false; - private $params, $titles, $missing, $everything, $pageCounter; + private $params, $titles, $missing, $everything; private $pageRestrictions, $pageIsRedir, $pageIsNew, $pageTouched, $pageLatest, $pageLength; @@ -799,6 +799,7 @@ class ApiQueryInfo extends ApiQueryBase { } public function getCacheMode( $params ) { + // Other props depend on something about the current user $publicProps = array( 'protection', 'talkid', @@ -807,13 +808,15 @@ class ApiQueryInfo extends ApiQueryBase { 'preload', 'displaytitle', ); - if ( !is_null( $params['prop'] ) ) { - foreach ( $params['prop'] as $prop ) { - if ( !in_array( $prop, $publicProps ) ) { - return 'private'; - } - } + if ( array_diff( (array)$params['prop'], $publicProps ) ) { + return 'private'; } + + // testactions also depends on the current user + if ( $params['testactions'] ) { + return 'private'; + } + if ( !is_null( $params['token'] ) ) { return 'private'; } @@ -868,6 +871,6 @@ class ApiQueryInfo extends ApiQueryBase { } public function getHelpUrls() { - return 'https://www.mediawiki.org/wiki/API:Properties#info_.2F_in'; + return 'https://www.mediawiki.org/wiki/API:Info'; } } |