From b623db87f96daa00df47d28ef439ba7a385bc6aa Mon Sep 17 00:00:00 2001
From: "deepsource-autofix[bot]"
<62050782+deepsource-autofix[bot]@users.noreply.github.com>
Date: Thu, 15 Aug 2024 00:06:15 +0000
Subject: [PATCH] style: format code with dotnet-format and PHP CS Fixer
This commit fixes the style issues introduced in 4d4cf08 according to the output
from dotnet-format and PHP CS Fixer.
Details: None
---
src/admin/bans.php | 24 ++++-----
src/admin/index.php | 124 +++++++++++++++++++++++++++-----------------
2 files changed, 87 insertions(+), 61 deletions(-)
diff --git a/src/admin/bans.php b/src/admin/bans.php
index edf2d8b..4688d6d 100644
--- a/src/admin/bans.php
+++ b/src/admin/bans.php
@@ -102,22 +102,22 @@
uid >= $min && $user->uid <= $max) :
- ?>
+foreach ($bannedUserList as $user) :
+ if ($user->uid >= $min && $user->uid <= $max) :
+ ?>
uid);
- if (!$avatarUrl) :
- ?>
+ $avatarUrl = Util::getavatar($user->uid);
+ if (!$avatarUrl) :
+ ?>
uid}.{$ext}";
- ?>
+ $ext = pathinfo($avatarUrl, PATHINFO_EXTENSION);
+ $filename = "{$user->uid}.{$ext}";
+ ?>
@@ -141,8 +141,8 @@
|
+endforeach;
+?>
diff --git a/src/admin/index.php b/src/admin/index.php
index a2ebb55..8e08cb4 100644
--- a/src/admin/index.php
+++ b/src/admin/index.php
@@ -23,55 +23,81 @@
// Handle POST request
if ($_SERVER["REQUEST_METHOD"] === "POST") {
- // Check the request method again for added security
- if (Util::securevar($_SERVER["REQUEST_METHOD"]) === "POST") {
-
- // Sanitize and assign POST variables
- $params = [
- 'SystemStatus', 'SystemMaint', 'SystemVersion', 'invite', 'Systemfreeze',
- 'flushchat', 'setnews', 'invwave', 'discordlinking', 'discordrelinking',
- 'discordlogging', 'service', 'setkey', 'setsecret', 'setcolor', 'captcha_option'
- ];
-
- foreach ($params as $param) {
- if (isset($_POST[$param])) {
- ${$param} = Util::securevar($_POST[$param]);
- }
- }
-
- // Perform admin check
- Util::adminCheck();
-
- // Execute admin functions based on the sanitized POST variables
- if (isset($SystemStatus)) $admin->setSystemStatus();
- if (isset($SystemMaint)) $admin->setSystemMaint();
- if (isset($SystemVersion)) {
- $ver = floatval(Util::securevar($_POST["version"]));
- $admin->setSystemVersion($ver);
- }
- if (isset($invite)) $admin->setinvite();
- if (isset($Systemfreeze)) $admin->setSystemfreeze();
- if (isset($flushchat)) $admin->flushchat();
- if (isset($setnews)) {
- $news = Util::securevar($_POST["msg"]);
- $admin->setnews($news);
- }
- if (isset($invwave)) $admin->invwave();
- if (isset($discordlinking)) $admin->setDiscordLink();
- if (isset($discordrelinking)) $admin->setDiscordReLink();
- if (isset($discordlogging)) $admin->setDiscordLogging();
- if (isset($captcha_option)) $admin->setCaptchaSystem($captcha_option);
- if (isset($setkey)) $admin->setCaptchaKey($setkey);
- if (isset($setsecret)) $admin->setCaptchaSecret($setsecret);
- if (isset($setcolor)) $admin->changeEmbedColor($setcolor);
-
- // Redirect to system page after processing
- header("location: index.php");
- exit;
- }
-
- header("location: index.php");
- exit;
+ // Check the request method again for added security
+ if (Util::securevar($_SERVER["REQUEST_METHOD"]) === "POST") {
+
+ // Sanitize and assign POST variables
+ $params = [
+ 'SystemStatus', 'SystemMaint', 'SystemVersion', 'invite', 'Systemfreeze',
+ 'flushchat', 'setnews', 'invwave', 'discordlinking', 'discordrelinking',
+ 'discordlogging', 'service', 'setkey', 'setsecret', 'setcolor', 'captcha_option'
+ ];
+
+ foreach ($params as $param) {
+ if (isset($_POST[$param])) {
+ ${$param} = Util::securevar($_POST[$param]);
+ }
+ }
+
+ // Perform admin check
+ Util::adminCheck();
+
+ // Execute admin functions based on the sanitized POST variables
+ if (isset($SystemStatus)) {
+ $admin->setSystemStatus();
+ }
+ if (isset($SystemMaint)) {
+ $admin->setSystemMaint();
+ }
+ if (isset($SystemVersion)) {
+ $ver = floatval(Util::securevar($_POST["version"]));
+ $admin->setSystemVersion($ver);
+ }
+ if (isset($invite)) {
+ $admin->setinvite();
+ }
+ if (isset($Systemfreeze)) {
+ $admin->setSystemfreeze();
+ }
+ if (isset($flushchat)) {
+ $admin->flushchat();
+ }
+ if (isset($setnews)) {
+ $news = Util::securevar($_POST["msg"]);
+ $admin->setnews($news);
+ }
+ if (isset($invwave)) {
+ $admin->invwave();
+ }
+ if (isset($discordlinking)) {
+ $admin->setDiscordLink();
+ }
+ if (isset($discordrelinking)) {
+ $admin->setDiscordReLink();
+ }
+ if (isset($discordlogging)) {
+ $admin->setDiscordLogging();
+ }
+ if (isset($captcha_option)) {
+ $admin->setCaptchaSystem($captcha_option);
+ }
+ if (isset($setkey)) {
+ $admin->setCaptchaKey($setkey);
+ }
+ if (isset($setsecret)) {
+ $admin->setCaptchaSecret($setsecret);
+ }
+ if (isset($setcolor)) {
+ $admin->changeEmbedColor($setcolor);
+ }
+
+ // Redirect to system page after processing
+ header("location: index.php");
+ exit;
+ }
+
+ header("location: index.php");
+ exit;
}
?>