diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 364855ebb8..33a3c5ac30 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -138,7 +138,7 @@ class parse_message $replace = array(); // relative urls for this board - $match[] = '#(^|[\n ])' . $server_protocol . trim($config['server_name']) . $server_port . preg_replace('/^\/?(.*?)(\/)?$/', '$1', trim($config['script_path'])) . '/([^ \t\n\r<"\']+)#i'; + $match[] = '#(^|[\n ])' . $server_protocol . trim($config['server_name']) . $server_port . preg_replace('/^\/?(.*?)(\/)?$/', '$1', trim($config['script_path'])) . '(?:/[^ \t\n\r<"\']*)?)#i'; $replace[] = '$1'; // matches a xxxx://aaaaa.bbb.cccc. ... diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index f2bd4a4d6d..160a3ef6cf 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -590,6 +590,10 @@ class user extends session { foreach ($lang_set as $key => $lang_file) { + // Please do not delete this line. + // We have to force the type here, else [array] language inclusion will not work + $key = (string) $key; + if ($key == 'db') { $this->add_lang($lang_file, true, $use_help); diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 349d3a682a..880e6976c4 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -179,7 +179,9 @@ $lang += array( 'LOGIN_INFO' => 'In order to login you must be registered. Registering takes only a few seconds but gives you increased capabilies. The board administrator may also grant additional permissions to registered users. Before you login please ensure you are familiar with our terms of use and related policies. Please ensure you read any forum rules as you navigate around the board.', 'LOGIN_VIEWFORUM' => 'The board administrator requires you to be registered and logged in to view this forum.', 'LOGOUT_USER' => 'Logout [ %s ]', + 'LOG_DELETE_TOPIC' => 'Deleted topic
» %s', 'LOG_ME_IN' => 'Log me on automatically each visit', + 'LOG_USER_GENERAL' => '%s', 'MARK' => 'Mark', 'MARK_ALL' => 'Mark all', @@ -519,8 +521,6 @@ $unused = array( 'Inbox_size' => 'Your Inbox is %d%% full', 'Join_group' => 'Join Group', 'LOGOUT' => 'Logout', - 'LOG_DELETE_TOPIC' => 'Deleted topic
» %s', - 'LOG_USER_GENERAL' => '%s', 'Login_to_join' => 'Login to join or manage group memberships', 'Member_this_group' => 'You are a member of this group', 'Memberships_pending' => 'Memberships pending', diff --git a/phpBB/posting.php b/phpBB/posting.php index ef9a0d90ec..bf7ba6e293 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -125,7 +125,7 @@ if ($sql) $post_edit_locked = (int) $post_edit_locked; - $user->setup('posting', $forum_style); + $user->setup(array('posting', 'mcp'), $forum_style); if ($forum_password) { @@ -343,7 +343,7 @@ if ($mode == 'delete' && (($poster_id == $user->data['user_id'] && $user->data[' $template->assign_vars(array( 'MESSAGE_TITLE' => $user->lang['DELETE_MESSAGE'], - 'MESSAGE_TEXT' => $user->lang['CONFIRM_DELETE_POST'], + 'MESSAGE_TEXT' => $user->lang['DELETE_POST_CONFIRM'], 'S_CONFIRM_ACTION' => "posting.$phpEx$SID", 'S_HIDDEN_FIELDS' => $s_hidden_fields) diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 8f68986325..48f9152e4a 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -696,7 +696,7 @@ else // Container for user details, only process once $post_list = $user_cache = $id_cache = $attachments = $attach_list = $rowset = $update_count = $post_edit_list = array(); -$has_attachments = $display_notice = FALSE; +$has_attachments = $display_notice = false; $force_encoding = ''; $bbcode_bitfield = $i = $i_total = 0; @@ -1015,7 +1015,7 @@ if (count($attach_list)) } else { - $display_notice = TRUE; + $display_notice = true; } } @@ -1090,11 +1090,6 @@ for ($i = 0; $i < count($post_list); ++$i) } $user_cache[$poster_id]['sig'] = smilie_text($user_cache[$poster_id]['sig']); - - /*if (count($censors)) - { - $user_cache[$poster_id]['sig'] = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$censors['match'], \$censors['replace'], '\\0')", '>' . $user_cache[$poster_id]['sig'] . '<'), 1, -1)); - }*/ $user_cache[$poster_id]['sig'] = str_replace("\n", '
', censor_text($user_cache[$poster_id]['sig'])); $user_cache[$poster_id]['sig_parsed'] = TRUE; } @@ -1129,11 +1124,6 @@ for ($i = 0; $i < count($post_list); ++$i) } // Replace naughty words such as farty pants -/* if (sizeof($censors)) - { - $row['post_subject'] = preg_replace($censors['match'], $censors['replace'], $row['post_subject']); - $message = str_replace('\"', '"', substr(preg_replace('#(\>(((?>([^><]+|(?R)))*)\<))#se', "preg_replace(\$censors['match'], \$censors['replace'], '\\0')", '>' . $message . '<'), 1, -1)); - }*/ $row['post_subject'] = censor_text($row['post_subject']); $message = str_replace("\n", '
', censor_text($message)); @@ -1192,19 +1182,26 @@ for ($i = 0; $i < count($post_list); ++$i) $tpl = display_attachments(NULL, $tpl, $update_count, false, true); $tpl_size = sizeof($tpl); + $unset_tpl = array(); + $message = preg_replace_callback('#(.*?)#', create_function('$matches', ' - global $tpl, $user, $config, $tpl_size; + global $tpl, $user, $config, $tpl_size, $unset_tpl; // Flip index if we are displaying the reverse way $index = ($config["display_order"]) ? ($tpl_size-($matches[1] + 1)) : $matches[1]; $return = (isset($tpl[$index])) ? $tpl[$index] : sprintf($user->lang["MISSING_INLINE_ATTACHMENT"], $matches[0]); - unset($tpl[$index]); + $unset_tpl[] = $index; return $return; '), $message); unset($tpl, $tpl_size); + + foreach (array_unique($unset_tpl) as $index) + { + unset($attachments[$row['post_id']][$index]); + } } // Dump vars into template