Bail out in ApiStashEdit for bots for sanity
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 26 May 2016 19:04:22 +0000 (12:04 -0700)
committerOri.livneh <ori@wikimedia.org>
Thu, 26 May 2016 19:59:16 +0000 (19:59 +0000)
checkCache() is disabled in this case anyway.

Change-Id: I1c18585eecc1a7c4c0e24546799c7ee448b3ea57

includes/api/ApiStashEdit.php

index ce254c9..40aa4d4 100644 (file)
@@ -46,6 +46,10 @@ class ApiStashEdit extends ApiBase {
                $user = $this->getUser();
                $params = $this->extractRequestParams();
 
+               if ( $user->isBot() ) { // sanity
+                       $this->dieUsage( 'This interface is not supported for bots', 'botsnotsupported' );
+               }
+
                $page = $this->getTitleOrPageId( $params );
                $title = $page->getTitle();