]> granicus.if.org Git - php/commitdiff
Throw warning for invalid iconv charset
authorNikita Popov <nikita.ppv@gmail.com>
Mon, 28 Sep 2020 10:51:03 +0000 (12:51 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Mon, 28 Sep 2020 10:51:25 +0000 (12:51 +0200)
ext/iconv/iconv.c
ext/iconv/tests/iconv_strlen_error2.phpt
ext/iconv/tests/iconv_strpos_error2.phpt
ext/iconv/tests/iconv_strrpos_error2.phpt
ext/iconv/tests/iconv_substr_error2.phpt

index 1f3a141b3e5224048b3d28ececf61bec97214677..3a4399d350556c9c11fecaa114e7a79e736ea5fe 100644 (file)
@@ -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;
 
index ea2bb430fbf2a64d627898afa0bd3bb2d95c6436..98c784c4142339a53ba5b2d8381704a302a78dbd 100644 (file)
@@ -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)
index b95e1e1edc9b227589365339bdd1cc7db0f7bcd8..48a8eff69b3fa8dfb1b32a419666ed3649bff2ff 100644 (file)
@@ -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
index 7b0155ac4d44427761579bb3edc2f9bdf7c37f34..4e9d925530fc093c57add8132287bd17de118c45 100644 (file)
@@ -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
index 70a4e958c180651f9e3f36f63a49328473b4749f..5da2d183fd634c3daf10cc6dfa3a9610691260bd 100644 (file)
@@ -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