Skip to content

Commit 69346a8

Browse files
committed
Make ##subroot token less typos prone.
1 parent 8b4cc0c commit 69346a8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/plugins-available/nginx_plugin.inc.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2862,10 +2862,10 @@ private function nginx_replace($matches){
28622862
return $location;
28632863
}
28642864

2865-
private function nginx_merge_locations($vhost_conf){
2866-
global $app, $conf;
2865+
private function nginx_merge_locations($vhost_conf) {
2866+
global $app, $conf;
28672867

2868-
if(preg_match('/##subroot (.+) ##/', $vhost_conf, $subroot)) {
2868+
if(preg_match('/##subroot (.+?)\s*##/', $vhost_conf, $subroot)) {
28692869
if(!preg_match('/^(?:[a-z0-9\/_-]|\.(?!\.))+$/iD', $subroot[1])) {
28702870
$app->log('Token ##subroot is unsecure (server ID: '.$conf['server_id'].').', LOGLEVEL_WARN);
28712871
} else {

0 commit comments

Comments
 (0)