Re: [PHP-CVS] com php-src: Merge branch '5.4': ext/openssl/openssl.c
I checked with Stas and he said ok for 5.4. On 12 Jun 2012, at 06:08, David Soria Parra dso...@gmx.net wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Stas did you ACK that change? It seems rather intrusive and I am not sure if we want that in a minor version just 24 h before releasing. can we solve that before tagging 5.4.4? thx On Tue, Jun 12, 2012 at 1:04 AM, Scott MacVicar scott...@php.net wrote: Commit:bcd671d999bcb9aac3691c59e632d91575ea87a0 Author: Scott MacVicar scott...@php.net Mon, 11 Jun 2012 16:04:01 -0700 Parents: aadf59dfa4be09147671de33786dc157716705df bccd1e672fabc3c788e93075221d47d9f077b167 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bcd671d999bcb9aac3691c59e632d91575ea87a0 Log: Merge branch '5.4' * 5.4: Rename openssl_pkcs5_pbkdf2_hmac() to something that doesn't sound like a spell. Add PBKDF2 support via openssl() Conflicts: ext/openssl/openssl.c Changed paths: MM ext/openssl/openssl.c Diff: diff --cc ext/openssl/openssl.c index f7db37b,4d482e8..d0ed15e --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@@ -3328,6 -3332,7 +3328,10 @@@ PHP_FUNCTION(openssl_pkey_get_details /* }}} */ #if OPENSSL_VERSION_NUMBER = 0x1000L ++ HEAD ++=== + ++ 5.4 /* {{{ proto string openssl_pbkdf2(string password, string salt, long key_length, long iterations [, string digest_method = sha1]) Generates a PKCS5 v2 PBKDF2 string, defaults to sha1 */ PHP_FUNCTION(openssl_pbkdf2) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQIcBAEBAgAGBQJP1z9hAAoJEKSanlo0ToXKTUMQAJH9+HTUMRuRGfHk6dvdK+3j d+fc447uDlNlxcMttgui1NDe7QdjDEkaKWFaKPvv6GIVTPYY4zzHM62okIzx+6V3 lzwbzRUCsER+9p1LD2pbIDNyxCbpenIeI6M1mLP5KfxFnsBx61ok0QghzKBjnnUQ Ci0IF8Ns5B5oj1Kmi5fqMrvgVNV1lRS0RjyiOGh0CyY+IYM1qqJ1VlrZ3LqyDb7s T+xx2MTpfvcyKSFHK1hEmooxYsReikqakJ5yC87k4jVAmSNDpuLDaibnUo/5o0aq 3ZRA8EoBUIeC+Ty0JF9MN+osZVmdD7cMd6q7h0e76HNupW/La2mdbKpQRy80P40N iH1v4HAX+N4k9Ut8bIjbViswWnEqoE/EY5ZSeLdYgR+W6J+R4abPfjR1I4KdLoCH /APyFwpcjGtErlaAPT8Z3iE+eelQ7a92WLz+yVWG70Qq8EG7HBV2234yTYJAsRlw GGDUMgGkmNxh+yCHyNGVqF8bO6Z4ghpUsz031pNhGRYlZrFFko5m9Is6VJsSN+g5 nNqi6xzdnCfVN5o2AZF/cvICO/NnWjpm2UI56gb14J4CtusvwDD8lek8MD+KQ+TQ /5T6JXtOkr8+BzkXna0e6/eqKqcxC34Kh2WuA2JsoUTkSDnK0UmPnP3ENfGnY6Uo SRlNfnuob0ebiLjC8DLN =ydGd -END PGP SIGNATURE- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch '5.4': ext/openssl/openssl.c
Commit:32040b574e7b456ca7b03918adaabfec4bbd91e2 Author:Scott MacVicar scott...@php.net Mon, 11 Jun 2012 00:29:02 -0700 Parents: 2065bab102d2117340d5b604f0ac55941c78ced8 f4847efc5d58b3375fa0f3269158d5e6ab625c21 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=32040b574e7b456ca7b03918adaabfec4bbd91e2 Log: Merge branch '5.4' * 5.4: Add PBKDF2 support via openssl() Changed paths: MM ext/openssl/openssl.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Add PBKDF2 support via openssl(): ext/openssl/openssl.c ext/openssl/php_openssl.h ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt
Commit:f4847efc5d58b3375fa0f3269158d5e6ab625c21 Author:Scott MacVicar scott...@php.net Mon, 11 Jun 2012 00:16:30 -0700 Parents: b55e69285bdfa280b94673e8a9434be6c08c65dc Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f4847efc5d58b3375fa0f3269158d5e6ab625c21 Log: Add PBKDF2 support via openssl() Summary: No easy way to put these in the hash extension since we don't really support optional parameters to certain algorithms. Implemented in openssl for now since it has it already and is pretty stable. Only SHA1 is confirmed to work as an algorithm but openssl has a parameter so it can be changed in the future. Will backport to 5.4 potentially with Stas' approval. Test Plan: Ran newly added tests which came from RFC 6070 Changed paths: M ext/openssl/openssl.c M ext/openssl/php_openssl.h A ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt Diff: diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 7187a96..46f60b2 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -242,6 +242,14 @@ ZEND_BEGIN_ARG_INFO(arginfo_openssl_pkey_get_details, 0) ZEND_ARG_INFO(0, key) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs5_pbkdf2_hmac, 0, 0, 4) +ZEND_ARG_INFO(0, password) +ZEND_ARG_INFO(0, salt) +ZEND_ARG_INFO(0, key_length) +ZEND_ARG_INFO(0, iterations) +ZEND_ARG_INFO(0, digest_algorithm) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs7_verify, 0, 0, 2) ZEND_ARG_INFO(0, filename) ZEND_ARG_INFO(0, flags) @@ -428,6 +436,8 @@ const zend_function_entry openssl_functions[] = { PHP_FE(openssl_seal,arginfo_openssl_seal) PHP_FE(openssl_open,arginfo_openssl_open) + PHP_FE(openssl_pkcs5_pbkdf2_hmac,arginfo_openssl_pkcs5_pbkdf2_hmac) + /* for S/MIME handling */ PHP_FE(openssl_pkcs7_verify,arginfo_openssl_pkcs7_verify) PHP_FE(openssl_pkcs7_decrypt, arginfo_openssl_pkcs7_decrypt) @@ -3317,6 +3327,53 @@ PHP_FUNCTION(openssl_pkey_get_details) /* }}} */ +/* {{{ proto string openssl_pkcs5_pbkdf2_hmac(string password, string salt, long key_length, long iterations [, string digest_method = sha1]) + Generates a PKCS5 v2 PBKDF2 string, defaults to sha1 */ +PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac) +{ + long key_length = 0, iterations = 0; + char *password; int password_len; + char *salt; int salt_len; + char *method; int method_len = 0; + unsigned char *out_buffer; + + const EVP_MD *digest; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ssll|s, + password, password_len, + salt, salt_len, + key_length, iterations, + method, method_len) == FAILURE) { + return; + } + + if (key_length = 0) { + RETURN_FALSE; + } + + if (method_len) { + digest = EVP_get_digestbyname(method); + } else { + digest = EVP_sha1(); + } + + if (!digest) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Unknown signature algorithm); + RETURN_FALSE; + } + + out_buffer = emalloc(key_length + 1); + out_buffer[key_length] = '\0'; + + if (PKCS5_PBKDF2_HMAC(password, password_len, (unsigned char *)salt, salt_len, iterations, digest, key_length, out_buffer) == 1) { + RETVAL_STRINGL((char *)out_buffer, key_length, 0); + } else { + efree(out_buffer); + RETURN_FALSE; + } +} +/* }}} */ + /* {{{ PKCS7 S/MIME functions */ /* {{{ proto bool openssl_pkcs7_verify(string filename, long flags [, string signerscerts [, array cainfo [, string extracerts [, string content) diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h index fc118db..0dbe7d2 100644 --- a/ext/openssl/php_openssl.h +++ b/ext/openssl/php_openssl.h @@ -52,6 +52,8 @@ PHP_FUNCTION(openssl_private_decrypt); PHP_FUNCTION(openssl_public_encrypt); PHP_FUNCTION(openssl_public_decrypt); +PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac); + PHP_FUNCTION(openssl_pkcs7_verify); PHP_FUNCTION(openssl_pkcs7_decrypt); PHP_FUNCTION(openssl_pkcs7_sign); diff --git a/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt b/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt new file mode 100644 index 000..348d399 --- /dev/null +++ b/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt @@ -0,0 +1,26 @@ +--TEST-- +openssl_pkcs5_pbkdf2_hmac() tests +--SKIPIF-- +?php if (!extension_loaded(openssl)) print skip; ? +--FILE-- +?php +// official test vectors +var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 1))); +var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 2))); +var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 4096
[PHP-CVS] com php-src: Rename openssl_pkcs5_pbkdf2_hmac() to something that doesn't sound like a spell.: ext/openssl/CREDITS ext/openssl/openssl.c ext/openssl/php_openssl.h ext/openssl/tests/openssl_p
Commit:b481ebae5503c54f31d73ef0e2243f5ef9025d0d Author:Scott MacVicar scott...@php.net Mon, 11 Jun 2012 12:38:54 -0700 Parents: 733aaf23b1ba58e1a6abb9c0d00aedf67d143167 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b481ebae5503c54f31d73ef0e2243f5ef9025d0d Log: Rename openssl_pkcs5_pbkdf2_hmac() to something that doesn't sound like a spell. Summary: Stas pointed out that this is named pretty poorly. Go for openssl_pbkdf2() Changed paths: M ext/openssl/CREDITS M ext/openssl/openssl.c M ext/openssl/php_openssl.h A ext/openssl/tests/openssl_pbkdf2.phpt D ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt Diff: diff --git a/ext/openssl/CREDITS b/ext/openssl/CREDITS index c2f50d6..b685ce1 100644 --- a/ext/openssl/CREDITS +++ b/ext/openssl/CREDITS @@ -1,2 +1,2 @@ OpenSSL -Stig Venaas, Wez Furlong, Sascha Kettler +Stig Venaas, Wez Furlong, Sascha Kettler, Scott MacVicar diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 1f515c7..938e0e1 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -239,7 +239,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_openssl_pkey_get_details, 0) ZEND_END_ARG_INFO() #if OPENSSL_VERSION_NUMBER = 0x1000L -ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs5_pbkdf2_hmac, 0, 0, 4) +ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pbkdf2, 0, 0, 4) ZEND_ARG_INFO(0, password) ZEND_ARG_INFO(0, salt) ZEND_ARG_INFO(0, key_length) @@ -435,7 +435,7 @@ const zend_function_entry openssl_functions[] = { PHP_FE(openssl_open,arginfo_openssl_open) #if OPENSSL_VERSION_NUMBER = 0x1000L - PHP_FE(openssl_pkcs5_pbkdf2_hmac, arginfo_openssl_pkcs5_pbkdf2_hmac) + PHP_FE(openssl_pbkdf2, arginfo_openssl_pbkdf2) #endif /* for S/MIME handling */ @@ -3329,9 +3329,9 @@ PHP_FUNCTION(openssl_pkey_get_details) #if OPENSSL_VERSION_NUMBER = 0x1000L -/* {{{ proto string openssl_pkcs5_pbkdf2_hmac(string password, string salt, long key_length, long iterations [, string digest_method = sha1]) +/* {{{ proto string openssl_pbkdf2(string password, string salt, long key_length, long iterations [, string digest_method = sha1]) Generates a PKCS5 v2 PBKDF2 string, defaults to sha1 */ -PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac) +PHP_FUNCTION(openssl_pbkdf2) { long key_length = 0, iterations = 0; char *password; int password_len; diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h index 0dbe7d2..2de211a 100644 --- a/ext/openssl/php_openssl.h +++ b/ext/openssl/php_openssl.h @@ -52,7 +52,7 @@ PHP_FUNCTION(openssl_private_decrypt); PHP_FUNCTION(openssl_public_encrypt); PHP_FUNCTION(openssl_public_decrypt); -PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac); +PHP_FUNCTION(openssl_pbkdf2); PHP_FUNCTION(openssl_pkcs7_verify); PHP_FUNCTION(openssl_pkcs7_decrypt); diff --git a/ext/openssl/tests/openssl_pbkdf2.phpt b/ext/openssl/tests/openssl_pbkdf2.phpt new file mode 100644 index 000..3ec4dce --- /dev/null +++ b/ext/openssl/tests/openssl_pbkdf2.phpt @@ -0,0 +1,26 @@ +--TEST-- +openssl_pbkdf2() tests +--SKIPIF-- +?php if (!extension_loaded(openssl) || !function_exists(openssl_pbkdf2)) print skip; ? +--FILE-- +?php +// official test vectors +var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 1))); +var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 2))); +var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 4096))); + +/* really slow but should be: +string(40) eefe3d61cd4da4e4e9945b3d6ba2158c2634e984 +var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 16777216))); +*/ + +var_dump(bin2hex(openssl_pbkdf2('passwordPASSWORDpassword', 'saltSALTsaltSALTsaltSALTsaltSALTsalt', 25, 4096))); +var_dump(bin2hex(openssl_pbkdf2(pass\0word, sa\0lt, 16, 4096))); + +? +--EXPECTF-- +string(40) 0c60c80f961f0e71f3a9b524af6012062fe037a6 +string(40) ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957 +string(40) 4b007901b765489abead49d926f721d065a429c1 +string(50) 3d2eec4fe41c849b80c8d83662c0e44a8b291a964cf2f07038 +string(32) 56fa6aa75548099dcc37d7f03425e0c3 diff --git a/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt b/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt deleted file mode 100644 index af1fcb1..000 --- a/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -openssl_pkcs5_pbkdf2_hmac() tests ---SKIPIF-- -?php if (!extension_loaded(openssl) || !function_exists(openssl_pkcs5_pbkdf2_hmac)) print skip; ? ---FILE-- -?php -// official test vectors -var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 1))); -var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 2))); -var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 4096))); - -/* really slow but should be: -string(40) eefe3d61cd4da4e4e9945b3d6ba2158c2634e984 -var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 16777216))); -*/ - -var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('passwordPASSWORDpassword
[PHP-CVS] com php-src: Add PBKDF2 support via openssl(): ext/openssl/openssl.c ext/openssl/php_openssl.h ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt
Commit:8c565efd713a313d0a8286fa9a9cdacaaa25ccbc Author:Scott MacVicar scott...@php.net Mon, 11 Jun 2012 00:16:30 -0700 Parents: a18cede1c5094d5255daeb99cd6debe09938399d Branches: 5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8c565efd713a313d0a8286fa9a9cdacaaa25ccbc Log: Add PBKDF2 support via openssl() Summary: No easy way to put these in the hash extension since we don't really support optional parameters to certain algorithms. Implemented in openssl for now since it has it already and is pretty stable. Only SHA1 is confirmed to work as an algorithm but openssl has a parameter so it can be changed in the future. Will backport to 5.4 potentially with Stas' approval. Test Plan: Ran newly added tests which came from RFC 6070 Changed paths: M ext/openssl/openssl.c M ext/openssl/php_openssl.h A ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt Diff: diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 7187a96..46f60b2 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -242,6 +242,14 @@ ZEND_BEGIN_ARG_INFO(arginfo_openssl_pkey_get_details, 0) ZEND_ARG_INFO(0, key) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs5_pbkdf2_hmac, 0, 0, 4) +ZEND_ARG_INFO(0, password) +ZEND_ARG_INFO(0, salt) +ZEND_ARG_INFO(0, key_length) +ZEND_ARG_INFO(0, iterations) +ZEND_ARG_INFO(0, digest_algorithm) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs7_verify, 0, 0, 2) ZEND_ARG_INFO(0, filename) ZEND_ARG_INFO(0, flags) @@ -428,6 +436,8 @@ const zend_function_entry openssl_functions[] = { PHP_FE(openssl_seal,arginfo_openssl_seal) PHP_FE(openssl_open,arginfo_openssl_open) + PHP_FE(openssl_pkcs5_pbkdf2_hmac,arginfo_openssl_pkcs5_pbkdf2_hmac) + /* for S/MIME handling */ PHP_FE(openssl_pkcs7_verify,arginfo_openssl_pkcs7_verify) PHP_FE(openssl_pkcs7_decrypt, arginfo_openssl_pkcs7_decrypt) @@ -3317,6 +3327,53 @@ PHP_FUNCTION(openssl_pkey_get_details) /* }}} */ +/* {{{ proto string openssl_pkcs5_pbkdf2_hmac(string password, string salt, long key_length, long iterations [, string digest_method = sha1]) + Generates a PKCS5 v2 PBKDF2 string, defaults to sha1 */ +PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac) +{ + long key_length = 0, iterations = 0; + char *password; int password_len; + char *salt; int salt_len; + char *method; int method_len = 0; + unsigned char *out_buffer; + + const EVP_MD *digest; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ssll|s, + password, password_len, + salt, salt_len, + key_length, iterations, + method, method_len) == FAILURE) { + return; + } + + if (key_length = 0) { + RETURN_FALSE; + } + + if (method_len) { + digest = EVP_get_digestbyname(method); + } else { + digest = EVP_sha1(); + } + + if (!digest) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Unknown signature algorithm); + RETURN_FALSE; + } + + out_buffer = emalloc(key_length + 1); + out_buffer[key_length] = '\0'; + + if (PKCS5_PBKDF2_HMAC(password, password_len, (unsigned char *)salt, salt_len, iterations, digest, key_length, out_buffer) == 1) { + RETVAL_STRINGL((char *)out_buffer, key_length, 0); + } else { + efree(out_buffer); + RETURN_FALSE; + } +} +/* }}} */ + /* {{{ PKCS7 S/MIME functions */ /* {{{ proto bool openssl_pkcs7_verify(string filename, long flags [, string signerscerts [, array cainfo [, string extracerts [, string content) diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h index fc118db..0dbe7d2 100644 --- a/ext/openssl/php_openssl.h +++ b/ext/openssl/php_openssl.h @@ -52,6 +52,8 @@ PHP_FUNCTION(openssl_private_decrypt); PHP_FUNCTION(openssl_public_encrypt); PHP_FUNCTION(openssl_public_decrypt); +PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac); + PHP_FUNCTION(openssl_pkcs7_verify); PHP_FUNCTION(openssl_pkcs7_decrypt); PHP_FUNCTION(openssl_pkcs7_sign); diff --git a/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt b/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt new file mode 100644 index 000..348d399 --- /dev/null +++ b/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt @@ -0,0 +1,26 @@ +--TEST-- +openssl_pkcs5_pbkdf2_hmac() tests +--SKIPIF-- +?php if (!extension_loaded(openssl)) print skip; ? +--FILE-- +?php +// official test vectors +var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 1))); +var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 2))); +var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 4096
[PHP-CVS] branch php-src: 5.4 deleted
Deleted branch: 5.4 User: Scott MacVicar scott...@php.net Mon, 11 Jun 2012 20:48:09 + -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] branch php-src: PHP-5.4 deleted
Deleted branch: PHP-5.4 User: Scott MacVicar scott...@php.net Mon, 11 Jun 2012 20:48:31 + -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Add PBKDF2 support via openssl(): ext/openssl/openssl.c ext/openssl/php_openssl.h ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt
Commit:b5b8ea1050837fba5a6cee55e41b4574ed64158e Author:Scott MacVicar scott...@php.net Mon, 11 Jun 2012 00:16:30 -0700 Parents: a18cede1c5094d5255daeb99cd6debe09938399d Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b5b8ea1050837fba5a6cee55e41b4574ed64158e Log: Add PBKDF2 support via openssl() Summary: No easy way to put these in the hash extension since we don't really support optional parameters to certain algorithms. Implemented in openssl for now since it has it already and is pretty stable. Only SHA1 is confirmed to work as an algorithm but openssl has a parameter so it can be changed in the future. Will backport to 5.4 potentially with Stas' approval. Test Plan: Ran newly added tests which came from RFC 6070 Changed paths: M ext/openssl/openssl.c M ext/openssl/php_openssl.h A ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt Diff: diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 7187a96..28f7618 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -242,6 +242,16 @@ ZEND_BEGIN_ARG_INFO(arginfo_openssl_pkey_get_details, 0) ZEND_ARG_INFO(0, key) ZEND_END_ARG_INFO() +#if OPENSSL_VERSION_NUMBER = 0x1000L +ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs5_pbkdf2_hmac, 0, 0, 4) +ZEND_ARG_INFO(0, password) +ZEND_ARG_INFO(0, salt) +ZEND_ARG_INFO(0, key_length) +ZEND_ARG_INFO(0, iterations) +ZEND_ARG_INFO(0, digest_algorithm) +ZEND_END_ARG_INFO() +#endif + ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs7_verify, 0, 0, 2) ZEND_ARG_INFO(0, filename) ZEND_ARG_INFO(0, flags) @@ -428,6 +438,10 @@ const zend_function_entry openssl_functions[] = { PHP_FE(openssl_seal,arginfo_openssl_seal) PHP_FE(openssl_open,arginfo_openssl_open) +#if OPENSSL_VERSION_NUMBER = 0x1000L + PHP_FE(openssl_pkcs5_pbkdf2_hmac, arginfo_openssl_pkcs5_pbkdf2_hmac) +#endif + /* for S/MIME handling */ PHP_FE(openssl_pkcs7_verify,arginfo_openssl_pkcs7_verify) PHP_FE(openssl_pkcs7_decrypt, arginfo_openssl_pkcs7_decrypt) @@ -3317,6 +3331,57 @@ PHP_FUNCTION(openssl_pkey_get_details) /* }}} */ +#if OPENSSL_VERSION_NUMBER = 0x1000L + +/* {{{ proto string openssl_pkcs5_pbkdf2_hmac(string password, string salt, long key_length, long iterations [, string digest_method = sha1]) + Generates a PKCS5 v2 PBKDF2 string, defaults to sha1 */ +PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac) +{ + long key_length = 0, iterations = 0; + char *password; int password_len; + char *salt; int salt_len; + char *method; int method_len = 0; + unsigned char *out_buffer; + + const EVP_MD *digest; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ssll|s, + password, password_len, + salt, salt_len, + key_length, iterations, + method, method_len) == FAILURE) { + return; + } + + if (key_length = 0) { + RETURN_FALSE; + } + + if (method_len) { + digest = EVP_get_digestbyname(method); + } else { + digest = EVP_sha1(); + } + + if (!digest) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Unknown signature algorithm); + RETURN_FALSE; + } + + out_buffer = emalloc(key_length + 1); + out_buffer[key_length] = '\0'; + + if (PKCS5_PBKDF2_HMAC(password, password_len, (unsigned char *)salt, salt_len, iterations, digest, key_length, out_buffer) == 1) { + RETVAL_STRINGL((char *)out_buffer, key_length, 0); + } else { + efree(out_buffer); + RETURN_FALSE; + } +} +/* }}} */ + +#endif + /* {{{ PKCS7 S/MIME functions */ /* {{{ proto bool openssl_pkcs7_verify(string filename, long flags [, string signerscerts [, array cainfo [, string extracerts [, string content) diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h index fc118db..0dbe7d2 100644 --- a/ext/openssl/php_openssl.h +++ b/ext/openssl/php_openssl.h @@ -52,6 +52,8 @@ PHP_FUNCTION(openssl_private_decrypt); PHP_FUNCTION(openssl_public_encrypt); PHP_FUNCTION(openssl_public_decrypt); +PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac); + PHP_FUNCTION(openssl_pkcs7_verify); PHP_FUNCTION(openssl_pkcs7_decrypt); PHP_FUNCTION(openssl_pkcs7_sign); diff --git a/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt b/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt new file mode 100644 index 000..af1fcb1 --- /dev/null +++ b/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt @@ -0,0 +1,26 @@ +--TEST-- +openssl_pkcs5_pbkdf2_hmac() tests +--SKIPIF-- +?php if (!extension_loaded(openssl) || !function_exists(openssl_pkcs5_pbkdf2_hmac)) print skip; ? +--FILE-- +?php +// official test vectors +var_dump(bin2hex
[PHP-CVS] com php-src: Rename openssl_pkcs5_pbkdf2_hmac() to something that doesn't sound like a spell.: ext/openssl/CREDITS ext/openssl/openssl.c ext/openssl/php_openssl.h ext/openssl/tests/openssl_p
Commit:bccd1e672fabc3c788e93075221d47d9f077b167 Author:Scott MacVicar scott...@php.net Mon, 11 Jun 2012 12:38:54 -0700 Parents: b5b8ea1050837fba5a6cee55e41b4574ed64158e Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bccd1e672fabc3c788e93075221d47d9f077b167 Log: Rename openssl_pkcs5_pbkdf2_hmac() to something that doesn't sound like a spell. Summary: Stas pointed out that this is named pretty poorly. Go for openssl_pbkdf2() Changed paths: M ext/openssl/CREDITS M ext/openssl/openssl.c M ext/openssl/php_openssl.h A ext/openssl/tests/openssl_pbkdf2.phpt D ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt Diff: diff --git a/ext/openssl/CREDITS b/ext/openssl/CREDITS index c2f50d6..b685ce1 100644 --- a/ext/openssl/CREDITS +++ b/ext/openssl/CREDITS @@ -1,2 +1,2 @@ OpenSSL -Stig Venaas, Wez Furlong, Sascha Kettler +Stig Venaas, Wez Furlong, Sascha Kettler, Scott MacVicar diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 28f7618..4d482e8 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -243,7 +243,7 @@ ZEND_BEGIN_ARG_INFO(arginfo_openssl_pkey_get_details, 0) ZEND_END_ARG_INFO() #if OPENSSL_VERSION_NUMBER = 0x1000L -ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pkcs5_pbkdf2_hmac, 0, 0, 4) +ZEND_BEGIN_ARG_INFO_EX(arginfo_openssl_pbkdf2, 0, 0, 4) ZEND_ARG_INFO(0, password) ZEND_ARG_INFO(0, salt) ZEND_ARG_INFO(0, key_length) @@ -439,7 +439,7 @@ const zend_function_entry openssl_functions[] = { PHP_FE(openssl_open,arginfo_openssl_open) #if OPENSSL_VERSION_NUMBER = 0x1000L - PHP_FE(openssl_pkcs5_pbkdf2_hmac, arginfo_openssl_pkcs5_pbkdf2_hmac) + PHP_FE(openssl_pbkdf2, arginfo_openssl_pbkdf2) #endif /* for S/MIME handling */ @@ -,9 +,9 @@ PHP_FUNCTION(openssl_pkey_get_details) #if OPENSSL_VERSION_NUMBER = 0x1000L -/* {{{ proto string openssl_pkcs5_pbkdf2_hmac(string password, string salt, long key_length, long iterations [, string digest_method = sha1]) +/* {{{ proto string openssl_pbkdf2(string password, string salt, long key_length, long iterations [, string digest_method = sha1]) Generates a PKCS5 v2 PBKDF2 string, defaults to sha1 */ -PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac) +PHP_FUNCTION(openssl_pbkdf2) { long key_length = 0, iterations = 0; char *password; int password_len; diff --git a/ext/openssl/php_openssl.h b/ext/openssl/php_openssl.h index 0dbe7d2..2de211a 100644 --- a/ext/openssl/php_openssl.h +++ b/ext/openssl/php_openssl.h @@ -52,7 +52,7 @@ PHP_FUNCTION(openssl_private_decrypt); PHP_FUNCTION(openssl_public_encrypt); PHP_FUNCTION(openssl_public_decrypt); -PHP_FUNCTION(openssl_pkcs5_pbkdf2_hmac); +PHP_FUNCTION(openssl_pbkdf2); PHP_FUNCTION(openssl_pkcs7_verify); PHP_FUNCTION(openssl_pkcs7_decrypt); diff --git a/ext/openssl/tests/openssl_pbkdf2.phpt b/ext/openssl/tests/openssl_pbkdf2.phpt new file mode 100644 index 000..3ec4dce --- /dev/null +++ b/ext/openssl/tests/openssl_pbkdf2.phpt @@ -0,0 +1,26 @@ +--TEST-- +openssl_pbkdf2() tests +--SKIPIF-- +?php if (!extension_loaded(openssl) || !function_exists(openssl_pbkdf2)) print skip; ? +--FILE-- +?php +// official test vectors +var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 1))); +var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 2))); +var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 4096))); + +/* really slow but should be: +string(40) eefe3d61cd4da4e4e9945b3d6ba2158c2634e984 +var_dump(bin2hex(openssl_pbkdf2('password', 'salt', 20, 16777216))); +*/ + +var_dump(bin2hex(openssl_pbkdf2('passwordPASSWORDpassword', 'saltSALTsaltSALTsaltSALTsaltSALTsalt', 25, 4096))); +var_dump(bin2hex(openssl_pbkdf2(pass\0word, sa\0lt, 16, 4096))); + +? +--EXPECTF-- +string(40) 0c60c80f961f0e71f3a9b524af6012062fe037a6 +string(40) ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957 +string(40) 4b007901b765489abead49d926f721d065a429c1 +string(50) 3d2eec4fe41c849b80c8d83662c0e44a8b291a964cf2f07038 +string(32) 56fa6aa75548099dcc37d7f03425e0c3 diff --git a/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt b/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt deleted file mode 100644 index af1fcb1..000 --- a/ext/openssl/tests/openssl_pkcs5_pbkdf2_hmac.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -openssl_pkcs5_pbkdf2_hmac() tests ---SKIPIF-- -?php if (!extension_loaded(openssl) || !function_exists(openssl_pkcs5_pbkdf2_hmac)) print skip; ? ---FILE-- -?php -// official test vectors -var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 1))); -var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 2))); -var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 4096))); - -/* really slow but should be: -string(40) eefe3d61cd4da4e4e9945b3d6ba2158c2634e984 -var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac('password', 'salt', 20, 16777216))); -*/ - -var_dump(bin2hex(openssl_pkcs5_pbkdf2_hmac
[PHP-CVS] com php-src: Add PBKDF2 support via openssl(): ext/openssl/openssl.c
Commit:aadf59dfa4be09147671de33786dc157716705df Author:Scott MacVicar scott...@php.net Mon, 11 Jun 2012 00:16:30 -0700 Parents: b481ebae5503c54f31d73ef0e2243f5ef9025d0d Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=aadf59dfa4be09147671de33786dc157716705df Log: Add PBKDF2 support via openssl() Summary: No easy way to put these in the hash extension since we don't really support optional parameters to certain algorithms. Implemented in openssl for now since it has it already and is pretty stable. Only SHA1 is confirmed to work as an algorithm but openssl has a parameter so it can be changed in the future. Will backport to 5.4 potentially with Stas' approval. Test Plan: Ran newly added tests which came from RFC 6070 Changed paths: M ext/openssl/openssl.c Diff: diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index 938e0e1..f7db37b 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -3328,7 +3328,6 @@ PHP_FUNCTION(openssl_pkey_get_details) /* }}} */ #if OPENSSL_VERSION_NUMBER = 0x1000L - /* {{{ proto string openssl_pbkdf2(string password, string salt, long key_length, long iterations [, string digest_method = sha1]) Generates a PKCS5 v2 PBKDF2 string, defaults to sha1 */ PHP_FUNCTION(openssl_pbkdf2) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch '5.4': ext/openssl/openssl.c
Commit:bcd671d999bcb9aac3691c59e632d91575ea87a0 Author:Scott MacVicar scott...@php.net Mon, 11 Jun 2012 16:04:01 -0700 Parents: aadf59dfa4be09147671de33786dc157716705df bccd1e672fabc3c788e93075221d47d9f077b167 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bcd671d999bcb9aac3691c59e632d91575ea87a0 Log: Merge branch '5.4' * 5.4: Rename openssl_pkcs5_pbkdf2_hmac() to something that doesn't sound like a spell. Add PBKDF2 support via openssl() Conflicts: ext/openssl/openssl.c Changed paths: MM ext/openssl/openssl.c Diff: diff --cc ext/openssl/openssl.c index f7db37b,4d482e8..d0ed15e --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@@ -3328,6 -3332,7 +3328,10 @@@ PHP_FUNCTION(openssl_pkey_get_details /* }}} */ #if OPENSSL_VERSION_NUMBER = 0x1000L ++ HEAD ++=== + ++ 5.4 /* {{{ proto string openssl_pbkdf2(string password, string salt, long key_length, long iterations [, string digest_method = sha1]) Generates a PKCS5 v2 PBKDF2 string, defaults to sha1 */ PHP_FUNCTION(openssl_pbkdf2) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: One more time: ext/openssl/openssl.c
Commit:5b3c9f4fd1fbaa251beea37ff7870f6523320672 Author:Scott MacVicar scott...@php.net Mon, 11 Jun 2012 16:23:27 -0700 Parents: bcd671d999bcb9aac3691c59e632d91575ea87a0 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5b3c9f4fd1fbaa251beea37ff7870f6523320672 Log: One more time Changed paths: M ext/openssl/openssl.c Diff: diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c index d0ed15e..938e0e1 100644 --- a/ext/openssl/openssl.c +++ b/ext/openssl/openssl.c @@ -3328,10 +3328,7 @@ PHP_FUNCTION(openssl_pkey_get_details) /* }}} */ #if OPENSSL_VERSION_NUMBER = 0x1000L - HEAD -=== - 5.4 /* {{{ proto string openssl_pbkdf2(string password, string salt, long key_length, long iterations [, string digest_method = sha1]) Generates a PKCS5 v2 PBKDF2 string, defaults to sha1 */ PHP_FUNCTION(openssl_pbkdf2) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/openssl/openssl.c branches/PHP_5_4/NEWS branches/PHP_5_4/ext/openssl/openssl.c trunk/ext/openssl/openssl.c
scottmac Thu, 23 Feb 2012 01:26:46 + Revision: http://svn.php.net/viewvc?view=revisionrevision=323440 Log: Fixed bug #61124 (Crash when decoding an invalid base64 encoded string). Bug: https://bugs.php.net/61124 (Assigned) Segmentation fault Changed paths: U php/php-src/branches/PHP_5_3/ext/openssl/openssl.c U php/php-src/branches/PHP_5_4/NEWS U php/php-src/branches/PHP_5_4/ext/openssl/openssl.c U php/php-src/trunk/ext/openssl/openssl.c Modified: php/php-src/branches/PHP_5_3/ext/openssl/openssl.c === --- php/php-src/branches/PHP_5_3/ext/openssl/openssl.c 2012-02-22 23:42:18 UTC (rev 323439) +++ php/php-src/branches/PHP_5_3/ext/openssl/openssl.c 2012-02-23 01:26:46 UTC (rev 323440) @@ -4776,6 +4776,10 @@ if (!raw_input) { base64_str = (char*)php_base64_decode((unsigned char*)data, data_len, base64_str_len); + if (!base64_str) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed to base64 decode the input); + RETURN_FALSE; + } data_len = base64_str_len; data = base64_str; } Modified: php/php-src/branches/PHP_5_4/NEWS === --- php/php-src/branches/PHP_5_4/NEWS 2012-02-22 23:42:18 UTC (rev 323439) +++ php/php-src/branches/PHP_5_4/NEWS 2012-02-23 01:26:46 UTC (rev 323440) @@ -1,6 +1,9 @@ PHPNEWS ||| ?? ??? 2012, PHP 5.4.0 RC 9 +- OpenSSL: + . Fixed bug #61124 (Crash when decoding an invalid base64 encoded string). +(me at ktamura dot com, Scott) 15 Feb 2012, PHP 5.4.0 RC 8 - Core: Modified: php/php-src/branches/PHP_5_4/ext/openssl/openssl.c === --- php/php-src/branches/PHP_5_4/ext/openssl/openssl.c 2012-02-22 23:42:18 UTC (rev 323439) +++ php/php-src/branches/PHP_5_4/ext/openssl/openssl.c 2012-02-23 01:26:46 UTC (rev 323440) @@ -4803,6 +4803,10 @@ if (!(options OPENSSL_RAW_DATA)) { base64_str = (char*)php_base64_decode((unsigned char*)data, data_len, base64_str_len); + if (!base64_str) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed to base64 decode the input); + RETURN_FALSE; + } data_len = base64_str_len; data = base64_str; } Modified: php/php-src/trunk/ext/openssl/openssl.c === --- php/php-src/trunk/ext/openssl/openssl.c 2012-02-22 23:42:18 UTC (rev 323439) +++ php/php-src/trunk/ext/openssl/openssl.c 2012-02-23 01:26:46 UTC (rev 323440) @@ -4799,6 +4799,10 @@ if (!(options OPENSSL_RAW_DATA)) { base64_str = (char*)php_base64_decode((unsigned char*)data, data_len, base64_str_len); + if (!base64_str) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed to base64 decode the input); + RETURN_FALSE; + } data_len = base64_str_len; data = base64_str; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ NEWS ext/ftp/ftp.c ext/openssl/xp_ssl.c
scottmac Thu, 26 Jan 2012 05:15:57 + Revision: http://svn.php.net/viewvc?view=revisionrevision=322785 Log: MFH r322485 Fix possible attack in SSL sockets with SSL 3.0 / TLS 1.0. CVE-2011-3389 Changed paths: U php/php-src/branches/PHP_5_4/NEWS U php/php-src/branches/PHP_5_4/ext/ftp/ftp.c U php/php-src/branches/PHP_5_4/ext/openssl/xp_ssl.c Modified: php/php-src/branches/PHP_5_4/NEWS === --- php/php-src/branches/PHP_5_4/NEWS 2012-01-26 04:16:32 UTC (rev 322784) +++ php/php-src/branches/PHP_5_4/NEWS 2012-01-26 05:15:57 UTC (rev 322785) @@ -1,6 +1,8 @@ PHPNEWS ||| -?? Jan 2012, PHP 5.4.0 +?? Jan 2012, PHP 5.4.0 RC 7 +- Fix possible attack in SSL sockets with SSL 3.0 / TLS 1.0. + CVE-2011-3389. (Scott) 19 Jan 2012, PHP 5.4.0 RC6 Modified: php/php-src/branches/PHP_5_4/ext/ftp/ftp.c === --- php/php-src/branches/PHP_5_4/ext/ftp/ftp.c 2012-01-26 04:16:32 UTC (rev 322784) +++ php/php-src/branches/PHP_5_4/ext/ftp/ftp.c 2012-01-26 05:15:57 UTC (rev 322785) @@ -243,6 +243,7 @@ { #if HAVE_OPENSSL_EXT SSL_CTX *ctx = NULL; + long ssl_ctx_options = SSL_OP_ALL; #endif if (ftp == NULL) { return 0; @@ -279,7 +280,10 @@ return 0; } - SSL_CTX_set_options(ctx, SSL_OP_ALL); +#if OPENSSL_VERSION_NUMBER = 0x0090605fL + ssl_ctx_options = ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS; +#endif + SSL_CTX_set_options(ctx, ssl_ctx_options); ftp-ssl_handle = SSL_new(ctx); if (ftp-ssl_handle == NULL) { @@ -1495,6 +1499,7 @@ #if HAVE_OPENSSL_EXT SSL_CTX *ctx; + long ssl_ctx_options = SSL_OP_ALL; #endif if (data-fd != -1) { @@ -1521,7 +1526,10 @@ return 0; } - SSL_CTX_set_options(ctx, SSL_OP_ALL); +#if OPENSSL_VERSION_NUMBER = 0x0090605fL + ssl_ctx_options = ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS; +#endif + SSL_CTX_set_options(ctx, ssl_ctx_options); data-ssl_handle = SSL_new(ctx); if (data-ssl_handle == NULL) { Modified: php/php-src/branches/PHP_5_4/ext/openssl/xp_ssl.c === --- php/php-src/branches/PHP_5_4/ext/openssl/xp_ssl.c 2012-01-26 04:16:32 UTC (rev 322784) +++ php/php-src/branches/PHP_5_4/ext/openssl/xp_ssl.c 2012-01-26 05:15:57 UTC (rev 322785) @@ -310,6 +310,7 @@ TSRMLS_DC) { SSL_METHOD *method; + long ssl_ctx_options = SSL_OP_ALL; if (sslsock-ssl_handle) { if (sslsock-s.is_blocked) { @@ -377,7 +378,10 @@ return -1; } - SSL_CTX_set_options(sslsock-ctx, SSL_OP_ALL); +#if OPENSSL_VERSION_NUMBER = 0x0090605fL + ssl_ctx_options = ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS; +#endif + SSL_CTX_set_options(sslsock-ctx, ssl_ctx_options); #if OPENSSL_VERSION_NUMBER = 0x0090806fL { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/ ftp/ftp.c openssl/xp_ssl.c
scottmac Fri, 20 Jan 2012 05:31:53 + Revision: http://svn.php.net/viewvc?view=revisionrevision=322485 Log: Fix CVE-2011-3389. Possible attack on CBC mode with TLS 1.0. See http://www.openssl.org/~bodo/tls-cbc.txt The biggest reason for this mode being in SSL_OP_ALL was older versions of IE (2002) talking to servers using OpenSSL. Can hopefully get this into 5.4. Changed paths: U php/php-src/trunk/ext/ftp/ftp.c U php/php-src/trunk/ext/openssl/xp_ssl.c Modified: php/php-src/trunk/ext/ftp/ftp.c === --- php/php-src/trunk/ext/ftp/ftp.c 2012-01-20 05:16:03 UTC (rev 322484) +++ php/php-src/trunk/ext/ftp/ftp.c 2012-01-20 05:31:53 UTC (rev 322485) @@ -243,6 +243,7 @@ { #if HAVE_OPENSSL_EXT SSL_CTX *ctx = NULL; + long ssl_ctx_options = SSL_OP_ALL; #endif if (ftp == NULL) { return 0; @@ -279,7 +280,10 @@ return 0; } - SSL_CTX_set_options(ctx, SSL_OP_ALL); +#if OPENSSL_VERSION_NUMBER = 0x0090605fL + ssl_ctx_options = ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS; +#endif + SSL_CTX_set_options(ctx, ssl_ctx_options); ftp-ssl_handle = SSL_new(ctx); if (ftp-ssl_handle == NULL) { @@ -1495,6 +1499,7 @@ #if HAVE_OPENSSL_EXT SSL_CTX *ctx; + long ssl_ctx_options = SSL_OP_ALL; #endif if (data-fd != -1) { @@ -1521,7 +1526,10 @@ return 0; } - SSL_CTX_set_options(ctx, SSL_OP_ALL); +#if OPENSSL_VERSION_NUMBER = 0x0090605fL + ssl_ctx_options = ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS; +#endif + SSL_CTX_set_options(ctx, ssl_ctx_options); data-ssl_handle = SSL_new(ctx); if (data-ssl_handle == NULL) { Modified: php/php-src/trunk/ext/openssl/xp_ssl.c === --- php/php-src/trunk/ext/openssl/xp_ssl.c 2012-01-20 05:16:03 UTC (rev 322484) +++ php/php-src/trunk/ext/openssl/xp_ssl.c 2012-01-20 05:31:53 UTC (rev 322485) @@ -310,6 +310,7 @@ TSRMLS_DC) { SSL_METHOD *method; + long ssl_ctx_options = SSL_OP_ALL; if (sslsock-ssl_handle) { if (sslsock-s.is_blocked) { @@ -377,7 +378,10 @@ return -1; } - SSL_CTX_set_options(sslsock-ctx, SSL_OP_ALL); +#if OPENSSL_VERSION_NUMBER = 0x0090605fL + ssl_ctx_options = ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS; +#endif + SSL_CTX_set_options(sslsock-ctx, ssl_ctx_options); #if OPENSSL_VERSION_NUMBER = 0x0090806fL { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/openssl/tests/openssl_encrypt_crash.phpt branches/PHP_5_4/ext/openssl/tests/openssl_encrypt_crash.phpt trunk/ext/openssl/tests/openssl_encrypt_crash.p
scottmac Mon, 19 Dec 2011 03:09:05 + Revision: http://svn.php.net/viewvc?view=revisionrevision=321148 Log: Add tests for OpenSSL crash. Changed paths: A php/php-src/branches/PHP_5_3/ext/openssl/tests/openssl_encrypt_crash.phpt A php/php-src/branches/PHP_5_4/ext/openssl/tests/openssl_encrypt_crash.phpt A php/php-src/trunk/ext/openssl/tests/openssl_encrypt_crash.phpt Added: php/php-src/branches/PHP_5_3/ext/openssl/tests/openssl_encrypt_crash.phpt === --- php/php-src/branches/PHP_5_3/ext/openssl/tests/openssl_encrypt_crash.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/openssl/tests/openssl_encrypt_crash.phpt 2011-12-19 03:09:05 UTC (rev 321148) @@ -0,0 +1,13 @@ +--TEST-- +openssl_encrypt() crash with old OpenSSL +--SKIPIF-- +?php if (!extension_loaded(openssl)) print skip; ? +--FILE-- +?php +openssl_encrypt('', 'AES-128-CBC', 'foo'); +var_dump(done); +? +--EXPECTF-- + +Warning: openssl_encrypt(): Using an empty Initialization Vector (iv) is potentially insecure and not recommended in %s on line %d +string(4) done \ No newline at end of file Added: php/php-src/branches/PHP_5_4/ext/openssl/tests/openssl_encrypt_crash.phpt === --- php/php-src/branches/PHP_5_4/ext/openssl/tests/openssl_encrypt_crash.phpt (rev 0) +++ php/php-src/branches/PHP_5_4/ext/openssl/tests/openssl_encrypt_crash.phpt 2011-12-19 03:09:05 UTC (rev 321148) @@ -0,0 +1,13 @@ +--TEST-- +openssl_encrypt() crash with old OpenSSL +--SKIPIF-- +?php if (!extension_loaded(openssl)) print skip; ? +--FILE-- +?php +openssl_encrypt('', 'AES-128-CBC', 'foo'); +var_dump(done); +? +--EXPECTF-- + +Warning: openssl_encrypt(): Using an empty Initialization Vector (iv) is potentially insecure and not recommended in %s on line %d +string(4) done \ No newline at end of file Added: php/php-src/trunk/ext/openssl/tests/openssl_encrypt_crash.phpt === --- php/php-src/trunk/ext/openssl/tests/openssl_encrypt_crash.phpt (rev 0) +++ php/php-src/trunk/ext/openssl/tests/openssl_encrypt_crash.phpt 2011-12-19 03:09:05 UTC (rev 321148) @@ -0,0 +1,13 @@ +--TEST-- +openssl_encrypt() crash with old OpenSSL +--SKIPIF-- +?php if (!extension_loaded(openssl)) print skip; ? +--FILE-- +?php +openssl_encrypt('', 'AES-128-CBC', 'foo'); +var_dump(done); +? +--EXPECTF-- + +Warning: openssl_encrypt(): Using an empty Initialization Vector (iv) is potentially insecure and not recommended in %s on line %d +string(4) done \ No newline at end of file -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/openssl/openssl.c branches/PHP_5_4/NEWS branches/PHP_5_4/ext/openssl/openssl.c trunk/ext/openssl/openssl.c
scottmac Sun, 18 Dec 2011 05:14:32 + Revision: http://svn.php.net/viewvc?view=revisionrevision=321094 Log: Fix segfault in older versions of OpenSSL (before 0.9.8i) Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/openssl/openssl.c U php/php-src/branches/PHP_5_4/NEWS U php/php-src/branches/PHP_5_4/ext/openssl/openssl.c U php/php-src/trunk/ext/openssl/openssl.c Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2011-12-18 01:04:35 UTC (rev 321093) +++ php/php-src/branches/PHP_5_3/NEWS 2011-12-18 05:14:32 UTC (rev 321094) @@ -6,6 +6,9 @@ . Added max_input_vars directive to prevent attacks based on hash collisions (Dmitry). +- OpenSSL: + . Fix segfault with older versions of OpenSSL. (Scott) + - Streams: . Fixed bug #60455 (stream_get_line misbehaves if EOF is not detected together with the last read). (Gustavo) Modified: php/php-src/branches/PHP_5_3/ext/openssl/openssl.c === --- php/php-src/branches/PHP_5_3/ext/openssl/openssl.c 2011-12-18 01:04:35 UTC (rev 321093) +++ php/php-src/branches/PHP_5_3/ext/openssl/openssl.c 2011-12-18 05:14:32 UTC (rev 321094) @@ -4713,7 +4713,9 @@ EVP_CIPHER_CTX_set_key_length(cipher_ctx, password_len); } EVP_EncryptInit_ex(cipher_ctx, NULL, NULL, key, (unsigned char *)iv); - EVP_EncryptUpdate(cipher_ctx, outbuf, i, (unsigned char *)data, data_len); + if (data_len 0) { + EVP_EncryptUpdate(cipher_ctx, outbuf, i, (unsigned char *)data, data_len); + } outlen = i; if (EVP_EncryptFinal(cipher_ctx, (unsigned char *)outbuf + i, i)) { outlen += i; Modified: php/php-src/branches/PHP_5_4/NEWS === --- php/php-src/branches/PHP_5_4/NEWS 2011-12-18 01:04:35 UTC (rev 321093) +++ php/php-src/branches/PHP_5_4/NEWS 2011-12-18 05:14:32 UTC (rev 321094) @@ -5,11 +5,16 @@ . Added max_input_vars directive to prevent attacks based on hash collisions (Dmitry). . Fixed bug #60536 (Traits Segfault). (Laruence) + - CLI SAPI: . Fixed bug #60477 (Segfault after two multipart/form-data POST requests, one 200 RQ and one 404). (Laruence) . Fixed bug #60523 (PHP Errors are not reported in browsers using built-in SAPI). (Laruence, Derick) + +- OpenSSL: + . Fix segfault with older versions of OpenSSL. (Scott) + - Pdo Firebird: . Fixed bug #48877 (bindValue and bindParam do not work for PDO Firebird). (Mariuz) Modified: php/php-src/branches/PHP_5_4/ext/openssl/openssl.c === --- php/php-src/branches/PHP_5_4/ext/openssl/openssl.c 2011-12-18 01:04:35 UTC (rev 321093) +++ php/php-src/branches/PHP_5_4/ext/openssl/openssl.c 2011-12-18 05:14:32 UTC (rev 321094) @@ -4740,7 +4740,9 @@ if (options OPENSSL_ZERO_PADDING) { EVP_CIPHER_CTX_set_padding(cipher_ctx, 0); } - EVP_EncryptUpdate(cipher_ctx, outbuf, i, (unsigned char *)data, data_len); + if (data_len 0) { + EVP_EncryptUpdate(cipher_ctx, outbuf, i, (unsigned char *)data, data_len); + } outlen = i; if (EVP_EncryptFinal(cipher_ctx, (unsigned char *)outbuf + i, i)) { outlen += i; Modified: php/php-src/trunk/ext/openssl/openssl.c === --- php/php-src/trunk/ext/openssl/openssl.c 2011-12-18 01:04:35 UTC (rev 321093) +++ php/php-src/trunk/ext/openssl/openssl.c 2011-12-18 05:14:32 UTC (rev 321094) @@ -4736,7 +4736,9 @@ if (options OPENSSL_ZERO_PADDING) { EVP_CIPHER_CTX_set_padding(cipher_ctx, 0); } - EVP_EncryptUpdate(cipher_ctx, outbuf, i, (unsigned char *)data, data_len); + if (data_len 0) { + EVP_EncryptUpdate(cipher_ctx, outbuf, i, (unsigned char *)data, data_len); + } outlen = i; if (EVP_EncryptFinal(cipher_ctx, (unsigned char *)outbuf + i, i)) { outlen += i; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/NEWS branches/PHP_5_4/ext/openssl/openssl.c trunk/ext/openssl/openssl.c
scottmac Wed, 07 Dec 2011 20:50:33 + Revision: http://svn.php.net/viewvc?view=revisionrevision=320612 Log: Make sure that we set the strong crypto result to false as well as returning false. Changed paths: U php/php-src/branches/PHP_5_4/NEWS U php/php-src/branches/PHP_5_4/ext/openssl/openssl.c U php/php-src/trunk/ext/openssl/openssl.c Modified: php/php-src/branches/PHP_5_4/NEWS === --- php/php-src/branches/PHP_5_4/NEWS 2011-12-07 20:36:39 UTC (rev 320611) +++ php/php-src/branches/PHP_5_4/NEWS 2011-12-07 20:50:33 UTC (rev 320612) @@ -18,6 +18,10 @@ - Intl: . Added support for UTS #46. (Gustavo) + +- OpenSSL: + . On error in openssl_random_pseudo_bytes() make sure we set strong result +to false. (Scott) - Reflection: . Fixed bug #60367 (Reflection and Late Static Binding). (Laruence) Modified: php/php-src/branches/PHP_5_4/ext/openssl/openssl.c === --- php/php-src/branches/PHP_5_4/ext/openssl/openssl.c 2011-12-07 20:36:39 UTC (rev 320611) +++ php/php-src/branches/PHP_5_4/ext/openssl/openssl.c 2011-12-07 20:50:33 UTC (rev 320612) @@ -4941,13 +4941,19 @@ #ifdef PHP_WIN32 strong_result = 1; /* random/urandom equivalent on Windows */ - if (php_win32_get_random_bytes(buffer, (size_t) buffer_length) == FAILURE){ + if (php_win32_get_random_bytes(buffer, (size_t) buffer_length) == FAILURE) { efree(buffer); + if (zstrong_result_returned) { + ZVAL_BOOL(zstrong_result_returned, 0); + } RETURN_FALSE; } #else if ((strong_result = RAND_pseudo_bytes(buffer, buffer_length)) 0) { efree(buffer); + if (zstrong_result_returned) { + ZVAL_BOOL(zstrong_result_returned, 0); + } RETURN_FALSE; } #endif Modified: php/php-src/trunk/ext/openssl/openssl.c === --- php/php-src/trunk/ext/openssl/openssl.c 2011-12-07 20:36:39 UTC (rev 320611) +++ php/php-src/trunk/ext/openssl/openssl.c 2011-12-07 20:50:33 UTC (rev 320612) @@ -4939,11 +4939,17 @@ /* random/urandom equivalent on Windows */ if (php_win32_get_random_bytes(buffer, (size_t) buffer_length) == FAILURE){ efree(buffer); + if (zstrong_result_returned) { + ZVAL_BOOL(zstrong_result_returned, 0); + } RETURN_FALSE; } #else if ((strong_result = RAND_pseudo_bytes(buffer, buffer_length)) 0) { efree(buffer); + if (zstrong_result_returned) { + ZVAL_BOOL(zstrong_result_returned, 0); + } RETURN_FALSE; } #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/ext/ldap/tests/ldap_control_paged_results_variation2.phpt trunk/ext/ldap/tests/ldap_control_paged_results_variation2.phpt
scottmac Wed, 24 Aug 2011 06:50:39 + Revision: http://svn.php.net/viewvc?view=revisionrevision=315407 Log: Fix typo in tests for ldap bug #42060 Bug: https://bugs.php.net/42060 (Feedback) [PATCH] LDAP: Add pagedResults support and more Changed paths: U php/php-src/branches/PHP_5_4/ext/ldap/tests/ldap_control_paged_results_variation2.phpt U php/php-src/trunk/ext/ldap/tests/ldap_control_paged_results_variation2.phpt Modified: php/php-src/branches/PHP_5_4/ext/ldap/tests/ldap_control_paged_results_variation2.phpt === --- php/php-src/branches/PHP_5_4/ext/ldap/tests/ldap_control_paged_results_variation2.phpt 2011-08-24 06:47:08 UTC (rev 315406) +++ php/php-src/branches/PHP_5_4/ext/ldap/tests/ldap_control_paged_results_variation2.phpt 2011-08-24 06:50:39 UTC (rev 315407) @@ -1,5 +1,5 @@ --TEST-- -ldap_ldap_control_paged_results() test (fetching the first page with a pagesize=2) +ldap_ldap_control_paged_result() test (fetching the first page with a pagesize=2) --CREDITS-- Jean-Sebastien Hedde jean...@au-fil-du.net --SKIPIF-- @@ -17,7 +17,7 @@ $dn = dc=my-domain,dc=com; $filter = (cn=*); var_dump( - ldap_control_paged_results($link, 2), + ldap_control_paged_result($link, 2), $result = ldap_search($link, $dn, $filter, array('cn')), ldap_get_entries($link, $result) ); Modified: php/php-src/trunk/ext/ldap/tests/ldap_control_paged_results_variation2.phpt === --- php/php-src/trunk/ext/ldap/tests/ldap_control_paged_results_variation2.phpt 2011-08-24 06:47:08 UTC (rev 315406) +++ php/php-src/trunk/ext/ldap/tests/ldap_control_paged_results_variation2.phpt 2011-08-24 06:50:39 UTC (rev 315407) @@ -1,5 +1,5 @@ --TEST-- -ldap_ldap_control_paged_results() test (fetching the first page with a pagesize=2) +ldap_ldap_control_paged_result() test (fetching the first page with a pagesize=2) --CREDITS-- Jean-Sebastien Hedde jean...@au-fil-du.net --SKIPIF-- @@ -17,7 +17,7 @@ $dn = dc=my-domain,dc=com; $filter = (cn=*); var_dump( - ldap_control_paged_results($link, 2), + ldap_control_paged_result($link, 2), $result = ldap_search($link, $dn, $filter, array('cn')), ldap_get_entries($link, $result) ); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/standard/php_crypt_r.c branches/PHP_5_4/ext/standard/php_crypt_r.c trunk/ext/standard/php_crypt_r.c
Sigh, I wonder how many str*l* functions were introduced that were incorrect? Looks like there wasn't an understanding that strlcat is for the destination not source. On Aug 19, 2011, at 3:49 PM, Stanislav Malyshev wrote: stas Fri, 19 Aug 2011 22:49:18 + Revision: http://svn.php.net/viewvc?view=revisionrevision=315218 Log: Unbreak crypt() (fix bug #55439) # If you want to remove static analyser messages, be my guest, # but please run unit tests after Bug: https://bugs.php.net/55439 (Assigned) crypt() returns only the salt for MD5 Changed paths: U php/php-src/branches/PHP_5_3/ext/standard/php_crypt_r.c U php/php-src/branches/PHP_5_4/ext/standard/php_crypt_r.c U php/php-src/trunk/ext/standard/php_crypt_r.c Modified: php/php-src/branches/PHP_5_3/ext/standard/php_crypt_r.c === --- php/php-src/branches/PHP_5_3/ext/standard/php_crypt_r.c 2011-08-19 22:45:43 UTC (rev 315217) +++ php/php-src/branches/PHP_5_3/ext/standard/php_crypt_r.c 2011-08-19 22:49:18 UTC (rev 315218) @@ -382,7 +382,7 @@ /* Now make the output string */ memcpy(passwd, MD5_MAGIC, MD5_MAGIC_LEN); strlcpy(passwd + MD5_MAGIC_LEN, sp, sl + 1); - strlcat(passwd, $, 1); + strcat(passwd, $); PHP_MD5Final(final, ctx); Modified: php/php-src/branches/PHP_5_4/ext/standard/php_crypt_r.c === --- php/php-src/branches/PHP_5_4/ext/standard/php_crypt_r.c 2011-08-19 22:45:43 UTC (rev 315217) +++ php/php-src/branches/PHP_5_4/ext/standard/php_crypt_r.c 2011-08-19 22:49:18 UTC (rev 315218) @@ -377,7 +377,7 @@ /* Now make the output string */ memcpy(passwd, MD5_MAGIC, MD5_MAGIC_LEN); strlcpy(passwd + MD5_MAGIC_LEN, sp, sl + 1); - strlcat(passwd, $, 1); + strcat(passwd, $); PHP_MD5Final(final, ctx); Modified: php/php-src/trunk/ext/standard/php_crypt_r.c === --- php/php-src/trunk/ext/standard/php_crypt_r.c 2011-08-19 22:45:43 UTC (rev 315217) +++ php/php-src/trunk/ext/standard/php_crypt_r.c 2011-08-19 22:49:18 UTC (rev 315218) @@ -377,7 +377,7 @@ /* Now make the output string */ memcpy(passwd, MD5_MAGIC, MD5_MAGIC_LEN); strlcpy(passwd + MD5_MAGIC_LEN, sp, sl + 1); - strlcat(passwd, $, 1); + strcat(passwd, $); PHP_MD5Final(final, ctx); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/sqlite3/libsqlite/sqlite3.c branches/PHP_5_3/ext/sqlite3/libsqlite/sqlite3.h branches/PHP_5_4/ext/sqlite3/libsqlite/sqlite3.c br
scottmac Tue, 09 Aug 2011 07:31:34 + Revision: http://svn.php.net/viewvc?view=revisionrevision=314586 Log: Update SQLite3 to the latest version Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/sqlite3/libsqlite/sqlite3.c U php/php-src/branches/PHP_5_3/ext/sqlite3/libsqlite/sqlite3.h U php/php-src/branches/PHP_5_4/ext/sqlite3/libsqlite/sqlite3.c U php/php-src/branches/PHP_5_4/ext/sqlite3/libsqlite/sqlite3.h U php/php-src/trunk/ext/sqlite3/libsqlite/sqlite3.c U php/php-src/trunk/ext/sqlite3/libsqlite/sqlite3.h diffs exceeded maximum size -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/UPGRADING trunk/UPGRADING
scottmac Tue, 09 Aug 2011 15:27:25 + Revision: http://svn.php.net/viewvc?view=revisionrevision=314676 Log: Fix typos in UPGRADING Changed paths: U php/php-src/branches/PHP_5_4/UPGRADING U php/php-src/trunk/UPGRADING Modified: php/php-src/branches/PHP_5_4/UPGRADING === --- php/php-src/branches/PHP_5_4/UPGRADING 2011-08-09 15:27:12 UTC (rev 314675) +++ php/php-src/branches/PHP_5_4/UPGRADING 2011-08-09 15:27:25 UTC (rev 314676) @@ -100,7 +100,7 @@ To create a generic object you can use StdClass: $test = new StdClass; - $text-baz = 1; + $test-baz = 1; - It's now possible to enforce the class' __construct arguments in an abstract constructor in the base class. @@ -344,7 +344,7 @@ multibyte support, but may enable or disable it by zend.multibyte. It doesn't make a lot of sense to enable this option without ext/mbstring, because the most functionality is implemented by mbstrings callbacks. -- Added enable_post_data_reading, which is enable by default. When it's +- Added enable_post_data_reading, which is enabled by default. When it's disabled, the POST data is not read (and processed); the behavior is similar to that of other request methods with body, like PUT. This allows reading the raw POST data in multipart requests and read/process the POST data in a Modified: php/php-src/trunk/UPGRADING === --- php/php-src/trunk/UPGRADING 2011-08-09 15:27:12 UTC (rev 314675) +++ php/php-src/trunk/UPGRADING 2011-08-09 15:27:25 UTC (rev 314676) @@ -100,7 +100,7 @@ To create a generic object you can use StdClass: $test = new StdClass; - $text-baz = 1; + $test-baz = 1; = 4. Changes made to existing functions @@ -328,7 +328,7 @@ multibyte support, but may enable or disable it by zend.multibyte. It doesn't make a lot of sense to enable this option without ext/mbstring, because the most functionality is implemented by mbstrings callbacks. -- Added enable_post_data_reading, which is enable by default. When it's +- Added enable_post_data_reading, which is enabled by default. When it's disabled, the POST data is not read (and processed); the behavior is similar to that of other request methods with body, like PUT. This allows reading the raw POST data in multipart requests and read/process the POST data in a -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/build/genif.sh branches/PHP_5_4/build/genif.sh trunk/build/genif.sh
scottmac Tue, 09 Aug 2011 18:12:06 + Revision: http://svn.php.net/viewvc?view=revisionrevision=314686 Log: Fix building of pure C++ extensions as static Changed paths: U php/php-src/branches/PHP_5_3/build/genif.sh U php/php-src/branches/PHP_5_4/build/genif.sh U php/php-src/trunk/build/genif.sh Modified: php/php-src/branches/PHP_5_3/build/genif.sh === --- php/php-src/branches/PHP_5_3/build/genif.sh 2011-08-09 16:05:19 UTC (rev 314685) +++ php/php-src/branches/PHP_5_3/build/genif.sh 2011-08-09 18:12:06 UTC (rev 314686) @@ -24,7 +24,7 @@ module_ptrs=$extra_module_ptrs`echo $@ | $awk -f ./build/order_by_dep.awk` for ext in ${1+$@} ; do - header_list=$header_list ext/$ext/*.h + header_list=$header_list ext/$ext/*.h* done includes=`$awk -f ./build/print_include.awk $header_list` Modified: php/php-src/branches/PHP_5_4/build/genif.sh === --- php/php-src/branches/PHP_5_4/build/genif.sh 2011-08-09 16:05:19 UTC (rev 314685) +++ php/php-src/branches/PHP_5_4/build/genif.sh 2011-08-09 18:12:06 UTC (rev 314686) @@ -24,7 +24,7 @@ module_ptrs=$extra_module_ptrs`echo $@ | $awk -f ./build/order_by_dep.awk` for ext in ${1+$@} ; do - header_list=$header_list ext/$ext/*.h + header_list=$header_list ext/$ext/*.h* done includes=`$awk -f ./build/print_include.awk $header_list` Modified: php/php-src/trunk/build/genif.sh === --- php/php-src/trunk/build/genif.sh2011-08-09 16:05:19 UTC (rev 314685) +++ php/php-src/trunk/build/genif.sh2011-08-09 18:12:06 UTC (rev 314686) @@ -24,7 +24,7 @@ module_ptrs=$extra_module_ptrs`echo $@ | $awk -f ./build/order_by_dep.awk` for ext in ${1+$@} ; do - header_list=$header_list ext/$ext/*.h + header_list=$header_list ext/$ext/*.h* done includes=`$awk -f ./build/print_include.awk $header_list` -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/openssl/xp_ssl.c branches/PHP_5_4/ext/openssl/xp_ssl.c trunk/ext/openssl/xp_ssl.c
scottmac Sat, 23 Jul 2011 01:29:44 + Revision: http://svn.php.net/viewvc?view=revisionrevision=313616 Log: When we have a blocking SSL socket, respect the timeout option. reading from SSL sockets could block indefinitely due to the lack of timeout Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/openssl/xp_ssl.c U php/php-src/branches/PHP_5_4/ext/openssl/xp_ssl.c U php/php-src/trunk/ext/openssl/xp_ssl.c Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2011-07-23 01:08:24 UTC (rev 313615) +++ php/php-src/branches/PHP_5_3/NEWS 2011-07-23 01:29:44 UTC (rev 313616) @@ -7,6 +7,8 @@ - OpenSSL . openssl_encrypt()/openssl_decrypt() truncated keys of variable length ciphers to the OpenSSL default for the algorithm. (Scott) + . On blocking SSL sockets respect the timeout option where possible. +(Scott) 14 Jul 2011, PHP 5.3.7 RC3 - Zend Engine: Modified: php/php-src/branches/PHP_5_3/ext/openssl/xp_ssl.c === --- php/php-src/branches/PHP_5_3/ext/openssl/xp_ssl.c 2011-07-23 01:08:24 UTC (rev 313615) +++ php/php-src/branches/PHP_5_3/ext/openssl/xp_ssl.c 2011-07-23 01:29:44 UTC (rev 313616) @@ -204,6 +204,36 @@ return didwrite; } +static void php_openssl_stream_wait_for_data(php_stream *stream, php_netstream_data_t *sock TSRMLS_DC) +{ + int retval; + struct timeval *ptimeout; + + if (sock-socket == -1) { + return; + } + + sock-timeout_event = 0; + + if (sock-timeout.tv_sec == -1) + ptimeout = NULL; + else + ptimeout = sock-timeout; + + while(1) { + retval = php_pollfd_for(sock-socket, PHP_POLLREADABLE, ptimeout); + + if (retval == 0) + sock-timeout_event = 1; + + if (retval = 0) + break; + + if (php_socket_errno() != EINTR) + break; + } +} + static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) { php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream-abstract; @@ -213,6 +243,13 @@ int retry = 1; do { + if (sslsock-s.is_blocked) { + php_openssl_stream_wait_for_data(stream, (sslsock-s) TSRMLS_CC); + if (sslsock-s.timeout_event) { + break; + } + /* there is no guarantee that there is application data available but something is there */ + } nr_bytes = SSL_read(sslsock-ssl_handle, buf, count); if (nr_bytes = 0) { Modified: php/php-src/branches/PHP_5_4/ext/openssl/xp_ssl.c === --- php/php-src/branches/PHP_5_4/ext/openssl/xp_ssl.c 2011-07-23 01:08:24 UTC (rev 313615) +++ php/php-src/branches/PHP_5_4/ext/openssl/xp_ssl.c 2011-07-23 01:29:44 UTC (rev 313616) @@ -204,6 +204,36 @@ return didwrite; } +static void php_openssl_stream_wait_for_data(php_stream *stream, php_netstream_data_t *sock TSRMLS_DC) +{ + int retval; + struct timeval *ptimeout; + + if (sock-socket == -1) { + return; + } + + sock-timeout_event = 0; + + if (sock-timeout.tv_sec == -1) + ptimeout = NULL; + else + ptimeout = sock-timeout; + + while(1) { + retval = php_pollfd_for(sock-socket, PHP_POLLREADABLE, ptimeout); + + if (retval == 0) + sock-timeout_event = 1; + + if (retval = 0) + break; + + if (php_socket_errno() != EINTR) + break; + } +} + static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC) { php_openssl_netstream_data_t *sslsock = (php_openssl_netstream_data_t*)stream-abstract; @@ -213,6 +243,13 @@ int retry = 1; do { + if (sslsock-s.is_blocked) { + php_openssl_stream_wait_for_data(stream, (sslsock-s) TSRMLS_CC); + if (sslsock-s.timeout_event) { + break; + } + /* there is no guarantee that there is application data available but something is there */ + } nr_bytes = SSL_read(sslsock-ssl_handle, buf, count); if (nr_bytes = 0) { Modified:
Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/openssl/tests/bug55169.phpt branches/PHP_5_4/ext/openssl/tests/bug55169.phpt trunk/ext/openssl/tests/bug55169.phpt
This is broken and clearly wasn't tested. Need ?php in the SKIPIF section as it executes the code there. - S On Jul 20, 2011, at 1:57 PM, Ryan Biesemeyer wrote: yaauie Wed, 20 Jul 2011 20:57:17 + Revision: http://svn.php.net/viewvc?view=revisionrevision=313487 Log: update test for bug #55169, don't require the extension in INI Bug: https://bugs.php.net/55169 (Assigned) mcrypt_create_iv always fails to gather sufficient random data Changed paths: U php/php-src/branches/PHP_5_3/ext/openssl/tests/bug55169.phpt U php/php-src/branches/PHP_5_4/ext/openssl/tests/bug55169.phpt U php/php-src/trunk/ext/openssl/tests/bug55169.phpt Modified: php/php-src/branches/PHP_5_3/ext/openssl/tests/bug55169.phpt === --- php/php-src/branches/PHP_5_3/ext/openssl/tests/bug55169.phpt 2011-07-20 19:39:22 UTC (rev 313486) +++ php/php-src/branches/PHP_5_3/ext/openssl/tests/bug55169.phpt 2011-07-20 20:57:17 UTC (rev 313487) @@ -1,8 +1,6 @@ --TEST-- openssl_random_pseudo_bytes test https://bugs.php.net/bug.php?id=55169 ---INI-- -extension=php_openssl.dll --SKIPIF-- if(!extension_loaded('openssl')) echo 'skip - requires openssl extension' --FILE-- Modified: php/php-src/branches/PHP_5_4/ext/openssl/tests/bug55169.phpt === --- php/php-src/branches/PHP_5_4/ext/openssl/tests/bug55169.phpt 2011-07-20 19:39:22 UTC (rev 313486) +++ php/php-src/branches/PHP_5_4/ext/openssl/tests/bug55169.phpt 2011-07-20 20:57:17 UTC (rev 313487) @@ -1,8 +1,6 @@ --TEST-- openssl_random_pseudo_bytes test https://bugs.php.net/bug.php?id=55169 ---INI-- -extension=php_openssl.dll --SKIPIF-- if(!extension_loaded('openssl')) echo 'skip - requires openssl extension' --FILE-- Modified: php/php-src/trunk/ext/openssl/tests/bug55169.phpt === --- php/php-src/trunk/ext/openssl/tests/bug55169.phpt 2011-07-20 19:39:22 UTC (rev 313486) +++ php/php-src/trunk/ext/openssl/tests/bug55169.phpt 2011-07-20 20:57:17 UTC (rev 313487) @@ -1,8 +1,6 @@ --TEST-- openssl_random_pseudo_bytes test https://bugs.php.net/bug.php?id=55169 ---INI-- -extension=php_openssl.dll --SKIPIF-- if(!extension_loaded('openssl')) echo 'skip - requires openssl extension' --FILE-- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/openssl/openssl.c branches/PHP_5_4/ext/openssl/openssl.c trunk/ext/openssl/openssl.c
scottmac Tue, 19 Jul 2011 22:15:56 + Revision: http://svn.php.net/viewvc?view=revisionrevision=313453 Log: openssl_encrypt() / openssl_decrypt() were flawed and truncated the key to the default size for the case of a variable key length cipher. The result is a key of 448 bits being passed to the blowfish algorithm would be truncated to 128 bit. Also fixed an error in the zend_parse_parameters() having an invalid character being used. Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/openssl/openssl.c U php/php-src/branches/PHP_5_4/ext/openssl/openssl.c U php/php-src/trunk/ext/openssl/openssl.c Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2011-07-19 22:12:13 UTC (rev 313452) +++ php/php-src/branches/PHP_5_3/NEWS 2011-07-19 22:15:56 UTC (rev 313453) @@ -4,6 +4,10 @@ - Improved core functions: . Updated crypt_blowfish to 1.2. ((CVE-2011-2483) (Solar Designer) +- OpenSSL + . openssl_encrypt()/openssl_decrypt() truncated keys of variable length +ciphers to the OpenSSL default for the algorithm. (Scott) + 14 Jul 2011, PHP 5.3.7 RC3 - Zend Engine: . Fixed bug #55156 (ReflectionClass::getDocComment() returns comment even Modified: php/php-src/branches/PHP_5_3/ext/openssl/openssl.c === --- php/php-src/branches/PHP_5_3/ext/openssl/openssl.c 2011-07-19 22:12:13 UTC (rev 313452) +++ php/php-src/branches/PHP_5_3/ext/openssl/openssl.c 2011-07-19 22:15:56 UTC (rev 313453) @@ -4708,7 +4708,11 @@ outlen = data_len + EVP_CIPHER_block_size(cipher_type); outbuf = emalloc(outlen + 1); - EVP_EncryptInit(cipher_ctx, cipher_type, key, (unsigned char *)iv); + EVP_EncryptInit(cipher_ctx, cipher_type, NULL, NULL); + if (password_len keylen) { + EVP_CIPHER_CTX_set_key_length(cipher_ctx, password_len); + } + EVP_EncryptInit_ex(cipher_ctx, NULL, NULL, key, (unsigned char *)iv); EVP_EncryptUpdate(cipher_ctx, outbuf, i, (unsigned char *)data, data_len); outlen = i; if (EVP_EncryptFinal(cipher_ctx, (unsigned char *)outbuf + i, i)) { @@ -4788,7 +4792,11 @@ outlen = data_len + EVP_CIPHER_block_size(cipher_type); outbuf = emalloc(outlen + 1); - EVP_DecryptInit(cipher_ctx, cipher_type, key, (unsigned char *)iv); + EVP_DecryptInit(cipher_ctx, cipher_type, NULL, NULL); + if (password_len keylen) { + EVP_CIPHER_CTX_set_key_length(cipher_ctx, password_len); + } + EVP_DecryptInit_ex(cipher_ctx, NULL, NULL, key, (unsigned char *)iv); EVP_DecryptUpdate(cipher_ctx, outbuf, i, (unsigned char *)data, data_len); outlen = i; if (EVP_DecryptFinal(cipher_ctx, (unsigned char *)outbuf + i, i)) { Modified: php/php-src/branches/PHP_5_4/ext/openssl/openssl.c === --- php/php-src/branches/PHP_5_4/ext/openssl/openssl.c 2011-07-19 22:12:13 UTC (rev 313452) +++ php/php-src/branches/PHP_5_4/ext/openssl/openssl.c 2011-07-19 22:15:56 UTC (rev 313453) @@ -1020,9 +1020,7 @@ OpenSSL_add_all_digests(); OpenSSL_add_all_algorithms(); - ERR_load_ERR_strings(); - ERR_load_crypto_strings(); - ERR_load_EVP_strings(); + SSL_load_error_strings(); /* register a resource id number with OpenSSL so that we can map SSL - stream structures in * OpenSSL callbacks */ @@ -3043,7 +3041,7 @@ BIO * bio_out = NULL; const EVP_CIPHER * cipher; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Zṕ|s!a!, zpkey, filename, filename_len, passphrase, passphrase_len, args) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, Zp|s!a!, zpkey, filename, filename_len, passphrase, passphrase_len, args) == FAILURE) { return; } RETVAL_FALSE; @@ -4726,7 +4724,11 @@ outlen = data_len + EVP_CIPHER_block_size(cipher_type); outbuf = emalloc(outlen + 1); - EVP_EncryptInit(cipher_ctx, cipher_type, key, (unsigned char *)iv); + EVP_EncryptInit(cipher_ctx, cipher_type, NULL, NULL); + if (password_len keylen) { + EVP_CIPHER_CTX_set_key_length(cipher_ctx, password_len); + } + EVP_EncryptInit_ex(cipher_ctx, NULL, NULL, key, (unsigned char *)iv); if (options OPENSSL_ZERO_PADDING) { EVP_CIPHER_CTX_set_padding(cipher_ctx, 0); } @@ -4809,7 +4811,11 @@ outlen = data_len + EVP_CIPHER_block_size(cipher_type); outbuf = emalloc(outlen + 1); - EVP_DecryptInit(cipher_ctx, cipher_type, key, (unsigned char *)iv); + EVP_DecryptInit(cipher_ctx, cipher_type, NULL, NULL); + if (password_len keylen) { +
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/ext/openssl/openssl.c trunk/ext/openssl/openssl.c
scottmac Tue, 19 Jul 2011 22:29:55 + Revision: http://svn.php.net/viewvc?view=revisionrevision=313455 Log: Revert change to use a special Windows version of openssl_random_pseudo_bytes(). Lets discuss this on internals first. We're advertising something from the OpenSSL library and then subverting it with another Windows OS call. What are the implications of this? Should we make this available in ext/standard/ instead? Changed paths: U php/php-src/branches/PHP_5_4/ext/openssl/openssl.c U php/php-src/trunk/ext/openssl/openssl.c Modified: php/php-src/branches/PHP_5_4/ext/openssl/openssl.c === --- php/php-src/branches/PHP_5_4/ext/openssl/openssl.c 2011-07-19 22:18:08 UTC (rev 313454) +++ php/php-src/branches/PHP_5_4/ext/openssl/openssl.c 2011-07-19 22:29:55 UTC (rev 313455) @@ -4930,19 +4930,10 @@ buffer = emalloc(buffer_length + 1); -#ifdef PHP_WIN32 - strong_result = 1; - /* random/urandom equivalent on Windows */ - if (php_win32_get_random_bytes(buffer, (size_t) buffer_length) == FAILURE){ - efree(buffer); - RETURN_FALSE; - } -#else if ((strong_result = RAND_pseudo_bytes(buffer, buffer_length)) 0) { efree(buffer); RETURN_FALSE; } -#endif buffer[buffer_length] = 0; RETVAL_STRINGL((char *)buffer, buffer_length, 0); Modified: php/php-src/trunk/ext/openssl/openssl.c === --- php/php-src/trunk/ext/openssl/openssl.c 2011-07-19 22:18:08 UTC (rev 313454) +++ php/php-src/trunk/ext/openssl/openssl.c 2011-07-19 22:29:55 UTC (rev 313455) @@ -4926,19 +4926,10 @@ buffer = emalloc(buffer_length + 1); -#ifdef PHP_WIN32 - strong_result = 1; - /* random/urandom equivalent on Windows */ - if (php_win32_get_random_bytes(buffer, (size_t) buffer_length) == FAILURE){ - efree(buffer); - RETURN_FALSE; - } -#else if ((strong_result = RAND_pseudo_bytes(buffer, buffer_length)) 0) { efree(buffer); RETURN_FALSE; } -#endif buffer[buffer_length] = 0; RETVAL_STRINGL((char *)buffer, buffer_length, 0); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/ext/openssl/openssl.c trunk/ext/openssl/openssl.c
Why isn't this fixed upstream? This is a horrible idea to make core changes like this without a discussion. I'll revert this again so we can at least have the opportunity to discuss this. S On 19 Jul 2011, at 15:55, Pierre Joye pierre@gmail.com wrote: Please restore that, now. That's not your cup of tea and it is the way it should have been in the 1st place. On Wed, Jul 20, 2011 at 12:29 AM, Scott MacVicar scott...@php.net wrote: scottmac Tue, 19 Jul 2011 22:29:55 + Revision: http://svn.php.net/viewvc?view=revisionrevision=313455 Log: Revert change to use a special Windows version of openssl_random_pseudo_bytes(). Lets discuss this on internals first. We're advertising something from the OpenSSL library and then subverting it with another Windows OS call. What are the implications of this? Should we make this available in ext/standard/ instead? Changed paths: U php/php-src/branches/PHP_5_4/ext/openssl/openssl.c U php/php-src/trunk/ext/openssl/openssl.c Modified: php/php-src/branches/PHP_5_4/ext/openssl/openssl.c === --- php/php-src/branches/PHP_5_4/ext/openssl/openssl.c 2011-07-19 22:18:08 UTC (rev 313454) +++ php/php-src/branches/PHP_5_4/ext/openssl/openssl.c 2011-07-19 22:29:55 UTC (rev 313455) @@ -4930,19 +4930,10 @@ buffer = emalloc(buffer_length + 1); -#ifdef PHP_WIN32 - strong_result = 1; - /* random/urandom equivalent on Windows */ - if (php_win32_get_random_bytes(buffer, (size_t) buffer_length) == FAILURE){ - efree(buffer); - RETURN_FALSE; - } -#else if ((strong_result = RAND_pseudo_bytes(buffer, buffer_length)) 0) { efree(buffer); RETURN_FALSE; } -#endif buffer[buffer_length] = 0; RETVAL_STRINGL((char *)buffer, buffer_length, 0); Modified: php/php-src/trunk/ext/openssl/openssl.c === --- php/php-src/trunk/ext/openssl/openssl.c 2011-07-19 22:18:08 UTC (rev 313454) +++ php/php-src/trunk/ext/openssl/openssl.c 2011-07-19 22:29:55 UTC (rev 313455) @@ -4926,19 +4926,10 @@ buffer = emalloc(buffer_length + 1); -#ifdef PHP_WIN32 - strong_result = 1; - /* random/urandom equivalent on Windows */ - if (php_win32_get_random_bytes(buffer, (size_t) buffer_length) == FAILURE){ - efree(buffer); - RETURN_FALSE; - } -#else if ((strong_result = RAND_pseudo_bytes(buffer, buffer_length)) 0) { efree(buffer); RETURN_FALSE; } -#endif buffer[buffer_length] = 0; RETVAL_STRINGL((char *)buffer, buffer_length, 0); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/ext/openssl/openssl.c trunk/ext/openssl/openssl.c
Why did you even commit such a change without discussing it? I understand your logic for doing this but there was no RFC or discussion around the impact of this. OpenSSL has been FIPS certified, your change has changed this contract and it's calling back into a Windows API. Has it been reviewed for correctness? Whats the speed difference between OpenSSL and your version. I know you removed the screen code which was causing a long delay. On Jul 19, 2011, at 4:13 PM, Pierre Joye wrote: Why did you not ask in the 1st place before reverting it? Please don't waste our time with such things. Users expect this (tested) fix in the next releases. Now, openssl has lower minimum windows version support that we do, and does all possible things to improve the entropy, which is not required nor necessary for the windows we support. The idea in the 1st place was to have a standard set of random functions instead of this, as you well know. Now it is too late and we have to live with this function. While the set of random will surely come at some point too. On Wed, Jul 20, 2011 at 1:04 AM, Scott MacVicar sc...@macvicar.net wrote: Why isn't this fixed upstream? This is a horrible idea to make core changes like this without a discussion. I'll revert this again so we can at least have the opportunity to discuss this. S On 19 Jul 2011, at 15:55, Pierre Joye pierre@gmail.com wrote: Please restore that, now. That's not your cup of tea and it is the way it should have been in the 1st place. On Wed, Jul 20, 2011 at 12:29 AM, Scott MacVicar scott...@php.net wrote: scottmac Tue, 19 Jul 2011 22:29:55 + Revision: http://svn.php.net/viewvc?view=revisionrevision=313455 Log: Revert change to use a special Windows version of openssl_random_pseudo_bytes(). Lets discuss this on internals first. We're advertising something from the OpenSSL library and then subverting it with another Windows OS call. What are the implications of this? Should we make this available in ext/standard/ instead? Changed paths: U php/php-src/branches/PHP_5_4/ext/openssl/openssl.c U php/php-src/trunk/ext/openssl/openssl.c Modified: php/php-src/branches/PHP_5_4/ext/openssl/openssl.c === --- php/php-src/branches/PHP_5_4/ext/openssl/openssl.c 2011-07-19 22:18:08 UTC (rev 313454) +++ php/php-src/branches/PHP_5_4/ext/openssl/openssl.c 2011-07-19 22:29:55 UTC (rev 313455) @@ -4930,19 +4930,10 @@ buffer = emalloc(buffer_length + 1); -#ifdef PHP_WIN32 - strong_result = 1; - /* random/urandom equivalent on Windows */ - if (php_win32_get_random_bytes(buffer, (size_t) buffer_length) == FAILURE){ - efree(buffer); - RETURN_FALSE; - } -#else if ((strong_result = RAND_pseudo_bytes(buffer, buffer_length)) 0) { efree(buffer); RETURN_FALSE; } -#endif buffer[buffer_length] = 0; RETVAL_STRINGL((char *)buffer, buffer_length, 0); Modified: php/php-src/trunk/ext/openssl/openssl.c === --- php/php-src/trunk/ext/openssl/openssl.c 2011-07-19 22:18:08 UTC (rev 313454) +++ php/php-src/trunk/ext/openssl/openssl.c 2011-07-19 22:29:55 UTC (rev 313455) @@ -4926,19 +4926,10 @@ buffer = emalloc(buffer_length + 1); -#ifdef PHP_WIN32 - strong_result = 1; - /* random/urandom equivalent on Windows */ - if (php_win32_get_random_bytes(buffer, (size_t) buffer_length) == FAILURE){ - efree(buffer); - RETURN_FALSE; - } -#else if ((strong_result = RAND_pseudo_bytes(buffer, buffer_length)) 0) { efree(buffer); RETURN_FALSE; } -#endif buffer[buffer_length] = 0; RETVAL_STRINGL((char *)buffer, buffer_length, 0); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/ext/ldap/ldap.c branches/PHP_5_4/ext/ldap/tests/ldap_control_paged_results_variation1.phpt branches/PHP_5_4/ext/ldap/tests/ldap_control_paged_results_vari
scottmac Thu, 14 Jul 2011 18:49:12 + Revision: http://svn.php.net/viewvc?view=revisionrevision=313251 Log: Fix prototypes for ldap_control_paged_result and fix function name in tests Changed paths: U php/php-src/branches/PHP_5_4/ext/ldap/ldap.c U php/php-src/branches/PHP_5_4/ext/ldap/tests/ldap_control_paged_results_variation1.phpt U php/php-src/branches/PHP_5_4/ext/ldap/tests/ldap_control_paged_results_variation3.phpt U php/php-src/trunk/ext/ldap/ldap.c U php/php-src/trunk/ext/ldap/tests/ldap_control_paged_results_variation1.phpt U php/php-src/trunk/ext/ldap/tests/ldap_control_paged_results_variation3.phpt Modified: php/php-src/branches/PHP_5_4/ext/ldap/ldap.c === --- php/php-src/branches/PHP_5_4/ext/ldap/ldap.c2011-07-14 17:58:16 UTC (rev 313250) +++ php/php-src/branches/PHP_5_4/ext/ldap/ldap.c2011-07-14 18:49:12 UTC (rev 313251) @@ -2186,7 +2186,7 @@ #endif #ifdef LDAP_CONTROL_PAGEDRESULTS -/* {{{ proto bool ldap_control_paged_result(resource link, int pagesize [, bool iscritical [, string cookie]]) +/* {{{ proto mixed ldap_control_paged_result(resource link, int pagesize [, bool iscritical [, string cookie]]) Inject paged results control*/ PHP_FUNCTION(ldap_control_paged_result) { @@ -2278,7 +2278,7 @@ } /* }}} */ -/* {{{ proto bool ldap_control_paged_result_response(resource link, resource result [, string cookie [, int estimated]]) +/* {{{ proto bool ldap_control_paged_result_response(resource link, resource result [, string cookie [, int estimated]]) Extract paged results control response */ PHP_FUNCTION(ldap_control_paged_result_response) { @@ -2292,7 +2292,6 @@ ber_tag_t tag; int rc, lerrcode, myargcount = ZEND_NUM_ARGS(); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rr|zz, link, result, cookie, estimated) != SUCCESS) { return; } Modified: php/php-src/branches/PHP_5_4/ext/ldap/tests/ldap_control_paged_results_variation1.phpt === --- php/php-src/branches/PHP_5_4/ext/ldap/tests/ldap_control_paged_results_variation1.phpt 2011-07-14 17:58:16 UTC (rev 313250) +++ php/php-src/branches/PHP_5_4/ext/ldap/tests/ldap_control_paged_results_variation1.phpt 2011-07-14 18:49:12 UTC (rev 313251) @@ -1,5 +1,5 @@ --TEST-- -ldap_ldap_control_paged_results() test (fetching the first page) +ldap_ldap_control_paged_result() test (fetching the first page) --CREDITS-- Jean-Sebastien Hedde jean...@au-fil-du.net --SKIPIF-- @@ -17,7 +17,7 @@ $dn = dc=my-domain,dc=com; $filter = (cn=*); var_dump( - ldap_control_paged_results($link, 1), + ldap_control_paged_result($link, 1), $result = ldap_search($link, $dn, $filter, array('cn')), ldap_get_entries($link, $result) ); Modified: php/php-src/branches/PHP_5_4/ext/ldap/tests/ldap_control_paged_results_variation3.phpt === --- php/php-src/branches/PHP_5_4/ext/ldap/tests/ldap_control_paged_results_variation3.phpt 2011-07-14 17:58:16 UTC (rev 313250) +++ php/php-src/branches/PHP_5_4/ext/ldap/tests/ldap_control_paged_results_variation3.phpt 2011-07-14 18:49:12 UTC (rev 313251) @@ -1,5 +1,5 @@ --TEST-- -ldap_ldap_control_paged_results() test (fetching the first page then the next final page) +ldap_ldap_control_paged_result() test (fetching the first page then the next final page) --CREDITS-- Jean-Sebastien Hedde jean...@au-fil-du.net --SKIPIF-- @@ -18,11 +18,11 @@ $filter = (cn=*); $cookie = ''; var_dump( - ldap_control_paged_results($link, 2, true, $cookie), + ldap_control_paged_result($link, 2, true, $cookie), $result = ldap_search($link, $dn, $filter, array('cn')), ldap_get_entries($link, $result), - ldap_control_paged_results_response($link, $result, $cookie), - ldap_control_paged_results($link, 20, true, $cookie), + ldap_control_paged_result_response($link, $result, $cookie), + ldap_control_paged_result($link, 20, true, $cookie), $result = ldap_search($link, $dn, $filter, array('cn')), ldap_get_entries($link, $result) ); Modified: php/php-src/trunk/ext/ldap/ldap.c === --- php/php-src/trunk/ext/ldap/ldap.c 2011-07-14 17:58:16 UTC (rev 313250) +++ php/php-src/trunk/ext/ldap/ldap.c 2011-07-14 18:49:12 UTC (rev 313251) @@ -2186,7 +2186,7 @@ #endif #ifdef LDAP_CONTROL_PAGEDRESULTS -/* {{{ proto bool ldap_control_paged_result(resource link, int pagesize [, bool iscritical [, string cookie]]) +/* {{{ proto mixed ldap_control_paged_result(resource link, int pagesize [, bool iscritical [, string cookie]]) Inject paged results control*/ PHP_FUNCTION(ldap_control_paged_result) { @@ -2278,7 +2278,7 @@ }
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/sqlite3/libsqlite/sqlite3.c branches/PHP_5_3/ext/sqlite3/libsqlite/sqlite3.h branches/PHP_5_4/ext/sqlite3/libsqlite/sqlite3.c br
scottmac Tue, 14 Jun 2011 17:00:49 + Revision: http://svn.php.net/viewvc?view=revisionrevision=312159 Log: Upgrade SQLite to 3.7.6.3 Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/sqlite3/libsqlite/sqlite3.c U php/php-src/branches/PHP_5_3/ext/sqlite3/libsqlite/sqlite3.h U php/php-src/branches/PHP_5_4/ext/sqlite3/libsqlite/sqlite3.c U php/php-src/branches/PHP_5_4/ext/sqlite3/libsqlite/sqlite3.h U php/php-src/trunk/ext/sqlite3/libsqlite/sqlite3.c U php/php-src/trunk/ext/sqlite3/libsqlite/sqlite3.h Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2011-06-14 16:29:46 UTC (rev 312158) +++ php/php-src/branches/PHP_5_3/NEWS 2011-06-14 17:00:49 UTC (rev 312159) @@ -1,7 +1,7 @@ PHPNEWS ||| ?? ??? 2011, PHP 5.3.7 -- Upgraded bundled SQLite to version 3.7.6.2. (Scott) +- Upgraded bundled SQLite to version 3.7.6.3. (Scott) - Upgraded bundled PCRE to version 8.12. (Scott) - Increased the backtrack limit from 10 to 100 (Rasmus) Modified: php/php-src/branches/PHP_5_3/ext/sqlite3/libsqlite/sqlite3.c === --- php/php-src/branches/PHP_5_3/ext/sqlite3/libsqlite/sqlite3.c 2011-06-14 16:29:46 UTC (rev 312158) +++ php/php-src/branches/PHP_5_3/ext/sqlite3/libsqlite/sqlite3.c 2011-06-14 17:00:49 UTC (rev 312159) @@ -4,7 +4,7 @@ /** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.7.6.2. By combining all the individual C code files into this +** version 3.7.6.3. By combining all the individual C code files into this ** single large file, the entire code can be compiled as a single translation ** unit. This allows many compilers to do optimizations that would not be ** possible if the files were compiled separately. Performance improvements @@ -654,9 +654,9 @@ ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION3.7.6.2 +#define SQLITE_VERSION3.7.6.3 #define SQLITE_VERSION_NUMBER 3007006 -#define SQLITE_SOURCE_ID 2011-04-17 17:25:17 154ddbc17120be2915eb03edc52af1225eb7cb5e +#define SQLITE_SOURCE_ID 2011-05-19 13:26:54 ed1da510a239ea767a01dc332b667119fa3c908e /* ** CAPI3REF: Run-Time Library Version Numbers @@ -42076,11 +42076,21 @@ }else{ if( pagerUseWal(pPager) ){ PgHdr *pList = sqlite3PcacheDirtyList(pPager-pPCache); + PgHdr *pPageOne = 0; + if( pList==0 ){ +/* Must have at least one page for the WAL commit flag. +** Ticket [2d1a5c67dfc2363e44f29d9bbd57f] 2011-05-18 */ +rc = sqlite3PagerGet(pPager, 1, pPageOne); +pList = pPageOne; +pList-pDirty = 0; + } + assert( pList!=0 || rc!=SQLITE_OK ); if( pList ){ rc = pagerWalFrames(pPager, pList, pPager-dbSize, 1, (pPager-fullSync ? pPager-syncFlags : 0) ); } + sqlite3PagerUnref(pPageOne); if( rc==SQLITE_OK ){ sqlite3PcacheCleanAll(pPager-pPCache); } Modified: php/php-src/branches/PHP_5_3/ext/sqlite3/libsqlite/sqlite3.h === --- php/php-src/branches/PHP_5_3/ext/sqlite3/libsqlite/sqlite3.h 2011-06-14 16:29:46 UTC (rev 312158) +++ php/php-src/branches/PHP_5_3/ext/sqlite3/libsqlite/sqlite3.h 2011-06-14 17:00:49 UTC (rev 312159) @@ -107,9 +107,9 @@ ** [sqlite3_libversion_number()], [sqlite3_sourceid()], ** [sqlite_version()] and [sqlite_source_id()]. */ -#define SQLITE_VERSION3.7.6.2 +#define SQLITE_VERSION3.7.6.3 #define SQLITE_VERSION_NUMBER 3007006 -#define SQLITE_SOURCE_ID 2011-04-17 17:25:17 154ddbc17120be2915eb03edc52af1225eb7cb5e +#define SQLITE_SOURCE_ID 2011-05-19 13:26:54 ed1da510a239ea767a01dc332b667119fa3c908e /* ** CAPI3REF: Run-Time Library Version Numbers Modified: php/php-src/branches/PHP_5_4/ext/sqlite3/libsqlite/sqlite3.c === --- php/php-src/branches/PHP_5_4/ext/sqlite3/libsqlite/sqlite3.c 2011-06-14 16:29:46 UTC (rev 312158) +++ php/php-src/branches/PHP_5_4/ext/sqlite3/libsqlite/sqlite3.c 2011-06-14 17:00:49 UTC (rev 312159) @@ -4,7 +4,7 @@ /** ** This file is an amalgamation of many separate C source files from SQLite -** version 3.7.6.2. By combining all the individual C code files into this +** version 3.7.6.3. By combining all the individual C code files into this ** single large file, the entire code can be
[PHP-CVS] svn: /SVNROOT/ httpd.conf
scottmac Tue, 07 Jun 2011 20:34:55 + Revision: http://svn.php.net/viewvc?view=revisionrevision=311898 Log: Update config for new SSL cert Changed paths: U SVNROOT/httpd.conf Modified: SVNROOT/httpd.conf === --- SVNROOT/httpd.conf 2011-06-07 20:26:59 UTC (rev 311897) +++ SVNROOT/httpd.conf 2011-06-07 20:34:55 UTC (rev 311898) @@ -46,8 +46,9 @@ VirtualHost *:443 SSLEngine On SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL -SSLCertificateFile /local/this-box/svn_php_net.crt -SSLCertificateKeyFile /local/this-box/svn_php_net.key +SSLCertificateFile /local/this-box/wildcard-php.net.crt +SSLCertificateKeyFile /local/this-box/wildcard-php.net.key +SSLCertificateChainFile /local/this-box/wildcard-php.net.GODADDY-CA.crt ServerName svn.php.net CustomLog |/local/bin/rotatelogs /home/svn/logs/svn-ssl-svn_log.%Y%m%d 86400 %t %u %{SVN-ACTION}e env=SVN-ACTION -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/NEWS branches/PHP_5_4/UPGRADING branches/PHP_5_4/ext/standard/basic_functions.c branches/PHP_5_4/ext/standard/php_string.h branches/PHP_5_4/ext/standard/s
scottmac Fri, 03 Jun 2011 00:12:22 + Revision: http://svn.php.net/viewvc?view=revisionrevision=311743 Log: Added fabled hex2bin() function Changed paths: U php/php-src/branches/PHP_5_4/NEWS U php/php-src/branches/PHP_5_4/UPGRADING U php/php-src/branches/PHP_5_4/ext/standard/basic_functions.c U php/php-src/branches/PHP_5_4/ext/standard/php_string.h U php/php-src/branches/PHP_5_4/ext/standard/string.c U php/php-src/trunk/ext/standard/basic_functions.c U php/php-src/trunk/ext/standard/php_string.h U php/php-src/trunk/ext/standard/string.c Modified: php/php-src/branches/PHP_5_4/NEWS === --- php/php-src/branches/PHP_5_4/NEWS 2011-06-02 22:54:14 UTC (rev 311742) +++ php/php-src/branches/PHP_5_4/NEWS 2011-06-03 00:12:22 UTC (rev 311743) @@ -130,6 +130,7 @@ - Improved core functions: . number_format() no longer truncates multibyte decimal points and thousand separators to the first byte. FR #53457. (Adam) + . Added hex2bin() function. (Scott) - Improved CURL extension: . Added support for CURLOPT_MAX_RECV_SPEED_LARGE and Modified: php/php-src/branches/PHP_5_4/UPGRADING === --- php/php-src/branches/PHP_5_4/UPGRADING 2011-06-02 22:54:14 UTC (rev 311742) +++ php/php-src/branches/PHP_5_4/UPGRADING 2011-06-03 00:12:22 UTC (rev 311743) @@ -358,10 +358,11 @@ - Core: - get_declared_traits() + - hex2bin() - http_response_code() - - trait_exists() - stream_set_chunk_size() - socket_import_stream() + - trait_exists() - LDAP: - ldap_control_paged_results() Modified: php/php-src/branches/PHP_5_4/ext/standard/basic_functions.c === --- php/php-src/branches/PHP_5_4/ext/standard/basic_functions.c 2011-06-02 22:54:14 UTC (rev 311742) +++ php/php-src/branches/PHP_5_4/ext/standard/basic_functions.c 2011-06-03 00:12:22 UTC (rev 311743) @@ -2142,6 +2142,10 @@ ZEND_ARG_INFO(0, data) ZEND_END_ARG_INFO() +ZEND_BEGIN_ARG_INFO(arginfo_hex2bin, 0) + ZEND_ARG_INFO(0, data) +ZEND_END_ARG_INFO() + ZEND_BEGIN_ARG_INFO_EX(arginfo_strspn, 0, 0, 2) ZEND_ARG_INFO(0, str) ZEND_ARG_INFO(0, mask) @@ -2682,6 +2686,7 @@ const zend_function_entry basic_functions[] = { /* {{{ */ PHP_FE(constant, arginfo_constant) PHP_FE(bin2hex, arginfo_bin2hex) + PHP_FE(hex2bin, arginfo_hex2bin) PHP_FE(sleep, arginfo_sleep) PHP_FE(usleep, arginfo_usleep) #if HAVE_NANOSLEEP Modified: php/php-src/branches/PHP_5_4/ext/standard/php_string.h === --- php/php-src/branches/PHP_5_4/ext/standard/php_string.h 2011-06-02 22:54:14 UTC (rev 311742) +++ php/php-src/branches/PHP_5_4/ext/standard/php_string.h 2011-06-03 00:12:22 UTC (rev 311743) @@ -78,6 +78,7 @@ PHP_FUNCTION(parse_str); PHP_FUNCTION(str_getcsv); PHP_FUNCTION(bin2hex); +PHP_FUNCTION(hex2bin); PHP_FUNCTION(similar_text); PHP_FUNCTION(strip_tags); PHP_FUNCTION(str_repeat); Modified: php/php-src/branches/PHP_5_4/ext/standard/string.c === --- php/php-src/branches/PHP_5_4/ext/standard/string.c 2011-06-02 22:54:14 UTC (rev 311742) +++ php/php-src/branches/PHP_5_4/ext/standard/string.c 2011-06-03 00:12:22 UTC (rev 311743) @@ -146,6 +146,46 @@ } /* }}} */ +/* {{{ php_hex2bin + */ +static char *php_hex2bin(const unsigned char *old, const size_t oldlen, size_t *newlen) +{ + size_t target_length = oldlen 1; + register unsigned char *str = (unsigned char *)safe_emalloc(target_length, sizeof(char), 1); + size_t i, j; + for (i = j = 0; i target_length; i++) { + char c = old[j++]; + if (c = '0' c = '9') { + str[i] = (c - '0') 4; + } else if (c = 'a' c = 'f') { + str[i] = (c - 'a' + 10) 4; + } else if (c = 'A' c = 'F') { + str[i] = (c - 'A' + 10) 4; + } else { + efree(str); + return NULL; + } + c = old[j++]; +
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/ext/standard/browscap.c trunk/ext/standard/browscap.c
scottmac Fri, 03 Jun 2011 00:42:07 + Revision: http://svn.php.net/viewvc?view=revisionrevision=311745 Log: Fix Bug #54918 - Crash when there is a failure to read the browscap file Bug: http://bugs.php.net/54918 (Assigned) browscap issues Changed paths: U php/php-src/branches/PHP_5_4/ext/standard/browscap.c U php/php-src/trunk/ext/standard/browscap.c Modified: php/php-src/branches/PHP_5_4/ext/standard/browscap.c === --- php/php-src/branches/PHP_5_4/ext/standard/browscap.c2011-06-03 00:35:22 UTC (rev 311744) +++ php/php-src/branches/PHP_5_4/ext/standard/browscap.c2011-06-03 00:42:07 UTC (rev 311745) @@ -333,19 +333,19 @@ PHP_MINIT_FUNCTION(browscap) /* {{{ */ { char *browscap = INI_STR(browscap); - - if (browscap browscap[0]) { - if (browscap_read_file(browscap, global_bdata, 1 TSRMLS_CC) == FAILURE) { - return FAILURE; - } - } - + #ifdef ZTS ts_allocate_id(browscap_globals_id, sizeof(browser_data), browscap_globals_ctor, NULL); #endif /* ctor call not really needed for non-ZTS */ + if (browscap browscap[0]) { + if (browscap_read_file(browscap, global_bdata, 1 TSRMLS_CC) == FAILURE) { + return FAILURE; + } + } + return SUCCESS; } /* }}} */ Modified: php/php-src/trunk/ext/standard/browscap.c === --- php/php-src/trunk/ext/standard/browscap.c 2011-06-03 00:35:22 UTC (rev 311744) +++ php/php-src/trunk/ext/standard/browscap.c 2011-06-03 00:42:07 UTC (rev 311745) @@ -333,19 +333,19 @@ PHP_MINIT_FUNCTION(browscap) /* {{{ */ { char *browscap = INI_STR(browscap); - - if (browscap browscap[0]) { - if (browscap_read_file(browscap, global_bdata, 1 TSRMLS_CC) == FAILURE) { - return FAILURE; - } - } - + #ifdef ZTS ts_allocate_id(browscap_globals_id, sizeof(browser_data), browscap_globals_ctor, NULL); #endif /* ctor call not really needed for non-ZTS */ + if (browscap browscap[0]) { + if (browscap_read_file(browscap, global_bdata, 1 TSRMLS_CC) == FAILURE) { + return FAILURE; + } + } + return SUCCESS; } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/NEWS branches/PHP_5_4/UPGRADING branches/PHP_5_4/ext/openssl/openssl.c branches/PHP_5_4/ext/openssl/php_openssl.h branches/PHP_5_4/ext/openssl/tests/011.p
scottmac Fri, 20 May 2011 18:56:13 + Revision: http://svn.php.net/viewvc?view=revisionrevision=311299 Log: Allow management of your own padding in openssl_encrypt/decrypt. For using mcrypt / openssl interchangeabley managing your own padding is the only solution. Changed paths: U php/php-src/branches/PHP_5_4/NEWS U php/php-src/branches/PHP_5_4/UPGRADING U php/php-src/branches/PHP_5_4/ext/openssl/openssl.c U php/php-src/branches/PHP_5_4/ext/openssl/php_openssl.h U php/php-src/branches/PHP_5_4/ext/openssl/tests/011.phpt U php/php-src/branches/PHP_5_4/ext/openssl/tests/bug54060.phpt U php/php-src/branches/PHP_5_4/ext/openssl/tests/bug54061.phpt U php/php-src/branches/PHP_5_4/ext/openssl/tests/openssl_decrypt_error.phpt U php/php-src/trunk/ext/openssl/openssl.c U php/php-src/trunk/ext/openssl/php_openssl.h U php/php-src/trunk/ext/openssl/tests/011.phpt U php/php-src/trunk/ext/openssl/tests/bug54060.phpt U php/php-src/trunk/ext/openssl/tests/bug54061.phpt U php/php-src/trunk/ext/openssl/tests/openssl_decrypt_error.phpt Modified: php/php-src/branches/PHP_5_4/NEWS === --- php/php-src/branches/PHP_5_4/NEWS 2011-05-20 18:07:34 UTC (rev 311298) +++ php/php-src/branches/PHP_5_4/NEWS 2011-05-20 18:56:13 UTC (rev 311299) @@ -178,6 +178,7 @@ . Added AES support. FR #48632. (yonas dot y at gmail dot com, Pierre) . Added a no_ticket SSL context option to disable the SessionTicket TLS extension. FR #53447. (Adam) + . Added no padding option to openssl_encrypt()/openssl_decrypt(). (Scott) - Improved PDO DB-LIB: (Stanley) . Added nextRowset support. Modified: php/php-src/branches/PHP_5_4/UPGRADING === --- php/php-src/branches/PHP_5_4/UPGRADING 2011-05-20 18:07:34 UTC (rev 311298) +++ php/php-src/branches/PHP_5_4/UPGRADING 2011-05-20 18:56:13 UTC (rev 311299) @@ -174,6 +174,8 @@ just the first matching node. - All SimpleXMLElement children are now always printed when using var_dump(), var_export(), and print_r(). +- The raw data parameter in openssl_encrypt()/openssl_decrypt() is now an options + integer rather than a boolean. A value of true produces the same behaviour. === 5. Changes made to existing methods @@ -392,6 +394,8 @@ - IPV6_MULTICAST_LOOP - IPPROTO_IP - IPPROTO_IPV6 + - OPENSSL_RAW_DATA + - OPENSSL_ZERO_PADDING g. New classes Modified: php/php-src/branches/PHP_5_4/ext/openssl/openssl.c === --- php/php-src/branches/PHP_5_4/ext/openssl/openssl.c 2011-05-20 18:07:34 UTC (rev 311298) +++ php/php-src/branches/PHP_5_4/ext/openssl/openssl.c 2011-05-20 18:56:13 UTC (rev 311299) @@ -350,7 +350,7 @@ ZEND_ARG_INFO(0, data) ZEND_ARG_INFO(0, method) ZEND_ARG_INFO(0, password) -ZEND_ARG_INFO(0, raw_output) +ZEND_ARG_INFO(0, options) ZEND_ARG_INFO(0, iv) ZEND_END_ARG_INFO() @@ -358,7 +358,7 @@ ZEND_ARG_INFO(0, data) ZEND_ARG_INFO(0, method) ZEND_ARG_INFO(0, password) -ZEND_ARG_INFO(0, raw_input) +ZEND_ARG_INFO(0, options) ZEND_ARG_INFO(0, iv) ZEND_END_ARG_INFO() @@ -1089,6 +1089,9 @@ REGISTER_LONG_CONSTANT(OPENSSL_KEYTYPE_EC, OPENSSL_KEYTYPE_EC, CONST_CS|CONST_PERSISTENT); #endif + REGISTER_LONG_CONSTANT(OPENSSL_RAW_DATA, OPENSSL_RAW_DATA, CONST_CS|CONST_PERSISTENT); + REGISTER_LONG_CONSTANT(OPENSSL_ZERO_PADDING, OPENSSL_ZERO_PADDING, CONST_CS|CONST_PERSISTENT); + #if OPENSSL_VERSION_NUMBER = 0x0090806fL !defined(OPENSSL_NO_TLSEXT) /* SNI support included in OpenSSL = 0.9.8j */ REGISTER_LONG_CONSTANT(OPENSSL_TLSEXT_SERVER_NAME, 1, CONST_CS|CONST_PERSISTENT); @@ -4679,11 +4682,11 @@ } -/* {{{ proto string openssl_encrypt(string data, string method, string password [, bool raw_output=false [, string $iv='']]) +/* {{{ proto string openssl_encrypt(string data, string method, string password [, long options=0 [, string $iv='']]) Encrypts given data with given method and key, returns raw or base64 encoded string */ PHP_FUNCTION(openssl_encrypt) { - zend_bool raw_output = 0; + long options = 0; char *data, *method, *password, *iv = ; int data_len, method_len, password_len, iv_len = 0, max_iv_len; const EVP_CIPHER *cipher_type; @@ -4692,7 +4695,7 @@ unsigned char *outbuf, *key; zend_bool free_iv; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, sss|bs, data, data_len, method, method_len, password, password_len, raw_output, iv, iv_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, sss|ls, data, data_len, method, method_len, password, password_len, options, iv, iv_len) == FAILURE) { return; } cipher_type = EVP_get_cipherbyname(method); @@ -4720,11 +4723,14 @@ outbuf = emalloc(outlen + 1);
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/ext/ldap/ldap.c branches/PHP_5_4/ext/ldap/tests/ldap_control_paged_results_variation1.phpt branches/PHP_5_4/ext/ldap/tests/ldap_control_paged_results_vari
scottmac Thu, 19 May 2011 17:41:21 + Revision: http://svn.php.net/viewvc?view=revisionrevision=311264 Log: Tidy up ldap paging code and rename the API as discussed in #42060 Bug: http://bugs.php.net/42060 (Feedback) [PATCH] LDAP: Add pagedResults support and more Changed paths: U php/php-src/branches/PHP_5_4/ext/ldap/ldap.c A php/php-src/branches/PHP_5_4/ext/ldap/tests/ldap_control_paged_results_variation1.phpt A php/php-src/branches/PHP_5_4/ext/ldap/tests/ldap_control_paged_results_variation2.phpt A php/php-src/branches/PHP_5_4/ext/ldap/tests/ldap_control_paged_results_variation3.phpt D php/php-src/branches/PHP_5_4/ext/ldap/tests/ldap_ctrl_paged_results_variation1.phpt D php/php-src/branches/PHP_5_4/ext/ldap/tests/ldap_ctrl_paged_results_variation2.phpt D php/php-src/branches/PHP_5_4/ext/ldap/tests/ldap_ctrl_paged_results_variation3.phpt U php/php-src/trunk/ext/ldap/ldap.c A php/php-src/trunk/ext/ldap/tests/ldap_control_paged_results_variation1.phpt A php/php-src/trunk/ext/ldap/tests/ldap_control_paged_results_variation2.phpt A php/php-src/trunk/ext/ldap/tests/ldap_control_paged_results_variation3.phpt D php/php-src/trunk/ext/ldap/tests/ldap_ctrl_paged_results_variation1.phpt D php/php-src/trunk/ext/ldap/tests/ldap_ctrl_paged_results_variation2.phpt D php/php-src/trunk/ext/ldap/tests/ldap_ctrl_paged_results_variation3.phpt Modified: php/php-src/branches/PHP_5_4/ext/ldap/ldap.c === --- php/php-src/branches/PHP_5_4/ext/ldap/ldap.c 2011-05-19 17:38:03 UTC (rev 311263) +++ php/php-src/branches/PHP_5_4/ext/ldap/ldap.c 2011-05-19 17:41:21 UTC (rev 311264) @@ -2186,13 +2186,15 @@ #endif #ifdef LDAP_CONTROL_PAGEDRESULTS -/* {{{ proto bool ldap_ctrl_paged_results(resource link, int pagesize [, bool iscritical [, string cookie]]) +/* {{{ proto bool ldap_control_paged_result(resource link, int pagesize [, bool iscritical [, string cookie]]) Inject paged results control*/ -PHP_FUNCTION(ldap_ctrl_paged_results) +PHP_FUNCTION(ldap_control_paged_result) { long pagesize; zend_bool iscritical; - zval *link, *cookie; + zval *link; + char *cookie = NULL; + int cookie_len = 0; struct berval lcookie = { 0, NULL }; ldap_linkdata *ld; LDAP *ldap; @@ -2200,11 +2202,11 @@ LDAPControl ctrl, *ctrlsp[2]; int rc, myargcount = ZEND_NUM_ARGS(); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rl|bz, link, pagesize, iscritical, cookie) != SUCCESS) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rl|bs, link, pagesize, iscritical, cookie, cookie_len) != SUCCESS) { return; } - if (Z_TYPE_PP(link) == IS_NULL) { + if (Z_TYPE_P(link) == IS_NULL) { ldap = NULL; } else { ZEND_FETCH_RESOURCE(ld, ldap_linkdata *, link, -1, ldap link, le_link); @@ -2221,9 +2223,8 @@ switch (myargcount) { case 4: - convert_to_string_ex(cookie); - lcookie.bv_val = Z_STRVAL_PP(cookie); - lcookie.bv_len = Z_STRLEN_PP(cookie); + lcookie.bv_val = cookie; + lcookie.bv_len = cookie_len; /* fallthru */ case 3: ctrl.ldctl_iscritical = (int)iscritical; @@ -2232,13 +2233,13 @@ if (ber_printf(ber, {iO}, (int)pagesize, lcookie) == LBER_ERROR) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to BER printf paged results control); - RETVAL_BOOL(0); + RETVAL_FALSE; goto lcpr_error_out; } rc = ber_flatten2(ber, ctrl.ldctl_value, 0); if (rc == LBER_ERROR) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to BER encode paged results control); - RETVAL_BOOL(0); + RETVAL_FALSE; goto lcpr_error_out; } @@ -2252,16 +2253,16 @@ rc = ldap_set_option(ldap, LDAP_OPT_SERVER_CONTROLS, ctrlsp); if (rc != LDAP_SUCCESS) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to set paged results control: %s (%d), ldap_err2string(rc), rc); - RETVAL_BOOL(0); + RETVAL_FALSE; goto lcpr_error_out; } - RETVAL_BOOL(1); + RETVAL_TRUE; } else { /* return a PHP control object */ array_init(return_value); add_assoc_string(return_value, oid, ctrl.ldctl_oid, 1); - if ( ctrl.ldctl_value.bv_len ) { + if (ctrl.ldctl_value.bv_len) { add_assoc_stringl(return_value, value, ctrl.ldctl_value.bv_val, ctrl.ldctl_value.bv_len, 1); } if (ctrl.ldctl_iscritical) { @@ -2270,16 +2271,16 @@ } lcpr_error_out: -if (ber != NULL) { + if (ber != NULL) { ber_free(ber, 1); } return; } /* }}} */ -/* {{{ proto bool ldap_ctrl_paged_results_resp(resource link, resource result [, string cookie [, int estimated]]) +/* {{{ proto bool ldap_control_paged_result_response(resource link, resource result [, string cookie [, int estimated]]) Extract paged results control response */ -PHP_FUNCTION(ldap_ctrl_paged_results_resp) +PHP_FUNCTION(ldap_control_paged_result_response) { zval *link, *result, *cookie, *estimated; struct berval lcookie; @@ -2357,8 +2358,8 @@
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ UPGRADING
scottmac Thu, 19 May 2011 21:39:01 + Revision: http://svn.php.net/viewvc?view=revisionrevision=311272 Log: Add new functions to UPGRADING Changed paths: U php/php-src/branches/PHP_5_4/UPGRADING Modified: php/php-src/branches/PHP_5_4/UPGRADING === --- php/php-src/branches/PHP_5_4/UPGRADING 2011-05-19 21:17:30 UTC (rev 311271) +++ php/php-src/branches/PHP_5_4/UPGRADING 2011-05-19 21:39:01 UTC (rev 311272) @@ -357,6 +357,8 @@ - Core: - get_declared_traits() - http_response_code() + - ldap_control_paged_results() + - ldap_control_paged_results_response() - trait_exists() - stream_set_chunk_size() - socket_import_stream() -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_4/ UPGRADING
scottmac Thu, 19 May 2011 22:49:47 + Revision: http://svn.php.net/viewvc?view=revisionrevision=311273 Log: Move LDAP to its own section Changed paths: U php/php-src/branches/PHP_5_4/UPGRADING Modified: php/php-src/branches/PHP_5_4/UPGRADING === --- php/php-src/branches/PHP_5_4/UPGRADING 2011-05-19 21:39:01 UTC (rev 311272) +++ php/php-src/branches/PHP_5_4/UPGRADING 2011-05-19 22:49:47 UTC (rev 311273) @@ -357,12 +357,14 @@ - Core: - get_declared_traits() - http_response_code() - - ldap_control_paged_results() - - ldap_control_paged_results_response() - trait_exists() - stream_set_chunk_size() - socket_import_stream() + - LDAP: + - ldap_control_paged_results() + - ldap_control_paged_results_response() + f. New global constants - JSON_PRETTY_PRINT -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/acinclude.m4 branches/PHP_5_4/acinclude.m4 trunk/acinclude.m4
scottmac Thu, 19 May 2011 05:43:48 + Revision: http://svn.php.net/viewvc?view=revisionrevision=311223 Log: Revert part of the fix for #53339 On OSX we need ssl AND crypto The patch that was applied didn't even match what was in the bug Bug: http://bugs.php.net/53339 (Closed) Fails to build LDAP module when compilng with gcc 4.5 and DSO libraries Changed paths: U php/php-src/branches/PHP_5_3/acinclude.m4 U php/php-src/branches/PHP_5_4/acinclude.m4 U php/php-src/trunk/acinclude.m4 Modified: php/php-src/branches/PHP_5_3/acinclude.m4 === --- php/php-src/branches/PHP_5_3/acinclude.m4 2011-05-19 00:42:30 UTC (rev 311222) +++ php/php-src/branches/PHP_5_3/acinclude.m4 2011-05-19 05:43:48 UTC (rev 311223) @@ -2397,6 +2397,7 @@ -L$OPENSSL_LIBDIR ]) LIBS=$old_LIBS +PHP_ADD_LIBRARY(ssl,,$1) PHP_ADD_LIBRARY(crypto,,$1) PHP_ADD_LIBPATH($OPENSSL_LIBDIR, $1) Modified: php/php-src/branches/PHP_5_4/acinclude.m4 === --- php/php-src/branches/PHP_5_4/acinclude.m4 2011-05-19 00:42:30 UTC (rev 311222) +++ php/php-src/branches/PHP_5_4/acinclude.m4 2011-05-19 05:43:48 UTC (rev 311223) @@ -2412,6 +2412,7 @@ -L$OPENSSL_LIBDIR ]) LIBS=$old_LIBS +PHP_ADD_LIBRARY(ssl,,$1) PHP_ADD_LIBRARY(crypto,,$1) PHP_ADD_LIBPATH($OPENSSL_LIBDIR, $1) Modified: php/php-src/trunk/acinclude.m4 === --- php/php-src/trunk/acinclude.m4 2011-05-19 00:42:30 UTC (rev 311222) +++ php/php-src/trunk/acinclude.m4 2011-05-19 05:43:48 UTC (rev 311223) @@ -2412,6 +2412,7 @@ -L$OPENSSL_LIBDIR ]) LIBS=$old_LIBS +PHP_ADD_LIBRARY(ssl,,$1) PHP_ADD_LIBRARY(crypto,,$1) PHP_ADD_LIBPATH($OPENSSL_LIBDIR, $1) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/Zend/zend_constants.c trunk/Zend/zend_constants.c
scottmac Tue, 17 May 2011 22:24:44 + Revision: http://svn.php.net/viewvc?view=revisionrevision=311164 Log: ZEND_THREAD_SAFE and ZEND_DEBUG_BUILD are not meant to be case insensitive Changed paths: U php/php-src/branches/PHP_5_4/Zend/zend_constants.c U php/php-src/trunk/Zend/zend_constants.c Modified: php/php-src/branches/PHP_5_4/Zend/zend_constants.c === --- php/php-src/branches/PHP_5_4/Zend/zend_constants.c 2011-05-17 22:17:16 UTC (rev 311163) +++ php/php-src/branches/PHP_5_4/Zend/zend_constants.c 2011-05-17 22:24:44 UTC (rev 311164) @@ -141,7 +141,7 @@ c.value.type = IS_NULL; zend_register_constant(c TSRMLS_CC); - c.flags = CONST_PERSISTENT; + c.flags = CONST_PERSISTENT | CONST_CS; c.name = zend_strndup(ZEND_STRL(ZEND_THREAD_SAFE)); c.name_len = sizeof(ZEND_THREAD_SAFE); Modified: php/php-src/trunk/Zend/zend_constants.c === --- php/php-src/trunk/Zend/zend_constants.c 2011-05-17 22:17:16 UTC (rev 311163) +++ php/php-src/trunk/Zend/zend_constants.c 2011-05-17 22:24:44 UTC (rev 311164) @@ -141,7 +141,7 @@ c.value.type = IS_NULL; zend_register_constant(c TSRMLS_CC); - c.flags = CONST_PERSISTENT; + c.flags = CONST_PERSISTENT | CONST_CS; c.name = zend_strndup(ZEND_STRL(ZEND_THREAD_SAFE)); c.name_len = sizeof(ZEND_THREAD_SAFE); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/sqlite3/libsqlite/php-sqlite3-changes.patch branches/PHP_5_3/ext/sqlite3/libsqlite/sqlite3.c branches/PHP_5_3/ext/sqlite3/libsql
scottmac Fri, 13 May 2011 06:11:06 + Revision: http://svn.php.net/viewvc?view=revisionrevision=310982 Log: Update bundled SQLite to 3.7.6.2 Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/sqlite3/libsqlite/php-sqlite3-changes.patch U php/php-src/branches/PHP_5_3/ext/sqlite3/libsqlite/sqlite3.c U php/php-src/branches/PHP_5_3/ext/sqlite3/libsqlite/sqlite3.h U php/php-src/trunk/ext/sqlite3/libsqlite/php-sqlite3-changes.patch U php/php-src/trunk/ext/sqlite3/libsqlite/sqlite3.c U php/php-src/trunk/ext/sqlite3/libsqlite/sqlite3.h diffs exceeded maximum size -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/pcre/pcrelib/pcre_internal.h trunk/ext/pcre/pcrelib/pcre_internal.h
scottmac Fri, 13 May 2011 13:51:07 + Revision: http://svn.php.net/viewvc?view=revisionrevision=310991 Log: Fix Windows build, this really should be in a patch file / README. I'll fix this up later. Changed paths: U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/pcre_internal.h U php/php-src/trunk/ext/pcre/pcrelib/pcre_internal.h Modified: php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/pcre_internal.h === --- php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/pcre_internal.h 2011-05-13 13:47:50 UTC (rev 310990) +++ php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/pcre_internal.h 2011-05-13 13:51:07 UTC (rev 310991) @@ -192,7 +192,9 @@ have stdint.h (e.g. Solaris) may have inttypes.h. The macro int64_t may be set by configure. */ -#if HAVE_STDINT_H +#ifdef PHP_WIN32 +#include win32/php_stdint.h +#elif HAVE_STDINT_H #include stdint.h #elif HAVE_INTTYPES_H #include inttypes.h Modified: php/php-src/trunk/ext/pcre/pcrelib/pcre_internal.h === --- php/php-src/trunk/ext/pcre/pcrelib/pcre_internal.h 2011-05-13 13:47:50 UTC (rev 310990) +++ php/php-src/trunk/ext/pcre/pcrelib/pcre_internal.h 2011-05-13 13:51:07 UTC (rev 310991) @@ -192,7 +192,9 @@ have stdint.h (e.g. Solaris) may have inttypes.h. The macro int64_t may be set by configure. */ -#if HAVE_STDINT_H +#ifdef PHP_WIN32 +#include win32/php_stdint.h +#elif HAVE_STDINT_H #include stdint.h #elif HAVE_INTTYPES_H #include inttypes.h -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/pcre/pcrelib/pcre_internal.h trunk/ext/pcre/pcrelib/pcre_internal.h
I didn't see a readme, i patched upgrade-pcre.php for one and i'll have it patch the other part if needed. On May 13, 2011, at 7:18 AM, Pierre Joye wrote: Patch has been sent upstream. That's why we have it as patch here and a readme that should be read :) On 13 May 2011 15:51, Scott MacVicar scott...@php.net wrote: scottmac Fri, 13 May 2011 13:51:07 + Revision: http://svn.php.net/viewvc?view=revisionrevision=310991 Log: Fix Windows build, this really should be in a patch file / README. I'll fix this up later. Changed paths: U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/pcre_internal.h U php/php-src/trunk/ext/pcre/pcrelib/pcre_internal.h Modified: php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/pcre_internal.h === --- php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/pcre_internal.h 2011-05-13 13:47:50 UTC (rev 310990) +++ php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/pcre_internal.h 2011-05-13 13:51:07 UTC (rev 310991) @@ -192,7 +192,9 @@ have stdint.h (e.g. Solaris) may have inttypes.h. The macro int64_t may be set by configure. */ -#if HAVE_STDINT_H +#ifdef PHP_WIN32 +#include win32/php_stdint.h +#elif HAVE_STDINT_H #include stdint.h #elif HAVE_INTTYPES_H #include inttypes.h Modified: php/php-src/trunk/ext/pcre/pcrelib/pcre_internal.h === --- php/php-src/trunk/ext/pcre/pcrelib/pcre_internal.h 2011-05-13 13:47:50 UTC (rev 310990) +++ php/php-src/trunk/ext/pcre/pcrelib/pcre_internal.h 2011-05-13 13:51:07 UTC (rev 310991) @@ -192,7 +192,9 @@ have stdint.h (e.g. Solaris) may have inttypes.h. The macro int64_t may be set by configure. */ -#if HAVE_STDINT_H +#ifdef PHP_WIN32 +#include win32/php_stdint.h +#elif HAVE_STDINT_H #include stdint.h #elif HAVE_INTTYPES_H #include inttypes.h
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/standard/image.c trunk/ext/standard/image.c
scottmac Fri, 13 May 2011 05:06:48 + Revision: http://svn.php.net/viewvc?view=revisionrevision=310980 Log: Fixed bug #54723 - getimagesize() doesn't check the full ico signature and misreports mpg files Bug: http://bugs.php.net/54723 (Open) getimagesize() incorrectly identifies files as ICO which aren't Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/standard/image.c U php/php-src/trunk/ext/standard/image.c Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2011-05-13 03:50:23 UTC (rev 310979) +++ php/php-src/branches/PHP_5_3/NEWS 2011-05-13 05:06:48 UTC (rev 310980) @@ -19,6 +19,8 @@ . Implemented FR #54459 (Range function accuracy). (Adam) . Added PHP_MANDIR constant telling where the manpages were installed into, and an --man-dir argument to php-config. (Hannes) + . Fixed bug #54723 (getimagesize() doesn't check the full ico signature). +(Scott) . Fixed bug #54580 (get_browser() segmentation fault when browscap ini directive is set through php_admin_value). (Gustavo) . Fixed bug #54238 (use-after-free in substr_replace()). (Stas) Modified: php/php-src/branches/PHP_5_3/ext/standard/image.c === --- php/php-src/branches/PHP_5_3/ext/standard/image.c 2011-05-13 03:50:23 UTC (rev 310979) +++ php/php-src/branches/PHP_5_3/ext/standard/image.c 2011-05-13 05:06:48 UTC (rev 310980) @@ -51,7 +51,7 @@ (char)0x6a, (char)0x50, (char)0x20, (char)0x20, (char)0x0d, (char)0x0a, (char)0x87, (char)0x0a}; PHPAPI const char php_sig_iff[4] = {'F','O','R','M'}; -PHPAPI const char php_sig_ico[3] = {(char)0x00, (char)0x00, (char)0x01}; +PHPAPI const char php_sig_ico[4] = {(char)0x00, (char)0x00, (char)0x01, (char)0x00}; /* REMEMBER TO ADD MIME-TYPE TO FUNCTION php_image_type_to_mime_type */ /* PCX must check first 64bytes and byte 0=0x0a and byte2 0x06 */ @@ -1265,7 +1265,7 @@ return IMAGE_FILETYPE_TIFF_MM; } else if (!memcmp(filetype, php_sig_iff, 4)) { return IMAGE_FILETYPE_IFF; - } else if (!memcmp(filetype, php_sig_ico, 3)) { + } else if (!memcmp(filetype, php_sig_ico, 4)) { return IMAGE_FILETYPE_ICO; } Modified: php/php-src/trunk/ext/standard/image.c === --- php/php-src/trunk/ext/standard/image.c 2011-05-13 03:50:23 UTC (rev 310979) +++ php/php-src/trunk/ext/standard/image.c 2011-05-13 05:06:48 UTC (rev 310980) @@ -51,7 +51,7 @@ (char)0x6a, (char)0x50, (char)0x20, (char)0x20, (char)0x0d, (char)0x0a, (char)0x87, (char)0x0a}; PHPAPI const char php_sig_iff[4] = {'F','O','R','M'}; -PHPAPI const char php_sig_ico[3] = {(char)0x00, (char)0x00, (char)0x01}; +PHPAPI const char php_sig_ico[4] = {(char)0x00, (char)0x00, (char)0x01, (char)0x00}; /* REMEMBER TO ADD MIME-TYPE TO FUNCTION php_image_type_to_mime_type */ /* PCX must check first 64bytes and byte 0=0x0a and byte2 0x06 */ @@ -1265,7 +1265,7 @@ return IMAGE_FILETYPE_TIFF_MM; } else if (!memcmp(filetype, php_sig_iff, 4)) { return IMAGE_FILETYPE_IFF; - } else if (!memcmp(filetype, php_sig_ico, 3)) { + } else if (!memcmp(filetype, php_sig_ico, 4)) { return IMAGE_FILETYPE_ICO; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/xmlreader/php_xmlreader.c trunk/ext/xmlreader/php_xmlreader.c
scottmac Fri, 13 May 2011 05:54:34 + Revision: http://svn.php.net/viewvc?view=revisionrevision=310981 Log: Fix use after free() in XMLReader::xml() Changed paths: U php/php-src/branches/PHP_5_3/ext/xmlreader/php_xmlreader.c U php/php-src/trunk/ext/xmlreader/php_xmlreader.c Modified: php/php-src/branches/PHP_5_3/ext/xmlreader/php_xmlreader.c === --- php/php-src/branches/PHP_5_3/ext/xmlreader/php_xmlreader.c 2011-05-13 05:06:48 UTC (rev 310980) +++ php/php-src/branches/PHP_5_3/ext/xmlreader/php_xmlreader.c 2011-05-13 05:54:34 UTC (rev 310981) @@ -1092,9 +1092,7 @@ uri = (char *) xmlCanonicPath((const xmlChar *) resolved_path); } reader = xmlNewTextReader(inputbfr, uri); - if (uri) { - xmlFree(uri); - } + if (reader != NULL) { #if LIBXML_VERSION = 20628 ret = xmlTextReaderSetup(reader, NULL, uri, encoding, options); @@ -1108,11 +1106,20 @@ } intern-input = inputbfr; intern-ptr = reader; + + if (uri) { + xmlFree(uri); + } + return; } } } + if (uri) { + xmlFree(uri); + } + if (inputbfr) { xmlFreeParserInputBuffer(inputbfr); } Modified: php/php-src/trunk/ext/xmlreader/php_xmlreader.c === --- php/php-src/trunk/ext/xmlreader/php_xmlreader.c 2011-05-13 05:06:48 UTC (rev 310980) +++ php/php-src/trunk/ext/xmlreader/php_xmlreader.c 2011-05-13 05:54:34 UTC (rev 310981) @@ -30,6 +30,7 @@ #ifdef HAVE_DOM #include ext/dom/xml_common.h #endif +#include libxml/xmlreader.h #include libxml/uri.h zend_class_entry *xmlreader_class_entry; @@ -1091,9 +1092,7 @@ uri = (char *) xmlCanonicPath((const xmlChar *) resolved_path); } reader = xmlNewTextReader(inputbfr, uri); - if (uri) { - xmlFree(uri); - } + if (reader != NULL) { #if LIBXML_VERSION = 20628 ret = xmlTextReaderSetup(reader, NULL, uri, encoding, options); @@ -1107,11 +1106,20 @@ } intern-input = inputbfr; intern-ptr = reader; + + if (uri) { + xmlFree(uri); + } + return; } } } + if (uri) { + xmlFree(uri); + } + if (inputbfr) { xmlFreeParserInputBuffer(inputbfr); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/standard/head.c trunk/ext/standard/head.c
scottmac Tue, 10 May 2011 19:09:24 + Revision: http://svn.php.net/viewvc?view=revisionrevision=310925 Log: Turns out that more than 1% of users clocks are more than a year out of date, this causes cookies to never get deleted since the date is in the future. I can only guess its due to batteries on the motherboard being dead. Changed paths: U php/php-src/branches/PHP_5_3/ext/standard/head.c U php/php-src/trunk/ext/standard/head.c Modified: php/php-src/branches/PHP_5_3/ext/standard/head.c === --- php/php-src/branches/PHP_5_3/ext/standard/head.c2011-05-10 15:20:03 UTC (rev 310924) +++ php/php-src/branches/PHP_5_3/ext/standard/head.c2011-05-10 19:09:24 UTC (rev 310925) @@ -115,10 +115,9 @@ /* * MSIE doesn't delete a cookie when you set it to a null value * so in order to force cookies to be deleted, even on MSIE, we -* pick an expiry date 1 year and 1 second in the past +* pick an expiry date in the past */ - time_t t = time(NULL) - 31536001; - dt = php_format_date(D, d-M-Y H:i:s T, sizeof(D, d-M-Y H:i:s T)-1, t, 0 TSRMLS_CC); + dt = php_format_date(D, d-M-Y H:i:s T, sizeof(D, d-M-Y H:i:s T)-1, 1, 0 TSRMLS_CC); snprintf(cookie, len + 100, Set-Cookie: %s=deleted; expires=%s, name, dt); efree(dt); } else { Modified: php/php-src/trunk/ext/standard/head.c === --- php/php-src/trunk/ext/standard/head.c 2011-05-10 15:20:03 UTC (rev 310924) +++ php/php-src/trunk/ext/standard/head.c 2011-05-10 19:09:24 UTC (rev 310925) @@ -114,10 +114,9 @@ /* * MSIE doesn't delete a cookie when you set it to a null value * so in order to force cookies to be deleted, even on MSIE, we -* pick an expiry date 1 year and 1 second in the past +* pick an expiry date in the past */ - time_t t = time(NULL) - 31536001; - dt = php_format_date(D, d-M-Y H:i:s T, sizeof(D, d-M-Y H:i:s T)-1, t, 0 TSRMLS_CC); + dt = php_format_date(D, d-M-Y H:i:s T, sizeof(D, d-M-Y H:i:s T)-1, 1, 0 TSRMLS_CC); snprintf(cookie, len + 100, Set-Cookie: %s=deleted; expires=%s, name, dt); efree(dt); } else { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/lib/timelib.h trunk/ext/date/lib/timelib.h
scottmac Wed, 09 Mar 2011 20:06:52 + Revision: http://svn.php.net/viewvc?view=revisionrevision=309055 Log: Add a version number to timelib for other projects that use it. This has the same version scheme as timezonedb. yearrelease-padded-to-two Changed paths: U php/php-src/branches/PHP_5_3/ext/date/lib/timelib.h U php/php-src/trunk/ext/date/lib/timelib.h Modified: php/php-src/branches/PHP_5_3/ext/date/lib/timelib.h === --- php/php-src/branches/PHP_5_3/ext/date/lib/timelib.h 2011-03-09 18:53:22 UTC (rev 309054) +++ php/php-src/branches/PHP_5_3/ext/date/lib/timelib.h 2011-03-09 20:06:52 UTC (rev 309055) @@ -26,6 +26,8 @@ #include limits.h #endif +#define TIMELIB_VERSION 201101 + #define TIMELIB_NONE 0x00 #define TIMELIB_OVERRIDE_TIME0x01 #define TIMELIB_NO_CLONE 0x02 Modified: php/php-src/trunk/ext/date/lib/timelib.h === --- php/php-src/trunk/ext/date/lib/timelib.h2011-03-09 18:53:22 UTC (rev 309054) +++ php/php-src/trunk/ext/date/lib/timelib.h2011-03-09 20:06:52 UTC (rev 309055) @@ -26,6 +26,8 @@ #include limits.h #endif +#define TIMELIB_VERSION 201101 + #define TIMELIB_NONE 0x00 #define TIMELIB_OVERRIDE_TIME0x01 #define TIMELIB_NO_CLONE 0x02 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/json/json.c branches/PHP_5_3/ext/json/tests/bug54058.phpt trunk/ext/json/json.c trunk/ext/json/tests/bug54058.phpt
scottmac Mon, 21 Feb 2011 08:09:02 + Revision: http://svn.php.net/viewvc?view=revisionrevision=308529 Log: Fix Bug #54058, invalid utf-8 doesn't set json_encode() in all cases Bug: http://bugs.php.net/54058 (Open) json_last_error() doesn't work properly with arrays/objects Changed paths: U php/php-src/branches/PHP_5_3/ext/json/json.c A php/php-src/branches/PHP_5_3/ext/json/tests/bug54058.phpt U php/php-src/trunk/ext/json/json.c A php/php-src/trunk/ext/json/tests/bug54058.phpt Modified: php/php-src/branches/PHP_5_3/ext/json/json.c === --- php/php-src/branches/PHP_5_3/ext/json/json.c2011-02-21 07:36:26 UTC (rev 308528) +++ php/php-src/branches/PHP_5_3/ext/json/json.c2011-02-21 08:09:02 UTC (rev 308529) @@ -431,7 +431,6 @@ PHP_JSON_API void php_json_encode(smart_str *buf, zval *val, int options TSRMLS_DC) /* {{{ */ { - JSON_G(error_code) = PHP_JSON_ERROR_NONE; switch (Z_TYPE_P(val)) { case IS_NULL: @@ -567,6 +566,8 @@ return; } + JSON_G(error_code) = PHP_JSON_ERROR_NONE; + php_json_encode(buf, parameter, options TSRMLS_CC); ZVAL_STRINGL(return_value, buf.c, buf.len, 1); Added: php/php-src/branches/PHP_5_3/ext/json/tests/bug54058.phpt === --- php/php-src/branches/PHP_5_3/ext/json/tests/bug54058.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/json/tests/bug54058.phpt 2011-02-21 08:09:02 UTC (rev 308529) @@ -0,0 +1,35 @@ +--TEST-- +Bug #54058 (json_last_error() invalid UTF-8 produces wrong error) +--SKIPIF-- +?php if (!extension_loaded(json)) print skip; ? +--FILE-- +?php + +$bad_utf8 = quoted_printable_decode('=B0'); + +json_encode($bad_utf8); +var_dump(json_last_error()); + +$a = new stdclass; +$a-foo = quoted_printable_decode('=B0'); +json_encode($a); +var_dump(json_last_error()); + +$b = new stdclass; +$b-foo = $bad_utf8; +$b-bar = 1; +json_encode($b); +var_dump(json_last_error()); + +$c = array( +'foo' = $bad_utf8, +'bar' = 1 +); +json_encode($c); +var_dump(json_last_error()); +? +--EXPECTF-- +int(5) +int(5) +int(5) +int(5) Modified: php/php-src/trunk/ext/json/json.c === --- php/php-src/trunk/ext/json/json.c 2011-02-21 07:36:26 UTC (rev 308528) +++ php/php-src/trunk/ext/json/json.c 2011-02-21 08:09:02 UTC (rev 308529) @@ -538,7 +538,6 @@ PHP_JSON_API void php_json_encode(smart_str *buf, zval *val, int options TSRMLS_DC) /* {{{ */ { - JSON_G(error_code) = PHP_JSON_ERROR_NONE; switch (Z_TYPE_P(val)) { case IS_NULL: @@ -680,6 +679,8 @@ return; } + JSON_G(error_code) = PHP_JSON_ERROR_NONE; + php_json_encode(buf, parameter, options TSRMLS_CC); ZVAL_STRINGL(return_value, buf.c, buf.len, 1); Added: php/php-src/trunk/ext/json/tests/bug54058.phpt === --- php/php-src/trunk/ext/json/tests/bug54058.phpt (rev 0) +++ php/php-src/trunk/ext/json/tests/bug54058.phpt 2011-02-21 08:09:02 UTC (rev 308529) @@ -0,0 +1,35 @@ +--TEST-- +Bug #54058 (json_last_error() invalid UTF-8 produces wrong error) +--SKIPIF-- +?php if (!extension_loaded(json)) print skip; ? +--FILE-- +?php + +$bad_utf8 = quoted_printable_decode('=B0'); + +json_encode($bad_utf8); +var_dump(json_last_error()); + +$a = new stdclass; +$a-foo = quoted_printable_decode('=B0'); +json_encode($a); +var_dump(json_last_error()); + +$b = new stdclass; +$b-foo = $bad_utf8; +$b-bar = 1; +json_encode($b); +var_dump(json_last_error()); + +$c = array( +'foo' = $bad_utf8, +'bar' = 1 +); +json_encode($c); +var_dump(json_last_error()); +? +--EXPECTF-- +int(5) +int(5) +int(5) +int(5) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/json/JSON_parser.c trunk/ext/json/JSON_parser.c
scottmac Wed, 09 Feb 2011 08:05:00 + Revision: http://svn.php.net/viewvc?view=revisionrevision=308155 Log: Fix Bug #53963, error code isn't always set in certain error cases. Bug: http://bugs.php.net/53963 (Assigned) Failed to decode, yet json_last_error() is JSON_ERROR_NONE Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/json/JSON_parser.c U php/php-src/trunk/ext/json/JSON_parser.c Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2011-02-09 00:34:12 UTC (rev 308154) +++ php/php-src/branches/PHP_5_3/NEWS 2011-02-09 08:05:00 UTC (rev 308155) @@ -75,6 +75,10 @@ . Implemented clone functionality for number, date message formatters. (Stas). +- JSON extension: + . Fixed bug #53963 (Ensure error_code is always set during some failed +decodings). (Scott) + - MySQL Improved extension: . Added 'db' and 'catalog' keys to the field fetching functions (FR #39847). (Kalle) Modified: php/php-src/branches/PHP_5_3/ext/json/JSON_parser.c === --- php/php-src/branches/PHP_5_3/ext/json/JSON_parser.c 2011-02-09 00:34:12 UTC (rev 308154) +++ php/php-src/branches/PHP_5_3/ext/json/JSON_parser.c 2011-02-09 08:05:00 UTC (rev 308155) @@ -656,6 +656,7 @@ /* fall through if not IS_STRING */ default: FREE_BUFFERS(); +jp-error_code = PHP_JSON_ERROR_SYNTAX; return false; } break; @@ -695,6 +696,7 @@ break; default: FREE_BUFFERS(); +jp-error_code = PHP_JSON_ERROR_SYNTAX; return false; } buf.len = 0; Modified: php/php-src/trunk/ext/json/JSON_parser.c === --- php/php-src/trunk/ext/json/JSON_parser.c2011-02-09 00:34:12 UTC (rev 308154) +++ php/php-src/trunk/ext/json/JSON_parser.c2011-02-09 08:05:00 UTC (rev 308155) @@ -673,6 +673,7 @@ /* fall through if not IS_STRING */ default: FREE_BUFFERS(); +jp-error_code = PHP_JSON_ERROR_SYNTAX; return false; } break; @@ -712,6 +713,7 @@ break; default: FREE_BUFFERS(); +jp-error_code = PHP_JSON_ERROR_SYNTAX; return false; } buf.len = 0; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/intl/spoofchecker/ spoofchecker_main.c
scottmac Thu, 03 Feb 2011 16:29:23 + Revision: http://svn.php.net/viewvc?view=revisionrevision=307976 Log: Fix docblocks on SpoofChecker and remove exceptions after discussion with Stas. Changed paths: U php/php-src/trunk/ext/intl/spoofchecker/spoofchecker_main.c Modified: php/php-src/trunk/ext/intl/spoofchecker/spoofchecker_main.c === --- php/php-src/trunk/ext/intl/spoofchecker/spoofchecker_main.c 2011-02-03 13:33:10 UTC (rev 307975) +++ php/php-src/trunk/ext/intl/spoofchecker/spoofchecker_main.c 2011-02-03 16:29:23 UTC (rev 307976) @@ -21,7 +21,7 @@ #include php_intl.h #include spoofchecker_class.h -/* {{{ proto bool Spoofchecker::isSuspicious( string $text[, int $error_code ] ) +/* {{{ proto bool Spoofchecker::isSuspicious( string text[, int error_code ] ) * Checks if a given text contains any suspicious characters */ PHP_METHOD(Spoofchecker, isSuspicious) @@ -41,8 +41,8 @@ ret = uspoof_checkUTF8(co-uspoof, text, text_len, NULL, SPOOFCHECKER_ERROR_CODE_P(co)); if (U_FAILURE(SPOOFCHECKER_ERROR_CODE(co))) { - zend_throw_exception(zend_exception_get_default(TSRMLS_C), u_errorName(SPOOFCHECKER_ERROR_CODE(co)), SPOOFCHECKER_ERROR_CODE(co) TSRMLS_CC); - return; + php_error_docref(NULL TSRMLS_CC, E_WARNING, (%ld) %s, u_errorName(SPOOFCHECKER_ERROR_CODE(co)), SPOOFCHECKER_ERROR_CODE(co)); + RETURN_TRUE; } if (error_code) { @@ -53,7 +53,7 @@ } /* }}} */ -/* {{{ proto bool Spoofchecker::areConfusable( string $str1, string $str2[, int $error_code ] ) +/* {{{ proto bool Spoofchecker::areConfusable( string str1, string str2[, int error_code ] ) * Checks if a given text contains any confusable characters */ PHP_METHOD(Spoofchecker, areConfusable) @@ -74,8 +74,8 @@ ret = uspoof_areConfusableUTF8(co-uspoof, s1, s1_len, s2, s2_len, SPOOFCHECKER_ERROR_CODE_P(co)); if (U_FAILURE(SPOOFCHECKER_ERROR_CODE(co))) { - zend_throw_exception(zend_exception_get_default(TSRMLS_C), u_errorName(SPOOFCHECKER_ERROR_CODE(co)), SPOOFCHECKER_ERROR_CODE(co) TSRMLS_CC); - return; + php_error_docref(NULL TSRMLS_CC, E_WARNING, (%ld) %s, u_errorName(SPOOFCHECKER_ERROR_CODE(co)), SPOOFCHECKER_ERROR_CODE(co)); + RETURN_TRUE; } if (error_code) { @@ -86,7 +86,7 @@ } /* }}} */ -/* {{{ proto void Spoofchecker::setAllowedLocales( string $locales ) +/* {{{ proto void Spoofchecker::setAllowedLocales( string locales ) * Locales to use when running checks */ PHP_METHOD(Spoofchecker, setAllowedLocales) @@ -105,13 +105,13 @@ uspoof_setAllowedLocales(co-uspoof, locales, SPOOFCHECKER_ERROR_CODE_P(co)); if (U_FAILURE(SPOOFCHECKER_ERROR_CODE(co))) { - zend_throw_exception(zend_exception_get_default(TSRMLS_C), u_errorName(SPOOFCHECKER_ERROR_CODE(co)), SPOOFCHECKER_ERROR_CODE(co) TSRMLS_CC); + php_error_docref(NULL TSRMLS_CC, E_WARNING, (%ld) %s, u_errorName(SPOOFCHECKER_ERROR_CODE(co)), SPOOFCHECKER_ERROR_CODE(co)); return; } } /* }}} */ -/* {{{ proto void Spoofchecker::setChecks( int $checks ) +/* {{{ proto void Spoofchecker::setChecks( int checks ) * Set the checks to run */ PHP_METHOD(Spoofchecker, setChecks) @@ -129,8 +129,7 @@ uspoof_setChecks(co-uspoof, checks, SPOOFCHECKER_ERROR_CODE_P(co)); if (U_FAILURE(SPOOFCHECKER_ERROR_CODE(co))) { - zend_throw_exception(zend_exception_get_default(TSRMLS_C), u_errorName(SPOOFCHECKER_ERROR_CODE(co)), SPOOFCHECKER_ERROR_CODE(co) TSRMLS_CC); - return; + php_error_docref(NULL TSRMLS_CC, E_WARNING, (%ld) %s, u_errorName(SPOOFCHECKER_ERROR_CODE(co)), SPOOFCHECKER_ERROR_CODE(co)); } } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ NEWS ext/standard/basic_functions.c ext/standard/basic_functions.h main/SAPI.c main/SAPI.h
scottmac Thu, 03 Feb 2011 16:47:28 + Revision: http://svn.php.net/viewvc?view=revisionrevision=307977 Log: Add header_register_callback(), allows a userland function to be called as all the headers are being sent and after all of the default headers have been merged. headers_list(), header_remove() and header() can all be used inside the callback. ?php header('Content-Type: text/plain'); header('X-Test: foo'); function foo() { foreach (headers_list() as $header) { if (strpos($header, 'X-Powered') !== false) { header_remove('X-Powered-By'); } header_remove('X-Test'); } } $result = header_register_callback('foo'); echo a; Changed paths: U php/php-src/trunk/NEWS U php/php-src/trunk/ext/standard/basic_functions.c U php/php-src/trunk/ext/standard/basic_functions.h U php/php-src/trunk/main/SAPI.c U php/php-src/trunk/main/SAPI.h Modified: php/php-src/trunk/NEWS === --- php/php-src/trunk/NEWS 2011-02-03 16:29:23 UTC (rev 307976) +++ php/php-src/trunk/NEWS 2011-02-03 16:47:28 UTC (rev 307977) @@ -42,6 +42,9 @@ . Added support for object references in recursive serialize() calls. FR #36424. (Mike) . Added http_response_code() function. FR #52555. (Paul Dragoonis, Kalle) + . Added header_register_callback() which is invoked immediately +prior to the sending of headers and after default headers have +been added. (Scott) . Added DTrace support. (David Soria Parra) . Improved output layer, see README.NEW-OUTPUT-API for internals. (Mike) . Improved unserialize() performance. Modified: php/php-src/trunk/ext/standard/basic_functions.c === --- php/php-src/trunk/ext/standard/basic_functions.c2011-02-03 16:29:23 UTC (rev 307976) +++ php/php-src/trunk/ext/standard/basic_functions.c2011-02-03 16:47:28 UTC (rev 307977) @@ -141,6 +141,13 @@ ZEND_ARG_INFO(0, seconds) ZEND_END_ARG_INFO() /* }}} */ + +/* {{{ main/sapi.c */ +ZEND_BEGIN_ARG_INFO(arginfo_header_register_callback, 0) + ZEND_ARG_INFO(0, callback) +ZEND_END_ARG_INFO() +/* }}} */ + /* {{{ main/output.c */ ZEND_BEGIN_ARG_INFO_EX(arginfo_ob_start, 0, 0, 0) ZEND_ARG_INFO(0, user_function) @@ -2940,6 +2947,7 @@ PHP_FE(convert_cyr_string, arginfo_convert_cyr_string) PHP_FE(get_current_user, arginfo_get_current_user) PHP_FE(set_time_limit, arginfo_set_time_limit) + PHP_FE(header_register_callback, arginfo_header_register_callback) PHP_FE(get_cfg_var, arginfo_get_cfg_var) PHP_DEP_FALIAS(magic_quotes_runtime,set_magic_quotes_runtime, arginfo_set_magic_quotes_runtime) Modified: php/php-src/trunk/ext/standard/basic_functions.h === --- php/php-src/trunk/ext/standard/basic_functions.h2011-02-03 16:29:23 UTC (rev 307976) +++ php/php-src/trunk/ext/standard/basic_functions.h2011-02-03 16:47:28 UTC (rev 307977) @@ -69,6 +69,8 @@ PHP_FUNCTION(get_current_user); PHP_FUNCTION(set_time_limit); +PHP_FUNCTION(header_register_callback); + PHP_FUNCTION(get_cfg_var); PHP_FUNCTION(set_magic_quotes_runtime); PHP_FUNCTION(get_magic_quotes_runtime); Modified: php/php-src/trunk/main/SAPI.c === --- php/php-src/trunk/main/SAPI.c 2011-02-03 16:29:23 UTC (rev 307976) +++ php/php-src/trunk/main/SAPI.c 2011-02-03 16:47:28 UTC (rev 307977) @@ -116,7 +116,59 @@ efree(sapi_header-header); } +/* {{{ proto bool header_register_callback(mixed callback) + call a header function */ +PHP_FUNCTION(header_register_callback) +{ + zval *callback_func; + char *callback_name; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z, callback_func) == FAILURE) { + return; + } + + if (!zend_is_callable(callback_func, 0, callback_name TSRMLS_CC)) { + efree(callback_name); + RETURN_FALSE; + } + efree(callback_name); + if (SG(callback_func)) { + zval_ptr_dtor(SG(callback_func)); + SG(fci_cache) = empty_fcall_info_cache; + } + + Z_ADDREF_P(callback_func); + + SG(callback_func) = callback_func; + + RETURN_TRUE; +} +/* }}} */ + +static void sapi_run_header_callback() +{ + int error; +
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/tests/ bug20087.phpt mb_parse_str.phpt mb_parse_str02.phpt
scottmac Thu, 03 Feb 2011 17:07:48 + Revision: http://svn.php.net/viewvc?view=revisionrevision=307978 Log: XFAIL these for the moment, Kalle totally broke these in 298241 when removing register_globals Changed paths: U php/php-src/trunk/ext/mbstring/tests/bug20087.phpt U php/php-src/trunk/ext/mbstring/tests/mb_parse_str.phpt U php/php-src/trunk/ext/mbstring/tests/mb_parse_str02.phpt Modified: php/php-src/trunk/ext/mbstring/tests/bug20087.phpt === --- php/php-src/trunk/ext/mbstring/tests/bug20087.phpt 2011-02-03 16:47:28 UTC (rev 307977) +++ php/php-src/trunk/ext/mbstring/tests/bug20087.phpt 2011-02-03 17:07:48 UTC (rev 307978) @@ -2,6 +2,8 @@ Bug #20087 (Assertion failure) --SKIPIF-- ?php extension_loaded('mbstring') or die('skip mbstring not available'); ? +--XFAIL-- +register_globals calls killed the ability for mb_parse_str() to register into the global scope --FILE-- ?php ini_set('include_path', dirname(__FILE__)); Modified: php/php-src/trunk/ext/mbstring/tests/mb_parse_str.phpt === --- php/php-src/trunk/ext/mbstring/tests/mb_parse_str.phpt 2011-02-03 16:47:28 UTC (rev 307977) +++ php/php-src/trunk/ext/mbstring/tests/mb_parse_str.phpt 2011-02-03 17:07:48 UTC (rev 307978) @@ -2,6 +2,8 @@ mb_parse_str() --SKIPIF-- ?php extension_loaded('mbstring') or die('skip mbstring not available'); ? +--XFAIL-- +register_globals calls killed the ability for mb_parse_str() to register into the global scope --INI-- arg_separator.input= --FILE-- Modified: php/php-src/trunk/ext/mbstring/tests/mb_parse_str02.phpt === --- php/php-src/trunk/ext/mbstring/tests/mb_parse_str02.phpt2011-02-03 16:47:28 UTC (rev 307977) +++ php/php-src/trunk/ext/mbstring/tests/mb_parse_str02.phpt2011-02-03 17:07:48 UTC (rev 307978) @@ -2,6 +2,8 @@ mb_parse_str() test 2 --SKIPIF-- ?php extension_loaded('mbstring') or die('skip mbstring not available'); ? +--XFAIL-- +register_globals calls killed the ability for mb_parse_str() to register into the global scope --INI-- arg_separator.input=# --FILE-- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/mbstring/ mbstring.c
scottmac Thu, 27 Jan 2011 11:47:31 + Revision: http://svn.php.net/viewvc?view=revisionrevision=307779 Log: Fix crash with mbstring, this probably isn't the correct behaviour but 272/276 of the tests pass after this. When mbstring.language is unset, it ends up being mbfl_no_language_neutral and there is no default when setting the encoding. internal_encoding and current_internal_encoding then end up being null. Changed paths: U php/php-src/trunk/ext/mbstring/mbstring.c Modified: php/php-src/trunk/ext/mbstring/mbstring.c === --- php/php-src/trunk/ext/mbstring/mbstring.c 2011-01-27 11:47:24 UTC (rev 307778) +++ php/php-src/trunk/ext/mbstring/mbstring.c 2011-01-27 11:47:31 UTC (rev 307779) @@ -1252,7 +1252,7 @@ encoding = mbfl_no2encoding(mbfl_no_encoding_8859_9); break; default: - encoding = NULL; + encoding = mbfl_no2encoding(mbfl_no_encoding_8859_1); break; } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ NEWS ext/intl/config.m4 ext/intl/config.w32 ext/intl/php_intl.c ext/intl/spoofchecker/spoofchecker.c ext/intl/spoofchecker/spoofchecker.h ext/intl/spoofchecker/spoof
/spoofchecker/spoofchecker.c === --- php/php-src/trunk/ext/intl/spoofchecker/spoofchecker.c (rev 0) +++ php/php-src/trunk/ext/intl/spoofchecker/spoofchecker.c 2011-01-13 06:53:09 UTC (rev 307431) @@ -0,0 +1,60 @@ +/* + +--+ + | PHP Version 5| + +--+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is| + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | lice...@php.net so we can mail you a copy immediately. | + +--+ + | Authors: Scott MacVicar scott...@php.net | + +--+ + */ + +#ifdef HAVE_CONFIG_H +#include config.h +#endif + +#include spoofchecker_class.h +#include spoofchecker.h + +#include unicode/uspoof.h + + +/* {{{ spoofchecker_register_constants + * Register constants + */ +void spoofchecker_register_constants(INIT_FUNC_ARGS) +{ + if (!Spoofchecker_ce_ptr) + { + zend_error(E_ERROR, Spoofchecker class not defined); + return; + } + + #define SPOOFCHECKER_EXPOSE_CLASS_CONST(x) zend_declare_class_constant_long(Spoofchecker_ce_ptr, ZEND_STRS( #x ) - 1, USPOOF_##x TSRMLS_CC); + + SPOOFCHECKER_EXPOSE_CLASS_CONST(SINGLE_SCRIPT_CONFUSABLE) + SPOOFCHECKER_EXPOSE_CLASS_CONST(MIXED_SCRIPT_CONFUSABLE) + SPOOFCHECKER_EXPOSE_CLASS_CONST(WHOLE_SCRIPT_CONFUSABLE) + SPOOFCHECKER_EXPOSE_CLASS_CONST(ANY_CASE) + SPOOFCHECKER_EXPOSE_CLASS_CONST(SINGLE_SCRIPT) + SPOOFCHECKER_EXPOSE_CLASS_CONST(INVISIBLE) + SPOOFCHECKER_EXPOSE_CLASS_CONST(CHAR_LIMIT) + + + #undef SPOOFCHECKER_EXPOSE_CLASS_CONST +} +/* }}} */ + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: noet sw=4 ts=4 fdm=marker + * vim600: noet sw=4 ts=4 + */ Property changes on: php/php-src/trunk/ext/intl/spoofchecker/spoofchecker.c ___ Added: svn:executable + * Added: php/php-src/trunk/ext/intl/spoofchecker/spoofchecker.h === --- php/php-src/trunk/ext/intl/spoofchecker/spoofchecker.h (rev 0) +++ php/php-src/trunk/ext/intl/spoofchecker/spoofchecker.h 2011-01-13 06:53:09 UTC (rev 307431) @@ -0,0 +1,24 @@ +/* + +--+ + | PHP Version 5| + +--+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE, and is| + | available through the world-wide-web at the following url: | + | http://www.php.net/license/3_01.txt | + | If you did not receive a copy of the PHP license and are unable to | + | obtain it through the world-wide-web, please send a note to | + | lice...@php.net so we can mail you a copy immediately. | + +--+ + | Authors: Scott MacVicar scott...@php.net | + +--+ + */ + +#ifndef SPOOFCHECKER_SPOOFCHECKER_H +#define SPOOFCHECKER_SPOOFCHECKER_H + +#include php.h + +void spoofchecker_register_constants(INIT_FUNC_ARGS); + +#endif // SPOOFCHECKER_SPOOFCHECKER_H Property changes on: php/php-src/trunk/ext/intl/spoofchecker/spoofchecker.h ___ Added: svn:executable + * Added: php/php-src/trunk/ext/intl/spoofchecker/spoofchecker_class.c === --- php/php-src/trunk/ext/intl/spoofchecker/spoofchecker_class.c (rev 0) +++ php/php-src/trunk/ext/intl/spoofchecker/spoofchecker_class.c 2011-01-13 06:53:09 UTC (rev 307431) @@ -0,0 +1,185 @@ +/* + +--+ + | PHP Version 5| + +--+ + | This source file is subject to version 3.01 of the PHP license, | + | that is bundled with this package in the file LICENSE
[PHP-CVS] svn: /php/php-src/trunk/ext/intl/spoofchecker/ spoofchecker_class.c spoofchecker_create.c spoofchecker_main.c
scottmac Thu, 13 Jan 2011 07:46:59 + Revision: http://svn.php.net/viewvc?view=revisionrevision=307433 Log: intl: Add Spoofchecker cloning, fix typo in prototype, rename some variables and tidy syntax. Changed paths: U php/php-src/trunk/ext/intl/spoofchecker/spoofchecker_class.c U php/php-src/trunk/ext/intl/spoofchecker/spoofchecker_create.c U php/php-src/trunk/ext/intl/spoofchecker/spoofchecker_main.c Modified: php/php-src/trunk/ext/intl/spoofchecker/spoofchecker_class.c === --- php/php-src/trunk/ext/intl/spoofchecker/spoofchecker_class.c 2011-01-13 07:27:46 UTC (rev 307432) +++ php/php-src/trunk/ext/intl/spoofchecker/spoofchecker_class.c 2011-01-13 07:46:59 UTC (rev 307433) @@ -117,6 +117,31 @@ }; /* }}} */ +static zend_object_value spoofchecker_clone_obj(zval *object TSRMLS_DC) /* {{{ */ +{ + zend_object_value new_obj_val; + zend_object_handle handle = Z_OBJ_HANDLE_P(object); + Spoofchecker_object *sfo, *new_sfo; + +sfo = (Spoofchecker_object *) zend_object_store_get_object(object TSRMLS_CC); +intl_error_reset(SPOOFCHECKER_ERROR_P(sfo) TSRMLS_CC); + + new_obj_val = Spoofchecker_ce_ptr-create_object(Spoofchecker_ce_ptr TSRMLS_CC); + new_sfo = (Spoofchecker_object *)zend_object_store_get_object_by_handle(new_obj_val.handle TSRMLS_CC); + /* clone standard parts */ + zend_objects_clone_members(new_sfo-zo, new_obj_val, sfo-zo, handle TSRMLS_CC); + /* clone internal object */ + new_sfo-uspoof = uspoof_clone(sfo-uspoof, SPOOFCHECKER_ERROR_CODE_P(new_sfo)); + if(U_FAILURE(SPOOFCHECKER_ERROR_CODE(new_sfo))) { + /* set up error in case error handler is interested */ + intl_error_set( NULL, SPOOFCHECKER_ERROR_CODE(new_sfo), Failed to clone SpoofChecker object, 0 TSRMLS_CC ); + Spoofchecker_objects_dtor(new_sfo, new_obj_val.handle TSRMLS_CC); /* free new object */ + zend_error(E_ERROR, Failed to clone SpoofChecker object); + } + return new_obj_val; +} +/* }}} */ + /* {{{ spoofchecker_register_Spoofchecker_class * Initialize 'Spoofchecker' class */ @@ -131,8 +156,7 @@ memcpy(Spoofchecker_handlers, zend_get_std_object_handlers(), sizeof Spoofchecker_handlers); - /* Doesn't make sense to clone */ - Spoofchecker_handlers.clone_obj = NULL; + Spoofchecker_handlers.clone_obj = spoofchecker_clone_obj; if (!Spoofchecker_ce_ptr) { zend_error(E_ERROR, Modified: php/php-src/trunk/ext/intl/spoofchecker/spoofchecker_create.c === --- php/php-src/trunk/ext/intl/spoofchecker/spoofchecker_create.c 2011-01-13 07:27:46 UTC (rev 307432) +++ php/php-src/trunk/ext/intl/spoofchecker/spoofchecker_create.c 2011-01-13 07:46:59 UTC (rev 307433) @@ -29,13 +29,13 @@ PHP_METHOD(Spoofchecker, __construct) { int checks; - SPOOFCHECKER_METHOD_INIT_VARS + SPOOFCHECKER_METHOD_INIT_VARS; if (zend_parse_parameters_none() == FAILURE) { return; } - SPOOFCHECKER_METHOD_FETCH_OBJECT + SPOOFCHECKER_METHOD_FETCH_OBJECT; co-uspoof = uspoof_open(SPOOFCHECKER_ERROR_CODE_P(co)); INTL_CTOR_CHECK_STATUS(co, spoofchecker: unable to open ICU Spoof Checker); Modified: php/php-src/trunk/ext/intl/spoofchecker/spoofchecker_main.c === --- php/php-src/trunk/ext/intl/spoofchecker/spoofchecker_main.c 2011-01-13 07:27:46 UTC (rev 307432) +++ php/php-src/trunk/ext/intl/spoofchecker/spoofchecker_main.c 2011-01-13 07:46:59 UTC (rev 307433) @@ -21,7 +21,7 @@ #include php_intl.h #include spoofchecker_class.h -/* {{{ proto void Spoofchecker::isSuspicious( string $text[, int $error_code ] ) +/* {{{ proto bool Spoofchecker::isSuspicious( string $text[, int $error_code ] ) * Checks if a given text contains any suspicious characters */ PHP_METHOD(Spoofchecker, isSuspicious) @@ -29,14 +29,14 @@ int ret; char *text; int text_len; - zval *issued_found = NULL; - SPOOFCHECKER_METHOD_INIT_VARS + zval *error_code = NULL; + SPOOFCHECKER_METHOD_INIT_VARS; - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|z, text, text_len, issued_found)) { + if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s|z, text, text_len, error_code)) { return; } - SPOOFCHECKER_METHOD_FETCH_OBJECT + SPOOFCHECKER_METHOD_FETCH_OBJECT; ret = uspoof_checkUTF8(co-uspoof, text, text_len, NULL, SPOOFCHECKER_ERROR_CODE_P(co)); @@ -45,15 +45,15 @@ return; } - if (issued_found) { - zval_dtor(issued_found); - ZVAL_LONG(issued_found, ret); +
Re: [PHP-CVS] =?utf-8?q?svn:_/php/php-src/trunk/_NEWS_ext/intl/config.m4_ext/intl/config.w32_ext/intl/php=5Fintl.c_ext/intl/spoofchecker/spoofchecker.c_ext/intl/spoofchecker/spoofchecker.h_ext/intl/sp
On Jan 12, 2011, at 11:11 PM, Stas Malyshev wrote: Hi! Some of questions: 1. Why clone is not defined? uspoof_clone exists. Done 2. /* {{{ proto void Spoofchecker::areConfusable( string $str1, string $str2[, int $error_code ] ) + * Checks if a given text contains any confusable characters + */ It says void but code returns bool. Same with isSuspicious. Also, is 'issued_found' a typo? Why wouldn't this function just return the error code? Yeah, it's meant to return bool. Just a typo in the prototype. 3. + if (U_FAILURE(SPOOFCHECKER_ERROR_CODE(co))) { + zend_throw_exception(zend_exception_get_default(TSRMLS_C), u_errorName(SPOOFCHECKER_ERROR_CODE(co)), SPOOFCHECKER_ERROR_CODE(co) TSRMLS_CC); None of intl parts throw exceptions on errors. Please bring the code in sync with the rest of the module. what value would it return instead of an exception? false? It returns a bool already, so false means its not suspicious. So if some random error occurred it would imply there is no security issue. 4. + SPOOFCHECKER_METHOD_FETCH_OBJECT Please put ; at the end of the line. I know it's not required, but the line without ; at the end makes the code less readable - each time you look at it you think is there a problem here? Done, but surely we should kill ; from the macro then so it becomes required. 5. Why setAllowedLocales but no setAllowedChars? Couldn't see an immediate use, but i'll add it shortly. - Scott -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/sqlite3/sqlite3.c trunk/ext/sqlite3/sqlite3.c
scottmac Thu, 06 Jan 2011 00:08:59 + Revision: http://svn.php.net/viewvc?view=revisionrevision=307143 Log: Implemented FR #53466 (SQLite3Result::columnType() should return false after all of the rows have been fetched). Bug: http://bugs.php.net/53466 (Open) sqlite3 columnType() returns SQLITE3_NULL when not in fetch loop Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/sqlite3/sqlite3.c U php/php-src/trunk/ext/sqlite3/sqlite3.c Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2011-01-05 21:20:08 UTC (rev 307142) +++ php/php-src/branches/PHP_5_3/NEWS 2011-01-06 00:08:59 UTC (rev 307143) @@ -85,6 +85,7 @@ - SQLite3 extension: . Fixed memory leaked introduced by the NULL poisoning patch (Mateusz Kocielski, Pierre) . Add SQlite3_Stmt::readonly() for checking if a statement is read only. (Scott) + . Implemented FR #53466 (SQLite3Result::columnType() should return false after all of the rows have been fetched). (Scott) - Streams: . Implemented FR #26158 (open arbitrary file descriptor with fopen). (Gustavo) Modified: php/php-src/branches/PHP_5_3/ext/sqlite3/sqlite3.c === --- php/php-src/branches/PHP_5_3/ext/sqlite3/sqlite3.c 2011-01-05 21:20:08 UTC (rev 307142) +++ php/php-src/branches/PHP_5_3/ext/sqlite3/sqlite3.c 2011-01-06 00:08:59 UTC (rev 307143) @@ -1585,6 +1585,10 @@ return; } + if (result_obj-complete) { + RETURN_FALSE; + } + RETURN_LONG(sqlite3_column_type(result_obj-stmt_obj-stmt, column)); } /* }}} */ @@ -1634,6 +1638,7 @@ break; case SQLITE_DONE: + result_obj-complete = 1; RETURN_FALSE; break; Modified: php/php-src/trunk/ext/sqlite3/sqlite3.c === --- php/php-src/trunk/ext/sqlite3/sqlite3.c 2011-01-05 21:20:08 UTC (rev 307142) +++ php/php-src/trunk/ext/sqlite3/sqlite3.c 2011-01-06 00:08:59 UTC (rev 307143) @@ -1582,6 +1582,10 @@ return; } + if (result_obj-complete) { + RETURN_FALSE; + } + RETURN_LONG(sqlite3_column_type(result_obj-stmt_obj-stmt, column)); } /* }}} */ @@ -1631,6 +1635,7 @@ break; case SQLITE_DONE: + result_obj-complete = 1; RETURN_FALSE; break; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/Zend/zend_strtod.c branches/PHP_5_3/NEWS branches/PHP_5_3/Zend/zend_strtod.c trunk/Zend/zend_strtod.c
scottmac Tue, 04 Jan 2011 22:36:23 + Revision: http://svn.php.net/viewvc?view=revisionrevision=307095 Log: Fix bug #53632 with x87 fpu Bug: http://bugs.php.net/53632 (Assigned) PHP hangs on numeric value 2.2250738585072011e-308 Changed paths: U php/php-src/branches/PHP_5_2/Zend/zend_strtod.c U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/Zend/zend_strtod.c U php/php-src/trunk/Zend/zend_strtod.c Modified: php/php-src/branches/PHP_5_2/Zend/zend_strtod.c === --- php/php-src/branches/PHP_5_2/Zend/zend_strtod.c 2011-01-04 22:01:09 UTC (rev 307094) +++ php/php-src/branches/PHP_5_2/Zend/zend_strtod.c 2011-01-04 22:36:23 UTC (rev 307095) @@ -2035,7 +2035,7 @@ int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign, e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign; CONST char *s, *s0, *s1; - double aadj, aadj1, adj; + volatile double aadj, aadj1, adj; volatile _double rv, rv0; Long L; ULong y, z; Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2011-01-04 22:01:09 UTC (rev 307094) +++ php/php-src/branches/PHP_5_3/NEWS 2011-01-04 22:36:23 UTC (rev 307095) @@ -8,6 +8,7 @@ . Indirect reference to $this fails to resolve if direct $this is never used in method. (Scott) . Fixed Bug #53629 (memory leak inside highlight_string()). (Hannes, Ilia) + . Fixed Bug #53632 (infinite loop with x87 fpu). (Scott, Rasmus) - Core: . Fixed bug #48484 (array_product() always returns 0 for an empty array). Modified: php/php-src/branches/PHP_5_3/Zend/zend_strtod.c === --- php/php-src/branches/PHP_5_3/Zend/zend_strtod.c 2011-01-04 22:01:09 UTC (rev 307094) +++ php/php-src/branches/PHP_5_3/Zend/zend_strtod.c 2011-01-04 22:36:23 UTC (rev 307095) @@ -2035,7 +2035,7 @@ int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign, e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign; CONST char *s, *s0, *s1; - double aadj, aadj1, adj; + volatile double aadj, aadj1, adj; volatile _double rv, rv0; Long L; ULong y, z; Modified: php/php-src/trunk/Zend/zend_strtod.c === --- php/php-src/trunk/Zend/zend_strtod.c2011-01-04 22:01:09 UTC (rev 307094) +++ php/php-src/trunk/Zend/zend_strtod.c2011-01-04 22:36:23 UTC (rev 307095) @@ -2035,7 +2035,7 @@ int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign, e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign; CONST char *s, *s0, *s1; - double aadj, aadj1, adj; + volatile double aadj, aadj1, adj; volatile _double rv, rv0; Long L; ULong y, z; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/Zend/tests/bug53632.phpt branches/PHP_5_3/Zend/tests/bug53632.phpt trunk/Zend/tests/bug53632.phpt
scottmac Tue, 04 Jan 2011 23:36:56 + Revision: http://svn.php.net/viewvc?view=revisionrevision=307097 Log: Add test for bug #53632 Bug: http://bugs.php.net/53632 (Assigned) PHP hangs on numeric value 2.2250738585072011e-308 Changed paths: A php/php-src/branches/PHP_5_2/Zend/tests/bug53632.phpt A php/php-src/branches/PHP_5_3/Zend/tests/bug53632.phpt A php/php-src/trunk/Zend/tests/bug53632.phpt Added: php/php-src/branches/PHP_5_2/Zend/tests/bug53632.phpt === --- php/php-src/branches/PHP_5_2/Zend/tests/bug53632.phpt (rev 0) +++ php/php-src/branches/PHP_5_2/Zend/tests/bug53632.phpt 2011-01-04 23:36:56 UTC (rev 307097) @@ -0,0 +1,10 @@ +--TEST-- +zend_strtod() hangs with 2.2250738585072011e-308 +--FILE-- +?php +$d = 2.2250738585072011e-308; + +echo Done\n; +? +--EXPECTF-- +Done Added: php/php-src/branches/PHP_5_3/Zend/tests/bug53632.phpt === --- php/php-src/branches/PHP_5_3/Zend/tests/bug53632.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/Zend/tests/bug53632.phpt 2011-01-04 23:36:56 UTC (rev 307097) @@ -0,0 +1,10 @@ +--TEST-- +zend_strtod() hangs with 2.2250738585072011e-308 +--FILE-- +?php +$d = 2.2250738585072011e-308; + +echo Done\n; +? +--EXPECTF-- +Done Added: php/php-src/trunk/Zend/tests/bug53632.phpt === --- php/php-src/trunk/Zend/tests/bug53632.phpt (rev 0) +++ php/php-src/trunk/Zend/tests/bug53632.phpt 2011-01-04 23:36:56 UTC (rev 307097) @@ -0,0 +1,10 @@ +--TEST-- +zend_strtod() hangs with 2.2250738585072011e-308 +--FILE-- +?php +$d = 2.2250738585072011e-308; + +echo Done\n; +? +--EXPECTF-- +Done -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/sqlite3/sqlite3.c trunk/ext/sqlite3/sqlite3.c
scottmac Mon, 03 Jan 2011 19:15:36 + Revision: http://svn.php.net/viewvc?view=revisionrevision=307037 Log: Fix error with initialisation flag being set too early. If encryption is enabled and fails to decrypt a crash can occur. Also fix a WS error. Changed paths: U php/php-src/branches/PHP_5_3/ext/sqlite3/sqlite3.c U php/php-src/trunk/ext/sqlite3/sqlite3.c Modified: php/php-src/branches/PHP_5_3/ext/sqlite3/sqlite3.c === --- php/php-src/branches/PHP_5_3/ext/sqlite3/sqlite3.c 2011-01-03 18:47:46 UTC (rev 307036) +++ php/php-src/branches/PHP_5_3/ext/sqlite3/sqlite3.c 2011-01-03 19:15:36 UTC (rev 307037) @@ -40,7 +40,7 @@ static PHP_GINIT_FUNCTION(sqlite3); static int php_sqlite3_authorizer(void *autharg, int access_type, const char *arg3, const char *arg4, const char *arg5, const char *arg6); static void sqlite3_param_dtor(void *data); -static int php_sqlite3_compare_stmt_zval_free( php_sqlite3_free_list **free_list, zval *statement ); +static int php_sqlite3_compare_stmt_zval_free(php_sqlite3_free_list **free_list, zval *statement); /* {{{ Error Handler */ @@ -152,8 +152,6 @@ return; } - db_obj-initialised = 1; - #if SQLITE_HAS_CODEC if (encryption_key_len 0) { if (sqlite3_key(db_obj-db, encryption_key, encryption_key_len) != SQLITE_OK) { @@ -163,6 +161,8 @@ } #endif + db_obj-initialised = 1; + #if PHP_API_VERSION 20100412 if (PG(safe_mode) || (PG(open_basedir) *PG(open_basedir))) { #else Modified: php/php-src/trunk/ext/sqlite3/sqlite3.c === --- php/php-src/trunk/ext/sqlite3/sqlite3.c 2011-01-03 18:47:46 UTC (rev 307036) +++ php/php-src/trunk/ext/sqlite3/sqlite3.c 2011-01-03 19:15:36 UTC (rev 307037) @@ -40,7 +40,7 @@ static PHP_GINIT_FUNCTION(sqlite3); static int php_sqlite3_authorizer(void *autharg, int access_type, const char *arg3, const char *arg4, const char *arg5, const char *arg6); static void sqlite3_param_dtor(void *data); -static int php_sqlite3_compare_stmt_zval_free( php_sqlite3_free_list **free_list, zval *statement ); +static int php_sqlite3_compare_stmt_zval_free(php_sqlite3_free_list **free_list, zval *statement); /* {{{ Error Handler */ @@ -149,8 +149,6 @@ return; } - db_obj-initialised = 1; - #if SQLITE_HAS_CODEC if (encryption_key_len 0) { if (sqlite3_key(db_obj-db, encryption_key, encryption_key_len) != SQLITE_OK) { @@ -160,6 +158,8 @@ } #endif + db_obj-initialised = 1; + #if PHP_API_VERSION 20100412 if (PG(safe_mode) || (PG(open_basedir) *PG(open_basedir))) { #else -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/date/lib/timelib_structs.h branches/PHP_5_3/ext/date/lib/unixtime2tm.c trunk/ext/date/lib/timelib_structs.h trunk/ext/date/lib/unixtime2tm.c
scottmac Mon, 03 Jan 2011 19:24:04 + Revision: http://svn.php.net/viewvc?view=revisionrevision=307038 Log: Change DEBUG() to TIMELIB_DEBUG(), there are potential conflicts with other libraries that also use this. Changed paths: U php/php-src/branches/PHP_5_3/ext/date/lib/timelib_structs.h U php/php-src/branches/PHP_5_3/ext/date/lib/unixtime2tm.c U php/php-src/trunk/ext/date/lib/timelib_structs.h U php/php-src/trunk/ext/date/lib/unixtime2tm.c Modified: php/php-src/branches/PHP_5_3/ext/date/lib/timelib_structs.h === --- php/php-src/branches/PHP_5_3/ext/date/lib/timelib_structs.h 2011-01-03 19:15:36 UTC (rev 307037) +++ php/php-src/branches/PHP_5_3/ext/date/lib/timelib_structs.h 2011-01-03 19:24:04 UTC (rev 307038) @@ -218,6 +218,6 @@ #define timelib_is_leap(y) ((y) % 4 == 0 ((y) % 100 != 0 || (y) % 400 == 0)) -#define DEBUG(s) if (0) { s } +#define TIMELIB_DEBUG(s) if (0) { s } #endif Modified: php/php-src/branches/PHP_5_3/ext/date/lib/unixtime2tm.c === --- php/php-src/branches/PHP_5_3/ext/date/lib/unixtime2tm.c 2011-01-03 19:15:36 UTC (rev 307037) +++ php/php-src/branches/PHP_5_3/ext/date/lib/unixtime2tm.c 2011-01-03 19:24:04 UTC (rev 307038) @@ -51,7 +51,7 @@ days++; remainder -= SECS_PER_DAY; } - DEBUG(printf(days=%lld, rem=%lld\n, days, remainder);); + TIMELIB_DEBUG(printf(days=%lld, rem=%lld\n, days, remainder);); if (ts = 0) { tmp_days = days + 1; @@ -78,11 +78,11 @@ while (tmp_days = 0) { if (tmp_days -1460970) { cur_year -= 4000; - DEBUG(printf(tmp_days=%lld, year=%lld\n, tmp_days, cur_year);); + TIMELIB_DEBUG(printf(tmp_days=%lld, year=%lld\n, tmp_days, cur_year);); tmp_days += 1460970; } else { cur_year--; - DEBUG(printf(tmp_days=%lld, year=%lld\n, tmp_days, cur_year);); + TIMELIB_DEBUG(printf(tmp_days=%lld, year=%lld\n, tmp_days, cur_year);); if (timelib_is_leap(cur_year)) { tmp_days += DAYS_PER_LYEAR; } else { @@ -92,7 +92,7 @@ } remainder += SECS_PER_DAY; } - DEBUG(printf(tmp_days=%lld, year=%lld\n, tmp_days, cur_year);); + TIMELIB_DEBUG(printf(tmp_days=%lld, year=%lld\n, tmp_days, cur_year);); months = timelib_is_leap(cur_year) ? month_tab_leap : month_tab; if (timelib_is_leap(cur_year) cur_year 1970) { @@ -100,19 +100,19 @@ } i = 11; while (i 0) { - DEBUG(printf(month=%lld (%d)\n, i, months[i]);); + TIMELIB_DEBUG(printf(month=%lld (%d)\n, i, months[i]);); if (tmp_days months[i]) { break; } i--; } - DEBUG(printf(A: ts=%lld, year=%lld, month=%lld, day=%lld,, ts, cur_year, i + 1, tmp_days - months[i]);); + TIMELIB_DEBUG(printf(A: ts=%lld, year=%lld, month=%lld, day=%lld,, ts, cur_year, i + 1, tmp_days - months[i]);); /* That was the date, now we do the tme */ hours = remainder / 3600; minutes = (remainder - hours * 3600) / 60; seconds = remainder % 60; - DEBUG(printf( hour=%lld, minute=%lld, second=%lld\n, hours, minutes, seconds);); + TIMELIB_DEBUG(printf( hour=%lld, minute=%lld, second=%lld\n, hours, minutes, seconds);); tm-y = cur_year; tm-m = i + 1; @@ -240,18 +240,18 @@ { if (localtime) { /* Converting from GMT time to local time */ - DEBUG(printf(Converting from GMT time to local time\n);); + TIMELIB_DEBUG(printf(Converting from GMT time to local time\n);); /* Check if TZ is set */ if (!t-tz_info) { - DEBUG(printf(E: No timezone configured, can't switch to local time\n);); + TIMELIB_DEBUG(printf(E: No timezone configured, can't switch to local time\n);); return -1; } timelib_unixtime2local(t, t-sse); } else { /* Converting from local time to GMT time */ - DEBUG(printf(Converting from local time to GMT time\n);); + TIMELIB_DEBUG(printf(Converting from local time to GMT time\n);); timelib_unixtime2gmt(t, t-sse); } Modified: php/php-src/trunk/ext/date/lib/timelib_structs.h === ---
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/sqlite3/sqlite3.c branches/PHP_5_3/ext/sqlite3/tests/sqlite3_35_stmt_readonly.phpt trunk/ext/sqlite3/sqlite3.c trunk/ext/sqlite3
scottmac Fri, 31 Dec 2010 16:37:12 + Revision: http://svn.php.net/viewvc?view=revisionrevision=306930 Log: Add SQLite3_Stmt::readOnly for checking if a statement is read only Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/sqlite3/sqlite3.c A php/php-src/branches/PHP_5_3/ext/sqlite3/tests/sqlite3_35_stmt_readonly.phpt U php/php-src/trunk/ext/sqlite3/sqlite3.c A php/php-src/trunk/ext/sqlite3/tests/sqlite3_35_stmt_readonly.phpt Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2010-12-31 15:10:43 UTC (rev 306929) +++ php/php-src/branches/PHP_5_3/NEWS 2010-12-31 16:37:12 UTC (rev 306930) @@ -1,6 +1,6 @@ PHPNEWS ||| -?? ??? 20??, PHP 5.3.5 +?? ??? 2011, PHP 5.3.5 - Upgraded bundled Sqlite3 to version 3.7.4. (Ilia) - Upgraded bundled PCRE to version 8.11. (Ilia) @@ -79,8 +79,9 @@ . Fixed bug #53515 (property_exists incorrect on ArrayObject null and 0 values). (Felipe) -- SQLite extension: +- SQLite3 extension: . Fixed memory leaked introduced by the NULL poisoning patch (Mateusz Kocielski, Pierre) + . Add SQlite3_Stmt::readonly() for checking if a statement is read only. (Scott) - Streams: . Implemented FR #26158 (open arbitrary file descriptor with fopen). (Gustavo) Modified: php/php-src/branches/PHP_5_3/ext/sqlite3/sqlite3.c === --- php/php-src/branches/PHP_5_3/ext/sqlite3/sqlite3.c 2010-12-31 15:10:43 UTC (rev 306929) +++ php/php-src/branches/PHP_5_3/ext/sqlite3/sqlite3.c 2010-12-31 16:37:12 UTC (rev 306930) @@ -1081,10 +1081,9 @@ static int php_sqlite3_stream_stat(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC) { - /* TODO: fill in details based on Data: and Content-Length: headers, and/or data - * from curl_easy_getinfo(). - * For now, return -1 to indicate that it doesn't make sense to stat this stream */ - return -1; + php_stream_sqlite3_data *sqlite3_stream = (php_stream_sqlite3_data *) stream-abstract; + ssb-sb.st_size = sqlite3_stream-size; + return 0; } static php_stream_ops php_stream_sqlite3_ops = { @@ -1234,6 +1233,27 @@ } /* }}} */ +/* {{{ proto bool SQLite3Stmt::readOnly() + Returns true if a statement is definitely read only */ +PHP_METHOD(sqlite3stmt, readOnly) +{ + php_sqlite3_stmt *stmt_obj; + zval *object = getThis(); + stmt_obj = (php_sqlite3_stmt *)zend_object_store_get_object(object TSRMLS_CC); + + if (zend_parse_parameters_none() == FAILURE) { + return; + } + +#if SQLITE_VERSION_NUMBER = 3007004 + if (sqlite3_stmt_readonly(stmt_obj-stmt)) { + RETURN_TRUE; + } +#endif + RETURN_FALSE; +} +/* }}} */ + static int register_bound_parameter_to_sqlite(struct php_sqlite3_bound_param *param, php_sqlite3_stmt *stmt TSRMLS_DC) /* {{{ */ { HashTable *hash; @@ -1804,6 +1824,7 @@ PHP_ME(sqlite3stmt, execute, arginfo_sqlite3_void, ZEND_ACC_PUBLIC) PHP_ME(sqlite3stmt, bindParam, arginfo_sqlite3stmt_bindparam, ZEND_ACC_PUBLIC) PHP_ME(sqlite3stmt, bindValue, arginfo_sqlite3stmt_bindvalue, ZEND_ACC_PUBLIC) + PHP_ME(sqlite3stmt, readOnly, arginfo_sqlite3_void, ZEND_ACC_PUBLIC) PHP_ME(sqlite3stmt, __construct, arginfo_sqlite3stmt_construct, ZEND_ACC_PRIVATE|ZEND_ACC_CTOR) {NULL, NULL, NULL} }; Added: php/php-src/branches/PHP_5_3/ext/sqlite3/tests/sqlite3_35_stmt_readonly.phpt === --- php/php-src/branches/PHP_5_3/ext/sqlite3/tests/sqlite3_35_stmt_readonly.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/sqlite3/tests/sqlite3_35_stmt_readonly.phpt 2010-12-31 16:37:12 UTC (rev 306930) @@ -0,0 +1,53 @@ +--TEST-- +SQLite3_stmt::readOnly check +--SKIPIF-- +?php require_once(dirname(__FILE__) . '/skipif.inc'); +$version = SQLite3::version(); +if ($version['versionNumber'] 3007004) { + die(skip); +} +? +--FILE-- +?php + +require_once(dirname(__FILE__) . '/new_db.inc'); +define('TIMENOW', time()); + +echo Creating Table\n; +var_dump($db-exec('CREATE TABLE test (time INTEGER, id STRING)')); + +echo INSERT into table\n; +var_dump($db-exec(INSERT INTO test (time, id) VALUES ( . TIMENOW . , 'a'))); +var_dump($db-exec(INSERT INTO test (time, id) VALUES ( . TIMENOW . , 'b'))); + +echo Checking select statement\n; +$stmt = $db-prepare(SELECT * FROM test WHERE id = ? ORDER BY id ASC); +var_dump($stmt-readOnly()); + +echo Checking update statement\n; +$stmt = $db-prepare(UPDATE test SET id = 'c' WHERE id = ?); +var_dump($stmt-readOnly()); + +echo Checking delete statement\n; +$stmt = $db-prepare(DELETE FROM test); +var_dump($stmt-readOnly()); + +echo Closing database\n; +var_dump($db-close()); +echo Done\n; +? +--EXPECTF-- +Creating Table +bool(true) +INSERT
[PHP-CVS] svn: /php/php-src/trunk/ NEWS UPGRADING Zend/tests/026.phpt Zend/tests/033.phpt Zend/tests/bug52041.phpt Zend/tests/bug52614.phpt Zend/zend_execute.c ext/dom/tests/bug47430.phpt ext/reflecti
scottmac Fri, 31 Dec 2010 16:57:45 + Revision: http://svn.php.net/viewvc?view=revisionrevision=306931 Log: Silently casting an empty string, null or false into an object by adding a property is pretty non-intuitive. If the same value was 1 or true you get a warning and it halts. Since we can't break BC completely (yet) lets bump this from E_STRICT. Also added a new section to UPGRADING for engine changes. ?php $x = ''; // $x = null; // $x = false; $x-baz = 1; var_dump($x); $y = 1; $y-baz = 1; var_dump($y); Changed paths: U php/php-src/trunk/NEWS U php/php-src/trunk/UPGRADING U php/php-src/trunk/Zend/tests/026.phpt U php/php-src/trunk/Zend/tests/033.phpt U php/php-src/trunk/Zend/tests/bug52041.phpt U php/php-src/trunk/Zend/tests/bug52614.phpt U php/php-src/trunk/Zend/zend_execute.c U php/php-src/trunk/ext/dom/tests/bug47430.phpt U php/php-src/trunk/ext/reflection/tests/bug40431.phpt U php/php-src/trunk/tests/classes/implicit_instantiation_001.phpt Modified: php/php-src/trunk/NEWS === --- php/php-src/trunk/NEWS 2010-12-31 16:37:12 UTC (rev 306930) +++ php/php-src/trunk/NEWS 2010-12-31 16:57:45 UTC (rev 306931) @@ -27,6 +27,8 @@ - Changed array_combine() to return empty array instead of FALSE when both parameter arrays are empty. FR #34857. (joel.per...@gmail.com) - Changed third parameter of preg_match_all() to optional. FR #53238. (Adam) +- Changed silent casting of null/''/false into an Object when adding + a property into a warning. (Scott) - General improvements: . Added multibyte suppport by default. Previosly php had to be compiled Modified: php/php-src/trunk/UPGRADING === --- php/php-src/trunk/UPGRADING 2010-12-31 16:37:12 UTC (rev 306930) +++ php/php-src/trunk/UPGRADING 2010-12-31 16:57:45 UTC (rev 306931) @@ -4,19 +4,19 @@ 1. Changes made to default configuration 2. Reserved words and classes -3. Changes made to existing functions -4. Changes made to existing methods -5. Changes made to existing classes -6. Deprecated -7. Removed -8. Extensions: +3. Changes made to engine behaviour +4. Changes made to existing functions +5. Changes made to existing methods +6. Changes made to existing classes +7. Deprecated +8. Removed +9. Extensions: a. moved out to PECL and actively maintained there b. no longer maintained c. with changed behaviour d. no longer possible to disable -9. Changes in SAPI support -10. Changes in INI directives -11. Syntax additions +10. Changes in SAPI support +11. Changes in INI directives 12. Syntax additions 13. Windows support 14. New in PHP X.Y: @@ -87,8 +87,22 @@ - += +3. Changes made to engine behaviour += + +- Turning null, false or empty string into an object by adding a property + will now emit a warning instead of an E_STRICT error. + + $test = null; + $test-baz = 1; + + To create a generic object you can use StdClass: + $test = new StdClass; + $text-baz = 1; + = -3. Changes made to existing functions +4. Changes made to existing functions = - array_combine now returns array() instead of FALSE when two empty arrays are @@ -150,23 +164,23 @@ === -4. Changes made to existing methods +5. Changes made to existing methods === - === -5. Changes made to existing classes +6. Changes made to existing classes === - = -6. Deprecated +7. Deprecated = == -7. Removed +8. Removed == a. removed features @@ -215,7 +229,7 @@ - continue $var; = -8. Extensions +9. Extensions = a. moved out to PECL and actively maintained there @@ -237,7 +251,7 @@ - == -9. Changes in SAPI support +10. Changes in SAPI support == - The REQUEST_TIME value inside server now returns a floating point number @@ -245,7 +259,7 @@ value should be returning float and not time_t. = -10. Changes in INI directives +11. Changes in INI directives = - Added session.upload_progress.enabled, session.upload_progress.cleanup, @@ -264,7 +278,7 @@ three times. -11. Syntax additions +12. Syntax additions - Array dereferencing. @@ -273,14 +287,14 @@ $foo-bar()[0] === -12. Windows support +13. Windows support === - is_link now works properly for symbolic links on Windows Vista or later. Earlier systems do not support symbolic links. === -13. New in PHP X.Y: +14.
[PHP-CVS] svn: /php/php-src/trunk/ext/curl/ interface.c
scottmac Fri, 10 Dec 2010 01:45:55 + Revision: http://svn.php.net/viewvc?view=revisionrevision=306162 Log: Add more constants to curl_getinfo(), dependent on cURL version installed so wrapped in ifdefs Changed paths: U php/php-src/trunk/ext/curl/interface.c Modified: php/php-src/trunk/ext/curl/interface.c === --- php/php-src/trunk/ext/curl/interface.c 2010-12-10 01:32:16 UTC (rev 306161) +++ php/php-src/trunk/ext/curl/interface.c 2010-12-10 01:45:55 UTC (rev 306162) @@ -2315,12 +2315,33 @@ create_certinfo(ci, listcode TSRMLS_CC); CAAZ(certinfo, listcode); } + if (curl_easy_getinfo(ch-cp, CURLINFO_PRIMARY_IP, s_code) == CURLE_OK) { + CAAS(primary_ip, s_code); + } #endif +#if LIBCURL_VERSION_NUM 0x071500 + if (curl_easy_getinfo(ch-cp, CURLINFO_PRIMARY_PORT, l_code) == CURLE_OK) { + CAAL(primary_port, l_code); + } + if (curl_easy_getinfo(ch-cp, CURLINFO_LOCAL_IP, s_code) == CURLE_OK) { + CAAS(local_ip, s_code); + } + if (curl_easy_getinfo(ch-cp, CURLINFO_LOCAL_PORT, l_code) == CURLE_OK) { + CAAL(local_port, l_code); + } +#endif if (ch-header.str_len 0) { CAAS(request_header, ch-header.str); } } else { switch (option) { + /* string variable types */ +#if LIBCURL_VERSION_NUM = 0x071500 + case CURLINFO_PRIMARY_IP: +#endif +#if LIBCURL_VERSION_NUM = 0x071500 + case CURLINFO_LOCAL_IP: +#endif case CURLINFO_PRIVATE: case CURLINFO_EFFECTIVE_URL: case CURLINFO_CONTENT_TYPE: { @@ -2333,6 +2354,11 @@ } break; } + /* Long variable types */ +#if LIBCURL_VERSION_NUM = 0x071500 + case CURLINFO_PRIMARY_PORT: + case CURLINFO_LOCAL_PORT: +#endif case CURLINFO_HTTP_CODE: case CURLINFO_HEADER_SIZE: case CURLINFO_REQUEST_SIZE: @@ -2348,6 +2374,7 @@ } break; } + /* Double variable types */ case CURLINFO_TOTAL_TIME: case CURLINFO_NAMELOOKUP_TIME: case CURLINFO_CONNECT_TIME: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ NEWS Zend/tests/indirect_reference_this.phpt Zend/zend_compile.c
scottmac Fri, 10 Dec 2010 06:34:03 + Revision: http://svn.php.net/viewvc?view=revisionrevision=306169 Log: MFH: Fix indirect reference of $this Changed paths: U php/php-src/branches/PHP_5_3/NEWS A php/php-src/branches/PHP_5_3/Zend/tests/indirect_reference_this.phpt U php/php-src/branches/PHP_5_3/Zend/zend_compile.c Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2010-12-10 05:16:47 UTC (rev 306168) +++ php/php-src/branches/PHP_5_3/NEWS 2010-12-10 06:34:03 UTC (rev 306169) @@ -8,6 +8,9 @@ - PDO Oracle driver: . Fixed bug #39199 (Cannot load Lob data with more than 4000 bytes on ORACLE 10). (spatar at mail dot nnov dot ru) + +- Indirect reference to $this fails to resolve if direct $this is never used + in method. (Scott) 09 Dec 2010, PHP 5.3.4 - Upgraded bundled Sqlite3 to version 3.7.3. (Ilia) Added: php/php-src/branches/PHP_5_3/Zend/tests/indirect_reference_this.phpt === --- php/php-src/branches/PHP_5_3/Zend/tests/indirect_reference_this.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/Zend/tests/indirect_reference_this.phpt 2010-12-10 06:34:03 UTC (rev 306169) @@ -0,0 +1,13 @@ +--TEST-- +Indirect referenced $this +--FILE-- +?php +class X { + function f($x){var_dump($$x);} +} +$x = new X; +$x-f(this); +? +--EXPECTF-- +object(X)#%d (0) { +} \ No newline at end of file Modified: php/php-src/branches/PHP_5_3/Zend/zend_compile.c === --- php/php-src/branches/PHP_5_3/Zend/zend_compile.c2010-12-10 05:16:47 UTC (rev 306168) +++ php/php-src/branches/PHP_5_3/Zend/zend_compile.c2010-12-10 06:34:03 UTC (rev 306169) @@ -4351,6 +4351,10 @@ } zend_do_begin_variable_parse(TSRMLS_C); fetch_simple_variable(result, variable, 1 TSRMLS_CC); + /* there is a chance someone is accessing $this */ + if (CG(active_op_array)-scope CG(active_op_array)-this_var == -1) { + CG(active_op_array)-this_var = lookup_cv(CG(active_op_array), estrndup(this, sizeof(this)-1), sizeof(this)-1 TSRMLS_CC); + } } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/Zend/ zend_operators.c
scottmac Sun, 22 Aug 2010 08:01:34 + Revision: http://svn.php.net/viewvc?view=revisionrevision=302629 Log: Fix a bug where two doubles are equal but the maths operation makes it appear false. Best example with INF where equals and identical produce different results. ?php var_dump(INF==INF); var_dump(INF===INF); Changed paths: U php/php-src/trunk/Zend/zend_operators.c Modified: php/php-src/trunk/Zend/zend_operators.c === --- php/php-src/trunk/Zend/zend_operators.c 2010-08-22 00:59:41 UTC (rev 302628) +++ php/php-src/trunk/Zend/zend_operators.c 2010-08-22 08:01:34 UTC (rev 302629) @@ -1410,8 +1410,12 @@ return SUCCESS; case TYPE_PAIR(IS_DOUBLE, IS_DOUBLE): - Z_DVAL_P(result) = Z_DVAL_P(op1) - Z_DVAL_P(op2); - ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_DVAL_P(result))); + if (Z_DVAL_P(op1) == Z_DVAL_P(op2)) { + ZVAL_LONG(result, 0); + } else { + Z_DVAL_P(result) = Z_DVAL_P(op1) - Z_DVAL_P(op2); + ZVAL_LONG(result, ZEND_NORMALIZE_BOOL(Z_DVAL_P(result))); + } return SUCCESS; case TYPE_PAIR(IS_ARRAY, IS_ARRAY): -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/ext/standard/ php_var.h tests/general_functions/var_export_error2.phpt tests/general_functions/var_export_error3.phpt var.c
scottmac Fri, 09 Jul 2010 21:11:37 + Revision: http://svn.php.net/viewvc?view=revisionrevision=301143 Log: Fix a bug when var_export() causes a fatal error that could inadvertently display data due to flushing of the output buffer. Examples include, memory limit, execution time and recursion. Changed paths: U php/php-src/trunk/ext/standard/php_var.h U php/php-src/trunk/ext/standard/tests/general_functions/var_export_error2.phpt U php/php-src/trunk/ext/standard/tests/general_functions/var_export_error3.phpt U php/php-src/trunk/ext/standard/var.c Modified: php/php-src/trunk/ext/standard/php_var.h === --- php/php-src/trunk/ext/standard/php_var.h 2010-07-09 19:54:58 UTC (rev 301142) +++ php/php-src/trunk/ext/standard/php_var.h 2010-07-09 21:11:37 UTC (rev 301143) @@ -34,6 +34,8 @@ PHPAPI void php_var_dump(zval **struc, int level TSRMLS_DC); PHPAPI void php_var_export(zval **struc, int level TSRMLS_DC); +PHPAPI void php_var_export_ex(zval **struc, int level, smart_str *buf TSRMLS_DC); + PHPAPI void php_debug_zval_dump(zval **struc, int level TSRMLS_DC); typedef HashTable* php_serialize_data_t; Modified: php/php-src/trunk/ext/standard/tests/general_functions/var_export_error2.phpt === --- php/php-src/trunk/ext/standard/tests/general_functions/var_export_error2.phpt 2010-07-09 19:54:58 UTC (rev 301142) +++ php/php-src/trunk/ext/standard/tests/general_functions/var_export_error2.phpt 2010-07-09 21:11:37 UTC (rev 301143) @@ -14,12 +14,5 @@ ? ===DONE=== --EXPECTF-- -stdClass::__set_state(array( - 'p' = - stdClass::__set_state(array( - 'p' = -stdClass::__set_state(array( - 'p' = - stdClass::__set_state(array( Fatal error: Nesting level too deep - recursive dependency? in %s on line 9 \ No newline at end of file Modified: php/php-src/trunk/ext/standard/tests/general_functions/var_export_error3.phpt === --- php/php-src/trunk/ext/standard/tests/general_functions/var_export_error3.phpt 2010-07-09 19:54:58 UTC (rev 301142) +++ php/php-src/trunk/ext/standard/tests/general_functions/var_export_error3.phpt 2010-07-09 21:11:37 UTC (rev 301143) @@ -14,14 +14,5 @@ ? ===DONE=== --EXPECTF-- -array ( - 0 = - array ( -0 = -array ( - 0 = - array ( -0 = -array ( Fatal error: Nesting level too deep - recursive dependency? in %s on line 9 \ No newline at end of file Modified: php/php-src/trunk/ext/standard/var.c === --- php/php-src/trunk/ext/standard/var.c 2010-07-09 19:54:58 UTC (rev 301142) +++ php/php-src/trunk/ext/standard/var.c 2010-07-09 21:11:37 UTC (rev 301143) @@ -334,27 +334,48 @@ } /* }}} */ +#define buffer_append_spaces(buf, num_spaces) \ + do { \ + char *tmp_spaces; \ + int tmp_spaces_len; \ + tmp_spaces_len = spprintf(tmp_spaces, 0,%*c, num_spaces, ' '); \ + smart_str_appendl(buf, tmp_spaces, tmp_spaces_len); \ + efree(tmp_spaces); \ + } while(0); + static int php_array_element_export(zval **zv TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ { int level; + smart_str *buf; level = va_arg(args, int); + buf = va_arg(args, smart_str *); if (hash_key-nKeyLength == 0) { /* numeric key */ - php_printf(%*c%ld = , level + 1, ' ', hash_key-h); + buffer_append_spaces(buf, level+1); + smart_str_append_long(buf, hash_key-h); + smart_str_appendl(buf, = , 4); + } else { /* string key */ char *key, *tmp_str; int key_len, tmp_len; key = php_addcslashes(hash_key-arKey, hash_key-nKeyLength - 1, key_len, 0, '\\, 2 TSRMLS_CC); tmp_str = php_str_to_str_ex(key, key_len, \0, 1, ' . \\\0\ . ', 12, tmp_len, 0, NULL); - php_printf(%*c', level + 1, ' '); - PHPWRITE(tmp_str, tmp_len); - php_printf(' = ); + + buffer_append_spaces(buf, level + 1); + + smart_str_appendc(buf, '\''); + smart_str_appendl(buf, tmp_str, tmp_len); + smart_str_appendl(buf, ' = , 5); + efree(key); efree(tmp_str); } - php_var_export(zv, level + 2 TSRMLS_CC); - PUTS (,\n); + php_var_export_ex(zv, level + 2, buf TSRMLS_CC); + + smart_str_appendc(buf, ','); + smart_str_appendc(buf, '\n'); + return 0; } /* }}} */ @@ -362,24 +383,31 @@ static int php_object_element_export(zval **zv TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ { int level; + smart_str *buf; char *prop_name, *class_name; level = va_arg(args, int); + buf = va_arg(args, smart_str *); - php_printf(%*c, level + 1, ' '); + buffer_append_spaces(buf, level + 2); if (hash_key-nKeyLength != 0) { zend_unmangle_property_name(hash_key-arKey, hash_key-nKeyLength - 1, class_name, prop_name); - php_printf( '%s' = , prop_name); + + smart_str_appendc(buf, '\''); + smart_str_appends(buf, prop_name); +
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ NEWS ext/standard/php_var.h ext/standard/tests/general_functions/var_export_error2.phpt ext/standard/tests/general_functions/var_export_error3.phpt ext/st
scottmac Fri, 09 Jul 2010 21:19:27 + Revision: http://svn.php.net/viewvc?view=revisionrevision=301144 Log: Doing this as a seperate commit unless we need to back it out. Fix a bug when var_export() causes a fatal error that could inadvertently display data due to flushing of the output buffer. Examples include, memory limit, execution time and recursion. Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/standard/php_var.h U php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/var_export_error2.phpt U php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/var_export_error3.phpt U php/php-src/branches/PHP_5_3/ext/standard/var.c Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2010-07-09 21:11:37 UTC (rev 301143) +++ php/php-src/branches/PHP_5_3/NEWS 2010-07-09 21:19:27 UTC (rev 301144) @@ -1,6 +1,9 @@ PHPNEWS ||| ?? Jul 2010, PHP 5.3.3 RC3 +- Rewrote var_export() to use smart_str rather than output buffering, prevents + data disclosure if a fatal error occurs. (Scott) + - Fixed bug #52262 (json_decode() shows no errors on invalid UTF-8). (Scott) - Fixed bug #52240 (hash_copy() does not copy the HMAC key, causes wrong Modified: php/php-src/branches/PHP_5_3/ext/standard/php_var.h === --- php/php-src/branches/PHP_5_3/ext/standard/php_var.h 2010-07-09 21:11:37 UTC (rev 301143) +++ php/php-src/branches/PHP_5_3/ext/standard/php_var.h 2010-07-09 21:19:27 UTC (rev 301144) @@ -33,6 +33,8 @@ PHPAPI void php_var_dump(zval **struc, int level TSRMLS_DC); PHPAPI void php_var_export(zval **struc, int level TSRMLS_DC); +PHPAPI void php_var_export_ex(zval **struc, int level, smart_str *buf TSRMLS_DC); + PHPAPI void php_debug_zval_dump(zval **struc, int level TSRMLS_DC); /* typdef HashTable php_serialize_data_t; */ Modified: php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/var_export_error2.phpt === --- php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/var_export_error2.phpt 2010-07-09 21:11:37 UTC (rev 301143) +++ php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/var_export_error2.phpt 2010-07-09 21:19:27 UTC (rev 301144) @@ -14,12 +14,5 @@ ? ===DONE=== --EXPECTF-- -stdClass::__set_state(array( - 'p' = - stdClass::__set_state(array( - 'p' = -stdClass::__set_state(array( - 'p' = - stdClass::__set_state(array( Fatal error: Nesting level too deep - recursive dependency? in %s on line 9 \ No newline at end of file Modified: php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/var_export_error3.phpt === --- php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/var_export_error3.phpt 2010-07-09 21:11:37 UTC (rev 301143) +++ php/php-src/branches/PHP_5_3/ext/standard/tests/general_functions/var_export_error3.phpt 2010-07-09 21:19:27 UTC (rev 301144) @@ -14,14 +14,5 @@ ? ===DONE=== --EXPECTF-- -array ( - 0 = - array ( -0 = -array ( - 0 = - array ( -0 = -array ( Fatal error: Nesting level too deep - recursive dependency? in %s on line 9 \ No newline at end of file Modified: php/php-src/branches/PHP_5_3/ext/standard/var.c === --- php/php-src/branches/PHP_5_3/ext/standard/var.c 2010-07-09 21:11:37 UTC (rev 301143) +++ php/php-src/branches/PHP_5_3/ext/standard/var.c 2010-07-09 21:19:27 UTC (rev 301144) @@ -334,27 +334,47 @@ } /* }}} */ +#define buffer_append_spaces(buf, num_spaces) \ + do { \ + char *tmp_spaces; \ + int tmp_spaces_len; \ + tmp_spaces_len = spprintf(tmp_spaces, 0,%*c, num_spaces, ' '); \ + smart_str_appendl(buf, tmp_spaces, tmp_spaces_len); \ + efree(tmp_spaces); \ + } while(0); + static int php_array_element_export(zval **zv TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) /* {{{ */ { int level; + smart_str *buf; level = va_arg(args, int); + buf = va_arg(args, smart_str *); if (hash_key-nKeyLength == 0) { /* numeric key */ - php_printf(%*c%ld = , level + 1, ' ', hash_key-h); + buffer_append_spaces(buf, level+1); + smart_str_append_long(buf, hash_key-h); + smart_str_appendl(buf, = , 4); } else { /* string key */ char *key, *tmp_str; int key_len, tmp_len; key = php_addcslashes(hash_key-arKey, hash_key-nKeyLength - 1, key_len, 0, '\\, 2 TSRMLS_CC); tmp_str = php_str_to_str_ex(key, key_len, \0, 1, ' . \\\0\ . ', 12, tmp_len, 0, NULL); - php_printf(%*c', level + 1, ' '); -
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/json/json.c trunk/ext/json/json.c
scottmac Tue, 06 Jul 2010 17:01:30 + Revision: http://svn.php.net/viewvc?view=revisionrevision=301028 Log: Fix bug #52262 - Invalid UTF-8 documents don't set an error code when they fail to decode. Bug: http://bugs.php.net/52262 (Assigned) json_decode reports no error while returning NULL Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/json/json.c U php/php-src/trunk/ext/json/json.c Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2010-07-06 16:09:43 UTC (rev 301027) +++ php/php-src/branches/PHP_5_3/NEWS 2010-07-06 17:01:30 UTC (rev 301028) @@ -1,6 +1,8 @@ PHPNEWS ||| ?? Jul 2010, PHP 5.3.3 RC3 +- Fixed bug #52262 (json_decode() shows no errors on invalid UTF-8). + (Scott) - Fixed bug #52240 (hash_copy() does not copy the HMAC key, causes wrong results and PHP crashes). (Felipe) - Fixed bug #52238 (Crash when an Exception occured in iterator_to_array). Modified: php/php-src/branches/PHP_5_3/ext/json/json.c === --- php/php-src/branches/PHP_5_3/ext/json/json.c2010-07-06 16:09:43 UTC (rev 301027) +++ php/php-src/branches/PHP_5_3/ext/json/json.c2010-07-06 17:01:30 UTC (rev 301028) @@ -500,6 +500,7 @@ if (utf16) { efree(utf16); } + JSON_G(error_code) = PHP_JSON_ERROR_UTF8; RETURN_NULL(); } Modified: php/php-src/trunk/ext/json/json.c === --- php/php-src/trunk/ext/json/json.c 2010-07-06 16:09:43 UTC (rev 301027) +++ php/php-src/trunk/ext/json/json.c 2010-07-06 17:01:30 UTC (rev 301028) @@ -560,6 +560,7 @@ if (utf16) { efree(utf16); } + JSON_G(error_code) = PHP_JSON_ERROR_UTF8; RETURN_NULL(); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/ configure.in
scottmac Tue, 16 Feb 2010 09:35:31 + Revision: http://svn.php.net/viewvc?view=revisionrevision=295149 Log: Building libmbfl seperately fails since the shared library version is an API reference rather than a version number Changed paths: U php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/configure.in Modified: php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/configure.in === --- php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/configure.in 2010-02-16 09:25:10 UTC (rev 295148) +++ php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/configure.in 2010-02-16 09:35:31 UTC (rev 295149) @@ -4,7 +4,9 @@ AC_CONFIG_SRCDIR(mbfl/mbfilter.c) AM_CONFIG_HEADER(config.h) -SHLIB_VERSION=1:0:2 +# SHLIB isn't a version number but the API reference +# Read http://www.gnu.org/software/libtool/manual/libtool.html#Updating-version-info +SHLIB_VERSION=1:1:0 AC_SUBST(SHLIB_VERSION) # Checks for programs. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/ Makefile.am
scottmac Tue, 16 Feb 2010 09:46:06 + Revision: http://svn.php.net/viewvc?view=revisionrevision=295150 Log: mbstring filter files were referenced but never actually compiled Changed paths: U php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/Makefile.am Modified: php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/Makefile.am === --- php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/Makefile.am 2010-02-16 09:35:31 UTC (rev 295149) +++ php/php-src/branches/PHP_5_3/ext/mbstring/libmbfl/filters/Makefile.am 2010-02-16 09:46:06 UTC (rev 295150) @@ -47,6 +47,7 @@ mbfilter_euc_cn.c \ mbfilter_euc_kr.c \ mbfilter_uhc.c \ + mbfilter_iso2022_jp_ms.c \ mbfilter_iso2022_kr.c \ mbfilter_cp866.c \ mbfilter_koi8r.c \ @@ -75,6 +76,7 @@ mbfilter_euc_tw.h \ mbfilter_htmlent.h \ mbfilter_hz.h \ + mbfilter_iso2022_jp_ms.h \ mbfilter_iso2022_kr.h \ mbfilter_iso8859_1.h \ mbfilter_iso8859_10.h \ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/standard/string.c trunk/ext/standard/string.c
scottmac Fri, 06 Nov 2009 09:02:52 + Revision: http://svn.php.net/viewvc?view=revisionrevision=290368 Log: Fix a typo Changed paths: U php/php-src/branches/PHP_5_3/ext/standard/string.c U php/php-src/trunk/ext/standard/string.c Modified: php/php-src/branches/PHP_5_3/ext/standard/string.c === --- php/php-src/branches/PHP_5_3/ext/standard/string.c 2009-11-06 06:57:07 UTC (rev 290367) +++ php/php-src/branches/PHP_5_3/ext/standard/string.c 2009-11-06 09:02:52 UTC (rev 290368) @@ -3918,7 +3918,7 @@ tmp = str; end = str + str_len; - /* it is really faster to scan twice and allocate mem once insted scanning once + /* it is really faster to scan twice and allocate mem once instead of scanning once and constantly reallocing */ while (tmp end) { if (*tmp == '\r') { Modified: php/php-src/trunk/ext/standard/string.c === --- php/php-src/trunk/ext/standard/string.c 2009-11-06 06:57:07 UTC (rev 290367) +++ php/php-src/trunk/ext/standard/string.c 2009-11-06 09:02:52 UTC (rev 290368) @@ -5830,7 +5830,7 @@ p = str; - /* it is really faster to scan twice and allocate mem once insted scanning once + /* it is really faster to scan twice and allocate mem once instead of scanning once and constantly reallocing */ if (str_type == IS_UNICODE) { end.u = p.u + str_len; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/pcre/pcrelib/ChangeLog branches/PHP_5_3/ext/pcre/pcrelib/HACKING branches/PHP_5_3/ext/pcre/pcrelib/LICENCE branches/PHP_5_3/ext/pcre/pcrelib/NEWS bran
scottmac Tue, 03 Nov 2009 12:15:03 + Revision: http://svn.php.net/viewvc?view=revisionrevision=290167 Log: Update PCRE to 8.00 Changed paths: U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/ChangeLog U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/HACKING U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/LICENCE U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/NEWS U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/NON-UNIX-USE U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/README U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/config.h U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/doc/pcre.txt U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/pcre.h U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/pcre_compile.c U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/pcre_exec.c U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/pcre_fullinfo.c U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/pcre_internal.h U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/pcre_printint.src U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/pcre_study.c U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/pcre_try_flipped.c U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/pcre_ucd.c U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/pcredemo.c U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/pcreposix.c U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/pcreposix.h U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/testdata/grepoutput U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/testdata/testinput1 U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/testdata/testinput10 U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/testdata/testinput2 U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/testdata/testinput3 U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/testdata/testinput4 U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/testdata/testinput5 U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/testdata/testinput6 U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/testdata/testinput7 U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/testdata/testinput8 U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/testdata/testinput9 U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/testdata/testoutput1 U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/testdata/testoutput10 U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/testdata/testoutput2 U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/testdata/testoutput3 U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/testdata/testoutput4 U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/testdata/testoutput5 U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/testdata/testoutput6 U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/testdata/testoutput7 U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/testdata/testoutput8 U php/php-src/branches/PHP_5_3/ext/pcre/pcrelib/testdata/testoutput9 U php/php-src/branches/PHP_5_3/ext/pcre/upgrade-pcre.php U php/php-src/trunk/ext/pcre/pcrelib/ChangeLog U php/php-src/trunk/ext/pcre/pcrelib/HACKING U php/php-src/trunk/ext/pcre/pcrelib/LICENCE U php/php-src/trunk/ext/pcre/pcrelib/NEWS U php/php-src/trunk/ext/pcre/pcrelib/NON-UNIX-USE U php/php-src/trunk/ext/pcre/pcrelib/README U php/php-src/trunk/ext/pcre/pcrelib/config.h U php/php-src/trunk/ext/pcre/pcrelib/doc/pcre.txt U php/php-src/trunk/ext/pcre/pcrelib/pcre.h U php/php-src/trunk/ext/pcre/pcrelib/pcre_compile.c U php/php-src/trunk/ext/pcre/pcrelib/pcre_exec.c U php/php-src/trunk/ext/pcre/pcrelib/pcre_fullinfo.c U php/php-src/trunk/ext/pcre/pcrelib/pcre_internal.h U php/php-src/trunk/ext/pcre/pcrelib/pcre_printint.src U php/php-src/trunk/ext/pcre/pcrelib/pcre_study.c U php/php-src/trunk/ext/pcre/pcrelib/pcre_try_flipped.c U php/php-src/trunk/ext/pcre/pcrelib/pcre_ucd.c U php/php-src/trunk/ext/pcre/pcrelib/pcredemo.c U php/php-src/trunk/ext/pcre/pcrelib/pcreposix.c U php/php-src/trunk/ext/pcre/pcrelib/pcreposix.h U php/php-src/trunk/ext/pcre/pcrelib/testdata/grepoutput U php/php-src/trunk/ext/pcre/pcrelib/testdata/testinput1 U php/php-src/trunk/ext/pcre/pcrelib/testdata/testinput10 U php/php-src/trunk/ext/pcre/pcrelib/testdata/testinput2 U php/php-src/trunk/ext/pcre/pcrelib/testdata/testinput3 U php/php-src/trunk/ext/pcre/pcrelib/testdata/testinput4 U php/php-src/trunk/ext/pcre/pcrelib/testdata/testinput5 U php/php-src/trunk/ext/pcre/pcrelib/testdata/testinput6 U php/php-src/trunk/ext/pcre/pcrelib/testdata/testinput7 U php/php-src/trunk/ext/pcre/pcrelib/testdata/testinput8 U php/php-src/trunk/ext/pcre/pcrelib/testdata/testinput9 U php/php-src/trunk/ext/pcre/pcrelib/testdata/testoutput1 U
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ NEWS
scottmac Tue, 03 Nov 2009 12:23:54 + Revision: http://svn.php.net/viewvc?view=revisionrevision=290168 Log: BFN Changed paths: U php/php-src/branches/PHP_5_3/NEWS Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2009-11-03 12:15:03 UTC (rev 290167) +++ php/php-src/branches/PHP_5_3/NEWS 2009-11-03 12:23:54 UTC (rev 290168) @@ -1,6 +1,8 @@ PHPNEWS ||| ?? ??? 20??, PHP 5.3.2 +- Upgraded bundled PCRE to version 8.00. (Scott) + - Added max_file_uploads INI directive, which can be set to limit the number of file uploads per-request to 100 by default, to prevent possible DOS via temporary file exhaustion. (Ilia) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_2/ NEWS configure.in ext/standard/config.m4 ext/standard/dns.c
scottmac Fri, 16 Oct 2009 16:09:49 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289700 Log: Fix bug #49332 - Unable to compile with Snow Leopard due to some DNS funsies Bug: http://bugs.php.net/49332 (Assigned) Make fails with Undefined symbols: _res_9_dn_expand, _res_9_search and _res_9 Changed paths: U php/php-src/branches/PHP_5_2/NEWS U php/php-src/branches/PHP_5_2/configure.in U php/php-src/branches/PHP_5_2/ext/standard/config.m4 U php/php-src/branches/PHP_5_2/ext/standard/dns.c Modified: php/php-src/branches/PHP_5_2/NEWS === --- php/php-src/branches/PHP_5_2/NEWS 2009-10-16 16:05:44 UTC (rev 289699) +++ php/php-src/branches/PHP_5_2/NEWS 2009-10-16 16:09:49 UTC (rev 289700) @@ -38,6 +38,7 @@ of a multibyte character). (Moriyoshi) - Fixed bug #49528 (UTF-16 strings prefixed by BOMs wrongly converted). (Moriyoshi) +- Fixed bug #49332 (Build error with Snow Leopard). (Scott) - Fixed bug #48805 (IPv6 socket transport is not working). (Ilia) - Fixed bug #48764 (PDO_pgsql::query() always uses implicit prepared statements if v3 proto available). (Matteo, Mark Kirkwood) Modified: php/php-src/branches/PHP_5_2/configure.in === --- php/php-src/branches/PHP_5_2/configure.in 2009-10-16 16:05:44 UTC (rev 289699) +++ php/php-src/branches/PHP_5_2/configure.in 2009-10-16 16:09:49 UTC (rev 289700) @@ -211,7 +211,14 @@ CPPFLAGS=$CPPFLAGS -no-cpp-precomp fi fi -AC_DEFINE(BIND_8_COMPAT, 1, [Enabling BIND8 compatibility for Panther]) + +macosx_major=`sw_vers -productVersion | cut -d . -f 1` +macosx_minor=`sw_vers -productVersion | cut -d . -f 2` + +if test $macosx_major -ge 10 test $macosx_minor -lt 6 ; then + AC_DEFINE(BIND_8_COMPAT, 1, [Enabling BIND8 compatibility for Panther]) +fi + php_multiple_shlib_versions_ok=yes ;; *beos*) @@ -388,6 +395,7 @@ netinet/in.h \ alloca.h \ arpa/inet.h \ +arpa/nameser_compat.h \ arpa/nameser.h \ assert.h \ crypt.h \ Modified: php/php-src/branches/PHP_5_2/ext/standard/config.m4 === --- php/php-src/branches/PHP_5_2/ext/standard/config.m4 2009-10-16 16:05:44 UTC (rev 289699) +++ php/php-src/branches/PHP_5_2/ext/standard/config.m4 2009-10-16 16:09:49 UTC (rev 289700) @@ -315,6 +315,18 @@ PHP_CHECK_FUNC(res_nsend, resolv, bind, socket) PHP_CHECK_FUNC(dn_expand, resolv, bind, socket) +dnl OSX has the dns functions in libc but remaps them in resolv.h for bind so linking fails +case $host_alias in + *darwin*) +macosx_major=`sw_vers -productVersion | cut -d . -f 1` +macosx_minor=`sw_vers -productVersion | cut -d . -f 2` + +if test $macosx_major -ge 10 test $macosx_minor -ge 6 ; then + LIBS=$LIBS -lresolv +fi + ;; +esac + dnl dnl Check if atof() accepts NAN dnl Modified: php/php-src/branches/PHP_5_2/ext/standard/dns.c === --- php/php-src/branches/PHP_5_2/ext/standard/dns.c 2009-10-16 16:05:44 UTC (rev 289699) +++ php/php-src/branches/PHP_5_2/ext/standard/dns.c 2009-10-16 16:09:49 UTC (rev 289700) @@ -55,6 +55,9 @@ #undef STATUS #undef T_UNSPEC #endif +#if HAVE_ARPA_NAMESER_COMPAT_H +#include arpa/nameser_compat.h +#endif #if HAVE_ARPA_NAMESER_H #include arpa/nameser.h #endif -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/sqlite3/libsqlite/sqlite3.c branches/PHP_5_3/ext/sqlite3/libsqlite/sqlite3.h trunk/ext/sqlite3/libsqlite/sqlite3.c trunk/ext/sql
scottmac Fri, 16 Oct 2009 01:56:36 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289690 Log: Update libsqlite to 3.6.19 Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/sqlite3/libsqlite/sqlite3.c U php/php-src/branches/PHP_5_3/ext/sqlite3/libsqlite/sqlite3.h U php/php-src/trunk/ext/sqlite3/libsqlite/sqlite3.c U php/php-src/trunk/ext/sqlite3/libsqlite/sqlite3.h diffs exceeded maximum size -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/standard/dns.c branches/PHP_5_3/ext/standard/php_dns.h trunk/ext/standard/dns.c trunk/ext/standard/php_dns.h
scottmac Fri, 16 Oct 2009 02:10:52 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289691 Log: Part fix for bug #49224 Bug: http://bugs.php.net/49224 (Assigned) Segmentation fault Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/standard/dns.c U php/php-src/branches/PHP_5_3/ext/standard/php_dns.h U php/php-src/trunk/ext/standard/dns.c U php/php-src/trunk/ext/standard/php_dns.h Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2009-10-16 01:56:36 UTC (rev 289690) +++ php/php-src/branches/PHP_5_3/NEWS 2009-10-16 02:10:52 UTC (rev 289691) @@ -40,6 +40,8 @@ cannot be set). (Felipe) - Fixed bug #49517 (cURL's CURLOPT_FILE prevents file from being deleted after fclose). (Ilia) +- Fixed bug #49224 (Compile error due to old DNS functions on AIX systems). + (Scott) - Fixed bug #48805 (IPv6 socket transport is not working). (Ilia) - Fixed PECL bug #16842 (oci_error return false when NO_DATA_FOUND is raised). (Chris Jones) Modified: php/php-src/branches/PHP_5_3/ext/standard/dns.c === --- php/php-src/branches/PHP_5_3/ext/standard/dns.c 2009-10-16 01:56:36 UTC (rev 289690) +++ php/php-src/branches/PHP_5_3/ext/standard/dns.c 2009-10-16 02:10:52 UTC (rev 289691) @@ -810,14 +810,8 @@ n = php_dns_search(handle, hostname, C_IN, type_to_fetch, answer.qb2, sizeof answer); if (n 0) { - if (php_dns_errno(handle) == NO_DATA) { - php_dns_free_handle(handle); - continue; - } - php_dns_free_handle(handle); - zval_dtor(return_value); - RETURN_FALSE; + continue; } cp = answer.qb2 + HFIXEDSZ; Modified: php/php-src/branches/PHP_5_3/ext/standard/php_dns.h === --- php/php-src/branches/PHP_5_3/ext/standard/php_dns.h 2009-10-16 01:56:36 UTC (rev 289690) +++ php/php-src/branches/PHP_5_3/ext/standard/php_dns.h 2009-10-16 02:10:52 UTC (rev 289691) @@ -28,8 +28,6 @@ ((int)dns_search(res, dname, class, type, answer, anslen, (struct sockaddr *)from, fromsize)) #define php_dns_free_handle(res) \ dns_free(res) -#define php_dns_errno(_res) \ - (NO_DATA) #elif defined(HAVE_RES_NSEARCH) #define php_dns_search(res, dname, class, type, answer, anslen) \ @@ -37,15 +35,11 @@ #define php_dns_free_handle(res) \ res_nclose(res); \ php_dns_free_res(*res) -#define php_dns_errno(res) \ - (res-res_h_errno) #elif defined(HAVE_RES_SEARCH) #define php_dns_search(res, dname, class, type, answer, anslen) \ res_search(dname, class, type, answer, anslen) #define php_dns_free_handle(res) /* noop */ -#define php_dns_errno(res) \ - (_res.res_h_errno) #endif Modified: php/php-src/trunk/ext/standard/dns.c === --- php/php-src/trunk/ext/standard/dns.c2009-10-16 01:56:36 UTC (rev 289690) +++ php/php-src/trunk/ext/standard/dns.c2009-10-16 02:10:52 UTC (rev 289691) @@ -810,14 +810,8 @@ n = php_dns_search(handle, hostname, C_IN, type_to_fetch, answer.qb2, sizeof answer); if (n 0) { - if (php_dns_errno(handle) == NO_DATA) { - php_dns_free_handle(handle); - continue; - } - php_dns_free_handle(handle); - zval_dtor(return_value); - RETURN_FALSE; + continue; } cp = answer.qb2 + HFIXEDSZ; Modified: php/php-src/trunk/ext/standard/php_dns.h === --- php/php-src/trunk/ext/standard/php_dns.h2009-10-16 01:56:36 UTC (rev 289690) +++ php/php-src/trunk/ext/standard/php_dns.h2009-10-16 02:10:52 UTC (rev 289691) @@ -28,8 +28,6 @@ ((int)dns_search(res, dname, class, type, answer, anslen, (struct sockaddr *)from, fromsize)) #define php_dns_free_handle(res) \ dns_free(res) -#define php_dns_errno(_res) \ - (NO_DATA) #elif defined(HAVE_RES_NSEARCH) #define php_dns_search(res, dname, class, type, answer, anslen) \ @@ -38,15
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/pdo_sqlite/config.w32 branches/PHP_5_3/ext/sqlite3/config.w32 trunk/ext/pdo_sqlite/config.w32 trunk/ext/sqlite3/config.w32
scottmac Fri, 16 Oct 2009 02:22:48 + Revision: http://svn.php.net/viewvc?view=revisionrevision=289692 Log: Add metadata support to the bundled version of libsqlite on Windows, part of bug #49206. Will commit the new feature part separately. Bug: http://bugs.php.net/49206 (Assigned) PDO SQLite support for ATTR_FETCH_TABLE_NAMES and getColumnMeta fix Changed paths: U php/php-src/branches/PHP_5_3/ext/pdo_sqlite/config.w32 U php/php-src/branches/PHP_5_3/ext/sqlite3/config.w32 U php/php-src/trunk/ext/pdo_sqlite/config.w32 U php/php-src/trunk/ext/sqlite3/config.w32 Modified: php/php-src/branches/PHP_5_3/ext/pdo_sqlite/config.w32 === --- php/php-src/branches/PHP_5_3/ext/pdo_sqlite/config.w32 2009-10-16 02:10:52 UTC (rev 289691) +++ php/php-src/branches/PHP_5_3/ext/pdo_sqlite/config.w32 2009-10-16 02:22:48 UTC (rev 289692) @@ -4,7 +4,7 @@ ARG_WITH(pdo-sqlite, for pdo_sqlite support, no); if (PHP_PDO_SQLITE != no) { - EXTENSION(pdo_sqlite, pdo_sqlite.c sqlite_driver.c sqlite_statement.c, null, /DSQLITE_THREADSAFE= + (PHP_ZTS == yes ? 1 : 0) + /I + configure_module_dirname + /../sqlite3/libsqlite /I + configure_module_dirname); + EXTENSION(pdo_sqlite, pdo_sqlite.c sqlite_driver.c sqlite_statement.c, null, /DSQLITE_THREADSAFE= + (PHP_ZTS == yes ? 1 : 0) + /D SQLITE_ENABLE_FTS3=1 /D SQLITE_ENABLE_COLUMN_METADATA=1 /D SQLITE_CORE=1 /I + configure_module_dirname + /../sqlite3/libsqlite /I + configure_module_dirname); ADD_EXTENSION_DEP('pdo_sqlite', 'pdo'); // If pdo_sqlite is static, and sqlite3 is also static, then we don't add a second copy of the sqlite3 libs Modified: php/php-src/branches/PHP_5_3/ext/sqlite3/config.w32 === --- php/php-src/branches/PHP_5_3/ext/sqlite3/config.w32 2009-10-16 02:10:52 UTC (rev 289691) +++ php/php-src/branches/PHP_5_3/ext/sqlite3/config.w32 2009-10-16 02:22:48 UTC (rev 289692) @@ -4,7 +4,7 @@ ARG_WITH(sqlite3, SQLite 3 support, no); if (PHP_SQLITE3 != no) { - ADD_FLAG(CFLAGS_SQLITE3, /D SQLITE_THREADSAFE= + (PHP_ZTS == yes ? 1 : 0) + /D SQLITE_ENABLE_FTS3=1 /D SQLITE_CORE=1 ); + ADD_FLAG(CFLAGS_SQLITE3, /D SQLITE_THREADSAFE= + (PHP_ZTS == yes ? 1 : 0) + /D SQLITE_ENABLE_FTS3=1 /D SQLITE_ENABLE_COLUMN_METADATA=1 /D SQLITE_CORE=1 ); EXTENSION(sqlite3, sqlite3.c, null, /I + configure_module_dirname + /libsqlite /I + configure_module_dirname); ADD_SOURCES(configure_module_dirname + /libsqlite, sqlite3.c, sqlite3); Modified: php/php-src/trunk/ext/pdo_sqlite/config.w32 === --- php/php-src/trunk/ext/pdo_sqlite/config.w32 2009-10-16 02:10:52 UTC (rev 289691) +++ php/php-src/trunk/ext/pdo_sqlite/config.w32 2009-10-16 02:22:48 UTC (rev 289692) @@ -4,7 +4,7 @@ ARG_WITH(pdo-sqlite, for pdo_sqlite support, no); if (PHP_PDO_SQLITE != no) { - EXTENSION(pdo_sqlite, pdo_sqlite.c sqlite_driver.c sqlite_statement.c, null, /DSQLITE_THREADSAFE= + (PHP_ZTS == yes ? 1 : 0) + /I + configure_module_dirname + /../sqlite3/libsqlite /I + configure_module_dirname); + EXTENSION(pdo_sqlite, pdo_sqlite.c sqlite_driver.c sqlite_statement.c, null, /DSQLITE_THREADSAFE= + (PHP_ZTS == yes ? 1 : 0) + /D SQLITE_ENABLE_FTS3=1 /D SQLITE_ENABLE_COLUMN_METADATA=1 /D SQLITE_CORE=1 /I + configure_module_dirname + /../sqlite3/libsqlite /I + configure_module_dirname); ADD_EXTENSION_DEP('pdo_sqlite', 'pdo'); // If pdo_sqlite is static, and sqlite3 is also static, then we don't add a second copy of the sqlite3 libs Modified: php/php-src/trunk/ext/sqlite3/config.w32 === --- php/php-src/trunk/ext/sqlite3/config.w322009-10-16 02:10:52 UTC (rev 289691) +++ php/php-src/trunk/ext/sqlite3/config.w322009-10-16 02:22:48 UTC (rev 289692) @@ -4,7 +4,7 @@ ARG_WITH(sqlite3, SQLite 3 support, no); if (PHP_SQLITE3 != no) { - ADD_FLAG(CFLAGS_SQLITE3, /D SQLITE_THREADSAFE= + (PHP_ZTS == yes ? 1 : 0) + /D SQLITE_ENABLE_FTS3=1 /D SQLITE_CORE=1 ); + ADD_FLAG(CFLAGS_SQLITE3, /D SQLITE_THREADSAFE= + (PHP_ZTS == yes ? 1 : 0) + /D SQLITE_ENABLE_FTS3=1 /D SQLITE_ENABLE_COLUMN_METADATA=1 /D SQLITE_CORE=1 ); EXTENSION(sqlite3, sqlite3.c, null, /I + configure_module_dirname + /libsqlite /I + configure_module_dirname); ADD_SOURCES(configure_module_dirname + /libsqlite, sqlite3.c, sqlite3); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ NEWS
scottmac Wed, 12 Aug 2009 08:40:05 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287150 Log: Use the correct tense for the NEWS entries Changed paths: U php/php-src/branches/PHP_5_3/NEWS Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2009-08-12 08:37:25 UTC (rev 287149) +++ php/php-src/branches/PHP_5_3/NEWS 2009-08-12 08:40:05 UTC (rev 287150) @@ -3,11 +3,11 @@ ?? ??? 2009, PHP 5.3.1 - Upgraded bundled sqlite to version 3.6.17. (Scott) -- Improve dns_get_record support on windows. Always available when IPv6 is +- Improved dns_get_record support on windows. Always available when IPv6 is support is installed, format is now the same than on unix. (Pierre) -- Improve the DNS functions on OSX to use newer APIs, also use Bind 9 API +- Improved the DNS functions on OSX to use newer APIs, also use Bind 9 API where available on other platforms. (Scott) -- Improve shared extension loading on OSX to use the standard Unix dlopen() API. +- Improved shared extension loading on OSX to use the standard Unix dlopen() API. (Scott) - Added error constant when json_encode() detects an invalid UTF-8 sequence. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/standard/basic_functions.c trunk/ext/standard/basic_functions.c
scottmac Wed, 12 Aug 2009 09:18:41 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287151 Log: Fix build on platforms where crypt isn't always available Changed paths: U php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c U php/php-src/trunk/ext/standard/basic_functions.c Modified: php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c === --- php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c 2009-08-12 08:40:05 UTC (rev 287150) +++ php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c 2009-08-12 09:18:41 UTC (rev 287151) @@ -3678,7 +3678,9 @@ #if defined(HAVE_LOCALECONV) defined(ZTS) PHP_MSHUTDOWN(localeconv)(SHUTDOWN_FUNC_ARGS_PASSTHRU); #endif +#if HAVE_CRYPT PHP_MSHUTDOWN(crypt)(SHUTDOWN_FUNC_ARGS_PASSTHRU); +#endif return SUCCESS; } Modified: php/php-src/trunk/ext/standard/basic_functions.c === --- php/php-src/trunk/ext/standard/basic_functions.c2009-08-12 08:40:05 UTC (rev 287150) +++ php/php-src/trunk/ext/standard/basic_functions.c2009-08-12 09:18:41 UTC (rev 287151) @@ -3671,7 +3671,9 @@ #if defined(HAVE_LOCALECONV) defined(ZTS) PHP_MSHUTDOWN(localeconv)(SHUTDOWN_FUNC_ARGS_PASSTHRU); #endif +#if HAVE_CRYPT PHP_MSHUTDOWN(crypt)(SHUTDOWN_FUNC_ARGS_PASSTHRU); +#endif return SUCCESS; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/pcre/config0.m4 branches/PHP_5_3/ext/pcre/config0.m4 trunk/ext/pcre/config0.m4
scottmac Tue, 11 Aug 2009 12:03:29 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287081 Log: Search /usr/include too for those wanting to use a system PCRE. Changed paths: U php/php-src/branches/PHP_5_2/ext/pcre/config0.m4 U php/php-src/branches/PHP_5_3/ext/pcre/config0.m4 U php/php-src/trunk/ext/pcre/config0.m4 Modified: php/php-src/branches/PHP_5_2/ext/pcre/config0.m4 === --- php/php-src/branches/PHP_5_2/ext/pcre/config0.m42009-08-11 11:58:11 UTC (rev 287080) +++ php/php-src/branches/PHP_5_2/ext/pcre/config0.m42009-08-11 12:03:29 UTC (rev 287081) @@ -16,7 +16,7 @@ PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h pcrelib/]) AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ]) else -for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre; do +for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/local/include $PHP_PCRE_REGEX/include/pcre; do test -f $i/pcre.h PCRE_INCDIR=$i done Modified: php/php-src/branches/PHP_5_3/ext/pcre/config0.m4 === --- php/php-src/branches/PHP_5_3/ext/pcre/config0.m42009-08-11 11:58:11 UTC (rev 287080) +++ php/php-src/branches/PHP_5_3/ext/pcre/config0.m42009-08-11 12:03:29 UTC (rev 287081) @@ -11,7 +11,7 @@ if test $PHP_PCRE_REGEX != yes test $PHP_PCRE_REGEX != no; then AC_MSG_CHECKING([for PCRE headers location]) -for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre; do +for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/local/include $PHP_PCRE_REGEX/include/pcre; do test -f $i/pcre.h PCRE_INCDIR=$i done Modified: php/php-src/trunk/ext/pcre/config0.m4 === --- php/php-src/trunk/ext/pcre/config0.m4 2009-08-11 11:58:11 UTC (rev 287080) +++ php/php-src/trunk/ext/pcre/config0.m4 2009-08-11 12:03:29 UTC (rev 287081) @@ -11,7 +11,7 @@ if test $PHP_PCRE_REGEX != yes test $PHP_PCRE_REGEX != no; then AC_MSG_CHECKING([for PCRE headers location]) -for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre; do +for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/local/include $PHP_PCRE_REGEX/include/pcre; do test -f $i/pcre.h PCRE_INCDIR=$i done -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_2/ext/pcre/config0.m4 branches/PHP_5_3/ext/pcre/config0.m4 trunk/ext/pcre/config0.m4
scottmac Tue, 11 Aug 2009 21:40:15 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287118 Log: We should check /usr/local/include last Changed paths: U php/php-src/branches/PHP_5_2/ext/pcre/config0.m4 U php/php-src/branches/PHP_5_3/ext/pcre/config0.m4 U php/php-src/trunk/ext/pcre/config0.m4 Modified: php/php-src/branches/PHP_5_2/ext/pcre/config0.m4 === --- php/php-src/branches/PHP_5_2/ext/pcre/config0.m42009-08-11 21:33:36 UTC (rev 287117) +++ php/php-src/branches/PHP_5_2/ext/pcre/config0.m42009-08-11 21:40:15 UTC (rev 287118) @@ -16,7 +16,7 @@ PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h pcrelib/]) AC_DEFINE(HAVE_BUNDLED_PCRE, 1, [ ]) else -for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/local/include $PHP_PCRE_REGEX/include/pcre; do +for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre $PHP_PCRE_REGEX/local/include; do test -f $i/pcre.h PCRE_INCDIR=$i done Modified: php/php-src/branches/PHP_5_3/ext/pcre/config0.m4 === --- php/php-src/branches/PHP_5_3/ext/pcre/config0.m42009-08-11 21:33:36 UTC (rev 287117) +++ php/php-src/branches/PHP_5_3/ext/pcre/config0.m42009-08-11 21:40:15 UTC (rev 287118) @@ -11,7 +11,7 @@ if test $PHP_PCRE_REGEX != yes test $PHP_PCRE_REGEX != no; then AC_MSG_CHECKING([for PCRE headers location]) -for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/local/include $PHP_PCRE_REGEX/include/pcre; do +for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre $PHP_PCRE_REGEX/local/include; do test -f $i/pcre.h PCRE_INCDIR=$i done Modified: php/php-src/trunk/ext/pcre/config0.m4 === --- php/php-src/trunk/ext/pcre/config0.m4 2009-08-11 21:33:36 UTC (rev 287117) +++ php/php-src/trunk/ext/pcre/config0.m4 2009-08-11 21:40:15 UTC (rev 287118) @@ -11,7 +11,7 @@ if test $PHP_PCRE_REGEX != yes test $PHP_PCRE_REGEX != no; then AC_MSG_CHECKING([for PCRE headers location]) -for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/local/include $PHP_PCRE_REGEX/include/pcre; do +for i in $PHP_PCRE_REGEX $PHP_PCRE_REGEX/include $PHP_PCRE_REGEX/include/pcre $PHP_PCRE_REGEX/local/include; do test -f $i/pcre.h PCRE_INCDIR=$i done -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ configure.in ext/standard/basic_functions.c ext/standard/config.m4 ext/standard/dns.c ext/standard/php_dns.h
scottmac Tue, 11 Aug 2009 22:07:35 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287120 Log: Merge chanes from head to improve DNS on OSX and allow usage of bind9 stuff with the bind8 compatibility layer. Changed paths: U php/php-src/branches/PHP_5_3/configure.in U php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c U php/php-src/branches/PHP_5_3/ext/standard/config.m4 U php/php-src/branches/PHP_5_3/ext/standard/dns.c U php/php-src/branches/PHP_5_3/ext/standard/php_dns.h Modified: php/php-src/branches/PHP_5_3/configure.in === --- php/php-src/branches/PHP_5_3/configure.in 2009-08-11 21:49:55 UTC (rev 287119) +++ php/php-src/branches/PHP_5_3/configure.in 2009-08-11 22:07:35 UTC (rev 287120) @@ -254,7 +254,6 @@ CPPFLAGS=$CPPFLAGS -no-cpp-precomp fi fi -AC_DEFINE(BIND_8_COMPAT, 1, [Enabling BIND8 compatibility for Panther]) php_multiple_shlib_versions_ok=yes ;; *beos*) Modified: php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c === --- php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c 2009-08-11 21:49:55 UTC (rev 287119) +++ php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c 2009-08-11 22:07:35 UTC (rev 287120) @@ -995,22 +995,20 @@ ZEND_END_ARG_INFO() #endif -#if defined(PHP_WIN32) || (HAVE_RES_SEARCH !(defined(__BEOS__) || defined(NETWARE))) +#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC !(defined(__BEOS__) || defined(NETWARE))) ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_check_record, 0, 0, 1) ZEND_ARG_INFO(0, host) ZEND_ARG_INFO(0, type) ZEND_END_ARG_INFO() -# if defined(PHP_WIN32) || HAVE_DNS_FUNCS +# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_get_record, 1, 0, 1) ZEND_ARG_INFO(0, hostname) ZEND_ARG_INFO(0, type) ZEND_ARG_INFO(1, authns) /* ARRAY_INFO(1, authns, 1) */ ZEND_ARG_INFO(1, addtl) /* ARRAY_INFO(1, addtl, 1) */ ZEND_END_ARG_INFO() -# endif -# if defined(PHP_WIN32) || (HAVE_DN_SKIPNAME HAVE_DN_EXPAND) ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_get_mx, 0, 0, 2) ZEND_ARG_INFO(0, hostname) ZEND_ARG_INFO(1, mxhosts) /* ARRAY_INFO(1, mxhosts, 1) */ @@ -1018,7 +1016,7 @@ ZEND_END_ARG_INFO() # endif -#endif /* defined(PHP_WIN32) || (HAVE_RES_SEARCH !(defined(__BEOS__) || defined(NETWARE))) */ +#endif /* defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC !(defined(__BEOS__) || defined(NETWARE))) */ /* }}} */ /* {{{ exec.c */ @@ -3000,17 +2998,14 @@ PHP_FE(gethostname, arginfo_gethostname) #endif -#if defined(PHP_WIN32) || (HAVE_RES_SEARCH !(defined(__BEOS__) || defined(NETWARE))) +#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC !(defined(__BEOS__) || defined(NETWARE))) PHP_FE(dns_check_record,arginfo_dns_check_record) PHP_FALIAS(checkdnsrr, dns_check_record, arginfo_dns_check_record) -# if defined(PHP_WIN32) || (HAVE_DN_SKIPNAME HAVE_DN_EXPAND) +# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS PHP_FE(dns_get_mx, arginfo_dns_get_mx) PHP_FALIAS(getmxrr,dns_get_mx, arginfo_dns_get_mx) -# endif - -# if defined(PHP_WIN32) || HAVE_DNS_FUNCS PHP_FE(dns_get_record, arginfo_dns_get_record) # endif #endif @@ -3639,8 +3634,8 @@ php_register_url_stream_wrapper(ftp, php_stream_ftp_wrapper TSRMLS_CC); #endif -#if defined(PHP_WIN32) || (HAVE_RES_SEARCH !(defined(__BEOS__) || defined(NETWARE))) -# if defined(PHP_WIN32) || HAVE_DNS_FUNCS +#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC !(defined(__BEOS__) || defined(NETWARE))) +# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS PHP_MINIT(dns)(INIT_FUNC_ARGS_PASSTHRU); # endif #endif Modified: php/php-src/branches/PHP_5_3/ext/standard/config.m4 === --- php/php-src/branches/PHP_5_3/ext/standard/config.m4 2009-08-11 21:49:55 UTC (rev 287119) +++ php/php-src/branches/PHP_5_3/ext/standard/config.m4 2009-08-11 22:07:35 UTC (rev 287120) @@ -247,21 +247,18 @@ dnl dnl Detect library functions needed by php dns_xxx functions -dnl ext/standard/php_dns.h will collect these in a single define: HAVE_DNS_FUNCS +dnl ext/standard/php_dns.h will collect these in a single define: HAVE_FULL_DNS_FUNCS dnl -PHP_CHECK_FUNC(res_nmkquery, resolv, bind, socket) -PHP_CHECK_FUNC(res_nsend, resolv, bind, socket) -PHP_CHECK_FUNC(res_search, resolv, bind, socket) +PHP_CHECK_FUNC(res_nsearch, resolv, bind, socket) +PHP_CHECK_FUNC(dns_search, resolv, bind, socket) PHP_CHECK_FUNC(dn_expand, resolv, bind, socket) PHP_CHECK_FUNC(dn_skipname, resolv, bind, socket) dnl -dnl These are old deprecated functions, a single define of HAVE_DEPRECATED_DNS_FUNCS -dnl will be set in ext/standard/php_dns.h +dnl These are old deprecated functions dnl -PHP_CHECK_FUNC(res_mkquery, resolv, bind, socket)
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/sqlite3/libsqlite/sqlite3.c branches/PHP_5_3/ext/sqlite3/libsqlite/sqlite3.h trunk/ext/sqlite3/libsqlite/sqlite3.c trunk/ext/sqlite3/libsqlite/sqlite3
scottmac Tue, 11 Aug 2009 22:22:21 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287121 Log: Update libsqlite to 3.6.17. Changed paths: U php/php-src/branches/PHP_5_3/ext/sqlite3/libsqlite/sqlite3.c U php/php-src/branches/PHP_5_3/ext/sqlite3/libsqlite/sqlite3.h U php/php-src/trunk/ext/sqlite3/libsqlite/sqlite3.c U php/php-src/trunk/ext/sqlite3/libsqlite/sqlite3.h diffs exceeded maximum size -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ NEWS
scottmac Tue, 11 Aug 2009 22:45:21 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287122 Log: Update NEWS entry with some stuff I missed. Changed paths: U php/php-src/branches/PHP_5_3/NEWS Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2009-08-11 22:22:21 UTC (rev 287121) +++ php/php-src/branches/PHP_5_3/NEWS 2009-08-11 22:45:21 UTC (rev 287122) @@ -1,9 +1,18 @@ PHPNEWS ||| ?? ??? 2009, PHP 5.3.1 +- Upgraded bundled sqlite to version 3.6.17. (Scott) + - Improve dns_get_record support on windows. Always available when IPv6 is support is installed, format is now the same than on unix. (Pierre) +- Improve the DNS functions on OSX to use newer APIs, also use Bind 9 API + where available on other platforms. (Scott) +- Improve shared extension loading on OSX to use the standard Unix dlopen() API. + (Scott) +- Added error constant when json_encode() detects an invalid UTF-8 sequence. + (Scott) + - Fixed spl_autoload_unregister/spl_autoload_functions wrt. Closures and Functors. (Christian Seiler) - Fixed open_basedir circumvention for mail.log. (Maksymilian Arciemowicz, -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/fileinfo/fileinfo.c trunk/ext/fileinfo/fileinfo.c
scottmac Tue, 11 Aug 2009 23:05:13 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287125 Log: Fix BC break in mime_content_type() Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/fileinfo/fileinfo.c U php/php-src/trunk/ext/fileinfo/fileinfo.c Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2009-08-11 22:55:19 UTC (rev 287124) +++ php/php-src/branches/PHP_5_3/NEWS 2009-08-11 23:05:13 UTC (rev 287125) @@ -19,6 +19,7 @@ Stas) - Fixed signature generation/validation for zip archives in ext/phar. (Greg) - Fixed memory leak in stream_is_local(). (Felipe, Tony) +- Fixed BC break in mime_content_type(), removes the content encoding. (Scott) - Fixed bug #49193 (gdJpegGetVersionString() inside gd_compact identifies wrong type in declaration). (Ilia) Modified: php/php-src/branches/PHP_5_3/ext/fileinfo/fileinfo.c === --- php/php-src/branches/PHP_5_3/ext/fileinfo/fileinfo.c2009-08-11 22:55:19 UTC (rev 287124) +++ php/php-src/branches/PHP_5_3/ext/fileinfo/fileinfo.c2009-08-11 23:05:13 UTC (rev 287125) @@ -414,7 +414,7 @@ RETURN_FALSE; } - magic = magic_open(MAGIC_MIME); + magic = magic_open(MAGIC_MIME_TYPE); if (magic_load(magic, NULL) == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed to load magic database.); goto common; Modified: php/php-src/trunk/ext/fileinfo/fileinfo.c === --- php/php-src/trunk/ext/fileinfo/fileinfo.c 2009-08-11 22:55:19 UTC (rev 287124) +++ php/php-src/trunk/ext/fileinfo/fileinfo.c 2009-08-11 23:05:13 UTC (rev 287125) @@ -419,7 +419,7 @@ RETURN_FALSE; } - magic = magic_open(MAGIC_MIME); + magic = magic_open(MAGIC_MIME_TYPE); if (magic_load(magic, NULL) == -1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Failed to load magic database.); goto common; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_2/ext/hash/ hash_adler32.c tests/adler32.phpt tests/hash_file_basic1.phpt tests/hash_hmac_basic.phpt tests/hash_hmac_file_basic.phpt
scottmac Wed, 12 Aug 2009 00:18:36 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287127 Log: MFB 5.3: Fix bug #48284 (r283144) - adler32 is in the wrong order. Changed to match what zlib produces. Bug: http://bugs.php.net/48284 (Assigned) hash adler32 byte order is reversed Changed paths: U php/php-src/branches/PHP_5_2/ext/hash/hash_adler32.c U php/php-src/branches/PHP_5_2/ext/hash/tests/adler32.phpt U php/php-src/branches/PHP_5_2/ext/hash/tests/hash_file_basic1.phpt U php/php-src/branches/PHP_5_2/ext/hash/tests/hash_hmac_basic.phpt U php/php-src/branches/PHP_5_2/ext/hash/tests/hash_hmac_file_basic.phpt Modified: php/php-src/branches/PHP_5_2/ext/hash/hash_adler32.c === --- php/php-src/branches/PHP_5_2/ext/hash/hash_adler32.c2009-08-11 23:45:35 UTC (rev 287126) +++ php/php-src/branches/PHP_5_2/ext/hash/hash_adler32.c2009-08-12 00:18:36 UTC (rev 287127) @@ -42,10 +42,10 @@ PHP_HASH_API void PHP_ADLER32Final(unsigned char digest[4], PHP_ADLER32_CTX *context) { - digest[3] = (unsigned char) ((context-state 24) 0xff); - digest[2] = (unsigned char) ((context-state 16) 0xff); - digest[1] = (unsigned char) ((context-state 8) 0xff); - digest[0] = (unsigned char) (context-state 0xff); + digest[0] = (unsigned char) ((context-state 24) 0xff); + digest[1] = (unsigned char) ((context-state 16) 0xff); + digest[2] = (unsigned char) ((context-state 8) 0xff); + digest[3] = (unsigned char) (context-state 0xff); context-state = 0; } Modified: php/php-src/branches/PHP_5_2/ext/hash/tests/adler32.phpt === --- php/php-src/branches/PHP_5_2/ext/hash/tests/adler32.phpt2009-08-11 23:45:35 UTC (rev 287126) +++ php/php-src/branches/PHP_5_2/ext/hash/tests/adler32.phpt2009-08-12 00:18:36 UTC (rev 287127) @@ -13,10 +13,10 @@ echo hash('adler32', '12345678901234567890123456789012345678901234567890123456789012345678901234567890'), \n; ? --EXPECT-- -0100 -62006200 -27014d02 -86057529 -200b8690 -0c15db8a -6910b697 +0001 +00620062 +024d0127 +29750586 +90860b20 +8adb150c +97b61069 Modified: php/php-src/branches/PHP_5_2/ext/hash/tests/hash_file_basic1.phpt === --- php/php-src/branches/PHP_5_2/ext/hash/tests/hash_file_basic1.phpt 2009-08-11 23:45:35 UTC (rev 287126) +++ php/php-src/branches/PHP_5_2/ext/hash/tests/hash_file_basic1.phpt 2009-08-12 00:18:36 UTC (rev 287127) @@ -63,7 +63,7 @@ ===Done=== --EXPECTF-- *** Testing hash_file() : basic functionality *** -adler32: 2e2287ff +adler32: ff87222e crc32: 61664d33 gost: d9e65f0c0c2ef944e4f8a01f4a46365c4f33a2853756878182a7f03e1490a4cd haval128,3: 8bb81269aca8b7f87829020d76a4e841 @@ -81,7 +81,7 @@ snefru: d414b2345d3e7fa1a31c044cf334bfc1fec24d89e464411998d579d24663895f tiger192,3: c6fa75a0be4ecf7afa3cafb4e2a08efc3a40534c0e46b971 whirlpool: 4248b149e000477269a4a5f1a84d97cfc3d0199b7aaf505913e6f010a6f83276029d11a9ad545374bc710eb59c7d958985023ab886ffa9ec9a23852844c764ec -adler32(raw): 2e2287ff +adler32(raw): ff87222e md5(raw): 704bf818448f5bbb94061332d2c889aa sha256(raw): a0f5702fa5d3670b80033d668e8732b70550392abb53841355447f8bb0f72245 ===Done=== \ No newline at end of file Modified: php/php-src/branches/PHP_5_2/ext/hash/tests/hash_hmac_basic.phpt === --- php/php-src/branches/PHP_5_2/ext/hash/tests/hash_hmac_basic.phpt 2009-08-11 23:45:35 UTC (rev 287126) +++ php/php-src/branches/PHP_5_2/ext/hash/tests/hash_hmac_basic.phpt 2009-08-12 00:18:36 UTC (rev 287127) @@ -44,7 +44,7 @@ ===Done=== --EXPECTF-- *** Testing hash_hmac() : basic functionality *** -adler32: 9e033311 +adler32: 12c803f7 crc32: 96859101 gost: a4a3c80bdf3f8665bf07376a34dc9c1b11af7c813f4928f62e39f0c0dc564dad haval128,3: 82cd0f4bd36729b5c80c33efa8c13ac5 @@ -62,7 +62,7 @@ snefru: 67af483046f9cf16fe19f9087929ccfc6ad176ade3290b4d33f43e0ddb07e711 tiger192,3: 82779797cdc439e886884953ba21fa38e35679041e95ee27 whirlpool: 4a0f1582b21b7aff59bfba7f9c29131c69741b2ce80acdc7d314040f3b768cf5a17e30b74cceb86fbc6b34b1692e0addd5bfd7cfc043d40c0621f1b97e26fa49 -adler32(raw): 9e033311 +adler32(raw): 12c803f7 md5(raw): 2a632783e2812cf23de100d7d6a463ae sha256(raw): 49bde3496b9510a17d0edd8a4b0ac70148e32a1d51e881ec76faa96534125838 ===Done=== \ No newline at end of file Modified: php/php-src/branches/PHP_5_2/ext/hash/tests/hash_hmac_file_basic.phpt === --- php/php-src/branches/PHP_5_2/ext/hash/tests/hash_hmac_file_basic.phpt 2009-08-11 23:45:35 UTC (rev 287126) +++ php/php-src/branches/PHP_5_2/ext/hash/tests/hash_hmac_file_basic.phpt 2009-08-12 00:18:36 UTC (rev 287127) @@ -72,7 +72,7 @@
[PHP-CVS] svn: /php/php-src/branches/PHP_5_2/ NEWS
scottmac Wed, 12 Aug 2009 00:21:42 + Revision: http://svn.php.net/viewvc?view=revisionrevision=287128 Log: BFN Changed paths: U php/php-src/branches/PHP_5_2/NEWS Modified: php/php-src/branches/PHP_5_2/NEWS === --- php/php-src/branches/PHP_5_2/NEWS 2009-08-12 00:18:36 UTC (rev 287127) +++ php/php-src/branches/PHP_5_2/NEWS 2009-08-12 00:21:42 UTC (rev 287128) @@ -66,6 +66,7 @@ - Fixed bug #48450 (Compile failure under IRIX 6.5.30 building gd.c). (Kalle) - Fixed bug #48400 (imap crashes when closing stream opened with OP_PROTOTYPE flag). (Jani) +- Fixed bug #48284 (hash adler32 byte order is reversed). (Scott) - Fixed bug #48276 (date(Y) on big endian machines produces the wrong result). (Scott) - Fixed bug #48247 (Infinite loop and possible crash during startup with -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/branches/PHP_5_2/ext/standard/ basic_functions.c config.m4 dns.c dns.h php_dns.h php_standard.h
scottmac Thu, 06 Aug 2009 14:07:16 + Revision: http://svn.php.net/viewvc?view=revisionrevision=286890 Log: Merge r286857: Change dns.h to php_dns.h, part of my dns cleanup Changed paths: U php/php-src/branches/PHP_5_2/ext/standard/basic_functions.c U php/php-src/branches/PHP_5_2/ext/standard/config.m4 U php/php-src/branches/PHP_5_2/ext/standard/dns.c D php/php-src/branches/PHP_5_2/ext/standard/dns.h A + php/php-src/branches/PHP_5_2/ext/standard/php_dns.h (from php/php-src/branches/PHP_5_2/ext/standard/dns.h:r286885) U php/php-src/branches/PHP_5_2/ext/standard/php_standard.h Modified: php/php-src/branches/PHP_5_2/ext/standard/basic_functions.c === --- php/php-src/branches/PHP_5_2/ext/standard/basic_functions.c 2009-08-06 13:54:21 UTC (rev 286889) +++ php/php-src/branches/PHP_5_2/ext/standard/basic_functions.c 2009-08-06 14:07:16 UTC (rev 286890) @@ -31,7 +31,7 @@ #include ext/standard/info.h #include ext/session/php_session.h #include zend_operators.h -#include ext/standard/dns.h +#include ext/standard/php_dns.h #include ext/standard/php_uuencode.h #ifdef PHP_WIN32 Modified: php/php-src/branches/PHP_5_2/ext/standard/config.m4 === --- php/php-src/branches/PHP_5_2/ext/standard/config.m4 2009-08-06 13:54:21 UTC (rev 286889) +++ php/php-src/branches/PHP_5_2/ext/standard/config.m4 2009-08-06 14:07:16 UTC (rev 286890) @@ -309,7 +309,7 @@ dnl dnl Detect library functions needed by php dns_xxx functions -dnl ext/standard/dns.h will collect these in a single define: HAVE_DNS_FUNCS +dnl ext/standard/php_dns.h will collect these in a single define: HAVE_DNS_FUNCS dnl PHP_CHECK_FUNC(res_nmkquery, resolv, bind, socket) PHP_CHECK_FUNC(res_nsend, resolv, bind, socket) Modified: php/php-src/branches/PHP_5_2/ext/standard/dns.c === --- php/php-src/branches/PHP_5_2/ext/standard/dns.c 2009-08-06 13:54:21 UTC (rev 286889) +++ php/php-src/branches/PHP_5_2/ext/standard/dns.c 2009-08-06 14:07:16 UTC (rev 286890) @@ -68,7 +68,7 @@ #define AF_INET 2 /* internetwork: UDP, TCP, etc. */ #endif -#include dns.h +#include php_dns.h /* type compat */ #ifndef DNS_T_A Deleted: php/php-src/branches/PHP_5_2/ext/standard/dns.h === --- php/php-src/branches/PHP_5_2/ext/standard/dns.h 2009-08-06 13:54:21 UTC (rev 286889) +++ php/php-src/branches/PHP_5_2/ext/standard/dns.h 2009-08-06 14:07:16 UTC (rev 286890) @@ -1,54 +0,0 @@ -/* - +--+ - | PHP Version 5| - +--+ - | Copyright (c) 1997-2009 The PHP Group| - +--+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is| - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | lice...@php.net so we can mail you a copy immediately. | - +--+ - | Authors: The typical suspects| - | Marcus Boerger he...@php.net | - | Pollita poll...@php.net | - +--+ -*/ - -/* $Id$ */ - -#ifndef DNS_H -#define DNS_H - -#if HAVE_RES_NMKQUERY HAVE_RES_NSEND HAVE_DN_EXPAND HAVE_DN_SKIPNAME -#define HAVE_DNS_FUNCS 1 -#endif - -PHP_FUNCTION(gethostbyaddr); -PHP_FUNCTION(gethostbyname); -PHP_FUNCTION(gethostbynamel); - -#if HAVE_RES_SEARCH !(defined(__BEOS__) || defined(PHP_WIN32) || defined(NETWARE)) -PHP_FUNCTION(dns_check_record); -# if HAVE_DN_SKIPNAME HAVE_DN_EXPAND -PHP_FUNCTION(dns_get_mx); -# endif - -# if HAVE_DNS_FUNCS -PHP_FUNCTION(dns_get_record); -PHP_MINIT_FUNCTION(dns); -# endif -#endif - -#ifndef INT16SZ -#define INT16SZ2 -#endif - -#ifndef INT32SZ -#define INT32SZ4 -#endif - -#endif /* DNS_H */ Copied: php/php-src/branches/PHP_5_2/ext/standard/php_dns.h (from rev 286885, php/php-src/branches/PHP_5_2/ext/standard/dns.h) === --- php/php-src/branches/PHP_5_2/ext/standard/php_dns.h (rev 0) +++
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/configure.in trunk/configure.in
scottmac Wed, 05 Aug 2009 20:01:33 + Revision: http://svn.php.net/viewvc?view=revisionrevision=286852 Log: res_search is already checked within ext/standard/config.m4 also check for arpa/nameser_compat.h, OSX puts some old defines in there (not used yet) Changed paths: U php/php-src/branches/PHP_5_3/configure.in U php/php-src/trunk/configure.in Modified: php/php-src/branches/PHP_5_3/configure.in === --- php/php-src/branches/PHP_5_3/configure.in 2009-08-05 19:45:13 UTC (rev 286851) +++ php/php-src/branches/PHP_5_3/configure.in 2009-08-05 20:01:33 UTC (rev 286852) @@ -424,6 +424,7 @@ alloca.h \ arpa/inet.h \ arpa/nameser.h \ +arpa/nameser_compat.h \ assert.h \ crypt.h \ fcntl.h \ @@ -599,7 +600,6 @@ realpath \ random \ rand_r \ -res_search \ scandir \ setitimer \ setlocale \ Modified: php/php-src/trunk/configure.in === --- php/php-src/trunk/configure.in 2009-08-05 19:45:13 UTC (rev 286851) +++ php/php-src/trunk/configure.in 2009-08-05 20:01:33 UTC (rev 286852) @@ -424,6 +424,7 @@ alloca.h \ arpa/inet.h \ arpa/nameser.h \ +arpa/nameser_compat.h \ assert.h \ crypt.h \ fcntl.h \ @@ -599,7 +600,6 @@ realpath \ random \ rand_r \ -res_search \ scandir \ setitimer \ setlocale \ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/configure.in branches/PHP_5_3/ext/standard/basic_functions.c branches/PHP_5_3/ext/standard/config.m4 branches/PHP_5_3/ext/standard/dns.c branches/PHP_5_3/
scottmac Wed, 05 Aug 2009 23:20:17 + Revision: http://svn.php.net/viewvc?view=revisionrevision=286857 Log: Change dns.h to php_dns.h, part of my dns cleanup Changed paths: U php/php-src/branches/PHP_5_3/configure.in U php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c U php/php-src/branches/PHP_5_3/ext/standard/config.m4 U php/php-src/branches/PHP_5_3/ext/standard/dns.c D php/php-src/branches/PHP_5_3/ext/standard/dns.h U php/php-src/branches/PHP_5_3/ext/standard/dns_win32.c A + php/php-src/branches/PHP_5_3/ext/standard/php_dns.h (from php/php-src/branches/PHP_5_3/ext/standard/dns.h:r286856) U php/php-src/branches/PHP_5_3/ext/standard/php_standard.h U php/php-src/trunk/configure.in U php/php-src/trunk/ext/standard/basic_functions.c U php/php-src/trunk/ext/standard/config.m4 U php/php-src/trunk/ext/standard/dns.c D php/php-src/trunk/ext/standard/dns.h U php/php-src/trunk/ext/standard/dns_win32.c A + php/php-src/trunk/ext/standard/php_dns.h (from php/php-src/trunk/ext/standard/dns.h:r286850) U php/php-src/trunk/ext/standard/php_standard.h U php/php-src/trunk/ext/standard/url_scanner_ex.c Modified: php/php-src/branches/PHP_5_3/configure.in === --- php/php-src/branches/PHP_5_3/configure.in 2009-08-05 21:46:09 UTC (rev 286856) +++ php/php-src/branches/PHP_5_3/configure.in 2009-08-05 23:20:17 UTC (rev 286857) @@ -423,10 +423,11 @@ netinet/in.h \ alloca.h \ arpa/inet.h \ +arpa/nameser_compat.h \ arpa/nameser.h \ -arpa/nameser_compat.h \ assert.h \ crypt.h \ +dns.h \ fcntl.h \ grp.h \ ieeefp.h \ Modified: php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c === --- php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c 2009-08-05 21:46:09 UTC (rev 286856) +++ php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c 2009-08-05 23:20:17 UTC (rev 286857) @@ -32,7 +32,7 @@ #include ext/standard/info.h #include ext/session/php_session.h #include zend_operators.h -#include ext/standard/dns.h +#include ext/standard/php_dns.h #include ext/standard/php_uuencode.h #include safe_mode.h Modified: php/php-src/branches/PHP_5_3/ext/standard/config.m4 === --- php/php-src/branches/PHP_5_3/ext/standard/config.m4 2009-08-05 21:46:09 UTC (rev 286856) +++ php/php-src/branches/PHP_5_3/ext/standard/config.m4 2009-08-05 23:20:17 UTC (rev 286857) @@ -247,7 +247,7 @@ dnl dnl Detect library functions needed by php dns_xxx functions -dnl ext/standard/dns.h will collect these in a single define: HAVE_DNS_FUNCS +dnl ext/standard/php_dns.h will collect these in a single define: HAVE_DNS_FUNCS dnl PHP_CHECK_FUNC(res_nmkquery, resolv, bind, socket) PHP_CHECK_FUNC(res_nsend, resolv, bind, socket) @@ -257,7 +257,7 @@ dnl dnl These are old deprecated functions, a single define of HAVE_DEPRECATED_DNS_FUNCS -dnl will be set in ext/standard/dns.h +dnl will be set in ext/standard/php_dns.h dnl PHP_CHECK_FUNC(res_mkquery, resolv, bind, socket) Modified: php/php-src/branches/PHP_5_3/ext/standard/dns.c === --- php/php-src/branches/PHP_5_3/ext/standard/dns.c 2009-08-05 21:46:09 UTC (rev 286856) +++ php/php-src/branches/PHP_5_3/ext/standard/dns.c 2009-08-05 23:20:17 UTC (rev 286857) @@ -56,7 +56,7 @@ #define AF_INET 2 /* internetwork: UDP, TCP, etc. */ #endif -#include dns.h +#include php_dns.h /* type compat */ #ifndef DNS_T_A Deleted: php/php-src/branches/PHP_5_3/ext/standard/dns.h === --- php/php-src/branches/PHP_5_3/ext/standard/dns.h 2009-08-05 21:46:09 UTC (rev 286856) +++ php/php-src/branches/PHP_5_3/ext/standard/dns.h 2009-08-05 23:20:17 UTC (rev 286857) @@ -1,71 +0,0 @@ -/* - +--+ - | PHP Version 5| - +--+ - | Copyright (c) 1997-2008 The PHP Group| - +--+ - | This source file is subject to version 3.01 of the PHP license, | - | that is bundled with this package in the file LICENSE, and is| - | available through the world-wide-web at the following url: | - | http://www.php.net/license/3_01.txt | - | If you did not receive a copy of the PHP license and are unable to | - | obtain it through the world-wide-web, please send a note to | - | lice...@php.net so we can mail you a copy immediately. | -
[PHP-CVS] svn: /php/php-src/trunk/ configure.in ext/standard/basic_functions.c ext/standard/config.m4 ext/standard/dns.c ext/standard/php_dns.h
scottmac Thu, 06 Aug 2009 00:10:46 + Revision: http://svn.php.net/viewvc?view=revisionrevision=286858 Log: Remove usage of res_nmkquery and res_nsend. We essentially were just doing a res_search() anyway, though now we use res_nsearch() with our own state. This also adds support for using the high level dns.h API on OSX which in turns allows use of bind9 (finally). Changed paths: U php/php-src/trunk/configure.in U php/php-src/trunk/ext/standard/basic_functions.c U php/php-src/trunk/ext/standard/config.m4 U php/php-src/trunk/ext/standard/dns.c U php/php-src/trunk/ext/standard/php_dns.h Modified: php/php-src/trunk/configure.in === --- php/php-src/trunk/configure.in 2009-08-05 23:20:17 UTC (rev 286857) +++ php/php-src/trunk/configure.in 2009-08-06 00:10:46 UTC (rev 286858) @@ -254,7 +254,6 @@ CPPFLAGS=$CPPFLAGS -no-cpp-precomp fi fi -AC_DEFINE(BIND_8_COMPAT, 1, [Enabling BIND8 compatibility for Panther]) php_multiple_shlib_versions_ok=yes ;; *beos*) Modified: php/php-src/trunk/ext/standard/basic_functions.c === --- php/php-src/trunk/ext/standard/basic_functions.c 2009-08-05 23:20:17 UTC (rev 286857) +++ php/php-src/trunk/ext/standard/basic_functions.c 2009-08-06 00:10:46 UTC (rev 286858) @@ -992,22 +992,20 @@ ZEND_END_ARG_INFO() #endif -#if defined(PHP_WIN32) || (HAVE_RES_SEARCH !(defined(__BEOS__) || defined(NETWARE))) +#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC !(defined(__BEOS__) || defined(NETWARE))) ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_check_record, 0, 0, 1) ZEND_ARG_INFO(0, host) ZEND_ARG_INFO(0, type) ZEND_END_ARG_INFO() -# if defined(PHP_WIN32) || HAVE_DNS_FUNCS +# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_get_record, 1, 0, 1) ZEND_ARG_INFO(0, hostname) ZEND_ARG_INFO(0, type) ZEND_ARG_INFO(1, authns) /* ARRAY_INFO(1, authns, 1) */ ZEND_ARG_INFO(1, addtl) /* ARRAY_INFO(1, addtl, 1) */ ZEND_END_ARG_INFO() -# endif -# if defined(PHP_WIN32) || (HAVE_DN_SKIPNAME HAVE_DN_EXPAND) ZEND_BEGIN_ARG_INFO_EX(arginfo_dns_get_mx, 0, 0, 2) ZEND_ARG_INFO(0, hostname) ZEND_ARG_INFO(1, mxhosts) /* ARRAY_INFO(1, mxhosts, 1) */ @@ -1015,7 +1013,7 @@ ZEND_END_ARG_INFO() # endif -#endif /* defined(PHP_WIN32) || (HAVE_RES_SEARCH !(defined(__BEOS__) || defined(NETWARE))) */ +#endif /* defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC !(defined(__BEOS__) || defined(NETWARE))) */ /* }}} */ /* {{{ exec.c */ ZEND_BEGIN_ARG_INFO_EX(arginfo_exec, 0, 0, 1) @@ -3023,17 +3021,14 @@ PHP_FE(gethostname, arginfo_gethostname) #endif -#if defined(PHP_WIN32) || (HAVE_RES_SEARCH !(defined(__BEOS__) || defined(NETWARE))) +#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC !(defined(__BEOS__) || defined(NETWARE))) PHP_FE(dns_check_record,arginfo_dns_check_record) PHP_FALIAS(checkdnsrr, dns_check_record, arginfo_dns_check_record) -# if defined(PHP_WIN32) || (HAVE_DN_SKIPNAME HAVE_DN_EXPAND) +# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS PHP_FE(dns_get_mx, arginfo_dns_get_mx) PHP_FALIAS(getmxrr,dns_get_mx, arginfo_dns_get_mx) -# endif - -# if defined(PHP_WIN32) || HAVE_DNS_FUNCS PHP_FE(dns_get_record, arginfo_dns_get_record) # endif #endif @@ -3632,8 +3627,8 @@ php_register_url_stream_wrapper(ftp, php_stream_ftp_wrapper TSRMLS_CC); #endif -#if defined(PHP_WIN32) || (HAVE_RES_SEARCH !(defined(__BEOS__) || defined(NETWARE))) -# if defined(PHP_WIN32) || HAVE_DNS_FUNCS +#if defined(PHP_WIN32) || (HAVE_DNS_SEARCH_FUNC !(defined(__BEOS__) || defined(NETWARE))) +# if defined(PHP_WIN32) || HAVE_FULL_DNS_FUNCS PHP_MINIT(dns)(INIT_FUNC_ARGS_PASSTHRU); # endif #endif Modified: php/php-src/trunk/ext/standard/config.m4 === --- php/php-src/trunk/ext/standard/config.m4 2009-08-05 23:20:17 UTC (rev 286857) +++ php/php-src/trunk/ext/standard/config.m4 2009-08-06 00:10:46 UTC (rev 286858) @@ -247,21 +247,18 @@ dnl dnl Detect library functions needed by php dns_xxx functions -dnl ext/standard/php_dns.h will collect these in a single define: HAVE_DNS_FUNCS +dnl ext/standard/php_dns.h will collect these in a single define: HAVE_FULL_DNS_FUNCS dnl -PHP_CHECK_FUNC(res_nmkquery, resolv, bind, socket) -PHP_CHECK_FUNC(res_nsend, resolv, bind, socket) -PHP_CHECK_FUNC(res_search, resolv, bind, socket) +PHP_CHECK_FUNC(res_nsearch, resolv, bind, socket) +PHP_CHECK_FUNC(dns_search, resolv, bind, socket) PHP_CHECK_FUNC(dn_expand, resolv, bind, socket) PHP_CHECK_FUNC(dn_skipname, resolv, bind, socket) dnl -dnl These are old deprecated functions, a single define of HAVE_DEPRECATED_DNS_FUNCS -dnl will be set in ext/standard/php_dns.h +dnl These are old deprecated functions dnl -PHP_CHECK_FUNC(res_mkquery,
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/Zend/Zend.m4 branches/PHP_5_3/Zend/zend.h branches/PHP_5_3/Zend/zend_API.c branches/PHP_5_3/Zend/zend_extensions.c branches/PHP_5_3/configure.in branches/
scottmac Thu, 06 Aug 2009 01:33:54 + Revision: http://svn.php.net/viewvc?view=revisionrevision=286859 Log: Fix bug #48575 - Use dlopen() just like all the other *nixes instead of OSX specific code. Bug: http://bugs.php.net/48575 (Assigned) Darwin / OS X should use dlopen() et al Changed paths: U php/php-src/branches/PHP_5_3/Zend/Zend.m4 U php/php-src/branches/PHP_5_3/Zend/zend.h U php/php-src/branches/PHP_5_3/Zend/zend_API.c U php/php-src/branches/PHP_5_3/Zend/zend_extensions.c U php/php-src/branches/PHP_5_3/configure.in U php/php-src/branches/PHP_5_3/ext/standard/dl.c U php/php-src/trunk/Zend/Zend.m4 U php/php-src/trunk/Zend/zend.h U php/php-src/trunk/Zend/zend_API.c U php/php-src/trunk/Zend/zend_extensions.c U php/php-src/trunk/configure.in U php/php-src/trunk/ext/standard/dl.c Modified: php/php-src/branches/PHP_5_3/Zend/Zend.m4 === --- php/php-src/branches/PHP_5_3/Zend/Zend.m4 2009-08-06 00:10:46 UTC (rev 286858) +++ php/php-src/branches/PHP_5_3/Zend/Zend.m4 2009-08-06 01:33:54 UTC (rev 286859) @@ -62,18 +62,6 @@ stdlib.h \ dlfcn.h) -dnl Don't use mach-o/dyld.h on Darwin 8+, dl* is recommended by Apple from there on -dnl See http://developer.apple.com/documentation/DeveloperTools/Conceptual/MachOTopics/Articles/loading_code.html -case $host_alias in -*darwin[[89]]*) -;; -*) -AC_CHECK_HEADERS([ \ -mach-o/dyld.h -],[],[][]) -;; -esac - AC_TYPE_SIZE_T AC_TYPE_SIGNAL Modified: php/php-src/branches/PHP_5_3/Zend/zend.h === --- php/php-src/branches/PHP_5_3/Zend/zend.h 2009-08-06 00:10:46 UTC (rev 286858) +++ php/php-src/branches/PHP_5_3/Zend/zend.h 2009-08-06 01:33:54 UTC (rev 286859) @@ -79,19 +79,8 @@ # include dlfcn.h #endif -#if HAVE_MACH_O_DYLD_H -#include mach-o/dyld.h +#if defined(HAVE_LIBDL) !defined(ZEND_WIN32) -/* MH_BUNDLE loading functions for Mac OS X / Darwin */ -void *zend_mh_bundle_load (char* bundle_path); -int zend_mh_bundle_unload (void *bundle_handle); -void *zend_mh_bundle_symbol(void *bundle_handle, const char *symbol_name); -const char *zend_mh_bundle_error(void); - -#endif /* HAVE_MACH_O_DYLD_H */ - -#if defined(HAVE_LIBDL) !defined(HAVE_MACH_O_DYLD_H) !defined(ZEND_WIN32) - # ifndef RTLD_LAZY # define RTLD_LAZY 1/* Solaris 1, FreeBSD's (2.1.7.1 and older) */ # endif @@ -116,13 +105,6 @@ # define DL_ERROR dlerror # define DL_HANDLE void * # define ZEND_EXTENSIONS_SUPPORT 1 -#elif defined(HAVE_MACH_O_DYLD_H) -# define DL_LOAD(libname) zend_mh_bundle_load(libname) -# define DL_UNLOAD zend_mh_bundle_unload -# define DL_FETCH_SYMBOL(h,s) zend_mh_bundle_symbol(h,s) -# define DL_ERROR zend_mh_bundle_error -# define DL_HANDLE void * -# define ZEND_EXTENSIONS_SUPPORT 1 #elif defined(ZEND_WIN32) # define DL_LOAD(libname) LoadLibrary(libname) # define DL_FETCH_SYMBOL GetProcAddress Modified: php/php-src/branches/PHP_5_3/Zend/zend_API.c === --- php/php-src/branches/PHP_5_3/Zend/zend_API.c 2009-08-06 00:10:46 UTC (rev 286858) +++ php/php-src/branches/PHP_5_3/Zend/zend_API.c 2009-08-06 01:33:54 UTC (rev 286859) @@ -2114,7 +2114,7 @@ zend_unregister_functions(module-functions, -1, NULL TSRMLS_CC); } -#if HAVE_LIBDL || defined(HAVE_MACH_O_DYLD_H) +#if HAVE_LIBDL #if !(defined(NETWARE) defined(APACHE_1_BUILD)) if (module-handle) { DL_UNLOAD(module-handle); Modified: php/php-src/branches/PHP_5_3/Zend/zend_extensions.c === --- php/php-src/branches/PHP_5_3/Zend/zend_extensions.c 2009-08-06 00:10:46 UTC (rev 286858) +++ php/php-src/branches/PHP_5_3/Zend/zend_extensions.c 2009-08-06 01:33:54 UTC (rev 286859) @@ -218,67 +218,6 @@ } /* - * Support for dynamic loading of MH_BUNDLEs on Darwin / Mac OS X - * - */ - -#if HAVE_MACH_O_DYLD_H - -void *zend_mh_bundle_load(char* bundle_path) -{ - NSObjectFileImage bundle_image; - NSModule bundle_handle; - NSSymbol bundle_init_nssymbol; - void (*bundle_init)(void); - - if (NSCreateObjectFileImageFromFile(bundle_path, bundle_image) != NSObjectFileImageSuccess) { - return NULL; - } - - bundle_handle = NSLinkModule(bundle_image, bundle_path, NSLINKMODULE_OPTION_NONE); - NSDestroyObjectFileImage(bundle_image); - - /* call the init function of the bundle */ - bundle_init_nssymbol = NSLookupSymbolInModule(bundle_handle, __init); - if (bundle_init_nssymbol != NULL) { - bundle_init = NSAddressOfSymbol(bundle_init_nssymbol); - bundle_init(); - } - - return bundle_handle; -} - -int zend_mh_bundle_unload(void *bundle_handle) -{ - NSSymbol bundle_fini_nssymbol; - void (*bundle_fini)(void); - - /* call the fini function of the bundle */ - bundle_fini_nssymbol = NSLookupSymbolInModule(bundle_handle, __fini); - if
[PHP-CVS] svn: /php/php-src/trunk/ext/standard/ dns.c php_dns.h
scottmac Thu, 06 Aug 2009 04:37:07 + Revision: http://svn.php.net/viewvc?view=revisionrevision=286865 Log: Deal with moving to res_nsearch(). dns_search() on OSX lacks an error handler, might revert to using straight bind9. Changed paths: U php/php-src/trunk/ext/standard/dns.c U php/php-src/trunk/ext/standard/php_dns.h Modified: php/php-src/trunk/ext/standard/dns.c === --- php/php-src/trunk/ext/standard/dns.c2009-08-06 04:33:18 UTC (rev 286864) +++ php/php-src/trunk/ext/standard/dns.c2009-08-06 04:37:07 UTC (rev 286865) @@ -809,10 +809,14 @@ n = php_dns_search(handle, hostname, C_IN, type_to_fetch, answer.qb2, sizeof answer); - if (n 0 ) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, res_nsearch() failed); + if (n 0) { + if (php_dns_errno(handle) == NO_DATA) { + php_dns_free_handle(handle); + continue; + } + + php_dns_free_handle(handle); zval_dtor(return_value); - php_dns_free_handle(handle); RETURN_FALSE; } @@ -845,33 +849,33 @@ add_next_index_zval(return_value, retval); } } - php_dns_free_handle(handle); - } - } - if (authns || addtl) { - /* List of Authoritative Name Servers -* Process when only requesting addtl so that we can skip through the section -*/ - while (ns-- 0 cp cp end) { - zval *retval = NULL; + if (authns || addtl) { + /* List of Authoritative Name Servers +* Process when only requesting addtl so that we can skip through the section +*/ + while (ns-- 0 cp cp end) { + zval *retval = NULL; - cp = php_parserr(cp, answer, DNS_T_ANY, authns != NULL, retval TSRMLS_CC); - if (retval != NULL) { - add_next_index_zval(authns, retval); + cp = php_parserr(cp, answer, DNS_T_ANY, authns != NULL, retval TSRMLS_CC); + if (retval != NULL) { + add_next_index_zval(authns, retval); + } + } } - } - } - if (addtl) { - /* Additional records associated with authoritative name servers */ - while (ar-- 0 cp cp end) { - zval *retval = NULL; + if (addtl) { + /* Additional records associated with authoritative name servers */ + while (ar-- 0 cp cp end) { + zval *retval = NULL; - cp = php_parserr(cp, answer, DNS_T_ANY, 1, retval TSRMLS_CC); - if (retval != NULL) { - add_next_index_zval(addtl, retval); + cp = php_parserr(cp, answer, DNS_T_ANY, 1, retval TSRMLS_CC); + if (retval != NULL) { + add_next_index_zval(addtl, retval); + } + } } + php_dns_free_handle(handle); } } } Modified: php/php-src/trunk/ext/standard/php_dns.h === --- php/php-src/trunk/ext/standard/php_dns.h2009-08-06 04:33:18 UTC (rev 286864) +++ php/php-src/trunk/ext/standard/php_dns.h2009-08-06 04:37:07 UTC (rev 286865) @@ -28,17 +28,25 @@ ((int)dns_search(res, dname, class, type, answer, anslen, (struct sockaddr *)from, fromsize)) #define php_dns_free_handle(res) \ dns_free(res) +#define php_dns_errno(_res) \ + (NO_DATA) #elif defined(HAVE_RES_NSEARCH) #define php_dns_search(res, dname, class, type, answer, anslen) \ res_nsearch(res, dname, class, type, answer, anslen) -#define php_dns_free_handle(res) \ - res_nclose(res) +#define php_dns_free_handle(res) \ + res_nclose(res); \ +
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/json/ JSON_parser.h json.c
scottmac Mon, 27 Jul 2009 03:43:38 + Revision: http://svn.php.net/viewvc?view=revisionrevision=286385 Log: MFH: Add error constant when json_encode detects an invalid UTF-8 sequence. Changed paths: U php/php-src/branches/PHP_5_3/ext/json/JSON_parser.h U php/php-src/branches/PHP_5_3/ext/json/json.c Modified: php/php-src/branches/PHP_5_3/ext/json/JSON_parser.h === --- php/php-src/branches/PHP_5_3/ext/json/JSON_parser.h 2009-07-27 03:31:00 UTC (rev 286384) +++ php/php-src/branches/PHP_5_3/ext/json/JSON_parser.h 2009-07-27 03:43:38 UTC (rev 286385) @@ -24,6 +24,7 @@ PHP_JSON_ERROR_STATE_MISMATCH, PHP_JSON_ERROR_CTRL_CHAR, PHP_JSON_ERROR_SYNTAX, +PHP_JSON_ERROR_UTF8 }; extern JSON_parser new_JSON_parser(int depth); Modified: php/php-src/branches/PHP_5_3/ext/json/json.c === --- php/php-src/branches/PHP_5_3/ext/json/json.c2009-07-27 03:31:00 UTC (rev 286384) +++ php/php-src/branches/PHP_5_3/ext/json/json.c2009-07-27 03:43:38 UTC (rev 286385) @@ -301,6 +301,7 @@ efree(utf16); } if (len 0) { + JSON_G(error_code) = PHP_JSON_ERROR_UTF8; if (!PG(display_errors)) { php_error_docref(NULL TSRMLS_CC, E_WARNING, Invalid UTF-8 sequence in argument); } @@ -413,6 +414,7 @@ PHP_JSON_API void php_json_encode(smart_str *buf, zval *val, int options TSRMLS_DC) /* {{{ */ { + JSON_G(error_code) = PHP_JSON_ERROR_NONE; switch (Z_TYPE_P(val)) { case IS_NULL: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/hash hash_adler32.c
scottmacTue Jun 30 12:49:54 2009 UTC Modified files: /php-src/ext/hash hash_adler32.c Log: Fix bug #48284 - adler32 is in the wrong order. Changed to match what zlib produces. http://cvs.php.net/viewvc.cgi/php-src/ext/hash/hash_adler32.c?r1=1.11r2=1.12diff_format=u Index: php-src/ext/hash/hash_adler32.c diff -u php-src/ext/hash/hash_adler32.c:1.11 php-src/ext/hash/hash_adler32.c:1.12 --- php-src/ext/hash/hash_adler32.c:1.11Tue Mar 10 23:39:18 2009 +++ php-src/ext/hash/hash_adler32.c Tue Jun 30 12:49:54 2009 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: hash_adler32.c,v 1.11 2009/03/10 23:39:18 helly Exp $ */ +/* $Id: hash_adler32.c,v 1.12 2009/06/30 12:49:54 scottmac Exp $ */ #include php_hash.h #include php_hash_adler32.h @@ -42,10 +42,10 @@ PHP_HASH_API void PHP_ADLER32Final(unsigned char digest[4], PHP_ADLER32_CTX *context) { - digest[3] = (unsigned char) ((context-state 24) 0xff); - digest[2] = (unsigned char) ((context-state 16) 0xff); - digest[1] = (unsigned char) ((context-state 8) 0xff); - digest[0] = (unsigned char) (context-state 0xff); + digest[0] = (unsigned char) ((context-state 24) 0xff); + digest[1] = (unsigned char) ((context-state 16) 0xff); + digest[2] = (unsigned char) ((context-state 8) 0xff); + digest[3] = (unsigned char) (context-state 0xff); context-state = 0; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/hash/tests adler32.phpt hash_copy_001.phpt hash_file_basic1.phpt hash_hmac_basic.phpt hash_hmac_file_basic.phpt
scottmacTue Jun 30 12:50:17 2009 UTC Modified files: /php-src/ext/hash/tests adler32.phpt hash_copy_001.phpt hash_file_basic1.phpt hash_hmac_basic.phpt hash_hmac_file_basic.phpt Log: Fix tests for bug #48284 - adler32 is in the wrong order. http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/adler32.phpt?r1=1.4r2=1.5diff_format=u Index: php-src/ext/hash/tests/adler32.phpt diff -u php-src/ext/hash/tests/adler32.phpt:1.4 php-src/ext/hash/tests/adler32.phpt:1.5 --- php-src/ext/hash/tests/adler32.phpt:1.4 Mon Oct 2 01:38:05 2006 +++ php-src/ext/hash/tests/adler32.phpt Tue Jun 30 12:50:16 2009 @@ -13,10 +13,10 @@ echo hash('adler32', '12345678901234567890123456789012345678901234567890123456789012345678901234567890'), \n; ? --EXPECT-- -0100 -62006200 -27014d02 -86057529 -200b8690 -0c15db8a -6910b697 +0001 +00620062 +024d0127 +29750586 +90860b20 +8adb150c +97b61069 http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/hash_copy_001.phpt?r1=1.5r2=1.6diff_format=u Index: php-src/ext/hash/tests/hash_copy_001.phpt diff -u php-src/ext/hash/tests/hash_copy_001.phpt:1.5 php-src/ext/hash/tests/hash_copy_001.phpt:1.6 --- php-src/ext/hash/tests/hash_copy_001.phpt:1.5 Sat Dec 27 01:04:09 2008 +++ php-src/ext/hash/tests/hash_copy_001.phpt Tue Jun 30 12:50:16 2009 @@ -71,8 +71,8 @@ unicode(64) fbe88daa74c89b9e29468fa3cd3a657d31845e21bb58dd3f8d806f5179a85c26 unicode(64) 5820c7c4a0650587538b30ef4099f2b5993069758d5c847a552e6ef7360766a5 unicode(64) 5820c7c4a0650587538b30ef4099f2b5993069758d5c847a552e6ef7360766a5 -unicode(8) 28097c6f -unicode(8) 28097c6f +unicode(8) 6f7c0928 +unicode(8) 6f7c0928 unicode(8) e5cfc160 unicode(8) e5cfc160 unicode(8) 69147a4e @@ -155,8 +155,8 @@ unicode(64) 614ca924864fa0e8fa309aa0944e047d5edbfd4964a35858f4d8ec66a0fb88b0 unicode(64) 5820c7c4a0650587538b30ef4099f2b5993069758d5c847a552e6ef7360766a5 unicode(64) a00961e371287c71c527a41c14564f13b6ed12ac7cd9d5f5dfb3542a25e28d3b -unicode(8) 28097c6f -unicode(8) 471714d9 +unicode(8) 6f7c0928 +unicode(8) d9141747 unicode(8) e5cfc160 unicode(8) 59f8d3d2 unicode(8) 69147a4e http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/hash_file_basic1.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/hash/tests/hash_file_basic1.phpt diff -u php-src/ext/hash/tests/hash_file_basic1.phpt:1.1 php-src/ext/hash/tests/hash_file_basic1.phpt:1.2 --- php-src/ext/hash/tests/hash_file_basic1.phpt:1.1Wed Jan 7 14:30:06 2009 +++ php-src/ext/hash/tests/hash_file_basic1.phptTue Jun 30 12:50:16 2009 @@ -61,7 +61,7 @@ ===Done=== --EXPECTF-- *** Testing hash_file() : basic functionality *** -adler32: 2e2287ff +adler32: ff87222e crc32: 61664d33 gost: d9e65f0c0c2ef944e4f8a01f4a46365c4f33a2853756878182a7f03e1490a4cd haval128,3: 8bb81269aca8b7f87829020d76a4e841 @@ -79,7 +79,7 @@ snefru: d414b2345d3e7fa1a31c044cf334bfc1fec24d89e464411998d579d24663895f tiger192,3: c6fa75a0be4ecf7afa3cafb4e2a08efc3a40534c0e46b971 whirlpool: 4248b149e000477269a4a5f1a84d97cfc3d0199b7aaf505913e6f010a6f83276029d11a9ad545374bc710eb59c7d958985023ab886ffa9ec9a23852844c764ec -adler32(raw): 2e2287ff +adler32(raw): ff87222e md5(raw): 704bf818448f5bbb94061332d2c889aa sha256(raw): a0f5702fa5d3670b80033d668e8732b70550392abb53841355447f8bb0f72245 -===Done=== \ No newline at end of file +===Done=== http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/hash_hmac_basic.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/hash/tests/hash_hmac_basic.phpt diff -u php-src/ext/hash/tests/hash_hmac_basic.phpt:1.1 php-src/ext/hash/tests/hash_hmac_basic.phpt:1.2 --- php-src/ext/hash/tests/hash_hmac_basic.phpt:1.1 Wed Jan 7 14:30:06 2009 +++ php-src/ext/hash/tests/hash_hmac_basic.phpt Tue Jun 30 12:50:16 2009 @@ -42,7 +42,7 @@ ===Done=== --EXPECTF-- *** Testing hash_hmac() : basic functionality *** -adler32: 9e033311 +adler32: 12c803f7 crc32: 96859101 gost: a4a3c80bdf3f8665bf07376a34dc9c1b11af7c813f4928f62e39f0c0dc564dad haval128,3: 82cd0f4bd36729b5c80c33efa8c13ac5 @@ -60,7 +60,7 @@ snefru: 67af483046f9cf16fe19f9087929ccfc6ad176ade3290b4d33f43e0ddb07e711 tiger192,3: 82779797cdc439e886884953ba21fa38e35679041e95ee27 whirlpool: 4a0f1582b21b7aff59bfba7f9c29131c69741b2ce80acdc7d314040f3b768cf5a17e30b74cceb86fbc6b34b1692e0addd5bfd7cfc043d40c0621f1b97e26fa49 -adler32(raw): 9e033311 +adler32(raw): 12c803f7 md5(raw): 2a632783e2812cf23de100d7d6a463ae sha256(raw): 49bde3496b9510a17d0edd8a4b0ac70148e32a1d51e881ec76faa96534125838 -===Done=== \ No newline at end of file +===Done=== http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/hash_hmac_file_basic.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/hash/tests/hash_hmac_file_basic.phpt diff -u php-src/ext/hash/tests/hash_hmac_file_basic.phpt:1.1 php-src/ext/hash/tests/hash_hmac_file_basic.phpt:1.2 --- php-src/ext/hash/tests/hash_hmac_file_basic.phpt:1.1Wed Jan 7 14:30:06 2009 +++
[PHP-CVS] cvs: php-src(PHP_5_3) /ext/hash hash_adler32.c /ext/hash/tests adler32.phpt hash_copy_001.phpt hash_file_basic1.phpt hash_hmac_basic.phpt hash_hmac_file_basic.phpt
scottmacTue Jun 30 13:21:54 2009 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/hash hash_adler32.c /php-src/ext/hash/tests adler32.phpt hash_copy_001.phpt hash_file_basic1.phpt hash_hmac_basic.phpt hash_hmac_file_basic.phpt Log: MFH Fix bug #48284 - adler32 is in the wrong order. Changed to match what zlib produces. http://cvs.php.net/viewvc.cgi/php-src/ext/hash/hash_adler32.c?r1=1.3.2.4.2.2.2.3r2=1.3.2.4.2.2.2.4diff_format=u Index: php-src/ext/hash/hash_adler32.c diff -u php-src/ext/hash/hash_adler32.c:1.3.2.4.2.2.2.3 php-src/ext/hash/hash_adler32.c:1.3.2.4.2.2.2.4 --- php-src/ext/hash/hash_adler32.c:1.3.2.4.2.2.2.3 Wed Dec 31 11:15:37 2008 +++ php-src/ext/hash/hash_adler32.c Tue Jun 30 13:21:53 2009 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: hash_adler32.c,v 1.3.2.4.2.2.2.3 2008/12/31 11:15:37 sebastian Exp $ */ +/* $Id: hash_adler32.c,v 1.3.2.4.2.2.2.4 2009/06/30 13:21:53 scottmac Exp $ */ #include php_hash.h #include php_hash_adler32.h @@ -42,10 +42,10 @@ PHP_HASH_API void PHP_ADLER32Final(unsigned char digest[4], PHP_ADLER32_CTX *context) { - digest[3] = (unsigned char) ((context-state 24) 0xff); - digest[2] = (unsigned char) ((context-state 16) 0xff); - digest[1] = (unsigned char) ((context-state 8) 0xff); - digest[0] = (unsigned char) (context-state 0xff); + digest[0] = (unsigned char) ((context-state 24) 0xff); + digest[1] = (unsigned char) ((context-state 16) 0xff); + digest[2] = (unsigned char) ((context-state 8) 0xff); + digest[3] = (unsigned char) (context-state 0xff); context-state = 0; } http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/adler32.phpt?r1=1.1.2.1r2=1.1.2.1.4.1diff_format=u Index: php-src/ext/hash/tests/adler32.phpt diff -u php-src/ext/hash/tests/adler32.phpt:1.1.2.1 php-src/ext/hash/tests/adler32.phpt:1.1.2.1.4.1 --- php-src/ext/hash/tests/adler32.phpt:1.1.2.1 Sat Dec 3 10:31:01 2005 +++ php-src/ext/hash/tests/adler32.phpt Tue Jun 30 13:21:53 2009 @@ -13,10 +13,10 @@ echo hash('adler32', '12345678901234567890123456789012345678901234567890123456789012345678901234567890'), \n; ? --EXPECT-- -0100 -62006200 -27014d02 -86057529 -200b8690 -0c15db8a -6910b697 +0001 +00620062 +024d0127 +29750586 +90860b20 +8adb150c +97b61069 http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/hash_copy_001.phpt?r1=1.1.2.5r2=1.1.2.6diff_format=u Index: php-src/ext/hash/tests/hash_copy_001.phpt diff -u php-src/ext/hash/tests/hash_copy_001.phpt:1.1.2.5 php-src/ext/hash/tests/hash_copy_001.phpt:1.1.2.6 --- php-src/ext/hash/tests/hash_copy_001.phpt:1.1.2.5 Sat Dec 27 01:05:07 2008 +++ php-src/ext/hash/tests/hash_copy_001.phpt Tue Jun 30 13:21:53 2009 @@ -71,8 +71,8 @@ string(64) fbe88daa74c89b9e29468fa3cd3a657d31845e21bb58dd3f8d806f5179a85c26 string(64) 5820c7c4a0650587538b30ef4099f2b5993069758d5c847a552e6ef7360766a5 string(64) 5820c7c4a0650587538b30ef4099f2b5993069758d5c847a552e6ef7360766a5 -string(8) 28097c6f -string(8) 28097c6f +string(8) 6f7c0928 +string(8) 6f7c0928 string(8) e5cfc160 string(8) e5cfc160 string(8) 69147a4e @@ -155,8 +155,8 @@ string(64) 614ca924864fa0e8fa309aa0944e047d5edbfd4964a35858f4d8ec66a0fb88b0 string(64) 5820c7c4a0650587538b30ef4099f2b5993069758d5c847a552e6ef7360766a5 string(64) a00961e371287c71c527a41c14564f13b6ed12ac7cd9d5f5dfb3542a25e28d3b -string(8) 28097c6f -string(8) 471714d9 +string(8) 6f7c0928 +string(8) d9141747 string(8) e5cfc160 string(8) 59f8d3d2 string(8) 69147a4e http://cvs.php.net/viewvc.cgi/php-src/ext/hash/tests/hash_file_basic1.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u Index: php-src/ext/hash/tests/hash_file_basic1.phpt diff -u php-src/ext/hash/tests/hash_file_basic1.phpt:1.1.2.2 php-src/ext/hash/tests/hash_file_basic1.phpt:1.1.2.3 --- php-src/ext/hash/tests/hash_file_basic1.phpt:1.1.2.2Wed Jan 7 14:32:46 2009 +++ php-src/ext/hash/tests/hash_file_basic1.phptTue Jun 30 13:21:53 2009 @@ -61,7 +61,7 @@ ===Done=== --EXPECTF-- *** Testing hash_file() : basic functionality *** -adler32: 2e2287ff +adler32: ff87222e crc32: 61664d33 gost: d9e65f0c0c2ef944e4f8a01f4a46365c4f33a2853756878182a7f03e1490a4cd haval128,3: 8bb81269aca8b7f87829020d76a4e841 @@ -79,7 +79,7 @@ snefru: d414b2345d3e7fa1a31c044cf334bfc1fec24d89e464411998d579d24663895f tiger192,3: c6fa75a0be4ecf7afa3cafb4e2a08efc3a40534c0e46b971 whirlpool: 4248b149e000477269a4a5f1a84d97cfc3d0199b7aaf505913e6f010a6f83276029d11a9ad545374bc710eb59c7d958985023ab886ffa9ec9a23852844c764ec -adler32(raw): 2e2287ff +adler32(raw): ff87222e md5(raw): 704bf818448f5bbb94061332d2c889aa sha256(raw): a0f5702fa5d3670b80033d668e8732b70550392abb53841355447f8bb0f72245 -===Done=== \ No newline at end of file +===Done===
Re: [PHP-CVS] cvs: php-src(PHP_5_2) /ext/sqlite sqlite.c /ext/sqlite/tests bug48679.phpt
On 25 Jun 2009, at 10:40, Johannes Schlüter wrote: Scott, On Thu, 2009-06-25 at 00:07 +, Scott MacVicar wrote: scottmacThu Jun 25 00:07:21 2009 UTC Added files: (Branch: PHP_5_2) [...] --EXPECT-- unicode(41) Row count is not available for this query Done I doubt that works in this branch, and I think this branch deserves a NEWS entry. The commit email is wrong, it definitely says string(41) in CVS and no one changed it. Scott -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/sqlite sqlite.c /ext/sqlite/tests bug48679.phpt
scottmacThu Jun 25 00:04:07 2009 UTC Added files: /php-src/ext/sqlite/tests bug48679.phpt Modified files: /php-src/ext/sqlite sqlite.c Log: Fix bug #48679 - Crash in SQLite with count on an unbuffered query set http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/sqlite.c?r1=1.227r2=1.228diff_format=u Index: php-src/ext/sqlite/sqlite.c diff -u php-src/ext/sqlite/sqlite.c:1.227 php-src/ext/sqlite/sqlite.c:1.228 --- php-src/ext/sqlite/sqlite.c:1.227 Mon May 25 14:32:15 2009 +++ php-src/ext/sqlite/sqlite.c Thu Jun 25 00:04:07 2009 @@ -17,7 +17,7 @@ | Marcus Boerger he...@php.net | +--+ - $Id: sqlite.c,v 1.227 2009/05/25 14:32:15 felipe Exp $ + $Id: sqlite.c,v 1.228 2009/06/25 00:04:07 scottmac Exp $ */ #ifdef HAVE_CONFIG_H @@ -1550,7 +1550,7 @@ { php_info_print_table_start(); php_info_print_table_header(2, SQLite support, enabled); - php_info_print_table_row(2, PECL Module version, PHP_SQLITE_MODULE_VERSION $Id: sqlite.c,v 1.227 2009/05/25 14:32:15 felipe Exp $); + php_info_print_table_row(2, PECL Module version, PHP_SQLITE_MODULE_VERSION $Id: sqlite.c,v 1.228 2009/06/25 00:04:07 scottmac Exp $); php_info_print_table_row(2, SQLite Library, sqlite_libversion()); php_info_print_table_row(2, SQLite Encoding, sqlite_libencoding()); php_info_print_table_end(); @@ -3021,6 +3021,11 @@ { sqlite_object *obj = (sqlite_object*) zend_object_store_get_object(object TSRMLS_CC); + if (obj-u.res == NULL) { + zend_throw_exception(sqlite_ce_exception, Row count is not available for this query, 0 TSRMLS_CC); + return FAILURE; + } + if (obj-u.res-buffered) { * count = obj-u.res-nrows; return SUCCESS; http://cvs.php.net/viewvc.cgi/php-src/ext/sqlite/tests/bug48679.phpt?view=markuprev=1.1 Index: php-src/ext/sqlite/tests/bug48679.phpt +++ php-src/ext/sqlite/tests/bug48679.phpt --TEST-- Bug #48679 (sqlite2 count on unbuffered query causes segfault) --SKIPIF-- ?php if (!extension_loaded(sqlite)) print skip; ? --FILE-- ?php try { $x = new sqliteunbuffered; count($x); } catch (SQLiteException $e) { var_dump($e-getMessage()); } echo Done\n; ? --EXPECT-- unicode(41) Row count is not available for this query Done -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php