Project

General

Profile

Actions

Bug #14271

closed

prefixRelPath incorrectly prefixes absolute urls

Added by Lyle E over 19 years ago. Updated over 17 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 #1

Updated by Lyle E over 19 years ago

I wasn't sure if I should select backend or front-end. It effects the backend during template building with TemplaVoila and the Front End when rendering TypoLinks.

Actions #2

Updated by Ingmar Schlecht over 19 years ago

This is fixed in CVS now and will be in Typo3 3.7.0

Actions #3

Updated by Lyle E over 19 years ago

Sounds great, thanks for taking my small patch.

What's the close procedure for these bugs? I'm new to the Typo3 development community.

Actions #4

Updated by Ingmar Schlecht over 19 years ago

I have to thank you for your patch! :-)

I'm now setting the status of this bug to resolved.

Actions

Also available in: Atom PDF