1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-06 07:35:29 +02:00

Merge branch 'develop-olympus' into git-tools

This commit is contained in:
Igor Wiedler 2010-03-28 14:12:36 +02:00
commit 472739bcbc
2 changed files with 54 additions and 48 deletions

View File

@ -2297,6 +2297,8 @@ function redirect($url, $return = false, $disable_cd_check = false)
{
global $db, $cache, $config, $user, $phpbb_root_path;
$failover_flag = false;
if (empty($user->lang))
{
$user->add_lang('common');
@ -2344,11 +2346,14 @@ function redirect($url, $return = false, $disable_cd_check = false)
if (!file_exists($pathinfo['dirname']))
{
// 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'];
break;
$failover_flag = true;
}
}
if (!$failover_flag)
{
// Is the uri pointing to the current directory?
if ($pathinfo['dirname'] == '.')
{
@ -2405,6 +2410,7 @@ function redirect($url, $return = false, $disable_cd_check = false)
$url = generate_board_url() . '/' . $url;
}
}
}
// 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)

View File

@ -264,7 +264,7 @@ class phpbb_template_template_test extends phpbb_test_case
$this->template->set_filenames(array('test' => $filename));
$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->display('test');