X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiQueryUsers.php;h=52636ccdd62f8d570217be008b89319e7fd3e125;hb=2086cd118020f6388d7b6952ac2d9e2b55e6ef1f;hp=db8cc1c81922c9067db397a5af12702410c512e8;hpb=c39aefd439a4479cd9ef780c90e27db118e63e07;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiQueryUsers.php b/includes/api/ApiQueryUsers.php index db8cc1c819..52636ccdd6 100644 --- a/includes/api/ApiQueryUsers.php +++ b/includes/api/ApiQueryUsers.php @@ -67,15 +67,16 @@ class ApiQueryUsers extends ApiQueryBase { return $this->tokenFunctions; } - // If we're in JSON callback mode, no tokens can be obtained - if ( !is_null( $this->getMain()->getRequest()->getVal( 'callback' ) ) ) { + // If we're in a mode that breaks the same-origin policy, no tokens can + // be obtained + if ( $this->lacksSameOriginSecurity() ) { return array(); } $this->tokenFunctions = array( 'userrights' => array( 'ApiQueryUsers', 'getUserrightsToken' ), ); - wfRunHooks( 'APIQueryUsersTokens', array( &$this->tokenFunctions ) ); + Hooks::run( 'APIQueryUsersTokens', array( &$this->tokenFunctions ) ); return $this->tokenFunctions; }