]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Now correctly identifiying notices with uploaded content.
authorRobin Millette <millette@controlyourself.ca>
Wed, 10 Jun 2009 19:24:25 +0000 (15:24 -0400)
committerRobin Millette <millette@controlyourself.ca>
Wed, 10 Jun 2009 19:24:25 +0000 (15:24 -0400)
classes/Notice.php

index e4dade7806b033c68d4b5ead4957ff85e9f3ffaa..eb51bbd8f1d173a14a20e397eda17497b4b11fba 100644 (file)
@@ -274,7 +274,11 @@ class Notice extends Memcached_DataObject
         $query = 'select file.url as up, file.id as i from file join file_to_post on file.id = file_id where post_id=' . $post->escape($post->id) . ' and url like "%/notice/%/file"';
         $post->query($query);
         $post->fetch();
-        $ret = array($post->up, $post->i);
+        if (empty($post->up) || empty($post->i)) {
+            $ret = false;
+        } else {
+            $ret = array($post->up, $post->i);
+        }
         $post->free();
         return $ret;
     }