Project

General

Profile

Actions

Bug #16335

closed

t3lib_div::getIndpEnv('TYPO3_DOCUMENT_ROOT') delivers wrong value in Backend

Added by Andreas Wolf almost 18 years ago. Updated about 13 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2006-07-11
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.0
PHP Version:
4.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When in backend mode, t3lib_div::getIndpEnv() delivers a wrong value when asked for 'TYPO3_DOCUMENT_ROOT'. When the root of your TYPO3-Installation is e.g. located in /srv/www/htdocs/t3inst/, it returns /srv/www/htdocs/t3inst/typo3/.
I suppose this happens because getIndpEnv uses SCRIPT_FILENAME for getting the document-root. When in backend-mode, this path is {real doc-root}/typo3/xyz.php, so the

Additionally, the value is always wrong when the whole TYPO3-dir is a symlink to another location, e.g. when /srv/www/htdocs/t3inst/ points to /srv/www/t3inst-real/.

(issue imported from #M3819)


Files

3819_v2.diff (2.87 KB) 3819_v2.diff Administrator Admin, 2010-08-08 19:29

Related issues 4 (0 open4 closed)

Related to TYPO3 Core - Bug #14410: RealURL does not work, because TYPO3_SITE_URL value is wrongClosed2004-11-24

Actions
Related to TYPO3 Core - Bug #17878: mod_rewrite redirect to subdirectory + realurl = page not foundClosed2007-12-03

Actions
Related to TYPO3 Core - Bug #23262: unittest in tests/t3lib/cache/backend/t3lib_cache_backend_filebackendTest.php fails if installed in subdir of document_rootClosedChristian Kuhn2010-07-24

Actions
Has duplicate TYPO3 Core - Bug #21415: Fix failing unit test in t3lib_cache_backend_FileBackendTestCaseClosedChristian Kuhn2009-11-01

Actions
Actions #1

Updated by Andreas Wolf almost 18 years ago

Well, I found out that this isn't a real bug in t3lib_div, but in the extension I used. The problem was that the extension called browse_links.php with a path containing two slashes, i.e. typo3//browse_links.php. This made getIndpEnv return an incorrect value for DOCUMENT_ROOT.
Perhaps there should be a clause that filters out double slashes etc. to avoid such errors in the future.

The problem with the symlink persists, btw.

Actions #2

Updated by Sebastian Kurfuerst over 17 years ago

keyword:t3dd06

Actions #3

Updated by Christian Kuhn almost 15 years ago

Confirmed: TYPO3_DOCUMENT_ROOT is wrong if installaltion symlinked (I think) / and or a subpath.
Stumbled upon this in the query generator for file fields.

Actions #4

Updated by Georg Ringer almost 15 years ago

IMO it is also wrong in subdirs

Actions #5

Updated by Peter Niederlag almost 14 years ago

Is this still a problem? In which menu/function/extension does this bug show up? Can it be reproduced somehow? Big Thx for any further hints.

Actions #6

Updated by Christian Kuhn almost 14 years ago

Still valid, at least if an installation is in a subdirectory.

Actions #7

Updated by Steffen Kamper over 13 years ago

My patch was wrong. Fact is that TYPO3_DOCUMENT_ROOT works as expected, it delivers the apache web root.

What is wrong is the usage - don't expect to compose the absolute path of a file with this var, use PATH_site instead. Attached v2 adds these comment to TYPO3_DOCUMENT_ROOT and fixes wrong usage in core:

// 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

Actions #8

Updated by Steffen Kamper over 13 years ago

Committed to svn
4_2 rev 8587
4_3 rev 8588
4_4 rev 8589
trunk rev 8590

Actions #9

Updated by Susanne Moog about 13 years ago

  • Target version deleted (4.5.0)
Actions

Also available in: Atom PDF