fix psr2
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user