Skip to content

Conversation

Zhao-Andy
Copy link
Contributor

@Zhao-Andy Zhao-Andy commented Feb 15, 2019

What type of PR is this? (check all applicable)

  • Bug Fix

Description

use include instead of start_with and end_with as recommended for a more secure check.

@pr-triage pr-triage bot added the PR: unreviewed bot applied label for PR's with no review label Feb 15, 2019
@pr-triage pr-triage bot added PR: reviewed-approved bot applied label for PR's where reviewer approves changes and removed PR: unreviewed bot applied label for PR's with no review labels Feb 15, 2019
@maestromac maestromac merged commit 0b8ab21 into forem:master Feb 15, 2019
@pr-triage pr-triage bot added PR: merged bot applied label for PR's that are merged and removed PR: reviewed-approved bot applied label for PR's where reviewer approves changes labels Feb 15, 2019

def sanitized_preamble(markup)
raise StandardError, "Runkit tag is invalid" if markup.ends_with? "\">"
raise StandardError, "Runkit tag is invalid" if markup.include? "\""
Copy link
Contributor

@glebec glebec Mar 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line prevents the use of double quotes, not the use of > characters. This breaks all runkit preambles that use double-quoted strings. For example, the following is now a minimal example of an invalid runkit tag:

{% runkit "" %}
{% endrunkit %}

Whereas this is fine:

{% runkit '' %}
{% endrunkit %}

@pr-triage pr-triage bot added PR: reviewed-approved bot applied label for PR's where reviewer approves changes and removed PR: merged bot applied label for PR's that are merged labels Mar 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: reviewed-approved bot applied label for PR's where reviewer approves changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants