diff --git a/webfiori/framework/router/RouterUri.php b/webfiori/framework/router/RouterUri.php index f1577bf5..01e6471b 100644 --- a/webfiori/framework/router/RouterUri.php +++ b/webfiori/framework/router/RouterUri.php @@ -267,7 +267,7 @@ public function getLanguages() : array { public function getMiddleware() : array { if (count($this->assignedMiddlewareList) != count($this->sortedMiddleeareList)) { $compareFunc = function ($a, $b) { - return $b->getPriority() - $a->getPriority(); + return $a->compare($b); }; $this->sortedMiddleeareList = $this->assignedMiddlewareList;