Bug #21467

tweak for t3lib_div::locationHeaderUrl()

Added by Morten Nisker over 10 years ago. Updated over 6 years ago.

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

0%

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)

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

History

#1 Updated by Alexander Opitz about 7 years ago

  • Status changed from New to Needs Feedback
  • Target version deleted (0)

As this report is very old, is the handling in newer TYPO3 CMS Versions (like 6.0/6.1) more like you expect it?

#2 Updated by Alexander Opitz over 6 years ago

  • Status changed from Needs Feedback to Closed
  • Is Regression set to No

No feedback for over 90 days.

Also available in: Atom PDF