diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-06-10 13:52:32 -0700 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-06-10 13:52:32 -0700 |
commit | b4e649fe906a793cd5e62d6390065ea5d41c40db (patch) | |
tree | cad629e106bc038ca63d92cd6c30e6cd3bc5b064 /classes/Notice.php | |
parent | 361a52a9c8042c26e72e85c42aff166bd531c85d (diff) | |
parent | 4699fa7936be41e05a950b357c6b46949ad7c74d (diff) |
Merge branch '0.8.x' of git@gitorious.org:+laconica-developers/laconica/dev into 0.8.x
Diffstat (limited to 'classes/Notice.php')
-rw-r--r-- | classes/Notice.php | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/classes/Notice.php b/classes/Notice.php index 45ea72823..1c4858149 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -276,13 +276,15 @@ class Notice extends Memcached_DataObject function getUploadedAttachment() { $post = clone $this; - $query = 'select file.url as uploaded from file join file_to_post on file.id = file_id where post_id=' . $post->escape($post->id) . ' and url like "%/notice/%/file"'; + $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 = $post->uploaded; -// var_dump($post); + if (empty($post->up) || empty($post->i)) { + $ret = false; + } else { + $ret = array($post->up, $post->i); + } $post->free(); -// die(); return $ret; } |