#42280 [Opn-Bgs]: Change in file upload behavior
ID: 42280 User updated by: chris at dented-planet dot net Reported By: chris at dented-planet dot net -Status: Open +Status: Bogus Bug Type: *General Issues Operating System: Mac OS X 10.4.10 PHP Version: 5.2.4RC1 New Comment: There is no bug here. Only someone who doesn't completely understand how to compile source code. I was reusing the same source download over and over switching between --enable-debug and --disable-debug. While I rm'd config.cache, I didn't remove other generated files in the source directory. I assumed they'd be overwritten. Once I downloaded a virgin source code for 5.2.3, the bug no longer occurred. Sorry! That being said, can you suggest a good book on learning and compiling C? I think it's about time I learn a bit more so this doesn't happen again. Previous Comments: [2007-08-12 22:45:49] chris at dented-planet dot net I compiled each version myself from source downloaded from php.net I used the --disable-debug config setting and phpinfo() says Debug Build No [2007-08-12 22:16:38] [EMAIL PROTECTED] Are you absolutely sure you do NOT have a debug build? (check from phpinfo() output..) I can't see any way in sources for the error to be '5' if you really aren't using a debug build. It's only possible if you have patched the sources.. [2007-08-12 21:30:06] chris at dented-planet dot net Description: I don't know if this is considered a bug there there has been a change in behavior in the File Upload handling when uploading a zero-length file. The change happened after PHP 5.2.2 and is in 5.2.4RC1 as well. Note: I am not using a debug build. Reproduce code: --- Use this code to upload a zero-length file (I used Firefox 1.5.x): !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en-US head/head body form method=post action=?php echo $_SERVER['PHP_SELF'] ? enctype=multipart/form-data input type=file name=upload_file / br / input type=submit name=submit value=Submit / /form br / pre ?php var_dump($_FILES); ? /pre /body /html Expected result: In PHP 5.2.2, the output of var_dump($_FILES) is: array(1) { [upload_file]= array(5) { [name]= string(9) empty.txt [type]= string(10) text/plain [tmp_name]= string(18) /var/tmp/phpLAvnSB [error]= int(0) [size]= int(0) } } In PHP 5.2.3 and later it is: array(1) { [upload_file]= array(5) { [name]= string(9) empty.txt [type]= string(0) [tmp_name]= string(0) [error]= int(5) [size]= int(0) } } Especially, notice the change in error. -- Edit this bug report at http://bugs.php.net/?id=42280edit=1
#42280 [NEW]: Change in File Upload Behavior
From: chris at dented-planet dot net Operating system: Mac OS X 10.4.10 PHP version: 5.2.4RC1 PHP Bug Type: Unknown/Other Function Bug description: Change in File Upload Behavior Description: I don't know if this is considered a bug there there has been a change in behavior in the File Upload handling when uploading a zero-length file. The change happened after PHP 5.2.2 and is in 5.2.4RC1 as well. Note: I am not using a debug build. Reproduce code: --- Use this code to upload a zero-length file (I used Firefox 1.5.x): !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en-US head/head body form method=post action=?php echo $_SERVER['PHP_SELF'] ? enctype=multipart/form-data input type=file name=upload_file / br / input type=submit name=submit value=Submit / /form br / pre ?php var_dump($_FILES); ? /pre /body /html Expected result: In PHP 5.2.2, the output of var_dump($_FILES) is: array(1) { [upload_file]= array(5) { [name]= string(9) empty.txt [type]= string(10) text/plain [tmp_name]= string(18) /var/tmp/phpLAvnSB [error]= int(0) [size]= int(0) } } In PHP 5.2.3 and later it is: array(1) { [upload_file]= array(5) { [name]= string(9) empty.txt [type]= string(0) [tmp_name]= string(0) [error]= int(5) [size]= int(0) } } Especially, notice the change in error. -- Edit bug report at http://bugs.php.net/?id=42280edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=42280r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=42280r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=42280r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=42280r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=42280r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=42280r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=42280r=needscript Try newer version:http://bugs.php.net/fix.php?id=42280r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=42280r=support Expected behavior:http://bugs.php.net/fix.php?id=42280r=notwrong Not enough info: http://bugs.php.net/fix.php?id=42280r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=42280r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=42280r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42280r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=42280r=dst IIS Stability:http://bugs.php.net/fix.php?id=42280r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=42280r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=42280r=float No Zend Extensions: http://bugs.php.net/fix.php?id=42280r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=42280r=mysqlcfg
#42280 [Fbk-Opn]: Change in file upload behavior
ID: 42280 User updated by: chris at dented-planet dot net Reported By: chris at dented-planet dot net -Status: Feedback +Status: Open Bug Type: *General Issues Operating System: Mac OS X 10.4.10 PHP Version: 5.2.4RC1 New Comment: I compiled each version myself from source downloaded from php.net I used the --disable-debug config setting and phpinfo() says Debug Build No Previous Comments: [2007-08-12 22:16:38] [EMAIL PROTECTED] Are you absolutely sure you do NOT have a debug build? (check from phpinfo() output..) I can't see any way in sources for the error to be '5' if you really aren't using a debug build. It's only possible if you have patched the sources.. [2007-08-12 21:30:06] chris at dented-planet dot net Description: I don't know if this is considered a bug there there has been a change in behavior in the File Upload handling when uploading a zero-length file. The change happened after PHP 5.2.2 and is in 5.2.4RC1 as well. Note: I am not using a debug build. Reproduce code: --- Use this code to upload a zero-length file (I used Firefox 1.5.x): !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd; html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en-US head/head body form method=post action=?php echo $_SERVER['PHP_SELF'] ? enctype=multipart/form-data input type=file name=upload_file / br / input type=submit name=submit value=Submit / /form br / pre ?php var_dump($_FILES); ? /pre /body /html Expected result: In PHP 5.2.2, the output of var_dump($_FILES) is: array(1) { [upload_file]= array(5) { [name]= string(9) empty.txt [type]= string(10) text/plain [tmp_name]= string(18) /var/tmp/phpLAvnSB [error]= int(0) [size]= int(0) } } In PHP 5.2.3 and later it is: array(1) { [upload_file]= array(5) { [name]= string(9) empty.txt [type]= string(0) [tmp_name]= string(0) [error]= int(5) [size]= int(0) } } Especially, notice the change in error. -- Edit this bug report at http://bugs.php.net/?id=42280edit=1
#41716 [NEW]: Need Clarification About New htmlentities() Param
From: chris at dented-planet dot net Operating system: Mac OS 10.4.9 PHP version: 5.2.3 PHP Bug Type: Unknown/Other Function Bug description: Need Clarification About New htmlentities() Param Description: I just need a clarification about the new $double_encode param for htmlentities() and htmlspecialchars(). Is it supposed to do as I expect it to do in the code below or am I misuderstanding its use? Reproduce code: --- // Output: lt; echo htmlentities('', ENT_QUOTES, false); // Expected Output: lt; // Actual Output: amp;lt; echo htmlentities(htmlentities('', ENT_QUOTES, false), ENT_QUOTES, false); -- Edit bug report at http://bugs.php.net/?id=41716edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41716r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41716r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41716r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=41716r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=41716r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=41716r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=41716r=needscript Try newer version:http://bugs.php.net/fix.php?id=41716r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=41716r=support Expected behavior:http://bugs.php.net/fix.php?id=41716r=notwrong Not enough info: http://bugs.php.net/fix.php?id=41716r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=41716r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=41716r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41716r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=41716r=dst IIS Stability:http://bugs.php.net/fix.php?id=41716r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=41716r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=41716r=float No Zend Extensions: http://bugs.php.net/fix.php?id=41716r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=41716r=mysqlcfg
#41716 [Opn]: Need Clarification About New htmlentities() Param
ID: 41716 User updated by: chris at dented-planet dot net Reported By: chris at dented-planet dot net Status: Open Bug Type: Unknown/Other Function Operating System: Mac OS 10.4.9 PHP Version: 5.2.3 New Comment: BTW I wouldn't actually use such code. I did it only to achieve that I think of as double encoding:) Previous Comments: [2007-06-16 23:32:46] chris at dented-planet dot net Description: I just need a clarification about the new $double_encode param for htmlentities() and htmlspecialchars(). Is it supposed to do as I expect it to do in the code below or am I misuderstanding its use? Reproduce code: --- // Output: lt; echo htmlentities('', ENT_QUOTES, false); // Expected Output: lt; // Actual Output: amp;lt; echo htmlentities(htmlentities('', ENT_QUOTES, false), ENT_QUOTES, false); -- Edit this bug report at http://bugs.php.net/?id=41716edit=1
#41383 [NEW]: Function in 'required' File doesn't Appear to Exist
From: chris at dented-planet dot net Operating system: Mac OS X PHP version: 5.2.2 PHP Bug Type: Unknown/Other Function Bug description: Function in 'required' File doesn't Appear to Exist Description: The documentation on functions (http://www.php.net/manual/en/language.functions.php) says: In PHP 3, functions must be defined before they are referenced. No such requirement exists since PHP 4. Except when a function is conditionally defined... I don't understand why the following code (in three different files BTW) doesn't work as expected. It doesn't seem to be conditionally defined. Tested with PHP 4.4.4-CLI, PHP 5.2.1, PHP 5.2.2. I am openminded that this may not be a bug but I can't seem to find an explanation. Reproduce code: --- FILE a.php: ?php error_reporting(E_ALL | E_NOTICE); echo FILE 'a.php'\n; if (function_exists('test')) { echo test(); } else { echo function 'test()' doesn't exist!\n; } require 'b.php'; ? -- FILE b.php ?php echo FILE 'b.php'\n; require 'c.php'; ? -- FILE c.php ?php echo FILE 'c.php'\n; function test() { return function test() was called!\n; } ? Expected result: SIGNIFICANT expected result: 'function test() was called!' is echoed. Other output is for debugging. Actual result: -- Actual result: 'function 'test()' doesn't exist!' is echoed. -- Edit bug report at http://bugs.php.net/?id=41383edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41383r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41383r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41383r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=41383r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=41383r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=41383r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=41383r=needscript Try newer version:http://bugs.php.net/fix.php?id=41383r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=41383r=support Expected behavior:http://bugs.php.net/fix.php?id=41383r=notwrong Not enough info: http://bugs.php.net/fix.php?id=41383r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=41383r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=41383r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41383r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=41383r=dst IIS Stability:http://bugs.php.net/fix.php?id=41383r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=41383r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=41383r=float No Zend Extensions: http://bugs.php.net/fix.php?id=41383r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=41383r=mysqlcfg
#41383 [Opn]: Function in 'required' File doesn't Appear to Exist
ID: 41383 User updated by: chris at dented-planet dot net Reported By: chris at dented-planet dot net Status: Open Bug Type: Unknown/Other Function Operating System: Mac OS X PHP Version: 5.2.2 New Comment: Okay, it was explained to me why this doesn't work. That's why I said that it might not be a bug. It isn't a bug, indeed. The only thing that is buggy is my ability to read the documentaion more thoroughly. Case Closed Previous Comments: [2007-05-13 10:38:59] chris at dented-planet dot net Description: The documentation on functions (http://www.php.net/manual/en/language.functions.php) says: In PHP 3, functions must be defined before they are referenced. No such requirement exists since PHP 4. Except when a function is conditionally defined... I don't understand why the following code (in three different files BTW) doesn't work as expected. It doesn't seem to be conditionally defined. Tested with PHP 4.4.4-CLI, PHP 5.2.1, PHP 5.2.2. I am openminded that this may not be a bug but I can't seem to find an explanation. Reproduce code: --- FILE a.php: ?php error_reporting(E_ALL | E_NOTICE); echo FILE 'a.php'\n; if (function_exists('test')) { echo test(); } else { echo function 'test()' doesn't exist!\n; } require 'b.php'; ? -- FILE b.php ?php echo FILE 'b.php'\n; require 'c.php'; ? -- FILE c.php ?php echo FILE 'c.php'\n; function test() { return function test() was called!\n; } ? Expected result: SIGNIFICANT expected result: 'function test() was called!' is echoed. Other output is for debugging. Actual result: -- Actual result: 'function 'test()' doesn't exist!' is echoed. -- Edit this bug report at http://bugs.php.net/?id=41383edit=1
#40608 [Com]: break within foreach causes strange behaviour
ID: 40608 Comment by: chris at dented-planet dot net Reported By: eric dot broersma at phil dot uu dot nl Status: No Feedback Bug Type: Arrays related Operating System: Sun Solaris PHP Version: 5.2.1 New Comment: I can reproduce this with PHP-CLI 5.2.1 on Mac OS X 10.4.9 Intel. Previous Comments: [2007-03-31 01:00:01] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to Open. [2007-03-23 07:53:12] [EMAIL PROTECTED] I cannot reproduce this on Gentoo with 5.2.1 [2007-03-20 16:40:30] [EMAIL PROTECTED] I wasn't feeling spunky enough to mark the bug closed, though... figured I'd better leave that to the real PHP devs... [2007-03-20 16:35:58] [EMAIL PROTECTED] My bad... pretending to be a dev myself there, by selecting the Quick Fix option to notify the original bug submitter (and all readers) about the snapshot option. [2007-03-19 20:48:54] [EMAIL PROTECTED] Are you asking yourself to try fresh snapshot? Or did you click wrong link? The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/40608 -- Edit this bug report at http://bugs.php.net/?id=40608edit=1
#39652 [NEW]: memory_get_usage() Bug
From: chris at dented-planet dot net Operating system: Mac OS X 10.4.8 PHP version: 5.2.0 PHP Bug Type: Unknown/Other Function Bug description: memory_get_usage() Bug Description: I don't know if it's utf8_encode() or memory_get_usage() in the following script that might be causing the issue. But rather quickly in the loop, memory_get_usage() begins to report a steadily decreasing amount of memory used until it drops into negative values. A graph of usage is at: http://dented-planet.net/graph.png 'memory_limit' is set to 100MB in php.ini. I know this isn't the best possible bug report, but I'm not sure how else to report it. Reproduce code: --- ?php $x = ''; for ($i = 1; $i = 2; $i++) { $x = utf8_encode('this is a test'); if ($i % 100 === 0) { echo $i . ' ' . memory_get_usage() . ' ' . memory_get_usage(true) . \n; } } ? -- Edit bug report at http://bugs.php.net/?id=39652edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39652r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39652r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39652r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39652r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39652r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39652r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=39652r=needscript Try newer version:http://bugs.php.net/fix.php?id=39652r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39652r=support Expected behavior:http://bugs.php.net/fix.php?id=39652r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39652r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39652r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39652r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39652r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39652r=dst IIS Stability:http://bugs.php.net/fix.php?id=39652r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39652r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39652r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39652r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=39652r=mysqlcfg
#36872 [NEW]: session_destroy() fails after call to session_regenerate_id()
From: chris at dented-planet dot net Operating system: mac os x 10.3.9 PHP version: 5.1.2 PHP Bug Type: Session related Bug description: session_destroy() fails after call to session_regenerate_id() Description: Calling session_destroy() after call to session_regenerate_id() results in the failed session destruction and the following warning: Warning: session_destroy() [function.session-destroy]: Session object destruction failed... If I remove the call to session_regenerate() then session_destroy() works correctly. Reproduce code: --- ?php ob_start() session_start(); //some code session_regenerate_id(true); //some code session_destroy(); ob_end_flush(); ? Expected result: Session should be destroyed Actual result: -- Warning: session_destroy() [function.session-destroy]: Session object destruction failed... -- Edit bug report at http://bugs.php.net/?id=36872edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36872r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36872r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36872r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=36872r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=36872r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=36872r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=36872r=needscript Try newer version:http://bugs.php.net/fix.php?id=36872r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=36872r=support Expected behavior:http://bugs.php.net/fix.php?id=36872r=notwrong Not enough info: http://bugs.php.net/fix.php?id=36872r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=36872r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=36872r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36872r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=36872r=dst IIS Stability:http://bugs.php.net/fix.php?id=36872r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=36872r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=36872r=float No Zend Extensions: http://bugs.php.net/fix.php?id=36872r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=36872r=mysqlcfg