You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you pass an invalid UTF-8 byte sequence such as "\xC3\x28" to StringHelper::replaceMb4, the preg_replace_callback call will return null and cause an error since the method it is type hinted to string.
Steps to reproduce
Call StringHelper::replaceMb4("\xC3\x28", '');
Craft CMS version
5.7.4
PHP version
8.4
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered:
Thanks for reporting that! The core issue is that \xC3\x28 is considered invalid UTF-8 data. I’ve fixed this for the next Craft 4 and 5 releases by catching the null response and throwing an InvalidArgumentException instead.
What happened?
Description
If you pass an invalid UTF-8 byte sequence such as "\xC3\x28" to StringHelper::replaceMb4, the preg_replace_callback call will return null and cause an error since the method it is type hinted to string.
Steps to reproduce
Craft CMS version
5.7.4
PHP version
8.4
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: