diff options
Diffstat (limited to 'phpBB')
85 files changed, 254 insertions, 291 deletions
diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index 5576098cef..95539bd45d 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -148,14 +148,14 @@ function adm_page_header($page_title) 'ICON_SYNC_DISABLED' => '<img src="' . $phpbb_admin_path . 'images/icon_sync_disabled.gif" alt="' . $user->lang['RESYNC'] . '" title="' . $user->lang['RESYNC'] . '" />', 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'], - 'S_CONTENT_ENCODING' => $user->lang['ENCODING'], + 'S_CONTENT_ENCODING' => 'UTF-8', 'S_CONTENT_DIR_LEFT' => $user->lang['LEFT'], 'S_CONTENT_DIR_RIGHT' => $user->lang['RIGHT']) ); - if (!empty($config['send_encoding'])) + if ($config['send_encoding']) { - header('Content-type: text/html; charset: ' . $user->lang['ENCODING']); + header('Content-type: text/html; charset=UTF-8'); } header('Cache-Control: private, no-cache="set-cookie"'); header('Expires: 0'); diff --git a/phpBB/common.php b/phpBB/common.php index f5e81ad1a6..ccebe5de2e 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -178,6 +178,7 @@ require($phpbb_root_path . 'includes/auth.' . $phpEx); require($phpbb_root_path . 'includes/functions.' . $phpEx); require($phpbb_root_path . 'includes/constants.' . $phpEx); require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx); +require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); // Set PHP error handler to ours set_error_handler('msg_handler'); diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 2e40616b17..98a4e14740 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1220,7 +1220,6 @@ function get_schema_struct() 'post_subject' => array('XSTEXT_UNI', ''), 'post_text' => array('MTEXT_UNI', ''), 'post_checksum' => array('VCHAR:32', ''), - 'post_encoding' => array('VCHAR:20', 'iso-8859-1'), 'post_attachment' => array('BOOL', 0), 'bbcode_bitfield' => array('VCHAR:252', ''), 'bbcode_uid' => array('VCHAR:5', ''), @@ -1259,7 +1258,6 @@ function get_schema_struct() 'message_text' => array('MTEXT_UNI', ''), 'message_edit_reason' => array('STEXT_UNI', ''), 'message_edit_user' => array('UINT', 0), - 'message_encoding' => array('VCHAR:20', 'iso-8859-1'), 'message_attachment' => array('BOOL', 0), 'bbcode_bitfield' => array('VCHAR:252', ''), 'bbcode_uid' => array('VCHAR:5', ''), diff --git a/phpBB/includes/acp/acp_search.php b/phpBB/includes/acp/acp_search.php index b3caae028e..2ff1b778bb 100644 --- a/phpBB/includes/acp/acp_search.php +++ b/phpBB/includes/acp/acp_search.php @@ -320,7 +320,7 @@ class acp_search } else { - $sql = 'SELECT post_id, post_subject, post_text, post_encoding, poster_id, forum_id + $sql = 'SELECT post_id, post_subject, post_text, poster_id, forum_id FROM ' . POSTS_TABLE . ' WHERE post_id >= ' . (int) ($post_counter + 1) . ' AND post_id < ' . (int) ($post_counter + $this->batch_size); @@ -328,7 +328,7 @@ class acp_search while ($row = $db->sql_fetchrow($result)) { - $this->search->index('post', $row['post_id'], $row['post_text'], $row['post_subject'], $row['post_encoding'], $row['poster_id'], $row['forum_id']); + $this->search->index('post', $row['post_id'], $row['post_text'], $row['post_subject'], $row['poster_id'], $row['forum_id']); } $db->sql_freeresult($result); diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php index 3446513e19..44bbcb4eb3 100644 --- a/phpBB/includes/db/firebird.php +++ b/phpBB/includes/db/firebird.php @@ -355,7 +355,7 @@ class dbal_firebird extends dbal */ function sql_escape($msg) { - return (@ini_get('magic_quotes_sybase') || strtolower(@ini_get('magic_quotes_sybase')) == 'on') ? str_replace('\\\'', '\'', addslashes($msg)) : str_replace('\'', '\'\'', stripslashes($msg)); + return (@ini_get('magic_quotes_sybase') == 1 || strtolower(@ini_get('magic_quotes_sybase')) == 'on') ? str_replace('\\\'', '\'', addslashes($msg)) : str_replace('\'', '\'\'', stripslashes($msg)); } /** diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 4aa4f4a2c0..d7a594eeeb 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -24,14 +24,26 @@ function set_var(&$result, $var, $type, $multibyte = false) if ($type == 'string') { - $result = trim(htmlspecialchars(str_replace(array("\r\n", "\r"), array("\n", "\n"), $result))); - $result = (STRIP) ? stripslashes($result) : $result; + $result = trim(htmlspecialchars(str_replace(array("\r\n", "\r"), array("\n", "\n"), $result), ENT_QUOTES, 'UTF-8')); - // Check for possible multibyte characters to save a preg_replace call if nothing is in there... - if ($multibyte && strpos($result, '&#') !== false) + if (!empty($result)) { - $result = preg_replace('#&(\#[0-9]+;)#', '&\1', $result); + // Make sure multibyte characters are wellformed + if ($multibyte) + { + if (!preg_match('/^./u', $result)) + { + $result = ''; + } + } + else + { + // no multibyte, allow only ASCII (0-127) + $result = preg_replace('/[\x80-\xFF]/', '?', $result); + } } + + $result = (STRIP) ? stripslashes($result) : $result; } } @@ -2039,7 +2051,7 @@ function get_context($text, $words, $length = 400) // find the starting indizes of all words foreach ($words as $word) { - if (preg_match('#(?: |^)(' . str_replace('\*', '\w*?', preg_quote($word, '#')) . ')(?: |$)#i', $text, $match)) + if (preg_match('#(?:[^\w]|^)(' . str_replace('\*', '\w*?', preg_quote($word, '#')) . ')(?:[^\w]|$)#i', $text, $match)) { $pos = strpos($text, $match[1]); if ($pos !== false) @@ -2363,6 +2375,12 @@ function parse_inline_attachments(&$text, &$attachments, &$update_count, $forum_ { global $config, $user; + if (!function_exists('display_attachments')) + { + global $phpbb_root_path, $phpEx; + include_once("{$phpbb_root_path}includes/functions_display.$phpEx"); + } + $attachments = display_attachments($forum_id, NULL, $attachments, $update_count, false, true); $tpl_size = sizeof($attachments); @@ -3143,7 +3161,7 @@ function page_header($page_title = '', $display_online_list = true) 'S_USER_BROWSER' => (isset($user->data['session_browser'])) ? $user->data['session_browser'] : $user->lang['UNKNOWN_BROWSER'], 'S_USERNAME' => $user->data['username'], 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'], - 'S_CONTENT_ENCODING' => $user->lang['ENCODING'], + 'S_CONTENT_ENCODING' => 'UTF-8', 'S_CONTENT_DIR_LEFT' => $user->lang['LEFT'], 'S_CONTENT_DIR_RIGHT' => $user->lang['RIGHT'], 'S_TIMEZONE' => ($user->data['user_dst'] || ($user->data['user_id'] == ANONYMOUS && $config['board_dst'])) ? sprintf($user->lang['ALL_TIMES'], $user->lang['tz'][$tz], $user->lang['tz']['dst']) : sprintf($user->lang['ALL_TIMES'], $user->lang['tz'][$tz], ''), @@ -3164,7 +3182,7 @@ function page_header($page_title = '', $display_online_list = true) 'T_ICONS_PATH' => "{$phpbb_root_path}{$config['icons_path']}/", 'T_RANKS_PATH' => "{$phpbb_root_path}{$config['ranks_path']}/", 'T_UPLOAD_PATH' => "{$phpbb_root_path}{$config['upload_path']}/", - 'T_STYLESHEET_LINK' => (!$user->theme['theme_storedb']) ? "{$phpbb_root_path}styles/" . $user->theme['theme_path'] . '/theme/stylesheet.css' : "{$phpbb_root_path}style.$phpEx?sid=$user->session_id&id=" . $user->theme['style_id'], + 'T_STYLESHEET_LINK' => (!$user->theme['theme_storedb']) ? "{$phpbb_root_path}styles/" . $user->theme['theme_path'] . '/theme/stylesheet.css' : "{$phpbb_root_path}style.$phpEx?sid=$user->session_id&id=" . $user->theme['style_id'] . '&lang=' . $user->data['user_lang'], 'T_STYLESHEET_NAME' => $user->theme['theme_name'], 'T_THEME_DATA' => (!$user->theme['theme_storedb']) ? '' : $user->theme['theme_data'], @@ -3173,7 +3191,7 @@ function page_header($page_title = '', $display_online_list = true) if ($config['send_encoding']) { - header('Content-type: text/html; charset=' . $user->lang['ENCODING']); + header('Content-type: text/html; charset=UTF-8'); } header('Cache-Control: private, no-cache="set-cookie"'); header('Expires: 0'); diff --git a/phpBB/includes/functions_jabber.php b/phpBB/includes/functions_jabber.php index 96d2e686e4..9efe17dc6b 100644 --- a/phpBB/includes/functions_jabber.php +++ b/phpBB/includes/functions_jabber.php @@ -25,7 +25,6 @@ */ class jabber { - var $encoding; var $server; var $port; var $username; @@ -68,8 +67,6 @@ class jabber $this->packet_queue = $this->subscription_queue = array(); $this->iq_sleep_timer = $this->delay_disconnect = 1; - $this->encoding = 'UTF-8'; - $this->returned_keep_alive = true; $this->txnid = 0; @@ -454,7 +451,6 @@ class jabber } $this->_array_xmlspecialchars($content); - $this->_array_conv_utf8($content); $xml = "<message to='$to' type='$type' id='$id'>\n"; @@ -795,69 +791,6 @@ class jabber $string = str_replace(array('&', '>', '<', '"', '\''), array('&', '>', '<', '"', '''), $string); } - /** - * Recursively converts all elements in an array to UTF-8 from the encoding stored in {@link encoding the encoding attribute}. - * @access private - */ - function _array_conv_utf8(&$array) - { - // no need to do anything if the encoding already is UTF-8 - if (strtoupper($this->encoding) == 'UTF-8') - { - return true; - } - - if (is_array($array)) - { - foreach ($array as $k => $v) - { - if (is_array($v)) - { - $this->_array_conv_utf8($array[$k]); - } - else - { - $this->_conv_utf8($array[$k]); - } - } - } - } - - /** - * Converts a string to utf8 encoding. - * - * @param string $string has to have the same encoding as {@link encoding the encoding attribute} is set to. - * - * @return boolean True on success, false on failure. - * - * @access private - */ - function _conv_utf8(&$string) - { - // no need to do anything if the encoding already is UTF-8 - if (strtoupper($this->encoding) == 'UTF-8') - { - return true; - } - - // first try iconv then mb_convert_encoding and as a last fall back try recode_string - if (function_exists('iconv') && (($string = iconv($this->encoding, 'UTF-8', $string)) !== false)) - { - return true; - } - elseif (function_exists('mb_convert_encoding') && (($string = mb_convert_encoding($string, 'UTF-8', $this->encoding)) !== false)) - { - return true; - } - elseif (function_exists('recode_string') && (($string = recode_string($this->encoding . '..UTF-8', $string)) !== false)) - { - return true; - } - - // if everything fails we will just have to live with what we have, good luck! - return false; - } - // ====================================================================== // <message/> parsers // ====================================================================== diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index d8dfb2837e..d5d9c8dd5e 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -14,7 +14,7 @@ */ class messenger { - var $vars, $msg, $extra_headers, $replyto, $from, $subject, $encoding; + var $vars, $msg, $extra_headers, $replyto, $from, $subject; var $addresses = array(); var $mail_priority = MAIL_NORMAL_PRIORITY; @@ -45,7 +45,7 @@ class messenger function reset() { $this->addresses = array(); - $this->vars = $this->msg = $this->extra_headers = $this->replyto = $this->from = $this->encoding = ''; + $this->vars = $this->msg = $this->extra_headers = $this->replyto = $this->from = ''; $this->mail_priority = MAIL_NORMAL_PRIORITY; } @@ -221,16 +221,6 @@ class messenger $this->subject = (($this->subject != '') ? $this->subject : $user->lang['NO_SUBJECT']); } - if (preg_match('#^(Charset:(.*?))$#m', $this->msg, $match)) - { - $this->encoding = (trim($match[2]) != '') ? trim($match[2]) : trim($user->lang['ENCODING']); - $drop_header .= '[\r\n]*?' . preg_quote($match[1], '#'); - } - else - { - $this->encoding = trim($user->lang['ENCODING']); - } - if ($drop_header) { $this->msg = trim(preg_replace('#' . $drop_header . '#s', '', $this->msg)); @@ -324,7 +314,7 @@ class messenger foreach ($address_ary as $which_ary) { - $$type .= (($$type != '') ? ', ' : '') . (($which_ary['name'] != '') ? '"' . mail_encode($which_ary['name'], $this->encoding) . '" <' . $which_ary['email'] . '>' : $which_ary['email']); + $$type .= (($$type != '') ? ', ' : '') . (($which_ary['name'] != '') ? '"' . mail_encode($which_ary['name']) . '" <' . $which_ary['email'] . '>' : $which_ary['email']); } } @@ -348,7 +338,7 @@ class messenger $headers .= "MIME-Version: 1.0\n"; $headers .= 'Message-ID: <' . md5(unique_id(time())) . "@" . $config['server_name'] . ">\n"; $headers .= 'Date: ' . gmdate('D, d M Y H:i:s T', time()) . "\n"; - $headers .= "Content-type: text/plain; charset={$this->encoding}\n"; + $headers .= "Content-type: text/plain; charset=UTF-8\n"; $headers .= "Content-transfer-encoding: 8bit\n"; $headers .= "X-Priority: {$this->mail_priority}\n"; $headers .= 'X-MSMail-Priority: ' . (($this->mail_priority == MAIL_LOW_PRIORITY) ? 'Low' : (($this->mail_priority == MAIL_NORMAL_PRIORITY) ? 'Normal' : 'High')) . "\n"; @@ -357,7 +347,7 @@ class messenger $headers .= "X-phpBB-Origin: phpbb://" . str_replace(array('http://', 'https://'), array('', ''), generate_board_url()) . "\n"; $headers .= ($this->extra_headers != '') ? $this->extra_headers : ''; - // Send message ... removed $this->encode() from subject for time being + // Send message ... if (!$use_queue) { $mail_to = ($to == '') ? 'Undisclosed-Recipient:;' : $to; @@ -365,7 +355,7 @@ class messenger if ($config['smtp_delivery']) { - $result = smtpmail($this->addresses, $this->subject, wordwrap($this->msg), $err_msg, $this->encoding, $headers); + $result = smtpmail($this->addresses, $this->subject, wordwrap($this->msg), $err_msg, $headers); } else { @@ -387,7 +377,6 @@ class messenger 'addresses' => $this->addresses, 'subject' => $this->subject, 'msg' => $this->msg, - 'encoding' => $this->encoding, 'headers' => $headers) ); } @@ -435,7 +424,6 @@ class messenger $this->jabber->username = $config['jab_username']; $this->jabber->password = $config['jab_password']; $this->jabber->resource = ($config['jab_resource']) ? $config['jab_resource'] : ''; - $this->jabber->encoding = $this->encoding; if (!$this->jabber->connect()) { @@ -607,7 +595,7 @@ class queue $err_msg = ''; $to = (!$to) ? 'Undisclosed-Recipient:;' : $to; - $result = ($config['smtp_delivery']) ? smtpmail($addresses, $subject, wordwrap($msg), $err_msg, $encoding, $headers) : @$config['email_function_name']($to, $subject, implode("\n", preg_split("/\r?\n/", wordwrap($msg))), $headers); + $result = ($config['smtp_delivery']) ? smtpmail($addresses, $subject, wordwrap($msg), $err_msg, $headers) : @$config['email_function_name']($to, $subject, implode("\n", preg_split("/\r?\n/", wordwrap($msg))), $headers); if (!$result) { @@ -739,7 +727,7 @@ class queue /** * Replacement or substitute for PHP's mail command */ -function smtpmail($addresses, $subject, $message, &$err_msg, $encoding, $headers = '') +function smtpmail($addresses, $subject, $message, &$err_msg, $headers = '') { global $config, $user; @@ -794,7 +782,7 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $encoding, $headers { foreach ($addresses['to'] as $which_ary) { - $mail_to[] = ($which_ary['name'] != '') ? mail_encode(trim($which_ary['name']), $encoding) . ' <' . trim($which_ary['email']) . '>' : '<' . trim($which_ary['email']) . '>'; + $mail_to[] = ($which_ary['name'] != '') ? mail_encode(trim($which_ary['name'])) . ' <' . trim($which_ary['email']) . '>' : '<' . trim($which_ary['email']) . '>'; $mail_rcpt['to'][] = '<' . trim($which_ary['email']) . '>'; } } @@ -811,7 +799,7 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $encoding, $headers { foreach ($addresses['cc'] as $which_ary) { - $mail_cc[] = ($which_ary['name'] != '') ? mail_encode(trim($which_ary['name']), $encoding) . ' <' . trim($which_ary['email']) . '>' : '<' . trim($which_ary['email']) . '>'; + $mail_cc[] = ($which_ary['name'] != '') ? mail_encode(trim($which_ary['name'])) . ' <' . trim($which_ary['email']) . '>' : '<' . trim($which_ary['email']) . '>'; $mail_rcpt['cc'][] = '<' . trim($which_ary['email']) . '>'; } } @@ -1363,12 +1351,12 @@ class smtp_class } /** -* Encodes the given string for proper display for this encoding ... nabbed +* Encodes the given string for proper display in UTF-8 ... nabbed * from php.net and modified. There is an alternative encoding method which * may produce less output but it's questionable as to its worth in this -* scenario IMO +* scenario. */ -function mail_encode($str, $encoding) +function mail_encode($str) { if ($encoding == '') { @@ -1377,7 +1365,7 @@ function mail_encode($str, $encoding) // define start delimimter, end delimiter and spacer $end = "?="; - $start = "=?$encoding?B?"; + $start = "=?UTF-8?B?"; $spacer = "$end\r\n $start"; // determine length of encoded text within chunks and ensure length is even diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 4a46dc1062..1518f1d1e5 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1414,7 +1414,6 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u 'post_subject' => $subject, 'post_text' => $data['message'], 'post_checksum' => $data['message_md5'], - 'post_encoding' => $user->lang['ENCODING'], 'post_attachment' => (sizeof($data['attachment_data'])) ? 1 : 0, 'bbcode_bitfield' => $data['bbcode_bitfield'], 'bbcode_uid' => $data['bbcode_uid'], @@ -1468,7 +1467,6 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u 'post_edit_reason' => $data['post_edit_reason'], 'post_edit_user' => (int) $data['post_edit_user'], 'post_checksum' => $data['message_md5'], - 'post_encoding' => $user->lang['ENCODING'], 'post_attachment' => (sizeof($data['attachment_data'])) ? 1 : 0, 'bbcode_bitfield' => $data['bbcode_bitfield'], 'bbcode_uid' => $data['bbcode_uid'], @@ -1911,7 +1909,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u trigger_error($error); } - $search->index($mode, $data['post_id'], $data['message'], $subject, $user->lang['ENCODING'], $poster_id, ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id']); + $search->index($mode, $data['post_id'], $data['message'], $subject, $poster_id, ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id']); } $db->sql_transaction('commit'); diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 94b6368493..1f53dc4511 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1323,7 +1323,6 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr 'enable_sig' => $data['enable_sig'], 'message_subject' => $subject, 'message_text' => $data['message'], - 'message_encoding' => $user->lang['ENCODING'], 'message_attachment'=> (sizeof($data['attachment_data'])) ? 1 : 0, 'bbcode_bitfield' => $data['bbcode_bitfield'], 'bbcode_uid' => $data['bbcode_uid'], @@ -1342,7 +1341,6 @@ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = tr 'enable_sig' => $data['enable_sig'], 'message_subject' => $subject, 'message_text' => $data['message'], - 'message_encoding' => $user->lang['ENCODING'], 'message_attachment'=> (sizeof($data['attachment_data'])) ? 1 : 0, 'bbcode_bitfield' => $data['bbcode_bitfield'], 'bbcode_uid' => $data['bbcode_uid'] diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index fe1047db79..2d298a4108 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -893,7 +893,6 @@ function mcp_fork_topic($topic_ids) 'post_edit_reason' => (string) $row['post_edit_reason'], 'post_edit_user' => (int) $row['post_edit_user'], 'post_checksum' => (string) $row['post_checksum'], - 'post_encoding' => (string) $row['post_encoding'], 'post_attachment' => (int) $row['post_attachment'], 'bbcode_bitfield' => $row['bbcode_bitfield'], 'bbcode_uid' => (string) $row['bbcode_uid'], diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 4a9a57df34..f4bf0d9eaf 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -561,7 +561,7 @@ class fulltext_mysql extends search_backend * * @param string $mode contains the post mode: edit, post, reply, quote ... */ - function index($mode, $post_id, &$message, &$subject, $encoding, $poster_id, $forum_id) + function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id) { global $db; diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index 90da8abcd1..1dcb599718 100755 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -56,10 +56,6 @@ class fulltext_native extends search_backend { include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx); } - if (!function_exists('utf8_strlen')) - { - include($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); - } $error = false; @@ -86,47 +82,89 @@ class fulltext_native extends search_backend { global $db, $config, $user; - // Clean up the query search - $match = array( - // Replace multiple spaces with a single space - '# +#', + $keywords = trim($this->cleanup($keywords, '+-|()*')); - // Strip spaces after: +-|( - '#([+\\-|(]) #', + // allow word|word|word without brackets + if ((strpos($keywords, ' ') === false) && (strpos($keywords, '|') !== false) && (strpos($keywords, '(') === false)) + { + $keywords = '(' . $keywords . ')'; + } - // Strip spaces before: |*) - '# ([|*)])#', + $open_bracket = $space = false; + for ($i = 0, $n = strlen($keywords); $i < $n; $i++) + { + if ($open_bracket !== false) + { + switch ($keywords[$i]) + { + case ')': + if ($open_bracket + 1 == $i) + { + $keywords[$i - 1] = '|'; + $keywords[$i] = '|'; + } + $open_bracket = false; + break; + case '(': + $keywords[$i] = '|'; + break; + case '+': + case '-': + case ' ': + $keywords[$i] = '|'; + break; + } + } + else + { + switch ($keywords[$i]) + { + case ')': + $keywords[$i] = ' '; + break; + case '(': + $open_bracket = $i; + break; + case '|': + $keywords[$i] = ' '; + break; + case '-': + case '+': + $space = $keywords[$i]; + break; + case ' ': + if ($space !== false) + { + $keywords[$i] = $space; + } + break; + default: + $space = false; + } + } + } - // Make word|word|word work without brackets - '#^[^()]*\\|[^()]*$#', + if ($open_bracket) + { + $keywords .= ')'; + } - // Remove nested brackets - '#(\\([^()]*)(?=\\()#', - '#\\)([^()]*)(?=\\))#', + $match = array( + '# +#', + '#\|\|+#', + '#(\+|\-)(?:\+|\-)+#', + '#\(\|#', + '#\|\)#', ); - $replace = array( ' ', + '|', '$1', - '$1', - '($0)', - '$1)', - '$1', + '(', + ')', ); - $keywords = trim(preg_replace($match, $replace, $this->cleanup($keywords, '+-|()*', $user->lang['ENCODING']))); - - // remove some useless bracket combinations which might be created by the previous regexps - $keywords = str_replace(array('()', ')|('), array('', '|'), $keywords); - - $keywords = preg_replace_callback( - '#\((?:(?:[^)]*?) )*?[^)]*?\)#', - create_function( - '$matches', - 'return str_replace(" ", "|", $matches[0]);' - ), - $keywords - ); + $keywords = preg_replace($match, $replace, $keywords); // $keywords input format: each word seperated by a space, words in a bracket are not seperated @@ -143,7 +181,7 @@ class fulltext_native extends search_backend } // set the search_query which is shown to the user - $this->search_query = utf8_encode_ncr($keywords, ENT_QUOTES); + $this->search_query = $keywords; $exact_words = array(); preg_match_all('#([^\\s+\\-|*()]+)(?:$|[\\s+\\-|()])#', $keywords, $exact_words); @@ -224,6 +262,11 @@ class fulltext_native extends search_backend $mode = 'must_contain'; } + if (empty($word)) + { + continue; + } + // if this is an array of words then retrieve an id for each if (is_array($word)) { @@ -255,7 +298,7 @@ class fulltext_native extends search_backend // throw an error if we shall not ignore unexistant words else if (!$ignore_no_id) { - trigger_error(sprintf($user->lang['WORDS_IN_NO_POST'], utf8_encode_ncr(implode(', ', $word)))); + trigger_error(sprintf($user->lang['WORDS_IN_NO_POST'], implode(', ', $word))); } } // else we only need one id @@ -273,7 +316,7 @@ class fulltext_native extends search_backend // throw an error if we shall not ignore unexistant words else if (!$ignore_no_id) { - trigger_error(sprintf($user->lang['WORD_IN_NO_POST'], utf8_encode_ncr($word))); + trigger_error(sprintf($user->lang['WORD_IN_NO_POST'], $word)); } } @@ -558,9 +601,16 @@ class fulltext_native extends search_backend case 'mysql': case 'mysql4': case 'mysqli': - $sql_array['SELECT'] = 'SQL_CALC_FOUND_ROWS ' . $sql_array['SELECT']; - $is_mysql = true; - break; + // 3.x does not support SQL_CALC_FOUND_ROWS + if (SQL_LAYER != 'mysql' || $db->sql_server_info[6] != '3') + { + $sql_array['SELECT'] = 'SQL_CALC_FOUND_ROWS ' . $sql_array['SELECT']; + $is_mysql = true; + + // that's everything for MySQL >= 4.0 + break; + } + // no break for MySQL 3.x case 'sqlite': $sql_array_count['SELECT'] = ($type == 'posts') ? 'DISTINCT p.post_id' : 'DISTINCT p.topic_id'; @@ -871,7 +921,7 @@ class fulltext_native extends search_backend * * NOTE: duplicates are NOT removed from the return array * - * @param string $text Text to split, encoded in user's encoding + * @param string $text Text to split, encoded in UTF-8 * @return array Array of UTF-8 words * * @access private @@ -899,7 +949,7 @@ class fulltext_native extends search_backend /** * Clean up the string, remove HTML tags, remove BBCodes */ - $word = strtok($this->cleanup(preg_replace($match, ' ', strip_tags($text)), -1, $user->lang['ENCODING']), ' '); + $word = strtok($this->cleanup(preg_replace($match, ' ', strip_tags($text)), -1), ' '); while (isset($word[0])) { @@ -952,13 +1002,12 @@ class fulltext_native extends search_backend * @param int $post_id The id of the post which is modified/created * @param string $message New or updated post content * @param string $subject New or updated post subject - * @param string $encoding The post content's encoding * @param int $poster_id Post author's user id * @param int $forum_id The id of the forum in which the post is located * * @access public */ - function index($mode, $post_id, &$message, &$subject, $encoding, $poster_id, $forum_id) + function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id) { global $config, $db, $user; @@ -1104,22 +1153,6 @@ class fulltext_native extends search_backend } /** - * Used by index() to sort strings by string length, longest first - */ - function strlencmp($a, $b) - { - $len_a = strlen($a); - $len_b = strlen($b); - - if ($len_a == $len_b) - { - return 0; - } - - return ($len_a > $len_b) ? -1 : 1; - } - - /** * Removes entries from the wordmatch table for the specified post_ids */ function index_remove($post_ids, $author_ids, $forum_ids) @@ -1278,7 +1311,7 @@ class fulltext_native extends search_backend * @param string $encoding Text encoding * @return string Cleaned up text, only alphanumeric chars are left */ - function cleanup($text, $allowed_chars = null, $encoding = 'iso-8859-1') + function cleanup($text, $allowed_chars = null, $encoding = 'utf-8') { global $phpbb_root_path, $phpEx; static $conv = array(), $conv_loaded = array(); @@ -1537,7 +1570,7 @@ class fulltext_native extends search_backend // These are fields required in the config table return array( 'tpl' => $tpl, - 'config' => array('fulltext_native_load_upd' => 'bool', 'fulltext_native_min_chars' => 'integer:0:252', 'fulltext_native_max_chars' => 'integer:0:252') + 'config' => array('fulltext_native_load_upd' => 'bool', 'fulltext_native_min_chars' => 'integer:0:252', 'fulltext_native_max_chars' => 'integer:0:255') ); } } diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index ff8df44148..60ed5dc360 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -61,7 +61,7 @@ class ucp_prefs $var_ary = array( 'dateformat' => array('string', false, 3, 30), - 'lang' => array('match', false, '#^[a-z_\-]{2,}$#i'), + 'lang' => array('match', false, '#^[a-z0-9_\-]{2,}$#i'), 'tz' => array('num', false, -14, 14), ); diff --git a/phpBB/includes/utf/utf_tools.php b/phpBB/includes/utf/utf_tools.php index 2f7c8de69a..a4de83ab0f 100644 --- a/phpBB/includes/utf/utf_tools.php +++ b/phpBB/includes/utf/utf_tools.php @@ -741,7 +741,7 @@ function utf8_recode($string, $encoding) */ function utf8_encode_ncr($text) { - return preg_replace_callback('#[\\xC2-\\xF4][\\x80-\\xBF]+#', 'utf8_encode_ncr_callback', $text); + return preg_replace_callback('#[\\xC2-\\xF4][\\x80-\\xBF]?[\\x80-\\xBF]?[\\x80-\\xBF]+#', 'utf8_encode_ncr_callback', $text); } /** diff --git a/phpBB/index.php b/phpBB/index.php index af72cc0be1..442a94c34c 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -54,7 +54,7 @@ $db->sql_freeresult($result); $birthday_list = ''; if ($config['load_birthdays']) { - $now = getdate(time() + $user->timezone + $user->dst); + $now = getdate(time() + $user->timezone + $user->dst - (date('H', time()) - gmdate('H', time())) * 3600); $sql = 'SELECT user_id, username, user_colour, user_birthday FROM ' . USERS_TABLE . " WHERE user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%' diff --git a/phpBB/install/index.php b/phpBB/install/index.php index 6668416c7d..ee8ec90fdf 100755 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -320,16 +320,13 @@ class module 'T_IMAGE_PATH' => $phpbb_root_path . 'adm/images/', 'S_CONTENT_DIRECTION' => $lang['DIRECTION'], - 'S_CONTENT_ENCODING' => $lang['ENCODING'], + 'S_CONTENT_ENCODING' => 'UTF-8', 'S_CONTENT_DIR_LEFT' => $lang['LEFT'], 'S_CONTENT_DIR_RIGHT' => $lang['RIGHT'], ) ); - if (!empty($lang['ENCODING'])) - { - header('Content-type: text/html; charset: ' . $lang['ENCODING']); - } + header('Content-type: text/html; charset=UTF-8'); header('Cache-Control: private, no-cache="set-cookie"'); header('Expires: 0'); header('Pragma: no-cache'); diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index 10fb3ea574..25dd4dcf33 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -640,7 +640,6 @@ CREATE TABLE phpbb_posts ( post_subject BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, post_text BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, post_checksum VARCHAR(32) DEFAULT '' NOT NULL, - post_encoding VARCHAR(20) DEFAULT 'iso-8859-1' NOT NULL, post_attachment INTEGER DEFAULT 0 NOT NULL, bbcode_bitfield VARCHAR(252) DEFAULT '' NOT NULL, bbcode_uid VARCHAR(5) DEFAULT '' NOT NULL, @@ -689,7 +688,6 @@ CREATE TABLE phpbb_privmsgs ( message_text BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, message_edit_reason BLOB SUB_TYPE TEXT DEFAULT '' NOT NULL, message_edit_user INTEGER DEFAULT 0 NOT NULL, - message_encoding VARCHAR(20) DEFAULT 'iso-8859-1' NOT NULL, message_attachment INTEGER DEFAULT 0 NOT NULL, bbcode_bitfield VARCHAR(252) DEFAULT '' NOT NULL, bbcode_uid VARCHAR(5) DEFAULT '' NOT NULL, diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 64652762d5..5f2f889e57 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -751,7 +751,6 @@ CREATE TABLE [phpbb_posts] ( [post_subject] [nvarchar] (1000) DEFAULT ('') NOT NULL , [post_text] [ntext] DEFAULT ('') NOT NULL , [post_checksum] [varchar] (32) DEFAULT ('') NOT NULL , - [post_encoding] [varchar] (20) DEFAULT ('iso-8859-1') NOT NULL , [post_attachment] [int] DEFAULT (0) NOT NULL , [bbcode_bitfield] [varchar] (252) DEFAULT ('') NOT NULL , [bbcode_uid] [varchar] (5) DEFAULT ('') NOT NULL , @@ -811,7 +810,6 @@ CREATE TABLE [phpbb_privmsgs] ( [message_text] [ntext] DEFAULT ('') NOT NULL , [message_edit_reason] [nvarchar] (3000) DEFAULT ('') NOT NULL , [message_edit_user] [int] DEFAULT (0) NOT NULL , - [message_encoding] [varchar] (20) DEFAULT ('iso-8859-1') NOT NULL , [message_attachment] [int] DEFAULT (0) NOT NULL , [bbcode_bitfield] [varchar] (252) DEFAULT ('') NOT NULL , [bbcode_uid] [varchar] (5) DEFAULT ('') NOT NULL , diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index d71cf7c5d9..f2be2243a2 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -438,7 +438,6 @@ CREATE TABLE phpbb_posts ( post_subject text DEFAULT '' NOT NULL, post_text mediumtext DEFAULT '' NOT NULL, post_checksum varchar(32) DEFAULT '' NOT NULL, - post_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL, post_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, bbcode_bitfield varchar(252) DEFAULT '' NOT NULL, bbcode_uid varchar(5) DEFAULT '' NOT NULL, @@ -475,7 +474,6 @@ CREATE TABLE phpbb_privmsgs ( message_text mediumtext DEFAULT '' NOT NULL, message_edit_reason text DEFAULT '' NOT NULL, message_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - message_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL, message_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, bbcode_bitfield varchar(252) DEFAULT '' NOT NULL, bbcode_uid varchar(5) DEFAULT '' NOT NULL, diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index 8fda313642..593980ea9b 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -438,7 +438,6 @@ CREATE TABLE phpbb_posts ( post_subject text DEFAULT '' NOT NULL, post_text mediumtext DEFAULT '' NOT NULL, post_checksum varchar(32) DEFAULT '' NOT NULL, - post_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL, post_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, bbcode_bitfield varchar(252) DEFAULT '' NOT NULL, bbcode_uid varchar(5) DEFAULT '' NOT NULL, @@ -475,7 +474,6 @@ CREATE TABLE phpbb_privmsgs ( message_text mediumtext DEFAULT '' NOT NULL, message_edit_reason text DEFAULT '' NOT NULL, message_edit_user mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - message_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL, message_attachment tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, bbcode_bitfield varchar(252) DEFAULT '' NOT NULL, bbcode_uid varchar(5) DEFAULT '' NOT NULL, diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 74c37acacd..adc86f7b26 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -848,7 +848,6 @@ CREATE TABLE phpbb_posts ( post_subject varchar2(1000) DEFAULT '' , post_text clob DEFAULT '' , post_checksum varchar2(32) DEFAULT '' , - post_encoding varchar2(20) DEFAULT 'iso-8859-1' NOT NULL, post_attachment number(1) DEFAULT '0' NOT NULL, bbcode_bitfield varchar2(252) DEFAULT '' , bbcode_uid varchar2(5) DEFAULT '' , @@ -911,7 +910,6 @@ CREATE TABLE phpbb_privmsgs ( message_text clob DEFAULT '' , message_edit_reason varchar2(3000) DEFAULT '' , message_edit_user number(8) DEFAULT '0' NOT NULL, - message_encoding varchar2(20) DEFAULT 'iso-8859-1' NOT NULL, message_attachment number(1) DEFAULT '0' NOT NULL, bbcode_bitfield varchar2(252) DEFAULT '' , bbcode_uid varchar2(5) DEFAULT '' , diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index 147df5875b..a4e71e8acf 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -606,7 +606,6 @@ CREATE TABLE phpbb_posts ( post_subject varchar(1000) DEFAULT '' NOT NULL, post_text TEXT DEFAULT '' NOT NULL, post_checksum varchar(32) DEFAULT '' NOT NULL, - post_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL, post_attachment INT2 DEFAULT '0' NOT NULL CHECK (post_attachment >= 0), bbcode_bitfield varchar(252) DEFAULT '' NOT NULL, bbcode_uid varchar(5) DEFAULT '' NOT NULL, @@ -647,7 +646,6 @@ CREATE TABLE phpbb_privmsgs ( message_text TEXT DEFAULT '' NOT NULL, message_edit_reason varchar(3000) DEFAULT '' NOT NULL, message_edit_user INT4 DEFAULT '0' NOT NULL CHECK (message_edit_user >= 0), - message_encoding varchar(20) DEFAULT 'iso-8859-1' NOT NULL, message_attachment INT2 DEFAULT '0' NOT NULL CHECK (message_attachment >= 0), bbcode_bitfield varchar(252) DEFAULT '' NOT NULL, bbcode_uid varchar(5) DEFAULT '' NOT NULL, diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 6750113dce..adbffb4d0e 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -425,7 +425,6 @@ CREATE TABLE phpbb_posts ( post_subject text(65535) NOT NULL DEFAULT '', post_text mediumtext(16777215) NOT NULL DEFAULT '', post_checksum varchar(32) NOT NULL DEFAULT '', - post_encoding varchar(20) NOT NULL DEFAULT 'iso-8859-1', post_attachment INTEGER UNSIGNED NOT NULL DEFAULT '0', bbcode_bitfield varchar(252) NOT NULL DEFAULT '', bbcode_uid varchar(5) NOT NULL DEFAULT '', @@ -461,7 +460,6 @@ CREATE TABLE phpbb_privmsgs ( message_text mediumtext(16777215) NOT NULL DEFAULT '', message_edit_reason text(65535) NOT NULL DEFAULT '', message_edit_user INTEGER UNSIGNED NOT NULL DEFAULT '0', - message_encoding varchar(20) NOT NULL DEFAULT 'iso-8859-1', message_attachment INTEGER UNSIGNED NOT NULL DEFAULT '0', bbcode_bitfield varchar(252) NOT NULL DEFAULT '', bbcode_uid varchar(5) NOT NULL DEFAULT '', diff --git a/phpBB/language/en/acp/attachments.php b/phpBB/language/en/acp/attachments.php index 407de35837..2b25e0b0aa 100644 --- a/phpBB/language/en/acp/attachments.php +++ b/phpBB/language/en/acp/attachments.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows diff --git a/phpBB/language/en/acp/ban.php b/phpBB/language/en/acp/ban.php index 60b1035028..cc9d184d57 100644 --- a/phpBB/language/en/acp/ban.php +++ b/phpBB/language/en/acp/ban.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows diff --git a/phpBB/language/en/acp/email.php b/phpBB/language/en/acp/email.php index 73f061c1db..097909b9a4 100644 --- a/phpBB/language/en/acp/email.php +++ b/phpBB/language/en/acp/email.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows diff --git a/phpBB/language/en/acp/forums.php b/phpBB/language/en/acp/forums.php index 3c72dc688b..89848d4b24 100644 --- a/phpBB/language/en/acp/forums.php +++ b/phpBB/language/en/acp/forums.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows diff --git a/phpBB/language/en/acp/groups.php b/phpBB/language/en/acp/groups.php index 03c02b97fc..1e8dfa3f59 100644 --- a/phpBB/language/en/acp/groups.php +++ b/phpBB/language/en/acp/groups.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows diff --git a/phpBB/language/en/acp/language.php b/phpBB/language/en/acp/language.php index 9aa8c06b9a..e735cd8dae 100644 --- a/phpBB/language/en/acp/language.php +++ b/phpBB/language/en/acp/language.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows diff --git a/phpBB/language/en/acp/modules.php b/phpBB/language/en/acp/modules.php index b5055570c1..0eefb59753 100644 --- a/phpBB/language/en/acp/modules.php +++ b/phpBB/language/en/acp/modules.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows diff --git a/phpBB/language/en/acp/permissions.php b/phpBB/language/en/acp/permissions.php index 07ee227486..089e157707 100644 --- a/phpBB/language/en/acp/permissions.php +++ b/phpBB/language/en/acp/permissions.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows diff --git a/phpBB/language/en/acp/permissions_phpbb.php b/phpBB/language/en/acp/permissions_phpbb.php index 8577210862..4d550965a5 100644 --- a/phpBB/language/en/acp/permissions_phpbb.php +++ b/phpBB/language/en/acp/permissions_phpbb.php @@ -19,7 +19,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows diff --git a/phpBB/language/en/acp/posting.php b/phpBB/language/en/acp/posting.php index 457e65444e..a6c1f0aad8 100644 --- a/phpBB/language/en/acp/posting.php +++ b/phpBB/language/en/acp/posting.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows diff --git a/phpBB/language/en/acp/profile.php b/phpBB/language/en/acp/profile.php index cf40fd1e3d..229b93591a 100644 --- a/phpBB/language/en/acp/profile.php +++ b/phpBB/language/en/acp/profile.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows diff --git a/phpBB/language/en/acp/prune.php b/phpBB/language/en/acp/prune.php index 71f4169fbb..0788eb4fdc 100644 --- a/phpBB/language/en/acp/prune.php +++ b/phpBB/language/en/acp/prune.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows diff --git a/phpBB/language/en/acp/search.php b/phpBB/language/en/acp/search.php index ab6e55a0d4..9766729f35 100644 --- a/phpBB/language/en/acp/search.php +++ b/phpBB/language/en/acp/search.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows diff --git a/phpBB/language/en/acp/styles.php b/phpBB/language/en/acp/styles.php index abf3685cf0..9b875d28ab 100644 --- a/phpBB/language/en/acp/styles.php +++ b/phpBB/language/en/acp/styles.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows diff --git a/phpBB/language/en/acp/users.php b/phpBB/language/en/acp/users.php index 3f36325ab5..70e1520e0b 100644 --- a/phpBB/language/en/acp/users.php +++ b/phpBB/language/en/acp/users.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index b0fb089d2b..717064b936 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang)) // DEVELOPERS PLEASE NOTE // +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. +// // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows // translators to re-order the output of data while ensuring it remains correct @@ -30,7 +32,6 @@ if (empty($lang) || !is_array($lang)) $lang = array_merge($lang, array( 'TRANSLATION_INFO' => '', - 'ENCODING' => 'iso-8859-1', 'DIRECTION' => 'ltr', 'LEFT' => 'left', 'RIGHT' => 'right', diff --git a/phpBB/language/en/email/admin_activate.txt b/phpBB/language/en/email/admin_activate.txt index ea0af53880..04c8275491 100644 --- a/phpBB/language/en/email/admin_activate.txt +++ b/phpBB/language/en/email/admin_activate.txt @@ -1,5 +1,4 @@ Subject: New user account -Charset: iso-8859-1 Hello, diff --git a/phpBB/language/en/email/admin_send_email.txt b/phpBB/language/en/email/admin_send_email.txt index 5fd5592f7c..b778496258 100644 --- a/phpBB/language/en/email/admin_send_email.txt +++ b/phpBB/language/en/email/admin_send_email.txt @@ -1,4 +1,3 @@ -Charset: iso-8859-1 The following is an email sent to you by an administrator of "{SITENAME}". If this message is spam, contains abusive or other comments you find offensive please contact the webmaster of the board at the following address: diff --git a/phpBB/language/en/email/admin_welcome_activated.txt b/phpBB/language/en/email/admin_welcome_activated.txt index 3b7aa48362..abd1391df8 100644 --- a/phpBB/language/en/email/admin_welcome_activated.txt +++ b/phpBB/language/en/email/admin_welcome_activated.txt @@ -1,5 +1,4 @@ Subject: Account Activated -Charset: iso-8859-1 Hello {USERNAME}, diff --git a/phpBB/language/en/email/admin_welcome_inactive.txt b/phpBB/language/en/email/admin_welcome_inactive.txt index 905e71696b..a9cd4e5db0 100644 --- a/phpBB/language/en/email/admin_welcome_inactive.txt +++ b/phpBB/language/en/email/admin_welcome_inactive.txt @@ -1,5 +1,4 @@ Subject: Welcome to {SITENAME} Forums -Charset: iso-8859-1 {WELCOME_MSG} diff --git a/phpBB/language/en/email/coppa_resend_inactive.txt b/phpBB/language/en/email/coppa_resend_inactive.txt index d65367e31b..8c8b8795ce 100644 --- a/phpBB/language/en/email/coppa_resend_inactive.txt +++ b/phpBB/language/en/email/coppa_resend_inactive.txt @@ -1,5 +1,4 @@ Subject: Welcome to {SITENAME} Forums -Charset: iso-8859-1 {WELCOME_MSG} diff --git a/phpBB/language/en/email/coppa_welcome_inactive.txt b/phpBB/language/en/email/coppa_welcome_inactive.txt index 4aac4ce5bd..71431a2712 100644 --- a/phpBB/language/en/email/coppa_welcome_inactive.txt +++ b/phpBB/language/en/email/coppa_welcome_inactive.txt @@ -1,5 +1,4 @@ Subject: Welcome to {SITENAME} Forums -Charset: iso-8859-1 {WELCOME_MSG} diff --git a/phpBB/language/en/email/email_notify.txt b/phpBB/language/en/email/email_notify.txt index 0543165627..4f65f17566 100644 --- a/phpBB/language/en/email/email_notify.txt +++ b/phpBB/language/en/email/email_notify.txt @@ -1,5 +1,4 @@ Subject: {SITENAME} - Email a friend -Charset: iso-8859-1 Hello {TO_USERNAME}, diff --git a/phpBB/language/en/email/forum_notify.txt b/phpBB/language/en/email/forum_notify.txt index af9e9e3bab..e69046f921 100644 --- a/phpBB/language/en/email/forum_notify.txt +++ b/phpBB/language/en/email/forum_notify.txt @@ -1,5 +1,4 @@ Subject: Forum Post Notification - {FORUM_NAME} -Charset: iso-8859-1 Hello {USERNAME}, diff --git a/phpBB/language/en/email/group_added.txt b/phpBB/language/en/email/group_added.txt index 4f07fdb9cd..e2a6d22ec0 100644 --- a/phpBB/language/en/email/group_added.txt +++ b/phpBB/language/en/email/group_added.txt @@ -1,5 +1,4 @@ Subject: You have been added to this usergroup -Charset: iso-8859-1 Congratulations, diff --git a/phpBB/language/en/email/group_approved.txt b/phpBB/language/en/email/group_approved.txt index b2134f86f9..bc31d88b3e 100644 --- a/phpBB/language/en/email/group_approved.txt +++ b/phpBB/language/en/email/group_approved.txt @@ -1,5 +1,4 @@ Subject: Your request has been approved -Charset: iso-8859-1 Congratulations, diff --git a/phpBB/language/en/email/group_request.txt b/phpBB/language/en/email/group_request.txt index 7b51823067..5b6bbcb33f 100644 --- a/phpBB/language/en/email/group_request.txt +++ b/phpBB/language/en/email/group_request.txt @@ -1,5 +1,4 @@ Subject: A request to join your group has been made -Charset: iso-8859-1 Dear {USERNAME}, diff --git a/phpBB/language/en/email/installed.txt b/phpBB/language/en/email/installed.txt index b69e9189ae..cb6944ceef 100644 --- a/phpBB/language/en/email/installed.txt +++ b/phpBB/language/en/email/installed.txt @@ -1,5 +1,4 @@ Subject: phpBB Installed -Charset: iso-8859-1 Congratulations, diff --git a/phpBB/language/en/email/newtopic_notify.txt b/phpBB/language/en/email/newtopic_notify.txt index 93c62fe9e2..3a7dd72a11 100644 --- a/phpBB/language/en/email/newtopic_notify.txt +++ b/phpBB/language/en/email/newtopic_notify.txt @@ -1,5 +1,4 @@ Subject: New Topic Notification - {FORUM_NAME} -Charset: iso-8859-1 Hello {USERNAME}, diff --git a/phpBB/language/en/email/post_approved.txt b/phpBB/language/en/email/post_approved.txt index 3d7c4902c5..5b39c9a236 100644 --- a/phpBB/language/en/email/post_approved.txt +++ b/phpBB/language/en/email/post_approved.txt @@ -1,5 +1,4 @@ Subject: Post Approved - {POST_SUBJECT} -Charset: iso-8859-1 Hello {USERNAME}, diff --git a/phpBB/language/en/email/post_disapproved.txt b/phpBB/language/en/email/post_disapproved.txt index c6055cb28e..6004abd0df 100644 --- a/phpBB/language/en/email/post_disapproved.txt +++ b/phpBB/language/en/email/post_disapproved.txt @@ -1,5 +1,4 @@ Subject: Post Disapproved - {POST_SUBJECT} -Charset: iso-8859-1 Hello {USERNAME}, diff --git a/phpBB/language/en/email/privmsg_notify.txt b/phpBB/language/en/email/privmsg_notify.txt index 7dae75ecc9..731a7a3ecb 100644 --- a/phpBB/language/en/email/privmsg_notify.txt +++ b/phpBB/language/en/email/privmsg_notify.txt @@ -1,5 +1,4 @@ Subject: New Private Message has arrived -Charset: iso-8859-1 Hello {USERNAME}, diff --git a/phpBB/language/en/email/profile_send_email.txt b/phpBB/language/en/email/profile_send_email.txt index 00dcde1e46..5dd8fd0e9c 100644 --- a/phpBB/language/en/email/profile_send_email.txt +++ b/phpBB/language/en/email/profile_send_email.txt @@ -1,4 +1,3 @@ -Charset: iso-8859-1 Hello {TO_USERNAME}, diff --git a/phpBB/language/en/email/profile_send_im.txt b/phpBB/language/en/email/profile_send_im.txt index 5220bdd906..d2fea692a0 100644 --- a/phpBB/language/en/email/profile_send_im.txt +++ b/phpBB/language/en/email/profile_send_im.txt @@ -1,4 +1,3 @@ -Charset: iso-8859-1 Hello {TO_USERNAME}, diff --git a/phpBB/language/en/email/report_closed.txt b/phpBB/language/en/email/report_closed.txt index 7da2026fb3..9880aaadeb 100644 --- a/phpBB/language/en/email/report_closed.txt +++ b/phpBB/language/en/email/report_closed.txt @@ -1,5 +1,4 @@ Subject: Report Closed - {POST_SUBJECT} -Charset: iso-8859-1 Hello {USERNAME}, diff --git a/phpBB/language/en/email/report_deleted.txt b/phpBB/language/en/email/report_deleted.txt index 9fed2a590f..9a851ff980 100644 --- a/phpBB/language/en/email/report_deleted.txt +++ b/phpBB/language/en/email/report_deleted.txt @@ -1,5 +1,4 @@ Subject: Report Closed - {POST_SUBJECT} -Charset: iso-8859-1 Hello {USERNAME}, diff --git a/phpBB/language/en/email/topic_approved.txt b/phpBB/language/en/email/topic_approved.txt index 28927b5a29..371017fb80 100644 --- a/phpBB/language/en/email/topic_approved.txt +++ b/phpBB/language/en/email/topic_approved.txt @@ -1,5 +1,4 @@ Subject: Topic Approved - {TOPIC_TITLE} -Charset: iso-8859-1 Hello {USERNAME}, diff --git a/phpBB/language/en/email/topic_disapproved.txt b/phpBB/language/en/email/topic_disapproved.txt index 52c1578861..52aea1a60b 100644 --- a/phpBB/language/en/email/topic_disapproved.txt +++ b/phpBB/language/en/email/topic_disapproved.txt @@ -1,5 +1,4 @@ Subject: Topic Disapproved - {TOPIC_TITLE} -Charset: iso-8859-1 Hello {USERNAME}, diff --git a/phpBB/language/en/email/topic_notify.txt b/phpBB/language/en/email/topic_notify.txt index 274fe0995a..d5ea583ebe 100644 --- a/phpBB/language/en/email/topic_notify.txt +++ b/phpBB/language/en/email/topic_notify.txt @@ -1,5 +1,4 @@ Subject: Topic Reply Notification - {TOPIC_TITLE} -Charset: iso-8859-1 Hello {USERNAME}, diff --git a/phpBB/language/en/email/user_activate.txt b/phpBB/language/en/email/user_activate.txt index 0adeb5bff2..7d7960c4c5 100644 --- a/phpBB/language/en/email/user_activate.txt +++ b/phpBB/language/en/email/user_activate.txt @@ -1,5 +1,4 @@ Subject: Reactivate your account -Charset: iso-8859-1 Hello {USERNAME}, diff --git a/phpBB/language/en/email/user_activate_inactive.txt b/phpBB/language/en/email/user_activate_inactive.txt index 439437940f..cbef5c780c 100644 --- a/phpBB/language/en/email/user_activate_inactive.txt +++ b/phpBB/language/en/email/user_activate_inactive.txt @@ -1,5 +1,4 @@ Subject: Your account has been deactivated -Charset: iso-8859-1 Hello {USERNAME}, diff --git a/phpBB/language/en/email/user_activate_passwd.txt b/phpBB/language/en/email/user_activate_passwd.txt index 0c2adc82ec..019ee963f7 100644 --- a/phpBB/language/en/email/user_activate_passwd.txt +++ b/phpBB/language/en/email/user_activate_passwd.txt @@ -1,5 +1,4 @@ Subject: New password activation -Charset: iso-8859-1 Hello {USERNAME} diff --git a/phpBB/language/en/email/user_remind_inactive.txt b/phpBB/language/en/email/user_remind_inactive.txt index be0cf3e76b..806f9f3a63 100644 --- a/phpBB/language/en/email/user_remind_inactive.txt +++ b/phpBB/language/en/email/user_remind_inactive.txt @@ -1,5 +1,4 @@ Subject: Inactive account reminder -Charset: iso-8859-1 Hello {USERNAME}, diff --git a/phpBB/language/en/email/user_resend_inactive.txt b/phpBB/language/en/email/user_resend_inactive.txt index bc4dd02d2d..29393323a4 100644 --- a/phpBB/language/en/email/user_resend_inactive.txt +++ b/phpBB/language/en/email/user_resend_inactive.txt @@ -1,5 +1,4 @@ Subject: Welcome to {SITENAME} Forums -Charset: iso-8859-1 {WELCOME_MSG} diff --git a/phpBB/language/en/email/user_welcome.txt b/phpBB/language/en/email/user_welcome.txt index 42dc56df3b..963be09048 100644 --- a/phpBB/language/en/email/user_welcome.txt +++ b/phpBB/language/en/email/user_welcome.txt @@ -1,5 +1,4 @@ Subject: Welcome to {SITENAME} Forums -Charset: iso-8859-1 {WELCOME_MSG} diff --git a/phpBB/language/en/email/user_welcome_inactive.txt b/phpBB/language/en/email/user_welcome_inactive.txt index 6ece2d4faf..726abf4d60 100644 --- a/phpBB/language/en/email/user_welcome_inactive.txt +++ b/phpBB/language/en/email/user_welcome_inactive.txt @@ -1,5 +1,4 @@ Subject: Welcome to {SITENAME} Forums -Charset: iso-8859-1 {WELCOME_MSG} diff --git a/phpBB/language/en/groups.php b/phpBB/language/en/groups.php index 07b566f3fe..8bdf31168c 100644 --- a/phpBB/language/en/groups.php +++ b/phpBB/language/en/groups.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows diff --git a/phpBB/language/en/help_bbcode.php b/phpBB/language/en/help_bbcode.php index aa6f8d8463..afdd8226f6 100644 --- a/phpBB/language/en/help_bbcode.php +++ b/phpBB/language/en/help_bbcode.php @@ -13,7 +13,9 @@ /** */ -// DEVELOPERS PLEASE NOTE +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows diff --git a/phpBB/language/en/help_faq.php b/phpBB/language/en/help_faq.php index 31d9a8f5fd..e90db8a1de 100644 --- a/phpBB/language/en/help_faq.php +++ b/phpBB/language/en/help_faq.php @@ -13,7 +13,9 @@ /** */ -// DEVELOPERS PLEASE NOTE +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 90092804f7..6ffb4d9a2b 100755 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang)) // DEVELOPERS PLEASE NOTE // +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. +// // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows // translators to re-order the output of data while ensuring it remains correct diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php index 46c9b90418..bdb64075cc 100644 --- a/phpBB/language/en/mcp.php +++ b/phpBB/language/en/mcp.php @@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang)) // DEVELOPERS PLEASE NOTE // +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. +// // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows // translators to re-order the output of data while ensuring it remains correct diff --git a/phpBB/language/en/memberlist.php b/phpBB/language/en/memberlist.php index ec3f044785..08cc977111 100644 --- a/phpBB/language/en/memberlist.php +++ b/phpBB/language/en/memberlist.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index 05d58bb4b3..7623583d31 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows diff --git a/phpBB/language/en/search.php b/phpBB/language/en/search.php index 569c40a53d..b8aa018380 100644 --- a/phpBB/language/en/search.php +++ b/phpBB/language/en/search.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index db73d763e4..cf71cfb996 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang)) // DEVELOPERS PLEASE NOTE // +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. +// // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows // translators to re-order the output of data while ensuring it remains correct diff --git a/phpBB/language/en/viewforum.php b/phpBB/language/en/viewforum.php index 99d2d446d6..f995aa4d78 100644 --- a/phpBB/language/en/viewforum.php +++ b/phpBB/language/en/viewforum.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows diff --git a/phpBB/language/en/viewtopic.php b/phpBB/language/en/viewtopic.php index c4ab86796a..3f37d1b265 100644 --- a/phpBB/language/en/viewtopic.php +++ b/phpBB/language/en/viewtopic.php @@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang)) // DEVELOPERS PLEASE NOTE // +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. +// // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows // translators to re-order the output of data while ensuring it remains correct @@ -75,7 +77,6 @@ $lang = array_merge($lang, array( 'POLL_ENDED_AT' => 'Poll ended at %s', 'POLL_RUN_TILL' => 'Poll runs till %s', 'POLL_VOTED_OPTION' => 'You voted for this option', - 'POST_ENCODING' => 'This post by <strong>%1$s</strong> was made in a character set different to yours. %2$sView this post in its proper encoding%3$s.', 'PRINT_TOPIC' => 'Print view', 'QUICK_MOD' => 'Quick-mod tools', diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 63d1966623..9a0a7be418 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -1333,7 +1333,7 @@ function show_profile($data) if ($bday_year) { - $now = getdate(time() + $user->timezone + $user->dst); + $now = getdate(time() + $user->timezone + $user->dst - (date('H', time()) - gmdate('H', time())) * 3600); $diff = $now['mon'] - $bday_month; if ($diff == 0) diff --git a/phpBB/search.php b/phpBB/search.php index 7c82549b35..933072e4de 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -254,24 +254,23 @@ if ($keywords || $author || $author_id || $search_id || $submit) $sort_key = 't'; $sort_dir = 'd'; $sort_by_sql['t'] = 't.topic_last_post_time'; - $sql_sort = 'ORDER BY ' . $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC'); if (!$sort_days) { - $sort_days = 1; + $sort_days = 3; } gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); - $s_sort_key = $s_sort_dir = $u_sort_param = ''; + $s_sort_key = $s_sort_dir = ''; + $u_sort_param = 'st=' . $sort_days; $last_post_time = (time() - ($sort_days * 24 * 3600)); - $sql = 'SELECT DISTINCT t.topic_last_post_time, t.topic_id - FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t - WHERE p.post_time > $last_post_time + $sql = 'SELECT t.topic_last_post_time, t.topic_id + FROM ' . TOPICS_TABLE . " t + WHERE t.topic_last_post_time > $last_post_time AND t.topic_moved_id = 0 - AND p.topic_id = t.topic_id - $m_approve_fid_sql - " . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '') . ' + " . str_replace(array('p.', 'post_'), array('t.', 'topic_'), $m_approve_fid_sql) . ' + ' . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('t.forum_id', $ex_fid_ary, true) : '') . ' ORDER BY t.topic_last_post_time DESC'; $field = 'topic_id'; break; @@ -286,6 +285,15 @@ if ($keywords || $author || $author_id || $search_id || $submit) $sort_join = ($sort_key == 'f') ? FORUMS_TABLE . ' f, ' : ''; $sql_sort = ($sort_key == 'f') ? ' AND f.forum_id = p.forum_id ' . $sql_sort : $sql_sort; + if ($sort_days) + { + $last_post_time = 'AND p.post_time > ' . (time() - ($sort_days * 24 * 3600)); + } + else + { + $last_post_time = ''; + } + if ($show_results == 'posts') { if ($sort_key == 'a') @@ -298,6 +306,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) FROM $sort_join" . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t WHERE t.topic_replies = 0 AND p.topic_id = t.topic_id + $last_post_time $m_approve_fid_sql " . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '') . " $sql_sort"; @@ -310,6 +319,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) WHERE t.topic_replies = 0 AND t.topic_moved_id = 0 AND p.topic_id = t.topic_id + $last_post_time $m_approve_fid_sql " . ((sizeof($ex_fid_ary)) ? ' AND ' . $db->sql_in_set('p.forum_id', $ex_fid_ary, true) : '') . " $sql_sort"; @@ -325,10 +335,6 @@ if ($keywords || $author || $author_id || $search_id || $submit) $sort_by_sql['t'] = ($show_results == 'posts') ? 'p.post_time' : 't.topic_last_post_time'; $sql_sort = 'ORDER BY ' . $sort_by_sql[$sort_key] . (($sort_dir == 'a') ? ' ASC' : ' DESC'); - if (!$sort_days) - { - $sort_days = 1; - } gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param); $s_sort_key = $s_sort_dir = $u_sort_param = $s_limit_days = ''; @@ -935,6 +941,11 @@ while ($row = $db->sql_fetchrow($result)) $db->sql_freeresult($result); unset($pad_store); +if (!$s_forums) +{ + trigger_error($user->lang['NO_SEARCH']); +} + // Number of chars returned $s_characters = '<option value="-1">' . $user->lang['ALL_AVAILABLE'] . '</option>'; $s_characters .= '<option value="0">0</option>'; diff --git a/phpBB/styles/subSilver/template/viewtopic_body.html b/phpBB/styles/subSilver/template/viewtopic_body.html index 4236634522..9050f3109e 100644 --- a/phpBB/styles/subSilver/template/viewtopic_body.html +++ b/phpBB/styles/subSilver/template/viewtopic_body.html @@ -133,12 +133,6 @@ <td class="gensmall" colspan="2" height="25" align="center">{postrow.L_IGNORE_POST}</td> <!-- ELSE --> - <!-- IF postrow.FORCE_ENCODING --> - <td class="gensmall" colspan="2" height="25" align="center">{postrow.FORCE_ENCODING}</td> - </tr> - <!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> - <!-- ENDIF --> - <td align="center" valign="middle"><!-- IF postrow.S_FIRST_UNREAD --><a name="unread"></a><!-- ENDIF --><a name="p{postrow.POST_ID}"></a><b class="postauthor">{postrow.POSTER_NAME}</b></td> <td width="100%" height="25"> <table width="100%" cellspacing="0"> diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 62a5b822f9..a22aedf651 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -804,7 +804,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; -$bbcode_bitfield = $force_encoding = ''; +$bbcode_bitfield = ''; $i = $i_total = 0; // Go ahead and pull all data for this topic @@ -862,7 +862,7 @@ $sql = $db->sql_build_query('SELECT', array( $result = $db->sql_query($sql); -$now = getdate(time() + $user->timezone + $user->dst); +$now = getdate(time() + $user->timezone + $user->dst - (date('H', time()) - gmdate('H', time())) * 3600); // Posts are stored in the $rowset array while $attach_list, $user_cache // and the global bbcode_bitfield are built @@ -922,7 +922,6 @@ while ($row = $db->sql_fetchrow($result)) 'post_approved' => $row['post_approved'], 'post_reported' => $row['post_reported'], 'post_text' => $row['post_text'], - 'post_encoding' => $row['post_encoding'], 'bbcode_uid' => $row['bbcode_uid'], 'bbcode_bitfield' => $row['bbcode_bitfield'], 'enable_smilies' => $row['enable_smilies'], @@ -1238,10 +1237,6 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) continue; } - else if ($row['post_encoding'] != $user->lang['ENCODING'] && $view == 'encoding' && $post_id == $row['post_id']) - { - $force_encoding = $row['post_encoding']; - } // End signature parsing, only if needed if ($user_cache[$poster_id]['sig'] && empty($user_cache[$poster_id]['sig_parsed'])) @@ -1398,8 +1393,6 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'ONLINE_IMG' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? '' : (($user_cache[$poster_id]['online']) ? $user->img('icon_user_online', 'ONLINE') : $user->img('icon_user_offline', 'OFFLINE')), 'S_ONLINE' => ($poster_id == ANONYMOUS || !$config['load_onlinetrack']) ? false : (($user_cache[$poster_id]['online']) ? true : false), - 'FORCE_ENCODING' => ($row['post_encoding'] != $user->lang['ENCODING']) ? sprintf($user->lang['POST_ENCODING'], $row['poster'], '<a href="' . $viewtopic_url . "&p={$row['post_id']}&view=encoding#p{$row['post_id']}" . '">', '</a>') : '', - 'U_EDIT' => (($user->data['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id) && ($row['post_time'] > time() - ($config['edit_time'] * 60) || !$config['edit_time'])) || $auth->acl_get('m_edit', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f=$forum_id&p={$row['post_id']}") : '', 'U_QUOTE' => ($auth->acl_get('f_reply', $forum_id)) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=quote&f=$forum_id&p={$row['post_id']}") : '', 'U_INFO' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=post_details&f=$forum_id&p=" . $row['post_id'], true, $user->session_id) : '', @@ -1528,12 +1521,6 @@ else if (!$all_marked_read) } } -// Change encoding if appropriate -if ($force_encoding != '') -{ - $user->lang['ENCODING'] = $force_encoding; -} - // We overwrite $_REQUEST['f'] if there is no forum specified // to be able to display the correct online list. // One downside is that the user currently viewing this topic/post is not taken into account. |