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

Keep track of the callbacks run (and their sources) when a filter is applied #1016

Merged
merged 1 commit into from Mar 13, 2018

Conversation

Projects
None yet
2 participants
@westonruter
Collaborator

westonruter commented Mar 12, 2018

  • Wrap the_content and the_excerpt in AMP stack source comments to reveal which filters are responsible for the resulting content, since not any one filter callback can be identified as the culprit for invalid content.
  • Remove spurious apostrophe from callback class name.
  • Prevent PHP notice when doing summarize_validation_errors if a source has no type or name.

If I enter an excerpt that contains:

This is <b onclick=EVIL>awesome</b> food

Now this results in the validation error containing the filter that is applied (the_excerpt), the current post global, and the filter callbacks added and their sources:

image

This will greatly help with debugging AMP validation errors related to filters, where previously there was only good validation debugging for actions.

Keep track of the callbacks run (and their sources) when a filter is …
…applied

* Wrap the_content and the_excerpt in AMP stack source comments to reveal which filters are responsible for the resulting content, since not any one filter callback can be identified as the culprit for invalid content.
* Remove spurious apostrophe from callback class name.
* Prevent PHP notice when doing summarize_validation_errors if a source has no type or name.

@westonruter westonruter requested a review from kienstra Mar 12, 2018

@westonruter westonruter added this to the v0.7 milestone Mar 12, 2018

@westonruter

This comment has been minimized.

Show comment
Hide comment
@westonruter

westonruter Mar 12, 2018

Collaborator

Here's what it looks like when there is invalid content output by a shortcode: both the shortcode being applied and the filter (the_content) is captured in the source stack trace:

image

Collaborator

westonruter commented Mar 12, 2018

Here's what it looks like when there is invalid content output by a shortcode: both the shortcode being applied and the filter (the_content) is captured in the source stack trace:

image

@kienstra

Approved

Hi @westonruter,
This looks good. It's nice how it has a stack trace of the filter.

@westonruter westonruter merged commit 3f3687f into develop Mar 13, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@westonruter westonruter deleted the add/filter-source-stack branch Mar 13, 2018

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