From 609cf152af6a51832119acdb83375938ec2768f9 Mon Sep 17 00:00:00 2001 From: slawkens Date: Fri, 24 Apr 2026 16:24:06 +0200 Subject: [PATCH 1/5] Plugins: Fix uninstall when hook is without HOOK_ prefix --- system/src/Plugins.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/system/src/Plugins.php b/system/src/Plugins.php index 6a88fcab..2560f9f5 100644 --- a/system/src/Plugins.php +++ b/system/src/Plugins.php @@ -870,7 +870,11 @@ class Plugins { global $hooks; foreach($plugin_info['hooks'] ?? [] as $name => $info) { - $hooks->unregister($name, $info['type'], $info['file']); + if (str_contains($info['type'], 'HOOK_')) { + $info['type'] = str_replace('HOOK_', '', $info['type']); + } + + $hooks->unregister($name, 'HOOK_' . $info['type'], $info['file']); } clearCache(); From e4a947cabb03d785ea4b7d4193af38b05000a0a7 Mon Sep 17 00:00:00 2001 From: slawkens Date: Fri, 24 Apr 2026 16:32:53 +0200 Subject: [PATCH 2/5] tibiacom: Reduce queries count from highscores box --- templates/tibiacom/boxes/highscores.php | 18 ++++++++---------- .../boxes/templates/highscores.html.twig | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/templates/tibiacom/boxes/highscores.php b/templates/tibiacom/boxes/highscores.php index a2f371fa..4b347da9 100644 --- a/templates/tibiacom/boxes/highscores.php +++ b/templates/tibiacom/boxes/highscores.php @@ -1,15 +1,13 @@ display('highscores.html.twig', array( 'topPlayers' => $topPlayers diff --git a/templates/tibiacom/boxes/templates/highscores.html.twig b/templates/tibiacom/boxes/templates/highscores.html.twig index c1f8f1d6..bc20a135 100644 --- a/templates/tibiacom/boxes/templates/highscores.html.twig +++ b/templates/tibiacom/boxes/templates/highscores.html.twig @@ -44,7 +44,7 @@
{% for player in topPlayers %} -
+
{% if setting('core.online_outfit') %} player outfit {% endif %} From 0635108d4cd58b157e000b9f830dd9af6672cf80 Mon Sep 17 00:00:00 2001 From: slawkens Date: Fri, 24 Apr 2026 16:33:07 +0200 Subject: [PATCH 3/5] Merge branch 'main' into develop From ac9a328206f79b125dc82758f6d6314f69116f69 Mon Sep 17 00:00:00 2001 From: slawkens Date: Fri, 24 Apr 2026 16:39:55 +0200 Subject: [PATCH 4/5] Highscores: Prevent mass queries amount caused by getPlayerLink --- system/pages/highscores.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/pages/highscores.php b/system/pages/highscores.php index ea1a9fe6..b86cdf10 100644 --- a/system/pages/highscores.php +++ b/system/pages/highscores.php @@ -214,6 +214,7 @@ if (empty($highscores)) { $tmp['online'] = $row->online_status; $tmp['vocation'] = $row->vocation_name; $tmp['outfit_url'] = $row->outfit_url; // @phpstan-ignore-line + $tmp['link'] = getPlayerLink($row->name, false); unset($tmp['online_table']); return $tmp; @@ -247,7 +248,6 @@ foreach($highscores as $id => &$player) $player['experience'] = number_format($player['experience']); } - $player['link'] = getPlayerLink($player['name'], false); $player['flag'] = getFlagImage($player['country']); $player['outfit'] = ''; From 54bdea85a3a7f34470066b6e9c658ae062d44a02 Mon Sep 17 00:00:00 2001 From: slawkens Date: Fri, 24 Apr 2026 20:36:56 +0200 Subject: [PATCH 5/5] Fix phpstan --- phpstan.neon | 2 -- system/pages/highscores.php | 5 ++++- system/src/Models/Player.php | 4 ++++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index 68e1aa6a..05778a86 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -31,8 +31,6 @@ parameters: - '#Call to an undefined method [a-zA-Z0-9\\_]+::[a-zA-Z0-9\\_]+\(\)#' - '#Call to an undefined static method [a-zA-Z0-9\\_]+::[a-zA-Z0-9\\_]+\(\)#' # system/pages/highscores.php - - '#Access to an undefined property Illuminate\\Database\\Eloquent\\Model::\$online_status#' - - '#Access to an undefined property Illuminate\\Database\\Eloquent\\Model::\$vocation_name#' - message: '#Variable \$tmp in empty\(\) always exists and is always falsy#' path: templates\kathrine\javascript.php diff --git a/system/pages/highscores.php b/system/pages/highscores.php index b86cdf10..e3c52645 100644 --- a/system/pages/highscores.php +++ b/system/pages/highscores.php @@ -210,10 +210,13 @@ if (empty($highscores)) { } $highscores = $query->get()->map(function($row) { + /** + * @var Player $row + */ $tmp = $row->toArray(); $tmp['online'] = $row->online_status; $tmp['vocation'] = $row->vocation_name; - $tmp['outfit_url'] = $row->outfit_url; // @phpstan-ignore-line + $tmp['outfit_url'] = $row->outfit_url; $tmp['link'] = getPlayerLink($row->name, false); unset($tmp['online_table']); diff --git a/system/src/Models/Player.php b/system/src/Models/Player.php index 77fe4504..77b9313f 100644 --- a/system/src/Models/Player.php +++ b/system/src/Models/Player.php @@ -5,6 +5,7 @@ use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\HasOne; /** + * @property string $name * @property int $level * @property int $vocation * @property int $online @@ -14,6 +15,9 @@ use Illuminate\Database\Eloquent\Relations\HasOne; * @property int $looklegs * @property int $lookfeet * @property int $lookaddons + * @property int $promotion + * @property bool $online_status + * @property string $vocation_name * @property string $outfit_url * @property hasOne $onlineTable */