aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions.php2
-rw-r--r--phpBB/includes/functions_content.php30
-rw-r--r--phpBB/includes/functions_download.php3
-rw-r--r--phpBB/includes/mcp/mcp_warn.php24
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php2
5 files changed, 40 insertions, 21 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 72c0d458c6..8e3f62230a 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2401,6 +2401,7 @@ function redirect($url, $return = false, $disable_cd_check = false)
echo '<html dir="' . $user->lang['DIRECTION'] . '" lang="' . $user->lang['USER_LANG'] . '">';
echo '<head>';
echo '<meta charset="utf-8">';
+ echo '<meta http-equiv="X-UA-Compatible" content="IE=edge">';
echo '<meta http-equiv="refresh" content="0; url=' . str_replace('&', '&amp;', $url) . '" />';
echo '<title>' . $user->lang['REDIRECT'] . '</title>';
echo '</head>';
@@ -3997,6 +3998,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
echo '<html dir="ltr">';
echo '<head>';
echo '<meta charset="utf-8">';
+ echo '<meta http-equiv="X-UA-Compatible" content="IE=edge">';
echo '<title>' . $msg_title . '</title>';
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; } ';
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php
index 36d7dfc03c..e05fcb0586 100644
--- a/phpBB/includes/functions_content.php
+++ b/phpBB/includes/functions_content.php
@@ -1036,17 +1036,8 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
unset($new_attachment_data);
}
- // Sort correctly
- if ($config['display_order'])
- {
- // Ascending sort
- krsort($attachments);
- }
- else
- {
- // Descending sort
- ksort($attachments);
- }
+ // Make sure attachments are properly ordered
+ ksort($attachments);
foreach ($attachments as $attachment)
{
@@ -1285,8 +1276,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
$attachments = $compiled_attachments;
unset($compiled_attachments);
- $tpl_size = sizeof($attachments);
-
$unset_tpl = array();
preg_match_all('#<!\-\- ia([0-9]+) \-\->(.*?)<!\-\- ia\1 \-\->#', $message, $matches, PREG_PATTERN_ORDER);
@@ -1294,8 +1283,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
$replace = array();
foreach ($matches[0] as $num => $capture)
{
- // Flip index if we are displaying the reverse way
- $index = ($config['display_order']) ? ($tpl_size-($matches[1][$num] + 1)) : $matches[1][$num];
+ $index = $matches[1][$num];
$replace['from'][] = $matches[0][$num];
$replace['to'][] = (isset($attachments[$index])) ? $attachments[$index] : sprintf($user->lang['MISSING_INLINE_ATTACHMENT'], $matches[2][array_search($index, $matches[1])]);
@@ -1310,6 +1298,18 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
$unset_tpl = array_unique($unset_tpl);
+ // Sort correctly
+ if ($config['display_order'])
+ {
+ // Ascending sort
+ krsort($attachments);
+ }
+ else
+ {
+ // Descending sort
+ ksort($attachments);
+ }
+
// Needed to let not display the inlined attachments at the end of the post again
foreach ($unset_tpl as $index)
{
diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php
index 254e65ae3d..2c5cba2c0d 100644
--- a/phpBB/includes/functions_download.php
+++ b/phpBB/includes/functions_download.php
@@ -108,6 +108,7 @@ function wrap_img_in_html($src, $title)
echo '<html>';
echo '<head>';
echo '<meta charset="utf-8">';
+ echo '<meta http-equiv="X-UA-Compatible" content="IE=edge">';
echo '<title>' . $title . '</title>';
echo '</head>';
echo '<body>';
@@ -412,7 +413,7 @@ function set_modified_headers($stamp, $browser)
global $request;
// let's see if we have to send the file at all
- $last_load = $request->header('Modified-Since') ? strtotime(trim($request->header('Modified-Since'))) : false;
+ $last_load = $request->header('If-Modified-Since') ? strtotime(trim($request->header('If-Modified-Since'))) : false;
if (strpos(strtolower($browser), 'msie 6.0') === false && !phpbb_is_greater_ie_version($browser, 7))
{
diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php
index d724b8703b..33c898ffc2 100644
--- a/phpBB/includes/mcp/mcp_warn.php
+++ b/phpBB/includes/mcp/mcp_warn.php
@@ -530,12 +530,28 @@ function add_warning($user_row, $warning, $send_pm = true, $post_id = 0)
include_once($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx);
- $user_row['user_lang'] = (file_exists($phpbb_root_path . 'language/' . $user_row['user_lang'] . "/mcp.$phpEx")) ? $user_row['user_lang'] : $config['default_lang'];
- include($phpbb_root_path . 'language/' . basename($user_row['user_lang']) . "/mcp.$phpEx");
+ // Attempt to translate warning to language of user being warned if user's language differs from issuer's language
+ if ($user_row['user_lang'] != $user->lang_name)
+ {
+ $lang = array();
+
+ $user_row['user_lang'] = (file_exists($phpbb_root_path . 'language/' . basename($user_row['user_lang']) . "/mcp." . $phpEx)) ? $user_row['user_lang'] : $config['default_lang'];
+ include($phpbb_root_path . 'language/' . basename($user_row['user_lang']) . "/mcp." . $phpEx);
+
+ $warn_pm_subject = $lang['WARNING_PM_SUBJECT'];
+ $warn_pm_body = sprintf($lang['WARNING_PM_BODY'], $warning);
+
+ unset($lang);
+ }
+ else
+ {
+ $warn_pm_subject = $user->lang('WARNING_PM_SUBJECT');
+ $warn_pm_body = $user->lang('WARNING_PM_BODY', $warning);
+ }
$message_parser = new parse_message();
- $message_parser->message = $user->lang('WARNING_PM_BODY', $warning);
+ $message_parser->message = $warn_pm_body;
$message_parser->parse(true, true, true, false, false, true, true);
$pm_data = array(
@@ -553,7 +569,7 @@ function add_warning($user_row, $warning, $send_pm = true, $post_id = 0)
'address_list' => array('u' => array($user_row['user_id'] => 'to')),
);
- submit_pm('post', $user->lang('WARNING_PM_SUBJECT'), $pm_data, false);
+ submit_pm('post', $warn_pm_subject, $pm_data, false);
}
add_log('admin', 'LOG_USER_WARNING', $user_row['username']);
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index 8b7d42e9c9..aae80b0c06 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -154,7 +154,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
'S_SHOW_PM_BOX' => true,
'S_ALLOW_MASS_PM' => ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) ? true : false,
'S_GROUP_OPTIONS' => ($config['allow_mass_pm'] && $auth->acl_get('u_masspm_group')) ? $group_options : '',
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=searchuser&amp;form=postform&amp;field=username_list&amp;select_single=$select_single"),
+ 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=searchuser&amp;form=postform&amp;field=username_list&amp;select_single=" . (int) $select_single),
));
}