summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikic@php.net>2014-07-02 22:33:57 +0200
committerNikita Popov <nikic@php.net>2014-07-02 22:34:32 +0200
commit8c4156ed28e56b8b97e3ddfc7e4320f6103e7dbe (patch)
tree90802b907c38836a51909004a9660831be4993c7
parentd9ebd0f3d696e42d7c7bd2b0176414534aed0ef1 (diff)
parent3cc6bd10acdec14dc28bce1f39689bc99add4514 (diff)
downloadphp-git-8c4156ed28e56b8b97e3ddfc7e4320f6103e7dbe.tar.gz
Merge branch 'PHP-5.4' into PHP-5.5
-rw-r--r--NEWS3
-rw-r--r--ext/standard/string.c4
2 files changed, 6 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 9bfa384e82..4f9ed4dd9f 100644
--- a/NEWS
+++ b/NEWS
@@ -9,8 +9,9 @@ PHP NEWS
match). (Bob)
. Fixed bug #67091 (make install fails to install libphp5.so on FreeBSD 10.0).
(Ferenc)
- . Fixed buf #67497 (eval with parse error causes segmentation fault in
+ . Fixed bug #67497 (eval with parse error causes segmentation fault in
generator). (Nikita)
+ . Fixed bug #67151 (strtr with empty array crashes). (Nikita)
- CLI server:
. Implemented FR #67429 (CLI server is missing some new HTTP response codes).
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 58aad8d6b6..a63bea09ff 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -3106,6 +3106,10 @@ static void php_strtr_array(zval *return_value, char *str, int slen, HashTable *
int patterns_len;
zend_llist *allocs;
+ if (zend_hash_num_elements(pats) == 0) {
+ RETURN_STRINGL(str, slen, 1);
+ }
+
S(&text) = str;
L(&text) = slen;