mirror of
https://github.com/moodle/moodle.git
synced 2025-07-25 00:02:18 +02:00
MDL-35754 libraries: openpopup() does not fail when window name is not set
This commit is contained in:
@@ -1212,9 +1212,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()');
|
||||
|
Reference in New Issue
Block a user