diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-09-28 12:51:03 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-09-28 12:51:25 +0200 |
commit | 9e3f35269128f5f0a153c20dd0a74027cf86e879 (patch) | |
tree | 341eab56583b1579f8b6c6e9cdda686f6d5d052d /ext/iconv | |
parent | 0a573f9e1c0c9677e37842252a522e873eece7ac (diff) | |
download | php-git-9e3f35269128f5f0a153c20dd0a74027cf86e879.tar.gz |
Throw warning for invalid iconv charset
Diffstat (limited to 'ext/iconv')
-rw-r--r-- | ext/iconv/iconv.c | 4 | ||||
-rw-r--r-- | ext/iconv/tests/iconv_strlen_error2.phpt | 2 | ||||
-rw-r--r-- | ext/iconv/tests/iconv_strpos_error2.phpt | 2 | ||||
-rw-r--r-- | ext/iconv/tests/iconv_strrpos_error2.phpt | 2 | ||||
-rw-r--r-- | ext/iconv/tests/iconv_substr_error2.phpt | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index 1f3a141b3e..3a4399d350 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -1777,11 +1777,11 @@ static void _php_iconv_show_error(php_iconv_err_t err, const char *out_charset, break; case PHP_ICONV_ERR_CONVERTER: - php_error_docref(NULL, E_NOTICE, "Cannot open converter"); + php_error_docref(NULL, E_WARNING, "Cannot open converter"); break; case PHP_ICONV_ERR_WRONG_CHARSET: - php_error_docref(NULL, E_NOTICE, "Wrong charset, conversion from `%s' to `%s' is not allowed", + php_error_docref(NULL, E_WARNING, "Wrong charset, conversion from \"%s\" to \"%s\" is not allowed", in_charset, out_charset); break; diff --git a/ext/iconv/tests/iconv_strlen_error2.phpt b/ext/iconv/tests/iconv_strlen_error2.phpt index ea2bb430fb..98c784c414 100644 --- a/ext/iconv/tests/iconv_strlen_error2.phpt +++ b/ext/iconv/tests/iconv_strlen_error2.phpt @@ -23,5 +23,5 @@ var_dump(iconv_strlen($string, $encoding)); --EXPECTF-- *** Testing iconv_strlen() : error *** -Notice: iconv_strlen(): Wrong charset, conversion from `unknown-encoding' to `UCS-4LE' is not allowed in %s on line %d +Warning: iconv_strlen(): Wrong charset, conversion from "unknown-encoding" to "UCS-4LE" is not allowed in %s on line %d bool(false) diff --git a/ext/iconv/tests/iconv_strpos_error2.phpt b/ext/iconv/tests/iconv_strpos_error2.phpt index b95e1e1edc..48a8eff69b 100644 --- a/ext/iconv/tests/iconv_strpos_error2.phpt +++ b/ext/iconv/tests/iconv_strpos_error2.phpt @@ -24,6 +24,6 @@ echo "Done"; --EXPECTF-- *** Testing iconv_strpos() : error conditions *** -Notice: iconv_strpos(): Wrong charset, conversion from `unknown-encoding' to `UCS-4LE' is not allowed in %s on line %d +Warning: iconv_strpos(): Wrong charset, conversion from "unknown-encoding" to "UCS-4LE" is not allowed in %s on line %d bool(false) Done diff --git a/ext/iconv/tests/iconv_strrpos_error2.phpt b/ext/iconv/tests/iconv_strrpos_error2.phpt index 7b0155ac4d..4e9d925530 100644 --- a/ext/iconv/tests/iconv_strrpos_error2.phpt +++ b/ext/iconv/tests/iconv_strrpos_error2.phpt @@ -25,6 +25,6 @@ echo "Done"; --EXPECTF-- *** Testing iconv_strrpos() : error conditions *** -Notice: iconv_strrpos(): Wrong charset, conversion from `unknown-encoding' to `UCS-4LE' is not allowed in %s on line %d +Warning: iconv_strrpos(): Wrong charset, conversion from "unknown-encoding" to "UCS-4LE" is not allowed in %s on line %d bool(false) Done diff --git a/ext/iconv/tests/iconv_substr_error2.phpt b/ext/iconv/tests/iconv_substr_error2.phpt index 70a4e958c1..5da2d183fd 100644 --- a/ext/iconv/tests/iconv_substr_error2.phpt +++ b/ext/iconv/tests/iconv_substr_error2.phpt @@ -25,6 +25,6 @@ echo "Done"; --EXPECTF-- *** Testing iconv_substr() : error conditions *** -Notice: iconv_substr(): Wrong charset, conversion from `unknown-encoding' to `UCS-4LE' is not allowed in %s on line %d +Warning: iconv_substr(): Wrong charset, conversion from "unknown-encoding" to "UCS-4LE" is not allowed in %s on line %d bool(false) Done |