Un-blacklist PhanUndeclaredVariable
[lhc/web/wiklou.git] / includes / api / ApiUpload.php
index 311fa54..6b38302 100644 (file)
@@ -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',
@@ -719,7 +720,7 @@ class ApiUpload extends ApiBase {
         * @return StatusValue
         */
        protected function handleStashException( $e ) {
-               switch ( get_class( $exception ) ) {
+               switch ( get_class( $e ) ) {
                        case 'UploadStashFileNotFoundException':
                                $wrap = 'apierror-stashedfilenotfound';
                                break;