phpBB

Code Changes

File: phpbb/controller/helper.php

  Unmodified   Added   Modified   Removed
Line 71Line 71
	* @param \phpbb\template\template $template Template object
* @param \phpbb\user $user User object
* @param \phpbb\config\config $config Config object

	* @param \phpbb\template\template $template Template object
* @param \phpbb\user $user User object
* @param \phpbb\config\config $config Config object

 
	 *

	* @param \phpbb\controller\provider $provider Path provider
* @param \phpbb\extension\manager $manager Extension manager object
* @param \phpbb\symfony_request $symfony_request Symfony Request object

	* @param \phpbb\controller\provider $provider Path provider
* @param \phpbb\extension\manager $manager Extension manager object
* @param \phpbb\symfony_request $symfony_request Symfony Request object

Line 100Line 101
	* @param string $page_title The title of the page to output
* @param int $status_code The status code to be sent to the page header
* @param bool $display_online_list Do we display online users list

	* @param string $page_title The title of the page to output
* @param int $status_code The status code to be sent to the page header
* @param bool $display_online_list Do we display online users list

 
	* @param int $item_id Restrict online users to item id
* @param string $item Restrict online users to a certain session item, e.g. forum for session_forum_id
* @param bool $send_headers Whether headers should be sent by page_header(). Defaults to false for controllers.

	*
* @return Response object containing rendered page
*/

	*
* @return Response object containing rendered page
*/

	public function render($template_file, $page_title = '', $status_code = 200, $display_online_list = false)

	public function render($template_file, $page_title = '', $status_code = 200, $display_online_list = false, $item_id = 0, $item = 'forum', $send_headers = false)

	{

	{

		page_header($page_title, $display_online_list);

		page_header($page_title, $display_online_list, $item_id, $item, $send_headers);


$this->template->set_filenames(array(
'body' => $template_file,


$this->template->set_filenames(array(
'body' => $template_file,

Line 113Line 117

page_footer(true, false, false);



page_footer(true, false, false);


		return new Response($this->template->assign_display('body'), $status_code);



		$headers = !empty($this->user->data['is_bot']) ? array('X-PHPBB-IS-BOT' => 'yes') : array();

return new Response($this->template->assign_display('body'), $status_code, $headers);

	}

/**

	}

/**

Line 137Line 143

$context = new RequestContext();
$context->fromRequest($this->symfony_request);


$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);


$script_name = $this->symfony_request->getScriptName();
$page_name = substr($script_name, -1, 1) == '/' ? '' : utf8_basename($script_name);

Line 153Line 168
		$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

		$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']))
{

		{
if (empty($this->config['enable_mod_rewrite']))
{