mcramer
2012-11-14 537349fc1426942e27c49d415e400ff89c65cf57
Updated: Do not add a / to redirect path if path begins with http(s) or [scheme]

1 files modified
4 ■■■■ changed files
server/plugins-available/apache2_plugin.inc.php 4 ●●●● patch | view | raw | blame | history
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);