From e5b8bf49420fd9f0b11d8594cd0ff4a353c513e7 Mon Sep 17 00:00:00 2001 From: Erik Bernhardson Date: Tue, 17 Jan 2017 16:48:59 -0800 Subject: 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 --- includes/api/ApiUpload.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'includes/api/ApiUpload.php') 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', -- cgit v1.2.3