diff options
author | Craig Andrews <candrews@integralblue.com> | 2009-09-02 16:42:15 -0400 |
---|---|---|
committer | Craig Andrews <candrews@integralblue.com> | 2009-09-02 16:42:15 -0400 |
commit | a535ccdc4eba320ad88dc531329ae63c7f09c258 (patch) | |
tree | a8448dfe0b764818562ca9d04a39f04d4978dead /classes | |
parent | f949c2c9d9afa63496f26b33d0309f8d06f77520 (diff) | |
parent | 0c95734a6874608ea5ed44608cabeda7c3a1b4ea (diff) |
Merge remote branch 'laconica/0.8.x' into 0.9.x
Conflicts:
lib/common.php
lib/twitter.php
Diffstat (limited to 'classes')
-rw-r--r-- | classes/File.php | 10 | ||||
-rw-r--r-- | classes/Notice.php | 13 | ||||
-rw-r--r-- | classes/Status_network.php | 2 |
3 files changed, 8 insertions, 17 deletions
diff --git a/classes/File.php b/classes/File.php index dc668ab23..9758cf7f5 100644 --- a/classes/File.php +++ b/classes/File.php @@ -78,14 +78,14 @@ class File extends Memcached_DataObject $file_id = $x->insert(); if (isset($redir_data['type']) - && ('text/html' === substr($redir_data['type'], 0, 9)) + && (('text/html' === substr($redir_data['type'], 0, 9) || 'application/xhtml+xml' === substr($redir_data['type'], 0, 21))) && ($oembed_data = File_oembed::_getOembed($given_url))) { File_oembed::saveNew($oembed_data, $file_id); } return $x; } - function processNew($given_url, $notice_id) { + function processNew($given_url, $notice_id=null) { if (empty($given_url)) return -1; // error, no url to process $given_url = File_redirection::_canonUrl($given_url); if (empty($given_url)) return -1; // error, no url to process @@ -96,7 +96,7 @@ class File extends Memcached_DataObject $redir_data = File_redirection::where($given_url); $redir_url = $redir_data['url']; // TODO: max field length - if ($redir_url === $given_url || strlen($redir_url) > 255) { + if ($redir_url === $given_url || strlen($redir_url) > 255) { $x = File::saveNew($redir_data, $given_url); $file_id = $x->id; } else { @@ -119,7 +119,9 @@ class File extends Memcached_DataObject } } - File_to_post::processNew($file_id, $notice_id); + if (!empty($notice_id)) { + File_to_post::processNew($file_id, $notice_id); + } return $x; } diff --git a/classes/Notice.php b/classes/Notice.php index c3c8d13c8..2138e0561 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -56,7 +56,7 @@ class Notice extends Memcached_DataObject /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE - /* Notice types */ + /* Notice types */ const LOCAL_PUBLIC = 1; const REMOTE_OMB = 0; const LOCAL_NONPUBLIC = -1; @@ -260,17 +260,6 @@ class Notice extends Memcached_DataObject $notice->saveUrls(); - // FIXME: why do we have to re-render the content? - // Remove this if it's not necessary. - - $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'); Event::handle('EndNoticeSave', array($notice)); diff --git a/classes/Status_network.php b/classes/Status_network.php index d526cb4d6..fe4f0b0c5 100644 --- a/classes/Status_network.php +++ b/classes/Status_network.php @@ -54,7 +54,7 @@ class Status_network extends DB_DataObject global $config; $config['db']['database_'.$dbname] = "mysqli://$dbuser:$dbpass@$dbhost/$dbname"; - $config['db']['ini_'.$dbname] = INSTALLDIR.'/classes/statusnet.ini'; + $config['db']['ini_'.$dbname] = INSTALLDIR.'/classes/status_network.ini'; $config['db']['table_status_network'] = $dbname; self::$cache = new Memcache(); |