mirror of
https://github.com/slawkens/myaac.git
synced 2025-11-27 21:56:50 +01:00
Ignore case on plugin route method
This commit is contained in:
@@ -115,6 +115,18 @@ $dispatcher = FastRoute\cachedDispatcher(function (FastRoute\RouteCollector $r)
|
||||
if ($route[0] === '*') {
|
||||
$route[0] = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'HEAD'];
|
||||
}
|
||||
else {
|
||||
if (is_string($route[0])) {
|
||||
$route[0] = explode(',', $route[0]);
|
||||
}
|
||||
|
||||
$toUpperCase = function(string $value): string {
|
||||
return trim(strtoupper($value));
|
||||
};
|
||||
|
||||
// convert to upper case, fast-route accepts only upper case
|
||||
$route[0] = array_map($toUpperCase, $route[0]);
|
||||
}
|
||||
|
||||
$aliases = [
|
||||
[':int', ':string', ':alphanum'],
|
||||
|
||||
Reference in New Issue
Block a user