- Fixed wrong signature initialization in imagepng (Takeshi Abe)
- Added optimization for imageline with horizontal and vertial lines (Pierre)
- Fixed bug #39775 ("Indirect modification ..." message is not shown). (Dmitry)
+- Fixed bug #39763 (magic quotes are applied twice by ext/filter in
+ parse_str()). (Ilia)
- Fixed bug #39754 (Some POSIX extension functions not thread safe).
(Ilia, wharmby at uk dot ibm dot com)
- Fixed bug #39724 (Broken build due to spl/filter usage of pcre extension).
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);
- } 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);
} else {
Z_STRVAL(new_var) = estrndup(*val, val_len);
--- /dev/null
+--TEST--
+Bug #39763 filter applies magic_quotes twice in parse_str()
+--INI--
+magic_quotes_gpc=1
+--FILE--
+<?php
+$arr = array();
+parse_str("val=%22probably+a+bug%22", $arr);
+echo $arr['val'] . "\n";
+parse_str("val=%22probably+a+bug%22");
+echo $val . "\n";
+?>
+--EXPECT--
+\"probably a bug\"
+\"probably a bug\"