From 0b0ae051f257b6f1954a81123f207a6e593640b9 Mon Sep 17 00:00:00 2001
From: bestzyq <21013965@mail.ecust.edu.cn>
Date: Thu, 26 Sep 2024 23:21:07 +0800
Subject: [PATCH 1/3] fix: Function strftime() is deprecated
---
public/shoutbox.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/shoutbox.php b/public/shoutbox.php
index 0701547f8..72262de0c 100644
--- a/public/shoutbox.php
+++ b/public/shoutbox.php
@@ -127,7 +127,7 @@ function hbquota(){
}
else $username = $lang_shoutbox['text_guest'];
if (isset($CURUSER) && $CURUSER['timetype'] != 'timealive')
- $time = strftime("%m.%d %H:%M",$arr["date"]);
+ $time = (new DateTime())->setTimestamp($arr["date"])->format('m.d H:i');
else $time = get_elapsed_time($arr["date"]).$lang_shoutbox['text_ago'];
print("
[".$time."] ".
$del ." ". $username." " . format_comment($arr["text"],true,false,true,true,600,false,false)."
From c05798e184e15acb87107a959112f28fba9268f7 Mon Sep 17 00:00:00 2001
From: bestzyq <21013965@mail.ecust.edu.cn>
Date: Thu, 26 Sep 2024 23:29:14 +0800
Subject: [PATCH 2/3] fix: Undefined array key "ismalldescr"
---
public/torrentrss.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/torrentrss.php b/public/torrentrss.php
index bcffbd9ab..426efc4a4 100644
--- a/public/torrentrss.php
+++ b/public/torrentrss.php
@@ -71,7 +71,7 @@ function hex_esc($matches) {
$ANDOR = ($search_mode == 0 ? " AND " : " OR "); // only affects mode 0 and mode 1
foreach ($like_expression_array as &$like_expression_array_element)
- $like_expression_array_element = "(torrents.name" . $like_expression_array_element.(!empty($_GET['ismalldescr']) ? " OR torrents.small_descr". $like_expression_array_element : "").")";
+ $like_expression_array_element = "(torrents.name" . $like_expression_array_element . (isset($_GET['ismalldescr']) && $_GET['ismalldescr'] ? " OR torrents.small_descr" . $like_expression_array_element : "") . ")";
$wherea[] = implode($ANDOR, $like_expression_array);
$where .= ($where ? " AND " : "") . implode(" AND ", $wherea);
}
From 8df7743eeb9b99332995b82b91f0187a036f78c1 Mon Sep 17 00:00:00 2001
From: bestzyq <21013965@mail.ecust.edu.cn>
Date: Thu, 26 Sep 2024 23:35:14 +0800
Subject: [PATCH 3/3] fix: checking if $bwrow is set and contains the expected
keys before trying to access them
---
public/details.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/details.php b/public/details.php
index 921135999..9801a6223 100644
--- a/public/details.php
+++ b/public/details.php
@@ -483,7 +483,7 @@ function hex_esc($matches) {
tr($lang_details['row_hot_meter'], "",1);
$bwres = sql_query("SELECT uploadspeed.name AS upname, downloadspeed.name AS downname, isp.name AS ispname FROM users LEFT JOIN uploadspeed ON users.upload = uploadspeed.id LEFT JOIN downloadspeed ON users.download = downloadspeed.id LEFT JOIN isp ON users.isp = isp.id WHERE users.id=".$row['owner']);
$bwrow = mysql_fetch_array($bwres);
- if ($bwrow['upname'] && $bwrow['downname'])
+ if (isset($bwrow['upname']) && isset($bwrow['downname']) && $bwrow['upname'] && $bwrow['downname'])
tr($lang_details['row_uploader_bandwidth'], " ".$bwrow['downname']." ".$bwrow['upname']." ".$bwrow['ispname'],1);
/*
|