Permalink
Browse files

Merge branch 'MDL-35754-23' of git://github.com/FMCorz/moodle into MO…

…ODLE_23_STABLE
  • Loading branch information...
2 parents a8d7f5c + 1e5b1d6 commit aaed6d78000bf61146a60fe334736d0df88f54ce @danpoltawski danpoltawski committed Oct 3, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/javascript-static.js
View
@@ -1190,9 +1190,12 @@ function openpopup(event, args) {
}
}
- // Cleans window name because IE does not support funky ones.
+ // Make sure the name argument is set and valid.
var nameregex = /[^a-z0-9_]/i;
- if (args.name.match(nameregex)) {
+ if (typeof args.name !== 'string') {
+ args.name = '_blank';
+ } else if (args.name.match(nameregex)) {
+ // Cleans window name because IE does not support funky ones.
args.name = args.name.replace(nameregex, '_');
if (M.cfg.developerdebug) {
alert('DEVELOPER NOTICE: Invalid \'name\' passed to openpopup()');

0 comments on commit aaed6d7

Please sign in to comment.