fix: Validate if the uploaded file is a valid torrent

This commit is contained in:
Oha-you
2021-04-14 23:01:45 +03:00
parent cdcacce768
commit 3b8cbab91f
2 changed files with 12 additions and 4 deletions
@@ -74,7 +74,7 @@ class TorrentController extends BaseController
return $this->sendError('Validation Error.', 'You Must Provide A Torrent File For Upload!');
}
if ($requestFile->getError() !== 0 && $requestFile->getClientOriginalExtension() !== 'torrent') {
if ($requestFile->getError() !== 0 || $requestFile->getClientOriginalExtension() !== 'torrent') {
return $this->sendError('Validation Error.', 'You Must Provide A Valid Torrent File For Upload!');
}