php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #76942
Patch php-7.1.22-msgformatter.patch revision 2018-10-01 13:33 UTC by anthrax at unixuser dot org
revision 2018-10-01 13:24 UTC by anthrax at unixuser dot org

Patch php-7.1.22-msgformatter.patch for intl Bug #76942

Patch version 2018-10-01 13:33 UTC

Return to Bug #76942 | Download this patch
Patch Revisions:

Developer: anthrax@unixuser.org

diff -ur php-7.1.22.orig/ext/intl/msgformat/msgformat_helpers.cpp php-7.1.22.fix/ext/intl/msgformat/msgformat_helpers.cpp
--- php-7.1.22.orig/ext/intl/msgformat/msgformat_helpers.cpp	2018-09-11 23:08:36.000000000 +0900
+++ php-7.1.22.fix/ext/intl/msgformat/msgformat_helpers.cpp	2018-10-01 22:02:27.692770446 +0900
@@ -48,6 +48,10 @@
 #define HAS_MESSAGE_PATTERN 1
 #endif
 
+#if U_ICU_VERSION_MAJOR_NUM * 10 + U_ICU_VERSION_MINOR_NUM >= 48
+#define HAS_MISALLOCATE_MEMORY_BUG 1
+#endif
+
 U_NAMESPACE_BEGIN
 /**
  * This class isolates our access to private internal methods of
@@ -334,6 +338,7 @@
 		return; /* already done */
 	}
 
+#ifdef HAS_MISALLOCATE_MEMORY_BUG
 	/* There is a bug in ICU which prevents MessageFormatter::getFormats()
 	   to handle more than 10 formats correctly. The enumerator could be
 	   used to walk through the present formatters using getFormat(), which
@@ -351,6 +356,7 @@
 	if (count > 10) {
 		return;
 	}
+#endif
 
 	formats = mf->getFormats(count);
 
diff -ur php-7.1.22.orig/ext/intl/tests/bug74484_MessageFormatter.phpt php-7.1.22.fix/ext/intl/tests/bug74484_MessageFormatter.phpt
--- php-7.1.22.orig/ext/intl/tests/bug74484_MessageFormatter.phpt	2018-09-11 23:08:36.000000000 +0900
+++ php-7.1.22.fix/ext/intl/tests/bug74484_MessageFormatter.phpt	2018-10-01 22:32:19.782074005 +0900
@@ -4,6 +4,8 @@
 <?php
 if (!extension_loaded('intl'))
 	die('skip intl extension not enabled');
+if (version_compare(INTL_ICU_VERSION, '4.8') < 0)
+	die('skip for ICU 4.8+');
 ?>
 --FILE--
 <?php
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 11:01:29 2024 UTC