summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2008-06-24 06:07:08 +0000
committerDmitry Stogov <dmitry@php.net>2008-06-24 06:07:08 +0000
commit273ee49acb23bc2081f125c599df9a1e8bef8563 (patch)
tree00c9bdadbe24acedaf40ee3a0253ba4e9a49b0f0
parente13bb4c5f6f594c5ab032d3ccb187f1dfc36e43d (diff)
downloadphp-git-273ee49acb23bc2081f125c599df9a1e8bef8563.tar.gz
Fixed strtolower/strtoupper to not modify the passed argument
-rw-r--r--ext/standard/string.c9
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);
}
/* }}} */