Re: cvs: php-src(PHP_5_2) / NEWS /ext/filter filter.c /ext/filter/tests bug39763.phpt

From: Date: Fri, 08 Dec 2006 18:43:49 +0000
Subject: Re: cvs: php-src(PHP_5_2) / NEWS /ext/filter filter.c /ext/filter/tests bug39763.phpt
References: 1 2  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-41990@lists.php.net to get a copy of this message
On 8-Dec-06, at 1:26 PM, Stefan Esser wrote:
php_zval_filter(&tmp_new_var, IF_G(default_filter), IF_G(default_filter_flags), NULL, NULL/*charset*/, 0 TSRMLS_CC); - } else if (PG(magic_quotes_gpc)) { + } else if (PG(magic_quotes_gpc) && !retval) { /* for PARSE_STRING php_register_variable_safe() will do the addslashes() */ Z_STRVAL(new_var) = php_addslashes(*val, Z_STRLEN(new_var), &Z_STRLEN(new_var), 0 TSRMLS_CC);
This comment is wrong. It is not php_register_variable_safe() but ext/filter that adds the magic_quotes.
This is where you are incorrect, take a look at php_register_variable_safe() line #51. The reason we don't apply magic quotes for PARSE_STRING (retval == 1) is because the return value of the function in this instance is 1, which causes php_register_variable_safe() to be executed on the returned value.
a) support daisy chaining
Can you not provide your own hooks and have them call the stock filter functions?
b) does not register the variables itself but actually work as filters were supposed to do.
I think it makes the API simpler, but it would not be major change to make if there was a really good reason to do so.
c) Support Cookies correctly...
Can you elaborate in terms of what is missing in cookie support? Ilia Alshanetsky

« previous php.cvs (#41990) next »