diff options
| author | Marc Alexander <admin@m-a-styles.de> | 2016-04-07 21:59:36 +0200 | 
|---|---|---|
| committer | Marc Alexander <admin@m-a-styles.de> | 2016-04-07 21:59:36 +0200 | 
| commit | 901f36e982645efc6a778805cc592d80523f88d7 (patch) | |
| tree | cea81cf4280bdf67b10a42164ce51d5528710034 /phpBB/phpbb | |
| parent | c53eae7abca55929aeb700cfbe3e760418dce7f1 (diff) | |
| parent | 02469d46912c1e739f2ca134368db0dbfed74b50 (diff) | |
| download | forums-901f36e982645efc6a778805cc592d80523f88d7.tar forums-901f36e982645efc6a778805cc592d80523f88d7.tar.gz forums-901f36e982645efc6a778805cc592d80523f88d7.tar.bz2 forums-901f36e982645efc6a778805cc592d80523f88d7.tar.xz forums-901f36e982645efc6a778805cc592d80523f88d7.zip  | |
Merge pull request #4258 from Nicofuma/ticket/13683-3.2.x
[ticket/13683] Respects force_server_vars settings when generating URLs
Diffstat (limited to 'phpBB/phpbb')
| -rw-r--r-- | phpBB/phpbb/controller/helper.php | 18 | ||||
| -rw-r--r-- | phpBB/phpbb/routing/helper.php | 11 | 
2 files changed, 19 insertions, 10 deletions
diff --git a/phpBB/phpbb/controller/helper.php b/phpBB/phpbb/controller/helper.php index 9dbc3737f7..664b4f4e0f 100644 --- a/phpBB/phpbb/controller/helper.php +++ b/phpBB/phpbb/controller/helper.php @@ -52,15 +52,15 @@ class helper  	protected $routing_helper;  	/** -	* Constructor -	* -	* @param \phpbb\template\template $template Template object -	* @param \phpbb\user $user User object -	* @param \phpbb\config\config $config Config object -	* @param \phpbb\symfony_request $symfony_request Symfony Request object -	* @param \phpbb\request\request_interface $request phpBB request object -	* @param \phpbb\routing\helper $routing_helper Helper to generate the routes -	*/ +	 * Constructor +	 * +	 * @param \phpbb\template\template $template Template object +	 * @param \phpbb\user $user User object +	 * @param \phpbb\config\config $config Config object +	 * @param \phpbb\symfony_request $symfony_request Symfony Request object +	 * @param \phpbb\request\request_interface $request phpBB request object +	 * @param \phpbb\routing\helper $routing_helper Helper to generate the routes +	 */  	public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, \phpbb\symfony_request $symfony_request, \phpbb\request\request_interface $request, \phpbb\routing\helper $routing_helper)  	{  		$this->template = $template; diff --git a/phpBB/phpbb/routing/helper.php b/phpBB/phpbb/routing/helper.php index f56974a354..c15608dce5 100644 --- a/phpBB/phpbb/routing/helper.php +++ b/phpBB/phpbb/routing/helper.php @@ -104,6 +104,15 @@ class helper  		$context = new RequestContext();  		$context->fromRequest($this->symfony_request); +		if ($this->config['force_server_vars']) +		{ +			$context->setHost($this->config['server_name']); +			$context->setScheme(substr($this->config['server_protocol'], 0, -3)); +			$context->setHttpPort($this->config['server_port']); +			$context->setHttpsPort($this->config['server_port']); +			$context->setBaseUrl(rtrim($this->config['script_path'], '/')); +		} +  		$script_name = $this->symfony_request->getScriptName();  		$page_name = substr($script_name, -1, 1) == '/' ? '' : utf8_basename($script_name); @@ -119,7 +128,7 @@ class helper  		$base_url = str_replace('/' . $page_name, empty($this->config['enable_mod_rewrite']) ? '/app.' . $this->php_ext : '', $base_url);  		// We need to update the base url to move to the directory of the app.php file if the current script is not app.php -		if ($page_name !== 'app.php') +		if ($page_name !== 'app.php' && !$this->config['force_server_vars'])  		{  			if (empty($this->config['enable_mod_rewrite']))  			{  | 
