Project

General

Profile

« Previous | Next » 

Revision 1513

Added by Dietmar about 13 years ago

outputfilter now check and add missing slash in empty href if relative urls are enabled

View differences:

branches/2.8.x/CHANGELOG
12 12

  
13 13
=============================== FEATURES FREEZE ================================
14 14
----------------------------------- Fixes 2.8.2 --------------------------------
15
04 Okt-2011 Build 1513 Dietmar Woellbrink (Luisehahne)
16
! outputfilter now check and add missing slash in empty href if relative urls are enabled
15 17
24 Sep-2011 Build 1512 Werner v.d.Decken(DarkViper)
16 18
! settings for pwgen updated
17 19
14 Sep-2011 Build 1511 Dietmar Woellbrink (Luisehahne)
branches/2.8.x/wb/admin/interface/version.php
52 52

  
53 53
// check if defined to avoid errors during installation (redirect to admin panel fails if PHP error/warnings are enabled)
54 54
if(!defined('VERSION')) define('VERSION', '2.8.2');
55
if(!defined('REVISION')) define('REVISION', '1512');
55
if(!defined('REVISION')) define('REVISION', '1513');
branches/2.8.x/wb/modules/output_filter/filter-routines.php
58 58
		// get output filter settings from database
59 59
		$filter_settings = get_output_filter_settings();
60 60
		$location = '';
61
        if($filter_settings['sys_rel'] == '1'){
62
			if( !isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'off' )
63
			{
61
		if($filter_settings['sys_rel'] == '1'){
62
			if( !isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) == 'off' ) {
64 63
				define('SYS_HTTPS', false);
65 64
				define('SYS_PORT', (($_SERVER['SERVER_PORT'] != '80') ? ':'.$_SERVER['SERVER_PORT'] : '') );
66 65
				define('SYS_PROTOCOL', 'http');
67
			}else
68
			{
66
			} else {
69 67
				define('SYS_HTTPS', true);
70 68
				define('SYS_PORT', (($_SERVER['SERVER_PORT'] != '443') ? ':'.$_SERVER['SERVER_PORT'] : '') );
71 69
				define('SYS_PROTOCOL', 'https');
72 70
			}
73 71
			$tmp = '';
74
			if( isset($_SERVER['HTTP_HOST']) )
75
			{
72
			if( isset($_SERVER['HTTP_HOST']) ) {
76 73
				$tmp = $_SERVER['HTTP_HOST'];
77
			}elseif( isset($_SERVER['SERVER_NAME']) )
78
			{
74
			} elseif( isset($_SERVER['SERVER_NAME']) ) {
79 75
				$tmp = $_SERVER['SERVER_NAME'];
80 76
			}
81 77

  
82 78
			define('WB_HOST', preg_replace('/:[0-9]*$/', '', $tmp));
83
	        $location = SYS_PROTOCOL.'://'.WB_HOST.SYS_PORT;
79
			$location = SYS_PROTOCOL.'://'.WB_HOST.SYS_PORT;
80
			$searchfor = '/(<.*?=\s*?\")(?:'.preg_quote($location, '/').'\/?)(.*?\".*?>)/i';
81
			$content = preg_replace($searchfor, '$1/$2', $content);
82
			$content = preg_replace('/(<.*?(?:href|src)\s*=\s*?\")(\".*?>)/i', '$1/$2', $content);
84 83

  
85
        }
84
		}
86 85

  
87 86
		// work out the defined output filter mode: possible output filter modes: [0], 1, 2, 3, 6, 7
88 87
		// 2^0 * (0.. disable, 1.. enable) filtering of mail addresses in text
......
91 90

  
92 91
		// only filter output if we are supposed to
93 92
		if($filter_settings['email_filter'] != '1' && $filter_settings['mailto_filter'] != '1'){
94
			$searchfor = '/(<.*?=\s*?\")(?:'.preg_quote($location, '/').')(.*?\".*?>)/i';
95
			$content = preg_replace($searchfor, '$1$2', $content);
93
			// do nothing more
96 94
			return $content;
97 95
		}
98 96

  

Also available in: Unified diff