Skip to content

Commit

Permalink
fix vhost-cleaning regex for nginx-location directives; fixes #1185
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Kaufmann <[email protected]>
  • Loading branch information
d00p committed Sep 12, 2023
1 parent 6d9014c commit 506cccd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Froxlor/Cron/Http/Nginx.php
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ private function cleanVhostStruct($vhost = null)
// 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
Expand Down

0 comments on commit 506cccd

Please sign in to comment.