From: Ilia Alshanetsky Date: Fri, 30 Jan 2009 00:16:27 +0000 (+0000) Subject: Improved validation checks inside str_pad() X-Git-Tag: RELEASE_1_3_5~205 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a820c7c568ed95c63f634d35fb85a04a603d8e43;p=php Improved validation checks inside str_pad() --- diff --git a/ext/standard/string.c b/ext/standard/string.c index 32b87751b3..b8d822ce45 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -4816,7 +4816,7 @@ PHP_FUNCTION(str_pad) /* If resulting string turns out to be shorter than input string, we simply copy the input and return. */ - if (pad_length < 0 || num_pad_chars < 0) { + if (pad_length <= 0 || num_pad_chars <= 0) { RETURN_STRINGL(input, input_len, 1); }