mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-07 08:05:25 +02:00
Merge branch 'develop-olympus' into git-tools
This commit is contained in:
commit
472739bcbc
@ -2297,6 +2297,8 @@ function redirect($url, $return = false, $disable_cd_check = false)
|
|||||||
{
|
{
|
||||||
global $db, $cache, $config, $user, $phpbb_root_path;
|
global $db, $cache, $config, $user, $phpbb_root_path;
|
||||||
|
|
||||||
|
$failover_flag = false;
|
||||||
|
|
||||||
if (empty($user->lang))
|
if (empty($user->lang))
|
||||||
{
|
{
|
||||||
$user->add_lang('common');
|
$user->add_lang('common');
|
||||||
@ -2344,11 +2346,14 @@ function redirect($url, $return = false, $disable_cd_check = false)
|
|||||||
if (!file_exists($pathinfo['dirname']))
|
if (!file_exists($pathinfo['dirname']))
|
||||||
{
|
{
|
||||||
// fallback to "last known user page"
|
// fallback to "last known user page"
|
||||||
|
// at least this way we know the user does not leave the phpBB root
|
||||||
$url = generate_board_url() . '/' . $user->page['page'];
|
$url = generate_board_url() . '/' . $user->page['page'];
|
||||||
break;
|
$failover_flag = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!$failover_flag)
|
||||||
|
{
|
||||||
// Is the uri pointing to the current directory?
|
// Is the uri pointing to the current directory?
|
||||||
if ($pathinfo['dirname'] == '.')
|
if ($pathinfo['dirname'] == '.')
|
||||||
{
|
{
|
||||||
@ -2405,6 +2410,7 @@ function redirect($url, $return = false, $disable_cd_check = false)
|
|||||||
$url = generate_board_url() . '/' . $url;
|
$url = generate_board_url() . '/' . $url;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Make sure no linebreaks are there... to prevent http response splitting for PHP < 4.4.2
|
// 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)
|
if (strpos(urldecode($url), "\n") !== false || strpos(urldecode($url), "\r") !== false || strpos($url, ';') !== false)
|
||||||
|
@ -264,7 +264,7 @@ class phpbb_template_template_test extends phpbb_test_case
|
|||||||
$this->template->set_filenames(array('test' => $filename));
|
$this->template->set_filenames(array('test' => $filename));
|
||||||
$this->assertFileNotExists($this->template_path . '/' . $filename, 'Testing missing file, file cannot exist');
|
$this->assertFileNotExists($this->template_path . '/' . $filename, 'Testing missing file, file cannot exist');
|
||||||
|
|
||||||
$expecting = sprintf('template->_tpl_load_file(): File %s does not exist or is empty', realpath($this->template_path) . '/' . $filename);
|
$expecting = sprintf('template->_tpl_load_file(): File %s does not exist or is empty', realpath($this->template_path . '/../') . '/templates/' . $filename);
|
||||||
$this->setExpectedTriggerError(E_USER_ERROR, $expecting);
|
$this->setExpectedTriggerError(E_USER_ERROR, $expecting);
|
||||||
|
|
||||||
$this->display('test');
|
$this->display('test');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user