diff --git a/aboutnexus.php b/aboutnexus.php index 4a172424..d8517764 100644 --- a/aboutnexus.php +++ b/aboutnexus.php @@ -23,11 +23,11 @@ begin_frame("".$lang_aboutnexus['text_authorization'] print ($lang_aboutnexus['text_authorization_note']); print ("

"); end_frame(); -unset($ppl); +$ppl = ''; $res = sql_query("SELECT * FROM language ORDER BY trans_state") or sqlerr(); while ($arr = mysql_fetch_assoc($res)) { - $ppl .= "\"".$arr[lang_name]."\" + $ppl .= "\"".$arr['lang_name']."\" ".$arr['lang_name']."". "".$arr['trans_state']."\n"; } @@ -38,7 +38,7 @@ print ($ppl); print (""); print ("

"); end_frame(); -unset($ppl); +$ppl = ''; $res = sql_query("SELECT * FROM stylesheets ORDER BY id") or sqlerr(); while ($arr = mysql_fetch_assoc($res)) { diff --git a/announce.php b/announce.php index a916958c..ccabe477 100644 --- a/announce.php +++ b/announce.php @@ -15,7 +15,7 @@ foreach (array("passkey","info_hash","peer_id","event") as $x) // get integer type port, downloaded, uploaded, left from client foreach (array("port","downloaded","uploaded","left","compact","no_peer_id") as $x) { - $GLOBALS[$x] = 0 + $_GET[$x]; + $GLOBALS[$x] = $_GET[$x] ?? 0; } //check info_hash, peer_id and passkey foreach (array("passkey","info_hash","peer_id","port","downloaded","uploaded","left") as $x) @@ -42,7 +42,7 @@ foreach(array("numwant", "num want", "num_want") as $k) { if (isset($_GET[$k])) { - $rsize = 0 + $_GET[$k]; + $rsize = $_GET[$k] ?? 0; break; } } diff --git a/cc98bar.php b/cc98bar.php index 96337de4..a1bf9df2 100644 --- a/cc98bar.php +++ b/cc98bar.php @@ -28,7 +28,7 @@ $db = preg_replace($pattern, "\\36", $_SERVER['REQUEST_URI']); $ds = preg_replace($pattern, "\\38", $_SERVER['REQUEST_URI']); $dx = preg_replace($pattern, "\\40", $_SERVER['REQUEST_URI']); $dy = preg_replace($pattern, "\\42", $_SERVER['REQUEST_URI']); -$bg = 0 + preg_replace($pattern, "\\44", $_SERVER['REQUEST_URI']); +$bg = (int)preg_replace($pattern, "\\44", $_SERVER['REQUEST_URI']); $id = preg_replace($pattern, "\\45", $_SERVER['REQUEST_URI']); $res = sql_query("SELECT username, uploaded, downloaded, class, privacy FROM users WHERE id=".sqlesc($id)." LIMIT 1"); diff --git a/comment.php b/comment.php index 4c96fd51..7622b14e 100644 --- a/comment.php +++ b/comment.php @@ -34,7 +34,7 @@ if ($action == "add") } } - $parent_id = 0 + $_POST["pid"]; + $parent_id = $_POST["pid"] ?? 0; int_check($parent_id,true); if($type == "torrent") @@ -105,12 +105,12 @@ if ($action == "add") die; } - $parent_id = 0 + $_GET["pid"]; + $parent_id = $_GET["pid"] ?? 0; int_check($parent_id,true); if($sub == "quote") { - $commentid = 0 + $_GET["cid"]; + $commentid = $_GET["cid"] ?? 0; int_check($commentid,true); $res2 = sql_query("SELECT comments.text, users.username FROM comments JOIN users ON comments.user = users.id WHERE comments.id=$commentid") or sqlerr(__FILE__, __LINE__); @@ -151,7 +151,7 @@ if ($action == "add") } elseif ($action == "edit") { - $commentid = 0 + $_GET["cid"]; + $commentid = $_GET["cid"] ?? 0; int_check($commentid,true); if($type == "torrent") @@ -211,7 +211,7 @@ elseif ($action == "delete") if (get_user_class() < $commanage_class) stderr($lang_comment['std_error'], $lang_comment['std_permission_denied']); - $commentid = 0 + $_GET["cid"]; + $commentid = $_GET["cid"] ?? 0; $sure = $_GET["sure"]; int_check($commentid,true); @@ -268,7 +268,7 @@ elseif ($action == "vieworiginal") if (get_user_class() < $commanage_class) stderr($lang_comment['std_error'], $lang_comment['std_permission_denied']); - $commentid = 0 + $_GET["cid"]; + $commentid = $_GET["cid"] ?? 0; int_check($commentid,true); if($type == "torrent") diff --git a/confirm_resend.php b/confirm_resend.php index 1dbefb35..82551ab9 100644 --- a/confirm_resend.php +++ b/confirm_resend.php @@ -3,7 +3,7 @@ require "include/bittorrent.php"; dbconn(); failedloginscheck ("Re-send",true); -$langid = 0 + $_GET['sitelanguage']; +$langid = $_GET['sitelanguage'] ?? 0; if ($langid) { $lang_folder = validlang($langid); diff --git a/confirmemail.php b/confirmemail.php index 26682ae4..838635f2 100644 --- a/confirmemail.php +++ b/confirmemail.php @@ -4,7 +4,7 @@ require_once("include/bittorrent.php"); if (!preg_match(':^/(\d{1,10})/([\w]{32})/(.+)$:', $_SERVER["PATH_INFO"], $matches)) httperr(); -$id = 0 + $matches[1]; +$id = $matches[1] ?? 0; $md5 = $matches[2]; $email = urldecode($matches[3]); //print($email); diff --git a/contactstaff.php b/contactstaff.php index 0534b05e..d15ae517 100644 --- a/contactstaff.php +++ b/contactstaff.php @@ -7,8 +7,8 @@ loggedinorreturn(); stdhead($lang_contactstaff['head_contact_staff'], false); begin_main_frame(); print("
"); -if ($_GET["returnto"] || $_SERVER["HTTP_REFERER"]) - print(""); +if (isset($_GET["returnto"]) && $_GET["returnto"] || $_SERVER["HTTP_REFERER"]) + print(""); begin_compose($lang_contactstaff['text_message_to_staff'], "new"); end_compose(); print("
"); diff --git a/details.php b/details.php index 9a7160af..a0ca6ce9 100644 --- a/details.php +++ b/details.php @@ -7,7 +7,7 @@ if ($showextinfo['imdb'] == 'yes') require_once("imdb/imdb.class.php"); loggedinorreturn(); -$id = 0 + $_GET["id"]; +$id = $_GET["id"] ?? 0; int_check($id); if (!isset($id) || !$id) diff --git a/fastdelete.php b/fastdelete.php index c740c050..ab181633 100644 --- a/fastdelete.php +++ b/fastdelete.php @@ -15,7 +15,7 @@ function bark($msg) { if (!mkglobal("id")) bark($lang_fastdelete['std_missing_form_data']); -$id = 0 + $id; +$id = $id ?? 0; int_check($id); $sure = $_GET["sure"]; diff --git a/forummanage.php b/forummanage.php index e3de29c8..5d87f118 100644 --- a/forummanage.php +++ b/forummanage.php @@ -3,13 +3,17 @@ require "include/bittorrent.php"; dbconn(); require_once(get_langfile_path()); loggedinorreturn(); +//lots of place use this variable +$prefix = ''; +$user = $CURUSER; +$PHP_SELF = $_SERVER['PHP_SELF']; if (get_user_class() < $forummanage_class) permissiondenied(); // DELETE FORUM ACTION -if ($_GET['action'] == "del") { - $id = 0 + $_GET['id']; +if (isset($_GET['action']) && $_GET['action'] == "del") { + $id = $_GET['id'] ?? 0; if (!$id) { header("Location: forummanage.php"); die(); @@ -30,7 +34,7 @@ if ($_GET['action'] == "del") { } //EDIT FORUM ACTION -elseif ($_POST['action'] == "editforum") { +elseif (isset($_POST['action']) && $_POST['action'] == "editforum") { $name = $_POST['name']; $desc = $_POST['desc']; $id = $_POST['id']; @@ -38,7 +42,7 @@ elseif ($_POST['action'] == "editforum") { header("Location: " . get_protocol_prefix() . "$BASEURL/forummanage.php"); die(); } - if ($_POST["moderator"]){ + if (!empty($_POST["moderator"])) { $moderator = $_POST["moderator"]; set_forum_moderators($moderator,$id); } @@ -53,7 +57,7 @@ elseif ($_POST['action'] == "editforum") { } //ADD FORUM ACTION -elseif ($_POST['action'] == "addforum") { +elseif (isset($_POST['action']) && $_POST['action'] == "addforum") { $name = ($_POST['name']); $desc = ($_POST['desc']); if (!$name && !$desc) { @@ -74,9 +78,9 @@ elseif ($_POST['action'] == "addforum") { // SHOW FORUMS WITH FORUM MANAGMENT TOOLS stdhead($lang_forummanage['head_forum_management']); begin_main_frame(); -if ($_GET['action'] == "editforum") { +if (isset($_GET['action']) && $_GET['action'] == "editforum") { //EDIT PAGE FOR THE FORUMS - $id = 0 + ($_GET["id"]); + $id = ($_GET["id"] ?? 0); $result = sql_query ("SELECT * FROM forums where id = ".sqlesc($id)); if ($row = mysql_fetch_array($result)) { do { @@ -183,7 +187,7 @@ $nr = mysql_num_rows($res); } } // -elseif ($_GET['action'] == "newforum"){ +elseif (isset($_GET['action']) && $_GET['action'] == "newforum"){ ?>

-->


diff --git a/forums.php b/forums.php index 3c236fa9..62799d75 100644 --- a/forums.php +++ b/forums.php @@ -164,7 +164,7 @@ function get_last_read_post_id($topicid) { } else $Cache->cache_value('user_'.$CURUSER['id'].'_last_read_post_list', 'no record', 900); } - if ($ret != "no record" && $ret[$topicid] && $CURUSER['last_catchup'] < $ret[$topicid]){ + if ($ret != "no record" && isset($ret[$topicid]) && $CURUSER['last_catchup'] < $ret[$topicid]){ return $ret[$topicid]; } elseif ($CURUSER['last_catchup']) @@ -329,7 +329,7 @@ if ($action == "post") } $id = $_POST["id"]; $type = $_POST["type"]; - $subject = $_POST["subject"]; + $subject = $_POST["subject"] ?? ''; $body = trim($_POST["body"]); $hassubject = false; switch ($type){ @@ -403,7 +403,7 @@ if ($action == "post") if ($forum_last_replied_topic_row && $forum_last_replied_topic_row['id'] == $topicid) $Cache->delete_value('forum_'.$forumid.'_last_replied_topic_content'); } - sql_query("UPDATE posts SET body=".sqlesc($body).", editdate=".sqlesc($date).", editedby=".sqlesc($CURUSER[id])." WHERE id=".sqlesc($id)) or sqlerr(__FILE__, __LINE__); + sql_query("UPDATE posts SET body=".sqlesc($body).", editdate=".sqlesc($date).", editedby=".sqlesc($CURUSER['id'])." WHERE id=".sqlesc($id)) or sqlerr(__FILE__, __LINE__); $postid = $id; $Cache->delete_value('post_'.$postid.'_content'); } @@ -470,12 +470,12 @@ if ($action == "post") if ($action == "viewtopic") { - $highlight = htmlspecialchars(trim($_GET["highlight"])); + $highlight = htmlspecialchars(trim($_GET["highlight"] ?? '')); - $topicid = 0+$_GET["topicid"]; + $topicid = $_GET["topicid"] ?? 0; int_check($topicid,true); - $page = $_GET["page"]; - $authorid = 0+$_GET["authorid"]; + $page = $_GET["page"] ?? ''; + $authorid = $_GET["authorid"] ?? 0; if ($authorid) { $where = "WHERE topicid=".sqlesc($topicid)." AND userid=".sqlesc($authorid); @@ -532,7 +532,7 @@ if ($action == "viewtopic") $pages = ceil($postcount / $perpage); - if ($page[0] == "p") + if (isset($page[0]) && $page[0] == "p") { $findpost = substr($page, 1); $res = sql_query("SELECT id FROM posts $where ORDER BY added") or sqlerr(__FILE__, __LINE__); @@ -635,7 +635,7 @@ if ($action == "viewtopic") if ($pn>=1) { if ($Advertisement->enable_ad()){ - if ($forumpostad[$pn-1]) + if (!empty($forumpostad[$pn-1])) echo "
".$forumpostad[$pn-1]."
"; } } @@ -735,11 +735,11 @@ if ($action == "viewtopic") print("\n"); print("\n"); print("\n"); print(""); print("\n"); print("
\n"); print("\n"); - print("\n"); + print("\n"); print("
\n"); print("\n"); - print("\n"); + print("\n"); print("
\n"); print("\n"); @@ -796,7 +796,7 @@ if ($action == "viewtopic") "); print(""); - print("\n"); + print("\n"); print("
\n"); @@ -988,7 +988,7 @@ if ($action == "deletepost") if ($action == "setlocked") { - $topicid = 0 + $_POST["topicid"]; + $topicid = $_POST["topicid"] ?? 0; $ismod = is_forum_moderator($topicid,'topic'); if (!$topicid || (get_user_class() < $postmanage_class && !$ismod)) permissiondenied(); @@ -1002,7 +1002,7 @@ if ($action == "setlocked") if ($action == 'hltopic') { - $topicid = 0 + $_GET["topicid"]; + $topicid = $_GET["topicid"] ?? 0; $ismod = is_forum_moderator($topicid,'topic'); if (!$topicid || (get_user_class() < $postmanage_class && !$ismod)) permissiondenied(); @@ -1022,9 +1022,9 @@ if ($action == 'hltopic') if ($action == "setsticky") { - $topicid = 0 + $_POST["topicid"]; + $topicid = $_POST["topicid"] ?? 0; $ismod = is_forum_moderator($topicid,'topic'); - if (!topicid || (get_user_class() < $postmanage_class && !$ismod)) + if (!$topicid || (get_user_class() < $postmanage_class && !$ismod)) permissiondenied(); $sticky = sqlesc($_POST["sticky"]); @@ -1052,7 +1052,7 @@ if ($action == "viewforum") $forumname = $row['name']; $forummoderators = get_forum_moderators($forumid,false); - $search = mysql_real_escape_string(trim($_GET["search"])); + $search = mysql_real_escape_string(trim($_GET["search"] ?? '')); if ($search){ $wherea = " AND subject LIKE '%$search%'"; $addparam .= "&search=".rawurlencode($search); @@ -1064,7 +1064,7 @@ if ($action == "viewforum") $num = get_row_count("topics","WHERE forumid=".sqlesc($forumid).$wherea); list($pagertop, $pagerbottom, $limit) = pager($topicsperpage, $num, "?"."action=viewforum&forumid=".$forumid.$addparam."&"); - if ($_GET["sort"]){ + if (isset($_GET["sort"])){ switch ($_GET["sort"]){ case 'firstpostasc': { @@ -1121,7 +1121,7 @@ if ($action == "viewforum") { print(""); - print("\n"); + print("\n"); print("\n"); $counter = 0; @@ -1179,8 +1179,8 @@ if ($action == "viewforum") //---- Get userID and date of last post $arr = get_post_row($topicarr['lastpost']); - $lppostid = 0 + $arr["id"]; - $lpuserid = 0 + $arr["userid"]; + $lppostid = $arr["id"] ?? 0; + $lpuserid = $arr["userid"] ?? 0; $lpusername = get_username($lpuserid); $lpadded = gettime($arr["added"],true,false); $onmouseover = ""; @@ -1196,7 +1196,7 @@ if ($action == "viewforum") } $arr = get_post_row($topicarr['firstpost']); - $fpuserid = 0 + $arr["userid"]; + $fpuserid = $arr["userid"] ?? 0; $fpauthor = get_username($arr["userid"]); $subject = ($sticky ? "\"Sticky\"  " : "") . "" .highlight_topic(highlight($search,htmlspecialchars($topicarr["subject"])), $hlcolor) . "".$topicpages; @@ -1263,7 +1263,7 @@ if ($action == "viewunread") { $userid = $CURUSER['id']; - $beforepostid = 0+$_GET['beforepostid']; + $beforepostid = $_GET['beforepostid'] ?? 0; $maxresults = 25; $res = sql_query("SELECT id, forumid, subject, lastpost, hlcolor FROM topics WHERE lastpost > ".$CURUSER['last_catchup'].($beforepostid ? " AND lastpost < ".sqlesc($beforepostid) : "")." ORDER BY lastpost DESC LIMIT 100") or sqlerr(__FILE__, __LINE__); @@ -1332,7 +1332,7 @@ if ($action == "search") $res = sql_query("SELECT COUNT(posts.id) FROM posts LEFT JOIN topics ON posts.topicid = topics.id LEFT JOIN forums ON topics.forumid = forums.id WHERE forums.minclassread <= ".sqlesc(get_user_class())." AND ((topics.subject $extraSql AND posts.id=topics.firstpost) OR posts.body $extraSql)") or sqlerr(__FILE__, __LINE__); $arr = mysql_fetch_row($res); - $hits = 0 + $arr[0]; + $hits = $arr[0] ?? 0; if ($hits){ $error = false; $found = "[ ".$lang_forums['text_found'].$hits.$lang_forums['text_num_posts']." ]"; @@ -1445,7 +1445,7 @@ foreach ($overforums as $a) continue; if ($count>=1) if ($Advertisement->enable_ad()){ - if ($interoverforumsad[$count-1]) + if (!empty($interoverforumsad[$count-1])) echo ""; } $forid = $a["id"]; diff --git a/image.php b/image.php index cbd52995..e25a8c72 100644 --- a/image.php +++ b/image.php @@ -9,6 +9,7 @@ if($action == "regimage") $sql = sql_query($query); $regimage = mysql_fetch_array($sql); $imagestring = $regimage['imagestring']; + $space = $newstring = ''; for($i=0;$i"); } function format_urls($text, $newWindow = false) { - return preg_replace("/((https?|ftp|gopher|news|telnet|mms|rtsp):\/\/[^()\[\]<>\s]+)/ei", - "formatUrl('\\1', ".($newWindow==true ? 1 : 0).", '', 'faqlink')", $text); +// return preg_replace("/((https?|ftp|gopher|news|telnet|mms|rtsp):\/\/[^()\[\]<>\s]+)/ei", "formatUrl('\\1', ".($newWindow==true ? 1 : 0).", '', 'faqlink')", $text); + return preg_replace_callback("/((https?|ftp|gopher|news|telnet|mms|rtsp):\/\/[^()\[\]<>\s]+)/i", function ($matches) use ($newWindow) { + return formatUrl($matches[1], ".($newWindow==true ? 1 : 0).", '', 'faqlink'); + }, $text); } function format_comment($text, $strip_html = true, $xssclean = false, $newtab = false, $imageresizer = true, $image_max_width = 700, $enableimage = true, $enableflash = true , $imagenum = -1, $image_max_height = 0, $adid = 0) { @@ -267,7 +269,10 @@ function format_comment($text, $strip_html = true, $xssclean = false, $newtab = $s = nl2br($s); if (strpos($s,"[code]") !== false && strpos($s,"[/code]") !== false) { - $s = preg_replace("/\[code\](.+?)\[\/code\]/eis","formatCode('\\1')", $s); +// $s = preg_replace("/\[code\](.+?)\[\/code\]/eis","formatCode('\\1')", $s); + $s = preg_replace_callback("/\[code\](.+?)\[\/code\]/is",function ($matches) { + return formatCode($matches[1]); + }, $s); } $originalBbTagArray = array('[siteurl]', '[site]','[*]', '[b]', '[/b]', '[i]', '[/i]', '[u]', '[/u]', '[pre]', '[/pre]', '[/color]', '[/font]', '[/size]', " "); @@ -304,7 +309,10 @@ function format_comment($text, $strip_html = true, $xssclean = false, $newtab = // [flash,500,400]http://www/image.swf[/flash] if (strpos($s,"[flash") !== false) { //flash is not often used. Better check if it exist before hand if ($enableflash) { - $s = preg_replace("/\[flash(\,([1-9][0-9]*)\,([1-9][0-9]*))?\]((http|ftp):\/\/[^\s'\"<>]+(\.(swf)))\[\/flash\]/ei", "formatFlash('\\4', '\\2', '\\3')", $s); +// $s = preg_replace("/\[flash(\,([1-9][0-9]*)\,([1-9][0-9]*))?\]((http|ftp):\/\/[^\s'\"<>]+(\.(swf)))\[\/flash\]/ei", "formatFlash('\\4', '\\2', '\\3')", $s); + $s = preg_replace_callback("/\[flash(\,([1-9][0-9]*)\,([1-9][0-9]*))?\]((http|ftp):\/\/[^\s'\"<>]+(\.(swf)))\[\/flash\]/i", function ($matches) { + return formatFlash($matches[4], $matches[2], $matches[3]); + }, $s); } else { $s = preg_replace("/\[flash(\,([1-9][0-9]*)\,([1-9][0-9]*))?\]((http|ftp):\/\/[^\s'\"<>]+(\.(swf)))\[\/flash\]/i", '', $s); } @@ -312,7 +320,10 @@ function format_comment($text, $strip_html = true, $xssclean = false, $newtab = //[flv,320,240]http://www/a.flv[/flv] if (strpos($s,"[flv") !== false) { //flv is not often used. Better check if it exist before hand if ($enableflash) { - $s = preg_replace("/\[flv(\,([1-9][0-9]*)\,([1-9][0-9]*))?\]((http|ftp):\/\/[^\s'\"<>]+(\.(flv)))\[\/flv\]/ei", "formatFlv('\\4', '\\2', '\\3')", $s); +// $s = preg_replace("/\[flv(\,([1-9][0-9]*)\,([1-9][0-9]*))?\]((http|ftp):\/\/[^\s'\"<>]+(\.(flv)))\[\/flv\]/ei", "formatFlv('\\4', '\\2', '\\3')", $s); + $s = preg_replace_callback("/\[flv(\,([1-9][0-9]*)\,([1-9][0-9]*))?\]((http|ftp):\/\/[^\s'\"<>]+(\.(flv)))\[\/flv\]/i", function ($matches) { + return formatFlv($matches[4], $matches[2], $matches[3]); + }, $s); } else { $s = preg_replace("/\[flv(\,([1-9][0-9]*)\,([1-9][0-9]*))?\]((http|ftp):\/\/[^\s'\"<>]+(\.(flv)))\[\/flv\]/i", '', $s); } @@ -320,14 +331,22 @@ function format_comment($text, $strip_html = true, $xssclean = false, $newtab = // [url=http://www.example.com]Text[/url] if ($adid) { - $s = preg_replace("/\[url=([^\[\s]+?)\](.+?)\[\/url\]/ei", "formatAdUrl(".$adid." ,'\\1', '\\2', ".($newtab==true ? 1 : 0).", 'faqlink')", $s); +// $s = preg_replace("/\[url=([^\[\s]+?)\](.+?)\[\/url\]/ei", "formatAdUrl(".$adid." ,'\\1', '\\2', ".($newtab==true ? 1 : 0).", 'faqlink')", $s); + $s = preg_replace_callback("/\[url=([^\[\s]+?)\](.+?)\[\/url\]/i", function ($matches) use ($adid, $newtab) { + return formatAdUrl(".$adid." ,$matches[1], $matches[2], ".($newtab==true ? 1 : 0).", 'faqlink'); + }, $s); } else { - $s = preg_replace("/\[url=([^\[\s]+?)\](.+?)\[\/url\]/ei", "formatUrl('\\1', ".($newtab==true ? 1 : 0).", '\\2', 'faqlink')", $s); +// $s = preg_replace("/\[url=([^\[\s]+?)\](.+?)\[\/url\]/ei", "formatUrl('\\1', ".($newtab==true ? 1 : 0).", '\\2', 'faqlink')", $s); + $s = preg_replace_callback("/\[url=([^\[\s]+?)\](.+?)\[\/url\]/i", function ($matches) use ($newtab) { + return formatUrl($matches[1], ".($newtab==true ? 1 : 0).", $matches[2], 'faqlink'); + }, $s); } // [url]http://www.example.com[/url] - $s = preg_replace("/\[url\]([^\[\s]+?)\[\/url\]/ei", - "formatUrl('\\1', ".($newtab==true ? 1 : 0).", '', 'faqlink')", $s); +// $s = preg_replace("/\[url\]([^\[\s]+?)\[\/url\]/ei", "formatUrl('\\1', ".($newtab==true ? 1 : 0).", '', 'faqlink')", $s); + $s = preg_replace_callback("/\[url\]([^\[\s]+?)\[\/url\]/i", function ($matches) use ($newtab) { + return formatUrl($matches[1], ".($newtab==true ? 1 : 0).", '', 'faqlink'); + }, $s); $s = format_urls($s, $newtab); // Quotes @@ -335,9 +354,12 @@ function format_comment($text, $strip_html = true, $xssclean = false, $newtab = $s = format_quotes($s); } - $s = preg_replace("/\[em([1-9][0-9]*)\]/ie", "(\\1 < 192 ? '\"[em\\1]\"' : '[em\\1]')", $s); +// $s = preg_replace("/\[em([1-9][0-9]*)\]/ie", "(\\1 < 192 ? '\"[em\\1]\"' : '[em\\1]')", $s); + $s = preg_replace_callback("/\[em([1-9][0-9]*)\]/i", function ($matches) { + return $matches[1] < 192 ? '[em' . $matches[1] . ']' : '[em' . $matches[1] . ']'; + }, $s); reset($tempCode); - $j = 0; + $j = $i = 0; while(count($tempCode) || $j > 5) { foreach($tempCode as $key=>$code) { $s = str_replace("", $code, $s, $count); @@ -1506,7 +1528,7 @@ function registration_check($type = "invitesystem", $maxuserscheck = true, $ipch function random_str($length="6") { $set = array("A","B","C","D","E","F","G","H","P","R","M","N","1","2","3","4","5","6","7","8","9"); - $str; + $str = ''; for($i=1;$i<=$length;$i++) { $ch = rand(0, count($set)-1); @@ -4049,7 +4071,7 @@ function get_ratio($userid, $html = true){ function add_s($num, $es = false) { global $lang_functions; - return ($num > 1 ? ($es ? $lang_functions['text_es'] : $lang_functions['text_s']) : ""); + return ($num > 1 ? ($es ? ($lang_functions['text_es'] ?? '') : $lang_functions['text_s']) : ""); } function is_or_are($num) @@ -4182,7 +4204,7 @@ function get_forum_moderators($forumid, $plaintext = true) } $Cache->cache_value('forum_moderator_array', $moderatorsArray, 86200); } - $ret = (array)$moderatorsArray[$forumid]; + $ret = $moderatorsArray[$forumid] ?? []; $moderators = ""; foreach($ret as $userid) { diff --git a/invite.php b/invite.php index 296cb258..6fd5305b 100644 --- a/invite.php +++ b/invite.php @@ -4,7 +4,7 @@ dbconn(); require_once(get_langfile_path()); loggedinorreturn(); parked(); -$id = 0 + $_GET["id"]; +$id = $_GET["id"] ?? 0; $type = unesc($_GET["type"] ?? ''); registration_check('invitesystem',true,false); diff --git a/iphistory.php b/iphistory.php index 8a2f593f..1e9a30a1 100644 --- a/iphistory.php +++ b/iphistory.php @@ -23,7 +23,7 @@ $perpage = 20; $ipcountres = sql_query("SELECT COUNT(DISTINCT(access)) FROM iplog WHERE userid = $userid"); $ipcountres = mysql_fetch_row($ipcountres); $countrows = $ipcountres[0]+1; -$order = $_GET['order']; +$order = $_GET['order'] ?? ''; list($pagertop, $pagerbottom, $limit) = pager($perpage, $countrows, "iphistory.php?id=$userid&order=$order&"); diff --git a/ipsearch.php b/ipsearch.php index a10987af..aa99be4a 100644 --- a/ipsearch.php +++ b/ipsearch.php @@ -18,7 +18,7 @@ else } } - $mask = trim($_GET['mask']); + $mask = trim($_GET['mask'] ?? ''); if ($mask == "" || $mask == "255.255.255.255") { $where1 = "u.ip = '$ip'"; @@ -54,7 +54,7 @@ else begin_main_frame(); print("

".$lang_ipsearch['text_search_ip_history']."

\n"); - print("
"); + print(""); print("
".$lang_forums['col_topic']."".$lang_forums['col_author']."".$lang_forums['col_replies']."/".$lang_forums['col_views']."".$lang_forums['col_last_post']."
".$lang_forums['col_topic']."".$lang_forums['col_author']."".$lang_forums['col_replies']."/".$lang_forums['col_views']."".$lang_forums['col_last_post']."
".$interoverforumsad[$count-1]."
\n"); tr($lang_ipsearch['row_ip']."*", "", 1); tr("".$lang_ipsearch['row_subnet_mask']."", "", 1); @@ -81,8 +81,8 @@ GROUP BY u.id die; } - $order = $_GET['order']; - $page = 0 + $_GET["page"]; + $order = $_GET['order'] ?? ''; + $page = $_GET["page"] ?? 0; $perpage = 20; list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, "$_SERVER[PHP_SELF]?ip=$ip&mask=$mask&order=$order&"); diff --git a/login.php b/login.php index fe950a3a..4bf20ca8 100644 --- a/login.php +++ b/login.php @@ -2,7 +2,7 @@ require_once("include/bittorrent.php"); dbconn(); -$langid = 0 + $_GET['sitelanguage']; +$langid = $_GET['sitelanguage'] ?? 0; if ($langid) { $lang_folder = validlang($langid); diff --git a/modtask.php b/modtask.php index 23e8ba42..dde81221 100644 --- a/modtask.php +++ b/modtask.php @@ -26,12 +26,12 @@ if ($action == "confirmuser") if ($action == "edituser") { $userid = $_POST["userid"]; - $class = 0 + $_POST["class"]; + $class = $_POST["class"] ?? 0; $vip_added = ($_POST["vip_added"] == 'yes' ? 'yes' : 'no'); $vip_until = ($_POST["vip_until"] ? $_POST["vip_until"] : '0000-00-00 00:00:00'); $warned = $_POST["warned"]; - $warnlength = 0 + $_POST["warnlength"]; + $warnlength = $_POST["warnlength"] ?? 0; $warnpm = $_POST["warnpm"]; $title = $_POST["title"]; $avatar = $_POST["avatar"]; diff --git a/moforums.php b/moforums.php index 2b4f93cf..e22ce8ce 100644 --- a/moforums.php +++ b/moforums.php @@ -7,8 +7,11 @@ if (get_user_class() < $forummanage_class) permissiondenied(); //Presets -$act = $_GET['action']; -$id = 0 + $_GET['id']; +$act = $_GET['action'] ?? ''; +$id = $_GET['id'] ?? 0; +$PHP_SELF = $_SERVER['PHP_SELF']; +$user = $CURUSER; +$prefix = ''; if (!$act) { $act = "forum"; @@ -28,7 +31,7 @@ die(); } //EDIT FORUM ACTION -if ($_POST['action'] == "editforum") { +if (isset($_POST['action']) && $_POST['action'] == "editforum") { if (get_user_class() < $forummanage_class) permissiondenied(); @@ -44,7 +47,7 @@ die(); } //ADD FORUM ACTION -if ($_POST['action'] == "addforum") { +if (isset($_POST['action']) && $_POST['action'] == "addforum") { if (get_user_class() < $forummanage_class) permissiondenied(); @@ -133,7 +136,7 @@ $nr = mysql_num_rows($res); print(" diff --git a/mybar.php b/mybar.php index 6da051c5..4c635291 100644 --- a/mybar.php +++ b/mybar.php @@ -1,8 +1,8 @@ =0 && $_GET['namered']<=255) - $namered = 0 + $_GET['namered']; + $namered = $_GET['namered'] ?? 0; else $namered=255; if (isset($_GET['namegreen']) && $_GET['namegreen']>=0 && $_GET['namegreen']<=255) - $namegreen = 0 + $_GET['namegreen']; + $namegreen = $_GET['namegreen'] ?? 0; else $namegreen=255; if (isset($_GET['nameblue']) && $_GET['nameblue']>=0 && $_GET['nameblue']<=255) - $nameblue = 0 + $_GET['nameblue']; + $nameblue = $_GET['nameblue'] ?? 0; else $nameblue=255; if (isset($_GET['namesize']) && $_GET['namesize']>=1 && $_GET['namesize']<=5) - $namesize = 0 + $_GET['namesize']; + $namesize = $_GET['namesize'] ?? 0; else $namesize=3; if (isset($_GET['namex']) && $_GET['namex']>=0 && $_GET['namex']<=350) - $namex = 0 + $_GET['namex']; + $namex = $_GET['namex'] ?? 0; else $namex=10; if (isset($_GET['namey']) && $_GET['namey']>=0 && $_GET['namey']<=19) - $namey = 0 + $_GET['namey']; + $namey = $_GET['namey'] ?? 0; else $namey=3; $name_colour = imagecolorallocate($my_img, $namered, $namegreen, $nameblue); imagestring($my_img, $namesize, $namex, $namey, $username, $name_colour); @@ -51,22 +51,22 @@ if (!$_GET['noname']) if (!$_GET['noup']) { if (isset($_GET['upred']) && $_GET['upred']>=0 && $_GET['upred']<=255) - $upred = 0 + $_GET['upred']; + $upred = $_GET['upred'] ?? 0; else $upred=0; if (isset($_GET['upgreen']) && $_GET['upgreen']>=0 && $_GET['upgreen']<=255) - $upgreen = 0 + $_GET['upgreen']; + $upgreen = $_GET['upgreen'] ?? 0; else $upgreen=255; if (isset($_GET['upblue']) && $_GET['upblue']>=0 && $_GET['upblue']<=255) - $upblue = 0 + $_GET['upblue']; + $upblue = $_GET['upblue'] ?? 0; else $upblue=0; if (isset($_GET['upsize']) && $_GET['upsize']>=1 && $_GET['upsize']<=5) - $upsize = 0 + $_GET['upsize']; + $upsize = $_GET['upsize'] ?? 0; else $upsize=3; if (isset($_GET['upx']) && $_GET['upx']>=0 && $_GET['upx']<=350) - $upx = 0 + $_GET['upx']; + $upx = $_GET['upx'] ?? 0; else $upx=100; if (isset($_GET['upy']) && $_GET['upy']>=0 && $_GET['upy']<=19) - $upy = 0 + $_GET['upy']; + $upy = $_GET['upy'] ?? 0; else $upy=3; $up_colour = imagecolorallocate($my_img, $upred, $upgreen, $upblue); imagestring($my_img, $upsize, $upx, $upy, $uploaded, $up_colour); @@ -75,22 +75,22 @@ if (!$_GET['noup']) if (!$_GET['nodown']) { if (isset($_GET['downred']) && $_GET['downred']>=0 && $_GET['downred']<=255) - $downred = 0 + $_GET['downred']; + $downred = $_GET['downred'] ?? 0; else $downred=255; if (isset($_GET['downgreen']) && $_GET['downgreen']>=0 && $_GET['downgreen']<=255) - $downgreen = 0 + $_GET['downgreen']; + $downgreen = $_GET['downgreen'] ?? 0; else $downgreen=0; if (isset($_GET['downblue']) && $_GET['downblue']>=0 && $_GET['downblue']<=255) - $downblue = 0 + $_GET['downblue']; + $downblue = $_GET['downblue'] ?? 0; else $downblue=0; if (isset($_GET['downsize']) && $_GET['downsize']>=1 && $_GET['downsize']<=5) - $downsize = 0 + $_GET['downsize']; + $downsize = $_GET['downsize'] ?? 0; else $downsize=3; if (isset($_GET['downx']) && $_GET['downx']>=0 && $_GET['downx']<=350) - $downx = 0 + $_GET['downx']; + $downx = $_GET['downx'] ?? 0; else $downx=180; if (isset($_GET['downy']) && $_GET['downy']>=0 && $_GET['downy']<=19) - $downy = 0 + $_GET['downy']; + $downy = $_GET['downy']; else $downy=3; $down_colour = imagecolorallocate($my_img, $downred, $downgreen, $downblue); imagestring($my_img, $downsize, $downx, $downy, $downloaded, $down_colour); diff --git a/offers.php b/offers.php index ae737627..995b543f 100644 --- a/offers.php +++ b/offers.php @@ -22,7 +22,7 @@ if (isset($_GET['category']) && $_GET["category"]){ } if (isset($_GET['id']) && $_GET["id"]){ - $id = 0 + htmlspecialchars($_GET["id"]); + $id = htmlspecialchars($_GET["id"] ?? 0); if (preg_match('/^[0-9]+$/', !$id)) stderr($lang_offers['std_error'], $lang_offers['std_smell_rat']); } @@ -31,7 +31,7 @@ if (isset($_GET['id']) && $_GET["id"]){ if (isset($_GET['add_offer']) && $_GET["add_offer"]){ if (get_user_class() < $addoffer_class) permissiondenied(); - $add_offer = 0 + $_GET["add_offer"]; + $add_offer = $_GET["add_offer"] ?? 0; if($add_offer != '1') stderr($lang_offers['std_error'], $lang_offers['std_smell_rat']); @@ -63,11 +63,11 @@ if (isset($_GET['add_offer']) && $_GET["add_offer"]){ if (isset($_GET['new_offer']) && $_GET["new_offer"]){ if (get_user_class() < $addoffer_class) permissiondenied(); - $new_offer = 0 + $_GET["new_offer"]; + $new_offer = $_GET["new_offer"] ?? 0; if($new_offer != '1') stderr($lang_offers['std_error'], $lang_offers['std_smell_rat']); - $userid = 0 + $CURUSER["id"]; + $userid = $CURUSER["id"] ?? 0; if (preg_match("/^[0-9]+$/", !$userid)) stderr($lang_offers['std_error'], $lang_offers['std_smell_rat']); @@ -75,7 +75,7 @@ if (isset($_GET['new_offer']) && $_GET["new_offer"]){ if ($name == "") bark($lang_offers['std_must_enter_name']); - $cat = (0 + $_POST["type"]); + $cat = ($_POST["type"] ?? 0); if (!is_valid_id($cat)) bark($lang_offers['std_must_select_category']); @@ -101,7 +101,7 @@ if (isset($_GET['new_offer']) && $_GET["new_offer"]){ //===end $ret = sql_query("INSERT INTO offers (userid, name, descr, category, added) VALUES (" . - implode(",", array_map("sqlesc", array($CURUSER["id"], $name, $descr, 0 + $_POST["type"]))) . + implode(",", array_map("sqlesc", array($CURUSER["id"], $name, $descr, $_POST["type"] ?? 0))) . ", '" . date("Y-m-d H:i:s") . "')"); if (!$ret) { if (mysql_errno() == 1062) @@ -127,7 +127,7 @@ if (isset($_GET['new_offer']) && $_GET["new_offer"]){ //=== offer details if (isset($_GET['off_details']) && $_GET["off_details"]){ - $off_details = 0 + $_GET["off_details"]; + $off_details = $_GET["off_details"] ?? 0; if($off_details != '1') stderr($lang_offers['std_error'], $lang_offers['std_smell_rat']); @@ -238,13 +238,13 @@ if (isset($_GET["allow_offer"]) && $_GET["allow_offer"]) { if (get_user_class() < $offermanage_class) stderr($lang_offers['std_access_denied'], $lang_offers['std_mans_job']); - $allow_offer = 0 + $_GET["allow_offer"]; + $allow_offer = $_GET["allow_offer"] ?? 0; if($allow_offer != '1') stderr($lang_offers['std_error'], $lang_offers['std_smell_rat']); //=== to allow the offer credit to S4NE for this next bit :) //if ($_POST["offerid"]){ - $offid = 0 + $_POST["offerid"]; + $offid = $_POST["offerid"] ?? 0; if(!is_valid_id($offid)) stderr($lang_offers['std_error'], $lang_offers['std_smell_rat']); @@ -273,11 +273,11 @@ if (isset($_GET["finish_offer"]) && $_GET["finish_offer"]) { if (get_user_class() < $offermanage_class) stderr($lang_offers['std_access_denied'], $lang_offers['std_have_no_permission']); - $finish_offer = 0 + $_GET["finish_offer"]; + $finish_offer = $_GET["finish_offer"] ?? 0; if($finish_offer != '1') stderr($lang_offers['std_error'], $lang_offers['std_smell_rat']); - $offid = 0 + $_POST["finish"]; + $offid = $_POST["finish"] ?? 0; if(!is_valid_id($offid)) stderr($lang_offers['std_error'], $lang_offers['std_smell_rat']); @@ -323,11 +323,11 @@ if (isset($_GET["finish_offer"]) && $_GET["finish_offer"]) { if (isset($_GET["edit_offer"]) && $_GET["edit_offer"]) { - $edit_offer = 0 + $_GET["edit_offer"]; + $edit_offer = $_GET["edit_offer"] ?? 0; if($edit_offer != '1') stderr($lang_offers['std_error'], $lang_offers['std_smell_rat']); - $id = 0 + $_GET["id"]; + $id = $_GET["id"] ?? 0; $res = sql_query("SELECT * FROM offers WHERE id = $id") or sqlerr(__FILE__, __LINE__); $num = mysql_fetch_array($res); @@ -369,11 +369,11 @@ if (isset($_GET["edit_offer"]) && $_GET["edit_offer"]) { //==== take offer edit if (isset($_GET["take_off_edit"]) && $_GET["take_off_edit"]){ - $take_off_edit = 0 + $_GET["take_off_edit"]; + $take_off_edit = $_GET["take_off_edit"] ?? 0; if($take_off_edit != '1') stderr($lang_offers['std_error'], $lang_offers['std_smell_rat']); - $id = 0 + $_GET["id"]; + $id = $_GET["id"] ?? 0; $res = sql_query("SELECT userid FROM offers WHERE id = $id") or sqlerr(__FILE__, __LINE__); $num = mysql_fetch_array($res); @@ -395,7 +395,7 @@ if (isset($_GET["take_off_edit"]) && $_GET["take_off_edit"]){ bark($lang_offers['std_must_enter_name']); if (!$descr) bark($lang_offers['std_must_enter_description']); - $cat = (0 + $_POST["category"]); + $cat = ($_POST["category"] ?? 0); if (!is_valid_id($cat)) bark($lang_offers['std_must_select_category']); @@ -412,11 +412,11 @@ if (isset($_GET["take_off_edit"]) && $_GET["take_off_edit"]){ //=== offer votes list if (isset($_GET["offer_vote"]) && $_GET["offer_vote"]){ - $offer_vote = 0 + $_GET["offer_vote"]; + $offer_vote = $_GET["offer_vote"] ?? 0; if($offer_vote != '1') stderr($lang_offers['std_error'], $lang_offers['std_smell_rat']); - $offerid = 0 + htmlspecialchars($_GET[id]); + $offerid = htmlspecialchars($_GET['id'] ?? 0); $res2 = sql_query("SELECT COUNT(*) FROM offervotes WHERE offerid = ".sqlesc($offerid)) or sqlerr(__FILE__, __LINE__); $row = mysql_fetch_array($res2); @@ -459,7 +459,7 @@ if (isset($_GET["offer_vote"]) && $_GET["offer_vote"]){ //=== offer votes if (isset($_GET["vote"]) && $_GET["vote"]){ - $offerid = 0 + htmlspecialchars($_GET["id"]); + $offerid = htmlspecialchars($_GET["id"] ?? 0); $vote = htmlspecialchars($_GET["vote"]); if ($vote == 'against' && get_user_class() < $againstoffer_class) stderr($lang_offers['std_error'], $lang_offers['std_smell_rat']); @@ -532,13 +532,13 @@ if (isset($_GET["vote"]) && $_GET["vote"]){ //=== delete offer if (isset($_GET["del_offer"]) && $_GET["del_offer"]){ - $del_offer = 0 + $_GET["del_offer"]; + $del_offer = $_GET["del_offer"] ?? 0; if($del_offer != '1') stderr($lang_offers['std_error'], $lang_offers['std_smell_rat']); - $offer = 0 + $_GET["id"]; + $offer = $_GET["id"] ?? 0; - $userid = 0 + $CURUSER["id"]; + $userid = $CURUSER["id"] ?? 0; if (!is_valid_id($userid)) stderr($lang_offers['std_error'], $lang_offers['std_smell_rat']); @@ -554,7 +554,7 @@ if (isset($_GET["del_offer"]) && $_GET["del_offer"]){ { $sure = $_GET["sure"]; if($sure == '0' || $sure == '1') - $sure = 0 + $_GET["sure"]; + $sure = $_GET["sure"] ?? 0; else stderr($lang_offers['std_error'], $lang_offers['std_smell_rat']); } @@ -604,7 +604,7 @@ if (isset($_GET["sort"]) && $_GET["sort"]) $categ = $_GET["category"] ?? 0; $offerorid = 0; if (isset($_GET["offerorid"]) && $_GET["offerorid"]){ - $offerorid = 0 + htmlspecialchars($_GET["offerorid"]); + $offerorid = htmlspecialchars($_GET["offerorid"] ?? 0); if (preg_match("/^[0-9]+$/", !$offerorid)) stderr($lang_offers['std_error'], $lang_offers['std_smell_rat']); } diff --git a/recover.php b/recover.php index feb1b241..a53943e3 100644 --- a/recover.php +++ b/recover.php @@ -4,7 +4,7 @@ dbconn(); failedloginscheck ("Recover",true); $take_recover = !isset($_GET['sitelanguage']); -$langid = 0 + $_GET['sitelanguage']; +$langid = $_GET['sitelanguage'] ?? 0; if ($langid) { $lang_folder = validlang($langid); @@ -60,7 +60,7 @@ EOD; } elseif($_SERVER["REQUEST_METHOD"] == "GET" && $take_recover && isset($_GET["id"]) && isset($_GET["secret"])) { - $id = 0 + $_GET["id"]; + $id = $_GET["id"] ?? 0; $md5 = $_GET["secret"]; if (!$id) diff --git a/retriver.php b/retriver.php index 3223f9ec..66c6d652 100644 --- a/retriver.php +++ b/retriver.php @@ -6,9 +6,9 @@ loggedinorreturn(); if (get_user_class() < $updateextinfo_class) { permissiondenied(); } -$id = 0 + $_GET["id"]; -$type = 0 + $_GET["type"]; -$siteid = 0 + $_GET["siteid"]; // 1 for IMDb +$id = $_GET["id"] ?? 0; +$type = $_GET["type"] ?? 0; +$siteid = $_GET["siteid"] ?? 0; // 1 for IMDb if (!isset($id) || !$id || !is_numeric($id) || !isset($type) || !$type || !is_numeric($type) || !isset($siteid) || !$siteid || !is_numeric($siteid)) die(); diff --git a/signup.php b/signup.php index 7beb9dde..c4eb1259 100644 --- a/signup.php +++ b/signup.php @@ -2,7 +2,7 @@ require_once("include/bittorrent.php"); dbconn(); -$langid = 0 + $_GET['sitelanguage']; +$langid = $_GET['sitelanguage'] ?? 0; if ($langid) { $lang_folder = validlang($langid); diff --git a/tags.php b/tags.php index 0589fb1c..b318722a 100644 --- a/tags.php +++ b/tags.php @@ -21,7 +21,7 @@ function insert_tag($name, $description, $syntax, $example, $remarks) stdhead($lang_tags['head_tags']); begin_main_frame(); begin_frame($lang_tags['text_tags']); -$test = $_POST["test"]; +$test = $_POST["test"] ?? ''; ?>

diff --git a/takeedit.php b/takeedit.php index 84cc99c2..04144d8b 100644 --- a/takeedit.php +++ b/takeedit.php @@ -14,7 +14,7 @@ if (!mkglobal("id:name:descr:type")){ bark($lang_takeedit['std_missing_form_data']); } -$id = 0 + $id; +$id = $id ?? 0; if (!$id) die(); @@ -57,7 +57,7 @@ elseif ($nfoaction == "remove"){ } } -$catid = (0 + $type); +$catid = ($type ?? 0); if (!is_valid_id($catid)) bark($lang_takeedit['std_missing_form_data']); if (!$name || !$descr) @@ -75,13 +75,13 @@ $updateset[] = "url = " . sqlesc($url); $updateset[] = "small_descr = " . sqlesc($_POST["small_descr"]); //$updateset[] = "ori_descr = " . sqlesc($descr); $updateset[] = "category = " . sqlesc($catid); -$updateset[] = "source = " . sqlesc(0 + $_POST["source_sel"]); -$updateset[] = "medium = " . sqlesc(0 + $_POST["medium_sel"]); -$updateset[] = "codec = " . sqlesc(0 + $_POST["codec_sel"]); -$updateset[] = "standard = " . sqlesc(0 + $_POST["standard_sel"]); -$updateset[] = "processing = " . sqlesc(0 + $_POST["processing_sel"]); -$updateset[] = "team = " . sqlesc(0 + $_POST["team_sel"]); -$updateset[] = "audiocodec = " . sqlesc(0 + $_POST["audiocodec_sel"]); +$updateset[] = "source = " . sqlesc($_POST["source_sel"] ?? 0); +$updateset[] = "medium = " . sqlesc($_POST["medium_sel"] ?? 0); +$updateset[] = "codec = " . sqlesc($_POST["codec_sel"] ?? 0); +$updateset[] = "standard = " . sqlesc($_POST["standard_sel"] ?? 0); +$updateset[] = "processing = " . sqlesc($_POST["processing_sel"] ?? 0); +$updateset[] = "team = " . sqlesc($_POST["team_sel"] ?? 0); +$updateset[] = "audiocodec = " . sqlesc($_POST["audiocodec_sel"] ?? 0); if (get_user_class() >= $torrentmanage_class) { if ($_POST["banned"]) { @@ -96,17 +96,17 @@ if(get_user_class()>=$torrentonpromotion_class) { if(!isset($_POST["sel_spstate"]) || $_POST["sel_spstate"] == 1) $updateset[] = "sp_state = 1"; - elseif((0 + $_POST["sel_spstate"]) == 2) + elseif(($_POST["sel_spstate"] ?? 0) == 2) $updateset[] = "sp_state = 2"; - elseif((0 + $_POST["sel_spstate"]) == 3) + elseif(($_POST["sel_spstate"] ?? 0) == 3) $updateset[] = "sp_state = 3"; - elseif((0 + $_POST["sel_spstate"]) == 4) + elseif(($_POST["sel_spstate"] ?? 0) == 4) $updateset[] = "sp_state = 4"; - elseif((0 + $_POST["sel_spstate"]) == 5) + elseif(($_POST["sel_spstate"] ?? 0) == 5) $updateset[] = "sp_state = 5"; - elseif((0 + $_POST["sel_spstate"]) == 6) + elseif(($_POST["sel_spstate"] ?? 0) == 6) $updateset[] = "sp_state = 6"; - elseif((0 + $_POST["sel_spstate"]) == 7) + elseif(($_POST["sel_spstate"] ?? 0) == 7) $updateset[] = "sp_state = 7"; //promotion expiration type @@ -128,37 +128,37 @@ if(get_user_class()>=$torrentonpromotion_class) } if(get_user_class()>=$torrentsticky_class) { - if((0 + $_POST["sel_posstate"]) == 0) + if(($_POST["sel_posstate"] ?? 0) == 0) $updateset[] = "pos_state = 'normal'"; - elseif((0 + $_POST["sel_posstate"]) == 1) + elseif(($_POST["sel_posstate"] ?? 0) == 1) $updateset[] = "pos_state = 'sticky'"; } $pick_info = ""; if(get_user_class()>=$torrentmanage_class && $CURUSER['picker'] == 'yes') { - if((0 + $_POST["sel_recmovie"]) == 0) + if(($_POST["sel_recmovie"] ?? 0) == 0) { if($row["picktype"] != 'normal') $pick_info = ", recomendation canceled!"; $updateset[] = "picktype = 'normal'"; $updateset[] = "picktime = '0000-00-00 00:00:00'"; } - elseif((0 + $_POST["sel_recmovie"]) == 1) + elseif(($_POST["sel_recmovie"] ?? 0) == 1) { if($row["picktype"] != 'hot') $pick_info = ", recommend as hot movie"; $updateset[] = "picktype = 'hot'"; $updateset[] = "picktime = ". sqlesc(date("Y-m-d H:i:s")); } - elseif((0 + $_POST["sel_recmovie"]) == 2) + elseif(($_POST["sel_recmovie"] ?? 0) == 2) { if($row["picktype"] != 'classic') $pick_info = ", recommend as classic movie"; $updateset[] = "picktype = 'classic'"; $updateset[] = "picktime = ". sqlesc(date("Y-m-d H:i:s")); } - elseif((0 + $_POST["sel_recmovie"]) == 3) + elseif(($_POST["sel_recmovie"] ?? 0) == 3) { if($row["picktype"] != 'recommended') $pick_info = ", recommend as recommended movie"; diff --git a/takeflush.php b/takeflush.php index eb523e4c..fe96b9a3 100644 --- a/takeflush.php +++ b/takeflush.php @@ -11,7 +11,7 @@ function bark($msg) exit; } -$id = 0 + $_GET['id']; +$id = $_GET['id'] ?? 0; int_check($id,true); if (get_user_class() >= UC_MODERATOR || $CURUSER[id] == "$id") diff --git a/takereseed.php b/takereseed.php index f041e5e7..c13eb791 100644 --- a/takereseed.php +++ b/takereseed.php @@ -7,7 +7,7 @@ loggedinorreturn(); if (get_user_class() < $askreseed_class) permissiondenied(); -$reseedid = 0 + $_GET["reseedid"]; +$reseedid = $_GET["reseedid"] ?? 0; $res = sql_query("SELECT seeders, last_reseed FROM torrents WHERE id=".sqlesc($reseedid)." LIMIT 1") or sqlerr(__FILE__, __LINE__); $row = mysql_fetch_array($res); if ($row['seeders'] > 0) diff --git a/topten.php b/topten.php index c6615896..9048229d 100644 --- a/topten.php +++ b/topten.php @@ -451,10 +451,10 @@ function languagetable($res, $frame_caption) stdhead($lang_topten['head_top_ten']); begin_main_frame(); -$type = isset($_GET["type"]) ? 0 + $_GET["type"] : 0; +$type = isset($_GET["type"]) ? (int)$_GET["type"] : 0; if (!in_array($type,array(1,2,3,4,5,6,7))) $type = 1; -$limit = isset($_GET["lim"]) ? 0 + $_GET["lim"] : false; +$limit = isset($_GET["lim"]) ? (int)$_GET["lim"] : false; $subtype = isset($_GET["subtype"]) ? $_GET["subtype"] : false; print("

" . @@ -473,6 +473,9 @@ $cachename = "topten_type_".$type."_limit_".$limit."_subtype_".$subtype; $cachetime = 60 * 60; // 60 minutes // START CACHE $Cache->new_page($cachename, $cachetime, true); +//no this option +$reviewenabled = 'no'; + if (!$Cache->get_page()) { $Cache->add_whole_row(); diff --git a/torrentrss.php b/torrentrss.php index e5cb7978..7db53583 100644 --- a/torrentrss.php +++ b/torrentrss.php @@ -30,7 +30,7 @@ $searchstr = mysql_real_escape_string(trim($_GET["search"])); if (empty($searchstr)) unset($searchstr); if (isset($searchstr)){ - $search_mode = 0 + $_GET["search_mode"]; + $search_mode = $_GET["search_mode"] ?? 0; if (!in_array($search_mode,array(0,1,2))) { $search_mode = 0; diff --git a/torrents.php b/torrents.php index f0a140d3..9dc5f141 100644 --- a/torrents.php +++ b/torrents.php @@ -92,7 +92,7 @@ if ($showsubcat){ } //----------------- start whether show torrents from all sections---------------------// if ($_GET) - $allsec = 0 + $_GET["allsec"]; + $allsec = $_GET["allsec"] ?? 0; else $allsec = 0; if ($allsec == 1) //show torrents from all sections { @@ -101,7 +101,7 @@ if ($allsec == 1) //show torrents from all sections // ----------------- end whether ignoring section ---------------------// // ----------------- start bookmarked ---------------------// if ($_GET) - $inclbookmarked = 0 + $_GET["inclbookmarked"]; + $inclbookmarked = $_GET["inclbookmarked"] ?? 0; elseif ($CURUSER['notifs']){ if (strpos($CURUSER['notifs'], "[inclbookmarked=0]") !== false) $inclbookmarked = 0; @@ -139,7 +139,7 @@ if (!isset($CURUSER) || get_user_class() < $seebanned_class) $wherea[] = "banned != 'yes'"; // ----------------- start include dead ---------------------// if (isset($_GET["incldead"])) - $include_dead = 0 + $_GET["incldead"]; + $include_dead = $_GET["incldead"] ?? 0; elseif ($CURUSER['notifs']){ if (strpos($CURUSER['notifs'], "[incldead=0]") !== false) $include_dead = 0; @@ -675,7 +675,7 @@ if (isset($searchstr)) else{ $notnewword="notnewword=1&"; } - $search_mode = 0 + $_GET["search_mode"]; + $search_mode = $_GET["search_mode"] ?? 0; if (!in_array($search_mode,array(0,1,2))) { $search_mode = 0; diff --git a/userdetails.php b/userdetails.php index 42d82e17..1f42ebc8 100644 --- a/userdetails.php +++ b/userdetails.php @@ -14,7 +14,7 @@ function bark($msg) exit; } -$id = 0 + $_GET["id"]; +$id = $_GET["id"] ?? 0; int_check($id,true); if ($id != $CURUSER['id']){ @@ -28,10 +28,10 @@ else if ($user["status"] == "pending") stderr($lang_userdetails['std_sorry'], $lang_userdetails['std_user_not_confirmed']); -if ($user[added] == "0000-00-00 00:00:00") +if ($user['added'] == "0000-00-00 00:00:00") $joindate = $lang_userdetails['text_not_available']; else -$joindate = $user[added]." (" . gettime($user["added"], true, false, true).")"; +$joindate = $user['added']." (" . gettime($user["added"], true, false, true).")"; $lastseen = $user["last_access"]; if ($lastseen == "0000-00-00 00:00:00") $lastseen = $lang_userdetails['text_not_available']; @@ -39,24 +39,27 @@ else { $lastseen .= " (" . gettime($lastseen, true, false, true).")"; } -$res = sql_query("SELECT COUNT(*) FROM comments WHERE user=" . $user[id]) or sqlerr(); +$res = sql_query("SELECT COUNT(*) FROM comments WHERE user=" . $user['id']) or sqlerr(); $arr3 = mysql_fetch_row($res); $torrentcomments = $arr3[0]; -$res = sql_query("SELECT COUNT(*) FROM posts WHERE userid=" . $user[id]) or sqlerr(); +$res = sql_query("SELECT COUNT(*) FROM posts WHERE userid=" . $user['id']) or sqlerr(); $arr3 = mysql_fetch_row($res); $forumposts = $arr3[0]; - $arr = get_country_row($user[country]); - $country = "\"".$arr[name]."\""; + $arr = get_country_row($user['country']); + $country = "\"".$arr['name']."\""; - $arr = get_downloadspeed_row($user[download]); - $download = "\"Downstream ".$arr[name]; + $arr = (array)get_downloadspeed_row($user['download']); + $name = $arr['name'] ?? ''; + $download = "\"Downstream ".$name; - $arr = get_uploadspeed_row($user[upload]); - $upload = "\"Upstream ".$arr[name]; + $arr = (array)get_uploadspeed_row($user['upload']); + $name = $arr['name'] ?? ''; + $upload = "\"Upstream ".$name; - $arr = get_isp_row($user[isp]); - $isp = $arr[name]; + $arr = get_isp_row($user['isp']); + $name = $arr['name'] ?? ''; + $isp = $name; if ($user["gender"] == "Male") $gender = "Male"; @@ -69,15 +72,15 @@ stdhead($lang_userdetails['head_details_for']. $user["username"]); $enabled = $user["enabled"] == 'yes'; $moviepicker = $user["picker"] == 'yes'; -print("

" . get_username($user[id], true,false) . $country."

"); +print("

" . get_username($user['id'], true,false) . $country."

"); if (!$enabled) print("

".$lang_userdetails['text_account_disabled_note']."

"); elseif ($CURUSER["id"] <> $user["id"]) { - $r = sql_query("SELECT id FROM friends WHERE userid=$CURUSER[id] AND friendid=$id") or sqlerr(__FILE__, __LINE__); + $r = sql_query("SELECT id FROM friends WHERE userid={$CURUSER['id']} AND friendid=$id") or sqlerr(__FILE__, __LINE__); $friend = mysql_num_rows($r); - $r = sql_query("SELECT id FROM blocks WHERE userid=$CURUSER[id] AND blockid=$id") or sqlerr(__FILE__, __LINE__); + $r = sql_query("SELECT id FROM blocks WHERE userid={$CURUSER['id']} AND blockid=$id") or sqlerr(__FILE__, __LINE__); $block = mysql_num_rows($r); if ($friend) @@ -91,17 +94,17 @@ elseif ($CURUSER["id"] <> $user["id"]) } } begin_main_frame(); -if ($CURUSER[id] == $user[id] || get_user_class() >= $cruprfmanage_class) +if ($CURUSER['id'] == $user['id'] || get_user_class() >= $cruprfmanage_class) print("

".$lang_userdetails['text_flush_ghost_torrents']."".$lang_userdetails['text_here']."

\n"); ?>
= $prfmanage_class) || $CURUSER[id] == $user[id]){ +if (($user["privacy"] != "strong") OR (get_user_class() >= $prfmanage_class) || $CURUSER['id'] == $user['id']){ //Xia Zuojie: Taste compatibility is extremely slow. It can takes thounsands of datebase queries. It is disabled until someone makes it fast. /* - if (isset($CURUSER) && $CURUSER[id] != $user[id]) + if (isset($CURUSER) && $CURUSER['id'] != $user['id']) { - $user_snatched = sql_query("SELECT * FROM snatched WHERE userid = $CURUSER[id]") or sqlerr(__FILE__, __LINE__); + $user_snatched = sql_query("SELECT * FROM snatched WHERE userid = $CURUSER['id']") or sqlerr(__FILE__, __LINE__); if(mysql_num_rows($user_snatched) == 0) $compatibility_info = $lang_userdetails['text_unknown']; else @@ -110,7 +113,7 @@ if (($user["privacy"] != "strong") OR (get_user_class() >= $prfmanage_class) || { $torrent_2_user_value = get_torrent_2_user_value($user_snatched_arr); - $user_snatched_res_target = sql_query("SELECT * FROM snatched WHERE torrentid = " . $user_snatched_arr['torrentid'] . " AND userid = " . $user[id]) or sqlerr(__FILE__, __LINE__); // + $user_snatched_res_target = sql_query("SELECT * FROM snatched WHERE torrentid = " . $user_snatched_arr['torrentid'] . " AND userid = " . $user['id']) or sqlerr(__FILE__, __LINE__); // if(mysql_num_rows($user_snatched_res_target) == 1) // have other peole snatched this torrent { $user_snatched_arr_target = mysql_fetch_array($user_snatched_res_target) or sqlerr(__FILE__, __LINE__); // find target user's current analyzing torrent's snatch info @@ -123,7 +126,7 @@ if (($user["privacy"] != "strong") OR (get_user_class() >= $prfmanage_class) || } } - $val = $other_user_2_curuser_value[$user[id]]; + $val = $other_user_2_curuser_value[$user['id']]; if ($val > 1) { $val = 1; @@ -165,17 +168,17 @@ if (($user["privacy"] != "strong") OR (get_user_class() >= $prfmanage_class) || } */ - if ($CURUSER[id] == $user[id] || get_user_class() >= $viewinvite_class){ + if ($CURUSER['id'] == $user['id'] || get_user_class() >= $viewinvite_class){ if ($user["invites"] <= 0) tr_small($lang_userdetails['row_invitation'], $lang_userdetails['text_no_invitation'], 1); else - tr_small($lang_userdetails['row_invitation'], "".$user[invites]."", 1);} + tr_small($lang_userdetails['row_invitation'], "".$user['invites']."", 1);} else{ - if ($CURUSER[id] != $user[id] || get_user_class() != $viewinvite_class){ + if ($CURUSER['id'] != $user['id'] || get_user_class() != $viewinvite_class){ if ($user["invites"] <= 0) tr_small($lang_userdetails['row_invitation'], $lang_userdetails['text_no_invitation'], 1); else - tr($lang_userdetails['row_invitation'], $user[invites], 1);} + tr($lang_userdetails['row_invitation'], $user['invites'], 1);} } if ($user["invited_by"] > 0) { tr_small($lang_userdetails['row_invited_by'], get_username($user['invited_by']), 1); @@ -186,7 +189,7 @@ if ($where_tweak == "yes") { tr_small($lang_userdetails['row_last_seen_location'], $user[page], 1); } if (get_user_class() >= $userprofile_class OR $user["privacy"] == "low") { - tr_small($lang_userdetails['row_email'], "".$user[email]."", 1); + tr_small($lang_userdetails['row_email'], "".$user['email']."", 1); } if (get_user_class() >= $userprofile_class) { $resip = sql_query("SELECT ip FROM iplog WHERE userid =$id GROUP BY ip") or sqlerr(__FILE__, __LINE__); @@ -199,18 +202,18 @@ if (get_user_class() >= $userprofile_class) { if (get_user_class() >= $userprofile_class || $user["id"] == $CURUSER["id"]) { if ($enablelocation_tweak == 'yes'){ - list($loc_pub, $loc_mod) = get_ip_location($user[ip]); + list($loc_pub, $loc_mod) = get_ip_location($user['ip']); $locationinfo = "[" . $loc_pub . "]"; } else $locationinfo = ""; - tr_small($lang_userdetails['row_ip_address'], $user[ip].$locationinfo, 1); + tr_small($lang_userdetails['row_ip_address'], $user['ip'].$locationinfo, 1); } -$res = sql_query("SELECT agent, peer_id, ip, port FROM peers WHERE userid = $user[id] GROUP BY agent") or sqlerr(); +$res = sql_query("SELECT agent, peer_id, ip, port FROM peers WHERE userid = {$user['id']} GROUP BY agent") or sqlerr(); + $clientselect = ""; if (mysql_num_rows($res) > 0) { $first = true; - $clientselect = ""; while($arr = mysql_fetch_assoc($res)) { $clientselect .= ($first == true ? "" : " ; ") . get_agent($arr["peer_id"], $arr["agent"]); @@ -232,7 +235,7 @@ if ($user["downloaded"] > 0) $xfer = ""; -tr_small($lang_userdetails['row_transfer'], "
" . $lang_userdetails['row_uploaded'] . ": ". mksize($user["uploaded"]) . "  " . $lang_userdetails['row_downloaded'] . ": " . mksize($user["downloaded"]) . "
" . $sr . $xfer . "
", 1); +tr_small($lang_userdetails['row_transfer'], "" . ($sr ?? '') . $xfer . "
", 1); if ($user["leechtime"] > 0) @@ -243,26 +246,26 @@ if ($user["leechtime"] > 0) $slt = "" . $lang_userdetails['text_seeding_time'] . ": ". mkprettytime($user["seedtime"]) . "  " . $lang_userdetails['text_leeching_time'] . ": " . mkprettytime($user["leechtime"]) . ""; - tr_small($lang_userdetails['row_sltime'], "" . $slr . $slt . "
", 1); + tr_small($lang_userdetails['row_sltime'], "" . ($slr ?? '') . $slt . "
", 1); if ($user["download"] && $user["upload"]) tr_small($lang_userdetails['row_internet_speed'], $download."    ".$upload."    ".$isp, 1); tr_small($lang_userdetails['row_gender'], $gender, 1); if (($user['donated'] > 0 || $user['donated_cny'] > 0 )&& (get_user_class() >= $userprofile_class || $CURUSER["id"] == $user["id"])) -tr_small($lang_userdetails['row_donated'], "$".htmlspecialchars($user[donated])."      ".htmlspecialchars($user[donated_cny]), 1); +tr_small($lang_userdetails['row_donated'], "$".htmlspecialchars($user['donated'])."      ".htmlspecialchars($user[donated_cny]), 1); if ($user["avatar"]) tr_small($lang_userdetails['row_avatar'], return_avatar_image(htmlspecialchars(trim($user["avatar"]))), 1); $uclass = get_user_class_image($user["class"]); -tr_small($lang_userdetails['row_class'], "\"".get_user_class_name($user["class"],false,false,true)."\" ".($user[title]!=="" ? " ".htmlspecialchars(trim($user["title"]))."" : ""), 1); +tr_small($lang_userdetails['row_class'], "\"".get_user_class_name($user["class"],false,false,true)."\" ".($user['title']!=="" ? " ".htmlspecialchars(trim($user["title"]))."" : ""), 1); tr_small($lang_userdetails['row_torrent_comment'], ($torrentcomments && ($user["id"] == $CURUSER["id"] || get_user_class() >= $viewhistory_class) ? "".$torrentcomments."" : $torrentcomments), 1); tr_small($lang_userdetails['row_forum_posts'], ($forumposts && ($user["id"] == $CURUSER["id"] || get_user_class() >= $viewhistory_class) ? "".$forumposts."" : $forumposts), 1); if ($user["id"] == $CURUSER["id"] || get_user_class() >= $viewhistory_class) -tr_small($lang_userdetails['row_karma_points'], htmlspecialchars($user[seedbonus]), 1); +tr_small($lang_userdetails['row_karma_points'], htmlspecialchars($user['seedbonus']), 1); if ($user["ip"] && (get_user_class() >= $torrenthistory_class || $user["id"] == $CURUSER["id"])){ @@ -285,27 +288,27 @@ if ($user["info"]) } else { - print("".$lang_userdetails['text_public_access_denied'].$user[username].$lang_userdetails['text_user_wants_privacy']."\n"); + print("".$lang_userdetails['text_public_access_denied'].$user['username'].$lang_userdetails['text_user_wants_privacy']."\n"); } if ($CURUSER["id"] != $user["id"]) if (get_user_class() >= $staffmem_class) $showpmbutton = 1; elseif ($user["acceptpms"] == "yes") { - $r = sql_query("SELECT id FROM blocks WHERE userid=$user[id] AND blockid=$CURUSER[id]") or sqlerr(__FILE__,__LINE__); + $r = sql_query("SELECT id FROM blocks WHERE userid={$user['id']} AND blockid={$CURUSER['id']}") or sqlerr(__FILE__,__LINE__); $showpmbutton = (mysql_num_rows($r) == 1 ? 0 : 1); } elseif ($user["acceptpms"] == "friends") { - $r = sql_query("SELECT id FROM friends WHERE userid=$user[id] AND friendid=$CURUSER[id]") or sqlerr(__FILE__,__LINE__); + $r = sql_query("SELECT id FROM friends WHERE userid={$user['id']} AND friendid={$CURUSER['id']}") or sqlerr(__FILE__,__LINE__); $showpmbutton = (mysql_num_rows($r) == 1 ? 1 : 0); } if ($CURUSER["id"] != $user["id"]){ print(""); if ($showpmbutton) -print("\"PM\""); +print("\"PM\""); -print("\"Report\""); +print("\"Report\""); print(""); } print("\n"); @@ -318,7 +321,7 @@ if (get_user_class() >= $prfmanage_class && $user["class"] < get_user_class()) print(""); print(""); print("\n"); - tr($lang_userdetails['row_title'], "", 1); + tr($lang_userdetails['row_title'], "", 1); $avatar = htmlspecialchars(trim($user["avatar"])); tr($lang_userdetails['row_privacy_level'], "".$lang_userdetails['radio_low']."".$lang_userdetails['radio_normal']."".$lang_userdetails['radio_strong'], 1); @@ -329,7 +332,7 @@ if (get_user_class() >= $prfmanage_class && $user["class"] < get_user_class()) if (get_user_class() == UC_STAFFLEADER) { tr($lang_userdetails['row_donor_status'], "".$lang_userdetails['radio_yes']." ".$lang_userdetails['radio_no'], 1); - tr($lang_userdetails['row_donated'], "USD:     CNY: " . $lang_userdetails['text_transaction_memo'] . "", 1); + tr($lang_userdetails['row_donated'], "USD:     CNY: " . $lang_userdetails['text_transaction_memo'] . "", 1); } if (get_user_class() == $prfmanage_class) $maxclass = UC_VIP; @@ -390,7 +393,7 @@ if (get_user_class() >= $prfmanage_class && $user["class"] < get_user_class()) $elapsedlw = get_elapsed_time(strtotime($user["lastwarned"])); - print("\n"); + print("\n"); if ($user["timeswarned"] == 0) { @@ -398,7 +401,7 @@ if (get_user_class() >= $prfmanage_class && $user["class"] < get_user_class()) }else{ if ($user["warnedby"] != "System") { - $res = sql_query("SELECT id, username, warnedby FROM users WHERE id = " . $user['warnedby'] . "") or sqlerr(__FILE__,__LINE__); + $res = sql_query("SELECT id, username, warnedby FROM users WHERE id = " . $user['warnedby']) or sqlerr(__FILE__,__LINE__); $arr = mysql_fetch_assoc($res); $warnedby = "
[".$lang_userdetails['text_by']."" . get_username($arr['id']) . "]"; }else{ @@ -435,9 +438,9 @@ if (get_user_class() >= $prfmanage_class && $user["class"] < get_user_class()) tr($lang_userdetails['row_no_ad_until'], " ".$lang_userdetails['text_no_ad_until_note'], 1); if (get_user_class() >= $cruprfmanage_class) { - tr($lang_userdetails['row_change_username'], "", 1); + tr($lang_userdetails['row_change_username'], "", 1); - tr($lang_userdetails['row_change_email'], "", 1); + tr($lang_userdetails['row_change_email'], "", 1); } tr($lang_userdetails['row_change_password'], "", 1); @@ -445,10 +448,10 @@ if (get_user_class() >= $prfmanage_class && $user["class"] < get_user_class()) if (get_user_class() >= $cruprfmanage_class) { - tr($lang_userdetails['row_amount_uploaded'], "", 1); - tr($lang_userdetails['row_amount_downloaded'], "", 1); - tr($lang_userdetails['row_seeding_karma'], "", 1); - tr($lang_userdetails['row_invites'], "", 1); + tr($lang_userdetails['row_amount_uploaded'], "", 1); + tr($lang_userdetails['row_amount_downloaded'], "", 1); + tr($lang_userdetails['row_seeding_karma'], "", 1); + tr($lang_userdetails['row_invites'], "", 1); } tr($lang_userdetails['row_passkey'], "".$lang_userdetails['checkbox_reset_passkey'], 1); diff --git a/viewfilelist.php b/viewfilelist.php index df5adc36..6763d142 100644 --- a/viewfilelist.php +++ b/viewfilelist.php @@ -10,7 +10,7 @@ header("Cache-Control: no-cache, must-revalidate" ); header("Pragma: no-cache" ); header("Content-Type: text/xml; charset=utf-8"); -$id = 0 + $_GET['id']; +$id = $_GET['id'] ?? 0; if(isset($CURUSER)) { $s = "
".$lang_userdetails['text_times_warned']."".$user[timeswarned]."
".$lang_userdetails['text_times_warned']."".$user['timeswarned']."
\n";