You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem:
Hashed svg with the following name man.1234566.svg (original file was man.svg) will match icon with this name "cdicon-man.svg" and change it to "cdicon-man.1234566.svg"
Example string: "is.cdicon_man_href=u.a.urls.resources.SVGs+"cdicon-man.svg#cdicon-man",this.authenti"
The reason is the \b does not cover all word boundaries in case of file name ("-" is legible character in file name).
This is the problematic line in the code:
contents = contents.replace(new RegExp('\\b' + original + '(?!\\.)\\b', 'g'), cachebusted);
Suggested regex: [^a-zA-Z0-9_-]man.svg(?!.)\b
Other characters except from "-" can be added
New code line:
contents = contents.replace(new RegExp('[^a-zA-Z0-9_-]' + original + '(?!\.)\b', 'g'), cachebusted);
be glad to get feedback on that, as well I will open a pull request.
The text was updated successfully, but these errors were encountered:
Problem:
Hashed svg with the following name man.1234566.svg (original file was man.svg) will match icon with this name "cdicon-man.svg" and change it to "cdicon-man.1234566.svg"
Example string: "is.cdicon_man_href=u.a.urls.resources.SVGs+"cdicon-man.svg#cdicon-man",this.authenti"
The reason is the \b does not cover all word boundaries in case of file name ("-" is legible character in file name).
Suggested regex: [^a-zA-Z0-9_-]man.svg(?!.)\b
Other characters except from "-" can be added
New code line:
contents = contents.replace(new RegExp('[^a-zA-Z0-9_-]' + original + '(?!\.)\b', 'g'), cachebusted);
be glad to get feedback on that, as well I will open a pull request.
The text was updated successfully, but these errors were encountered: