summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-01-10 13:18:53 -0800
committerEvan Prodromou <evan@status.net>2010-01-10 13:18:53 -0800
commitf463329b9a5575856757ae8879e4cc11400d50a2 (patch)
tree6ace44bdf60023bd6f813a0517c691ccb41b385b /classes
parent9d3893255a77ee6c6cf1ab861d0da55ecbadbecc (diff)
check before inserting File_oembed and File_thumbnail
Diffstat (limited to 'classes')
-rw-r--r--classes/File.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/classes/File.php b/classes/File.php
index e04a9d525..03d9ca6f0 100644
--- a/classes/File.php
+++ b/classes/File.php
@@ -80,7 +80,14 @@ class File extends Memcached_DataObject
if (isset($redir_data['type'])
&& (('text/html' === substr($redir_data['type'], 0, 9) || 'application/xhtml+xml' === substr($redir_data['type'], 0, 21)))
&& ($oembed_data = File_oembed::_getOembed($given_url))) {
+
+ $fo = File_oembed::staticGet('file_id', $file_id);
+
+ if (empty($fo)) {
File_oembed::saveNew($oembed_data, $file_id);
+ } else {
+ common_log(LOG_WARNING, "Strangely, a File_oembed object exists for new file $file_id", __FILE__);
+ }
}
return $x;
}