Fixing truncation of special attribute (src and style) values containing '=' #714

Merged
merged 1 commit into from Feb 4, 2014

Conversation

Projects
None yet
2 participants
@ccummings
Contributor

ccummings commented Feb 4, 2014

Exact same issue as #342 except with src and style which are considered special attributes. Values for special attributes are passed to getValue where they are run through a few regex.

The value passed to getValue has the attribute name in it followed by an =, so if your src value has a '=' in it like myImage.png?wid=900&hei=450, getValue would be operating on src="myImage.png?wid=900&hei=450" and you would end up with 450.

Fix is to change the attribute regex to take the string after the first = instead of taking the string after the last =

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Feb 4, 2014

Contributor

@ccummings can you write a new test instead of modifying the old one? As a div and image each take a separate path when being live-bound, we should keep a test for both cases.

Contributor

justinbmeyer commented Feb 4, 2014

@ccummings can you write a new test instead of modifying the old one? As a div and image each take a separate path when being live-bound, we should keep a test for both cases.

@justinbmeyer justinbmeyer added this to the 2.0.5 milestone Feb 4, 2014

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Feb 4, 2014

Contributor

I'm going to merge. @ccummings please add this in for 2.1.

Contributor

justinbmeyer commented Feb 4, 2014

I'm going to merge. @ccummings please add this in for 2.1.

justinbmeyer added a commit that referenced this pull request Feb 4, 2014

Merge pull request #714 from bitovi/attribute-value-escaping
Fixing truncation of special attribute (src and style) values containing '='

@justinbmeyer justinbmeyer merged commit 63ebd7f into master Feb 4, 2014

1 check passed

default The Travis CI build passed
Details

@daffl daffl deleted the attribute-value-escaping branch Feb 24, 2014

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