Req #38917 [Com]: OpenSSL: signing function for spkac
Edit report at https://bugs.php.net/bug.php?id=38917edit=1 ID: 38917 Comment by: jason dot gerfen at gmail dot com Reported by:zeph at purotesto dot it Summary:OpenSSL: signing function for spkac Status: Feedback Type: Feature/Change Request Package:OpenSSL related Operating System: Irrilevant PHP Version:trunk Block user comment: N Private report: N New Comment: Once again, please disregard the last message. After researching the documentation I found that where I had been using NULL with the openssl_csr_sign() function allows for a CA option as well as the SPKAC addition to the configargs optional array. The patch was updated last night to include the 026.phpt test script, as well as the five new functions to work with the SPKI provided by keygen tags. How do patch inclusions work besides posting them to the php internals list? Previous Comments: [2011-12-14 22:10:52] jason dot gerfen at gmail dot com Please disregard my previous comment. I did a little more digging and am under the impression that adding the following to php_openssl_make_REQ() function should allow me to create a self signed certificate using the SPKAC NID like so? if (strcmp(strindex, SPKAC) == 0) { if (!X509_NAME_add_entry_by_txt(subj, strindex, MBSTRING_ASC, (unsigned char*)Z_STRVAL_PP(item), -1, -1, 0)){ php_error_docref(NULL TSRMLS_CC, E_WARNING, dn: add_entry_by_txt %s - %s (failed), strindex, Z_STRVAL_PP(item)); return FAILURE; } } Would you recommend another method? Please advise. [2011-12-14 19:40:20] jason dot gerfen at gmail dot com One other question about using SPKAC's when creating a x509. It seems the current method using openssl_csr_new() which in turn calls the php_openssl_make_REQ() to assign the specified DN attributes has no method of adding the SPKAC field. After digging around it seems logical to use the OBJ_create() and OBJ_* family of functions to add NID. Please forgive me if I am way off here but any direction you could point me in using the existing functions to output and sign a certificate similar to the following command? openssl ca -config /path/to/openssl.conf -days 180 -notext -batch \ -spkac /path/to/cert.pem -out /path/to/signed.pem -passin pass:'random' My assumption is that I will need to create one specifically for this purpose but would like your insight. [2011-12-14 13:51:42] jason dot gerfen at gmail dot com This will test all five new functions unless you would like one test case per function? --TEST-- openssl_spki_new(), openssl_spki_verify(), openssl_spki_export(), openssl_spki_export_challenge(), openssl_spki_details() --SKIPIF-- ?php if (!extension_loaded(openssl)) die(skip); if (!@openssl_pkey_new()) die(skip cannot create private key); ? --FILE-- ?php echo Creating private key\n; $key = openssl_pkey_new(); if ($key === false) die(failed to create private key\n); echo Creating new SPKAC\n; if (!function_exists(openssl_spki_new)) die(openssl_spki_new() does not exist\n); $spki = openssl_spki_new($key, sample_challenge_string); if ($spki === false) die(could not create spkac\n); echo Verifying SPKAC\n; if (!function_exists(openssl_spki_verify)) die(openssl_spki_verify() does not exist\n); $x = openssl_spki_verify(preg_replace(/SPKAC=/, , $spki)); if ($x === false) die(could not verify spkac\n); echo Exporting challenge\n; if (!function_exists(openssl_spki_export_challenge)) die(openssl_spki_export_challenge() does not exist\n); $y = openssl_spki_export_challenge(preg_replace(/SPKAC=/, , $spki)); if ($y !== sample_challenge_string) die(could not verify challenge string from spkac\n); echo Exporting public key from SPKAC\n; if (!function_exists(openssl_spki_export)) die(openssl_spki_export() does not exist\n); $z = openssl_spki_export(preg_replace(/SPKAC=/, '', $spki)); if ($z === ) die(could not export public key from spkac\n); echo Generating details of SPKAC structure\n; if (!function_exists(openssl_spki_details)) die(openssl_spki_details() does not exist\n); $w = openssl_spki_details(preg_replace('/SPKAC=/', '', $spki)); if ($w === ) die(could not obtain details from spkac\n); echo OK!\n; openssl_free_key($key); ? --EXPECT-- Creating private key Creating new SPKAC Verifying SPKAC Exporting challenge Exporting public key from SPKAC Generating details of SPKAC structure OK! [2011-12-14 12:02:35] paj...@php.net Please see the phpt files in ext/openssl/tests/ this is how tests should be written. Further explanations are available here: http://qa.php.net/ Thanks!
[PHP-BUG] Req #60584 [NEW]: headers_list should return in a key = value fashion
From: Operating system: CentOS 2.6.18 PHP version: Irrelevant Package: Network related Bug Type: Feature/Change Request Bug description:headers_list should return in a key = value fashion Description: The function headers_list() returns the headers in a numeric array fashion, although, headers are, AFAIK, always in a `Key: Value` fashion, therefore, associative array would be a better choice. More on this, header_remove() works by simply passing the key, therefore, in background, headers have their key representation, I suppose. I've made an example function that uses this function, for a header lookup, but ends up in lots of lines compared to what could be replaced with one: https://gist.github.com/1505803 P.S. This is my first file in PHP Bugs section, please guide me if I have given not enough information. Test script: --- header('Test-Header: A random result'); var_dump(headers_list()); Expected result: array(5) { [X-Powered-By]= string(23) PHP/5.3.3 [Expires]= string(38) Thu, 19 Nov 1981 08:52:00 GMT [Cache-Control]= string(77) no-store, no-cache, must-revalidate, post-check=0, pre-check=0 [Pragma]= string(16) no-cache [Test-Header]= string(28) A random result } Actual result: -- array(5) { [0]= string(23) X-Powered-By: PHP/5.3.3 [1]= string(38) Expires: Thu, 19 Nov 1981 08:52:00 GMT [2]= string(77) Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 [3]= string(16) Pragma: no-cache [4]= string(28) Test-Header: A random result } -- Edit bug report at https://bugs.php.net/bug.php?id=60584edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60584r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60584r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60584r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60584r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60584r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60584r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60584r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60584r=needscript Try newer version: https://bugs.php.net/fix.php?id=60584r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60584r=support Expected behavior: https://bugs.php.net/fix.php?id=60584r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60584r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60584r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60584r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60584r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=60584r=dst IIS Stability: https://bugs.php.net/fix.php?id=60584r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60584r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60584r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60584r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60584r=mysqlcfg
Req #60584 [Opn]: headers_list() should return in a `$key = $value` fashion
Edit report at https://bugs.php.net/bug.php?id=60584edit=1 ID: 60584 User updated by:toms at mindboiler dot lv Reported by:toms at mindboiler dot lv -Summary:headers_list should return in a key = value fashion +Summary:headers_list() should return in a `$key = $value` fashion Status: Open Type: Feature/Change Request Package:Network related -Operating System: CentOS 2.6.18 +Operating System: CentOS 2.6.18-274.12.1.el5xen PHP Version:Irrelevant Block user comment: N Private report: N New Comment: Changed the summary a little, OS version. Previous Comments: [2011-12-21 12:34:34] toms at mindboiler dot lv Description: The function headers_list() returns the headers in a numeric array fashion, although, headers are, AFAIK, always in a `Key: Value` fashion, therefore, associative array would be a better choice. More on this, header_remove() works by simply passing the key, therefore, in background, headers have their key representation, I suppose. I've made an example function that uses this function, for a header lookup, but ends up in lots of lines compared to what could be replaced with one: https://gist.github.com/1505803 P.S. This is my first file in PHP Bugs section, please guide me if I have given not enough information. Test script: --- header('Test-Header: A random result'); var_dump(headers_list()); Expected result: array(5) { [X-Powered-By]= string(23) PHP/5.3.3 [Expires]= string(38) Thu, 19 Nov 1981 08:52:00 GMT [Cache-Control]= string(77) no-store, no-cache, must-revalidate, post-check=0, pre-check=0 [Pragma]= string(16) no-cache [Test-Header]= string(28) A random result } Actual result: -- array(5) { [0]= string(23) X-Powered-By: PHP/5.3.3 [1]= string(38) Expires: Thu, 19 Nov 1981 08:52:00 GMT [2]= string(77) Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 [3]= string(16) Pragma: no-cache [4]= string(28) Test-Header: A random result } -- Edit this bug report at https://bugs.php.net/bug.php?id=60584edit=1
[PHP-BUG] Bug #60585 [NEW]: php build fails with USE flag snmp
From: Operating system: Gentoo Linux PHP version: 5.4.0RC3 Package: SNMP related Bug Type: Bug Bug description:php build fails with USE flag snmp Description: I try to build php5.4.0rc3 on Gentoo with following USE flags: bcmath bzip2 cgi cli crypt ctype curl fileinfo filter ftp gd gdbm hash iconv json mhash mysql mysqli nls pdo phar posix readline session simplexml snmp* sockets sqlite3 ssl threads tokenizer truetype unicode xml xmlreader xmlrpc xmlwriter zlib -apache2 -berkdb -calendar -cdb -cjk -curlwrappers -debug -doc -embed -enchant -exif -firebird -flatfile -fpm (-frontbase) -gmp -imap -inifile -intl -iodbc -ipv6 -kerberos -kolab -ldap -ldap-sasl -libedit -mssql -mysqlnd -oci8-instant-client -odbc -pcntl -pic -postgres -qdbm -recode -sharedmem -soap -spell (-sybase-ct) -sysvipc -tidy -wddx -xpm -xsl -zip but it fails. As soon as I remove the snmp USE flag, the build works. Versions: - net-snmp: 5.4.3 - Net-SNMP: 6.0.1 Expected result: php build with snmp support Actual result: -- /var/tmp/portage/dev-lang/php-5.4.0_rc3/work/sapis-build/cli/ext/snmp/snmp.c: In function 'php_snmp_error': /var/tmp/portage/dev-lang/php-5.4.0_rc3/work/sapis-build/cli/ext/snmp/snmp.c:536:3: warning: passing argument 3 of 'zend_throw_exception_ex' from incompatible pointer type /var/tmp/portage/dev-lang/php-5.4.0_rc3/work/sapis-build/cli/Zend/zend_exceptions.h:44:17: note: expected 'void ***' but argument is of type 'char *' /var/tmp/portage/dev-lang/php-5.4.0_rc3/work/sapis-build/cli/ext/snmp/snmp.c:536:3: warning: passing argument 4 of 'zend_throw_exception_ex' from incompatible pointer type /var/tmp/portage/dev-lang/php-5.4.0_rc3/work/sapis-build/cli/Zend/zend_exceptions.h:44:17: note: expected 'char *' but argument is of type 'void ***' /var/tmp/portage/dev-lang/php-5.4.0_rc3/work/sapis-build/cli/ext/snmp/snmp.c: In function 'netsnmp_session_init': /var/tmp/portage/dev-lang/php-5.4.0_rc3/work/sapis-build/cli/ext/snmp/snmp.c:1174:10: error: request for member 'sa_family' in something not a structure or union /var/tmp/portage/dev-lang/php-5.4.0_rc3/work/sapis-build/cli/ext/snmp/snmp.c:1178:3: error: incompatible type for argument 1 of 'inet_ntoa' /usr/include/arpa/inet.h:54:14: note: expected 'struct in_addr' but argument is of type 'struct sockaddr **' make: *** [ext/snmp/snmp.lo] Fehler 1 make: *** Warte auf noch nicht beendete Prozesse... -- Edit bug report at https://bugs.php.net/bug.php?id=60585edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60585r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60585r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60585r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60585r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60585r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60585r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60585r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60585r=needscript Try newer version: https://bugs.php.net/fix.php?id=60585r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60585r=support Expected behavior: https://bugs.php.net/fix.php?id=60585r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60585r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60585r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60585r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60585r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=60585r=dst IIS Stability: https://bugs.php.net/fix.php?id=60585r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60585r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60585r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60585r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60585r=mysqlcfg
Bug #60362 [PATCH]: non-existent sub-sub keys should not have values
Edit report at https://bugs.php.net/bug.php?id=60362edit=1 ID: 60362 Patch added by: ala...@php.net Reported by:danielc at analysisandsolutions dot com Summary:non-existent sub-sub keys should not have values Status: Closed Type: Bug Package:Arrays related Operating System: linux PHP Version:5.4SVN-2011-11-23 (SVN) Assigned To:stas Block user comment: N Private report: N New Comment: The following patch has been added/updated: Patch Name: fix_to_prevent_warning_on_isset_empty_for_55_and_a_half.patch Revision: 1324478042 URL: https://bugs.php.net/patch-display.php?bug=60362patch=fix_to_prevent_warning_on_isset_empty_for_55_and_a_half.patchrevision=1324478042 Previous Comments: [2011-12-19 02:10:17] s...@php.net This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Applied patch making isset return false and access produce warning on invalid offsets. [2011-12-19 02:04:42] s...@php.net Automatic comment from SVN on behalf of stas Revision: http://svn.php.net/viewvc/?view=revisionamp;revision=321145 Log: implement the solution for isset/string offsets, fix bug #60362 [2011-12-18 05:08:03] ala...@php.net The following patch has been added/updated: Patch Name: isset_changed_warning_only_on_access.patch Revision: 1324184882 URL: https://bugs.php.net/patch-display.php?bug=60362patch=isset_changed_warning_only_on_access.patchrevision=1324184882 [2011-12-05 07:34:36] ala...@php.net I don't think the error trigger on isset() will work, isset() is used to avoid the errors [2011-12-05 05:17:20] larue...@php.net The following patch has been added/updated: Patch Name: string_offset_trigger_notice.patch Revision: 1323062240 URL: https://bugs.php.net/patch-display.php?bug=60362patch=string_offset_trigger_notice.patchrevision=1323062240 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 https://bugs.php.net/bug.php?id=60362 -- Edit this bug report at https://bugs.php.net/bug.php?id=60362edit=1
Bug #60570 [Opn-Ver]: memory leak with create context
Edit report at https://bugs.php.net/bug.php?id=60570edit=1 ID: 60570 Updated by: cataphr...@php.net Reported by:roberto at spadim dot com dot br Summary:memory leak with create context -Status: Open +Status: Verified Type: Bug Package:Streams related Operating System: LINUX PHP Version:5.3.8 Block user comment: N Private report: N Previous Comments: [2011-12-20 05:20:49] roberto at spadim dot com dot br Description: hi, when i create a context inside a function i see a memory leak, but when i create it in the main source code line, i don´t see it... please check the script.. i think the problem is something that don´t leave memory get back when destroying context variable Test script: --- memory leak: ?php function g(){ $context=stream_context_create(array('http'=array('timeout'=1))); $ret=file_get_contents('http://172.17.0.5/not_found',0,$context); unset($context); return($ret); } $base=memory_get_usage(); while(1){ g(); usleep(5); echo(memory_get_usage()-$base).\n; // memory get bigger and bigger here } ? memory leak too: ?php $base=memory_get_usage(); while(1){ $context= stream_context_create(array('http'=array('timeout'=1))); $ret=file_get_contents('http://172.17.0.5/not_found',0,$context); usleep(5);unset($ret,$context); echo(memory_get_usage()-$base).\n; // memory get bigger and bigger... } ? nice: ?php $base=memory_get_usage(); $context= stream_context_create(array('http'=array('timeout'=1))); while(1){ $ret=file_get_contents('http://172.17.0.5/not_found',0,$context); usleep(5);unset($ret); echo(memory_get_usage()-$base).\n; // memory is nice here... } ? Expected result: NICE: Warning... 3552 Warning... 3552 Warning... 3552 Warning... 3552 Warning... 3552 Warning... 3552 MEMORY LEAK: Warning... 40120 Warning... 41344 Warning... 42568 Warning... 43792 Actual result: -- well i think that others fields explain... MEMORY LEAK: Warning... 40120 Warning... 41344 Warning... (+- 1224 per while interaction) i don´t know how to solve this, unset don´t work, =null don´t work, and i don´t find a function to destroy contexts... -- Edit this bug report at https://bugs.php.net/bug.php?id=60570edit=1
Bug #60570 [Com]: memory leak with create context
Edit report at https://bugs.php.net/bug.php?id=60570edit=1 ID: 60570 Comment by: roberto at spadim dot com dot br Reported by:roberto at spadim dot com dot br Summary:memory leak with create context Status: Verified Type: Bug Package:Streams related Operating System: LINUX PHP Version:5.3.8 Block user comment: N Private report: N New Comment: maybe the array parameters isn´t being removed from memory? i tryed to change code inserting a comma after timeout parameter 'timeout'=1, and it add more memory leak per interaction more commas = more memory leak $context= stream_context_create(array('http'=array('timeout'=1,))); Previous Comments: [2011-12-20 05:20:49] roberto at spadim dot com dot br Description: hi, when i create a context inside a function i see a memory leak, but when i create it in the main source code line, i don´t see it... please check the script.. i think the problem is something that don´t leave memory get back when destroying context variable Test script: --- memory leak: ?php function g(){ $context=stream_context_create(array('http'=array('timeout'=1))); $ret=file_get_contents('http://172.17.0.5/not_found',0,$context); unset($context); return($ret); } $base=memory_get_usage(); while(1){ g(); usleep(5); echo(memory_get_usage()-$base).\n; // memory get bigger and bigger here } ? memory leak too: ?php $base=memory_get_usage(); while(1){ $context= stream_context_create(array('http'=array('timeout'=1))); $ret=file_get_contents('http://172.17.0.5/not_found',0,$context); usleep(5);unset($ret,$context); echo(memory_get_usage()-$base).\n; // memory get bigger and bigger... } ? nice: ?php $base=memory_get_usage(); $context= stream_context_create(array('http'=array('timeout'=1))); while(1){ $ret=file_get_contents('http://172.17.0.5/not_found',0,$context); usleep(5);unset($ret); echo(memory_get_usage()-$base).\n; // memory is nice here... } ? Expected result: NICE: Warning... 3552 Warning... 3552 Warning... 3552 Warning... 3552 Warning... 3552 Warning... 3552 MEMORY LEAK: Warning... 40120 Warning... 41344 Warning... 42568 Warning... 43792 Actual result: -- well i think that others fields explain... MEMORY LEAK: Warning... 40120 Warning... 41344 Warning... (+- 1224 per while interaction) i don´t know how to solve this, unset don´t work, =null don´t work, and i don´t find a function to destroy contexts... -- Edit this bug report at https://bugs.php.net/bug.php?id=60570edit=1
[PHP-BUG] Bug #60586 [NEW]: ignore_user_abort=true has no effect on IIS with FastCGI
From: Operating system: Windows Server 2008 R2 PHP version: 5.3.8 Package: IIS related Bug Type: Bug Bug description:ignore_user_abort=true has no effect on IIS with FastCGI Description: ignore_user_abort=true does not to work in an IIS FastCGI environment: The process is stopped when sending output after the browser was closed. Expected result: The process should continue to run, even with the browser window being closed and the script sending output. Actual result: -- The process stops. -- Edit bug report at https://bugs.php.net/bug.php?id=60586edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60586r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60586r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60586r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60586r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60586r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60586r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60586r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60586r=needscript Try newer version: https://bugs.php.net/fix.php?id=60586r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60586r=support Expected behavior: https://bugs.php.net/fix.php?id=60586r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60586r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60586r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60586r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60586r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=60586r=dst IIS Stability: https://bugs.php.net/fix.php?id=60586r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60586r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60586r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60586r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60586r=mysqlcfg
Bug #60570 [Ver]: memory leak with create context
Edit report at https://bugs.php.net/bug.php?id=60570edit=1 ID: 60570 Updated by: cataphr...@php.net Reported by:roberto at spadim dot com dot br Summary:memory leak with create context Status: Verified Type: Bug Package:Streams related Operating System: LINUX PHP Version:5.3.8 Block user comment: N Private report: N New Comment: The problem is simply that the context resource leaks everytime the http request fails. Seems to have been introduce in r262454. Previous Comments: [2011-12-21 15:03:29] roberto at spadim dot com dot br maybe the array parameters isn´t being removed from memory? i tryed to change code inserting a comma after timeout parameter 'timeout'=1, and it add more memory leak per interaction more commas = more memory leak $context= stream_context_create(array('http'=array('timeout'=1,))); [2011-12-20 05:20:49] roberto at spadim dot com dot br Description: hi, when i create a context inside a function i see a memory leak, but when i create it in the main source code line, i don´t see it... please check the script.. i think the problem is something that don´t leave memory get back when destroying context variable Test script: --- memory leak: ?php function g(){ $context=stream_context_create(array('http'=array('timeout'=1))); $ret=file_get_contents('http://172.17.0.5/not_found',0,$context); unset($context); return($ret); } $base=memory_get_usage(); while(1){ g(); usleep(5); echo(memory_get_usage()-$base).\n; // memory get bigger and bigger here } ? memory leak too: ?php $base=memory_get_usage(); while(1){ $context= stream_context_create(array('http'=array('timeout'=1))); $ret=file_get_contents('http://172.17.0.5/not_found',0,$context); usleep(5);unset($ret,$context); echo(memory_get_usage()-$base).\n; // memory get bigger and bigger... } ? nice: ?php $base=memory_get_usage(); $context= stream_context_create(array('http'=array('timeout'=1))); while(1){ $ret=file_get_contents('http://172.17.0.5/not_found',0,$context); usleep(5);unset($ret); echo(memory_get_usage()-$base).\n; // memory is nice here... } ? Expected result: NICE: Warning... 3552 Warning... 3552 Warning... 3552 Warning... 3552 Warning... 3552 Warning... 3552 MEMORY LEAK: Warning... 40120 Warning... 41344 Warning... 42568 Warning... 43792 Actual result: -- well i think that others fields explain... MEMORY LEAK: Warning... 40120 Warning... 41344 Warning... (+- 1224 per while interaction) i don´t know how to solve this, unset don´t work, =null don´t work, and i don´t find a function to destroy contexts... -- Edit this bug report at https://bugs.php.net/bug.php?id=60570edit=1
Bug #53437 [Asn]: Crash when using unserialized DatePeriod instance
Edit report at https://bugs.php.net/bug.php?id=53437edit=1 ID: 53437 Updated by: tony2...@php.net Reported by:from dot php dot net at brainbox dot cz Summary:Crash when using unserialized DatePeriod instance Status: Assigned Type: Bug Package:Date/time related Operating System: Windows XP SP3 PHP Version:5.3.3 Assigned To:derick Block user comment: N Private report: N New Comment: @Cataphrac (the Date(Period|Interval) serialization patch is here btw: http://nebm.ist.utl.pt/~glopes/misc/date_period_interval_ser.diff ) Previous Comments: [2011-12-06 06:07:24] der...@php.net Automatic comment from SVN on behalf of derick Revision: http://svn.php.net/viewvc/?view=revisionamp;revision=320479 Log: - Added a test case for #53437. [2011-01-09 06:00:35] cataphr...@php.net Reassigning to Derick, as the patch I've written is under his consideration. [2010-12-01 21:50:03] fel...@php.net Duplicated of #52113 [2010-12-01 17:15:05] from dot php dot net at brainbox dot cz Description: DatePeriod class does not have the serialization/unserialization logic implemented. Therefore, when unserialized instance is used, script crashes. This is result of serializing the DatePeriod instance: O:10:DatePeriod:0:{} unserialize() wents fine as well, but when I call foreach() on unserialized instance, the script crashes. Test script: --- $dp = new DatePeriod(new DateTime('2010-01-01 UTC'), new DateInterval('P1D'), 2); echo Original:\r\n; foreach($dp as $dt) { echo $dt-format('Y-m-d H:i:s').\r\n; } echo \r\n; $ser = serialize($dp); // $ser is: O:10:DatePeriod:0:{} // Create dangerous instance $dpu = unserialize($ser); // $dpu has invalid values⦠echo Unserialized:\r\n; // â¦which leads to CRASH: foreach($dpu as $dt) { echo $dt-format('Y-m-d H:i:s').\r\n; } Expected result: Original: 2010-01-01 00:00:00 2010-01-02 00:00:00 2010-01-03 00:00:00 Unserialized: 2010-01-01 00:00:00 2010-01-02 00:00:00 2010-01-03 00:00:00 Actual result: -- PHP crashes on the unserialize line. -- Edit this bug report at https://bugs.php.net/bug.php?id=53437edit=1
Bug #60570 [Com]: memory leak with create context
Edit report at https://bugs.php.net/bug.php?id=60570edit=1 ID: 60570 Comment by: roberto at spadim dot com dot br Reported by:roberto at spadim dot com dot br Summary:memory leak with create context Status: Verified Type: Bug Package:Streams related Operating System: LINUX PHP Version:5.3.8 Block user comment: N Private report: N New Comment: it´s a bit strange since if i don´t create a new context (calling a function or creating a new context) the memory leak don´t occur well, if the problem was founded that´s ok :) i´m just waiting something to solve it i´m changing ini varible to change http timeout and not using contexts while no other workaround is founded Previous Comments: [2011-12-21 15:07:41] cataphr...@php.net The problem is simply that the context resource leaks everytime the http request fails. Seems to have been introduce in r262454. [2011-12-21 15:03:29] roberto at spadim dot com dot br maybe the array parameters isn´t being removed from memory? i tryed to change code inserting a comma after timeout parameter 'timeout'=1, and it add more memory leak per interaction more commas = more memory leak $context= stream_context_create(array('http'=array('timeout'=1,))); [2011-12-20 05:20:49] roberto at spadim dot com dot br Description: hi, when i create a context inside a function i see a memory leak, but when i create it in the main source code line, i don´t see it... please check the script.. i think the problem is something that don´t leave memory get back when destroying context variable Test script: --- memory leak: ?php function g(){ $context=stream_context_create(array('http'=array('timeout'=1))); $ret=file_get_contents('http://172.17.0.5/not_found',0,$context); unset($context); return($ret); } $base=memory_get_usage(); while(1){ g(); usleep(5); echo(memory_get_usage()-$base).\n; // memory get bigger and bigger here } ? memory leak too: ?php $base=memory_get_usage(); while(1){ $context= stream_context_create(array('http'=array('timeout'=1))); $ret=file_get_contents('http://172.17.0.5/not_found',0,$context); usleep(5);unset($ret,$context); echo(memory_get_usage()-$base).\n; // memory get bigger and bigger... } ? nice: ?php $base=memory_get_usage(); $context= stream_context_create(array('http'=array('timeout'=1))); while(1){ $ret=file_get_contents('http://172.17.0.5/not_found',0,$context); usleep(5);unset($ret); echo(memory_get_usage()-$base).\n; // memory is nice here... } ? Expected result: NICE: Warning... 3552 Warning... 3552 Warning... 3552 Warning... 3552 Warning... 3552 Warning... 3552 MEMORY LEAK: Warning... 40120 Warning... 41344 Warning... 42568 Warning... 43792 Actual result: -- well i think that others fields explain... MEMORY LEAK: Warning... 40120 Warning... 41344 Warning... (+- 1224 per while interaction) i don´t know how to solve this, unset don´t work, =null don´t work, and i don´t find a function to destroy contexts... -- Edit this bug report at https://bugs.php.net/bug.php?id=60570edit=1
Bug #60570 [Ver-Csd]: memory leak with create context
Edit report at https://bugs.php.net/bug.php?id=60570edit=1 ID: 60570 Updated by: cataphr...@php.net Reported by:roberto at spadim dot com dot br Summary:memory leak with create context -Status: Verified +Status: Closed Type: Bug Package:Streams related Operating System: LINUX PHP Version:5.3.8 -Assigned To: +Assigned To:cataphract Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Previous Comments: [2011-12-21 15:44:35] cataphr...@php.net Automatic comment from SVN on behalf of cataphract Revision: http://svn.php.net/viewvc/?view=revisionamp;revision=321298 Log: - Fixed bug #60570 (http wrapper leaks context resource if request fails/is redirected). [2011-12-21 15:36:03] roberto at spadim dot com dot br it´s a bit strange since if i don´t create a new context (calling a function or creating a new context) the memory leak don´t occur well, if the problem was founded that´s ok :) i´m just waiting something to solve it i´m changing ini varible to change http timeout and not using contexts while no other workaround is founded [2011-12-21 15:07:41] cataphr...@php.net The problem is simply that the context resource leaks everytime the http request fails. Seems to have been introduce in r262454. [2011-12-21 15:03:29] roberto at spadim dot com dot br maybe the array parameters isn´t being removed from memory? i tryed to change code inserting a comma after timeout parameter 'timeout'=1, and it add more memory leak per interaction more commas = more memory leak $context= stream_context_create(array('http'=array('timeout'=1,))); [2011-12-20 05:20:49] roberto at spadim dot com dot br Description: hi, when i create a context inside a function i see a memory leak, but when i create it in the main source code line, i don´t see it... please check the script.. i think the problem is something that don´t leave memory get back when destroying context variable Test script: --- memory leak: ?php function g(){ $context=stream_context_create(array('http'=array('timeout'=1))); $ret=file_get_contents('http://172.17.0.5/not_found',0,$context); unset($context); return($ret); } $base=memory_get_usage(); while(1){ g(); usleep(5); echo(memory_get_usage()-$base).\n; // memory get bigger and bigger here } ? memory leak too: ?php $base=memory_get_usage(); while(1){ $context= stream_context_create(array('http'=array('timeout'=1))); $ret=file_get_contents('http://172.17.0.5/not_found',0,$context); usleep(5);unset($ret,$context); echo(memory_get_usage()-$base).\n; // memory get bigger and bigger... } ? nice: ?php $base=memory_get_usage(); $context= stream_context_create(array('http'=array('timeout'=1))); while(1){ $ret=file_get_contents('http://172.17.0.5/not_found',0,$context); usleep(5);unset($ret); echo(memory_get_usage()-$base).\n; // memory is nice here... } ? Expected result: NICE: Warning... 3552 Warning... 3552 Warning... 3552 Warning... 3552 Warning... 3552 Warning... 3552 MEMORY LEAK: Warning... 40120 Warning... 41344 Warning... 42568 Warning... 43792 Actual result: -- well i think that others fields explain... MEMORY LEAK: Warning... 40120 Warning... 41344 Warning... (+- 1224 per while interaction) i don´t know how to solve this, unset don´t work, =null don´t work, and i don´t find a function to destroy contexts... -- Edit this bug report at https://bugs.php.net/bug.php?id=60570edit=1
Bug #60570 [Com]: memory leak with create context
Edit report at https://bugs.php.net/bug.php?id=60570edit=1 ID: 60570 Comment by: roberto at spadim dot com dot br Reported by:roberto at spadim dot com dot br Summary:memory leak with create context Status: Closed Type: Bug Package:Streams related Operating System: LINUX PHP Version:5.3.8 Assigned To:cataphract Block user comment: N Private report: N New Comment: ok i will test it soon no problem :) i helped before and i won´t stop helping :) thanks guys your are wellcome Previous Comments: [2011-12-21 15:45:22] cataphr...@php.net This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. [2011-12-21 15:44:35] cataphr...@php.net Automatic comment from SVN on behalf of cataphract Revision: http://svn.php.net/viewvc/?view=revisionamp;revision=321298 Log: - Fixed bug #60570 (http wrapper leaks context resource if request fails/is redirected). [2011-12-21 15:36:03] roberto at spadim dot com dot br it´s a bit strange since if i don´t create a new context (calling a function or creating a new context) the memory leak don´t occur well, if the problem was founded that´s ok :) i´m just waiting something to solve it i´m changing ini varible to change http timeout and not using contexts while no other workaround is founded [2011-12-21 15:07:41] cataphr...@php.net The problem is simply that the context resource leaks everytime the http request fails. Seems to have been introduce in r262454. [2011-12-21 15:03:29] roberto at spadim dot com dot br maybe the array parameters isn´t being removed from memory? i tryed to change code inserting a comma after timeout parameter 'timeout'=1, and it add more memory leak per interaction more commas = more memory leak $context= stream_context_create(array('http'=array('timeout'=1,))); 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 https://bugs.php.net/bug.php?id=60570 -- Edit this bug report at https://bugs.php.net/bug.php?id=60570edit=1
Req #60584 [Opn-Wfx]: headers_list() should return in a `$key = $value` fashion
Edit report at https://bugs.php.net/bug.php?id=60584edit=1 ID: 60584 Updated by: cataphr...@php.net Reported by:toms at mindboiler dot lv Summary:headers_list() should return in a `$key = $value` fashion -Status: Open +Status: Wont fix Type: Feature/Change Request Package:Network related Operating System: CentOS 2.6.18-274.12.1.el5xen PHP Version:Irrelevant Block user comment: N Private report: N New Comment: While I don't think HTTP allows repeated headers, they're common in the wild, so key = value is not an option (maybe if the value was an array, but in any case both options break backwards compatibility). Thank you for the suggestion, anyway. Previous Comments: [2011-12-21 12:37:53] toms at mindboiler dot lv Changed the summary a little, OS version. [2011-12-21 12:34:34] toms at mindboiler dot lv Description: The function headers_list() returns the headers in a numeric array fashion, although, headers are, AFAIK, always in a `Key: Value` fashion, therefore, associative array would be a better choice. More on this, header_remove() works by simply passing the key, therefore, in background, headers have their key representation, I suppose. I've made an example function that uses this function, for a header lookup, but ends up in lots of lines compared to what could be replaced with one: https://gist.github.com/1505803 P.S. This is my first file in PHP Bugs section, please guide me if I have given not enough information. Test script: --- header('Test-Header: A random result'); var_dump(headers_list()); Expected result: array(5) { [X-Powered-By]= string(23) PHP/5.3.3 [Expires]= string(38) Thu, 19 Nov 1981 08:52:00 GMT [Cache-Control]= string(77) no-store, no-cache, must-revalidate, post-check=0, pre-check=0 [Pragma]= string(16) no-cache [Test-Header]= string(28) A random result } Actual result: -- array(5) { [0]= string(23) X-Powered-By: PHP/5.3.3 [1]= string(38) Expires: Thu, 19 Nov 1981 08:52:00 GMT [2]= string(77) Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 [3]= string(16) Pragma: no-cache [4]= string(28) Test-Header: A random result } -- Edit this bug report at https://bugs.php.net/bug.php?id=60584edit=1
Bug #60554 [Opn-Bgs]: basename() broken with Spanish locales
Edit report at https://bugs.php.net/bug.php?id=60554edit=1 ID: 60554 Updated by: cataphr...@php.net Reported by:yun...@php.net Summary:basename() broken with Spanish locales -Status: Open +Status: Bogus Type: Bug Package:Filesystem function related PHP Version:5.4.0RC3 Block user comment: N Private report: N New Comment: basename() features this warning: basename() is locale aware, so for it to see the correct basename with multibyte character paths, the matching locale must be set using the setlocale() function. As I understand, you're passign it utf-8 data while setting the locale to something else; this is not allowed. Previous Comments: [2011-12-18 16:06:31] yun...@php.net Description: See test script. Test script: --- LANG=es_ES php -r 'var_dump(basename(é«æ§è¡åçæé .xls));' Expected result: é«æ§è¡åçæé .xls Actual result: -- æ§è¡åçæé .xls -- Edit this bug report at https://bugs.php.net/bug.php?id=60554edit=1
Bug #52719 [Com]: array_walk_recursive crashes if third param of the function is by reference
Edit report at https://bugs.php.net/bug.php?id=52719edit=1 ID: 52719 Comment by: ni...@php.net Reported by:apouch at woozworld dot com Summary:array_walk_recursive crashes if third param of the function is by reference Status: Feedback Type: Bug Package:Arrays related Operating System: Linux PHP Version:5.3.3 Block user comment: N Private report: N New Comment: Another test case: http://codepad.viper-7.com/Mw3DhS. You can observe the memory corruption in the values that are output. Also you can simply toggle the crash be removing the 'alpha' elements: http://codepad.viper-7.com/luVZw5 will crash. By the way, I could not reproduce the crash on a debug build (I get only leaks there, too). Previous Comments: [2010-12-13 13:19:19] php at oxanvanleeuwen dot nl This is still a problem with PHP 5.3.4. Strange is that it segfaults after the call to array_walk_recursive; running is printed. See this test script, which segfaults: ?php $array = array(hello, array(bye)); $flat = array(); array_walk_recursive($array, function ($value, $key, $flat) { $flat[] = $value; }, $flat); echo Running; [2010-08-30 19:36:24] johan...@php.net Please try using this snapshot: http://snaps.php.net/php5.3-latest.tar.gz For Windows: http://windows.php.net/snapshots/ I get no crash but a memleak which is handled gracefully with current SVN. No crash[Mon Aug 30 19:33:37 2010] Script: '-' /home/johannes/src/php/php-src/branches/PHP_5_3/Zend/zend_execute_API.c(888) : Freeing 0x00DEB060 (32 bytes), script=- === Total 1 memory leaks detected === [2010-08-27 22:42:39] apouch at woozworld dot com Description: This is something that changed between PHP 5.3.2 and PHP 5.3.3. array_walk_recursive accepts a 3rd parameter for 'userdata'. If: - this parameter is an object AND - the user-created function used as second parameter to array_walk_recursive defines the third parameter by reference AND - The array given as first parameter to array_walk_recursive is a multi-dimensional array, PHP crashes. Test script: --- $array = array('foo', 'bar' = array('taz')); $foo = new stdClass(); array_walk_recursive($array, create_function('$v, $k, $u', ''), $foo); echo 'No crash'; //This one works: array_walk_recursive($array, create_function('$v, $k, $u', ''), $foo); Expected result: No Crash Actual result: -- PHP crashes -- Edit this bug report at https://bugs.php.net/bug.php?id=52719edit=1
Bug #60578 [Opn]: IMAP-functions don't work!
Edit report at https://bugs.php.net/bug.php?id=60578edit=1 ID: 60578 User updated by:profymath at yahoo dot com Reported by:profymath at yahoo dot com Summary:IMAP-functions don't work! Status: Open Type: Bug Package:IMAP related Operating System: Linux PHP Version:Irrelevant Block user comment: N Private report: N New Comment: One more option! Previous Comments: [2011-12-20 22:18:42] profymath at yahoo dot com Description: Note: 1. imap.so is loaded (as seen from the script and, through get_loaded_extensions() function); 2. imap.ini is parsed (as seen from phpinfo() function); 3. php is compiled with imap (as seen from phpinfo() function, IMAP c-Client Version 2007e); 4. error log file (php.ini) don't record any failures after launching the script; 5. connection to IMAP Server (dovecot) through telnet doesn't have any problem. Moreover, when I start the script I see that the connection to IMAP Server goes well but it is disconnected immediately. That is compared to telnet connection, the connection through imap_open function doesn't stay opened! 6. webserver (apache) configuration is checked for misconfiguration (as imap- functions start from webserver environment).Nothing found. Test script: --- ?php if(extension_loaded(imap)) { echo preimap loaded/pre; }else{ echo preimap not loaded/pre; } $mbox = imap_open({X.com:143/novalidate-cert},user_name,user_pass); if($mbox !== FALSE) { $list = imap_list($mbox,{X.com:143/novalidate-cert},*); }else{ echobr,The stream is closed!; } ? Expected result: An array containing the names of the mailboxes ($list). Actual result: -- imap loaded Notice: Undefined variable: mbox in /usr/lib/cgi-bin/PPP.php on line 24 Fatal error: Call to undefined function  imap_list() in /usr/lib/cgi-bin/PPP.php on line 27 -- Edit this bug report at https://bugs.php.net/bug.php?id=60578edit=1
Bug #60578 [Opn]: IMAP-functions don't work!
Edit report at https://bugs.php.net/bug.php?id=60578edit=1 ID: 60578 User updated by:profymath at yahoo dot com Reported by:profymath at yahoo dot com Summary:IMAP-functions don't work! Status: Open Type: Bug Package:IMAP related Operating System: Linux PHP Version:Irrelevant Block user comment: N Private report: N New Comment: 7. safe_mode = Off Previous Comments: [2011-12-21 16:20:11] profymath at yahoo dot com One more option! [2011-12-20 22:18:42] profymath at yahoo dot com Description: Note: 1. imap.so is loaded (as seen from the script and, through get_loaded_extensions() function); 2. imap.ini is parsed (as seen from phpinfo() function); 3. php is compiled with imap (as seen from phpinfo() function, IMAP c-Client Version 2007e); 4. error log file (php.ini) don't record any failures after launching the script; 5. connection to IMAP Server (dovecot) through telnet doesn't have any problem. Moreover, when I start the script I see that the connection to IMAP Server goes well but it is disconnected immediately. That is compared to telnet connection, the connection through imap_open function doesn't stay opened! 6. webserver (apache) configuration is checked for misconfiguration (as imap- functions start from webserver environment).Nothing found. Test script: --- ?php if(extension_loaded(imap)) { echo preimap loaded/pre; }else{ echo preimap not loaded/pre; } $mbox = imap_open({X.com:143/novalidate-cert},user_name,user_pass); if($mbox !== FALSE) { $list = imap_list($mbox,{X.com:143/novalidate-cert},*); }else{ echobr,The stream is closed!; } ? Expected result: An array containing the names of the mailboxes ($list). Actual result: -- imap loaded Notice: Undefined variable: mbox in /usr/lib/cgi-bin/PPP.php on line 24 Fatal error: Call to undefined function  imap_list() in /usr/lib/cgi-bin/PPP.php on line 27 -- Edit this bug report at https://bugs.php.net/bug.php?id=60578edit=1
Req #50047 [Com]: interface binding for fsockopen (like socket_bind)
Edit report at https://bugs.php.net/bug.php?id=50047edit=1 ID: 50047 Comment by: drclue at drclue dot net Reported by:naox at o2 dot pl Summary:interface binding for fsockopen (like socket_bind) Status: Open Type: Feature/Change Request Package:Network related Operating System: - PHP Version:5.2.11 Block user comment: N Private report: N New Comment: I know this is an OLD thread to be bumping , but the missing bind facility in fsockopen() is exactly my problem today. The knee jerk thought that most people have is that one is trying to bind as a server, BUT in this use case I'm binding the client. The particular application is an ip hygiene tester for a level 3 networking company that verifies if particular source IP addresses can send mail, prior to leasing them out to corporate clients like Walmart. We do various DNS lookups to spamhaus servers , and as a final test send test mails to test email accounts we have established at the target servers of interest to the clients to verify the /24 ip ranges will indeed deliver mail. (THIS IS NOT A SPAM SYSTEM). The server I'm developing on is configured with multiple ip addresses and the application needs to bind the client socket to perform the tests. My existing mail routines use fsocket functions , so I'm having to investigate various work arounds such as making a stream wrapper just to get that bind function in there. I really don't want to recreate all the feof , fread , fgets etc. logic. Previous Comments: [2009-11-03 04:40:27] naox at o2 dot pl nope. this would be setting destination not source interface. Check out http://php.net/manual/pl/function.socket-bind.php this however is for socket functions not network like fsockopen [2009-11-03 03:06:00] srina...@php.net is this some thing what you are looking for ? $fp = fsockopen(tcp://127.0.0.1, 8080); or $fp = fsockopen(unix:///tmp/mysocket, ..); [2009-11-01 00:26:59] naox at o2 dot pl Description: PHP really needs interface binding for fsockopen() (like socket_bind()) -- Edit this bug report at https://bugs.php.net/bug.php?id=50047edit=1
Bug #60550 [Com]: strtotime adds compound string, subtracts wrong
Edit report at https://bugs.php.net/bug.php?id=60550edit=1 ID: 60550 Comment by: jayte dot boehler at bestnotes dot com Reported by:viewport2heaven at yahoo dot com Summary:strtotime adds compound string, subtracts wrong Status: Open Type: Bug Package:Date/time related Operating System: Windows 7 PHP Version:5.3.8 Block user comment: N Private report: N New Comment: The manual doesn't clarify how php processes a sequential set of number-based relative values, but it appears that the initial '+/-' does not dictate the direction of the entire sequence. If you continue in the negative direction with the string '-3 days -2 hours -3 minutes -4 seconds', it yields the correct diff... Previous Comments: [2011-12-17 04:02:03] viewport2heaven at yahoo dot com Description: --- From manual page: http://www.php.net/function.strtotime#refsect1-function.strtotime-parameters --- A string of '+1 day 2 hours 3 minutes 4 seconds' works. A string of '-1 day 2 hours 3 minutes 4 seconds' doesn't work. Test script: --- $time = strtotime('+3 days 2 hours 3 minutes 4 seconds') - time(); $expectedDiff = 3 * 24 * 60 * 60 + 2 * 60 * 60 + 3 * 60 + 4; $time = strtotime('-3 days 2 hours 3 minutes 4 seconds') - time(); $expectedDiff = 3 * 24 * 60 * 60 + 2 * 60 * 60 + 3 * 60 + 4; Expected result: + and - should be the same. Actual result: -- + is correct. - is wrong. -- Edit this bug report at https://bugs.php.net/bug.php?id=60550edit=1
Req #29401 [Com]: Form POST not decoded properly
Edit report at https://bugs.php.net/bug.php?id=29401edit=1 ID: 29401 Comment by: mikebianc at aol dot com Reported by:xmlguy at hotmail dot com Summary:Form POST not decoded properly Status: Open Type: Feature/Change Request Package:Feature/Change Request Operating System: Win XP Pro PHP Version:4.3.8 Block user comment: N Private report: N New Comment: fwiw, python parses this properly. I'm just seeing an empty array! form enctype=multipart/form-data action='/fileupload.php' method=post input multiple=true type=file name='file[my{}stuff].data'input type=submit value='submit'/form var_dump($_FILES) yields: array(0) {} If I change the 'action' to a python script, I see this: [ { 'file[my{}stuff].dataâ, âtestfile2.txtâ, âthis is another test file (2)\nâ }, { âfile[my{}stuff].dataâ, âtestfile1.txtâ, âthis is test file 1\nâ } ] ] POST source: Content-Type: multipart/form-data; boundary=---141539390286251557952150290 Content-Length: 468 -141539390286251557952150290 Content-Disposition: form-data; name=file[\my{}stuff\].data; filename=testfile2.txt Content-Type: text/plain this is another test file (2) -141539390286251557952150290 Content-Disposition: form-data; name=file[\my{}stuff\].data; filename=testfile1.txt Content-Type: text/plain this is test file 1 -141539390286251557952150290-- Previous Comments: [2004-10-12 00:32:05] xmlguy at hotmail dot com I indicated this as an mbstring related problem because the similar bugs I found used this as the category. See bugs 20114 19507 19347 20024 20133. [2004-10-08 16:17:43] moriyo...@php.net How come this could be a mbstring related problem..? [2004-07-27 02:44:23] xmlguy at hotmail dot com with the version of the form I posted, the expected and actual result sample data should obviously reflect the strings John and Doe instead of billy and joel, respectfully. [2004-07-27 02:33:53] xmlguy at hotmail dot com Description: If key contains more than one set of square brackets, the key value pair is not decoded properly. For example, a form with a series of input elements named such as formname[0].fieldname[0] will cause incorrect and missing key/value pairs to be stored into the $_POST array. In researching the existing bug list, I noticed that there have been numerous variations of bugs reported when form data contains url encoded data, such as occurs when the brackets are encoded as %5b and %5d. However these bugs have apparently been closed without actually fixing this problem. Perhaps a more thorough analysis of this problem is warranted to keep it from lingering on for a few more years before this report is closed. The Adobe acrobat products/reader have just started to encode form names in this format, so it could become a very serious issue if PHP cannot correctly process this form data. Reproduce code: --- html headtitleForm Submit Test Script/title/head body form name='fm1' action=? echo ($_SERVER[HTTP_REFERER])? method='post' input type='text' name='form1[0].firstname[0]' value='John' / input type='text' name='form1[0].lastname[0]' value='Doe' / input type='submit' / /form ? var_dump($_POST); ? /body /html Expected result: array(2) { [form1[0].firstname[0]]= string(5) billy [form1[0].lastname[0]]= string(4) joel } Actual result: -- array(1) { [form1]= array(1) { [0]= string(4) joel } } -- Edit this bug report at https://bugs.php.net/bug.php?id=29401edit=1
Bug #40837 [Com]: static and non-static functions can't have the same name
Edit report at https://bugs.php.net/bug.php?id=40837edit=1 ID: 40837 Comment by: mac at macnewbold dot com Reported by:nick dot telford at gmail dot com Summary:static and non-static functions can't have the same name Status: Bogus Type: Bug Package:Class/Object related Operating System: Irrelevant PHP Version:5.2.1 Block user comment: N Private report: N New Comment: I agree with martijntje and nick.telford - the static function and normal function of the same name shouldn't have any conflict, and it would be extremely helpful to be able to define the same function for use both statically and non-statically. In the meantime, I'm going to try using __call() and __callStatic() to pretend like this feature actually exists. Previous Comments: [2011-11-26 22:17:42] martijntje at martijnotto dot nl I have no idea why this bug is closed as 'bogus'. Just because the documentation states it is a certain way does not mean that it is right. I, for one, believe that it should be possible to create both a static and a member function with the same name. There would never be any confusion as to which function should be called due to the difference of using the :: or - operator. [2007-03-16 17:40:02] he...@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php . [2007-03-16 16:44:17] nick dot telford at gmail dot com Description: When declaring two functions in a class (methods) non-static and static functions may not use the same names. While I understand this, this is essentially wrong since static methods and non-static methods are entirely different. This also leads me on to another bug/feature suggestion I'm about to file about not being able to overload static attributes with __set/__get. Reproduce code: --- class Example { public static function test() {} public function test() {} } $example = new Example(); $example-test(); Example::test(); Expected result: No errors, all methods called correctly. Actual result: -- PHP errors with: Fatal error: Cannot redeclare Example::test() -- Edit this bug report at https://bugs.php.net/bug.php?id=40837edit=1
[PHP-BUG] Bug #60589 [NEW]: str_replace error
From: Operating system: lenny debian PHP version: 5.3.8 Package: *General Issues Bug Type: Bug Bug description:str_replace error Description: str_replace() error: following construct delivers true on using phpexcelreader on ms excelfile as $item if $item = ord($item)=32 that means, not all whitespaces where found with str_replaces() Test script: --- foreach($user as $key=$item) { if(trim(str_replace( ,,$item)) == ) { echobritems:.ord($item); } } output will be displayed with ascii 32 (space). Should be not possible. Expected result: dump-NULL Actual result: -- (space ascii 32 -- Edit bug report at https://bugs.php.net/bug.php?id=60589edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60589r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60589r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60589r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60589r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60589r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60589r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60589r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60589r=needscript Try newer version: https://bugs.php.net/fix.php?id=60589r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60589r=support Expected behavior: https://bugs.php.net/fix.php?id=60589r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60589r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60589r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60589r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60589r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=60589r=dst IIS Stability: https://bugs.php.net/fix.php?id=60589r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60589r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60589r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60589r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60589r=mysqlcfg
Bug #60589 [Opn]: str_replace error
Edit report at https://bugs.php.net/bug.php?id=60589edit=1 ID: 60589 User updated by:pehohlva at gmail dot com Reported by:pehohlva at gmail dot com Summary:str_replace error Status: Open Type: Bug Package:*General Issues Operating System: lenny debian PHP Version:5.3.8 Block user comment: N Private report: N New Comment: meant is: str_replace() doesnt recognise ascii 32 as whitespace / space. Previous Comments: [2011-12-21 21:02:49] pehohlva at gmail dot com Description: str_replace() error: following construct delivers true on using phpexcelreader on ms excelfile as $item if $item = ord($item)=32 that means, not all whitespaces where found with str_replaces() Test script: --- foreach($user as $key=$item) { if(trim(str_replace( ,,$item)) == ) { echobritems:.ord($item); } } output will be displayed with ascii 32 (space). Should be not possible. Expected result: dump-NULL Actual result: -- (space ascii 32 -- Edit this bug report at https://bugs.php.net/bug.php?id=60589edit=1
Req #60584 [Com]: headers_list() should return in a `$key = $value` fashion
Edit report at https://bugs.php.net/bug.php?id=60584edit=1 ID: 60584 Comment by: anon at anon dot anon Reported by:toms at mindboiler dot lv Summary:headers_list() should return in a `$key = $value` fashion Status: Wont fix Type: Feature/Change Request Package:Network related Operating System: CentOS 2.6.18-274.12.1.el5xen PHP Version:Irrelevant Block user comment: N Private report: N New Comment: This could not work. Each sent cookie in an HTTP response has its own Set-Cookie header, and there is no syntax accepted by browsers for combining them into one (separators like commas or semi-colons already have other meanings in the Set-Cookie syntax). Blame Netscape for coming up with that, but 17 years later there's nothing that can be done about it. Example: setcookie('foo', 'bar'); setcookie('abc', '123'); var_dump(headers_list()); Output: array(2) { [0]= string(19) Set-Cookie: foo=bar [1]= string(19) Set-Cookie: abc=123 } See also: http://curl.haxx.se/rfc/cookie_spec.html Previous Comments: [2011-12-21 15:56:36] cataphr...@php.net While I don't think HTTP allows repeated headers, they're common in the wild, so key = value is not an option (maybe if the value was an array, but in any case both options break backwards compatibility). Thank you for the suggestion, anyway. [2011-12-21 12:37:53] toms at mindboiler dot lv Changed the summary a little, OS version. [2011-12-21 12:34:34] toms at mindboiler dot lv Description: The function headers_list() returns the headers in a numeric array fashion, although, headers are, AFAIK, always in a `Key: Value` fashion, therefore, associative array would be a better choice. More on this, header_remove() works by simply passing the key, therefore, in background, headers have their key representation, I suppose. I've made an example function that uses this function, for a header lookup, but ends up in lots of lines compared to what could be replaced with one: https://gist.github.com/1505803 P.S. This is my first file in PHP Bugs section, please guide me if I have given not enough information. Test script: --- header('Test-Header: A random result'); var_dump(headers_list()); Expected result: array(5) { [X-Powered-By]= string(23) PHP/5.3.3 [Expires]= string(38) Thu, 19 Nov 1981 08:52:00 GMT [Cache-Control]= string(77) no-store, no-cache, must-revalidate, post-check=0, pre-check=0 [Pragma]= string(16) no-cache [Test-Header]= string(28) A random result } Actual result: -- array(5) { [0]= string(23) X-Powered-By: PHP/5.3.3 [1]= string(38) Expires: Thu, 19 Nov 1981 08:52:00 GMT [2]= string(77) Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 [3]= string(16) Pragma: no-cache [4]= string(28) Test-Header: A random result } -- Edit this bug report at https://bugs.php.net/bug.php?id=60584edit=1
Bug #60589 [Com]: str_replace error
Edit report at https://bugs.php.net/bug.php?id=60589edit=1 ID: 60589 Comment by: anon at anon dot anon Reported by:pehohlva at gmail dot com Summary:str_replace error Status: Open Type: Bug Package:*General Issues Operating System: lenny debian PHP Version:5.3.8 Block user comment: N Private report: N New Comment: str_replace works fine. You're just not using its result. str_replace returns the altered string; it doesn't change the original. Do: $item = str_replace( , , $item); Previous Comments: [2011-12-21 21:07:49] pehohlva at gmail dot com meant is: str_replace() doesnt recognise ascii 32 as whitespace / space. [2011-12-21 21:02:49] pehohlva at gmail dot com Description: str_replace() error: following construct delivers true on using phpexcelreader on ms excelfile as $item if $item = ord($item)=32 that means, not all whitespaces where found with str_replaces() Test script: --- foreach($user as $key=$item) { if(trim(str_replace( ,,$item)) == ) { echobritems:.ord($item); } } output will be displayed with ascii 32 (space). Should be not possible. Expected result: dump-NULL Actual result: -- (space ascii 32 -- Edit this bug report at https://bugs.php.net/bug.php?id=60589edit=1
Bug #60589 [Opn-Bgs]: str_replace error
Edit report at https://bugs.php.net/bug.php?id=60589edit=1 ID: 60589 Updated by: cataphr...@php.net Reported by:pehohlva at gmail dot com Summary:str_replace error -Status: Open +Status: Bogus Type: Bug Package:*General Issues Operating System: lenny debian PHP Version:5.3.8 Block user comment: N Private report: N New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. Previous Comments: [2011-12-22 02:32:26] anon at anon dot anon str_replace works fine. You're just not using its result. str_replace returns the altered string; it doesn't change the original. Do: $item = str_replace( , , $item); [2011-12-21 21:07:49] pehohlva at gmail dot com meant is: str_replace() doesnt recognise ascii 32 as whitespace / space. [2011-12-21 21:02:49] pehohlva at gmail dot com Description: str_replace() error: following construct delivers true on using phpexcelreader on ms excelfile as $item if $item = ord($item)=32 that means, not all whitespaces where found with str_replaces() Test script: --- foreach($user as $key=$item) { if(trim(str_replace( ,,$item)) == ) { echobritems:.ord($item); } } output will be displayed with ascii 32 (space). Should be not possible. Expected result: dump-NULL Actual result: -- (space ascii 32 -- Edit this bug report at https://bugs.php.net/bug.php?id=60589edit=1
[PHP-BUG] Bug #60591 [NEW]: Memory leak when access a non-exists file
From: laruence Operating system: PHP version: 5.4.0RC3 Package: Built-in web server Bug Type: Bug Bug description:Memory leak when access a non-exists file Description: report by cjones if built-in server start with a router: ?php if (preg_match('/\.(?:png|jpg|jpeg|gif)$/', $_SERVER[REQUEST_URI])) return false; // serve the requested resource as-is. else { echo here; } ? then accesss a non-exists file like(a.jpe) will result in mem leak. Test script: --- ?php if (preg_match('/\.(?:png|jpg|jpeg|gif)$/', $_SERVER[REQUEST_URI])) return false; // serve the requested resource as-is. else { echo here; } ? Expected result: cjones@mlt:~/w$ php54 -S localhost:8000 routing.php PHP 5.4.0RC4-dev Development Server started at Mon Dec 19 18:55:25 2011 Listening on localhost:8000 Document root is /home/cjones/public_html Press Ctrl-C to quit. [Mon Dec 19 18:55:30 2011] ::1:48358 [200]: /oraclelogo.jpg [Mon Dec 19 18:55:30 2011] Script: '/home/cjones/public_html/favicon.ico' /home/cjones/phpsrc/php/php-src/branches/PHP_5_4/ext/filter/filter.c(451) : Freeing 0xB493F0E4 (16 bytes), script=/home/cjones/public_html/favicon.ico Last leak repeated 19 times [Mon Dec 19 18:55:30 2011] Script: '/home/cjones/public_html/favicon.ico' /home/cjones/phpsrc/php/php-src/branches/PHP_5_4/Zend/zend_execute.h(184) : Freeing 0xB493F19C (65484 bytes), script=/home/cjones/public_html/favicon.ico [Mon Dec 19 18:55:30 2011] Script: '/home/cjones/public_html/favicon.ico' . -- Edit bug report at https://bugs.php.net/bug.php?id=60591edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60591r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60591r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60591r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60591r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60591r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60591r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60591r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60591r=needscript Try newer version: https://bugs.php.net/fix.php?id=60591r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60591r=support Expected behavior: https://bugs.php.net/fix.php?id=60591r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60591r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60591r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60591r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60591r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=60591r=dst IIS Stability: https://bugs.php.net/fix.php?id=60591r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60591r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60591r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60591r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60591r=mysqlcfg
Bug #60591 [Opn-Csd]: Memory leak when access a non-exists file
Edit report at https://bugs.php.net/bug.php?id=60591edit=1 ID: 60591 Updated by: larue...@php.net Reported by:larue...@php.net Summary:Memory leak when access a non-exists file -Status: Open +Status: Closed Type: Bug Package:Built-in web server PHP Version:5.4.0RC3 -Assigned To: +Assigned To:laruence Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Previous Comments: [2011-12-22 07:39:21] larue...@php.net Automatic comment from SVN on behalf of laruence Revision: http://svn.php.net/viewvc/?view=revisionamp;revision=321320 Log: Fix bug #60591 (Memory leak when access a non-exists file) [2011-12-22 07:18:43] larue...@php.net Description: report by cjones if built-in server start with a router: ?php if (preg_match('/\.(?:png|jpg|jpeg|gif)$/', $_SERVER[REQUEST_URI])) return false; // serve the requested resource as-is. else { echo here; } ? then accesss a non-exists file like(a.jpe) will result in mem leak. Test script: --- ?php if (preg_match('/\.(?:png|jpg|jpeg|gif)$/', $_SERVER[REQUEST_URI])) return false; // serve the requested resource as-is. else { echo here; } ? Expected result: cjones@mlt:~/w$ php54 -S localhost:8000 routing.php PHP 5.4.0RC4-dev Development Server started at Mon Dec 19 18:55:25 2011 Listening on localhost:8000 Document root is /home/cjones/public_html Press Ctrl-C to quit. [Mon Dec 19 18:55:30 2011] ::1:48358 [200]: /oraclelogo.jpg [Mon Dec 19 18:55:30 2011] Script: '/home/cjones/public_html/favicon.ico' /home/cjones/phpsrc/php/php-src/branches/PHP_5_4/ext/filter/filter.c(451) : Freeing 0xB493F0E4 (16 bytes), script=/home/cjones/public_html/favicon.ico Last leak repeated 19 times [Mon Dec 19 18:55:30 2011] Script: '/home/cjones/public_html/favicon.ico' /home/cjones/phpsrc/php/php-src/branches/PHP_5_4/Zend/zend_execute.h(184) : Freeing 0xB493F19C (65484 bytes), script=/home/cjones/public_html/favicon.ico [Mon Dec 19 18:55:30 2011] Script: '/home/cjones/public_html/favicon.ico' . -- Edit this bug report at https://bugs.php.net/bug.php?id=60591edit=1