]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
[add] user_agent in file_get_contents 387/head
authorNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Tue, 7 Jan 2014 12:15:43 +0000 (13:15 +0100)
committerNicolas Lœuillet <nicolas.loeuillet@gmail.com>
Tue, 7 Jan 2014 12:15:43 +0000 (13:15 +0100)
inc/poche/Poche.class.php

index e9ff7b46ca0b59426e2fd29e9295cdc80d8d3262..76a73be2b88e188500c3ad7affd11468e2a7dead 100644 (file)
@@ -333,7 +333,9 @@ class Poche
         switch ($action)
         {
             case 'add':
-                $json = file_get_contents(Tools::getPocheUrl() . '/inc/3rdparty/makefulltextfeed.php?url='.urlencode($url->getUrl()).'&max=5&links=preserve&exc=&format=json&submit=Create+Feed');
+                $options = array('http' => array('user_agent' => 'poche'));
+                $context = stream_context_create($options);
+                $json = file_get_contents(Tools::getPocheUrl() . '/inc/3rdparty/makefulltextfeed.php?url='.urlencode($url->getUrl()).'&max=5&links=preserve&exc=&format=json&submit=Create+Feed', false, $context);
                 $content = json_decode($json, true);
                 $title = $content['rss']['channel']['item']['title'];
                 $body = $content['rss']['channel']['item']['description'];