From 537349fc1426942e27c49d415e400ff89c65cf57 Mon Sep 17 00:00:00 2001 From: mcramer <m.cramer@pixcept.de> Date: Wed, 14 Nov 2012 05:06:04 -0500 Subject: [PATCH] Updated: Do not add a / to redirect path if path begins with http(s) or [scheme] --- 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 aa33628..ca8a88c 100644 --- a/server/plugins-available/apache2_plugin.inc.php +++ b/server/plugins-available/apache2_plugin.inc.php @@ -868,7 +868,7 @@ // Rewrite rules $rewrite_rules = array(); 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'],-1) != '/' && !preg_match('/^(https?|\[scheme\]):\/\//', $data['new']['redirect_path'])) $data['new']['redirect_path'] .= '/'; if(substr($data['new']['redirect_path'],0,8) == '[scheme]'){ $rewrite_target = 'http'.substr($data['new']['redirect_path'],8); $rewrite_target_ssl = 'https'.substr($data['new']['redirect_path'],8); @@ -963,7 +963,7 @@ // Rewriting if($alias['redirect_type'] != '' && $alias['redirect_path'] != '') { - if(substr($alias['redirect_path'],-1) != '/') $alias['redirect_path'] .= '/'; + if(substr($alias['redirect_path'],-1) != '/' && !preg_match('/^(https?|\[scheme\]):\/\//', $data['new']['redirect_path'])) $alias['redirect_path'] .= '/'; if(substr($alias['redirect_path'],0,8) == '[scheme]'){ $rewrite_target = 'http'.substr($alias['redirect_path'],8); $rewrite_target_ssl = 'https'.substr($alias['redirect_path'],8); -- Gitblit v1.9.1