Commit 790cb86a authored by Falko Timme's avatar Falko Timme

- Make sure no rewrite rules are created if the redirect path is empty.

parent accfe5ed
......@@ -755,7 +755,7 @@ class apache2_plugin {
// Rewrite rules
$rewrite_rules = array();
if($data['new']['redirect_type'] != '') {
if($data['new']['redirect_type'] != '' && $data['new']['redirect_path'] != '') {
if(substr($data['new']['redirect_path'],-1) != '/') $data['new']['redirect_path'] .= '/';
if(substr($data['new']['redirect_path'],0,8) == '[scheme]'){
$rewrite_target = 'http'.substr($data['new']['redirect_path'],8);
......@@ -821,7 +821,7 @@ class apache2_plugin {
}
$app->log('Add server alias: '.$alias['domain'],LOGLEVEL_DEBUG);
// Rewriting
if($alias['redirect_type'] != '') {
if($alias['redirect_type'] != '' && $alias['redirect_path'] != '') {
if(substr($alias['redirect_path'],-1) != '/') $alias['redirect_path'] .= '/';
if(substr($alias['redirect_path'],0,8) == '[scheme]'){
$rewrite_target = 'http'.substr($alias['redirect_path'],8);
......
......@@ -778,7 +778,7 @@ class nginx_plugin {
// Rewrite rules
$rewrite_rules = array();
if($data['new']['redirect_type'] != '') {
if($data['new']['redirect_type'] != '' && $data['new']['redirect_path'] != '') {
if(substr($data['new']['redirect_path'],-1) != '/') $data['new']['redirect_path'] .= '/';
if(substr($data['new']['redirect_path'],0,8) == '[scheme]') $data['new']['redirect_path'] = '$scheme'.substr($data['new']['redirect_path'],8);
/* Disabled path extension
......@@ -834,7 +834,7 @@ class nginx_plugin {
}
$app->log('Add server alias: '.$alias['domain'],LOGLEVEL_DEBUG);
// Rewriting
if($alias['redirect_type'] != '') {
if($alias['redirect_type'] != '' && $alias['redirect_path'] != '') {
if(substr($alias['redirect_path'],-1) != '/') $alias['redirect_path'] .= '/';
if(substr($alias['redirect_path'],0,8) == '[scheme]') $alias['redirect_path'] = '$scheme'.substr($alias['redirect_path'],8);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment