Skip to content

Commit

Permalink
Delete non https/data:image URI's during Script parsing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zren committed Nov 15, 2014
1 parent 719540a commit 3649939
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libs/modelParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,15 @@ var parseScript = function (aScriptData) {
if (script.meta.icon64) {
script.icon45Url = script.meta.icon64;
}
// Icons: Validation
// Must be a data:image uri or start with https://
var iconUrlRegex = /((^data:image\/(gif|png);base64,)|(^https:\/\/))/;
if (script.icon16Url && !iconUrlRegex.test(script.icon16Url)) {
delete script.icon16Url;
}
if (script.icon45Url && !iconUrlRegex.test(script.icon45Url)) {
delete script.icon45Url;
}

// Support Url
if (script.meta.supportURL) {
Expand Down

0 comments on commit 3649939

Please sign in to comment.