Skip to content

Commit

Permalink
[Asset] do not allow filenames longer than 255 characters
Browse files Browse the repository at this point in the history
  • Loading branch information
brusch committed Mar 19, 2019
1 parent d27f659 commit 732f164
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions models/Asset.php
Expand Up @@ -623,6 +623,10 @@ public function correctPath()
$this->setFilename($this->getFilename() . '.txt');
}

if(mb_strlen($this->getFilename()) > 255) {
throw new \Exception('Filenames longer than 255 characters are not allowed');
}

if (Asset\Service::pathExists($this->getRealFullPath())) {
$duplicate = Asset::getByPath($this->getRealFullPath());
if ($duplicate instanceof Asset and $duplicate->getId() != $this->getId()) {
Expand Down

0 comments on commit 732f164

Please sign in to comment.