mirror of
https://github.com/php/php-src.git
synced 2024-11-26 11:23:47 +08:00
@- ucfirst()/ucwords() no longer modify arg1. (Thies)
(PHP ucfirst,ucwords) no longer modify arg1
This commit is contained in:
parent
f2b0c70512
commit
4127b34a0a
@ -937,8 +937,10 @@ PHP_FUNCTION(ucfirst)
|
||||
if (!*(*arg)->value.str.val) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
*(*arg)->value.str.val = toupper((unsigned char)*(*arg)->value.str.val);
|
||||
RETVAL_STRING((*arg)->value.str.val,1);
|
||||
|
||||
*return_value=**arg;
|
||||
zval_copy_ctor(return_value);
|
||||
*return_value->value.str.val = toupper((unsigned char)*return_value->value.str.val);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
@ -957,8 +959,11 @@ PHP_FUNCTION(ucwords)
|
||||
if (!*(*arg)->value.str.val) {
|
||||
RETURN_FALSE;
|
||||
}
|
||||
*(*arg)->value.str.val = toupper((unsigned char)*(*arg)->value.str.val);
|
||||
r=(*arg)->value.str.val;
|
||||
*return_value=**arg;
|
||||
zval_copy_ctor(return_value);
|
||||
*return_value->value.str.val = toupper((unsigned char)*return_value->value.str.val);
|
||||
|
||||
r=return_value->value.str.val;
|
||||
while((r=strstr(r," "))){
|
||||
if(*(r+1)){
|
||||
r++;
|
||||
@ -967,7 +972,6 @@ PHP_FUNCTION(ucwords)
|
||||
break;
|
||||
}
|
||||
}
|
||||
RETVAL_STRING((*arg)->value.str.val,1);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user