From 2032288b291a081b69d37ef3fa1fe7d2973e330a Mon Sep 17 00:00:00 2001 From: Christian Beer Date: Fri, 18 Dec 2015 11:08:19 +0100 Subject: [PATCH] Web: fix get_other_projects() RPC There can be intermittent "simplexml_load_file(): I/O warning : failed to load external entity" errors when using simplexml_load_file(). According to http://stackoverflow.com/questions/20534866 the solution is to use file_get_contents() first. This seems to work in our case too. --- html/inc/user.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/html/inc/user.inc b/html/inc/user.inc index 211908d60c..3a3127e021 100644 --- a/html/inc/user.inc +++ b/html/inc/user.inc @@ -46,7 +46,7 @@ function get_other_projects($user) { if (ini_get('allow_url_fopen')) { $timeout = 3; $old_timeout = ini_set('default_socket_timeout', $timeout); - $xml_object = simplexml_load_file($url); + $xml_object = simplexml_load_string(file_get_contents($url)); ini_set('default_socket_timeout', $old_timeout); } else { $ch = curl_init($url);