File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
src/Symfony/Component/HttpFoundation/File Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -252,7 +252,7 @@ public function move($directory, $name = null)
252
252
return $ target ;
253
253
}
254
254
255
- throw new FileException ($ this ->getErrorMessage ($ this -> getError () ));
255
+ throw new FileException ($ this ->getErrorMessage ());
256
256
}
257
257
258
258
/**
@@ -281,11 +281,9 @@ public static function getMaxFilesize()
281
281
/**
282
282
* Returns an informative upload error message.
283
283
*
284
- * @param int $code The error code returned by an upload attempt
285
- *
286
284
* @return string The error message regarding the specified error code
287
285
*/
288
- private function getErrorMessage ($ errorCode )
286
+ public function getErrorMessage ()
289
287
{
290
288
static $ errors = array (
291
289
UPLOAD_ERR_INI_SIZE => 'The file "%s" exceeds your upload_max_filesize ini directive (limit is %d kb). ' ,
@@ -297,6 +295,7 @@ private function getErrorMessage($errorCode)
297
295
UPLOAD_ERR_EXTENSION => 'File upload was stopped by a php extension. ' ,
298
296
);
299
297
298
+ $ errorCode = $ this ->error ;
300
299
$ maxFilesize = $ errorCode === UPLOAD_ERR_INI_SIZE ? self ::getMaxFilesize () / 1024 : 0 ;
301
300
$ message = isset ($ errors [$ errorCode ]) ? $ errors [$ errorCode ] : 'The file "%s" was not uploaded due to an unknown error. ' ;
302
301
You can’t perform that action at this time.
0 commit comments