summaryrefslogtreecommitdiff
path: root/ext/mbstring/php_mbregex.c
diff options
context:
space:
mode:
authorGeorge Peter Banyard <girgias@php.net>2020-03-28 20:31:18 +0100
committerGeorge Peter Banyard <girgias@php.net>2020-03-31 16:34:18 +0200
commit90eeca2531296648a264f3fdc9a3e7e8e281b24e (patch)
tree5fbea594100c996722c77c6e88350abef239559d /ext/mbstring/php_mbregex.c
parent55a3e5b99e35a99fe5916a761df87ea269d0b959 (diff)
downloadphp-git-90eeca2531296648a264f3fdc9a3e7e8e281b24e.tar.gz
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
Diffstat (limited to 'ext/mbstring/php_mbregex.c')
-rw-r--r--ext/mbstring/php_mbregex.c4
1 files changed, 2 insertions, 2 deletions
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;