From 69346a81eca63c2f9c86fc755e8b212a10481ccc Mon Sep 17 00:00:00 2001
From: Costin <manykc@yahoo.com>
Date: Sun, 7 Jan 2018 20:43:36 +0100
Subject: [PATCH] Make ##subroot token less typos prone.

---
 server/plugins-available/nginx_plugin.inc.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/server/plugins-available/nginx_plugin.inc.php b/server/plugins-available/nginx_plugin.inc.php
index dd680380c9..bcacdcab99 100644
--- a/server/plugins-available/nginx_plugin.inc.php
+++ b/server/plugins-available/nginx_plugin.inc.php
@@ -2862,10 +2862,10 @@ class nginx_plugin {
 		return $location;
 	}
 
-	private function nginx_merge_locations($vhost_conf){
-        global $app, $conf;
+	private function nginx_merge_locations($vhost_conf) {
+		global $app, $conf;
 
-        if(preg_match('/##subroot (.+) ##/', $vhost_conf, $subroot)) {
+        if(preg_match('/##subroot (.+?)\s*##/', $vhost_conf, $subroot)) {
             if(!preg_match('/^(?:[a-z0-9\/_-]|\.(?!\.))+$/iD', $subroot[1])) {
                 $app->log('Token ##subroot is unsecure (server ID: '.$conf['server_id'].').', LOGLEVEL_WARN);
             } else {
-- 
GitLab