From 790cb86a8f98ddcd5cc7cb109f2b6a990cd4814e Mon Sep 17 00:00:00 2001
From: ftimme <ft@falkotimme.com>
Date: Mon, 09 Apr 2012 18:54:00 -0400
Subject: [PATCH] - Make sure no rewrite rules are created if the redirect path is empty.

---
 server/plugins-available/apache2_plugin.inc.php |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/plugins-available/apache2_plugin.inc.php b/server/plugins-available/apache2_plugin.inc.php
index 1f4cc2b..650b843 100644
--- a/server/plugins-available/apache2_plugin.inc.php
+++ b/server/plugins-available/apache2_plugin.inc.php
@@ -755,7 +755,7 @@
 
 		// 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 @@
 				}
 				$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);

--
Gitblit v1.9.1