From e9e5ccbfb9c1ea0a401a247a7bfe5d4916f80953 Mon Sep 17 00:00:00 2001 From: acydburn Date: Sat, 18 Apr 2009 15:09:19 +0000 Subject: [PATCH] Merge changes made in revisions #r9405 to #r9467 2009-04-18 git-svn-id: http://code.phpbb.com/svn/phpbb/trunk@9468 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/acp_database.html | 4 +-- phpBB/adm/style/acp_email.html | 2 +- phpBB/adm/style/acp_permissions.html | 30 +++++++++-------- phpBB/adm/style/acp_search.html | 10 ++++-- phpBB/adm/style/overall_header.html | 27 +++++++++------ phpBB/adm/style/simple_header.html | 13 ++++++-- phpBB/docs/FAQ.html | 8 ++--- phpBB/download/file.php | 5 +-- phpBB/includes/bbcode.php | 6 ++-- .../includes/captcha/plugins/captcha_abstract.php | 7 ++-- phpBB/includes/classes/session.php | 9 +++++ phpBB/includes/classes/template_compile.php | 8 ++--- phpBB/includes/classes/user.php | 2 +- phpBB/includes/constants.php | 2 +- phpBB/includes/core/system.php | 3 ++ phpBB/includes/functions_admin.php | 27 ++++++++++++--- phpBB/includes/functions_content.php | 2 +- phpBB/includes/functions_display.php | 2 +- phpBB/includes/functions_messenger.php | 19 ++++++----- phpBB/includes/functions_posting.php | 16 ++++++--- phpBB/includes/functions_privmsgs.php | 11 ++++-- phpBB/includes/functions_transfer.php | 39 ++++++++++++++++++++-- phpBB/includes/functions_upload.php | 39 ++++++++++++++++++++-- phpBB/includes/functions_user.php | 5 +-- phpBB/includes/message_parser.php | 6 +--- phpBB/includes/search/fulltext_mysql.php | 6 ++++ phpBB/includes/search/fulltext_native.php | 31 ++++++++++++++--- phpBB/install/database_update.php | 9 +++-- phpBB/install/schemas/schema_data.php | 3 +- phpBB/language/en/acp/board.php | 4 +-- phpBB/language/en/acp/permissions.php | 14 ++++---- phpBB/language/en/acp/search.php | 2 ++ phpBB/language/en/common.php | 8 +++-- phpBB/language/en/help_bbcode.php | 2 +- phpBB/language/en/posting.php | 2 +- phpBB/language/en/search.php | 2 ++ phpBB/language/en/ucp.php | 4 +-- phpBB/mcp.php | 7 ++++ phpBB/memberlist.php | 2 ++ phpBB/modules/acp/acp_database.php | 29 +++++++++++----- phpBB/modules/acp/acp_permissions.php | 4 +-- phpBB/modules/acp/acp_search.php | 2 ++ phpBB/modules/acp/acp_styles.php | 3 ++ phpBB/modules/acp/acp_users.php | 10 ++++++ phpBB/modules/ucp/ucp_main.php | 7 ++-- phpBB/modules/ucp/ucp_pm_compose.php | 8 ++--- phpBB/modules/ucp/ucp_pm_viewfolder.php | 4 +-- phpBB/posting.php | 3 +- phpBB/search.php | 7 ++-- phpBB/styles/prosilver/template/editor.js | 1 - phpBB/styles/prosilver/template/forum_fn.js | 11 ++++-- .../styles/prosilver/template/posting_editor.html | 2 +- .../prosilver/template/ucp_pm_viewmessage.html | 4 +-- .../styles/prosilver/template/viewforum_body.html | 2 +- .../styles/prosilver/template/viewtopic_body.html | 2 +- phpBB/styles/prosilver/theme/bidi.css | 5 ++- phpBB/styles/prosilver/theme/colours.css | 2 +- phpBB/styles/prosilver/theme/common.css | 2 +- phpBB/viewforum.php | 7 ++-- phpBB/viewonline.php | 2 +- phpBB/viewtopic.php | 15 +++++---- 61 files changed, 376 insertions(+), 154 deletions(-) diff --git a/phpBB/adm/style/acp_database.html b/phpBB/adm/style/acp_database.html index ebc76c36a..e839fb1bd 100644 --- a/phpBB/adm/style/acp_database.html +++ b/phpBB/adm/style/acp_database.html @@ -70,8 +70,8 @@
-
- +
+
diff --git a/phpBB/adm/style/acp_email.html b/phpBB/adm/style/acp_email.html index b1d9b4af1..885809ffe 100644 --- a/phpBB/adm/style/acp_email.html +++ b/phpBB/adm/style/acp_email.html @@ -44,7 +44,7 @@

-   +  

{S_FORM_TOKEN} diff --git a/phpBB/adm/style/acp_permissions.html b/phpBB/adm/style/acp_permissions.html index b4386d5f1..63583093b 100644 --- a/phpBB/adm/style/acp_permissions.html +++ b/phpBB/adm/style/acp_permissions.html @@ -3,7 +3,7 @@ - +

{L_ACP_PERMISSIONS}

{L_ACP_PERMISSIONS_EXPLAIN} @@ -12,10 +12,12 @@ + « {L_BACK} +

{L_TITLE}

{L_EXPLAIN}

- +

{L_FORUMS}: {FORUM_NAMES}

@@ -62,7 +64,7 @@ - + @@ -123,7 +125,7 @@
- +
{S_HIDDEN_FIELDS} {S_FORM_TOKEN} @@ -154,7 +156,7 @@
- +

{L_USERGROUPS}

@@ -168,7 +170,7 @@
- +
{S_HIDDEN_FIELDS} {S_FORM_TOKEN} @@ -177,7 +179,7 @@
- +
{L_ADD_GROUPS}
@@ -199,7 +201,7 @@
- +

{L_USERS}

@@ -210,7 +212,7 @@
- +
{S_HIDDEN_FIELDS} {S_FORM_TOKEN} @@ -240,7 +242,7 @@
- +

{L_USERGROUPS}

@@ -251,7 +253,7 @@
- +
{S_HIDDEN_FIELDS} {S_FORM_TOKEN} @@ -311,11 +313,11 @@ - +
{S_HIDDEN_FIELDS} {S_FORM_TOKEN} - {L_SELECT_TYPE}: + {L_SELECT_TYPE}:
@@ -347,7 +349,7 @@


- +
diff --git a/phpBB/adm/style/acp_search.html b/phpBB/adm/style/acp_search.html index 087978074..5fd7a23d9 100644 --- a/phpBB/adm/style/acp_search.html +++ b/phpBB/adm/style/acp_search.html @@ -33,6 +33,10 @@
+

{L_MAX_NUM_SEARCH_KEYWORDS_EXPLAIN}
+
+
+

{L_SEARCH_STORE_RESULTS_EXPLAIN}
{L_SECONDS}
@@ -130,9 +134,9 @@ - + - +

@@ -142,7 +146,7 @@

