summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS3
-rw-r--r--ext/intl/msgformat/msgformat_helpers.cpp21
2 files changed, 14 insertions, 10 deletions
diff --git a/NEWS b/NEWS
index 472272f723..fe45a4db3c 100644
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,9 @@ PHP NEWS
- Fileinfo:
. Fixed bug #77961 (finfo_open crafted magic parsing SIGABRT). (cmb)
+- Intl:
+ . Fixed bug #80425 (MessageFormatAdapter::getArgTypeList redefined). (Nikita)
+
- Standard:
. Fixed bug #80366 (Return Value of zend_fstat() not Checked). (sagpant, cmb)
. Fixed bug #80411 (References to null-serialized object break serialize()).
diff --git a/ext/intl/msgformat/msgformat_helpers.cpp b/ext/intl/msgformat/msgformat_helpers.cpp
index 11ff2f3388..5fcb2bb48a 100644
--- a/ext/intl/msgformat/msgformat_helpers.cpp
+++ b/ext/intl/msgformat/msgformat_helpers.cpp
@@ -46,25 +46,26 @@ extern "C" {
U_NAMESPACE_BEGIN
/**
- * This class isolates our access to private internal methods of
- * MessageFormat. It is never instantiated; it exists only for C++
- * access management.
+ * ICU declares MessageFormatAdapter as a friend class of MessageFormat,
+ * to use as a backdoor for accessing private MessageFormat members.
+ * We use it for the same purpose here. Prefix the methods with php to
+ * avoid clashes with any definitions in ICU.
*/
class MessageFormatAdapter {
public:
- static const Formattable::Type* getArgTypeList(const MessageFormat& m,
+ static const Formattable::Type* phpGetArgTypeList(const MessageFormat& m,
int32_t& count);
- static const MessagePattern getMessagePattern(MessageFormat* m);
+ static const MessagePattern phpGetMessagePattern(MessageFormat* m);
};
const Formattable::Type*
-MessageFormatAdapter::getArgTypeList(const MessageFormat& m,
+MessageFormatAdapter::phpGetArgTypeList(const MessageFormat& m,
int32_t& count) {
return m.getArgTypeList(count);
}
const MessagePattern
-MessageFormatAdapter::getMessagePattern(MessageFormat* m) {
+MessageFormatAdapter::phpGetMessagePattern(MessageFormat* m) {
return m->msgPattern;
}
U_NAMESPACE_END
@@ -80,7 +81,7 @@ using icu::FieldPosition;
U_CFUNC int32_t umsg_format_arg_count(UMessageFormat *fmt)
{
int32_t fmt_count = 0;
- MessageFormatAdapter::getArgTypeList(*(const MessageFormat*)fmt, fmt_count);
+ MessageFormatAdapter::phpGetArgTypeList(*(const MessageFormat*)fmt, fmt_count);
return fmt_count;
}
@@ -103,7 +104,7 @@ static HashTable *umsg_get_numeric_types(MessageFormatter_object *mfo,
return mfo->mf_data.arg_types;
}
- const Formattable::Type *types = MessageFormatAdapter::getArgTypeList(
+ const Formattable::Type *types = MessageFormatAdapter::phpGetArgTypeList(
*(MessageFormat*)mfo->mf_data.umsgf, parts_count);
/* Hash table will store Formattable::Type objects directly,
@@ -288,7 +289,7 @@ static HashTable *umsg_get_types(MessageFormatter_object *mfo,
{
MessageFormat *mf = (MessageFormat *)mfo->mf_data.umsgf;
- const MessagePattern mp = MessageFormatAdapter::getMessagePattern(mf);
+ const MessagePattern mp = MessageFormatAdapter::phpGetMessagePattern(mf);
return umsg_parse_format(mfo, mp, err);
}