This commit is contained in:
2020-08-09 17:37:16 +02:00
parent 644dbd9ea2
commit 2c054b9b79
4 changed files with 9 additions and 9 deletions

View File

@@ -66,17 +66,17 @@ class BookmarkController extends Controller
$promise = $client->requestAsync('GET', $url);
$response = $promise->wait();
$page = $response->getBody()->getContents();
preg_match("/\<title\>(.*)\<\/title\>/i",$page,$title);
preg_match("/\<title\>(.*)\<\/title\>/i", $page, $title);
$metas['title'] = $title[1];
preg_match('/\<link rel="[icon|appel-touch](.*)\"\>/i',$page,$favicon);
if(isset($favicon[1])) {
preg_match('/href="(.*)/i',$favicon[1],$favicon);
preg_match('/\<link rel="[icon|appel-touch](.*)\"\>/i', $page, $favicon);
if (isset($favicon[1])) {
preg_match('/href="(.*)/i', $favicon[1], $favicon);
$metas['favicon'] = $favicon[1];
preg_match('/http/', $metas['favicon'], $matches);
if(empty($matches)) {
if (empty($matches)) {
$metas['favicon'] = parse_url($url, PHP_URL_SCHEME).'://'.parse_url($url, PHP_URL_HOST).$metas['favicon'];
}
//dd($metas['favicon'], $matches, !isset($matches[1]), empty($matches));