aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorSébastien SAUVAGE <sebsauvage@sebsauvage.net>2013-09-24 02:01:13 -0700
committerSébastien SAUVAGE <sebsauvage@sebsauvage.net>2013-09-24 02:01:13 -0700
commit5d48d5d06e5d38933c3415890d692d4b23febe06 (patch)
tree2bf1b70ad62dba912af832983ab38c8c04bdfe2b
parent002ef0e5c8ed2bab38e205a5d54617780f25c3a9 (diff)
parent03545ef69170ab4aeebd77be41c9edbd28324cd5 (diff)
downloadShaarli-5d48d5d06e5d38933c3415890d692d4b23febe06.tar.gz
Shaarli-5d48d5d06e5d38933c3415890d692d4b23febe06.tar.zst
Shaarli-5d48d5d06e5d38933c3415890d692d4b23febe06.zip
Merge pull request #122 from lehollandaisvolant/master
Ajout d’un UA lors de la récupération d’une page externe
-rw-r--r--index.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/index.php b/index.php
index d88f471c..2154c063 100644
--- a/index.php
+++ b/index.php
@@ -566,7 +566,7 @@ function getHTTP($url,$timeout=30)
566{ 566{
567 try 567 try
568 { 568 {
569 $options = array('http'=>array('method'=>'GET','timeout' => $timeout)); // Force network timeout 569 $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
570 $context = stream_context_create($options); 570 $context = stream_context_create($options);
571 $data=file_get_contents($url,false,$context,-1, 4000000); // We download at most 4 Mb from source. 571 $data=file_get_contents($url,false,$context,-1, 4000000); // We download at most 4 Mb from source.
572 if (!$data) { return array('HTTP Error',array(),''); } 572 if (!$data) { return array('HTTP Error',array(),''); }
@@ -2440,4 +2440,4 @@ if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'do=d
2440if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'ws=')) { processWS(); exit; } // Webservices (for jQuery/jQueryUI) 2440if (isset($_SERVER["QUERY_STRING"]) && startswith($_SERVER["QUERY_STRING"],'ws=')) { processWS(); exit; } // Webservices (for jQuery/jQueryUI)
2441if (!isset($_SESSION['LINKS_PER_PAGE'])) $_SESSION['LINKS_PER_PAGE']=$GLOBALS['config']['LINKS_PER_PAGE']; 2441if (!isset($_SESSION['LINKS_PER_PAGE'])) $_SESSION['LINKS_PER_PAGE']=$GLOBALS['config']['LINKS_PER_PAGE'];
2442renderPage(); 2442renderPage();
2443?> \ No newline at end of file 2443?>