aboutsummaryrefslogtreecommitdiffstats
path: root/includes/api/ApiUpload.php
diff options
context:
space:
mode:
authorErik Bernhardson <ebernhardson@wikimedia.org>2017-01-17 16:48:59 -0800
committerErik Bernhardson <ebernhardson@wikimedia.org>2017-01-18 13:07:39 -0800
commite5b8bf49420fd9f0b11d8594cd0ff4a353c513e7 (patch)
tree783f3a4ddb391b03c85307f1a310c5c9cbb5e18a /includes/api/ApiUpload.php
parentf4ed4cd93907bd4ff0fd3490daaad5ce7bbbba28 (diff)
downloadmediawikicore-e5b8bf49420fd9f0b11d8594cd0ff4a353c513e7.tar.gz
mediawikicore-e5b8bf49420fd9f0b11d8594cd0ff4a353c513e7.zip
Un-blacklist PhanUndeclaredVariable
Undeclared variables are a very common error type that we want to catch as often as possible. To avoid needing to refactor a variety of global level code (mostly in old-style maintenance scripts) this ignores undeclared variables in global scope. This is still a good improvement over what was happening previously. Change-Id: I50b41d571724244552074b9408abbdf6160aca59
Diffstat (limited to 'includes/api/ApiUpload.php')
-rw-r--r--includes/api/ApiUpload.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php
index f8213740644c..6b38302c8fc1 100644
--- a/includes/api/ApiUpload.php
+++ b/includes/api/ApiUpload.php
@@ -637,7 +637,8 @@ class ApiUpload extends ApiBase {
break;
case UploadBase::HOOK_ABORTED:
- $this->dieWithError( $params, 'hookaborted', [ 'details' => $verification['error'] ] );
+ $msg = $verification['error'] === '' ? 'hookaborted' : $verification['error'];
+ $this->dieWithError( $msg, 'hookaborted', [ 'details' => $verification['error'] ] );
break;
default:
$this->dieWithError( 'apierror-unknownerror-nocode', 'unknown-error',