{S_FORM_TOKEN}
- + diff --git a/phpBB/adm/style/overall_header.html b/phpBB/adm/style/overall_header.html index adafc0aa6..93d72d520 100644 --- a/phpBB/adm/style/overall_header.html +++ b/phpBB/adm/style/overall_header.html @@ -28,9 +28,16 @@ function jumpto() { var page = prompt(jump_page, on_page); - if (page !== null && !isNaN(page) && page > 0) + if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0) { - document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page); + if (base_url.indexOf('?') == -1) + { + document.location.href = base_url + '?start=' + ((page - 1) * per_page); + } + else + { + document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page); + } } } @@ -71,7 +78,7 @@ function marklist(id, name, state) } var rb = parent.getElementsByTagName('input'); - + for (var r = 0; r < rb.length; r++) { if (rb[r].name.substr(0, name.length) == name) @@ -166,7 +173,7 @@ function switch_menu()

{L_ADMIN_INDEX}{L_FORUM_INDEX}

{L_SKIP}

- +
    @@ -180,31 +187,31 @@ function switch_menu()
    - +
    - +
    diff --git a/phpBB/adm/style/simple_header.html b/phpBB/adm/style/simple_header.html index 3e36c4798..e7d34c7ff 100644 --- a/phpBB/adm/style/simple_header.html +++ b/phpBB/adm/style/simple_header.html @@ -39,9 +39,16 @@ function jumpto() { var page = prompt(jump_page, on_page); - if (page !== null && !isNaN(page) && page > 0) + if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0) { - document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page); + if (base_url.indexOf('?') == -1) + { + document.location.href = base_url + '?start=' + ((page - 1) * per_page); + } + else + { + document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page); + } } } @@ -77,7 +84,7 @@ function marklist(id, name, state) } var rb = parent.getElementsByTagName('input'); - + for (var r = 0; r < rb.length; r++) { if (rb[r].name.substr(0, name.length) == name) diff --git a/phpBB/docs/FAQ.html b/phpBB/docs/FAQ.html index ee9242753..f91d4bc22 100644 --- a/phpBB/docs/FAQ.html +++ b/phpBB/docs/FAQ.html @@ -53,7 +53,7 @@
      -
    • I cannot install this it is too difficult! Will you do it?
    • +
    • I am finding phpBB too difficult to install. Will you do it for me?
    • I am having problems with the admin at a certain board, help!
    • A board has ripped off my graphics/software/etc., stop them!
    • A board is dealing in warez/porn/etc., you need to prevent them doing this!
    • @@ -62,7 +62,7 @@
    • I keep getting Mail sending errors when I (or my users) post/send PM's/etc.!
    • My users are complaining that emails are not in their selected language!
    • My AOL based users keep getting logged out!
    • -
    • No matter what I set the uploadable avatars to I cannot upload one from my computer!
    • +
    • I am unable to upload avatars from my computer, regardless of the settings.
    • I just cannot get gallery avatars to appear!
    • How do I use/set permissions?
    • I (or my users) cannot stay logged in to the forum!
    • @@ -78,7 +78,7 @@
      -

      I cannot install this it is too difficult! Will you do it?

      +

      I am finding phpBB too difficult to install. Will you do it for me?

      @@ -205,7 +205,7 @@ I want to sue you because i think you host an illegal board!
      -

      No matter what I set the uploadable avatars to I cannot upload one from my computer!

      +

      I am unable to upload avatars from my computer, regardless of the settings.

      diff --git a/phpBB/download/file.php b/phpBB/download/file.php index 61c108c62..dda6548e8 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -349,7 +349,7 @@ function send_avatar_to_browser($file, $browser) } else { - header('HTTP/1.0 404 not found'); + header('HTTP/1.0 404 Not Found'); } } @@ -631,8 +631,9 @@ function set_modified_headers($stamp, $browser) { if ($last_load !== false && $last_load <= $stamp) { - if (@php_sapi_name() === 'CGI') + if (substr(strtolower(@php_sapi_name()),0,3) === 'cgi') { + // in theory, we shouldn't need that due to php doing it. Reality offers a differing opinion, though header('Status: 304 Not Modified', true, 304); } else diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index d0cfd2f04..22aa43431 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -1,4 +1,4 @@ -bbcode_tpl($tpl)); diff --git a/phpBB/includes/captcha/plugins/captcha_abstract.php b/phpBB/includes/captcha/plugins/captcha_abstract.php index 621fea414..4f494b9c6 100644 --- a/phpBB/includes/captcha/plugins/captcha_abstract.php +++ b/phpBB/includes/captcha/plugins/captcha_abstract.php @@ -29,6 +29,8 @@ abstract class phpbb_default_captcha implements phpbb_captcha_plugin protected $type; protected $solved = false; + protected $min_chars = 4; + protected $max_chars = 7; function init($type) { @@ -46,7 +48,7 @@ abstract class phpbb_default_captcha implements phpbb_captcha_plugin function execute_demo() { - $this->code = gen_rand_string(mt_rand(5, 8)); + $this->code = gen_rand_string(mt_rand($this->min_chars, $this->max_chars)); $this->seed = hexdec(substr(unique_id(), 4, 10)); // compute $seed % 0x7fffffff @@ -188,10 +190,11 @@ abstract class phpbb_default_captcha implements phpbb_captcha_plugin */ protected function generate_code() { - $this->code = gen_rand_string(mt_rand(5, 8)); + $this->code = gen_rand_string(mt_rand($this->min_chars, $this->max_chars)); $this->confirm_id = md5(unique_id(phpbb::$user->ip)); $this->seed = hexdec(substr(unique_id(), 4, 10)); $this->solved = false; + // compute $seed % 0x7fffffff $this->seed -= 0x7fffffff * floor($this->seed / 0x7fffffff); diff --git a/phpBB/includes/classes/session.php b/phpBB/includes/classes/session.php index 05a2b60a6..ca54bae55 100644 --- a/phpBB/includes/classes/session.php +++ b/phpBB/includes/classes/session.php @@ -420,6 +420,15 @@ abstract class phpbb_session } } + // Something quite important: session_page always holds the *last* page visited, except for the *first* visit. + // We are not able to simply have an empty session_page btw, therefore we need to tell phpBB how to detect this special case. + // If the session id is empty, we have a completely new one and will set an "identifier" here. This identifier is able to be checked later. + if (empty($this->data['session_id'])) + { + // This is a temporary variable, only set for the very first visit + $this->data['session_created'] = true; + } + $this->session_id = $this->data['session_id'] = md5(phpbb::$security->unique_id()); $sql_ary['session_id'] = (string) $this->session_id; diff --git a/phpBB/includes/classes/template_compile.php b/phpBB/includes/classes/template_compile.php index 3f6f82f5d..098d8f481 100644 --- a/phpBB/includes/classes/template_compile.php +++ b/phpBB/includes/classes/template_compile.php @@ -187,8 +187,8 @@ class phpbb_template_filter extends php_user_filter $this->compile_language_tags($text_blocks); // This will handle the remaining root-level varrefs - $text_blocks = preg_replace('#\{([a-z0-9\-_]*)\}#is', "", $text_blocks); - $text_blocks = preg_replace('#\{\$([a-z0-9\-_]*)\}#is', "", $text_blocks); + $text_blocks = preg_replace('#\{([A-Z0-9\-_]+)\}#', "", $text_blocks); + $text_blocks = preg_replace('#\{\$([A-Z0-9\-_]+)\}#', "", $text_blocks); return $text_blocks; } @@ -201,14 +201,14 @@ class phpbb_template_filter extends php_user_filter // transform vars prefixed by L_ into their language variable pendant if nothing is set within the tpldata array if (strpos($text_blocks, '{L_') !== false) { - $text_blocks = preg_replace('#\{L_([a-z0-9\-_]*)\}#is', "", $text_blocks); + $text_blocks = preg_replace('#\{L_([A-Z0-9\-_]+)\}#', "", $text_blocks); } // Handle addslashed language variables prefixed with LA_ // If a template variable already exist, it will be used in favor of it... if (strpos($text_blocks, '{LA_') !== false) { - $text_blocks = preg_replace('#\{LA_([a-z0-9\-_]*)\}#is', "", $text_blocks); + $text_blocks = preg_replace('#\{LA_([A-Z0-9\-_]+)\}#', "", $text_blocks); } } diff --git a/phpBB/includes/classes/user.php b/phpBB/includes/classes/user.php index e060bcda5..83e8fce4e 100644 --- a/phpBB/includes/classes/user.php +++ b/phpBB/includes/classes/user.php @@ -953,7 +953,7 @@ class phpbb_user extends phpbb_session return $img_data; } - $img_data['src'] = PHPBB_ROOT_PATH . 'styles/' . $this->theme['imageset_path'] . '/imageset/' . ($this->img_array[$img]['image_lang'] ? $this->img_array[$img]['image_lang'] .'/' : '') . $this->img_array[$img]['image_filename']; + $img_data['src'] = PHPBB_ROOT_PATH . 'styles/' . rawurlencode($this->theme['imageset_path']) . '/imageset/' . ($this->img_array[$img]['image_lang'] ? $this->img_array[$img]['image_lang'] .'/' : '') . $this->img_array[$img]['image_filename']; $img_data['width'] = $this->img_array[$img]['image_width']; $img_data['height'] = $this->img_array[$img]['image_height']; } diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index f4863bd24..8fc06cb35 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -25,7 +25,7 @@ if (!defined('IN_PHPBB')) */ // phpBB Version -define('PHPBB_VERSION', '3.1.0-dev'); +define('PHPBB_VERSION', '3.1.0-dev1'); // QA-related // define('PHPBB_QA', 1); diff --git a/phpBB/includes/core/system.php b/phpBB/includes/core/system.php index 55dca1d31..5bb42e9ed 100644 --- a/phpBB/includes/core/system.php +++ b/phpBB/includes/core/system.php @@ -107,6 +107,9 @@ class phpbb_system extends phpbb_plugin_support if ($this->chmod_info['process']) { + $file_uid = fileowner($filename); + $file_gid = filegroup($filename); + // Change owner if (@chown($filename, $this->chmod_info['common_owner'])) { diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index ead47e4db..884c5526c 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -633,7 +633,24 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = return false; } - $where_clause = phpbb::$db->sql_in_set($where_type, array_map('intval', $where_ids)); + $where_ids = array_map('intval', $where_ids); + + // Split post deletion into chunks to overcome database limitations + if (sizeof($where_ids) >= 1001) + { + // Split into chunks of 1000 + $chunks = array_chunk($where_ids, 1000); + $removed_posts = 0; + + foreach ($chunks as $_where_ids) + { + $removed_posts += delete_posts($where_type, $_where_ids, $auto_sync, $posted_sync, $post_count_sync, $call_delete_topics); + } + + return $removed_posts; + } + + $where_clause = phpbb::$db->sql_in_set($where_type, $where_ids); } $approved_posts = 0; @@ -646,10 +663,10 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = while ($row = phpbb::$db->sql_fetchrow($result)) { - $post_ids[] = $row['post_id']; - $poster_ids[] = $row['poster_id']; - $topic_ids[] = $row['topic_id']; - $forum_ids[] = $row['forum_id']; + $post_ids[] = (int) $row['post_id']; + $poster_ids[] = (int) $row['poster_id']; + $topic_ids[] = (int) $row['topic_id']; + $forum_ids[] = (int) $row['forum_id']; if ($row['post_postcount'] && $post_count_sync && $row['post_approved']) { diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 27d70a708..64c915b7d 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -1108,7 +1108,7 @@ function truncate_string($string, $max_length = 60, $max_store_length = 255, $al array_pop($chars); $string = implode('', $chars); } - while (utf8_strlen($string) > $max_store_length || !sizeof($chars)); + while (!empty($chars) && utf8_strlen($string) > $max_store_length); } if ($strip_reply) diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 18f23fbee..cf12a60ae 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -234,7 +234,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod // Handle marking posts if ($mark_read == 'forums' || $mark_read == 'all') { - $redirect = phpbb::$url->build_url('mark', 'hash'); + $redirect = phpbb::$url->build_url(array('mark', 'hash')); $token = request_var('hash', ''); if (phpbb::$security->check_link($token, 'global')) diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index a985a7b2e..8d15e8a13 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -176,7 +176,8 @@ class messenger if (empty($this->tpl_msg[$template_lang . $template_file])) { - $tpl_file = PHPBB_ROOT_PATH . "language/$template_lang/email/$template_file.txt"; + $tpl_file = (!empty(phpbb::$user->lang_path)) ? phpbb::$user->lang_path : PHPBB_ROOT_PATH . 'language/'; + $tpl_file .= $template_lang . "/email/$template_file.txt"; if (!file_exists($tpl_file)) { @@ -1401,9 +1402,10 @@ function mail_encode($str) // define start delimimter, end delimiter and spacer $start = "=?UTF-8?B?"; $end = "?="; - $spacer = $end . ' ' . $start; - $split_length = 64; + $delimiter = "\r\n "; + // Maximum length is 75. $split_length *must* be a multiple of 4, but <= 75 - strlen($start . $delimiter . $end)!!! + $split_length = 60; $encoded_str = base64_encode($str); // If encoded string meets the limits, we just return with the correct data. @@ -1415,7 +1417,7 @@ function mail_encode($str) // If there is only ASCII data, we just return what we want, correctly splitting the lines. if (strlen($str) === utf8_strlen($str)) { - return $start . implode($spacer, str_split($encoded_str, $split_length)) . $end; + return $start . implode($end . $delimiter . $start, str_split($encoded_str, $split_length)) . $end; } // UTF-8 data, compose encoded lines @@ -1426,16 +1428,15 @@ function mail_encode($str) { $text = ''; - while (sizeof($array) && intval((strlen($text . current($array)) + 2) / 3) << 2 <= $split_length) + while (sizeof($array) && intval((strlen($text . $array[0]) + 2) / 3) << 2 <= $split_length) { - $text .= current($array); - unset($array[key($array)]); + $text .= array_shift($array); } - $str .= $start . base64_encode($text) . $end . ' '; + $str .= $start . base64_encode($text) . $end . $delimiter; } - return substr($str, 0, -1); + return substr($str, 0, -strlen($delimiter)); } ?> \ No newline at end of file diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index baa2ab318..1b5e43421 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -600,7 +600,7 @@ function create_thumbnail($source, $destination, $mimetype) list($new_width, $new_height) = get_img_size_format($width, $height); // Do not create a thumbnail if the resulting width/height is bigger than the original one - if ($new_width > $width && $new_height > $height) + if ($new_width >= $width && $new_height >= $height) { return false; } @@ -1101,7 +1101,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id if (!$topic_notification && !$forum_notification) { - trigger_error('WRONG_NOTIFICATION_MODE'); + trigger_error('NO_MODE'); } if (($topic_notification && !phpbb::$config['allow_topic_notify']) || ($forum_notification && !phpbb::$config['allow_forum_notify'])) @@ -1708,6 +1708,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u $sql_data[TOPICS_TABLE]['sql'] = array( 'topic_poster' => (int) phpbb::$user->data['user_id'], 'topic_time' => $current_time, + 'topic_last_view_time' => $current_time, 'forum_id' => ($topic_type == POST_GLOBAL) ? 0 : $data['forum_id'], 'icon_id' => $data['icon_id'], 'topic_approved' => $post_approval, @@ -1755,7 +1756,13 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u break; case 'reply': - $sql_data[TOPICS_TABLE]['stat'][] = 'topic_replies_real = topic_replies_real + 1, topic_bumped = 0, topic_bumper = 0' . (($post_approval) ? ', topic_replies = topic_replies + 1' : '') . ((!empty($data['attachment_data']) || (isset($data['topic_attachment']) && $data['topic_attachment'])) ? ', topic_attachment = 1' : ''); + $sql_data[TOPICS_TABLE]['stat'][] = 'topic_last_view_time = ' . $current_time . ', + topic_replies_real = topic_replies_real + 1, + topic_bumped = 0, + topic_bumper = 0' . + (($post_approval) ? ', topic_replies = topic_replies + 1' : '') . + ((!empty($data['attachment_data']) || (isset($data['topic_attachment']) && $data['topic_attachment'])) ? ', topic_attachment = 1' : ''); + $sql_data[USERS_TABLE]['stat'][] = "user_lastpost_time = $current_time" . ((phpbb::$acl->acl_get('f_postcount', $data['forum_id']) && $post_approval) ? ', user_posts = user_posts + 1' : ''); if ($post_approval && $topic_type != POST_GLOBAL) @@ -1794,6 +1801,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u 'poll_max_options' => (isset($poll['poll_options'])) ? $poll['poll_max_options'] : 1, 'poll_length' => (isset($poll['poll_options'])) ? $poll_length : 0, 'poll_vote_change' => (isset($poll['poll_vote_change'])) ? $poll['poll_vote_change'] : 0, + 'topic_last_view_time' => $current_time, 'topic_attachment' => (!empty($data['attachment_data'])) ? 1 : (isset($data['topic_attachment']) ? $data['topic_attachment'] : 0), ); @@ -1837,7 +1845,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u // Correctly set back the topic replies and forum posts... but only if the post was approved before. if (!$post_approval && $data['post_approved']) { - $sql_data[TOPICS_TABLE]['stat'][] = 'topic_replies = topic_replies - 1'; + $sql_data[TOPICS_TABLE]['stat'][] = 'topic_replies = topic_replies - 1, topic_last_view_time = ' . $current_time; $sql_data[FORUMS_TABLE]['stat'][] = 'forum_posts = forum_posts - 1'; set_config_count('num_posts', -1, true); diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index de7a1e7d1..90060519d 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1731,8 +1731,14 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode $url = append_sid('ucp', 'i=pm'); $next_history_pm = $previous_history_pm = $prev_id = 0; - foreach ($rowset as $id => $row) + // Re-order rowset to be able to get the next/prev message rows... + $rowset = array_values($rowset); + + for ($i = 0, $size = sizeof($rowset); $i < $size; $i++) { + $row = &$rowset[$i]; + $id = (int) $row['msg_id']; + $author_id = $row['author_id']; $folder_id = (int) $row['folder_id']; @@ -1763,8 +1769,7 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode if ($id == $msg_id) { - $next_history_pm = next($rowset); - $next_history_pm = (sizeof($next_history_pm)) ? (int) $next_history_pm['msg_id'] : 0; + $next_history_pm = (isset($rowset[$i + 1])) ? (int) $rowset[$i + 1]['msg_id'] : 0; $previous_history_pm = $prev_id; } diff --git a/phpBB/includes/functions_transfer.php b/phpBB/includes/functions_transfer.php index 808f28a14..d7cb11cbf 100644 --- a/phpBB/includes/functions_transfer.php +++ b/phpBB/includes/functions_transfer.php @@ -190,7 +190,7 @@ class transfer $directory = $this->root_path . str_replace(PHPBB_ROOT_PATH, '', $directory); $this->_chdir($directory); - $result = $this->_ls(''); + $result = $this->_ls(); if ($result !== false && is_array($result)) { @@ -442,7 +442,24 @@ class ftp extends transfer */ private function _ls($dir = './') { - return @ftp_nlist($this->connection, $dir); + $list = @ftp_nlist($this->connection, $dir); + + // Remove path if prepended + foreach ($list as $key => $item) + { + // Use same separator for item and dir + $item = str_replace('\\', '/', $item); + $dir = str_replace('\\', '/', $dir); + + if (strpos($item, $dir) === 0) + { + $item = substr($item, strlen($dir)); + } + + $list[$key] = $item; + } + + return $list; } /** @@ -690,6 +707,24 @@ class ftp_fsock extends transfer } $this->_close_data_connection(); + // Clear buffer + $this->_check_command(); + + // Remove path if prepended + foreach ($list as $key => $item) + { + // Use same separator for item and dir + $item = str_replace('\\', '/', $item); + $dir = str_replace('\\', '/', $dir); + + if (strpos($item, $dir) === 0) + { + $item = substr($item, strlen($dir)); + } + + $list[$key] = $item; + } + return $list; } diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index 63c62215d..363bfdd76 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -588,7 +588,18 @@ class fileupload // PHP Upload filesize exceeded if ($file->get('filename') == 'none') { - $file->error[] = (@ini_get('upload_max_filesize') == '') ? phpbb::$user->lang[$this->error_prefix . 'PHP_SIZE_NA'] : sprintf(phpbb::$user->lang[$this->error_prefix . 'PHP_SIZE_OVERRUN'], @ini_get('upload_max_filesize')); + $max_filesize = @ini_get('upload_max_filesize'); + $unit = 'MB'; + + if (!empty($max_filesize)) + { + $unit = strtolower(substr($max_filesize, -1, 1)); + $max_filesize = (int) $max_filesize; + + $unit = ($unit == 'k') ? 'KB' : (($unit == 'g') ? 'GB' : 'MB'); + } + + $file->error[] = (empty($max_filesize)) ? phpbb::$user->lang[$this->error_prefix . 'PHP_SIZE_NA'] : phpbb::$user->lang($this->error_prefix . 'PHP_SIZE_OVERRUN', $max_filesize, phpbb::$user->lang[$unit]); return $file; } @@ -662,7 +673,18 @@ class fileupload // PHP Upload filesize exceeded if ($file->get('filename') == 'none') { - $file->error[] = (@ini_get('upload_max_filesize') == '') ? phpbb::$user->lang[$this->error_prefix . 'PHP_SIZE_NA'] : sprintf(phpbb::$user->lang[$this->error_prefix . 'PHP_SIZE_OVERRUN'], @ini_get('upload_max_filesize')); + $max_filesize = @ini_get('upload_max_filesize'); + $unit = 'MB'; + + if (!empty($max_filesize)) + { + $unit = strtolower(substr($max_filesize, -1, 1)); + $max_filesize = (int) $max_filesize; + + $unit = ($unit == 'k') ? 'KB' : (($unit == 'g') ? 'GB' : 'MB'); + } + + $file->error[] = (empty($max_filesize)) ? phpbb::$user->lang[$this->error_prefix . 'PHP_SIZE_NA'] : phpbb::$user->lang($this->error_prefix . 'PHP_SIZE_OVERRUN', $max_filesize, phpbb::$user->lang[$unit]); return $file; } @@ -806,7 +828,18 @@ class fileupload switch ($errorcode) { case 1: - $error = (@ini_get('upload_max_filesize') == '') ? phpbb::$user->lang[$this->error_prefix . 'PHP_SIZE_NA'] : sprintf(phpbb::$user->lang[$this->error_prefix . 'PHP_SIZE_OVERRUN'], @ini_get('upload_max_filesize')); + $max_filesize = @ini_get('upload_max_filesize'); + $unit = 'MB'; + + if (!empty($max_filesize)) + { + $unit = strtolower(substr($max_filesize, -1, 1)); + $max_filesize = (int) $max_filesize; + + $unit = ($unit == 'k') ? 'KB' : (($unit == 'g') ? 'GB' : 'MB'); + } + + $error = (empty($max_filesize)) ? phpbb::$user->lang[$this->error_prefix . 'PHP_SIZE_NA'] : phpbb::$user->lang($this->error_prefix . 'PHP_SIZE_OVERRUN', $max_filesize, phpbb::$user->lang[$unit]); break; case 2: diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 58149b952..5c22cfb4e 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -2686,13 +2686,14 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false, $temp_ary = array(); while ($row = phpbb::$db->sql_fetchrow($result)) { - if ($default_groups[$row['user_id']] == $group_id && (!isset($temp_ary[$row['user_id']]) || array_search($row['group_name_clean'], $clean_group_order) < $temp_ary[$row['user_id']])) + if ($default_groups[$row['user_id']] == $group_id && (!isset($temp_ary[$row['user_id']]) || $group_order_id[$row['group_name']] < $temp_ary[$row['user_id']])) { $temp_ary[$row['user_id']] = $row['group_id']; } } phpbb::$db->sql_freeresult($result); + // sql_where_ary holds the new default groups and their users $sql_where_ary = array(); foreach ($temp_ary as $uid => $gid) { @@ -2704,7 +2705,7 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false, { if (isset($sql_where_ary[$gid]) && sizeof($sql_where_ary[$gid])) { - remove_default_rank($group_id, $sql_where_ary[$gid]); + remove_default_rank($gid, $sql_where_ary[$gid]); remove_default_avatar($group_id, $sql_where_ary[$gid]); group_set_user_default($gid, $sql_where_ary[$gid], $default_data_ary); } diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 9a13d2d14..39c65e054 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -1037,11 +1037,7 @@ class parse_message extends bbcode_firstpass { // Init BBCode UID $this->bbcode_uid = substr(base_convert(unique_id(), 16, 36), 0, BBCODE_UID_LEN); - - if ($message) - { - $this->message = $message; - } + $this->message = $message; } /** diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 6430e3b0b..8c4b8f3c7 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -110,6 +110,12 @@ class fulltext_mysql extends search_backend preg_match_all('#(?:[^\p{L}\p{N}*"()]|^)([+\-|]?(?:[\p{L}\p{N}*"()]+\'?)*[\p{L}\p{N}*"()])(?:[^\p{L}\p{N}*"()]|$)#u', $split_keywords, $matches); $this->split_words = $matches[1]; + // We limit the number of allowed keywords to minimize load on the database + if (phpbb::$config['max_num_search_keywords'] && sizeof($this->split_words) > phpbb::$config['max_num_search_keywords']) + { + trigger_error(phpbb::$user->lang('MAX_NUM_SEARCH_KEYWORDS_REFINE', phpbb::$config['max_num_search_keywords'], sizeof($this->split_words))); + } + // to allow phrase search, we need to concatenate quoted words $tmp_split_words = array(); $phrase = ''; diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index 54854651a..a2cb8936b 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -163,6 +163,13 @@ class fulltext_native extends search_backend ); $keywords = preg_replace($match, $replace, $keywords); + $num_keywords = sizeof(explode(' ', $keywords)); + + // We limit the number of allowed keywords to minimize load on the database + if (phpbb::$config['max_num_search_keywords'] && $num_keywords > phpbb::$config['max_num_search_keywords']) + { + trigger_error(phpbb::$user->lang('MAX_NUM_SEARCH_KEYWORDS_REFINE', phpbb::$config['max_num_search_keywords'], $num_keywords)); + } // $keywords input format: each word separated by a space, words in a bracket are not separated @@ -637,7 +644,11 @@ class fulltext_native extends search_backend if (phpbb::$db->dbms_type === 'mysql') { - $sql_array['SELECT'] = 'SQL_CALC_FOUND_ROWS ' . $sql_array['SELECT']; + $sql_array_copy = $sql_array; + + // $sql_array['SELECT'] = 'SQL_CALC_FOUND_ROWS ' . $sql_array['SELECT']; + $sql_array_copy['SELECT'] = 'SQL_CALC_FOUND_ROWS p.post_id '; + $is_mysql = true; } else @@ -710,8 +721,14 @@ class fulltext_native extends search_backend } // if we use mysql and the total result count is not cached yet, retrieve it from the db - if (!$total_results && $is_mysql) + if (!$total_results && $is_mysql && !empty($sql_array_copy)) { + $sql = phpbb::$db->sql_build_query('SELECT', $sql_array_copy); + unset($sql_array_copy); + + phpbb::$db->sql_query($sql); + phpbb::$db->sql_freeresult($result); + $sql = 'SELECT FOUND_ROWS() as total_results'; $result = phpbb::$db->sql_query($sql); $total_results = (int) phpbb::$db->sql_fetchfield('total_results'); @@ -831,8 +848,8 @@ class fulltext_native extends search_backend { if (phpbb::$db->dbms_type === 'mysql') { - $select = 'SQL_CALC_FOUND_ROWS ' . $select; - $is_mysql = true; +// $select = 'SQL_CALC_FOUND_ROWS ' . $select; + $is_mysql = true; } else { @@ -923,6 +940,12 @@ class fulltext_native extends search_backend if (!$total_results && $is_mysql) { + // Count rows for the executed queries. Replace $select within $sql with SQL_CALC_FOUND_ROWS, and run it. + $sql = str_replace('SELECT ' . $select, 'SELECT DISTINCT SQL_CALC_FOUND_ROWS p.post_id', $sql); + + phpbb::$db->sql_query($sql); + phpbb::$db->sql_freeresult($result); + $sql = 'SELECT FOUND_ROWS() as total_results'; $result = phpbb::$db->sql_query($sql); $total_results = (int) phpbb::$db->sql_fetchfield('total_results'); diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 2eef01374..0be2e0f5b 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -8,7 +8,7 @@ * */ -$updates_to_version = '3.1.0'; +$updates_to_version = '3.1.0-dev1'; // Enter any version to update from to test updates. The version within the db will not be updated. $debug_from_version = false; @@ -55,8 +55,8 @@ $inline_update = (request_var('type', 0)) ? true : false; // Only an example, but also commented out $database_update_info = array( - // No changes from 3.0.3-RC1 to 3.0.3 - '3.0.3-RC1' => array(), + // Changes from 3.0.5 to 3.1.0-dev1 + '3.0.5' => array(), ); $error_ary = array(); @@ -340,6 +340,9 @@ function change_database_data($version) switch ($version) { default: + // Changes from 3.0.5 to 3.1.0-dev1 + case '3.0.5': + break; break; } } diff --git a/phpBB/install/schemas/schema_data.php b/phpBB/install/schemas/schema_data.php index f4f5d3444..766a91834 100644 --- a/phpBB/install/schemas/schema_data.php +++ b/phpBB/install/schemas/schema_data.php @@ -206,6 +206,7 @@ $schema_data[] = array( array('max_filesize_pm', '262144'), array('max_login_attempts', '3'), array('max_name_chars', '20'), + array('max_num_search_keywords', '10'), array('max_pass_chars', '30'), array('max_poll_options', '10'), array('max_poll_chars', '60000'), @@ -268,7 +269,7 @@ $schema_data[] = array( array('tpl_allow_php', '0'), array('upload_icons_path', 'images/upload_icons'), array('upload_path', 'files'), - array('version', '3.1.0'), + array('version', '3.1.0-dev1'), array('warnings_expire_days', '90'), array('warnings_gc', '14400'), ), diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index dc12cbb42..3c96f239e 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -269,8 +269,8 @@ $lang = array_merge($lang, array( 'VISUAL_CONFIRM_POST_EXPLAIN' => 'Requires anonymous users to enter a random code matching an image to help prevent mass postings.', 'VISUAL_CONFIRM_REG' => 'Enable visual confirmation for registrations', 'VISUAL_CONFIRM_REG_EXPLAIN' => 'Requires new users to enter a random code matching an image to help prevent mass registrations.', - 'VISUAL_CONFIRM_REFRESH' => 'Enable users to request new images', - 'VISUAL_CONFIRM_REFRESH_EXPLAIN' => 'Allows users to request new images, if they are unable to solve the VC during registration.', + 'VISUAL_CONFIRM_REFRESH' => 'Enable users to refresh the confirmation image', + 'VISUAL_CONFIRM_REFRESH_EXPLAIN' => 'Allows users to request new confirmation codes, if they are unable to solve the VC during registration.', )); // Cookie Settings diff --git a/phpBB/language/en/acp/permissions.php b/phpBB/language/en/acp/permissions.php index bba425d07..920643d92 100644 --- a/phpBB/language/en/acp/permissions.php +++ b/phpBB/language/en/acp/permissions.php @@ -50,7 +50,7 @@ $lang = array_merge($lang, array(

      Permission Masks

      These are used to view the effective permissions assigned to Users, Moderators (Local and Global), Administrators or Forums.

      - +

      For further information on setting up and managing permissions on your phpBB3 board, please see Chapter 1.5 of our Quick Start Guide.

      @@ -71,7 +71,7 @@ $lang = array_merge($lang, array( 'ACL_TYPE_GLOBAL_M_' => 'Global Moderator permissions', 'ACL_TYPE_LOCAL_M_' => 'Forum Moderator permissions', 'ACL_TYPE_LOCAL_F_' => 'Forum permissions', - + 'ACL_NO' => 'No', 'ACL_VIEW' => 'Viewing permissions', 'ACL_VIEW_EXPLAIN' => 'Here you can see the effective permissions the user/group is having. A red square indicates that the user/group does not have the permission, a green square indicates that the user/group does have the permission.', @@ -83,10 +83,10 @@ $lang = array_merge($lang, array( 'ACP_GLOBAL_MODERATORS_EXPLAIN' => 'Here you can assign global moderator permissions to users or groups. These moderators are like ordinary moderators except they have access to every forum on your board.', 'ACP_GROUPS_FORUM_PERMISSIONS_EXPLAIN' => 'Here you can assign forum permissions to groups.', 'ACP_GROUPS_PERMISSIONS_EXPLAIN' => 'Here you can assign global permissions to groups - user permissions, global moderator permissions and administrator permissions. User permissions include capabilities such as the use of avatars, sending private messages, et cetera; global moderator permissions such as approving posts, manage topics, manage bans, et cetera and lastly administrator permissions such as altering permissions, define custom BBCodes, manage forums, et cetera. Individual users permissions should only be changed in rare occasions, the preferred method is putting users in groups and assigning the group’s permissions.', - 'ACP_ADMIN_ROLES_EXPLAIN' => 'Here you are able to manage the roles for administrative permissions. Roles are effective permissions, if you change a role the items having this role assigned will change it’s permissions too.', - 'ACP_FORUM_ROLES_EXPLAIN' => 'Here you are able to manage the roles for forum permissions. Roles are effective permissions, if you change a role the items having this role assigned will change it’s permissions too.', - 'ACP_MOD_ROLES_EXPLAIN' => 'Here you are able to manage the roles for moderative permissions. Roles are effective permissions, if you change a role the items having this role assigned will change it’s permissions too.', - 'ACP_USER_ROLES_EXPLAIN' => 'Here you are able to manage the roles for user permissions. Roles are effective permissions, if you change a role the items having this role assigned will change it’s permissions too.', + 'ACP_ADMIN_ROLES_EXPLAIN' => 'Here you are able to manage the roles for administrative permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.', + 'ACP_FORUM_ROLES_EXPLAIN' => 'Here you are able to manage the roles for forum permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.', + 'ACP_MOD_ROLES_EXPLAIN' => 'Here you are able to manage the roles for moderative permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.', + 'ACP_USER_ROLES_EXPLAIN' => 'Here you are able to manage the roles for user permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.', 'ACP_USERS_FORUM_PERMISSIONS_EXPLAIN' => 'Here you can assign forum permissions to users.', 'ACP_USERS_PERMISSIONS_EXPLAIN' => 'Here you can assign global permissions to users - user permissions, global moderator permissions and administrator permissions. User permissions include capabilities such as the use of avatars, sending private messages, et cetera; global moderator permissions such as approving posts, manage topics, manage bans, et cetera and lastly administrator permissions such as altering permissions, define custom BBCodes, manage forums, et cetera. To alter these settings for large numbers of users the Group permissions system is the preferred method. User’s permissions should only be changed in rare occasions, the preferred method is putting users in groups and assigning the group’s permissions.', 'ACP_VIEW_ADMIN_PERMISSIONS_EXPLAIN' => 'Here you can view the effective administrative permissions assigned to the selected users/groups.', @@ -196,7 +196,7 @@ $lang = array_merge($lang, array( 'ROLE_DESCRIPTION_USER_NOAVATAR' => 'Has a limited feature set and is not allowed to use the Avatar feature.', 'ROLE_DESCRIPTION_USER_NOPM' => 'Has a limited feature set, and is not allowed to use Private Messages.', 'ROLE_DESCRIPTION_USER_STANDARD' => 'Can access most but not all user features. Cannot change user name or ignore the flood limit, for instance.', - + 'ROLE_DESCRIPTION_EXPLAIN' => 'You are able to enter a short explanation of what the role is doing or for what it is meant for. The text you enter here will be displayed within the permissions screens too.', 'ROLE_DESCRIPTION_LONG' => 'The role description is too long, please limit it to 4000 characters.', 'ROLE_DETAILS' => 'Role details', diff --git a/phpBB/language/en/acp/search.php b/phpBB/language/en/acp/search.php index 16fa7fdf6..11e6723c7 100644 --- a/phpBB/language/en/acp/search.php +++ b/phpBB/language/en/acp/search.php @@ -68,6 +68,8 @@ $lang = array_merge($lang, array( 'MAX_SEARCH_CHARS' => 'Max characters indexed by search', 'MAX_SEARCH_CHARS_EXPLAIN' => 'Words with no more than this many characters will be indexed for searching.', + 'MAX_NUM_SEARCH_KEYWORDS' => 'Maximum number of allowed keywords', + 'MAX_NUM_SEARCH_KEYWORDS_EXPLAIN' => 'Maximum number of words the user is able to search for. A value of 0 allows an unlimited number of words.', 'MIN_SEARCH_CHARS' => 'Min characters indexed by search', 'MIN_SEARCH_CHARS_EXPLAIN' => 'Words with at least this many characters will be indexed for searching.', 'MIN_SEARCH_AUTHOR_CHARS' => 'Min author name characters', diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 3dbda4a4d..048e732e8 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -87,7 +87,7 @@ $lang = array_merge($lang, array( 'AVATAR_NO_SIZE' => 'The width or height of the linked avatar could not be determined. Please enter them manually.', 'AVATAR_PARTIAL_UPLOAD' => 'The specified file was only partially uploaded.', 'AVATAR_PHP_SIZE_NA' => 'The avatar’s filesize is too large.
      The maximum allowed filesize set in php.ini could not be determined.', - 'AVATAR_PHP_SIZE_OVERRUN' => 'The avatar’s filesize is too large. The maximum allowed upload size is %d MB.
      Please note this is set in php.ini and cannot be overridden.', + 'AVATAR_PHP_SIZE_OVERRUN' => 'The avatar’s filesize is too large. The maximum allowed upload size is %1$d %2$s.
      Please note this is set in php.ini and cannot be overridden.', 'AVATAR_URL_INVALID' => 'The URL you specified is invalid.', 'AVATAR_URL_NOT_FOUND' => 'The file specified could not be found.', 'AVATAR_WRONG_FILESIZE' => 'The avatar’s filesize must be between 0 and %1d %2s.', @@ -163,7 +163,7 @@ $lang = array_merge($lang, array( ), 'EDIT_POST' => 'Edit post', - 'EMAIL' => 'E-mail', + 'EMAIL' => 'E-mail', // Short form for EMAIL_ADDRESS 'EMAIL_ADDRESS' => 'E-mail address', 'EMAIL_SMTP_ERROR_RESPONSE' => 'Ran into problems sending e-mail at Line %1$s. Response: %2$s.', 'EMPTY_SUBJECT' => 'You must specify a subject when posting a new topic.', @@ -233,6 +233,8 @@ $lang = array_merge($lang, array( 'FTP_USERNAME_EXPLAIN' => 'Username used to connect to your server.', 'GENERAL_ERROR' => 'General Error', + 'GB' => 'GB', + 'GIB' => 'GiB', 'GO' => 'Go', 'GOTO_PAGE' => 'Go to page', 'GROUP' => 'Group', @@ -535,7 +537,7 @@ $lang = array_merge($lang, array( 'SELECT_ALL_CODE' => 'Select all', 'SELECT_DESTINATION_FORUM' => 'Please select a destination forum', 'SELECT_FORUM' => 'Select a forum', - 'SEND_EMAIL' => 'E-mail', + 'SEND_EMAIL' => 'E-mail', // Used for submit buttons 'SEND_EMAIL_USER' => 'E-mail', // Used as: {L_SEND_EMAIL_USER} {USERNAME} -> E-mail UserX 'SEND_PRIVATE_MESSAGE' => 'Send private message', 'SETTINGS' => 'Settings', diff --git a/phpBB/language/en/help_bbcode.php b/phpBB/language/en/help_bbcode.php index 00b00c9e1..ed6fea96d 100644 --- a/phpBB/language/en/help_bbcode.php +++ b/phpBB/language/en/help_bbcode.php @@ -76,7 +76,7 @@ $help = array( ), array( 0 => 'Creating an Ordered list', - 1 => 'The second type of list, an ordered list, gives you control over what is output before each item. To create an ordered list you use [list=1][/list] to create a numbered list or alternatively [list=a][/list] for an alphabetical list. As with the unordered list, items are specified using [*]. For example:

      [list=1]
      [*]Go to the shops
      [*]Buy a new computer
      [*]Swear at computer when it crashes
      [/list]

      will generate the following:
      1. Go to the shops
      2. Buy a new computer
      3. Swear at computer when it crashes
      Whereas for an alphabetical list you would use:

      [list=a]
      [*]The first possible answer
      [*]The second possible answer
      [*]The third possible answer
      [/list]

      giving
      1. The first possible answer
      2. The second possible answer
      3. The third possible answer
      ' + 1 => 'The second type of list, an ordered list, gives you control over what is output before each item. To create an ordered list you use [list=1][/list] to create a numbered list or alternatively [list=a][/list] for an alphabetical list. As with the unordered list, items are specified using [*]. For example:

      [list=1]
      [*]Go to the shops
      [*]Buy a new computer
      [*]Swear at computer when it crashes
      [/list]

      will generate the following:
      1. Go to the shops
      2. Buy a new computer
      3. Swear at computer when it crashes
      Whereas for an alphabetical list you would use:

      [list=a]
      [*]The first possible answer
      [*]The second possible answer
      [*]The third possible answer
      [/list]

      giving
      1. The first possible answer
      2. The second possible answer
      3. The third possible answer
      ' ), array( 0 => '--', diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index f75837e96..b3acb7f29 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -141,7 +141,7 @@ $lang = array_merge($lang, array( 'PARTIAL_UPLOAD' => 'The uploaded file was only partially uploaded.', 'PHP_SIZE_NA' => 'The attachment’s file size is too large.
      Could not determine the maximum size defined by PHP in php.ini.', - 'PHP_SIZE_OVERRUN' => 'The attachment’s file size is too large, the maximum upload size is %d MB.
      Please note this is set in php.ini and cannot be overridden.', + 'PHP_SIZE_OVERRUN' => 'The attachment’s file size is too large, the maximum upload size is %1$d %2$s.
      Please note this is set in php.ini and cannot be overridden.', 'PLACE_INLINE' => 'Place inline', 'POLL_DELETE' => 'Delete poll', 'POLL_FOR' => 'Run poll for', diff --git a/phpBB/language/en/search.php b/phpBB/language/en/search.php index 8e376b260..4618a585b 100644 --- a/phpBB/language/en/search.php +++ b/phpBB/language/en/search.php @@ -54,6 +54,8 @@ $lang = array_merge($lang, array( 'LOGIN_EXPLAIN_EGOSEARCH' => 'The board requires you to be registered and logged in to view your own posts.', + 'MAX_NUM_SEARCH_KEYWORDS_REFINE' => 'You specified too many words to search for. Please do not enter more than %1$d words.', + 'NO_KEYWORDS' => 'You must specify at least one word to search for. Each word must consist of at least %d characters and must not contain more than %d characters excluding wildcards.', 'NO_RECENT_SEARCHES' => 'No searches have been carried out recently.', 'NO_SEARCH' => 'Sorry but you are not permitted to use the search system.', diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index 0c26e612e..ccb6fbdbb 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -122,8 +122,8 @@ $lang = array_merge($lang, array( 'CONFIRM_EMAIL' => 'Confirm e-mail address', 'CONFIRM_EMAIL_EXPLAIN' => 'You only need to specify this if you are changing your e-mail address.', 'CONFIRM_EXPLAIN' => 'To prevent automated registrations the board requires you to enter a confirmation code. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.', - 'VC_REFRESH' => 'New Image', - 'VC_REFRESH_EXPLAIN' => 'If you cannot read the code, then you can request a new one by clicking the button.', + 'VC_REFRESH' => 'Refresh confirmation code', + 'VC_REFRESH_EXPLAIN' => 'If you cannot read the code you can request a new one by clicking the button.', 'CONFIRM_PASSWORD' => 'Confirm password', 'CONFIRM_PASSWORD_EXPLAIN' => 'You only need to confirm your password if you changed it above.', diff --git a/phpBB/mcp.php b/phpBB/mcp.php index ba0e47c6c..df1bf291d 100644 --- a/phpBB/mcp.php +++ b/phpBB/mcp.php @@ -169,6 +169,13 @@ if ($quickmod) break; case 'topic_logs': + // Reset start parameter if we jumped from the quickmod dropdown + if (request_var('start', 0)) + { + phpbb_request::overwrite('start', 0, phpbb_request::GET); + phpbb_request::overwrite('start', 0, phpbb_request::REQUEST); + } + $module->set_active('logs', 'topic_logs'); break; diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index a8f359ba1..1ba62f7f8 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -890,6 +890,8 @@ switch ($mode) phpbb::$template->assign_vars(array( 'ERROR_MESSAGE' => (sizeof($error)) ? implode('
      ', $error) : '', + 'SUBJECT' => $subject, + 'MESSAGE' => $message, )); break; diff --git a/phpBB/modules/acp/acp_database.php b/phpBB/modules/acp/acp_database.php index 86f050e1d..1490882d0 100644 --- a/phpBB/modules/acp/acp_database.php +++ b/phpBB/modules/acp/acp_database.php @@ -78,7 +78,7 @@ class acp_database $schema_data = true; } - @set_time_limit(1200); + @set_time_limit(0); $time = time(); @@ -420,27 +420,37 @@ class acp_database $dir = PHPBB_ROOT_PATH . 'store/'; $dh = @opendir($dir); + $backup_files = array(); + if ($dh) { while (($file = readdir($dh)) !== false) { if (preg_match('#^backup_(\d{10,})_[a-z\d]{16}\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches)) { - $supported = in_array($matches[2], $methods); - - if ($supported == 'true') + if (in_array($matches[2], $methods)) { - phpbb::$template->assign_block_vars('files', array( - 'FILE' => $file, - 'NAME' => gmdate("d-m-Y H:i:s", $matches[1]), - 'SUPPORTED' => $supported, - )); + $backup_files[gmdate("d-m-Y H:i:s", $matches[1])] = $file; } } } closedir($dh); } + if (!empty($backup_files)) + { + krsort($backup_files); + + foreach ($backup_files as $name => $file) + { + phpbb::$template->assign_block_vars('files', array( + 'FILE' => $file, + 'NAME' => $name, + 'SUPPORTED' => true, + )); + } + } + phpbb::$template->assign_vars(array( 'U_ACTION' => $this->u_action . '&action=submit', )); @@ -540,6 +550,7 @@ class base_extractor function write_end() { static $close; + if ($this->store) { if ($close === null) diff --git a/phpBB/modules/acp/acp_permissions.php b/phpBB/modules/acp/acp_permissions.php index 85b2cda16..074a468fe 100644 --- a/phpBB/modules/acp/acp_permissions.php +++ b/phpBB/modules/acp/acp_permissions.php @@ -743,7 +743,7 @@ class acp_permissions $this->log_action($mode, 'add', $permission_type, $ug_type, $ug_ids, $forum_ids); - trigger_error(phpbb::$user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action)); + trigger_error(phpbb::$user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action . '&forum_id[]=' . implode('&forum_id[]=', $forum_ids))); } /** @@ -806,7 +806,7 @@ class acp_permissions $this->log_action($mode, 'del', $permission_type, $ug_type, (($ug_type == 'user') ? $user_id : $group_id), (sizeof($forum_id) ? $forum_id : array(0 => 0))); - trigger_error(phpbb::$user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action)); + trigger_error(phpbb::$user->lang['AUTH_UPDATED'] . adm_back_link($this->u_action . '&forum_id[]=' . implode('&forum_id[]=', $forum_id))); } /** diff --git a/phpBB/modules/acp/acp_search.php b/phpBB/modules/acp/acp_search.php index 43bb66777..fd2133f0a 100644 --- a/phpBB/modules/acp/acp_search.php +++ b/phpBB/modules/acp/acp_search.php @@ -58,6 +58,7 @@ class acp_search 'load_search' => 'bool', 'limit_search_load' => 'float', 'min_search_author_chars' => 'integer', + 'max_num_search_keywords' => 'integer', 'search_store_results' => 'integer', ); @@ -211,6 +212,7 @@ class acp_search 'SEARCH_INTERVAL' => (float) phpbb::$config['search_interval'], 'SEARCH_GUEST_INTERVAL' => (float) phpbb::$config['search_anonymous_interval'], 'SEARCH_STORE_RESULTS' => (int) phpbb::$config['search_store_results'], + 'MAX_NUM_SEARCH_KEYWORDS' => (int) phpbb::$config['max_num_search_keywords'], 'S_SEARCH_TYPES' => $search_options, 'S_YES_SEARCH' => (bool) phpbb::$config['load_search'], diff --git a/phpBB/modules/acp/acp_styles.php b/phpBB/modules/acp/acp_styles.php index a087348b3..db2a77790 100644 --- a/phpBB/modules/acp/acp_styles.php +++ b/phpBB/modules/acp/acp_styles.php @@ -34,7 +34,10 @@ class acp_styles // Hardcoded template bitfield to add for new templates $bitfield = new bitfield(); $bitfield->set(0); + $bitfield->set(1); + $bitfield->set(2); $bitfield->set(3); + $bitfield->set(4); $bitfield->set(8); $bitfield->set(9); $bitfield->set(11); diff --git a/phpBB/modules/acp/acp_users.php b/phpBB/modules/acp/acp_users.php index 54296c386..bf83e6b84 100644 --- a/phpBB/modules/acp/acp_users.php +++ b/phpBB/modules/acp/acp_users.php @@ -1843,6 +1843,16 @@ class acp_users } $error = array(); + + // The delete action was successful - therefore update the user row... + $sql = 'SELECT u.*, s.* + FROM ' . USERS_TABLE . ' u + LEFT JOIN ' . SESSIONS_TABLE . ' s ON (s.session_user_id = u.user_id) + WHERE u.user_id = ' . $user_id . ' + ORDER BY s.session_time DESC'; + $result = $db->sql_query($sql); + $user_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); } else { diff --git a/phpBB/modules/ucp/ucp_main.php b/phpBB/modules/ucp/ucp_main.php index 8bd03baf4..1206d5168 100644 --- a/phpBB/modules/ucp/ucp_main.php +++ b/phpBB/modules/ucp/ucp_main.php @@ -775,7 +775,8 @@ class ucp_main $folder_img = $folder_alt = $topic_type = ''; topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type); - $view_topic_url = append_sid('viewtopic', "f=$forum_id&t=$topic_id"); + $view_topic_url_params = "f=$forum_id&t=$topic_id"; + $view_topic_url = append_sid('viewtopic', $view_topic_url_params); // Send vars to template phpbb::$template->assign_block_vars('topicrow', array( @@ -818,8 +819,8 @@ class ucp_main 'S_USER_POSTED' => (!empty($row['topic_posted'])) ? true : false, 'S_UNREAD_TOPIC' => $unread_topic, - 'U_NEWEST_POST' => append_sid('viewtopic', "f=$forum_id&t=$topic_id&view=unread") . '#unread', - 'U_LAST_POST' => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'], + 'U_NEWEST_POST' => append_sid('viewtopic', $view_topic_url_params . '&view=unread') . '#unread', + 'U_LAST_POST' => append_sid('viewtopic', $view_topic_url_params . '&p=' . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'], 'U_VIEW_TOPIC' => $view_topic_url, 'U_VIEW_FORUM' => append_sid('viewforum', 'f=' . $forum_id), )); diff --git a/phpBB/modules/ucp/ucp_pm_compose.php b/phpBB/modules/ucp/ucp_pm_compose.php index 122e08bc4..d316c0a77 100644 --- a/phpBB/modules/ucp/ucp_pm_compose.php +++ b/phpBB/modules/ucp/ucp_pm_compose.php @@ -839,10 +839,10 @@ function compose_pm($id, $mode, $action) $forward_text = array(); $forward_text[] = phpbb::$user->lang['FWD_ORIGINAL_MESSAGE']; - $forward_text[] = sprintf(phpbb::$user->lang['FWD_SUBJECT'], censor_text($message_subject)); - $forward_text[] = sprintf(phpbb::$user->lang['FWD_DATE'], phpbb::$user->format_date($message_time)); - $forward_text[] = sprintf(phpbb::$user->lang['FWD_FROM'], $quote_username_text); - $forward_text[] = sprintf(phpbb::$user->lang['FWD_TO'], implode(', ', $fwd_to_field['to'])); + $forward_text[] = phpbb::$user->lang('FWD_SUBJECT', censor_text($message_subject)); + $forward_text[] = phpbb::$user->lang('FWD_DATE', phpbb::$user->format_date($message_time, false, true)); + $forward_text[] = phpbb::$user->lang('FWD_FROM', $quote_username_text); + $forward_text[] = phpbb::$user->lang('FWD_TO', implode(', ', $fwd_to_field['to'])); $message_parser->message = implode("\n", $forward_text) . "\n\n[quote="{$quote_username}"]\n" . censor_text(trim($message_parser->message)) . "\n[/quote]"; $message_subject = ((!preg_match('/^Fwd:/', $message_subject)) ? 'Fwd: ' : '') . censor_text($message_subject); diff --git a/phpBB/modules/ucp/ucp_pm_viewfolder.php b/phpBB/modules/ucp/ucp_pm_viewfolder.php index 3d4c9d2f0..5b252f741 100644 --- a/phpBB/modules/ucp/ucp_pm_viewfolder.php +++ b/phpBB/modules/ucp/ucp_pm_viewfolder.php @@ -325,7 +325,7 @@ function view_folder($id, $mode, $folder_id, $folder) $data[] = array( 'subject' => censor_text($row['message_subject']), 'sender' => $row['username'], - 'date' => phpbb::$user->format_date($row['message_time']), + 'date' => phpbb::$user->format_date($row['message_time'], 'c', true), // ISO 8601 date. 'to' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? $address[$message_id] : '', 'message' => $message_row['message_text'] ); @@ -497,7 +497,7 @@ function get_pm_from($folder_id, $folder, $user_id) 'PAGE_NUMBER' => on_page($pm_count, phpbb::$config['topics_per_page'], $start), 'TOTAL_MESSAGES' => (($pm_count == 1) ? phpbb::$user->lang['VIEW_PM_MESSAGE'] : sprintf(phpbb::$user->lang['VIEW_PM_MESSAGES'], $pm_count)), - 'POST_IMG' => (!phpbb::$acl->acl_get('u_sendpm')) ? phpbb::$user->img('button_topic_locked', 'PM_LOCKED') : phpbb::$user->img('button_pm_new', 'POST_PM'), + 'POST_IMG' => (!phpbb::$acl->acl_get('u_sendpm')) ? phpbb::$user->img('button_topic_locked', 'POST_PM_LOCKED') : phpbb::$user->img('button_pm_new', 'POST_NEW_PM'), 'L_NO_MESSAGES' => (!phpbb::$acl->acl_get('u_sendpm')) ? phpbb::$user->lang['POST_PM_LOCKED'] : phpbb::$user->lang['NO_MESSAGES'], diff --git a/phpBB/posting.php b/phpBB/posting.php index f5ad0961f..4c0dcc248 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -55,7 +55,8 @@ if (phpbb::$config['enable_post_confirm'] && !phpbb::$user->is_registered) // Was cancel pressed? If so then redirect to the appropriate page if ($cancel || ($current_time - $lastclick < 2 && $submit)) { - $redirect = ($post_id) ? append_sid('viewtopic', 'p=' . $post_id) . '#p' . $post_id : (($topic_id) ? append_sid('viewtopic', 't=' . $topic_id) : (($forum_id) ? append_sid('viewforum', 'f=' . $forum_id) : append_sid('index'))); + $f = ($forum_id) ? 'f=' . $forum_id . '&' : ''; + $redirect = ($post_id) ? append_sid('viewtopic', $f . 'p=' . $post_id) . '#p' . $post_id : (($topic_id) ? append_sid('viewtopic', $f . 't=' . $topic_id) : (($forum_id) ? append_sid('viewforum', 'f=' . $forum_id) : append_sid('index'))); redirect($redirect); } diff --git a/phpBB/search.php b/phpBB/search.php index 835ec11b9..1acdf2fd9 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -767,7 +767,8 @@ if ($keywords || $author || $author_id || $search_id || $submit) $u_forum_id = $forum_id; } - $view_topic_url = append_sid('viewtopic', "f=$u_forum_id&t=$result_topic_id" . (($u_hilit) ? "&hilit=$u_hilit" : '')); + $view_topic_url_params = "f=$u_forum_id&t=$result_topic_id" . (($u_hilit) ? "&hilit=$u_hilit" : ''); + $view_topic_url = append_sid('viewtopic', $view_topic_url_params); $replies = (phpbb::$acl->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies']; @@ -825,10 +826,10 @@ if ($keywords || $author || $author_id || $search_id || $submit) 'S_TOPIC_UNAPPROVED' => $topic_unapproved, 'S_POSTS_UNAPPROVED' => $posts_unapproved, - 'U_LAST_POST' => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'], + 'U_LAST_POST' => append_sid('viewtopic', $view_topic_url_params . '&p=' . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'], 'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), 'U_TOPIC_AUTHOR' => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), - 'U_NEWEST_POST' => $view_topic_url . '&view=unread#unread', + 'U_NEWEST_POST' => append_sid('viewtopic', $view_topic_url_params . '&view=unread') . '#unread', 'U_MCP_REPORT' => append_sid('mcp', 'i=reports&mode=reports&t=' . $result_topic_id, true, phpbb::$user->session_id), 'U_MCP_QUEUE' => $u_mcp_queue, ); diff --git a/phpBB/styles/prosilver/template/editor.js b/phpBB/styles/prosilver/template/editor.js index 5631ab67d..9610cf91d 100644 --- a/phpBB/styles/prosilver/template/editor.js +++ b/phpBB/styles/prosilver/template/editor.js @@ -16,7 +16,6 @@ var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == - var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1)); var baseHeight; -onload_functions.push('initInsertions()'); /** * Shows the help messages in the helpline window diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index 6694dfb61..06c4d1e78 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -23,9 +23,16 @@ function jumpto() { var page = prompt(jump_page, on_page); - if (page !== null && !isNaN(page) && page > 0) + if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0) { - document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page); + if (base_url.indexOf('?') == -1) + { + document.location.href = base_url + '?start=' + ((page - 1) * per_page); + } + else + { + document.location.href = base_url.replace(/&/g, '&') + '&start=' + ((page - 1) * per_page); + } } } diff --git a/phpBB/styles/prosilver/template/posting_editor.html b/phpBB/styles/prosilver/template/posting_editor.html index a6d779e98..f9a26ad31 100644 --- a/phpBB/styles/prosilver/template/posting_editor.html +++ b/phpBB/styles/prosilver/template/posting_editor.html @@ -135,7 +135,7 @@
      - +
      diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html index 535641f33..d7f0608c8 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html +++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html @@ -70,12 +70,12 @@
      {L_POSTS}: {AUTHOR_POSTS}
      {L_JOINED}: {AUTHOR_JOINED}
      {L_LOCATION}: {AUTHOR_FROM}
      - +
      - +
      diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html index a32c4004c..ecd9d5295 100644 --- a/phpBB/styles/prosilver/template/viewtopic_body.html +++ b/phpBB/styles/prosilver/template/viewtopic_body.html @@ -200,7 +200,7 @@
      • {L_PRIVATE_MESSAGE}
      • - +
      • {L_WEBSITE}
      • {L_MSNM}
      • {L_ICQ}
      • diff --git a/phpBB/styles/prosilver/theme/bidi.css b/phpBB/styles/prosilver/theme/bidi.css index a5327bd0d..561bba071 100644 --- a/phpBB/styles/prosilver/theme/bidi.css +++ b/phpBB/styles/prosilver/theme/bidi.css @@ -719,4 +719,7 @@ * tweaks.css */ - +/** Reference: Bug #27155 */ +.rtl #wrap, .rtl .headerbar, .rtl #site-description, .rtl .navbar { + position: relative; +} diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css index 06a05b561..815ccb9f1 100644 --- a/phpBB/styles/prosilver/theme/colours.css +++ b/phpBB/styles/prosilver/theme/colours.css @@ -882,7 +882,7 @@ dl.mini dt { border-color: #5D8FBD; } -pmlist li.pm_foe_colour, .pm_foe_colour { +.pmlist li.pm_foe_colour, .pm_foe_colour { border-color: #000000; } diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index 3a26ceac0..7178fa6e4 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -599,7 +599,7 @@ div.rules { font-size: 1.1em; } -div.rules ul { +div.rules ul, div.rules ol { margin-left: 20px; } diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index c32ec18a6..bb337e95b 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -612,7 +612,8 @@ if (sizeof($topic_list)) topic_status($row, $replies, $unread_topic, $folder_img, $folder_alt, $topic_type); // Generate all the URIs ... - $view_topic_url = append_sid('viewtopic', 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . '&t=' . $topic_id); + $view_topic_url_params = 'f=' . (($row['forum_id']) ? $row['forum_id'] : $forum_id) . '&t=' . $topic_id; + $view_topic_url = append_sid('viewtopic', $view_topic_url_params); $topic_unapproved = (!$row['topic_approved'] && phpbb::$acl->acl_get('m_approve', $forum_id)) ? true : false; $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && phpbb::$acl->acl_get('m_approve', $forum_id)) ? true : false; @@ -664,8 +665,8 @@ if (sizeof($topic_list)) 'S_TOPIC_LOCKED' => ($row['topic_status'] == ITEM_LOCKED) ? true : false, 'S_TOPIC_MOVED' => ($row['topic_status'] == ITEM_MOVED) ? true : false, - 'U_NEWEST_POST' => $view_topic_url . '&view=unread#unread', - 'U_LAST_POST' => $view_topic_url . '&p=' . $row['topic_last_post_id'] . '#p' . $row['topic_last_post_id'], + 'U_NEWEST_POST' => append_sid('viewtopic', $view_topic_url_params . '&view=unread') . '#unread', + 'U_LAST_POST' => append_sid('viewtopic', $view_topic_url_params . '&p=' . $row['topic_last_post_id']) . '#p' . $row['topic_last_post_id'], 'U_LAST_POST_AUTHOR' => get_username_string('profile', $row['topic_last_poster_id'], $row['topic_last_poster_name'], $row['topic_last_poster_colour']), 'U_TOPIC_AUTHOR' => get_username_string('profile', $row['topic_poster'], $row['topic_first_poster_name'], $row['topic_first_poster_colour']), 'U_VIEW_TOPIC' => $view_topic_url, diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php index d252716d5..5d0192dd1 100644 --- a/phpBB/viewonline.php +++ b/phpBB/viewonline.php @@ -186,7 +186,7 @@ while ($row = phpbb::$db->sql_fetchrow($result)) continue; } - preg_match('#^([a-z/]+)#i', $row['session_page'], $on_page); + preg_match('#^([a-z/_]+)#i', $row['session_page'], $on_page); if (!sizeof($on_page)) { $on_page[1] = ''; diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 7f20a7f4b..e66e1a702 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -262,9 +262,9 @@ phpbb::$db->sql_freeresult($result); if (!$topic_data) { // If post_id was submitted, we try at least to display the topic as a last resort... - if ($post_id && $forum_id && $topic_id) + if ($post_id && $topic_id) { - redirect(append_sid('viewtopic', "f=$forum_id&t=$topic_id")); + redirect(append_sid('viewtopic', "t=$topic_id" . (($forum_id) ? "&f=$forum_id" : ''))); } trigger_error('NO_TOPIC'); @@ -605,7 +605,7 @@ phpbb::$template->assign_vars(array( 'S_SINGLE_MODERATOR' => (!empty($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id]) > 1) ? false : true, 'S_TOPIC_ACTION' => append_sid('viewtopic', "f=$forum_id&t=$topic_id&start=$start"), 'S_TOPIC_MOD' => ($topic_mod != '') ? '' : '', - 'S_MOD_ACTION' => append_sid('mcp', "f=$forum_id&t=$topic_id&quickmod=1&redirect=" . urlencode(str_replace('&', '&', $viewtopic_url)), true, phpbb::$user->session_id), + 'S_MOD_ACTION' => append_sid('mcp', "f=$forum_id&t=$topic_id&start=$start&quickmod=1&redirect=" . urlencode(str_replace('&', '&', $viewtopic_url)), true, $user->session_id), 'S_VIEWTOPIC' => true, 'S_DISPLAY_SEARCHBOX' => (phpbb::$acl->acl_get('u_search') && phpbb::$acl->acl_get('f_search', $forum_id) && phpbb::$config['load_search']) ? true : false, @@ -1144,7 +1144,10 @@ phpbb::$db->sql_freeresult($result); // Load custom profile fields if (phpbb::$config['load_cpf_viewtopic']) { - include(PHPBB_ROOT_PATH . 'includes/functions_profile_fields.' . PHP_EXT); + if (!class_exists('custom_profile')) + { + include(PHPBB_ROOT_PATH . 'includes/functions_profile_fields.' . PHP_EXT); + } $cp = new custom_profile(); // Grab all profile fields from users in id cache for later use - similar to the poster cache @@ -1422,7 +1425,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'POSTER_WARNINGS' => $user_cache[$poster_id]['warnings'], 'POSTER_AGE' => $user_cache[$poster_id]['age'], - 'POST_DATE' => phpbb::$user->format_date($row['post_time']), + 'POST_DATE' => phpbb::$user->format_date($row['post_time'], false, ($view == 'print') ? true : false), 'POST_SUBJECT' => $row['post_subject'], 'MESSAGE' => $message, 'SIGNATURE' => ($row['enable_sig']) ? $user_cache[$poster_id]['sig'] : '', @@ -1515,7 +1518,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) unset($rowset, $user_cache); // Update topic view and if necessary attachment view counters ... but only for humans and if this is the first 'page view' -if (isset(phpbb::$user->data['session_page']) && !phpbb::$user->is_bot && strpos(phpbb::$user->data['session_page'], '&t=' . $topic_id) === false) +if (isset(phpbb::$user->data['session_page']) && !phpbb::$user->is_bot && (strpos(phpbb::$user->data['session_page'], '&t=' . $topic_id) === false || isset(phpbb::$user->data['session_created']))) { $sql = 'UPDATE ' . TOPICS_TABLE . ' SET topic_views = topic_views + 1, topic_last_view_time = ' . time() . " -- 2.11.4.GIT