[PHP-CVS-DAILY] cvs: php-src / ChangeLog
changelog Tue Nov 14 01:31:22 2006 UTC Modified files: /php-srcChangeLog Log: ChangeLog update http://cvs.php.net/viewvc.cgi/php-src/ChangeLog?r1=1.2511r2=1.2512diff_format=u Index: php-src/ChangeLog diff -u php-src/ChangeLog:1.2511 php-src/ChangeLog:1.2512 --- php-src/ChangeLog:1.2511Mon Nov 13 01:31:13 2006 +++ php-src/ChangeLog Tue Nov 14 01:31:21 2006 @@ -1,3 +1,125 @@ +2006-11-13 Ilia Alshanetsky [EMAIL PROTECTED] + +* ext/pgsql/pgsql.c: + MFB: Fixed bug #36812 (pg_execute() modifies input array). + +* (PHP_5_2) + NEWS + ext/pgsql/pgsql.c: + Fixed bug #36812 (pg_execute() modifies input array). + +2006-11-13 Antony Dovgal [EMAIL PROTECTED] + +* ext/standard/tests/file/fgetss.phpt + ext/standard/tests/file/fgetss.phpt: + + file fgetss.phpt was initially added on branch PHP_5_2. + +2006-11-13 Rob Richards [EMAIL PROTECTED] + +* NEWS: + BFN + +* ext/xmlwriter/php_xmlwriter.c + ext/xmlwriter/tests/bug39504.phpt: + Fixed bug #39504 (xmlwriter_write_dtd_entity() creates Attlist tag, + not enity). (Hannes Magnusson) + add test + +2006-11-13 Antony Dovgal [EMAIL PROTECTED] + +* ext/standard/file.c + ext/standard/file.c: + don't forget to close the stream when/if flock() fails + +* (PHP_5_2) + ext/standard/file.c + ext/standard/tests/strings/get_meta_tags.phpt: + MFH: fix leaks in get_meta_tags() when used with b0rked HTML + add test + +* ext/standard/file.c + ext/standard/tests/strings/get_meta_tags.phpt + ext/standard/tests/strings/get_meta_tags.phpt: + fix leaks in get_meta_tags() when used with b0rked HTML + add test + +* ext/filter/filter.c + ext/filter/tests/039.phpt: + improve the fix and the test + +2006-11-13 Hannes Magnusson [EMAIL PROTECTED] + +* (PHP_5_2) + README.UPDATE_5_2: + It's called addEmptyDir(), not createEmptyDir() + +2006-11-13 Ilia Alshanetsky [EMAIL PROTECTED] + +* ext/standard/array.c: + MFB: php_splice() optimization + +* ext/com_dotnet/com_variant.c: + MFB: Fixed bug #36644 (possible crash in variant_date_from_timestamp()). + +* (PHP_5_2) + NEWS + ext/com_dotnet/com_variant.c: + Fixed bug #36644 (possible crash in variant_date_from_timestamp()). + +2006-11-13 Dmitry Stogov [EMAIL PROTECTED] + +* TSRM/tsrm_virtual_cwd.c + TSRM/tsrm_virtual_cwd.c + TSRM/tsrm_virtual_cwd.h + TSRM/tsrm_virtual_cwd.h: + Use symbolic names + +2006-11-13 Antony Dovgal [EMAIL PROTECTED] + +* ext/filter/filter.c: + actually copy input to return_value + input is a local var, you can't use it this way + +* (PHP_5_2) + ext/filter/tests/039.phpt: + new test + +* ext/filter/tests/039.phpt + ext/filter/tests/039.phpt: + + new test + +2006-11-13 Michael Wallner [EMAIL PROTECTED] + +* tests/output/ob_013.phpt + tests/output/ob_020.phpt: + - fix tests + +* main/output.c + main/php_output.h: + - fix buffer size alignment + - avoid memory overflow #if MEMORY_LIMIT + +2006-11-13 Antony Dovgal [EMAIL PROTECTED] + +* ext/dom/tests/bug38474.phpt + ext/dom/tests/bug38474.phpt: + add a note that libxml2 2.6.2x is required + +* ext/xmlrpc/xmlrpc-epi-php.c: + fix compile warning + +* (PHP_5_2) + ext/mysqli/tests/bug37090.phpt: + fix test + +2006-11-13 Dmitry Stogov [EMAIL PROTECTED] + +* ZendEngine2/zend_alloc.c + ZendEngine2/zend_alloc.c: + Fixed incorrect heap corruptiuon detection code + 2006-11-12 Hannes Magnusson [EMAIL PROTECTED] * ext/spl/config.m4:
[PHP-CVS-DAILY] cvs: ZendEngine2 / ChangeLog
changelog Tue Nov 14 01:31:25 2006 UTC Modified files: /ZendEngine2ChangeLog Log: ChangeLog update http://cvs.php.net/viewvc.cgi/ZendEngine2/ChangeLog?r1=1.1018r2=1.1019diff_format=u Index: ZendEngine2/ChangeLog diff -u ZendEngine2/ChangeLog:1.1018 ZendEngine2/ChangeLog:1.1019 --- ZendEngine2/ChangeLog:1.1018Sat Nov 11 01:31:31 2006 +++ ZendEngine2/ChangeLog Tue Nov 14 01:31:25 2006 @@ -1,3 +1,9 @@ +2006-11-13 Dmitry Stogov [EMAIL PROTECTED] + +* zend_alloc.c + zend_alloc.c: + Fixed incorrect heap corruptiuon detection code + 2006-11-10 Dmitry Stogov [EMAIL PROTECTED] * zend_object_handlers.c: @@ -15758,7 +15764,7 @@ 2003-06-10 Jani Taskinen [EMAIL PROTECTED] * zend_multiply.h: - - Missing $Id: ChangeLog,v 1.1018 2006/11/11 01:31:31 changelog Exp $ tag + - Missing $Id: ChangeLog,v 1.1019 2006/11/14 01:31:25 changelog Exp $ tag 2003-06-10 James Cox [EMAIL PROTECTED] @@ -17482,7 +17488,7 @@ zend_types.h zend_variables.c zend_variables.h: - - Added some missing CVS $Id: ChangeLog,v 1.1018 2006/11/11 01:31:31 changelog Exp $ tags, headers and footers. + - Added some missing CVS $Id: ChangeLog,v 1.1019 2006/11/14 01:31:25 changelog Exp $ tags, headers and footers. 2003-01-30 Ilia Alshanetsky [EMAIL PROTECTED]
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/mysqli/tests bug37090.phpt
tony2001Mon Nov 13 12:47:43 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/mysqli/tests bug37090.phpt Log: fix test http://cvs.php.net/viewvc.cgi/php-src/ext/mysqli/tests/bug37090.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u Index: php-src/ext/mysqli/tests/bug37090.phpt diff -u php-src/ext/mysqli/tests/bug37090.phpt:1.1.2.1 php-src/ext/mysqli/tests/bug37090.phpt:1.1.2.2 --- php-src/ext/mysqli/tests/bug37090.phpt:1.1.2.1 Sun Jul 30 11:03:30 2006 +++ php-src/ext/mysqli/tests/bug37090.phpt Mon Nov 13 12:47:43 2006 @@ -1,7 +1,11 @@ --TEST-- bug #37090: mysqli_set_charset return code --SKIPIF-- -?php require_once('skipif.inc'); ? +?php require_once('skipif.inc'); +if (!function_exists('mysqli_set_charset')) { + die('skip mysqli_set_charset() not available'); +} +? --FILE-- ?php include connect.inc; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/xmlrpc xmlrpc-epi-php.c
tony2001Mon Nov 13 12:49:18 2006 UTC Modified files: /php-src/ext/xmlrpc xmlrpc-epi-php.c Log: fix compile warning http://cvs.php.net/viewvc.cgi/php-src/ext/xmlrpc/xmlrpc-epi-php.c?r1=1.46r2=1.47diff_format=u Index: php-src/ext/xmlrpc/xmlrpc-epi-php.c diff -u php-src/ext/xmlrpc/xmlrpc-epi-php.c:1.46 php-src/ext/xmlrpc/xmlrpc-epi-php.c:1.47 --- php-src/ext/xmlrpc/xmlrpc-epi-php.c:1.46Mon Aug 14 08:15:44 2006 +++ php-src/ext/xmlrpc/xmlrpc-epi-php.c Mon Nov 13 12:49:18 2006 @@ -51,7 +51,7 @@ +--+ */ -/* $Id: xmlrpc-epi-php.c,v 1.46 2006/08/14 08:15:44 tony2001 Exp $ */ +/* $Id: xmlrpc-epi-php.c,v 1.47 2006/11/13 12:49:18 tony2001 Exp $ */ /** * BUGS: * @@ -688,7 +688,7 @@ } if (out.xmlrpc_out.xml_elem_opts.encoding != ENCODING_DEFAULT) { - efree(out.xmlrpc_out.xml_elem_opts.encoding); + efree((char *)out.xmlrpc_out.xml_elem_opts.encoding); } } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/xmlrpc xmlrpc-epi-php.c
tony2001Mon Nov 13 12:49:29 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/xmlrpc xmlrpc-epi-php.c Log: MFH: fix compile warning http://cvs.php.net/viewvc.cgi/php-src/ext/xmlrpc/xmlrpc-epi-php.c?r1=1.39.2.5.2.2r2=1.39.2.5.2.3diff_format=u Index: php-src/ext/xmlrpc/xmlrpc-epi-php.c diff -u php-src/ext/xmlrpc/xmlrpc-epi-php.c:1.39.2.5.2.2 php-src/ext/xmlrpc/xmlrpc-epi-php.c:1.39.2.5.2.3 --- php-src/ext/xmlrpc/xmlrpc-epi-php.c:1.39.2.5.2.2Mon Aug 14 08:18:01 2006 +++ php-src/ext/xmlrpc/xmlrpc-epi-php.c Mon Nov 13 12:49:28 2006 @@ -51,7 +51,7 @@ +--+ */ -/* $Id: xmlrpc-epi-php.c,v 1.39.2.5.2.2 2006/08/14 08:18:01 tony2001 Exp $ */ +/* $Id: xmlrpc-epi-php.c,v 1.39.2.5.2.3 2006/11/13 12:49:28 tony2001 Exp $ */ /** * BUGS: * @@ -689,7 +689,7 @@ } if (out.xmlrpc_out.xml_elem_opts.encoding != ENCODING_DEFAULT) { - efree(out.xmlrpc_out.xml_elem_opts.encoding); + efree((char *)out.xmlrpc_out.xml_elem_opts.encoding); } } /* }}} */ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/dom/tests bug38474.phpt
tony2001Mon Nov 13 12:54:04 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/dom/tests bug38474.phpt Log: add a note that libxml2 2.6.2x is required http://cvs.php.net/viewvc.cgi/php-src/ext/dom/tests/bug38474.phpt?r1=1.1.2.1r2=1.1.2.2diff_format=u Index: php-src/ext/dom/tests/bug38474.phpt diff -u php-src/ext/dom/tests/bug38474.phpt:1.1.2.1 php-src/ext/dom/tests/bug38474.phpt:1.1.2.2 --- php-src/ext/dom/tests/bug38474.phpt:1.1.2.1 Mon Aug 28 23:36:23 2006 +++ php-src/ext/dom/tests/bug38474.phpt Mon Nov 13 12:54:04 2006 @@ -1,5 +1,5 @@ --TEST-- -Bug #38474 (getAttribute select attribute by order, even when prefixed) +Bug #38474 (getAttribute select attribute by order, even when prefixedi) (OK to fail with libxml2 2.6.2x) --SKIPIF-- ?php require_once('skipif.inc'); ? --FILE-- -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /main output.c php_output.h
mikeMon Nov 13 14:05:03 2006 UTC Modified files: /php-src/main output.c php_output.h Log: - fix buffer size alignment - avoid memory overflow #if MEMORY_LIMIT http://cvs.php.net/viewvc.cgi/php-src/main/output.c?r1=1.200r2=1.201diff_format=u Index: php-src/main/output.c diff -u php-src/main/output.c:1.200 php-src/main/output.c:1.201 --- php-src/main/output.c:1.200 Thu Oct 12 12:50:28 2006 +++ php-src/main/output.c Mon Nov 13 14:05:03 2006 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: output.c,v 1.200 2006/10/12 12:50:28 mike Exp $ */ +/* $Id: output.c,v 1.201 2006/11/13 14:05:03 mike Exp $ */ #ifndef PHP_OUTPUT_DEBUG # define PHP_OUTPUT_DEBUG 0 @@ -52,7 +52,13 @@ static inline int php_output_lock_error(int op TSRMLS_DC); static inline void php_output_op(int op, const char *str, size_t len TSRMLS_DC); -static inline php_output_handler *php_output_handler_init(zval *name, size_t chunk_size, int flags); +#if MEMORY_LIMIT +#define php_output_handler_init(n, cs, f) php_output_handler_init_ex((n), (cs), (f) TSRMLS_CC) +static inline php_output_handler *php_output_handler_init_ex(zval *name, size_t chunk_size, int flags TSRMLS_DC); +#else +#define php_output_handler_init php_output_handler_init_ex +static inline php_output_handler *php_output_handler_init_ex(zval *name, size_t chunk_size, int flags); +#endif static inline php_output_handler_status_t php_output_handler_op(php_output_handler *handler, php_output_context *context); static inline int php_output_handler_append(php_output_handler *handler, const php_output_buffer *buf TSRMLS_DC); static inline zval *php_output_handler_status(php_output_handler *handler, zval *entry); @@ -849,13 +855,28 @@ /* {{{ static php_output_handler *php_output_handler_init(zval *name, size_t chunk_size, int flags) Allocates and initializes a php_output_handler structure */ -static inline php_output_handler *php_output_handler_init(zval *name, size_t chunk_size, int flags) +#if MEMORY_LIMIT +static inline php_output_handler *php_output_handler_init_ex(zval *name, size_t chunk_size, int flags TSRMLS_DC) +#else +static inline php_output_handler *php_output_handler_init_ex(zval *name, size_t chunk_size, int flags) +#endif { php_output_handler *handler; - +#if MEMORY_LIMIT + size_t mem_limit; +#endif + handler = ecalloc(1, sizeof(php_output_handler)); ZVAL_ADDREF(name); handler-name = name; + +#if MEMORY_LIMIT + mem_limit = (PG(memory_limit) - zend_memory_usage(1 TSRMLS_CC)) / 2; + if (!chunk_size || chunk_size mem_limit) { + handler-size = mem_limit; + chunk_size = 0; + } else +#endif handler-size = chunk_size; handler-flags = flags; handler-buffer.size = PHP_OUTPUT_HANDLER_INITBUF_SIZE(chunk_size); @@ -874,14 +895,13 @@ /* store it away */ if ((handler-buffer.size - handler-buffer.used) = buf-used) { size_t grow_int = PHP_OUTPUT_HANDLER_INITBUF_SIZE(handler-size); - size_t grow_buf = PHP_OUTPUT_HANDLER_INITBUF_SIZE(buf-used + 1 - (handler-buffer.size - handler-buffer.used)); + size_t grow_buf = PHP_OUTPUT_HANDLER_INITBUF_SIZE(buf-used - (handler-buffer.size - handler-buffer.used)); size_t grow_max = MAX(grow_int, grow_buf); - + handler-buffer.data = erealloc(handler-buffer.data, handler-buffer.size += grow_max); } memcpy(handler-buffer.data + handler-buffer.used, buf-data, buf-used); handler-buffer.used += buf-used; - handler-buffer.data[handler-buffer.used] = '\0'; /* chunked buffering */ if (handler-size (handler-buffer.used = handler-size)) { @@ -898,6 +918,7 @@ static inline php_output_handler_status_t php_output_handler_op(php_output_handler *handler, php_output_context *context) { php_output_handler_status_t status; + int original_op = context-op; PHP_OUTPUT_TSRMLS(context); #if PHP_OUTPUT_DEBUG @@ -1017,6 +1038,7 @@ break; } + context-op = original_op; return status; } /* }}} */ @@ -1057,29 +1079,27 @@ context.out.used = len; } - if (context.out.data) { - if (context.out.used) { + if (context.out.data context.out.used) { #if PHP_OUTPUT_DEBUG - fprintf(stderr, ::: sapi_write('%s', %zu)\n, context.out.data, context.out.used); + fprintf(stderr, ::: sapi_write('%s', %zu)\n, context.out.data, context.out.used); #endif - if (!SG(headers_sent) php_header(TSRMLS_C)) { -
[PHP-CVS] cvs: php-src /tests/output ob_013.phpt ob_020.phpt
mikeMon Nov 13 14:05:49 2006 UTC Removed files: /php-src/tests/output ob_020.phpt Modified files: /php-src/tests/output ob_013.phpt Log: - fix tests http://cvs.php.net/viewvc.cgi/php-src/tests/output/ob_013.phpt?r1=1.2r2=1.3diff_format=u Index: php-src/tests/output/ob_013.phpt diff -u php-src/tests/output/ob_013.phpt:1.2 php-src/tests/output/ob_013.phpt:1.3 --- php-src/tests/output/ob_013.phpt:1.2Wed Aug 9 13:56:45 2006 +++ php-src/tests/output/ob_013.phptMon Nov 13 14:05:49 2006 @@ -25,7 +25,7 @@ print_r(ob_get_status(true)); ? ---EXPECT-- +--EXPECTF-- foo Array ( @@ -41,7 +41,7 @@ [type] = 1 [flags] = 4209 [level] = 4 -[chunk_size] = 0 +[chunk_size] = %d [buffer_size] = 16384 [buffer_used] = 96 ) @@ -53,7 +53,7 @@ [type] = 0 [flags] = 112 [level] = 0 -[chunk_size] = 0 +[chunk_size] = %d [buffer_size] = 16384 [buffer_used] = 0 ) @@ -64,7 +64,7 @@ [type] = 1 [flags] = 113 [level] = 1 -[chunk_size] = 0 +[chunk_size] = %d [buffer_size] = 16384 [buffer_used] = 0 ) @@ -75,7 +75,7 @@ [type] = 1 [flags] = 113 [level] = 2 -[chunk_size] = 0 +[chunk_size] = %d [buffer_size] = 16384 [buffer_used] = 0 ) @@ -86,7 +86,7 @@ [type] = 1 [flags] = 113 [level] = 3 -[chunk_size] = 0 +[chunk_size] = %d [buffer_size] = 16384 [buffer_used] = 4 ) @@ -97,9 +97,9 @@ [type] = 1 [flags] = 4209 [level] = 4 -[chunk_size] = 0 +[chunk_size] = %d [buffer_size] = 16384 -[buffer_used] = 248 +[buffer_used] = %d ) ) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/standard array.c
Matt, I did a cursory check through ext/ and this seems like the only place the optimization trick can be applied. I will look into writing a patch for HEAD when I have a bit more time. On 12-Nov-06, at 6:20 PM, Matt Wilmas wrote: Hi Ilia, Ah, I had wondered what other places could be changed to use the _quick functions (but didn't really check). :-) Anyway, will this be applied to HEAD also? Matt - Original Message - From: Ilia Alshanetsky Sent: Sunday, November 12, 2006 iliaa Sun Nov 12 17:13:23 2006 UTC Modified files: (Branch: PHP_5_2) /php-src NEWS /php-src/ext/standard array.c Log: Optimized array functions utilizing php_splice(). http://cvs.php.net/viewvc.cgi/php-src/NEWS? r1=1.2027.2.547.2.357r2=1.2027.2.547.2.358diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.357 php-src/NEWS: 1.2027.2.547.2.358 --- php-src/NEWS:1.2027.2.547.2.357 Sun Nov 12 01:14:39 2006 +++ php-src/NEWS Sun Nov 12 17:13:22 2006 @@ -15,6 +15,7 @@ - Streams optimization (Dmitry) . removed unnecessary ftell() calls (one call for each included PHP file) . disabled calls to read() after EOF +- Optimized array functions utilizing php_splice(). (Ilia) - VCWD_REALPATH() is improved to use realpath cache without VIRTUAL_DIR. (Dmitry) - ext/bcmath intialization code is moved from request startup to module http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c? r1=1.308.2.21.2.15r2=1.308.2.21.2.16diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.308.2.21.2.15 php-src/ext/standard/array.c:1.308.2.21.2.16 --- php-src/ext/standard/array.c:1.308.2.21.2.15 Sun Nov 12 01:14:39 2006 +++ php-src/ext/standard/array.c Sun Nov 12 17:13:22 2006 @@ -21,7 +21,7 @@ +- -+ */ -/* $Id: array.c,v 1.308.2.21.2.15 2006/11/12 01:14:39 bjori Exp $ */ +/* $Id: array.c,v 1.308.2.21.2.16 2006/11/12 17:13:22 iliaa Exp $ */ #include php.h #include php_ini.h @@ -1874,7 +1874,7 @@ /* Update output hash depending on key type */ if (p-nKeyLength) - zend_hash_update(out_hash, p-arKey, p-nKeyLength, entry, sizeof(zval *), NULL); + zend_hash_quick_update(out_hash, p-arKey, p-nKeyLength, p-h, entry, sizeof(zval *), NULL); else zend_hash_next_index_insert(out_hash, entry, sizeof(zval *), NULL); } @@ -1885,7 +1885,7 @@ entry = *((zval **)p-pData); entry-refcount++; if (p-nKeyLength) - zend_hash_update(*removed, p-arKey, p-nKeyLength, entry, sizeof(zval *), NULL); + zend_hash_quick_update(*removed, p-arKey, p-nKeyLength, p-h, entry, sizeof(zval *), NULL); else zend_hash_next_index_insert(*removed, entry, sizeof(zval *), NULL); } @@ -1897,17 +1897,7 @@ /* ..for each one, create a new zval, copy entry into it and copy it into the output hash */ for (i=0; ilist_count; i++) { entry = *list[i]; - if (entry-refcount=1000) { - zval *tmp = (zval *) emalloc(sizeof(zval)); - - *tmp = *entry; - zval_copy_ctor(tmp); - tmp-refcount = 1; - tmp-is_ref = 0; - entry = tmp; - } else { - entry-refcount++; - } + entry-refcount++; zend_hash_next_index_insert(out_hash, entry, sizeof(zval *), NULL); } } @@ -1917,7 +1907,7 @@ entry = *((zval **)p-pData); entry-refcount++; if (p-nKeyLength) - zend_hash_update(out_hash, p-arKey, p-nKeyLength, entry, sizeof(zval *), NULL); + zend_hash_quick_update(out_hash, p-arKey, p-nKeyLength, p-h, entry, sizeof(zval *), NULL); else zend_hash_next_index_insert(out_hash, entry, sizeof(zval *), NULL); } @@ -2212,7 +2202,7 @@ /* Get the arguments and do error-checking */ argc = ZEND_NUM_ARGS(); if (argc 2 || argc 4 || zend_get_parameters_ex(argc, input, offset, length, z_preserve_keys)) { - WRONG_PARAM_COUNT; + WRONG_PARA¬M_COUNT; } if (Z_TYPE_PP(input) != IS_ARRAY) { Ilia Alshanetsky -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/filter/tests 039.phpt
tony2001Mon Nov 13 14:50:55 2006 UTC Added files: /php-src/ext/filter/tests 039.phpt Log: new test http://cvs.php.net/viewvc.cgi/php-src/ext/filter/tests/039.phpt?view=markuprev=1.1 Index: php-src/ext/filter/tests/039.phpt +++ php-src/ext/filter/tests/039.phpt --TEST-- filter_var_array() and different arguments --SKIPIF-- ?php if (!extension_loaded(filter)) print skip; ? --FILE-- ?php var_dump(filter_var_array(NULL)); var_dump(filter_var_array(array())); var_dump(filter_var_array(array(1,blah=hoho))); var_dump(filter_var_array(array(), -1)); var_dump(filter_var_array(array(), 100)); var_dump(filter_var_array(array(), )); var_dump(filter_var_array(array(=), -1)); var_dump(filter_var_array(array(=), 100)); var_dump(filter_var_array(array(=), )); var_dump(filter_var_array(array(aaa=bbb), -1)); var_dump(filter_var_array(array(aaa=bbb), 100)); var_dump(filter_var_array(array(aaa=bbb), )); var_dump(filter_var_array(array(), new stdclass)); var_dump(filter_var_array(array(), array())); var_dump(filter_var_array(array(), array(var_name=1))); var_dump(filter_var_array(array(), array(var_name=-1))); var_dump(filter_var_array(array(var_name=), array(var_name=-1))); var_dump(filter_var_array(array(var_name=), array(var_name=-1, asdas=asdasd, qwe=rty, =))); var_dump(filter_var_array(array(asdas=text), array(var_name=-1, asdas=asdasd, qwe=rty, =))); echo Done\n; ? --EXPECTF-- Warning: filter_var_array() expects parameter 1 to be array, null given in %s on line %d NULL array(0) { } array(2) { [0]= string(1) 1 [blah]= string(4) hoho } array(0) { } array(0) { } bool(false) array(1) { []= string(0) } array(1) { []= string(0) } bool(false) array(1) { [aaa]= string(3) bbb } array(1) { [aaa]= string(3) bbb } bool(false) bool(false) array(0) { } array(1) { [var_name]= NULL } array(1) { [var_name]= NULL } array(1) { [var_name]= string(0) } array(4) { [var_name]= string(0) [asdas]= NULL [qwe]= NULL []= NULL } array(4) { [var_name]= NULL [asdas]= string(4) text [qwe]= NULL []= NULL } Done -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/filter/tests 039.phpt
tony2001Mon Nov 13 14:51:11 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/filter/tests 039.phpt Log: new test http://cvs.php.net/viewvc.cgi/php-src/ext/filter/tests/039.phpt?view=markuprev=1.1 Index: php-src/ext/filter/tests/039.phpt +++ php-src/ext/filter/tests/039.phpt --TEST-- filter_var_array() and different arguments --SKIPIF-- ?php if (!extension_loaded(filter)) print skip; ? --FILE-- ?php var_dump(filter_var_array(NULL)); var_dump(filter_var_array(array())); var_dump(filter_var_array(array(1,blah=hoho))); var_dump(filter_var_array(array(), -1)); var_dump(filter_var_array(array(), 100)); var_dump(filter_var_array(array(), )); var_dump(filter_var_array(array(=), -1)); var_dump(filter_var_array(array(=), 100)); var_dump(filter_var_array(array(=), )); var_dump(filter_var_array(array(aaa=bbb), -1)); var_dump(filter_var_array(array(aaa=bbb), 100)); var_dump(filter_var_array(array(aaa=bbb), )); var_dump(filter_var_array(array(), new stdclass)); var_dump(filter_var_array(array(), array())); var_dump(filter_var_array(array(), array(var_name=1))); var_dump(filter_var_array(array(), array(var_name=-1))); var_dump(filter_var_array(array(var_name=), array(var_name=-1))); var_dump(filter_var_array(array(var_name=), array(var_name=-1, asdas=asdasd, qwe=rty, =))); var_dump(filter_var_array(array(asdas=text), array(var_name=-1, asdas=asdasd, qwe=rty, =))); echo Done\n; ? --EXPECTF-- Warning: filter_var_array() expects parameter 1 to be array, null given in %s on line %d NULL array(0) { } array(2) { [0]= string(1) 1 [blah]= string(4) hoho } array(0) { } array(0) { } bool(false) array(1) { []= string(0) } array(1) { []= string(0) } bool(false) array(1) { [aaa]= string(3) bbb } array(1) { [aaa]= string(3) bbb } bool(false) bool(false) array(0) { } array(1) { [var_name]= NULL } array(1) { [var_name]= NULL } array(1) { [var_name]= string(0) } array(4) { [var_name]= string(0) [asdas]= NULL [qwe]= NULL []= NULL } array(4) { [var_name]= NULL [asdas]= string(4) text [qwe]= NULL []= NULL } Done -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/filter filter.c
tony2001Mon Nov 13 14:59:47 2006 UTC Modified files: /php-src/ext/filter filter.c Log: actually copy input to return_value input is a local var, you can't use it this way http://cvs.php.net/viewvc.cgi/php-src/ext/filter/filter.c?r1=1.75r2=1.76diff_format=u Index: php-src/ext/filter/filter.c diff -u php-src/ext/filter/filter.c:1.75 php-src/ext/filter/filter.c:1.76 --- php-src/ext/filter/filter.c:1.75Fri Nov 10 01:08:52 2006 +++ php-src/ext/filter/filter.c Mon Nov 13 14:59:47 2006 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: filter.c,v 1.75 2006/11/10 01:08:52 iliaa Exp $ */ +/* $Id: filter.c,v 1.76 2006/11/13 14:59:47 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -274,7 +274,7 @@ { php_info_print_table_start(); php_info_print_table_row( 2, Input Validation and Filtering, enabled ); - php_info_print_table_row( 2, Revision, $Revision: 1.75 $); + php_info_print_table_row( 2, Revision, $Revision: 1.76 $); php_info_print_table_end(); DISPLAY_INI_ENTRIES(); @@ -617,10 +617,12 @@ if (!op) { SEPARATE_ZVAL(input); *return_value = *input; + zval_copy_ctor(return_value); php_filter_call(return_value, FILTER_DEFAULT, NULL, 0, FILTER_REQUIRE_ARRAY TSRMLS_CC); } else if (Z_TYPE_PP(op) == IS_LONG) { SEPARATE_ZVAL(input); *return_value = *input; + zval_copy_ctor(return_value); php_filter_call(return_value, Z_LVAL_PP(op), NULL, 0, FILTER_REQUIRE_ARRAY TSRMLS_CC); } else if (Z_TYPE_PP(op) == IS_ARRAY) { array_init(return_value); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/filter filter.c
tony2001Mon Nov 13 15:00:05 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/filter filter.c Log: MFH http://cvs.php.net/viewvc.cgi/php-src/ext/filter/filter.c?r1=1.52.2.26r2=1.52.2.27diff_format=u Index: php-src/ext/filter/filter.c diff -u php-src/ext/filter/filter.c:1.52.2.26 php-src/ext/filter/filter.c:1.52.2.27 --- php-src/ext/filter/filter.c:1.52.2.26 Fri Nov 10 01:08:17 2006 +++ php-src/ext/filter/filter.c Mon Nov 13 15:00:05 2006 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: filter.c,v 1.52.2.26 2006/11/10 01:08:17 iliaa Exp $ */ +/* $Id: filter.c,v 1.52.2.27 2006/11/13 15:00:05 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -275,7 +275,7 @@ { php_info_print_table_start(); php_info_print_table_header( 2, Input Validation and Filtering, enabled ); - php_info_print_table_row( 2, Revision, $Revision: 1.52.2.26 $); + php_info_print_table_row( 2, Revision, $Revision: 1.52.2.27 $); php_info_print_table_end(); DISPLAY_INI_ENTRIES(); @@ -609,10 +609,12 @@ if (!op) { SEPARATE_ZVAL(input); *return_value = *input; + zval_copy_ctor(return_value); php_filter_call(return_value, FILTER_DEFAULT, NULL, 0, FILTER_REQUIRE_ARRAY TSRMLS_CC); } else if (Z_TYPE_PP(op) == IS_LONG) { SEPARATE_ZVAL(input); *return_value = *input; + zval_copy_ctor(return_value); php_filter_call(return_value, Z_LVAL_PP(op), NULL, 0, FILTER_REQUIRE_ARRAY TSRMLS_CC); } else if (Z_TYPE_PP(op) == IS_ARRAY) { array_init(return_value); -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: CVSROOT / avail
wez Mon Nov 13 15:15:21 2006 UTC Modified files: /CVSROOTavail Log: doc karma for Dave Renshaw http://cvs.php.net/viewvc.cgi/CVSROOT/avail?r1=1.1209r2=1.1210diff_format=u Index: CVSROOT/avail diff -u CVSROOT/avail:1.1209 CVSROOT/avail:1.1210 --- CVSROOT/avail:1.1209Fri Nov 10 18:40:46 2006 +++ CVSROOT/avail Mon Nov 13 15:15:21 2006 @@ -378,7 +378,7 @@ avail|gcc,cem,mfp,ansriniv,slaws|pecl/sdo avail|dbs,kraman,kfbombar|pecl/pdo_ids,pecl/pdo_informix,pecl/pdo_ibm avail|ifeghali|pear/MDB2_Schema -avail|dsr|pecl/sam +avail|dsr|pecl/sam,phpdoc # preprocessor karma avail|merlin|pecl/preprocessor -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/standard array.c
Hi Ilia, Oh, sorry, didn't know it was a time issue. :-) I thought both branches were mostly always updated together to keep things synced, etc. In that case, if it saves you any time, I've attached the patch for HEAD. - Original Message - From: Ilia Alshanetsky Sent: Monday, November 13, 2006 Matt, I did a cursory check through ext/ and this seems like the only place the optimization trick can be applied. I will look into writing a patch for HEAD when I have a bit more time. On 12-Nov-06, at 6:20 PM, Matt Wilmas wrote: Hi Ilia, Ah, I had wondered what other places could be changed to use the _quick functions (but didn't really check). :-) Anyway, will this be applied to HEAD also? Matt - Original Message - From: Ilia Alshanetsky Sent: Sunday, November 12, 2006 iliaa Sun Nov 12 17:13:23 2006 UTC Modified files: (Branch: PHP_5_2) /php-src NEWS /php-src/ext/standard array.c Log: Optimized array functions utilizing php_splice(). Index: ext/standard/array.c === RCS file: /repository/php-src/ext/standard/array.c,v retrieving revision 1.390 diff -u -r1.390 array.c --- ext/standard/array.c12 Nov 2006 01:11:58 - 1.390 +++ ext/standard/array.c13 Nov 2006 15:04:19 - @@ -1977,7 +1977,7 @@ if (p-nKeyLength == 0) { zend_hash_next_index_insert(out_hash, entry, sizeof(zval *), NULL); } else { - zend_u_hash_update(out_hash, p-key.type, ZSTR(p-key.arKey.s), p-nKeyLength, entry, sizeof(zval *), NULL); + zend_u_hash_quick_update(out_hash, p-key.type, ZSTR(p-key.arKey.s), p-nKeyLength, p-h, entry, sizeof(zval *), NULL); } } @@ -1989,7 +1989,7 @@ if (p-nKeyLength == 0) { zend_hash_next_index_insert(*removed, entry, sizeof(zval *), NULL); } else { - zend_u_hash_update(*removed, p-key.type, ZSTR(p-key.arKey.s), p-nKeyLength, entry, sizeof(zval *), NULL); + zend_u_hash_quick_update(*removed, p-key.type, ZSTR(p-key.arKey.s), p-nKeyLength, p-h, entry, sizeof(zval *), NULL); } } } else /* otherwise just skip those entries */ @@ -2000,17 +2000,7 @@ /* ..for each one, create a new zval, copy entry into it and copy it into the output hash */ for (i=0; ilist_count; i++) { entry = *list[i]; - if (entry-refcount=1000) { - zval *tmp = (zval *) emalloc(sizeof(zval)); - - *tmp = *entry; - zval_copy_ctor(tmp); - tmp-refcount = 1; - tmp-is_ref = 0; - entry = tmp; - } else { - entry-refcount++; - } + entry-refcount++; zend_hash_next_index_insert(out_hash, entry, sizeof(zval *), NULL); } } @@ -2022,7 +2012,7 @@ if (p-nKeyLength == 0) { zend_hash_next_index_insert(out_hash, entry, sizeof(zval *), NULL); } else { - zend_u_hash_update(out_hash, p-key.type, ZSTR(p-key.arKey.s), p-nKeyLength, entry, sizeof(zval *), NULL); + zend_u_hash_quick_update(out_hash, p-key.type, ZSTR(p-key.arKey.s), p-nKeyLength, p-h, entry, sizeof(zval *), NULL); } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/com_dotnet com_variant.c
iliaa Mon Nov 13 15:33:26 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/com_dotnet com_variant.c /php-srcNEWS Log: Fixed bug #36644 (possible crash in variant_date_from_timestamp()). http://cvs.php.net/viewvc.cgi/php-src/ext/com_dotnet/com_variant.c?r1=1.11.2.2r2=1.11.2.2.2.1diff_format=u Index: php-src/ext/com_dotnet/com_variant.c diff -u php-src/ext/com_dotnet/com_variant.c:1.11.2.2 php-src/ext/com_dotnet/com_variant.c:1.11.2.2.2.1 --- php-src/ext/com_dotnet/com_variant.c:1.11.2.2 Sat Feb 4 10:57:27 2006 +++ php-src/ext/com_dotnet/com_variant.cMon Nov 13 15:33:26 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: com_variant.c,v 1.11.2.2 2006/02/04 10:57:27 rrichards Exp $ */ +/* $Id: com_variant.c,v 1.11.2.2.2.1 2006/11/13 15:33:26 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -798,6 +798,11 @@ return; } + if (timestamp 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Timestamp value must be a positive value.); + RETURN_FALSE; + } + VariantInit(res); tzset(); tmv = localtime(timestamp); http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.358r2=1.2027.2.547.2.359diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.358 php-src/NEWS:1.2027.2.547.2.359 --- php-src/NEWS:1.2027.2.547.2.358 Sun Nov 12 17:13:22 2006 +++ php-src/NEWSMon Nov 13 15:33:26 2006 @@ -75,6 +75,7 @@ - Fixed bug #38456 (Apache2 segfaults when virtual() is called in .php ErrorDocument). (Ilia) - Fixed bug #36975 (natcasesort() causes array_pop() to misbehave). (Hannes) +- Fixed bug #36644 (possible crash in variant_date_from_timestamp()). (Ilia) - Fixed bug #33282 (Re-assignment by reference does not clear the is_ref flag) (Ilia,Dmitry, Matt Wilmas) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/com_dotnet com_variant.c
iliaa Mon Nov 13 15:33:40 2006 UTC Modified files: /php-src/ext/com_dotnet com_variant.c Log: MFB: Fixed bug #36644 (possible crash in variant_date_from_timestamp()). http://cvs.php.net/viewvc.cgi/php-src/ext/com_dotnet/com_variant.c?r1=1.16r2=1.17diff_format=u Index: php-src/ext/com_dotnet/com_variant.c diff -u php-src/ext/com_dotnet/com_variant.c:1.16 php-src/ext/com_dotnet/com_variant.c:1.17 --- php-src/ext/com_dotnet/com_variant.c:1.16 Sat Feb 4 10:59:18 2006 +++ php-src/ext/com_dotnet/com_variant.cMon Nov 13 15:33:40 2006 @@ -16,7 +16,7 @@ +--+ */ -/* $Id: com_variant.c,v 1.16 2006/02/04 10:59:18 rrichards Exp $ */ +/* $Id: com_variant.c,v 1.17 2006/11/13 15:33:40 iliaa Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -806,6 +806,11 @@ return; } + if (timestamp 0) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, Timestamp value must be a positive value.); + RETURN_FALSE; + } + VariantInit(res); tzset(); ttstamp = timestamp; -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard array.c
iliaa Mon Nov 13 15:34:49 2006 UTC Modified files: /php-src/ext/standard array.c Log: MFB: php_splice() optimization http://cvs.php.net/viewvc.cgi/php-src/ext/standard/array.c?r1=1.390r2=1.391diff_format=u Index: php-src/ext/standard/array.c diff -u php-src/ext/standard/array.c:1.390 php-src/ext/standard/array.c:1.391 --- php-src/ext/standard/array.c:1.390 Sun Nov 12 01:11:58 2006 +++ php-src/ext/standard/array.cMon Nov 13 15:34:49 2006 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: array.c,v 1.390 2006/11/12 01:11:58 bjori Exp $ */ +/* $Id: array.c,v 1.391 2006/11/13 15:34:49 iliaa Exp $ */ #include php.h #include php_ini.h @@ -1977,7 +1977,7 @@ if (p-nKeyLength == 0) { zend_hash_next_index_insert(out_hash, entry, sizeof(zval *), NULL); } else { - zend_u_hash_update(out_hash, p-key.type, ZSTR(p-key.arKey.s), p-nKeyLength, entry, sizeof(zval *), NULL); + zend_u_hash_quick_update(out_hash, p-key.type, ZSTR(p-key.arKey.s), p-nKeyLength, p-h, entry, sizeof(zval *), NULL); } } @@ -1989,7 +1989,7 @@ if (p-nKeyLength == 0) { zend_hash_next_index_insert(*removed, entry, sizeof(zval *), NULL); } else { - zend_u_hash_update(*removed, p-key.type, ZSTR(p-key.arKey.s), p-nKeyLength, entry, sizeof(zval *), NULL); + zend_u_hash_quick_update(*removed, p-key.type, ZSTR(p-key.arKey.s), p-nKeyLength, p-h, entry, sizeof(zval *), NULL); } } } else /* otherwise just skip those entries */ @@ -2000,17 +2000,7 @@ /* ..for each one, create a new zval, copy entry into it and copy it into the output hash */ for (i=0; ilist_count; i++) { entry = *list[i]; - if (entry-refcount=1000) { - zval *tmp = (zval *) emalloc(sizeof(zval)); - - *tmp = *entry; - zval_copy_ctor(tmp); - tmp-refcount = 1; - tmp-is_ref = 0; - entry = tmp; - } else { - entry-refcount++; - } + entry-refcount++; zend_hash_next_index_insert(out_hash, entry, sizeof(zval *), NULL); } } @@ -2022,7 +2012,7 @@ if (p-nKeyLength == 0) { zend_hash_next_index_insert(out_hash, entry, sizeof(zval *), NULL); } else { - zend_u_hash_update(out_hash, p-key.type, ZSTR(p-key.arKey.s), p-nKeyLength, entry, sizeof(zval *), NULL); + zend_u_hash_quick_update(out_hash, p-key.type, ZSTR(p-key.arKey.s), p-nKeyLength, p-h, entry, sizeof(zval *), NULL); } } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / README.UPDATE_5_2
bjori Mon Nov 13 18:30:59 2006 UTC Modified files: (Branch: PHP_5_2) /php-srcREADME.UPDATE_5_2 Log: It's called addEmptyDir(), not createEmptyDir() http://cvs.php.net/viewvc.cgi/php-src/README.UPDATE_5_2?r1=1.1.2.35r2=1.1.2.36diff_format=u Index: php-src/README.UPDATE_5_2 diff -u php-src/README.UPDATE_5_2:1.1.2.35 php-src/README.UPDATE_5_2:1.1.2.36 --- php-src/README.UPDATE_5_2:1.1.2.35 Sun Nov 12 17:16:13 2006 +++ php-src/README.UPDATE_5_2 Mon Nov 13 18:30:59 2006 @@ -749,7 +749,7 @@ In ext/zip == ZipArchive: - bool createEmptyDir(string dirname) + bool addEmptyDir(string dirname) Creates an empty directory in the archive As of 5.2.1 #See http://cvs.php.net/viewvc.cgi/php-src/ext/zip/php_zip.c?r1=1.1.2.15r2=1.1.2.16 -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/standard file.c /ext/standard/tests/strings get_meta_tags.phpt
tony2001Mon Nov 13 20:17:06 2006 UTC Added files: /php-src/ext/standard/tests/strings get_meta_tags.phpt Modified files: /php-src/ext/standard file.c Log: fix leaks in get_meta_tags() when used with b0rked HTML add test http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.465r2=1.466diff_format=u Index: php-src/ext/standard/file.c diff -u php-src/ext/standard/file.c:1.465 php-src/ext/standard/file.c:1.466 --- php-src/ext/standard/file.c:1.465 Wed Oct 25 17:28:20 2006 +++ php-src/ext/standard/file.c Mon Nov 13 20:17:05 2006 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: file.c,v 1.465 2006/10/25 17:28:20 andrei Exp $ */ +/* $Id: file.c,v 1.466 2006/11/13 20:17:05 tony2001 Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -425,6 +425,7 @@ } } else if (tok_last == TOK_EQUAL looking_for_val) { if (saw_name) { + STR_FREE(name); /* Get the NAME attr (Single word attr, non-quoted) */ temp = name = estrndup(md.token_data, md.token_len); @@ -437,6 +438,7 @@ have_name = 1; } else if (saw_content) { + STR_FREE(value); /* Get the CONTENT attr (Single word attr, non-quoted) */ value = estrndup(md.token_data, md.token_len); @@ -459,6 +461,7 @@ } } else if (tok == TOK_STRING tok_last == TOK_EQUAL looking_for_val) { if (saw_name) { + STR_FREE(name); /* Get the NAME attr (Quoted single/double) */ temp = name = estrndup(md.token_data, md.token_len); @@ -471,6 +474,7 @@ have_name = 1; } else if (saw_content) { + STR_FREE(value); /* Get the CONTENT attr (Single word attr, non-quoted) */ value = estrndup(md.token_data, md.token_len); @@ -490,12 +494,13 @@ /* For BC */ php_strtolower(name, strlen(name)); if (have_content) { - add_assoc_utf8_string(return_value, name, value, 0); + add_assoc_utf8_string(return_value, name, value, 1); } else { add_assoc_utf8_string(return_value, name, , 1); } efree(name); + efree(value); } else if (have_content) { efree(value); } @@ -517,6 +522,8 @@ md.token_data = NULL; } + STR_FREE(value); + STR_FREE(name); php_stream_close(md.stream); } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/get_meta_tags.phpt?view=markuprev=1.1 Index: php-src/ext/standard/tests/strings/get_meta_tags.phpt +++ php-src/ext/standard/tests/strings/get_meta_tags.phpt --TEST-- get_meta_tags() tests --FILE-- ?php $filename = dirname(__FILE__)./get_meta_tags.html; $data = DATA meta name=author content=name meta name=keywords content=php documentation meta name=DESCRIPTION content=a php manual meta name=geo.position content=49.33;-86.59 /head !-- parsing stops here -- DATA; $data1 = DATA html head meta name=author content=name meta name=keywords content=php documentation meta name=DESCRIPTION content=a php manual meta name=geo.position content=49.33;-86.59 /head body meta name=author content=name1 meta name=keywords content=php documentation1 meta name=DESCRIPTION content=a php manual1 meta name=geo.position content=49.33;-86.591 /body /html DATA; $data2 = DATA meta name=author content=name meta name=keywords content=php documentation DATA; $data3 = DATA meta meta name=keywords content=php documentation DATA; $data4 = DATA meta name=author content=name meta name=keywords content=php documentation DATA; $array = array($data, $data1, $data2, $data3, $data4, , , meta); foreach ($array as $html) { file_put_contents($filename, $html); var_dump(get_meta_tags($filename)); } @unlink($filename); echo Done\n; ? --EXPECTF-- array(4) { [author]= string(4) name [keywords]= string(17) php documentation [description]= string(12) a php manual
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard file.c /ext/standard/tests/strings get_meta_tags.phpt
tony2001Mon Nov 13 20:18:12 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/standard/tests/strings get_meta_tags.phpt Modified files: /php-src/ext/standard file.c Log: MFH: fix leaks in get_meta_tags() when used with b0rked HTML add test http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.409.2.6.2.7r2=1.409.2.6.2.8diff_format=u Index: php-src/ext/standard/file.c diff -u php-src/ext/standard/file.c:1.409.2.6.2.7 php-src/ext/standard/file.c:1.409.2.6.2.8 --- php-src/ext/standard/file.c:1.409.2.6.2.7 Fri Oct 13 01:42:19 2006 +++ php-src/ext/standard/file.c Mon Nov 13 20:18:12 2006 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: file.c,v 1.409.2.6.2.7 2006/10/13 01:42:19 iliaa Exp $ */ +/* $Id: file.c,v 1.409.2.6.2.8 2006/11/13 20:18:12 tony2001 Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -399,6 +399,7 @@ } } else if (tok_last == TOK_EQUAL looking_for_val) { if (saw_name) { + STR_FREE(name); /* Get the NAME attr (Single word attr, non-quoted) */ temp = name = estrndup(md.token_data, md.token_len); @@ -411,6 +412,7 @@ have_name = 1; } else if (saw_content) { + STR_FREE(value); /* Get the CONTENT attr (Single word attr, non-quoted) */ if (PG(magic_quotes_runtime)) { value = php_addslashes(md.token_data, 0, md.token_len, 0 TSRMLS_CC); @@ -437,6 +439,7 @@ } } else if (tok == TOK_STRING tok_last == TOK_EQUAL looking_for_val) { if (saw_name) { + STR_FREE(name); /* Get the NAME attr (Quoted single/double) */ temp = name = estrndup(md.token_data, md.token_len); @@ -449,6 +452,7 @@ have_name = 1; } else if (saw_content) { + STR_FREE(value); /* Get the CONTENT attr (Single word attr, non-quoted) */ if (PG(magic_quotes_runtime)) { value = php_addslashes(md.token_data, 0, md.token_len, 0 TSRMLS_CC); @@ -472,12 +476,13 @@ /* For BC */ php_strtolower(name, strlen(name)); if (have_content) { - add_assoc_string(return_value, name, value, 0); + add_assoc_string(return_value, name, value, 1); } else { add_assoc_string(return_value, name, , 1); } efree(name); + efree(value); } else if (have_content) { efree(value); } @@ -499,6 +504,8 @@ md.token_data = NULL; } + STR_FREE(value); + STR_FREE(name); php_stream_close(md.stream); } http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/strings/get_meta_tags.phpt?view=markuprev=1.1 Index: php-src/ext/standard/tests/strings/get_meta_tags.phpt +++ php-src/ext/standard/tests/strings/get_meta_tags.phpt --TEST-- get_meta_tags() tests --FILE-- ?php $filename = dirname(__FILE__)./get_meta_tags.html; $data = DATA meta name=author content=name meta name=keywords content=php documentation meta name=DESCRIPTION content=a php manual meta name=geo.position content=49.33;-86.59 /head !-- parsing stops here -- DATA; $data1 = DATA html head meta name=author content=name meta name=keywords content=php documentation meta name=DESCRIPTION content=a php manual meta name=geo.position content=49.33;-86.59 /head body meta name=author content=name1 meta name=keywords content=php documentation1 meta name=DESCRIPTION content=a php manual1 meta name=geo.position content=49.33;-86.591 /body /html DATA; $data2 = DATA meta name=author content=name meta name=keywords content=php documentation DATA; $data3 = DATA meta meta name=keywords content=php documentation DATA; $data4 = DATA meta name=author content=name meta name=keywords content=php documentation DATA; $array = array($data, $data1, $data2, $data3, $data4, , , meta); foreach ($array as $html) {
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard file.c
tony2001Mon Nov 13 20:31:27 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/standard file.c Log: don't forget to close the stream when/if flock() fails http://cvs.php.net/viewvc.cgi/php-src/ext/standard/file.c?r1=1.409.2.6.2.8r2=1.409.2.6.2.9diff_format=u Index: php-src/ext/standard/file.c diff -u php-src/ext/standard/file.c:1.409.2.6.2.8 php-src/ext/standard/file.c:1.409.2.6.2.9 --- php-src/ext/standard/file.c:1.409.2.6.2.8 Mon Nov 13 20:18:12 2006 +++ php-src/ext/standard/file.c Mon Nov 13 20:31:27 2006 @@ -21,7 +21,7 @@ +--+ */ -/* $Id: file.c,v 1.409.2.6.2.8 2006/11/13 20:18:12 tony2001 Exp $ */ +/* $Id: file.c,v 1.409.2.6.2.9 2006/11/13 20:31:27 tony2001 Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -598,6 +598,7 @@ } if (flags LOCK_EX php_stream_lock(stream, LOCK_EX)) { + php_stream_close(stream); RETURN_FALSE; } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/xmlwriter php_xmlwriter.c /ext/xmlwriter/tests bug39504.phpt
rrichards Mon Nov 13 20:47:52 2006 UTC Added files: /php-src/ext/xmlwriter/testsbug39504.phpt Modified files: /php-src/ext/xmlwriter php_xmlwriter.c Log: Fixed bug #39504 (xmlwriter_write_dtd_entity() creates Attlist tag, not enity). (Hannes Magnusson) add test http://cvs.php.net/viewvc.cgi/php-src/ext/xmlwriter/php_xmlwriter.c?r1=1.41r2=1.42diff_format=u Index: php-src/ext/xmlwriter/php_xmlwriter.c diff -u php-src/ext/xmlwriter/php_xmlwriter.c:1.41 php-src/ext/xmlwriter/php_xmlwriter.c:1.42 --- php-src/ext/xmlwriter/php_xmlwriter.c:1.41 Thu Nov 9 20:02:23 2006 +++ php-src/ext/xmlwriter/php_xmlwriter.c Mon Nov 13 20:47:52 2006 @@ -17,7 +17,7 @@ +--+ */ -/* $Id: php_xmlwriter.c,v 1.41 2006/11/09 20:02:23 bjori Exp $ */ +/* $Id: php_xmlwriter.c,v 1.42 2006/11/13 20:47:52 rrichards Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -370,7 +370,7 @@ } /* }}} */ -/* {{{ xmlwriter_objects_clone */ +/* {{{ php_xmlwriter_streams_IO_close */ static int php_xmlwriter_streams_IO_close(void *context) { TSRMLS_FETCH(); @@ -1355,7 +1355,7 @@ } /* }}} */ -/* {{{ proto bool xmlwriter_write_dtd_entity(resource xmlwriter, string name, string content) U +/* {{{ proto bool xmlwriter_write_dtd_entity(resource xmlwriter, string name, string content [, int pe [, string pubid [, string sysid [, string ndataid) U Write full DTD Entity tag - returns FALSE on error */ static PHP_FUNCTION(xmlwriter_write_dtd_entity) { @@ -1364,22 +1364,29 @@ xmlTextWriterPtr ptr; char *name, *content; int name_len, content_len, retval; + /* Optional parameters */ + char *pubid = NULL, *sysid = NULL, *ndataid = NULL; + int pe = 0, pubid_len, sysid_len, ndataid_len; #ifdef ZEND_ENGINE_2 zval *this = getThis(); if (this) { if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ss, - name, name_len, UG(utf8_conv), content, content_len, UG(utf8_conv)) == FAILURE) { + name, name_len, UG(utf8_conv), content, content_len, UG(utf8_conv), + pe, UG(utf8_conv), pubid, pubid_len, UG(utf8_conv), sysid, sysid_len, UG(utf8_conv), + UG(utf8_conv), ndataid, ndataid_len) == FAILURE) { return; } XMLWRITER_FROM_OBJECT(intern, this); } else #endif { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rss, pind, - name, name_len, UG(utf8_conv), content, content_len, UG(utf8_conv)) == FAILURE) { - return; + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, rss|lsss, pind, + name, name_len, UG(utf8_conv), content, content_len, UG(utf8_conv), + pe, UG(utf8_conv), pubid, pubid_len, UG(utf8_conv), sysid, sysid_len, UG(utf8_conv), + UG(utf8_conv), ndataid, ndataid_len) == FAILURE) { + return; } ZEND_FETCH_RESOURCE(intern,xmlwriter_object *, pind, -1, XMLWriter, le_xmlwriter); } @@ -1389,7 +1396,7 @@ ptr = intern-ptr; if (ptr) { - retval = xmlTextWriterWriteDTDAttlist(ptr, (xmlChar *)name, (xmlChar *)content); + retval = xmlTextWriterWriteDTDEntity(ptr, pe, (xmlChar *)name, (xmlChar *)pubid, (xmlChar *)sysid, (xmlChar *)ndataid, (xmlChar *)content); if (retval != -1) { RETURN_TRUE; } http://cvs.php.net/viewvc.cgi/php-src/ext/xmlwriter/tests/bug39504.phpt?view=markuprev=1.1 Index: php-src/ext/xmlwriter/tests/bug39504.phpt +++ php-src/ext/xmlwriter/tests/bug39504.phpt --TEST-- bug# 39504 (xmlwriter_write_dtd_entity() creates Attlist tag, not enity) --FILE-- ?php $xw = xmlwriter_open_memory(); xmlwriter_start_document($xw, NULL, UTF-8); xmlwriter_start_dtd($xw, root); xmlwriter_write_dtd_entity($xw, ent2, val2); xmlwriter_end_dtd($xw); xmlwriter_start_element($xw, root); xmlwriter_end_document($xw); print xmlwriter_flush($xw, true); ? --EXPECTF-- ?xml version=1.0 encoding=UTF-8? !DOCTYPE root [!ENTITY ent2 val2]root/ -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src / NEWS
rrichards Mon Nov 13 20:48:18 2006 UTC Modified files: /php-srcNEWS Log: BFN http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2130r2=1.2131diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2130 php-src/NEWS:1.2131 --- php-src/NEWS:1.2130 Fri Oct 27 21:18:56 2006 +++ php-src/NEWSMon Nov 13 20:48:18 2006 @@ -59,5 +59,7 @@ . stream_resolve_include_path(). (Sara) - Added shm_has_var() function. (Mike) +- Fixed bug #39504 (xmlwriter_write_dtd_entity() creates Attlist tag, + not enity). (Hannes Magnusson) - Fixed bug #36630 (umask not reset at the end of the request). (Ilia) - Fixed bug #34286 (__toString() behavior is inconsistent). (Marcus) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard/tests/file fgetss.phpt
tony2001Mon Nov 13 21:27:48 2006 UTC Added files: (Branch: PHP_5_2) /php-src/ext/standard/tests/filefgetss.phpt Log: add new test http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/file/fgetss.phpt?view=markuprev=1.1 Index: php-src/ext/standard/tests/file/fgetss.phpt +++ php-src/ext/standard/tests/file/fgetss.phpt -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /ext/xmlwriter php_xmlwriter.c /ext/xmlwriter/tests bug39504.phpt
MFH to 5.2? On 13-Nov-06, at 3:47 PM, Rob Richards wrote: Fixed bug #39504 (xmlwriter_write_dtd_entity() creates Attlist tag, not enity). (Hannes Magnusson) add test Ilia Alshanetsky -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/pgsql pgsql.c
iliaa Mon Nov 13 22:10:40 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/pgsql pgsql.c /php-srcNEWS Log: Fixed bug #36812 (pg_execute() modifies input array). http://cvs.php.net/viewvc.cgi/php-src/ext/pgsql/pgsql.c?r1=1.331.2.13.2.9r2=1.331.2.13.2.10diff_format=u Index: php-src/ext/pgsql/pgsql.c diff -u php-src/ext/pgsql/pgsql.c:1.331.2.13.2.9 php-src/ext/pgsql/pgsql.c:1.331.2.13.2.10 --- php-src/ext/pgsql/pgsql.c:1.331.2.13.2.9Fri Oct 6 21:45:10 2006 +++ php-src/ext/pgsql/pgsql.c Mon Nov 13 22:10:36 2006 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: pgsql.c,v 1.331.2.13.2.9 2006/10/06 21:45:10 iliaa Exp $ */ +/* $Id: pgsql.c,v 1.331.2.13.2.10 2006/11/13 22:10:36 iliaa Exp $ */ #include stdlib.h @@ -1472,6 +1472,7 @@ php_error_docref(NULL TSRMLS_CC, E_NOTICE, Found results on this connection. Use pg_get_result() to get these results first); } + SEPARATE_ZVAL(pv_param_arr); zend_hash_internal_pointer_reset(Z_ARRVAL_PP(pv_param_arr)); num_params = zend_hash_num_elements(Z_ARRVAL_PP(pv_param_arr)); if (num_params 0) { @@ -1486,7 +1487,8 @@ } otype = (*tmp)-type; - convert_to_string(*tmp); + SEPARATE_ZVAL(tmp); + convert_to_string_ex(tmp); if (Z_TYPE_PP(tmp) != IS_STRING) { php_error_docref(NULL TSRMLS_CC, E_WARNING,Error converting parameter); _php_pgsql_free_params(params, num_params); @@ -1495,8 +1497,7 @@ if (otype == IS_NULL) { params[i] = NULL; - } - else { + } else { params[i] = Z_STRVAL_PP(tmp); } http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.359r2=1.2027.2.547.2.360diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.359 php-src/NEWS:1.2027.2.547.2.360 --- php-src/NEWS:1.2027.2.547.2.359 Mon Nov 13 15:33:26 2006 +++ php-src/NEWSMon Nov 13 22:10:37 2006 @@ -75,6 +75,7 @@ - Fixed bug #38456 (Apache2 segfaults when virtual() is called in .php ErrorDocument). (Ilia) - Fixed bug #36975 (natcasesort() causes array_pop() to misbehave). (Hannes) +- Fixed bug #36812 (pg_execute() modifies input array). (Ilia) - Fixed bug #36644 (possible crash in variant_date_from_timestamp()). (Ilia) - Fixed bug #33282 (Re-assignment by reference does not clear the is_ref flag) (Ilia,Dmitry, Matt Wilmas) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/pgsql pgsql.c
iliaa Mon Nov 13 22:11:02 2006 UTC Modified files: /php-src/ext/pgsql pgsql.c Log: MFB: Fixed bug #36812 (pg_execute() modifies input array). http://cvs.php.net/viewvc.cgi/php-src/ext/pgsql/pgsql.c?r1=1.358r2=1.359diff_format=u Index: php-src/ext/pgsql/pgsql.c diff -u php-src/ext/pgsql/pgsql.c:1.358 php-src/ext/pgsql/pgsql.c:1.359 --- php-src/ext/pgsql/pgsql.c:1.358 Fri Oct 6 21:45:35 2006 +++ php-src/ext/pgsql/pgsql.c Mon Nov 13 22:11:02 2006 @@ -20,7 +20,7 @@ +--+ */ -/* $Id: pgsql.c,v 1.358 2006/10/06 21:45:35 iliaa Exp $ */ +/* $Id: pgsql.c,v 1.359 2006/11/13 22:11:02 iliaa Exp $ */ #include stdlib.h @@ -1472,6 +1472,7 @@ php_error_docref(NULL TSRMLS_CC, E_NOTICE, Found results on this connection. Use pg_get_result() to get these results first); } + SEPARATE_ZVAL(pv_param_arr); zend_hash_internal_pointer_reset(Z_ARRVAL_PP(pv_param_arr)); num_params = zend_hash_num_elements(Z_ARRVAL_PP(pv_param_arr)); if (num_params 0) { @@ -1486,7 +1487,8 @@ } otype = (*tmp)-type; - convert_to_string(*tmp); + SEPARATE_ZVAL(tmp); + convert_to_string_ex(tmp); if (Z_TYPE_PP(tmp) != IS_STRING) { php_error_docref(NULL TSRMLS_CC, E_WARNING,Error converting parameter); _php_pgsql_free_params(params, num_params); @@ -1495,8 +1497,7 @@ if (otype == IS_NULL) { params[i] = NULL; - } - else { + } else { params[i] = Z_STRVAL_PP(tmp); } -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php-src /ext/xmlwriter php_xmlwriter.c /ext/xmlwriter/tests bug39504.phpt
Nope. The functionality isn't enabled in 5.2. Rob Ilia Alshanetsky wrote: MFH to 5.2? On 13-Nov-06, at 3:47 PM, Rob Richards wrote: Fixed bug #39504 (xmlwriter_write_dtd_entity() creates Attlist tag, not enity). (Hannes Magnusson) add test Ilia Alshanetsky -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src /ext/filter filter.c /ext/filter/tests 039.phpt
tony2001Mon Nov 13 19:32:43 2006 UTC Modified files: /php-src/ext/filter filter.c /php-src/ext/filter/tests 039.phpt Log: improve the fix and the test http://cvs.php.net/viewvc.cgi/php-src/ext/filter/filter.c?r1=1.76r2=1.77diff_format=u Index: php-src/ext/filter/filter.c diff -u php-src/ext/filter/filter.c:1.76 php-src/ext/filter/filter.c:1.77 --- php-src/ext/filter/filter.c:1.76Mon Nov 13 14:59:47 2006 +++ php-src/ext/filter/filter.c Mon Nov 13 19:32:43 2006 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: filter.c,v 1.76 2006/11/13 14:59:47 tony2001 Exp $ */ +/* $Id: filter.c,v 1.77 2006/11/13 19:32:43 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -274,7 +274,7 @@ { php_info_print_table_start(); php_info_print_table_row( 2, Input Validation and Filtering, enabled ); - php_info_print_table_row( 2, Revision, $Revision: 1.76 $); + php_info_print_table_row( 2, Revision, $Revision: 1.77 $); php_info_print_table_end(); DISPLAY_INI_ENTRIES(); @@ -615,14 +615,16 @@ zval **tmp, **arg_elm; if (!op) { - SEPARATE_ZVAL(input); + zval_dtor(return_value); *return_value = *input; zval_copy_ctor(return_value); + INIT_PZVAL(return_value); php_filter_call(return_value, FILTER_DEFAULT, NULL, 0, FILTER_REQUIRE_ARRAY TSRMLS_CC); } else if (Z_TYPE_PP(op) == IS_LONG) { - SEPARATE_ZVAL(input); + zval_dtor(return_value); *return_value = *input; zval_copy_ctor(return_value); + INIT_PZVAL(return_value); php_filter_call(return_value, Z_LVAL_PP(op), NULL, 0, FILTER_REQUIRE_ARRAY TSRMLS_CC); } else if (Z_TYPE_PP(op) == IS_ARRAY) { array_init(return_value); http://cvs.php.net/viewvc.cgi/php-src/ext/filter/tests/039.phpt?r1=1.1r2=1.2diff_format=u Index: php-src/ext/filter/tests/039.phpt diff -u php-src/ext/filter/tests/039.phpt:1.1 php-src/ext/filter/tests/039.phpt:1.2 --- php-src/ext/filter/tests/039.phpt:1.1 Mon Nov 13 14:50:55 2006 +++ php-src/ext/filter/tests/039.phpt Mon Nov 13 19:32:43 2006 @@ -28,6 +28,19 @@ var_dump(filter_var_array(array(var_name=), array(var_name=-1, asdas=asdasd, qwe=rty, =))); var_dump(filter_var_array(array(asdas=text), array(var_name=-1, asdas=asdasd, qwe=rty, =))); + +$a = array(=); $b = -1; +var_dump(filter_var_array($a, $b)); +var_dump($a, $b); + +$a = array(=); $b = 10; +var_dump(filter_var_array($a, $b)); +var_dump($a, $b); + +$a = array(=); $b = ; +var_dump(filter_var_array($a, $b)); +var_dump($a, $b); + echo Done\n; ? --EXPECTF-- @@ -99,4 +112,28 @@ []= NULL } +array(1) { + []= + string(0) +} +array(1) { + []= + string(0) +} +int(-1) +array(1) { + []= + string(0) +} +array(1) { + []= + string(0) +} +int(10) +bool(false) +array(1) { + []= + string(0) +} +string(0) Done -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-CVS] cvs: php-src(PHP_5_2) /ext/filter filter.c /ext/filter/tests 039.phpt
tony2001Mon Nov 13 19:32:58 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/filter filter.c /php-src/ext/filter/tests 039.phpt Log: MFH: improve the fix and the test http://cvs.php.net/viewvc.cgi/php-src/ext/filter/filter.c?r1=1.52.2.27r2=1.52.2.28diff_format=u Index: php-src/ext/filter/filter.c diff -u php-src/ext/filter/filter.c:1.52.2.27 php-src/ext/filter/filter.c:1.52.2.28 --- php-src/ext/filter/filter.c:1.52.2.27 Mon Nov 13 15:00:05 2006 +++ php-src/ext/filter/filter.c Mon Nov 13 19:32:58 2006 @@ -19,7 +19,7 @@ +--+ */ -/* $Id: filter.c,v 1.52.2.27 2006/11/13 15:00:05 tony2001 Exp $ */ +/* $Id: filter.c,v 1.52.2.28 2006/11/13 19:32:58 tony2001 Exp $ */ #ifdef HAVE_CONFIG_H #include config.h @@ -275,7 +275,7 @@ { php_info_print_table_start(); php_info_print_table_header( 2, Input Validation and Filtering, enabled ); - php_info_print_table_row( 2, Revision, $Revision: 1.52.2.27 $); + php_info_print_table_row( 2, Revision, $Revision: 1.52.2.28 $); php_info_print_table_end(); DISPLAY_INI_ENTRIES(); @@ -607,14 +607,16 @@ zval **tmp, **arg_elm; if (!op) { - SEPARATE_ZVAL(input); + zval_dtor(return_value); *return_value = *input; zval_copy_ctor(return_value); + INIT_PZVAL(return_value); php_filter_call(return_value, FILTER_DEFAULT, NULL, 0, FILTER_REQUIRE_ARRAY TSRMLS_CC); } else if (Z_TYPE_PP(op) == IS_LONG) { - SEPARATE_ZVAL(input); + zval_dtor(return_value); *return_value = *input; zval_copy_ctor(return_value); + INIT_PZVAL(return_value); php_filter_call(return_value, Z_LVAL_PP(op), NULL, 0, FILTER_REQUIRE_ARRAY TSRMLS_CC); } else if (Z_TYPE_PP(op) == IS_ARRAY) { array_init(return_value); http://cvs.php.net/viewvc.cgi/php-src/ext/filter/tests/039.phpt?r1=1.1.2.2r2=1.1.2.3diff_format=u Index: php-src/ext/filter/tests/039.phpt diff -u php-src/ext/filter/tests/039.phpt:1.1.2.2 php-src/ext/filter/tests/039.phpt:1.1.2.3 --- php-src/ext/filter/tests/039.phpt:1.1.2.2 Mon Nov 13 14:51:11 2006 +++ php-src/ext/filter/tests/039.phpt Mon Nov 13 19:32:58 2006 @@ -28,6 +28,19 @@ var_dump(filter_var_array(array(var_name=), array(var_name=-1, asdas=asdasd, qwe=rty, =))); var_dump(filter_var_array(array(asdas=text), array(var_name=-1, asdas=asdasd, qwe=rty, =))); + +$a = array(=); $b = -1; +var_dump(filter_var_array($a, $b)); +var_dump($a, $b); + +$a = array(=); $b = 10; +var_dump(filter_var_array($a, $b)); +var_dump($a, $b); + +$a = array(=); $b = ; +var_dump(filter_var_array($a, $b)); +var_dump($a, $b); + echo Done\n; ? --EXPECTF-- @@ -99,4 +112,28 @@ []= NULL } +array(1) { + []= + string(0) +} +array(1) { + []= + string(0) +} +int(-1) +array(1) { + []= + string(0) +} +array(1) { + []= + string(0) +} +int(10) +bool(false) +array(1) { + []= + string(0) +} +string(0) Done -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php