Using the TYPO3_PATH_WEB env var with a trailing
slash leads to failing unit/functional tests.
Trimming and appending a slash makes the usage
fail safe.
Releases: master
Resolves: #69124
Change-Id: I5048de4c9d35400c148cb5c40cf516d0d684b47a
Reviewed-on: http://review.typo3.org/42676
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
*/
protected function getWebRoot() {
if (getenv('TYPO3_PATH_WEB')) {
- $webRoot = getenv('TYPO3_PATH_WEB') . '/';
+ $webRoot = getenv('TYPO3_PATH_WEB');
} else {
- $webRoot = getcwd() . '/';
+ $webRoot = getcwd();
}
-
- return strtr($webRoot, '\\', '/');
+ return rtrim(strtr($webRoot, '\\', '/'), '/') . '/';
}
}
*/
protected function getWebRoot() {
if (getenv('TYPO3_PATH_WEB')) {
- $webRoot = getenv('TYPO3_PATH_WEB') . '/';
+ $webRoot = getenv('TYPO3_PATH_WEB');
} else {
- $webRoot = getcwd() . '/';
+ $webRoot = getcwd();
}
-
- return strtr($webRoot, '\\', '/');
+ return rtrim(strtr($webRoot, '\\', '/'), '/') . '/';
}
/**