From 782942d8904960b854cccaf539393f37998289b9 Mon Sep 17 00:00:00 2001 From: lorenzulrich Date: Thu, 11 Jul 2024 11:22:42 +0200 Subject: [PATCH] task: Allow redirects to external URLs --- Classes/Controller/DocumentsController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Classes/Controller/DocumentsController.php b/Classes/Controller/DocumentsController.php index 4b32869..d788897 100644 --- a/Classes/Controller/DocumentsController.php +++ b/Classes/Controller/DocumentsController.php @@ -383,7 +383,9 @@ private function findPossibleRedirect(string $path, string $host): ?array } return [ - 'targetPath' => '/' . ltrim($redirect->getTargetUriPath(), '/'), + 'targetPath' => parse_url($redirect->getTargetUriPath(), PHP_URL_SCHEME) === null ? + '/' . ltrim($redirect->getTargetUriPath(), '/') + : $redirect->getTargetUriPath(), 'statusCode' => $redirect->getStatusCode(), ]; }