mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-19 13:01:51 -07:00
fix xss / GH-2252
ref https://github.com/serghey-rodin/vesta/issues/2252
This commit is contained in:
parent
e527827174
commit
0682f7b10c
1 changed files with 7 additions and 0 deletions
|
@ -1191,6 +1191,13 @@ class UploadHandler
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(!headers_sent()){
|
||||||
|
// this is the most likely/expected path.
|
||||||
|
header("Content-Type: text/javascript; charset=UTF-8");
|
||||||
|
} else {
|
||||||
|
// html-encode json to prevent xss...
|
||||||
|
$json = htmlentities($json, ENT_QUOTES | ENT_SUBSTITUTE | ENT_DISALLOWED | ENT_HTML401);
|
||||||
|
}
|
||||||
$this->body($json);
|
$this->body($json);
|
||||||
}
|
}
|
||||||
return $content;
|
return $content;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue