|
@@ -10,7 +10,10 @@
|
10
|
10
|
// Maximum allowed size for uploaded files
|
11
|
11
|
// https://php.net/upload-max-filesize
|
12
|
12
|
ini_set('upload_max_filesize', 2097152); // 2 MiB
|
13
|
|
-ini_set('max_file_uploads', 100);
|
|
13
|
+
|
|
14
|
+# Allow many uncompressed files,
|
|
15
|
+# e.g., http://academictorrents.com/details/5a447ff50062194bd58dd11c0fedead59e6d873c/tech
|
|
16
|
+ini_set('max_file_uploads', 65535);
|
14
|
17
|
define('MAX_FILENAME_LENGTH', 180);
|
15
|
18
|
|
16
|
19
|
include(SERVER_ROOT.'/classes/validate.class.php');
|
|
@@ -82,7 +85,7 @@ if (isset($_POST['release'])) {
|
82
|
85
|
$Properties['GroupDescription'] = trim($_POST['album_desc']);
|
83
|
86
|
$Properties['TorrentDescription'] = $_POST['release_desc'];
|
84
|
87
|
$Properties['MediaInfo'] = 'nil';
|
85
|
|
-$Properties['Screenshots'] = isset($_POST['screenshots']) ? $_POST['screenshots'] : "";
|
|
88
|
+$Properties['Screenshots'] = isset($_POST['screenshots']) ? $_POST['screenshots'] : '';
|
86
|
89
|
|
87
|
90
|
if ($_POST['album_desc']) {
|
88
|
91
|
$Properties['GroupDescription'] = trim($_POST['album_desc']);
|
|
@@ -168,7 +171,7 @@ switch ($Type) {
|
168
|
171
|
'title',
|
169
|
172
|
'0',
|
170
|
173
|
'string',
|
171
|
|
- 'Sequence Name must be between 1 and 300 characters.', # `torrents_group` limits
|
|
174
|
+ 'Torrent Title must be between 1 and 300 characters.', # `torrents_group` limits
|
172
|
175
|
array('maxlength'=>300, 'minlength'=>1)
|
173
|
176
|
);
|
174
|
177
|
$Validate->SetFields(
|
|
@@ -382,7 +385,7 @@ if (!isset($GroupID) || !$GroupID) {
|
382
|
385
|
// Needs to be here as it isn't set for add format until now
|
383
|
386
|
$LogName .= $T['Title'];
|
384
|
387
|
|
385
|
|
-// For notifications---take note now whether it's a new group
|
|
388
|
+// For notifications. Take note now whether it's a new group
|
386
|
389
|
$IsNewGroup = !isset($GroupID) || !$GroupID;
|
387
|
390
|
|
388
|
391
|
//----- Start inserts
|
|
@@ -447,10 +450,13 @@ if (!isset($GroupID) || !$GroupID) {
|
447
|
450
|
|
448
|
451
|
// Add screenshots
|
449
|
452
|
$Screenshots = explode("\n", $T['Screenshots']);
|
450
|
|
- $Screenshots = array_map("trim", $Screenshots);
|
|
453
|
+ $Screenshots = array_map('trim', $Screenshots);
|
|
454
|
+
|
451
|
455
|
$Screenshots = array_filter($Screenshots, function ($s) {
|
452
|
|
- return preg_match('/^'.IMAGE_REGEX.'$/i', $s);
|
|
456
|
+ return preg_match('/^'.DOI_REGEX.'$/i', $s);
|
|
457
|
+ #return preg_match('/^'.IMAGE_REGEX.'$/i', $s);
|
453
|
458
|
});
|
|
459
|
+
|
454
|
460
|
$Screenshots = array_unique($Screenshots);
|
455
|
461
|
$Screenshots = array_slice($Screenshots, 0, 10);
|
456
|
462
|
|
|
@@ -535,9 +541,9 @@ if ($DB->has_results()) {
|
535
|
541
|
}
|
536
|
542
|
}
|
537
|
543
|
|
538
|
|
-// Torrents over 100 GiB are neutral leech
|
|
544
|
+// Torrents over a size in bytes are neutral leech
|
539
|
545
|
// Download doesn't count, upload does
|
540
|
|
-if (($TotalSize > 107374182400)) { # 100 GiB
|
|
546
|
+if (($TotalSize > 53687091200)) { # 50 GiB
|
541
|
547
|
$T['FreeTorrent'] = '2';
|
542
|
548
|
$T['FreeLeechType'] = '2';
|
543
|
549
|
}
|
|
@@ -595,6 +601,7 @@ $Debug->set_flag('upload: ocelot updated');
|
595
|
601
|
$Cache->cache_value("torrent_{$TorrentID}_lock", true, 600);
|
596
|
602
|
|
597
|
603
|
// Give BP if necessary
|
|
604
|
+// @todo Repurpose this
|
598
|
605
|
if (($Type === "Movies" || $Type === "Anime") && ($T['Container'] === 'ISO' || $T['Container'] === 'M2TS' || $T['Container'] === 'VOB IFO')) {
|
599
|
606
|
$BPAmt = (int) 2*($TotalSize / (1024*1024*1024))*1000;
|
600
|
607
|
|
|
@@ -682,17 +689,21 @@ if (trim($T['Image']) !== '') {
|
682
|
689
|
if ($PublicTorrent) {
|
683
|
690
|
View::show_header('Warning'); ?>
|
684
|
691
|
<h1>Warning</h1>
|
685
|
|
-<p><strong>Your torrent has been uploaded - but you must re-download your torrent file from <a
|
686
|
|
- href="torrents.php?id=<?=$GroupID?>&torrentid=<?=$TorrentID?>">here</a>
|
687
|
|
- because the site modified it to make it private.</strong></p>
|
|
692
|
+<p>
|
|
693
|
+ <strong>Your torrent has been uploaded but you must re-download your torrent file from
|
|
694
|
+ <a href="torrents.php?id=<?=$GroupID?>&torrentid=<?=$TorrentID?>">here</a>
|
|
695
|
+ because the site modified it to make it private.</strong>
|
|
696
|
+</p>
|
688
|
697
|
<?php
|
689
|
698
|
View::show_footer();
|
690
|
699
|
} elseif ($UnsourcedTorrent) {
|
691
|
700
|
View::show_header('Warning'); ?>
|
692
|
701
|
<h1>Warning</h1>
|
693
|
|
-<p><strong>Your torrent has been uploaded - but you must re-download your torrent file from <a
|
694
|
|
- href="torrents.php?id=<?=$GroupID?>&torrentid=<?=$TorrentID?>">here</a>
|
695
|
|
- because the site modified it to add a source flag.</strong></p>
|
|
702
|
+<p>
|
|
703
|
+ <strong>Your torrent has been uploaded but you must re-download your torrent file from
|
|
704
|
+ <a href="torrents.php?id=<?=$GroupID?>&torrentid=<?=$TorrentID?>">here</a>
|
|
705
|
+ because the site modified it to add a source flag.</strong>
|
|
706
|
+</p>
|
696
|
707
|
<?php
|
697
|
708
|
View::show_footer();
|
698
|
709
|
} elseif ($RequestID) {
|