65535) bark("NFO is too big! Max 65,535 bytes."); $nfofilename = $nfofile['tmp_name']; if (@is_uploaded_file($nfofilename) && @filesize($nfofilename) > 0) $updateset[] = "nfo = " . sqlesc(str_replace("\x0d\x0d\x0a", "\x0d\x0a", file_get_contents($nfofilename))); } else if ($nfoaction == "remove") $updateset[] = "nfo = ''"; $descr = $_POST['descr']; $updateset[] = "name = " . sqlesc($name); $updateset[] = "description = " . sqlesc( strip_tags($smalldescr) ); $updateset[] = "search_text = " . sqlesc(searchfield("$shortfname $dname $torrent")); $updateset[] = "descr_parsed = " . sqlesc( format_comment($descr) ); $updateset[] = "descr = " . sqlesc( strip_tags($descr) ); $updateset[] = "ori_descr = " . sqlesc( strip_tags($descr) ); $updateset[] = "category = " . (0 + $type); if ($CURUSER["admin"] == "yes") { if ($_POST["banned"]) { $updateset[] = "banned = 'yes'"; $_POST["visible"] = 0; } else $updateset[] = "banned = 'no'"; } $updateset[] = "visible = '" . ($_POST["visible"] ? "yes" : "no") . "'"; $updateset[] = "forcevisible = '" . ($_POST["forcevisible"] ? "yes" : "no") . "'"; mysql_query("UPDATE torrents SET " . join(",", $updateset) . " WHERE id = $id"); write_log("Torrent $id ($name) was edited by ".(($CURUSER['anonymous'] == 'yes') ? 'Anonymous' : $CURUSER["username"])); $returl = "details.php?id=$id&edited=1"; if (isset($_POST["returnto"])) $returl .= "&returnto=" . htmlspecialchars($_POST["returnto"]); header("Refresh: 0; url=$returl"); ?>