bark("No NFO! for #3 torrent OR NFO #3 is too big! Max 65,535 bytes.");
 }
 $f4 = $_FILES["file4"];
 $nfofile4 = $_FILES['nfo4'];
 $fname[] = unesc($f4["name"]);
 if ($nfofile4['size'] > 65535) {
     bark("No NFO! for #4 torrent OR NFO #4 is too big! Max 65,535 bytes.");
 }
 $f5 = $_FILES["file5"];
 $nfofile5 = $_FILES['nfo5'];
 $fname[] = unesc($f5["name"]);
 if ($nfofile5['size'] > 65535) {
     bark("No NFO! #5 torrent OR NFO #5 is too big! Max 65,535 bytes.");
 }
 // some crucial checks
 if (!validfilename($fname[0]) || !validfilename($fname[1]) || !validfilename($fname[2]) || !validfilename($fname[3]) || !validfilename($fname[4])) {
     bark("One of the filenames was invalid!");
 }
 if (!preg_match('/^(.+)\\.torrent$/si', $fname[0], $matches[0])) {
     bark("Invalid filename 1(not a .torrent).");
 }
 if (!preg_match('/^(.+)\\.torrent$/si', $fname[1], $matches[1])) {
     bark("Invalid filename 2(not a .torrent).");
 }
 if (!preg_match('/^(.+)\\.torrent$/si', $fname[2], $matches[2])) {
     bark("Invalid filename 3(not a .torrent).");
 }
 if (!preg_match('/^(.+)\\.torrent$/si', $fname[3], $matches[3])) {
     bark("Invalid filename 4(not a .torrent).");
 }
 if (!preg_match('/^(.+)\\.torrent$/si', $fname[4], $matches[4])) {
Esempio n. 2
0
$descr = unesc($_POST["descr"]);
if (!$descr) {
    bark($lang_takeupload['std_blank_description']);
}
$catid = 0 + $_POST["type"];
$sourceid = 0 + $_POST["source_sel"];
$mediumid = 0 + $_POST["medium_sel"];
$codecid = 0 + $_POST["codec_sel"];
$standardid = 0 + $_POST["standard_sel"];
$processingid = 0 + $_POST["processing_sel"];
$teamid = 0 + $_POST["team_sel"];
$audiocodecid = 0 + $_POST["audiocodec_sel"];
if (!is_valid_id($catid)) {
    bark($lang_takeupload['std_category_unselected']);
}
if (!validfilename($fname)) {
    bark($lang_takeupload['std_invalid_filename']);
}
if (!preg_match('/^(.+)\\.torrent$/si', $fname, $matches)) {
    bark($lang_takeupload['std_filename_not_torrent']);
}
$shortfname = $torrent = $matches[1];
if (!empty($_POST["name"])) {
    $torrent = unesc($_POST["name"]);
}
if ($f['size'] > $max_torrent_size) {
    bark($lang_takeupload['std_torrent_file_too_big'] . number_format($max_torrent_size) . $lang_takeupload['std_remake_torrent_note']);
}
$tmpname = $f["tmp_name"];
if (!is_uploaded_file($tmpname)) {
    bark("eek");