Index: trunk/phase3/includes/upload/UploadFromUrl.php |
— | — | @@ -62,11 +62,6 @@ |
63 | 63 | * @param $request Object: WebRequest object |
64 | 64 | */ |
65 | 65 | public function initializeFromRequest( &$request ) { |
66 | | - |
67 | | - // set dl mode if not set: |
68 | | - if( !$this->dl_mode ) |
69 | | - $this->dl_mode = Http::SYNC_DOWNLOAD; |
70 | | - |
71 | 66 | $desiredDestName = $request->getText( 'wpDestFile' ); |
72 | 67 | if( !$desiredDestName ) |
73 | 68 | $desiredDestName = $request->getText( 'wpUploadFile' ); |
Index: trunk/phase3/includes/upload/UploadBase.php |
— | — | @@ -18,6 +18,7 @@ |
19 | 19 | protected $mDesiredDestName, $mDestName, $mRemoveTempFile, $mSourceType; |
20 | 20 | protected $mTitle = false, $mTitleError = 0; |
21 | 21 | protected $mFilteredName, $mFinalExtension; |
| 22 | + protected $mLocalFile; |
22 | 23 | |
23 | 24 | const SUCCESS = 0; |
24 | 25 | const OK = 0; |
— | — | @@ -175,17 +176,19 @@ |
176 | 177 | if( $verification !== true ) { |
177 | 178 | if( !is_array( $verification ) ) |
178 | 179 | $verification = array( $verification ); |
179 | | - $verification['status'] = self::VERIFICATION_ERROR; |
180 | | - return $verification; |
| 180 | + return array( 'status' => self::VERIFICATION_ERROR, |
| 181 | + 'details' => $verification ); |
| 182 | + |
181 | 183 | } |
182 | 184 | |
183 | 185 | $error = ''; |
184 | 186 | if( !wfRunHooks( 'UploadVerification', |
185 | 187 | array( $this->mDestName, $this->mTempPath, &$error ) ) ) { |
| 188 | + // This status needs another name... |
186 | 189 | return array( 'status' => self::UPLOAD_VERIFICATION_ERROR, 'error' => $error ); |
187 | 190 | } |
188 | 191 | |
189 | | - return self::OK; |
| 192 | + return array( 'status' => self::OK ); |
190 | 193 | } |
191 | 194 | |
192 | 195 | /** |
— | — | @@ -202,7 +205,7 @@ |
203 | 206 | |
204 | 207 | #magically determine mime type |
205 | 208 | $magic = MimeMagic::singleton(); |
206 | | - $mime = $magic->guessMimeType( $this->mTempFile, false ); |
| 209 | + $mime = $magic->guessMimeType( $this->mTempPath, false ); |
207 | 210 | |
208 | 211 | #check mime type, if desired |
209 | 212 | global $wgVerifyMimeType; |
— | — | @@ -212,11 +215,11 @@ |
213 | 216 | return array( 'filetype-badmime', $mime ); |
214 | 217 | |
215 | 218 | # Check IE type |
216 | | - $fp = fopen( $this->mTempFile, 'rb' ); |
| 219 | + $fp = fopen( $this->mTempPath, 'rb' ); |
217 | 220 | $chunk = fread( $fp, 256 ); |
218 | 221 | fclose( $fp ); |
219 | 222 | $extMime = $magic->guessTypesForExtension( $this->mFinalExtension ); |
220 | | - $ieTypes = $magic->getIEMimeTypes( $tmpfile, $chunk, $extMime ); |
| 223 | + $ieTypes = $magic->getIEMimeTypes( $this->mTempPath, $chunk, $extMime ); |
221 | 224 | foreach ( $ieTypes as $ieType ) { |
222 | 225 | if ( $this->checkFileExtension( $ieType, $wgMimeTypeBlacklist ) ) { |
223 | 226 | return array( 'filetype-bad-ie-mime', $ieType ); |
— | — | @@ -225,11 +228,11 @@ |
226 | 229 | } |
227 | 230 | |
228 | 231 | #check for htmlish code and javascript |
229 | | - if( self::detectScript( $tmpfile, $mime, $this->mFinalExtension ) ) { |
| 232 | + if( self::detectScript( $this->mTempPath, $mime, $this->mFinalExtension ) ) { |
230 | 233 | return 'uploadscripted'; |
231 | 234 | } |
232 | 235 | if( $this->mFinalExtension == 'svg' || $mime == 'image/svg+xml' ) { |
233 | | - if( self::detectScriptInSvg( $tmpfile ) ) { |
| 236 | + if( self::detectScriptInSvg( $this->mTempPath ) ) { |
234 | 237 | return 'uploadscripted'; |
235 | 238 | } |
236 | 239 | } |
— | — | @@ -237,7 +240,7 @@ |
238 | 241 | /** |
239 | 242 | * Scan the uploaded file for viruses |
240 | 243 | */ |
241 | | - $virus = $this->detectVirus( $tmpfile ); |
| 244 | + $virus = $this->detectVirus( $this->mTempPath ); |
242 | 245 | if ( $virus ) { |
243 | 246 | return array( 'uploadvirus', $virus ); |
244 | 247 | } |
Index: trunk/phase3/includes/upload/UploadFromChunks.php |
— | — | @@ -79,7 +79,7 @@ |
80 | 80 | function verifyUpload() { |
81 | 81 | // no checks on chunk upload mode: |
82 | 82 | if( $this->chunk_mode == UploadFromChunks::INIT ) |
83 | | - return self::OK; |
| 83 | + return array( 'status' => self::OK ); |
84 | 84 | |
85 | 85 | // verify on init and last chunk request |
86 | 86 | if( $this->chunk_mode == UploadFromChunks::CHUNK || |
Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -2348,6 +2348,8 @@ |
2349 | 2349 | /** |
2350 | 2350 | * Executes a shell command in the background. Passes back the PID of the operation |
2351 | 2351 | * |
| 2352 | + * FIXME: Does not work on Windows; does not work at all (See CodeReview r55575) |
| 2353 | + * |
2352 | 2354 | * @param $cmd String |
2353 | 2355 | */ |
2354 | 2356 | function wfShellBackgroundExec( $cmd ){ |
Index: trunk/phase3/includes/api/ApiBase.php |
— | — | @@ -862,7 +862,8 @@ |
863 | 863 | 'undo-failure' => array('code' => 'undofailure', 'info' => 'Undo failed due to conflicting intermediate edits'), |
864 | 864 | |
865 | 865 | //uploadMsgs |
866 | | - 'invalid-session-key' => array( 'code' => 'invalid-session-key', 'info'=>'Not a valid session key' ), |
| 866 | + 'invalid-session-key' => array( 'code' => 'invalid-session-key', 'info' => 'Not a valid session key' ), |
| 867 | + 'nouploadmodule' => array( 'code' => 'nouploadmodule', 'info' => 'No upload module set' ), |
867 | 868 | ); |
868 | 869 | |
869 | 870 | /** |
Index: trunk/phase3/includes/api/ApiUpload.php |
— | — | @@ -30,7 +30,8 @@ |
31 | 31 | * @ingroup API |
32 | 32 | */ |
33 | 33 | class ApiUpload extends ApiBase { |
34 | | - var $mUpload = null; |
| 34 | + protected $mUpload = null; |
| 35 | + protected $mParams; |
35 | 36 | |
36 | 37 | public function __construct( $main, $action ) { |
37 | 38 | parent::__construct( $main, $action ); |
— | — | @@ -44,9 +45,9 @@ |
45 | 46 | $request = $this->getMain()->getRequest(); |
46 | 47 | |
47 | 48 | // do token checks: |
48 | | - if( is_null( $this->mParams['token'] ) ) |
| 49 | + if ( is_null( $this->mParams['token'] ) ) |
49 | 50 | $this->dieUsageMsg( array( 'missingparam', 'token' ) ); |
50 | | - if( !$wgUser->matchEditToken( $this->mParams['token'] ) ) |
| 51 | + if ( !$wgUser->matchEditToken( $this->mParams['token'] ) ) |
51 | 52 | $this->dieUsageMsg( array( 'sessionfailure' ) ); |
52 | 53 | |
53 | 54 | |
— | — | @@ -54,24 +55,23 @@ |
55 | 56 | $this->mParams['file'] = $request->getFileName( 'file' ); |
56 | 57 | |
57 | 58 | // Check whether upload is enabled |
58 | | - if( !UploadBase::isEnabled() ) |
| 59 | + if ( !UploadBase::isEnabled() ) |
59 | 60 | $this->dieUsageMsg( array( 'uploaddisabled' ) ); |
60 | 61 | |
61 | | - wfDebug( __METHOD__ . "running require param\n" ); |
62 | 62 | // One and only one of the following parameters is needed |
63 | 63 | $this->requireOnlyOneParameter( $this->mParams, |
64 | 64 | 'sessionkey', 'file', 'url', 'enablechunks' ); |
65 | 65 | |
66 | | - if( $this->mParams['enablechunks'] ){ |
| 66 | + if ( $this->mParams['enablechunks'] ) { |
67 | 67 | // chunks upload enabled |
68 | 68 | $this->mUpload = new UploadFromChunks(); |
69 | | - $this->mUpload->initializeFromParams( $this->mParams, $request ); |
| 69 | + $status = $this->mUpload->initializeFromParams( $this->mParams, $request ); |
70 | 70 | |
71 | | - //if getAPIresult did not exit report the status error: |
72 | | - if( isset( $this->mUpload->status['error'] ) ) |
73 | | - $this->dieUsageMsg( $this->mUpload->status['error'] ); |
| 71 | + if( isset( $status['error'] ) ) |
| 72 | + $this->dieUsageMsg( $status['error'] ); |
74 | 73 | |
75 | | - } else if( $this->mParams['internalhttpsession'] ){ |
| 74 | + } elseif ( $this->mParams['internalhttpsession'] ) { |
| 75 | + // TODO: Move to subclass |
76 | 76 | $sd = & $_SESSION['wsDownload'][ $this->mParams['internalhttpsession'] ]; |
77 | 77 | |
78 | 78 | wfDebug("InternalHTTP:: " . print_r($this->mParams, true)); |
— | — | @@ -83,56 +83,60 @@ |
84 | 84 | filesize( $sd['target_file_path'] ) |
85 | 85 | ); |
86 | 86 | |
87 | | - if( !isset( $this->mUpload ) ) |
88 | | - $this->dieUsage( 'No upload module set', 'nomodule' ); |
89 | | - |
90 | | - } else if( $this->mParams['httpstatus'] && $this->mParams['sessionkey'] ){ |
| 87 | + } elseif ( $this->mParams['httpstatus'] && $this->mParams['sessionkey'] ) { |
91 | 88 | // return the status of the given upload session_key: |
92 | | - if( !isset( $_SESSION['wsDownload'][ $this->mParams['sessionkey'] ] ) ){ |
| 89 | + |
| 90 | + // Check the session key |
| 91 | + if( !isset( $_SESSION['wsDownload'][$this->mParams['sessionkey']] ) ) |
93 | 92 | return $this->dieUsageMsg( array( 'invalid-session-key' ) ); |
94 | | - } |
95 | | - $sd = & $_SESSION['wsDownload'][$this->mParams['sessionkey']]; |
| 93 | + |
| 94 | + $sd =& $_SESSION['wsDownload'][$this->mParams['sessionkey']]; |
96 | 95 | // keep passing down the upload sessionkey |
97 | 96 | $statusResult = array( |
98 | 97 | 'upload_session_key' => $this->mParams['sessionkey'] |
99 | 98 | ); |
100 | 99 | |
101 | 100 | // put values into the final apiResult if available |
102 | | - if( isset( $sd['apiUploadResult'] ) ) $statusResult['apiUploadResult'] = $sd['apiUploadResult']; |
103 | | - if( isset( $sd['loaded'] ) ) $statusResult['loaded'] = $sd['loaded']; |
104 | | - if( isset( $sd['content_length'] ) ) $statusResult['content_length'] = $sd['content_length']; |
| 101 | + if( isset( $sd['apiUploadResult'] ) ) |
| 102 | + $statusResult['apiUploadResult'] = $sd['apiUploadResult']; |
| 103 | + if( isset( $sd['loaded'] ) ) |
| 104 | + $statusResult['loaded'] = $sd['loaded']; |
| 105 | + if( isset( $sd['content_length'] ) ) |
| 106 | + $statusResult['content_length'] = $sd['content_length']; |
105 | 107 | |
106 | | - return $this->getResult()->addValue( null, $this->getModuleName(), |
107 | | - $statusResult |
108 | | - ); |
| 108 | + return $this->getResult()->addValue( null, |
| 109 | + $this->getModuleName(), $statusResult); |
| 110 | + |
109 | 111 | } else if( $this->mParams['sessionkey'] ) { |
110 | 112 | // Stashed upload |
111 | 113 | $this->mUpload = new UploadFromStash(); |
112 | | - $this->mUpload->initialize( $this->mParams['filename'], $_SESSION['wsUploadData'][$this->mParams['sessionkey']] ); |
| 114 | + $this->mUpload->initialize( $this->mParams['filename'], |
| 115 | + $_SESSION['wsUploadData'][$this->mParams['sessionkey']] ); |
113 | 116 | } else { |
114 | 117 | // Upload from url or file |
115 | 118 | // Parameter filename is required |
116 | | - if( !isset( $this->mParams['filename'] ) ) |
| 119 | + if ( !isset( $this->mParams['filename'] ) ) |
117 | 120 | $this->dieUsageMsg( array( 'missingparam', 'filename' ) ); |
118 | 121 | |
119 | 122 | // Initialize $this->mUpload |
120 | | - if( isset( $this->mParams['file'] ) ) { |
| 123 | + if ( isset( $this->mParams['file'] ) ) { |
121 | 124 | $this->mUpload = new UploadFromFile(); |
122 | 125 | $this->mUpload->initialize( |
123 | 126 | $request->getFileName( 'file' ), |
124 | 127 | $request->getFileTempName( 'file' ), |
125 | 128 | $request->getFileSize( 'file' ) |
126 | 129 | ); |
127 | | - } elseif( isset( $this->mParams['url'] ) ) { |
128 | | - |
| 130 | + } elseif ( isset( $this->mParams['url'] ) ) { |
129 | 131 | $this->mUpload = new UploadFromUrl(); |
130 | | - $this->mUpload->initialize( $this->mParams['filename'], $this->mParams['url'], $this->mParams['asyncdownload'] ); |
| 132 | + $this->mUpload->initialize( $this->mParams['filename'], |
| 133 | + $this->mParams['url'], $this->mParams['asyncdownload'] ); |
131 | 134 | |
132 | 135 | $status = $this->mUpload->fetchFile(); |
133 | 136 | if( !$status->isOK() ){ |
134 | 137 | return $this->dieUsage( 'fetchfileerror', $status->getWikiText() ); |
135 | 138 | } |
136 | | - //check if we doing a async request set session info and return the upload_session_key) |
| 139 | + |
| 140 | + // check if we doing a async request set session info and return the upload_session_key) |
137 | 141 | if( $this->mUpload->isAsync() ){ |
138 | 142 | $upload_session_key = $status->value; |
139 | 143 | // update the session with anything with the params we will need to finish up the upload later on: |
— | — | @@ -159,7 +163,7 @@ |
160 | 164 | $this->doExecUpload(); |
161 | 165 | } |
162 | 166 | |
163 | | - function doExecUpload(){ |
| 167 | + protected function doExecUpload(){ |
164 | 168 | global $wgUser; |
165 | 169 | // Check whether the user has the appropriate permissions to upload anyway |
166 | 170 | $permission = $this->mUpload->isAllowed( $wgUser ); |
— | — | @@ -177,57 +181,55 @@ |
178 | 182 | $this->getResult()->addValue( null, $this->getModuleName(), $result ); |
179 | 183 | } |
180 | 184 | |
181 | | - private function performUpload() { |
| 185 | + protected function performUpload() { |
182 | 186 | global $wgUser; |
183 | 187 | $result = array(); |
184 | | - $resultDetails = null; |
185 | 188 | $permErrors = $this->mUpload->verifyPermissions( $wgUser ); |
186 | 189 | if( $permErrors !== true ) { |
187 | | - $result['result'] = 'Failure'; |
188 | | - $result['error'] = 'permission-denied'; |
189 | | - return $result; |
| 190 | + $this->dieUsageMsg( array( 'baddaccess-groups' ) ); |
190 | 191 | } |
191 | | - $verification = $this->mUpload->verifyUpload( $resultDetails ); |
192 | | - if( $verification != UploadBase::OK ) { |
| 192 | + |
| 193 | + // TODO: Move them to ApiBase's message map |
| 194 | + $verification = $this->mUpload->verifyUpload(); |
| 195 | + if( $verification['status'] !== UploadBase::OK ) { |
193 | 196 | $result['result'] = 'Failure'; |
194 | | - switch( $verification ) { |
| 197 | + switch( $verification['status'] ) { |
195 | 198 | case UploadBase::EMPTY_FILE: |
196 | | - $result['error'] = 'empty-file'; |
| 199 | + $this->dieUsage( 'The file you submitted was empty', 'empty-file' ); |
197 | 200 | break; |
198 | 201 | case UploadBase::FILETYPE_MISSING: |
199 | | - $result['error'] = 'filetype-missing'; |
| 202 | + $this->dieUsage( 'The file is missing an extension', 'filetype-missing' ); |
200 | 203 | break; |
201 | 204 | case UploadBase::FILETYPE_BADTYPE: |
202 | 205 | global $wgFileExtensions; |
203 | | - $result['error'] = 'filetype-banned'; |
204 | | - $result['filetype'] = $resultDetails['finalExt']; |
205 | | - $result['allowed-filetypes'] = $wgFileExtensions; |
| 206 | + $this->dieUsage( 'This type of file is banned', 'filetype-banned', |
| 207 | + 0, array( |
| 208 | + 'filetype' => $verification['finalExt'], |
| 209 | + 'allowed' => $wgFileExtensions |
| 210 | + ) ); |
206 | 211 | break; |
207 | 212 | case UploadBase::MIN_LENGHT_PARTNAME: |
208 | | - $result['error'] = 'filename-tooshort'; |
| 213 | + $this->dieUsage( 'The filename is too short', 'filename-tooshort' ); |
209 | 214 | break; |
210 | 215 | case UploadBase::ILLEGAL_FILENAME: |
211 | | - $result['error'] = 'illegal-filename'; |
212 | | - $result['filename'] = $resultDetails['filtered']; |
| 216 | + $this->dieUsage( 'The filename is not allowed', 'illegal-filename', |
| 217 | + 0, array( 'filename' => $verification['filtered'] ) ); |
213 | 218 | break; |
214 | 219 | case UploadBase::OVERWRITE_EXISTING_FILE: |
215 | | - $result['error'] = 'overwrite'; |
| 220 | + $this->dieUsage( 'Overwriting an existing file is not allowed', 'overwrite' ); |
216 | 221 | break; |
217 | 222 | case UploadBase::VERIFICATION_ERROR: |
218 | | - $result['error'] = 'verification-error'; |
219 | | - $args = $resultDetails['veri']; |
220 | | - $code = array_shift( $args ); |
221 | | - $result['verification-error'] = $code; |
222 | | - $result['args'] = $args; |
223 | | - $this->getResult()->setIndexedTagName( $result['args'], 'arg' ); |
| 223 | + $this->getResult()->setIndexedTagName( $verification['details'], 'detail' ); |
| 224 | + $this->dieUsage( 'This file did not pass file verification', 'verification-error', |
| 225 | + 0, array( 'details' => $verification['details'] ) ); |
224 | 226 | break; |
225 | 227 | case UploadBase::UPLOAD_VERIFICATION_ERROR: |
226 | | - $result['error'] = 'upload-verification-error'; |
227 | | - $result['upload-verification-error'] = $resultDetails['error']; |
| 228 | + $this->dieUsage( "The modification you tried to make was aborted by an extension hook", |
| 229 | + 'hookaborted', 0, array( 'error' => $verification['error'] ) ); |
228 | 230 | break; |
229 | 231 | default: |
230 | | - $result['error'] = 'unknown-error'; |
231 | | - $result['code'] = $verification; |
| 232 | + $this->dieUsage( 'An unknown error occurred', 'unknown-error', |
| 233 | + 0, array( 'code' => $verification['status'] ) ); |
232 | 234 | break; |
233 | 235 | } |
234 | 236 | return $result; |
— | — | @@ -236,36 +238,39 @@ |
237 | 239 | if( !$this->mParams['ignorewarnings'] ) { |
238 | 240 | $warnings = $this->mUpload->checkWarnings(); |
239 | 241 | if( $warnings ) { |
| 242 | + |
| 243 | + // Add indices |
240 | 244 | $this->getResult()->setIndexedTagName( $warnings, 'warning' ); |
241 | | - //also add index to duplicate: |
242 | | - if(isset($warnings['duplicate'])) |
| 245 | + |
| 246 | + if( isset( $warnings['duplicate'] ) ) |
243 | 247 | $this->getResult()->setIndexedTagName( $warnings['duplicate'], 'duplicate'); |
244 | 248 | |
245 | | - if(isset($warnings['exists'])) |
246 | | - $this->getResult()->setIndexedTagName( $warnings['exists'], 'exists'); |
247 | | - |
| 249 | + if( isset( $warnings['exists'] ) ) |
| 250 | + $this->getResult()->setIndexedTagName( $warnings['exists'], 'exists' ); |
| 251 | + |
| 252 | + if( isset( $warnings['filewasdeleted'] ) ) |
| 253 | + $warnings['filewasdeleted'] = $warnings['filewasdeleted']->getDBkey(); |
| 254 | + |
248 | 255 | $result['result'] = 'Warning'; |
249 | 256 | $result['warnings'] = $warnings; |
250 | | - if( isset( $result['filewasdeleted'] ) ) |
251 | | - $result['filewasdeleted'] = $result['filewasdeleted']->getDBkey(); |
252 | 257 | |
253 | 258 | $sessionKey = $this->mUpload->stashSession(); |
254 | | - if( $sessionKey ) |
255 | | - $result['sessionkey'] = $sessionKey; |
| 259 | + if ( !$sessionKey ) |
| 260 | + $this->dieUsage( 'Stashing temporary file failed', 'stashfailed' ); |
| 261 | + $result['sessionkey'] = $sessionKey; |
256 | 262 | return $result; |
257 | 263 | } |
258 | 264 | } |
259 | 265 | |
260 | | - // do the upload |
| 266 | + // No errors, no warnings: do the upload |
261 | 267 | $status = $this->mUpload->performUpload( $this->mParams['comment'], |
262 | 268 | $this->mParams['comment'], $this->mParams['watch'], $wgUser ); |
263 | 269 | |
264 | 270 | if( !$status->isGood() ) { |
265 | | - $result['result'] = 'Failure'; |
266 | | - $result['error'] = 'internal-error'; |
267 | | - $result['details'] = $status->getErrorsArray(); |
| 271 | + $error = $status->getErrorsArray(); |
268 | 272 | $this->getResult()->setIndexedTagName( $result['details'], 'error' ); |
269 | | - return $result; |
| 273 | + |
| 274 | + $this->dieUsage( 'An internal error occurred', 'internal-error', 0, $error ); |
270 | 275 | } |
271 | 276 | |
272 | 277 | $file = $this->mUpload->getLocalFile(); |
— | — | @@ -277,10 +282,8 @@ |
278 | 283 | //get all the image properties: |
279 | 284 | $imParam = ApiQueryImageInfo::getPropertyNames(); |
280 | 285 | $result['imageinfo'] = ApiQueryImageInfo::getInfo( $file, |
281 | | - array_flip( $imParam ), |
282 | | - $this->getResult() ); |
| 286 | + array_flip( $imParam ), $this->getResult() ); |
283 | 287 | |
284 | | - |
285 | 288 | return $result; |
286 | 289 | } |
287 | 290 | |
— | — | @@ -307,7 +310,7 @@ |
308 | 311 | 'chunk' => null, |
309 | 312 | 'done' => false, |
310 | 313 | 'url' => null, |
311 | | - 'asyncdownload' => false, |
| 314 | + /*'asyncdownload' => false,*/ // btongminh: Disabled pending fixing wfShellBackgroundExec |
312 | 315 | 'httpstatus' => false, |
313 | 316 | 'sessionkey' => null, |
314 | 317 | 'internalhttpsession' => null, |
Index: trunk/phase3/includes/specials/SpecialUpload.php |
— | — | @@ -226,8 +226,8 @@ |
227 | 227 | |
228 | 228 | case UploadBase::VERIFICATION_ERROR: |
229 | 229 | unset( $details['status'] ); |
230 | | - $code = array_shift( $details ); |
231 | | - $this->uploadError( wfMsgExt( $code, 'parseinline', $details ) ); |
| 230 | + $code = array_shift( $details['details'] ); |
| 231 | + $this->uploadError( wfMsgExt( $code, 'parseinline', $details['details'] ) ); |
232 | 232 | break; |
233 | 233 | |
234 | 234 | case UploadBase::UPLOAD_VERIFICATION_ERROR: |
— | — | @@ -284,7 +284,7 @@ |
285 | 285 | |
286 | 286 | // Check whether this is a sane upload |
287 | 287 | $result = $this->mUpload->verifyUpload(); |
288 | | - if( $result != UploadBase::OK ) |
| 288 | + if( $result['status'] != UploadBase::OK ) |
289 | 289 | return $result; |
290 | 290 | |
291 | 291 | $this->mLocalFile = $this->mUpload->getLocalFile(); |