[PHP-CVS] com php-src: Renumber the comments in php_request_shutdown() to be in order.: main/main.c
Commit:de3b9bc77c046625f743d556854eccfdddf5bf23 Author:Adam Harvey Wed, 4 Dec 2013 14:29:13 -0800 Parents: 0cb38a3d2606740b0b3c048351632f250a855909 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=de3b9bc77c046625f743d556854eccfdddf5bf23 Log: Renumber the comments in php_request_shutdown() to be in order. What, me OCD? Changed paths: M main/main.c Diff: diff --git a/main/main.c b/main/main.c index 20a7d88..6f7e149 100644 --- a/main/main.c +++ b/main/main.c @@ -1793,7 +1793,7 @@ void php_request_shutdown(void *dummy) } } zend_end_try(); - /* 7.5 free last error information */ + /* 8. free last error information */ if (PG(last_error_message)) { free(PG(last_error_message)); PG(last_error_message) = NULL; @@ -1803,34 +1803,34 @@ void php_request_shutdown(void *dummy) PG(last_error_file) = NULL; } - /* 7. Shutdown scanner/executor/compiler and restore ini entries */ + /* 9. Shutdown scanner/executor/compiler and restore ini entries */ zend_deactivate(TSRMLS_C); - /* 8. Call all extensions post-RSHUTDOWN functions */ + /* 10. Call all extensions post-RSHUTDOWN functions */ zend_try { zend_post_deactivate_modules(TSRMLS_C); } zend_end_try(); - /* 9. SAPI related shutdown (free stuff) */ + /* 11. SAPI related shutdown (free stuff) */ zend_try { sapi_deactivate(TSRMLS_C); } zend_end_try(); - /* 9.5 free virtual CWD memory */ + /* 12. free virtual CWD memory */ virtual_cwd_deactivate(TSRMLS_C); - /* 10. Destroy stream hashes */ + /* 13. Destroy stream hashes */ zend_try { php_shutdown_stream_hashes(TSRMLS_C); } zend_end_try(); - /* 11. Free Willy (here be crashes) */ + /* 14. Free Willy (here be crashes) */ zend_try { shutdown_memory_manager(CG(unclean_shutdown) || !report_memleaks, 0 TSRMLS_CC); } zend_end_try(); zend_interned_strings_restore(TSRMLS_C); - /* 12. Reset max_execution_time */ + /* 15. Reset max_execution_time */ zend_try { zend_unset_timeout(TSRMLS_C); } zend_end_try(); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Make all code paths in json_determine_array_type() return constants.: ext/json/json.c
Commit:90d4ae4da8f5a81e136cad26d9612a8f78d14f2d Author:Adam Harvey Sat, 9 Nov 2013 12:15:37 -0500 Parents: 43cb6ba7639aacf08f5e6a46428b12f5df303f6f Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=90d4ae4da8f5a81e136cad26d9612a8f78d14f2d Log: Make all code paths in json_determine_array_type() return constants. This is a purely cosmetic change, but the current behaviour of returning PHP_JSON_OUTPUT_ARRAY and 1 looks weird. Changed paths: M ext/json/json.c Diff: diff --git a/ext/json/json.c b/ext/json/json.c index 782375e..90ca50d 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -190,10 +190,10 @@ static int json_determine_array_type(zval **val TSRMLS_DC) /* {{{ */ } if (i == HASH_KEY_IS_STRING) { - return 1; + return PHP_JSON_OUTPUT_OBJECT; } else { if (index != idx) { - return 1; + return PHP_JSON_OUTPUT_OBJECT; } } idx++; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com php-src: Added function opcache_compile_file() to load PHP scripts into cache without execution.: NEWS ext/opcache/ZendAccelerator.c ext/opcache/ZendAccelerator.h ext/opcache/zend_ac
On 25 September 2013 01:14, Dmitry Stogov wrote: > + zend_try { > + op_array = persistent_compile_file(&handle, ZEND_INCLUDE > TSRMLS_CC); > + } zend_catch { > + EG(current_execute_data) = orig_execute_data; > + zend_error(E_WARNING, ACCELERATOR_PRODUCT_NAME " could not > compile file %s" TSRMLS_CC, handle.filename); > + } zend_end_try(); I'm writing the documentation for this, and I'm wondering: does the warning serve any purpose here? Is there an intended situation where opcache_compile_file() would return false and wouldn't generate a warning? (I can see some code paths in persistent_compile_file() that probably result in that, but I don't know how intentional that is.) If there isn't, I'm thinking it would be better to just return false without the warning — users who are doing error handling and have error reporting on don't need to use @ in that case. I know that's a constant irritant for me when I'm writing code that uses fopen(), for instance. :) Adam -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix typo: HTTP_ROW_POST_DATA → HTTP_RAW_POST_DATA.: UPGRADING
Commit:8d087dc0d7c88e26539646875dc0f7bb5042187b Author:Adam Harvey Mon, 23 Sep 2013 13:30:47 -0700 Parents: c760ff1615ba8da301d4ba109bf5fd3193c8b5e2 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8d087dc0d7c88e26539646875dc0f7bb5042187b Log: Fix typo: HTTP_ROW_POST_DATA → HTTP_RAW_POST_DATA. Fixes bug #65745 (Typo in commit 4a3936ef4abdeb72c7d323fe4b6a65e1ae0ef181). Bugs: https://bugs.php.net/65745 Changed paths: M UPGRADING Diff: diff --git a/UPGRADING b/UPGRADING index f5e7cd0..581a38e 100755 --- a/UPGRADING +++ b/UPGRADING @@ -26,7 +26,7 @@ PHP X.Y UPGRADE NOTES -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Copy dba_*() keys before converting to string.: NEWS ext/dba/dba.c ext/dba/tests/bug65708.phpt
Commit:30e0442c549bd20288ca8754daa0cdf24d98f055 Author:Adam Harvey Sun, 22 Sep 2013 16:46:17 -0700 Parents: cc66eaa04b123bdfb6aaa7305713fa508640999e Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=30e0442c549bd20288ca8754daa0cdf24d98f055 Log: Copy dba_*() keys before converting to string. A nice Sunday afternoon project for somebody would be to refactor the dba functions to use zend_parse_parameters() reliably and try to untangle some of the macros in dba.c. Sadly, it is not a nice Sunday afternoon here. Fixes bug #65708 (dba functions cast $key param to string in-place, bypassing copy on write). Bugs: https://bugs.php.net/65708 Changed paths: M NEWS M ext/dba/dba.c A ext/dba/tests/bug65708.phpt Diff: diff --git a/NEWS b/NEWS index bb170e7..e176325 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,10 @@ PHP NEWS . Fixed bug #64157 (DateTime::createFromFormat() reports confusing error message). (Boro Sitnikovski) +- DBA extension: + . Fixed bug #65708 (dba functions cast $key param to string in-place, +bypassing copy on write). (Adam) + - Filter: . Add RFC 6598 IPs to reserved addresses. (Sebastian Nohn) . Fixed bug #64441 (FILTER_VALIDATE_URL rejects fully qualified domain names). diff --git a/ext/dba/dba.c b/ext/dba/dba.c index 8005101..50a94dd 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -226,12 +226,17 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS *key_free = *key_str; return len; } else { - *key_free = NULL; + zval tmp = *key; + int len; - convert_to_string(key); - *key_str = Z_STRVAL_P(key); + zval_copy_ctor(&tmp); + convert_to_string(&tmp); - return Z_STRLEN_P(key); + *key_free = *key_str = estrndup(Z_STRVAL(tmp), Z_STRLEN(tmp)); + len = Z_STRLEN(tmp); + + zval_dtor(&tmp); + return len; } } /* }}} */ @@ -297,6 +302,14 @@ static size_t php_dba_make_key(zval *key, char **key_str, char **key_free TSRMLS RETURN_FALSE; \ } +/* the same check, but with a call to DBA_ID_DONE before returning */ +#define DBA_WRITE_CHECK_WITH_ID \ + if(info->mode != DBA_WRITER && info->mode != DBA_TRUNC && info->mode != DBA_CREAT) { \ + php_error_docref(NULL TSRMLS_CC, E_WARNING, "You cannot perform a modification to a database without proper access"); \ + DBA_ID_DONE; \ + RETURN_FALSE; \ + } + /* }}} */ /* {{{ globals */ @@ -557,7 +570,7 @@ static void php_dba_update(INTERNAL_FUNCTION_PARAMETERS, int mode) DBA_FETCH_RESOURCE(info, &id); - DBA_WRITE_CHECK; + DBA_WRITE_CHECK_WITH_ID; if (info->hnd->update(info, key_str, key_len, val, val_len, mode TSRMLS_CC) == SUCCESS) { DBA_ID_DONE; @@ -1110,7 +1123,7 @@ PHP_FUNCTION(dba_delete) { DBA_ID_GET2; - DBA_WRITE_CHECK; + DBA_WRITE_CHECK_WITH_ID; if(info->hnd->delete(info, key_str, key_len TSRMLS_CC) == SUCCESS) { diff --git a/ext/dba/tests/bug65708.phpt b/ext/dba/tests/bug65708.phpt new file mode 100644 index 000..b77138f --- /dev/null +++ b/ext/dba/tests/bug65708.phpt @@ -0,0 +1,38 @@ +--TEST-- +Bug #65708 (dba functions cast $key param to string in-place, bypassing copy on write) +--SKIPIF-- + +--FILE-- + +--CLEAN-- + +--EXPECT-- +integer +integer +integer +integer -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: NEWS
Commit:a92a350ccef7b295a5d7d8404771ae9bb8f602d3 Author:Adam Harvey Sun, 22 Sep 2013 16:52:41 -0700 Parents: 3f64d35559241fa69b95052faaa4ae93e745c1c6 30e0442c549bd20288ca8754daa0cdf24d98f055 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a92a350ccef7b295a5d7d8404771ae9bb8f602d3 Log: Merge branch 'PHP-5.4' into PHP-5.5 * PHP-5.4: Copy dba_*() keys before converting to string. Changed paths: MM NEWS Diff: diff --cc NEWS index aa3f8d2,e176325..e02d1b9 --- a/NEWS +++ b/NEWS @@@ -5,17 -5,19 +5,21 @@@ PH - CLI server: . Fixed bug #65633 (built-in server treat some http headers as case-sensitive). (Adam) + . Added application/pdf to PHP CLI Web Server mime types (Chris Jones) - Datetime: - . Fixed bug #64157 (DateTime::createFromFormat() reports confusing error -message). (Boro Sitnikovski) + . Fixed bug #65502 (DateTimeImmutable::createFromFormat returns DateTime). +(Boro Sitnikovski) + . Fixed bug #65548 (Comparison for DateTimeImmutable doesn't work). +(Boro Sitnikovski) + - DBA extension: + . Fixed bug #65708 (dba functions cast $key param to string in-place, + bypassing copy on write). (Adam) + -- Filter: - . Add RFC 6598 IPs to reserved addresses. (Sebastian Nohn) - . Fixed bug #64441 (FILTER_VALIDATE_URL rejects fully qualified domain names). -(Syra) +- GD + . Ensure that the defined interpolation method is used with the generic +scaling methods. (Pierre) - IMAP: . Fixed bug #65721 (configure script broken in 5.5.4 and 5.4.20 when enabling -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: NEWS ext/imap/config.m4
Commit:3f64d35559241fa69b95052faaa4ae93e745c1c6 Author:Adam Harvey Fri, 20 Sep 2013 14:19:01 -0700 Parents: 8f146c2bb0dcba3307f08a839554be056e660f34 cc66eaa04b123bdfb6aaa7305713fa508640999e Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3f64d35559241fa69b95052faaa4ae93e745c1c6 Log: Merge branch 'PHP-5.4' into PHP-5.5 * PHP-5.4: Fix the broken sh syntax in ext/imap/config.m4. Changed paths: MM NEWS MM ext/imap/config.m4 Diff: diff --cc NEWS index 7b37e07,bb170e7..aa3f8d2 --- a/NEWS +++ b/NEWS @@@ -5,28 -5,21 +5,32 @@@ PH - CLI server: . Fixed bug #65633 (built-in server treat some http headers as case-sensitive). (Adam) + . Added application/pdf to PHP CLI Web Server mime types (Chris Jones) - Datetime: - . Fixed bug #64157 (DateTime::createFromFormat() reports confusing error -message). (Boro Sitnikovski) + . Fixed bug #65502 (DateTimeImmutable::createFromFormat returns DateTime). +(Boro Sitnikovski) + . Fixed bug #65548 (Comparison for DateTimeImmutable doesn't work). +(Boro Sitnikovski) -- Filter: - . Add RFC 6598 IPs to reserved addresses. (Sebastian Nohn) - . Fixed bug #64441 (FILTER_VALIDATE_URL rejects fully qualified domain names). -(Syra) +- GD + . Ensure that the defined interpolation method is used with the generic +scaling methods. (Pierre) + - IMAP: + . Fixed bug #65721 (configure script broken in 5.5.4 and 5.4.20 when enabling + imap). (ryotakatsuki at gmail dot com) + -?? ??? 2013, PHP 5.4.20 +- OPcache: + . Fixed bug #65665 (Exception not properly caught when opcache enabled). +(Laruence) + . Fixed bug #65510 (5.5.2 crashes in _get_zval_ptr_ptr_var). (Dmitry) + +- SPL: + . Fix bug #64782 (SplFileObject constructor make $context optional / give it +a default value). (Nikita) + +?? ??? 2013, PHP 5.5.4 - Core: . Fixed bug #60598 (cli/apache sapi segfault on objects manipulation). -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix the broken sh syntax in ext/imap/config.m4.: NEWS ext/imap/config.m4
Commit:cc66eaa04b123bdfb6aaa7305713fa508640999e Author:Adam Harvey Fri, 20 Sep 2013 14:15:19 -0700 Parents: d5ba2d8a99653521ff6a7997bf9aabe2b016c89a Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cc66eaa04b123bdfb6aaa7305713fa508640999e Log: Fix the broken sh syntax in ext/imap/config.m4. Patch by ryotakatsuki at gmail dot com. Fixes bug #65721 (configure script broken in 5.5.4 and 5.4.20 when enabling imap). Bugs: https://bugs.php.net/65721 Changed paths: M NEWS M ext/imap/config.m4 Diff: diff --git a/NEWS b/NEWS index 6d94980..bb170e7 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,10 @@ PHP NEWS . Fixed bug #64441 (FILTER_VALIDATE_URL rejects fully qualified domain names). (Syra) +- IMAP: + . Fixed bug #65721 (configure script broken in 5.5.4 and 5.4.20 when enabling +imap). (ryotakatsuki at gmail dot com) + ?? ??? 2013, PHP 5.4.20 - Core: diff --git a/ext/imap/config.m4 b/ext/imap/config.m4 index d4dcd4c..3fcf674 100644 --- a/ext/imap/config.m4 +++ b/ext/imap/config.m4 @@ -198,9 +198,9 @@ if test "$PHP_IMAP" != "no"; then AC_MSG_ERROR(Cannot find rfc822.h. Please check your c-client installation.) fi -if test ! -r "$IMAP_DIR/c-client/libc-client.a" && -r "$IMAP_DIR/c-client/c-client.a" ; then +if test ! -r "$IMAP_DIR/c-client/libc-client.a" && test -r "$IMAP_DIR/c-client/c-client.a" ; then ln -s "$IMAP_DIR/c-client/c-client.a" "$IMAP_DIR/c-client/libc-client.a" >/dev/null 2>&1 -elif test ! -r "$IMAP_DIR/$PHP_LIBDIR/libc-client.a" && -r "$IMAP_DIR/$PHP_LIBDIR/c-client.a"; then +elif test ! -r "$IMAP_DIR/$PHP_LIBDIR/libc-client.a" && test -r "$IMAP_DIR/$PHP_LIBDIR/c-client.a"; then ln -s "$IMAP_DIR/$PHP_LIBDIR/c-client.a" "$IMAP_DIR/$PHP_LIBDIR/libc-client.a" >/dev/null 2>&1 fi -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Request non-keep-alive connections by default in HTTP 1.1 requests.: NEWS UPGRADING ext/standard/http_fopen_wrapper.c ext/standard/tests/http/bug65634.phpt
Commit:8983a38d5130c11bd96643dfa2b2f1393ac5969d Author:Adam Harvey Wed, 11 Sep 2013 14:11:29 -0700 Parents: fba290c061027c24e4c8effdba37addd3430c3d4 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8983a38d5130c11bd96643dfa2b2f1393ac5969d Log: Request non-keep-alive connections by default in HTTP 1.1 requests. As noted in FR #65634, at present we don't send a Connection request header when the protocol version is set to 1.1, which means that RFC-compliant Web servers should respond with keep-alive connections. Since there's no way of reusing the HTTP connection at present, this simply means that PHP will appear to hang until the remote server hits its connection timeout, which may be quite some time. This commit sends a "Connection: close" header by default when HTTP 1.1 (or later) is requested by the user via the context options. It can be overridden by specifying a Connection header in the context options. It isn't possible to disable sending of the Connection header, but given "Connection: keep-alive" is the same as the default HTTP 1.1 behaviour, I don't see this as a significant issue — users who want to opt in for that still can. As a note, although I've removed an efree(protocol_version), this doesn't result in a memory leak: protocol_version is freed in the out: block at the end of the function anyway, and there are no returns between the removed efree() and the later call. Yes, I ran the tests with valgrind to check that. ☺ Implements FR #65634 (HTTP wrapper is very slow with protocol_version 1.1). Bugs: https://bugs.php.net/65634 Changed paths: M NEWS M UPGRADING M ext/standard/http_fopen_wrapper.c A ext/standard/tests/http/bug65634.phpt Diff: diff --git a/NEWS b/NEWS index bc39126..3848161 100644 --- a/NEWS +++ b/NEWS @@ -44,4 +44,8 @@ PHP NEWS improvements based on this. (RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita) +- Standard: + . Implemented FR #65634 (HTTP wrapper is very slow with protocol_version +1.1). (Adam) + <<< NOTE: Insert NEWS from last stable release here prior to actual release! >>> diff --git a/UPGRADING b/UPGRADING index f392edd..e9fba51 100755 --- a/UPGRADING +++ b/UPGRADING @@ -98,3 +98,7 @@ PHP X.Y UPGRADE NOTES - File upload: Uploads equal or greater than 2GB in size are now accepted. + +- HTTP stream wrapper: + HTTP 1.1 requests now include a Connection: close header unless explicitly + overridden by setting a Connection header via the header context option. diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index ac6fdad..8762fa4 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -80,6 +80,7 @@ #define HTTP_HEADER_FROM 8 #define HTTP_HEADER_CONTENT_LENGTH 16 #define HTTP_HEADER_TYPE 32 +#define HTTP_HEADER_CONNECTION 64 #define HTTP_WRAPPER_HEADER_INIT1 #define HTTP_WRAPPER_REDIRECTED 2 @@ -386,8 +387,6 @@ finish: strlcat(scratch, " HTTP/", scratch_len); strlcat(scratch, protocol_version, scratch_len); strlcat(scratch, "\r\n", scratch_len); - efree(protocol_version); - protocol_version = NULL; } else { strlcat(scratch, " HTTP/1.0\r\n", scratch_len); } @@ -490,6 +489,11 @@ finish: *(s-1) == '\t' || *(s-1) == ' ')) { have_header |= HTTP_HEADER_TYPE; } + if ((s = strstr(tmp, "connection:")) && + (s == tmp || *(s-1) == '\r' || *(s-1) == '\n' || +*(s-1) == '\t' || *(s-1) == ' ')) { +have_header |= HTTP_HEADER_CONNECTION; + } /* remove Proxy-Authorization header */ if (use_proxy && use_ssl && (s = strstr(tmp, "proxy-authorization:")) && (s == tmp || *(s-1) == '\r' || *(s-1) == '\n' || @@ -563,6 +567,16 @@ finish: } } + /* Send a Connection: close header when using HTTP 1.1 or later to avoid +* hanging when the server interprets the RFC literally and establishes a +* keep-alive connection, unless the user specifically requests something +* else by specifying a Connection header in the context options. */ + if (protocol_version && + ((have_header & HTTP_HEADER_CONNECTION) == 0) && + (strncmp(protoc
[PHP-CVS] com php-src: Sort the NEWS file alphabetically.: NEWS
Commit:59e2ce9ff19540dd85ebe25278a6d5b24a0fac64 Author:Adam Harvey Wed, 11 Sep 2013 14:37:07 -0700 Parents: 8983a38d5130c11bd96643dfa2b2f1393ac5969d Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=59e2ce9ff19540dd85ebe25278a6d5b24a0fac64 Log: Sort the NEWS file alphabetically. Insert OCD otter meme here. Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index 3848161..64ca9a5 100644 --- a/NEWS +++ b/NEWS @@ -14,14 +14,10 @@ PHP NEWS . Implemented FR #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir or safe_mode). (Adam) -- Session: - . Fixed Bug #65315 (session.hash_function silently fallback to default md5) -(Yasuo) - . Implemented Request #54649 (Create session_serializer_name()). (Yasuo) - . Implemented Request #17860 (Session write short circuit). (Yasuo) - . Implemented Request #20421 (session_abort() and session_reset() function). -(Yasuo) - . Implemented Request #11100 (session_gc() function). (Yasuo) +- GMP: + . Moved GMP to use object as the underlying structure and implemented various +improvements based on this. +(RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita) - mysqlnd: . Disabled flag for SP OUT variables for 5.5+ servers as they are not natively @@ -39,10 +35,14 @@ PHP NEWS . Fixed Bug #63657 (pgsqlCopyFromFile, pgsqlCopyToArray use Postgres < 7.3 syntax). (Matteo) -- GMP: - . Moved GMP to use object as the underlying structure and implemented various -improvements based on this. -(RFC: https://wiki.php.net/rfc/operator_overloading_gmp). (Nikita) +- Session: + . Fixed Bug #65315 (session.hash_function silently fallback to default md5) +(Yasuo) + . Implemented Request #54649 (Create session_serializer_name()). (Yasuo) + . Implemented Request #17860 (Session write short circuit). (Yasuo) + . Implemented Request #20421 (session_abort() and session_reset() function). +(Yasuo) + . Implemented Request #11100 (session_gc() function). (Yasuo) - Standard: . Implemented FR #65634 (HTTP wrapper is very slow with protocol_version -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Allow CURLOPT_FOLLOWLOCATION to be used with open_basedir.: NEWS ext/curl/interface.c ext/curl/tests/bug65646.phpt ext/curl/tests/bug65646_open_basedir_new.phpt ext/curl/tests/b
Commit:fba290c061027c24e4c8effdba37addd3430c3d4 Author:Adam Harvey Tue, 10 Sep 2013 11:42:42 -0700 Parents: b8beb657ca725913ab8568eb218691bdd2f838c5 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fba290c061027c24e4c8effdba37addd3430c3d4 Log: Allow CURLOPT_FOLLOWLOCATION to be used with open_basedir. Newer versions of libcurl prevent file:// location response headers by default, which means that the open_basedir check is unnecessary — the fact CURLOPT_REDIR_PROTOCOLS can't set CURLPROTO_FILE with open_basedir enabled means that there's no possibility of breaching the open_basedir restriction, and this allows HTTP redirects to be followed automatically. Implements FR #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir or safe_mode). Bugs: https://bugs.php.net/65646 Changed paths: M NEWS M ext/curl/interface.c A ext/curl/tests/bug65646.phpt A ext/curl/tests/bug65646_open_basedir_new.phpt A ext/curl/tests/bug65646_open_basedir_old.phpt D ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION_open_basedir.phpt Diff: diff --git a/NEWS b/NEWS index 29b5c9c..bc39126 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,10 @@ PHP NEWS of E_STRICT (phase 1 of RFC: https://wiki.php.net/rfc/incompat_ctx). (Gustavo) +- cURL: + . Implemented FR #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir +or safe_mode). (Adam) + - Session: . Fixed Bug #65315 (session.hash_function silently fallback to default md5) (Yasuo) diff --git a/ext/curl/interface.c b/ext/curl/interface.c index ac872df..5913159 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -2504,6 +2504,7 @@ string_copy: case CURLOPT_FOLLOWLOCATION: convert_to_long_ex(zvalue); +#if LIBCURL_VERSION_NUM < 0x071304 if (PG(open_basedir) && *PG(open_basedir)) { if (Z_LVAL_PP(zvalue) != 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set"); @@ -2511,6 +2512,7 @@ string_copy: return 1; } } +#endif error = curl_easy_setopt(ch->cp, option, Z_LVAL_PP(zvalue)); break; diff --git a/ext/curl/tests/bug65646.phpt b/ext/curl/tests/bug65646.phpt new file mode 100644 index 000..f244f72 --- /dev/null +++ b/ext/curl/tests/bug65646.phpt @@ -0,0 +1,15 @@ +--TEST-- +Bug #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir or safe_mode): open_basedir disabled +--SKIPIF-- + +--FILE-- + +--EXPECT-- +bool(true) diff --git a/ext/curl/tests/bug65646_open_basedir_new.phpt b/ext/curl/tests/bug65646_open_basedir_new.phpt new file mode 100644 index 000..991c4a2 --- /dev/null +++ b/ext/curl/tests/bug65646_open_basedir_new.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir or safe_mode): open_basedir enabled; curl >= 7.19.4 +--INI-- +open_basedir=. +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +bool(true) + +Warning: curl_setopt(): CURLPROTO_FILE cannot be activated when an open_basedir is set in %s on line %d +bool(false) + +Warning: curl_setopt(): CURLPROTO_FILE cannot be activated when an open_basedir is set in %s on line %d +bool(false) diff --git a/ext/curl/tests/bug65646_open_basedir_old.phpt b/ext/curl/tests/bug65646_open_basedir_old.phpt new file mode 100644 index 000..cf11d21 --- /dev/null +++ b/ext/curl/tests/bug65646_open_basedir_old.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #65646 (re-enable CURLOPT_FOLLOWLOCATION with open_basedir or safe_mode): open_basedir enabled; curl < 7.19.4 +--INI-- +open_basedir=. +--SKIPIF-- +=')) exit("skip curl version is too new"); +?> +--FILE-- + +--EXPECTF-- +Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set in %s on line %d +bool(false) diff --git a/ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION_open_basedir.phpt b/ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION_open_basedir.phpt deleted file mode 100644 index 7a778f3..000 --- a/ext/curl/tests/curl_setopt_CURLOPT_FOLLOWLOCATION_open_basedir.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -CURLOPT_FOLLOWLOCATION case check open_basedir ---CREDITS-- -WHITE new media architects - Dennis ---INI-- -open_basedir = DIRECTORY_SEPARATOR."tmp"; ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -Warning: curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set in %s.php on line %d -bool(false) - -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.5': php.ini-development php.ini-production
Commit:b8beb657ca725913ab8568eb218691bdd2f838c5 Author:Adam Harvey Mon, 9 Sep 2013 16:59:26 -0700 Parents: 2240f9531be40a8d186c47c9f3689c0b72e1a11f d209c362d2d59b0ceb82ff300cc868933ae23a06 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b8beb657ca725913ab8568eb218691bdd2f838c5 Log: Merge branch 'PHP-5.5' * PHP-5.5: Tinker with the wording of the short_open_tag description. Conflicts: php.ini-development php.ini-production Changed paths: MM php.ini-development MM php.ini-production Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Tinker with the wording of the short_open_tag description.: php.ini-development php.ini-production
Commit:160cd8d0a7205cacab9800318abb63a540587c4f Author:Adam Harvey Mon, 9 Sep 2013 16:56:57 -0700 Parents: 3c3b2b5bdc8e2bcff4d0e7d09375ad7af760b32a Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=160cd8d0a7205cacab9800318abb63a540587c4f Log: Tinker with the wording of the short_open_tag description. I'm still not thrilled with this, but it's a bit better and addresses the issues noted in bug #65644. Plus, it now mentions the decoupling of https://bugs.php.net/65644 Changed paths: M php.ini-development M php.ini-production Diff: diff --git a/php.ini-development b/php.ini-development index db908c0..ba20bd3 100644 --- a/php.ini-development +++ b/php.ini-development @@ -197,13 +197,12 @@ engine = On ; This directive determines whether or not PHP will recognize code between -; tags as PHP source which should be processed as such. It's been -; recommended for several years that you not use the short tag "short cut" and -; instead to use the full tag combination. With the wide spread use -; of XML and use of these tags by other languages, the server can become easily -; confused and end up parsing the wrong code in the wrong context. But because -; this short cut has been a feature for such a long time, it's currently still -; supported for backwards compatibility, but we recommend you don't use them. +; tags as PHP source which should be processed as such. It is +; generally recommended that should be used and that this feature +; should be disabled, as enabling it may result in issues when generating XML +; documents, however this remains supported for backward compatibility reasons. +; Note that this directive does not control the tags as PHP source which should be processed as such. It's been -; recommended for several years that you not use the short tag "short cut" and -; instead to use the full tag combination. With the wide spread use -; of XML and use of these tags by other languages, the server can become easily -; confused and end up parsing the wrong code in the wrong context. But because -; this short cut has been a feature for such a long time, it's currently still -; supported for backwards compatibility, but we recommend you don't use them. +; tags as PHP source which should be processed as such. It is +; generally recommended that should be used and that this feature +; should be disabled, as enabling it may result in issues when generating XML +; documents, however this remains supported for backward compatibility reasons. +; Note that this directive does not control the http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: php.ini-development php.ini-production
Commit:d209c362d2d59b0ceb82ff300cc868933ae23a06 Author:Adam Harvey Mon, 9 Sep 2013 16:58:35 -0700 Parents: 144f2f1773c9f2ca6ce65ddc11568869aa81b038 160cd8d0a7205cacab9800318abb63a540587c4f Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d209c362d2d59b0ceb82ff300cc868933ae23a06 Log: Merge branch 'PHP-5.4' into PHP-5.5 * PHP-5.4: Tinker with the wording of the short_open_tag description. Changed paths: MM php.ini-development MM php.ini-production Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix NEWS: these commits were after 5.5.4 was branched and will be in 5.5.5.: NEWS
Commit:144f2f1773c9f2ca6ce65ddc11568869aa81b038 Author:Adam Harvey Mon, 9 Sep 2013 16:46:14 -0700 Parents: 8b6270271ea0b707c69c80d7c41886b125af925c Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=144f2f1773c9f2ca6ce65ddc11568869aa81b038 Log: Fix NEWS: these commits were after 5.5.4 was branched and will be in 5.5.5. Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index 73214b3..df7f9d5 100644 --- a/NEWS +++ b/NEWS @@ -6,6 +6,13 @@ PHP NEWS . Fixed bug #65633 (built-in server treat some http headers as case-sensitive). (Adam) +- GD + . Ensure that the defined interpolation method is used with the generic +scaling methods. (Pierre) + +- OPcache: + . Fixed bug #65510 (5.5.2 crashes in _get_zval_ptr_ptr_var). (Dmitry) + ?? ??? 2013, PHP 5.5.4 - Core: @@ -34,13 +41,9 @@ PHP NEWS . Fixed bug #65564 (stack-buffer-overflow in DateTimeZone stuff caught by AddressSanitizer). (Remi). -- GD - . Ensure that the defined interpolation method is used with the generic scaling methods (Pierre) - - OPCache: . Fixed bug #65561 (Zend Opcache on Solaris 11 x86 needs ZEND_MM_ALIGNMENT=4). (Terry Ellison) - . Fixed bug #65510 (5.5.2 crashes in _get_zval_ptr_ptr_var). (Dmitry) - Openssl: . Fixed bug #64802 (openssl_x509_parse fails to parse subject properly in -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Handle CLI server request headers case insensitively.: NEWS sapi/cli/php_cli_server.c sapi/cli/tests/bug65633.phpt
Commit:3c3b2b5bdc8e2bcff4d0e7d09375ad7af760b32a Author:Adam Harvey Mon, 9 Sep 2013 16:24:49 -0700 Parents: 7beef74a827f393753852f7239af75af236fb4f8 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3c3b2b5bdc8e2bcff4d0e7d09375ad7af760b32a Log: Handle CLI server request headers case insensitively. Fixes bug #65633 (built-in server treat some http headers as case-sensitive). Bugs: https://bugs.php.net/65633 Changed paths: M NEWS M sapi/cli/php_cli_server.c A sapi/cli/tests/bug65633.phpt Diff: diff --git a/NEWS b/NEWS index 486ccb2..e05b240 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||| ?? ??? 2013, PHP 5.4.21 +- CLI server: + . Fixed bug #65633 (built-in server treat some http headers as +case-sensitive). (Adam) + ?? ??? 2013, PHP 5.4.20 - Core: diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index 5a12134..4da55ac 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -408,7 +408,7 @@ static void append_essential_headers(smart_str* buffer, php_cli_server_client *c { { char **val; - if (SUCCESS == zend_hash_find(&client->request.headers, "Host", sizeof("Host"), (void**)&val)) { + if (SUCCESS == zend_hash_find(&client->request.headers, "host", sizeof("host"), (void**)&val)) { smart_str_appendl_ex(buffer, "Host", sizeof("Host") - 1, persistent); smart_str_appendl_ex(buffer, ": ", sizeof(": ") - 1, persistent); smart_str_appends_ex(buffer, *val, persistent); @@ -558,7 +558,7 @@ static char *sapi_cli_server_read_cookies(TSRMLS_D) /* {{{ */ { php_cli_server_client *client = SG(server_context); char **val; - if (FAILURE == zend_hash_find(&client->request.headers, "Cookie", sizeof("Cookie"), (void**)&val)) { + if (FAILURE == zend_hash_find(&client->request.headers, "cookie", sizeof("cookie"), (void**)&val)) { return NULL; } return *val; @@ -1556,12 +1556,9 @@ static int php_cli_server_client_read_request_on_header_value(php_http_parser *p return 1; } { - char *header_name = client->current_header_name; - size_t header_name_len = client->current_header_name_len; - char c = header_name[header_name_len]; - header_name[header_name_len] = '\0'; - zend_hash_add(&client->request.headers, header_name, header_name_len + 1, &value, sizeof(char *), NULL); - header_name[header_name_len] = c; + char *header_name = zend_str_tolower_dup(client->current_header_name, client->current_header_name_len); + zend_hash_add(&client->request.headers, header_name, client->current_header_name_len + 1, &value, sizeof(char *), NULL); + efree(header_name); } if (client->current_header_name_allocated) { @@ -1719,7 +1716,7 @@ static void php_cli_server_client_populate_request_info(const php_cli_server_cli request_info->post_data = client->request.content; request_info->content_length = request_info->post_data_length = client->request.content_len; request_info->auth_user = request_info->auth_password = request_info->auth_digest = NULL; - if (SUCCESS == zend_hash_find(&client->request.headers, "Content-Type", sizeof("Content-Type"), (void**)&val)) { + if (SUCCESS == zend_hash_find(&client->request.headers, "content-type", sizeof("content-type"), (void**)&val)) { request_info->content_type = *val; } } /* }}} */ @@ -1957,7 +1954,7 @@ static int php_cli_server_begin_send_static(php_cli_server *server, php_cli_serv static int php_cli_server_request_startup(php_cli_server *server, php_cli_server_client *client TSRMLS_DC) { /* {{{ */ char **auth; php_cli_server_client_populate_request_info(client, &SG(request_info)); - if (SUCCESS == zend_hash_find(&client->request.headers, "Authorization", sizeof("Authorization"), (void**)&auth)) { + if (SUCCESS == zend_hash_find(&client->request.headers, "authorization", sizeof("authorization"), (void**)&auth)) { php_handle_auth_data(*auth TSRMLS_CC); } SG(sapi_headers).http_response_code = 200; diff --git a/sapi/cli/tests/bug65633.phpt b/sapi/cli/tests/bug65633.phpt new f
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: NEWS sapi/cli/php_cli_server.c
Commit:8b6270271ea0b707c69c80d7c41886b125af925c Author:Adam Harvey Mon, 9 Sep 2013 16:32:16 -0700 Parents: b54b6e30a4e46d9dd1f1bf0cbc0d4539c0f7d51d 3c3b2b5bdc8e2bcff4d0e7d09375ad7af760b32a Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8b6270271ea0b707c69c80d7c41886b125af925c Log: Merge branch 'PHP-5.4' into PHP-5.5 * PHP-5.4: Handle CLI server request headers case insensitively. 5.4.21 now Conflicts: configure.in main/php_version.h Changed paths: MM NEWS MM sapi/cli/php_cli_server.c Diff: diff --cc NEWS index 8655571,e05b240..73214b3 --- a/NEWS +++ b/NEWS @@@ -1,8 -1,12 +1,12 @@@ PHP NEWS ||| -?? ??? 2013, PHP 5.4.21 +?? ??? 2013, PHP 5.5.5 + - CLI server: + . Fixed bug #65633 (built-in server treat some http headers as + case-sensitive). (Adam) + -?? ??? 2013, PHP 5.4.20 +?? ??? 2013, PHP 5.5.4 - Core: . Fixed bug #60598 (cli/apache sapi segfault on objects manipulation). -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.5': ext/curl/interface.c
Commit:2a46fc0470c0cec055178af8cb962c8d52fb4700 Author:Adam Harvey Mon, 19 Aug 2013 12:19:13 -0700 Parents: d17ade127b4f0b546c0fd1d11b915c485ceea9ea 69f12ad582c102c1d7b3b2c0ae6cf7cd633dfe1d Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2a46fc0470c0cec055178af8cb962c8d52fb4700 Log: Merge branch 'PHP-5.5' * PHP-5.5: Track created curl_slist structs by option so they can be updated in situ. Conflicts: ext/curl/interface.c Changed paths: MM ext/curl/interface.c Diff: diff --cc ext/curl/interface.c index 8061867,8617954..a1c8a1e --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@@ -1790,9 -1790,11 +1790,11 @@@ static void alloc_curl_handle(php_curl (*ch)->handlers->read->stream = NULL; zend_llist_init(&(*ch)->to_free->str, sizeof(char *), (llist_dtor_func_t) curl_free_string, 0); - zend_llist_init(&(*ch)->to_free->slist, sizeof(struct curl_slist), (llist_dtor_func_t) curl_free_slist, 0); zend_llist_init(&(*ch)->to_free->post, sizeof(struct HttpPost), (llist_dtor_func_t) curl_free_post, 0); - (*ch)->safe_upload = 0; /* for now, for BC reason we allow unsafe API */ + (*ch)->safe_upload = 1; /* for now, for BC reason we allow unsafe API */ + + (*ch)->to_free->slist = emalloc(sizeof(HashTable)); + zend_hash_init((*ch)->to_free->slist, 4, NULL, curl_free_slist, 0); } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: NEWS ext/curl/interface.c ext/curl/php_curl.h
Commit:69f12ad582c102c1d7b3b2c0ae6cf7cd633dfe1d Author:Adam Harvey Mon, 19 Aug 2013 12:16:36 -0700 Parents: d2c78c9e2039b0dfd14587800e24b30ff0ab0e1e aa7d3d8e6d8de73ebe8dd015fb5392a4bde5bfc6 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=69f12ad582c102c1d7b3b2c0ae6cf7cd633dfe1d Log: Merge branch 'PHP-5.4' into PHP-5.5 * PHP-5.4: Track created curl_slist structs by option so they can be updated in situ. Conflicts: ext/curl/interface.c Changed paths: MM NEWS MM ext/curl/interface.c MM ext/curl/php_curl.h diff --cc NEWS index d5d2cda,64e049d..634e6b9 --- a/NEWS +++ b/NEWS @@@ -1,25 -1,12 +1,28 @@@ PHP NEWS ||| -?? ??? 2013, PHP 5.4.19 +?? ??? 2013, PHP 5.5.3 - Core: - . Fixed bug #65470 (Segmentation fault in zend_error() with + . Fixed bug #65470 (Segmentation fault in zend_error() with --enable-dtrace). (Chris Jones) + . Fixed bug #65225 (PHP_BINARY incorrectly set). (Patrick Allaert) + . Fixed bug #62692 (PHP fails to build with DTrace). (Chris Jones, Kris Van Hees) + ++- cURL: ++ . Fixed bug #65458 (curl memory leak). (Adam) ++ +- Openssl: + . Fixed bug #64802 (openssl_x509_parse fails to parse subject properly in +some cases). (Mark Jones) + +15 Aug 2013, PHP 5.5.2 + +- Core: . Fixed bug #65372 (Segfault in gc_zval_possible_root when return reference fails). (Laruence) + . Fixed value of FILTER_SANITIZE_FULL_SPECIAL_CHARS constant (previously was +erroneously set to FILTER_SANITIZE_SPECIAL_CHARS value). (Andrey +avp200681 gmail com). . Fixed bug #65304 (Use of max int in array_sum). (Laruence) . Fixed bug #65291 (get_defined_constants() causes PHP to crash in a very limited case). (Arpad) diff --cc ext/curl/interface.c index 4b6e5e2,f79d0d5..8617954 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@@ -1790,9 -1443,10 +1790,11 @@@ static void alloc_curl_handle(php_curl (*ch)->handlers->read->stream = NULL; zend_llist_init(&(*ch)->to_free->str, sizeof(char *), (llist_dtor_func_t) curl_free_string, 0); - zend_llist_init(&(*ch)->to_free->slist, sizeof(struct curl_slist), (llist_dtor_func_t) curl_free_slist, 0); zend_llist_init(&(*ch)->to_free->post, sizeof(struct HttpPost), (llist_dtor_func_t) curl_free_post, 0); + (*ch)->safe_upload = 0; /* for now, for BC reason we allow unsafe API */ + + (*ch)->to_free->slist = emalloc(sizeof(HashTable)); + zend_hash_init((*ch)->to_free->slist, 4, NULL, curl_free_slist, 0); } /* }}} */ @@@ -2019,30 -1675,9 +2021,31 @@@ PHP_FUNCTION(curl_copy_handle curl_easy_setopt(dupch->cp, CURLOPT_FILE, (void *) dupch); curl_easy_setopt(dupch->cp, CURLOPT_INFILE,(void *) dupch); curl_easy_setopt(dupch->cp, CURLOPT_WRITEHEADER, (void *) dupch); - curl_easy_setopt(dupch->cp, CURLOPT_PROGRESSDATA, (void *) dupch); + + if (ch->handlers->progress) { + dupch->handlers->progress = ecalloc(1, sizeof(php_curl_progress)); + if (ch->handlers->progress->func_name) { + zval_add_ref(&ch->handlers->progress->func_name); + dupch->handlers->progress->func_name = ch->handlers->progress->func_name; + } + dupch->handlers->progress->method = ch->handlers->progress->method; + curl_easy_setopt(dupch->cp, CURLOPT_PROGRESSDATA, (void *) dupch); + } + +/* Available since 7.21.0 */ +#if LIBCURL_VERSION_NUM >= 0x071500 + if (ch->handlers->fnmatch) { + dupch->handlers->fnmatch = ecalloc(1, sizeof(php_curl_fnmatch)); + if (ch->handlers->fnmatch->func_name) { + zval_add_ref(&ch->handlers->fnmatch->func_name); + dupch->handlers->fnmatch->func_name = ch->handlers->fnmatch->func_name; + } + dupch->handlers->fnmatch->method = ch->handlers->fnmatch->method; + curl_easy_setopt(dupch->cp, CURLOPT_FNMATCH_DATA, (void *) dupch); + } +#endif + efree(dupch->to_free->slist); efree(dupch->to_free); dupch->to_free = ch->to_free; @@@ -2415,102 -1973,56 +2418,102 @@@ string_copy error = curl_easy_setopt(ch->cp, option, fp); break; } - break; } - case CURLOPT_RETURNTRANSFER: -
[PHP-CVS] com php-src: Track created curl_slist structs by option so they can be updated in situ.: NEWS ext/curl/interface.c ext/curl/php_curl.h ext/curl/tests/bug65458.phpt
Commit:aa7d3d8e6d8de73ebe8dd015fb5392a4bde5bfc6 Author:Adam Harvey Mon, 19 Aug 2013 11:58:57 -0700 Parents: a4862503d485abf449e0565ac03157d859a31bf7 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=aa7d3d8e6d8de73ebe8dd015fb5392a4bde5bfc6 Log: Track created curl_slist structs by option so they can be updated in situ. At present, when curl_setopt() is called with an option that requires the creation of a curl_slist, we simply push the new curl_slist onto a list to be freed when the curl handle is freed. This avoids a memory leak, but means that repeated calls to curl_setopt() on the same handle with the same option wastes previously allocated memory on curl_slist structs that will no longer be read. This commit changes the zend_llist that was previously used to track the lists to a HashTable keyed by the option number, which means that we can simply update the hash table each time curl_setopt() is called. Fixes bug #65458 (curl memory leak). Bugs: https://bugs.php.net/65458 Changed paths: M NEWS M ext/curl/interface.c M ext/curl/php_curl.h A ext/curl/tests/bug65458.phpt Diff: diff --git a/NEWS b/NEWS index ff79a29..64e049d 100644 --- a/NEWS +++ b/NEWS @@ -19,6 +19,9 @@ PHP NEWS . Fixed bug #61268 (--enable-dtrace leads make to clobber Zend/zend_dtrace.d) (Chris Jones) +- cURL: + . Fixed bug #65458 (curl memory leak). (Adam) + - Openssl: . Fixed bug #64802 (openssl_x509_parse fails to parse subject properly in some cases). (Mark Jones) diff --git a/ext/curl/interface.c b/ext/curl/interface.c index 531f15b..f79d0d5 100644 --- a/ext/curl/interface.c +++ b/ext/curl/interface.c @@ -1373,9 +1373,9 @@ static void curl_free_post(void **post) /* {{{ curl_free_slist */ -static void curl_free_slist(void **slist) +static void curl_free_slist(void *slist) { - curl_slist_free_all((struct curl_slist *) *slist); + curl_slist_free_all(*((struct curl_slist **) slist)); } /* }}} */ @@ -1443,8 +1443,10 @@ static void alloc_curl_handle(php_curl **ch) (*ch)->handlers->read->stream = NULL; zend_llist_init(&(*ch)->to_free->str, sizeof(char *), (llist_dtor_func_t) curl_free_string, 0); - zend_llist_init(&(*ch)->to_free->slist, sizeof(struct curl_slist), (llist_dtor_func_t) curl_free_slist, 0); zend_llist_init(&(*ch)->to_free->post, sizeof(struct HttpPost), (llist_dtor_func_t) curl_free_post, 0); + + (*ch)->to_free->slist = emalloc(sizeof(HashTable)); + zend_hash_init((*ch)->to_free->slist, 4, NULL, curl_free_slist, 0); } /* }}} */ @@ -1675,6 +1677,7 @@ PHP_FUNCTION(curl_copy_handle) curl_easy_setopt(dupch->cp, CURLOPT_WRITEHEADER, (void *) dupch); curl_easy_setopt(dupch->cp, CURLOPT_PROGRESSDATA, (void *) dupch); + efree(dupch->to_free->slist); efree(dupch->to_free); dupch->to_free = ch->to_free; @@ -2184,7 +2187,7 @@ string_copy: return 1; } } - zend_llist_add_element(&ch->to_free->slist, &slist); + zend_hash_index_update(ch->to_free->slist, (ulong) option, &slist, sizeof(struct curl_slist *), NULL); error = curl_easy_setopt(ch->cp, option, slist); @@ -2680,8 +2683,9 @@ static void _php_curl_close_ex(php_curl *ch TSRMLS_DC) /* cURL destructors should be invoked only by last curl handle */ if (Z_REFCOUNT_P(ch->clone) <= 1) { zend_llist_clean(&ch->to_free->str); - zend_llist_clean(&ch->to_free->slist); zend_llist_clean(&ch->to_free->post); + zend_hash_destroy(ch->to_free->slist); + efree(ch->to_free->slist); efree(ch->to_free); FREE_ZVAL(ch->clone); } else { diff --git a/ext/curl/php_curl.h b/ext/curl/php_curl.h index 945f0a4..911d87a 100644 --- a/ext/curl/php_curl.h +++ b/ext/curl/php_curl.h @@ -126,7 +126,7 @@ struct _php_curl_send_headers { struct _php_curl_free { zend_llist str; zend_llist post; - zend_llist slist; + HashTable *slist; }; typedef struct { diff --git a/ext/curl/tests/bug65458.phpt b/ext/curl/tests/bug65458.phpt new file mode 100644 index 000..99288f2 --- /dev/null +++ b/ext/curl/tests/bug65458.phpt @@ -0,0 +1,25 @@ +--TEST-- +Bug #65458 (curl memory leak) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +bool(true) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Expand the ZEND_STRL macro to handle platforms where strncmp() is a macro.: ext/spl/php_spl.c
Commit:f9000fde98195844b4d1c1d6209f9796da3ebee8 Author:Adam Harvey Tue, 23 Jul 2013 11:15:43 -0700 Parents: f00d796b7ef290b4fa515ae09afc34f17201528f Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f9000fde98195844b4d1c1d6209f9796da3ebee8 Log: Expand the ZEND_STRL macro to handle platforms where strncmp() is a macro. On most platforms, this works fine, but on Linux armhf, strncmp() is a macro rather than a real function, ergo the macro expansion of ZEND_STRL doesn't occur until after the compiler knows it needs three parameters for strncmp() and we get a compile error. Fixes the fix for bug #61697. Bugs: https://bugs.php.net/61697 Changed paths: M ext/spl/php_spl.c Diff: diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c index c3a774e..a5ffdb7 100644 --- a/ext/spl/php_spl.c +++ b/ext/spl/php_spl.c @@ -744,7 +744,7 @@ PHP_FUNCTION(spl_autoload_functions) add_next_index_string(tmp, alfi->func_ptr->common.function_name, 1); add_next_index_zval(return_value, tmp); } else { - if (strncmp(alfi->func_ptr->common.function_name, ZEND_STRL("__lambda_func"))) { + if (strncmp(alfi->func_ptr->common.function_name, "__lambda_func", sizeof("__lambda_func") - 1)) { add_next_index_string(return_value, alfi->func_ptr->common.function_name, 1); } else { char *key; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: NEWS acinclude.m4
Commit:296a12efbbdcb4db4a28b5744e3f3bd60e8fec9f Author:Adam Harvey Sun, 23 Jun 2013 11:04:10 -0700 Parents: fc898ee0f94ee3686aa1f359d4a973d5e8e1754b 2531307be601b95a4aac38dc26dd2d27112b9291 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=296a12efbbdcb4db4a28b5744e3f3bd60e8fec9f Log: Merge branch 'PHP-5.4' into PHP-5.5 * PHP-5.4: Fix bug #65088 (Generated configure script is malformed on OpenBSD). Bugs: https://bugs.php.net/65088 Changed paths: MM NEWS MM acinclude.m4 Diff: diff --cc NEWS index 577d2e4,be774f8..1f60758 --- a/NEWS +++ b/NEWS @@@ -1,70 -1,18 +1,75 @@@ PHP NEWS ||| -?? ??? 2013, PHP 5.4.18 +?? ??? 2013, PHP 5.5.1 + - Core: + . Fixed bug #65088 (Generated configure script is malformed on OpenBSD). + (Adam) + - CLI server: . Fixed bug #65066 (Cli server not responsive when responding with 422 http status code). (Adam) + -?? ??? 2013, PHP 5.4.17 +- GD + . Fixed #65070 (bgcolor does not use the same format as the input image with +imagerotate). (Pierre) + . Fixed Bug #65060 (imagecreatefrom... crashes with user streams). (Remi) + . Fixed Bug #65084 (imagecreatefromjpeg fails with URL). (Remi) + +20 Jun 2013, PHP 5.5.0 - Core: + . Added Zend Opcache extension and enable building it by default. +More details here: https://wiki.php.net/rfc/optimizerplus. (Dmitry) + . Added generators and coroutines (https://wiki.php.net/rfc/generators). +(Nikita Popov) + . Added "finally" keyword (https://wiki.php.net/rfc/finally). (Laruence) + . Added simplified password hashing API +(https://wiki.php.net/rfc/password_hash). (Anthony Ferrara) + . Added support for constant array/string dereferencing. (Laruence) + . Added array_column function which returns a column in a multidimensional +array. https://wiki.php.net/rfc/array_column. (Ben Ramsey) + . Added boolval(). (Jille Timmermans) + . Added "Z" option to pack/unpack. (Gustavo) + . Added Generator::throw() method. (Nikita Popov) + . Added Class Name Resolution As Scalar Via "class" Keyword. +(Ralph Schindler, Nikita Popov, Lars) + . Added optional second argument for assert() to specify custom message. Patch +by Lonny Kapelushnik (lo...@lonnylot.com). (Lars) + . Added support for using empty() on the result of function calls and +other expressions (https://wiki.php.net/rfc/empty_isset_exprs). +(Nikita Popov) + . Added support for non-scalar Iterator keys in foreach +(https://wiki.php.net/rfc/foreach-non-scalar-keys). (Nikita Popov) + . Added support for list in foreach (https://wiki.php.net/rfc/foreachlist). +(Laruence) + . Added support for changing the process's title in CLI/CLI-Server SAPIs. +The implementation is more robust that the proctitle PECL module. More +details here: https://wiki.php.net/rfc/cli_process_title. (Keyur) + . Added ARMv7/v8 versions of various Zend arithmetic functions that are +implemented using inline assembler (Ard Biesheuvel) + . Added systemtap support by enabling systemtap compatible dtrace probes on +linux. (David Soria Parra) + . Optimized access to temporary and compiled VM variables. 8% less memory +reads. (Dmitry) + . The VM stacks for passing function arguments and syntaticaly nested calls +were merged into a single stack. The stack size needed for op_array +execution is calculated at compile time and preallocated at once. As result +all the stack push operatins don't require checks for stack overflow +any more. (Dmitry) + . Improve set_exception_handler while doing reset. (Laruence) + . Return previous handler when passing NULL to set_error_handler and +set_exception_handler. (Nikita Popov) + . Remove php_logo_guid(), php_egg_logo_guid(), php_real_logo_guid(), +zend_logo_guid(). (Adnrew Faulds) + . Drop Windows XP and 2003 support. (Pierre) + . Implemented FR #64175 (Added HTTP codes as of RFC 6585). (Jonh Wendell) + . Implemented FR #60738 (Allow 'set_error_handler' to handle NULL). +(Laruence, Nikita Popov) + . Implemented FR #60524 (specify temp dir by php.ini). (ALeX Kazik). + . Implemented FR #46487 (Dereferencing process-handles no longer waits on +those processes). (Jille Timmermans) + . Fixed bug #65051 (count() off by one inside unset()). (Nikita) . Fixed bug #64988 (Class loading order affects E_STRICT warning). (Laruence) . Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC). (Laruence) . Fixed bug #64960 (Segfault in gc_zval_possible_root). (Laruence) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix bug #65088 (Generated configure script is malformed on OpenBSD).: NEWS acinclude.m4
Commit:2531307be601b95a4aac38dc26dd2d27112b9291 Author:Adam Harvey Sun, 23 Jun 2013 11:01:36 -0700 Parents: 8623562b02dd6759617ef78ddcb06bdfe7710329 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2531307be601b95a4aac38dc26dd2d27112b9291 Log: Fix bug #65088 (Generated configure script is malformed on OpenBSD). We fell foul of a "common urban legend"[0], which resulted in us backslash escaping double quotes that we didn't need to in acinclude.m4. This worked fine on most shells, but OpenBSD's ksh implementation really didn't like it. [0] http://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Shell-Substitutions.html Bugs: https://bugs.php.net/65088 Changed paths: M NEWS M acinclude.m4 Diff: diff --git a/NEWS b/NEWS index 9612928..be774f8 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||| ?? ??? 2013, PHP 5.4.18 +- Core: + . Fixed bug #65088 (Generated configure script is malformed on OpenBSD). +(Adam) + - CLI server: . Fixed bug #65066 (Cli server not responsive when responding with 422 http status code). (Adam) diff --git a/acinclude.m4 b/acinclude.m4 index 350e498..d5912ad 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -66,10 +66,10 @@ AC_DEFUN([PHP_EXPAND_PATH],[ $2=$1 else changequote({,}) -ep_dir="`echo $1|$SED 's%/*[^/][^/]*/*$%%'`" +ep_dir=`echo $1|$SED 's%/*[^/][^/]*/*$%%'` changequote([,]) -ep_realdir="`(cd \"$ep_dir\" && pwd)`" -$2="$ep_realdir/`basename \"$1\"`" +ep_realdir=`(cd "$ep_dir" && pwd)` +$2="$ep_realdir"/`basename "$1"` fi ]) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: NEWS sapi/cli/php_cli_server.c
Commit:77c46ba51600ea03ff07f64ddaa2d73dd4a81be5 Author:Adam Harvey Thu, 20 Jun 2013 09:39:37 -0700 Parents: 94e7549719350362617c6933dba6379f058e68a8 f5c7fe92020fd7b8e81c94658da4813a7e6dea17 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=77c46ba51600ea03ff07f64ddaa2d73dd4a81be5 Log: Merge branch 'PHP-5.4' into PHP-5.5 * PHP-5.4: Fix the spelling of the php_cli_server_http_response_status_code_pair typedef. Change the search in get_status_string() to correctly handle unknown codes. Changed paths: MM NEWS MM sapi/cli/php_cli_server.c Diff: diff --cc NEWS index 1247dfd,9612928..653a64a --- a/NEWS +++ b/NEWS @@@ -1,59 -1,14 +1,65 @@@ PHP NEWS ||| -?? ??? 2013, PHP 5.4.18 ++?? ??? 2013, PHP 5.5.1 + + - CLI server: + . Fixed bug #65066 (Cli server not responsive when responding with 422 http + status code). (Adam) + -?? ??? 2013, PHP 5.4.17 +20 Jun 2013, PHP 5.5.0 - Core: + . Added Zend Opcache extension and enable building it by default. +More details here: https://wiki.php.net/rfc/optimizerplus. (Dmitry) + . Added generators and coroutines (https://wiki.php.net/rfc/generators). +(Nikita Popov) + . Added "finally" keyword (https://wiki.php.net/rfc/finally). (Laruence) + . Added simplified password hashing API +(https://wiki.php.net/rfc/password_hash). (Anthony Ferrara) + . Added support for constant array/string dereferencing. (Laruence) + . Added array_column function which returns a column in a multidimensional +array. https://wiki.php.net/rfc/array_column. (Ben Ramsey) + . Added boolval(). (Jille Timmermans) + . Added "Z" option to pack/unpack. (Gustavo) + . Added Generator::throw() method. (Nikita Popov) + . Added Class Name Resolution As Scalar Via "class" Keyword. +(Ralph Schindler, Nikita Popov, Lars) + . Added optional second argument for assert() to specify custom message. Patch +by Lonny Kapelushnik (lo...@lonnylot.com). (Lars) + . Added support for using empty() on the result of function calls and +other expressions (https://wiki.php.net/rfc/empty_isset_exprs). +(Nikita Popov) + . Added support for non-scalar Iterator keys in foreach +(https://wiki.php.net/rfc/foreach-non-scalar-keys). (Nikita Popov) + . Added support for list in foreach (https://wiki.php.net/rfc/foreachlist). +(Laruence) + . Added support for changing the process's title in CLI/CLI-Server SAPIs. +The implementation is more robust that the proctitle PECL module. More +details here: https://wiki.php.net/rfc/cli_process_title. (Keyur) + . Added ARMv7/v8 versions of various Zend arithmetic functions that are +implemented using inline assembler (Ard Biesheuvel) + . Added systemtap support by enabling systemtap compatible dtrace probes on +linux. (David Soria Parra) + . Optimized access to temporary and compiled VM variables. 8% less memory +reads. (Dmitry) + . The VM stacks for passing function arguments and syntaticaly nested calls +were merged into a single stack. The stack size needed for op_array +execution is calculated at compile time and preallocated at once. As result +all the stack push operatins don't require checks for stack overflow +any more. (Dmitry) + . Improve set_exception_handler while doing reset. (Laruence) + . Return previous handler when passing NULL to set_error_handler and +set_exception_handler. (Nikita Popov) + . Remove php_logo_guid(), php_egg_logo_guid(), php_real_logo_guid(), +zend_logo_guid(). (Adnrew Faulds) + . Drop Windows XP and 2003 support. (Pierre) + . Implemented FR #64175 (Added HTTP codes as of RFC 6585). (Jonh Wendell) + . Implemented FR #60738 (Allow 'set_error_handler' to handle NULL). +(Laruence, Nikita Popov) + . Implemented FR #60524 (specify temp dir by php.ini). (ALeX Kazik). + . Implemented FR #46487 (Dereferencing process-handles no longer waits on +those processes). (Jille Timmermans) + . Fixed bug #65051 (count() off by one inside unset()). (Nikita) . Fixed bug #64988 (Class loading order affects E_STRICT warning). (Laruence) . Fixed bug #64966 (segfault in zend_do_fcall_common_helper_SPEC). (Laruence) . Fixed bug #64960 (Segfault in gc_zval_possible_root). (Laruence) diff --cc sapi/cli/php_cli_server.c index 5c9b2e8,335d589..a1bae67 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@@ -251,9 -250,9 +252,9 @@@ static php_cli_server_http_response_sta { 511, "Network Authentication Required" }, }; - static php_cli_server_http_reponse_status_code_pair template_map[] = { + static php_cli_server_http_response_status_code_pair template_map[] = { { 400,
[PHP-CVS] com php-src: Fix the spelling of the php_cli_server_http_response_status_code_pair typedef.: sapi/cli/php_cli_server.c
Commit:f5c7fe92020fd7b8e81c94658da4813a7e6dea17 Author:Adam Harvey Thu, 20 Jun 2013 09:34:21 -0700 Parents: 283f56af6696f57400bdbf8ce29ee66e64249c0d Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f5c7fe92020fd7b8e81c94658da4813a7e6dea17 Log: Fix the spelling of the php_cli_server_http_response_status_code_pair typedef. Specifically: php_cli_server_http_reponse_status_code_pair → php_cli_server_http_response_status_code_pair. Changed paths: M sapi/cli/php_cli_server.c Diff: diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index 268beeb..335d589 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -193,17 +193,17 @@ typedef struct php_cli_server { HashTable clients; } php_cli_server; -typedef struct php_cli_server_http_reponse_status_code_pair { +typedef struct php_cli_server_http_response_status_code_pair { int code; const char *str; -} php_cli_server_http_reponse_status_code_pair; +} php_cli_server_http_response_status_code_pair; typedef struct php_cli_server_ext_mime_type_pair { const char *ext; const char *mime_type; } php_cli_server_ext_mime_type_pair; -static php_cli_server_http_reponse_status_code_pair status_map[] = { +static php_cli_server_http_response_status_code_pair status_map[] = { { 100, "Continue" }, { 101, "Switching Protocols" }, { 200, "OK" }, @@ -250,7 +250,7 @@ static php_cli_server_http_reponse_status_code_pair status_map[] = { { 511, "Network Authentication Required" }, }; -static php_cli_server_http_reponse_status_code_pair template_map[] = { +static php_cli_server_http_response_status_code_pair template_map[] = { { 400, "%sYour browser sent a request that this server could not understand." }, { 404, "%sThe requested resource %s was not found on this server." }, { 500, "%sThe server is temporarily unavailable." }, @@ -336,8 +336,8 @@ static char *get_last_error() /* {{{ */ static int status_comp(const void *a, const void *b) /* {{{ */ { - const php_cli_server_http_reponse_status_code_pair *pa = (const php_cli_server_http_reponse_status_code_pair *) a; - const php_cli_server_http_reponse_status_code_pair *pb = (const php_cli_server_http_reponse_status_code_pair *) b; + const php_cli_server_http_response_status_code_pair *pa = (const php_cli_server_http_response_status_code_pair *) a; + const php_cli_server_http_response_status_code_pair *pb = (const php_cli_server_http_response_status_code_pair *) b; if (pa->code < pb->code) { return -1; @@ -350,7 +350,7 @@ static int status_comp(const void *a, const void *b) /* {{{ */ static const char *get_status_string(int code) /* {{{ */ { - php_cli_server_http_reponse_status_code_pair needle, *result = NULL; + php_cli_server_http_response_status_code_pair needle, *result = NULL; needle.code = code; needle.str = NULL; @@ -370,7 +370,7 @@ static const char *get_status_string(int code) /* {{{ */ static const char *get_template_string(int code) /* {{{ */ { - size_t e = (sizeof(template_map) / sizeof(php_cli_server_http_reponse_status_code_pair)); + size_t e = (sizeof(template_map) / sizeof(php_cli_server_http_response_status_code_pair)); size_t s = 0; while (e != s) { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Change the search in get_status_string() to correctly handle unknown codes.: NEWS sapi/cli/php_cli_server.c sapi/cli/tests/bug65066_100.phpt sapi/cli/tests/bug65066_422.phpt sap
Commit:283f56af6696f57400bdbf8ce29ee66e64249c0d Author:Adam Harvey Wed, 19 Jun 2013 11:32:37 -0700 Parents: b5978e239ee308e425843e40eb6ab2a9f0beba83 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=283f56af6696f57400bdbf8ce29ee66e64249c0d Log: Change the search in get_status_string() to correctly handle unknown codes. This previously used a buggy implementation of binary search that would loop infinitely for unknown codes when searching in reason arrays of particular sizes (such as the one we have at the moment). Since C provides bsearch(), we'll just use that instead, since libc authors hopefully get this right. There was also an additional bug that was masked by the first one: the design was that an unknown code would result in get_status_string() returning NULL, which would then result in a segfault in append_http_status_line(), since it assumed that it would always receive a valid string pointer that could be handed off to smart_str_appends_ex(). We'll now return a placeholder in that case. Fixes bug #65066 (Cli server not responsive when responding with 422 http status code). Bugs: https://bugs.php.net/65066 Changed paths: M NEWS M sapi/cli/php_cli_server.c A sapi/cli/tests/bug65066_100.phpt A sapi/cli/tests/bug65066_422.phpt A sapi/cli/tests/bug65066_511.phpt Diff: diff --git a/NEWS b/NEWS index 46fa7f0..9612928 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||| ?? ??? 2013, PHP 5.4.18 +- CLI server: + . Fixed bug #65066 (Cli server not responsive when responding with 422 http +status code). (Adam) + ?? ??? 2013, PHP 5.4.17 - Core: diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index 903f042..268beeb 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -20,6 +20,7 @@ /* $Id: php_cli.c 306938 2011-01-01 02:17:06Z felipe $ */ #include +#include #include #include @@ -333,23 +334,38 @@ static char *get_last_error() /* {{{ */ return pestrdup(strerror(errno), 1); } /* }}} */ +static int status_comp(const void *a, const void *b) /* {{{ */ +{ + const php_cli_server_http_reponse_status_code_pair *pa = (const php_cli_server_http_reponse_status_code_pair *) a; + const php_cli_server_http_reponse_status_code_pair *pb = (const php_cli_server_http_reponse_status_code_pair *) b; + + if (pa->code < pb->code) { + return -1; + } else if (pa->code > pb->code) { + return 1; + } + + return 0; +} /* }}} */ + static const char *get_status_string(int code) /* {{{ */ { - size_t e = (sizeof(status_map) / sizeof(php_cli_server_http_reponse_status_code_pair)); - size_t s = 0; + php_cli_server_http_reponse_status_code_pair needle, *result = NULL; - while (e != s) { - size_t c = MIN((e + s + 1) / 2, e - 1); - int d = status_map[c].code; - if (d > code) { - e = c; - } else if (d < code) { - s = c; - } else { - return status_map[c].str; - } + needle.code = code; + needle.str = NULL; + + result = bsearch(&needle, status_map, sizeof(status_map) / sizeof(needle), sizeof(needle), status_comp); + + if (result) { + return result->str; } - return NULL; + + /* Returning NULL would require complicating append_http_status_line() to +* not segfault in that case, so let's just return a placeholder, since RFC +* 2616 requires a reason phrase. This is basically what a lot of other Web +* servers do in this case anyway. */ + return "Unknown Status Code"; } /* }}} */ static const char *get_template_string(int code) /* {{{ */ diff --git a/sapi/cli/tests/bug65066_100.phpt b/sapi/cli/tests/bug65066_100.phpt new file mode 100644 index 000..3a97c7e --- /dev/null +++ b/sapi/cli/tests/bug65066_100.phpt @@ -0,0 +1,39 @@ +--TEST-- +Bug #65066 (Cli server not responsive when responding with 422 http status code): 100 status code +--INI-- +allow_url_fopen=1 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +HTTP/1.1 100 Continue +Host: %s +Connection: close +X-Powered-By: PHP/%s +Content-type: text/html diff --git a/sapi/cli/tests/bug65066_422.phpt b/sapi/cli/tests/bug65066_422.phpt new file mode 100644 index 000..2552d1d --- /dev/null +++ b/sapi/cli/tests/bug65066_422.phpt @@ -0,0 +1,39 @@ +--TEST-- +Bug #65066 (Cli server not responsive when responding with 422 http status code): 422 status code +--INI-- +allow_url_fopen=1 +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +HTTP/1.1 422 Unknown Status Code +Host: %s +Connection: close +X-Powered-By: PHP
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: NEWS
Commit:77010bf9bf45c46d844b336c18cc8102cfc7e249 Author:Adam Harvey Wed, 16 Jan 2013 10:19:13 +0800 Parents: 2f7aafe9929d843ae089a7072c5e6d9bd70c77ae 142c40f32c075a8eb706f2e630b934f39e711b70 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=77010bf9bf45c46d844b336c18cc8102cfc7e249 Log: Merge branch 'PHP-5.4' into PHP-5.5 * PHP-5.4: Update the arguments in the prototype of fpm_socket_unix_test_connect(). Changed paths: MM NEWS Diff: diff --cc NEWS index 212029c,8fc3d6c..6395b34 --- a/NEWS +++ b/NEWS @@@ -1,63 -1,106 +1,66 @@@ PHP NEWS ||| -?? ??? 2012, PHP 5.4.12 +?? ??? 201?, PHP 5.5.0 Alpha 3 - Core: - . Fixed bug #63982 (isset() inconsistently produces a fatal error on -protected property). (Stas) - . Fixed bug #63943 (Bad warning text from strpos() on empty needle). -(Laruence) - . Fixed bug #63899 (Use after scope error in zend_compile). (Laruence) - . Fixed bug #63893 (Poor efficiency of strtr() using array with keys of very -different length). (Gustavo) - . Fixed bug #63882 (zend_std_compare_objects crash on recursion). (Dmitry) - . Support BITMAPV5HEADER in getimagesize(). (AsamK, Lars) - -- Date: - . Fixed bug #63699 (Performance improvements for various ext/date functions). -(Lars, original patch by njaguar at gmail dot com) - . Fixed bug #55397: Comparsion of incomplete DateTime causes SIGSEGV. -(Derick) - -- FPM: - . Fixed bug #63999 (php with fpm fails to build on Solaris 10 or 11). (Adam) - -- Litespeed: - . Fixed bug #63228 (-Werror=format-security error in lsapi code). (George) - -- ext/sqlite3: - . Fixed bug #63921 (sqlite3::bindvalue and relative PHP functions aren't -using sqlite3_*_int64 API). (srgoogleguy, Lars) - -- PDO_sqlite: - . Fixed bug #63916 (PDO::PARAM_INT casts to 32bit int internally even -on 64bit builds in pdo_sqlite). (srgoogleguy, Lars) - . Fixed bug #57702 (Multi-row BLOB fetches). (hswong3i, Laruence) - . Fixed bug #52958 (Segfault in PDO_OCI on cleanup after running a long -testsuite). (hswong3i, Lars) + . Fixed bug #63980 (object members get trimmed by zero bytes). (Laruence) -?? ??? 2012, PHP 5.4.11 - -- Core: - . Fixed bug #63762 (Sigsegv when Exception::$trace is changed by user). -(Johannes) - . Fixed bug #43177 (Errors in eval()'ed code produce status code 500). -(Todd Ruth, Stas). - -- Filter: - . Fixed bug #63757 (getenv() produces memory leak with CGI SAPI). (Dmitry) - . Fixed bug #54096 (FILTER_VALIDATE_INT does not accept +0 and -0). -(martin at divbyzero dot net, Lars) - -- JSON: - . Fixed bug #63737 (json_decode does not properly decode with options -parameter). (Adam) - -- CLI server - . Update list of common mime types. Added webm, ogv, ogg. (Lars, -pascalc at gmail dot com) +- General improvements: + . Fixed bug #63874 (Segfault if php_strip_whitespace has heredoc). (Pierrick) + . Fixed bug #63822 (Crash when using closures with ArrayAccess). +(Nikita Popov) + . Add Generator::throw() method. (Nikita Popov) + . Bug #23955: allow specifying Max-Age attribute in setcookie() (narfbg, Lars) + . Bug #52126: timestamp for mail.log (Martin Jansen, Lars) -- cURL extension: - . Fixed bug (segfault due to libcurl connection caching). (Pierrick) - . Fixed bug #63859 (Memory leak when reusing curl-handle). (Pierrick) - . Fixed bug #63795 (CURL >= 7.28.0 no longer support value 1 for -CURLOPT_SSL_VERIFYHOST). (Pierrick) - . Fixed bug #63352 (Can't enable hostname validation when using curl stream -wrappers). (Pierrick) - . Fixed bug #55438 (Curlwapper is not sending http header randomly). -(php...@lostreality.org, Pierrick) +- mysqlnd + . Fixed return value of mysqli_stmt_affected_rows() in the time after +prepare() and before execute(). (Andrey) -20 Dec 2012, PHP 5.4.10 +- cURL: + . Added new functions curl_escape, curl_multi_setopt, curl_multi_strerror +curl_pause, curl_reset, curl_share_close, curl_share_init, + curl_share_setopt curl_strerror and curl_unescape. (Pierrick) + . Addes new curl options CURLOPT_TELNETOPTIONS, CURLOPT_GSSAPI_DELEGATION, +CURLOPT_ACCEPTTIMEOUT_MS, CURLOPT_SSL_OPTIONS, CURLOPT_TCP_KEEPALIVE, + CURLOPT_TCP_KEEPIDLE and CURLOPT_TCP_KEEPINTVL. (Pierrick) -- Core: - . Fixed bug #63726 (Memleak with static properties and internal/user -classes). (Laruence) - . Fixed bug #63635 (Segfault in gc_collect_cycles). (Dmitry) - . Fixed bug #63512 (parse_ini_file() with INI_SCANNER_RAW removes quotes -from value). (Pierrick) - . Fixed bug #63468 (wrong called method as callback with inheritance). -(Laruence) - . Fixed bug #63451 (config.guess file
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: NEWS
Commit:142c40f32c075a8eb706f2e630b934f39e711b70 Author:Adam Harvey Wed, 16 Jan 2013 10:18:00 +0800 Parents: 9498cf6194496a1dd6b400e3e9a85ff005dc3dcd f63a9f6c11c05aa76158b6cae0e05340d303a6af Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=142c40f32c075a8eb706f2e630b934f39e711b70 Log: Merge branch 'PHP-5.3' into PHP-5.4 * PHP-5.3: Update the arguments in the prototype of fpm_socket_unix_test_connect(). Changed paths: MM NEWS Diff: diff --cc NEWS index bcff155,928d829..8fc3d6c --- a/NEWS +++ b/NEWS @@@ -1,58 -1,17 +1,61 @@@ PHP NEWS ||| -?? ??? 2013, PHP 5.3.23 +?? ??? 2012, PHP 5.4.12 -?? ??? 2013, PHP 5.3.22 - -- Zend Engine: +- Core: + . Fixed bug #63982 (isset() inconsistently produces a fatal error on +protected property). (Stas) + . Fixed bug #63943 (Bad warning text from strpos() on empty needle). +(Laruence) . Fixed bug #63899 (Use after scope error in zend_compile). (Laruence) + . Fixed bug #63893 (Poor efficiency of strtr() using array with keys of very +different length). (Gustavo) + . Fixed bug #63882 (zend_std_compare_objects crash on recursion). (Dmitry) + . Support BITMAPV5HEADER in getimagesize(). (AsamK, Lars) + +- Date: + . Fixed bug #63699 (Performance improvements for various ext/date functions). +(Lars, original patch by njaguar at gmail dot com) + . Fixed bug #55397: Comparsion of incomplete DateTime causes SIGSEGV. +(Derick) + ++- FPM: ++ . Fixed bug #63999 (php with fpm fails to build on Solaris 10 or 11). (Adam) ++ +- Litespeed: + . Fixed bug #63228 (-Werror=format-security error in lsapi code). (George) + +- ext/sqlite3: + . Fixed bug #63921 (sqlite3::bindvalue and relative PHP functions aren't +using sqlite3_*_int64 API). (srgoogleguy, Lars) + +- PDO_sqlite: + . Fixed bug #63916 (PDO::PARAM_INT casts to 32bit int internally even +on 64bit builds in pdo_sqlite). (srgoogleguy, Lars) + . Fixed bug #57702 (Multi-row BLOB fetches). (hswong3i, Laruence) + . Fixed bug #52958 (Segfault in PDO_OCI on cleanup after running a long +testsuite). (hswong3i, Lars) + +?? ??? 2012, PHP 5.4.11 + +- Core: . Fixed bug #63762 (Sigsegv when Exception::$trace is changed by user). (Johannes) + . Fixed bug #43177 (Errors in eval()'ed code produce status code 500). +(Todd Ruth, Stas). -- Core - . Fixed bug #63943 (Bad warning text from strpos() on empty needle). -(Laruence) +- Filter: + . Fixed bug #63757 (getenv() produces memory leak with CGI SAPI). (Dmitry) + . Fixed bug #54096 (FILTER_VALIDATE_INT does not accept +0 and -0). +(martin at divbyzero dot net, Lars) + +- JSON: + . Fixed bug #63737 (json_decode does not properly decode with options +parameter). (Adam) + +- CLI server + . Update list of common mime types. Added webm, ogv, ogg. (Lars, +pascalc at gmail dot com) - cURL extension: . Fixed bug (segfault due to libcurl connection caching). (Pierrick) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Update the arguments in the prototype of fpm_socket_unix_test_connect().: NEWS sapi/fpm/fpm/fpm_sockets.h
Commit:f63a9f6c11c05aa76158b6cae0e05340d303a6af Author:Adam Harvey Wed, 16 Jan 2013 10:06:56 +0800 Parents: c077074c1379b5faed386106fdbb53f5d17fd6e7 Branches: PHP-5.3 PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f63a9f6c11c05aa76158b6cae0e05340d303a6af Log: Update the arguments in the prototype of fpm_socket_unix_test_connect(). Fixes bug #63999 (php with fpm fails to build on Solaris 10 or 11). Bugs: https://bugs.php.net/63999 Changed paths: M NEWS M sapi/fpm/fpm/fpm_sockets.h Diff: diff --git a/NEWS b/NEWS index e78af23..928d829 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,9 @@ PHP NEWS . Fixed bug #55397 (comparsion of incomplete DateTime causes SIGSEGV). (Laruence, Derick) +- FPM: + . Fixed bug #63999 (php with fpm fails to build on Solaris 10 or 11). (Adam) + 20 Dec 2012, PHP 5.3.20 - Zend Engine: diff --git a/sapi/fpm/fpm/fpm_sockets.h b/sapi/fpm/fpm/fpm_sockets.h index 499ba6b..cce5712 100644 --- a/sapi/fpm/fpm/fpm_sockets.h +++ b/sapi/fpm/fpm/fpm_sockets.h @@ -25,7 +25,7 @@ enum fpm_address_domain fpm_sockets_domain_from_address(char *addr); int fpm_sockets_init_main(); int fpm_socket_get_listening_queue(int sock, unsigned *cur_lq, unsigned *max_lq); -int fpm_socket_unix_test_connect(struct sockaddr_un *sun, size_t socklen); +int fpm_socket_unix_test_connect(struct sockaddr_un *sock, size_t socklen); static inline int fd_set_blocked(int fd, int blocked) /* {{{ */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: NEWS ext/standard/file.c
Commit:b1bf524140f3825d161c6e8f922b696d91b93969 Author:Adam Harvey Tue, 15 Jan 2013 17:35:34 +0800 Parents: 374ebc87416d9e31efd961a3176510e3a901355b c077074c1379b5faed386106fdbb53f5d17fd6e7 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b1bf524140f3825d161c6e8f922b696d91b93969 Log: Merge branch 'PHP-5.3' into PHP-5.4 * PHP-5.3: Revert "Update fputcsv() to escape all characters equally." Changed paths: MM NEWS MM ext/standard/file.c Diff: diff --cc NEWS index 5f45667,e78af23..8201ce1 --- a/NEWS +++ b/NEWS @@@ -1,58 -1,17 +1,56 @@@ PHP NEWS ||| -?? ??? 2013, PHP 5.3.23 +?? ??? 2012, PHP 5.4.12 -?? ??? 2013, PHP 5.3.22 - -- Zend Engine: +- Core: + . Fixed bug #63982 (isset() inconsistently produces a fatal error on +protected property). (Stas) + . Fixed bug #63943 (Bad warning text from strpos() on empty needle). +(Laruence) . Fixed bug #63899 (Use after scope error in zend_compile). (Laruence) + . Fixed bug #63882 (zend_std_compare_objects crash on recursion). (Dmitry) - . Fixed bug #43225 (fputcsv incorrectly handles cells ending in \ followed - by "). (Adam) + . Support BITMAPV5HEADER in getimagesize(). (AsamK, Lars) + +- Date: + . Fixed bug #63699 (Performance improvements for various ext/date functions). +(Lars, original patch by njaguar at gmail dot com) + . Fixed bug #55397: Comparsion of incomplete DateTime causes SIGSEGV. +(Derick) + +- Litespeed: + . Fixed bug #63228 (-Werror=format-security error in lsapi code). (George) + +- ext/sqlite3: + . Fixed bug #63921 (sqlite3::bindvalue and relative PHP functions aren't +using sqlite3_*_int64 API). (srgoogleguy, Lars) + +- PDO_sqlite: + . Fixed bug #63916 (PDO::PARAM_INT casts to 32bit int internally even +on 64bit builds in pdo_sqlite). (srgoogleguy, Lars) + . Fixed bug #57702 (Multi-row BLOB fetches). (hswong3i, Laruence) + . Fixed bug #52958 (Segfault in PDO_OCI on cleanup after running a long +testsuite). (hswong3i, Lars) + +?? ??? 2012, PHP 5.4.11 + +- Core: . Fixed bug #63762 (Sigsegv when Exception::$trace is changed by user). (Johannes) + . Fixed bug #43177 (Errors in eval()'ed code produce status code 500). +(Todd Ruth, Stas). -- Core - . Fixed bug #63943 (Bad warning text from strpos() on empty needle). -(Laruence) +- Filter: + . Fixed bug #63757 (getenv() produces memory leak with CGI SAPI). (Dmitry) + . Fixed bug #54096 (FILTER_VALIDATE_INT does not accept +0 and -0). +(martin at divbyzero dot net, Lars) + +- JSON: + . Fixed bug #63737 (json_decode does not properly decode with options +parameter). (Adam) + +- CLI server + . Update list of common mime types. Added webm, ogv, ogg. (Lars, +pascalc at gmail dot com) - cURL extension: . Fixed bug (segfault due to libcurl connection caching). (Pierrick) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Revert "Update fputcsv() to escape all characters equally.": NEWS ext/standard/file.c ext/standard/tests/file/fputcsv.phpt ext/standard/tests/file/fputcsv_bug43225.phpt
Commit:c077074c1379b5faed386106fdbb53f5d17fd6e7 Author:Adam Harvey Tue, 15 Jan 2013 17:33:54 +0800 Parents: 9b5cb0e8059b1e8bec096067491ed8d75f878938 Branches: PHP-5.3 PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c077074c1379b5faed386106fdbb53f5d17fd6e7 Log: Revert "Update fputcsv() to escape all characters equally." On second thoughts, while the behaviour _is_ broken, this isn't the right fix. This reverts commit 9b5cb0e8059b1e8bec096067491ed8d75f878938. Changed paths: M NEWS M ext/standard/file.c M ext/standard/tests/file/fputcsv.phpt D ext/standard/tests/file/fputcsv_bug43225.phpt Diff: diff --git a/NEWS b/NEWS index a7c2fa4..e78af23 100644 --- a/NEWS +++ b/NEWS @@ -12,8 +12,6 @@ PHP NEWS - Core . Fixed bug #63943 (Bad warning text from strpos() on empty needle). (Laruence) - . Fixed bug #43225 (fputcsv incorrectly handles cells ending in \ followed -by "). (Adam) - cURL extension: . Fixed bug (segfault due to libcurl connection caching). (Pierrick) diff --git a/ext/standard/file.c b/ext/standard/file.c index fa85bf1..8b18155 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1953,6 +1953,7 @@ PHP_FUNCTION(fputcsv) { char delimiter = ','; /* allow this to be set as parameter */ char enclosure = '"'; /* allow this to be set as parameter */ + const char escape_char = '\\'; php_stream *stream; int ret; zval *fp = NULL, *fields = NULL, **field_tmp = NULL, field; @@ -2007,19 +2008,24 @@ PHP_FUNCTION(fputcsv) /* enclose a field that contains a delimiter, an enclosure character, or a newline */ if (FPUTCSV_FLD_CHK(delimiter) || FPUTCSV_FLD_CHK(enclosure) || + FPUTCSV_FLD_CHK(escape_char) || FPUTCSV_FLD_CHK('\n') || FPUTCSV_FLD_CHK('\r') || FPUTCSV_FLD_CHK('\t') || - FPUTCSV_FLD_CHK('\\') || FPUTCSV_FLD_CHK(' ') ) { char *ch = Z_STRVAL(field); char *end = ch + Z_STRLEN(field); + int escaped = 0; smart_str_appendc(&csvline, enclosure); while (ch < end) { - if (*ch == enclosure) { + if (*ch == escape_char) { + escaped = 1; + } else if (!escaped && *ch == enclosure) { smart_str_appendc(&csvline, enclosure); + } else { + escaped = 0; } smart_str_appendc(&csvline, *ch); ch++; diff --git a/ext/standard/tests/file/fputcsv.phpt b/ext/standard/tests/file/fputcsv.phpt index d71f777..63c4150 100644 --- a/ext/standard/tests/file/fputcsv.phpt +++ b/ext/standard/tests/file/fputcsv.phpt @@ -44,7 +44,7 @@ echo '$list = ';var_export($res);echo ";\n"; $fp = fopen($file, "r"); $res = array(); -while($l=fgetcsv($fp, 0, ',', '"', '"')) +while($l=fgetcsv($fp)) { $res[] = join(',',$l); } @@ -75,10 +75,10 @@ $list = array ( 13 => 'aaa,"""bbb """', 14 => '"aaa""aaa""","""bbb""bbb"', 15 => '"aaa""aaa""""""",bbb', - 16 => 'aaa,"""\\""bbb",ccc', - 17 => '"aaa""\\""a""","""bbb"""', - 18 => '"""\\""""","""aaa"""', - 19 => '"""\\""""""",aaa', + 16 => 'aaa,"""\\"bbb",ccc', + 17 => '"aaa""\\"a""","""bbb"""', + 18 => '"""\\"""","""aaa"""', + 19 => '"""\\"""""",aaa', ); $list = array ( 0 => 'aaa,bbb', diff --git a/ext/standard/tests/file/fputcsv_bug43225.phpt b/ext/standard/tests/file/fputcsv_bug43225.phpt deleted file mode 100644 index 1de3b5f..000 --- a/ext/standard/tests/file/fputcsv_bug43225.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -fputcsv(): bug #43225 (fputcsv incorrectly handles cells ending in \ followed by ") ---FILE-- - ---EXPECT-- -"a\""",bbb -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Revert "Update fputcsv() to escape all characters equally.": ext/standard/file.c ext/standard/tests/file/fputcsv.phpt ext/standard/tests/file/fputcsv_bug43225.phpt
Commit:cab290d2adbd616a18b9efaace6abe629f827190 Author:Adam Harvey Tue, 15 Jan 2013 17:33:54 +0800 Parents: dc495bbe95680a9cf2321da83a382d834d70758c Branches: PHP-5.5 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cab290d2adbd616a18b9efaace6abe629f827190 Log: Revert "Update fputcsv() to escape all characters equally." On second thoughts, while the behaviour _is_ broken, this isn't the right fix. This reverts commit 9b5cb0e8059b1e8bec096067491ed8d75f878938. Changed paths: M ext/standard/file.c M ext/standard/tests/file/fputcsv.phpt D ext/standard/tests/file/fputcsv_bug43225.phpt Diff: diff --git a/ext/standard/file.c b/ext/standard/file.c index 574fb53..74577ac 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1871,16 +1871,20 @@ PHPAPI int php_fputcsv(php_stream *stream, zval *fields, char delimiter, char en FPUTCSV_FLD_CHK('\n') || FPUTCSV_FLD_CHK('\r') || FPUTCSV_FLD_CHK('\t') || - FPUTCSV_FLD_CHK('\\') || FPUTCSV_FLD_CHK(' ') ) { char *ch = Z_STRVAL(field); char *end = ch + Z_STRLEN(field); + int escaped = 0; smart_str_appendc(&csvline, enclosure); while (ch < end) { - if (*ch == enclosure) { + if (*ch == escape_char) { + escaped = 1; + } else if (!escaped && *ch == enclosure) { smart_str_appendc(&csvline, enclosure); + } else { + escaped = 0; } smart_str_appendc(&csvline, *ch); ch++; diff --git a/ext/standard/tests/file/fputcsv.phpt b/ext/standard/tests/file/fputcsv.phpt index d71f777..63c4150 100644 --- a/ext/standard/tests/file/fputcsv.phpt +++ b/ext/standard/tests/file/fputcsv.phpt @@ -44,7 +44,7 @@ echo '$list = ';var_export($res);echo ";\n"; $fp = fopen($file, "r"); $res = array(); -while($l=fgetcsv($fp, 0, ',', '"', '"')) +while($l=fgetcsv($fp)) { $res[] = join(',',$l); } @@ -75,10 +75,10 @@ $list = array ( 13 => 'aaa,"""bbb """', 14 => '"aaa""aaa""","""bbb""bbb"', 15 => '"aaa""aaa""""""",bbb', - 16 => 'aaa,"""\\""bbb",ccc', - 17 => '"aaa""\\""a""","""bbb"""', - 18 => '"""\\""""","""aaa"""', - 19 => '"""\\""""""",aaa', + 16 => 'aaa,"""\\"bbb",ccc', + 17 => '"aaa""\\"a""","""bbb"""', + 18 => '"""\\"""","""aaa"""', + 19 => '"""\\"""""",aaa', ); $list = array ( 0 => 'aaa,bbb', diff --git a/ext/standard/tests/file/fputcsv_bug43225.phpt b/ext/standard/tests/file/fputcsv_bug43225.phpt deleted file mode 100644 index 1de3b5f..000 --- a/ext/standard/tests/file/fputcsv_bug43225.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -fputcsv(): bug #43225 (fputcsv incorrectly handles cells ending in \ followed by ") ---FILE-- - ---EXPECT-- -"a\""",bbb -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Revert "Update fputcsv() to escape all characters equally.": ext/standard/file.c ext/standard/tests/file/fputcsv.phpt ext/standard/tests/file/fputcsv_bug43225.phpt
Commit:232cf4a640f00932e8030b0d57541a8d5c286309 Author:Adam Harvey Tue, 15 Jan 2013 17:33:54 +0800 Parents: c77fe090ea8dcbf0ceab924c748182ea472ef32d Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=232cf4a640f00932e8030b0d57541a8d5c286309 Log: Revert "Update fputcsv() to escape all characters equally." On second thoughts, while the behaviour _is_ broken, this isn't the right fix. This reverts commit 9b5cb0e8059b1e8bec096067491ed8d75f878938. Changed paths: M ext/standard/file.c M ext/standard/tests/file/fputcsv.phpt D ext/standard/tests/file/fputcsv_bug43225.phpt Diff: diff --git a/ext/standard/file.c b/ext/standard/file.c index 574fb53..74577ac 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1871,16 +1871,20 @@ PHPAPI int php_fputcsv(php_stream *stream, zval *fields, char delimiter, char en FPUTCSV_FLD_CHK('\n') || FPUTCSV_FLD_CHK('\r') || FPUTCSV_FLD_CHK('\t') || - FPUTCSV_FLD_CHK('\\') || FPUTCSV_FLD_CHK(' ') ) { char *ch = Z_STRVAL(field); char *end = ch + Z_STRLEN(field); + int escaped = 0; smart_str_appendc(&csvline, enclosure); while (ch < end) { - if (*ch == enclosure) { + if (*ch == escape_char) { + escaped = 1; + } else if (!escaped && *ch == enclosure) { smart_str_appendc(&csvline, enclosure); + } else { + escaped = 0; } smart_str_appendc(&csvline, *ch); ch++; diff --git a/ext/standard/tests/file/fputcsv.phpt b/ext/standard/tests/file/fputcsv.phpt index d71f777..63c4150 100644 --- a/ext/standard/tests/file/fputcsv.phpt +++ b/ext/standard/tests/file/fputcsv.phpt @@ -44,7 +44,7 @@ echo '$list = ';var_export($res);echo ";\n"; $fp = fopen($file, "r"); $res = array(); -while($l=fgetcsv($fp, 0, ',', '"', '"')) +while($l=fgetcsv($fp)) { $res[] = join(',',$l); } @@ -75,10 +75,10 @@ $list = array ( 13 => 'aaa,"""bbb """', 14 => '"aaa""aaa""","""bbb""bbb"', 15 => '"aaa""aaa""""""",bbb', - 16 => 'aaa,"""\\""bbb",ccc', - 17 => '"aaa""\\""a""","""bbb"""', - 18 => '"""\\""""","""aaa"""', - 19 => '"""\\""""""",aaa', + 16 => 'aaa,"""\\"bbb",ccc', + 17 => '"aaa""\\"a""","""bbb"""', + 18 => '"""\\"""","""aaa"""', + 19 => '"""\\"""""",aaa', ); $list = array ( 0 => 'aaa,bbb', diff --git a/ext/standard/tests/file/fputcsv_bug43225.phpt b/ext/standard/tests/file/fputcsv_bug43225.phpt deleted file mode 100644 index 1de3b5f..000 --- a/ext/standard/tests/file/fputcsv_bug43225.phpt +++ /dev/null @@ -1,20 +0,0 @@ ---TEST-- -fputcsv(): bug #43225 (fputcsv incorrectly handles cells ending in \ followed by ") ---FILE-- - ---EXPECT-- -"a\""",bbb -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Revert "Apply the fputcsv test fix to SplFileObject_fputcsv.phpt. Mea culpa.": ext/spl/tests/SplFileObject_fputcsv.phpt
Commit:40c1122dcc8d74b063d5b6f06d5ce52ff7b3dcc3 Author:Adam Harvey Tue, 15 Jan 2013 17:37:21 +0800 Parents: 232cf4a640f00932e8030b0d57541a8d5c286309 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=40c1122dcc8d74b063d5b6f06d5ce52ff7b3dcc3 Log: Revert "Apply the fputcsv test fix to SplFileObject_fputcsv.phpt. Mea culpa." This reverts commit 0510701474e8d99b5b30139b5599e44f9b555a5a. Changed paths: M ext/spl/tests/SplFileObject_fputcsv.phpt Diff: diff --git a/ext/spl/tests/SplFileObject_fputcsv.phpt b/ext/spl/tests/SplFileObject_fputcsv.phpt index 601edab..66fdbfd 100644 --- a/ext/spl/tests/SplFileObject_fputcsv.phpt +++ b/ext/spl/tests/SplFileObject_fputcsv.phpt @@ -42,7 +42,7 @@ echo '$list = ';var_export($res);echo ";\n"; $fp = fopen($file, "r"); $res = array(); -while($l=fgetcsv($fp, 0, ',', '"', '"')) +while($l=fgetcsv($fp)) { $res[] = join(',',$l); } @@ -76,10 +76,10 @@ $list = array ( 13 => 'aaa,"""bbb """', 14 => '"aaa""aaa""","""bbb""bbb"', 15 => '"aaa""aaa""""""",bbb', - 16 => 'aaa,"""\\""bbb",ccc', - 17 => '"aaa""\\""a""","""bbb"""', - 18 => '"""\\""""","""aaa"""', - 19 => '"""\\""""""",aaa', + 16 => 'aaa,"""\\"bbb",ccc', + 17 => '"aaa""\\"a""","""bbb"""', + 18 => '"""\\"""","""aaa"""', + 19 => '"""\\"""""",aaa', ); $list = array ( 0 => 'aaa,bbb', -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Revert "Apply the fputcsv test fix to SplFileObject_fputcsv.phpt. Mea culpa.": ext/spl/tests/SplFileObject_fputcsv.phpt
Commit:ef86530a561ad3d6374b81909d6dd336159fb465 Author:Adam Harvey Tue, 15 Jan 2013 17:37:21 +0800 Parents: cab290d2adbd616a18b9efaace6abe629f827190 Branches: PHP-5.5 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ef86530a561ad3d6374b81909d6dd336159fb465 Log: Revert "Apply the fputcsv test fix to SplFileObject_fputcsv.phpt. Mea culpa." This reverts commit 0510701474e8d99b5b30139b5599e44f9b555a5a. Changed paths: M ext/spl/tests/SplFileObject_fputcsv.phpt Diff: diff --git a/ext/spl/tests/SplFileObject_fputcsv.phpt b/ext/spl/tests/SplFileObject_fputcsv.phpt index 601edab..66fdbfd 100644 --- a/ext/spl/tests/SplFileObject_fputcsv.phpt +++ b/ext/spl/tests/SplFileObject_fputcsv.phpt @@ -42,7 +42,7 @@ echo '$list = ';var_export($res);echo ";\n"; $fp = fopen($file, "r"); $res = array(); -while($l=fgetcsv($fp, 0, ',', '"', '"')) +while($l=fgetcsv($fp)) { $res[] = join(',',$l); } @@ -76,10 +76,10 @@ $list = array ( 13 => 'aaa,"""bbb """', 14 => '"aaa""aaa""","""bbb""bbb"', 15 => '"aaa""aaa""""""",bbb', - 16 => 'aaa,"""\\""bbb",ccc', - 17 => '"aaa""\\""a""","""bbb"""', - 18 => '"""\\""""","""aaa"""', - 19 => '"""\\""""""",aaa', + 16 => 'aaa,"""\\"bbb",ccc', + 17 => '"aaa""\\"a""","""bbb"""', + 18 => '"""\\"""","""aaa"""', + 19 => '"""\\"""""",aaa', ); $list = array ( 0 => 'aaa,bbb', -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Revert "Apply the fputcsv test fix to SplFileObject_fputcsv.phpt. Mea culpa.": ext/spl/tests/SplFileObject_fputcsv.phpt
Commit:83864b470b030a7d1bd0a1b46d3be75ce301304c Author:Adam Harvey Tue, 15 Jan 2013 17:37:21 +0800 Parents: b1bf524140f3825d161c6e8f922b696d91b93969 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=83864b470b030a7d1bd0a1b46d3be75ce301304c Log: Revert "Apply the fputcsv test fix to SplFileObject_fputcsv.phpt. Mea culpa." This reverts commit 0510701474e8d99b5b30139b5599e44f9b555a5a. Changed paths: M ext/spl/tests/SplFileObject_fputcsv.phpt Diff: diff --git a/ext/spl/tests/SplFileObject_fputcsv.phpt b/ext/spl/tests/SplFileObject_fputcsv.phpt index 601edab..66fdbfd 100644 --- a/ext/spl/tests/SplFileObject_fputcsv.phpt +++ b/ext/spl/tests/SplFileObject_fputcsv.phpt @@ -42,7 +42,7 @@ echo '$list = ';var_export($res);echo ";\n"; $fp = fopen($file, "r"); $res = array(); -while($l=fgetcsv($fp, 0, ',', '"', '"')) +while($l=fgetcsv($fp)) { $res[] = join(',',$l); } @@ -76,10 +76,10 @@ $list = array ( 13 => 'aaa,"""bbb """', 14 => '"aaa""aaa""","""bbb""bbb"', 15 => '"aaa""aaa""""""",bbb', - 16 => 'aaa,"""\\""bbb",ccc', - 17 => '"aaa""\\""a""","""bbb"""', - 18 => '"""\\""""","""aaa"""', - 19 => '"""\\""""""",aaa', + 16 => 'aaa,"""\\"bbb",ccc', + 17 => '"aaa""\\"a""","""bbb"""', + 18 => '"""\\"""","""aaa"""', + 19 => '"""\\"""""",aaa', ); $list = array ( 0 => 'aaa,bbb', -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Apply the fputcsv test fix to SplFileObject_fputcsv.phpt. Mea culpa.: ext/spl/tests/SplFileObject_fputcsv.phpt
Commit:0510701474e8d99b5b30139b5599e44f9b555a5a Author:Adam Harvey Tue, 15 Jan 2013 15:49:13 +0800 Parents: 3bc74903706ab08e916905a0bd634e77aa804def Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0510701474e8d99b5b30139b5599e44f9b555a5a Log: Apply the fputcsv test fix to SplFileObject_fputcsv.phpt. Mea culpa. Changed paths: M ext/spl/tests/SplFileObject_fputcsv.phpt Diff: diff --git a/ext/spl/tests/SplFileObject_fputcsv.phpt b/ext/spl/tests/SplFileObject_fputcsv.phpt index 66fdbfd..601edab 100644 --- a/ext/spl/tests/SplFileObject_fputcsv.phpt +++ b/ext/spl/tests/SplFileObject_fputcsv.phpt @@ -42,7 +42,7 @@ echo '$list = ';var_export($res);echo ";\n"; $fp = fopen($file, "r"); $res = array(); -while($l=fgetcsv($fp)) +while($l=fgetcsv($fp, 0, ',', '"', '"')) { $res[] = join(',',$l); } @@ -76,10 +76,10 @@ $list = array ( 13 => 'aaa,"""bbb """', 14 => '"aaa""aaa""","""bbb""bbb"', 15 => '"aaa""aaa""""""",bbb', - 16 => 'aaa,"""\\"bbb",ccc', - 17 => '"aaa""\\"a""","""bbb"""', - 18 => '"""\\"""","""aaa"""', - 19 => '"""\\"""""",aaa', + 16 => 'aaa,"""\\""bbb",ccc', + 17 => '"aaa""\\""a""","""bbb"""', + 18 => '"""\\""""","""aaa"""', + 19 => '"""\\""""""",aaa', ); $list = array ( 0 => 'aaa,bbb', -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/standard/file.c
Commit:ba329707101208db330acd3b07b96f90ab75a81f Author:Adam Harvey Tue, 15 Jan 2013 15:26:25 +0800 Parents: be1700d467a6875415c292f95040965fb359493c a4191b0aad94fb7bebb8fd5c4233006849845c31 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ba329707101208db330acd3b07b96f90ab75a81f Log: Merge branch 'PHP-5.4' into PHP-5.5 * PHP-5.4: Update fputcsv() to escape all characters equally. Changed paths: MM ext/standard/file.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: NEWS ext/standard/file.c
Commit:a4191b0aad94fb7bebb8fd5c4233006849845c31 Author:Adam Harvey Tue, 15 Jan 2013 15:24:21 +0800 Parents: 6a065876b9212404daaf8fee1708834da83dac56 9b5cb0e8059b1e8bec096067491ed8d75f878938 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a4191b0aad94fb7bebb8fd5c4233006849845c31 Log: Merge branch 'PHP-5.3' into PHP-5.4 * PHP-5.3: Update fputcsv() to escape all characters equally. Changed paths: MM NEWS MM ext/standard/file.c Diff: diff --cc NEWS index 58a50bb,a7c2fa4..14ee211 --- a/NEWS +++ b/NEWS @@@ -1,31 -1,10 +1,33 @@@ PHP NEWS ||| -?? ??? 2013, PHP 5.3.23 +?? ??? 2012, PHP 5.4.12 -?? ??? 2013, PHP 5.3.22 +- Core: + . Fixed bug #63982 (isset() inconsistently produces a fatal error on +protected property). (Stas) + . Fixed bug #63943 (Bad warning text from strpos() on empty needle). +(Laruence) + . Fixed bug #63882 (zend_std_compare_objects crash on recursion). (Dmitry) ++ . Fixed bug #43225 (fputcsv incorrectly handles cells ending in \ followed ++by "). (Adam) + . Support BITMAPV5HEADER in getimagesize(). (AsamK, Lars) -- Zend Engine: +- Litespeed: + . Fixed bug #63228 (-Werror=format-security error in lsapi code). (George) + +- ext/sqlite3: + . Fixed bug #63921 (sqlite3::bindvalue and relative PHP functions aren't +using sqlite3_*_int64 API). (srgoogleguy, Lars) + +- PDO_sqlite: + . Fixed bug #63916 (PDO::PARAM_INT casts to 32bit int internally even +on 64bit builds in pdo_sqlite). (srgoogleguy, Lars) + . Fixed bug #52958 (Segfault in PDO_OCI on cleanup after running a long +testsuite) (hswong3i, Lars) + +?? ??? 2012, PHP 5.4.11 + +- Core: . Fixed bug #63899 (Use after scope error in zend_compile). (Laruence) . Fixed bug #63762 (Sigsegv when Exception::$trace is changed by user). (Johannes) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Update fputcsv() to escape all characters equally.: NEWS ext/standard/file.c ext/standard/tests/file/fputcsv.phpt ext/standard/tests/file/fputcsv_bug43225.phpt
Commit:9b5cb0e8059b1e8bec096067491ed8d75f878938 Author:Adam Harvey Tue, 15 Jan 2013 15:17:45 +0800 Parents: e1410b5a70543856de3978603b41fbf2ca5d330c Branches: PHP-5.3 PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9b5cb0e8059b1e8bec096067491ed8d75f878938 Log: Update fputcsv() to escape all characters equally. At present, backslashes have special case handling within fputcsv(): when one is encountered within a field that's being escaped, escaping stops until the next instance of the enclosure character is hit. This can result in malformed CSV. Fixes bug #43225 (fputcsv incorrectly handles cells ending in \ followed by "). Bugs: https://bugs.php.net/43225 Changed paths: M NEWS M ext/standard/file.c M ext/standard/tests/file/fputcsv.phpt A ext/standard/tests/file/fputcsv_bug43225.phpt Diff: diff --git a/NEWS b/NEWS index e78af23..a7c2fa4 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,8 @@ PHP NEWS - Core . Fixed bug #63943 (Bad warning text from strpos() on empty needle). (Laruence) + . Fixed bug #43225 (fputcsv incorrectly handles cells ending in \ followed +by "). (Adam) - cURL extension: . Fixed bug (segfault due to libcurl connection caching). (Pierrick) diff --git a/ext/standard/file.c b/ext/standard/file.c index 8b18155..fa85bf1 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1953,7 +1953,6 @@ PHP_FUNCTION(fputcsv) { char delimiter = ','; /* allow this to be set as parameter */ char enclosure = '"'; /* allow this to be set as parameter */ - const char escape_char = '\\'; php_stream *stream; int ret; zval *fp = NULL, *fields = NULL, **field_tmp = NULL, field; @@ -2008,24 +2007,19 @@ PHP_FUNCTION(fputcsv) /* enclose a field that contains a delimiter, an enclosure character, or a newline */ if (FPUTCSV_FLD_CHK(delimiter) || FPUTCSV_FLD_CHK(enclosure) || - FPUTCSV_FLD_CHK(escape_char) || FPUTCSV_FLD_CHK('\n') || FPUTCSV_FLD_CHK('\r') || FPUTCSV_FLD_CHK('\t') || + FPUTCSV_FLD_CHK('\\') || FPUTCSV_FLD_CHK(' ') ) { char *ch = Z_STRVAL(field); char *end = ch + Z_STRLEN(field); - int escaped = 0; smart_str_appendc(&csvline, enclosure); while (ch < end) { - if (*ch == escape_char) { - escaped = 1; - } else if (!escaped && *ch == enclosure) { + if (*ch == enclosure) { smart_str_appendc(&csvline, enclosure); - } else { - escaped = 0; } smart_str_appendc(&csvline, *ch); ch++; diff --git a/ext/standard/tests/file/fputcsv.phpt b/ext/standard/tests/file/fputcsv.phpt index 63c4150..d71f777 100644 --- a/ext/standard/tests/file/fputcsv.phpt +++ b/ext/standard/tests/file/fputcsv.phpt @@ -44,7 +44,7 @@ echo '$list = ';var_export($res);echo ";\n"; $fp = fopen($file, "r"); $res = array(); -while($l=fgetcsv($fp)) +while($l=fgetcsv($fp, 0, ',', '"', '"')) { $res[] = join(',',$l); } @@ -75,10 +75,10 @@ $list = array ( 13 => 'aaa,"""bbb """', 14 => '"aaa""aaa""","""bbb""bbb"', 15 => '"aaa""aaa""""""",bbb', - 16 => 'aaa,"""\\"bbb",ccc', - 17 => '"aaa""\\"a""","""bbb"""', - 18 => '"""\\"""","""aaa"""', - 19 => '"""\\"""""",aaa', + 16 => 'aaa,"""\\""bbb",ccc', + 17 => '"aaa""\\""a""","""bbb"""', + 18 => '"""\\""""","""aaa"""', + 19 => '"""\\""""""",aaa', ); $list = array ( 0 => 'aaa,bbb', diff --git a/ext/standard/tests/file/fputcsv_bug43225.phpt b/ext/standard/tests/file/fputcsv_bug43225.phpt new file mode 100644 index 000..1de3b5f --- /dev/null +++ b/ext/standard/tests/file/fputcsv_bug43225.phpt @@ -0,0 +1,20 @@ +--TEST-- +fputcsv(): bug #43225 (fputcsv incorrectly handles cells ending in \ followed by ") +--FILE-- + +--EXPECT-- +"a\""",bbb -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com php-src: Bug #46408: Fix double formatting for PostgreSQL bound parameters: NEWS Zend/zend_operators.c Zend/zend_operators.h ext/pgsql/pgsql.c ext/pgsql/tests/bug46408.phpt
On 15 January 2013 04:23, Lars Strojny wrote: > diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c > index bd9..274893c 100644 > --- a/Zend/zend_operators.c > +++ b/Zend/zend_operators.c > @@ -572,6 +572,24 @@ ZEND_API void convert_to_boolean(zval *op) /* {{{ */ > } > /* }}} */ > > +ZEND_API void _convert_to_cstring(zval *op ZEND_FILE_LINE_DC) /* {{{ */ > +{ > + double dval; > + switch (Z_TYPE_P(op)) { > + case IS_DOUBLE: { > + TSRMLS_FETCH(); > + dval = Z_DVAL_P(op); > + Z_STRLEN_P(op) = zend_spprintf(&Z_STRVAL_P(op), 0, > "%.*H", (int) EG(precision), dval); > + /* %H already handles removing trailing zeros from > the fractional part, yay */ > + break; > + } > + default: > + return _convert_to_string(op); > + } > + Z_TYPE_P(op) = IS_STRING; > +} > +/* }}} */ > + > ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC) /* {{{ */ > { > long lval; This broke compilation — specifically, the default: code path. I've opened https://github.com/php/php-src/pull/261 to fix this, if someone with Zend karma would be so kind. Thanks, Adam -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Tinker with UPGRADING's wording for the format string changes for clarity.: UPGRADING
Commit:fe27146b1b533e046e9a5841bb6e5685296208a8 Author:Adam Harvey Mon, 14 Jan 2013 13:54:43 +0800 Parents: 30fd25bb498f8cb1f4cc45e576f04535d8dd0d2d Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=fe27146b1b533e046e9a5841bb6e5685296208a8 Log: Tinker with UPGRADING's wording for the format string changes for clarity. Changed paths: M UPGRADING Diff: diff --git a/UPGRADING b/UPGRADING index f65e868..6c53084 100755 --- a/UPGRADING +++ b/UPGRADING @@ -105,10 +105,11 @@ PHP 5.5 UPGRADE NOTES - pack()/unpack() had the following changes, which bring it more in line with Perl's behavior: - - Implemented format character "Z": NUL-padded string - - "a" now does not remove trailing NUL characters on unpack() anymore - - "A" will now strip all trailing ASCII whitespace on unpack() (it used to -remove only trailing spaces). + - Implemented format character "Z": NULL padded string, with trailing NULL +bytes removed. + - Changed format character "a": this no longer removes trailing NULL bytes. + - Changed format character "A": all trailing ASCII whitespace is now removed +(defined as spaces, tabs, \r, \n and NULL). - MessageFormatter::format() and related functions now accepted named arguments and mixed numeric/named arguments in ICU 4.8+. - MessageFormatter::format() and related functions now don't error out when -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: sapi/litespeed/lsapi_main.c: Fix bug #63228: sapi/litespeed/lsapi_main.c
Commit:9c52d09ebc62683f26338123bcda8068f162541d Author:George Wang Fri, 12 Oct 2012 13:04:22 -0400 Committer: Adam Harvey Tue, 8 Jan 2013 11:40:13 +0800 Parents: 0de5fb4165aa7693fd90c44e61bf885a04322d0f Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=9c52d09ebc62683f26338123bcda8068f162541d Log: sapi/litespeed/lsapi_main.c: Fix bug #63228 Fix compiling error at line 606 (error: format not a string literal and no format arguments [-Werror=format-security] Bugs: https://bugs.php.net/63228 Changed paths: M sapi/litespeed/lsapi_main.c Diff: diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c index 3e04df9..f33b049 100644 --- a/sapi/litespeed/lsapi_main.c +++ b/sapi/litespeed/lsapi_main.c @@ -603,7 +603,7 @@ static void cli_usage( TSRMLS_D ) " args...Arguments passed to script.\n"; php_output_startup(); php_output_activate(TSRMLS_C); -php_printf( usage ); +php_printf( "%s", usage ); #ifdef PHP_OUTPUT_NEWAPI php_output_end_all(TSRMLS_C); #else -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Add NEWS for the previously cherry picked commit.: NEWS
Commit:6e684e6a6ceac89ad51f822493f702a6925a2d37 Author:Adam Harvey Tue, 8 Jan 2013 11:40:51 +0800 Parents: 9c52d09ebc62683f26338123bcda8068f162541d Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6e684e6a6ceac89ad51f822493f702a6925a2d37 Log: Add NEWS for the previously cherry picked commit. Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index 75c9816..9fca188 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,9 @@ PHP NEWS ||| ?? ??? 2012, PHP 5.4.12 +- Litespeed: + . Fixed bug #63228 (-Werror=format-security error in lsapi code). (George) + ?? ??? 2012, PHP 5.4.11 - Core: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: ext/json/json.c
Commit:8bb106d20c8f36d814772c45d693af2b42b06732 Author:Adam Harvey Tue, 11 Dec 2012 19:53:02 +0800 Parents: ec83534d88da4c96777b86d8db7fd20a52ed012e 2d1694d4ebd51ab61f12e6bc545a17e3baf3b4a0 Branches: PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8bb106d20c8f36d814772c45d693af2b42b06732 Log: Merge branch 'PHP-5.4' into PHP-5.5 * PHP-5.4: Alter php_json_decode_ex() to respect JSON_BIGINT_AS_STRING for bare numbers. Changed paths: MM ext/json/json.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Alter php_json_decode_ex() to respect JSON_BIGINT_AS_STRING for bare numbers.: NEWS ext/json/json.c ext/json/tests/bug63737.phpt
Commit:2d1694d4ebd51ab61f12e6bc545a17e3baf3b4a0 Author:Adam Harvey Tue, 11 Dec 2012 19:51:30 +0800 Parents: 95fd52ff3d3cc2162baf4d30fe06cf37da398050 Branches: PHP-5.4 PHP-5.5 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2d1694d4ebd51ab61f12e6bc545a17e3baf3b4a0 Log: Alter php_json_decode_ex() to respect JSON_BIGINT_AS_STRING for bare numbers. Fixes bug #63737 (json_decode does not properly decode with options parameter). Bugs: https://bugs.php.net/63737 Changed paths: M NEWS M ext/json/json.c A ext/json/tests/bug63737.phpt Diff: diff --git a/NEWS b/NEWS index 29b62a3..0504472 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||| ?? ??? 2012, PHP 5.4.11 +- JSON: + . Fixed bug #63737 (json_decode does not properly decode with options +parameter). (Adam) + ?? ??? 2012, PHP 5.4.10 - Core: diff --git a/ext/json/json.c b/ext/json/json.c index fb01529..e26c369 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -682,7 +682,7 @@ PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, int str_len, else { double d; - int type; + int type, overflow_info; long p; RETVAL_NULL(); @@ -698,11 +698,36 @@ PHP_JSON_API void php_json_decode_ex(zval *return_value, char *str, int str_len, RETVAL_BOOL(0); } - if ((type = is_numeric_string(str, str_len, &p, &d, 0)) != 0) { + if ((type = is_numeric_string_ex(str, str_len, &p, &d, 0, &overflow_info)) != 0) { if (type == IS_LONG) { RETVAL_LONG(p); } else if (type == IS_DOUBLE) { - RETVAL_DOUBLE(d); + if (options & PHP_JSON_BIGINT_AS_STRING && overflow_info) { + /* Within an object or array, a numeric literal is assumed +* to be an integer if and only if it's entirely made up of +* digits (exponent notation will result in the number +* being treated as a double). We'll match that behaviour +* here. */ + int i; + zend_bool is_float = 0; + + for (i = (str[0] == '-' ? 1 : 0); i < str_len; i++) { + /* Not using isdigit() because it's locale specific, +* but we expect JSON input to always be UTF-8. */ + if (str[i] < '0' || str[i] > '9') { + is_float = 1; + break; + } + } + + if (is_float) { + RETVAL_DOUBLE(d); + } else { + RETVAL_STRINGL(str, str_len, 1); + } + } else { + RETVAL_DOUBLE(d); + } } } diff --git a/ext/json/tests/bug63737.phpt b/ext/json/tests/bug63737.phpt new file mode 100644 index 000..1fb06d4 --- /dev/null +++ b/ext/json/tests/bug63737.phpt @@ -0,0 +1,32 @@ +--TEST-- +Bug #63737 (json_decode does not properly decode with options parameter) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +float(1.2345678901235E+29) +string(30) "123456789012345678901234567890" +float(-1.2345678901235E+29) +string(31) "-123456789012345678901234567890" +float(1.2345678901235E+29) +float(1.2345678901235E+29) +float(-1.2345678901235E+29) +float(-1.2345678901235E+29) +Done -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Tinker with the wording of the MySQL deprecation news post.: NEWS
Commit:ec83534d88da4c96777b86d8db7fd20a52ed012e Author:Adam Harvey Tue, 11 Dec 2012 09:08:07 +0800 Parents: b7091aaf0137d97cf4aa4a402ec50b3946d369c0 Branches: PHP-5.5 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ec83534d88da4c96777b86d8db7fd20a52ed012e Log: Tinker with the wording of the MySQL deprecation news post. I know that in general NEWS is a very punchy "this is what happened" log, but Chris e-mailed me off-list to ask if it could be added to avoid any FUD — this merely brings the NEWS post into line with UPGRADING, the migration guide, and every other piece of advice we're giving out. I also forgot to add the RFC URL last night, so added that. Changed paths: M NEWS Diff: diff --git a/NEWS b/NEWS index ce5f08c..40fab8a 100644 --- a/NEWS +++ b/NEWS @@ -166,7 +166,8 @@ PHP NEWS - MySQL . This extension is now deprecated, and deprecation warnings will be generated when connections are established to databases via mysql_connect(), -mysql_pconnect(), or through implicit connection. (Adam) +mysql_pconnect(), or through implicit connection: use MySQLi or PDO_MySQL +instead (https://wiki.php.net/rfc/mysql_deprecation). (Adam) - MySQLi . Dropped support for LOAD DATA LOCAL INFILE handlers when using libmysql. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com php-src: Two tests deactivated until #63688 was fixed: tests/lang/034.phpt tests/lang/bug30638.phpt
On 6 December 2012 06:24, Christopher Jones wrote: > On 12/05/2012 01:40 AM, Anatoliy Belsky wrote: >> >> That's a windows specific fail, the tests still pass on linux. XFAIL >> would mark that wrong on linux, that's why. >> >> Regards >> >> Anatoliy > > > Please leave them enabled in the meantime. Otherwise we have 0 coverage. Alternatively, we could have two copies of the tests, with: 1. A phpt file that SKIPs on Windows and runs normally, and 2. A phpt file that SKIPs on non-Windows and is XFAIL. Longer term, I know we have some other tests that would benefit from platform specific XFAILs: tests/func/005a.phpt still failed only on OS X last time I checked (due to a kernel bug we can't really work around), for instance. Adam -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Add the new password functions to UPGRADING.: UPGRADING
Commit:f909e058352aa2b725bc4cb2053c6e3ef8e98c14 Author:Adam Harvey Wed, 21 Nov 2012 09:25:05 +0800 Parents: 8f65c76d2e0e4b13c8419627b65c3c9688c4bbbd Branches: PHP-5.5 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f909e058352aa2b725bc4cb2053c6e3ef8e98c14 Log: Add the new password functions to UPGRADING. As a public service announcement on behalf of the documentation team, please remember to update UPGRADING as well as NEWS when adding features to master or an alpha branch. :) Changed paths: M UPGRADING Diff: diff --git a/UPGRADING b/UPGRADING index f7f88ac..18ab6bf 100755 --- a/UPGRADING +++ b/UPGRADING @@ -119,6 +119,10 @@ PHP 5.5 UPGRADE NOTES - Core: - boolval() + - password_get_info() + - password_hash() + - password_needs_rehash() + - password_verify() - Hash: - hash_pbkdf2() -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Move the deprecated functions up to the Deprecated Functionality section so they're more visible.: UPGRADING
Commit:ab4c270ccf71060f98b209852f2b73f2c134900d Author:Adam Harvey Fri, 16 Nov 2012 04:33:17 + Parents: 8c97c79d77f968318113a99a3c560de4366a2643 Branches: PHP-5.5 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=ab4c270ccf71060f98b209852f2b73f2c134900d Log: Move the deprecated functions up to the Deprecated Functionality section so they're more visible. Changed paths: M UPGRADING Diff: diff --git a/UPGRADING b/UPGRADING index e6362be..c0f1f9b 100755 --- a/UPGRADING +++ b/UPGRADING @@ -56,6 +56,12 @@ PHP X.Y UPGRADE NOTES - The preg_replace /e modifier is now deprecated. Use preg_replace_callback instead. (https://wiki.php.net/rfc/remove_preg_replace_eval_modifier) +- IntlDateFormatter::setTimeZoneID() and datefmt_set_timezone_id() are + deprecated. Use IntlDateFormatter::setTimeZone() or datefmt_set_timezone() + instead. +- mcrypt_ecb(), mcrypt_cbc(), mcrypt_cfb() and mcrypt_ofb() now throw + E_DEPRECATED. Their use was already previously discouraged in the docs, + but that predated the existence of E_DEPRECATED. 4. Changed Functions @@ -98,14 +104,8 @@ PHP X.Y UPGRADE NOTES - IntlDateFormatter::setCalendar() and datefmt_set_calendar() now also accept an IntlCalendar object, in which case its time zone is taken. Passing a constant is still allowed, and still keeps the time zone. -- IntlDateFormatter::setTimeZoneID() and datefmt_set_timezone_id() are - deprecated. Use IntlDateFormatter::setTimeZone() or datefmt_set_timezone() - instead. - IntlDateFormatter::format() and datefmt_format() now also accept an IntlCalendar object for formatting. -- mcrypt_ecb(), mcrypt_cbc(), mcrypt_cfb() and mcrypt_ofb() now throw - E_DEPRECATED. Their use was already previously discouraged in the docs, - but that predated the existence of E_DEPRECATED. - php_logo_guid(), php_egg_logo_guid(), php_real_logo_guid() and zend_logo_guid() have been removed - set_error_handler(NULL) can now be used to reset the error handler. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Put the new php.ini directives together.: UPGRADING
Commit:d207e6551b11e5fb0a0fad154048203ac73f8fe2 Author:Adam Harvey Fri, 16 Nov 2012 04:34:10 + Parents: ab4c270ccf71060f98b209852f2b73f2c134900d Branches: PHP-5.5 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d207e6551b11e5fb0a0fad154048203ac73f8fe2 Log: Put the new php.ini directives together. (And make colon usage more consistent.) Changed paths: M UPGRADING Diff: diff --git a/UPGRADING b/UPGRADING index c0f1f9b..41ec330 100755 --- a/UPGRADING +++ b/UPGRADING @@ -231,19 +231,23 @@ PHP X.Y UPGRADE NOTES - Intl: - This extension now requires ICU 4.0+. - - Added intl.use_exceptions INI directive, which controls what happens when -global errors are set together with intl.error_level. 9. New Global Constants -- mysqli + +- mysqli: - Added MYSQLI_SERVER_PUBLIC_KEY constant to be used with mysqli_options() 10. Changes to INI File Handling -- mysqlnd + +- Intl: + - Added intl.use_exceptions INI directive, which controls what happens when +global errors are set together with intl.error_level. + +- mysqlnd: - Added mysqlnd.sha256_server_public_key INI PERDIR setting that affects all APIs which use(are built) for mysqlnd. This allows ext/mysqli to be used with the new auth protocol, although at coarser level. -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Merge branch 'PHP-5.4': ext/pcre/php_pcre.c
Commit:0b96b4c4e9d4dc818713eee3159ff7c4ec6f5e9b Author:Adam Harvey Mon, 12 Nov 2012 20:09:18 +0800 Parents: 180767373d03238431103c02a93de19df49c14dc 6b9df7a4542c47fa6ab615461913ccdf7cdd4e10 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0b96b4c4e9d4dc818713eee3159ff7c4ec6f5e9b Log: Merge branch 'PHP-5.4' * PHP-5.4: Update arginfo for preg_match_all() to reflect reality. fix invalid read when trimming empty string Changed paths: MM ext/pcre/php_pcre.c Diff: -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Update arginfo for preg_match_all() to reflect reality.: ext/pcre/php_pcre.c
Commit:bca8ff723d1d2721e410ecdf10955aea57445a19 Author:Adam Harvey Mon, 12 Nov 2012 20:04:26 +0800 Parents: 5b82fb52fd5143a3860db219eb39616c6e642a4b Branches: PHP-5.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bca8ff723d1d2721e410ecdf10955aea57445a19 Log: Update arginfo for preg_match_all() to reflect reality. Back when I implemented FR #53238 during the 5.4 development phase to make the $matches parameter optional in preg_match_all(), it turns out I forgot to update the arginfo to note that only 2 parameters are now required by preg_match_all(). The function itself works fine, but reflection was reporting the wrong number of required parameters. Bugs: https://bugs.php.net/53238 Changed paths: M ext/pcre/php_pcre.c Diff: diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 2f892c8..b18c9ed 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -1866,7 +1866,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_preg_match, 0, 0, 2) ZEND_ARG_INFO(0, offset) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_preg_match_all, 0, 0, 3) +ZEND_BEGIN_ARG_INFO_EX(arginfo_preg_match_all, 0, 0, 2) ZEND_ARG_INFO(0, pattern) ZEND_ARG_INFO(0, subject) ZEND_ARG_INFO(1, subpatterns) /* array */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix doc bug #63032 (Number of release in documentation).: CODING_STANDARDS
Commit:f66642aae10fbf77d536a4a4ac68602124e41ae0 Author:Adam Harvey Mon, 10 Sep 2012 10:05:15 +0800 Parents: b29dc146b9311c14186c14bcb1c8ae5288b65d73 Branches: PHP-5.3 PHP-5.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=f66642aae10fbf77d536a4a4ac68602124e41ae0 Log: Fix doc bug #63032 (Number of release in documentation). Also add a bonus grammar fix. Bugs: https://bugs.php.net/63032 Changed paths: M CODING_STANDARDS Diff: diff --git a/CODING_STANDARDS b/CODING_STANDARDS index ae8ee04..7413be4 100644 --- a/CODING_STANDARDS +++ b/CODING_STANDARDS @@ -2,11 +2,11 @@ PHP Coding Standards -This file lists several standards that any programmer, adding or changing -code in PHP, should follow. Since this file was added at a very late +This file lists several standards that any programmer adding or changing +code in PHP should follow. Since this file was added at a very late stage of the development of PHP v3.0, the code base does not (yet) fully follow it, but it's going in that general direction. Since we are now -well into the version 4 releases, many sections have been recoded to use +well into version 5 releases, many sections have been recoded to use these rules. Code Implementation -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Update version numbers to 5.4.7-dev.: configure.in main/php_version.h
Commit:14847af41d153e3abe4986afa49526d93810098a Author:Adam Harvey Fri, 17 Aug 2012 23:07:54 +0800 Parents: 0b23da1c74c52a819b728c78c66c182511223355 Branches: PHP-5.4 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=14847af41d153e3abe4986afa49526d93810098a Log: Update version numbers to 5.4.7-dev. Changed paths: M configure.in M main/php_version.h Diff: diff --git a/configure.in b/configure.in index 1e80689..e5e1cd6 100644 --- a/configure.in +++ b/configure.in @@ -119,7 +119,7 @@ int zend_sprintf(char *buffer, const char *format, ...); PHP_MAJOR_VERSION=5 PHP_MINOR_VERSION=4 -PHP_RELEASE_VERSION=5 +PHP_RELEASE_VERSION=7 PHP_EXTRA_VERSION="-dev" PHP_VERSION="$PHP_MAJOR_VERSION.$PHP_MINOR_VERSION.$PHP_RELEASE_VERSION$PHP_EXTRA_VERSION" PHP_VERSION_ID=`expr [$]PHP_MAJOR_VERSION \* 1 + [$]PHP_MINOR_VERSION \* 100 + [$]PHP_RELEASE_VERSION` diff --git a/main/php_version.h b/main/php_version.h index 4b7709c..3315661 100644 --- a/main/php_version.h +++ b/main/php_version.h @@ -2,7 +2,7 @@ /* edit configure.in to change version number */ #define PHP_MAJOR_VERSION 5 #define PHP_MINOR_VERSION 4 -#define PHP_RELEASE_VERSION 5 +#define PHP_RELEASE_VERSION 7 #define PHP_EXTRA_VERSION "-dev" -#define PHP_VERSION "5.4.5-dev" -#define PHP_VERSION_ID 50405 +#define PHP_VERSION "5.4.7-dev" +#define PHP_VERSION_ID 50407 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] com php-src: Fix bug #61537 (json_encode() incorrectly truncates/discards information) and remove a test case that's now mooted by this fix.: NEWS ext/json/json.c ext/json/php_json.h ext
2012/4/12 Johannes Schlüter : > please make sure to merge things upwards. i see the patch was applied to > 5.4 and master, too, but git doesn't know about the merge. I thought I had, to be honest — there was a conflict on NEWS (not surprising), but I thought I'd resolved that properly. Any people with more git merging experience want to point to a guide to dealing with that sort of thing? I've used git for years, but I'm really having a hard time wrapping my head around the way we're using it, even with the guides on the Wiki. Adam -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] com php-src: Fix bug #61537 (json_encode() incorrectly truncates/discards information) and remove a test case that's now mooted by this fix.: NEWS ext/json/json.c ext/json/php_json.h ext/jso
Commit:cb2a1c71c96d7c9b2ee03d77beae0c8e0d385f1b Author:Adam Harvey Mon, 2 Apr 2012 09:46:18 +0800 Parents: 112a476b683a634390b23fe7509d5b73632d0829 Branches: PHP-5.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=cb2a1c71c96d7c9b2ee03d77beae0c8e0d385f1b Log: Fix bug #61537 (json_encode() incorrectly truncates/discards information) and remove a test case that's now mooted by this fix. Bugs: https://bugs.php.net/61537 Changed paths: M NEWS M ext/json/json.c M ext/json/php_json.h D ext/json/tests/bug43941.phpt M ext/json/tests/bug54058.phpt A ext/json/tests/bug61537.phpt Diff: diff --git a/NEWS b/NEWS index 42f7cd9..05cc254 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,14 @@ PHP NEWS $_SERVER['SCRIPT_FILENAME'] when using router). (Laruence) . "Connection: close" instead of "Connection: closed" (Gustavo) +- JSON + . Fixed bug #61537 (json_encode() incorrectly truncates/discards +information). (Adam) + +?? ??? 2012, PHP 5.3.11 + +(merge after 5.3.11 release) + - Core: . Fixed bug #61660 (bin2hex(hex2bin($data)) != $data). (Nikita Popov) . Fixed bug #61650 (ini parser crashes when using ${} ini variables diff --git a/ext/json/json.c b/ext/json/json.c index fc1fcb7..853611e 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -96,6 +96,7 @@ static PHP_MINIT_FUNCTION(json) REGISTER_LONG_CONSTANT("JSON_UNESCAPED_SLASHES", PHP_JSON_UNESCAPED_SLASHES, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_PRETTY_PRINT", PHP_JSON_PRETTY_PRINT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_UNESCAPED_UNICODE", PHP_JSON_UNESCAPED_UNICODE, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("JSON_PARTIAL_OUTPUT_ON_ERROR", PHP_JSON_PARTIAL_OUTPUT_ON_ERROR, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_ERROR_NONE", PHP_JSON_ERROR_NONE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_ERROR_DEPTH", PHP_JSON_ERROR_DEPTH, CONST_CS | CONST_PERSISTENT); @@ -389,9 +390,7 @@ static void json_escape_string(smart_str *buf, char *s, int len, int options TSR } if (ulen < 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"); - } + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid UTF-8 sequence in argument"); smart_str_appendl(buf, "null", 4); } else { smart_str_appendl(buf, "\"\"", 2); @@ -689,7 +688,11 @@ static PHP_FUNCTION(json_encode) php_json_encode(&buf, parameter, options TSRMLS_CC); - ZVAL_STRINGL(return_value, buf.c, buf.len, 1); + if (JSON_G(error_code) != PHP_JSON_ERROR_NONE && options ^ PHP_JSON_PARTIAL_OUTPUT_ON_ERROR) { + ZVAL_FALSE(return_value); + } else { + ZVAL_STRINGL(return_value, buf.c, buf.len, 1); + } smart_str_free(&buf); } diff --git a/ext/json/php_json.h b/ext/json/php_json.h index ef3e4b5..20426c0 100644 --- a/ext/json/php_json.h +++ b/ext/json/php_json.h @@ -63,6 +63,7 @@ extern zend_class_entry *php_json_serializable_ce; #define PHP_JSON_UNESCAPED_SLASHES (1<<6) #define PHP_JSON_PRETTY_PRINT (1<<7) #define PHP_JSON_UNESCAPED_UNICODE (1<<8) +#define PHP_JSON_PARTIAL_OUTPUT_ON_ERROR (1<<9) /* Internal flags */ #define PHP_JSON_OUTPUT_ARRAY 0 diff --git a/ext/json/tests/bug43941.phpt b/ext/json/tests/bug43941.phpt deleted file mode 100644 index 0f86d1d..000 --- a/ext/json/tests/bug43941.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Bug #43941 (json_encode() invalid UTF-8) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -string(5) ""abc"" -string(4) "null" -string(4) "null" -string(17) "[null,null,"abc"]" -Done - diff --git a/ext/json/tests/bug54058.phpt b/ext/json/tests/bug54058.phpt index 3b1136b..08c7f57 100644 --- a/ext/json/tests/bug54058.phpt +++ b/ext/json/tests/bug54058.phpt @@ -29,7 +29,14 @@ json_encode($c); var_dump(json_last_error()); ?> --EXPECTF-- +Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d int(5) + +Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d int(5) + +Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d int(5) + +Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d int(5) diff --git a/ext/json/tests/bug61537.phpt b/ext/json/tests/bug61537.phpt new file mode 100
[PHP-CVS] com php-src: Fix bug #61537 (json_encode() incorrectly truncates/discards information) and remove a test case that's now mooted by this fix.: NEWS ext/json/json.c ext/json/php_json.h ext/jso
Commit:3f3ad30c50c32327e723046bcc6649d05dd9236a Author:Adam Harvey Mon, 2 Apr 2012 09:46:18 +0800 Parents: 1c8fccdf6d6d04d8e6a5dedd7c9d6b1afda8839f Branches: PHP-5.3 Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=3f3ad30c50c32327e723046bcc6649d05dd9236a Log: Fix bug #61537 (json_encode() incorrectly truncates/discards information) and remove a test case that's now mooted by this fix. Bugs: https://bugs.php.net/61537 Changed paths: M NEWS M ext/json/json.c M ext/json/php_json.h D ext/json/tests/bug43941.phpt M ext/json/tests/bug54058.phpt A ext/json/tests/bug61537.phpt Diff: diff --git a/NEWS b/NEWS index a660a91..b9af819 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,10 @@ PHP NEWS ||| ?? ??? 2012, PHP 5.3.12 +- JSON + . Fixed bug #61537 (json_encode() incorrectly truncates/discards +information). (Adam) + ?? ??? 2012, PHP 5.3.11 - Iconv extension: . Fixed a bug that iconv extension fails to link to the correct library diff --git a/ext/json/json.c b/ext/json/json.c index 5b62c2f..ce2cf43 100644 --- a/ext/json/json.c +++ b/ext/json/json.c @@ -73,6 +73,7 @@ static PHP_MINIT_FUNCTION(json) REGISTER_LONG_CONSTANT("JSON_HEX_QUOT", PHP_JSON_HEX_QUOT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_FORCE_OBJECT", PHP_JSON_FORCE_OBJECT, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_NUMERIC_CHECK", PHP_JSON_NUMERIC_CHECK, CONST_CS | CONST_PERSISTENT); + REGISTER_LONG_CONSTANT("JSON_PARTIAL_OUTPUT_ON_ERROR", PHP_JSON_PARTIAL_OUTPUT_ON_ERROR, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_ERROR_NONE", PHP_JSON_ERROR_NONE, CONST_CS | CONST_PERSISTENT); REGISTER_LONG_CONSTANT("JSON_ERROR_DEPTH", PHP_JSON_ERROR_DEPTH, CONST_CS | CONST_PERSISTENT); @@ -320,9 +321,7 @@ static void json_escape_string(smart_str *buf, char *s, int len, int options TSR } 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"); - } + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid UTF-8 sequence in argument"); smart_str_appendl(buf, "null", 4); } else { smart_str_appendl(buf, "\"\"", 2); @@ -571,7 +570,11 @@ static PHP_FUNCTION(json_encode) php_json_encode(&buf, parameter, options TSRMLS_CC); - ZVAL_STRINGL(return_value, buf.c, buf.len, 1); + if (JSON_G(error_code) != PHP_JSON_ERROR_NONE && options ^ PHP_JSON_PARTIAL_OUTPUT_ON_ERROR) { + ZVAL_FALSE(return_value); + } else { + ZVAL_STRINGL(return_value, buf.c, buf.len, 1); + } smart_str_free(&buf); } diff --git a/ext/json/php_json.h b/ext/json/php_json.h index b104d4c..3cb4902 100644 --- a/ext/json/php_json.h +++ b/ext/json/php_json.h @@ -56,6 +56,7 @@ PHP_JSON_API void php_json_decode(zval *return_value, char *str, int str_len, ze #define PHP_JSON_HEX_QUOT (1<<3) #define PHP_JSON_FORCE_OBJECT (1<<4) #define PHP_JSON_NUMERIC_CHECK (1<<5) +#define PHP_JSON_PARTIAL_OUTPUT_ON_ERROR (1<<9) #define PHP_JSON_OUTPUT_ARRAY 0 #define PHP_JSON_OUTPUT_OBJECT 1 diff --git a/ext/json/tests/bug43941.phpt b/ext/json/tests/bug43941.phpt deleted file mode 100644 index 0f86d1d..000 --- a/ext/json/tests/bug43941.phpt +++ /dev/null @@ -1,21 +0,0 @@ ---TEST-- -Bug #43941 (json_encode() invalid UTF-8) ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -string(5) ""abc"" -string(4) "null" -string(4) "null" -string(17) "[null,null,"abc"]" -Done - diff --git a/ext/json/tests/bug54058.phpt b/ext/json/tests/bug54058.phpt index 3b1136b..08c7f57 100644 --- a/ext/json/tests/bug54058.phpt +++ b/ext/json/tests/bug54058.phpt @@ -29,7 +29,14 @@ json_encode($c); var_dump(json_last_error()); ?> --EXPECTF-- +Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d int(5) + +Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d int(5) + +Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d int(5) + +Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d int(5) diff --git a/ext/json/tests/bug61537.phpt b/ext/json/tests/bug61537.phpt new file mode 100644 index 000..e2abdda --- /dev/null +++ b/ext/json/tests/bug61537.phpt @@ -0,0 +1,30 @@ +--TEST-- +Bug #61537 (json_encode() incorrectly truncates/discards
[PHP-CVS] com php-src: Update test to fix breakage caused by the previous commit.: ext/json/tests/bug53946.phpt
Commit:05c8d4766c272e101b5279f0ec432e1b16e74637 Author:Adam Harvey Mon, 2 Apr 2012 10:30:02 +0800 Parents: cb2a1c71c96d7c9b2ee03d77beae0c8e0d385f1b Branches: PHP-5.4 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=05c8d4766c272e101b5279f0ec432e1b16e74637 Log: Update test to fix breakage caused by the previous commit. Changed paths: M ext/json/tests/bug53946.phpt Diff: diff --git a/ext/json/tests/bug53946.phpt b/ext/json/tests/bug53946.phpt index abbb812..079906f 100644 --- a/ext/json/tests/bug53946.phpt +++ b/ext/json/tests/bug53946.phpt @@ -9,8 +9,12 @@ var_dump(json_encode("latin 1234 -/russian мама мыла раму speci var_dump(json_encode("ab\xE0")); var_dump(json_encode("ab\xE0", JSON_UNESCAPED_UNICODE)); ?> ---EXPECT-- +--EXPECTF-- string(156) ""latin 1234 -\/russian \u043c\u0430\u043c\u0430 \u043c\u044b\u043b\u0430 \u0440\u0430\u043c\u0443 specialchars \u0002 \b \n U+1D11E >\ud834\udd1e<"" string(100) ""latin 1234 -\/russian мама мыла раму specialchars \u0002 \b \n U+1D11E >𝄞<"" -string(4) "null" -string(4) "null" + +Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d +bool(false) + +Warning: json_encode(): Invalid UTF-8 sequence in argument in %s on line %d +bool(false) -- 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/standard/info.c trunk/ext/standard/info.c
aharvey Fri, 16 Mar 2012 02:07:46 + Revision: http://svn.php.net/viewvc?view=revision&revision=324289 Log: Fix bug #61409 (Bad formatting on phpinfo()). Patch by Jakub Vrana. Bug: https://bugs.php.net/61409 (Assigned) Bad formatting on php_info() Changed paths: U php/php-src/branches/PHP_5_4/NEWS U php/php-src/branches/PHP_5_4/ext/standard/info.c U php/php-src/trunk/ext/standard/info.c Modified: php/php-src/branches/PHP_5_4/NEWS === --- php/php-src/branches/PHP_5_4/NEWS 2012-03-15 23:17:06 UTC (rev 324288) +++ php/php-src/branches/PHP_5_4/NEWS 2012-03-16 02:07:46 UTC (rev 324289) @@ -96,6 +96,7 @@ - Standard: . Fixed memory leak in substr_replace. (Pierrick) . Make max_file_uploads ini directive settable outside of php.ini (Rasmus) + . Fixed bug #61409 (Bad formatting on phpinfo()). (Jakub Vrana) . Fixed bug #60222 (time_nanosleep() does validate input params). (Ilia) . Fixed bug #60106 (stream_socket_server silently truncates long unix socket paths). (Ilia) Modified: php/php-src/branches/PHP_5_4/ext/standard/info.c === --- php/php-src/branches/PHP_5_4/ext/standard/info.c2012-03-15 23:17:06 UTC (rev 324288) +++ php/php-src/branches/PHP_5_4/ext/standard/info.c2012-03-16 02:07:46 UTC (rev 324289) @@ -117,7 +117,7 @@ HashPosition pos; if (!sapi_module.phpinfo_as_text) { - php_info_printf("Registered %s", name); + php_info_printf("Registered %s", name); } else { php_info_printf("\nRegistered %s => ", name); } Modified: php/php-src/trunk/ext/standard/info.c === --- php/php-src/trunk/ext/standard/info.c 2012-03-15 23:17:06 UTC (rev 324288) +++ php/php-src/trunk/ext/standard/info.c 2012-03-16 02:07:46 UTC (rev 324289) @@ -117,7 +117,7 @@ HashPosition pos; if (!sapi_module.phpinfo_as_text) { - php_info_printf("Registered %s", name); + php_info_printf("Registered %s", name); } else { php_info_printf("\nRegistered %s => ", name); } -- 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 PHP_5_3/ext/standard/string.c PHP_5_3/ext/standard/tests/strings/bug60801.phpt PHP_5_4/NEWS PHP_5_4/ext/standard/string.c PHP_5_4/ext/standard/tests/
aharvey Fri, 02 Mar 2012 03:39:04 + Revision: http://svn.php.net/viewvc?view=revision&revision=323779 Log: MFH: Fix bug #60801 (strpbrk() mishandles NUL byte). (Trunk commit: r322934). Bug: https://bugs.php.net/60801 (Closed) strpbrk() mishandles NUL byte Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/standard/string.c A php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug60801.phpt U php/php-src/branches/PHP_5_4/NEWS U php/php-src/branches/PHP_5_4/ext/standard/string.c A php/php-src/branches/PHP_5_4/ext/standard/tests/strings/bug60801.phpt Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2012-03-02 03:38:04 UTC (rev 323778) +++ php/php-src/branches/PHP_5_3/NEWS 2012-03-02 03:39:04 UTC (rev 323779) @@ -18,6 +18,7 @@ functions). (Pierre) . Fixed bug #60825 (Segfault when running symfony 2 tests). (Dmitry, Laruence) + . Fixed bug #60801 (strpbrk() mishandles NUL byte). (Adam) . Fixed bug #60227 (header() cannot detect the multi-line header with CR). (rui, Gustavo) . Fixed bug #51860 (Include fails with toplevel symlink to /). (Dmitry) Modified: php/php-src/branches/PHP_5_3/ext/standard/string.c === --- php/php-src/branches/PHP_5_3/ext/standard/string.c 2012-03-02 03:38:04 UTC (rev 323778) +++ php/php-src/branches/PHP_5_3/ext/standard/string.c 2012-03-02 03:39:04 UTC (rev 323779) @@ -5240,7 +5240,7 @@ { char *haystack, *char_list; int haystack_len, char_list_len; - char *p; + char *haystack_ptr, *cl_ptr; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &haystack, &haystack_len, &char_list, &char_list_len) == FAILURE) { RETURN_FALSE; @@ -5251,11 +5251,15 @@ RETURN_FALSE; } - if ((p = strpbrk(haystack, char_list))) { - RETURN_STRINGL(p, (haystack + haystack_len - p), 1); - } else { - RETURN_FALSE; + for (haystack_ptr = haystack; haystack_ptr < (haystack + haystack_len); ++haystack_ptr) { + for (cl_ptr = char_list; cl_ptr < (char_list + char_list_len); ++cl_ptr) { + if (*cl_ptr == *haystack_ptr) { + RETURN_STRINGL(haystack_ptr, (haystack + haystack_len - haystack_ptr), 1); + } + } } + + RETURN_FALSE; } /* }}} */ Added: php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug60801.phpt === (Binary files differ) Property changes on: php/php-src/branches/PHP_5_3/ext/standard/tests/strings/bug60801.phpt ___ Added: svn:mime-type + application/octet-stream Modified: php/php-src/branches/PHP_5_4/NEWS === --- php/php-src/branches/PHP_5_4/NEWS 2012-03-02 03:38:04 UTC (rev 323778) +++ php/php-src/branches/PHP_5_4/NEWS 2012-03-02 03:39:04 UTC (rev 323779) @@ -15,6 +15,7 @@ . Fixed bug #61000 (Exceeding max nesting level doesn't delete numerical vars). (Laruence) . Fixed bug #60978 (exit code incorrect). (Laruence) + . Fixed bug #60801 (strpbrk() mishandles NUL byte). (Adam) . Fixed bug #60573 (type hinting with "self" keyword causes weird errors). (Laruence) Modified: php/php-src/branches/PHP_5_4/ext/standard/string.c === --- php/php-src/branches/PHP_5_4/ext/standard/string.c 2012-03-02 03:38:04 UTC (rev 323778) +++ php/php-src/branches/PHP_5_4/ext/standard/string.c 2012-03-02 03:39:04 UTC (rev 323779) @@ -5315,7 +5315,7 @@ { char *haystack, *char_list; int haystack_len, char_list_len; - char *p; + char *haystack_ptr, *cl_ptr; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &haystack, &haystack_len, &char_list, &char_list_len) == FAILURE) { RETURN_FALSE; @@ -5326,11 +5326,15 @@ RETURN_FALSE; } - if ((p = strpbrk(haystack, char_list))) { - RETURN_STRINGL(p, (haystack + haystack_len - p), 1); - } else { - RETURN_FALSE; + for (haystack_ptr = haystack; haystack_ptr < (haystack + haystack_len); ++haystack_ptr) { + for (cl_ptr = char_list; cl_ptr < (char_list + char_list_len); ++cl_ptr) { + if (*cl_ptr == *haystack_ptr) { + RETURN_STRINGL(haystack_ptr, (haystack + haystack_len - haystack_ptr), 1); + } + } } + + RETURN_FALSE; } /* }}} */ Added: php/php-src/branches/PHP_5_4/ext/standard/tests/strings/bug60801
[PHP-CVS] svn: /php/php-src/trunk/ UPGRADING ext/spl/spl_fixedarray.c ext/spl/tests/SplFixedArray_serialize.phpt
aharvey Tue, 21 Feb 2012 10:34:42 + Revision: http://svn.php.net/viewvc?view=revision&revision=323408 Log: Add a __wakeup() method to SplFixedArray, thereby fixing serialising an SplFixedArray object and bug #60560 (SplFixedArray un-/serialize, getSize(), count() return 0, keys are strings). Bug: https://bugs.php.net/60560 (Open) SplFixedArray un-/serialize, getSize(), count() return 0, keys are strings Changed paths: U php/php-src/trunk/UPGRADING U php/php-src/trunk/ext/spl/spl_fixedarray.c A php/php-src/trunk/ext/spl/tests/SplFixedArray_serialize.phpt Modified: php/php-src/trunk/UPGRADING === --- php/php-src/trunk/UPGRADING 2012-02-21 10:07:05 UTC (rev 323407) +++ php/php-src/trunk/UPGRADING 2012-02-21 10:34:42 UTC (rev 323408) @@ -450,6 +450,9 @@ - SplFileObject - SplFileObject::fputcsv() + - SplFixedArray + - SplFixedArray::__wakeup() + i. New class constants - Modified: php/php-src/trunk/ext/spl/spl_fixedarray.c === --- php/php-src/trunk/ext/spl/spl_fixedarray.c 2012-02-21 10:07:05 UTC (rev 323407) +++ php/php-src/trunk/ext/spl/spl_fixedarray.c 2012-02-21 10:34:42 UTC (rev 323408) @@ -579,6 +579,38 @@ } /* }}} */ +/* {{{ proto void SplFixedArray::__wakeup() +*/ +SPL_METHOD(SplFixedArray, __wakeup) +{ + spl_fixedarray_object *intern = (spl_fixedarray_object *) zend_object_store_get_object(getThis() TSRMLS_CC); + HashPosition ptr; + HashTable *intern_ht = zend_std_get_properties(getThis() TSRMLS_CC); + zval **data; + + if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "")) { + return; + } + + if (!intern->array) { + int index = 0; + int size = zend_hash_num_elements(intern_ht); + + intern->array = emalloc(sizeof(spl_fixedarray)); + spl_fixedarray_init(intern->array, size TSRMLS_CC); + + for (zend_hash_internal_pointer_reset_ex(intern_ht, &ptr); zend_hash_get_current_data_ex(intern_ht, (void **) &data, &ptr) == SUCCESS; zend_hash_move_forward_ex(intern_ht, &ptr)) { + Z_ADDREF_PP(data); + intern->array->elements[index++] = *data; + } + + /* Remove the unserialised properties, since we now have the elements +* within the spl_fixedarray_object structure. */ + zend_hash_clean(intern_ht); + } +} +/* }}} */ + /* {{{ proto int SplFixedArray::count(void) */ SPL_METHOD(SplFixedArray, count) @@ -1056,6 +1088,7 @@ static zend_function_entry spl_funcs_SplFixedArray[] = { /* {{{ */ SPL_ME(SplFixedArray, __construct, arginfo_splfixedarray_construct,ZEND_ACC_PUBLIC) + SPL_ME(SplFixedArray, __wakeup,arginfo_splfixedarray_void, ZEND_ACC_PUBLIC) SPL_ME(SplFixedArray, count, arginfo_splfixedarray_void, ZEND_ACC_PUBLIC) SPL_ME(SplFixedArray, toArray, arginfo_splfixedarray_void, ZEND_ACC_PUBLIC) SPL_ME(SplFixedArray, fromArray, arginfo_fixedarray_fromArray, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC) Added: php/php-src/trunk/ext/spl/tests/SplFixedArray_serialize.phpt === --- php/php-src/trunk/ext/spl/tests/SplFixedArray_serialize.phpt (rev 0) +++ php/php-src/trunk/ext/spl/tests/SplFixedArray_serialize.phpt 2012-02-21 10:34:42 UTC (rev 323408) @@ -0,0 +1,52 @@ +--TEST-- +SplFixedArray serialisation +--FILE-- +prop = 'value'; + +$array[0] = 'foo'; +$array[2] = 42; +$array[3] = $obj; +$array[4] = range(1, 5); + +$ser = serialize($array); +echo "$ser\n"; +$unser = unserialize($ser); + +printf("count: %d\n", count($unser)); +printf("getSize(): %d\n", $unser->getSize()); + +var_dump($unser[0], $unser[1], $unser[2], $unser[3], $unser[4]); + +$unser[4] = 'quux'; +var_dump($unser[4]); + +?> +--EXPECT-- +O:13:"SplFixedArray":5:{i:0;s:3:"foo";i:1;N;i:2;i:42;i:3;O:8:"stdClass":1:{s:4:"prop";s:5:"value";}i:4;a:5:{i:0;i:1;i:1;i:2;i:2;i:3;i:3;i:4;i:4;i:5;}} +count: 5 +getSize(): 5 +string(3) "foo" +NULL +int(42) +object(stdClass)#4 (1) { + ["prop"]=> + string(5) "value" +} +array(5) { + [0]=> + int(1) + [1]=> + int(2) + [2]=> + int(3) + [3]=> + int(4) + [4]=> + int(5) +} +string(4) "quux" -- 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
aharvey Sat, 18 Feb 2012 04:32:45 + Revision: http://svn.php.net/viewvc?view=revision&revision=323313 Log: Merge 5.3.10 NEWS, per Ondřej's mailing list prod. 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 2012-02-18 02:18:45 UTC (rev 323312) +++ php/php-src/branches/PHP_5_3/NEWS 2012-02-18 04:32:45 UTC (rev 323313) @@ -54,9 +54,11 @@ . Fixed bug #61058 (array_fill leaks if start index is PHP_INT_MAX). (Laruence) -?? ??? 2012, PHP 5.3.10 +02 Feb 2012, PHP 5.3.10 -(to be added) +- Core: + . Fixed arbitrary remote code execution vulnerability reported by Stefan +Esser, CVE-2012-0830. (Stas, Dmitry) 10 Jan 2012, PHP 5.3.9 -- 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/standard/tests/array/ locale_sort.phpt
aharvey Fri, 03 Feb 2012 04:17:11 + Revision: http://svn.php.net/viewvc?view=revision&revision=323037 Log: Fix bug #60933 on PHP_5_4 (approved by Stas). Bug: https://bugs.php.net/60933 (Suspended) Testing asort with SORT_LOCALE_STRING fails on Mac OS X 10.6 Changed paths: U php/php-src/branches/PHP_5_4/ext/standard/tests/array/locale_sort.phpt Modified: php/php-src/branches/PHP_5_4/ext/standard/tests/array/locale_sort.phpt === --- php/php-src/branches/PHP_5_4/ext/standard/tests/array/locale_sort.phpt 2012-02-03 01:21:24 UTC (rev 323036) +++ php/php-src/branches/PHP_5_4/ext/standard/tests/array/locale_sort.phpt 2012-02-03 04:17:11 UTC (rev 323037) @@ -5,7 +5,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { die("skip Unix locale name only, not available on windows (and crashes with VC6)\n"); } -if (false == setlocale(LC_CTYPE, "fr_FR", "fr_FR.ISO8859-1")) { +if (false == setlocale(LC_CTYPE, "fr_FR.ISO8859-1", "fr_FR")) { die("skip setlocale() failed\n"); } ?> @@ -14,7 +14,7 @@ unicode.output_encoding=ISO8859-1 --FILE-- "Alberta", "BC" => "Colombie-Britannique", "MB" => "Manitoba", -- 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/tests/array/locale_sort.phpt trunk/ext/standard/tests/array/locale_sort.phpt
aharvey Fri, 03 Feb 2012 01:21:24 + Revision: http://svn.php.net/viewvc?view=revision&revision=323036 Log: Fix bug #60933 (Testing asort with SORT_LOCALE_STRING fails on Mac OS X 10.6) on PHP_5_3 and trunk. Bug: https://bugs.php.net/60933 (Assigned) Testing asort with SORT_LOCALE_STRING fails on Mac OS X 10.6 Changed paths: U php/php-src/branches/PHP_5_3/ext/standard/tests/array/locale_sort.phpt U php/php-src/trunk/ext/standard/tests/array/locale_sort.phpt Modified: php/php-src/branches/PHP_5_3/ext/standard/tests/array/locale_sort.phpt === --- php/php-src/branches/PHP_5_3/ext/standard/tests/array/locale_sort.phpt 2012-02-03 01:02:38 UTC (rev 323035) +++ php/php-src/branches/PHP_5_3/ext/standard/tests/array/locale_sort.phpt 2012-02-03 01:21:24 UTC (rev 323036) @@ -5,7 +5,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { die("skip Unix locale name only, not available on windows (and crashes with VC6)\n"); } -if (false == setlocale(LC_CTYPE, "fr_FR", "fr_FR.ISO8859-1")) { +if (false == setlocale(LC_CTYPE, "fr_FR.ISO8859-1", "fr_FR")) { die("skip setlocale() failed\n"); } ?> @@ -14,7 +14,7 @@ unicode.output_encoding=ISO8859-1 --FILE-- "Alberta", "BC" => "Colombie-Britannique", "MB" => "Manitoba", Modified: php/php-src/trunk/ext/standard/tests/array/locale_sort.phpt === --- php/php-src/trunk/ext/standard/tests/array/locale_sort.phpt 2012-02-03 01:02:38 UTC (rev 323035) +++ php/php-src/trunk/ext/standard/tests/array/locale_sort.phpt 2012-02-03 01:21:24 UTC (rev 323036) @@ -5,7 +5,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { die("skip Unix locale name only, not available on windows (and crashes with VC6)\n"); } -if (false == setlocale(LC_CTYPE, "fr_FR", "fr_FR.ISO8859-1")) { +if (false == setlocale(LC_CTYPE, "fr_FR.ISO8859-1", "fr_FR")) { die("skip setlocale() failed\n"); } ?> @@ -14,7 +14,7 @@ unicode.output_encoding=ISO8859-1 --FILE-- "Alberta", "BC" => "Colombie-Britannique", "MB" => "Manitoba", -- 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/ string.c tests/strings/bug60801.phpt
aharvey Mon, 30 Jan 2012 13:29:15 + Revision: http://svn.php.net/viewvc?view=revision&revision=322934 Log: Fix bug #60801 (strpbrk() mishandles NUL byte) on trunk only for now. Bug: https://bugs.php.net/60801 (Assigned) strpbrk() mishandles NUL byte Changed paths: U php/php-src/trunk/ext/standard/string.c A php/php-src/trunk/ext/standard/tests/strings/bug60801.phpt Modified: php/php-src/trunk/ext/standard/string.c === --- php/php-src/trunk/ext/standard/string.c 2012-01-30 13:02:10 UTC (rev 322933) +++ php/php-src/trunk/ext/standard/string.c 2012-01-30 13:29:15 UTC (rev 322934) @@ -5315,7 +5315,7 @@ { char *haystack, *char_list; int haystack_len, char_list_len; - char *p; + char *haystack_ptr, *cl_ptr; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &haystack, &haystack_len, &char_list, &char_list_len) == FAILURE) { RETURN_FALSE; @@ -5326,11 +5326,15 @@ RETURN_FALSE; } - if ((p = strpbrk(haystack, char_list))) { - RETURN_STRINGL(p, (haystack + haystack_len - p), 1); - } else { - RETURN_FALSE; + for (haystack_ptr = haystack; haystack_ptr < (haystack + haystack_len); ++haystack_ptr) { + for (cl_ptr = char_list; cl_ptr < (char_list + char_list_len); ++cl_ptr) { + if (*cl_ptr == *haystack_ptr) { + RETURN_STRINGL(haystack_ptr, (haystack + haystack_len - haystack_ptr), 1); + } + } } + + RETURN_FALSE; } /* }}} */ Added: php/php-src/trunk/ext/standard/tests/strings/bug60801.phpt === --- php/php-src/trunk/ext/standard/tests/strings/bug60801.phpt (rev 0) +++ php/php-src/trunk/ext/standard/tests/strings/bug60801.phpt 2012-01-30 13:29:15 UTC (rev 322934) @@ -0,0 +1,23 @@ +--TEST-- +Bug #60801 (strpbrk() mishandles NUL byte) +--FILE-- + +--EXPECT-- +string(2) "ar" +string(3) " +string(4) "b +string(3) "bar" +string(1) " +bool(false) +bool(false) Property changes on: php/php-src/trunk/ext/standard/tests/strings/bug60801.phpt ___ Added: svn:mime-type + text/x-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_4/ UPGRADING
aharvey Fri, 11 Nov 2011 13:13:16 + Revision: http://svn.php.net/viewvc?view=revision&revision=319050 Log: Note the change in ob_start() chunk size behaviour mentioned in doc bug #60243 (Add way to specify output buffering chunk size of 1). Bug: https://bugs.php.net/60243 (Assigned) Add way to specify output buffering chunk size of 1 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-11-11 12:53:10 UTC (rev 319049) +++ php/php-src/branches/PHP_5_4/UPGRADING 2011-11-11 13:13:16 UTC (rev 319050) @@ -225,6 +225,8 @@ - is_a() and is_subclass_of() now have third boolean parameter, which specifies if the first argument can be a string class name. Default if false for is_a and true for is_subclass_of() for BC reasons. +- ob_start() will now treat a chunk size of 1 as meaning 1 byte, rather than + the previous special case behaviour of treating it as 4096 bytes. === 5. Changes made to existing methods -- 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/sapi/litespeed/Makefile.frag trunk/sapi/litespeed/Makefile.frag
aharvey Sat, 24 Sep 2011 19:16:33 + Revision: http://svn.php.net/viewvc?view=revision&revision=317251 Log: Fix bug #55769 (Make Fails with "Missing Separator" error) via s//^I/. Bug: https://bugs.php.net/55769 (Assigned) Make Fails with "Missing Separator" error Changed paths: U php/php-src/branches/PHP_5_4/NEWS U php/php-src/branches/PHP_5_4/sapi/litespeed/Makefile.frag U php/php-src/trunk/sapi/litespeed/Makefile.frag Modified: php/php-src/branches/PHP_5_4/NEWS === --- php/php-src/branches/PHP_5_4/NEWS 2011-09-24 17:18:43 UTC (rev 317250) +++ php/php-src/branches/PHP_5_4/NEWS 2011-09-24 19:16:33 UTC (rev 317251) @@ -21,6 +21,9 @@ . Fixed bug #55747 (request headers missed in $_SERVER). (Laruence) . Fixed bug #55755 (SegFault when outputting header WWW-Authenticate). (Laruence) +- Litespeed SAPI: + . Fixed bug #55769 (Make Fails with "Missing Separator" error). (Adam) + 15 Sep 2011, PHP 5.4.0 Beta - General improvements: . Added callable typehint. (Hannes) Modified: php/php-src/branches/PHP_5_4/sapi/litespeed/Makefile.frag === --- php/php-src/branches/PHP_5_4/sapi/litespeed/Makefile.frag 2011-09-24 17:18:43 UTC (rev 317250) +++ php/php-src/branches/PHP_5_4/sapi/litespeed/Makefile.frag 2011-09-24 19:16:33 UTC (rev 317251) @@ -5,5 +5,5 @@ install-litespeed: $(SAPI_LITESPEED_PATH) @echo "Installing PHP LitSpeed binary: $(INSTALL_ROOT)$(bindir)/" -@$(INSTALL) -m 0755 $(SAPI_LITESPEED_PATH) $(INSTALL_ROOT)$(bindir)/lsphp + @$(INSTALL) -m 0755 $(SAPI_LITESPEED_PATH) $(INSTALL_ROOT)$(bindir)/lsphp Modified: php/php-src/trunk/sapi/litespeed/Makefile.frag === --- php/php-src/trunk/sapi/litespeed/Makefile.frag 2011-09-24 17:18:43 UTC (rev 317250) +++ php/php-src/trunk/sapi/litespeed/Makefile.frag 2011-09-24 19:16:33 UTC (rev 317251) @@ -5,5 +5,5 @@ install-litespeed: $(SAPI_LITESPEED_PATH) @echo "Installing PHP LitSpeed binary: $(INSTALL_ROOT)$(bindir)/" -@$(INSTALL) -m 0755 $(SAPI_LITESPEED_PATH) $(INSTALL_ROOT)$(bindir)/lsphp + @$(INSTALL) -m 0755 $(SAPI_LITESPEED_PATH) $(INSTALL_ROOT)$(bindir)/lsphp -- 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/ info.c
aharvey Tue, 23 Aug 2011 06:07:24 + Revision: http://svn.php.net/viewvc?view=revision&revision=315332 Log: Fix bug #55483 (extra > at the end of html tag in phpinfo). Bug: https://bugs.php.net/55483 (Assigned) extra > at the end of html tag in phpinfo Changed paths: U php/php-src/branches/PHP_5_3/ext/standard/info.c Modified: php/php-src/branches/PHP_5_3/ext/standard/info.c === --- php/php-src/branches/PHP_5_3/ext/standard/info.c2011-08-23 04:16:40 UTC (rev 315331) +++ php/php-src/branches/PHP_5_3/ext/standard/info.c2011-08-23 06:07:24 UTC (rev 315332) @@ -626,7 +626,7 @@ PUTS("\n"); - PUTS("http://www.w3.org/1999/xhtml\";>>"); + PUTS("http://www.w3.org/1999/xhtml\";>"); PUTS("\n"); php_info_print_style(TSRMLS_C); PUTS("phpinfo()"); -- 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 PHP_5_4/NEWS
aharvey Thu, 30 Jun 2011 06:14:41 + Revision: http://svn.php.net/viewvc?view=revision&revision=312659 Log: Fix bug #55066 (Missing linebreak in NEWS). Bug: https://bugs.php.net/55066 (Open) Missing linebreak in NEWS Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_4/NEWS Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2011-06-30 06:10:56 UTC (rev 312658) +++ php/php-src/branches/PHP_5_3/NEWS 2011-06-30 06:14:41 UTC (rev 312659) @@ -223,7 +223,8 @@ - Streams: . Fixed bug #54946 (stream_get_contents infinite loop). (Hannes) - . Fixed bug #54623 (Segfault when writing to a persistent socket after closinga copy of the socket). (Gustavo) + . Fixed bug #54623 (Segfault when writing to a persistent socket after +closing a copy of the socket). (Gustavo) . Zip extension: . Fixed bug #54681 (addGlob() crashes on invalid flags). (Felipe) Modified: php/php-src/branches/PHP_5_4/NEWS === --- php/php-src/branches/PHP_5_4/NEWS 2011-06-30 06:10:56 UTC (rev 312658) +++ php/php-src/branches/PHP_5_4/NEWS 2011-06-30 06:14:41 UTC (rev 312659) @@ -430,7 +430,8 @@ - Streams: . Fixed bug #54946 (stream_get_contents infinite loop). (Hannes) - . Fixed bug #54623 (Segfault when writing to a persistent socket after closinga copy of the socket). (Gustavo) + . Fixed bug #54623 (Segfault when writing to a persistent socket after +closing a copy of the socket). (Gustavo) . Zip extension: . Fixed bug #54681 (addGlob() crashes on invalid flags). (Felipe) -- 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
aharvey Tue, 10 May 2011 08:14:55 + Revision: http://svn.php.net/viewvc?view=revision&revision=310877 Log: Fix bug #54692 (SQLite3::open() Return Value) by correcting the SQLite3::open() prototype. Bug: http://bugs.php.net/54692 (Assigned) SQLite3::open() Return Value 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-05-10 07:15:22 UTC (rev 310876) +++ php/php-src/branches/PHP_5_3/ext/sqlite3/sqlite3.c 2011-05-10 08:14:55 UTC (rev 310877) @@ -89,7 +89,7 @@ zend_class_entry *php_sqlite3_stmt_entry; zend_class_entry *php_sqlite3_result_entry; -/* {{{ proto bool SQLite3::open(String filename [, int Flags [, string Encryption Key]]) +/* {{{ proto void SQLite3::open(String filename [, int Flags [, string Encryption Key]]) Opens a SQLite 3 Database, if the build includes encryption then it will attempt to use the key. */ PHP_METHOD(sqlite3, open) { Modified: php/php-src/trunk/ext/sqlite3/sqlite3.c === --- php/php-src/trunk/ext/sqlite3/sqlite3.c 2011-05-10 07:15:22 UTC (rev 310876) +++ php/php-src/trunk/ext/sqlite3/sqlite3.c 2011-05-10 08:14:55 UTC (rev 310877) @@ -89,7 +89,7 @@ zend_class_entry *php_sqlite3_stmt_entry; zend_class_entry *php_sqlite3_result_entry; -/* {{{ proto bool SQLite3::open(String filename [, int Flags [, string Encryption Key]]) +/* {{{ proto void SQLite3::open(String filename [, int Flags [, string Encryption Key]]) Opens a SQLite 3 Database, if the build includes encryption then it will attempt to use the key. */ PHP_METHOD(sqlite3, open) { -- 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/array.c branches/PHP_5_3/ext/standard/tests/array/bug54459.phpt trunk/ext/standard/array.c trunk/ext/standard/tests/arr
aharvey Wed, 06 Apr 2011 10:23:06 + Revision: http://svn.php.net/viewvc?view=revision&revision=309986 Log: Implement FR #54459 (Range function accuracy) by changing the way range() calculates values when used with floating point bounds/step. Bug: http://bugs.php.net/54459 (Open) Range function accuracy Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/standard/array.c A php/php-src/branches/PHP_5_3/ext/standard/tests/array/bug54459.phpt U php/php-src/trunk/ext/standard/array.c A php/php-src/trunk/ext/standard/tests/array/bug54459.phpt Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2011-04-06 10:22:19 UTC (rev 309985) +++ php/php-src/branches/PHP_5_3/NEWS 2011-04-06 10:23:06 UTC (rev 309986) @@ -9,6 +9,7 @@ - Core: . Fixed a crash inside dtor for error handling. (Ilia) + . Implemented FR #54459 (Range function accuracy). (Adam) . Fixed bug #54454 (substr_compare incorrectly reports equality in some cases). (Pierrick) . Fixed bug #54180 (parse_url() incorrectly parses path when ? in fragment). Modified: php/php-src/branches/PHP_5_3/ext/standard/array.c === --- php/php-src/branches/PHP_5_3/ext/standard/array.c 2011-04-06 10:22:19 UTC (rev 309985) +++ php/php-src/branches/PHP_5_3/ext/standard/array.c 2011-04-06 10:23:06 UTC (rev 309986) @@ -1688,28 +1688,32 @@ } } else if (Z_TYPE_P(zlow) == IS_DOUBLE || Z_TYPE_P(zhigh) == IS_DOUBLE || is_step_double) { - double low, high; + double low, high, value; + long i; double_str: convert_to_double(zlow); convert_to_double(zhigh); low = Z_DVAL_P(zlow); high = Z_DVAL_P(zhigh); + i = 0; if (low > high) { /* Negative steps */ if (low - high < step || step <= 0) { err = 1; goto err; } - for (; low >= (high - DOUBLE_DRIFT_FIX); low -= step) { -add_next_index_double(return_value, low); + + for (value = low; value >= (high - DOUBLE_DRIFT_FIX); value = low - (++i * step)) { +add_next_index_double(return_value, value); } } else if (high > low) { /* Positive steps */ if (high - low < step || step <= 0) { err = 1; goto err; } - for (; low <= (high + DOUBLE_DRIFT_FIX); low += step) { -add_next_index_double(return_value, low); + + for (value = low; value <= (high + DOUBLE_DRIFT_FIX); value = low + (++i * step)) { +add_next_index_double(return_value, value); } } else { add_next_index_double(return_value, low); Added: php/php-src/branches/PHP_5_3/ext/standard/tests/array/bug54459.phpt === --- php/php-src/branches/PHP_5_3/ext/standard/tests/array/bug54459.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/standard/tests/array/bug54459.phpt 2011-04-06 10:23:06 UTC (rev 309986) @@ -0,0 +1,215 @@ +--TEST-- +Bug #54459 (Range function accuracy) +--INI-- +precision=14 +--FILE-- + $v){ + echo $i, ' = ', $v, PHP_EOL; +} +foreach (range("90", "100", .1) as $i => $v){ + echo $i, ' = ', $v, PHP_EOL; +} +--EXPECT-- +0 = 90 +1 = 90.1 +2 = 90.2 +3 = 90.3 +4 = 90.4 +5 = 90.5 +6 = 90.6 +7 = 90.7 +8 = 90.8 +9 = 90.9 +10 = 91 +11 = 91.1 +12 = 91.2 +13 = 91.3 +14 = 91.4 +15 = 91.5 +16 = 91.6 +17 = 91.7 +18 = 91.8 +19 = 91.9 +20 = 92 +21 = 92.1 +22 = 92.2 +23 = 92.3 +24 = 92.4 +25 = 92.5 +26 = 92.6 +27 = 92.7 +28 = 92.8 +29 = 92.9 +30 = 93 +31 = 93.1 +32 = 93.2 +33 = 93.3 +34 = 93.4 +35 = 93.5 +36 = 93.6 +37 = 93.7 +38 = 93.8 +39 = 93.9 +40 = 94 +41 = 94.1 +42 = 94.2 +43 = 94.3 +44 = 94.4 +45 = 94.5 +46 = 94.6 +47 = 94.7 +48 = 94.8 +49 = 94.9 +50 = 95 +51 = 95.1 +52 = 95.2 +53 = 95.3 +54 = 95.4 +55 = 95.5 +56 = 95.6 +57 = 95.7 +58 = 95.8 +59 = 95.9 +60 = 96 +61 = 96.1 +62 = 96.2 +63 = 96.3 +64 = 96.4 +65 = 96.5 +66 = 96.6 +67 = 96.7 +68 = 96.8 +69 = 96.9 +70 = 97 +71 = 97.1 +72 = 97.2 +73 = 97.3 +74 = 97.4 +75 = 97.5 +76 = 97.6 +77 = 97.7 +78 = 97.8 +79 = 97.9 +80 = 98 +81 = 98.1 +82 = 98.2 +83 = 98.3 +84 = 98.4 +85 = 98.5 +86 = 98.6 +87 = 98.7 +88 = 98.8 +89 = 98.9 +90 = 99 +91 = 99.1 +92 = 99.2 +93 = 99.3 +94 = 99.4 +95 = 99.5 +96 = 99.6 +97 = 99.7 +98 = 99.8 +99 = 99.9 +100 = 100 +0 = 90 +1 = 90.1 +2 = 90.2 +3 = 90.3 +4 = 90.4 +5 = 90.5 +6 = 90.6 +7 = 90.7 +8 = 90.8 +9 = 90.9 +10 = 91 +11 = 91.1 +12 = 91.2 +13 = 91.3 +14 = 91.4 +15 = 91.5 +16 = 91.6 +17 = 91.7 +18 = 91.8 +19 = 91.9 +20 = 92 +21 = 92.1 +22 = 92.2 +23 = 92.3 +24 = 92.4 +25 = 92.5 +26 = 92.6 +27 = 92.7 +28 = 92.8 +29 = 92.9 +30 = 93 +31 = 93.1 +32 = 93.2 +33 = 93.3 +34 = 93.4 +35 = 93.5 +36 = 93.6 +37 = 93.7 +38 = 93.8 +39 = 93.9 +40 = 94 +41 = 94.1 +42 = 94.2 +43 = 94.3 +44 = 94.4 +45 = 94.5 +46 = 94.6 +47 = 94.7 +48 = 94.8 +49 = 94.9 +50 = 95 +51 = 95.1 +52 = 95.2 +53 = 95.3 +54 = 95.4 +55 = 95.5 +56 = 95.6 +57 = 95.7 +58 = 95.8 +59 = 95.9 +60 = 96
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/standard/tests/array/ bug48484.phpt
aharvey Wed, 06 Apr 2011 10:16:14 + Revision: http://svn.php.net/viewvc?view=revision&revision=309982 Log: Fix duplicated test. Changed paths: U php/php-src/branches/PHP_5_3/ext/standard/tests/array/bug48484.phpt Modified: php/php-src/branches/PHP_5_3/ext/standard/tests/array/bug48484.phpt === --- php/php-src/branches/PHP_5_3/ext/standard/tests/array/bug48484.phpt 2011-04-06 10:13:42 UTC (rev 309981) +++ php/php-src/branches/PHP_5_3/ext/standard/tests/array/bug48484.phpt 2011-04-06 10:16:14 UTC (rev 309982) @@ -6,11 +6,3 @@ ?> --EXPECT-- int(1) ---TEST-- -Bug 48484 (array_product() always returns 0 for an empty array) ---FILE-- - ---EXPECT-- -int(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_3/tests/lang/034.phpt branches/PHP_5_3/tests/lang/bug30638.phpt trunk/tests/lang/034.phpt trunk/tests/lang/bug30638.phpt
aharvey Wed, 23 Mar 2011 08:59:11 + Revision: http://svn.php.net/viewvc?view=revision&revision=309586 Log: Implement request #54355 (Test for de_DE doesn't use UTF-8 locales). Patch by Ondřej Surý. Bug: http://bugs.php.net/54355 (Assigned) Test for de_DE doesn't use UTF-8 locales Changed paths: U php/php-src/branches/PHP_5_3/tests/lang/034.phpt U php/php-src/branches/PHP_5_3/tests/lang/bug30638.phpt U php/php-src/trunk/tests/lang/034.phpt U php/php-src/trunk/tests/lang/bug30638.phpt Modified: php/php-src/branches/PHP_5_3/tests/lang/034.phpt === --- php/php-src/branches/PHP_5_3/tests/lang/034.phpt2011-03-23 08:57:52 UTC (rev 309585) +++ php/php-src/branches/PHP_5_3/tests/lang/034.phpt2011-03-23 08:59:11 UTC (rev 309586) @@ -4,14 +4,14 @@ precision=14 --SKIPIF-- --FILE-- Modified: php/php-src/branches/PHP_5_3/tests/lang/bug30638.phpt === --- php/php-src/branches/PHP_5_3/tests/lang/bug30638.phpt 2011-03-23 08:57:52 UTC (rev 309585) +++ php/php-src/branches/PHP_5_3/tests/lang/bug30638.phpt 2011-03-23 08:59:11 UTC (rev 309586) @@ -2,7 +2,7 @@ Bug #30638 (localeconv returns wrong LC_NUMERIC settings) (ok to fail on MacOS X) --SKIPIF-- --FILE-- Modified: php/php-src/trunk/tests/lang/bug30638.phpt === --- php/php-src/trunk/tests/lang/bug30638.phpt 2011-03-23 08:57:52 UTC (rev 309585) +++ php/php-src/trunk/tests/lang/bug30638.phpt 2011-03-23 08:59:11 UTC (rev 309586) @@ -2,7 +2,7 @@ Bug #30638 (localeconv returns wrong LC_NUMERIC settings) (ok to fail on MacOS X) --SKIPIF-- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] svn: /php/php-src/trunk/tests/lang/ engine_assignExecutionOrder_008.phpt foreachLoop.016.phpt
aharvey Wed, 23 Mar 2011 08:48:32 + Revision: http://svn.php.net/viewvc?view=revision&revision=309584 Log: Bah, these should have been in the last commit too. Update expected output for further tests that now generate warnings after r306931. Changed paths: U php/php-src/trunk/tests/lang/engine_assignExecutionOrder_008.phpt U php/php-src/trunk/tests/lang/foreachLoop.016.phpt Modified: php/php-src/trunk/tests/lang/engine_assignExecutionOrder_008.phpt === --- php/php-src/trunk/tests/lang/engine_assignExecutionOrder_008.phpt 2011-03-23 08:43:36 UTC (rev 309583) +++ php/php-src/trunk/tests/lang/engine_assignExecutionOrder_008.phpt 2011-03-23 08:48:32 UTC (rev 309584) @@ -66,10 +66,16 @@ ${'i'}=f(): good $i[0]=f(): good $i[0][0]=f(): good -$i->p=f(): good -$i->p->q=f(): good +$i->p=f(): +Warning: Creating default object from empty value in %s on line %d +good +$i->p->q=f(): +Warning: Creating default object from empty value in %s on line %d +good $i->p[0]=f(): good -$i->p[0]->p=f(): good +$i->p[0]->p=f(): +Warning: Creating default object from empty value in %s on line %d +good C::$p=f(): good C::$p[0]=f(): good -C::$p->q=f(): good \ No newline at end of file +C::$p->q=f(): good Modified: php/php-src/trunk/tests/lang/foreachLoop.016.phpt === --- php/php-src/trunk/tests/lang/foreachLoop.016.phpt 2011-03-23 08:43:36 UTC (rev 309583) +++ php/php-src/trunk/tests/lang/foreachLoop.016.phpt 2011-03-23 08:48:32 UTC (rev 309584) @@ -150,12 +150,16 @@ } $a->b + +Warning: Creating default object from empty value in %s on line %d array(1) { [0]=> string(8) "original" } $a->b->c + +Warning: Creating default object from empty value in %s on line %d array(1) { [0]=> string(8) "original" @@ -174,6 +178,8 @@ } $a->b[0]->c + +Warning: Creating default object from empty value in %s on line %d array(1) { [0]=> string(8) "original" @@ -192,7 +198,9 @@ } C::$a[0]->b + +Warning: Creating default object from empty value in %s on line %d array(1) { [0]=> string(8) "original" -} \ 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/trunk/tests/lang/ bug7515.phpt
aharvey Wed, 23 Mar 2011 08:43:36 + Revision: http://svn.php.net/viewvc?view=revision&revision=309583 Log: Update test that now generates a warning after r306931, which increased the error you get when silently casting an empty variable to an object to an E_WARNING from E_STRICT. Changed paths: U php/php-src/trunk/tests/lang/bug7515.phpt Modified: php/php-src/trunk/tests/lang/bug7515.phpt === --- php/php-src/trunk/tests/lang/bug7515.phpt 2011-03-23 07:53:40 UTC (rev 309582) +++ php/php-src/trunk/tests/lang/bug7515.phpt 2011-03-23 08:43:36 UTC (rev 309583) @@ -32,5 +32,6 @@ "; } ?> ---EXPECT-- +--EXPECTF-- +Warning: Creating default object from empty value in %s on line %d 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_3/NEWS branches/PHP_5_3/ext/pdo_pgsql/config.m4 trunk/ext/pdo_pgsql/config.m4
aharvey Tue, 22 Mar 2011 09:12:01 + Revision: http://svn.php.net/viewvc?view=revision&revision=309545 Log: Fix bug #54318 (Non-portable grep option used in PDO pgsql configuration). Patch by Ben Walton . Bug: http://bugs.php.net/54318 (Assigned) Non-portable grep option used in PDO pgsql configuration Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/pdo_pgsql/config.m4 U php/php-src/trunk/ext/pdo_pgsql/config.m4 Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2011-03-22 09:08:00 UTC (rev 309544) +++ php/php-src/branches/PHP_5_3/NEWS 2011-03-22 09:12:01 UTC (rev 309545) @@ -29,6 +29,10 @@ . Fixed bug #54167 (PDO_DBLIB returns null on SQLUNIQUE field). (mjh at hodginsmedia dot com, Felipe) +- PDO PostgreSQL driver: + . Fixed bug #54318 (Non-portable grep option used in PDO pgsql +configuration). (bwalton at artsci dot utoronto dot ca) + - SOAP extension: . Fixed bug #54312 (soap_version logic bug). (tom at samplonius dot org) Modified: php/php-src/branches/PHP_5_3/ext/pdo_pgsql/config.m4 === --- php/php-src/branches/PHP_5_3/ext/pdo_pgsql/config.m42011-03-22 09:08:00 UTC (rev 309544) +++ php/php-src/branches/PHP_5_3/ext/pdo_pgsql/config.m42011-03-22 09:12:01 UTC (rev 309545) @@ -69,7 +69,8 @@ AC_DEFINE(HAVE_PDO_PGSQL,1,[Whether to build PostgreSQL for PDO support or not]) AC_MSG_CHECKING([for openssl dependencies]) - if grep -q openssl $PGSQL_INCLUDE/libpq-fe.h ; then + grep openssl $PGSQL_INCLUDE/libpq-fe.h >/dev/null 2>&1 + if test $? -eq 0 ; then AC_MSG_RESULT([yes]) dnl First try to find pkg-config AC_PATH_PROG(PKG_CONFIG, pkg-config, no) Modified: php/php-src/trunk/ext/pdo_pgsql/config.m4 === --- php/php-src/trunk/ext/pdo_pgsql/config.m4 2011-03-22 09:08:00 UTC (rev 309544) +++ php/php-src/trunk/ext/pdo_pgsql/config.m4 2011-03-22 09:12:01 UTC (rev 309545) @@ -69,7 +69,8 @@ AC_DEFINE(HAVE_PDO_PGSQL,1,[Whether to build PostgreSQL for PDO support or not]) AC_MSG_CHECKING([for openssl dependencies]) - if grep -q openssl $PGSQL_INCLUDE/libpq-fe.h ; then + grep openssl $PGSQL_INCLUDE/libpq-fe.h >/dev/null 2>&1 + if test $? -eq 0 ; then AC_MSG_RESULT([yes]) dnl First try to find pkg-config AC_PATH_PROG(PKG_CONFIG, pkg-config, no) -- 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/date/php_date.c branches/PHP_5_3/ext/date/tests/bug54340.phpt trunk/ext/date/php_date.c trunk/ext/date/tests/bug54340.phpt
aharvey Tue, 22 Mar 2011 08:33:22 + Revision: http://svn.php.net/viewvc?view=revision&revision=309535 Log: Fix bug #54340 (DateTime::add() method bug). Bug: http://bugs.php.net/54340 (Assigned) DateTime::add() method bug Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/date/php_date.c A php/php-src/branches/PHP_5_3/ext/date/tests/bug54340.phpt U php/php-src/trunk/ext/date/php_date.c A php/php-src/trunk/ext/date/tests/bug54340.phpt Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2011-03-22 08:27:33 UTC (rev 309534) +++ php/php-src/branches/PHP_5_3/NEWS 2011-03-22 08:33:22 UTC (rev 309535) @@ -10,6 +10,7 @@ (tomas dot brastavicius at quantum dot lt, Pierrick) - DateTime extension: + . Fixed bug #54340 (DateTime::add() method bug). (Adam) . Fixed bug #54316 (DateTime::createFromFormat does not handle trailing '|' correctly). (Adam) Modified: php/php-src/branches/PHP_5_3/ext/date/php_date.c === --- php/php-src/branches/PHP_5_3/ext/date/php_date.c2011-03-22 08:27:33 UTC (rev 309534) +++ php/php-src/branches/PHP_5_3/ext/date/php_date.c2011-03-22 08:33:22 UTC (rev 309535) @@ -2860,14 +2860,13 @@ if (intobj->diff->invert) { bias = -1; } + memset(&dateobj->time->relative, 0, sizeof(struct timelib_rel_time)); dateobj->time->relative.y = intobj->diff->y * bias; dateobj->time->relative.m = intobj->diff->m * bias; dateobj->time->relative.d = intobj->diff->d * bias; dateobj->time->relative.h = intobj->diff->h * bias; dateobj->time->relative.i = intobj->diff->i * bias; dateobj->time->relative.s = intobj->diff->s * bias; - dateobj->time->relative.weekday = 0; - dateobj->time->relative.have_weekday_relative = 0; } dateobj->time->have_relative = 1; dateobj->time->sse_uptodate = 0; @@ -2907,6 +2906,7 @@ bias = -1; } + memset(&dateobj->time->relative, 0, sizeof(struct timelib_rel_time)); dateobj->time->relative.y = 0 - (intobj->diff->y * bias); dateobj->time->relative.m = 0 - (intobj->diff->m * bias); dateobj->time->relative.d = 0 - (intobj->diff->d * bias); @@ -2914,8 +2914,6 @@ dateobj->time->relative.i = 0 - (intobj->diff->i * bias); dateobj->time->relative.s = 0 - (intobj->diff->s * bias); dateobj->time->have_relative = 1; - dateobj->time->relative.weekday = 0; - dateobj->time->relative.have_weekday_relative = 0; dateobj->time->sse_uptodate = 0; timelib_update_ts(dateobj->time, NULL); Added: php/php-src/branches/PHP_5_3/ext/date/tests/bug54340.phpt === --- php/php-src/branches/PHP_5_3/ext/date/tests/bug54340.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/date/tests/bug54340.phpt 2011-03-22 08:33:22 UTC (rev 309535) @@ -0,0 +1,43 @@ +--TEST-- +Bug #54340 (DateTime::add() method bug) +--INI-- +date.timezone=UTC +--FILE-- +add($interval); +var_dump($dt); + +$dt = new DateTime('first day of January 2011'); + +$dt->sub($interval); +var_dump($dt); +--EXPECT-- +object(DateTime)#2 (3) { + ["date"]=> + string(19) "2011-01-01 00:00:00" + ["timezone_type"]=> + int(3) + ["timezone"]=> + string(3) "UTC" +} +object(DateTime)#2 (3) { + ["date"]=> + string(19) "2011-01-02 00:00:00" + ["timezone_type"]=> + int(3) + ["timezone"]=> + string(3) "UTC" +} +object(DateTime)#3 (3) { + ["date"]=> + string(19) "2010-12-31 00:00:00" + ["timezone_type"]=> + int(3) + ["timezone"]=> + string(3) "UTC" +} Modified: php/php-src/trunk/ext/date/php_date.c === --- php/php-src/trunk/ext/date/php_date.c 2011-03-22 08:27:33 UTC (rev 309534) +++ php/php-src/trunk/ext/date/php_date.c 2011-03-22 08:33:22 UTC (rev 309535) @@ -2855,14 +2855,13 @@ if (intobj->diff->invert) { bias = -1; } + memset(&dateobj->time->relative, 0, sizeof(struct timelib_rel_time)); dateobj->time->relative.y = intobj->diff->y * bias; dateobj->time->relative.m = intobj->diff->m * bias; dateobj->time->relative.d = intobj->diff->d * bias; dateobj->time->relative.h = intobj->diff->h * bias; dateobj->time->relative.i = intobj->diff->i * bias; dateobj->time->relative.s = intobj->diff->s * bias; - dateobj->time->relative.weekday = 0; - dateobj->time->relative.have_weekday_relative = 0;
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/date/lib/parse_date.c branches/PHP_5_3/ext/date/lib/parse_date.re branches/PHP_5_3/ext/date/tests/bug54316.phpt trunk/ext/date/l
aharvey Mon, 21 Mar 2011 09:40:52 + Revision: http://svn.php.net/viewvc?view=revision&revision=309493 Log: Fix bug #54316 (DateTime::createFromFormat does not handle trailing '|' correctly). Bug: http://bugs.php.net/54316 (Assigned) DateTime::createFromFormat does not handle trailing '|' correctly Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/date/lib/parse_date.c U php/php-src/branches/PHP_5_3/ext/date/lib/parse_date.re A php/php-src/branches/PHP_5_3/ext/date/tests/bug54316.phpt U php/php-src/trunk/ext/date/lib/parse_date.c U php/php-src/trunk/ext/date/lib/parse_date.re A php/php-src/trunk/ext/date/tests/bug54316.phpt -- 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/NEWS branches/PHP_5_3/ext/filter/tests/015.phpt branches/PHP_5_3/ext/standard/url.c trunk/ext/filter/tests/015.phpt trunk/ext/standard/url.c
On 5 February 2011 05:41, Ilia Alshanetsky wrote: > Log: > Fixed bug #53924 (FILTER_VALIDATE_URL doesn't validate port number). > > Modified: php/php-src/branches/PHP_5_3/NEWS > === > --- php/php-src/branches/PHP_5_3/NEWS 2011-02-04 19:22:43 UTC (rev 308034) > +++ php/php-src/branches/PHP_5_3/NEWS 2011-02-04 21:41:15 UTC (rev 308035) > @@ -109,6 +111,8 @@ > - Phar extension: > . Fixed bug #53541 (format string bug in ext/phar). > (crrodriguez at opensuse dot org, Ilia) > + . Fixed bug #53898 (PHAR reports invalid error message, when the directory > + does not exist). (Ilia) I suspect that NEWS item was meant to be for another commit. :) Adam -- 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/zip/php_zip.c trunk/ext/zip/php_zip.c
aharvey Fri, 04 Feb 2011 11:51:29 + Revision: http://svn.php.net/viewvc?view=revision&revision=308020 Log: Change the way HAVE_GLOB is dealt with in ext/zip per IRC conversation with Pierre. Changed paths: U php/php-src/branches/PHP_5_3/ext/zip/php_zip.c U php/php-src/trunk/ext/zip/php_zip.c Modified: php/php-src/branches/PHP_5_3/ext/zip/php_zip.c === --- php/php-src/branches/PHP_5_3/ext/zip/php_zip.c 2011-02-04 11:24:29 UTC (rev 308019) +++ php/php-src/branches/PHP_5_3/ext/zip/php_zip.c 2011-02-04 11:51:29 UTC (rev 308020) @@ -473,10 +473,12 @@ #define GLOB_FLAGMASK (~GLOB_ONLYDIR) #else #define GLOB_FLAGMASK (~0) +#endif #endif /* }}} */ int php_zip_glob(char *pattern, int pattern_len, long flags, zval *return_value TSRMLS_DC) /* {{{ */ { +#ifdef HAVE_GLOB char cwd[MAXPATHLEN]; int cwd_skip = 0; #ifdef ZTS @@ -563,9 +565,12 @@ globfree(&globbuf); return globbuf.gl_pathc; +#else + php_error_docref(NULL TSRMLS_CC, E_ERROR, "Glob support is not available"); + return 0; +#endif /* HAVE_GLOB */ } /* }}} */ -#endif /* HAVE_GLOB */ int php_zip_pcre(char *regexp, int regexp_len, char *path, int path_len, zval *return_value TSRMLS_DC) /* {{{ */ { @@ -665,8 +670,9 @@ return files_cnt; } /* }}} */ -#endif +#endif + /* {{{ arginfo */ ZEND_BEGIN_ARG_INFO_EX(arginfo_zip_open, 0, 0, 1) ZEND_ARG_INFO(0, filename) @@ -1591,11 +1597,9 @@ char *add_path = NULL; int pattern_len, add_path_len, remove_path_len, path_len = 0; long remove_all_path = 0; + long flags = 0; zval *options = NULL; int found; -#ifdef HAVE_GLOB - long flags = 0; -#endif if (!this) { RETURN_FALSE; @@ -1604,15 +1608,10 @@ ZIP_FROM_OBJECT(intern, this); /* 1 == glob, 2==pcre */ if (type == 1) { -#ifdef HAVE_GLOB if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|la", &pattern, &pattern_len, &flags, &options) == FAILURE) { return; } -#else - php_error_docref(NULL TSRMLS_CC, E_ERROR, "Glob support is not available"); - RETURN_FALSE; -#endif } else { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sa", &pattern, &pattern_len, &path, &path_len, &options) == FAILURE) { @@ -1635,9 +1634,7 @@ } if (type == 1) { -#ifdef HAVE_GLOB found = php_zip_glob(pattern, pattern_len, flags, return_value TSRMLS_CC); -#endif } else { found = php_zip_pcre(pattern, pattern_len, path, path_len, return_value TSRMLS_CC); } @@ -1696,7 +1693,6 @@ } /* }}} */ -#ifdef HAVE_GLOB /* {{{ proto bool ZipArchive::addGlob(string pattern[,int flags [, array options]]) Add files matching the glob pattern. See php's glob for the pattern syntax. */ static ZIPARCHIVE_METHOD(addGlob) @@ -1704,7 +1700,6 @@ php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); } /* }}} */ -#endif /* {{{ proto bool ZipArchive::addPattern(string pattern[, string path [, array options]]) Add files matching the pcre pattern. See php's pcre for the pattern syntax. */ @@ -2580,13 +2575,11 @@ ZEND_ARG_INFO(0, dirname) ZEND_END_ARG_INFO() -#ifdef HAVE_GLOB ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_addglob, 0, 0, 1) ZEND_ARG_INFO(0, pattern) ZEND_ARG_INFO(0, flags) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() -#endif ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_addpattern, 0, 0, 1) ZEND_ARG_INFO(0, pattern) @@ -2692,9 +2685,7 @@ ZIPARCHIVE_ME(addEmptyDir, arginfo_ziparchive_addemptydir, ZEND_ACC_PUBLIC) ZIPARCHIVE_ME(addFromString, arginfo_ziparchive_addfromstring, ZEND_ACC_PUBLIC) ZIPARCHIVE_ME(addFile, arginfo_ziparchive_addfile, ZEND_ACC_PUBLIC) -#ifdef HAVE_GLOB ZIPARCHIVE_ME(addGlob, arginfo_ziparchive_addglob, ZEND_ACC_PUBLIC) -#endif ZIPARCHIVE_ME(addPattern, arginfo_ziparchive_addpattern, ZEND_ACC_PUBLIC) ZIPARCHIVE_ME(renameIndex, arginfo_ziparchive_renameindex, ZEND_ACC_PUBLIC) ZIPARCHIVE_ME(renameName, arginfo_ziparchive_renamename, ZEND_ACC_PUBLIC) Modified: php/php-src/trunk/ext/zip/php_zip.c === --- php/php-src/trunk/ext/zip/php_zip.c 2011-02-04 11:24:29 UTC (rev 308019) +++ php/php-src/trunk/ext/zip/php_zip.c 2011-02-04 11:51:29 UTC (rev 308020) @@ -473,10 +473,12 @@ #define GLOB_FLAGMASK (~GLOB_ONLYDIR) #else #define GLOB_FLAGMASK (~0) +#endif #endif /* }}} */ int php_zip_glob(char *patter
[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ NEWS
aharvey Fri, 04 Feb 2011 10:55:34 + Revision: http://svn.php.net/viewvc?view=revision&revision=308015 Log: Update 5.3.6 NEWS to use a consistent bug ordering. I've gone with Pierre's order on Internals for now (new features, then non-bug tracker fixes, then bugs in descending order of bug number) -- feel free to bikeshed this on Internals or IRC, but we need to pick _something_, because it's all over the place at present. (And yes, I'm partly to blame for that too.) 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 2011-02-04 10:50:42 UTC (rev 308014) +++ php/php-src/branches/PHP_5_3/NEWS 2011-02-04 10:55:34 UTC (rev 308015) @@ -63,40 +63,40 @@ MIME header unfolding). (Adam) - Intl extension: + . Fixed bug #53612 (Segmentation fault when using cloned several intl +objects). (Gustavo) . Fixed bug #53512 (NumberFormatter::setSymbol crash on bogus $attr values). (Felipe) - . Fixed bug #53612 (Segmentation fault when using cloned several intl -objects). (Gustavo) . Implemented clone functionality for number, date & message formatters. (Stas). - MySQL Improved extension: . Added 'db' and 'catalog' keys to the field fetching functions (FR #39847). (Kalle) + . Fixed buggy counting of affected rows when using the text protocol. The +collected statistics were wrong when multi_query was used with mysqlnd +(Andrey) . Fixed bug #53795 (Connect Error from MySqli (mysqlnd) when using SSL). (Kalle) . Fixed bug #53503 (mysqli::query returns false after successful LOAD DATA query). (Kalle, Andrey) . Fixed bug #53425 (mysqli_real_connect() ignores client flags when built to call libmysql). (Kalle, tre-php-net at crushedhat dot com) - . Fixed buggy counting of affected rows when using the text protocol. The -collected statistics were wrong when multi_query was used with mysqlnd -(Andrey) - OpenSSL extension: + . Fixed stream_socket_enable_crypto() not honoring the socket timeout in +server mode. (Gustavo) + . Fixed bug #53592 (stream_socket_enable_crypto() busy-waits in client mode). +(Gustavo) . Implemented FR #53447 (Cannot disable SessionTicket extension for servers that do not support it) by adding a no_ticket SSL context option. (Adam, Tony) - . Fixed bug #53592 (stream_socket_enable_crypto() busy-waits in client mode). -(Gustavo) - . Fixed stream_socket_enable_crypto() not honoring the socket timeout in -server mode. (Gustavo) - PDO MySQL driver: + . Fixed bug #53551 (PDOStatement execute segfaults for pdo_mysql driver). +(Johannes) . Implemented FR #47802 (Support for setting character sets in DSN strings). (Kalle) - . Fixed bug #53551 (PDOStatement execute segfaults for pdo_mysql driver). -(Johannes) - PDO Oracle driver: . Fixed bug #39199 (Cannot load Lob data with more than 4000 bytes on @@ -111,10 +111,10 @@ (crrodriguez at opensuse dot org, Ilia) - PHP-FPM SAPI: - . Fixed bug #53527 (php-fpm --test doesn't set a valuable return value). (fat) . Enforce security in the fastcgi protocol parsing. (ef-lists at email dotde) . Fixed bug #53777 (php-fpm log format now match php_error log format). (fat) + . Fixed bug #53527 (php-fpm --test doesn't set a valuable return value). (fat) . Fixed bug #53434 (php-fpm slowlog now also logs the original request). (fat) - Readline extension: @@ -125,6 +125,10 @@ . Fixed bug #53915 (ReflectionClass::getConstant(s) emits fatal error on constants with self::). (Gustavo) +- SNMP extension: + . Fixed bug #51336 (snmprealwalk (snmp v1) does not handle end of OID tree +correctly). (Boris Lytochkin) + - SOAP extension: . Fixed possible crash introduced by the NULL poisoning patch. (Mateusz Kocielski, Pierre) @@ -145,11 +149,11 @@ all of the rows have been fetched). (Scott) - Streams: - . Implemented FR #26158 (open arbitrary file descriptor with fopen). (Gustavo) . Fixed bug #53913 (Streams functions assume HAVE_GLOB is defined). (Chris Jones) . Fixed bug #53903 (userspace stream stat callback does not separate the elements of the returned array before converting them). (Gustavo) + . Implemented FR #26158 (open arbitrary file descriptor with fopen). (Gustavo) - XSL extension: . Fixed memory leaked introduced by the NULL poisoning patch. @@ -158,23 +162,20 @@ - Zip extension: . Added the filename into the return value of stream_get_meta_data(). (Hannes) . Fixed bug #53923 (Zip functions assume HAVE_GLOB is defined). (Adam) + . Fixed bug #53885 (ZipArchive segfault with FL_UNCHANGED on empty archive). +(Stas, Maksymilian Arciemowicz). + . Fixed bug #53854 (Missing constants for compression type). (Richard, Adam) + . Fixed bug #53603 (ZipArchive should qui
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/zip/php_zip.c trunk/ext/zip/php_zip.c
aharvey Fri, 04 Feb 2011 10:50:42 + Revision: http://svn.php.net/viewvc?view=revision&revision=308014 Log: Fix bug #53923 (Zip functions assume HAVE_GLOB is defined). Bug: http://bugs.php.net/53923 (Assigned) Zip functions assume HAVE_GLOB is defined Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/zip/php_zip.c U php/php-src/trunk/ext/zip/php_zip.c Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2011-02-04 10:49:49 UTC (rev 308013) +++ php/php-src/branches/PHP_5_3/NEWS 2011-02-04 10:50:42 UTC (rev 308014) @@ -157,6 +157,7 @@ - Zip extension: . Added the filename into the return value of stream_get_meta_data(). (Hannes) + . Fixed bug #53923 (Zip functions assume HAVE_GLOB is defined). (Adam) . Fixed bug #53166 (Missing parameters in docs and reflection definition). (Richard) . Fixed bug #53568 (swapped memset arguments in struct initialization). Modified: php/php-src/branches/PHP_5_3/ext/zip/php_zip.c === --- php/php-src/branches/PHP_5_3/ext/zip/php_zip.c 2011-02-04 10:49:49 UTC (rev 308013) +++ php/php-src/branches/PHP_5_3/ext/zip/php_zip.c 2011-02-04 10:50:42 UTC (rev 308014) @@ -565,6 +565,7 @@ return globbuf.gl_pathc; } /* }}} */ +#endif /* HAVE_GLOB */ int php_zip_pcre(char *regexp, int regexp_len, char *path, int path_len, zval *return_value TSRMLS_DC) /* {{{ */ { @@ -666,8 +667,6 @@ /* }}} */ #endif -#endif - /* {{{ arginfo */ ZEND_BEGIN_ARG_INFO_EX(arginfo_zip_open, 0, 0, 1) ZEND_ARG_INFO(0, filename) @@ -1592,9 +1591,11 @@ char *add_path = NULL; int pattern_len, add_path_len, remove_path_len, path_len = 0; long remove_all_path = 0; - long flags = 0; zval *options = NULL; int found; +#ifdef HAVE_GLOB + long flags = 0; +#endif if (!this) { RETURN_FALSE; @@ -1603,10 +1604,15 @@ ZIP_FROM_OBJECT(intern, this); /* 1 == glob, 2==pcre */ if (type == 1) { +#ifdef HAVE_GLOB if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|la", &pattern, &pattern_len, &flags, &options) == FAILURE) { return; } +#else + php_error_docref(NULL TSRMLS_CC, E_ERROR, "Glob support is not available"); + RETURN_FALSE; +#endif } else { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|sa", &pattern, &pattern_len, &path, &path_len, &options) == FAILURE) { @@ -1629,7 +1635,9 @@ } if (type == 1) { +#ifdef HAVE_GLOB found = php_zip_glob(pattern, pattern_len, flags, return_value TSRMLS_CC); +#endif } else { found = php_zip_pcre(pattern, pattern_len, path, path_len, return_value TSRMLS_CC); } @@ -1688,6 +1696,7 @@ } /* }}} */ +#ifdef HAVE_GLOB /* {{{ proto bool ZipArchive::addGlob(string pattern[,int flags [, array options]]) Add files matching the glob pattern. See php's glob for the pattern syntax. */ static ZIPARCHIVE_METHOD(addGlob) @@ -1695,6 +1704,7 @@ php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); } /* }}} */ +#endif /* {{{ proto bool ZipArchive::addPattern(string pattern[, string path [, array options]]) Add files matching the pcre pattern. See php's pcre for the pattern syntax. */ @@ -2570,11 +2580,13 @@ ZEND_ARG_INFO(0, dirname) ZEND_END_ARG_INFO() +#ifdef HAVE_GLOB ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_addglob, 0, 0, 1) ZEND_ARG_INFO(0, pattern) ZEND_ARG_INFO(0, flags) ZEND_ARG_INFO(0, options) ZEND_END_ARG_INFO() +#endif ZEND_BEGIN_ARG_INFO_EX(arginfo_ziparchive_addpattern, 0, 0, 1) ZEND_ARG_INFO(0, pattern) @@ -2680,7 +2692,9 @@ ZIPARCHIVE_ME(addEmptyDir, arginfo_ziparchive_addemptydir, ZEND_ACC_PUBLIC) ZIPARCHIVE_ME(addFromString, arginfo_ziparchive_addfromstring, ZEND_ACC_PUBLIC) ZIPARCHIVE_ME(addFile, arginfo_ziparchive_addfile, ZEND_ACC_PUBLIC) +#ifdef HAVE_GLOB ZIPARCHIVE_ME(addGlob, arginfo_ziparchive_addglob, ZEND_ACC_PUBLIC) +#endif ZIPARCHIVE_ME(addPattern, arginfo_ziparchive_addpattern, ZEND_ACC_PUBLIC) ZIPARCHIVE_ME(renameIndex, arginfo_ziparchive_renameindex, ZEND_ACC_PUBLIC) ZIPARCHIVE_ME(renameName, arginfo_ziparchive_renamename, ZEND_ACC_PUBLIC) Modified: php/php-src/trunk/ext/zip/php_zip.c === --- php/php-src/trunk/ext/zip/php_zip.c 2011-02-04 10:49:49 UTC (rev 308013
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/spl/spl_directory.c branches/PHP_5_3/ext/spl/tests/dit_001.phpt branches/PHP_5_3/ext/spl/tests/dit_001_noglob.phpt branches/PHP_
aharvey Fri, 04 Feb 2011 10:49:49 + Revision: http://svn.php.net/viewvc?view=revision&revision=308013 Log: Fix bug #53914 (SPL assumes HAVE_GLOB is defined). Original patch by Chris Jones; test updates by myself. Bug: http://bugs.php.net/53914 (Assigned) SPL assumes HAVE_GLOB is defined Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/spl/spl_directory.c U php/php-src/branches/PHP_5_3/ext/spl/tests/dit_001.phpt A php/php-src/branches/PHP_5_3/ext/spl/tests/dit_001_noglob.phpt U php/php-src/branches/PHP_5_3/ext/spl/tests/dit_002.phpt U php/php-src/trunk/ext/spl/spl_directory.c U php/php-src/trunk/ext/spl/tests/dit_001.phpt A php/php-src/trunk/ext/spl/tests/dit_001_noglob.phpt U php/php-src/trunk/ext/spl/tests/dit_002.phpt Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2011-02-04 10:49:33 UTC (rev 308012) +++ php/php-src/branches/PHP_5_3/NEWS 2011-02-04 10:49:49 UTC (rev 308013) @@ -130,6 +130,7 @@ (Mateusz Kocielski, Pierre) - SPL extension: + . Fixed bug #53914 (SPL assumes HAVE_GLOB is defined). (Chris Jones) . Fixed bug #53515 (property_exists incorrect on ArrayObject null and 0 values). (Felipe) Modified: php/php-src/branches/PHP_5_3/ext/spl/spl_directory.c === --- php/php-src/branches/PHP_5_3/ext/spl/spl_directory.c 2011-02-04 10:49:33 UTC (rev 308012) +++ php/php-src/branches/PHP_5_3/ext/spl/spl_directory.c 2011-02-04 10:49:49 UTC (rev 308013) @@ -164,11 +164,13 @@ PHPAPI char* spl_filesystem_object_get_path(spl_filesystem_object *intern, int *len TSRMLS_DC) /* {{{ */ { +#ifdef HAVE_GLOB if (intern->type == SPL_FS_DIR) { if (php_stream_is(intern->u.dir.dirp ,&php_glob_stream_ops)) { return php_glob_stream_get_path(intern->u.dir.dirp, 0, len); } } +#endif if (len) { *len = intern->_path_len; } @@ -575,6 +577,7 @@ efree(pnstr); } if (intern->type == SPL_FS_DIR) { +#ifdef HAVE_GLOB pnstr = spl_gen_private_prop_name(spl_ce_DirectoryIterator, "glob", sizeof("glob")-1, &pnlen TSRMLS_CC); if (php_stream_is(intern->u.dir.dirp ,&php_glob_stream_ops)) { add_assoc_stringl_ex(&zrv, pnstr, pnlen+1, intern->_path, intern->_path_len, 1); @@ -582,6 +585,7 @@ add_assoc_bool_ex(&zrv, pnstr, pnlen+1, 0); } efree(pnstr); +#endif pnstr = spl_gen_private_prop_name(spl_ce_RecursiveDirectoryIterator, "subPathName", sizeof("subPathName")-1, &pnlen TSRMLS_CC); if (intern->u.dir.sub_path) { add_assoc_stringl_ex(&zrv, pnstr, pnlen+1, intern->u.dir.sub_path, intern->u.dir.sub_path_len, 1); @@ -647,12 +651,16 @@ intern = (spl_filesystem_object*)zend_object_store_get_object(getThis() TSRMLS_CC); intern->flags = flags; +#ifdef HAVE_GLOB if (SPL_HAS_FLAG(ctor_flags, DIT_CTOR_GLOB) && strstr(path, "glob://") != path) { spprintf(&path, 0, "glob://%s", path); spl_filesystem_dir_open(intern, path TSRMLS_CC); efree(path); - } else { + } else +#endif + { spl_filesystem_dir_open(intern, path TSRMLS_CC); + } intern->u.dir.is_recursive = instanceof_function(intern->std.ce, spl_ce_RecursiveDirectoryIterator TSRMLS_CC) ? 1 : 0; @@ -1439,6 +1447,7 @@ } /* }}} */ +#ifdef HAVE_GLOB /* {{{ proto int GlobIterator::__construct(string path [, int flags]) Cronstructs a new dir iterator from a glob expression (no glob:// needed). */ SPL_METHOD(GlobIterator, __construct) @@ -1465,6 +1474,7 @@ } } /* }}} */ +#endif /* HAVE_GLOB */ /* {{{ forward declarations to the iterator handlers */ static void spl_filesystem_dir_it_dtor(zend_object_iterator *iter TSRMLS_DC); @@ -1864,11 +1874,13 @@ {NULL, NULL, NULL} }; +#ifdef HAVE_GLOB static const zend_function_entry spl_GlobIterator_functions[] = { SPL_ME(GlobIterator, __construct, arginfo_r_dir___construct, ZEND_ACC_PUBLIC) SPL_ME(GlobIterator, count, arginfo_splfileinfo_void, ZEND_ACC_PUBLIC) {NULL, NULL, NULL} }; +#endif /* }}} */ static int spl_filesystem_file_read(spl_filesystem_object *intern, int silent TSRMLS_DC) /* {{{ */ @@ -2824,8 +2836,10 @@ REGISTER_SPL_SUB_CLASS_EX(RecursiveDirectoryIterator, FilesystemIterator, spl_filesystem_object_new, spl_RecursiveDirectoryIterator_functions); REGISTER_SPL_IMPLEMENTS(RecursiveDirectoryIterator, RecursiveIterator); +#ifdef HAVE_GLOB REGISTER_SPL_SUB_CLASS_EX(GlobIterator, FilesystemIterator, spl_filesystem_object_new, spl_GlobIterator_functions); REGISTER_SPL_IMPLEMENTS(GlobIterator, Countable); +#endif REGISTER_SPL_SUB_CLASS_EX(SplFileObject, SplFileInfo, spl_filesystem_object_new, spl_SplFileObject_functions); REGISTER_SPL_IMPLEMENTS(SplFileObject, RecursiveIterator); Modified: php/php-src/branches/PHP_5_3/ext/spl/tests/dit_001.phpt === --- php/
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/standard/basic_functions.c branches/PHP_5_3/main/streams/plain_wrapper.c trunk/ext/standard/basic_functions.c trunk/main/streams
aharvey Fri, 04 Feb 2011 10:47:41 + Revision: http://svn.php.net/viewvc?view=revision&revision=308011 Log: Fix bug #53913 (Streams functions assume HAVE_GLOB is defined). Patch by Chris Jones. Bug: http://bugs.php.net/53913 (Assigned) Streams functions assume HAVE_GLOB is defined Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c U php/php-src/branches/PHP_5_3/main/streams/plain_wrapper.c U php/php-src/trunk/ext/standard/basic_functions.c U php/php-src/trunk/main/streams/plain_wrapper.c Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2011-02-04 10:42:43 UTC (rev 308010) +++ php/php-src/branches/PHP_5_3/NEWS 2011-02-04 10:47:41 UTC (rev 308011) @@ -145,6 +145,8 @@ - Streams: . Implemented FR #26158 (open arbitrary file descriptor with fopen). (Gustavo) + . Fixed bug #53913 (Streams functions assume HAVE_GLOB is defined). (Chris +Jones) . Fixed bug #53903 (userspace stream stat callback does not separate the elements of the returned array before converting them). (Gustavo) 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 2011-02-04 10:42:43 UTC (rev 308010) +++ php/php-src/branches/PHP_5_3/ext/standard/basic_functions.c 2011-02-04 10:47:41 UTC (rev 308011) @@ -3648,7 +3648,9 @@ php_register_url_stream_wrapper("php", &php_stream_php_wrapper TSRMLS_CC); php_register_url_stream_wrapper("file", &php_plain_files_wrapper TSRMLS_CC); +#ifdef HAVE_GLOB php_register_url_stream_wrapper("glob", &php_glob_stream_wrapper TSRMLS_CC); +#endif php_register_url_stream_wrapper("data", &php_stream_rfc2397_wrapper TSRMLS_CC); #ifndef PHP_CURL_URL_WRAPPERS php_register_url_stream_wrapper("http", &php_stream_http_wrapper TSRMLS_CC); Modified: php/php-src/branches/PHP_5_3/main/streams/plain_wrapper.c === --- php/php-src/branches/PHP_5_3/main/streams/plain_wrapper.c 2011-02-04 10:42:43 UTC (rev 308010) +++ php/php-src/branches/PHP_5_3/main/streams/plain_wrapper.c 2011-02-04 10:47:41 UTC (rev 308011) @@ -855,9 +855,11 @@ DIR *dir = NULL; php_stream *stream = NULL; +#ifdef HAVE_GLOB if (options & STREAM_USE_GLOB_DIR_OPEN) { return php_glob_stream_wrapper.wops->dir_opener(&php_glob_stream_wrapper, path, mode, options, opened_path, context STREAMS_REL_CC TSRMLS_CC); } +#endif if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path TSRMLS_CC)) { return NULL; Modified: php/php-src/trunk/ext/standard/basic_functions.c === --- php/php-src/trunk/ext/standard/basic_functions.c2011-02-04 10:42:43 UTC (rev 308010) +++ php/php-src/trunk/ext/standard/basic_functions.c2011-02-04 10:47:41 UTC (rev 308011) @@ -3613,7 +3613,9 @@ php_register_url_stream_wrapper("php", &php_stream_php_wrapper TSRMLS_CC); php_register_url_stream_wrapper("file", &php_plain_files_wrapper TSRMLS_CC); +#ifdef HAVE_GLOB php_register_url_stream_wrapper("glob", &php_glob_stream_wrapper TSRMLS_CC); +#endif php_register_url_stream_wrapper("data", &php_stream_rfc2397_wrapper TSRMLS_CC); #ifndef PHP_CURL_URL_WRAPPERS php_register_url_stream_wrapper("http", &php_stream_http_wrapper TSRMLS_CC); Modified: php/php-src/trunk/main/streams/plain_wrapper.c === --- php/php-src/trunk/main/streams/plain_wrapper.c 2011-02-04 10:42:43 UTC (rev 308010) +++ php/php-src/trunk/main/streams/plain_wrapper.c 2011-02-04 10:47:41 UTC (rev 308011) @@ -855,9 +855,11 @@ DIR *dir = NULL; php_stream *stream = NULL; +#ifdef HAVE_GLOB if (options & STREAM_USE_GLOB_DIR_OPEN) { return php_glob_stream_wrapper.wops->dir_opener(&php_glob_stream_wrapper, path, mode, options, opened_path, context STREAMS_REL_CC TSRMLS_CC); } +#endif if (((options & STREAM_DISABLE_OPEN_BASEDIR) == 0) && php_check_open_basedir(path TSRMLS_CC)) { 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/trunk/ UPGRADING
aharvey Sat, 29 Jan 2011 05:26:45 + Revision: http://svn.php.net/viewvc?view=revision&revision=307839 Log: Revert the UPGRADING change in r307807, since it's actually completely pointless, as Johannes pointed out. Changed paths: U php/php-src/trunk/UPGRADING Modified: php/php-src/trunk/UPGRADING === --- php/php-src/trunk/UPGRADING 2011-01-28 22:14:20 UTC (rev 307838) +++ php/php-src/trunk/UPGRADING 2011-01-29 05:26:45 UTC (rev 307839) @@ -371,12 +371,7 @@ i. New class constants - - ZipArchive::CM_BZIP2 - - ZipArchive::CM_LZ77 - - ZipArchive::CM_LZMA - - ZipArchive::CM_PPMD - - ZipArchive::CM_TERSE - - ZipArchive::CM_WAVPACK + - j. New Hash algorithms -- 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/NEWS branches/PHP_5_3/ext/zip/php_zip.c branches/PHP_5_3/ext/zip/tests/bug53854.phpt trunk/UPGRADING trunk/ext/zip/php_zip.c trunk/ext/zip/tests/bug53
2011/1/28 Johannes Schlüter : > On Fri, 2011-01-28 at 04:19 +0000, Adam Harvey wrote: >> >> Modified: php/php-src/trunk/UPGRADING >> === >> --- php/php-src/trunk/UPGRADING 2011-01-28 04:17:08 UTC (rev 307806) >> +++ php/php-src/trunk/UPGRADING 2011-01-28 04:19:40 UTC (rev 307807) >> @@ -371,7 +371,12 @@ >> >> i. New class constants >> >> - - >> + - ZipArchive::CM_BZIP2 >> + - ZipArchive::CM_LZ77 >> + - ZipArchive::CM_LZMA >> + - ZipArchive::CM_PPMD >> + - ZipArchive::CM_TERSE >> + - ZipArchive::CM_WAVPACK >> >> j. New Hash algorithms >> > > Why are you adding these in trunk/UPGRADING when they are also in 5.3 > and will appear there first? Rank idiocy combined with sleep deprivation. Thanks. :) Adam -- 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
aharvey Fri, 28 Jan 2011 04:30:12 + Revision: http://svn.php.net/viewvc?view=revision&revision=307808 Log: Fix NEWS sorting. 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 2011-01-28 04:19:40 UTC (rev 307807) +++ php/php-src/branches/PHP_5_3/NEWS 2011-01-28 04:30:12 UTC (rev 307808) @@ -138,14 +138,14 @@ - Zip extension: . Added the filename into the return value of stream_get_meta_data(). (Hannes) + . Fixed bug #53166 (Missing parameters in docs and reflection definition). +(Richard) . Fixed bug #53568 (swapped memset arguments in struct initialization). (crrodriguez at opensuse dot org) . Fixed bug #53579 (stream_get_contents() segfaults on ziparchive streams). (Hannes) . Fixed bug #53603 (ZipArchive should quiet stat errors). (brad dot froehle at gmail dot com, Gustavo) - . Fixed bug #53166 (Missing parameters in docs and reflection definition). -(Richard) . Fixed bug #53854 (Missing constants for compression type). (Richard, Adam) 06 Jan 2011, PHP 5.3.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/zip/php_zip.c branches/PHP_5_3/ext/zip/tests/bug53854.phpt trunk/UPGRADING trunk/ext/zip/php_zip.c trunk/ext/zip/tests/bug53854.
aharvey Fri, 28 Jan 2011 04:19:40 + Revision: http://svn.php.net/viewvc?view=revision&revision=307807 Log: Fixed bug #53854 (Missing constants for compression type). Patch by Richard Quadling. Bug: http://bugs.php.net/53854 (Assigned) Missing constants for compression type. Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/zip/php_zip.c A php/php-src/branches/PHP_5_3/ext/zip/tests/bug53854.phpt U php/php-src/trunk/UPGRADING U php/php-src/trunk/ext/zip/php_zip.c A php/php-src/trunk/ext/zip/tests/bug53854.phpt Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2011-01-28 04:17:08 UTC (rev 307806) +++ php/php-src/branches/PHP_5_3/NEWS 2011-01-28 04:19:40 UTC (rev 307807) @@ -146,6 +146,7 @@ gmail dot com, Gustavo) . Fixed bug #53166 (Missing parameters in docs and reflection definition). (Richard) + . Fixed bug #53854 (Missing constants for compression type). (Richard, Adam) 06 Jan 2011, PHP 5.3.5 - Fixed Bug #53632 (infinite loop with x87 fpu). (CVE-2010-4645) (Scott, Modified: php/php-src/branches/PHP_5_3/ext/zip/php_zip.c === --- php/php-src/branches/PHP_5_3/ext/zip/php_zip.c 2011-01-28 04:17:08 UTC (rev 307806) +++ php/php-src/branches/PHP_5_3/ext/zip/php_zip.c 2011-01-28 04:19:40 UTC (rev 307807) @@ -2754,6 +2754,12 @@ REGISTER_ZIP_CLASS_CONST_LONG("CM_DEFLATE", ZIP_CM_DEFLATE); REGISTER_ZIP_CLASS_CONST_LONG("CM_DEFLATE64", ZIP_CM_DEFLATE64); REGISTER_ZIP_CLASS_CONST_LONG("CM_PKWARE_IMPLODE", ZIP_CM_PKWARE_IMPLODE); + REGISTER_ZIP_CLASS_CONST_LONG("CM_BZIP2", ZIP_CM_BZIP2); + REGISTER_ZIP_CLASS_CONST_LONG("CM_LZMA", ZIP_CM_LZMA); + REGISTER_ZIP_CLASS_CONST_LONG("CM_TERSE", ZIP_CM_TERSE); + REGISTER_ZIP_CLASS_CONST_LONG("CM_LZ77", ZIP_CM_LZ77); + REGISTER_ZIP_CLASS_CONST_LONG("CM_WAVPACK", ZIP_CM_WAVPACK); + REGISTER_ZIP_CLASS_CONST_LONG("CM_PPMD", ZIP_CM_PPMD); /* Error code */ REGISTER_ZIP_CLASS_CONST_LONG("ER_OK", ZIP_ER_OK); /* N No error */ Added: php/php-src/branches/PHP_5_3/ext/zip/tests/bug53854.phpt === --- php/php-src/branches/PHP_5_3/ext/zip/tests/bug53854.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/zip/tests/bug53854.phpt2011-01-28 04:19:40 UTC (rev 307807) @@ -0,0 +1,44 @@ +--TEST-- +Bug #53854 (Missing constants for compression type) +--SKIPIF-- + +--FILE-- + +--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
aharvey Fri, 28 Jan 2011 04:17:08 + Revision: http://svn.php.net/viewvc?view=revision&revision=307806 Log: Fix NEWS typo. 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 2011-01-28 03:55:34 UTC (rev 307805) +++ php/php-src/branches/PHP_5_3/NEWS 2011-01-28 04:17:08 UTC (rev 307806) @@ -144,7 +144,7 @@ (Hannes) . Fixed bug #53603 (ZipArchive should quiet stat errors). (brad dot froehle at gmail dot com, Gustavo) - . Fixed bzg #53166 (Missing parameters in docs and reflection definition). + . Fixed bug #53166 (Missing parameters in docs and reflection definition). (Richard) 06 Jan 2011, PHP 5.3.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/ext/zip/tests/stream_meta_data.phpt trunk/ext/zip/tests/stream_meta_data.phpt
aharvey Fri, 28 Jan 2011 03:55:34 + Revision: http://svn.php.net/viewvc?view=revision&revision=307805 Log: Fix zip test. Changed paths: U php/php-src/branches/PHP_5_3/ext/zip/tests/stream_meta_data.phpt U php/php-src/trunk/ext/zip/tests/stream_meta_data.phpt Modified: php/php-src/branches/PHP_5_3/ext/zip/tests/stream_meta_data.phpt === --- php/php-src/branches/PHP_5_3/ext/zip/tests/stream_meta_data.phpt 2011-01-28 00:16:42 UTC (rev 307804) +++ php/php-src/branches/PHP_5_3/ext/zip/tests/stream_meta_data.phpt 2011-01-28 03:55:34 UTC (rev 307805) @@ -64,7 +64,7 @@ ["seekable"]=> bool(false) ["uri"]=> - string(99) "zip:///%stest_with_comment.zip#foo" + string(%d) "zip:///%stest_with_comment.zip#foo" ["timed_out"]=> bool(false) ["blocked"]=> Modified: php/php-src/trunk/ext/zip/tests/stream_meta_data.phpt === --- php/php-src/trunk/ext/zip/tests/stream_meta_data.phpt 2011-01-28 00:16:42 UTC (rev 307804) +++ php/php-src/trunk/ext/zip/tests/stream_meta_data.phpt 2011-01-28 03:55:34 UTC (rev 307805) @@ -64,7 +64,7 @@ ["seekable"]=> bool(false) ["uri"]=> - string(99) "zip:///%stest_with_comment.zip#foo" + string(%d) "zip:///%stest_with_comment.zip#foo" ["timed_out"]=> bool(false) ["blocked"]=> -- 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/ basic_functions.c http.c php_http.h url.h
On 8 January 2011 10:34, Rui Hirokawa wrote: > hirokawa Sat, 08 Jan 2011 02:34:33 + > > Revision: http://svn.php.net/viewvc?view=revision&revision=307248 > > Log: > MFH: added an option to http_build_query for RFC-3986 > based url-encoding. Somebody should double check me on this, because binary compatibility's not one of my stronger points, but isn't the change to the php_url_encode_hash_ex() definition going to break BC in 5.3? ext/standard/php_http.h is one of the headers we install. Adam -- 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/php.ini-development branches/PHP_5_3/php.ini-production trunk/php.ini-development trunk/php.ini-production
aharvey Fri, 07 Jan 2011 03:43:20 + Revision: http://svn.php.net/viewvc?view=revision&revision=307206 Log: Implement request #53684 (Deprecated HTML in sample php.ini). Bug: http://bugs.php.net/53684 (Assigned) Deprecated HTML in sample php.ini Changed paths: U php/php-src/branches/PHP_5_3/php.ini-development U php/php-src/branches/PHP_5_3/php.ini-production U php/php-src/trunk/php.ini-development U php/php-src/trunk/php.ini-production Modified: php/php-src/branches/PHP_5_3/php.ini-development === --- php/php-src/branches/PHP_5_3/php.ini-development2011-01-07 03:39:17 UTC (rev 307205) +++ php/php-src/branches/PHP_5_3/php.ini-development2011-01-07 03:43:20 UTC (rev 307206) @@ -621,13 +621,13 @@ ; this setting blank. ; http://php.net/error-prepend-string ; Example: -;error_prepend_string = "" +;error_prepend_string = "" ; String to output after an error message. PHP's default behavior is to leave ; this setting blank. ; http://php.net/error-append-string ; Example: -;error_append_string = "" +;error_append_string = "" ; Log errors to specified file. PHP's default behavior is to leave this value ; empty. Modified: php/php-src/branches/PHP_5_3/php.ini-production === --- php/php-src/branches/PHP_5_3/php.ini-production 2011-01-07 03:39:17 UTC (rev 307205) +++ php/php-src/branches/PHP_5_3/php.ini-production 2011-01-07 03:43:20 UTC (rev 307206) @@ -621,13 +621,13 @@ ; this setting blank. ; http://php.net/error-prepend-string ; Example: -;error_prepend_string = "" +;error_prepend_string = "" ; String to output after an error message. PHP's default behavior is to leave ; this setting blank. ; http://php.net/error-append-string ; Example: -;error_append_string = "" +;error_append_string = "" ; Log errors to specified file. PHP's default behavior is to leave this value ; empty. Modified: php/php-src/trunk/php.ini-development === --- php/php-src/trunk/php.ini-development 2011-01-07 03:39:17 UTC (rev 307205) +++ php/php-src/trunk/php.ini-development 2011-01-07 03:43:20 UTC (rev 307206) @@ -566,13 +566,13 @@ ; this setting blank. ; http://php.net/error-prepend-string ; Example: -;error_prepend_string = "" +;error_prepend_string = "" ; String to output after an error message. PHP's default behavior is to leave ; this setting blank. ; http://php.net/error-append-string ; Example: -;error_append_string = "" +;error_append_string = "" ; Log errors to specified file. PHP's default behavior is to leave this value ; empty. Modified: php/php-src/trunk/php.ini-production === --- php/php-src/trunk/php.ini-production2011-01-07 03:39:17 UTC (rev 307205) +++ php/php-src/trunk/php.ini-production2011-01-07 03:43:20 UTC (rev 307206) @@ -566,13 +566,13 @@ ; this setting blank. ; http://php.net/error-prepend-string ; Example: -;error_prepend_string = "" +;error_prepend_string = "" ; String to output after an error message. PHP's default behavior is to leave ; this setting blank. ; http://php.net/error-append-string ; Example: -;error_append_string = "" +;error_append_string = "" ; Log errors to specified file. PHP's default behavior is to leave this value ; empty. -- 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 UPGRADING ext/spl/internal/regexiterator.inc ext/spl/spl_iterators.c ext/spl/spl_iterators.h ext/spl/tests/regexiterator_getregex.phpt
aharvey Thu, 06 Jan 2011 02:32:02 + Revision: http://svn.php.net/viewvc?view=revision&revision=307147 Log: Implement request #53659 (Implementing RegexIterator::getRegex() method). Patch by Joshua Thijssen. Bug: http://bugs.php.net/53659 (Assigned) Implementing RegexIterator::getRegex() method Changed paths: U php/php-src/trunk/NEWS U php/php-src/trunk/UPGRADING U php/php-src/trunk/ext/spl/internal/regexiterator.inc U php/php-src/trunk/ext/spl/spl_iterators.c U php/php-src/trunk/ext/spl/spl_iterators.h A php/php-src/trunk/ext/spl/tests/regexiterator_getregex.phpt Modified: php/php-src/trunk/NEWS === --- php/php-src/trunk/NEWS 2011-01-06 02:24:49 UTC (rev 307146) +++ php/php-src/trunk/NEWS 2011-01-06 02:32:02 UTC (rev 307147) @@ -182,6 +182,7 @@ either is present at compile time. (Rasmus) - Improved SPL extension: + . Added RegexIterator::getRegex() method. (Joshua Thijssen) . Added SplObjectStorage::getHash() hook. (Etienne) . Added SplFileInfo::getExtension(). FR #48767. (Peter Cowburn) Modified: php/php-src/trunk/UPGRADING === --- php/php-src/trunk/UPGRADING 2011-01-06 02:24:49 UTC (rev 307146) +++ php/php-src/trunk/UPGRADING 2011-01-06 02:32:02 UTC (rev 307147) @@ -353,6 +353,9 @@ - ReflectionClass::getTraitAliases() - ReflectionParameter::canBePassedByValue() + - RegexIterator + - RegexIterator::getRegex() + - PDO_dblib - PDO::newRowset() Modified: php/php-src/trunk/ext/spl/internal/regexiterator.inc === --- php/php-src/trunk/ext/spl/internal/regexiterator.inc2011-01-06 02:24:49 UTC (rev 307146) +++ php/php-src/trunk/ext/spl/internal/regexiterator.inc2011-01-06 02:32:02 UTC (rev 307147) @@ -158,6 +158,13 @@ { $this->preg_flags = $preg_flags; } + + /** @return current regular expression + */ + function getRegex() + { + return $this->regex; + } } ?> Modified: php/php-src/trunk/ext/spl/spl_iterators.c === --- php/php-src/trunk/ext/spl/spl_iterators.c 2011-01-06 02:24:49 UTC (rev 307146) +++ php/php-src/trunk/ext/spl/spl_iterators.c 2011-01-06 02:32:02 UTC (rev 307147) @@ -1465,6 +1465,7 @@ } intern->u.regex.mode = mode; intern->u.regex.regex = estrndup(regex, regex_len); + intern->u.regex.regex_len = regex_len; intern->u.regex.pce = pcre_get_compiled_regex_cache(regex, regex_len TSRMLS_CC); if (intern->u.regex.pce == NULL) { /* pcre_get_compiled_regex_cache has already sent error */ @@ -1941,6 +1942,19 @@ } } /* }}} */ +/* {{{ proto string RegexIterator::getRegex() + Returns current regular expression */ +SPL_METHOD(RegexIterator, getRegex) +{ + spl_dual_it_object *intern = (spl_dual_it_object*)zend_object_store_get_object(getThis() TSRMLS_CC); + + if (zend_parse_parameters_none() == FAILURE) { + return; + } + + RETURN_STRINGL(intern->u.regex.regex, intern->u.regex.regex_len, 1); +} /* }}} */ + /* {{{ proto bool RegexIterator::getMode() Returns current operation mode */ SPL_METHOD(RegexIterator, getMode) @@ -2205,6 +2219,7 @@ SPL_ME(RegexIterator, setFlags, arginfo_regex_it_set_flags, ZEND_ACC_PUBLIC) SPL_ME(RegexIterator, getPregFlags, arginfo_recursive_it_void, ZEND_ACC_PUBLIC) SPL_ME(RegexIterator, setPregFlags, arginfo_regex_it_set_preg_flags, ZEND_ACC_PUBLIC) + SPL_ME(RegexIterator, getRegex, arginfo_recursive_it_void, ZEND_ACC_PUBLIC) {NULL, NULL, NULL} }; Modified: php/php-src/trunk/ext/spl/spl_iterators.h === --- php/php-src/trunk/ext/spl/spl_iterators.h 2011-01-06 02:24:49 UTC (rev 307146) +++ php/php-src/trunk/ext/spl/spl_iterators.h 2011-01-06 02:32:02 UTC (rev 307147) @@ -154,6 +154,7 @@ long preg_flags; pcre_cache_entry *pce; char *regex; + uint regex_len; } regex; #endif } u; Added: php/php-src/trunk/ext/spl/tests/regexiterator_getregex.phpt === --- php/php-src/trunk/ext/spl/tests/regexiterator_getregex.phpt (rev 0) +++ php/php-src/trunk/ext/spl/tests/regexiterator_getregex.phpt 2011-01-06 02:32:02 UTC (rev 307147) @@ -0,0 +1,29 @@ +--TEST-- +SP
[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/spl/tests/bug53588.phpt trunk/ext/spl/tests/bug53588.phpt
aharvey Thu, 06 Jan 2011 02:24:49 + Revision: http://svn.php.net/viewvc?view=revision&revision=307146 Log: Remove empty files left when r306542 was reverted in r306552. Changed paths: D php/php-src/branches/PHP_5_3/ext/spl/tests/bug53588.phpt D php/php-src/trunk/ext/spl/tests/bug53588.phpt Deleted: php/php-src/branches/PHP_5_3/ext/spl/tests/bug53588.phpt === Deleted: php/php-src/trunk/ext/spl/tests/bug53588.phpt === -- 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 ext/imap/php_imap.c ext/imap/tests/bug53377.phpt
aharvey Mon, 13 Dec 2010 08:38:01 + Revision: http://svn.php.net/viewvc?view=revision&revision=306336 Log: MFH: fixed bug #53377 (imap_mime_header_decode() doesn't ignore \t during long MIME header unfolding). Bug: http://bugs.php.net/53377 (Suspended) imap_mime_header_decode() doesn't ignore \t during long MIME header unfolding Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/imap/php_imap.c A php/php-src/branches/PHP_5_3/ext/imap/tests/bug53377.phpt Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2010-12-13 08:29:44 UTC (rev 306335) +++ php/php-src/branches/PHP_5_3/NEWS 2010-12-13 08:38:01 UTC (rev 306336) @@ -16,6 +16,10 @@ (Ilia) . Fixed bug #47435 (FILTER_FLAG_NO_RES_RANGE don't work with ipv6). (Ilia, valli at icsurselva dot ch) + +- IMAP extension: + . Fixed bug #53377 (imap_mime_header_decode() doesn't ignore \t during long +MIME header unfolding). (Adam) - Intl extension: . Fixed bug #53512 (NumberFormatter::setSymbol crash on bogus $attr values). Modified: php/php-src/branches/PHP_5_3/ext/imap/php_imap.c === --- php/php-src/branches/PHP_5_3/ext/imap/php_imap.c2010-12-13 08:29:44 UTC (rev 306335) +++ php/php-src/branches/PHP_5_3/ext/imap/php_imap.c2010-12-13 08:38:01 UTC (rev 306336) @@ -4243,7 +4243,7 @@ } offset = end_token+2; - for (i = 0; (string[offset + i] == ' ') || (string[offset + i] == 0x0a) || (string[offset + i] == 0x0d); i++); + for (i = 0; (string[offset + i] == ' ') || (string[offset + i] == 0x0a) || (string[offset + i] == 0x0d) || (string[offset + i] == '\t'); i++); if ((string[offset + i] == '=') && (string[offset + i + 1] == '?') && (offset + i < end)) { offset += i; } Added: php/php-src/branches/PHP_5_3/ext/imap/tests/bug53377.phpt === --- php/php-src/branches/PHP_5_3/ext/imap/tests/bug53377.phpt (rev 0) +++ php/php-src/branches/PHP_5_3/ext/imap/tests/bug53377.phpt 2010-12-13 08:38:01 UTC (rev 306336) @@ -0,0 +1,38 @@ +--TEST-- +Bug #53377 (imap_mime_header_decode() doesn't ignore \t during long MIME header unfolding) +--SKIPIF-- + +--FILE-- + + object(stdClass)#1 (2) { +["charset"]=> +string(5) "UTF-8" +["text"]=> +string(3) "€" + } + [1]=> + object(stdClass)#2 (2) { +["charset"]=> +string(5) "UTF-8" +["text"]=> +string(3) "€" + } + [2]=> + object(stdClass)#3 (2) { +["charset"]=> +string(5) "UTF-8" +["text"]=> +string(3) "€" + } +} -- 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 ext/openssl/xp_ssl.c
aharvey Mon, 13 Dec 2010 08:29:44 + Revision: http://svn.php.net/viewvc?view=revision&revision=306335 Log: MFH: implement FR #53447 (Cannot disable SessionTicket extension for servers that do not support it). Includes Tony's subsequent commit to fix a segfault. Bug: http://bugs.php.net/53447 (Suspended) Cannot disable SessionTicket extension for servers that do not support it Changed paths: U php/php-src/branches/PHP_5_3/NEWS U php/php-src/branches/PHP_5_3/ext/openssl/xp_ssl.c Modified: php/php-src/branches/PHP_5_3/NEWS === --- php/php-src/branches/PHP_5_3/NEWS 2010-12-13 07:54:58 UTC (rev 306334) +++ php/php-src/branches/PHP_5_3/NEWS 2010-12-13 08:29:44 UTC (rev 306335) @@ -27,6 +27,11 @@ . Fixed bug #53425 (mysqli_real_connect() ignores client flags when built to call libmysql). (Kalle, tre-php-net at crushedhat dot com) +- OpenSSL extension: + . Implemented FR #53447 (Cannot disable SessionTicket extension for servers +that do not support it) by adding a no_ticket SSL context option. (Adam, +Tony) + - 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) 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 2010-12-13 07:54:58 UTC (rev 306334) +++ php/php-src/branches/PHP_5_3/ext/openssl/xp_ssl.c 2010-12-13 08:29:44 UTC (rev 306335) @@ -369,6 +369,18 @@ SSL_CTX_set_options(sslsock->ctx, SSL_OP_ALL); +#if OPENSSL_VERSION_NUMBER >= 0x0090806fL + { + zval **val; + + if (stream->context && SUCCESS == php_stream_context_get_option( + stream->context, "ssl", "no_ticket", &val) && + zval_is_true(*val)) { + SSL_CTX_set_options(sslsock->ctx, SSL_OP_NO_TICKET); + } + } +#endif + sslsock->ssl_handle = php_SSL_new_from_context(sslsock->ctx, stream TSRMLS_CC); if (sslsock->ssl_handle == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to create an SSL handle"); -- 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
aharvey Thu, 09 Dec 2010 02:47:47 + Revision: http://svn.php.net/viewvc?view=revision&revision=306105 Log: Fix the next version number in NEWS. 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 2010-12-09 00:18:40 UTC (rev 306104) +++ php/php-src/branches/PHP_5_2/NEWS 2010-12-09 02:47:47 UTC (rev 306105) @@ -1,6 +1,6 @@ PHP NEWS ||| -?? ?? , PHP 5.2.15 +?? ?? , PHP 5.2.16 09 Dec 2010, PHP 5.2.15 - Fixed extract() to do not overwrite $GLOBALS and $this when using -- 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 UPGRADING ext/standard/math.c ext/standard/php_math.h ext/standard/tests/math/number_format_multichar.phpt
aharvey Fri, 03 Dec 2010 10:10:08 + Revision: http://svn.php.net/viewvc?view=revision&revision=305937 Log: Implement FR #53457 (number_format must support more than one character for thousands separator). Bug: http://bugs.php.net/53457 (Assigned) number_format must support more than one character for thousands separator Changed paths: U php/php-src/trunk/NEWS U php/php-src/trunk/UPGRADING U php/php-src/trunk/ext/standard/math.c U php/php-src/trunk/ext/standard/php_math.h A php/php-src/trunk/ext/standard/tests/math/number_format_multichar.phpt Modified: php/php-src/trunk/NEWS === --- php/php-src/trunk/NEWS 2010-12-03 09:34:35 UTC (rev 305936) +++ php/php-src/trunk/NEWS 2010-12-03 10:10:08 UTC (rev 305937) @@ -112,6 +112,10 @@ getallheaders(), apache_request_headers() and apache_response_headers() . Improved performance of FastCGI request parsing. +- Improved core functions: + . number_format() no longer truncates multibyte decimal points and thousand +separators to the first byte. FR #53457. (Adam) + - Improved CURL extension: . Added support for CURLOPT_MAX_RECV_SPEED_LARGE and CURLOPT_MAX_SEND_SPEED_LARGE. FR #51815. (Pierrick) Modified: php/php-src/trunk/UPGRADING === --- php/php-src/trunk/UPGRADING 2010-12-03 09:34:35 UTC (rev 305936) +++ php/php-src/trunk/UPGRADING 2010-12-03 10:10:08 UTC (rev 305937) @@ -133,6 +133,8 @@ behavior follows the recommendations of Unicode Technical Report #36. - htmlspecialchars_decode/html_entity_decode now decode ' if the document type is ENT_XML1, ENT_XHTML, or ENT_HTML5. +- number_format() no longer truncates multibyte decimal points and thousand + separators to the first byte. - The third parameter ($matches) to preg_match_all() is now optional. If omitted, the function will simply return the number of times the pattern was matched in the subject and will have no other side effects. Modified: php/php-src/trunk/ext/standard/math.c === --- php/php-src/trunk/ext/standard/math.c 2010-12-03 09:34:35 UTC (rev 305936) +++ php/php-src/trunk/ext/standard/math.c 2010-12-03 10:10:08 UTC (rev 305937) @@ -1082,6 +1082,11 @@ */ PHPAPI char *_php_math_number_format(double d, int dec, char dec_point, char thousand_sep) { + return _php_math_number_format_ex(d, dec, &dec_point, 1, &thousand_sep, 1); +} + +PHPAPI char *_php_math_number_format_ex(double d, int dec, char *dec_point, size_t dec_point_len, char *thousand_sep, size_t thousand_sep_len) +{ char *tmpbuf = NULL, *resbuf; char *s, *t; /* source, target */ char *dp; @@ -1121,7 +1126,7 @@ /* allow for thousand separators */ if (thousand_sep) { - integral += (integral-1) / 3; + integral += thousand_sep_len * ((integral-1) / 3); } reslen = integral; @@ -1130,7 +1135,7 @@ reslen += dec; if (dec_point) { - reslen++; + reslen += dec_point_len; } } @@ -1166,7 +1171,8 @@ /* add decimal point */ if (dec_point) { - *t-- = dec_point; + t -= dec_point_len; + memcpy(t + 1, dec_point, dec_point_len); } } @@ -1175,7 +1181,8 @@ while(s >= tmpbuf) { *t-- = *s--; if (thousand_sep && (++count%3)==0 && s>=tmpbuf) { - *t-- = thousand_sep; + t -= thousand_sep_len; + memcpy(t + 1, thousand_sep, thousand_sep_len); } } @@ -1212,21 +1219,17 @@ RETURN_STRING(_php_math_number_format(num, dec, dec_point_chr, thousand_sep_chr), 0); break; case 4: - if (dec_point != NULL) { - if (dec_point_len) { - dec_point_chr = dec_point[0]; - } else { - dec_point_chr = 0; - } + if (dec_point == NULL) { + dec_point = &dec_point_chr; + dec_point_len = 1; } - if (thousand_sep != NULL) { - if (thousand_sep_len) { - thousand_sep_chr = thousand_sep[0]; - } else { - thousand_sep_chr = 0; - } + + if (thousand_sep == NULL) { + thousand_sep = &thousand_sep_chr; + thousand_sep_len = 1; } - RETURN_STRING(_php_math_number_format(num, dec
[PHP-CVS] svn: /php/php-src/trunk/ NEWS ext/openssl/xp_ssl.c
aharvey Fri, 03 Dec 2010 09:34:35 + Revision: http://svn.php.net/viewvc?view=revision&revision=305936 Log: Implemented FR #53447 (Cannot disable SessionTicket extension for servers that do not support it). I haven't written a test due to the need for such a test to have a HTTPS server available which mishandles SessionTicket requests; it's likely that server administrators will gradually fix this either intentionally or through OpenSSL upgrades. That said, if there's a great clamoring for a test, I'll work one up. Bug: http://bugs.php.net/53447 (Assigned) Cannot disable SessionTicket extension for servers that do not support it Changed paths: U php/php-src/trunk/NEWS U php/php-src/trunk/ext/openssl/xp_ssl.c Modified: php/php-src/trunk/NEWS === --- php/php-src/trunk/NEWS 2010-12-03 09:11:31 UTC (rev 305935) +++ php/php-src/trunk/NEWS 2010-12-03 09:34:35 UTC (rev 305936) @@ -152,6 +152,8 @@ - Improved OpenSSL extension: . 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) - Improved PDO DB-LIB: (Stanley) . Added nextRowset support. Modified: php/php-src/trunk/ext/openssl/xp_ssl.c === --- php/php-src/trunk/ext/openssl/xp_ssl.c 2010-12-03 09:11:31 UTC (rev 305935) +++ php/php-src/trunk/ext/openssl/xp_ssl.c 2010-12-03 09:34:35 UTC (rev 305936) @@ -369,6 +369,18 @@ SSL_CTX_set_options(sslsock->ctx, SSL_OP_ALL); +#if OPENSSL_VERSION_NUMBER >= 0x0090806fL + { + zval **val; + + if (SUCCESS == php_stream_context_get_option( + stream->context, "ssl", "no_ticket", &val) && + zval_is_true(*val)) { + SSL_CTX_set_options(sslsock->ctx, SSL_OP_NO_TICKET); + } + } +#endif + sslsock->ssl_handle = php_SSL_new_from_context(sslsock->ctx, stream TSRMLS_CC); if (sslsock->ssl_handle == NULL) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to create an SSL handle"); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php