diff options
-rw-r--r-- | phpBB/includes/acp/acp_language.php | 12 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_main.php | 4 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_styles.php | 18 | ||||
-rw-r--r-- | phpBB/includes/acp/auth.php | 6 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 14 | ||||
-rw-r--r-- | phpBB/includes/functions_admin.php | 16 | ||||
-rw-r--r-- | phpBB/includes/functions_convert.php | 6 | ||||
-rw-r--r-- | phpBB/includes/functions_user.php | 22 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_forum.php | 2 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_main.php | 6 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_topic.php | 4 | ||||
-rwxr-xr-x | phpBB/includes/search/fulltext_native.php | 8 | ||||
-rw-r--r-- | phpBB/includes/session.php | 12 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_zebra.php | 2 | ||||
-rw-r--r-- | phpBB/install/convertors/functions_phpbb20.php | 22 | ||||
-rwxr-xr-x | phpBB/install/install_install.php | 20 | ||||
-rw-r--r-- | phpBB/posting.php | 12 | ||||
-rw-r--r-- | phpBB/styles/prosilver/template/viewforum_body.html | 2 |
18 files changed, 94 insertions, 94 deletions
diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php index 266729765d..ff827c5141 100644 --- a/phpBB/includes/acp/acp_language.php +++ b/phpBB/includes/acp/acp_language.php @@ -800,12 +800,12 @@ class acp_language if (in_array($image_name, $valid_localized)) { $sql_ary[] = array( - 'image_name' => $image_name, - 'image_filename' => $image_filename, - 'image_height' => $image_height, - 'image_width' => $image_width, - 'imageset_id' => $imageset_row['imageset_id'], - 'image_lang' => $lang_pack['iso'], + 'image_name' => (string) $image_name, + 'image_filename' => (string) $image_filename, + 'image_height' => (int) $image_height, + 'image_width' => (int) $image_width, + 'imageset_id' => (int) $imageset_row['imageset_id'], + 'image_lang' => (string) $lang_pack['iso'], ); } } diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 5f1e32fb51..84ea8cdfbd 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -251,8 +251,8 @@ class acp_main foreach ($topic_row as $topic_id) { $sql_ary[] = array( - 'user_id' => $user_id, - 'topic_id' => $topic_id, + 'user_id' => (int) $user_id, + 'topic_id' => (int) $topic_id, 'topic_posted' => 1, ); } diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 74659fe792..00c5e9adc7 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -412,11 +412,11 @@ parse_css_file = {PARSE_CSS_FILE} if (in_array($image_name, $imageset_definitions)) { $sql_ary[] = array( - 'image_name' => $image_name, - 'image_filename' => $image_filename, + 'image_name' => (string) $image_name, + 'image_filename' => (string) $image_filename, 'image_height' => (int) $image_height, 'image_width' => (int) $image_width, - 'imageset_id' => $style_id, + 'imageset_id' => (int) $style_id, 'image_lang' => '', ); } @@ -458,12 +458,12 @@ parse_css_file = {PARSE_CSS_FILE} if (in_array($image_name, $imageset_definitions)) { $sql_ary[] = array( - 'image_name' => $image_name, - 'image_filename' => $image_filename, - 'image_height' => $image_height, - 'image_width' => $image_width, - 'imageset_id' => $style_id, - 'image_lang' => $row['lang_dir'], + 'image_name' => (string) $image_name, + 'image_filename' => (string) $image_filename, + 'image_height' => (int) $image_height, + 'image_width' => (int) $image_width, + 'imageset_id' => (int) $style_id, + 'image_lang' => (string) $row['lang_dir'], ); } } diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index b5ae092954..e3514833b5 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -765,7 +765,7 @@ class auth_admin extends auth foreach ($option_ary as $option) { $sql_ary[] = array( - 'auth_option' => $option, + 'auth_option' => (string) $option, 'is_global' => ($type == 'global' || $type == 'local_global') ? 1 : 0, 'is_local' => ($type == 'local' || $type == 'local_global') ? 1 : 0 ); @@ -879,7 +879,7 @@ class auth_admin extends auth 'forum_id' => (int) $forum, 'auth_option_id' => 0, 'auth_setting' => 0, - 'auth_role_id' => $role_id + 'auth_role_id' => (int) $role_id, ); } } @@ -960,7 +960,7 @@ class auth_admin extends auth { $sql_ary[] = array( 'role_id' => (int) $role_id, - 'auth_option_id' => $this->option_ids[$flag], + 'auth_option_id' => (int) $this->option_ids[$flag], 'auth_setting' => ACL_NEVER ); } diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 9a97bd7ece..daff12e3a8 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -848,8 +848,8 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ foreach ($sql_insert as $f_id) { $sql_ary[] = array( - 'user_id' => $user->data['user_id'], - 'forum_id' => $f_id, + 'user_id' => (int) $user->data['user_id'], + 'forum_id' => (int) $f_id, 'mark_time' => time() ); } @@ -918,10 +918,10 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ $db->sql_return_on_error(true); $sql_ary = array( - 'user_id' => $user->data['user_id'], - 'topic_id' => $topic_id, + 'user_id' => (int) $user->data['user_id'], + 'topic_id' => (int) $topic_id, 'forum_id' => (int) $forum_id, - 'mark_time' => ($post_time) ? $post_time : time(), + 'mark_time' => ($post_time) ? (int) $post_time : time(), ); $db->sql_query('INSERT INTO ' . TOPICS_TRACK_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); @@ -1005,8 +1005,8 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ $db->sql_return_on_error(true); $sql_ary = array( - 'user_id' => $use_user_id, - 'topic_id' => $topic_id, + 'user_id' => (int) $use_user_id, + 'topic_id' => (int) $topic_id, 'topic_posted' => 1 ); diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 64358cbdf4..7074f21f25 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -1079,8 +1079,8 @@ function update_posted_info(&$topic_ids) foreach ($topic_row as $topic_id) { $sql_ary[] = array( - 'user_id' => $user_id, - 'topic_id' => $topic_id, + 'user_id' => (int) $user_id, + 'topic_id' => (int) $topic_id, 'topic_posted' => 1, ); } @@ -2244,9 +2244,9 @@ function cache_moderators() foreach ($forum_id_ary as $forum_id => $auth_ary) { $sql_ary[] = array( - 'forum_id' => $forum_id, - 'user_id' => $user_id, - 'username' => $usernames_ary[$user_id], + 'forum_id' => (int) $forum_id, + 'user_id' => (int) $user_id, + 'username' => (string) $usernames_ary[$user_id], 'group_id' => 0, 'group_name' => '' ); @@ -2307,11 +2307,11 @@ function cache_moderators() } $sql_ary[] = array( - 'forum_id' => $forum_id, + 'forum_id' => (int) $forum_id, 'user_id' => 0, 'username' => '', - 'group_id' => $group_id, - 'group_name' => $groupnames_ary[$group_id] + 'group_id' => (int) $group_id, + 'group_name' => (string) $groupnames_ary[$group_id] ); } } diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index 98d15abb84..159ec387bd 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -1707,9 +1707,9 @@ function add_default_groups() 'group_desc_uid' => '', 'group_desc_bitfield' => '', 'group_type' => GROUP_SPECIAL, - 'group_colour' => $data[0], - 'group_legend' => $data[1], - 'group_founder_manage' => $data[2] + 'group_colour' => (string) $data[0], + 'group_legend' => (int) $data[1], + 'group_founder_manage' => (int) $data[2] ); } diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 2ebcc30e81..0194ec06a4 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -766,7 +766,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas { do { - $banlist_ary[] = $row['user_id']; + $banlist_ary[] = (int) $row['user_id']; } while ($row = $db->sql_fetchrow($result)); } @@ -849,7 +849,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas else if (preg_match('#^\*$#', trim($ban_item))) { // Ban all IPs - $banlist_ary[] = "*"; + $banlist_ary[] = '*'; } else if (preg_match('#^([\w\-_]\.?){2,}$#is', trim($ban_item))) { @@ -959,11 +959,11 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas { $sql_ary[] = array( $type => $ban_entry, - 'ban_start' => $current_time, - 'ban_end' => $ban_end, - 'ban_exclude' => $ban_exclude, - 'ban_reason' => $ban_reason, - 'ban_give_reason' => $ban_give_reason, + 'ban_start' => (int) $current_time, + 'ban_end' => (int) $ban_end, + 'ban_exclude' => (int) $ban_exclude, + 'ban_reason' => (string) $ban_reason, + 'ban_give_reason' => (string) $ban_give_reason, ); } @@ -2574,10 +2574,10 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false, foreach ($add_id_ary as $user_id) { $sql_ary[] = array( - 'user_id' => $user_id, - 'group_id' => $group_id, - 'group_leader' => $leader, - 'user_pending' => $pending, + 'user_id' => (int) $user_id, + 'group_id' => (int) $group_id, + 'group_leader' => (int) $leader, + 'user_pending' => (int) $pending, ); } diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index 4059e77d39..d4c6f1f395 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -396,7 +396,7 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id) // If the topic no longer exist, we will update the topic watch table. // To not let it error out on users watching both topics, we just return on an error... $db->sql_return_on_error(true); - $db->sql_query('UPDATE ' . TOPICS_WATCH_TABLE . ' SET topic_id = ' . $to_topic_id . ' WHERE ' . $db->sql_in_set('topic_id', $topic_ids)); + $db->sql_query('UPDATE ' . TOPICS_WATCH_TABLE . ' SET topic_id = ' . (int) $to_topic_id . ' WHERE ' . $db->sql_in_set('topic_id', $topic_ids)); $db->sql_return_on_error(false); $db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . ' WHERE ' . $db->sql_in_set('topic_id', $topic_ids)); diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index a8f6985089..199a54032a 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -1132,9 +1132,9 @@ function mcp_fork_topic($topic_ids) while ($row = $db->sql_fetchrow($result)) { $sql_ary[] = array( - 'topic_id' => $new_topic_id, - 'user_id' => $row['user_id'], - 'notify_status' => $row['notify_status'], + 'topic_id' => (int) $new_topic_id, + 'user_id' => (int) $row['user_id'], + 'notify_status' => (int) $row['notify_status'], ); } $db->sql_freeresult($result); diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index aefea01e4b..a5bfba23fe 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -572,10 +572,10 @@ function merge_posts($topic_id, $to_topic_id) // If the topic no longer exist, we will update the topic watch table. // To not let it error out on users watching both topics, we just return on an error... $db->sql_return_on_error(true); - $db->sql_query('UPDATE ' . TOPICS_WATCH_TABLE . ' SET topic_id = ' . $to_topic_id . ' WHERE topic_id = ' . $topic_id); + $db->sql_query('UPDATE ' . TOPICS_WATCH_TABLE . ' SET topic_id = ' . (int) $to_topic_id . ' WHERE topic_id = ' . (int) $topic_id); $db->sql_return_on_error(false); - $db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . ' WHERE topic_id = ' . $topic_id); + $db->sql_query('DELETE FROM ' . TOPICS_WATCH_TABLE . ' WHERE topic_id = ' . (int) $topic_id); } // Link to the new topic diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index e99d94bc53..ac3fc14f4f 100755 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -1134,7 +1134,7 @@ class fulltext_native extends search_backend foreach ($new_words as $word) { - $sql_ary[] = array('word_text' => $word, 'word_count' => 0); + $sql_ary[] = array('word_text' => (string) $word, 'word_count' => 0); } $db->sql_return_on_error(true); $db->sql_multi_insert(SEARCH_WORDLIST_TABLE, $sql_ary); @@ -1183,9 +1183,9 @@ class fulltext_native extends search_backend if (sizeof($word_ary)) { - $sql = 'INSERT INTO ' . SEARCH_WORDMATCH_TABLE . " (post_id, word_id, title_match) - SELECT $post_id, word_id, $title_match - FROM " . SEARCH_WORDLIST_TABLE . ' + $sql = 'INSERT INTO ' . SEARCH_WORDMATCH_TABLE . ' (post_id, word_id, title_match) + SELECT ' . (int) $post_id . ', word_id, ' . (int) $title_match . ' + FROM ' . SEARCH_WORDLIST_TABLE . ' WHERE ' . $db->sql_in_set('word_text', $word_ary); $db->sql_query($sql); diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index a100723972..275618f7dc 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -1453,12 +1453,12 @@ class user extends session { $image_name = substr($image_name, 4); $sql_ary[] = array( - 'image_name' => $image_name, - 'image_filename' => $image_filename, - 'image_height' => $image_height, - 'image_width' => $image_width, - 'imageset_id' => $this->theme['imageset_id'], - 'image_lang' => $this->img_lang, + 'image_name' => (string) $image_name, + 'image_filename' => (string) $image_filename, + 'image_height' => (int) $image_height, + 'image_width' => (int) $image_width, + 'imageset_id' => (int) $this->theme['imageset_id'], + 'image_lang' => (string) $this->img_lang, ); } } diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php index 3c9abfe5b4..49ba7329be 100644 --- a/phpBB/includes/ucp/ucp_zebra.php +++ b/phpBB/includes/ucp/ucp_zebra.php @@ -157,7 +157,7 @@ class ucp_zebra foreach ($user_id_ary as $zebra_id) { $sql_ary[] = array( - 'user_id' => $user->data['user_id'], + 'user_id' => (int) $user->data['user_id'], 'zebra_id' => (int) $zebra_id, $sql_mode => 1 ); diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index 7daefabdce..ab1a1ede11 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -97,7 +97,7 @@ function phpbb_insert_forums() while ($row = $src_db->sql_fetchrow($result)) { $sql_ary = array( - 'forum_id' => $max_forum_id, + 'forum_id' => (int) $max_forum_id, 'forum_name' => ($row['cat_title']) ? htmlspecialchars(phpbb_set_default_encoding($row['cat_title']), ENT_COMPAT, 'UTF-8') : $user->lang['CATEGORY'], 'parent_id' => 0, 'forum_parents' => '', @@ -113,8 +113,8 @@ function phpbb_insert_forums() $cat_row = $db->sql_fetchrow($_result); $db->sql_freeresult($_result); - $sql_ary['left_id'] = $cat_row['right_id'] + 1; - $sql_ary['right_id'] = $cat_row['right_id'] + 2; + $sql_ary['left_id'] = (int) ($cat_row['right_id'] + 1); + $sql_ary['right_id'] = (int) ($cat_row['right_id'] + 2); $sql = 'INSERT INTO ' . FORUMS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); $db->sql_query($sql); @@ -148,8 +148,8 @@ function phpbb_insert_forums() $unknown_cat_id = 'ghost'; $sql_ary = array( - 'forum_id' => $max_forum_id, - 'forum_name' => $user->lang['CATEGORY'], + 'forum_id' => (int) $max_forum_id, + 'forum_name' => (string) $user->lang['CATEGORY'], 'parent_id' => 0, 'forum_parents' => '', 'forum_desc' => '', @@ -164,8 +164,8 @@ function phpbb_insert_forums() $cat_row = $db->sql_fetchrow($_result); $db->sql_freeresult($_result); - $sql_ary['left_id'] = $cat_row['right_id'] + 1; - $sql_ary['right_id'] = $cat_row['right_id'] + 2; + $sql_ary['left_id'] = (int) ($cat_row['right_id'] + 1); + $sql_ary['right_id'] = (int) ($cat_row['right_id'] + 2); $sql = 'INSERT INTO ' . FORUMS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); $db->sql_query($sql); @@ -210,7 +210,7 @@ function phpbb_insert_forums() $sql_ary = array( 'forum_id' => (int) $row['forum_id'], 'forum_name' => htmlspecialchars(phpbb_set_default_encoding($row['forum_name']), ENT_COMPAT, 'UTF-8'), - 'parent_id' => $cats_added[$row['cat_id']], + 'parent_id' => (int) $cats_added[$row['cat_id']], 'forum_parents' => '', 'forum_desc' => htmlspecialchars(phpbb_set_default_encoding($row['forum_desc']), ENT_COMPAT, 'UTF-8'), 'forum_type' => FORUM_POST, @@ -269,8 +269,8 @@ function phpbb_insert_forums() WHERE ' . $cat_row['left_id'] . ' BETWEEN left_id AND right_id'; $db->sql_query($sql); - $sql_ary['left_id'] = $cat_row['right_id']; - $sql_ary['right_id'] = $cat_row['right_id'] + 1; + $sql_ary['left_id'] = (int) $cat_row['right_id']; + $sql_ary['right_id'] = (int) ($cat_row['right_id'] + 1); $sql = 'INSERT INTO ' . FORUMS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); $db->sql_query($sql); @@ -1778,7 +1778,7 @@ function phpbb_check_username_collisions() while ($row = $src_db->sql_fetchrow($result)) { $clean_name = utf8_clean_string(phpbb_set_default_encoding($row['username'])); - $insert_ary[] = array('user_id' => $row['user_id'], 'username_clean' => $clean_name); + $insert_ary[] = array('user_id' => (int) $row['user_id'], 'username_clean' => (string) $clean_name); if ($i % 1000 == 999) { diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index f6a8613ae8..4dd7e73db5 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -1738,12 +1738,12 @@ class install_install extends module if (in_array($image_name, $valid_localized)) { $sql_ary[] = array( - 'image_name' => $image_name, - 'image_filename' => $image_filename, - 'image_height' => $image_height, - 'image_width' => $image_width, - 'imageset_id' => $imageset_row['imageset_id'], - 'image_lang' => $lang_pack['lang_iso'], + 'image_name' => (string) $image_name, + 'image_filename' => (string) $image_filename, + 'image_height' => (int) $image_height, + 'image_width' => (int) $image_width, + 'imageset_id' => (int) $imageset_row['imageset_id'], + 'image_lang' => (string) $lang_pack['lang_iso'], ); } } @@ -1835,10 +1835,10 @@ class install_install extends module $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'bot_active' => 1, - 'bot_name' => $bot_name, - 'user_id' => $user_id, - 'bot_agent' => $bot_ary[0], - 'bot_ip' => $bot_ary[1], + 'bot_name' => (string) $bot_name, + 'user_id' => (int) $user_id, + 'bot_agent' => (string) $bot_ary[0], + 'bot_ip' => (string) $bot_ary[1], )); $result = $db->sql_query($sql); diff --git a/phpBB/posting.php b/phpBB/posting.php index c2712009a1..92b44b3f21 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -476,12 +476,12 @@ if ($save && $user->data['is_registered'] && $auth->acl_get('u_savedrafts') && ( if (confirm_box(true)) { $sql = 'INSERT INTO ' . DRAFTS_TABLE . ' ' . $db->sql_build_array('INSERT', array( - 'user_id' => $user->data['user_id'], - 'topic_id' => $topic_id, - 'forum_id' => $forum_id, - 'save_time' => $current_time, - 'draft_subject' => $subject, - 'draft_message' => $message) + 'user_id' => (int) $user->data['user_id'], + 'topic_id' => (int) $topic_id, + 'forum_id' => (int) $forum_id, + 'save_time' => (int) $current_time, + 'draft_subject' => (string) $subject, + 'draft_message' => (string) $message) ); $db->sql_query($sql); diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html index c5b7904fbb..7d03939605 100644 --- a/phpBB/styles/prosilver/template/viewforum_body.html +++ b/phpBB/styles/prosilver/template/viewforum_body.html @@ -181,7 +181,7 @@ <div class="topic-actions"> <!-- IF not S_IS_BOT and S_DISPLAY_POST_INFO --> <div class="buttons"> - <div class="post-icon"><a href="{U_POST_NEW_TOPIC}"><span>{L_POST_REPLY}</span></a></div> + <div class="post-icon"><a href="{U_POST_NEW_TOPIC}"><span>{L_POST_TOPIC}</span></a></div> </div> <!-- ENDIF --> |