summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/File_oembed.php20
1 files changed, 5 insertions, 15 deletions
diff --git a/classes/File_oembed.php b/classes/File_oembed.php
index bcb2f7bac..b7bf3a5da 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;
}
}