Aude has uploaded a new change for review.
https://gerrit.wikimedia.org/r/119770
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
(cherry picked from commit a9edd2029e76c0a34a809aa4b730ecebe6affe91)
---
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/70/119770/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/119770
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: mw1.23-wmf19
Gerrit-Owner: Aude <[email protected]>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits