Thiemo Mättig (WMDE) has uploaded a new change for review.
https://gerrit.wikimedia.org/r/119533
Change subject: Don't trigger warning if "bot" parameter is missing in API
request
......................................................................
Don't trigger warning if "bot" parameter is missing in API request
I don't think it's required to always have the "bot" parameter set
in the request. It could be "0", empty or simply not exist. All
other parameters are optional, so shouldn't this one too? The
inline documentation doesn't say it's required.
For some strange reason this triggers "Undefined index" errors in a
completely unrelated patch. I didn't spent time on deeper
investigation since I think this is a proper solution.
Change-Id: Ie0650ebe41a328f0576e304c67a7c1f852a0e72b
---
M repo/includes/api/ApiWikibase.php
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/33/119533/1
diff --git a/repo/includes/api/ApiWikibase.php
b/repo/includes/api/ApiWikibase.php
index 81db295..10dc42c 100644
--- a/repo/includes/api/ApiWikibase.php
+++ b/repo/includes/api/ApiWikibase.php
@@ -477,7 +477,8 @@
$params = $this->extractRequestParams();
$user = $this->getUser();
- $flags |= ( $user->isAllowed( 'bot' ) && $params['bot'] ) ?
EDIT_FORCE_BOT : 0;
+ $bot = isset( $params['bot'] ) ? $params['bot'] : false;
+ $flags |= ( $bot && $user->isAllowed( 'bot' ) ) ?
EDIT_FORCE_BOT : 0;
$baseRevisionId = isset( $params['baserevid'] ) ? intval(
$params['baserevid'] ) : null;
$baseRevisionId = $baseRevisionId > 0 ? $baseRevisionId : false;
--
To view, visit https://gerrit.wikimedia.org/r/119533
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie0650ebe41a328f0576e304c67a7c1f852a0e72b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Thiemo Mättig (WMDE) <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits