jenkins-bot has submitted this change and it was merged.

Change subject: Improve wiki ID field validation due to SiteConfiguration 
oddness
......................................................................


Improve wiki ID field validation due to SiteConfiguration oddness

bug: 55580
Change-Id: I983f6be38aaa0c11cc1de48caefaa379a8bd03ce
---
M control/MWOAuthConsumerAcceptanceSubmitControl.php
M control/MWOAuthConsumerSubmitControl.php
2 files changed, 4 insertions(+), 2 deletions(-)

Approvals:
  Anomie: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/control/MWOAuthConsumerAcceptanceSubmitControl.php 
b/control/MWOAuthConsumerAcceptanceSubmitControl.php
index 1500e81..58a9582 100644
--- a/control/MWOAuthConsumerAcceptanceSubmitControl.php
+++ b/control/MWOAuthConsumerAcceptanceSubmitControl.php
@@ -50,7 +50,8 @@
                        'update'   => array(
                                'acceptanceId' => '/^\d+$/',
                                'wiki'        => function( $s ) {
-                                       return WikiMap::getWiki( $s ) || $s === 
'*'; },
+                                       global $wgConf;
+                                       return in_array( $s, 
$wgConf->getLocalDatabases() ) || $s === '*'; },
                                'grants'      => function( $s ) {
                                        $grants = FormatJSON::decode( $s, true 
);
                                        return is_array( $grants ) && 
MWOAuthUtils::grantsAreValid( $grants );
diff --git a/control/MWOAuthConsumerSubmitControl.php 
b/control/MWOAuthConsumerSubmitControl.php
index 0d0f788..d49e550 100644
--- a/control/MWOAuthConsumerSubmitControl.php
+++ b/control/MWOAuthConsumerSubmitControl.php
@@ -67,7 +67,8 @@
                                'email'        => function( $s ) {
                                        return Sanitizer::validateEmail( $s ); 
},
                                'wiki'         => function( $s ) {
-                                       return WikiMap::getWiki( $s ) || $s === 
'*'; },
+                                       global $wgConf;
+                                       return in_array( $s, 
$wgConf->getLocalDatabases() ) || $s === '*'; },
                                'grants'       => function( $s ) {
                                        $grants = FormatJSON::decode( $s, true 
);
                                        return is_array( $grants ) && 
MWOAuthUtils::grantsAreValid( $grants );

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I983f6be38aaa0c11cc1de48caefaa379a8bd03ce
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to