Anomie has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/209333

Change subject: ApiCentralAuthToken: Use ApiBase::lacksSameOriginSecurity()
......................................................................

ApiCentralAuthToken: Use ApiBase::lacksSameOriginSecurity()

In the future there might be more things to check than just 'callback',
so Ic6e3483f added a method to ApiBase to abstract the check.

Change-Id: Ibae7bcbd42ed38c77460199398a8304cca4d0161
---
M includes/api/ApiCentralAuthToken.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/33/209333/1

diff --git a/includes/api/ApiCentralAuthToken.php 
b/includes/api/ApiCentralAuthToken.php
index e07adcf..dc0127b 100644
--- a/includes/api/ApiCentralAuthToken.php
+++ b/includes/api/ApiCentralAuthToken.php
@@ -38,7 +38,7 @@
                $params = $this->extractRequestParams();
 
                // If we're in JSON callback mode, no tokens can be obtained
-               if ( !is_null( $this->getMain()->getRequest()->getVal( 
'callback' ) ) ) {
+               if ( $this->lacksSameOriginSecurity() ) {
                        $this->dieUsage( 'Cannot obtain a centralauthtoken when 
using a callback', 'hascallback' );
                }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/209333
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibae7bcbd42ed38c77460199398a8304cca4d0161
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Anomie <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to