Project

General

Profile

Actions

Bug #14438

closed

t3lib_div::getURL() do not always return something

Added by old_zas almost 20 years ago. Updated over 18 years ago.

Status:
Closed
Priority:
Should have
Category:
Backend API
Target version:
-
Start date:
2004-12-06
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
3.7.0
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

In t3lib/class.t3lib_div.php at line 2002, fopen() may fail.
In that case nothing is returned.
IMHO, return $content in if and elseif branch should be dropped and move just before end of function, so it will return an empty string when nothing was read (due to ie. failure of fopen()).

(issue imported from #M581)


Files

0000581-t3lib_div.diff (476 Bytes) 0000581-t3lib_div.diff Administrator Admin, 2004-12-13 11:05
Actions #1

Updated by Wolfgang Klinger almost 20 years ago

I've provided a patch ---> see attached file

Actions #2

Updated by old_zas almost 20 years ago

This patch applies cleanly and is working, thanks.

Actions #3

Updated by Martin Kutschker almost 20 years ago

While we're at it, how about an enhancement? This might be faster for PHP 4.4 and above:

elseif (function_exists('file_get_contents') {
return file_get_contents($url);
}

Actions #4

Updated by Michael Stucki almost 19 years ago

Seems this is fixed already.

Actions

Also available in: Atom PDF