From 8e20909f23a75f3416c16dbd26a8a2e6d022b25b Mon Sep 17 00:00:00 2001 From: Anonymous Contributor Date: Sat, 9 Sep 2023 06:31:23 +0200 Subject: [PATCH] Fix leftover reference to RUNTIME in Profile.php --- app/page/Profile.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/page/Profile.php b/app/page/Profile.php index f7edf65..e991b8e 100644 --- a/app/page/Profile.php +++ b/app/page/Profile.php @@ -229,13 +229,11 @@ class Profile extends \Mcp\RequestHandler private function setNamePart(string $part, string $value, string $otherPart, string $otherValue): bool { - global $RUNTIME; - - $query = $RUNTIME['PDO']->prepare('SELECT 1 FROM UserAccounts WHERE '.$part.' = ? AND '.$otherPart.' = ?'); + $query = $this->app->db()->prepare('SELECT 1 FROM UserAccounts WHERE '.$part.' = ? AND '.$otherPart.' = ?'); $query->execute(array($value, $otherValue)); if ($query->rowCount() == 0) { - $statement = $RUNTIME['PDO']->prepare('UPDATE UserAccounts SET '.$part.' = ? WHERE PrincipalID = ?'); + $statement = $this->app->db()->prepare('UPDATE UserAccounts SET '.$part.' = ? WHERE PrincipalID = ?'); $statement->execute(array($value, $_SESSION['UUID'])); return true; }