Skip to content
Permalink
Browse files
[Asset] do not allow filenames longer than 255 characters
  • Loading branch information
brusch committed Mar 19, 2019
1 parent d27f659 commit 732f1647cc6e0a29b5b1f5d904b4d726b5e9455f
Showing 1 changed file with 4 additions and 0 deletions.
@@ -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()) {

0 comments on commit 732f164

Please sign in to comment.