]> granicus.if.org Git - php/commitdiff
- Make maic qutes runtime work if length is specified too
authorMarcus Boerger <helly@php.net>
Mon, 7 Mar 2005 21:52:34 +0000 (21:52 +0000)
committerMarcus Boerger <helly@php.net>
Mon, 7 Mar 2005 21:52:34 +0000 (21:52 +0000)
ext/standard/file.c

index f1d283f106ac4bbda42b47cef384413b55d419a2..a64242ec1cf3494e0fe6e3f4ef87fd9a44274c20 100644 (file)
@@ -1240,8 +1240,8 @@ PHPAPI PHP_FUNCTION(fwrite)
 
        PHP_STREAM_TO_ZVAL(stream, arg1);
 
-       if (!arg3 && PG(magic_quotes_runtime)) {
-               buffer = estrndup(Z_STRVAL_PP(arg2), Z_STRLEN_PP(arg2));
+       if (PG(magic_quotes_runtime)) {
+               buffer = estrndup(Z_STRVAL_PP(arg2), num_bytes);
                php_stripslashes(buffer, &num_bytes TSRMLS_CC);
        }