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

Call dup on input to #fragment before preprocessing #128

Merged
merged 1 commit into from
Feb 4, 2015
Merged

Call dup on input to #fragment before preprocessing #128

merged 1 commit into from
Feb 4, 2015

Commits on Feb 4, 2015

  1. Call dup on input to #fragment before preprocessing

    The introduction of this #preprocess method in
    bf0d753 broke sanitisation of frozen
    strings (for example, hash keys). The reason this was not a problem
    previously is that after #preprocess is called, the input is only ever
    used by interpolation into another string, so it never matters that the
    object is itself frozen.
    
    This patch has the input stringified and duplicated at the start of
    preprocessing. I suspect that was already the intent, since this line
    of code already stringified and duplicated it, but then threw the
    result away. The only actual change here is assigning the result to the
    input variable instead.
    
    This commit also adds a test to ensure that #fragment always works on a
    frozen input string.
    Steven McDonald committed Feb 4, 2015
    Configuration menu
    Copy the full SHA
    7a43f1d View commit details
    Browse the repository at this point in the history