-
Notifications
You must be signed in to change notification settings - Fork 383
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
Address an issue where <script> tags aren't stripped. #892
Conversation
As Weston mentioned, adding this to the post content: Hello <script>document.write('world');</script> Produced: This looks to be related to how process_node() gets the $attr_spec_list. In some cases, all will have an equal 'score,' As indicated in $spec_ids_sorted. And sometimes, all of them will be missing a mandatory attribute. In that case, $attr_spec_list will be empty. If it is, use the first spec list in: $rule_spec_list_to_validate. This will need regression testing.
There was an error on the Travis build: Can't use function return value in write context. So store the result of reset() in $first_spec_list.
This has a mandatory attribute. And per the previous commits, It should fail validation.
Note that the CDATA section will be eliminated with #891. |
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.
Great work on debugging this @kienstra. Changes are approved from my perspective.
Basic Testing Hi @ThierryA and @westonruter, I haven't seen any regression yet. But some more sanity-checking would probably help. |
@kienstra I used git-bisect between 0.5.1 and 0.6 to find the commit that introduced the problem. Given this script https://gist.github.com/westonruter/39d251d6f3ff8f9958f8fd1d11167da5 I found that the issue appeared as of a066117. Prior to that commit, the |
I tested the page generated via |
607ba56
to
d25e48f
Compare
Tested, No Regressions Found Hi @westonruter, There weren't any regressions from the earlier version, |
Request For Code Review
Hi @ThierryA,
Could you please review this pull request? The target branch is now
0.6
, but I don't know if that's right.This addresses the issue that @westonruter raised. Before, when you added this to the post content:
It produced:
The expected output is:
This looks to be related to how
process_node()
gets the$attr_spec_list
. In some cases, all of the specs will have an equal 'score,' as indicated in$spec_ids_sorted
.And sometimes, all of them will be missing a mandatory attribute. In that case,
$attr_spec_list
will be empty.If it is, this uses the first spec list in
$rule_spec_list_to_validate
. This will need regression testing.