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