diff options
author | Dmitry Stogov <dmitry@php.net> | 2008-06-24 06:07:08 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2008-06-24 06:07:08 +0000 |
commit | 273ee49acb23bc2081f125c599df9a1e8bef8563 (patch) | |
tree | 00c9bdadbe24acedaf40ee3a0253ba4e9a49b0f0 | |
parent | e13bb4c5f6f594c5ab032d3ccb187f1dfc36e43d (diff) | |
download | php-git-273ee49acb23bc2081f125c599df9a1e8bef8563.tar.gz |
Fixed strtolower/strtoupper to not modify the passed argument
-rw-r--r-- | ext/standard/string.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c index 916f9e15a7..142e1f4ace 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1291,9 +1291,9 @@ PHP_FUNCTION(strtoupper) return; } - php_strtoupper(arg, arglen); - - RETURN_STRINGL(arg, arglen, 1); + arg = estrndup(arg, arglen); + php_strtoupper(arg, arglen); + RETURN_STRINGL(arg, arglen, 0); } /* }}} */ @@ -1325,8 +1325,9 @@ PHP_FUNCTION(strtolower) return; } + str = estrndup(str, arglen); php_strtolower(str, arglen); - RETURN_STRINGL(str, arglen, 1); + RETURN_STRINGL(str, arglen, 0); } /* }}} */ |