aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/lib
diff options
context:
space:
mode:
authorAndreas Gohr <gohr@cosmocode.de>2016-02-24 10:59:50 +0100
committerAndreas Gohr <gohr@cosmocode.de>2016-02-24 10:59:50 +0100
commit3a63c3f39219186fa14c21f2b177d9fa75e3067d (patch)
tree8aa47d1bc4c6e75859e869f049e0d32c9cb81814 /lib
parent34b180e5dfbc3470c33917e2aebc9c97293be03d (diff)
downloaddokuwiki-3a63c3f39219186fa14c21f2b177d9fa75e3067d.tar.gz
dokuwiki-3a63c3f39219186fa14c21f2b177d9fa75e3067d.zip
clean up the onselect callback
This makes sure the provided callback is using alphanumerics only. I'm not sure this is needed, but better safe than sorry.
Diffstat (limited to 'lib')
-rw-r--r--lib/scripts/media.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/scripts/media.js b/lib/scripts/media.js
index c52226eaa..dc0191d49 100644
--- a/lib/scripts/media.js
+++ b/lib/scripts/media.js
@@ -257,7 +257,7 @@ var dw_mediamanager = {
edid = String.prototype.match.call(document.location, /&edid=([^&]+)/);
edid = edid ? edid[1] : 'wiki__text';
cb = String.prototype.match.call(document.location, /&onselect=([^&]+)/);
- cb = cb ? cb[1] : 'dw_mediamanager_item_select';
+ cb = cb ? cb[1].replace(/[^\w]+/, '') : 'dw_mediamanager_item_select';
opener[cb](edid, id, opts, dw_mediamanager.align);
if(!dw_mediamanager.keepopen) {