mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
[ticket/12099] Correctly fix go back to root before prepending the root path
This allows moving app.php outside of phpBB and still work as expected PHPBB3-12099
This commit is contained in:
parent
64f51bd3dd
commit
58cfdfe143
1 changed files with 13 additions and 9 deletions
|
@ -184,17 +184,21 @@ class path_helper
|
||||||
* Append ../ to the end of the phpbb_root_path as many times
|
* Append ../ to the end of the phpbb_root_path as many times
|
||||||
* as / exists in path_info
|
* as / exists in path_info
|
||||||
*/
|
*/
|
||||||
return $this->web_root_path = $this->phpbb_root_path . str_repeat('../', $corrections);
|
$this->web_root_path = $this->filesystem->clean_path(str_repeat('../', $corrections) . $this->phpbb_root_path);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* If we're here it means we're at a re-written path, so we must
|
||||||
|
* correct the relative path for web URLs. We must append ../
|
||||||
|
* to the end of the root path as many times as / exists in path_info
|
||||||
|
* less one time (because the script, e.g. /app.php, doesn't exist in
|
||||||
|
* the URL)
|
||||||
|
*/
|
||||||
|
$this->web_root_path = $this->filesystem->clean_path(str_repeat('../', $corrections - 1) . $this->phpbb_root_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
return $this->web_root_path;
|
||||||
* If we're here it means we're at a re-written path, so we must
|
|
||||||
* correct the relative path for web URLs. We must append ../
|
|
||||||
* to the end of the root path as many times as / exists in path_info
|
|
||||||
* less one time (because the script, e.g. /app.php, doesn't exist in
|
|
||||||
* the URL)
|
|
||||||
*/
|
|
||||||
return $this->web_root_path = $this->phpbb_root_path . str_repeat('../', $corrections - 1);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue