FAQ
jani Wed Feb 6 19:05:18 2008 UTC

Modified files:
/php-src/ext/filter filter.c
Log:
- Fixed bug in handling arrays which caused the original array being modified too.

http://cvs.php.net/viewvc.cgi/php-src/ext/filter/filter.c?r1=1.90&r2=1.91&diff_format=u
Index: php-src/ext/filter/filter.c
diff -u php-src/ext/filter/filter.c:1.90 php-src/ext/filter/filter.c:1.91
--- php-src/ext/filter/filter.c:1.90 Fri Jan 25 20:21:18 2008
+++ php-src/ext/filter/filter.c Wed Feb 6 19:05:18 2008
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/

-/* $Id: filter.c,v 1.90 2008/01/25 20:21:18 nlopess Exp $ */
+/* $Id: filter.c,v 1.91 2008/02/06 19:05:18 jani Exp $ */

#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -275,7 +275,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.90 $");
+ php_info_print_table_row( 2, "Revision", "$Revision: 1.91 $");
php_info_print_table_end();

DISPLAY_INI_ENTRIES();
@@ -457,8 +457,9 @@

for (zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(value), &pos);
zend_hash_get_current_data_ex(Z_ARRVAL_PP(value), (void **) &element, &pos) == SUCCESS;
- zend_hash_move_forward_ex(Z_ARRVAL_PP(value), &pos)) {
-
+ zend_hash_move_forward_ex(Z_ARRVAL_PP(value), &pos)
+ ) {
+ SEPARATE_ZVAL_IF_NOT_REF(element);
if (Z_TYPE_PP(element) == IS_ARRAY) {
Z_ARRVAL_PP(element)->nApplyCount++;
php_zval_filter_recursive(element, filter, flags, options, charset, copy TSRMLS_CC);

Search Discussions

  • Jani Taskinen at Feb 6, 2008 at 7:06 pm
    jani Wed Feb 6 19:06:05 2008 UTC

    Modified files:
    /php-src/ext/filter filter.c
    Log:
    ws

    http://cvs.php.net/viewvc.cgi/php-src/ext/filter/filter.c?r1=1.91&r2=1.92&diff_format=u
    Index: php-src/ext/filter/filter.c
    diff -u php-src/ext/filter/filter.c:1.91 php-src/ext/filter/filter.c:1.92
    --- php-src/ext/filter/filter.c:1.91 Wed Feb 6 19:05:18 2008
    +++ php-src/ext/filter/filter.c Wed Feb 6 19:06:05 2008
    @@ -19,7 +19,7 @@
    +----------------------------------------------------------------------+
    */

    -/* $Id: filter.c,v 1.91 2008/02/06 19:05:18 jani Exp $ */
    +/* $Id: filter.c,v 1.92 2008/02/06 19:06:05 jani Exp $ */

    #ifdef HAVE_CONFIG_H
    #include "config.h"
    @@ -275,7 +275,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.91 $");
    + php_info_print_table_row( 2, "Revision", "$Revision: 1.92 $");
    php_info_print_table_end();

    DISPLAY_INI_ENTRIES();
    @@ -460,13 +460,13 @@
    zend_hash_move_forward_ex(Z_ARRVAL_PP(value), &pos)
    ) {
    SEPARATE_ZVAL_IF_NOT_REF(element);
    - if (Z_TYPE_PP(element) == IS_ARRAY) {
    - Z_ARRVAL_PP(element)->nApplyCount++;
    - php_zval_filter_recursive(element, filter, flags, options, charset, copy TSRMLS_CC);
    - Z_ARRVAL_PP(element)->nApplyCount--;
    - } else {
    - php_zval_filter(element, filter, flags, options, charset, copy TSRMLS_CC);
    - }
    + if (Z_TYPE_PP(element) == IS_ARRAY) {
    + Z_ARRVAL_PP(element)->nApplyCount++;
    + php_zval_filter_recursive(element, filter, flags, options, charset, copy TSRMLS_CC);
    + Z_ARRVAL_PP(element)->nApplyCount--;
    + } else {
    + php_zval_filter(element, filter, flags, options, charset, copy TSRMLS_CC);
    + }
    }
    } else {
    php_zval_filter(value, filter, flags, options, charset, copy TSRMLS_CC);
  • Felipe Pena at Feb 24, 2008 at 6:42 pm
    felipe Sun Feb 24 18:42:09 2008 UTC

    Modified files:
    /php-src/ext/filter filter.c
    Log:
    MFB: Fixed segfault in filter extension when using callbacks.

    http://cvs.php.net/viewvc.cgi/php-src/ext/filter/filter.c?r1=1.92&r2=1.93&diff_format=u
    Index: php-src/ext/filter/filter.c
    diff -u php-src/ext/filter/filter.c:1.92 php-src/ext/filter/filter.c:1.93
    --- php-src/ext/filter/filter.c:1.92 Wed Feb 6 19:06:05 2008
    +++ php-src/ext/filter/filter.c Sun Feb 24 18:42:09 2008
    @@ -19,7 +19,7 @@
    +----------------------------------------------------------------------+
    */

    -/* $Id: filter.c,v 1.92 2008/02/06 19:06:05 jani Exp $ */
    +/* $Id: filter.c,v 1.93 2008/02/24 18:42:09 felipe Exp $ */

    #ifdef HAVE_CONFIG_H
    #include "config.h"
    @@ -275,7 +275,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.92 $");
    + php_info_print_table_row( 2, "Revision", "$Revision: 1.93 $");
    php_info_print_table_end();

    DISPLAY_INI_ENTRIES();
    @@ -322,7 +322,7 @@
    filter_func.function(*value, flags, options, charset TSRMLS_CC);

    if (
    - options &&
    + options && (Z_TYPE_P(options) == IS_ARRAY || Z_TYPE_P(options) == IS_OBJECT) &&
    ((flags & FILTER_NULL_ON_FAILURE && Z_TYPE_PP(value) == IS_NULL) ||
    (!(flags & FILTER_NULL_ON_FAILURE) && Z_TYPE_PP(value) == IS_BOOL && Z_LVAL_PP(value) == 0)) &&
    zend_hash_exists(HASH_OF(options), "default", sizeof("default"))

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-cvs @
categoriesphp
postedFeb 6, '08 at 7:05p
activeFeb 24, '08 at 6:42p
posts3
users2
websitephp.net

2 users in discussion

Jani Taskinen: 2 posts Felipe Pena: 1 post

People

Translate

site design / logo © 2019 Grokbase