Req #42422 [Opn->Csd]: File Upload Behavior with E_STRICT error_reporting
| From: | cmb@php.net | Date: | Sat, 10 Mar 2018 22:30:20 +0000 |
| Subject: | Req #42422 [Opn->Csd]: File Upload Behavior with E_STRICT error_reporting | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-214280@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=42422&edit=1
ID: 42422
Updated by: cmb@php.net
Reported by: edman007 at edman007 dot com
Summary: File Upload Behavior with E_STRICT error_reporting
-Status: Open
+Status: Closed
Type: Feature/Change Request
Package: *General Issues
Operating System: Linux
PHP Version: 5.2.4RC3
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
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>
Previous Comments:
------------------------------------------------------------------------
[2007-08-25 11:32:22] edman007 at edman007 dot com
sorry, the bug mentioned is suppose to be bug #16747
------------------------------------------------------------------------
[2007-08-25 11:30:33] 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.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=42422&edit=1