-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.0] Finder: Replacing iconv() with mb_convert_encoding() #22042
Conversation
Similar solution is at: joomla-cms/libraries/src/Filter/InputFilter.php Lines 796 to 814 in eb68e01
|
The PHP mb extension is not always installed on hosts. So either way I would add a check or fallback to iconv if it is not available. |
|
ok |
Thanks |
$oldSetting = ini_get('mbstring.substitute_character'); | ||
ini_set('mbstring.substitute_character', 'none'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ini_set returns the old value so this could be one operation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm ok commenting on an 5 year old pr makes no sense... sry for the noise
The original issue is this here: https://forum.joomla.org/viewtopic.php?t=860554#p3503601
Looking through the documentation, iconv() indeed has issues: https://secure.php.net/manual/en/function.iconv.php
The more reliable solution as it seems is this code.
Testing Instructions
Apply this patch and run the indexer of Smart Search in the backend. See that it still works.