Now correctly identifiying notices with uploaded content.

This commit is contained in:
Robin Millette 2009-06-10 15:24:25 -04:00
parent ba6beaa310
commit 4699fa7936

View 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"'; $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->query($query);
$post->fetch(); $post->fetch();
if (empty($post->up) || empty($post->i)) {
$ret = false;
} else {
$ret = array($post->up, $post->i); $ret = array($post->up, $post->i);
}
$post->free(); $post->free();
return $ret; return $ret;
} }