diff --git a/models/Asset.php b/models/Asset.php index f43fd585aca..4d28af150f2 100644 --- a/models/Asset.php +++ b/models/Asset.php @@ -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()) {