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

Warning: Use of undefined constant INTL_IDNA_VARIANT_UTS46 #1439

Closed
kraftbj opened this Issue Sep 17, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@kraftbj
Contributor

kraftbj commented Sep 17, 2018

( ! ) Warning: Use of undefined constant INTL_IDNA_VARIANT_UTS46 - assumed
'INTL_IDNA_VARIANT_UTS46' (this will throw an Error in a future version of PHP) in
/home/public_html/wp-content/plugins/amp/includes/class-amp-http.php on line 205

From looking online, this may be due to a really old version of ICU running on the machine, but something that we may want to account for?

@westonruter westonruter added this to the v1.0 milestone Sep 17, 2018

@westonruter

This comment has been minimized.

Member

westonruter commented Sep 17, 2018

Thank you. The relevant code is:

https://github.com/Automattic/amp-wp/blob/64cad605ee112175f2144df2518ca5a4f11cdfbb/includes/class-amp-http.php#L203-L209

So it seems what we should do is:

- if ( version_compare( PHP_VERSION, '5.4', '>=' ) ) { 
+ if ( version_compare( PHP_VERSION, '5.4', '>=' ) && defined( 'INTL_IDNA_VARIANT_UTS46' ) ) { 
@kraftbj

This comment has been minimized.

Contributor

kraftbj commented Sep 17, 2018

I'll PR that after testing.

In the meantime, I confirmed that INTL_IDNA_VARIANT_UTS46 was shipped in http://site.icu-project.org/download/46 ICU 4.6 back in ~2010/2011, but while this particular machine has PHP 7.2.9 installed, ICU is 4.2.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment