Skip to content
Browse files

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

…ODLE_22_STABLE
  • Loading branch information...
2 parents bd465e3 + 5d07f6e commit 1c61cadaaffc3e5a6a35f80c1a4686f6dba9fcc1 @danpoltawski danpoltawski committed Oct 3, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/javascript-static.js
View
7 lib/javascript-static.js
@@ -1109,9 +1109,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 1c61cad

Please sign in to comment.
Something went wrong with that request. Please try again.