1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-13 20:24:08 +02:00

[ticket/11620] Add validate_referrer test

Add a test for the validate_referrer function.

PHPBB3-11620
This commit is contained in:
Andy Chase
2013-07-03 12:28:37 -07:00
parent 30ebc03d14
commit 290533a14f
2 changed files with 95 additions and 1 deletions

View File

@@ -102,10 +102,24 @@ class phpbb_session_testable_facade
return $session->session_create($user_id, $set_admin, $persist_login, $viewonline);
}
function validate_referer($check_script_path = false)
function validate_referer(
$check_script_path,
$referer,
$host,
$force_server_vars,
$server_port,
$server_name,
$root_script_path
)
{
$session = $this->session_factory->get_session($this->db);
global $config, $request;
$session->referer = $referer;
$session->page['root_script_path'] = $root_script_path;
$session->host = $host;
$config['force_server_vars'] = $force_server_vars;
$config['server_name'] = $server_name;
$request->overwrite('SERVER_PORT', $server_port, phpbb_request_interface::SERVER);
return $session->validate_referer($check_script_path);
}
}