-
Notifications
You must be signed in to change notification settings - Fork 384
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
Improve validating sanitizer with context for why element/attribute is invalid #3780
Merged
Merged
Changes from 1 commit
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
bf28199
Eliminate premature/redundant attribute checks from validate_attr_spe…
westonruter 656ebb0
Remove redundant is_missing_mandatory_attribute check
westonruter a7f2750
Consolidate removal of elements without mandatory attributes
westonruter 6475b70
Introduce illegal_cdata error code
westonruter ad440fa
Fix return value docs for validate_attr_spec_list_for_node
westonruter 3f2f50e
Reuse check_attr_spec_rule_mandatory in is_missing_mandatory_attribute
westonruter 3bb3d8e
Introduce specific error codes for attribute value violations
westonruter ad66b8f
Include list of missing mandatory attributes in validation error
westonruter 35638c5
Extract AMP validator error codes and messages from spec
westonruter a2e20d6
Use constant in switch statement
westonruter ef80051
Fix removing emptyable-attributes and fix is_missing_mandatory_attribute
westonruter 2d6ec3d
Add constants for error codes; improve CDATA error reporting
westonruter 00eb55c
Add fine-grained error codes for CDATA
westonruter a6d0fc9
Revert "Extract AMP validator error codes and messages from spec"
westonruter 15fb6dd
Fix validation of __amp_source_origin URL value
westonruter c55c58c
Eliminate duplicated testing; add code checking
westonruter 7f4bf4e
Add DISALLOWED_DESCENDANT_TAG error code
westonruter df96667
Fix checking of empty URL before relative URL
westonruter 7b32198
Add assertions for specific error codes
westonruter 9808761
Move erroneous sanitiation inside of validate_tag_spec_for_node method
westonruter 374e0d3
Add fine-grained error codes for elements that have bad ancestors or …
westonruter 934bbd1
Add constants for normalized error codes used in style sanitizer
westonruter 5da07dc
Ensure body present instead of raising error
westonruter b0dfd17
Improve error codes used in media converters; add error context data
westonruter 2c42a07
Include spec_name in validation error
westonruter 10b0c29
Include spec_name in validation errors raised by style sanitizer
westonruter 6975bd0
Verify unique tag spec names when generating spec
westonruter e2db927
Remove redundant info from validation error now that spec_name provided
westonruter 5e56cce
Fix up PHP comments
westonruter 9067d6c
Remove obsolete DISALLOWED_DOMAIN checks
westonruter 5d9c205
Add tests for INVALID_CDATA_CONTENTS and DISALLOWED_RELATIVE_URL
westonruter 7470a24
Add test for MANDATORY_CDATA_MISSING_OR_INCORRECT
westonruter 038caa7
Add tests for MANDATORY_TAG_ANCESTOR, DISALLOWED_TAG_ANCESTOR, and (n…
westonruter 998c45c
Add test for INCORRECT_NUM_CHILD_TAGS
westonruter 22b1869
Remove redundant validation error data; test for non-redundant data
westonruter 8550fd7
Merge branch 'develop' of github.com:ampproject/amp-wp into add/inval…
westonruter 322035b
Bring sanity to the code
schlessera dc76b9f
Merge branch 'develop' of github.com:ampproject/amp-wp into add/inval…
westonruter b96e4e7
Fix typos in comments and code style
westonruter 827659a
Harmonize logic for getting stylesheet by URL
westonruter f7d00f9
Use SORT_REGULAR flag for array_unique() instead of serializing array…
westonruter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😜
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, maybe I should mention I searched for usage first: