X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FFile_oembed.php;h=b7bf3a5dae51d5db18ba259fd6f0a812c60e6faa;hb=39f8d2c72830d7bc3c08f60d1df38d19c846a74b;hp=bcb2f7bacc432fde7548d25450338749645b92b4;hpb=2c4313467f07cae059798ac500ec2a1c31953877;p=quix0rs-gnu-social.git diff --git a/classes/File_oembed.php b/classes/File_oembed.php index bcb2f7bacc..b7bf3a5dae 100644 --- a/classes/File_oembed.php +++ b/classes/File_oembed.php @@ -59,25 +59,15 @@ class File_oembed extends Memcached_DataObject } function _getOembed($url) { - require_once INSTALLDIR.'/extlib/Services/oEmbed.php'; $parameters = array( 'maxwidth' => common_config('attachments', 'thumb_width'), 'maxheight' => common_config('attachments', 'thumb_height'), ); - try{ - $oEmbed = new Services_oEmbed($url); - $object = $oEmbed->getObject($parameters); - return $object; - }catch(Exception $e){ - try{ - $oEmbed = new Services_oEmbed($url, array( - Services_oEmbed::OPTION_API => common_config('oohembed', 'endpoint') - )); - $object = $oEmbed->getObject($parameters); - return $object; - }catch(Exception $ex){ - return false; - } + try { + return oEmbedHelper::getObject($url, $parameters); + } catch (Exception $e) { + common_log(LOG_ERR, "Error during oembed lookup for $url - " . $e->getMessage()); + return false; } }