mirror of
https://github.com/9001/copyparty.git
synced 2025-08-18 09:22:31 -06:00
Update util.js
Signed-off-by: Zeroday BYTE <github@zerodaysec.org>
This commit is contained in:
parent
4915b14be1
commit
8656952d0f
|
@ -2001,9 +2001,9 @@ function load_md_plug(md_text, plug_type, defer) {
|
|||
|
||||
var old_plug = md_plug[plug_type];
|
||||
if (!old_plug || old_plug[1] != js) {
|
||||
js = 'const loc = new URL("' + location.href + '"), x = { ' + js + ' }; x;';
|
||||
// Use Function constructor to avoid code injection via location.href
|
||||
try {
|
||||
var x = eval(js);
|
||||
var x = (new Function('loc', 'return { ' + js + ' };'))(new URL(location.href));
|
||||
if (x['ctor']) {
|
||||
x['ctor']();
|
||||
delete x['ctor'];
|
||||
|
|
Loading…
Reference in a new issue