Edit report at https://bugs.php.net/bug.php?id=79213&edit=1
ID: 79213
Comment by: bugreports at gmail dot com
Reported by: info at ioweb dot gr
Summary: mb_check_encoding doesn't work with base64
Status: Open
Type: Bug
Package: Unknown/Other Function
Operating System: Debian 9, Ubuntu 18.04
PHP Version: 7.2.27
Block user comment: N
Private report: N
New Comment:
why do you expect base64 strings to be detected as whatever multibyte encoding?
it's a plain string - not more and not less and "BASE64" is not a multibyte encoding
at all
Previous Comments:
------------------------------------------------------------------------
[2020-02-02 21:54:05] info at ioweb dot gr
Description:
------------
mb_check_encoding is unable to detect strings that are encoded with base64, it will show false
Example string "test" will yield "dGVzdA=="
but mb_check_encoding fails to detect correctly this is a base64 encoded string
Test script:
---------------
$base64encoded = base64_encode("test");
$valid = mb_check_encoding($base64encoded, "BASE64");
Expected result:
----------------
$valid is true
Actual result:
--------------
$valid is false
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79213&edit=1