Skip to content
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

Use include instead as a better check #1808

Merged
merged 1 commit into from Feb 15, 2019

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
@@ -66,13 +66,9 @@ def self.script
end

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.

None yet

3 participants