From a820c7c568ed95c63f634d35fb85a04a603d8e43 Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Fri, 30 Jan 2009 00:16:27 +0000 Subject: [PATCH] Improved validation checks inside str_pad() --- ext/standard/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.50.1