mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Fix crash when first argument to strtr is empty
This commit is contained in:
parent
62f626b157
commit
16987ca15f
@ -1573,6 +1573,11 @@ PHP_FUNCTION(strtr)
|
||||
|
||||
convert_to_string_ex(str);
|
||||
|
||||
/* shortcut for empty string */
|
||||
if(Z_STRLEN_PP(str) == 0) {
|
||||
RETURN_EMPTY_STRING();
|
||||
}
|
||||
|
||||
if (ac == 2) {
|
||||
php_strtr_array(return_value,(*str)->value.str.val,(*str)->value.str.len,HASH_OF(*from));
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user