summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-08-25 18:06:07 +0200
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-08-25 18:09:50 +0200
commitea87d0480fbfcdd1610bb56e680f64840b233b0c (patch)
tree2d530376df32fd75e5ff953b22d78997dd5eb04a /ext/pcre/php_pcre.c
parent2369f48092a15a42731a4c1d1d8a1c770517a780 (diff)
downloadphp-git-ea87d0480fbfcdd1610bb56e680f64840b233b0c.tar.gz
Promote warnings to exceptions in ext/pcre
Closes GH-6006
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r--ext/pcre/php_pcre.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index acaeb19dc6..801d19fc4f 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -1193,8 +1193,8 @@ PHPAPI void php_pcre_match_impl(pcre_cache_entry *pce, zend_string *subject_str,
}
if ((global && (subpats_order < PREG_PATTERN_ORDER || subpats_order > PREG_SET_ORDER)) ||
(!global && subpats_order != 0)) {
- php_error_docref(NULL, E_WARNING, "Invalid flags specified");
- return;
+ zend_argument_value_error(4, "must be a PREG_* constant");
+ RETURN_THROWS();
}
} else {
offset_capture = 0;
@@ -2410,9 +2410,7 @@ PHP_FUNCTION(preg_replace_callback_array)
}
if (!zend_is_callable_ex(replace, NULL, 0, NULL, &fcc, NULL)) {
- zend_string *callback_name = zend_get_callable_name(replace);
- zend_type_error("'%s' is not a valid callback", ZSTR_VAL(callback_name));
- zend_string_release_ex(callback_name, 0);
+ zend_argument_type_error(1, "must contain only valid callbacks");
RETURN_THROWS();
}