]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fixed recent attachment bug that required URLs to be posted twice to be taken into...
authorRobin Millette <millette@controlyourself.ca>
Wed, 17 Jun 2009 20:21:50 +0000 (16:21 -0400)
committerRobin Millette <millette@controlyourself.ca>
Wed, 17 Jun 2009 20:21:50 +0000 (16:21 -0400)
classes/File.php
classes/Notice.php

index 24ab11b8eb12d595469c08aa2092dca65d013a6b..08320faf8f11fda1af215b127e890c303b0fb9c8 100644 (file)
@@ -79,7 +79,6 @@ class File extends Memcached_DataObject
             && ('text/html' === substr($redir_data['type'], 0, 9))
             && ($oembed_data = File_oembed::_getOembed($given_url))
             && isset($oembed_data['json'])) {
-
             File_oembed::saveNew($oembed_data['json'], $file_id);
         }
         return $x;
@@ -98,7 +97,6 @@ class File extends Memcached_DataObject
                 if ($redir_url === $given_url) {
                     $x = File::saveNew($redir_data, $given_url);
                     $file_id = $x->id;
-
                 } else {
                     $x = File::processNew($redir_url, $notice_id);
                     $file_id = $x->id;
index 770b5d78b7020ab76a321216a516dd80054796e0..e0bb90ba62f4481d478ac8b9a4d4c864e7565c6d 100644 (file)
@@ -218,6 +218,12 @@ class Notice extends Memcached_DataObject
             $notice->addToInboxes();
             $notice->saveGroups();
             $notice->saveUrls();
+            $orig2 = clone($notice);
+               $notice->rendered = common_render_content($final, $notice);
+            if (!$notice->update($orig2)) {
+                common_log_db_error($notice, 'UPDATE', __FILE__);
+                return _('Problem saving notice.');
+            }
 
             $notice->query('COMMIT');
 
@@ -237,8 +243,6 @@ class Notice extends Memcached_DataObject
      * follow redirects and save all available file information
      * (mimetype, date, size, oembed, etc.)
      *
-     * @param class $notice Notice to pull URLs from
-     *
      * @return void
      */
     function saveUrls() {