[wp-trac] [WordPress Trac] #8310: Wrong error messages while uploading

WordPress Trac wp-trac at lists.automattic.com
Fri Nov 21 20:22:00 GMT 2008


#8310: Wrong error messages while uploading
----------------------+-----------------------------------------------------
 Reporter:  sekundek  |       Owner:     
     Type:  defect    |      Status:  new
 Priority:  normal    |   Milestone:  2.7
Component:  Upload    |     Version:  2.7
 Severity:  normal    |    Keywords:     
----------------------+-----------------------------------------------------
 While dealing with random upload error i found that listed error messages
 were not set as it should. If you check the manual
 http://www.php.net/manual/en/features.file-upload.errors.php you can see
 that index error code 5 is missing. Because of that in my case wrong error
 was printed. On error code 6 message was "Failed to write file to disk"
 but the real error was "Missing a temporary folder". This needs to be
 corrected, because it missleads when error is printed to client. Error
 messages are listed in wp-admin/includes/file.php at row 234 and later at
 340

 It can be corrected with

 {{{
 $upload_error_strings = array( false,
                 __( "The uploaded file exceeds the
 <code>upload_max_filesize</code> directive in <code>php.ini</code>." ),
                 __( "The uploaded file exceeds the <em>MAX_FILE_SIZE</em>
 directive that was specified in the HTML form." ),
                 __( "The uploaded file was only partially uploaded." ),
                 __( "No file was uploaded." ),
                '',
                 __( "Missing a temporary folder." ),
                 __( "Failed to write file to disk." ));

 }}}

 Problem with random upload was actually with XCache. When I disabled it
 error was gone.

-- 
Ticket URL: <http://trac.wordpress.org/ticket/8310>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list