diff options
Diffstat (limited to 'src/Support')
| -rw-r--r-- | src/Support/Parser.php | 10 | ||||
| -rw-r--r-- | src/Support/RequestValidator.php | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/Support/Parser.php b/src/Support/Parser.php index 02ec251..c432240 100644 --- a/src/Support/Parser.php +++ b/src/Support/Parser.php @@ -33,10 +33,18 @@ class Parser $name = ""; $server = ""; + if (str_starts_with($alias, "#")) { + $alias = substr($alias, 1); + } + $parts = explode(":", $alias); - $name = substr($parts[0], 1); + $name = $parts[0]; $server = $parts[1]; + if ($server === "localhost" && str_starts_with($_ENV["DOMAIN"], "localhost")) { + $server = $_ENV["DOMAIN"]; + } + return [ "name" => $name, "server" => $server, diff --git a/src/Support/RequestValidator.php b/src/Support/RequestValidator.php index 40ede8b..e27ed4d 100644 --- a/src/Support/RequestValidator.php +++ b/src/Support/RequestValidator.php @@ -3,7 +3,7 @@ namespace App\Support; use App\Errors\AppException; -use App\Errors\ErrorCode; +use Matrix\Enums\ErrorCode; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; |
