From fb57aab74d5f884128dc3549240893c442fc191a Mon Sep 17 00:00:00 2001 From: lehollandaisvolant Date: Tue, 3 Sep 2013 15:55:13 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20d=E2=80=99un=20UA=20lors=20de=20la=20r?= =?UTF-8?q?=C3=A9cup=C3=A9ration=20d=E2=80=99une=20page=20externe=20(certa?= =?UTF-8?q?ins=20site=20veulent=20un=20UA)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 11696a2..4b1a04b 100644 --- a/index.php +++ b/index.php @@ -578,7 +578,7 @@ function getHTTP($url,$timeout=30) { try { - $options = array('http'=>array('method'=>'GET','timeout' => $timeout)); // Force network timeout + $options = array('http'=>array('method'=>'GET','timeout' => $timeout, 'user_agent' => 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:23.0) Gecko/20100101 Firefox/23.0')); // Force network timeout $context = stream_context_create($options); $data=file_get_contents($url,false,$context,-1, 4000000); // We download at most 4 Mb from source. if (!$data) { return array('HTTP Error',array(),''); } @@ -2474,4 +2474,4 @@ if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=d if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'ws=')) { processWS(); exit; } // Webservices (for jQuery/jQueryUI) if (!isset($_SESSION['LINKS_PER_PAGE'])) $_SESSION['LINKS_PER_PAGE']=$GLOBALS['config']['LINKS_PER_PAGE']; renderPage(); -?> \ No newline at end of file +?>