Closed olifrieda closed 1 year ago
@olifrieda Hi, thanks for bringing this up, it definitely has to be tackled with!
When you use "mb_convert_encoding($mixed, 'UTF-8', 'UTF-8');", don't you just get some replacement chars like question marks for invalid utf8 chars? If that is the case, I would rather just use 'JSON_INVALID_UTF8_IGNORE' or 'JSON_INVALID_UTF8_SUBSTITUTE' flag to simply ignore invalid utf8 chars in the first place.
@cicnavi The flags may work too. We should give it a try!
If you get this error while trying to login:
it might be because of an empty claims column in the database. The reason why this field is empty could be an error while running the json_encode() function. This cannot handle non UTF-8 chars! Especially when you have an LDAP as authsource the attributes from session state may contain non UTF-8 chars. To not run into this issue, non UTF-8 chars should be removed or converted.
https://github.com/simplesamlphp/simplesamlphp-module-oidc/blob/40e2ea3bdd658d409ce52116331419740f5f5233/lib/Entity/UserEntity.php#L66-L89
I have changed these lines:
Maybe someone can fix this issue.
Thanks to https://stackoverflow.com/a/52641198