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
There should not be any need to show a validation error as this should automatically get converted. If the site is using an encoding other than UTF-8, then technically the encoding should be getting converted to UTF-8 before being parsed. See:
/* translators: %s: the charset of the current site. */
trigger_error( esc_html( sprintf( __( 'The database has the %s encoding when it needs to be utf-8 to work with AMP.', 'amp' ), get_bloginfo( 'charset' ) ) ), E_USER_WARNING ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_trigger_error
Bug Description
As reported in a support forum topic, if a theme like Koji declares the
Content-Type
using the HTML4 method like this:Then the result the AMP plugin generating:
Somehow the validating sanitizer is leaking the
http-equiv
andcontent
attributes here, and this causes an error in the validator:This is even though the sanitizer is reporting the former as being invalid:
Even though it is accepted, it is not getting sanitized. So that's confusing.
The AMP plugin should transparently convert any such
meta
Content-Type tag into the HTML meta charset that AMP requires:See also #2970. This would have avoided an error in adding support for Twenty Twenty (#3342 (comment)) which was fixed in Twenty Twenty via WordPress/twentytwenty#640.
Here is a workaround plugin for the issue: https://gist.github.com/westonruter/d18fd37fb9a58a26ae375a0cb9570831
There should not be any need to show a validation error as this should automatically get converted. If the site is using an encoding other than UTF-8, then technically the encoding should be getting converted to UTF-8 before being parsed. See:
amp-wp/includes/class-amp-theme-support.php
Lines 2290 to 2294 in 6033288
This would fix #855.
Expected Behaviour
An AMP-valid HTML5 meta charset should only be output.
Steps to reproduce
http-equiv
attribute.Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
http-equiv
attribute should not be leaked to the frontend.meta[http-equiv]
to HTML5meta[charset]
.Implementation brief
QA testing instructions
Demo
Changelog entry
The text was updated successfully, but these errors were encountered: