From 1c64f00dcc7b57dc501c5f64cd9c3aed9d0569ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bar=C3=A1=C5=A1ek?= Date: Sun, 5 Jan 2020 21:49:27 +0100 Subject: [PATCH] Helpers: Fix routing to full domain --- src/Helpers.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Helpers.php b/src/Helpers.php index b1a1af3..3795b3e 100644 --- a/src/Helpers.php +++ b/src/Helpers.php @@ -30,12 +30,12 @@ public static function processPath(): string if (($currentUrl = self::getCurrentUrl()) !== null) { if (preg_match('/^(?:https?:\/\/.+)\/www\/?(.*)$/', $currentUrl, $localUrlParser)) { $return = $localUrlParser[1]; - } elseif (preg_match('/^(?:https?:\/\/[^\/]+)(.*)$/', $currentUrl, $publicUrlParser)) { - $return = $publicUrlParser[2]; + } elseif (preg_match('/^(?:https?:\/\/[^\/]+)(.*?)$/', $currentUrl, $publicUrlParser)) { + $return = $publicUrlParser[1]; } } - return $return !== null ? rtrim($return, '/') : ''; + return $return !== null ? trim($return, '/') : ''; } /**