Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c366bea
)
MDL-31499 Javascript: Handle invalid window names in openpopup
author
Frederic Massart
<fred@moodle.com>
Thu, 13 Sep 2012 08:51:45 +0000
(16:51 +0800)
committer
Frederic Massart
<fred@moodle.com>
Mon, 24 Sep 2012 07:24:30 +0000
(15:24 +0800)
lib/javascript-static.js
patch
|
blob
|
blame
|
history
diff --git
a/lib/javascript-static.js
b/lib/javascript-static.js
index
812fe07
..
068fb98
100644
(file)
--- a/
lib/javascript-static.js
+++ b/
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;