Tony,

This patch is incorrect, please revert it, the filter does not always get data through php_register_variable_ex(), so it does need to add slashes in some instances.

On 7-Dec-06, at 5:59 AM, Antony Dovgal wrote:

tony2001                Thu Dec  7 10:59:35 2006 UTC

  Modified files:
    /php-src/ext/filter filter.c
  Log:
  fix #39763 (magic quotes are applied twice by ext/filter)
no need to add slashes manually, they are added by php_register_variable_ex()


http://cvs.php.net/viewvc.cgi/php-src/ext/filter/filter.c? r1=1.80&r2=1.81&diff_format=u
Index: php-src/ext/filter/filter.c
diff -u php-src/ext/filter/filter.c:1.80 php-src/ext/filter/ filter.c:1.81
--- php-src/ext/filter/filter.c:1.80    Tue Dec  5 01:23:42 2006
+++ php-src/ext/filter/filter.c Thu Dec  7 10:59:35 2006
@@ -19,7 +19,7 @@
+--------------------------------------------------------------------- -+
 */

-/* $Id: filter.c,v 1.80 2006/12/05 01:23:42 pajoye Exp $ */
+/* $Id: filter.c,v 1.81 2006/12/07 10:59:35 tony2001 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.80 $");
+       php_info_print_table_row( 2, "Revision", "$Revision: 1.81 $");
        php_info_print_table_end();

        DISPLAY_INI_ENTRIES();
@@ -397,13 +397,7 @@
                        Z_STRVAL(new_var) = estrndup(*val, val_len);
                        INIT_PZVAL(tmp_new_var);
php_zval_filter(&tmp_new_var, IF_G(default_filter), IF_G (default_filter_flags), NULL, NULL/*charset*/, 0 TSRMLS_CC);
-               }
-#if PHP_VERSION_ID<60000
-               else if (PG(magic_quotes_gpc)) {
- Z_STRVAL(new_var) = php_addslashes(*val, Z_STRLEN(new_var), &Z_STRLEN(new_var), 0 TSRMLS_CC);
-               }
-#endif
-               else {
+               } else {
                        Z_STRVAL(new_var) = estrndup(*val, val_len);
                }
        } else { /* empty string */

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Ilia Alshanetsky

--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to