]> _ Git - psq.git/commitdiff
Update GetPageTitleFromUrl.php
authorLouis Jeckel <louis.jeckel@outlook.cm>
Thu, 27 Aug 2020 17:32:49 +0000 (19:32 +0200)
committerLouis Jeckel <louis.jeckel@outlook.cm>
Thu, 27 Aug 2020 17:32:49 +0000 (19:32 +0200)
app/Invokables/GetPageTitleFromUrl.php

index 4b1698d3afc72a712dcac601224f52d10955aef0..b6c40ca13f7ed817eae1997b3c21173ea72de7ff 100644 (file)
@@ -32,17 +32,6 @@ class GetPageTitleFromUrl
         curl_close($ch);
 
 
-        $context = stream_context_create(
-            [
-                "http" => [
-//                    "header" => implode("\r\n", $headers),
-                    "header" => "User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36",
-
-                ]
-            ]
-        );
-
-//        $str = file_get_contents($url, false, $context);
         if($str !== ''){
             $str = trim(preg_replace('/\s+/', ' ', $str)); // supports line breaks inside <title>
             preg_match("/<title>(.*)<\/title>/i",$str,$title); // ignore case