From 31f51276b2c78f0c5f0770398648abb9f6431b03 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Mon, 10 Nov 2025 20:30:41 +0100 Subject: [PATCH] =?UTF-8?q?Profiler/Fixup=20=20*=20fix=20exception=20when?= =?UTF-8?q?=20manually=20querying=20for=20unsynced=20guild/arena-team=20?= =?UTF-8?q?=20=20=20that=20shares=20it's=20name=20with=20another=20guild/t?= =?UTF-8?q?eam=20(e.g.=20=C3=AC=C3=AD=C3=AEi=20is=20the=20same=20to=20SQL)?= =?UTF-8?q?=20=20=20=20and=20the=20target=20guild/team=20not=20being=20the?= =?UTF-8?q?=20first=20result?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- endpoints/arena-team/arena-team.php | 4 ++-- endpoints/guild/guild.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/endpoints/arena-team/arena-team.php b/endpoints/arena-team/arena-team.php index 7e30a1c2..509fbdf3 100644 --- a/endpoints/arena-team/arena-team.php +++ b/endpoints/arena-team/arena-team.php @@ -58,9 +58,9 @@ class ArenateamBaseResponse extends TemplateResponse // 2) not yet synced but exists on realm (wont work if we get passed an urlized name, but there is nothing we can do about it) $subjects = DB::Characters($this->realmId)->select('SELECT at.`arenaTeamId` AS "realmGUID", at.`name`, at.`type` FROM arena_team at WHERE at.`name` = ?', $this->subjectName); - if ($subject = array_filter($subjects, fn($x) => Util::lower($x['name']) == Util::lower($this->subjectName))) + if ($subject = array_filter($subjects, fn($x) => Util::lower($x['name']) === Util::lower($this->subjectName))) { - $subject = $subject[0]; + $subject = array_pop($subject); $subject['realm'] = $this->realmId; $subject['stub'] = 1; $subject['nameUrl'] = Profiler::urlize($subject['name']); diff --git a/endpoints/guild/guild.php b/endpoints/guild/guild.php index 2cd0f3f6..dff1e831 100644 --- a/endpoints/guild/guild.php +++ b/endpoints/guild/guild.php @@ -58,9 +58,9 @@ class GuildBaseResponse extends TemplateResponse // 2) not yet synced but exists on realm (wont work if we get passed an urlized name, but there is nothing we can do about it) $subjects = DB::Characters($this->realmId)->select('SELECT `guildid` AS "realmGUID", `name` FROM guild WHERE `name` = ?', $this->subjectName); - if ($subject = array_filter($subjects, fn($x) => Util::lower($x['name']) == Util::lower($this->subjectName))) + if ($subject = array_filter($subjects, fn($x) => Util::lower($x['name']) === Util::lower($this->subjectName))) { - $subject = $subject[0]; + $subject = array_pop($subject); $subject['realm'] = $this->realmId; $subject['stub'] = 1; $subject['nameUrl'] = Profiler::urlize($subject['name']);