recover some $_GET & $POST variable keep be integer

This commit is contained in:
xiaomlove
2021-01-06 00:56:13 +08:00
parent 47ba5397a3
commit a968b5855c
24 changed files with 102 additions and 104 deletions

10
fun.php
View File

@@ -12,7 +12,7 @@ if (!$action)
}
if ($action == 'delete')
{
$id = $_GET["id"] ?? 0;
$id = intval($_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 = $_GET["sure"] ?? 0;
$sure = intval($_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 = $_GET["id"] ?? 0;
$id = intval($_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 = $_GET["id"] ?? 0;
$id = intval($_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 = $_GET["id"] ?? 0;
$id = intval($_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);