diff options
author | Tristan Darricau <github@nicofuma.fr> | 2014-05-09 00:46:56 +0200 |
---|---|---|
committer | Tristan Darricau <github@nicofuma.fr> | 2014-05-09 00:46:56 +0200 |
commit | 712491697e79e5af80df6ad8a563ea3a1601a1a4 (patch) | |
tree | 553fe2b794ab5358e6491be280249ec7859e672b /phpBB/phpbb/content_visibility.php | |
parent | a80ad5d00f66d5195cdfe1c953079b54d27063dc (diff) | |
download | forums-712491697e79e5af80df6ad8a563ea3a1601a1a4.tar forums-712491697e79e5af80df6ad8a563ea3a1601a1a4.tar.gz forums-712491697e79e5af80df6ad8a563ea3a1601a1a4.tar.bz2 forums-712491697e79e5af80df6ad8a563ea3a1601a1a4.tar.xz forums-712491697e79e5af80df6ad8a563ea3a1601a1a4.zip |
[ticket/12174] Update the conditions
PHPBB3-12174
Diffstat (limited to 'phpBB/phpbb/content_visibility.php')
-rw-r--r-- | phpBB/phpbb/content_visibility.php | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/phpBB/phpbb/content_visibility.php b/phpBB/phpbb/content_visibility.php index f532d7e61e..c587c2b07b 100644 --- a/phpBB/phpbb/content_visibility.php +++ b/phpBB/phpbb/content_visibility.php @@ -448,22 +448,19 @@ class content_visibility AND ' . $this->db->sql_in_set('post_id', $post_id, true); $result = $this->db->sql_query_limit($sql, 1); - $row = $this->db->sql_fetchrow($result); - if ($row != false) + $has_attachment = (bool) $this->db->sql_fetchfield('has_attachments'); + $this->db->sql_freeresult($result); + + if ($has_attachment && $visibility == ITEM_APPROVED) { - if ($visibility == ITEM_APPROVED) - { - $update_topic_attachments_flag = true; - $topic_update_array[] = 'topic_attachment = 1'; - } + $update_topic_attachments_flag = true; + $topic_update_array[] = 'topic_attachment = 1'; } - else + else if (!$has_attachment) { $update_topic_attachments_flag = true; $topic_update_array[] = 'topic_attachment = 0'; } - - $this->db->sql_freeresult($result); } if ($update_topic_postcount || $update_topic_attachments_flag) |