From: Rasmus Lerdorf Date: Tue, 21 Sep 1999 17:50:51 +0000 (+0000) Subject: fgetss/gzgetss fixes X-Git-Tag: before-sapi-split~89 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cd0957112b147b434c6896e4c7382f98d595defb;p=php fgetss/gzgetss fixes --- diff --git a/ext/standard/file.c b/ext/standard/file.c index 900e29304e..9bf77ccd85 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -973,7 +973,8 @@ PHP_FUNCTION(fgetss) RETURN_FALSE; } - _php3_strip_tags(buf, len, fgetss_state, allow->value.str.val); + /* strlen() can be used here since we are doing it on the return of an fgets() anyway */ + _php3_strip_tags(buf, strlen(buf), fgetss_state, allow?allow->value.str.val:NULL); RETURN_STRING(buf, 0); } /* }}} */ diff --git a/ext/standard/string.c b/ext/standard/string.c index 5cff5d43ba..22bcbc6c3b 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1789,7 +1789,7 @@ PHP_FUNCTION(strip_tags) } convert_to_string(str); buf = estrdup(str->value.str.val); - _php3_strip_tags(buf, str->value.str.len, 0, allow->value.str.val); + _php3_strip_tags(buf, str->value.str.len, 0, allow?allow->value.str.val:NULL); RETURN_STRING(buf, 0); } /* }}} */ diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index 3e505f0425..b4717e40ff 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -518,7 +518,8 @@ PHP_FUNCTION(gzgetss) RETURN_FALSE; } - _php3_strip_tags(buf, len, ZLIBG(gzgetss_state), allow->value.str.val); + /* strlen() can be used here since we are doing it on the return of an fgets() anyway */ + _php3_strip_tags(buf, strlen, ZLIBG(gzgetss_state), allow?allow->value.str.val:NULL); RETURN_STRING(buf, 0); }