fix warning

This commit is contained in:
xiaomlove
2020-12-29 21:49:37 +08:00
parent d190ca6f67
commit 398cf8607a
55 changed files with 223 additions and 214 deletions

View File

@@ -190,7 +190,7 @@ tr($lang_admanage['row_flash_height']."<font color=\"red\">*</font>", "<input ty
$action = $_GET['action'];
if ($action == 'del')
{
$id = 0 + $_GET['id'];
$id = $_GET['id'] ?? 0;
if (!$id)
{
stderr($lang_admanage['std_error'], $lang_admanage['std_invalid_id']);
@@ -204,7 +204,7 @@ if ($action == 'del')
}
elseif ($action == 'edit')
{
$id = 0 + $_GET['id'];
$id = $_GET['id'] ?? 0;
if (!$id)
{
stderr($lang_admanage['std_error'], $lang_admanage['std_invalid_id']);
@@ -252,7 +252,7 @@ elseif ($action == 'submit')
else
{
if ($_POST['isedit']){
$id = 0 + $_POST['id'];
$id = $_POST['id'] ?? 0;
if (!$id)
{
stderr($lang_admanage['std_error'], $lang_admanage['std_invalid_id']);
@@ -276,8 +276,8 @@ elseif ($action == 'submit')
$name = $_POST['ad']['name'];
$starttime = $_POST['ad']['starttime'];
$endtime = $_POST['ad']['endtime'];
$displayorder = 0+$_POST['ad']['displayorder'];
$enabled = 0+$_POST['ad']['enabled'];
$displayorder = $_POST['ad']['displayorder'] ?? 0;
$enabled = $_POST['ad']['enabled'] ?? 0;
$type = $_POST['ad']['type'];
if (!$name || !$type)
{
@@ -317,8 +317,8 @@ elseif ($action == 'submit')
case 'image':
if (!$_POST['ad']['image']['url'] || !$_POST['ad']['image']['link'])
stderr($lang_admanage['std_error'], $lang_admanage['std_missing_form_data']);
$_POST['ad']['image']['width'] = 0+$_POST['ad']['image']['width'];
$_POST['ad']['image']['height'] = 0+$_POST['ad']['image']['height'];
$_POST['ad']['image']['width'] = $_POST['ad']['image']['width'] ?? 0;
$_POST['ad']['image']['height'] = $_POST['ad']['image']['height'] ?? 0;
$parameters = serialize($_POST['ad']['image']);
$imgadd = "";
if ($_POST['ad']['image']['width'])
@@ -330,8 +330,8 @@ elseif ($action == 'submit')
$code = "<a href=\"adredir.php?id=".$adid."&amp;url=".rawurlencode(htmlspecialchars($_POST['ad']['image']['link']))."\" target=\"_blank\"><img border=\"0\" src=\"".htmlspecialchars($_POST['ad']['image']['url'])."\"".$imgadd." alt=\"ad\" /></a>";
break;
case 'flash':
$_POST['ad']['flash']['width'] = 0+$_POST['ad']['flash']['width'];
$_POST['ad']['flash']['height'] = 0+$_POST['ad']['flash']['height'];
$_POST['ad']['flash']['width'] = $_POST['ad']['flash']['width'] ?? 0;
$_POST['ad']['flash']['height'] = $_POST['ad']['flash']['height'] ?? 0;
if (!$_POST['ad']['flash']['url'] || !$_POST['ad']['flash']['width'] || !$_POST['ad']['flash']['height'])
stderr($lang_admanage['std_error'], $lang_admanage['std_missing_form_data']);
$parameters = serialize($_POST['ad']['flash']);

View File

@@ -4,7 +4,7 @@ dbconn();
require_once(get_langfile_path());
if ($enablead_advertisement != 'yes')
stderr($lang_adredir['std_error'], $lang_adredir['std_ad_system_disabled']);
$id=0+$_GET['id'];
$id=$_GET['id'] ?? 0;
if (!$id)
stderr($lang_adredir['std_error'], $lang_adredir['std_invalid_ad_id']);
$redir=htmlspecialchars_decode(urldecode($_GET['url']));

View File

@@ -57,7 +57,7 @@ if (!$az = $Cache->get_value('user_passkey_'.$passkey.'_content')){
$Cache->cache_value('user_passkey_'.$passkey.'_content', $az, 950);
}
if (!$az) err("Invalid passkey! Re-download the .torrent from $BASEURL");
$userid = 0+$az['id'];
$userid = $az['id'] ?? 0;
//3. CHECK IF CLIENT IS ALLOWED
$clicheck_res = check_client($peer_id,$agent,$client_familyid);

View File

@@ -9,7 +9,7 @@ header("Cache-Control: no-cache, must-revalidate" );
header("Pragma: no-cache" );
header("Content-Type: text/xml; charset=utf-8");
$torrentid = 0 + $_GET['torrentid'];
$torrentid = $_GET['torrentid'] ?? 0;
if(isset($CURUSER))
{
$res_bookmark = sql_query("SELECT * FROM bookmarks WHERE torrentid=" . sqlesc($torrentid) . " AND userid=" . sqlesc($CURUSER[id]));

View File

@@ -575,7 +575,7 @@ print($pagerbottom);
}
elseif($action == 'del')
{
$id = 0 + $_GET['id'];
$id = $_GET['id'] ?? 0;
if (!$id)
{
stderr($lang_catmanage['std_error'], $lang_catmanage['std_invalid_id']);
@@ -602,7 +602,7 @@ elseif($action == 'del')
}
elseif($action == 'edit')
{
$id = 0 + $_GET['id'];
$id = $_GET['id'] ?? 0;
if (!$id)
{
stderr($lang_catmanage['std_error'], $lang_catmanage['std_invalid_id']);
@@ -640,7 +640,7 @@ elseif($action == 'submit')
{
$dbtablename=return_category_db_table_name($type);
if ($_POST['isedit']){
$id = 0 + $_POST['id'];
$id = $_POST['id'] ?? 0;
if (!$id)
{
stderr($lang_catmanage['std_error'], $lang_catmanage['std_invalid_id']);
@@ -658,23 +658,23 @@ elseif($action == 'submit')
if (!$name)
stderr($lang_catmanage['std_error'], $lang_catmanage['std_missing_form_data']);
$updateset[] = "name=".sqlesc($name);
$sort_index = 0+$_POST['sort_index'];
$sort_index = $_POST['sort_index'] ?? 0;
$updateset[] = "sort_index=".sqlesc($sort_index);
$Cache->delete_value($dbtablename.'_list');
}
elseif ($type=='searchbox'){
$name = $_POST['name'];
$catsperrow = 0+$_POST['catsperrow'];
$catpadding = 0+$_POST['catpadding'];
$catsperrow = $_POST['catsperrow'] ?? 0;
$catpadding = $_POST['catpadding'] ?? 0;
if (!$name || !$catsperrow || !$catpadding)
stderr($lang_catmanage['std_error'], $lang_catmanage['std_missing_form_data']);
$showsource = 0+$_POST['showsource'];
$showmedium = 0+$_POST['showmedium'];
$showcodec = 0+$_POST['showcodec'];
$showstandard = 0+$_POST['showstandard'];
$showprocessing = 0+$_POST['showprocessing'];
$showteam = 0+$_POST['showteam'];
$showaudiocodec = 0+$_POST['showaudiocodec'];
$showsource = $_POST['showsource'] ?? 0;
$showmedium = $_POST['showmedium'] ?? 0;
$showcodec = $_POST['showcodec'] ?? 0;
$showstandard = $_POST['showstandard'] ?? 0;
$showprocessing = $_POST['showprocessing'] ?? 0;
$showteam = $_POST['showteam'] ?? 0;
$showaudiocodec = $_POST['showaudiocodec'];
$updateset[] = "catsperrow=".sqlesc($catsperrow);
$updateset[] = "catpadding=".sqlesc($catpadding);
$updateset[] = "name=".sqlesc($name);
@@ -720,13 +720,13 @@ elseif($action == 'submit')
$name = $_POST['name'];
$image = trim($_POST['image']);
$class_name = trim($_POST['class_name']);
$source = 0+$_POST['source'];
$medium = 0+$_POST['medium'];
$codec = 0+$_POST['codec'];
$standard = 0+$_POST['standard'];
$processing = 0+$_POST['processing'];
$team = 0+$_POST['team'];
$audiocodec = 0+$_POST['audiocodec'];
$source = $_POST['source'] ?? 0;
$medium = $_POST['medium'] ?? 0;
$codec = $_POST['codec'] ?? 0;
$standard = $_POST['standard'] ?? 0;
$processing = $_POST['processing'] ?? 0;
$team = $_POST['team'] ?? 0;
$audiocodec = $_POST['audiocodec'] ?? 0;
if (!$name || !$image)
stderr($lang_catmanage['std_error'], $lang_catmanage['std_missing_form_data']);
if (!valid_file_name($image))
@@ -756,9 +756,9 @@ elseif($action == 'submit')
elseif ($type=='category'){
$name = $_POST['name'];
$image = trim($_POST['image']);
$mode = 0+$_POST['mode'];
$mode = $_POST['mode'] ?? 0;
$class_name = trim($_POST['class_name']);
$sort_index = 0+$_POST['sort_index'];
$sort_index = $_POST['sort_index'] ?? 0;
if (!$name || !$image)
stderr($lang_catmanage['std_error'], $lang_catmanage['std_missing_form_data']);
if (!valid_file_name($image))

View File

@@ -4,7 +4,7 @@ dbconn();
require_once(get_langfile_path());
loggedinorreturn();
parked();
$id = 0 + $_GET["id"];
$id = $_GET["id"] ?? 0;
int_check($id,true);
function bark($msg)
{

View File

@@ -5,7 +5,7 @@ require_once(get_langfile_path());
require(get_langfile_path("",true));
$action = htmlspecialchars($_GET["action"]);
$sub = htmlspecialchars($_GET["sub"]);
$sub = htmlspecialchars($_GET["sub"] ?? '');
$type = htmlspecialchars($_GET["type"]);
loggedinorreturn();

View File

@@ -16,7 +16,7 @@ function bark($msg) {
if (!mkglobal("id"))
bark($lang_delete['std_missing_form_date']);
$id = 0 + $id;
$id = $id ?? 0;
if (!$id)
die();
@@ -28,7 +28,7 @@ if (!$row)
if ($CURUSER["id"] != $row["owner"] && get_user_class() < $torrentmanage_class)
bark($lang_delete['std_not_owner']);
$rt = 0 + $_POST["reasontype"];
$rt = $_POST["reasontype"] ?? 0;
if (!is_int($rt) || $rt < 1 || $rt > 5)
bark($lang_delete['std_invalid_reason']."$rt.");

View File

@@ -26,26 +26,26 @@ if (!$row)
elseif ($row['banned'] == 'yes' && get_user_class() < $seebanned_class)
permissiondenied();
else {
if ($_GET["hit"]) {
if (!empty($_GET["hit"])) {
sql_query("UPDATE torrents SET views = views + 1 WHERE id = $id");
}
if (!isset($_GET["cmtpage"])) {
stdhead($lang_details['head_details_for_torrent']. "\"" . $row["name"] . "\"");
if ($_GET["uploaded"])
if (!empty($_GET["uploaded"]))
{
print("<h1 align=\"center\">".$lang_details['text_successfully_uploaded']."</h1>");
print("<p>".$lang_details['text_redownload_torrent_note']."</p>");
header("refresh: 1; url=download.php?id=$id");
//header("refresh: 1; url=getimdb.php?id=$id&type=1");
}
elseif ($_GET["edited"]) {
elseif (!empty($_GET["edited"])) {
print("<h1 align=\"center\">".$lang_details['text_successfully_edited']."</h1>");
if (isset($_GET["returnto"]))
print("<p><b>".$lang_details['text_go_back'] . "<a href=\"".htmlspecialchars($_GET["returnto"])."\">" . $lang_details['text_whence_you_came']."</a></b></p>");
}
$sp_torrent = get_torrent_promotion_append($row[sp_state],'word');
$sp_torrent = get_torrent_promotion_append($row['sp_state'],'word');
$s=htmlspecialchars($row["name"]).($sp_torrent ? "&nbsp;&nbsp;&nbsp;".$sp_torrent : "");
print("<h1 align=\"center\" id=\"top\">".$s."</h1>\n");
@@ -86,27 +86,28 @@ else {
$size_info = "<b>".$lang_details['text_size']."</b>" . mksize($row["size"]);
$type_info = "&nbsp;&nbsp;&nbsp;<b>".$lang_details['row_type'].":</b>&nbsp;".$row["cat_name"];
$source_info = $medium_info = $codec_info = $audiocodec_info = $standard_info = $processing_info = $team_info = '';
if (isset($row["source_name"]))
$source_info = "&nbsp;&nbsp;&nbsp;<b>".$lang_details['text_source']."&nbsp;</b>".$row[source_name];
$source_info = "&nbsp;&nbsp;&nbsp;<b>".$lang_details['text_source']."&nbsp;</b>".$row['source_name'];
if (isset($row["medium_name"]))
$medium_info = "&nbsp;&nbsp;&nbsp;<b>".$lang_details['text_medium']."&nbsp;</b>".$row[medium_name];
$medium_info = "&nbsp;&nbsp;&nbsp;<b>".$lang_details['text_medium']."&nbsp;</b>".$row['medium_name'];
if (isset($row["codec_name"]))
$codec_info = "&nbsp;&nbsp;&nbsp;<b>".$lang_details['text_codec']."&nbsp;</b>".$row[codec_name];
$codec_info = "&nbsp;&nbsp;&nbsp;<b>".$lang_details['text_codec']."&nbsp;</b>".$row['codec_name'];
if (isset($row["standard_name"]))
$standard_info = "&nbsp;&nbsp;&nbsp;<b>".$lang_details['text_stardard']."&nbsp;</b>".$row[standard_name];
$standard_info = "&nbsp;&nbsp;&nbsp;<b>".$lang_details['text_stardard']."&nbsp;</b>".$row['standard_name'];
if (isset($row["processing_name"]))
$processing_info = "&nbsp;&nbsp;&nbsp;<b>".$lang_details['text_processing']."&nbsp;</b>".$row[processing_name];
$processing_info = "&nbsp;&nbsp;&nbsp;<b>".$lang_details['text_processing']."&nbsp;</b>".$row['processing_name'];
if (isset($row["team_name"]))
$team_info = "&nbsp;&nbsp;&nbsp;<b>".$lang_details['text_team']."&nbsp;</b>".$row[team_name];
$team_info = "&nbsp;&nbsp;&nbsp;<b>".$lang_details['text_team']."&nbsp;</b>".$row['team_name'];
if (isset($row["audiocodec_name"]))
$audiocodec_info = "&nbsp;&nbsp;&nbsp;<b>".$lang_details['text_audio_codec']."&nbsp;</b>".$row[audiocodec_name];
$audiocodec_info = "&nbsp;&nbsp;&nbsp;<b>".$lang_details['text_audio_codec']."&nbsp;</b>".$row['audiocodec_name'];
tr($lang_details['row_basic_info'], $size_info.$type_info.$source_info . $medium_info. $codec_info . $audiocodec_info. $standard_info . $processing_info . $team_info, 1);
if ($CURUSER["downloadpos"] != "no")
$download = "<a title=\"".$lang_details['title_download_torrent']."\" href=\"download.php?id=".$id."\"><img class=\"dt_download\" src=\"pic/trans.gif\" alt=\"download\" />&nbsp;<b><font class=\"small\">".$lang_details['text_download_torrent']."</font></b></a>&nbsp;|&nbsp;";
else $download = "";
tr($lang_details['row_action'], $download. ($owned == 1 ? "<$editlink><img class=\"dt_edit\" src=\"pic/trans.gif\" alt=\"edit\" />&nbsp;<b><font class=\"small\">".$lang_details['text_edit_torrent'] . "</font></b></a>&nbsp;|&nbsp;" : ""). (get_user_class() >= $askreseed_class && $row[seeders] == 0 ? "<a title=\"".$lang_details['title_ask_for_reseed']."\" href=\"takereseed.php?reseedid=$id\"><img class=\"dt_reseed\" src=\"pic/trans.gif\" alt=\"reseed\">&nbsp;<b><font class=\"small\">".$lang_details['text_ask_for_reseed'] ."</font></b></a>&nbsp;|&nbsp;" : "") . "<a title=\"".$lang_details['title_report_torrent']."\" href=\"report.php?torrent=$id\"><img class=\"dt_report\" src=\"pic/trans.gif\" alt=\"report\" />&nbsp;<b><font class=\"small\">".$lang_details['text_report_torrent']."</font></b></a>", 1);
tr($lang_details['row_action'], $download. ($owned == 1 ? "<$editlink><img class=\"dt_edit\" src=\"pic/trans.gif\" alt=\"edit\" />&nbsp;<b><font class=\"small\">".$lang_details['text_edit_torrent'] . "</font></b></a>&nbsp;|&nbsp;" : ""). (get_user_class() >= $askreseed_class && $row['seeders'] == 0 ? "<a title=\"".$lang_details['title_ask_for_reseed']."\" href=\"takereseed.php?reseedid=$id\"><img class=\"dt_reseed\" src=\"pic/trans.gif\" alt=\"reseed\">&nbsp;<b><font class=\"small\">".$lang_details['text_ask_for_reseed'] ."</font></b></a>&nbsp;|&nbsp;" : "") . "<a title=\"".$lang_details['title_report_torrent']."\" href=\"report.php?torrent=$id\"><img class=\"dt_report\" src=\"pic/trans.gif\" alt=\"report\" />&nbsp;<b><font class=\"small\">".$lang_details['text_report_torrent']."</font></b></a>", 1);
// ---------------- start subtitle block -------------------//
$r = sql_query("SELECT subs.*, language.flagpic, language.lang_name FROM subs LEFT JOIN language ON subs.lang_id=language.id WHERE torrent_id = " . sqlesc($row["id"]). " ORDER BY subs.lang_id ASC") or sqlerr(__FILE__, __LINE__);
@@ -154,7 +155,7 @@ else {
if ($CURUSER['showdescription'] != 'no' && !empty($row["descr"])){
$torrentdetailad=$Advertisement->get_ad('torrentdetail');
tr("<a href=\"javascript: klappe_news('descr')\"><span class=\"nowrap\"><img class=\"minus\" src=\"pic/trans.gif\" alt=\"Show/Hide\" id=\"picdescr\" title=\"".$lang_detail['title_show_or_hide']."\" /> ".$lang_details['row_description']."</span></a>", "<div id='kdescr'>".($Advertisement->enable_ad() && $torrentdetailad ? "<div align=\"left\" style=\"margin-bottom: 10px\" id=\"ad_torrentdetail\">".$torrentdetailad[0]."</div>" : "").format_comment($row["descr"])."</div>", 1);
tr("<a href=\"javascript: klappe_news('descr')\"><span class=\"nowrap\"><img class=\"minus\" src=\"pic/trans.gif\" alt=\"Show/Hide\" id=\"picdescr\" title=\"".($lang_details['title_show_or_hide'] ?? '')."\" /> ".$lang_details['row_description']."</span></a>", "<div id='kdescr'>".($Advertisement->enable_ad() && $torrentdetailad ? "<div align=\"left\" style=\"margin-bottom: 10px\" id=\"ad_torrentdetail\">".$torrentdetailad[0]."</div>" : "").format_comment($row["descr"])."</div>", 1);
}
if (get_user_class() >= $viewnfo_class && $CURUSER['shownfo'] != 'no' && $row["nfosz"] > 0){
@@ -162,7 +163,7 @@ else {
$nfo = code($row["nfo"], $view == "magic");
$Cache->cache_value('nfo_block_torrent_id_'.$id, $nfo, 604800);
}
tr("<a href=\"javascript: klappe_news('nfo')\"><img class=\"plus\" src=\"pic/trans.gif\" alt=\"Show/Hide\" id=\"picnfo\" title=\"".$lang_detail['title_show_or_hide']."\" /> ".$lang_details['text_nfo']."</a><br /><a href=\"viewnfo.php?id=".$row[id]."\" class=\"sublink\">". $lang_details['text_view_nfo']. "</a>", "<div id='knfo' style=\"display: none;\"><pre style=\"font-size:10pt; font-family: 'Courier New', monospace;\">".$nfo."</pre></div>\n", 1);
tr("<a href=\"javascript: klappe_news('nfo')\"><img class=\"plus\" src=\"pic/trans.gif\" alt=\"Show/Hide\" id=\"picnfo\" title=\"".$lang_details['title_show_or_hide']."\" /> ".$lang_details['text_nfo']."</a><br /><a href=\"viewnfo.php?id=".$row[id]."\" class=\"sublink\">". $lang_details['text_view_nfo']. "</a>", "<div id='knfo' style=\"display: none;\"><pre style=\"font-size:10pt; font-family: 'Courier New', monospace;\">".$nfo."</pre></div>\n", 1);
}
if ($imdb_id && $showextinfo['imdb'] == 'yes' && $CURUSER['showimdb'] != 'no')
@@ -345,7 +346,7 @@ else {
$Cache->add_whole_row();
print("<tr>");
print("<td class=\"rowhead\"><a href=\"javascript: klappe_ext('imdb')\"><span class=\"nowrap\"><img class=\"minus\" src=\"pic/trans.gif\" alt=\"Show/Hide\" id=\"picimdb\" title=\"".$lang_detail['title_show_or_hide']."\" /> ".$lang_details['text_imdb'] . $lang_details['row_info'] ."</span></a><div id=\"posterimdb\">". $smallth."</div></td>");
print("<td class=\"rowhead\"><a href=\"javascript: klappe_ext('imdb')\"><span class=\"nowrap\"><img class=\"minus\" src=\"pic/trans.gif\" alt=\"Show/Hide\" id=\"picimdb\" title=\"".$lang_details['title_show_or_hide']."\" /> ".$lang_details['text_imdb'] . $lang_details['row_info'] ."</span></a><div id=\"posterimdb\">". $smallth."</div></td>");
$Cache->end_whole_row();
$Cache->add_row();
$Cache->add_part();
@@ -410,15 +411,15 @@ else {
}
if (isset($copy_row["source_name"]))
$other_source_info = $copy_row[source_name].", ";
$other_source_info = $copy_row['source_name'].", ";
if (isset($copy_row["medium_name"]))
$other_medium_info = $copy_row[medium_name].", ";
$other_medium_info = $copy_row['medium_name'].", ";
if (isset($copy_row["codec_name"]))
$other_codec_info = $copy_row[codec_name].", ";
$other_codec_info = $copy_row['codec_name'].", ";
if (isset($copy_row["standard_name"]))
$other_standard_info = $copy_row[standard_name].", ";
$other_standard_info = $copy_row['standard_name'].", ";
if (isset($copy_row["processing_name"]))
$other_processing_info = $copy_row[processing_name].", ";
$other_processing_info = $copy_row['processing_name'].", ";
$sphighlight = get_torrent_bg_color($copy_row['sp_state']);
$sp_info = get_torrent_promotion_append($copy_row['sp_state']);
@@ -432,7 +433,7 @@ else {
"</tr>\n";
}
$s .= "</table>\n";
tr("<a href=\"javascript: klappe_news('othercopy')\"><span class=\"nowrap\"><img class=\"".($copies_count > 5 ? "plus" : "minus")."\" src=\"pic/trans.gif\" alt=\"Show/Hide\" id=\"picothercopy\" title=\"".$lang_detail['title_show_or_hide']."\" /> ".$lang_details['row_other_copies']."</span></a>", "<b>".$copies_count.$lang_details['text_other_copies']." </b><br /><div id='kothercopy' style=\"".($copies_count > 5 ? "display: none;" : "display: block;")."\">".$s."</div>",1);
tr("<a href=\"javascript: klappe_news('othercopy')\"><span class=\"nowrap\"><img class=\"".($copies_count > 5 ? "plus" : "minus")."\" src=\"pic/trans.gif\" alt=\"Show/Hide\" id=\"picothercopy\" title=\"".$lang_details['title_show_or_hide']."\" /> ".$lang_details['row_other_copies']."</span></a>", "<b>".$copies_count.$lang_details['text_other_copies']." </b><br /><div id='kothercopy' style=\"".($copies_count > 5 ? "display: none;" : "display: block;")."\">".$s."</div>",1);
}
}
@@ -505,7 +506,7 @@ else {
tr($lang_details['row_health'], $health, 1);*/
tr("<span id=\"seeders\"></span><span id=\"leechers\"></span>".$lang_details['row_peers']."<br /><span id=\"showpeer\"><a href=\"javascript: viewpeerlist(".$row['id'].");\" class=\"sublink\">".$lang_details['text_see_full_list']."</a></span><span id=\"hidepeer\" style=\"display: none;\"><a href=\"javascript: hidepeerlist();\" class=\"sublink\">".$lang_details['text_hide_list']."</a></span>", "<div id=\"peercount\"><b>".$row['seeders'].$lang_details['text_seeders'].add_s($row['seeders'])."</b> | <b>".$row['leechers'].$lang_details['text_leechers'].add_s($row['leechers'])."</b></div><div id=\"peerlist\"></div>" , 1);
if ($_GET['dllist'] == 1)
if (isset($_GET['dllist']) && $_GET['dllist'] == 1)
{
$scronload = "viewpeerlist(".$row['id'].")";
@@ -562,7 +563,7 @@ if ($CURUSER['showcomment'] != 'no'){
{
print("<br /><br />");
print("<h1 align=\"center\" id=\"startcomments\">" .$lang_details['h1_user_comments'] . "</h1>\n");
list($pagertop, $pagerbottom, $limit) = pager(10, $count, "details.php?id=$id&cmtpage=1&", array(lastpagedefault => 1), "page");
list($pagertop, $pagerbottom, $limit) = pager(10, $count, "details.php?id=$id&cmtpage=1&", array('lastpagedefault' => 1), "page");
$subres = sql_query("SELECT id, text, user, added, editedby, editdate FROM comments WHERE torrent = $id ORDER BY id $limit") or sqlerr(__FILE__, __LINE__);
$allrows = array();

View File

@@ -4,7 +4,7 @@ dbconn();
$id = (int)$_GET["id"];
if (!$id)
httperr();
$passkey = $_GET['passkey'];
$passkey = $_GET['passkey'] ?? '';
if ($passkey){
$res = sql_query("SELECT * FROM users WHERE passkey=". sqlesc($passkey)." LIMIT 1");
$user = mysql_fetch_array($res);
@@ -20,7 +20,7 @@ else
{
loggedinorreturn();
parked();
$letdown = $_GET['letdown'];
$letdown = $_GET['letdown'] ?? 0;
if (!$letdown && $CURUSER['showdlnotice'] == 1)
{
header("Location: " . get_protocol_prefix() . "$BASEURL/downloadnotice.php?torrentid=".$id."&type=firsttime");

View File

@@ -5,7 +5,7 @@ require_once(get_langfile_path());
loggedinorreturn();
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
$torrentid = 0+$_POST['id'];
$torrentid = $_POST['id'] ?? 0;
$type = $_POST['type'];
$hidenotice = $_POST['hidenotice'];
if (!$torrentid || !in_array($type,array('firsttime', 'client', 'ratio')))

View File

@@ -13,8 +13,8 @@ $dirname = $_GET["torrentid"];
if (!$filename || !$dirname)
die("File name missing\n");
$filename = 0 + $filename;
$dirname = 0 + $dirname;
$filename = $filename ?? 0;
$dirname = $dirname ?? 0;
$res = sql_query("SELECT * FROM subs WHERE id=$filename") or sqlerr(__FILE__, __LINE__);
$arr = mysql_fetch_assoc($res);

View File

@@ -4,7 +4,7 @@ dbconn();
require_once(get_langfile_path());
loggedinorreturn();
$id = 0 + $_GET['id'];
$id = $_GET['id'] ?? 0;
if (!$id)
die();

View File

@@ -1,7 +1,7 @@
<?php
require "include/bittorrent.php";
dbconn();
$id = 0 + $_GET["id"];
$id = $_GET["id"] ?? 0;
int_check($id,true);
$res = sql_query("SELECT username, class, email FROM users WHERE id=".mysql_real_escape_string($id));

View File

@@ -108,7 +108,7 @@ elseif ($_GET[action] == "editsect" && $_POST[id] != NULL && $_POST[title] != NU
// ACTION: delete - delete a section or item
elseif ($_GET[action] == "delete" && isset($_GET[id])) {
if ($_GET[confirm] == "yes") {
sql_query("DELETE FROM `faq` WHERE `id`=".sqlesc(0+$_GET[id])." LIMIT 1") or sqlerr();
sql_query("DELETE FROM `faq` WHERE `id`=".sqlesc($_GET[id] ?? 0)." LIMIT 1") or sqlerr();
header("Location: " . get_protocol_prefix() . "$BASEURL/faqmanage.php");
die;
}
@@ -132,8 +132,8 @@ elseif ($_GET[action] == "additem" && $_GET[inid] && $_GET[langid]) {
print("<tr><td>Question:</td><td><input style=\"width: 600px;\" type=\"text\" name=\"question\" value=\"\" /></td></tr>\n");
print("<tr><td style=\"vertical-align: top;\">Answer:</td><td><textarea rows=20 style=\"width: 600px; height=600px;\" name=\"answer\"></textarea></td></tr>\n");
print("<tr><td>Status:</td><td><select name=\"flag\" style=\"width: 110px;\"><option value=\"0\" style=\"color: #FF0000;\">Hidden</option><option value=\"1\" style=\"color: #000000;\">Normal</option><option value=\"2\" style=\"color: #0000FF;\">Updated</option><option value=\"3\" style=\"color: #008000;\" selected=\"selected\">New</option></select></td></tr>");
print("<input type=hidden name=categ value=\"".(0+$_GET[inid])."\">");
print("<input type=hidden name=langid value=\"".(0+$_GET[langid])."\">");
print("<input type=hidden name=categ value=\"".($_GET[inid] ?? 0)."\">");
print("<input type=hidden name=langid value=\"".($_GET[langid] ?? 0)."\">");
print("<tr><td colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"Add\" style=\"width: 60px;\"></td></tr>\n");
print("</table></form>");
end_main_frame();
@@ -168,23 +168,23 @@ elseif ($_GET[action] == "addsection") {
elseif ($_GET[action] == "addnewitem" && $_POST[question] != NULL && $_POST[answer] != NULL) {
$question = $_POST[question];
$answer = $_POST[answer];
$categ = 0+$_POST[categ];
$langid = 0+$_POST[langid];
$categ = $_POST[categ] ?? 0;
$langid = $_POST[langid] ?? 0;
$res = sql_query("SELECT MAX(`order`) AS maxorder, MAX(`link_id`) AS maxlinkid FROM `faq` WHERE `type`='item' AND `categ`=".sqlesc($categ)." AND lang_id=".sqlesc($langid));
while ($arr = mysql_fetch_array($res, MYSQL_BOTH))
{
$order = $arr['maxorder'] + 1;
$link_id = $arr['maxlinkid']+1;
}
sql_query("INSERT INTO `faq` (`link_id`, `type`, `lang_id`, `question`, `answer`, `flag`, `categ`, `order`) VALUES ('$link_id', 'item', ".sqlesc($langid).", ".sqlesc($question).", ".sqlesc($answer).", " . sqlesc(0+$_POST[flag]) . ", ".sqlesc($categ).", ".sqlesc($order).")") or sqlerr();
sql_query("INSERT INTO `faq` (`link_id`, `type`, `lang_id`, `question`, `answer`, `flag`, `categ`, `order`) VALUES ('$link_id', 'item', ".sqlesc($langid).", ".sqlesc($question).", ".sqlesc($answer).", " . sqlesc($_POST['flag'] ?? 0) . ", ".sqlesc($categ).", ".sqlesc($order).")") or sqlerr();
header("Location: " . get_protocol_prefix() . "$BASEURL/faqmanage.php");
die;
}
// subACTION: addnewsect - add a new section to the db
elseif ($_GET[action] == "addnewsect" && $_POST[title] != NULL && $_POST[flag] != NULL) {
$title = $_POST[title];
$language = 0+$_POST['language'];
elseif ($_GET['action'] == "addnewsect" && $_POST['title'] != NULL && $_POST['flag'] != NULL) {
$title = $_POST['title'];
$language = $_POST['language'] ?? 0;
$res = sql_query("SELECT MAX(`order`) AS maxorder, MAX(`link_id`) AS maxlinkid FROM `faq` WHERE `type`='categ' AND `lang_id` = ".sqlesc($language));
while ($arr = mysql_fetch_array($res, MYSQL_BOTH)) {$order = $arr['maxorder'] + 1;$link_id = $arr['maxlinkid']+1;}
sql_query("INSERT INTO `faq` (`link_id`,`type`,`lang_id`, `question`, `answer`, `flag`, `categ`, `order`) VALUES (".sqlesc($link_id).",'categ', ".sqlesc($language).", ".sqlesc($title).", '', ".sqlesc($_POST[flag]).", '0', ".sqlesc($order).")") or sqlerr();

View File

@@ -258,7 +258,7 @@ $action = htmlspecialchars(trim($_GET["action"] ?? ''));
//-------- Action: New topic
if ($action == "newtopic")
{
$forumid = 0+$_GET["forumid"];
$forumid = $_GET["forumid"] ?? 0;
check_whether_exist($forumid, 'forum');
stdhead($lang_forums['head_new_topic']);
begin_main_frame();
@@ -269,7 +269,7 @@ if ($action == "newtopic")
}
if ($action == "quotepost")
{
$postid = 0+$_GET["postid"];
$postid = $_GET["postid"] ?? 0;
check_whether_exist($postid, 'post');
stdhead($lang_forums['head_post_reply']);
begin_main_frame();
@@ -283,7 +283,7 @@ if ($action == "quotepost")
if ($action == "reply")
{
$topicid = 0+$_GET["topicid"];
$topicid = $_GET["topicid"] ?? 0;
check_whether_exist($topicid, 'topic');
stdhead($lang_forums['head_post_reply']);
begin_main_frame();
@@ -297,7 +297,7 @@ if ($action == "reply")
if ($action == "editpost")
{
$postid = 0+$_GET["postid"];
$postid = $_GET["postid"] ?? 0;
check_whether_exist($postid, 'post');
$res = sql_query("SELECT userid, topicid FROM posts WHERE id=".sqlesc($postid)) or sqlerr(__FILE__, __LINE__);
@@ -383,7 +383,7 @@ if ($action == "post")
if ($body == "")
stderr($lang_forums['std_error'], $lang_forums['std_no_body_text']);
$userid = 0+$CURUSER["id"];
$userid = $CURUSER["id"] ?? 0;
$date = date("Y-m-d H:i:s");
if ($type != 'new'){
@@ -829,9 +829,9 @@ if ($action == "viewtopic")
if ($action == "movetopic")
{
$forumid = 0+$_POST["forumid"];
$forumid = $_POST["forumid"] ?? 0;
$topicid = 0+$_GET["topicid"];
$topicid = $_GET["topicid"] ?? 0;
$ismod = is_forum_moderator($topicid,'topic');
if (!is_valid_id($forumid) || !is_valid_id($topicid) || (get_user_class() < $postmanage_class && !$ismod))
permissiondenied();
@@ -885,7 +885,7 @@ if ($action == "movetopic")
if ($action == "deletetopic")
{
$topicid = 0+$_GET["topicid"];
$topicid = $_GET["topicid"] ?? 0;
$res1 = sql_query("SELECT forumid, userid FROM topics WHERE id=".sqlesc($topicid)." LIMIT 1") or sqlerr(__FILE__, __LINE__);
$row1 = mysql_fetch_array($res1);
if (!$row1){
@@ -899,7 +899,7 @@ if ($action == "deletetopic")
if (!is_valid_id($topicid) || (get_user_class() < $postmanage_class && !$ismod))
permissiondenied();
$sure = 0+$_GET["sure"];
$sure = $_GET["sure"] ?? 0;
if (!$sure)
{
stderr($lang_forums['std_delete_topic'], $lang_forums['std_delete_topic_note'] .
@@ -929,8 +929,8 @@ if ($action == "deletetopic")
if ($action == "deletepost")
{
$postid = 0+$_GET["postid"];
$sure = 0+$_GET["sure"];
$postid = $_GET["postid"] ?? 0;
$sure = $_GET["sure"] ?? 0;
$ismod = is_forum_moderator($postid, 'post');
if ((get_user_class() < $postmanage_class && !$ismod) || !is_valid_id($postid))
@@ -1038,9 +1038,9 @@ if ($action == "setsticky")
if ($action == "viewforum")
{
$forumid = 0+$_GET["forumid"];
$forumid = $_GET["forumid"] ?? 0;
int_check($forumid,true);
$userid = 0+$CURUSER["id"];
$userid = $CURUSER["id"] ?? 0;
//------ Get forum name, moderators
$row = get_forum_row($forumid);
if (!$row){

10
fun.php
View File

@@ -12,7 +12,7 @@ if (!$action)
}
if ($action == 'delete')
{
$id = 0+$_GET["id"];
$id = $_GET["id"] ?? 0;
int_check($id,true);
$res = sql_query("SELECT userid FROM fun WHERE id=$id") or sqlerr(__FILE__,__LINE__);
$arr = mysql_fetch_array($res);
@@ -20,7 +20,7 @@ if ($action == 'delete')
stderr($lang_fun['std_error'], $lang_fun['std_invalid_id']);
if (get_user_class() < $funmanage_class)
permissiondenied();
$sure = 0+$_GET["sure"];
$sure = $_GET["sure"] ?? 0;
$returnto = $_GET["returnto"] ? htmlspecialchars($_GET["returnto"]) : htmlspecialchars($_SERVER["HTTP_REFERER"]);
if (!$sure)
stderr($lang_fun['std_delete_fun'],$lang_fun['text_please_click'] ."<a class=altlink href=?action=delete&id=$id&returnto=$returnto&sure=1>".$lang_fun['text_here_if_sure'],false);
@@ -123,7 +123,7 @@ if ($row){
print("</body></html>");
}
if ($action == 'edit'){
$id = 0+$_GET["id"];
$id = $_GET["id"] ?? 0;
int_check($id,true);
$res = sql_query("SELECT * FROM fun WHERE id=$id") or sqlerr(__FILE__,__LINE__);
$arr = mysql_fetch_array($res);
@@ -165,7 +165,7 @@ if ($action == 'ban')
{
if (get_user_class() < $funmanage_class)
permissiondenied();
$id = 0+$_GET["id"];
$id = $_GET["id"] ?? 0;
int_check($id,true);
$res = sql_query("SELECT * FROM fun WHERE id=$id") or sqlerr(__FILE__,__LINE__);
$arr = mysql_fetch_array($res);
@@ -210,7 +210,7 @@ function funreward($funvote, $totalvote, $title, $posterid, $bonus)
if ($action == 'vote')
{
$id = 0+$_GET["id"];
$id = $_GET["id"] ?? 0;
int_check($id,true);
$res = sql_query("SELECT * FROM fun WHERE id=$id") or sqlerr(__FILE__,__LINE__);
$arr = mysql_fetch_array($res);

View File

@@ -141,8 +141,8 @@ if ($_SERVER['REQUEST_METHOD'] == "POST") {
$query[] = "iuplder=1";
}
$searchstr = mysql_real_escape_string(trim($_POST["search"] ?? ''));
if (empty($searchstr))
unset($searchstr);
// if (empty($searchstr))
// unset($searchstr);
if ($searchstr)
{
$query[] = "search=".rawurlencode($searchstr);

View File

@@ -161,7 +161,7 @@ function maketable($res, $mode = 'seeding')
return $ret;
}
$id = 0+$_GET['userid'];
$id = $_GET['userid'] ?? 0;
$type = $_GET['type'];
if (!in_array($type,array('uploaded','seeding','leeching','completed','incomplete')))
die;

View File

@@ -53,9 +53,9 @@ function docleanup($forceAll = 0, $printProgress = false) {
$torrentres = sql_query("select torrents.added, torrents.size, torrents.seeders from torrents LEFT JOIN peers ON peers.torrent = torrents.id WHERE peers.userid = $arr[userid] AND peers.seeder ='yes'") or sqlerr(__FILE__, __LINE__);
while ($torrent = mysql_fetch_array($torrentres))
{
$weeks_alive = ($timenow - strtotime($torrent[added])) / $sectoweek;
$gb_size = $torrent[size] / 1073741824;
$temp = (1 - exp($valueone * $weeks_alive)) * $gb_size * (1 + $sqrtof2 * exp($valuethree * ($torrent[seeders] - 1)));
$weeks_alive = ($timenow - strtotime($torrent['added'])) / $sectoweek;
$gb_size = $torrent['size'] / 1073741824;
$temp = (1 - exp($valueone * $weeks_alive)) * $gb_size * (1 + $sqrtof2 * exp($valuethree * ($torrent['seeders'] - 1)));
$A += $temp;
$count++;
}

View File

@@ -297,8 +297,8 @@ $oneinvite_bonus = $BONUS['oneinvite'];
$customtitle_bonus = $BONUS['customtitle'];
$vipstatus_bonus = $BONUS['vipstatus'];
$bonusgift_bonus = $BONUS['bonusgift'];
$basictax_bonus = 0+$BONUS['basictax'];
$taxpercentage_bonus = 0+$BONUS['taxpercentage'];
$basictax_bonus = $BONUS['basictax'];
$taxpercentage_bonus = $BONUS['taxpercentage'];
$prolinkpoint_bonus = $BONUS['prolinkpoint'];
$prolinktime_bonus = $BONUS['prolinktime'];
@@ -395,7 +395,7 @@ $SUBSPATH = "subs";
//Make sure you have wget installed on your OS
//replace "http://www.nexusphp.com/" with your own site address
$useCronTriggerCleanUp = false;
$useCronTriggerCleanUp = $MAIN['use_cron_trigger_cleanup'];
//some promotion rules
//$promotionrules_torrent = array(0 => array("mediumid" => array(1), "promotion" => 5), 1 => array("mediumid" => array(3), "promotion" => 5), 2 => array("catid" => array(402), "standardid" => array(3), "promotion" => 4), 3 => array("catid" => array(403), "standardid" => array(3), "promotion" => 4));
$promotionrules_torrent = array();

View File

@@ -1037,7 +1037,7 @@ function insert_suggest($keyword, $userid, $pre_escaped = true)
{
if(mb_strlen($keyword,"UTF-8") >= 2)
{
$userid = 0 + $userid;
$userid = $userid ?? 0;
if($userid)
sql_query("INSERT INTO suggest(keywords, userid, adddate) VALUES (" . ($pre_escaped == true ? "'" . $keyword . "'" : sqlesc($keyword)) . "," . sqlesc($userid) . ", NOW())") or sqlerr(__FILE__,__LINE__);
}
@@ -1053,7 +1053,7 @@ function get_external_tr($imdb_url = "")
function get_torrent_extinfo_identifier($torrentid)
{
$torrentid = 0 + $torrentid;
$torrentid = $torrentid ?? 0;
$result = array('imdb_id');
unset($result);
@@ -1796,7 +1796,7 @@ function userlogin() {
//return;
}
$b_id = base64($_COOKIE["c_secure_uid"],false);
$id = 0 + $b_id;
$id = $b_id ?? 0;
if (!$id || !is_valid_id($id) || strlen($_COOKIE["c_secure_pass"]) != 32)
return;
@@ -2036,7 +2036,7 @@ function validemail($email) {
function validlang($langid) {
global $deflang;
$langid = 0 + $langid;
$langid = $langid ?? 0;
$res = sql_query("SELECT * FROM language WHERE site_lang = 1 AND id = " . sqlesc($langid)) or sqlerr(__FILE__, __LINE__);
if(mysql_num_rows($res) == 1)
{
@@ -2474,13 +2474,13 @@ if ($msgalert)
/*
$pending_invitee = $Cache->get_value('user_'.$CURUSER["id"].'_pending_invitee_count');
if ($pending_invitee == ""){
$pending_invitee = get_row_count("users","WHERE status = 'pending' AND invited_by = ".sqlesc($CURUSER[id]));
$pending_invitee = get_row_count("users","WHERE status = 'pending' AND invited_by = ".sqlesc($CURUSER['id']));
$Cache->cache_value('user_'.$CURUSER["id"].'_pending_invitee_count', $pending_invitee, 900);
}
if ($pending_invitee > 0)
{
$text = $lang_functions['text_your_friends'].add_s($pending_invitee).is_or_are($pending_invitee).$lang_functions['text_awaiting_confirmation'];
msgalert("invite.php?id=".$CURUSER[id],$text, "red");
msgalert("invite.php?id=".$CURUSER['id'],$text, "red");
}*/
$settings_script_name = $_SERVER["SCRIPT_FILENAME"];
if (!preg_match("/index/i", $settings_script_name))
@@ -2557,21 +2557,21 @@ function stdfoot() {
$year = substr($datefounded, 0, 4);
$yearfounded = ($year ? $year : 2007);
print(" (c) "." <a href=\"" . get_protocol_prefix() . $BASEURL."\" target=\"_self\">".$SITENAME."</a> ".($icplicense_main ? " ".$icplicense_main." " : "").(date("Y") != $yearfounded ? $yearfounded."-" : "").date("Y")." ".VERSION."<br /><br />");
printf ("[page created in <b> %f </b> sec", $totaltime);
print (" with <b>".count($query_name)."</b> db queries, <b>".$Cache->getCacheReadTimes()."</b> reads and <b>".$Cache->getCacheWriteTimes()."</b> writes of memcached and <b>".mksize(memory_get_usage())."</b> ram]");
printf ("[page created in <b> %s </b> ms", sprintf("%.1f", $totaltime * 1000));
print (" with <b>".count($query_name)."</b> db queries, <b>".$Cache->getCacheReadTimes()."</b> reads and <b>".$Cache->getCacheWriteTimes()."</b> writes of Redis and <b>".mksize(memory_get_usage())."</b> ram]");
print ("</div>\n");
if ($enablesqldebug_tweak == 'yes' && get_user_class() >= $sqldebug_tweak) {
print("<div id=\"sql_debug\">SQL query list: <ul>");
foreach($query_name as $query) {
print("<li>".htmlspecialchars($query)."</li>");
print(sprintf('<li>%s [%s ms]</li>', htmlspecialchars($query['query']), $query['time'] * 1000));
}
print("</ul>");
print("Memcached key read: <ul>");
print("Redis key read: <ul>");
foreach($Cache->getKeyHits('read') as $keyName => $hits) {
print("<li>".htmlspecialchars($keyName)." : ".$hits."</li>");
}
print("</ul>");
print("Memcached key write: <ul>");
print("Redis key write: <ul>");
foreach($Cache->getKeyHits('write') as $keyName => $hits) {
print("<li>".htmlspecialchars($keyName)." : ".$hits."</li>");
}
@@ -2731,7 +2731,7 @@ function pager($rpp, $count, $href, $opts = array(), $pagename = "page") {
}
if (isset($_GET[$pagename])) {
$page = 0 + $_GET[$pagename];
$page = $_GET[$pagename] ?? 0;
if ($page < 0)
$page = $pagedefault;
}
@@ -2817,14 +2817,14 @@ function commenttable($rows, $type, $parent_id, $review = false)
if ($count>=1)
{
if ($Advertisement->enable_ad()){
if ($commentad[$count-1])
if (!empty($commentad[$count-1]))
echo "<div align=\"center\" style=\"margin-top: 10px\" id=\"ad_comment_".$count."\">".$commentad[$count-1]."</div>";
}
}
print("<div style=\"margin-top: 8pt; margin-bottom: 8pt;\"><table id=\"cid".$row["id"]."\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"><tr><td class=\"embedded\" width=\"99%\">#" . $row["id"] . "&nbsp;&nbsp;<font color=\"gray\">".$lang_functions['text_by']."</font>");
print(get_username($row["user"],false,true,true,false,false,true));
print("&nbsp;&nbsp;<font color=\"gray\">".$lang_functions['text_at']."</font>".gettime($row["added"]).
($row["editedby"] && get_user_class() >= $commanage_class ? " - [<a href=\"comment.php?action=vieworiginal&amp;cid=".$row[id]."&amp;type=".$type."\">".$lang_functions['text_view_original']."</a>]" : "") . "</td><td class=\"embedded nowrap\" width=\"1%\"><a href=\"#top\"><img class=\"top\" src=\"pic/trans.gif\" alt=\"Top\" title=\"Top\" /></a>&nbsp;&nbsp;</td></tr></table></div>");
($row["editedby"] && get_user_class() >= $commanage_class ? " - [<a href=\"comment.php?action=vieworiginal&amp;cid=".$row['id']."&amp;type=".$type."\">".$lang_functions['text_view_original']."</a>]" : "") . "</td><td class=\"embedded nowrap\" width=\"1%\"><a href=\"#top\"><img class=\"top\" src=\"pic/trans.gif\" alt=\"Top\" title=\"Top\" /></a>&nbsp;&nbsp;</td></tr></table></div>");
$avatar = ($CURUSER["avatars"] == "yes" ? htmlspecialchars(trim($userRow["avatar"])) : "");
if (!$avatar)
$avatar = "pic/default_avatar.png";
@@ -2842,8 +2842,8 @@ function commenttable($rows, $type, $parent_id, $review = false)
print("<td class=\"rowfollow\" width=\"150\" valign=\"top\" style=\"padding: 0px;\">".return_avatar_image($avatar)."</td>\n");
print("<td class=\"rowfollow\" valign=\"top\"><br />".$text.$text_editby."</td>\n");
print("</tr>\n");
$actionbar = "<a href=\"comment.php?action=add&amp;sub=quote&amp;cid=".$row[id]."&amp;pid=".$parent_id."&amp;type=".$type."\"><img class=\"f_quote\" src=\"pic/trans.gif\" alt=\"Quote\" title=\"".$lang_functions['title_reply_with_quote']."\" /></a>".
"<a href=\"comment.php?action=add&amp;pid=".$parent_id."&amp;type=".$type."\"><img class=\"f_reply\" src=\"pic/trans.gif\" alt=\"Add Reply\" title=\"".$lang_functions['title_add_reply']."\" /></a>".(get_user_class() >= $commanage_class ? "<a href=\"comment.php?action=delete&amp;cid=".$row[id]."&amp;type=".$type."\"><img class=\"f_delete\" src=\"pic/trans.gif\" alt=\"Delete\" title=\"".$lang_functions['title_delete']."\" /></a>" : "").($row["user"] == $CURUSER["id"] || get_user_class() >= $commanage_class ? "<a href=\"comment.php?action=edit&amp;cid=".$row[id]."&amp;type=".$type."\"><img class=\"f_edit\" src=\"pic/trans.gif\" alt=\"Edit\" title=\"".$lang_functions['title_edit']."\" />"."</a>" : "");
$actionbar = "<a href=\"comment.php?action=add&amp;sub=quote&amp;cid=".$row['id']."&amp;pid=".$parent_id."&amp;type=".$type."\"><img class=\"f_quote\" src=\"pic/trans.gif\" alt=\"Quote\" title=\"".$lang_functions['title_reply_with_quote']."\" /></a>".
"<a href=\"comment.php?action=add&amp;pid=".$parent_id."&amp;type=".$type."\"><img class=\"f_reply\" src=\"pic/trans.gif\" alt=\"Add Reply\" title=\"".$lang_functions['title_add_reply']."\" /></a>".(get_user_class() >= $commanage_class ? "<a href=\"comment.php?action=delete&amp;cid=".$row['id']."&amp;type=".$type."\"><img class=\"f_delete\" src=\"pic/trans.gif\" alt=\"Delete\" title=\"".$lang_functions['title_delete']."\" /></a>" : "").($row["user"] == $CURUSER["id"] || get_user_class() >= $commanage_class ? "<a href=\"comment.php?action=edit&amp;cid=".$row['id']."&amp;type=".$type."\"><img class=\"f_edit\" src=\"pic/trans.gif\" alt=\"Edit\" title=\"".$lang_functions['title_edit']."\" />"."</a>" : "");
print("<tr><td class=\"toolbox\"> ".("'".$userRow['last_access']."'"> $dt ? "<img class=\"f_online\" src=\"pic/trans.gif\" alt=\"Online\" title=\"".$lang_functions['title_online']."\" />":"<img class=\"f_offline\" src=\"pic/trans.gif\" alt=\"Offline\" title=\"".$lang_functions['title_offline']."\" />" )."<a href=\"sendmessage.php?receiver=".htmlspecialchars(trim($row["user"]))."\"><img class=\"f_pm\" src=\"pic/trans.gif\" alt=\"PM\" title=\"".$lang_functions['title_send_message_to'].htmlspecialchars($userRow["username"])."\" /></a><a href=\"report.php?commentid=".htmlspecialchars(trim($row["id"]))."\"><img class=\"f_report\" src=\"pic/trans.gif\" alt=\"Report\" title=\"".$lang_functions['title_report_this_comment']."\" /></a></td><td class=\"toolbox\" align=\"right\">".$actionbar."</td>");
print("</tr></table>\n");
@@ -2933,8 +2933,8 @@ function return_torrent_bookmark_array($userid)
function get_torrent_bookmark_state($userid, $torrentid, $text = false)
{
global $lang_functions;
$userid = 0 + $userid;
$torrentid = 0 + $torrentid;
$userid = $userid ?? 0;
$torrentid = $torrentid ?? 0;
$ret = array();
$ret = return_torrent_bookmark_array($userid);
if (!count($ret) || !in_array($torrentid, $ret, false)) // already bookmarked
@@ -2969,7 +2969,7 @@ function torrenttable($res, $variant = "torrent") {
if ($last_browse > $time_now) {
$last_browse=$time_now;
}
$wait = 0;
if (get_user_class() < UC_VIP && $waitsystem == "yes") {
$ratio = get_ratio($CURUSER["id"], false);
$gigs = $CURUSER["uploaded"] / (1024*1024*1024);
@@ -3006,7 +3006,7 @@ foreach ($_GET as $get_name => $get_value) {
if ($count_get > 0) {
$oldlink = $oldlink . "&amp;";
}
$sort = $_GET['sort'];
$sort = $_GET['sort'] ?? '';
$link = array();
for ($i=1; $i<=9; $i++){
if ($sort == $i)
@@ -3180,6 +3180,8 @@ while ($row = mysql_fetch_assoc($res))
//comments
$nl = "<br />";
$lastcom_tooltip = [];
$torrent_tooltip = [];
if (!$row["comments"]) {
print("<a href=\"comment.php?action=add&amp;pid=".$id."&amp;type=torrent\" title=\"".$lang_functions['title_add_comments']."\">" . $row["comments"] . "</a>");
} else {
@@ -3236,7 +3238,7 @@ while ($row = mysql_fetch_assoc($res))
print("<td class=\"rowfollow\">0</td>\n");
if ($row["times_completed"] >=1)
print("<td class=\"rowfollow\"><a href=\"viewsnatches.php?id=".$row[id]."\"><b>" . number_format($row["times_completed"]) . "</b></a></td>\n");
print("<td class=\"rowfollow\"><a href=\"viewsnatches.php?id=".$row['id']."\"><b>" . number_format($row["times_completed"]) . "</b></a></td>\n");
else
print("<td class=\"rowfollow\">" . number_format($row["times_completed"]) . "</td>\n");
@@ -3255,7 +3257,7 @@ while ($row = mysql_fetch_assoc($res))
if (get_user_class() >= $torrentmanage_class)
{
print("<td class=\"rowfollow\"><a href=\"".htmlspecialchars("fastdelete.php?id=".$row[id])."\"><img class=\"staff_delete\" src=\"pic/trans.gif\" alt=\"D\" title=\"".$lang_functions['text_delete']."\" /></a>");
print("<td class=\"rowfollow\"><a href=\"".htmlspecialchars("fastdelete.php?id=".$row['id'])."\"><img class=\"staff_delete\" src=\"pic/trans.gif\" alt=\"D\" title=\"".$lang_functions['text_delete']."\" /></a>");
print("<br /><a href=\"edit.php?returnto=" . rawurlencode($_SERVER["REQUEST_URI"]) . "&amp;id=" . $row["id"] . "\"><img class=\"staff_edit\" src=\"pic/trans.gif\" alt=\"E\" title=\"".$lang_functions['text_edit']."\" /></a></td>\n");
}
print("</tr>\n");
@@ -3274,7 +3276,7 @@ function get_username($id, $big = false, $link = true, $bold = true, $target = f
{
static $usernameArray = array();
global $lang_functions;
$id = 0+$id;
$id = (int)$id;
if (func_num_args() == 1 && isset($usernameArray[$id])) { //One argument=is default display of username. Get it directly from static array if available
return $usernameArray[$id];

View File

@@ -198,8 +198,8 @@ function check_client($peer_id, $agent, &$agent_familyid)
{
if($row_allowed_ua['peer_id_matchtype'] == 'dec')
{
$match_target[$i+1] = 0 + $match_target[$i+1];
$match_bench[$i+1] = 0 + $match_bench[$i+1];
$match_target[$i+1] = $match_target[$i+1] ?? 0;
$match_bench[$i+1] = $match_bench[$i+1] ?? 0;
}
else if($row_allowed_ua['peer_id_matchtype'] == 'hex')
{
@@ -248,8 +248,8 @@ function check_client($peer_id, $agent, &$agent_familyid)
{
if($row_allowed_ua['agent_matchtype'] == 'dec')
{
$match_target[$i+1] = 0 + $match_target[$i+1];
$match_bench[$i+1] = 0 + $match_bench[$i+1];
$match_target[$i+1] = $match_target[$i+1] ?? 0;
$match_bench[$i+1] = $match_bench[$i+1] ?? 0;
}
else if($row_allowed_ua['agent_matchtype'] == 'hex')
{

View File

@@ -67,9 +67,14 @@ function getip() {
function sql_query($query)
{
$begin = getmicrotime();
global $query_name;
$query_name[] = $query;
return mysql_query($query);
$result = mysql_query($query);
$query_name[] = [
'query' => $query,
'time' => sprintf('%.3f', getmicrotime() - $begin),
];
return $result;
}
function sqlesc($value) {

View File

@@ -269,8 +269,8 @@ if ($CURUSER && $showpolls_main == "yes")
print("</h2>");
if ($pollexists)
{
$pollid = 0+$arr["id"];
$userid = 0+$CURUSER["id"];
$pollid = $arr["id"] ?? 0;
$userid = $CURUSER["id"];
$question = $arr["question"];
$o = array($arr["option0"], $arr["option1"], $arr["option2"], $arr["option3"], $arr["option4"],
$arr["option5"], $arr["option6"], $arr["option7"], $arr["option8"], $arr["option9"],

View File

@@ -7,7 +7,7 @@ loggedinorreturn();
if (get_user_class() < $userprofile_class)
permissiondenied();
$userid = 0 + $_GET["id"];
$userid = $_GET["id"] ?? 0;
if (!is_valid_id($userid))
stderr($lang_iphistory['std_error'], $lang_iphistory['std_invalid_id']);

View File

@@ -84,7 +84,7 @@ $lang_details = array
'row_last_seeder' => "最近活动:",
'text_ago' => "以前",
'text_size' => "<b>大小:</b>",
'text_none_yet' => "暂无(需要".$minvotes."票,现在只有",
'text_none_yet' => "暂无(需要".$TORRENT['minvotes']."票,现在只有",
'text_only' => "",
'text_none' => "",
'text_no_votes_yet' => "暂无评分",

View File

@@ -84,7 +84,7 @@ $lang_details = array
'row_last_seeder' => "最近現行:",
'text_ago' => "以前",
'text_size' => "<b>大小:</b>",
'text_none_yet' => "暫無(需要".$minvotes."票,現在只有",
'text_none_yet' => "暫無(需要".$TORRENT['minvotes']."票,現在只有",
'text_only' => "",
'text_none' => "",
'text_no_votes_yet' => "暫無評分",

View File

@@ -84,7 +84,7 @@ $lang_details = array
'row_last_seeder' => "Last&nbsp;Action:&nbsp;",
'text_ago' => " ago",
'text_size' => "Size: ",
'text_none_yet' => "none yet (needs at least ".$minvotes." votes and has got ",
'text_none_yet' => "none yet (needs at least ".$TORRENT['minvotes']." votes and has got ",
'text_only' => "only ",
'text_none' => "none",
'text_no_votes_yet' => "No votes yet",

View File

@@ -81,7 +81,7 @@ elseif (get_user_class() < $linkmanage_class)
permissiondenied();
else{
if ($_GET['action'] == "del") {
$id = 0 + $_GET['id'];
$id = $_GET['id'] ?? 0;
if (!$id) { header("Location: linksmanage.php"); die();}
$result = sql_query ("SELECT * FROM links where id = '".$id."'");
if ($row = mysql_fetch_array($result))
@@ -148,7 +148,7 @@ echo "<tr><td>".$row["name"]."</td><td>".$row["url"]."</td><td>".$row["title"].
echo "</table>";
?>
<?php if ($_GET['action'] == "edit") {
$id = 0 + ($_GET["id"]);
$id = ($_GET["id"] ?? 0);
$result = sql_query ("SELECT * FROM links where id = ".sqlesc($id));
if ($row = mysql_fetch_array($result)) {
?>

View File

@@ -32,7 +32,7 @@ if($delid > 0) {
$edited = $_GET['edited'];
if($edited == 1) {
$id = 0 + $_GET['id'];
$id = $_GET['id'] ?? 0;
$name = $_GET['name'];
$flagpic = $_GET['flagpic'];
$location_main = $_GET['location_main'];
@@ -65,7 +65,7 @@ if($edited == 1) {
}
$editid = 0 + $_GET['editid'];
$editid = $_GET['editid'] ?? 0;
if($editid > 0) {
$query = "SELECT * FROM locations WHERE id=" . sqlesc($editid);

View File

@@ -177,10 +177,10 @@ else {
elseif (isset($_POST['do']) && $_POST['do'] == "add")
sql_query ("INSERT INTO chronicle (userid,added, txt) VALUES ('".$CURUSER["id"]."', now(), ".sqlesc($txt).")") or sqlerr(__FILE__, __LINE__);
elseif (isset($_POST['do'] ) && $_POST['do'] == "update"){
$id = 0 + $_POST['id'];
$id = $_POST['id'] ?? 0;
if (!$id) { header("Location: log.php?action=chronicle"); die();}
else sql_query ("UPDATE chronicle SET txt=".sqlesc($txt)." WHERE id=".$id) or sqlerr(__FILE__, __LINE__);}
else {$id = 0 + ($_GET['id'] ?? 0);
else {$id = ($_GET['id'] ?? 0);
if (!$id) { header("Location: log.php?action=chronicle"); die();}
elseif ($_GET['do'] == "del")
sql_query ("DELETE FROM chronicle where id = '".$id."'") or sqlerr(__FILE__, __LINE__);

View File

@@ -4,7 +4,7 @@ dbconn();
loggedinorreturn();
if (get_user_class() < UC_SYSOP)
stderr("Error", "Permission denied.");
$class = 0 + $_POST["class"];
$class = $_POST["class"] ?? 0;
if ($class)
int_check($class,true);
$or = $_POST["or"];

View File

@@ -33,7 +33,7 @@ function searchform () {
<?php
}
$countrows = number_format(get_row_count("loginattempts")) + 1;
$page = 0 + $_GET["page"];
$page = $_GET["page"] ?? 0;
$order = $_GET['order'];
if ($order == 'id')
@@ -120,7 +120,7 @@ stdfoot();
stdfoot();
}elseif ($action == 'save') {
$id = sqlesc(0+$_POST['id']);
$id = sqlesc($_POST['id']);
$ip = sqlesc($_POST['ip']);
$attempts = sqlesc($_POST['attempts']);
$type = sqlesc($_POST['type']);

View File

@@ -63,7 +63,7 @@ elseif ($_GET["act"] == "edit"){
stdfoot();
}
elseif ($_GET["act"]=="edited"){
$id = 0+$_POST["id"];
$id = $_POST["id"] ?? 0;
$title = $_POST["title"];
$text = $_POST["text"];
$language = $_POST["language"];
@@ -71,8 +71,8 @@ elseif ($_GET["act"]=="edited"){
header("Refresh: 0; url=modrules.php");
}
elseif ($_GET["act"]=="del"){
$id = 0+$_GET["id"];
$sure = 0+$_GET["sure"];
$id = (int)$_GET["id"];
$sure = $_GET["sure"] ?? 0;
if (!$sure)
{
stderr("Delete Rule","You are about to delete a rule. Click <a class=altlink href=?act=del&id=$id&sure=1>here</a> if you are sure.",false);

View File

@@ -151,7 +151,7 @@ $nr = mysql_num_rows($res);
<?php if ($act == "editforum") {
//EDIT PAGE FOR THE FORUMS
$id = 0+$_GET["id"];
$id = $_GET["id"] ?? 0;
$result = sql_query ("SELECT * FROM overforums where id = '$id'");
if ($row = mysql_fetch_array($result)) {

View File

@@ -384,13 +384,13 @@ if ($action == "exchange") {
}
elseif($art == 'gift_2') // charity giving
{
$points = 0+$_POST["bonuscharity"];
$points = $_POST["bonuscharity"] ?? 0;
if ($points < 1000 || $points > 50000){
stdmsg($lang_mybonus['text_error'], $lang_mybonus['bonus_amount_not_allowed_two'], 0);
stdfoot();
die();
}
$ratiocharity = 0.0+$_POST["ratiocharity"];
$ratiocharity = $_POST["ratiocharity"];
if ($ratiocharity < 0.1 || $ratiocharity > 0.8){
stdmsg($lang_mybonus['text_error'], $lang_mybonus['bonus_ratio_not_allowed']);
stdfoot();
@@ -416,7 +416,7 @@ if ($action == "exchange") {
}
elseif($art == "gift_1" && $bonusgift_bonus == 'yes') {
//=== trade for giving the gift of karma
$points = 0+$_POST["bonusgift"];
$points = $_POST["bonusgift"];
$message = $_POST["message"];
//==gift for peeps with no more options
$usernamegift = sqlesc(trim($_POST["username"]));

View File

@@ -12,12 +12,12 @@ $action = htmlspecialchars($_GET["action"]);
if ($action == 'delete')
{
$newsid = 0+$_GET["newsid"];
$newsid = $_GET["newsid"] ?? 0;
int_check($newsid,true);
$returnto = $_GET["returnto"] ? htmlspecialchars($_GET["returnto"]) : htmlspecialchars($_SERVER["HTTP_REFERER"]);
$sure = 0+$_GET["sure"];
$sure = $_GET["sure"] ?? 0;
if (!$sure)
stderr($lang_news['std_delete_news_item'], $lang_news['std_are_you_sure'] . "<a class=altlink href=?action=delete&newsid=$newsid&returnto=$returnto&sure=1>".$lang_news['std_here']."</a>".$lang_news['std_if_sure'],false);
@@ -59,7 +59,7 @@ if ($action == 'add')
if ($action == 'edit')
{
$newsid = 0+$_GET["newsid"];
$newsid = $_GET["newsid"] ?? 0;
int_check($newsid,true);
$res = sql_query("SELECT * FROM news WHERE id=".sqlesc($newsid)) or sqlerr(__FILE__, __LINE__);

View File

@@ -131,7 +131,7 @@ if (isset($_GET['off_details']) && $_GET["off_details"]){
if($off_details != '1')
stderr($lang_offers['std_error'], $lang_offers['std_smell_rat']);
$id = 0+$_GET["id"];
$id = $_GET["id"] ?? 0;
if(!$id)
die();
//stderr("Error", "I smell a rat!");
@@ -465,7 +465,7 @@ if (isset($_GET["vote"]) && $_GET["vote"]){
stderr($lang_offers['std_error'], $lang_offers['std_smell_rat']);
if ($vote =='yeah' || $vote =='against')
{
$userid = 0+$CURUSER["id"];
$userid = $CURUSER["id"] ?? 0;
$res = sql_query("SELECT * FROM offervotes WHERE offerid=".sqlesc($offerid)." AND userid=".sqlesc($userid)) or sqlerr(__FILE__,__LINE__);
$arr = mysql_fetch_assoc($res);
$voted = $arr;

View File

@@ -7,7 +7,7 @@ loggedinorreturn();
if (get_user_class() < $pollmanage_class)
permissiondenied();
$pollid = 0+$_GET['id'];
$pollid = $_GET['id'] ?? 0;
if ($pollid)
{

View File

@@ -62,7 +62,7 @@ countdown(time);
if(isset($_GET["sent"]) && $_GET["sent"]=="yes"){
if(!isset($_GET["shbox_text"]) || !$_GET['shbox_text'])
{
$userid=0+$CURUSER["id"];
$userid=$CURUSER["id"] ?? 0;
}
else
{
@@ -77,7 +77,7 @@ else
}
elseif ($_GET["type"] == 'shoutbox')
{
$userid=0+$CURUSER["id"];
$userid=$CURUSER["id"] ?? 0;
if (!$userid){
write_log("Someone is hacking shoutbox. - IP : ".getip(),'mod');
die($lang_shoutbox['text_no_permission_to_shoutbox']);

View File

@@ -68,7 +68,7 @@ if ($action == "viewpm")
if (get_user_class() < $staffmem_class)
permissiondenied();
$pmid = 0 + $_GET["pmid"];
$pmid = $_GET["pmid"] ?? 0;
$ress4 = sql_query("SELECT * FROM staffmessages WHERE id=".sqlesc($pmid));
$arr4 = mysql_fetch_assoc($ress4);
@@ -126,7 +126,7 @@ if ($action == "answermessage") {
permissiondenied();
$answeringto = $_GET["answeringto"];
$receiver = 0 + $_GET["receiver"];
$receiver = $_GET["receiver"] ?? 0;
int_check($receiver,true);
@@ -166,7 +166,7 @@ if ($action == "takeanswer") {
if (get_user_class() < $staffmem_class)
permissiondenied();
$receiver = 0 + $_POST["receiver"];
$receiver = $_POST["receiver"] ?? 0;
$answeringto = $_POST["answeringto"];
int_check($receiver,true);
@@ -195,7 +195,7 @@ $Cache->delete_value('staff_new_message_count');
if ($action == "deletestaffmessage") {
$id = 0 + $_GET["id"];
$id = $_GET["id"] ?? 0;
if (!is_numeric($id) || $id < 1 || floor($id) != $id)
die;
@@ -218,7 +218,7 @@ if ($action == "setanswered") {
if (get_user_class() < $staffmem_class)
permissiondenied();
$id = 0 + $_GET["id"];
$id = $_GET["id"] ?? 0;
sql_query ("UPDATE staffmessages SET answered=1, answeredby = $CURUSER[id] WHERE id = $id") or sqlerr();
$Cache->delete_value('staff_new_message_count');

View File

@@ -55,7 +55,7 @@ if ($lang_id)
}
if ($_SERVER["REQUEST_METHOD"] == "POST" && $_POST["action"] == "upload" && ($in_detail!= 'in_detail'))
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["action"]) && $_POST["action"] == "upload" && ($in_detail!= 'in_detail'))
{
//start process upload file
$file = $_FILES['file'];
@@ -72,7 +72,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && $_POST["action"] == "upload" && ($in
exit;
}
$accept_ext = array('sub' => sub, 'srt' => srt, 'zip' => zip, 'rar' => rar, 'ace' => ace, 'txt' => txt, 'SUB' => SUB, 'SRT' => SRT, 'ZIP' => ZIP, 'RAR' => RAR, 'ACE' => ACE, 'TXT' => TXT, 'ssa' => ssa, 'ass' => ass, 'cue' => cue);
$accept_ext = array('sub' => 'sub', 'srt' => 'srt', 'zip' => 'zip', 'rar' => 'rar', 'ace' => 'ace', 'txt' => 'txt', 'SUB' => 'SUB', 'SRT' => 'SRT', 'ZIP' => 'ZIP', 'RAR' => 'RAR', 'ACE' => 'ACE', 'TXT' => 'TXT', 'ssa' => 'ssa', 'ass' => 'ass', 'cue' => 'cue');
$ext_l = strrpos($file['name'], ".");
$ext = strtolower(substr($file['name'], $ext_l+1, strlen($file['name'])-($ext_l+1)));
@@ -158,7 +158,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST" && $_POST["action"] == "upload" && ($in
}
//end process language
if ($_POST['uplver'] == 'yes' && get_user_class()>=$beanonymous_class) {
if (isset($_POST['uplver']) && $_POST['uplver'] == 'yes' && get_user_class()>=$beanonymous_class) {
$anonymous = "yes";
$anon = "Anonymous";
}
@@ -206,12 +206,12 @@ if (get_user_class() >= $delownsub_class)
$a = mysql_fetch_assoc($r);
if (get_user_class() >= $submanage_class || $a["uppedby"] == $CURUSER["id"])
{
$sure = $_GET["sure"];
$sure = $_GET["sure"] ?? 0;
if ($sure == 1)
{
$reason = $_POST["reason"];
sql_query("DELETE FROM subs WHERE id=$delete") or sqlerr(__FILE__, __LINE__);
if (!unlink("$SUBSPATH/$a[torrent_id]/$a[id].$a[ext]"))
if (!@unlink("$SUBSPATH/$a[torrent_id]/$a[id].$a[ext]"))
{
stdmsg($lang_subtitles['std_error'], $lang_subtitles['std_this_file']."$a[filename]".$lang_subtitles['std_is_invalid']);
stdfoot();

View File

@@ -2,7 +2,7 @@
require_once("include/bittorrent.php");
dbconn();
require_once(get_langfile_path());
$id = isset($_POST['id']) ? 0+$_POST['id'] : (isset($_GET['id']) ? 0+$_GET['id'] : die());
$id = isset($_POST['id']) ? $_POST['id'] : (isset($_GET['id']) ? $_GET['id'] : die());
int_check($id,true);
$email = unesc(htmlspecialchars(trim($_POST["email"])));
if(isset($_POST[conusr]))

View File

@@ -36,7 +36,7 @@ $updateset = array();
//$shortfname = $matches[1];
//$dname = $row["save_as"];
$url = parse_imdb_id($_POST['url']);
$url = parse_imdb_id($_POST['url'] ?? '');
if ($enablenfo_main=='yes'){
$nfoaction = $_POST['nfoaction'];
@@ -68,7 +68,7 @@ if ($enablespecial == 'yes' && get_user_class() >= $movetorrent_class)
else $allowmove = false;
if ($oldcatmode != $newcatmode && !$allowmove)
bark($lang_takeedit['std_cannot_move_torrent']);
$updateset[] = "anonymous = '" . ($_POST["anonymous"] ? "yes" : "no") . "'";
$updateset[] = "anonymous = '" . (!empty($_POST["anonymous"]) ? "yes" : "no") . "'";
$updateset[] = "name = " . sqlesc($name);
$updateset[] = "descr = " . sqlesc($descr);
$updateset[] = "url = " . sqlesc($url);
@@ -84,14 +84,14 @@ $updateset[] = "team = " . sqlesc($_POST["team_sel"] ?? 0);
$updateset[] = "audiocodec = " . sqlesc($_POST["audiocodec_sel"] ?? 0);
if (get_user_class() >= $torrentmanage_class) {
if ($_POST["banned"]) {
if (!empty($_POST["banned"])) {
$updateset[] = "banned = 'yes'";
$_POST["visible"] = 0;
}
else
$updateset[] = "banned = 'no'";
}
$updateset[] = "visible = '" . ($_POST["visible"] ? "yes" : "no") . "'";
$updateset[] = "visible = '" . (!empty($_POST["visible"]) ? "yes" : "no") . "'";
if(get_user_class()>=$torrentonpromotion_class)
{
if(!isset($_POST["sel_spstate"]) || $_POST["sel_spstate"] == 1)
@@ -135,6 +135,7 @@ if(get_user_class()>=$torrentsticky_class)
}
$pick_info = "";
$place_info = "";
if(get_user_class()>=$torrentmanage_class && $CURUSER['picker'] == 'yes')
{
if(($_POST["sel_recmovie"] ?? 0) == 0)

View File

@@ -8,7 +8,7 @@ loggedinorreturn();
if ($_SERVER["REQUEST_METHOD"] != "POST")
stderr($lang_takemessage['std_error'], $lang_takemessage['std_permission_denied']);
$origmsg = 0+$_POST["origmsg"];
$origmsg = $_POST["origmsg"] ?? 0;
$msg = trim($_POST["body"]);
if ($_POST['forward'] == 1) //this is forwarding
{
@@ -35,7 +35,7 @@ if ($_SERVER["REQUEST_METHOD"] != "POST")
}
else
{
$receiver = 0+$_POST["receiver"];
$receiver = $_POST["receiver"] ?? 0;
if (!is_valid_id($receiver) || ($origmsg && !is_valid_id($origmsg)))
stderr($lang_takemessage['std_error'],$lang_takemessage['std_invalid_id']);
$bodyadd = "";

View File

@@ -30,7 +30,7 @@ $f = $_FILES["file"];
$fname = unesc($f["name"]);
if (empty($fname))
bark($lang_takeupload['std_empty_filename']);
if (get_user_class()>=$beanonymous_class && $_POST['uplver'] == 'yes') {
if (get_user_class()>=$beanonymous_class && isset($_POST['uplver']) && $_POST['uplver'] == 'yes') {
$anonymous = "yes";
$anon = "Anonymous";
}
@@ -39,7 +39,7 @@ else {
$anon = $CURUSER["username"];
}
$url = parse_imdb_id($_POST['url']);
$url = parse_imdb_id($_POST['url'] ?? '');
$nfo = '';
if ($enablenfo_main=='yes'){
@@ -67,14 +67,14 @@ $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"]);
$catid = ($_POST["type"] ?? 0);
$sourceid = ($_POST["source_sel"] ?? 0);
$mediumid = ($_POST["medium_sel"] ?? 0);
$codecid = ($_POST["codec_sel"] ?? 0);
$standardid = ($_POST["standard_sel"] ?? 0);
$processingid = ($_POST["processing_sel"] ?? 0);
$teamid = ($_POST["team_sel"] ?? 0);
$audiocodecid = ($_POST["audiocodec_sel"] ?? 0);
if (!is_valid_id($catid))
bark($lang_takeupload['std_category_unselected']);
@@ -214,7 +214,7 @@ $allowtorrents = user_can_upload("torrents");
$allowspecial = user_can_upload("music");
$catmod = get_single_value("categories","mode","WHERE id=".sqlesc($catid));
$offerid = $_POST['offer'];
$offerid = $_POST['offer'] ?? 0;
$is_offer=false;
if ($browsecatmode != $specialcatmode && $catmod == $specialcatmode){//upload to special section
if (!$allowspecial)

View File

@@ -4,7 +4,7 @@ dbconn();
loggedinorreturn();
if ($_GET['id'])
if (isset($_GET['id']))
stderr("Party is over!", "This trick doesn't work anymore. You need to click the button!");
$userid = $CURUSER["id"];
$torrentid = $_POST["id"];

View File

@@ -12,8 +12,7 @@ function print_array($array, $offset_symbol = "|--", $offset = "", $parent = "")
reset($array);
switch($array['type'])
switch($array['type'] ?? '')
{
case "string":
printf("<li><div align=left class=string> - <span class=icon>[STRING]</span> <span class=title>[%s]</span> <span class=length>(%d)</span>: <span class=value>%s</span></div></li>",$parent,$array['strlen'],$array['value']);
@@ -29,7 +28,7 @@ function print_array($array, $offset_symbol = "|--", $offset = "", $parent = "")
break;
case "dictionary":
printf("<li><div align=left class=dictionary> + <span class=icon>[DICT]</span> <span class=title>[%s]</span> <span class=length>(%d)</span></div>",$parent,$array['strlen']);
while (list($key, $val) = each($array))
foreach ($array as $key => $val)
{
if (is_array($val))
{
@@ -42,7 +41,7 @@ function print_array($array, $offset_symbol = "|--", $offset = "", $parent = "")
break;
default:
while (list($key, $val) = each($array))
foreach ($array as $key => $val)
{
if (is_array($val))
{

View File

@@ -16,7 +16,7 @@ if ($passkey){
die("account disabed or parked");
elseif ($_GET['linktype'] == 'dl')
$dllink = true;
$inclbookmarked=0+$_GET['inclbookmarked'];
$inclbookmarked=$_GET['inclbookmarked'] ?? 0;
if($inclbookmarked == 1)
{
$bookmarkarray = return_torrent_bookmark_array($user['id']);
@@ -26,7 +26,7 @@ if ($passkey){
}
}
}
$searchstr = mysql_real_escape_string(trim($_GET["search"]));
$searchstr = mysql_real_escape_string(trim($_GET["search"] ?? ''));
if (empty($searchstr))
unset($searchstr);
if (isset($searchstr)){
@@ -66,10 +66,10 @@ if (isset($searchstr)){
}
$limit = "";
$startindex = 0+$_GET['startindex'];
$startindex = $_GET['startindex'] ?? 0;
if ($startindex)
$limit .= $startindex.", ";
$showrows = 0+$_GET['rows'];
$showrows = $_GET['rows'] ?? 0;
if($showrows < 1 || $showrows > 50)
$showrows = 10;
$limit .= $showrows;
@@ -81,9 +81,9 @@ function get_where($tablename = "sources", $itemname = "source", $getname = "sou
$whereitemina = array();
foreach ($items as $item)
{
if ($_GET[$getname.$item[id]])
if (!empty($_GET[$getname.$item['id']]))
{
$whereitemina[] = $item[id];
$whereitemina[] = $item['id'];
}
}
if (count($whereitemina) >= 1){

View File

@@ -7,10 +7,10 @@ loggedinorreturn();
if (get_user_class() < UC_UPLOADER)
permissiondenied();
$year=0+$_GET['year'];
$year=$_GET['year'] ?? 0;
if (!$year || $year < 2000)
$year=date('Y');
$month=0+$_GET['month'];
$month=$_GET['month'] ?? 0;
if (!$month || $month<=0 || $month>12)
$month=date('m');
$order=$_GET['order'];

View File

@@ -280,7 +280,7 @@ tr($lang_usercp['row_school'], "<select name=school>$schools</select>", 1);
$updateset[] = "lang = " . sqlesc($sitelanguage);
}
$updateset[] = "torrentsperpage = " . min(100, 0 + $_POST["torrentsperpage"]);
$updateset[] = "torrentsperpage = " . min(100, $_POST["torrentsperpage"] ?? 0);
if ($showmovies['hot'] == "yes"){
$showhot = $_POST["show_hot"];
$updateset[] = "showhot = " . sqlesc($showhot);
@@ -323,9 +323,9 @@ tr($lang_usercp['row_school'], "<select name=school>$schools</select>", 1);
$updateset[] = "pmnum = " . $pmnum;
if ($showfunbox_main == 'yes'){$showfb = ($_POST["showfb"] == 'yes' ? "yes" : "no");
$updateset[] = "showfb = " . sqlesc($showfb);}
$sbnum = ($_POST["sbnum"] ? max(10, min(500, 0 + $_POST["sbnum"])) : 70);
$sbnum = ($_POST["sbnum"] ? max(10, min(500, $_POST["sbnum"] ?? 0)) : 70);
$updateset[] = "sbnum = " . $sbnum;
$sbrefresh = ($_POST["sbrefresh"] ? max(10, min(3600, 0 + $_POST["sbrefresh"])) : 120);
$sbrefresh = ($_POST["sbrefresh"] ? max(10, min(3600, $_POST["sbrefresh"] ?? 0)) : 120);
$updateset[] = "sbrefresh = " . $sbrefresh;
if ($_POST["hidehb"] == 'yes')
@@ -616,8 +616,8 @@ tr_small($lang_usercp['row_funbox'],"<input type=checkbox name=showfb".($CURUSER
$signatures = ($_POST["signatures"] != "" ? "yes" : "no");
$signature = htmlspecialchars( trim($_POST["signature"]) );
$updateset[] = "topicsperpage = " . min(100, 0 + $_POST["topicsperpage"]);
$updateset[] = "postsperpage = " . min(100, 0 + $_POST["postsperpage"]);
$updateset[] = "topicsperpage = " . min(100, $_POST["topicsperpage"] ?? 0);
$updateset[] = "postsperpage = " . min(100, $_POST["postsperpage"] ?? 0);
$updateset[] = "avatars = " . sqlesc($avatars);
if ($showtooltipsetting)
$updateset[] = "showlastpost = " . sqlesc($ttlastpost);
@@ -844,6 +844,7 @@ if (!$forumposts = $Cache->get_value('user_'.$CURUSER['id'].'_post_count')){
$forumposts = get_row_count("posts","WHERE userid=".$CURUSER['id']);
$Cache->cache_value('user_'.$CURUSER['id'].'_post_count', $forumposts, 3600);
}
$dayposts = 0;
if ($forumposts)
{
$seconds3 = (TIMENOW - strtotime($CURUSER["added"]));
@@ -915,8 +916,8 @@ while ($topicarr = mysql_fetch_assoc($res_topics))
/// GETTING USERID AND DATE OF LAST POST ///
$arr = get_post_row($topicarr['lastpost']);
$postid = 0 + $arr["id"];
$userid = 0 + $arr["userid"];
$postid = $arr["id"] ?? 0;
$userid = $arr["userid"] ?? 0;
$added = gettime($arr['added'],true,false);
/// GET NAME OF LAST POSTER ///

View File

@@ -8,7 +8,7 @@ if (get_user_class() < $viewuserlist_class)
permissiondenied();
$search = trim($_GET['search']);
$class = $_GET['class'];
$country = 0+$_GET['country'];
$country = $_GET['country'] ?? 0;
$letter = trim($_GET["letter"]);
if (strlen($letter) > 1)

View File

@@ -9,7 +9,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))
{
function dltable($name, $arr, $torrent)

View File

@@ -60,7 +60,7 @@ if ($count){
}
else
{
stdmsg($lang_viewsnatches['std_sorry'], $lang_viewsnatches['std_no_snatched_users']);
stdmsg($lang_viewsnatches['std_sorry'], $lang_viewsnatches['text_no_snatched_users']);
}
end_main_frame();
stdfoot();