From: Dmitry Stogov Date: Tue, 24 Jun 2008 06:07:08 +0000 (+0000) Subject: Fixed strtolower/strtoupper to not modify the passed argument X-Git-Tag: php-5.3.0alpha1~621 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=273ee49acb23bc2081f125c599df9a1e8bef8563;p=php Fixed strtolower/strtoupper to not modify the passed argument --- 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); } /* }}} */