fix warning

This commit is contained in:
xiaomlove
2020-12-30 02:37:43 +08:00
parent 398cf8607a
commit b92f152b67
9 changed files with 57 additions and 52 deletions
+2 -1
View File
@@ -23,6 +23,7 @@ $altsize = $_POST['altsize'] ?? '';
<body class="inframe">
<table width="100%">
<?php
$warning = "";
if ($Attach->enable_attachment())
{
if ($_SERVER["REQUEST_METHOD"] == "POST")
@@ -35,7 +36,7 @@ if ($Attach->enable_attachment())
$ext = strtolower(substr($origfilename, $ext_l+1, strlen($origfilename)-($ext_l+1)));
$banned_ext = array('exe', 'com', 'bat', 'msi');
$img_ext = array('jpeg', 'jpg', 'png', 'gif');
$warning = "";
if (!$file || $filesize == 0 || $file["name"] == "") // nothing received
{
$warning = $lang_attachment['text_nothing_received'];
+2 -2
View File
@@ -9,13 +9,13 @@ if (get_user_class() < $staffmem_class)
permissiondenied();
if ($_POST['setdealt']){
if (!empty($_POST['setdealt'])) {
$res = sql_query ("SELECT id FROM cheaters WHERE dealtwith=0 AND id IN (" . implode(", ", $_POST[delcheater]) . ")");
while ($arr = mysql_fetch_assoc($res))
sql_query ("UPDATE cheaters SET dealtwith=1, dealtby = $CURUSER[id] WHERE id = $arr[id]") or sqlerr();
$Cache->delete_value('staff_new_cheater_count');
}
elseif ($_POST['delete']){
elseif (!empty($_POST['delete'])) {
$res = sql_query ("SELECT id FROM cheaters WHERE id IN (" . implode(", ", $_POST[delcheater]) . ")");
while ($arr = mysql_fetch_assoc($res))
sql_query ("DELETE from cheaters WHERE id = $arr[id]") or sqlerr();
+2 -2
View File
@@ -18,7 +18,7 @@ function purge_neighbors_cache()
//make_folder("cache/" , get_langfolder_cookie() . "/neighbors");
$userid = $CURUSER['id'];
$action = $_GET['action'];
$action = $_GET['action'] ?? '';
if (!is_valid_id($userid))
stderr($lang_friends['std_error'], $lang_friends['std_invalid_id']."$userid.");
@@ -106,7 +106,7 @@ if ($action == 'delete')
stdhead($lang_friends['head_personal_lists_for']. $user['username']);
print("<p><table class=main border=0 cellspacing=0 cellpadding=0>".
"<tr><td class=embedded><h1 style='margin:0px'> " . $lang_friends['text_personallist'] . " ".get_username($user[id])."</h1></td></tr></table></p>\n");
"<tr><td class=embedded><h1 style='margin:0px'> " . $lang_friends['text_personallist'] . " ".get_username($user['id'])."</h1></td></tr></table></p>\n");
//Start: Friends
print("<table class=main width=737 border=0 cellspacing=0 cellpadding=0><tr><td class=embedded>");
+9 -7
View File
@@ -3,6 +3,7 @@ require "include/bittorrent.php";
dbconn(true);
require_once(get_langfile_path());
loggedinorreturn(true);
$userid = $CURUSER["id"];
if ($showextinfo['imdb'] == 'yes')
require_once ("imdb/imdb.class.php");
if ($_SERVER["REQUEST_METHOD"] == "POST")
@@ -166,7 +167,7 @@ if ($showfunbox_main == "yes" && (!isset($CURUSER) || $CURUSER['showfb'] == "yes
$Cache->cache_value('current_fun_vote_funny_count', $funvote, 756);
}
//check whether current user has voted
$funvoted = get_row_count("funvotes", "WHERE funid = ".sqlesc($row['id'])." AND userid=".sqlesc($CURUSER[id]));
$funvoted = get_row_count("funvotes", "WHERE funid = ".sqlesc($row['id'])." AND userid=".sqlesc($CURUSER['id']));
print ("<h2>".$lang_index['text_funbox']);
if ($CURUSER)
@@ -260,9 +261,9 @@ if ($CURUSER && $showpolls_main == "yes")
print("<font class=\"small\"> - [<a class=\"altlink\" href=\"makepoll.php?returnto=main\"><b>".$lang_index['text_new']."</b></a>]\n");
if ($pollexists)
{
print(" - [<a class=\"altlink\" href=\"makepoll.php?action=edit&amp;pollid=".$arr[id]."&amp;returnto=main\"><b>".$lang_index['text_edit']."</b></a>]\n");
print(" - [<a class=\"altlink\" href=\"log.php?action=poll&amp;do=delete&amp;pollid=".$arr[id]."&amp;returnto=main\"><b>".$lang_index['text_delete']."</b></a>]");
print(" - [<a class=\"altlink\" href=\"polloverview.php?id=".$arr[id]."\"><b>".$lang_index['text_detail']."</b></a>]");
print(" - [<a class=\"altlink\" href=\"makepoll.php?action=edit&amp;pollid=".$arr['id']."&amp;returnto=main\"><b>".$lang_index['text_edit']."</b></a>]\n");
print(" - [<a class=\"altlink\" href=\"log.php?action=poll&amp;do=delete&amp;pollid=".$arr['id']."&amp;returnto=main\"><b>".$lang_index['text_delete']."</b></a>]");
print(" - [<a class=\"altlink\" href=\"polloverview.php?id=".$arr['id']."\"><b>".$lang_index['text_detail']."</b></a>]");
}
print("</font>");
}
@@ -270,7 +271,7 @@ if ($CURUSER && $showpolls_main == "yes")
if ($pollexists)
{
$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"],
@@ -299,7 +300,7 @@ if ($CURUSER && $showpolls_main == "yes")
$os = array();
// Count votes
while ($arr2 = mysql_fetch_row($res))
while (($arr2 = mysql_fetch_row($res) !== null) && isset($vs[$arr2[0]]))
$vs[$arr2[0]] ++;
reset($o);
@@ -320,8 +321,9 @@ if ($CURUSER && $showpolls_main == "yes")
print("<table class=\"main\" width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n");
$Cache->end_whole_row();
$i = 0;
while ($a = $os[$i])
while (isset($os[$i]))
{
$a = $os[$i];
if ($tvotes == 0)
$p = 0;
else
+3 -2
View File
@@ -399,13 +399,14 @@ else {
reset($o);
for ($i = 0; $i < count($o); ++$i)
if ($o[$i])
if (isset($o[$i]) && isset($vs[$i]))
$os[$i] = array($vs[$i], $o[$i]);
print("<table width=100% class=main border=0 cellspacing=0 cellpadding=0>\n");
$i = 0;
while ($a = $os[$i])
while (isset($os[$i]))
{
$a = $os[$i];
if ($tvotes > 0)
$p = round($a[0] / $tvotes * 100);
else
+26 -25
View File
@@ -6,8 +6,9 @@ loggedinorreturn();
if (get_user_class() < $pollmanage_class)
permissiondenied();
$action = $_GET["action"];
$pollid = $_GET["pollid"];
$action = $_GET["action"] ?? '';
$pollid = $_GET["pollid"] ?? 0;
$poll = [];
if ($action == "edit")
{
@@ -20,7 +21,7 @@ if ($action == "edit")
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
$pollid = (int)$_POST["pollid"];
$pollid = $_POST["pollid"] ?? 0;
$question = htmlspecialchars($_POST["question"]);
$option0 = htmlspecialchars($_POST["option0"]);
$option1 = htmlspecialchars($_POST["option1"]);
@@ -141,27 +142,27 @@ input.mp
width: 450px;
}
</style>
<tr><td class=rowhead><?php echo $lang_makepoll['text_question']?> <font color=red>*</font></td><td align=left><input name=question class=mp maxlength=255 value="<?php echo $poll['question']?>"></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>1 <font color=red>*</font></td><td align=left><input name=option0 class=mp maxlength=40 value="<?php echo $poll['option0']?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>2 <font color=red>*</font></td><td align=left><input name=option1 class=mp maxlength=40 value="<?php echo $poll['option1']?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>3</td><td align=left><input name=option2 class=mp maxlength=40 value="<?php echo $poll['option2']?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>4</td><td align=left><input name=option3 class=mp maxlength=40 value="<?php echo $poll['option3']?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>5</td><td align=left><input name=option4 class=mp maxlength=40 value="<?php echo $poll['option4']?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>6</td><td align=left><input name=option5 class=mp maxlength=40 value="<?php echo $poll['option5']?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>7</td><td align=left><input name=option6 class=mp maxlength=40 value="<?php echo $poll['option6']?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>8</td><td align=left><input name=option7 class=mp maxlength=40 value="<?php echo $poll['option7']?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>9</td><td align=left><input name=option8 class=mp maxlength=40 value="<?php echo $poll['option8']?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>10</td><td align=left><input name=option9 class=mp maxlength=40 value="<?php echo $poll['option9']?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>11</td><td align=left><input name=option10 class=mp maxlength=40 value="<?php echo $poll['option10']?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>12</td><td align=left><input name=option11 class=mp maxlength=40 value="<?php echo $poll['option11']?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>13</td><td align=left><input name=option12 class=mp maxlength=40 value="<?php echo $poll['option12']?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>14</td><td align=left><input name=option13 class=mp maxlength=40 value="<?php echo $poll['option13']?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>15</td><td align=left><input name=option14 class=mp maxlength=40 value="<?php echo $poll['option14']?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>16</td><td align=left><input name=option15 class=mp maxlength=40 value="<?php echo $poll['option15']?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>17</td><td align=left><input name=option16 class=mp maxlength=40 value="<?php echo $poll['option16']?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>18</td><td align=left><input name=option17 class=mp maxlength=40 value="<?php echo $poll['option17']?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>19</td><td align=left><input name=option18 class=mp maxlength=40 value="<?php echo $poll['option18']?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>20</td><td align=left><input name=option19 class=mp maxlength=40 value="<?php echo $poll['option19']?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_question']?> <font color=red>*</font></td><td align=left><input name=question class=mp maxlength=255 value="<?php echo $poll['question'] ?? ''?>"></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>1 <font color=red>*</font></td><td align=left><input name=option0 class=mp maxlength=40 value="<?php echo $poll['option0'] ?? ''?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>2 <font color=red>*</font></td><td align=left><input name=option1 class=mp maxlength=40 value="<?php echo $poll['option1'] ?? ''?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>3</td><td align=left><input name=option2 class=mp maxlength=40 value="<?php echo $poll['option2'] ?? ''?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>4</td><td align=left><input name=option3 class=mp maxlength=40 value="<?php echo $poll['option3'] ?? ''?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>5</td><td align=left><input name=option4 class=mp maxlength=40 value="<?php echo $poll['option4'] ?? ''?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>6</td><td align=left><input name=option5 class=mp maxlength=40 value="<?php echo $poll['option5'] ?? ''?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>7</td><td align=left><input name=option6 class=mp maxlength=40 value="<?php echo $poll['option6'] ?? ''?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>8</td><td align=left><input name=option7 class=mp maxlength=40 value="<?php echo $poll['option7'] ?? ''?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>9</td><td align=left><input name=option8 class=mp maxlength=40 value="<?php echo $poll['option8'] ?? ''?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>10</td><td align=left><input name=option9 class=mp maxlength=40 value="<?php echo $poll['option9'] ?? ''?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>11</td><td align=left><input name=option10 class=mp maxlength=40 value="<?php echo $poll['option10'] ?? ''?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>12</td><td align=left><input name=option11 class=mp maxlength=40 value="<?php echo $poll['option11'] ?? ''?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>13</td><td align=left><input name=option12 class=mp maxlength=40 value="<?php echo $poll['option12'] ?? ''?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>14</td><td align=left><input name=option13 class=mp maxlength=40 value="<?php echo $poll['option13'] ?? ''?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>15</td><td align=left><input name=option14 class=mp maxlength=40 value="<?php echo $poll['option14'] ?? ''?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>16</td><td align=left><input name=option15 class=mp maxlength=40 value="<?php echo $poll['option15'] ?? ''?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>17</td><td align=left><input name=option16 class=mp maxlength=40 value="<?php echo $poll['option16'] ?? ''?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>18</td><td align=left><input name=option17 class=mp maxlength=40 value="<?php echo $poll['option17'] ?? ''?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>19</td><td align=left><input name=option18 class=mp maxlength=40 value="<?php echo $poll['option18'] ?? ''?>"><br /></td></tr>
<tr><td class=rowhead><?php echo $lang_makepoll['text_option']?>20</td><td align=left><input name=option19 class=mp maxlength=40 value="<?php echo $poll['option19'] ?? ''?>"><br /></td></tr>
<tr><td colspan=2 align=center><input type=submit value="<?php echo $pollid ? $lang_makepoll['submit_edit_poll'] : $lang_makepoll['submit_create_poll']?>" style='height: 20pt'></td></tr>
</table>
<p><font color=red>*</font><?php echo $lang_makepoll['text_required']?></p>
@@ -169,7 +170,7 @@ input.mp
if ($pollid)
print("<input type=hidden name=pollid value=\"".$poll["id"]."\">");
?>
<input type=hidden name=returnto value="<?php echo htmlspecialchars($_GET["returnto"]) ? htmlspecialchars($_GET["returnto"]) : htmlspecialchars($_SERVER["HTTP_REFERER"])?>">
<input type=hidden name=returnto value="<?php echo htmlspecialchars($_GET["returnto"] ?? '') ? htmlspecialchars($_GET["returnto"] ?? '') : htmlspecialchars($_SERVER["HTTP_REFERER"] ?? '')?>">
</form>
<?php
+6 -6
View File
@@ -6,7 +6,7 @@ loggedinorreturn();
if (get_user_class() < $newsmanage_class)
permissiondenied();
$action = htmlspecialchars($_GET["action"]);
$action = htmlspecialchars($_GET["action"] ?? '');
// Delete News Item //////////////////////////////////////////////////////
@@ -15,7 +15,7 @@ if ($action == 'delete')
$newsid = $_GET["newsid"] ?? 0;
int_check($newsid,true);
$returnto = $_GET["returnto"] ? htmlspecialchars($_GET["returnto"]) : htmlspecialchars($_SERVER["HTTP_REFERER"]);
$returnto = !empty($_GET["returnto"]) ? htmlspecialchars($_GET["returnto"]) : htmlspecialchars($_SERVER["HTTP_REFERER"]);
$sure = $_GET["sure"] ?? 0;
if (!$sure)
@@ -41,10 +41,10 @@ if ($action == 'add')
if (!$title)
stderr($lang_news['std_error'], $lang_news['std_news_title_empty']);
$added = $_POST["added"];
$added = $_POST["added"] ?? 0;
if (!$added)
$added = sqlesc(date("Y-m-d H:i:s"));
$notify = $_POST['notify'];
$notify = $_POST['notify'] ?? '';
if ($notify != 'yes')
$notify = 'no';
sql_query("INSERT INTO news (userid, added, body, title, notify) VALUES (".sqlesc($CURUSER['id']) . ", $added, " . sqlesc($body) . ", " . sqlesc($title) . ", " . sqlesc($notify).")") or sqlerr(__FILE__, __LINE__);
@@ -84,7 +84,7 @@ if ($action == 'edit')
$body = sqlesc($body);
$editdate = sqlesc(date("Y-m-d H:i:s"));
$notify = $_POST['notify'];
$notify = $_POST['notify'] ?? '';
if ($notify != 'yes')
$notify = 'no';
$notify = sqlesc($notify);
@@ -101,7 +101,7 @@ if ($action == 'edit')
$subject = htmlspecialchars($arr['title']);
$title = $lang_news['text_edit_site_news'];
print("<form id=\"compose\" name=\"compose\" method=\"post\" action=\"".htmlspecialchars("?action=edit&newsid=".$newsid)."\">");
print("<input type=\"hidden\" name=\"returnto\" value=\"".$returnto."\" />");
print("<input type=\"hidden\" name=\"returnto\" value=\"".($returnto ?? '')."\" />");
begin_compose($title, "edit", $body, true, $subject);
print("<tr><td class=\"toolbox\" align=\"center\" colspan=\"2\"><input type=\"checkbox\" name=\"notify\" value=\"yes\" ".($arr['notify'] == 'yes' ? " checked=\"checked\"" : "")." />".$lang_news['text_notify_users_of_this']."</td></tr>\n");
end_compose();
+5 -5
View File
@@ -12,7 +12,7 @@ if (isset($_GET['del']))
}
}
}
$where=$_GET["type"];
$where=$_GET["type"] ?? '';
$refresh = ($CURUSER['sbrefresh'] ? $CURUSER['sbrefresh'] : 120)
?>
<html><head>
@@ -57,7 +57,7 @@ countdown(time);
}
</script>
</head>
<body class='inframe' <?php if ($_GET["type"] != "helpbox"){?> onload="<?php echo $startcountdown?>" <?php } else {?> onload="hbquota()" <?php } ?>>
<body class='inframe' <?php if (isset($_GET["type"]) && $_GET["type"] != "helpbox"){?> onload="<?php echo $startcountdown?>" <?php } else {?> onload="hbquota()" <?php } ?>>
<?php
if(isset($_GET["sent"]) && $_GET["sent"]=="yes"){
if(!isset($_GET["shbox_text"]) || !$_GET['shbox_text'])
@@ -82,7 +82,7 @@ else
write_log("Someone is hacking shoutbox. - IP : ".getip(),'mod');
die($lang_shoutbox['text_no_permission_to_shoutbox']);
}
if ($_GET["toguest"])
if (!empty($_GET["toguest"]))
$type ='hb';
else $type = 'sb';
}
@@ -118,11 +118,11 @@ else
while ($arr = mysql_fetch_assoc($res))
{
if (get_user_class() >= $sbmanage_class) {
$del="[<a href=\"shoutbox.php?del=".$arr[id]."\">".$lang_shoutbox['text_del']."</a>]";
$del="[<a href=\"shoutbox.php?del=".$arr['id']."\">".$lang_shoutbox['text_del']."</a>]";
}
if ($arr["userid"]) {
$username = get_username($arr["userid"],false,true,true,true,false,false,"",true);
if ($_GET["type"] != 'helpbox' && $arr["type"] == 'hb')
if (isset($arr["type"]) && isset($_GET['type']) && $_GET["type"] != 'helpbox' && $arr["type"] == 'hb')
$username .= $lang_shoutbox['text_to_guest'];
}
else $username = $lang_shoutbox['text_guest'];
+2 -2
View File
@@ -6,7 +6,7 @@ loggedinorreturn();
if (get_user_class() < $staffmem_class)
permissiondenied();
$action = $_GET["action"];
$action = $_GET["action"] ?? '';
///////////////////////////
// SHOW PM'S //
@@ -14,7 +14,7 @@ $action = $_GET["action"];
if (!$action) {
stdhead($lang_staffbox['head_staff_pm']);
$url = $_SERVER[PHP_SELF]."?";
$url = $_SERVER['PHP_SELF']."?";
$count = get_row_count("staffmessages");
$perpage = 20;
list($pagertop, $pagerbottom, $limit) = pager($perpage, $count, $url);