diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2009-01-30 00:17:05 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2009-01-30 00:17:05 +0000 |
commit | adfdb7a77fed92567b09664b0220679ea9bd8ec3 (patch) | |
tree | 7050b61571c4c091bb31965aca30627312131e78 | |
parent | d84d3e47f33d3c4193bc3d3e17d4ddc6dfafe836 (diff) | |
download | php-git-adfdb7a77fed92567b09664b0220679ea9bd8ec3.tar.gz |
MFB: Improved validation checks inside str_pad()
-rw-r--r-- | ext/standard/string.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c index d7c3164f8d..e1062afac3 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -4922,7 +4922,7 @@ PHP_FUNCTION(str_pad) /* If resulting string turns out to be shorter than input string, we simply copy the input and return. */ - if (Z_LVAL_PP(pad_length) < 0 || num_pad_chars < 0) { + if (Z_LVAL_PP(pad_length) <= 0 || num_pad_chars <= 0) { RETURN_ZVAL(*input, 1, 0); } |