Skip to content

Commit

Permalink
prevent basepath from starting or ending with slah
Browse files Browse the repository at this point in the history
again
close #355
  • Loading branch information
vincent-peugnet committed Nov 6, 2023
1 parent 5dfdb0e commit 6baffed
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/class/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ public static function tojson()
*/
public static function checkbasepath(): bool
{
if (str_starts_with(self::$basepath, '/') || str_ends_with(self::$basepath, '/')) {
return false;
}
$path = $_SERVER['DOCUMENT_ROOT'] . '/' . self::$basepath . '/' . Model::CONFIG_FILE;
return (file_exists($path));
}
Expand Down

0 comments on commit 6baffed

Please sign in to comment.