mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 06:07:32 +02:00
SSL fix for getRemoteContent().
This commit is contained in:
@@ -581,7 +581,15 @@ class e_file
|
|||||||
if (function_exists('file_get_contents') && ini_get('allow_url_fopen'))
|
if (function_exists('file_get_contents') && ini_get('allow_url_fopen'))
|
||||||
{
|
{
|
||||||
$old_timeout = e107_ini_set('default_socket_timeout', $timeout);
|
$old_timeout = e107_ini_set('default_socket_timeout', $timeout);
|
||||||
$data = file_get_contents($address);
|
|
||||||
|
$context = array(
|
||||||
|
'ssl' => array(
|
||||||
|
'verify_peer' => false,
|
||||||
|
'verify_peer_name' => false,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
$data = file_get_contents($address, false, stream_context_create($context));
|
||||||
|
|
||||||
// $data = file_get_contents(htmlspecialchars($address)); // buggy - sometimes fails.
|
// $data = file_get_contents(htmlspecialchars($address)); // buggy - sometimes fails.
|
||||||
if ($old_timeout !== FALSE)
|
if ($old_timeout !== FALSE)
|
||||||
|
Reference in New Issue
Block a user