From d920c050b412101aab3a25ea1dd9cf6efe4d8e36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Mon, 28 Jan 2013 19:01:54 +0100 Subject: [PATCH] // Tools::file_get_contents load with file_get_content for local paths --- classes/Tools.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/classes/Tools.php b/classes/Tools.php index 9dd4f367d..e2217c6e5 100644 --- a/classes/Tools.php +++ b/classes/Tools.php @@ -1277,10 +1277,9 @@ class ToolsCore public static function file_get_contents($url, $use_include_path = false, $stream_context = null, $curl_timeout = 5) { - if ($stream_context == null) + if ($stream_context == null && !strstr($url, 'http')) $stream_context = @stream_context_create(array('http' => array('timeout' => 5))); - - if (in_array(ini_get('allow_url_fopen'), array('On', 'on', '1'))) + if (in_array(ini_get('allow_url_fopen'), array('On', 'on', '1')) || !strstr($url, 'http')) return @file_get_contents($url, $use_include_path, $stream_context); elseif (function_exists('curl_init')) {