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

This commit is contained in:
Dan Poltawski
2012-10-03 10:26:22 +08:00
+5 -2
View File
@@ -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()');