[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 15:06:49 +0000 (17:06 +0200)
commit174d81fdffeffe47e0888527b8b8e5f7470e0e23
treeb66a320860e9bcf83b7631290dd5c620c51e9e15
parent8d9854cbf7f24c733c6fdd70c9480dc3e04dbacb
[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: I8058db5d2a70a6d94b7c3c511e549cccc8079a2c
Fixes: #35847
Releases: 6.0, 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/10258
Reviewed-by: Ingo Renner
Tested-by: Ingo Renner
t3lib/class.t3lib_div.php
tests/t3lib/t3lib_divTest.php