diff options
| author | Thomas Backlund <tmb@mageia.org> | 2017-05-26 20:02:07 +0300 | 
|---|---|---|
| committer | Thomas Backlund <tmb@mageia.org> | 2017-05-26 20:02:07 +0300 | 
| commit | 5e6803684739dc0963d784c0cefd86697ad397f3 (patch) | |
| tree | 8ab6acff6c8069c5ba3035cba3adec90dba24ba1 /phpBB/includes/functions.php | |
| parent | 8fc97191a3533a1cce0b051baa55db68d83b5dc4 (diff) | |
| parent | 11242dd07d6359a725f22f3674028adfdddb49d6 (diff) | |
| download | forums-5e6803684739dc0963d784c0cefd86697ad397f3.tar forums-5e6803684739dc0963d784c0cefd86697ad397f3.tar.gz forums-5e6803684739dc0963d784c0cefd86697ad397f3.tar.bz2 forums-5e6803684739dc0963d784c0cefd86697ad397f3.tar.xz forums-5e6803684739dc0963d784c0cefd86697ad397f3.zip  | |
Merge tag 'release-3.0.14' of https://github.com/phpbb/phpbb
Merge upstream 3.0.14 release.
Diffstat (limited to 'phpBB/includes/functions.php')
| -rw-r--r-- | phpBB/includes/functions.php | 18 | 
1 files changed, 14 insertions, 4 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index eef4ade4e7..2cef973a28 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2492,7 +2492,7 @@ function redirect($url, $return = false, $disable_cd_check = false)  		// Attention: only able to redirect within the same domain if $disable_cd_check is false (yourdomain.com -> www.yourdomain.com will not work)  		if (!$disable_cd_check && $url_parts['host'] !== $user->host)  		{ -			$url = generate_board_url(); +			trigger_error('Tried to redirect to potentially insecure url.', E_USER_ERROR);  		}  	}  	else if ($url[0] == '/') @@ -2579,6 +2579,12 @@ function redirect($url, $return = false, $disable_cd_check = false)  		}  	} +	// Make sure we don't redirect to external URLs +	if (!$disable_cd_check && strpos($url, generate_board_url(true) . '/') !== 0) +	{ +		trigger_error('Tried to redirect to potentially insecure url.', E_USER_ERROR); +	} +  	// Make sure no linebreaks are there... to prevent http response splitting for PHP < 4.4.2  	if (strpos(urldecode($url), "\n") !== false || strpos(urldecode($url), "\r") !== false || strpos($url, ';') !== false)  	{ @@ -2782,7 +2788,7 @@ function send_status_line($code, $message)  	}  	else  	{ -		if (!empty($_SERVER['SERVER_PROTOCOL'])) +		if (!empty($_SERVER['SERVER_PROTOCOL']) && is_string($_SERVER['SERVER_PROTOCOL']) && preg_match('#^HTTP/[0-9]\.[0-9]$#', $_SERVER['SERVER_PROTOCOL']))  		{  			$version = $_SERVER['SERVER_PROTOCOL'];  		} @@ -3367,7 +3373,7 @@ function parse_cfg_file($filename, $lines = false)  		}  		// Determine first occurrence, since in values the equal sign is allowed -		$key = strtolower(trim(substr($line, 0, $delim_pos))); +		$key = htmlspecialchars(strtolower(trim(substr($line, 0, $delim_pos))));  		$value = trim(substr($line, $delim_pos + 1));  		if (in_array($value, array('off', 'false', '0'))) @@ -3384,7 +3390,11 @@ function parse_cfg_file($filename, $lines = false)  		}  		else if (($value[0] == "'" && $value[sizeof($value) - 1] == "'") || ($value[0] == '"' && $value[sizeof($value) - 1] == '"'))  		{ -			$value = substr($value, 1, sizeof($value)-2); +			$value = htmlspecialchars(substr($value, 1, sizeof($value)-2)); +		} +		else +		{ +			$value = htmlspecialchars($value);  		}  		$parsed_items[$key] = $value;  | 
