X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiUpload.php;h=54294c9cb70b45dd71bd5aafac681ba61076d75b;hb=f8ab4e5ffee1cfb53da38d3dffcd37ffe4e2abbc;hp=78a497144f119e937003b5aff7ecb122a3b52970;hpb=4ac9dbee4a1c0688da6dfa91e8c6419c1bd16f69;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index 78a497144f..54294c9cb7 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -514,20 +514,20 @@ class ApiUpload extends ApiBase { 'filetype' => $verification['finalExt'], 'allowed' => array_values( array_unique( $this->getConfig()->get( 'FileExtensions' ) ) ) ); - $this->getResult()->setIndexedTagName( $extradata['allowed'], 'ext' ); + ApiResult::setIndexedTagName( $extradata['allowed'], 'ext' ); $msg = "Filetype not permitted: "; if ( isset( $verification['blacklistedExt'] ) ) { $msg .= join( ', ', $verification['blacklistedExt'] ); $extradata['blacklisted'] = array_values( $verification['blacklistedExt'] ); - $this->getResult()->setIndexedTagName( $extradata['blacklisted'], 'ext' ); + ApiResult::setIndexedTagName( $extradata['blacklisted'], 'ext' ); } else { $msg .= $verification['finalExt']; } $this->dieUsage( $msg, 'filetype-banned', 0, $extradata ); break; case UploadBase::VERIFICATION_ERROR: - $this->getResult()->setIndexedTagName( $verification['details'], 'detail' ); + ApiResult::setIndexedTagName( $verification['details'], 'detail' ); $this->dieUsage( 'This file did not pass file verification', 'verification-error', 0, array( 'details' => $verification['details'] ) ); break; @@ -559,7 +559,7 @@ class ApiUpload extends ApiBase { if ( $warnings ) { // Add indices $result = $this->getResult(); - $result->setIndexedTagName( $warnings, 'warning' ); + ApiResult::setIndexedTagName( $warnings, 'warning' ); if ( isset( $warnings['duplicate'] ) ) { $dupes = array(); @@ -567,7 +567,7 @@ class ApiUpload extends ApiBase { foreach ( $warnings['duplicate'] as $dupe ) { $dupes[] = $dupe->getName(); } - $result->setIndexedTagName( $dupes, 'duplicate' ); + ApiResult::setIndexedTagName( $dupes, 'duplicate' ); $warnings['duplicate'] = $dupes; } @@ -696,7 +696,7 @@ class ApiUpload extends ApiBase { ); } - $this->getResult()->setIndexedTagName( $error, 'error' ); + ApiResult::setIndexedTagName( $error, 'error' ); $this->dieUsage( 'An internal error occurred', 'internal-error', 0, $error ); } $result['result'] = 'Success'; @@ -735,7 +735,9 @@ class ApiUpload extends ApiBase { 'comment' => array( ApiBase::PARAM_DFLT => '' ), - 'text' => null, + 'text' => array( + ApiBase::PARAM_TYPE => 'text', + ), 'watch' => array( ApiBase::PARAM_DFLT => false, ApiBase::PARAM_DEPRECATED => true,