Project

General

Profile

Actions

Bug #14271

closed

prefixRelPath incorrectly prefixes absolute urls

Added by Lyle E almost 20 years ago. Updated almost 18 years ago.

Status:
Closed
Priority:
Should have
Category:
Backend API
Target version:
-
Start date:
2004-08-14
Due date:
% Done:

0%

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

Description

Problem:
URL's with a leading slash are absolute and should not be prefixed as though they were relative. The prefixRelPath function adds the template path (eg, /fileadmin/templates/current/) to the absolute url of /about/ resulting in an invalid (and non-existent) url of /fileadmin/templates/current//about/ (notice the double // before about)

prefixRelPath uses the built-in PHP function 'parse_url' to discover the 'scheme' (http, ftp, etc) of the URL to be prefixed. In the case of a URL with a leading / there is no 'scheme' value returned.

Solution:
One solution is to modify the function to include a simple check if the leading character of the url to be cleaned is a slash. Line 888 of typo3_src-3.6.2/t3lib/class.t3lib_parsehtml.original.php reads:

if (!$pU['scheme']) { // If not an absolute URL.

But could read:

if (!$pU['scheme'] && substr($srcVal, 0, 1)!='/') { // If not an absolute URL.

RedHat Linux EL 3.0
Typo3 SRC 3.6.2
AliasPRO extension (and others, this is the only one that is relevant)
(issue imported from #M288)

Actions

Also available in: Atom PDF