Fix formatImg() security issue

This commit is contained in:
xiaomlove
2023-07-19 02:32:02 +08:00
parent 61cb2bb6bb
commit 30aae54673
3 changed files with 17 additions and 1 deletions

View File

@@ -1195,3 +1195,13 @@ function has_role_work_seeding($uid)
return $result;
}
function is_danger_url($url): bool
{
$dangerScriptsPattern = "/(logout|login|ajax|announce|scrape|adduser|modtask|take.*)\.php/i";
$match = preg_match($dangerScriptsPattern, $url);
if ($match > 0) {
return true;
}
return false;
}