Add full document sanitization in theme support#929
Merged
westonruter merged 17 commits intodevelopfrom Feb 5, 2018
Merged
Conversation
* Sanitize the elements in the HEAD. * Deprecate get_body_node in favor of getting html or body element once and storing in var. * Add support for alternative attribute names in check for mandatory attributes. * Expand use of NAME_VALUE_DISPATCH for other value matching results.
This reduces a lot of complexity and as well as it fixes errors in the PHP-generation
…al link are present
Contributor
|
Review In Progress Hi @westonruter, |
kienstra
approved these changes
Feb 4, 2018
Contributor
kienstra
left a comment
There was a problem hiding this comment.
Approved
Made Minor Point
Hi @westonruter,
This pull request looks good. Phpize seems to have simplified creating the PHP in amphtml-update.py.
I made a minor point, but this is approved.
| echo self::CUSTOM_STYLES_PLACEHOLDER; // WPCS: XSS OK. | ||
| echo '</style>'; | ||
| public static function add_amp_styles_placeholder() { | ||
| echo self::STYLES_PLACEHOLDER; // WPCS: XSS OK. |
Contributor
There was a problem hiding this comment.
This looks to have the same output:
echo wp_kses_post( self::STYLES_PLACEHOLDER );
Of course, this is a minor point, and not a blocker.
Member
Author
There was a problem hiding this comment.
Thanks. Since this is a constant it doesn't need escaping.
…ts once failure found
…d X-UA-Compatible content
* Remove newly-unused dispatch key constant. * Use integers for flags. * Use constants instead of string literals.
Collaborator
|
I absolutely love these changes ❤️ |
This was referenced Feb 6, 2018
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
htmldocument not just the `body.amphtml-update.pyto use PHP for generation of array literals as opposed to using the previous buggy Python functions.<html>element has theampattribute.Todo:
Fixes #875.