mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-03-31 17:15:38 +00:00
prevend duplicates upload by md5 file check #11
This commit is contained in:
parent
bd772f87d1
commit
1f7d8d0810
3 changed files with 35 additions and 0 deletions
|
|
@ -257,6 +257,12 @@ class TorrentController extends AbstractController
|
|||
$form['torrent']['error'][] = $translator->trans('Torrent file out of size limit');
|
||||
}
|
||||
|
||||
//// Check for duplicates
|
||||
if ($torrentService->findTorrentByMd5File(md5_file($file->getPathName())))
|
||||
{
|
||||
$form['torrent']['error'][] = $translator->trans('Torrent file already exists');
|
||||
}
|
||||
|
||||
//// Validate torrent format
|
||||
if (!$torrentService->readTorrentFileByFilepath($file->getPathName()))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue