Aaron Schulz has uploaded a new change for review.
https://gerrit.wikimedia.org/r/89101
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(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OAuth
refs/changes/01/89101/1
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: newchange
Gerrit-Change-Id: I983f6be38aaa0c11cc1de48caefaa379a8bd03ce
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/OAuth
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits