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.
This commit is contained in:
Christian Beer 2015-12-18 11:08:19 +01:00
parent 5ae8474e04
commit 2032288b29
1 changed files with 1 additions and 1 deletions

View File

@ -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);