[BUGFIX] PHP warning when a language pack does not exist
authorXavier Perseguers <xavier@typo3.org>
Wed, 9 May 2012 07:48:05 +0000 (09:48 +0200)
committerOliver Hader <oliver.hader@typo3.org>
Mon, 21 May 2012 07:47:40 +0000 (09:47 +0200)
If PHP warnings are not catched, file_get_contents issues a warning
message whenever a file cannot be retrieved.

Change-Id: Icdf7c767e9672a6ff632a1f98542e2f97c0dcbc7
Fixes: #36976
Releases: 4.5, 4.6, 4.7, 6.0
Reviewed-on: http://review.typo3.org/11356
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
t3lib/class.t3lib_div.php

index fffafa2..9887e5a 100644 (file)
@@ -3150,10 +3150,10 @@ final class t3lib_div {
                        )
                        );
 
-                       $content = file_get_contents($url, FALSE, $ctx);
+                       $content = @file_get_contents($url, FALSE, $ctx);
 
                        if ($content === FALSE && isset($report)) {
-                               $report['error']   = -1;
+                               $report['error'] = -1;
                                $report['message'] = 'Couldn\'t get URL: ' . implode(LF, $http_response_header);
                        }
                } else {
@@ -3164,7 +3164,7 @@ final class t3lib_div {
                        $content = @file_get_contents($url);
 
                        if ($content === FALSE && isset($report)) {
-                               $report['error']   = -1;
+                               $report['error'] = -1;
                                $report['message'] = 'Couldn\'t get URL: ' . implode(LF, $http_response_header);
                        }
                }