diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-08-26 10:16:32 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-08-26 10:25:09 +0200 |
commit | 6b554251f742a9389ca16f11f8ab618c10fde67d (patch) | |
tree | 3b63680f8a76baf2c3326c64a1a1ce63a7875277 /ext/intl/formatter/formatter_main.c | |
parent | 72eaf509d3e56d3f4310243141f6df1aa4ae3427 (diff) | |
download | php-git-6b554251f742a9389ca16f11f8ab618c10fde67d.tar.gz |
Prevent double-construction of NumberFormatter
Diffstat (limited to 'ext/intl/formatter/formatter_main.c')
-rw-r--r-- | ext/intl/formatter/formatter_main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/intl/formatter/formatter_main.c b/ext/intl/formatter/formatter_main.c index 80d99b3f01..8f44f33fa3 100644 --- a/ext/intl/formatter/formatter_main.c +++ b/ext/intl/formatter/formatter_main.c @@ -43,6 +43,10 @@ static int numfmt_ctor(INTERNAL_FUNCTION_PARAMETERS) INTL_CHECK_LOCALE_LEN_OR_FAILURE(locale_len); object = return_value; FORMATTER_METHOD_FETCH_OBJECT_NO_CHECK; + if (FORMATTER_OBJECT(nfo)) { + zend_throw_error(NULL, "NumberFormatter object is already constructed"); + return FAILURE; + } /* Convert pattern (if specified) to UTF-16. */ if(pattern && pattern_len) { |