From cc2d60d59336831750fd50a5fd6191b39cfbbf9b Mon Sep 17 00:00:00 2001 From: Louis Jeckel Date: Thu, 27 Aug 2020 19:32:49 +0200 Subject: [PATCH] Update GetPageTitleFromUrl.php --- app/Invokables/GetPageTitleFromUrl.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/app/Invokables/GetPageTitleFromUrl.php b/app/Invokables/GetPageTitleFromUrl.php index 4b1698d..b6c40ca 100644 --- a/app/Invokables/GetPageTitleFromUrl.php +++ b/app/Invokables/GetPageTitleFromUrl.php @@ -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 preg_match("/<title>(.*)<\/title>/i",$str,$title); // ignore case -- 2.39.5