Integrate fetching of the content type into "getSiteinfo"
This commit is contained in:
parent
262ee2b0b1
commit
ffb92e3355
3 changed files with 13 additions and 11 deletions
|
@ -210,6 +210,12 @@ class ParseUrl
|
|||
return $siteinfo;
|
||||
}
|
||||
|
||||
$type = self::getContentType($url);
|
||||
if (in_array($type, ['image', 'video', 'audio'])) {
|
||||
$siteinfo['type'] = $type;
|
||||
return $siteinfo;
|
||||
}
|
||||
|
||||
$curlResult = DI::httpRequest()->get($url);
|
||||
if (!$curlResult->isSuccess()) {
|
||||
return $siteinfo;
|
||||
|
@ -251,7 +257,7 @@ class ParseUrl
|
|||
$oembed_data = OEmbed::fetchURL($url);
|
||||
|
||||
if (!empty($oembed_data->type)) {
|
||||
if (!in_array($oembed_data->type, ['error', 'rich', ''])) {
|
||||
if (!in_array($oembed_data->type, ['error', 'rich', 'image', 'video', 'audio', ''])) {
|
||||
$siteinfo['type'] = $oembed_data->type;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue