php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #42422 File Upload Behavior with E_STRICT error_reporting
Submitted: 2007-08-25 11:30 UTC Modified: 2018-03-10 22:30 UTC
Votes:1
Avg. Score:1.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: edman007 at edman007 dot com Assigned: cmb (profile)
Status: Closed Package: *General Issues
PHP Version: 5.2.4RC3 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: edman007 at edman007 dot com
New email:
PHP Version: OS:

 

 [2007-08-25 11:30 UTC] edman007 at edman007 dot com
Description:
------------
When error_reporting is set to E_STRICT PHP will throw a notice if a file was not uploaded, this causes problems when developing a website with optional file upload.

The actual problem is detailed in bug #6747 but that was closed saying its "expected behaviour". However if this is expected behavior then why it it not listed anywhere in the documentation except for the set_error_handler() docs where it ways your basically SOL when it comes to this error (and it mentions no other similar error), the docs on uploading files make no mention of this error either.

The fact is this does cause problems when developing a website, in the comments for the other bug there are multiple people requesting its removal suggesting there is in fact a problem. In my particular case the error broke the HTML on the page and prevented cookies, and the proper fix is "Just set your error_reporting level."?

E_STRICT exists so it can be used, what good is it when the correct usage of something (in this case an upload form) throws and error that cannot be caught? When I don't fill out a text field it sends an empty field to the server, under the same logic wouldn't that mean that an error should be thrown when I leave any field blank?

This error should be completely removed, what it is providing is not only already listed in $_FILES but the error is thrown when nothing is wrong and completely caused by user input and nothing else (the code in the file is irrelevant). If not removed then there should at the very least be some method to avoid the error, it appears to be the only non-fatal error that cannot be caught or suppressed, this needs to be fixed.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-08-25 11:32 UTC] edman007 at edman007 dot com
sorry, the bug mentioned is suppose to be bug #16747
 [2011-04-08 21:35 UTC] jani@php.net
-Package: Feature/Change Request +Package: *General Issues
 [2018-03-10 22:30 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2018-03-10 22:30 UTC] cmb@php.net
Apparently, you used a *debug* build of PHP – otherwise there
would have no error as of PHP 5.0.0[1].  Anyhow, as of PHP 7.1.0
there won't be any error even on debug builds, unless explictly
requested[2].

[1] <http://git.php.net/?p=php-src.git;a=commit;h=fe576c7acb71763b63a8bd289a0c56d7da2f290a>
[2] <http://git.php.net/?p=php-src.git;a=commit;h=37b0dcc8e01085e5a93b0dfcf79f8e87bcb9c3fe>
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Thu Dec 13 19:01:27 2018 UTC