From b762cce94dd3a75ccae9675cb85c8b119072857b Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Fri, 6 Dec 2013 10:31:22 +0100 Subject: [PATCH] custom user-agent also for simplexml_load_file-method of reading news-feed Signed-off-by: Michael Kaufmann (d00p) --- lib/ajax.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ajax.php b/lib/ajax.php index 39c962e0..eaa6597c 100644 --- a/lib/ajax.php +++ b/lib/ajax.php @@ -31,9 +31,10 @@ if ($action == "newsfeed") { die(); } + // get version + require './tables.inc.php'; + if (function_exists('curl_version')) { - // get version - require './tables.inc.php'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $feed); curl_setopt($ch, CURLOPT_USERAGENT, 'Froxlor/'.$version); @@ -43,6 +44,7 @@ if ($action == "newsfeed") { $news = simplexml_load_string(trim($output)); } else { if (ini_get('allow_url_fopen')) { + ini_set('user_agent', 'Froxlor/'.$version); $news = simplexml_load_file($feed, null, LIBXML_NOCDATA); } else { $news = false;