]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Oembed/OembedPlugin.php
Accessibility fix, make yes button more explicit
[quix0rs-gnu-social.git] / plugins / Oembed / OembedPlugin.php
index c5343c7b4f7f7a5a85ef3cc8ea4ce34bd7984167..c014b65cfb28148be4535502170a4cb7f673b7f7 100644 (file)
@@ -8,9 +8,10 @@ class OembedPlugin extends Plugin
     // WARNING, these are _regexps_ (slashes added later). Always escape your dots and end your strings
     public $domain_whitelist = array(       // hostname => service provider
                                     '^i\d*\.ytimg\.com$' => 'YouTube',
+                                    '^i\d*\.vimeocdn\.com$' => 'Vimeo',
                                     );
     public $append_whitelist = array(); // fill this array as domain_whitelist to add more trusted sources
-    public $check_whitelist  = true;    // security/abuse precaution
+    public $check_whitelist  = false;    // security/abuse precaution
 
     protected $imgData = array();
 
@@ -181,7 +182,7 @@ class OembedPlugin extends Plugin
         case 'video':
         case 'link':
             if (!empty($oembed->html)
-                    && (StatusNet::isAjax() || common_config('attachments', 'show_html'))) {
+                    && (GNUsocial::isAjax() || common_config('attachments', 'show_html'))) {
                 require_once INSTALLDIR.'/extlib/htmLawed/htmLawed.php';
                 $config = array(
                     'safe'=>1,
@@ -288,10 +289,8 @@ class OembedPlugin extends Plugin
         $thumbnail->filename = $filename;
         $thumbnail->width = $info[0];    // array indexes documented on php.net:
         $thumbnail->height = $info[1];   // https://php.net/manual/en/function.getimagesize.php
-        if (!$thumbnail->update($orig)) {
-            unlink($fullpath);  // delete the file if database failed to write
-            throw new ServerException(_('Failed to update remotely downloaded file info in database.'));
-        }
+        // Throws exception on failure.
+        $thumbnail->updateWithKeys($orig, 'file_id');
     }
 
     public function onPluginVersion(array &$versions)