Skip to content

Conversation

@howard
Copy link

@howard howard commented Nov 27, 2015

The method Array.prototype.filter() is overridden by prototype.js, changing the semantics of the call, which triggers an exception and essentially breaks SVGInjector on any site that uses at least version 1.7 of this library.

A test case that breaks without the fix is included.

Since there are no contribution guidelines, I was not sure whether to do take the steps of the release procedure into this pull request. Please advise.

howard added 2 commits July 23, 2015 13:07
In current versions of Magento (Community Edition, at least), Prototype messes
with the Array prototype. As a result, the part of SVGInjector that copies
attributes of the original `img` tag to the newly embedded SVG `tag`.

The fix is manually iterating over the `img` tag's attributes instead of using
`Array.filter()`, and adding the attributes matching the pattern to `imgData`.
@georgms
Copy link

georgms commented Nov 27, 2015

@stryju
Copy link
Contributor

stryju commented Aug 1, 2016

this is more of prototype.js issue

@georgms
Copy link

georgms commented Aug 1, 2016

I agree. But since prototype.js' last release was in September 2015 I doubt they will fix anything. Also, fixing this in prototype.js is not backward compatible. The proposed change here on the other hand is completely transparent.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants