Merge remote-tracking branch 'origin/php8' into php8

This commit is contained in:
xiaomlove
2025-02-25 02:06:01 +08:00
18 changed files with 31 additions and 31 deletions
+2 -2
View File
@@ -1973,7 +1973,7 @@ function userlogin() {
$res = sql_query("SELECT * FROM bans WHERE $nip >= first AND $nip <= last") or sqlerr(__FILE__, __LINE__); $res = sql_query("SELECT * FROM bans WHERE $nip >= first AND $nip <= last") or sqlerr(__FILE__, __LINE__);
if (mysql_num_rows($res) > 0) if (mysql_num_rows($res) > 0)
{ {
header("HTTP/1.0 403 Forbidden"); header("HTTP/1.1 403 Forbidden");
print("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"></head><body>".$lang_functions['text_unauthorized_ip']."</body></html>\n"); print("<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"></head><body>".$lang_functions['text_unauthorized_ip']."</body></html>\n");
die; die;
} }
@@ -3008,7 +3008,7 @@ function mksecret($len = 20) {
} }
function httperr($code = 404) { function httperr($code = 404) {
header("HTTP/1.0 404 Not found"); header("HTTP/1.1 404 Not found");
print("<h1>Not Found</h1>\n"); print("<h1>Not Found</h1>\n");
exit(); exit();
} }
+1 -1
View File
@@ -48,7 +48,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
\App\Models\Message::query()->insert($messages); \App\Models\Message::query()->insert($messages);
$page++; $page++;
} }
header(sprintf("Refresh: 0; url=%s?sent=1", $_SERVER['PHP_SELF'])); header(sprintf("Location: %s?sent=1", $_SERVER['PHP_SELF']));
} }
stdhead("Add Attendance card", false); stdhead("Add Attendance card", false);
+3 -3
View File
@@ -97,11 +97,11 @@ if ($action == "add")
sql_query("UPDATE users SET last_comment = NOW() WHERE id = ".sqlesc($CURUSER['id'])) or sqlerr(__FILE__, __LINE__); sql_query("UPDATE users SET last_comment = NOW() WHERE id = ".sqlesc($CURUSER['id'])) or sqlerr(__FILE__, __LINE__);
if($type == "torrent") if($type == "torrent")
header("Refresh: 0; url=details.php?id=$parent_id#$newid"); header("Location: details.php?id=$parent_id#$newid");
else if($type == "offer") else if($type == "offer")
header("Refresh: 0; url=offers.php?id=$parent_id&off_details=1#$newid"); header("Location: offers.php?id=$parent_id&off_details=1#$newid");
else if($type == "request") else if($type == "request")
header("Refresh: 0; url=viewrequests.php?id=$parent_id&req_details=1#$newid"); header("Location: viewrequests.php?id=$parent_id&req_details=1#$newid");
die; die;
} }
+2 -2
View File
@@ -16,7 +16,7 @@ if (!$row)
httperr(); httperr();
if ($row["status"] != "pending") { if ($row["status"] != "pending") {
header("Refresh: 0; url=ok.php?type=confirmed"); header("Location: ok.php?type=confirmed");
exit(); exit();
} }
@@ -43,5 +43,5 @@ else // when it's op, default is not use secure login
logincookie($id, $passh,1,get_setting('system.cookie_valid_days', 365) * 86400,$securelogin_indentity_cookie); logincookie($id, $passh,1,get_setting('system.cookie_valid_days', 365) * 86400,$securelogin_indentity_cookie);
//sessioncookie($row["id"], $passh,false); //sessioncookie($row["id"], $passh,false);
header("Refresh: 0; url=ok.php?type=confirm"); header("Location: ok.php?type=confirm");
?> ?>
+1 -1
View File
@@ -31,5 +31,5 @@ sql_query("UPDATE users SET editsecret='', email=" . sqlesc($email) . " WHERE id
if (!mysql_affected_rows()) if (!mysql_affected_rows())
httperr(); httperr();
header("Refresh: 0; url=" . get_protocol_prefix() . "$BASEURL/usercp.php?action=security&type=saved"); header("Location: " . get_protocol_prefix() . "$BASEURL/usercp.php?action=security&type=saved");
?> ?>
+1 -1
View File
@@ -53,5 +53,5 @@ if (\App\Models\User::query()->where("id", $row['owner'])->exists()) {
sql_query("INSERT INTO messages (sender, receiver, subject, added, msg) VALUES(0, $row[owner], $subject, $dt, $msg)") or sqlerr(__FILE__, __LINE__); sql_query("INSERT INTO messages (sender, receiver, subject, added, msg) VALUES(0, $row[owner], $subject, $dt, $msg)") or sqlerr(__FILE__, __LINE__);
} }
} }
header("Refresh: 0; url=torrents.php"); header("Location: torrents.php");
?> ?>
+1 -1
View File
@@ -3,6 +3,6 @@ require_once("../include/bittorrent.php");
dbconn(); dbconn();
logoutcookie(); logoutcookie();
//logoutsession(); //logoutsession();
//header("Refresh: 0; url=./"); //header("Location: ./");
nexus_redirect("/"); nexus_redirect("/");
?> ?>
+3 -3
View File
@@ -40,7 +40,7 @@ elseif (isset($_GET["act"]) && $_GET["act"]=="addsect"){
$language = $_POST["language"]; $language = $_POST["language"];
sql_query("insert into rules (title, text, lang_id) values(".sqlesc($title).", ".sqlesc($text).", ".sqlesc($language).")") or sqlerr(__FILE__,__LINE__); sql_query("insert into rules (title, text, lang_id) values(".sqlesc($title).", ".sqlesc($text).", ".sqlesc($language).")") or sqlerr(__FILE__,__LINE__);
clear_rules_cache(); clear_rules_cache();
header("Refresh: 0; url=modrules.php"); header("Location: modrules.php");
} }
elseif (isset($_GET["act"]) && $_GET["act"] == "edit"){ elseif (isset($_GET["act"]) && $_GET["act"] == "edit"){
$id = intval($_GET["id"]); $id = intval($_GET["id"]);
@@ -74,7 +74,7 @@ elseif (isset($_GET["act"]) && $_GET["act"]=="edited"){
$language = $_POST["language"]; $language = $_POST["language"];
sql_query("update rules set title=".sqlesc($title).", text=".sqlesc($text).", lang_id = ".sqlesc($language)." where id=".sqlesc($id)) or sqlerr(__FILE__,__LINE__); sql_query("update rules set title=".sqlesc($title).", text=".sqlesc($text).", lang_id = ".sqlesc($language)." where id=".sqlesc($id)) or sqlerr(__FILE__,__LINE__);
clear_rules_cache(); clear_rules_cache();
header("Refresh: 0; url=modrules.php"); header("Location: modrules.php");
} }
elseif (isset($_GET["act"]) && $_GET["act"]=="del"){ elseif (isset($_GET["act"]) && $_GET["act"]=="del"){
$id = (int)$_GET["id"]; $id = (int)$_GET["id"];
@@ -85,7 +85,7 @@ elseif (isset($_GET["act"]) && $_GET["act"]=="del"){
} }
sql_query("DELETE FROM rules WHERE id=".sqlesc($id)) or sqlerr(__FILE__, __LINE__); sql_query("DELETE FROM rules WHERE id=".sqlesc($id)) or sqlerr(__FILE__, __LINE__);
clear_rules_cache(); clear_rules_cache();
header("Refresh: 0; url=modrules.php"); header("Location: modrules.php");
} }
else{ else{
$res = sql_query("select rules.*, lang_name from rules left join language on rules.lang_id = language.id order by lang_name, id"); $res = sql_query("select rules.*, lang_name from rules left join language on rules.lang_id = language.id order by lang_name, id");
+1 -1
View File
@@ -49,5 +49,5 @@ if (!empty($_POST["desact"])){
} }
} }
} }
header("Refresh: 0; url=warned.php"); header("Location: warned.php");
?> ?>
+5 -5
View File
@@ -110,7 +110,7 @@ if (isset($_GET['new_offer']) && $_GET["new_offer"]){
write_log("offer $name was added by ".$CURUSER['username'],'normal'); write_log("offer $name was added by ".$CURUSER['username'],'normal');
header("Refresh: 0; url=offers.php?id=$id&off_details=1"); header("Location: offers.php?id=$id&off_details=1");
stdhead($lang_offers['head_success']); stdhead($lang_offers['head_success']);
} }
@@ -261,7 +261,7 @@ if (isset($_GET["allow_offer"]) && $_GET["allow_offer"]) {
sql_query ("UPDATE offers SET allowed = 'allowed', allowedtime = '".$allowedtime."' WHERE id = $offid") or sqlerr(__FILE__,__LINE__); sql_query ("UPDATE offers SET allowed = 'allowed', allowedtime = '".$allowedtime."' WHERE id = $offid") or sqlerr(__FILE__,__LINE__);
write_log("{$CURUSER['username']} allowed offer {$arr['name']}",'normal'); write_log("{$CURUSER['username']} allowed offer {$arr['name']}",'normal');
header("Refresh: 0; url=" . get_protocol_prefix() . "$BASEURL/offers.php?id=$offid&off_details=1"); header("Location: " . get_protocol_prefix() . "$BASEURL/offers.php?id=$offid&off_details=1");
} }
//=== end allow the offer //=== end allow the offer
@@ -312,7 +312,7 @@ if (isset($_GET["finish_offer"]) && $_GET["finish_offer"]) {
//sql_query("INSERT INTO messages (sender, receiver, added, msg) VALUES(0, $arr['userid'], '" . date("Y-m-d H:i:s") . "', " . sqlesc($msg) . ")") or sqlerr(__FILE__, __LINE__); //sql_query("INSERT INTO messages (sender, receiver, added, msg) VALUES(0, $arr['userid'], '" . date("Y-m-d H:i:s") . "', " . sqlesc($msg) . ")") or sqlerr(__FILE__, __LINE__);
write_log("{$CURUSER['username']} closed poll {$arr['name']}",'normal'); write_log("{$CURUSER['username']} closed poll {$arr['name']}",'normal');
header("Refresh: 0; url=" . get_protocol_prefix() . "$BASEURL/offers.php?id=$offid&off_details=1"); header("Location: " . get_protocol_prefix() . "$BASEURL/offers.php?id=$offid&off_details=1");
die; die;
} }
//===end allow offer by vote //===end allow offer by vote
@@ -403,7 +403,7 @@ if (isset($_GET["take_off_edit"]) && $_GET["take_off_edit"]){
sql_query("UPDATE offers SET category=$cat, name=$name, descr=$descr where id=".sqlesc($id)); sql_query("UPDATE offers SET category=$cat, name=$name, descr=$descr where id=".sqlesc($id));
//header("Refresh: 0; url=offers.php?id=$id&off_details=1"); //header("Location: offers.php?id=$id&off_details=1");
} }
//======end take offer edit //======end take offer edit
@@ -579,7 +579,7 @@ if (isset($_GET["del_offer"]) && $_GET["del_offer"]){
sql_query("INSERT INTO messages (sender, receiver, msg, added, subject) VALUES(0, {$num['userid']}, $msg, $added, $subject)") or sqlerr(__FILE__, __LINE__); sql_query("INSERT INTO messages (sender, receiver, msg, added, subject) VALUES(0, {$num['userid']}, $msg, $added, $subject)") or sqlerr(__FILE__, __LINE__);
} }
write_log("Offer: $offer ({$num['name']}) was deleted by {$CURUSER['username']}".($reason != "" ? " (".$reason.")" : ""),'normal'); write_log("Offer: $offer ({$num['name']}) was deleted by {$CURUSER['username']}".($reason != "" ? " (".$reason.")" : ""),'normal');
header("Refresh: 0; url=offers.php"); header("Location: offers.php");
die; die;
} }
else else
+2 -2
View File
@@ -231,7 +231,7 @@ $id = intval($_GET["id"] ?? 0);
sql_query ("UPDATE staffmessages SET answered=1, answeredby = {$CURUSER['id']} WHERE id = $id") or sqlerr(); sql_query ("UPDATE staffmessages SET answered=1, answeredby = {$CURUSER['id']} WHERE id = $id") or sqlerr();
$Cache->delete_value('staff_new_message_count'); $Cache->delete_value('staff_new_message_count');
clear_staff_message_cache(); clear_staff_message_cache();
header("Refresh: 0; url=staffbox.php" . (!empty($_GET['return']) ? "?" . $_GET['return'] : '')); header("Location: staffbox.php" . (!empty($_GET['return']) ? "?" . $_GET['return'] : ''));
} }
////////////////////////// //////////////////////////
@@ -259,7 +259,7 @@ elseif ($_POST['delete']){
} }
$Cache->delete_value('staff_new_message_count'); $Cache->delete_value('staff_new_message_count');
clear_staff_message_cache(); clear_staff_message_cache();
header("Refresh: 0; url=staffbox.php"); header("Location: staffbox.php");
} }
?> ?>
+1 -1
View File
@@ -76,5 +76,5 @@ while (true) {
$page++; $page++;
} }
header("Refresh: 0; url=increment-bulk.php?sent=1&type=$type"); header("Location: increment-bulk.php?sent=1&type=$type");
?> ?>
+1 -1
View File
@@ -37,5 +37,5 @@ while($dat=mysql_fetch_assoc($query))
sql_query("INSERT INTO messages (sender, receiver, added, subject, msg) VALUES ($sender_id, {$dat['id']}, $dt, " . sqlesc($subject) .", " . sqlesc($msg) .")") or sqlerr(__FILE__,__LINE__); sql_query("INSERT INTO messages (sender, receiver, added, subject, msg) VALUES ($sender_id, {$dat['id']}, $dt, " . sqlesc($subject) .", " . sqlesc($msg) .")") or sqlerr(__FILE__,__LINE__);
} }
header("Refresh: 0; url=amountupload.php?sent=1"); header("Location: amountupload.php?sent=1");
?> ?>
+1 -1
View File
@@ -30,5 +30,5 @@ EOD;
//this mail is sent when the site is using admin(open/closed)/inviter(closed) confirmation and the admin/inviter confirmed the pending user //this mail is sent when the site is using admin(open/closed)/inviter(closed) confirmation and the admin/inviter confirmed the pending user
sent_mail($email,$SITENAME,$SITEEMAIL,$title,$body,"invite confirm",false,false,''); sent_mail($email,$SITENAME,$SITEEMAIL,$title,$body,"invite confirm",false,false,'');
header("Refresh: 0; url=invite.php?id=".htmlspecialchars($CURUSER['id'])); header("Location: invite.php?id=".htmlspecialchars($CURUSER['id']));
?> ?>
+1 -1
View File
@@ -309,4 +309,4 @@ if ($affectedRows == 1) {
$returl = "details.php?id=$id&edited=1"; $returl = "details.php?id=$id&edited=1";
if (isset($_POST["returnto"])) if (isset($_POST["returnto"]))
$returl = $_POST["returnto"]; $returl = $_POST["returnto"];
header("Refresh: 0; url=$returl"); header("Location: $returl");
+1 -1
View File
@@ -130,7 +130,7 @@ if ($sendResult === true) {
} }
} }
$lock->release(); $lock->release();
header("Refresh: 0; url=invite.php?id=".htmlspecialchars($id)."&sent=1"); header("Location: invite.php?id=".htmlspecialchars($id)."&sent=1");
?> ?>
+1 -1
View File
@@ -53,5 +53,5 @@ while (true) {
$page++; $page++;
} }
header("Refresh: 0; url=staffmess.php?sent=1"); header("Location: staffmess.php?sent=1");
?> ?>
+1 -1
View File
@@ -23,4 +23,4 @@ while ($arr = mysql_fetch_assoc($res))
$Cache->delete_value('staff_report_count'); $Cache->delete_value('staff_report_count');
} }
header("Refresh: 0; url=reports.php"); header("Location: reports.php");