]> granicus.if.org Git - php/commitdiff
Improved validation checks inside str_pad()
authorIlia Alshanetsky <iliaa@php.net>
Fri, 30 Jan 2009 00:16:27 +0000 (00:16 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Fri, 30 Jan 2009 00:16:27 +0000 (00:16 +0000)
ext/standard/string.c

index 32b87751b33925abf0584fd66cb179b19c95a659..b8d822ce45cdecf0e29814e48493b520604a543f 100644 (file)
@@ -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);
        }