From cc5ba36a061215e0d96f32b67e9f1391e699ac63 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 10 Mar 2013 22:18:37 +0100 Subject: [PATCH] [ticket/9657] Cast IDs to integer PHPBB3-9657 --- phpBB/includes/content_visibility.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/content_visibility.php b/phpBB/includes/content_visibility.php index 6ca1f8b25c..ac827bd822 100644 --- a/phpBB/includes/content_visibility.php +++ b/phpBB/includes/content_visibility.php @@ -244,13 +244,13 @@ class phpbb_content_visibility if ($row['post_visibility'] != $visibility) { - if ($row['post_postcount'] && !isset($poster_postcounts[$row['poster_id']])) + if ($row['post_postcount'] && !isset($poster_postcounts[(int) $row['poster_id']])) { - $poster_postcounts[$row['poster_id']] = 1; + $poster_postcounts[(int) $row['poster_id']] = 1; } else if ($row['post_postcount']) { - $poster_postcounts[$row['poster_id']]++; + $poster_postcounts[(int) $row['poster_id']]++; } if (!isset($postcount_visibility[$row['post_visibility']])) @@ -411,12 +411,12 @@ class phpbb_content_visibility // Update the number for replies and posts $sql = 'UPDATE ' . TOPICS_TABLE . ' SET ' . implode(', ', $topic_sql) . ' - WHERE topic_id = ' . $topic_id; + WHERE topic_id = ' . (int) $topic_id; $db->sql_query($sql); $sql = 'UPDATE ' . FORUMS_TABLE . ' SET ' . implode(', ', $forum_sql) . ' - WHERE forum_id = ' . $forum_id; + WHERE forum_id = ' . (int) $forum_id; $db->sql_query($sql); } }