diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index 78c876808b..836d2556f8 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -430,6 +430,21 @@ function validate_config_vars($config_vars, &$cfg_array, &$error) break; + // Absolute path + case 'lang': + if (!$cfg_array[$config_name]) + { + break; + } + + $cfg_array[$config_name] = basename($cfg_array[$config_name]); + + if (!file_exists($phpbb_root_path . 'language/' . $cfg_array[$config_name] . '/')) + { + $error[] = $user->lang['WRONG_DATA_LANG']; + } + break; + // Relative path (appended $phpbb_root_path) case 'rpath': case 'rwpath': diff --git a/phpBB/adm/style/acp_ban.html b/phpBB/adm/style/acp_ban.html index abc115330c..cbafa554b1 100644 --- a/phpBB/adm/style/acp_ban.html +++ b/phpBB/adm/style/acp_ban.html @@ -60,11 +60,11 @@
-
+
-
+

diff --git a/phpBB/adm/style/acp_bots.html b/phpBB/adm/style/acp_bots.html index 6b531f545e..a80c6db331 100644 --- a/phpBB/adm/style/acp_bots.html +++ b/phpBB/adm/style/acp_bots.html @@ -92,6 +92,7 @@

+

{L_MARK_ALL}{L_UNMARK_ALL}

diff --git a/phpBB/adm/style/acp_update.html b/phpBB/adm/style/acp_update.html index eb4dbbdef4..e82aee0e87 100644 --- a/phpBB/adm/style/acp_update.html +++ b/phpBB/adm/style/acp_update.html @@ -8,7 +8,7 @@

{L_VERSION_CHECK_EXPLAIN}

- +

{L_VERSION_UP_TO_DATE_ACP}

@@ -22,7 +22,7 @@
-
{CURRENT_VERSION}
+
{AUTO_VERSION}{CURRENT_VERSION}
@@ -30,6 +30,12 @@
+ + {L_UPDATE_INSTRUCTIONS_INCOMPLETE} +

+ {UPDATE_INSTRUCTIONS} +

+ {UPDATE_INSTRUCTIONS}

diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css index f81c56846d..b127462814 100644 --- a/phpBB/adm/style/admin.css +++ b/phpBB/adm/style/admin.css @@ -1221,20 +1221,19 @@ input.disabled { } /* Nice method for clearing floated blocks without having to insert any extra markup - From http://www.positioniseverything.net/easyclearing.html */ + From http://www.positioniseverything.net/easyclearing.html .clearfix:after, #tabs:after, .row:after, #content:after, fieldset dl:after, #page-body:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; -} +}*/ -/* Hide from Mac IE, Windows IE uses this as it doesn't support the :after method above \*/ .clearfix, #tabs, .row, #content, fieldset dl, #page-body { height: 1%; + overflow: hidden; } -/* End hide */ /* Syntax Highlighting ---------------------------------------- */ diff --git a/phpBB/adm/style/editor.js b/phpBB/adm/style/editor.js index e82b9d5d62..93d0059609 100644 --- a/phpBB/adm/style/editor.js +++ b/phpBB/adm/style/editor.js @@ -47,7 +47,7 @@ function initInsertions() { textarea.focus(); baseHeight = doc.selection.createRange().duplicate().boundingHeight; - document.body.focus(); + // document.body.focus(); } } diff --git a/phpBB/adm/style/install_update_diff.html b/phpBB/adm/style/install_update_diff.html index 794d285574..54242d94b4 100644 --- a/phpBB/adm/style/install_update_diff.html +++ b/phpBB/adm/style/install_update_diff.html @@ -54,7 +54,7 @@ div#codepanel { } - + /** * Unified Diff */ diff --git a/phpBB/adm/style/viewsource.html b/phpBB/adm/style/viewsource.html index 7f0fde239c..f127c9626f 100644 --- a/phpBB/adm/style/viewsource.html +++ b/phpBB/adm/style/viewsource.html @@ -1,10 +1,10 @@ -
+

{FILENAME}

