[BUGFIX] t3lib_div::getUrl() providing wrong error information
authorIngo Renner <ingo@typo3.org>
Wed, 11 Apr 2012 11:54:57 +0000 (13:54 +0200)
committerIngo Renner <ingo@typo3.org>
Wed, 11 Apr 2012 14:34:13 +0000 (16:34 +0200)
commitecc71ee8b7a8af4947d056f78953bef46796bc72
tree34460269cb746af75414ae208e43166f61f0e564
parent4829df639f9371f0d37c1aacc5388aebe09a0a34
[BUGFIX] t3lib_div::getUrl() providing wrong error information

When using t3lib_div::getUrl() with lib file/context it uses
file_get_contents() to read a URL. When this fails it tries to provide the
reason for the error but does not return the actual issue.

The error key in the returned array contains the error retrieved by
error_get_last() which does not provide the error that occurred with
file_get_contents(), but with PHP. Usually this is a notice.

The actual error message of file_get_contents() is in the variable
$http_response_header which is available after calling file_get_contents().

See http://de2.php.net/manual/en/reserved.variables.httpresponseheader.php

Change-Id: I6bb9ad7010a633f259da103f71f404592194f743
Fixes: #35847
Releases: 6.0, 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/10229
Reviewed-by: Oliver Klee
Tested-by: Oliver Klee
Reviewed-by: Andy Grunwald
Tested-by: Andy Grunwald
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
Reviewed-by: Ingo Renner
Tested-by: Ingo Renner
t3lib/class.t3lib_div.php
tests/t3lib/class.t3lib_divTest.php