From 7c4f7c9ed42521c5a7e20a03f322955dcc05a3cb Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 21 Oct 2024 10:30:35 -0700 Subject: [PATCH] web: fix PHP8 deprecation warnings --- html/inc/forum_db.inc | 10 ++++++++++ html/inc/pm.inc | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/html/inc/forum_db.inc b/html/inc/forum_db.inc index b6000bab47..49e7487929 100644 --- a/html/inc/forum_db.inc +++ b/html/inc/forum_db.inc @@ -18,6 +18,7 @@ require_once("../inc/boinc_db.inc"); +#[AllowDynamicProperties] class BoincCategory { static function lookup_id($id) { $db = BoincDb::get(); @@ -33,6 +34,7 @@ class BoincCategory { } } +#[AllowDynamicProperties] class BoincForum { static function insert($clause) { $db = BoincDb::get(); @@ -62,6 +64,7 @@ class BoincForum { } } +#[AllowDynamicProperties] class BoincThread { static function insert($clause) { $db = BoincDb::get(); @@ -92,6 +95,7 @@ class BoincThread { } } +#[AllowDynamicProperties] class BoincPost { static function insert($clause) { $db = BoincDb::get(); @@ -132,6 +136,7 @@ class BoincPost { } } +#[AllowDynamicProperties] class BoincForumPrefs { static $cache; static function lookup_userid($id) { @@ -181,6 +186,7 @@ class BoincForumPrefs { } } +#[AllowDynamicProperties] class BoincForumLogging { static $cache; static function replace($userid, $threadid, $timestamp) { @@ -227,6 +233,7 @@ class BoincForumLogging { } } +#[AllowDynamicProperties] class BoincSubscription { static function lookup($userid, $threadid) { $db = BoincDb::get(); @@ -246,6 +253,7 @@ class BoincSubscription { } } +#[AllowDynamicProperties] class BoincPostRating { static function lookup($userid, $postid) { $db = BoincDb::get(); @@ -257,6 +265,7 @@ class BoincPostRating { } } +#[AllowDynamicProperties] class BoincFriend { static function insert($clause) { $db = BoincDb::get(); @@ -289,6 +298,7 @@ class BoincFriend { } } +#[AllowDynamicProperties] class BoincNotify { static function insert($clause) { $db = BoincDb::get(); diff --git a/html/inc/pm.inc b/html/inc/pm.inc index b20d6d3fe5..1dc33c74b9 100644 --- a/html/inc/pm.inc +++ b/html/inc/pm.inc @@ -154,8 +154,8 @@ function pm_form_page($replyto, $userid, $error = null) { $content = post_str("content", true); } - $content = htmlspecialchars($content); - $subject = htmlspecialchars($subject); + $content = $content?htmlspecialchars($content):''; + $subject = $subject?htmlspecialchars($subject):''; if ($error != null) { echo "

".$error."

\n";