- +
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index d4821d0d5d..1261d4f57e 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -764,10 +764,10 @@ foreach ($supported_dbms as $dbms) * BOOL => tinyint(1) UNSIGNED * VCHAR => varchar(255) * CHAR:x => char(x) -* XSTEXT => text for storing 1000 characters (topic_title for example) -* STEXT => text for storing 3000 characters (normal input field with a max of 255 single-byte chars) -* TEXT => text for storing 8000 characters (short text, descriptions, comments, etc.) -* MTEXT => mediumtext (post text, large text) +* XSTEXT_UNI => text for storing 100 characters (topic_title for example) +* STEXT_UNI => text for storing 255 characters (normal input field with a max of 255 single-byte chars) - same as VCHAR_UNI +* TEXT_UNI => text for storing 3000 characters (short text, descriptions, comments, etc.) +* MTEXT_UNI => mediumtext (post text, large text) * VCHAR:x => varchar(x) * TIMESTAMP => int(11) UNSIGNED * DECIMAL => decimal number (5,2) @@ -886,8 +886,8 @@ function get_schema_struct() 'ban_start' => array('TIMESTAMP', 0), 'ban_end' => array('TIMESTAMP', 0), 'ban_exclude' => array('BOOL', 0), - 'ban_reason' => array('STEXT', ''), - 'ban_give_reason' => array('STEXT', ''), + 'ban_reason' => array('VCHAR_UNI', ''), + 'ban_give_reason' => array('VCHAR_UNI', ''), ), 'PRIMARY_KEY' => 'ban_id', 'KEYS' => array( diff --git a/phpBB/docs/AUTHORS b/phpBB/docs/AUTHORS index 8033dcea0b..8e648afb43 100644 --- a/phpBB/docs/AUTHORS +++ b/phpBB/docs/AUTHORS @@ -1,16 +1,25 @@ -/* ********************************************************************** *\ -/* *\ -/* phpBB3 © Copyright 2006 phpBB Group *\ -/* *\ -/* [ http://www.phpbb.com/ ] *\ -/* *\ -/* ********************************************************************** *\ +/** +* +* phpBB3 © Copyright 2000, 2002, 2005, 2007 phpBB Group +* http://www.phpbb.com +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, version 2 of the License. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +* +*/ Please see: http://www.phpbb.com/about/team/ for a list of all the people currently involved in phpBB. -phpBB Project Manager : SHS` (Jonathan Stanley) - phpBB Lead Developer : Acyd Burn (Meik Sievertsen) phpBB Developers : DavidMJ (David M.) @@ -23,6 +32,7 @@ phpBB Developers : DavidMJ (David M.) -- Previous Contributors -- phpBB Project Manager : theFinn (James Atkinson) [Founder - 04/2007] + SHS` (Jonathan Stanley) phpBB Lead Developer : psoTFX (Paul S. Owen) [2001 - 09/2005] diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 72fb2d5ad4..39593090f0 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -169,6 +169,7 @@ p a {
', $output); $output = preg_replace('#', ''), array('class="row1"', 'class="row2"', '', '', ''), $output); - + + if (empty($output)) + { + trigger_error('NO_PHPINFO_AVAILABLE', E_USER_WARNING); + } + + $orig_output = $output; + preg_match_all('#
(.*)
#siU', $output, $output); - $output = $output[1][0]; + $output = (!empty($output[1][0])) ? $output[1][0] : $orig_output; $template->assign_var('PHPINFO', $output); } diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 9f2b3579e8..db5bca1ba6 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -249,8 +249,8 @@ parse_css_file = {PARSE_CSS_FILE} while ($row = $db->sql_fetchrow($result)) { - if (@filemtime("{$phpbb_root_path}styles/{$template_row['template_path']}/template/" . $row['template_filename']) > $row['template_mtime']) - { +// if (@filemtime("{$phpbb_root_path}styles/{$template_row['template_path']}/template/" . $row['template_filename']) > $row['template_mtime']) +// { // get folder info from the filename if (($slash_pos = strrpos($row['template_filename'], '/')) === false) { @@ -258,9 +258,9 @@ parse_css_file = {PARSE_CSS_FILE} } else { - $filelist[substr($row['template_filename'], 0, $slash_pos + 1)] = substr($row['template_filename'], $slash_pos + 1, strlen($row['template_filename']) - $slash_pos - 1); + $filelist[substr($row['template_filename'], 0, $slash_pos + 1)][] = substr($row['template_filename'], $slash_pos + 1, strlen($row['template_filename']) - $slash_pos - 1); } - } +// } } $db->sql_freeresult($result); @@ -739,6 +739,8 @@ parse_css_file = {PARSE_CSS_FILE} // destroy the cached version of the template (filename without extension) $this->clear_template_cache($template_info, array(substr($template_file, 0, -5))); + $cache->destroy('sql', STYLES_TABLE); + add_log('admin', 'LOG_TEMPLATE_EDIT', $template_info['template_name'], $template_file); trigger_error($user->lang['TEMPLATE_FILE_UPDATED'] . $additional . adm_back_link($this->u_action . "&action=edit&id=$template_id&text_rows=$text_rows&template_file=$template_file")); } @@ -779,7 +781,7 @@ parse_css_file = {PARSE_CSS_FILE} } else { - $filelist[$file_info['dirname'] . '/'][] = "{$file_info['basename']}.{$file_info['extension']}"; + $filelist[$file_info['dirname'] . '/'][] = $file_info['basename']; } } @@ -2169,6 +2171,14 @@ parse_css_file = {PARSE_CSS_FILE} $filelist = filelist("{$phpbb_root_path}styles/{$style_row['template_path']}/template", '', 'html'); $this->store_templates('insert', $style_id, $style_row['template_path'], $filelist); } + else + { + // We no longer store within the db, but are also not able to update the file structure + // Since the admin want to switch this, we adhere to his decision. But we also need to remove the cache + $sql = 'DELETE FROM ' . STYLES_TEMPLATE_DATA_TABLE . " + WHERE template_id = $style_id"; + $db->sql_query($sql); + } $sql_ary += array( 'template_storedb' => $store_db, diff --git a/phpBB/includes/acp/acp_update.php b/phpBB/includes/acp/acp_update.php index 02d4c6bb3c..03f2db7d15 100644 --- a/phpBB/includes/acp/acp_update.php +++ b/phpBB/includes/acp/acp_update.php @@ -42,15 +42,28 @@ class acp_update $announcement_url = trim($info[1]); $update_link = append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=update'); + // Determine automatic update... + $sql = 'SELECT config_value + FROM ' . CONFIG_TABLE . " + WHERE config_name = 'version_update_from'"; + $result = $db->sql_query($sql); + $version_update_from = (string) $db->sql_fetchfield('config_value'); + $db->sql_freeresult($result); + + $current_version = (!empty($version_update_from)) ? $version_update_from : $config['version']; + + $up_to_date_automatic = (version_compare(str_replace('rc', 'RC', strtolower($current_version)), str_replace('rc', 'RC', strtolower($latest_version)), '<')) ? false : true; $up_to_date = (version_compare(str_replace('rc', 'RC', strtolower($config['version'])), str_replace('rc', 'RC', strtolower($latest_version)), '<')) ? false : true; $template->assign_vars(array( 'S_UP_TO_DATE' => $up_to_date, + 'S_UP_TO_DATE_AUTO' => $up_to_date_automatic, 'S_VERSION_CHECK' => true, 'U_ACTION' => $this->u_action, 'LATEST_VERSION' => $latest_version, 'CURRENT_VERSION' => $config['version'], + 'AUTO_VERSION' => $version_update_from, 'UPDATE_INSTRUCTIONS' => sprintf($user->lang['UPDATE_INSTRUCTIONS'], $announcement_url, $update_link), )); diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index 7d0b00cc25..a7518a287c 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -591,7 +591,7 @@ class auth_admin extends auth ORDER BY left_id'; $result = $db->sql_query($sql); - $forum_names = array(); + $forum_names = array(0 => ''); while ($row = $db->sql_fetchrow($result)) { $forum_names[$row['forum_id']] = $row['forum_name']; diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php index d9200ee182..af8d523ab1 100644 --- a/phpBB/includes/db/firebird.php +++ b/phpBB/includes/db/firebird.php @@ -118,7 +118,7 @@ class dbal_firebird extends dbal { if (strlen($regs[3]) > 32767) { - preg_match_all('/\'(?:[^\']++|\'\')*+\'|\\d+/', $regs[3], $vals, PREG_PATTERN_ORDER); + preg_match_all('/\'(?:[^\']++|\'\')*+\'|[\d-.]+/', $regs[3], $vals, PREG_PATTERN_ORDER); $inserts = $vals[0]; unset($vals); @@ -135,13 +135,13 @@ class dbal_firebird extends dbal $query = $regs[1] . '(' . $regs[2] . ') VALUES (' . implode(', ', $inserts) . ')'; } } - else if (preg_match('/^(UPDATE ([\\w_]++)\\s+SET )([\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|\\d+)(?:,\\s*[\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|\\d+))*+)\\s+(WHERE.*)$/s', $query, $data)) + else if (preg_match('/^(UPDATE ([\\w_]++)\\s+SET )([\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|\\d+)(?:,\\s*[\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]+))*+)\\s+(WHERE.*)$/s', $query, $data)) { if (strlen($data[3]) > 32767) { $update = $data[1]; $where = $data[4]; - preg_match_all('/(\\w++)\\s*=\\s*(\'(?:[^\']++|\'\')*+\'|\\d++)/', $data[3], $temp, PREG_SET_ORDER); + preg_match_all('/(\\w++)\\s*=\\s*(\'(?:[^\']++|\'\')*+\'|[\d-.]++)/', $data[3], $temp, PREG_SET_ORDER); unset($data); $cols = array(); @@ -164,7 +164,7 @@ class dbal_firebird extends dbal } } - if (!function_exists('ibase_affected_rows') && (preg_match('/^UPDATE ([\w_]++)\s+SET [\w_]++\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|\d+)(?:,\s*[\w_]++\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|\d+))*+\s+(WHERE.*)$/s', $query, $regs) || preg_match('/^DELETE FROM ([\w_]++)\s*WHERE\s*(.*)$/s', $query, $regs))) + if (!function_exists('ibase_affected_rows') && (preg_match('/^UPDATE ([\w_]++)\s+SET [\w_]++\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]+)(?:,\s*[\w_]++\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]+))*+\s+(WHERE.*)$/s', $query, $regs) || preg_match('/^DELETE FROM ([\w_]++)\s*WHERE\s*(.*)$/s', $query, $regs))) { $affected_sql = 'SELECT COUNT(*) as num_rows_affected FROM ' . $regs[1] . ' ' . $regs[2]; diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php index 76a920d4b8..888a9fd4bf 100644 --- a/phpBB/includes/db/oracle.php +++ b/phpBB/includes/db/oracle.php @@ -115,7 +115,7 @@ class dbal_oracle extends dbal */ function _rewrite_where($where_clause) { - preg_match_all('/\s*(AND|OR)?\s*([\w_.]++)\s*(?:(=|<>)\s*((?>\'(?>[^\']++|\'\')*+\'|\d+))|((NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|\d+,? ?)*+\)))/', $where_clause, $result, PREG_SET_ORDER); + preg_match_all('/\s*(AND|OR)?\s*([\w_.]++)\s*(?:(=|<>)\s*((?>\'(?>[^\']++|\'\')*+\'|[\d-.]+))|((NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|[\d-.]+,? ?)*+\)))/', $where_clause, $result, PREG_SET_ORDER); $out = ''; foreach ($result as $val) { @@ -143,7 +143,7 @@ class dbal_oracle extends dbal $in_clause = array(); $sub_exp = substr($val[5], strpos($val[5], '(') + 1, -1); $extra = false; - preg_match_all('/\'(?>[^\']++|\'\')*+\'|\d++/', $sub_exp, $sub_vals, PREG_PATTERN_ORDER); + preg_match_all('/\'(?>[^\']++|\'\')*+\'|[\d-.]++/', $sub_exp, $sub_vals, PREG_PATTERN_ORDER); $i = 0; foreach ($sub_vals[0] as $sub_val) { @@ -239,7 +239,7 @@ class dbal_oracle extends dbal if (strlen($regs[3]) > 4000) { $cols = explode(', ', $regs[2]); - preg_match_all('/\'(?:[^\']++|\'\')*+\'|\\d+/', $regs[3], $vals, PREG_PATTERN_ORDER); + preg_match_all('/\'(?:[^\']++|\'\')*+\'|\[\d-.]+/', $regs[3], $vals, PREG_PATTERN_ORDER); $inserts = $vals[0]; unset($vals); @@ -256,13 +256,13 @@ class dbal_oracle extends dbal $query = $regs[1] . '(' . $regs[2] . ') VALUES (' . implode(', ', $inserts) . ')'; } } - else if (preg_match_all('/^(UPDATE [\\w_]++\\s+SET )([\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|\\d+)(?:,\\s*[\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|\\d+))*+)\\s+(WHERE.*)$/s', $query, $data, PREG_SET_ORDER)) + else if (preg_match_all('/^(UPDATE [\\w_]++\\s+SET )([\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]+)(?:,\\s*[\\w_]++\\s*=\\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]+))*+)\\s+(WHERE.*)$/s', $query, $data, PREG_SET_ORDER)) { if (strlen($data[0][2]) > 4000) { $update = $data[0][1]; $where = $data[0][3]; - preg_match_all('/([\\w_]++)\\s*=\\s*(\'(?:[^\']++|\'\')*+\'|\\d++)/', $data[0][2], $temp, PREG_SET_ORDER); + preg_match_all('/([\\w_]++)\\s*=\\s*(\'(?:[^\']++|\'\')*+\'|[\d-.]++)/', $data[0][2], $temp, PREG_SET_ORDER); unset($data); $cols = array(); @@ -288,7 +288,7 @@ class dbal_oracle extends dbal switch (substr($query, 0, 6)) { case 'DELETE': - if (preg_match('/^(DELETE FROM [\w_]++ WHERE)((?:\s*(?:AND|OR)?\s*[\w_]+\s*(?:(?:=|<>)\s*(?>\'(?>[^\']++|\'\')*+\'|\d+)|(?:NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|\d+,? ?)*+\)))*+)$/', $query, $regs)) + if (preg_match('/^(DELETE FROM [\w_]++ WHERE)((?:\s*(?:AND|OR)?\s*[\w_]+\s*(?:(?:=|<>)\s*(?>\'(?>[^\']++|\'\')*+\'|[\d-.]+)|(?:NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|[\d-.]+,? ?)*+\)))*+)$/', $query, $regs)) { $query = $regs[1] . $this->_rewrite_where($regs[2]); unset($regs); @@ -296,7 +296,7 @@ class dbal_oracle extends dbal break; case 'UPDATE': - if (preg_match('/^(UPDATE [\\w_]++\\s+SET [\\w_]+\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|\\d++|:\w++)(?:, [\\w_]+\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|\\d++|:\w++))*+\\s+WHERE)(.*)$/s', $query, $regs)) + if (preg_match('/^(UPDATE [\\w_]++\\s+SET [\\w_]+\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]++|:\w++)(?:, [\\w_]+\s*=\s*(?:\'(?:[^\']++|\'\')*+\'|[\d-.]++|:\w++))*+\\s+WHERE)(.*)$/s', $query, $regs)) { $query = $regs[1] . $this->_rewrite_where($regs[2]); unset($regs); @@ -304,7 +304,7 @@ class dbal_oracle extends dbal break; case 'SELECT': - $query = preg_replace_callback('/([\w_.]++)\s*(?:(=|<>)\s*(?>\'(?>[^\']++|\'\')*+\'|\d++|([\w_.]++))|(?:NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|\d++,? ?)*+\))/', array($this, '_rewrite_col_compare'), $query); + $query = preg_replace_callback('/([\w_.]++)\s*(?:(=|<>)\s*(?>\'(?>[^\']++|\'\')*+\'|[\d-.]++|([\w_.]++))|(?:NOT )?IN\s*\((?>\'(?>[^\']++|\'\')*+\',? ?|[\d-.]++,? ?)*+\))/', array($this, '_rewrite_col_compare'), $query); break; } diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index a91bddd9b8..caf26bf379 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -472,7 +472,7 @@ if (!function_exists('stripos')) if (!function_exists('realpath')) { - if (substr(PHP_OS, 0, 3) != 'WIN' && !(bool) ini_get('safe_mode') && function_exists('shell_exec') && trim(`realpath .`)) + if (DIRECTORY_SEPARATOR != '\\' && !(bool) ini_get('safe_mode') && function_exists('shell_exec') && trim(`realpath .`)) { /** * @author Chris Smith @@ -497,7 +497,7 @@ if (!function_exists('realpath')) */ function is_absolute($path) { - return ($path[0] == '/' || (substr(PHP_OS, 0, 3) == 'WIN' && preg_match('#^[a-z]:/#i', $path))) ? true : false; + return ($path[0] == '/' || (DIRECTORY_SEPARATOR == '\\' && preg_match('#^[a-z]:/#i', $path))) ? true : false; } /** @@ -3608,7 +3608,7 @@ function phpbb_checkdnsrr($host, $type = '') { $type = (!$type) ? 'MX' : $type; - if (strpos(PHP_OS, 'WIN') !== false) + if (DIRECTORY_SEPARATOR == '\\') { if (!function_exists('exec')) { diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index 414f6f2f20..4037fb4872 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -224,7 +224,13 @@ function make_uid($timestamp) */ function validate_website($url) { - return ($url == 'http://') ? '' : $url; + if ($url === 'http://'){ + return ''; + } + else if (strpos(strtolower($url), 'http://') !== 0) + { + return 'http://' . $url; + } } /** @@ -2413,4 +2419,14 @@ function get_smiley_display() return ($smiley_count < 50) ? 1 : 0; } + +function fill_dateformat($user_dateformat) +{ + global $config; + + return ((empty($user_dateformat)) ? $config['default_dateformat'] : $user_dateformat); +} + + + ?> \ No newline at end of file diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index 61ac1883b3..133ef294b0 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -13,14 +13,7 @@ */ function can_load_dll($dll) { - global $suffix; - - if (empty($suffix)) - { - $suffix = (defined('PHP_OS') && strpos(strtolower(PHP_OS), 'win') === 0) ? 'dll' : 'so'; - } - - return ((@ini_get('enable_dl') || strtolower(@ini_get('enable_dl')) == 'on') && (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') && @dl($dll . ".$suffix")) ? true : false; + return ((@ini_get('enable_dl') || strtolower(@ini_get('enable_dl')) == 'on') && (!@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'off') && @dl($dll . '.' . PHP_SHLIB_SUFFIX)) ? true : false; } /** diff --git a/phpBB/includes/functions_jabber.php b/phpBB/includes/functions_jabber.php index eb2a7245a5..def15c67c7 100644 --- a/phpBB/includes/functions_jabber.php +++ b/phpBB/includes/functions_jabber.php @@ -12,7 +12,7 @@ * * Jabber class from Flyspray project * -* @version class.jabber2.php 1244 2007-05-28 +* @version class.jabber2.php 1306 2007-06-21 * @copyright 2006 Flyspray.org * @author: Florian Schmitz (floele) * @@ -31,6 +31,7 @@ class jabber var $username; var $password; var $use_ssl; + var $resource = 'functions_jabber.phpbb.php'; var $enable_logging; var $log_array; @@ -76,17 +77,31 @@ class jabber return false; } - // Make sure the encryption stream is supported + /** + * Make sure the encryption stream is supported + * Also seem to work without the crypto stream if correctly compiled + $streams = stream_get_wrappers(); if (!in_array('streams.crypto', $streams)) { return false; } + */ return true; } + /** + * Sets the resource which is used. No validation is done here, only escaping. + * @param string $name + * @access public + */ + function set_resource($name) + { + $this->resource = $name; + } + /** * Connect */ @@ -126,7 +141,7 @@ class jabber // disconnect gracefully if (isset($this->session['sent_presence'])) { - $this->presence('offline', '', true); + $this->send_presence('offline', '', true); } $this->send(''); @@ -379,7 +394,7 @@ class jabber } // go on with authentication? - if (isset($this->features['stream:features'][0]['#']['bind'])) + if (isset($this->features['stream:features'][0]['#']['bind']) || $this->session['tls']) { return $this->response($this->features); } @@ -394,9 +409,9 @@ class jabber $this->send(" - functions_jabber.phpbb.php + " . utf8_htmlspecialchars($this->resource) . ' - "); + '); return $this->response($this->listen()); } diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 26ff1491fb..b2cb5ec054 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -52,7 +52,7 @@ class messenger $this->addresses['to'][$pos]['email'] = trim($address); // If empty sendmail_path on windows, PHP changes the to line - if (!$config['smtp_delivery'] && strpos(strtolower(PHP_OS), 'win') === 0) + if (!$config['smtp_delivery'] && DIRECTORY_SEPARATOR == '\\') { $this->addresses['to'][$pos]['name'] = ''; } @@ -556,6 +556,7 @@ class queue $fp = @fopen($this->cache_file . '.lock', 'wb'); fclose($fp); + @chmod($this->cache_file . '.lock', 0666); include($this->cache_file); @@ -683,6 +684,8 @@ class queue fwrite($fp, "queue_data = " . var_export($this->queue_data, true) . ";\n?>"); @flock($fp, LOCK_UN); fclose($fp); + + @chmod($this->cache_file, 0666); } } @@ -722,6 +725,8 @@ class queue fwrite($fp, "queue_data = " . var_export($this->data, true) . ";\n?>"); @flock($fp, LOCK_UN); fclose($fp); + + @chmod($this->cache_file, 0666); } } } diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index bbb44d4b3d..1010de643b 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -123,6 +123,22 @@ class p_master // Re-index (this is needed, else we are not able to array_slice later) $this->module_cache['modules'] = array_merge($this->module_cache['modules']); + // Include MOD _info files for populating language entries within the menus + if (file_exists($user->lang_path . 'mods')) + { + $add_files = array(); + + foreach (glob($user->lang_path . 'mods/info_' . strtolower($this->p_class) . '_*.' . $phpEx, GLOB_NOSORT) as $file) + { + $add_files[] = 'mods/' . substr(basename($file), 0, -(strlen($phpEx) + 1)); + } + + if (sizeof($add_files)) + { + $user->add_lang($add_files); + } + } + // Now build the module array, but exclude completely empty categories... $right_id = false; $names = array(); diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 282e74fa7c..21b2677483 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -115,11 +115,16 @@ function update_post_information($type, $ids, $return_update_sql = false) { global $db; + if (empty($ids)) + { + return; + } if (!is_array($ids)) { $ids = array($ids); } + $update_sql = $empty_forums = $not_empty_forums = array(); if ($type != 'topic') @@ -1310,6 +1315,29 @@ function delete_post($forum_id, $topic_id, $post_id, &$data) $db->sql_transaction('begin'); + // we must make sure to update forums that contain the shadow'd topic + if ($post_mode == 'delete_topic') + { + $shadow_forum_ids = array(); + + $sql = 'SELECT forum_id + FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_moved_id', $topic_id); + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + if (!isset($shadow_forum_ids[(int) $row['forum_id']])) + { + $shadow_forum_ids[(int) $row['forum_id']] = 1; + } + else + { + $shadow_forum_ids[(int) $row['forum_id']]++; + } + } + $db->sql_freeresult($result); + } + if (!delete_posts('post_id', array($post_id), false, false)) { // Try to delete topic, we may had an previous error causing inconsistency @@ -1327,6 +1355,15 @@ function delete_post($forum_id, $topic_id, $post_id, &$data) switch ($post_mode) { case 'delete_topic': + + foreach ($shadow_forum_ids as $updated_forum => $topic_count) + { + // counting is fun! we only have to do sizeof($forum_ids) number of queries, + // even if the topic is moved back to where its shadow lives (we count how many times it is in a forum) + $db->sql_query('UPDATE ' . FORUMS_TABLE . ' SET forum_topics_real = forum_topics_real - ' . $topic_count . ', forum_topics = forum_topics - ' . $topic_count . ' WHERE forum_id = ' . $updated_forum); + update_post_information('forum', $updated_forum); + } + delete_topics('topic_id', array($topic_id), false); if ($data['topic_type'] != POST_GLOBAL) @@ -2005,6 +2042,8 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u // We make a new topic // We reply to a topic // We edit the last post in a topic and this post is the latest in the forum (maybe) + // We edit the only post in the topic + // We edit the first post in the topic and all the other posts are not approved if (($post_mode == 'post' || $post_mode == 'reply') && $post_approved) { $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_id = ' . $data['post_id']; @@ -2014,9 +2053,9 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_name = '" . $db->sql_escape((!$user->data['is_registered'] && $username) ? $username : (($user->data['user_id'] != ANONYMOUS) ? $user->data['username'] : '')) . "'"; $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_poster_colour = '" . $db->sql_escape($user->data['user_colour']) . "'"; } - else if ($post_mode == 'edit_last_post') + else if ($post_mode == 'edit_last_post' || $post_mode == 'edit_topic' || ($post_mode == 'edit_first_post' && !$data['topic_replies'])) { - // edit_last_post does not _necessarily_ mean that we must update the info again, + // this does not _necessarily_ mean that we must update the info again, // it just means that we might have to $sql = 'SELECT forum_last_post_id, forum_last_post_subject FROM ' . FORUMS_TABLE . ' @@ -2025,7 +2064,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - // this post is the last post in the forum, better update + // this post is the latest post in the forum, better update if ($row['forum_last_post_id'] == $data['post_id']) { if ($post_approved && $row['forum_last_post_subject'] !== $subject) @@ -2065,7 +2104,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u } else { - // just our luck, the last topic in the forum has just been globalized... + // just our luck, the last topic in the forum has just been turned unapproved... $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_id = 0'; $sql_data[FORUMS_TABLE]['stat'][] = "forum_last_post_subject = ''"; $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_time = 0'; @@ -2164,13 +2203,13 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u $sql_data[TOPICS_TABLE]['stat'][] = "topic_last_post_subject = '" . $db->sql_escape($subject) . "'"; $sql_data[TOPICS_TABLE]['stat'][] = 'topic_last_post_time = ' . (int) $current_time; } - else if ($post_mode == 'edit_last_post') + else if ($post_mode == 'edit_last_post' || $post_mode == 'edit_topic' || ($post_mode == 'edit_first_post' && !$data['topic_replies'])) { // only the subject can be changed from edit $sql_data[TOPICS_TABLE]['stat'][] = "topic_last_post_subject = '" . $db->sql_escape($subject) . "'"; } } - else if (!$data['post_approved'] && $post_mode == 'edit_last_post') + else if (!$data['post_approved'] && ($post_mode == 'edit_last_post' || $post_mode == 'edit_topic' || ($post_mode == 'edit_first_post' && !$data['topic_replies']))) { // like having the rug pulled from under us $sql = 'SELECT MAX(post_id) as last_post_id @@ -2248,7 +2287,10 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u trigger_error('NO_SUCH_SEARCH_MODULE'); } - require_once("{$phpbb_root_path}includes/search/$search_type.$phpEx"); + if (!class_exists($search_type)) + { + include("{$phpbb_root_path}includes/search/$search_type.$phpEx"); + } $error = false; $search = new $search_type($error); diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index 47d3ae03a9..7c5e39c3a7 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -469,8 +469,8 @@ class custom_profile // case 'datetime': case 'date': $date = explode('-', $value); - $month = (isset($date[0])) ? (int) $date[0] : 0; - $day = (isset($date[1])) ? (int) $date[1] : 0; + $day = (isset($date[0])) ? (int) $date[0] : 0; + $month = (isset($date[1])) ? (int) $date[1] : 0; $year = (isset($date[2])) ? (int) $date[2] : 0; if (!$day && !$month && !$year) @@ -479,7 +479,8 @@ class custom_profile } else if ($day && $month && $year) { - return sprintf('%4d-%02d-%02d', $year, $month, $day); + global $user; + return $user->format_date(mktime(0, 0, 0, $month, $day, $year), $user->lang['DATE_FORMAT'], true); } return $value; diff --git a/phpBB/includes/functions_template.php b/phpBB/includes/functions_template.php index aacb4c6ddb..0d8a39eaee 100644 --- a/phpBB/includes/functions_template.php +++ b/phpBB/includes/functions_template.php @@ -752,8 +752,7 @@ class template_compile @flock($fp, LOCK_UN); @fclose($fp); - @umask(0); - @chmod($filename, 0644); + @chmod($filename, 0666); } return; diff --git a/phpBB/includes/mcp/mcp_ban.php b/phpBB/includes/mcp/mcp_ban.php index c317260a2e..f2ecbdef5b 100644 --- a/phpBB/includes/mcp/mcp_ban.php +++ b/phpBB/includes/mcp/mcp_ban.php @@ -37,7 +37,7 @@ class mcp_ban { // Grab the list of entries - $ban = request_var('ban', ''); + $ban = request_var('ban', '', ($mode === 'user') true ? false); $ban_len = request_var('banlength', 0); $ban_len_other = request_var('banlengthother', ''); $ban_exclude = request_var('banexclude', 0); diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index be94521b14..8617cb5ca7 100755 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -451,6 +451,8 @@ function close_report($report_id_list, $mode, $action) $redirect = request_var('redirect', build_url(array('_f_', 'quickmod'))); } $success_msg = ''; + $forum_ids = array(); + $topic_ids = array(); $s_hidden_fields = build_hidden_fields(array( 'i' => 'reports', @@ -586,6 +588,13 @@ function close_report($report_id_list, $mode, $action) $messenger->send($reporter['user_notify_type']); } } + + foreach($post_info as $post) + { + $forum_ids[$post['forum_id']] = $post['forum_id']; + $topic_ids[$post['topic_id']] = $post['topic_id']; + } + unset($notify_reporters, $post_info, $reports); $messenger->save_queue(); @@ -607,7 +616,18 @@ function close_report($report_id_list, $mode, $action) else { meta_refresh(3, $redirect); - trigger_error($user->lang[$success_msg] . '

' . sprintf($user->lang['RETURN_PAGE'], "", '')); + $return_forum = ''; + if (sizeof($forum_ids == 1)) + { + $return_forum = sprintf($user->lang['RETURN_FORUM'], '', '') . '

'; + } + $return_topic = ''; + if (sizeof($topic_ids == 1)) + { + $return_topic = sprintf($user->lang['RETURN_TOPIC'], '', '') . '

'; + } + + trigger_error($user->lang[$success_msg] . '

' . $return_forum . $return_topic . sprintf($user->lang['RETURN_PAGE'], "", '')); } } diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 1a70a7fd80..3579467bff 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -1229,7 +1229,7 @@ class parse_message extends bbcode_firstpass while ($row = $db->sql_fetchrow($result)) { // (assertion) - $match[] = '#(?<=^|[\n .])' . preg_quote($row['code'], '#') . '(?![^<>]*>)#'; + $match[] = '(?<=^|[\n .])' . preg_quote($row['code'], '#') . '(?![^<>]*>)'; $replace[] = '' . $row['code'] . ''; } $db->sql_freeresult($result); @@ -1239,7 +1239,7 @@ class parse_message extends bbcode_firstpass { if ($max_smilies) { - $num_matches = preg_match_all('#' . str_replace('#', '', implode('|', $match)) . '#', $this->message, $matches); + $num_matches = preg_match_all('#' . implode('|', $match) . '#', $this->message, $matches); unset($matches); if ($num_matches !== false && $num_matches > $max_smilies) @@ -1249,7 +1249,8 @@ class parse_message extends bbcode_firstpass } } - $this->message = trim(preg_replace($match, $replace, $this->message)); + // Make sure the delimiter # is added in front and at the end of every element within $match + $this->message = trim(preg_replace(explode(chr(0), '#' . implode('#' . chr(0) . '#', $match) . '#'), $replace, $this->message)); } } diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index c297a961a8..495fdcee48 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -43,6 +43,7 @@ class session if (!$script_name) { $script_name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI'); + $script_name = (($pos = strpos($script_name, '?')) !== false) ? substr($script_name, 0, strpos($script_name, '?')) : $script_name; $page_array['failover'] = 1; } @@ -884,13 +885,13 @@ class session { if (!is_array($user_ips)) { - $ip_banned = preg_match('#^' . str_replace('*', '.*?', $row['ban_ip']) . '$#i', $user_ips); + $ip_banned = preg_match('#^' . str_replace('\*', '.*?', preg_quote($row['ban_ip'], '#')) . '$#i', $user_ips); } else { foreach ($user_ips as $user_ip) { - if (preg_match('#^' . str_replace('*', '.*?', $row['ban_ip']) . '$#i', $user_ip)) + if (preg_match('#^' . str_replace('\*', '.*?', preg_quote($row['ban_ip'], '#')) . '$#i', $user_ip)) { $ip_banned = true; break; @@ -901,7 +902,7 @@ class session if ((!empty($row['ban_userid']) && intval($row['ban_userid']) == $user_id) || $ip_banned || - (!empty($row['ban_email']) && preg_match('#^' . str_replace('*', '.*?', $row['ban_email']) . '$#i', $user_email))) + (!empty($row['ban_email']) && preg_match('#^' . str_replace('\*', '.*?', preg_quote($row['ban_email'], '#')) . '$#i', $user_email))) { if (!empty($row['ban_exclude'])) { @@ -917,7 +918,7 @@ class session { $ban_triggered_by = 'user'; } - else if (!empty($row['ban_ip']) && preg_match('#^' . str_replace('*', '.*?', $row['ban_ip']) . '$#i', $user_ips)) + else if (!empty($row['ban_ip']) && preg_match('#^' . str_replace('\*', '.*?', preg_quote($row['ban_ip'], '#')) . '$#i', $user_ips)) { $ban_triggered_by = 'ip'; } @@ -1510,29 +1511,32 @@ class user extends session } } - // Make sure the user is able to hide his session - if (!$this->data['session_viewonline']) + if (isset($this->data['session_viewonline'])) { - // Reset online status if not allowed to hide the session... - if (!$auth->acl_get('u_hideonline')) + // Make sure the user is able to hide his session + if (!$this->data['session_viewonline']) { - $sql = 'UPDATE ' . SESSIONS_TABLE . ' - SET session_viewonline = 1 - WHERE session_user_id = ' . $this->data['user_id']; - $db->sql_query($sql); - $this->data['session_viewonline'] = 1; + // Reset online status if not allowed to hide the session... + if (!$auth->acl_get('u_hideonline')) + { + $sql = 'UPDATE ' . SESSIONS_TABLE . ' + SET session_viewonline = 1 + WHERE session_user_id = ' . $this->data['user_id']; + $db->sql_query($sql); + $this->data['session_viewonline'] = 1; + } } - } - else if (!$this->data['user_allow_viewonline']) - { - // the user wants to hide and is allowed to -> cloaking device on. - if ($auth->acl_get('u_hideonline')) + else if (!$this->data['user_allow_viewonline']) { - $sql = 'UPDATE ' . SESSIONS_TABLE . ' - SET session_viewonline = 0 - WHERE session_user_id = ' . $this->data['user_id']; - $db->sql_query($sql); - $this->data['session_viewonline'] = 0; + // the user wants to hide and is allowed to -> cloaking device on. + if ($auth->acl_get('u_hideonline')) + { + $sql = 'UPDATE ' . SESSIONS_TABLE . ' + SET session_viewonline = 0 + WHERE session_user_id = ' . $this->data['user_id']; + $db->sql_query($sql); + $this->data['session_viewonline'] = 0; + } } } @@ -1624,9 +1628,18 @@ class user extends session // - add appropriate variables here, name them as they are used within the language file... if (!$use_db) { - if ((include($this->lang_path . (($use_help) ? 'help_' : '') . "$lang_file.$phpEx")) === false) + if ($use_help && strpos($lang_file, '/') !== false) { - trigger_error("Language file {$this->lang_path}" . (($use_help) ? 'help_' : '') . "$lang_file.$phpEx couldn't be opened.", E_USER_ERROR); + $language_filename = $this->lang_path . substr($lang_file, 0, stripos($lang_file, '/') + 1) . 'help_' . substr($lang_file, stripos($lang_file, '/') + 1) . '.' . $phpEx; + } + else + { + $language_filename = $this->lang_path . (($use_help) ? 'help_' : '') . $lang_file . '.' . $phpEx; + } + + if ((include($language_filename)) === false) + { + trigger_error("Language file $language_filename couldn't be opened.", E_USER_ERROR); } } else if ($use_db) diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index d926801b2f..d517ca2d1b 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -812,7 +812,7 @@ class ucp_groups $user->add_lang('acp/groups'); // Approve, demote or promote - group_user_attributes('approve', $group_id, $mark_ary, false, ($group_id) ? $group_row['group_name'] : false); + group_user_attributes('approve', $group_id, $mark_ary, false, false); trigger_error($user->lang['USERS_APPROVED'] . '

' . sprintf($user->lang['RETURN_PAGE'], '', '')); @@ -836,6 +836,8 @@ class ucp_groups trigger_error($user->lang['NOT_LEADER_OF_GROUP'] . $return_page); } + $group_row['group_name'] = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name']; + if (confirm_box(true)) { if (!sizeof($mark_ary)) @@ -910,6 +912,8 @@ class ucp_groups trigger_error($user->lang['NOT_LEADER_OF_GROUP'] . $return_page); } + $group_row['group_name'] = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name']; + if (confirm_box(true)) { if (!$group_id) diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 105dda1d8c..e296ad12b1 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -345,6 +345,8 @@ function compose_pm($id, $mode, $action) // "{$phpbb_root_path}ucp.$phpEx?i=pm&mode=compose" confirm_box(false, 'DELETE_MESSAGE', build_hidden_fields($s_hidden_fields)); } + + redirect(append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=view&action=view_message&p=' . $msg_id)); } // Handle User/Group adding/removing diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index 8a10254a6e..b0e8f098c2 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -123,6 +123,7 @@ class ucp_prefs 'S_DST' => $data['dst'], 'DATE_FORMAT' => $data['dateformat'], + 'A_DATE_FORMAT' => addslashes($data['dateformat']), 'S_DATEFORMAT_OPTIONS' => $dateformat_options, 'S_CUSTOM_DATEFORMAT' => $s_custom, 'DEFAULT_DATEFORMAT' => $config['default_dateformat'], diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index 796c2e19d4..2a542dd6fa 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -31,7 +31,7 @@ unset($dbpasswd); */ $convertor_data = array( 'forum_name' => 'phpBB 2.0.x', - 'version' => '1.0.RC2', + 'version' => '1.0.RC3', 'phpbb_version' => '3.0.0', 'author' => 'phpBB Group', 'dbms' => $dbms, @@ -540,7 +540,7 @@ if (!$get_info) 'autoincrement' => 'smiley_id', array('smiley_id', 'smilies.smilies_id', ''), - array('code', 'smilies.code', 'phpbb_set_encoding'), + array('code', 'smilies.code', array('function1' => 'phpbb_smilie_html_decode', 'function2' => 'phpbb_set_encoding', 'function3' => 'utf8_htmlspecialchars')), array('emotion', 'smilies.emoticon', 'phpbb_set_encoding'), array('smiley_url', 'smilies.smile_url', 'import_smiley'), array('smiley_width', 'smilies.smile_url', 'get_smiley_width'), @@ -862,7 +862,7 @@ if (!$get_info) array('user_lang', $config['default_lang'], ''), array('', 'users.user_lang', ''), array('user_timezone', 'users.user_timezone', ''), - array('user_dateformat', 'users.user_dateformat', array('function1' => 'phpbb_set_encoding')), + array('user_dateformat', 'users.user_dateformat', array('function1' => 'phpbb_set_encoding', 'function2' => 'fill_dateformat')), array('user_inactive_reason', '', 'phpbb_inactive_reason'), array('user_inactive_time', '', 'phpbb_inactive_time'), diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index eca72b64bd..443855403b 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -216,10 +216,10 @@ function phpbb_insert_forums() 'forum_type' => FORUM_POST, 'forum_status' => is_item_locked($row['forum_status']), 'enable_prune' => ($prune_enabled) ? $row['prune_enable'] : 0, - 'prune_next' => null_to_zero($row['prune_next']), - 'prune_days' => null_to_zero($row['prune_days']), + 'prune_next' => (int) null_to_zero($row['prune_next']), + 'prune_days' => (int) null_to_zero($row['prune_days']), 'prune_viewed' => 0, - 'prune_freq' => null_to_zero($row['prune_freq']), + 'prune_freq' => (int) null_to_zero($row['prune_freq']), 'forum_flags' => phpbb_forum_flags(), @@ -1439,6 +1439,16 @@ function phpbb_avatar_type($type) return 0; } + +/** +* Just undos the replacing of '<' and '>' +*/ +function phpbb_smilie_html_decode($code) +{ + $code = str_replace('<', '<', $code); + return str_replace('>', '>', $code); +} + /** * Transfer avatars, copying the image if it was uploaded */ diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 56327f3a8c..fc5851804c 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -8,7 +8,7 @@ * */ -$updates_to_version = '3.0.RC2'; +$updates_to_version = '3.0.RC3'; if (defined('IN_PHPBB') && defined('IN_INSTALL')) { @@ -332,6 +332,16 @@ $database_update_info = array( ), ), ), + // Changes from 3.0.RC2 to the next version + '3.0.RC2' => array( + // Remove the following keys + 'change_columns' => array( + BANLIST_TABLE => array( + 'ban_reason' => array('VCHAR_UNI', ''), + 'ban_give_reason' => array('VCHAR_UNI', ''), + ), + ), + ), ); // Determine mapping database type @@ -620,10 +630,47 @@ if (version_compare($current_version, '3.0.RC1', '<=')) $no_updates = false; } -//if (version_compare($current_version, '3.0.RC2', '<=')) -//{ -// $no_updates = false; -//} +if (version_compare($current_version, '3.0.RC2', '<=')) +{ + $smileys = array(); + $sql = 'SELECT smiley_id, code + FROM ' . SMILIES_TABLE; + + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $smileys[$row['smiley_id']] = $row['code']; + } + $db->sql_freeresult($result); + + foreach($smileys as $id => $code) + { + // 2.0 only entitized lt and gt; We need to do something about double quotes. + if (strchr($code, '"') === false) + { + continue; + } + $new_code = str_replace('&', '&', $code); + $new_code = str_replace('<', '<', $new_code); + $new_code = str_replace('>', '>', $new_code); + $new_code = utf8_htmlspecialchars($new_code); + $sql = 'UPDATE ' . SMILIES_TABLE . ' + SET code = \'' . $db->sql_escape($new_code) . '\' + WHERE smiley_id = ' . (int)$id; + $db->sql_query($sql); + } + + $index_list = sql_list_index($map_dbms, ACL_ROLES_DATA_TABLE); + + if (in_array('ath_opt_id', $index_list)) + { + sql_index_drop($map_dbms, 'ath_opt_id', ACL_ROLES_DATA_TABLE); + sql_create_index($map_dbms, 'ath_op_id', ACL_ROLES_DATA_TABLE, array('auth_option_id')); + } + + $no_updates = false; +} _write_result($no_updates, $errored, $error_ary); @@ -647,6 +694,10 @@ $sql = "UPDATE " . CONFIG_TABLE . " WHERE config_name = 'version'"; _sql($sql, $errored, $error_ary); +// Reset permissions +$sql = 'UPDATE ' . USERS_TABLE . " + SET user_permissions = ''"; +_sql($sql, $errored, $error_ary); /* Optimize/vacuum analyze the tables where appropriate // this should be done for each version in future along with @@ -777,8 +828,8 @@ function _write_result($no_updates, $errored, $error_ary) for ($i = 0; $i < sizeof($error_ary['sql']); $i++) { - echo '
  • ' . $lang['ERROR'] . ' :: ' . $error_ary['error_code'][$i]['message'] . '
    '; - echo $lang['SQL'] . ' :: ' . $error_ary['sql'][$i] . '

  • '; + echo '
  • ' . $lang['ERROR'] . ' :: ' . htmlspecialchars($error_ary['error_code'][$i]['message']) . '
    '; + echo $lang['SQL'] . ' :: ' . htmlspecialchars($error_ary['sql'][$i]) . '

  • '; } echo '

    ' . $lang['SQL_FAILURE_EXPLAIN'] . '

    '; @@ -1338,6 +1389,86 @@ function sql_create_index($dbms, $index_name, $table_name, $column) } } +// List all of the indices that belong to a table, +// does not count: +// * UNIQUE indices +// * PRIMARY keys +function sql_list_index($dbms, $table_name) +{ + global $dbms_type_map, $db; + global $errored, $error_ary; + + $index_array = array(); + + if ($dbms == 'mssql') + { + $sql = "EXEC sp_statistics '$table_name'"; + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + if ($row['TYPE'] == 3) + { + $index_array[] = $row['INDEX_NAME']; + } + } + $db->sql_freeresult($result); + } + else + { + switch ($dbms) + { + case 'firebird': + $sql = "SELECT LOWER(RDB$INDEX_NAME) as index_name + FROM RDB$INDICES + WHERE RDB$RELATION_NAME = " . strtoupper($table_name) . " + AND RDB$UNIQUE_FLAG IS NULL + AND RDB$FOREIGN_KEY IS NULL"; + $col = 'index_name'; + break; + + case 'postgres': + $sql = "SELECT ic.relname as index_name + FROM pg_class bc, pg_class ic, pg_index i + WHERE (bc.oid = i.indrelid) + AND (ic.oid = i.indexrelid) + AND (bc.relname = '" . $table_name . "') + AND (i.indisunique != 't') + AND (i.indisprimary != 't')"; + $col = 'index_name'; + break; + + case 'mysql_40': + case 'mysql_41': + $sql = 'SHOW KEYS + FROM ' . $table_name .' + WHERE Non_unique = 1'; + $col = 'Key_name'; + break; + + case 'oracle': + $sql = "SELECT index_name + FROM user_indexes + WHERE table_name = '" . $table_name . "' + AND generated = 'N'"; + break; + + case 'sqlite': + $sql = "PRAGMA index_info('" . $table_name . "');"; + $col = 'name'; + break; + } + + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + $index_array[] = $row[$col]; + } + $db->sql_freeresult($result); + } + + return array_map('strtolower', $index_array); +} + /** * Change column type (not name!) */ @@ -1373,7 +1504,16 @@ function sql_column_change($dbms, $table_name, $column_name, $column_data) break; case 'postgres': - $sql = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' SET ' . $column_data['column_type_sql']; + $default_pos = strpos($column_data['column_type_sql'], ' DEFAULT'); + + if ($default_pos === false) + { + $sql = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' TYPE ' . $column_data['column_type_sql']; + } + else + { + $sql = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' TYPE ' . substr($column_data['column_type_sql'], 0, $default_pos) . ', ALTER COLUMN ' . $column_name . ' SET ' . substr($column_data['column_type_sql'], $default_pos + 1); + } _sql($sql, $errored, $error_ary); break; diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 5244e656c9..7fd4c881c6 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -380,7 +380,7 @@ class install_install extends module } // Can we find Imagemagick anywhere on the system? - $exe = (defined('PHP_OS') && strpos(strtolower(PHP_OS), 'win') === 0) ? '.exe' : ''; + $exe = (DIRECTORY_SEPARATOR == '\\') ? '.exe' : ''; $magic_home = getenv('MAGICK_HOME'); $img_imagick = ''; @@ -868,8 +868,6 @@ class install_install extends module $available_dbms = get_available_dbms($dbms); $check_exts = array_merge(array($available_dbms[$dbms]['MODULE']), $this->php_dlls_other); - $suffix = (defined('PHP_OS') && strpos(strtolower(PHP_OS), 'win') === 0) ? 'dll' : 'so'; - foreach ($check_exts as $dll) { if (!@extension_loaded($dll)) @@ -879,7 +877,7 @@ class install_install extends module continue; } - $load_extensions[] = "$dll.$suffix"; + $load_extensions[] = $dll . '.' . PHP_SHLIB_SUFFIX; } } @@ -892,6 +890,8 @@ class install_install extends module } @fclose($fp); + @chmod($phpbb_root_path . 'cache/install_lock', 0666); + $dbpasswd = htmlspecialchars_decode($dbpasswd); $load_extensions = implode(',', $load_extensions); @@ -919,7 +919,7 @@ class install_install extends module // Assume it will work ... if nothing goes wrong below $written = true; - if (!($fp = @fopen($phpbb_root_path . 'config.'.$phpEx, 'w'))) + if (!($fp = @fopen($phpbb_root_path . 'config.' . $phpEx, 'w'))) { // Something went wrong ... so let's try another method $written = false; @@ -932,6 +932,11 @@ class install_install extends module } @fclose($fp); + + if ($written) + { + @chmod($phpbb_root_path . 'config.' . $phpEx, 0644); + } } if (isset($_POST['dldone'])) diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index 3a68e271ed..bf1912076f 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -408,11 +408,65 @@ class install_update extends module // Add database update to log add_log('admin', 'LOG_UPDATE_PHPBB', $this->current_version, $this->latest_version); - $cache->purge(); + // Refresh prosilver css data - this may cause some unhappy users, but + $sql = 'SELECT * + FROM ' . STYLES_THEME_TABLE . " + WHERE theme_name = 'prosilver'"; + $result = $db->sql_query($sql); + $theme = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($theme) + { + $recache = (empty($theme['theme_data'])) ? true : false; + $update_time = time(); + + // We test for stylesheet.css because it is faster and most likely the only file changed on common themes + if (!$recache && $theme['theme_mtime'] < @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css')) + { + $recache = true; + $update_time = @filemtime("{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme/stylesheet.css'); + } + else if (!$recache) + { + $last_change = $theme['theme_mtime']; + + foreach (glob("{$phpbb_root_path}styles/{$theme['theme_path']}/theme/*.css", GLOB_NOSORT) as $file) + { + if ($last_change < @filemtime($file)) + { + $recache = true; + break; + } + } + } + + if ($recache) + { + include_once($phpbb_root_path . 'includes/acp/acp_styles.' . $phpEx); + + $theme['theme_data'] = acp_styles::db_theme_data($theme); + $theme['theme_mtime'] = $update_time; + + // Save CSS contents + $sql_ary = array( + 'theme_mtime' => $theme['theme_mtime'], + 'theme_data' => $theme['theme_data'] + ); + + $sql = 'UPDATE ' . STYLES_THEME_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' + WHERE theme_id = ' . $theme['theme_id']; + $db->sql_query($sql); + + $cache->destroy('sql', STYLES_THEME_TABLE); + } + } $db->sql_return_on_error(true); $db->sql_query('DELETE FROM ' . CONFIG_TABLE . " WHERE config_name = 'version_update_from'"); $db->sql_return_on_error(false); + + $cache->purge(); } break; @@ -776,11 +830,18 @@ class install_update extends module global $phpbb_root_path, $template, $user; $this->tpl_name = 'install_update_diff'; + + // Got the diff template itself updated? If so, we are able to directly use it + if (in_array('adm/style/install_update_diff.html', $this->update_info['files'])) + { + $this->tpl_name = '../../install/update/new/adm/style/install_update_diff'; + } + $this->page_title = 'VIEWING_FILE_DIFF'; $status = request_var('status', ''); $file = request_var('file', ''); - $diff_mode = request_var('diff_mode', 'inline'); + $diff_mode = request_var('diff_mode', 'side_by_side'); // First of all make sure the file is within our file update list with the correct status $found_entry = array(); @@ -852,6 +913,8 @@ class install_update extends module 'S_DIFF_CONFLICT_FILE' => true, 'NUM_CONFLICTS' => $diff->merged_output(false, false, false, true)) ); + + $diff = $this->return_diff($phpbb_root_path . $file, $diff->merged_output()); break; } @@ -947,7 +1010,11 @@ class install_update extends module } else { - $update_list['no_update'][] = $file; + // Do not include style-related or language-related content + if (strpos($file, 'styles/') !== 0 && strpos($file, 'language/') !== 0) + { + $update_list['no_update'][] = $file; + } } unset($this->update_info['files'][$index]); } @@ -1090,8 +1157,25 @@ class install_update extends module if ($diff->merged_output(false, false, false, true)) { $update_ary['conflicts'] = $diff->_conflicting_blocks; - $update_list['conflict'][] = $update_ary; + // There is one special case... users having merged with a conflicting file... we need to check this + $tmp = array( + 'file1' => file_get_contents($phpbb_root_path . $file), + 'file2' => implode("\n", $diff->merged_orig_output()), + ); + + $diff = &new diff($tmp['file1'], $tmp['file2'], false); + $empty = $diff->is_empty(); + + if ($empty) + { + unset($update_ary['conflicts']); + unset($diff); + $update_list['up_to_date'][] = $update_ary; + return; + } + + $update_list['conflict'][] = $update_ary; unset($diff); return; @@ -1108,6 +1192,8 @@ class install_update extends module if ($empty) { + unset($diff); + $update_list['up_to_date'][] = $update_ary; return; } @@ -1160,6 +1246,19 @@ class install_update extends module { $info = $this->test_update; } + + // If info is false the fsockopen function may not be working. Instead get the latest version from our update file (and pray it is up-to-date) + if ($info === false) + { + $update_info = array(); + include($phpbb_root_path . 'install/update/index.php'); + $info = (empty($update_info) || !is_array($update_info)) ? false : $update_info; + + if ($info !== false) + { + $info = (!empty($info['version']['to'])) ? trim($info['version']['to']) : false; + } + } break; case 'update_info': diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index f1c74512eb..d0f9cf88d1 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -136,8 +136,8 @@ CREATE TABLE phpbb_banlist ( ban_start INTEGER DEFAULT 0 NOT NULL, ban_end INTEGER DEFAULT 0 NOT NULL, ban_exclude INTEGER DEFAULT 0 NOT NULL, - ban_reason BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL, - ban_give_reason BLOB SUB_TYPE TEXT CHARACTER SET NONE DEFAULT '' NOT NULL + ban_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + ban_give_reason VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE );; ALTER TABLE phpbb_banlist ADD PRIMARY KEY (ban_id);; diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 6c2e2ee24d..7dd9c4e924 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -178,8 +178,8 @@ CREATE TABLE [phpbb_banlist] ( [ban_start] [int] DEFAULT (0) NOT NULL , [ban_end] [int] DEFAULT (0) NOT NULL , [ban_exclude] [int] DEFAULT (0) NOT NULL , - [ban_reason] [varchar] (3000) DEFAULT ('') NOT NULL , - [ban_give_reason] [varchar] (3000) DEFAULT ('') NOT NULL + [ban_reason] [varchar] (255) DEFAULT ('') NOT NULL , + [ban_give_reason] [varchar] (255) DEFAULT ('') NOT NULL ) ON [PRIMARY] GO diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index 44b292b7e7..7fee7f696d 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -98,8 +98,8 @@ CREATE TABLE phpbb_banlist ( ban_start int(11) UNSIGNED DEFAULT '0' NOT NULL, ban_end int(11) UNSIGNED DEFAULT '0' NOT NULL, ban_exclude tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - ban_reason text NOT NULL, - ban_give_reason text NOT NULL, + ban_reason varchar(255) DEFAULT '' NOT NULL, + ban_give_reason varchar(255) DEFAULT '' NOT NULL, PRIMARY KEY (ban_id), KEY ban_end (ban_end), KEY ban_user (ban_userid, ban_exclude), diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 489c7e7bc5..69889a3db2 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -220,8 +220,8 @@ CREATE TABLE phpbb_banlist ( ban_start number(11) DEFAULT '0' NOT NULL, ban_end number(11) DEFAULT '0' NOT NULL, ban_exclude number(1) DEFAULT '0' NOT NULL, - ban_reason varchar2(3000) DEFAULT '' , - ban_give_reason varchar2(3000) DEFAULT '' , + ban_reason varchar2(765) DEFAULT '' , + ban_give_reason varchar2(765) DEFAULT '' , CONSTRAINT pk_phpbb_banlist PRIMARY KEY (ban_id) ) / diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index b1ff1d1d11..c49423bcf9 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -199,8 +199,8 @@ CREATE TABLE phpbb_banlist ( ban_start INT4 DEFAULT '0' NOT NULL CHECK (ban_start >= 0), ban_end INT4 DEFAULT '0' NOT NULL CHECK (ban_end >= 0), ban_exclude INT2 DEFAULT '0' NOT NULL CHECK (ban_exclude >= 0), - ban_reason varchar(3000) DEFAULT '' NOT NULL, - ban_give_reason varchar(3000) DEFAULT '' NOT NULL, + ban_reason varchar(255) DEFAULT '' NOT NULL, + ban_give_reason varchar(255) DEFAULT '' NOT NULL, PRIMARY KEY (ban_id) ); diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 321cae118c..81e8c3cf80 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -138,7 +138,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online_guests INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online_time', '5'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_onlinetrack', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_search', '1'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_tplcompile', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_tplcompile', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_user_activity', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_attachments', '3'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_attachments_pm', '1'); @@ -205,7 +205,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page', INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.RC2'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.RC3'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400'); diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 70b4f8de22..156e4bfc76 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -97,8 +97,8 @@ CREATE TABLE phpbb_banlist ( ban_start INTEGER UNSIGNED NOT NULL DEFAULT '0', ban_end INTEGER UNSIGNED NOT NULL DEFAULT '0', ban_exclude INTEGER UNSIGNED NOT NULL DEFAULT '0', - ban_reason text(65535) NOT NULL DEFAULT '', - ban_give_reason text(65535) NOT NULL DEFAULT '' + ban_reason varchar(255) NOT NULL DEFAULT '', + ban_give_reason varchar(255) NOT NULL DEFAULT '' ); CREATE INDEX phpbb_banlist_ban_end ON phpbb_banlist (ban_end); diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 74a80c5047..90676cf6bc 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -356,7 +356,7 @@ $lang = array_merge($lang, array( 'EMAIL_CHECK_MX' => 'Check e-mail domain for valid MX record', 'EMAIL_CHECK_MX_EXPLAIN' => 'If enabled, the e-mail domain provided on registration and profile changes is checked for a valid MX record.', 'FORCE_PASS_CHANGE' => 'Force password change', - 'FORCE_PASS_CHANGE_EXPLAIN' => 'Require user to change their password after a set number of days. Set this value to 0 disables this behaviour.', + 'FORCE_PASS_CHANGE_EXPLAIN' => 'Require user to change their password after a set number of days. Setting this value to 0 disables this behaviour.', 'FORWARDED_FOR_VALID' => 'Validated X_FORWARDED_FOR header', 'FORWARDED_FOR_VALID_EXPLAIN' => 'Sessions will only be continued if the sent X_FORWARDED_FOR header equals the one sent with the previous request. Bans will be checked against IPs in X_FORWARDED_FOR too.', 'IP_VALID' => 'Session IP validation', diff --git a/phpBB/language/en/acp/bots.php b/phpBB/language/en/acp/bots.php index d06a90d363..a166142d24 100644 --- a/phpBB/language/en/acp/bots.php +++ b/phpBB/language/en/acp/bots.php @@ -33,7 +33,7 @@ if (empty($lang) || !is_array($lang)) // Bot settings $lang = array_merge($lang, array( 'BOTS' => 'Manage bots', - 'BOTS_EXPLAIN' => 'Bots or crawlers are automated agents most commonly used by search engines to update their databases. Since they rarely make proper use of sessions they can distort visitor counts, increase load and sometimes fail to index sites correctly. Here you can define a special type of user to overcome these problems.', + 'BOTS_EXPLAIN' => '"Bots", "spiders" or "crawlers" are automated agents most commonly used by search engines to update their databases. Since they rarely make proper use of sessions they can distort visitor counts, increase load and sometimes fail to index sites correctly. Here you can define a special type of user to overcome these problems.', 'BOT_ACTIVATE' => 'Activate', 'BOT_ACTIVE' => 'Bot active', 'BOT_ADD' => 'Add bot', @@ -51,12 +51,11 @@ $lang = array_merge($lang, array( 'BOT_IP_EXPLAIN' => 'Partial matches are allowed, separate addresses with a comma.', 'BOT_NAME' => 'Bot name', 'BOT_NAME_EXPLAIN' => 'Used only for your own information.', + 'BOT_NAME_TAKEN' => 'The name is already in use on your board and can\'t be used for the Bot.', 'BOT_NEVER' => 'Never', 'BOT_STYLE' => 'Bot style', 'BOT_STYLE_EXPLAIN' => 'The style used for the board by the bot.', 'BOT_UPDATED' => 'Existing bot updated successfully.', - 'BOT_VIS' => 'Bot visible', - 'BOT_VIS_EXPLAIN' => 'Allow bot to be seen by all users in online lists.', 'ERR_BOT_AGENT_MATCHES_UA' => 'The bot agent you supplied is similar to the one you are currently using. Please adjust the agent for this bot.', 'ERR_BOT_NO_IP' => 'The IP addresses you supplied were invalid or the hostname could not be resolved.', diff --git a/phpBB/language/en/acp/groups.php b/phpBB/language/en/acp/groups.php index 936dc9bf3c..562e3a89cc 100644 --- a/phpBB/language/en/acp/groups.php +++ b/phpBB/language/en/acp/groups.php @@ -31,7 +31,7 @@ if (empty($lang) || !is_array($lang)) // in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine $lang = array_merge($lang, array( - 'ACP_GROUPS_MANAGE_EXPLAIN' => 'From this panel you can administrate all your usergroups, you can delete, create and edit existing groups. You may choose group leaders, toggle open/closed group status and set the group name and description.', + 'ACP_GROUPS_MANAGE_EXPLAIN' => 'From this panel you can administrate all your usergroups. You can delete, create and edit existing groups. Furthermore, you may choose group leaders, toggle open/hidden/closed group status and set the group name and description.', 'ADD_USERS' => 'Add users', 'ADD_USERS_EXPLAIN' => 'Here you can add new users to the group. You may select whether this group becomes the new default for the selected users. Additionally you can define them as group leaders. Please enter each username on a separate line.', @@ -48,7 +48,7 @@ $lang = array_merge($lang, array( 'GROUP_AVATAR_EXPLAIN' => 'This image will be displayed in the Group Control Panel.', 'GROUP_CLOSED' => 'Closed', 'GROUP_COLOR' => 'Group colour', - 'GROUP_COLOR_EXPLAIN' => 'Defines the colour members usernames will appear in, leave blank for user default.', + 'GROUP_COLOR_EXPLAIN' => 'Defines the colour members’ usernames will appear in, leave blank for user default.', 'GROUP_CONFIRM_ADD_USER' => 'Are you sure that you want to add the user %1$s to the group?', 'GROUP_CONFIRM_ADD_USERS' => 'Are you sure that you want to add the users %1$s to the group?', 'GROUP_CREATED' => 'Group has been created successfully.', @@ -59,10 +59,10 @@ $lang = array_merge($lang, array( 'GROUP_DEMOTE' => 'Demote group leader', 'GROUP_DESC' => 'Group description', 'GROUP_DETAILS' => 'Group details', - 'GROUP_EDIT_EXPLAIN' => 'Here you can edit an existing group. You can change its name, description and type (open, closed, etc.). You can also set certain group wide options such as colouration, rank, etc. Changes made here override users current settings. Please note that group members can alter their avatar unless you set appropriate user permissions.', + 'GROUP_EDIT_EXPLAIN' => 'Here you can edit an existing group. You can change its name, description and type (open, closed, etc.). You can also set certain group wide options such as colouration, rank, etc. Changes made here override users’ current settings. Please note that group members can override group-avatar settings, unless you set appropriate user permissions.', 'GROUP_ERR_USERS_EXIST' => 'The specified users are already members of this group.', 'GROUP_FOUNDER_MANAGE' => 'Founder manage only', - 'GROUP_FOUNDER_MANAGE_EXPLAIN' => 'Restrict group management for this group for founders only. Users having group permissions are still able to see this group as well as this groups members.', + 'GROUP_FOUNDER_MANAGE_EXPLAIN' => 'Restrict management of this group to founders only. Users having group permissions are still able to see this group as well as this group’s members.', 'GROUP_HIDDEN' => 'Hidden', 'GROUP_LANG' => 'Group language', 'GROUP_LEAD' => 'Group leaders', @@ -86,10 +86,7 @@ $lang = array_merge($lang, array( 'GROUP_RECEIVE_PM' => 'Group able to receive private messages', 'GROUP_RECEIVE_PM_EXPLAIN' => 'Please note that hidden groups are not able to be messaged, regardless of this setting.', 'GROUP_REQUEST' => 'Request', - 'GROUP_SETTINGS' => 'Set user preferences', - 'GROUP_SETTINGS_EXPLAIN' => 'Here you can force changes in users current preferences. Please note these settings are not saved for the group itself. They are intended as a quick method of altering the preferences of all users in this group.', 'GROUP_SETTINGS_SAVE' => 'Group wide settings', - 'GROUP_TIMEZONE' => 'Group timezone', 'GROUP_TYPE' => 'Group type', 'GROUP_TYPE_EXPLAIN' => 'This determines which users can join or view this group.', 'GROUP_UPDATED' => 'Group preferences updated successfully.', @@ -106,7 +103,7 @@ $lang = array_merge($lang, array( 'NO_PERMISSIONS' => 'Do not copy permissions', 'NO_USERS' => 'You haven’t entered any users.', - 'SPECIAL_GROUPS' => 'Predefined groups', + 'SPECIAL_GROUPS' => 'Pre-defined groups', 'SPECIAL_GROUPS_EXPLAIN' => 'Pre-defined groups are special groups, they cannot be deleted or directly modified. However you can still add users and alter basic settings.', 'TOTAL_MEMBERS' => 'Members', diff --git a/phpBB/language/en/help_faq.php b/phpBB/language/en/help_faq.php index 2681dc32cc..193e8cf3a2 100644 --- a/phpBB/language/en/help_faq.php +++ b/phpBB/language/en/help_faq.php @@ -132,7 +132,7 @@ $help = array( ), array( 0 => 'Why can’t I access a forum?', - 1 => 'Some forums may be limited to certain users or groups. To view, read, post or perform another action you may need special authorization. Contact a moderator or board administrator to grant you access.' + 1 => 'Some forums may be limited to certain users or groups. To view, read, post or perform another action you may need special permissions. Contact a moderator or board administrator to grant you access.' ), array( 0 => 'Why can’t I add attachments?', diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 8f37b52c09..180157d5e0 100755 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -394,7 +394,7 @@ $lang = array_merge($lang, array( 'FILE_DIFF_NOT_ALLOWED' => 'File not allowed to be diffed.', 'FILE_USED' => 'Information used from', // Single file 'FILES_CONFLICT' => 'Conflict files', - 'FILES_CONFLICT_EXPLAIN' => 'The following files are modified and do not represent the original files from the old version. phpBB determined that these files create conflicts if they are tried to be merged. Please investigate the conflicts and try to manually resolve them or continue the update choosing the preferred merging method. If you resolve the conflicts manually check the files again after you modified the them. You are also able to choose between the preferred merge method for every file. The first one will result in a file where the conflicting lines from your old file will be lost, the other one will result in loosing the changes from the newer file.', + 'FILES_CONFLICT_EXPLAIN' => 'The following files are modified and do not represent the original files from the old version. phpBB determined that these files create conflicts if they are tried to be merged. Please investigate the conflicts and try to manually resolve them or continue the update choosing the preferred merging method. If you resolve the conflicts manually check the files again after you modified them. You are also able to choose between the preferred merge method for every file. The first one will result in a file where the conflicting lines from your old file will be lost, the other one will result in loosing the changes from the newer file.', 'FILES_MODIFIED' => 'Modified files', 'FILES_MODIFIED_EXPLAIN' => 'The following files are modified and do not represent the original files from the old version. The updated file will be a merge between your modifications and the new file.', 'FILES_NEW' => 'New files', @@ -485,16 +485,16 @@ $lang = array_merge($lang, array(

    Release announcement

    -

    Please read the release announcement for the latest version before you continue your update process, it may contain useful information. It also contains full download links as well as the change log.

    +

    Please read the release announcement for the latest version before you continue your update process, it may contain useful information. It also contains full download links as well as the change log.


    -

    How to update your installation

    +

    How to update your installation with the Automatic Update Package

    -

    The recommended way of updating your installation only takes the following steps:

    +

    The recommended way of updating your installation listed here is only valid for the automatic update package. You are also able to update your installation using the methods listed within the INSTALL.html document. The steps for updating phpBB3 automatically are:

      -
    • Go to the phpBB.com downloads page and download the correct "phpBB Update Package" archive.

    • +
    • Go to the phpBB.com downloads page and download the "Automatic Update Package" archive.

    • Unpack the archive.

    • Upload the complete uncompressed install folder to your phpBB root directory (where your config.php file is).

    @@ -502,9 +502,15 @@ $lang = array_merge($lang, array(

    Once uploaded your board will be offline for normal users due to the install directory you uploaded now present.

    Now start the update process by pointing your browser to the install folder.

    - You will then be guided through the update process. You will be notified after the update is complete. + You will then be guided through the update process. You will be notified once the update is complete.

    ', + 'UPDATE_INSTRUCTIONS_INCOMPLETE' => ' + +

    Incomplete update detected

    + +

    phpBB detected an incomplete automatic update. Please make sure you followed every step within the automatic update tool. Below you will find the link again, or go directly to your install directory.

    + ', 'UPDATE_METHOD' => 'Update method', 'UPDATE_METHOD_EXPLAIN' => 'You are now able to choose your preferred update method. Using the FTP upload will present you with a form you need to enter your FTP account details into. With this method the files will be automatically moved to the new location and backups of the old files being created by appending .bak to the filename. If you choose to download the modified files you are able to unpack and upload them to their correct location manually later.', 'UPDATE_SUCCESS' => 'Update was successful', diff --git a/phpBB/language/en/memberlist.php b/phpBB/language/en/memberlist.php index f4219feb61..6feb16c02c 100644 --- a/phpBB/language/en/memberlist.php +++ b/phpBB/language/en/memberlist.php @@ -54,6 +54,7 @@ $lang = array_merge($lang, array( 'EMAIL_TOPIC_EXPLAIN' => 'This message will be sent as plain text, do not include any HTML or BBCode. Please note that the topic information is already included in the message. The return address for this message will be set to your e-mail address.', 'EMPTY_ADDRESS_EMAIL' => 'You must provide a valid e-mail address for the recipient.', 'EMPTY_MESSAGE_EMAIL' => 'You must enter a message to be emailed.', + 'EMPTY_MESSAGE_IM' => 'You must enter a message to be send.', 'EMPTY_NAME_EMAIL' => 'You must enter the real name of the recipient.', 'EMPTY_SUBJECT_EMAIL' => 'You must specify a subject for the e-mail.', 'EQUAL_TO' => 'Equal to', diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index 79b380b14f..4ff4b9be62 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -151,18 +151,19 @@ $lang = array_merge($lang, array( 'POLL_VOTE_CHANGE' => 'Allow re-voting', 'POLL_VOTE_CHANGE_EXPLAIN' => 'If enabled users are able to change their vote.', 'POSTED_ATTACHMENTS' => 'Posted attachments', + 'POST_APPROVAL_NOTIFY' => ' You will be notified when your post has been approved.', 'POST_CONFIRMATION' => 'Confirmation of post', 'POST_CONFIRM_EXPLAIN' => 'To prevent automated posts 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.', 'POST_DELETED' => 'This message has been deleted successfully.', 'POST_EDITED' => 'This message has been edited successfully.', - 'POST_EDITED_MOD' => 'This message has been edited successfully, but it will need to be approved by a moderator before it is publicly viewable. You will be notified when your post has been approved.', + 'POST_EDITED_MOD' => 'This message has been edited successfully, but it will need to be approved by a moderator before it is publicly viewable.', 'POST_GLOBAL' => 'Global', 'POST_ICON' => 'Post icon', 'POST_NORMAL' => 'Normal', 'POST_REVIEW' => 'Post review', 'POST_REVIEW_EXPLAIN' => 'At least one new post has been made to this topic. You may wish to review your post in light of this.', 'POST_STORED' => 'This message has been posted successfully.', - 'POST_STORED_MOD' => 'This message has been submitted successfully, but it will need to be approved by a moderator before it is publicly viewable. You will be notified when your post has been approved.', + 'POST_STORED_MOD' => 'This message has been submitted successfully, but it will need to be approved by a moderator before it is publicly viewable.', 'POST_TOPIC_AS' => 'Post topic as', 'PROGRESS_BAR' => 'Progress bar', diff --git a/phpBB/language/en/search.php b/phpBB/language/en/search.php index 720c39635e..641aa74efc 100644 --- a/phpBB/language/en/search.php +++ b/phpBB/language/en/search.php @@ -47,6 +47,8 @@ $lang = array_merge($lang, array( 'JUMP_TO_POST' => 'Jump to post', + 'LOGIN_EXPLAIN_EGOSEARCH' => 'The board requires you to be registered and logged in to view your own posts.', + '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 304b9952d1..4c402d9b59 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -82,7 +82,7 @@ $lang = array_merge($lang, array( 'ATTACHMENTS_DELETED' => 'Attachments successfully deleted.', 'ATTACHMENT_DELETED' => 'Attachment successfully deleted.', 'AVATAR_CATEGORY' => 'Category', - 'AVATAR_EXPLAIN' => 'Maximum dimensions; width %1$d pixels, height %2$d pixels, file size %3$dkB.', + 'AVATAR_EXPLAIN' => 'Maximum dimensions; width: %1$d pixels, height: %2$d pixels, file size: %3$dkB.', 'AVATAR_FEATURES_DISABLED' => 'The avatar functionality is currently disabled.', 'AVATAR_GALLERY' => 'Local gallery', 'AVATAR_GENERAL_UPLOAD_ERROR' => 'Could not upload avatar to %s.', @@ -210,7 +210,7 @@ $lang = array_merge($lang, array( 'GLOBAL_ANNOUNCEMENT' => 'Global announcement', 'HIDE_ONLINE' => 'Hide my online status', - 'HIDE_ONLINE_EXPLAIN' => 'Changing this setting to "No" won\'t become effective until your next visit to the board.', + 'HIDE_ONLINE_EXPLAIN' => 'Changing this setting won\'t become effective until your next visit to the board.', 'HOLD_NEW_MESSAGES' => 'Do not accept new messages (New messages will be held back until enough space is available)', 'HOLD_NEW_MESSAGES_SHORT' => 'New messages will be held back', @@ -441,7 +441,7 @@ $lang = array_merge($lang, array( 'UNWATCH_MARKED' => 'Unwatch marked', 'UPLOAD_AVATAR_FILE' => 'Upload from your machine', 'UPLOAD_AVATAR_URL' => 'Upload from a URL', - 'UPLOAD_AVATAR_URL_EXPLAIN' => 'Enter the URL of the location containing the image, it will be copied to this site.', + 'UPLOAD_AVATAR_URL_EXPLAIN' => 'Enter the URL of the location containing the image. The image will be copied to this site.', 'USERNAME_ALPHA_ONLY_EXPLAIN' => 'Username must be between %1$d and %2$d chars long and use only alphanumeric characters.', 'USERNAME_ALPHA_SPACERS_EXPLAIN'=> 'Username must be between %1$d and %2$d chars long and use alphanumeric, space or -+_[] characters.', 'USERNAME_ASCII_EXPLAIN' => 'Username must be between %1$d and %2$d chars long and use only ASCII characters, so no special symbols.', diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 76b6aa2d27..dfeaf9801f 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -328,7 +328,12 @@ switch ($mode) include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); $subject = sprintf($user->lang['IM_JABBER_SUBJECT'], $user->data['username'], $config['server_name']); - $message = request_var('message', '', true); + $message = trim(request_var('message', '', true)); + + if (empty($message)) + { + trigger_error('EMPTY_MESSAGE_IM'); + } $messenger = new messenger(false); @@ -717,7 +722,7 @@ switch ($mode) } else { - if (!$email || !preg_match('#^.*?@(.*?\.)?[a-z0-9\-]+\.[a-z]{2,4}$#i', $email)) + if (!$email || !preg_match('/^' . get_preg_expression('email') . '$/i', $email)) { $error[] = $user->lang['EMPTY_ADDRESS_EMAIL']; } @@ -934,16 +939,16 @@ switch ($mode) $s_find_active_time .= ''; } - $sql_where .= ($username) ? ' AND u.username_clean ' . $db->sql_like_expression(str_replace('*', '%', utf8_clean_string($username))) : ''; - $sql_where .= ($email) ? ' AND u.user_email ' . $db->sql_like_expression(str_replace('*', '%', $email)) . ' ' : ''; - $sql_where .= ($icq) ? ' AND u.user_icq ' . $db->sql_like_expression(str_replace('*', '%', $icq)) . ' ' : ''; - $sql_where .= ($aim) ? ' AND u.user_aim ' . $db->sql_like_expression(str_replace('*', '%', $aim)) . ' ' : ''; - $sql_where .= ($yahoo) ? ' AND u.user_yim ' . $db->sql_like_expression(str_replace('*', '%', $yahoo)) . ' ' : ''; - $sql_where .= ($msn) ? ' AND u.user_msnm ' . $db->sql_like_expression(str_replace('*', '%', $msn)) . ' ' : ''; - $sql_where .= ($jabber) ? ' AND u.user_jabber ' . $db->sql_like_expression(str_replace('*', '%', $jabber)) . ' ' : ''; + $sql_where .= ($username) ? ' AND u.username_clean ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($username))) : ''; + $sql_where .= ($email) ? ' AND u.user_email ' . $db->sql_like_expression(str_replace('*', $db->any_char, $email)) . ' ' : ''; + $sql_where .= ($icq) ? ' AND u.user_icq ' . $db->sql_like_expression(str_replace('*', $db->any_char, $icq)) . ' ' : ''; + $sql_where .= ($aim) ? ' AND u.user_aim ' . $db->sql_like_expression(str_replace('*', $db->any_char, $aim)) . ' ' : ''; + $sql_where .= ($yahoo) ? ' AND u.user_yim ' . $db->sql_like_expression(str_replace('*', $db->any_char, $yahoo)) . ' ' : ''; + $sql_where .= ($msn) ? ' AND u.user_msnm ' . $db->sql_like_expression(str_replace('*', $db->any_char, $msn)) . ' ' : ''; + $sql_where .= ($jabber) ? ' AND u.user_jabber ' . $db->sql_like_expression(str_replace('*', $db->any_char, $jabber)) . ' ' : ''; $sql_where .= (is_numeric($count)) ? ' AND u.user_posts ' . $find_key_match[$count_select] . ' ' . (int) $count . ' ' : ''; $sql_where .= (sizeof($joined) > 1) ? " AND u.user_regdate " . $find_key_match[$joined_select] . ' ' . gmmktime(0, 0, 0, intval($joined[1]), intval($joined[2]), intval($joined[0])) : ''; - $sql_where .= (sizeof($active) > 1) ? " AND u.user_lastvisit " . $find_key_match[$active_select] . ' ' . gmmktime(0, 0, 0, $active[1], intval($active[2]), intval($active[0])) : ''; + $sql_where .= ($auth->acl_get('u_viewonline') && sizeof($active) > 1) ? " AND u.user_lastvisit " . $find_key_match[$active_select] . ' ' . gmmktime(0, 0, 0, $active[1], intval($active[2]), intval($active[0])) : ''; $sql_where .= ($search_group_id) ? " AND u.user_id = ug.user_id AND ug.group_id = $search_group_id AND ug.user_pending = 0 " : ''; if ($search_group_id) @@ -1387,11 +1392,12 @@ switch ($mode) 'U_SORT_AIM' => $sort_url . '&sk=h&sd=' . (($sort_key == 'h' && $sort_dir == 'a') ? 'd' : 'a'), 'U_SORT_MSN' => $sort_url . '&sk=i&sd=' . (($sort_key == 'i' && $sort_dir == 'a') ? 'd' : 'a'), 'U_SORT_YIM' => $sort_url . '&sk=j&sd=' . (($sort_key == 'j' && $sort_dir == 'a') ? 'd' : 'a'), - 'U_SORT_ACTIVE' => $sort_url . '&sk=l&sd=' . (($sort_key == 'l' && $sort_dir == 'a') ? 'd' : 'a'), + 'U_SORT_ACTIVE' => ($auth->acl_get('u_viewonline')) ? $sort_url . '&sk=l&sd=' . (($sort_key == 'l' && $sort_dir == 'a') ? 'd' : 'a') : '', 'U_SORT_RANK' => $sort_url . '&sk=m&sd=' . (($sort_key == 'm' && $sort_dir == 'a') ? 'd' : 'a'), 'U_LIST_CHAR' => $sort_url . '&sk=a&sd=' . (($sort_key == 'l' && $sort_dir == 'a') ? 'd' : 'a'), 'S_SHOW_GROUP' => ($mode == 'group') ? true : false, + 'S_VIEWONLINE' => $auth->acl_get('u_viewonline'), 'S_MODE_SELECT' => $s_sort_key, 'S_ORDER_SELECT' => $s_sort_dir, 'S_CHAR_OPTIONS' => $s_char_options, diff --git a/phpBB/posting.php b/phpBB/posting.php index 675b390672..403eea5418 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -164,6 +164,10 @@ if ($post_data['forum_password']) } // Check permissions +if ($user->data['is_bot']) +{ + redirect(append_sid("{$phpbb_root_path}index.$phpEx")); +} // Is the user able to read within this forum? if (!$auth->acl_get('f_read', $forum_id)) @@ -716,7 +720,7 @@ if ($submit || $preview || $refresh) } // Validate username - if (($post_data['username'] && !$user->data['is_registered']) || ($mode == 'edit' && $post_data['username'] && $post_data['post_username'] && $post_data['post_username'] != $post_data['username'])) + if (($post_data['username'] && !$user->data['is_registered']) || ($mode == 'edit' && $post_data['poster_id'] == ANONYMOUS && $post_data['username'] && $post_data['post_username'] && $post_data['post_username'] != $post_data['username'])) { include($phpbb_root_path . 'includes/functions_user.' . $phpEx); @@ -977,6 +981,7 @@ if ($submit || $preview || $refresh) if ($mode == 'edit') { $data['topic_replies_real'] = $post_data['topic_replies_real']; + $data['topic_replies'] = $post_data['topic_replies']; } unset($message_parser); @@ -989,6 +994,7 @@ if ($submit || $preview || $refresh) { meta_refresh(10, $redirect_url); $message = ($mode == 'edit') ? $user->lang['POST_EDITED_MOD'] : $user->lang['POST_STORED_MOD']; + $message .= (($user->data['user_id'] == ANONYMOUS) ? '' : $user->lang['POST_APPROVAL_NOTIFY']); } else { diff --git a/phpBB/search.php b/phpBB/search.php index cbc5b6732f..0693b32569 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -85,6 +85,11 @@ if ($keywords || $author || $author_id || $search_id || $submit) if ($search_id == 'egosearch') { $author_id = $user->data['user_id']; + + if ($user->data['user_id'] == ANONYMOUS) + { + login_box('', $user->lang['LOGIN_EXPLAIN_EGOSEARCH']); + } } // If we are looking for authors get their ids diff --git a/phpBB/styles/prosilver/template/editor.js b/phpBB/styles/prosilver/template/editor.js index 38dd77bdbe..80dd20da99 100644 --- a/phpBB/styles/prosilver/template/editor.js +++ b/phpBB/styles/prosilver/template/editor.js @@ -48,7 +48,7 @@ function initInsertions() { textarea.focus(); baseHeight = doc.selection.createRange().duplicate().boundingHeight; - document.body.focus(); + // document.body.focus(); } } @@ -74,7 +74,7 @@ function bbstyle(bbnumber) function bbfontstyle(bbopen, bbclose) { theSelection = false; - + var textarea = document.forms[form_name].elements[text_name]; textarea.focus(); @@ -325,7 +325,7 @@ function colorPalette(dir, width, height) for (b = 0; b < 5; b++) { color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]); - document.write('
    '); } diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html index 7d267410aa..753d83995c 100644 --- a/phpBB/styles/prosilver/template/forumlist_body.html +++ b/phpBB/styles/prosilver/template/forumlist_body.html @@ -27,7 +27,7 @@
  • -
    {forumrow.FORUM_IMAGE}
    + {forumrow.FORUM_IMAGE} {forumrow.FORUM_NAME}
    {forumrow.FORUM_DESC} diff --git a/phpBB/styles/prosilver/template/mcp_ban.html b/phpBB/styles/prosilver/template/mcp_ban.html index cc41ce9c1f..531a90bb42 100644 --- a/phpBB/styles/prosilver/template/mcp_ban.html +++ b/phpBB/styles/prosilver/template/mcp_ban.html @@ -54,11 +54,11 @@
    -
    +
    -
    +

    diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html index 081352924e..0f9d1cb792 100644 --- a/phpBB/styles/prosilver/template/memberlist_body.html +++ b/phpBB/styles/prosilver/template/memberlist_body.html @@ -83,7 +83,7 @@
  • - + @@ -106,7 +106,7 @@ - + @@ -119,11 +119,11 @@ - + - + diff --git a/phpBB/styles/prosilver/template/memberlist_im.html b/phpBB/styles/prosilver/template/memberlist_im.html index b12d5314c7..717273baa3 100644 --- a/phpBB/styles/prosilver/template/memberlist_im.html +++ b/phpBB/styles/prosilver/template/memberlist_im.html @@ -13,7 +13,7 @@
    -
    {USERNAME} [ {IM_CONTACT} ] {PRESENCE_IMG}
    +
    {USERNAME} [ {IM_CONTACT} ] {PRESENCE_IMG}
    diff --git a/phpBB/styles/prosilver/template/memberlist_search.html b/phpBB/styles/prosilver/template/memberlist_search.html index ac7ac9821d..1061d30628 100644 --- a/phpBB/styles/prosilver/template/memberlist_search.html +++ b/phpBB/styles/prosilver/template/memberlist_search.html @@ -80,10 +80,12 @@ function insert_single(user)
    +
    +
    diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html index 1f8bd75718..8a6f129f50 100644 --- a/phpBB/styles/prosilver/template/overall_header.html +++ b/phpBB/styles/prosilver/template/overall_header.html @@ -113,7 +113,7 @@
    '); + document.write(''); document.write('#' + color + ''); document.writeln('{L_POSTS} {L_WEBSITE}{L_COMMA_SEPARATOR}{L_LOCATION} {L_JOINED}{L_LAST_ACTIVE}{L_LAST_ACTIVE}
           
    {memberrow.POSTS}{memberrow.POSTS}
    {memberrow.LOCATION}
     
    {memberrow.JOINED}{memberrow.VISITED} {memberrow.VISITED} 
    {L_NO_MEMBERS}{L_NO_MEMBERS}