Browse Source

do not use advanced_file_get_contents

as it should not exist in the first place

Signed-off-by: Pierre Mazière <pierre.maziere@gmx.com>
Pierre Mazière 7 years ago
parent
commit
d73bfbab63
1 changed files with 14 additions and 1 deletions
  1. 14 1
      bridges/LWNprevBridge.php

+ 14 - 1
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);