diff --git a/ChangeLog b/ChangeLog index 00f10c42965f0a667191641097c7f5c78f835df9..304c81018c0f45f24001e875a21baffa50892edb 100755 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ 2010-08-12 Steffen Kamper <steffen@typo3.org> + * Fixed bug #3819: t3lib_div::getIndpEnv('TYPO3_DOCUMENT_ROOT') delivers wrong value in Backend * Fixed bug #15020: Enhancement of t3lib_div::testInt (Thanks to Michiel Roos) * Fixed bug #15029: Testcase for t3lib_div::isFirstPartOfStr is missing. (Thanks to Nikolas Hagestein) * Fixed bug #13815: Feature: Add .numberFormat function to stdWrap (Thanks to Sebastian Michaelsen) diff --git a/t3lib/class.t3lib_div.php b/t3lib/class.t3lib_div.php index 94fbe85988198057eaa59c513b987c56819869ee..e0b5407a24e664ac7411fce88185abb545b0217e 100644 --- a/t3lib/class.t3lib_div.php +++ b/t3lib/class.t3lib_div.php @@ -4071,6 +4071,8 @@ final class t3lib_div { $retVal = $_SERVER[$getEnvName]; break; case 'TYPO3_DOCUMENT_ROOT': + // Get the web root (it is not the root of the TYPO3 installation) + // The absolute path of the script can be calculated with TYPO3_DOCUMENT_ROOT + SCRIPT_FILENAME // Some CGI-versions (LA13CGI) and mod-rewrite rules on MODULE versions will deliver a 'wrong' DOCUMENT_ROOT (according to our description). Further various aliases/mod_rewrite rules can disturb this as well. // Therefore the DOCUMENT_ROOT is now always calculated as the SCRIPT_FILENAME minus the end part shared with SCRIPT_NAME. $SFN = self::getIndpEnv('SCRIPT_FILENAME'); diff --git a/t3lib/class.t3lib_fullsearch.php b/t3lib/class.t3lib_fullsearch.php index b8124f800c19599f5d62c2d33c0c69e7551aad5f..9eff88ecc263e7f89ad9906853753041361672b7 100644 --- a/t3lib/class.t3lib_fullsearch.php +++ b/t3lib/class.t3lib_fullsearch.php @@ -850,7 +850,7 @@ class t3lib_fullsearch { function makeValueList($fN, $fV, $conf, $table, $splitString) { $fieldSetup = $conf; if ($fieldSetup['type'] == 'files') { - $d = dir(t3lib_div::getIndpEnv(TYPO3_DOCUMENT_ROOT).'/'.$fieldSetup['uploadfolder']); + $d = dir(PATH_site . $fieldSetup['uploadfolder']); while (false !== ($entry = $d->read())) { if ($entry == '.' || $entry == '..') { continue; diff --git a/t3lib/class.t3lib_querygenerator.php b/t3lib/class.t3lib_querygenerator.php index f0d4ab4ebb33109781e3e3f344240a255414afb0..351f79ab4d364cd7db87a91b0c41ca778fd9ed00 100644 --- a/t3lib/class.t3lib_querygenerator.php +++ b/t3lib/class.t3lib_querygenerator.php @@ -752,7 +752,7 @@ class t3lib_queryGenerator { } } } - $d = dir(t3lib_div::getIndpEnv(TYPO3_DOCUMENT_ROOT).'/'.$fieldSetup['uploadfolder']); + $d = dir(PATH_site . $fieldSetup['uploadfolder']); while (false !== ($entry=$d->read())) { if ($entry=='.' || $entry=='..') { continue; diff --git a/tests/t3lib/cache/backend/t3lib_cache_backend_filebackendTest.php b/tests/t3lib/cache/backend/t3lib_cache_backend_filebackendTest.php index 122921538c64a3b37327d72637f6dfc9f9925885..bb009d4fe6e1bdf5cfaf61de3ebf7a0bb6d233b4 100644 --- a/tests/t3lib/cache/backend/t3lib_cache_backend_filebackendTest.php +++ b/tests/t3lib/cache/backend/t3lib_cache_backend_filebackendTest.php @@ -238,7 +238,7 @@ class t3lib_cache_backend_FileBackendTest extends tx_phpunit_testcase { $mockCache->expects($this->atLeastOnce())->method('getIdentifier')->will($this->returnValue('UnitTestCache')); $backend = $this->getMock('t3lib_cache_backend_FileBackend', array('isCacheFileExpired'), array(), '', FALSE); - $fullPathToCacheFile = t3lib_div::getIndpEnv('TYPO3_DOCUMENT_ROOT') . '/typo3temp/cache/UnitTestCache/ExpiredEntry'; + $fullPathToCacheFile = PATH_site . 'typo3temp/cache/UnitTestCache/ExpiredEntry'; $backend->expects($this->once())->method('isCacheFileExpired')->with($fullPathToCacheFile)->will($this->returnValue(TRUE)); $backend->setCache($mockCache);