From 506cccd7c8bfa292ee5becc6105e93f776e0e7a0 Mon Sep 17 00:00:00 2001 From: Michael Kaufmann Date: Tue, 12 Sep 2023 15:20:56 +0200 Subject: [PATCH] fix vhost-cleaning regex for nginx-location directives; fixes #1185 Signed-off-by: Michael Kaufmann --- lib/Froxlor/Cron/Http/Nginx.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Froxlor/Cron/Http/Nginx.php b/lib/Froxlor/Cron/Http/Nginx.php index c0cf4749..33d80e86 100644 --- a/lib/Froxlor/Cron/Http/Nginx.php +++ b/lib/Froxlor/Cron/Http/Nginx.php @@ -883,7 +883,7 @@ class Nginx extends HttpConfigBase // remove comments $vhost = implode("\n", preg_replace('/^(\s+)?#(.*)$/', '', explode("\n", $vhost))); // Break blocks into lines - $vhost = preg_replace("/^(\s+)location(.+)\{(.+)\}$/misU", "location $2 {\n $3 \n}", $vhost); + $vhost = preg_replace("/^(\s+)?location(.+)\{(.+)\}$/misU", "location $2 {\n $3 \n}", $vhost); // Break into array items $vhost = explode("\n", preg_replace('/[ \t]+/', ' ', trim(preg_replace('/\t+/', '', $vhost)))); // Remove empty lines