diff options
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acp/acp_attachments.php | 28 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_board.php | 8 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_search.php | 4 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_users.php | 56 | ||||
-rw-r--r-- | phpBB/includes/diff/renderer.php | 10 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 12 | ||||
-rw-r--r-- | phpBB/includes/functions_content.php | 16 | ||||
-rw-r--r-- | phpBB/includes/functions_display.php | 6 | ||||
-rw-r--r-- | phpBB/includes/functions_module.php | 6 | ||||
-rw-r--r-- | phpBB/includes/functions_posting.php | 13 | ||||
-rw-r--r-- | phpBB/includes/functions_privmsgs.php | 20 | ||||
-rw-r--r-- | phpBB/includes/functions_user.php | 42 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_pm.php | 2 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_prefs.php | 2 |
14 files changed, 113 insertions, 112 deletions
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 08b5f863e0..4d403df93b 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -23,7 +23,7 @@ class acp_attachments { var $u_action; var $new_config; - + function main($id, $mode) { global $db, $user, $auth, $template, $cache; @@ -56,7 +56,7 @@ class acp_attachments case 'ext_groups': $l_title = 'ACP_EXTENSION_GROUPS'; break; - + case 'orphan': $l_title = 'ACP_ORPHAN_ATTACHMENTS'; break; @@ -212,7 +212,7 @@ class acp_attachments // Secure Download Options - Same procedure as with banning $allow_deny = ($this->new_config['secure_allow_deny']) ? 'ALLOWED' : 'DISALLOWED'; - + $sql = 'SELECT * FROM ' . SITELIST_TABLE; $result = $db->sql_query($sql); @@ -282,7 +282,7 @@ class acp_attachments 'CONTENT' => build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars), ) ); - + unset($display_vars['vars'][$config_key]); } @@ -334,7 +334,7 @@ class acp_attachments FROM ' . EXTENSIONS_TABLE . ' WHERE ' . $db->sql_in_set('extension_id', $extension_id_list); $result = $db->sql_query($sql); - + $extension_list = ''; while ($row = $db->sql_fetchrow($result)) { @@ -364,7 +364,7 @@ class acp_attachments FROM ' . EXTENSIONS_TABLE . " WHERE extension = '" . $db->sql_escape($add_extension) . "'"; $result = $db->sql_query($sql); - + if ($row = $db->sql_fetchrow($result)) { $error[] = sprintf($user->lang['EXTENSION_EXIST'], $add_extension); @@ -603,7 +603,7 @@ class acp_attachments SET group_id = 0 WHERE group_id = $group_id"; $db->sql_query($sql); - + add_log('admin', 'LOG_ATTACH_EXTGROUP_DEL', $group_name); $cache->destroy('_extensions'); @@ -900,7 +900,7 @@ class acp_attachments $upload_list = array(); foreach ($add_files as $attach_id) { - if (!in_array($attach_id, array_keys($delete_files)) && !empty($post_ids[$attach_id])) + if (!isset($delete_files[$attach_id]) && !empty($post_ids[$attach_id])) { $upload_list[$attach_id] = $post_ids[$attach_id]; } @@ -1050,7 +1050,7 @@ class acp_attachments ATTACHMENT_CATEGORY_FLASH => $user->lang['CAT_FLASH_FILES'], ATTACHMENT_CATEGORY_QUICKTIME => $user->lang['CAT_QUICKTIME_FILES'], ); - + if ($group_id) { $sql = 'SELECT cat_id @@ -1066,7 +1066,7 @@ class acp_attachments { $cat_type = ATTACHMENT_CATEGORY_NONE; } - + $group_select = '<select name="' . $select_name . '"' . (($key) ? ' id="' . $key . '"' : '') . '>'; foreach ($types as $type => $mode) @@ -1086,7 +1086,7 @@ class acp_attachments function group_select($select_name, $default_group = false, $key = '') { global $db, $user; - + $group_select = '<select name="' . $select_name . '"' . (($key) ? ' id="' . $key . '"' : '') . '>'; $sql = 'SELECT group_id, group_name @@ -1104,7 +1104,7 @@ class acp_attachments $row['group_id'] = 0; $row['group_name'] = $user->lang['NOT_ASSIGNED']; $group_name[] = $row; - + for ($i = 0; $i < sizeof($group_name); $i++) { if ($default_group === false) @@ -1138,7 +1138,7 @@ class acp_attachments if (empty($magic_home)) { $locations = array('C:/WINDOWS/', 'C:/WINNT/', 'C:/WINDOWS/SYSTEM/', 'C:/WINNT/SYSTEM/', 'C:/WINDOWS/SYSTEM32/', 'C:/WINNT/SYSTEM32/', '/usr/bin/', '/usr/sbin/', '/usr/local/bin/', '/usr/local/sbin/', '/opt/', '/usr/imagemagick/', '/usr/bin/imagemagick/'); - $path_locations = str_replace('\\', '/', (explode(($exe) ? ';' : ':', getenv('PATH')))); + $path_locations = str_replace('\\', '/', (explode(($exe) ? ';' : ':', getenv('PATH')))); $locations = array_merge($path_locations, $locations); @@ -1352,7 +1352,7 @@ class acp_attachments $db->sql_query($sql); } } - + if (!empty($ip_list_log)) { // Update log diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 4d467b6895..455719110e 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -127,7 +127,7 @@ class acp_board 'pm_max_msgs' => array('lang' => 'BOXES_LIMIT', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true), 'full_folder_action' => array('lang' => 'FULL_FOLDER_ACTION', 'validate' => 'int', 'type' => 'select', 'method' => 'full_folder_select', 'explain' => true), 'pm_edit_time' => array('lang' => 'PM_EDIT_TIME', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), - + 'legend2' => 'GENERAL_OPTIONS', 'allow_mass_pm' => array('lang' => 'ALLOW_MASS_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'auth_bbcode_pm' => array('lang' => 'ALLOW_BBCODE_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), @@ -269,7 +269,7 @@ class acp_board 'load_jumpbox' => array('lang' => 'YES_JUMPBOX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'load_user_activity' => array('lang' => 'LOAD_USER_ACTIVITY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'load_tplcompile' => array('lang' => 'RECOMPILE_STYLES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), - + 'legend3' => 'CUSTOM_PROFILE_FIELDS', 'load_cpf_memberlist' => array('lang' => 'LOAD_CPF_MEMBERLIST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'load_cpf_viewprofile' => array('lang' => 'LOAD_CPF_VIEWPROFILE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), @@ -564,7 +564,7 @@ class acp_board 'CONTENT' => build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars), ) ); - + unset($display_vars['vars'][$config_key]); } @@ -795,7 +795,7 @@ class acp_board } $dateformat_options .= '<option value="custom"'; - if (!in_array($value, array_keys($user->lang['dateformats']))) + if (!isset($user->lang['dateformats'][$value])) { $dateformat_options .= ' selected="selected"'; } diff --git a/phpBB/includes/acp/acp_search.php b/phpBB/includes/acp/acp_search.php index 65634ebb25..67a3c6bf6f 100644 --- a/phpBB/includes/acp/acp_search.php +++ b/phpBB/includes/acp/acp_search.php @@ -518,9 +518,9 @@ class acp_search function close_popup_js() { return "<script type=\"text/javascript\">\n" . - "<!--\n" . + "// <![CDATA[\n" . " close_waitscreen = 1;\n" . - "//-->\n" . + "// ]]>\n" . "</script>\n"; } diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 40230d0270..360552c452 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -411,7 +411,7 @@ class acp_users $sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE user_id = $user_id"; $db->sql_query($sql); - + add_log('admin', 'LOG_USER_DEL_SIG', $user_row['username']); add_log('user', $user_id, 'LOG_USER_DEL_SIG_USER'); @@ -492,9 +492,9 @@ class acp_users 'update' => true)) ); } - + break; - + case 'moveposts': if (!check_form_key($form_name)) @@ -835,9 +835,9 @@ class acp_users { $quick_tool_ary += array('active' => (($user_row['user_type'] == USER_INACTIVE) ? 'ACTIVATE' : 'DEACTIVATE')); } - + $quick_tool_ary += array('delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH'); - + if ($config['email_enable'] && ($user_row['user_type'] == USER_NORMAL || $user_row['user_type'] == USER_INACTIVE)) { $quick_tool_ary['reactivate'] = 'FORCE'; @@ -923,7 +923,7 @@ class acp_users case 'feedback': $user->add_lang('mcp'); - + // Set up general vars $start = request_var('start', 0); $deletemark = (isset($_POST['delmarked'])) ? true : false; @@ -980,7 +980,7 @@ class acp_users trigger_error($user->lang['USER_FEEDBACK_ADDED'] . adm_back_link($this->u_action . '&u=' . $user_id)); } - + // Sorting $limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']); $sort_by_text = array('u' => $user->lang['SORT_USERNAME'], 't' => $user->lang['SORT_DATE'], 'i' => $user->lang['SORT_IP'], 'o' => $user->lang['SORT_ACTION']); @@ -1216,7 +1216,7 @@ class acp_users 'S_BIRTHDAY_DAY_OPTIONS' => $s_birthday_day_options, 'S_BIRTHDAY_MONTH_OPTIONS' => $s_birthday_month_options, 'S_BIRTHDAY_YEAR_OPTIONS' => $s_birthday_year_options, - + 'S_PROFILE' => true) ); @@ -1347,7 +1347,7 @@ class acp_users $s_custom = false; $dateformat_options .= '<option value="custom"'; - if (!in_array($data['dateformat'], array_keys($user->lang['dateformats']))) + if (!isset($user->lang['dateformats'][$data['dateformat']])) { $dateformat_options .= ' selected="selected"'; $s_custom = true; @@ -1395,7 +1395,7 @@ class acp_users $template->assign_vars(array( 'S_PREFS' => true, 'S_JABBER_DISABLED' => ($config['jab_enable'] && $user_row['user_jabber'] && @extension_loaded('xml')) ? false : true, - + 'VIEW_EMAIL' => $data['viewemail'], 'MASS_EMAIL' => $data['massemail'], 'ALLOW_PM' => $data['allowpm'], @@ -1416,7 +1416,7 @@ class acp_users 'VIEW_SIGS' => $data['view_sigs'], 'VIEW_AVATARS' => $data['view_avatars'], 'VIEW_WORDCENSOR' => $data['view_wordcensor'], - + 'S_TOPIC_SORT_DAYS' => $s_limit_topic_days, 'S_TOPIC_SORT_KEY' => $s_sort_topic_key, 'S_TOPIC_SORT_DIR' => $s_sort_topic_dir, @@ -1509,7 +1509,7 @@ class acp_users trigger_error($user->lang['USER_RANK_UPDATED'] . adm_back_link($this->u_action . '&u=' . $user_id)); } - + $sql = 'SELECT * FROM ' . RANKS_TABLE . ' WHERE rank_special = 1 @@ -1531,9 +1531,9 @@ class acp_users ); break; - + case 'sig': - + include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx); @@ -1552,7 +1552,7 @@ class acp_users // Allowing Quote BBCode $message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, $config['allow_sig_links'], true, 'sig'); - + if (sizeof($message_parser->warn_msg)) { $error[] = implode('<br />', $message_parser->warn_msg); @@ -1578,13 +1578,13 @@ class acp_users trigger_error($user->lang['USER_SIG_UPDATED'] . adm_back_link($this->u_action . '&u=' . $user_id)); } - + // Replace "error" strings with their real, localised form $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error); } - + $signature_preview = ''; - + if ($preview) { // Now parse it for displaying @@ -1755,7 +1755,7 @@ class acp_users 'ATTACH_ID' => $row['attach_id'], 'POST_ID' => $row['post_msg_id'], 'TOPIC_ID' => $row['topic_id'], - + 'S_IN_MESSAGE' => $row['in_message'], 'U_DOWNLOAD' => append_sid("{$phpbb_root_path}download/file.$phpEx", 'mode=view&id=' . $row['attach_id']), @@ -1763,7 +1763,7 @@ class acp_users ); } $db->sql_freeresult($result); - + $template->assign_vars(array( 'S_ATTACHMENTS' => true, 'S_ON_PAGE' => on_page($num_attachments, $config['topics_per_page'], $start), @@ -1774,14 +1774,14 @@ class acp_users ); break; - + case 'groups': include($phpbb_root_path . 'includes/functions_user.' . $phpEx); $user->add_lang(array('groups', 'acp/groups')); $group_id = request_var('g', 0); - + if ($group_id) { // Check the founder only entry for this group to make sure everything is well @@ -1791,7 +1791,7 @@ class acp_users $result = $db->sql_query($sql); $founder_manage = (int) $db->sql_fetchfield('group_founder_manage'); $db->sql_freeresult($result); - + if ($user->data['user_type'] != USER_FOUNDER && $founder_manage) { trigger_error($user->lang['NOT_ALLOWED_MANAGE_GROUP'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); @@ -1801,7 +1801,7 @@ class acp_users { $founder_manage = 0; } - + switch ($action) { case 'demote': @@ -1832,7 +1832,7 @@ class acp_users { trigger_error($user->lang[$error] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING); } - + $error = array(); } else @@ -1845,7 +1845,7 @@ class acp_users 'g' => $group_id)) ); } - + break; } @@ -1980,7 +1980,7 @@ class acp_users $result = $db->sql_query($sql); $hold_ary = array(); - + while ($row = $db->sql_fetchrow($result)) { $hold_ary = $auth_admin->get_mask('view', $user_id, false, false, $row['auth_option'], 'global', ACL_NEVER); @@ -2020,7 +2020,7 @@ class acp_users 'U_USER_PERMISSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx" ,'i=permissions&mode=setting_user_global&user_id[]=' . $user_id), 'U_USER_FORUM_PERMISSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions&mode=setting_user_local&user_id[]=' . $user_id)) ); - + break; } diff --git a/phpBB/includes/diff/renderer.php b/phpBB/includes/diff/renderer.php index 4157bc2cde..f4a0bce3f9 100644 --- a/phpBB/includes/diff/renderer.php +++ b/phpBB/includes/diff/renderer.php @@ -301,7 +301,7 @@ class diff_renderer_unified extends diff_renderer { return '<pre class="diff context">' . htmlspecialchars($this->_lines($lines, ' ')) . '<br /></pre>'; } - + function _added($lines) { return '<pre class="diff added">' . htmlspecialchars($this->_lines($lines, '+')) . '<br /></pre>'; @@ -448,7 +448,7 @@ class diff_renderer_inline extends diff_renderer // Therefore we split on words, but include all blocks of whitespace in the wordlist. $splitted_text_1 = $this->_split_on_words($text1, $nl); $splitted_text_2 = $this->_split_on_words($text2, $nl); - + $diff = &new diff($splitted_text_1, $splitted_text_2); unset($splitted_text_1, $splitted_text_2); @@ -463,7 +463,7 @@ class diff_renderer_inline extends diff_renderer { // Ignore \0; otherwise the while loop will never finish. $string = str_replace("\0", '', $string); - + $words = array(); $length = strlen($string); $pos = 0; @@ -537,7 +537,7 @@ class diff_renderer_raw extends diff_renderer { return $this->_lines($lines, ' '); } - + function _added($lines) { return $this->_lines($lines, '+'); @@ -603,7 +603,7 @@ class diff_renderer_side_by_side extends diff_renderer // Iterate through every header block of changes foreach ($this->lines as $header) { - $output .= '<tr><th>Line ' . $header['oldline'] . '</th><th>' . $user->lang['LINE'] . ' ' . $header['newline'] . '</th></tr>'; + $output .= '<tr><th>' . $user->lang['LINE'] . ' ' . $header['oldline'] . '</th><th>' . $user->lang['LINE'] . ' ' . $header['newline'] . '</th></tr>'; // Each header block consists of a number of changes (add, remove, change). $current_context = ''; diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 017dfa5c68..e31b8d5294 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1359,7 +1359,7 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti while ($row = $db->sql_fetchrow($result)) { - if (!in_array(base_convert($row['topic_id'], 10, 36), array_keys($check_forum))) + if (!isset($check_forum[base_convert($row['topic_id'], 10, 36)])) { $unread = true; break; @@ -2308,7 +2308,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa // Something failed, determine what... if ($result['status'] == LOGIN_BREAK) { - trigger_error($result['error_msg'], E_USER_ERROR); + trigger_error($result['error_msg']); } // Special cases... determine @@ -2423,7 +2423,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa 'PASSWORD_CREDENTIAL' => ($admin) ? 'password_' . $credential : 'password', )); - page_header($user->lang['LOGIN']); + page_header($user->lang['LOGIN'], false); $template->set_filenames(array( 'body' => 'login_body.html') @@ -2966,14 +2966,14 @@ function msg_handler($errno, $msg_text, $errfile, $errline) echo '<head>'; echo '<meta http-equiv="content-type" content="text/html; charset=utf-8" />'; echo '<title>' . $msg_title . '</title>'; - echo '<style type="text/css">' . "\n" . '<!--' . "\n"; + echo '<style type="text/css">' . "\n" . '/* <![CDATA[ */' . "\n"; echo '* { margin: 0; padding: 0; } html { font-size: 100%; height: 100%; margin-bottom: 1px; background-color: #E4EDF0; } body { font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif; color: #536482; background: #E4EDF0; font-size: 62.5%; margin: 0; } '; echo 'a:link, a:active, a:visited { color: #006699; text-decoration: none; } a:hover { color: #DD6900; text-decoration: underline; } '; echo '#wrap { padding: 0 20px 15px 20px; min-width: 615px; } #page-header { text-align: right; height: 40px; } #page-footer { clear: both; font-size: 1em; text-align: center; } '; echo '.panel { margin: 4px 0; background-color: #FFFFFF; border: solid 1px #A9B8C2; } '; echo '#errorpage #page-header a { font-weight: bold; line-height: 6em; } #errorpage #content { padding: 10px; } #errorpage #content h1 { line-height: 1.2em; margin-bottom: 0; color: #DF075C; } '; echo '#errorpage #content div { margin-top: 20px; margin-bottom: 5px; border-bottom: 1px solid #CCCCCC; padding-bottom: 5px; color: #333333; font: bold 1.2em "Lucida Grande", Arial, Helvetica, sans-serif; text-decoration: none; line-height: 120%; text-align: left; } '; - echo "\n" . '//-->' . "\n"; + echo "\n" . '/* ]]> */' . "\n"; echo '</style>'; echo '</head>'; echo '<body id="errorpage">'; @@ -3344,7 +3344,6 @@ function page_header($page_title = '', $display_online_list = true) 'U_POPUP_PM' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=popup'), 'UA_POPUP_PM' => addslashes(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=popup')), 'U_MEMBERLIST' => append_sid("{$phpbb_root_path}memberlist.$phpEx"), - 'U_MEMBERSLIST' => append_sid("{$phpbb_root_path}memberlist.$phpEx"), 'U_VIEWONLINE' => ($auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel')) ? append_sid("{$phpbb_root_path}viewonline.$phpEx") : '', 'U_LOGIN_LOGOUT' => $u_login_logout, 'U_INDEX' => append_sid("{$phpbb_root_path}index.$phpEx"), @@ -3380,6 +3379,7 @@ function page_header($page_title = '', $display_online_list = true) 'S_DISPLAY_PM' => ($config['allow_privmsg'] && $user->data['is_registered'] && ($auth->acl_get('u_readpm') || $auth->acl_get('u_sendpm'))) ? true : false, 'S_DISPLAY_MEMBERLIST' => (isset($auth)) ? $auth->acl_get('u_viewprofile') : 0, 'S_NEW_PM' => ($s_privmsg_new) ? 1 : 0, + 'S_REGISTER_ENABLED' => ($config['require_activation'] != USER_ACTIVATION_DISABLE) ? true : false, 'T_THEME_PATH' => "{$phpbb_root_path}styles/" . $user->theme['theme_path'] . '/theme', 'T_TEMPLATE_PATH' => "{$phpbb_root_path}styles/" . $user->theme['template_path'] . '/template', diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index c0acd2eb41..a5a8683df3 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -67,7 +67,7 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key, $sort_dir = key($sort_dir_text); } - $s_limit_days = '<select name="st">'; + $s_limit_days = '<select name="st" id="st">'; foreach ($limit_days as $day => $text) { $selected = ($sort_days == $day) ? ' selected="selected"' : ''; @@ -75,7 +75,7 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key, } $s_limit_days .= '</select>'; - $s_sort_key = '<select name="sk">'; + $s_sort_key = '<select name="sk" id="sk">'; foreach ($sort_by_text as $key => $text) { $selected = ($sort_key == $key) ? ' selected="selected"' : ''; @@ -83,7 +83,7 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key, } $s_sort_key .= '</select>'; - $s_sort_dir = '<select name="sd">'; + $s_sort_dir = '<select name="sd" id="sd">'; foreach ($sort_dir_text as $key => $value) { $selected = ($sort_dir == $key) ? ' selected="selected"' : ''; @@ -382,7 +382,7 @@ function strip_bbcode(&$text, $uid = '') $match = get_preg_expression('bbcode_htm'); $replace = array('\1', '\1', '\2', '\1', '', ''); - + $text = preg_replace($match, $replace, $text); } @@ -418,7 +418,7 @@ function generate_text_for_display($text, $uid, $bitfield, $flags) { $bbcode->bbcode($bitfield); } - + $bbcode->bbcode_second_pass($text, $uid); } @@ -801,7 +801,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count, $template->destroy_block_vars('_file'); $block_array = array(); - + // Some basics... $attachment['extension'] = strtolower(trim($attachment['extension'])); $filename = $phpbb_root_path . $config['upload_path'] . '/' . basename($attachment['physical_filename']); @@ -1083,7 +1083,7 @@ function truncate_string($string, $max_length = 60, $allow_reply = true, $append { $string = 'Re: ' . $string; } - + if ($append != '' && $stripped) { $string = $string . $append; @@ -1202,7 +1202,7 @@ class bitfield if (strlen($this->data) >= $byte + 1) { $c = $this->data[$byte]; - + // Lookup the ($n % 8)th bit of the byte $bit = 7 - ($n & 7); return (bool) (ord($c) & (1 << $bit)); diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index f9cabaff29..a3507a7b54 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -27,7 +27,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $forum_rows = $subforums = $forum_ids = $forum_ids_moderator = $forum_moderators = $active_forum_ary = array(); $parent_id = $visible_forums = 0; $sql_from = ''; - + // Mark forums read? $mark_read = request_var('mark', ''); @@ -438,7 +438,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'S_UNREAD' => $subforum['unread']) ); } - + $last_catless = $catless; } @@ -980,7 +980,7 @@ function display_user_activity(&$userdata) /** * Topic and forum watching common code */ -function watch_topic_forum($mode, &$s_watching, &$s_watching_img, $user_id, $forum_id, $topic_id, $notify_status = 'unset', $start = 0) +function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, $notify_status = 'unset', $start = 0) { global $template, $db, $user, $phpEx, $start, $phpbb_root_path; diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index b58993d878..f4ee454033 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -677,7 +677,7 @@ class p_master } // Select first id we can get - if (!$current_id && (in_array($item_ary['id'], array_keys($this->module_cache['parents'])) || $item_ary['id'] == $this->p_id)) + if (!$current_id && (isset($this->module_cache['parents'][$item_ary['id']]) || $item_ary['id'] == $this->p_id)) { $current_id = $item_ary['id']; } @@ -710,7 +710,7 @@ class p_master $tpl_ary = array( 'L_TITLE' => $item_ary['lang'], - 'S_SELECTED' => (in_array($item_ary['id'], array_keys($this->module_cache['parents'])) || $item_ary['id'] == $this->p_id) ? true : false, + 'S_SELECTED' => (isset($this->module_cache['parents'][$item_ary['id']]) || $item_ary['id'] == $this->p_id) ? true : false, 'U_TITLE' => $u_title ); @@ -719,7 +719,7 @@ class p_master $tpl_ary = array( 'L_TITLE' => $item_ary['lang'], - 'S_SELECTED' => (in_array($item_ary['id'], array_keys($this->module_cache['parents'])) || $item_ary['id'] == $this->p_id) ? true : false, + 'S_SELECTED' => (isset($this->module_cache['parents'][$item_ary['id']]) || $item_ary['id'] == $this->p_id) ? true : false, 'U_TITLE' => $u_title ); diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 04e56f3851..2374029ae6 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -267,7 +267,7 @@ function posting_gen_topic_icons($mode, $icon_id) 'ICON_IMG' => $phpbb_root_path . $config['icons_path'] . '/' . $data['img'], 'ICON_WIDTH' => $data['width'], 'ICON_HEIGHT' => $data['height'], - + 'S_CHECKED' => ($id == $icon_id) ? true : false, 'S_ICON_CHECKED' => ($id == $icon_id) ? ' checked="checked"' : '') ); @@ -323,7 +323,7 @@ function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL) $topic_type_array ); - + foreach ($topic_type_array as $array) { $template->assign_block_vars('topic_type', $array); @@ -939,7 +939,8 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id WHERE p.topic_id = $topic_id " . ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND p.post_approved = 1' : '') . ' ' . (($mode == 'post_review') ? " AND p.post_id > $cur_post_id" : '') . ' - ORDER BY p.post_time DESC'; + ORDER BY p.post_time'; + $sql .= ($mode == 'post_review') ? 'ASC' : 'DESC'; $result = $db->sql_query_limit($sql, $config['posts_per_page']); $post_list = array(); @@ -1722,7 +1723,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u } $sql_data[USERS_TABLE]['stat'][] = "user_lastpost_time = $current_time" . (($auth->acl_get('f_postcount', $data['forum_id'])) ? ', user_posts = user_posts + 1' : ''); - + if ($topic_type != POST_GLOBAL) { if ($auth->acl_get('f_noapprove', $data['forum_id']) || $auth->acl_get('m_approve', $data['forum_id'])) @@ -1945,7 +1946,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u } $sql_insert_ary = array(); - + for ($i = 0, $size = sizeof($poll['poll_options']); $i < $size; $i++) { if (strlen(trim($poll['poll_options'][$i]))) @@ -2018,7 +2019,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u foreach ($data['attachment_data'] as $pos => $attach_row) { - if ($attach_row['is_orphan'] && !in_array($attach_row['attach_id'], array_keys($orphan_rows))) + if ($attach_row['is_orphan'] && !isset($orphan_rows[$attach_row['attach_id']])) { continue; } diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 5476517440..bffa64158a 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -276,7 +276,7 @@ function check_rule(&$rules, &$rule_row, &$message_row, $user_id) case ACTION_PLACE_INTO_FOLDER: return array('action' => $rule_row['rule_action'], 'folder_id' => $rule_row['rule_folder_id']); break; - + case ACTION_MARK_AS_READ: case ACTION_MARK_AS_IMPORTANT: return array('action' => $rule_row['rule_action'], 'pm_unread' => $message_row['pm_unread'], 'pm_marked' => $message_row['pm_marked']); @@ -304,7 +304,7 @@ function check_rule(&$rules, &$rule_row, &$message_row, $user_id) return false; break; - + default: return false; } @@ -606,7 +606,7 @@ function place_pm_into_folder(&$global_privmsgs_rules, $release = false) unset($sql_folder); - if (in_array(PRIVMSGS_INBOX, array_keys($move_into_folder))) + if (isset($move_into_folder[PRIVMSGS_INBOX])) { $sql = 'SELECT COUNT(msg_id) as num_messages FROM ' . PRIVMSGS_TO_TABLE . " @@ -892,7 +892,7 @@ function handle_mark_actions($user_id, $mark_action) if (confirm_box(true)) { delete_pm($user_id, $msg_ids, $cur_folder_id); - + $success_msg = (sizeof($msg_ids) == 1) ? 'MESSAGE_DELETED' : 'MESSAGES_DELETED'; $redirect = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=' . $cur_folder_id); @@ -1034,8 +1034,8 @@ function delete_pm($user_id, $msg_ids, $folder_id) $user->data['user_new_privmsg'] -= $num_new; $user->data['user_unread_privmsg'] -= $num_unread; } - - // Now we have to check which messages we can delete completely + + // Now we have to check which messages we can delete completely $sql = 'SELECT msg_id FROM ' . PRIVMSGS_TO_TABLE . ' WHERE ' . $db->sql_in_set('msg_id', array_keys($delete_rows)); @@ -1157,7 +1157,7 @@ function write_pm_addresses($check_ary, $author_id, $plaintext = false) FROM ' . GROUPS_TABLE . ' WHERE ' . $db->sql_in_set('group_id', $g); $result = $db->sql_query($sql); - + while ($row = $db->sql_fetchrow($result)) { if ($check_type == 'to' || $author_id == $user->data['user_id'] || $row['user_id'] == $user->data['user_id']) @@ -1175,7 +1175,7 @@ function write_pm_addresses($check_ary, $author_id, $plaintext = false) AND g.group_id = ug.group_id AND ug.user_pending = 0'; $result = $db->sql_query($sql); - + while ($row = $db->sql_fetchrow($result)) { if (!isset($address['group'][$row['group_id']])) @@ -1331,7 +1331,7 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true) AND u.user_id = ug.user_id AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')'; $result = $db->sql_query($sql); - + while ($row = $db->sql_fetchrow($result)) { $field = ($data['address_list']['g'][$row['group_id']] == 'to') ? 'to' : 'bcc'; @@ -1506,7 +1506,7 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true) foreach ($data['attachment_data'] as $pos => $attach_row) { - if ($attach_row['is_orphan'] && !in_array($attach_row['attach_id'], array_keys($orphan_rows))) + if ($attach_row['is_orphan'] && !isset($orphan_rows[$attach_row['attach_id']])) { continue; } diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index af9e69d00c..8782460ecf 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -219,7 +219,7 @@ function user_add($user_row, $cp_data = false) 'user_sig' => '', 'user_sig_bbcode_uid' => '', 'user_sig_bbcode_bitfield' => '', - + 'user_form_salt' => unique_id(), ); @@ -377,7 +377,7 @@ function user_delete($mode, $user_id, $post_username = false) { avatar_delete('user', $user_row); } - + switch ($mode) { case 'retain': @@ -985,7 +985,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas 'ban_give_reason' => (string) $ban_give_reason, ); } - + $db->sql_multi_insert(BANLIST_TABLE, $sql_ary); // If we are banning we want to logout anyone matching the ban @@ -1292,7 +1292,7 @@ function validate_date($date_string, $optional = false) $date[2] = 1980; } } - + if (sizeof($date) != 3 || !checkdate($date[1], $date[0], $date[2])) { return 'INVALID'; @@ -1847,7 +1847,7 @@ function avatar_delete($mode, $row, $clean_db = false) return false; } } - + if ($clean_db) { avatar_remove_db($row[$mode . '_avatar']); @@ -1959,7 +1959,7 @@ function avatar_upload($data, &$error) { $file = $upload->remote_upload($data['uploadurl']); } - + $prefix = $config['avatar_salt'] . '_'; $file->clean_filename('avatar', $prefix, $data['user_id']); @@ -1996,7 +1996,7 @@ function get_avatar_filename($avatar_entry) { global $config; - + if ($avatar_entry[0] === 'g') { $avatar_group = true; @@ -2042,7 +2042,7 @@ function avatar_gallery($category, $avatar_select, $items_per_column, $block_var if ($file[0] != '.' && preg_match('#^[^&"\'<>]+$#i', $file) && is_dir("$path/$file")) { $avatar_row_count = $avatar_col_count = 0; - + if ($dp2 = @opendir("$path/$file")) { while (($sub_file = readdir($dp2)) !== false) @@ -2122,7 +2122,7 @@ function avatar_gallery($category, $avatar_select, $items_per_column, $block_var function avatar_get_dimensions($avatar, $avatar_type, &$error, $current_x = 0, $current_y = 0) { global $config, $phpbb_root_path, $user; - + switch ($avatar_type) { case AVATAR_REMOTE : @@ -2131,7 +2131,7 @@ function avatar_get_dimensions($avatar, $avatar_type, &$error, $current_x = 0, $ case AVATAR_UPLOAD : $avatar = $phpbb_root_path . $config['avatar_path'] . '/' . get_avatar_filename($avatar); break; - + case AVATAR_GALLERY : $avatar = $phpbb_root_path . $config['avatar_gallery_path'] . '/' . $avatar ; break; @@ -2149,7 +2149,7 @@ function avatar_get_dimensions($avatar, $avatar_type, &$error, $current_x = 0, $ $error[] = $user->lang['AVATAR_NO_SIZE']; return false; } - + // try to maintain ratio if (!(empty($current_x) && empty($current_y))) { @@ -2248,7 +2248,7 @@ function avatar_process_user(&$error, $custom_userdata = false) else if (!empty($userdata['user_avatar'])) { // Only update the dimensions - + if (empty($data['width']) || empty($data['height'])) { if ($dims = avatar_get_dimensions($userdata['user_avatar'], $userdata['user_avatar_type'], $error, $data['width'], $data['height'])) @@ -2354,13 +2354,13 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow { $error[] = (!utf8_strlen($name)) ? $user->lang['GROUP_ERR_USERNAME'] : $user->lang['GROUP_ERR_USER_LONG']; } - + $err = group_validate_groupname($group_id, $name); if (!empty($err)) { $error[] = $user->lang[$err]; } - + if (!in_array($type, array(GROUP_OPEN, GROUP_CLOSED, GROUP_HIDDEN, GROUP_SPECIAL, GROUP_FREE))) { $error[] = $user->lang['GROUP_ERR_TYPE']; @@ -2494,7 +2494,7 @@ function group_correct_avatar($group_id, $old_entry) $old_filename = get_avatar_filename($old_entry); $new_filename = $config['avatar_salt'] . "_g$group_id.$ext"; $new_entry = 'g' . $group_id . '_' . substr(time(), -5) . ".$ext"; - + $avatar_path = $phpbb_root_path . $config['avatar_path']; if (@rename($avatar_path . '/'. $old_filename, $avatar_path . '/' . $new_filename)) { @@ -2512,7 +2512,7 @@ function group_correct_avatar($group_id, $old_entry) function avatar_remove_db($avatar_name) { global $config, $db; - + $sql = 'UPDATE ' . USERS_TABLE . " SET user_avatar = '', user_avatar_type = 0 @@ -2842,7 +2842,7 @@ function remove_default_avatar($group_id, $user_ids) return false; } $db->sql_freeresult($result); - + $sql = 'UPDATE ' . USERS_TABLE . " SET user_avatar = '', user_avatar_type = 0, @@ -2851,7 +2851,7 @@ function remove_default_avatar($group_id, $user_ids) WHERE group_id = " . (int) $group_id . " AND user_avatar = '" . $db->sql_escape($row['group_avatar']) . "' AND " . $db->sql_in_set('user_id', $user_ids); - + $db->sql_query($sql); } @@ -3053,7 +3053,7 @@ function group_validate_groupname($group_id, $group_name) $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - + if ($row) { return 'GROUP_NAME_TAKEN'; @@ -3116,7 +3116,7 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal } // Before we update the user attributes, we will make a list of those having now the group avatar assigned - if (in_array('user_avatar', array_keys($sql_ary))) + if (isset($sql_ary['user_avatar'])) { // Ok, get the original avatar data from users having an uploaded one (we need to remove these from the filesystem) $sql = 'SELECT user_id, group_id, user_avatar @@ -3142,7 +3142,7 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal WHERE ' . $db->sql_in_set('user_id', $user_id_ary); $db->sql_query($sql); - if (in_array('user_colour', array_keys($sql_ary))) + if (isset($sql_ary['user_colour'])) { // Update any cached colour information for these users $sql = 'UPDATE ' . FORUMS_TABLE . " SET forum_last_poster_colour = '" . $db->sql_escape($sql_ary['user_colour']) . "' diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php index 04155e8522..46b23efb54 100644 --- a/phpBB/includes/ucp/ucp_pm.php +++ b/phpBB/includes/ucp/ucp_pm.php @@ -92,7 +92,7 @@ class ucp_pm { if ($user->data['user_new_privmsg']) { - $l_new_message = ($user->data['user_new_privmsg'] == 1 ) ? $user->lang['YOU_NEW_PM'] : $user->lang['YOU_NEW_PMS']; + $l_new_message = ($user->data['user_new_privmsg'] == 1) ? $user->lang['YOU_NEW_PM'] : $user->lang['YOU_NEW_PMS']; } else { diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index 3ce3ea73ed..3762cf25f6 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -114,7 +114,7 @@ class ucp_prefs $s_custom = false; $dateformat_options .= '<option value="custom"'; - if (!in_array($data['dateformat'], array_keys($user->lang['dateformats']))) + if (!isset($user->lang['dateformats'][$data['dateformat']])) { $dateformat_options .= ' selected="selected"'; $s_custom = true; |