Project

General

Profile

Actions

Bug #21467

closed

tweak for t3lib_div::locationHeaderUrl()

Added by Morten Nisker about 15 years ago. Updated about 11 years ago.

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

0%

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

Description

A bug in an extension made me have a look at locationHeaderUrl($path) in t3lib_div. And I think there is room for a little improvement.

If the the function is called with a path that is a relative URL this is feed directly to php parse_url() function even though the output from this is not needed in case of a relative URL.
Furthermore the documentation for parse_url() states: "Note: This function doesn't work with relative URLs." even though it actually does, but should it suddenly start working according to the documentation it will become a problem.

I've made a patch that makes the check for relative URL prior to calling parse_url() and also have also included a call to devLog with an error messsage if the URL is seriously malformed and causes parse_url() to emit a E_WARNING.

(issue imported from #M12479)


Files

patch.txt (693 Bytes) patch.txt Administrator Admin, 2009-11-05 15:11
Actions

Also available in: Atom PDF