diff --git a/app/Models/User.php b/app/Models/User.php index 51ce60b3..04776bb8 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -158,7 +158,7 @@ class User extends Authenticatable public function updateWithModComment(array $update, $modComment) { if (!$this->exists) { - throw new \RuntimeException('User not exists!'); + throw new \RuntimeException('This mehtod only works when user exists!'); } $update['modcomment'] = DB::raw("concat_ws('\n', $modComment, modcomment)"); return $this->update($update); diff --git a/include/cleanup.php b/include/cleanup.php index d7b8c97f..42103c91 100644 --- a/include/cleanup.php +++ b/include/cleanup.php @@ -348,7 +348,7 @@ function docleanup($forceAll = 0, $printProgress = false) { $res = sql_query("SELECT id, seeders, leechers, comments FROM torrents") or sqlerr(__FILE__, __LINE__); while ($row = mysql_fetch_assoc($res)) { $id = $row["id"]; - $torr = $torrents[$id]; + $torr = $torrents[$id] ?? []; foreach ($fields as $field) { if (!isset($torr[$field])) $torr[$field] = 0; @@ -924,9 +924,9 @@ function docleanup($forceAll = 0, $printProgress = false) { if (count($delids)) sql_query("DELETE FROM files WHERE torrent IN (" . join(",", $delids) . ")") or sqlerr(__FILE__, __LINE__); } while (0); + $log = "delete torrents that doesn't exist any more"; + do_log($log); if ($printProgress) { - $log = "delete torrents that doesn't exist any more"; - do_log($log); printProgress($log); } diff --git a/include/functions.php b/include/functions.php index 1f4e3059..c67b865a 100644 --- a/include/functions.php +++ b/include/functions.php @@ -2802,7 +2802,7 @@ function deletetorrent($id) { foreach(array("peers", "files", "comments") as $x) { sql_query("DELETE FROM $x WHERE torrent = ".mysql_real_escape_string($id)); } - unlink("$torrent_dir/$id.torrent"); + unlink(getFullDirectory("$torrent_dir/$id.torrent")); } function pager($rpp, $count, $href, $opts = array(), $pagename = "page") { diff --git a/public/delete.php b/public/delete.php index d3120bda..0dfb619a 100644 --- a/public/delete.php +++ b/public/delete.php @@ -33,7 +33,6 @@ $rt = intval($_POST["reasontype"] ?? 0); if (!is_int($rt) || $rt < 1 || $rt > 5) bark($lang_delete['std_invalid_reason']."$rt."); -$r = $_POST["r"]; $reason = $_POST["reason"]; if ($rt == 1) @@ -58,9 +57,9 @@ else deletetorrent($id); if ($row['anonymous'] == 'yes' && $CURUSER["id"] == $row["owner"]) { - write_log("Torrent $id ($row[name]) was deleted by its anonymous uploader ($reasonstr)",'normal'); + write_log("Torrent $id ({$row['name']}) was deleted by its anonymous uploader ($reasonstr)",'normal'); } else { - write_log("Torrent $id ($row[name]) was deleted by $CURUSER[username] ($reasonstr)",'normal'); + write_log("Torrent $id ({$row['name']}) was deleted by {$CURUSER['username']} ($reasonstr)",'normal'); } //===remove karma diff --git a/public/details.php b/public/details.php index 09b30faf..bc243799 100644 --- a/public/details.php +++ b/public/details.php @@ -282,7 +282,7 @@ else { { $dispname=substr($dispname, 0, $max_lenght_of_torrent_name) . ".."; } - + $other_source_info = $other_medium_info = $other_codec_info = $other_standard_info = $other_processing_info = ''; if (isset($copy_row["source_name"])) $other_source_info = $copy_row['source_name'].", "; if (isset($copy_row["medium_name"])) diff --git a/public/torrents.php b/public/torrents.php index 1e297d7f..4d369e5a 100644 --- a/public/torrents.php +++ b/public/torrents.php @@ -452,7 +452,7 @@ if (!$all) $addparam .= "audiocodec{$audiocodec['id']}=1&"; } } - } + } } // when one clicked the cat, source, etc. name/image elseif ($category_get) @@ -666,7 +666,7 @@ $wherebase = $wherea; $search_area = 0; if (isset($searchstr)) { - if (!$_GET['notnewword']){ + if (!isset($_GET['notnewword']) || !$_GET['notnewword']){ insert_suggest($searchstr, $CURUSER['id']); $notnewword=""; } @@ -926,14 +926,14 @@ if ($allsec != 1 || $enablespecial != 'yes'){ //do not print searchbox if showin ?> - + - + @@ -1092,7 +1092,7 @@ if ($count) { print($pagertop); if ($sectiontype == $browsecatmode) torrenttable($rows, "torrents"); - elseif ($sectiontype == $specialcatmode) + elseif ($sectiontype == $specialcatmode) torrenttable($rows, "music"); else torrenttable($rows, "bookmarks"); print($pagerbottom);
- +