mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
ok... now i remember. Added more precise comments
git-svn-id: file:///svn/phpbb/trunk@9159 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
9ef743ba7d
commit
16e8b8271b
1 changed files with 6 additions and 5 deletions
|
@ -2125,14 +2125,15 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false)
|
||||||
global $_SID, $_EXTRA_URL, $phpbb_hook;
|
global $_SID, $_EXTRA_URL, $phpbb_hook;
|
||||||
static $parsed_urls = array();
|
static $parsed_urls = array();
|
||||||
|
|
||||||
// Adjust internal url before calling the hook - we are able to just leave out any path and extension.
|
// The following code is used to make sure such calls like append_sid('viewtopic') (ommitting phpbb_root_path and php_ext) work as intended
|
||||||
// In this case the root path and extension are added before going through this function.
|
|
||||||
if (isset($parsed_urls[$url]))
|
if (isset($parsed_urls[$url]))
|
||||||
{
|
{
|
||||||
|
// Set an url like 'viewtopic' to PHPBB_ROOT_PATH . 'viewtopic.' . PHP_EXT
|
||||||
$url = $parsed_urls[$url];
|
$url = $parsed_urls[$url];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// If we detect an url without root path and extension, and also not a relative or absolute path, we add it and put it to the parsed urls
|
||||||
if (strpos($url, '.' . PHP_EXT) === false && $url[0] != '.' && $url[0] != '/')
|
if (strpos($url, '.' . PHP_EXT) === false && $url[0] != '.' && $url[0] != '/')
|
||||||
{
|
{
|
||||||
$parsed_urls[$url] = $url = PHPBB_ROOT_PATH . $url . '.' . PHP_EXT;
|
$parsed_urls[$url] = $url = PHPBB_ROOT_PATH . $url . '.' . PHP_EXT;
|
||||||
|
|
Loading…
Add table
Reference in a new issue