Merge branch 'PHP-7.4' into PHP-8.0

* PHP-7.4:
  Fixed bug #80425
This commit is contained in:
Nikita Popov 2020-11-27 10:03:02 +01:00
commit c61390cfb4
2 changed files with 14 additions and 10 deletions

View file

@ -43,25 +43,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
@ -77,7 +78,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;
}
@ -100,7 +101,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,
@ -285,7 +286,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);
}