Permalink
Browse files

MDL-31499 Javascript: Handle invalid window names in openpopup

  • Loading branch information...
1 parent c366bea commit fede879cf238e919776cb351dd0f1b42a8ce1da0 @FMCorz FMCorz committed Sep 13, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 lib/javascript-static.js
@@ -1178,6 +1178,15 @@ function openpopup(event, args) {
}
}
+ // Cleans window name because IE does not support funky ones.
+ var nameregex = /[^a-z0-9_]/i;
+ if (args.name.match(nameregex)) {
+ args.name = args.name.replace(nameregex, '_');
+ if (M.cfg.developerdebug) {
+ alert('DEVELOPER NOTICE: Invalid \'name\' passed to openpopup()');
+ }
+ }
+
var fullurl = args.url;
if (!args.url.match(/https?:\/\//)) {
fullurl = M.cfg.wwwroot + args.url;

0 comments on commit fede879

Please sign in to comment.