summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2018-06-30 23:21:30 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2018-06-30 23:22:20 +0200
commit1b61c3b210da6f57c00fd1e5a7da0f42ce4bb91f (patch)
tree11bfbac8b2debabe988f1c7ee0652988207725b4
parent8faa6ef30e9e75764695dff4168902f5de7ebb1d (diff)
parentae163d9a366baed363d7ed146b2b3a5b72b093d9 (diff)
downloadphp-git-1b61c3b210da6f57c00fd1e5a7da0f42ce4bb91f.tar.gz
Merge branch 'PHP-7.2'
* PHP-7.2: Fix #76556: get_debug_info handler for BreakIterator shows wrong type
-rw-r--r--NEWS4
-rw-r--r--ext/intl/breakiterator/breakiterator_class.cpp2
-rw-r--r--ext/intl/tests/bug76556.phpt23
3 files changed, 28 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 9e10327145..77f5fbd1c9 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,10 @@ PHP NEWS
. Fixed bug #73342 (Vulnerability in php-fpm by changing stdin to
non-blocking). (Nikita)
+- intl:
+ . Fixed bug #76556 (get_debug_info handler for BreakIterator shows wrong
+ type). (cmb)
+
- mbstring:
. Fixed bug #76532 (Integer overflow and excessive memory usage
in mb_strimwidth). (MarcusSchwarz)
diff --git a/ext/intl/breakiterator/breakiterator_class.cpp b/ext/intl/breakiterator/breakiterator_class.cpp
index 7ff9d47e1d..8c47aaf860 100644
--- a/ext/intl/breakiterator/breakiterator_class.cpp
+++ b/ext/intl/breakiterator/breakiterator_class.cpp
@@ -167,7 +167,7 @@ static HashTable *BreakIterator_get_debug_info(zval *object, int *is_temp)
}
ZVAL_STRING(&val, const_cast<char*>(typeid(*biter).name()));
- zend_hash_str_update(debug_info, "type", sizeof("type") - 1, &bio->text);
+ zend_hash_str_update(debug_info, "type", sizeof("type") - 1, &val);
return debug_info;
}
diff --git a/ext/intl/tests/bug76556.phpt b/ext/intl/tests/bug76556.phpt
new file mode 100644
index 0000000000..57395fba2d
--- /dev/null
+++ b/ext/intl/tests/bug76556.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Bug #76556 (get_debug_info handler for BreakIterator shows wrong type)
+--SKIPIF--
+<?php
+if (!extension_loaded('intl')) die('skip intl extension not available');
+?>
+--FILE--
+<?php
+$it = IntlBreakIterator::createCharacterInstance();
+$it->setText('foo');
+var_dump($it);
+?>
+===DONE===
+--EXPECTF--
+object(IntlRuleBasedBreakIterator)#%d (3) {
+ ["valid"]=>
+ bool(true)
+ ["text"]=>
+ string(3) "foo"
+ ["type"]=>
+ string(%d) "%sRuleBasedBreakIterator%s"
+}
+===DONE===