X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryInfo.php;h=b05c75c379fc10cc53b8fa406b8e325f2a6c29f9;hb=be5cc8d84656ab2e536a3b51f3d1656beb19e8d3;hp=eee5daef65b0ce0cc9fb8537217f7e4d1876e0bf;hpb=b2faab0991a16b3102c8167bdb3147699f3b86fb;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index eee5daef65..b05c75c379 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'; }