From 90eeca2531296648a264f3fdc9a3e7e8e281b24e Mon Sep 17 00:00:00 2001 From: George Peter Banyard Date: Sat, 28 Mar 2020 20:31:18 +0100 Subject: Convert some unknown encoding warnings to ValueErrors in ext/mbstring Promotes only the warnings where the encoding comes only from a string. Functions which accept an array of encodings will be fixed at a later stage. Closes GH-5317 --- ext/mbstring/php_mbregex.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/mbstring/php_mbregex.c') diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index bcdff2c4c9..6fded56744 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -855,8 +855,8 @@ PHP_FUNCTION(mb_regex_encoding) mbctype = _php_mb_regex_name2mbctype(encoding); if (mbctype == ONIG_ENCODING_UNDEF) { - php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", encoding); - RETURN_FALSE; + zend_argument_value_error(1, "must be a valid encoding, \"%s\" given", encoding); + RETURN_THROWS(); } MBREX(current_mbctype) = mbctype; -- cgit v1.2.1