From 34415c50f87bc9e0b292fa6bc8d992a8a0f6ca08 Mon Sep 17 00:00:00 2001 From: "Roman Schmerold (BNoiZe)" Date: Sun, 15 Feb 2015 19:07:01 +0100 Subject: [PATCH] Fixing a bug with linebreaks, fixes #1498 Signed-off-by: Roman Schmerold (BNoiZe) --- scripts/jobs/cron_tasks.inc.http.30.nginx.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/jobs/cron_tasks.inc.http.30.nginx.php b/scripts/jobs/cron_tasks.inc.http.30.nginx.php index 789baba4..758e504a 100644 --- a/scripts/jobs/cron_tasks.inc.http.30.nginx.php +++ b/scripts/jobs/cron_tasks.inc.http.30.nginx.php @@ -449,7 +449,7 @@ class nginx { // Clean user defined settings $vhost_usr = str_replace("\r", "\n", $vhost_usr); // Remove windows linebreaks - $vhost_usr = str_replace(array("{", "}"), array("{\n", "\n}"), $vhost_usr); // Break blocks into lines + $vhost_usr = str_replace(array("{ ", " }"), array("{\n", "\n}"), $vhost_usr); // Break blocks into lines $vhost_usr = explode("\n", preg_replace('/[ \t]+/', ' ', trim(preg_replace('/\t+/', '', $vhost_usr)))); // Break into array items $vhost_usr = array_filter($vhost_usr, create_function('$a','return preg_match("#\S#", $a);')); // Remove empty lines