diff --git a/include/constants.php b/include/constants.php index dbc74e58..d2233ca2 100644 --- a/include/constants.php +++ b/include/constants.php @@ -1,6 +1,6 @@ "); } diff --git a/include/globalfunctions.php b/include/globalfunctions.php index 5541df83..a93134bd 100644 --- a/include/globalfunctions.php +++ b/include/globalfunctions.php @@ -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; +} +