-
Notifications
You must be signed in to change notification settings - Fork 295
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
mb_check_encoding
use can raise a fatal error in some environments
#6524
Comments
One solution here would be to include the |
IB ✅ |
@jamesozzie sure, that would fix the issue too, although I'm guessing most users wouldn't have that option. |
Good to know, thanks @aaemnnosttv. |
Confirming that installing
|
Got paged my blog was down, presumably after a plugin auto update, and found this error. If you can't install mbstring quickly, you can bring your site back online by hacking in Look for if ( true || mb_check_encoding( $wpp['host'], 'ASCII' ) ) { |
QA Update:
|
@wpdarren it is disabled but I didn't realize the polyfill plugin was still active which fills the gap there. I've since disabled it so this should be ready to test again 👍 |
QA Update: ✅Verified:
Related to the IDN. There were a few bugs discovered during testing #5868 and these are highlighted in #6435. |
Bug Description
In #5868 we implemented a fix which resolves redirect issues on sites using internationalized domain names (IDN). This involves the use of a core PHP multibyte string function which may not exist on some environments. While the
mbstring
module is commonly enabled, it is not enabled by default so we cannot rely on it to be generally available.WordPress polyfills a few
mb_*
functions, (e.g.mb_substr
, andmb_strlen
) but not all of them.Steps to reproduce
mbstring
PHP module to be disabledwp_validate_redirect
which itself is called by various functions, notably wp_safe_redirect()googlesitekit-splash
in the URL togooglesitekit-dashboard
and then attempt to navigate to that URL to invoke the redirectSupport topics
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
mbstring
PHP module is not enabledmb_*
function to be provided by PHPImplementation Brief
allowed_redirect_hosts
filter callback fromPlugin
Authentication::allowed_redirect_hosts
methodURL::parse
instead of(wp_)parse_url
functions can have problems with multibyte hostnames (see Permuting site URLs can fail for some domains and environments #4776)admin_url
as the URL to parse here rather than thehome_url
for accuracy. The hosts should be the same because SK does not support them being different but this is more accurate because SK only does redirects within WP adminmb_check_encoding
with the sameis_ascii
check we use inModule::permute_site_hosts
Test Coverage
AuthenticationTest
perhaps by testing a number of redirects usingwp_safe_redirect
with ascii + unicode domains and ensure the destination location is as expected (seeRedirectException
in our tests for examples)QA Brief
mbstring
module/extension enabledChangelog entry
mbstring
PHP extension is not loaded.The text was updated successfully, but these errors were encountered: