diff --git a/modules/announcements.php b/modules/announcements.php index c543c659..dced178f 100644 --- a/modules/announcements.php +++ b/modules/announcements.php @@ -223,8 +223,8 @@ class announcements extends module_base OR topic_type = ' . POST_ANNOUNCE . ') AND topic_visibility = 1 AND topic_moved_id = 0 - ' . $post_time . ' - ' . $str_where; + ' . $this->db->sql_escape($post_time) . ' + ' . $this->db->sql_escape($str_where); $result = $this->db->sql_query($sql, 30); $total_announcements = (int) $this->db->sql_fetchfield('num_topics'); $this->db->sql_freeresult($result); @@ -317,6 +317,7 @@ class announcements extends module_base 'ATTACH_ICON_IMG' => ($fetch_news[$i]['attachment'] && $this->config['allow_attachments']) ? $this->user->img('icon_topic_attach', $this->user->lang['TOTAL_ATTACHMENTS']) : '', 'FORUM_NAME' => ($forum_id) ? $fetch_news[$i]['forum_name'] : '', 'TITLE' => $fetch_news[$i]['topic_title'], + 'MINI_POST' => $unread_topic ? $this->user->lang['UNREAD_POST'] : $this->user->lang['POST'], 'POSTER' => $fetch_news[$i]['username'], 'POSTER_FULL' => $fetch_news[$i]['username_full'], 'USERNAME_FULL_LAST' => $fetch_news[$i]['username_full_last'], @@ -447,9 +448,9 @@ class announcements extends module_base 'vars' => array( 'legend1' => 'ACP_PORTAL_ANNOUNCE_SETTINGS', 'board3_announcements_style_' . $module_id => array('lang' => 'PORTAL_ANNOUNCEMENTS_STYLE' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), - 'board3_number_of_announcements_' . $module_id => array('lang' => 'PORTAL_NUMBER_OF_ANNOUNCEMENTS' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), - 'board3_announcements_day_' . $module_id => array('lang' => 'PORTAL_ANNOUNCEMENTS_DAY' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), - 'board3_announcements_length_' . $module_id => array('lang' => 'PORTAL_ANNOUNCEMENTS_LENGTH' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), + 'board3_number_of_announcements_' . $module_id => array('lang' => 'PORTAL_NUMBER_OF_ANNOUNCEMENTS' , 'validate' => 'int', 'type' => 'number:0:999', 'explain' => true), + 'board3_announcements_day_' . $module_id => array('lang' => 'PORTAL_ANNOUNCEMENTS_DAY' , 'validate' => 'int', 'type' => 'number:0:999', 'explain' => true), + 'board3_announcements_length_' . $module_id => array('lang' => 'PORTAL_ANNOUNCEMENTS_LENGTH' , 'validate' => 'int', 'type' => 'number:0:999', 'explain' => true), 'board3_global_announcements_forum_' . $module_id => array('lang' => 'PORTAL_GLOBAL_ANNOUNCEMENTS_FORUM' , 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => array('board3.portal.modules_helper', 'generate_forum_select'), 'submit' => array('board3.portal.modules_helper', 'store_selected_forums')), 'board3_announcements_forum_exclude_' . $module_id => array('lang' => 'PORTAL_ANNOUNCEMENTS_FORUM_EXCLUDE', 'validate' => 'string', 'type' => 'radio:yes_no', 'explain' => true), 'board3_announcements_archive_' . $module_id => array('lang' => 'PORTAL_ANNOUNCEMENTS_ARCHIVE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), diff --git a/modules/attachments.php b/modules/attachments.php index c03906d2..225a7173 100644 --- a/modules/attachments.php +++ b/modules/attachments.php @@ -115,18 +115,18 @@ class attachments extends module_base */ public function get_template_acp($module_id) { - return array( + return [ 'title' => 'ACP_PORTAL_ATTACHMENTS_NUMBER_SETTINGS', - 'vars' => array( + 'vars' => [ 'legend1' => 'ACP_PORTAL_ATTACHMENTS_NUMBER_SETTINGS', - 'board3_attachments_number_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_NUMBER' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), - 'board3_attach_max_length_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_MAX_LENGTH' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), - 'board3_attachments_forum_ids_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_FORUM_IDS', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => array('board3.portal.modules_helper', 'generate_forum_select'), 'submit' => array('board3.portal.modules_helper', 'store_selected_forums')), - 'board3_attachments_forum_exclude_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_FORUM_EXCLUDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), - 'board3_attachments_filetype_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_FILETYPE', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => 'select_filetype', 'submit' => 'store_filetypes'), - 'board3_attachments_exclude_' . $module_id => array('lang' => 'PORTAL_ATTACHMENTS_EXCLUDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), - ), - ); + 'board3_attachments_number_' . $module_id => ['lang' => 'PORTAL_ATTACHMENTS_NUMBER' , 'validate' => 'int', 'type' => 'number:0:999', 'explain' => true], + 'board3_attach_max_length_' . $module_id => ['lang' => 'PORTAL_ATTACHMENTS_MAX_LENGTH', 'validate' => 'int', 'type' => 'number:0:999', 'explain' => true], + 'board3_attachments_forum_ids_' . $module_id => ['lang' => 'PORTAL_ATTACHMENTS_FORUM_IDS', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => ['board3.portal.modules_helper', 'generate_forum_select'], 'submit' => ['board3.portal.modules_helper', 'store_selected_forums']], + 'board3_attachments_forum_exclude_' . $module_id => ['lang' => 'PORTAL_ATTACHMENTS_FORUM_EXCLUDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true], + 'board3_attachments_filetype_' . $module_id => ['lang' => 'PORTAL_ATTACHMENTS_FILETYPE', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => 'select_filetype', 'submit' => 'store_filetypes'], + 'board3_attachments_exclude_' . $module_id => ['lang' => 'PORTAL_ATTACHMENTS_EXCLUDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true], + ], + ]; } /** @@ -279,7 +279,7 @@ class attachments extends module_base WHERE a.topic_id <> 0 AND a.topic_id = t.topic_id - ' . $where . ' + ' . $this->db->sql_escape($where) . ' ORDER BY filetime ' . ((!$this->config['display_order']) ? 'DESC' : 'ASC') . ', post_msg_id ASC'; $result = $this->db->sql_query_limit($sql, $this->config['board3_attachments_number_' . $module_id], 0, 600); diff --git a/modules/birthday_list.php b/modules/birthday_list.php index 3cfa3b31..b04a77db 100644 --- a/modules/birthday_list.php +++ b/modules/birthday_list.php @@ -114,12 +114,12 @@ class birthday_list extends module_base ), 'WHERE' => "(b.ban_id IS NULL OR b.ban_exclude = 1) - AND (u.user_birthday " . $this->db->sql_like_expression($this->db->get_any_char() . sprintf('%2d-%2d-', $now['mday'], $now['mon']) . $this->db->get_any_char()) . " {$sql_days}) + AND (u.user_birthday " . $this->db->sql_like_expression($this->db->get_any_char() . sprintf('%2d-%2d-', $this->db->sql_escape($now['mday']), $this->db->sql_escape($now['mon'])) . $this->db->get_any_char()) . " {$sql_days}) AND " . $this->db->sql_in_set('u.user_type', array(USER_NORMAL , USER_FOUNDER)), 'ORDER BY' => $order_by, ); $sql = $this->db->sql_build_query('SELECT', $sql_array); - $result = $this->db->sql_query($sql, 300); + $result = $this->db->sql_query($sql, 15); $today = sprintf('%2d-%2d-', $now['mday'], $now['mon']); while ($row = $this->db->sql_fetchrow($result)) @@ -166,7 +166,7 @@ class birthday_list extends module_base 'title' => 'ACP_PORTAL_BIRTHDAYS_SETTINGS', 'vars' => array( 'legend1' => 'ACP_PORTAL_BIRTHDAYS_SETTINGS', - 'board3_birthdays_ahead_' . $module_id => array('lang' => 'PORTAL_BIRTHDAYS_AHEAD', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), + 'board3_birthdays_ahead_' . $module_id => ['lang' => 'PORTAL_BIRTHDAYS_AHEAD', 'validate' => 'int', 'type' => 'number:0:999', 'explain' => true], ), ); } diff --git a/modules/calendar.php b/modules/calendar.php index 7464d058..a99036cf 100644 --- a/modules/calendar.php +++ b/modules/calendar.php @@ -193,14 +193,14 @@ class calendar extends module_base $this->template->assign_block_vars('minical', array( 'S_SUNDAY_FIRST' => ($this->config['board3_sunday_first_' . $module_id]) ? true : false, - 'L_MINI_CAL_MONTH' => (($this->config['board3_long_month_' . $module_id]) ? $this->user->lang(['mini_cal', 'long_month'], $this->day[0][1]) : $this->user->lang(['mini_cal', 'month'], $this->day[0][1])) . " " . $this->day[0][2], - 'L_MINI_CAL_SUN' => '' . $this->user->lang(['mini_cal', 'day'], 1) . '', - 'L_MINI_CAL_MON' => $this->user->lang(['mini_cal', 'day'], 2), - 'L_MINI_CAL_TUE' => $this->user->lang(['mini_cal', 'day'], 3), - 'L_MINI_CAL_WED' => $this->user->lang(['mini_cal', 'day'], 4), - 'L_MINI_CAL_THU' => $this->user->lang(['mini_cal', 'day'], 5), - 'L_MINI_CAL_FRI' => $this->user->lang(['mini_cal', 'day'], 6), - 'L_MINI_CAL_SAT' => $this->user->lang(['mini_cal', 'day'], 7), + 'L_MINI_CAL_MONTH' => (($this->config['board3_long_month_' . $module_id]) ? $this->user->lang['mini_cal']['long_month'][$this->day[0][1]] : $this->user->lang['mini_cal']['month'][$this->day[0][1]]) . " " . $this->day[0][2], + 'L_MINI_CAL_SUN' => '' . $this->user->lang['mini_cal']['day'][1] . '', + 'L_MINI_CAL_MON' => $this->user->lang['mini_cal']['day'][2], + 'L_MINI_CAL_TUE' => $this->user->lang['mini_cal']['day'][3], + 'L_MINI_CAL_WED' => $this->user->lang['mini_cal']['day'][4], + 'L_MINI_CAL_THU' => $this->user->lang['mini_cal']['day'][5], + 'L_MINI_CAL_FRI' => $this->user->lang['mini_cal']['day'][6], + 'L_MINI_CAL_SAT' => $this->user->lang['mini_cal']['day'][7], 'U_PREV_MONTH' => $prev_month, 'U_NEXT_MONTH' => $next_month, 'S_DISPLAY_EVENTS' => ($this->config['board3_display_events_' . $module_id]) ? true : false, @@ -503,7 +503,7 @@ class calendar extends module_base 'end_time' => $end_time, 'all_day' => $event_all_day, 'permission' => $event_permission, - 'url' => htmlspecialchars_decode($event_url), + 'url' => htmlentities($event_url, ENT_QUOTES | ENT_SUBSTITUTE), ); $this->log->add('admin', $this->user->data['user_id'], $this->user->data['user_ip'], 'LOG_PORTAL_EVENT_UPDATED', false, array($event_title)); diff --git a/modules/custom.php b/modules/custom.php index 052b16f0..b181aa64 100644 --- a/modules/custom.php +++ b/modules/custom.php @@ -214,7 +214,7 @@ class custom extends module_base // first check for obvious errors, we don't want to waste server resources if (empty($custom_code)) { - trigger_error($this->user->lang['ACP_PORTAL_CUSTOM_CODE_SHORT']. adm_back_link($u_action), E_USER_WARNING); + trigger_error($this->user->lang['TOO_FEW_CHARS']. adm_back_link($u_action), E_USER_WARNING); } // get groups and check if the selected groups actually exist diff --git a/modules/friends.php b/modules/friends.php index 3fafc661..0fab578e 100644 --- a/modules/friends.php +++ b/modules/friends.php @@ -98,7 +98,7 @@ class friends extends module_base ) ), - 'WHERE' => 'z.user_id = ' . $this->user->data['user_id'] . ' + 'WHERE' => 'z.user_id = ' . (int) $this->user->data['user_id'] . ' AND z.friend = 1 AND u.user_id = z.zebra_id', 'GROUP_BY' => 'z.zebra_id, u.user_id, u.username, u.username_clean, u.user_allow_viewonline, u.user_colour', @@ -139,7 +139,7 @@ class friends extends module_base 'title' => 'ACP_PORTAL_FRIENDS_SETTINGS', 'vars' => array( 'legend1' => 'ACP_PORTAL_FRIENDS_SETTINGS', - 'board3_max_online_friends_' . $module_id => array('lang' => 'PORTAL_MAX_ONLINE_FRIENDS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), + 'board3_max_online_friends_' . $module_id => array('lang' => 'PORTAL_MAX_ONLINE_FRIENDS', 'validate' => 'int', 'type' => 'number:1:999', 'explain' => true), ) ); } diff --git a/modules/latest_bots.php b/modules/latest_bots.php index 925e572f..dc030e3d 100644 --- a/modules/latest_bots.php +++ b/modules/latest_bots.php @@ -114,7 +114,7 @@ class latest_bots extends module_base 'title' => 'ACP_PORTAL_BOTS_SETTINGS', 'vars' => array( 'legend1' => 'ACP_PORTAL_BOTS_SETTINGS', - 'board3_last_visited_bots_number_' . $module_id => array('lang' => 'PORTAL_LAST_VISITED_BOTS_NUMBER' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), + 'board3_last_visited_bots_number_' . $module_id => array('lang' => 'PORTAL_LAST_VISITED_BOTS_NUMBER' , 'validate' => 'int', 'type' => 'number:0:999', 'explain' => true), ) ); } diff --git a/modules/latest_members.php b/modules/latest_members.php index 1bfe7fd8..512971bb 100644 --- a/modules/latest_members.php +++ b/modules/latest_members.php @@ -102,7 +102,7 @@ class latest_members extends module_base 'title' => 'ACP_PORTAL_MEMBERS_SETTINGS', 'vars' => array( 'legend1' => 'ACP_PORTAL_MEMBERS_SETTINGS', - 'board3_max_last_member_' . $module_id => array('lang' => 'PORTAL_MAX_LAST_MEMBER' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), + 'board3_max_last_member_' . $module_id => array('lang' => 'PORTAL_MAX_LAST_MEMBER' , 'validate' => 'int', 'type' => 'number:0:999', 'explain' => true), ) ); } diff --git a/modules/leaders.php b/modules/leaders.php index 35498992..5e2ebaa5 100644 --- a/modules/leaders.php +++ b/modules/leaders.php @@ -116,7 +116,7 @@ class leaders extends module_base AND ug.user_pending = 0 ) WHERE g.group_legend >= 1 - AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $this->user->data['user_id'] . ') + AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . (int) $this->user->data['user_id'] . ') ORDER BY g.' . $order_legend . ' ASC'; } $result = $this->db->sql_query($sql, 600); diff --git a/modules/link_us.php b/modules/link_us.php index 7b2757a2..729fd748 100644 --- a/modules/link_us.php +++ b/modules/link_us.php @@ -75,7 +75,8 @@ class link_us extends module_base // Assign specific vars $this->template->assign_vars(array( 'LINK_US_TXT' => sprintf($this->user->lang['LINK_US_TXT'], $this->config['sitename']), - 'U_LINK_US' => '<a href="' . $u_link . '" ' . (($this->config['site_desc']) ? 'title="' . $this->config['site_desc'] . '"' : '' ) . '>' . (($this->config['sitename']) ? $this->config['sitename'] : $u_link ) . '</a>', + 'U_LINK_US_HTML' => '<a href="' . $u_link . '" ' . (($this->config['sitename']) ? 'title="' . $this->config['sitename'] . '"' : '' ) . '>' . (($this->config['sitename']) ? $this->config['sitename'] : $u_link ) . '</a>', + 'U_LINK_US_BB' => '[url=' . $u_link . ']' . (($this->config['sitename']) ? $this->config['sitename'] : $u_link ) . '[/url]', )); return 'link_us_side.html'; diff --git a/modules/links.php b/modules/links.php index e9bdf899..4ac03926 100644 --- a/modules/links.php +++ b/modules/links.php @@ -299,7 +299,7 @@ class links extends module_base $links[$link_id] = array( 'title' => $link_title, - 'url' => htmlspecialchars_decode($link_url), + 'url' => htmlentities($link_url, ENT_QUOTES | ENT_SUBSTITUTE), 'type' => $link_type, 'permission' => $link_permissions, ); @@ -312,7 +312,7 @@ class links extends module_base $links[] = array( 'title' => $link_title, - 'url' => htmlspecialchars_decode($link_url), + 'url' => htmlentities($link_url, ENT_QUOTES | ENT_SUBSTITUTE), 'type' => $link_type, 'permission' => $link_permissions, ); diff --git a/modules/main_menu.php b/modules/main_menu.php index 870f1e4f..d03896bf 100644 --- a/modules/main_menu.php +++ b/modules/main_menu.php @@ -355,7 +355,7 @@ class main_menu extends module_base $links[$link_id] = array( 'title' => $link_title, - 'url' => htmlspecialchars_decode($link_url), + 'url' => htmlentities($link_url, ENT_QUOTES | ENT_SUBSTITUTE), 'type' => $link_type, 'permission' => $link_permissions, ); @@ -372,7 +372,7 @@ class main_menu extends module_base } $links[] = array( 'title' => $link_title, - 'url' => htmlspecialchars_decode($link_url), + 'url' => htmlentities($link_url, ENT_QUOTES | ENT_SUBSTITUTE), 'type' => $link_type, 'permission' => $link_permissions, ); diff --git a/modules/news.php b/modules/news.php index f378ddc1..242734a3 100644 --- a/modules/news.php +++ b/modules/news.php @@ -313,6 +313,7 @@ class news extends module_base 'ATTACH_ICON_IMG' => ($fetch_news[$i]['attachment'] && $this->config['allow_attachments']) ? $this->user->img('icon_topic_attach', $this->user->lang['TOTAL_ATTACHMENTS']) : '', 'FORUM_NAME' => ($forum_id) ? $fetch_news[$i]['forum_name'] : '', 'TITLE' => $fetch_news[$i]['topic_title'], + 'MINI_POST' => $unread_topic ? $this->user->lang['UNREAD_POST'] : $this->user->lang['POST'], 'POSTER' => $fetch_news[$i]['username'], 'POSTER_FULL' => $fetch_news[$i]['username_full'], 'USERNAME_FULL_LAST' => $fetch_news[$i]['username_full_last'], @@ -439,8 +440,8 @@ class news extends module_base 'legend1' => 'ACP_PORTAL_NEWS_SETTINGS', 'board3_news_style_' . $module_id => array('lang' => 'PORTAL_NEWS_STYLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_show_all_news_' . $module_id => array('lang' => 'PORTAL_SHOW_ALL_NEWS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), - 'board3_number_of_news_' . $module_id => array('lang' => 'PORTAL_NUMBER_OF_NEWS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), - 'board3_news_length_' . $module_id => array('lang' => 'PORTAL_NEWS_LENGTH', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), + 'board3_number_of_news_' . $module_id => array('lang' => 'PORTAL_NUMBER_OF_NEWS', 'validate' => 'int', 'type' => 'number:0:999', 'explain' => true), + 'board3_news_length_' . $module_id => array('lang' => 'PORTAL_NEWS_LENGTH', 'validate' => 'int', 'type' => 'number:0:999', 'explain' => true), 'board3_news_forum_' . $module_id => array('lang' => 'PORTAL_NEWS_FORUM', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => array('board3.portal.modules_helper', 'generate_forum_select'), 'submit' => array('board3.portal.modules_helper', 'store_selected_forums')), 'board3_news_exclude_' . $module_id => array('lang' => 'PORTAL_NEWS_EXCLUDE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_news_show_last_' . $module_id => array('lang' => 'PORTAL_NEWS_SHOW_LAST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), diff --git a/modules/poll.php b/modules/poll.php index 49d6d954..dcb4d25a 100644 --- a/modules/poll.php +++ b/modules/poll.php @@ -127,7 +127,7 @@ class poll extends module_base 'legend1' => 'ACP_PORTAL_POLLS_SETTINGS', 'board3_poll_topic_id_' . $module_id => array('lang' => 'PORTAL_POLL_TOPIC_ID' , 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => array('board3.portal.modules_helper', 'generate_forum_select'), 'submit' => array('board3.portal.modules_helper', 'store_selected_forums')), 'board3_poll_exclude_id_' . $module_id => array('lang' => 'PORTAL_POLL_EXCLUDE_ID' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), - 'board3_poll_limit_' . $module_id => array('lang' => 'PORTAL_POLL_LIMIT' , 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), + 'board3_poll_limit_' . $module_id => array('lang' => 'PORTAL_POLL_LIMIT' , 'validate' => 'int', 'type' => 'number:1:999', 'explain' => true), 'board3_poll_allow_vote_' . $module_id => array('lang' => 'PORTAL_POLL_ALLOW_VOTE' , 'validate' => 'ibool', 'type' => 'radio:yes_no', 'explain' => true), 'board3_poll_hide_' . $module_id => array('lang' => 'PORTAL_POLL_HIDE' , 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), ) @@ -474,6 +474,7 @@ class poll extends module_base } $data['poll_title'] = censor_text($data['poll_title']); + decode_message($data['poll_title'], $data['bbcode_uid']); if ($poll_bbcode !== false) { @@ -517,6 +518,7 @@ class poll extends module_base } $pd['poll_option_text'] = censor_text($pd['poll_option_text']); + decode_message($pd['poll_option_text'], $data['bbcode_uid']); if ($poll_bbcode !== false) { @@ -542,7 +544,7 @@ class poll extends module_base $this->db->sql_freeresult($result); $this->template->assign_vars(array( - 'S_HAS_POLL' => $has_poll, + 'S_HAS_B3P_POLL' => $has_poll, 'POLL_LEFT_CAP_IMG' => $this->user->img('poll_left'), 'POLL_RIGHT_CAP_IMG' => $this->user->img('poll_right'), )); diff --git a/modules/recent.php b/modules/recent.php index a13e59d2..9033f782 100644 --- a/modules/recent.php +++ b/modules/recent.php @@ -134,7 +134,7 @@ class recent extends module_base AND topic_visibility = ' . ITEM_APPROVED . ' AND (topic_type = ' . POST_ANNOUNCE . ' OR topic_type = ' . POST_GLOBAL . ') AND topic_moved_id = 0 - ' . $sql_where . $forum_sql . ' + ' . $this->db->sql_escape($sql_where) . $this->db->sql_escape($forum_sql) . ' ORDER BY topic_time DESC'; $result = $this->db->sql_query_limit($sql, $this->config['board3_max_topics_' . $module_id], 0 , 30); @@ -158,9 +158,9 @@ class recent extends module_base $sql = 'SELECT topic_title, forum_id, topic_id FROM ' . TOPICS_TABLE . ' t WHERE topic_visibility = ' . ITEM_APPROVED . ' - AND topic_posts_approved >' . $this->config['hot_threshold'] . ' + AND topic_posts_approved >' . (int) $this->config['hot_threshold'] . ' AND topic_moved_id = 0 - ' . $sql_where . $forum_sql . ' + ' . $this->db->sql_escape($sql_where) . $this->db->sql_escape($forum_sql) . ' ORDER BY topic_time DESC'; $result = $this->db->sql_query_limit($sql, $this->config['board3_max_topics_' . $module_id], 0, 30); @@ -187,7 +187,7 @@ class recent extends module_base AND topic_visibility = ' . ITEM_APPROVED . ' AND topic_type = ' . POST_NORMAL . ' AND topic_moved_id = 0 - ' . $sql_where . $forum_sql . ' + ' . $this->db->sql_escape($sql_where) . $this->db->sql_escape($forum_sql) . ' ORDER BY topic_time DESC'; $result = $this->db->sql_query_limit($sql, $this->config['board3_max_topics_' . $module_id], 0, 30); @@ -217,8 +217,8 @@ class recent extends module_base 'title' => 'ACP_PORTAL_RECENT_SETTINGS', 'vars' => array( 'legend1' => 'ACP_PORTAL_RECENT_SETTINGS', - 'board3_max_topics_' . $module_id => array('lang' => 'PORTAL_MAX_TOPIC', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), - 'board3_recent_title_limit_' . $module_id => array('lang' => 'PORTAL_RECENT_TITLE_LIMIT', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), + 'board3_max_topics_' . $module_id => array('lang' => 'PORTAL_MAX_TOPIC', 'validate' => 'int', 'type' => 'number:0:999', 'explain' => true), + 'board3_recent_title_limit_' . $module_id => array('lang' => 'PORTAL_RECENT_TITLE_LIMIT', 'validate' => 'int', 'type' => 'number:0:999', 'explain' => true), 'board3_recent_forum_' . $module_id => array('lang' => 'PORTAL_RECENT_FORUM', 'validate' => 'string', 'type' => 'custom', 'explain' => true, 'method' => array('board3.portal.modules_helper', 'generate_forum_select'), 'submit' => array('board3.portal.modules_helper', 'store_selected_forums')), 'board3_recent_exclude_forums_' . $module_id => array('lang' => 'PORTAL_EXCLUDE_FORUM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), ) diff --git a/modules/topposters.php b/modules/topposters.php index 50f75dbc..8d169ad5 100644 --- a/modules/topposters.php +++ b/modules/topposters.php @@ -89,11 +89,11 @@ class topposters extends module_base while (($row = $this->db->sql_fetchrow($result))) { - $this->template->assign_block_vars('topposters', array( + $this->template->assign_block_vars('topposters', [ 'S_SEARCH_ACTION' => append_sid("{$this->phpbb_root_path}search.{$this->php_ext}", 'author_id=' . $row['user_id'] . '&sr=posts'), 'USERNAME_FULL' => get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']), 'POSTER_POSTS' => $row['user_posts'], - )); + ]); } $this->db->sql_freeresult($result); @@ -105,13 +105,13 @@ class topposters extends module_base */ public function get_template_acp($module_id) { - return array( + return [ 'title' => 'TOPPOSTERS_CONFIG', - 'vars' => array( + 'vars' => [ 'legend1' => 'TOPPOSTERS', - 'board3_topposters_' . $module_id => array('lang' => 'NUM_TOPPOSTERS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), - ), - ); + 'board3_topposters_' . $module_id => ['lang' => 'NUM_TOPPOSTERS', 'validate' => 'int', 'type' => 'number:1:999', 'explain' => true], + ], + ]; } /** @@ -128,9 +128,9 @@ class topposters extends module_base */ public function uninstall($module_id, $db) { - $del_config = array( + $del_config = [ 'board3_topposters_' . $module_id, - ); + ]; $sql = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE ' . $db->sql_in_set('config_name', $del_config); return $db->sql_query($sql); diff --git a/modules/welcome.php b/modules/welcome.php index a8be9f49..b4f60246 100644 --- a/modules/welcome.php +++ b/modules/welcome.php @@ -189,7 +189,7 @@ class welcome extends module_base // first check for obvious errors, we don't want to waste server resources if (empty($welcome_message)) { - trigger_error($this->user->lang['ACP_PORTAL_WELCOME_MESSAGE_SHORT']. adm_back_link($u_action), E_USER_WARNING); + trigger_error($this->user->lang['TOO_FEW_CHARS']. adm_back_link($u_action), E_USER_WARNING); } // set_portal_config will take care of escaping the welcome message