From d73bfbab63de63d00001519045b2725d10c76f49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pierre=20Mazi=C3=A8re?= Date: Sun, 26 Jun 2016 11:18:23 +0200 Subject: [PATCH] do not use advanced_file_get_contents MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit as it should not exist in the first place Signed-off-by: Pierre Mazière --- bridges/LWNprevBridge.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/bridges/LWNprevBridge.php b/bridges/LWNprevBridge.php index 224a01b..9772799 100644 --- a/bridges/LWNprevBridge.php +++ b/bridges/LWNprevBridge.php @@ -39,7 +39,20 @@ class LWNprevBridge extends BridgeAbstract{ public function collectData(array $param){ // Because the LWN page is written in loose HTML and not XHTML, // Simple HTML Dom is not accurate enough for the job - $html = advanced_file_get_contents('https://lwn.net/free/bigpage') + + $uri='https://lwn.net/free/bigpage'; + $context=null; + if(defined('PROXY_URL')) { + $context = array( + 'http' => array( + 'proxy' => PROXY_URL, + 'request_fulluri' => true, + ), + ); + $context = stream_context_create($context); + } + + $html=file_get_contents($uri, false, $context) or $this->returnError('No results for LWNprev', 404); libxml_use_internal_errors(true);