diff --git a/apps/encryption/lib/Crypto/Encryption.php b/apps/encryption/lib/Crypto/Encryption.php index fc1d55ab7b480..340330d6470af 100644 --- a/apps/encryption/lib/Crypto/Encryption.php +++ b/apps/encryption/lib/Crypto/Encryption.php @@ -511,7 +511,9 @@ protected function getPathToRealFile($path) { if ($parts[2] === 'files_versions') { $realPath = '/' . $parts[1] . '/files/' . implode('/', array_slice($parts, 3)); $length = strrpos($realPath, '.'); - $realPath = substr($realPath, 0, $length); + if ($length !== false) { + $realPath = substr($realPath, 0, $length); + } } return $realPath;