forked from ampproject/amp-wp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor how sources are determined for validation
* Allow sources to be determined when calling remove_invalid_child() from any sanitizers (not just whitelist). * Include more context in sources, including the shortcode tag and hook name. * Run removal callback before node is removed from document. * Add amp_disable_invalid_removal arg to prevent invalid elements and attributes from being removed (for debugging). * Prevent calling reset_removed() inside get_response() so that multiple copies of response can be obtained. Reduce side effects. * Remove use of constant for 'remove_invalid_callback' key since adds class dependency from AMP_Base_Sanitizer to AMP_Validation_Utils. * Prevent wrapping action output if it does not contain HTML tags, to prevent comments from corrupting actions triggered in HTML attributes. * Rename get_response() to get_validation_results() to prevent confusion with returning WP_REST_Response. * Add comment to end of body that contains the validation results when validation is being performed. * Check should_validate_front_end before calling store_validation_errors, not the other way around. * Remove redundant calls to has_cap(). * Add reporting for removal of amp-keyframe element. * Allow reporting of external stylesheet links. * Prevent applying the_content filters twice when calling validate_content.
- Loading branch information
1 parent
2715cf1
commit 76e2be5
Showing
9 changed files
with
306 additions
and
238 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.