From bb718d8406581f0dd9435274630ad887b68eb91b Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 27 Nov 2006 23:31:09 +0000 Subject: [PATCH 001/264] - the same procedure as every... oh. this is taken. - also including the first bugfix within beta4, just noticed at area51 that quicktools are not working in global announcements. :D git-svn-id: file:///svn/phpbb/trunk@6681 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/auth.php | 10 ++++++++++ phpBB/install/schemas/schema_data.sql | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index c174fc6769..70a3ccb046 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -223,6 +223,16 @@ class auth { $allowed = false; + if (is_array($opt)) + { + foreach ($opt as $check_option) + { + $allowed |= $this->acl_getf_global($check_option); + } + + return $allowed; + } + if (isset($this->acl_options['local'][$opt])) { foreach ($this->acl as $f => $bitstring) diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index c3a438e0de..0cea5a5f72 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -199,7 +199,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.B4'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.B5-dev'); 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'); From 59e4c4b810c76db985944136a4f82981379f4a1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Tue, 28 Nov 2006 09:34:08 +0000 Subject: [PATCH 002/264] per common request git-svn-id: file:///svn/phpbb/trunk@6682 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/config.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/phpBB/config.php b/phpBB/config.php index e69de29bb2..da2f709dae 100644 --- a/phpBB/config.php +++ b/phpBB/config.php @@ -0,0 +1,18 @@ + \ No newline at end of file From e759598fc6c220a053d59865a248b5e1c3bd6662 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Tue, 28 Nov 2006 09:38:31 +0000 Subject: [PATCH 003/264] In honor of Beta4! git-svn-id: file:///svn/phpbb/trunk@6683 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/config.php | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/phpBB/config.php b/phpBB/config.php index da2f709dae..e69de29bb2 100644 --- a/phpBB/config.php +++ b/phpBB/config.php @@ -1,18 +0,0 @@ - \ No newline at end of file From ed24dd9aeb670bf6639af9e223b7df4deef604bf Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 28 Nov 2006 11:04:26 +0000 Subject: [PATCH 004/264] fix for bug #5676 - of course the "delete install folder" notice should not occur if directly within installation. git-svn-id: file:///svn/phpbb/trunk@6684 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/session.php | 2 +- phpBB/install/install_update.php | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index ad6a049a65..1408463c0b 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -1210,7 +1210,7 @@ class user extends session // Disable board if the install/ directory is still present // For the brave development army we do not care about this, else we need to comment out this everytime we develop locally - if (!defined('DEBUG_EXTRA') && !defined('ADMIN_START') && !defined('IN_LOGIN') && file_exists($phpbb_root_path . 'install')) + if (!defined('DEBUG_EXTRA') && !defined('ADMIN_START') && !defined('IN_INSTALL') && !defined('IN_LOGIN') && file_exists($phpbb_root_path . 'install')) { // Adjust the message slightly according to the permissions if ($auth->acl_gets('a_', 'm_')) diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index 069022f0e5..8bd94f036e 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -96,9 +96,7 @@ class install_update extends module include_once($phpbb_root_path . 'includes/diff/diff.' . $phpEx); - /** - * Check for user session - * - commented out for beta3 with "broken" install check routine + // Check for user session if (!$user->data['is_registered']) { login_box('', $user->lang['LOGIN_UPDATE_EXPLAIN']); @@ -108,7 +106,6 @@ class install_update extends module { trigger_error($user->lang['NO_AUTH_UPDATE']); } - */ // If we are within the intro page we need to make sure we get up-to-date version info if ($sub == 'intro') From 38efea8d5834853082006bf6bf61fc3cb49c8322 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 28 Nov 2006 12:27:20 +0000 Subject: [PATCH 005/264] different time limit for installer git-svn-id: file:///svn/phpbb/trunk@6685 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 2 +- phpBB/install/index.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 461b5807c2..011e7bfa35 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -27,7 +27,7 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1); //error_reporting(E_ALL ^ E_NOTICE); error_reporting(E_ALL); -@set_time_limit(120); +@set_time_limit(0); // Include essential scripts include($phpbb_root_path . 'config.' . $phpEx); diff --git a/phpBB/install/index.php b/phpBB/install/index.php index bd8ae095a3..c3b667f497 100755 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -102,7 +102,7 @@ else define('STRIP', (get_magic_quotes_gpc()) ? true : false); } -@set_time_limit(120); +@set_time_limit(0); // Include essential scripts require($phpbb_root_path . 'includes/functions.' . $phpEx); From a538fb2a9e1ef01a9bf2b1d1c462f74eae1309a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Tue, 28 Nov 2006 13:29:38 +0000 Subject: [PATCH 006/264] #5678 git-svn-id: file:///svn/phpbb/trunk@6686 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/install_update.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/adm/style/install_update.html b/phpBB/adm/style/install_update.html index 5cdf2eeea0..d99bd9a794 100644 --- a/phpBB/adm/style/install_update.html +++ b/phpBB/adm/style/install_update.html @@ -127,7 +127,7 @@ function popup(url, width, height)
{files.FILENAME}
-
+
{files.FILENAME}
{L_FILE_USED}: {files.CUSTOM_ORIGINAL} @@ -136,12 +136,12 @@ function popup(url, width, height)
{L_NUM_CONFLICTS}: {files.NUM_CONFLICTS}
-
[ {files.L_SHOW_DIFF} ]
+
[ {files.L_SHOW_DIFF} ]
-
  {L_DO_NOT_UPDATE}
+
  {L_DO_NOT_UPDATE}
-
  {L_MERGE_NEW_FILE_OPTION}
  {L_MERGE_MOD_FILE_OPTION}
+
  {L_MERGE_NEW_FILE_OPTION}
  {L_MERGE_MOD_FILE_OPTION}
From 4308f5e8a5094887789ae1bf1d2ac37ba9410eb0 Mon Sep 17 00:00:00 2001 From: David M Date: Tue, 28 Nov 2006 13:44:21 +0000 Subject: [PATCH 007/264] #5672 git-svn-id: file:///svn/phpbb/trunk@6687 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/captcha/captcha_gd.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/captcha/captcha_gd.php b/phpBB/includes/captcha/captcha_gd.php index 10c61836a5..3d64cb1c26 100644 --- a/phpBB/includes/captcha/captcha_gd.php +++ b/phpBB/includes/captcha/captcha_gd.php @@ -70,6 +70,7 @@ class captcha // fill with noise or grid if ($config['captcha_gd_noise']) { + $chars_allowed = array_merge(range('1', '9'), range('A', 'Z')); // random characters in background with random position, angle, color for ($i = 0 ; $i < 72; $i++) { @@ -78,9 +79,10 @@ class captcha $x = mt_rand(0, 360); $y = mt_rand(0, (int)($this->height - ($size / 5))); $color = $func2($image, mt_rand(160, 224), mt_rand(160, 224), mt_rand(160, 224)); - $text = chr(mt_rand(45, 250)); + $text = $chars_allowed[array_rand($chars_allowed)]; imagettftext($image, $size, $angle, $x, $y, $color, $this->get_font(), $text); } + unset($chars_allowed); } else { From 63496350392d12828ee1119241eaf0687811c70a Mon Sep 17 00:00:00 2001 From: David M Date: Tue, 28 Nov 2006 14:29:47 +0000 Subject: [PATCH 008/264] #5654 - bzopen_or_bzdopen in bzlib.c appends us our binary mode in a strcat call, we don't need it for bzopen(); git-svn-id: file:///svn/phpbb/trunk@6688 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_compress.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_compress.php b/phpBB/includes/functions_compress.php index 93a3547e21..3fe2bf9a9b 100644 --- a/phpBB/includes/functions_compress.php +++ b/phpBB/includes/functions_compress.php @@ -600,7 +600,7 @@ class compress_tar extends compress function open() { $fzopen = ($this->isbz && function_exists('bzopen')) ? 'bzopen' : (($this->isgz && @extension_loaded('zlib')) ? 'gzopen' : 'fopen'); - $this->fp = @$fzopen($this->file, $this->mode . 'b' . (($fzopen == 'gzopen') ? '9' : '')); + $this->fp = @$fzopen($this->file, $this->mode . (($fzopen == 'bzopen') ? '' : 'b') . (($fzopen == 'gzopen') ? '9' : '')); if (!$this->fp) { From e0a33e05bd7909e366223515600958d4303d46a8 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 28 Nov 2006 14:31:55 +0000 Subject: [PATCH 009/264] fix for ftp update bug... git-svn-id: file:///svn/phpbb/trunk@6689 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_transfer.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions_transfer.php b/phpBB/includes/functions_transfer.php index 00ef78f933..3a3bb24563 100644 --- a/phpBB/includes/functions_transfer.php +++ b/phpBB/includes/functions_transfer.php @@ -196,7 +196,9 @@ class transfer global $phpbb_root_path; $directory = $this->root_path . str_replace($phpbb_root_path, '', $directory); - $result = $this->_ls($directory); + + $this->_chdir($directory); + $result = $this->_ls(''); if ($result !== false && is_array($result)) { From 4f41d936e27cf4c0191b7c4bf5544f53694238a0 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 28 Nov 2006 14:44:46 +0000 Subject: [PATCH 010/264] fix for bug #5658 git-svn-id: file:///svn/phpbb/trunk@6690 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/install_update.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/adm/style/install_update.html b/phpBB/adm/style/install_update.html index d99bd9a794..19cf38c99b 100644 --- a/phpBB/adm/style/install_update.html +++ b/phpBB/adm/style/install_update.html @@ -258,7 +258,7 @@ function popup(url, width, height)

{data.EXPLAIN}
-
+
From ff2b4e4e8f319e9c7346d33a79a3e1458464b7e8 Mon Sep 17 00:00:00 2001 From: David M Date: Tue, 28 Nov 2006 15:01:13 +0000 Subject: [PATCH 011/264] #5656 git-svn-id: file:///svn/phpbb/trunk@6691 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_bbcodes.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index dd1897ecbd..0853de31e0 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -134,7 +134,18 @@ class acp_bbcodes } } - if (!preg_match('#\[' . $data['bbcode_tag'] .'].*?\[/' . $data['bbcode_tag'] . ']#s', $bbcode_match)) + if (substr($data['bbcode_tag'], -1) === '=') + { + $open = '\[' . $data['bbcode_tag'] . '.*?]'; + $close = '\[/' . substr($data['bbcode_tag'], 0, -1) . ']'; + } + else + { + $open = '\[' . $data['bbcode_tag'] . ']'; + $close = '\[/' . $data['bbcode_tag'] . ']'; + } + + if (!preg_match('#' . $open . '.*?' . $close . '#s', $bbcode_match)) { trigger_error($user->lang['BBCODE_OPEN_ENDED_TAG'] . adm_back_link($this->u_action), E_USER_WARNING); } From 149f92896345b1fd873a814721b6e042a8681593 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 28 Nov 2006 16:34:28 +0000 Subject: [PATCH 012/264] begin working on getting this thing a bit faster. I need to finish the other calls, this commit actually will break the diff engine and the updater. The speed increase noticed is from 89 seconds to 22 seconds as well as saving a lot of memory. git-svn-id: file:///svn/phpbb/trunk@6692 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/diff/diff.php | 11 +++++-- phpBB/includes/diff/engine.php | 5 +-- phpBB/install/install_update.php | 55 +++++++++++++++++++++++++------- 3 files changed, 55 insertions(+), 16 deletions(-) diff --git a/phpBB/includes/diff/diff.php b/phpBB/includes/diff/diff.php index ca8d16fd3e..59124ae7ef 100644 --- a/phpBB/includes/diff/diff.php +++ b/phpBB/includes/diff/diff.php @@ -46,10 +46,17 @@ class diff * @param array $from_lines An array of strings. Typically these are lines from a file. * @param array $to_lines An array of strings. */ - function diff($from_lines, $to_lines) + function diff(&$from_content, &$to_content) { $diff_engine = &new diff_engine(); - $this->_edits = call_user_func_array(array($diff_engine, 'diff'), array($from_lines, $to_lines)); + + $match = array('#\r\n?#', "#([\n]+){2,}#u"); + $replace = array("\n", "\n"); + + $from_content = preg_replace($match, $replace, $from_content); + $to_content = preg_replace($match, $replace, $to_content); + + $this->_edits = call_user_func_array(array($diff_engine, 'diff'), array(explode("\n", $from_content), explode("\n", $to_content))); } /** diff --git a/phpBB/includes/diff/engine.php b/phpBB/includes/diff/engine.php index 5fcb317dd5..e7740a0584 100644 --- a/phpBB/includes/diff/engine.php +++ b/phpBB/includes/diff/engine.php @@ -49,8 +49,9 @@ class diff_engine { function diff($from_lines, $to_lines) { - array_walk($from_lines, array('diff', 'trim_newlines')); - array_walk($to_lines, array('diff', 'trim_newlines')); + // Remove empty lines... +// array_walk($from_lines, array('diff', 'trim_newlines')); +// array_walk($to_lines, array('diff', 'trim_newlines')); $n_from = sizeof($from_lines); $n_to = sizeof($to_lines); diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index 8bd94f036e..4a829f68dc 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -862,11 +862,19 @@ class install_update extends module // Check for this circumstance, the new file need to be up-to-date with the current file then... if (!file_exists($this->old_location . $original_file) && file_exists($this->new_location . $original_file) && file_exists($phpbb_root_path . $file)) { + $tmp = array( + 'file1' => file_get_contents($this->new_location . $original_file), + 'file2' => file_get_contents($phpbb_root_path . $file), + ); + // We need to diff the contents here to make sure the file is really the one we expect - $diff = &new diff(file($this->new_location . $original_file), file($phpbb_root_path . $file)); + $diff = &new diff($tmp['file1'], $tmp['file2']); + $empty = $diff->is_empty(); + + unset($tmp, $diff); // if there are no differences we have an up-to-date file... - if ($diff->is_empty()) + if ($empty) { $update_list['up_to_date'][] = $update_ary; return; @@ -883,16 +891,34 @@ class install_update extends module trigger_error($user->lang['INCOMPLETE_UPDATE_FILES'], E_USER_ERROR); } - $diff = &new diff(file($this->old_location . $original_file), file($phpbb_root_path . $file)); + $tmp = array( + 'file1' => file_get_contents($this->old_location . $original_file), + 'file2' => file_get_contents($phpbb_root_path . $file), + ); + + // We need to diff the contents here to make sure the file is really the one we expect + $diff = &new diff($tmp['file1'], $tmp['file2']); + $empty_1 = $diff->is_empty(); + + unset($tmp, $diff); + + $tmp = array( + 'file1' => file_get_contents($this->new_location . $original_file), + 'file2' => file_get_contents($phpbb_root_path . $file), + ); + + // We need to diff the contents here to make sure the file is really the one we expect + $diff = &new diff($tmp['file1'], $tmp['file2']); + $empty_2 = $diff->is_empty(); + + unset($tmp, $diff); // If the file is not modified we are finished here... - if ($diff->is_empty()) + if ($empty_1) { // Further check if it is already up to date - it could happen that non-modified files // slip through - $diff = &new diff(file($this->new_location . $original_file), file($phpbb_root_path . $file)); - - if ($diff->is_empty()) + if ($empty_2) { $update_list['up_to_date'][] = $update_ary; return; @@ -903,10 +929,9 @@ class install_update extends module } // If the file had been modified then we need to check if it is already up to date - $diff = &new diff(file($this->new_location . $original_file), file($phpbb_root_path . $file)); // if there are no differences we have an up-to-date file... - if ($diff->is_empty()) + if ($empty_2) { $update_list['up_to_date'][] = $update_ary; return; @@ -922,10 +947,16 @@ class install_update extends module return; } - // now compare the merged output with the original file to see if the modified file is up to date - $diff = &new diff(file($phpbb_root_path . $file), $diff->merged_output()); + $tmp = array( + 'file1' => file_get_contents($phpbb_root_path . $file), + 'file2' => implode("\n", $diff->merged_output()), + ); - if ($diff->is_empty()) + // now compare the merged output with the original file to see if the modified file is up to date + $diff = &new diff($tmp['file1'], $tmp['file2']); + $empty = $diff->is_empty(); + + if ($empty) { $update_list['up_to_date'][] = $update_ary; return; From ae58794cbb6f77d1a1ebbe17fee703c9660577df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Wed, 29 Nov 2006 00:36:40 +0000 Subject: [PATCH 013/264] Some tiny bug fixes - cannot stand seeing more than 1 page of Olympus bugs in the tracker git-svn-id: file:///svn/phpbb/trunk@6693 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/acp_permissions.html | 4 ++-- phpBB/adm/style/acp_styles.html | 2 +- phpBB/language/en/install.php | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/phpBB/adm/style/acp_permissions.html b/phpBB/adm/style/acp_permissions.html index 9e305e525c..9b301f8f5c 100644 --- a/phpBB/adm/style/acp_permissions.html +++ b/phpBB/adm/style/acp_permissions.html @@ -261,8 +261,8 @@
{L_LOOK_UP_GROUP}
-
-
+
+
 
diff --git a/phpBB/adm/style/acp_styles.html b/phpBB/adm/style/acp_styles.html index 6ee90b7d3d..5c35c95747 100644 --- a/phpBB/adm/style/acp_styles.html +++ b/phpBB/adm/style/acp_styles.html @@ -516,7 +516,7 @@ - {installed.NAME} * + {installed.NAME} * {installed.STYLE_COUNT} diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index f6c1105d20..1568409b76 100755 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -225,7 +225,7 @@ $lang = array_merge($lang, array( 'PCRE_UTF_SUPPORT' => 'PCRE UTF-8 Support', 'PCRE_UTF_SUPPORT_EXPLAIN' => 'phpBB will not run if your PHP installation is not compiled with UTF-8 support in the PCRE extension', 'PHP_OPTIONAL_MODULE' => 'Optional Modules', - 'PHP_OPTIONAL_MODULE_EXPLAIN' => 'Optional - These modules or applications are optional, you do not need these to use phpBB 3.0. However if you do have them they will will enable greater functionality.', + 'PHP_OPTIONAL_MODULE_EXPLAIN' => 'Optional - These modules or applications are optional, you do not need these to use phpBB 3.0. However if you have them available they will enable greater functionality.', 'PHP_SUPPORTED_DB' => 'Supported Databases', 'PHP_SUPPORTED_DB_EXPLAIN' => 'Required - You must have support for at least one compatible database within PHP. If no database modules are shown as available you should contact your hosting provider or review the relevant PHP installation documentation for advice.', 'PHP_REGISTER_GLOBALS' => 'PHP setting register_globals is disabled', @@ -305,7 +305,7 @@ $lang = array_merge($lang, array( 'CHECK_FILES_UP_TO_DATE' => 'According to your database your version is up to date. You may want to proceed with the file check to make sure all files are really up to date with the latest phpBB version.', 'COLLECTED_INFORMATION' => 'Information on collected files', 'COLLECTED_INFORMATION_EXPLAIN' => 'The list below shows information about the files needing an update. Please read the information in front of every status block to see what they mean and what you may need to do to perform a successful update.', - 'COMPLETE_LOGIN_TO_BOARD' => 'You should now login to your board and check if everything is working fine. Don’t forget to delete, rename or move your install directory!', + 'COMPLETE_LOGIN_TO_BOARD' => 'You should now login to your board and check if everything is working fine. Do not forget to delete, rename or move your install directory!', 'CURRENT_FILE' => 'Current original file', 'CURRENT_VERSION' => 'Current version', @@ -434,7 +434,7 @@ $lang = array_merge($lang, array(

Once uploaded your board will be offline for normal users.

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

- You will then be guided through the update process. The update is complete after the database update script has been completed successfully - this is the last step within the udpate process. + You will then be guided through the update process. The update is complete after the database update script has been completed successfully - this is the last step within the update process.

', From d417d53c0aceb79f18df31a372f78f9dc44519c7 Mon Sep 17 00:00:00 2001 From: David M Date: Wed, 29 Nov 2006 01:33:14 +0000 Subject: [PATCH 014/264] better regex git-svn-id: file:///svn/phpbb/trunk@6694 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/diff/diff.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/diff/diff.php b/phpBB/includes/diff/diff.php index 59124ae7ef..430ae0f522 100644 --- a/phpBB/includes/diff/diff.php +++ b/phpBB/includes/diff/diff.php @@ -50,11 +50,8 @@ class diff { $diff_engine = &new diff_engine(); - $match = array('#\r\n?#', "#([\n]+){2,}#u"); - $replace = array("\n", "\n"); - - $from_content = preg_replace($match, $replace, $from_content); - $to_content = preg_replace($match, $replace, $to_content); + $from_content = preg_replace('#[\n\r]+#', "\n", $from_content); + $to_content = preg_replace('#[\n\r]+#', "\n", $to_content); $this->_edits = call_user_func_array(array($diff_engine, 'diff'), array(explode("\n", $from_content), explode("\n", $to_content))); } From 7ed41c4de14e5b454e8935c35edef4a0b3c400a9 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 29 Nov 2006 15:51:54 +0000 Subject: [PATCH 015/264] updates for the updater and the diff engine. - this update also includes an important change for including the diff engine, since we may need to include an updated engine before updating. This basically means that for a future update (B4 to another version) requires copying the new diff files first... the new include method should prevent this needed handwork for later versions then. git-svn-id: file:///svn/phpbb/trunk@6695 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/diff/diff.php | 28 +++++----- phpBB/includes/diff/engine.php | 27 ++++++++-- phpBB/includes/diff/renderer.php | 15 ++++-- phpBB/install/install_update.php | 91 ++++++++++++++++++++++++++++---- 4 files changed, 129 insertions(+), 32 deletions(-) diff --git a/phpBB/includes/diff/diff.php b/phpBB/includes/diff/diff.php index 430ae0f522..b18970dab4 100644 --- a/phpBB/includes/diff/diff.php +++ b/phpBB/includes/diff/diff.php @@ -15,10 +15,6 @@ if (!defined('IN_PHPBB')) exit; } -// Include renderer and engine -include_once($phpbb_root_path . 'includes/diff/engine.' . $phpEx); -include_once($phpbb_root_path . 'includes/diff/renderer.' . $phpEx); - /** * Code from pear.php.net, Text_Diff-0.2.1 (beta) package * http://pear.php.net/package/Text_Diff/ @@ -46,14 +42,10 @@ class diff * @param array $from_lines An array of strings. Typically these are lines from a file. * @param array $to_lines An array of strings. */ - function diff(&$from_content, &$to_content) + function diff(&$from_content, &$to_content, $preserve_cr = true) { $diff_engine = &new diff_engine(); - - $from_content = preg_replace('#[\n\r]+#', "\n", $from_content); - $to_content = preg_replace('#[\n\r]+#', "\n", $to_content); - - $this->_edits = call_user_func_array(array($diff_engine, 'diff'), array(explode("\n", $from_content), explode("\n", $to_content))); + $this->_edits = $diff_engine->diff($from_content, $to_content, $preserve_cr); } /** @@ -252,7 +244,7 @@ class mapped_diff extends diff * compared when computing the diff. * @param array $mapped_to_lines This array should have the same number of elements as $to_lines. */ - function mapped_diff($from_lines, $to_lines, $mapped_from_lines, $mapped_to_lines) + function mapped_diff(&$from_lines, &$to_lines, &$mapped_from_lines, &$mapped_to_lines) { if (sizeof($from_lines) != sizeof($mapped_from_lines) || sizeof($to_lines) != sizeof($mapped_to_lines)) { @@ -418,10 +410,16 @@ class diff3 extends diff * @param array $final1 The first version to compare to. * @param array $final2 The second version to compare to. */ - function diff3($orig, $final1, $final2) + function diff3(&$orig, &$final1, &$final2) { - $engine = new diff_engine(); - $this->_edits = $this->_diff3($engine->diff($orig, $final1), $engine->diff($orig, $final2)); + $diff_engine = &new diff_engine(); + + $diff_1 = $diff_engine->diff($orig, $final1); + $diff_2 = $diff_engine->diff($orig, $final2); + + unset($engine); + + $this->_edits = $this->_diff3($diff_1, $diff_2); } /** @@ -546,7 +544,7 @@ class diff3 extends diff /** * @access private */ - function _diff3($edits1, $edits2) + function _diff3(&$edits1, &$edits2) { $edits = array(); $bb = &new diff3_block_builder(); diff --git a/phpBB/includes/diff/engine.php b/phpBB/includes/diff/engine.php index e7740a0584..456b5233d3 100644 --- a/phpBB/includes/diff/engine.php +++ b/phpBB/includes/diff/engine.php @@ -47,11 +47,32 @@ if (!defined('IN_PHPBB')) */ class diff_engine { - function diff($from_lines, $to_lines) + function diff(&$from_lines, &$to_lines, $preserve_cr = true) { // Remove empty lines... -// array_walk($from_lines, array('diff', 'trim_newlines')); -// array_walk($to_lines, array('diff', 'trim_newlines')); + // If preserve_cr is true, we basically only change \r\n and bare \r to \n to get the same carriage returns for both files + // If it is false, we try to only use \n once per line and ommit all empty lines to be able to get a proper data diff + + if (is_array($from_lines)) + { + $from_lines = implode("\n", $from_lines); + } + + if (is_array($to_lines)) + { + $to_lines = implode("\n", $to_lines); + } + + if ($preserve_cr) + { + $from_lines = explode("\n", str_replace("\r", "\n", str_replace("\r\n", "\n", $from_lines))); + $to_lines = explode("\n", str_replace("\r", "\n", str_replace("\r\n", "\n", $to_lines))); + } + else + { + $from_lines = explode("\n", preg_replace('#[\n\r]+#', "\n", $from_lines)); + $to_lines = explode("\n", preg_replace('#[\n\r]+#', "\n", $to_lines)); + } $n_from = sizeof($from_lines); $n_to = sizeof($to_lines); diff --git a/phpBB/includes/diff/renderer.php b/phpBB/includes/diff/renderer.php index 984fd65708..6f4400051c 100644 --- a/phpBB/includes/diff/renderer.php +++ b/phpBB/includes/diff/renderer.php @@ -98,15 +98,20 @@ class diff_renderer if (is_a($diff, 'diff3')) { $diff3 = &$diff; - $diff = &new diff($diff3->get_original(), $diff3->merged_output()); + + $diff_1 = $diff3->get_original(); + $diff_2 = $diff3->merged_output(); + unset($diff3); + + $diff = &new diff($diff_1, $diff_2); } $nlead = $this->_leading_context_lines; $ntrail = $this->_trailing_context_lines; $output = $this->_start_diff(); - $diffs = $diff->get_diff(); + $diffs = &$diff->get_diff(); foreach ($diffs as $i => $edit) { @@ -440,7 +445,11 @@ class diff_renderer_inline extends diff_renderer // We want to split on word boundaries, but we need to preserve whitespace as well. // Therefore we split on words, but include all blocks of whitespace in the wordlist. - $diff = &new diff($this->_split_on_words($text1, $nl), $this->_split_on_words($text2, $nl)); + $splitted_text_1 = $this->_split_on_words($text1, $nl); + $splitted_text_2 = $this->_split_on_words($text2, $nl); + + $diff = &new diff($splitted_text_1, $splitted_text_2); + unset($splitted_text_1, $splitted_text_2); // Get the diff in inline format. $renderer = &new diff_renderer_inline(array_merge($this->get_params(), array('split_level' => 'words'))); diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index 4a829f68dc..f7d9a801ee 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -94,7 +94,10 @@ class install_update extends module $auth->acl($user->data); $user->setup('install'); + // Include renderer and engine include_once($phpbb_root_path . 'includes/diff/diff.' . $phpEx); + include_once($phpbb_root_path . 'includes/diff/engine.' . $phpEx); + include_once($phpbb_root_path . 'includes/diff/renderer.' . $phpEx); // Check for user session if (!$user->data['is_registered']) @@ -574,22 +577,41 @@ class install_update extends module break; case 'modified': - $diff = &new diff3(file($this->old_location . $original_filename), file($phpbb_root_path . $file_struct['filename']), file($this->new_location . $original_filename)); + + $tmp = array( + 'file1' => file_get_contents($this->old_location . $original_filename), + 'file2' => file_get_contents($phpbb_root_path . $file_struct['filename']), + 'file3' => file_get_contents($this->new_location . $original_filename), + ); + + $diff = &new diff3($tmp['file1'], $tmp['file2'], $tmp['file3']); $contents = implode("\n", $diff->merged_output()); + unset($tmp, $diff); + if ($update_mode == 'download') { $compress->add_data($contents, $file_struct['filename']); } else { + // @todo add option to specify if a backup file should be created? $transfer->rename($file_struct['filename'], $file_struct['filename'] . '.bak'); $transfer->write_file($file_struct['filename'], $contents); } break; case 'conflict': - $diff = &new diff3(file($this->old_location . $original_filename), file($phpbb_root_path . $file_struct['filename']), file($this->new_location . $original_filename)); + + $tmp = array( + 'file1' => file_get_contents($this->old_location . $original_filename), + 'file2' => file_get_contents($phpbb_root_path . $file_struct['filename']), + 'file3' => file_get_contents($this->new_location . $original_filename), + ); + + $diff = &new diff3($tmp['file1'], $tmp['file2'], $tmp['file3']); + + unset($tmp); if ($conflicts[$file_struct['filename']] == 1) { @@ -601,9 +623,12 @@ class install_update extends module } else { + unset($diff); break; } + unset($diff); + if ($update_mode == 'download') { $compress->add_data($contents, $file_struct['filename']); @@ -716,7 +741,15 @@ class install_update extends module switch ($status) { case 'conflict': - $diff = &new diff3(file($this->old_location . $original_file), file($phpbb_root_path . $file), file($this->new_location . $original_file)); + $tmp = array( + 'file1' => file_get_contents($this->old_location . $original_file), + 'file2' => file_get_contents($phpbb_root_path . $file), + 'file3' => file_get_contents($this->new_location . $original_file), + ); + + $diff = &new diff3($tmp['file1'], $tmp['file2'], $tmp['file3']); + + unset($tmp); $template->assign_vars(array( 'S_DIFF_CONFLICT_FILE' => true, @@ -725,16 +758,39 @@ class install_update extends module break; case 'modified': - $diff = &new diff3(file($this->old_location . $original_file), file($phpbb_root_path . $original_file), file($this->new_location . $file)); + $tmp = array( + 'file1' => file_get_contents($this->old_location . $original_file), + 'file2' => file_get_contents($phpbb_root_path . $original_file), + 'file3' => file_get_contents($this->new_location . $file), + ); + + $diff = &new diff3($tmp['file1'], $tmp['file2'], $tmp['file3']); + + unset($tmp); break; case 'not_modified': case 'new_conflict': - $diff = &new diff(file($phpbb_root_path . $file), file($this->new_location . $original_file)); + $tmp = array( + 'file1' => file_get_contents($phpbb_root_path . $file), + 'file2' => file_get_contents($this->new_location . $original_file), + ); + + $diff = &new diff($tmp['file1'], $tmp['file2']); + + unset($tmp); break; case 'new': - $diff = &new diff(array(), file($this->new_location . $original_file)); + $tmp = array( + 'file1' => array(), + 'file2' => file_get_contents($this->new_location . $original_file), + ); + + $diff = &new diff($tmp['file1'], $tmp['file2']); + + unset($tmp); + $template->assign_var('S_DIFF_NEW_FILE', true); $diff_mode = 'inline'; $this->page_title = 'VIEWING_FILE_CONTENTS'; @@ -762,6 +818,8 @@ class install_update extends module 'S_DIFF_MODE_OPTIONS' => $diff_mode_options, 'S_SHOW_DIFF' => true, )); + + unset($diff, $renderer); } /** @@ -868,7 +926,7 @@ class install_update extends module ); // We need to diff the contents here to make sure the file is really the one we expect - $diff = &new diff($tmp['file1'], $tmp['file2']); + $diff = &new diff($tmp['file1'], $tmp['file2'], false); $empty = $diff->is_empty(); unset($tmp, $diff); @@ -897,7 +955,7 @@ class install_update extends module ); // We need to diff the contents here to make sure the file is really the one we expect - $diff = &new diff($tmp['file1'], $tmp['file2']); + $diff = &new diff($tmp['file1'], $tmp['file2'], false); $empty_1 = $diff->is_empty(); unset($tmp, $diff); @@ -908,7 +966,7 @@ class install_update extends module ); // We need to diff the contents here to make sure the file is really the one we expect - $diff = &new diff($tmp['file1'], $tmp['file2']); + $diff = &new diff($tmp['file1'], $tmp['file2'], false); $empty_2 = $diff->is_empty(); unset($tmp, $diff); @@ -938,12 +996,23 @@ class install_update extends module } // if the file is modified we try to make sure a merge succeed - $diff = &new diff3(file($this->old_location . $original_file), file($phpbb_root_path . $file), file($this->new_location . $original_file)); + $tmp = array( + 'file1' => file_get_contents($this->old_location . $original_file), + 'file2' => file_get_contents($phpbb_root_path . $file), + 'file3' => file_get_contents($this->new_location . $original_file), + ); + + $diff = &new diff3($tmp['file1'], $tmp['file2'], $tmp['file3'], false); + + unset($tmp); if ($diff->merged_output(false, false, false, true)) { $update_ary['conflicts'] = $diff->_conflicting_blocks; $update_list['conflict'][] = $update_ary; + + unset($diff); + return; } @@ -953,7 +1022,7 @@ class install_update extends module ); // now compare the merged output with the original file to see if the modified file is up to date - $diff = &new diff($tmp['file1'], $tmp['file2']); + $diff = &new diff($tmp['file1'], $tmp['file2'], false); $empty = $diff->is_empty(); if ($empty) From 5e9becda1733052f918c4c9fa4179ad6084dd759 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 30 Nov 2006 15:05:51 +0000 Subject: [PATCH 016/264] sorry, i can't stand this uglification. To let the added fieldsets being valid i simply reverted the previous layout by changing the css. git-svn-id: file:///svn/phpbb/trunk@6696 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/acp_icons.html | 2 +- phpBB/adm/style/acp_search.html | 2 +- phpBB/adm/style/admin.css | 11 ++++++++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/phpBB/adm/style/acp_icons.html b/phpBB/adm/style/acp_icons.html index 1ea1061d82..0518a03ec3 100644 --- a/phpBB/adm/style/acp_icons.html +++ b/phpBB/adm/style/acp_icons.html @@ -122,7 +122,7 @@
-
+
{L_TITLE} diff --git a/phpBB/adm/style/acp_search.html b/phpBB/adm/style/acp_search.html index 7a712892e8..104f6362a8 100644 --- a/phpBB/adm/style/acp_search.html +++ b/phpBB/adm/style/acp_search.html @@ -94,7 +94,7 @@ {backend.S_HIDDEN_FIELDS} -
+
{L_INDEX_STATS}: {backend.L_NAME} ({L_ACTIVE}) diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css index bedb045397..2daa161395 100644 --- a/phpBB/adm/style/admin.css +++ b/phpBB/adm/style/admin.css @@ -484,7 +484,16 @@ fieldset.quick legend { } fieldset.tabulated { - background-color: #DADFE4; +/* background-color: #DADFE4;*/ + background: none; + margin: 0; + padding: 0; + padding-top: 5px; + border: 0; +} + +fieldset.tabulated legend { + display: none; } fieldset.nobg { From de1c536548c5b41d33a16f3afe12ba67000d7210 Mon Sep 17 00:00:00 2001 From: Jonathan Stanley Date: Fri, 1 Dec 2006 16:12:15 +0000 Subject: [PATCH 017/264] Titlecase be gone! Suprised John Hjorth hadn't picked these up as they've been bugging me for a while. ;) git-svn-id: file:///svn/phpbb/trunk@6697 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/viewforum.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/language/en/viewforum.php b/phpBB/language/en/viewforum.php index f18dc37c77..8a1802b414 100644 --- a/phpBB/language/en/viewforum.php +++ b/phpBB/language/en/viewforum.php @@ -41,8 +41,8 @@ $lang = array_merge($lang, array( 'LOGIN_NOTIFY_FORUM' => 'You have been notified about this forum, please login to view it.', - 'MARK_TOPICS_READ' => 'Mark Topics Read', - 'MOVED_TOPIC' => 'Moved Topic', + 'MARK_TOPICS_READ' => 'Mark topics read', + 'MOVED_TOPIC' => 'Moved topic', 'NEW_POSTS_HOT' => 'New posts [ Popular ]', 'NEW_POSTS_LOCKED' => 'New posts [ Locked ]', From 7ad986c37e15bc51f5dc2cb42a4fa6445fde51e3 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 2 Dec 2006 13:19:40 +0000 Subject: [PATCH 018/264] - a bunch of fixes - added todos to the updater to make sure i do not forget. :) git-svn-id: file:///svn/phpbb/trunk@6698 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/acp_icons.html | 23 +++++-------- phpBB/adm/style/acp_language.html | 2 +- phpBB/includes/acp/acp_attachments.php | 6 ++-- phpBB/includes/acp/acp_ban.php | 2 +- phpBB/includes/acp/acp_database.php | 5 +++ phpBB/includes/acp/acp_disallow.php | 2 +- phpBB/includes/acp/acp_email.php | 4 +-- phpBB/includes/acp/acp_groups.php | 4 +-- phpBB/includes/acp/acp_permissions.php | 4 +-- phpBB/includes/acp/acp_update.php | 2 +- phpBB/includes/functions.php | 2 +- phpBB/includes/functions_admin.php | 2 +- phpBB/includes/functions_transfer.php | 12 +++++-- phpBB/includes/functions_user.php | 4 +-- phpBB/includes/mcp/mcp_forum.php | 2 +- phpBB/includes/mcp/mcp_front.php | 4 +-- phpBB/includes/mcp/mcp_main.php | 8 ++--- phpBB/includes/mcp/mcp_notes.php | 3 +- phpBB/includes/mcp/mcp_post.php | 5 +-- phpBB/includes/mcp/mcp_queue.php | 6 ++-- phpBB/includes/mcp/mcp_reports.php | 12 +++---- phpBB/includes/mcp/mcp_topic.php | 3 +- phpBB/includes/mcp/mcp_warn.php | 5 +-- phpBB/includes/session.php | 9 +++-- phpBB/includes/ucp/ucp_groups.php | 6 ++-- phpBB/includes/ucp/ucp_pm.php | 1 + phpBB/includes/ucp/ucp_pm_compose.php | 3 +- phpBB/includes/ucp/ucp_pm_viewfolder.php | 2 +- phpBB/includes/ucp/ucp_pm_viewmessage.php | 1 + phpBB/includes/ucp/ucp_prefs.php | 2 +- phpBB/includes/ucp/ucp_register.php | 2 +- phpBB/includes/ucp/ucp_zebra.php | 7 ++-- phpBB/install/install_update.php | 33 ++++++++++++------- phpBB/language/en/acp/board.php | 4 ++- phpBB/language/en/acp/bots.php | 4 ++- phpBB/language/en/acp/common.php | 2 ++ phpBB/language/en/acp/database.php | 4 ++- phpBB/language/en/acp/email.php | 2 +- phpBB/memberlist.php | 2 +- phpBB/posting.php | 4 +-- phpBB/search.php | 2 +- .../subSilver/template/mcp_notes_front.html | 2 +- phpBB/styles/subSilver/template/mcp_post.html | 2 +- .../subSilver/template/mcp_warn_front.html | 2 +- .../subSilver/template/simple_footer.html | 2 +- .../subSilver/template/ucp_zebra_foes.html | 2 +- .../subSilver/template/ucp_zebra_friends.html | 2 +- phpBB/ucp.php | 4 +-- phpBB/viewonline.php | 2 +- 49 files changed, 133 insertions(+), 97 deletions(-) diff --git a/phpBB/adm/style/acp_icons.html b/phpBB/adm/style/acp_icons.html index 0518a03ec3..3a95e5ebf7 100644 --- a/phpBB/adm/style/acp_icons.html +++ b/phpBB/adm/style/acp_icons.html @@ -122,11 +122,13 @@ -
- {L_TITLE} +
+ + {L_TITLE} +
@@ -151,19 +153,10 @@ - diff --git a/phpBB/adm/style/acp_language.html b/phpBB/adm/style/acp_language.html index bc05fc43fd..7e4a49f893 100644 --- a/phpBB/adm/style/acp_language.html +++ b/phpBB/adm/style/acp_language.html @@ -185,7 +185,7 @@

{data.EXPLAIN}
-
+
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 59694b294e..662a83d212 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -91,9 +91,9 @@ class acp_attachments 'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'upload_path' => array('lang' => 'UPLOAD_DIR', 'validate' => 'wpath', 'type' => 'text:25:100', 'explain' => true), 'display_order' => array('lang' => 'DISPLAY_ORDER', 'validate' => 'bool', 'type' => 'custom', 'method' => 'display_order', 'explain' => true), - 'attachment_quota' => array('lang' => 'ATTACH_QUOTA', 'validate' => 'int', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true), - 'max_filesize' => array('lang' => 'ATTACH_MAX_FILESIZE', 'validate' => 'int', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true), - 'max_filesize_pm' => array('lang' => 'ATTACH_MAX_PM_FILESIZE','validate' => 'int', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true), + 'attachment_quota' => array('lang' => 'ATTACH_QUOTA', 'validate' => 'string', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true), + 'max_filesize' => array('lang' => 'ATTACH_MAX_FILESIZE', 'validate' => 'string', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true), + 'max_filesize_pm' => array('lang' => 'ATTACH_MAX_PM_FILESIZE','validate' => 'string', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true), 'max_attachments' => array('lang' => 'MAX_ATTACHMENTS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => false), 'max_attachments_pm' => array('lang' => 'MAX_ATTACHMENTS_PM', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => false), 'secure_downloads' => array('lang' => 'SECURE_DOWNLOADS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php index 44ab731072..d28319c731 100644 --- a/phpBB/includes/acp/acp_ban.php +++ b/phpBB/includes/acp/acp_ban.php @@ -119,7 +119,7 @@ class acp_ban $field = 'username'; $l_ban_cell = $user->lang['USERNAME']; - $sql = 'SELECT b.*, u.user_id, u.username + $sql = 'SELECT b.*, u.user_id, u.username, u.username_clean FROM ' . BANLIST_TABLE . ' b, ' . USERS_TABLE . ' u WHERE (b.ban_end >= ' . time() . ' OR b.ban_end = 0) diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 7a8acab445..ef9822b83d 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -36,6 +36,8 @@ class acp_database { case 'backup': + $this->page_title = 'ACP_BACKUP'; + switch ($action) { case 'download': @@ -1168,6 +1170,9 @@ class acp_database break; case 'restore': + + $this->page_title = 'ACP_RESTORE'; + switch ($action) { case 'submit': diff --git a/phpBB/includes/acp/acp_disallow.php b/phpBB/includes/acp/acp_disallow.php index 70bdf30628..cbdc24a3b6 100644 --- a/phpBB/includes/acp/acp_disallow.php +++ b/phpBB/includes/acp/acp_disallow.php @@ -26,7 +26,7 @@ class acp_disallow // Set up general vars $this->tpl_name = 'acp_disallow'; - $this->page_header = 'ACP_DISALLOW_USERNAMES'; + $this->page_title = 'ACP_DISALLOW_USERNAMES'; $disallow = (isset($_POST['disallow'])) ? true : false; $allow = (isset($_POST['allow'])) ? true : false; diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php index 5b79451634..fa29e7b209 100644 --- a/phpBB/includes/acp/acp_email.php +++ b/phpBB/includes/acp/acp_email.php @@ -65,7 +65,7 @@ class acp_email { if ($group_id) { - $sql = 'SELECT u.user_email, u.username, u.user_lang, u.user_jabber, u.user_notify_type + $sql = 'SELECT u.user_email, u.username, u.username_clean, u.user_lang, u.user_jabber, u.user_notify_type FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . " ug WHERE ug.group_id = $group_id AND ug.user_pending = 0 @@ -75,7 +75,7 @@ class acp_email } else { - $sql = 'SELECT username, user_email, user_jabber, user_notify_type, user_lang + $sql = 'SELECT username, username_clean, user_email, user_jabber, user_notify_type, user_lang FROM ' . USERS_TABLE . ' WHERE user_allow_massemail = 1 ORDER BY user_lang, user_notify_type'; diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index e81dc9883f..678a4f3bcf 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -574,11 +574,11 @@ class acp_groups $db->sql_freeresult($result); // Grab the members - $sql = 'SELECT u.user_id, u.username, u.user_regdate, u.user_posts, u.group_id, ug.group_leader, ug.user_pending + $sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_regdate, u.user_posts, u.group_id, ug.group_leader, ug.user_pending FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . " ug WHERE ug.group_id = $group_id AND u.user_id = ug.user_id - ORDER BY ug.group_leader DESC, ug.user_pending ASC, u.username"; + ORDER BY ug.group_leader DESC, ug.user_pending ASC, u.username_clean"; $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); $leader = $member = 0; diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index 5354d70f72..8b611ffef1 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -1064,7 +1064,7 @@ class acp_permissions $sql_permission_option = "AND o.auth_option LIKE '" . $db->sql_escape($permission_type) . "%'"; $sql = $db->sql_build_query('SELECT_DISTINCT', array( - 'SELECT' => 'u.username, u.user_regdate, u.user_id', + 'SELECT' => 'u.username, u.username_clean, u.user_regdate, u.user_id', 'FROM' => array( USERS_TABLE => 'u', @@ -1084,7 +1084,7 @@ class acp_permissions $sql_forum_id AND u.user_id = a.user_id", - 'ORDER_BY' => 'u.username, u.user_regdate ASC' + 'ORDER_BY' => 'u.username_clean, u.user_regdate ASC' )); $result = $db->sql_query($sql); diff --git a/phpBB/includes/acp/acp_update.php b/phpBB/includes/acp/acp_update.php index fac20449bc..140d3b7dda 100644 --- a/phpBB/includes/acp/acp_update.php +++ b/phpBB/includes/acp/acp_update.php @@ -23,7 +23,7 @@ class acp_update $user->add_lang('install'); $this->tpl_name = 'acp_update'; - $this->page_title = 'ACP_UPDATE'; + $this->page_title = 'ACP_VERSION_CHECK'; // Get current and latest version $errstr = ''; diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 9c8163bd14..43d6b862ff 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3140,7 +3140,7 @@ function page_header($page_title = '', $display_online_list = true) $db->sql_freeresult($result); } - $sql = 'SELECT u.username, u.user_id, u.user_type, u.user_allow_viewonline, u.user_colour, s.session_ip, s.session_viewonline + $sql = 'SELECT u.username, u.username_clean, u.user_id, u.user_type, u.user_allow_viewonline, u.user_colour, s.session_ip, s.session_viewonline FROM ' . USERS_TABLE . ' u, ' . SESSIONS_TABLE . ' s WHERE s.session_time >= ' . (time() - (intval($config['load_online_time']) * 60)) . $reading_sql . diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index c00a2cd3d9..23f243168f 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2161,7 +2161,7 @@ function view_log($mode, &$log, &$log_count, $limit = 0, $offset = 0, $forum_id return; } - $sql = "SELECT l.*, u.username, u.user_colour + $sql = "SELECT l.*, u.username, u.username_clean, u.user_colour FROM " . LOG_TABLE . " l, " . USERS_TABLE . " u WHERE l.log_type = $log_type AND u.user_id = l.user_id diff --git a/phpBB/includes/functions_transfer.php b/phpBB/includes/functions_transfer.php index 3a3bb24563..4c47f99412 100644 --- a/phpBB/includes/functions_transfer.php +++ b/phpBB/includes/functions_transfer.php @@ -265,7 +265,11 @@ class ftp extends transfer // Make sure $this->root_path is layed out the same way as the $user->page['root_script_path'] value (/ at the end) $this->root_path = str_replace('\\', '/', $this->root_path); - $this->root_path = (($root_path[0] != '/' ) ? '/' : '') . $root_path . ((substr($root_path, -1, 1) == '/') ? '' : '/'); + + if (!empty($root_path)) + { + $this->root_path = (($root_path[0] != '/' ) ? '/' : '') . $root_path . ((substr($root_path, -1, 1) == '/') ? '' : '/'); + } // Init some needed values transfer::transfer(); @@ -479,7 +483,11 @@ class ftp_fsock extends transfer // Make sure $this->root_path is layed out the same way as the $user->page['root_script_path'] value (/ at the end) $this->root_path = str_replace('\\', '/', $this->root_path); - $this->root_path = (($root_path[0] != '/' ) ? '/' : '') . $root_path . ((substr($root_path, -1, 1) == '/') ? '' : '/'); + + if (!empty($root_path)) + { + $this->root_path = (($root_path[0] != '/' ) ? '/' : '') . $root_path . ((substr($root_path, -1, 1) == '/') ? '' : '/'); + } // Init some needed values transfer::transfer(); diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index d22add63ea..3272c9663e 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1973,7 +1973,7 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna case 'approve': // Make sure we only approve those which are pending ;) - $sql = 'SELECT u.user_id, u.user_email, u.username, u.user_notify_type, u.user_jabber, u.user_lang + $sql = 'SELECT u.user_id, u.user_email, u.username, u.username_clean, u.user_notify_type, u.user_jabber, u.user_lang FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . ' ug WHERE ug.group_id = ' . $group_id . ' AND ug.user_pending = 1 @@ -2176,7 +2176,7 @@ function group_memberships($group_id_ary = false, $user_id_ary = false, $return_ $group_id_ary = (!is_array($group_id_ary)) ? array($group_id_ary) : $group_id_ary; } - $sql = 'SELECT ug.*, u.username, u.user_email + $sql = 'SELECT ug.*, u.username, u.username_clean, u.user_email FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . ' u WHERE ug.user_id = u.user_id AND '; diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index bf9ef5280d..4fdae3159d 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -180,7 +180,7 @@ function mcp_resync_topics($topic_ids) trigger_error($user->lang['NO_TOPIC_SELECTED']); } - if (check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_'))) + if (!check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_'))) { return; } diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index acfedb583f..d77d2fda60 100644 --- a/phpBB/includes/mcp/mcp_front.php +++ b/phpBB/includes/mcp/mcp_front.php @@ -63,7 +63,7 @@ function mcp_front_view($id, $mode, $action) } $db->sql_freeresult($result); - $sql = 'SELECT p.post_id, p.post_subject, p.post_time, p.poster_id, p.post_username, u.username, t.topic_id, t.topic_title, t.topic_first_post_id, p.forum_id + $sql = 'SELECT p.post_id, p.post_subject, p.post_time, p.poster_id, p.post_username, u.username, u.username_clean, t.topic_id, t.topic_title, t.topic_first_post_id, p.forum_id FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u WHERE ' . $db->sql_in_set('p.post_id', $post_list) . ' AND t.topic_id = p.topic_id @@ -134,7 +134,7 @@ function mcp_front_view($id, $mode, $action) $global_id = $forum_list[0]; $sql = $db->sql_build_query('SELECT', array( - 'SELECT' => 'r.report_time, p.post_id, p.post_subject, u.username, u.user_colour, u.user_id, t.topic_id, t.topic_title, f.forum_id, f.forum_name', + 'SELECT' => 'r.report_time, p.post_id, p.post_subject, u.username, u.username_clean, u.user_colour, u.user_id, t.topic_id, t.topic_title, f.forum_id, f.forum_name', 'FROM' => array( REPORTS_TABLE => 'r', diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index a59d965300..262e9d0c74 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -226,7 +226,7 @@ function lock_unlock($action, $ids) } unset($orig_ids); - $redirect = request_var('redirect', build_url(array('_f_', 'action'))); + $redirect = request_var('redirect', build_url(array('_f_', 'action', 'quickmod'))); $s_hidden_fields = build_hidden_fields(array( $sql_id . '_list' => $ids, @@ -591,7 +591,7 @@ function mcp_delete_topic($topic_ids) return; } - $redirect = request_var('redirect', build_url(array('_f_', 'action'))); + $redirect = request_var('redirect', build_url(array('_f_', 'action', 'quickmod'))); $forum_id = request_var('f', 0); $s_hidden_fields = build_hidden_fields(array( @@ -647,7 +647,7 @@ function mcp_delete_post($post_ids) return; } - $redirect = request_var('redirect', build_url(array('_f_', 'action'))); + $redirect = request_var('redirect', build_url(array('_f_', 'action', 'quickmod'))); $forum_id = request_var('f', 0); $s_hidden_fields = build_hidden_fields(array( @@ -770,7 +770,7 @@ function mcp_fork_topic($topic_ids) $to_forum_id = request_var('to_forum_id', 0); $forum_id = request_var('forum_id', 0); - $redirect = request_var('redirect', build_url(array('_f_', 'action'))); + $redirect = request_var('redirect', build_url(array('_f_', 'action', 'quickmod'))); $additional_msg = $success_msg = ''; $s_hidden_fields = build_hidden_fields(array( diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php index 84bba18bb7..96fe1f9bd0 100755 --- a/phpBB/includes/mcp/mcp_notes.php +++ b/phpBB/includes/mcp/mcp_notes.php @@ -41,7 +41,8 @@ class mcp_notes { case 'front': $template->assign_vars(array( - 'U_FIND_MEMBER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp&field=username'), + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp&field=username'), + 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp&field=username', false), 'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes'), 'L_TITLE' => $user->lang['MCP_NOTES']) diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index a1cc7f4331..44558eb553 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -119,7 +119,8 @@ function mcp_post_details($id, $mode, $action) 'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false, 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}") : '', - 'U_FIND_MEMBER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp_chgposter&field=username'), + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp_chgposter&field=username'), + 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp_chgposter&field=username', false), 'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $post_info['forum_id'] . '&p=' . $post_id), 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $post_info['forum_id'] . '&p=' . $post_id), 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $post_info['user_id']), @@ -316,7 +317,7 @@ function mcp_post_details($id, $mode, $action) */ function change_poster(&$post_info, $userdata) { - global $auth, $db, $config; + global $auth, $db, $config, $phpbb_root_path, $phpEx; if (empty($userdata) || $userdata['user_id'] == $post_info['user_id']) { diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index df23bcd98f..3fd7e6d856 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -248,7 +248,7 @@ class mcp_queue if (sizeof($post_ids)) { - $sql = 'SELECT t.topic_id, t.topic_title, t.forum_id, p.post_id, p.post_subject, p.post_username, p.poster_id, p.post_time, u.username, u.user_colour + $sql = 'SELECT t.topic_id, t.topic_title, t.forum_id, p.post_id, p.post_subject, p.post_username, p.poster_id, p.post_time, u.username, u.username_clean, u.user_colour FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u WHERE ' . $db->sql_in_set('p.post_id', $post_ids) . ' AND t.topic_id = p.topic_id @@ -382,7 +382,7 @@ function approve_post($post_id_list, $mode) trigger_error('NOT_AUTHORIZED'); } - $redirect = request_var('redirect', build_url(array('_f_'))); + $redirect = request_var('redirect', build_url(array('_f_', 'quickmod'))); $success_msg = ''; $s_hidden_fields = build_hidden_fields(array( @@ -627,7 +627,7 @@ function disapprove_post($post_id_list, $mode) trigger_error('NOT_AUTHORIZED'); } - $redirect = request_var('redirect', build_url(array('t', 'mode', '_f_')) . '&mode=unapproved_topics'); + $redirect = request_var('redirect', build_url(array('t', 'mode', '_f_', 'quickmod')) . '&mode=unapproved_topics'); $reason = request_var('reason', '', true); $reason_id = request_var('reason_id', 0); $success_msg = $additional_msg = ''; diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index 7a84c872a5..91e5b8633b 100755 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -64,7 +64,7 @@ class mcp_reports // closed reports are accessed by report id $report_id = request_var('r', 0); - $sql = 'SELECT r.post_id, r.user_id, r.report_closed, report_time, r.report_text, rr.reason_title, rr.reason_description, u.username, u.user_colour + $sql = 'SELECT r.post_id, r.user_id, r.report_closed, report_time, r.report_text, rr.reason_title, rr.reason_description, u.username, u.username_clean, u.user_colour FROM ' . REPORTS_TABLE . ' r, ' . REPORTS_REASONS_TABLE . ' rr, ' . USERS_TABLE . ' u WHERE ' . (($report_id) ? 'r.report_id = ' . $report_id : "r.post_id = $post_id AND r.report_closed = 0") . ' AND rr.reason_id = r.reason_id @@ -279,7 +279,7 @@ class mcp_reports if (sizeof($report_ids)) { - $sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, p.post_id, p.post_subject, p.post_username, p.poster_id, p.post_time, u.username, u.user_colour, r.user_id as reporter_id, ru.username as reporter_name, ru.user_colour as reporter_colour, r.report_time, r.report_id + $sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, p.post_id, p.post_subject, p.post_username, p.poster_id, p.post_time, u.username, u.username_clean, u.user_colour, r.user_id as reporter_id, ru.username as reporter_name, ru.user_colour as reporter_colour, r.report_time, r.report_id FROM ' . REPORTS_TABLE . ' r, ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . USERS_TABLE . ' u, ' . USERS_TABLE . ' ru WHERE ' . $db->sql_in_set('r.report_id', $report_ids) . ' AND t.topic_id = p.topic_id @@ -361,15 +361,15 @@ function close_report($post_id_list, $mode, $action) if ($action == 'delete' && strpos($user->data['session_page'], 'mode=report_details') !== false) { - $redirect = request_var('redirect', build_url(array('mode', '_f_', 'r')) . '&mode=reports'); + $redirect = request_var('redirect', build_url(array('mode', '_f_', 'r', 'quickmod')) . '&mode=reports'); } else if ($action == 'close' && !request_var('r', 0)) { - $redirect = request_var('redirect', build_url(array('mode', '_f_', 'p')) . '&mode=reports'); + $redirect = request_var('redirect', build_url(array('mode', '_f_', 'p', 'quickmod')) . '&mode=reports'); } else { - $redirect = request_var('redirect', build_url(array('_f_'))); + $redirect = request_var('redirect', build_url(array('_f_', 'quickmod'))); } $success_msg = ''; @@ -385,7 +385,7 @@ function close_report($post_id_list, $mode, $action) { $post_info = get_post_data($post_id_list, 'm_report'); - $sql = 'SELECT r.post_id, r.report_closed, r.user_id, r.user_notify, u.username, u.user_email, u.user_jabber, u.user_lang, u.user_notify_type + $sql = 'SELECT r.post_id, r.report_closed, r.user_id, r.user_notify, u.username, u.username_clean, u.user_email, u.user_jabber, u.user_lang, u.user_notify_type FROM ' . REPORTS_TABLE . ' r, ' . USERS_TABLE . ' u WHERE ' . $db->sql_in_set('r.post_id', array_keys($post_info)) . ' ' . (($action == 'close') ? 'AND r.report_closed = 0' : '') . ' diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index ae4ed9850c..44904358e5 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -79,7 +79,7 @@ function mcp_topic_view($id, $mode, $action) $posts_per_page = $total; } - $sql = 'SELECT u.username, u.user_colour, p.* + $sql = 'SELECT u.username, u.username_clean, u.user_colour, p.* FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u WHERE ' . (($action == 'reports') ? 'p.post_reported = 1 AND ' : '') . ' p.topic_id = ' . $topic_id . ' ' . @@ -467,6 +467,7 @@ function merge_posts($topic_id, $to_topic_id) if (sizeof($topic_data)) { + $topic_data = $topic_data[$topic_id]; $return_link .= sprintf($user->lang['RETURN_TOPIC'], '', ''); } diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index ef8d0132fc..cce30833ff 100755 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -71,7 +71,8 @@ function mcp_warn_front_view($id, $mode) global $template, $db, $user, $auth; $template->assign_vars(array( - 'U_FIND_MEMBER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp&field=username'), + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp&field=username'), + 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp&field=username', false), 'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user'), ) ); @@ -102,7 +103,7 @@ function mcp_warn_front_view($id, $mode) // And now the 5 most recent users to get in trouble - $sql = 'SELECT u.user_id, u.username, u.user_colour, u.user_warnings, w.warning_time + $sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_colour, u.user_warnings, w.warning_time FROM ' . USERS_TABLE . ' u, ' . WARNINGS_TABLE . ' w WHERE u.user_id = w.user_id ORDER BY w.warning_time DESC'; diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 1408463c0b..80d66291d7 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -870,9 +870,10 @@ class session * Only IPv4 (rbldns does not support AAAA records/IPv6 lookups) * * @author satmd (from the php manual) + * @param string $mode register/post - spamcop for example is ommitted for posting * @return false if ip is not blacklisted, else an array([checked server], [lookup]) */ - function check_dnsbl($ip = false) + function check_dnsbl($mode, $ip = false) { if ($ip === false) { @@ -880,11 +881,15 @@ class session } $dnsbl_check = array( - 'bl.spamcop.net' => 'http://spamcop.net/bl.shtml?', 'list.dsbl.org' => 'http://dsbl.org/listing?', 'sbl-xbl.spamhaus.org' => 'http://www.spamhaus.org/query/bl?ip=', ); + if ($mode == 'register') + { + $dnsbl_check['bl.spamcop.net'] = 'http://spamcop.net/bl.shtml?'; + } + if ($ip) { $quads = explode('.', $ip); diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index 1536411e9d..13ce175720 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -172,7 +172,7 @@ class ucp_groups include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); $messenger = new messenger(); - $sql = 'SELECT u.username, u.user_email, u.user_notify_type, u.user_jabber, u.user_lang + $sql = 'SELECT u.username, u.username_clean, u.user_email, u.user_notify_type, u.user_jabber, u.user_lang FROM ' . USER_GROUP_TABLE . ' ug, ' . USERS_TABLE . ' u WHERE ug.user_id = u.user_id AND ' . (($group_row[$group_id]['group_type'] == GROUP_FREE) ? "ug.user_id = {$user->data['user_id']}" : 'ug.group_leader = 1') . " @@ -675,11 +675,11 @@ class ucp_groups $start = request_var('start', 0); // Grab the members - $sql = 'SELECT u.user_id, u.username, u.user_regdate, u.user_posts, u.group_id, ug.group_leader, ug.user_pending + $sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_regdate, u.user_posts, u.group_id, ug.group_leader, ug.user_pending FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . " ug WHERE ug.group_id = $group_id AND u.user_id = ug.user_id - ORDER BY ug.group_leader DESC, ug.user_pending ASC, u.username"; + ORDER BY ug.group_leader DESC, ug.user_pending ASC, u.username_clean"; $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); $pending = false; diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php index b51f265df3..50eb91297d 100644 --- a/phpBB/includes/ucp/ucp_pm.php +++ b/phpBB/includes/ucp/ucp_pm.php @@ -368,6 +368,7 @@ class ucp_pm 'U_OUTBOX' => $this->u_action . '&folder=outbox', 'U_SENTBOX' => $this->u_action . '&folder=sentbox', 'U_CREATE_FOLDER' => $this->u_action . '&mode=options', + 'U_CURRENT_FOLDER' => $this->u_action . '&folder=' . $folder_id, 'S_IN_INBOX' => ($folder_id == PRIVMSGS_INBOX) ? true : false, 'S_IN_OUTBOX' => ($folder_id == PRIVMSGS_OUTBOX) ? true : false, diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 3cfb2f37a9..8fa5de090f 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -90,7 +90,8 @@ function compose_pm($id, $mode, $action) 'S_SHOW_PM_BOX' => true, 'S_ALLOW_MASS_PM' => ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) ? true : false, 'S_GROUP_OPTIONS' => ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) ? $group_options : '', - 'U_SEARCH_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=post&field=username_list')) + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=post&field=username_list'), + 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=post&field=username_list', true)) ); } diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php index 4277639d83..d301e2ecb9 100644 --- a/phpBB/includes/ucp/ucp_pm_viewfolder.php +++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php @@ -519,7 +519,7 @@ function get_pm_from($folder_id, $folder, $user_id) $sql_start = $start; } - $sql = 'SELECT t.*, p.root_level, p.message_time, p.message_subject, p.icon_id, p.to_address, p.message_attachment, p.bcc_address, u.username, u.user_colour + $sql = 'SELECT t.*, p.root_level, p.message_time, p.message_subject, p.icon_id, p.to_address, p.message_attachment, p.bcc_address, u.username, u.username_clean, u.user_colour FROM ' . PRIVMSGS_TO_TABLE . ' t, ' . PRIVMSGS_TABLE . ' p, ' . USERS_TABLE . " u WHERE t.user_id = $user_id AND p.author_id = u.user_id diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 9a19baa257..6764dd9d43 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -193,6 +193,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) 'MESSAGE' => $message, 'SIGNATURE' => ($message_row['enable_sig']) ? $signature : '', 'EDITED_MESSAGE' => $l_edited_by, + 'MESSAGE_ID' => $message_row['msg_id'], 'U_INFO' => ($auth->acl_get('m_info') && $message_row['pm_forwarded']) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'mode=pm_details&p=' . $message_row['msg_id'], true, $user->session_id) : '', 'U_DELETE' => ($auth->acl_get('u_pm_delete')) ? "$url&mode=compose&action=delete&f=$folder_id&p=" . $message_row['msg_id'] : '', diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php index e72673c023..e57cc3ec26 100644 --- a/phpBB/includes/ucp/ucp_prefs.php +++ b/phpBB/includes/ucp/ucp_prefs.php @@ -215,7 +215,7 @@ class ucp_prefs $limit_post_days = array(0 => $user->lang['ALL_POSTS'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']); $sort_by_post_text = array('a' => $user->lang['AUTHOR'], 't' => $user->lang['POST_TIME'], 's' => $user->lang['SUBJECT']); - $sort_by_post_sql = array('a' => 'u.username', 't' => 'p.post_id', 's' => 'p.post_subject'); + $sort_by_post_sql = array('a' => 'u.username_clean', 't' => 'p.post_id', 's' => 'p.post_subject'); $_options = array('topic', 'post'); foreach ($_options as $sort_option) diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index fcbc2675f8..2e355fe3c2 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -157,7 +157,7 @@ class ucp_register // DNSBL check if ($config['check_dnsbl']) { - if (($dnsbl = $user->check_dnsbl()) !== false) + if (($dnsbl = $user->check_dnsbl('register')) !== false) { $error[] = sprintf($user->lang['IP_BLACKLISTED'], $user->ip, $dnsbl[1]); } diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php index b65ba2fd29..c9478fd01a 100644 --- a/phpBB/includes/ucp/ucp_zebra.php +++ b/phpBB/includes/ucp/ucp_zebra.php @@ -48,7 +48,7 @@ class ucp_zebra // 'nice' and automatically handle names added to one list present on // the other (by removing the existing one) ... but I have a feeling this // may lead to complaints - $sql = 'SELECT z.*, u.username + $sql = 'SELECT z.*, u.username, u.username_clean FROM ' . ZEBRA_TABLE . ' z, ' . USERS_TABLE . ' u WHERE z.user_id = ' . $user->data['user_id'] . ' AND u.user_id = z.zebra_id'; @@ -197,7 +197,7 @@ class ucp_zebra } $sql_and = ($mode == 'friends') ? 'z.friend = 1' : 'z.foe = 1'; - $sql = 'SELECT z.*, u.username + $sql = 'SELECT z.*, u.username, u.username_clean FROM ' . ZEBRA_TABLE . ' z, ' . USERS_TABLE . ' u WHERE z.user_id = ' . $user->data['user_id'] . " AND $sql_and @@ -215,7 +215,8 @@ class ucp_zebra $template->assign_vars(array( 'L_TITLE' => $user->lang['UCP_ZEBRA_' . $l_mode], - 'U_SEARCH_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=add'), + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=add'), + 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=add', true), 'S_USERNAME_OPTIONS' => $s_username_options, 'S_HIDDEN_FIELDS' => $s_hidden_fields, diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index f7d9a801ee..c57aff8ed8 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -6,6 +6,12 @@ * @copyright (c) 2006 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU Public License * +* @todo add successful file update to log +* @todo add successful database update to log +* @todo do database update before updating files. Within the updater create a new config variable (version_update_from). Use this version in favor of the real versino to check for the database update successfully run through. After successful file update remove the information. +* @todo check memory by setting limit to 8MB locally. +* @todo make sure binary files get updated too, omitting the diff engine for this (handle like a conflict) +* @todo do not require login... */ /** @@ -71,6 +77,8 @@ class install_update extends module global $template, $phpEx, $phpbb_root_path, $user, $db, $config, $cache, $auth; $this->tpl_name = 'install_update'; + $this->page_title = 'UPDATE_INSTALLATION'; + $this->old_location = $phpbb_root_path . 'install/update/old/'; $this->new_location = $phpbb_root_path . 'install/update/new/'; @@ -87,7 +95,17 @@ class install_update extends module // We do not need this any longer, unset for safety purposes unset($dbpasswd); - $config = $cache->obtain_config(); + $config = array(); + + $sql = 'SELECT config_name, config_value + FROM ' . CONFIG_TABLE; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $config[$row['config_name']] = $row['config_value']; + } + $db->sql_freeresult($result); // First of all, init the user session $user->session_begin(); @@ -99,17 +117,6 @@ class install_update extends module include_once($phpbb_root_path . 'includes/diff/engine.' . $phpEx); include_once($phpbb_root_path . 'includes/diff/renderer.' . $phpEx); - // Check for user session - if (!$user->data['is_registered']) - { - login_box('', $user->lang['LOGIN_UPDATE_EXPLAIN']); - } - - if (!$auth->acl_get('a_')) - { - trigger_error($user->lang['NO_AUTH_UPDATE']); - } - // If we are within the intro page we need to make sure we get up-to-date version info if ($sub == 'intro') { @@ -696,6 +703,8 @@ class install_update extends module 'U_DB_UPDATE' => $phpbb_root_path . 'install/database_update.' . $phpEx) ); + + break; } } diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 481a77d576..c5c31767c6 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows diff --git a/phpBB/language/en/acp/bots.php b/phpBB/language/en/acp/bots.php index dda1dcf73f..875af18b9b 100644 --- a/phpBB/language/en/acp/bots.php +++ b/phpBB/language/en/acp/bots.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 76db47b1eb..4b0ec7fea6 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -20,6 +20,8 @@ if (empty($lang) || !is_array($lang)) // DEVELOPERS PLEASE NOTE // +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. +// // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows // translators to re-order the output of data while ensuring it remains correct diff --git a/phpBB/language/en/acp/database.php b/phpBB/language/en/acp/database.php index b03348ba46..07605cc4cb 100644 --- a/phpBB/language/en/acp/database.php +++ b/phpBB/language/en/acp/database.php @@ -18,7 +18,9 @@ if (empty($lang) || !is_array($lang)) $lang = array(); } -// DEVELOPERS PLEASE NOTE +// DEVELOPERS PLEASE NOTE +// +// All language files should use UTF-8 as their encoding and the files must not contain a BOM. // // Placeholders can now contain order information, e.g. instead of // 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows diff --git a/phpBB/language/en/acp/email.php b/phpBB/language/en/acp/email.php index 1bb377fc2f..5b66f2cd9b 100644 --- a/phpBB/language/en/acp/email.php +++ b/phpBB/language/en/acp/email.php @@ -30,7 +30,7 @@ if (empty($lang) || !is_array($lang)) // equally where a string contains only two placeholders which are used to wrap text // in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine -// Bot settings +// Email settings $lang = array_merge($lang, array( 'ACP_MASS_EMAIL_EXPLAIN' => 'Here you can email a message to either all of your users or all users of a specific group. To do this, an email will be sent out to the administrative email address supplied, with a blind carbon copy sent to all recipients. If you are emailing a large group of people please be patient after submitting and do not stop the page halfway through. It is normal for a mass emailing to take a long time, you will be notified when the script has completed', 'ALL_USERS' => 'All users', diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 834a938049..8b35a162e5 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -122,7 +122,7 @@ switch ($mode) $db->sql_freeresult($result); $sql = $db->sql_build_query('SELECT', array( - 'SELECT' => 'u.user_id, u.group_id as default_group, u.username, u.user_colour, u.user_rank, u.user_posts, u.user_allow_pm, g.group_id, g.group_name, g.group_colour, g.group_type, ug.user_id as ug_user_id', + 'SELECT' => 'u.user_id, u.group_id as default_group, u.username, u.username_clean, u.user_colour, u.user_rank, u.user_posts, u.user_allow_pm, g.group_id, g.group_name, g.group_colour, g.group_type, ug.user_id as ug_user_id', 'FROM' => array( USERS_TABLE => 'u', diff --git a/phpBB/posting.php b/phpBB/posting.php index 654db73a61..ba32f24626 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -88,7 +88,7 @@ switch ($mode) trigger_error('NO_POST'); } - $sql = 'SELECT f.*, t.*, p.*, u.username, u.user_sig, u.user_sig_bbcode_uid, u.user_sig_bbcode_bitfield + $sql = 'SELECT f.*, t.*, p.*, u.username, u.username_clean, u.user_sig, u.user_sig_bbcode_uid, u.user_sig_bbcode_bitfield FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t, ' . FORUMS_TABLE . ' f, ' . USERS_TABLE . " u WHERE p.post_id = $post_id AND t.topic_id = p.topic_id @@ -794,7 +794,7 @@ if ($submit || $preview || $refresh) // DNSBL check if ($config['check_dnsbl'] && !$refresh) { - if (($dnsbl = $user->check_dnsbl()) !== false) + if (($dnsbl = $user->check_dnsbl('post')) !== false) { $error[] = sprintf($user->lang['IP_BLACKLISTED'], $user->ip, $dnsbl[1]); } diff --git a/phpBB/search.php b/phpBB/search.php index 1be3aa8b14..9985e287bd 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -505,7 +505,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) } $db->sql_freeresult($result); - $sql = 'SELECT p.*, f.forum_id, f.forum_name, t.*, u.username, u.user_sig, u.user_sig_bbcode_uid, u.user_colour + $sql = 'SELECT p.*, f.forum_id, f.forum_name, t.*, u.username, u.username_clean, u.user_sig, u.user_sig_bbcode_uid, u.user_colour FROM ' . POSTS_TABLE . ' p LEFT JOIN ' . TOPICS_TABLE . ' t ON (p.topic_id = t.topic_id) LEFT JOIN ' . FORUMS_TABLE . ' f ON (p.forum_id = f.forum_id) diff --git a/phpBB/styles/subSilver/template/mcp_notes_front.html b/phpBB/styles/subSilver/template/mcp_notes_front.html index c43fad9465..b374773f65 100755 --- a/phpBB/styles/subSilver/template/mcp_notes_front.html +++ b/phpBB/styles/subSilver/template/mcp_notes_front.html @@ -7,7 +7,7 @@ - + diff --git a/phpBB/styles/subSilver/template/mcp_post.html b/phpBB/styles/subSilver/template/mcp_post.html index a86aacf006..301ee6a9a7 100644 --- a/phpBB/styles/subSilver/template/mcp_post.html +++ b/phpBB/styles/subSilver/template/mcp_post.html @@ -101,7 +101,7 @@ - + diff --git a/phpBB/styles/subSilver/template/mcp_warn_front.html b/phpBB/styles/subSilver/template/mcp_warn_front.html index c77f1c8644..432580325b 100755 --- a/phpBB/styles/subSilver/template/mcp_warn_front.html +++ b/phpBB/styles/subSilver/template/mcp_warn_front.html @@ -7,7 +7,7 @@ - + diff --git a/phpBB/styles/subSilver/template/simple_footer.html b/phpBB/styles/subSilver/template/simple_footer.html index 1d627c1dda..a7d656404b 100644 --- a/phpBB/styles/subSilver/template/simple_footer.html +++ b/phpBB/styles/subSilver/template/simple_footer.html @@ -10,7 +10,7 @@ forums may be affected. The phpBB Group : 2006 -// --> +//-->
Powered by phpBB © 2002, 2006 phpBB Group diff --git a/phpBB/styles/subSilver/template/ucp_zebra_foes.html b/phpBB/styles/subSilver/template/ucp_zebra_foes.html index 7ff375ce79..1248b6fd2d 100644 --- a/phpBB/styles/subSilver/template/ucp_zebra_foes.html +++ b/phpBB/styles/subSilver/template/ucp_zebra_foes.html @@ -17,7 +17,7 @@
- + diff --git a/phpBB/styles/subSilver/template/ucp_zebra_friends.html b/phpBB/styles/subSilver/template/ucp_zebra_friends.html index fa0403002f..4be2b8838f 100644 --- a/phpBB/styles/subSilver/template/ucp_zebra_friends.html +++ b/phpBB/styles/subSilver/template/ucp_zebra_friends.html @@ -17,7 +17,7 @@ - + diff --git a/phpBB/ucp.php b/phpBB/ucp.php index d1461c1764..d0163d9daf 100755 --- a/phpBB/ucp.php +++ b/phpBB/ucp.php @@ -244,7 +244,7 @@ if (!$user->data['is_registered']) $update_time = $config['load_online_time'] * 60; $sql = $db->sql_build_query('SELECT_DISTINCT', array( - 'SELECT' => 'u.user_id, u.username, u.user_colour, u.user_allow_viewonline, MAX(s.session_time) as online_time, MIN(s.session_viewonline) AS viewonline', + 'SELECT' => 'u.user_id, u.username, u.username_clean, u.user_colour, u.user_allow_viewonline, MAX(s.session_time) as online_time, MIN(s.session_viewonline) AS viewonline', 'FROM' => array( USERS_TABLE => 'u', @@ -262,7 +262,7 @@ $sql = $db->sql_build_query('SELECT_DISTINCT', array( AND z.friend = 1 AND u.user_id = z.zebra_id', - 'GROUP_BY' => 'z.zebra_id, u.user_id, u.username, u.user_allow_viewonline, u.user_colour', + 'GROUP_BY' => 'z.zebra_id, u.user_id, u.username_clean, u.user_allow_viewonline, u.user_colour, u.username', 'ORDER_BY' => 'u.username_clean ASC', )); diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php index 8d5f73f0ef..85f4749f53 100644 --- a/phpBB/viewonline.php +++ b/phpBB/viewonline.php @@ -117,7 +117,7 @@ if (!$show_guests) } // Get user list -$sql = 'SELECT u.user_id, u.username, u.user_type, u.user_allow_viewonline, u.user_colour, s.session_id, s.session_time, s.session_page, s.session_ip, s.session_viewonline +$sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_type, u.user_allow_viewonline, u.user_colour, s.session_id, s.session_time, s.session_page, s.session_ip, s.session_viewonline FROM ' . USERS_TABLE . ' u, ' . SESSIONS_TABLE . ' s WHERE u.user_id = s.session_user_id AND s.session_time >= ' . (time() - ($config['load_online_time'] * 60)) . From fbe0c22293ca8889090bb9455f9d12da6a69f655 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 2 Dec 2006 13:43:21 +0000 Subject: [PATCH 019/264] fix git-svn-id: file:///svn/phpbb/trunk@6699 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/diff/renderer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/diff/renderer.php b/phpBB/includes/diff/renderer.php index 6f4400051c..490450dd7b 100644 --- a/phpBB/includes/diff/renderer.php +++ b/phpBB/includes/diff/renderer.php @@ -111,7 +111,7 @@ class diff_renderer $ntrail = $this->_trailing_context_lines; $output = $this->_start_diff(); - $diffs = &$diff->get_diff(); + $diffs = $diff->get_diff(); foreach ($diffs as $i => $edit) { From 7a79c742883e26f6ba14701a909dc8d2f97ae8c2 Mon Sep 17 00:00:00 2001 From: David M Date: Sat, 2 Dec 2006 16:52:17 +0000 Subject: [PATCH 020/264] by the power of math! git-svn-id: file:///svn/phpbb/trunk@6700 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_messenger.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 4625ba47d0..f08e81e754 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -1406,7 +1406,7 @@ function mail_encode($str) { $text = ''; - while (sizeof($array) && strlen(base64_encode($text . $array[0])) <= $split_length) + while (sizeof($array) && intval((strlen($text . $array[0]) + 2) / 3) << 2 <= $split_length) { $text .= array_shift($array); } From e08317eb7132692ab93115d47e78b4841909c07c Mon Sep 17 00:00:00 2001 From: David M Date: Sat, 2 Dec 2006 18:16:25 +0000 Subject: [PATCH 021/264] - pretty serious speed improvement for strtoupper/strtolower - mbstring envrio checks #5774 git-svn-id: file:///svn/phpbb/trunk@6701 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/utf/utf_tools.php | 217 ++++++++++++++---------------- phpBB/install/install_install.php | 62 ++++++++- phpBB/language/en/install.php | 12 ++ 3 files changed, 175 insertions(+), 116 deletions(-) diff --git a/phpBB/includes/utf/utf_tools.php b/phpBB/includes/utf/utf_tools.php index 4c6c26909a..d4277e1f20 100644 --- a/phpBB/includes/utf/utf_tools.php +++ b/phpBB/includes/utf/utf_tools.php @@ -18,6 +18,9 @@ if (!defined('IN_PHPBB')) exit; } +// Enforce ASCII only string handling +setlocale(LC_CTYPE, 'C'); + /** * UTF-8 tools * @@ -104,6 +107,8 @@ if (!extension_loaded('xml')) // if mbstring is not loaded, we go into native mode. if (extension_loaded('mbstring')) { + mb_internal_encoding('UTF-8'); + /** * UTF-8 aware alternative to strrpos * Find position of last occurrence of a char in a string @@ -320,116 +325,6 @@ else } } - $UTF8_UPPER_TO_LOWER = array( - "\x41" => "\x61", "\x42" => "\x62", "\x43" => "\x63", "\x44" => "\x64", - "\x45" => "\x65", "\x46" => "\x66", "\x47" => "\x67", "\x48" => "\x68", - "\x49" => "\x69", "\x4A" => "\x6A", "\x4B" => "\x6B", "\x4C" => "\x6C", - "\x4D" => "\x6D", "\x4E" => "\x6E", "\x4F" => "\x6F", "\x50" => "\x70", - "\x51" => "\x71", "\x52" => "\x72", "\x53" => "\x73", "\x54" => "\x74", - "\x55" => "\x75", "\x56" => "\x76", "\x57" => "\x77", "\x58" => "\x78", - "\x59" => "\x79", "\x5A" => "\x7A", "\xC3\x80" => "\xC3\xA0", "\xC3\x81" => "\xC3\xA1", - "\xC3\x82" => "\xC3\xA2", "\xC3\x83" => "\xC3\xA3", "\xC3\x84" => "\xC3\xA4", "\xC3\x85" => "\xC3\xA5", - "\xC3\x86" => "\xC3\xA6", "\xC3\x87" => "\xC3\xA7", "\xC3\x88" => "\xC3\xA8", "\xC3\x89" => "\xC3\xA9", - "\xC3\x8A" => "\xC3\xAA", "\xC3\x8B" => "\xC3\xAB", "\xC3\x8C" => "\xC3\xAC", "\xC3\x8D" => "\xC3\xAD", - "\xC3\x8E" => "\xC3\xAE", "\xC3\x8F" => "\xC3\xAF", "\xC3\x90" => "\xC3\xB0", "\xC3\x91" => "\xC3\xB1", - "\xC3\x92" => "\xC3\xB2", "\xC3\x93" => "\xC3\xB3", "\xC3\x94" => "\xC3\xB4", "\xC3\x95" => "\xC3\xB5", - "\xC3\x96" => "\xC3\xB6", "\xC3\x98" => "\xC3\xB8", "\xC3\x99" => "\xC3\xB9", "\xC3\x9A" => "\xC3\xBA", - "\xC3\x9B" => "\xC3\xBB", "\xC3\x9C" => "\xC3\xBC", "\xC3\x9D" => "\xC3\xBD", "\xC3\x9E" => "\xC3\xBE", - "\xC4\x80" => "\xC4\x81", "\xC4\x82" => "\xC4\x83", "\xC4\x84" => "\xC4\x85", "\xC4\x86" => "\xC4\x87", - "\xC4\x88" => "\xC4\x89", "\xC4\x8A" => "\xC4\x8B", "\xC4\x8C" => "\xC4\x8D", "\xC4\x8E" => "\xC4\x8F", - "\xC4\x90" => "\xC4\x91", "\xC4\x92" => "\xC4\x93", "\xC4\x96" => "\xC4\x97", "\xC4\x98" => "\xC4\x99", - "\xC4\x9A" => "\xC4\x9B", "\xC4\x9C" => "\xC4\x9D", "\xC4\x9E" => "\xC4\x9F", "\xC4\xA0" => "\xC4\xA1", - "\xC4\xA2" => "\xC4\xA3", "\xC4\xA4" => "\xC4\xA5", "\xC4\xA6" => "\xC4\xA7", "\xC4\xA8" => "\xC4\xA9", - "\xC4\xAA" => "\xC4\xAB", "\xC4\xAE" => "\xC4\xAF", "\xC4\xB4" => "\xC4\xB5", "\xC4\xB6" => "\xC4\xB7", - "\xC4\xB9" => "\xC4\xBA", "\xC4\xBB" => "\xC4\xBC", "\xC4\xBD" => "\xC4\xBE", "\xC5\x81" => "\xC5\x82", - "\xC5\x83" => "\xC5\x84", "\xC5\x85" => "\xC5\x86", "\xC5\x87" => "\xC5\x88", "\xC5\x8A" => "\xC5\x8B", - "\xC5\x8C" => "\xC5\x8D", "\xC5\x90" => "\xC5\x91", "\xC5\x94" => "\xC5\x95", "\xC5\x96" => "\xC5\x97", - "\xC5\x98" => "\xC5\x99", "\xC5\x9A" => "\xC5\x9B", "\xC5\x9C" => "\xC5\x9D", "\xC5\x9E" => "\xC5\x9F", - "\xC5\xA0" => "\xC5\xA1", "\xC5\xA2" => "\xC5\xA3", "\xC5\xA4" => "\xC5\xA5", "\xC5\xA6" => "\xC5\xA7", - "\xC5\xA8" => "\xC5\xA9", "\xC5\xAA" => "\xC5\xAB", "\xC5\xAC" => "\xC5\xAD", "\xC5\xAE" => "\xC5\xAF", - "\xC5\xB0" => "\xC5\xB1", "\xC5\xB2" => "\xC5\xB3", "\xC5\xB4" => "\xC5\xB5", "\xC5\xB6" => "\xC5\xB7", - "\xC5\xB8" => "\xC3\xBF", "\xC5\xB9" => "\xC5\xBA", "\xC5\xBB" => "\xC5\xBC", "\xC5\xBD" => "\xC5\xBE", - "\xC6\xA0" => "\xC6\xA1", "\xC6\xAF" => "\xC6\xB0", "\xC8\x98" => "\xC8\x99", "\xC8\x9A" => "\xC8\x9B", - "\xCE\x86" => "\xCE\xAC", "\xCE\x88" => "\xCE\xAD", "\xCE\x89" => "\xCE\xAE", "\xCE\x8A" => "\xCE\xAF", - "\xCE\x8C" => "\xCF\x8C", "\xCE\x8E" => "\xCF\x8D", "\xCE\x8F" => "\xCF\x8E", "\xCE\x91" => "\xCE\xB1", - "\xCE\x92" => "\xCE\xB2", "\xCE\x93" => "\xCE\xB3", "\xCE\x94" => "\xCE\xB4", "\xCE\x95" => "\xCE\xB5", - "\xCE\x96" => "\xCE\xB6", "\xCE\x97" => "\xCE\xB7", "\xCE\x98" => "\xCE\xB8", "\xCE\x99" => "\xCE\xB9", - "\xCE\x9A" => "\xCE\xBA", "\xCE\x9B" => "\xCE\xBB", "\xCE\x9C" => "\xCE\xBC", "\xCE\x9D" => "\xCE\xBD", - "\xCE\x9E" => "\xCE\xBE", "\xCE\x9F" => "\xCE\xBF", "\xCE\xA0" => "\xCF\x80", "\xCE\xA1" => "\xCF\x81", - "\xCE\xA3" => "\xCF\x83", "\xCE\xA4" => "\xCF\x84", "\xCE\xA5" => "\xCF\x85", "\xCE\xA6" => "\xCF\x86", - "\xCE\xA7" => "\xCF\x87", "\xCE\xA8" => "\xCF\x88", "\xCE\xA9" => "\xCF\x89", "\xCE\xAA" => "\xCF\x8A", - "\xCE\xAB" => "\xCF\x8B", "\xD0\x81" => "\xD1\x91", "\xD0\x82" => "\xD1\x92", "\xD0\x83" => "\xD1\x93", - "\xD0\x84" => "\xD1\x94", "\xD0\x85" => "\xD1\x95", "\xD0\x86" => "\xD1\x96", "\xD0\x87" => "\xD1\x97", - "\xD0\x88" => "\xD1\x98", "\xD0\x89" => "\xD1\x99", "\xD0\x8A" => "\xD1\x9A", "\xD0\x8B" => "\xD1\x9B", - "\xD0\x8C" => "\xD1\x9C", "\xD0\x8E" => "\xD1\x9E", "\xD0\x8F" => "\xD1\x9F", "\xD0\x90" => "\xD0\xB0", - "\xD0\x91" => "\xD0\xB1", "\xD0\x92" => "\xD0\xB2", "\xD0\x93" => "\xD0\xB3", "\xD0\x94" => "\xD0\xB4", - "\xD0\x95" => "\xD0\xB5", "\xD0\x96" => "\xD0\xB6", "\xD0\x97" => "\xD0\xB7", "\xD0\x98" => "\xD0\xB8", - "\xD0\x99" => "\xD0\xB9", "\xD0\x9A" => "\xD0\xBA", "\xD0\x9B" => "\xD0\xBB", "\xD0\x9C" => "\xD0\xBC", - "\xD0\x9D" => "\xD0\xBD", "\xD0\x9E" => "\xD0\xBE", "\xD0\x9F" => "\xD0\xBF", "\xD0\xA0" => "\xD1\x80", - "\xD0\xA1" => "\xD1\x81", "\xD0\xA2" => "\xD1\x82", "\xD0\xA3" => "\xD1\x83", "\xD0\xA4" => "\xD1\x84", - "\xD0\xA5" => "\xD1\x85", "\xD0\xA6" => "\xD1\x86", "\xD0\xA7" => "\xD1\x87", "\xD0\xA8" => "\xD1\x88", - "\xD0\xA9" => "\xD1\x89", "\xD0\xAA" => "\xD1\x8A", "\xD0\xAB" => "\xD1\x8B", "\xD0\xAC" => "\xD1\x8C", - "\xD0\xAD" => "\xD1\x8D", "\xD0\xAE" => "\xD1\x8E", "\xD0\xAF" => "\xD1\x8F", "\xD2\x90" => "\xD2\x91", - "\xE1\xB8\x82" => "\xE1\xB8\x83", "\xE1\xB8\x8A" => "\xE1\xB8\x8B", "\xE1\xB8\x9E" => "\xE1\xB8\x9F", "\xE1\xB9\x80" => "\xE1\xB9\x81", - "\xE1\xB9\x96" => "\xE1\xB9\x97", "\xE1\xB9\xA0" => "\xE1\xB9\xA1", "\xE1\xB9\xAA" => "\xE1\xB9\xAB", "\xE1\xBA\x80" => "\xE1\xBA\x81", - "\xE1\xBA\x82" => "\xE1\xBA\x83", "\xE1\xBA\x84" => "\xE1\xBA\x85", "\xE1\xBB\xB2" => "\xE1\xBB\xB3" - ); - - $UTF8_LOWER_TO_UPPER = array( - "\x61" => "\x41", "\x62" => "\x42", "\x63" => "\x43", "\x64" => "\x44", - "\x65" => "\x45", "\x66" => "\x46", "\x67" => "\x47", "\x68" => "\x48", - "\x69" => "\x49", "\x6A" => "\x4A", "\x6B" => "\x4B", "\x6C" => "\x4C", - "\x6D" => "\x4D", "\x6E" => "\x4E", "\x6F" => "\x4F", "\x70" => "\x50", - "\x71" => "\x51", "\x72" => "\x52", "\x73" => "\x53", "\x74" => "\x54", - "\x75" => "\x55", "\x76" => "\x56", "\x77" => "\x57", "\x78" => "\x58", - "\x79" => "\x59", "\x7A" => "\x5A", "\xC3\xA0" => "\xC3\x80", "\xC3\xA1" => "\xC3\x81", - "\xC3\xA2" => "\xC3\x82", "\xC3\xA3" => "\xC3\x83", "\xC3\xA4" => "\xC3\x84", "\xC3\xA5" => "\xC3\x85", - "\xC3\xA6" => "\xC3\x86", "\xC3\xA7" => "\xC3\x87", "\xC3\xA8" => "\xC3\x88", "\xC3\xA9" => "\xC3\x89", - "\xC3\xAA" => "\xC3\x8A", "\xC3\xAB" => "\xC3\x8B", "\xC3\xAC" => "\xC3\x8C", "\xC3\xAD" => "\xC3\x8D", - "\xC3\xAE" => "\xC3\x8E", "\xC3\xAF" => "\xC3\x8F", "\xC3\xB0" => "\xC3\x90", "\xC3\xB1" => "\xC3\x91", - "\xC3\xB2" => "\xC3\x92", "\xC3\xB3" => "\xC3\x93", "\xC3\xB4" => "\xC3\x94", "\xC3\xB5" => "\xC3\x95", - "\xC3\xB6" => "\xC3\x96", "\xC3\xB8" => "\xC3\x98", "\xC3\xB9" => "\xC3\x99", "\xC3\xBA" => "\xC3\x9A", - "\xC3\xBB" => "\xC3\x9B", "\xC3\xBC" => "\xC3\x9C", "\xC3\xBD" => "\xC3\x9D", "\xC3\xBE" => "\xC3\x9E", - "\xC3\xBF" => "\xC5\xB8", "\xC4\x81" => "\xC4\x80", "\xC4\x83" => "\xC4\x82", "\xC4\x85" => "\xC4\x84", - "\xC4\x87" => "\xC4\x86", "\xC4\x89" => "\xC4\x88", "\xC4\x8B" => "\xC4\x8A", "\xC4\x8D" => "\xC4\x8C", - "\xC4\x8F" => "\xC4\x8E", "\xC4\x91" => "\xC4\x90", "\xC4\x93" => "\xC4\x92", "\xC4\x97" => "\xC4\x96", - "\xC4\x99" => "\xC4\x98", "\xC4\x9B" => "\xC4\x9A", "\xC4\x9D" => "\xC4\x9C", "\xC4\x9F" => "\xC4\x9E", - "\xC4\xA1" => "\xC4\xA0", "\xC4\xA3" => "\xC4\xA2", "\xC4\xA5" => "\xC4\xA4", "\xC4\xA7" => "\xC4\xA6", - "\xC4\xA9" => "\xC4\xA8", "\xC4\xAB" => "\xC4\xAA", "\xC4\xAF" => "\xC4\xAE", "\xC4\xB5" => "\xC4\xB4", - "\xC4\xB7" => "\xC4\xB6", "\xC4\xBA" => "\xC4\xB9", "\xC4\xBC" => "\xC4\xBB", "\xC4\xBE" => "\xC4\xBD", - "\xC5\x82" => "\xC5\x81", "\xC5\x84" => "\xC5\x83", "\xC5\x86" => "\xC5\x85", "\xC5\x88" => "\xC5\x87", - "\xC5\x8B" => "\xC5\x8A", "\xC5\x8D" => "\xC5\x8C", "\xC5\x91" => "\xC5\x90", "\xC5\x95" => "\xC5\x94", - "\xC5\x97" => "\xC5\x96", "\xC5\x99" => "\xC5\x98", "\xC5\x9B" => "\xC5\x9A", "\xC5\x9D" => "\xC5\x9C", - "\xC5\x9F" => "\xC5\x9E", "\xC5\xA1" => "\xC5\xA0", "\xC5\xA3" => "\xC5\xA2", "\xC5\xA5" => "\xC5\xA4", - "\xC5\xA7" => "\xC5\xA6", "\xC5\xA9" => "\xC5\xA8", "\xC5\xAB" => "\xC5\xAA", "\xC5\xAD" => "\xC5\xAC", - "\xC5\xAF" => "\xC5\xAE", "\xC5\xB1" => "\xC5\xB0", "\xC5\xB3" => "\xC5\xB2", "\xC5\xB5" => "\xC5\xB4", - "\xC5\xB7" => "\xC5\xB6", "\xC5\xBA" => "\xC5\xB9", "\xC5\xBC" => "\xC5\xBB", "\xC5\xBE" => "\xC5\xBD", - "\xC6\xA1" => "\xC6\xA0", "\xC6\xB0" => "\xC6\xAF", "\xC8\x99" => "\xC8\x98", "\xC8\x9B" => "\xC8\x9A", - "\xCE\xAC" => "\xCE\x86", "\xCE\xAD" => "\xCE\x88", "\xCE\xAE" => "\xCE\x89", "\xCE\xAF" => "\xCE\x8A", - "\xCE\xB1" => "\xCE\x91", "\xCE\xB2" => "\xCE\x92", "\xCE\xB3" => "\xCE\x93", "\xCE\xB4" => "\xCE\x94", - "\xCE\xB5" => "\xCE\x95", "\xCE\xB6" => "\xCE\x96", "\xCE\xB7" => "\xCE\x97", "\xCE\xB8" => "\xCE\x98", - "\xCE\xB9" => "\xCE\x99", "\xCE\xBA" => "\xCE\x9A", "\xCE\xBB" => "\xCE\x9B", "\xCE\xBC" => "\xCE\x9C", - "\xCE\xBD" => "\xCE\x9D", "\xCE\xBE" => "\xCE\x9E", "\xCE\xBF" => "\xCE\x9F", "\xCF\x80" => "\xCE\xA0", - "\xCF\x81" => "\xCE\xA1", "\xCF\x83" => "\xCE\xA3", "\xCF\x84" => "\xCE\xA4", "\xCF\x85" => "\xCE\xA5", - "\xCF\x86" => "\xCE\xA6", "\xCF\x87" => "\xCE\xA7", "\xCF\x88" => "\xCE\xA8", "\xCF\x89" => "\xCE\xA9", - "\xCF\x8A" => "\xCE\xAA", "\xCF\x8B" => "\xCE\xAB", "\xCF\x8C" => "\xCE\x8C", "\xCF\x8D" => "\xCE\x8E", - "\xCF\x8E" => "\xCE\x8F", "\xD0\xB0" => "\xD0\x90", "\xD0\xB1" => "\xD0\x91", "\xD0\xB2" => "\xD0\x92", - "\xD0\xB3" => "\xD0\x93", "\xD0\xB4" => "\xD0\x94", "\xD0\xB5" => "\xD0\x95", "\xD0\xB6" => "\xD0\x96", - "\xD0\xB7" => "\xD0\x97", "\xD0\xB8" => "\xD0\x98", "\xD0\xB9" => "\xD0\x99", "\xD0\xBA" => "\xD0\x9A", - "\xD0\xBB" => "\xD0\x9B", "\xD0\xBC" => "\xD0\x9C", "\xD0\xBD" => "\xD0\x9D", "\xD0\xBE" => "\xD0\x9E", - "\xD0\xBF" => "\xD0\x9F", "\xD1\x80" => "\xD0\xA0", "\xD1\x81" => "\xD0\xA1", "\xD1\x82" => "\xD0\xA2", - "\xD1\x83" => "\xD0\xA3", "\xD1\x84" => "\xD0\xA4", "\xD1\x85" => "\xD0\xA5", "\xD1\x86" => "\xD0\xA6", - "\xD1\x87" => "\xD0\xA7", "\xD1\x88" => "\xD0\xA8", "\xD1\x89" => "\xD0\xA9", "\xD1\x8A" => "\xD0\xAA", - "\xD1\x8B" => "\xD0\xAB", "\xD1\x8C" => "\xD0\xAC", "\xD1\x8D" => "\xD0\xAD", "\xD1\x8E" => "\xD0\xAE", - "\xD1\x8F" => "\xD0\xAF", "\xD1\x91" => "\xD0\x81", "\xD1\x92" => "\xD0\x82", "\xD1\x93" => "\xD0\x83", - "\xD1\x94" => "\xD0\x84", "\xD1\x95" => "\xD0\x85", "\xD1\x96" => "\xD0\x86", "\xD1\x97" => "\xD0\x87", - "\xD1\x98" => "\xD0\x88", "\xD1\x99" => "\xD0\x89", "\xD1\x9A" => "\xD0\x8A", "\xD1\x9B" => "\xD0\x8B", - "\xD1\x9C" => "\xD0\x8C", "\xD1\x9E" => "\xD0\x8E", "\xD1\x9F" => "\xD0\x8F", "\xD2\x91" => "\xD2\x90", - "\xE1\xB8\x83" => "\xE1\xB8\x82", "\xE1\xB8\x8B" => "\xE1\xB8\x8A", "\xE1\xB8\x9F" => "\xE1\xB8\x9E", "\xE1\xB9\x81" => "\xE1\xB9\x80", - "\xE1\xB9\x97" => "\xE1\xB9\x96", "\xE1\xB9\xA1" => "\xE1\xB9\xA0", "\xE1\xB9\xAB" => "\xE1\xB9\xAA", "\xE1\xBA\x81" => "\xE1\xBA\x80", - "\xE1\xBA\x83" => "\xE1\xBA\x82", "\xE1\xBA\x85" => "\xE1\xBA\x84", "\xE1\xBB\xB3" => "\xE1\xBB\xB2" - ); - /** * UTF-8 aware alternative to strtolower * Make a string lowercase @@ -443,9 +338,56 @@ else */ function utf8_strtolower($string) { - global $UTF8_UPPER_TO_LOWER; + static $UTF8_UPPER_TO_LOWER = array( + "\xC3\x80" => "\xC3\xA0", "\xC3\x81" => "\xC3\xA1", + "\xC3\x82" => "\xC3\xA2", "\xC3\x83" => "\xC3\xA3", "\xC3\x84" => "\xC3\xA4", "\xC3\x85" => "\xC3\xA5", + "\xC3\x86" => "\xC3\xA6", "\xC3\x87" => "\xC3\xA7", "\xC3\x88" => "\xC3\xA8", "\xC3\x89" => "\xC3\xA9", + "\xC3\x8A" => "\xC3\xAA", "\xC3\x8B" => "\xC3\xAB", "\xC3\x8C" => "\xC3\xAC", "\xC3\x8D" => "\xC3\xAD", + "\xC3\x8E" => "\xC3\xAE", "\xC3\x8F" => "\xC3\xAF", "\xC3\x90" => "\xC3\xB0", "\xC3\x91" => "\xC3\xB1", + "\xC3\x92" => "\xC3\xB2", "\xC3\x93" => "\xC3\xB3", "\xC3\x94" => "\xC3\xB4", "\xC3\x95" => "\xC3\xB5", + "\xC3\x96" => "\xC3\xB6", "\xC3\x98" => "\xC3\xB8", "\xC3\x99" => "\xC3\xB9", "\xC3\x9A" => "\xC3\xBA", + "\xC3\x9B" => "\xC3\xBB", "\xC3\x9C" => "\xC3\xBC", "\xC3\x9D" => "\xC3\xBD", "\xC3\x9E" => "\xC3\xBE", + "\xC4\x80" => "\xC4\x81", "\xC4\x82" => "\xC4\x83", "\xC4\x84" => "\xC4\x85", "\xC4\x86" => "\xC4\x87", + "\xC4\x88" => "\xC4\x89", "\xC4\x8A" => "\xC4\x8B", "\xC4\x8C" => "\xC4\x8D", "\xC4\x8E" => "\xC4\x8F", + "\xC4\x90" => "\xC4\x91", "\xC4\x92" => "\xC4\x93", "\xC4\x96" => "\xC4\x97", "\xC4\x98" => "\xC4\x99", + "\xC4\x9A" => "\xC4\x9B", "\xC4\x9C" => "\xC4\x9D", "\xC4\x9E" => "\xC4\x9F", "\xC4\xA0" => "\xC4\xA1", + "\xC4\xA2" => "\xC4\xA3", "\xC4\xA4" => "\xC4\xA5", "\xC4\xA6" => "\xC4\xA7", "\xC4\xA8" => "\xC4\xA9", + "\xC4\xAA" => "\xC4\xAB", "\xC4\xAE" => "\xC4\xAF", "\xC4\xB4" => "\xC4\xB5", "\xC4\xB6" => "\xC4\xB7", + "\xC4\xB9" => "\xC4\xBA", "\xC4\xBB" => "\xC4\xBC", "\xC4\xBD" => "\xC4\xBE", "\xC5\x81" => "\xC5\x82", + "\xC5\x83" => "\xC5\x84", "\xC5\x85" => "\xC5\x86", "\xC5\x87" => "\xC5\x88", "\xC5\x8A" => "\xC5\x8B", + "\xC5\x8C" => "\xC5\x8D", "\xC5\x90" => "\xC5\x91", "\xC5\x94" => "\xC5\x95", "\xC5\x96" => "\xC5\x97", + "\xC5\x98" => "\xC5\x99", "\xC5\x9A" => "\xC5\x9B", "\xC5\x9C" => "\xC5\x9D", "\xC5\x9E" => "\xC5\x9F", + "\xC5\xA0" => "\xC5\xA1", "\xC5\xA2" => "\xC5\xA3", "\xC5\xA4" => "\xC5\xA5", "\xC5\xA6" => "\xC5\xA7", + "\xC5\xA8" => "\xC5\xA9", "\xC5\xAA" => "\xC5\xAB", "\xC5\xAC" => "\xC5\xAD", "\xC5\xAE" => "\xC5\xAF", + "\xC5\xB0" => "\xC5\xB1", "\xC5\xB2" => "\xC5\xB3", "\xC5\xB4" => "\xC5\xB5", "\xC5\xB6" => "\xC5\xB7", + "\xC5\xB8" => "\xC3\xBF", "\xC5\xB9" => "\xC5\xBA", "\xC5\xBB" => "\xC5\xBC", "\xC5\xBD" => "\xC5\xBE", + "\xC6\xA0" => "\xC6\xA1", "\xC6\xAF" => "\xC6\xB0", "\xC8\x98" => "\xC8\x99", "\xC8\x9A" => "\xC8\x9B", + "\xCE\x86" => "\xCE\xAC", "\xCE\x88" => "\xCE\xAD", "\xCE\x89" => "\xCE\xAE", "\xCE\x8A" => "\xCE\xAF", + "\xCE\x8C" => "\xCF\x8C", "\xCE\x8E" => "\xCF\x8D", "\xCE\x8F" => "\xCF\x8E", "\xCE\x91" => "\xCE\xB1", + "\xCE\x92" => "\xCE\xB2", "\xCE\x93" => "\xCE\xB3", "\xCE\x94" => "\xCE\xB4", "\xCE\x95" => "\xCE\xB5", + "\xCE\x96" => "\xCE\xB6", "\xCE\x97" => "\xCE\xB7", "\xCE\x98" => "\xCE\xB8", "\xCE\x99" => "\xCE\xB9", + "\xCE\x9A" => "\xCE\xBA", "\xCE\x9B" => "\xCE\xBB", "\xCE\x9C" => "\xCE\xBC", "\xCE\x9D" => "\xCE\xBD", + "\xCE\x9E" => "\xCE\xBE", "\xCE\x9F" => "\xCE\xBF", "\xCE\xA0" => "\xCF\x80", "\xCE\xA1" => "\xCF\x81", + "\xCE\xA3" => "\xCF\x83", "\xCE\xA4" => "\xCF\x84", "\xCE\xA5" => "\xCF\x85", "\xCE\xA6" => "\xCF\x86", + "\xCE\xA7" => "\xCF\x87", "\xCE\xA8" => "\xCF\x88", "\xCE\xA9" => "\xCF\x89", "\xCE\xAA" => "\xCF\x8A", + "\xCE\xAB" => "\xCF\x8B", "\xD0\x81" => "\xD1\x91", "\xD0\x82" => "\xD1\x92", "\xD0\x83" => "\xD1\x93", + "\xD0\x84" => "\xD1\x94", "\xD0\x85" => "\xD1\x95", "\xD0\x86" => "\xD1\x96", "\xD0\x87" => "\xD1\x97", + "\xD0\x88" => "\xD1\x98", "\xD0\x89" => "\xD1\x99", "\xD0\x8A" => "\xD1\x9A", "\xD0\x8B" => "\xD1\x9B", + "\xD0\x8C" => "\xD1\x9C", "\xD0\x8E" => "\xD1\x9E", "\xD0\x8F" => "\xD1\x9F", "\xD0\x90" => "\xD0\xB0", + "\xD0\x91" => "\xD0\xB1", "\xD0\x92" => "\xD0\xB2", "\xD0\x93" => "\xD0\xB3", "\xD0\x94" => "\xD0\xB4", + "\xD0\x95" => "\xD0\xB5", "\xD0\x96" => "\xD0\xB6", "\xD0\x97" => "\xD0\xB7", "\xD0\x98" => "\xD0\xB8", + "\xD0\x99" => "\xD0\xB9", "\xD0\x9A" => "\xD0\xBA", "\xD0\x9B" => "\xD0\xBB", "\xD0\x9C" => "\xD0\xBC", + "\xD0\x9D" => "\xD0\xBD", "\xD0\x9E" => "\xD0\xBE", "\xD0\x9F" => "\xD0\xBF", "\xD0\xA0" => "\xD1\x80", + "\xD0\xA1" => "\xD1\x81", "\xD0\xA2" => "\xD1\x82", "\xD0\xA3" => "\xD1\x83", "\xD0\xA4" => "\xD1\x84", + "\xD0\xA5" => "\xD1\x85", "\xD0\xA6" => "\xD1\x86", "\xD0\xA7" => "\xD1\x87", "\xD0\xA8" => "\xD1\x88", + "\xD0\xA9" => "\xD1\x89", "\xD0\xAA" => "\xD1\x8A", "\xD0\xAB" => "\xD1\x8B", "\xD0\xAC" => "\xD1\x8C", + "\xD0\xAD" => "\xD1\x8D", "\xD0\xAE" => "\xD1\x8E", "\xD0\xAF" => "\xD1\x8F", "\xD2\x90" => "\xD2\x91", + "\xE1\xB8\x82" => "\xE1\xB8\x83", "\xE1\xB8\x8A" => "\xE1\xB8\x8B", "\xE1\xB8\x9E" => "\xE1\xB8\x9F", "\xE1\xB9\x80" => "\xE1\xB9\x81", + "\xE1\xB9\x96" => "\xE1\xB9\x97", "\xE1\xB9\xA0" => "\xE1\xB9\xA1", "\xE1\xB9\xAA" => "\xE1\xB9\xAB", "\xE1\xBA\x80" => "\xE1\xBA\x81", + "\xE1\xBA\x82" => "\xE1\xBA\x83", "\xE1\xBA\x84" => "\xE1\xBA\x85", "\xE1\xBB\xB2" => "\xE1\xBB\xB3" + ); - return strtr($string, $UTF8_UPPER_TO_LOWER); + return strtr(strtolower($string), $UTF8_UPPER_TO_LOWER); } /** @@ -461,9 +403,56 @@ else */ function utf8_strtoupper($string) { - global $UTF8_LOWER_TO_UPPER; + static $UTF8_LOWER_TO_UPPER = array( + "\xC3\xA0" => "\xC3\x80", "\xC3\xA1" => "\xC3\x81", + "\xC3\xA2" => "\xC3\x82", "\xC3\xA3" => "\xC3\x83", "\xC3\xA4" => "\xC3\x84", "\xC3\xA5" => "\xC3\x85", + "\xC3\xA6" => "\xC3\x86", "\xC3\xA7" => "\xC3\x87", "\xC3\xA8" => "\xC3\x88", "\xC3\xA9" => "\xC3\x89", + "\xC3\xAA" => "\xC3\x8A", "\xC3\xAB" => "\xC3\x8B", "\xC3\xAC" => "\xC3\x8C", "\xC3\xAD" => "\xC3\x8D", + "\xC3\xAE" => "\xC3\x8E", "\xC3\xAF" => "\xC3\x8F", "\xC3\xB0" => "\xC3\x90", "\xC3\xB1" => "\xC3\x91", + "\xC3\xB2" => "\xC3\x92", "\xC3\xB3" => "\xC3\x93", "\xC3\xB4" => "\xC3\x94", "\xC3\xB5" => "\xC3\x95", + "\xC3\xB6" => "\xC3\x96", "\xC3\xB8" => "\xC3\x98", "\xC3\xB9" => "\xC3\x99", "\xC3\xBA" => "\xC3\x9A", + "\xC3\xBB" => "\xC3\x9B", "\xC3\xBC" => "\xC3\x9C", "\xC3\xBD" => "\xC3\x9D", "\xC3\xBE" => "\xC3\x9E", + "\xC3\xBF" => "\xC5\xB8", "\xC4\x81" => "\xC4\x80", "\xC4\x83" => "\xC4\x82", "\xC4\x85" => "\xC4\x84", + "\xC4\x87" => "\xC4\x86", "\xC4\x89" => "\xC4\x88", "\xC4\x8B" => "\xC4\x8A", "\xC4\x8D" => "\xC4\x8C", + "\xC4\x8F" => "\xC4\x8E", "\xC4\x91" => "\xC4\x90", "\xC4\x93" => "\xC4\x92", "\xC4\x97" => "\xC4\x96", + "\xC4\x99" => "\xC4\x98", "\xC4\x9B" => "\xC4\x9A", "\xC4\x9D" => "\xC4\x9C", "\xC4\x9F" => "\xC4\x9E", + "\xC4\xA1" => "\xC4\xA0", "\xC4\xA3" => "\xC4\xA2", "\xC4\xA5" => "\xC4\xA4", "\xC4\xA7" => "\xC4\xA6", + "\xC4\xA9" => "\xC4\xA8", "\xC4\xAB" => "\xC4\xAA", "\xC4\xAF" => "\xC4\xAE", "\xC4\xB5" => "\xC4\xB4", + "\xC4\xB7" => "\xC4\xB6", "\xC4\xBA" => "\xC4\xB9", "\xC4\xBC" => "\xC4\xBB", "\xC4\xBE" => "\xC4\xBD", + "\xC5\x82" => "\xC5\x81", "\xC5\x84" => "\xC5\x83", "\xC5\x86" => "\xC5\x85", "\xC5\x88" => "\xC5\x87", + "\xC5\x8B" => "\xC5\x8A", "\xC5\x8D" => "\xC5\x8C", "\xC5\x91" => "\xC5\x90", "\xC5\x95" => "\xC5\x94", + "\xC5\x97" => "\xC5\x96", "\xC5\x99" => "\xC5\x98", "\xC5\x9B" => "\xC5\x9A", "\xC5\x9D" => "\xC5\x9C", + "\xC5\x9F" => "\xC5\x9E", "\xC5\xA1" => "\xC5\xA0", "\xC5\xA3" => "\xC5\xA2", "\xC5\xA5" => "\xC5\xA4", + "\xC5\xA7" => "\xC5\xA6", "\xC5\xA9" => "\xC5\xA8", "\xC5\xAB" => "\xC5\xAA", "\xC5\xAD" => "\xC5\xAC", + "\xC5\xAF" => "\xC5\xAE", "\xC5\xB1" => "\xC5\xB0", "\xC5\xB3" => "\xC5\xB2", "\xC5\xB5" => "\xC5\xB4", + "\xC5\xB7" => "\xC5\xB6", "\xC5\xBA" => "\xC5\xB9", "\xC5\xBC" => "\xC5\xBB", "\xC5\xBE" => "\xC5\xBD", + "\xC6\xA1" => "\xC6\xA0", "\xC6\xB0" => "\xC6\xAF", "\xC8\x99" => "\xC8\x98", "\xC8\x9B" => "\xC8\x9A", + "\xCE\xAC" => "\xCE\x86", "\xCE\xAD" => "\xCE\x88", "\xCE\xAE" => "\xCE\x89", "\xCE\xAF" => "\xCE\x8A", + "\xCE\xB1" => "\xCE\x91", "\xCE\xB2" => "\xCE\x92", "\xCE\xB3" => "\xCE\x93", "\xCE\xB4" => "\xCE\x94", + "\xCE\xB5" => "\xCE\x95", "\xCE\xB6" => "\xCE\x96", "\xCE\xB7" => "\xCE\x97", "\xCE\xB8" => "\xCE\x98", + "\xCE\xB9" => "\xCE\x99", "\xCE\xBA" => "\xCE\x9A", "\xCE\xBB" => "\xCE\x9B", "\xCE\xBC" => "\xCE\x9C", + "\xCE\xBD" => "\xCE\x9D", "\xCE\xBE" => "\xCE\x9E", "\xCE\xBF" => "\xCE\x9F", "\xCF\x80" => "\xCE\xA0", + "\xCF\x81" => "\xCE\xA1", "\xCF\x83" => "\xCE\xA3", "\xCF\x84" => "\xCE\xA4", "\xCF\x85" => "\xCE\xA5", + "\xCF\x86" => "\xCE\xA6", "\xCF\x87" => "\xCE\xA7", "\xCF\x88" => "\xCE\xA8", "\xCF\x89" => "\xCE\xA9", + "\xCF\x8A" => "\xCE\xAA", "\xCF\x8B" => "\xCE\xAB", "\xCF\x8C" => "\xCE\x8C", "\xCF\x8D" => "\xCE\x8E", + "\xCF\x8E" => "\xCE\x8F", "\xD0\xB0" => "\xD0\x90", "\xD0\xB1" => "\xD0\x91", "\xD0\xB2" => "\xD0\x92", + "\xD0\xB3" => "\xD0\x93", "\xD0\xB4" => "\xD0\x94", "\xD0\xB5" => "\xD0\x95", "\xD0\xB6" => "\xD0\x96", + "\xD0\xB7" => "\xD0\x97", "\xD0\xB8" => "\xD0\x98", "\xD0\xB9" => "\xD0\x99", "\xD0\xBA" => "\xD0\x9A", + "\xD0\xBB" => "\xD0\x9B", "\xD0\xBC" => "\xD0\x9C", "\xD0\xBD" => "\xD0\x9D", "\xD0\xBE" => "\xD0\x9E", + "\xD0\xBF" => "\xD0\x9F", "\xD1\x80" => "\xD0\xA0", "\xD1\x81" => "\xD0\xA1", "\xD1\x82" => "\xD0\xA2", + "\xD1\x83" => "\xD0\xA3", "\xD1\x84" => "\xD0\xA4", "\xD1\x85" => "\xD0\xA5", "\xD1\x86" => "\xD0\xA6", + "\xD1\x87" => "\xD0\xA7", "\xD1\x88" => "\xD0\xA8", "\xD1\x89" => "\xD0\xA9", "\xD1\x8A" => "\xD0\xAA", + "\xD1\x8B" => "\xD0\xAB", "\xD1\x8C" => "\xD0\xAC", "\xD1\x8D" => "\xD0\xAD", "\xD1\x8E" => "\xD0\xAE", + "\xD1\x8F" => "\xD0\xAF", "\xD1\x91" => "\xD0\x81", "\xD1\x92" => "\xD0\x82", "\xD1\x93" => "\xD0\x83", + "\xD1\x94" => "\xD0\x84", "\xD1\x95" => "\xD0\x85", "\xD1\x96" => "\xD0\x86", "\xD1\x97" => "\xD0\x87", + "\xD1\x98" => "\xD0\x88", "\xD1\x99" => "\xD0\x89", "\xD1\x9A" => "\xD0\x8A", "\xD1\x9B" => "\xD0\x8B", + "\xD1\x9C" => "\xD0\x8C", "\xD1\x9E" => "\xD0\x8E", "\xD1\x9F" => "\xD0\x8F", "\xD2\x91" => "\xD2\x90", + "\xE1\xB8\x83" => "\xE1\xB8\x82", "\xE1\xB8\x8B" => "\xE1\xB8\x8A", "\xE1\xB8\x9F" => "\xE1\xB8\x9E", "\xE1\xB9\x81" => "\xE1\xB9\x80", + "\xE1\xB9\x97" => "\xE1\xB9\x96", "\xE1\xB9\xA1" => "\xE1\xB9\xA0", "\xE1\xB9\xAB" => "\xE1\xB9\xAA", "\xE1\xBA\x81" => "\xE1\xBA\x80", + "\xE1\xBA\x83" => "\xE1\xBA\x82", "\xE1\xBA\x85" => "\xE1\xBA\x84", "\xE1\xBB\xB3" => "\xE1\xBB\xB2" + ); - return strtr($string, $UTF8_LOWER_TO_UPPER); + return strtr(strtoupper($string), $UTF8_LOWER_TO_UPPER); } /** diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 0b4f94a5c2..e88e13a05e 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -206,6 +206,64 @@ class install_install extends module 'S_LEGEND' => false, )); + $passed['mbstring'] = true; + if (extension_loaded('mbstring')) + { + // Test for available database modules + $template->assign_block_vars('checks', array( + 'S_LEGEND' => true, + 'S_FIRST_ROW' => false, + 'LEGEND' => $lang['MBSTRING_CHECK'], + 'LEGEND_EXPLAIN' => $lang['MBSTRING_CHECK_EXPLAIN'], + )); + + $checks = array( + array('func_overload', '&', MB_OVERLOAD_MAIL|MB_OVERLOAD_STRING), + array('encoding_translation', '!=', 0), + array('http_input', '!=', 'pass'), + array('http_output', '!=', 'pass') + ); + + foreach ($checks as $mb_checks) + { + $ini_val = ini_get('mbstring.' . $mb_checks[0]); + switch ($mb_checks[1]) + { + case '&': + if (intval($ini_val) & $mb_checks[2]) + { + $result = '' . $lang['NO'] . ''; + $passed['mbstring'] = false; + } + else + { + $result = '' . $lang['YES'] . ''; + } + break; + + case '!=': + if ($ini_val != $mb_checks[2]) + { + $result = '' . $lang['NO'] . ''; + $passed['mbstring'] = false; + } + else + { + $result = '' . $lang['YES'] . ''; + } + break; + } + $template->assign_block_vars('checks', array( + 'TITLE' => $lang['MBSTRING_' . strtoupper($mb_checks[0])], + 'TITLE_EXPLAIN' => $lang['MBSTRING_' . strtoupper($mb_checks[0]) . '_EXPLAIN'], + 'RESULT' => $result, + + 'S_EXPLAIN' => true, + 'S_LEGEND' => false, + )); + } + } + // Test for available database modules $template->assign_block_vars('checks', array( 'S_LEGEND' => true, @@ -415,8 +473,8 @@ class install_install extends module // And finally where do we want to go next (well today is taken isn't it :P) $s_hidden_fields = ($img_imagick) ? '' : ''; - $url = ($passed['php'] && $passed['db'] && $passed['files'] && $passed['pcre']) ? $this->p_master->module_url . "?mode=$mode&sub=database&language=$language" : $this->p_master->module_url . "?mode=$mode&sub=requirements&language=$language "; - $submit = ($passed['php'] && $passed['db'] && $passed['files'] && $passed['pcre']) ? $lang['INSTALL_START'] : $lang['INSTALL_TEST']; + $url = ($passed['php'] && $passed['db'] && $passed['files'] && $passed['pcre'] && $passed['mbstring']) ? $this->p_master->module_url . "?mode=$mode&sub=database&language=$language" : $this->p_master->module_url . "?mode=$mode&sub=requirements&language=$language "; + $submit = ($passed['php'] && $passed['db'] && $passed['files'] && $passed['pcre'] && $passed['mbstring']) ? $lang['INSTALL_START'] : $lang['INSTALL_TEST']; $template->assign_vars(array( diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 1568409b76..f9371a503c 100755 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -209,6 +209,18 @@ $lang = array_merge($lang, array( 'INST_ERR_USER_TOO_SHORT' => 'The username you entered is too short. The minimum length is 3 characters.', 'INVALID_PRIMARY_KEY' => 'Invalid primary key : %s', + // mbstring + 'MBSTRING_CHECK' => 'mbstring Extension Check', + 'MBSTRING_CHECK_EXPLAIN' => 'mbstring is a PHP extension that provides multibyte string functions. Certain features of mbstring are not compatible with phpBB and must be disabled', + 'MBSTRING_FUNC_OVERLOAD' => 'Function overloading', + 'MBSTRING_FUNC_OVERLOAD_EXPLAIN' => 'mbstring.func_overload must be set to either 0 or 4', + 'MBSTRING_ENCODING_TRANSLATION' => 'Transparent character encoding', + 'MBSTRING_ENCODING_TRANSLATION_EXPLAIN' => 'mbstring.encoding_translation must be set to either 0', + 'MBSTRING_HTTP_INPUT' => 'HTTP input character conversion', + 'MBSTRING_HTTP_INPUT_EXPLAIN' => 'mbstring.http_input must be set to pass', + 'MBSTRING_HTTP_OUTPUT' => 'HTTP output character conversion', + 'MBSTRING_HTTP_OUTPUT_EXPLAIN' => 'mbstring.http_output must be set to pass', + 'MAKE_FOLDER_WRITABLE' => 'Please make sure that this folder exists and is writable by the webserver then try again:
»%s', 'MAKE_FOLDERS_WRITABLE' => 'Please make sure that these folders exist and are writable by the webserver then try again:
»%s', From 2b4525ae97dc0ab6d7d9391fe4c126bdf7d15dbb Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 3 Dec 2006 16:12:03 +0000 Subject: [PATCH 022/264] some tiny bugfixes. git-svn-id: file:///svn/phpbb/trunk@6702 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_board.php | 13 +++++++- phpBB/includes/acp/acp_styles.php | 2 +- phpBB/includes/functions.php | 2 +- phpBB/includes/functions_privmsgs.php | 2 +- phpBB/install/install_update.php | 30 +++++++++++++++---- .../subSilver/template/overall_header.html | 2 +- 6 files changed, 40 insertions(+), 11 deletions(-) diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index a04ad9dc0f..92f8057676 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -735,7 +735,14 @@ class acp_board */ function dateformat_select($value, $key) { - global $user; + global $user, $config; + + // Let the format_date function operate with the acp values + $old_tz = $user->timezone; + $old_dst = $user->dst; + + $user->timezone = $config['board_timezone']; + $user->dst = $config['board_dst']; $dateformat_options = ''; @@ -753,6 +760,10 @@ class acp_board } $dateformat_options .= '>' . $user->lang['CUSTOM_DATEFORMAT'] . ''; + // Reset users date options + $user->timezone = $old_tz; + $user->dst = $old_dst; + return " "; } diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index c4c1c85793..a1937b592f 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -262,7 +262,7 @@ pagination_sep = \'{PAGINATION_SEP}\' } else { - $filelist[substr($row['template_filename'], 0, $slash_pos + 1)] = substr($row['template_filename'], $slash_pos + 1, strlen($row['template_filename']) - $slashpos - 1); + $filelist[substr($row['template_filename'], 0, $slash_pos + 1)] = substr($row['template_filename'], $slash_pos + 1, strlen($row['template_filename']) - $slash_pos - 1); } } } diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 43d6b862ff..e975469685 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3363,7 +3363,7 @@ function page_header($page_title = '', $display_online_list = true) 'U_RESTORE_PERMISSIONS' => ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm') : '', 'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS) ? true : false, - 'S_BOARD_DISABLED' => ($config['board_disable'] && !defined('IN_LOGIN') && !$auth->acl_gets('a_', 'm_')) ? true : false, + 'S_BOARD_DISABLED' => ($config['board_disable']) ? true : false, 'S_REGISTERED_USER' => $user->data['is_registered'], 'S_IS_BOT' => $user->data['is_bot'], 'S_USER_PM_POPUP' => $user->optionget('popuppm'), diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index d67478b190..0fcc42def1 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1242,7 +1242,7 @@ function get_folder_status($folder_id, $folder) */ function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = true) { - global $db, $auth, $config, $phpEx, $template, $user; + global $db, $auth, $config, $phpEx, $template, $user, $phpbb_root_path; // We do not handle erasing pms here if ($mode == 'delete') diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index c57aff8ed8..fb022a5822 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -12,6 +12,7 @@ * @todo check memory by setting limit to 8MB locally. * @todo make sure binary files get updated too, omitting the diff engine for this (handle like a conflict) * @todo do not require login... +* @todo check for writeable cache/store/files directory */ /** @@ -113,9 +114,9 @@ class install_update extends module $user->setup('install'); // Include renderer and engine - include_once($phpbb_root_path . 'includes/diff/diff.' . $phpEx); - include_once($phpbb_root_path . 'includes/diff/engine.' . $phpEx); - include_once($phpbb_root_path . 'includes/diff/renderer.' . $phpEx); + $this->include_file('includes/diff/diff.' . $phpEx); + $this->include_file('includes/diff/engine.' . $phpEx); + $this->include_file('includes/diff/renderer.' . $phpEx); // If we are within the intro page we need to make sure we get up-to-date version info if ($sub == 'intro') @@ -187,7 +188,7 @@ class install_update extends module if (in_array('language/en/install.php', $this->update_info['files'])) { $lang = array(); - include('./update/new/language/en/install.php'); + include($this->new_location . 'language/en/install.php'); $user->lang = array_merge($user->lang, $lang); } @@ -349,7 +350,7 @@ class install_update extends module if (!empty($_POST['download'])) { - include_once($phpbb_root_path . 'includes/functions_compress.' . $phpEx); + $this->include_file('includes/functions_compress.' . $phpEx); $use_method = request_var('use_method', ''); $methods = array('.tar'); @@ -419,7 +420,7 @@ class install_update extends module } else { - include_once($phpbb_root_path . 'includes/functions_transfer.' . $phpEx); + $this->include_file('includes/functions_transfer.' . $phpEx); // Choose FTP, if not available use fsock... $method = request_var('method', ''); @@ -1147,6 +1148,23 @@ class install_update extends module return $info; } + + /** + * Function for including files... + */ + function include_file($filename) + { + global $phpbb_root_path; + + if (!empty($this->update_info['files']) && in_array($filename, $this->update_info['files'])) + { + include_once($this->new_location . $filename); + } + else + { + include_once($phpbb_root_path . $filename); + } + } } ?> \ No newline at end of file diff --git a/phpBB/styles/subSilver/template/overall_header.html b/phpBB/styles/subSilver/template/overall_header.html index 22833f0ab2..092d85aac1 100644 --- a/phpBB/styles/subSilver/template/overall_header.html +++ b/phpBB/styles/subSilver/template/overall_header.html @@ -148,7 +148,7 @@ function marklist(id, name, state)
#s', '', $output); $output = preg_replace('#]+>#i', '
{items.CODE} {items.EMOTION} - - {ICON_MOVE_UP_DISABLED} - {ICON_MOVE_DOWN} - - {ICON_MOVE_UP} - {ICON_MOVE_DOWN} - - {ICON_MOVE_UP} - {ICON_MOVE_DOWN_DISABLED} - - {ICON_EDIT} - {ICON_DELETE} + + {ICON_MOVE_UP_DISABLED}{ICON_MOVE_UP}  + {ICON_MOVE_DOWN_DISABLED}{ICON_MOVE_DOWN} +  {ICON_EDIT} {ICON_DELETE}
{L_SELECT_USER}
{L_FIND_USERNAME}:
[ {L_FIND_USERNAME} ]
{L_FIND_USERNAME}:
[ {L_FIND_USERNAME} ]
{L_CHANGE_POSTER}
[ {L_FIND_USERNAME} ]

[ {L_FIND_USERNAME} ]
{L_SELECT_USER}
{L_FIND_USERNAME}:
[ {L_FIND_USERNAME} ]
{L_FIND_USERNAME}:
[ {L_FIND_USERNAME} ]
{L_NO_FOES}
{L_ADD_FOES}:
{L_ADD_FOES_EXPLAIN} [ {L_FIND_USERNAME} ]
{L_ADD_FOES}:
{L_ADD_FOES_EXPLAIN} [ {L_FIND_USERNAME} ]

{L_NO_FRIENDS}
{L_ADD_FRIENDS}:
{L_ADD_FRIENDS_EXPLAIN} [ {L_FIND_USERNAME} ]
{L_ADD_FRIENDS}:
{L_ADD_FRIENDS_EXPLAIN} [ {L_FIND_USERNAME} ]

{L_LOGIN_LOGOUT} {L_LOGIN_LOGOUT}   {L_RESTORE_PERMISSIONS} {L_RESTORE_PERMISSIONS} -  {L_BOARD_DISABLED} +  {L_BOARD_DISABLED}  {L_PRIVATE_MESSAGES} {PRIVATE_MESSAGE_INFO}, {PRIVATE_MESSAGE_INFO_UNREAD}  {L_REGISTER} {L_REGISTER} From d63ccbe8ac2a5c9adeff58b446a730cbca48c4e8 Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 3 Dec 2006 16:33:32 +0000 Subject: [PATCH 023/264] - FreeTDS builds lets you specify a character set encoding, lets take advantage of that git-svn-id: file:///svn/phpbb/trunk@6703 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/db/mssql.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php index 439cb725fb..037cef81bf 100644 --- a/phpBB/includes/db/mssql.php +++ b/phpBB/includes/db/mssql.php @@ -46,6 +46,11 @@ class dbal_mssql extends dbal } } + if (ini_get('mssql.charset')) + { + ini_set('mssql.charset', 'UTF-8'); + } + return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error(''); } From 1f7224c6019be5871f8385c6bb4403fd6ea28563 Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 3 Dec 2006 16:43:18 +0000 Subject: [PATCH 024/264] only works if you do it _before_ the connect :P git-svn-id: file:///svn/phpbb/trunk@6704 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/db/mssql.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php index 037cef81bf..42ddb1a17a 100644 --- a/phpBB/includes/db/mssql.php +++ b/phpBB/includes/db/mssql.php @@ -35,6 +35,11 @@ class dbal_mssql extends dbal $this->server = $sqlserver . (($port) ? ':' . $port : ''); $this->dbname = $database; + if (ini_get('mssql.charset')) + { + ini_set('mssql.charset', 'UTF-8'); + } + $this->db_connect_id = ($this->persistency) ? @mssql_pconnect($this->server, $this->user, $sqlpassword) : @mssql_connect($this->server, $this->user, $sqlpassword); if ($this->db_connect_id && $this->dbname != '') @@ -46,11 +51,6 @@ class dbal_mssql extends dbal } } - if (ini_get('mssql.charset')) - { - ini_set('mssql.charset', 'UTF-8'); - } - return ($this->db_connect_id) ? $this->db_connect_id : $this->sql_error(''); } From ec80eb74aa5874f8790c3435bf4dd9fdf9614c6f Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 3 Dec 2006 17:36:59 +0000 Subject: [PATCH 025/264] #5734 - replaced array_rand($array) with mt_rand(0, sizeof($array) - 1) as array_rand did not take my seed git-svn-id: file:///svn/phpbb/trunk@6705 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/develop/create_schema_files.php | 1 + phpBB/includes/captcha/captcha_gd.php | 9 ++++-- phpBB/includes/captcha/captcha_non_gd.php | 7 ++--- phpBB/includes/functions.php | 4 ++- phpBB/includes/ucp/ucp_confirm.php | 4 +-- phpBB/includes/ucp/ucp_register.php | 4 ++- phpBB/install/database_update.php | 36 ++++++++++++++++++++++- phpBB/install/schemas/firebird_schema.sql | 3 +- phpBB/install/schemas/mssql_schema.sql | 3 +- phpBB/install/schemas/mysql_40_schema.sql | 1 + phpBB/install/schemas/mysql_41_schema.sql | 1 + phpBB/install/schemas/oracle_schema.sql | 1 + phpBB/install/schemas/postgres_schema.sql | 1 + phpBB/install/schemas/sqlite_schema.sql | 1 + phpBB/posting.php | 4 ++- 15 files changed, 65 insertions(+), 15 deletions(-) diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 60324d94a8..cc657f7829 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -949,6 +949,7 @@ function get_schema_struct() 'session_id' => array('CHAR:32', ''), 'confirm_type' => array('TINT:3', 0), 'code' => array('VCHAR:8', ''), + 'seed' => array('UINT:10', 0), ), 'PRIMARY_KEY' => array('session_id', 'confirm_id'), 'KEYS' => array( diff --git a/phpBB/includes/captcha/captcha_gd.php b/phpBB/includes/captcha/captcha_gd.php index 3d64cb1c26..c513c45fe7 100644 --- a/phpBB/includes/captcha/captcha_gd.php +++ b/phpBB/includes/captcha/captcha_gd.php @@ -19,7 +19,7 @@ class captcha var $width = 360; var $height = 96; - function execute($code) + function execute($code, $seed) { global $config; $stats = gd_info(); @@ -48,6 +48,9 @@ class captcha imageantialias($image, true); } + // seed the random generator + mt_srand($seed); + // set background color $back = imagecolorallocate($image, mt_rand(224, 255), mt_rand(224, 255), mt_rand(224, 255)); imagefilledrectangle($image, 0, 0, $this->width, $this->height, $back); @@ -79,7 +82,7 @@ class captcha $x = mt_rand(0, 360); $y = mt_rand(0, (int)($this->height - ($size / 5))); $color = $func2($image, mt_rand(160, 224), mt_rand(160, 224), mt_rand(160, 224)); - $text = $chars_allowed[array_rand($chars_allowed)]; + $text = $chars_allowed[mt_rand(0, sizeof($chars_allowed) - 1)]; imagettftext($image, $size, $angle, $x, $y, $color, $this->get_font(), $text); } unset($chars_allowed); @@ -145,7 +148,7 @@ class captcha closedir($dr); } - return $fonts[array_rand($fonts)]; + return $fonts[mt_rand(0, sizeof($fonts) - 1)]; } } diff --git a/phpBB/includes/captcha/captcha_non_gd.php b/phpBB/includes/captcha/captcha_non_gd.php index 41bd22868e..bb4e5af443 100644 --- a/phpBB/includes/captcha/captcha_non_gd.php +++ b/phpBB/includes/captcha/captcha_non_gd.php @@ -30,15 +30,14 @@ class captcha } /** - * Create the image containing $code + * Create the image containing $code with a seed of $seed */ - function execute($code) + function execute($code, $seed) { $img_height = $this->height - 10; $img_width = 0; - list($usec, $sec) = explode(' ', microtime()); - mt_srand($sec * $usec); + mt_srand($seed); $char_widths = $hold_chars = array(); $code_len = strlen($code); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index e975469685..6f5ff42ac2 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1903,12 +1903,14 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa // Generate code $code = gen_rand_string(mt_rand(5, 8)); $confirm_id = md5(unique_id($user->ip)); + $seed = hexdec(substr(unique_id(), 4, 10)); $sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'confirm_id' => (string) $confirm_id, 'session_id' => (string) $user->session_id, 'confirm_type' => (int) CONFIRM_LOGIN, - 'code' => (string) $code) + 'code' => (string) $code, + 'seed' => (int) $seed) ); $db->sql_query($sql); diff --git a/phpBB/includes/ucp/ucp_confirm.php b/phpBB/includes/ucp/ucp_confirm.php index 087a186fa7..e971dbb3ae 100644 --- a/phpBB/includes/ucp/ucp_confirm.php +++ b/phpBB/includes/ucp/ucp_confirm.php @@ -39,7 +39,7 @@ class ucp_confirm } // Try and grab code for this id and session - $sql = 'SELECT code + $sql = 'SELECT code, seed FROM ' . CONFIRM_TABLE . " WHERE session_id = '" . $db->sql_escape($user->session_id) . "' AND confirm_id = '" . $db->sql_escape($confirm_id) . "' @@ -64,7 +64,7 @@ class ucp_confirm } $captcha = new captcha(); - $captcha->execute($row['code']); + $captcha->execute($row['code'], $row['seed']); exit; } } diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 2e355fe3c2..d78ea09806 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -441,12 +441,14 @@ class ucp_register $code = gen_rand_string(mt_rand(5, 8)); $confirm_id = md5(unique_id($user->ip)); + $seed = hexdec(substr(unique_id(), 4, 10)); $sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'confirm_id' => (string) $confirm_id, 'session_id' => (string) $user->session_id, 'confirm_type' => (int) CONFIRM_REG, - 'code' => (string) $code) + 'code' => (string) $code, + 'seed' => (int) $seed) ); $db->sql_query($sql); } diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 011e7bfa35..fa691d9119 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -196,6 +196,33 @@ $dbms_type_map = array( 'VARBINARY' => '[varchar] (255)', ), + 'db2' => array( + 'INT:' => 'integer', + 'BINT' => 'float', + 'UINT' => 'integer', + 'UINT:' => 'integer', + 'TINT:' => 'smallint', + 'USINT' => 'smallint', + 'BOOL' => 'smallint', + 'VCHAR' => 'varchar(255)', + 'VCHAR:' => 'varchar(%d)', + 'CHAR:' => 'char(%d)', + 'XSTEXT' => 'varchar(1000)', + 'STEXT' => 'varchar(3000)', + 'TEXT' => 'varchar(8000)', + 'MTEXT' => 'varchar(32672)', + 'XSTEXT_UNI'=> 'varchar(100)', + 'STEXT_UNI' => 'varchar(255)', + 'TEXT_UNI' => 'varchar(4000)', + 'MTEXT_UNI' => 'varchar(32672)', + 'TIMESTAMP' => 'integer', + 'DECIMAL' => 'float', + 'VCHAR_UNI' => 'varchar(255)', + 'VCHAR_UNI:'=> 'varchar(%d)', + 'VCHAR_CI' => 'varchar(255)', + 'VARBINARY' => 'varchar(255)', + ), + 'oracle' => array( 'INT:' => 'number(%d)', 'BINT' => 'number(20)', @@ -308,7 +335,14 @@ $database_update_info = array( ), ), // Latest version - '3.0.b4' => array(), + '3.0.b4' => array( + // Add the following columns + 'add_columns' => array( + CONFIRM_TABLE => array( + 'seed' => array('UINT:10', 0), + ), + ), + ), ); // Determine mapping database type diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index f06c98b657..e983744fb7 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -226,7 +226,8 @@ CREATE TABLE phpbb_confirm ( confirm_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL, session_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL, confirm_type INTEGER DEFAULT 0 NOT NULL, - code VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL + code VARCHAR(8) CHARACTER SET NONE DEFAULT '' NOT NULL, + seed INTEGER DEFAULT 0 NOT NULL );; ALTER TABLE phpbb_confirm ADD PRIMARY KEY (session_id, confirm_id);; diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 804d5eafc8..9e0e90d48c 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -292,7 +292,8 @@ CREATE TABLE [phpbb_confirm] ( [confirm_id] [char] (32) DEFAULT ('') NOT NULL , [session_id] [char] (32) DEFAULT ('') NOT NULL , [confirm_type] [int] DEFAULT (0) NOT NULL , - [code] [varchar] (8) DEFAULT ('') NOT NULL + [code] [varchar] (8) DEFAULT ('') NOT NULL , + [seed] [int] DEFAULT (0) NOT NULL ) ON [PRIMARY] GO diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index cf4d43b768..635faf81a5 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -163,6 +163,7 @@ CREATE TABLE phpbb_confirm ( session_id char(32) DEFAULT '' NOT NULL, confirm_type tinyint(3) DEFAULT '0' NOT NULL, code varchar(8) DEFAULT '' NOT NULL, + seed int(10) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (session_id, confirm_id), KEY confirm_type (confirm_type) ); diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index aaf00d077e..99e16ac4c8 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -163,6 +163,7 @@ CREATE TABLE phpbb_confirm ( session_id char(32) DEFAULT '' NOT NULL, confirm_type tinyint(3) DEFAULT '0' NOT NULL, code varchar(8) DEFAULT '' NOT NULL, + seed int(10) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (session_id, confirm_id), KEY confirm_type (confirm_type) ) CHARACTER SET `utf8` COLLATE `utf8_bin`; diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 816d584b97..c267fff059 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -337,6 +337,7 @@ CREATE TABLE phpbb_confirm ( session_id char(32) DEFAULT '' , confirm_type number(3) DEFAULT '0' NOT NULL, code varchar2(8) DEFAULT '' , + seed number(10) DEFAULT '0' NOT NULL, CONSTRAINT pk_phpbb_confirm PRIMARY KEY (session_id, confirm_id) ) / diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index aa22d5b0fa..206dff3b2e 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -275,6 +275,7 @@ CREATE TABLE phpbb_confirm ( session_id char(32) DEFAULT '' NOT NULL, confirm_type INT2 DEFAULT '0' NOT NULL, code varchar(8) DEFAULT '' NOT NULL, + seed INT4 DEFAULT '0' NOT NULL CHECK (seed >= 0), PRIMARY KEY (session_id, confirm_id) ); diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index ee42bfec4b..ba86abe6e4 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -160,6 +160,7 @@ CREATE TABLE phpbb_confirm ( session_id char(32) NOT NULL DEFAULT '', confirm_type tinyint(3) NOT NULL DEFAULT '0', code varchar(8) NOT NULL DEFAULT '', + seed INTEGER UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY (session_id, confirm_id) ); diff --git a/phpBB/posting.php b/phpBB/posting.php index ba32f24626..d991f27b35 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1128,12 +1128,14 @@ if ($config['enable_post_confirm'] && !$user->data['is_registered'] && $solved_c // Generate code $code = gen_rand_string(mt_rand(5, 8)); $confirm_id = md5(unique_id($user->ip)); + $seed = hexdec(substr(unique_id(), 4, 10)); $sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'confirm_id' => (string) $confirm_id, 'session_id' => (string) $user->session_id, 'confirm_type' => (int) CONFIRM_POST, - 'code' => (string) $code) + 'code' => (string) $code, + 'seed' => (int) $seed) ); $db->sql_query($sql); From 83443a362db2d4ccef25898d8192e2aa33cdbb68 Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 3 Dec 2006 17:40:28 +0000 Subject: [PATCH 026/264] none of you saw that! at least, not for this version :P git-svn-id: file:///svn/phpbb/trunk@6706 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index fa691d9119..dae441f40b 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -196,33 +196,6 @@ $dbms_type_map = array( 'VARBINARY' => '[varchar] (255)', ), - 'db2' => array( - 'INT:' => 'integer', - 'BINT' => 'float', - 'UINT' => 'integer', - 'UINT:' => 'integer', - 'TINT:' => 'smallint', - 'USINT' => 'smallint', - 'BOOL' => 'smallint', - 'VCHAR' => 'varchar(255)', - 'VCHAR:' => 'varchar(%d)', - 'CHAR:' => 'char(%d)', - 'XSTEXT' => 'varchar(1000)', - 'STEXT' => 'varchar(3000)', - 'TEXT' => 'varchar(8000)', - 'MTEXT' => 'varchar(32672)', - 'XSTEXT_UNI'=> 'varchar(100)', - 'STEXT_UNI' => 'varchar(255)', - 'TEXT_UNI' => 'varchar(4000)', - 'MTEXT_UNI' => 'varchar(32672)', - 'TIMESTAMP' => 'integer', - 'DECIMAL' => 'float', - 'VCHAR_UNI' => 'varchar(255)', - 'VCHAR_UNI:'=> 'varchar(%d)', - 'VCHAR_CI' => 'varchar(255)', - 'VARBINARY' => 'varchar(255)', - ), - 'oracle' => array( 'INT:' => 'number(%d)', 'BINT' => 'number(20)', From 3d38552c6918b5e3b94c885d1c6ff338380528d9 Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 3 Dec 2006 17:48:00 +0000 Subject: [PATCH 027/264] blah git-svn-id: file:///svn/phpbb/trunk@6707 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/db/mssql.php | 5 +---- phpBB/language/en/install.php | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php index 42ddb1a17a..c9946c2b5c 100644 --- a/phpBB/includes/db/mssql.php +++ b/phpBB/includes/db/mssql.php @@ -35,10 +35,7 @@ class dbal_mssql extends dbal $this->server = $sqlserver . (($port) ? ':' . $port : ''); $this->dbname = $database; - if (ini_get('mssql.charset')) - { - ini_set('mssql.charset', 'UTF-8'); - } + ini_set('mssql.charset', 'UTF-8'); $this->db_connect_id = ($this->persistency) ? @mssql_pconnect($this->server, $this->user, $sqlpassword) : @mssql_connect($this->server, $this->user, $sqlpassword); diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index f9371a503c..5868471fdd 100755 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -215,7 +215,7 @@ $lang = array_merge($lang, array( 'MBSTRING_FUNC_OVERLOAD' => 'Function overloading', 'MBSTRING_FUNC_OVERLOAD_EXPLAIN' => 'mbstring.func_overload must be set to either 0 or 4', 'MBSTRING_ENCODING_TRANSLATION' => 'Transparent character encoding', - 'MBSTRING_ENCODING_TRANSLATION_EXPLAIN' => 'mbstring.encoding_translation must be set to either 0', + 'MBSTRING_ENCODING_TRANSLATION_EXPLAIN' => 'mbstring.encoding_translation must be set 0', 'MBSTRING_HTTP_INPUT' => 'HTTP input character conversion', 'MBSTRING_HTTP_INPUT_EXPLAIN' => 'mbstring.http_input must be set to pass', 'MBSTRING_HTTP_OUTPUT' => 'HTTP output character conversion', From 9d9624a88624ca8850d6fcae60022a6ed9f754fc Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sun, 3 Dec 2006 18:03:33 +0000 Subject: [PATCH 028/264] - author search should use clean names for searching [Bug #5752] - local moderators are moderators too! - don't show a "word is not contained in any post" message for ignored common words - bold search words in search error messages [Bug #5762] git-svn-id: file:///svn/phpbb/trunk@6708 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_profile_fields.php | 6 +++--- phpBB/includes/search/fulltext_native.php | 8 +++++++- phpBB/includes/session.php | 6 +++--- phpBB/language/en/install.php | 2 +- phpBB/language/en/search.php | 4 ++-- phpBB/search.php | 2 +- 6 files changed, 17 insertions(+), 11 deletions(-) diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index 494288a600..05bea54bd7 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -37,7 +37,7 @@ class custom_profile case 'profile': // Show hidden fields to moderators/admins - if (!$auth->acl_gets('a_', 'm_')) + if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) { $sql_where .= ' AND f.field_hide = 0'; } @@ -199,7 +199,7 @@ class custom_profile FROM ' . PROFILE_LANG_TABLE . ' l, ' . PROFILE_FIELDS_TABLE . ' f WHERE l.lang_id = ' . $user->get_iso_lang_id() . ' AND f.field_active = 1 ' . - ((!$auth->acl_gets('a_', 'm_')) ? ' AND f.field_hide = 0 ' : '') . ' + ((!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) ? ' AND f.field_hide = 0 ' : '') . ' AND f.field_no_view = 0 AND l.field_id = f.field_id ORDER BY f.field_order'; @@ -264,7 +264,7 @@ class custom_profile case 'profile': // Show hidden fields to moderators/admins - if (!$auth->acl_gets('a_', 'm_')) + if (!$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) { $sql_where .= ' AND f.field_hide = 0'; } diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index df000f5e04..10c53d78cd 100755 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -187,6 +187,8 @@ class fulltext_native extends search_backend preg_match_all('#([^\\s+\\-|*()]+)(?:$|[\\s+\\-|()])#u', $keywords, $exact_words); $exact_words = $exact_words[1]; + $common_ids = array(); + if (sizeof($exact_words)) { $sql = 'SELECT word_id, word_text, word_common @@ -200,6 +202,7 @@ class fulltext_native extends search_backend if ($row['word_common']) { $this->common_words[] = $row['word_text']; + $common_ids[$row['word_text']] = (int) $row['word_id']; continue; } @@ -316,7 +319,10 @@ class fulltext_native extends search_backend // throw an error if we shall not ignore unexistant words else if (!$ignore_no_id) { - trigger_error(sprintf($user->lang['WORD_IN_NO_POST'], $word)); + if (!isset($common_ids[$word])) + { + trigger_error(sprintf($user->lang['WORD_IN_NO_POST'], $word)); + } } } diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 80d66291d7..de78969c3f 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -1218,7 +1218,7 @@ class user extends session if (!defined('DEBUG_EXTRA') && !defined('ADMIN_START') && !defined('IN_INSTALL') && !defined('IN_LOGIN') && file_exists($phpbb_root_path . 'install')) { // Adjust the message slightly according to the permissions - if ($auth->acl_gets('a_', 'm_')) + if ($auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_')) { $message = 'REMOVE_INSTALL'; } @@ -1231,7 +1231,7 @@ class user extends session } // Is board disabled and user not an admin or moderator? - if ($config['board_disable'] && !defined('IN_LOGIN') && !$auth->acl_gets('a_', 'm_')) + if ($config['board_disable'] && !defined('IN_LOGIN') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) { $message = (!empty($config['board_disable_msg'])) ? $config['board_disable_msg'] : 'BOARD_DISABLE'; trigger_error($message); @@ -1240,7 +1240,7 @@ class user extends session // Is load exceeded? if ($config['limit_load'] && $this->load !== false) { - if ($this->load > floatval($config['limit_load']) && !defined('IN_LOGIN') && !$auth->acl_gets('a_', 'm_')) + if ($this->load > floatval($config['limit_load']) && !defined('IN_LOGIN') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_gets('a_', 'm_')) { trigger_error('BOARD_UNAVAILABLE'); } diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 5868471fdd..e5b2325d24 100755 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -215,7 +215,7 @@ $lang = array_merge($lang, array( 'MBSTRING_FUNC_OVERLOAD' => 'Function overloading', 'MBSTRING_FUNC_OVERLOAD_EXPLAIN' => 'mbstring.func_overload must be set to either 0 or 4', 'MBSTRING_ENCODING_TRANSLATION' => 'Transparent character encoding', - 'MBSTRING_ENCODING_TRANSLATION_EXPLAIN' => 'mbstring.encoding_translation must be set 0', + 'MBSTRING_ENCODING_TRANSLATION_EXPLAIN' => 'mbstring.encoding_translation must be set to 0', 'MBSTRING_HTTP_INPUT' => 'HTTP input character conversion', 'MBSTRING_HTTP_INPUT_EXPLAIN' => 'mbstring.http_input must be set to pass', 'MBSTRING_HTTP_OUTPUT' => 'HTTP output character conversion', diff --git a/phpBB/language/en/search.php b/phpBB/language/en/search.php index db922f340b..9b63bf6f38 100644 --- a/phpBB/language/en/search.php +++ b/phpBB/language/en/search.php @@ -50,8 +50,8 @@ $lang = array_merge($lang, array( 'NO_SEARCH' => 'Sorry but you are not permitted to use the search system.', 'NO_SEARCH_RESULTS' => 'No suitable matches were found.', 'NO_SEARCH_TIME' => 'Sorry but you cannot use search at this time. Please try again in a few minutes.', - 'WORD_IN_NO_POST' => 'No posts were found because the word %s is not contained in any post.', - 'WORDS_IN_NO_POST' => 'No posts were found because the words %s are not contained in any post.', + 'WORD_IN_NO_POST' => 'No posts were found because the word %s is not contained in any post.', + 'WORDS_IN_NO_POST' => 'No posts were found because the words %s are not contained in any post.', 'POST_CHARACTERS' => 'characters of posts', diff --git a/phpBB/search.php b/phpBB/search.php index 9985e287bd..ef3fa572c0 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -103,7 +103,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) $sql_where = (strpos($author, '*') !== false) ? ' LIKE ' : ' = '; $sql = 'SELECT user_id FROM ' . USERS_TABLE . " - WHERE username $sql_where '" . $db->sql_escape(preg_replace('#\*+#', '%', $author)) . "' + WHERE username_clean $sql_where '" . $db->sql_escape(preg_replace('#\*+#', '%', utf8_clean_string($author))) . "' AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')'; $result = $db->sql_query_limit($sql, 100); From 1a5791e19f892f8a673685fdee63f9ee6c5f9847 Mon Sep 17 00:00:00 2001 From: David M Date: Mon, 4 Dec 2006 21:52:55 +0000 Subject: [PATCH 029/264] #6010 git-svn-id: file:///svn/phpbb/trunk@6709 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_database.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index ef9822b83d..a8c014979e 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -638,8 +638,8 @@ class acp_database for ($i = 0; $i < $i_num_fields; $i++) { - $ary_type[$i] = odbc_field_type($result, $i); - $ary_name[$i] = odbc_field_name($result, $i); + $ary_type[$i] = odbc_field_type($result, $i + 1); + $ary_name[$i] = odbc_field_name($result, $i + 1); } while ($row = $db->sql_fetchrow($result)) From f43a46fcf407f8eda62dceef5e0bcb2eadc59beb Mon Sep 17 00:00:00 2001 From: David M Date: Mon, 4 Dec 2006 21:55:34 +0000 Subject: [PATCH 030/264] #6010 git-svn-id: file:///svn/phpbb/trunk@6710 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_database.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index a8c014979e..c4c282e588 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -1261,7 +1261,7 @@ class acp_database break; case 'mssql': - case 'mssql-odbc': + case 'mssql_odbc': $delim = 'GO'; break; } From fae4e2bd969af97e6a40c5d80a2eab86252dfe77 Mon Sep 17 00:00:00 2001 From: David M Date: Tue, 5 Dec 2006 20:06:58 +0000 Subject: [PATCH 031/264] oops :D git-svn-id: file:///svn/phpbb/trunk@6711 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 2 +- phpBB/includes/ucp/ucp_register.php | 2 +- phpBB/posting.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 6f5ff42ac2..ab7bc452a5 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1910,7 +1910,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa 'session_id' => (string) $user->session_id, 'confirm_type' => (int) CONFIRM_LOGIN, 'code' => (string) $code, - 'seed' => (int) $seed) + 'seed' => (float) $seed) ); $db->sql_query($sql); diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index d78ea09806..17e421505b 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -448,7 +448,7 @@ class ucp_register 'session_id' => (string) $user->session_id, 'confirm_type' => (int) CONFIRM_REG, 'code' => (string) $code, - 'seed' => (int) $seed) + 'seed' => (float) $seed) ); $db->sql_query($sql); } diff --git a/phpBB/posting.php b/phpBB/posting.php index d991f27b35..663a96591f 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1135,7 +1135,7 @@ if ($config['enable_post_confirm'] && !$user->data['is_registered'] && $solved_c 'session_id' => (string) $user->session_id, 'confirm_type' => (int) CONFIRM_POST, 'code' => (string) $code, - 'seed' => (int) $seed) + 'seed' => (float) $seed) ); $db->sql_query($sql); From 576603574181e3300dcdefd77172781383c17d34 Mon Sep 17 00:00:00 2001 From: David M Date: Tue, 5 Dec 2006 20:24:28 +0000 Subject: [PATCH 032/264] #6000 git-svn-id: file:///svn/phpbb/trunk@6712 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_profile.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index 8bfe2b8b36..e093308f4d 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -103,6 +103,8 @@ class acp_profile $field_ident = (string) $db->sql_fetchfield('field_ident'); $db->sql_freeresult($result); + $db->sql_transaction('begin'); + $db->sql_query('DELETE FROM ' . PROFILE_FIELDS_TABLE . " WHERE field_id = $field_id"); $db->sql_query('DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . " WHERE field_id = $field_id"); $db->sql_query('DELETE FROM ' . PROFILE_LANG_TABLE . " WHERE field_id = $field_id"); @@ -119,8 +121,6 @@ class acp_profile $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - $db->sql_transaction('begin'); - // Create a temp table and populate it, destroy the existing one $db->sql_query(preg_replace('#CREATE\s+TABLE\s+"?' . PROFILE_FIELDS_DATA_TABLE . '"?#i', 'CREATE TEMPORARY TABLE ' . PROFILE_FIELDS_DATA_TABLE . '_temp', $row['sql'])); $db->sql_query('INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . '_temp SELECT * FROM ' . PROFILE_FIELDS_DATA_TABLE); @@ -149,12 +149,10 @@ class acp_profile $db->sql_query('CREATE TABLE ' . PROFILE_FIELDS_DATA_TABLE . ' (' . $new_table_cols . ');'); $db->sql_query('INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . PROFILE_FIELDS_DATA_TABLE . '_temp;'); $db->sql_query('DROP TABLE ' . PROFILE_FIELDS_DATA_TABLE . '_temp'); - - $db->sql_transaction('commit'); break; default: - $db->sql_query('ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " DROP pf_$field_ident"); + $db->sql_query('ALTER TABLE ' . PROFILE_FIELDS_DATA_TABLE . " DROP COLUMN pf_$field_ident"); } $order = 0; @@ -177,6 +175,8 @@ class acp_profile } $db->sql_freeresult($result); + $db->sql_transaction('commit'); + add_log('admin', 'LOG_PROFILE_FIELD_REMOVED', $field_ident); trigger_error($user->lang['REMOVED_PROFILE_FIELD'] . adm_back_link($this->u_action)); } From cb505ce4b08d3ec1de1184474a673886dfdb212b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Wed, 6 Dec 2006 14:44:40 +0000 Subject: [PATCH 033/264] what git-svn-id: file:///svn/phpbb/trunk@6713 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/common.php | 1 + phpBB/language/en/memberlist.php | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 5bba8f92e6..541d004f11 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -299,6 +299,7 @@ $lang = array_merge($lang, array( 'MODERATORS' => 'Moderators', 'MONTH' => 'Month', 'MOVE' => 'Move', + 'MSNM' => 'MSNM/WLM', 'NA' => 'N/A', 'NEWEST_USER' => 'Our newest member %s%s%s', diff --git a/phpBB/language/en/memberlist.php b/phpBB/language/en/memberlist.php index b46fe1c621..2d47c31f38 100644 --- a/phpBB/language/en/memberlist.php +++ b/phpBB/language/en/memberlist.php @@ -92,7 +92,6 @@ $lang = array_merge($lang, array( 'LOGIN_EXPLAIN_VIEWPROFILE' => 'The board administrator requires you to be registered and logged in to view profiles.', 'MORE_THAN' => 'More than', - 'MSNM' => 'MSNM', 'NO_EMAIL' => 'You are not permitted to send email to this user.', 'NO_VIEW_USERS' => 'You are not authorised to view the member list or profiles.', From daeef71d813b68524e0630e2aadbf0870bb06800 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 6 Dec 2006 15:47:50 +0000 Subject: [PATCH 034/264] some updater changes as well as tiny bugfixes git-svn-id: file:///svn/phpbb/trunk@6714 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/install_update.html | 29 ++- phpBB/adm/style/install_update_diff.html | 2 +- phpBB/includes/acp/acp_icons.php | 28 ++- phpBB/includes/acp/acp_php_info.php | 9 +- phpBB/includes/message_parser.php | 2 +- phpBB/install/install_update.php | 216 +++++++++++++++-------- phpBB/language/en/acp/common.php | 2 + phpBB/language/en/install.php | 7 +- 8 files changed, 210 insertions(+), 85 deletions(-) diff --git a/phpBB/adm/style/install_update.html b/phpBB/adm/style/install_update.html index 19cf38c99b..be4fd0961b 100644 --- a/phpBB/adm/style/install_update.html +++ b/phpBB/adm/style/install_update.html @@ -128,7 +128,7 @@ function popup(url, width, height)
{files.FILENAME}
- {files.FILENAME} + {files.DIR_PART}
{files.FILE_PART}

{L_FILE_USED}: {files.CUSTOM_ORIGINAL} @@ -141,10 +141,33 @@ function popup(url, width, height)
  {L_DO_NOT_UPDATE}
-
  {L_MERGE_NEW_FILE_OPTION}
  {L_MERGE_MOD_FILE_OPTION}
+ +
+
  {L_MERGE_NO_MERGE_NEW_OPTION}
+
[{L_SHOW_DIFF_FINAL}]
+
+
+
  {L_MERGE_NO_MERGE_MOD_OPTION}
+
[{L_SHOW_DIFF_FINAL}]
+
+
+
  {L_MERGE_NEW_FILE_OPTION}
+
[{L_SHOW_DIFF_FINAL}]
+
+
+
  {L_MERGE_MOD_FILE_OPTION}
+
[{L_SHOW_DIFF_FINAL}]
+
+ + + +
+ {files.L_STATUS} + + - + diff --git a/phpBB/adm/style/install_update_diff.html b/phpBB/adm/style/install_update_diff.html index cdc0d8cc21..9856f60f2c 100644 --- a/phpBB/adm/style/install_update_diff.html +++ b/phpBB/adm/style/install_update_diff.html @@ -171,7 +171,7 @@ table.hrdiff caption span {
{L_NUM_CONFLICTS}: {NUM_CONFLICTS}
- {DIFF_CONTENT} + {DIFF_CONTENT} diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index 4636b067c2..f5e09582e4 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -308,6 +308,29 @@ class acp_icons { $order = 0; + if (!($pak_ary = @file($phpbb_root_path . $img_path . '/' . $pak))) + { + trigger_error($user->lang['PAK_FILE_NOT_READABLE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + // Make sure the pak_ary is valid + foreach ($pak_ary as $pak_entry) + { + if (preg_match_all("#'(.*?)', #", $pak_entry, $data)) + { + if ((sizeof($data[1]) != 4 && $mode == 'icons') || + (sizeof($data[1]) != 6 && $mode == 'smilies')) + { + trigger_error($user->lang['WRONG_PAK_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + } + else + { + trigger_error($user->lang['WRONG_PAK_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING); + } + } + + // The user has already selected a smilies_pak file if ($current == 'delete') { @@ -343,11 +366,6 @@ class acp_icons $db->sql_freeresult($result); } - if (!($pak_ary = @file($phpbb_root_path . $img_path . '/' . $pak))) - { - trigger_error($user->lang['PAK_FILE_NOT_READABLE'] . adm_back_link($this->u_action), E_USER_WARNING); - } - foreach ($pak_ary as $pak_entry) { $data = array(); diff --git a/phpBB/includes/acp/acp_php_info.php b/phpBB/includes/acp/acp_php_info.php index fe223b623e..3816285953 100644 --- a/phpBB/includes/acp/acp_php_info.php +++ b/phpBB/includes/acp/acp_php_info.php @@ -29,15 +29,22 @@ class acp_php_info $this->page_title = 'ACP_PHP_INFO'; ob_start(); - phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES | INFO_VARIABLES); + @phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES | INFO_VARIABLES); $phpinfo = ob_get_contents(); ob_end_clean(); + $phpinfo = trim($phpinfo); + // Here we play around a little with the PHP Info HTML to try and stylise // it along phpBB's lines ... hopefully without breaking anything. The idea // for this was nabbed from the PHP annotated manual preg_match_all('#]*>(.*)#si', $phpinfo, $output); + if (empty($phpinfo) || empty($output)) + { + trigger_error('NO_PHPINFO_AVAILABLE', E_USER_WARNING); + } + $output = $output[1][0]; $output = preg_replace('#
(.*?]*>]*>)(.*?)
\2\1
', $output); diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 797c2f5cfd..285b0d0649 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -418,7 +418,7 @@ class bbcode_firstpass extends bbcode $conf = array('highlight.bg', 'highlight.comment', 'highlight.default', 'highlight.html', 'highlight.keyword', 'highlight.string'); foreach ($conf as $ini_var) { - ini_set($ini_var, str_replace('highlight.', 'syntax', $ini_var)); + @ini_set($ini_var, str_replace('highlight.', 'syntax', $ini_var)); } // Because highlight_string is specialcharing the text (but we already did this before), we have to reverse this in order to get correct results diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index fb022a5822..2a6de60d47 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -88,6 +88,12 @@ class install_update extends module require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx); require($phpbb_root_path . 'includes/constants.' . $phpEx); + // Special options for conflicts + define('MERGE_NO_MERGE_NEW', 1); + define('MERGE_NO_MERGE_MOD', 2); + define('MERGE_NEW_FILE', 3); + define('MERGE_MOD_FILE', 4); + $db = new $sql_db(); // Connect to DB @@ -113,11 +119,6 @@ class install_update extends module $auth->acl($user->data); $user->setup('install'); - // Include renderer and engine - $this->include_file('includes/diff/diff.' . $phpEx); - $this->include_file('includes/diff/engine.' . $phpEx); - $this->include_file('includes/diff/renderer.' . $phpEx); - // If we are within the intro page we need to make sure we get up-to-date version info if ($sub == 'intro') { @@ -192,6 +193,11 @@ class install_update extends module $user->lang = array_merge($user->lang, $lang); } + // Include renderer and engine + $this->include_file('includes/diff/diff.' . $phpEx); + $this->include_file('includes/diff/engine.' . $phpEx); + $this->include_file('includes/diff/renderer.' . $phpEx); + // Make sure we stay at the file check if checking the files again if (!empty($_POST['check_again'])) { @@ -294,18 +300,38 @@ class install_update extends module foreach ($filelist as $file_struct) { + $filename = htmlspecialchars($file_struct['filename']); + if (strrpos($filename, '/') !== false) + { + $dir_part = substr($filename, 0, strrpos($filename, '/') + 1); + $file_part = substr($filename, strrpos($filename, '/') + 1); + } + else + { + $dir_part = ''; + $file_part = $filename; + } + + $diff_url = append_sid($this->p_master->module_url, "mode=$mode&sub=file_check&action=diff&status=$status&file=" . urlencode($file_struct['filename'])); + $template->assign_block_vars('files', array( 'STATUS' => $status, - 'FILENAME' => htmlspecialchars($file_struct['filename']), + 'FILENAME' => $filename, + 'DIR_PART' => $dir_part, + 'FILE_PART' => $file_part, 'NUM_CONFLICTS' => (isset($file_struct['conflicts'])) ? $file_struct['conflicts'] : 0, 'S_CUSTOM' => ($file_struct['custom']) ? true : false, 'CUSTOM_ORIGINAL' => ($file_struct['custom']) ? $file_struct['original'] : '', - 'U_SHOW_DIFF' => append_sid($this->p_master->module_url, "mode=$mode&sub=file_check&action=diff&status=$status&file=" . urlencode($file_struct['filename'])), - 'UA_SHOW_DIFF' => append_sid($this->p_master->module_url, "mode=$mode&sub=file_check&action=diff&status=$status&file=" . urlencode($file_struct['filename']), false), + 'U_SHOW_DIFF' => $diff_url, 'L_SHOW_DIFF' => ($status != 'up_to_date') ? $user->lang['SHOW_DIFF_' . strtoupper($status)] : '', + + 'U_VIEW_MOD_FILE' => $diff_url . '&op=' . MERGE_MOD_FILE, + 'U_VIEW_NEW_FILE' => $diff_url . '&op=' . MERGE_NEW_FILE, + 'U_VIEW_NO_MERGE_MOD' => $diff_url . '&op=' . MERGE_NO_MERGE_MOD, + 'U_VIEW_NO_MERGE_NEW' => $diff_url . '&op=' . MERGE_NO_MERGE_NEW, )); } } @@ -586,16 +612,10 @@ class install_update extends module case 'modified': - $tmp = array( - 'file1' => file_get_contents($this->old_location . $original_filename), - 'file2' => file_get_contents($phpbb_root_path . $file_struct['filename']), - 'file3' => file_get_contents($this->new_location . $original_filename), - ); + $diff = $this->return_diff($this->old_location . $original_filename, $phpbb_root_path . $file_struct['filename'], $this->new_location . $original_filename); - $diff = &new diff3($tmp['file1'], $tmp['file2'], $tmp['file3']); $contents = implode("\n", $diff->merged_output()); - - unset($tmp, $diff); + unset($diff); if ($update_mode == 'download') { @@ -611,32 +631,41 @@ class install_update extends module case 'conflict': - $tmp = array( - 'file1' => file_get_contents($this->old_location . $original_filename), - 'file2' => file_get_contents($phpbb_root_path . $file_struct['filename']), - 'file3' => file_get_contents($this->new_location . $original_filename), - ); + $option = $conflicts[$file_struct['filename']]; + $contents = ''; - $diff = &new diff3($tmp['file1'], $tmp['file2'], $tmp['file3']); + switch ($option) + { + case MERGE_NO_MERGE_NEW: + $contents = file_get_contents($this->new_location . $original_filename); + break; - unset($tmp); + case MERGE_NO_MERGE_MOD: + $contents = file_get_contents($phpbb_root_path . $file_struct['filename']); + break; - if ($conflicts[$file_struct['filename']] == 1) - { - $contents = implode("\n", $diff->merged_new_output()); - } - else if ($conflicts[$file_struct['filename']] == 2) - { - $contents = implode("\n", $diff->merged_orig_output()); - } - else - { - unset($diff); + default: + + $diff = $this->return_diff($this->old_location . $original_filename, $phpbb_root_path . $file_struct['filename'], $this->new_location . $original_filename); + + if ($option == MERGE_NEW_FILE) + { + $contents = implode("\n", $diff->merged_new_output()); + } + else if ($option == MERGE_MOD_FILE) + { + $contents = implode("\n", $diff->merged_orig_output()); + } + else + { + unset($diff); + break 2; + } + + unset($diff); break; } - unset($diff); - if ($update_mode == 'download') { $compress->add_data($contents, $file_struct['filename']); @@ -751,59 +780,71 @@ class install_update extends module switch ($status) { case 'conflict': - $tmp = array( - 'file1' => file_get_contents($this->old_location . $original_file), - 'file2' => file_get_contents($phpbb_root_path . $file), - 'file3' => file_get_contents($this->new_location . $original_file), - ); + $option = request_var('op', 0); - $diff = &new diff3($tmp['file1'], $tmp['file2'], $tmp['file3']); + switch ($option) + { + case MERGE_NO_MERGE_NEW: + case MERGE_NO_MERGE_MOD: - unset($tmp); + $diff = $this->return_diff(array(), ($option == MERGE_NO_MERGE_NEW) ? $this->new_location . $original_file : $phpbb_root_path . $file); + + $template->assign_var('S_DIFF_NEW_FILE', true); + $diff_mode = 'inline'; + $this->page_title = 'VIEWING_FILE_CONTENTS'; + + break; + + case MERGE_NEW_FILE: + case MERGE_MOD_FILE: + + $diff = $this->return_diff($this->old_location . $original_file, $phpbb_root_path . $file, $this->new_location . $original_file); + + $tmp = array( + 'file1' => array(), + 'file2' => ($option == MERGE_NEW_FILE) ? implode("\n", $diff->merged_new_output()) : implode("\n", $diff->merged_orig_output()), + ); + + $diff = &new diff($tmp['file1'], $tmp['file2']); + + unset($tmp); + + $template->assign_var('S_DIFF_NEW_FILE', true); + $diff_mode = 'inline'; + $this->page_title = 'VIEWING_FILE_CONTENTS'; + + break; + + default: + + $diff = $this->return_diff($this->old_location . $original_file, $phpbb_root_path . $file, $this->new_location . $original_file); + + $template->assign_vars(array( + 'S_DIFF_CONFLICT_FILE' => true, + 'NUM_CONFLICTS' => $diff->merged_output(false, false, false, true)) + ); + break; + } - $template->assign_vars(array( - 'S_DIFF_CONFLICT_FILE' => true, - 'NUM_CONFLICTS' => $diff->merged_output(false, false, false, true)) - ); break; case 'modified': - $tmp = array( - 'file1' => file_get_contents($this->old_location . $original_file), - 'file2' => file_get_contents($phpbb_root_path . $original_file), - 'file3' => file_get_contents($this->new_location . $file), - ); - - $diff = &new diff3($tmp['file1'], $tmp['file2'], $tmp['file3']); - - unset($tmp); + $diff = $this->return_diff($this->old_location . $original_file, $phpbb_root_path . $original_file, $this->new_location . $file); break; case 'not_modified': case 'new_conflict': - $tmp = array( - 'file1' => file_get_contents($phpbb_root_path . $file), - 'file2' => file_get_contents($this->new_location . $original_file), - ); - - $diff = &new diff($tmp['file1'], $tmp['file2']); - - unset($tmp); + $diff = $this->return_diff($phpbb_root_path . $file, $this->new_location . $original_file); break; case 'new': - $tmp = array( - 'file1' => array(), - 'file2' => file_get_contents($this->new_location . $original_file), - ); - $diff = &new diff($tmp['file1'], $tmp['file2']); - - unset($tmp); + $diff = $this->return_diff(array(), $this->new_location . $original_file); $template->assign_var('S_DIFF_NEW_FILE', true); $diff_mode = 'inline'; $this->page_title = 'VIEWING_FILE_CONTENTS'; + break; } @@ -1154,7 +1195,7 @@ class install_update extends module */ function include_file($filename) { - global $phpbb_root_path; + global $phpbb_root_path, $phpEx; if (!empty($this->update_info['files']) && in_array($filename, $this->update_info['files'])) { @@ -1165,6 +1206,37 @@ class install_update extends module include_once($phpbb_root_path . $filename); } } + + /** + * Wrapper for returning a diff object + */ + function &return_diff() + { + $args = func_get_args(); + $three_way_diff = (func_num_args() > 2) ? true : false; + + $file1 = array_shift($args); + $file2 = array_shift($args); + + $tmp['file1'] = (!empty($file1) && is_string($file1)) ? file_get_contents($file1) : $file1; + $tmp['file2'] = (!empty($file2) && is_string($file2)) ? file_get_contents($file2) : $file2; + + if ($three_way_diff) + { + $file3 = array_shift($args); + $tmp['file3'] = (!empty($file3) && is_string($file3)) ? file_get_contents($file3) : $file3; + + $diff = &new diff3($tmp['file1'], $tmp['file2'], $tmp['file3']); + } + else + { + $diff = &new diff($tmp['file1'], $tmp['file2']); + } + + unset($tmp); + + return $diff; + } } ?> \ No newline at end of file diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 4b0ec7fea6..a45f7af083 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -273,6 +273,8 @@ $lang = array_merge($lang, array( // PHP info $lang = array_merge($lang, array( 'ACP_PHP_INFO_EXPLAIN' => 'This page lists information on the version of PHP installed on this server. It includes details of loaded modules, available variables and default settings. This information may be useful when diagnosing problems. Please be aware that some hosting companies will limit what information is displayed here for security reasons. You are advised to not give out any details on this page except when asked by support or other Team Member on the support forums.', + + 'NO_PHPINFO_AVAILABLE' => 'The PHP informations are unable to be determined. Phpinfo() has been disabled for security reasons.', )); // Logs diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index e5b2325d24..08c07cdeb8 100755 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -368,8 +368,10 @@ $lang = array_merge($lang, array( 'LOGIN_UPDATE_EXPLAIN' => 'In order to update your installation you need to login first.', 'MAPPING_FILE_STRUCTURE' => 'To ease the upload here are the file locations which map your phpBB installation.', - 'MERGE_MOD_FILE_OPTION' => 'Use modified file code on final merge', - 'MERGE_NEW_FILE_OPTION' => 'Use new file code on final merge', + 'MERGE_NO_MERGE_NEW_OPTION' => 'Do not merge - use new file', + 'MERGE_NO_MERGE_MOD_OPTION' => 'Do not merge - use currently installed file', + 'MERGE_MOD_FILE_OPTION' => 'Merge differences and use modified code within conflicting block', + 'MERGE_NEW_FILE_OPTION' => 'Merge differences and use new file code within conflicting block', 'MERGE_SELECT_ERROR' => 'Conflicting file merge modes are not correctly selected.', 'NEW_FILE' => 'New updated file', @@ -400,6 +402,7 @@ $lang = array_merge($lang, array( 'SELECT_DOWNLOAD_FORMAT' => 'Select download archive format', 'SELECT_FTP_SETTINGS' => 'Select FTP Settings', 'SHOW_DIFF_CONFLICT' => 'Show differences/conflicts', + 'SHOW_DIFF_FINAL' => 'Show resulting file', 'SHOW_DIFF_MODIFIED' => 'Show merged differences', 'SHOW_DIFF_NEW' => 'Show file contents', 'SHOW_DIFF_NEW_CONFLICT' => 'Show differences', From 676fd08c4790ec5cab8c2ed59fc5839ec2f3cea8 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 6 Dec 2006 17:35:04 +0000 Subject: [PATCH 035/264] changes to how errors are processed by the messenger git-svn-id: file:///svn/phpbb/trunk@6715 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_messenger.php | 33 +++++++++++++++++--------- phpBB/language/en/ucp.php | 1 + 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index f08e81e754..650deb6a0d 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -249,7 +249,7 @@ class messenger */ function error($type, $msg) { - global $user, $phpEx, $phpbb_root_path; + global $user, $phpEx, $phpbb_root_path, $config; // Session doesn't exist, create it if (!isset($user->session_id) || $user->session_id === '') @@ -257,7 +257,22 @@ class messenger $user->session_begin(); } - add_log('critical', 'LOG_ERROR_' . $type, $msg); + $calling_page = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF']; + + $message = ''; + switch ($type) + { + case 'EMAIL': + $message = 'EMAIL/' . (($config['smtp_delivery']) ? 'SMTP' : 'PHP/' . $config['email_function_name'] . '()') . ''; + break; + + default: + $message = "$type"; + break; + } + + $message .= '
' . htmlspecialchars($calling_page) . '

' . $msg . '
'; + add_log('critical', 'LOG_ERROR_' . $type, $message); } /** @@ -388,9 +403,7 @@ class messenger if (!$result) { - $message = 'EMAIL ERROR [ ' . (($config['smtp_delivery']) ? 'SMTP' : 'PHP') . ' ]

' . $err_msg . '

CALLING PAGE

' . ((!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF']) . '
'; - - $this->error('EMAIL', $message); + $this->error('EMAIL', $err_msg); return false; } } @@ -613,8 +626,7 @@ class queue { @unlink($this->cache_file . '.lock'); - $message = 'Method: [ ' . (($config['smtp_delivery']) ? 'SMTP' : 'PHP') . ' ]

' . $err_msg . '

CALLING PAGE

' . ((!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF']); - messenger::error('EMAIL', $message); + messenger::error('EMAIL', $err_msg); continue 2; } break; @@ -624,8 +636,7 @@ class queue { if ($this->jabber->send_message($address, 'normal', NULL, array('body' => $msg)) === false) { - $message = 'Method: [ JABBER ]

' . $this->jabber->get_log() . '

CALLING PAGE

' . ((!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF']); - messenger::error('JABBER', $message); + messenger::error('JABBER', $this->jabber_get_log()); continue 3; } } @@ -976,7 +987,7 @@ class smtp_class { if ($this->backtrace) { - $this->backtrace_log[] = $message; + $this->backtrace_log[] = htmlspecialchars($message, ENT_COMPAT, 'UTF-8'); } } @@ -1033,7 +1044,7 @@ class smtp_class if ($this->backtrace) { - $message = '

Backtrace

' . implode('
', array_map('htmlspecialchars', $this->backtrace_log)) . '

'; + $message = '

Backtrace

' . implode('
', $this->backtrace_log) . '

'; $err_msg .= $message; } } diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index 4761fcdd48..fceafdaf02 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -321,6 +321,7 @@ $lang = array_merge($lang, array( 'PASS_TYPE_ANY_EXPLAIN' => 'Must be between %1$d and %2$d characters.', 'PASS_TYPE_CASE_EXPLAIN' => 'Password must be between %1$d and %2$d chars long and must be mixed case', 'PASS_TYPE_SYMBOL_EXPLAIN' => 'Password must be between %1$d and %2$d chars long and must contain symbols', + 'PASSWORD' => 'Password', 'PASSWORD_ACTIVATED' => 'Your new password has been activated', 'PASSWORD_UPDATED' => 'Your password has been sent successfully to your original email address.', 'PERMISSIONS_RESTORED' => 'Successfully restored original permissions.', From ef6f81a64d6248e2d2b0e13066804fa1ea0ef8c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Wed, 6 Dec 2006 18:13:36 +0000 Subject: [PATCH 036/264] #5938 git-svn-id: file:///svn/phpbb/trunk@6716 89ea8834-ac86-4346-8a33-228a782c2dd0 --- .../subSilver/template/memberlist_body.html | 29 +++++++++++++------ .../subSilver/template/memberlist_search.html | 4 +-- 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/phpBB/styles/subSilver/template/memberlist_body.html b/phpBB/styles/subSilver/template/memberlist_body.html index 78b2896439..a266299932 100644 --- a/phpBB/styles/subSilver/template/memberlist_body.html +++ b/phpBB/styles/subSilver/template/memberlist_body.html @@ -1,6 +1,12 @@ - + + + + + - + + + @@ -93,12 +99,17 @@
-
- -
- -
- - \ No newline at end of file + + + +
+ + + +
+ +
+ + \ No newline at end of file diff --git a/phpBB/styles/subSilver/template/memberlist_search.html b/phpBB/styles/subSilver/template/memberlist_search.html index 042909fa8d..b602ab8aa6 100644 --- a/phpBB/styles/subSilver/template/memberlist_search.html +++ b/phpBB/styles/subSilver/template/memberlist_search.html @@ -1,6 +1,5 @@ - - + +
From 6e7c29adfb82164ab10984bd2a57b11f1ac916a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Wed, 6 Dec 2006 18:23:42 +0000 Subject: [PATCH 037/264] What the? Did Paul try to sneak in a new feature without our knowledge a few years back. O_o #5788 git-svn-id: file:///svn/phpbb/trunk@6717 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/posting.php | 1 - 1 file changed, 1 deletion(-) diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index 95217c3ac8..e7d92c26bd 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -61,7 +61,6 @@ $lang = array_merge($lang, array( 'CANNOT_EDIT_POST_LOCKED' => 'This post has been locked. You can no longer edit that post.', 'CANNOT_EDIT_TIME' => 'You can no longer edit or delete that post', 'CANNOT_POST_ANNOUNCE' => 'Sorry but you cannot post announcements.', - 'CANNOT_POST_NEWS' => 'Sorry but you cannot post news topics.', 'CANNOT_POST_STICKY' => 'Sorry but you cannot post sticky topics.', 'CHANGE_TOPIC_TO' => 'Change topic type to', 'CLOSE_TAGS' => 'Close tags', From a9b2e99974398b6e88dc5a1417c0a711ec3a437c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Wed, 6 Dec 2006 18:30:33 +0000 Subject: [PATCH 038/264] Custom BBCodes? Never heard of 'em. git-svn-id: file:///svn/phpbb/trunk@6718 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/help_bbcode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/language/en/help_bbcode.php b/phpBB/language/en/help_bbcode.php index ada28713e0..7909a2a148 100644 --- a/phpBB/language/en/help_bbcode.php +++ b/phpBB/language/en/help_bbcode.php @@ -96,7 +96,7 @@ $help = array( ), array( 0 => 'Can I add my own tags?', - 1 => 'No, I am afraid not directly in phpBB 2.0. We are looking at offering customisable BBCode tags for the next major version' + 1 => 'If you are an administrator on this board and have the proper permissions, you can add further BBCodes through the Custom BBCodes section.' ) ); From b508c57b8046f7372b37e45fd993471303fcfc58 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 6 Dec 2006 22:13:11 +0000 Subject: [PATCH 039/264] minor bugfixing git-svn-id: file:///svn/phpbb/trunk@6719 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/acp_language.html | 2 +- phpBB/includes/acp/acp_bots.php | 74 +++++++++++-------- phpBB/includes/acp/acp_language.php | 3 +- phpBB/includes/acp/acp_modules.php | 11 +++ phpBB/includes/db/dbal.php | 11 ++- phpBB/includes/functions.php | 2 +- phpBB/includes/session.php | 15 +++- phpBB/includes/ucp/ucp_register.php | 2 +- phpBB/language/en/acp/common.php | 2 - .../subSilver/template/ucp_register.html | 2 +- phpBB/viewforum.php | 20 ++++- 11 files changed, 100 insertions(+), 44 deletions(-) diff --git a/phpBB/adm/style/acp_language.html b/phpBB/adm/style/acp_language.html index 7e4a49f893..d7a4a31901 100644 --- a/phpBB/adm/style/acp_language.html +++ b/phpBB/adm/style/acp_language.html @@ -7,7 +7,7 @@ « {L_BACK}

{L_SELECT_DOWNLOAD_FORMAT}

- +
diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php index 2dbcc463e9..0b1cdb122f 100644 --- a/phpBB/includes/acp/acp_bots.php +++ b/phpBB/includes/acp/acp_bots.php @@ -70,42 +70,54 @@ class acp_bots case 'delete': if ($bot_id || sizeof($mark)) { - // We need to delete the relevant user, usergroup and bot entries ... - $sql_id = ($bot_id) ? " = $bot_id" : ' IN (' . implode(', ', $mark) . ')'; - - $sql = 'SELECT bot_name, user_id - FROM ' . BOTS_TABLE . " - WHERE bot_id $sql_id"; - $result = $db->sql_query($sql); - - $user_id_ary = $bot_name_ary = array(); - while ($row = $db->sql_fetchrow($result)) + if (confirm_box(true)) { - $user_id_ary[] = (int) $row['user_id']; - $bot_name_ary[] = $row['bot_name']; - } - $db->sql_freeresult($result); + // We need to delete the relevant user, usergroup and bot entries ... + $sql_id = ($bot_id) ? " = $bot_id" : ' IN (' . implode(', ', $mark) . ')'; - $db->sql_transaction('begin'); + $sql = 'SELECT bot_name, user_id + FROM ' . BOTS_TABLE . " + WHERE bot_id $sql_id"; + $result = $db->sql_query($sql); - $sql = 'DELETE FROM ' . BOTS_TABLE . " - WHERE bot_id $sql_id"; - $db->sql_query($sql); + $user_id_ary = $bot_name_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + $user_id_ary[] = (int) $row['user_id']; + $bot_name_ary[] = $row['bot_name']; + } + $db->sql_freeresult($result); - $_tables = array(USERS_TABLE, USER_GROUP_TABLE); - foreach ($_tables as $table) - { - $sql = "DELETE FROM $table - WHERE " . $db->sql_in_set('user_id', $user_id_ary); + $db->sql_transaction('begin'); + + $sql = 'DELETE FROM ' . BOTS_TABLE . " + WHERE bot_id $sql_id"; $db->sql_query($sql); + + $_tables = array(USERS_TABLE, USER_GROUP_TABLE); + foreach ($_tables as $table) + { + $sql = "DELETE FROM $table + WHERE " . $db->sql_in_set('user_id', $user_id_ary); + $db->sql_query($sql); + } + + $db->sql_transaction('commit'); + + $cache->destroy('bots'); + + add_log('admin', 'LOG_BOT_DELETE', implode(', ', $bot_name_ary)); + trigger_error($user->lang['BOT_DELETED'] . adm_back_link($this->u_action)); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'mark' => $mark, + 'id' => $bot_id, + 'mode' => $mode, + 'action' => $action)) + ); } - - $db->sql_transaction('commit'); - - $cache->destroy('bots'); - - add_log('admin', 'LOG_BOT_DELETE', implode(', ', $bot_name_ary)); - trigger_error($user->lang['BOT_DELETED'] . adm_back_link($this->u_action)); } break; @@ -302,7 +314,7 @@ class acp_bots $sql = 'SELECT b.bot_id, b.bot_name, b.bot_active, u.user_lastvisit FROM ' . BOTS_TABLE . ' b, ' . USERS_TABLE . ' u WHERE u.user_id = b.user_id - ORDER BY u.user_lastvisit DESC'; + ORDER BY u.user_lastvisit DESC, b.bot_name ASC'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php index 6c962d9405..abd01b6263 100644 --- a/phpBB/includes/acp/acp_language.php +++ b/phpBB/includes/acp/acp_language.php @@ -116,6 +116,7 @@ class acp_language 'S_UPLOAD' => true, 'NAME' => $method, 'U_ACTION' => $this->u_action . "&id=$lang_id&action=upload_data", + 'U_BACK' => $this->u_action . "&id=$lang_id&action=details&language_file=" . urlencode($selected_lang_file), 'HIDDEN' => $hidden_data, 'S_CONNECTION_SUCCESS' => (request_var('test_connection', '') && $test_connection === true) ? true : false, @@ -203,7 +204,7 @@ class acp_language if (!$fp) { - trigger_error(sprintf($user->lang['UNABLE_TO_WRITE_FILE'], $filename) . adm_back_link($this->u_action . '&id=' . $lang_id . '&language_file=' . urlencode($selected_lang_file)), E_USER_WARNING); + trigger_error(sprintf($user->lang['UNABLE_TO_WRITE_FILE'], $filename) . adm_back_link($this->u_action . '&id=' . $lang_id . '&action=details&language_file=' . urlencode($selected_lang_file)), E_USER_WARNING); } if ($this->language_directory == 'email') diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php index c426e4607d..9b42b7b8ba 100644 --- a/phpBB/includes/acp/acp_modules.php +++ b/phpBB/includes/acp/acp_modules.php @@ -67,6 +67,17 @@ class acp_modules if (confirm_box(true)) { + // Make sure we are not directly within a module + if ($module_id == $this->parent_id) + { + $sql = 'SELECT parent_id + FROM ' . MODULES_TABLE . ' + WHERE module_id = ' . $module_id; + $result = $db->sql_query($sql); + $this->parent_id = (int) $db->sql_fetchfield('parent_id'); + $db->sql_freeresult($result); + } + $errors = $this->delete_module($module_id); if (!sizeof($errors)) diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index da5efcf55a..f4cbe0e2d4 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -438,7 +438,7 @@ class dbal */ function sql_error($sql = '') { - global $auth, $user; + global $auth, $user, $config; // Set var to retrieve errored status $this->sql_error_triggered = true; @@ -472,7 +472,14 @@ class dbal } else { - $message .= '

' . $user->lang['SQL_ERROR_OCCURRED']; + if (!empty($config['board_contact'])) + { + $message .= '

' . sprintf($user->lang['SQL_ERROR_OCCURRED'], '', ''); + } + else + { + $message .= '

' . sprintf($user->lang['SQL_ERROR_OCCURRED'], '', ''); + } } } diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index ab7bc452a5..1a3cb559f2 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -636,7 +636,7 @@ function language_select($default = '') $sql = 'SELECT lang_iso, lang_local_name FROM ' . LANG_TABLE . ' ORDER BY lang_english_name'; - $result = $db->sql_query($sql, 600); + $result = $db->sql_query($sql); $lang_options = ''; while ($row = $db->sql_fetchrow($result)) diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index de78969c3f..676b2c9518 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -895,12 +895,25 @@ class session $quads = explode('.', $ip); $reverse_ip = $quads[3] . '.' . $quads[2] . '.' . $quads[1] . '.' . $quads[0]; + // Need to be listed on all servers... + $listed = true; + $info = array(); + foreach ($dnsbl_check as $dnsbl => $lookup) { if (phpbb_checkdnsrr($reverse_ip . '.' . $dnsbl . '.', 'A') === true) { - return array($dnsbl, $lookup . $ip); + $info = array($dnsbl, $lookup . $ip); } + else + { + $listed = false; + } + } + + if ($listed) + { + return $info; } } diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 17e421505b..916c1b78d9 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -490,7 +490,7 @@ class ucp_register 'L_CONFIRM_EXPLAIN' => sprintf($user->lang['CONFIRM_EXPLAIN'], '', ''), 'L_REG_COND' => $l_reg_cond, 'L_USERNAME_EXPLAIN' => sprintf($user->lang[$user_char_ary[str_replace('\\\\', '\\', $config['allow_name_chars'])] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']), - 'L_NEW_PASSWORD_EXPLAIN' => sprintf($user->lang[$pass_char_ary[str_replace('\\\\', '\\', $config['pass_complex'])] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']), + 'L_PASSWORD_EXPLAIN' => sprintf($user->lang[$pass_char_ary[str_replace('\\\\', '\\', $config['pass_complex'])] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']), 'S_LANG_OPTIONS' => language_select($data['lang']), 'S_TZ_OPTIONS' => tz_select($data['tz']), diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index a45f7af083..40ea5cc8e4 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -220,8 +220,6 @@ $lang = array_merge($lang, array( 'EXPORT_DOWNLOAD' => 'Download', 'EXPORT_STORE' => 'Store', - 'FORUM_INDEX' => 'Forum index', - 'GENERAL_OPTIONS' => 'General options', 'GENERAL_SETTINGS' => 'General settings', 'GLOBAL_MASK' => 'Global permission mask', diff --git a/phpBB/styles/subSilver/template/ucp_register.html b/phpBB/styles/subSilver/template/ucp_register.html index ccbcb4505f..7d79f93aec 100644 --- a/phpBB/styles/subSilver/template/ucp_register.html +++ b/phpBB/styles/subSilver/template/ucp_register.html @@ -50,7 +50,7 @@ - {L_NEW_PASSWORD}:
{L_NEW_PASSWORD_EXPLAIN} + {L_PASSWORD}:
{L_PASSWORD_EXPLAIN} diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 9d6da5c31c..41ed374c3b 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -241,9 +241,6 @@ $post_alt = ($forum_data['forum_status'] == ITEM_LOCKED) ? $user->lang['FORUM_LO $s_display_active = ($forum_data['forum_type'] == FORUM_CAT && ($forum_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS)) ? true : false; $template->assign_vars(array( - 'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&$u_sort_param"), $topics_count, $config['topics_per_page'], $start), - 'PAGE_NUMBER' => on_page($topics_count, $config['topics_per_page'], $start), - 'TOTAL_TOPICS' => ($s_display_active) ? false : (($topics_count == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $topics_count)), 'MODERATORS' => (!empty($moderators[$forum_id])) ? implode(', ', $moderators[$forum_id]) : '', 'POST_IMG' => ($forum_data['forum_status'] == ITEM_LOCKED) ? $user->img('button_topic_locked', $post_alt) : $user->img('button_topic_new', $post_alt), @@ -441,6 +438,17 @@ if (sizeof($shadow_topic_list)) { $orig_topic_id = $shadow_topic_list[$row['topic_id']]; + // Do not include those topics the user has no permission to access + if (!$auth->acl_get('f_read', $row['forum_id'])) + { + // We need to remove any trace regarding this topic. :) + unset($rowset[$orig_topic_id]); + unset($topic_list[array_search($orig_topic_id, $topic_list)]); + $topics_count--; + + continue; + } + // We want to retain some values $row = array_merge($row, array( 'topic_moved_id' => $rowset[$orig_topic_id]['topic_moved_id'], @@ -453,6 +461,12 @@ if (sizeof($shadow_topic_list)) } unset($shadow_topic_list); +$template->assign_vars(array( + 'PAGINATION' => generate_pagination(append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&$u_sort_param"), $topics_count, $config['topics_per_page'], $start), + 'PAGE_NUMBER' => on_page($topics_count, $config['topics_per_page'], $start), + 'TOTAL_TOPICS' => ($s_display_active) ? false : (($topics_count == 1) ? $user->lang['VIEW_FORUM_TOPIC'] : sprintf($user->lang['VIEW_FORUM_TOPICS'], $topics_count))) +); + $topic_list = ($store_reverse) ? array_merge($announcement_list, array_reverse($topic_list)) : array_merge($announcement_list, $topic_list); $topic_tracking_info = $tracking_topics = array(); From d76c4d54a13aee7ee58d7ef402b5dd63b674dcef Mon Sep 17 00:00:00 2001 From: David M Date: Thu, 7 Dec 2006 02:30:33 +0000 Subject: [PATCH 040/264] - do data validation via is_int instead of preg_match, ctype has bugs so it can't be trusted git-svn-id: file:///svn/phpbb/trunk@6720 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/utf/utf_tools.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/utf/utf_tools.php b/phpBB/includes/utf/utf_tools.php index d4277e1f20..e192214d88 100644 --- a/phpBB/includes/utf/utf_tools.php +++ b/phpBB/includes/utf/utf_tools.php @@ -625,7 +625,7 @@ else */ function utf8_str_split($str, $split_len = 1) { - if (!preg_match('/^[0-9]+$/', $split_len) || $split_len < 1) + if (!is_int($split_len) || $split_len < 1) { return false; } From c6c994eaefab891069ead91cd3e426b83b428663 Mon Sep 17 00:00:00 2001 From: David M Date: Thu, 7 Dec 2006 02:52:09 +0000 Subject: [PATCH 041/264] - removed a regex that made no sense git-svn-id: file:///svn/phpbb/trunk@6721 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/utf/utf_tools.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/phpBB/includes/utf/utf_tools.php b/phpBB/includes/utf/utf_tools.php index e192214d88..5453a3f985 100644 --- a/phpBB/includes/utf/utf_tools.php +++ b/phpBB/includes/utf/utf_tools.php @@ -648,8 +648,6 @@ function utf8_str_split($str, $split_len = 1) */ function utf8_strspn($str, $mask, $start = null, $length = null) { - $mask = preg_replace('!([\\\\\\-\\]\\[/^])!', '\\\${1}', $mask); - if ($start !== null || $length !== null) { $str = utf8_substr($str, $start, $length); From c848979cdd668d4188ef921ee2f214cef595abf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Thu, 7 Dec 2006 11:58:50 +0000 Subject: [PATCH 042/264] No need to show the current messages / total messages data when unlimited private messages are allowed. git-svn-id: file:///svn/phpbb/trunk@6722 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/styles/subSilver/template/ucp_pm_message_header.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/phpBB/styles/subSilver/template/ucp_pm_message_header.html b/phpBB/styles/subSilver/template/ucp_pm_message_header.html index f3c5cc828b..d73d744c15 100644 --- a/phpBB/styles/subSilver/template/ucp_pm_message_header.html +++ b/phpBB/styles/subSilver/template/ucp_pm_message_header.html @@ -9,7 +9,11 @@ - + + + + +
 [ {FOLDER_CUR_MESSAGES}/{FOLDER_MAX_MESSAGES} {L_MESSAGES} ({FOLDER_PERCENT}%) ]  [ {FOLDER_CUR_MESSAGES}/{FOLDER_MAX_MESSAGES} {L_MESSAGES} ({FOLDER_PERCENT}%) ]  [ {FOLDER_CUR_MESSAGES} {L_MESSAGES} ] 
From 7428cdfd8542adf7e11e8e94575aeaf3ad0abb57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Thu, 7 Dec 2006 12:40:55 +0000 Subject: [PATCH 043/264] Do not display the "You have reached your blah blah folder limit" when the administrator has set the limit to 0. Existing folders that were created before the limit was set to 0 can still be edited. This only affects the "Add folder" section. git-svn-id: file:///svn/phpbb/trunk@6723 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/ucp/ucp_pm_options.php | 1 + phpBB/language/en/ucp.php | 2 +- phpBB/styles/subSilver/template/ucp_pm_options.html | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/ucp/ucp_pm_options.php b/phpBB/includes/ucp/ucp_pm_options.php index 9ce7f87740..da451b999c 100644 --- a/phpBB/includes/ucp/ucp_pm_options.php +++ b/phpBB/includes/ucp/ucp_pm_options.php @@ -430,6 +430,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit 'S_HOLD_CHECKED' => $s_hold_checked, 'S_MOVE_CHECKED' => $s_move_checked, 'S_MAX_FOLDER_REACHED' => ($num_user_folder >= $config['pm_max_boxes']) ? true : false, + 'S_MAX_FOLDER_ZERO' => ($config['pm_max_boxes'] == 0) ? true : false, 'DEFAULT_ACTION' => ($config['full_folder_action'] == 1) ? $user->lang['DELETE_OLDEST_MESSAGES'] : $user->lang['HOLD_NEW_MESSAGES'], diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index fceafdaf02..2b999df15c 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -245,7 +245,7 @@ $lang = array_merge($lang, array( 'MARK_IMPORTANT' => 'Mark as important', 'MARKED_MESSAGE' => 'Marked message', - 'MAX_FOLDER_REACHED' => 'Maximum number of allowed user defined folder reached', + 'MAX_FOLDER_REACHED' => 'Maximum number of allowed user defined folders reached', 'MESSAGE_BY_AUTHOR' => 'by', 'MESSAGE_COLOURS' => 'Message colours', 'MESSAGE_DELETED' => 'Message successfully deleted', diff --git a/phpBB/styles/subSilver/template/ucp_pm_options.html b/phpBB/styles/subSilver/template/ucp_pm_options.html index 05040e529a..ab3b6b9a26 100644 --- a/phpBB/styles/subSilver/template/ucp_pm_options.html +++ b/phpBB/styles/subSilver/template/ucp_pm_options.html @@ -113,6 +113,7 @@
+ @@ -131,6 +132,7 @@
{L_ADD_FOLDER}
+
From 277910a016ccb5a2250af659f228f0d4cb89ba32 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 7 Dec 2006 15:11:28 +0000 Subject: [PATCH 044/264] #6024 git-svn-id: file:///svn/phpbb/trunk@6724 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/acp_reasons.html | 2 +- phpBB/includes/functions_display.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/adm/style/acp_reasons.html b/phpBB/adm/style/acp_reasons.html index 4aaf7328e7..a9c314e564 100644 --- a/phpBB/adm/style/acp_reasons.html +++ b/phpBB/adm/style/acp_reasons.html @@ -64,7 +64,7 @@

{L_ACP_REASONS_EXPLAIN}

-
+
{L_ACP_REASONS} diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 663b6bfe19..e875fade70 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1007,7 +1007,7 @@ function display_reasons($reason_id = 0) // If the reason is defined within the language file, we will use the localized version, else just use the database entry... if (isset($user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])]) && isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])])) { - $row['reson_description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])]; + $row['reason_description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])]; $row['reason_title'] = $user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])]; } From 7f3114364df5bf425c65d0e6da655ed67741f69c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Thu, 7 Dec 2006 16:55:50 +0000 Subject: [PATCH 045/264] I really hate embed, but I guess there is no way around it apart from dirty object hacks. Please note that this might break everything below Media Player 7, but as we are at 11 now, this should be fine. #5744 git-svn-id: file:///svn/phpbb/trunk@6725 89ea8834-ac86-4346-8a33-228a782c2dd0 --- .../styles/subSilver/template/attachment.html | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/phpBB/styles/subSilver/template/attachment.html b/phpBB/styles/subSilver/template/attachment.html index 2f4ac0d268..6d1c20b43d 100644 --- a/phpBB/styles/subSilver/template/attachment.html +++ b/phpBB/styles/subSilver/template/attachment.html @@ -28,18 +28,24 @@ - - - - - - - - - - - - + + + + + + + From 3886559e8331f59c9633a0ec9c915b1e1e84db12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Thu, 7 Dec 2006 17:05:52 +0000 Subject: [PATCH 046/264] #5822 Thanks to TerraFrost for this fix! :) git-svn-id: file:///svn/phpbb/trunk@6726 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/styles/subSilver/template/editor.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/phpBB/styles/subSilver/template/editor.js b/phpBB/styles/subSilver/template/editor.js index 54e7e61f3a..c6542aac89 100644 --- a/phpBB/styles/subSilver/template/editor.js +++ b/phpBB/styles/subSilver/template/editor.js @@ -18,6 +18,9 @@ var is_nav = ((clientPC.indexOf('mozilla') != -1) && (clientPC.indexOf('spoofer' var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1)); var is_mac = (clientPC.indexOf('mac') != -1); +var baseHeight; +window.onload = initInsertions; + /** * Shows the help messages in the helpline window */ @@ -64,6 +67,19 @@ function arraypop(thearray) return retval; } +/** +* Fix a bug involving the TextRange object. From +* http://www.frostjedi.com/terra/scripts/demo/caretBug.html +*/ +function initInsertions() +{ + document.post.message.focus(); + if (is_ie && typeof(baseHeight) != 'number') + { + baseHeight = document.selection.createRange().duplicate().boundingHeight; + } +} + /** * bbstyle @@ -168,6 +184,11 @@ function insert_text(text, spaces, popup) else if (textarea.createTextRange && textarea.caretPos) { + if (baseHeight != textarea.caretPos.boundingHeight) + { + textarea.focus(); + storeCaret(textarea); + } var caret_pos = textarea.caretPos; caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text; From ac5b7a578fd9650f5c724c8c0415a29621aa9fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Thu, 7 Dec 2006 17:11:37 +0000 Subject: [PATCH 047/264] oopsie git-svn-id: file:///svn/phpbb/trunk@6727 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/styles/subSilver/template/editor.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/phpBB/styles/subSilver/template/editor.js b/phpBB/styles/subSilver/template/editor.js index c6542aac89..60c1b30013 100644 --- a/phpBB/styles/subSilver/template/editor.js +++ b/phpBB/styles/subSilver/template/editor.js @@ -19,7 +19,7 @@ var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != - var is_mac = (clientPC.indexOf('mac') != -1); var baseHeight; -window.onload = initInsertions; +window.onload = initInsertions(); /** * Shows the help messages in the helpline window @@ -73,10 +73,13 @@ function arraypop(thearray) */ function initInsertions() { - document.post.message.focus(); - if (is_ie && typeof(baseHeight) != 'number') + if(is_ie) { - baseHeight = document.selection.createRange().duplicate().boundingHeight; + document.post.message.focus(); + if (is_ie && typeof(baseHeight) != 'number') + { + baseHeight = document.selection.createRange().duplicate().boundingHeight; + } } } From dddffa234796608a167b2e6804baf6359633562c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Thu, 7 Dec 2006 17:35:26 +0000 Subject: [PATCH 048/264] Blah, so obvious git-svn-id: file:///svn/phpbb/trunk@6728 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/styles/subSilver/template/editor.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/phpBB/styles/subSilver/template/editor.js b/phpBB/styles/subSilver/template/editor.js index 60c1b30013..dfd992974d 100644 --- a/phpBB/styles/subSilver/template/editor.js +++ b/phpBB/styles/subSilver/template/editor.js @@ -19,7 +19,7 @@ var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != - var is_mac = (clientPC.indexOf('mac') != -1); var baseHeight; -window.onload = initInsertions(); +window.onload = initInsertions; /** * Shows the help messages in the helpline window @@ -73,13 +73,11 @@ function arraypop(thearray) */ function initInsertions() { - if(is_ie) + var textarea = document.forms[form_name].elements[text_name]; + textarea.focus(); + if (is_ie && typeof(baseHeight) != 'number') { - document.post.message.focus(); - if (is_ie && typeof(baseHeight) != 'number') - { - baseHeight = document.selection.createRange().duplicate().boundingHeight; - } + baseHeight = document.selection.createRange().duplicate().boundingHeight; } } From 4519c510663b5c5168d6594d9eb96819a0c6bae0 Mon Sep 17 00:00:00 2001 From: David M Date: Fri, 8 Dec 2006 00:08:46 +0000 Subject: [PATCH 049/264] #6076 - removed unused junk from functions.php git-svn-id: file:///svn/phpbb/trunk@6729 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 14 +++++++++----- phpBB/includes/functions_display.php | 4 +--- phpBB/includes/ucp/ucp_register.php | 7 ++++++- phpBB/posting.php | 7 ++++++- 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 1a3cb559f2..3b0cd9a055 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1905,12 +1905,17 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa $confirm_id = md5(unique_id($user->ip)); $seed = hexdec(substr(unique_id(), 4, 10)); + if ($seed > 0x7FFFFFFF) + { + $seed -= 0x7FFFFFFF; + } + $sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'confirm_id' => (string) $confirm_id, 'session_id' => (string) $user->session_id, 'confirm_type' => (int) CONFIRM_LOGIN, 'code' => (string) $code, - 'seed' => (float) $seed) + 'seed' => (int) $seed) ); $db->sql_query($sql); @@ -2795,7 +2800,7 @@ function get_username_string($mode, $user_id, $username, $username_colour = '', { global $phpbb_root_path, $phpEx, $user; - $full_string = $profile_url = ''; + $profile_url = ''; $username_colour = ($username_colour) ? '#' . $username_colour : ''; if ($guest_username === false) @@ -2918,7 +2923,7 @@ function phpbb_checkdnsrr($host, $type = '') function msg_handler($errno, $msg_text, $errfile, $errline) { global $cache, $db, $auth, $template, $config, $user; - global $phpEx, $phpbb_root_path, $starttime, $msg_title, $msg_long_text; + global $phpEx, $phpbb_root_path, $msg_title, $msg_long_text; // Message handler is stripping text. In case we need it, we are possible to define long text... if (isset($msg_long_text) && $msg_long_text && !$msg_text) @@ -3097,7 +3102,6 @@ function page_header($page_title = '', $display_online_list = true) if ($config['load_online'] && $config['load_online_time'] && $display_online_list) { - $userlist_ary = $userlist_visible = array(); $logged_visible_online = $logged_hidden_online = $guests_online = $prev_user_id = 0; $prev_session_ip = $reading_sql = ''; @@ -3417,7 +3421,7 @@ function page_header($page_title = '', $display_online_list = true) */ function page_footer($run_cron = true) { - global $db, $config, $template, $user, $auth, $cache, $messenger, $starttime, $phpbb_root_path, $phpEx; + global $db, $config, $template, $user, $auth, $cache, $starttime, $phpbb_root_path, $phpEx; // Output page creation time if (defined('DEBUG')) diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index e875fade70..4c16029803 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -47,7 +47,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $show_active = (isset($root_data['forum_flags']) && ($root_data['forum_flags'] & FORUM_FLAG_ACTIVE_TOPICS)) ? true : false; $sql_from = FORUMS_TABLE . ' f '; - $lastread_select = $sql_lastread = ''; + $lastread_select = ''; if ($config['load_db_lastread'] && $user->data['is_registered']) { @@ -846,8 +846,6 @@ function display_attachments($forum_id, $blockname, &$attachment_data, &$update_ $download_link = (!$force_physical && $attachment['attach_id']) ? append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $attachment['attach_id'] . '&f=' . $forum_id) : $filename; - $download_link_full = (!$force_physical && $attachment['attach_id']) ? generate_board_url() . append_sid("/download.$phpEx", 'id=' . $attachment['attach_id'] . '&f=' . $forum_id) : generate_board_url() . $filename; - switch ($display_cat) { // Images diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 916c1b78d9..b4b28e8a1e 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -443,12 +443,17 @@ class ucp_register $confirm_id = md5(unique_id($user->ip)); $seed = hexdec(substr(unique_id(), 4, 10)); + if ($seed > 0x7FFFFFFF) + { + $seed -= 0x7FFFFFFF; + } + $sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'confirm_id' => (string) $confirm_id, 'session_id' => (string) $user->session_id, 'confirm_type' => (int) CONFIRM_REG, 'code' => (string) $code, - 'seed' => (float) $seed) + 'seed' => (int) $seed) ); $db->sql_query($sql); } diff --git a/phpBB/posting.php b/phpBB/posting.php index 663a96591f..9b33a9ab62 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1130,12 +1130,17 @@ if ($config['enable_post_confirm'] && !$user->data['is_registered'] && $solved_c $confirm_id = md5(unique_id($user->ip)); $seed = hexdec(substr(unique_id(), 4, 10)); + if ($seed > 0x7FFFFFFF) + { + $seed -= 0x7FFFFFFF; + } + $sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'confirm_id' => (string) $confirm_id, 'session_id' => (string) $user->session_id, 'confirm_type' => (int) CONFIRM_POST, 'code' => (string) $code, - 'seed' => (float) $seed) + 'seed' => (int) $seed) ); $db->sql_query($sql); From 1c41450bd90f86f47521952e7f48339f103b8e5d Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 8 Dec 2006 15:20:57 +0000 Subject: [PATCH 050/264] - re-add script_path for "strange configurations" to let them force the generated urls correctly - show rank title if no rank image present in memberlist - other fixes. git-svn-id: file:///svn/phpbb/trunk@6730 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/index.php | 33 ++++++++++++++- phpBB/includes/acp/acp_board.php | 16 +++++--- phpBB/includes/acp/acp_inactive.php | 6 +-- phpBB/includes/functions.php | 14 +++++-- phpBB/includes/functions_transfer.php | 14 +++++-- phpBB/includes/message_parser.php | 9 ++++- phpBB/includes/ucp/ucp_profile.php | 2 +- phpBB/includes/ucp/ucp_resend.php | 2 +- phpBB/install/database_update.php | 8 ++++ phpBB/install/install_install.php | 40 +++++++++++++++---- phpBB/install/install_update.php | 3 +- phpBB/install/schemas/schema_data.sql | 1 + phpBB/language/en/acp/board.php | 4 +- phpBB/language/en/install.php | 2 +- phpBB/memberlist.php | 8 ++-- .../subSilver/template/memberlist_body.html | 4 +- 16 files changed, 130 insertions(+), 36 deletions(-) diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index 907fed3681..beba6d00a6 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -408,6 +408,35 @@ function validate_config_vars($config_vars, &$cfg_array, &$error) $cfg_array[$config_name] = (int) $cfg_array[$config_name]; break; + // Absolute path + case 'script_path': + if (!$cfg_array[$config_name]) + { + break; + } + + $destination = str_replace('\\', '/', $cfg_array[$config_name]); + + if ($destination !== '/') + { + // Adjust destination path (no trailing slash) + if (substr($destination, -1, 1) == '/') + { + $destination = substr($destination, 0, -1); + } + + $destination = str_replace(array('../', './'), '', $destination); + + if ($destination[0] != '/') + { + $destination = '/' . $destination; + } + } + + $cfg_array[$config_name] = trim($destination); + + break; + // Relative path (appended $phpbb_root_path) case 'rpath': case 'rwpath': @@ -419,9 +448,9 @@ function validate_config_vars($config_vars, &$cfg_array, &$error) $destination = $cfg_array[$config_name]; // Adjust destination path (no trailing slash) - if ($destination{(sizeof($destination)-1)} == '/' || $destination{(sizeof($destination)-1)} == '\\') + if (substr($destination, -1, 1) == '/' || substr($destination, -1, 1) == '\\') { - $destination = substr($destination, 0, sizeof($destination)-2); + $destination = substr($destination, 0, -1); } $destination = str_replace(array('../', '..\\', './', '.\\'), '', $destination); diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 92f8057676..d67cfba2f3 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -27,7 +27,12 @@ class acp_board $action = request_var('action', ''); $submit = (isset($_POST['submit'])) ? true : false; - // Validation types are: string, int, bool, rpath (relative), rwpath (realtive, writeable), path (relative path, but able to escape the root), wpath (writeable) + /** + * Validation types are: + * string, int, bool, + * script_path (absolute path in url - beginning with / and no trailing slash), + * rpath (relative), rwpath (realtive, writeable), path (relative path, but able to escape the root), wpath (writeable) + */ switch ($mode) { case 'settings': @@ -283,10 +288,11 @@ class acp_board 'ranks_path' => array('lang' => 'RANKS_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true), 'legend3' => 'SERVER_URL_SETTINGS', - 'force_server_vars' => array('lang' => 'FORCE_SERVER_VARS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), - 'server_protocol' => array('lang' => 'SERVER_PROTOCOL', 'validate' => 'string', 'type' => 'text:10:10', 'explain' => true), - 'server_name' => array('lang' => 'SERVER_NAME', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true), - 'server_port' => array('lang' => 'SERVER_PORT', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true), + 'force_server_vars' => array('lang' => 'FORCE_SERVER_VARS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'server_protocol' => array('lang' => 'SERVER_PROTOCOL', 'validate' => 'string', 'type' => 'text:10:10', 'explain' => true), + 'server_name' => array('lang' => 'SERVER_NAME', 'validate' => 'string', 'type' => 'text:40:255', 'explain' => true), + 'server_port' => array('lang' => 'SERVER_PORT', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true), + 'script_path' => array('lang' => 'SCRIPT_PATH', 'validate' => 'script_path', 'type' => 'text::255', 'explain' => true), ) ); break; diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php index 68eeaab5b4..84387b4f5c 100755 --- a/phpBB/includes/acp/acp_inactive.php +++ b/phpBB/includes/acp/acp_inactive.php @@ -94,10 +94,8 @@ class acp_inactive include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx); $messenger = new messenger(); - - $board_url = generate_board_url() . "/ucp.$phpEx?mode=activate"; - $usernames = array(); + do { $messenger->template('user_remind_inactive', $row['user_lang']); @@ -109,7 +107,7 @@ class acp_inactive $messenger->assign_vars(array( 'USERNAME' => htmlspecialchars_decode($row['username']), 'REGISTER_DATE' => $user->format_date($row['user_regdate']), - 'U_ACTIVATE' => "$board_url&mode=activate&u=" . $row['user_id'] . '&k=' . $row['user_actkey']) + 'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u=" . $row['user_id'] . '&k=' . $row['user_actkey']) ); $messenger->send($row['user_notify_type']); diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 3b0cd9a055..4c417cc03e 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1451,6 +1451,7 @@ function generate_board_url($without_script_path = false) $server_protocol = ($config['server_protocol']) ? $config['server_protocol'] : (($config['cookie_secure']) ? 'https://' : 'http://'); $server_name = $config['server_name']; $server_port = (int) $config['server_port']; + $script_path = $config['script_path']; $url = $server_protocol . $server_name; } @@ -1459,6 +1460,8 @@ function generate_board_url($without_script_path = false) // Do not rely on cookie_secure, users seem to think that it means a secured cookie instead of an encrypted connection $cookie_secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 1 : 0; $url = (($cookie_secure) ? 'https://' : 'http://') . $server_name; + + $script_path = $user->page['root_script_path']; } if ($server_port && (($config['cookie_secure'] && $server_port <> 443) || (!$config['cookie_secure'] && $server_port <> 80))) @@ -1466,13 +1469,18 @@ function generate_board_url($without_script_path = false) $url .= ':' . $server_port; } - if ($without_script_path) + if (!$without_script_path) { - return $url; + $url .= $script_path; } // Strip / from the end - return $url . substr($user->page['root_script_path'], 0, -1); + if (substr($url, -1, 1) == '/') + { + $url = substr($url, 0, -1); + } + + return $url; } /** diff --git a/phpBB/includes/functions_transfer.php b/phpBB/includes/functions_transfer.php index 4c47f99412..8c00f2b1dd 100644 --- a/phpBB/includes/functions_transfer.php +++ b/phpBB/includes/functions_transfer.php @@ -359,9 +359,12 @@ class ftp extends transfer */ function _chdir($dir = '') { - if (substr($dir, -1, 1) == '/') + if ($dir && $dir !== '/') { - $dir = substr($dir, 0, -1); + if (substr($dir, -1, 1) == '/') + { + $dir = substr($dir, 0, -1); + } } return @ftp_chdir($this->connection, $dir); @@ -585,9 +588,12 @@ class ftp_fsock extends transfer */ function _chdir($dir = '') { - if (substr($dir, -1, 1) == '/') + if ($dir && $dir !== '/') { - $dir = substr($dir, 0, -1); + if (substr($dir, -1, 1) == '/') + { + $dir = substr($dir, 0, -1); + } } return $this->_send_command('CWD', $dir); diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 285b0d0649..ed6f69cf49 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -840,7 +840,14 @@ class bbcode_firstpass extends bbcode { global $config, $phpEx, $user; - $check_path = ($user->page['root_script_path'] != '/') ? substr($user->page['root_script_path'], 0, -1) : '/'; + if ($config['force_server_vars']) + { + $check_path = $config['script_path']; + } + else + { + $check_path = ($user->page['root_script_path'] != '/') ? substr($user->page['root_script_path'], 0, -1) : '/'; + } // Is the user trying to link to a php file in this domain and script path? if (strpos($url, ".{$phpEx}") !== false && strpos($url, $check_path) !== false) diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 29055f0d89..cfd6f217c0 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -173,7 +173,7 @@ class ucp_profile $messenger->assign_vars(array( 'USERNAME' => htmlspecialchars_decode($data['username']), - 'U_USER_DETAILS' => "$server_url/memberlist.$phpEx?mode=viewprofile&u={$user->data['user_id']}", + 'U_USER_DETAILS' => "$server_url/memberlist.$phpEx?mode=viewprofile&u={$user->data['user_id']}", 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u={$user->data['user_id']}&k=$user_actkey") ); diff --git a/phpBB/includes/ucp/ucp_resend.php b/phpBB/includes/ucp/ucp_resend.php index fe5801b37d..c61859b3e2 100644 --- a/phpBB/includes/ucp/ucp_resend.php +++ b/phpBB/includes/ucp/ucp_resend.php @@ -113,7 +113,7 @@ class ucp_resend $messenger->assign_vars(array( 'USERNAME' => htmlspecialchars_decode($user_row['username']), - 'U_USER_DETAILS' => "$server_url/memberlist.$phpEx?mode=viewprofile&u={$user->data['user_id']}", + 'U_USER_DETAILS' => generate_board_url() . "/memberlist.$phpEx?mode=viewprofile&u={$user->data['user_id']}", 'U_ACTIVATE' => generate_board_url() . "/ucp.$phpEx?mode=activate&u={$user_row['user_id']}&k={$user_row['user_actkey']}") ); diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index dae441f40b..e5c0998be5 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -490,6 +490,14 @@ if (version_compare($current_version, '3.0.b3', '<')) $no_updates = false; } +if (version_compare($current_version, '3.0.b4', '<')) +{ + // Add config value + set_config('script_path', '/'); + + $no_updates = false; +} + _write_result($no_updates, $errored, $error_ary); $error_ary = array(); diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index e88e13a05e..f5cf049327 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -987,6 +987,19 @@ class install_install extends module $server_protocol = ($server_protocol !== '') ? $server_protocol : ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://'); $cookie_secure = ($cookie_secure !== '') ? $cookie_secure : ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? true : false); + if ($script_path === '') + { + $name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF'); + if (!$name) + { + $name = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : getenv('REQUEST_URI'); + } + + // Replace backslashes and doubled slashes (could happen on some proxy setups) + $name = str_replace(array('\\', '//', '/install'), '/', $name); + $script_path = trim(dirname($name)); + } + foreach ($this->advanced_config_options as $config_key => $vars) { if (!is_array($vars) && strpos($config_key, 'legend') === false) @@ -1166,6 +1179,22 @@ class install_install extends module $user_ip = (!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars($_SERVER['REMOTE_ADDR']) : ''; + if ($script_path !== '/') + { + // Adjust destination path (no trailing slash) + if ($script_path[sizeof($script_path) - 1] == '/') + { + $script_path = substr($script_path, 0, -1); + } + + $script_path = str_replace(array('../', './'), '', $script_path); + + if ($script_path[0] != '/') + { + $script_path = '/' . $script_path; + } + } + // Set default config and post data, this applies to all DB's $sql_ary = array( 'INSERT INTO ' . $table_prefix . "config (config_name, config_value) @@ -1235,17 +1264,13 @@ class install_install extends module WHERE config_name = 'force_server_vars'", 'UPDATE ' . $table_prefix . "config - SET config_value = '" . $db->sql_escape($server_name) . "' - WHERE config_name = 'server_name'", + SET config_value = '" . $db->sql_escape($script_path) . "' + WHERE config_name = 'script_path'", 'UPDATE ' . $table_prefix . "config SET config_value = '" . $db->sql_escape($server_protocol) . "' WHERE config_name = 'server_protocol'", - 'UPDATE ' . $table_prefix . "config - SET config_value = '" . $db->sql_escape($server_port) . "' - WHERE config_name = 'server_port'", - 'UPDATE ' . $table_prefix . "config SET config_value = '" . $db->sql_escape($admin_name) . "' WHERE config_name = 'newest_username'", @@ -2025,7 +2050,7 @@ class install_install extends module * The variables that we will be passing between pages * Used to retrieve data quickly on each page */ - var $request_vars = array('language', 'dbms', 'dbhost', 'dbport', 'dbuser', 'dbpasswd', 'dbname', 'table_prefix', 'default_lang', 'admin_name', 'admin_pass1', 'admin_pass2', 'board_email1', 'board_email2', 'img_imagick', 'ftp_path', 'ftp_user', 'ftp_pass', 'email_enable', 'smtp_delivery', 'smtp_host', 'smtp_auth', 'smtp_user', 'smtp_pass', 'cookie_secure', 'force_server_vars', 'server_protocol', 'server_name', 'server_port'); + var $request_vars = array('language', 'dbms', 'dbhost', 'dbport', 'dbuser', 'dbpasswd', 'dbname', 'table_prefix', 'default_lang', 'admin_name', 'admin_pass1', 'admin_pass2', 'board_email1', 'board_email2', 'img_imagick', 'ftp_path', 'ftp_user', 'ftp_pass', 'email_enable', 'smtp_delivery', 'smtp_host', 'smtp_auth', 'smtp_user', 'smtp_pass', 'cookie_secure', 'force_server_vars', 'server_protocol', 'server_name', 'server_port', 'script_path'); /** * The information below will be used to build the input fields presented to the user @@ -2064,6 +2089,7 @@ class install_install extends module 'server_protocol' => array('lang' => 'SERVER_PROTOCOL', 'type' => 'text:10:10', 'explain' => true), 'server_name' => array('lang' => 'SERVER_NAME', 'type' => 'text:40:255', 'explain' => true), 'server_port' => array('lang' => 'SERVER_PORT', 'type' => 'text:5:5', 'explain' => true), + 'script_path' => array('lang' => 'SCRIPT_PATH', 'type' => 'text::255', 'explain' => true), ); /** diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index 2a6de60d47..fed66a0a07 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -412,6 +412,7 @@ class install_update extends module // To ease the update process create a file location map $update_list = $cache->get('_update_list'); + $script_path = ($config['force_server_vars']) ? (($config['script_path'] == '/') ? '/' : $config['script_path'] . '/') : $user->page['root_script_path']; foreach ($update_list as $status => $files) { @@ -429,7 +430,7 @@ class install_update extends module $template->assign_block_vars('location', array( 'SOURCE' => htmlspecialchars($file_struct['filename']), - 'DESTINATION' => $user->page['root_script_path'] . htmlspecialchars($file_struct['filename']), + 'DESTINATION' => $script_path . htmlspecialchars($file_struct['filename']), )); } } diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 0cea5a5f72..795ca8becd 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -170,6 +170,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('print_pm', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('queue_interval', '600'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('ranks_path', 'images/ranks'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('require_activation', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('script_path', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_block_size', '250'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_gc', '7200'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_indexing_state', ''); diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index c5c31767c6..e34c65bf90 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -249,7 +249,7 @@ $lang = array_merge($lang, array( 'LIMIT_LOAD_EXPLAIN' => 'If the 1 minute system load exceeds this value the board will go offline, 1.0 equals ~100% utilisation of one processor. This only functions on UNIX based servers.', 'LIMIT_SESSIONS' => 'Limit sessions', 'LIMIT_SESSIONS_EXPLAIN' => 'If the number of sessions exceeds this value within a one minute period the board will go offline. Set to 0 for unlimited sessions.', - 'LOAD_CPF_MEMBERLIST' => 'Display custom profile fields in memberlist', + 'LOAD_CPF_MEMBERLIST' => 'Allow styles to display custom profile fields in memberlist', 'LOAD_CPF_VIEWPROFILE' => 'Display custom profile fields in user profiles', 'LOAD_CPF_VIEWTOPIC' => 'Display custom profile fields on viewtopic', 'LOAD_USER_ACTIVITY' => 'Show users activity', @@ -305,6 +305,8 @@ $lang = array_merge($lang, array( 'PATH_SETTINGS' => 'Path settings', 'RANKS_PATH' => 'Rank image storage path', 'RANKS_PATH_EXPLAIN' => 'Path under your phpBB root dir, e.g. images/ranks', + 'SCRIPT_PATH' => 'Script path', + 'SCRIPT_PATH_EXPLAIN' => 'The path where phpBB is located relative to the domain name, e.g. /phpBB3', 'SEND_ENCODING' => 'Send encoding', 'SEND_ENCODING_EXPLAIN' => 'Send the file encoding from phpBB via HTTP overriding the webserver configuration', 'SERVER_NAME' => 'Domain name', diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 08c07cdeb8..b0a8171dc1 100755 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -259,7 +259,7 @@ $lang = array_merge($lang, array( 'RETRY_WRITE_EXPLAIN' => 'If you wish you can change the permissions on config.php to allow phpBB to write to it. Should you wish to do that you can click Retry below to try again. Remember to return the permissions on config.php after phpBB has finished installation.', 'SCRIPT_PATH' => 'Script path', - 'SCRIPT_PATH_EXPLAIN' => 'The path where phpBB is located relative to the domain name', + 'SCRIPT_PATH_EXPLAIN' => 'The path where phpBB is located relative to the domain name, e.g. /phpBB3', 'SELECT_LANG' => 'Select language', 'SERVER_CONFIG' => 'Server Configuration', 'SOFTWARE' => 'Forum Software', diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 8b35a162e5..6b8455ef3b 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -1444,14 +1444,17 @@ function show_profile($data) // Dump it out to the template return array( 'AGE' => $age, - 'USERNAME' => $username, - 'USER_COLOR' => (!empty($data['user_colour'])) ? $data['user_colour'] : '', 'RANK_TITLE' => $rank_title, 'JOINED' => $user->format_date($data['user_regdate']), 'VISITED' => (empty($last_visit)) ? ' - ' : $user->format_date($last_visit), 'POSTS' => ($data['user_posts']) ? $data['user_posts'] : 0, 'WARNINGS' => isset($data['user_warnings']) ? $data['user_warnings'] : 0, + 'USERNAME_FULL' => get_username_string('full', $user_id, $username, $data['user_colour']), + 'USERNAME' => get_username_string('username', $user_id, $username, $data['user_colour']), + 'USER_COLOR' => get_username_string('colour', $user_id, $username, $data['user_colour']), + 'U_VIEW_PROFILE' => get_username_string('profile', $user_id, $username, $data['user_colour']), + 'ONLINE_IMG' => (!$config['load_onlinetrack']) ? '' : (($online) ? $user->img('icon_user_online', 'ONLINE') : $user->img('icon_user_offline', 'OFFLINE')), 'S_ONLINE' => ($config['load_onlinetrack'] && $online) ? true : false, 'RANK_IMG' => $rank_img, @@ -1459,7 +1462,6 @@ function show_profile($data) 'ICQ_STATUS_IMG' => (!empty($data['user_icq'])) ? '' : '', 'S_JABBER_ENABLED' => ($config['jab_enable']) ? true : false, - 'U_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $user_id), 'U_SEARCH_USER' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$user_id&sr=posts") : '', 'U_NOTES' => $auth->acl_getf_global('m_') ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $user_id, true, $user->session_id) : '', 'U_WARN' => $auth->acl_getf_global('m_warn') ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $user_id, true, $user->session_id) : '', diff --git a/phpBB/styles/subSilver/template/memberlist_body.html b/phpBB/styles/subSilver/template/memberlist_body.html index a266299932..911d980f75 100644 --- a/phpBB/styles/subSilver/template/memberlist_body.html +++ b/phpBB/styles/subSilver/template/memberlist_body.html @@ -61,10 +61,10 @@  {memberrow.ROW_NUMBER}  - style="color:#{memberrow.USER_COLOR}" href="{memberrow.U_VIEW_PROFILE}">{memberrow.USERNAME} + {memberrow.USERNAME_FULL}  {memberrow.JOINED}  {memberrow.POSTS} - {memberrow.RANK_IMG} + {memberrow.RANK_IMG}{memberrow.RANK_TITLE}  {PM_IMG}   {EMAIL_IMG}   {WWW_IMG}  From 9df6b75f325533fde4c121872a3ce62523ff2312 Mon Sep 17 00:00:00 2001 From: David M Date: Sat, 9 Dec 2006 19:17:01 +0000 Subject: [PATCH 051/264] proper solution to #6114, guarantees $seed lies below 0x7FFFFFFF git-svn-id: file:///svn/phpbb/trunk@6731 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 6 ++---- phpBB/includes/ucp/ucp_register.php | 6 ++---- phpBB/posting.php | 6 ++---- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 4c417cc03e..9cb5c215b3 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1913,10 +1913,8 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa $confirm_id = md5(unique_id($user->ip)); $seed = hexdec(substr(unique_id(), 4, 10)); - if ($seed > 0x7FFFFFFF) - { - $seed -= 0x7FFFFFFF; - } + // compute $seed % 0x7fffffff + $seed -= 0x7fffffff * floor($seed / 0x7fffffff); $sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'confirm_id' => (string) $confirm_id, diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index b4b28e8a1e..39afc8cad7 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -443,10 +443,8 @@ class ucp_register $confirm_id = md5(unique_id($user->ip)); $seed = hexdec(substr(unique_id(), 4, 10)); - if ($seed > 0x7FFFFFFF) - { - $seed -= 0x7FFFFFFF; - } + // compute $seed % 0x7fffffff + $seed -= 0x7fffffff * floor($seed / 0x7fffffff); $sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'confirm_id' => (string) $confirm_id, diff --git a/phpBB/posting.php b/phpBB/posting.php index 9b33a9ab62..fbc91b47b9 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1130,10 +1130,8 @@ if ($config['enable_post_confirm'] && !$user->data['is_registered'] && $solved_c $confirm_id = md5(unique_id($user->ip)); $seed = hexdec(substr(unique_id(), 4, 10)); - if ($seed > 0x7FFFFFFF) - { - $seed -= 0x7FFFFFFF; - } + // compute $seed % 0x7fffffff + $seed -= 0x7fffffff * floor($seed / 0x7fffffff); $sql = 'INSERT INTO ' . CONFIRM_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'confirm_id' => (string) $confirm_id, From 90457c7f8cda02a7f9466b48ce2863fa3457ee41 Mon Sep 17 00:00:00 2001 From: David M Date: Sat, 9 Dec 2006 20:05:12 +0000 Subject: [PATCH 052/264] #6118 git-svn-id: file:///svn/phpbb/trunk@6732 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_database.php | 42 +++++++++++------------------ 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index c4c282e588..18ee6c81a7 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -153,31 +153,6 @@ class acp_database break; } - if ($structure && $db->sql_layer == 'firebird') - { - $sql = 'SELECT RDB$FUNCTION_NAME, RDB$DESCRIPTION - FROM RDB$FUNCTIONS - ORDER BY RDB$FUNCTION_NAME'; - $result = $db->sql_query($sql); - - $rows = array(); - while ($row = $db->sql_fetchrow($result)) - { - $sql = 'SELECT F.RDB$FUNCTION_NAME, F.RDB$MODULE_NAME, F.RDB$ENTRYPOINT, F.RDB$RETURN_ARGUMENT, F.RDB$DESCRIPTION, FA.RDB$ARGUMENT_POSITION, FA.RDB$MECHANISM, FA.RDB$FIELD_TYPE, FA.RDB$FIELD_SCALE, FA.RDB$FIELD_LENGTH, FA.RDB$FIELD_SUB_TYPE, C.RDB$BYTES_PER_CHARACTER, C.RDB$CHARACTER_SET_NAME ,FA.RDB$FIELD_PRECISION - FROM RDB$FUNCTIONS F - LEFT JOIN RDB$FUNCTION_ARGUMENTS FA ON F.RDB$FUNCTION_NAME = FA.RDB$FUNCTION_NAME - LEFT JOIN RDB$CHARACTER_SETS C ON FA.RDB$CHARACTER_SET_ID = C.RDB$CHARACTER_SET_ID - WHERE (F.RDB$FUNCTION_NAME = ' . $row['FUNCTION_NAME'] . ') - ORDER BY FA.RDB$ARGUMENT_POSITION'; - $result2 = $db->sql_query($sql); - while ($row2 = $db->sql_fetchrow($result2)) - { - } - $db->sql_freeresult($result2); - } - $db->sql_freeresult($result); - } - foreach ($table as $table_name) { // Get the table structure @@ -1268,7 +1243,7 @@ class acp_database $pieces = split_sql_file($data, $delim); $sql_count = count($pieces); - for($i = 0; $i < $sql_count; $i++) + for ($i = 0; $i < $sql_count; $i++) { $sql = trim($pieces[$i]); @@ -1338,6 +1313,7 @@ class acp_database function get_table_structure($table_name) { global $db, $domains_created; + static $has_index_type; $sql_data = ''; @@ -1347,6 +1323,18 @@ class acp_database case 'mysql4': case 'mysql': + if ($has_index_type === null) + { + if ($db->sql_layer === 'mysqli' || version_compare($this->mysql_version, '4.0.2', '>=')) + { + $has_index_type = true; + } + else + { + $has_index_type = false; + } + } + $sql_data .= "CREATE TABLE $table_name(\n"; $rows = array(); @@ -1389,7 +1377,7 @@ class acp_database if ($kname != 'PRIMARY') { - if ($row['Index_type'] == 'FULLTEXT') + if ($has_index_type && $row['Index_type'] == 'FULLTEXT') { $kname = "FULLTEXT|$kname"; } From bf2a0e7eb2991158bee2175413148a068af4649f Mon Sep 17 00:00:00 2001 From: David M Date: Sat, 9 Dec 2006 22:47:50 +0000 Subject: [PATCH 053/264] #6130 git-svn-id: file:///svn/phpbb/trunk@6733 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_database.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 18ee6c81a7..f1449853ad 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -1028,7 +1028,7 @@ class acp_database $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { - if (strpos($row['name'], $table_prefix) === 0) + if (strlen($table_prefix) == 0 || strpos($row['name'], $table_prefix) === 0) { $tables[] = $row['name']; } @@ -1056,7 +1056,7 @@ class acp_database $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { - if (strpos($row['relname'], $table_prefix) === 0) + if (strlen($table_prefix) == 0 || strpos($row['relname'], $table_prefix) === 0) { $tables[] = $row['relname']; } @@ -1073,7 +1073,7 @@ class acp_database $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { - if (strpos($row['TABLE_NAME'], $table_prefix) === 0) + if (strlen($table_prefix) == 0 || strpos($row['TABLE_NAME'], $table_prefix) === 0) { $tables[] = $row['TABLE_NAME']; } @@ -1089,7 +1089,7 @@ class acp_database $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { - if (stripos($row['table_name'], $table_prefix) === 0) + if (strlen($table_prefix) == 0 || stripos($row['table_name'], $table_prefix) === 0) { $tables[] = $row['table_name']; } @@ -1103,7 +1103,7 @@ class acp_database $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { - if (stripos($row['table_name'], $table_prefix) === 0) + if (strlen($table_prefix) == 0 || stripos($row['table_name'], $table_prefix) === 0) { $tables[] = $row['table_name']; } From b72caf0be41c10876eabc60a1408bd9fe16dc82c Mon Sep 17 00:00:00 2001 From: David M Date: Sat, 9 Dec 2006 23:52:40 +0000 Subject: [PATCH 054/264] - tiny bit of sunshine :D git-svn-id: file:///svn/phpbb/trunk@6734 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/memberlist.php | 4 ++-- phpBB/style.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 6b8455ef3b..f7efa43691 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -940,7 +940,7 @@ switch ($mode) if ($ipdomain && $auth->acl_getf_global('m_info')) { - if (preg_match('#[a-z]#', $ipdomain)) + if (strspn($ipdomain, 'abcdefghijklmnopqrstuvwxyz')) { $hostnames = gethostbynamel($ipdomain); @@ -969,7 +969,7 @@ switch ($mode) $sql = 'SELECT DISTINCT poster_id FROM ' . POSTS_TABLE . ' - WHERE poster_ip ' . ((preg_match('#%#', $ips)) ? 'LIKE' : 'IN') . " ($ips) + WHERE poster_ip ' . ((strpos($ips, '%') !== false) ? 'LIKE' : 'IN') . " ($ips) AND forum_id IN (0, " . implode(', ', $ip_forums) . ')'; $result = $db->sql_query($sql); diff --git a/phpBB/style.php b/phpBB/style.php index 496ae7c8e0..a9803aa4e5 100644 --- a/phpBB/style.php +++ b/phpBB/style.php @@ -33,7 +33,7 @@ if (!empty($load_extensions)) $sid = (isset($_GET['sid'])) ? htmlspecialchars($_GET['sid']) : ''; $id = (isset($_GET['id'])) ? intval($_GET['id']) : 0; -if (!preg_match('/^[A-Za-z0-9]*$/', $sid)) +if (!ctype_alnum($sid)) { $sid = ''; } From 94476d05e09bcc70f4f2ea42472b5f22538f3235 Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 10 Dec 2006 01:19:54 +0000 Subject: [PATCH 055/264] #6090 - some cool regex stuff (one of them looks kinda weird :\ ...) git-svn-id: file:///svn/phpbb/trunk@6735 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/message_parser.php | 32 ++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index ed6f69cf49..561b2d79da 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -265,7 +265,7 @@ class bbcode_firstpass extends bbcode */ function bbcode_img($in) { - global $user, $config, $phpEx; + global $user, $config; if (!$this->check_bbcode('img', $in)) { @@ -309,7 +309,7 @@ class bbcode_firstpass extends bbcode */ function bbcode_flash($width, $height, $in) { - global $user, $config, $phpEx; + global $user, $config; if (!$this->check_bbcode('flash', $in)) { @@ -940,7 +940,8 @@ class parse_message extends bbcode_firstpass // Do some general 'cleanup' first before processing message, // e.g. remove excessive newlines(?), smilies(?) // Transform \r\n and \r into \n - $match = array('#\r\n?#', "#([\n][\s]+){3,}#u", '#(script|about|applet|activex|chrome):#i'); + // TODO: Second regex looks wrong... + $match = array('#\r\n?#', "#(\n\s+){3,}#u", '#(script|about|applet|activex|chrome):#i'); $replace = array("\n", "\n\n", "\\1:"); $this->message = preg_replace($match, $replace, trim($this->message)); @@ -994,7 +995,7 @@ class parse_message extends bbcode_firstpass if ($config['max_' . $mode . '_urls']) { - $num_urls += preg_match_all('#\' . $row['emotion'] . ''; } $db->sql_freeresult($result); @@ -1456,16 +1457,22 @@ class parse_message extends bbcode_firstpass $tmp_message = $this->message; $this->message = $poll['poll_title']; + $poll['poll_options'] = explode("\n", trim($poll['poll_option_text'])); + $poll['poll_options_size'] = sizeof($poll['poll_options']); - $poll['poll_title'] = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, false, $config['allow_post_links'], false); + if (!$poll['poll_title'] && $poll['poll_options_size']) + { + $this->warn_msg[] = $user->lang['NO_POLL_TITLE']; + } + else + { + $poll['poll_title'] = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, false, $config['allow_post_links'], false); + } $this->message = $tmp_message; unset($tmp_message); - $poll['poll_options'] = explode("\n", trim($poll['poll_option_text'])); - $poll['poll_options_size'] = sizeof($poll['poll_options']); - if (sizeof($poll['poll_options']) == 1) { $this->warn_msg[] = $user->lang['TOO_FEW_POLL_OPTIONS']; @@ -1479,11 +1486,6 @@ class parse_message extends bbcode_firstpass $this->warn_msg[] = $user->lang['TOO_MANY_USER_OPTIONS']; } - if (!$poll['poll_title'] && $poll['poll_options_size']) - { - $this->warn_msg[] = $user->lang['NO_POLL_TITLE']; - } - $poll['poll_max_options'] = ($poll['poll_max_options'] < 1) ? 1 : (($poll['poll_max_options'] > $config['max_poll_options']) ? $config['max_poll_options'] : $poll['poll_max_options']); } } From 4e2d04dd4af4ee8d7be21788fe7e079bfd53e7d7 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 10 Dec 2006 14:33:21 +0000 Subject: [PATCH 056/264] implemented updater changes git-svn-id: file:///svn/phpbb/trunk@6736 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/install_update.html | 242 +++++++++++++++------------- phpBB/includes/acp/acp_update.php | 2 +- phpBB/install/database_update.php | 43 ++++- phpBB/install/install_update.php | 125 +++++++------- phpBB/language/en/acp/common.php | 3 + phpBB/language/en/install.php | 26 +-- 6 files changed, 264 insertions(+), 177 deletions(-) diff --git a/phpBB/adm/style/install_update.html b/phpBB/adm/style/install_update.html index be4fd0961b..9eef17200f 100644 --- a/phpBB/adm/style/install_update.html +++ b/phpBB/adm/style/install_update.html @@ -71,14 +71,16 @@ function popup(url, width, height) - + +
-

{L_CHECK_FILES_EXPLAIN}

- +

{L_UPDATE_DATABASE_EXPLAIN}

+
+
@@ -90,113 +92,147 @@ function popup(url, width, height)
- + -

{L_COLLECTED_INFORMATION}

+ -

{L_COLLECTED_INFORMATION_EXPLAIN}

+

{L_PERFORM_DATABASE_UPDATE}

- -
-

{L_NO_UPDATE_FILES}

+

+ {L_PERFORM_DATABASE_UPDATE_EXPLAIN}
+
+ » {L_RUN_DATABASE_SCRIPT} « +

-

{L_NO_UPDATE_FILES_EXPLAIN}


+

- {NO_UPDATE_FILES} - -
- - -
- - - - - - - - -

{files.TITLE}

- -

{files.EXPLAIN}

- -
- {files.L_STATUS} - -
- -
{files.FILENAME}
- -
- {files.DIR_PART}
{files.FILE_PART}
- -
{L_FILE_USED}: {files.CUSTOM_ORIGINAL} - - -
{L_NUM_CONFLICTS}: {files.NUM_CONFLICTS} - -
-
[ {files.L_SHOW_DIFF} ]
- -
  {L_DO_NOT_UPDATE}
- - -
-
-
  {L_MERGE_NO_MERGE_NEW_OPTION}
-
[{L_SHOW_DIFF_FINAL}]
-
-
-
  {L_MERGE_NO_MERGE_MOD_OPTION}
-
[{L_SHOW_DIFF_FINAL}]
-
-
-
  {L_MERGE_NEW_FILE_OPTION}
-
[{L_SHOW_DIFF_FINAL}]
-
-
-
  {L_MERGE_MOD_FILE_OPTION}
-
[{L_SHOW_DIFF_FINAL}]
-
- -
- -
- {files.L_STATUS} - - - - - - - + +
+
- -
- -
- -
- -
- - - -

{L_NO_DATABASE_UPDATE_NEEDED}

- -
+ + +

{L_UPDATE_DB_SUCCESS}

+ +

+ + + +
+

{L_CHECK_FILES_EXPLAIN}

+ +
+ +
+ + + + + + + +
+

{L_UPDATE_SUCCESS}

+

{L_ALL_FILES_UP_TO_DATE}

+
+ + +

{L_COLLECTED_INFORMATION}

+ +

{L_COLLECTED_INFORMATION_EXPLAIN}

+ + +
+

{L_NO_UPDATE_FILES}

+ +

{L_NO_UPDATE_FILES_EXPLAIN}


+ + {NO_UPDATE_FILES} + +
+ + +
+ + + + + +
+ + +

{files.TITLE}

+ +

{files.EXPLAIN}

+ +
+ {files.L_STATUS} + +
+ +
{files.FILENAME}
+ +
+ {files.DIR_PART}
{files.FILE_PART}
+ +
{L_FILE_USED}: {files.CUSTOM_ORIGINAL} + + +
{L_NUM_CONFLICTS}: {files.NUM_CONFLICTS} + +
+
[ {files.L_SHOW_DIFF} ]{L_BINARY_FILE}
+ +
  {L_DO_NOT_UPDATE}
+ + +
+
+
  {L_MERGE_NO_MERGE_NEW_OPTION}
+
[{L_SHOW_DIFF_FINAL}]
+
+
+
  {L_MERGE_NO_MERGE_MOD_OPTION}
+
[{L_SHOW_DIFF_FINAL}]
+
+ +
+
  {L_MERGE_NEW_FILE_OPTION}
+
[{L_SHOW_DIFF_FINAL}]
+
+
+
  {L_MERGE_MOD_FILE_OPTION}
+
[{L_SHOW_DIFF_FINAL}]
+
+ + +
+ +
+ {files.L_STATUS} + + + + + + + -
-

{L_ALL_FILES_UP_TO_DATE}

-
- +
+ +
+ +
+ +
+

{L_UPDATE_METHOD}

{L_UPDATE_METHOD_EXPLAIN}

@@ -205,9 +241,9 @@ function popup(url, width, height)    
- + - + @@ -295,16 +331,6 @@ function popup(url, width, height) - - -

{L_PERFORM_DATABASE_UPDATE}

- -

- {L_PERFORM_DATABASE_UPDATE_EXPLAIN}
-
- » {L_RUN_DATABASE_SCRIPT} « -

- diff --git a/phpBB/includes/acp/acp_update.php b/phpBB/includes/acp/acp_update.php index 140d3b7dda..050c547445 100644 --- a/phpBB/includes/acp/acp_update.php +++ b/phpBB/includes/acp/acp_update.php @@ -53,7 +53,7 @@ class acp_update 'LATEST_VERSION' => $latest_version, 'CURRENT_VERSION' => $config['version'], - 'UPDATE_INSTRUCTIONS' => sprintf($user->lang['UPDATE_INSTRUCTIONS'], $announcement_url, $update_archive_link, $update_link), + 'UPDATE_INSTRUCTIONS' => sprintf($user->lang['UPDATE_INSTRUCTIONS'], $announcement_url, $update_link), )); } } diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index e5c0998be5..e9d429f45c 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -60,6 +60,7 @@ require($phpbb_root_path . 'includes/constants.' . $phpEx); require($phpbb_root_path . 'includes/db/' . $dbms . '.' . $phpEx); require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); +$user = new user(); $cache = new cache(); $db = new $sql_db(); @@ -85,6 +86,7 @@ include($phpbb_root_path . 'language/' . $row['config_value'] . '/install.' . $p //set_error_handler('msg_handler'); // Define some variables for the database update +$inline_update = (request_var('type', 0)) ? true : false; // Database column types mapping $dbms_type_map = array( @@ -388,6 +390,21 @@ echo $lang['UPDATED_VERSION'] . ' :: ' . $updates_to_version . 'sql_query('DELETE FROM ' . CONFIG_TABLE . " WHERE config_name = 'version_update_from'"); +} // Schema updates ?> @@ -548,11 +565,33 @@ _write_result($no_updates, $errored, $error_ary);
-

+

+if (!$inline_update) +{ +?> + +

+ +

+ +

+ +

»

+ +ip = (!empty($_SERVER['REMOTE_ADDR'])) ? htmlspecialchars($_SERVER['REMOTE_ADDR']) : ''; +add_log('admin', 'LOG_UPDATE_DATABASE', $orig_version, $updates_to_version); // Now we purge the session table as well as all cache files $cache->purge(); diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index fed66a0a07..a62b122014 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -6,12 +6,6 @@ * @copyright (c) 2006 phpBB Group * @license http://opensource.org/licenses/gpl-license.php GNU Public License * -* @todo add successful file update to log -* @todo add successful database update to log -* @todo do database update before updating files. Within the updater create a new config variable (version_update_from). Use this version in favor of the real versino to check for the database update successfully run through. After successful file update remove the information. -* @todo check memory by setting limit to 8MB locally. -* @todo make sure binary files get updated too, omitting the diff engine for this (handle like a conflict) -* @todo do not require login... * @todo check for writeable cache/store/files directory */ @@ -46,7 +40,7 @@ if (!empty($setmodules)) 'module_filename' => substr(basename(__FILE__), 0, -strlen($phpEx)-1), 'module_order' => 30, 'module_subs' => '', - 'module_stages' => array('INTRO', 'VERSION_CHECK', 'FILE_CHECK', 'UPDATE_FILES', 'UPDATE_DB'), + 'module_stages' => array('INTRO', 'VERSION_CHECK', 'UPDATE_DB', 'FILE_CHECK', 'UPDATE_FILES'), 'module_reqs' => '' ); } @@ -129,8 +123,6 @@ class install_update extends module $template->set_custom_template('../adm/style', 'admin'); // Get current and latest version - $this->current_version = $config['version']; - if (($latest_version = $cache->get('_version_info')) === false) { $this->latest_version = $this->get_file('version_info'); @@ -141,6 +133,9 @@ class install_update extends module $this->latest_version = $latest_version; } + // For the current version we trick a bit. ;) + $this->current_version = (!empty($config['version_update_from'])) ? $config['version_update_from'] : $config['version']; + $up_to_date = (version_compare(strtolower($this->current_version), strtolower($this->latest_version), '<')) ? false : true; // Check for a valid update directory, else point the user to the phpbb.com website @@ -179,18 +174,21 @@ class install_update extends module return; } - // Got the updater template itself updated? If so, we are able to directly use it - but only if all three files are present - if (in_array('adm/style/install_update.html', $this->update_info['files'])) + if ($this->test_update === false) { - $this->tpl_name = '../../install/update/new/adm/style/install_update'; - } + // Got the updater template itself updated? If so, we are able to directly use it - but only if all three files are present + if (in_array('adm/style/install_update.html', $this->update_info['files'])) + { + $this->tpl_name = '../../install/update/new/adm/style/install_update'; + } - // What about the language file? Got it updated? - if (in_array('language/en/install.php', $this->update_info['files'])) - { - $lang = array(); - include($this->new_location . 'language/en/install.php'); - $user->lang = array_merge($user->lang, $lang); + // What about the language file? Got it updated? + if (in_array('language/en/install.php', $this->update_info['files'])) + { + $lang = array(); + include($this->new_location . 'language/en/install.php'); + $user->lang = array_merge($user->lang, $lang); + } } // Include renderer and engine @@ -224,14 +222,52 @@ class install_update extends module $template->assign_vars(array( 'S_UP_TO_DATE' => $up_to_date, 'S_VERSION_CHECK' => true, - 'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=file_check"), + + 'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=file_check"), + 'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=update_db"), 'LATEST_VERSION' => $this->latest_version, - 'CURRENT_VERSION' => $config['version']) + 'CURRENT_VERSION' => $this->current_version) ); break; + case 'update_db': + + // Make sure the database update is valid for the latest version + $valid = false; + $updates_to_version = ''; + + if (file_exists($phpbb_root_path . 'install/database_update.' . $phpEx)) + { + include_once($phpbb_root_path . 'install/database_update.' . $phpEx); + + if ($updates_to_version === $this->latest_version) + { + $valid = true; + } + } + + // Should not happen at all + if (!$valid) + { + trigger_error($user->lang['DATABASE_UPDATE_INFO_OLD'], E_USER_ERROR); + } + + // Just a precaution + $cache->purge(); + + // Redirect the user to the database update script with some explanations... + $template->assign_vars(array( + 'S_DB_UPDATE' => true, + 'S_DB_UPDATE_FINISHED' => ($config['version'] == $this->latest_version) ? true : false, + 'U_DB_UPDATE' => $phpbb_root_path . 'install/database_update.' . $phpEx . '?type=1', + 'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=update_db"), + 'U_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=file_check"), + )); + + break; + case 'file_check': $this->page_title = 'STAGE_FILE_CHECK'; @@ -300,6 +336,8 @@ class install_update extends module foreach ($filelist as $file_struct) { + $s_binary = (!empty($this->update_info['binary']) && in_array($file_struct['filename'], $this->update_info['binary'])) ? true : false; + $filename = htmlspecialchars($file_struct['filename']); if (strrpos($filename, '/') !== false) { @@ -323,6 +361,7 @@ class install_update extends module 'NUM_CONFLICTS' => (isset($file_struct['conflicts'])) ? $file_struct['conflicts'] : 0, 'S_CUSTOM' => ($file_struct['custom']) ? true : false, + 'S_BINARY' => $s_binary, 'CUSTOM_ORIGINAL' => ($file_struct['custom']) ? $file_struct['original'] : '', 'U_SHOW_DIFF' => $diff_url, @@ -355,6 +394,16 @@ class install_update extends module 'U_DB_UPDATE_ACTION' => append_sid($this->p_master->module_url, "mode=$mode&sub=update_db"), )); + if ($all_up_to_date) + { + $db->sql_query('DELETE FROM ' . CONFIG_TABLE . " WHERE config_name = 'version_update_from'"); + + // Add database update to log + add_log('admin', 'LOG_UPDATE_PHPBB', $this->current_version, $this->latest_version); + + $cache->purge(); + } + break; case 'update_files': @@ -703,40 +752,6 @@ class install_update extends module break; - case 'update_db': - - // Make sure the database update is valid for the latest version - $valid = false; - $updates_to_version = ''; - - if (file_exists($phpbb_root_path . 'install/database_update.' . $phpEx)) - { - include_once($phpbb_root_path . 'install/database_update.' . $phpEx); - - if ($updates_to_version === $this->latest_version) - { - $valid = true; - } - } - - // Should not happen at all - if (!$valid) - { - trigger_error($user->lang['DATABASE_UPDATE_INFO_OLD'], E_USER_ERROR); - } - - // Because we are done with the file update we purge the cache directory - $cache->purge(); - - // Redirect the user to the database update script with some explanations... - $template->assign_vars(array( - 'S_DB_UPDATE' => true, - 'U_DB_UPDATE' => $phpbb_root_path . 'install/database_update.' . $phpEx) - ); - - - - break; } } diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 40ea5cc8e4..096efc9c52 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -592,6 +592,9 @@ $lang = array_merge($lang, array( 'LOG_THEME_EXPORT' => 'Exported theme
» %s', 'LOG_THEME_REFRESHED' => 'Refreshed theme
» %s', + 'LOG_UPDATE_DATABASE' => 'Updated Database from version %1$s to version %2$s', + 'LOG_UPDATE_PHPBB' => 'Updated phpBB from version %1$s to version %2$s', + 'LOG_USER_ACTIVE' => 'User activated
» %s', 'LOG_USER_BAN_USER' => 'Banned User via user management for reason "%1$s"
» %2$s', 'LOG_USER_BAN_IP' => 'Banned IP via user management for reason "%1$s"
» %2$s', diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index b0a8171dc1..59c39e0991 100755 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -306,18 +306,21 @@ $lang = array_merge($lang, array( // Updater $lang = array_merge($lang, array( - 'ALL_FILES_UP_TO_DATE' => 'All files are up to date with the latest phpBB version. You may want to run the database update tool now.', + 'ALL_FILES_UP_TO_DATE' => 'All files are up to date with the latest phpBB version. You should now login to your board and check if everything is working fine. Do not forget to delete, rename or move your install directory!', 'ARCHIVE_FILE' => 'Source file within archive', - 'BACK' => 'Back', + 'BACK' => 'Back', + 'BINARY_FILE' => 'Binary file', 'CHECK_FILES' => 'Check files', 'CHECK_FILES_AGAIN' => 'Check files again', 'CHECK_FILES_EXPLAIN' => 'Within the next step all files will be checked against the update files - this can take a while if this is the first file check.', 'CHECK_FILES_UP_TO_DATE' => 'According to your database your version is up to date. You may want to proceed with the file check to make sure all files are really up to date with the latest phpBB version.', + 'CHECK_UPDATE_DATABASE' => 'Continue update process', 'COLLECTED_INFORMATION' => 'Information on collected files', 'COLLECTED_INFORMATION_EXPLAIN' => 'The list below shows information about the files needing an update. Please read the information in front of every status block to see what they mean and what you may need to do to perform a successful update.', 'COMPLETE_LOGIN_TO_BOARD' => 'You should now login to your board and check if everything is working fine. Do not forget to delete, rename or move your install directory!', + 'CONTINUE_INLINE_UPDATE' => 'The database update was successful. Now please close this window and continue the update process as explained.', 'CURRENT_FILE' => 'Current original file', 'CURRENT_VERSION' => 'Current version', @@ -376,7 +379,6 @@ $lang = array_merge($lang, array( 'NEW_FILE' => 'New updated file', 'NO_AUTH_UPDATE' => 'Not authorized to update', - 'NO_DATABASE_UPDATE_NEEDED' => 'All of your files seem to be up to date. Since you are already running the latest version you do not need to update your database.', 'NO_ERRORS' => 'No errors', 'NO_UPDATE_FILES' => 'Not updating the following files', 'NO_UPDATE_FILES_EXPLAIN' => 'The following files are new or modified but the directory they normally reside in could not be found on your installation. If this list contains files to other directories than language/ or styles/ than you may have modified your directory structure and the update may be incomplete.', @@ -391,7 +393,7 @@ $lang = array_merge($lang, array( 'OLD_UPDATE_FILES' => 'Update files are out of date. The update files found are for updating from phpBB %1$s to phpBB %2$s but the latest version of phpBB is %3$s.', 'PERFORM_DATABASE_UPDATE' => 'Perform database update', - 'PERFORM_DATABASE_UPDATE_EXPLAIN' => 'Below you will find a link to the database update script. This script needs to be run seperatly because updating the database might result in unexpected behaviour if you are logged in. The database update can take a while, so please do not stop the execution if it only seems to hang. After you clicked the link and the update finished you can close this window too.', + 'PERFORM_DATABASE_UPDATE_EXPLAIN' => 'Below you will find a link to the database update script. This script needs to be run seperatly because updating the database might result in unexpected behaviour if you are logged in. The database update can take a while, so please do not stop the execution if it seems to hang. After you performed the database update, close the database update window and continue the update process.', 'PREVIOUS_VERSION' => 'Previous version', 'PROGRESS' => 'Progress', @@ -423,11 +425,12 @@ $lang = array_merge($lang, array( 'UPDATE_COMPLETED' => 'Update completed', 'UPDATE_DATABASE' => 'Update database', + 'UPDATE_DATABASE_EXPLAIN' => 'Within the next step the database will be updated.', 'UPDATE_DATABASE_SCHEMA' => 'Updating database schema', 'UPDATE_FILES' => 'Update files', 'UPDATE_FILES_NOTICE' => 'Please make sure you have updated your board files too, this file is only updating your database.', 'UPDATE_INSTALLATION' => 'Update phpBB Installation', - 'UPDATE_INSTALLATION_EXPLAIN' => 'With this option, it is possible to update your phpBB installation to the latest version.
During the process all of your files will be checked for their integrity. You are able to review all differences and files before the update.

The file update itself can be done in two different ways.

Manual Update

With this update you only download your personal set of changed files to make sure you do not lose your file modifications you may have done. After you downloaded this package you need to manually upload the files to their correct position under your phpBB root directory. Once done, you are able to do the file check stage again to see if you moved the files to their correct location. If everything is correctly updated you will be forwarded to the database updater.

Automatic Update with FTP

This method is similar to the first one but without the need to download the changed files and uploading them on your own. This will be done for you. In order to use this method you need to know your FTP login details since you will be asked for them. Once finished you will be redirected to the file check again to make sure everything got updated correctly. If so, you will be forwarded to the database updater.', + 'UPDATE_INSTALLATION_EXPLAIN' => 'With this option, it is possible to update your phpBB installation to the latest version.
During the process all of your files will be checked for their integrity. You are able to review all differences and files before the update.

The file update itself can be done in two different ways.

Manual Update

With this update you only download your personal set of changed files to make sure you do not lose your file modifications you may have done. After you downloaded this package you need to manually upload the files to their correct position under your phpBB root directory. Once done, you are able to do the file check stage again to see if you moved the files to their correct location.

Automatic Update with FTP

This method is similar to the first one but without the need to download the changed files and uploading them on your own. This will be done for you. In order to use this method you need to know your FTP login details since you will be asked for them. Once finished you will be redirected to the file check again to make sure everything got updated correctly.

', 'UPDATE_INSTRUCTIONS' => '

Release announcement

@@ -441,17 +444,16 @@ $lang = array_merge($lang, array(

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

-

Once uploaded your board will be offline for normal users.

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

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. The update is complete after the database update script has been completed successfully - this is the last step within the update process. + You will then be guided through the update process. You will be notified after the update is complete.

- ', '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.', @@ -463,6 +465,8 @@ $lang = array_merge($lang, array( 'UPDATED_VERSION' => 'Updated version', 'UPLOAD_METHOD' => 'Upload method', + 'UPDATE_DB_SUCCESS' => 'Database update was successful', + 'VERSION_CHECK' => 'Version Check', 'VERSION_CHECK_EXPLAIN' => 'Checks to see if the version of phpBB you are currently running is up to date.', 'VERSION_NOT_UP_TO_DATE' => 'Your version of phpBB is not up to date. Please continue the update process.', From e274c6abc60d4dde3039027954297a8f589777c6 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 10 Dec 2006 14:43:59 +0000 Subject: [PATCH 057/264] #6094 git-svn-id: file:///svn/phpbb/trunk@6737 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/acp/email.php | 4 ++-- phpBB/language/en/posting.php | 12 ++++++------ phpBB/language/en/ucp.php | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/phpBB/language/en/acp/email.php b/phpBB/language/en/acp/email.php index 5b66f2cd9b..9fbf6f3d45 100644 --- a/phpBB/language/en/acp/email.php +++ b/phpBB/language/en/acp/email.php @@ -38,8 +38,8 @@ $lang = array_merge($lang, array( 'COMPOSE' => 'Compose', 'EMAIL_SEND_ERROR' => 'There were one or more errors while sending the email. Please check the %sError Log%s for detailed error messages.', - 'EMAIL_SENT' => 'Your message has been sent.', - 'EMAIL_SENT_QUEUE' => 'Your message has been queued for sending.', + 'EMAIL_SENT' => 'This message has been sent.', + 'EMAIL_SENT_QUEUE' => 'This message has been queued for sending.', 'LOG_SESSION' => 'Log mail session to critical log', diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index e7d92c26bd..a4dee8e31a 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -118,7 +118,7 @@ $lang = array_merge($lang, array( 'MAX_IMG_WIDTH_EXCEEDED' => 'Your images may only be up to %1$d pixels wide.', 'MESSAGE_BODY_EXPLAIN' => 'Enter your message here, it may contain no more than %d characters.', - 'MESSAGE_DELETED' => 'Your message has been deleted successfully', + 'MESSAGE_DELETED' => 'This message has been deleted successfully', 'MORE_SMILIES' => 'View more smilies', 'NOTIFY_REPLY' => 'Send me an email when a reply is posted', @@ -146,17 +146,17 @@ $lang = array_merge($lang, array( 'POSTED_ATTACHMENTS' => 'Posted attachments', 'POST_CONFIRMATION' => 'Confirmation of post', 'POST_CONFIRM_EXPLAIN' => 'To prevent automated posts the board administrator 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' => 'Your message has been deleted successfully', - 'POST_EDITED' => 'Your message has been edited successfully', - 'POST_EDITED_MOD' => 'Your message has been edited but requires approval', + 'POST_DELETED' => 'This message has been deleted successfully', + 'POST_EDITED' => 'This message has been edited successfully', + 'POST_EDITED_MOD' => 'This message has been edited but requires approval', 'POST_GLOBAL' => 'Global', 'POST_ICON' => 'Post icon', 'POST_NORMAL' => 'Normal', 'POST_REPLY' => 'Post a reply', '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' => 'Your message has been posted successfully', - 'POST_STORED_MOD' => 'Your message has been saved but requires approval', + 'POST_STORED' => 'This message has been posted successfully', + 'POST_STORED_MOD' => 'This message has been saved but requires approval', 'POST_TOPIC' => 'Post a new topic', 'POST_TOPIC_AS' => 'Post topic as', 'PROGRESS_BAR' => 'Progress bar', diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index 2b999df15c..41ee1ccc7f 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -252,7 +252,7 @@ $lang = array_merge($lang, array( 'MESSAGE_HISTORY' => 'Message history', 'MESSAGE_REMOVED_FROM_OUTBOX' => 'This message has been removed by it’s author before it was delivered', 'MESSAGE_SENT_ON' => 'on', - 'MESSAGE_STORED' => 'Your message has been sent successfully', + 'MESSAGE_STORED' => 'This message has been sent successfully', 'MESSAGE_TO' => 'To', 'MESSAGES_DELETED' => 'Messages successfully deleted', 'MOVE_DELETED_MESSAGES_TO' => 'Move messages from removed folder to', From 564e6782f04ca81ddad8bba5e041aa1bd8914be8 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 10 Dec 2006 15:09:31 +0000 Subject: [PATCH 058/264] - #6110 - #6102 - #6096 git-svn-id: file:///svn/phpbb/trunk@6738 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_permission_roles.php | 2 +- phpBB/includes/acp/acp_users.php | 2 +- phpBB/includes/acp/auth.php | 8 +++- phpBB/includes/ucp/ucp_profile.php | 2 +- phpBB/install/schemas/schema_data.sql | 44 +++++++++---------- phpBB/language/en/acp/permissions.php | 23 ++++++++++ .../styles/subSilver/template/ucp_header.html | 2 +- 7 files changed, 55 insertions(+), 28 deletions(-) diff --git a/phpBB/includes/acp/acp_permission_roles.php b/phpBB/includes/acp/acp_permission_roles.php index 004d9f55af..581766e9c8 100644 --- a/phpBB/includes/acp/acp_permission_roles.php +++ b/phpBB/includes/acp/acp_permission_roles.php @@ -388,7 +388,7 @@ class acp_permission_roles while ($row = $db->sql_fetchrow($result)) { $template->assign_block_vars('roles', array( - 'ROLE_NAME' => $row['role_name'], + 'ROLE_NAME' => (!empty($user->lang[$row['role_name']])) ? $user->lang[$row['role_name']] : $row['role_name'], 'ROLE_DESCRIPTION' => (!empty($user->lang[$row['role_description']])) ? $user->lang[$row['role_description']] : nl2br($row['role_description']), 'U_EDIT' => $this->u_action . '&action=edit&role_id=' . $row['role_id'], diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 314514b8e2..28125df3ed 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1032,7 +1032,7 @@ class acp_users 'icq' => array( array('string', true, 3, 15), array('match', true, '#^[0-9]+$#i')), - 'aim' => array('string', true, 3, 17), + 'aim' => array('string', true, 3, 255), 'msn' => array('string', true, 5, 255), 'jabber' => array( array('string', true, 5, 255), diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index 35b0cd29e2..b6ec69a347 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -462,8 +462,10 @@ class auth_admin extends auth foreach ($roles as $role_id => $role_row) { $role_description = (!empty($user->lang[$role_row['role_description']])) ? $user->lang[$role_row['role_description']] : nl2br($role_row['role_description']); + $role_name = (!empty($user->lang[$role_row['role_name']])) ? $user->lang[$role_row['role_name']] : $role_row['role_name']; + $title = ($role_description) ? ' title="' . $role_description . '"' : ''; - $s_role_options .= ''; + $s_role_options .= ''; } if ($s_role_options) @@ -520,8 +522,10 @@ class auth_admin extends auth foreach ($roles as $role_id => $role_row) { $role_description = (!empty($user->lang[$role_row['role_description']])) ? $user->lang[$role_row['role_description']] : nl2br($role_row['role_description']); + $role_name = (!empty($user->lang[$role_row['role_name']])) ? $user->lang[$role_row['role_name']] : $role_row['role_name']; + $title = ($role_description) ? ' title="' . $role_description . '"' : ''; - $s_role_options .= ''; + $s_role_options .= ''; } if ($s_role_options) diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index cfd6f217c0..a979f73e93 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -272,7 +272,7 @@ class ucp_profile 'icq' => array( array('string', true, 3, 15), array('match', true, '#^[0-9]+$#i')), - 'aim' => array('string', true, 3, 17), + 'aim' => array('string', true, 3, 255), 'msn' => array('string', true, 5, 255), 'jabber' => array( array('string', true, 5, 255), diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 795ca8becd..ea85966656 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -350,28 +350,28 @@ INSERT INTO phpbb_acl_options (auth_option, is_global) VALUES ('u_viewprofile', # -- standard auth roles -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Standard Admin', 'ROLE_DESCRIPTION_ADMIN_STANDARD', 'a_', 1); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Forum Admin', 'ROLE_DESCRIPTION_ADMIN_FORUM', 'a_', 3); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('User and Groups Admin', 'ROLE_DESCRIPTION_ADMIN_USERGROUP', 'a_', 4); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Full Admin', 'ROLE_DESCRIPTION_ADMIN_FULL', 'a_', 2); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('All Features', 'ROLE_DESCRIPTION_USER_FULL', 'u_', 3); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Standard Features', 'ROLE_DESCRIPTION_USER_STANDARD', 'u_', 1); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Limited Features', 'ROLE_DESCRIPTION_USER_LIMITED', 'u_', 2); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('No Private Messages', 'ROLE_DESCRIPTION_USER_NOPM', 'u_', 4); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('No Avatar', 'ROLE_DESCRIPTION_USER_NOAVATAR', 'u_', 5); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Full Moderator', 'ROLE_DESCRIPTION_MOD_FULL', 'm_', 3); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Standard Moderator', 'ROLE_DESCRIPTION_MOD_STANDARD', 'm_', 1); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Simple Moderator', 'ROLE_DESCRIPTION_MOD_SIMPLE', 'm_', 2); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Queue Moderator', 'ROLE_DESCRIPTION_MOD_QUEUE', 'm_', 4); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Full Access', 'ROLE_DESCRIPTION_FORUM_FULL', 'f_', 7); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Standard Access', 'ROLE_DESCRIPTION_FORUM_STANDARD', 'f_', 5); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('No Access', 'ROLE_DESCRIPTION_FORUM_NOACCESS', 'f_', 1); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Read Only Access', 'ROLE_DESCRIPTION_FORUM_READONLY', 'f_', 2); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Limited Access', 'ROLE_DESCRIPTION_FORUM_LIMITED', 'f_', 3); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Bot Access', 'ROLE_DESCRIPTION_FORUM_BOT', 'f_', 9); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('On Moderation Queue', 'ROLE_DESCRIPTION_FORUM_ONQUEUE', 'f_', 8); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Standard Access + Polls', 'ROLE_DESCRIPTION_FORUM_POLLS', 'f_', 6); -INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('Limited Access + Polls', 'ROLE_DESCRIPTION_FORUM_LIMITED_POLLS', 'f_', 4); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_ADMIN_STANDARD', 'ROLE_DESCRIPTION_ADMIN_STANDARD', 'a_', 1); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_ADMIN_FORUM', 'ROLE_DESCRIPTION_ADMIN_FORUM', 'a_', 3); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_ADMIN_USERGROUP', 'ROLE_DESCRIPTION_ADMIN_USERGROUP', 'a_', 4); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_ADMIN_FULL', 'ROLE_DESCRIPTION_ADMIN_FULL', 'a_', 2); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_USER_FULL', 'ROLE_DESCRIPTION_USER_FULL', 'u_', 3); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_USER_STANDARD', 'ROLE_DESCRIPTION_USER_STANDARD', 'u_', 1); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_USER_LIMITED', 'ROLE_DESCRIPTION_USER_LIMITED', 'u_', 2); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_USER_NOPM', 'ROLE_DESCRIPTION_USER_NOPM', 'u_', 4); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_USER_NOAVATAR', 'ROLE_DESCRIPTION_USER_NOAVATAR', 'u_', 5); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_MOD_FULL', 'ROLE_DESCRIPTION_MOD_FULL', 'm_', 3); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_MOD_STANDARD', 'ROLE_DESCRIPTION_MOD_STANDARD', 'm_', 1); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_MOD_SIMPLE', 'ROLE_DESCRIPTION_MOD_SIMPLE', 'm_', 2); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_MOD_QUEUE', 'ROLE_DESCRIPTION_MOD_QUEUE', 'm_', 4); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_FULL', 'ROLE_DESCRIPTION_FORUM_FULL', 'f_', 7); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_STANDARD', 'ROLE_DESCRIPTION_FORUM_STANDARD', 'f_', 5); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_NOACCESS', 'ROLE_DESCRIPTION_FORUM_NOACCESS', 'f_', 1); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_READONLY', 'ROLE_DESCRIPTION_FORUM_READONLY', 'f_', 2); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_LIMITED', 'ROLE_DESCRIPTION_FORUM_LIMITED', 'f_', 3); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_BOT', 'ROLE_DESCRIPTION_FORUM_BOT', 'f_', 9); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_ONQUEUE', 'ROLE_DESCRIPTION_FORUM_ONQUEUE', 'f_', 8); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_POLLS', 'ROLE_DESCRIPTION_FORUM_POLLS', 'f_', 6); +INSERT INTO phpbb_acl_roles (role_name, role_description, role_type, role_order) VALUES ('ROLE_FORUM_LIMITED_POLLS', 'ROLE_DESCRIPTION_FORUM_LIMITED_POLLS', 'f_', 4); # -- phpbb_styles diff --git a/phpBB/language/en/acp/permissions.php b/phpBB/language/en/acp/permissions.php index b66389907c..d37001c977 100644 --- a/phpBB/language/en/acp/permissions.php +++ b/phpBB/language/en/acp/permissions.php @@ -145,6 +145,29 @@ $lang = array_merge($lang, array( 'ROLE_DELETED' => 'Role successfully removed.', 'ROLE_DESCRIPTION' => 'Role description', + 'ROLE_ADMIN_FORUM' => 'Forum Admin', + 'ROLE_ADMIN_FULL' => 'Full Admin', + 'ROLE_ADMIN_STANDARD' => 'Standard Admin', + 'ROLE_ADMIN_USERGROUP' => 'User and Groups Admin', + 'ROLE_FORUM_BOT' => 'Bot Access', + 'ROLE_FORUM_FULL' => 'Full Access', + 'ROLE_FORUM_LIMITED' => 'Limited Access', + 'ROLE_FORUM_LIMITED_POLLS' => 'Limited Access + Polls', + 'ROLE_FORUM_NOACCESS' => 'No Access', + 'ROLE_FORUM_ONQUEUE' => 'On Moderation Queue', + 'ROLE_FORUM_POLLS' => 'Standard Access + Polls', + 'ROLE_FORUM_READONLY' => 'Read Only Access', + 'ROLE_FORUM_STANDARD' => 'Standard Access', + 'ROLE_MOD_FULL' => 'Full Moderator', + 'ROLE_MOD_QUEUE' => 'Queue Moderator', + 'ROLE_MOD_SIMPLE' => 'Simple Moderator', + 'ROLE_MOD_STANDARD' => 'Standard Moderator', + 'ROLE_USER_FULL' => 'All Features', + 'ROLE_USER_LIMITED' => 'Limited Features', + 'ROLE_USER_NOAVATAR' => 'No Avatar', + 'ROLE_USER_NOPM' => 'No Private Messages', + 'ROLE_USER_STANDARD' => 'Standard Features', + 'ROLE_DESCRIPTION_ADMIN_FORUM' => 'Can access the forum management and forum permission settings.', 'ROLE_DESCRIPTION_ADMIN_FULL' => 'Has access to all admin functions of this forum.
Not recommended.', 'ROLE_DESCRIPTION_ADMIN_STANDARD' => 'Has access to most admin features but is not allowed to use server or system related tools.', diff --git a/phpBB/styles/subSilver/template/ucp_header.html b/phpBB/styles/subSilver/template/ucp_header.html index c1eee778ee..dfddea4c8c 100644 --- a/phpBB/styles/subSilver/template/ucp_header.html +++ b/phpBB/styles/subSilver/template/ucp_header.html @@ -26,7 +26,7 @@
From 7e47135792a2cbf7e25ccdd184b4934b2a9e764d Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 10 Dec 2006 15:52:31 +0000 Subject: [PATCH 059/264] - #6144 - #6132 - #6122 git-svn-id: file:///svn/phpbb/trunk@6739 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/simple_body.html | 2 +- .../subSilver/template/memberlist_leaders.html | 12 ++++++------ phpBB/styles/subSilver/template/posting_body.html | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/phpBB/adm/style/simple_body.html b/phpBB/adm/style/simple_body.html index 0dd2fb7625..0b1e11b9a2 100644 --- a/phpBB/adm/style/simple_body.html +++ b/phpBB/adm/style/simple_body.html @@ -1,6 +1,6 @@ -
+

{MESSAGE_TITLE}

{MESSAGE_TEXT}

diff --git a/phpBB/styles/subSilver/template/memberlist_leaders.html b/phpBB/styles/subSilver/template/memberlist_leaders.html index 731be4d2b1..dbe5dab1bc 100644 --- a/phpBB/styles/subSilver/template/memberlist_leaders.html +++ b/phpBB/styles/subSilver/template/memberlist_leaders.html @@ -14,7 +14,7 @@ {L_ADMINISTRATORS} - + {admin.USERNAME_FULL}   @@ -30,14 +30,14 @@ - {L_NO_ADMINISTRATORS} + {L_NO_ADMINISTRATORS} - {L_MODERATORS} + {L_MODERATORS} - + {mod.USERNAME_FULL} {L_ALL_FORUMS}  @@ -53,11 +53,11 @@ - {L_NO_MODERATORS} + {L_NO_MODERATORS} - +
diff --git a/phpBB/styles/subSilver/template/posting_body.html b/phpBB/styles/subSilver/template/posting_body.html index f0ebd9f3b1..d7b081ba2b 100644 --- a/phpBB/styles/subSilver/template/posting_body.html +++ b/phpBB/styles/subSilver/template/posting_body.html @@ -159,7 +159,7 @@ - {bcc_recipient.NAME}{bcc_recipient.NAME_FULL}   + {bcc_recipient.NAME}{bcc_recipient.NAME_FULL}   {L_NO_BCC_RECIPIENT} From f40e2aba2261aaf79ee3b5ebe87b71dd6d30d1cb Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sun, 10 Dec 2006 17:44:45 +0000 Subject: [PATCH 060/264] - finally correctly calculate current time for birthday calculation [Bug #6030] - allow searching forums with unsearchable subforums [Bug #6056] - addition of an optional HTTP_X_FORWARDED_FOR check in sessions, including bans - do not index forums which have indexing disabled on index recreation [Bug #6060] - properly handle html entities in the theme editor [Bug #6048] - anonymous access is no longer required for the LDAP auth plugin [Bug #6046] - corrected mcp_front queue link to point to approve_details [Bug #6134] - added direct (dis)approval to mcp_front queue items [Bug #6134] - proper mysql version test for fulltext-compatibility [Bug #6054] - added note to style/language "used by" column so it's clear that bots are included - correctly update bot last visit time [Bug #6108] git-svn-id: file:///svn/phpbb/trunk@6740 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/admin.css | 1 + phpBB/adm/style/overall_header.html | 2 +- phpBB/adm/style/simple_header.html | 2 +- phpBB/develop/create_schema_files.php | 1 + phpBB/develop/ip_regex.php | 37 ++++++++ phpBB/includes/acp/acp_search.php | 17 +++- phpBB/includes/acp/acp_styles.php | 6 +- phpBB/includes/auth/auth_ldap.php | 26 +++++- phpBB/includes/mcp/mcp_front.php | 7 +- phpBB/includes/search/fulltext_mysql.php | 11 +-- phpBB/includes/session.php | 85 ++++++++++++++++--- phpBB/includes/ucp/ucp_pm_viewmessage.php | 2 +- phpBB/index.php | 2 +- phpBB/install/database_update.php | 5 +- phpBB/install/schemas/firebird_schema.sql | 1 + phpBB/install/schemas/mssql_schema.sql | 1 + phpBB/install/schemas/mysql_40_schema.sql | 1 + phpBB/install/schemas/mysql_41_schema.sql | 1 + phpBB/install/schemas/oracle_schema.sql | 1 + phpBB/install/schemas/postgres_schema.sql | 1 + phpBB/install/schemas/schema_data.sql | 3 + phpBB/install/schemas/sqlite_schema.sql | 1 + phpBB/language/en/acp/board.php | 25 +++--- phpBB/language/en/acp/common.php | 2 +- phpBB/language/en/acp/language.php | 2 +- phpBB/language/en/acp/styles.php | 2 +- phpBB/memberlist.php | 2 +- phpBB/search.php | 6 ++ .../styles/subSilver/template/mcp_front.html | 21 ++++- phpBB/viewtopic.php | 2 +- 30 files changed, 223 insertions(+), 53 deletions(-) create mode 100644 phpBB/develop/ip_regex.php diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css index 2daa161395..ee0977e51b 100644 --- a/phpBB/adm/style/admin.css +++ b/phpBB/adm/style/admin.css @@ -321,6 +321,7 @@ th { color: #FFA34F; font-weight: bold; background: #006699 url("../images/cellpic3.gif") 0 0 repeat-x; + white-space: nowrap; } td { diff --git a/phpBB/adm/style/overall_header.html b/phpBB/adm/style/overall_header.html index d5b3ff5f7e..fa05f19725 100644 --- a/phpBB/adm/style/overall_header.html +++ b/phpBB/adm/style/overall_header.html @@ -93,7 +93,7 @@ function trace(link) function find_username() { - window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); + window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=570, resizable=yes, scrollbars=yes, width=760'); return false; } diff --git a/phpBB/adm/style/simple_header.html b/phpBB/adm/style/simple_header.html index d555bc1443..c0db2c0cc6 100644 --- a/phpBB/adm/style/simple_header.html +++ b/phpBB/adm/style/simple_header.html @@ -79,7 +79,7 @@ function marklist(id, name, state) function find_username() { - window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=500, resizable=yes, scrollbars=yes, width=740'); + window.open('{UA_FIND_USERNAME}', '_usersearch', 'height=570, resizable=yes, scrollbars=yes, width=760'); return false; } diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index cc657f7829..3b51a15bd4 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1488,6 +1488,7 @@ function get_schema_struct() 'session_time' => array('TIMESTAMP', 0), 'session_ip' => array('VCHAR:40', ''), 'session_browser' => array('VCHAR:150', ''), + 'session_forwarded_for' => array('VCHAR:255', ''), 'session_page' => array('VCHAR_UNI', ''), 'session_viewonline' => array('BOOL', 1), 'session_autologin' => array('BOOL', 0), diff --git a/phpBB/develop/ip_regex.php b/phpBB/develop/ip_regex.php new file mode 100644 index 0000000000..4e7aaf0156 --- /dev/null +++ b/phpBB/develop/ip_regex.php @@ -0,0 +1,37 @@ +\nIPv6: " . $ipv6; +?> \ No newline at end of file diff --git a/phpBB/includes/acp/acp_search.php b/phpBB/includes/acp/acp_search.php index f858da6a16..342ec34e29 100644 --- a/phpBB/includes/acp/acp_search.php +++ b/phpBB/includes/acp/acp_search.php @@ -17,7 +17,7 @@ class acp_search var $state; var $search; var $max_post_id; - var $batch_size = 4000; + var $batch_size = 5000; function main($id, $mode) { @@ -320,6 +320,16 @@ class acp_search } else { + $sql = 'SELECT forum_id, enable_indexing + FROM ' . FORUMS_TABLE; + $result = $db->sql_query($sql, 3600); + + while ($row = $db->sql_fetchrow($result)) + { + $forums[$row['forum_id']] = (bool) $row['enable_indexing']; + } + $db->sql_freeresult($result); + $sql = 'SELECT post_id, post_subject, post_text, poster_id, forum_id FROM ' . POSTS_TABLE . ' WHERE post_id >= ' . (int) ($post_counter + 1) . ' @@ -328,7 +338,10 @@ class acp_search while ($row = $db->sql_fetchrow($result)) { - $this->search->index('post', $row['post_id'], $row['post_text'], $row['post_subject'], $row['poster_id'], $row['forum_id']); + if ($forums[$row['forum_id']]) + { + $this->search->index('post', $row['post_id'], $row['post_text'], $row['post_subject'], $row['poster_id'], $row['forum_id']); + } } $db->sql_freeresult($result); diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index a1937b592f..34dbd4c7ff 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -1121,7 +1121,7 @@ pagination_sep = \'{PAGINATION_SEP}\' $s_units = '' . $s_units; $template->assign_vars(array( - strtoupper($var) => $value, + strtoupper($var) => htmlspecialchars($value), 'S_' . strtoupper($var) . '_UNITS' => $s_units) ); break; @@ -1162,7 +1162,7 @@ pagination_sep = \'{PAGINATION_SEP}\' default: $template->assign_vars(array( - strtoupper($var) => $value) + strtoupper($var) => htmlspecialchars($value)) ); } } @@ -1226,7 +1226,7 @@ pagination_sep = \'{PAGINATION_SEP}\' break; default: - $value = request_var($var, ''); + $value = htmlspecialchars_decode(request_var($var, '')); } // use the element mapping to create raw css code diff --git a/phpBB/includes/auth/auth_ldap.php b/phpBB/includes/auth/auth_ldap.php index 8241db1c4f..365361a364 100644 --- a/phpBB/includes/auth/auth_ldap.php +++ b/phpBB/includes/auth/auth_ldap.php @@ -34,6 +34,14 @@ function init_ldap() @ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3); @ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0); + if ($config['ldap_user'] || $config['ldap_password']) + { + if (!@ldap_bind($ldap, ldap_escape(htmlspecialchars_decode($config['ldap_user'])), htmlspecialchars_decode($config['ldap_password']))) + { + return $user->lang['LDAP_INCORRECT_USER_PASSWORD']; + } + } + // ldap_connect only checks whether the specified server is valid, so the connection might still fail $search = @ldap_search( $ldap, @@ -95,6 +103,14 @@ function login_ldap(&$username, &$password) @ldap_set_option($ldap, LDAP_OPT_PROTOCOL_VERSION, 3); @ldap_set_option($ldap, LDAP_OPT_REFERRALS, 0); + if ($config['ldap_user'] || $config['ldap_password']) + { + if (!@ldap_bind($ldap, $config['ldap_user'], htmlspecialchars_decode($config['ldap_password']))) + { + return $user->lang['LDAP_NO_SERVER_CONNECTION']; + } + } + $search = @ldap_search( $ldap, $config['ldap_base_dn'], @@ -221,6 +237,14 @@ function acp_ldap(&$new)

' . $user->lang['LDAP_SERVER_EXPLAIN'] . '
+
+

' . $user->lang['LDAP_USER_EXPLAIN'] . '
+
+
+
+

' . $user->lang['LDAP_PASSWORD_EXPLAIN'] . '
+
+

' . $user->lang['LDAP_DN_EXPLAIN'] . '
@@ -238,7 +262,7 @@ function acp_ldap(&$new) // These are fields required in the config table return array( 'tpl' => $tpl, - 'config' => array('ldap_server', 'ldap_base_dn', 'ldap_uid', 'ldap_email') + 'config' => array('ldap_server', 'ldap_user', 'ldap_password', 'ldap_base_dn', 'ldap_uid', 'ldap_email') ); } diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php index d77d2fda60..3411369d79 100644 --- a/phpBB/includes/mcp/mcp_front.php +++ b/phpBB/includes/mcp/mcp_front.php @@ -80,7 +80,7 @@ function mcp_front_view($id, $mode, $action) } $template->assign_block_vars('unapproved', array( - 'U_POST_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=post_details&f=' . $row['forum_id'] . '&p=' . $row['post_id']), + 'U_POST_DETAILS' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $row['forum_id'] . '&p=' . $row['post_id']), 'U_MCP_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=forum_view&f=' . $row['forum_id']) : '', 'U_MCP_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=topic_view&f=' . $row['forum_id'] . '&t=' . $row['topic_id']), 'U_FORUM' => (!$global_topic) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id']) : '', @@ -88,6 +88,7 @@ function mcp_front_view($id, $mode, $action) 'U_AUTHOR' => ($row['poster_id'] == ANONYMOUS) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&u=' . $row['poster_id']), 'FORUM_NAME' => (!$global_topic) ? $forum_names[$row['forum_id']] : $user->lang['GLOBAL_ANNOUNCEMENT'], + 'POST_ID' => $row['post_id'], 'TOPIC_TITLE' => $row['topic_title'], 'AUTHOR' => ($row['poster_id'] == ANONYMOUS) ? (($row['post_username']) ? $row['post_username'] : $user->lang['GUEST']) : $row['username'], 'SUBJECT' => ($row['post_subject']) ? $row['post_subject'] : $user->lang['NO_SUBJECT'], @@ -97,6 +98,10 @@ function mcp_front_view($id, $mode, $action) $db->sql_freeresult($result); } + $template->assign_vars(array( + 'S_MCP_QUEUE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue"), + )); + if ($total == 0) { $template->assign_vars(array( diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 8a102a321d..598299e316 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -49,16 +49,7 @@ class fulltext_mysql extends search_backend { global $db, $user; - if (strpos($db->sql_layer, 'mysql') === false) - { - return $user->lang['FULLTEXT_MYSQL_INCOMPATIBLE_VERSION']; - } - - $result = $db->sql_query('SELECT VERSION() AS mysql_version'); - $version = $db->sql_fetchfield('mysql_version'); - $db->sql_freeresult($result); - - if (!preg_match('#^4|5|6#s', $version)) + if ($db->sql_layer != 'mysql4' && $db->sql_layer != 'mysqli') { return $user->lang['FULLTEXT_MYSQL_INCOMPATIBLE_VERSION']; } diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 676b2c9518..523e259618 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -18,9 +18,11 @@ class session var $page = array(); var $data = array(); var $browser = ''; + var $forwarded_for = ''; var $host = ''; var $session_id = ''; var $ip = ''; + var $ips = array(); var $load = 0; var $time_now = 0; var $update_session_page = true; @@ -145,9 +147,40 @@ class session $this->cookie_data = array('u' => 0, 'k' => ''); $this->update_session_page = $update_session_page; $this->browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? (string) $_SERVER['HTTP_USER_AGENT'] : ''; + $this->forwarded_for = (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) ? (string) $_SERVER['HTTP_X_FORWARDED_FOR'] : ''; $this->host = (!empty($_SERVER['HTTP_HOST'])) ? (string) $_SERVER['HTTP_HOST'] : 'localhost'; $this->page = $this->extract_current_page($phpbb_root_path); + // if the forwarded for header shall be checked we have to validate its contents + if ($config['forwarded_for_check']) + { + $this->forwarded_for = preg_replace('#, +#', ', ', $this->forwarded_for); + + // Whoa these look impressive! + // The code to generate the following two regular expressions which match valid IPv4/IPv6 addresses + // can be found in the develop directory + $ipv4 = '#^(?:(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])$#'; + $ipv6 = '#^(?:(?:(?:[\dA-F]{1,4}:){6}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])))|(?:::(?:[\dA-F]{1,4}:){5}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:):(?:[\dA-F]{1,4}:){4}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,2}:(?:[\dA-F]{1,4}:){3}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,3}:(?:[\dA-F]{1,4}:){2}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,4}:(?:[\dA-F]{1,4}:)(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,5}:(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,6}:[\dA-F]{1,4})|(?:(?:[\dA-F]{1,4}:){1,7}:))$#'; + + // split the list of IPs + $ips = explode(', ', $this->forwarded_for); + foreach ($ips as $ip) + { + // check IPv4 first, the IPv6 is hopefully only going to be used very seldomly + if (!preg_match("#^$ipv4$#", $this->forwarded_for) && !preg_match("#^$ipv6$#", $this->forwarded_for)) + { + if (!defined('DEBUG_EXTRA')) + { + trigger_error('Hacking attempt!'); + } + else + { + trigger_error('Invalid HTTP_X_FORWARDED_FOR header detected: ' . htmlspecialchars($this->forwarded_for)); + } + } + } + } + // Add forum to the page for tracking online users - also adding a "x" to the end to properly identify the number $this->page['page'] .= (isset($_REQUEST['f'])) ? ((strpos($this->page['page'], '?') !== false) ? '&' : '?') . '_f_=' . (int) $_REQUEST['f'] . 'x' : ''; @@ -216,7 +249,10 @@ class session $s_browser = ($config['browser_check']) ? strtolower(substr($this->data['session_browser'], 0, 149)) : ''; $u_browser = ($config['browser_check']) ? strtolower(substr($this->browser, 0, 149)) : ''; - if ($u_ip === $s_ip && $s_browser === $u_browser) + $s_forwarded_for = ($config['forwarded_for_check']) ? substr($this->data['forwarded_for'], 0, 254) : ''; + $u_forwarded_for = ($config['forwarded_for_check']) ? substr($this->forwarded_for, 0, 254) : ''; + + if ($u_ip === $s_ip && $s_browser === $u_browser && $s_forwarded_for === $u_forwarded_for) { $session_expired = false; @@ -278,7 +314,7 @@ class session // Added logging temporarly to help debug bugs... if (defined('DEBUG_EXTRA')) { - add_log('critical', 'LOG_IP_BROWSER_CHECK', $u_ip, $s_ip, $u_browser, $s_browser); + add_log('critical', 'LOG_IP_BROWSER_FORWARDED_CHECK', $u_ip, $s_ip, $u_browser, $s_browser, $u_forwarded, $s_forwarded); } } } @@ -447,7 +483,16 @@ class session // Is user banned? Are they excluded? Won't return on ban, exists within method if ($this->data['user_type'] != USER_FOUNDER) { - $this->check_ban($this->data['user_id'], $this->ip); + if (!$config['forwarded_for_check']) + { + $this->check_ban($this->data['user_id'], $this->ip); + } + else + { + $ips = explode(', ', $this->forwarded_for); + $ips[] = $this->ip; + $this->check_ban($this->data['user_id'], $ips); + } } $this->data['is_registered'] = (!$bot && $this->data['user_id'] != ANONYMOUS && ($this->data['user_type'] == USER_NORMAL || $this->data['user_type'] == USER_FOUNDER)) ? true : false; @@ -456,14 +501,17 @@ class session // If our friend is a bot, we re-assign a previously assigned session if ($this->data['is_bot'] && $bot == $this->data['user_id'] && $this->data['session_id']) { - // Only assign the current session if the ip and browser match... + // Only assign the current session if the ip, browser and forwarded_for match... $s_ip = implode('.', array_slice(explode('.', $this->data['session_ip']), 0, $config['ip_check'])); $u_ip = implode('.', array_slice(explode('.', $this->ip), 0, $config['ip_check'])); $s_browser = ($config['browser_check']) ? strtolower(substr($this->data['session_browser'], 0, 149)) : ''; $u_browser = ($config['browser_check']) ? strtolower(substr($this->browser, 0, 149)) : ''; - if ($u_ip === $s_ip && $s_browser === $u_browser) + $s_forwarded_for = ($config['forwarded_for_check']) ? substr($this->data['session_forwarded_for'], 0, 254) : ''; + $u_forwarded_for = ($config['forwarded_for_check']) ? substr($this->forwarded_for, 0, 254) : ''; + + if ($u_ip === $s_ip && $s_browser === $u_browser && $s_forwarded_for === $u_forwarded_for) { $this->session_id = $this->data['session_id']; @@ -512,6 +560,7 @@ class session 'session_last_visit' => (int) $this->data['session_last_visit'], 'session_time' => (int) $this->time_now, 'session_browser' => (string) $this->browser, + 'session_forwarded_for' => (string) $this->forwarded_for, 'session_ip' => (string) $this->ip, 'session_autologin' => ($session_autologin) ? 1 : 0, 'session_admin' => ($set_admin) ? 1 : 0, @@ -580,6 +629,14 @@ class session } else { + $this->data['session_time'] = $this->data['session_last_visit'] = $this->time_now; + + // Update the last visit time + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_lastvisit = ' . (int) $this->data['session_time'] . ' + WHERE user_id = ' . (int) $this->data['user_id']; + $db->sql_query($sql); + $SID = '?sid='; $_SID = ''; } @@ -757,8 +814,10 @@ class session * are passed to the method pre-existing session data is used. If $return is false * this routine does not return on finding a banned user, it outputs a relevant * message and stops execution. + * + * @param string|array $user_ips Can contain a string with one IP or an array of multiple IPs */ - function check_ban($user_id = false, $user_ip = false, $user_email = false, $return = false) + function check_ban($user_id = false, $user_ips = false, $user_email = false, $return = false) { global $config, $db; @@ -774,14 +833,14 @@ class session $sql .= " AND ban_email = ''"; } - if ($user_ip === false) + if ($user_ips === false) { - $sql .= " AND (ban_ip = '' OR (ban_ip <> '' AND ban_exclude = 1))"; + $sql .= " AND (ban_ip = '' OR ban_exclude = 1)"; } if ($user_id === false) { - $sql .= ' AND (ban_userid = 0 OR (ban_userid <> 0 AND ban_exclude = 1))'; + $sql .= ' AND (ban_userid = 0 OR ban_exclude = 1)'; } else { @@ -792,7 +851,7 @@ class session $sql .= " OR ban_email <> ''"; } - if ($user_ip !== false) + if ($user_ips !== false) { $sql .= " OR ban_ip <> ''"; } @@ -806,7 +865,7 @@ class session while ($row = $db->sql_fetchrow($result)) { if ((!empty($row['ban_userid']) && intval($row['ban_userid']) == $user_id) || - (!empty($row['ban_ip']) && preg_match('#^' . str_replace('*', '.*?', $row['ban_ip']) . '$#i', $user_ip)) || + (!empty($row['ban_ip']) && preg_match('#^' . str_replace('*', '.*?', $row['ban_ip']) . '$#i', $user_ips)) || (!empty($row['ban_email']) && preg_match('#^' . str_replace('*', '.*?', $row['ban_email']) . '$#i', $user_email))) { if (!empty($row['ban_exclude'])) @@ -823,7 +882,7 @@ class session { $ban_triggered_by = 'user'; } - else if (!empty($row['ban_ip']) && preg_match('#^' . str_replace('*', '.*?', $row['ban_ip']) . '$#i', $user_ip)) + else if (!empty($row['ban_ip']) && preg_match('#^' . str_replace('*', '.*?', $row['ban_ip']) . '$#i', $user_ips)) { $ban_triggered_by = 'ip'; } @@ -1253,7 +1312,7 @@ class user extends session // Is load exceeded? if ($config['limit_load'] && $this->load !== false) { - if ($this->load > floatval($config['limit_load']) && !defined('IN_LOGIN') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_gets('a_', 'm_')) + if ($this->load > floatval($config['limit_load']) && !defined('IN_LOGIN') && !$auth->acl_gets('a_', 'm_') && !$auth->acl_getf_global('m_')) { trigger_error('BOARD_UNAVAILABLE'); } diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 6764dd9d43..2ddd5766d4 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -468,7 +468,7 @@ function get_user_information($user_id, $user_row) if (!empty($user_row['user_allow_viewemail']) || $auth->acl_get('a_email')) { - $user_row['email'] = ($config['board_email_form'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=email&u=$user_id") : (($config['board_hide_emails'] && !$auth->acl_get('a_email')) ? '' : 'mailto:' . $user_row['user_email']); + $user_row['email'] = ($config['board_email_form'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=email&u=$user_id") : ((($config['board_hide_emails'] && !$auth->acl_get('a_email')) || empty($user_row['user_email'])) ? '' : 'mailto:' . $user_row['user_email']); } else { diff --git a/phpBB/index.php b/phpBB/index.php index 59e51bac49..83d8dbdac0 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -61,7 +61,7 @@ $db->sql_freeresult($result); $birthday_list = ''; if ($config['load_birthdays']) { - $now = getdate(time() + $user->timezone + $user->dst - (date('H', time()) - gmdate('H', time())) * 3600); + $now = getdate(time() + $user->timezone + $user->dst - date('Z')); $sql = 'SELECT user_id, username, user_colour, user_birthday FROM ' . USERS_TABLE . " WHERE user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', $now['mday'], $now['mon'])) . "%' diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index e9d429f45c..389008f393 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -314,7 +314,10 @@ $database_update_info = array( // Add the following columns 'add_columns' => array( CONFIRM_TABLE => array( - 'seed' => array('UINT:10', 0), + 'seed' => array('UINT:10', 0), + ), + SESSIONS_TABLE => array( + 'session_forwarded_for' => array('VCHAR:255', 0), ), ), ), diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index e983744fb7..0f01640a85 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -961,6 +961,7 @@ CREATE TABLE phpbb_sessions ( session_time INTEGER DEFAULT 0 NOT NULL, session_ip VARCHAR(40) CHARACTER SET NONE DEFAULT '' NOT NULL, session_browser VARCHAR(150) CHARACTER SET NONE DEFAULT '' NOT NULL, + session_forwarded_for VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, session_page VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, session_viewonline INTEGER DEFAULT 1 NOT NULL, session_autologin INTEGER DEFAULT 0 NOT NULL, diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 9e0e90d48c..888f66f472 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -1141,6 +1141,7 @@ CREATE TABLE [phpbb_sessions] ( [session_time] [int] DEFAULT (0) NOT NULL , [session_ip] [varchar] (40) DEFAULT ('') NOT NULL , [session_browser] [varchar] (150) DEFAULT ('') NOT NULL , + [session_forwarded_for] [varchar] (255) DEFAULT ('') NOT NULL , [session_page] [varchar] (255) DEFAULT ('') NOT NULL , [session_viewonline] [int] DEFAULT (1) NOT NULL , [session_autologin] [int] DEFAULT (0) NOT NULL , diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index 635faf81a5..27d36edd12 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -662,6 +662,7 @@ CREATE TABLE phpbb_sessions ( session_time int(11) UNSIGNED DEFAULT '0' NOT NULL, session_ip varchar(40) DEFAULT '' NOT NULL, session_browser varchar(150) DEFAULT '' NOT NULL, + session_forwarded_for varchar(255) DEFAULT '' NOT NULL, session_page text NOT NULL, session_viewonline tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, session_autologin tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index 99e16ac4c8..4b6d4b008b 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -662,6 +662,7 @@ CREATE TABLE phpbb_sessions ( session_time int(11) UNSIGNED DEFAULT '0' NOT NULL, session_ip varchar(40) DEFAULT '' NOT NULL, session_browser varchar(150) DEFAULT '' NOT NULL, + session_forwarded_for varchar(255) DEFAULT '' NOT NULL, session_page varchar(255) DEFAULT '' NOT NULL, session_viewonline tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, session_autologin tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index c267fff059..7a5f05c274 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -1280,6 +1280,7 @@ CREATE TABLE phpbb_sessions ( session_time number(11) DEFAULT '0' NOT NULL, session_ip varchar2(40) DEFAULT '' , session_browser varchar2(150) DEFAULT '' , + session_forwarded_for varchar2(255) DEFAULT '' , session_page varchar2(765) DEFAULT '' , session_viewonline number(1) DEFAULT '1' NOT NULL, session_autologin number(1) DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index 206dff3b2e..5eb8775adf 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -876,6 +876,7 @@ CREATE TABLE phpbb_sessions ( session_time INT4 DEFAULT '0' NOT NULL CHECK (session_time >= 0), session_ip varchar(40) DEFAULT '' NOT NULL, session_browser varchar(150) DEFAULT '' NOT NULL, + session_forwarded_for varchar(255) DEFAULT '' NOT NULL, session_page varchar(255) DEFAULT '' NOT NULL, session_viewonline INT2 DEFAULT '1' NOT NULL CHECK (session_viewonline >= 0), session_autologin INT2 DEFAULT '0' NOT NULL CHECK (session_autologin >= 0), diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index ea85966656..d4c72a2989 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -86,6 +86,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_post_confir INSERT INTO phpbb_config (config_name, config_value) VALUES ('flood_interval', '15'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('force_server_vars', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('forward_pm', '1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('forwarded_for_check', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('full_folder_action', '2'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_mysql_max_word_len', '254'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_mysql_min_word_len', '4'); @@ -114,8 +115,10 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_resource', '') INSERT INTO phpbb_config (config_name, config_value) VALUES ('jab_username', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_base_dn', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_email', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_password', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_server', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_uid', ''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ldap_user', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('limit_load', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('limit_search_load', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_anon_lastread', '0'); diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index ba86abe6e4..9ddbb6bb8b 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -640,6 +640,7 @@ CREATE TABLE phpbb_sessions ( session_time INTEGER UNSIGNED NOT NULL DEFAULT '0', session_ip varchar(40) NOT NULL DEFAULT '', session_browser varchar(150) NOT NULL DEFAULT '', + session_forwarded_for varchar(255) NOT NULL DEFAULT '', session_page varchar(255) NOT NULL DEFAULT '', session_viewonline INTEGER UNSIGNED NOT NULL DEFAULT '1', session_autologin INTEGER UNSIGNED NOT NULL DEFAULT '0', diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index e34c65bf90..cfce514ebf 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -281,16 +281,21 @@ $lang = array_merge($lang, array( 'APACHE_SETUP_BEFORE_USE' => 'You have to setup apache authentication before you switch phpBB to this authentication method. Keep in mind that the username you use for apache authentication has to be the same as your phpBB username.', - 'LDAP_DN' => 'LDAP base dn', - 'LDAP_DN_EXPLAIN' => 'This is the Distinguished Name, locating the user information, e.g. o=My Company,c=US', - 'LDAP_EMAIL' => 'LDAP email attribute', - 'LDAP_EMAIL_EXPLAIN' => 'Set this to the name of your user entry email attribute (if one exists) in order to automatically set the email address for new users. Leaving this empty results in empty email address for users who log in for the first time.', - 'LDAP_NO_EMAIL' => 'The specified email attribute does not exist.', - 'LDAP_NO_IDENTITY' => 'Could not find a login identity for %s', - 'LDAP_SERVER' => 'LDAP server name', - 'LDAP_SERVER_EXPLAIN' => 'If using LDAP this is the name or IP address of the server.', - 'LDAP_UID' => 'LDAP uid', - 'LDAP_UID_EXPLAIN' => 'This is the key under which to search for a given login identity, e.g. uid, sn, etc.', + 'LDAP_DN' => 'LDAP base dn', + 'LDAP_DN_EXPLAIN' => 'This is the Distinguished Name, locating the user information, e.g. o=My Company,c=US', + 'LDAP_EMAIL' => 'LDAP email attribute', + 'LDAP_EMAIL_EXPLAIN' => 'Set this to the name of your user entry email attribute (if one exists) in order to automatically set the email address for new users. Leaving this empty results in empty email address for users who log in for the first time.', + 'LDAP_INCORRECT_USER_PASSWORD' => 'Binding to LDAP server failed with specified user/password.', + 'LDAP_NO_EMAIL' => 'The specified email attribute does not exist.', + 'LDAP_NO_IDENTITY' => 'Could not find a login identity for %s', + 'LDAP_PASSWORD' => 'LDAP password', + 'LDAP_PASSWORD_EXPLAIN' => 'Leave blank to use anonymous access. Else fill in the password for the above user. WARNING: This password will be stored as plain text in the database visible to everybody who can access your database.', + 'LDAP_SERVER' => 'LDAP server name', + 'LDAP_SERVER_EXPLAIN' => 'If using LDAP this is the name or IP address of the server.', + 'LDAP_UID' => 'LDAP uid', + 'LDAP_UID_EXPLAIN' => 'This is the key under which to search for a given login identity, e.g. uid, sn, etc.', + 'LDAP_USER' => 'LDAP user', + 'LDAP_USER_EXPLAIN' => 'Leave blank to use anonymous access. If filled in phpBB will connect to the LDAP server as the specified user.', )); // Server Settings diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 096efc9c52..7253334bd3 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -510,7 +510,7 @@ $lang = array_merge($lang, array( 'LOG_INSTALL_CONVERTED' => 'Converted from %1$s to phpBB %2$s', 'LOG_INSTALL_INSTALLED' => 'Installed phpBB %s', - 'LOG_IP_BROWSER_CHECK' => 'Session IP/browser check failed
»User IP "%1$s" checked against session IP "%2$s" and user browser string "%3$s" checked against session browser string "%4$s".', + 'LOG_IP_BROWSER_FORWARDED_CHECK' => 'Session IP/browser/X_FORWARDED_FOR check failed
»User IP "%1$s" checked against session IP "%2$s", user browser string "%3$s" checked against session browser string "%4$s" and user X_FORWARDED_FOR string "%5$s" checked against session X_FORWARDED_FOR string "%6$s".', 'LOG_JAB_CHANGED' => 'Jabber account changed', 'LOG_JAB_PASSCHG' => 'Jabber password changed', diff --git a/phpBB/language/en/acp/language.php b/phpBB/language/en/acp/language.php index acfc45e916..1707fbaa3c 100644 --- a/phpBB/language/en/acp/language.php +++ b/phpBB/language/en/acp/language.php @@ -58,7 +58,7 @@ $lang = array_merge($lang, array( 'LANGUAGE_PACK_LOCALNAME' => 'Local name', 'LANGUAGE_PACK_NAME' => 'Name', 'LANGUAGE_PACK_NOT_EXIST' => 'The selected language pack does not exist.', - 'LANGUAGE_PACK_USED_BY' => 'Used by', + 'LANGUAGE_PACK_USED_BY' => 'Used by (including robots)', 'LANGUAGE_VARIABLE' => 'Language Variable', 'LANG_AUTHOR' => 'Language Pack Author', 'LANG_ENGLISH_NAME' => 'English name', diff --git a/phpBB/language/en/acp/styles.php b/phpBB/language/en/acp/styles.php index 27ecbdb261..4456325bd3 100644 --- a/phpBB/language/en/acp/styles.php +++ b/phpBB/language/en/acp/styles.php @@ -354,7 +354,7 @@ $lang = array_merge($lang, array( 'STYLE_NAME' => 'Style name', 'STYLE_TEMPLATE' => 'Template', 'STYLE_THEME' => 'Theme', - 'STYLE_USED_BY' => 'Used by', + 'STYLE_USED_BY' => 'Used by (including robots)', 'TEMPLATE_ADDED' => 'Template set added and stored on filesystem.', 'TEMPLATE_ADDED_DB' => 'Template set added and stored in database.', diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index f7efa43691..b06fbea482 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -1425,7 +1425,7 @@ function show_profile($data) if ($bday_year) { - $now = getdate(time() + $user->timezone + $user->dst - (date('H', time()) - gmdate('H', time())) * 3600); + $now = getdate(time() + $user->timezone + $user->dst - date('Z')); $diff = $now['mon'] - $bday_month; if ($diff == 0) diff --git a/phpBB/search.php b/phpBB/search.php index ef3fa572c0..e8898141c0 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -960,6 +960,12 @@ while ($row = $db->sql_fetchrow($result)) $holding = ''; } } + +if ($holding) +{ + $s_forums .= $holding; +} + $db->sql_freeresult($result); unset($pad_store); diff --git a/phpBB/styles/subSilver/template/mcp_front.html b/phpBB/styles/subSilver/template/mcp_front.html index 41fbb19a3a..3404663a1c 100644 --- a/phpBB/styles/subSilver/template/mcp_front.html +++ b/phpBB/styles/subSilver/template/mcp_front.html @@ -1,9 +1,11 @@ +
+ - + @@ -11,6 +13,7 @@ + @@ -19,17 +22,29 @@ + - + - + + + + +
{L_LATEST_UNAPPROVED}{L_LATEST_UNAPPROVED}
 {L_FORUM}  {L_SUBJECT}   {L_AUTHOR}   {L_POST_TIME}  {L_SELECT} 
{unapproved.SUBJECT}
[ {L_VIEW_DETAILS} ]
{unapproved.AUTHOR}{unapproved.AUTHOR} {unapproved.POST_TIME}
{L_UNAPPROVED_POSTS_ZERO_TOTAL}{L_UNAPPROVED_POSTS_ZERO_TOTAL}
{L_UNAPPROVED_TOTAL}{L_UNAPPROVED_TOTAL}
  
+ +
+ + + + +
{L_MARK_ALL} :: {L_UNMARK_ALL}


diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index d7ef0697c1..524fad6909 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -880,7 +880,7 @@ $sql = $db->sql_build_query('SELECT', array( $result = $db->sql_query($sql); -$now = getdate(time() + $user->timezone + $user->dst - (date('H', time()) - gmdate('H', time())) * 3600); +$now = getdate(time() + $user->timezone + $user->dst - date('Z')); // Posts are stored in the $rowset array while $attach_list, $user_cache // and the global bbcode_bitfield are built From c02215f7ccaf98174f87795e312273a1d85eaf44 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 10 Dec 2006 18:06:27 +0000 Subject: [PATCH 061/264] add the added config vars git-svn-id: file:///svn/phpbb/trunk@6741 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 389008f393..92e0e593fa 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -512,8 +512,11 @@ if (version_compare($current_version, '3.0.b3', '<')) if (version_compare($current_version, '3.0.b4', '<')) { - // Add config value + // Add config values set_config('script_path', '/'); + set_config('forwarded_for_check', '0'); + set_config('ldap_password', ''); + set_config('ldap_user', ''); $no_updates = false; } From 7eff1949cac08271fd745feb20564ee7dc9bee80 Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 10 Dec 2006 18:14:47 +0000 Subject: [PATCH 062/264] #5242 git-svn-id: file:///svn/phpbb/trunk@6742 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_user.php | 18 ++++++++++++++---- phpBB/install/database_update.php | 10 ++++++++++ phpBB/install/schemas/schema_data.sql | 1 + 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 3272c9663e..b45de4a6db 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -77,7 +77,7 @@ function update_last_username() global $db; // Get latest username - $sql = 'SELECT user_id, username + $sql = 'SELECT user_id, username, user_colour FROM ' . USERS_TABLE . ' WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ') ORDER BY user_id DESC'; @@ -89,6 +89,7 @@ function update_last_username() { set_config('newest_user_id', $row['user_id'], true); set_config('newest_username', $row['username'], true); + set_config('newest_user_colour', $row['user_colour'], true); } } @@ -142,7 +143,7 @@ function user_add($user_row, $cp_data = false) 'username' => $user_row['username'], 'username_clean' => utf8_clean_string($user_row['username']), 'user_password' => (isset($user_row['user_password'])) ? $user_row['user_password'] : '', - 'user_pass_convert' => 0, + //'user_pass_convert' => 0, 'user_email' => strtolower($user_row['user_email']), 'user_email_hash' => (int) crc32(strtolower($user_row['user_email'])) . strlen($user_row['user_email']), 'group_id' => $user_row['group_id'], @@ -244,7 +245,7 @@ function user_add($user_row, $cp_data = false) $db->sql_query($sql); // Now make it the users default group... - group_set_user_default($user_row['group_id'], array($user_id)); + group_set_user_default($user_row['group_id'], array($user_id), false, true); // set the newest user and adjust the user count if the user is a normal user and no activation mail is sent if ($user_row['user_type'] == USER_NORMAL) @@ -2043,7 +2044,7 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna /** * Set users default group */ -function group_set_user_default($group_id, $user_id_ary, $group_attributes = false) +function group_set_user_default($group_id, $user_id_ary, $group_attributes = false, $new_user = false) { global $db; @@ -2126,6 +2127,15 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal $sql = 'UPDATE ' . TOPICS_TABLE . " SET topic_last_poster_colour = '" . $db->sql_escape($sql_ary['user_colour']) . "' WHERE " . $db->sql_in_set('topic_last_poster_id', $user_id_ary); $db->sql_query($sql); + + $sql = 'UPDATE ' . TOPICS_TABLE . " SET topic_last_poster_colour = '" . $db->sql_escape($sql_ary['user_colour']) . "' + WHERE " . $db->sql_in_set('topic_last_poster_id', $user_id_ary); + $db->sql_query($sql); + + if ($new_user || in_array($config['newest_user_id'], $user_id_ary)) + { + set_config('newest_user_colour', $sql_ary['user_colour'], true); + } } } diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 92e0e593fa..5717dbc4d2 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -518,6 +518,16 @@ if (version_compare($current_version, '3.0.b4', '<')) set_config('ldap_password', ''); set_config('ldap_user', ''); + $sql = 'SELECT user_colour + FROM ' . USERS_TABLE . ' + WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ') + ORDER BY user_id DESC'; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + set_config('newest_user_colour', $row['user_colour'], true); + $no_updates = false; } diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index d4c72a2989..abc6021deb 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -210,6 +210,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '144 INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('cache_last_gc', '0', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('database_last_gc', '0', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('last_queue_run', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('newest_user_colour', 'AA0000', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('newest_user_id', '2', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('newest_username', '', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_files', '0', 1); From 9b03d2a67e5d295d8b50d6b180c22cfcfc0d6742 Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 10 Dec 2006 18:23:49 +0000 Subject: [PATCH 063/264] blah git-svn-id: file:///svn/phpbb/trunk@6743 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_user.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index b45de4a6db..da3bc1fa1f 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -143,7 +143,7 @@ function user_add($user_row, $cp_data = false) 'username' => $user_row['username'], 'username_clean' => utf8_clean_string($user_row['username']), 'user_password' => (isset($user_row['user_password'])) ? $user_row['user_password'] : '', - //'user_pass_convert' => 0, + 'user_pass_convert' => 0, 'user_email' => strtolower($user_row['user_email']), 'user_email_hash' => (int) crc32(strtolower($user_row['user_email'])) . strlen($user_row['user_email']), 'group_id' => $user_row['group_id'], @@ -2128,10 +2128,6 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal WHERE " . $db->sql_in_set('topic_last_poster_id', $user_id_ary); $db->sql_query($sql); - $sql = 'UPDATE ' . TOPICS_TABLE . " SET topic_last_poster_colour = '" . $db->sql_escape($sql_ary['user_colour']) . "' - WHERE " . $db->sql_in_set('topic_last_poster_id', $user_id_ary); - $db->sql_query($sql); - if ($new_user || in_array($config['newest_user_id'], $user_id_ary)) { set_config('newest_user_colour', $sql_ary['user_colour'], true); From 81832ca6452edc04085d8e098132694121700780 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sun, 10 Dec 2006 20:13:46 +0000 Subject: [PATCH 064/264] I'm a little oblivious today ;-) git-svn-id: file:///svn/phpbb/trunk@6744 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_board.php | 1 + phpBB/includes/session.php | 27 +++++++++++++++++++++++---- phpBB/language/en/acp/board.php | 2 ++ 3 files changed, 26 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index d67cfba2f3..9638accc26 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -306,6 +306,7 @@ class acp_board 'max_autologin_time' => array('lang' => 'AUTOLOGIN_LENGTH', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true), 'ip_check' => array('lang' => 'IP_VALID', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_ip_check', 'explain' => true), 'browser_check' => array('lang' => 'BROWSER_VALID', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'forwarded_for_check' => array('lang' => 'FORWARDED_FOR_VALID', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'check_dnsbl' => array('lang' => 'CHECK_DNSBL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'email_check_mx' => array('lang' => 'EMAIL_CHECK_MX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true), diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 523e259618..91bdffc794 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -22,7 +22,6 @@ class session var $host = ''; var $session_id = ''; var $ip = ''; - var $ips = array(); var $load = 0; var $time_now = 0; var $update_session_page = true; @@ -167,7 +166,7 @@ class session foreach ($ips as $ip) { // check IPv4 first, the IPv6 is hopefully only going to be used very seldomly - if (!preg_match("#^$ipv4$#", $this->forwarded_for) && !preg_match("#^$ipv6$#", $this->forwarded_for)) + if (!empty($ip) && !preg_match($ipv4, $this->forwarded_for) && !preg_match($ipv6, $this->forwarded_for)) { if (!defined('DEBUG_EXTRA')) { @@ -249,7 +248,7 @@ class session $s_browser = ($config['browser_check']) ? strtolower(substr($this->data['session_browser'], 0, 149)) : ''; $u_browser = ($config['browser_check']) ? strtolower(substr($this->browser, 0, 149)) : ''; - $s_forwarded_for = ($config['forwarded_for_check']) ? substr($this->data['forwarded_for'], 0, 254) : ''; + $s_forwarded_for = ($config['forwarded_for_check']) ? substr($this->data['session_forwarded_for'], 0, 254) : ''; $u_forwarded_for = ($config['forwarded_for_check']) ? substr($this->forwarded_for, 0, 254) : ''; if ($u_ip === $s_ip && $s_browser === $u_browser && $s_forwarded_for === $u_forwarded_for) @@ -864,8 +863,28 @@ class session $ban_triggered_by = 'user'; while ($row = $db->sql_fetchrow($result)) { + $ip_banned = false; + if (!empty($row['ban_ip'])) + { + if (!is_array($user_ips)) + { + $ip_banned = preg_match('#^' . str_replace('*', '.*?', $row['ban_ip']) . '$#i', $user_ips); + } + else + { + foreach ($user_ips as $user_ip) + { + if (preg_match('#^' . str_replace('*', '.*?', $row['ban_ip']) . '$#i', $user_ip)) + { + $ip_banned = true; + break; + } + } + } + } + if ((!empty($row['ban_userid']) && intval($row['ban_userid']) == $user_id) || - (!empty($row['ban_ip']) && preg_match('#^' . str_replace('*', '.*?', $row['ban_ip']) . '$#i', $user_ips)) || + $ip_banned || (!empty($row['ban_email']) && preg_match('#^' . str_replace('*', '.*?', $row['ban_email']) . '$#i', $user_email))) { if (!empty($row['ban_exclude'])) diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index cfce514ebf..d3d3a3d6d0 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -346,6 +346,8 @@ $lang = array_merge($lang, array( 'EMAIL_CHECK_MX_EXPLAIN' => 'If enabled, the email 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 or zero to disable.', + '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', 'IP_VALID_EXPLAIN' => 'Determines how much of the users IP is used to validate a session; All compares the complete address, A.B.C the first x.x.x, A.B the first x.x, None disables checking.', 'MAX_LOGIN_ATTEMPTS' => 'Maximum number of login attempts', From f8aa743b5f50d67c7ba6d5982083e1185a849107 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sun, 10 Dec 2006 21:31:35 +0000 Subject: [PATCH 065/264] I'm very oblivious today :@ git-svn-id: file:///svn/phpbb/trunk@6745 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/session.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 91bdffc794..3be378747e 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -166,7 +166,7 @@ class session foreach ($ips as $ip) { // check IPv4 first, the IPv6 is hopefully only going to be used very seldomly - if (!empty($ip) && !preg_match($ipv4, $this->forwarded_for) && !preg_match($ipv6, $this->forwarded_for)) + if (!empty($ip) && !preg_match($ipv4, $this->forwarded_for) && !preg_match($ipv6, $ip)) { if (!defined('DEBUG_EXTRA')) { From 96858686ff822a6b83c3c4b1704bfed5c9766906 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sun, 10 Dec 2006 21:33:01 +0000 Subject: [PATCH 066/264] Haha, slowly it's starting to look stupid ... git-svn-id: file:///svn/phpbb/trunk@6746 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/session.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 3be378747e..229b7f10eb 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -166,7 +166,7 @@ class session foreach ($ips as $ip) { // check IPv4 first, the IPv6 is hopefully only going to be used very seldomly - if (!empty($ip) && !preg_match($ipv4, $this->forwarded_for) && !preg_match($ipv6, $ip)) + if (!empty($ip) && !preg_match($ipv4, $ip) && !preg_match($ipv6, $ip)) { if (!defined('DEBUG_EXTRA')) { From 91648953010419115776758615679ef894f519cf Mon Sep 17 00:00:00 2001 From: David M Date: Mon, 11 Dec 2006 20:07:57 +0000 Subject: [PATCH 067/264] #6164 git-svn-id: file:///svn/phpbb/trunk@6747 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_database.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index f1449853ad..1059d4940d 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -1325,7 +1325,7 @@ class acp_database if ($has_index_type === null) { - if ($db->sql_layer === 'mysqli' || version_compare($this->mysql_version, '4.0.2', '>=')) + if ($db->sql_layer === 'mysqli' || version_compare($db->mysql_version, '4.0.2', '>=')) { $has_index_type = true; } From f2bdbcfecdc890b54cc32c8d8544d95367607d10 Mon Sep 17 00:00:00 2001 From: David M Date: Mon, 11 Dec 2006 20:13:33 +0000 Subject: [PATCH 068/264] #6158 git-svn-id: file:///svn/phpbb/trunk@6748 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_user.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index da3bc1fa1f..449d436001 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -2128,6 +2128,8 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal WHERE " . $db->sql_in_set('topic_last_poster_id', $user_id_ary); $db->sql_query($sql); + global $config; + if ($new_user || in_array($config['newest_user_id'], $user_id_ary)) { set_config('newest_user_colour', $sql_ary['user_colour'], true); From 6875bd59b4eb4bedd9b62855d2d9f571169690a4 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 12 Dec 2006 09:55:15 +0000 Subject: [PATCH 069/264] until nils comes to inspecting this further we will use this "workaround" git-svn-id: file:///svn/phpbb/trunk@6750 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/message_parser.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 561b2d79da..ebac61dd8f 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -799,16 +799,23 @@ class bbcode_firstpass extends bbcode return ''; } - // Checking urls - if (preg_match('#' . preg_quote(generate_board_url(), '#') . '/([^ \t\n\r<"\']+)#i', $url) || - preg_match('#([\w]+?://.*?[^ \t\n\r<"\']*)#i', $url) || - preg_match('#(www\.[\w\-]+\.[\w\-.\~]+(?:/[^ \t\n\r<"\']*)?)#i', $url)) + // Before we check anything, we make sure certain characters are not included + if (!preg_match('#[\t\n\r<"\']#', $url)) { - $valid = true; + // Checking urls + if (preg_match('#' . preg_quote(generate_board_url(), '#') . '/([^ \t\n\r<"\']+)#i', $url) || + preg_match('#([\w]+?://.*?[^ \t\n\r<"\']*)#i', $url) || + preg_match('#(www\.[\w\-]+\.[\w\-.\~]+(?:/[^ \t\n\r<"\']*)?)#i', $url)) + { + $valid = true; + } } if ($valid) { + // Do we want to transform some characters? + $url = str_replace(' ', '%20', $url); + $this->parsed_items['url']++; if (!preg_match('#^[\w]+?://.*?#i', $url)) From 515993f5aead7b10584956fbf6d9dffe8705ecd4 Mon Sep 17 00:00:00 2001 From: Jonathan Stanley Date: Tue, 12 Dec 2006 17:53:13 +0000 Subject: [PATCH 070/264] Begone hardcoded ellipsis of the secret template! Putting into language file so that it is i18n/L10n-able... git-svn-id: file:///svn/phpbb/trunk@6751 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/common.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 541d004f11..5469ec7ed2 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -444,17 +444,18 @@ $lang = array_merge($lang, array( 'RULES_VOTE_CANNOT' => 'You cannot vote in polls in this forum', 'SEARCH' => 'Search', + 'SEARCH_MINI' => 'Search…', 'SEARCH_ADV' => 'Advanced search', 'SEARCH_ADV_EXPLAIN' => 'View the advanced search options', 'SEARCH_KEYWORDS' => 'Search for keywords', 'SEARCHING_FORUMS' => 'Searching forums', 'SEARCH_ACTIVE_TOPICS' => 'View active topics', 'SEARCH_FOR' => 'Search for', - 'SEARCH_FORUM' => 'Search this forum', + 'SEARCH_FORUM' => 'Search this forum…', 'SEARCH_NEW' => 'View new posts', 'SEARCH_POSTS_BY' => 'Search posts by', 'SEARCH_SELF' => 'View your posts', - 'SEARCH_TOPIC' => 'Search this topic', + 'SEARCH_TOPIC' => 'Search this topic…', 'SEARCH_UNANSWERED' => 'View unanswered posts', 'SECONDS' => 'Seconds', 'SELECT' => 'Select', From a2e512b2181c333ff7f8d86e9e210d9d674b3ccd Mon Sep 17 00:00:00 2001 From: David M Date: Wed, 13 Dec 2006 00:56:56 +0000 Subject: [PATCH 071/264] #6192 - i wanted to do this using streams but found myself unable to do so. if one could figure out how to do so, i would like to find out :D git-svn-id: file:///svn/phpbb/trunk@6752 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_database.php | 131 +++++++++------------------- 1 file changed, 41 insertions(+), 90 deletions(-) diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 1059d4940d..7da2044471 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -90,7 +90,6 @@ class acp_database $open = 'bzopen'; $write = 'bzwrite'; $close = 'bzclose'; - $oper = 'bzcompress'; $mimetype = 'application/x-bzip2'; break; case 'gzip': @@ -98,7 +97,6 @@ class acp_database $open = 'gzopen'; $write = 'gzwrite'; $close = 'gzclose'; - $oper = 'gzencode'; $mimetype = 'application/x-gzip'; break; } @@ -106,6 +104,25 @@ class acp_database // We write the file to "store" first (and then compress the file) to not use too much // memory. The server process can be easily killed by storing too much data at once. + if ($download == true) + { + $fh = fopen('php://output', 'wb'); + + switch ($format) + { + case 'bzip2': + ob_start('ob_bz2handler'); + break; + case 'gzip': + ob_start('ob_gzhandler'); + break; + } + + $name = $filename . $ext; + header('Pragma: no-cache'); + header("Content-Type: $mimetype; name=\"$name\""); + header("Content-disposition: attachment; filename=$name"); + } if ($store == true) { @@ -119,14 +136,6 @@ class acp_database } } - if ($download == true) - { - $name = $filename . $ext; - header('Pragma: no-cache'); - header("Content-Type: $mimetype; name=\"$name\""); - header("Content-disposition: attachment; filename=$name"); - } - // All of the generated queries go here $sql_data = ''; $sql_data .= "#\n"; @@ -215,14 +224,7 @@ class acp_database if ($download == true) { - if (!empty($oper)) - { - echo $oper($sql_data); - } - else - { - echo $sql_data; - } + fwrite($fh, $sql_data); } $sql_data = ''; @@ -284,14 +286,7 @@ class acp_database if ($download == true) { - if (!empty($oper)) - { - echo $oper($sql_data); - } - else - { - echo $sql_data; - } + fwrite($fh, $sql_data); } $sql_data = ''; @@ -358,14 +353,7 @@ class acp_database if ($download == true) { - if (!empty($oper)) - { - echo $oper($sql_data); - } - else - { - echo $sql_data; - } + fwrite($fh, $sql_data); } $sql_data = ''; } @@ -447,14 +435,7 @@ class acp_database if ($download == true) { - if (!empty($oper)) - { - echo $oper($sql_data); - } - else - { - echo $sql_data; - } + fwrite($fh, $sql_data); } $sql_data = ''; @@ -548,14 +529,7 @@ class acp_database if ($download == true) { - if (!empty($oper)) - { - echo $oper($sql_data); - } - else - { - echo $sql_data; - } + fwrite($fh, $sql_data); } $sql_data = ''; @@ -669,14 +643,7 @@ class acp_database if ($download == true) { - if (!empty($oper)) - { - echo $oper($sql_data); - } - else - { - echo $sql_data; - } + fwrite($fh, $sql_data); } $sql_data = ''; @@ -780,14 +747,7 @@ class acp_database if ($download == true) { - if (!empty($oper)) - { - echo $oper($sql_data); - } - else - { - echo $sql_data; - } + fwrite($fh, $sql_data); } $sql_data = ''; @@ -875,14 +835,7 @@ class acp_database if ($download == true) { - if (!empty($oper)) - { - echo $oper($sql_data); - } - else - { - echo $sql_data; - } + fwrite($fh, $sql_data); } $sql_data = ''; @@ -959,14 +912,7 @@ class acp_database if ($download == true) { - if (!empty($oper)) - { - echo $oper($sql_data); - } - else - { - echo $sql_data; - } + fwrite($fh, $sql_data); } $sql_data = ''; @@ -999,14 +945,8 @@ class acp_database if ($download == true) { - if (!empty($oper)) - { - echo $oper($sql_data); - } - else - { - echo $sql_data; - } + fwrite($fh, $sql_data); + fclose($fh); exit; } @@ -2025,4 +1965,15 @@ class acp_database } } +// Internal handler for BZip2 +function ob_bz2handler($data, $mode) +{ + static $internal = ''; + $internal .= $data; + if ($mode & PHP_OUTPUT_HANDLER_END) + { + return bzcompress($internal); + } +} + ?> \ No newline at end of file From 37de46aede999bc362b89d043d4755702c5cd08f Mon Sep 17 00:00:00 2001 From: Jonathan Stanley Date: Wed, 13 Dec 2006 21:18:41 +0000 Subject: [PATCH 072/264] #5708 git-svn-id: file:///svn/phpbb/trunk@6753 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/email/group_added.txt | 2 +- phpBB/language/en/help_faq.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/language/en/email/group_added.txt b/phpBB/language/en/email/group_added.txt index eb0c96e58d..58a44c12a8 100644 --- a/phpBB/language/en/email/group_added.txt +++ b/phpBB/language/en/email/group_added.txt @@ -3,7 +3,7 @@ Subject: You have been added to this usergroup Congratulations, You have been added to the “{GROUP_NAME}” group on “{SITENAME}”. -This action was done by a group moderator or the site administrator, contact them for more information. +This action was done by a group leader or the site administrator, contact them for more information. You can view your groups information here: {U_GROUP} diff --git a/phpBB/language/en/help_faq.php b/phpBB/language/en/help_faq.php index 9e68ebf393..d536d7c352 100644 --- a/phpBB/language/en/help_faq.php +++ b/phpBB/language/en/help_faq.php @@ -216,11 +216,11 @@ $help = array( ), array( 0 => 'How do I join a Usergroup?', - 1 => 'To join a Usergroup click the Usergroup link within your User Control Panel, you can then view all usergroups. Not all groups are open access, some may require approval to join, some are closed and some may even have hidden memberships. If the group is open then you can join it by clicking the appropriate button. If a group requires approval to join you may request to join it by clicking the appropriate button. The user group moderator will need to approve your request, they may ask why you want to join the group. Please do not pester a group moderator if they turn your request down, they will have their reasons.' + 1 => 'To join a Usergroup click the Usergroup link within your User Control Panel, you can then view all usergroups. Not all groups are open access, some may require approval to join, some are closed and some may even have hidden memberships. If the group is open then you can join it by clicking the appropriate button. If a group requires approval to join you may request to join it by clicking the appropriate button. The user group leader will need to approve your request, they may ask why you want to join the group. Please do not pester a group leader if they turn your request down, they will have their reasons.' ), array( - 0 => 'How do I become a Usergroup Moderator?', - 1 => 'When Usergroups are initially created by the board administrator, they also assign a Usergroup moderator. If you are interested in creating a Usergroup then your first point of contact should be the administrator, try sending them a private message.' + 0 => 'How do I become a Usergroup Leader?', + 1 => 'When Usergroups are initially created by the board administrator, they also assign a Usergroup leader. If you are interested in creating a Usergroup then your first point of contact should be the administrator, try sending them a private message.' ), array( 0 => 'Why do some Usergroups appear in a different colour?', From 7b1b55bc1a83ca3885c991bbab452ad83e5decb1 Mon Sep 17 00:00:00 2001 From: Jonathan Stanley Date: Wed, 13 Dec 2006 21:32:26 +0000 Subject: [PATCH 073/264] #5846 git-svn-id: file:///svn/phpbb/trunk@6754 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/help_faq.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/language/en/help_faq.php b/phpBB/language/en/help_faq.php index d536d7c352..97d52f1ea9 100644 --- a/phpBB/language/en/help_faq.php +++ b/phpBB/language/en/help_faq.php @@ -140,7 +140,7 @@ $help = array( ), array( 0 => 'Why did I receive a warning?', - 1 => 'Each board administrator has their own set of rules for their site. If they feel you have broken one of your rules, they may issue you a warning. Please note that this is the board administrator’s decision, and the phpBB Group does not have anything to do with the warning on the given site.' + 1 => 'Each board administrator has their own set of rules for their site. If they feel you have broken one of their rules, they may issue you a warning. Please note that this is the board administrator’s decision, and the phpBB Group does not have anything to do with the warning on the given site.' ), array( 0 => 'How can I report posts to a moderator?', From 9ae7da3fa5dea8b72fc58d87d5d36a7f63b3dacb Mon Sep 17 00:00:00 2001 From: Jonathan Stanley Date: Wed, 13 Dec 2006 21:57:15 +0000 Subject: [PATCH 074/264] #5942 git-svn-id: file:///svn/phpbb/trunk@6755 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/acp/attachments.php | 10 +++++----- phpBB/language/en/acp/board.php | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/phpBB/language/en/acp/attachments.php b/phpBB/language/en/acp/attachments.php index 4f8167f13a..f5d86abef6 100644 --- a/phpBB/language/en/acp/attachments.php +++ b/phpBB/language/en/acp/attachments.php @@ -56,7 +56,7 @@ $lang = array_merge($lang, array( 'ATTACH_ORPHAN_URL' => 'Orphan attachments', 'ATTACH_POST_ID' => 'Post ID', 'ATTACH_QUOTA' => 'Total attachment quota', - 'ATTACH_QUOTA_EXPLAIN' => 'Maximum drive space available for attachments in total, 0 is unlimited.', + 'ATTACH_QUOTA_EXPLAIN' => 'Maximum drive space available for attachments for the whole board, with 0 being unlimited.', 'ATTACH_TO_POST' => 'Attach file to post', 'CAT_FLASH_FILES' => 'Flash Files', @@ -124,14 +124,14 @@ $lang = array_merge($lang, array( 'ORDER_ALLOW_DENY' => 'Allow', 'ORDER_DENY_ALLOW' => 'Deny', - 'REMOVE_ALLOWED_IPS' => 'Remove or un-exclude allowed IPs/hostnames', - 'REMOVE_DISALLOWED_IPS' => 'Remove or un-exclude disallowed IPs/hostnames', + 'REMOVE_ALLOWED_IPS' => 'Remove or un-exclude allowed IPs/hostnames', + 'REMOVE_DISALLOWED_IPS' => 'Remove or un-exclude disallowed IPs/hostnames', 'SEARCH_IMAGICK' => 'Search for Imagemagick', 'SECURE_ALLOW_DENY' => 'Allow/Deny list', - 'SECURE_ALLOW_DENY_EXPLAIN' => 'Allow or Deny the list of addresses, this setting only applies to downloading files', + 'SECURE_ALLOW_DENY_EXPLAIN' => 'Change the default behaviour when secure downloads are enabled of the Allow/Deny list to that of a whitelist (Allow) or a blacklist (Deny)', 'SECURE_DOWNLOADS' => 'Enable secure downloads', - 'SECURE_DOWNLOADS_EXPLAIN' => 'With this option enabled, downloads are limited to IP’s/hostnames you defined.', + 'SECURE_DOWNLOADS_EXPLAIN' => 'With this option enabled, downloads are limited to IP’s/hostnames you define.', 'SECURE_DOWNLOAD_NOTICE' => 'Secure Downloads are not enabled. The settings below will be applied after enabling secure downloads.', 'SECURE_DOWNLOAD_UPDATE_SUCCESS'=> 'The IP list has been updated successfully.', 'SECURE_EMPTY_REFERRER' => 'Allow empty referrer', diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index d3d3a3d6d0..c3cecbc543 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -49,7 +49,7 @@ $lang = array_merge($lang, array( 'SYSTEM_DST' => 'Enable Daylight Savings Time', 'SYSTEM_TIMEZONE' => 'System timezone', 'WARNINGS_EXPIRE' => 'Warning duration', - 'WARNINGS_EXPIRE_EXPLAIN' => 'Number of days after it is issued before a warning will expire from a user’s record', + 'WARNINGS_EXPIRE_EXPLAIN' => 'Number of days that will elapse before the warning will automatically expire from a user’s record', )); // Board Features @@ -117,7 +117,7 @@ $lang = array_merge($lang, array( 'BOXES_MAX_EXPLAIN' => 'By default users may create this many personal folders for private messages.', 'ENABLE_PM_ICONS' => 'Enable use of topic icons in private messages', 'FULL_FOLDER_ACTION' => 'Full folder default action', - 'FULL_FOLDER_ACTION_EXPLAIN'=> 'Default Action to take if a user’s folder is full and if the users folder action set is not applicable. For the “sent messages” folder the default action is always deleting old messages.', + 'FULL_FOLDER_ACTION_EXPLAIN'=> 'Default action to take if a user’s folder is full assuming the user’s folder action, if set at all, is not applicable. The only exception is for the “Sent messages” folder where the default action is always to delete old messages.', 'HOLD_NEW_MESSAGES' => 'Hold new messages', 'PM_EDIT_TIME' => 'Limit editing time', 'PM_EDIT_TIME_EXPLAIN' => 'Limits the time available to edit a private message not already delivered, zero equals infinity', From 0d94eb2daf2fbeaed4ae586a820268b4cbe444b0 Mon Sep 17 00:00:00 2001 From: Jonathan Stanley Date: Wed, 13 Dec 2006 22:04:02 +0000 Subject: [PATCH 075/264] #5946 git-svn-id: file:///svn/phpbb/trunk@6756 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/help_faq.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/language/en/help_faq.php b/phpBB/language/en/help_faq.php index 97d52f1ea9..1951942e59 100644 --- a/phpBB/language/en/help_faq.php +++ b/phpBB/language/en/help_faq.php @@ -112,7 +112,7 @@ $help = array( ), array( 0 => 'How do I edit or delete a post?', - 1 => 'Unless you are the board admin or forum moderator you can only edit or delete your own posts. You can edit a post (sometimes for only a limited time after it was made) by clicking the edit button for the relevant post. If someone has already replied to the post you will find a small piece of text output below the post when you return to the topic, this lists the number of times you edited it. This will only appear if no one has replied, it also will not appear if moderators or administrators edit the post (they should leave a message saying what they altered and why). Please note that normal users cannot delete a post once someone has replied.' + 1 => 'Unless you are the board admin or forum moderator you can only edit or delete your own posts. You can edit a post (sometimes for only a limited time after it was made) by clicking the edit button for the relevant post. If someone has already replied to the post you will find a small piece of text output below the post when you return to the topic, which lists the number of times you edited it along with when. This will not appear if no one has replied, nor will not appear if moderators or administrators edit the post though they may leave a note as to why they’ve edited the post at their own disgression. Please note that normal users cannot delete a post once someone has replied.' ), array( 0 => 'How do I add a signature to my post?', From 586cd68ac170fb674e5a76ee784b6bf34b5e86c0 Mon Sep 17 00:00:00 2001 From: Jonathan Stanley Date: Wed, 13 Dec 2006 22:08:21 +0000 Subject: [PATCH 076/264] #5984 git-svn-id: file:///svn/phpbb/trunk@6757 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/acp/attachments.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/language/en/acp/attachments.php b/phpBB/language/en/acp/attachments.php index f5d86abef6..77b1edcb67 100644 --- a/phpBB/language/en/acp/attachments.php +++ b/phpBB/language/en/acp/attachments.php @@ -94,7 +94,7 @@ $lang = array_merge($lang, array( 'GROUP_NAME' => 'Group name', 'IMAGE_LINK_SIZE' => 'Image link dimensions', - 'IMAGE_LINK_SIZE_EXPLAIN' => 'Display image attachment as link if image is larger than this, set to 0px by 0px to disable.', + 'IMAGE_LINK_SIZE_EXPLAIN' => 'Display image attachment as an inline text link if image is larger than this, set to 0px by 0px to disable.', 'IMAGICK_PATH' => 'Imagemagick path', 'IMAGICK_PATH_EXPLAIN' => 'Full path to the imagemagick convert application, e.g. /usr/bin/', @@ -102,7 +102,7 @@ $lang = array_merge($lang, array( 'MAX_ATTACHMENTS_PM' => 'Max attachments per message', 'MAX_EXTGROUP_FILESIZE' => 'Maximum filesize', 'MAX_IMAGE_SIZE' => 'Maximum image dimensions', - 'MAX_IMAGE_SIZE_EXPLAIN' => 'Maximum size of image attachments, 0px by 0px disables image attachments.', + 'MAX_IMAGE_SIZE_EXPLAIN' => 'Maximum size of image attachments, set to 0px by 0px to disable dimension checking.', 'MAX_THUMB_WIDTH' => 'Maximum thumbnail width in pixel', 'MAX_THUMB_WIDTH_EXPLAIN' => 'A generated thumbnail will not exceed the width set here', 'MIN_THUMB_FILESIZE' => 'Minimum thumbnail filesize', From dfd189dbd2afd7fdf18a69d305cbef1ebed0d78c Mon Sep 17 00:00:00 2001 From: Jonathan Stanley Date: Wed, 13 Dec 2006 22:16:37 +0000 Subject: [PATCH 077/264] #6084 git-svn-id: file:///svn/phpbb/trunk@6758 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/common.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 5469ec7ed2..384fd80340 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -271,7 +271,7 @@ $lang = array_merge($lang, array( 'LOGIN_CONFIRMATION' => 'Confirmation of login', 'LOGIN_CONFIRM_EXPLAIN' => 'To prevent brute forcing accounts the board administrator requires you to enter a confirmation code after a maximum amount of failed logins. 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.', 'LOGIN_ERROR_ATTEMPTS' => 'You exceeded the maximum allowed number of login attempts. In addition to your username and password you now also have to enter the confirm code from the image you see below.', - 'LOGIN_ERROR_EXTERNAL_AUTH_APACHE' => 'You have not been authenticated by apache.', + 'LOGIN_ERROR_EXTERNAL_AUTH_APACHE' => 'You have not been authenticated by Apache.', 'LOGIN_ERROR_PASSWORD' => 'You have specified an incorrect password. Please check your password and try again. If you continue to have problems please contact the %sBoard Administrator%s.', 'LOGIN_ERROR_USERNAME' => 'You have specified an incorrect username. Please check your username and try again. If you continue to have problems please contact the %sBoard Administrator%s.', 'LOGIN_FORUM' => 'To view or post in this forum you must enter its password.', @@ -572,7 +572,7 @@ $lang = array_merge($lang, array( 'USER_POST' => '%d Post', 'USER_POSTS' => '%d Posts', 'USERS' => 'Users', - 'USE_PERMISSIONS' => 'Test out users permissions', + 'USE_PERMISSIONS' => 'Test out user’s permissions', 'VIEWED' => 'Viewed', 'VIEWING_FAQ' => 'Viewing FAQ', From 834cc6a5fe792b1442ab371a671abca7eb25716c Mon Sep 17 00:00:00 2001 From: Jonathan Stanley Date: Wed, 13 Dec 2006 22:32:02 +0000 Subject: [PATCH 078/264] #6212 - Oooh Bertie, spank me with that casing stick, spank me spank me spaaaaannnnk mee! git-svn-id: file:///svn/phpbb/trunk@6759 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/mcp.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php index 35f537f9db..9eeb70d57b 100644 --- a/phpBB/language/en/mcp.php +++ b/phpBB/language/en/mcp.php @@ -81,7 +81,7 @@ $lang = array_merge($lang, array( 'FEEDBACK' => 'Feedback', 'FORK' => 'Fork', - 'FORK_TOPIC' => 'Fork Topic', + 'FORK_TOPIC' => 'Fork topic', 'FORK_TOPIC_CONFIRM' => 'Are you sure you want to copy this topic?', 'FORK_TOPICS' => 'Fork selected topics', 'FORK_TOPICS_CONFIRM' => 'Are you sure you want to copy the selected topics?', From 31d0f9328c1506d2d2e46f788ea74940850bdfa4 Mon Sep 17 00:00:00 2001 From: Jonathan Stanley Date: Wed, 13 Dec 2006 22:36:01 +0000 Subject: [PATCH 079/264] #6218 git-svn-id: file:///svn/phpbb/trunk@6760 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/help_faq.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/language/en/help_faq.php b/phpBB/language/en/help_faq.php index 1951942e59..39903fc14b 100644 --- a/phpBB/language/en/help_faq.php +++ b/phpBB/language/en/help_faq.php @@ -172,7 +172,7 @@ $help = array( ), array( 0 => 'What are Smilies?', - 1 => 'Smilies, or Emoticons are small graphical images which can be used to express some feeling using a short code, e.g. :) means happy, :( means sad. The full list of emoticons can be seen via the posting form. Try not to overuse smileys though, they can quickly render a post unreadable and a moderator may decide to edit them out or remove the post altogether.' + 1 => 'Smilies, or Emoticons are small graphical images which can be used to express some feeling using a short code, e.g. :) means happy, :( means sad. The full list of emoticons can be seen via the posting form. Try not to overuse smileys though, they can quickly render a post unreadable and a moderator may decide to edit them out or remove the post altogether. The board administrator may also have set a limit to the number of such smilies you may use within a post.' ), array( 0 => 'Can I post images?', From 6adbaea1758585c905728ea78c04688ed77d1852 Mon Sep 17 00:00:00 2001 From: David M Date: Thu, 14 Dec 2006 03:21:24 +0000 Subject: [PATCH 080/264] #5242 - forgot to *show* the change! git-svn-id: file:///svn/phpbb/trunk@6761 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/index.php b/phpBB/index.php index 83d8dbdac0..6d24ac8e5d 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -86,7 +86,7 @@ $template->assign_vars(array( 'TOTAL_POSTS' => sprintf($user->lang[$l_total_post_s], $total_posts), 'TOTAL_TOPICS' => sprintf($user->lang[$l_total_topic_s], $total_topics), 'TOTAL_USERS' => sprintf($user->lang[$l_total_user_s], $total_users), - 'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], '', $newest_user, ''), + 'NEWEST_USER' => sprintf($user->lang['NEWEST_USER'], '', $newest_user, ''), 'LEGEND' => $legend, 'BIRTHDAY_LIST' => $birthday_list, From 18ae2e2ff93771b8b49cd1c2c392507808503e59 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 14 Dec 2006 17:54:44 +0000 Subject: [PATCH 081/264] two changes related to the convertor git-svn-id: file:///svn/phpbb/trunk@6762 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/install_convert.html | 16 ++++++++++++++++ phpBB/language/en/install.php | 12 +++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/phpBB/adm/style/install_convert.html b/phpBB/adm/style/install_convert.html index 0e3da86ae5..39d31cd538 100755 --- a/phpBB/adm/style/install_convert.html +++ b/phpBB/adm/style/install_convert.html @@ -39,6 +39,22 @@ + + + +
+
+ +
+
+
+ +
+
+ +
+ +
diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 59c39e0991..30291cf5a7 100755 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -61,18 +61,22 @@ $lang = array_merge($lang, array( 'CONFIG_RETRY' => 'Retry', 'CONTACT_EMAIL_CONFIRM' => 'Confirm contact email', 'CONTINUE_CONVERT' => 'Continue conversion', + 'CONTINUE_CONVERT_BODY' => 'A previous conversion attempt has been determined. You are now able to choose between starting a new conversion or continueing the conversion.', 'CONTINUE_LAST' => 'Continue last statements', + 'CONTINUE_OLD_CONVERSION' => 'Continue previously started conversion', 'CONVERT' => 'Convert', 'CONVERT_COMPLETE' => 'Conversion completed', 'CONVERT_COMPLETE_EXPLAIN' => 'You have now successfully converted your board to phpBB 3.0. You can now login and access your forum. Remember that help on using phpBB is available online via the Userguide and the Beta support forum', 'CONVERT_INTRO' => 'Welcome to the phpBB Unified Convertor Framework', 'CONVERT_INTRO_BODY' => 'From here, you are able to import data from other (installed) forum systems. The list below shows all the conversion modules currently available. If there is no convertor shown in this list for the forum software you wish to convert from, please check our website where further conversion modules may be available for download.', + 'CONVERT_NEW_CONVERSION' => 'New conversion', 'CONVERT_NOT_EXIST' => 'The specified convertor does not exist', 'CONVERT_SETTINGS_VERIFIED' => 'The information you entered has been verified. To start the conversion progress, push the button below to begin', 'CONV_ERROR_ATTACH_FTP_DIR' => 'FTP Upload for Attachments is enabled at the old board. Please copy all Attachment files to a directory accessible, disable ftp uploading and make sure a valid upload dir is specified. If you have done this, restart the convertor.', 'CONV_ERROR_CONFIG_EMPTY' => 'There is no configuration information available for the conversion.', 'CONV_ERROR_FORUM_ACCESS' => 'Unable to get forum access information.', + 'CONV_ERROR_FORUM_MAPPING' => 'The forum mapping information is missing.', 'CONV_ERROR_GET_CATEGORIES' => 'Unable to get categories.', 'CONV_ERROR_GET_CONFIG' => 'Could not retrieve your forum configuration.', 'CONV_ERROR_COULD_NOT_READ' => 'Unable to access/read "%s".', @@ -88,13 +92,14 @@ $lang = array_merge($lang, array( 'CONV_ERROR_NO_GROUP' => 'Group "%1$s" could not be found in %2$s.', 'CONV_ERROR_NO_RANKS_PATH' => 'Note to developer: you must specify $convertor[\'ranks_path\'] to use %s.', 'CONV_ERROR_NO_SMILIES_PATH' => 'Note to developer: you must specify $convertor[\'smilies_path\'] to use %s.', - 'CONV_ERROR_NO_UPLOAD_DIR' => 'Note to developer: you must specify $convertor[\'upload_dir\'] to use %s.', + 'CONV_ERROR_NO_UPLOAD_DIR' => 'Note to developer: you must specify $convertor[\'upload_path\'] to use %s.', 'CONV_ERROR_PERM_SETTING' => 'Unable to insert/update permission setting.', 'CONV_ERROR_PM_COUNT' => 'Unable to select folder pm count.', 'CONV_ERROR_REPLACE_CATEGORY' => 'Unable to insert new forum replacing old category.', 'CONV_ERROR_REPLACE_FORUM' => 'Unable to insert new forum replacing old forum.', 'CONV_ERROR_USER_ACCESS' => 'Unable to get user authentication information.', 'CONV_ERROR_WRONG_GROUP' => 'Wrong group "%1$s" defined in %2$s.', + 'CONV_SAVED_MESSAGES' => 'Saved Messages', 'COULD_NOT_COPY' => 'Could not copy file %1$s to %2$s

Please check that the target directory exists and is writable by the webserver', 'COULD_NOT_FIND_PATH' => 'Could not find path to your former forum. Please check your settings and try again.
» Specified source path was %s', @@ -277,7 +282,7 @@ $lang = array_merge($lang, array( 'STAGE_REQUIREMENTS' => 'Requirements', 'STAGE_SETTINGS' => 'Settings', 'STARTING_CONVERT' => 'Starting Conversion Process', - 'STEP_PERCENT_COMPLETED' => 'Step %d of %d: %d%% completed', + 'STEP_PERCENT_COMPLETED' => 'Step %d of %d', 'SUB_INTRO' => 'Introduction', 'SUB_LICENSE' => 'License', 'SUB_SUPPORT' => 'Support', @@ -286,7 +291,7 @@ $lang = array_merge($lang, array( 'SUPPORT_BODY' => 'During the beta phase a minimal level of support will be given at the phpBB 3.0 Beta support forum. We will provide answers to general setup questions, configuration problems and support for determining common problems mostly related to bugs. We will not support modifications, custom code/style additions or any users using the beta packages within a live environment.

For additional assistance, please refer to our Quick Start Guide.

To ensure you stay up to date with the latest news and releases, why not subscribe to our mailing list', 'SYNC_FORUMS' => 'Starting to sync forums', 'SYNC_TOPICS' => 'Starting to sync topics', - 'SYNC_TOPIC_ID' => 'Synchronising topics from topic_id $1%s to $2%s', + 'SYNC_TOPIC_ID' => 'Synchronising topics from topic_id %1$s to %2$s', 'TABLES_MISSING' => 'Could not find these tables
» %s.', 'TABLE_PREFIX' => 'Prefix for tables in database', @@ -297,6 +302,7 @@ $lang = array_merge($lang, array( 'UNABLE_WRITE_LOCK' => 'Unable to write lock file', 'UNAVAILABLE' => 'Unavailable', 'UNWRITEABLE' => 'Unwriteable', + 'UPDATE_TOPICS_POSTED' => 'Generating topics posted informations', 'VERSION' => 'Version', From 62763d3f3d2ab758a6de8294e36adb4268f6054b Mon Sep 17 00:00:00 2001 From: Jonathan Stanley Date: Thu, 14 Dec 2006 18:18:45 +0000 Subject: [PATCH 082/264] Speeling... ;) git-svn-id: file:///svn/phpbb/trunk@6763 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/install.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 30291cf5a7..6ef3e3c450 100755 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -61,7 +61,7 @@ $lang = array_merge($lang, array( 'CONFIG_RETRY' => 'Retry', 'CONTACT_EMAIL_CONFIRM' => 'Confirm contact email', 'CONTINUE_CONVERT' => 'Continue conversion', - 'CONTINUE_CONVERT_BODY' => 'A previous conversion attempt has been determined. You are now able to choose between starting a new conversion or continueing the conversion.', + 'CONTINUE_CONVERT_BODY' => 'A previous conversion attempt has been determined. You are now able to choose between starting a new conversion or continuing the conversion.', 'CONTINUE_LAST' => 'Continue last statements', 'CONTINUE_OLD_CONVERSION' => 'Continue previously started conversion', 'CONVERT' => 'Convert', From 837fcd1295bb1872cde70db049bd65b2a98c6121 Mon Sep 17 00:00:00 2001 From: David M Date: Thu, 14 Dec 2006 20:36:07 +0000 Subject: [PATCH 083/264] #6264 git-svn-id: file:///svn/phpbb/trunk@6764 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/search.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/phpBB/search.php b/phpBB/search.php index e8898141c0..d0575bdc3c 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -999,11 +999,18 @@ $template->assign_vars(array( // Can't do comparisons w/ TEXT on MSSQL, CAST is good enough switch ($db->sql_layer) { + case 'oracle': + $sql = 'SELECT search_time, search_keywords + FROM ' . SEARCH_RESULTS_TABLE . ' + WHERE dbms_lob.getlength(search_keywords) > 0 + ORDER BY search_time DESC'; + break; + case 'mssql': case 'mssql_odbc': $sql = 'SELECT search_time, search_keywords FROM ' . SEARCH_RESULTS_TABLE . ' - WHERE CAST(search_keywords AS varchar) <> \'\' + WHERE DATALENGTH(search_keywords) > 0 ORDER BY search_time DESC'; break; From 950d67d60e4354f418834ceb100ab2d260611037 Mon Sep 17 00:00:00 2001 From: David M Date: Fri, 15 Dec 2006 02:38:14 +0000 Subject: [PATCH 084/264] elseif -> else if git-svn-id: file:///svn/phpbb/trunk@6765 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/develop/generate_utf_casefold.php | 2 +- phpBB/develop/generate_utf_tables.php | 8 ++++---- phpBB/develop/lang_duplicates.php | 2 +- phpBB/develop/utf_normalizer_test.php | 4 ++-- phpBB/includes/acp/acp_styles.php | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/phpBB/develop/generate_utf_casefold.php b/phpBB/develop/generate_utf_casefold.php index 68cc83d880..d9aace10ce 100644 --- a/phpBB/develop/generate_utf_casefold.php +++ b/phpBB/develop/generate_utf_casefold.php @@ -89,7 +89,7 @@ function my_var_export($var) return 'array(' . implode(',', $lines) . ')'; } - elseif (is_string($var)) + else if (is_string($var)) { return "'" . str_replace(array('\\', "'"), array('\\\\', "\\'"), $var) . "'"; } diff --git a/phpBB/develop/generate_utf_tables.php b/phpBB/develop/generate_utf_tables.php index 1d7fbc1d67..ffad9106d6 100644 --- a/phpBB/develop/generate_utf_tables.php +++ b/phpBB/develop/generate_utf_tables.php @@ -320,7 +320,7 @@ while ($line = fgets($fp, 1024)) */ $map[$cp] = strtolower($capture[1]); } - elseif (isset($m[13][0])) + else if (isset($m[13][0])) { /** * If the letter has a lowercased form, use it @@ -455,7 +455,7 @@ function my_var_export($var) return 'array(' . implode(',', $lines) . ')'; } - elseif (is_string($var)) + else if (is_string($var)) { return "'" . str_replace(array('\\', "'"), array('\\\\', "\\'"), $var) . "'"; } @@ -544,11 +544,11 @@ function cp_to_utf($cp) { return chr(0xF0 | ($cp >> 18)) . chr(0x80 | (($cp >> 12) & 0x3F)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F)); } - elseif ($cp > 0x7FF) + else if ($cp > 0x7FF) { return chr(0xE0 | ($cp >> 12)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F)); } - elseif ($cp > 0x7F) + else if ($cp > 0x7F) { return chr(0xC0 | ($cp >> 6)) . chr(0x80 | ($cp & 0x3F)); } diff --git a/phpBB/develop/lang_duplicates.php b/phpBB/develop/lang_duplicates.php index 666a9a084e..5a77c79543 100644 --- a/phpBB/develop/lang_duplicates.php +++ b/phpBB/develop/lang_duplicates.php @@ -60,7 +60,7 @@ while ($module = array_shift($keys)) $compare = "Equal"; $equal++; } - elseif (strcasecmp($kkeys[$module][$dup], $kkeys[$other_module][$dup]) == 0) + else if (strcasecmp($kkeys[$module][$dup], $kkeys[$other_module][$dup]) == 0) { $compare = "Differ in case"; $case++; diff --git a/phpBB/develop/utf_normalizer_test.php b/phpBB/develop/utf_normalizer_test.php index 63c73c05e4..6dbd09cdda 100644 --- a/phpBB/develop/utf_normalizer_test.php +++ b/phpBB/develop/utf_normalizer_test.php @@ -365,11 +365,11 @@ function cp_to_utf($cp) { return chr(0xF0 | ($cp >> 18)) . chr(0x80 | (($cp >> 12) & 0x3F)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F)); } - elseif ($cp > 0x7FF) + else if ($cp > 0x7FF) { return chr(0xE0 | ($cp >> 12)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F)); } - elseif ($cp > 0x7F) + else if ($cp > 0x7F) { return chr(0xC0 | ($cp >> 6)) . chr(0x80 | ($cp & 0x3F)); } diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 34dbd4c7ff..2ec7e7095b 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -1178,7 +1178,7 @@ pagination_sep = \'{PAGINATION_SEP}\' } // else if we are showing raw css or the user submitted data from the simple view // then we need to turn the given information into raw css - elseif (!$css_data && !$add_custom) + else if (!$css_data && !$add_custom) { foreach ($match_elements as $type => $match_ary) { @@ -1245,7 +1245,7 @@ pagination_sep = \'{PAGINATION_SEP}\' } } // make sure we have $show_css set, so we can link to the show_css page if we need to - elseif (!$hide_css) + else if (!$hide_css) { $show_css = true; } From 35ac391fe341288da0abc72707aa9970d7c8a8c8 Mon Sep 17 00:00:00 2001 From: David M Date: Fri, 15 Dec 2006 02:41:43 +0000 Subject: [PATCH 085/264] count -> sizeof git-svn-id: file:///svn/phpbb/trunk@6766 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/develop/search_fill.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/develop/search_fill.php b/phpBB/develop/search_fill.php index 8bb656b901..1ab74f562c 100644 --- a/phpBB/develop/search_fill.php +++ b/phpBB/develop/search_fill.php @@ -82,7 +82,7 @@ for(;$postcounter <= $max_post_id; $postcounter += $batchsize) $rowset = $db->sql_fetchrowset($result); $db->sql_freeresult($result); - $post_rows = count($rowset); + $post_rows = sizeof($rowset); if( $post_rows ) { From c3a2557108e5cf544c6c49a9ec6e1479f0e3317d Mon Sep 17 00:00:00 2001 From: David M Date: Fri, 15 Dec 2006 02:45:42 +0000 Subject: [PATCH 086/264] FALSE -> false TRUE -> true git-svn-id: file:///svn/phpbb/trunk@6767 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/develop/utf_normalizer_test.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/develop/utf_normalizer_test.php b/phpBB/develop/utf_normalizer_test.php index 6dbd09cdda..2026d3d4c8 100644 --- a/phpBB/develop/utf_normalizer_test.php +++ b/phpBB/develop/utf_normalizer_test.php @@ -71,7 +71,7 @@ $test_suite = array( require_once($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx); $i = $n = 0; -$failed = FALSE; +$failed = false; $tested_chars = array(); $fp = fopen($phpbb_root_path . 'develop/NormalizationTest.txt', 'rb'); @@ -127,7 +127,7 @@ while (!feof($fp)) if (strcmp($utf_expected, $utf_result)) { - $failed = TRUE; + $failed = true; $hex_result = utf_to_hexseq($utf_result); echo "\nFAILED $expected == $form($test) ($hex_expected != $hex_result)"; From 522d52efe46c8617c1bd77af092d506229e44abf Mon Sep 17 00:00:00 2001 From: David M Date: Fri, 15 Dec 2006 03:06:57 +0000 Subject: [PATCH 087/264] - nobody found this bug :D git-svn-id: file:///svn/phpbb/trunk@6768 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_database.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 7da2044471..dbf78daad7 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -72,7 +72,7 @@ class acp_database $time = time(); - $filename = 'backup_' . $time; + $filename = 'backup_' . $time . '_' . unique_id(); // We set up the info needed for our on-the-fly creation :D switch ($format) @@ -856,8 +856,8 @@ class acp_database for ($i = 0; $i < $i_num_fields; $i++) { - $ary_type[$i] = ocicolumntype($result, $i); - $ary_name[$i] = ocicolumnname($result, $i); + $ary_type[$i] = ocicolumntype($result, $i + 1); + $ary_name[$i] = ocicolumnname($result, $i + 1); } while ($row = $db->sql_fetchrow($result)) @@ -1216,7 +1216,7 @@ class acp_database $dh = opendir($dir); while (($file = readdir($dh)) !== false) { - if (preg_match('#^backup_(\d{10,})\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches)) + if (preg_match('#^backup_(\d{10,})_(?:[a-z\d]{16})\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches)) { $supported = in_array($matches[2], $methods); From 11e70be6edd39fb0956541117e8bf327c94f651e Mon Sep 17 00:00:00 2001 From: David M Date: Fri, 15 Dec 2006 03:11:34 +0000 Subject: [PATCH 088/264] - remove some of my mess :P git-svn-id: file:///svn/phpbb/trunk@6769 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/acp_database.html | 2 +- phpBB/includes/acp/acp_database.php | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/phpBB/adm/style/acp_database.html b/phpBB/adm/style/acp_database.html index c73670d9a8..11daffa06d 100644 --- a/phpBB/adm/style/acp_database.html +++ b/phpBB/adm/style/acp_database.html @@ -16,7 +16,7 @@

- +

    diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index dbf78daad7..7949845862 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -1199,7 +1199,6 @@ class acp_database break; default: - $selected = false; $methods = array('sql'); $available_methods = array('sql.gz' => 'zlib', 'sql.bz2' => 'bz2'); @@ -1227,17 +1226,11 @@ class acp_database 'NAME' => gmdate("d-m-Y H:i:s", $matches[1]), 'SUPPORTED' => $supported )); - $selected = true; } } } closedir($dh); - if ($selected === true) - { - $template->assign_var('EXISTS', true); - } - $template->assign_vars(array( 'U_ACTION' => $this->u_action . '&action=submit' )); From 2e4cd16058cc548068a94047c9c31e5a9ad272d0 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 15 Dec 2006 14:54:52 +0000 Subject: [PATCH 089/264] - fixed bug within the database update script - #6254 - #6242 - #6184 - #6160 - #6020 git-svn-id: file:///svn/phpbb/trunk@6770 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_bots.php | 22 +++++++++++++++---- phpBB/includes/functions_posting.php | 6 ++--- phpBB/install/database_update.php | 4 ++-- phpBB/install/schemas/schema_data.sql | 4 ++-- phpBB/language/en/posting.php | 1 - phpBB/memberlist.php | 2 +- .../subSilver/template/memberlist_view.html | 2 +- 7 files changed, 27 insertions(+), 14 deletions(-) diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php index 0b1cdb122f..7e1c31dc44 100644 --- a/phpBB/includes/acp/acp_bots.php +++ b/phpBB/includes/acp/acp_bots.php @@ -206,7 +206,7 @@ class acp_bots } else if ($bot_id) { - $sql = 'SELECT user_id + $sql = 'SELECT user_id, bot_name FROM ' . BOTS_TABLE . " WHERE bot_id = $bot_id"; $result = $db->sql_query($sql); @@ -218,10 +218,18 @@ class acp_bots trigger_error($user->lang['NO_BOT'] . adm_back_link($this->u_action . "&id=$bot_id&action=$action"), E_USER_WARNING); } - $sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array( + $sql_ary = array( 'user_style' => (int) $bot_row['bot_style'], - 'user_lang' => (string) $bot_row['bot_lang']) - ) . " WHERE user_id = {$row['user_id']}"; + 'user_lang' => (string) $bot_row['bot_lang'], + ); + + if ($bot_row['bot_name'] !== $row['bot_name']) + { + $sql_ary['username'] = (string) $bot_row['bot_name']; + $sql_ary['username_clean'] = (string) utf8_clean_string($bot_row['bot_name']); + } + + $sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE user_id = {$row['user_id']}"; $db->sql_query($sql); $sql = 'UPDATE ' . BOTS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', array( @@ -232,6 +240,12 @@ class acp_bots ) . " WHERE bot_id = $bot_id"; $db->sql_query($sql); + // Updated username? + if ($bot_row['bot_name'] !== $row['bot_name']) + { + user_update_name($row['bot_name'], $bot_row['bot_name']); + } + $log = 'UPDATED'; } diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 49ed4932a3..51bcf2e583 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1324,12 +1324,12 @@ function delete_post($forum_id, $topic_id, $post_id, &$data) $db->sql_transaction('commit'); // Adjust posted info for this user by looking for a post by him/her within this topic... - if ($post_mode != 'delete_topic' && $config['load_db_track'] && $user->data['is_registered']) + if ($post_mode != 'delete_topic' && $config['load_db_track'] && $data['poster_id'] != ANONYMOUS) { $sql = 'SELECT poster_id FROM ' . POSTS_TABLE . ' WHERE topic_id = ' . $topic_id . ' - AND poster_id = ' . $user->data['user_id']; + AND poster_id = ' . $data['poster_id']; $result = $db->sql_query_limit($sql, 1); $poster_id = (int) $db->sql_fetchfield('poster_id'); $db->sql_freeresult($result); @@ -1339,7 +1339,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data) { $sql = 'DELETE FROM ' . TOPICS_POSTED_TABLE . ' WHERE topic_id = ' . $topic_id . ' - AND user_id = ' . $user->data['user_id']; + AND user_id = ' . $data['poster_id']; $db->sql_query($sql); } } diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 5717dbc4d2..ae52373609 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -488,7 +488,7 @@ flush(); $no_updates = true; // some code magic -if (version_compare($current_version, '3.0.b3', '<')) +if (version_compare($current_version, '3.0.b3', '<=')) { // Set group_founder_manage for administrators group $sql = 'SELECT group_id @@ -510,7 +510,7 @@ if (version_compare($current_version, '3.0.b3', '<')) $no_updates = false; } -if (version_compare($current_version, '3.0.b4', '<')) +if (version_compare($current_version, '3.0.b4', '<=')) { // Add config values set_config('script_path', '/'); diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index abc6021deb..9bc38ab00e 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -471,13 +471,13 @@ INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 16, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option = 'f_'; # Read Only Access (f_) -INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 17, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_', 'f_download', 'f_list', 'f_read', 'f_search', 'f_subscribe'); +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 17, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_', 'f_download', 'f_list', 'f_read', 'f_search', 'f_subscribe', 'f_print'); # Limited Access (f_) INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 18, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_attach', 'f_bump', 'f_delete', 'f_flash', 'f_icons', 'f_ignoreflood', 'f_poll', 'f_sticky', 'f_user_lock', 'f_votechg'); # Bot Access (f_) -INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 19, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_', 'f_download', 'f_list', 'f_read'); +INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 19, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_', 'f_download', 'f_list', 'f_read', 'f_print'); # On Moderation Queue (f_) INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 20, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_bump', 'f_delete', 'f_flash', 'f_icons', 'f_ignoreflood', 'f_poll', 'f_sticky', 'f_user_lock', 'f_votechg', 'f_noapprove'); diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index a4dee8e31a..d84987a590 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -127,7 +127,6 @@ $lang = array_merge($lang, array( 'NO_POLL_TITLE' => 'You have to enter a poll title', 'NO_POST' => 'The requested post does not exist.', 'NO_POST_MODE' => 'No post mode specified', - 'NO_TOPIC_ICON' => 'None', 'PARTIAL_UPLOAD' => 'The uploaded file was only partially uploaded', 'PHP_SIZE_NA' => 'The attachment’s filesize is too large.
Could not determine the maximum size defined by PHP in php.ini.', diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index b06fbea482..c53c9de6a3 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -1388,7 +1388,7 @@ function show_profile($data) $rank_title = $rank_img = $rank_img_src = ''; get_user_rank($data['user_rank'], $data['user_posts'], $rank_title, $rank_img, $rank_img_src); - + if (!empty($data['user_allow_viewemail']) || $auth->acl_get('a_email')) { $email = ($config['board_email_form'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=email&u=' . $user_id) : (($config['board_hide_emails'] && !$auth->acl_get('a_email')) ? '' : 'mailto:' . $data['user_email']); diff --git a/phpBB/styles/subSilver/template/memberlist_view.html b/phpBB/styles/subSilver/template/memberlist_view.html index d8885370a0..4c7cabc5e9 100644 --- a/phpBB/styles/subSilver/template/memberlist_view.html +++ b/phpBB/styles/subSilver/template/memberlist_view.html @@ -22,7 +22,7 @@ - {USERNAME} [ {L_USER_ADMIN} ] + {USERNAME} [ {L_USER_ADMIN} ] From 204187187ddd3f556b67c3c78373034a73d760e7 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 16 Dec 2006 12:57:01 +0000 Subject: [PATCH 090/264] fix for bug #6140 (jabber not working) git-svn-id: file:///svn/phpbb/trunk@6771 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_jabber.php | 8 +++--- phpBB/includes/functions_jabber.php | 39 +++++++++++++++++--------- phpBB/includes/functions_messenger.php | 8 +++--- 3 files changed, 34 insertions(+), 21 deletions(-) diff --git a/phpBB/includes/acp/acp_jabber.php b/phpBB/includes/acp/acp_jabber.php index d216ff7f9b..d58fef14f1 100644 --- a/phpBB/includes/acp/acp_jabber.php +++ b/phpBB/includes/acp/acp_jabber.php @@ -58,7 +58,7 @@ class acp_jabber { if (!$jabber->connect()) { - trigger_error($user->lang['ERR_JAB_CONNECT'] . adm_back_link($this->u_action), E_USER_WARNING); + trigger_error($user->lang['ERR_JAB_CONNECT'] . $jabber->get_log() . adm_back_link($this->u_action), E_USER_WARNING); } // First we'll try to authorise using this account, if that fails we'll try to create it. @@ -87,16 +87,16 @@ class acp_jabber { if (!$jabber->connect()) { - trigger_error($user->lang['ERR_JAB_CONNECT'] . adm_back_link($this->u_action), E_USER_WARNING); + trigger_error($user->lang['ERR_JAB_CONNECT'] . $jabber->get_log() . adm_back_link($this->u_action), E_USER_WARNING); } if (!$jabber->send_auth()) { - trigger_error($user->lang['ERR_JAB_AUTH'] . adm_back_link($this->u_action), E_USER_WARNING); + trigger_error($user->lang['ERR_JAB_AUTH'] . $jabber->get_log() . adm_back_link($this->u_action), E_USER_WARNING); } $jabber->send_presence(NULL, NULL, 'online'); - if (($result = $jabber->change_password($jab_password)) <> 2) + if (($result = $jabber->change_password($jab_password)) <> 2) { $error[] = ($result == 1) ? $user->lang['ERR_JAB_PASSCHG'] : sprintf($user->lang['ERR_JAB_PASSFAIL'], $result); } diff --git a/phpBB/includes/functions_jabber.php b/phpBB/includes/functions_jabber.php index 726985e631..b0a7e09c08 100644 --- a/phpBB/includes/functions_jabber.php +++ b/phpBB/includes/functions_jabber.php @@ -20,7 +20,7 @@ * last modified: 24.03.2004 13:01:53 * * Modified by phpBB Development Team -* version: v0.4.3a +* version: v0.4.3a1 * * @package phpBB3 */ @@ -113,7 +113,7 @@ class jabber if ($this->connector->open_socket($this->server, $this->port)) { $this->send_packet("\n"); - $this->send_packet("\n"); + $this->send_packet("\n"); sleep(2); @@ -672,7 +672,7 @@ class jabber { if ($this->enable_logging && sizeof($this->log_array)) { - return implode("\n\n", $this->log_array); + return implode("

", $this->log_array); } return ''; @@ -805,7 +805,7 @@ class jabber * Check if connected * @access private */ - function _check_connected() + function _check_connected($in_tls = false) { $incoming_array = $this->_listen_incoming(); @@ -815,14 +815,16 @@ class jabber { $this->stream_id = $incoming_array['stream:stream']['@']['id']; - if (!empty($incoming_array['stream:stream']['#']['stream:features'][0]['#']['starttls'][0]['@']['xmlns']) && $incoming_array['stream:stream']['#']['stream:features'][0]['#']['starttls'][0]['@']['xmlns'] == 'urn:ietf:params:xml:ns:xmpp-tls') + // We only start TLS authentication if not called within TLS authentication itself, which may produce a never ending loop... + if (!$in_tls) { - return $this->_starttls(); - } - else - { - return true; + if (!empty($incoming_array['stream:stream']['#']['stream:features'][0]['#']['starttls'][0]['@']['xmlns']) && $incoming_array['stream:stream']['#']['stream:features'][0]['#']['starttls'][0]['@']['xmlns'] == 'urn:ietf:params:xml:ns:xmpp-tls') + { + return $this->_starttls(); + } } + + return true; } else { @@ -843,12 +845,21 @@ class jabber */ function _starttls() { - if (!function_exists('stream_socket_enable_crypto') || !function_exists('stream_get_meta_data') || !function_exists('socket_set_blocking')) + if (!function_exists('stream_socket_enable_crypto') || !function_exists('stream_get_meta_data') || !function_exists('socket_set_blocking') || !function_exists('stream_get_wrappers')) { $this->add_to_log('WARNING: TLS is not available'); return true; } + // Make sure the encryption stream is supported + $streams = stream_get_wrappers(); + + if (!in_array('streams.crypto', $streams)) + { + $this->add_to_log('WARNING: SSL/crypto stream not supported'); + return true; + } + $this->send_packet("\n"); sleep(2); $incoming_array = $this->_listen_incoming(); @@ -868,19 +879,21 @@ class jabber $meta = stream_get_meta_data($this->connector->active_socket); socket_set_blocking($this->connector->active_socket, 1); - if (!stream_socket_enable_crypto($this->connector->active_socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) + $result = @stream_socket_enable_crypto($this->connector->active_socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT); + if (!$result) { socket_set_blocking($this->connector->active_socket, $meta['blocked']); $this->add_to_log('ERROR: _starttls() #3'); return false; } + socket_set_blocking($this->connector->active_socket, $meta['blocked']); $this->send_packet("\n"); $this->send_packet("\n"); sleep(2); - if (!$this->_check_connected()) + if (!$this->_check_connected(true)) { $this->add_to_log('ERROR: _starttls() #4'); return false; diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 650deb6a0d..b6af4ef12f 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -453,18 +453,18 @@ class messenger if (!$use_queue) { - include_once($phpbb_root_path . 'includes/functions_jabber.'.$phpEx); + include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx); $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], $config['jab_password'], $config['jab_resource']); if (!$this->jabber->connect()) { - $this->error('JABBER', 'Could not connect to Jabber server'); + $this->error('JABBER', 'Could not connect to Jabber server
' . $this->jabber->get_log()); return false; } if (!$this->jabber->send_auth()) { - $this->error('JABBER', 'Could not authorise on Jabber server'); + $this->error('JABBER', 'Could not authorise on Jabber server
' . $this->jabber->get_log()); return false; } $this->jabber->send_presence(NULL, NULL, 'online'); @@ -636,7 +636,7 @@ class queue { if ($this->jabber->send_message($address, 'normal', NULL, array('body' => $msg)) === false) { - messenger::error('JABBER', $this->jabber_get_log()); + messenger::error('JABBER', $this->jabber->get_log()); continue 3; } } From 6938688e75e703208bd1087be8f37383da8e3f15 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 16 Dec 2006 13:16:22 +0000 Subject: [PATCH 091/264] let set_config() calls success instead of fail if the config value already exist. git-svn-id: file:///svn/phpbb/trunk@6773 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index ae52373609..0f3f5b3aa2 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -381,19 +381,25 @@ $errored = false;

:: sql_layer; ?>
sql_query($sql); -$row = $db->sql_fetchrow($result); + +while ($row = $db->sql_fetchrow($result)) +{ + $config[$row['config_name']] = $row['config_value']; +} $db->sql_freeresult($result); -echo $lang['PREVIOUS_VERSION'] . ' :: ' . $row['config_value'] . '
'; + +echo $lang['PREVIOUS_VERSION'] . ' :: ' . $config['version'] . '
'; echo $lang['UPDATED_VERSION'] . ' :: ' . $updates_to_version . ''; -$current_version = strtolower($row['config_value']); +$current_version = strtolower($config['version']); $latest_version = strtolower($updates_to_version); -$orig_version = $row['config_value']; +$orig_version = $config['version']; // If the latest version and the current version are 'unequal', we will update the version_update_from, else we do not update anything. if ($inline_update) From 1e34820cd87837b545b310022ee460803d8c5b54 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sat, 16 Dec 2006 20:24:34 +0000 Subject: [PATCH 092/264] - Optimize acl_getf_global a bit - a little performance improvement of the IP regular expressions - convert post_text/subject collation to utf8_unicode_ci if a user wants to use mysql_fulltext to allow case insensitivity [Bug #6272] - mysql_fulltext should alter all necessary columns at once to speed up the process - validate URLs against RFC3986 - fixed some weirdness in make_clickable I hope I didn't break any URLs with this commit, if I did then report it to the bugtracker please! git-svn-id: file:///svn/phpbb/trunk@6774 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/develop/ip_regex.php | 37 ------------ phpBB/develop/regex.php | 74 ++++++++++++++++++++++++ phpBB/includes/auth.php | 21 +++---- phpBB/includes/functions.php | 26 +++++++-- phpBB/includes/message_parser.php | 30 +++++----- phpBB/includes/search/fulltext_mysql.php | 30 ++++++++-- phpBB/includes/session.php | 6 +- 7 files changed, 149 insertions(+), 75 deletions(-) delete mode 100644 phpBB/develop/ip_regex.php create mode 100644 phpBB/develop/regex.php diff --git a/phpBB/develop/ip_regex.php b/phpBB/develop/ip_regex.php deleted file mode 100644 index 4e7aaf0156..0000000000 --- a/phpBB/develop/ip_regex.php +++ /dev/null @@ -1,37 +0,0 @@ -\nIPv6: " . $ipv6; -?> \ No newline at end of file diff --git a/phpBB/develop/regex.php b/phpBB/develop/regex.php new file mode 100644 index 0000000000..4893a3d271 --- /dev/null +++ b/phpBB/develop/regex.php @@ -0,0 +1,74 @@ +\nIPv6: " . $ipv6 . "
\n"; + +// URL regular expressions + +$pct_encoded = "%[\dA-F]{2}"; +$unreserved = 'a-z0-9\-._~'; +$sub_delims = '!$&\'()*+,;='; +$pchar = "(?:[$unreserved$sub_delims:@|]|$pct_encoded)"; // rfc: no "|" + +$scheme = '[a-z][a-z\d+\-.]*'; +$reg_name = "(?:[$unreserved$sub_delims|]|$pct_encoded)+"; // rfc: * instead of + and no "|" +$authority = "(?:(?:[\w\-.~!$&'()*+,;=:]|$pct_encoded)*@){0,1}(?:$reg_name|$ipv4|\[$ipv6\])[:]?\d*"; +$userinfo = "(?:(?:[$unreserved$sub_delims:]|$pct_encoded))*"; +$ipv4_simple = '[0-9.]+'; +$ipv6_simple = '\[[a-z0-9.:]+\]'; +$host = "(?:$reg_name|$ipv4_simple|$ipv6_simple)"; +$port = '\d*'; +$authority = "(?:$userinfo@)?$host(?::$port)?"; +$segment = "$pchar*"; +$path_abempty = "(?:/$segment)*"; +$hier_part = "/{2}$authority$path_abempty"; +$query = "(?:[$unreserved$sub_delims:@/?|]|$pct_encoded)*"; // pchar | "/" | "?", rfc: no "|" +$fragment = $query; + +$url = "$scheme:$hier_part(?:\?$query)?(?:\#$fragment)?"; +echo 'URL: ' . $url . "
\n"; + +// no scheme, shortened authority, but host has to start with www. +$www_url = "www\.$reg_name(?::$port)?$path_abempty(?:\?$query)?(?:\#$fragment)?"; +echo 'www.URL: ' . $www_url . "
\n"; + +// no schema and no authority +$relative_url = "$segment$path_abempty(?:\?$query)?(?:\#$fragment)?"; +echo 'relative URL: ' . $relative_url . "
\n"; + +?> \ No newline at end of file diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index 70a3ccb046..a553d8e4ed 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -221,16 +221,18 @@ class auth */ function acl_getf_global($opt) { - $allowed = false; - if (is_array($opt)) { + // evaluates to true as soon as acl_getf_global is true for one option foreach ($opt as $check_option) { - $allowed |= $this->acl_getf_global($check_option); + if ($this->acl_getf_global($check_option)) + { + return true; + } } - return $allowed; + return false; } if (isset($this->acl_options['local'][$opt])) @@ -243,20 +245,19 @@ class auth continue; } - $allowed = (!isset($this->cache[$f][$opt])) ? $this->acl_get($opt, $f) : $this->cache[$f][$opt]; - - if ($allowed) + // as soon as the user has any permission we're done so return true + if ((!isset($this->cache[$f][$opt])) ? $this->acl_get($opt, $f) : $this->cache[$f][$opt]) { - break; + return true; } } } else if (isset($this->acl_options['global'][$opt])) { - $allowed = $this->acl_get($opt); + return $this->acl_get($opt); } - return $allowed; + return false; } /** diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 9cb5c215b3..4511c57408 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2379,15 +2379,16 @@ function make_clickable($text, $server_url = false) // Be sure to not let the matches cross over. ;) // relative urls for this board - $magic_url_match[] = '#(^|[\n\t (])(' . preg_quote($server_url, '#') . ')/(([^[ \t\n\r<"\'\)&]+|&(?!lt;|quot;))*)#ie'; - $magic_url_replace[] = "'\$1' . preg_replace('/(&|\?)sid=[0-9a-f]{32}/', '\\1', '\$3') . ''"; + $magic_url_match[] = '#(^|[\n\t (])(' . preg_quote($server_url, '#') . ')/(' . get_preg_expression('relative_url') . ')#ie'; + $magic_url_replace[] = "'\$1' . preg_replace('/(&|\?)sid=[0-9a-f]{32}/', '\\\\1', '\$3') . ''"; // matches a xxxx://aaaaa.bbb.cccc. ... - $magic_url_match[] = '#(^|[\n\t (])([\w]+:/{2}.*?([^[ \t\n\r<"\'\)&]+|&(?!lt;|quot;))*)#ie'; + //$magic_url_match[] = '#(^|[\n\t (])(' . get_preg_expression('url') . ')([[ \t\n\r<"\'\)]|&(?!lt;|quot;))*#ie'; + $magic_url_match[] = '#(^|[\n\t (])(' . get_preg_expression('url') . ')#ie'; $magic_url_replace[] = "'\$1' . ((strlen('\$2') > 55) ? substr(str_replace('&', '&', '\$2'), 0, 39) . ' ... ' . substr(str_replace('&', '&', '\$2'), -10) : '\$2') . ''"; // matches a "www.xxxx.yyyy[/zzzz]" kinda lazy URL thing - $magic_url_match[] = '#(^|[\n\t (])(w{3}\.[\w\-]+\.[\w\-.\~]+(?:[^[ \t\n\r<"\'\)&]+|&(?!lt;|quot;))*)#ie'; + $magic_url_match[] = '#(^|[\n\t (])(' . get_preg_expression('www_url') . ')#ie'; $magic_url_replace[] = "'\$1' . ((strlen('\$2') > 55) ? substr(str_replace('&', '&', '\$2'), 0, 39) . ' ... ' . substr(str_replace('&', '&', '\$2'), -10) : '\$2') . ''"; // matches an email@domain type address at the start of a line, or after a space or after what might be a BBCode. @@ -2725,8 +2726,8 @@ function get_backtrace() /** * This function returns a regular expression pattern for commonly used expressions -* Use with / as delimiter for email mode -* mode can be: email|bbcode_htm +* Use with / as delimiter for email mode and # for url modes +* mode can be: email|bbcode_htm|url|www_url|relative_url */ function get_preg_expression($mode) { @@ -2745,6 +2746,19 @@ function get_preg_expression($mode) '#<.*?>#s', ); break; + + case 'url': + // generated with regex generation file in the develop folder + return "[a-z][a-z\d+\-.]*:/{2}(?:(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[\dA-F]{2}))*@)?(?:(?:[a-z0-9\-._~!$&'()*+,;=|]|%[\dA-F]{2})+|[0-9.]+|\[[a-z0-9.:]+\])(?::\d*)?(?:/(?:[a-z0-9\-._~!$&'()*+,;=:@|]|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]|%[\dA-F]{2})*)?"; + break; + + case 'www_url': + return "www\.(?:[a-z0-9\-._~!$&'()*+,;=|]|%[\dA-F]{2})+(?::\d*)?(?:/(?:[a-z0-9\-._~!$&'()*+,;=:@|]|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]|%[\dA-F]{2})*)?"; + break; + + case 'relative_url': + return "(?:[a-z0-9\-._~!$&'()*+,;=:@|]|%[\dA-F]{2})*(?:/(?:[a-z0-9\-._~!$&'()*+,;=:@|]|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]|%[\dA-F]{2})*)?"; + break; } return ''; diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index ebac61dd8f..a6687a94e5 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -783,6 +783,9 @@ class bbcode_firstpass extends bbcode /** * Validate url + * + * @param string $var1 optional url parameter for url bbcode: [url(=$var1)]$var2[/url] + * @param string $var2 url bbcode content: [url(=$var1)]$var2[/url] */ function validate_url($var1, $var2) { @@ -792,38 +795,35 @@ class bbcode_firstpass extends bbcode $var2 = str_replace("\r\n", "\n", str_replace('\"', '"', trim($var2))); $url = ($var1) ? $var1 : $var2; - $valid = false; if (!$url || ($var1 && !$var2)) { return ''; } - // Before we check anything, we make sure certain characters are not included - if (!preg_match('#[\t\n\r<"\']#', $url)) + $valid = false; + + $url = str_replace(' ', '%20', $url); + + // Checking urls + if (preg_match('#^' . get_preg_expression('url') . '$#i', $url) || + preg_match('#^' . get_preg_expression('www_url') . '$#i', $url) || + preg_match('#^' . preg_quote(generate_board_url(), '#') . get_preg_expression('relative_url') . '$#i', $url)) { - // Checking urls - if (preg_match('#' . preg_quote(generate_board_url(), '#') . '/([^ \t\n\r<"\']+)#i', $url) || - preg_match('#([\w]+?://.*?[^ \t\n\r<"\']*)#i', $url) || - preg_match('#(www\.[\w\-]+\.[\w\-.\~]+(?:/[^ \t\n\r<"\']*)?)#i', $url)) - { - $valid = true; - } + $valid = true; } if ($valid) { - // Do we want to transform some characters? - $url = str_replace(' ', '%20', $url); - $this->parsed_items['url']++; - if (!preg_match('#^[\w]+?://.*?#i', $url)) + // if there is no scheme, then add http schema + if (!preg_match('#^[a-z][a-z\d+\-.]*:/{2}#i', $url)) { $url = 'http://' . $url; } - // We take our test url and stick on the first bit of text we get to check if we are really at the domain. If so, lets go! + // Is this a link to somewhere inside this board? If so then remove the session id from the url if (strpos($url, generate_board_url()) !== false && strpos($url, 'sid=') !== false) { $url = preg_replace('/(&|\?)sid=[0-9a-f]{32}/', '\1', $url); diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 598299e316..490b676906 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -639,14 +639,29 @@ class fulltext_mysql extends search_backend $this->get_stats(); } + $alter = array(); + if (!isset($this->stats['post_subject'])) { - $db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' ADD FULLTEXT (post_subject)'); + if (version_compare($db->mysql_version, '4.1.3', '>=')) + { + $alter[] = 'MODIFY post_subject varchar(100) COLLATE utf8_unicode_ci DEFAULT \'\' NOT NULL'; + } + $alter[] = 'ADD FULLTEXT (post_subject)'; } if (!isset($this->stats['post_text'])) { - $db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' ADD FULLTEXT (post_text)'); + if (version_compare($db->mysql_version, '4.1.3', '>=')) + { + $alter[] = 'MODIFY post_text mediumtext COLLATE utf8_unicode_ci NOT NULL'; + } + $alter[] = 'ADD FULLTEXT (post_text)'; + } + + if (sizeof($alter)) + { + $db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' ' . implode(', ', $alter)); } $db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE); @@ -672,14 +687,21 @@ class fulltext_mysql extends search_backend $this->get_stats(); } + $alter = array(); + if (isset($this->stats['post_subject'])) { - $db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' DROP INDEX post_subject'); + $alter[] = 'DROP INDEX post_subject'; } if (isset($this->stats['post_text'])) { - $db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' DROP INDEX post_text'); + $alter[] = 'DROP INDEX post_text'; + } + + if (sizeof($alter)) + { + $db->sql_query('ALTER TABLE ' . POSTS_TABLE . ' ' . implode(', ', $alter)); } $db->sql_query('TRUNCATE TABLE ' . SEARCH_RESULTS_TABLE); diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 229b7f10eb..e11245ec0c 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -158,8 +158,8 @@ class session // Whoa these look impressive! // The code to generate the following two regular expressions which match valid IPv4/IPv6 addresses // can be found in the develop directory - $ipv4 = '#^(?:(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])$#'; - $ipv6 = '#^(?:(?:(?:[\dA-F]{1,4}:){6}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])))|(?:::(?:[\dA-F]{1,4}:){5}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:):(?:[\dA-F]{1,4}:){4}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,2}:(?:[\dA-F]{1,4}:){3}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,3}:(?:[\dA-F]{1,4}:){2}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,4}:(?:[\dA-F]{1,4}:)(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,5}:(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d?\d|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,6}:[\dA-F]{1,4})|(?:(?:[\dA-F]{1,4}:){1,7}:))$#'; + $ipv4 = '#^(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$#'; + $ipv6 = '#^(?:(?:(?:[\dA-F]{1,4}:){6}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:::(?:[\dA-F]{1,4}:){5}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:):(?:[\dA-F]{1,4}:){4}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,2}:(?:[\dA-F]{1,4}:){3}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,3}:(?:[\dA-F]{1,4}:){2}(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,4}:(?:[\dA-F]{1,4}:)(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,5}:(?:[\dA-F]{1,4}:[\dA-F]{1,4}|(?:(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.){3}(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])))|(?:(?:[\dA-F]{1,4}:){1,6}:[\dA-F]{1,4})|(?:(?:[\dA-F]{1,4}:){1,7}:))$#i'; // split the list of IPs $ips = explode(', ', $this->forwarded_for); @@ -313,7 +313,7 @@ class session // Added logging temporarly to help debug bugs... if (defined('DEBUG_EXTRA')) { - add_log('critical', 'LOG_IP_BROWSER_FORWARDED_CHECK', $u_ip, $s_ip, $u_browser, $s_browser, $u_forwarded, $s_forwarded); + add_log('critical', 'LOG_IP_BROWSER_FORWARDED_CHECK', $u_ip, $s_ip, $u_browser, $s_browser, $u_forwarded_for, $s_forwarded_for); } } } From f4c8c73a8b735925be215661b0879aa316c3d1f4 Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 17 Dec 2006 16:11:48 +0000 Subject: [PATCH 093/264] - exclude the IP of the post in the "other IP's" list git-svn-id: file:///svn/phpbb/trunk@6776 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/mcp/mcp_post.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index 44558eb553..f17821ae28 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -38,12 +38,12 @@ function mcp_post_details($id, $mode, $action) $ip = request_var('ip', ''); include($phpbb_root_path . 'includes/functions_user.' . $phpEx); - + $whois = user_ipwhois($ip); - + $whois = preg_replace('#(\s)([\w\-\._\+]+@[\w\-\.]+)(\s)#', '\1\2\3', $whois); - $whois = preg_replace('#(\s)(http:/{2}[^\s]*)(\s)#', '\1\2\3', $whois); - + $whois = preg_replace('#(\s)(ht{2}p:/{2}\S*)(\s)#', '\1\2\3', $whois); + $template->assign_vars(array( 'RETURN_POST' => sprintf($user->lang['RETURN_POST'], '', ''), 'WHOIS' => trim($whois)) @@ -275,6 +275,7 @@ function mcp_post_details($id, $mode, $action) $sql = 'SELECT poster_ip, COUNT(poster_ip) AS postings FROM ' . POSTS_TABLE . ' WHERE poster_id = ' . $post_info['poster_id'] . ' + AND poster_ip <> ' . $db->sql_escape($post_info['poster_ip']) . ' GROUP BY poster_ip ORDER BY postings DESC'; $result = $db->sql_query($sql); From e84d85d88cc5a88854a50bf025d766726c030f2a Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 17 Dec 2006 17:59:08 +0000 Subject: [PATCH 094/264] - Changed handling of the bitfield in bbcode.php - #6270, reverted to an earlier version of list handling + bug fixes git-svn-id: file:///svn/phpbb/trunk@6777 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/bbcode.php | 23 ++------- phpBB/includes/message_parser.php | 80 +++++++++++++++++++++---------- 2 files changed, 59 insertions(+), 44 deletions(-) diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index 9536abddd3..906094b233 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -21,7 +21,7 @@ class bbcode var $bbcodes = array(); - var $template_bitfield = 0; + var $template_bitfield; var $template_filename = ''; /** @@ -115,7 +115,7 @@ class bbcode if (empty($this->template_filename)) { - $this->template_bitfield = $user->theme['bbcode_bitfield']; + $this->template_bitfield = new bitfield($user->theme['bbcode_bitfield']); $this->template_filename = $phpbb_root_path . 'styles/' . $user->theme['template_path'] . '/template/bbcode.html'; if (!@file_exists($this->template_filename)) @@ -318,13 +318,9 @@ class bbcode break; default: - if (!isset($template_bitfield)) - { - $template_bitfield = new bitfield($this->template_bitfield); - } if (isset($rowset[$bbcode_id])) { - if ($template_bitfield->get($bbcode_id)) + if ($this->template_bitfield->get($bbcode_id)) { // The bbcode requires a custom template to be loaded if (!$bbcode_tpl = $this->bbcode_tpl($rowset[$bbcode_id]['bbcode_tag'], $bbcode_id)) @@ -383,10 +379,10 @@ class bbcode */ function bbcode_tpl($tpl_name, $bbcode_id = -1, $skip_bitfield_check = false) { + static $bbcode_hardtpl = array(); if (empty($bbcode_hardtpl)) { global $user; - static $bbcode_hardtpl = array(); $bbcode_hardtpl = array( 'b_open' => '', @@ -400,10 +396,9 @@ class bbcode 'color' => '$2', 'email' => '$2' ); - $template_bitfield = new bitfield($this->template_bitfield); } - if ($bbcode_id != -1 && !$template_bitfield->get($bbcode_id) && !$skip_bitfield_check) + if ($bbcode_id != -1 && !$skip_bitfield_check && !$this->template_bitfield->get($bbcode_id)) { return (isset($bbcode_hardtpl[$tpl_name])) ? $bbcode_hardtpl[$tpl_name] : false; } @@ -477,49 +472,41 @@ class bbcode { $tpl = 'ulist_open_default'; $type = 'default'; - $start = 0; } else if ($type == 'i') { $tpl = 'olist_open'; $type = 'lower-roman'; - $start = 1; } else if ($type == 'I') { $tpl = 'olist_open'; $type = 'upper-roman'; - $start = 1; } else if (preg_match('#^(disc|circle|square)$#i', $type)) { $tpl = 'ulist_open'; $type = strtolower($type); - $start = 1; } else if (preg_match('#^[a-z]$#', $type)) { $tpl = 'olist_open'; $type = 'lower-alpha'; - $start = ord($type) - 96; } else if (preg_match('#[A-Z]#', $type)) { $tpl = 'olist_open'; $type = 'upper-alpha'; - $start = ord($type) - 64; } else if (is_numeric($type)) { $tpl = 'olist_open'; $type = 'arabic-numbers'; - $start = intval($type); } else { $tpl = 'olist_open'; $type = 'arabic-numbers'; - $start = 1; } return str_replace('{LIST_TYPE}', $type, $this->bbcode_tpl($tpl)); diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index a6687a94e5..251e736a14 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -119,7 +119,7 @@ class bbcode_firstpass extends bbcode 'size' => array('bbcode_id' => 5, 'regexp' => array('#\[size=([\-\+]?[1-2]?[0-9])\](.*?)\[/size\]#ise' => "\$this->bbcode_size('\$1', '\$2')")), 'color' => array('bbcode_id' => 6, 'regexp' => array('!\[color=(#[0-9A-Fa-f]{6}|[a-z\-]+)\](.*?)\[/color\]!ise' => "\$this->bbcode_color('\$1', '\$2')")), 'u' => array('bbcode_id' => 7, 'regexp' => array('#\[u\](.*?)\[/u\]#ise' => "\$this->bbcode_underline('\$1')")), - 'list' => array('bbcode_id' => 9, 'regexp' => array('#\[list(=[a-z|0-9|(?:disc|circle|square))]+)?\].*\[/list\]#ise' => "\$this->bbcode_parse_list('\$0')")), + 'list' => array('bbcode_id' => 9, 'regexp' => array('#\[list(?:=(?:[a-z0-9]|disc|circle|square))?].*\[/list]#ise' => "\$this->bbcode_parse_list('\$0')")), 'email' => array('bbcode_id' => 10, 'regexp' => array('#\[email=?(.*?)?\](.*?)\[/email\]#ise' => "\$this->validate_email('\$1', '\$2')")), 'flash' => array('bbcode_id' => 11, 'regexp' => array('#\[flash=([0-9]+),([0-9]+)\](.*?)\[/flash\]#ie' => "\$this->bbcode_flash('\$1', '\$2', '\$3')")) ); @@ -484,27 +484,13 @@ class bbcode_firstpass extends bbcode return ''; } - $out = '['; - - // Grab item_start with no item_end - $in = preg_replace('#\[\*\](.*?)(\[\/list\]|\[list(=?(?:[0-9]|[a-z]|))\]|\[\*\])#is', '[*:' . $this->bbcode_uid . ']\1[/*:m:' . $this->bbcode_uid . ']\2', $in); - - // Grab them again as backreference - $in = preg_replace('#\[\*\](.*?)(\[\/list\]|\[list(=?(?:[0-9]|[a-z]|))\]|\[\*\])(^\[\/*\])#is', '[*:' . $this->bbcode_uid . ']\1[/*:m:' . $this->bbcode_uid . ']\2', $in); - - // Grab end tag following start tag - $in = preg_replace('#\[\/\*:m:' . $this->bbcode_uid . '\](\n|)\[\*\]#is', '[/*:m:' . $this->bbcode_uid . '][*:' . $this->bbcode_uid . ']', $in); - - // Replace end tag - $in = preg_replace('#\[\/\*\]#i', '[/*:' . $this->bbcode_uid . ']', $in); - // $tok holds characters to stop at. Since the string starts with a '[' we'll get everything up to the first ']' which should be the opening [list] tag $tok = ']'; $out = '['; // First character is [ $in = substr($in, 1); - $list_end_tags = array(); + $list_end_tags = $item_end_tags = array(); do { @@ -512,7 +498,7 @@ class bbcode_firstpass extends bbcode for ($i = 0, $tok_len = strlen($tok); $i < $tok_len; ++$i) { - $tmp_pos = strpos($in, $tok{$i}); + $tmp_pos = strpos($in, $tok[$i]); if ($tmp_pos !== false && $tmp_pos < $pos) { @@ -521,7 +507,7 @@ class bbcode_firstpass extends bbcode } $buffer = substr($in, 0, $pos); - $tok = $in{$pos}; + $tok = $in[$pos]; $in = substr($in, $pos + 1); @@ -530,13 +516,20 @@ class bbcode_firstpass extends bbcode // if $tok is ']' the buffer holds a tag if (strtolower($buffer) == '/list' && sizeof($list_end_tags)) { + // valid [/list] tag + if (sizeof($item_end_tags)) + { + // current li tag has not been closed + $out = preg_replace('/\n?\[$/', '[', $out) . array_pop($item_end_tags) . ']['; + } + $out .= array_pop($list_end_tags) . ']'; $tok = '['; } - else if (preg_match('#list(=?(?:[0-9]|[a-z]|))#i', $buffer, $m)) + else if (preg_match('#list(=[0-9a-z])?#i', $buffer, $m)) { // sub-list, add a closing tag - if (!$m[1] || preg_match('/^(disc|square|circle)$/i', $m[1])) + if (empty($m[1]) || preg_match('/^(disc|square|circle)$/i', $m[1])) { array_push($list_end_tags, '/list:u:' . $this->bbcode_uid); } @@ -544,17 +537,47 @@ class bbcode_firstpass extends bbcode { array_push($list_end_tags, '/list:o:' . $this->bbcode_uid); } - - if (strtolower(substr($buffer, 0, 4)) == 'list') - { - $buffer = 'list' . substr($buffer, 4, $pos); - } - $out .= $buffer . ':' . $this->bbcode_uid . ']'; $tok = '['; } else { + if (($buffer == '*' || substr($buffer, -2) == '[*') && sizeof($list_end_tags)) + { + // the buffer holds a bullet tag and we have a [list] tag open + if (sizeof($item_end_tags) >= sizeof($list_end_tags)) + { + if (substr($buffer, -2) == '[*') + { + $out .= substr($buffer, 0, -2) . '['; + } + // current li tag has not been closed + if (preg_match('/\n\[$/', $out, $m)) + { + $out = preg_replace('/\n\[$/', '[', $out); + $buffer = array_pop($item_end_tags) . "]\n[*:" . $this->bbcode_uid; + } + else + { + $buffer = array_pop($item_end_tags) . '][*:' . $this->bbcode_uid; + } + } + else + { + $buffer = '*:' . $this->bbcode_uid; + } + + $item_end_tags[] = '/*:m:' . $this->bbcode_uid; + } + else if ($buffer == '/*') + { + if (array_pop($item_end_tags) == '/*:m:' . $this->bbcode_uid) + { + array_pop($item_end_tags); + } + $buffer = '/*:' . $this->bbcode_uid; + } + $out .= $buffer . $tok; $tok = '[]'; } @@ -568,6 +591,11 @@ class bbcode_firstpass extends bbcode } while ($in); + // do we have some tags open? close them now + if (sizeof($item_end_tags)) + { + $out .= '[' . implode('][', $item_end_tags) . ']'; + } if (sizeof($list_end_tags)) { $out .= '[' . implode('][', $list_end_tags) . ']'; From f50d52588cc94543ac3aa313c8d8d71eca801557 Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 17 Dec 2006 18:06:39 +0000 Subject: [PATCH 095/264] - we need at least 4.3.3, "phpversion() < '4.3'" will always be false git-svn-id: file:///svn/phpbb/trunk@6778 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_messenger.php | 9 --------- 1 file changed, 9 deletions(-) diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index b6af4ef12f..7296a8c283 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -26,15 +26,6 @@ class messenger */ function messenger($use_queue = true) { - global $config; - - if (preg_match('#^[c-z]:\\\#i', getenv('PATH')) && !$config['smtp_delivery'] && phpversion() < '4.3') - { - // We are running on windows, force delivery to use our smtp functions since php's are broken by default - $config['smtp_delivery'] = 1; - $config['smtp_host'] = @ini_get('SMTP'); - } - $this->use_queue = $use_queue; $this->subject = ''; } From c1b5a3b3282e2ab37bfd1ee7c04da14b4b1b9674 Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 17 Dec 2006 18:17:10 +0000 Subject: [PATCH 096/264] - using the PHP_VERSION constant is faster git-svn-id: file:///svn/phpbb/trunk@6779 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/common.php b/phpBB/common.php index 295a0a4abd..2d1d67c3fc 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -76,7 +76,7 @@ function deregister_globals() } // If we are on PHP >= 6.0.0 we do not need some code -if (version_compare(phpversion(), '6.0.0-dev', '>=')) +if (version_compare(PHP_VERSION, '6.0.0-dev', '>=')) { /** * @ignore From 4e5466d276a4c8bb24172b2dc888c8d1a715a04a Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 17 Dec 2006 23:21:34 +0000 Subject: [PATCH 097/264] #6328 git-svn-id: file:///svn/phpbb/trunk@6780 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_user.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 449d436001..6a9fc0922d 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -245,7 +245,7 @@ function user_add($user_row, $cp_data = false) $db->sql_query($sql); // Now make it the users default group... - group_set_user_default($user_row['group_id'], array($user_id), false, true); + group_set_user_default($user_row['group_id'], array($user_id), false, $user_row['user_type'] == USER_NORMAL); // set the newest user and adjust the user count if the user is a normal user and no activation mail is sent if ($user_row['user_type'] == USER_NORMAL) From 7ca8a4a6626345fa7444cbbbb36b678e31688258 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 18 Dec 2006 17:29:39 +0000 Subject: [PATCH 098/264] - Modules are not added correctly [#6370] - Minor bug in ucp_prefs_personal.html (Opera) [#6348] - MCP-Warnings section colspan problem in Opera [#6338] - Loading extensions on install [#6332] - Adjust PM rules if folder removed [#6326] - #6318 - Coppa registration [#6306] - Quick-Mod Topic Type Changes Fail when Topic == Global [#6228] - added the possibility to change topic type for more than one topic (within mcp) git-svn-id: file:///svn/phpbb/trunk@6781 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/acp_modules.html | 1 + phpBB/includes/mcp/mcp_forum.php | 5 ++ phpBB/includes/mcp/mcp_main.php | 54 +++++++++++++++---- phpBB/includes/mcp/mcp_post.php | 11 ++-- phpBB/includes/mcp/mcp_topic.php | 4 +- phpBB/includes/ucp/ucp_pm_options.php | 8 +++ phpBB/includes/ucp/ucp_register.php | 3 +- phpBB/install/install_install.php | 34 ++++++++++-- phpBB/language/en/acp/common.php | 2 +- phpBB/language/en/mcp.php | 41 +++++++------- phpBB/mcp.php | 28 +++++++--- .../styles/subSilver/template/mcp_forum.html | 6 +++ phpBB/styles/subSilver/template/mcp_move.html | 2 +- phpBB/styles/subSilver/template/mcp_post.html | 4 +- .../subSilver/template/mcp_warn_front.html | 8 +-- .../subSilver/template/mcp_warn_list.html | 4 +- .../template/ucp_prefs_personal.html | 2 +- 17 files changed, 158 insertions(+), 59 deletions(-) diff --git a/phpBB/adm/style/acp_modules.html b/phpBB/adm/style/acp_modules.html index c9f7c0baf1..25920f7577 100644 --- a/phpBB/adm/style/acp_modules.html +++ b/phpBB/adm/style/acp_modules.html @@ -27,6 +27,7 @@ // Create the new select tag var new_node = document.createElement('select'); new_node.setAttribute('id', 'module_mode'); + new_node.setAttribute('name', 'module_mode'); // Substitute it for the old one item.parentNode.replaceChild(new_node, item); diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index 4fdae3159d..9c51990ef0 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -16,6 +16,8 @@ function mcp_forum_view($id, $mode, $action, $forum_info) global $template, $db, $user, $auth, $cache; global $phpEx, $phpbb_root_path, $config; + $user->add_lang('viewtopic'); + include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx); $url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . extra_url()); @@ -78,6 +80,9 @@ function mcp_forum_view($id, $mode, $action, $forum_info) 'S_CAN_SYNC' => $auth->acl_get('m_', $forum_id), 'S_CAN_APPROVE' => $auth->acl_get('m_approve', $forum_id), 'S_MERGE_SELECT' => ($action == 'merge_select') ? true : false, + 'S_CAN_MAKE_NORMAL' => $auth->acl_gets('f_sticky', 'f_announce', $forum_id), + 'S_CAN_MAKE_STICKY' => $auth->acl_get('f_sticky', $forum_id), + 'S_CAN_MAKE_ANNOUNCE' => $auth->acl_get('f_announce', $forum_id), 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id), 'U_VIEW_FORUM_LOGS' => ($auth->acl_gets('a_', 'm_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=logs&mode=forum_logs&f=' . $forum_id) : '', diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 262e9d0c74..135280c650 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -312,13 +312,13 @@ function change_topic_type($action, $topic_ids) break; } - $redirect = request_var('redirect', $user->data['session_page']); + $redirect = request_var('redirect', build_url(array('_f_', 'action', 'quickmod'))); - $s_hidden_fields = build_hidden_fields(array( + $s_hidden_fields = array( 'topic_id_list' => $topic_ids, 'f' => $forum_id, 'action' => $action, - 'redirect' => $redirect) + 'redirect' => $redirect, ); $success_msg = ''; @@ -333,22 +333,24 @@ function change_topic_type($action, $topic_ids) $db->sql_query($sql); // Reset forum id if a global topic is within the array - if ($forum_id) + $to_forum_id = request_var('to_forum_id', 0); + + if ($to_forum_id) { $sql = 'UPDATE ' . TOPICS_TABLE . " - SET topic_type = $new_topic_type, forum_id = $forum_id + SET topic_type = $new_topic_type, forum_id = $to_forum_id WHERE " . $db->sql_in_set('topic_id', $topic_ids) . ' AND forum_id = 0'; $db->sql_query($sql); // Update forum_ids for all posts $sql = 'UPDATE ' . POSTS_TABLE . " - SET forum_id = $forum_id + SET forum_id = $to_forum_id WHERE " . $db->sql_in_set('topic_id', $topic_ids) . ' AND forum_id = 0'; $db->sql_query($sql); - sync('forum', 'forum_id', $forum_id); + sync('forum', 'forum_id', $to_forum_id); } } else @@ -403,7 +405,41 @@ function change_topic_type($action, $topic_ids) } else { - confirm_box(false, $l_new_type, $s_hidden_fields); + // Global topic involved? + $global_involved = false; + + if ($new_topic_type != POST_GLOBAL) + { + $sql = 'SELECT forum_id + FROM ' . TOPICS_TABLE . ' + WHERE ' . $db->sql_in_set('topic_id', $topic_ids) . ' + AND forum_id = 0'; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if ($row) + { + $global_involved = true; + } + } + + if ($global_involved) + { + global $template; + + $template->assign_vars(array( + 'S_FORUM_SELECT' => make_forum_select(request_var('f', $forum_id), false, false, true, true), + 'S_CAN_LEAVE_SHADOW' => false, + 'ADDITIONAL_MSG' => (sizeof($topic_ids) == 1) ? $user->lang['SELECT_FORUM_GLOBAL_ANNOUNCEMENT'] : $user->lang['SELECT_FORUM_GLOBAL_ANNOUNCEMENTS']) + ); + + confirm_box(false, $l_new_type, build_hidden_fields($s_hidden_fields), 'mcp_move.html'); + } + else + { + confirm_box(false, $l_new_type, build_hidden_fields($s_hidden_fields)); + } } $redirect = request_var('redirect', "index.$phpEx"); @@ -437,7 +473,7 @@ function mcp_move_topic($topic_ids) } $to_forum_id = request_var('to_forum_id', 0); - $redirect = request_var('redirect', $user->data['session_page']); + $redirect = request_var('redirect', build_url(array('_f_', 'action', 'quickmod'))); $additional_msg = $success_msg = ''; $s_hidden_fields = build_hidden_fields(array( diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index f17821ae28..a921d90041 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -145,8 +145,10 @@ function mcp_post_details($id, $mode, $action) 'POST_DATE' => $user->format_date($post_info['post_time']), 'POST_IP' => $post_info['poster_ip'], 'POST_IPADDR' => @gethostbyaddr($post_info['poster_ip']), - 'POST_ID' => $post_info['post_id']) - ); + 'POST_ID' => $post_info['post_id'], + + 'U_WHOIS' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&mode=$mode&action=whois&p=$post_id&ip={$post_info['poster_ip']}") : '', + )); // Get User Notes $log_data = array(); @@ -274,10 +276,9 @@ function mcp_post_details($id, $mode, $action) $sql = 'SELECT poster_ip, COUNT(poster_ip) AS postings FROM ' . POSTS_TABLE . ' - WHERE poster_id = ' . $post_info['poster_id'] . ' - AND poster_ip <> ' . $db->sql_escape($post_info['poster_ip']) . ' + WHERE poster_id = ' . $post_info['poster_id'] . " GROUP BY poster_ip - ORDER BY postings DESC'; + ORDER BY postings DESC"; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 44904358e5..2b761bfcae 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -280,7 +280,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) return; } - $redirect = request_var('redirect', $user->data['session_page']); + $redirect = request_var('redirect', build_url(array('_f_', 'quickmod'))); $s_hidden_fields = build_hidden_fields(array( 'i' => 'main', @@ -438,7 +438,7 @@ function merge_posts($topic_id, $to_topic_id) return; } - $redirect = request_var('redirect', $user->data['session_page']); + $redirect = request_var('redirect', build_url(array('_f_', 'quickmod'))); $s_hidden_fields = build_hidden_fields(array( 'i' => 'main', diff --git a/phpBB/includes/ucp/ucp_pm_options.php b/phpBB/includes/ucp/ucp_pm_options.php index da451b999c..fc1bffa5f5 100644 --- a/phpBB/includes/ucp/ucp_pm_options.php +++ b/phpBB/includes/ucp/ucp_pm_options.php @@ -227,6 +227,14 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit $user->data['user_full_folder'] = PRIVMSGS_INBOX; } + // Now make sure the folder is not used for rules + // We assign another folder id (the one the messages got moved to) or assign the INBOX (to not have to remove any rule) + $sql = 'UPDATE ' . PRIVMSGS_RULES_TABLE . ' SET rule_folder_id = '; + $sql .= ($remove_action == 1) ? $move_to : PRIVMSGS_INBOX; + $sql .= ' WHERE rule_folder_id = ' . $remove_folder_id; + + $db->sql_query($sql); + $meta_info = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=$mode"); $message = $user->lang['FOLDER_REMOVED']; diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 39afc8cad7..b8d5c438a7 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -65,6 +65,7 @@ class ucp_register if (!$agreed) { $add_lang = ($change_lang) ? '&change_lang=' . urlencode($change_lang) : ''; + $add_coppa = ($coppa) ? '&coppa=1' : ''; if ($coppa === false && $config['coppa_enable']) { @@ -92,7 +93,7 @@ class ucp_register 'S_SHOW_COPPA' => false, 'S_REGISTRATION' => true, 'S_HIDDEN_FIELDS' => ($confirm_id) ? '' : '', - 'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register' . $add_lang)) + 'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register' . $add_lang . $add_coppa)) ); } diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index f5cf049327..b3a7bfa89a 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -97,7 +97,6 @@ class install_install extends module case 'create_table': $this->load_schema($mode, $sub); - break; case 'final' : @@ -206,8 +205,16 @@ class install_install extends module 'S_LEGEND' => false, )); +/** +* Better not enabling and adding to the loaded extensions due to the specific requirements needed + if (!@extension_loaded('mbstring')) + { + $this->can_load_dll('mbstring'); + } +*/ + $passed['mbstring'] = true; - if (extension_loaded('mbstring')) + if (@extension_loaded('mbstring')) { // Test for available database modules $template->assign_block_vars('checks', array( @@ -338,7 +345,7 @@ class install_install extends module } // Can we find Imagemagick anywhere on the system? - $exe = ((defined('PHP_OS')) && (preg_match('#^win#i', PHP_OS))) ? '.exe' : ''; + $exe = (defined('PHP_OS') && strpos(strtolower(PHP_OS), 'win') === 0) ? '.exe' : ''; $magic_home = getenv('MAGICK_HOME'); $img_imagick = ''; @@ -831,6 +838,8 @@ class install_install extends module $load_extensions = array(); $check_exts = array_merge(array($this->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)) @@ -839,6 +848,7 @@ class install_install extends module { continue; } + $load_extensions[] = "$dll.$suffix"; } } @@ -1086,7 +1096,7 @@ class install_install extends module // If we get here and the extension isn't loaded it should be safe to just go ahead and load it if (!@extension_loaded($this->available_dbms[$dbms]['MODULE'])) { - @dl($this->available_dbms[$dbms]['MODULE'] . ".$prefix"); + $this->can_load_dll($this->available_dbms[$dbms]['MODULE']); } $dbpasswd = htmlspecialchars_decode($dbpasswd); @@ -1305,6 +1315,11 @@ class install_install extends module SET forum_last_post_time = $current_time", ); + if (!@extension_loaded('gd')) + { + $this->can_load_dll('gd'); + } + // This is for people who have TTF and GD if (@extension_loaded('gd') && function_exists('imagettfbbox') && function_exists('imagettftext')) { @@ -1356,6 +1371,12 @@ class install_install extends module $dbpasswd = htmlspecialchars_decode($dbpasswd); + // If we get here and the extension isn't loaded it should be safe to just go ahead and load it + if (!@extension_loaded($this->available_dbms[$dbms]['MODULE'])) + { + $this->can_load_dll($this->available_dbms[$dbms]['MODULE']); + } + // Load the appropriate database class if not already loaded include($phpbb_root_path . 'includes/db/' . $this->available_dbms[$dbms]['DRIVER'] . '.' . $phpEx); @@ -1770,6 +1791,11 @@ class install_install extends module { 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; } diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 7253334bd3..e1c281eb4a 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -185,7 +185,7 @@ $lang = array_merge($lang, array( 'ACP_VIEW_ADMIN_PERMISSIONS' => 'View administrative permissions', 'ACP_VIEW_FORUM_MOD_PERMISSIONS' => 'View forum moderation permissions', 'ACP_VIEW_FORUM_PERMISSIONS' => 'View forum-based permissions', - 'ACP_VIEW_GLOBAL_MOD_PERMISSIONS' => 'View global moderatoration permissions', + 'ACP_VIEW_GLOBAL_MOD_PERMISSIONS' => 'View global moderation permissions', 'ACP_VIEW_USER_PERMISSIONS' => 'View user-based permissions', 'ACP_WORDS' => 'Word censoring', diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php index 9eeb70d57b..1b7f430806 100644 --- a/phpBB/language/en/mcp.php +++ b/phpBB/language/en/mcp.php @@ -95,6 +95,7 @@ $lang = array_merge($lang, array( 'GLOBAL_ANNOUNCEMENT' => 'Global Announcement', 'IP_INFO' => 'IP Information', + 'IPS_POSTED_FROM' => 'IP addresses this user has posted from', 'LATEST_LOGS' => 'Latest 5 logged actions', 'LATEST_REPORTED' => 'Latest 5 reports', @@ -211,7 +212,6 @@ $lang = array_merge($lang, array( 'NO_TOPIC_ICON' => 'None', 'NO_TOPIC_SELECTED' => 'You must select at least one topic to perform this action', - 'OTHER_IPS' => 'Other IP addresses this user has posted from', 'ONLY_TOPIC' => 'Only topic "%s"', 'OTHER_USERS' => 'Users posting from this IP', @@ -262,24 +262,26 @@ $lang = array_merge($lang, array( 'RETURN_QUEUE' => '%sReturn to the queue%s', 'RETURN_REPORTS' => '%sReturn to the reports%s', - 'SEARCH_POSTS_BY_USER' => 'Search posts by', - 'SELECT_ACTION' => 'Select desired action', - 'SELECT_TOPICS_FROM' => 'Select topics from', - 'SELECT_TOPIC' => 'Select topic', - 'SELECT_USER' => 'Select user', - 'SORT_ACTION' => 'Log action', - 'SORT_DATE' => 'Date', - 'SORT_IP' => 'IP address', - 'SORT_WARNINGS' => 'Warnings', - 'SPLIT_AFTER' => 'Split from selected post', - 'SPLIT_FORUM' => 'Forum for new topic', - 'SPLIT_POSTS' => 'Split selected posts', - 'SPLIT_SUBJECT' => 'New topic title', - 'SPLIT_TOPIC_ALL' => 'Split topic from selected posts', - 'SPLIT_TOPIC_ALL_CONFIRM' => 'Are you sure you want to split this topic?', - 'SPLIT_TOPIC_BEYOND' => 'Split topic at selected post', - 'SPLIT_TOPIC_BEYOND_CONFIRM'=> 'Are you sure you want to split this topic at the selected post?', - 'SPLIT_TOPIC_EXPLAIN' => 'Using the form below you can split a topic in two, either by selecting the posts individually or by splitting at a selected post', + 'SEARCH_POSTS_BY_USER' => 'Search posts by', + 'SELECT_ACTION' => 'Select desired action', + 'SELECT_FORUM_GLOBAL_ANNOUNCEMENT' => 'Please select the forum you wish this global announcement to be displayed.', + 'SELECT_FORUM_GLOBAL_ANNOUNCEMENTS' => 'One or more of the selected topics are global announcements. Please select the forum you wish these to be displayed.', + 'SELECT_TOPICS_FROM' => 'Select topics from', + 'SELECT_TOPIC' => 'Select topic', + 'SELECT_USER' => 'Select user', + 'SORT_ACTION' => 'Log action', + 'SORT_DATE' => 'Date', + 'SORT_IP' => 'IP address', + 'SORT_WARNINGS' => 'Warnings', + 'SPLIT_AFTER' => 'Split from selected post', + 'SPLIT_FORUM' => 'Forum for new topic', + 'SPLIT_POSTS' => 'Split selected posts', + 'SPLIT_SUBJECT' => 'New topic title', + 'SPLIT_TOPIC_ALL' => 'Split topic from selected posts', + 'SPLIT_TOPIC_ALL_CONFIRM' => 'Are you sure you want to split this topic?', + 'SPLIT_TOPIC_BEYOND' => 'Split topic at selected post', + 'SPLIT_TOPIC_BEYOND_CONFIRM' => 'Are you sure you want to split this topic at the selected post?', + 'SPLIT_TOPIC_EXPLAIN' => 'Using the form below you can split a topic in two, either by selecting the posts individually or by splitting at a selected post', 'THIS_POST_IP' => 'IP for this post', 'TOPICS_APPROVED_SUCCESS' => 'The selected topics have been approved', @@ -289,6 +291,7 @@ $lang = array_merge($lang, array( 'TOPICS_LOCKED_SUCCESS' => 'The selected topics have been locked', 'TOPICS_MOVED_SUCCESS' => 'The selected topics have been moved successfully', 'TOPICS_RESYNC_SUCCESS' => 'The selected topics have been resynchronised', + 'TOPICS_TYPE_CHANGED' => 'Topic types changed successfully.', 'TOPICS_UNLOCKED_SUCCESS' => 'The selected topics have been unlocked', 'TOPIC_APPROVED_SUCCESS' => 'The selected topic has been approved', 'TOPIC_DELETED_SUCCESS' => 'The selected topic has been successfully removed from the database', diff --git a/phpBB/mcp.php b/phpBB/mcp.php index 98a59a73ed..7886091081 100644 --- a/phpBB/mcp.php +++ b/phpBB/mcp.php @@ -632,6 +632,7 @@ function check_ids(&$ids, $table, $sql_id, $acl_list = false, $single_forum = fa $ids = array(); $forum_id = false; + while ($row = $db->sql_fetchrow($result)) { if ($acl_list && $row['forum_id'] && !$auth->acl_gets($acl_list, $row['forum_id'])) @@ -652,17 +653,26 @@ function check_ids(&$ids, $table, $sql_id, $acl_list = false, $single_forum = fa } // Limit forum to a specific forum id? - if ($single_forum !== true && $row['forum_id'] == (int) $single_forum) + // This can get really tricky, because we do not want to create a failure on global topics. :) + if ($row['forum_id']) { - $forum_id = (int) $single_forum; - } - else if ($forum_id === false) - { - $forum_id = $row['forum_id']; - } + if ($single_forum !== true && $row['forum_id'] == (int) $single_forum) + { + $forum_id = (int) $single_forum; + } + else if ($forum_id === false) + { + $forum_id = $row['forum_id']; + } - if ($row['forum_id'] == $forum_id) + if ($row['forum_id'] == $forum_id) + { + $ids[] = $row[$sql_id]; + } + } + else { + // Always add a global topic $ids[] = $row[$sql_id]; } } @@ -673,6 +683,8 @@ function check_ids(&$ids, $table, $sql_id, $acl_list = false, $single_forum = fa return false; } + // If forum id is false and ids populated we may have only global announcements selected (returning 0 because of (int) $forum_id) + return ($single_forum === false) ? true : (int) $forum_id; } diff --git a/phpBB/styles/subSilver/template/mcp_forum.html b/phpBB/styles/subSilver/template/mcp_forum.html index 536e7bc0b9..fe20a7eca0 100644 --- a/phpBB/styles/subSilver/template/mcp_forum.html +++ b/phpBB/styles/subSilver/template/mcp_forum.html @@ -56,6 +56,12 @@ + + + + + + diff --git a/phpBB/styles/subSilver/template/mcp_move.html b/phpBB/styles/subSilver/template/mcp_move.html index 78a0579de6..eed7ca8fe3 100644 --- a/phpBB/styles/subSilver/template/mcp_move.html +++ b/phpBB/styles/subSilver/template/mcp_move.html @@ -20,7 +20,7 @@ {L_LEAVE_SHADOW}

{S_HIDDEN_FIELDS}{MESSAGE_TEXT}

-   
+    {L_NO_DESTINATION_FORUM}

{S_HIDDEN_FIELDS} diff --git a/phpBB/styles/subSilver/template/mcp_post.html b/phpBB/styles/subSilver/template/mcp_post.html index 301ee6a9a7..0f695881ac 100644 --- a/phpBB/styles/subSilver/template/mcp_post.html +++ b/phpBB/styles/subSilver/template/mcp_post.html @@ -58,7 +58,7 @@ {L_THIS_POST_IP}: - {POST_IP} [ {POST_IPADDR} ] + {POST_IP}{POST_IP} [ {POST_IPADDR} ] @@ -137,7 +137,7 @@ - {L_OTHER_IPS} + {L_IPS_POSTED_FROM} [ {L_LOOKUP_ALL} ] diff --git a/phpBB/styles/subSilver/template/mcp_warn_front.html b/phpBB/styles/subSilver/template/mcp_warn_front.html index 432580325b..087e9124ff 100755 --- a/phpBB/styles/subSilver/template/mcp_warn_front.html +++ b/phpBB/styles/subSilver/template/mcp_warn_front.html @@ -21,7 +21,7 @@ - + @@ -38,7 +38,7 @@ - +
{L_MOST_WARNINGS}{L_MOST_WARNINGS}
 {L_USERNAME} 
{L_WARNINGS_ZERO_TOTAL}{L_WARNINGS_ZERO_TOTAL}
@@ -47,7 +47,7 @@ - + @@ -64,7 +64,7 @@ - +
{L_LATEST_WARNINGS}{L_LATEST_WARNINGS}
 {L_USERNAME} 
{L_WARNINGS_ZERO_TOTAL}{L_WARNINGS_ZERO_TOTAL}
diff --git a/phpBB/styles/subSilver/template/mcp_warn_list.html b/phpBB/styles/subSilver/template/mcp_warn_list.html index 5beb502b76..fcf2ca5412 100755 --- a/phpBB/styles/subSilver/template/mcp_warn_list.html +++ b/phpBB/styles/subSilver/template/mcp_warn_list.html @@ -4,7 +4,7 @@ - + @@ -21,7 +21,7 @@ - + diff --git a/phpBB/styles/subSilver/template/ucp_prefs_personal.html b/phpBB/styles/subSilver/template/ucp_prefs_personal.html index ccab661587..ffff4a4280 100644 --- a/phpBB/styles/subSilver/template/ucp_prefs_personal.html +++ b/phpBB/styles/subSilver/template/ucp_prefs_personal.html @@ -48,7 +48,7 @@ - + From c32156a616b46ef3478c4cb2d37f5721fdbedcd6 Mon Sep 17 00:00:00 2001 From: David M Date: Tue, 19 Dec 2006 02:37:36 +0000 Subject: [PATCH 099/264] don't mind me... git-svn-id: file:///svn/phpbb/trunk@6782 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_user.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 6a9fc0922d..6cd35bfd7f 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -245,7 +245,7 @@ function user_add($user_row, $cp_data = false) $db->sql_query($sql); // Now make it the users default group... - group_set_user_default($user_row['group_id'], array($user_id), false, $user_row['user_type'] == USER_NORMAL); + group_set_user_default($user_row['group_id'], array($user_id), false); // set the newest user and adjust the user count if the user is a normal user and no activation mail is sent if ($user_row['user_type'] == USER_NORMAL) @@ -253,6 +253,15 @@ function user_add($user_row, $cp_data = false) set_config('newest_user_id', $user_id, true); set_config('newest_username', $user_row['username'], true); set_config('num_users', $config['num_users'] + 1, true); + + $sql = 'SELECT group_colour + FROM ' . GROUPS_TABLE . ' + WHERE group_id = ' . $user_row['group_id']; + $result = $db->sql_query_limit($sql, 1); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + set_config('newest_user_colour', $row['group_colour'], true); } return $user_id; @@ -2044,7 +2053,7 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna /** * Set users default group */ -function group_set_user_default($group_id, $user_id_ary, $group_attributes = false, $new_user = false) +function group_set_user_default($group_id, $user_id_ary, $group_attributes = false) { global $db; @@ -2130,7 +2139,7 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal global $config; - if ($new_user || in_array($config['newest_user_id'], $user_id_ary)) + if (in_array($config['newest_user_id'], $user_id_ary)) { set_config('newest_user_colour', $sql_ary['user_colour'], true); } From 3503830c47600fdb7ce5df806030cdc7d1dd3f53 Mon Sep 17 00:00:00 2001 From: David M Date: Tue, 19 Dec 2006 23:48:32 +0000 Subject: [PATCH 100/264] #6436, thanks ToonArmy for the patch :D git-svn-id: file:///svn/phpbb/trunk@6783 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 4511c57408..04113fae06 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -524,8 +524,8 @@ if (!function_exists('realpath')) // Break the string into little bits for us to nibble on $bits = explode('/', $path); - // Remove any . in the path - $bits = array_diff($bits, array('.')); + // Remove any . in the path, renumber array for the loop below + $bits = array_keys(array_diff($bits, array('.'))); // Lets get looping, run over and resolve any .. (up directory) for ($i = 0, $max = sizeof($bits); $i < $max; $i++) From 9e5819ac4c2afacd5a66e7e9e2dc71f0f182c0b1 Mon Sep 17 00:00:00 2001 From: David M Date: Wed, 20 Dec 2006 22:36:06 +0000 Subject: [PATCH 101/264] #6368, thanks to ToonArmy git-svn-id: file:///svn/phpbb/trunk@6784 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/mcp/mcp_topic.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 2b761bfcae..bc0d18afbd 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -463,14 +463,18 @@ function merge_posts($topic_id, $to_topic_id) $success_msg = 'POSTS_MERGED_SUCCESS'; // Does the original topic still exist? If yes, link back to it - $topic_data = get_topic_data(array($topic_id)); + $sql = 'SELECT forum_id + FROM ' . TOPICS_TABLE . ' + WHERE topic_id = ' . $topic_id; + $result = $db->sql_query_limit($sql, 1); - if (sizeof($topic_data)) + if ($row = $db->sql_fetchrow($result)) { - $topic_data = $topic_data[$topic_id]; - $return_link .= sprintf($user->lang['RETURN_TOPIC'], '', ''); + $return_link .= sprintf($user->lang['RETURN_TOPIC'], '', ''); } + $db->sql_freeresult($result); + // Link to the new topic $return_link .= (($return_link) ? '

' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '', ''); } From d9f3aed7042a85d9553dc509182422326e23ec49 Mon Sep 17 00:00:00 2001 From: David M Date: Thu, 21 Dec 2006 02:07:52 +0000 Subject: [PATCH 102/264] #6460, thanks to ToonArmy for the patch :D - removed pregenerated template variables from the installer git-svn-id: file:///svn/phpbb/trunk@6785 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/install_install.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index b3a7bfa89a..dd20987c04 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -133,7 +133,6 @@ class install_install extends module // Test for basic PHP settings $template->assign_block_vars('checks', array( 'S_LEGEND' => true, - 'S_FIRST_ROW' => true, 'LEGEND' => $lang['PHP_SETTINGS'], 'LEGEND_EXPLAIN' => $lang['PHP_SETTINGS_EXPLAIN'], )); @@ -219,7 +218,6 @@ class install_install extends module // Test for available database modules $template->assign_block_vars('checks', array( 'S_LEGEND' => true, - 'S_FIRST_ROW' => false, 'LEGEND' => $lang['MBSTRING_CHECK'], 'LEGEND_EXPLAIN' => $lang['MBSTRING_CHECK_EXPLAIN'], )); @@ -274,7 +272,6 @@ class install_install extends module // Test for available database modules $template->assign_block_vars('checks', array( 'S_LEGEND' => true, - 'S_FIRST_ROW' => false, 'LEGEND' => $lang['PHP_SUPPORTED_DB'], 'LEGEND_EXPLAIN' => $lang['PHP_SUPPORTED_DB_EXPLAIN'], )); @@ -313,7 +310,6 @@ class install_install extends module // Test for other modules $template->assign_block_vars('checks', array( 'S_LEGEND' => true, - 'S_FIRST_ROW' => false, 'LEGEND' => $lang['PHP_OPTIONAL_MODULE'], 'LEGEND_EXPLAIN' => $lang['PHP_OPTIONAL_MODULE_EXPLAIN'], )); @@ -386,7 +382,6 @@ class install_install extends module // Check permissions on files/directories we need access to $template->assign_block_vars('checks', array( 'S_LEGEND' => true, - 'S_FIRST_ROW' => false, 'LEGEND' => $lang['FILES_REQUIRED'], 'LEGEND_EXPLAIN' => $lang['FILES_REQUIRED_EXPLAIN'], )); @@ -443,7 +438,6 @@ class install_install extends module // Check permissions on files/directories it would be useful access to $template->assign_block_vars('checks', array( 'S_LEGEND' => true, - 'S_FIRST_ROW' => false, 'LEGEND' => $lang['FILES_OPTIONAL'], 'LEGEND_EXPLAIN' => $lang['FILES_OPTIONAL_EXPLAIN'], )); @@ -526,7 +520,6 @@ class install_install extends module $template->assign_block_vars('checks', array( 'S_LEGEND' => true, - 'S_FIRST_ROW' => true, 'LEGEND' => $lang['DB_CONNECTION'], 'LEGEND_EXPLAIN' => false, )); @@ -712,7 +705,6 @@ class install_install extends module $template->assign_block_vars('checks', array( 'S_LEGEND' => true, - 'S_FIRST_ROW' => true, 'LEGEND' => $lang['STAGE_ADMINISTRATOR'], 'LEGEND_EXPLAIN' => false, )); @@ -1192,7 +1184,7 @@ class install_install extends module if ($script_path !== '/') { // Adjust destination path (no trailing slash) - if ($script_path[sizeof($script_path) - 1] == '/') + if (substr($script_path, -1) == '/') { $script_path = substr($script_path, 0, -1); } From 2e1eef2713f7891ce9d78736ceae6d2faf93fc4b Mon Sep 17 00:00:00 2001 From: David M Date: Thu, 21 Dec 2006 04:50:38 +0000 Subject: [PATCH 103/264] #6462, not a bug unless you run a version of PHP 5 that is less than 5.0.4... git-svn-id: file:///svn/phpbb/trunk@6786 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 04113fae06..ea05d969a2 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3568,17 +3568,18 @@ class bitfield // Get the ($n / 8)th char $byte = $n >> 3; - if (!isset($this->data[$byte])) + if (strlen($this->data) >= $byte + 1) + { + $c = $this->data[$byte]; + + // Lookup the ($n % 8)th bit of the byte + $bit = 7 - ($n & 7); + return (bool) (ord($c) & (1 << $bit)); + } + else { - // Of course, if it doesn't exist then the result if FALSE return false; } - - $c = $this->data[$byte]; - - // Lookup the ($n % 8)th bit of the byte - $bit = 7 - ($n & 7); - return (bool) (ord($c) & (1 << $bit)); } function set($n) @@ -3586,16 +3587,13 @@ class bitfield $byte = $n >> 3; $bit = 7 - ($n & 7); - if (isset($this->data[$byte])) + if (strlen($this->data) >= $byte + 1) { $this->data[$byte] = $this->data[$byte] | chr(1 << $bit); } else { - if ($byte - strlen($this->data) > 0) - { - $this->data .= str_repeat("\0", $byte - strlen($this->data)); - } + $this->data .= str_repeat("\0", $byte - strlen($this->data)); $this->data .= chr(1 << $bit); } } @@ -3604,13 +3602,11 @@ class bitfield { $byte = $n >> 3; - if (!isset($this->data[$byte])) + if (strlen($this->data) >= $byte + 1) { - return; + $bit = 7 - ($n & 7); + $this->data[$byte] = $this->data[$byte] &~ chr(1 << $bit); } - - $bit = 7 - ($n & 7); - $this->data[$byte] = $this->data[$byte] &~ chr(1 << $bit); } function get_blob() From 515085a2a2d4b06989566a60b8add3fa4864f1e3 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 21 Dec 2006 10:37:50 +0000 Subject: [PATCH 104/264] - some fixes - important bugfix for the mcp and determining allowed ids in general (if global announcements are included) git-svn-id: file:///svn/phpbb/trunk@6787 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_users.php | 1 + phpBB/includes/functions_module.php | 8 +- phpBB/includes/functions_posting.php | 2 +- phpBB/includes/functions_upload.php | 75 ++++++++-------- phpBB/includes/functions_user.php | 3 +- phpBB/includes/mcp/mcp_ban.php | 37 +++++++- phpBB/includes/mcp/mcp_notes.php | 2 + phpBB/includes/mcp/mcp_warn.php | 94 +++++++++++--------- phpBB/language/en/acp/common.php | 6 +- phpBB/mcp.php | 17 +++- phpBB/styles/subSilver/template/mcp_ban.html | 2 +- 11 files changed, 155 insertions(+), 92 deletions(-) diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 28125df3ed..ae64fd37ed 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -941,6 +941,7 @@ class acp_users if ($submit && $message) { add_log('admin', 'LOG_USER_FEEDBACK', $user_row['username']); + add_log('mod', 0, 0, 'LOG_USER_FEEDBACK', $user_row['username']); add_log('user', $user_id, 'LOG_USER_GENERAL', $message); trigger_error($user->lang['USER_FEEDBACK_ADDED'] . adm_back_link($this->u_action . '&u=' . $user_id)); diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index 753e043c16..22312b8d76 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -166,7 +166,7 @@ class p_master $depth = sizeof($this->module_cache['parents'][$row['module_id']]); // We need to prefix the functions to not create a naming conflict - + // Function for building 'url_extra' $url_func = '_module_' . $row['module_basename'] . '_url'; @@ -191,7 +191,7 @@ class p_master 'mode' => (string) $row['module_mode'], 'display' => (int) $row['module_display'], - 'url_extra' => (function_exists($url_func)) ? $url_func($row['module_mode']) : '', + 'url_extra' => (function_exists($url_func)) ? $url_func($row['module_mode'], $row) : '', 'lang' => ($row['module_basename'] && function_exists($lang_func)) ? $lang_func($row['module_mode'], $row['module_langname']) : ((!empty($user->lang[$row['module_langname']])) ? $user->lang[$row['module_langname']] : $row['module_langname']), 'langname' => $row['module_langname'], @@ -578,7 +578,9 @@ class p_master } $u_title = $module_url . $delim . 'i=' . (($item_ary['cat']) ? $item_ary['id'] : $item_ary['name'] . (($item_ary['is_duplicate']) ? '&icat=' . $current_id : '') . '&mode=' . $item_ary['mode']); - $u_title .= (!$item_ary['cat'] && isset($item_ary['url_extra'])) ? $item_ary['url_extra'] : ''; + + // Was not allowed in categories before - /*!$item_ary['cat'] && */ + $u_title .= (isset($item_ary['url_extra'])) ? $item_ary['url_extra'] : ''; // Only output a categories items if it's currently selected if (!$depth || ($depth && (in_array($item_ary['parent'], array_values($this->module_cache['parents'])) || $item_ary['parent'] == $this->p_parent))) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 51bcf2e583..5805e654c6 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -96,7 +96,7 @@ function generate_smilies($mode, $forum_id) } /** -* Update Post Information (First/Last Post in topic/forum) +* Update last post information * Should be used instead of sync() if only the last post information are out of sync... faster * * @param string $type Can be forum|topic diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index ff32e4447d..e1cffaf710 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -214,10 +214,11 @@ class filespec * The phpbb_root_path variable will be applied to the destination path * * @param string $destination_path Destination path, for example $config['avatar_path'] + * @param bool $overwrite If set to true, an already existing file will be overwritten * @param octal $chmod Permission mask for chmodding the file after a successful move * @access public */ - function move_file($destination, $chmod = 0666) + function move_file($destination, $overwrite = false, $chmod = 0666) { global $user, $phpbb_root_path; @@ -241,62 +242,64 @@ class filespec $this->destination_file = $this->destination_path . '/' . basename($this->realname); // Check if the file already exist, else there is something wrong... - if (file_exists($this->destination_file)) + if (file_exists($this->destination_file) && !$overwrite) { @unlink($this->filename); - return false; } - - switch ($upload_mode) + else { - case 'copy': + if (file_exists($this->destination_file)) + { + @unlink($this->destination_file); + } + + switch ($upload_mode) + { + case 'copy': + + if (!@copy($this->filename, $this->destination_file)) + { + if (!@move_uploaded_file($this->filename, $this->destination_file)) + { + $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file); + return false; + } + } + + @unlink($this->filename); + + break; + + case 'move': - if (!@copy($this->filename, $this->destination_file)) - { if (!@move_uploaded_file($this->filename, $this->destination_file)) { - $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file); - return false; + if (!@copy($this->filename, $this->destination_file)) + { + $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file); + return false; + } } - } - else - { + @unlink($this->filename); - } - break; + break; - case 'move': + case 'local': - if (!@move_uploaded_file($this->filename, $this->destination_file)) - { if (!@copy($this->filename, $this->destination_file)) { $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file); return false; } - else - { - @unlink($this->filename); - } - } + @unlink($this->filename); - break; + break; + } - case 'local': - - if (!@copy($this->filename, $this->destination_file)) - { - $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'GENERAL_UPLOAD_ERROR'], $this->destination_file); - return false; - } - @unlink($this->filename); - - break; + @chmod($this->destination_file, $chmod); } - @chmod($this->destination_file, $chmod); - // Try to get real filesize from destination folder $this->filesize = (@filesize($this->destination_file)) ? @filesize($this->destination_file) : $this->filesize; diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 6cd35bfd7f..55725b2cfd 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1409,7 +1409,8 @@ function avatar_upload($data, &$error) $destination = ''; } - $file->move_file($destination); + // Move file and overwrite any existing image + $file->move_file($destination, true); if (sizeof($file->error)) { diff --git a/phpBB/includes/mcp/mcp_ban.php b/phpBB/includes/mcp/mcp_ban.php index 510943aa45..5a7240143a 100644 --- a/phpBB/includes/mcp/mcp_ban.php +++ b/phpBB/includes/mcp/mcp_ban.php @@ -104,8 +104,41 @@ class mcp_ban 'U_ACTION' => $this->u_action, 'U_FIND_USER' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp_ban&field=ban'), - ) - ); + )); + + if ($mode != 'user') + { + return; + } + + // As a "service" we will check if any post id is specified and populate the username of the poster id if given + $post_id = request_var('p', 0); + $user_id = request_var('u', 0); + $username = false; + + if ($user_id && $user_id <> ANONYMOUS) + { + $sql = 'SELECT username + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . $user_id; + $result = $db->sql_query($sql); + $username = (string) $db->sql_fetchfield('username'); + $db->sql_freeresult($result); + } + else if ($post_id) + { + $post_info = get_post_data($post_id, 'm_ban'); + + if (sizeof($post_info) && !empty($post_info[$post_id])) + { + $username = $post_info[$post_id]['username']; + } + } + + if ($username) + { + $template->assign_var('USERNAMES', $username); + } } } diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php index 96fe1f9bd0..415290d3c5 100755 --- a/phpBB/includes/mcp/mcp_notes.php +++ b/phpBB/includes/mcp/mcp_notes.php @@ -131,6 +131,8 @@ class mcp_notes if ($usernote && $action == 'add_feedback') { add_log('admin', 'LOG_USER_FEEDBACK', $userrow['username']); + add_log('mod', 0, 0, 'LOG_USER_FEEDBACK', $userrow['username']); + add_log('user', $user_id, 'LOG_USER_GENERAL', $usernote); $redirect = $this->u_action . '&u=' . $user_id; diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index cce30833ff..cc670ed417 100755 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -207,22 +207,22 @@ function mcp_warn_post_view($id, $mode, $action) WHERE post_id = $post_id AND u.user_id = p.poster_id"; $result = $db->sql_query($sql); - $userrow = $db->sql_fetchrow($result); + $user_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - if (!$userrow) + if (!$user_row) { trigger_error($user->lang['NO_POST']); } // There is no point issuing a warning to ignored users (ie anonymous and bots) - if ($userrow['user_type'] == USER_IGNORE) + if ($user_row['user_type'] == USER_IGNORE) { trigger_error($user->lang['CANNOT_WARN_ANONYMOUS']); } // Prevent someone from warning themselves - if ($userrow['user_id'] == $user->data['user_id']) + if ($user_row['user_id'] == $user->data['user_id']) { trigger_error($user->lang['CANNOT_WARN_SELF']); } @@ -241,11 +241,11 @@ function mcp_warn_post_view($id, $mode, $action) trigger_error($user->lang['ALREADY_WARNED']); } - $user_id = $userrow['user_id']; + $user_id = $user_row['user_id']; if ($warning && $action == 'add_warning') { - add_warning($userrow, $warning, $notify, $post_id); + add_warning($user_row, $warning, $notify, $post_id); $redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=notes&mode=user_notes&u=$user_id"); meta_refresh(2, $redirect); @@ -256,16 +256,16 @@ function mcp_warn_post_view($id, $mode, $action) // We want to make the message available here as a reminder // Parse the message and subject - $message = $userrow['post_text']; + $message = $user_row['post_text']; $message = str_replace("\n", '
', censor_text($message)); // Second parse bbcode here - if ($userrow['bbcode_bitfield']) + if ($user_row['bbcode_bitfield']) { include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx); - $bbcode = new bbcode($userrow['bbcode_bitfield']); - $bbcode->bbcode_second_pass($message, $userrow['bbcode_uid'], $userrow['bbcode_bitfield']); + $bbcode = new bbcode($user_row['bbcode_bitfield']); + $bbcode->bbcode_second_pass($message, $user_row['bbcode_uid'], $user_row['bbcode_bitfield']); } // Always process smilies after parsing bbcodes @@ -273,13 +273,13 @@ function mcp_warn_post_view($id, $mode, $action) // Generate the appropriate user information for the user we are looking at $rank_title = $rank_img = ''; -// get_user_rank($userrow['user_rank'], $userrow['user_posts'], $rank_title, $rank_img); +// get_user_rank($user_row['user_rank'], $user_row['user_posts'], $rank_title, $rank_img); $avatar_img = ''; - if (!empty($userrow['user_avatar'])) + if (!empty($user_row['user_avatar'])) { - switch ($userrow['user_avatar_type']) + switch ($user_row['user_avatar_type']) { case AVATAR_UPLOAD: $avatar_img = $config['avatar_path'] . '/'; @@ -290,19 +290,19 @@ function mcp_warn_post_view($id, $mode, $action) break; } - $avatar_img .= $userrow['user_avatar']; - $avatar_img = ''; + $avatar_img .= $user_row['user_avatar']; + $avatar_img = ''; } $template->assign_vars(array( 'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&mode=$mode&p=$post_id"), 'POST' => $message, - 'USERNAME' => $userrow['username'], - 'USER_COLOR' => (!empty($userrow['user_colour'])) ? $userrow['user_colour'] : '', + 'USERNAME' => $user_row['username'], + 'USER_COLOR' => (!empty($user_row['user_colour'])) ? $user_row['user_colour'] : '', 'RANK_TITLE' => $rank_title, - 'JOINED' => $user->format_date($userrow['user_regdate']), - 'POSTS' => ($userrow['user_posts']) ? $userrow['user_posts'] : 0, + 'JOINED' => $user->format_date($user_row['user_regdate']), + 'POSTS' => ($user_row['user_posts']) ? $user_row['user_posts'] : 0, 'AVATAR_IMG' => $avatar_img, 'RANK_IMG' => $rank_img, @@ -331,25 +331,25 @@ function mcp_warn_user_view($id, $mode, $action) FROM ' . USERS_TABLE . ' WHERE ' . $sql_where; $result = $db->sql_query($sql); - $userrow = $db->sql_fetchrow($result); + $user_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - if (!$userrow) + if (!$user_row) { trigger_error('NO_USER'); } // Prevent someone from warning themselves - if ($userrow['user_id'] == $user->data['user_id']) + if ($user_row['user_id'] == $user->data['user_id']) { trigger_error($user->lang['CANNOT_WARN_SELF']); } - $user_id = $userrow['user_id']; + $user_id = $user_row['user_id']; if ($warning && $action == 'add_warning') { - add_warning($userrow, $warning, $notify); + add_warning($user_row, $warning, $notify); $redirect = append_sid("{$phpbb_root_path}mcp.$phpEx", "i=notes&mode=user_notes&u=$user_id"); meta_refresh(2, $redirect); @@ -358,13 +358,13 @@ function mcp_warn_user_view($id, $mode, $action) // Generate the appropriate user information for the user we are looking at $rank_title = $rank_img = ''; -// get_user_rank($userrow['user_rank'], $userrow['user_posts'], $rank_title, $rank_img); +// get_user_rank($user_row['user_rank'], $user_row['user_posts'], $rank_title, $rank_img); $avatar_img = ''; - if (!empty($userrow['user_avatar'])) + if (!empty($user_row['user_avatar'])) { - switch ($userrow['user_avatar_type']) + switch ($user_row['user_avatar_type']) { case AVATAR_UPLOAD: $avatar_img = $config['avatar_path'] . '/'; @@ -375,20 +375,20 @@ function mcp_warn_user_view($id, $mode, $action) break; } - $avatar_img .= $userrow['user_avatar']; - $avatar_img = ''; + $avatar_img .= $user_row['user_avatar']; + $avatar_img = ''; } // OK, they didn't submit a warning so lets build the page for them to do so $template->assign_vars(array( 'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&mode=$mode&u=$user_id"), - 'USERNAME' => $userrow['username'], - 'USER_COLOR' => (!empty($userrow['user_colour'])) ? $userrow['user_colour'] : '', + 'USERNAME' => $user_row['username'], + 'USER_COLOR' => (!empty($user_row['user_colour'])) ? $user_row['user_colour'] : '', 'RANK_TITLE' => $rank_title, - 'JOINED' => $user->format_date($userrow['user_regdate']), - 'POSTS' => ($userrow['user_posts']) ? $userrow['user_posts'] : 0, - 'WARNINGS' => ($userrow['user_warnings']) ? $userrow['user_warnings'] : 0, + 'JOINED' => $user->format_date($user_row['user_regdate']), + 'POSTS' => ($user_row['user_posts']) ? $user_row['user_posts'] : 0, + 'WARNINGS' => ($user_row['user_warnings']) ? $user_row['user_warnings'] : 0, 'AVATAR_IMG' => $avatar_img, 'RANK_IMG' => $rank_img, @@ -399,7 +399,7 @@ function mcp_warn_user_view($id, $mode, $action) /** * Insert the warning into the database */ -function add_warning($userrow, $warning, $send_pm = true, $post_id = 0) +function add_warning($user_row, $warning, $send_pm = true, $post_id = 0) { global $phpEx, $phpbb_root_path, $config; global $template, $db, $user, $auth; @@ -409,8 +409,8 @@ function add_warning($userrow, $warning, $send_pm = true, $post_id = 0) include_once($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx); - $userrow['user_lang'] = (file_exists($phpbb_root_path . 'language/' . $userrow['user_lang'] . "/mcp.$phpEx")) ? $userrow['user_lang'] : $config['default_lang']; - include($phpbb_root_path . 'language/' . basename($userrow['user_lang']) . "/mcp.$phpEx"); + $user_row['user_lang'] = (file_exists($phpbb_root_path . 'language/' . $user_row['user_lang'] . "/mcp.$phpEx")) ? $user_row['user_lang'] : $config['default_lang']; + include($phpbb_root_path . 'language/' . basename($user_row['user_lang']) . "/mcp.$phpEx"); $message_parser = new parse_message(); @@ -429,17 +429,17 @@ function add_warning($userrow, $warning, $send_pm = true, $post_id = 0) 'bbcode_bitfield' => $message_parser->bbcode_bitfield, 'bbcode_uid' => $message_parser->bbcode_uid, 'message' => $message_parser->message, - 'address_list' => array('u' => array($userrow['user_id'] => 'to')), + 'address_list' => array('u' => array($user_row['user_id'] => 'to')), ); submit_pm('post', $lang['WARNING_PM_SUBJECT'], $pm_data, false, false); } - add_log('admin', 'LOG_USER_WARNING', $userrow['username']); - $log_id = add_log('user', $userrow['user_id'], 'LOG_USER_WARNING_BODY', $warning); + add_log('admin', 'LOG_USER_WARNING', $user_row['username']); + $log_id = add_log('user', $user_row['user_id'], 'LOG_USER_WARNING_BODY', $warning); $sql_ary = array( - 'user_id' => $userrow['user_id'], + 'user_id' => $user_row['user_id'], 'post_id' => $post_id, 'log_id' => $log_id, 'warning_time' => time(), @@ -450,8 +450,18 @@ function add_warning($userrow, $warning, $send_pm = true, $post_id = 0) $sql = 'UPDATE ' . USERS_TABLE . ' SET user_warnings = user_warnings + 1, user_last_warning = ' . time() . ' - WHERE user_id = ' . $userrow['user_id']; + WHERE user_id = ' . $user_row['user_id']; $db->sql_query($sql); + + // We add this to the mod log too for moderators to see that a specific user got warned. + $sql = 'SELECT forum_id, topic_id + FROM ' . POSTS_TABLE . ' + WHERE post_id = ' . $post_id; + $result = $db->sql_query($sql); + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_USER_WARNING', $user_row['username']); } ?> \ No newline at end of file diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index e1c281eb4a..6b380a8ea6 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -449,7 +449,7 @@ $lang = array_merge($lang, array( 'LOG_FORK' => 'Copied topic
» from %s', 'LOG_LOCK' => 'Locked topic
» %s', 'LOG_LOCK_POST' => 'Locked post
» %s', - 'LOG_MERGE' => 'Merged posts into topic
»%s', + 'LOG_MERGE' => 'Merged posts into topic
» %s', 'LOG_MOVE' => 'Moved topic
» from %s', 'LOG_TOPIC_DELETED' => 'Deleted topic
» %s', 'LOG_TOPIC_RESYNC' => 'Resynchronised topic counters
» %s', @@ -622,8 +622,8 @@ $lang = array_merge($lang, array( 'LOG_USER_MOVE_POSTS_USER' => 'Moved all posts to forum "%s"', 'LOG_USER_REACTIVATE_USER' => 'Forced user account re-activation', 'LOG_USER_UNLOCK' => 'User unlocked own topic
» %s', - 'LOG_USER_WARNING' => 'Added user warning
»%s', - 'LOG_USER_WARNING_BODY' => 'The following warning was issued to this user
»%s', + 'LOG_USER_WARNING' => 'Added user warning
» %s', + 'LOG_USER_WARNING_BODY' => 'The following warning was issued to this user
» %s', 'LOG_USER_GROUP_CHANGE' => 'User changed default group
» %s', 'LOG_USER_GROUP_DEMOTE' => 'User demoted as leaders from usergroup
» %s', diff --git a/phpBB/mcp.php b/phpBB/mcp.php index 7886091081..6ec68d6c82 100644 --- a/phpBB/mcp.php +++ b/phpBB/mcp.php @@ -227,24 +227,35 @@ $module->display($module->get_page_title(), false); /** * Functions used to generate additional URL paramters */ -function _module_main_url($mode) +function _module__url($mode, &$module_row) { return extra_url(); } -function _module_logs_url($mode) +function _module_main_url($mode, &$module_row) +{ + return extra_url(); +} + +function _module_logs_url($mode, &$module_row) +{ + return extra_url(); +} + +function _module_ban_url($mode, &$module_row) { return extra_url(); } function extra_url() { - global $forum_id, $topic_id, $post_id; + global $forum_id, $topic_id, $post_id, $user_id; $url_extra = ''; $url_extra .= ($forum_id) ? "&f=$forum_id" : ''; $url_extra .= ($topic_id) ? "&t=$topic_id" : ''; $url_extra .= ($post_id) ? "&p=$post_id" : ''; + $url_extra .= ($user_id) ? "&u=$user_id" : ''; return $url_extra; } diff --git a/phpBB/styles/subSilver/template/mcp_ban.html b/phpBB/styles/subSilver/template/mcp_ban.html index fff3d350d1..1834e729ba 100644 --- a/phpBB/styles/subSilver/template/mcp_ban.html +++ b/phpBB/styles/subSilver/template/mcp_ban.html @@ -43,7 +43,7 @@
From 7dbef7096d037222ca66da33b287c4fc451d9d2c Mon Sep 17 00:00:00 2001 From: Jonathan Stanley Date: Thu, 21 Dec 2006 16:36:39 +0000 Subject: [PATCH 105/264] Bertie does the Office 2007 dance! git-svn-id: file:///svn/phpbb/trunk@6788 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/schemas/schema_data.sql | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 9bc38ab00e..88d4a08d14 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -668,12 +668,21 @@ INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'js'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (3, 'xml'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'xls'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'xlsx'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'xlsm'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'xlsb'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'doc'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'docx'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'docm'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'dot'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'dotx'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'dotm'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'pdf'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'ai'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'ps'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'ppt'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'pptx'); +INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'pptm'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'odg'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'odp'); INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'ods'); From e66429cba1f79a69890deb6ca9c35841dee6872f Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 22 Dec 2006 16:34:00 +0000 Subject: [PATCH 106/264] only tiny change git-svn-id: file:///svn/phpbb/trunk@6789 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/install.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 6ef3e3c450..9ea4cd4057 100755 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -76,7 +76,6 @@ $lang = array_merge($lang, array( 'CONV_ERROR_ATTACH_FTP_DIR' => 'FTP Upload for Attachments is enabled at the old board. Please copy all Attachment files to a directory accessible, disable ftp uploading and make sure a valid upload dir is specified. If you have done this, restart the convertor.', 'CONV_ERROR_CONFIG_EMPTY' => 'There is no configuration information available for the conversion.', 'CONV_ERROR_FORUM_ACCESS' => 'Unable to get forum access information.', - 'CONV_ERROR_FORUM_MAPPING' => 'The forum mapping information is missing.', 'CONV_ERROR_GET_CATEGORIES' => 'Unable to get categories.', 'CONV_ERROR_GET_CONFIG' => 'Could not retrieve your forum configuration.', 'CONV_ERROR_COULD_NOT_READ' => 'Unable to access/read "%s".', @@ -153,7 +152,7 @@ $lang = array_merge($lang, array( 'FILLING_TABLES' => 'Filling Tables', 'FINAL_STEP' => 'Process Final Step', 'FORUM_ADDRESS' => 'Forum address', - 'FORUM_ADDRESS_EXPLAIN' => 'This is the http address of your former forum', + 'FORUM_ADDRESS_EXPLAIN' => 'This is the http address of your former forum, for example http://www.example.com/phpBB2/. If an address is entered here and not left empty every instance of this address will be replaced by your new forum address within messages, private messages and signatures.', 'FORUM_PATH' => 'Forum path', 'FORUM_PATH_EXPLAIN' => 'This is the relative path on disk to your former forum from the root of your phpBB install', 'FOUND' => 'Found', From 803f64c7248d87e9e9508349c699b0f442556d55 Mon Sep 17 00:00:00 2001 From: Jonathan Stanley Date: Fri, 22 Dec 2006 22:51:33 +0000 Subject: [PATCH 107/264] Bertiezilla make Bertie-smash on language files! #6244 #6278 #6284 #6286 #6336 #6340 #6342 #6344 #6346 #6352 #6358 #6364 #6376 #6382 #6386 #6388 #6418 #6420 #6426 #6428 #6430 #6434 #6452 #6454 #6458 git-svn-id: file:///svn/phpbb/trunk@6790 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/acp/attachments.php | 22 ++-- phpBB/language/en/acp/ban.php | 4 +- phpBB/language/en/acp/board.php | 118 +++++++++--------- phpBB/language/en/acp/common.php | 24 ++-- phpBB/language/en/acp/email.php | 2 +- phpBB/language/en/acp/forums.php | 6 +- phpBB/language/en/acp/language.php | 10 +- phpBB/language/en/acp/permissions.php | 2 +- phpBB/language/en/acp/posting.php | 4 +- phpBB/language/en/acp/profile.php | 6 +- phpBB/language/en/acp/styles.php | 18 +-- phpBB/language/en/acp/users.php | 6 +- phpBB/language/en/common.php | 48 +++---- .../en/email/user_remind_inactive.txt | 2 +- phpBB/language/en/groups.php | 2 +- phpBB/language/en/help_bbcode.php | 2 +- phpBB/language/en/help_faq.php | 2 +- phpBB/language/en/install.php | 96 +++++++------- phpBB/language/en/mcp.php | 42 +++---- phpBB/language/en/posting.php | 10 +- phpBB/language/en/search.php | 4 +- phpBB/language/en/ucp.php | 28 ++--- phpBB/language/en/viewtopic.php | 16 +-- 23 files changed, 237 insertions(+), 237 deletions(-) diff --git a/phpBB/language/en/acp/attachments.php b/phpBB/language/en/acp/attachments.php index 77b1edcb67..c906834f5d 100644 --- a/phpBB/language/en/acp/attachments.php +++ b/phpBB/language/en/acp/attachments.php @@ -50,20 +50,20 @@ $lang = array_merge($lang, array( 'ATTACH_EXTENSIONS_URL' => 'Extensions', 'ATTACH_EXT_GROUPS_URL' => 'Extension groups', 'ATTACH_MAX_FILESIZE' => 'Maximum filesize', - 'ATTACH_MAX_FILESIZE_EXPLAIN' => 'Maximum size of each file, 0 is unlimited.', + 'ATTACH_MAX_FILESIZE_EXPLAIN' => 'Maximum size of each file, with 0 being unlimited.', 'ATTACH_MAX_PM_FILESIZE' => 'Maximum filesize messaging', - 'ATTACH_MAX_PM_FILESIZE_EXPLAIN' => 'Maximum drive space available per user for private message attachments, 0 is unlimited.', + 'ATTACH_MAX_PM_FILESIZE_EXPLAIN' => 'Maximum drive space available per user for private message attachments, with 0 being unlimited.', 'ATTACH_ORPHAN_URL' => 'Orphan attachments', 'ATTACH_POST_ID' => 'Post ID', 'ATTACH_QUOTA' => 'Total attachment quota', 'ATTACH_QUOTA_EXPLAIN' => 'Maximum drive space available for attachments for the whole board, with 0 being unlimited.', 'ATTACH_TO_POST' => 'Attach file to post', - 'CAT_FLASH_FILES' => 'Flash Files', + 'CAT_FLASH_FILES' => 'Flash files', 'CAT_IMAGES' => 'Images', - 'CAT_QUICKTIME_FILES' => 'Quicktime Media', - 'CAT_RM_FILES' => 'Real Media Streams', - 'CAT_WM_FILES' => 'Window Media Streams', + 'CAT_QUICKTIME_FILES' => 'Quicktime media files', + 'CAT_RM_FILES' => 'RealMedia media files', + 'CAT_WM_FILES' => 'Windows Media media files', 'CREATE_GROUP' => 'Create new group', 'CREATE_THUMBNAIL' => 'Create thumbnail', 'CREATE_THUMBNAIL_EXPLAIN' => 'Create a thumbnail in all possible situations.', @@ -94,7 +94,7 @@ $lang = array_merge($lang, array( 'GROUP_NAME' => 'Group name', 'IMAGE_LINK_SIZE' => 'Image link dimensions', - 'IMAGE_LINK_SIZE_EXPLAIN' => 'Display image attachment as an inline text link if image is larger than this, set to 0px by 0px to disable.', + 'IMAGE_LINK_SIZE_EXPLAIN' => 'Display image attachment as an inline text link if image is larger than this. To disable this behaviour, set the values to 0px by 0px.', 'IMAGICK_PATH' => 'Imagemagick path', 'IMAGICK_PATH_EXPLAIN' => 'Full path to the imagemagick convert application, e.g. /usr/bin/', @@ -102,7 +102,7 @@ $lang = array_merge($lang, array( 'MAX_ATTACHMENTS_PM' => 'Max attachments per message', 'MAX_EXTGROUP_FILESIZE' => 'Maximum filesize', 'MAX_IMAGE_SIZE' => 'Maximum image dimensions', - 'MAX_IMAGE_SIZE_EXPLAIN' => 'Maximum size of image attachments, set to 0px by 0px to disable dimension checking.', + 'MAX_IMAGE_SIZE_EXPLAIN' => 'Maximum size of image attachments. Set both values to 0px by 0px to disable dimension checking.', 'MAX_THUMB_WIDTH' => 'Maximum thumbnail width in pixel', 'MAX_THUMB_WIDTH_EXPLAIN' => 'A generated thumbnail will not exceed the width set here', 'MIN_THUMB_FILESIZE' => 'Minimum thumbnail filesize', @@ -137,14 +137,14 @@ $lang = array_merge($lang, array( 'SECURE_EMPTY_REFERRER' => 'Allow empty referrer', 'SECURE_EMPTY_REFERRER_EXPLAIN' => 'Secure downloads are based on referrers. Do you want to allow downloads for those ommitting the referrer?', 'SETTINGS_CAT_IMAGES' => 'Image category settings', - 'SPECIAL_CATEGORY' => 'Special Category', - 'SPECIAL_CATEGORY_EXPLAIN' => 'Special Categories differ between the way presented within posts.', + 'SPECIAL_CATEGORY' => 'Special category', + 'SPECIAL_CATEGORY_EXPLAIN' => 'Special categories differ between the way presented within posts.', 'SUCCESSFULLY_UPLOADED' => 'Succeessfully uploaded', 'SUCCESS_EXTENSION_GROUP_ADD' => 'Extension group successfully added', 'SUCCESS_EXTENSION_GROUP_EDIT' => 'Extension group successfully updated', 'UPLOADING_FILES' => 'Uploading files', - 'UPLOADING_FILE_TO' => 'Uploading file “%1$s” to Post Number %2$d…', + 'UPLOADING_FILE_TO' => 'Uploading file “%1$s” to post number %2$d…', 'UPLOAD_DENIED_FORUM' => 'You do not have the permission to upload files to forum “%s”', 'UPLOAD_DIR' => 'Upload directory', 'UPLOAD_DIR_EXPLAIN' => 'Storage path for attachments.', diff --git a/phpBB/language/en/acp/ban.php b/phpBB/language/en/acp/ban.php index 278171ccdd..dd21ee8ad0 100644 --- a/phpBB/language/en/acp/ban.php +++ b/phpBB/language/en/acp/ban.php @@ -56,7 +56,7 @@ $lang = array_merge($lang, array( 'IP_BAN_EXPLAIN' => 'To specify several different IPs or hostnames enter each on a new line. To specify a range of IP addresses separate the start and end with a hyphen (-), to specify a wildcard use *', 'IP_HOSTNAME' => 'IP addresses or hostnames', 'IP_NO_BANNED' => 'No banned IP addresses', - 'IP_UNBAN' => 'Un-ban or Un-exclude IPs', + 'IP_UNBAN' => 'Un-ban or un-exclude IPs', 'IP_UNBAN_EXPLAIN' => 'You can unban (or un-exclude) multiple IP addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded IPs have a marked background.', 'PERMANENT' => 'Permanent', @@ -66,7 +66,7 @@ $lang = array_merge($lang, array( 'USER_BAN_EXCLUDE_EXPLAIN' => 'Enable this to exclude the entered users from all current bans.', 'USER_BAN_EXPLAIN' => 'You can ban multiple users in one go by entering each name on a new line. Use the Find a member facility to look up and add one or more users automatically.', 'USER_NO_BANNED' => 'No banned usernames', - 'USER_UNBAN' => 'Un-ban or Un-exclude usernames', + 'USER_UNBAN' => 'Un-ban or un-exclude usernames', 'USER_UNBAN_EXPLAIN' => 'You can unban (or un-exclude) multiple users in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded users have a marked background.', )); diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index c3cecbc543..02dabb9775 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -35,14 +35,14 @@ $lang = array_merge($lang, array( 'ACP_BOARD_SETTINGS_EXPLAIN' => 'Here you can determine the basic operation of your board, from the site name through user registration to private messaging.', 'CUSTOM_DATEFORMAT' => 'Custom…', - 'DEFAULT_DATE_FORMAT' => 'Date Format', + 'DEFAULT_DATE_FORMAT' => 'Date format', 'DEFAULT_DATE_FORMAT_EXPLAIN' => 'The date format is the same as the PHP date function.', 'DEFAULT_LANGUAGE' => 'Default language', 'DEFAULT_STYLE' => 'Default style', 'DISABLE_BOARD' => 'Disable board', 'DISABLE_BOARD_EXPLAIN' => 'This will make the board unavailable to users. You can also enter a short (255 character) message to display if you wish.', 'OVERRIDE_STYLE' => 'Override user style', - 'OVERRIDE_STYLE_EXPLAIN' => 'Replaces users style with the default.', + 'OVERRIDE_STYLE_EXPLAIN' => 'Replaces user’s style with the default.', 'RELATIVE_DAYS' => 'Relative days', 'SITE_DESC' => 'Site description', 'SITE_NAME' => 'Site name', @@ -62,15 +62,15 @@ $lang = array_merge($lang, array( 'ALLOW_BBCODE' => 'Allow BBCode', 'ALLOW_FORUM_NOTIFY' => 'Allow forum watching', 'ALLOW_NAME_CHANGE' => 'Allow username changes', - 'ALLOW_NO_CENSORS' => 'Allow disable of censors', - 'ALLOW_NO_CENSORS_EXPLAIN' => 'User can disable word censoring.', + 'ALLOW_NO_CENSORS' => 'Allow disabling of word censoring', + 'ALLOW_NO_CENSORS_EXPLAIN' => 'Users can choose to disable the automatic word censoring of posts and private messages.', 'ALLOW_PM_ATTACHMENTS' => 'Allow attachments in private messages', 'ALLOW_SIG' => 'Allow signatures', 'ALLOW_SIG_BBCODE' => 'Allow BBCode in user signatures', 'ALLOW_SIG_FLASH' => 'Allow use of [FLASH] BBCode tag in user signatures', 'ALLOW_SIG_IMG' => 'Allow use of [IMG] BBCode tag in user signatures', 'ALLOW_SIG_LINKS' => 'Allow use of links in user signatures', - 'ALLOW_SIG_LINKS_EXPLAIN' => 'If disallowed the [URL] bbcode tag and automatic/magic URLs are disabled.', + 'ALLOW_SIG_LINKS_EXPLAIN' => 'If disallowed the [URL] BBCode tag and automatic/magic URLs are disabled.', 'ALLOW_SIG_SMILIES' => 'Allow use of smilies in user signatures', 'ALLOW_SMILIES' => 'Allow smilies', 'ALLOW_TOPIC_NOTIFY' => 'Allow topic watching', @@ -87,9 +87,9 @@ $lang = array_merge($lang, array( 'ALLOW_REMOTE_EXPLAIN' => 'Avatars linked to from another website', 'ALLOW_UPLOAD' => 'Enable avatar uploading', 'AVATAR_GALLERY_PATH' => 'Avatar gallery path', - 'AVATAR_GALLERY_PATH_EXPLAIN' => 'Path under your phpBB root dir for pre-loaded images, e.g. images/avatars/gallery', + 'AVATAR_GALLERY_PATH_EXPLAIN' => 'Path under your phpBB root directory for pre-loaded images, e.g. images/avatars/gallery', 'AVATAR_STORAGE_PATH' => 'Avatar storage path', - 'AVATAR_STORAGE_PATH_EXPLAIN' => 'Path under your phpBB root dir, e.g. images/avatars/upload', + 'AVATAR_STORAGE_PATH_EXPLAIN' => 'Path under your phpBB root directory, e.g. images/avatars/upload', 'MAX_AVATAR_SIZE' => 'Maximum avatar dimensions', 'MAX_AVATAR_SIZE_EXPLAIN' => '(Height x Width in pixels)', 'MAX_FILESIZE' => 'Maximum avatar file size', @@ -111,51 +111,51 @@ $lang = array_merge($lang, array( 'ALLOW_QUOTE_PM' => 'Allow quotes in private messages', 'ALLOW_SIG_PM' => 'Allow signature in private messages', 'ALLOW_SMILIES_PM' => 'Allow smilies in private messages', - 'BOXES_LIMIT' => 'Max private messages per box', - 'BOXES_LIMIT_EXPLAIN' => 'Users may receive no more than this many messages in each of their private message boxes or zero for unlimited messages.', - 'BOXES_MAX' => 'Max private message folders', + 'BOXES_LIMIT' => 'Maximum private messages per box', + 'BOXES_LIMIT_EXPLAIN' => 'Users may receive no more than this many messages in each of their private message boxes. Set this value to 0 to allow unlimited messages.', + 'BOXES_MAX' => 'Maximum private message folders', 'BOXES_MAX_EXPLAIN' => 'By default users may create this many personal folders for private messages.', 'ENABLE_PM_ICONS' => 'Enable use of topic icons in private messages', 'FULL_FOLDER_ACTION' => 'Full folder default action', 'FULL_FOLDER_ACTION_EXPLAIN'=> 'Default action to take if a user’s folder is full assuming the user’s folder action, if set at all, is not applicable. The only exception is for the “Sent messages” folder where the default action is always to delete old messages.', 'HOLD_NEW_MESSAGES' => 'Hold new messages', 'PM_EDIT_TIME' => 'Limit editing time', - 'PM_EDIT_TIME_EXPLAIN' => 'Limits the time available to edit a private message not already delivered, zero equals infinity', + 'PM_EDIT_TIME_EXPLAIN' => 'Limits the time available to edit a private message not already delivered. Setting the value to 0 disables this behaviour.', )); // Post Settings $lang = array_merge($lang, array( 'ACP_POST_SETTINGS_EXPLAIN' => 'Here you can set all default settings for posting', 'ALLOW_POST_LINKS' => 'Allow links in posts/private messages', - 'ALLOW_POST_LINKS_EXPLAIN' => 'If disallowed the URL bbcode tag and automatic/magic urls are disabled.', + 'ALLOW_POST_LINKS_EXPLAIN' => 'If disallowed the [URL] BBCode tag and automatic/magic URLs are disabled.', - 'BUMP_INTERVAL' => 'Bump Interval', + 'BUMP_INTERVAL' => 'Bump interval', 'BUMP_INTERVAL_EXPLAIN' => 'Number of minutes, hours or days between the last post to a topic and the ability to bump this topic.', - 'CHAR_LIMIT' => 'Max characters per post', - 'CHAR_LIMIT_EXPLAIN' => 'Set to 0 for unlimited characters.', + 'CHAR_LIMIT' => 'Maximum characters per post', + 'CHAR_LIMIT_EXPLAIN' => 'The number of characters allowed within a post. Set to 0 for unlimited characters.', 'DISPLAY_LAST_EDITED' => 'Display last edited time information', 'DISPLAY_LAST_EDITED_EXPLAIN' => 'Choose if the last edited by information to be displayed on posts', 'EDIT_TIME' => 'Limit editing time', - 'EDIT_TIME_EXPLAIN' => 'Limits the time available to edit a new post, zero equals infinity', - 'FLOOD_INTERVAL' => 'Flood Interval', + 'EDIT_TIME_EXPLAIN' => 'Limits the time available to edit a new post. Setting the value to 0 disables this behaviour.', + 'FLOOD_INTERVAL' => 'Flood interval', 'FLOOD_INTERVAL_EXPLAIN' => 'Number of seconds a user must wait between posting new messages. To enable users to ignore this alter their permissions.', - 'HOT_THRESHOLD' => 'Posts for Popular Threshold, Set to 0 to disable hot topics.', - 'MAX_POLL_OPTIONS' => 'Max number of poll options', - 'MAX_POST_FONT_SIZE' => 'Max font size per post', - 'MAX_POST_FONT_SIZE_EXPLAIN' => 'Set to 0 for unlimited font size.', - 'MAX_POST_IMG_HEIGHT' => 'Max image height per post', + 'HOT_THRESHOLD' => 'Posts per topic threshold required for the hot topic annotation. Set to 0 to disable hot topics.', + 'MAX_POLL_OPTIONS' => 'Maximum number of poll options', + 'MAX_POST_FONT_SIZE' => 'Maximum font size per post', + 'MAX_POST_FONT_SIZE_EXPLAIN' => 'Maximum font size allowed in a post. Set to 0 for unlimited font size.', + 'MAX_POST_IMG_HEIGHT' => 'Maximum image height per post', 'MAX_POST_IMG_HEIGHT_EXPLAIN' => 'Maximum height of an image/flash file in postings. Set to 0 for unlimited size.', - 'MAX_POST_IMG_WIDTH' => 'Max image width per post', + 'MAX_POST_IMG_WIDTH' => 'Maximum image width per post', 'MAX_POST_IMG_WIDTH_EXPLAIN' => 'Maximum width of an image/flash file in postings. Set to 0 for unlimited size.', - 'MAX_POST_URLS' => 'Max links per post', - 'MAX_POST_URLS_EXPLAIN' => 'Set to 0 for unlimited links.', + 'MAX_POST_URLS' => 'Maximum links per post', + 'MAX_POST_URLS_EXPLAIN' => 'Maximum number of URLs in a post. Set to 0 for unlimited links.', 'POSTING' => 'Posting', - 'POSTS_PER_PAGE' => 'Posts Per Page', - 'QUOTE_DEPTH_LIMIT' => 'Max nested quotes per post', - 'QUOTE_DEPTH_LIMIT_EXPLAIN' => 'Set to 0 for unlimited depth.', - 'SMILIES_LIMIT' => 'Max smilies per post', - 'SMILIES_LIMIT_EXPLAIN' => 'Set to 0 for unlimited smilies.', - 'TOPICS_PER_PAGE' => 'Topics Per Page', + 'POSTS_PER_PAGE' => 'Posts per page', + 'QUOTE_DEPTH_LIMIT' => 'Maximum nested quotes per post', + 'QUOTE_DEPTH_LIMIT_EXPLAIN' => 'Maximum number of nested quotes in a post. Set to 0 for unlimited depth.', + 'SMILIES_LIMIT' => 'Maximum smilies per post', + 'SMILIES_LIMIT_EXPLAIN' => 'Maximum number of smilies in a post. Set to 0 for unlimited smilies.', + 'TOPICS_PER_PAGE' => 'Topics per page', )); // Signature Settings @@ -189,7 +189,7 @@ $lang = array_merge($lang, array( // 'ACC_USER_ADMIN' => 'User + Admin', 'ALLOW_EMAIL_REUSE' => 'Allow email address re-use', 'ALLOW_EMAIL_REUSE_EXPLAIN' => 'Different users can register with the same email address.', - 'COPPA' => 'Coppa', + 'COPPA' => 'COPPA', 'COPPA_FAX' => 'COPPA fax number', 'COPPA_MAIL' => 'COPPA mailing address', 'COPPA_MAIL_EXPLAIN' => 'This is the mailing address where parents will send COPPA registration forms', @@ -216,7 +216,7 @@ $lang = array_merge($lang, array( 'ACP_VC_SETTINGS_EXPLAIN' => 'Here you are able to define visual confirmation defaults and captcha settings.', 'CAPTCHA_GD' => 'GD CAPTCHA', - 'CAPTCHA_GD_NOISE' => 'GD CAPTCHA Noise', + 'CAPTCHA_GD_NOISE' => 'GD CAPTCHA noise', 'CAPTCHA_GD_EXPLAIN' => 'Use GD to make a more advanced CAPTCHA', 'CAPTCHA_GD_NOISE_EXPLAIN' => 'Use noise to make the GD based CAPTCHA harder', 'VISUAL_CONFIRM_POST' => 'Enable visual confirmation for guest postings', @@ -235,7 +235,7 @@ $lang = array_merge($lang, array( 'COOKIE_SECURE' => 'Cookie secure', 'COOKIE_SECURE_EXPLAIN' => 'If your server is running via SSL set this to enabled else leave as disabled. Having this enabled and not running via SSL will result in server errors during redirects.', 'ONLINE_LENGTH' => 'View online time span', - 'ONLINE_LENGTH_EXPLAIN' => 'Time in minutes after which inactive users will not appear in viewonline listings, lower equals less processing.', + 'ONLINE_LENGTH_EXPLAIN' => 'Number of minutes after which inactive users will not appear in “Who is online” listings. The higher this value the greater is the processing required to generate the listing.', 'SESSION_LENGTH' => 'Session length', 'SESSION_LENGTH_EXPLAIN' => 'Sessions will expire after this time, in seconds.', )); @@ -246,26 +246,26 @@ $lang = array_merge($lang, array( 'CUSTOM_PROFILE_FIELDS' => 'Custom profile fields', 'LIMIT_LOAD' => 'Limit system load', - 'LIMIT_LOAD_EXPLAIN' => 'If the 1 minute system load exceeds this value the board will go offline, 1.0 equals ~100% utilisation of one processor. This only functions on UNIX based servers.', + 'LIMIT_LOAD_EXPLAIN' => 'If the system’s 1-minute load average exceeds this value the board will automatically go offline. A value of 1.0 equals ~100% utilisation of one processor. This only functions on UNIX based servers.', 'LIMIT_SESSIONS' => 'Limit sessions', 'LIMIT_SESSIONS_EXPLAIN' => 'If the number of sessions exceeds this value within a one minute period the board will go offline. Set to 0 for unlimited sessions.', 'LOAD_CPF_MEMBERLIST' => 'Allow styles to display custom profile fields in memberlist', 'LOAD_CPF_VIEWPROFILE' => 'Display custom profile fields in user profiles', 'LOAD_CPF_VIEWTOPIC' => 'Display custom profile fields on viewtopic', - 'LOAD_USER_ACTIVITY' => 'Show users activity', + 'LOAD_USER_ACTIVITY' => 'Show user’s activity', 'LOAD_USER_ACTIVITY_EXPLAIN' => 'Displays active topic/forum in user profiles and user control panel. It is recommended to disable this on boards with more than one million posts.', 'RECOMPILE_TEMPLATES' => 'Recompile stale templates', 'RECOMPILE_TEMPLATES_EXPLAIN' => 'Check for updated template files on filesystem and recompile.', 'YES_ANON_READ_MARKING' => 'Enable topic marking for guests', 'YES_ANON_READ_MARKING_EXPLAIN' => 'Stores read/unread status information for guests. If disabled posts are always read for guests.', 'YES_BIRTHDAYS' => 'Enable birthday listing', - 'YES_JUMPBOX' => 'Enable display of Jumpbox', - 'YES_MODERATORS' => 'Enable display of Moderators', + 'YES_JUMPBOX' => 'Enable display of jumpbox', + 'YES_MODERATORS' => 'Enable display of moderators', 'YES_ONLINE' => 'Enable online user listings', 'YES_ONLINE_EXPLAIN' => 'Display online user information on index, forum and topic pages.', 'YES_ONLINE_GUESTS' => 'Enable online guest listings in viewonline', 'YES_ONLINE_GUESTS_EXPLAIN' => 'Allow display of guest user information in viewonline.', - 'YES_ONLINE_TRACK' => 'Enable display of user online img', + 'YES_ONLINE_TRACK' => 'Enable display of user online/offline information', 'YES_ONLINE_TRACK_EXPLAIN' => 'Display online information for user in profiles and viewtopic.', 'YES_POST_MARKING' => 'Enable dotted topics', 'YES_POST_MARKING_EXPLAIN' => 'Indicates whether user has posted to a topic.', @@ -302,29 +302,29 @@ $lang = array_merge($lang, array( $lang = array_merge($lang, array( 'ACP_SERVER_SETTINGS_EXPLAIN' => 'Here you define server and domain dependant settings. Please ensure the data you enter is accurate, errors will result in emails containing incorrect information. When entering the domain name remember it does include http:// or other protocol term. Only alter the port number if you know your server uses a different value, port 80 is correct in most cases.', - 'ENABLE_GZIP' => 'Enable GZip Compression', + 'ENABLE_GZIP' => 'Enable GZip compression', 'FORCE_SERVER_VARS' => 'Force server URL settings', 'FORCE_SERVER_VARS_EXPLAIN' => 'If set to yes the server settings defined here will be used in favour of the automatically determined values', 'ICONS_PATH' => 'Post icons storage path', - 'ICONS_PATH_EXPLAIN' => 'Path under your phpBB root dir, e.g. images/icons', + 'ICONS_PATH_EXPLAIN' => 'Path under your phpBB root directory, e.g. images/icons', 'PATH_SETTINGS' => 'Path settings', 'RANKS_PATH' => 'Rank image storage path', - 'RANKS_PATH_EXPLAIN' => 'Path under your phpBB root dir, e.g. images/ranks', + 'RANKS_PATH_EXPLAIN' => 'Path under your phpBB root directory, e.g. images/ranks', 'SCRIPT_PATH' => 'Script path', 'SCRIPT_PATH_EXPLAIN' => 'The path where phpBB is located relative to the domain name, e.g. /phpBB3', 'SEND_ENCODING' => 'Send encoding', - 'SEND_ENCODING_EXPLAIN' => 'Send the file encoding from phpBB via HTTP overriding the webserver configuration', + 'SEND_ENCODING_EXPLAIN' => 'Send the file encoding from phpBB via HTTP overriding the webserver’s configuration', 'SERVER_NAME' => 'Domain name', 'SERVER_NAME_EXPLAIN' => 'The domain name this board runs from (for example: www.foo.bar)', - 'SERVER_PORT' => 'Server Port', + 'SERVER_PORT' => 'Server port', 'SERVER_PORT_EXPLAIN' => 'The port your server is running on, usually 80, only change if different', 'SERVER_PROTOCOL' => 'Server protocol', 'SERVER_PROTOCOL_EXPLAIN' => 'This is used as the server protocol if these settings are forced. If empty or not forced the protocol is determined by the cookie secure settings (http:// or https://)', 'SERVER_URL_SETTINGS' => 'Server URL settings', 'SMILIES_PATH' => 'Smilies storage path', - 'SMILIES_PATH_EXPLAIN' => 'Path under your phpBB root dir, e.g. images/smilies', + 'SMILIES_PATH_EXPLAIN' => 'Path under your phpBB root directory, e.g. images/smilies', 'UPLOAD_ICONS_PATH' => 'Extension group icons storage path', - 'UPLOAD_ICONS_PATH_EXPLAIN' => 'Path under your phpBB root dir, e.g. images/upload_icons', + 'UPLOAD_ICONS_PATH_EXPLAIN' => 'Path under your phpBB root directory, e.g. images/upload_icons', )); // Security Settings @@ -339,15 +339,15 @@ $lang = array_merge($lang, array( 'BROWSER_VALID' => 'Validate browser', 'BROWSER_VALID_EXPLAIN' => 'Enables browser validation for each session improving security.', 'CHECK_DNSBL' => 'Check IP against DNS Blackhole List', - 'CHECK_DNSBL_EXPLAIN' => 'If enabled the IP is checked against the following DNSBL services on registration and posting: spamcop.net, dsbl.org and spamhaus.org. This lookup may take a bit, depending on the servers configuration. If slowdowns are experienced or too much false positives reported it is recommended to disable this check.', + 'CHECK_DNSBL_EXPLAIN' => 'If enabled the user’s IP address is checked against the following DNSBL services on registration and posting: spamcop.net, dsbl.org and spamhaus.org. This lookup may take a while, depending on the server’s configuration. If slowdowns are experienced or too many false positives reported it is recommended to disable this check.', 'CLASS_B' => 'A.B', 'CLASS_C' => 'A.B.C', - 'EMAIL_CHECK_MX' => 'Check email domain for valid MX Record', + 'EMAIL_CHECK_MX' => 'Check email domain for valid MX record', 'EMAIL_CHECK_MX_EXPLAIN' => 'If enabled, the email 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 or zero to disable.', - '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.', + 'FORCE_PASS_CHANGE_EXPLAIN' => 'Require user to change their password after a set number of days. Set 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', 'IP_VALID_EXPLAIN' => 'Determines how much of the users IP is used to validate a session; All compares the complete address, A.B.C the first x.x.x, A.B the first x.x, None disables checking.', 'MAX_LOGIN_ATTEMPTS' => 'Maximum number of login attempts', @@ -388,17 +388,17 @@ $lang = array_merge($lang, array( 'SMTP_CRAM_MD5' => 'CRAM-MD5', 'SMTP_DIGEST_MD5' => 'DIGEST-MD5', 'SMTP_LOGIN' => 'LOGIN', - 'SMTP_PASSWORD' => 'SMTP Password', + 'SMTP_PASSWORD' => 'SMTP password', 'SMTP_PASSWORD_EXPLAIN' => 'Only enter a password if your SMTP server requires it.', 'SMTP_PLAIN' => 'PLAIN', 'SMTP_POP_BEFORE_SMTP' => 'POP-BEFORE-SMTP', - 'SMTP_PORT' => 'SMTP Server Port', + 'SMTP_PORT' => 'SMTP server port', 'SMTP_PORT_EXPLAIN' => 'Only change this if you know your SMTP server is on a different port.', - 'SMTP_SERVER' => 'SMTP Server Address', - 'SMTP_SETTINGS' => 'SMTP Settings', - 'SMTP_USERNAME' => 'SMTP Username', - 'SMTP_USERNAME_EXPLAIN' => 'Only enter a username if your SMTP server requires it.', - 'USE_SMTP' => 'Use SMTP Server for email', + 'SMTP_SERVER' => 'SMTP server address', + 'SMTP_SETTINGS' => 'SMTP settings', + 'SMTP_USERNAME' => 'SMTP username', + 'SMTP_USERNAME_EXPLAIN' => 'Only enter a username if your SMTP server requires it.', + 'USE_SMTP' => 'Use SMTP server for email', 'USE_SMTP_EXPLAIN' => 'Select “Yes” if you want or have to send email via a named server instead of the local mail function.', )); @@ -417,7 +417,7 @@ $lang = array_merge($lang, array( 'JAB_ENABLE' => 'Enable Jabber', 'JAB_ENABLE_EXPLAIN' => 'Enables use of jabber messaging and notifications', 'JAB_PACKAGE_SIZE' => 'Jabber package size', - 'JAB_PACKAGE_SIZE_EXPLAIN' => 'This is the number of messages sent in one package. If set to 0 the message is sent immediatly and gets not queued for later sending.', + 'JAB_PACKAGE_SIZE_EXPLAIN' => 'This is the number of messages sent in one package. If set to 0 the message is sent immediately and gets not queued for later sending.', 'JAB_PASSWORD' => 'Jabber password', 'JAB_PASS_CHANGED' => 'Jabber password changed successfully.', 'JAB_PORT' => 'Jabber port', diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 6b380a8ea6..22d32831bf 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -101,7 +101,7 @@ $lang = array_merge($lang, array( 'ACP_ICONS_SMILIES' => 'Topic icons/smilies', 'ACP_IMAGESETS' => 'Imagesets', 'ACP_INACTIVE_USERS' => 'Inactive users', - 'ACP_INDEX' => 'Admin index', + 'ACP_INDEX' => 'ACP index', 'ACP_JABBER_SETTINGS' => 'Jabber settings', @@ -110,7 +110,7 @@ $lang = array_merge($lang, array( 'ACP_LOAD_SETTINGS' => 'Load settings', 'ACP_LOGGING' => 'Logging', - 'ACP_MAIN' => 'Admin index', + 'ACP_MAIN' => 'ACP index', 'ACP_MANAGE_EXTENSIONS' => 'Manage extensions', 'ACP_MANAGE_FORUMS' => 'Manage forums', 'ACP_MANAGE_RANKS' => 'Manage ranks', @@ -139,7 +139,7 @@ $lang = array_merge($lang, array( 'ACP_QUICK_ACCESS' => 'Quick access', 'ACP_RANKS' => 'Ranks', - 'ACP_REASONS' => 'Report/Denial reasons', + 'ACP_REASONS' => 'Report/denial reasons', 'ACP_REGISTER_SETTINGS' => 'User registration settings', 'ACP_RESTORE' => 'Restore', @@ -258,7 +258,7 @@ $lang = array_merge($lang, array( 'RESYNC' => 'Resyncronise', 'RETURN_TO' => 'Return to…', - 'SELECT_ANONYMOUS' => 'Select Anonymous User', + 'SELECT_ANONYMOUS' => 'Select anonymous user', 'SELECT_OPTION' => 'Select option', 'UCP' => 'User Control Panel', @@ -270,7 +270,7 @@ $lang = array_merge($lang, array( // PHP info $lang = array_merge($lang, array( - 'ACP_PHP_INFO_EXPLAIN' => 'This page lists information on the version of PHP installed on this server. It includes details of loaded modules, available variables and default settings. This information may be useful when diagnosing problems. Please be aware that some hosting companies will limit what information is displayed here for security reasons. You are advised to not give out any details on this page except when asked by support or other Team Member on the support forums.', + 'ACP_PHP_INFO_EXPLAIN' => 'This page lists information on the version of PHP installed on this server. It includes details of loaded modules, available variables and default settings. This information may be useful when diagnosing problems. Please be aware that some hosting companies will limit what information is displayed here for security reasons. You are advised to not give out any details on this page except when asked by official team members on the support forums.', 'NO_PHPINFO_AVAILABLE' => 'The PHP informations are unable to be determined. Phpinfo() has been disabled for security reasons.', )); @@ -347,7 +347,7 @@ $lang = array_merge($lang, array( 'INACTIVE_REASON_REGISTER' => 'Newly registered account', 'INACTIVE_REASON_REMIND' => 'Forced user account reactivation', 'INACTIVE_REASON_UNKNOWN' => 'Unknown', - 'INACTIVE_USERS' => 'Inactive Users', + 'INACTIVE_USERS' => 'Inactive users', 'INACTIVE_USERS_EXPLAIN' => 'This is a list of users who have registered but whos accounts are inactive. You can activate, delete or remind (by sending an email) these users if you wish.', 'INACTIVE_USERS_EXPLAIN_INDEX' => 'This is a list of the last 10 registered users who have inactive accounts. A full list is available from the appropriate menu item or by following the link below from where you can activate, delete or remind (by sending an email) these users if you wish.', @@ -367,8 +367,8 @@ $lang = array_merge($lang, array( 'LOG_ACL_ADD_GROUP_GLOBAL_U_' => 'Added or edited groups user permissions
» %s', 'LOG_ACL_ADD_USER_GLOBAL_M_' => 'Added or edited users global moderator permissions
» %s', 'LOG_ACL_ADD_GROUP_GLOBAL_M_' => 'Added or edited groups global moderator permissions
» %s', - 'LOG_ACL_ADD_USER_GLOBAL_A_' => 'Added or edited users admin permissions
» %s', - 'LOG_ACL_ADD_GROUP_GLOBAL_A_' => 'Added or edited groups admin permissions
» %s', + 'LOG_ACL_ADD_USER_GLOBAL_A_' => 'Added or edited users administrator permissions
» %s', + 'LOG_ACL_ADD_GROUP_GLOBAL_A_' => 'Added or edited groups administrator permissions
» %s', 'LOG_ACL_ADD_ADMIN_GLOBAL_A_' => 'Added or edited Administrators
» %s', 'LOG_ACL_ADD_MOD_GLOBAL_M_' => 'Added or edited Global Moderators
» %s', @@ -379,12 +379,12 @@ $lang = array_merge($lang, array( 'LOG_ACL_ADD_GROUP_LOCAL_M_' => 'Added or edited groups forum moderator access from %1$s
» %2$s', 'LOG_ACL_ADD_MOD_LOCAL_M_' => 'Added or edited Moderators from %1$s
» %2$s', - 'LOG_ACL_ADD_FORUM_LOCAL_F_' => 'Added or edited Forum Permissions from %1$s
» %2$s', + 'LOG_ACL_ADD_FORUM_LOCAL_F_' => 'Added or edited forum permissions from %1$s
» %2$s', 'LOG_ACL_DEL_ADMIN_GLOBAL_A_' => 'Removed Administrators
» %s', 'LOG_ACL_DEL_MOD_GLOBAL_M_' => 'Removed Global Moderators
» %s', 'LOG_ACL_DEL_MOD_LOCAL_M_' => 'Removed Moderators from %1$s
» %2$s', - 'LOG_ACL_DEL_FORUM_LOCAL_F_' => 'Removed User/Group Forum Permissions from %1$s
» %2$s', + 'LOG_ACL_DEL_FORUM_LOCAL_F_' => 'Removed User/Group forum permissions from %1$s
» %2$s', 'LOG_ACL_TRANSFER_PERMISSIONS' => 'Permissions transfered from
» %s', 'LOG_ACL_RESTORE_PERMISSIONS' => 'Own permissions restored after using permissions from
» %s', @@ -404,11 +404,11 @@ $lang = array_merge($lang, array( 'LOG_BAN_EXCLUDE_USER' => 'Excluded user from ban for reason "%1$s"
» %2$s ', 'LOG_BAN_EXCLUDE_IP' => 'Excluded IP from ban for reason "%1$s"
» %2$s ', 'LOG_BAN_EXCLUDE_EMAIL' => 'Excluded email from ban for reason "%1$s"
» %2$s ', - 'LOG_BAN_USER' => 'Banned User for reason "%1$s"
» %2$s ', + 'LOG_BAN_USER' => 'Banned user for reason "%1$s"
» %2$s ', 'LOG_BAN_IP' => 'Banned IP for reason "%1$s"
» %2$s', 'LOG_BAN_EMAIL' => 'Banned email for reason "%1$s"
» %2$s', 'LOG_UNBAN_USER' => 'Unbanned user
» %s', - 'LOG_UNBAN_IP' => 'Unbanned ip
» %s', + 'LOG_UNBAN_IP' => 'Unbanned IP
» %s', 'LOG_UNBAN_EMAIL' => 'Unbanned email
» %s', 'LOG_BBCODE_ADD' => 'Added new BBCode
» %s', diff --git a/phpBB/language/en/acp/email.php b/phpBB/language/en/acp/email.php index 9fbf6f3d45..f959eb21bb 100644 --- a/phpBB/language/en/acp/email.php +++ b/phpBB/language/en/acp/email.php @@ -37,7 +37,7 @@ $lang = array_merge($lang, array( 'COMPOSE' => 'Compose', - 'EMAIL_SEND_ERROR' => 'There were one or more errors while sending the email. Please check the %sError Log%s for detailed error messages.', + 'EMAIL_SEND_ERROR' => 'There were one or more errors while sending the email. Please check the %sError log%s for detailed error messages.', 'EMAIL_SENT' => 'This message has been sent.', 'EMAIL_SENT_QUEUE' => 'This message has been queued for sending.', diff --git a/phpBB/language/en/acp/forums.php b/phpBB/language/en/acp/forums.php index ef67df40ed..48d4374056 100644 --- a/phpBB/language/en/acp/forums.php +++ b/phpBB/language/en/acp/forums.php @@ -46,7 +46,7 @@ $lang = array_merge($lang, array( 'DECIDE_MOVE_DELETE_CONTENT' => 'Delete content or move to forum', 'DECIDE_MOVE_DELETE_SUBFORUMS' => 'Delete subforums or move to forum', - 'DEFAULT_STYLE' => 'Default Style', + 'DEFAULT_STYLE' => 'Default style', 'DELETE_ALL_POSTS' => 'Delete posts', 'DELETE_SUBFORUMS' => 'Delete subforums and posts', 'DISPLAY_ACTIVE_TOPICS' => 'Enable active topics', @@ -59,7 +59,7 @@ $lang = array_merge($lang, array( 'ENABLE_POST_REVIEW_EXPLAIN' => 'If set to yes users are able to review their post if new posts were made to the topic while users wrote theirs. This should be disabled for chat forums.', 'ENABLE_RECENT' => 'Display active topics', 'ENABLE_RECENT_EXPLAIN' => 'If set to yes topics made to this forum will be shown in the active topics list.', - 'ENABLE_TOPIC_ICONS' => 'Enable Topic Icons', + 'ENABLE_TOPIC_ICONS' => 'Enable topic icons', 'FORUM_ADMIN' => 'Forum administration', 'FORUM_ADMIN_EXPLAIN' => 'In phpBB3 there are no categories, everything is forum based. Each forum can have an unlimited number of sub-forums and you can determine whether each may be posted to or not (i.e. whether it acts like an old category). Here you can add, edit, delete, lock, unlock individual forums as well as set certain additional controls. If your posts and topics have got out of sync you can also resynchronise a forum.', @@ -73,7 +73,7 @@ $lang = array_merge($lang, array( 'FORUM_DESC' => 'Description', 'FORUM_DESC_EXPLAIN' => 'Any markup entered here will displayed as is.', 'FORUM_EDIT_EXPLAIN' => 'The form below will allow you to customise this forum. Please note that moderation and post count controls are set via forum permissions for each user or usergroup.', - 'FORUM_IMAGE' => 'Forum Image', + 'FORUM_IMAGE' => 'Forum image', 'FORUM_IMAGE_EXPLAIN' => 'Location, relative to the phpBB root directory, of an additional image to associate with this forum.', 'FORUM_LINK_EXPLAIN' => 'Full URL (including the protocol, for example http://) to location clicking this forum will take the user.', 'FORUM_LINK_TRACK' => 'Track link redirects', diff --git a/phpBB/language/en/acp/language.php b/phpBB/language/en/acp/language.php index 1707fbaa3c..afd79e4301 100644 --- a/phpBB/language/en/acp/language.php +++ b/phpBB/language/en/acp/language.php @@ -46,7 +46,7 @@ $lang = array_merge($lang, array( 'INVALID_UPLOAD_METHOD' => 'The selected upload method is not valid, please choose a different method.', 'LANGUAGE_DETAILS_UPDATED' => 'Language details successfully updated.', - 'LANGUAGE_ENTRIES' => 'Language Entries', + 'LANGUAGE_ENTRIES' => 'Language entries', 'LANGUAGE_ENTRIES_EXPLAIN' => 'Here you are able to change existing language pack entries or not already translated ones.
Note: Once you changed a language file, the changes will be stored within a seperate folder for you to download. The changes will not be seen by your users until you replace the original language files at your webspace (by uploading them).', 'LANGUAGE_FILES' => 'Language files', 'LANGUAGE_KEY' => 'Language key', @@ -59,13 +59,13 @@ $lang = array_merge($lang, array( 'LANGUAGE_PACK_NAME' => 'Name', 'LANGUAGE_PACK_NOT_EXIST' => 'The selected language pack does not exist.', 'LANGUAGE_PACK_USED_BY' => 'Used by (including robots)', - 'LANGUAGE_VARIABLE' => 'Language Variable', - 'LANG_AUTHOR' => 'Language Pack Author', + 'LANGUAGE_VARIABLE' => 'Language variable', + 'LANG_AUTHOR' => 'Language pack author', 'LANG_ENGLISH_NAME' => 'English name', - 'LANG_ISO_CODE' => 'ISO Code', + 'LANG_ISO_CODE' => 'ISO code', 'LANG_LOCAL_NAME' => 'Local name', - 'MISSING_LANGUAGE_FILE' => 'Missing Language File: %s', + 'MISSING_LANGUAGE_FILE' => 'Missing language file: %s', 'MISSING_LANG_VARIABLES' => 'Missing language variables', 'MODS_FILES' => 'MODs language files', diff --git a/phpBB/language/en/acp/permissions.php b/phpBB/language/en/acp/permissions.php index d37001c977..e17b31b8ef 100644 --- a/phpBB/language/en/acp/permissions.php +++ b/phpBB/language/en/acp/permissions.php @@ -134,7 +134,7 @@ $lang = array_merge($lang, array( 'ONLY_FORUM_DEFINED' => 'You only defined forums in your selection. Please also select at least one user or one group.', - 'PERMISSION_APPLIED_TO_ALL' => 'Permissions and Role will also be applied to all checked objects', + 'PERMISSION_APPLIED_TO_ALL' => 'Permissions and role will also be applied to all checked objects', 'PLUS_SUBFORUMS' => '+Subforums', 'REMOVE_PERMISSIONS' => 'Remove permissions', diff --git a/phpBB/language/en/acp/posting.php b/phpBB/language/en/acp/posting.php index 13dae541ac..cb16abfe47 100644 --- a/phpBB/language/en/acp/posting.php +++ b/phpBB/language/en/acp/posting.php @@ -100,7 +100,7 @@ $lang = array_merge($lang, array( 'FIRST' => 'First', - 'ICONS_ADD' => 'Add a new Icon', + 'ICONS_ADD' => 'Add a new icon', 'ICONS_ADDED' => 'The icon has been added successfully.', 'ICONS_CONFIG' => 'Icon configuration', 'ICONS_DELETED' => 'The icon has been removed successfully.', @@ -137,7 +137,7 @@ $lang = array_merge($lang, array( 'SMILIES_CODE' => 'Smiley code', 'SMILIES_CONFIG' => 'Smiley configuration', 'SMILIES_DELETED' => 'The smiley has been removed successfully.', - 'SMILIES_EDIT' => 'Edit Smiley', + 'SMILIES_EDIT' => 'Edit smiley', 'SMILIES_EDITED' => 'The smiley has been updated successfully.', 'SMILIES_EMOTION' => 'Emotion', 'SMILIES_HEIGHT' => 'Smiley height', diff --git a/phpBB/language/en/acp/profile.php b/phpBB/language/en/acp/profile.php index 1866d59490..dcdb5bec18 100644 --- a/phpBB/language/en/acp/profile.php +++ b/phpBB/language/en/acp/profile.php @@ -45,7 +45,7 @@ $lang = array_merge($lang, array( 'CHECKBOX' => 'Checkbox', 'COLUMNS' => 'Columns', 'CP_LANG_DEFAULT_VALUE' => 'Default value', - 'CP_LANG_EXPLAIN' => 'Field Description', + 'CP_LANG_EXPLAIN' => 'Field description', 'CP_LANG_EXPLAIN_EXPLAIN' => 'The explanation for this field presented to the user', 'CP_LANG_NAME' => 'Field name/title presented to the user', 'CP_LANG_OPTIONS' => 'Options', @@ -90,7 +90,7 @@ $lang = array_merge($lang, array( 'FIRST_OPTION' => 'First option', 'HIDE_PROFILE_FIELD' => 'Hide profile field', - 'HIDE_PROFILE_FIELD_EXPLAIN' => 'Only Administrators and Moderators are able to see/fill out this profile field. If this option is enabled, the profile field will be only displayed in user profiles.', + 'HIDE_PROFILE_FIELD_EXPLAIN' => 'Only administrators and moderators are able to see/fill out this profile field. If this option is enabled, the profile field will be only displayed in users’ profiles.', 'INVALID_CHARS_FIELD_IDENT' => 'Field identification can only contain lowercase a-z and _', 'INVALID_FIELD_IDENT_LEN' => 'Field identification can only be 17 characters long', @@ -119,7 +119,7 @@ $lang = array_merge($lang, array( 'RADIO_BUTTONS' => 'Radio buttons', 'REMOVED_PROFILE_FIELD' => 'Successfully removed profile field.', - 'REQUIRED_FIELD' => 'Required Field', + 'REQUIRED_FIELD' => 'Required field', 'REQUIRED_FIELD_EXPLAIN' => 'Force profile field to be filled out or specified by user. This will display the profile field at registration and within the user control panel.', 'ROWS' => 'Rows', diff --git a/phpBB/language/en/acp/styles.php b/phpBB/language/en/acp/styles.php index 4456325bd3..14ae1a5d29 100644 --- a/phpBB/language/en/acp/styles.php +++ b/phpBB/language/en/acp/styles.php @@ -132,10 +132,10 @@ $lang = array_merge($lang, array( 'IMAGESET_ERR_NAME_LONG' => 'The imageset name can be no longer than 30 characters.', 'IMAGESET_ERR_NOT_IMAGESET' => 'The archive you specified does not contain a valid imageset.', 'IMAGESET_ERR_STYLE_NAME' => 'You must supply a name for this imageset.', - 'IMAGESET_EXPORT' => 'Export Imageset', + 'IMAGESET_EXPORT' => 'Export imageset', 'IMAGESET_EXPORT_EXPLAIN' => 'Here you can export an imageset in the form of an archive. This archive will contain all the data necessary to install the set of images on another board. You may select whether to download the file directly or to place it in your store folder for download later or via FTP.', 'IMAGESET_EXPORTED' => 'Imageset exported succesfully and stored in %s.', - 'IMAGESET_NAME' => 'Imageset Name', + 'IMAGESET_NAME' => 'Imageset name', 'IMAGESET_REFRESHED' => 'Imageset refreshed successfully.', 'IMAGESET_UPDATED' => 'Imageset updated successfully.', 'ITALIC' => 'Italic', @@ -150,7 +150,7 @@ $lang = array_merge($lang, array( 'IMG_CAT_UI' => 'General user interface elements', 'IMG_CAT_USER' => 'Additional images', - 'IMG_SITE_LOGO' => 'Main Logo', + 'IMG_SITE_LOGO' => 'Main logo', 'IMG_UPLOAD_BAR' => 'Upload progress bar', 'IMG_POLL_LEFT' => 'Poll left end', 'IMG_POLL_CENTER' => 'Poll centre', @@ -264,13 +264,13 @@ $lang = array_merge($lang, array( 'INCLUDE_IMAGESET' => 'Include imageset', 'INCLUDE_TEMPLATE' => 'Include template', 'INCLUDE_THEME' => 'Include theme', - 'INSTALL_IMAGESET' => 'Install Imageset', + 'INSTALL_IMAGESET' => 'Install imageset', 'INSTALL_IMAGESET_EXPLAIN' => 'Here you can install your selected imageset. You can edit certain details if you wish or use the installation defaults.', - 'INSTALL_STYLE' => 'Install Style', + 'INSTALL_STYLE' => 'Install style', 'INSTALL_STYLE_EXPLAIN' => 'Here you can install a new style and if appropriate the corresponding style elements. If you already have the relevant style elements installed they will not be overwritten. Some styles require existing style elements to already be installed. If you try installing such a style and do not have the required elements you will be notified.', 'INSTALL_TEMPLATE' => 'Install Template', 'INSTALL_TEMPLATE_EXPLAIN' => 'Here you can install a new template set. Depending on your server configuration you may have a number of options here.', - 'INSTALL_THEME' => 'Install Theme', + 'INSTALL_THEME' => 'Install theme', 'INSTALL_THEME_EXPLAIN' => 'Here you can install your selected theme. You can edit certain details if you wish or use the installation defaults.', 'INSTALLED_IMAGESET' => 'Installed imagesets', 'INSTALLED_STYLE' => 'Installed styles', @@ -284,7 +284,7 @@ $lang = array_merge($lang, array( 'NO_CLASS' => 'Cannot find class in stylesheet.', 'NO_IMAGESET' => 'Cannot find imageset on filesystem.', - 'NO_IMAGE' => 'No Image', + 'NO_IMAGE' => 'No image', 'NO_STYLE' => 'Cannot find style on filesystem.', 'NO_TEMPLATE' => 'Cannot find template on filesystem.', 'NO_THEME' => 'Cannot find theme on filesystem.', @@ -347,7 +347,7 @@ $lang = array_merge($lang, array( 'STYLE_ERR_NO_IDS' => 'You must select a template, theme and imageset for this style.', 'STYLE_ERR_NOT_STYLE' => 'The imported or uploaded file did not contain a valid style archive.', 'STYLE_ERR_STYLE_NAME' => 'You must supply a name for this style.', - 'STYLE_EXPORT' => 'Export Style', + 'STYLE_EXPORT' => 'Export style', 'STYLE_EXPORT_EXPLAIN' => 'Here you can export a style in the form of an archive. A style does not need to contain all elements but it must contain at least one. For example if you have created a new theme and imageset for a commonly used template you could simply export the theme and imageset and ommit the template. You may select whether to download the file directly or to place it in your store folder for download later or via FTP.', 'STYLE_EXPORTED' => 'Style exported succesfully and stored in %s.', 'STYLE_IMAGESET' => 'Imageset', @@ -407,7 +407,7 @@ $lang = array_merge($lang, array( 'THEME_EXPORTED' => 'Theme exported succesfully and stored in %s.', 'THEME_LOCATION' => 'Store stylesheet in', 'THEME_LOCATION_EXPLAIN' => 'Images are always stored on the filesystem.', - 'THEME_NAME' => 'Theme Name', + 'THEME_NAME' => 'Theme name', 'THEME_REFRESHED' => 'Theme refreshed successfully.', 'THEME_UPDATED' => 'Class updated successfully.', diff --git a/phpBB/language/en/acp/users.php b/phpBB/language/en/acp/users.php index 08bebf2d66..6b8935334c 100644 --- a/phpBB/language/en/acp/users.php +++ b/phpBB/language/en/acp/users.php @@ -79,7 +79,7 @@ $lang = array_merge($lang, array( 'RETAIN_POSTS' => 'Retain posts', 'SELECT_FORM' => 'Select form', - 'SELECT_USER' => 'Select User', + 'SELECT_USER' => 'Select user', 'USER_ADMIN' => 'User administration', 'USER_ADMIN_ACTIVATE' => 'Activate account', @@ -113,9 +113,9 @@ $lang = array_merge($lang, array( 'USER_POSTS_DELETED' => 'Successfully removed all posts made by this user.', 'USER_POSTS_MOVED' => 'Successfully moved users posts to target forum.', 'USER_PREFS_UPDATED' => 'User preferences updated.', - 'USER_PROFILE' => 'User Profile', + 'USER_PROFILE' => 'User profile', 'USER_PROFILE_UPDATED' => 'User profile updated.', - 'USER_RANK' => 'User Rank', + 'USER_RANK' => 'User rank', 'USER_RANK_UPDATED' => 'User rank updated.', 'USER_SIG_UPDATED' => 'User signature successfully updated.', 'USER_TOOLS' => 'Basic tools', diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 384fd80340..f31968f885 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -85,7 +85,7 @@ $lang = array_merge($lang, array( 'BACK_TO_TOP' => 'Top', 'BACK_TO_PREV' => 'Back to previous page', 'BAN_TRIGGERED_BY_EMAIL'=> 'This ban has been issued on your email address.', - 'BAN_TRIGGERED_BY_IP' => 'This ban has been issued on your ip address.', + 'BAN_TRIGGERED_BY_IP' => 'This ban has been issued on your IP address.', 'BAN_TRIGGERED_BY_USER' => 'This ban has been issued on your username.', 'BBCODE_GUIDE' => 'BBCode guide', 'BCC' => 'BCC', @@ -218,9 +218,9 @@ $lang = array_merge($lang, array( 'G_ADMINISTRATORS' => 'Administrators', 'G_BOTS' => 'Bots', 'G_GUESTS' => 'Guests', - 'G_REGISTERED' => 'Registered Users', - 'G_REGISTERED_COPPA' => 'Registered COPPA Users', - 'G_GLOBAL_MODERATORS' => 'Global Moderators', + 'G_REGISTERED' => 'Registered users', + 'G_REGISTERED_COPPA' => 'Registered COPPA users', + 'G_GLOBAL_MODERATORS' => 'Global moderators', 'HIDDEN_USERS_ONLINE' => '%d hidden users online', 'HIDDEN_USERS_TOTAL' => '%d hidden and ', @@ -289,7 +289,7 @@ $lang = array_merge($lang, array( 'MCP' => 'Moderator Control Panel', 'MEMBERLIST' => 'Members', 'MEMBERLIST_EXPLAIN' => 'View complete list of members', - 'MERGE_TOPIC' => 'Merge Topic', + 'MERGE_TOPIC' => 'Merge topic', 'MESSAGE' => 'Message', 'MESSAGES' => 'Messages', 'MESSAGE_BODY' => 'Message body', @@ -303,8 +303,8 @@ $lang = array_merge($lang, array( 'NA' => 'N/A', 'NEWEST_USER' => 'Our newest member %s%s%s', - 'NEW_MESSAGE' => 'New Message', - 'NEW_MESSAGES' => 'New Messages', + 'NEW_MESSAGE' => 'New message', + 'NEW_MESSAGES' => 'New messages', 'NEW_PM' => '%d new message', 'NEW_PMS' => '%d new messages', 'NEW_POST' => 'New post', @@ -312,7 +312,7 @@ $lang = array_merge($lang, array( 'NEXT' => 'Next', 'NEVER' => 'Never', 'NO' => 'No', - 'NOT_ALLOWED_MANAGE_GROUP' => 'You are not allowed to manage this group from the administration control panel.', + 'NOT_ALLOWED_MANAGE_GROUP' => 'You are not allowed to manage this group from the “Administration Control Panel”.', 'NOT_AUTHORIZED' => 'You are not authorised to access this area.', 'NOT_WATCHING_FORUM' => 'You are no longer subscribed to updates on this forum.', 'NOT_WATCHING_TOPIC' => 'You are no longer subscribed to this topic.', @@ -331,7 +331,7 @@ $lang = array_merge($lang, array( 'NO_FORUMS' => 'This board has no forums', 'NO_GROUP' => 'The requested usergroup does not exist.', 'NO_GROUP_MEMBERS' => 'This group currently has no members', - 'NO_IPS_DEFINED' => 'No IPs or Hostnames defined', + 'NO_IPS_DEFINED' => 'No IP addresses or hostnames defined', 'NO_MEMBERS' => 'No members found for this search criteria', 'NO_MESSAGES' => 'No messages', 'NO_MODE' => 'No mode specified.', @@ -356,7 +356,7 @@ $lang = array_merge($lang, array( 'OCCUPATION' => 'Occupation', 'OFFLINE' => 'Offline', 'ONLINE' => 'Online', - 'ONLINE_BUDDIES' => 'Online Buddies', + 'ONLINE_BUDDIES' => 'Online friends', 'ONLINE_USERS_TOTAL' => 'In total there are %d users online :: ', 'ONLINE_USERS_ZERO_TOTAL' => 'In total there are 0 users online :: ', 'ONLINE_USER_TOTAL' => 'In total there is %d user online :: ', @@ -364,7 +364,7 @@ $lang = array_merge($lang, array( 'PAGE_OF' => 'Page %1$d of %2$d', 'PASSWORD' => 'Password', - 'PLAY_QUICKTIME_FILE' => 'Play quicktime file', + 'PLAY_QUICKTIME_FILE' => 'Play Quicktime file', 'PM' => 'PM', 'POSTING_MESSAGE' => 'Posting message in %s', 'POST' => 'Post', @@ -389,9 +389,9 @@ $lang = array_merge($lang, array( 'PREVIEW' => 'Preview', 'PREVIOUS' => 'Previous', 'PRIVACY' => 'Privacy policy', - 'PRIVATE_MESSAGE' => 'Private Message', - 'PRIVATE_MESSAGES' => 'Private Messages', - 'PRIVATE_MESSAGING' => 'Private Messaging', + 'PRIVATE_MESSAGE' => 'Private message', + 'PRIVATE_MESSAGES' => 'Private messages', + 'PRIVATE_MESSAGING' => 'Private messaging', 'PROFILE' => 'User Control Panel', 'READING_FORUM' => 'Viewing topics in %s', @@ -413,7 +413,7 @@ $lang = array_merge($lang, array( 'REMOVE_INSTALL' => 'Please delete, move or rename the install directory before you use your forum. If this directory is still present, only the Administration Control Panel (ACP) will be accessible.', 'REPLIES' => 'Replies', 'REPLY_WITH_QUOTE' => 'Reply with quote', - 'REPLYING_GLOBAL_ANNOUNCE' => 'Replying to Global Announcement', + 'REPLYING_GLOBAL_ANNOUNCE' => 'Replying to global announcement', 'REPLYING_MESSAGE' => 'Replying to message in %s', 'REPORT_BY' => 'Report by', 'REPORT_POST' => 'Report this post', @@ -496,9 +496,9 @@ $lang = array_merge($lang, array( 'TOO_LONG_CONFIRM_CODE' => 'The confirm code you entered is too long.', 'TOO_LONG_ICQ' => 'The ICQ number you entered is too long.', 'TOO_LONG_INTERESTS' => 'The interests you entered is too long.', - 'TOO_LONG_JABBER' => 'The jabber account name you entered is too long.', + 'TOO_LONG_JABBER' => 'The Jabber account name you entered is too long.', 'TOO_LONG_LOCATION' => 'The location you entered is too long.', - 'TOO_LONG_MSN' => 'The MSN name you entered is too long.', + 'TOO_LONG_MSN' => 'The MSNM/WLM name you entered is too long.', 'TOO_LONG_NEW_PASSWORD' => 'The password you entered is too long.', 'TOO_LONG_OCCUPATION' => 'The occupation you entered is too long.', 'TOO_LONG_PASSWORD_CONFIRM' => 'The password confirmation you entered is too long.', @@ -507,7 +507,7 @@ $lang = array_merge($lang, array( 'TOO_LONG_EMAIL' => 'The email address you entered is too long.', 'TOO_LONG_EMAIL_CONFIRM' => 'The email address confirmation you entered is too long.', 'TOO_LONG_WEBSITE' => 'The website address you entered is too long.', - 'TOO_LONG_YIM' => 'The yahoo messenger name you entered is too long.', + 'TOO_LONG_YIM' => 'The Yahoo! Messenger name you entered is too long.', 'TOO_MANY_VOTE_OPTIONS' => 'You have tried to vote for too many options.', @@ -515,9 +515,9 @@ $lang = array_merge($lang, array( 'TOO_SHORT_CONFIRM_CODE' => 'The confirm code you entered is too short.', 'TOO_SHORT_ICQ' => 'The ICQ number you entered is too short.', 'TOO_SHORT_INTERESTS' => 'The interests you entered is too short.', - 'TOO_SHORT_JABBER' => 'The jabber account name you entered is too short.', + 'TOO_SHORT_JABBER' => 'The Jabber account name you entered is too short.', 'TOO_SHORT_LOCATION' => 'The location you entered is too short.', - 'TOO_SHORT_MSN' => 'The MSN name you entered is too short.', + 'TOO_SHORT_MSN' => 'The MSNM/WLM name you entered is too short.', 'TOO_SHORT_NEW_PASSWORD' => 'The password you entered is too short.', 'TOO_SHORT_OCCUPATION' => 'The occupation you entered is too short.', 'TOO_SHORT_PASSWORD_CONFIRM' => 'The password confirmation you entered is too short.', @@ -526,7 +526,7 @@ $lang = array_merge($lang, array( 'TOO_SHORT_EMAIL' => 'The email address you entered is too short.', 'TOO_SHORT_EMAIL_CONFIRM' => 'The email address confirmation you entered is too short.', 'TOO_SHORT_WEBSITE' => 'The website address you entered is too short.', - 'TOO_SHORT_YIM' => 'The yahoo messenger name you entered is too short.', + 'TOO_SHORT_YIM' => 'The Yahoo! Messenger name you entered is too short.', 'TOPIC' => 'Topic', 'TOPICS' => 'Topics', @@ -606,10 +606,10 @@ $lang = array_merge($lang, array( 'WHO_IS_ONLINE' => 'Who is online', 'WRONG_PASSWORD' => 'You entered an incorrect password.', - 'WRONG_DATA_ICQ' => 'The number you entered is not a valid icq number.', - 'WRONG_DATA_JABBER' => 'The name you entered is not a valid jabber account name.', + 'WRONG_DATA_ICQ' => 'The number you entered is not a valid ICQ number.', + 'WRONG_DATA_JABBER' => 'The name you entered is not a valid Jabber account name.', 'WRONG_DATA_LANG' => 'The language you specified is not valid.', - 'WRONG_DATA_WEBSITE' => 'The website address has to be a valid url, including the protocol. For example http://www.example.com/.', + 'WRONG_DATA_WEBSITE' => 'The website address has to be a valid URL, including the protocol. For example http://www.example.com/.', 'YEAR' => 'Year', 'YES' => 'Yes', diff --git a/phpBB/language/en/email/user_remind_inactive.txt b/phpBB/language/en/email/user_remind_inactive.txt index f0969dfc9f..1bbe058351 100644 --- a/phpBB/language/en/email/user_remind_inactive.txt +++ b/phpBB/language/en/email/user_remind_inactive.txt @@ -2,7 +2,7 @@ Subject: Inactive account reminder Hello {USERNAME}, -On {REGISTER_DATE} you registered a new account at “{SITENAME}”. So far you have not activated this account, you must do this before you can login. For your convenience the activation link is repeated below. +On {REGISTER_DATE} you registered a new account at “{SITENAME}”. To date you have not activated this account which is a prerequisite for forum login. For your convenience the activation link is repeated below. {U_ACTIVATE} diff --git a/phpBB/language/en/groups.php b/phpBB/language/en/groups.php index a936058162..2f9f6826e9 100644 --- a/phpBB/language/en/groups.php +++ b/phpBB/language/en/groups.php @@ -42,7 +42,7 @@ $lang = array_merge($lang, array( 'GROUP_DESC' => 'Group description', 'GROUP_HIDDEN' => 'Hidden', 'GROUP_INFORMATION' => 'Usergroup information', - 'GROUP_IS_CLOSED' => 'This is a closed group, new members cannot automatically join.', + 'GROUP_IS_CLOSED' => 'This is a closed group, where new members cannot automatically join and only upon invitation of a group leader.', 'GROUP_IS_FREE' => 'This is a freely open group, all new members are welcome.', 'GROUP_IS_HIDDEN' => 'This is a hidden group, only members of this group can view its membership.', 'GROUP_IS_OPEN' => 'This is an open group, members can apply to join.', diff --git a/phpBB/language/en/help_bbcode.php b/phpBB/language/en/help_bbcode.php index 7909a2a148..544b68f5b4 100644 --- a/phpBB/language/en/help_bbcode.php +++ b/phpBB/language/en/help_bbcode.php @@ -44,7 +44,7 @@ $help = array( ), array( 0 => 'How to change the text colour or size', - 1 => 'To alter the color or size of your text the following tags can be used. Keep in mind that how the output appears will depend on the viewers browser and system:
  • Changing the colour of text is achieved by wrapping it in [color=][/color]. You can specify either a recognised colour name (eg. red, blue, yellow, etc.) or the hexadecimal triplet alternative, eg. #FFFFFF, #000000. For example, to create red text you could use:

    [color=red]Hello![/color]

    or

    [color=#FF0000]Hello![/color]

    will both output Hello!
  • Changing the text size is achieved in a similar way using [size=][/size]. This tag is dependent on the template you are using but the recommended format is a numerical value representing the text size in pixels, starting at 1 (so tiny you will not see it) through to 29 (very large). For example:

    [size=9]SMALL[/size]

    will generally be SMALL

    whereas:

    [size=24]HUGE![/size]

    will be HUGE!
' + 1 => 'To alter the color or size of your text the following tags can be used. Keep in mind that how the output appears will depend on the viewers browser and system:
  • Changing the colour of text is achieved by wrapping it in [color=][/color]. You can specify either a recognised colour name (eg. red, blue, yellow, etc.) or the hexadecimal triplet alternative, eg. #FFFFFF, #000000. For example, to create red text you could use:

    [color=red]Hello![/color]

    or

    [color=#FF0000]Hello![/color]

    will both output Hello!
  • Changing the text size is achieved in a similar way using [size=][/size]. This tag is dependent on the template the user has selected but the recommended format is a numerical value representing the text size in pixels, starting at 1 (so tiny you will not see it) through to 29 (very large). For example:

    [size=9]SMALL[/size]

    will generally be SMALL

    whereas:

    [size=24]HUGE![/size]

    will be HUGE!
' ), array( 0 => 'Can I combine formatting tags?', diff --git a/phpBB/language/en/help_faq.php b/phpBB/language/en/help_faq.php index 39903fc14b..c0b8549486 100644 --- a/phpBB/language/en/help_faq.php +++ b/phpBB/language/en/help_faq.php @@ -44,7 +44,7 @@ $help = array( ), array( 0 => 'How do I prevent my username appearing in the online user listings?', - 1 => 'In your profile you will find an option Hide your online status, if you switch this on you’ll only appear to board administrators, moderators, or to yourself. You will be counted as a hidden user.' + 1 => 'Within the UCP under “Forum preferences” you will find an option Hide your online status, if you enable this option with Yes, you’ll only appear to the administrators, moderators or yourself. You will be counted as a hidden user.' ), array( 0 => 'I’ve lost my password!', diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 9ea4cd4057..c4fc43731b 100755 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.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( - 'ADMIN_CONFIG' => 'Admin Configuration', + 'ADMIN_CONFIG' => 'Administrator configuration', 'ADMIN_PASSWORD' => 'Administrator password', 'ADMIN_PASSWORD_CONFIRM' => 'Confirm administrator password', 'ADMIN_PASSWORD_EXPLAIN' => '(Please enter a password between 6 and 30 characters in length)', @@ -39,9 +39,9 @@ $lang = array_merge($lang, array( 'ADMIN_USERNAME' => 'Administrator username', 'ADMIN_USERNAME_EXPLAIN' => '(Please enter a username between 3 and 20 characters in length)', 'APP_MAGICK' => 'Imagemagick support [ Attachments ]', - 'AUTHOR_NOTES' => 'Author Notes
» %s', + 'AUTHOR_NOTES' => 'Author notes
» %s', 'AVAILABLE' => 'Available', - 'AVAILABLE_CONVERTORS' => 'Available Convertors', + 'AVAILABLE_CONVERTORS' => 'Available convertors', 'BEGIN_CONVERT' => 'Begin conversion', 'BLANK_PREFIX_FOUND' => 'A scan of your tables has shown a valid installation using no table prefix.', @@ -73,7 +73,7 @@ $lang = array_merge($lang, array( 'CONVERT_NOT_EXIST' => 'The specified convertor does not exist', 'CONVERT_SETTINGS_VERIFIED' => 'The information you entered has been verified. To start the conversion progress, push the button below to begin', - 'CONV_ERROR_ATTACH_FTP_DIR' => 'FTP Upload for Attachments is enabled at the old board. Please copy all Attachment files to a directory accessible, disable ftp uploading and make sure a valid upload dir is specified. If you have done this, restart the convertor.', + 'CONV_ERROR_ATTACH_FTP_DIR' => 'FTP upload for attachments is enabled at the old board. Please disable the FTP upload option and make sure a valid upload directory is specified, then copy all attachment files to this new web accessible directory. Once you have done this, restart the convertor.', 'CONV_ERROR_CONFIG_EMPTY' => 'There is no configuration information available for the conversion.', 'CONV_ERROR_FORUM_ACCESS' => 'Unable to get forum access information.', 'CONV_ERROR_GET_CATEGORIES' => 'Unable to get categories.', @@ -98,14 +98,14 @@ $lang = array_merge($lang, array( 'CONV_ERROR_REPLACE_FORUM' => 'Unable to insert new forum replacing old forum.', 'CONV_ERROR_USER_ACCESS' => 'Unable to get user authentication information.', 'CONV_ERROR_WRONG_GROUP' => 'Wrong group "%1$s" defined in %2$s.', - 'CONV_SAVED_MESSAGES' => 'Saved Messages', + 'CONV_SAVED_MESSAGES' => 'Saved messages', 'COULD_NOT_COPY' => 'Could not copy file %1$s to %2$s

Please check that the target directory exists and is writable by the webserver', 'COULD_NOT_FIND_PATH' => 'Could not find path to your former forum. Please check your settings and try again.
» Specified source path was %s', 'DBMS' => 'Database type', - 'DB_CONFIG' => 'Database Configuration', - 'DB_CONNECTION' => 'Database Connection', + 'DB_CONFIG' => 'Database configuration', + 'DB_CONNECTION' => 'Database connection', 'DB_ERR_INSERT' => 'Error while processing INSERT query', 'DB_ERR_LAST' => 'Error while processing query_last', 'DB_ERR_QUERY_FIRST' => 'Error while executing query_first', @@ -118,7 +118,7 @@ $lang = array_merge($lang, array( 'DB_PORT' => 'Database server port', 'DB_PORT_EXPLAIN' => 'Leave this blank unless you know the server operates on a non-standard port.', 'DB_USERNAME' => 'Database username', - 'DB_TEST' => 'Test Connection', + 'DB_TEST' => 'Test connection', 'DEFAULT_LANG' => 'Default board language', 'DEFAULT_PREFIX_IS' => 'The default table prefix for %1$s is %2$s', 'DEV_NO_TEST_FILE' => 'No value has been specified for the test_file variable in the convertor. If you are a user of this convertor, you should not be seeing this error, please report this message to the convertor author. If you are a convertor author, you must specify the name of a file which exists in the source forum to allow the path to it to be verified.', @@ -144,27 +144,27 @@ $lang = array_merge($lang, array( 'ENABLE_KEYS' => 'Re-enabling keys. This can take a while', - 'FILES_OPTIONAL' => 'Optional Files and Directories', + 'FILES_OPTIONAL' => 'Optional files and directories', 'FILES_OPTIONAL_EXPLAIN' => 'Optional - These files, directories or permissions are not required. The installation routines will attempt to use various techniques to complete if they do not exist or cannot be written to. However, the presence of these files, directories or permissions will speed installation.', 'FILES_REQUIRED' => 'Files and Directories', 'FILES_REQUIRED_EXPLAIN' => 'Required - In order to function correctly phpBB needs to be able to access or write to certain files or directories. If you see “Not Found” you need to create the relevant file or directory. If you see “Unwriteable” you need to change the permissions on the file or directory to allow phpBB to write to it.', 'FILLING_TABLE' => 'Filling table %s', - 'FILLING_TABLES' => 'Filling Tables', - 'FINAL_STEP' => 'Process Final Step', + 'FILLING_TABLES' => 'Filling tables', + 'FINAL_STEP' => 'Processing final step', 'FORUM_ADDRESS' => 'Forum address', - 'FORUM_ADDRESS_EXPLAIN' => 'This is the http address of your former forum, for example http://www.example.com/phpBB2/. If an address is entered here and not left empty every instance of this address will be replaced by your new forum address within messages, private messages and signatures.', + 'FORUM_ADDRESS_EXPLAIN' => 'This is the URL of your former forum, for example http://www.example.com/phpBB2/. If an address is entered here and not left empty every instance of this address will be replaced by your new forum address within messages, private messages and signatures.', 'FORUM_PATH' => 'Forum path', 'FORUM_PATH_EXPLAIN' => 'This is the relative path on disk to your former forum from the root of your phpBB install', 'FOUND' => 'Found', 'FTP_CONFIG' => 'Transfer config by FTP', 'FTP_CONFIG_EXPLAIN' => 'phpBB has detected the presence of the FTP module on this server. You may attempt to install your config.php via this if you wish. You will need to supply the information listed below. Remember your username and password are those to your server! (ask your hosting provider for details if you are unsure what these are)', - 'FTP_PATH' => 'FTP Path', + 'FTP_PATH' => 'FTP path', 'FTP_PATH_EXPLAIN' => 'This is the path from your root directory to that of phpBB, e.g. htdocs/phpBB3/', 'FTP_UPLOAD' => 'Upload', 'GPL' => 'General Public License', - 'INITIAL_CONFIG' => 'Basic Configuration', + 'INITIAL_CONFIG' => 'Basic configuration', 'INITIAL_CONFIG_EXPLAIN' => 'Now that install has determined your server can run phpBB you need to supply some specific information. If you do not know how to connect to your database please contact your hosting provider (in the first instance) or use the phpBB support forums. When entering data please ensure you check it thoroughly before continuing.', 'INSTALL_CONGRATS' => 'Congratulations', 'INSTALL_CONGRATS_EXPLAIN' => 'You have now successfully installed phpBB 3.0. Clicking the button below will take you to your Administration Control Panel (ACP). Take some time to examine the options available to you. Remember that help is available online via the Userguide and the Beta support forum, see the %sREADME%s for further information.

Please now delete, move or rename the install directory before you use your forum. If this directory is still present, only the Administration Control Panel (ACP) will be accessible.', @@ -183,8 +183,8 @@ $lang = array_merge($lang, array( 'INSTALL_NEXT_PASS' => 'All the basic tests have been passed and you may proceed to the next stage of installation. If you have changed any permissions, modules, etc. and wish to re-test you can do so if you wish.', 'INSTALL_PANEL' => 'Installation Panel', 'INSTALL_SEND_CONFIG' => 'Unfortunately phpBB could not write the configuration information directly to your config.php. This may be because the file does not exist or is not writeable. A number of options will be listed below enabling you to complete installation of config.php.', - 'INSTALL_START' => 'Start Install', - 'INSTALL_TEST' => 'Test Again', + 'INSTALL_START' => 'Start install', + 'INSTALL_TEST' => 'Test again', 'INST_ERR' => 'Installation error', 'INST_ERR_DB_CONNECT' => 'Could not connect to the database, see error message below', 'INST_ERR_DB_FORUM_PATH' => 'The database file specified is within your forum directory tree. You should put this file in a non web-accessible location', @@ -214,16 +214,16 @@ $lang = array_merge($lang, array( 'INVALID_PRIMARY_KEY' => 'Invalid primary key : %s', // mbstring - 'MBSTRING_CHECK' => 'mbstring Extension Check', - 'MBSTRING_CHECK_EXPLAIN' => 'mbstring is a PHP extension that provides multibyte string functions. Certain features of mbstring are not compatible with phpBB and must be disabled', + 'MBSTRING_CHECK' => 'mbstring extension check', + 'MBSTRING_CHECK_EXPLAIN' => 'mbstring is a PHP extension that provides multibyte string functions. Certain features of mbstring are not compatible with phpBB and must be disabled', 'MBSTRING_FUNC_OVERLOAD' => 'Function overloading', - 'MBSTRING_FUNC_OVERLOAD_EXPLAIN' => 'mbstring.func_overload must be set to either 0 or 4', + 'MBSTRING_FUNC_OVERLOAD_EXPLAIN' => 'mbstring.func_overload must be set to either 0 or 4', 'MBSTRING_ENCODING_TRANSLATION' => 'Transparent character encoding', - 'MBSTRING_ENCODING_TRANSLATION_EXPLAIN' => 'mbstring.encoding_translation must be set to 0', + 'MBSTRING_ENCODING_TRANSLATION_EXPLAIN' => 'mbstring.encoding_translation must be set to 0', 'MBSTRING_HTTP_INPUT' => 'HTTP input character conversion', - 'MBSTRING_HTTP_INPUT_EXPLAIN' => 'mbstring.http_input must be set to pass', + 'MBSTRING_HTTP_INPUT_EXPLAIN' => 'mbstring.http_input must be set to pass', 'MBSTRING_HTTP_OUTPUT' => 'HTTP output character conversion', - 'MBSTRING_HTTP_OUTPUT_EXPLAIN' => 'mbstring.http_output must be set to pass', + 'MBSTRING_HTTP_OUTPUT_EXPLAIN' => 'mbstring.http_output must be set to pass', 'MAKE_FOLDER_WRITABLE' => 'Please make sure that this folder exists and is writable by the webserver then try again:
»%s', 'MAKE_FOLDERS_WRITABLE' => 'Please make sure that these folders exist and are writable by the webserver then try again:
»%s', @@ -238,26 +238,26 @@ $lang = array_merge($lang, array( 'NO_TABLES_FOUND' => 'No tables found.', // TODO: Write some explanatory introduction text 'OVERVIEW_BODY' => 'Welcome to our public beta of the next-generation of phpBB after 2.0.x, phpBB 3.0! This beta release is intended for advanced users to try out on dedicated development enviroments to help us finish creating the best Opensource Bulletin Board solution available.

Note: This release is not final and made available for testing purposes only.

This installation system will guide you through the process of installing phpBB, converting from a different software package or updating to the latest version of phpBB. For more information on each option, select it from the menu above.', - 'PCRE_UTF_SUPPORT' => 'PCRE UTF-8 Support', + 'PCRE_UTF_SUPPORT' => 'PCRE UTF-8 support', 'PCRE_UTF_SUPPORT_EXPLAIN' => 'phpBB will not run if your PHP installation is not compiled with UTF-8 support in the PCRE extension', - 'PHP_OPTIONAL_MODULE' => 'Optional Modules', + 'PHP_OPTIONAL_MODULE' => 'Optional modules', 'PHP_OPTIONAL_MODULE_EXPLAIN' => 'Optional - These modules or applications are optional, you do not need these to use phpBB 3.0. However if you have them available they will enable greater functionality.', - 'PHP_SUPPORTED_DB' => 'Supported Databases', + 'PHP_SUPPORTED_DB' => 'Supported databases', 'PHP_SUPPORTED_DB_EXPLAIN' => 'Required - You must have support for at least one compatible database within PHP. If no database modules are shown as available you should contact your hosting provider or review the relevant PHP installation documentation for advice.', 'PHP_REGISTER_GLOBALS' => 'PHP setting register_globals is disabled', 'PHP_REGISTER_GLOBALS_EXPLAIN' => 'phpBB will still run if this setting is enabled, but if possible, it is recommended that register_globals is disabled on your PHP install for security reasons.', - 'PHP_SAFE_MODE' => 'Safe Mode', - 'PHP_SETTINGS' => 'PHP Version and Settings', + 'PHP_SAFE_MODE' => 'Safe mode', + 'PHP_SETTINGS' => 'PHP version and settings', 'PHP_SETTINGS_EXPLAIN' => 'Required - You must be running at least version 4.3.3 of PHP in order to install phpBB. If safe mode is displayed below your PHP installation is running in that mode. This will impose limitations on remote administration and similar features.', 'PHP_VERSION_REQD' => 'PHP version >= 4.3.3', - 'POST_ID' => 'Post id', + 'POST_ID' => 'Post ID', 'PREFIX_FOUND' => 'A scan of your tables has shown a valid installation using %s as table prefix.', 'PREPROCESS_STEP' => 'Executing pre-processing functions/queries', 'PRE_CONVERT_COMPLETE' => 'All pre-conversion steps have successfully been completed. You may now begin the actual conversion process.', 'PROCESS_LAST' => 'Processing last statements', // 'REQUIRED' => 'Required', - 'REQUIREMENTS_TITLE' => 'Installation Compatibility', + 'REQUIREMENTS_TITLE' => 'Installation compatibility', 'REQUIREMENTS_EXPLAIN' => 'Before proceeding with full installation phpBB will carry out some tests on your server configuration and files to ensure that you are able to install and run phpBB. Please ensure you read through the results thoroughly and do not proceed until all the required tests are passed. If you wish to enable any of the functionality listed by the optional tests, you should ensure that these tests are passed also.', 'RETRY_WRITE' => 'Retry writing config', 'RETRY_WRITE_EXPLAIN' => 'If you wish you can change the permissions on config.php to allow phpBB to write to it. Should you wish to do that you can click Retry below to try again. Remember to return the permissions on config.php after phpBB has finished installation.', @@ -265,32 +265,32 @@ $lang = array_merge($lang, array( 'SCRIPT_PATH' => 'Script path', 'SCRIPT_PATH_EXPLAIN' => 'The path where phpBB is located relative to the domain name, e.g. /phpBB3', 'SELECT_LANG' => 'Select language', - 'SERVER_CONFIG' => 'Server Configuration', - 'SOFTWARE' => 'Forum Software', - 'SPECIFY_OPTIONS' => 'Specify Conversion Options', - 'STAGE_ADMINISTRATOR' => 'Administrator Details', - 'STAGE_ADVANCED' => 'Advanced Settings', + 'SERVER_CONFIG' => 'Server configuration', + 'SOFTWARE' => 'Forum software', + 'SPECIFY_OPTIONS' => 'Specify conversion options', + 'STAGE_ADMINISTRATOR' => 'Administrator details', + 'STAGE_ADVANCED' => 'Advanced settings', 'STAGE_ADVANCED_EXPLAIN' => 'The settings on this page are only necessary to set if you know that you require something different from the default. If unsure, just proceed to the next page, this can be altered from the Administration Panel later.', - 'STAGE_CONFIG_FILE' => 'Configuration File', - 'STAGE_CREATE_TABLE' => 'Create Database Tables', + 'STAGE_CONFIG_FILE' => 'Configuration file', + 'STAGE_CREATE_TABLE' => 'Create database tables', 'STAGE_CREATE_TABLE_EXPLAIN' => 'The database tables used by phpBB 3.0 have been created and populated with some initial data. Proceed to the next screen to finish installing phpBB.', - 'STAGE_DATABASE' => 'Database Settings', - 'STAGE_FINAL' => 'Final Stage', + 'STAGE_DATABASE' => 'Database settings', + 'STAGE_FINAL' => 'Final stage', 'STAGE_INTRO' => 'Introduction', 'STAGE_IN_PROGRESS' => 'Conversion in progress', 'STAGE_REQUIREMENTS' => 'Requirements', 'STAGE_SETTINGS' => 'Settings', - 'STARTING_CONVERT' => 'Starting Conversion Process', + 'STARTING_CONVERT' => 'Starting conversion process', 'STEP_PERCENT_COMPLETED' => 'Step %d of %d', 'SUB_INTRO' => 'Introduction', 'SUB_LICENSE' => 'License', 'SUB_SUPPORT' => 'Support', - 'SUCCESSFUL_CONNECT' => 'Successful Connection', + 'SUCCESSFUL_CONNECT' => 'Successful connection', // TODO: Write some text on obtaining support 'SUPPORT_BODY' => 'During the beta phase a minimal level of support will be given at the phpBB 3.0 Beta support forum. We will provide answers to general setup questions, configuration problems and support for determining common problems mostly related to bugs. We will not support modifications, custom code/style additions or any users using the beta packages within a live environment.

For additional assistance, please refer to our Quick Start Guide.

To ensure you stay up to date with the latest news and releases, why not subscribe to our mailing list', 'SYNC_FORUMS' => 'Starting to sync forums', 'SYNC_TOPICS' => 'Starting to sync topics', - 'SYNC_TOPIC_ID' => 'Synchronising topics from topic_id %1$s to %2$s', + 'SYNC_TOPIC_ID' => 'Synchronising topics from topic_id %1$s to %2$s', 'TABLES_MISSING' => 'Could not find these tables
» %s.', 'TABLE_PREFIX' => 'Prefix for tables in database', @@ -361,8 +361,8 @@ $lang = array_merge($lang, array( 'FILES_NOT_MODIFIED_EXPLAIN' => 'The following files were not modified and represent the original phpBB files from the version you want to update from.', 'FILES_UP_TO_DATE' => 'Already updated files', 'FILES_UP_TO_DATE_EXPLAIN' => 'The following files are already up to date and do not need to be updated.', - 'FTP_SETTINGS' => 'FTP Settings', - 'FTP_UPDATE_METHOD' => 'FTP Upload', + 'FTP_SETTINGS' => 'FTP settings', + 'FTP_UPDATE_METHOD' => 'FTP upload', 'INCOMPATIBLE_UPDATE_FILES' => 'The update files found are incompatible with your installed version. Your installed version is %1$s and the update file is for updating phpBB %2$s to %3$s.', 'INCOMPLETE_UPDATE_FILES' => 'The update files are incomplete', @@ -407,7 +407,7 @@ $lang = array_merge($lang, array( 'SELECT_DIFF_MODE' => 'Select diff mode', 'SELECT_DOWNLOAD_FORMAT' => 'Select download archive format', - 'SELECT_FTP_SETTINGS' => 'Select FTP Settings', + 'SELECT_FTP_SETTINGS' => 'Select FTP settings', 'SHOW_DIFF_CONFLICT' => 'Show differences/conflicts', 'SHOW_DIFF_FINAL' => 'Show resulting file', 'SHOW_DIFF_MODIFIED' => 'Show merged differences', @@ -420,7 +420,7 @@ $lang = array_merge($lang, array( 'STAGE_FILE_CHECK' => 'Check files', 'STAGE_UPDATE_DB' => 'Update database', 'STAGE_UPDATE_FILES' => 'Update files', - 'STAGE_VERSION_CHECK' => 'Version Check', + 'STAGE_VERSION_CHECK' => 'Version check', 'STATUS_CONFLICT' => 'Modified file producing conflicts', 'STATUS_MODIFIED' => 'Modified file', 'STATUS_NEW' => 'New file', @@ -434,7 +434,7 @@ $lang = array_merge($lang, array( 'UPDATE_DATABASE_SCHEMA' => 'Updating database schema', 'UPDATE_FILES' => 'Update files', 'UPDATE_FILES_NOTICE' => 'Please make sure you have updated your board files too, this file is only updating your database.', - 'UPDATE_INSTALLATION' => 'Update phpBB Installation', + 'UPDATE_INSTALLATION' => 'Update phpBB installation', 'UPDATE_INSTALLATION_EXPLAIN' => 'With this option, it is possible to update your phpBB installation to the latest version.
During the process all of your files will be checked for their integrity. You are able to review all differences and files before the update.

The file update itself can be done in two different ways.

Manual Update

With this update you only download your personal set of changed files to make sure you do not lose your file modifications you may have done. After you downloaded this package you need to manually upload the files to their correct position under your phpBB root directory. Once done, you are able to do the file check stage again to see if you moved the files to their correct location.

Automatic Update with FTP

This method is similar to the first one but without the need to download the changed files and uploading them on your own. This will be done for you. In order to use this method you need to know your FTP login details since you will be asked for them. Once finished you will be redirected to the file check again to make sure everything got updated correctly.

', 'UPDATE_INSTRUCTIONS' => ' @@ -461,7 +461,7 @@ $lang = array_merge($lang, array(

', '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_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', 'UPDATE_SUCCESS_EXPLAIN' => 'Successfully updated all files. The next step involves checking all files again to make sure the files got updated correctly.', 'UPDATE_VERSION_OPTIMIZE' => 'Updating version and optimizing tables', @@ -472,7 +472,7 @@ $lang = array_merge($lang, array( 'UPDATE_DB_SUCCESS' => 'Database update was successful', - 'VERSION_CHECK' => 'Version Check', + 'VERSION_CHECK' => 'Version check', 'VERSION_CHECK_EXPLAIN' => 'Checks to see if the version of phpBB you are currently running is up to date.', 'VERSION_NOT_UP_TO_DATE' => 'Your version of phpBB is not up to date. Please continue the update process.', 'VERSION_NOT_UP_TO_DATE_ACP'=> 'Your version of phpBB is not up to date.
Below you will find a link to the release announcement for the latest version as well as instructions on how to perform the update.', diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php index 1b7f430806..8c3e3e049f 100644 --- a/phpBB/language/en/mcp.php +++ b/phpBB/language/en/mcp.php @@ -92,9 +92,9 @@ $lang = array_merge($lang, array( 'FORUM_STATUS' => 'Forum status', 'FORUM_STYLE' => 'Forum style', - 'GLOBAL_ANNOUNCEMENT' => 'Global Announcement', + 'GLOBAL_ANNOUNCEMENT' => 'Global announcement', - 'IP_INFO' => 'IP Information', + 'IP_INFO' => 'IP address information', 'IPS_POSTED_FROM' => 'IP addresses this user has posted from', 'LATEST_LOGS' => 'Latest 5 logged actions', @@ -126,7 +126,7 @@ $lang = array_merge($lang, array( 'MCP_ADD' => 'Add a warning', 'MCP_BAN' => 'Banning', - 'MCP_BAN_EMAILS' => 'Ban Emails', + 'MCP_BAN_EMAILS' => 'Ban emails', 'MCP_BAN_IPS' => 'Ban IPs', 'MCP_BAN_USERNAMES' => 'Ban Usernames', @@ -140,22 +140,22 @@ $lang = array_merge($lang, array( 'MCP_MAIN_FRONT' => 'Front page', 'MCP_MAIN_POST_DETAILS' => 'Post details', 'MCP_MAIN_TOPIC_VIEW' => 'View topic', - 'MCP_MAKE_ANNOUNCEMENT' => 'Make Announcement', - 'MCP_MAKE_ANNOUNCEMENT_CONFIRM' => 'Are you sure you want to change this topic to an Announcement?', - 'MCP_MAKE_ANNOUNCEMENTS' => 'Make Announcements', - 'MCP_MAKE_ANNOUNCEMENTS_CONFIRM'=> 'Are you sure you want to change the selected topics to Announcements?', - 'MCP_MAKE_GLOBAL' => 'Make Global Announcement', - 'MCP_MAKE_GLOBAL_CONFIRM' => 'Are you sure you want to change this topic to a Global Announcement?', - 'MCP_MAKE_GLOBALS' => 'Make Global Announcements', - 'MCP_MAKE_GLOBALS_CONFIRM' => 'Are you sure you want to change the selected topics to Global Announcements?', - 'MCP_MAKE_STICKY' => 'Make Sticky', - 'MCP_MAKE_STICKY_CONFIRM' => 'Are you sure you want to change this topic to a Sticky?', - 'MCP_MAKE_STICKIES' => 'Make Stickies', - 'MCP_MAKE_STICKIES_CONFIRM' => 'Are you sure you want to change the selected topics to Stickies?', - 'MCP_MAKE_NORMAL' => 'Make Standard Topic', - 'MCP_MAKE_NORMAL_CONFIRM' => 'Are you sure you want to change this topic to a Standard Topic?', - 'MCP_MAKE_NORMALS' => 'Make Standard Topics', - 'MCP_MAKE_NORMALS_CONFIRM' => 'Are you sure you want to change the selected topics to Standard Topics?', + 'MCP_MAKE_ANNOUNCEMENT' => 'Modify to “Announcement”', + 'MCP_MAKE_ANNOUNCEMENT_CONFIRM' => 'Are you sure you want to change this topic to an “Announcement”?', + 'MCP_MAKE_ANNOUNCEMENTS' => 'Modify to “Announcements”', + 'MCP_MAKE_ANNOUNCEMENTS_CONFIRM'=> 'Are you sure you want to change the selected topics to “Announcements”?', + 'MCP_MAKE_GLOBAL' => 'Modify to “Global announcement”', + 'MCP_MAKE_GLOBAL_CONFIRM' => 'Are you sure you want to change this topic to a “Global announcement”?', + 'MCP_MAKE_GLOBALS' => 'Modify to “Global announcements”', + 'MCP_MAKE_GLOBALS_CONFIRM' => 'Are you sure you want to change the selected topics to “Global announcements”?', + 'MCP_MAKE_STICKY' => 'Modify to “Sticky”', + 'MCP_MAKE_STICKY_CONFIRM' => 'Are you sure you want to change this topic to a “Sticky”?', + 'MCP_MAKE_STICKIES' => 'Modify to “Stickie”s', + 'MCP_MAKE_STICKIES_CONFIRM' => 'Are you sure you want to change the selected topics to “Stickies”?', + 'MCP_MAKE_NORMAL' => 'Modify to “Standard Topic”', + 'MCP_MAKE_NORMAL_CONFIRM' => 'Are you sure you want to change this topic to a “Standard Topic”?', + 'MCP_MAKE_NORMALS' => 'Modify to “Standard Topics”', + 'MCP_MAKE_NORMALS_CONFIRM' => 'Are you sure you want to change the selected topics to “Standard Topics”?', 'MCP_NOTES' => 'User notes', 'MCP_NOTES_FRONT' => 'Front page', @@ -186,7 +186,7 @@ $lang = array_merge($lang, array( 'MERGE_POSTS' => 'Merge posts', 'MERGE_POSTS_CONFIRM' => 'Are you sure you want to merge the selected posts?', 'MERGE_TOPIC_EXPLAIN' => 'Using the form below you can merge selected posts into another topic. These posts will not be reordered and will appear as if the users posted them to the new topic.
Please enter the destination topic id or click on the "Select" button to search for one', - 'MERGE_TOPIC_ID' => 'Destination topic id', + 'MERGE_TOPIC_ID' => 'Destination topic identification number', 'MODERATE_FORUM' => 'Moderate forum', 'MOD_OPTIONS' => 'Moderator options', 'MORE_INFO' => 'Further information', @@ -331,7 +331,7 @@ $lang = array_merge($lang, array( 'WARNED_USERS' => 'Warned users', 'WARNED_USERS_EXPLAIN' => 'This is a list of users with unexpired warnings issued to them', 'WARNING_PM_BODY' => 'The following is a warning which has been issued to you by an administrator or moderator of this site.[quote]%s[/quote]', - 'WARNING_PM_SUBJECT' => 'Board Warning Issued', + 'WARNING_PM_SUBJECT' => 'Board warning issued', 'WARNING_POST_DEFAULT' => 'This is a warning regarding the following post made by you: %s', 'WARNINGS_ZERO_TOTAL' => 'No warnings exists', diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index d84987a590..b87b29b7d6 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -164,7 +164,7 @@ $lang = array_merge($lang, array( 'SAVE' => 'Save', 'SAVE_DATE' => 'Saved at', - 'SAVE_DRAFT' => 'Save Draft', + 'SAVE_DRAFT' => 'Save draft', 'SAVE_DRAFT_CONFIRM' => 'Please note that saved drafts only include the subject and the message, any other element will be removed. Do you want to save your draft now?', 'SMILIES' => 'Smilies', 'SMILIES_ARE_OFF' => 'Smilies are OFF', @@ -179,12 +179,12 @@ $lang = array_merge($lang, array( 'TOO_MANY_ATTACHMENTS' => 'Cannot add another attachment, %d is the maxmimum.', 'TOO_MANY_CHARS' => 'Your message contains too many characters.', 'TOO_MANY_POLL_OPTIONS' => 'You have tried to enter too many poll options', - 'TOO_MANY_SMILIES' => 'Your message contains too many smilies. A maximum of %d smilies are allowed.', - 'TOO_MANY_URLS' => 'Your message contains too many urls. A maximum of %d urls are allowed.', - 'TOO_MANY_USER_OPTIONS' => 'You cannot specify more Options per User than existing poll options', + 'TOO_MANY_SMILIES' => 'Your message contains too many smilies. The maximum number of smilies allowed is %d.', + 'TOO_MANY_URLS' => 'Your message contains too many URLs. The maximum number of URLs allowed is %d.', + 'TOO_MANY_USER_OPTIONS' => 'You cannot specify more options per user than existing poll options', 'TOPIC_BUMPED' => 'Topic has been bumped successfully', - 'UNAUTHORISED_BBCODE' => 'You cannot use certain bbcodes: ', + 'UNAUTHORISED_BBCODE' => 'You cannot use certain BBCodes: ', 'UNGLOBALISE_EXPLAIN' => 'To switch this topic back from being global to a normal topic, you need to select the forum you wish this topic to be displayed.', 'UPDATE_COMMENT' => 'Update comment', 'URL_INVALID' => 'The URL you specified is invalid.', diff --git a/phpBB/language/en/search.php b/phpBB/language/en/search.php index 9b63bf6f38..cd7b8c50e5 100644 --- a/phpBB/language/en/search.php +++ b/phpBB/language/en/search.php @@ -72,8 +72,8 @@ $lang = array_merge($lang, array( 'SEARCH_IN_RESULTS' => 'Search these results', 'SEARCH_KEYWORDS_EXPLAIN' => 'Place + in front of a word which must be found and - in front of a word which must not be found. Put a list of words seperated by | into brackets if only one of the words must be found. Use * as a wildcard for partial matches.', 'SEARCH_MSG_ONLY' => 'Message text only', - 'SEARCH_OPTIONS' => 'Search Options', - 'SEARCH_QUERY' => 'Search Query', + 'SEARCH_OPTIONS' => 'Search options', + 'SEARCH_QUERY' => 'Search query', 'SEARCH_SUBFORUMS' => 'Search subforums', 'SEARCH_TITLE_MSG' => 'Post subjects and message text', 'SEARCH_TITLE_ONLY' => 'Topic titles only', diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index 41ee1ccc7f..92d5225743 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -84,15 +84,15 @@ $lang = array_merge($lang, array( 'ADD_FOLDER' => 'Add folder', 'ADD_FRIENDS' => 'Add new friends', 'ADD_FRIENDS_EXPLAIN' => 'You may enter several usernames each on a different line', - 'ADD_NEW_RULE' => 'Add new Rule', - 'ADD_RULE' => 'Add Rule', + 'ADD_NEW_RULE' => 'Add new rule', + 'ADD_RULE' => 'Add rule', 'ADD_TO' => 'Add [To]', 'ADMIN_EMAIL' => 'Administrators can email me information', 'AGREE' => 'I agree to these terms', 'ALLOW_PM' => 'Allow users to send you private messages', - 'ALLOW_PM_EXPLAIN' => 'Note that admins and moderators will always be able to send you messages.', + 'ALLOW_PM_EXPLAIN' => 'Note that administrators and moderators will always be able to send you messages.', 'ALREADY_ACTIVATED' => 'You have already activated your account', - 'ATTACHMENTS_EXPLAIN' => 'This is a list of attachements you have made in posts to this forum.', + 'ATTACHMENTS_EXPLAIN' => 'This is a list of attachments you have made in posts to this forum.', 'ATTACHMENTS_DELETED' => 'Attachments successfully deleted.', 'ATTACHMENT_DELETED' => 'Attachment successfully deleted.', 'AVATAR_CATEGORY' => 'Category', @@ -183,7 +183,7 @@ $lang = array_merge($lang, array( 'EXPORT_AS_CSV_EXCEL' => 'Export as CSV (Excel)', 'EXPORT_AS_TXT' => 'Export as TXT', 'EXPORT_AS_MSG' => 'Export as MSG', - 'EXPORT_FOLDER' => 'Export Folder', + 'EXPORT_FOLDER' => 'Export folder', 'FIELD_REQUIRED' => 'The field “%s” must be completed.', 'FIELD_TOO_SHORT' => 'The field “%1$s” is too short, a minimum of %2$d characters is required.', @@ -213,14 +213,14 @@ $lang = array_merge($lang, array( 'FRIENDS_OFFLINE' => 'Offline', 'FRIENDS_ONLINE' => 'Online', 'FRIENDS_UPDATED' => 'Your friends list has been updated successfully', - 'FULL_FOLDER_OPTION_CHANGED'=> 'Full Folder Option changed successfully', + 'FULL_FOLDER_OPTION_CHANGED'=> 'The action to take when a folder is full have been changed successfully', 'FWD_ORIGINAL_MESSAGE' => '-------- Original Message --------', 'FWD_SUBJECT' => 'Subject: %s', 'FWD_DATE' => 'Date: %s', 'FWD_FROM' => 'From: %s', 'FWD_TO' => 'To: %s', - 'GLOBAL_ANNOUNCEMENT' => 'Global Announcement', + 'GLOBAL_ANNOUNCEMENT' => 'Global announcement', 'HIDE_ONLINE' => 'Hide my online status', 'HOLD_NEW_MESSAGES' => 'Do not accept new messages (New messages will be held back until enough space is available)', @@ -236,7 +236,7 @@ $lang = array_merge($lang, array( 'LANGUAGE' => 'Language', 'LINK_REMOTE_AVATAR' => 'Link off-site', - 'LINK_REMOTE_AVATAR_EXPLAIN'=> 'Enter the URL of the location containing the Avatar image you wish to link to.', + 'LINK_REMOTE_AVATAR_EXPLAIN'=> 'Enter the URL of the location containing the avatar image you wish to link to.', 'LINK_REMOTE_SIZE' => 'Avatar dimensions', 'LINK_REMOTE_SIZE_EXPLAIN' => 'Specify the width and height of the avatar, leave blank to attempt automatic verification.', 'LOGIN_EXPLAIN_UCP' => 'Please login in order to access the User Control Panel', @@ -259,7 +259,7 @@ $lang = array_merge($lang, array( 'MOVE_DOWN' => 'Move down', 'MOVE_MARKED_TO_FOLDER' => 'Move marked to %s', 'MOVE_PM_ERROR' => 'An error occurred while moving the messages to the new folder, only %1d from %2d messages were moved.', - 'MOVE_TO_FOLDER' => 'Move to Folder', + 'MOVE_TO_FOLDER' => 'Move to folder', 'MOVE_UP' => 'Move up', 'NEW_EMAIL_ERROR' => 'The email addresses you entered do not match.', @@ -306,7 +306,7 @@ $lang = array_merge($lang, array( 'NO_FRIENDS_ONLINE' => 'No friends online', 'NO_GROUP_SELECTED' => 'No group specified', 'NO_IMPORTANT_NEWS' => 'No important announcements present', - 'NO_MESSAGE' => 'Private Message could not be found', + 'NO_MESSAGE' => 'Private message could not be found', 'NO_NEW_FOLDER_NAME' => 'You have to specify a new folder name', 'NO_NEWER_PM' => 'No newer messages', 'NO_OLDER_PM' => 'No older messages', @@ -332,18 +332,18 @@ $lang = array_merge($lang, array( 'PM_ICON' => 'PM icon', 'PM_INBOX' => 'Inbox', 'PM_OUTBOX' => 'Outbox', - 'PM_SENTBOX' => 'Sent Messages', + 'PM_SENTBOX' => 'Sent messages', 'PM_SUBJECT' => 'Message subject', 'PM_TO' => 'Send to', 'POPUP_ON_PM' => 'Pop up window on new private message', 'POST_EDIT_PM' => 'Edit message', 'POST_FORWARD_PM' => 'Forward message', 'POST_NEW_PM' => 'Post message', - 'POST_PM_LOCKED' => 'Private Messaging is locked', + 'POST_PM_LOCKED' => 'Private messaging is locked', 'POST_PM_POST' => 'Quote post', 'POST_QUOTE_PM' => 'Quote message', 'POST_REPLY_PM' => 'Reply to message', - 'PRINT_PM' => 'Print View', + 'PRINT_PM' => 'Print view', 'PREFERENCES_UPDATED' => 'Your preferences have been updated.', 'PROFILE_INFO_NOTICE' => 'Please note that this information will be viewable to other members. Be careful when including any personal details. Any fields marked with a * must be completed.', 'PROFILE_UPDATED' => 'Your profile has been updated.', @@ -399,7 +399,7 @@ $lang = array_merge($lang, array( 'UCP_AIM' => 'AOL Instant Messenger', 'UCP_ATTACHMENTS' => 'Attachments', 'UCP_COPPA_BEFORE' => 'Before %s', - 'UCP_COPPA_ON_AFTER' => 'On or After %s', + 'UCP_COPPA_ON_AFTER' => 'On or after %s', 'UCP_EMAIL_ACTIVATE' => 'Please note that you will need to enter a valid email address before your account is activated. You will recieve an email at the address you provide that contains an account activation link.', 'UCP_ICQ' => 'ICQ number', 'UCP_JABBER' => 'Jabber address', diff --git a/phpBB/language/en/viewtopic.php b/phpBB/language/en/viewtopic.php index 44276689a7..1361a345f7 100644 --- a/phpBB/language/en/viewtopic.php +++ b/phpBB/language/en/viewtopic.php @@ -32,7 +32,7 @@ if (empty($lang) || !is_array($lang)) $lang = array_merge($lang, array( 'ATTACHMENT' => 'Attachment', - 'ATTACHMENT_FUNCTIONALITY_DISABLED' => 'Attachment has been disabled', + 'ATTACHMENT_FUNCTIONALITY_DISABLED' => 'The attachments feature has been disabled', 'BOOKMARK_ADDED' => 'Bookmarked topic successfully.', 'BOOKMARK_REMOVED' => 'Removed bookmarked topic successfully.', @@ -49,7 +49,7 @@ $lang = array_merge($lang, array( 'EDITED_TIMES_TOTAL' => 'Last edited by %1$s on %2$s, edited %3$d times in total', 'EDITED_TIME_TOTAL' => 'Last edited by %1$s on %2$s, edited %3$d time in total', 'EMAIL_TOPIC' => 'Email friend', - 'ERROR_NO_ATTACHMENT' => 'The selected Attachment does not exist anymore', + 'ERROR_NO_ATTACHMENT' => 'The selected attachment does not exist anymore', 'FILE_NOT_FOUND_404' => 'The file %s does not exist.', 'FORK_TOPIC' => 'Copy topic', @@ -58,10 +58,10 @@ $lang = array_merge($lang, array( 'LOGIN_NOTIFY_TOPIC' => 'You have been notified about this topic, please login to view it.', 'LOGIN_VIEWTOPIC' => 'The board administrator requires you to be registered and logged in to view this topic.', - 'MAKE_ANNOUNCE' => 'Change to Announcement', - 'MAKE_GLOBAL' => 'Change to Global', - 'MAKE_NORMAL' => 'Change to Standard Topic', - 'MAKE_STICKY' => 'Change to Sticky', + 'MAKE_ANNOUNCE' => 'Change to “Announcement”', + 'MAKE_GLOBAL' => 'Change to “Global”', + 'MAKE_NORMAL' => 'Change to “Standard Topic”', + 'MAKE_STICKY' => 'Change to “Sticky”', 'MAX_OPTIONS_SELECT' => 'You may select up to %d options', 'MAX_OPTION_SELECT' => 'You may select 1 option', 'MISSING_INLINE_ATTACHMENT' => 'The attachment %s is no longer available', @@ -95,8 +95,8 @@ $lang = array_merge($lang, array( 'VIEW_NEXT_TOPIC' => 'Next topic', 'VIEW_PREVIOUS_TOPIC' => 'Previous topic', 'VIEW_RESULTS' => 'View results', - 'VIEW_TOPIC_POST' => '1 Post', - 'VIEW_TOPIC_POSTS' => '%d Posts', + 'VIEW_TOPIC_POST' => '1 post', + 'VIEW_TOPIC_POSTS' => '%d posts', 'VIEW_UNREAD_POST' => 'First unread post', 'VISIT_WEBSITE' => 'WWW', 'VOTE_SUBMITTED' => 'Your vote has been cast', From 7b86f3b9a89682727685062a9544eadb191d60a5 Mon Sep 17 00:00:00 2001 From: David M Date: Sat, 23 Dec 2006 02:34:18 +0000 Subject: [PATCH 108/264] #6502 git-svn-id: file:///svn/phpbb/trunk@6791 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_database.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php index 7949845862..4cbbdf750b 100644 --- a/phpBB/includes/acp/acp_database.php +++ b/phpBB/includes/acp/acp_database.php @@ -1094,7 +1094,7 @@ class acp_database $delete = request_var('delete', ''); $file = request_var('file', ''); - preg_match('#^(backup_\d{10,})\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches); + preg_match('#^backup_\d{10,}_[a-z\d]{16}\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches); $file_name = $phpbb_root_path . 'store/' . $matches[0]; if (!(file_exists($file_name) && is_readable($file_name))) @@ -1110,7 +1110,7 @@ class acp_database $data = file_get_contents($file_name); - switch ($matches[2]) + switch ($matches[1]) { case 'sql.bz2': $data = bzdecompress($data); @@ -1126,7 +1126,7 @@ class acp_database { $name = $matches[0]; - switch ($matches[2]) + switch ($matches[1]) { case 'sql': $mimetype = 'text/x-sql'; @@ -1215,7 +1215,7 @@ class acp_database $dh = opendir($dir); while (($file = readdir($dh)) !== false) { - if (preg_match('#^backup_(\d{10,})_(?:[a-z\d]{16})\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches)) + if (preg_match('#^backup_(\d{10,})_[a-z\d]{16}\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches)) { $supported = in_array($matches[2], $methods); From 6d0a00a446396ab72d8fb0475f4cd1c8ab9fa151 Mon Sep 17 00:00:00 2001 From: David M Date: Sat, 23 Dec 2006 17:50:48 +0000 Subject: [PATCH 110/264] #6492 git-svn-id: file:///svn/phpbb/trunk@6793 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/develop/create_schema_files.php | 5 +- phpBB/install/database_update.php | 149 ++++++++++++++++++++++ phpBB/install/schemas/firebird_schema.sql | 4 +- phpBB/install/schemas/mssql_schema.sql | 10 +- phpBB/install/schemas/mysql_40_schema.sql | 3 +- phpBB/install/schemas/mysql_41_schema.sql | 3 +- phpBB/install/schemas/oracle_schema.sql | 7 +- phpBB/install/schemas/postgres_schema.sql | 5 +- phpBB/install/schemas/sqlite_schema.sql | 5 +- 9 files changed, 166 insertions(+), 25 deletions(-) diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 3b51a15bd4..f17623da44 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1934,10 +1934,7 @@ function get_schema_struct() 'friend' => array('BOOL', 0), 'foe' => array('BOOL', 0), ), - 'KEYS' => array( - 'user_id' => array('INDEX', 'user_id'), - 'zebra_id' => array('INDEX', 'zebra_id'), - ), + 'PRIMARY_KEY' => array('user_id', 'zebra_id'), ); return $schema_data; diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 0f3f5b3aa2..6c1f030d6b 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -321,6 +321,23 @@ $database_update_info = array( ), ), ), + // Latest version + '3.0.b5' => array( + // Remove the following keys + 'drop_keys' => array( + ZEBRA_TABLE => array( + 'user_id', + 'zebra_id', + ), + ), + // Add the following primary keys + 'add_primary_keys' => array( + ZEBRA_TABLE => array( + 'user_id', + 'zebra_id', + ), + ), + ), ); // Determine mapping database type @@ -472,6 +489,27 @@ foreach ($database_update_info as $version => $schema_changes) } } } + + // Remove keys? + if (!empty($schema_changes['drop_keys'])) + { + foreach ($schema_changes['drop_keys'] as $table => $indexes) + { + foreach ($indexes as $index_name) + { + sql_index_drop($map_dbms, $index_name, $table); + } + } + } + + // Add primary keys? + if (!empty($schema_changes['add_primary_keys'])) + { + foreach ($schema_changes['add_primary_keys'] as $table => $columns) + { + sql_create_primary_key($map_dbms, $table, $columns); + } + } } _write_result($no_updates, $errored, $error_ary); @@ -968,6 +1006,117 @@ function sql_column_add($dbms, $table_name, $column_name, $column_data) } } +function sql_index_drop($dbms, $index_name, $table_name) +{ + global $dbms_type_map, $db; + global $errored, $error_ary; + + switch ($dbms) + { + case 'mssql': + $sql = 'DROP INDEX ' . $table_name . '\.' . $index_name . ' ON ' . $table_name; + _sql($sql, $errored, $error_ary); + break; + + case 'mysql_40': + case 'mysql_41': + $sql = 'DROP INDEX ' . $index_name . ' ON ' . $table_name; + _sql($sql, $errored, $error_ary); + break; + + case 'firebird': + case 'oracle': + case 'postgres': + case 'sqlite': + $sql = 'DROP INDEX ' . $table_name . '_' . $index_name; + _sql($sql, $errored, $error_ary); + break; + } +} + +function sql_create_primary_key($dbms, $table_name, $column) +{ + global $dbms_type_map, $db; + global $errored, $error_ary; + + switch ($dbms) + { + case 'firebird': + case 'postgres': + $sql = 'ALTER TABLE ' . $table_name . ' ADD PRIMARY KEY (' . implode(', ', $column) . ')'; + _sql($sql, $errored, $error_ary); + break; + + case 'mssql': + $sql = "ALTER TABLE [{$table_name}] WITH NOCHECK ADD "; + $sql .= "CONSTRAINT [PK_{$table_name}] PRIMARY KEY CLUSTERED ("; + $sql .= '[' . implode("],\n\t\t[", $column) . ']'; + $sql .= ') ON [PRIMARY]'; + _sql($sql, $errored, $error_ary); + break; + + case 'mysql_40': + case 'mysql_41': + $sql = 'ALTER TABLE ' . $table_name . ' ADD PRIMARY KEY (' . implode(', ', $column) . ')'; + _sql($sql, $errored, $error_ary); + break; + + case 'oracle': + $sql = 'ALTER TABLE ' . $table_name . 'add CONSTRAINT pk_' . $table_name . ' PRIMARY KEY (' . implode(', ', $column) . ')'; + _sql($sql, $errored, $error_ary); + break; + + case 'sqlite': + $sql = "SELECT sql + FROM sqlite_master + WHERE type = 'table' + AND name = '{$table_name}' + ORDER BY type DESC, name;"; + $result = _sql($sql, $errored, $error_ary); + + if (!$result) + { + break; + } + + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + $db->sql_transaction('begin'); + + // Create a backup table and populate it, destroy the existing one + $db->sql_query(preg_replace('#CREATE\s+TABLE\s+"?' . $table_name . '"?#i', 'CREATE TEMPORARY TABLE ' . $table_name . '_temp', $row['sql'])); + $db->sql_query('INSERT INTO ' . $table_name . '_temp SELECT * FROM ' . $table_name); + $db->sql_query('DROP TABLE ' . $table_name); + + preg_match('#\((.*)\)#s', $row['sql'], $matches); + + $new_table_cols = trim($matches[1]); + $old_table_cols = preg_split('/,(?=[\\sa-z])/im', $new_table_cols); + $column_list = array(); + + foreach ($old_table_cols as $declaration) + { + $entities = preg_split('#\s+#', trim($declaration)); + if ($entities == 'PRIMARY') + { + continue; + } + $column_list[] = $entities[0]; + } + + $columns = implode(',', $column_list); + + // create a new table and fill it up. destroy the temp one + $db->sql_query('CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ', PRIMARY KEY (' . implode(', ', $column) . '));'); + $db->sql_query('INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;'); + $db->sql_query('DROP TABLE ' . $table_name . '_temp'); + + $db->sql_transaction('commit'); + break; + } +} + /** * Change column type (not name!) */ diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index 0f01640a85..fe38795ee8 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -1502,6 +1502,6 @@ CREATE TABLE phpbb_zebra ( foe INTEGER DEFAULT 0 NOT NULL );; -CREATE INDEX phpbb_zebra_user_id ON phpbb_zebra(user_id);; -CREATE INDEX phpbb_zebra_zebra_id ON phpbb_zebra(zebra_id);; +ALTER TABLE phpbb_zebra ADD PRIMARY KEY (user_id, zebra_id);; + diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 888f66f472..8c00685f68 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -1744,10 +1744,12 @@ CREATE TABLE [phpbb_zebra] ( ) ON [PRIMARY] GO -CREATE INDEX [user_id] ON [phpbb_zebra]([user_id]) ON [PRIMARY] -GO - -CREATE INDEX [zebra_id] ON [phpbb_zebra]([zebra_id]) ON [PRIMARY] +ALTER TABLE [phpbb_zebra] WITH NOCHECK ADD + CONSTRAINT [PK_phpbb_zebra] PRIMARY KEY CLUSTERED + ( + [user_id], + [zebra_id] + ) ON [PRIMARY] GO diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index 27d36edd12..ee3d290c42 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -1066,8 +1066,7 @@ CREATE TABLE phpbb_zebra ( zebra_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, friend tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, foe tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - KEY user_id (user_id), - KEY zebra_id (zebra_id) + PRIMARY KEY (user_id, zebra_id) ); diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index 4b6d4b008b..c203a8a574 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -1066,8 +1066,7 @@ CREATE TABLE phpbb_zebra ( zebra_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, friend tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, foe tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - KEY user_id (user_id), - KEY zebra_id (zebra_id) + PRIMARY KEY (user_id, zebra_id) ) CHARACTER SET `utf8` COLLATE `utf8_bin`; diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 7a5f05c274..f65d367356 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -1935,12 +1935,9 @@ CREATE TABLE phpbb_zebra ( user_id number(8) DEFAULT '0' NOT NULL, zebra_id number(8) DEFAULT '0' NOT NULL, friend number(1) DEFAULT '0' NOT NULL, - foe number(1) DEFAULT '0' NOT NULL + foe number(1) DEFAULT '0' NOT NULL, + CONSTRAINT pk_phpbb_zebra PRIMARY KEY (user_id, zebra_id) ) / -CREATE INDEX phpbb_zebra_user_id ON phpbb_zebra (user_id) -/ -CREATE INDEX phpbb_zebra_zebra_id ON phpbb_zebra (zebra_id) -/ diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index 5eb8775adf..ccd33c4f56 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -1335,11 +1335,10 @@ CREATE TABLE phpbb_zebra ( user_id INT4 DEFAULT '0' NOT NULL CHECK (user_id >= 0), zebra_id INT4 DEFAULT '0' NOT NULL CHECK (zebra_id >= 0), friend INT2 DEFAULT '0' NOT NULL CHECK (friend >= 0), - foe INT2 DEFAULT '0' NOT NULL CHECK (foe >= 0) + foe INT2 DEFAULT '0' NOT NULL CHECK (foe >= 0), + PRIMARY KEY (user_id, zebra_id) ); -CREATE INDEX phpbb_zebra_user_id ON phpbb_zebra (user_id); -CREATE INDEX phpbb_zebra_zebra_id ON phpbb_zebra (zebra_id); COMMIT; \ No newline at end of file diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 9ddbb6bb8b..4d697f3b15 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -1033,11 +1033,10 @@ CREATE TABLE phpbb_zebra ( user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', zebra_id INTEGER UNSIGNED NOT NULL DEFAULT '0', friend INTEGER UNSIGNED NOT NULL DEFAULT '0', - foe INTEGER UNSIGNED NOT NULL DEFAULT '0' + foe INTEGER UNSIGNED NOT NULL DEFAULT '0', + PRIMARY KEY (user_id, zebra_id) ); -CREATE INDEX phpbb_zebra_user_id ON phpbb_zebra (user_id); -CREATE INDEX phpbb_zebra_zebra_id ON phpbb_zebra (zebra_id); COMMIT; \ No newline at end of file From c0f64d360fcb410192fa35d6353a2956bcc421c6 Mon Sep 17 00:00:00 2001 From: David M Date: Sat, 23 Dec 2006 17:56:50 +0000 Subject: [PATCH 111/264] regex man strikes again! git-svn-id: file:///svn/phpbb/trunk@6794 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/develop/regex.php | 9 ++++----- phpBB/includes/functions.php | 8 ++++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/phpBB/develop/regex.php b/phpBB/develop/regex.php index 4893a3d271..2b736afec2 100644 --- a/phpBB/develop/regex.php +++ b/phpBB/develop/regex.php @@ -43,12 +43,11 @@ echo 'IPv4: ' . $ipv4 . "
\nIPv6: " . $ipv6 . "
\n"; $pct_encoded = "%[\dA-F]{2}"; $unreserved = 'a-z0-9\-._~'; $sub_delims = '!$&\'()*+,;='; -$pchar = "(?:[$unreserved$sub_delims:@|]|$pct_encoded)"; // rfc: no "|" +$pchar = "(?:[$unreserved$sub_delims:@|]+|$pct_encoded)"; // rfc: no "|" $scheme = '[a-z][a-z\d+\-.]*'; -$reg_name = "(?:[$unreserved$sub_delims|]|$pct_encoded)+"; // rfc: * instead of + and no "|" -$authority = "(?:(?:[\w\-.~!$&'()*+,;=:]|$pct_encoded)*@){0,1}(?:$reg_name|$ipv4|\[$ipv6\])[:]?\d*"; -$userinfo = "(?:(?:[$unreserved$sub_delims:]|$pct_encoded))*"; +$reg_name = "(?:[$unreserved$sub_delims|]+|$pct_encoded)+"; // rfc: * instead of + and no "|" +$userinfo = "(?:(?:[$unreserved$sub_delims:]+|$pct_encoded))*"; $ipv4_simple = '[0-9.]+'; $ipv6_simple = '\[[a-z0-9.:]+\]'; $host = "(?:$reg_name|$ipv4_simple|$ipv6_simple)"; @@ -57,7 +56,7 @@ $authority = "(?:$userinfo@)?$host(?::$port)?"; $segment = "$pchar*"; $path_abempty = "(?:/$segment)*"; $hier_part = "/{2}$authority$path_abempty"; -$query = "(?:[$unreserved$sub_delims:@/?|]|$pct_encoded)*"; // pchar | "/" | "?", rfc: no "|" +$query = "(?:[$unreserved$sub_delims:@/?|]+|$pct_encoded)*"; // pchar | "/" | "?", rfc: no "|" $fragment = $query; $url = "$scheme:$hier_part(?:\?$query)?(?:\#$fragment)?"; diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index ea05d969a2..323590b269 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2740,7 +2740,7 @@ function get_preg_expression($mode) case 'bbcode_htm': return array( '#.*?#', - '#.*?#', + '#.*?#', '# Date: Sat, 23 Dec 2006 18:17:05 +0000 Subject: [PATCH 112/264] comment the version mapping more appropiatly. git-svn-id: file:///svn/phpbb/trunk@6795 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 6c1f030d6b..97cf8ad8b6 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -285,7 +285,7 @@ $unsigned_types = array('UINT', 'UINT:', 'USINT', 'BOOL', 'TIMESTAMP'); // Only an example, but also commented out $database_update_info = array( - // Changes within this version + // Changes from 3.0.b3 to the next version '3.0.b3' => array( // Change the following columns... 'change_columns' => array( @@ -309,7 +309,7 @@ $database_update_info = array( ), ), ), - // Latest version + // Changes from 3.0.b4 to the next version '3.0.b4' => array( // Add the following columns 'add_columns' => array( @@ -320,9 +320,6 @@ $database_update_info = array( 'session_forwarded_for' => array('VCHAR:255', 0), ), ), - ), - // Latest version - '3.0.b5' => array( // Remove the following keys 'drop_keys' => array( ZEBRA_TABLE => array( @@ -1346,17 +1343,18 @@ function add_bots() foreach ($bot_list as $bot_name => $bot_ary) { $user_row = array( - 'user_type' => USER_IGNORE, - 'group_id' => $group_id, - 'username' => $bot_name, - 'user_regdate' => time(), - 'user_password' => '', - 'user_colour' => '9E8DA7', - 'user_email' => '', - 'user_lang' => $config['default_lang'], - 'user_style' => 1, - 'user_timezone' => 0, - 'user_dateformat' => $config['default_dateformat'], + 'user_type' => USER_IGNORE, + 'group_id' => $group_id, + 'username' => $bot_name, + 'user_regdate' => time(), + 'user_password' => '', + 'user_colour' => '9E8DA7', + 'user_email' => '', + 'user_lang' => $config['default_lang'], + 'user_style' => 1, + 'user_timezone' => 0, + 'user_dateformat' => $config['default_dateformat'], + 'user_allow_massemail' => 0, ); $user_id = user_add($user_row); From 0d502f3b07df4c198688d87a08bd6f785db77a1d Mon Sep 17 00:00:00 2001 From: David M Date: Sat, 23 Dec 2006 18:27:15 +0000 Subject: [PATCH 113/264] - quite a few optimizations to the template engine. bitwise arithmatic is used to check odd/even, usage of ref to the root template variables should reduce the number of hash lookups needed, usage of refs within loops should reduce the amount of hash lookups, incrementing vars were turned from class variables to regular variables, cache now uses preincrementing variables instead of postincrementing variables, some regex were optimized/trimmed - a bug fix somewhere in there... git-svn-id: file:///svn/phpbb/trunk@6796 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_template.php | 142 ++++++++++++++++---------- phpBB/includes/template.php | 15 +-- 2 files changed, 98 insertions(+), 59 deletions(-) diff --git a/phpBB/includes/functions_template.php b/phpBB/includes/functions_template.php index 47ff906a28..04150d0420 100644 --- a/phpBB/includes/functions_template.php +++ b/phpBB/includes/functions_template.php @@ -115,18 +115,19 @@ class template_compile // Pull out all block/statement level elements and seperate plain text preg_match_all('#(.*?)#s', $code, $matches); $php_blocks = $matches[1]; - $code = preg_replace('#(.*?)#s', '', $code); + $code = preg_replace('#.*?#s', '', $code); - preg_match_all('##', $code, $matches); + preg_match_all('##', $code, $matches); $include_blocks = $matches[1]; - $code = preg_replace('##', '', $code); + $code = preg_replace('##', '', $code); - preg_match_all('##', $code, $matches); + preg_match_all('##', $code, $matches); $includephp_blocks = $matches[1]; - $code = preg_replace('##', '', $code); + $code = preg_replace('##', '', $code); - preg_match_all('##', $code, $blocks); - $text_blocks = preg_split('##', $code); + preg_match_all('##', $code, $blocks, PREG_SET_ORDER); + + $text_blocks = preg_split('##', $code); for ($i = 0, $j = sizeof($text_blocks); $i < $j; $i++) { @@ -134,18 +135,15 @@ class template_compile } $compile_blocks = array(); - for ($curr_tb = 0, $tb_size = sizeof($text_blocks); $curr_tb < $tb_size; $curr_tb++) + for ($curr_tb = 0, $tb_size = sizeof($blocks); $curr_tb < $tb_size; $curr_tb++) { - if (!isset($blocks[1][$curr_tb])) - { - $blocks[1][$curr_tb] = ''; - } + $block_val = &$blocks[$curr_tb]; - switch ($blocks[1][$curr_tb]) + switch ($block_val[1]) { case 'BEGIN': $this->block_else_level[] = false; - $compile_blocks[] = 'compile_tag_block($blocks[2][$curr_tb]) . ' ?>'; + $compile_blocks[] = 'compile_tag_block($block_val[2]) . ' ?>'; break; case 'BEGINELSE': @@ -159,7 +157,7 @@ class template_compile break; case 'IF': - $compile_blocks[] = 'compile_tag_if($blocks[2][$curr_tb], false) . ' ?>'; + $compile_blocks[] = 'compile_tag_if($block_val[2], false) . ' ?>'; break; case 'ELSE': @@ -167,7 +165,7 @@ class template_compile break; case 'ELSEIF': - $compile_blocks[] = 'compile_tag_if($blocks[2][$curr_tb], true) . ' ?>'; + $compile_blocks[] = 'compile_tag_if($block_val[2], true) . ' ?>'; break; case 'ENDIF': @@ -175,11 +173,11 @@ class template_compile break; case 'DEFINE': - $compile_blocks[] = 'compile_tag_define($blocks[2][$curr_tb], true) . ' ?>'; + $compile_blocks[] = 'compile_tag_define($block_val[2], true) . ' ?>'; break; case 'UNDEFINE': - $compile_blocks[] = 'compile_tag_define($blocks[2][$curr_tb], false) . ' ?>'; + $compile_blocks[] = 'compile_tag_define($block_val[2], false) . ' ?>'; break; case 'INCLUDE': @@ -197,9 +195,9 @@ class template_compile break; default: - $this->compile_var_tags($blocks[0][$curr_tb]); - $trim_check = trim($blocks[0][$curr_tb]); - $compile_blocks[] = (!$no_echo) ? ((!empty($trim_check)) ? $blocks[0][$curr_tb] : '') : ((!empty($trim_check)) ? $blocks[0][$curr_tb] : ''); + $this->compile_var_tags($block_val[0]); + $trim_check = trim($block_val[0]); + $compile_blocks[] = (!$no_echo) ? ((!empty($trim_check)) ? $block_val[0] : '') : ((!empty($trim_check)) ? $block_val[0] : ''); break; } } @@ -229,33 +227,33 @@ class template_compile $varrefs = array(); // This one will handle varrefs WITH namespaces - preg_match_all('#\{((?:[a-z0-9\-_]+\.)+)(\$)?([A-Z0-9\-_]+)\}#', $text_blocks, $varrefs); + preg_match_all('#\{((?:[a-z0-9\-_]+\.)+)(\$)?([A-Z0-9\-_]+)\}#', $text_blocks, $varrefs, PREG_SET_ORDER); - for ($j = 0, $size = sizeof($varrefs[1]); $j < $size; $j++) + foreach ($varrefs as $var_val) { - $namespace = $varrefs[1][$j]; - $varname = $varrefs[3][$j]; - $new = $this->generate_block_varref($namespace, $varname, true, $varrefs[2][$j]); + $namespace = $var_val[1]; + $varname = $var_val[3]; + $new = $this->generate_block_varref($namespace, $varname, true, $var_val[2]); - $text_blocks = str_replace($varrefs[0][$j], $new, $text_blocks); + $text_blocks = str_replace($var_val[0], $new, $text_blocks); } // This will handle the remaining root-level varrefs // 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', "_tpldata['.'][0]['L_\\1'])) ? \$this->_tpldata['.'][0]['L_\\1'] : ((isset(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '{ ' . ucfirst(strtolower(str_replace('_', ' ', '\\1'))) . ' }')); ?>", $text_blocks); + $text_blocks = preg_replace('#\{L_([a-z0-9\-_]*)\}#is', "_rootref['L_\\1'])) ? \$this->_rootref['L_\\1'] : ((isset(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '{ ' . ucfirst(strtolower(str_replace('_', ' ', '\\1'))) . ' }')); ?>", $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', "_tpldata['.'][0]['LA_\\1'])) ? \$this->_tpldata['.'][0]['LA_\\1'] : ((isset(\$this->_tpldata['.'][0]['L_\\1'])) ? addslashes(\$this->_tpldata['.'][0]['L_\\1']) : ((isset(\$user->lang['\\1'])) ? addslashes(\$user->lang['\\1']) : '{ ' . ucfirst(strtolower(str_replace('_', ' ', '\\1'))) . ' }'))); ?>", $text_blocks); + $text_blocks = preg_replace('#\{LA_([a-z0-9\-_]*)\}#is', "_rootref['LA_\\1'])) ? \$this->_rootref['LA_\\1'] : ((isset(\$this->_rootref['L_\\1'])) ? addslashes(\$this->_rootref['L_\\1']) : ((isset(\$user->lang['\\1'])) ? addslashes(\$user->lang['\\1']) : '{ ' . ucfirst(strtolower(str_replace('_', ' ', '\\1'))) . ' }'))); ?>", $text_blocks); } // Handle remaining varrefs - $text_blocks = preg_replace('#\{([a-z0-9\-_]*)\}#is', "_tpldata['.'][0]['\\1'])) ? \$this->_tpldata['.'][0]['\\1'] : ''; ?>", $text_blocks); + $text_blocks = preg_replace('#\{([a-z0-9\-_]*)\}#is', "_rootref['\\1'])) ? \$this->_rootref['\\1'] : ''; ?>", $text_blocks); $text_blocks = preg_replace('#\{\$([a-z0-9\-_]*)\}#is', "_tpldata['DEFINE']['.']['\\1'])) ? \$this->_tpldata['DEFINE']['.']['\\1'] : ''; ?>", $text_blocks); return; @@ -321,6 +319,7 @@ class template_compile { // Block is not nested. $tag_template_php = '$_' . $tag_args . "_count = (isset(\$this->_tpldata['$tag_args'])) ? sizeof(\$this->_tpldata['$tag_args']) : 0;"; + $varref = "\$this->_tpldata['$tag_args']"; } else { @@ -346,7 +345,19 @@ class template_compile } $tag_template_php .= 'if ($_' . $tag_args . '_count) {'; - $tag_template_php .= 'for ($this->_' . $tag_args . '_i = ' . $loop_start . '; $this->_' . $tag_args . '_i < ' . $loop_end . '; $this->_' . $tag_args . '_i++){'; + + /** + * The following uses foreach for iteration instead of a for loop, foreach is faster but requires PHP to make a copy of the contents of the array which uses more memory + * + * if (!$offset) + * { + * $tag_template_php .= 'foreach (' . $varref . ' as $_' . $tag_args . '_i => $_' . $tag_args . '_val){'; + * } + * + */ + + $tag_template_php .= 'for ($_' . $tag_args . '_i = ' . $loop_start . '; $_' . $tag_args . '_i < ' . $loop_end . '; ++$_' . $tag_args . '_i){'; + $tag_template_php .= '$_'. $tag_args . '_val = &' . $varref . '[$_'. $tag_args. '_i];'; return $tag_template_php; } @@ -464,14 +475,30 @@ class template_compile default: if (preg_match('#^((?:[a-z0-9\-_]+\.)+)?(\$)?(?=[A-Z])([A-Z0-9\-_]+)#s', $token, $varrefs)) { - $token = (!empty($varrefs[1])) ? $this->generate_block_data_ref(substr($varrefs[1], 0, -1), true, $varrefs[2]) . '[\'' . $varrefs[3] . '\']' : (($varrefs[2]) ? '$this->_tpldata[\'DEFINE\'][\'.\'][\'' . $varrefs[3] . '\']' : '$this->_tpldata[\'.\'][0][\'' . $varrefs[3] . '\']'); + $token = (!empty($varrefs[1])) ? $this->generate_block_data_ref(substr($varrefs[1], 0, -1), true, $varrefs[2]) . '[\'' . $varrefs[3] . '\']' : (($varrefs[2]) ? '$this->_tpldata[\'DEFINE\'][\'.\'][\'' . $varrefs[3] . '\']' : '$this->_rootref[\'' . $varrefs[3] . '\']'); } - else if (preg_match('#^\.(([a-z0-9\-_]+\.?)+)$#s', $token, $varrefs)) + else if (preg_match('#^\.((?:[a-z0-9\-_]+\.?)+)$#s', $token, $varrefs)) { // Allow checking if loops are set with .loopname // It is also possible to check the loop count by doing for example - $_tok = $this->generate_block_data_ref($varrefs[1], false); - $token = "sizeof($_tok)"; + $blocks = explode('.', $varrefs[1]); + // If the block is nested, we have a reference that we can grab. + // If the block is not nested, we just go and grab the block from _tpldata + if (sizeof($blocks) > 1) + { + $block = array_pop($blocks); + $namespace = implode('.', $blocks); + $varref = $this->generate_block_data_ref($namespace, true); + // Add the block reference for the last child. + $varref .= "['" . $block . "']"; + } + else + { + $varref = '$this->_tpldata'; + // Add the block reference for the last child. + $varref .= "['" . $blocks[0] . "']"; + } + $token = "sizeof($varref)"; } break; @@ -491,7 +518,7 @@ class template_compile if (empty($match[2]) || (!isset($match[4]) && $op)) { - return; + return ''; } if (!$op) @@ -583,7 +610,7 @@ class template_compile } else { - $expr = "!($is_arg % 2)"; + $expr = "!($is_arg & 1)"; } break; @@ -596,7 +623,7 @@ class template_compile } else { - $expr = "($is_arg % 2)"; + $expr = "($is_arg & 1)"; } break; @@ -658,33 +685,42 @@ class template_compile // Get an array of the blocks involved. $blocks = explode('.', $blockname); $blockcount = sizeof($blocks) - 1; - $varref = '$this->_tpldata' . (($defop) ? '[\'DEFINE\']' : ''); - // Build up the string with everything but the last child. - for ($i = 0; $i < $blockcount; $i++) + // DEFINE is not an element of any referenced variable, we must use _tpldata to access it + if ($defop) { - $varref .= "['" . $blocks[$i] . "'][\$this->_" . $blocks[$i] . '_i]'; + $varref = '$this->_tpldata[\'DEFINE\']'; + // Build up the string with everything but the last child. + for ($i = 0; $i < $blockcount; $i++) + { + $varref .= "['" . $blocks[$i] . "'][\$_" . $blocks[$i] . '_i]'; + } + // Add the block reference for the last child. + $varref .= "['" . $blocks[$blockcount] . "']"; + // Add the iterator for the last child if requried. + if ($include_last_iterator) + { + $varref .= '[$_' . $blocks[$blockcount] . '_i]'; + } + return $varref; } - - // Add the block reference for the last child. - $varref .= "['" . $blocks[$blockcount] . "']"; - - // Add the iterator for the last child if requried. - if ($include_last_iterator) + else if ($include_last_iterator) { - $varref .= '[$this->_' . $blocks[$blockcount] . '_i]'; + return '$_'. $blocks[$blockcount] . '_val'; + } + else + { + return '$_'. $blocks[$blockcount - 1] . '_val[\''. $blocks[$blockcount]. '\']'; } - - return $varref; } /** * Write compiled file to cache directory * @access private */ - function compile_write(&$handle, $data) + function compile_write($handle, $data) { - global $phpEx, $user; + global $phpEx; $filename = $this->template->cachepath . str_replace('/', '.', $this->template->filename[$handle]) . '.' . $phpEx; diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php index 76a89869f5..97c92558b6 100644 --- a/phpBB/includes/template.php +++ b/phpBB/includes/template.php @@ -23,11 +23,12 @@ class template { /** variable that holds all the data we'll be substituting into * the compiled templates. Takes form: - * --> $this->_tpldata[block.][iteration#][child.][iteration#][child2.][iteration#][variablename] == value + * --> $this->_tpldata[block][iteration#][child][iteration#][child2][iteration#][variablename] == value * if it's a root-level variable, it'll be like this: * --> $this->_tpldata[.][0][varname] == value */ - var $_tpldata = array(); + var $_tpldata = array('.' => array(0 => array())); + var $_rootref; // Root dir and hash of filenames for each template handle. var $root = ''; @@ -55,6 +56,8 @@ class template trigger_error('Template path could not be found: styles/' . $user->theme['template_path'] . '/template', E_USER_ERROR); } + $this->_rootref = &$this->_tpldata['.'][0]; + return true; } @@ -104,7 +107,7 @@ class template */ function destroy() { - $this->_tpldata = array(); + $this->_tpldata = array('.' => array(0 => array())); } /** @@ -205,7 +208,7 @@ class template $compile = new template_compile($this); // If the file for this handle is already loaded and compiled, do nothing. - if (!empty($this->uncompiled_code[$handle])) + if (!empty($this->compiled_code[$handle])) { return true; } @@ -281,7 +284,7 @@ class template { foreach ($vararray as $key => $val) { - $this->_tpldata['.'][0][$key] = $val; + $this->_rootref[$key] = $val; } return true; @@ -293,7 +296,7 @@ class template */ function assign_var($varname, $varval) { - $this->_tpldata['.'][0][$varname] = $varval; + $this->_rootref[$varname] = $varval; return true; } From c4a7d130556f4422a95ebd5f8214d94f1a1325b1 Mon Sep 17 00:00:00 2001 From: David M Date: Sat, 23 Dec 2006 18:49:38 +0000 Subject: [PATCH 114/264] #6520 git-svn-id: file:///svn/phpbb/trunk@6797 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/search/fulltext_mysql.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 490b676906..f20962d11d 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -643,7 +643,7 @@ class fulltext_mysql extends search_backend if (!isset($this->stats['post_subject'])) { - if (version_compare($db->mysql_version, '4.1.3', '>=')) + if ($db->sql_layer == 'mysqli' || version_compare($db->mysql_version, '4.1.3', '>=')) { $alter[] = 'MODIFY post_subject varchar(100) COLLATE utf8_unicode_ci DEFAULT \'\' NOT NULL'; } @@ -652,7 +652,7 @@ class fulltext_mysql extends search_backend if (!isset($this->stats['post_text'])) { - if (version_compare($db->mysql_version, '4.1.3', '>=')) + if ($db->sql_layer == 'mysqli' || version_compare($db->mysql_version, '4.1.3', '>=')) { $alter[] = 'MODIFY post_text mediumtext COLLATE utf8_unicode_ci NOT NULL'; } From 8e72037e67f67076c87089a29948821cb6a5077e Mon Sep 17 00:00:00 2001 From: David M Date: Sat, 23 Dec 2006 19:06:53 +0000 Subject: [PATCH 115/264] #6414 git-svn-id: file:///svn/phpbb/trunk@6800 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/search/fulltext_native.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index 10c53d78cd..4ad0f8ae41 100755 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -953,10 +953,9 @@ class fulltext_native extends search_backend */ $word = strtok($this->cleanup(preg_replace($match, ' ', strip_tags($text)), -1), ' '); - while (isset($word[0])) + while (strlen($word)) { - if (isset($word[255]) - || !isset($word[$isset_min])) + if (strlen($word) > 255 || strlen($word) <= $isset_min) { /** * Words longer than 255 bytes are ignored. This will have to be From 49b8060b0c3cd8db11798a906d3acaf906e6a68d Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 24 Dec 2006 06:26:03 +0000 Subject: [PATCH 116/264] #6504 git-svn-id: file:///svn/phpbb/trunk@6801 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/posting.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/phpBB/posting.php b/phpBB/posting.php index fbc91b47b9..b05c051549 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -488,6 +488,18 @@ if ($save && $user->data['is_registered'] && $auth->acl_get('u_savedrafts')) confirm_box(false, 'SAVE_DRAFT', $s_hidden_fields); } } + else + { + if (!$subject) + { + $error[] = $user->lang['EMPTY_SUBJECT']; + } + + if (!$message) + { + $error[] = $user->lang['TOO_FEW_CHARS']; + } + } unset($subject, $message); } From 9cc0b364bcc9473d0b1f4656db9008a55921918b Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 24 Dec 2006 06:53:48 +0000 Subject: [PATCH 117/264] #6206 git-svn-id: file:///svn/phpbb/trunk@6802 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/mcp/mcp_main.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 135280c650..67f7441725 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -805,7 +805,7 @@ function mcp_fork_topic($topic_ids) } $to_forum_id = request_var('to_forum_id', 0); - $forum_id = request_var('forum_id', 0); + $forum_id = request_var('f', 0); $redirect = request_var('redirect', build_url(array('_f_', 'action', 'quickmod'))); $additional_msg = $success_msg = ''; From ae1cb0316e6c19d62f0579e9cef52f11df081bcf Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 24 Dec 2006 13:11:54 +0000 Subject: [PATCH 118/264] some fixes today - most important change is the consolidation of the display attachment functions; merging them together to have one function we need to call. git-svn-id: file:///svn/phpbb/trunk@6803 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/faq.php | 2 +- phpBB/includes/acp/acp_bots.php | 22 +- phpBB/includes/acp/acp_inactive.php | 20 +- phpBB/includes/functions.php | 298 +++++++++++++++++- phpBB/includes/functions_display.php | 268 ---------------- phpBB/includes/functions_messenger.php | 14 +- phpBB/includes/functions_module.php | 11 +- phpBB/includes/functions_user.php | 43 ++- phpBB/includes/mcp/mcp_queue.php | 12 +- phpBB/includes/mcp/mcp_topic.php | 15 + phpBB/includes/message_parser.php | 100 +++--- phpBB/includes/session.php | 29 +- phpBB/includes/ucp/ucp_pm_compose.php | 33 +- phpBB/includes/ucp/ucp_pm_viewmessage.php | 10 +- phpBB/install/install_install.php | 23 +- phpBB/install/schemas/schema_data.sql | 2 +- phpBB/posting.php | 15 +- phpBB/search.php | 4 +- .../template/posting_attach_body.html | 3 - phpBB/viewtopic.php | 10 +- 20 files changed, 506 insertions(+), 428 deletions(-) diff --git a/phpBB/faq.php b/phpBB/faq.php index a0976e7c67..b74ede66e4 100644 --- a/phpBB/faq.php +++ b/phpBB/faq.php @@ -32,7 +32,7 @@ switch ($mode) break; default: - $l_title = $user->lang['FAQ']; + $l_title = $user->lang['FAQ_EXPLAIN']; $user->add_lang('faq', false, true); break; } diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php index 7e1c31dc44..72fb40216d 100644 --- a/phpBB/includes/acp/acp_bots.php +++ b/phpBB/includes/acp/acp_bots.php @@ -181,17 +181,17 @@ class acp_bots } $user_id = user_add(array( - 'user_type' => (int) USER_IGNORE, - 'group_id' => (int) $group_row['group_id'], - 'username' => (string) $bot_row['bot_name'], - 'user_regdate' => time(), - 'user_password' => '', - 'user_colour' => (string) $group_row['group_colour'], - 'user_email' => '', - 'user_lang' => (string) $bot_row['bot_lang'], - 'user_style' => (int) $bot_row['bot_style'], - 'user_options' => 0) - ); + 'user_type' => (int) USER_IGNORE, + 'group_id' => (int) $group_row['group_id'], + 'username' => (string) $bot_row['bot_name'], + 'user_regdate' => time(), + 'user_password' => '', + 'user_colour' => (string) $group_row['group_colour'], + 'user_email' => '', + 'user_lang' => (string) $bot_row['bot_lang'], + 'user_style' => (int) $bot_row['bot_style'], + 'user_allow_massemail' => 0, + )); $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'user_id' => (int) $user_id, diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php index 84387b4f5c..5663979f1c 100755 --- a/phpBB/includes/acp/acp_inactive.php +++ b/phpBB/includes/acp/acp_inactive.php @@ -26,6 +26,8 @@ class acp_inactive global $config, $db, $user, $auth, $template; global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix; + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + $user->add_lang('memberlist'); $action = request_var('action', ''); @@ -43,7 +45,8 @@ class acp_inactive { case 'activate': case 'delete': - $sql = 'SELECT username + + $sql = 'SELECT user_id, username FROM ' . USERS_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $mark); $result = $db->sql_query($sql); @@ -51,13 +54,12 @@ class acp_inactive $user_affected = array(); while ($row = $db->sql_fetchrow($result)) { - $user_affected[] = $row['username']; + $user_affected[$row['user_id']] = $row['username']; } $db->sql_freeresult($result); if ($action == 'activate') { - include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx); user_active_flip('activate', $mark); } else if ($action == 'delete') @@ -67,14 +69,14 @@ class acp_inactive trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING); } - $sql = 'DELETE FROM ' . USER_GROUP_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $mark); - $db->sql_query($sql); - $sql = 'DELETE FROM ' . USERS_TABLE . ' WHERE ' . $db->sql_in_set('user_id', $mark); - $db->sql_query($sql); - - add_log('admin', 'LOG_INACTIVE_' . strtoupper($action), implode(', ', $user_affected)); + foreach ($mark as $user_id) + { + user_delete('retain', $user_id, $user_affected[$user_id]); + } } + add_log('admin', 'LOG_INACTIVE_' . strtoupper($action), implode(', ', $user_affected)); + break; case 'remind': diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 323590b269..aa5c766764 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1887,6 +1887,12 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa // append/replace SID (may change during the session for AOL users) $redirect = reapply_sid($redirect); + // Special case... the user is effectively banned, but we allow founders to login + if (defined('IN_CHECK_BAN') && $result['user_row']['user_type'] != USER_FOUNDER) + { + return; + } + meta_refresh(3, $redirect); trigger_error($message . '

' . sprintf($l_redirect, '', '')); } @@ -2439,24 +2445,288 @@ function smiley_text($text, $force_option = false) } /** -* Inline Attachment processing +* General attachment parsing +* +* @param int $forum_id The forum id the attachments are displayed in (0 for private messages) +* @param string &$message The post/private message +* @param array &$attachments The attachments to parse for (inline) display. The attachments array will hold templated data after parsing. +* @param array &$update_count The attachment counts to be updated - will be filled +* @param bool $preview If set to true the attachments are parsed for preview. Within preview mode the comments are fetched from the given $attachments array and not fetched from the database. */ -function parse_inline_attachments(&$text, &$attachments, &$update_count, $forum_id = 0, $preview = false) +function parse_attachments($forum_id, &$message, &$attachments, &$update_count, $preview = false) { - global $config, $user; - - if (!function_exists('display_attachments')) + if (!sizeof($attachments)) { - global $phpbb_root_path, $phpEx; - include("{$phpbb_root_path}includes/functions_display.$phpEx"); + return; } - $attachments = display_attachments($forum_id, NULL, $attachments, $update_count, false, true); + global $template, $cache, $user; + global $extensions, $config, $phpbb_root_path, $phpEx; + + // + $force_physical = false; + $compiled_attachments = array(); + + if (!isset($template->filename['attachment_tpl'])) + { + $template->set_filenames(array( + 'attachment_tpl' => 'attachment.html') + ); + } + + if (empty($extensions) || !is_array($extensions)) + { + $extensions = $cache->obtain_attach_extensions(); + } + + // Look for missing attachment information... + $attach_ids = array(); + foreach ($attachments as $pos => $attachment) + { + // If is_orphan is set, we need to retrieve the attachments again... + if (!isset($attachment['extension']) && !isset($attachment['physical_filename'])) + { + $attach_ids[(int) $attachment['attach_id']] = $pos; + } + } + + // Grab attachments (security precaution) + if (sizeof($attach_ids)) + { + global $db; + + $new_attachment_data = array(); + + $sql = 'SELECT * + FROM ' . ATTACHMENTS_TABLE . ' + WHERE ' . $db->sql_in_set('attach_id', array_keys($attach_ids)); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if (!isset($attach_ids[$row['attach_id']])) + { + continue; + } + + // If we preview attachments we will set some retrieved values here + if ($preview) + { + $row['attach_comment'] = $attachments[$attach_ids[$row['attach_id']]]['attach_comment']; + } + + $new_attachment_data[$attach_ids[$row['attach_id']]] = $row; + } + $db->sql_freeresult($result); + + $attachments = $new_attachment_data; + unset($new_attachment_data); + } + + // Sort correctly + if ($config['display_order']) + { + // Ascending sort + krsort($attachments); + } + else + { + // Descending sort + ksort($attachments); + } + + foreach ($attachments as $attachment) + { + if (!sizeof($attachment)) + { + continue; + } + + // We need to reset/empty the _file block var, because this function might be called more than once + $template->destroy_block_vars('_file'); + + $block_array = array(); + + // Some basics... + $attachment['extension'] = strtolower(trim($attachment['extension'])); + $filename = $phpbb_root_path . $config['upload_path'] . '/' . basename($attachment['physical_filename']); + $thumbnail_filename = $phpbb_root_path . $config['upload_path'] . '/thumb_' . basename($attachment['physical_filename']); + + $upload_icon = ''; + + if (isset($extensions[$attachment['extension']])) + { + if ($user->img('icon_topic_attach', '') && !$extensions[$attachment['extension']]['upload_icon']) + { + $upload_icon = $user->img('icon_topic_attach', ''); + } + else if ($extensions[$attachment['extension']]['upload_icon']) + { + $upload_icon = ''; + } + } + + $filesize = $attachment['filesize']; + $size_lang = ($filesize >= 1048576) ? $user->lang['MB'] : ( ($filesize >= 1024) ? $user->lang['KB'] : $user->lang['BYTES'] ); + $filesize = ($filesize >= 1048576) ? round((round($filesize / 1048576 * 100) / 100), 2) : (($filesize >= 1024) ? round((round($filesize / 1024 * 100) / 100), 2) : $filesize); + + $comment = str_replace("\n", '
', censor_text($attachment['attach_comment'])); + + $block_array += array( + 'UPLOAD_ICON' => $upload_icon, + 'FILESIZE' => $filesize, + 'SIZE_LANG' => $size_lang, + 'DOWNLOAD_NAME' => basename($attachment['real_filename']), + 'COMMENT' => $comment, + ); + + $denied = false; + + if (!extension_allowed($forum_id, $attachment['extension'], $extensions)) + { + $denied = true; + + $block_array += array( + 'S_DENIED' => true, + 'DENIED_MESSAGE' => sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension']) + ); + } + + if (!$denied) + { + $l_downloaded_viewed = $download_link = ''; + $display_cat = $extensions[$attachment['extension']]['display_cat']; + + if ($display_cat == ATTACHMENT_CATEGORY_IMAGE) + { + if ($attachment['thumbnail']) + { + $display_cat = ATTACHMENT_CATEGORY_THUMB; + } + else + { + if ($config['img_display_inlined']) + { + if ($config['img_link_width'] || $config['img_link_height']) + { + list($width, $height) = @getimagesize($filename); + + $display_cat = (!$width && !$height) ? ATTACHMENT_CATEGORY_IMAGE : (($width <= $config['img_link_width'] && $height <= $config['img_link_height']) ? ATTACHMENT_CATEGORY_IMAGE : ATTACHMENT_CATEGORY_NONE); + } + } + else + { + $display_cat = ATTACHMENT_CATEGORY_NONE; + } + } + } + + $download_link = (!$force_physical && $attachment['attach_id']) ? append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $attachment['attach_id'] . '&f=' . $forum_id) : $filename; + + switch ($display_cat) + { + // Images + case ATTACHMENT_CATEGORY_IMAGE: + $l_downloaded_viewed = $user->lang['VIEWED']; + + $block_array += array( + 'S_IMAGE' => true, + ); + + $update_count[] = $attachment['attach_id']; + break; + + // Images, but display Thumbnail + case ATTACHMENT_CATEGORY_THUMB: + $l_downloaded_viewed = $user->lang['VIEWED']; + $thumbnail_link = (!$force_physical && $attachment['attach_id']) ? append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $attachment['attach_id'] . '&t=1&f=' . $forum_id) : $thumbnail_filename; + + $block_array += array( + 'S_THUMBNAIL' => true, + 'THUMB_IMAGE' => $thumbnail_link, + ); + break; + + // Windows Media Streams + case ATTACHMENT_CATEGORY_WM: + $l_downloaded_viewed = $user->lang['VIEWED']; + + // Giving the filename directly because within the wm object all variables are in local context making it impossible + // to validate against a valid session (all params can differ) + $download_link = $filename; + + $block_array += array( + 'U_FORUM' => generate_board_url(), + 'S_WM_FILE' => true, + ); + + // Viewed/Heared File ... update the download count + $update_count[] = $attachment['attach_id']; + break; + + // Real Media Streams + case ATTACHMENT_CATEGORY_RM: + case ATTACHMENT_CATEGORY_QUICKTIME: + $l_downloaded_viewed = $user->lang['VIEWED']; + + $block_array += array( + 'S_RM_FILE' => ($display_cat == ATTACHMENT_CATEGORY_RM) ? true : false, + 'S_QUICKTIME_FILE' => ($display_cat == ATTACHMENT_CATEGORY_QUICKTIME) ? true : false, + 'U_FORUM' => generate_board_url(), + 'ATTACH_ID' => $attachment['attach_id'], + ); + + // Viewed/Heared File ... update the download count + $update_count[] = $attachment['attach_id']; + break; + + // Macromedia Flash Files + case ATTACHMENT_CATEGORY_FLASH: + list($width, $height) = @getimagesize($filename); + + $l_downloaded_viewed = $user->lang['VIEWED']; + + $block_array += array( + 'S_FLASH_FILE' => true, + 'WIDTH' => $width, + 'HEIGHT' => $height, + ); + + // Viewed/Heared File ... update the download count + $update_count[] = $attachment['attach_id']; + break; + + default: + $l_downloaded_viewed = $user->lang['DOWNLOADED']; + + $block_array += array( + 'S_FILE' => true, + ); + break; + } + + $l_download_count = (!isset($attachment['download_count']) || $attachment['download_count'] == 0) ? $user->lang['DOWNLOAD_NONE'] : (($attachment['download_count'] == 1) ? sprintf($user->lang['DOWNLOAD_COUNT'], $attachment['download_count']) : sprintf($user->lang['DOWNLOAD_COUNTS'], $attachment['download_count'])); + + $block_array += array( + 'U_DOWNLOAD_LINK' => $download_link, + 'L_DOWNLOADED_VIEWED' => $l_downloaded_viewed, + 'L_DOWNLOAD_COUNT' => $l_download_count + ); + } + + $template->assign_block_vars('_file', $block_array); + + $compiled_attachments[] = $template->assign_display('attachment_tpl'); + } + + $attachments = $compiled_attachments; + unset($compiled_attachments); + $tpl_size = sizeof($attachments); $unset_tpl = array(); - preg_match_all('#(.*?)#', $text, $matches, PREG_PATTERN_ORDER); + preg_match_all('#(.*?)#', $message, $matches, PREG_PATTERN_ORDER); $replace = array(); foreach ($matches[0] as $num => $capture) @@ -2472,10 +2742,16 @@ function parse_inline_attachments(&$text, &$attachments, &$update_count, $forum_ if (isset($replace['from'])) { - $text = str_replace($replace['from'], $replace['to'], $text); + $message = str_replace($replace['from'], $replace['to'], $message); } - return array_unique($unset_tpl); + $unset_tpl = array_unique($unset_tpl); + + // Needed to let not display the inlined attachments at the end of the post again + foreach ($unset_tpl as $index) + { + unset($attachments[$index]); + } } /** diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 4c16029803..242eb871ae 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -688,274 +688,6 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold } } -/** -* Display Attachments -*/ -function display_attachments($forum_id, $blockname, &$attachment_data, &$update_count, $force_physical = false, $return = false) -{ - global $template, $cache, $user; - global $extensions, $config, $phpbb_root_path, $phpEx; - - $return_tpl = array(); - - $template->set_filenames(array( - 'attachment_tpl' => 'attachment.html') - ); - - if (!sizeof($attachment_data)) - { - return array(); - } - - if (empty($extensions) || !is_array($extensions)) - { - $extensions = $cache->obtain_attach_extensions(); - } - - // Look for missing attachment information... - $attach_ids = array(); - foreach ($attachment_data as $pos => $attachment) - { - // If is_orphan is set, we need to retrieve the attachments again... - if (!isset($attachment['extension']) && !isset($attachment['physical_filename'])) - { - $attach_ids[(int) $attachment['attach_id']] = $pos; - } - } - - if (sizeof($attach_ids)) - { - global $db; - - $attachment_data = array(); - - $sql = 'SELECT * - FROM ' . ATTACHMENTS_TABLE . ' - WHERE ' . $db->sql_in_set('attach_id', array_keys($attach_ids)); - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - if (!isset($attach_ids[$row['attach_id']])) - { - continue; - } - - $attachment_data[$attach_ids[$row['attach_id']]] = $row; - } - $db->sql_freeresult($result); - } - - // Sort correctly (please note that the attachment_data array itself get changed by this - if ($config['display_order']) - { - // Ascending sort - krsort($attachment_data); - } - else - { - // Descending sort - ksort($attachment_data); - } - - foreach ($attachment_data as $attachment) - { - if (!sizeof($attachment)) - { - continue; - } - - // We need to reset/empty the _file block var, because this function might be called more than once - $template->destroy_block_vars('_file'); - - $block_array = array(); - - // Some basics... - $attachment['extension'] = strtolower(trim($attachment['extension'])); - $filename = $phpbb_root_path . $config['upload_path'] . '/' . basename($attachment['physical_filename']); - $thumbnail_filename = $phpbb_root_path . $config['upload_path'] . '/thumb_' . basename($attachment['physical_filename']); - - $upload_icon = ''; - - if (isset($extensions[$attachment['extension']])) - { - if ($user->img('icon_topic_attach', '') && !$extensions[$attachment['extension']]['upload_icon']) - { - $upload_icon = $user->img('icon_topic_attach', ''); - } - else if ($extensions[$attachment['extension']]['upload_icon']) - { - $upload_icon = ''; - } - } - - $filesize = $attachment['filesize']; - $size_lang = ($filesize >= 1048576) ? $user->lang['MB'] : ( ($filesize >= 1024) ? $user->lang['KB'] : $user->lang['BYTES'] ); - $filesize = ($filesize >= 1048576) ? round((round($filesize / 1048576 * 100) / 100), 2) : (($filesize >= 1024) ? round((round($filesize / 1024 * 100) / 100), 2) : $filesize); - - $comment = str_replace("\n", '
', censor_text($attachment['attach_comment'])); - - $block_array += array( - 'UPLOAD_ICON' => $upload_icon, - 'FILESIZE' => $filesize, - 'SIZE_LANG' => $size_lang, - 'DOWNLOAD_NAME' => basename($attachment['real_filename']), - 'COMMENT' => $comment, - ); - - $denied = false; - - if (!extension_allowed($forum_id, $attachment['extension'], $extensions)) - { - $denied = true; - - $block_array += array( - 'S_DENIED' => true, - 'DENIED_MESSAGE' => sprintf($user->lang['EXTENSION_DISABLED_AFTER_POSTING'], $attachment['extension']) - ); - } - - if (!$denied) - { - $l_downloaded_viewed = $download_link = ''; - $display_cat = $extensions[$attachment['extension']]['display_cat']; - - if ($display_cat == ATTACHMENT_CATEGORY_IMAGE) - { - if ($attachment['thumbnail']) - { - $display_cat = ATTACHMENT_CATEGORY_THUMB; - } - else - { - if ($config['img_display_inlined']) - { - if ($config['img_link_width'] || $config['img_link_height']) - { - list($width, $height) = @getimagesize($filename); - - $display_cat = (!$width && !$height) ? ATTACHMENT_CATEGORY_IMAGE : (($width <= $config['img_link_width'] && $height <= $config['img_link_height']) ? ATTACHMENT_CATEGORY_IMAGE : ATTACHMENT_CATEGORY_NONE); - } - } - else - { - $display_cat = ATTACHMENT_CATEGORY_NONE; - } - } - } - - $download_link = (!$force_physical && $attachment['attach_id']) ? append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $attachment['attach_id'] . '&f=' . $forum_id) : $filename; - - switch ($display_cat) - { - // Images - case ATTACHMENT_CATEGORY_IMAGE: - $l_downloaded_viewed = $user->lang['VIEWED']; - - $block_array += array( - 'S_IMAGE' => true, - ); - - $update_count[] = $attachment['attach_id']; - break; - - // Images, but display Thumbnail - case ATTACHMENT_CATEGORY_THUMB: - $l_downloaded_viewed = $user->lang['VIEWED']; - $thumbnail_link = (!$force_physical && $attachment['attach_id']) ? append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $attachment['attach_id'] . '&t=1&f=' . $forum_id) : $thumbnail_filename; - - $block_array += array( - 'S_THUMBNAIL' => true, - 'THUMB_IMAGE' => $thumbnail_link, - ); - break; - - // Windows Media Streams - case ATTACHMENT_CATEGORY_WM: - $l_downloaded_viewed = $user->lang['VIEWED']; - - // Giving the filename directly because within the wm object all variables are in local context making it impossible - // to validate against a valid session (all params can differ) - $download_link = $filename; - - $block_array += array( - 'U_FORUM' => generate_board_url(), - 'S_WM_FILE' => true, - ); - - // Viewed/Heared File ... update the download count - $update_count[] = $attachment['attach_id']; - break; - - // Real Media Streams - case ATTACHMENT_CATEGORY_RM: - case ATTACHMENT_CATEGORY_QUICKTIME: - $l_downloaded_viewed = $user->lang['VIEWED']; - - $block_array += array( - 'S_RM_FILE' => ($display_cat == ATTACHMENT_CATEGORY_RM) ? true : false, - 'S_QUICKTIME_FILE' => ($display_cat == ATTACHMENT_CATEGORY_QUICKTIME) ? true : false, - 'U_FORUM' => generate_board_url(), - 'ATTACH_ID' => $attachment['attach_id'], - ); - - // Viewed/Heared File ... update the download count - $update_count[] = $attachment['attach_id']; - break; - - // Macromedia Flash Files - case ATTACHMENT_CATEGORY_FLASH: - list($width, $height) = @getimagesize($filename); - - $l_downloaded_viewed = $user->lang['VIEWED']; - - $block_array += array( - 'S_FLASH_FILE' => true, - 'WIDTH' => $width, - 'HEIGHT' => $height, - ); - - // Viewed/Heared File ... update the download count - $update_count[] = $attachment['attach_id']; - break; - - default: - $l_downloaded_viewed = $user->lang['DOWNLOADED']; - - $block_array += array( - 'S_FILE' => true, - ); - break; - } - - $l_download_count = (!isset($attachment['download_count']) || $attachment['download_count'] == 0) ? $user->lang['DOWNLOAD_NONE'] : (($attachment['download_count'] == 1) ? sprintf($user->lang['DOWNLOAD_COUNT'], $attachment['download_count']) : sprintf($user->lang['DOWNLOAD_COUNTS'], $attachment['download_count'])); - - $block_array += array( - 'U_DOWNLOAD_LINK' => $download_link, - 'L_DOWNLOADED_VIEWED' => $l_downloaded_viewed, - 'L_DOWNLOAD_COUNT' => $l_download_count - ); - } - - $template->assign_block_vars('_file', $block_array); - - $tpl = $template->assign_display('attachment_tpl'); - - if (!$return) - { - $template->assign_block_vars($blockname, array( - 'DISPLAY_ATTACHMENT' => $tpl) - ); - } - else - { - $return_tpl[] = $tpl; - } - } - - return $return_tpl; -} - /** * Assign/Build custom bbcodes for display in screens supporting using of bbcodes * The custom bbcodes buttons will be placed within the template block 'custom_codes' diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 7296a8c283..f2ad76f892 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -45,9 +45,21 @@ class messenger */ function to($address, $realname = '') { + global $config; + $pos = isset($this->addresses['to']) ? sizeof($this->addresses['to']) : 0; + $this->addresses['to'][$pos]['email'] = trim($address); - $this->addresses['to'][$pos]['name'] = trim($realname); + + // If empty sendmail_path on windows, PHP changes the to line + if (!$config['smtp_delivery'] && strpos(strtolower(PHP_OS), 'win') === 0) + { + $this->addresses['to'][$pos]['name'] = ''; + } + else + { + $this->addresses['to'][$pos]['name'] = trim($realname); + } } /** diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index 22312b8d76..ca47ef2f89 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -69,6 +69,11 @@ class p_master $cache->put('_modules_' . $this->p_class, $this->module_cache); } + if (empty($this->module_cache)) + { + $this->module_cache = array('modules' => array(), 'parents' => array()); + } + // We "could" build a true tree with this function - maybe mod authors want to use this... // Functions for traversing and manipulating the tree are not available though // We might re-structure the module system to use true trees in 3.2.x... @@ -370,7 +375,7 @@ class p_master if (defined('IN_ADMIN')) { // Not being able to overwrite ;) - $this->module->u_action = append_sid("{$phpbb_admin_path}index.$phpEx", "i={$this->p_id}") . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}"; + $this->module->u_action = append_sid("{$phpbb_admin_path}index.$phpEx", "i={$this->p_name}") . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}"; } else { @@ -384,7 +389,7 @@ class p_master $this->module->u_action = $phpbb_root_path . (($user->page['page_dir']) ? $user->page['page_dir'] . '/' : '') . $user->page['page_name']; } - $this->module->u_action = append_sid($this->module->u_action, "i={$this->p_id}") . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}"; + $this->module->u_action = append_sid($this->module->u_action, "i={$this->p_name}") . (($icat) ? '&icat=' . $icat : '') . "&mode={$this->p_mode}"; } // Assign the module path for re-usage @@ -394,7 +399,7 @@ class p_master // Users are able to call the main method after this function to be able to assign additional parameters manually if ($execute_module) { - $this->module->main(($this->p_name) ? $this->p_name : $this->p_id, $this->p_mode); + $this->module->main($this->p_name, $this->p_mode); } return; diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 55725b2cfd..1d11f00298 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -275,6 +275,18 @@ function user_delete($mode, $user_id, $post_username = false) global $cache, $config, $db, $user, $auth; global $phpbb_root_path, $phpEx; + $sql = 'SELECT * + FROM ' . USERS_TABLE . ' + WHERE user_id = ' . $user_id; + $result = $db->sql_query($sql); + $user_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$user_row) + { + return false; + } + $db->sql_transaction('begin'); switch ($mode) @@ -312,18 +324,12 @@ function user_delete($mode, $user_id, $post_username = false) $db->sql_query($sql); // Since we change every post by this author, we need to count this amount towards the anonymous user - $sql = 'SELECT user_posts - FROM ' . USERS_TABLE . ' - WHERE user_id = ' . $user_id; - $result = $db->sql_query($sql); - $num_posts = (int) $db->sql_fetchfield('user_posts'); - $db->sql_freeresult($result); // Update the post count for the anonymous user - if ($num_posts) + if ($user_row['user_posts']) { $sql = 'UPDATE ' . USERS_TABLE . ' - SET user_posts = user_posts + ' . $num_posts . ' + SET user_posts = user_posts + ' . $user_row['user_posts'] . ' WHERE user_id = ' . ANONYMOUS; $db->sql_query($sql); } @@ -333,7 +339,7 @@ function user_delete($mode, $user_id, $post_username = false) if (!function_exists('delete_posts')) { - include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); } $sql = 'SELECT topic_id, COUNT(post_id) AS total_posts @@ -391,8 +397,6 @@ function user_delete($mode, $user_id, $post_username = false) $cache->destroy('sql', MODERATOR_CACHE_TABLE); - include_once($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); - // Remove any undelivered mails... $sql = 'SELECT msg_id, user_id FROM ' . PRIVMSGS_TO_TABLE . ' @@ -456,7 +460,11 @@ function user_delete($mode, $user_id, $post_username = false) update_last_username(); } - set_config('num_users', $config['num_users'] - 1, true); + // Decrement number of users if this user is active + if ($user_row['user_type'] != USER_INACTIVE && $user_row['user_type'] != USER_IGNORE) + { + set_config('num_users', $config['num_users'] - 1, true); + } $db->sql_transaction('commit'); @@ -1247,7 +1255,7 @@ function validate_email($email) { list(, $domain) = explode('@', $email); - if (phpbb_checkdnsrr($domain, 'MX') === false) + if (phpbb_checkdnsrr($domain, 'A') === false && phpbb_checkdnsrr($domain, 'MX') === false) { return 'DOMAIN_NO_MX_RECORD'; } @@ -1603,12 +1611,19 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow $sql = 'UPDATE ' . GROUPS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE group_id = $group_id"; + $db->sql_query($sql); + + // Since we may update the name too, we need to do this on other tables too... + $sql = 'UPDATE ' . MODERATOR_CACHE_TABLE . " + SET group_name = '" . $db->sql_escape($sql_ary['group_name']) . "' + WHERE group_id = $group_id"; + $db->sql_query($sql); } else { $sql = 'INSERT INTO ' . GROUPS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); } - $db->sql_query($sql); if (!$group_id) { diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 3fd7e6d856..48756c640e 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -50,11 +50,11 @@ class mcp_queue if ($action == 'approve') { - approve_post($post_id_list, $mode); + approve_post($post_id_list, 'queue', $mode); } else { - disapprove_post($post_id_list, $mode); + disapprove_post($post_id_list, 'queue', $mode); } break; @@ -372,7 +372,7 @@ class mcp_queue /** * Approve Post/Topic */ -function approve_post($post_id_list, $mode) +function approve_post($post_id_list, $id, $mode) { global $db, $template, $user, $config; global $phpEx, $phpbb_root_path; @@ -386,7 +386,7 @@ function approve_post($post_id_list, $mode) $success_msg = ''; $s_hidden_fields = build_hidden_fields(array( - 'i' => 'queue', + 'i' => $id, 'mode' => $mode, 'post_id_list' => $post_id_list, 'action' => 'approve', @@ -617,7 +617,7 @@ function approve_post($post_id_list, $mode) /** * Disapprove Post/Topic */ -function disapprove_post($post_id_list, $mode) +function disapprove_post($post_id_list, $id, $mode) { global $db, $template, $user, $config; global $phpEx, $phpbb_root_path; @@ -633,7 +633,7 @@ function disapprove_post($post_id_list, $mode) $success_msg = $additional_msg = ''; $s_hidden_fields = build_hidden_fields(array( - 'i' => 'queue', + 'i' => $id, 'mode' => $mode, 'post_id_list' => $post_id_list, 'action' => 'disapprove', diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index bc0d18afbd..4ad8efeda3 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -57,6 +57,21 @@ function mcp_topic_view($id, $mode, $action) $subject = $topic_info['topic_title']; } + // Approve posts? + if ($action == 'approve' && $auth->acl_get('m_approve', $topic_info['forum_id'])) + { + include($phpbb_root_path . 'includes/mcp/mcp_queue.' . $phpEx); + include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx); + include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx); + + if (!sizeof($post_id_list)) + { + trigger_error('NO_POST_SELECTED'); + } + + approve_post($post_id_list, $id, $mode); + } + // Jumpbox, sort selects and that kind of things make_jumpbox($url . "&i=$id&mode=forum_view", $topic_info['forum_id'], false, 'm_'); $where_sql = ($action == 'reports') ? 'WHERE post_reported = 1 AND ' : 'WHERE'; diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 251e736a14..c139af5ef7 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -1213,7 +1213,22 @@ class parse_message extends bbcode_firstpass $add_file = (isset($_POST['add_file'])) ? true : false; $delete_file = (isset($_POST['delete_file'])) ? true : false; - $edit_comment = (isset($_POST['edit_comment'])) ? true : false; + + // First of all adjust comments if changed + $actual_comment_list = utf8_normalize_nfc(request_var('comment_list', array(''), true)); + + foreach ($actual_comment_list as $comment_key => $comment) + { + if (!isset($this->attachment_data[$comment_key])) + { + continue; + } + + if ($this->attachment_data[$comment_key]['attach_comment'] != $actual_comment_list[$comment_key]) + { + $this->attachment_data[$comment_key]['attach_comment'] = $actual_comment_list[$comment_key]; + } + } $cfg = array(); $cfg['max_attachments'] = ($is_message) ? $config['max_attachments_pm'] : $config['max_attachments']; @@ -1284,7 +1299,6 @@ class parse_message extends bbcode_firstpass if (!empty($this->attachment_data[$index])) { - // delete selected attachment if ($this->attachment_data[$index]['is_orphan']) { @@ -1321,58 +1335,46 @@ class parse_message extends bbcode_firstpass $this->attachment_data = array_values($this->attachment_data); } } - else if ($edit_comment || $add_file || $preview) + else if (($add_file || $preview) && $upload_file) { - if ($edit_comment) + if ($num_attachments < $cfg['max_attachments'] || $auth->acl_gets('m_', 'a_', $forum_id)) { - $actual_comment_list = utf8_normalize_nfc(request_var('comment_list', array(''), true)); + $filedata = upload_attachment($form_name, $forum_id, false, '', $is_message); + $error = array_merge($error, $filedata['error']); - $edit_comment = request_var('edit_comment', array(0 => '')); - $edit_comment = key($edit_comment); - $this->attachment_data[$edit_comment]['attach_comment'] = $actual_comment_list[$edit_comment]; + if (!sizeof($error)) + { + $sql_ary = array( + 'physical_filename' => $filedata['physical_filename'], + 'attach_comment' => $this->filename_data['filecomment'], + 'real_filename' => $filedata['real_filename'], + 'extension' => $filedata['extension'], + 'mimetype' => $filedata['mimetype'], + 'filesize' => $filedata['filesize'], + 'filetime' => $filedata['filetime'], + 'thumbnail' => $filedata['thumbnail'], + 'is_orphan' => 1, + 'in_message' => ($is_message) ? 1 : 0, + 'poster_id' => $user->data['user_id'], + ); + + $db->sql_query('INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); + + $new_entry = array( + 'attach_id' => $db->sql_nextid(), + 'is_orphan' => 1, + 'real_filename' => $filedata['real_filename'], + 'attach_comment'=> $this->filename_data['filecomment'], + ); + + $this->attachment_data = array_merge(array(0 => $new_entry), $this->attachment_data); + $this->message = preg_replace('#\[attachment=([0-9]+)\](.*?)\[\/attachment\]#e', "'[attachment='.(\\1 + 1).']\\2[/attachment]'", $this->message); + $this->filename_data['filecomment'] = ''; + } } - - if (($add_file || $preview) && $upload_file) + else { - if ($num_attachments < $cfg['max_attachments'] || $auth->acl_gets('m_', 'a_', $forum_id)) - { - $filedata = upload_attachment($form_name, $forum_id, false, '', $is_message); - $error = array_merge($error, $filedata['error']); - - if (!sizeof($error)) - { - $sql_ary = array( - 'physical_filename' => $filedata['physical_filename'], - 'attach_comment' => $this->filename_data['filecomment'], - 'real_filename' => $filedata['real_filename'], - 'extension' => $filedata['extension'], - 'mimetype' => $filedata['mimetype'], - 'filesize' => $filedata['filesize'], - 'filetime' => $filedata['filetime'], - 'thumbnail' => $filedata['thumbnail'], - 'is_orphan' => 1, - 'in_message' => ($is_message) ? 1 : 0, - 'poster_id' => $user->data['user_id'], - ); - - $db->sql_query('INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); - - $new_entry = array( - 'attach_id' => $db->sql_nextid(), - 'is_orphan' => 1, - 'real_filename' => $filedata['real_filename'], - 'attach_comment'=> $this->filename_data['filecomment'], - ); - - $this->attachment_data = array_merge(array(0 => $new_entry), $this->attachment_data); - $this->message = preg_replace('#\[attachment=([0-9]+)\](.*?)\[\/attachment\]#e', "'[attachment='.(\\1 + 1).']\\2[/attachment]'", $this->message); - $this->filename_data['filecomment'] = ''; - } - } - else - { - $error[] = sprintf($user->lang['TOO_MANY_ATTACHMENTS'], $cfg['max_attachments']); - } + $error[] = sprintf($user->lang['TOO_MANY_ATTACHMENTS'], $cfg['max_attachments']); } } } diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index e11245ec0c..5ab9cf618d 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -651,7 +651,7 @@ class session * and update the users information from the relevant session data. It will then * grab guest user information. */ - function session_kill() + function session_kill($new_session = true) { global $SID, $_SID, $db, $config, $phpbb_root_path, $phpEx; @@ -712,7 +712,10 @@ class session $this->session_id = $_SID = ''; // To make sure a valid session is created we create one for the anonymous user - $this->session_create(ANONYMOUS); + if ($new_session) + { + $this->session_create(ANONYMOUS); + } return true; } @@ -820,6 +823,11 @@ class session { global $config, $db; + if (defined('IN_CHECK_BAN')) + { + return; + } + $banned = false; $sql = 'SELECT ban_ip, ban_userid, ban_email, ban_exclude, ban_give_reason, ban_end @@ -927,6 +935,23 @@ class session $this->session_kill(); } + // We show a login box here to allow founders accessing the board if banned by IP + if (defined('IN_LOGIN') && $this->data['user_id'] == ANONYMOUS) + { + global $phpEx; + + // Set as a precaution to allow login_box() handling this case correctly as well as this function not being executed again. + define('IN_CHECK_BAN', 1); + + $this->setup('ucp'); + $this->data['is_registered'] = $this->data['is_bot'] = false; + + login_box("index.$phpEx"); + + // The false here is needed, else the user is able to circumvent the ban. + $this->session_kill(false); + } + // Determine which message to output $till_date = ($ban_row['ban_end']) ? $this->format_date($ban_row['ban_end']) : ''; $message = ($ban_row['ban_end']) ? 'BOARD_BAN_TIME' : 'BOARD_BAN_PERM'; diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 8fa5de090f..0dd85c06ae 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -48,7 +48,7 @@ function compose_pm($id, $mode, $action) $add_to = (isset($_REQUEST['add_to'])) ? true : false; $add_bcc = (isset($_REQUEST['add_bcc'])) ? true : false; - $refresh = isset($_POST['add_file']) || isset($_POST['delete_file']) || isset($_POST['edit_comment']) || $save || $load + $refresh = isset($_POST['add_file']) || isset($_POST['delete_file']) || $save || $load || $remove_u || $remove_g || $add_to || $add_bcc; $action = ($delete && !$preview && !$refresh && $submit) ? 'delete' : $action; @@ -514,14 +514,17 @@ function compose_pm($id, $mode, $action) } // Subject defined - if (!$subject && !($remove_u || $remove_g || $add_to || $add_bcc)) + if ($submit) { - $error[] = $user->lang['EMPTY_SUBJECT']; - } + if (!$subject) + { + $error[] = $user->lang['EMPTY_SUBJECT']; + } - if (!sizeof($address_list)) - { - $error[] = $user->lang['NO_RECIPIENT']; + if (!sizeof($address_list)) + { + $error[] = $user->lang['NO_RECIPIENT']; + } } if (sizeof($message_parser->warn_msg) && !($remove_u || $remove_g || $add_to || $add_bcc)) @@ -597,10 +600,20 @@ function compose_pm($id, $mode, $action) // Attachment Preview if (sizeof($message_parser->attachment_data)) { - $extensions = $update_count = array(); - $template->assign_var('S_HAS_ATTACHMENTS', true); - display_attachments(0, 'attachment', $message_parser->attachment_data, $update_count); + + $update_count = array(); + $attachment_data = $message_parser->attachment_data; + + parse_attachments(0, $preview_message, $attachment_data, $update_count, true); + + foreach ($attachment_data as $i => $attachment) + { + $template->assign_block_vars('attachment', array( + 'DISPLAY_ATTACHMENT' => $attachment) + ); + } + unset($attachment_data); } $preview_subject = censor_text($subject); diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 2ddd5766d4..d87acfee69 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -117,16 +117,10 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) } // Assign inline attachments - if (isset($attachments) && sizeof($attachments)) + if (!empty($attachments)) { $update_count = array(); - $unset_attachments = parse_inline_attachments($message, $attachments, $update_count, 0); - - // Needed to let not display the inlined attachments at the end of the message again - foreach ($unset_attachments as $index) - { - unset($attachments[$index]); - } + parse_attachments(0, $message, $attachments, $update_count); // Update the attachment download counts if (sizeof($update_count)) diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index dd20987c04..a9ce326b88 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -1670,17 +1670,18 @@ class install_install extends module foreach ($this->bot_list as $bot_name => $bot_ary) { $user_row = array( - 'user_type' => USER_IGNORE, - 'group_id' => $group_id, - 'username' => $bot_name, - 'user_regdate' => time(), - 'user_password' => '', - 'user_colour' => '9E8DA7', - 'user_email' => '', - 'user_lang' => $default_lang, - 'user_style' => 1, - 'user_timezone' => 0, - 'user_dateformat' => $lang['default_dateformat'], + 'user_type' => USER_IGNORE, + 'group_id' => $group_id, + 'username' => $bot_name, + 'user_regdate' => time(), + 'user_password' => '', + 'user_colour' => '9E8DA7', + 'user_email' => '', + 'user_lang' => $default_lang, + 'user_style' => 1, + 'user_timezone' => 0, + 'user_dateformat' => $lang['default_dateformat'], + 'user_allow_massemail' => 0, ); $user_id = user_add($user_row); diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 88d4a08d14..916a9a12d7 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -396,7 +396,7 @@ INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id, forum_type, forum_posts, forum_topics, forum_topics_real, forum_last_post_id, forum_last_poster_id, forum_last_poster_name, forum_last_poster_colour, forum_last_post_subject, forum_last_post_time, forum_link, forum_password, forum_image, forum_rules, forum_rules_link, forum_rules_uid, forum_desc_uid, prune_days, prune_viewed, forum_parents) VALUES ('Test Forum 1', 'This is just a test forum.', 2, 3, 1, 1, 1, 1, 1, 1, 2, 'Admin', 'AA0000', 'Welcome to phpBB 3', 972086460, '', '', '', '', '', '', '', 0, 0, ''); # -- Users / Anonymous user -INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ, user_interests, user_actkey, user_newpasswd) VALUES (2, 1, 'Anonymous', 'anonymous', 0, '', '', 'en', 1, 0, '', 0, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', '', '', '', '', '', '', '', ''); +INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ, user_interests, user_actkey, user_newpasswd, user_allow_massemail) VALUES (2, 1, 'Anonymous', 'anonymous', 0, '', '', 'en', 1, 0, '', 0, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 0); # -- username: Admin password: admin (change this or remove it once everything is working!) INSERT INTO phpbb_users (user_type, group_id, username, username_clean, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ, user_interests, user_actkey, user_newpasswd) VALUES (3, 5, 'Admin', 'admin', 0, '21232f297a57a5a743894a0e4a801fc3', 'admin@yourdomain.com', 'en', 1, 1, 'AA0000', 1, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', '', '', '', '', '', '', '', ''); diff --git a/phpBB/posting.php b/phpBB/posting.php index b05c051549..1afd964b38 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -39,7 +39,7 @@ $load = (isset($_POST['load'])) ? true : false; $delete = (isset($_POST['delete'])) ? true : false; $cancel = (isset($_POST['cancel']) && !isset($_POST['save'])) ? true : false; -$refresh = (isset($_POST['add_file']) || isset($_POST['delete_file']) || isset($_POST['edit_comment']) || isset($_POST['cancel_unglobalise']) || $save || $load) ? true : false; +$refresh = (isset($_POST['add_file']) || isset($_POST['delete_file']) || isset($_POST['cancel_unglobalise']) || $save || $load) ? true : false; $mode = ($delete && !$preview && !$refresh && $submit) ? 'delete' : request_var('mode', ''); $error = $post_data = array(); @@ -733,7 +733,7 @@ if ($submit || $preview || $refresh) } // Parse subject - if (!$refresh && !$post_data['post_subject'] && ($mode == 'post' || ($mode == 'edit' && $post_data['topic_first_post_id'] == $post_id))) + if (!$preview && !$refresh && !$post_data['post_subject'] && ($mode == 'post' || ($mode == 'edit' && $post_data['topic_first_post_id'] == $post_id))) { $error[] = $user->lang['EMPTY_SUBJECT']; } @@ -999,17 +999,12 @@ if (!sizeof($error) && $preview) // Attachment Preview if (sizeof($message_parser->attachment_data)) { - $extensions = $update_count = array(); - $template->assign_var('S_HAS_ATTACHMENTS', true); + $update_count = array(); $attachment_data = $message_parser->attachment_data; - $unset_attachments = parse_inline_attachments($preview_message, $attachment_data, $update_count, $forum_id, true); - foreach ($unset_attachments as $index) - { - unset($attachment_data[$index]); - } + parse_attachments($forum_id, $preview_message, $attachment_data, $update_count, true); foreach ($attachment_data as $i => $attachment) { @@ -1017,7 +1012,7 @@ if (!sizeof($error) && $preview) 'DISPLAY_ATTACHMENT' => $attachment) ); } - unset($attachment_data, $attachment); + unset($attachment_data); } if (!sizeof($error)) diff --git a/phpBB/search.php b/phpBB/search.php index d0575bdc3c..e86e1bea68 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -822,9 +822,9 @@ if ($keywords || $author || $author_id || $search_id || $submit) $bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']); } - if (isset($attachments[$row['post_id']]) && sizeof($attachments[$row['post_id']])) + if (!empty($attachments[$row['post_id']])) { - parse_inline_attachments($message, $attachments[$row['post_id']], $update_count, $forum_id); + parse_attachments($forum_id, $message, $attachments[$row['post_id']], $update_count); // we only display inline attachments unset($attachments[$row['post_id']]); diff --git a/phpBB/styles/subSilver/template/posting_attach_body.html b/phpBB/styles/subSilver/template/posting_attach_body.html index 6510b8f706..3c9e93a45c 100644 --- a/phpBB/styles/subSilver/template/posting_attach_body.html +++ b/phpBB/styles/subSilver/template/posting_attach_body.html @@ -68,9 +68,6 @@
- + diff --git a/phpBB/styles/subSilver/theme/stylesheet.css b/phpBB/styles/subSilver/theme/stylesheet.css index 066b051cc5..769fe4d092 100644 --- a/phpBB/styles/subSilver/theme/stylesheet.css +++ b/phpBB/styles/subSilver/theme/stylesheet.css @@ -12,8 +12,6 @@ -------------------------------------------------------------- */ - - /* Layout ------------ */ * { diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 43a5108a55..73d8c161bc 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -480,7 +480,7 @@ $icons = $cache->obtain_icons(); $extensions = array(); if ($topic_data['topic_attachment']) { - $extensions = $cache->obtain_attach_extensions(); + $extensions = $cache->obtain_attach_extensions($forum_id); } // Forum rules listing From 69ef685cde40bb014e8e5a3872baa77136bdd7fb Mon Sep 17 00:00:00 2001 From: David M Date: Thu, 28 Dec 2006 14:27:19 +0000 Subject: [PATCH 132/264] #6642 git-svn-id: file:///svn/phpbb/trunk@6817 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/template.php | 6 ------ 1 file changed, 6 deletions(-) diff --git a/phpBB/includes/template.php b/phpBB/includes/template.php index 97c92558b6..a2e04e4ab4 100644 --- a/phpBB/includes/template.php +++ b/phpBB/includes/template.php @@ -207,12 +207,6 @@ class template $compile = new template_compile($this); - // If the file for this handle is already loaded and compiled, do nothing. - if (!empty($this->compiled_code[$handle])) - { - return true; - } - // If we don't have a file assigned to this handle, die. if (!isset($this->files[$handle])) { From d6ef968a679f97e60d62bfae7ac2856cb8334591 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 28 Dec 2006 16:21:17 +0000 Subject: [PATCH 133/264] - made sure ranks are displayed correctly (used RANK instead of RANK_TITLE) - #6630 - hide a few links from bots (forum/topic marking, memberlist, post/reply/quote/edit/etc. buttons) [#6354] - #5698 git-svn-id: file:///svn/phpbb/trunk@6818 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/install_update.html | 10 +++---- phpBB/includes/acp/acp_forums.php | 5 ++++ phpBB/includes/functions_user.php | 1 - phpBB/includes/ucp/ucp_pm_viewmessage.php | 4 +-- .../subSilver/template/forumlist_body.html | 2 +- .../subSilver/template/mcp_notes_user.html | 4 +-- .../subSilver/template/mcp_warn_post.html | 4 +-- .../subSilver/template/mcp_warn_user.html | 4 +-- .../subSilver/template/memberlist_view.html | 4 +-- .../subSilver/template/overall_header.html | 17 ++++++++--- .../subSilver/template/viewforum_body.html | 8 ++--- .../subSilver/template/viewtopic_body.html | 30 +++++++++++-------- phpBB/viewtopic.php | 6 ++-- 13 files changed, 58 insertions(+), 41 deletions(-) diff --git a/phpBB/adm/style/install_update.html b/phpBB/adm/style/install_update.html index 9eef17200f..a948ceb3fc 100644 --- a/phpBB/adm/style/install_update.html +++ b/phpBB/adm/style/install_update.html @@ -2,11 +2,11 @@ diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 41b40f76e3..fe78a6252b 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -390,6 +390,11 @@ class acp_forums { $forum_data = $row; } + else + { + $forum_data['left_id'] = $row['left_id']; + $forum_data['right_id'] = $row['right_id']; + } // Make sure there is no forum displayed for parents_list having the current forum id as a parent... $sql = 'SELECT forum_id diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index e36d3571f6..ee15ad116c 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1705,7 +1705,6 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow { $user_ary[] = $row['user_id']; } - $db->sql_freeresult($result); if (sizeof($user_ary)) diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index 60591f2031..af476aabe7 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -164,8 +164,8 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) 'MESSAGE_AUTHOR' => get_username_string('username', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']), 'U_MESSAGE_AUTHOR' => get_username_string('profile', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username']), - 'AUTHOR_RANK' => $user_info['rank_title'], - 'RANK_IMAGE' => $user_info['rank_image'], + 'RANK_TITLE' => $user_info['rank_title'], + 'RANK_IMG' => $user_info['rank_image'], 'AUTHOR_AVATAR' => (isset($user_info['avatar'])) ? $user_info['avatar'] : '', 'AUTHOR_JOINED' => $user->format_date($user_info['user_regdate']), 'AUTHOR_POSTS' => (!empty($user_info['user_posts'])) ? $user_info['user_posts'] : '', diff --git a/phpBB/styles/subSilver/template/forumlist_body.html b/phpBB/styles/subSilver/template/forumlist_body.html index eeee5d914b..90e5e1e0cd 100644 --- a/phpBB/styles/subSilver/template/forumlist_body.html +++ b/phpBB/styles/subSilver/template/forumlist_body.html @@ -1,6 +1,6 @@
{L_WARNED_USERS}{L_WARNED_USERS}
 {L_USERNAME} 
{L_WARNINGS_ZERO_TOTAL}{L_WARNINGS_ZERO_TOTAL}
{L_NOTIFY_METHOD}:
{L_NOTIFY_METHOD_EXPLAIN}
checked="checked" />{L_NOTIFY_METHOD_EMAIL}   checked="checked" />{L_NOTIFY_METHOD_IM}   checked="checked" />{L_NOTIFY_METHOD_BOTH} checked="checked" />{L_NOTIFY_METHOD_EMAIL}   checked="checked" />{L_NOTIFY_METHOD_IM}   checked="checked" />{L_NOTIFY_METHOD_BOTH}
{L_BAN_CELL}: - +
[ {L_FIND_USERNAME} ]
  - - - diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 524fad6909..43a5108a55 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1266,15 +1266,9 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) // Always process smilies after parsing bbcodes $message = smiley_text($message); - if (isset($attachments[$row['post_id']]) && sizeof($attachments[$row['post_id']])) + if (!empty($attachments[$row['post_id']])) { - $unset_attachments = parse_inline_attachments($message, $attachments[$row['post_id']], $update_count, $forum_id); - - // Needed to let not display the inlined attachments at the end of the post again - foreach ($unset_attachments as $index) - { - unset($attachments[$row['post_id']][$index]); - } + parse_attachments($forum_id, $message, $attachments[$row['post_id']], $update_count); } // Highlight active words (primarily for search) From f0129b6f27cc05f9e6488729acd32739e2616602 Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 24 Dec 2006 14:28:01 +0000 Subject: [PATCH 119/264] #6542 git-svn-id: file:///svn/phpbb/trunk@6804 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/message_parser.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index c139af5ef7..69b085e516 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -84,15 +84,12 @@ class bbcode_firstpass extends bbcode function prepare_bbcodes() { // Add newline at the end and in front of each quote block to prevent parsing errors (urls, smilies, etc.) - if (strpos($this->message, '[quote') !== false) + if (strpos($this->message, '[quote') !== false && strpos($this->message, '[/quote]') !== false) { $this->message = str_replace("\r\n", "\n", $this->message); - // We strip newlines and spaces after and before quotes in quotes (trimming) - $this->message = preg_replace(array('#\[quote(=".*?")?\]([\s|\n]+)#ius', '#([\s|\n]+)\[\/quote\]#ius'), array("[quote\\1]", "[/quote]"), $this->message); - - // Now we add exactly one newline - $this->message = preg_replace(array('#\[quote(=".*?")?\]#is', '#\[\/quote\]#is'), array("[quote\\1]\n", "\n[/quote]"), $this->message); + // We strip newlines and spaces after and before quotes in quotes (trimming) and then add exactly one newline + $this->message = preg_replace('#\[quote(=".*?")?\]\s*(.*?)\s*\[/quote\]#siu', '[quote\1]' . "\n" . '\2' ."\n[/quote]", $this->message); } // Add other checks which needs to be placed before actually parsing anything (be it bbcodes, smilies, urls...) From cbd1fb07ed9e0a19e19a58098e1b00bb74a102d5 Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 24 Dec 2006 14:34:26 +0000 Subject: [PATCH 120/264] sprintf git-svn-id: file:///svn/phpbb/trunk@6805 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/message_parser.php | 2 +- phpBB/language/en/posting.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 69b085e516..9751ab676e 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -55,7 +55,7 @@ class bbcode_firstpass extends bbcode { if (preg_match($regexp, $this->message)) { - $this->warn_msg[] = $user->lang['UNAUTHORISED_BBCODE'] . '[' . $bbcode_name . ']'; + $this->warn_msg[] = sprintf($user->lang['UNAUTHORISED_BBCODE'] , '[' . $bbcode_name . ']'); continue; } } diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index b87b29b7d6..c650b2b388 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -184,7 +184,7 @@ $lang = array_merge($lang, array( 'TOO_MANY_USER_OPTIONS' => 'You cannot specify more options per user than existing poll options', 'TOPIC_BUMPED' => 'Topic has been bumped successfully', - 'UNAUTHORISED_BBCODE' => 'You cannot use certain BBCodes: ', + 'UNAUTHORISED_BBCODE' => 'You cannot use certain BBCodes: %s', 'UNGLOBALISE_EXPLAIN' => 'To switch this topic back from being global to a normal topic, you need to select the forum you wish this topic to be displayed.', 'UPDATE_COMMENT' => 'Update comment', 'URL_INVALID' => 'The URL you specified is invalid.', From fb4e1920fcfc596eacdfa02f4752b83ca1e95508 Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 24 Dec 2006 15:35:24 +0000 Subject: [PATCH 121/264] #6372 git-svn-id: file:///svn/phpbb/trunk@6806 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_users.php | 2 +- phpBB/includes/functions_user.php | 2 +- phpBB/includes/ucp/ucp_register.php | 2 +- phpBB/install/database_update.php | 11 +++++++++++ phpBB/language/en/acp/board.php | 2 ++ phpBB/language/en/ucp.php | 2 ++ 6 files changed, 18 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index ae64fd37ed..dc08a766a3 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -790,7 +790,7 @@ class acp_users $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error); } - $user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[\w]+' => 'USERNAME_ALPHA_ONLY', '[\w_\+\. \-\[\]]+' => 'USERNAME_ALPHA_SPACERS'); + $user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[a-z]+' => 'USERNAME_ALPHA_ONLY', '[-\]_+ [a-z]+' => 'USERNAME_ALPHA_SPACERS', '\w+' => 'USERNAME_LETTER_NUM', '[-\]_+ [\w]+' => 'USERNAME_LETTER_NUM_SPACERS'); $pass_char_ary = array('.*' => 'PASS_TYPE_ANY', '[a-zA-Z]' => 'PASS_TYPE_CASE', '[a-zA-Z0-9]' => 'PASS_TYPE_ALPHA', '[a-zA-Z\W]' => 'PASS_TYPE_SYMBOL'); if ($user_id == $user->data['user_id']) diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 1d11f00298..a8fb455cdf 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1148,7 +1148,7 @@ function validate_username($username) return false; } - if (!preg_match('#^' . str_replace('\\\\', '\\', $config['allow_name_chars']) . '$#i', $username) || strpos($username, '"') !== false || strpos($username, '"') !== false) + if (!preg_match('#^' . str_replace('\\\\', '\\', $config['allow_name_chars']) . '$#ui', $username) || strpos($username, '"') !== false || strpos($username, '"') !== false) { return 'INVALID_CHARS'; } diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index b8d5c438a7..37d44958bc 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -478,7 +478,7 @@ class ucp_register break; } - $user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[\w]+' => 'USERNAME_ALPHA_ONLY', '[\w_\+\. \-\[\]]+' => 'USERNAME_ALPHA_SPACERS'); + $user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[a-z]+' => 'USERNAME_ALPHA_ONLY', '[-\]_+ [a-z]+' => 'USERNAME_ALPHA_SPACERS', '\w+' => 'USERNAME_LETTER_NUM', '[-\]_+ [\w]+' => 'USERNAME_LETTER_NUM_SPACERS'); $pass_char_ary = array('.*' => 'PASS_TYPE_ANY', '[a-zA-Z]' => 'PASS_TYPE_CASE', '[a-zA-Z0-9]' => 'PASS_TYPE_ALPHA', '[a-zA-Z\W]' => 'PASS_TYPE_SYMBOL'); // diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 97cf8ad8b6..febd88665f 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -569,6 +569,17 @@ if (version_compare($current_version, '3.0.b4', '<=')) set_config('newest_user_colour', $row['user_colour'], true); + switch ($config['allow_name_chars']) + { + case '[\w]+': + set_config('allow_name_chars', '[a-z]+'); + break; + + case '[\w_\+\. \-\[\]]+': + set_config('allow_name_chars', '[-\]_+ [a-z]+'); + break; + } + $no_updates = false; } diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 02dabb9775..6270987935 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -204,6 +204,8 @@ $lang = array_merge($lang, array( 'REG_LIMIT_EXPLAIN' => 'Number of attempts users can make at the confirmation code before being locked out that session.', 'USERNAME_ALPHA_ONLY' => 'Alphanumeric only', 'USERNAME_ALPHA_SPACERS' => 'Alphanumeric and spacers', + 'USERNAME_LETTER_NUM' => 'Any letter and number', + 'USERNAME_LETTER_NUM_SPACERS' => 'Any letter, number, and spacer', 'USERNAME_CHARS' => 'Limit username chars', 'USERNAME_CHARS_ANY' => 'Any character', 'USERNAME_CHARS_EXPLAIN' => 'Restrict type of characters that may be used in usernames, spacers are; space, -, +, _, [ and ]', diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index 92d5225743..b336bca739 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -453,6 +453,8 @@ $lang = array_merge($lang, array( 'UPLOAD_AVATAR_URL_EXPLAIN' => 'Enter the URL of the location containing the image, it 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_LETTER_NUM_EXPLAIN' => 'Username must be between %1$d and %2$d chars long and use only letter or number characters', + 'USERNAME_LETTER_NUM_SPACERS_EXPLAIN'=> 'Username must be between %1$d and %2$d chars long and use letter, number, space or -+_[] characters.', 'USERNAME_CHARS_ANY_EXPLAIN' => 'Length must be between %1$d and %2$d characters.', 'USERNAME_TAKEN_USERNAME' => 'The username you entered is already in use, please select an alternative.', 'USERNAME_DISALLOWED_USERNAME' => 'The username you entered has been banned.', From c428ca8f239e21b98b4f0ae6a4a0e58b9f6c46f1 Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 24 Dec 2006 21:05:08 +0000 Subject: [PATCH 122/264] #6472 git-svn-id: file:///svn/phpbb/trunk@6807 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/auth.php | 60 ++++++++++++++++++++++++------------- 1 file changed, 40 insertions(+), 20 deletions(-) diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index b6ec69a347..95dffb9e72 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -480,7 +480,7 @@ class auth_admin extends auth 'FORUM_ID' => $forum_id) ); - $this->assign_cat_array($ug_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, $show_trace); + $this->assign_cat_array($ug_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, $show_trace, ($mode == 'view')); } } } @@ -513,13 +513,13 @@ class auth_admin extends auth 'S_GROUP_MODE' => ($user_mode == 'group') ? true : false) ); - foreach ($content_array as $forum_id => $forum_array) + while (list($forum_id, $forum_array) = each($content_array)) { // Build role dropdown options $current_role_id = (isset($cur_roles[$ug_id][$forum_id])) ? $cur_roles[$ug_id][$forum_id] : 0; $s_role_options = ''; - foreach ($roles as $role_id => $role_row) + while (list($role_id, $role_row) = each($roles)) { $role_description = (!empty($user->lang[$role_row['role_description']])) ? $user->lang[$role_row['role_description']] : nl2br($role_row['role_description']); $role_name = (!empty($user->lang[$role_row['role_name']])) ? $user->lang[$role_row['role_name']] : $role_row['role_name']; @@ -567,7 +567,7 @@ class auth_admin extends auth 'FORUM_ID' => $forum_id) ); - $this->assign_cat_array($forum_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, $show_trace); + $this->assign_cat_array($forum_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, $show_trace, ($mode == 'view')); } } } @@ -1045,11 +1045,11 @@ class auth_admin extends auth * Assign category to template * used by display_mask() */ - function assign_cat_array(&$category_array, $tpl_cat, $tpl_mask, $ug_id, $forum_id, $show_trace = false) + function assign_cat_array(&$category_array, $tpl_cat, $tpl_mask, $ug_id, $forum_id, $show_trace = false, $s_view) { global $template, $user, $phpbb_admin_path, $phpEx; - foreach ($category_array as $cat => $cat_array) + while (list($cat, $cat_array) = each($category_array)) { $template->assign_block_vars($tpl_cat, array( 'S_YES' => ($cat_array['S_YES'] && !$cat_array['S_NEVER'] && !$cat_array['S_NO']) ? true : false, @@ -1059,23 +1059,43 @@ class auth_admin extends auth 'CAT_NAME' => $user->lang['permission_cat'][$cat]) ); - foreach ($cat_array['permissions'] as $permission => $allowed) + while (list($permission, $allowed) = each($cat_array['permissions'])) { - $template->assign_block_vars($tpl_cat . '.' . $tpl_mask, array( - 'S_YES' => ($allowed == ACL_YES) ? true : false, - 'S_NEVER' => ($allowed == ACL_NEVER) ? true : false, - 'S_NO' => ($allowed == ACL_NO) ? true : false, + if ($s_view) + { + $template->assign_block_vars($tpl_cat . '.' . $tpl_mask, array( + 'S_YES' => ($allowed == ACL_YES) ? true : false, + 'S_NEVER' => ($allowed == ACL_NEVER) ? true : false, - 'UG_ID' => $ug_id, - 'FORUM_ID' => $forum_id, - 'FIELD_NAME' => $permission, - 'S_FIELD_NAME' => 'setting[' . $ug_id . '][' . $forum_id . '][' . $permission . ']', + 'UG_ID' => $ug_id, + 'FORUM_ID' => $forum_id, + 'FIELD_NAME' => $permission, + 'S_FIELD_NAME' => 'setting[' . $ug_id . '][' . $forum_id . '][' . $permission . ']', - 'U_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission") : '', - 'UA_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission", false) : '', + 'U_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission") : '', + 'UA_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission", false) : '', - 'PERMISSION' => $user->lang['acl_' . $permission]['lang']) - ); + 'PERMISSION' => $user->lang['acl_' . $permission]['lang']) + ); + } + else + { + $template->assign_block_vars($tpl_cat . '.' . $tpl_mask, array( + 'S_YES' => ($allowed == ACL_YES) ? true : false, + 'S_NEVER' => ($allowed == ACL_NEVER) ? true : false, + 'S_NO' => ($allowed == ACL_NO) ? true : false, + + 'UG_ID' => $ug_id, + 'FORUM_ID' => $forum_id, + 'FIELD_NAME' => $permission, + 'S_FIELD_NAME' => 'setting[' . $ug_id . '][' . $forum_id . '][' . $permission . ']', + + 'U_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission") : '', + 'UA_TRACE' => ($show_trace) ? append_sid("{$phpbb_admin_path}index.$phpEx", "i=permissions&mode=trace&u=$ug_id&f=$forum_id&auth=$permission", false) : '', + + 'PERMISSION' => $user->lang['acl_' . $permission]['lang']) + ); + } } } } @@ -1098,7 +1118,7 @@ class auth_admin extends auth $permissions = $permission_row[$forum_id]; ksort($permissions); - foreach ($permissions as $permission => $auth_setting) + while (list($permission, $auth_setting) = each($permissions)) { if (!isset($user->lang['acl_' . $permission])) { From fcc22ef2b036c6c5438c227ffc13b3625860e753 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 25 Dec 2006 15:19:45 +0000 Subject: [PATCH 123/264] show dropdown box for choosing the forum in user management screen -> permissions git-svn-id: file:///svn/phpbb/trunk@6808 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/acp_users.html | 15 ++++- phpBB/includes/acp/acp_permissions.php | 4 +- phpBB/includes/acp/acp_users.php | 92 +++++++++++++++++--------- phpBB/includes/acp/auth.php | 7 ++ phpBB/includes/auth.php | 4 +- phpBB/language/en/acp/permissions.php | 2 + 6 files changed, 85 insertions(+), 39 deletions(-) diff --git a/phpBB/adm/style/acp_users.html b/phpBB/adm/style/acp_users.html index 7bc81434d0..c615dadb44 100644 --- a/phpBB/adm/style/acp_users.html +++ b/phpBB/adm/style/acp_users.html @@ -731,10 +731,21 @@ var help_line = { -
+
+ + + + +
+ {L_SELECT_FORUM}: + +
+ + + +
diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index 8b611ffef1..61017a059d 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -305,7 +305,7 @@ class acp_permissions $s_forum_options = ''; foreach ($forum_list as $f_id => $f_row) { - $s_forum_options .= ''; + $s_forum_options .= ''; } // Build subforum options @@ -488,7 +488,7 @@ class acp_permissions foreach ($forum_list as $key => $row) { - $s_options .= ''; - while ($row = $db->sql_fetchrow($result)) + $forum_list = make_forum_select($forum_id, false, true, false, false, false, true); + + // Build forum options + foreach ($forum_list as $f_id => $f_row) { - $hold_ary = $auth_admin->get_mask('view', $user_id, false, false, $row['auth_option'], 'global', ACL_NEVER); - $auth_admin->display_mask('view', $row['auth_option'], $hold_ary, 'user', false, false); + $s_forum_options .= ''; } - $db->sql_freeresult($result); - - $sql = 'SELECT auth_option, is_local, is_global - FROM ' . ACL_OPTIONS_TABLE . " - WHERE auth_option LIKE '%\_'"; - - if ($db->sql_layer == 'mssql' || $db->sql_layer == 'mssql_odbc') - { - $sql .= " ESCAPE '\\' "; - } - - $sql .= 'AND is_local = 1 - ORDER BY is_global DESC, auth_option'; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - $hold_ary = $auth_admin->get_mask('view', $user_id, false, false, $row['auth_option'], 'local', ACL_NEVER); - $auth_admin->display_mask('view', $row['auth_option'], $hold_ary, 'user', true, false); - } - $db->sql_freeresult($result); $template->assign_vars(array( 'S_PERMISSIONS' => true, + + 'S_GLOBAL' => (!$forum_id) ? true : false, + 'S_FORUM_OPTIONS' => $s_forum_options, + + 'U_ACTION' => $this->u_action . '&u=' . $user_id, 'U_USER_PERMISSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx" ,'i=permissions&mode=setting_user_global&user_id[]=' . $user_id), 'U_USER_FORUM_PERMISSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=permissions&mode=setting_user_local&user_id[]=' . $user_id)) ); diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index 95dffb9e72..26977a6ceb 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -380,6 +380,7 @@ class auth_admin extends auth } $template->assign_var('S_ROLE_JS_ARRAY', $s_role_js_array); + unset($s_role_js_array); // Now obtain memberships $user_groups_default = $user_groups_custom = array(); @@ -481,7 +482,11 @@ class auth_admin extends auth ); $this->assign_cat_array($ug_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, $show_trace, ($mode == 'view')); + + unset($content_array[$ug_id]); } + + unset($hold_ary[$forum_id]); } } else @@ -569,6 +574,8 @@ class auth_admin extends auth $this->assign_cat_array($forum_array, $tpl_pmask . '.' . $tpl_fmask . '.' . $tpl_category, $tpl_mask, $ug_id, $forum_id, $show_trace, ($mode == 'view')); } + + unset($hold_ary[$ug_id], $ug_names_ary[$ug_id]); } } } diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index a553d8e4ed..cf1b053f8c 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -113,7 +113,7 @@ class auth { if (isset($this->acl[0])) { - $this->cache[$f][$opt] = $this->acl[0]{$this->acl_options['global'][$opt]}; + $this->cache[$f][$opt] = $this->acl[0][$this->acl_options['global'][$opt]]; } } @@ -123,7 +123,7 @@ class auth { if (isset($this->acl[$f])) { - $this->cache[$f][$opt] |= $this->acl[$f]{$this->acl_options['local'][$opt]}; + $this->cache[$f][$opt] |= $this->acl[$f][$this->acl_options['local'][$opt]]; } } } diff --git a/phpBB/language/en/acp/permissions.php b/phpBB/language/en/acp/permissions.php index e17b31b8ef..94ff82148b 100644 --- a/phpBB/language/en/acp/permissions.php +++ b/phpBB/language/en/acp/permissions.php @@ -242,6 +242,8 @@ $lang = array_merge($lang, array( 'USER_IS_MEMBER_OF_CUSTOM' => 'is a member of the following custom groups', 'VIEW_ASSIGNED_ITEMS' => 'View assigned items', + 'VIEW_LOCAL_PERMS' => 'Local permissions', + 'VIEW_GLOBAL_PERMS' => 'Global permissions', 'VIEW_PERMISSIONS' => 'View permissions', 'WRONG_PERMISSION_TYPE' => 'Wrong permission type selected.', From 0ea0a361ae018ad5a3bec5099bdb26e8458d1765 Mon Sep 17 00:00:00 2001 From: Jonathan Stanley Date: Mon, 25 Dec 2006 17:07:52 +0000 Subject: [PATCH 124/264] Possessed about possessives... and re-titlecasing an ACP title. Ho-ho-ho. git-svn-id: file:///svn/phpbb/trunk@6809 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/acp/common.php | 10 +++++----- phpBB/language/en/acp/permissions.php | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 22d32831bf..e60eda4209 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -66,7 +66,7 @@ $lang = array_merge($lang, array( 'ACP_CAT_POSTING' => 'Posting', 'ACP_CAT_STYLES' => 'Styles', 'ACP_CAT_SYSTEM' => 'System', - 'ACP_CAT_USERGROUP' => 'Users and groups', + 'ACP_CAT_USERGROUP' => 'Users and Groups', 'ACP_CAT_USERS' => 'Users', 'ACP_CLIENT_COMMUNICATION' => 'Client communication', 'ACP_COOKIE_SETTINGS' => 'Cookie settings', @@ -92,10 +92,10 @@ $lang = array_merge($lang, array( 'ACP_GLOBAL_MODERATORS' => 'Global moderators', 'ACP_GLOBAL_PERMISSIONS' => 'Global permissions', 'ACP_GROUPS' => 'Groups', - 'ACP_GROUPS_FORUM_PERMISSIONS' => 'Groups forum permissions', + 'ACP_GROUPS_FORUM_PERMISSIONS' => 'Groups’ forum permissions', 'ACP_GROUPS_MANAGE' => 'Manage groups', 'ACP_GROUPS_MANAGEMENT' => 'Group management', - 'ACP_GROUPS_PERMISSIONS' => 'Groups permissions', + 'ACP_GROUPS_PERMISSIONS' => 'Groups’ permissions', 'ACP_ICONS' => 'Topic icons', 'ACP_ICONS_SMILIES' => 'Topic icons/smilies', @@ -162,9 +162,9 @@ $lang = array_merge($lang, array( 'ACP_THEMES' => 'Themes', 'ACP_UPDATE' => 'Updating', - 'ACP_USERS_FORUM_PERMISSIONS' => 'Users forum permissions', + 'ACP_USERS_FORUM_PERMISSIONS' => 'Users’ forum permissions', 'ACP_USERS_LOGS' => 'User logs', - 'ACP_USERS_PERMISSIONS' => 'Users permissions', + 'ACP_USERS_PERMISSIONS' => 'Users’ permissions', 'ACP_USER_ATTACH' => 'Attachments', 'ACP_USER_AVATAR' => 'Avatar', 'ACP_USER_FEEDBACK' => 'Feedback', diff --git a/phpBB/language/en/acp/permissions.php b/phpBB/language/en/acp/permissions.php index 94ff82148b..500325edab 100644 --- a/phpBB/language/en/acp/permissions.php +++ b/phpBB/language/en/acp/permissions.php @@ -35,10 +35,10 @@ $lang = array_merge($lang, array(

Permissions are highly granular and grouped into four major sections, which are:

Global Permissions

-

These are used to control access on a global level and apply to the entire bulletin board. They are further divided into Users Permissions, Groups Permissions, Administrators and Global Moderators.

+

These are used to control access on a global level and apply to the entire bulletin board. They are further divided into Users’ Permissions, Groups’ Permissions, Administrators and Global Moderators.

Forum Based Permissions

-

These are used to control access on a per forum basis. They are further divided into Forum Permissions, Forum Moderators, Users Forum Permissions and Groups Forum Permissions.

+

These are used to control access on a per forum basis. They are further divided into Forum Permissions, Forum Moderators, Users’ Forum Permissions and Groups’ Forum Permissions.

Permission Roles

These are used to create different sets of permissions for the different permission types later being able to be assigned on a role-based basis. The default roles should cover the administration of bulletin boards large and small, though within each of the four divisions, you can add/edit/delete roles as you see fit.

@@ -83,7 +83,7 @@ $lang = array_merge($lang, array( '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_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 admin permissions. User permissions include capabilities such as the use of avatars, sending private messages, etc. Global moderator permissions are blabla, administrative permissions blabla. To alter these settings for large numbers of users the Group permissions system is the prefered method. Users permissions should only be changed in rare occassions, the preferred method is putting users in groups and assigning the groups permissions.', + '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, etc. Global moderator permissions are blabla, administrative permissions blabla. To alter these settings for large numbers of users the Group permissions system is the prefered method. User’s permissions should only be changed in rare occassions, 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', 'ACP_VIEW_GLOBAL_MOD_PERMISSIONS_EXPLAIN' => 'Here you can view the global moderative permissions assigned to the selected users/groups', 'ACP_VIEW_FORUM_PERMISSIONS_EXPLAIN' => 'Here you can view the forum permissions assigned to the selected users/groups and forums', From 81356523452259c9272a0139f6865aeab360d966 Mon Sep 17 00:00:00 2001 From: Jonathan Stanley Date: Mon, 25 Dec 2006 17:36:08 +0000 Subject: [PATCH 125/264] #6564 git-svn-id: file:///svn/phpbb/trunk@6810 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/help_bbcode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/language/en/help_bbcode.php b/phpBB/language/en/help_bbcode.php index 544b68f5b4..9d2554d73c 100644 --- a/phpBB/language/en/help_bbcode.php +++ b/phpBB/language/en/help_bbcode.php @@ -80,7 +80,7 @@ $help = array( ), array( 0 => 'Linking to another site', - 1 => 'phpBB BBCode supports a number of ways of creating URIs, Uniform Resource Indicators better known as URLs.
  • The first of these uses the [url=][/url] tag, whatever you type after the = sign will cause the contents of that tag to act as a URL. For example to link to phpBB.com you could use:

    [url=http://www.phpbb.com/]Visit phpBB![/url]

    This would generate the following link, Visit phpBB! You will notice the link opens in a new window so the user can continue browsing the forums if they wish.
  • If you want the URL itself displayed as the link you can do this by simply using:

    [url]http://www.phpbb.com/[/url]

    This would generate the following link, http://www.phpbb.com/
  • Additionally phpBB features something called Magic Links, this will turn any syntatically correct URL into a link without you needing to specify any tags or even the leading http://. For example typing www.phpbb.com into your message will automatically lead to www.phpbb.com being output when you view the message.
  • The same thing applies equally to email addresses, you can either specify an address explicitly for example:

    [email]no.one@domain.adr[/email]

    which will output no.one@domain.adr or you can just type no.one@domain.adr into your message and it will be automatically converted when you view.
As with all the BBCode tags you can wrap URLs around any of the other tags such as [img][/img] (see next entry), [b][/b], etc. As with the formatting tags it is up to you to ensure the correct open and close order is following, for example:

[url=http://www.phpbb.com/][img]http://www.phpbb.com/images/phplogo.gif[/url][/img]

is not correct which may lead to your post being deleted so take care.' + 1 => 'phpBB BBCode supports a number of ways of creating URIs, Uniform Resource Indicators better known as URLs.
  • The first of these uses the [url=][/url] tag, whatever you type after the = sign will cause the contents of that tag to act as a URL. For example to link to phpBB.com you could use:

    [url=http://www.phpbb.com/]Visit phpBB![/url]

    This would generate the following link, Visit phpBB! You will notice the link opens in a new window so the user can continue browsing the forums if they wish.
  • If you want the URL itself displayed as the link you can do this by simply using:

    [url]http://www.phpbb.com/[/url]

    This would generate the following link, http://www.phpbb.com/
  • Additionally phpBB features something called Magic Links, this will turn any syntatically correct URL into a link without you needing to specify any tags or even the leading http://. For example typing www.phpbb.com into your message will automatically lead to www.phpbb.com being output when you view the message.
  • The same thing applies equally to email addresses, you can either specify an address explicitly for example:

    [email]no.one@domain.adr[/email]

    which will output no.one@domain.adr or you can just type no.one@domain.adr into your message and it will be automatically converted when you view.
As with all the BBCode tags you can wrap URLs around any of the other tags such as [img][/img] (see next entry), [b][/b], etc. As with the formatting tags it is up to you to ensure the correct open and close order is following, for example:

[url=http://www.phpbb.com/][img]http://www.phpbb.com/images/phplogo.gif[/url][/img]

is not correct which may lead to your post being deleted so take care.' ), array( 0 => '--', From 5225e5da5cf3d78f670aa5866633860a63dc50b5 Mon Sep 17 00:00:00 2001 From: Jonathan Stanley Date: Mon, 25 Dec 2006 17:48:25 +0000 Subject: [PATCH 126/264] FACKing BBCode FAQ. [attachment=] forever! :P Ho-ho-ho. #6568 git-svn-id: file:///svn/phpbb/trunk@6811 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/help_bbcode.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/phpBB/language/en/help_bbcode.php b/phpBB/language/en/help_bbcode.php index 9d2554d73c..94c17f9b0d 100644 --- a/phpBB/language/en/help_bbcode.php +++ b/phpBB/language/en/help_bbcode.php @@ -88,7 +88,11 @@ $help = array( ), array( 0 => 'Adding an image to a post', - 1 => 'phpBB BBCode incorporates a tag for including images in your posts. Two very important things to remember when using this tag are; many users do not appreciate lots of images being shown in posts and secondly the image you display must already be available on the internet (it cannot exist only on your computer for example, unless you run a webserver!). There is currently no way of storing images locally with phpBB (all these issues are expected to be addressed in the next release of phpBB). To display an image you must surround the URL pointing to the image with [img][/img] tags. For example:

[img]http://www.phpbb.com/images/phplogo.gif[/img]

As noted in the URL section above you can wrap an image in a [url][/url] tag if you wish, eg.

[url=http://www.phpbb.com/][img]http://www.phpbb.com/images/phplogo.gif[/img][/url]

would generate:


' + 1 => 'phpBB BBCode incorporates a tag for including images in your posts. Two very important things to remember when using this tag are; many users do not appreciate lots of images being shown in posts and secondly the image you display must already be available on the internet (it cannot exist only on your computer for example, unless you run a webserver!). To display an image you must surround the URL pointing to the image with [img][/img] tags. For example:

[img]http://www.phpbb.com/images/phplogo.gif[/img]

As noted in the URL section above you can wrap an image in a [url][/url] tag if you wish, eg.

[url=http://www.phpbb.com/][img]http://www.phpbb.com/images/phplogo.gif[/img][/url]

would generate:


.' + ), + array( + 0 => 'Adding attachments into a post', + 1 => 'Attachments can now be placed in any part of a post by using the new [attachment=][/attachment] BBCode, if the attachments functionality has been enabled by a board administrator & if you are given the appropiate permissions to create attachments. Within the posting screen is a drop-down box for placing attachments inline.' ), array( 0 => '--', From 1d8e391d195fd61ce363bbfa18a1bec7257186b4 Mon Sep 17 00:00:00 2001 From: David M Date: Tue, 26 Dec 2006 13:56:50 +0000 Subject: [PATCH 127/264] #6596 git-svn-id: file:///svn/phpbb/trunk@6812 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_template.php | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/phpBB/includes/functions_template.php b/phpBB/includes/functions_template.php index 04150d0420..2bbd812678 100644 --- a/phpBB/includes/functions_template.php +++ b/phpBB/includes/functions_template.php @@ -315,7 +315,17 @@ class template_compile $tag_template_php = ''; array_push($this->block_names, $tag_args); - if (sizeof($this->block_names) < 2) + if ($no_nesting !== false) + { + // We need to implode $no_nesting times from the end... + $block = array_slice($this->block_names, -$no_nesting); + } + else + { + $block = $this->block_names; + } + + if (sizeof($block) < 2) { // Block is not nested. $tag_template_php = '$_' . $tag_args . "_count = (isset(\$this->_tpldata['$tag_args'])) ? sizeof(\$this->_tpldata['$tag_args']) : 0;"; @@ -324,17 +334,8 @@ class template_compile else { // This block is nested. - // Generate a namespace string for this block. - if ($no_nesting !== false) - { - // We need to implode $no_nesting times from the end... - $namespace = implode('.', array_slice($this->block_names, -$no_nesting)); - } - else - { - $namespace = implode('.', $this->block_names); - } + $namespace = implode('.', $block); // Get a reference to the data array for this block that depends on the // current indices of all parent blocks. From 677dc5d2e11c3209fcaf798e4b44588a9305328f Mon Sep 17 00:00:00 2001 From: David M Date: Tue, 26 Dec 2006 20:49:20 +0000 Subject: [PATCH 128/264] #6598 - should have fixed all uses of curly braces git-svn-id: file:///svn/phpbb/trunk@6813 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_user.php | 6 +++--- phpBB/includes/message_parser.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index a8fb455cdf..0ac9b7b97b 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1406,13 +1406,13 @@ function avatar_upload($data, &$error) $destination = $config['avatar_path']; - if ($destination{(sizeof($destination)-1)} == '/' || $destination{(sizeof($destination)-1)} == '\\') + if ($destination[sizeof($destination) - 1] == '/' || $destination[sizeof($destination) - 1] == '\\') { - $destination = substr($destination, 0, sizeof($destination)-2); + $destination = substr($destination, 0, -1); } $destination = str_replace(array('../', '..\\', './', '.\\'), '', $destination); - if ($destination && ($destination[0] == '/' || $destination[0] == "\\")) + if ($destination && ($destination[0] == '/' || $destination[0] == '\\')) { $destination = ''; } diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 9751ab676e..07ba6c5b00 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -445,7 +445,7 @@ class bbcode_firstpass extends bbcode $code = preg_replace('#(?:[\n\r\s\t]| )*$#u', '', $code); // remove newline at the end - if (!empty($code) && $code{strlen($code)-1} == "\n") + if (!empty($code) && $code[strlen($code) - 1] == "\n") { $code = substr($code, 0, -1); } From b41365fcd41fc185fe197667d2f0bec13f6c30c2 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Wed, 27 Dec 2006 00:06:39 +0000 Subject: [PATCH 129/264] - display search type as page title for premade searches [Bug #6508] - flash enabled on user side by default, so that admins can actually change anything by activating it (still disabled by default) - properly implemented password complexity check [Bug #6584] - do not ldap_escape paramaters for the bind function [Bug #6208] - deleted words in edited post subjects weren't getting there search cache refreshed [Bug #6288] - made common word threshold configurable [Bug #6168] - recreated word match table entries after installation, side effect of bug #6060 - option to only allow ASCII usernames - adjusted search page pagination [Bug #6424] - correctly calculate unformatted search result extract length git-svn-id: file:///svn/phpbb/trunk@6814 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/acp_styles.html | 6 +-- phpBB/develop/create_schema_files.php | 2 +- phpBB/includes/acp/acp_board.php | 11 +++-- phpBB/includes/acp/acp_users.php | 5 +- phpBB/includes/auth/auth_ldap.php | 2 +- phpBB/includes/functions.php | 1 - phpBB/includes/functions_user.php | 47 +++++++++++++++++-- phpBB/includes/search/fulltext_native.php | 15 ++++-- phpBB/includes/ucp/ucp_register.php | 6 +-- phpBB/install/database_update.php | 27 +++++++++++ phpBB/install/schemas/firebird_schema.sql | 2 +- phpBB/install/schemas/mssql_schema.sql | 2 +- phpBB/install/schemas/mysql_40_schema.sql | 2 +- phpBB/install/schemas/mysql_41_schema.sql | 2 +- phpBB/install/schemas/oracle_schema.sql | 2 +- phpBB/install/schemas/postgres_schema.sql | 2 +- phpBB/install/schemas/schema_data.sql | 21 +++++++-- phpBB/install/schemas/sqlite_schema.sql | 2 +- phpBB/language/en/acp/board.php | 1 + phpBB/language/en/acp/search.php | 2 + phpBB/language/en/ucp.php | 1 + phpBB/search.php | 34 ++++++++------ .../subSilver/template/search_results.html | 5 +- 23 files changed, 148 insertions(+), 52 deletions(-) diff --git a/phpBB/adm/style/acp_styles.html b/phpBB/adm/style/acp_styles.html index 5c35c95747..efdaf1980a 100644 --- a/phpBB/adm/style/acp_styles.html +++ b/phpBB/adm/style/acp_styles.html @@ -322,15 +322,15 @@
-
checked="checked" /> {L_YES}   checked="checked" /> {L_NO}   checked="checked" /> {L_UNSET}
+
checked="checked" /> {L_YES}   checked="checked" /> {L_NO}   checked="checked" /> {L_UNSET}
-
checked="checked" /> {L_YES}   checked="checked" /> {L_NO}   checked="checked" /> {L_UNSET}
+
checked="checked" /> {L_YES}   checked="checked" /> {L_NO}   checked="checked" /> {L_UNSET}
-
checked="checked" /> {L_YES}   checked="checked" /> {L_NO}   checked="checked" /> {L_UNSET}
+
checked="checked" /> {L_YES}   checked="checked" /> {L_NO}   checked="checked" /> {L_UNSET}
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index f17623da44..7f6ee07d44 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1878,7 +1878,7 @@ function get_schema_struct() 'user_allow_viewonline' => array('BOOL', 1), 'user_allow_viewemail' => array('BOOL', 1), 'user_allow_massemail' => array('BOOL', 1), - 'user_options' => array('UINT:11', 893), + 'user_options' => array('UINT:11', 895), 'user_avatar' => array('VCHAR', ''), 'user_avatar_type' => array('TINT:2', 0), 'user_avatar_width' => array('USINT', 0), diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 9638accc26..7cd50d004e 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -668,7 +668,8 @@ class acp_board { global $user; - $user_char_ary = array('USERNAME_CHARS_ANY' => '.*', 'USERNAME_ALPHA_ONLY' => '[\w]+', 'USERNAME_ALPHA_SPACERS' => '[\w_\+\. \-\[\]]+'); + $user_char_ary = array('USERNAME_CHARS_ANY' => '.*', 'USERNAME_ALPHA_ONLY' => '[a-z]+', 'USERNAME_ALPHA_SPACERS' => '[-\]_+ [a-z]+', 'USERNAME_LETTER_NUM' => '\w+', 'USERNAME_LETTER_NUM_SPACERS' => '[-\]_+ [\w]+', 'USERNAME_ASCII' => '[\x01-\x7F]+'); + $user_char_options = ''; foreach ($user_char_ary as $lang => $value) { @@ -696,12 +697,12 @@ class acp_board { global $user; - $pass_type_ary = array('PASS_TYPE_ANY' => '.*', 'PASS_TYPE_CASE' => '[a-zA-Z]', 'PASS_TYPE_ALPHA' => '[a-zA-Z0-9]', 'PASS_TYPE_SYMBOL' => '[a-zA-Z\W]'); + $pass_type_ary = array('PASS_TYPE_ANY', 'PASS_TYPE_CASE', 'PASS_TYPE_ALPHA', 'PASS_TYPE_SYMBOL'); $pass_char_options = ''; - foreach ($pass_type_ary as $lang => $value) + foreach ($pass_type_ary as $pass_type) { - $selected = ($selected_value == $value) ? ' selected="selected"' : ''; - $pass_char_options .= ''; + $selected = ($selected_value == $pass_type) ? ' selected="selected"' : ''; + $pass_char_options .= ''; } return $pass_char_options; diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 7c0834aa79..82017a5871 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -790,8 +790,7 @@ class acp_users $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error); } - $user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[a-z]+' => 'USERNAME_ALPHA_ONLY', '[-\]_+ [a-z]+' => 'USERNAME_ALPHA_SPACERS', '\w+' => 'USERNAME_LETTER_NUM', '[-\]_+ [\w]+' => 'USERNAME_LETTER_NUM_SPACERS'); - $pass_char_ary = array('.*' => 'PASS_TYPE_ANY', '[a-zA-Z]' => 'PASS_TYPE_CASE', '[a-zA-Z0-9]' => 'PASS_TYPE_ALPHA', '[a-zA-Z\W]' => 'PASS_TYPE_SYMBOL'); + $user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[a-z]+' => 'USERNAME_ALPHA_ONLY', '[-\]_+ [a-z]+' => 'USERNAME_ALPHA_SPACERS', '\w+' => 'USERNAME_LETTER_NUM', '[-\]_+ [\w]+' => 'USERNAME_LETTER_NUM_SPACERS', '[\x01-\x7F]+' => 'USERNAME_ASCII'); if ($user_id == $user->data['user_id']) { @@ -868,7 +867,7 @@ class acp_users $template->assign_vars(array( 'L_NAME_CHARS_EXPLAIN' => sprintf($user->lang[$user_char_ary[str_replace('\\\\', '\\', $config['allow_name_chars'])] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']), - 'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang[$pass_char_ary[str_replace('\\\\', '\\', $config['pass_complex'])] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']), + 'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang[$config['pass_complex'] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']), 'S_FOUNDER' => ($user->data['user_type'] == USER_FOUNDER) ? true : false, 'S_OVERVIEW' => true, diff --git a/phpBB/includes/auth/auth_ldap.php b/phpBB/includes/auth/auth_ldap.php index 365361a364..ff6ff3edd1 100644 --- a/phpBB/includes/auth/auth_ldap.php +++ b/phpBB/includes/auth/auth_ldap.php @@ -36,7 +36,7 @@ function init_ldap() if ($config['ldap_user'] || $config['ldap_password']) { - if (!@ldap_bind($ldap, ldap_escape(htmlspecialchars_decode($config['ldap_user'])), htmlspecialchars_decode($config['ldap_password']))) + if (!@ldap_bind($ldap, htmlspecialchars_decode($config['ldap_user']), htmlspecialchars_decode($config['ldap_password']))) { return $user->lang['LDAP_INCORRECT_USER_PASSWORD']; } diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index aa5c766764..a88e3be9bf 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2389,7 +2389,6 @@ function make_clickable($text, $server_url = false) $magic_url_replace[] = "'\$1' . preg_replace('/(&|\?)sid=[0-9a-f]{32}/', '\\\\1', '\$3') . ''"; // matches a xxxx://aaaaa.bbb.cccc. ... - //$magic_url_match[] = '#(^|[\n\t (])(' . get_preg_expression('url') . ')([[ \t\n\r<"\'\)]|&(?!lt;|quot;))*#ie'; $magic_url_match[] = '#(^|[\n\t (])(' . get_preg_expression('url') . ')#ie'; $magic_url_replace[] = "'\$1' . ((strlen('\$2') > 55) ? substr(str_replace('&', '&', '\$2'), 0, 39) . ' ... ' . substr(str_replace('&', '&', '\$2'), -10) : '\$2') . ''"; diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 0ac9b7b97b..5991243d64 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1219,10 +1219,51 @@ function validate_password($password) return false; } - // We only check for existance of characters - if (!preg_match('#' . str_replace('\\\\', '\\', $config['pass_complex']) . '#i', $password)) + // generic UTF-8 character types supported? + if (version_compare(PHP_VERSION, '5.1.0', '>=') || (version_compare(PHP_VERSION, '5.0.0-dev', '<=') && version_compare(PHP_VERSION, '4.4.0', '>='))) { - return 'INVALID_CHARS'; + $upp = '\p{Lu}'; + $low = '\p{Ll}'; + $num = '\p{N}'; + $sym = '[^\p{Lu}\p{Ll}\p{N}]'; + } + else + { + $upp = '[A-Z]'; + $low = '[a-z]'; + $num = '[0-9]'; + $sym = '[^A-Za-z0-9]'; + } + + $chars = array(); + + switch ($config['pass_complex']) + { + case 'PASS_TYPE_CASE': + $chars[] = $low; + $chars[] = $upp; + break; + + case 'PASS_TYPE_ALPHA': + $chars[] = $low; + $chars[] = $upp; + $chars[] = $num; + break; + + case 'PASS_TYPE_SYMBOL': + $chars[] = $low; + $chars[] = $upp; + $chars[] = $num; + $chars[] = $sym; + break; + } + + foreach ($chars as $char) + { + if (!preg_match('#' . $char . '#u', $password)) + { + return 'INVALID_CHARS'; + } } return false; diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index 4ad0f8ae41..cbdef03b88 100755 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -1136,7 +1136,7 @@ class fulltext_native extends search_backend } // destroy cached search results containing any of the words removed or added - $this->destroy_cache(array_unique(array_merge($words['add']['post'], $words['add']['title'], $words['del']['post'], $words['del']['post'])), array($poster_id)); + $this->destroy_cache(array_unique(array_merge($words['add']['post'], $words['add']['title'], $words['del']['post'], $words['del']['title'])), array($poster_id)); unset($unique_add_words); unset($words); @@ -1179,14 +1179,15 @@ class fulltext_native extends search_backend $destroy_cache_words = array(); - // Remove common (> 20% of posts ) words - if ($config['num_posts'] >= 100) + // Remove common words + if ($config['num_posts'] >= 100 && $config['fulltext_native_common_thres']) { + $common_threshold = ((double) $config['fulltext_native_common_thres']) / 100.0; // First, get the IDs of common words $sql = 'SELECT word_id FROM ' . SEARCH_WORDMATCH_TABLE . ' GROUP BY word_id - HAVING COUNT(word_id) > ' . floor($config['num_posts'] * 0.2); + HAVING COUNT(word_id) > ' . floor($config['num_posts'] * $common_threshold); $result = $db->sql_query($sql); $sql_in = array(); @@ -1556,12 +1557,16 @@ class fulltext_native extends search_backend

' . $user->lang['MAX_SEARCH_CHARS_EXPLAIN'] . '
+
+

' . $user->lang['COMMON_WORD_THRESHOLD_EXPLAIN'] . '
+
%
+
'; // These are fields required in the config table return array( 'tpl' => $tpl, - 'config' => array('fulltext_native_load_upd' => 'bool', 'fulltext_native_min_chars' => 'integer:0:255', 'fulltext_native_max_chars' => 'integer:0:255') + 'config' => array('fulltext_native_load_upd' => 'bool', 'fulltext_native_min_chars' => 'integer:0:255', 'fulltext_native_max_chars' => 'integer:0:255', 'fulltext_native_common_thres' => 'double:0:100') ); } } diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 37d44958bc..050eece86e 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -478,10 +478,8 @@ class ucp_register break; } - $user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[a-z]+' => 'USERNAME_ALPHA_ONLY', '[-\]_+ [a-z]+' => 'USERNAME_ALPHA_SPACERS', '\w+' => 'USERNAME_LETTER_NUM', '[-\]_+ [\w]+' => 'USERNAME_LETTER_NUM_SPACERS'); - $pass_char_ary = array('.*' => 'PASS_TYPE_ANY', '[a-zA-Z]' => 'PASS_TYPE_CASE', '[a-zA-Z0-9]' => 'PASS_TYPE_ALPHA', '[a-zA-Z\W]' => 'PASS_TYPE_SYMBOL'); + $user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[a-z]+' => 'USERNAME_ALPHA_ONLY', '[-\]_+ [a-z]+' => 'USERNAME_ALPHA_SPACERS', '\w+' => 'USERNAME_LETTER_NUM', '[-\]_+ [\w]+' => 'USERNAME_LETTER_NUM_SPACERS', '[\x01-\x7F]+' => 'USERNAME_ASCII'); - // $template->assign_vars(array( 'ERROR' => (sizeof($error)) ? implode('
', $error) : '', 'USERNAME' => $data['username'], @@ -494,7 +492,7 @@ class ucp_register 'L_CONFIRM_EXPLAIN' => sprintf($user->lang['CONFIRM_EXPLAIN'], '', ''), 'L_REG_COND' => $l_reg_cond, 'L_USERNAME_EXPLAIN' => sprintf($user->lang[$user_char_ary[str_replace('\\\\', '\\', $config['allow_name_chars'])] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']), - 'L_PASSWORD_EXPLAIN' => sprintf($user->lang[$pass_char_ary[str_replace('\\\\', '\\', $config['pass_complex'])] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']), + 'L_PASSWORD_EXPLAIN' => sprintf($user->lang[$config['pass_complex'] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']), 'S_LANG_OPTIONS' => language_select($data['lang']), 'S_TZ_OPTIONS' => tz_select($data['tz']), diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index febd88665f..42c7e101f8 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -320,6 +320,10 @@ $database_update_info = array( 'session_forwarded_for' => array('VCHAR:255', 0), ), ), + 'change_columns' => array( + USERS_TABLE => array( + 'user_options' => array('UINT:11', 895), + ), // Remove the following keys 'drop_keys' => array( ZEBRA_TABLE => array( @@ -558,6 +562,7 @@ if (version_compare($current_version, '3.0.b4', '<=')) set_config('forwarded_for_check', '0'); set_config('ldap_password', ''); set_config('ldap_user', ''); + set_config('fulltext_native_common_thres', '20'); $sql = 'SELECT user_colour FROM ' . USERS_TABLE . ' @@ -580,6 +585,28 @@ if (version_compare($current_version, '3.0.b4', '<=')) break; } + switch ($config['pass_complex']) + { + case '.*': + set_config('pass_complex', 'PASS_TYPE_ANY'); + break; + + case '[a-zA-Z]': + set_config('pass_complex', 'PASS_TYPE_CASE'); + break; + + case '[a-zA-Z0-9]': + set_config('pass_complex', 'PASS_TYPE_ALPHA'); + break; + + case '[a-zA-Z\W]': + set_config('pass_complex', 'PASS_TYPE_SYMBOL'); + break; + } + + $sql = 'UPDATE ' . USERS_TABLE . ' SET user_options = 895 WHERE user_options = 893'; + _sql($sql, $errored, $error_ary); + $no_updates = false; } diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index fe38795ee8..dd3e4af9d2 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -1411,7 +1411,7 @@ CREATE TABLE phpbb_users ( user_allow_viewonline INTEGER DEFAULT 1 NOT NULL, user_allow_viewemail INTEGER DEFAULT 1 NOT NULL, user_allow_massemail INTEGER DEFAULT 1 NOT NULL, - user_options INTEGER DEFAULT 893 NOT NULL, + user_options INTEGER DEFAULT 895 NOT NULL, user_avatar VARCHAR(255) CHARACTER SET NONE DEFAULT '' NOT NULL, user_avatar_type INTEGER DEFAULT 0 NOT NULL, user_avatar_width INTEGER DEFAULT 0 NOT NULL, diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 8c00685f68..7f33783072 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -1653,7 +1653,7 @@ CREATE TABLE [phpbb_users] ( [user_allow_viewonline] [int] DEFAULT (1) NOT NULL , [user_allow_viewemail] [int] DEFAULT (1) NOT NULL , [user_allow_massemail] [int] DEFAULT (1) NOT NULL , - [user_options] [int] DEFAULT (893) NOT NULL , + [user_options] [int] DEFAULT (895) NOT NULL , [user_avatar] [varchar] (255) DEFAULT ('') NOT NULL , [user_avatar_type] [int] DEFAULT (0) NOT NULL , [user_avatar_width] [int] DEFAULT (0) NOT NULL , diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index ee3d290c42..7ceacea8b9 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -1013,7 +1013,7 @@ CREATE TABLE phpbb_users ( user_allow_viewonline tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, user_allow_viewemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, user_allow_massemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, - user_options int(11) UNSIGNED DEFAULT '893' NOT NULL, + user_options int(11) UNSIGNED DEFAULT '895' NOT NULL, user_avatar varchar(255) DEFAULT '' NOT NULL, user_avatar_type tinyint(2) DEFAULT '0' NOT NULL, user_avatar_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index c203a8a574..a34b478be1 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -1013,7 +1013,7 @@ CREATE TABLE phpbb_users ( user_allow_viewonline tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, user_allow_viewemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, user_allow_massemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, - user_options int(11) UNSIGNED DEFAULT '893' NOT NULL, + user_options int(11) UNSIGNED DEFAULT '895' NOT NULL, user_avatar varchar(255) DEFAULT '' NOT NULL, user_avatar_type tinyint(2) DEFAULT '0' NOT NULL, user_avatar_width smallint(4) UNSIGNED DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index f65d367356..a1d1e129e7 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -1822,7 +1822,7 @@ CREATE TABLE phpbb_users ( user_allow_viewonline number(1) DEFAULT '1' NOT NULL, user_allow_viewemail number(1) DEFAULT '1' NOT NULL, user_allow_massemail number(1) DEFAULT '1' NOT NULL, - user_options number(11) DEFAULT '893' NOT NULL, + user_options number(11) DEFAULT '895' NOT NULL, user_avatar varchar2(255) DEFAULT '' , user_avatar_type number(2) DEFAULT '0' NOT NULL, user_avatar_width number(4) DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index ccd33c4f56..a5a3a4b546 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -1273,7 +1273,7 @@ CREATE TABLE phpbb_users ( user_allow_viewonline INT2 DEFAULT '1' NOT NULL CHECK (user_allow_viewonline >= 0), user_allow_viewemail INT2 DEFAULT '1' NOT NULL CHECK (user_allow_viewemail >= 0), user_allow_massemail INT2 DEFAULT '1' NOT NULL CHECK (user_allow_massemail >= 0), - user_options INT4 DEFAULT '893' NOT NULL CHECK (user_options >= 0), + user_options INT4 DEFAULT '895' NOT NULL CHECK (user_options >= 0), user_avatar varchar(255) DEFAULT '' NOT NULL, user_avatar_type INT2 DEFAULT '0' NOT NULL, user_avatar_width INT2 DEFAULT '0' NOT NULL CHECK (user_avatar_width >= 0), diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 916a9a12d7..d1bc1ee376 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -90,6 +90,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('forwarded_for_chec INSERT INTO phpbb_config (config_name, config_value) VALUES ('full_folder_action', '2'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_mysql_max_word_len', '254'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_mysql_min_word_len', '4'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_native_common_thres', '20'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_native_load_upd', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_native_max_chars', '14'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('fulltext_native_min_chars', '3'); @@ -164,7 +165,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_name_chars', ' INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_pass_chars', '6'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_search_author_chars', '3'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('override_user_style', '0'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('pass_complex', '.*'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('pass_complex', 'PASS_TYPE_ANY'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_edit_time', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_boxes', '4'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_msgs', '50'); @@ -589,13 +590,20 @@ INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, disp # -- wordlist +INSERT INTO phpbb_search_wordlist (word_text, word_common) VALUES ('this', 0); INSERT INTO phpbb_search_wordlist (word_text, word_common) VALUES ('example', 0); INSERT INTO phpbb_search_wordlist (word_text, word_common) VALUES ('post', 0); +INSERT INTO phpbb_search_wordlist (word_text, word_common) VALUES ('your', 0); INSERT INTO phpbb_search_wordlist (word_text, word_common) VALUES ('phpbb', 0); INSERT INTO phpbb_search_wordlist (word_text, word_common) VALUES ('installation', 0); +INSERT INTO phpbb_search_wordlist (word_text, word_common) VALUES ('you', 0); +INSERT INTO phpbb_search_wordlist (word_text, word_common) VALUES ('may', 0); INSERT INTO phpbb_search_wordlist (word_text, word_common) VALUES ('delete', 0); INSERT INTO phpbb_search_wordlist (word_text, word_common) VALUES ('topic', 0); +INSERT INTO phpbb_search_wordlist (word_text, word_common) VALUES ('and', 0); +INSERT INTO phpbb_search_wordlist (word_text, word_common) VALUES ('even', 0); INSERT INTO phpbb_search_wordlist (word_text, word_common) VALUES ('forum', 0); +INSERT INTO phpbb_search_wordlist (word_text, word_common) VALUES ('like', 0); INSERT INTO phpbb_search_wordlist (word_text, word_common) VALUES ('since', 0); INSERT INTO phpbb_search_wordlist (word_text, word_common) VALUES ('everything', 0); INSERT INTO phpbb_search_wordlist (word_text, word_common) VALUES ('seems', 0); @@ -614,8 +622,15 @@ INSERT INTO phpbb_search_wordmatch (word_id, post_id, title_match) VALUES (8, 1, INSERT INTO phpbb_search_wordmatch (word_id, post_id, title_match) VALUES (9, 1, 0); INSERT INTO phpbb_search_wordmatch (word_id, post_id, title_match) VALUES (10, 1, 0); INSERT INTO phpbb_search_wordmatch (word_id, post_id, title_match) VALUES (11, 1, 0); -INSERT INTO phpbb_search_wordmatch (word_id, post_id, title_match) VALUES (12, 1, 1); -INSERT INTO phpbb_search_wordmatch (word_id, post_id, title_match) VALUES (3, 1, 1); +INSERT INTO phpbb_search_wordmatch (word_id, post_id, title_match) VALUES (12, 1, 0); +INSERT INTO phpbb_search_wordmatch (word_id, post_id, title_match) VALUES (13, 1, 0); +INSERT INTO phpbb_search_wordmatch (word_id, post_id, title_match) VALUES (14, 1, 0); +INSERT INTO phpbb_search_wordmatch (word_id, post_id, title_match) VALUES (15, 1, 0); +INSERT INTO phpbb_search_wordmatch (word_id, post_id, title_match) VALUES (16, 1, 0); +INSERT INTO phpbb_search_wordmatch (word_id, post_id, title_match) VALUES (17, 1, 0); +INSERT INTO phpbb_search_wordmatch (word_id, post_id, title_match) VALUES (18, 1, 0); +INSERT INTO phpbb_search_wordmatch (word_id, post_id, title_match) VALUES (5, 1, 1); +INSERT INTO phpbb_search_wordmatch (word_id, post_id, title_match) VALUES (19, 1, 1); # -- reasons diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 4d697f3b15..d33f38b35a 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -984,7 +984,7 @@ CREATE TABLE phpbb_users ( user_allow_viewonline INTEGER UNSIGNED NOT NULL DEFAULT '1', user_allow_viewemail INTEGER UNSIGNED NOT NULL DEFAULT '1', user_allow_massemail INTEGER UNSIGNED NOT NULL DEFAULT '1', - user_options INTEGER UNSIGNED NOT NULL DEFAULT '893', + user_options INTEGER UNSIGNED NOT NULL DEFAULT '895', user_avatar varchar(255) NOT NULL DEFAULT '', user_avatar_type tinyint(2) NOT NULL DEFAULT '0', user_avatar_width INTEGER UNSIGNED NOT NULL DEFAULT '0', diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 6270987935..3aee12ad37 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -204,6 +204,7 @@ $lang = array_merge($lang, array( 'REG_LIMIT_EXPLAIN' => 'Number of attempts users can make at the confirmation code before being locked out that session.', 'USERNAME_ALPHA_ONLY' => 'Alphanumeric only', 'USERNAME_ALPHA_SPACERS' => 'Alphanumeric and spacers', + 'USERNAME_ASCII' => 'ASCII (no international unicode)', 'USERNAME_LETTER_NUM' => 'Any letter and number', 'USERNAME_LETTER_NUM_SPACERS' => 'Any letter, number, and spacer', 'USERNAME_CHARS' => 'Limit username chars', diff --git a/phpBB/language/en/acp/search.php b/phpBB/language/en/acp/search.php index 4d6b01cb6c..ffbfc89e10 100644 --- a/phpBB/language/en/acp/search.php +++ b/phpBB/language/en/acp/search.php @@ -34,6 +34,8 @@ $lang = array_merge($lang, array( 'ACP_SEARCH_INDEX_EXPLAIN' => 'Here you can manage the search backend’s indexes. Since you normally use only one backend you should delete all indexes that you do not make use of. After altering some of the search settings (e.g. the number of minimum/maximum chars) it might be worth recreating the index so it reflects those changes.', 'ACP_SEARCH_SETTINGS_EXPLAIN' => 'Here you can define what search backend will be used for indexing posts and performing searches. You can set various options that can influence how much processing these actions require. Some of these settings are the same for all search engine backends.', + 'COMMON_WORD_THRESHOLD' => 'Common word threshold', + 'COMMON_WORD_THRESHOLD_EXPLAIN' => 'Words which are contained in a greater percentage of all posts will be regarded as common. Common words are ignored in search queries. Set to zero to disable. Only takes effect if there are more than 100 posts.', 'CONFIRM_SEARCH_BACKEND' => 'Are you sure you wish to switch to a different search backend? After changing the search backend you will have to create an index for the new search backend. If you don’t plan on switching back to the old search backend you can also delete the old backend’s index in order to free system resources.', 'CONTINUE_DELETING_INDEX' => 'Continue previous index deleting process', 'CONTINUE_DELETING_INDEX_EXPLAIN' => 'An index deleting process has been started. In order to access the search index page again you need to complete it first.', diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index b336bca739..f74857091f 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -453,6 +453,7 @@ $lang = array_merge($lang, array( 'UPLOAD_AVATAR_URL_EXPLAIN' => 'Enter the URL of the location containing the image, it 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', 'USERNAME_LETTER_NUM_EXPLAIN' => 'Username must be between %1$d and %2$d chars long and use only letter or number characters', 'USERNAME_LETTER_NUM_SPACERS_EXPLAIN'=> 'Username must be between %1$d and %2$d chars long and use letter, number, space or -+_[] characters.', 'USERNAME_CHARS_ANY_EXPLAIN' => 'Length must be between %1$d and %2$d characters.', diff --git a/phpBB/search.php b/phpBB/search.php index e86e1bea68..642b54b53e 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -250,13 +250,14 @@ if ($keywords || $author || $author_id || $search_id || $submit) $sort_by_sql = array('a' => 'u.username_clean', 't' => (($show_results == 'posts') ? 'p.post_time' : 't.topic_last_post_time'), 'f' => 'f.forum_id', 'i' => 't.topic_title', 's' => (($show_results == 'posts') ? 'p.post_subject' : 't.topic_title')); // pre-made searches - $sql = $field = ''; + $sql = $field = $l_search_title = ''; if ($search_id) { switch ($search_id) { // Oh holy Bob, bring us some activity... case 'active_topics': + $l_search_title = $user->lang['SEARCH_ACTIVE_TOPICS']; $show_results = 'topics'; $sort_key = 't'; $sort_dir = 'd'; @@ -279,6 +280,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) break; case 'unanswered': + $l_search_title = $user->lang['SEARCH_UNANSWERED']; $show_results = request_var('sr', 'topics'); $show_results = ($show_results == 'posts') ? 'posts' : 'topics'; $sort_by_sql['t'] = ($show_results == 'posts') ? 'p.post_time' : 't.topic_last_post_time'; @@ -331,6 +333,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) break; case 'newposts': + $l_search_title = $user->lang['SEARCH_NEW']; // force sorting $show_results = (request_var('sr', 'topics') == 'posts') ? 'posts' : 'topics'; $sort_key = 't'; @@ -363,6 +366,10 @@ if ($keywords || $author || $author_id || $search_id || $submit) $field = 'topic_id'; } break; + + case 'egosearch': + $l_search_title = $user->lang['SEARCH_SELF']; + break; } } @@ -464,6 +471,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) $u_search .= ($return_chars != 200) ? '&ch=' . $return_chars : ''; $template->assign_vars(array( + 'SEARCH_TITLE' => $l_search_title, 'SEARCH_MATCHES' => $l_search_matches, 'SEARCH_WORDS' => preg_replace('#&(\#[0-9]+;)#', '&$1', htmlspecialchars($search->search_query)), 'IGNORED_WORDS' => (sizeof($search->common_words)) ? htmlspecialchars(implode(' ', $search->common_words)) : '', @@ -794,26 +802,23 @@ if ($keywords || $author || $author_id || $search_id || $submit) // Replace naughty words such as farty pants $row['post_subject'] = censor_text($row['post_subject']); - $message = $row['post_text']; + $message = censor_text($row['post_text']); - if ($return_chars != -1 && utf8_strlen($message) >= ($return_chars + 3)) + $text_only_message = $message; + // make list items visible as such + $text_only_message = str_replace('[*:' . $row['bbcode_uid'] . ']', '⋅ ', $message); + // no BBCode in text only message + strip_bbcode($text_only_message, $row['bbcode_uid']); + + if ($return_chars != -1 && utf8_strlen($text_only_message) >= ($return_chars + 3)) { - $message = censor_text($message); - - // make list items visible as such - $message = str_replace('[*:' . $row['bbcode_uid'] . ']', '⋅ ', $message); - - // do not display raw bbcode - strip_bbcode($message, $row['bbcode_uid']); - // now find context for the searched words - $message = get_context($message, array_filter(explode('|', $hilit), 'strlen'), $return_chars); + $message = get_context($text_only_message, array_filter(explode('|', $hilit), 'strlen'), $return_chars); $message = str_replace("\n", '
', $message); } else { - $message = censor_text($message); $message = str_replace("\n", '
', $message); // Second parse bbcode here @@ -833,6 +838,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) // Always process smilies after parsing bbcodes $message = smiley_text($message); } + unset($text_only_message); if ($hilit) { @@ -878,7 +884,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) } unset($rowset); - page_header($user->lang['SEARCH']); + page_header(($l_search_title) ? $l_search_title : $user->lang['SEARCH']); $template->set_filenames(array( 'body' => 'search_results.html') diff --git a/phpBB/styles/subSilver/template/search_results.html b/phpBB/styles/subSilver/template/search_results.html index ab0764254c..ea880d3642 100644 --- a/phpBB/styles/subSilver/template/search_results.html +++ b/phpBB/styles/subSilver/template/search_results.html @@ -4,7 +4,7 @@
- + @@ -123,7 +123,8 @@ - +
{PAGE_NUMBER} [ {SEARCH_MATCHES} ]
+

From b9da985180730252133699242ef639f91da2880e Mon Sep 17 00:00:00 2001 From: David M Date: Wed, 27 Dec 2006 16:51:56 +0000 Subject: [PATCH 130/264] #6600 git-svn-id: file:///svn/phpbb/trunk@6815 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/install_install.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index a9ce326b88..c6b5ab263d 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -1322,7 +1322,7 @@ class install_install extends module foreach ($sql_ary as $sql) { - $sql = trim(str_replace('|', ';', $sql)); + //$sql = trim(str_replace('|', ';', $sql)); if (!$db->sql_query($sql)) { From 945afbc5fa427f6e6fa15f3e2f5c67969121b01e Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 27 Dec 2006 17:43:55 +0000 Subject: [PATCH 131/264] Unused Code inside function update_forum_data [Bug #6606] Copy permissions protection for groups [Bug #6594] HTML issues in ACP [Bug #6580, #6578] Always send the correct encoding [related to bug #6576] Mass email fixes for first loop iteration [Bug #6570] Extension groups to be allowed in PM's and/or Posts [Bug #6558] Extension allowance checking clarified (no longer using forum id 0 for private messaging) Using request_var() array method for some variables [Bug #6556] Added confirmation for deletion of ranks/smilies/icons/word censores [Bug #6548, #6530, #6512, #6466] Only show postable forums in dropdown list for moving posts on forum deletion as well as correct re-indexing [Bug #6510, #6476, #6384] Jabber password being password field in jabber settings screen [Bug #6478] user activity language variable if viewing not own profile [Bug #6432] Show moderator group/user-name colour [Bug #6402] Log rank creation/updating/removing [Bug #6398] Update check permission changed from a_ to a_board [Bug #6392] git-svn-id: file:///svn/phpbb/trunk@6816 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/index.php | 7 +- phpBB/adm/style/acp_attachments.html | 13 ++- phpBB/adm/style/acp_database.html | 21 ++-- phpBB/adm/style/acp_groups.html | 2 +- phpBB/adm/style/acp_jabber.html | 2 +- phpBB/adm/style/acp_search.html | 9 +- phpBB/adm/style/acp_words.html | 5 +- phpBB/download.php | 7 +- phpBB/includes/acp/acp_attachments.php | 100 +++++++----------- phpBB/includes/acp/acp_board.php | 1 - phpBB/includes/acp/acp_email.php | 7 +- phpBB/includes/acp/acp_forums.php | 14 ++- phpBB/includes/acp/acp_groups.php | 63 ++++++----- phpBB/includes/acp/acp_icons.php | 65 +++++++----- phpBB/includes/acp/acp_permissions.php | 4 +- phpBB/includes/acp/acp_ranks.php | 28 ++++- phpBB/includes/acp/acp_words.php | 38 ++++--- phpBB/includes/acp/info/acp_update.php | 2 +- phpBB/includes/cache.php | 69 ++++++++---- phpBB/includes/functions.php | 47 +++----- phpBB/includes/functions_admin.php | 12 ++- phpBB/includes/functions_display.php | 43 ++++++-- phpBB/includes/functions_posting.php | 2 +- phpBB/includes/functions_privmsgs.php | 2 +- phpBB/includes/functions_user.php | 29 ++--- phpBB/includes/ucp/ucp_attachments.php | 2 +- phpBB/includes/ucp/ucp_main.php | 8 +- phpBB/includes/ucp/ucp_pm.php | 2 +- phpBB/includes/ucp/ucp_pm_compose.php | 2 +- phpBB/includes/ucp/ucp_pm_viewmessage.php | 2 +- phpBB/install/database_update.php | 9 ++ phpBB/install/schemas/schema_data.sql | 1 - phpBB/language/en/acp/attachments.php | 1 + phpBB/language/en/acp/board.php | 2 - phpBB/language/en/acp/common.php | 4 + phpBB/language/en/acp/permissions_phpbb.php | 2 +- phpBB/language/en/common.php | 3 +- .../subSilver/template/memberlist_view.html | 2 +- .../subSilver/template/ucp_main_front.html | 2 +- phpBB/styles/subSilver/theme/stylesheet.css | 2 - phpBB/viewtopic.php | 2 +- 41 files changed, 371 insertions(+), 267 deletions(-) diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index beba6d00a6..81673fcf7a 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -154,10 +154,9 @@ function adm_page_header($page_title) 'S_CONTENT_DIR_RIGHT' => $user->lang['RIGHT']) ); - if ($config['send_encoding']) - { - header('Content-type: text/html; charset=UTF-8'); - } + // application/xhtml+xml not used because of IE + header('Content-type: text/html; charset=UTF-8'); + header('Cache-Control: private, no-cache="set-cookie"'); header('Expires: 0'); header('Pragma: no-cache'); diff --git a/phpBB/adm/style/acp_attachments.html b/phpBB/adm/style/acp_attachments.html index 698ea77f01..d34a3a6a22 100644 --- a/phpBB/adm/style/acp_attachments.html +++ b/phpBB/adm/style/acp_attachments.html @@ -2,6 +2,10 @@ + + « {L_BACK} + +

{L_TITLE}

{L_TITLE_EXPLAIN}

@@ -234,17 +238,18 @@
- + - - + @@ -323,7 +328,7 @@ -
+
{L_TITLE}
{SEARCH_MATCHES}
{SEARCH_TITLE}{SEARCH_MATCHES}
{L_SEARCHED_TOPIC}: {SEARCH_TOPIC}
{L_SEARCHED_FOR}: {SEARCH_WORDS} {L_IGNORED_TERMS}: {IGNORED_WORDS}
 
{groups.GROUP_NAME} + {groups.GROUP_NAME}
» {L_NOT_ALLOWED_IN_PM} +
» {L_ONLY_ALLOWED_IN_PM}
{groups.CATEGORY} {L_EDIT} | {L_DELETE} | {groups.L_ACT_DEACT}  {ICON_EDIT}  {ICON_DELETE} 
diff --git a/phpBB/adm/style/acp_database.html b/phpBB/adm/style/acp_database.html index 11daffa06d..8341d36c70 100644 --- a/phpBB/adm/style/acp_database.html +++ b/phpBB/adm/style/acp_database.html @@ -12,7 +12,7 @@
{L_RESTORE_OPTIONS}
-
+
@@ -53,26 +53,27 @@
{L_BACKUP_OPTIONS}
-
-
 {L_FULL_BACKUP}   {L_STRUCTURE_ONLY}   {L_DATA_ONLY}
+
+
 {L_FULL_BACKUP}   {L_STRUCTURE_ONLY}   {L_DATA_ONLY}
-
+
- checked="checked" /> {methods.TYPE} + id="method" checked="checked" type="radio" class="radio" value="{methods.TYPE}" /> {methods.TYPE}
-
-
 {L_STORE_AND_DOWNLOAD}   {L_STORE_LOCAL}   {L_DOWNLOAD}
+
+
 {L_STORE_AND_DOWNLOAD}   {L_STORE_LOCAL}   {L_DOWNLOAD}
-
-
-

+ +
{L_SELECT_ALL} :: {L_DESELECT_ALL}

diff --git a/phpBB/adm/style/acp_groups.html b/phpBB/adm/style/acp_groups.html index e2ed9d4529..753cfd0f63 100644 --- a/phpBB/adm/style/acp_groups.html +++ b/phpBB/adm/style/acp_groups.html @@ -44,7 +44,7 @@ - +


{L_COPY_PERMISSIONS_EXPLAIN}
diff --git a/phpBB/adm/style/acp_jabber.html b/phpBB/adm/style/acp_jabber.html index 22c38446f2..a94b25e52b 100644 --- a/phpBB/adm/style/acp_jabber.html +++ b/phpBB/adm/style/acp_jabber.html @@ -35,7 +35,7 @@
-
+

{L_JAB_RESOURCE_EXPLAIN}
diff --git a/phpBB/adm/style/acp_search.html b/phpBB/adm/style/acp_search.html index 104f6362a8..c52a7ac2ec 100644 --- a/phpBB/adm/style/acp_search.html +++ b/phpBB/adm/style/acp_search.html @@ -91,10 +91,13 @@ - + - {backend.S_HIDDEN_FIELDS} +
+ + {backend.S_HIDDEN_FIELDS} + {L_INDEX_STATS}: {backend.L_NAME} ({L_ACTIVE})
@@ -130,7 +133,7 @@

- + diff --git a/phpBB/adm/style/acp_words.html b/phpBB/adm/style/acp_words.html index 17f734c29f..f0062e9600 100644 --- a/phpBB/adm/style/acp_words.html +++ b/phpBB/adm/style/acp_words.html @@ -52,7 +52,7 @@ - + @@ -60,8 +60,7 @@ - - + diff --git a/phpBB/download.php b/phpBB/download.php index 790938a7d4..c2b1ef8dda 100644 --- a/phpBB/download.php +++ b/phpBB/download.php @@ -63,7 +63,8 @@ if ($attachment['is_orphan']) trigger_error('ERROR_NO_ATTACHMENT'); } - $extensions = $cache->obtain_attach_extensions(); + // Obtain all extensions... + $extensions = $cache->obtain_attach_extensions(true); } else { @@ -106,14 +107,14 @@ else } else { - $row['forum_id'] = 0; + $row['forum_id'] = false; if (!$auth->acl_get('u_pm_download')) { trigger_error('SORRY_AUTH_VIEW_ATTACH'); } } - // disallowed ? + // disallowed? $extensions = array(); if (!extension_allowed($row['forum_id'], $attachment['extension'], $extensions)) { diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 662a83d212..823e9709c4 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -56,8 +56,7 @@ class acp_attachments $template->assign_vars(array( 'L_TITLE' => $user->lang[$l_title], 'L_TITLE_EXPLAIN' => $user->lang[$l_title . '_EXPLAIN'], - 'U_ACTION' => $this->u_action, - ) + 'U_ACTION' => $this->u_action) ); switch ($mode) @@ -181,8 +180,7 @@ class acp_attachments $template->assign_vars(array( 'U_SEARCH_IMAGICK' => $this->u_action . '&action=imgmagick', - 'S_THUMBNAIL_SUPPORT' => (!$this->new_config['img_imagick'] && (!isset($supported_types['format']) || !sizeof($supported_types['format']))) ? false : true, - ) + 'S_THUMBNAIL_SUPPORT' => (!$this->new_config['img_imagick'] && (!isset($supported_types['format']) || !sizeof($supported_types['format']))) ? false : true) ); // Secure Download Options - Same procedure as with banning @@ -216,8 +214,7 @@ class acp_attachments 'L_SECURE_TITLE' => $user->lang['DEFINE_' . $allow_deny . '_IPS'], 'L_IP_EXCLUDE' => $user->lang['EXCLUDE_FROM_' . $allow_deny . '_IP'], - 'L_REMOVE_IPS' => $user->lang['REMOVE_' . $allow_deny . '_IPS'], - ) + 'L_REMOVE_IPS' => $user->lang['REMOVE_' . $allow_deny . '_IPS']) ); // Output relevant options @@ -271,8 +268,8 @@ class acp_attachments if ($submit) { // Change Extensions ? - $extension_change_list = (isset($_POST['extension_change_list'])) ? array_map('intval', $_POST['extension_change_list']) : array(); - $group_select_list = (isset($_POST['group_select'])) ? array_map('intval', $_POST['group_select']) : array(); + $extension_change_list = request_var('extension_change_list', array(0)); + $group_select_list = request_var('group_select', array(0)); // Generate correct Change List $extensions = array(); @@ -294,7 +291,7 @@ class acp_attachments $sql = 'UPDATE ' . EXTENSIONS_TABLE . ' SET group_id = ' . (int) $extensions[$row['extension_id']]['group_id'] . ' WHERE extension_id = ' . $row['extension_id']; - $db->sql_query($sql); + $db->sql_query($sql); add_log('admin', 'LOG_ATTACH_EXT_UPDATE', $row['extension']); } @@ -302,7 +299,7 @@ class acp_attachments $db->sql_freeresult($result); // Delete Extension? - $extension_id_list = (isset($_POST['extension_id_list'])) ? array_map('intval', $_POST['extension_id_list']) : array(); + $extension_id_list = request_var('extension_id_list', array(0)); if (sizeof($extension_id_list)) { @@ -332,7 +329,7 @@ class acp_attachments $add_extension_group = request_var('add_group_select', 0); $add = (isset($_POST['add_extension_check'])) ? true : false; - if ($add_extension != '' && $add) + if ($add_extension && $add) { if (!sizeof($error)) { @@ -353,7 +350,7 @@ class acp_attachments 'group_id' => $add_extension_group, 'extension' => $add_extension ); - + $db->sql_query('INSERT INTO ' . EXTENSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); add_log('admin', 'LOG_ATTACH_EXT_ADD', $add_extension); } @@ -364,7 +361,7 @@ class acp_attachments { $notify[] = $user->lang['EXTENSIONS_UPDATED']; } - + $cache->destroy('_extensions'); } @@ -467,11 +464,11 @@ class acp_attachments $upload_icon = request_var('upload_icon', 'no_image'); $size_select = request_var('size_select', 'b'); $forum_select = request_var('forum_select', false); - $allowed_forums = isset($_POST['allowed_forums']) ? array_map('intval', array_values($_POST['allowed_forums'])) : array(); - $allow_in_pm = isset($_POST['allow_in_pm']) ? true : false; + $allowed_forums = request_var('allowed_forums', array(0)); + $allow_in_pm = (isset($_POST['allow_in_pm'])) ? true : false; $max_filesize = request_var('max_filesize', 0); $max_filesize = ($size_select == 'kb') ? round($max_filesize * 1024) : (($size_select == 'mb') ? round($max_filesize * 1048576) : $max_filesize); - $allow_group = (isset($_POST['allow_group'])) ? 1 : 0; + $allow_group = (isset($_POST['allow_group'])) ? true : false; if ($max_filesize == $config['max_filesize']) { @@ -486,12 +483,12 @@ class acp_attachments $group_ary = array( 'group_name' => $group_name, 'cat_id' => request_var('special_category', ATTACHMENT_CATEGORY_NONE), - 'allow_group' => $allow_group, + 'allow_group' => ($allow_group) ? 1 : 0, 'download_mode' => request_var('download_mode', INLINE_LINK), 'upload_icon' => ($upload_icon == 'no_image') ? '' : $upload_icon, 'max_filesize' => $max_filesize, 'allowed_forums'=> ($forum_select) ? serialize($allowed_forums) : '', - 'allow_in_pm' => ($allow_in_pm) ? 1 : 0 + 'allow_in_pm' => ($allow_in_pm) ? 1 : 0, ); $sql = ($action == 'add') ? 'INSERT INTO ' . EXTENSION_GROUPS_TABLE . ' ' : 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' SET '; @@ -508,7 +505,7 @@ class acp_attachments add_log('admin', 'LOG_ATTACH_EXTGROUP_' . strtoupper($action), $group_name); } - $extension_list = isset($_REQUEST['extensions']) ? array_map('intval', array_values($_REQUEST['extensions'])) : array(); + $extension_list = request_var('extensions', array(0)); if ($action == 'edit' && sizeof($extension_list)) { @@ -533,7 +530,7 @@ class acp_attachments $notify[] = $user->lang['SUCCESS_EXTENSION_GROUP_' . strtoupper($action)]; } } - + $cat_lang = array( ATTACHMENT_CATEGORY_NONE => $user->lang['NO_FILE_CAT'], ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'], @@ -581,7 +578,6 @@ class acp_attachments confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( 'i' => $id, 'mode' => $mode, - 'action' => $action, 'group_id' => $group_id, 'action' => 'delete', ))); @@ -590,7 +586,7 @@ class acp_attachments break; case 'edit': - + if (!$group_id) { trigger_error($user->lang['NO_EXT_GROUP_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING); @@ -608,7 +604,7 @@ class acp_attachments // no break; case 'add': - + if ($action == 'add') { $ext_group_row = array( @@ -620,7 +616,7 @@ class acp_attachments 'upload_icon' => '', 'max_filesize' => 0, ); - + $forum_ids = array(); } @@ -690,15 +686,15 @@ class acp_attachments } $template->assign_vars(array( - 'PHPBB_ROOT_PATH' => $phpbb_root_path, - 'IMG_PATH' => $img_path, - 'ACTION' => $action, - 'GROUP_ID' => $group_id, - 'GROUP_NAME' => $ext_group_row['group_name'], - 'ALLOW_GROUP' => $ext_group_row['allow_group'], - 'ALLOW_IN_PM' => $ext_group_row['allow_in_pm'], - 'UPLOAD_ICON_SRC' => $phpbb_root_path . $img_path . '/' . $ext_group_row['upload_icon'], - 'EXTGROUP_FILESIZE' => $ext_group_row['max_filesize'], + 'PHPBB_ROOT_PATH' => $phpbb_root_path, + 'IMG_PATH' => $img_path, + 'ACTION' => $action, + 'GROUP_ID' => $group_id, + 'GROUP_NAME' => $ext_group_row['group_name'], + 'ALLOW_GROUP' => $ext_group_row['allow_group'], + 'ALLOW_IN_PM' => $ext_group_row['allow_in_pm'], + 'UPLOAD_ICON_SRC' => $phpbb_root_path . $img_path . '/' . $ext_group_row['upload_icon'], + 'EXTGROUP_FILESIZE' => $ext_group_row['max_filesize'], 'ASSIGNED_EXTENSIONS' => $assigned_extensions, 'S_CATEGORY_SELECT' => $this->category_select('special_category', $group_id, 'category'), @@ -711,9 +707,9 @@ class acp_attachments 'S_FORUM_IDS' => (sizeof($forum_ids)) ? true : false, 'U_EXTENSIONS' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=extensions"), + 'U_BACK' => $this->u_action, - 'L_LEGEND' => $user->lang[strtoupper($action) . '_EXTENSION_GROUP'], - ) + 'L_LEGEND' => $user->lang[strtoupper($action) . '_EXTENSION_GROUP']) ); $s_forum_id_options = ''; @@ -721,11 +717,12 @@ class acp_attachments $sql = 'SELECT forum_id, forum_name, parent_id, forum_type, left_id, right_id FROM ' . FORUMS_TABLE . ' ORDER BY left_id ASC'; - $result = $db->sql_query($sql, 600); + $result = $db->sql_query($sql); $right = $cat_right = $padding_inc = 0; $padding = $forum_list = $holding = ''; $padding_store = array('0' => ''); + while ($row = $db->sql_fetchrow($result)) { if ($row['forum_type'] == FORUM_CAT && ($row['left_id'] + 1 == $row['right_id'])) @@ -777,38 +774,19 @@ class acp_attachments $template->assign_vars(array( 'S_FORUM_ID_OPTIONS' => $s_forum_id_options) ); - - break; - - case 'deactivate': - case 'activate': - - if (!$group_id) - { - trigger_error($user->lang['NO_EXT_GROUP_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING); - } - - $sql = 'UPDATE ' . EXTENSION_GROUPS_TABLE . ' - SET allow_group = ' . (($action == 'activate') ? '1' : '0') . " - WHERE group_id = $group_id"; - $db->sql_query($sql); - - $this->rewrite_extensions(); break; } $sql = 'SELECT * FROM ' . EXTENSION_GROUPS_TABLE . ' - ORDER BY allow_group DESC, group_name'; + ORDER BY allow_group DESC, allow_in_pm DESC, group_name'; $result = $db->sql_query($sql); - $act_deact = 'activate'; + $old_allow_group = $old_allow_pm = 1; while ($row = $db->sql_fetchrow($result)) { - $s_add_spacer = ($row['allow_group'] == 0 && $act_deact == 'deactivate') ? true : false; - - $act_deact = ($row['allow_group']) ? 'deactivate' : 'activate'; + $s_add_spacer = ($old_allow_group != $row['allow_group'] || $old_allow_pm != $row['allow_in_pm']) ? true : false; $template->assign_block_vars('groups', array( 'S_ADD_SPACER' => $s_add_spacer, @@ -817,14 +795,14 @@ class acp_attachments 'U_EDIT' => $this->u_action . "&action=edit&g={$row['group_id']}", 'U_DELETE' => $this->u_action . "&action=delete&g={$row['group_id']}", - 'U_ACT_DEACT' => $this->u_action . "&action=$act_deact&g={$row['group_id']}", - 'L_ACT_DEACT' => $user->lang[strtoupper($act_deact)], 'GROUP_NAME' => $row['group_name'], 'CATEGORY' => $cat_lang[$row['cat_id']], ) ); + $old_allow_group = $row['allow_group']; + $old_allow_pm = $row['allow_in_pm']; } $db->sql_freeresult($result); @@ -1369,7 +1347,7 @@ class acp_attachments } else if (isset($_POST['unsecuresubmit'])) { - $unip_sql = array_map('intval', $_POST['unip']); + $unip_sql = request_var('unip', array(0)); if (sizeof($unip_sql)) { diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 7cd50d004e..11fddd3d1c 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -278,7 +278,6 @@ class acp_board 'title' => 'ACP_SERVER_SETTINGS', 'vars' => array( 'legend1' => 'ACP_SERVER_SETTINGS', - 'send_encoding' => array('lang' => 'SEND_ENCODING', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'gzip_compress' => array('lang' => 'ENABLE_GZIP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'legend2' => 'PATH_SETTINGS', diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php index fa29e7b209..4f42f5b5b2 100644 --- a/phpBB/includes/acp/acp_email.php +++ b/phpBB/includes/acp/acp_email.php @@ -107,7 +107,12 @@ class acp_email if ($i == $max_chunk_size || $row['user_lang'] != $old_lang || $row['user_notify_type'] != $old_notify_type) { $i = 0; - $j++; + + if (sizeof($email_list)) + { + $j++; + } + $old_lang = $row['user_lang']; $old_notify_type = $row['user_notify_type']; } diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index fc524e0c75..41b40f76e3 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -668,7 +668,7 @@ class acp_forums if ($db->sql_fetchrow($result)) { $template->assign_vars(array( - 'S_MOVE_FORUM_OPTIONS' => make_forum_select($forum_data['parent_id'], $subforums_id)) // , false, true, false??? + 'S_MOVE_FORUM_OPTIONS' => make_forum_select($forum_data['parent_id'], $subforums_id, false, true)) // , false, true, false??? ); } $db->sql_freeresult($result); @@ -989,7 +989,6 @@ class acp_forums if ($action_subforums == 'delete') { - $log_action_forums = 'FORUMS'; $rows = get_forum_branch($row['forum_id'], 'children', 'descending', false); foreach ($rows as $_row) @@ -1055,8 +1054,6 @@ class acp_forums return array($user->lang['NO_DESTINATION_FORUM']); } - $log_action_forums = 'MOVE_FORUMS'; - $sql = 'SELECT forum_name FROM ' . FORUMS_TABLE . ' WHERE forum_id = ' . $subforums_to_id; @@ -1115,11 +1112,9 @@ class acp_forums if ($row['forum_name'] != $forum_data_sql['forum_name']) { - // the forum name has changed, clear the parents list of child forums + // the forum name has changed, clear the parents list of all forums (for safety) $sql = 'UPDATE ' . FORUMS_TABLE . " - SET forum_parents = '' - WHERE left_id > " . $row['left_id'] . ' - AND right_id < ' . $row['right_id']; + SET forum_parents = ''"; $db->sql_query($sql); } @@ -1374,6 +1369,9 @@ class acp_forums } $db->sql_freeresult($result); + // Grab new forum data for correct tree updating later + $forum_data = $this->get_forum_info($forum_id); + $sql = 'UPDATE ' . FORUMS_TABLE . " SET parent_id = $subforums_to_id WHERE parent_id = $forum_id"; diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index 678a4f3bcf..f7b4d8fc66 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -358,35 +358,49 @@ class acp_groups $group_perm_from = request_var('group_perm_from', 0); // Copy permissions? - if ($group_perm_from && $action == 'add') + // If the user has the a_authgroups permission and at least one additional permission ability set the permissions are fully transfered. + // We do not limit on one auth category because this can lead to incomplete permissions being tricky to fix for the admin, roles being assigned or added non-default permissions. + // Since the user only has the option to copy permissions from non leader managed groups this seems to be a good compromise. + if ($group_perm_from && $action == 'add' && $auth->acl_get('a_authgroups') && $auth->acl_gets('a_aauth', 'a_fauth', 'a_mauth', 'a_uauth')) { - // From the mysql documentation: - // Prior to MySQL 4.0.14, the target table of the INSERT statement cannot appear in the FROM clause of the SELECT part of the query. This limitation is lifted in 4.0.14. - // Due to this we stay on the safe side if we do the insertion "the manual way" - - // Copy permisisons from/to the acl groups table (only group_id gets changed) - $sql = 'SELECT forum_id, auth_option_id, auth_role_id, auth_setting - FROM ' . ACL_GROUPS_TABLE . ' + $sql = 'SELECT group_manage_founder + FROM ' . GROUPS_TABLE . ' WHERE group_id = ' . $group_perm_from; $result = $db->sql_query($sql); - - $groups_sql_ary = array(); - while ($row = $db->sql_fetchrow($result)) - { - $groups_sql_ary[] = array( - 'group_id' => (int) $group_id, - 'forum_id' => (int) $row['forum_id'], - 'auth_option_id' => (int) $row['auth_option_id'], - 'auth_role_id' => (int) $row['auth_role_id'], - 'auth_setting' => (int) $row['auth_setting'] - ); - } + $check_row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - // Now insert the data - $db->sql_multi_insert(ACL_GROUPS_TABLE, $groups_sql_ary); + // Check the group if non-founder + if ($check_row && ($user->data['user_type'] == USER_FOUNDER || $check_row['group_manage_founder'] == 0)) + { + // From the mysql documentation: + // Prior to MySQL 4.0.14, the target table of the INSERT statement cannot appear in the FROM clause of the SELECT part of the query. This limitation is lifted in 4.0.14. + // Due to this we stay on the safe side if we do the insertion "the manual way" - $auth->acl_clear_prefetch(); + // Copy permisisons from/to the acl groups table (only group_id gets changed) + $sql = 'SELECT forum_id, auth_option_id, auth_role_id, auth_setting + FROM ' . ACL_GROUPS_TABLE . ' + WHERE group_id = ' . $group_perm_from; + $result = $db->sql_query($sql); + + $groups_sql_ary = array(); + while ($row = $db->sql_fetchrow($result)) + { + $groups_sql_ary[] = array( + 'group_id' => (int) $group_id, + 'forum_id' => (int) $row['forum_id'], + 'auth_option_id' => (int) $row['auth_option_id'], + 'auth_role_id' => (int) $row['auth_role_id'], + 'auth_setting' => (int) $row['auth_setting'] + ); + } + $db->sql_freeresult($result); + + // Now insert the data + $db->sql_multi_insert(ACL_GROUPS_TABLE, $groups_sql_ary); + + $auth->acl_clear_prefetch(); + } } $cache->destroy('sql', GROUPS_TABLE); @@ -494,6 +508,7 @@ class acp_groups $template->assign_vars(array( 'S_EDIT' => true, 'S_ADD_GROUP' => ($action == 'add') ? true : false, + 'S_GROUP_PERM' => ($action == 'add' && $auth->acl_get('a_authgroups') && $auth->acl_gets('a_aauth', 'a_fauth', 'a_mauth', 'a_uauth')) ? true : false, 'S_INCLUDE_SWATCH' => true, 'S_CAN_UPLOAD' => $can_upload, 'S_ERROR' => (sizeof($error)) ? true : false, @@ -518,7 +533,7 @@ class acp_groups 'S_DESC_SMILIES_CHECKED'=> $group_desc_data['allow_smilies'], 'S_RANK_OPTIONS' => $rank_options, - 'S_GROUP_OPTIONS' => group_select_options(0), + 'S_GROUP_OPTIONS' => group_select_options(false, false, (($user->data['user_type'] == USER_FOUNDER) ? false : 0)), 'AVATAR_IMAGE' => $avatar_img, 'AVATAR_MAX_FILESIZE' => $config['avatar_filesize'], 'GROUP_AVATAR_WIDTH' => (isset($group_row['group_avatar_width'])) ? $group_row['group_avatar_width'] : '', diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index f5e09582e4..bd942fe27f 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -203,14 +203,14 @@ class acp_icons $images = (isset($_POST['image'])) ? array_keys(request_var('image', array('' => 0))) : array(); // Now really get the items - $image_id = (isset($_POST['id'])) ? array_map('intval', $_POST['id']) : array(); - $image_order = (isset($_POST['order'])) ? array_map('intval', $_POST['order']) : array(); - $image_width = (isset($_POST['width'])) ? array_map('intval', $_POST['width']) : array(); - $image_height = (isset($_POST['height'])) ? array_map('intval', $_POST['height']) : array(); - $image_add = (isset($_POST['add_img'])) ? array_map('intval', $_POST['add_img']) : array(); + $image_id = (isset($_POST['id'])) ? request_var('id', array(0)) : array(); + $image_order = (isset($_POST['order'])) ? request_var('order', array(0)) : array(); + $image_width = (isset($_POST['width'])) ? request_var('width', array(0)) : array(); + $image_height = (isset($_POST['height'])) ? request_var('height', array(0)) : array(); + $image_add = (isset($_POST['add_img'])) ? request_var('add_img', array(0)) : array(); $image_emotion = request_var('emotion', array('' => '')); $image_code = request_var('code', array('' => '')); - $image_display_on_posting = (isset($_POST['display_on_posting'])) ? array_map('intval', $_POST['display_on_posting']) : array(); + $image_display_on_posting = (isset($_POST['display_on_posting'])) ? request_var('display_on_posting', array(0)) : array(); foreach ($images as $image) { @@ -530,32 +530,43 @@ class acp_icons case 'delete': - $sql = "DELETE FROM $table - WHERE {$fields}_id = $icon_id"; - $db->sql_query($sql); - - switch ($mode) + if (confirm_box(true)) { - case 'smilies': - break; + $sql = "DELETE FROM $table + WHERE {$fields}_id = $icon_id"; + $db->sql_query($sql); - case 'icons': - // Reset appropriate icon_ids - $db->sql_query('UPDATE ' . TOPICS_TABLE . " - SET icon_id = 0 - WHERE icon_id = $icon_id"); + switch ($mode) + { + case 'smilies': + break; - $db->sql_query('UPDATE ' . POSTS_TABLE . " - SET icon_id = 0 - WHERE icon_id = $icon_id"); + case 'icons': + // Reset appropriate icon_ids + $db->sql_query('UPDATE ' . TOPICS_TABLE . " + SET icon_id = 0 + WHERE icon_id = $icon_id"); - break; + $db->sql_query('UPDATE ' . POSTS_TABLE . " + SET icon_id = 0 + WHERE icon_id = $icon_id"); + break; + } + + $notice = $user->lang[$lang . '_DELETED']; + + $cache->destroy('icons'); + $cache->destroy('sql', $table); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'id' => $icon_id, + 'action' => 'delete', + ))); } - - $notice = $user->lang[$lang . '_DELETED']; - - $cache->destroy('icons'); - $cache->destroy('sql', $table); break; diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index 61017a059d..9a8bc9e251 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -347,7 +347,7 @@ class acp_permissions $template->assign_vars(array( 'S_SELECT_GROUP' => true, - 'S_GROUP_OPTIONS' => group_select_options(false)) + 'S_GROUP_OPTIONS' => group_select_options(false, false, (($user->data['user_type'] == USER_FOUNDER) ? false : 0))) ); break; @@ -393,7 +393,7 @@ class acp_permissions 'S_SELECT_USERGROUP_VIEW' => ($victim == 'usergroup_view') ? true : false, 'S_DEFINED_USER_OPTIONS' => $items['user_ids_options'], 'S_DEFINED_GROUP_OPTIONS' => $items['group_ids_options'], - 'S_ADD_GROUP_OPTIONS' => group_select_options(false, $items['group_ids']), + 'S_ADD_GROUP_OPTIONS' => group_select_options(false, $items['group_ids'], (($user->data['user_type'] == USER_FOUNDER) ? false : 0)), 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=add_user&field=username'), 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=add_user&field=username', false)) ); diff --git a/phpBB/includes/acp/acp_ranks.php b/phpBB/includes/acp/acp_ranks.php index db96b173e8..a52ff07607 100644 --- a/phpBB/includes/acp/acp_ranks.php +++ b/phpBB/includes/acp/acp_ranks.php @@ -62,11 +62,15 @@ class acp_ranks { $sql = 'UPDATE ' . RANKS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE rank_id = $rank_id"; $message = $user->lang['RANK_UPDATED']; + + add_log('admin', 'LOG_RANK_UPDATED', $rank_title); } else { $sql = 'INSERT INTO ' . RANKS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); $message = $user->lang['RANK_ADDED']; + + add_log('admin', 'LOG_RANK_ADDED', $rank_title); } $db->sql_query($sql); @@ -78,9 +82,20 @@ class acp_ranks case 'delete': - // Ok, they want to delete their rank - if ($rank_id) + if (!$rank_id) { + trigger_error($user->lang['MUST_SELECT_RANK'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if (confirm_box(true)) + { + $sql = 'SELECT rank_title + FROM ' . RANKS_TABLE . ' + WHERE rank_id = ' . $rank_id; + $result = $db->sql_query($sql); + $rank_title = (string) $db->sql_fetchfield('rank_title'); + $db->sql_freeresult($result); + $sql = 'DELETE FROM ' . RANKS_TABLE . " WHERE rank_id = $rank_id"; $db->sql_query($sql); @@ -92,11 +107,16 @@ class acp_ranks $cache->destroy('ranks'); - trigger_error($user->lang['RANK_REMOVED'] . adm_back_link($this->u_action)); + add_log('admin', 'LOG_RANK_REMOVED', $rank_title); } else { - trigger_error($user->lang['MUST_SELECT_RANK'] . adm_back_link($this->u_action), E_USER_WARNING); + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'rank_id' => $rank_id, + 'action' => 'delete', + ))); } break; diff --git a/phpBB/includes/acp/acp_words.php b/phpBB/includes/acp/acp_words.php index e087c4f8af..a35b7e5156 100644 --- a/phpBB/includes/acp/acp_words.php +++ b/phpBB/includes/acp/acp_words.php @@ -110,23 +110,35 @@ class acp_words trigger_error($user->lang['NO_WORD'] . adm_back_link($this->u_action), E_USER_WARNING); } - $sql = 'SELECT word - FROM ' . WORDS_TABLE . " - WHERE word_id = $word_id"; - $result = $db->sql_query($sql); - $deleted_word = $db->sql_fetchfield('word'); - $db->sql_freeresult($result); + if (confirm_box(true)) + { + $sql = 'SELECT word + FROM ' . WORDS_TABLE . " + WHERE word_id = $word_id"; + $result = $db->sql_query($sql); + $deleted_word = $db->sql_fetchfield('word'); + $db->sql_freeresult($result); - $sql = 'DELETE FROM ' . WORDS_TABLE . " - WHERE word_id = $word_id"; - $db->sql_query($sql); + $sql = 'DELETE FROM ' . WORDS_TABLE . " + WHERE word_id = $word_id"; + $db->sql_query($sql); - $cache->destroy('word_censors'); + $cache->destroy('word_censors'); - add_log('admin', 'LOG_WORD_DELETE', $deleted_word); + add_log('admin', 'LOG_WORD_DELETE', $deleted_word); + + trigger_error($user->lang['WORD_REMOVED'] . adm_back_link($this->u_action)); + } + else + { + confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array( + 'i' => $id, + 'mode' => $mode, + 'id' => $word_id, + 'action' => 'delete', + ))); + } - trigger_error($user->lang['WORD_REMOVED'] . adm_back_link($this->u_action)); - break; } diff --git a/phpBB/includes/acp/info/acp_update.php b/phpBB/includes/acp/info/acp_update.php index 014d67ff2b..0355c583f3 100644 --- a/phpBB/includes/acp/info/acp_update.php +++ b/phpBB/includes/acp/info/acp_update.php @@ -20,7 +20,7 @@ class acp_update_info 'title' => 'ACP_UPDATE', 'version' => '1.0.0', 'modes' => array( - 'version_check' => array('title' => 'ACP_VERSION_CHECK', 'auth' => 'acl_a_', 'cat' => array('ACP_AUTOMATION')), + 'version_check' => array('title' => 'ACP_VERSION_CHECK', 'auth' => 'acl_a_board', 'cat' => array('ACP_AUTOMATION')), ), ); } diff --git a/phpBB/includes/cache.php b/phpBB/includes/cache.php index 6266d32c0f..c5a4a080a5 100644 --- a/phpBB/includes/cache.php +++ b/phpBB/includes/cache.php @@ -173,21 +173,29 @@ class cache extends acm /** * Obtain allowed extensions + * + * @param mixed $forum_id If false then check for private messaging, if int then check for forum id. If true, then only return extension informations. + * + * @return array allowed extensions array. */ - function obtain_attach_extensions($forum_id = false) + function obtain_attach_extensions($forum_id) { if (($extensions = $this->get('_extensions')) === false) { global $db; - + + $extensions = array( + '_allowed_post' => array(), + '_allowed_pm' => array(), + ); + // The rule is to only allow those extensions defined. ;) $sql = 'SELECT e.extension, g.* FROM ' . EXTENSIONS_TABLE . ' e, ' . EXTENSION_GROUPS_TABLE . ' g WHERE e.group_id = g.group_id - AND g.allow_group = 1'; + AND (g.allow_group = 1 OR g.allow_in_pm = 1)'; $result = $db->sql_query($sql); - $extensions = array('_allowed_' => array()); while ($row = $db->sql_fetchrow($result)) { $extension = strtolower(trim($row['extension'])); @@ -196,47 +204,62 @@ class cache extends acm 'display_cat' => (int) $row['cat_id'], 'download_mode' => (int) $row['download_mode'], 'upload_icon' => trim($row['upload_icon']), - 'max_filesize' => (int) $row['max_filesize'] + 'max_filesize' => (int) $row['max_filesize'], + 'allow_group' => $row['allow_group'], + 'allow_in_pm' => $row['allow_in_pm'], ); $allowed_forums = ($row['allowed_forums']) ? unserialize(trim($row['allowed_forums'])) : array(); - if ($row['allow_in_pm']) + // Store allowed extensions forum wise + if ($row['allow_group']) { - $allowed_forums = array_merge($allowed_forums, array(0)); + $extensions['_allowed_post'][$extension] = (!sizeof($allowed_forums)) ? 0 : $allowed_forums; } - // Store allowed extensions forum wise - $extensions['_allowed_'][$extension] = (!sizeof($allowed_forums)) ? 0 : $allowed_forums; + if ($row['allow_in_pm']) + { + $extensions['_allowed_pm'][$extension] = 0; + } } $db->sql_freeresult($result); $this->put('_extensions', $extensions); } - if ($forum_id !== false) + // Forum post + if ($forum_id === false) { - $return = array(); + // We are checking for private messages, therefore we only need to get the pm extensions... + $return = array('_allowed_' => array()); - foreach ($extensions['_allowed_'] as $extension => $check) + foreach ($extensions['_allowed_pm'] as $extension => $check) { - $allowed = false; + $return['_allowed_'][$extension] = 0; + $return[$extension] = $extensions[$extension]; + } + $extensions = $return; + } + else if ($forum_id === true) + { + return $extensions; + } + else + { + $forum_id = (int) $forum_id; + $return = array('_allowed_' => array()); + + foreach ($extensions['_allowed_post'] as $extension => $check) + { + // Check for allowed forums if (is_array($check)) { - // Check for private messaging AND all forums allowed - if (sizeof($check) == 1 && $check[0] == 0) - { - $allowed = true; - } - else - { - $allowed = (!in_array($forum_id, $check)) ? false : true; - } + $allowed = (!in_array($forum_id, $check)) ? false : true; } else { - $allowed = ($forum_id === 0) ? false : true; + $allowed = true; } if ($allowed) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index a88e3be9bf..8e1df45cb0 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2446,7 +2446,7 @@ function smiley_text($text, $force_option = false) /** * General attachment parsing * -* @param int $forum_id The forum id the attachments are displayed in (0 for private messages) +* @param mixed $forum_id The forum id the attachments are displayed in (false if in private message) * @param string &$message The post/private message * @param array &$attachments The attachments to parse for (inline) display. The attachments array will hold templated data after parsing. * @param array &$update_count The attachment counts to be updated - will be filled @@ -2475,7 +2475,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count, if (empty($extensions) || !is_array($extensions)) { - $extensions = $cache->obtain_attach_extensions(); + $extensions = $cache->obtain_attach_extensions($forum_id); } // Look for missing attachment information... @@ -2620,7 +2620,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count, } } - $download_link = (!$force_physical && $attachment['attach_id']) ? append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $attachment['attach_id'] . '&f=' . $forum_id) : $filename; + $download_link = (!$force_physical && $attachment['attach_id']) ? append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $attachment['attach_id'] . '&f=' . (int) $forum_id) : $filename; switch ($display_cat) { @@ -2638,7 +2638,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count, // Images, but display Thumbnail case ATTACHMENT_CATEGORY_THUMB: $l_downloaded_viewed = $user->lang['VIEWED']; - $thumbnail_link = (!$force_physical && $attachment['attach_id']) ? append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $attachment['attach_id'] . '&t=1&f=' . $forum_id) : $thumbnail_filename; + $thumbnail_link = (!$force_physical && $attachment['attach_id']) ? append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $attachment['attach_id'] . '&t=1&f=' . (int) $forum_id) : $thumbnail_filename; $block_array += array( 'S_THUMBNAIL' => true, @@ -2754,35 +2754,23 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count, } /** -* Check if extension is allowed to be posted within forum X (forum_id 0 == private messaging) +* Check if extension is allowed to be posted. +* +* @param mixed $forum_id The forum id to check or false if private message +* @param string $extension The extension to check, for example zip. +* @param array &$extensions The extension array holding the information from the cache (will be obtained if empty) +* +* @return bool False if the extension is not allowed to be posted, else true. */ function extension_allowed($forum_id, $extension, &$extensions) { - if (!sizeof($extensions)) + if (empty($extensions)) { global $cache; - $extensions = $cache->obtain_attach_extensions(); + $extensions = $cache->obtain_attach_extensions($forum_id); } - if (!isset($extensions['_allowed_'][$extension])) - { - return false; - } - - $check = $extensions['_allowed_'][$extension]; - - if (is_array($check)) - { - // Check for private messaging AND all forums allowed - if (sizeof($check) == 1 && $check[0] == 0) - { - return true; - } - - return (!in_array($forum_id, $check)) ? false : true; - } - - return ($forum_id == 0) ? false : true; + return (!isset($extensions['_allowed_'][$extension])) ? false : true; } // Little helpers @@ -3700,10 +3688,9 @@ function page_header($page_title = '', $display_online_list = true) 'SITE_LOGO_IMG' => $user->img('site_logo')) ); - if ($config['send_encoding']) - { - header('Content-type: text/html; charset=UTF-8'); - } + // application/xhtml+xml not used because of IE + header('Content-type: text/html; charset=UTF-8'); + header('Cache-Control: private, no-cache="set-cookie"'); header('Expires: 0'); header('Pragma: no-cache'); diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 23f243168f..a94504d3d2 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -200,19 +200,27 @@ function size_select_options($size_compare) } /** -* Generate list of groups +* Generate list of groups (option fields without select) +* +* @param int $group_id The default group id to mark as selected +* @param array $exclude_ids The group ids to exclude from the list, false (default) if you whish to exclude no id +* @param int $manage_founder If set to false (default) all groups are returned, if 0 only those groups returned not being managed by founders only, if 1 only those groups returned managed by founders only. +* +* @return string The list of options. */ -function group_select_options($group_id, $exclude_ids = false) +function group_select_options($group_id, $exclude_ids = false, $manage_founder = false) { global $db, $user, $config; $exclude_sql = ($exclude_ids !== false && sizeof($exclude_ids)) ? 'WHERE ' . $db->sql_in_set('group_id', array_map('intval', $exclude_ids), true) : ''; $sql_and = (!$config['coppa_enable']) ? (($exclude_sql) ? ' AND ' : ' WHERE ') . "group_name <> 'REGISTERED_COPPA'" : ''; + $sql_founder = ($manage_founder !== false) ? (($exclude_sql || $sql_and) ? ' AND ' : ' WHERE ') . 'group_founder_manage = ' . (int) $manage_founder : ''; $sql = 'SELECT group_id, group_name, group_type FROM ' . GROUPS_TABLE . " $exclude_sql $sql_and + $sql_founder ORDER BY group_type DESC, group_name ASC"; $result = $db->sql_query($sql); diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 242eb871ae..47e7e67c17 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -563,18 +563,43 @@ function get_moderators(&$forum_moderators, $forum_id = false) return; } - $forum_sql = 'AND ' . $db->sql_in_set('forum_id', $forum_id); + $forum_sql = 'AND m.' . $db->sql_in_set('forum_id', $forum_id); } - $sql = 'SELECT * - FROM ' . MODERATOR_CACHE_TABLE . " - WHERE display_on_index = 1 - $forum_sql"; + $sql_array = array( + 'SELECT' => 'm.*, u.user_colour, g.group_colour, g.group_type', + + 'FROM' => array( + MODERATOR_CACHE_TABLE => 'm', + ), + + 'LEFT_JOIN' => array( + array( + 'FROM' => array(USERS_TABLE => 'u'), + 'ON' => 'm.user_id = u.user_id', + ), + array( + 'FROM' => array(GROUPS_TABLE => 'g'), + 'ON' => 'm.group_id = g.group_id', + ), + ), + + 'WHERE' => "m.display_on_index = 1 $forum_sql", + ); + + $sql = $db->sql_build_query('SELECT', $sql_array); $result = $db->sql_query($sql, 3600); while ($row = $db->sql_fetchrow($result)) { - $forum_moderators[$row['forum_id']][] = (!empty($row['user_id'])) ? '' . $row['username'] . '' : '' . $row['group_name'] . ''; + if (!empty($row['user_id'])) + { + $forum_moderators[$row['forum_id']][] = get_username_string('full', $row['user_id'], $row['username'], $row['user_colour']); + } + else + { + $forum_moderators[$row['forum_id']][] = '' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . ''; + } } $db->sql_freeresult($result); @@ -846,13 +871,15 @@ function display_user_activity(&$userdata) $active_t_pct = ($userdata['user_posts']) ? ($active_t_count / $userdata['user_posts']) * 100 : 0; } + $l_active_pct = ($userdata['user_id'] != ANONYMOUS && $userdata['user_id'] == $user->data['user_id']) ? $user->lang['POST_PCT_ACTIVE_OWN'] : $user->lang['POST_PCT_ACTIVE']; + $template->assign_vars(array( 'ACTIVE_FORUM' => $active_f_name, 'ACTIVE_FORUM_POSTS' => ($active_f_count == 1) ? sprintf($user->lang['USER_POST'], 1) : sprintf($user->lang['USER_POSTS'], $active_f_count), - 'ACTIVE_FORUM_PCT' => sprintf($user->lang['POST_PCT_ACTIVE'], $active_f_pct), + 'ACTIVE_FORUM_PCT' => sprintf($l_active_pct, $active_f_pct), 'ACTIVE_TOPIC' => censor_text($active_t_name), 'ACTIVE_TOPIC_POSTS' => ($active_t_count == 1) ? sprintf($user->lang['USER_POST'], 1) : sprintf($user->lang['USER_POSTS'], $active_t_count), - 'ACTIVE_TOPIC_PCT' => sprintf($user->lang['POST_PCT_ACTIVE'], $active_t_pct), + 'ACTIVE_TOPIC_PCT' => sprintf($l_active_pct, $active_t_pct), 'U_ACTIVE_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $active_f_id), 'U_ACTIVE_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 't=' . $active_t_id), 'S_SHOW_ACTIVITY' => true) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 5805e654c6..fa839f038d 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -338,7 +338,7 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage return $filedata; } - $extensions = $cache->obtain_attach_extensions($forum_id); + $extensions = $cache->obtain_attach_extensions((($is_message) ? false : (int) $forum_id)); $upload->set_allowed_extensions(array_keys($extensions['_allowed_'])); $file = ($local) ? $upload->local_upload($local_storage) : $upload->form_upload($form_name); diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 0fcc42def1..a3a99bd4ec 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -831,7 +831,7 @@ function handle_mark_actions($user_id, $mark_action) { global $db, $user, $_POST, $phpbb_root_path, $phpEx; - $msg_ids = (isset($_POST['marked_msg_id'])) ? array_map('intval', $_POST['marked_msg_id']) : array(); + $msg_ids = request_var('marked_msg_id', array(0)); $cur_folder_id = request_var('cur_folder_id', PRIVMSGS_NO_BOX); $confirm = (isset($_POST['confirm'])) ? true : false; diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 5991243d64..e36d3571f6 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -746,19 +746,6 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas $ip_1_counter++; } } - else if (preg_match('#^([\w\-_]\.?){2,}$#is', trim($ban_item))) - { - // hostname - $ip_ary = gethostbynamel(trim($ban_item)); - - foreach ($ip_ary as $ip) - { - if ($ip) - { - $banlist_ary[] = $ip; - } - } - } else if (preg_match('#^([0-9]{1,3})\.([0-9\*]{1,3})\.([0-9\*]{1,3})\.([0-9\*]{1,3})$#', trim($ban_item)) || preg_match('#^[a-f0-9:]+\*?$#i', trim($ban_item))) { // Normal IP address @@ -769,6 +756,22 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas // Ban all IPs $banlist_ary[] = "*"; } + else if (preg_match('#^([\w\-_]\.?){2,}$#is', trim($ban_item))) + { + // hostname + $ip_ary = gethostbynamel(trim($ban_item)); + + if (!empty($ip_ary)) + { + foreach ($ip_ary as $ip) + { + if ($ip) + { + $banlist_ary[] = $ip; + } + } + } + } else { trigger_error('NO_IPS_DEFINED'); diff --git a/phpBB/includes/ucp/ucp_attachments.php b/phpBB/includes/ucp/ucp_attachments.php index 2312d1f30d..f995f05bf6 100644 --- a/phpBB/includes/ucp/ucp_attachments.php +++ b/phpBB/includes/ucp/ucp_attachments.php @@ -27,7 +27,7 @@ class ucp_attachments $delete = (isset($_POST['delete'])) ? true : false; $confirm = (isset($_POST['confirm'])) ? true : false; - $delete_ids = isset($_REQUEST['attachment']) ? array_keys(array_map('intval', $_REQUEST['attachment'])) : array(); + $delete_ids = request_var('attachment', array(0)); if ($delete && sizeof($delete_ids)) { diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index 57a8d0f86a..6678c362c0 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -193,8 +193,8 @@ class ucp_main if ($unwatch) { - $forums = (isset($_POST['f'])) ? array_map('intval', array_keys($_POST['f'])) : array(); - $topics = (isset($_POST['t'])) ? array_map('intval', array_keys($_POST['t'])) : array(); + $forums = array_keys(request_var('f', array(0 => 0))); + $topics = array_keys(request_var('t', array(0 => 0))); if (sizeof($forums) || sizeof($topics)) { @@ -512,7 +512,7 @@ class ucp_main if (isset($_POST['unbookmark'])) { $s_hidden_fields = array('unbookmark' => 1); - $topics = (isset($_POST['t'])) ? array_map('intval', array_keys($_POST['t'])) : array(); + $topics = (isset($_POST['t'])) ? array_keys(request_var('t', array(0 => 0))) : array(); $url = $this->u_action; if (!sizeof($topics)) @@ -644,7 +644,7 @@ class ucp_main if ($delete) { - $drafts = (!empty($_POST['d'])) ? array_map('intval', array_keys($_POST['d'])) : array(); + $drafts = array_keys(request_var('d', array(0 => 0))); if (sizeof($drafts)) { diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php index 50eb91297d..b9c069e47e 100644 --- a/phpBB/includes/ucp/ucp_pm.php +++ b/phpBB/includes/ucp/ucp_pm.php @@ -218,7 +218,7 @@ class ucp_pm // Move PM if ($move_pm) { - $move_msg_ids = (isset($_POST['marked_msg_id'])) ? array_map('intval', $_POST['marked_msg_id']) : array(); + $move_msg_ids = (isset($_POST['marked_msg_id'])) ? request_var('marked_msg_id', array(0)) : array(); $cur_folder_id = request_var('cur_folder_id', PRIVMSGS_NO_BOX); if (move_pm($user->data['user_id'], $user->data['message_limit'], $move_msg_ids, $dest_folder, $cur_folder_id)) diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 0dd85c06ae..3b41827aa7 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -605,7 +605,7 @@ function compose_pm($id, $mode, $action) $update_count = array(); $attachment_data = $message_parser->attachment_data; - parse_attachments(0, $preview_message, $attachment_data, $update_count, true); + parse_attachments(false, $preview_message, $attachment_data, $update_count, true); foreach ($attachment_data as $i => $attachment) { diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php index d87acfee69..60591f2031 100644 --- a/phpBB/includes/ucp/ucp_pm_viewmessage.php +++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php @@ -120,7 +120,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row) if (!empty($attachments)) { $update_count = array(); - parse_attachments(0, $message, $attachments, $update_count); + parse_attachments(false, $message, $attachments, $update_count); // Update the attachment download counts if (sizeof($update_count)) diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 42c7e101f8..a003254df3 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -324,6 +324,7 @@ $database_update_info = array( USERS_TABLE => array( 'user_options' => array('UINT:11', 895), ), + ), // Remove the following keys 'drop_keys' => array( ZEBRA_TABLE => array( @@ -564,6 +565,10 @@ if (version_compare($current_version, '3.0.b4', '<=')) set_config('ldap_user', ''); set_config('fulltext_native_common_thres', '20'); + // Remove config variables + $sql = 'DELETE FROM ' . CONFIG_TABLE . " WHERE config_name = 'send_encoding'"; + _sql($sql, $errored, $error_ary); + $sql = 'SELECT user_colour FROM ' . USERS_TABLE . ' WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ') @@ -607,6 +612,10 @@ if (version_compare($current_version, '3.0.b4', '<=')) $sql = 'UPDATE ' . USERS_TABLE . ' SET user_options = 895 WHERE user_options = 893'; _sql($sql, $errored, $error_ary); + $sql = 'UPDATE ' . MODULES_TABLE . " SET module_auth = 'acl_a_board' + WHERE module_class = 'acp' AND module_mode = 'version_check' AND module_auth = 'acl_a_'"; + _sql($sql, $errored, $error_ary); + $no_updates = false; } diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index d1bc1ee376..7c20f39679 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -185,7 +185,6 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('search_store_resul INSERT INTO phpbb_config (config_name, config_value) VALUES ('secure_allow_deny', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('secure_allow_empty_referer', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('secure_downloads', '0'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('send_encoding', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_name', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_port', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_protocol', ''); diff --git a/phpBB/language/en/acp/attachments.php b/phpBB/language/en/acp/attachments.php index c906834f5d..85143d3eb2 100644 --- a/phpBB/language/en/acp/attachments.php +++ b/phpBB/language/en/acp/attachments.php @@ -121,6 +121,7 @@ $lang = array_merge($lang, array( 'NO_UPLOAD_DIR' => 'The upload directory you specified does not exist.', 'NO_WRITE_UPLOAD' => 'The upload directory you specified cannot be written to. Please alter the permissions to allow the webserver to write to it.', + 'ONLY_ALLOWED_IN_PM' => 'Only allowed in private messages', 'ORDER_ALLOW_DENY' => 'Allow', 'ORDER_DENY_ALLOW' => 'Deny', diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 3aee12ad37..3bf098312c 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -315,8 +315,6 @@ $lang = array_merge($lang, array( 'RANKS_PATH_EXPLAIN' => 'Path under your phpBB root directory, e.g. images/ranks', 'SCRIPT_PATH' => 'Script path', 'SCRIPT_PATH_EXPLAIN' => 'The path where phpBB is located relative to the domain name, e.g. /phpBB3', - 'SEND_ENCODING' => 'Send encoding', - 'SEND_ENCODING_EXPLAIN' => 'Send the file encoding from phpBB via HTTP overriding the webserver’s configuration', 'SERVER_NAME' => 'Domain name', 'SERVER_NAME_EXPLAIN' => 'The domain name this board runs from (for example: www.foo.bar)', 'SERVER_PORT' => 'Server port', diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index e60eda4209..8ac4602dd9 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -559,6 +559,10 @@ $lang = array_merge($lang, array( 'LOG_PRUNE_USER_DEL_DEL' => 'Users pruned and posts deleted
» %s', 'LOG_PRUNE_USER_DEL_ANON' => 'Users pruned and posts retained
» %s', + 'LOG_RANK_ADDED' => 'Added new rank
» %s', + 'LOG_RANK_REMOVED' => 'Removed rank
» %s', + 'LOG_RANK_UPDATED' => 'Updated rank
» %s', + 'LOG_REASON_ADDED' => 'Added report/denial reason
» %s', 'LOG_REASON_REMOVED' => 'Removed report/denial reason
» %s', 'LOG_REASON_UPDATED' => 'Updated report/denial reason
» %s', diff --git a/phpBB/language/en/acp/permissions_phpbb.php b/phpBB/language/en/acp/permissions_phpbb.php index df2d9e8c6f..8f936ec6e1 100644 --- a/phpBB/language/en/acp/permissions_phpbb.php +++ b/phpBB/language/en/acp/permissions_phpbb.php @@ -181,7 +181,7 @@ $lang = array_merge($lang, array( // Admin Permissions $lang = array_merge($lang, array( - 'acl_a_board' => array('lang' => 'Can alter board settings', 'cat' => 'settings'), + 'acl_a_board' => array('lang' => 'Can alter board settings/check for updates', 'cat' => 'settings'), 'acl_a_server' => array('lang' => 'Can alter server/communication settings', 'cat' => 'settings'), 'acl_a_jabber' => array('lang' => 'Can alter Jabber settings', 'cat' => 'settings'), 'acl_a_phpinfo' => array('lang' => 'Can view php settings', 'cat' => 'settings'), diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index f31968f885..0bd4a1e454 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -381,7 +381,8 @@ $lang = array_merge($lang, array( 'POST_DETAILS' => 'Post details', 'POST_NEW_TOPIC' => 'Post new topic', 'POST_PCT' => '%.2f%% of all posts', - 'POST_PCT_ACTIVE' => '%.2f%% of your posts', + 'POST_PCT_ACTIVE' => '%.2f%% of user’s posts', + 'POST_PCT_ACTIVE_OWN' => '%.2f%% of your posts', 'POST_REPORTED' => 'Click to view report', 'POST_SUBJECT' => 'Post subject', 'POST_TIME' => 'Post time', diff --git a/phpBB/styles/subSilver/template/memberlist_view.html b/phpBB/styles/subSilver/template/memberlist_view.html index 4c7cabc5e9..e235a0e180 100644 --- a/phpBB/styles/subSilver/template/memberlist_view.html +++ b/phpBB/styles/subSilver/template/memberlist_view.html @@ -83,7 +83,7 @@
- +
{L_WORD} {L_REPLACEMENT}{L_ACTION}{L_ACTION}
{words.WORD} {words.REPLACEMENT} {L_EDIT}  {L_DELETE}  {ICON_EDIT}  {ICON_DELETE} 
{L_ACTIVE_IN_TOPIC}: {ACTIVE_TOPIC}
[ {ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT} ]-
{ACTIVE_TOPIC}
[ {ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT} ]-
diff --git a/phpBB/styles/subSilver/template/ucp_main_front.html b/phpBB/styles/subSilver/template/ucp_main_front.html index 54257d72ea..af749b314b 100644 --- a/phpBB/styles/subSilver/template/ucp_main_front.html +++ b/phpBB/styles/subSilver/template/ucp_main_front.html @@ -52,7 +52,7 @@
{L_ACTIVE_IN_TOPIC}: {ACTIVE_TOPIC}
[ {ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT} ]-
{ACTIVE_TOPIC}
[ {ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT} ]-
- + diff --git a/phpBB/styles/subSilver/template/mcp_notes_user.html b/phpBB/styles/subSilver/template/mcp_notes_user.html index 094ee093d8..095627db4d 100755 --- a/phpBB/styles/subSilver/template/mcp_notes_user.html +++ b/phpBB/styles/subSilver/template/mcp_notes_user.html @@ -12,9 +12,9 @@ - + - + diff --git a/phpBB/styles/subSilver/template/mcp_warn_post.html b/phpBB/styles/subSilver/template/mcp_warn_post.html index 896f813d75..957e9416d8 100755 --- a/phpBB/styles/subSilver/template/mcp_warn_post.html +++ b/phpBB/styles/subSilver/template/mcp_warn_post.html @@ -10,9 +10,9 @@ - + - + diff --git a/phpBB/styles/subSilver/template/mcp_warn_user.html b/phpBB/styles/subSilver/template/mcp_warn_user.html index 4598faed26..61a1a5da1d 100755 --- a/phpBB/styles/subSilver/template/mcp_warn_user.html +++ b/phpBB/styles/subSilver/template/mcp_warn_user.html @@ -10,9 +10,9 @@ - + - + diff --git a/phpBB/styles/subSilver/template/memberlist_view.html b/phpBB/styles/subSilver/template/memberlist_view.html index e235a0e180..70a87aad3e 100644 --- a/phpBB/styles/subSilver/template/memberlist_view.html +++ b/phpBB/styles/subSilver/template/memberlist_view.html @@ -24,9 +24,9 @@ - + - + diff --git a/phpBB/styles/subSilver/template/overall_header.html b/phpBB/styles/subSilver/template/overall_header.html index 092d85aac1..ae97057452 100644 --- a/phpBB/styles/subSilver/template/overall_header.html +++ b/phpBB/styles/subSilver/template/overall_header.html @@ -149,12 +149,21 @@ function marklist(id, name, state) {L_LOGIN_LOGOUT} {L_LOGIN_LOGOUT}   {L_RESTORE_PERMISSIONS} {L_RESTORE_PERMISSIONS}  {L_BOARD_DISABLED} - -  {L_PRIVATE_MESSAGES} {PRIVATE_MESSAGE_INFO}, {PRIVATE_MESSAGE_INFO_UNREAD} -  {L_REGISTER} {L_REGISTER} + + +  {L_PRIVATE_MESSAGES} {PRIVATE_MESSAGE_INFO}, {PRIVATE_MESSAGE_INFO_UNREAD} +  {L_REGISTER} {L_REGISTER} + + + + -
{L_MARK_FORUMS_READ} {L_MARK_FORUMS_READ} 
 {L_FORUM} 
{USERNAME}
{RANK}{RANK_TITLE}
{USERNAME}
{RANK}{RANK_TITLE}
{USERNAME}
{RANK}{RANK_TITLE}
{USERNAME} [ {L_USER_ADMIN} ]
{RANK}{RANK_TITLE}
+ {L_FAQ} {L_FAQ} +    {L_SEARCH} {L_SEARCH} + +    {L_MEMBERLIST} {L_MEMBERLIST} +    {L_PROFILE} {L_PROFILE} {L_FAQ} {L_FAQ}   {L_SEARCH} {L_SEARCH}   {L_MEMBERLIST} {L_MEMBERLIST}   {L_PROFILE} {L_PROFILE}

diff --git a/phpBB/styles/subSilver/template/viewforum_body.html b/phpBB/styles/subSilver/template/viewforum_body.html index d357f45279..160749532a 100644 --- a/phpBB/styles/subSilver/template/viewforum_body.html +++ b/phpBB/styles/subSilver/template/viewforum_body.html @@ -136,7 +136,7 @@ - + @@ -154,8 +154,8 @@ @@ -238,7 +238,7 @@
{POST_IMG} - - + +
- + diff --git a/phpBB/styles/subSilver/template/viewtopic_body.html b/phpBB/styles/subSilver/template/viewtopic_body.html index bee02f94ee..dcd62dca13 100644 --- a/phpBB/styles/subSilver/template/viewtopic_body.html +++ b/phpBB/styles/subSilver/template/viewtopic_body.html @@ -31,7 +31,7 @@
{POST_IMG}{POST_IMG}  [ {TOTAL_TOPICS} ]
- + @@ -46,13 +46,15 @@
{POST_IMG} {REPLY_IMG}{POST_IMG} {REPLY_IMG}  [ {TOTAL_POSTS} ] 
- +
@@ -158,14 +160,14 @@ {postrow.ONLINE_IMG} - + - {postrow.POSTER_RANK} + {postrow.RANK_TITLE} - + - {postrow.RANK_IMAGE} + {postrow.RANK_IMG} @@ -255,10 +257,12 @@
+ {REPORT_IMG} {INFO_IMG} {WARN_IMG} {DELETE_IMG} +
@@ -271,7 +275,7 @@   - + @@ -290,7 +294,7 @@ - + diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 73d8c161bc..ee15a89d7a 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1382,9 +1382,9 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) 'POST_AUTHOR' => get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), 'U_POST_AUTHOR' => get_username_string('profile', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), - 'POSTER_RANK' => $user_cache[$poster_id]['rank_title'], - 'RANK_IMAGE' => $user_cache[$poster_id]['rank_image'], - 'RANK_IMAGE_SRC' => $user_cache[$poster_id]['rank_image_src'], + 'RANK_TITLE' => $user_cache[$poster_id]['rank_title'], + 'RANK_IMG' => $user_cache[$poster_id]['rank_image'], + 'RANK_IMG_SRC' => $user_cache[$poster_id]['rank_image_src'], 'POSTER_JOINED' => $user_cache[$poster_id]['joined'], 'POSTER_POSTS' => $user_cache[$poster_id]['posts'], 'POSTER_FROM' => $user_cache[$poster_id]['from'], From cbb50049a575a64e481f94e0a51280507d3d19ba Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 28 Dec 2006 17:28:28 +0000 Subject: [PATCH 134/264] - add return links to approve details [#6252] - lets decide on input field or textarea based on the entry length in language pack management [#6280] git-svn-id: file:///svn/phpbb/trunk@6819 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/acp_language.html | 6 +- phpBB/includes/acp/acp_language.php | 147 ++++++------------ phpBB/includes/mcp/mcp_queue.php | 9 +- phpBB/includes/utf/utf_tools.php | 8 + phpBB/language/en/mcp.php | 1 + phpBB/styles/subSilver/template/mcp_post.html | 2 +- 6 files changed, 67 insertions(+), 106 deletions(-) diff --git a/phpBB/adm/style/acp_language.html b/phpBB/adm/style/acp_language.html index d7a4a31901..37b1e032f2 100644 --- a/phpBB/adm/style/acp_language.html +++ b/phpBB/adm/style/acp_language.html @@ -72,7 +72,7 @@

{L_MISSING_LANG_VARIABLES}

{L_MISSING_VARS_EXPLAIN}

- +
{POST_IMG} {REPLY_IMG}{POST_IMG} {REPLY_IMG}  [ {TOTAL_POSTS} ] 
@@ -104,14 +104,14 @@

{L_LANGUAGE_ENTRIES_EXPLAIN}

- +
- +
 
diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php index abd01b6263..94a79fa2d3 100644 --- a/phpBB/includes/acp/acp_language.php +++ b/phpBB/includes/acp/acp_language.php @@ -622,16 +622,15 @@ class acp_language if (!$is_email_file) { - $method = ($is_help_file) ? 'print_help_entries' : 'print_language_entries'; $tpl = ''; $name = (($this->language_directory) ? $this->language_directory . '/' : '') . $this->language_file; if (isset($missing_vars[$name]) && sizeof($missing_vars[$name])) { - $tpl .= $this->$method($missing_vars[$name], '* '); + $tpl .= $this->print_language_entries($missing_vars[$name], '* '); } - $tpl .= $this->$method($lang); + $tpl .= $this->print_language_entries($lang); $template->assign_var('TPL', $tpl); unset($tpl); @@ -950,7 +949,7 @@ class acp_language * {FILENAME} [{LANG_NAME}] * * @package language -* @copyright (c) 2006 phpBB Group +* @copyright (c) ' . date('Y') . ' phpBB Group * @author {CHANGED} - {AUTHOR} * @license http://opensource.org/licenses/gpl-license.php GNU Public License * @@ -1029,6 +1028,35 @@ $lang = array_merge($lang, array( } } + /** + * Little helper to add some hardcoded template bits + */ + function add_input_field() + { + $keys = func_get_args(); + + $non_static = array_shift($keys); + $value = array_shift($keys); + + if (!$non_static) + { + return '' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . ''; + } + + // If more then 270 characters, then we present a textarea, else an input field + $textarea = (utf8_strlen($value) > 270) ? true : false; + $tpl = ''; + + $tpl .= ($textarea) ? '' : '" />'; + + return $tpl; + } + /** * Print language entries */ @@ -1040,56 +1068,46 @@ $lang = array_merge($lang, array( { if (is_array($value)) { + // Write key $tpl .= ' - + '; foreach ($value as $_key => $_value) { if (is_array($_value)) { + // Write key $tpl .= ' - + '; foreach ($_value as $__key => $__value) { + // Write key $tpl .= ' - + '; } } else { + // Write key $tpl .= ' - + '; } @@ -1102,84 +1120,13 @@ $lang = array_merge($lang, array( } else { + // Write key $tpl .= ' - + - '; - } - } - - return $tpl; - } - - /** - * Print help entries - */ - function print_help_entries(&$lang_ary, $key_prefix = '', $text_field = true) - { - $tpl = ''; - - foreach ($lang_ary as $key => $value) - { - if (is_array($value)) - { - $tpl .= ' - - - '; - - foreach ($value as $_key => $_value) - { - $tpl .= ' - - - - '; - } - - $tpl .= ' - - - '; - } - else - { - $tpl .= ' - - - '; diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 48756c640e..d175cfa3fe 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -110,6 +110,9 @@ class mcp_queue } $message = smiley_text($message); + $post_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&p=' . $post_info['post_id'] . '#p' . $post_info['post_id']); + $topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&t=' . $post_info['topic_id']); + $template->assign_vars(array( 'S_MCP_QUEUE' => true, 'S_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&p=$post_id&f=$forum_id"), @@ -124,10 +127,12 @@ class mcp_queue 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $post_info['forum_id'] . '&p=' . $post_id), 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $post_info['user_id']), 'U_MCP_WARN_USER' => ($auth->acl_getf_global('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user&u=' . $post_info['user_id']) : '', - 'U_VIEW_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&p=' . $post_info['post_id'] . '#p' . $post_info['post_id']), - 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&t=' . $post_info['topic_id']), + 'U_VIEW_POST' => $post_url, + 'U_VIEW_TOPIC' => $topic_url, 'RETURN_QUEUE' => sprintf($user->lang['RETURN_QUEUE'], '", ''), + 'RETURN_POST' => sprintf($user->lang['RETURN_POST'], '', ''), + 'RETURN_TOPIC_SIMPLE' => sprintf($user->lang['RETURN_TOPIC_SIMPLE'], '', ''), 'REPORTED_IMG' => $user->img('icon_topic_reported', $user->lang['POST_REPORTED']), 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', $user->lang['POST_UNAPPROVED']), 'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']), diff --git a/phpBB/includes/utf/utf_tools.php b/phpBB/includes/utf/utf_tools.php index 5453a3f985..ed803df7e6 100644 --- a/phpBB/includes/utf/utf_tools.php +++ b/phpBB/includes/utf/utf_tools.php @@ -1004,4 +1004,12 @@ function utf8_clean_string($text) return $text; } +/** +* A wrapper for htmlspecialchars($value, ENT_COMPAT, 'UTF-8') +*/ +function utf8_htmlspecialchars(&$value) +{ + return htmlspecialchars($value, ENT_COMPAT, 'UTF-8'); +} + ?> \ No newline at end of file diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php index 8c3e3e049f..47cd8ed20a 100644 --- a/phpBB/language/en/mcp.php +++ b/phpBB/language/en/mcp.php @@ -261,6 +261,7 @@ $lang = array_merge($lang, array( 'RETURN_POST' => '%sReturn to the post%s', 'RETURN_QUEUE' => '%sReturn to the queue%s', 'RETURN_REPORTS' => '%sReturn to the reports%s', + 'RETURN_TOPIC_SIMPLE' => '%sReturn to the topic%s', 'SEARCH_POSTS_BY_USER' => 'Search posts by', 'SELECT_ACTION' => 'Select desired action', diff --git a/phpBB/styles/subSilver/template/mcp_post.html b/phpBB/styles/subSilver/template/mcp_post.html index 0f695881ac..b355f6388d 100644 --- a/phpBB/styles/subSilver/template/mcp_post.html +++ b/phpBB/styles/subSilver/template/mcp_post.html @@ -45,7 +45,7 @@ - + From 0af60d92cc2ee837fa2ad36fd97bd92b968607b6 Mon Sep 17 00:00:00 2001 From: Jonathan Stanley Date: Thu, 28 Dec 2006 18:28:09 +0000 Subject: [PATCH 135/264] Farewell Asterix the Gaul. :P #6616 git-svn-id: file:///svn/phpbb/trunk@6820 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/acp/styles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/language/en/acp/styles.php b/phpBB/language/en/acp/styles.php index 14ae1a5d29..de35825e30 100644 --- a/phpBB/language/en/acp/styles.php +++ b/phpBB/language/en/acp/styles.php @@ -32,7 +32,7 @@ if (empty($lang) || !is_array($lang)) $lang = array_merge($lang, array( 'ACP_IMAGESETS_EXPLAIN' => 'Imagesets comprise all the button, forum, folder, etc. and other non-style specific images used by the board. Here you can edit, export or delete existing imagesets and import or activate new sets.', - 'ACP_STYLES_EXPLAIN' => 'Here you can manage the available styles on your board. A style consists off a template, theme and imageset. You may alter existing styles, delete, deactivate, reactivate, create or import new ones. You can also see what a style will look like using the preview function. The current default style is noted by the presence of an asterix (*). Also listed is the total user count for each style, note that overriding user styles will not be reflected here.', + 'ACP_STYLES_EXPLAIN' => 'Here you can manage the available styles on your board. A style consists off a template, theme and imageset. You may alter existing styles, delete, deactivate, reactivate, create or import new ones. You can also see what a style will look like using the preview function. The current default style is noted by the presence of an asterisk (*). Also listed is the total user count for each style, note that overriding user styles will not be reflected here.', 'ACP_TEMPLATES_EXPLAIN' => 'A template set comprises all the markup used to generate the layout of your board. Here you can edit existing template sets, delete, export, import and preview sets. You can also modify the templating code used to generate BBCode.', 'ACP_THEMES_EXPLAIN' => 'From here you can create, install, edit, delete and export themes. A theme is the combination of colours and images that are applied to your templates to define the basic look of your forum. The range of options open to you depends on the configuration of your server and phpBB installation, see the manual for further details. Please note that when creating new themes the use of an existing theme as a basis is optional.', 'ADD_IMAGESET' => 'Create imageset', From 7ed8dda36d984962933c613347fb66182faae4a1 Mon Sep 17 00:00:00 2001 From: David M Date: Thu, 28 Dec 2006 18:59:47 +0000 Subject: [PATCH 136/264] hah! finally :D git-svn-id: file:///svn/phpbb/trunk@6821 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/utf/utf_tools.php | 105 +++++++++++++++++++++++++++++-- 1 file changed, 101 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/utf/utf_tools.php b/phpBB/includes/utf/utf_tools.php index ed803df7e6..b4edff53f5 100644 --- a/phpBB/includes/utf/utf_tools.php +++ b/phpBB/includes/utf/utf_tools.php @@ -754,14 +754,111 @@ function utf8_recode($string, $encoding) trigger_error('Unknown encoding: ' . $encoding, E_USER_ERROR); } - global $phpbb_root_path; + global $phpbb_root_path, $phpEx; - if (!file_exists($phpbb_root_path . 'includes/utf/data/')) + // CP/WIN character encoding + if (preg_match('/(?:cp|win)[_\- ]?(\\d+)/i', $encoding, $array)) { - return $string; + switch ($array[1]) + { + case '932': + break; + case '1250': + case '1254': + case '1255': + case '1256': + case '1257': + case '874': + if (!function_exists('cp' . $array[1])) + { + if (!file_exists($phpbb_root_path . 'includes/utf/data/basic.' . $phpEx)) + { + trigger_error('Reencoder file is missing', E_USER_ERROR); + } + include($phpbb_root_path . 'includes/utf/data/basic.' . $phpEx); + } + return call_user_func('cp' . $array[1], $string); + break; + + default: + trigger_error('Unknown encoding: ' . $encoding, E_USER_ERROR); + break; + } } - die('Finish me!! ' . basename(__FILE__) . ' at line ' . __LINE__); + // iso-8859-* character encoding + if (preg_match('/iso[_ -]?8859[_ -]?(\\d+)/', $encoding, $array)) + { + switch ($array[1]) + { + case '1': + case '2': + case '4': + case '7': + case '9': + case '15': + if (!function_exists('iso_8895_' . $array[1])) + { + if (!file_exists($phpbb_root_path . 'includes/utf/data/basic.' . $phpEx)) + { + trigger_error('Basic reencoder file is missing', E_USER_ERROR); + } + include($phpbb_root_path . 'includes/utf/data/basic.' . $phpEx); + } + return call_user_func('iso_8895_' . $array[1], $string); + break; + + default: + trigger_error('Unknown encoding: ' . $encoding, E_USER_ERROR); + break; + } + } + + // SJIS + if (preg_match('/sjis(?:[_ -]?win)?|(?:cp|ibm)[_ -]?932|shift[_ -]?jis/i', $encoding) + { + if (!function_exists('sjis')) + { + if (!file_exists($phpbb_root_path . 'includes/utf/data/cjk.' . $phpEx)) + { + trigger_error('CJK reencoder file is missing', E_USER_ERROR); + } + include($phpbb_root_path . 'includes/utf/data/cjk.' . $phpEx); + } + return sjis($string); + } + + // EUC_KR + if (preg_match('/euc[_ -]?kr/i', $encoding) + { + if (!function_exists('euc_kr')) + { + if (!file_exists($phpbb_root_path . 'includes/utf/data/cjk.' . $phpEx)) + { + trigger_error('CJK reencoder file is missing', E_USER_ERROR); + } + include($phpbb_root_path . 'includes/utf/data/cjk.' . $phpEx); + } + return euc_kr($string); + } + + // BIG-5 + if (preg_match('/big[_ -]?5/i', $encoding) + { + if (!function_exists('big5')) + { + if (!file_exists($phpbb_root_path . 'includes/utf/data/cjk.' . $phpEx)) + { + trigger_error('CJK reencoder file is missing', E_USER_ERROR); + } + include($phpbb_root_path . 'includes/utf/data/cjk.' . $phpEx); + } + return big5($string); + } + + // Trigger an error?! Fow now just give bad data :-( + //trigger_error('Unknown encoding: ' . $encoding, E_USER_ERROR); + return $string; } /** From 2dfbf0da8edf3ebe31cc8051ec87e2defdb50775 Mon Sep 17 00:00:00 2001 From: Jonathan Stanley Date: Thu, 28 Dec 2006 20:26:22 +0000 Subject: [PATCH 137/264] #6566 Switched the link to Google, dhn would be happy. :P phpBB.com hasn't allowed hotlinking in ages anyway... so it wouldn't have worked even if the link to the image was correct. :D git-svn-id: file:///svn/phpbb/trunk@6822 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/help_bbcode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/language/en/help_bbcode.php b/phpBB/language/en/help_bbcode.php index 94c17f9b0d..938a767374 100644 --- a/phpBB/language/en/help_bbcode.php +++ b/phpBB/language/en/help_bbcode.php @@ -80,7 +80,7 @@ $help = array( ), array( 0 => 'Linking to another site', - 1 => 'phpBB BBCode supports a number of ways of creating URIs, Uniform Resource Indicators better known as URLs.
  • The first of these uses the [url=][/url] tag, whatever you type after the = sign will cause the contents of that tag to act as a URL. For example to link to phpBB.com you could use:

    [url=http://www.phpbb.com/]Visit phpBB![/url]

    This would generate the following link, Visit phpBB! You will notice the link opens in a new window so the user can continue browsing the forums if they wish.
  • If you want the URL itself displayed as the link you can do this by simply using:

    [url]http://www.phpbb.com/[/url]

    This would generate the following link, http://www.phpbb.com/
  • Additionally phpBB features something called Magic Links, this will turn any syntatically correct URL into a link without you needing to specify any tags or even the leading http://. For example typing www.phpbb.com into your message will automatically lead to www.phpbb.com being output when you view the message.
  • The same thing applies equally to email addresses, you can either specify an address explicitly for example:

    [email]no.one@domain.adr[/email]

    which will output no.one@domain.adr or you can just type no.one@domain.adr into your message and it will be automatically converted when you view.
As with all the BBCode tags you can wrap URLs around any of the other tags such as [img][/img] (see next entry), [b][/b], etc. As with the formatting tags it is up to you to ensure the correct open and close order is following, for example:

[url=http://www.phpbb.com/][img]http://www.phpbb.com/images/phplogo.gif[/url][/img]

is not correct which may lead to your post being deleted so take care.' + 1 => 'phpBB BBCode supports a number of ways of creating URIs, Uniform Resource Indicators better known as URLs.
  • The first of these uses the [url=][/url] tag, whatever you type after the = sign will cause the contents of that tag to act as a URL. For example to link to phpBB.com you could use:

    [url=http://www.phpbb.com/]Visit phpBB![/url]

    This would generate the following link, Visit phpBB! You will notice the link opens in a new window so the user can continue browsing the forums if they wish.
  • If you want the URL itself displayed as the link you can do this by simply using:

    [url]http://www.phpbb.com/[/url]

    This would generate the following link, http://www.phpbb.com/
  • Additionally phpBB features something called Magic Links, this will turn any syntatically correct URL into a link without you needing to specify any tags or even the leading http://. For example typing www.phpbb.com into your message will automatically lead to www.phpbb.com being output when you view the message.
  • The same thing applies equally to email addresses, you can either specify an address explicitly for example:

    [email]no.one@domain.adr[/email]

    which will output no.one@domain.adr or you can just type no.one@domain.adr into your message and it will be automatically converted when you view.
As with all the BBCode tags you can wrap URLs around any of the other tags such as [img][/img] (see next entry), [b][/b], etc. As with the formatting tags it is up to you to ensure the correct open and close order is following, for example:

[url=http://www.google.com/][img]http://www.google.com/intl/en_ALL/images/logo.gif[/url][/img]

is not correct which may lead to your post being deleted so take care.' ), array( 0 => '--', From 8914025c39a306bc0617f4c2353d744e7e538029 Mon Sep 17 00:00:00 2001 From: David M Date: Thu, 28 Dec 2006 20:46:15 +0000 Subject: [PATCH 138/264] #6646 git-svn-id: file:///svn/phpbb/trunk@6823 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/utf/utf_tools.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/utf/utf_tools.php b/phpBB/includes/utf/utf_tools.php index b4edff53f5..d3cad34fd1 100644 --- a/phpBB/includes/utf/utf_tools.php +++ b/phpBB/includes/utf/utf_tools.php @@ -815,7 +815,7 @@ function utf8_recode($string, $encoding) } // SJIS - if (preg_match('/sjis(?:[_ -]?win)?|(?:cp|ibm)[_ -]?932|shift[_ -]?jis/i', $encoding) + if (preg_match('/sjis(?:[_ -]?win)?|(?:cp|ibm)[_ -]?932|shift[_ -]?jis/i', $encoding)) { if (!function_exists('sjis')) { @@ -829,7 +829,7 @@ function utf8_recode($string, $encoding) } // EUC_KR - if (preg_match('/euc[_ -]?kr/i', $encoding) + if (preg_match('/euc[_ -]?kr/i', $encoding)) { if (!function_exists('euc_kr')) { @@ -843,7 +843,7 @@ function utf8_recode($string, $encoding) } // BIG-5 - if (preg_match('/big[_ -]?5/i', $encoding) + if (preg_match('/big[_ -]?5/i', $encoding)) { if (!function_exists('big5')) { From ca7f397cd448ee67f57131442007125e94ae3d99 Mon Sep 17 00:00:00 2001 From: David M Date: Fri, 29 Dec 2006 07:12:47 +0000 Subject: [PATCH 139/264] - added GB2312 support, made things nicer :D git-svn-id: file:///svn/phpbb/trunk@6824 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/utf/utf_tools.php | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/utf/utf_tools.php b/phpBB/includes/utf/utf_tools.php index d3cad34fd1..ca4aa86ce3 100644 --- a/phpBB/includes/utf/utf_tools.php +++ b/phpBB/includes/utf/utf_tools.php @@ -757,7 +757,7 @@ function utf8_recode($string, $encoding) global $phpbb_root_path, $phpEx; // CP/WIN character encoding - if (preg_match('/(?:cp|win)[_\- ]?(\\d+)/i', $encoding, $array)) + if (preg_match('/(?:cp|windows)[_\- ]?(\\d+)/', $encoding, $array)) { switch ($array[1]) { @@ -773,7 +773,7 @@ function utf8_recode($string, $encoding) { if (!file_exists($phpbb_root_path . 'includes/utf/data/basic.' . $phpEx)) { - trigger_error('Reencoder file is missing', E_USER_ERROR); + trigger_error('Basic reencoder file is missing', E_USER_ERROR); } include($phpbb_root_path . 'includes/utf/data/basic.' . $phpEx); } @@ -815,7 +815,7 @@ function utf8_recode($string, $encoding) } // SJIS - if (preg_match('/sjis(?:[_ -]?win)?|(?:cp|ibm)[_ -]?932|shift[_ -]?jis/i', $encoding)) + if (preg_match('/sjis(?:[_ -]?win)?|(?:cp|ibm)[_ -]?932|shift[_ -]?jis/', $encoding)) { if (!function_exists('sjis')) { @@ -829,7 +829,7 @@ function utf8_recode($string, $encoding) } // EUC_KR - if (preg_match('/euc[_ -]?kr/i', $encoding)) + if (preg_match('/euc[_ -]?kr/', $encoding)) { if (!function_exists('euc_kr')) { @@ -843,7 +843,7 @@ function utf8_recode($string, $encoding) } // BIG-5 - if (preg_match('/big[_ -]?5/i', $encoding)) + if (preg_match('/big[_ -]?5/', $encoding)) { if (!function_exists('big5')) { @@ -856,6 +856,20 @@ function utf8_recode($string, $encoding) return big5($string); } + // GB2312 + if (preg_match('/gb[_ -]?2312/', $encoding)) + { + if (!function_exists('gb2312')) + { + if (!file_exists($phpbb_root_path . 'includes/utf/data/cjk.' . $phpEx)) + { + trigger_error('CJK reencoder file is missing', E_USER_ERROR); + } + include($phpbb_root_path . 'includes/utf/data/cjk.' . $phpEx); + } + return gb2312($string); + } + // Trigger an error?! Fow now just give bad data :-( //trigger_error('Unknown encoding: ' . $encoding, E_USER_ERROR); return $string; From 54f79e200fdba8e6eee74a0a8aed68a2ca71ec5e Mon Sep 17 00:00:00 2001 From: Jonathan Stanley Date: Fri, 29 Dec 2006 20:14:05 +0000 Subject: [PATCH 140/264] #6666 - Diablo-Bertiezilla shall be vanquished! git-svn-id: file:///svn/phpbb/trunk@6825 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/email/admin_activate.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/language/en/email/admin_activate.txt b/phpBB/language/en/email/admin_activate.txt index 0689c1a068..2206906a92 100644 --- a/phpBB/language/en/email/admin_activate.txt +++ b/phpBB/language/en/email/admin_activate.txt @@ -2,9 +2,9 @@ Subject: Activate user account Hello, -The account owned by “{USERNAME}” has been deactivated or newly created, you should check the details of this user (if required) and handle it appropiatly. +The account owned by “{USERNAME}” has been deactivated or newly created, you should check the details of this user (if required) and handle it appropriately. -Use this link to view the users profile: +Use this link to view the user’s profile: {U_USER_DETAILS} Use this link to activate the account: From 46f3bd40a8ed2c5cfcb6b229f7ebab5678e41bf0 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 31 Dec 2006 16:56:15 +0000 Subject: [PATCH 141/264] - telling the admin for what the board contact and board email addresses are used for and also making sure this explanation is correct ;) - fixes for bugs #6694, #6664 and #6662 git-svn-id: file:///svn/phpbb/trunk@6826 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_email.php | 1 - phpBB/includes/acp/acp_inactive.php | 1 - phpBB/includes/acp/acp_users.php | 1 - phpBB/includes/functions_messenger.php | 14 +++++++------- phpBB/includes/functions_posting.php | 1 - phpBB/includes/functions_privmsgs.php | 1 - phpBB/includes/functions_user.php | 1 - phpBB/includes/mcp/mcp_queue.php | 2 -- phpBB/includes/mcp/mcp_reports.php | 1 - phpBB/includes/ucp/ucp_activate.php | 1 - phpBB/includes/ucp/ucp_groups.php | 1 - phpBB/includes/ucp/ucp_profile.php | 2 -- phpBB/includes/ucp/ucp_register.php | 2 -- phpBB/includes/ucp/ucp_remind.php | 1 - phpBB/includes/ucp/ucp_resend.php | 3 --- phpBB/install/install_install.php | 1 - phpBB/language/en/acp/board.php | 4 ++-- phpBB/language/en/email/email_notify.txt | 2 +- phpBB/language/en/email/profile_send_email.txt | 2 +- phpBB/language/en/email/profile_send_im.txt | 2 +- phpBB/memberlist.php | 4 ++-- .../subSilver/template/memberlist_leaders.html | 4 ++-- 22 files changed, 16 insertions(+), 36 deletions(-) diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php index 4f42f5b5b2..991b368a01 100644 --- a/phpBB/includes/acp/acp_email.php +++ b/phpBB/includes/acp/acp_email.php @@ -156,7 +156,6 @@ class acp_email $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip); $messenger->subject(htmlspecialchars_decode($subject)); - $messenger->replyto($config['board_email']); $messenger->set_mail_priority($priority); $messenger->assign_vars(array( diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php index 5663979f1c..450b9fd0de 100755 --- a/phpBB/includes/acp/acp_inactive.php +++ b/phpBB/includes/acp/acp_inactive.php @@ -102,7 +102,6 @@ class acp_inactive { $messenger->template('user_remind_inactive', $row['user_lang']); - $messenger->replyto($config['board_email']); $messenger->to($row['user_email'], $row['username']); $messenger->im($row['user_jabber'], $row['username']); diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 82017a5871..978bf1947d 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -296,7 +296,6 @@ class acp_users $messenger->template('user_resend_inactive', $user_row['user_lang']); - $messenger->replyto($config['board_contact']); $messenger->to($user_row['user_email'], $user_row['username']); $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']); diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index f2ad76f892..06da2f0999 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -363,12 +363,12 @@ class messenger if (empty($this->replyto)) { - $this->replyto = '<' . $config['board_email'] . '>'; + $this->replyto = '<' . $config['board_contact'] . '>'; } if (empty($this->from)) { - $this->from = '<' . $config['board_email'] . '>'; + $this->from = '<' . $config['board_conact'] . '>'; } // Build to, cc and bcc strings @@ -474,7 +474,7 @@ class messenger foreach ($addresses as $address) { - $this->jabber->send_message($address, 'normal', NULL, array('body' => $this->msg)); + $this->jabber->send_message($address, 'normal', NULL, array('body' => $this->msg, 'subject' => $this->subject)); } sleep(1); @@ -637,7 +637,7 @@ class queue case 'jabber': foreach ($addresses as $address) { - if ($this->jabber->send_message($address, 'normal', NULL, array('body' => $msg)) === false) + if ($this->jabber->send_message($address, 'normal', NULL, array('body' => $msg, 'subject' => $subject)) === false) { messenger::error('JABBER', $this->jabber->get_log()); continue 3; @@ -781,10 +781,10 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $headers = '') // Something we really didn't take into consideration originally $header_array = explode("\r\n", $headers); $headers = ''; - + foreach ($header_array as $header) { - if (preg_match('#^cc:#si', $header) || preg_match('#^bcc:#si', $header)) + if (strpos(strtolower($header), 'cc:') === 0 || strpos(strtolower($header), 'bcc:') === 0) { $header = ''; } @@ -865,7 +865,7 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $headers = '') // From this point onward most server response codes should be 250 // Specify who the mail is from.... - $smtp->server_send('MAIL FROM:<' . $config['board_email'] . '>'); + $smtp->server_send('MAIL FROM:<' . $config['board_contact'] . '>'); if ($err_msg = $smtp->server_parse('250', __LINE__)) { $smtp->close_session($err_msg); diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index fa839f038d..910999d5ef 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1107,7 +1107,6 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id { $messenger->template($email_template, $addr['lang']); - $messenger->replyto($config['board_email']); $messenger->to($addr['email'], $addr['name']); $messenger->im($addr['jabber'], $addr['name']); diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index a3a99bd4ec..20f043c890 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1610,7 +1610,6 @@ function pm_notification($mode, $author, $recipients, $subject, $message) { $messenger->template('privmsg_notify', $addr['lang']); - $messenger->replyto($config['board_email']); $messenger->to($addr['email'], $addr['name']); $messenger->im($addr['jabber'], $addr['name']); diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index ee15ad116c..0c6cf60f0f 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -2077,7 +2077,6 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna { $messenger->template('group_approved', $row['user_lang']); - $messenger->replyto($config['board_email']); $messenger->to($row['user_email'], $row['username']); $messenger->im($row['user_jabber'], $row['username']); diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index d175cfa3fe..b8619e6f84 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -549,7 +549,6 @@ function approve_post($post_id_list, $id, $mode) $messenger->template($email_template, $post_data['user_lang']); - $messenger->replyto($config['board_email']); $messenger->to($post_data['user_email'], $post_data['username']); $messenger->im($post_data['user_jabber'], $post_data['username']); @@ -772,7 +771,6 @@ function disapprove_post($post_id_list, $id, $mode) $messenger->template($email_template, $post_data['user_lang']); - $messenger->replyto($config['board_email']); $messenger->to($post_data['user_email'], $post_data['username']); $messenger->im($post_data['user_jabber'], $post_data['username']); diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index 91e5b8633b..28d065a4db 100755 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -482,7 +482,6 @@ function close_report($post_id_list, $mode, $action) $messenger->template('report_' . $action . 'd', $reporter['user_lang']); - $messenger->replyto($config['board_email']); $messenger->to($reporter['user_email'], $reporter['username']); $messenger->im($reporter['user_jabber'], $reporter['username']); diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php index b3cb27223a..e9fbe69938 100644 --- a/phpBB/includes/ucp/ucp_activate.php +++ b/phpBB/includes/ucp/ucp_activate.php @@ -84,7 +84,6 @@ class ucp_activate $messenger->template('admin_welcome_activated', $user_row['user_lang']); - $messenger->replyto($config['board_contact']); $messenger->to($user_row['user_email'], $user_row['username']); $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']); diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index 13ce175720..119f496d21 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -183,7 +183,6 @@ class ucp_groups { $messenger->template($email_template, $row['user_lang']); - $messenger->replyto($config['board_email']); $messenger->to($row['user_email'], $row['username']); $messenger->im($row['user_jabber'], $row['username']); diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index a979f73e93..e6be8acd3d 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -130,7 +130,6 @@ class ucp_profile $template_file = ($config['require_activation'] == USER_ACTIVATION_ADMIN) ? 'user_activate_inactive' : 'user_activate'; $messenger->template($template_file, $user->data['user_lang']); - $messenger->replyto($config['board_contact']); $messenger->to($data['email'], $data['username']); $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']); @@ -167,7 +166,6 @@ class ucp_profile while ($row = $db->sql_fetchrow($result)) { $messenger->template('admin_activate', $row['user_lang']); - $messenger->replyto($config['board_contact']); $messenger->to($row['user_email'], $row['username']); $messenger->im($row['user_jabber'], $row['username']); diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 050eece86e..75bd3170ae 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -321,7 +321,6 @@ class ucp_register $messenger->template($email_template, $data['lang']); - $messenger->replyto($config['board_contact']); $messenger->to($data['email'], $data['username']); $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']); @@ -369,7 +368,6 @@ class ucp_register while ($row = $db->sql_fetchrow($result)) { $messenger->template('admin_activate', $row['user_lang']); - $messenger->replyto($config['board_contact']); $messenger->to($row['user_email'], $row['username']); $messenger->im($row['user_jabber'], $row['username']); diff --git a/phpBB/includes/ucp/ucp_remind.php b/phpBB/includes/ucp/ucp_remind.php index 924c096e04..53384f522b 100644 --- a/phpBB/includes/ucp/ucp_remind.php +++ b/phpBB/includes/ucp/ucp_remind.php @@ -64,7 +64,6 @@ class ucp_remind $messenger->template('user_activate_passwd', $user_row['user_lang']); - $messenger->replyto($user->data['user_email']); $messenger->to($user_row['user_email'], $user_row['username']); $messenger->im($user_row['user_jabber'], $user_row['username']); diff --git a/phpBB/includes/ucp/ucp_resend.php b/phpBB/includes/ucp/ucp_resend.php index c61859b3e2..d543045540 100644 --- a/phpBB/includes/ucp/ucp_resend.php +++ b/phpBB/includes/ucp/ucp_resend.php @@ -67,8 +67,6 @@ class ucp_resend if ($config['require_activation'] == USER_ACTIVATION_SELF || $coppa) { $messenger->template(($coppa) ? 'coppa_resend_inactive' : 'user_resend_inactive', $user_row['user_lang']); - - $messenger->replyto($config['board_contact']); $messenger->to($user_row['user_email'], $user_row['username']); $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']); @@ -107,7 +105,6 @@ class ucp_resend while ($row = $db->sql_fetchrow($result)) { $messenger->template('admin_activate', $row['user_lang']); - $messenger->replyto($config['board_contact']); $messenger->to($row['user_email'], $row['username']); $messenger->im($row['user_jabber'], $row['username']); diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index c6b5ab263d..06579e7c49 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -1750,7 +1750,6 @@ class install_install extends module $messenger->template('installed', $language); - $messenger->replyto($config['board_contact']); $messenger->to($board_email1, $admin_name); $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']); diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 3bf098312c..ebd6f7ff36 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -369,13 +369,13 @@ $lang = array_merge($lang, array( 'ACP_EMAIL_SETTINGS_EXPLAIN' => 'This information is used when the board sends emails to your users. Please ensure the email address you specify is valid, any bounced or undeliverable messages will likely be sent to that address. If your host does not provide a native (PHP based) email service you can instead send messages directly using SMTP. This requires the address of an appropriate server (ask your provider if necessary), do not specify any old name here! If the server requires authentication (and only if it does) enter the necessary username and password. Please note only basic authentication is offered, different authentication implementations are not currently supported.', 'ADMIN_EMAIL' => 'Return email address', - 'ADMIN_EMAIL_EXPLAIN' => 'This will be used as the return address on all emails.', + 'ADMIN_EMAIL_EXPLAIN' => 'This will be used as the return address on all emails, the technical contact email address. It will always be used as the Return-Path and Sender address in emails.', 'BOARD_EMAIL_FORM' => 'Users send email via board', 'BOARD_EMAIL_FORM_EXPLAIN' => 'Instead of showing the users email address users are able to send emails via the board.', 'BOARD_HIDE_EMAILS' => 'Hide email addresses', 'BOARD_HIDE_EMAILS_EXPLAIN' => 'This function keeps email addresses completely private.', 'CONTACT_EMAIL' => 'Contact email address', - 'CONTACT_EMAIL_EXPLAIN' => 'This address will be used whenever a specific contact point is needed, e.g. spam, error output, etc.', + 'CONTACT_EMAIL_EXPLAIN' => 'This address will be used whenever a specific contact point is needed, e.g. spam, error output, etc. It will always be used as the From and Reply-To address in emails.', 'EMAIL_FUNCTION_NAME' => 'Email function name', 'EMAIL_FUNCTION_NAME_EXPLAIN' => 'The email function used to send mails through PHP.', 'EMAIL_PACKAGE_SIZE' => 'Email package size', diff --git a/phpBB/language/en/email/email_notify.txt b/phpBB/language/en/email/email_notify.txt index e8d4e3ae1d..a513bbc8b8 100644 --- a/phpBB/language/en/email/email_notify.txt +++ b/phpBB/language/en/email/email_notify.txt @@ -10,7 +10,7 @@ You can find it at: {U_TOPIC} -A message from {FROM_USERNAME} may also be included below. Please note that this message has not been seen or approved by the board administrators. If you wish to complain about having received this email please contact the board administrator at {BOARD_EMAIL}. Please quote the the message headers when contacting this address. +A message from {FROM_USERNAME} may also be included below. Please note that this message has not been seen or approved by the board administrators. If you wish to complain about having received this email please contact the board administrator at {BOARD_CONTACT}. Please quote the the message headers when contacting this address. ---------- diff --git a/phpBB/language/en/email/profile_send_email.txt b/phpBB/language/en/email/profile_send_email.txt index b9e03734e4..cf858767ec 100644 --- a/phpBB/language/en/email/profile_send_email.txt +++ b/phpBB/language/en/email/profile_send_email.txt @@ -3,7 +3,7 @@ Hello {TO_USERNAME}, The following is an email sent to you by {FROM_USERNAME} via your account on “{SITENAME}”. If this message is spam, contains abusive or other comments you find offensive please contact the webmaster of the board at the following address: -{BOARD_EMAIL} +{BOARD_CONTACT} Include this full email (particularly the headers). Please note that the reply address to this email has been set to that of {FROM_USERNAME}. diff --git a/phpBB/language/en/email/profile_send_im.txt b/phpBB/language/en/email/profile_send_im.txt index 59e06d4fd0..244b712ee2 100644 --- a/phpBB/language/en/email/profile_send_im.txt +++ b/phpBB/language/en/email/profile_send_im.txt @@ -3,7 +3,7 @@ Hello {TO_USERNAME}, The following is a message sent to you by {FROM_USERNAME} via your account on “{SITENAME}”. If this message is spam, contains abusive or other comments you find offensive please contact the webmaster of the board at the following address: -{BOARD_EMAIL} +{BOARD_CONTACT} Include this full message. Please note that the sender address has been set to the boards IM account. diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index c53c9de6a3..ff1ccd6670 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -305,7 +305,7 @@ switch ($mode) $messenger->im($row['user_jabber'], $row['username']); $messenger->assign_vars(array( - 'BOARD_EMAIL' => $config['board_contact'], + 'BOARD_CONTACT' => $config['board_contact'], 'FROM_USERNAME' => htmlspecialchars_decode($user->data['username']), 'TO_USERNAME' => htmlspecialchars_decode($row['username']), 'MESSAGE' => htmlspecialchars_decode($message)) @@ -780,7 +780,7 @@ switch ($mode) $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip); $messenger->assign_vars(array( - 'BOARD_EMAIL' => $config['board_contact'], + 'BOARD_CONTACT' => $config['board_contact'], 'TO_USERNAME' => htmlspecialchars_decode($row['to_name']), 'FROM_USERNAME' => htmlspecialchars_decode($user->data['username']), 'MESSAGE' => htmlspecialchars_decode($message)) diff --git a/phpBB/styles/subSilver/template/memberlist_leaders.html b/phpBB/styles/subSilver/template/memberlist_leaders.html index dbe5dab1bc..42f0fa1305 100644 --- a/phpBB/styles/subSilver/template/memberlist_leaders.html +++ b/phpBB/styles/subSilver/template/memberlist_leaders.html @@ -25,7 +25,7 @@ {admin.GROUP_NAME}   -
+ @@ -48,7 +48,7 @@ {mod.GROUP_NAME}   - + From 595bed3354c4873a8b4bca35bcd76a3c74ea12ad Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 1 Jan 2007 12:56:14 +0000 Subject: [PATCH 142/264] fix typo git-svn-id: file:///svn/phpbb/trunk@6827 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_messenger.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 06da2f0999..190975a96b 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -368,7 +368,7 @@ class messenger if (empty($this->from)) { - $this->from = '<' . $config['board_conact'] . '>'; + $this->from = '<' . $config['board_contact'] . '>'; } // Build to, cc and bcc strings From 1c32dcaeb10292de8fa8de25c8775fbdab25e2c7 Mon Sep 17 00:00:00 2001 From: David M Date: Mon, 1 Jan 2007 19:01:24 +0000 Subject: [PATCH 143/264] meh git-svn-id: file:///svn/phpbb/trunk@6828 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_admin.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index a94504d3d2..ee2d432818 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -1935,10 +1935,7 @@ function split_sql_file($sql, $delimiter) $sql = str_replace("\r" , '', $sql); $data = preg_split('/' . preg_quote($delimiter, '/') . '$/m', $sql); - foreach ($data as $key => $value) - { - $data[$key] = trim($value); - } + $data = array_map('trim', $data); // The empty case $end_data = end($data); From 46c9da77a47abba5f0bb314d9a4cd68d1abb32c9 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 2 Jan 2007 16:35:48 +0000 Subject: [PATCH 144/264] - do not allow setting the parent to currently assigned childs [Bug #6708] - Allow the display_on_index setting to be specified for link forums [Bug #6660] - Rank code in functions_display.php [Bug #6656] - Added some new locations for the viewonline page [Related to bug #6484] - Do not display attached images inline if user disabled image display in posts; the same with flash files [Bug #6226] git-svn-id: file:///svn/phpbb/trunk@6829 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/acp_forums.html | 6 ++++ phpBB/includes/acp/acp_forums.php | 18 +++++++----- phpBB/includes/functions.php | 11 +++++++ phpBB/includes/functions_display.php | 44 ++++++++++++++++++++++++++++ phpBB/language/en/common.php | 7 +++++ phpBB/memberlist.php | 36 +---------------------- phpBB/viewonline.php | 38 ++++++++++++++++++------ phpBB/viewtopic.php | 23 +-------------- 8 files changed, 109 insertions(+), 74 deletions(-) diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html index 427a1f07a4..46223ea81d 100644 --- a/phpBB/adm/style/acp_forums.html +++ b/phpBB/adm/style/acp_forums.html @@ -256,6 +256,12 @@ From 732ad23cd724e60df801a5cc32611e7d7706240d Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 3 Jan 2007 16:38:25 +0000 Subject: [PATCH 146/264] - removed download mode selection (the column info and constants will not be removed, we or others may be able to re-use them later on) - removing extension from physical filename for uploaded attachments (as has been suggested some time ago from our community), can still be used by using the new 'unique_ext' mode on file cleaning - fixed a bug with copying attachments if copying a topic - made sure no attachment files get removed used at another location - changed media player "embed" code. For some this may result in no auto-resizing - though a download link has been added. git-svn-id: file:///svn/phpbb/trunk@6831 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/acp_attachments.html | 4 - phpBB/download.php | 1 + phpBB/includes/acp/acp_attachments.php | 102 +++--------------- phpBB/includes/acp/acp_php_info.php | 3 +- phpBB/includes/constants.php | 1 + phpBB/includes/functions.php | 8 +- phpBB/includes/functions_admin.php | 28 +++-- phpBB/includes/functions_upload.php | 6 +- phpBB/includes/mcp/mcp_main.php | 1 + phpBB/includes/ucp/ucp_attachments.php | 2 +- phpBB/language/en/acp/attachments.php | 2 - phpBB/posting.php | 5 + .../styles/subSilver/template/attachment.html | 49 +++++---- 13 files changed, 84 insertions(+), 128 deletions(-) diff --git a/phpBB/adm/style/acp_attachments.html b/phpBB/adm/style/acp_attachments.html index d34a3a6a22..04535719b4 100644 --- a/phpBB/adm/style/acp_attachments.html +++ b/phpBB/adm/style/acp_attachments.html @@ -187,10 +187,6 @@
checked="checked" />
-
-

{L_DOWNLOAD_MODE_EXPLAIN}
-
{S_DOWNLOAD_SELECT}
-
'; - - foreach ($types as $type => $mode) - { - $selected = ($type == $download_mode) ? ' selected="selected"' : ''; - $group_select .= ''; - } - - $group_select .= ''; - - return $group_select; - } - /** * Search Imagick */ @@ -1376,45 +1343,6 @@ class acp_attachments } } - /** - * Re-Write extensions cache file - */ - function rewrite_extensions() - { - global $db, $cache; - - $sql = 'SELECT e.extension, g.* - FROM ' . EXTENSIONS_TABLE . ' e, ' . EXTENSION_GROUPS_TABLE . ' g - WHERE e.group_id = g.group_id - AND g.allow_group = 1'; - $result = $db->sql_query($sql); - - $extensions = array(); - while ($row = $db->sql_fetchrow($result)) - { - $extension = $row['extension']; - - $extensions[$extension]['display_cat'] = (int) $row['cat_id']; - $extensions[$extension]['download_mode']= (int) $row['download_mode']; - $extensions[$extension]['upload_icon'] = (string) $row['upload_icon']; - $extensions[$extension]['max_filesize'] = (int) $row['max_filesize']; - - $allowed_forums = ($row['allowed_forums']) ? unserialize(trim($row['allowed_forums'])) : array(); - - if ($row['allow_in_pm']) - { - $allowed_forums = array_merge($allowed_forums, array(0)); - } - - // Store allowed extensions forum wise - $extensions['_allowed_'][$extension] = (!sizeof($allowed_forums)) ? 0 : $allowed_forums; - } - $db->sql_freeresult($result); - - $cache->destroy('_extensions'); - $cache->put('_extensions', $extensions); - } - /** * Write display_order config field */ diff --git a/phpBB/includes/acp/acp_php_info.php b/phpBB/includes/acp/acp_php_info.php index 3816285953..342d89addd 100644 --- a/phpBB/includes/acp/acp_php_info.php +++ b/phpBB/includes/acp/acp_php_info.php @@ -30,8 +30,7 @@ class acp_php_info ob_start(); @phpinfo(INFO_GENERAL | INFO_CONFIGURATION | INFO_MODULES | INFO_VARIABLES); - $phpinfo = ob_get_contents(); - ob_end_clean(); + $phpinfo = ob_get_clean(); $phpinfo = trim($phpinfo); diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index 652bda40a6..99812363b7 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -117,6 +117,7 @@ define('FULL_FOLDER_HOLD', -1); // Download Modes - Attachments define('INLINE_LINK', 1); +// This mode is only used internally to allow modders extending the attachment functionality define('PHYSICAL_LINK', 2); // Confirm types diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 5206e51fdd..a160bee7d3 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2463,7 +2463,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count, global $extensions, $config, $phpbb_root_path, $phpEx; // - $force_physical = false; $compiled_attachments = array(); if (!isset($template->filename['attachment_tpl'])) @@ -2631,7 +2630,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count, $display_cat = ATTACHMENT_CATEGORY_NONE; } - $download_link = (!$force_physical && $attachment['attach_id']) ? append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $attachment['attach_id'] . '&f=' . (int) $forum_id) : $filename; + $download_link = append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $attachment['attach_id'] . '&f=' . (int) $forum_id); switch ($display_cat) { @@ -2649,7 +2648,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count, // Images, but display Thumbnail case ATTACHMENT_CATEGORY_THUMB: $l_downloaded_viewed = $user->lang['VIEWED']; - $thumbnail_link = (!$force_physical && $attachment['attach_id']) ? append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $attachment['attach_id'] . '&t=1&f=' . (int) $forum_id) : $thumbnail_filename; + $thumbnail_link = append_sid("{$phpbb_root_path}download.$phpEx", 'id=' . $attachment['attach_id'] . '&t=1&f=' . (int) $forum_id); $block_array += array( 'S_THUMBNAIL' => true, @@ -2663,10 +2662,11 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count, // Giving the filename directly because within the wm object all variables are in local context making it impossible // to validate against a valid session (all params can differ) - $download_link = $filename; + // $download_link = $filename; $block_array += array( 'U_FORUM' => generate_board_url(), + 'ATTACH_ID' => $attachment['attach_id'], 'S_WM_FILE' => true, ); diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index ee2d432818..f32bf00254 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -767,7 +767,7 @@ function delete_attachments($mode, $ids, $resync = true) $space_removed = $files_removed = 0; foreach ($physical as $file_ary) { - if (phpbb_unlink($file_ary['filename'], 'file')) + if (phpbb_unlink($file_ary['filename'], 'file', true)) { $space_removed += $file_ary['filesize']; $files_removed++; @@ -775,7 +775,7 @@ function delete_attachments($mode, $ids, $resync = true) if ($file_ary['thumbnail']) { - phpbb_unlink($file_ary['filename'], 'thumbnail'); + phpbb_unlink($file_ary['filename'], 'thumbnail', true); } } set_config('upload_dir_size', $config['upload_dir_size'] - $space_removed, true); @@ -1001,14 +1001,28 @@ function update_posted_info(&$topic_ids) } /** -* Delete File +* Delete attached file */ -function phpbb_unlink($filename, $mode = 'file') +function phpbb_unlink($filename, $mode = 'file', $entry_removed = false) { - global $config, $user, $phpbb_root_path; + global $db, $phpbb_root_path, $config; - $filename = ($mode == 'thumbnail') ? $phpbb_root_path . $config['upload_path'] . '/thumb_' . basename($filename) : $phpbb_root_path . $config['upload_path'] . '/' . basename($filename); - return @unlink($filename); + // Because of copying topics or modifications a physical filename could be assigned more than once. If so, do not remove the file itself. + $sql = 'SELECT COUNT(attach_id) AS num_entries + FROM ' . ATTACHMENTS_TABLE . " + WHERE physical_filename = '" . $db->sql_escape(basename($filename)) . "'"; + $result = $db->sql_query($sql); + $num_entries = (int) $db->sql_fetchfield('num_entries'); + $db->sql_freeresult($result); + + // Do not remove file if at least one additional entry with the same name exist. + if (($entry_removed && $num_entries > 0) || (!$entry_removed && $num_entries > 1)) + { + return false; + } + + $filename = ($mode == 'thumbnail') ? 'thumb_' . basename($filename) : basename($filename); + return @unlink($phpbb_root_path . $config['upload_path'] . '/' . $filename); } /** diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index e1cffaf710..31687ab3fe 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -76,7 +76,7 @@ class filespec /** * Cleans destination filename * - * @param real|unique $mode real creates a realname, filtering some characters, lowering every character. Unique creates an unique filename + * @param real|unique|unique_ext $mode real creates a realname, filtering some characters, lowering every character. Unique creates an unique filename * @param string $prefix Prefix applied to filename * @access public */ @@ -106,6 +106,10 @@ class filespec break; case 'unique': + $this->realname = $prefix . md5(unique_id()); + break; + + case 'unique_ext': default: $this->realname = $prefix . md5(unique_id()) . '.' . $this->extension; break; diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 67f7441725..a53430f1bd 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -976,6 +976,7 @@ function mcp_fork_topic($topic_ids) 'post_msg_id' => (int) $new_post_id, 'topic_id' => (int) $new_topic_id, 'in_message' => 0, + 'is_orphan' => (int) $attach_row['is_orphan'], 'poster_id' => (int) $attach_row['poster_id'], 'physical_filename' => (string) basename($attach_row['physical_filename']), 'real_filename' => (string) basename($attach_row['real_filename']), diff --git a/phpBB/includes/ucp/ucp_attachments.php b/phpBB/includes/ucp/ucp_attachments.php index f995f05bf6..895cb51020 100644 --- a/phpBB/includes/ucp/ucp_attachments.php +++ b/phpBB/includes/ucp/ucp_attachments.php @@ -27,7 +27,7 @@ class ucp_attachments $delete = (isset($_POST['delete'])) ? true : false; $confirm = (isset($_POST['confirm'])) ? true : false; - $delete_ids = request_var('attachment', array(0)); + $delete_ids = array_keys(request_var('attachment', array(0))); if ($delete && sizeof($delete_ids)) { diff --git a/phpBB/language/en/acp/attachments.php b/phpBB/language/en/acp/attachments.php index 85143d3eb2..247e045416 100644 --- a/phpBB/language/en/acp/attachments.php +++ b/phpBB/language/en/acp/attachments.php @@ -71,8 +71,6 @@ $lang = array_merge($lang, array( 'DEFINE_ALLOWED_IPS' => 'Define allowed IPs/hostnames', 'DEFINE_DISALLOWED_IPS' => 'Define disallowed IPs/hostnames', 'DOWNLOAD_ADD_IPS_EXPLAIN' => 'To specify several different IPs or hostnames enter each on a new line. To specify a range of IP addresses separate the start and end with a hyphen (-), to specify a wildcard use *', - 'DOWNLOAD_MODE' => 'Download mode', - 'DOWNLOAD_MODE_EXPLAIN' => 'If you experience problems downloading files, set this to “physical”, the user will be directed to the file directly. Do not set it to physical if not really needed, it discloses the filename.', 'DOWNLOAD_REMOVE_IPS_EXPLAIN' => 'You can remove (or un-exclude) multiple IP addresses in one go using the appropriate combination of mouse and keyboard for your computer and browser. Excluded IPs have a blue background.', 'DISPLAY_INLINED' => 'Display images inline', 'DISPLAY_INLINED_EXPLAIN' => 'If set to No image attachments will show as a link.', diff --git a/phpBB/posting.php b/phpBB/posting.php index 1afd964b38..364cf26339 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -191,6 +191,11 @@ switch ($mode) break; case 'quote': + + $post_data['post_edit_locked'] = 0; + + // no break; + case 'reply': if ($auth->acl_get('f_reply', $forum_id)) { diff --git a/phpBB/styles/subSilver/template/attachment.html b/phpBB/styles/subSilver/template/attachment.html index 6d1c20b43d..8fd64d6d9c 100644 --- a/phpBB/styles/subSilver/template/attachment.html +++ b/phpBB/styles/subSilver/template/attachment.html @@ -21,31 +21,40 @@ - {_file.UPLOAD_IMAGE} + {_file.UPLOAD_ICON} {_file.DOWNLOAD_NAME} [{_file.FILESIZE} {_file.SIZE_LANG}]
{_file.L_DOWNLOADED_VIEWED} {_file.L_DOWNLOAD_COUNT} - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -102,7 +111,7 @@
[ {L_PLAY_QUICKTIME_FILE} ] - {_file.DOWNLOAD_NAME} [ {_file.FILESIZE} {_file.SIZE_LANG} | {_file.L_DOWNLOADED_VIEWED} {_file.L_DOWNLOAD_COUNT} ] + {_file.DOWNLOAD_NAME} [ {_file.FILESIZE} {_file.SIZE_LANG} | {_file.L_DOWNLOADED_VIEWED} {_file.L_DOWNLOAD_COUNT} ]
From 17a27175fd769db449aef44a82d16747a440d452 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Wed, 3 Jan 2007 18:58:19 +0000 Subject: [PATCH 147/264] - allow login with redirect parameter - altered URL regular expression so it won't cause problem with long URLs - PCRE >:( [Bug #6720] - moderator list on index should have coloured groups in bold as everywhere else too - correctly handle password requirements in UCP [Bug #6692] - added soft-hyphen to utf8_clean_string(), if you know any more evil characters (or whitespace characters that are not in ASCII range) then tell me about them (bug report) ;-) git-svn-id: file:///svn/phpbb/trunk@6832 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/develop/regex.php | 7 +++--- phpBB/includes/functions.php | 4 ++-- phpBB/includes/functions_display.php | 2 +- phpBB/includes/ucp/ucp_profile.php | 5 ++--- phpBB/includes/utf/utf_tools.php | 32 ++++++++++++++++------------ phpBB/ucp.php | 2 +- 6 files changed, 28 insertions(+), 24 deletions(-) diff --git a/phpBB/develop/regex.php b/phpBB/develop/regex.php index 2b736afec2..1719fe03e9 100644 --- a/phpBB/develop/regex.php +++ b/phpBB/develop/regex.php @@ -46,13 +46,14 @@ $sub_delims = '!$&\'()*+,;='; $pchar = "(?:[$unreserved$sub_delims:@|]+|$pct_encoded)"; // rfc: no "|" $scheme = '[a-z][a-z\d+\-.]*'; -$reg_name = "(?:[$unreserved$sub_delims|]+|$pct_encoded)+"; // rfc: * instead of + and no "|" -$userinfo = "(?:(?:[$unreserved$sub_delims:]+|$pct_encoded))*"; +$reg_name = "(?:[$unreserved$sub_delims|@]+|$pct_encoded)+"; // rfc: * instead of + and no "|" and no "@" (included instead of userinfo +//$userinfo = "(?:(?:[$unreserved$sub_delims:]+|$pct_encoded))*"; $ipv4_simple = '[0-9.]+'; $ipv6_simple = '\[[a-z0-9.:]+\]'; $host = "(?:$reg_name|$ipv4_simple|$ipv6_simple)"; $port = '\d*'; -$authority = "(?:$userinfo@)?$host(?::$port)?"; +//$authority = "(?:$userinfo@)?$host(?::$port)?"; +$authority = "$host(?::$port)?"; $segment = "$pchar*"; $path_abempty = "(?:/$segment)*"; $hier_part = "/{2}$authority$path_abempty"; diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index a160bee7d3..42046ff265 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3023,11 +3023,11 @@ function get_preg_expression($mode) case 'url': // generated with regex generation file in the develop folder - return "[a-z][a-z\d+\-.]*:/{2}(?:(?:(?:[a-z0-9\-._~!$&'()*+,;=:]+|%[\dA-F]{2}))*@)?(?:(?:[a-z0-9\-._~!$&'()*+,;=|]+|%[\dA-F]{2})+|[0-9.]+|\[[a-z0-9.:]+\])(?::\d*)?(?:/(?:[a-z0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?"; + return "[a-z][a-z\d+\-.]*:/{2}(?:(?:[a-z0-9\-._~!$&'()*+,;=|@]+|%[\dA-F]{2})+|[0-9.]+|\[[a-z0-9.:]+\])(?::\d*)?(?:/(?:[a-z0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?"; break; case 'www_url': - return "www\.(?:[a-z0-9\-._~!$&'()*+,;=|]+|%[\dA-F]{2})+(?::\d*)?(?:/(?:[a-z0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?"; + return "www\.(?:[a-z0-9\-._~!$&'()*+,;=|@]+|%[\dA-F]{2})+(?::\d*)?(?:/(?:[a-z0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?"; break; case 'relative_url': diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 60e35709c9..bfff31af6a 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -598,7 +598,7 @@ function get_moderators(&$forum_moderators, $forum_id = false) } else { - $forum_moderators[$row['forum_id']][] = '' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . ''; + $forum_moderators[$row['forum_id']][] = '' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . ''; } } $db->sql_freeresult($result); diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index e6be8acd3d..e0d375c7ff 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -210,8 +210,7 @@ class ucp_profile $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error); } - $user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[\w]+' => 'USERNAME_ALPHA_ONLY', '[\w_\+\. \-\[\]]+' => 'USERNAME_ALPHA_SPACERS'); - $pass_char_ary = array('.*' => 'PASS_TYPE_ANY', '[a-zA-Z]' => 'PASS_TYPE_CASE', '[a-zA-Z0-9]' => 'PASS_TYPE_ALPHA', '[a-zA-Z\W]' => 'PASS_TYPE_SYMBOL'); + $user_char_ary = array('.*' => 'USERNAME_CHARS_ANY', '[a-z]+' => 'USERNAME_ALPHA_ONLY', '[-\]_+ [a-z]+' => 'USERNAME_ALPHA_SPACERS', '\w+' => 'USERNAME_LETTER_NUM', '[-\]_+ [\w]+' => 'USERNAME_LETTER_NUM_SPACERS', '[\x01-\x7F]+' => 'USERNAME_ASCII'); $template->assign_vars(array( 'ERROR' => (sizeof($error)) ? implode('
', $error) : '', @@ -223,7 +222,7 @@ class ucp_profile 'CUR_PASSWORD' => '', 'L_USERNAME_EXPLAIN' => sprintf($user->lang[$user_char_ary[str_replace('\\\\', '\\', $config['allow_name_chars'])] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']), - 'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang[$pass_char_ary[str_replace('\\\\', '\\', $config['pass_complex'])] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']), + 'L_CHANGE_PASSWORD_EXPLAIN' => sprintf($user->lang[$config['pass_complex'] . '_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']), 'S_FORCE_PASSWORD' => ($config['chg_passforce'] && $user->data['user_passchg'] < time() - $config['chg_passforce']) ? true : false, 'S_CHANGE_USERNAME' => ($config['allow_namechange'] && $auth->acl_get('u_chgname')) ? true : false, diff --git a/phpBB/includes/utf/utf_tools.php b/phpBB/includes/utf/utf_tools.php index ca4aa86ce3..c3c15b2c3b 100644 --- a/phpBB/includes/utf/utf_tools.php +++ b/phpBB/includes/utf/utf_tools.php @@ -1092,22 +1092,26 @@ function utf8_clean_string($text) static $homographs = array( // cyrllic - "\xD0\xB0" => "\x61", - "\xD0\xB5" => "\x65", - "\xD0\xBE" => "\x6F", - "\xD1\x80" => "\x70", - "\xD1\x81" => "\x63", - "\xD1\x83" => "\x79", - "\xD1\x85" => "\x78", - "\xD1\x95" => "\x73", - "\xD1\x96" => "\x69", - "\xD1\x98" => "\x6A", - "\xD2\xBB" => "\x68", + "\xD0\xB0" => "\x61", + "\xD0\xB5" => "\x65", + "\xD0\xBE" => "\x6F", + "\xD1\x80" => "\x70", + "\xD1\x81" => "\x63", + "\xD1\x83" => "\x79", + "\xD1\x85" => "\x78", + "\xD1\x95" => "\x73", + "\xD1\x96" => "\x69", + "\xD1\x98" => "\x6A", + "\xD2\xBB" => "\x68", // greek - "\xCE\xB1" => "\x61", - "\xCE\xBF" => "\x6F", + "\xCE\xB1" => "\x61", + "\xCE\xBF" => "\x6F", // other - "\xC2\xA1" => "\x69", + "\xC2\xA1" => "\x69", + "\xC2\xAD" => '', + "\x08" => '', + "\x09" => "\x32", + "\x11" => "\x32", ); $text = strtr($text, $homographs); diff --git a/phpBB/ucp.php b/phpBB/ucp.php index d0163d9daf..4568592081 100755 --- a/phpBB/ucp.php +++ b/phpBB/ucp.php @@ -78,7 +78,7 @@ switch ($mode) redirect(append_sid("{$phpbb_root_path}index.$phpEx")); } - login_box("index.$phpEx"); + login_box(request_var('redirect', "index.$phpEx")); break; case 'logout': From a512cc0f2ee5653df89c28fbb0cf6bfcdec46051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Wed, 3 Jan 2007 19:30:30 +0000 Subject: [PATCH 148/264] #6282 - more logical tabindex git-svn-id: file:///svn/phpbb/trunk@6833 89ea8834-ac86-4346-8a33-228a782c2dd0 --- .../styles/subSilver/template/posting_body.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/phpBB/styles/subSilver/template/posting_body.html b/phpBB/styles/subSilver/template/posting_body.html index d7b081ba2b..b70074d3fe 100644 --- a/phpBB/styles/subSilver/template/posting_body.html +++ b/phpBB/styles/subSilver/template/posting_body.html @@ -349,9 +349,9 @@
@@ -369,13 +369,13 @@
' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '
' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '   ' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . '' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '   ' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . '
' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '' . htmlspecialchars($__key, ENT_COMPAT, 'UTF-8') . '' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '' . htmlspecialchars($__key, ENT_COMPAT, 'UTF-8') . ' '; - if ($input_field) - { - $tpl .= ''; - } - else - { - $tpl .= '' . htmlspecialchars($__value, ENT_COMPAT, 'UTF-8') . ''; - } - + $tpl .= $this->add_input_field($input_field, $__value, $key, $_key, $__key); + $tpl .= '
' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . '' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . ' '; - if ($input_field) - { - $tpl .= ''; - } - else - { - $tpl .= '' . htmlspecialchars($_value, ENT_COMPAT, 'UTF-8') . ''; - } - + $tpl .= $this->add_input_field($input_field, $_value, $key, $_key); + $tpl .= '
' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . ' '; - if ($input_field) - { - $tpl .= ''; - } - else - { - $tpl .= '' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . ''; - } - - $tpl .= '
' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . '
' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '' . htmlspecialchars($_key, ENT_COMPAT, 'UTF-8') . ''; - - if ($text_field) - { - $tpl .= ''; - } - else - { - $tpl .= '' . htmlspecialchars($_value, ENT_COMPAT, 'UTF-8') . ''; - } - - $tpl .= '
 
' . htmlspecialchars($key_prefix, ENT_COMPAT, 'UTF-8') . '' . htmlspecialchars($key, ENT_COMPAT, 'UTF-8') . ''; - - if ($text_field) - { - $tpl .= ''; - } - else - { - $tpl .= '' . htmlspecialchars($value, ENT_COMPAT, 'UTF-8') . ''; - } + $tpl .= $this->add_input_field($input_field, $value, $key); $tpl .= '
{L_POST_DETAILS}
{RETURN_QUEUE}{RETURN_REPORTS}{RETURN_TOPIC}{RETURN_QUEUE} | {RETURN_TOPIC_SIMPLE} | {RETURN_POST}{RETURN_REPORTS}{RETURN_TOPIC}
{L_POST_SUBJECT}: {admin.RANK_IMG}{admin.RANK_IMG}{admin.RANK_TITLE}  {PM_IMG} 
{mod.RANK_IMG}{mod.RANK_IMG}{mod.RANK_TITLE}  {PM_IMG} 
-

» {faq_block.faq_row.FAQ_QUESTION}

-

{faq_block.faq_row.FAQ_ANSWER}

+
» {faq_block.faq_row.FAQ_QUESTION}
+
{faq_block.faq_row.FAQ_ANSWER}

{L_BACK_TO_TOP}

  -   -   -   +   +   +  
{S_HIDDEN_FIELDS} - -   + +   -   -   +   +   -   +  
From 30c2aca53ed046ea2862fc55479107446633e2af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Wed, 3 Jan 2007 19:38:12 +0000 Subject: [PATCH 149/264] #6214 git-svn-id: file:///svn/phpbb/trunk@6834 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/styles/subSilver/template/message_body.html | 9 +-------- phpBB/styles/subSilver/template/search_body.html | 9 +-------- phpBB/styles/subSilver/template/ucp_footer.html | 6 +----- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/phpBB/styles/subSilver/template/message_body.html b/phpBB/styles/subSilver/template/message_body.html index 03c34041bf..f61a3e6365 100644 --- a/phpBB/styles/subSilver/template/message_body.html +++ b/phpBB/styles/subSilver/template/message_body.html @@ -11,13 +11,6 @@
- - - - -
- -

{S_TIMEZONE}

-
+ \ No newline at end of file diff --git a/phpBB/styles/subSilver/template/search_body.html b/phpBB/styles/subSilver/template/search_body.html index 70952041e0..20385ef753 100644 --- a/phpBB/styles/subSilver/template/search_body.html +++ b/phpBB/styles/subSilver/template/search_body.html @@ -71,14 +71,7 @@ - - - - -
- -

{S_TIMEZONE}

-
+
diff --git a/phpBB/styles/subSilver/template/ucp_footer.html b/phpBB/styles/subSilver/template/ucp_footer.html index 2160717aba..3b40f90852 100644 --- a/phpBB/styles/subSilver/template/ucp_footer.html +++ b/phpBB/styles/subSilver/template/ucp_footer.html @@ -6,11 +6,7 @@
- - - - -
{S_TIMEZONE}
+
From 826a045ddd922df1b38fba1f405b6f70b0fc8b9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Wed, 3 Jan 2007 19:43:21 +0000 Subject: [PATCH 150/264] #6120 - Making overall_header nicer for text-browsers git-svn-id: file:///svn/phpbb/trunk@6835 89ea8834-ac86-4346-8a33-228a782c2dd0 --- .../subSilver/template/overall_header.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/phpBB/styles/subSilver/template/overall_header.html b/phpBB/styles/subSilver/template/overall_header.html index ae97057452..4fb03306c2 100644 --- a/phpBB/styles/subSilver/template/overall_header.html +++ b/phpBB/styles/subSilver/template/overall_header.html @@ -146,22 +146,22 @@ function marklist(id, name, state) From 2851b9ea80318e056486785a0a5e1d2ee33ec3de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Wed, 3 Jan 2007 20:10:53 +0000 Subject: [PATCH 151/264] #6712 - Posts in search results with empty subjects get a Jump to post message git-svn-id: file:///svn/phpbb/trunk@6836 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/search.php | 2 ++ phpBB/styles/subSilver/template/search_results.html | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/phpBB/language/en/search.php b/phpBB/language/en/search.php index cd7b8c50e5..b932cd8ccb 100644 --- a/phpBB/language/en/search.php +++ b/phpBB/language/en/search.php @@ -45,6 +45,8 @@ $lang = array_merge($lang, array( 'IGNORED_TERMS' => 'ignored', 'IGNORED_TERMS_EXPLAIN' => 'The following words in your search query were ignored: %s', + 'JUMP_TO_POST' => 'Jump to post', + '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/styles/subSilver/template/search_results.html b/phpBB/styles/subSilver/template/search_results.html index ea880d3642..79853b83af 100644 --- a/phpBB/styles/subSilver/template/search_results.html +++ b/phpBB/styles/subSilver/template/search_results.html @@ -84,14 +84,23 @@ - + From 6348898fd56a09fce66ff344070a1a8f29d3b098 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 3 Jan 2007 21:09:29 +0000 Subject: [PATCH 152/264] fix for bug #6742 git-svn-id: file:///svn/phpbb/trunk@6837 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_icons.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index bd942fe27f..131235ef8d 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -203,14 +203,14 @@ class acp_icons $images = (isset($_POST['image'])) ? array_keys(request_var('image', array('' => 0))) : array(); // Now really get the items - $image_id = (isset($_POST['id'])) ? request_var('id', array(0)) : array(); - $image_order = (isset($_POST['order'])) ? request_var('order', array(0)) : array(); - $image_width = (isset($_POST['width'])) ? request_var('width', array(0)) : array(); - $image_height = (isset($_POST['height'])) ? request_var('height', array(0)) : array(); - $image_add = (isset($_POST['add_img'])) ? request_var('add_img', array(0)) : array(); + $image_id = (isset($_POST['id'])) ? request_var('id', array('' => 0)) : array(); + $image_order = (isset($_POST['order'])) ? request_var('order', array('' => 0)) : array(); + $image_width = (isset($_POST['width'])) ? request_var('width', array('' => 0)) : array(); + $image_height = (isset($_POST['height'])) ? request_var('height', array('' => 0)) : array(); + $image_add = (isset($_POST['add_img'])) ? request_var('add_img', array('' => 0)) : array(); $image_emotion = request_var('emotion', array('' => '')); $image_code = request_var('code', array('' => '')); - $image_display_on_posting = (isset($_POST['display_on_posting'])) ? request_var('display_on_posting', array(0)) : array(); + $image_display_on_posting = (isset($_POST['display_on_posting'])) ? request_var('display_on_posting', array('' => 0)) : array(); foreach ($images as $image) { From fbef3990e74034f5cf205867a2b37e0e13a98997 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 3 Jan 2007 21:15:06 +0000 Subject: [PATCH 153/264] #6746 git-svn-id: file:///svn/phpbb/trunk@6838 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/viewonline.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php index 588d753b14..f202dceb5b 100644 --- a/phpBB/viewonline.php +++ b/phpBB/viewonline.php @@ -225,21 +225,22 @@ while ($row = $db->sql_fetchrow($result)) switch ($on_page[1]) { case 'reply': - $location = sprintf($user->lang['REPLYING_MESSAGE'], $forum_data[$forum_id]); + case 'quote': + $location = sprintf($user->lang['REPLYING_MESSAGE'], $forum_data[$forum_id]['forum_name']); break; default: - $location = sprintf($user->lang['POSTING_MESSAGE'], $forum_data[$forum_id]); + $location = sprintf($user->lang['POSTING_MESSAGE'], $forum_data[$forum_id]['forum_name']); break; } break; case 'viewtopic': - $location = sprintf($user->lang['READING_TOPIC'], $forum_data[$forum_id]); + $location = sprintf($user->lang['READING_TOPIC'], $forum_data[$forum_id]['forum_name']); break; case 'viewforum': - $location = sprintf($user->lang['READING_FORUM'], $forum_data[$forum_id]); + $location = sprintf($user->lang['READING_FORUM'], $forum_data[$forum_id]['forum_name']); break; } } From 3a8c3971da12623aeb86c67c34fe0b962d672ad9 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 4 Jan 2007 16:07:38 +0000 Subject: [PATCH 154/264] - use var_export instead of our format_array function [Bug #6748] - fix dumb error in column naming [Bug #6750] - Make sure to catch some special conditions for cpf translation as well as correctly removing/adding default values on language installation/removing [Bug #6752] git-svn-id: file:///svn/phpbb/trunk@6839 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acm/acm_file.php | 48 +++------------- phpBB/includes/acp/acp_groups.php | 4 +- phpBB/includes/acp/acp_language.php | 44 ++++++++++++++ phpBB/includes/acp/acp_profile.php | 79 +++++++++++++++++--------- phpBB/includes/functions_messenger.php | 54 +++++------------- 5 files changed, 120 insertions(+), 109 deletions(-) diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php index b6af055399..ecc4db8a89 100644 --- a/phpBB/includes/acm/acm_file.php +++ b/phpBB/includes/acm/acm_file.php @@ -71,12 +71,11 @@ class acm } global $phpEx; - $file = "vars = " . $this->format_array($this->vars) . ";\n\n\$this->var_expires = " . $this->format_array($this->var_expires) . "\n?>"; if ($fp = @fopen($this->cache_dir . 'data_global.' . $phpEx, 'wb')) { @flock($fp, LOCK_EX); - fwrite($fp, $file); + fwrite($fp, "vars = " . var_export($this->vars, true) . ";\n\n\$this->var_expires = " . var_export($this->var_expires, true) . "\n?>"); @flock($fp, LOCK_UN); fclose($fp); } @@ -151,7 +150,7 @@ class acm return false; } - include($this->cache_dir . 'data' . $var_name . ".$phpEx"); + include($this->cache_dir . "data{$var_name}.$phpEx"); return (isset($data)) ? $data : false; } else @@ -169,10 +168,10 @@ class acm { global $phpEx; - if ($fp = @fopen($this->cache_dir . 'data' . $var_name . ".$phpEx", 'wb')) + if ($fp = @fopen($this->cache_dir . "data{$var_name}.$phpEx", 'wb')) { @flock($fp, LOCK_EX); - fwrite($fp, " " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\n\$data = unserialize('" . str_replace("'", "\\'", str_replace('\\', '\\\\', serialize($var))) . "');\n?>"); + fwrite($fp, " " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\n\$data = " . var_export($var, true) . ";\n?>"); @flock($fp, LOCK_UN); fclose($fp); } @@ -290,37 +289,6 @@ class acm } } - /** - * Format an array to be stored on filesystem - */ - function format_array($array, $tab = '') - { - $tab .= "\t"; - - $lines = array(); - foreach ($array as $k => $v) - { - if (is_array($v)) - { - $lines[] = "\n{$tab}'$k' => " . $this->format_array($v, $tab); - } - else if (is_int($v)) - { - $lines[] = "\n{$tab}'$k' => $v"; - } - else if (is_bool($v)) - { - $lines[] = "\n{$tab}'$k' => " . (($v) ? 'true' : 'false'); - } - else - { - $lines[] = "\n{$tab}'$k' => '" . str_replace("'", "\\'", str_replace('\\', '\\\\', $v)) . "'"; - } - } - - return 'array(' . implode(',', $lines) . ')'; - } - /** * Load cached sql query */ @@ -368,7 +336,6 @@ class acm { @flock($fp, LOCK_EX); - $lines = array(); $query_id = sizeof($this->sql_rowset); $this->sql_rowset[$query_id] = array(); $this->sql_row_pointer[$query_id] = 0; @@ -376,12 +343,13 @@ class acm while ($row = $db->sql_fetchrow($query_result)) { $this->sql_rowset[$query_id][] = $row; - - $lines[] = "unserialize('" . str_replace("'", "\\'", str_replace('\\', '\\\\', serialize($row))) . "')"; } $db->sql_freeresult($query_result); - fwrite($fp, " " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\n\$this->sql_rowset[\$query_id] = array(" . implode(',', $lines) . ') ?>'); + $file = " " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n"; + + fwrite($fp, $file . "\n\$this->sql_rowset[\$query_id] = " . var_export($this->sql_rowset[$query_id], true) . ";\n?>"); @flock($fp, LOCK_UN); fclose($fp); diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index f7b4d8fc66..669e98f32f 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -363,7 +363,7 @@ class acp_groups // Since the user only has the option to copy permissions from non leader managed groups this seems to be a good compromise. if ($group_perm_from && $action == 'add' && $auth->acl_get('a_authgroups') && $auth->acl_gets('a_aauth', 'a_fauth', 'a_mauth', 'a_uauth')) { - $sql = 'SELECT group_manage_founder + $sql = 'SELECT group_founder_manage FROM ' . GROUPS_TABLE . ' WHERE group_id = ' . $group_perm_from; $result = $db->sql_query($sql); @@ -371,7 +371,7 @@ class acp_groups $db->sql_freeresult($result); // Check the group if non-founder - if ($check_row && ($user->data['user_type'] == USER_FOUNDER || $check_row['group_manage_founder'] == 0)) + if ($check_row && ($user->data['user_type'] == USER_FOUNDER || $check_row['group_founder_manage'] == 0)) { // From the mysql documentation: // Prior to MySQL 4.0.14, the target table of the INSERT statement cannot appear in the FROM clause of the SELECT part of the query. This limitation is lifted in 4.0.14. diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php index 94a79fa2d3..16f75d9c92 100644 --- a/phpBB/includes/acp/acp_language.php +++ b/phpBB/includes/acp/acp_language.php @@ -674,6 +674,13 @@ class acp_language WHERE user_lang = '" . $db->sql_escape($row['lang_iso']) . "'"; $db->sql_query($sql); + // We also need to remove the translated entries for custom profile fields - we want clean tables, don't we? + $sql = 'DELETE FROM ' . PROFILE_LANG_TABLE . ' WHERE lang_id = ' . $lang_id; + $db->sql_query($sql); + + $sql = 'DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . ' WHERE lang_id = ' . $lang_id; + $db->sql_query($sql); + add_log('admin', 'LOG_LANGUAGE_PACK_DELETED', $row['lang_english_name']); trigger_error(sprintf($user->lang['LANGUAGE_PACK_DELETED'], $row['lang_english_name']) . adm_back_link($this->u_action)); @@ -725,6 +732,43 @@ class acp_language ); $db->sql_query('INSERT INTO ' . LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary)); + $lang_id = $db->sql_nextid(); + + // Now let's copy the default language entries for custom profile fields for this new language - makes admin's life easier. + $sql = 'SELECT lang_id + FROM ' . LANG_TABLE . " + WHERE lang_iso = '" . $db->sql_escape($config['default_lang']) . "'"; + $result = $db->sql_query($sql); + $default_lang_id = (int) $db->sql_fetchfield('lang_id'); + $db->sql_freeresult($result); + + // From the mysql documentation: + // Prior to MySQL 4.0.14, the target table of the INSERT statement cannot appear in the FROM clause of the SELECT part of the query. This limitation is lifted in 4.0.14. + // Due to this we stay on the safe side if we do the insertion "the manual way" + + $sql = 'SELECT field_id, lang_name, lang_explain, lang_default_value + FROM ' . PROFILE_LANG_TABLE . ' + WHERE lang_id = ' . $default_lang_id; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $row['lang_id'] = $lang_id; + $db->sql_query('INSERT INTO ' . PROFILE_LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $row)); + } + $db->sql_freeresult($result); + + $sql = 'SELECT field_id, option_id, field_type, lang_value + FROM ' . PROFILE_FIELDS_LANG_TABLE . ' + WHERE lang_id = ' . $default_lang_id; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $row['lang_id'] = $lang_id; + $db->sql_query('INSERT INTO ' . PROFILE_FIELDS_LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $row)); + } + $db->sql_freeresult($result); add_log('admin', 'LOG_LANGUAGE_PACK_INSTALLED', $lang_pack['name']); diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index e093308f4d..da11868cc2 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -15,6 +15,9 @@ class acp_profile { var $u_action; + var $edit_lang_id; + var $lang_defs; + function main($id, $mode) { global $config, $db, $user, $auth, $template, $cache; @@ -47,7 +50,7 @@ class acp_profile // Build Language array // Based on this, we decide which elements need to be edited later and which language items are missing - $lang_defs = array(); + $this->lang_defs = array(); $sql = 'SELECT lang_id, lang_iso FROM ' . LANG_TABLE . ' @@ -57,8 +60,8 @@ class acp_profile while ($row = $db->sql_fetchrow($result)) { // Make some arrays with all available languages - $lang_defs['id'][] = $row['lang_id']; - $lang_defs['iso'][$row['lang_iso']] = $row['lang_id']; + $this->lang_defs['id'][$row['lang_id']] = $row['lang_iso']; + $this->lang_defs['iso'][$row['lang_iso']] = $row['lang_id']; } $db->sql_freeresult($result); @@ -70,17 +73,17 @@ class acp_profile while ($row = $db->sql_fetchrow($result)) { // Which languages are available for each item - $lang_defs['entry'][$row['field_id']][] = $row['lang_id']; + $this->lang_defs['entry'][$row['field_id']][] = $row['lang_id']; } $db->sql_freeresult($result); // Have some fields been defined? - if (isset($lang_defs['entry'])) + if (isset($this->lang_defs['entry'])) { - foreach ($lang_defs['entry'] as $field_id => $field_ary) + foreach ($this->lang_defs['entry'] as $field_id => $field_ary) { // Fill an array with the languages that are missing for each field - $lang_defs['diff'][$field_id] = array_diff($lang_defs['id'], $field_ary); + $this->lang_defs['diff'][$field_id] = array_diff(array_values($this->lang_defs['iso']), $field_ary); } } @@ -207,7 +210,7 @@ class acp_profile $default_lang_id = (int) $db->sql_fetchfield('lang_id'); $db->sql_freeresult($result); - if (!in_array($default_lang_id, $lang_defs['entry'][$field_id])) + if (!in_array($default_lang_id, $this->lang_defs['entry'][$field_id])) { trigger_error($user->lang['DEFAULT_LANGUAGE_NOT_FILLED'] . adm_back_link($this->u_action), E_USER_WARNING); } @@ -275,6 +278,9 @@ class acp_profile $submit = (isset($_REQUEST['next']) || isset($_REQUEST['prev'])) ? true : false; $save = (isset($_REQUEST['save'])) ? true : false; + // The language id of default language + $this->edit_lang_id = $this->lang_defs['iso'][$config['default_lang']]; + // We are editing... we need to grab basic things if ($action == 'edit') { @@ -285,7 +291,7 @@ class acp_profile $sql = 'SELECT l.*, f.* FROM ' . PROFILE_LANG_TABLE . ' l, ' . PROFILE_FIELDS_TABLE . ' f - WHERE l.lang_id = ' . $lang_defs['iso'][$config['default_lang']] . " + WHERE l.lang_id = ' . $this->edit_lang_id . " AND f.field_id = $field_id AND l.field_id = f.field_id"; $result = $db->sql_query($sql); @@ -294,14 +300,29 @@ class acp_profile if (!$field_row) { - trigger_error($user->lang['FIELD_NOT_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING); + // Some admin changed the default language? + $sql = 'SELECT l.*, f.* + FROM ' . PROFILE_LANG_TABLE . ' l, ' . PROFILE_FIELDS_TABLE . ' f + WHERE l.lang_id <> ' . $this->edit_lang_id . " + AND f.field_id = $field_id + AND l.field_id = f.field_id"; + $result = $db->sql_query($sql); + $field_row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (!$field_row) + { + trigger_error($user->lang['FIELD_NOT_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + $this->edit_lang_id = $field_row['lang_id']; } $field_type = $field_row['field_type']; // Get language entries $sql = 'SELECT * FROM ' . PROFILE_FIELDS_LANG_TABLE . ' - WHERE lang_id = ' . $lang_defs['iso'][$config['default_lang']] . " + WHERE lang_id = ' . $this->edit_lang_id . " AND field_id = $field_id ORDER BY option_id ASC"; $result = $db->sql_query($sql); @@ -404,17 +425,17 @@ class acp_profile { // The number of options in the field is equal to the number of options already in the database // Or we are creating a new dropdown list. - $cp->vars['lang_options'] = $exploded_options; + $cp->vars['lang_options'] = $exploded_options; } else if ($action == 'edit') { // Changing the number of options? (We remove and re-create the option fields) - $cp->vars['lang_options'] = $exploded_options; + $cp->vars['lang_options'] = $exploded_options; } } else { - $cp->vars['lang_options'] = $lang_options; + $cp->vars['lang_options'] = $lang_options; } // step 2 @@ -483,7 +504,7 @@ class acp_profile // Get language entries $sql = 'SELECT * FROM ' . PROFILE_FIELDS_LANG_TABLE . ' - WHERE lang_id <> ' . $lang_defs['iso'][$config['default_lang']] . " + WHERE lang_id <> ' . $this->edit_lang_id . " AND field_id = $field_id ORDER BY option_id ASC"; $result = $db->sql_query($sql); @@ -498,7 +519,7 @@ class acp_profile $sql = 'SELECT lang_id, lang_name, lang_explain, lang_default_value FROM ' . PROFILE_LANG_TABLE . ' - WHERE lang_id <> ' . $lang_defs['iso'][$config['default_lang']] . " + WHERE lang_id <> ' . $this->edit_lang_id . " AND field_id = $field_id ORDER BY lang_id ASC"; $result = $db->sql_query($sql); @@ -616,13 +637,13 @@ class acp_profile if (!sizeof($error)) { - if ($step == 3 && (sizeof($lang_defs['iso']) == 1 || $save)) + if ($step == 3 && (sizeof($this->lang_defs['iso']) == 1 || $save)) { - $this->save_profile_field($cp, $field_type, $lang_defs, $action); + $this->save_profile_field($cp, $field_type, $action); } else if ($action == 'edit' && $save) { - $this->save_profile_field($cp, $field_type, $lang_defs, $action); + $this->save_profile_field($cp, $field_type, $action); } } @@ -706,7 +727,7 @@ class acp_profile $template->assign_vars(array( 'S_STEP_TWO' => true, - 'L_NEXT' => (sizeof($lang_defs['iso']) == 1) ? $user->lang['SAVE'] : $user->lang['PROFILE_LANG_OPTIONS']) + 'L_NEXT' => (sizeof($this->lang_defs['iso']) == 1) ? $user->lang['SAVE'] : $user->lang['PROFILE_LANG_OPTIONS']) ); // Build options based on profile type @@ -729,7 +750,7 @@ class acp_profile foreach ($options as $lang_id => $lang_ary) { $template->assign_block_vars('options', array( - 'LANGUAGE' => ($lang_ary['lang_iso'] == $config['default_lang']) ? sprintf($user->lang['DEFAULT_ISO_LANGUAGE'], $config['default_lang']) : sprintf($user->lang['ISO_LANGUAGE'], $lang_ary['lang_iso'])) + 'LANGUAGE' => sprintf($user->lang[(($lang_id == $this->edit_lang_id) ? 'DEFAULT_' : '') . 'ISO_LANGUAGE'], $lang_ary['lang_iso'])) ); foreach ($lang_ary['fields'] as $field_ident => $field_ary) @@ -766,7 +787,7 @@ class acp_profile $active_value = (!$row['field_active']) ? 'activate' : 'deactivate'; $id = $row['field_id']; - $s_need_edit = (sizeof($lang_defs['diff'][$row['field_id']])) ? true : false; + $s_need_edit = (sizeof($this->lang_defs['diff'][$row['field_id']])) ? true : false; if ($s_need_edit) { @@ -815,10 +836,12 @@ class acp_profile { global $user, $config, $db; + $default_lang_id = (!empty($this->edit_lang_id)) ? $this->edit_lang_id : $this->lang_defs['iso'][$config['default_lang']]; + $sql = 'SELECT lang_id, lang_iso - FROM ' . LANG_TABLE . " - WHERE lang_iso <> '" . $config['default_lang'] . "' - ORDER BY lang_english_name"; + FROM ' . LANG_TABLE . ' + WHERE lang_id <> ' . (int) $default_lang_id . ' + ORDER BY lang_english_name'; $result = $db->sql_query($sql); $languages = array(); @@ -858,7 +881,7 @@ class acp_profile foreach ($options as $field => $field_type) { - $lang_options[1]['lang_iso'] = $config['default_lang']; + $lang_options[1]['lang_iso'] = $this->lang_defs['id'][$default_lang_id]; $lang_options[1]['fields'][$field] = array( 'TITLE' => $user->lang['CP_' . strtoupper($field)], 'FIELD' => '
' . ((is_array($cp->vars[$field])) ? implode('
', $cp->vars[$field]) : str_replace("\n", '
', $cp->vars[$field])) . '
' @@ -930,7 +953,7 @@ class acp_profile /** * Save Profile Field */ - function save_profile_field(&$cp, $field_type, &$lang_defs, $action = 'create') + function save_profile_field(&$cp, $field_type, $action = 'create') { global $db, $config, $user; @@ -939,7 +962,7 @@ class acp_profile // Collect all information, if something is going wrong, abort the operation $profile_sql = $profile_lang = $empty_lang = $profile_lang_fields = array(); - $default_lang_id = $lang_defs['iso'][$config['default_lang']]; + $default_lang_id = (!empty($this->edit_lang_id)) ? $this->edit_lang_id : $this->lang_defs['iso'][$config['default_lang']]; if ($action == 'create') { diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 190975a96b..b802d13a0d 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -401,7 +401,9 @@ class messenger } else { - $result = @$config['email_function_name']($mail_to, mail_encode($this->subject), implode("\n", preg_split("/\r?\n/", wordwrap($this->msg))), $headers); + ob_start(); + $result = $config['email_function_name']($mail_to, mail_encode($this->subject), implode("\n", preg_split("/\r?\n/", wordwrap($this->msg))), $headers); + $err_msg = ob_get_clean(); } if (!$result) @@ -623,7 +625,16 @@ class queue $err_msg = ''; $to = (!$to) ? 'Undisclosed-Recipient:;' : $to; - $result = ($config['smtp_delivery']) ? smtpmail($addresses, mail_encode($subject), wordwrap($msg), $err_msg, $headers) : @$config['email_function_name']($to, mail_encode($subject), implode("\n", preg_split("/\r?\n/", wordwrap($msg))), $headers); + if ($config['smtp_delivery']) + { + $result = smtpmail($addresses, mail_encode($subject), wordwrap($msg), $err_msg, $headers); + } + else + { + ob_start(); + $result = $config['email_function_name']($to, mail_encode($subject), implode("\n", preg_split("/\r?\n/", wordwrap($msg))), $headers); + $err_msg = ob_get_clean(); + } if (!$result) { @@ -671,12 +682,10 @@ class queue } else { - $file = 'queue_data=' . $this->format_array($this->queue_data) . '; ?>'; - if ($fp = @fopen($this->cache_file, 'w')) { @flock($fp, LOCK_EX); - fwrite($fp, $file); + fwrite($fp, "queue_data = " . var_export($this->queue_data) . ";\n?>"); @flock($fp, LOCK_UN); fclose($fp); } @@ -711,48 +720,15 @@ class queue } } } - - $file = 'queue_data = ' . $this->format_array($this->data) . '; ?>'; if ($fp = @fopen($this->cache_file, 'w')) { @flock($fp, LOCK_EX); - fwrite($fp, $file); + fwrite($fp, "queue_data = " . var_export($this->data) . ";\n?>"); @flock($fp, LOCK_UN); fclose($fp); } } - - /** - * Format array - * @access private - */ - function format_array($array) - { - $lines = array(); - foreach ($array as $k => $v) - { - if (is_array($v)) - { - $lines[] = "'$k'=>" . $this->format_array($v); - } - else if (is_int($v)) - { - $lines[] = "'$k'=>$v"; - } - else if (is_bool($v)) - { - $lines[] = "'$k'=>" . (($v) ? 'true' : 'false'); - } - else - { - $lines[] = "'$k'=>'" . str_replace("'", "\'", str_replace('\\', '\\\\', $v)) . "'"; - } - } - - return 'array(' . implode(',', $lines) . ')'; - } - } /** From e86c24a4198a94d28af9455e43865874fe998eb2 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 5 Jan 2007 09:30:46 +0000 Subject: [PATCH 155/264] forgot to add true to the var_export function. :( git-svn-id: file:///svn/phpbb/trunk@6840 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_messenger.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index b802d13a0d..a9e6011b8c 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -685,7 +685,7 @@ class queue if ($fp = @fopen($this->cache_file, 'w')) { @flock($fp, LOCK_EX); - fwrite($fp, "queue_data = " . var_export($this->queue_data) . ";\n?>"); + fwrite($fp, "queue_data = " . var_export($this->queue_data, true) . ";\n?>"); @flock($fp, LOCK_UN); fclose($fp); } @@ -724,7 +724,7 @@ class queue if ($fp = @fopen($this->cache_file, 'w')) { @flock($fp, LOCK_EX); - fwrite($fp, "queue_data = " . var_export($this->data) . ";\n?>"); + fwrite($fp, "queue_data = " . var_export($this->data, true) . ";\n?>"); @flock($fp, LOCK_UN); fclose($fp); } From 94b50f1797937c23bb400628dd51e09c6148c16d Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 5 Jan 2007 11:21:09 +0000 Subject: [PATCH 156/264] fix message length calculation for parsing bbcodes as well as saving some bytes of memory. ;) git-svn-id: file:///svn/phpbb/trunk@6841 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/search.php | 59 ++++++++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/phpBB/search.php b/phpBB/search.php index 642b54b53e..681d47f0f1 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -453,7 +453,6 @@ if ($keywords || $author || $author_id || $search_id || $submit) } // define some vars for urls - // @todo preg_replace still needed? $hilit = htmlspecialchars(implode('|', explode(' ', preg_replace('#\s+#u', ' ', str_replace(array('+', '-', '|', '(', ')'), ' ', $keywords))))); $u_hilit = urlencode($keywords); $u_show_results = ($show_results != 'posts') ? '&sr=' . $show_results : ''; @@ -498,9 +497,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) { if ($show_results == 'posts') { - /** - * @todo Joining this query to the one below? - */ + // @todo Joining this query to the one below? $sql = 'SELECT zebra_id, friend, foe FROM ' . ZEBRA_TABLE . ' WHERE user_id = ' . $user->data['user_id']; @@ -628,14 +625,26 @@ if ($keywords || $author || $author_id || $search_id || $submit) } else { - $bbcode_bitfield = ''; + $bbcode_bitfield = $text_only_message = ''; $attach_list = array(); while ($row = $db->sql_fetchrow($result)) { - $rowset[] = $row; - if (($return_chars == -1) || (utf8_strlen($row['post_text']) < $return_chars + 3)) + // We pre-process some variables here for later usage + $row['post_text'] = censor_text($row['post_text']); + + $text_only_message = $row['post_text']; + // make list items visible as such + if ($row['bbcode_uid']) { + $text_only_message = str_replace('[*:' . $row['bbcode_uid'] . ']', '⋅ ', $text_only_message); + // no BBCode in text only message + strip_bbcode($text_only_message, $row['bbcode_uid']); + } + + if ($return_chars == -1 || utf8_strlen($text_only_message) < ($return_chars + 3)) + { + $row['display_text_only'] = false; $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']); // Does this post have an attachment? If so, add it to the list @@ -644,9 +653,18 @@ if ($keywords || $author || $author_id || $search_id || $submit) $attach_list[$row['forum_id']][] = $row['post_id']; } } + else + { + $row['post_text'] = $text_only_message; + $row['display_text_only'] = true; + } + + $rowset[] = $row; } $db->sql_freeresult($result); + unset($text_only_message); + // Instantiate BBCode if needed if ($bbcode_bitfield !== '') { @@ -802,48 +820,39 @@ if ($keywords || $author || $author_id || $search_id || $submit) // Replace naughty words such as farty pants $row['post_subject'] = censor_text($row['post_subject']); - $message = censor_text($row['post_text']); - $text_only_message = $message; - // make list items visible as such - $text_only_message = str_replace('[*:' . $row['bbcode_uid'] . ']', '⋅ ', $message); - // no BBCode in text only message - strip_bbcode($text_only_message, $row['bbcode_uid']); - - if ($return_chars != -1 && utf8_strlen($text_only_message) >= ($return_chars + 3)) + if ($row['display_text_only']) { // now find context for the searched words - $message = get_context($text_only_message, array_filter(explode('|', $hilit), 'strlen'), $return_chars); - - $message = str_replace("\n", '
', $message); + $row['post_text'] = get_context($row['post_text'], array_filter(explode('|', $hilit), 'strlen'), $return_chars); + $row['post_text'] = str_replace("\n", '
', $row['post_text']); } else { - $message = str_replace("\n", '
', $message); + $row['post_text'] = str_replace("\n", '
', $row['post_text']); // Second parse bbcode here if ($row['bbcode_bitfield']) { - $bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']); + $bbcode->bbcode_second_pass($row['post_text'], $row['bbcode_uid'], $row['bbcode_bitfield']); } if (!empty($attachments[$row['post_id']])) { - parse_attachments($forum_id, $message, $attachments[$row['post_id']], $update_count); + parse_attachments($forum_id, $row['post_text'], $attachments[$row['post_id']], $update_count); // we only display inline attachments unset($attachments[$row['post_id']]); } // Always process smilies after parsing bbcodes - $message = smiley_text($message); + $row['post_text'] = smiley_text($row['post_text']); } - unset($text_only_message); if ($hilit) { // post highlighting - $message = preg_replace('#(?!<.*)(?]*(?:)#is', '$1', $message); + $row['post_text'] = preg_replace('#(?!<.*)(?]*(?:)#is', '$1', $row['post_text']); } $tpl_ary = array( @@ -854,7 +863,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) 'POST_SUBJECT' => $row['post_subject'], 'POST_DATE' => (!empty($row['post_time'])) ? $user->format_date($row['post_time']) : '', - 'MESSAGE' => $message + 'MESSAGE' => $row['post_text'] ); } From 77335d94e4258112a69b5484a3006233c7550630 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 5 Jan 2007 15:31:04 +0000 Subject: [PATCH 157/264] unique cookie name anyone? git-svn-id: file:///svn/phpbb/trunk@6842 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/install_install.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 06579e7c49..c9231075df 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -1320,6 +1320,14 @@ class install_install extends module WHERE config_name = 'captcha_gd'"; } + // We set a (semi-)unique cookie name to bypass login issues related to the cookie name. + $cookie_name = 'phpbb3_'; + $cookie_name .= strtolower(gen_rand_string(5)); + + $sql_ary[] = 'UPDATE ' . $table_prefix . "config + SET config_value = '" . $db->sql_escape($cookie_name) . "' + WHERE config_name = 'cookie_name'"; + foreach ($sql_ary as $sql) { //$sql = trim(str_replace('|', ';', $sql)); From ce13b9b9963b2d11bae2eca26560b1f74bd5505f Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Fri, 5 Jan 2007 21:17:28 +0000 Subject: [PATCH 158/264] - use constants no weird numbers ;-) - solved problem with \w using UTF-8 search (fulltext_mysql) by using PCRE unicode character properties if available [Bug #5768] git-svn-id: file:///svn/phpbb/trunk@6843 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 2 +- phpBB/includes/search/fulltext_mysql.php | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 42046ff265..e4abcc6cc7 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2338,7 +2338,7 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb $uid = ''; } - $flags = (($allow_bbcode) ? 1 : 0) + (($allow_smilies) ? 2 : 0) + (($allow_urls) ? 4 : 0); + $flags = (($allow_bbcode) ? OPTION_FLAG_BBCODE : 0) + (($allow_smilies) ? OPTION_FLAG_SMILIES : 0) + (($allow_urls) ? OPTION_FLAG_LINKS : 0); $bitfield = $message_parser->bbcode_bitfield; return; diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index f20962d11d..e475e012f0 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -32,6 +32,7 @@ class fulltext_mysql extends search_backend var $split_words = array(); var $search_query; var $common_words = array(); + var $pcre_properties = false; function fulltext_mysql(&$error) { @@ -39,6 +40,11 @@ class fulltext_mysql extends search_backend $this->word_length = array('min' => $config['fulltext_mysql_min_word_len'], 'max' => $config['fulltext_mysql_max_word_len']); + if (version_compare(PHP_VERSION, '5.1.0', '>=') || (version_compare(PHP_VERSION, '5.0.0-dev', '<=') && version_compare(PHP_VERSION, '4.4.0', '>='))) + { + $this->pcre_properties = true; + } + $error = false; } @@ -123,9 +129,9 @@ class fulltext_mysql extends search_backend $keywords = preg_replace($match, ' ', trim($keywords)); // Split words - $split_keywords = preg_replace('#([^\w\'*])#', '$1$1', str_replace('\'\'', '\' \'', trim($keywords))); + $split_keywords = preg_replace(($this->pcre_properties) ? '#([^\p{L}\p{N}\'*])#u' : '#([^\w\'*])#u', '$1$1', str_replace('\'\'', '\' \'', trim($keywords))); $matches = array(); - preg_match_all('#(?:[^\w*]|^)([+\-|]?(?:[\w*]+\'?)*[\w*])(?:[^\w*]|$)#', $split_keywords, $matches); + preg_match_all(($this->pcre_properties) ? '#(?:[^\p{L}\p{N}*]|^)([+\-|]?(?:[\p{L}\p{N}*]+\'?)*[\p{L}\p{N}*])(?:[^\p{L}\p{N}*]|$)#u' : '#(?:[^\w*]|^)([+\-|]?(?:[\w*]+\'?)*[\w*])(?:[^\w*]|$)#u', $split_keywords, $matches); $this->split_words = $matches[1]; if (sizeof($this->ignore_words)) @@ -174,9 +180,9 @@ class fulltext_mysql extends search_backend $this->get_synonyms(); // Split words - $text = preg_replace('#([^\w\'*])#', '$1$1', str_replace('\'\'', '\' \'', trim($text))); + $text = preg_replace(($this->pcre_properties) ? '#([^\p{L}\p{N}\'*])#u' : '#([^\w\'*])#u', '$1$1', str_replace('\'\'', '\' \'', trim($text))); $matches = array(); - preg_match_all('#(?:[^\w*]|^)([+\-|]?(?:[\w*]+\'?)*[\w*])(?:[^\w*]|$)#', $text, $matches); + preg_match_all(($this->pcre_properties) ? '#(?:[^\p{L}\p{N}*]|^)([+\-|]?(?:[\p{L}\p{N}*]+\'?)*[\p{L}\p{N}*])(?:[^\p{L}\p{N}*]|$)#u' : '#(?:[^\w*]|^)([+\-|]?(?:[\w*]+\'?)*[\w*])(?:[^\w*]|$)#u', $text, $matches); $text = $matches[1]; if (sizeof($this->ignore_words)) From e1b549a96766b33b8ae779a82f4442413c94a904 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 6 Jan 2007 18:31:42 +0000 Subject: [PATCH 159/264] - updated/new documents git-svn-id: file:///svn/phpbb/trunk@6844 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/AUTHORS | 4 +- phpBB/docs/CHANGELOG.html | 215 +++++++++++++ phpBB/docs/FAQ.html | 380 ++++++++++++++++++++++ phpBB/docs/INSTALL.html | 519 ++++++++++++++++++++++++++++++ phpBB/docs/README.html | 432 +++++++++++++++++++++++++ phpBB/docs/coding-guidelines.html | 89 +++-- 6 files changed, 1584 insertions(+), 55 deletions(-) create mode 100644 phpBB/docs/CHANGELOG.html create mode 100644 phpBB/docs/FAQ.html create mode 100644 phpBB/docs/INSTALL.html create mode 100644 phpBB/docs/README.html diff --git a/phpBB/docs/AUTHORS b/phpBB/docs/AUTHORS index 24072f19b6..a9f7a89f1f 100644 --- a/phpBB/docs/AUTHORS +++ b/phpBB/docs/AUTHORS @@ -14,13 +14,13 @@ phpBB Project Manager : theFinn (James Atkinson) phpBB Lead Developers : Acyd Burn (Meik Sievertsen) psoTFX (Paul S. Owen) [2001 - 09/2005] -phpBB Developers : Ashe (Ludovic Arnaud) - [10/2002 - 11/2003, 06/2006 - ] - DavidMJ (David M.) +phpBB Developers : DavidMJ (David M.) GrahamJE (Graham Eames) naderman (Nils Adermann) subBlue (Tom Beddard) BartVB (Bart van Bragt) - [11/2000 - 03/2006] + Ashe (Ludovic Arnaud) - [10/2002 - 11/2003, 06/2006 - 10/2006] Original subSilver by subBlue Design, Tom Beddard, (c) 2001 phpBB Group diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html new file mode 100644 index 0000000000..28e8cd63db --- /dev/null +++ b/phpBB/docs/CHANGELOG.html @@ -0,0 +1,215 @@ + + + + +phpBB 3.0.x Changelog + + + + + + + + + + + + + + + + + +
+ + + +

This is a non-exhaustive (but still near complete) changelog for phpBB 3.0.x including release candidate versions. Our thanks to all those people who've contributed bug reports and code fixes.

+ +

Changelog

+ + + +
+ +

1. Changelog

+ + 1.i. Changes since 3.0.RC1 +

+
+ + + +
+ Top +

+ +
+ +

2. Copyright and disclaimer

+ +
+ +

This application is opensource software released under the GPL. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) 2007 phpBB Group, All Rights Reserved.

+ +
+Top + + + +
+ +

+ + + + + diff --git a/phpBB/docs/FAQ.html b/phpBB/docs/FAQ.html new file mode 100644 index 0000000000..6a010dc5ec --- /dev/null +++ b/phpBB/docs/FAQ.html @@ -0,0 +1,380 @@ + + + + +phpBB 3.0.x FAQ + + + + + + + + + + + + + + + + + +
+ + + +

This is a very basic Frequently Asked Questions (FAQ) page which attempts to answer some of the more commonly asked questions. It is by no means exhaustive and should be used in combination with the 'built-in' User FAQ within phpBB3, the community forums and our IRC channel (see README for details).

+ +

FAQ

+ + + + +
+ +

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

+ +
+ +

Simple answer, no we will not. We are not being difficult when we say this we are actually trying to help you. phpBB has a reputation for being easy to install, that reputation is we believe well deserved. It is a simple process of unarchiving a single file, uploading the resulting directory/files to their intended location and entering some data in a web based form. The sequence of events, what to type where, etc. is covered in detail in the accompanying INSTALL.html documentation. If you cannot install phpBB3 the chances are you will be unable to administer or update it.

+ +

There are people, companies (unrelated to your hosting provider), etc. that will install your forum, either for free or for a payment. We do not recommend you make use of these offers. Unless the service is provided by your hosting company you will have to divulge passwords and other sensitive details. If you did not know how to use an ATM would you give a passer-by your bank card and PIN and ask them to show you what to do? No, probably not! The same applies to your hosting account details!

+ +

We think a better solution is for you to carefully read the enclosed documentation, read through our knowledge base at www.phpbb.com and if necessary ask for help on any thing you get stuck on. However, the decision is yours but please note we may not offer support if we believe you have had the board installed by a third party. In such cases you should direct your questions to that company or person/s.

+ +
+Top +

+ +
+ + +

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!

+

I want to sue you because i think you host an illegal board!

+ +
+ +

We provide the software, we have absolutely nothing to do with any board that runs it (beyond phpbb.com of course!) and we also do not host any site. The GPL grants the user an unlimited right of use subject to their adherence of that licence. Therefore we cannot prevent, dictate, control or otherwise limit the use of phpBB software. So please do not contact us for such matters.

+ +

If you have a problem with a given board please take it up with them, not us. We are not and cannot be held legally responsible for any third party use of this software (much like Microsoft et al cannot be held responsible for the use of Windows in illegal activities, etc.). Additionally we do not track the use of phpBB software in any way. So please do not ask us for details on a "given" board we will not be able to help you. If any law firms or lawyers out there send us writs, cease and desist orders, etc. for third party website use of this software we reserve the right to charge for time wasted dealing with such issues...

+ +
+Top +

+ +
+ +

According to viewonline a user is doing/reading something they should not be able to!

+ +
+ +

No, they probably are not. phpBB uses sessions to keep track of users as they move between pages. The session information tells us who this user is. Therefore in order to determine what a user can do on a page we first need the session details. Once this data is available we can check whether the user is permitted to do whatever it is they are trying to do. This can result in it appearing as if a user is reading a topic in a forum they should not be able to access. Or perhaps viewing private messages when they are only guests, etc. In practice the user is not doing these things, they are viewing a "You are not permitted to do this" type message. The session data has simply been updated before we were able to determine what the user could or could not do.

+ +

Of course this only applies where permissions have been set correctly!

+ +
+Top +

+ +
+ +

I keep getting Mail sending errors when I (or my users) post/send PM's/etc.!

+ +
+ +

This error will occur if phpBB cannot send mail. phpBB can send email two ways; using the PHP mail() function or directly via SMTP. Some hosting providers limit the mail() function to prevent its use in spamming, others may rename it or limit its functionality. If the mail() function got renamed, you are able to enter the correct name within the administration control panel. In either case you may need to make use of SMTP. This requires that you have access to such a facility, e.g. your hosting provider may provide one (perhaps requiring specific written authorisation), etc. Please see www.phpbb.com for additional help on this matter.

+ +

If you do require SMTP services please do not ask (on our forums or elsewhere) for someone to provide you with one. Open relays are now things of the past thanks to the unthinking spammers out there. Therefore you are unlikely to find someone willing to offer you (free) services.

+ +
+Top +

+ +
+ +

My users are complaining that emails are not in their selected language!

+ +
+ +

You must have deleted a language pack or the language pack is incomplete. phpBB will try to send emails in the users selected language. If it cannot find a suitable email template it will switch to the boards default language.

+ + + +
+Top +

+ +
+ +

My AOL based users keep getting logged out!

+ +
+ +

phpBB uses sessions to keep track of users as they browse the board. These sessions use a combination of a unique session id, the users IP and if specified the users browser and/or the users x-forwarded-for header to identify each user. We make use of all of this as an extra safe-guard to help prevent sessions being hijacked (by discovering the unique session id).

+ +

Unfortunately this only works when the users IP is constant as they browse the board. For most users this will be the case. However certain providers route their users via a cluster of proxys. In some cases, particularly the AOL browser, this results in different IPs being forwarded as the user moves between pages. We take account of this by not checking the entire IP by default but only the first "three quads" (A.B.C). Again in most cases this will be fine. However again AOL uses IPs which can vary so much that checking only the first two quads results in a fairly static IP being available for session validation.

+ +

If you are experiencing problems related to this you can set the Session IP validation parameter found in Admin->General->Server Configuration->Security Settings to A.B. Please note that reducing the IP validation length does potentially increase the risk of sessions being hijacked (this is something for you to consider, phpBB Group takes no responsibility should anything happen!). We suggest to at least additionally enable the browser validation.

+ +
+Top +

+ +
+ +

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

+ +
+ +

There are two possibilities here, the first is you have not created the directory you specified as the storage location for avatars, ie. as specified in the Admin -> General -> Board Configuration -> Avatar settings section. If the directory does not exist uploadeable avatars are automatically disabled. You should create the required directory (ensuring it has global write access or other appropriate permissions to allow the webserver to write files to it).

+ +

The second possibility is that your provider has disabled file_upload support. You should contact your provider and ask them if this is the case. There is not a lot you can do, there are still three other avatar settings left to choose from including uploading via an URL which will work fine.

+ +
+Top +

+ +
+ +

I just cannot get gallery avatars to appear!

+ +
+ +

phpBB categorises gallery avatars and it does this by reading through folders contained in the location you specified as being the gallery path. For example, if you set the gallery path to images/avatars/gallery phpBB will expect to find a series of folders within that path, eg. images/avatars/gallery/moviestars, images/avatars/gallery/cartoons, images/avatars/gallery/misc, etc. Placing images directly in images/avatars/gallery/ will result in nothing being listed in your gallery.

+ +
+Top +

+ +
+ +

How do I use/set permissions?

+ +
+ +

Please read our documentation about permissions.

+ +
+Top +

+ +
+ +

I (or my users) cannot stay logged in to the forum!

+ +
+ +

If you (or your users) are, after attempting a login, being returned to the index (or other page) without appearing to be logged in the most likely problem is incorrect cookie settings. phpBB uses cookies to store a session id and a small amount of user data. For this data to be stored correctly the cookie domain, name, path and secure settings must be correct. You can check this in Admin->General->Server Configuration->Cookie Settings. Typically the cookie domain can be left blank and the cookie path set to / (a single forward slash). Do not set the cookie as being secure unless your board is running over a secure sockets layer connection, ie. https://

+ +

If you still have problems try setting the cookie domain to your full domain name, eg. www.mysystem.tld, www.something.mydomain.tld. You must ensure the domain name contains at least two dots or browsers will be unlikely to recognise the cookie, eg. .mydomain.com, mydomain.com. Do not add http:// or anything else to the domain name!

+ +
+Top +

+ +
+ +

My users are complaining about being logged out too quickly!

+ +
+ +

You can increase the default length of sessions (ie. how long before a users session is considered 'dead') in Admin->General->Server Configuration->Load Settings. Set it to whatever value your users feel comfortable with, remember that security issues may affect your decision (ie. having too long a session may allow non-users to abuse your board should a user forget to logout or otherwise leave a current session on a public workstation).

+ +
+Top +

+ +
+ +

My question isn't answered here!

+ +
+ +

Please read our extensive user documentation first, it may just explain what you want to know.

+ +

Feel free to search our community forum for the information you require. PLEASE DO NOT post your question without having first used search, chances are someone has already asked and answered your question. You can find our board here:

+ +

www.phpbb.com

+ +
+Top +

+ +
+ +

Copyright and disclaimer

+ +
+ +

This application is opensource software released under the GPL. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) 2007 phpBB Group, All Rights Reserved.

+ +
+Top + + + +
+ + + + + diff --git a/phpBB/docs/INSTALL.html b/phpBB/docs/INSTALL.html new file mode 100644 index 0000000000..a1a38497e7 --- /dev/null +++ b/phpBB/docs/INSTALL.html @@ -0,0 +1,519 @@ + + + + +phpBB 3.0.x Install + + + + + + + + + + + + + + + + + +
+ + + +

Please read this document completely before proceeding with installation, updating or converting.

+ +

Please note these instructions are not fully comprehensive, a more thorough userguide will be available on the phpBB website in the near future. However, this document will walk you through the basics on installing, updating and converting the forum software.

+ +

A basic overview of running phpBB3 can be found in the accompanying README documentation. Please ensure you read that document in addition to this! For more detailed information on using phpBB3 you should read the documentation available online.

+ +

Install

+ + + +
+ +

1. Quick install

+ +
+

If you have basic knowledge of using FTP and are sure your hosting service or server will run phpBB3 you can use these steps to quickly get started. For a more detailed explanation you should skip this and go to section 2 below.

+ + + +

If you experienced problems or do not know how to proceed with any of the steps above please read the rest of this document.

+
+Top +

+ +
+ +

2. Requirements

+ +
+

phpBB3 has a few requirements which must be met before you are able to install and use it.

+ + + +

If your server or hosting account does not meet the requirements above we are afraid phpBB3 is not for you.

+
+Top +

+ +
+ +

3. New installation

+ +
+ +

Installation of phpBB3 will vary according to your server and database. If you have shell access to your account (via telnet or ssh for example) you may want to upload the entire phpBB3 archive (in binary mode!) to a directory on your host and unarchive it there.

+ +

If you do not have shell access or do not wish to use it you will need to decompress the phpBB3 archive to a local directory on your system using your favourite compression program, e.g. winzip, rar, zip, etc. From there you must FTP ALL the files it contains (being sure to retain the directory structure and filenames) to your host. Please ensure that the cases of filenames are retained, do NOT force filenames to all lower or upper case doing so will cause errors later.

+ +

All .php, .inc, .sql, .cfg, .html and .txt files should be uploaded in ASCII mode, while all graphics should be uploaded in BINARY mode. If you are unfamiliar with what this means please refer to your FTP client documentation. In most cases this is all handled transparantly by your ftp client but if you encounter problems later you should be sure the files where uploaded correctly as described here.

+ +

phpBB3 comes supplied with english as its standard language. However a number of seperate packs for different languages are available. If you are not a native english speaker you may wish to install one or more of these packages before continuing. The installation process below will allow you to select a default language from those available (you can of course change this default at a later stage). For more details of language packs, where to obtain them and how to install them please see the README.

+ +

Once all the files have been uploaded to your site you should point your browser at this location with the addition of install/. For example if your domain name is www.mydomain.tld and you placed phpBB3 in a directory /phpBB3 off your web root you would enter http://www.mydomain.tld/phpBB3/install/ or (alternatively) http://www.mydomain.tld/phpBB3/install/index.php into your browser. When you have done this you should see the phpBB3 Installation screen appear.

+ +

Introduction:

+ +

The installation screen gives you a short introduction into phpBB. It allows you to read the license phpBB3 is released under (General Public License) and provides information about how you can receive support. To start the installation, use the Install button.

+ +

Requirements

+ +

The first page you will see after starting the installation is the Requirements list. phpBB3 checks automatically whether everything that it needs to run properly is installed on your server. You need to have at least the minimum PHP version installed, and at least one database available to continue the installation. Also important, is that all shown folders are available and do have the correct permissions. Please see the description of each section to find out whether they are optional or required for phpBB3 to run. If everything is in order, you can continue the installation with Start Install.

+ +

Database settings

+ +

You now have to decide which database to use. See the Requirements section for information on which databases are supported. If you do not know your database settings, please contact your host and ask for them. You will not be able to continue without them. You need:

+ + + +
+

Note: if you are installing using SQLite, you should enter the full path to your database file in the DSN field and leave the username and password fields blank. For security reasons, you should make sure that the database file is not stored in a location accessible from the web.

+
+ +

You don't need to change the Prefix for tables in database setting, unless you plan on using multipe phpBB installations on one database. In this case you can use a different prefix for each installation to make it work.

+ +

After you entered your details, you can continue with the Proceed to next step button. Now phpBB3 will check whether the data you entered will lead to a successful database connection and whether tables with the same prefix already exist.

+ +

A Could not connect to the database error means that you didn't enter the database data correctly and it is not possible for phpBB to connect. Make sure that everything you entered is in order and try again. Again, if you are unsure about your database settings, please contact your host.

+ +

If you installed another version of phpBB before on the same database with the same prefix, phpBB will inform you and you just need to enter a different database prefix.

+ +

If you see the Successful Connection message, you can continue to the next step.

+ +

Administrator details

+ +

Now you have to create your administration user. This user will have full administration access and he will be the first user on your forum. All fields on this page are required. You can also set the default language of your forum on this page. In a vanilla phpBB3 installation we only include English [GB]. You can download further languages from www.phpbb.com, and add them before installing or later.

+ +

Configuration file

+ +

In this step, phpBB will try to write the configuration file automatically. The forum needs the configuration to run properly. It contains all database settings, so without it, phpBB will not be able to access the database.

+ +

Usually writing the configuration file automatically works fine. But in some cases it can fail due to wrong file permissions, for instance. In this case, you need to upload the file manually. phpBB asks you to download the config.php file and tells you what to do with it. Please read the instructions carefully. After you have uploaded the file, use Done to get to the last step. If Done returns you to the same page as before, and does not return a success message, you did not upload the file correctly.

+ +

Advanced settings

+ +

The Advanced settings allow you to set some parameters of the board configuration. They are optional, and you can always change them later. So if you are not sure what these settings mean, proceed to the final step and finish the installation.

+ +

If the installation was successful, you can now use the Login button to visit the Administration Control Panel. Congratulations, you have installed phpBB3 successfully. But there is still work ahead!

+ +

If you are unable to get phpBB3 installed even after reading this guide, please look at the support section to find out where you can ask for further assistance.

+ +

At this point if you are upgrading from phpBB 2.0.x, you should refer to the conversion steps for further information. If not, you should remove the install directory from your server as you will only be able to access the Administration Control Panel whilst it is present.

+ +
+Top +

+ +
+ +

4. Updating from stable releases of phpBB 3.0.x

+ +

If you are currently using a stable release of phpBB3 updating to this version is straightforward. You would have downloaded one of four packages and your choice determines what you need to do. Please Note: That before updating we heavily recommend you do a full backup of your database and existing phpBB3 files! If you are unsure how to achieve this please ask your hosting provider for advice.

+ +

Please make sure you update your phpBB3 source files too, even if you run the database_update.php file.

+ +4.i. Full package +

+
+ +

The full package is normally meant for new installations, but if you want to replace all source files this package comes in handy.

+ +

First you should make a copy of your existing config.php file, keep it in a safe place! Next delete all the existing phpBB3 files, you may want to leave your files/ and images/ directory in place. You can leave alternative styles in-place too. With this complete you can upload the new phpBB3 files (see New installation for details if necessary). Once complete copy back your saved config.php, replacing the new one. Another method is to just replace the existing files with the files from the full package - though make sure you do not overwrite your config.php file.

+ +

You should now run install/database_update.php which, depending on your previous version, will make a number of database changes. You may receive FAILURES during this procedure, they should not be a cause for concern unless you see an actual ERROR, in which case the script will stop (in this case you should seek help via our forums or bug tracker).

+ +

Once the install/database_update.php has completed you may proceed to the Administration Control Panel and check remove the install directory as advised.

+
+Top +

+ +4.ii. Changed files only +

+
+ +

This package contains a number of archives, each contains the files changed from a given release to the latest version. You should select the appropriate archive for your current version, e.g. if you currently have 3.0.0 you should select the phpBB-3.0.0_to_3.0.1.zip/tar.gz file.

+ +

The directory structure has been preserved enabling you (if you wish) to simply upload the contents of the archive to the appropriate location on your server, i.e. simply overwrite the existing files with the new versions. Do not forget that if you have installed any Mods these files will overwrite the originals possibly destroying them in the process. You will need to re-add Mods to any affected file before uploading.

+ +

As for the other update procedures you should run install/database_update.php after you have finished updating the files. This will update your database schema and increment the version number.

+
+Top +

+ +4.iii. Patch file +

+ +
+ +

The patch file is probably the best solution for those with many Mods or other changes who do not want to re-add them back to all the changed files. To use this you will need command line access to a standard UNIX type patch application. If you do not have access to such an application but still want to use this update approach we recommend the Automatic update package explained below.

+ +

A number of patch files are provided to allow you to update from previous stable releases. Select the correct patch, e.g. if your current version is 3.0.0 you need the phpBB-3.0.0_to_3.0.1.patch file. Place the correct patch in the parent directory containing the phpBB3 core files (i.e. index.php, viewforum.php, etc.). With this done you should run the following command: patch -cl -d [PHPBB DIRECTORY] -p1 < [PATCH NAME] (where PHPBB DIRECTORY is the directory name your phpBB Installation resides in, for example phpBB3, and where PATCH NAME is the relevant filename of the selected patch file). This should complete quickly, hopefully without any HUNK FAILED comments.

+ +

If you do get failures you should look at using the Changed files only package to replace the files which failed to patch, please note that you will need to manually re-add any Mods to these particular files. Alternatively if you know how you can examine the .rej files to determine what failed where and make manual adjustments to the relevant source.

+ +

You should of course delete the patch file (or files) after use. As for the other update procedures you should run install/database_update.php after you have finished updating the files. This will update your database schema and data (if appropriate) and increment the version number.

+
+Top +

+ +4.iv. Automatic update package +

+ +
+ +

The automatic update package is holding - contrary to the others - only the update informations for updating the last released version to the latest available version. These package is meant for use with the automatic update tool.

+ +

To perform the update, either follow the instructions from the Administration Control Panel -> System Tab - this should point out that you are running an outdated version and will guide you through the update - or following the instructions listed below.

+ + + +
+Top +

+ +4.v. All package types +

+ +
+ +

If you have non-English language packs installed you may want to see if a new version has been made available. A number of missing strings may have been added which, though not essential, may be beneficial to users. Please note that at this time not all language packs have been updated so you should be prepared to periodically check for updates.

+ +
+Top +

+ +
+ +

5. Conversion from phpBB 2.0.x to phpBB 3.0.x

+ +

This paragraph explains the steps necessary to convert your existing phpBB2 installation to phpBB3.

+ +5.i. Requirements before converting +

+ +
+

Before converting we heavily recommend you do a full backup of your database and files! If you are unsure how to achieve this please ask your hosting provider for advice. In order to convert, you need to have a new phpBB3 installation within the same database (but with a different prefix) as your old 2.0.x installation. You basically need to follow the basic instructions given for New installations. Please do not overwrite any old files - install phpBB3 at a different location.

+ +

Once you made a backup of everything and also have a brand new phpBB3 installation, you can now begin the conversion.

+
+Top +

+ +5.ii. Converting +

+ +
+ +

To begin the conversion visit the install folder of your phpBB3 installation (the same as you have done for installing). Now you will see a new tab Convert. Click this tab.

+ +

As with install the conversion is automated. Your previous 2.0.x database tables will not be touched as well as the original 2.0.x files remaining untouched. The conversion is actually only filling your phpBB3 database tables and copying additional data over to your phpBB3 installation. This has the benefit that if something goes wrong you are able to either re-run the conversion or continue a conversion, while your old board is still accessible. We really recommend you disable your old installation while converting, else you may have inconsistent data after the conversion.

+ +

Please note that this conversion process may take quite some time and depending on your hosting provider this may result in it failing (due to web server or other timeout issues). If this is the case you should ask your provider if they are willing to allow the convert script to temporarily exceed their limits (be nice and they will probably be quite helpful).

+ +

Once completed your board should be immediately available. If you encountered errors you should report the problems to our bug tracker or seek help via our forums (see README for details).

+
+Top +

+ +5.iii. Things to do after conversion +

+ +
+ +

After successful conversion there may be a few items you need to do - apart from checking if the installation is accessible and everything displayed correctly.

+ +

The first thing you may want to do is going to the administration control panel and checking every configuration item within the general tab. Thereafter you may want to adjust the forum descriptions/names if you entered HTML there. You also may want to access the other administrative sections, e.g. adjusting permissions, smilies, icons, ranks, etc.

+ +

Within the conversion the search index has not been created or transferred. This means after conversion you are not able to find any matches if you want to search for something. We recommend you rebuild your search index within Admin -> Maintenance -> Database -> Search Index.

+ +

Once you are pleased with your new installation you may want to give it the name of your old installation, changing the directory name. With phpBB3 this is possible without any problems - but you may still want to check your cookie settings within the administration panel, if the cookie path need to be adjusted prior to renaming.

+ +
+Top +

+ +
+ +

6. Important (security related) post-Install tasks for all installation methods

+ +
+ +

Once you have succssfully installed phpBB3 you MUST ensure you remove the entire install/ directory. Leaving the install directory in place is a very serious potential security issue which may lead to deletion or alteration of files, etc. Please note that until this directory is not removed phpBB3 will not operate and a warning message will be displayed. Beyond this essential deletion you may also wish to delete the docs/ directories if you wish.

+ +

With these directories deleted you should proceed to the administration panel. Depending on how the installation completed you may have been directed there automatically. If not, login as the administrator you specified during install/conversion and click the Administration Panel link at the bottom of any page. Ensure that details specified in Admin -> General are correct!

+
+Top +

+ +6.i. Uploadable avatars +

+
+ +

phpBB3 supports several methods for allowing users to select their own avatar (an avatar is a small image generally unique to a user and displayed just below their username in posts).

+ +

Two of these options allow users to upload an avatar from their machine or a remote location (via a URL). If you wish to enable this function you should first ensure the correct paths for uploadeable avatars is set in Admin -> General -> Board Configuration -> Avatar settings. By default this is images/avatars/uploads but you can set it to whatever you like, just ensure the configuration setting is updated. You must also ensure this directory can be written to by the webserver. Usually this means you have to alter its permissions to allow anyone to read and write to. Exactly how you should do this depends on your ftp client or server operating system.

+ +

On UNIX systems for example you set the directory to a+rwx (or ugo+rwx or even 777). This can be done from a command line on your server using chmod or via your FTP client (using the Change Permissions, chmod or other Permissions dialoge box, see your FTP clients documentation for help). Most FTP clients list permissions in the form of User (Read, Write, Execute), Group (Read, Write, Execute) and Other (Read, Write, Execute). You need to tick all of these boxes to set correct permissions.

+ +

On Windows system you need to ensure the directory is not write-protected and that it has global write permissions (see your servers documentation or contact your hosting provider if you are unsure on how to achieve this).

+ +

Please be aware that setting a directories permissions to global write access is a potential security issue. While it is unlikely that anything nasty will occur (such as all the avatars being deleted) there are always people out there to cause trouble. Therefore you should monitor this directory and if possible make regular backups.

+
+ +Top +

+ +
+ +

7. Copyright and disclaimer

+ +
+ +

This application is opensource software released under the GPL. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) 2007 phpBB Group, All Rights Reserved.

+ +
+Top + + + +
+ + + + + diff --git a/phpBB/docs/README.html b/phpBB/docs/README.html new file mode 100644 index 0000000000..ac455be387 --- /dev/null +++ b/phpBB/docs/README.html @@ -0,0 +1,432 @@ + + + + +phpBB 3.0.x Readme + + + + + + + + + + + + + + + + + +
+ + + +

Thank you for downloading phpBB3. This README will guide through the basics of installation and operation of phpBB3. Please ensure you read this and the accompanying documentation fully before proceeding with the installation.

+ +

Readme

+ + + +
+ +

1. Installing phpBB3

+ +
+ +

Installation and update/conversion instructions can be found in the INSTALL document contained in this distribution. If you are intending to convert from a previous phpBB 2.0.x installation we highly recommend you backup any existing data before proceeding!

+ +

Users of phpBB3 Beta versions cannot directly update or convert.

+ +
+Top +

+ +
+ +

2. Running phpBB3

+ +

Once installed phpBB is easily managed by both admin and moderator control panels. If you need help or advice with phpBB please see Section 3 below.

+ + 2.i. Internationalisation (i18n) +

+
+ +

A number of language packs and style localisations are available. You can find them on our official download page:

+ +

http://www.phpbb.com/downloads/

+ +

This is the official location for all supported language sets. If you download a package from a 3rd party site you do so with the understanding that we cannot offer support. So please, do not ask for help in these cases!

+ +

Installation of these packages is straightforward, simply download the required language pack and unarchive it into the languages/ folder. Please ensure you retain the directory structure when doing this! Once uploaded go to the Admin->System->Language Packs and install the now appeared new language pack. To install the style image packs you should unarchive the file/s into the styles/subSilver/imageset directory, again you must retain the directory structure. Once installed the languages will become immediately available.

+ +

If your language is not available please visit our forums where you will find a topic listing translations currently available or in preparation. This topic also gives you information should you wish to volunteer to translate a language not currently listed

+ +
+ Top +

+ + 2.ii. Styles +

+
+ +

Although phpBB Group are rather proud of the included styles we realise that it may not be to everyones tastes. Therefore phpBB3 allows styles to be switched with relative ease. Firstly you need to locate and download a style you like. We maintain such a site at

+ +

http://www.phpbb.com/styles/

+ +

Please note that 3rd party styles downloaded for versions of phpBB2 will not work in phpBB3.

+ +

Once you have downloaded a style the usual next step is to unarchive (or upload the unarchived contents of) the package into your styles/ directory. You then need to visit Administration -> Styles, you should see the new style available, click install and it will become available for all your users.

+ +
+ Top +

+ + 2.iii. Mods +

+
+ +

Although not officially supported by phpBB Group, phpBB has a thriving modification scene. These third party modifications to the standard phpBB extend its capabilities still further and can be found at:

+ +

http://www.phpbb.com/mods

+ +

Please remember that any bugs or other issues that occur after you have added any modification should NOT be reported to the bug tracker (see below). First remove the modification and see if the problem is resolved.

+ +

Also remember that any modifications which modify the database in any way may render upgrading your forum to future versions more difficult unless we state otherwise. With all this said many users have and continue to utilise many of the mods already available with great success

+ +
+ Top +

+ +
+ +

3. Getting help with phpBB3

+ +

phpBB 2 can seem a little daunting to new users in places, particularly with regard the permission system. The first thing you should do is check the FAQ which covers a few basic getting started questions. If you need additional help there are several places you should look.

+ + 3.i. phpBB3 Userguide +

+
+ +

A comprehensive userguide is now available online and can be accessed from the following location:

+ +

http://www.phpbb.com/support/documentation/

+ +

This covers everything from installation through setting permissions and managing users.

+ +
+ Top +

+ + 3.ii. Community Forums +

+ +
+ +

phpBB Group maintains a thriving community where a number of people have generously decided to donate their time to help support users. This site can be found at:

+ +

http://www.phpbb.com/

+ +

If you do seek help via our forums please be sure to do a Search before posting. This may well save both you and us time and allow the developer, moderator and support groups to spend more time responding to people with unknown issues and problems. Please also remember that phpBB is an entirely volunteer effort, no one receives any compensation for the time they give, this includes moderators as well as developers. So please be respectful and mindful when awaiting responses.

+ +
+ Top +

+ + 3.iii Internet Relay Chat +

+
+ +

Another place you may find help is our IRC channel. This operates on the Freenode IRC network, irc.freenode.net and the channel is #phpbb and can be accessed by any good IRC client such as mIRC, XChat, etc. Again, please do not abuse this service and be respectful of other users.

+ +
+ Top +

+ +
+ +

4. Status of this version

+ +
+

This is the third stable release of phpBB. The 3.0.x line is essentially feature frozen, point releases will see only bugs and such like fixed, though feature alterations and minor feature additions may be done. Our next major release will be phpBB 3.2 and the planning phase has begun (the unstable development version is 3.1). Please do not post questions asking when 3.2 will be available, no release date has been set.

+ +

For those interested in the development of phpBB should keep an eye on the community forums to see how things are progressing:

+ +

http://area51.phpbb.com/phpBB/

+ +

Please note that this forum should NOT be used to obtain support for or ask questions about phpBB 2.0.x or phpBB 3.0.x, the main community forums are the place for this. Any such posts will be locked and go unanswered.

+
+Top +

+ +
+ +

5. Reporting Bugs

+ +
+

The phpBB Group uses a bug tracking system to store, list and manage all reported bugs, it can be found at the location listed below. Please DO NOT post bug reports to our forums, they will be locked. In addition please DO NOT use the bug tracker for support requests. Posting such a request will only see you directed to the support forums (while taking time away from working on real bugs).

+ +

http://www.phpbb.com/bugs/

+ +

While we very much appreciate receiving bug reports (the more reports the more stable phpBB will be) we ask you carry out a few steps before adding new entries:

+ + + +

If you do post a new bug (i.e. one that isn't already listed in the bug tracker) firstly make sure you have logged in (your username and password are the same as for the community forums) then please include the following details:

+ + + +

The relevant database type/version is listed within the administration control panel

+ +

Please also be as detailed as you can in your report, if possible list the steps required to duplicate the problem. If you have a fix which you are VERY SURE works (and is consistent with our coding guidelines) and does not introduce further problems or incompatibilities please let us know. However only include it in the bug report if you really must, if we need it we'll ask you for it.

+ +

Once a bug has been submitted you will be emailed any follow up comments added to it. Please if you are requested to supply additional information, do so! It is frustrating for us to receive bug reports, ask for additional information but get nothing. In these cases we have a policy of closing the bug, which may leave a very real problem in place. Obviously we would rather not have this situation arise.

+ +
+Top +

+ +5.i. Security related bugs +

+
+

If you find a potential security related vulnerability in phpBB please DO NOT post it to the bug tracker, public forums, etc.! Doing so may allow unscrupulous users to take advantage of it before we have time to put a fix in place. All security related bugs should be sent to our security tracker:

+ +

http://www.phpbb.com/security/

+ +
+Top +

+ +
+ +

6. Overview of current bug list

+ +
+

This list is not complete but does represent those bugs which may effect users on a wider scale. Other bugs listed in the tracker have typically been shown to be limited to certain setups or methods of installation/upgrade.

+ + + +
+Top +

+ +
+ +

7. PHP compatibility issues

+ +
+

phpBB is no longer supported on PHP3 due to several compatibility issues and we recommend that you upgrade to the latest stable release of PHP5 to run phpBB. The minimum version required is PHP 4.3.3.

+ +

Please remember that running any application on a developmental version of PHP can lead to strange/unexpected results which may appear to be bugs in the application (which may not be true). Therefore we recommend you upgrade to the newest stable version of PHP before running phpBB3. If you are running a developmental version of PHP please check any bugs you find on a system running a stable release before submitting.

+ +

This board has been developed and tested under Linux and Windows (amongst others) running Apache using MySQL 3.23, 4.x, 5.x, MSSQL Server 2000, PostgreSQL 7.x, Oracle 8, SQLite and Firebird. Versions of PHP used range from 4.3.3 to 6.0.0-dev without problem.

+
+Top +

+ +7.i. Notice on PHP security issues + +

+
+

Currently there are no known issues regarding PHP security.

+
+Top +

+ +
+ +

8. Copyright and disclaimer

+ +
+ +

This application is opensource software released under the GPL. Please see source code and the docs directory for more details. This package and its contents are Copyright (c) 2007 phpBB Group, All Rights Reserved.

+ +
+Top + + + +
+ + + + + diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html index 69e51a1059..33b2bb6b8d 100644 --- a/phpBB/docs/coding-guidelines.html +++ b/phpBB/docs/coding-guidelines.html @@ -16,17 +16,13 @@ - -
+ +

These are the phpBB Coding Guidelines for Olympus, all attempts should be made to follow it as closely as possible.
This document is (c) 2006 phpBB Group, copying or redistribution is not allowed without permission.

Coding Guidelines

@@ -1554,6 +1535,8 @@ div
Top + + Top diff --git a/phpBB/docs/README.html b/phpBB/docs/README.html index ac455be387..196a0f2de4 100644 --- a/phpBB/docs/README.html +++ b/phpBB/docs/README.html @@ -258,7 +258,7 @@ p a {

Please remember that any bugs or other issues that occur after you have added any modification should NOT be reported to the bug tracker (see below). First remove the modification and see if the problem is resolved.

-

Also remember that any modifications which modify the database in any way may render upgrading your forum to future versions more difficult unless we state otherwise. With all this said many users have and continue to utilise many of the mods already available with great success

+

Also remember that any modifications which modify the database in any way may render upgrading your forum to future versions more difficult unless we state otherwise. With all this said many users have and continue to utilise many of the mods already available with great success.

Top @@ -268,7 +268,7 @@ p a {

3. Getting help with phpBB3

-

phpBB 2 can seem a little daunting to new users in places, particularly with regard the permission system. The first thing you should do is check the FAQ which covers a few basic getting started questions. If you need additional help there are several places you should look.

+

phpBB3 can seem a little daunting to new users in places, particularly with regard the permission system. The first thing you should do is check the FAQ which covers a few basic getting started questions. If you need additional help there are several places you should look.

3.i. phpBB3 Userguide

diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index 0895e1b1fc..342d0bd2ef 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -444,7 +444,7 @@ function import_avatar_gallery($gallery_name = '', $subdirs_as_galleries = false { while ($entry = readdir($handle)) { - if ($entry[0] == '.') + if ($entry[0] == '.' || $entry == 'CVS' || $entry == 'index.htm') { continue; } @@ -460,7 +460,7 @@ function import_avatar_gallery($gallery_name = '', $subdirs_as_galleries = false { while ($entry = $dir->read()) { - if (substr($entry, 0, 1) == '.') + if ($entry[0] == '.' || $entry == 'CVS' || $entry == 'index.htm') { continue; } @@ -2173,7 +2173,7 @@ function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_ { while ($entry = readdir($handle)) { - if ($entry[0] == '.') + if ($entry[0] == '.' || $entry == 'CVS' || $entry == 'index.htm') { continue; } @@ -2193,7 +2193,7 @@ function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_ { while ($entry = $dir->read()) { - if (substr($entry, 0, 1) == '.') + if ($entry[0] == '.' || $entry == 'CVS' || $entry == 'index.htm') { continue; } diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index 80143f18f8..f7a593232a 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -142,12 +142,19 @@ $test_file = 'modcp.php'; if (!$get_info) { // Test to see if the birthday MOD is installed on the source forum - // @todo Check the relevant MODs - I believe there are 2 that add this, but am not sure if their data is compatible or not + // Nils' birthday mod if (get_config_value('birthday_required') !== false) { define('MOD_BIRTHDAY', true); } + // TerraFrost's validated birthday mod + if (get_config_value('bday_required') !== false) + { + define('MOD_BIRTHDAY', true); + define('MOD_BIRTHDAY_TERRA', true); + } + // Test to see if the attachment MOD is installed on the source forum // If it is, we will convert this data as well $db->sql_return_on_error(true); diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index 8f00067cf6..bb9b1313a0 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -96,6 +96,56 @@ function phpbb_insert_forums() } $db->sql_freeresult($result); + // There may be installations having forums with non-existant category ids. + // We try to catch them and add them to an "unknown" category instead of leaving them out. + $sql = 'SELECT cat_id + FROM ' . $convert->src_table_prefix . 'forums + GROUP BY cat_id'; + $result = $db->sql_query($sql); + + $unknown_cat_id = false; + while ($row = $db->sql_fetchrow($result)) + { + // Catch those categories not been added before + if (!isset($cats_added[$row['cat_id']])) + { + $unknown_cat_id = true; + } + } + $db->sql_freeresult($result); + + // Is there at least one category not known? + if ($unknown_cat_id === true) + { + $unknown_cat_id = 'ghost'; + + $sql_ary = array( + 'forum_id' => $max_forum_id, + 'forum_name' => $user->lang['CATEGORY'], + 'parent_id' => 0, + 'forum_parents' => '', + 'forum_desc' => '', + 'forum_type' => FORUM_CAT, + 'forum_status' => ITEM_UNLOCKED, + 'forum_rules' => '', + ); + + $sql = 'SELECT MAX(right_id) AS right_id + FROM ' . FORUMS_TABLE; + $_result = $db->sql_query($sql); + $cat_row = $db->sql_fetchrow($_result); + $db->sql_freeresult($_result); + + $sql_ary['left_id'] = $cat_row['right_id'] + 1; + $sql_ary['right_id'] = $cat_row['right_id'] + 2; + + $sql = 'INSERT INTO ' . FORUMS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); + $db->sql_query($sql); + + $cats_added[$unknown_cat_id] = $max_forum_id; + $max_forum_id++; + } + // Now insert the forums $sql = 'SELECT f.*, fp.prune_days, fp.prune_freq FROM ' . $convert->src_table_prefix . 'forums f LEFT JOIN ' . $convert->src_table_prefix . 'forum_prune fp ON f.forum_id = fp.forum_id @@ -105,6 +155,18 @@ function phpbb_insert_forums() while ($row = $db->sql_fetchrow($result)) { + // Some might have forums here with an id not being "possible"... + // To be somewhat friendly we "change" the category id for those to a previously created ghost category + if (!isset($cats_added[$row['cat_id']]) && $unknown_cat_id !== false) + { + $row['cat_id'] = $unknown_cat_id; + } + + if (!isset($cats_added[$row['cat_id']])) + { + continue; + } + // Define the new forums sql ary $sql_ary = array( 'forum_id' => (int) $row['forum_id'], @@ -179,40 +241,56 @@ function phpbb_insert_forums() function phpbb_set_encoding($text) { - global $lang_enc_array, $config; + global $lang_enc_array; - if (!isset($lang_enc_array[$config['default_lang']])) + $default_lang = trim(get_config_value('default_lang')); + + if (!isset($lang_enc_array[$default_lang])) { global $phpEx, $convert; - include($convert->convertor_status['forum_path'] . '/language/lang_' . $config['default_lang'] . '/lang_main.' . $phpEx); - $lang_enc_array[$config['default_lang']] = $lang['ENCODING']; + include($convert->convertor_status['forum_path'] . '/language/lang_' . $default_lang . '/lang_main.' . $phpEx); + $lang_enc_array[$default_lang] = $lang['ENCODING']; unset($lang); } - return utf8_recode($text, $lang_enc_array[$user_lang]); + return utf8_recode($text, $lang_enc_array[$default_lang]); } /** * Convert Birthday from Birthday MOD to phpBB Format -* @todo See which birthday MOD's this supports - there appear to be several */ function phpbb_get_birthday($birthday = '') { $birthday = (int) $birthday; - if (!$birthday || $birthday == 999999) + if (defined('MOD_BIRTHDAY_TERRA')) { - return ' 0- 0- 0'; + // stored as month, day, year + if (!$birthday) + { + return ' 0- 0- 0'; + } + + $birthday = (string) $birthday; + + $month = substr($birthday, 0, 2); + $day = substr($birthday, 2, 2); + $year = substr($birthday, -4); + + return sprintf('%02d-%02d-%04d', $day, $month, $year); } + else + { + if (!$birthday || $birthday == 999999 || $birthday < 0) + { + return ' 0- 0- 0'; + } - // @todo Can't this be done with one call to create_date? - $bday_day = create_date('j', $birthday * 86400 + 1, 0); - $bday_month = create_date('n', $birthday * 86400 + 1, 0); - $bday_year = create_date('Y', $birthday * 86400 + 1, 0); - - return sprintf('%2d-%2d-%4d', $bday_day, $bday_month, $bday_year); + // The birthday mod from niels is using this code to transform to day/month/year + return gmdate('d-m-Y', $birthday * 86400 + 1); + } } /** @@ -718,13 +796,16 @@ function phpbb_convert_authentication($mode) } } - // Now make sure the user is able to read these forums - $hold_ary = $auth->acl_group_raw_data(get_group_id('guests'), 'f_list', $forum_ids); - - if (!empty($hold_ary)) + if (sizeof($forum_ids)) { - mass_auth('group', $row['forum_id'], 'guests', 'f_list', ACL_YES); - mass_auth('group', $row['forum_id'], 'registered', 'f_list', ACL_YES); + // Now make sure the user is able to read these forums + $hold_ary = $auth->acl_group_raw_data(get_group_id('guests'), 'f_list', $forum_ids); + + if (!empty($hold_ary)) + { + mass_auth('group', $row['forum_id'], 'guests', 'f_list', ACL_YES); + mass_auth('group', $row['forum_id'], 'registered', 'f_list', ACL_YES); + } } } } @@ -897,7 +978,7 @@ function phpbb_prepare_message($message) FROM ' . $convert->src_table_prefix . 'users WHERE user_id = ' . (int) $user_id; $result = $db->sql_query($sql); - $user_lang = $db->sql_fetchfield('user_lang'); + $user_lang = (string) $db->sql_fetchfield('user_lang'); $db->sql_freeresult($result); if (empty($lang_enc_array)) @@ -905,13 +986,15 @@ function phpbb_prepare_message($message) $lang_enc_array = array(); } + $user_lang = (!trim($user_lang)) ? trim(get_config_value('default_lang')) : trim($user_lang); + if (!isset($lang_enc_array[$user_lang])) { $filename = $convert->convertor_status['forum_path'] . '/language/lang_' . $user_lang . '/lang_main.' . $phpEx; if (!file_exists($filename)) { - $user_lang = $config['default_lang']; + $user_lang = trim(get_config_value('default_lang')); } if (!isset($lang_enc_array[$user_lang])) @@ -1243,7 +1326,12 @@ function phpbb_import_attach_config() $db->sql_freeresult($result); set_config('allow_attachments', 1); - set_config('display_order', $attach_config['display_order']); + + // old attachment mod? Must be very old if this entry do not exist... + if (!empty($attach_config['display_order'])) + { + set_config('display_order', $attach_config['display_order']); + } set_config('max_filesize', $attach_config['max_filesize']); set_config('max_filesize_pm', $attach_config['max_filesize_pm']); set_config('attachment_quota', $attach_config['attachment_quota']); diff --git a/phpBB/styles/subSilver/template/memberlist_leaders.html b/phpBB/styles/subSilver/template/memberlist_leaders.html index 42f0fa1305..6b7d1726cd 100644 --- a/phpBB/styles/subSilver/template/memberlist_leaders.html +++ b/phpBB/styles/subSilver/template/memberlist_leaders.html @@ -20,7 +20,7 @@
- + @@ -24,7 +24,7 @@ -
- {L_LOGIN_LOGOUT} {L_LOGIN_LOGOUT}  -  {L_RESTORE_PERMISSIONS} {L_RESTORE_PERMISSIONS} + * {L_LOGIN_LOGOUT}  +  * {L_RESTORE_PERMISSIONS}  {L_BOARD_DISABLED} -  {L_PRIVATE_MESSAGES} {PRIVATE_MESSAGE_INFO}, {PRIVATE_MESSAGE_INFO_UNREAD} -  {L_REGISTER} {L_REGISTER} +  * {PRIVATE_MESSAGE_INFO}, {PRIVATE_MESSAGE_INFO_UNREAD} +  * {L_REGISTER} - {L_FAQ} {L_FAQ} -    {L_SEARCH} {L_SEARCH} + * {L_FAQ} +    * {L_SEARCH} -    {L_MEMBERLIST} {L_MEMBERLIST} -    {L_PROFILE} {L_PROFILE} +    * {L_MEMBERLIST} +    * {L_PROFILE}
{searchresults.L_IGNORE_POST}

 {L_FORUM}: {searchresults.FORUM_TITLE}{L_GLOBAL}   {L_TOPIC}: {searchresults.TOPIC_TITLE}

 {L_FORUM}: {searchresults.FORUM_TITLE}{L_GLOBAL}   {L_TOPIC}: {searchresults.TOPIC_TITLE}

- +
 {L_POST_SUBJECT}: {searchresults.POST_SUBJECT}
{searchresults.MINI_POST_IMG}{L_POSTED}: {searchresults.POST_DATE} 
+
+ +  {L_POST_SUBJECT}: {searchresults.POST_SUBJECT} + + [ {L_JUMP_TO_POST} ] + +
+
{L_POSTED}: {searchresults.POST_DATE} 
+
    - style="color:#{admin.GROUP_COLOR}" href="{admin.U_GROUP}">{admin.GROUP_NAME} + style="font-weight: bold; color:#{admin.GROUP_COLOR}" href="{admin.U_GROUP}">{admin.GROUP_NAME} {admin.GROUP_NAME} @@ -43,7 +43,7 @@ {L_ALL_FORUMS}    - style="color:#{mod.GROUP_COLOR}" href="{mod.U_GROUP}">{mod.GROUP_NAME} + style="font-weight: bold; color:#{mod.GROUP_COLOR}" href="{mod.U_GROUP}">{mod.GROUP_NAME} {mod.GROUP_NAME} diff --git a/phpBB/ucp.php b/phpBB/ucp.php index 4568592081..db521af675 100755 --- a/phpBB/ucp.php +++ b/phpBB/ucp.php @@ -139,7 +139,9 @@ switch ($mode) foreach ($_COOKIE as $cookie_name => $cookie_data) { $cookie_name = str_replace($config['cookie_name'] . '_', '', $cookie_name); - if (strpos($cookie_name, '_poll') === false) + + // Polls are stored as {cookie_name}_poll_{topic_id}, cookie_name_ got removed, therefore checking for poll_ + if (strpos($cookie_name, 'poll_') !== 0) { $user->set_cookie($cookie_name, '', $set_time); } From 8f0f2e1f0d71c9f71c823734200e490e69338869 Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 7 Jan 2007 14:24:01 +0000 Subject: [PATCH 167/264] #6828 git-svn-id: file:///svn/phpbb/trunk@6852 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/utf/data/recode_basic.php | 4 ++-- phpBB/includes/utf/utf_tools.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/utf/data/recode_basic.php b/phpBB/includes/utf/data/recode_basic.php index 1a9d7af745..8950b0550b 100644 --- a/phpBB/includes/utf/data/recode_basic.php +++ b/phpBB/includes/utf/data/recode_basic.php @@ -406,7 +406,7 @@ function iso_8859_7($string) return strtr($string, $transform); } -function iso_8895_9($string) +function iso_8859_9($string) { static $tranform = array( "\xC3\x90" => "\xC4\x9E", @@ -419,7 +419,7 @@ function iso_8895_9($string) return strtr(utf8_encode($string), $transform); } -function iso_8895_15($string) +function iso_8859_15($string) { static $tranform = array( "\xC2\xA4" => "\xE2\x82\xAC", diff --git a/phpBB/includes/utf/utf_tools.php b/phpBB/includes/utf/utf_tools.php index ec233cf986..3a95c5f35f 100644 --- a/phpBB/includes/utf/utf_tools.php +++ b/phpBB/includes/utf/utf_tools.php @@ -767,7 +767,7 @@ function utf8_recode($string, $encoding) case '7': case '9': case '15': - if (!function_exists('iso_8895_' . $array[1])) + if (!function_exists('iso_8859_' . $array[1])) { if (!file_exists($phpbb_root_path . 'includes/utf/data/recode_basic.' . $phpEx)) { @@ -775,7 +775,7 @@ function utf8_recode($string, $encoding) } include($phpbb_root_path . 'includes/utf/data/recode_basic.' . $phpEx); } - return call_user_func('iso_8895_' . $array[1], $string); + return call_user_func('iso_8859_' . $array[1], $string); break; default: From ec7936509ac13ff99ff1d43ce3850d7110313f74 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 7 Jan 2007 16:27:26 +0000 Subject: [PATCH 168/264] do not reset complete convert_row. :o git-svn-id: file:///svn/phpbb/trunk@6853 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/convertors/convert_phpbb20.php | 2 +- phpBB/install/convertors/functions_phpbb20.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index f7a593232a..28d255b210 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -142,7 +142,7 @@ $test_file = 'modcp.php'; if (!$get_info) { // Test to see if the birthday MOD is installed on the source forum - // Nils' birthday mod + // Niels' birthday mod if (get_config_value('birthday_required') !== false) { define('MOD_BIRTHDAY', true); diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index bb9b1313a0..5ee3c52473 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -957,7 +957,7 @@ function phpbb_prepare_message($message) if (!$message) { - $convert->row['mp_bbcode_bitfield'] = $convert_row = 0; + $convert->row['mp_bbcode_bitfield'] = $convert_row['mp_bbcode_bitfield'] = 0; return ''; } From 8f4c3a1feeb04cc5b5a613472e14be1b98bf493c Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 7 Jan 2007 17:25:47 +0000 Subject: [PATCH 169/264] some fixes... git-svn-id: file:///svn/phpbb/trunk@6854 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_convert.php | 29 +++++++++----------- phpBB/install/convertors/convert_phpbb20.php | 1 + phpBB/install/install_convert.php | 4 +-- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index 342d0bd2ef..6968950cea 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -1648,7 +1648,7 @@ function add_default_groups() */ function add_bots() { - global $db, $convert, $user; + global $db, $convert, $user, $config; $sql = 'SELECT group_id FROM ' . GROUPS_TABLE . " WHERE group_name = 'BOTS'"; $result = $db->sql_query($sql); @@ -1725,22 +1725,19 @@ function add_bots() foreach ($bots as $bot_name => $bot_ary) { - $sql = 'INSERT INTO ' . USERS_TABLE . ' ' . $db->sql_build_array('INSERT', array( - 'user_type' => GROUP_HIDDEN, - 'group_id' => $group_id, - 'username' => $bot_name, - 'username_clean' => utf8_clean_string($bot_name), - 'user_regdate' => time(), - 'user_permissions' => '', - 'user_sig' => '', - 'user_interests' => '', - 'user_password' => '', - 'user_lang' => 'en', - 'user_style' => 1, - 'user_rank' => 1, - 'user_colour' => '9E8DA7') + $user_row = array( + 'user_type' => USER_IGNORE, + 'group_id' => $group_id, + 'username' => $bot_name, + 'user_regdate' => time(), + 'user_password' => '', + 'user_colour' => '9E8DA7', + 'user_email' => '', + 'user_lang' => $config['default_lang'], + 'user_style' => 1, + 'user_timezone' => 0, + 'user_allow_massemail' => 0, ); - $db->sql_query($sql); $user_id = $db->sql_nextid(); diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index 28d255b210..a30930ed5b 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -813,6 +813,7 @@ if (!$get_info) array('user_icq', 'users.user_icq', ''), array('user_from', 'users.user_from', 'utf8_htmlspecialchars'), array('user_rank', 'users.user_rank', ''), + array('user_permissions', '', ''), array('user_avatar', 'users.user_avatar', 'phpbb_import_avatar'), array('user_avatar_type', 'users.user_avatar_type', 'phpbb_avatar_type'), diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index f9e2583294..61096f5b86 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -893,7 +893,7 @@ class install_convert extends module $template->assign_block_vars('checks', array( 'TITLE' => "skip_rows = $skip_rows", - 'RESULT' => $rows . ((defined('DEBUG_EXTRA')) ? ceil(memory_get_usage()/1024) . ' KB' : ''), + 'RESULT' => $rows . ((defined('DEBUG_EXTRA') && function_exists('memory_get_usage')) ? ceil(memory_get_usage()/1024) . ' KB' : ''), )); $mtime = explode(' ', microtime()); @@ -1125,7 +1125,7 @@ class install_convert extends module sync('topic', 'range', 'topic_id BETWEEN ' . $sync_batch . ' AND ' . $end, true, true); $template->assign_block_vars('checks', array( - 'TITLE' => sprintf($user->lang['SYNC_TOPIC_ID'], $sync_batch, ($sync_batch + $batch_size)) . ((defined('DEBUG_EXTRA')) ? ' [' . ceil(memory_get_usage()/1024) . ' KB]' : ''), + 'TITLE' => sprintf($user->lang['SYNC_TOPIC_ID'], $sync_batch, ($sync_batch + $batch_size)) . ((defined('DEBUG_EXTRA') && function_exists('memory_get_usage')) ? ' [' . ceil(memory_get_usage()/1024) . ' KB]' : ''), 'RESULT' => $user->lang['DONE'], )); From 29ef0fdb86b3a9fb544d0e2d55d1af74bd2dbec8 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 7 Jan 2007 17:38:51 +0000 Subject: [PATCH 170/264] erm... git-svn-id: file:///svn/phpbb/trunk@6855 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_convert.php | 30 ++++++++++++++++++---------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index 6968950cea..a356101e9a 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -1648,7 +1648,7 @@ function add_default_groups() */ function add_bots() { - global $db, $convert, $user, $config; + global $db, $convert, $user, $config, $phpbb_root_path, $phpEx; $sql = 'SELECT group_id FROM ' . GROUPS_TABLE . " WHERE group_name = 'BOTS'"; $result = $db->sql_query($sql); @@ -1723,6 +1723,11 @@ function add_bots() 'YahooSeeker [Bot]' => array('YahooSeeker/', ''), ); + if (!function_exists('user_add')) + { + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); + } + foreach ($bots as $bot_name => $bot_ary) { $user_row = array( @@ -1739,18 +1744,21 @@ function add_bots() 'user_allow_massemail' => 0, ); - $user_id = $db->sql_nextid(); + $user_id = user_add($user_row); - add_user_group($group_id, $user_id, false); + if ($user_id) + { + add_user_group($group_id, $user_id, false); - $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array( - 'bot_active' => 1, - 'bot_name' => $bot_name, - 'user_id' => $user_id, - 'bot_agent' => $bot_ary[0], - 'bot_ip' => $bot_ary[1]) - ); - $db->sql_query($sql); + $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array( + 'bot_active' => 1, + 'bot_name' => $bot_name, + 'user_id' => $user_id, + 'bot_agent' => $bot_ary[0], + 'bot_ip' => $bot_ary[1]) + ); + $db->sql_query($sql); + } } } From 5474f1a0aea96c98202a28e048c9d408ff9b1b63 Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 7 Jan 2007 17:45:19 +0000 Subject: [PATCH 171/264] #6836 git-svn-id: file:///svn/phpbb/trunk@6856 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/install_convert.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index 61096f5b86..6b53d18b74 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -877,6 +877,21 @@ class install_convert extends module $counting = -1; $batch_time = 0; + $mysql_convert = false; + + switch ($db->sql_layer) + { + // Thanks MySQL, for silently converting... + case 'mysql': + case 'mysql4': + case 'mysqli': + if (version_compare($db->mysql_version, '4.1.3', '>=')) + { + $mysql_convert = true; + } + break; + } + while (($counting === -1 || $counting >= $convert->batch_size) && still_on_time()) { $old_current_table = $current_table; @@ -899,9 +914,19 @@ class install_convert extends module $mtime = explode(' ', microtime()); $batch_time = $mtime[0] + $mtime[1]; + if ($mysql_convert) + { + $db->sql_query("SET NAMES 'latin1'"); + } + // Take skip rows into account and only fetch batch_size amount of rows $___result = $db->sql_query_limit($sql, $convert->batch_size, $skip_rows); + if ($mysql_convert) + { + $db->sql_query("SET NAMES 'utf8'"); + } + // This loop processes each row $counting = 0; From 0ac5a3bdbee285adcd4011d28f4a2872efdb1873 Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 7 Jan 2007 18:02:46 +0000 Subject: [PATCH 172/264] silly pants git-svn-id: file:///svn/phpbb/trunk@6857 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/install_convert.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index 6b53d18b74..6a6f63effb 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -916,7 +916,7 @@ class install_convert extends module if ($mysql_convert) { - $db->sql_query("SET NAMES 'latin1'"); + $db->sql_query("SET NAMES 'binary'"); } // Take skip rows into account and only fetch batch_size amount of rows From 6f20a8742505e04b4e35457e087ed4dbf4ef5b39 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 7 Jan 2007 18:53:15 +0000 Subject: [PATCH 173/264] ok, let's recode other text fields too... git-svn-id: file:///svn/phpbb/trunk@6858 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/convertors/convert_phpbb20.php | 59 +++--- .../install/convertors/functions_phpbb20.php | 191 ++++++++++-------- 2 files changed, 135 insertions(+), 115 deletions(-) diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index a30930ed5b..c506b46f8d 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -321,11 +321,11 @@ if (!$get_info) array('topic_id', 'posts.topic_id', ''), array('in_message', 0, ''), array('is_orphan', 0, ''), - array('poster_id', 'attachments.user_id_1', 'phpbb_user_id'), + array('poster_id', 'attachments.user_id_1 AS poster_id', 'phpbb_user_id'), array('physical_filename', 'attachments_desc.physical_filename', 'import_attachment'), array('real_filename', 'attachments_desc.real_filename', ''), array('download_count', 'attachments_desc.download_count', ''), - array('attach_comment', 'attachments_desc.comment', 'utf8_htmlspecialchars'), + array('attach_comment', 'attachments_desc.comment', array('function1' => 'phpbb_set_encoding', 'function2' => 'utf8_htmlspecialchars')), array('extension', 'attachments_desc.extension', ''), array('mimetype', 'attachments_desc.mimetype', ''), array('filesize', 'attachments_desc.filesize', ''), @@ -345,11 +345,11 @@ if (!$get_info) array('topic_id', 0, ''), array('in_message', 1, ''), array('is_orphan', 0, ''), - array('poster_id', 'attachments.user_id_1', 'phpbb_user_id'), + array('poster_id', 'attachments.user_id_1 AS poster_id', 'phpbb_user_id'), array('physical_filename', 'attachments_desc.physical_filename', 'import_attachment'), array('real_filename', 'attachments_desc.real_filename', ''), array('download_count', 'attachments_desc.download_count', ''), - array('attach_comment', 'attachments_desc.comment', 'utf8_htmlspecialchars'), + array('attach_comment', 'attachments_desc.comment', array('function1' => 'phpbb_set_encoding', 'function2' => 'utf8_htmlspecialchars')), array('extension', 'attachments_desc.extension', ''), array('mimetype', 'attachments_desc.mimetype', ''), array('filesize', 'attachments_desc.filesize', ''), @@ -374,7 +374,7 @@ if (!$get_info) 'query_first' => (defined('MOD_ATTACHMENT')) ? $convert->truncate_statement . EXTENSION_GROUPS_TABLE : '', array('group_id', 'extension_groups.group_id', ''), - array('group_name', 'extension_groups.group_name', 'utf8_htmlspecialchars'), + array('group_name', 'extension_groups.group_name', array('function1' => 'phpbb_set_encoding', 'function2' => 'utf8_htmlspecialchars')), array('cat_id', 'extension_groups.cat_id', 'phpbb_attachment_category'), array('allow_group', 'extension_groups.allow_group', ''), array('download_mode', 1, ''), @@ -407,7 +407,7 @@ if (!$get_info) 'target' => DISALLOW_TABLE, 'query_first' => $convert->truncate_statement . DISALLOW_TABLE, - array('disallow_username', 'disallow.disallow_username', ''), + array('disallow_username', 'disallow.disallow_username', 'phpbb_set_encoding'), ), array( @@ -415,7 +415,7 @@ if (!$get_info) 'query_first' => $convert->truncate_statement . RANKS_TABLE, array('rank_id', 'ranks.rank_id', ''), - array('rank_title', 'ranks.rank_title', 'utf8_htmlspecialchars'), + array('rank_title', 'ranks.rank_title', array('function1' => 'phpbb_set_encoding', 'function2' => 'utf8_htmlspecialchars')), array('rank_min', 'ranks.rank_min', array('typecast' => 'int', 'execute' => '{RESULT} = ({VALUE}[0] < 0) ? 0 : {VALUE}[0];')), array('rank_special', 'ranks.rank_special', ''), array('rank_image', 'ranks.rank_image', 'import_rank'), @@ -429,9 +429,9 @@ if (!$get_info) array('topic_id', 'topics.topic_id', ''), array('forum_id', 'topics.forum_id', ''), array('icon_id', 0, ''), - array('topic_poster', 'topics.topic_poster', 'phpbb_user_id'), + array('topic_poster', 'topics.topic_poster AS poster_id', 'phpbb_user_id'), array('topic_attachment', ((defined('MOD_ATTACHMENT')) ? 'topics.topic_attachment' : 0), ''), - array('topic_title', 'topics.topic_title', ''), + array('topic_title', 'topics.topic_title', 'phpbb_set_encoding'), array('topic_time', 'topics.topic_time', ''), array('topic_views', 'topics.topic_views', ''), array('topic_replies', 'topics.topic_replies', ''), @@ -442,7 +442,7 @@ if (!$get_info) array('topic_type', 'topics.topic_type', 'phpbb_convert_topic_type'), array('topic_first_post_id', 'topics.topic_first_post_id', ''), - array('poll_title', 'vote_desc.vote_text', array('function1' => 'null_to_str', 'function2' => 'utf8_htmlspecialchars')), + array('poll_title', 'vote_desc.vote_text', array('function1' => 'null_to_str', 'function2' => 'phpbb_set_encoding', 'function3' => 'utf8_htmlspecialchars')), array('poll_start', 'vote_desc.vote_start', 'null_to_zero'), array('poll_length', 'vote_desc.vote_length', 'null_to_zero'), array('poll_max_options', 1, ''), @@ -459,9 +459,9 @@ if (!$get_info) array('topic_id', 'topics.topic_id', ''), array('forum_id', 'topics.forum_id', ''), array('icon_id', 0, ''), - array('topic_poster', 'topics.topic_poster', 'phpbb_user_id'), + array('topic_poster', 'topics.topic_poster AS poster_id', 'phpbb_user_id'), array('topic_attachment', ((defined('MOD_ATTACHMENT')) ? 'topics.topic_attachment' : 0), ''), - array('topic_title', 'topics.topic_title', ''), + array('topic_title', 'topics.topic_title', 'phpbb_set_encoding'), array('topic_time', 'topics.topic_time', ''), array('topic_views', 'topics.topic_views', ''), array('topic_replies', 'topics.topic_replies', ''), @@ -472,7 +472,7 @@ if (!$get_info) array('topic_type', 'topics.topic_type', 'phpbb_convert_topic_type'), array('topic_first_post_id', 'topics.topic_first_post_id', ''), - array('poll_title', 'vote_desc.vote_text', array('function1' => 'null_to_str', 'function2' => 'utf8_htmlspecialchars')), + array('poll_title', 'vote_desc.vote_text', array('function1' => 'null_to_str', 'function2' => 'phpbb_set_encoding', 'function3' => 'utf8_htmlspecialchars')), array('poll_start', 'vote_desc.vote_start', 'null_to_zero'), array('poll_length', 'vote_desc.vote_length', 'null_to_zero'), array('poll_max_options', 1, ''), @@ -497,8 +497,8 @@ if (!$get_info) 'query_first' => $convert->truncate_statement . SMILIES_TABLE, array('smiley_id', 'smilies.smilies_id', ''), - array('code', 'smilies.code', ''), - array('emotion', 'smilies.emoticon', ''), + array('code', 'smilies.code', 'phpbb_set_encoding'), + array('emotion', 'smilies.emoticon', 'phpbb_set_encoding'), array('smiley_url', 'smilies.smile_url', 'import_smiley'), array('smiley_width', 'smilies.smile_url', 'get_smiley_width'), array('smiley_height', 'smilies.smile_url', 'get_smiley_height'), @@ -517,10 +517,12 @@ if (!$get_info) array('poll_option_id', 'vote_results.vote_option_id', ''), array('topic_id', 'vote_desc.topic_id', ''), - array('poll_option_text', 'vote_results.vote_option_text', 'utf8_htmlspecialchars'), + array('', 'topics.topic_poster AS poster_id', ''), + array('poll_option_text', 'vote_results.vote_option_text', array('function1' => 'phpbb_set_encoding', 'function2' => 'utf8_htmlspecialchars')), array('poll_option_total', 'vote_results.vote_result', ''), 'where' => 'vote_results.vote_id = vote_desc.vote_id', + 'left_join' => 'vote_desc LEFT JOIN topics ON topics.topic_id = vote_desc.topic_id', ), array( @@ -542,8 +544,8 @@ if (!$get_info) 'query_first' => $convert->truncate_statement . WORDS_TABLE, array('word_id', 'words.word_id', ''), - array('word', 'words.word', ''), - array('replacement', 'words.replacement', ''), + array('word', 'words.word', 'phpbb_set_encoding'), + array('replacement', 'words.replacement', 'phpbb_set_encoding'), ), array( @@ -566,8 +568,8 @@ if (!$get_info) array('enable_smilies', 'posts.enable_smilies', ''), array('enable_sig', 'posts.enable_sig', ''), array('enable_magic_url', 1, ''), - array('post_username', 'posts.post_username', ''), - array('post_subject', 'posts_text.post_subject', ''), + array('post_username', 'posts.post_username', 'phpbb_set_encoding'), + array('post_subject', 'posts_text.post_subject', 'phpbb_set_encoding'), array('post_attachment', ((defined('MOD_ATTACHMENT')) ? 'posts.post_attachment' : 0), ''), array('post_edit_time', 'posts.post_edit_time', array('typecast' => 'int')), array('post_edit_count', 'posts.post_edit_count', ''), @@ -612,7 +614,7 @@ if (!$get_info) array('enable_smilies', 'privmsgs.privmsgs_enable_smilies AS enable_smilies', ''), array('enable_magic_url', 1, ''), array('enable_sig', 'privmsgs.privmsgs_attach_sig', ''), - array('message_subject', 'privmsgs.privmsgs_subject', 'utf8_htmlspecialchars'), + array('message_subject', 'privmsgs.privmsgs_subject', array('function1' => 'phpbb_set_encoding', 'function2' => 'utf8_htmlspecialchars')), array('message_attachment', ((defined('MOD_ATTACHMENT')) ? 'privmsgs.privmsgs_attachment' : 0), ''), array('message_edit_reason', '', ''), array('message_edit_user', 0, ''), @@ -744,8 +746,8 @@ if (!$get_info) array('group_id', 'groups.group_id', ''), array('group_type', 'groups.group_type', 'phpbb_convert_group_type'), array('group_display', 0, ''), - array('group_name', 'groups.group_name', 'phpbb_convert_group_name'), - array('group_desc', 'groups.group_description', ''), + array('group_name', 'groups.group_name', 'phpbb_convert_group_name'), // phpbb_set_encoding called in phpbb_convert_group_name + array('group_desc', 'groups.group_description', 'phpbb_set_encoding'), 'where' => 'groups.group_single_user = 0', ), @@ -788,8 +790,8 @@ if (!$get_info) array('user_type', 'users.user_active', 'set_user_type'), array('group_id', 'users.user_level', 'phpbb_set_primary_group'), array('user_regdate', 'users.user_regdate', ''), - array('username', 'users.username', ''), - array('username_clean', 'users.username', 'utf8_clean_string'), + array('username', 'users.username', 'phpbb_set_default_encoding'), // recode to utf8 with default lang + array('username_clean', 'users.username', array('function1' => 'phpbb_set_default_encoding', 'function2' => 'utf8_clean_string')), array('user_password', 'users.user_password', ''), array('user_pass_convert', 1, ''), array('user_posts', 'users.user_posts', ''), @@ -798,20 +800,21 @@ if (!$get_info) array('user_birthday', ((defined('MOD_BIRTHDAY')) ? 'users.user_birthday' : ''), 'phpbb_get_birthday'), array('user_lastvisit', 'users.user_lastvisit', ''), array('user_lang', $config['default_lang'], ''), + array('', 'users.user_lang', ''), array('user_timezone', 'users.user_timezone', ''), array('user_dateformat', 'users.user_dateformat', ''), array('user_inactive_reason', '', 'phpbb_inactive_reason'), array('user_inactive_time', '', 'phpbb_inactive_time'), - array('user_interests', 'users.user_interests', 'utf8_htmlspecialchars'), - array('user_occ', 'users.user_occ', 'utf8_htmlspecialchars'), + array('user_interests', 'users.user_interests', array('function1' => 'phpbb_set_encoding', 'function2' => 'utf8_htmlspecialchars')), + array('user_occ', 'users.user_occ', array('function1' => 'phpbb_set_encoding', 'function2' => 'utf8_htmlspecialchars')), array('user_website', 'users.user_website', 'validate_website'), array('user_jabber', '', ''), array('user_msnm', 'users.user_msnm', ''), array('user_yim', 'users.user_yim', ''), array('user_aim', 'users.user_aim', ''), array('user_icq', 'users.user_icq', ''), - array('user_from', 'users.user_from', 'utf8_htmlspecialchars'), + array('user_from', 'users.user_from', array('function1' => 'phpbb_set_encoding', 'function2' => 'utf8_htmlspecialchars')), array('user_rank', 'users.user_rank', ''), array('user_permissions', '', ''), diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index 5ee3c52473..62ce8b774a 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -70,7 +70,7 @@ function phpbb_insert_forums() { $sql_ary = array( 'forum_id' => $max_forum_id, - 'forum_name' => ($row['cat_title']) ? htmlspecialchars(phpbb_set_encoding($row['cat_title']), ENT_COMPAT, 'UTF-8') : $user->lang['CATEGORY'], + 'forum_name' => ($row['cat_title']) ? htmlspecialchars(phpbb_set_encoding($row['cat_title'], false), ENT_COMPAT, 'UTF-8') : $user->lang['CATEGORY'], 'parent_id' => 0, 'forum_parents' => '', 'forum_desc' => '', @@ -170,10 +170,10 @@ function phpbb_insert_forums() // Define the new forums sql ary $sql_ary = array( 'forum_id' => (int) $row['forum_id'], - 'forum_name' => htmlspecialchars(phpbb_set_encoding($row['forum_name']), ENT_COMPAT, 'UTF-8'), + 'forum_name' => htmlspecialchars(phpbb_set_encoding($row['forum_name'], false), ENT_COMPAT, 'UTF-8'), 'parent_id' => $cats_added[$row['cat_id']], 'forum_parents' => '', - 'forum_desc' => htmlspecialchars(phpbb_set_encoding($row['forum_desc']), ENT_COMPAT, 'UTF-8'), + 'forum_desc' => htmlspecialchars(phpbb_set_encoding($row['forum_desc'], false), ENT_COMPAT, 'UTF-8'), 'forum_type' => FORUM_POST, 'forum_status' => is_item_locked($row['forum_status']), 'enable_prune' => $row['prune_enable'], @@ -239,24 +239,113 @@ function phpbb_insert_forums() $db->sql_freeresult($result); } -function phpbb_set_encoding($text) +/** +* Function for recoding text with the default language +* +* @param string $text text to recode to utf8 +* @param bool $grab_user_lang if set to true the function tries to use $convert_row['user_lang'] (and falls back to $convert_row['poster_id']) instead of the boards default language +*/ +function phpbb_set_encoding($text, $grab_user_lang = true) { - global $lang_enc_array; + global $lang_enc_array, $convert_row; + global $convert, $phpEx; - $default_lang = trim(get_config_value('default_lang')); + /*static $lang_enc_array = array( + 'korean' => 'euc-kr', + 'serbian' => 'windows-1250', + 'polish' => 'iso-8859-2', + 'kurdish' => 'windows-1254', + 'slovak' => 'Windows-1250', + 'russian' => 'windows-1251', + 'estonian' => 'iso-8859-4', + 'chinese_simplified' => 'gb2312', + 'macedonian' => 'windows-1251', + 'azerbaijani' => 'UTF-8', + 'romanian' => 'iso-8859-2', + 'romanian_diacritice' => 'iso-8859-2', + 'lithuanian' => 'windows-1257', + 'turkish' => 'iso-8859-9', + 'ukrainian' => 'windows-1251', + 'japanese' => 'shift_jis', + 'hungarian' => 'ISO-8859-2', + 'romanian_no_diacritics' => 'iso-8859-2', + 'mongolian' => 'UTF-8', + 'slovenian' => 'windows-1250', + 'bosnian' => 'windows-1250', + 'czech' => 'Windows-1250', + 'farsi' => 'Windows-1256', + 'croatian' => 'windows-1250', + 'greek' => 'iso-8859-7', + 'russian_tu' => 'windows-1251', + 'sakha' => 'UTF-8', + 'serbian_cyrillic' => 'windows-1251', + 'bulgarian' => 'windows-1251', + 'chinese_traditional_taiwan' => 'big5', + 'chinese_traditional' => 'big5', + 'arabic' => 'windows-1256', + 'hebrew' => 'WINDOWS-1255', + 'thai' => 'windows-874', + //'chinese_traditional_taiwan' => 'utf-8' // custom modified, we may have to do an include :-( + );*/ - if (!isset($lang_enc_array[$default_lang])) + if (empty($lang_enc_array)) { - global $phpEx, $convert; - - include($convert->convertor_status['forum_path'] . '/language/lang_' . $default_lang . '/lang_main.' . $phpEx); - $lang_enc_array[$default_lang] = $lang['ENCODING']; - unset($lang); + $lang_enc_array = array(); } - return utf8_recode($text, $lang_enc_array[$default_lang]); + $get_lang = trim(get_config_value('default_lang')); + + // Do we need the users language encoding? + if ($grab_user_lang && !empty($convert_row)) + { + if (!empty($convert_row['user_lang'])) + { + $get_lang = trim($convert_row['user_lang']); + } + else if (!empty($convert_row['poster_id'])) + { + global $db; + + $sql = 'SELECT user_lang + FROM ' . $convert->src_table_prefix . 'users + WHERE user_id = ' . (int) $convert_row['poster_id']; + $result = $db->sql_query($sql); + $get_lang = (string) $db->sql_fetchfield('user_lang'); + $db->sql_freeresult($result); + + $get_lang = (!trim($get_lang)) ? trim(get_config_value('default_lang')) : trim($get_lang); + } + } + + if (!isset($lang_enc_array[$get_lang])) + { + $filename = $convert->convertor_status['forum_path'] . '/language/lang_' . $get_lang . '/lang_main.' . $phpEx; + + if (!file_exists($filename)) + { + $get_lang = trim(get_config_value('default_lang')); + } + + if (!isset($lang_enc_array[$get_lang])) + { + include($convert->convertor_status['forum_path'] . '/language/lang_' . $get_lang . '/lang_main.' . $phpEx); + $lang_enc_array[$get_lang] = $lang['ENCODING']; + unset($lang); + } + } + + $encoding = $lang_enc_array[$get_lang]; + + return utf8_recode($text, $lang_enc_array[$get_lang]); } +/** +* Same as phpbb_set_encoding, but forcing boards default language +*/ +function phpbb_set_default_encoding($text) +{ + return phpbb_set_encoding($text, false); +} /** * Convert Birthday from Birthday MOD to phpBB Format @@ -855,7 +944,7 @@ function phpbb_convert_group_name($group_name) return 'phpBB2 - ' . $group_name; } - return phpbb_set_encoding($group_name); + return phpbb_set_encoding($group_name, false); } /** @@ -915,45 +1004,6 @@ function phpbb_convert_topic_type($topic_type) function phpbb_prepare_message($message) { global $phpbb_root_path, $phpEx, $db, $convert, $user, $config, $cache, $convert_row, $message_parser; - global $lang_enc_array; - - /*static $lang_enc_array = array( - 'korean' => 'euc-kr', - 'serbian' => 'windows-1250', - 'polish' => 'iso-8859-2', - 'kurdish' => 'windows-1254', - 'slovak' => 'Windows-1250', - 'russian' => 'windows-1251', - 'estonian' => 'iso-8859-4', - 'chinese_simplified' => 'gb2312', - 'macedonian' => 'windows-1251', - 'azerbaijani' => 'UTF-8', - 'romanian' => 'iso-8859-2', - 'romanian_diacritice' => 'iso-8859-2', - 'lithuanian' => 'windows-1257', - 'turkish' => 'iso-8859-9', - 'ukrainian' => 'windows-1251', - 'japanese' => 'shift_jis', - 'hungarian' => 'ISO-8859-2', - 'romanian_no_diacritics' => 'iso-8859-2', - 'mongolian' => 'UTF-8', - 'slovenian' => 'windows-1250', - 'bosnian' => 'windows-1250', - 'czech' => 'Windows-1250', - 'farsi' => 'Windows-1256', - 'croatian' => 'windows-1250', - 'greek' => 'iso-8859-7', - 'russian_tu' => 'windows-1251', - 'sakha' => 'UTF-8', - 'serbian_cyrillic' => 'windows-1251', - 'bulgarian' => 'windows-1251', - 'chinese_traditional_taiwan' => 'big5', - 'chinese_traditional' => 'big5', - 'arabic' => 'windows-1256', - 'hebrew' => 'WINDOWS-1255', - 'thai' => 'windows-874', - //'chinese_traditional_taiwan' => 'utf-8' // custom modified, we may have to do an include :-( - );*/ if (!$message) { @@ -974,45 +1024,12 @@ function phpbb_prepare_message($message) $user_id = $convert->row['poster_id']; - $sql = 'SELECT user_lang - FROM ' . $convert->src_table_prefix . 'users - WHERE user_id = ' . (int) $user_id; - $result = $db->sql_query($sql); - $user_lang = (string) $db->sql_fetchfield('user_lang'); - $db->sql_freeresult($result); - - if (empty($lang_enc_array)) - { - $lang_enc_array = array(); - } - - $user_lang = (!trim($user_lang)) ? trim(get_config_value('default_lang')) : trim($user_lang); - - if (!isset($lang_enc_array[$user_lang])) - { - $filename = $convert->convertor_status['forum_path'] . '/language/lang_' . $user_lang . '/lang_main.' . $phpEx; - - if (!file_exists($filename)) - { - $user_lang = trim(get_config_value('default_lang')); - } - - if (!isset($lang_enc_array[$user_lang])) - { - include($convert->convertor_status['forum_path'] . '/language/lang_' . $user_lang . '/lang_main.' . $phpEx); - $lang_enc_array[$user_lang] = $lang['ENCODING']; - unset($lang); - } - } - - $encoding = $lang_enc_array[$user_lang]; - $message = str_replace('<', '<', $message); $message = str_replace('>', '>', $message); $message = str_replace('
', "\n", $message); // make the post UTF-8 - $message = utf8_recode($message, $encoding); + $message = phpbb_set_encoding($message); $message_parser->warn_msg = array(); // Reset the errors from the previous message $message_parser->bbcode_uid = make_uid($convert->row['post_time']); From b94a240d2f20ea70c131d939c84802dc71965aea Mon Sep 17 00:00:00 2001 From: David M Date: Sun, 7 Jan 2007 20:34:41 +0000 Subject: [PATCH 174/264] #6868 git-svn-id: file:///svn/phpbb/trunk@6859 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/install_convert.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index 6a6f63effb..485b9fb281 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -884,12 +884,15 @@ class install_convert extends module // Thanks MySQL, for silently converting... case 'mysql': case 'mysql4': - case 'mysqli': if (version_compare($db->mysql_version, '4.1.3', '>=')) { $mysql_convert = true; } break; + + case 'mysqli': + $mysql_convert = true; + break; } while (($counting === -1 || $counting >= $convert->batch_size) && still_on_time()) From 55b5e714113e346e5e37f147c65a3b811d6bcfdf Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 8 Jan 2007 16:47:16 +0000 Subject: [PATCH 175/264] - ok... first of all, let the forum names and descriptions being recoded correctly... - fixed the php notices for a non-existant poster id. They were related to user signature conversion - adjusted the topic_poster id; this should solve wrong user assignments for topic poster - adjusted private message author; normally here some users should have encountered wrong ids. - adjusted the batch sizes to support the usual 2.0.x target base - the old values were used for really huge conversions. :) - commented out meta refresh for the time being - we will add a setting for this, some may want to sit in front, some may want to go away while converting (most likely when they did a test run before) git-svn-id: file:///svn/phpbb/trunk@6860 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/convertors/convert_phpbb20.php | 6 ++-- .../install/convertors/functions_phpbb20.php | 22 +++++++++++++ phpBB/install/install_convert.php | 32 +++++++++++++------ phpBB/language/en/install.php | 1 + 4 files changed, 48 insertions(+), 13 deletions(-) diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index c506b46f8d..d2bec49982 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -517,7 +517,7 @@ if (!$get_info) array('poll_option_id', 'vote_results.vote_option_id', ''), array('topic_id', 'vote_desc.topic_id', ''), - array('', 'topics.topic_poster AS poster_id', ''), + array('', 'topics.topic_poster AS poster_id', 'phpbb_user_id'), array('poll_option_text', 'vote_results.vote_option_text', array('function1' => 'phpbb_set_encoding', 'function2' => 'utf8_htmlspecialchars')), array('poll_option_total', 'vote_results.vote_result', ''), @@ -605,7 +605,7 @@ if (!$get_info) array('msg_id', 'privmsgs.privmsgs_id', ''), array('root_level', 0, ''), - array('author_id', 'privmsgs.privmsgs_from_userid', 'phpbb_user_id'), + array('author_id', 'privmsgs.privmsgs_from_userid AS poster_id', 'phpbb_user_id'), array('icon_id', 0, ''), array('author_ip', 'privmsgs.privmsgs_ip', 'decode_ip'), array('message_time', 'privmsgs.privmsgs_date', ''), @@ -624,7 +624,6 @@ if (!$get_info) array('bbcode_uid', 'privmsgs.privmsgs_date AS post_time', 'make_uid'), array('message_text', 'privmsgs_text.privmsgs_text', 'phpbb_prepare_message'), array('', 'privmsgs_text.privmsgs_bbcode_uid AS old_bbcode_uid', ''), - array('', 'privmsgs.privmsgs_from_userid AS poster_id', ''), array('bbcode_bitfield', '', 'get_bbcode_bitfield'), array('to_address', 'privmsgs.privmsgs_to_userid', 'phpbb_privmsgs_to_userid'), @@ -787,6 +786,7 @@ if (!$get_info) ), array('user_id', 'users.user_id', 'phpbb_user_id'), + array('', 'users.user_id AS poster_id', 'phpbb_user_id'), array('user_type', 'users.user_active', 'set_user_type'), array('group_id', 'users.user_level', 'phpbb_set_primary_group'), array('user_regdate', 'users.user_regdate', ''), diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index 62ce8b774a..2f7edc18cd 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -63,8 +63,19 @@ function phpbb_insert_forums() $sql = 'SELECT cat_id, cat_title FROM ' . $convert->src_table_prefix . 'categories ORDER BY cat_order'; + + if ($convert->mysql_convert) + { + $db->sql_query("SET NAMES 'binary'"); + } + $result = $db->sql_query($sql); + if ($convert->mysql_convert) + { + $db->sql_query("SET NAMES 'utf8'"); + } + $cats_added = array(); while ($row = $db->sql_fetchrow($result)) { @@ -151,8 +162,19 @@ function phpbb_insert_forums() LEFT JOIN ' . $convert->src_table_prefix . 'forum_prune fp ON f.forum_id = fp.forum_id GROUP BY f.forum_id ORDER BY f.cat_id, f.forum_order'; + + if ($convert->mysql_convert) + { + $db->sql_query("SET NAMES 'binary'"); + } + $result = $db->sql_query($sql); + if ($convert->mysql_convert) + { + $db->sql_query("SET NAMES 'utf8'"); + } + while ($row = $db->sql_fetchrow($result)) { // Some might have forums here with an id not being "possible"... diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index 485b9fb281..03ed5d7f40 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -46,9 +46,14 @@ class convert var $fulltext_search; // Batch size, can be adjusted by the conversion file - var $batch_size = 6000; + // For big boards a value of 6000 seems to be optimal + var $batch_size = 2000; // Number of rows to be inserted at once (extended insert) if supported - var $num_wait_rows = 30; + // For installations having enough memory a value of 60 may be good. + var $num_wait_rows = 20; + + // Mysqls internal recoding engine messing up with our (better) functions? We at least support more encodings than mysql so should use it in favor. + var $mysql_convert = false; var $p_master; @@ -606,9 +611,16 @@ class install_convert extends module $this->p_master->error($user->lang['DEV_NO_TEST_FILE'], __LINE__, __FILE__); } - if (!is_writeable($phpbb_root_path . $local_path)) + if (!$local_path || !is_writeable($phpbb_root_path . $local_path)) { - $bad_folders[] = $local_path; + if (!$local_path) + { + $bad_folders[] = sprintf($user->lang['CONFIG_PHPBB_EMPTY'], $folder); + } + else + { + $bad_folders[] = $local_path; + } } } } @@ -877,7 +889,7 @@ class install_convert extends module $counting = -1; $batch_time = 0; - $mysql_convert = false; + $convert->mysql_convert = false; switch ($db->sql_layer) { @@ -886,12 +898,12 @@ class install_convert extends module case 'mysql4': if (version_compare($db->mysql_version, '4.1.3', '>=')) { - $mysql_convert = true; + $convert->mysql_convert = true; } break; case 'mysqli': - $mysql_convert = true; + $convert->mysql_convert = true; break; } @@ -917,7 +929,7 @@ class install_convert extends module $mtime = explode(' ', microtime()); $batch_time = $mtime[0] + $mtime[1]; - if ($mysql_convert) + if ($convert->mysql_convert) { $db->sql_query("SET NAMES 'binary'"); } @@ -925,7 +937,7 @@ class install_convert extends module // Take skip rows into account and only fetch batch_size amount of rows $___result = $db->sql_query_limit($sql, $convert->batch_size, $skip_rows); - if ($mysql_convert) + if ($convert->mysql_convert) { $db->sql_query("SET NAMES 'utf8'"); } @@ -1677,7 +1689,7 @@ class install_convert extends module { if (!defined('DEBUG_EXTRA')) { - meta_refresh(5, $url); + // meta_refresh(5, $url); } } diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index c4fc43731b..8a8cc028d4 100755 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -58,6 +58,7 @@ $lang = array_merge($lang, array( 'CONFIG_CONVERT' => 'Converting the configuration', 'CONFIG_FILE_UNABLE_WRITE' => 'It was not possible to write the configuration file. Alternative methods for this file to be created are presented below', 'CONFIG_FILE_WRITTEN' => 'The configuration file has been written, you may now proceed to the next step of the installation', + 'CONFIG_PHPBB_EMPTY' => 'The phpBB3 config variable for "%s" is empty.' 'CONFIG_RETRY' => 'Retry', 'CONTACT_EMAIL_CONFIRM' => 'Confirm contact email', 'CONTINUE_CONVERT' => 'Continue conversion', From 4be13298039b84d74040e5b4b3dfddc3b311dbd1 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 8 Jan 2007 17:19:56 +0000 Subject: [PATCH 176/264] ups. :) git-svn-id: file:///svn/phpbb/trunk@6861 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/install.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 8a8cc028d4..632b305e4b 100755 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -58,7 +58,7 @@ $lang = array_merge($lang, array( 'CONFIG_CONVERT' => 'Converting the configuration', 'CONFIG_FILE_UNABLE_WRITE' => 'It was not possible to write the configuration file. Alternative methods for this file to be created are presented below', 'CONFIG_FILE_WRITTEN' => 'The configuration file has been written, you may now proceed to the next step of the installation', - 'CONFIG_PHPBB_EMPTY' => 'The phpBB3 config variable for "%s" is empty.' + 'CONFIG_PHPBB_EMPTY' => 'The phpBB3 config variable for "%s" is empty.', 'CONFIG_RETRY' => 'Retry', 'CONTACT_EMAIL_CONFIRM' => 'Confirm contact email', 'CONTINUE_CONVERT' => 'Continue conversion', From 27f915f305a2fc02ca33c34ceeb7c9ae3e119e99 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 8 Jan 2007 21:14:49 +0000 Subject: [PATCH 177/264] - new homographs or IDN confusables ( http://www.unicode.org/reports/tr39/data/international.txt ) - also added character names to old homographs - pagination_sep theme option removed, PAGINATION_SEPERATOR can be set in language files and the theme can overwrite it using span.page-sep [Bug #6872] git-svn-id: file:///svn/phpbb/trunk@6862 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_styles.php | 12 +-- phpBB/includes/functions.php | 2 +- phpBB/includes/functions_display.php | 2 +- phpBB/includes/utf/utf_tools.php | 104 ++++++++++++++++++++----- phpBB/language/en/common.php | 1 + phpBB/styles/subSilver/theme/theme.cfg | 6 -- 6 files changed, 87 insertions(+), 40 deletions(-) diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 2ec7e7095b..29d38a4c19 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -82,11 +82,6 @@ version = {VERSION} # images within your css file. # parse_css_file = {PARSE_CSS_FILE} - -# -# This option defines the pagination seperator in templates. -# -pagination_sep = \'{PAGINATION_SEP}\' '; $this->imageset_keys = array( @@ -1812,12 +1807,7 @@ pagination_sep = \'{PAGINATION_SEP}\' $items['parse_css_file'] = 'off'; } - if (!isset($items['pagination_sep'])) - { - $items['pagination_sep'] = ', '; - } - - $theme_cfg = str_replace(array('{PARSE_CSS_FILE}', '{PAGINATION_SEP}'), array($items['parse_css_file'], $items['pagination_sep']), $theme_cfg); + $theme_cfg = str_replace(array('{PARSE_CSS_FILE}'), array($items['parse_css_file']), $theme_cfg); $files[] = array( 'src' => "styles/{$style_row['theme_path']}/theme/", diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index e4abcc6cc7..8054870554 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1285,7 +1285,7 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add { global $template, $user; - $seperator = $user->theme['pagination_sep']; + $seperator = '' . $user->lang['PAGINATION_SEPERATOR'] . ''; $total_pages = ceil($num_items/$per_page); if ($total_pages == 1 || !$num_items) diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index bfff31af6a..ab44baf944 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -521,7 +521,7 @@ function topic_generate_pagination($replies, $url) } else if ($times < $total_pages) { - $pagination .= $user->theme['pagination_sep']; + $pagination .= '' . $user->lang['PAGINATION_SEPERATOR'] . ''; } $times++; } diff --git a/phpBB/includes/utf/utf_tools.php b/phpBB/includes/utf/utf_tools.php index 3a95c5f35f..2c2e759fe1 100644 --- a/phpBB/includes/utf/utf_tools.php +++ b/phpBB/includes/utf/utf_tools.php @@ -1106,27 +1106,89 @@ function utf8_clean_string($text) utf_normalizer::nfc($text); static $homographs = array( - // cyrllic - "\xD0\xB0" => "\x61", - "\xD0\xB5" => "\x65", - "\xD0\xBE" => "\x6F", - "\xD1\x80" => "\x70", - "\xD1\x81" => "\x63", - "\xD1\x83" => "\x79", - "\xD1\x85" => "\x78", - "\xD1\x95" => "\x73", - "\xD1\x96" => "\x69", - "\xD1\x98" => "\x6A", - "\xD2\xBB" => "\x68", - // greek - "\xCE\xB1" => "\x61", - "\xCE\xBF" => "\x6F", - // other - "\xC2\xA1" => "\x69", - "\xC2\xAD" => '', - "\x08" => '', - "\x09" => "\x32", - "\x11" => "\x32", + "\x08" => '', // BACKSPACE => empty string + "\x09" => "\x20", // CHARACTER TABULATION => SPACE + "\x11" => "\x20", // Device Controls => SPACE + "\xC2\xA1" => "\x69", // EXCLAMATION MARK, INVERTED => LATIN SMALL LETTER I + "\xC2\xAD" => '', // HYPHEN, SOFT => empty string + "\xC4\x90" => "\xC3\x90", // LATIN CAPITAL LETTER D WITH STROKE => LATIN CAPITAL LETTER ETH + "\xC7\x83" => "\x21", // LATIN LETTER RETROFLEX CLICK => EXCLAMATION MARK + "\xC9\x85" => "\xCE\x9B", // LATIN CAPITAL LETTER TURNED V => GREEK CAPITAL LETTER LAMDA + "\xC9\x99" => "\xC7\x9D", // LATIN SMALL LETTER SCHWA => LATIN SMALL LETTER TURNED E + "\xCA\x99" => "\xD0\xB2", // LATIN LETTER SMALL CAPITAL B => CYRILLIC SMALL LETTER VE + "\xCA\x9C" => "\xD0\xBD", // LATIN LETTER SMALL CAPITAL H => CYRILLIC SMALL LETTER EN + "\xCE\x91" => "\x41", // GREEK CAPITAL LETTER ALPHA => LATIN CAPITAL LETTER A + "\xCE\x92" => "\x42", // GREEK CAPITAL LETTER BETA => LATIN CAPITAL LETTER B + "\xCE\x95" => "\x45", // GREEK CAPITAL LETTER EPSILON => LATIN CAPITAL LETTER E + "\xCE\x96" => "\x5A", // GREEK CAPITAL LETTER ZETA => LATIN CAPITAL LETTER Z + "\xCE\x97" => "\x48", // GREEK CAPITAL LETTER ETA => LATIN CAPITAL LETTER H + "\xCE\x99" => "\x49", // GREEK CAPITAL LETTER IOTA => LATIN CAPITAL LETTER I + "\xCE\x9A" => "\x4B", // GREEK CAPITAL LETTER KAPPA => LATIN CAPITAL LETTER K + "\xCE\x9C" => "\x4D", // GREEK CAPITAL LETTER MU => LATIN CAPITAL LETTER M + "\xCE\x9D" => "\x4E", // GREEK CAPITAL LETTER NU => LATIN CAPITAL LETTER N + "\xCE\x9F" => "\x4F", // GREEK CAPITAL LETTER OMICRON => LATIN CAPITAL LETTER O + "\xCE\xA1" => "\x50", // GREEK CAPITAL LETTER RHO => LATIN CAPITAL LETTER P + "\xCE\xA3" => "\xC6\xA9", // GREEK CAPITAL LETTER SIGMA => LATIN CAPITAL LETTER ESH + "\xCE\xA4" => "\x54", // GREEK CAPITAL LETTER TAU => LATIN CAPITAL LETTER T + "\xCE\xA5" => "\x59", // GREEK CAPITAL LETTER UPSILON => LATIN CAPITAL LETTER Y + "\xCE\xA7" => "\x58", // GREEK CAPITAL LETTER CHI => LATIN CAPITAL LETTER X + "\xCE\xB1" => "\x61", // GREEK SMALL LETTER ALPHA => LATIN SMALL LETTER A + "\xCE\xB5" => "\xC9\x9B", // GREEK SMALL LETTER EPSILON => LATIN SMALL LETTER OPEN E + "\xCE\xB9" => "\xC9\xA9", // GREEK SMALL LETTER IOTA => LATIN SMALL LETTER IOTA + "\xCE\xBF" => "\x6F", // GREEK SMALL LETTER OMICRON => LATIN SMALL LETTER O + "\xCF\xB3" => "\x6A", // GREEK LETTER YOT => LATIN SMALL LETTER J + "\xD0\x85" => "\x53", // CYRILLIC CAPITAL LETTER DZE => LATIN CAPITAL LETTER S + "\xD0\x88" => "\x4A", // CYRILLIC CAPITAL LETTER JE => LATIN CAPITAL LETTER J + "\xD0\x91" => "\xC6\x82", // CYRILLIC CAPITAL LETTER BE => LATIN CAPITAL LETTER B WITH TOPBAR + "\xD0\x93" => "\xCE\x93", // CYRILLIC CAPITAL LETTER GHE => GREEK CAPITAL LETTER GAMMA + "\xD0\x9F" => "\xCE\xA0", // CYRILLIC CAPITAL LETTER PE => GREEK CAPITAL LETTER PI + "\xD0\xA1" => "\x43", // CYRILLIC CAPITAL LETTER ES => LATIN CAPITAL LETTER C + "\xD0\xB0" => "\x61", // CYRILLIC SMALL LETTER A => LATIN SMALL LETTER A + "\xD0\xB5" => "\x65", // CYRILLIC SMALL LETTER IE => LATIN SMALL LETTER E + "\xD0\xBA" => "\xC4\xB8", // CYRILLIC SMALL LETTER KA => LATIN SMALL LETTER KRA + "\xD0\xBE" => "\x6F", // CYRILLIC SMALL LETTER O => LATIN SMALL LETTER O + "\xD1\x80" => "\x70", // CYRILLIC SMALL LETTER ER => LATIN SMALL LETTER P + "\xD1\x81" => "\x63", // CYRILLIC SMALL LETTER ES => LATIN SMALL LETTER C + "\xD1\x83" => "\x79", // CYRILLIC SMALL LETTER U => LATIN SMALL LETTER Y + "\xD1\x85" => "\x78", // CYRILLIC SMALL LETTER HA => LATIN SMALL LETTER X + "\xD1\x95" => "\x73", // CYRILLIC SMALL LETTER DZE => LATIN SMALL LETTER S + "\xD1\x96" => "\x69", // CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I => LATIN SMALL LETTER I + "\xD1\x98" => "\x6A", // CYRILLIC SMALL LETTER JE => LATIN SMALL LETTER J + "\xD2\xBB" => "\x68", // CYRILLIC SMALL LETTER SHHA => LATIN SMALL LETTER H + "\xD3\x8F" => "\xC9\xAA", // CYRILLIC SMALL LETTER PALOCHKA => LATIN LETTER SMALL CAPITAL I + "\xD3\x94" => "\xC3\x86", // CYRILLIC CAPITAL LIGATURE A IE => LATIN CAPITAL LETTER AE + "\xD3\x95" => "\xC3\xA6", // CYRILLIC SMALL LIGATURE A IE => LATIN SMALL LETTER AE + "\xD3\x98" => "\xC6\x8E", // CYRILLIC CAPITAL LETTER SCHWA => LATIN CAPITAL LETTER REVERSED E + "\xD3\x99" => "\xC7\x9D", // CYRILLIC SMALL LETTER SCHWA => LATIN SMALL LETTER TURNED E + "\xD3\xA1" => "\xCA\x92", // CYRILLIC SMALL LETTER ABKHASIAN DZE => LATIN SMALL LETTER EZH + "\xD3\xA8" => "\xC6\x9F", // CYRILLIC CAPITAL LETTER BARRED O => LATIN CAPITAL LETTER O WITH MIDDLE TILDE + "\xD3\xA9" => "\xC9\xB5", // CYRILLIC SMALL LETTER BARRED O => LATIN SMALL LETTER BARRED O + "\xD4\x81" => "\x64", // CYRILLIC SMALL LETTER KOMI DE => LATIN SMALL LETTER D + "\xE1\x81\x80" => "\xE1\x80\x9D", // MYANMAR DIGIT ZERO => MYANMAR LETTER WA + "\xE1\x9E\xA3" => "\xE1\x9E\xA2", // KHMER INDEPENDENT VOWEL QAQ => KHMER LETTER QA + "\xE1\xA1\x95" => "\xE1\xA0\xB5", // MONGOLIAN LETTER TODO YA => MONGOLIAN LETTER JA + "\xE1\xA7\x90" => "\xE1\xA6\x9E", // NEW TAI LUE DIGIT ZERO => NEW TAI LUE LETTER LOW VA + "\xE1\xAD\x92" => "\xE1\xAC\x8D", // BALINESE DIGIT TWO => BALINESE LETTER LA LENGA + "\xE1\xAD\x93" => "\xE1\xAC\x91", // BALINESE DIGIT THREE => BALINESE LETTER OKARA + "\xE1\xAD\x98" => "\xE1\xAC\xA8", // BALINESE DIGIT EIGHT => BALINESE LETTER PA KAPAL + "\xE1\xAD\x9C" => "\xE1\xAD\x90", // BALINESE WINDU => BALINESE DIGIT ZERO + "\xE1\xB4\x8D" => "\xD0\xBC", // LATIN LETTER SMALL CAPITAL M => CYRILLIC SMALL LETTER EM + "\xE1\xB4\x9B" => "\xD1\x82", // LATIN LETTER SMALL CAPITAL T => CYRILLIC SMALL LETTER TE + "\xE1\xB4\xA6" => "\xD0\xB3", // GREEK LETTER SMALL CAPITAL GAMMA => CYRILLIC SMALL LETTER GHE + "\xE1\xB4\xA8" => "\xD0\xBF", // GREEK LETTER SMALL CAPITAL PI => CYRILLIC SMALL LETTER PE + "\xE1\xB4\xA9" => "\xE1\xB4\x98", // GREEK LETTER SMALL CAPITAL RHO => LATIN LETTER SMALL CAPITAL P + "\xE1\xB4\xAB" => "\xD0\xBB", // CYRILLIC LETTER SMALL CAPITAL EL => CYRILLIC SMALL LETTER EL + "\xE2\x80\x81" => "\x20", // EM QUAD => SPACE + "\xE2\x8D\xB3" => "\xC9\xA9", // APL FUNCTIONAL SYMBOL IOTA => LATIN SMALL LETTER IOTA + "\xE2\x8D\xB4" => "\xCF\x81", // APL FUNCTIONAL SYMBOL RHO => GREEK SMALL LETTER RHO + "\xE2\x8D\xB5" => "\xCF\x89", // APL FUNCcTIONAL SYMBOL OMEGA => GREEK SMALL LETTER OMEGA + "\xE2\x8D\xBA" => "\xCE\xB1", // APL FUNCTIONAL SYMBOL ALPHA => GREEK SMALL LETTER ALPHA + "\xE2\xB1\xA7" => "\xD2\xA2", // LATIN CAPITAL LETTER H WITH DESCENDER => CYRILLIC CAPITAL LETTER EN WITH DESCENDER + "\xE2\xB1\xA9" => "\xD2\x9A", // LATIN CAPITAL LETTER K WITH DESCENDER => CYRILLIC CAPITAL LETTER KA WITH DESCENDER + "\xF0\x90\x8F\x91" => "\xF0\x90\x8E\x82", // OLD PERSIAN NUMBER ONE => UGARITIC LETTER GAMLA + "\xF0\x90\x8F\x93" => "\xF0\x90\x8E\x93", // OLD PERSIAN NUMBER TEN => UGARITIC LETTER AIN + "\xF0\x90\x92\xA0" => "\xF0\x90\x92\x86", // OSMANYA DIGIT ZERO => OSMANYA LETTER DEEL + "\xF0\x92\x80\xB8" => "\xF0\x90\x8E\x9A", // CUNEIFORM SIGN ASH => UGARITIC LETTER TO ); $text = strtr($text, $homographs); diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 10f5ec446f..13669eba50 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -366,6 +366,7 @@ $lang = array_merge($lang, array( 'OPTIONS' => 'Options', 'PAGE_OF' => 'Page %1$d of %2$d', + 'PAGINATION_SEPERATOR' => ', ', 'PASSWORD' => 'Password', 'PLAY_QUICKTIME_FILE' => 'Play Quicktime file', 'PM' => 'PM', diff --git a/phpBB/styles/subSilver/theme/theme.cfg b/phpBB/styles/subSilver/theme/theme.cfg index 695e0e8213..10985664fd 100644 --- a/phpBB/styles/subSilver/theme/theme.cfg +++ b/phpBB/styles/subSilver/theme/theme.cfg @@ -33,9 +33,3 @@ version = 2.1.1 # images within your css file. # parse_css_file = off - -# -# This option defines the pagination seperator in templates. -# -pagination_sep = ', ' - From 5cf6e00cf9e9aedfb293f1e9da228aefc37d70f8 Mon Sep 17 00:00:00 2001 From: David M Date: Tue, 9 Jan 2007 01:33:20 +0000 Subject: [PATCH 178/264] - installer now checks if the page size is correct for Firebird - Firebird now has a proper explain page git-svn-id: file:///svn/phpbb/trunk@6863 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/db/firebird.php | 15 +++++++++++ phpBB/install/install_install.php | 41 +++++++++++++++++++++++++++++++ phpBB/language/en/install.php | 1 + 3 files changed, 57 insertions(+) diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php index 7fd034c7dc..60fa366b7f 100644 --- a/phpBB/includes/db/firebird.php +++ b/phpBB/includes/db/firebird.php @@ -97,6 +97,12 @@ class dbal_firebird extends dbal { global $cache; + // EXPLAIN only in extra debug mode + if (defined('DEBUG_EXTRA')) + { + $this->sql_report('start', $query); + } + $this->last_query_text = $query; $this->query_result = ($cache_ttl && method_exists($cache, 'sql_load')) ? $cache->sql_load($query) : false; $this->sql_add_num_queries($this->query_result); @@ -108,6 +114,11 @@ class dbal_firebird extends dbal $this->sql_error($query); } + if (defined('DEBUG_EXTRA')) + { + $this->sql_report('stop', $query); + } + if (!$this->transaction) { if (function_exists('ibase_commit_ret')) @@ -131,6 +142,10 @@ class dbal_firebird extends dbal $this->open_queries[(int) $this->query_result] = $this->query_result; } } + else if (defined('DEBUG_EXTRA')) + { + $this->sql_report('fromcache', $query); + } } else { diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index c9231075df..38dc491665 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -1967,6 +1967,14 @@ class install_install extends module { $error[] = $lang['INST_ERR_DB_NO_FIREBIRD']; } + $db_info = @ibase_db_info($db->service_handle, $dbname, IBASE_STS_HDR_PAGES); + + preg_match('/^\\s*Page size\\s*(\\d+)/m', $db_info, $regs); + $page_size = intval($regs[1]); + if ($page_size < 8192) + { + $error[] = $lang['INST_ERR_DB_NO_FIREBIRD_PS']; + } } else { @@ -1994,6 +2002,39 @@ class install_install extends module } $db->sql_freeresult($result); } + + // Setup the stuff for our random table + $char_array = array_merge(range('A', 'Z'), range('0', '9')); + $char_len = mt_rand(7, 9); + $char_array_len = sizeof($char_array) - 1; + + $final = ''; + + for ($i = 0; $i < $char_len; $i++) + { + $final .= $char_array[mt_rand(0, $char_array_len)]; + } + + // Create some random table + $sql = 'CREATE TABLE ' . $final . " ( + FIELD1 VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, + FIELD2 INTEGER DEFAULT 0 NOT NULL);"; + $db->sql_query($sql); + + // Create an index that should fail if the page size is less than 8192 + $sql = 'CREATE INDEX ' . $final . ' ON ' . $final . '(FIELD1, FIELD2);'; + $db->sql_query($sql); + + if (ibase_errmsg() !== false) + { + $error[] = $lang['INST_ERR_DB_NO_FIREBIRD_PS']; + } + else + { + // Kill the old table + $db->sql_query('DROP TABLE ' . $final . ';'); + } + unset($final); } break; diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 632b305e4b..c8546325a8 100755 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -194,6 +194,7 @@ $lang = array_merge($lang, array( 'INST_ERR_DB_NO_SQLITE' => 'The version of the SQLite extension you have installed is too old, it must be upgraded to at least 2.8.2.', 'INST_ERR_DB_NO_ORACLE' => 'The version of Oracle installed on this machine requires you to set the NLS_CHARACTERSET parameter to UTF8. Either upgrade your installation to 9.2+ or change the parameter.', 'INST_ERR_DB_NO_FIREBIRD' => 'The version of Firebird installed on this machine is older than 2.0, please upgrade to a newer version.', + 'INST_ERR_DB_NO_FIREBIRD_PS'=> 'The database you selected for Firebird has a page size less than 8192, it must be at least 8192.', 'INST_ERR_DB_NO_POSTGRES' => 'The database you have selected was not created in UNICODE or UTF8 encoding. Try installing with a database in UNICODE or UTF8 encoding', 'INST_ERR_DB_NO_NAME' => 'No database name specified', 'INST_ERR_EMAIL_INVALID' => 'The email address you entered is invalid', From 164fb66f44322ccf5997cff8ccf154a1aa7f01d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Tue, 9 Jan 2007 14:01:37 +0000 Subject: [PATCH 179/264] #6098 "Find a member" now supports single clicks. Thanks for Highway of Life for helping out here. :) git-svn-id: file:///svn/phpbb/trunk@6864 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_permissions.php | 4 ++-- phpBB/includes/acp/acp_users.php | 4 ++-- phpBB/includes/mcp/mcp_notes.php | 4 ++-- phpBB/includes/mcp/mcp_post.php | 4 ++-- phpBB/includes/mcp/mcp_warn.php | 4 ++-- phpBB/includes/ucp/ucp_pm_compose.php | 4 ++-- phpBB/includes/ucp/ucp_pm_options.php | 4 ++-- phpBB/memberlist.php | 18 ++++++++++-------- .../subSilver/template/memberlist_body.html | 11 +++++------ .../subSilver/template/memberlist_search.html | 6 ++++++ .../styles/subSilver/template/ucp_header.html | 4 ++-- .../subSilver/template/ucp_zebra_foes.html | 2 ++ 12 files changed, 39 insertions(+), 30 deletions(-) diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index 9a8bc9e251..f9daf1c1e5 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -331,8 +331,8 @@ class acp_permissions $template->assign_vars(array( 'S_SELECT_USER' => true, - 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=select_victim&field=username'), - 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=select_victim&field=username', false)) + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=select_victim&field=username&select_single=true'), + 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=select_victim&field=username&select_single=true', false)) ); break; diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 978bf1947d..1929b1ece6 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -74,8 +74,8 @@ class acp_users 'ANONYMOUS_USER_ID' => ANONYMOUS, 'S_SELECT_USER' => true, - 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=select_user&field=username'), - 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=select_user&field=username', false), + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=select_user&field=username&select_single=true'), + 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=select_user&field=username&select_single=true', false), ) ); diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php index 415290d3c5..1b3c36ac22 100755 --- a/phpBB/includes/mcp/mcp_notes.php +++ b/phpBB/includes/mcp/mcp_notes.php @@ -41,8 +41,8 @@ class mcp_notes { case 'front': $template->assign_vars(array( - 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp&field=username'), - 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp&field=username', false), + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp&field=username&select_single=true'), + 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp&field=username&select_single=true', false), 'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes'), 'L_TITLE' => $user->lang['MCP_NOTES']) diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index a921d90041..3717c8df90 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -119,8 +119,8 @@ function mcp_post_details($id, $mode, $action) 'S_CLEAR_ALLOWED' => ($auth->acl_get('a_clearlogs')) ? true : false, 'U_EDIT' => ($auth->acl_get('m_edit', $post_info['forum_id'])) ? append_sid("{$phpbb_root_path}posting.$phpEx", "mode=edit&f={$post_info['forum_id']}&p={$post_info['post_id']}") : '', - 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp_chgposter&field=username'), - 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp_chgposter&field=username', false), + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp_chgposter&field=username&select_single=true'), + 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp_chgposter&field=username&select_single=true', false), 'U_MCP_APPROVE' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $post_info['forum_id'] . '&p=' . $post_id), 'U_MCP_REPORT' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $post_info['forum_id'] . '&p=' . $post_id), 'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $post_info['user_id']), diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index cc670ed417..dc7a4870cd 100755 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -71,8 +71,8 @@ function mcp_warn_front_view($id, $mode) global $template, $db, $user, $auth; $template->assign_vars(array( - 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp&field=username'), - 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp&field=username', false), + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp&field=username&select_single=true'), + 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=mcp&field=username&select_single=true', false), 'U_POST_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_user'), ) ); diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 3b41827aa7..ccd61fede1 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -90,8 +90,8 @@ function compose_pm($id, $mode, $action) 'S_SHOW_PM_BOX' => true, 'S_ALLOW_MASS_PM' => ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) ? true : false, 'S_GROUP_OPTIONS' => ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) ? $group_options : '', - 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=post&field=username_list'), - 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=post&field=username_list', true)) + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=post&field=username&select_single=true'), + 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=post&field=username&select_single=true', true)) ); } diff --git a/phpBB/includes/ucp/ucp_pm_options.php b/phpBB/includes/ucp/ucp_pm_options.php index fc1bffa5f5..1aecae4a42 100644 --- a/phpBB/includes/ucp/ucp_pm_options.php +++ b/phpBB/includes/ucp/ucp_pm_options.php @@ -442,8 +442,8 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit 'DEFAULT_ACTION' => ($config['full_folder_action'] == 1) ? $user->lang['DELETE_OLDEST_MESSAGES'] : $user->lang['HOLD_NEW_MESSAGES'], - 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=rule_string'), - 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=rule_string', true)) + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=rule_string&select_single=true'), + 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=rule_string&select_single=true', true)) ); $rule_lang = $action_lang = $check_lang = array(); diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 1811376b5b..dad73d8a64 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -23,12 +23,12 @@ $auth->acl($user->data); $user->setup(array('memberlist', 'groups')); // Grab data -$mode = request_var('mode', ''); -$action = request_var('action', ''); -$user_id = request_var('u', ANONYMOUS); -$username = request_var('un', '', true); -$group_id = request_var('g', 0); -$topic_id = request_var('t', 0); +$mode = request_var('mode', ''); +$action = request_var('action', ''); +$user_id = request_var('u', ANONYMOUS); +$username = request_var('un', '', true); +$group_id = request_var('g', 0); +$topic_id = request_var('t', 0); switch ($mode) { @@ -871,8 +871,9 @@ switch ($mode) // then only admins can make use of this (for ACP functionality) $sql_select = $sql_from = $sql_where = $order_by = ''; - $form = request_var('form', ''); - $field = request_var('field', ''); + $form = request_var('form', ''); + $field = request_var('field', ''); + $select_single = request_var('select_single', false); if ($mode == 'searchuser' && ($config['load_search'] || $auth->acl_get('a_'))) { @@ -1201,6 +1202,7 @@ switch ($mode) 'S_SEARCH_USER' => true, 'S_FORM_NAME' => $form, 'S_FIELD_NAME' => $field, + 'S_SELECT_SINGLE' => $select_single, 'S_COUNT_OPTIONS' => $s_find_count, 'S_SORT_OPTIONS' => $s_sort_key, 'S_JOINED_TIME_OPTIONS' => $s_find_join_time, diff --git a/phpBB/styles/subSilver/template/memberlist_body.html b/phpBB/styles/subSilver/template/memberlist_body.html index 911d980f75..0016190831 100644 --- a/phpBB/styles/subSilver/template/memberlist_body.html +++ b/phpBB/styles/subSilver/template/memberlist_body.html @@ -30,7 +30,6 @@ - @@ -41,7 +40,7 @@ - + @@ -61,7 +60,7 @@ - + @@ -72,7 +71,7 @@ - + @@ -86,7 +85,7 @@ - +
#{L_SEND_MESSAGE} {L_EMAIL} {L_WEBSITE}{L_MARK}{L_MARK}
 {memberrow.ROW_NUMBER} {memberrow.USERNAME_FULL}{memberrow.USERNAME_FULL}{L_SELECT} ]  {memberrow.JOINED}  {memberrow.POSTS} {memberrow.RANK_IMG}{memberrow.RANK_TITLE}  {memberrow.PROFILE_FIELD1_VALUE}
{L_SELECT_SORT_METHOD}:   {L_ORDER}   {L_SELECT_SORT_METHOD}:   {L_ORDER}  
@@ -95,7 +94,7 @@ - +
{PAGE_NUMBER} [ {TOTAL_USERS} ]{L_MARK_ALL} :: {L_UNMARK_ALL}
{L_MARK_ALL} :: {L_UNMARK_ALL}
diff --git a/phpBB/styles/subSilver/template/memberlist_search.html b/phpBB/styles/subSilver/template/memberlist_search.html index 99c509e550..dd104c5fd6 100644 --- a/phpBB/styles/subSilver/template/memberlist_search.html +++ b/phpBB/styles/subSilver/template/memberlist_search.html @@ -28,6 +28,12 @@ self.close(); } + function insert_single(user) + { + opener.document.forms['{S_FORM_NAME}'].{S_FIELD_NAME}.value = user; + self.close(); + } + /** * Mark/unmark checklist * id = ID of parent container, name = name prefix, state = state [true/false] diff --git a/phpBB/styles/subSilver/template/ucp_header.html b/phpBB/styles/subSilver/template/ucp_header.html index dfddea4c8c..ee64e9c1ca 100644 --- a/phpBB/styles/subSilver/template/ucp_header.html +++ b/phpBB/styles/subSilver/template/ucp_header.html @@ -14,7 +14,7 @@
{L_PM_TO}
{L_USERNAME}:{L_USERNAME}:
[ {L_FIND_USERNAME} ]
 {L_USERNAMES}:

+

diff --git a/phpBB/styles/subSilver/template/ucp_zebra_foes.html b/phpBB/styles/subSilver/template/ucp_zebra_foes.html index 1248b6fd2d..d87eed567c 100644 --- a/phpBB/styles/subSilver/template/ucp_zebra_foes.html +++ b/phpBB/styles/subSilver/template/ucp_zebra_foes.html @@ -24,5 +24,7 @@
{S_HIDDEN_FIELDS}  
+ + \ No newline at end of file From 2b35b9d60d42c750485ba84b31818fad0b4e0a91 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 9 Jan 2007 14:10:44 +0000 Subject: [PATCH 180/264] - some bugfixes - bugfixes for the convertor (typecasting for example was totally broken) git-svn-id: file:///svn/phpbb/trunk@6865 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/develop/create_schema_files.php | 6 +-- phpBB/includes/acp/auth.php | 6 +++ phpBB/includes/bbcode.php | 2 +- phpBB/includes/diff/engine.php | 1 + phpBB/includes/functions_convert.php | 15 +++++-- phpBB/includes/message_parser.php | 2 +- phpBB/install/convertors/convert_phpbb20.php | 8 ++-- .../install/convertors/functions_phpbb20.php | 20 ++++----- phpBB/install/database_update.php | 5 +++ phpBB/install/install_convert.php | 43 +++++++++++-------- phpBB/install/schemas/mysql_40_schema.sql | 6 +-- phpBB/install/schemas/mysql_41_schema.sql | 6 +-- phpBB/install/schemas/oracle_schema.sql | 6 +-- phpBB/install/schemas/postgres_schema.sql | 6 +-- phpBB/install/schemas/sqlite_schema.sql | 6 +-- 15 files changed, 82 insertions(+), 56 deletions(-) diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 7f6ee07d44..06c8ca24a6 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1044,9 +1044,9 @@ function get_schema_struct() 'enable_icons' => array('BOOL', 1), 'enable_prune' => array('BOOL', 0), 'prune_next' => array('TIMESTAMP', 0), - 'prune_days' => array('TINT:4', 0), - 'prune_viewed' => array('TINT:4', 0), - 'prune_freq' => array('TINT:4', 0), + 'prune_days' => array('UINT', 0), + 'prune_viewed' => array('UINT', 0), + 'prune_freq' => array('UINT', 0), ), 'PRIMARY_KEY' => 'forum_id', 'KEYS' => array( diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index 26977a6ceb..81ba5cd28b 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -518,12 +518,15 @@ class auth_admin extends auth 'S_GROUP_MODE' => ($user_mode == 'group') ? true : false) ); + @reset($content_array); while (list($forum_id, $forum_array) = each($content_array)) { // Build role dropdown options $current_role_id = (isset($cur_roles[$ug_id][$forum_id])) ? $cur_roles[$ug_id][$forum_id] : 0; $s_role_options = ''; + + @reset($roles); while (list($role_id, $role_row) = each($roles)) { $role_description = (!empty($user->lang[$role_row['role_description']])) ? $user->lang[$role_row['role_description']] : nl2br($role_row['role_description']); @@ -1056,6 +1059,7 @@ class auth_admin extends auth { global $template, $user, $phpbb_admin_path, $phpEx; + @reset($category_array); while (list($cat, $cat_array) = each($category_array)) { $template->assign_block_vars($tpl_cat, array( @@ -1066,6 +1070,7 @@ class auth_admin extends auth 'CAT_NAME' => $user->lang['permission_cat'][$cat]) ); + @reset($cat_array['permissions']); while (list($permission, $allowed) = each($cat_array['permissions'])) { if ($s_view) @@ -1125,6 +1130,7 @@ class auth_admin extends auth $permissions = $permission_row[$forum_id]; ksort($permissions); + @reset($permissions); while (list($permission, $auth_setting) = each($permissions)) { if (!isset($user->lang['acl_' . $permission])) diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index 906094b233..b7f274ce35 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -238,7 +238,7 @@ class bbcode case 6: $this->bbcode_cache[$bbcode_id] = array( 'preg' => array( - '!\[color=(#[0-9a-fA-F]{6}|[a-z\-]+):$uid\](.*?)\[/color:$uid\]!s' => $this->bbcode_tpl('color', $bbcode_id), + '!\[color=(#[0-9a-f]{6}|[a-z\-]+):$uid\](.*?)\[/color:$uid\]!is' => $this->bbcode_tpl('color', $bbcode_id), ) ); break; diff --git a/phpBB/includes/diff/engine.php b/phpBB/includes/diff/engine.php index 456b5233d3..a74fa9d263 100644 --- a/phpBB/includes/diff/engine.php +++ b/phpBB/includes/diff/engine.php @@ -271,6 +271,7 @@ class diff_engine } } + // no reset() here while (list($junk, $y) = each($matches)) { if ($y > $this->seq[$k - 1]) diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index a356101e9a..1d78b29968 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -37,10 +37,13 @@ function still_on_time() // If zero, then set to something higher to not let the user catch the ten seconds barrier. if ($max_execution_time === 0) { - $max_execution_time = 300; + $max_execution_time = 250; } - $max_execution_time = min(max(10, $max_execution_time), 300); + $max_execution_time = min(max(10, ($max_execution_time - 15)), 250); + + // For debugging purposes + // $max_execution_time = 30; global $starttime; $start_time = (empty($starttime)) ? $current_time : $starttime; @@ -1417,8 +1420,12 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting = ACL_NO) $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - $sql = "INSERT INTO $table ($id_field, forum_id, auth_role_id) VALUES ($ug_id, $forum_id, " . $row['role_id'] . ')'; - $db->sql_query($sql); + // If we have no role id there is something wrong here + if ($row) + { + $sql = "INSERT INTO $table ($id_field, forum_id, auth_role_id) VALUES ($ug_id, $forum_id, " . $row['role_id'] . ')'; + $db->sql_query($sql); + } return; } diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 07ba6c5b00..138c7f48bf 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -114,7 +114,7 @@ class bbcode_firstpass extends bbcode 'url' => array('bbcode_id' => 3, 'regexp' => array('#\[url(=(.*))?\](.*)\[/url\]#iUe' => "\$this->validate_url('\$2', '\$3')")), 'img' => array('bbcode_id' => 4, 'regexp' => array('#\[img\](https?://)([a-z0-9\-\.,\?!%\*_:;~\\&$@/=\+]+)\[/img\]#ie' => "\$this->bbcode_img('\$1\$2')")), 'size' => array('bbcode_id' => 5, 'regexp' => array('#\[size=([\-\+]?[1-2]?[0-9])\](.*?)\[/size\]#ise' => "\$this->bbcode_size('\$1', '\$2')")), - 'color' => array('bbcode_id' => 6, 'regexp' => array('!\[color=(#[0-9A-Fa-f]{6}|[a-z\-]+)\](.*?)\[/color\]!ise' => "\$this->bbcode_color('\$1', '\$2')")), + 'color' => array('bbcode_id' => 6, 'regexp' => array('!\[color=(#[0-9a-f]{6}|[a-z\-]+)\](.*?)\[/color\]!ise' => "\$this->bbcode_color('\$1', '\$2')")), 'u' => array('bbcode_id' => 7, 'regexp' => array('#\[u\](.*?)\[/u\]#ise' => "\$this->bbcode_underline('\$1')")), 'list' => array('bbcode_id' => 9, 'regexp' => array('#\[list(?:=(?:[a-z0-9]|disc|circle|square))?].*\[/list]#ise' => "\$this->bbcode_parse_list('\$0')")), 'email' => array('bbcode_id' => 10, 'regexp' => array('#\[email=?(.*?)?\](.*?)\[/email\]#ise' => "\$this->validate_email('\$1', '\$2')")), diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index d2bec49982..92a0f24913 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -390,6 +390,7 @@ if (!$get_info) array('ban_ip', 'banlist.ban_ip', 'decode_ban_ip'), array('ban_userid', 'banlist.ban_userid', 'phpbb_user_id'), + array('ban_email', 'banlist.ban_email', ''), 'where' => "banlist.ban_ip NOT LIKE '%.%'", ), @@ -397,10 +398,11 @@ if (!$get_info) array( 'target' => BANLIST_TABLE, - array('ban_email', 'banlist.ban_email', ''), - array('ban_userid', 'banlist.ban_userid', 'phpbb_user_id'), + array('ban_ip', 'banlist.ban_ip', ''), + array('ban_userid', '0', ''), + array('ban_email', '', ''), - 'where' => "banlist.ban_ip = ''", + 'where' => "banlist.ban_ip LIKE '%.%'", ), array( diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index 2f7edc18cd..b827c113b0 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -749,7 +749,7 @@ function phpbb_convert_authentication($mode) // We only check for ACL_YES equivalence entry if (isset($access[$old_auth_key]) && $access[$old_auth_key] == 1) { - mass_auth('group', $new_forum_id, $access['group_id'], $new_acl, ACL_YES); + mass_auth('group', $new_forum_id, (int) $access['group_id'], $new_acl, ACL_YES); } } } @@ -761,7 +761,7 @@ function phpbb_convert_authentication($mode) // We only check for ACL_YES equivalence entry if (isset($access[$old_auth_key]) && $access[$old_auth_key] == 1) { - mass_auth('user', $new_forum_id, phpbb_user_id($access['user_id']), $new_acl, ACL_YES); + mass_auth('user', $new_forum_id, (int) phpbb_user_id($access['user_id']), $new_acl, ACL_YES); } } } @@ -776,7 +776,7 @@ function phpbb_convert_authentication($mode) // We only check for ACL_YES equivalence entry if (isset($access[$old_auth_key]) && $access[$old_auth_key] == 1) { - mass_auth('group', $new_forum_id, $access['group_id'], $new_acl, ACL_YES); + mass_auth('group', $new_forum_id, (int) $access['group_id'], $new_acl, ACL_YES); } } } @@ -788,7 +788,7 @@ function phpbb_convert_authentication($mode) // We only check for ACL_YES equivalence entry if (isset($access[$old_auth_key]) && $access[$old_auth_key] == 1) { - mass_auth('user', $new_forum_id, phpbb_user_id($access['user_id']), $new_acl, ACL_YES); + mass_auth('user', $new_forum_id, (int) phpbb_user_id($access['user_id']), $new_acl, ACL_YES); } } } @@ -820,7 +820,7 @@ function phpbb_convert_authentication($mode) while ($row = $db->sql_fetchrow($result)) { - mass_auth('user_role', 0, phpbb_user_id($row['user_id']), 'USER_NOAVATAR'); + mass_auth('user_role', 0, (int) phpbb_user_id($row['user_id']), 'USER_NOAVATAR'); } $db->sql_freeresult($result); @@ -832,7 +832,7 @@ function phpbb_convert_authentication($mode) while ($row = $db->sql_fetchrow($result)) { - mass_auth('user_role', 0, phpbb_user_id($row['user_id']), 'USER_NOPM'); + mass_auth('user_role', 0, (int) phpbb_user_id($row['user_id']), 'USER_NOPM'); } $db->sql_freeresult($result); } @@ -848,8 +848,8 @@ function phpbb_convert_authentication($mode) { if (isset($access['auth_mod']) && $access['auth_mod'] == 1) { - mass_auth('user_role', $forum_id, phpbb_user_id($access['user_id']), 'MOD_STANDARD'); - mass_auth('user_role', $forum_id, phpbb_user_id($access['user_id']), 'FORUM_STANDARD'); + mass_auth('user_role', $forum_id, (int) phpbb_user_id($access['user_id']), 'MOD_STANDARD'); + mass_auth('user_role', $forum_id, (int) phpbb_user_id($access['user_id']), 'FORUM_STANDARD'); } } } @@ -862,8 +862,8 @@ function phpbb_convert_authentication($mode) { if (isset($access['auth_mod']) && $access['auth_mod'] == 1) { - mass_auth('group_role', $forum_id, $access['group_id'], 'MOD_STANDARD'); - mass_auth('group_role', $forum_id, $access['group_id'], 'FORUM_STANDARD'); + mass_auth('group_role', $forum_id, (int) $access['group_id'], 'MOD_STANDARD'); + mass_auth('group_role', $forum_id, (int) $access['group_id'], 'FORUM_STANDARD'); } } } diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index a003254df3..90583c8a5a 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -324,6 +324,11 @@ $database_update_info = array( USERS_TABLE => array( 'user_options' => array('UINT:11', 895), ), + FORUMS_TABLE => array( + 'prune_days' => array('UINT', 0), + 'prune_viewed' => array('UINT', 0), + 'prune_freq' => array('UINT', 0), + ), ), // Remove the following keys 'drop_keys' => array( diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index 03ed5d7f40..a4b5629596 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -479,6 +479,24 @@ class install_convert extends module // @todo Need to confirm that max post length in source is <= max post length in destination or there may be interesting formatting issues $config['max_post_chars'] = -1; + $convert->mysql_convert = false; + + switch ($db->sql_layer) + { + // Thanks MySQL, for silently converting... + case 'mysql': + case 'mysql4': + if (version_compare($db->mysql_version, '4.1.3', '>=')) + { + $convert->mysql_convert = true; + } + break; + + case 'mysqli': + $convert->mysql_convert = true; + break; + } + // Set up a user as well. We _should_ have enough of a database here at this point to do this // and it helps for any core code we call $user->session_begin(); @@ -889,24 +907,6 @@ class install_convert extends module $counting = -1; $batch_time = 0; - $convert->mysql_convert = false; - - switch ($db->sql_layer) - { - // Thanks MySQL, for silently converting... - case 'mysql': - case 'mysql4': - if (version_compare($db->mysql_version, '4.1.3', '>=')) - { - $convert->mysql_convert = true; - } - break; - - case 'mysqli': - $convert->mysql_convert = true; - break; - } - while (($counting === -1 || $counting >= $convert->batch_size) && still_on_time()) { $old_current_table = $current_table; @@ -1600,7 +1600,12 @@ class install_convert extends module { if (strpos($type, 'typecast') === 0) { - $value = settype($value, $execution); + if (!is_array($value)) + { + $value = array($value); + } + $value = $value[0]; + settype($value, $execution); } else if (strpos($type, 'function') === 0) { diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index 7ceacea8b9..545642ab74 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -254,9 +254,9 @@ CREATE TABLE phpbb_forums ( enable_icons tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, enable_prune tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, prune_next int(11) UNSIGNED DEFAULT '0' NOT NULL, - prune_days tinyint(4) DEFAULT '0' NOT NULL, - prune_viewed tinyint(4) DEFAULT '0' NOT NULL, - prune_freq tinyint(4) DEFAULT '0' NOT NULL, + prune_days mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + prune_viewed mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + prune_freq mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (forum_id), KEY left_right_id (left_id, right_id), KEY forum_lastpost_id (forum_last_post_id) diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index a34b478be1..05d81ab209 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -254,9 +254,9 @@ CREATE TABLE phpbb_forums ( enable_icons tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, enable_prune tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, prune_next int(11) UNSIGNED DEFAULT '0' NOT NULL, - prune_days tinyint(4) DEFAULT '0' NOT NULL, - prune_viewed tinyint(4) DEFAULT '0' NOT NULL, - prune_freq tinyint(4) DEFAULT '0' NOT NULL, + prune_days mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + prune_viewed mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + prune_freq mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (forum_id), KEY left_right_id (left_id, right_id), KEY forum_lastpost_id (forum_last_post_id) diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index a1d1e129e7..9f3d287e83 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -509,9 +509,9 @@ CREATE TABLE phpbb_forums ( enable_icons number(1) DEFAULT '1' NOT NULL, enable_prune number(1) DEFAULT '0' NOT NULL, prune_next number(11) DEFAULT '0' NOT NULL, - prune_days number(4) DEFAULT '0' NOT NULL, - prune_viewed number(4) DEFAULT '0' NOT NULL, - prune_freq number(4) DEFAULT '0' NOT NULL, + prune_days number(8) DEFAULT '0' NOT NULL, + prune_viewed number(8) DEFAULT '0' NOT NULL, + prune_freq number(8) DEFAULT '0' NOT NULL, CONSTRAINT pk_phpbb_forums PRIMARY KEY (forum_id) ) / diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index a5a3a4b546..d0005a16a7 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -386,9 +386,9 @@ CREATE TABLE phpbb_forums ( enable_icons INT2 DEFAULT '1' NOT NULL CHECK (enable_icons >= 0), enable_prune INT2 DEFAULT '0' NOT NULL CHECK (enable_prune >= 0), prune_next INT4 DEFAULT '0' NOT NULL CHECK (prune_next >= 0), - prune_days INT2 DEFAULT '0' NOT NULL, - prune_viewed INT2 DEFAULT '0' NOT NULL, - prune_freq INT2 DEFAULT '0' NOT NULL, + prune_days INT4 DEFAULT '0' NOT NULL CHECK (prune_days >= 0), + prune_viewed INT4 DEFAULT '0' NOT NULL CHECK (prune_viewed >= 0), + prune_freq INT4 DEFAULT '0' NOT NULL CHECK (prune_freq >= 0), PRIMARY KEY (forum_id) ); diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index d33f38b35a..184d2332ab 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -247,9 +247,9 @@ CREATE TABLE phpbb_forums ( enable_icons INTEGER UNSIGNED NOT NULL DEFAULT '1', enable_prune INTEGER UNSIGNED NOT NULL DEFAULT '0', prune_next INTEGER UNSIGNED NOT NULL DEFAULT '0', - prune_days tinyint(4) NOT NULL DEFAULT '0', - prune_viewed tinyint(4) NOT NULL DEFAULT '0', - prune_freq tinyint(4) NOT NULL DEFAULT '0' + prune_days INTEGER UNSIGNED NOT NULL DEFAULT '0', + prune_viewed INTEGER UNSIGNED NOT NULL DEFAULT '0', + prune_freq INTEGER UNSIGNED NOT NULL DEFAULT '0' ); CREATE INDEX phpbb_forums_left_right_id ON phpbb_forums (left_id, right_id); From 11300e3cebbd3ddffbc8a76516eb7fff2fd84b0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Tue, 9 Jan 2007 14:32:34 +0000 Subject: [PATCH 181/264] Multiple and single recepients now work properly git-svn-id: file:///svn/phpbb/trunk@6866 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/ucp/ucp_pm_compose.php | 5 +++-- phpBB/styles/subSilver/template/ucp_header.html | 12 ++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index ccd61fede1..e81794b101 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -52,6 +52,7 @@ function compose_pm($id, $mode, $action) || $remove_u || $remove_g || $add_to || $add_bcc; $action = ($delete && !$preview && !$refresh && $submit) ? 'delete' : $action; + $select_single = ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) ? false : true; $error = array(); $current_time = time(); @@ -90,8 +91,8 @@ function compose_pm($id, $mode, $action) 'S_SHOW_PM_BOX' => true, 'S_ALLOW_MASS_PM' => ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) ? true : false, 'S_GROUP_OPTIONS' => ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) ? $group_options : '', - 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=post&field=username&select_single=true'), - 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=post&field=username&select_single=true', true)) + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=searchuser&form=post&field=username_list&select_single=$select_single"), + 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=searchuser&form=post&field=username_list&select_single=$select_single", true)) ); } diff --git a/phpBB/styles/subSilver/template/ucp_header.html b/phpBB/styles/subSilver/template/ucp_header.html index ee64e9c1ca..72d96c8a9d 100644 --- a/phpBB/styles/subSilver/template/ucp_header.html +++ b/phpBB/styles/subSilver/template/ucp_header.html @@ -13,21 +13,21 @@ {L_PM_TO} + {L_USERNAME}:
[ {L_FIND_USERNAME} ] + -   +   - + {L_USERNAMES}: -
- +
+ [ {L_FIND_USERNAME} ] From 289998c5e73199c8cef21748bb9750e137167947 Mon Sep 17 00:00:00 2001 From: David M Date: Tue, 9 Jan 2007 20:16:06 +0000 Subject: [PATCH 182/264] #6776 git-svn-id: file:///svn/phpbb/trunk@6867 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_bbcodes.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index 0853de31e0..97a2c92e1c 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -136,20 +136,19 @@ class acp_bbcodes if (substr($data['bbcode_tag'], -1) === '=') { - $open = '\[' . $data['bbcode_tag'] . '.*?]'; - $close = '\[/' . substr($data['bbcode_tag'], 0, -1) . ']'; + $test = substr($data['bbcode_tag'], 0, -1); } else { - $open = '\[' . $data['bbcode_tag'] . ']'; - $close = '\[/' . $data['bbcode_tag'] . ']'; + $test = $data['bbcode_tag']; } - if (!preg_match('#' . $open . '.*?' . $close . '#s', $bbcode_match)) + if (!preg_match('%\\[' . $test . '[^]]*].*?\\[/' . $test . ']%s', $bbcode_match)) { trigger_error($user->lang['BBCODE_OPEN_ENDED_TAG'] . adm_back_link($this->u_action), E_USER_WARNING); } + // @todo - bbcode_tag <= 16, bbcode_helpline <= 255, bbcode_match <= 4000 $sql_ary = array( 'bbcode_tag' => $data['bbcode_tag'], 'bbcode_match' => $bbcode_match, From ccaae47b6ce6a3c0b9e740da863b7e159eccf686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Tue, 9 Jan 2007 20:46:57 +0000 Subject: [PATCH 183/264] Just some minor thing I need git-svn-id: file:///svn/phpbb/trunk@6868 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/mcp/mcp_reports.php | 4 +++- phpBB/language/en/mcp.php | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index 28d065a4db..8484b8fb70 100755 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -337,7 +337,9 @@ class mcp_reports 'PAGINATION' => generate_pagination($this->u_action . "&f=$forum_id&t=$topic_id", $total, $config['topics_per_page'], $start), 'PAGE_NUMBER' => on_page($total, $config['topics_per_page'], $start), 'TOPIC_ID' => $topic_id, - 'TOTAL' => $total) + 'TOTAL' => $total, + 'TOTAL_REPORTS' => ($total == 1) ? $user->lang['LIST_REPORT'] : sprintf($user->lang['LIST_REPORTS'], $total), + ) ); $this->tpl_name = 'mcp_reports'; diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php index 47cd8ed20a..9d3d34c13b 100644 --- a/phpBB/language/en/mcp.php +++ b/phpBB/language/en/mcp.php @@ -209,6 +209,7 @@ $lang = array_merge($lang, array( 'NO_POST_REPORT' => 'This post was not reported.', 'NO_POST_SELECTED' => 'You must select at least one post to perform this action', 'NO_REASON_DISAPPROVAL' => 'Please give an appropiate reason for disapproval', + 'NO_REPORTS' => 'No reports', 'NO_TOPIC_ICON' => 'None', 'NO_TOPIC_SELECTED' => 'You must select at least one topic to perform this action', From 216bf7e324b5b2fcacc6d6f167d23cb0000fc146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Tue, 9 Jan 2007 22:03:49 +0000 Subject: [PATCH 184/264] #6988 Nicely caught by Schumi git-svn-id: file:///svn/phpbb/trunk@6869 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/ucp/ucp_pm_compose.php | 2 +- phpBB/includes/ucp/ucp_pm_options.php | 2 +- phpBB/includes/ucp/ucp_zebra.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index e81794b101..2e7ace4567 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -92,7 +92,7 @@ function compose_pm($id, $mode, $action) 'S_ALLOW_MASS_PM' => ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) ? true : false, 'S_GROUP_OPTIONS' => ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) ? $group_options : '', 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=searchuser&form=post&field=username_list&select_single=$select_single"), - 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=searchuser&form=post&field=username_list&select_single=$select_single", true)) + 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=searchuser&form=post&field=username_list&select_single=$select_single", false)) ); } diff --git a/phpBB/includes/ucp/ucp_pm_options.php b/phpBB/includes/ucp/ucp_pm_options.php index 1aecae4a42..db4d62f472 100644 --- a/phpBB/includes/ucp/ucp_pm_options.php +++ b/phpBB/includes/ucp/ucp_pm_options.php @@ -443,7 +443,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit 'DEFAULT_ACTION' => ($config['full_folder_action'] == 1) ? $user->lang['DELETE_OLDEST_MESSAGES'] : $user->lang['HOLD_NEW_MESSAGES'], 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=rule_string&select_single=true'), - 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=rule_string&select_single=true', true)) + 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=rule_string&select_single=true', false)) ); $rule_lang = $action_lang = $check_lang = array(); diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php index c9478fd01a..a3155870d8 100644 --- a/phpBB/includes/ucp/ucp_zebra.php +++ b/phpBB/includes/ucp/ucp_zebra.php @@ -216,7 +216,7 @@ class ucp_zebra 'L_TITLE' => $user->lang['UCP_ZEBRA_' . $l_mode], 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=add'), - 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=add', true), + 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=ucp&field=add', false), 'S_USERNAME_OPTIONS' => $s_username_options, 'S_HIDDEN_FIELDS' => $s_hidden_fields, From c154f124f8df00f03a40c9eba2f8194c2c990972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Tue, 9 Jan 2007 22:53:51 +0000 Subject: [PATCH 185/264] bullseye git-svn-id: file:///svn/phpbb/trunk@6870 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/styles/subSilver/template/attachment.html | 2 +- phpBB/styles/subSilver/template/bbcode.html | 2 +- phpBB/styles/subSilver/template/mcp_reports.html | 2 +- phpBB/styles/subSilver/template/memberlist_body.html | 2 +- phpBB/styles/subSilver/template/memberlist_im.html | 2 +- phpBB/styles/subSilver/template/memberlist_view.html | 2 +- phpBB/styles/subSilver/template/overall_footer.html | 2 +- phpBB/styles/subSilver/template/posting_review.html | 2 +- phpBB/styles/subSilver/template/simple_footer.html | 2 +- phpBB/styles/subSilver/template/ucp_attachments.html | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/phpBB/styles/subSilver/template/attachment.html b/phpBB/styles/subSilver/template/attachment.html index 8fd64d6d9c..cac901a739 100644 --- a/phpBB/styles/subSilver/template/attachment.html +++ b/phpBB/styles/subSilver/template/attachment.html @@ -10,7 +10,7 @@ - {_file.DOWNLOAD_NAME}
+ {_file.DOWNLOAD_NAME}
{_file.DOWNLOAD_NAME} [ {_file.FILESIZE} {_file.SIZE_LANG} | {_file.L_DOWNLOADED_VIEWED} {_file.L_DOWNLOAD_COUNT} ] diff --git a/phpBB/styles/subSilver/template/bbcode.html b/phpBB/styles/subSilver/template/bbcode.html index abab909699..1f0e8a72d2 100644 --- a/phpBB/styles/subSilver/template/bbcode.html +++ b/phpBB/styles/subSilver/template/bbcode.html @@ -52,7 +52,7 @@ {L_IMAGE} -{DESCRIPTION} +{DESCRIPTION} {DESCRIPTION} diff --git a/phpBB/styles/subSilver/template/mcp_reports.html b/phpBB/styles/subSilver/template/mcp_reports.html index fa4a82602a..e350d96d6d 100644 --- a/phpBB/styles/subSilver/template/mcp_reports.html +++ b/phpBB/styles/subSilver/template/mcp_reports.html @@ -18,7 +18,7 @@ - +

{postrow.POST_SUBJECT}

{L_FORUM}: {postrow.FORUM_NAME}{postrow.FORUM_NAME} {postrow.POST_AUTHOR_FULL}
diff --git a/phpBB/styles/subSilver/template/memberlist_body.html b/phpBB/styles/subSilver/template/memberlist_body.html index 0016190831..d24d3792bd 100644 --- a/phpBB/styles/subSilver/template/memberlist_body.html +++ b/phpBB/styles/subSilver/template/memberlist_body.html @@ -66,7 +66,7 @@ {memberrow.RANK_IMG}{memberrow.RANK_TITLE}  {PM_IMG}   {EMAIL_IMG}  -  {WWW_IMG}  +  {WWW_IMG}   {memberrow.PROFILE_FIELD1_VALUE} diff --git a/phpBB/styles/subSilver/template/memberlist_im.html b/phpBB/styles/subSilver/template/memberlist_im.html index bfb80ec17a..e4be79a200 100644 --- a/phpBB/styles/subSilver/template/memberlist_im.html +++ b/phpBB/styles/subSilver/template/memberlist_im.html @@ -19,7 +19,7 @@ -
{L_IM_ADD_CONTACT}
{L_IM_SEND_MESSAGE}

{L_IM_DOWNLOAD_APP} | {L_IM_AIM_EXPRESS} +
{L_IM_ADD_CONTACT}
{L_IM_SEND_MESSAGE}

{L_IM_DOWNLOAD_APP} | {L_IM_AIM_EXPRESS}   diff --git a/phpBB/styles/subSilver/template/memberlist_view.html b/phpBB/styles/subSilver/template/memberlist_view.html index 70a87aad3e..d4ee7ca895 100644 --- a/phpBB/styles/subSilver/template/memberlist_view.html +++ b/phpBB/styles/subSilver/template/memberlist_view.html @@ -152,7 +152,7 @@ {L_WEBSITE}: - {U_WWW} + {U_WWW} diff --git a/phpBB/styles/subSilver/template/overall_footer.html b/phpBB/styles/subSilver/template/overall_footer.html index 70d359c61f..8fb846a32f 100644 --- a/phpBB/styles/subSilver/template/overall_footer.html +++ b/phpBB/styles/subSilver/template/overall_footer.html @@ -14,7 +14,7 @@
[ {L_ACP} ]

- Powered by phpBB © 2002, 2006 phpBB Group + Powered by phpBB © 2002, 2006 phpBB Group
{TRANSLATION_INFO}
[ {DEBUG_OUTPUT} ]
diff --git a/phpBB/styles/subSilver/template/posting_review.html b/phpBB/styles/subSilver/template/posting_review.html index 0d4d5cd71d..5dae2a6c82 100644 --- a/phpBB/styles/subSilver/template/posting_review.html +++ b/phpBB/styles/subSilver/template/posting_review.html @@ -57,7 +57,7 @@ - +
 {post_review_row.MINI_POST_IMG}{post_review_row.MINI_POST_IMG} {L_POSTED}: {post_review_row.POST_DATE}
diff --git a/phpBB/styles/subSilver/template/simple_footer.html b/phpBB/styles/subSilver/template/simple_footer.html index a7d656404b..b8f1cc865b 100644 --- a/phpBB/styles/subSilver/template/simple_footer.html +++ b/phpBB/styles/subSilver/template/simple_footer.html @@ -13,7 +13,7 @@ //-->
- Powered by phpBB © 2002, 2006 phpBB Group + Powered by phpBB © 2002, 2006 phpBB Group
diff --git a/phpBB/styles/subSilver/template/ucp_attachments.html b/phpBB/styles/subSilver/template/ucp_attachments.html index 4e3a12cb3b..42f7b50e35 100644 --- a/phpBB/styles/subSilver/template/ucp_attachments.html +++ b/phpBB/styles/subSilver/template/ucp_attachments.html @@ -28,7 +28,7 @@  {attachrow.ROW_NUMBER}  - {attachrow.FILENAME}
{L_PM}: {L_TOPIC}: {attachrow.TOPIC_TITLE} + {attachrow.FILENAME}
{L_PM}: {L_TOPIC}: {attachrow.TOPIC_TITLE}  {attachrow.POST_TIME}  {attachrow.SIZE} {attachrow.DOWNLOAD_COUNT} From 31ee257ab8232072676df0d4d354ff7a5a0b1416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Wed, 10 Jan 2007 00:23:37 +0000 Subject: [PATCH 186/264] #6998 MY EYES, MY EYES ... did I ever mention that I hate tables that are abused for layout purposes? git-svn-id: file:///svn/phpbb/trunk@6871 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/styles/subSilver/template/login_body.html | 2 +- phpBB/styles/subSilver/template/mcp_queue.html | 8 ++++---- .../styles/subSilver/template/memberlist_group.html | 2 +- .../styles/subSilver/template/ucp_groups_manage.html | 12 ++++++------ phpBB/styles/subSilver/template/viewtopic_body.html | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/phpBB/styles/subSilver/template/login_body.html b/phpBB/styles/subSilver/template/login_body.html index 70e147fca8..6e7f19babb 100644 --- a/phpBB/styles/subSilver/template/login_body.html +++ b/phpBB/styles/subSilver/template/login_body.html @@ -86,7 +86,7 @@ - {S_HIDDEN_FIELDS} + colspan="2" align="center">{S_HIDDEN_FIELDS} diff --git a/phpBB/styles/subSilver/template/mcp_queue.html b/phpBB/styles/subSilver/template/mcp_queue.html index d12928d50c..0cca2159bb 100644 --- a/phpBB/styles/subSilver/template/mcp_queue.html +++ b/phpBB/styles/subSilver/template/mcp_queue.html @@ -4,10 +4,10 @@ - + - + @@ -27,11 +27,11 @@ - + - +
{L_DISPLAY_OPTIONS}{L_DISPLAY_OPTIONS}
{L_DISPLAY_ITEMS}: {S_SELECT_SORT_DAYS} {L_SORT_BY} {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} {L_FORUM}     {L_ONLY_TOPIC}   {L_DISPLAY_ITEMS}: {S_SELECT_SORT_DAYS} {L_SORT_BY} {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} {L_FORUM}     {L_ONLY_TOPIC}  
 {L_TOPIC}{L_POST} 
{L_NO_POSTS}{L_NO_POSTS}
    
diff --git a/phpBB/styles/subSilver/template/memberlist_group.html b/phpBB/styles/subSilver/template/memberlist_group.html index 4a9b1ddbe0..650868f810 100644 --- a/phpBB/styles/subSilver/template/memberlist_group.html +++ b/phpBB/styles/subSilver/template/memberlist_group.html @@ -1,7 +1,7 @@ - + diff --git a/phpBB/styles/subSilver/template/ucp_groups_manage.html b/phpBB/styles/subSilver/template/ucp_groups_manage.html index 80113b08ad..d42a4b7fc6 100644 --- a/phpBB/styles/subSilver/template/ucp_groups_manage.html +++ b/phpBB/styles/subSilver/template/ucp_groups_manage.html @@ -227,18 +227,18 @@
{L_GROUP_INFORMATION}{L_GROUP_INFORMATION}
{L_GROUP_NAME}:
- + - + - + - + @@ -250,12 +250,12 @@ - + - +
{L_USERGROUPS}{L_USERGROUPS}
{L_GROUPS_EXPLAIN}{L_GROUPS_EXPLAIN}
{L_GROUP_DETAILS}{L_OPTIONS}{L_OPTIONS}
{L_GROUP_LEADER}{L_GROUP_LEADER}
{L_NO_LEADERS}{L_NO_LEADERS}
  
diff --git a/phpBB/styles/subSilver/template/viewtopic_body.html b/phpBB/styles/subSilver/template/viewtopic_body.html index dcd62dca13..e3bb8c2fa2 100644 --- a/phpBB/styles/subSilver/template/viewtopic_body.html +++ b/phpBB/styles/subSilver/template/viewtopic_body.html @@ -42,7 +42,7 @@ - - From 7c18792a6e2c3481ec073828039c31c18d922167 Mon Sep 17 00:00:00 2001 From: David M Date: Thu, 11 Jan 2007 03:59:17 +0000 Subject: [PATCH 194/264] #7034 git-svn-id: file:///svn/phpbb/trunk@6879 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/convertors/convert_phpbb20.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index 92a0f24913..219ef788bd 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -797,7 +797,7 @@ if (!$get_info) array('user_password', 'users.user_password', ''), array('user_pass_convert', 1, ''), array('user_posts', 'users.user_posts', ''), - array('user_email', 'users.user_email', ''), + array('user_email', 'users.user_email', 'strtolower'), array('user_email_hash', 'users.user_email', 'gen_email_hash'), array('user_birthday', ((defined('MOD_BIRTHDAY')) ? 'users.user_birthday' : ''), 'phpbb_get_birthday'), array('user_lastvisit', 'users.user_lastvisit', ''), From 3a2a61baa4642eb91d2003ac47c8dc91ad9e1ef2 Mon Sep 17 00:00:00 2001 From: David M Date: Thu, 11 Jan 2007 05:44:22 +0000 Subject: [PATCH 195/264] #6772 - some other random things git-svn-id: file:///svn/phpbb/trunk@6880 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/acp_ban.html | 6 +++--- phpBB/adm/style/acp_bots.html | 6 +++--- phpBB/adm/style/acp_disallow.html | 2 +- phpBB/adm/style/acp_forums.html | 16 ++++++++-------- phpBB/adm/style/acp_icons.html | 4 ++-- phpBB/adm/style/acp_language.html | 6 +++--- phpBB/adm/style/acp_modules.html | 2 +- phpBB/adm/style/acp_permission_roles.html | 4 ++-- phpBB/adm/style/acp_ranks.html | 2 +- phpBB/adm/style/acp_reasons.html | 2 +- phpBB/adm/style/acp_words.html | 4 ++-- phpBB/includes/acp/acp_attachments.php | 15 +++++++++++++++ phpBB/includes/acp/acp_bbcodes.php | 11 ++++++++++- phpBB/includes/acp/acp_forums.php | 10 ++++++++++ phpBB/includes/acp/acp_icons.php | 2 +- phpBB/includes/acp/acp_permission_roles.php | 5 +++++ phpBB/includes/acp/acp_ranks.php | 5 +++++ phpBB/includes/acp/acp_reasons.php | 2 +- phpBB/includes/functions_posting.php | 2 +- phpBB/includes/functions_user.php | 10 ++++++++++ phpBB/language/en/acp/forums.php | 2 ++ phpBB/language/en/acp/permissions.php | 1 + phpBB/language/en/acp/posting.php | 3 ++- phpBB/search.php | 2 +- 24 files changed, 91 insertions(+), 33 deletions(-) diff --git a/phpBB/adm/style/acp_ban.html b/phpBB/adm/style/acp_ban.html index eb42592f81..5f267aaa98 100644 --- a/phpBB/adm/style/acp_ban.html +++ b/phpBB/adm/style/acp_ban.html @@ -51,7 +51,7 @@
-
(YYYY-MM-DD)
+
(YYYY-MM-DD)

{L_BAN_EXCLUDE_EXPLAIN}
@@ -59,11 +59,11 @@
-
+
-
+

diff --git a/phpBB/adm/style/acp_bots.html b/phpBB/adm/style/acp_bots.html index 0c4e718353..6b531f545e 100644 --- a/phpBB/adm/style/acp_bots.html +++ b/phpBB/adm/style/acp_bots.html @@ -23,7 +23,7 @@ {L_TITLE}


{L_BOT_NAME_EXPLAIN}
-
+

{L_BOT_STYLE_EXPLAIN}
@@ -39,11 +39,11 @@

{L_BOT_AGENT_EXPLAIN}
-
+

{L_BOT_IP_EXPLAIN}
-
+

diff --git a/phpBB/adm/style/acp_disallow.html b/phpBB/adm/style/acp_disallow.html index 14e7c392c2..6486f66c32 100644 --- a/phpBB/adm/style/acp_disallow.html +++ b/phpBB/adm/style/acp_disallow.html @@ -12,7 +12,7 @@ {L_ADD_DISALLOW_TITLE}


{L_ADD_DISALLOW_EXPLAIN}
-
+

diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html index 46223ea81d..5156604ee6 100644 --- a/phpBB/adm/style/acp_forums.html +++ b/phpBB/adm/style/acp_forums.html @@ -143,23 +143,23 @@

-
+

{L_FORUM_DESC_EXPLAIN}
-
+
checked="checked" /> {L_PARSE_BBCODE}   checked="checked" /> {L_PARSE_SMILIES}   checked="checked" /> {L_PARSE_URLS}

{L_FORUM_IMAGE_EXPLAIN}
-
+
{L_FORUM_IMAGE}

{L_FORUM_PASSWORD_EXPLAIN}
-
+

{L_FORUM_PASSWORD_CONFIRM_EXPLAIN}
@@ -232,7 +232,7 @@

{L_AUTO_PRUNE_DAYS_EXPLAIN}
-
{L_DAYS}
+
{L_DAYS}

{L_AUTO_PRUNE_VIEWED_EXPLAIN}
@@ -264,7 +264,7 @@

{L_FORUM_LINK_EXPLAIN}
-
+

{L_FORUM_LINK_TRACK_EXPLAIN}
@@ -278,7 +278,7 @@ {L_FORUM_RULES}

{L_FORUM_RULES_LINK_EXPLAIN}
-
+
@@ -467,7 +467,7 @@
- +
diff --git a/phpBB/adm/style/acp_icons.html b/phpBB/adm/style/acp_icons.html index 3a95e5ebf7..302324240d 100644 --- a/phpBB/adm/style/acp_icons.html +++ b/phpBB/adm/style/acp_icons.html @@ -45,8 +45,8 @@
- - + + diff --git a/phpBB/adm/style/acp_language.html b/phpBB/adm/style/acp_language.html index 37b1e032f2..2eea79e8bd 100644 --- a/phpBB/adm/style/acp_language.html +++ b/phpBB/adm/style/acp_language.html @@ -36,11 +36,11 @@ {LANG_LOCAL_NAME}
-
+
-
+
@@ -48,7 +48,7 @@
-
+

diff --git a/phpBB/adm/style/acp_modules.html b/phpBB/adm/style/acp_modules.html index 25920f7577..ecc8fe4c61 100644 --- a/phpBB/adm/style/acp_modules.html +++ b/phpBB/adm/style/acp_modules.html @@ -192,7 +192,7 @@ - + diff --git a/phpBB/adm/style/acp_permission_roles.html b/phpBB/adm/style/acp_permission_roles.html index d8bbeb33dd..fd787dbe10 100644 --- a/phpBB/adm/style/acp_permission_roles.html +++ b/phpBB/adm/style/acp_permission_roles.html @@ -68,7 +68,7 @@ {L_ROLE_DETAILS}

-
+

{L_ROLE_DESCRIPTION_EXPLAIN}
@@ -210,7 +210,7 @@
+ -
- - - - -
-
- +
-
-
- -
-
-
- +
+ + + +
+
+ +
+
- -
+
+ - - - -
+ +
-
- - {checks.LEGEND} -

{checks.LEGEND_EXPLAIN}

- - -
-
{checks.TITLE}:
{checks.TITLE_EXPLAIN}
-
{checks.RESULT}
-
- - - -
- - - -
- - - - + + +
- +
+ + {checks.LEGEND} +

{checks.LEGEND_EXPLAIN}

+ + +
+
{checks.TITLE}:
{checks.TITLE_EXPLAIN}
+
{checks.RESULT}
+
- {options.LEGEND} - + -
-

{options.TITLE_EXPLAIN}
-
{options.CONTENT}
-
+
+ - - + +
-
+ + + +
+ +
+ + {options.LEGEND} + + +
+

{options.TITLE_EXPLAIN}
+
{options.CONTENT}
+
+ + + + +
+ + + +
+

{L_MESSAGE}

+ {S_HIDDEN} + +
+ + + - -
-

{L_MESSAGE}

- {S_HIDDEN} - -
- - - - \ No newline at end of file diff --git a/phpBB/adm/style/install_install.html b/phpBB/adm/style/install_install.html index 91a7f25480..fb8c1bdf0c 100755 --- a/phpBB/adm/style/install_install.html +++ b/phpBB/adm/style/install_install.html @@ -2,7 +2,7 @@
-

{TITLE}

+

{TITLE}

{BODY}

@@ -54,7 +54,7 @@ -

{L_DL_CONFIG}

+

{L_DL_CONFIG}

{L_DL_CONFIG_EXPLAIN}

diff --git a/phpBB/adm/style/install_main.html b/phpBB/adm/style/install_main.html index 9d125a42eb..2c318bfd65 100755 --- a/phpBB/adm/style/install_main.html +++ b/phpBB/adm/style/install_main.html @@ -1,6 +1,6 @@ -

{TITLE}

+

{TITLE}

{BODY}

\ No newline at end of file diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html index 33b2bb6b8d..0549671b95 100644 --- a/phpBB/docs/coding-guidelines.html +++ b/phpBB/docs/coding-guidelines.html @@ -862,7 +862,7 @@ $sql_array = array( 'FROM' => array(FORUMS_TRACK_TABLE => 'ft'), 'ON' => 'ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id' ) - ); + ), 'WHERE' => 'fw.user_id = ' . $user->data['user_id'] . ' AND f.forum_id = fw.forum_id', diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php index 16f75d9c92..e83445eeed 100644 --- a/phpBB/includes/acp/acp_language.php +++ b/phpBB/includes/acp/acp_language.php @@ -241,6 +241,9 @@ class acp_language $entry .= "\t),\n"; fwrite($fp, $entry); } + + $footer = ");\n\n?>"; + fwrite($fp, $footer); } else { @@ -253,10 +256,10 @@ class acp_language $entry = $this->format_lang_array($key, $value); fwrite($fp, $entry); } - } - $footer = "));\n\n?>"; - fwrite($fp, $footer); + $footer = "));\n\n?>"; + fwrite($fp, $footer); + } } fclose($fp); diff --git a/phpBB/includes/acp/acp_search.php b/phpBB/includes/acp/acp_search.php index 342ec34e29..ad3e770fbb 100644 --- a/phpBB/includes/acp/acp_search.php +++ b/phpBB/includes/acp/acp_search.php @@ -338,7 +338,9 @@ class acp_search while ($row = $db->sql_fetchrow($result)) { - if ($forums[$row['forum_id']]) + // Indexing enabled for this forum or global announcement? + // Global announcements get indexed by default. + if (!$row['forum_id'] || (isset($forums[$row['forum_id']]) && $forums[$row['forum_id']])) { $this->search->index('post', $row['post_id'], $row['post_text'], $row['post_subject'], $row['poster_id'], $row['forum_id']); } diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index 1d78b29968..499d62de3d 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -985,7 +985,7 @@ function set_user_options() foreach ($keyoptions as $key => $key_ary) { - $value = (isset($row[$key])) ? (int) $row[$key] : $key_ary['default']; + $value = (isset($convert_row[$key])) ? (int) $convert_row[$key] : $key_ary['default']; if ($value && !($option_field & 1 << $key_ary['bit'])) { @@ -1158,7 +1158,7 @@ function get_config() } else if ($convert->config_schema['table_format'] == 'file') { - $filename = $convert->convertor_status['forum_path'] . '/' . $convert->config_schema['filename']; + $filename = $convert->options['forum_path'] . '/' . $convert->config_schema['filename']; if (!file_exists($filename)) { $convert->p_master->error($user->lang['FILE_NOT_FOUND'] . ': ' . $filename, __LINE__, __FILE__); @@ -2278,7 +2278,7 @@ function relative_base($path, $is_relative = true, $line = false, $file = false) return $path; } - if (empty($convert->convertor_status['forum_path']) && $is_relative) + if (empty($convert->options['forum_path']) && $is_relative) { $line = $line ? $line : __LINE__; $file = $file ? $file : __FILE__; @@ -2286,7 +2286,7 @@ function relative_base($path, $is_relative = true, $line = false, $file = false) $convert->p_master->error($user->lang['CONV_ERROR_NO_FORUM_PATH'], $line, $file); } - return $convert->convertor_status['forum_path'] . '/' . $path; + return $convert->options['forum_path'] . '/' . $path; } ?> \ No newline at end of file diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index 119f496d21..c97fc99652 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -799,6 +799,7 @@ class ucp_groups group_user_attributes('default', $group_id, $mark_ary, false, $group_row['group_name'], $group_row); } + group_update_listings($group_id); $user->add_lang('acp/groups'); trigger_error($user->lang['GROUP_DEFS_UPDATED'] . $return_page); diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index b827c113b0..5923c92ac1 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -341,7 +341,7 @@ function phpbb_set_encoding($text, $grab_user_lang = true) if (!isset($lang_enc_array[$get_lang])) { - $filename = $convert->convertor_status['forum_path'] . '/language/lang_' . $get_lang . '/lang_main.' . $phpEx; + $filename = $convert->options['forum_path'] . '/language/lang_' . $get_lang . '/lang_main.' . $phpEx; if (!file_exists($filename)) { @@ -350,7 +350,7 @@ function phpbb_set_encoding($text, $grab_user_lang = true) if (!isset($lang_enc_array[$get_lang])) { - include($convert->convertor_status['forum_path'] . '/language/lang_' . $get_lang . '/lang_main.' . $phpEx); + include($convert->options['forum_path'] . '/language/lang_' . $get_lang . '/lang_main.' . $phpEx); $lang_enc_array[$get_lang] = $lang['ENCODING']; unset($lang); } @@ -1150,7 +1150,7 @@ function phpbb_copy_thumbnails() { global $db, $convert, $user, $config, $cache, $phpbb_root_path; - $src_path = $convert->convertor_status['forum_path'] . '/' . phpbb_get_files_dir() . '/thumbs/'; + $src_path = $convert->options['forum_path'] . '/' . phpbb_get_files_dir() . '/thumbs/'; if ($handle = @opendir($src_path)) { diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index a4b5629596..242e6b9ff5 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -32,7 +32,7 @@ if (!empty($setmodules)) class convert { - var $convertor_status = array(); + var $options = array(); var $convertor_tag = ''; var $src_table_prefix = ''; @@ -96,7 +96,15 @@ class install_convert extends module if (!defined('PHPBB_INSTALLED')) { - $this->p_master->redirect("index.$phpEx?mode=install"); + $config['load_tplcompile'] = true; + + $template->assign_vars(array( + 'S_NOT_INSTALLED' => true, + 'TITLE' => $lang['BOARD_NOT_INSTALLED'], + 'BODY' => sprintf($lang['BOARD_NOT_INSTALLED_EXPLAIN'], append_sid($phpbb_root_path . 'install/index.' . $phpEx, 'mode=install')), + )); + + return; } require($phpbb_root_path . 'config.' . $phpEx); @@ -132,16 +140,15 @@ class install_convert extends module } // Let's see if there is a conversion in the works... - $convertor_status = array(); + $options = array(); if (isset($config['convert_progress'])) { - $convertor_status = unserialize($config['convert_progress']); - // $convertor_status['forum_address'] = $config['conv_forum_address']; - $convertor_status['forum_path'] = $config['conv_forum_path']; + $options = unserialize($config['convert_progress']); + $options = array_merge($options, unserialize($config['convert_options'])); } // This information should have already been checked once, but do it again for safety - if (!empty($convertor_status) && !empty($convertor_status['tag']) && isset($convertor_status['table_prefix'])) + if (!empty($options) && !empty($options['tag']) && isset($options['table_prefix'])) { $this->page_title = $lang['CONTINUE_CONVERT']; @@ -153,7 +160,7 @@ class install_convert extends module 'S_CONTINUE' => true, 'U_NEW_ACTION' => $this->p_master->module_url . "?mode=$mode&sub=intro&new_conv=1", - 'U_CONTINUE_ACTION' => $this->p_master->module_url . "?mode=$mode&sub=in_progress&tag={$convertor_status['tag']}{$convertor_status['step']}", + 'U_CONTINUE_ACTION' => $this->p_master->module_url . "?mode=$mode&sub=in_progress&tag={$options['tag']}{$options['step']}", )); return; @@ -302,7 +309,8 @@ class install_convert extends module $submit = (isset($_POST['submit'])) ? true : false; $src_table_prefix = request_var('src_table_prefix', $convertor_data['table_prefix']); - $src_path = request_var('src_path', $convertor_data['forum_path']); + $forum_path = request_var('forum_path', $convertor_data['forum_path']); + $refresh = request_var('refresh', 1); // Default URL of the old board // @todo Are we going to use this for attempting to convert URL references in posts, or should we remove it? @@ -312,9 +320,9 @@ class install_convert extends module $error = array(); if ($submit) { - if (!file_exists('./../' . $src_path . '/' . $test_file)) + if (!file_exists('./../' . $forum_path . '/' . $test_file)) { - $error[] = sprintf($lang['COULD_NOT_FIND_PATH'], $src_path); + $error[] = sprintf($lang['COULD_NOT_FIND_PATH'], $forum_path); } // The forum prefix of the old and the new forum can't be the same because the @@ -384,8 +392,9 @@ class install_convert extends module { // Save convertor Status set_config('convert_progress', serialize(array('step' => '', 'table_prefix' => $src_table_prefix, 'tag' => $convertor_tag)), true); - // set_config('conv_forum_address', $src_url, true); // @todo See note above about this variable - set_config('conv_forum_path', './../' . $src_path, true); + + // Save options + set_config('convert_options', serialize(array('forum_path' => './../' . $forum_path, 'refresh' => $refresh)), true); $template->assign_block_vars('checks', array( 'TITLE' => $lang['SPECIFY_OPTIONS'], @@ -508,23 +517,22 @@ class install_convert extends module $this->page_title = $user->lang['STAGE_IN_PROGRESS']; - $convert->convertor_status = array(); + $convert->options = array(); if (isset($config['convert_progress'])) { - $convert->convertor_status = unserialize($config['convert_progress']); - // $convert->convertor_status['forum_address'] = $config['conv_forum_address']; - $convert->convertor_status['forum_path'] = $config['conv_forum_path']; + $convert->options = unserialize($config['convert_progress']); + $convert->options = array_merge($convert->options, unserialize($config['convert_options'])); } // This information should have already been checked once, but do it again for safety - if (empty($convert->convertor_status) || empty($convert->convertor_status['tag']) || !isset($convert->convertor_status['table_prefix'])) + if (empty($convert->options) || empty($convert->options['tag']) || !isset($convert->options['table_prefix'])) { $this->p_master->error($user->lang['NO_CONVERT_SPECIFIED'], __LINE__, __FILE__); } // Make some short variables accessible, for easier referencing - $convert->convertor_tag = basename($convert->convertor_status['tag']); - $convert->src_table_prefix = $convert->convertor_status['table_prefix']; + $convert->convertor_tag = basename($convert->options['tag']); + $convert->src_table_prefix = $convert->options['table_prefix']; $convert->truncate_statement = ($db->sql_layer != 'sqlite') ? 'TRUNCATE TABLE ' : 'DELETE FROM '; $get_info = false; @@ -558,9 +566,9 @@ class install_convert extends module $convert->convertor = $convertor; // The test_file is a file that should be present in the location of the old board. - if (!file_exists($convert->convertor_status['forum_path'] . '/' . $test_file)) + if (!file_exists($convert->options['forum_path'] . '/' . $test_file)) { - $this->p_master->error(sprintf($user->lang['COULD_NOT_FIND_PATH'], $convert->convertor_status['forum_path']), __LINE__, __FILE__); + $this->p_master->error(sprintf($user->lang['COULD_NOT_FIND_PATH'], $convert->options['forum_path']), __LINE__, __FILE__); } $search_type = $config['search_type']; @@ -1177,7 +1185,7 @@ class install_convert extends module $sync_batch = -1; $db->sql_query('DELETE FROM ' . CONFIG_TABLE . " - WHERE config_name = 'convert_progress' OR config_name = 'conv_forum_path' OR config_name = 'conv_forum_address'"); + WHERE config_name = 'convert_progress' OR config_name = 'convert_options'"); $db->sql_query('DELETE FROM ' . SESSIONS_TABLE); @unlink($phpbb_root_path . 'cache/data_global.php'); @@ -1204,7 +1212,7 @@ class install_convert extends module $step = '&sync_batch=' . $sync_batch; // Save convertor Status - set_config('convert_progress', serialize(array('step' => $step, 'table_prefix' => $convert->convertor_status['table_prefix'], 'tag' => $convert->convertor_tag)), true); + set_config('convert_progress', serialize(array('step' => $step, 'table_prefix' => $convert->options['table_prefix'], 'tag' => $convert->convertor_tag)), true); $url = $this->p_master->module_url . "?mode=$this->mode&sub=in_progress&tag={$convert->convertor_tag}$step"; @@ -1692,9 +1700,11 @@ class install_convert extends module */ function meta_refresh($url) { - if (!defined('DEBUG_EXTRA')) + global $convert; + + if ($convert->options['refresh']) { - // meta_refresh(5, $url); + meta_refresh(5, $url); } } @@ -1705,7 +1715,8 @@ class install_convert extends module 'legend1' => 'SPECIFY_OPTIONS', 'src_table_prefix' => array('lang' => 'TABLE_PREFIX', 'type' => 'text:25:100', 'explain' => false), //'src_url' => array('lang' => 'FORUM_ADDRESS', 'type' => 'text:50:100', 'explain' => true), - 'src_path' => array('lang' => 'FORUM_PATH', 'type' => 'text:25:100', 'explain' => true), + 'forum_path' => array('lang' => 'FORUM_PATH', 'type' => 'text:25:100', 'explain' => true), + 'refresh' => array('lang' => 'REFRESH_PAGE', 'type' => 'radio:yes_no', 'explain' => true), ); } diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 38dc491665..829c21d29a 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -515,7 +515,6 @@ class install_install extends module } $dbpasswd = htmlspecialchars_decode($dbpasswd); - $connect_test = $this->connect_check_db(true, $error, $dbms, $table_prefix, $dbhost, $dbuser, $dbpasswd, $dbname, $dbport); $template->assign_block_vars('checks', array( diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index c8546325a8..846334a65b 100755 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -43,8 +43,10 @@ $lang = array_merge($lang, array( 'AVAILABLE' => 'Available', 'AVAILABLE_CONVERTORS' => 'Available convertors', - 'BEGIN_CONVERT' => 'Begin conversion', - 'BLANK_PREFIX_FOUND' => 'A scan of your tables has shown a valid installation using no table prefix.', + 'BEGIN_CONVERT' => 'Begin conversion', + 'BLANK_PREFIX_FOUND' => 'A scan of your tables has shown a valid installation using no table prefix.', + 'BOARD_NOT_INSTALLED' => 'No installation found', + 'BOARD_NOT_INSTALLED_EXPLAIN' => 'To perform a conversion you need to have a default installation of phpBB3. Please note that for a conversion the new installation and the old installation need to reside within the same database. You may now want to perform an installation.', 'CATEGORY' => 'Category', 'CACHE_STORE' => 'Cache type', @@ -258,6 +260,8 @@ $lang = array_merge($lang, array( 'PRE_CONVERT_COMPLETE' => 'All pre-conversion steps have successfully been completed. You may now begin the actual conversion process.', 'PROCESS_LAST' => 'Processing last statements', + 'REFRESH_PAGE' => 'Refresh page to continue conversion', + 'REFRESH_PAGE_EXPLAIN' => 'If set to yes, the convertor will refresh the page to continue the conversion after having finished a step. If this is your first conversion for testing purposes and to determine any errors in advance, we suggest to set this to No.', // 'REQUIRED' => 'Required', 'REQUIREMENTS_TITLE' => 'Installation compatibility', 'REQUIREMENTS_EXPLAIN' => 'Before proceeding with full installation phpBB will carry out some tests on your server configuration and files to ensure that you are able to install and run phpBB. Please ensure you read through the results thoroughly and do not proceed until all the required tests are passed. If you wish to enable any of the functionality listed by the optional tests, you should ensure that these tests are passed also.', diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index dad73d8a64..340fc1e02c 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -515,8 +515,8 @@ switch ($mode) 'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_id) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&u={$user_id}") : '', 'S_ZEBRA' => ($user->data['user_id'] != $user_id && $user->data['is_registered'] && $zebra_enabled) ? true : false, - 'U_ADD_FRIEND' => (!$friend) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&add=' . urlencode($member['username'])) : '', - 'U_ADD_FOE' => (!$foe) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&mode=foes&add=' . urlencode($member['username'])) : '', + 'U_ADD_FRIEND' => (!$friend) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&add=' . urlencode(htmlspecialchars_decode($member['username']))) : '', + 'U_ADD_FOE' => (!$foe) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&mode=foes&add=' . urlencode(htmlspecialchars_decode($member['username']))) : '', 'U_REMOVE_FRIEND' => ($friend) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&remove=1&usernames[]=' . $user_id) : '', 'U_REMOVE_FOE' => ($foe) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=zebra&remove=1&usernames[]=' . $user_id) : '', )); From d46d56f9566ab171e6148e9014d8db335865f62c Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 10 Jan 2007 16:54:27 +0000 Subject: [PATCH 188/264] hmm, no, this was not meant to go in git-svn-id: file:///svn/phpbb/trunk@6873 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/install_convert.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index 242e6b9ff5..0227b0316d 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -96,8 +96,6 @@ class install_convert extends module if (!defined('PHPBB_INSTALLED')) { - $config['load_tplcompile'] = true; - $template->assign_vars(array( 'S_NOT_INSTALLED' => true, 'TITLE' => $lang['BOARD_NOT_INSTALLED'], From 2c4d3771ff9568479a23a8d15dc032f7dec11f75 Mon Sep 17 00:00:00 2001 From: Jonathan Stanley Date: Wed, 10 Jan 2007 18:13:04 +0000 Subject: [PATCH 189/264] Changed the example date from 2005-01-10T17:57Z to 2007-01-01T13:37Z to better illustrate the difference between "d" and "j" in the PHP date(). Also, since phpBB's language files tend towards formal, using "jS" (for 1st, 2nd, 3rd, etc) as opposed to just "s". Translators should pick whatever appropiate set of date format codes for their own locale, since PHP* doesn't offer any number ordinal suffixes apart from English. :( * PHP6.x probably will/could, though that's a long way of from being the _minimum_ required version for any current PHP app. git-svn-id: file:///svn/phpbb/trunk@6874 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/common.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index 13669eba50..af451a3efb 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -35,7 +35,7 @@ $lang = array_merge($lang, array( 'DIRECTION' => 'ltr', 'LEFT' => 'left', 'RIGHT' => 'right', - 'DATE_FORMAT' => '|d M Y|', + 'DATE_FORMAT' => '|d M Y|', // 01 Jan 2007 (with Relative days enabled) 'USER_LANG' => 'en-gb', '1_DAY' => '1 day', @@ -764,17 +764,17 @@ $lang = array_merge($lang, array( // The value is only an example and will get replaced by the current time on view 'dateformats' => array( - '|d M Y| H:i' => '10 Jan 2005 17:54 [Relative days]', - 'd M Y, H:i' => '10 Jan 2005, 17:57', - 'd M Y H:i' => '10 Jan 2005 17:57', - 'D M d, Y g:i a' => 'Mon Jan 10, 2005 5:57 pm', - 'M j, y, H:i' => 'Jan 10, 05, 5:57 pm', - 'F j, Y, g:i a' => 'January 10, 2005, 5:57 pm' + '|d M Y| H:i' => '01 Jan 2007 13:37 [Relative days]', + 'd M Y, H:i' => '01 Jan 2007, 13:37', + 'd M Y H:i' => '01 Jan 2007 13:37', + 'D M d, Y g:i a' => 'Mon Jan 01, 2007 1:37 pm', + 'M jS, y, H:i' => 'Jan 1st, 07, 1:37 pm', + 'F jS, Y, g:i a' => 'January 1st, 2007, 1:37 pm' ), // The default dateformat which will be used on new installs in this language // Translators should change this if a the usual date format is different - 'default_dateformat' => 'D M d, Y g:i a', // Mon Jan 10, 2005 5:57 pm + 'default_dateformat' => 'D M d, Y g:i a', // Mon Jan 01, 2007 1:37 pm )); From 96ac0fe0a2909c2d48d0a0b771a826da41d45d38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Wed, 10 Jan 2007 18:24:48 +0000 Subject: [PATCH 190/264] #7006 git-svn-id: file:///svn/phpbb/trunk@6875 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_permissions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index f9daf1c1e5..435125f3ee 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -394,8 +394,8 @@ class acp_permissions 'S_DEFINED_USER_OPTIONS' => $items['user_ids_options'], 'S_DEFINED_GROUP_OPTIONS' => $items['group_ids_options'], 'S_ADD_GROUP_OPTIONS' => group_select_options(false, $items['group_ids'], (($user->data['user_type'] == USER_FOUNDER) ? false : 0)), - 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=add_user&field=username'), - 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=add_user&field=username', false)) + 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=add_user&field=username&select_single=true'), + 'UA_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=add_user&field=username&select_single=true', false)) ); break; From 8e1adf93b61828923090f2f5c8324d8c45c9c54a Mon Sep 17 00:00:00 2001 From: Jonathan Stanley Date: Wed, 10 Jan 2007 20:52:14 +0000 Subject: [PATCH 191/264] pagination_sep is dead... removing the reference to it in the commented part. git-svn-id: file:///svn/phpbb/trunk@6876 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/styles/subSilver/theme/theme.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/styles/subSilver/theme/theme.cfg b/phpBB/styles/subSilver/theme/theme.cfg index 10985664fd..09d5d0d50c 100644 --- a/phpBB/styles/subSilver/theme/theme.cfg +++ b/phpBB/styles/subSilver/theme/theme.cfg @@ -15,7 +15,7 @@ # Single and double quotes do not need to be escaped. # # Available and used values: -# parse_css_file, pagination_sep +# parse_css_file # # General Information about this theme From eb56722d2f078b67d333cc976e1631fa8aec7eda Mon Sep 17 00:00:00 2001 From: David M Date: Wed, 10 Jan 2007 21:20:18 +0000 Subject: [PATCH 192/264] #6944 git-svn-id: file:///svn/phpbb/trunk@6877 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/viewtopic.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 1f1c1acb6a..ffcc826f7b 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -1234,7 +1234,6 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) // Parse the message and subject $message = censor_text($row['post_text']); - $message = str_replace("\n", '
', $message); // Second parse bbcode here if ($row['bbcode_bitfield']) @@ -1242,6 +1241,8 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i) $bbcode->bbcode_second_pass($message, $row['bbcode_uid'], $row['bbcode_bitfield']); } + $message = str_replace("\n", '
', $message); + // Always process smilies after parsing bbcodes $message = smiley_text($message); From 0165b873ef1f3cd8231f484504d110edb0cc1f92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Thu, 11 Jan 2007 01:01:26 +0000 Subject: [PATCH 193/264] Some remains from #6998 git-svn-id: file:///svn/phpbb/trunk@6878 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/styles/subSilver/template/viewforum_body.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/styles/subSilver/template/viewforum_body.html b/phpBB/styles/subSilver/template/viewforum_body.html index 160749532a..6e88eaab32 100644 --- a/phpBB/styles/subSilver/template/viewforum_body.html +++ b/phpBB/styles/subSilver/template/viewforum_body.html @@ -227,9 +227,9 @@
- + + {L_DISPLAY_TOPICS}: {S_SELECT_SORT_DAYS} {L_SORT_BY} {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}  [{items.IMG}]
- {L_CREATE_ROLE}:
+ {L_CREATE_ROLE}:
diff --git a/phpBB/adm/style/acp_ranks.html b/phpBB/adm/style/acp_ranks.html index 1926af18a2..e316c35b2a 100644 --- a/phpBB/adm/style/acp_ranks.html +++ b/phpBB/adm/style/acp_ranks.html @@ -26,7 +26,7 @@ {L_ACP_RANKS}
-
+
diff --git a/phpBB/adm/style/acp_reasons.html b/phpBB/adm/style/acp_reasons.html index a9c314e564..e10cc1d1ca 100644 --- a/phpBB/adm/style/acp_reasons.html +++ b/phpBB/adm/style/acp_reasons.html @@ -30,7 +30,7 @@

{L_IS_TRANSLATED_EXPLAIN}{L_IS_NOT_TRANSLATED_EXPLAIN}

-
+
diff --git a/phpBB/adm/style/acp_words.html b/phpBB/adm/style/acp_words.html index f0062e9600..fa85669595 100644 --- a/phpBB/adm/style/acp_words.html +++ b/phpBB/adm/style/acp_words.html @@ -16,11 +16,11 @@ {L_EDIT_WORD}
-
+
-
+
{S_HIDDEN_FIELDS} diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 1de254f6e2..eceaaa4cb5 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -673,6 +673,11 @@ class acp_attachments $selected = ($ext_group_row['upload_icon'] == $img) ? ' selected="selected"' : ''; } + if (strlen($img) > 255) + { + continue; + } + $filename_list .= ''; } } @@ -1266,10 +1271,20 @@ class acp_attachments { if ($row['site_ip']) { + if (strlen($row['site_ip']) > 40) + { + continue; + } + $iplist_tmp[] = "'" . $row['site_ip'] . "'"; } else if ($row['site_hostname']) { + if (strlen($row['site_hostname']) > 255) + { + continue; + } + $hostlist_tmp[] = "'" . $row['site_hostname'] . "'"; } // break; diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index 97a2c92e1c..270fc172ca 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -148,7 +148,16 @@ class acp_bbcodes trigger_error($user->lang['BBCODE_OPEN_ENDED_TAG'] . adm_back_link($this->u_action), E_USER_WARNING); } - // @todo - bbcode_tag <= 16, bbcode_helpline <= 255, bbcode_match <= 4000 + if (strlen($data['bbcode_tag']) > 16) + { + trigger_error($user->lang['BBCODE_TAG_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING); + } + + if (strlen($data['bbcode_tag']) > 4000) + { + trigger_error($user->lang['BBCODE_TAG_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING); + } + $sql_ary = array( 'bbcode_tag' => $data['bbcode_tag'], 'bbcode_match' => $bbcode_match, diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index da60162e33..5ccac5773e 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -853,6 +853,16 @@ class acp_forums $errors[] = $user->lang['FORUM_NAME_EMPTY']; } + if (utf8_strlen($forum_data['forum_desc']) > 4000) + { + $errors[] = $user->lang['FORUM_DESC_TOO_LONG']; + } + + if (utf8_strlen($forum_data['forum_rules']) > 4000) + { + $errors[] = $user->lang['FORUM_RULES_TOO_LONG']; + } + if ($forum_data['forum_password'] || $forum_data['forum_password_confirm']) { if ($forum_data['forum_password'] != $forum_data['forum_password_confirm']) diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index 131235ef8d..321df3ecb1 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -67,7 +67,7 @@ class acp_icons { $img_size = @getimagesize($phpbb_root_path . $img_path . '/' . $path . $img); - if (!$img_size[0] || !$img_size[1]) + if (!$img_size[0] || !$img_size[1] || strlen($img) > 255) { continue; } diff --git a/phpBB/includes/acp/acp_permission_roles.php b/phpBB/includes/acp/acp_permission_roles.php index 581766e9c8..86ac6f60c5 100644 --- a/phpBB/includes/acp/acp_permission_roles.php +++ b/phpBB/includes/acp/acp_permission_roles.php @@ -142,6 +142,11 @@ class acp_permission_roles trigger_error($user->lang['NO_ROLE_NAME_SPECIFIED'] . adm_back_link($this->u_action), E_USER_WARNING); } + if (utf8_strlen($role_description) > 4000) + { + trigger_error($user->lang['ROLE_DESCRIPTION_LONG'] . adm_back_link($this->u_action), E_USER_WARNING); + } + // if we add/edit a role we check the name to be unique among the settings... $sql = 'SELECT role_id FROM ' . ACL_ROLES_TABLE . " diff --git a/phpBB/includes/acp/acp_ranks.php b/phpBB/includes/acp/acp_ranks.php index a52ff07607..5b593a4d27 100644 --- a/phpBB/includes/acp/acp_ranks.php +++ b/phpBB/includes/acp/acp_ranks.php @@ -164,6 +164,11 @@ class acp_ranks $selected = ''; } + if (strlen($img) > 255) + { + continue; + } + $filename_list .= ''; } } diff --git a/phpBB/includes/acp/acp_reasons.php b/phpBB/includes/acp/acp_reasons.php index 72419de1ef..d9dc0505d4 100644 --- a/phpBB/includes/acp/acp_reasons.php +++ b/phpBB/includes/acp/acp_reasons.php @@ -214,7 +214,7 @@ class acp_reasons WHERE reason_id = $reason_id"; break; - // Nearly standard, not quite + // Standard? What's that? case 'mssql': case 'mssql_odbc': // Change the reports using this reason to 'other' diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 910999d5ef..ef5afdecd8 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1577,7 +1577,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u ); } - $sql = 'INSERT INTO ' . POSTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_data[POSTS_TABLE]['sql']); + $sql = 'INSERT INTO ' . POSTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_data[POSTS_TABLE]['sql']); $db->sql_query($sql); $data['post_id'] = $db->sql_nextid(); diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 0c6cf60f0f..25ac6f24eb 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -767,6 +767,11 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas { if ($ip) { + if (strlen($ip) > 40) + { + continue; + } + $banlist_ary[] = $ip; } } @@ -788,6 +793,11 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas if (preg_match('#^.*?@*|(([a-z0-9\-]+\.)+([a-z]{2,3}))$#i', $ban_item)) { + if (strlen($ban_item) > 100) + { + continue; + } + if (!sizeof($founder) || !in_array($ban_item, $founder)) { $banlist_ary[] = $ban_item; diff --git a/phpBB/language/en/acp/forums.php b/phpBB/language/en/acp/forums.php index 48d4374056..f6a2e88d84 100644 --- a/phpBB/language/en/acp/forums.php +++ b/phpBB/language/en/acp/forums.php @@ -67,6 +67,7 @@ $lang = array_merge($lang, array( 'FORUM_AUTO_PRUNE_EXPLAIN' => 'Prunes the forum of topics, set the frequency/age parameters below.', 'FORUM_CREATED' => 'Forum created successfully.', 'FORUM_DATA_NEGATIVE' => 'Pruning parameters cannot be negative.', + 'FORUM_DESC_TOO_LONG' => 'The forum description is too long, it must be less than 4000 characters.', 'FORUM_DELETE' => 'Delete forum', 'FORUM_DELETE_EXPLAIN' => 'The form below will allow you to delete a forum. If the forum is postable you are able to decide where you want to put all topics (or forums) it contained.', 'FORUM_DELETED' => 'Forum successfully deleted.', @@ -92,6 +93,7 @@ $lang = array_merge($lang, array( 'FORUM_RULES_LINK' => 'Link to forum rules', 'FORUM_RULES_LINK_EXPLAIN' => 'You are able to enter the URL of the page/post containing your forum rules here. This setting will override the forum rules text you specified.', 'FORUM_RULES_PREVIEW' => 'Forum rules preview', + 'FORUM_RULES_TOO_LONG' => 'The forum description is too long, it must be less than 4000 characters.', 'FORUM_SETTINGS' => 'Forum settings', 'FORUM_STATUS' => 'Forum status', 'FORUM_STYLE' => 'Forum style', diff --git a/phpBB/language/en/acp/permissions.php b/phpBB/language/en/acp/permissions.php index 500325edab..49b4ef108a 100644 --- a/phpBB/language/en/acp/permissions.php +++ b/phpBB/language/en/acp/permissions.php @@ -192,6 +192,7 @@ $lang = array_merge($lang, array( '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', 'ROLE_EDIT_SUCCESS' => 'Role successfully edited.', 'ROLE_NAME' => 'Role name', diff --git a/phpBB/language/en/acp/posting.php b/phpBB/language/en/acp/posting.php index cb16abfe47..f1aaa7c4b4 100644 --- a/phpBB/language/en/acp/posting.php +++ b/phpBB/language/en/acp/posting.php @@ -45,7 +45,8 @@ $lang = array_merge($lang, array( 'BBCODE_INVALID_TAG_NAME' => 'The BBCode tag name that you selected already exists.', 'BBCODE_OPEN_ENDED_TAG' => 'Your custom BBCode must contain both an opening and a closing tag.', 'BBCODE_TAG' => 'Tag', - 'BBCODE_TAG_TOO_LONG' => 'The tag definition that you have entered is too long, please shorten your tag definition.', + 'BBCODE_TAG_TOO_LONG' => 'The tag name you selected is too long.', + 'BBCODE_TAG_DEF_TOO_LONG' => 'The tag definition that you have entered is too long, please shorten your tag definition.', 'BBCODE_USAGE' => 'BBCode usage', 'BBCODE_USAGE_EXAMPLE' => '[colour={COLOR}]{TEXT}[/colour]

[font={TEXT1}]{TEXT2}[/font]', 'BBCODE_USAGE_EXPLAIN' => 'Here you define how to use the bbcode. Replace any variable input by the corresponding token (%ssee below%s)', diff --git a/phpBB/search.php b/phpBB/search.php index 681d47f0f1..398e46ce7c 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -1011,7 +1011,7 @@ $template->assign_vars(array( 'S_SELECT_SORT_DAYS' => $s_limit_days) ); -// Can't do comparisons w/ TEXT on MSSQL, CAST is good enough +// Handle large objects differently for Oracle and MSSQL switch ($db->sql_layer) { case 'oracle': From a0ff2c859d5b61b294a278fd56c036055f18fe5f Mon Sep 17 00:00:00 2001 From: David M Date: Thu, 11 Jan 2007 12:33:34 +0000 Subject: [PATCH 196/264] meh git-svn-id: file:///svn/phpbb/trunk@6881 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_bbcodes.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index 270fc172ca..9c2d19168a 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -153,9 +153,9 @@ class acp_bbcodes trigger_error($user->lang['BBCODE_TAG_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING); } - if (strlen($data['bbcode_tag']) > 4000) + if (strlen($bbcode_match) > 4000) { - trigger_error($user->lang['BBCODE_TAG_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING); + trigger_error($user->lang['BBCODE_TAG_DEF_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING); } $sql_ary = array( From bb5e17f40b5cc1e9a2b4d501d48eb71e03264e85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Thu, 11 Jan 2007 13:02:33 +0000 Subject: [PATCH 197/264] Some cleanup. Be gone you outdated JS code! git-svn-id: file:///svn/phpbb/trunk@6882 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/editor.js | 52 +++++++---------------- phpBB/memberlist.php | 12 +++--- phpBB/styles/subSilver/template/editor.js | 44 +------------------ 3 files changed, 23 insertions(+), 85 deletions(-) diff --git a/phpBB/adm/style/editor.js b/phpBB/adm/style/editor.js index 54e7e61f3a..2ef2853ed3 100644 --- a/phpBB/adm/style/editor.js +++ b/phpBB/adm/style/editor.js @@ -13,10 +13,10 @@ var clientPC = navigator.userAgent.toLowerCase(); // Get client info var clientVer = parseInt(navigator.appVersion); // Get browser version var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1)); -var is_nav = ((clientPC.indexOf('mozilla') != -1) && (clientPC.indexOf('spoofer') == -1) && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera') == -1) && (clientPC.indexOf('webtv') == -1) && (clientPC.indexOf('hotjava') == -1)); - var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1)); -var is_mac = (clientPC.indexOf('mac') != -1); + +var baseHeight; +window.onload = initInsertions; /** * Shows the help messages in the helpline window @@ -27,44 +27,19 @@ function helpline(help) } /** -* Replacement for arrayname.length property -*/ -function getarraysize(thearray) +* Fix a bug involving the TextRange object. From +* http://www.frostjedi.com/terra/scripts/demo/caretBug.html +*/ +function initInsertions() { - for (i = 0; i < thearray.length; i++) + var textarea = document.forms[form_name].elements[text_name]; + textarea.focus(); + if (is_ie && typeof(baseHeight) != 'number') { - if (typeof thearray[i] == 'undefined' || thearray[i] == '' || thearray[i] == null) - { - return i; - } + baseHeight = document.selection.createRange().duplicate().boundingHeight; } - - return thearray.length; } -/** -* Replacement for arrayname.push(value) not implemented in IE until version 5.5 -* Appends element to the array -*/ -function arraypush(thearray,value) -{ - thearray[getarraysize(thearray)] = value; -} - -/** -* Replacement for arrayname.pop() not implemented in IE until version 5.5 -* Removes and returns the last element of an array -*/ -function arraypop(thearray) -{ - thearraysize = getarraysize(thearray); - retval = thearray[thearraysize - 1]; - delete thearray[thearraysize - 1]; - - return retval; -} - - /** * bbstyle */ @@ -168,6 +143,11 @@ function insert_text(text, spaces, popup) else if (textarea.createTextRange && textarea.caretPos) { + if (baseHeight != textarea.caretPos.boundingHeight) + { + textarea.focus(); + storeCaret(textarea); + } var caret_pos = textarea.caretPos; caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text; diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 340fc1e02c..13a170e357 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -23,12 +23,12 @@ $auth->acl($user->data); $user->setup(array('memberlist', 'groups')); // Grab data -$mode = request_var('mode', ''); -$action = request_var('action', ''); -$user_id = request_var('u', ANONYMOUS); -$username = request_var('un', '', true); -$group_id = request_var('g', 0); -$topic_id = request_var('t', 0); +$mode = request_var('mode', ''); +$action = request_var('action', ''); +$user_id = request_var('u', ANONYMOUS); +$username = request_var('un', '', true); +$group_id = request_var('g', 0); +$topic_id = request_var('t', 0); switch ($mode) { diff --git a/phpBB/styles/subSilver/template/editor.js b/phpBB/styles/subSilver/template/editor.js index dfd992974d..2ef2853ed3 100644 --- a/phpBB/styles/subSilver/template/editor.js +++ b/phpBB/styles/subSilver/template/editor.js @@ -13,10 +13,7 @@ var clientPC = navigator.userAgent.toLowerCase(); // Get client info var clientVer = parseInt(navigator.appVersion); // Get browser version var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1)); -var is_nav = ((clientPC.indexOf('mozilla') != -1) && (clientPC.indexOf('spoofer') == -1) && (clientPC.indexOf('compatible') == -1) && (clientPC.indexOf('opera') == -1) && (clientPC.indexOf('webtv') == -1) && (clientPC.indexOf('hotjava') == -1)); - var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1)); -var is_mac = (clientPC.indexOf('mac') != -1); var baseHeight; window.onload = initInsertions; @@ -29,44 +26,6 @@ function helpline(help) document.forms[form_name].helpbox.value = help_line[help]; } -/** -* Replacement for arrayname.length property -*/ -function getarraysize(thearray) -{ - for (i = 0; i < thearray.length; i++) - { - if (typeof thearray[i] == 'undefined' || thearray[i] == '' || thearray[i] == null) - { - return i; - } - } - - return thearray.length; -} - -/** -* Replacement for arrayname.push(value) not implemented in IE until version 5.5 -* Appends element to the array -*/ -function arraypush(thearray,value) -{ - thearray[getarraysize(thearray)] = value; -} - -/** -* Replacement for arrayname.pop() not implemented in IE until version 5.5 -* Removes and returns the last element of an array -*/ -function arraypop(thearray) -{ - thearraysize = getarraysize(thearray); - retval = thearray[thearraysize - 1]; - delete thearray[thearraysize - 1]; - - return retval; -} - /** * Fix a bug involving the TextRange object. From * http://www.frostjedi.com/terra/scripts/demo/caretBug.html @@ -79,8 +38,7 @@ function initInsertions() { baseHeight = document.selection.createRange().duplicate().boundingHeight; } -} - +} /** * bbstyle From 09ed27b4aa2ec7ace17713dc13ac5fdd16ea5cd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Thu, 11 Jan 2007 13:11:28 +0000 Subject: [PATCH 198/264] #7032 git-svn-id: file:///svn/phpbb/trunk@6883 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/styles/subSilver/template/posting_buttons.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/styles/subSilver/template/posting_buttons.html b/phpBB/styles/subSilver/template/posting_buttons.html index a6540e3634..e4527570d4 100644 --- a/phpBB/styles/subSilver/template/posting_buttons.html +++ b/phpBB/styles/subSilver/template/posting_buttons.html @@ -87,7 +87,7 @@ - + {L_FONT_COLOR} From e133e4a72735f9b7cee2813cf46e7e34984e9540 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Thu, 11 Jan 2007 13:34:33 +0000 Subject: [PATCH 199/264] #7036 git-svn-id: file:///svn/phpbb/trunk@6884 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/styles/subSilver/template/posting_body.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/styles/subSilver/template/posting_body.html b/phpBB/styles/subSilver/template/posting_body.html index b70074d3fe..96920d90a7 100644 --- a/phpBB/styles/subSilver/template/posting_body.html +++ b/phpBB/styles/subSilver/template/posting_body.html @@ -127,7 +127,7 @@ - +
{L_NO_TOPIC_ICON} {L_NO_TOPIC_ICON}
From 9372acd0170cf255dd0a1551479e6d75c7af7008 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Thu, 11 Jan 2007 13:37:41 +0000 Subject: [PATCH 200/264] Remains from #6998 git-svn-id: file:///svn/phpbb/trunk@6885 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/styles/subSilver/template/viewforum_body.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/styles/subSilver/template/viewforum_body.html b/phpBB/styles/subSilver/template/viewforum_body.html index 6e88eaab32..86715b1f29 100644 --- a/phpBB/styles/subSilver/template/viewforum_body.html +++ b/phpBB/styles/subSilver/template/viewforum_body.html @@ -75,7 +75,7 @@ -   +   From e6421f9274d3932539974790db1fcf81027a4db5 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sat, 13 Jan 2007 22:32:03 +0000 Subject: [PATCH 201/264] - solved a problem with magic urls inside brackets, and with bbcodes being treated as IPv6 addresses - turn NOT IN () and IN () into 1=1 and 1=0 so the database will understand it, instead of throwing an error in sql_in_set [Bug #7118] - some tiny fixes to fulltext_native git-svn-id: file:///svn/phpbb/trunk@6886 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/develop/regex.php | 2 +- phpBB/includes/db/dbal.php | 12 ++++++++++-- phpBB/includes/functions.php | 20 +++++++++++++------- phpBB/includes/search/fulltext_native.php | 19 +++++++++++-------- 4 files changed, 35 insertions(+), 18 deletions(-) diff --git a/phpBB/develop/regex.php b/phpBB/develop/regex.php index 1719fe03e9..7abecc9650 100644 --- a/phpBB/develop/regex.php +++ b/phpBB/develop/regex.php @@ -49,7 +49,7 @@ $scheme = '[a-z][a-z\d+\-.]*'; $reg_name = "(?:[$unreserved$sub_delims|@]+|$pct_encoded)+"; // rfc: * instead of + and no "|" and no "@" (included instead of userinfo //$userinfo = "(?:(?:[$unreserved$sub_delims:]+|$pct_encoded))*"; $ipv4_simple = '[0-9.]+'; -$ipv6_simple = '\[[a-z0-9.:]+\]'; +$ipv6_simple = '\[[a-z0-9.]+:[a-z0-9.]+:[a-z0-9.:]+\]'; $host = "(?:$reg_name|$ipv4_simple|$ipv6_simple)"; $port = '\d*'; //$authority = "(?:$userinfo@)?$host(?::$port)?"; diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index f4cbe0e2d4..1f48909d43 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -289,8 +289,16 @@ class dbal { if (!sizeof($array)) { - // Not optimal, but at least the backtrace should help in identifying where the problem lies. - $this->sql_error('No values specified for SQL IN comparison'); + // NOT IN () actually means everything so use a tautology + if ($negate) + { + return '1=1'; + } + // IN () actually means nothing so use a contradiction + else + { + return '1=0'; + } } if (!is_array($array)) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 8054870554..c9d820ae03 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2385,15 +2385,15 @@ function make_clickable($text, $server_url = false) // Be sure to not let the matches cross over. ;) // relative urls for this board - $magic_url_match[] = '#(^|[\n\t (])(' . preg_quote($server_url, '#') . ')/(' . get_preg_expression('relative_url') . ')#ie'; + $magic_url_match[] = '#(^|[\n\t (])(' . preg_quote($server_url, '#') . ')/(' . get_preg_expression('relative_url_inline') . ')#ie'; $magic_url_replace[] = "'\$1' . preg_replace('/(&|\?)sid=[0-9a-f]{32}/', '\\\\1', '\$3') . ''"; // matches a xxxx://aaaaa.bbb.cccc. ... - $magic_url_match[] = '#(^|[\n\t (])(' . get_preg_expression('url') . ')#ie'; + $magic_url_match[] = '#(^|[\n\t (])(' . get_preg_expression('url_inline') . ')#ie'; $magic_url_replace[] = "'\$1' . ((strlen('\$2') > 55) ? substr(str_replace('&', '&', '\$2'), 0, 39) . ' ... ' . substr(str_replace('&', '&', '\$2'), -10) : '\$2') . ''"; // matches a "www.xxxx.yyyy[/zzzz]" kinda lazy URL thing - $magic_url_match[] = '#(^|[\n\t (])(' . get_preg_expression('www_url') . ')#ie'; + $magic_url_match[] = '#(^|[\n\t (])(' . get_preg_expression('www_url_inline') . ')#ie'; $magic_url_replace[] = "'\$1' . ((strlen('\$2') > 55) ? substr(str_replace('&', '&', '\$2'), 0, 39) . ' ... ' . substr(str_replace('&', '&', '\$2'), -10) : '\$2') . ''"; // matches an email@domain type address at the start of a line, or after a space or after what might be a BBCode. @@ -3001,7 +3001,7 @@ function get_backtrace() /** * This function returns a regular expression pattern for commonly used expressions * Use with / as delimiter for email mode and # for url modes -* mode can be: email|bbcode_htm|url|www_url|relative_url +* mode can be: email|bbcode_htm|url|url_inline|www_url|www_url_inline|relative_url|relative_url_inline */ function get_preg_expression($mode) { @@ -3022,16 +3022,22 @@ function get_preg_expression($mode) break; case 'url': + case 'url_inline': + $inline = ($mode == 'url') ? ')' : ''; // generated with regex generation file in the develop folder - return "[a-z][a-z\d+\-.]*:/{2}(?:(?:[a-z0-9\-._~!$&'()*+,;=|@]+|%[\dA-F]{2})+|[0-9.]+|\[[a-z0-9.:]+\])(?::\d*)?(?:/(?:[a-z0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?"; + return "[a-z][a-z\d+\-.]*:/{2}(?:(?:[a-z0-9\-._~!$&'($inline*+,;=|@]+|%[\dA-F]{2})+|[0-9.]+|\[[a-z0-9.]+:[a-z0-9.]+:[a-z0-9.:]+\])(?::\d*)?(?:/(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?"; break; case 'www_url': - return "www\.(?:[a-z0-9\-._~!$&'()*+,;=|@]+|%[\dA-F]{2})+(?::\d*)?(?:/(?:[a-z0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?"; + case 'www_url_inline': + $inline = ($mode == 'www_url') ? ')' : ''; + return "www\.(?:[a-z0-9\-._~!$&'($inline*+,;=|@]+|%[\dA-F]{2})+(?::\d*)?(?:/(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?"; break; case 'relative_url': - return "(?:[a-z0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})*(?:/(?:[a-z0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?"; + case 'relative_url_inline': + $inline = ($mode == 'relative_url') ? ')' : ''; + return "(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*(?:/(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?"; break; } diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index cbdef03b88..652495e734 100755 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -80,7 +80,7 @@ class fulltext_native extends search_backend */ function split_keywords($keywords, $terms) { - global $db, $config, $user; + global $db, $user; $keywords = trim($this->cleanup($keywords, '+-|()*')); @@ -273,16 +273,19 @@ class fulltext_native extends search_backend // if this is an array of words then retrieve an id for each if (is_array($word)) { + $non_common_words = array(); $id_words = array(); foreach ($word as $i => $word_part) { if (strpos($word_part, '*') !== false) { $id_words[] = '\'' . $db->sql_escape(str_replace('*', '%', $word_part)) . '\''; + $non_common_words[] = $word_part; } - if (isset($words[$word_part])) + else if (isset($words[$word_part])) { $id_words[] = $words[$word_part]; + $non_common_words[] = $word_part; } } if (sizeof($id_words)) @@ -299,10 +302,11 @@ class fulltext_native extends search_backend } } // throw an error if we shall not ignore unexistant words - else if (!$ignore_no_id) + else if (!$ignore_no_id && sizeof($non_common_words)) { - trigger_error(sprintf($user->lang['WORDS_IN_NO_POST'], implode(', ', $word))); + trigger_error(sprintf($user->lang['WORDS_IN_NO_POST'], implode(', ', $non_common_words))); } + unset($non_common_words); } // else we only need one id else if (($wildcard = strpos($word, '*') !== false) || isset($words[$word])) @@ -930,8 +934,7 @@ class fulltext_native extends search_backend */ function split_message($text) { - global $phpbb_root_path, $phpEx; - global $config, $user; + global $phpbb_root_path, $phpEx, $user; $match = $words = array(); @@ -943,8 +946,8 @@ class fulltext_native extends search_backend // BBcode $match[] = '#\[\/?[a-z0-9\*\+\-]+(?:=.*?)?(?::[a-z])?(\:?[0-9a-z]{5,})\]#'; - $min = $config['fulltext_native_min_chars']; - $max = $config['fulltext_native_max_chars']; + $min = $this->word_length['min']; + $max = $this->word_length['max']; $isset_min = $min - 1; From ce60114a71b87150e9c8440eeb09be5a5cb66607 Mon Sep 17 00:00:00 2001 From: Jonathan Stanley Date: Sun, 14 Jan 2007 22:29:05 +0000 Subject: [PATCH 202/264] #7150 git-svn-id: file:///svn/phpbb/trunk@6887 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/overall_header.html | 2 +- phpBB/adm/style/simple_header.html | 2 +- phpBB/styles/subSilver/template/simple_header.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/adm/style/overall_header.html b/phpBB/adm/style/overall_header.html index fa05f19725..ea1faef222 100644 --- a/phpBB/adm/style/overall_header.html +++ b/phpBB/adm/style/overall_header.html @@ -113,7 +113,7 @@ function swatch(field) - +
-

+ +

+ {L_SUBMIT}   -

diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html index 5156604ee6..2415b1c48d 100644 --- a/phpBB/adm/style/acp_forums.html +++ b/phpBB/adm/style/acp_forums.html @@ -216,7 +216,7 @@

{L_FORUM_TOPICS_PAGE_EXPLAIN}
-
+
@@ -228,15 +228,15 @@

{L_AUTO_PRUNE_FREQ_EXPLAIN}
-
{L_DAYS}
+
{L_DAYS}

{L_AUTO_PRUNE_DAYS_EXPLAIN}
-
{L_DAYS}
+
{L_DAYS}

{L_AUTO_PRUNE_VIEWED_EXPLAIN}
-
{L_DAYS}
+
{L_DAYS}

{L_PRUNE_OLD_POLLS_EXPLAIN}
diff --git a/phpBB/adm/style/acp_jabber.html b/phpBB/adm/style/acp_jabber.html index a94b25e52b..5ff54491a3 100644 --- a/phpBB/adm/style/acp_jabber.html +++ b/phpBB/adm/style/acp_jabber.html @@ -27,7 +27,7 @@

{L_JAB_PORT_EXPLAIN}
-
+

{L_JAB_USERNAME_EXPLAIN}
@@ -43,7 +43,7 @@

{L_JAB_PACKAGE_SIZE_EXPLAIN}
-
+

diff --git a/phpBB/adm/style/acp_search.html b/phpBB/adm/style/acp_search.html index c52a7ac2ec..cc10cc7596 100644 --- a/phpBB/adm/style/acp_search.html +++ b/phpBB/adm/style/acp_search.html @@ -17,11 +17,11 @@


{L_SEARCH_INTERVAL_EXPLAIN}
-
+
{L_SECONDS}

{L_SEARCH_GUEST_INTERVAL_EXPLAIN}
-
+
{L_SECONDS}

{L_LIMIT_SEARCH_LOAD_EXPLAIN}
@@ -33,7 +33,7 @@

{L_SEARCH_STORE_RESULTS_EXPLAIN}
-
+
{L_SECONDS}
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index eceaaa4cb5..9d98646b81 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -105,8 +105,8 @@ class acp_attachments 'img_max_thumb_width' => array('lang' => 'MAX_THUMB_WIDTH', 'validate' => 'int', 'type' => 'text:7:15', 'explain' => true, 'append' => ' px'), 'img_min_thumb_filesize' => array('lang' => 'MIN_THUMB_FILESIZE', 'validate' => 'int', 'type' => 'text:7:15', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']), 'img_imagick' => array('lang' => 'IMAGICK_PATH', 'validate' => 'string', 'type' => 'text:20:200', 'explain' => true, 'append' => '  [ ' . $user->lang['SEARCH_IMAGICK'] . ' ]'), - 'img_max' => array('lang' => 'MAX_IMAGE_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true), - 'img_link' => array('lang' => 'IMAGE_LINK_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true), + 'img_max' => array('lang' => 'MAX_IMAGE_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' px'), + 'img_link' => array('lang' => 'IMAGE_LINK_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' px'), ) ); diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 11fddd3d1c..3d3254d7d3 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -238,9 +238,9 @@ class acp_board 'vars' => array( 'legend1' => 'GENERAL_SETTINGS', 'limit_load' => array('lang' => 'LIMIT_LOAD', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true), - 'session_length' => array('lang' => 'SESSION_LENGTH', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true), + 'session_length' => array('lang' => 'SESSION_LENGTH', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']), 'active_sessions' => array('lang' => 'LIMIT_SESSIONS', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true), - 'load_online_time' => array('lang' => 'ONLINE_LENGTH', 'validate' => 'int', 'type' => 'text:4:3', 'explain' => true), + 'load_online_time' => array('lang' => 'ONLINE_LENGTH', 'validate' => 'int', 'type' => 'text:4:3', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), 'legend2' => 'GENERAL_OPTIONS', 'load_db_track' => array('lang' => 'YES_POST_MARKING', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), @@ -302,14 +302,14 @@ class acp_board 'vars' => array( 'legend1' => 'ACP_SECURITY_SETTINGS', 'allow_autologin' => array('lang' => 'ALLOW_AUTOLOGIN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), - 'max_autologin_time' => array('lang' => 'AUTOLOGIN_LENGTH', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true), + 'max_autologin_time' => array('lang' => 'AUTOLOGIN_LENGTH', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']), 'ip_check' => array('lang' => 'IP_VALID', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_ip_check', 'explain' => true), 'browser_check' => array('lang' => 'BROWSER_VALID', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'forwarded_for_check' => array('lang' => 'FORWARDED_FOR_VALID', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'check_dnsbl' => array('lang' => 'CHECK_DNSBL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'email_check_mx' => array('lang' => 'EMAIL_CHECK_MX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true), - 'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), + 'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']), 'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), 'tpl_allow_php' => array('lang' => 'TPL_ALLOW_PHP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), ) From 348edb41d91c86fbaf670e3cb4b78cdd7fb907c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Tue, 16 Jan 2007 23:20:26 +0000 Subject: [PATCH 204/264] hmmm ... git-svn-id: file:///svn/phpbb/trunk@6889 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/acp/permissions.php | 1 + 1 file changed, 1 insertion(+) diff --git a/phpBB/language/en/acp/permissions.php b/phpBB/language/en/acp/permissions.php index 49b4ef108a..611d080255 100644 --- a/phpBB/language/en/acp/permissions.php +++ b/phpBB/language/en/acp/permissions.php @@ -93,6 +93,7 @@ $lang = array_merge($lang, array( 'ADD_GROUPS' => 'Add groups', 'ADD_PERMISSIONS' => 'Add permissions', 'ADD_USERS' => 'Add users', + 'ADVANCED_PERMISSIONS' => 'Advanced Permissions', 'ALL_GROUPS' => 'Select all groups', 'ALL_NEVER' => 'All NEVER', 'ALL_NO' => 'All NO', From 07d7486389cc396a0867b80ebab105d864e46557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Tue, 16 Jan 2007 23:46:37 +0000 Subject: [PATCH 205/264] #7110 git-svn-id: file:///svn/phpbb/trunk@6890 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_display.php | 2 +- phpBB/styles/subSilver/template/posting_body.html | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index ab44baf944..73d52a5fdf 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -709,7 +709,7 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold if ($topic_row['poll_start']) { - $topic_type .= $user->lang['VIEW_TOPIC_POLL']; + $topic_type = $user->lang['VIEW_TOPIC_POLL']; } } diff --git a/phpBB/styles/subSilver/template/posting_body.html b/phpBB/styles/subSilver/template/posting_body.html index 96920d90a7..7d871ae922 100644 --- a/phpBB/styles/subSilver/template/posting_body.html +++ b/phpBB/styles/subSilver/template/posting_body.html @@ -154,6 +154,7 @@ + {L_BCC}: @@ -165,6 +166,7 @@ + From f4263042d53030fc2b9ed471c5144e41d0d9123e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Tue, 16 Jan 2007 23:52:38 +0000 Subject: [PATCH 206/264] Forgot that one for #7110 git-svn-id: file:///svn/phpbb/trunk@6891 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_display.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 73d52a5fdf..e1e6496c36 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -707,7 +707,7 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold } } - if ($topic_row['poll_start']) + if ($topic_row['poll_start'] && $topic_row['topic_status'] != ITEM_MOVED) { $topic_type = $user->lang['VIEW_TOPIC_POLL']; } From 5d42587e56c423e2a1a30abd2ec60f4b824ccaac Mon Sep 17 00:00:00 2001 From: David M Date: Wed, 17 Jan 2007 01:36:51 +0000 Subject: [PATCH 207/264] #7156 git-svn-id: file:///svn/phpbb/trunk@6892 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/ucp.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/ucp.php b/phpBB/ucp.php index db521af675..63c368a1f6 100755 --- a/phpBB/ucp.php +++ b/phpBB/ucp.php @@ -22,7 +22,7 @@ require($phpbb_root_path . 'includes/functions_module.' . $phpEx); $id = request_var('i', ''); $mode = request_var('mode', ''); -if ($mode == 'login' || $mode == 'logout') +if ($mode == 'login' || $mode == 'logout' || $mode == 'confirm') { define('IN_LOGIN', true); } From 708113b790368fffbf57eb5b96c8132eda00ba9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Wed, 17 Jan 2007 15:40:30 +0000 Subject: [PATCH 208/264] #7092 #7088 git-svn-id: file:///svn/phpbb/trunk@6893 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/styles/subSilver/template/mcp_topic.html | 4 ++-- phpBB/styles/subSilver/template/posting_body.html | 10 ++++++---- phpBB/styles/subSilver/template/posting_buttons.html | 2 +- phpBB/styles/subSilver/template/report_body.html | 4 ++-- phpBB/styles/subSilver/theme/stylesheet.css | 4 ++++ 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/phpBB/styles/subSilver/template/mcp_topic.html b/phpBB/styles/subSilver/template/mcp_topic.html index cb398e48e6..464159531b 100644 --- a/phpBB/styles/subSilver/template/mcp_topic.html +++ b/phpBB/styles/subSilver/template/mcp_topic.html @@ -25,7 +25,7 @@ - +
checked="checked" />{L_NO_TOPIC_ICON} checked="checked" /> checked="checked" />{L_NO_TOPIC_ICON} checked="checked" />
@@ -54,7 +54,7 @@ {L_DISPLAY_OPTIONS} - {L_POSTS_PER_PAGE}
{L_POSTS_PER_PAGE_EXPLAIN} + {L_POSTS_PER_PAGE}
{L_POSTS_PER_PAGE_EXPLAIN} diff --git a/phpBB/styles/subSilver/template/posting_body.html b/phpBB/styles/subSilver/template/posting_body.html index 7d871ae922..b99b902437 100644 --- a/phpBB/styles/subSilver/template/posting_body.html +++ b/phpBB/styles/subSilver/template/posting_body.html @@ -147,8 +147,9 @@ {S_HIDDEN_ADDRESS_FIELD} - - {to_recipient.NAME}{to_recipient.NAME_FULL}   + + {to_recipient.NAME}{to_recipient.NAME_FULL}   + {L_NO_TO_RECIPIENT} @@ -159,8 +160,9 @@ {L_BCC}: - - {bcc_recipient.NAME}{bcc_recipient.NAME_FULL}   + + {bcc_recipient.NAME}{bcc_recipient.NAME_FULL}   + {L_NO_BCC_RECIPIENT} diff --git a/phpBB/styles/subSilver/template/posting_buttons.html b/phpBB/styles/subSilver/template/posting_buttons.html index e4527570d4..f3cf518d69 100644 --- a/phpBB/styles/subSilver/template/posting_buttons.html +++ b/phpBB/styles/subSilver/template/posting_buttons.html @@ -68,7 +68,7 @@ - {L_FONT_SIZE}: diff --git a/phpBB/styles/subSilver/template/report_body.html b/phpBB/styles/subSilver/template/report_body.html index 7065f0f35d..59072606cc 100644 --- a/phpBB/styles/subSilver/template/report_body.html +++ b/phpBB/styles/subSilver/template/report_body.html @@ -23,10 +23,10 @@ {L_MORE_INFO}:
{L_CAN_LEAVE_BLANK} - + -   +   diff --git a/phpBB/styles/subSilver/theme/stylesheet.css b/phpBB/styles/subSilver/theme/stylesheet.css index 769fe4d092..4cf0ebc3cf 100644 --- a/phpBB/styles/subSilver/theme/stylesheet.css +++ b/phpBB/styles/subSilver/theme/stylesheet.css @@ -625,3 +625,7 @@ pre { font-size: 1.1em; font-family: Monaco, 'Courier New', monospace; } + +.nowrap { + white-space: nowrap; +} \ No newline at end of file From a841fe70a8234bf158165105339e32aa5ceb75a2 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 17 Jan 2007 18:41:49 +0000 Subject: [PATCH 209/264] ok, handled some bugs... the most important being validate_username (the variable passed to validate_data([...]array('username', [...])) and updating group listings while doing relevant group actions. Oh, and PM icons are working now. :o git-svn-id: file:///svn/phpbb/trunk@6894 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/acp_users.html | 8 ++-- phpBB/develop/create_schema_files.php | 4 +- phpBB/includes/acp/acp_forums.php | 4 +- phpBB/includes/acp/acp_groups.php | 4 -- phpBB/includes/acp/acp_users.php | 18 +------- phpBB/includes/db/dbal.php | 18 ++++++++ phpBB/includes/db/firebird.php | 15 ++----- phpBB/includes/db/mssql.php | 43 ++++++++----------- phpBB/includes/db/mssql_odbc.php | 43 ++++++++----------- phpBB/includes/db/mysql.php | 29 +++++-------- phpBB/includes/db/mysqli.php | 29 +++++-------- phpBB/includes/db/oracle.php | 15 ++----- phpBB/includes/db/postgres.php | 27 +++++------- phpBB/includes/db/sqlite.php | 27 +++++------- phpBB/includes/functions.php | 14 +++--- phpBB/includes/functions_display.php | 11 +++-- phpBB/includes/functions_privmsgs.php | 2 +- phpBB/includes/functions_user.php | 28 +++++++++--- phpBB/includes/mcp/mcp_forum.php | 37 +++++++++++----- phpBB/includes/mcp/mcp_topic.php | 6 +++ phpBB/includes/mcp/mcp_warn.php | 2 +- phpBB/includes/ucp/ucp_groups.php | 1 - phpBB/includes/ucp/ucp_pm_compose.php | 2 +- phpBB/includes/ucp/ucp_pm_viewfolder.php | 4 +- phpBB/includes/ucp/ucp_profile.php | 2 +- phpBB/install/database_update.php | 6 +++ phpBB/install/schemas/mysql_40_schema.sql | 4 +- phpBB/install/schemas/mysql_41_schema.sql | 4 +- phpBB/install/schemas/oracle_schema.sql | 4 +- phpBB/install/schemas/postgres_schema.sql | 4 +- phpBB/install/schemas/sqlite_schema.sql | 4 +- phpBB/language/en/acp/common.php | 3 ++ phpBB/language/en/acp/profile.php | 2 +- phpBB/language/en/acp/users.php | 2 - phpBB/language/en/posting.php | 1 + phpBB/memberlist.php | 12 +++++- phpBB/posting.php | 14 +++++- .../styles/subSilver/template/mcp_forum.html | 4 +- .../subSilver/template/posting_body.html | 4 +- .../subSilver/template/viewforum_body.html | 2 +- phpBB/viewforum.php | 4 +- phpBB/viewtopic.php | 2 +- 42 files changed, 243 insertions(+), 226 deletions(-) diff --git a/phpBB/adm/style/acp_users.html b/phpBB/adm/style/acp_users.html index c615dadb44..aeaff282e7 100644 --- a/phpBB/adm/style/acp_users.html +++ b/phpBB/adm/style/acp_users.html @@ -111,6 +111,10 @@
{USER_POSTS}
+
+
+
{USER_WARNINGS}
+

{L_FOUNDER_EXPLAIN}
id="user_founder" checked="checked" disabled="disabled" /> {L_YES}  id="user_founder" checked="checked" disabled="disabled" /> {L_NO} 
@@ -136,10 +140,6 @@
{L_USER_TOOLS} -
-

{L_WARNINGS_EXPLAIN}
-
-
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 06c8ca24a6..8bce25febb 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1327,7 +1327,7 @@ function get_schema_struct() 'rule_user_id' => array('UINT', 0), 'rule_group_id' => array('UINT', 0), 'rule_action' => array('UINT', 0), - 'rule_folder_id' => array('INT:4', 0), + 'rule_folder_id' => array('UINT', 0), ), 'PRIMARY_KEY' => 'rule_id', 'KEYS' => array( @@ -1346,7 +1346,7 @@ function get_schema_struct() 'pm_replied' => array('BOOL', 0), 'pm_marked' => array('BOOL', 0), 'pm_forwarded' => array('BOOL', 0), - 'folder_id' => array('INT:4', 0), + 'folder_id' => array('UINT', 0), ), 'KEYS' => array( 'msg_id' => array('INDEX', 'msg_id'), diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 5ccac5773e..20b463d82a 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -478,7 +478,7 @@ class acp_forums $forum_data['forum_rules_bitfield'] = ''; $forum_data['forum_rules_options'] = 0; - generate_text_for_storage($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], $forum_data['forum_rules_options'], request_var('rules_allow_bbcode', false), request_var('rules_allow_urls', false), request_var('rules_allow_smiliess', false)); + generate_text_for_storage($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], $forum_data['forum_rules_options'], request_var('rules_allow_bbcode', false), request_var('rules_allow_urls', false), request_var('rules_allow_smilies', false)); } // Generate preview content @@ -498,7 +498,7 @@ class acp_forums $forum_data['forum_desc_bitfield'] = ''; $forum_data['forum_desc_options'] = 0; - generate_text_for_storage($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options'], request_var('desc_allow_bbcode', false), request_var('desc_allow_urls', false), request_var('desc_allow_smiliess', false)); + generate_text_for_storage($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options'], request_var('desc_allow_bbcode', false), request_var('desc_allow_urls', false), request_var('desc_allow_smilies', false)); } // decode... diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php index 669e98f32f..63aec2db97 100644 --- a/phpBB/includes/acp/acp_groups.php +++ b/phpBB/includes/acp/acp_groups.php @@ -91,8 +91,6 @@ class acp_groups break; } - group_update_listings($group_id); - trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&action=list&g=' . $group_id)); break; @@ -142,8 +140,6 @@ class acp_groups group_user_attributes('default', $group_id, $mark_ary, false, $group_row['group_name'], $group_row); } - group_update_listings($group_id); - trigger_error($user->lang['GROUP_DEFS_UPDATED'] . adm_back_link($this->u_action . '&action=list&g=' . $group_id)); } else diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 1929b1ece6..81bd8d6436 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -623,7 +623,6 @@ class acp_users 'email_confirm' => strtolower(request_var('email_confirm', '')), 'user_password' => request_var('user_password', '', true), 'password_confirm' => request_var('password_confirm', '', true), - 'warnings' => request_var('warnings', $user_row['user_warnings']), ); // Validation data - we do not check the password complexity setting here @@ -632,7 +631,6 @@ class acp_users array('string', true, $config['min_pass_chars'], $config['max_pass_chars']), array('password')), 'password_confirm' => array('string', true, $config['min_pass_chars'], $config['max_pass_chars']), - 'warnings' => array('num'), ); // Check username if altered @@ -641,7 +639,8 @@ class acp_users $check_ary += array( 'username' => array( array('string', false, $config['min_name_chars'], $config['max_name_chars']), - array('username', $user_row['username'])), + array('username', $user_row['username']) + ), ); } @@ -670,7 +669,6 @@ class acp_users } // Which updates do we need to do? - $update_warning = ($user_row['user_warnings'] != $data['warnings']) ? true : false; $update_username = ($user_row['username'] != $data['username']) ? $data['username'] : false; $update_password = ($data['user_password'] && $user_row['user_password'] != md5($data['user_password'])) ? true : false; $update_email = ($data['email'] != $user_row['user_email']) ? $data['email'] : false; @@ -681,11 +679,6 @@ class acp_users if ($user_row['user_type'] != USER_FOUNDER || $user->data['user_type'] == USER_FOUNDER) { - if ($update_warning) - { - $sql_ary['user_warnings'] = $data['warnings']; - } - // Only allow founders updating the founder status... if ($user->data['user_type'] == USER_FOUNDER) { @@ -765,13 +758,6 @@ class acp_users $db->sql_query($sql); } - /** - * @todo adjust every data based in the number of user warnings - */ - if ($update_warning) - { - } - if ($update_username) { user_update_name($user_row['username'], $update_username); diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index 1f48909d43..df6e453329 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -114,6 +114,24 @@ class dbal return $this->_sql_close(); } + /** + * Build LIMIT query + * Doing some validation here. + */ + function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) + { + if (empty($query)) + { + return false; + } + + // Never use a negative total or offset + $total = ($total < 0) ? 0 : $total; + $offset = ($offset < 0) ? 0 : $offset; + + return $this->_sql_query_limit($query, $total, $offset, $cache_ttl); + } + /** * Fetch all rows */ diff --git a/phpBB/includes/db/firebird.php b/phpBB/includes/db/firebird.php index 60fa366b7f..709145c4cf 100644 --- a/phpBB/includes/db/firebird.php +++ b/phpBB/includes/db/firebird.php @@ -158,20 +158,13 @@ class dbal_firebird extends dbal /** * Build LIMIT query */ - function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) + function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) { - if ($query != '') - { - $this->query_result = false; + $this->query_result = false; - $query = 'SELECT FIRST ' . $total . ((!empty($offset)) ? ' SKIP ' . $offset : '') . substr($query, 6); + $query = 'SELECT FIRST ' . $total . ((!empty($offset)) ? ' SKIP ' . $offset : '') . substr($query, 6); - return $this->sql_query($query, $cache_ttl); - } - else - { - return false; - } + return $this->sql_query($query, $cache_ttl); } /** diff --git a/phpBB/includes/db/mssql.php b/phpBB/includes/db/mssql.php index c9946c2b5c..b28ea01acb 100644 --- a/phpBB/includes/db/mssql.php +++ b/phpBB/includes/db/mssql.php @@ -159,40 +159,33 @@ class dbal_mssql extends dbal /** * Build LIMIT query */ - function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) + function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) { - if ($query != '') + $this->query_result = false; + + // Since TOP is only returning a set number of rows we won't need it if total is set to 0 (return all rows) + if ($total) { - $this->query_result = false; - - // Since TOP is only returning a set number of rows we won't need it if total is set to 0 (return all rows) - if ($total) + // We need to grab the total number of rows + the offset number of rows to get the correct result + if (strpos($query, 'SELECT DISTINCT') === 0) { - // We need to grab the total number of rows + the offset number of rows to get the correct result - if (strpos($query, 'SELECT DISTINCT') === 0) - { - $query = 'SELECT DISTINCT TOP ' . ($total + $offset) . ' ' . substr($query, 15); - } - else - { - $query = 'SELECT TOP ' . ($total + $offset) . ' ' . substr($query, 6); - } + $query = 'SELECT DISTINCT TOP ' . ($total + $offset) . ' ' . substr($query, 15); } - - $result = $this->sql_query($query, $cache_ttl); - - // Seek by $offset rows - if ($offset) + else { - $this->sql_rowseek($offset, $result); + $query = 'SELECT TOP ' . ($total + $offset) . ' ' . substr($query, 6); } - - return $result; } - else + + $result = $this->sql_query($query, $cache_ttl); + + // Seek by $offset rows + if ($offset) { - return false; + $this->sql_rowseek($offset, $result); } + + return $result; } /** diff --git a/phpBB/includes/db/mssql_odbc.php b/phpBB/includes/db/mssql_odbc.php index 2cb3bf0f2d..0b8f1e2a95 100644 --- a/phpBB/includes/db/mssql_odbc.php +++ b/phpBB/includes/db/mssql_odbc.php @@ -156,40 +156,33 @@ class dbal_mssql_odbc extends dbal /** * Build LIMIT query */ - function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) + function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) { - if ($query != '') + $this->query_result = false; + + // Since TOP is only returning a set number of rows we won't need it if total is set to 0 (return all rows) + if ($total) { - $this->query_result = false; - - // Since TOP is only returning a set number of rows we won't need it if total is set to 0 (return all rows) - if ($total) + // We need to grab the total number of rows + the offset number of rows to get the correct result + if (strpos($query, 'SELECT DISTINCT') === 0) { - // We need to grab the total number of rows + the offset number of rows to get the correct result - if (strpos($query, 'SELECT DISTINCT') === 0) - { - $query = 'SELECT DISTINCT TOP ' . ($total + $offset) . ' ' . substr($query, 15); - } - else - { - $query = 'SELECT TOP ' . ($total + $offset) . ' ' . substr($query, 6); - } + $query = 'SELECT DISTINCT TOP ' . ($total + $offset) . ' ' . substr($query, 15); } - - $result = $this->sql_query($query, $cache_ttl); - - // Seek by $offset rows - if ($offset) + else { - $this->sql_rowseek($offset, $result); + $query = 'SELECT TOP ' . ($total + $offset) . ' ' . substr($query, 6); } - - return $result; } - else + + $result = $this->sql_query($query, $cache_ttl); + + // Seek by $offset rows + if ($offset) { - return false; + $this->sql_rowseek($offset, $result); } + + return $result; } /** diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php index 89a6e21d70..b750618ae6 100644 --- a/phpBB/includes/db/mysql.php +++ b/phpBB/includes/db/mysql.php @@ -163,27 +163,20 @@ class dbal_mysql extends dbal /** * Build LIMIT query */ - function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) + function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) { - if ($query != '') + $this->query_result = false; + + // if $total is set to 0 we do not want to limit the number of rows + if ($total == 0) { - $this->query_result = false; - - // if $total is set to 0 we do not want to limit the number of rows - if ($total == 0) - { - // Having a value of -1 was always a bug - $total = '18446744073709551615'; - } - - $query .= "\n LIMIT " . ((!empty($offset)) ? $offset . ', ' . $total : $total); - - return $this->sql_query($query, $cache_ttl); - } - else - { - return false; + // Having a value of -1 was always a bug + $total = '18446744073709551615'; } + + $query .= "\n LIMIT " . ((!empty($offset)) ? $offset . ', ' . $total : $total); + + return $this->sql_query($query, $cache_ttl); } /** diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php index 86700744fb..da6faa3983 100644 --- a/phpBB/includes/db/mysqli.php +++ b/phpBB/includes/db/mysqli.php @@ -142,27 +142,20 @@ class dbal_mysqli extends dbal /** * Build LIMIT query */ - function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) + function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) { - if ($query != '') + $this->query_result = false; + + // if $total is set to 0 we do not want to limit the number of rows + if ($total == 0) { - $this->query_result = false; - - // if $total is set to 0 we do not want to limit the number of rows - if ($total == 0) - { - // MySQL 4.1+ no longer supports -1 in limit queries - $total = '18446744073709551615'; - } - - $query .= "\n LIMIT " . ((!empty($offset)) ? $offset . ', ' . $total : $total); - - return $this->sql_query($query, $cache_ttl); - } - else - { - return false; + // MySQL 4.1+ no longer supports -1 in limit queries + $total = '18446744073709551615'; } + + $query .= "\n LIMIT " . ((!empty($offset)) ? $offset . ', ' . $total : $total); + + return $this->sql_query($query, $cache_ttl); } /** diff --git a/phpBB/includes/db/oracle.php b/phpBB/includes/db/oracle.php index 8f65c667a7..dcb972d119 100644 --- a/phpBB/includes/db/oracle.php +++ b/phpBB/includes/db/oracle.php @@ -213,20 +213,13 @@ class dbal_oracle extends dbal /** * Build LIMIT query */ - function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) + function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) { - if ($query != '') - { - $this->query_result = false; + $this->query_result = false; - $query = 'SELECT * FROM (SELECT /*+ FIRST_ROWS */ rownum AS xrownum, a.* FROM (' . $query . ') a WHERE rownum <= ' . ($offset + $total) . ') WHERE xrownum >= ' . $offset; + $query = 'SELECT * FROM (SELECT /*+ FIRST_ROWS */ rownum AS xrownum, a.* FROM (' . $query . ') a WHERE rownum <= ' . ($offset + $total) . ') WHERE xrownum >= ' . $offset; - return $this->sql_query($query, $cache_ttl); - } - else - { - return false; - } + return $this->sql_query($query, $cache_ttl); } /** diff --git a/phpBB/includes/db/postgres.php b/phpBB/includes/db/postgres.php index c06786a795..c0a8d930e1 100644 --- a/phpBB/includes/db/postgres.php +++ b/phpBB/includes/db/postgres.php @@ -192,26 +192,19 @@ class dbal_postgres extends dbal /** * Build LIMIT query */ - function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) + function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) { - if ($query != '') + $this->query_result = false; + + // if $total is set to 0 we do not want to limit the number of rows + if ($total == 0) { - $this->query_result = false; - - // if $total is set to 0 we do not want to limit the number of rows - if ($total == 0) - { - $total = -1; - } - - $query .= "\n LIMIT $total OFFSET $offset"; - - return $this->sql_query($query, $cache_ttl); - } - else - { - return false; + $total = -1; } + + $query .= "\n LIMIT $total OFFSET $offset"; + + return $this->sql_query($query, $cache_ttl); } /** diff --git a/phpBB/includes/db/sqlite.php b/phpBB/includes/db/sqlite.php index 708376881c..9f44bd6b35 100644 --- a/phpBB/includes/db/sqlite.php +++ b/phpBB/includes/db/sqlite.php @@ -141,26 +141,19 @@ class dbal_sqlite extends dbal /** * Build LIMIT query */ - function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) + function _sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0) { - if ($query != '') + $this->query_result = false; + + // if $total is set to 0 we do not want to limit the number of rows + if ($total == 0) { - $this->query_result = false; - - // if $total is set to 0 we do not want to limit the number of rows - if ($total == 0) - { - $total = -1; - } - - $query .= "\n LIMIT " . ((!empty($offset)) ? $offset . ', ' . $total : $total); - - return $this->sql_query($query, $cache_ttl); - } - else - { - return false; + $total = -1; } + + $query .= "\n LIMIT " . ((!empty($offset)) ? $offset . ', ' . $total : $total); + + return $this->sql_query($query, $cache_ttl); } /** diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index c9d820ae03..7a99a551cc 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1285,8 +1285,11 @@ function generate_pagination($base_url, $num_items, $per_page, $start_item, $add { global $template, $user; + // Make sure $per_page is a valid value + $per_page = ($per_page <= 0) ? 1 : $per_page; + $seperator = '' . $user->lang['PAGINATION_SEPERATOR'] . ''; - $total_pages = ceil($num_items/$per_page); + $total_pages = ceil($num_items / $per_page); if ($total_pages == 1 || !$num_items) { @@ -1361,6 +1364,9 @@ function on_page($num_items, $per_page, $start) { global $template, $user; + // Make sure $per_page is a valid value + $per_page = ($per_page <= 0) ? 1 : $per_page; + $on_page = floor($start / $per_page) + 1; $template->assign_vars(array( @@ -1503,12 +1509,6 @@ function redirect($url, $return = false) // Make sure no &'s are in, this will break the redirect $url = str_replace('&', '&', $url); - // Make sure no linebreaks are there... to prevent http response splitting for PHP < 4.4.2 - if (strpos(urldecode($url), "\n") !== false || strpos(urldecode($url), "\r") !== false) - { - trigger_error('Tried to redirect to potentially insecure url.', E_USER_ERROR); - } - // Determine which type of redirect we need to handle... $url_parts = parse_url($url); diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index e1e6496c36..601eaa544c 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -504,20 +504,23 @@ function topic_generate_pagination($replies, $url) { global $config, $user; - if (($replies + 1) > $config['posts_per_page']) + // Make sure $per_page is a valid value + $per_page = ($config['posts_per_page'] <= 0) ? 1 : $config['posts_per_page']; + + if (($replies + 1) > $per_page) { - $total_pages = ceil(($replies + 1) / $config['posts_per_page']); + $total_pages = ceil(($replies + 1) / $per_page); $pagination = ''; $times = 1; - for ($j = 0; $j < $replies + 1; $j += $config['posts_per_page']) + for ($j = 0; $j < $replies + 1; $j += $per_page) { $pagination .= '' . $times . ''; if ($times == 1 && $total_pages > 4) { $pagination .= ' ... '; $times = $total_pages - 3; - $j += ($total_pages - 4) * $config['posts_per_page']; + $j += ($total_pages - 4) * $per_page; } else if ($times < $total_pages) { diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 20f043c890..d0923f7d36 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1240,7 +1240,7 @@ function get_folder_status($folder_id, $folder) /** * Submit PM */ -function submit_pm($mode, $subject, &$data, $update_message, $put_in_outbox = true) +function submit_pm($mode, $subject, &$data, $put_in_outbox = true) { global $db, $auth, $config, $phpEx, $template, $user, $phpbb_root_path; diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 25ac6f24eb..3e60580293 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -817,9 +817,11 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas } // Fetch currently set bans of the specified type and exclude state. Prevent duplicate bans. + $sql_where = ($type == 'ban_userid') ? 'ban_userid <> 0' : "$type <> ''"; + $sql = "SELECT $type FROM " . BANLIST_TABLE . " - WHERE $type <> '' + WHERE $sql_where AND ban_exclude = $ban_exclude"; $result = $db->sql_query($sql); @@ -1148,15 +1150,19 @@ function validate_match($string, $optional = false, $match) * Also checks if it includes the " character, which we don't allow in usernames. * Used for registering, changing names, and posting anonymously with a username * +* @param string $username The username to check +* @param string $allowed_username An allowed username, default being $user->data['username'] +* * @return mixed Either false if validation succeeded or a string which will be used as the error message (with the variable name appended) */ -function validate_username($username) +function validate_username($username, $allowed_username = false) { global $config, $db, $user, $cache; $clean_username = utf8_clean_string($username); + $allowed_username = ($allowed_username === false) ? $user->data['username_clean'] : utf8_clean_string($allowed_username); - if (utf8_clean_string($user->data['username']) == $clean_username) + if ($allowed_username == $clean_username) { return false; } @@ -1190,7 +1196,6 @@ function validate_username($username) return 'USERNAME_TAKEN'; } - $bad_usernames = $cache->obtain_disallowed_usernames(); foreach ($bad_usernames as $bad_username) @@ -1725,6 +1730,8 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow $name = ($type == GROUP_SPECIAL) ? $user->lang['G_' . $name] : $name; add_log('admin', $log, $name); + + group_update_listings($group_id); } return (sizeof($error)) ? $error : false; @@ -2013,6 +2020,8 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false, add_log('admin', $log, $group_name, implode(', ', $username_ary)); + group_update_listings($group_id); + // Return false - no error return false; } @@ -2115,13 +2124,17 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna add_log('admin', $log, $group_name, implode(', ', $username_ary)); + group_update_listings($group_id); + return true; } /** * Set users default group +* +* @private */ -function group_set_user_default($group_id, $user_id_ary, $group_attributes = false) +function group_set_user_default($group_id, $user_id_ary, $group_attributes = false, $update_listing = false) { global $db; @@ -2212,6 +2225,11 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal set_config('newest_user_colour', $sql_ary['user_colour'], true); } } + + if ($update_listing) + { + group_update_listings($group_id); + } } /** diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index 9c51990ef0..9d0d15b917 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -129,14 +129,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info) $posts_unapproved = ($row['topic_approved'] && $row['topic_replies'] < $row['topic_replies_real'] && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false; $u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? $url . '&i=queue&mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . '&t=' . $row['topic_id'] : ''; - $template->assign_block_vars('topicrow', array( - 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&f=$forum_id&t={$row['topic_id']}&mode=topic_view"), - - 'S_SELECT_TOPIC' => ($action == 'merge_select' && $row['topic_id'] != $topic_id) ? true : false, - 'U_SELECT_TOPIC' => $url . "&i=$id&mode=topic_view&action=merge&to_topic_id=" . $row['topic_id'] . $selected_ids, - 'U_MCP_QUEUE' => $u_mcp_queue, - 'U_MCP_REPORT' => ($auth->acl_get('m_report', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=topic_view&t=' . $row['topic_id'] . '&action=reports') : '', - + $topic_row = array( 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['topic_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', 'TOPIC_FOLDER_IMG' => $user->img($folder_img, $folder_alt), 'TOPIC_FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'), @@ -159,16 +152,38 @@ function mcp_forum_view($id, $mode, $action, $forum_info) 'TOPIC_TITLE' => $topic_title, 'REPLIES' => ($auth->acl_get('m_approve', $row['forum_id'])) ? $row['topic_replies_real'] : $row['topic_replies'], 'LAST_POST_TIME' => $user->format_date($row['topic_last_post_time']), - 'TOPIC_ID' => $row['topic_id'], - 'S_TOPIC_CHECKED' => ($topic_id_list && in_array($row['topic_id'], $topic_id_list)) ? 'checked="checked" ' : '', 'FIRST_POST_TIME' => $user->format_date($row['topic_time']), 'LAST_POST_SUBJECT' => $row['topic_last_post_subject'], 'LAST_VIEW_TIME' => $user->format_date($row['topic_last_view_time']), 'S_TOPIC_REPORTED' => (!empty($row['topic_reported']) && $auth->acl_get('m_report', $row['forum_id'])) ? true : false, 'S_TOPIC_UNAPPROVED' => $topic_unapproved, - 'S_POSTS_UNAPPROVED' => $posts_unapproved) + 'S_POSTS_UNAPPROVED' => $posts_unapproved, ); + + if ($row['topic_status'] == ITEM_MOVED) + { + $topic_row = array_merge($topic_row, array( + 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t={$row['topic_moved_id']}"), + 'S_MOVED_TOPIC' => true, + 'TOPIC_ID' => $row['topic_moved_id'], + )); + } + else + { + $topic_row = array_merge($topic_row, array( + 'U_VIEW_TOPIC' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=$id&f=$forum_id&t={$row['topic_id']}&mode=topic_view"), + + 'S_SELECT_TOPIC' => ($action == 'merge_select' && $row['topic_id'] != $topic_id) ? true : false, + 'U_SELECT_TOPIC' => $url . "&i=$id&mode=topic_view&action=merge&to_topic_id=" . $row['topic_id'] . $selected_ids, + 'U_MCP_QUEUE' => $u_mcp_queue, + 'U_MCP_REPORT' => ($auth->acl_get('m_report', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&mode=topic_view&t=' . $row['topic_id'] . '&action=reports') : '', + 'TOPIC_ID' => $row['topic_id'], + 'S_TOPIC_CHECKED' => ($topic_id_list && in_array($row['topic_id'], $topic_id_list)) ? true : false, + )); + } + + $template->assign_block_vars('topicrow', $topic_row); } unset($topic_rows); } diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index 4ad8efeda3..09b3f6f314 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -386,6 +386,12 @@ function split_topic($action, $topic_id, $to_forum_id, $subject) $to_topic_id = $db->sql_nextid(); move_posts($post_id_list, $to_topic_id); + $topic_info = get_post_data(array($topic_id)); + $topic_info = $topic_info[$topic_id]; + + add_log('mod', $to_forum_id, $to_topic_id, 'LOG_SPLIT_DESTINATION', $subject); + add_log('mod', $forum_id, $topic_id, 'LOG_SPLIT_SOURCE', $topic_info['topic_title']); + // Change topic title of first post $sql = 'UPDATE ' . POSTS_TABLE . " SET post_subject = '" . $db->sql_escape($subject) . "' diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php index dc7a4870cd..a0a61110e1 100755 --- a/phpBB/includes/mcp/mcp_warn.php +++ b/phpBB/includes/mcp/mcp_warn.php @@ -432,7 +432,7 @@ function add_warning($user_row, $warning, $send_pm = true, $post_id = 0) 'address_list' => array('u' => array($user_row['user_id'] => 'to')), ); - submit_pm('post', $lang['WARNING_PM_SUBJECT'], $pm_data, false, false); + submit_pm('post', $lang['WARNING_PM_SUBJECT'], $pm_data, false); } add_log('admin', 'LOG_USER_WARNING', $user_row['username']); diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index c97fc99652..119f496d21 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -799,7 +799,6 @@ class ucp_groups group_user_attributes('default', $group_id, $mark_ary, false, $group_row['group_name'], $group_row); } - group_update_listings($group_id); $user->add_lang('acp/groups'); trigger_error($user->lang['GROUP_DEFS_UPDATED'] . $return_page); diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 2e7ace4567..714f5ec0aa 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -558,7 +558,7 @@ function compose_pm($id, $mode, $action) unset($message_parser); // ((!$message_subject) ? $subject : $message_subject) - $msg_id = submit_pm($action, $subject, $pm_data, true); + $msg_id = submit_pm($action, $subject, $pm_data); $return_message_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&mode=view&p=' . $msg_id); $return_folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=outbox'); diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php index d301e2ecb9..4ce5b81fce 100644 --- a/phpBB/includes/ucp/ucp_pm_viewfolder.php +++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php @@ -239,7 +239,9 @@ function view_folder($id, $mode, $folder_id, $folder) $template->assign_vars(array( 'S_SHOW_RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? true : false, - 'S_SHOW_COLOUR_LEGEND' => true) + 'S_SHOW_COLOUR_LEGEND' => true, + + 'S_PM_ICONS' => ($config['enable_pm_icons']) ? true : false) ); } } diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index e0d375c7ff..b5d2ae19d8 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -60,7 +60,7 @@ class ucp_profile { $check_ary['username'] = array( array('string', false, $config['min_name_chars'], $config['max_name_chars']), - array('username', $data['username']), + array('username'), ); } diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 90583c8a5a..64a4c46bb8 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -329,6 +329,12 @@ $database_update_info = array( 'prune_viewed' => array('UINT', 0), 'prune_freq' => array('UINT', 0), ), + PRIVMSGS_RULES_TABLE => array( + 'rule_folder_id' => array('UINT', 0), + ), + PRIVMSGS_TO_TABLE => array( + 'folder_id' => array('UINT', 0), + ), ), // Remove the following keys 'drop_keys' => array( diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index 545642ab74..61ec3e2c9e 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -511,7 +511,7 @@ CREATE TABLE phpbb_privmsgs_rules ( rule_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, rule_group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, rule_action mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - rule_folder_id int(4) DEFAULT '0' NOT NULL, + rule_folder_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (rule_id), KEY user_id (user_id) ); @@ -528,7 +528,7 @@ CREATE TABLE phpbb_privmsgs_to ( pm_replied tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, pm_marked tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, pm_forwarded tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - folder_id int(4) DEFAULT '0' NOT NULL, + folder_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, KEY msg_id (msg_id), KEY author_id (author_id), KEY usr_flder_id (user_id, folder_id) diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index 05d81ab209..1f1396e9e8 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -511,7 +511,7 @@ CREATE TABLE phpbb_privmsgs_rules ( rule_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, rule_group_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, rule_action mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, - rule_folder_id int(4) DEFAULT '0' NOT NULL, + rule_folder_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (rule_id), KEY user_id (user_id) ) CHARACTER SET `utf8` COLLATE `utf8_bin`; @@ -528,7 +528,7 @@ CREATE TABLE phpbb_privmsgs_to ( pm_replied tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, pm_marked tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, pm_forwarded tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, - folder_id int(4) DEFAULT '0' NOT NULL, + folder_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, KEY msg_id (msg_id), KEY author_id (author_id), KEY usr_flder_id (user_id, folder_id) diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 9f3d287e83..f926ff478b 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -989,7 +989,7 @@ CREATE TABLE phpbb_privmsgs_rules ( rule_user_id number(8) DEFAULT '0' NOT NULL, rule_group_id number(8) DEFAULT '0' NOT NULL, rule_action number(8) DEFAULT '0' NOT NULL, - rule_folder_id number(4) DEFAULT '0' NOT NULL, + rule_folder_id number(8) DEFAULT '0' NOT NULL, CONSTRAINT pk_phpbb_privmsgs_rules PRIMARY KEY (rule_id) ) / @@ -1026,7 +1026,7 @@ CREATE TABLE phpbb_privmsgs_to ( pm_replied number(1) DEFAULT '0' NOT NULL, pm_marked number(1) DEFAULT '0' NOT NULL, pm_forwarded number(1) DEFAULT '0' NOT NULL, - folder_id number(4) DEFAULT '0' NOT NULL + folder_id number(8) DEFAULT '0' NOT NULL ) / diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index d0005a16a7..aa3eb59c46 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -691,7 +691,7 @@ CREATE TABLE phpbb_privmsgs_rules ( rule_user_id INT4 DEFAULT '0' NOT NULL CHECK (rule_user_id >= 0), rule_group_id INT4 DEFAULT '0' NOT NULL CHECK (rule_group_id >= 0), rule_action INT4 DEFAULT '0' NOT NULL CHECK (rule_action >= 0), - rule_folder_id INT4 DEFAULT '0' NOT NULL, + rule_folder_id INT4 DEFAULT '0' NOT NULL CHECK (rule_folder_id >= 0), PRIMARY KEY (rule_id) ); @@ -710,7 +710,7 @@ CREATE TABLE phpbb_privmsgs_to ( pm_replied INT2 DEFAULT '0' NOT NULL CHECK (pm_replied >= 0), pm_marked INT2 DEFAULT '0' NOT NULL CHECK (pm_marked >= 0), pm_forwarded INT2 DEFAULT '0' NOT NULL CHECK (pm_forwarded >= 0), - folder_id INT4 DEFAULT '0' NOT NULL + folder_id INT4 DEFAULT '0' NOT NULL CHECK (folder_id >= 0) ); CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to (msg_id); diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 184d2332ab..ccc531a989 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -495,7 +495,7 @@ CREATE TABLE phpbb_privmsgs_rules ( rule_user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', rule_group_id INTEGER UNSIGNED NOT NULL DEFAULT '0', rule_action INTEGER UNSIGNED NOT NULL DEFAULT '0', - rule_folder_id int(4) NOT NULL DEFAULT '0' + rule_folder_id INTEGER UNSIGNED NOT NULL DEFAULT '0' ); CREATE INDEX phpbb_privmsgs_rules_user_id ON phpbb_privmsgs_rules (user_id); @@ -511,7 +511,7 @@ CREATE TABLE phpbb_privmsgs_to ( pm_replied INTEGER UNSIGNED NOT NULL DEFAULT '0', pm_marked INTEGER UNSIGNED NOT NULL DEFAULT '0', pm_forwarded INTEGER UNSIGNED NOT NULL DEFAULT '0', - folder_id int(4) NOT NULL DEFAULT '0' + folder_id INTEGER UNSIGNED NOT NULL DEFAULT '0' ); CREATE INDEX phpbb_privmsgs_to_msg_id ON phpbb_privmsgs_to (msg_id); diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 8ac4602dd9..09f6ddcc35 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -451,6 +451,9 @@ $lang = array_merge($lang, array( 'LOG_LOCK_POST' => 'Locked post
» %s', 'LOG_MERGE' => 'Merged posts into topic
» %s', 'LOG_MOVE' => 'Moved topic
» from %s', + 'LOG_SPLIT_DESTINATION' => 'Moved splitted posts
» to %s', + 'LOG_SPLIT_SOURCE' => 'Splitted posts
» from %s', + 'LOG_TOPIC_DELETED' => 'Deleted topic
» %s', 'LOG_TOPIC_RESYNC' => 'Resynchronised topic counters
» %s', 'LOG_TOPIC_TYPE_CHANGED' => 'Changed topic type
» %s', diff --git a/phpBB/language/en/acp/profile.php b/phpBB/language/en/acp/profile.php index dcdb5bec18..f690f6fdb7 100644 --- a/phpBB/language/en/acp/profile.php +++ b/phpBB/language/en/acp/profile.php @@ -62,7 +62,7 @@ $lang = array_merge($lang, array( 'DISPLAY_AT_REGISTER' => 'Display at registration screen', 'DISPLAY_AT_REGISTER_EXPLAIN' => 'If this option is enabled, the field will be displayed on registration and able to be changed within the user control panel.', 'DISPLAY_PROFILE_FIELD' => 'Display profile field', - 'DISPLAY_PROFILE_FIELD_EXPLAIN' => 'The profile field will be shown on viewtopic/viewprofile/memberlist/etc.', + 'DISPLAY_PROFILE_FIELD_EXPLAIN' => 'The profile field will be shown on viewtopic/viewprofile/memberlist. if this is enabled within the load settings. Only showing within the users profile is enabled by default.', 'DROPDOWN_ENTRIES_EXPLAIN' => 'Enter your options now, every option in one line', 'EDIT_DROPDOWN_LANG_EXPLAIN' => 'Please note that you are able to change your options text and also able to add new options to the end. It is not advised to add new options between existing options - this could result in wrong options assigned to your users. This can also happen if you remove options in-between. Removing options from the end result in users having assigned this item now reverting back to the default one.', diff --git a/phpBB/language/en/acp/users.php b/phpBB/language/en/acp/users.php index 6b8935334c..2424a88e2b 100644 --- a/phpBB/language/en/acp/users.php +++ b/phpBB/language/en/acp/users.php @@ -119,8 +119,6 @@ $lang = array_merge($lang, array( 'USER_RANK_UPDATED' => 'User rank updated.', 'USER_SIG_UPDATED' => 'User signature successfully updated.', 'USER_TOOLS' => 'Basic tools', - - 'WARNINGS_EXPLAIN' => 'You can directly alter the warnings this users has received.', )); ?> \ No newline at end of file diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index c650b2b388..fbeaa3e699 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -124,6 +124,7 @@ $lang = array_merge($lang, array( 'NOTIFY_REPLY' => 'Send me an email when a reply is posted', 'NOT_UPLOADED' => 'File could not be uploaded.', 'NO_DELETE_POLL_OPTIONS' => 'You cannot delete existing poll options', + 'NO_PM_ICON' => 'No PM icon', 'NO_POLL_TITLE' => 'You have to enter a poll title', 'NO_POST' => 'The requested post does not exist.', 'NO_POST_MODE' => 'No post mode specified', diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 13a170e357..31647cfe89 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -1202,7 +1202,7 @@ switch ($mode) 'S_SEARCH_USER' => true, 'S_FORM_NAME' => $form, 'S_FIELD_NAME' => $field, - 'S_SELECT_SINGLE' => $select_single, + 'S_SELECT_SINGLE' => $select_single, 'S_COUNT_OPTIONS' => $s_find_count, 'S_SORT_OPTIONS' => $s_sort_key, 'S_JOINED_TIME_OPTIONS' => $s_find_join_time, @@ -1239,7 +1239,8 @@ switch ($mode) $id_cache = array(); while ($row = $db->sql_fetchrow($result)) { - $row['session_time'] = (!empty($session_times[$row['user_id']])) ? $session_times[$row['user_id']] : ''; + $row['session_time'] = (!empty($session_times[$row['user_id']])) ? $session_times[$row['user_id']] : 0; + $row['last_visit'] = (!empty($row['session_time'])) ? $row['session_time'] : $row['user_lastvisit']; $id_cache[$row['user_id']] = $row; } @@ -1255,6 +1256,13 @@ switch ($mode) $profile_fields_cache = $cp->generate_profile_fields_template('grab', array_keys($id_cache)); } + // If we sort by last active date we need to adjust the id cache due to user_lastvisit not being the last active date... + if ($sort_key == 'l') + { + $lesser_than = ($sort_dir == 'a') ? -1 : 1; + uasort($id_cache, create_function('$first, $second', "return (\$first['last_visit'] == \$second['last_visit']) ? 0 : ((\$first['last_visit'] < \$second['last_visit']) ? $lesser_than : ($lesser_than * -1));")); + } + $i = 0; foreach ($id_cache as $user_id => $row) { diff --git a/phpBB/posting.php b/phpBB/posting.php index 364cf26339..2bb1329d16 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -549,7 +549,8 @@ if ($submit || $preview || $refresh) $post_data['username'] = utf8_normalize_nfc(request_var('username', $post_data['username'], true)); $post_data['post_edit_reason'] = (!empty($_POST['edit_reason']) && $mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? utf8_normalize_nfc(request_var('edit_reason', '', true)) : ''; - + + $post_data['orig_topic_type'] = $post_data['topic_type']; $post_data['topic_type'] = request_var('topic_type', (($mode != 'post') ? (int) $post_data['topic_type'] : POST_NORMAL)); $post_data['topic_time_limit'] = request_var('topic_time_limit', (($mode != 'post') ? (int) $post_data['topic_time_limit'] : 0)); $post_data['icon_id'] = request_var('icon', 0); @@ -799,7 +800,16 @@ if ($submit || $preview || $refresh) if (!$auth->acl_get($auth_option, $forum_id)) { - $error[] = $user->lang['CANNOT_POST_' . str_replace('F_', '', strtoupper($auth_option))]; + // There is a special case where a user edits his post whereby the topic type got changed by an admin/mod + if ($mode == 'edit' && $post_data['poster_id'] == $user->data['user_id']) + { + // To prevent non-authed users messing around with the topic type we reset it to the original one. + $post_data['topic_type'] = $post_data['orig_topic_type']; + } + else + { + $error[] = $user->lang['CANNOT_POST_' . str_replace('F_', '', strtoupper($auth_option))]; + } } } diff --git a/phpBB/styles/subSilver/template/mcp_forum.html b/phpBB/styles/subSilver/template/mcp_forum.html index fe20a7eca0..4fad6e7269 100644 --- a/phpBB/styles/subSilver/template/mcp_forum.html +++ b/phpBB/styles/subSilver/template/mcp_forum.html @@ -40,7 +40,9 @@

{topicrow.REPLIES}

{topicrow.LAST_POST_TIME}

- + + checked="checked" />  + diff --git a/phpBB/styles/subSilver/template/posting_body.html b/phpBB/styles/subSilver/template/posting_body.html index b99b902437..12fa6329c1 100644 --- a/phpBB/styles/subSilver/template/posting_body.html +++ b/phpBB/styles/subSilver/template/posting_body.html @@ -121,13 +121,13 @@ - + {L_ICON}: - +
{L_NO_TOPIC_ICON} {L_NO_TOPIC_ICON}{L_NO_PM_ICON}
diff --git a/phpBB/styles/subSilver/template/viewforum_body.html b/phpBB/styles/subSilver/template/viewforum_body.html index 86715b1f29..dc2fa082fa 100644 --- a/phpBB/styles/subSilver/template/viewforum_body.html +++ b/phpBB/styles/subSilver/template/viewforum_body.html @@ -116,7 +116,7 @@

- + diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 41ed374c3b..4dc7768b30 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -152,9 +152,11 @@ if (!($forum_data['forum_type'] == FORUM_POST || (($forum_data['forum_flags'] & if (!$auth->acl_get('f_read', $forum_id)) { $template->assign_vars(array( + 'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id&start=$start"), + 'S_NO_READ_ACCESS' => true, 'S_AUTOLOGIN_ENABLED' => ($config['allow_autologin']) ? true : false, - 'S_LOGIN_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login&redirect=' . urlencode(build_url(array('_f_')))) + 'S_LOGIN_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') . '&redirect=' . urlencode(build_url(array('_f_'))), )); page_footer(); diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index ffcc826f7b..84fc056ed1 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -493,7 +493,7 @@ $allow_change_type = ($auth->acl_get('m_', $forum_id) || ($user->data['is_regist $topic_mod = ''; $topic_mod .= ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && $user->data['user_id'] == $topic_data['topic_poster'] && $topic_data['topic_status'] == ITEM_UNLOCKED)) ? (($topic_data['topic_status'] == ITEM_UNLOCKED) ? '' : '') : ''; $topic_mod .= ($auth->acl_get('m_delete', $forum_id)) ? '' : ''; -$topic_mod .= ($auth->acl_get('m_move', $forum_id)) ? '' : ''; +$topic_mod .= ($auth->acl_get('m_move', $forum_id) && $topic_data['topic_status'] != ITEM_MOVED) ? '' : ''; $topic_mod .= ($auth->acl_get('m_split', $forum_id)) ? '' : ''; $topic_mod .= ($auth->acl_get('m_merge', $forum_id)) ? '' : ''; $topic_mod .= ($auth->acl_get('m_move', $forum_id)) ? '' : ''; From a815c191a42f59f8dc3efa8d39934a8f0e7da1cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Wed, 17 Jan 2007 19:41:52 +0000 Subject: [PATCH 210/264] #7198 and some related issues git-svn-id: file:///svn/phpbb/trunk@6895 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/acp_groups.html | 12 ++---- phpBB/adm/style/acp_inactive.html | 28 ++++++------- phpBB/adm/style/acp_logs.html | 40 ++++++++---------- phpBB/adm/style/acp_users.html | 68 ++++++++++++++++--------------- 4 files changed, 69 insertions(+), 79 deletions(-) diff --git a/phpBB/adm/style/acp_groups.html b/phpBB/adm/style/acp_groups.html index 753cfd0f63..0ff4afd1ad 100644 --- a/phpBB/adm/style/acp_groups.html +++ b/phpBB/adm/style/acp_groups.html @@ -221,20 +221,16 @@

{L_LOGIN_LOGOUT}

- -
@@ -190,11 +161,11 @@ {ICON_MOVE_UP_DISABLED} - {ICON_MOVE_DOWN} + {ICON_MOVE_DOWN} {ICON_MOVE_UP} {ICON_MOVE_DOWN} - + {ICON_MOVE_UP} {ICON_MOVE_DOWN_DISABLED} @@ -216,7 +187,7 @@ - +

{L_ROLE_ASSIGNED_TO}

@@ -225,8 +196,6 @@ - - - + \ No newline at end of file diff --git a/phpBB/adm/style/acp_permissions.html b/phpBB/adm/style/acp_permissions.html index 9b301f8f5c..f5a5f78c6b 100644 --- a/phpBB/adm/style/acp_permissions.html +++ b/phpBB/adm/style/acp_permissions.html @@ -337,14 +337,9 @@

-
- {L_PERMISSION_APPLIED_TO_ALL}
- {L_MARK_ALL}{L_UNMARK_ALL} -
-
- +


diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css index ee0977e51b..678265ec8b 100644 --- a/phpBB/adm/style/admin.css +++ b/phpBB/adm/style/admin.css @@ -183,7 +183,7 @@ a:hover { } /* Commented Backslash Hack hides rule from IE5-Mac \*/ -#tabs a span { float:none; } +#tabs a span { float:none;} /* End hack */ #tabs a:hover span { @@ -329,12 +329,12 @@ td { line-height: 1.2em; } -.row1 { background-color: #EFEFEF; } -.row2 { background-color: #DEE3E7; } -.row3 { background-color: #D1D7DC; } -.row4 { background-color: #E4E8EB; } -.col1 { background-color: #DEE3E7; } -.col2 { background-color: #EFEFEF; } +.row1 { background-color: #EFEFEF;} +.row2 { background-color: #DEE3E7;} +.row3 { background-color: #D1D7DC;} +.row4 { background-color: #E4E8EB;} +.col1 { background-color: #DEE3E7;} +.col2 { background-color: #EFEFEF;} .spacer { background-color: #D1D7DC; @@ -364,44 +364,33 @@ table.type2 td { /* General form styles ----------------------------------------*/ -fieldset { +fieldset { + background-color: #DDD; + padding: 10px; margin: 15px 0; - padding: 10px; border-right: 1px solid #AFAEAA; border-bottom: 1px solid #AFAEAA; border-left: 1px solid #D5D5C8; border-top: 1px solid #D5D5C8; - background-color: #ECECEC; + background-color: #ECECEC; position: relative; } - -* html fieldset { - padding: 0 10px 5px 10px; +legend { + position: absolute; + top: -0.5em; + font-size: 1.1em; + color:#006699; + font-family: "Lucida Grande",Arial,Verdana,Sans-serif; + font-weight: bold; + line-height: 100%; + text-transform: uppercase; + } fieldset p { font-size: 1.1em; } -legend { - padding: 1px 0; - font-family: "Lucida Grande", Arial, Verdana,Sans-serif; - font-size: 1.1em; - font-weight: bold; - color: #006699; - position: relative; - text-transform: uppercase; - line-height: 100%; - top: 0em; - vertical-align:middle; -} - -* html legend { - margin-bottom: -10px; - margin-left: -7px; - top: -1.2em; -} - input { font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif; font-size: 100%; @@ -440,7 +429,7 @@ option { .sep { color: black; - background-color: #FFA34F; + font-weight: bold; } textarea { @@ -543,11 +532,11 @@ dt { width: auto; } -dd { color: #000; } -dd + dd { padding-top: 5px; } -dt span { padding-right: 5px; } +dd { color: #000;} +dd + dd { padding-top: 5px;} +dt span { padding-right: 5px;} -dt .explain { font-style: italic; } +dt .explain { font-style: italic;} dt label { font-size: 100%; @@ -560,7 +549,7 @@ dd label { margin-right: 10px; } -html>body dd label input { vertical-align: text-bottom; } /* Tweak for Moz to align checkboxes/radio buttons nicely */ +html>body dd label input { vertical-align: text-bottom;} /* Tweak for Moz to align checkboxes/radio buttons nicely */ dd input, dd select { @@ -687,12 +676,12 @@ textarea.full { width: 99%; } -* html input.full, * html textarea.full { width: 95%; } -input.medium { width: 50%; } -input.narrow { width: 25%; } -input.tiny { width: 10%; } -input.autowidth { width: auto !important; } -.box2 .inputbox { background-color: #E9E9E9; } +* html input.full, * html textarea.full { width: 95%;} +input.medium { width: 50%;} +input.narrow { width: 25%;} +input.tiny { width: 10%;} +input.autowidth { width: auto !important;} +.box2 .inputbox { background-color: #E9E9E9;} /* Pagination @@ -771,169 +760,6 @@ a.button2, a.button2:link, a.button2:visited, a.button2:active { padding: 4px 8px; } -/* Permission related ----------------------------------------- */ - -.permissions { - margin: 15px 0 0 0; - padding: 0; - border: none; - background-color: transparent; -} - -.permissions table { - width: 100%; - /*empty-cells: hide;*/ - border: 1px solid #CCCFD3; - background-color: #FFFFFF; - padding: 1px; -} - -.permissions th { - padding: 3px 4px; - color: #FFFFFF; - background: #DDE1E4 url("../images/gradient2b.gif") bottom left repeat-x; - border-top: 1px solid #6DACD2; - border-bottom: 1px solid #327AA5; - text-align: left; - font-size: .85em; - text-transform: uppercase; -} - -.permissions td { - text-align: left; - font-size: 1.1em; - padding: 4px; - line-height: 120%; -} - -table.pmask { - border: none; - background: none; - padding: 0; -} - -table.pmask th { - background: none; - border-top: none; - text-align: center; - vertical-align: bottom; - color: #115098; - padding: 2px 0; -} - -table.pmask td { - padding: 0px; -} - -table.pmask td.name { - padding: 2px; - vertical-align: middle; -} - -.permissions th.name { - text-align: left; - width: auto; - padding-left: 4px; -} - -.permissions .entry { - text-align: left; - font-weight: normal; -} - -.permissions td.name { - text-align: left; - font-weight: bold; -} - -.permissions table.type3 { - float: right; - width: 350px; /* Setting the length of the permission view box */ - border: none; - background-color: transparent; - padding: 0; -} - -.permissions table.type3 thead th { - background-color: transparent; - border-top: none; - text-align: center; - color: #115098; - padding: 0 3px; - font-size: .9em; - font-weight: normal; - text-transform: none; -} - -.permissions table.type3 tbody th { - border-top: none; - text-align: left; - text-transform: none; - padding: 0; - border: none; - font-size: 1em; - font-weight: normal; - width: 100%; - vertical-align: middle; -} - -.permissions table.type3 td { - text-align: center; - padding: 1px; -} - -.permissions td.yes { - width: 20px; - background-color: #40C53D; -} - -.permissions td.never { - width: 20px; - background-color: #EC7181; -} - -.permissions td.no { - width: 20px; - background-color: transparent; -} - -/* Preset Styles ----------------------------------------- */ -.preset { - width: 60px; -} - -.preset a { - float: left; - display: block; - width: 100%; - height: 20px; - cursor: pointer; - background: transparent; -} - -.preset a:hover { - background: url("../images/arrow_down.gif") no-repeat 50% 50%; - text-decoration: none; -} - -.preset_yes { - background: #D3F3D2 url("../images/bg_hash1.gif") repeat; -} - -.preset_custom { - background: #DAE4EC url("../images/bg_hash2.gif") repeat; -} - -.preset_never { - background: #ECD7DA url("../images/bg_hash3.gif") repeat; -} - -.preset_no { - background: #ECD7DA url("../images/bg_hash4.gif") repeat; -} - /* Action Highlighting ---------------------------------------- */ .success { @@ -1086,3 +912,264 @@ table.pmask td.name { .syntaxstring { color: #DD0000; } + +/* Permission interface +---------------------------------------- */ + +fieldset.perm legend { + text-transform: none; +} + +/* Permission sections */ +fieldset.perm .perm_simple { + text-align: left; + padding-top: 3px; +} + +fieldset.perm .perm_advanced { + padding-left: 5px; + vertical-align: top; + clear: right; + padding-top: 10px; +} + +fieldset.perm .perm_switch { + float: right; + font-size: 1.1em; +} + +.perm_switch a { + text-decoration: underline; +} + +/* Tabbed menu */ +.perm_cat { + line-height: normal; + margin: 0 0 0px 7px; + min-width: 570px; + font-size: 1em; +} + +.perm_cat ul { + margin:0; + padding: 0; + list-style: none; +} + +.perm_cat li { + display: inline; + margin: 0; + padding: 0; + font-size: 1em; + font-weight: bold; +} + +.perm_cat a { + float: left; + background: url("../images/bg_tabs1.gif") no-repeat 0% -35px; + margin: 0 1px 0 0; + padding: 0 0 0 6px; + text-decoration: none; + position: relative; +} + +.perm_cat a span.tabbg { + float: left; + display: block; + background: url("../images/bg_tabs2.gif") no-repeat 100% -35px; + padding: 7px 12px 6px 6px; + color: #536482; + white-space: nowrap; +} + +/* Commented Backslash Hack hides rule from IE5-Mac \*/ +.perm_cat a span.tabbg { float:none;} +/* End hack */ + +.perm_cat a:hover span.tabbg { + color: #DD6900; +} + +.perm_cat .activetab a { + background-position: 0 0px; +} + +.perm_cat .activetab a span.tabbg { + background-position: 100% 0px; + padding-bottom: 7px; + color: #333333; +} + +.perm_cat a:hover { + background-position: 0 -70px; +} + +.perm_cat a:hover span.tabbg { + background-position: 100% -70px; +} + +.perm_cat .activetab a:hover span.tabbg { + color: #333333; + background-position: 100% 0px; +} + +.perm_cat .activetab a:hover { + background-position: 0 0px; +} + +.perm_cat a span.colour { + border: 1px solid #536482; + display: block; + float: left; + width: 10px; + height: 10px; + margin-right: 5px; +} + +.perm_cat .activetab span.colour { + border-color: #333333; +} + +.perm_cat a:hover span.colour { + border-color: #DD6900; +} + +.perm_cat .activetab a:hover span.colour { + border-color: #333333; +} + +/* Permission preset colours */ +.perm_preset_yes span.colour, +.yes { + background-color: #86F786; +} + +.perm_preset_custom span.colour { + background-color: #B2BBDD; +} + +.perm_preset_never span.colour { + background-color: #DD0000; +} + +.perm_preset_no span.colour, +.never { + background-color: #EFB0B2; +} + +/* Pemrission panel +---------------------------------------- */ +.perm_panel { + float: left; + background-color: #FFF; + width: 100%; + border: 1px solid #A9B8C2; + margin-top: -1px; +} + +.perm_panel span.corners-top { + background-image: url("../images/corners_left2.gif"); +} + +.perm_panel span.corners-top span { + background-image: url("../images/corners_right2.gif"); +} + +.perm_panel span.corners-bottom { + background-image: url("../images/corners_left2.gif"); +} + +.perm_panel span.corners-bottom span { + background-image: url("../images/corners_right2.gif"); +} + +.perm_panel span.corners-top, .perm_panel span.corners-bottom, +.perm_panel span.corners-top span, .perm_panel span.corners-bottom span { + font-size: 1px; + line-height: 1px; + display: block; + height: 5px; + background-repeat: no-repeat; +} + +.perm_panel span.corners-top { + background-image: url("../images/corners_left2.gif"); + background-position: 0 0; + margin: 0 0; +} + +.perm_panel span.corners-top span { + background-image: url("../images/corners_right2.gif"); + background-position: 100% 0; +} + +.perm_panel span.corners-bottom { + background-image: url("../images/corners_left2.gif"); + background-position: 0 100%; + margin: 0 0; + clear: both; +} + +.perm_panel span.corners-bottom span { + background-image: url("../images/corners_right2.gif"); + background-position: 100% 100%; +} + +/* Permission table +---------------------------------------- */ +.perm_panel .tablewrap { + margin: 0 10px; +} + +.perm_panel table { + width: 100%; +} + +.perm_panel th { + text-transform: none; +} + +.perm_panel th.value { + text-align: center; +} + +.perm_panel th.name { + text-align: left; + width: auto; + text-transform: none; +} + +.perm_panel th.permission_name { + border: none; + color: #536482; + font-weight: normal; +} + +.perm_panel th.permission_name a.trace { + display: inline; +} + +.perm_panel th.row3 { + background-image: none; + background-color: #D1D7DC; +} + +.perm_panel th.row4 { + background-image: none; + background-color: #E4E8EB; +} + +.perm_panel th a { + display: block; + color: #FFA34F; + text-decoration: underline; +} + +.perm_panel td { + padding: 0; + text-align: center; +} + +.perm_panel td label { + display: block; +} diff --git a/phpBB/adm/style/permission_mask.html b/phpBB/adm/style/permission_mask.html index 51b5bf9c63..86dbc0a5ee 100644 --- a/phpBB/adm/style/permission_mask.html +++ b/phpBB/adm/style/permission_mask.html @@ -5,251 +5,110 @@ var active_fmask = '0'; var active_cat = '0'; + var id = '000'; + var role_options = new Array(); {S_ROLE_JS_ARRAY} - - /** - * Show/hide option panels - * value = suffix for ID to show - */ - function swap_options(pmask, fmask, cat) - { - id = pmask + fmask + cat; - active_option = active_pmask + active_fmask + active_cat; - - if (id == active_option) - { - return; - } - - // Hide active options - dE('options' + active_option, -1); - dE('head' + active_pmask + active_fmask, 1, 'inline'); - dE('apply' + active_pmask + active_fmask, -1); - - // Display container - dE('options' + id, 1); - dE('head' + pmask + fmask, -1, 'inline'); - dE('apply' + pmask + fmask, 1); - - active_pmask = pmask; - active_fmask = fmask; - active_cat = cat; - } - - /** - * Mark all radio buttons in one panel - * id = table ID container, s = status ['y'/'u'/'n'] - */ - function mark_options(id, s) - { - var t = document.getElementById(id); - - if (!t) - { - return; - } - - var rb = t.getElementsByTagName('input'); - - for (var r = 0; r < rb.length; r++ ) - { - if (rb[r].id.substr(rb[r].id.length-1) == s) - { - rb[r].checked = true; - } - } - } - - /** - * Mark one radio button in one panel - * id = table ID container, field_name = the auth option, s = status ['y'/'u'/'n'] - */ - function mark_one_option(id, field_name, s) - { - var t = document.getElementById(id); - - if (!t) - { - return; - } - - var rb = t.getElementsByTagName('input'); - - for (var r = 0; r < rb.length; r++ ) - { - if (rb[r].id.substr(rb[r].id.length-field_name.length-3, field_name.length) == field_name && rb[r].id.substr(rb[r].id.length-1) == s) - { - rb[r].checked = true; - } - } - } - - /** - * Reset role dropdown field to Select role... if an option gets changed - */ - function reset_role(id) - { - var t = document.getElementById(id); - - if (!t) - { - return; - } - - t.options[0].selected = true; - } - - /** - * Load role and set options accordingly - */ - function set_role_settings(role_id, target_id) - { - settings = role_options[role_id]; - - if (!settings) - { - return; - } - - // Mark all options to no (unset) first... - mark_options(target_id, 'u'); - - for (var r in settings) - { - mark_one_option(target_id, r, (settings[r] == 1) ? 'y' : 'n'); - } - } - //--> +
+

{p_mask.NAME} [{p_mask.L_ACL_TYPE}]

-
- -
-

- {p_mask.NAME} {L_USER_IS_MEMBER_OF_DEFAULT}: {p_mask.USER_GROUPS_DEFAULT}
- {p_mask.NAME} {L_USER_IS_MEMBER_OF_CUSTOM}: {p_mask.USER_GROUPS_CUSTOM} -

+ +
+ {p_mask.f_mask.NAME} + + + +
+
+ +
+ +
{L_NO_ROLE_AVAILABLE}
+ +
- - - - - - - - + + +
style="display: none;"> - -
- - - - - - - - - - - - - -
{p_mask.NAME} [{p_mask.L_ACL_TYPE}]{p_mask.CATEGORIES}
- - - - - - - - -
- style="display: none;"> -   - - {p_mask.f_mask.PADDING} {p_mask.f_mask.FOLDER_IMAGE} {p_mask.f_mask.NAME} - -   - - - {L_ROLE}:    - - {L_ROLE}: {L_NO_ROLE_AVAILABLE} - - -
-
- - - - - - - -  
-
- -
-

{L_APPLY_PERMISSIONS_EXPLAIN}

- -
- - -   - +
+
-
-
 
- - style="display: none;"> + + +
style="display: none;"> + +
+
+ + + + + + + + - + - - + + - - - + + + - + - class="yes" class="no">  - class="never" class="no">  + class="yes">  + class="never"> - - - + + +
{L_ACL_SETTING} [{p_mask.f_mask.category.CAT_NAME}]{L_ACL_SETTING} {L_ACL_YES}{L_ACL_NEVER}{L_ACL_YES}{L_ACL_NEVER} {L_ACL_YES}{L_ACL_NO}{L_ACL_NEVER}{L_ACL_YES}{L_ACL_NO}{L_ACL_NEVER}
{L_TRACE_SETTING} {p_mask.f_mask.category.mask.PERMISSION}{L_TRACE_SETTING} {p_mask.f_mask.category.mask.PERMISSION} checked="checked" value="1" /> checked="checked" value="-1" /> checked="checked" value="0" />
- -
- + + + + +
+ From 2af1a4ca6a2883c0cddfac1330240f1a215e29c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Thu, 18 Jan 2007 13:08:36 +0000 Subject: [PATCH 217/264] This could help to make it work I guess ... :) git-svn-id: file:///svn/phpbb/trunk@6902 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/permissions.js | 243 +++++++++++++++++++++++++++++++++ 1 file changed, 243 insertions(+) create mode 100644 phpBB/adm/style/permissions.js diff --git a/phpBB/adm/style/permissions.js b/phpBB/adm/style/permissions.js new file mode 100644 index 0000000000..36f2a49e4d --- /dev/null +++ b/phpBB/adm/style/permissions.js @@ -0,0 +1,243 @@ + +/** +* Check whether we have a full radiobutton row of true +* index = offset for the row of inputs (0 == first row, 1 == second, 2 == third), +* rb = array of radiobuttons +*/ +function get_radio_status(index, rb) +{ + for (var i = index; i < rb.length; i = i + 3 ) + { + if (rb[i].checked != true) + { + if (i > index) + { + //at least one is true, but not all (custom) + return 2; + } + //first one is not true + return 0; + } + } + + // all radiobuttons true + return 1; +} + +/** +* Set tab colours +* id = panel the tab needs to be set for, +* init = initialising on open, +* quick = If no calculation needed, this contains the colour +*/ +function set_colours(id, init, quick) +{ + var table = document.getElementById('options' + id); + var tab = document.getElementById('tab' + id); + + if (typeof(quick) != 'undefined') + { + tab.className = 'perm_preset_' + quick + ' activetab'; + return; + } + + var rb = table.getElementsByTagName('input'); + var colour = 'custom'; + + var status = get_radio_status(0, rb); + + if (status == 1) + { + colour = 'yes'; + } + else if (status == 0) + { + // We move on to No + status = get_radio_status(1, rb); + + if (status == 1) + { + colour = 'no'; + } + else if (status == 0) + { + // We move on to Mever + status = get_radio_status(2, rb); + + if (status == 1) + { + colour = 'never'; + } + } + } + + if (init) + { + tab.className = 'perm_preset_' + colour; + } + else + { + tab.className = 'perm_preset_' + colour + ' activetab'; + } +} + +/** +* Initialise advanced tab colours on first load +* block_id = block that is opened +*/ +function init_colours(block_id) +{ + var block = document.getElementById('advanced' + block_id); + var panels = block.getElementsByTagName('div'); + var tab = document.getElementById('tab' + id); + + for (var i = 0; i < panels.length; i++) + { + if(panels[i].className == 'perm_panel') + { + set_colours(panels[i].id.replace(/options/, ''), true); + } + } + + tab.className = tab.className + ' activetab'; +} + +/** +* Show/hide option panels +* value = suffix for ID to show +* adv = we are opening advanced permissions +* view = called from view permissions +*/ +function swap_options(pmask, fmask, cat, adv, view) +{ + id = pmask + fmask + cat; + active_option = active_pmask + active_fmask + active_cat; + + var old_tab = document.getElementById('tab' + active_option); + var new_tab = document.getElementById('tab' + id); + var adv_block = document.getElementById('advanced' + pmask + fmask); + + if (adv_block.style.display == 'block' && adv == true) + { + dE('advanced' + pmask + fmask, -1); + return; + } + + // init colours + if (adv) + { + init_colours(pmask + fmask); + } + + // no need to set anything if we are clicking on the same tab again + if (new_tab == old_tab && !adv) + { + return; + } + + // set active tab + old_tab.className = old_tab.className.replace(/\ activetab/g, ''); + new_tab.className = new_tab.className + ' activetab'; + + if (id == active_option && adv != true) + { + return; + } + + dE('options' + active_option, -1); + + if (!view) + { + dE('advanced' + active_pmask + active_fmask, -1); + } + + if (!view) + { + dE('advanced' + pmask + fmask, 1); + } + dE('options' + id, 1); + + active_pmask = pmask; + active_fmask = fmask; + active_cat = cat; +} + +/** +* Mark all radio buttons in one panel +* id = table ID container, s = status ['y'/'u'/'n'] +*/ +function mark_options(id, s) +{ + var t = document.getElementById(id); + + if (!t) + { + return; + } + + var rb = t.getElementsByTagName('input'); + + for (var r = 0; r < rb.length; r++) + { + if (rb[r].id.substr(rb[r].id.length-1) == s) + { + rb[r].checked = true; + } + } +} + +function mark_one_option(id, field_name, s) +{ + var t = document.getElementById(id); + + if (!t) + { + return; + } + + var rb = t.getElementsByTagName('input'); + + for (var r = 0; r < rb.length; r++) + { + if (rb[r].id.substr(rb[r].id.length-field_name.length-3, field_name.length) == field_name && rb[r].id.substr(rb[r].id.length-1) == s) + { + rb[r].checked = true; + } + } +} + +/** +* Reset role dropdown field to Select role... if an option gets changed +*/ +function reset_role(id) +{ + var t = document.getElementById(id); + + if (!t) + { + return; + } + + t.options[0].selected = true; +} + +/** +* Load role and set options accordingly +*/ +function set_role_settings(role_id, target_id) +{ + settings = role_options[role_id]; + + if (!settings) + { + return; + } + + // Mark all options to no (unset) first... + mark_options(target_id, 'u'); + + for (var r in settings) + { + mark_one_option(target_id, r, (settings[r] == 1) ? 'y' : 'n'); + } +} From 1b1d9d2365561122c9cac280ff5b7080b3eaa695 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Thu, 18 Jan 2007 14:27:00 +0000 Subject: [PATCH 218/264] #7242 git-svn-id: file:///svn/phpbb/trunk@6903 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/acp_permission_roles.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/adm/style/acp_permission_roles.html b/phpBB/adm/style/acp_permission_roles.html index 9a53800d4e..724ae67f47 100644 --- a/phpBB/adm/style/acp_permission_roles.html +++ b/phpBB/adm/style/acp_permission_roles.html @@ -91,7 +91,7 @@
style="display: none;">
- +
@@ -111,9 +111,9 @@ - - - + + + From 916c410044c5d224d521a82efcb7ca061763fb97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Dr=C3=B6scher?= Date: Thu, 18 Jan 2007 14:28:34 +0000 Subject: [PATCH 219/264] The apply to selected items checkbox git-svn-id: file:///svn/phpbb/trunk@6904 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/permission_mask.html | 10 ++++++++-- phpBB/adm/style/permissions.js | 4 +++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/phpBB/adm/style/permission_mask.html b/phpBB/adm/style/permission_mask.html index 86dbc0a5ee..dca218fc90 100644 --- a/phpBB/adm/style/permission_mask.html +++ b/phpBB/adm/style/permission_mask.html @@ -23,7 +23,7 @@
- {p_mask.f_mask.NAME} + {p_mask.f_mask.NAME}
@@ -65,7 +65,7 @@
style="display: none;">
-
{auth.mask.PERMISSION}
+
@@ -104,6 +104,12 @@
+ +
+

{L_APPLY_PERMISSIONS_EXPLAIN}

+ +
+
diff --git a/phpBB/adm/style/permissions.js b/phpBB/adm/style/permissions.js index 36f2a49e4d..27a1a89ee8 100644 --- a/phpBB/adm/style/permissions.js +++ b/phpBB/adm/style/permissions.js @@ -32,7 +32,7 @@ function get_radio_status(index, rb) */ function set_colours(id, init, quick) { - var table = document.getElementById('options' + id); + var table = document.getElementById('table' + id); var tab = document.getElementById('tab' + id); if (typeof(quick) != 'undefined') @@ -120,12 +120,14 @@ function swap_options(pmask, fmask, cat, adv, view) if (adv_block.style.display == 'block' && adv == true) { dE('advanced' + pmask + fmask, -1); + document.getElementById('checkbox' + pmask + fmask).style.display = 'inline'; return; } // init colours if (adv) { + dE('checkbox' + pmask + fmask, -1); init_colours(pmask + fmask); } From ff7686797a428f1d5876ff3255f72ea2902c1fb1 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 18 Jan 2007 14:41:13 +0000 Subject: [PATCH 220/264] fixing some bugs git-svn-id: file:///svn/phpbb/trunk@6905 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/index.php | 4 +- phpBB/adm/style/acp_forums.html | 4 - phpBB/adm/swatch.php | 2 - phpBB/includes/acp/acp_forums.php | 2 +- phpBB/includes/acp/acp_groups.php | 35 +++- phpBB/includes/acp/acp_prune.php | 2 +- phpBB/includes/acp/acp_users.php | 88 +--------- phpBB/includes/functions.php | 2 - phpBB/includes/functions_convert.php | 154 ++++++++---------- phpBB/includes/functions_privmsgs.php | 4 +- phpBB/includes/functions_user.php | 121 ++++++++++++++ phpBB/includes/ucp/ucp_profile.php | 85 +--------- phpBB/install/index.php | 2 - phpBB/language/en/common.php | 2 - .../subSilver/template/posting_body.html | 2 +- 15 files changed, 229 insertions(+), 280 deletions(-) diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index 81673fcf7a..e4b96895fa 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -150,9 +150,7 @@ function adm_page_header($page_title) 'S_USER_LANG' => $user->lang['USER_LANG'], 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'], 'S_CONTENT_ENCODING' => 'UTF-8', - 'S_CONTENT_DIR_LEFT' => $user->lang['LEFT'], - 'S_CONTENT_DIR_RIGHT' => $user->lang['RIGHT']) - ); + )); // application/xhtml+xml not used because of IE header('Content-type: text/html; charset=UTF-8'); diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html index 2415b1c48d..1a407fbc85 100644 --- a/phpBB/adm/style/acp_forums.html +++ b/phpBB/adm/style/acp_forums.html @@ -192,12 +192,10 @@
-

{L_LIST_INDEX_EXPLAIN}
id="display_on_index" checked="checked" /> {L_YES}   id="display_on_index" checked="checked" /> {L_NO}
-

{L_ENABLE_POST_REVIEW_EXPLAIN}
id="enable_post_review" checked="checked" /> {L_YES}   id="enable_post_review" checked="checked" /> {L_NO}
@@ -256,12 +254,10 @@