Skip to content

Commit

Permalink
allow Media to be used outside of media folder fix #348
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-peugnet committed Oct 11, 2024
1 parent c554e90 commit e077ce9
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions app/class/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@ public function __construct(string $path)
if (!is_file($path)) {
throw new Fileexception("$path is not a file");
}
if (!str_starts_with(realpath($path), realpath(Model::MEDIA_DIR))) {
throw new Forbiddenexception("File `$path`, is not inside `media` folder");
}
$this->filename = basename($path);
$this->dir = pathinfo($path, PATHINFO_DIRNAME);
$this->analyse();
Expand Down

0 comments on commit e077ce9

Please sign in to comment.