Project

General

Profile

Actions

Bug #21544

closed

Pagetree frame shows HTTP 404 error

Added by Björn Pedersen over 14 years ago. Updated almost 14 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
-
Target version:
-
Start date:
2009-11-13
Due date:
% Done:

0%

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

Description

sometimes (mostly after using modules without pagetree, the page tree frame gives a 404:

Not Found

The requested URL /typo3/&currentSubScript= was not found on this server.

It seems like the url is missing some script part.

(issue imported from #M12581)


Files

0012581.patch (542 Bytes) 0012581.patch Administrator Admin, 2009-11-24 15:45
0012581_followup.patch (826 Bytes) 0012581_followup.patch Administrator Admin, 2009-11-25 00:53

Related issues 4 (0 open4 closed)

Related to TYPO3 Core - Bug #21346: Page tree will not be shown in the typo3 backendClosedOliver Hader2009-10-23

Actions
Related to TYPO3 Core - Bug #21681: after installation (wamp server): not found message in the backendClosedChris topher2009-11-25

Actions
Related to TYPO3 Core - Bug #21705: Page Tree shows Server ErrorClosedChristian Kuhn2009-11-26

Actions
Has duplicate TYPO3 Core - Bug #21600: Page tree will not be shown in the typo3 backendClosedOliver Hader2009-11-18

Actions
Actions #1

Updated by Oliver Hader over 14 years ago

Can you please provide, how this is called, e.g.
http://my-domain.com/typo3/alt_mod_frameset.php?fW=0&nav=/typo3/alt_db_navframe.php%3F&script=...&id=...

In general this should be fixed for TYPO3 4.3-beta3, however you still report this issue for that version.

Actions #2

Updated by Björn Pedersen over 14 years ago

<iframe id="content" scrolling="auto" frameborder="0" marginheight="0" marginwidth="0" name="content" src="/typo3/alt_mod_frameset.php?fW=0&nav=/typo3/alt_db_navframe.php%3F&script=..%2Ftypo3conf%2Fext%2Ftemplavoila%2Fmod1%2Findex.php&id=" style="height: 541px;">

It seems, that somes clicking fast twice gets the tree back.

Actions #3

Updated by Björn Pedersen over 14 years ago

<iframe id="content" scrolling="auto" frameborder="0" marginheight="0" marginwidth="0" name="content" src="/typo3/alt_mod_frameset.php?fW=0&nav=/typo3/alt_db_navframe.php%3F&script=..%2Ftypo3conf%2Fext%2Ftemplavoila%2Fmod1%2Findex.php&id=" style="height: 541px;">

no difference to see if it is working :(

Actions #4

Updated by Björn Pedersen over 14 years ago

Nov 13 15:51:16 wwwtest http://wwwtest.xxxxxxxx/: - Core: The URL "../typo3conf/ext/templavoila/mod1/index.php" is not considered to be local and was denied.
Nov 13 15:51:16 wwwtest http://wwwtest.xxxxxxxx/: - Core: The URL "/typo3/alt_db_navframe.php?" is not considered to be local and was denied.

From the logfiles.

Actions #5

Updated by Björn Pedersen over 14 years ago

the output after clicking the page module from:

self::debug($url );
self::debug($testAbsoluteUrl);
self::debug($testRelativeUrl);

in sanitizeLocalURL:

./typo3conf/ext/templavoila/mod1/index.php ./typo3conf/ext/templavoila/mod1/index.php /typo3conf/ext/templavoila/mod1/index.php /typo3/alt_db_navframe.php? /typo3/alt_db_navframe.php? /typo3//typo3/alt_db_navframe.php?
Actions #6

Updated by Oliver Hader over 14 years ago

Hm, that's strange...
What is the base path to your TYPO3 backend (e.g. http://mydomain.com/subDirectory/typo3/backend.php)?

Actions #7

Updated by Oliver Hader over 14 years ago

Oh, and could you please also debug self::getIndpEnv('TYPO3_SITE_PATH')? Thanks

Actions #8

Updated by Björn Pedersen over 14 years ago

the basepath is: http://wwwtest.xxxxx.xxxx/typo3

I will debug TYPO3_SITE_PATH later today,

Actions #9

Updated by Björn Pedersen over 14 years ago

t3lib_div::debug(t3lib_div::getIndpEnv('TYPO3_SITE_PATH'));
in the main function of alt_mod_frameset.php gives :
/

which seems correct.

The same result is obtained if debugging in class.t3lib_div.php::sanitizeLocalURL

Actions #10

Updated by Oliver Hader over 14 years ago

That looks all correct. What puzzles me is the fact that it happens only sometimes as you write in your initial bug description. If you can manage to have it reproducible I'd like to investigate further.

Actions #11

Updated by Björn Pedersen over 14 years ago

Further debugging gave a result:
For all wrong calls self::isValidUrl($decodedUrl) returned true, which skipped all if's. I think the if-cascade is wrong, the first if should surround the if/ifelse block, and not be a part of it. See below.

public static function sanitizeLocalUrl($url = '') {
$sanitizedUrl = '';
$decodedUrl = rawurldecode($url);
if (!empty($url) && self::removeXSS($decodedUrl) === $decodedUrl) {
$testAbsoluteUrl = self::resolveBackPath($decodedUrl);
$testRelativeUrl = self::resolveBackPath(
t3lib_div::dirname(t3lib_div::getIndpEnv('SCRIPT_NAME')) . '/' . $decodedUrl
);
// Pass if URL is on the current host:
if (self::isValidUrl($decodedUrl)) {
self::sysLog('isValidUrl','Core', self::SYSLOG_SEVERITY_NOTICE);
if (self::isOnCurrentHost($decodedUrl) && strpos($decodedUrl, self::getIndpEnv('TYPO3_SITE_URL')) === 0) {
$sanitizedUrl = $url;
// Pass if URL is an absolute file path:
} elseif (self::isAbsPath($decodedUrl) && self::isAllowedAbsPath($decodedUrl)) {
$sanitizedUrl = $url;
// Pass if URL is absolute and below TYPO3 base directory:
} elseif (strpos($testAbsoluteUrl, self::getIndpEnv('TYPO3_SITE_PATH')) === 0 && substr($decodedUrl, 0, 1) === '/') {
$sanitizedUrl = $url;
// Pass if URL is relative and below TYPO3 base directory:
} elseif (strpos($testRelativeUrl, self::getIndpEnv('TYPO3_SITE_PATH')) === 0 && substr($decodedUrl, 0, 1) !== '/') {
$sanitizedUrl = $url;
}
}
}
if (!empty($url) && empty($sanitizedUrl)) {
self::sysLog('The URL "' . $url . '" is not considered to be local and was denied.', 'Core', self::SYSLOG_SEVERITY_NOTICE);
}
return $sanitizedUrl;
}
Actions #12

Updated by Björn Pedersen over 14 years ago

With RC1, it always happens e.g. when switching from filelist to page-modul or vice versa.

Actions #13

Updated by Oliver Hader over 14 years ago

Whicht PHP version do you use exactly?

Actions #14

Updated by Björn Pedersen over 14 years ago

PHP Version
5.2.6
Web Server
Apache/2.2.9 (FreeBSD) mod_ssl/2.2.9 OpenSSL/0.9.8e DAV/2 PHP/5.2.6 with Suhosin-Patch

Actions #15

Updated by Oliver Hader over 14 years ago

Do you have DAM installed?
Standby some minutes, I'm going to create a patch for the isValidUrl() thingy...

Actions #16

Updated by Björn Pedersen over 14 years ago

Yes DAM is installed.

Actions #17

Updated by Oliver Hader over 14 years ago

Please test the attached patch file
It seems that there are wrong implementations in PHP5's filter_var() concerning URLs:

To work around now it's checked whether an URL starts with an URL scheme

Actions #18

Updated by Björn Pedersen over 14 years ago

Yes, that patch solves the problem.

Actions #19

Updated by Oliver Hader over 14 years ago

Ok - I'm going to post it on the Core List then

Actions #20

Updated by Oliver Hader over 14 years ago

Committed to SVN:
  • TYPO3_4-2 (rev. 6517)
  • Trunk (rev. 6518)
Actions #22

Updated by Oliver Hader over 14 years ago

Björn, could you please test the 0012581_followup.patch file?
It add an additional flag to the filter_var() function call that seems not to be used on some PHP5.2 version (e.g. yours). Thanks in advance!

Actions #23

Updated by Björn Pedersen over 14 years ago

Just tested, it is still working correctly with the followup-patch.

Actions #24

Updated by Oliver Hader over 14 years ago

Committed follow-up to SVN:
  • TYPO3_4-2 (rev. 6529)
  • Trunk (rev. 6530)
Actions

Also available in: Atom PDF