mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-05 07:20:58 +08:00
Fix formatImg() security issue
This commit is contained in:
@@ -229,6 +229,12 @@ function formatCode($text) {
|
||||
}
|
||||
|
||||
function formatImg($src, $enableImageResizer, $image_max_width, $image_max_height, $imgId = "") {
|
||||
if (is_danger_url($src)) {
|
||||
$msg = "[DANGER_URL]: $src";
|
||||
do_log($msg, "alert");
|
||||
write_log($msg, "mod");
|
||||
return "";
|
||||
}
|
||||
return addTempCode("<img style=\"max-width: 100%\" id=\"$imgId\" alt=\"image\" src=\"$src\"" .($enableImageResizer ? " onload=\"Scale(this,$image_max_width,$image_max_height);\" onclick=\"Preview(this);\"" : "") . " />");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user