From 3ca0a7cb7616860ac0941f7d3b302f7b318a7fb6 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Thu, 13 Dec 2007 22:23:25 +0000 Subject: [PATCH 001/102] What did you expect? Us slacking off because of a few digg/heise trolls? nah. never! The show must go on :) git-svn-id: file:///svn/phpbb/trunk@8280 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 9 ++++++- phpBB/includes/acp/acp_users.php | 11 ++++++--- phpBB/includes/functions_user.php | 39 ++++++++++++++++++++++++++++++ phpBB/includes/ucp/ucp_profile.php | 4 ++- phpBB/language/en/ucp.php | 1 + 5 files changed, 58 insertions(+), 6 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index c602cfdcd2..12801b1fc8 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -53,6 +53,7 @@
  1. Changelog
      +
    1. Changes since 3.0.0
    2. Changes since RC-8
    3. Changes since RC-7
    4. Changes since RC-6
    5. @@ -70,7 +71,7 @@ - +

      1. Changelog

      @@ -80,6 +81,12 @@
      +

      1.i. Changes since 3.0.0

      + +
        +
      • [Change] Validate birthdays (Bug #15004)
      • +
      +

      1.i. Changes since 3.0.RC8

        diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 260acbbc52..310759d38c 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1060,9 +1060,11 @@ class acp_users list($data['bday_day'], $data['bday_month'], $data['bday_year']) = explode('-', $user_row['user_birthday']); } - $data['bday_day'] = request_var('bday_day', $data['bday_day']); - $data['bday_month'] = request_var('bday_month', $data['bday_month']); - $data['bday_year'] = request_var('bday_year', $data['bday_year']); + $data['bday_day'] = request_var('bday_day', $data['bday_day']); + $data['bday_month'] = request_var('bday_month', $data['bday_month']); + $data['bday_year'] = request_var('bday_year', $data['bday_year']); + $data['user_birthday'] = sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']); + if ($submit) { @@ -1085,6 +1087,7 @@ class acp_users 'bday_day' => array('num', true, 1, 31), 'bday_month' => array('num', true, 1, 12), 'bday_year' => array('num', true, 1901, gmdate('Y', time())), + 'user_birthday' => array('date', true), )); // validate custom profile fields @@ -1111,7 +1114,7 @@ class acp_users 'user_from' => $data['location'], 'user_occ' => $data['occupation'], 'user_interests'=> $data['interests'], - 'user_birthday' => sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']), + 'user_birthday' => $data['user_birthday'], ); $sql = 'UPDATE ' . USERS_TABLE . ' diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index fa7025f2c2..c9921cc6f0 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -1260,6 +1260,45 @@ function validate_num($num, $optional = false, $min = 0, $max = 1E99) return false; } +/** +* Validate Date +* @param String $string a date in the dd-mm-yyyy format +* @return boolean +*/ +function validate_date($date_string, $optional = false) +{ + $date = explode('-', $date_string); + if ((empty($date) || sizeof($date) != 3) && $optional) + { + return false; + } + else if ($optional) + { + for ($field = 0; $field <= 1; $field++) + { + $date[$field] = (int) $date[$field]; + if (empty($date[$field])) + { + $date[$field] = 1; + } + } + $date[2] = (int) $date[2]; + // assume an arbitrary leap year + if (empty($date[2])) + { + $date[2] = 1980; + } + } + + if (sizeof($date) != 3 || !checkdate($date[1], $date[0], $date[2])) + { + return 'INVALID'; + } + + return false; +} + + /** * Validate Match * diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 3fe3d72d59..0f3cc218c3 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -295,6 +295,7 @@ class ucp_profile $data['bday_day'] = request_var('bday_day', $data['bday_day']); $data['bday_month'] = request_var('bday_month', $data['bday_month']); $data['bday_year'] = request_var('bday_year', $data['bday_year']); + $data['user_birthday'] = sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']); } add_form_key('ucp_profile_info'); @@ -325,6 +326,7 @@ class ucp_profile 'bday_day' => array('num', true, 1, 31), 'bday_month' => array('num', true, 1, 12), 'bday_year' => array('num', true, 1901, gmdate('Y', time()) + 50), + 'user_birthday' => array('date', true), )); } @@ -359,7 +361,7 @@ class ucp_profile if ($config['allow_birthdays']) { - $sql_ary['user_birthday'] = sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']); + $sql_ary['user_birthday'] = $data['user_birthday']; } $sql = 'UPDATE ' . USERS_TABLE . ' diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index 0a553b9366..d7006549ce 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -223,6 +223,7 @@ $lang = array_merge($lang, array( 'IF_FOLDER_FULL' => 'If folder is full', 'IMPORTANT_NEWS' => 'Important announcements', + 'INVALID_USER_BIRTHDAY' => 'The entered birthday is not a valid date.', 'INVALID_CHARS_USERNAME' => 'The username contains forbidden characters.', 'INVALID_CHARS_NEW_PASSWORD'=> 'The password does not contain the required characters.', 'ITEMS_REQUIRED' => 'The items marked with * are required profile fields and need to be filled out.', From ab9465a90e6ebb9c485d180431d297ba14af4884 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Wed, 19 Dec 2007 17:23:14 +0000 Subject: [PATCH 002/102] Hopefully fixes avatar caching for CGI installs. git-svn-id: file:///svn/phpbb/trunk@8281 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/download/file.php | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 12801b1fc8..00f54c0abf 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -85,6 +85,7 @@
        • [Change] Validate birthdays (Bug #15004)
        • +
        • [Fix] Allow correct avatar caching for CGI installations. (thanks wildbill)

        1.i. Changes since 3.0.RC8

        diff --git a/phpBB/download/file.php b/phpBB/download/file.php index c3ba3820f9..9bf16ce0dc 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -68,6 +68,14 @@ if (isset($_GET['avatar'])) if ($last_load !== false && $last_load <= $stamp) { header('Not Modified', true, 304); + if (@php_sapi_name() == 'CGI') + { + header('Status: 304 Not Modified', true, 304); + } + else + { + header('HTTP/1.0 304 Not Modified', true, 304); + } // seems that we need those too ... browsers header('Pragma: public'); header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 31536000)); From 0745a023b8fcab5dfa2016147815216133649114 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Thu, 20 Dec 2007 10:56:03 +0000 Subject: [PATCH 003/102] erm, yes. git-svn-id: file:///svn/phpbb/trunk@8282 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/download/file.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/phpBB/download/file.php b/phpBB/download/file.php index 9bf16ce0dc..552c43335e 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -67,8 +67,7 @@ if (isset($_GET['avatar'])) { if ($last_load !== false && $last_load <= $stamp) { - header('Not Modified', true, 304); - if (@php_sapi_name() == 'CGI') + if (@php_sapi_name() === 'CGI') { header('Status: 304 Not Modified', true, 304); } From dd488c5b03a6e806f5a30c8daa79aa1a178deb3d Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Thu, 20 Dec 2007 11:18:17 +0000 Subject: [PATCH 004/102] #12387 git-svn-id: file:///svn/phpbb/trunk@8283 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/styles/prosilver/template/overall_header.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html index f8eece7a5a..7c447afba5 100644 --- a/phpBB/styles/prosilver/template/overall_header.html +++ b/phpBB/styles/prosilver/template/overall_header.html @@ -57,7 +57,7 @@ */ window.onload = function() { - for (i = 0; i <= onload_functions.length; i++) + for (i = 0; i < onload_functions.length; i++) { eval(onload_functions[i]); } @@ -65,7 +65,7 @@ window.onunload = function() { - for (i = 0; i <= onunload_functions.length; i++) + for (i = 0; i < onunload_functions.length; i++) { eval(onunload_functions[i]); } From 9e35894f5e52220e6ae68b7917cfde1a703708f2 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 26 Dec 2007 14:53:52 +0000 Subject: [PATCH 005/102] *** empty log message *** git-svn-id: file:///svn/phpbb/trunk@8284 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/schemas/schema_data.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 254b067b55..81b0805a8d 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -213,7 +213,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.0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.1-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 9b1c8531e36b9b88d676985a43e59bdf7e819516 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 26 Dec 2007 15:33:06 +0000 Subject: [PATCH 007/102] re-allow disabling of word censors (we somehow forgot to commit this, i really do not know why :/) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8286 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/functions_content.php | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 00f54c0abf..3537cb5a0b 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -86,6 +86,7 @@
        • [Change] Validate birthdays (Bug #15004)
        • [Fix] Allow correct avatar caching for CGI installations. (thanks wildbill)
        • +
        • [Fix] Fix disabling of word censor, now possible again

        1.i. Changes since 3.0.RC8

        diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index b072895226..c0acd2eb41 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -647,12 +647,21 @@ function make_clickable($text, $server_url = false, $class = 'postlink') function censor_text($text) { static $censors; - global $cache; + // We moved the word censor checks in here because we call this function quite often - and then only need to do the check once if (!isset($censors) || !is_array($censors)) { - // obtain_word_list is taking care of the users censor option and the board-wide option - $censors = $cache->obtain_word_list(); + global $config, $user, $auth, $cache; + + // We check here if the user is having viewing censors disabled (and also allowed to do so). + if (!$user->optionget('viewcensors') && $config['allow_nocensors'] && $auth->acl_get('u_chgcensors')) + { + $censors = array(); + } + else + { + $censors = $cache->obtain_word_list(); + } } if (sizeof($censors)) From 8ec08728a6fde09c180eb79bef060fe563852e58 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 27 Dec 2007 16:04:42 +0000 Subject: [PATCH 008/102] Ticket #17705 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8287 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/acp/posting.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/language/en/acp/posting.php b/phpBB/language/en/acp/posting.php index a9a3547338..2f390dfebd 100644 --- a/phpBB/language/en/acp/posting.php +++ b/phpBB/language/en/acp/posting.php @@ -54,7 +54,7 @@ $lang = array_merge($lang, array( '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' => '[hilight={COLOR}]{TEXT}[/hilight]

        [font={SIMPLETEXT1}]{SIMPLETEXT2}[/font]', + 'BBCODE_USAGE_EXAMPLE' => '[highlight={COLOR}]{TEXT}[/highlight]

        [font={SIMPLETEXT1}]{SIMPLETEXT2}[/font]', 'BBCODE_USAGE_EXPLAIN' => 'Here you define how to use the BBCode. Replace any variable input by the corresponding token (%ssee below%s).', 'EXAMPLE' => 'Example:', From 12e59cf347268871713da078c2b86ea116409c61 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 27 Dec 2007 16:27:24 +0000 Subject: [PATCH 009/102] Ticket #16945 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8288 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/acp/permissions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/language/en/acp/permissions.php b/phpBB/language/en/acp/permissions.php index 8bddbebbd3..bba425d076 100644 --- a/phpBB/language/en/acp/permissions.php +++ b/phpBB/language/en/acp/permissions.php @@ -115,7 +115,7 @@ $lang = array_merge($lang, array( 'DEFAULT' => 'Default', 'DELETE_ROLE' => 'Delete role', - 'DELETE_ROLE_CONFIRM' => 'Are you sure you want to remove this role? Items having this role assigned will not loose their permission settings.', + 'DELETE_ROLE_CONFIRM' => 'Are you sure you want to remove this role? Items having this role assigned will not lose their permission settings.', 'DISPLAY_ROLE_ITEMS' => 'View items using this role', 'EDIT_PERMISSIONS' => 'Edit permissions', From d05cbff51b0ad185fd3425cd48c1f4525940e6c9 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 27 Dec 2007 16:36:24 +0000 Subject: [PATCH 010/102] Ticket #16825 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8289 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/styles/subsilver2/template/mcp_warn_post.html | 1 + 1 file changed, 1 insertion(+) diff --git a/phpBB/styles/subsilver2/template/mcp_warn_post.html b/phpBB/styles/subsilver2/template/mcp_warn_post.html index f12b1a4ba8..1ad5757f15 100644 --- a/phpBB/styles/subsilver2/template/mcp_warn_post.html +++ b/phpBB/styles/subsilver2/template/mcp_warn_post.html @@ -41,6 +41,7 @@ {L_ADD_WARNING_EXPLAIN} + From b870474810e7b513b70755c80e3eeb3105b4116b Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 27 Dec 2007 17:34:05 +0000 Subject: [PATCH 011/102] #16695 #s17235 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8290 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 2 ++ phpBB/install/install_convert.php | 7 +++--- phpBB/install/install_install.php | 39 +++++++++++++++++++------------ 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 3537cb5a0b..d2e8fb02ae 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -87,6 +87,8 @@
      • [Change] Validate birthdays (Bug #15004)
      • [Fix] Allow correct avatar caching for CGI installations. (thanks wildbill)
      • [Fix] Fix disabling of word censor, now possible again
      • +
      • [Fix] Allow single quotes in db password to be stored within config.php in installer
      • +
      • [Fix] Correctly quote db password for re-display in installer (Bug #16695 / thanks to m313 for reporting too - #s17235)

      1.i. Changes since 3.0.RC8

      diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index d1e36ec4a4..f1544c931a 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -422,8 +422,7 @@ class install_convert extends module } else { - $src_dbpasswd = htmlspecialchars_decode($src_dbpasswd); - $connect_test = connect_check_db(true, $error, $available_dbms[$src_dbms], $src_table_prefix, $src_dbhost, $src_dbuser, $src_dbpasswd, $src_dbname, $src_dbport, true, ($src_dbms == $dbms) ? false : true, false); + $connect_test = connect_check_db(true, $error, $available_dbms[$src_dbms], $src_table_prefix, $src_dbhost, $src_dbuser, htmlspecialchars_decode($src_dbpasswd), $src_dbname, $src_dbport, true, ($src_dbms == $dbms) ? false : true, false); } // The forum prefix of the old and the new forum can only be the same if two different databases are used. @@ -443,7 +442,7 @@ class install_convert extends module { $sql_db = 'dbal_' . $src_dbms; $src_db = new $sql_db(); - $src_db->sql_connect($src_dbhost, $src_dbuser, $src_dbpasswd, $src_dbname, $src_dbport, false, true); + $src_db->sql_connect($src_dbhost, $src_dbuser, htmlspecialchars_decode($src_dbpasswd), $src_dbname, $src_dbport, false, true); $same_db = false; } else @@ -666,7 +665,7 @@ class install_convert extends module } $sql_db = 'dbal_' . $convert->src_dbms; $src_db = new $sql_db(); - $src_db->sql_connect($convert->src_dbhost, $convert->src_dbuser, $convert->src_dbpasswd, $convert->src_dbname, $convert->src_dbport, false, true); + $src_db->sql_connect($convert->src_dbhost, $convert->src_dbuser, htmlspecialchars_decode($convert->src_dbpasswd), $convert->src_dbname, $convert->src_dbport, false, true); $same_db = false; } else diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 3afdb66e1e..2c4d9a0fda 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -551,7 +551,7 @@ class install_install extends module } else { - $connect_test = connect_check_db(true, $error, $available_dbms[$data['dbms']], $data['table_prefix'], $data['dbhost'], $data['dbuser'], $data['dbpasswd'], $data['dbname'], $data['dbport']); + $connect_test = connect_check_db(true, $error, $available_dbms[$data['dbms']], $data['table_prefix'], $data['dbhost'], $data['dbuser'], htmlspecialchars_decode($data['dbpasswd']), $data['dbname'], $data['dbport']); } $template->assign_block_vars('checks', array( @@ -884,17 +884,26 @@ class install_install extends module // Time to convert the data provided into a config file $config_data = " $available_dbms[$data['dbms']]['DRIVER'], + 'dbhost' => $data['dbhost'], + 'dbport' => $data['dbport'], + 'dbname' => $data['dbname'], + 'dbuser' => $data['dbuser'], + 'dbpasswd' => htmlspecialchars_decode($data['dbpasswd']), + 'table_prefix' => $data['table_prefix'], + 'acm_type' => 'file', + 'load_extensions' => $load_extensions, + ); + + foreach ($config_data_array as $key => $value) + { + $config_data .= "\${$key} = '" . str_replace("'", "\\'", str_replace('\\', '\\\\', $value)) . "';\n"; + } + unset($config_data_array); + + $config_data .= "\n@define('PHPBB_INSTALLED', true);\n"; $config_data .= "// @define('DEBUG', true);\n"; $config_data .= "// @define('DEBUG_EXTRA', true);\n"; $config_data .= '?' . '>'; // Done this to prevent highlighting editors getting confused! @@ -1124,7 +1133,7 @@ class install_install extends module // Instantiate the database $db = new $sql_db(); - $db->sql_connect($data['dbhost'], $data['dbuser'], $data['dbpasswd'], $data['dbname'], $data['dbport'], false, false); + $db->sql_connect($data['dbhost'], $data['dbuser'], htmlspecialchars_decode($data['dbpasswd']), $data['dbname'], $data['dbport'], false, false); // NOTE: trigger_error does not work here. $db->sql_return_on_error(true); @@ -1408,7 +1417,7 @@ class install_install extends module // Instantiate the database $db = new $sql_db(); - $db->sql_connect($data['dbhost'], $data['dbuser'], $data['dbpasswd'], $data['dbname'], $data['dbport'], false, false); + $db->sql_connect($data['dbhost'], $data['dbuser'], htmlspecialchars_decode($data['dbpasswd']), $data['dbname'], $data['dbport'], false, false); // NOTE: trigger_error does not work here. $db->sql_return_on_error(true); @@ -1948,7 +1957,7 @@ class install_install extends module 'dbhost' => request_var('dbhost', ''), 'dbport' => request_var('dbport', ''), 'dbuser' => request_var('dbuser', ''), - 'dbpasswd' => htmlspecialchars_decode(request_var('dbpasswd', '', true)), + 'dbpasswd' => request_var('dbpasswd', '', true), 'dbname' => request_var('dbname', ''), 'table_prefix' => request_var('table_prefix', ''), 'default_lang' => basename(request_var('default_lang', '')), From 00f0159ea292aacf23a3c4cfcfb854689ee5a1c0 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Wed, 2 Jan 2008 15:34:33 +0000 Subject: [PATCH 012/102] Some issues with change_lang and VC / form tokens Small stuff. #18325 #17415 #17085 #16515 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8291 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/index.php | 4 +-- phpBB/includes/functions_profile_fields.php | 2 +- phpBB/includes/ucp/ucp_register.php | 37 +++++++++++++++------ 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index e69e83d041..52810646ec 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -45,8 +45,8 @@ define('IN_ADMIN', true); $phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : './'; // Some oft used variables -$safe_mode = (@ini_get('safe_mode') || @strtolower(ini_get('safe_mode')) == 'on') ? true : false; -$file_uploads = (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on') ? true : false; +$safe_mode = (@ini_get('safe_mode') === '1' || @strtolower(ini_get('safe_mode')) === 'on') ? true : false; +$file_uploads = (@ini_get('file_uploads') === '1' || strtolower(@ini_get('file_uploads')) === 'on') ? true : false; $module_id = request_var('i', ''); $mode = request_var('mode', ''); diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index 6cccd7ffe5..63b506c5b8 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -666,7 +666,7 @@ class custom_profile } $profile_row['s_year_options'] = ''; - for ($i = $now['year'] - 100; $i <= $now['year']; $i++) + for ($i = $now['year'] - 100; $i <= $now['year'] + 100; $i++) { $profile_row['s_year_options'] .= '"; } diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 91660020e9..4c2129ee95 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -46,8 +46,8 @@ class ucp_register // not so fast, buddy - if (($submit && !check_form_key('ucp_register', false, '', false, $config['min_time_reg'])) - || (!$submit && !check_form_key('ucp_register_terms', false, '', false, $config['min_time_terms']))) + if (!check_form_key('ucp_register', false, '', false, $config['min_time_reg']) + && !check_form_key('ucp_register_terms', false, '', false, $config['min_time_terms'])) { $agreed = false; } @@ -103,12 +103,13 @@ class ucp_register // If we change the language, we want to pass on some more possible parameter. if ($change_lang) { - // We do not include the password! + // We do not include the password and not the captcha $s_hidden_fields = array_merge($s_hidden_fields, array( 'username' => utf8_normalize_nfc(request_var('username', '', true)), 'email' => strtolower(request_var('email', '')), 'email_confirm' => strtolower(request_var('email_confirm', '')), 'confirm_code' => request_var('confirm_code', ''), + 'confirm_id' => request_var('confirm_id', ''), 'lang' => $user->lang_name, 'tz' => request_var('tz', (float) $config['board_timezone']), )); @@ -451,13 +452,32 @@ class ucp_register $confirm_image = ''; // Visual Confirmation - Show images + if ($config['enable_confirm']) { - $str = ''; - if (!$change_lang) + if ($change_lang) + { + $str = '&change_lang=' . $change_lang; + $sql = 'SELECT code + FROM ' . CONFIRM_TABLE . " + WHERE confirm_id = '" . $db->sql_escape($confirm_id) . "' + AND session_id = '" . $db->sql_escape($user->session_id) . "' + AND confirm_type = " . CONFIRM_REG; + $result = $db->sql_query($sql); + if (!$row = $db->sql_fetchrow($result)) + { + $confirm_id = ''; + } + $db->sql_freeresult($result); + } + else + { + $str = ''; + } + if (!$change_lang || !$confirm_id) { $user->confirm_gc(CONFIRM_REG); - + $sql = 'SELECT COUNT(session_id) AS attempts FROM ' . CONFIRM_TABLE . " WHERE session_id = '" . $db->sql_escape($user->session_id) . "' @@ -487,11 +507,6 @@ class ucp_register ); $db->sql_query($sql); } - else - { - $str .= '&change_lang=' . $change_lang; - } - $confirm_image = ''; $s_hidden_fields .= ''; } From 73e18dcd5afd641b876dd6c4adae405f364cea0f Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Wed, 2 Jan 2008 15:56:43 +0000 Subject: [PATCH 013/102] A few very minor changes to avoid curveballs. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8292 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/index.php | 4 ++-- phpBB/includes/ucp/ucp_register.php | 2 +- phpBB/install/install_install.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index 52810646ec..a3b173ac7a 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -45,8 +45,8 @@ define('IN_ADMIN', true); $phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : './'; // Some oft used variables -$safe_mode = (@ini_get('safe_mode') === '1' || @strtolower(ini_get('safe_mode')) === 'on') ? true : false; -$file_uploads = (@ini_get('file_uploads') === '1' || strtolower(@ini_get('file_uploads')) === 'on') ? true : false; +$safe_mode = (@ini_get('safe_mode') == '1' || @strtolower(ini_get('safe_mode')) === 'on') ? true : false; +$file_uploads = (@ini_get('file_uploads') == '1' || strtolower(@ini_get('file_uploads')) === 'on') ? true : false; $module_id = request_var('i', ''); $mode = request_var('mode', ''); diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 4c2129ee95..09649ebe68 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -103,7 +103,7 @@ class ucp_register // If we change the language, we want to pass on some more possible parameter. if ($change_lang) { - // We do not include the password and not the captcha + // We do not include the password $s_hidden_fields = array_merge($s_hidden_fields, array( 'username' => utf8_normalize_nfc(request_var('username', '', true)), 'email' => strtolower(request_var('email', '')), diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 2c4d9a0fda..bce3cec730 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -151,7 +151,7 @@ class install_install extends module // We also give feedback on whether we're running in safe mode $result = '' . $lang['YES']; - if (@ini_get('safe_mode') || strtolower(@ini_get('safe_mode')) == 'on') + if (@ini_get('safe_mode') == '1' || strtolower(@ini_get('safe_mode')) == 'on') { $result .= ', ' . $lang['PHP_SAFE_MODE']; } From 8b423ba3084fbe29ce83aef2a5f6ac5380ee006e Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Thu, 3 Jan 2008 14:04:12 +0000 Subject: [PATCH 014/102] #16865 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8293 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/session.php | 3 ++- phpBB/style.php | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index d2e8fb02ae..d2e4ed52ee 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -89,6 +89,7 @@
    6. [Fix] Fix disabling of word censor, now possible again
    7. [Fix] Allow single quotes in db password to be stored within config.php in installer
    8. [Fix] Correctly quote db password for re-display in installer (Bug #16695 / thanks to m313 for reporting too - #s17235)
    9. +
    10. [Fix] Correctly handle empty imageset entries (Bug #16865)
    11. 1.i. Changes since 3.0.RC8

      diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 6149063dea..9411ec1ae6 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -1477,6 +1477,7 @@ class user extends session $sql = 'SELECT image_name, image_filename, image_lang, image_height, image_width FROM ' . STYLES_IMAGESET_DATA_TABLE . ' WHERE imageset_id = ' . $this->theme['imageset_id'] . " + AND image_filename <> '' AND image_lang IN ('" . $db->sql_escape($this->img_lang) . "', '')"; $result = $db->sql_query($sql, 3600); @@ -1886,7 +1887,7 @@ class user extends session default: $use_width = ($width === false) ? $img_data['width'] : $width; - + return '' . $alt . ''; break; } diff --git a/phpBB/style.php b/phpBB/style.php index f177d30c03..75c440bb63 100644 --- a/phpBB/style.php +++ b/phpBB/style.php @@ -116,6 +116,7 @@ if ($id) $sql = 'SELECT * FROM ' . STYLES_IMAGESET_DATA_TABLE . ' WHERE imageset_id = ' . $theme['imageset_id'] . " + AND image_filename <> '' AND image_lang IN ('" . $db->sql_escape($user_image_lang) . "', '')"; $result = $db->sql_query($sql, 3600); From 1074925720e84bcb9f2b1b6908da805c132a1c8a Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 5 Jan 2008 15:47:40 +0000 Subject: [PATCH 015/102] - backport viewforum performance change from 3.1.x to 3.0.x git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8305 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 5 +++ phpBB/includes/mcp/mcp_forum.php | 21 +++++++++-- phpBB/viewforum.php | 65 ++++++++++++++++++++------------ 3 files changed, 62 insertions(+), 29 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index d2e4ed52ee..660e5abb19 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -90,6 +90,11 @@
    12. [Fix] Allow single quotes in db password to be stored within config.php in installer
    13. [Fix] Correctly quote db password for re-display in installer (Bug #16695 / thanks to m313 for reporting too - #s17235)
    14. [Fix] Correctly handle empty imageset entries (Bug #16865)
    15. +
    16. [Fix] Correctly check empty subjects/messages (Bug #17915)
    17. +
    18. [Change] Do not check usernames against word censor list. Disallowed usernames is already checked and word censor belong to posts. (Bug #17745)
    19. +
    20. [Fix] Additionally include non-postable forums for moderators forums shown within the teams list. (Bug #17265)
    21. +
    22. [Change] Sped up viewforum considerably (also goes towards mcp_forum)
    23. +

      1.i. Changes since 3.0.RC8

      diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php index d97fbb7107..e1820aa7ce 100644 --- a/phpBB/includes/mcp/mcp_forum.php +++ b/phpBB/includes/mcp/mcp_forum.php @@ -146,8 +146,8 @@ function mcp_forum_view($id, $mode, $action, $forum_info) $read_tracking_join = $read_tracking_select = ''; } - $sql = "SELECT t.*$read_tracking_select - FROM " . TOPICS_TABLE . " t $read_tracking_join + $sql = "SELECT t.topic_id + FROM " . TOPICS_TABLE . " t WHERE t.forum_id IN($forum_id, 0) " . (($auth->acl_get('m_approve', $forum_id)) ? '' : 'AND t.topic_approved = 1') . " $limit_time_sql @@ -155,10 +155,21 @@ function mcp_forum_view($id, $mode, $action, $forum_info) $result = $db->sql_query_limit($sql, $topics_per_page, $start); $topic_list = $topic_tracking_info = array(); + + while ($row = $db->sql_fetchrow($result)) + { + $topic_list[] = $row['topic_id']; + } + $db->sql_freeresult($result); + + $sql = "SELECT t.*$read_tracking_select + FROM " . TOPICS_TABLE . " t $read_tracking_join + WHERE " . $db->sql_in_set('t.topic_id', $topic_list); + + $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { $topic_rows[$row['topic_id']] = $row; - $topic_list[] = $row['topic_id']; } $db->sql_freeresult($result); @@ -181,10 +192,12 @@ function mcp_forum_view($id, $mode, $action, $forum_info) } } - foreach ($topic_rows as $topic_id => $row) + foreach ($topic_list as $topic_id) { $topic_title = ''; + $row = &$topic_rows[$topic_id]; + $replies = ($auth->acl_get('m_approve', $forum_id)) ? $row['topic_replies_real'] : $row['topic_replies']; if ($row['topic_status'] == ITEM_MOVED) diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index c0ea87fede..0b2af13d76 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -408,39 +408,54 @@ else $sql_where = (sizeof($get_forum_ids)) ? $db->sql_in_set('t.forum_id', $get_forum_ids) : 't.forum_id = ' . $forum_id; } -// SQL array for obtaining topics/stickies -$sql_array = array( - 'SELECT' => $sql_array['SELECT'], - 'FROM' => $sql_array['FROM'], - 'LEFT_JOIN' => $sql_array['LEFT_JOIN'], - - 'WHERE' => $sql_where . ' - AND t.topic_type IN (' . POST_NORMAL . ', ' . POST_STICKY . ") +// Grab just the sorted topic ids +$sql = 'SELECT t.topic_id + FROM ' . TOPICS_TABLE . " t + WHERE $sql_where + AND t.topic_type IN (" . POST_NORMAL . ', ' . POST_STICKY . ") $sql_approved - $sql_limit_time", - - 'ORDER_BY' => 't.topic_type ' . ((!$store_reverse) ? 'DESC' : 'ASC') . ', ' . $sql_sort_order, -); - -// If store_reverse, then first obtain topics, then stickies, else the other way around... -// Funnily enough you typically save one query if going from the last page to the middle (store_reverse) because -// the number of stickies are not known -$sql = $db->sql_build_query('SELECT', $sql_array); + $sql_limit_time + ORDER BY t.topic_type " . ((!$store_reverse) ? 'DESC' : 'ASC') . ', ' . $sql_sort_order; $result = $db->sql_query_limit($sql, $sql_limit, $sql_start); -$shadow_topic_list = array(); while ($row = $db->sql_fetchrow($result)) { - if ($row['topic_status'] == ITEM_MOVED) - { - $shadow_topic_list[$row['topic_moved_id']] = $row['topic_id']; - } - - $rowset[$row['topic_id']] = $row; - $topic_list[] = $row['topic_id']; + $topic_list[] = (int) $row['topic_id']; } $db->sql_freeresult($result); +// For storing shadow topics +$shadow_topic_list = array(); + +if (sizeof($topic_list)) +{ + // SQL array for obtaining topics/stickies + $sql_array = array( + 'SELECT' => $sql_array['SELECT'], + 'FROM' => $sql_array['FROM'], + 'LEFT_JOIN' => $sql_array['LEFT_JOIN'], + + 'WHERE' => $db->sql_in_set('t.topic_id', $topic_list), + ); + + // If store_reverse, then first obtain topics, then stickies, else the other way around... + // Funnily enough you typically save one query if going from the last page to the middle (store_reverse) because + // the number of stickies are not known + $sql = $db->sql_build_query('SELECT', $sql_array); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if ($row['topic_status'] == ITEM_MOVED) + { + $shadow_topic_list[$row['topic_moved_id']] = $row['topic_id']; + } + + $rowset[$row['topic_id']] = $row; + } + $db->sql_freeresult($result); +} + // If we have some shadow topics, update the rowset to reflect their topic information if (sizeof($shadow_topic_list)) { From a7984e660da4def80d28a4efeacb5ee861c4718c Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 5 Jan 2008 16:10:10 +0000 Subject: [PATCH 016/102] Correctly check empty subjects/messages (Bug #17915) Do not check usernames against word censor list. Disallowed usernames is already checked and word censor belong to posts. (Bug #17745) Additionally include non-postable forums for moderators forums shown within the teams list. (Bug #17265) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8306 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_jabber.php | 20 +++++++++++++++----- phpBB/includes/functions_user.php | 17 +++-------------- phpBB/includes/message_parser.php | 11 ++++++++--- phpBB/includes/ucp/ucp_pm_compose.php | 6 +++--- phpBB/language/en/install.php | 2 +- phpBB/memberlist.php | 5 ++--- phpBB/posting.php | 6 +++--- 7 files changed, 35 insertions(+), 32 deletions(-) diff --git a/phpBB/includes/functions_jabber.php b/phpBB/includes/functions_jabber.php index 8575f339c1..7633c10be9 100644 --- a/phpBB/includes/functions_jabber.php +++ b/phpBB/includes/functions_jabber.php @@ -20,11 +20,11 @@ if (!defined('IN_PHPBB')) * * Jabber class from Flyspray project * -* @version class.jabber2.php 1306 2007-06-21 +* @version class.jabber2.php 1488 2007-11-25 * @copyright 2006 Flyspray.org * @author Florian Schmitz (floele) * -* Modified by Acyd Burn +* Only slightly modified by Acyd Burn * * @package phpBB3 */ @@ -286,7 +286,7 @@ class jabber $read = trim(fread($this->connection, 4096)); $data .= $read; } - while (time() <= $start + $timeout && ($wait || $data == '' || $read != '' || (substr(rtrim($data), -1) != '>'))); + while (time() <= $start + $timeout && !feof($this->connection) && ($wait || $data == '' || $read != '' || (substr(rtrim($data), -1) != '>'))); if ($data != '') { @@ -385,7 +385,6 @@ class jabber { case 'stream:stream': // Connection initialised (or after authentication). Not much to do here... - $this->session['id'] = $xml['stream:stream'][0]['@']['id']; if (isset($xml['stream:stream'][0]['#']['stream:features'])) { @@ -397,6 +396,16 @@ class jabber $this->features = $this->listen(); } + $second_time = isset($this->session['id']); + $this->session['id'] = $xml['stream:stream'][0]['@']['id']; + + if ($second_time) + { + // If we are here for the second time after TLS, we need to continue logging in + $this->login(); + return; + } + // go on with authentication? if (isset($this->features['stream:features'][0]['#']['bind']) || !empty($this->session['tls'])) { @@ -519,9 +528,10 @@ class jabber 'response' => $this->encrypt_password(array_merge($decoded, array('nc' => '00000001'))), 'charset' => 'utf-8', 'nc' => '00000001', + 'qop' => 'auth', // only auth being supported ); - foreach (array('nonce', 'qop', 'digest-uri', 'realm', 'cnonce') as $key) + foreach (array('nonce', 'digest-uri', 'realm', 'cnonce') as $key) { if (isset($decoded[$key])) { diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index c9921cc6f0..af9e69d00c 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -137,6 +137,9 @@ function user_update_name($old_name, $new_name) { set_config('newest_username', $new_name, true); } + + // Because some tables/caches use username-specific data we need to purge this here. + $cache->destroy('sql', MODERATOR_CACHE_TABLE); } /** @@ -1472,20 +1475,6 @@ function validate_username($username, $allowed_username = false) } } - $sql = 'SELECT word - FROM ' . WORDS_TABLE; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - if (preg_match('#(' . str_replace('\*', '.*?', preg_quote($row['word'], '#')) . ')#i', $username)) - { - $db->sql_freeresult($result); - return 'USERNAME_DISALLOWED'; - } - } - $db->sql_freeresult($result); - return false; } diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 6e601e1499..eeaa6d9529 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -913,9 +913,14 @@ class bbcode_firstpass extends bbcode $url = ($var1) ? $var1 : $var2; - if (!$url || ($var1 && !$var2)) + if ($var1 && !$var2) { - return ''; + $var2 = $var1; + } + + if (!$url) + { + return '[url' . (($var1) ? '=' . $var1 : '') . ']' . $var2 . '[/url]'; } $valid = false; @@ -1088,7 +1093,7 @@ class parse_message extends bbcode_firstpass } // Check for "empty" message - if ($mode !== 'sig' && !utf8_clean_string($this->message)) + if ($mode !== 'sig' && utf8_clean_string($this->message) === '') { $this->warn_msg[] = $user->lang['TOO_FEW_CHARS']; return $this->warn_msg; diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 6b56b52a5d..b2e91d8dde 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -494,12 +494,12 @@ function compose_pm($id, $mode, $action) } else { - if (!$subject || !utf8_clean_string($subject)) + if (utf8_clean_string($subject) === '') { $error[] = $user->lang['EMPTY_MESSAGE_SUBJECT']; } - if (!$message) + if (utf8_clean_string($message) === '') { $error[] = $user->lang['TOO_FEW_CHARS']; } @@ -600,7 +600,7 @@ function compose_pm($id, $mode, $action) // Subject defined if ($submit) { - if (!$subject || !utf8_clean_string($subject)) + if (utf8_clean_string($subject) === '') { $error[] = $user->lang['EMPTY_MESSAGE_SUBJECT']; } diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 15a5c6dca4..1481a88dc1 100755 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -460,7 +460,7 @@ $lang = array_merge($lang, array( 'NO_VISIBLE_CHANGES' => 'No visible changes', 'NOTICE' => 'Notice', 'NUM_CONFLICTS' => 'Number of conflicts', - 'NUMBER_OF_FILES_COLLECTED' => 'Currently having differences about %1$d from %2$d files collected.
      Please wait until file collection finished.', + 'NUMBER_OF_FILES_COLLECTED' => 'Currently differences of %1$d of %2$d files have been checked.
      Please wait until all files are checked.', '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.', diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index e41728a3d0..f7c9d101a8 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -141,10 +141,9 @@ switch ($mode) unset($admin_memberships); $sql = 'SELECT forum_id, forum_name - FROM ' . FORUMS_TABLE . ' - WHERE forum_type = ' . FORUM_POST; + FROM ' . FORUMS_TABLE; $result = $db->sql_query($sql); - + $forums = array(); while ($row = $db->sql_fetchrow($result)) { diff --git a/phpBB/posting.php b/phpBB/posting.php index 1236361e18..9ddaf52acd 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -520,12 +520,12 @@ if ($save && $user->data['is_registered'] && $auth->acl_get('u_savedrafts') && ( } else { - if (!$subject || !utf8_clean_string($subject)) + if (utf8_clean_string($subject) === '') { $error[] = $user->lang['EMPTY_SUBJECT']; } - if (!$message) + if (utf8_clean_string($message) === '') { $error[] = $user->lang['TOO_FEW_CHARS']; } @@ -769,7 +769,7 @@ if ($submit || $preview || $refresh) } // Parse subject - if (!$preview && !$refresh && !utf8_clean_string($post_data['post_subject']) && ($mode == 'post' || ($mode == 'edit' && $post_data['topic_first_post_id'] == $post_id))) + if (!$preview && !$refresh && utf8_clean_string($post_data['post_subject']) === '' && ($mode == 'post' || ($mode == 'edit' && $post_data['topic_first_post_id'] == $post_id))) { $error[] = $user->lang['EMPTY_SUBJECT']; } From 12a9e001837da139a9ea07b8dd52019ee071d9bd Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 6 Jan 2008 17:00:09 +0000 Subject: [PATCH 017/102] - Do not split topic list for topics being promoted to announcements after been moved to another forum (Bug #18635) - Allow editing usernames within database_update on username cleanup (Bug #18415) - Fixing wrong sync() calls if moving all posts by a member in ACP (Bug #18385) - Check entered imagemagick path for trailing slash (Bug #18205) - Use proper title on index for new/unread posts (Bug #13101) - patch provided by Pyramide - Allow calls to $user->set_cookie() define no cookie time for setting session cookies (Bug #18025) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8310 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 9 +++++++-- phpBB/includes/acp/acp_attachments.php | 15 +++++++++++++-- phpBB/includes/acp/acp_users.php | 2 +- phpBB/includes/acp/auth.php | 4 ++++ phpBB/includes/functions_display.php | 3 ++- phpBB/includes/functions_posting.php | 5 +++++ phpBB/includes/session.php | 8 ++++++-- phpBB/install/database_update.php | 3 +++ .../styles/prosilver/template/forumlist_body.html | 2 +- .../styles/prosilver/template/overall_header.html | 2 +- .../styles/prosilver/template/simple_header.html | 2 +- .../styles/prosilver/template/viewforum_body.html | 2 +- .../styles/prosilver/template/viewtopic_body.html | 2 +- .../prosilver/template/viewtopic_print.html | 2 +- .../subsilver2/template/overall_header.html | 2 +- .../styles/subsilver2/template/simple_header.html | 2 +- phpBB/viewforum.php | 5 +++-- phpBB/viewtopic.php | 2 +- 18 files changed, 53 insertions(+), 19 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 660e5abb19..a93f5106a8 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -94,9 +94,14 @@
    24. [Change] Do not check usernames against word censor list. Disallowed usernames is already checked and word censor belong to posts. (Bug #17745)
    25. [Fix] Additionally include non-postable forums for moderators forums shown within the teams list. (Bug #17265)
    26. [Change] Sped up viewforum considerably (also goes towards mcp_forum)
    27. - +
    28. [Fix] Do not split topic list for topics being promoted to announcements after been moved to another forum (Bug #18635)
    29. +
    30. [Fix] Allow editing usernames within database_update on username cleanup (Bug #18415)
    31. +
    32. [Fix] Fixing wrong sync() calls if moving all posts by a member in ACP (Bug #18385)
    33. +
    34. [Fix] Check entered imagemagick path for trailing slash (Bug #18205)
    35. +
    36. [Fix] Use proper title on index for new/unread posts (Bug #13101) - patch provided by Pyramide
    37. +
    38. [Fix] Allow calls to $user->set_cookie() define no cookie time for setting session cookies (Bug #18025)
    39. - +

      1.i. Changes since 3.0.RC8

        diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 4ab47ec9d6..e2ee126479 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -184,7 +184,18 @@ class acp_attachments } // We strip eventually manual added convert program, we only want the patch - $this->new_config['img_imagick'] = str_replace(array('convert', '.exe'), array('', ''), $this->new_config['img_imagick']); + if ($this->new_config['img_imagick']) + { + // Change path separator + $this->new_config['img_magick'] = str_replace('\\', '/', $this->new_config['img_magick']); + $this->new_config['img_imagick'] = str_replace(array('convert', '.exe'), array('', ''), $this->new_config['img_imagick']); + + // Check for trailing slash + if (substr($this->new_config['img_magick'], -1) !== '/') + { + $this->new_config['img_magick'] .= '/'; + } + } $supported_types = get_supported_image_types(); @@ -1134,7 +1145,7 @@ class acp_attachments foreach ($locations as $location) { // The path might not end properly, fudge it - if (substr($location, -1, 1) !== '/') + if (substr($location, -1) !== '/') { $location .= '/'; } diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 310759d38c..40230d0270 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -630,7 +630,7 @@ class acp_users } $forum_id_ary = array_unique($forum_id_ary); - $topic_id_ary = array_unique(array_merge($topic_id_ary, $new_topic_id_ary)); + $topic_id_ary = array_unique(array_merge(array_keys($topic_id_ary), $new_topic_id_ary)); if (sizeof($topic_id_ary)) { diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index b4ea0e46d0..177c42f581 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -778,6 +778,10 @@ class auth_admin extends auth $cache->destroy('_acl_options'); $this->acl_clear_prefetch(); + // Because we just changed the options and also purged the options cache, we instantly update/regenerate it for later calls to succeed. + $this->option_ids = $this->acl_options = array(); + $this->auth_admin(); + return true; } diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 05630342d1..f9cabaff29 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -371,7 +371,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $s_subforums_list = array(); foreach ($subforums_list as $subforum) { - $s_subforums_list[] = '' . $subforum['name'] . ''; + $s_subforums_list[] = '' . $subforum['name'] . ''; } $s_subforums_list = (string) implode(', ', $s_subforums_list); $catless = ($row['parent_id'] == $root_data['forum_id']) ? true : false; @@ -409,6 +409,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod $l_post_click_count => $post_click_count, 'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt), 'FORUM_FOLDER_IMG_SRC' => $user->img($folder_image, $folder_alt, false, '', 'src'), + 'FORUM_FOLDER_IMG_ALT' => isset($user->lang[$folder_alt]) ? $user->lang[$folder_alt] : '', 'FORUM_IMAGE' => ($row['forum_image']) ? '' . $user->lang[$folder_alt] . '' : '', 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '', 'LAST_POST_SUBJECT' => censor_text($last_post_subject), diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 9ed2d78cb7..4b7387115a 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -618,6 +618,11 @@ function create_thumbnail($source, $destination, $mimetype) // Only use imagemagick if defined and the passthru function not disabled if ($config['img_imagick'] && function_exists('passthru')) { + if (substr($config['img_magick'], -1) !== '/') + { + $config['img_magick'] .= '/'; + } + @passthru(escapeshellcmd($config['img_imagick']) . 'convert' . ((defined('PHP_OS') && preg_match('#^win#i', PHP_OS)) ? '.exe' : '') . ' -quality 85 -antialias -sample ' . $new_width . 'x' . $new_height . ' "' . str_replace('\\', '/', $source) . '" +profile "*" "' . str_replace('\\', '/', $destination) . '"'); if (file_exists($destination)) diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 9411ec1ae6..afc9e810e3 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -872,7 +872,11 @@ class session /** * Sets a cookie * - * Sets a cookie of the given name with the specified data for the given length of time. + * Sets a cookie of the given name with the specified data for the given length of time. If no time is specified, a session cookie will be set. + * + * @param string $name Name of the cookie, will be automatically prefixed with the phpBB cookie name. track becomes [cookie_name]_track then. + * @param string $cookiedata The data to hold within the cookie + * @param int $cookietime The expiration time as UNIX timestamp. If 0 is provided, a session cookie is set. */ function set_cookie($name, $cookiedata, $cookietime) { @@ -882,7 +886,7 @@ class session $expire = gmdate('D, d-M-Y H:i:s \\G\\M\\T', $cookietime); $domain = (!$config['cookie_domain'] || $config['cookie_domain'] == 'localhost' || $config['cookie_domain'] == '127.0.0.1') ? '' : '; domain=' . $config['cookie_domain']; - header('Set-Cookie: ' . $name_data . '; expires=' . $expire . '; path=' . $config['cookie_path'] . $domain . ((!$config['cookie_secure']) ? '' : '; secure') . '; HttpOnly', false); + header('Set-Cookie: ' . $name_data . (($cookietime) ? '; expires=' . $expire : '') . '; path=' . $config['cookie_path'] . $domain . ((!$config['cookie_secure']) ? '' : '; secure') . '; HttpOnly', false); } /** diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index fc9ce65dac..990591e8a4 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -616,6 +616,9 @@ if (version_compare($current_version, '3.0.RC8', '<=')) $modify_users = request_var('modify_users', array(0 => '')); $new_usernames = request_var('new_usernames', array(0 => ''), true); + // We need this file if someone wants to edit usernames. + include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx); + if (!class_exists('utf_new_normalizer')) { if (!file_exists($phpbb_root_path . 'install/data/new_normalizer.' . $phpEx)) diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html index 753d83995c..76e86ae1c2 100644 --- a/phpBB/styles/prosilver/template/forumlist_body.html +++ b/phpBB/styles/prosilver/template/forumlist_body.html @@ -26,7 +26,7 @@
      • -
        +
        {forumrow.FORUM_IMAGE} {forumrow.FORUM_NAME}
        {forumrow.FORUM_DESC} diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html index 7c447afba5..a87dc671b7 100644 --- a/phpBB/styles/prosilver/template/overall_header.html +++ b/phpBB/styles/prosilver/template/overall_header.html @@ -8,7 +8,7 @@ - + {META} diff --git a/phpBB/styles/prosilver/template/simple_header.html b/phpBB/styles/prosilver/template/simple_header.html index 65538f5da9..5acf19f000 100644 --- a/phpBB/styles/prosilver/template/simple_header.html +++ b/phpBB/styles/prosilver/template/simple_header.html @@ -8,7 +8,7 @@ - + {META} diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html index 1a731e0451..8bf9f98747 100644 --- a/phpBB/styles/prosilver/template/viewforum_body.html +++ b/phpBB/styles/prosilver/template/viewforum_body.html @@ -136,7 +136,7 @@
      • -
        {NEWEST_POST_IMG} {topicrow.TOPIC_TITLE} + style="background-image: url({T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}); background-repeat: no-repeat;" title="{topicrow.TOPIC_FOLDER_IMG_ALT}">{NEWEST_POST_IMG} {topicrow.TOPIC_TITLE} {topicrow.UNAPPROVED_IMG} {REPORTED_IMG}
        {topicrow.PAGINATION} diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html index 2238f402aa..ee89b3b15f 100644 --- a/phpBB/styles/prosilver/template/viewtopic_body.html +++ b/phpBB/styles/prosilver/template/viewtopic_body.html @@ -257,7 +257,7 @@
        - {S_TOPIC_MOD} + {S_TOPIC_MOD} {S_FORM_TOKEN}
        diff --git a/phpBB/styles/prosilver/template/viewtopic_print.html b/phpBB/styles/prosilver/template/viewtopic_print.html index 669c58d547..45c7010867 100644 --- a/phpBB/styles/prosilver/template/viewtopic_print.html +++ b/phpBB/styles/prosilver/template/viewtopic_print.html @@ -8,7 +8,7 @@ - + diff --git a/phpBB/styles/subsilver2/template/overall_header.html b/phpBB/styles/subsilver2/template/overall_header.html index 3603d8a3e2..309e9a1ef1 100644 --- a/phpBB/styles/subsilver2/template/overall_header.html +++ b/phpBB/styles/subsilver2/template/overall_header.html @@ -8,7 +8,7 @@ - + {META} diff --git a/phpBB/styles/subsilver2/template/simple_header.html b/phpBB/styles/subsilver2/template/simple_header.html index f3e374fac0..bcef9a7059 100644 --- a/phpBB/styles/subsilver2/template/simple_header.html +++ b/phpBB/styles/subsilver2/template/simple_header.html @@ -8,7 +8,7 @@ - + {META} diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 0b2af13d76..197f77065f 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -493,8 +493,9 @@ if (sizeof($shadow_topic_list)) // We want to retain some values $row = array_merge($row, array( 'topic_moved_id' => $rowset[$orig_topic_id]['topic_moved_id'], - 'topic_status' => $rowset[$orig_topic_id]['topic_status']) - ); + 'topic_status' => $rowset[$orig_topic_id]['topic_status'], + 'topic_type' => $rowset[$orig_topic_id]['topic_type'], + )); $rowset[$orig_topic_id] = $row; } diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index f24eebd1a7..4240c3da7a 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -578,7 +578,7 @@ $template->assign_vars(array( 'S_SELECT_SORT_DAYS' => $s_limit_days, 'S_SINGLE_MODERATOR' => (!empty($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id]) > 1) ? false : true, 'S_TOPIC_ACTION' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&t=$topic_id&start=$start"), - 'S_TOPIC_MOD' => ($topic_mod != '') ? '' : '', + 'S_TOPIC_MOD' => ($topic_mod != '') ? '' : '', 'S_MOD_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&t=$topic_id&quickmod=1&redirect=" . urlencode(str_replace('&', '&', $viewtopic_url)), true, $user->session_id), 'S_VIEWTOPIC' => true, From bbf09989b02dfaee9c3fa57b01c4a5766018a5b7 Mon Sep 17 00:00:00 2001 From: Vic D'Elfant Date: Mon, 7 Jan 2008 13:50:56 +0000 Subject: [PATCH 018/102] Same goes for the 3_0_0 branch... Fixed a problem caused by "-x-" variations of a translation, such as fr-x-strict and de-x-sie. We're now sending the main language code to the output so it will at least be a valid language code git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8312 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index bf00beb2e1..6f11170172 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3301,6 +3301,13 @@ function page_header($page_title = '', $display_online_list = true) // Which timezone? $tz = ($user->data['user_id'] != ANONYMOUS) ? strval(doubleval($user->data['user_timezone'])) : strval(doubleval($config['board_timezone'])); + // Send a proper content-language to the output + $user_lang = $user->lang['USER_LANG']; + if (strpos($user_lang, '-x-') !== false) + { + $user_lang = substr($user_lang, 0, strpos($user_lang, '-x-')); + } + // The following assigns all _common_ variables that may be used at any point in a template. $template->assign_vars(array( 'SITENAME' => $config['sitename'], @@ -3356,7 +3363,7 @@ function page_header($page_title = '', $display_online_list = true) 'S_REGISTERED_USER' => $user->data['is_registered'], 'S_IS_BOT' => $user->data['is_bot'], 'S_USER_PM_POPUP' => $user->optionget('popuppm'), - 'S_USER_LANG' => $user->lang['USER_LANG'], + 'S_USER_LANG' => $user_lang, 'S_USER_BROWSER' => (isset($user->data['session_browser'])) ? $user->data['session_browser'] : $user->lang['UNKNOWN_BROWSER'], 'S_USERNAME' => $user->data['username'], 'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'], From b29ba5343d86aeeacdb59d44560c486e52f3ffa7 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 7 Jan 2008 19:29:50 +0000 Subject: [PATCH 019/102] grr git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8314 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_attachments.php | 6 +++--- phpBB/includes/functions_posting.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index e2ee126479..08b5f863e0 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -187,13 +187,13 @@ class acp_attachments if ($this->new_config['img_imagick']) { // Change path separator - $this->new_config['img_magick'] = str_replace('\\', '/', $this->new_config['img_magick']); + $this->new_config['img_imagick'] = str_replace('\\', '/', $this->new_config['img_imagick']); $this->new_config['img_imagick'] = str_replace(array('convert', '.exe'), array('', ''), $this->new_config['img_imagick']); // Check for trailing slash - if (substr($this->new_config['img_magick'], -1) !== '/') + if (substr($this->new_config['img_imagick'], -1) !== '/') { - $this->new_config['img_magick'] .= '/'; + $this->new_config['img_imagick'] .= '/'; } } diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 4b7387115a..04e56f3851 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -618,9 +618,9 @@ function create_thumbnail($source, $destination, $mimetype) // Only use imagemagick if defined and the passthru function not disabled if ($config['img_imagick'] && function_exists('passthru')) { - if (substr($config['img_magick'], -1) !== '/') + if (substr($config['img_imagick'], -1) !== '/') { - $config['img_magick'] .= '/'; + $config['img_imagick'] .= '/'; } @passthru(escapeshellcmd($config['img_imagick']) . 'convert' . ((defined('PHP_OS') && preg_match('#^win#i', PHP_OS)) ? '.exe' : '') . ' -quality 85 -antialias -sample ' . $new_width . 'x' . $new_height . ' "' . str_replace('\\', '/', $source) . '" +profile "*" "' . str_replace('\\', '/', $destination) . '"'); From c16d34f995647c763d894689deea6aac0439b6eb Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Tue, 22 Jan 2008 15:29:58 +0000 Subject: [PATCH 020/102] #19675 and #19675 Language changes, so take care. I guess it's time to close up shop :) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8326 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 2 ++ phpBB/includes/acp/acp_icons.php | 20 +++++++++++---- phpBB/includes/ucp/ucp_pm_compose.php | 35 ++++++++++++++++++--------- phpBB/language/en/acp/posting.php | 2 ++ 4 files changed, 43 insertions(+), 16 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index a93f5106a8..5c60f6e1eb 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -100,6 +100,8 @@
      • [Fix] Check entered imagemagick path for trailing slash (Bug #18205)
      • [Fix] Use proper title on index for new/unread posts (Bug #13101) - patch provided by Pyramide
      • [Fix] Allow calls to $user->set_cookie() define no cookie time for setting session cookies (Bug #18025)
      • +
      • [Fix] Stricter checks on smilie packs (Bug #19675)
      • +
      • [Fix] Gracefully return from cancelling pm drafts (Bug #19675)

      1.i. Changes since 3.0.RC8

      diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php index 537c0425a2..f66f45cd36 100644 --- a/phpBB/includes/acp/acp_icons.php +++ b/phpBB/includes/acp/acp_icons.php @@ -337,11 +337,16 @@ class acp_icons } $icons_updated = 0; + $errors = array(); foreach ($images as $image) { - if (($mode == 'smilies' && ($image_emotion[$image] == '' || $image_code[$image] == '')) || - ($action == 'create' && !isset($image_add[$image]))) + if ($mode == 'smilies' && ($image_emotion[$image] == '' || $image_code[$image] == '')) { + $errors[$image] = 'SMILIE_NO_' . (($image_emotion[$image] == '') ? 'EMOTION' : 'CODE'); + } + else if ($action == 'create' && !isset($image_add[$image])) + { + // skip images where add wasn't checked } else { @@ -431,13 +436,18 @@ class acp_icons default: $suc_lang = $lang; } + $errormsgs = '
      '; + foreach ($errors as $img => $error) + { + $errormsgs .= '
      ' . sprintf($user->lang[$error], $img); + } if ($action == 'modify') { - trigger_error($user->lang[$suc_lang . '_EDITED'] . adm_back_link($this->u_action), $level); + trigger_error($user->lang[$suc_lang . '_EDITED'] . $errormsgs . adm_back_link($this->u_action), $level); } else { - trigger_error($user->lang[$suc_lang . '_ADDED'] . adm_back_link($this->u_action), $level); + trigger_error($user->lang[$suc_lang . '_ADDED'] . $errormsgs .adm_back_link($this->u_action), $level); } break; @@ -462,7 +472,7 @@ class acp_icons if (preg_match_all("#'(.*?)', ?#", $pak_entry, $data)) { if ((sizeof($data[1]) != 4 && $mode == 'icons') || - (sizeof($data[1]) != 6 && $mode == 'smilies')) + ((sizeof($data[1]) != 6 || (empty($data[1][4]) || empty($data[1][5]))) && $mode == 'smilies' )) { trigger_error($user->lang['WRONG_PAK_TYPE'] . adm_back_link($this->u_action), E_USER_WARNING); } diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index b2e91d8dde..af592e3612 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -465,7 +465,8 @@ function compose_pm($id, $mode, $action) 'forum_id' => 0, 'save_time' => $current_time, 'draft_subject' => $subject, - 'draft_message' => $message) + 'draft_message' => $message + ) ); $db->sql_query($sql); @@ -488,6 +489,8 @@ function compose_pm($id, $mode, $action) 'g' => $to_group_id, 'p' => $msg_id) ); + $s_hidden_fields .= build_address_field($address_list); + confirm_box(false, 'SAVE_DRAFT', $s_hidden_fields); } @@ -541,7 +544,7 @@ function compose_pm($id, $mode, $action) if ($submit || $preview || $refresh) { - if (!check_form_key('ucp_pm_compose')) + if (($submit || $preview) && !check_form_key('ucp_pm_compose')) { $error[] = $user->lang['FORM_INVALID']; } @@ -888,15 +891,9 @@ function compose_pm($id, $mode, $action) } // Build hidden address list - $s_hidden_address_field = ''; - foreach ($address_list as $type => $adr_ary) - { - foreach ($adr_ary as $id => $field) - { - $s_hidden_address_field .= ''; - } - } - + $s_hidden_address_field = build_address_field($address_list); + + $bbcode_checked = (isset($enable_bbcode)) ? !$enable_bbcode : (($config['allow_bbcode'] && $auth->acl_get('u_pm_bbcode')) ? !$user->optionget('bbcode') : 1); $smilies_checked = (isset($enable_smilies)) ? !$enable_smilies : (($config['allow_smilies'] && $auth->acl_get('u_pm_smilies')) ? !$user->optionget('smilies') : 1); $urls_checked = (isset($enable_urls)) ? !$enable_urls : 0; @@ -1117,6 +1114,22 @@ function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove } } +/** +* Build the hidden field for the recipients. Needed, as the variable is not read via request_var. +*/ +function build_address_field($address_list) +{ + $s_hidden_address_field = ''; + foreach ($address_list as $type => $adr_ary) + { + foreach ($adr_ary as $id => $field) + { + $s_hidden_address_field .= ''; + } + } + return $s_hidden_address_field; +} + /** * Return number of private message recipients */ diff --git a/phpBB/language/en/acp/posting.php b/phpBB/language/en/acp/posting.php index 2f390dfebd..961ca2612c 100644 --- a/phpBB/language/en/acp/posting.php +++ b/phpBB/language/en/acp/posting.php @@ -162,6 +162,8 @@ $lang = array_merge($lang, array( 'SMILIES_CONFIG' => 'Smiley configuration', 'SMILIES_DELETED' => 'The smiley has been removed successfully.', 'SMILIES_EDIT' => 'Edit smiley', + 'SMILIE_NO_CODE' => 'The smilie “%s” was ignored, as there was no code entered.', + 'SMILIE_NO_EMOTION' => 'The smilie “%s” was ignored, as there was no emotion entered.', 'SMILIES_NONE_EDITED' => 'No smilies were updated.', 'SMILIES_ONE_EDITED' => 'The smiley has been updated successfully.', 'SMILIES_EDITED' => 'The smilies have been updated successfully.', From 48490ba4b102f8d73cd3e433b15667456298696c Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Wed, 23 Jan 2008 14:05:17 +0000 Subject: [PATCH 021/102] #19975 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8332 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/styles/subsilver2/template/posting_body.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/styles/subsilver2/template/posting_body.html b/phpBB/styles/subsilver2/template/posting_body.html index a1cd573768..a1515f9628 100644 --- a/phpBB/styles/subsilver2/template/posting_body.html +++ b/phpBB/styles/subsilver2/template/posting_body.html @@ -382,13 +382,14 @@     -   +   {S_FORM_TOKEN}
      - + + @@ -397,8 +398,7 @@ - {S_FORM_TOKEN} - +
      From cdf9a41ced305ea3a3e9da50d4653c1e9eb66d70 Mon Sep 17 00:00:00 2001 From: "Marek A. R" Date: Wed, 23 Jan 2008 22:08:06 +0000 Subject: [PATCH 022/102] Fix for bug #17855 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8334 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_main.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index d41e1f4a62..00ea2f1689 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -392,7 +392,7 @@ class acp_main 'DATABASE_INFO' => $db->sql_server_info(), 'BOARD_VERSION' => $config['version'], - 'U_ACTION' => append_sid("{$phpbb_admin_path}index.$phpEx"), + 'U_ACTION' => $this->u_action, 'U_ADMIN_LOG' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=logs&mode=admin'), 'U_INACTIVE_USERS' => append_sid("{$phpbb_admin_path}index.$phpEx", 'i=inactive&mode=list'), From e13488ab1c4d3a3074feb1fedabf868597ad59e6 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Thu, 24 Jan 2008 11:09:15 +0000 Subject: [PATCH 023/102] #20085 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8335 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/styles/subsilver2/template/posting_body.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/phpBB/styles/subsilver2/template/posting_body.html b/phpBB/styles/subsilver2/template/posting_body.html index a1515f9628..827b5df061 100644 --- a/phpBB/styles/subsilver2/template/posting_body.html +++ b/phpBB/styles/subsilver2/template/posting_body.html @@ -382,14 +382,16 @@     -   {S_FORM_TOKEN} +   - -
      - + + {S_FORM_TOKEN} + +
      + From 79b02d160a496a2441d62f8beabfc5ca95499863 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Mon, 28 Jan 2008 13:00:10 +0000 Subject: [PATCH 024/102] 20255 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8337 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 afc9e810e3..70ffd4ee08 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -653,7 +653,7 @@ class session $sql = 'SELECT COUNT(session_id) AS sessions FROM ' . SESSIONS_TABLE . ' WHERE session_user_id = ' . (int) $this->data['user_id'] . ' - AND session_time >= ' . ($this->time_now - $config['form_token_lifetime']); + AND session_time >= ' . (int)($this->time_now - (max($config['session_length'], $config['form_token_lifetime']))); $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); From 98e394987f04fad65ecf3c743e4af4c92b23e932 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Mon, 28 Jan 2008 15:20:47 +0000 Subject: [PATCH 025/102] nit rightfully picked git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8340 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 70ffd4ee08..17f6759cb8 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -653,7 +653,7 @@ class session $sql = 'SELECT COUNT(session_id) AS sessions FROM ' . SESSIONS_TABLE . ' WHERE session_user_id = ' . (int) $this->data['user_id'] . ' - AND session_time >= ' . (int)($this->time_now - (max($config['session_length'], $config['form_token_lifetime']))); + AND session_time >= ' . (int) ($this->time_now - (max($config['session_length'], $config['form_token_lifetime']))); $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); From 5efd4f2c00c8d3f12a881d4fce54bc92986902c5 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 29 Jan 2008 14:23:02 +0000 Subject: [PATCH 026/102] #20135 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8343 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/session.php | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 5c60f6e1eb..a8211ae925 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -102,6 +102,7 @@
    40. [Fix] Allow calls to $user->set_cookie() define no cookie time for setting session cookies (Bug #18025)
    41. [Fix] Stricter checks on smilie packs (Bug #19675)
    42. [Fix] Gracefully return from cancelling pm drafts (Bug #19675)
    43. +
    44. [Fix] Possible login problems with IE7 if browser check is activated (Bug #20135)
    45. 1.i. Changes since 3.0.RC8

      diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 17f6759cb8..738cbfa74d 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -256,8 +256,8 @@ class session $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)) : ''; + $s_browser = ($config['browser_check']) ? trim(strtolower(substr($this->data['session_browser'], 0, 149))) : ''; + $u_browser = ($config['browser_check']) ? trim(strtolower(substr($this->browser, 0, 149))) : ''; $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) : ''; @@ -526,8 +526,8 @@ class session $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)) : ''; + $s_browser = ($config['browser_check']) ? trim(strtolower(substr($this->data['session_browser'], 0, 149))) : ''; + $u_browser = ($config['browser_check']) ? trim(strtolower(substr($this->browser, 0, 149))) : ''; $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) : ''; @@ -579,7 +579,7 @@ class session 'session_start' => (int) $this->time_now, 'session_last_visit' => (int) $this->data['session_last_visit'], 'session_time' => (int) $this->time_now, - 'session_browser' => (string) substr($this->browser, 0, 149), + 'session_browser' => (string) trim(substr($this->browser, 0, 149)), 'session_forwarded_for' => (string) $this->forwarded_for, 'session_ip' => (string) $this->ip, 'session_autologin' => ($session_autologin) ? 1 : 0, From fb1c5e22f6ac1cad6ddf9b6421bf21c00a95ae0c Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 29 Jan 2008 15:00:41 +0000 Subject: [PATCH 027/102] #17025 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8346 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/db/dbal.php | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index a8211ae925..e7013e9bae 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -103,6 +103,7 @@
    46. [Fix] Stricter checks on smilie packs (Bug #19675)
    47. [Fix] Gracefully return from cancelling pm drafts (Bug #19675)
    48. [Fix] Possible login problems with IE7 if browser check is activated (Bug #20135)
    49. +
    50. [Fix] Fix possible database transaction errors if code returns on error and rollback happened (Bug #17025)
    51. 1.i. Changes since 3.0.RC8

      diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index e37ccda0db..4964ac87f7 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -262,6 +262,13 @@ class dbal return true; } + // Check if there is a transaction (no transaction can happen if there was an error, with a combined rollback and error returning enabled) + // This implies we have transaction always set for autocommit db's + if (!$this->transaction) + { + return false; + } + $result = $this->_sql_transaction('commit'); if (!$result) From 9451f7feab692d7418f48b3d699026b4f9f731ce Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 29 Jan 2008 15:15:10 +0000 Subject: [PATCH 028/102] #20125 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8347 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/functions_module.php | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index e7013e9bae..1196e2ce7f 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -104,6 +104,7 @@
    52. [Fix] Gracefully return from cancelling pm drafts (Bug #19675)
    53. [Fix] Possible login problems with IE7 if browser check is activated (Bug #20135)
    54. [Fix] Fix possible database transaction errors if code returns on error and rollback happened (Bug #17025)
    55. +
    56. [Change] Allow numbers in permission names for modifications, as well as uppercase letters for the request_ part (Bug #20125)
    57. 1.i. Changes since 3.0.RC8

      diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index b55c408b8c..b58993d878 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -59,7 +59,7 @@ class p_master WHERE module_class = '" . $db->sql_escape($this->p_class) . "' ORDER BY left_id ASC"; $result = $db->sql_query($sql); - + $rows = array(); while ($row = $db->sql_fetchrow($result)) { @@ -114,7 +114,7 @@ class p_master unset($this->module_cache['modules'][$key]); continue; } - + $right_id = false; } @@ -147,7 +147,7 @@ class p_master { continue; } - + $right_id = false; } @@ -194,7 +194,7 @@ class p_master $custom_func = '_module_' . $row['module_basename']; $names[$row['module_basename'] . '_' . $row['module_mode']][] = true; - + $module_row = array( 'depth' => $depth, @@ -209,7 +209,7 @@ class p_master 'display' => (int) $row['module_display'], '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'], @@ -309,7 +309,7 @@ class p_master break; default: - if (!preg_match('#(?:acl_([a-z_]+)(,\$id)?)|(?:\$id)|(?:aclf_([a-z_]+))|(?:cfg_([a-z_]+))|(?:request_([a-z_]+))#', $token)) + if (!preg_match('#(?:acl_([a-z0-9_]+)(,\$id)?)|(?:\$id)|(?:aclf_([a-z0-9_]+))|(?:cfg_([a-z0-9_]+))|(?:request_([a-zA-Z0-9_]+))#', $token)) { $token = ''; } @@ -325,7 +325,7 @@ class p_master $forum_id = ($forum_id === false) ? $this->acl_forum_id : $forum_id; $is_auth = false; - eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z_]+)(,\$id)?#', '#\$id#', '#aclf_([a-z_]+)#', '#cfg_([a-z_]+)#', '#request_([a-z_]+)#'), array('(int) $auth->acl_get(\'\\1\'\\2)', '(int) $forum_id', '(int) $auth->acl_getf_global(\'\\1\')', '(int) $config[\'\\1\']', '!empty($_REQUEST[\'\\1\'])'), $module_auth) . ');'); + eval('$is_auth = (int) (' . preg_replace(array('#acl_([a-z0-9_]+)(,\$id)?#', '#\$id#', '#aclf_([a-z0-9_]+)#', '#cfg_([a-z0-9_]+)#', '#request_([a-zA-Z0-9_]+)#'), array('(int) $auth->acl_get(\'\\1\'\\2)', '(int) $forum_id', '(int) $auth->acl_getf_global(\'\\1\')', '(int) $config[\'\\1\']', '!empty($_REQUEST[\'\\1\'])'), $module_auth) . ');'); return $is_auth; } From c7821700dd36899a53b8afe9f859d7a40a23e7b4 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 29 Jan 2008 15:49:15 +0000 Subject: [PATCH 029/102] #19955 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8348 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/common.php | 8 +++- phpBB/docs/CHANGELOG.html | 1 + phpBB/download/file.php | 32 ++++++++-------- phpBB/includes/functions.php | 62 ++++++++++++++++--------------- phpBB/includes/message_parser.php | 8 ++-- phpBB/includes/session.php | 22 +++++------ phpBB/install/index.php | 13 +++++-- phpBB/install/install_install.php | 41 +++++++++++--------- 8 files changed, 103 insertions(+), 84 deletions(-) diff --git a/phpBB/common.php b/phpBB/common.php index ebffd46228..4fca1be2b4 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -131,7 +131,7 @@ if (!defined('PHPBB_INSTALLED')) // Redirect the user to the installer // We have to generate a full HTTP/1.1 header here since we can't guarantee to have any of the information // available as used by the redirect function - $server_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'); + $server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME')); $server_port = (!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT'); $secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 1 : 0; @@ -150,7 +150,11 @@ if (!defined('PHPBB_INSTALLED')) if ($server_port && (($secure && $server_port <> 443) || (!$secure && $server_port <> 80))) { - $url .= ':' . $server_port; + // HTTP HOST can carry a port number... + if (strpos($server_name, ':') === false) + { + $url .= ':' . $server_port; + } } $url .= $script_path; diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 1196e2ce7f..d778c0b41c 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -105,6 +105,7 @@
    58. [Fix] Possible login problems with IE7 if browser check is activated (Bug #20135)
    59. [Fix] Fix possible database transaction errors if code returns on error and rollback happened (Bug #17025)
    60. [Change] Allow numbers in permission names for modifications, as well as uppercase letters for the request_ part (Bug #20125)
    61. +
    62. [Fix] Use HTTP_HOST in favor of SERVER_NAME for determining server url for redirection and installation (Bug #19955)
    63. 1.i. Changes since 3.0.RC8

      diff --git a/phpBB/download/file.php b/phpBB/download/file.php index 552c43335e..503c57ee26 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -32,7 +32,7 @@ if (isset($_GET['avatar'])) exit; } unset($dbpasswd); - + // worst-case default $browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? htmlspecialchars((string) $_SERVER['HTTP_USER_AGENT']) : 'msie 6.0'; @@ -44,7 +44,7 @@ if (isset($_GET['avatar'])) $avatar_group = true; $filename = substr($filename, 1); } - + // '==' is not a bug - . as the first char is as bad as no dot at all if (strpos($filename, '.') == false) { @@ -56,22 +56,22 @@ if (isset($_GET['avatar'])) $db->sql_close(); exit; } - + $ext = substr(strrchr($filename, '.'), 1); $stamp = (int) substr(stristr($filename, '_'), 1); $filename = (int) $filename; - + // let's see if we have to send the file at all $last_load = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? strtotime(trim($_SERVER['HTTP_IF_MODIFIED_SINCE'])) : false; if (strpos(strtolower($browser), 'msie 6.0') === false) { if ($last_load !== false && $last_load <= $stamp) { - if (@php_sapi_name() === 'CGI') + if (@php_sapi_name() === 'CGI') { header('Status: 304 Not Modified', true, 304); - } - else + } + else { header('HTTP/1.0 304 Not Modified', true, 304); } @@ -79,13 +79,13 @@ if (isset($_GET['avatar'])) header('Pragma: public'); header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', time() + 31536000)); exit(); - } + } else { header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $stamp) . ' GMT'); } } - + if (!in_array($ext, array('png', 'gif', 'jpg', 'jpeg'))) { // no way such an avatar could exist. They are not following the rules, stop the show. @@ -97,7 +97,7 @@ if (isset($_GET['avatar'])) $db->sql_close(); exit; } - + if (!$filename) { // no way such an avatar could exist. They are not following the rules, stop the show. @@ -280,7 +280,7 @@ else { trigger_error($user->lang['PHYSICAL_DOWNLOAD_NOT_POSSIBLE']); } - + redirect($phpbb_root_path . $config['upload_path'] . '/' . $attachment['physical_filename']); exit; } @@ -467,7 +467,7 @@ function send_file_to_browser($attachment, $upload_dir, $category) { header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename(htmlspecialchars_decode($attachment['real_filename']))); } - + if ($size) { header("Content-Length: $size"); @@ -556,9 +556,9 @@ function download_allowed() } } } - + // Check for own server... - $server_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'); + $server_name = $user->host; // Forcing server vars is the only way to specify/override the protocol if ($config['force_server_vars'] || !$server_name) @@ -570,7 +570,7 @@ function download_allowed() { $allowed = true; } - + // Get IP's and Hostnames if (!$allowed) { @@ -620,7 +620,7 @@ function download_allowed() } $db->sql_freeresult($result); } - + return $allowed; } diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 6f11170172..017dfa5c68 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -287,7 +287,7 @@ function phpbb_hash($password) } $random = substr($random, 0, $count); } - + $hash = _hash_crypt_private($password, _hash_gensalt_private($random, $itoa64), $itoa64); if (strlen($hash) == 34) @@ -360,7 +360,7 @@ function _hash_encode64($input, $count, &$itoa64) } $output .= $itoa64[($value >> 12) & 0x3f]; - + if ($i++ >= $count) { break; @@ -836,7 +836,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $ unset($tracking_topics['t']); unset($tracking_topics['f']); $tracking_topics['l'] = base_convert(time() - $config['board_startdate'], 10, 36); - + $user->set_cookie('track', tracking_serialize($tracking_topics), time() + 31536000); $_COOKIE[$config['cookie_name'] . '_track'] = (STRIP) ? addslashes(tracking_serialize($tracking_topics)) : tracking_serialize($tracking_topics); @@ -1129,7 +1129,7 @@ function get_topic_tracking($forum_id, $topic_ids, &$rowset, $forum_mark_time, $ { $mark_time[$forum_id] = $forum_mark_time[$forum_id]; } - + $user_lastmark = (isset($mark_time[$forum_id])) ? $mark_time[$forum_id] : $user->data['user_lastmark']; foreach ($topic_ids as $topic_id) @@ -1177,7 +1177,7 @@ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_lis $last_read[$row['topic_id']] = $row['mark_time']; } $db->sql_freeresult($result); - + $topic_ids = array_diff($topic_ids, array_keys($last_read)); if (sizeof($topic_ids)) @@ -1188,7 +1188,7 @@ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_lis AND forum_id " . (($global_announce_list && sizeof($global_announce_list)) ? "IN (0, $forum_id)" : "= $forum_id"); $result = $db->sql_query($sql); - + $mark_time = array(); while ($row = $db->sql_fetchrow($result)) { @@ -1459,7 +1459,7 @@ function tracking_unserialize($string, $max_depth = 3) break; } break; - + case 2: switch ($string[$i]) { @@ -1477,7 +1477,7 @@ function tracking_unserialize($string, $max_depth = 3) break; } break; - + case 3: switch ($string[$i]) { @@ -1501,7 +1501,7 @@ function tracking_unserialize($string, $max_depth = 3) { die('Invalid data supplied'); } - + return $level; } @@ -1719,7 +1719,7 @@ function generate_board_url($without_script_path = false) { global $config, $user; - $server_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'); + $server_name = $user->host; $server_port = (!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT'); // Forcing server vars is the only way to specify/override the protocol @@ -1743,7 +1743,11 @@ function generate_board_url($without_script_path = false) if ($server_port && (($config['cookie_secure'] && $server_port <> 443) || (!$config['cookie_secure'] && $server_port <> 80))) { - $url .= ':' . $server_port; + // HTTP HOST can carry a port number... + if (strpos($server_name, ':') === false) + { + $url .= ':' . $server_port; + } } if (!$without_script_path) @@ -1984,7 +1988,7 @@ function build_url($strip_vars = false) unset($query[$strip]); } } - + // Glue the remaining parts together... already urlencoded foreach ($query as $key => $value) { @@ -2056,7 +2060,7 @@ function check_form_key($form_name, $timespan = false, $return_page = '', $trigg { $minimum_time = (int) $config['form_token_mintime']; } - + if (isset($_POST['creation_time']) && isset($_POST['form_token'])) { $creation_time = abs(request_var('creation_time', 0)); @@ -2067,7 +2071,7 @@ function check_form_key($form_name, $timespan = false, $return_page = '', $trigg if (($diff >= $minimum_time) && (($diff <= $timespan) || $timespan == -1)) { $token_sid = ($user->data['user_id'] == ANONYMOUS && !empty($config['form_token_sid_guests'])) ? $user->session_id : ''; - + $key = sha1($creation_time . $user->data['user_form_salt'] . $form_name . $token_sid); if ($key === $token) { @@ -2365,7 +2369,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa { $err = (!$config['board_contact']) ? sprintf($user->lang[$result['error_msg']], '', '') : sprintf($user->lang[$result['error_msg']], '', ''); } - + break; } } @@ -2502,7 +2506,7 @@ function login_forum_box($forum_data) $template->set_filenames(array( 'body' => 'login_forum.html') ); - + page_footer(); } @@ -2601,10 +2605,10 @@ function parse_cfg_file($filename, $lines = false) { $value = substr($value, 1, sizeof($value)-2); } - + $parsed_items[$key] = $value; } - + return $parsed_items; } @@ -2631,13 +2635,13 @@ function add_log() 'log_operation' => $action, 'log_data' => $data, ); - + switch ($mode) { case 'admin': $sql_ary['log_type'] = LOG_ADMIN; break; - + case 'mod': $sql_ary += array( 'log_type' => LOG_MOD, @@ -2656,7 +2660,7 @@ function add_log() case 'critical': $sql_ary['log_type'] = LOG_CRITICAL; break; - + default: return false; } @@ -2981,9 +2985,9 @@ function msg_handler($errno, $msg_text, $errfile, $errline) echo '
      '; echo '
      '; echo '

      ' . $msg_title . '

      '; - + echo '
      ' . $msg_text . '
      '; - + echo $l_notify; echo '
      '; @@ -2995,7 +2999,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline) echo '
      '; echo ''; echo ''; - + exit_handler(); break; @@ -3045,7 +3049,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline) // We do not want the cron script to be called on error messages define('IN_CRON', true); - + if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin']) { adm_page_footer(); @@ -3075,7 +3079,7 @@ function page_header($page_title = '', $display_online_list = true) { return; } - + define('HEADER_INC', true); // gzip_compression @@ -3300,14 +3304,14 @@ function page_header($page_title = '', $display_online_list = true) // Which timezone? $tz = ($user->data['user_id'] != ANONYMOUS) ? strval(doubleval($user->data['user_timezone'])) : strval(doubleval($config['board_timezone'])); - + // Send a proper content-language to the output $user_lang = $user->lang['USER_LANG']; if (strpos($user_lang, '-x-') !== false) { $user_lang = substr($user_lang, 0, strpos($user_lang, '-x-')); } - + // The following assigns all _common_ variables that may be used at any point in a template. $template->assign_vars(array( 'SITENAME' => $config['sitename'], @@ -3453,7 +3457,7 @@ function page_footer($run_cron = true) if (!defined('IN_CRON') && $run_cron && !$config['board_disable']) { $cron_type = ''; - + if (time() - $config['queue_interval'] > $config['last_queue_run'] && !defined('IN_ADMIN') && file_exists($phpbb_root_path . 'cache/queue.' . $phpEx)) { // Process email queue diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index eeaa6d9529..9e4b075818 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -983,7 +983,7 @@ class bbcode_firstpass extends bbcode // 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) { - $server_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'); + $server_name = $user->host; // Forcing server vars is the only way to specify/override the protocol if ($config['force_server_vars'] || !$server_name) @@ -1084,7 +1084,7 @@ class parse_message extends bbcode_firstpass if ($config['max_' . $mode . '_chars'] > 0) { $msg_len = ($mode == 'post') ? utf8_strlen($this->message) : utf8_strlen(preg_replace('#\[\/?[a-z\*\+\-]+(=[\S]+)?\]#ius', ' ', $this->message)); - + if ((!$msg_len && $mode !== 'sig') || $config['max_' . $mode . '_chars'] && $msg_len > $config['max_' . $mode . '_chars']) { $this->warn_msg[] = (!$msg_len) ? $user->lang['TOO_FEW_CHARS'] : sprintf($user->lang['TOO_MANY_CHARS_' . strtoupper($mode)], $msg_len, $config['max_' . $mode . '_chars']); @@ -1254,7 +1254,7 @@ class parse_message extends bbcode_firstpass $match = $replace = array(); // NOTE: obtain_* function? chaching the table contents? - + // For now setting the ttl to 10 minutes switch ($db->sql_layer) { @@ -1264,7 +1264,7 @@ class parse_message extends bbcode_firstpass FROM ' . SMILIES_TABLE . ' ORDER BY LEN(code) DESC'; break; - + case 'firebird': $sql = 'SELECT * FROM ' . SMILIES_TABLE . ' diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 738cbfa74d..0a80f32933 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -158,7 +158,7 @@ class session $this->update_session_page = $update_session_page; $this->browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? htmlspecialchars((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->host = (!empty($_SERVER['HTTP_HOST'])) ? (string) strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME')); $this->page = $this->extract_current_page($phpbb_root_path); // if the forwarded for header shall be checked we have to validate its contents @@ -649,7 +649,7 @@ class session $this->set_cookie('sid', $this->session_id, $cookie_expire); unset($cookie_expire); - + $sql = 'SELECT COUNT(session_id) AS sessions FROM ' . SESSIONS_TABLE . ' WHERE session_user_id = ' . (int) $this->data['user_id'] . ' @@ -777,7 +777,7 @@ class session global $db, $config; $batch_size = 10; - + if (!$this->time_now) { $this->time_now = time(); @@ -825,7 +825,7 @@ class session // Less than 10 users, update gc timer ... else we want gc // called again to delete other sessions set_config('session_last_gc', $this->time_now, true); - + if ($config['max_autologin_time']) { $sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . ' @@ -834,14 +834,14 @@ class session } $this->confirm_gc(); } - + return; } - + function confirm_gc($type = 0) { global $db, $config; - + $sql = 'SELECT DISTINCT c.session_id FROM ' . CONFIRM_TABLE . ' c LEFT JOIN ' . SESSIONS_TABLE . ' s ON (c.session_id = s.session_id) @@ -867,8 +867,8 @@ class session } $db->sql_freeresult($result); } - - + + /** * Sets a cookie * @@ -1481,7 +1481,7 @@ class user extends session $sql = 'SELECT image_name, image_filename, image_lang, image_height, image_width FROM ' . STYLES_IMAGESET_DATA_TABLE . ' WHERE imageset_id = ' . $this->theme['imageset_id'] . " - AND image_filename <> '' + AND image_filename <> '' AND image_lang IN ('" . $db->sql_escape($this->img_lang) . "', '')"; $result = $db->sql_query($sql, 3600); @@ -1891,7 +1891,7 @@ class user extends session default: $use_width = ($width === false) ? $img_data['width'] : $width; - + return '' . $alt . ''; break; } diff --git a/phpBB/install/index.php b/phpBB/install/index.php index 60265d5a29..bbf7fe34d3 100755 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -450,7 +450,7 @@ class module global $db, $template; $template->display('body'); - + // Close our DB connection. if (!empty($db) && is_object($db)) { @@ -493,7 +493,8 @@ class module */ function redirect($page) { - $server_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'); + // HTTP_HOST is having the correct browser url in most cases... + $server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME')); $server_port = (!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT'); $secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 1 : 0; @@ -511,7 +512,11 @@ class module if ($server_port && (($secure && $server_port <> 443) || (!$secure && $server_port <> 80))) { - $url .= ':' . $server_port; + // HTTP HOST can carry a port number... + if (strpos($server_name, ':') === false) + { + $url .= ':' . $server_port; + } } $url .= $script_path . '/' . $page; @@ -535,7 +540,7 @@ class module $l_cat = (!empty($lang['CAT_' . $cat])) ? $lang['CAT_' . $cat] : preg_replace('#_#', ' ', $cat); $cat = strtolower($cat); $url = $this->module_url . "?mode=$cat&language=$language"; - + if ($this->mode == $cat) { $template->assign_block_vars('t_block1', array( diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index bce3cec730..b942f01b8c 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -77,7 +77,7 @@ class install_install extends module case 'database': $this->obtain_database_settings($mode, $sub); - + break; case 'administrator': @@ -87,7 +87,7 @@ class install_install extends module case 'config_file': $this->create_config_file($mode, $sub); - + break; case 'advanced': @@ -105,7 +105,7 @@ class install_install extends module $this->add_language($mode, $sub); $this->add_bots($mode, $sub); $this->email_admin($mode, $sub); - + // Remove the lock file @unlink($phpbb_root_path . 'cache/install_lock'); @@ -184,8 +184,8 @@ class install_install extends module 'S_EXPLAIN' => true, 'S_LEGEND' => false, )); - - + + // Check for url_fopen if (@ini_get('allow_url_fopen') == '1' || strtolower(@ini_get('allow_url_fopen')) == 'on') { @@ -204,8 +204,8 @@ class install_install extends module 'S_EXPLAIN' => true, 'S_LEGEND' => false, )); - - + + // Check for getimagesize if (@function_exists('getimagesize')) { @@ -802,7 +802,7 @@ class install_install extends module $s_hidden_fields .= ''; } } - + $s_hidden_fields .= ($data['img_imagick']) ? '' : ''; $s_hidden_fields .= ''; @@ -907,7 +907,7 @@ class install_install extends module $config_data .= "// @define('DEBUG', true);\n"; $config_data .= "// @define('DEBUG_EXTRA', true);\n"; $config_data .= '?' . '>'; // Done this to prevent highlighting editors getting confused! - + // Attempt to write out the config file directly. If it works, this is the easiest way to do it ... if ((file_exists($phpbb_root_path . 'config.' . $phpEx) && is_writable($phpbb_root_path . 'config.' . $phpEx)) || is_writable($phpbb_root_path)) { @@ -1018,8 +1018,11 @@ class install_install extends module $s_hidden_fields = ($data['img_imagick']) ? '' : ''; $s_hidden_fields .= ''; + // HTTP_HOST is having the correct browser url in most cases... + $server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME')); + $data['email_enable'] = ($data['email_enable'] !== '') ? $data['email_enable'] : true; - $data['server_name'] = ($data['server_name'] !== '') ? $data['server_name'] : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME')); + $data['server_name'] = ($data['server_name'] !== '') ? $data['server_name'] : $server_name; $data['server_port'] = ($data['server_port'] !== '') ? $data['server_port'] : ((!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT')); $data['server_protocol'] = ($data['server_protocol'] !== '') ? $data['server_protocol'] : ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://'); $data['cookie_secure'] = ($data['cookie_secure'] !== '') ? $data['cookie_secure'] : ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? true : false); @@ -1109,7 +1112,9 @@ class install_install extends module $this->p_master->redirect("index.$phpEx?mode=install"); } - $cookie_domain = ($data['server_name'] != '') ? $data['server_name'] : (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'); + // HTTP_HOST is having the correct browser url in most cases... + $server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME')); + $cookie_domain = ($data['server_name'] != '') ? $data['server_name'] : $server_name; // Try to come up with the best solution for cookie domain... if (strpos($cookie_domain, 'www.') === 0) @@ -1314,11 +1319,11 @@ class install_install extends module 'UPDATE ' . $data['table_prefix'] . "config SET config_value = '" . $db->sql_escape($data['admin_name']) . "' WHERE config_name = 'newest_username'", - + 'UPDATE ' . $data['table_prefix'] . "config SET config_value = '" . md5(mt_rand()) . "' WHERE config_name = 'avatar_salt'", - + 'UPDATE ' . $data['table_prefix'] . "users SET username = '" . $db->sql_escape($data['admin_name']) . "', user_password='" . $db->sql_escape(md5($data['admin_pass1'])) . "', user_ip = '" . $db->sql_escape($user_ip) . "', user_lang = '" . $db->sql_escape($data['default_lang']) . "', user_email='" . $db->sql_escape($data['board_email1']) . "', user_dateformat='" . $db->sql_escape($lang['default_dateformat']) . "', user_email_hash = " . (crc32($data['board_email1']) . strlen($data['board_email1'])) . ", username_clean = '" . $db->sql_escape(utf8_clean_string($data['admin_name'])) . "' WHERE username = 'Admin'", @@ -1577,7 +1582,7 @@ class install_install extends module $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - + $_module->move_module_by($row, 'move_up', 4); // Move permissions intro screen module 4 up... @@ -1589,7 +1594,7 @@ class install_install extends module $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - + $_module->move_module_by($row, 'move_up', 4); // Move manage users screen module 5 up... @@ -1601,7 +1606,7 @@ class install_install extends module $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - + $_module->move_module_by($row, 'move_up', 5); } @@ -1616,7 +1621,7 @@ class install_install extends module $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - + $_module->move_module_by($row, 'move_down', 4); } @@ -1841,7 +1846,7 @@ class install_install extends module 'user_dateformat' => $lang['default_dateformat'], 'user_allow_massemail' => 0, ); - + $user_id = user_add($user_row); if (!$user_id) From 325ff1fa1b0f75b7da6a6abbc9d6bbf032bcdedf Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 30 Jan 2008 16:01:15 +0000 Subject: [PATCH 030/102] One commit for those fixes having a very tiny impact (mostly only whitespaces or forgotten spans, etc.) Although i somehow mistakingly got #20445 and #15249 into it. :/ Removing s_watching_img from watch_topic_forum() function (Bug #20445) Changing order for post review if more than one post affected (Bug #15249) Language typos/fixes (Bug #20425, #15719, #15429, #14669, #13479) Style/Template fixes (Bug #20065, #19405, #19205, #15028, #14934, #14821, #14752, #14497, #13707, #14738) Tiny code fixes (Bug #20165, #20025, #19795, #14804) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8350 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/acp_language.html | 2 + phpBB/adm/style/colour_swatch.html | 4 +- phpBB/adm/style/install_update_diff.html | 4 +- phpBB/docs/CHANGELOG.html | 5 ++ phpBB/docs/hook_system.html | 4 +- phpBB/includes/acp/acp_attachments.php | 28 +++++----- phpBB/includes/acp/acp_board.php | 8 +-- phpBB/includes/acp/acp_search.php | 4 +- phpBB/includes/acp/acp_users.php | 56 +++++++++---------- phpBB/includes/diff/renderer.php | 10 ++-- phpBB/includes/functions.php | 12 ++-- phpBB/includes/functions_content.php | 16 +++--- phpBB/includes/functions_display.php | 6 +- phpBB/includes/functions_module.php | 6 +- phpBB/includes/functions_posting.php | 13 +++-- phpBB/includes/functions_privmsgs.php | 20 +++---- phpBB/includes/functions_user.php | 42 +++++++------- phpBB/includes/ucp/ucp_pm.php | 2 +- phpBB/includes/ucp/ucp_prefs.php | 2 +- phpBB/install/install_update.php | 6 +- phpBB/language/en/acp/common.php | 40 ++++++------- phpBB/language/en/acp/permissions_phpbb.php | 4 +- phpBB/language/en/acp/posting.php | 10 ++-- phpBB/language/en/help_faq.php | 2 +- phpBB/language/en/mcp.php | 6 +- phpBB/language/en/posting.php | 2 +- phpBB/posting.php | 10 ++-- .../styles/prosilver/template/index_body.html | 2 +- .../styles/prosilver/template/login_body.html | 2 +- .../prosilver/template/mcp_warn_list.html | 4 +- .../prosilver/template/overall_header.html | 4 +- .../prosilver/template/ucp_groups_manage.html | 2 +- .../prosilver/template/ucp_main_front.html | 4 +- .../template/ucp_pm_viewmessage_print.html | 4 +- .../prosilver/template/viewforum_body.html | 2 +- .../subsilver2/template/login_body.html | 4 +- .../subsilver2/template/overall_header.html | 2 +- .../subsilver2/template/posting_body.html | 2 +- .../subsilver2/template/ucp_resend.html | 2 +- .../subsilver2/template/viewtopic_body.html | 3 +- phpBB/viewforum.php | 12 ++-- phpBB/viewtopic.php | 14 +++-- 42 files changed, 199 insertions(+), 188 deletions(-) diff --git a/phpBB/adm/style/acp_language.html b/phpBB/adm/style/acp_language.html index 815ebb024a..95ac1d5852 100644 --- a/phpBB/adm/style/acp_language.html +++ b/phpBB/adm/style/acp_language.html @@ -121,9 +121,11 @@ diff --git a/phpBB/adm/style/colour_swatch.html b/phpBB/adm/style/colour_swatch.html index f3c5a812dc..c9e89980d8 100644 --- a/phpBB/adm/style/colour_swatch.html +++ b/phpBB/adm/style/colour_swatch.html @@ -8,7 +8,7 @@ {L_COLOUR_SWATCH} diff --git a/phpBB/adm/style/install_update_diff.html b/phpBB/adm/style/install_update_diff.html index b9ac19ae5d..efbe1d045c 100644 --- a/phpBB/adm/style/install_update_diff.html +++ b/phpBB/adm/style/install_update_diff.html @@ -32,7 +32,7 @@ function resize_panel() diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index d778c0b41c..77656accab 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -106,6 +106,11 @@
    64. [Fix] Fix possible database transaction errors if code returns on error and rollback happened (Bug #17025)
    65. [Change] Allow numbers in permission names for modifications, as well as uppercase letters for the request_ part (Bug #20125)
    66. [Fix] Use HTTP_HOST in favor of SERVER_NAME for determining server url for redirection and installation (Bug #19955)
    67. +
    68. Removing s_watching_img from watch_topic_forum() function (Bug #20445)
    69. +
    70. Changing order for post review if more than one post affected (Bug #15249)
    71. +
    72. Language typos/fixes (Bug #20425, #15719, #15429, #14669, #13479)
    73. +
    74. Style/Template fixes (Bug #20065, #19405, #19205, #15028, #14934, #14821, #14752, #14497, #13707, #14738)
    75. +
    76. Tiny code fixes (Bug #20165, #20025, #19795, #14804)
    77. 1.i. Changes since 3.0.RC8

      diff --git a/phpBB/docs/hook_system.html b/phpBB/docs/hook_system.html index b7fd702987..565e0096fc 100644 --- a/phpBB/docs/hook_system.html +++ b/phpBB/docs/hook_system.html @@ -14,7 +14,7 @@ phpBB3 • Hook System diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 08b5f863e0..4d403df93b 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -23,7 +23,7 @@ class acp_attachments { var $u_action; var $new_config; - + function main($id, $mode) { global $db, $user, $auth, $template, $cache; @@ -56,7 +56,7 @@ class acp_attachments case 'ext_groups': $l_title = 'ACP_EXTENSION_GROUPS'; break; - + case 'orphan': $l_title = 'ACP_ORPHAN_ATTACHMENTS'; break; @@ -212,7 +212,7 @@ class acp_attachments // Secure Download Options - Same procedure as with banning $allow_deny = ($this->new_config['secure_allow_deny']) ? 'ALLOWED' : 'DISALLOWED'; - + $sql = 'SELECT * FROM ' . SITELIST_TABLE; $result = $db->sql_query($sql); @@ -282,7 +282,7 @@ class acp_attachments 'CONTENT' => build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars), ) ); - + unset($display_vars['vars'][$config_key]); } @@ -334,7 +334,7 @@ class acp_attachments FROM ' . EXTENSIONS_TABLE . ' WHERE ' . $db->sql_in_set('extension_id', $extension_id_list); $result = $db->sql_query($sql); - + $extension_list = ''; while ($row = $db->sql_fetchrow($result)) { @@ -364,7 +364,7 @@ class acp_attachments FROM ' . EXTENSIONS_TABLE . " WHERE extension = '" . $db->sql_escape($add_extension) . "'"; $result = $db->sql_query($sql); - + if ($row = $db->sql_fetchrow($result)) { $error[] = sprintf($user->lang['EXTENSION_EXIST'], $add_extension); @@ -603,7 +603,7 @@ class acp_attachments SET group_id = 0 WHERE group_id = $group_id"; $db->sql_query($sql); - + add_log('admin', 'LOG_ATTACH_EXTGROUP_DEL', $group_name); $cache->destroy('_extensions'); @@ -900,7 +900,7 @@ class acp_attachments $upload_list = array(); foreach ($add_files as $attach_id) { - if (!in_array($attach_id, array_keys($delete_files)) && !empty($post_ids[$attach_id])) + if (!isset($delete_files[$attach_id]) && !empty($post_ids[$attach_id])) { $upload_list[$attach_id] = $post_ids[$attach_id]; } @@ -1050,7 +1050,7 @@ class acp_attachments ATTACHMENT_CATEGORY_FLASH => $user->lang['CAT_FLASH_FILES'], ATTACHMENT_CATEGORY_QUICKTIME => $user->lang['CAT_QUICKTIME_FILES'], ); - + if ($group_id) { $sql = 'SELECT cat_id @@ -1066,7 +1066,7 @@ class acp_attachments { $cat_type = ATTACHMENT_CATEGORY_NONE; } - + $group_select = ''; $sql = 'SELECT group_id, group_name @@ -1104,7 +1104,7 @@ class acp_attachments $row['group_id'] = 0; $row['group_name'] = $user->lang['NOT_ASSIGNED']; $group_name[] = $row; - + for ($i = 0; $i < sizeof($group_name); $i++) { if ($default_group === false) @@ -1138,7 +1138,7 @@ class acp_attachments if (empty($magic_home)) { $locations = array('C:/WINDOWS/', 'C:/WINNT/', 'C:/WINDOWS/SYSTEM/', 'C:/WINNT/SYSTEM/', 'C:/WINDOWS/SYSTEM32/', 'C:/WINNT/SYSTEM32/', '/usr/bin/', '/usr/sbin/', '/usr/local/bin/', '/usr/local/sbin/', '/opt/', '/usr/imagemagick/', '/usr/bin/imagemagick/'); - $path_locations = str_replace('\\', '/', (explode(($exe) ? ';' : ':', getenv('PATH')))); + $path_locations = str_replace('\\', '/', (explode(($exe) ? ';' : ':', getenv('PATH')))); $locations = array_merge($path_locations, $locations); @@ -1352,7 +1352,7 @@ class acp_attachments $db->sql_query($sql); } } - + if (!empty($ip_list_log)) { // Update log diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 4d467b6895..455719110e 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -127,7 +127,7 @@ class acp_board 'pm_max_msgs' => array('lang' => 'BOXES_LIMIT', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true), 'full_folder_action' => array('lang' => 'FULL_FOLDER_ACTION', 'validate' => 'int', 'type' => 'select', 'method' => 'full_folder_select', 'explain' => true), 'pm_edit_time' => array('lang' => 'PM_EDIT_TIME', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), - + 'legend2' => 'GENERAL_OPTIONS', 'allow_mass_pm' => array('lang' => 'ALLOW_MASS_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'auth_bbcode_pm' => array('lang' => 'ALLOW_BBCODE_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), @@ -269,7 +269,7 @@ class acp_board 'load_jumpbox' => array('lang' => 'YES_JUMPBOX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'load_user_activity' => array('lang' => 'LOAD_USER_ACTIVITY', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'load_tplcompile' => array('lang' => 'RECOMPILE_STYLES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), - + 'legend3' => 'CUSTOM_PROFILE_FIELDS', 'load_cpf_memberlist' => array('lang' => 'LOAD_CPF_MEMBERLIST', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'load_cpf_viewprofile' => array('lang' => 'LOAD_CPF_VIEWPROFILE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), @@ -564,7 +564,7 @@ class acp_board 'CONTENT' => build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars), ) ); - + unset($display_vars['vars'][$config_key]); } @@ -795,7 +795,7 @@ class acp_board } $dateformat_options .= '
      - +
      diff --git a/phpBB/styles/prosilver/template/mcp_warn_list.html b/phpBB/styles/prosilver/template/mcp_warn_list.html index a432df4240..3da7c4c389 100644 --- a/phpBB/styles/prosilver/template/mcp_warn_list.html +++ b/phpBB/styles/prosilver/template/mcp_warn_list.html @@ -38,14 +38,14 @@ - +

      - +

      1.i. Changes since 3.0.RC8

      diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index a3507a7b54..88b07305a2 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -1102,7 +1102,7 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id, */ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src) { - global $ranks, $config; + global $ranks, $config, $phpbb_root_path; if (empty($ranks)) { @@ -1113,8 +1113,8 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank if (!empty($user_rank)) { $rank_title = (isset($ranks['special'][$user_rank]['rank_title'])) ? $ranks['special'][$user_rank]['rank_title'] : ''; - $rank_img = (!empty($ranks['special'][$user_rank]['rank_image'])) ? '' . $ranks['special'][$user_rank]['rank_title'] . '' : ''; - $rank_img_src = (!empty($ranks['special'][$user_rank]['rank_image'])) ? $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] : ''; + $rank_img = (!empty($ranks['special'][$user_rank]['rank_image'])) ? '' . $ranks['special'][$user_rank]['rank_title'] . '' : ''; + $rank_img_src = (!empty($ranks['special'][$user_rank]['rank_image'])) ? $phpbb_root_path . $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image'] : ''; } else { @@ -1125,8 +1125,8 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank if ($user_posts >= $rank['rank_min']) { $rank_title = $rank['rank_title']; - $rank_img = (!empty($rank['rank_image'])) ? '' . $rank['rank_title'] . '' : ''; - $rank_img_src = (!empty($rank['rank_image'])) ? $config['ranks_path'] . '/' . $rank['rank_image'] : ''; + $rank_img = (!empty($rank['rank_image'])) ? '' . $rank['rank_title'] . '' : ''; + $rank_img_src = (!empty($rank['rank_image'])) ? $phpbb_root_path . $config['ranks_path'] . '/' . $rank['rank_image'] : ''; break; } } From f8124b2117bf3abce4671cd2aa529b65b2103193 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 30 Jan 2008 17:06:26 +0000 Subject: [PATCH 032/102] Allow forum notifications if topic notifications are disabled but forum notifications enabled - #14765 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8353 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/functions_posting.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index c6afafe01a..0513ae1215 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -112,6 +112,7 @@
    78. [Fix] Style/Template fixes (Bug #20065, #19405, #19205, #15028, #14934, #14821, #14752, #14497, #13707, #14738)
    79. [Fix] Tiny code fixes (Bug #20165, #20025, #19795, #14804)
    80. [Fix] Prepend phpbb_root_path to ranks path for displaying ranks (Bug #19075)
    81. +
    82. [Fix] Allow forum notifications if topic notifications are disabled but forum notifications enabled (Bug #14765)
    83. 1.i. Changes since 3.0.RC8

      diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 2374029ae6..29dca090b7 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1111,7 +1111,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id trigger_error('WRONG_NOTIFICATION_MODE'); } - if (!$config['allow_topic_notify']) + if (($topic_notification && !$config['allow_topic_notify']) || ($forum_notification && !$config['allow_forum_notify'])) { return; } From 35ae4c420fed689ef16df8e3cad8c5164a6443df Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 30 Jan 2008 18:48:03 +0000 Subject: [PATCH 033/102] seems like i forgot something. :/ git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8354 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_posting.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 29dca090b7..33fab63235 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -939,7 +939,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id WHERE p.topic_id = $topic_id " . ((!$auth->acl_get('m_approve', $forum_id)) ? 'AND p.post_approved = 1' : '') . ' ' . (($mode == 'post_review') ? " AND p.post_id > $cur_post_id" : '') . ' - ORDER BY p.post_time'; + ORDER BY p.post_time '; $sql .= ($mode == 'post_review') ? 'ASC' : 'DESC'; $result = $db->sql_query_limit($sql, $config['posts_per_page']); From f24069d32c39d21037503b0c5d645a5929291f69 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 30 Jan 2008 19:30:58 +0000 Subject: [PATCH 034/102] Fixing realpath issues for provider returning the passed value instead of disabling it. This fixes issues with confirm boxes for those hosted on Network Solutions for example. - #20435 many thanks to the reporter for allowing me to debug this on his server. :) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8355 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/functions.php | 335 ++++++++++++++++++----------------- 2 files changed, 176 insertions(+), 160 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 0513ae1215..eea7f88892 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -113,6 +113,7 @@
    84. [Fix] Tiny code fixes (Bug #20165, #20025, #19795, #14804)
    85. [Fix] Prepend phpbb_root_path to ranks path for displaying ranks (Bug #19075)
    86. [Fix] Allow forum notifications if topic notifications are disabled but forum notifications enabled (Bug #14765)
    87. +
    88. [Fix] Fixing realpath issues for provider returning the passed value instead of disabling it. This fixes issues with confirm boxes for those hosted on Network Solutions for example. (Bug #20435)
    89. 1.i. Changes since 3.0.RC8

      diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index e31b8d5294..385a1ea72e 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -523,177 +523,175 @@ if (!function_exists('stripos')) } } -if (!function_exists('realpath')) +/** +* Checks if a path ($path) is absolute or relative +* +* @param string $path Path to check absoluteness of +* @return boolean +*/ +function is_absolute($path) { - /** - * Checks if a path ($path) is absolute or relative - * - * @param string $path Path to check absoluteness of - * @return boolean - */ - function is_absolute($path) + return ($path[0] == '/' || (DIRECTORY_SEPARATOR == '\\' && preg_match('#^[a-z]:/#i', $path))) ? true : false; +} + +/** +* @author Chris Smith +* @copyright 2006 Project Minerva Team +* @param string $path The path which we should attempt to resolve. +* @return mixed +*/ +function phpbb_own_realpath($path) +{ + // Now to perform funky shizzle + + // Switch to use UNIX slashes + $path = str_replace(DIRECTORY_SEPARATOR, '/', $path); + $path_prefix = ''; + + // Determine what sort of path we have + if (is_absolute($path)) { - return ($path[0] == '/' || (DIRECTORY_SEPARATOR == '\\' && preg_match('#^[a-z]:/#i', $path))) ? true : false; - } + $absolute = true; - /** - * @author Chris Smith - * @copyright 2006 Project Minerva Team - * @param string $path The path which we should attempt to resolve. - * @return mixed - */ - function phpbb_realpath($path) - { - // Now to perform funky shizzle - - // Switch to use UNIX slashes - $path = str_replace(DIRECTORY_SEPARATOR, '/', $path); - $path_prefix = ''; - - // Determine what sort of path we have - if (is_absolute($path)) + if ($path[0] == '/') { + // Absolute path, *NIX style + $path_prefix = ''; + } + else + { + // Absolute path, Windows style + // Remove the drive letter and colon + $path_prefix = $path[0] . ':'; + $path = substr($path, 2); + } + } + else + { + // Relative Path + // Prepend the current working directory + if (function_exists('getcwd')) + { + // This is the best method, hopefully it is enabled! + $path = str_replace(DIRECTORY_SEPARATOR, '/', getcwd()) . '/' . $path; $absolute = true; - - if ($path[0] == '/') + if (preg_match('#^[a-z]:#i', $path)) { - // Absolute path, *NIX style - $path_prefix = ''; + $path_prefix = $path[0] . ':'; + $path = substr($path, 2); } else { - // Absolute path, Windows style - // Remove the drive letter and colon - $path_prefix = $path[0] . ':'; - $path = substr($path, 2); + $path_prefix = ''; + } + } + else if (isset($_SERVER['SCRIPT_FILENAME']) && !empty($_SERVER['SCRIPT_FILENAME'])) + { + // Warning: If chdir() has been used this will lie! + // Warning: This has some problems sometime (CLI can create them easily) + $path = str_replace(DIRECTORY_SEPARATOR, '/', dirname($_SERVER['SCRIPT_FILENAME'])) . '/' . $path; + $absolute = true; + $path_prefix = ''; + } + else + { + // We have no way of getting the absolute path, just run on using relative ones. + $absolute = false; + $path_prefix = '.'; + } + } + + // Remove any repeated slashes + $path = preg_replace('#/{2,}#', '/', $path); + + // Remove the slashes from the start and end of the path + $path = trim($path, '/'); + + // Break the string into little bits for us to nibble on + $bits = explode('/', $path); + + // Remove any . in the path, renumber array for the loop below + $bits = array_values(array_diff($bits, array('.'))); + + // Lets get looping, run over and resolve any .. (up directory) + for ($i = 0, $max = sizeof($bits); $i < $max; $i++) + { + // @todo Optimise + if ($bits[$i] == '..' ) + { + if (isset($bits[$i - 1])) + { + if ($bits[$i - 1] != '..') + { + // We found a .. and we are able to traverse upwards, lets do it! + unset($bits[$i]); + unset($bits[$i - 1]); + $i -= 2; + $max -= 2; + $bits = array_values($bits); + } + } + else if ($absolute) // ie. !isset($bits[$i - 1]) && $absolute + { + // We have an absolute path trying to descend above the root of the filesystem + // ... Error! + return false; + } + } + } + + // Prepend the path prefix + array_unshift($bits, $path_prefix); + + $resolved = ''; + + $max = sizeof($bits) - 1; + + // Check if we are able to resolve symlinks, Windows cannot. + $symlink_resolve = (function_exists('readlink')) ? true : false; + + foreach ($bits as $i => $bit) + { + if (@is_dir("$resolved/$bit") || ($i == $max && @is_file("$resolved/$bit"))) + { + // Path Exists + if ($symlink_resolve && is_link("$resolved/$bit") && ($link = readlink("$resolved/$bit"))) + { + // Resolved a symlink. + $resolved = $link . (($i == $max) ? '' : '/'); + continue; } } else { - // Relative Path - // Prepend the current working directory - if (function_exists('getcwd')) - { - // This is the best method, hopefully it is enabled! - $path = str_replace(DIRECTORY_SEPARATOR, '/', getcwd()) . '/' . $path; - $absolute = true; - if (preg_match('#^[a-z]:#i', $path)) - { - $path_prefix = $path[0] . ':'; - $path = substr($path, 2); - } - else - { - $path_prefix = ''; - } - } - else if (isset($_SERVER['SCRIPT_FILENAME']) && !empty($_SERVER['SCRIPT_FILENAME'])) - { - // Warning: If chdir() has been used this will lie! - // Warning: This has some problems sometime (CLI can create them easily) - $path = str_replace(DIRECTORY_SEPARATOR, '/', dirname($_SERVER['SCRIPT_FILENAME'])) . '/' . $path; - $absolute = true; - $path_prefix = ''; - } - else - { - // We have no way of getting the absolute path, just run on using relative ones. - $absolute = false; - $path_prefix = '.'; - } + // Something doesn't exist here! + // This is correct realpath() behaviour but sadly open_basedir and safe_mode make this problematic + // return false; } - - // Remove any repeated slashes - $path = preg_replace('#/{2,}#', '/', $path); - - // Remove the slashes from the start and end of the path - $path = trim($path, '/'); - - // Break the string into little bits for us to nibble on - $bits = explode('/', $path); - - // Remove any . in the path, renumber array for the loop below - $bits = array_values(array_diff($bits, array('.'))); - - // Lets get looping, run over and resolve any .. (up directory) - for ($i = 0, $max = sizeof($bits); $i < $max; $i++) - { - // @todo Optimise - if ($bits[$i] == '..' ) - { - if (isset($bits[$i - 1])) - { - if ($bits[$i - 1] != '..') - { - // We found a .. and we are able to traverse upwards, lets do it! - unset($bits[$i]); - unset($bits[$i - 1]); - $i -= 2; - $max -= 2; - $bits = array_values($bits); - } - } - else if ($absolute) // ie. !isset($bits[$i - 1]) && $absolute - { - // We have an absolute path trying to descend above the root of the filesystem - // ... Error! - return false; - } - } - } - - // Prepend the path prefix - array_unshift($bits, $path_prefix); - - $resolved = ''; - - $max = sizeof($bits) - 1; - - // Check if we are able to resolve symlinks, Windows cannot. - $symlink_resolve = (function_exists('readlink')) ? true : false; - - foreach ($bits as $i => $bit) - { - if (@is_dir("$resolved/$bit") || ($i == $max && @is_file("$resolved/$bit"))) - { - // Path Exists - if ($symlink_resolve && is_link("$resolved/$bit") && ($link = readlink("$resolved/$bit"))) - { - // Resolved a symlink. - $resolved = $link . (($i == $max) ? '' : '/'); - continue; - } - } - else - { - // Something doesn't exist here! - // This is correct realpath() behaviour but sadly open_basedir and safe_mode make this problematic - // return false; - } - $resolved .= $bit . (($i == $max) ? '' : '/'); - } - - // @todo If the file exists fine and open_basedir only has one path we should be able to prepend it - // because we must be inside that basedir, the question is where... - // @internal The slash in is_dir() gets around an open_basedir restriction - if (!@file_exists($resolved) || (!is_dir($resolved . '/') && !is_file($resolved))) - { - return false; - } - - // Put the slashes back to the native operating systems slashes - $resolved = str_replace('/', DIRECTORY_SEPARATOR, $resolved); - - // Check for DIRECTORY_SEPARATOR at the end (and remove it!) - if (substr($resolved, -1) == DIRECTORY_SEPARATOR) - { - return substr($resolved, 0, -1); - } - - return $resolved; // We got here, in the end! + $resolved .= $bit . (($i == $max) ? '' : '/'); } + + // @todo If the file exists fine and open_basedir only has one path we should be able to prepend it + // because we must be inside that basedir, the question is where... + // @internal The slash in is_dir() gets around an open_basedir restriction + if (!@file_exists($resolved) || (!is_dir($resolved . '/') && !is_file($resolved))) + { + return false; + } + + // Put the slashes back to the native operating systems slashes + $resolved = str_replace('/', DIRECTORY_SEPARATOR, $resolved); + + // Check for DIRECTORY_SEPARATOR at the end (and remove it!) + if (substr($resolved, -1) == DIRECTORY_SEPARATOR) + { + return substr($resolved, 0, -1); + } + + return $resolved; // We got here, in the end! } -else + +if (!function_exists('realpath')) { /** * A wrapper for realpath @@ -701,15 +699,32 @@ else */ function phpbb_realpath($path) { - $path = realpath($path); + return phpbb_own_realpath($path); + } +} +else +{ + /** + * A wrapper for realpath + */ + function phpbb_realpath($path) + { + $realpath = realpath($path); - // Check for DIRECTORY_SEPARATOR at the end (and remove it!) - if (substr($path, -1) == DIRECTORY_SEPARATOR) + // Strangely there are provider not disabling realpath but returning strange values. :o + // We at least try to cope with them. + if ($realpath === $path || $realpath === false) { - return substr($path, 0, -1); + return phpbb_own_realpath($path); } - return $path; + // Check for DIRECTORY_SEPARATOR at the end (and remove it!) + if (substr($realpath, -1) == DIRECTORY_SEPARATOR) + { + $realpath = substr($realpath, 0, -1); + } + + return $realpath; } } From fbea6fbc31e45332f9bb56aa0a65eeba3451655a Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 1 Feb 2008 12:45:05 +0000 Subject: [PATCH 035/102] Try to sort last active date on memberlist correctly at least on current page (Bug #18665) - patch provided by phillipK git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8359 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/memberlist.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index eea7f88892..2e7600b000 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -114,6 +114,7 @@
    90. [Fix] Prepend phpbb_root_path to ranks path for displaying ranks (Bug #19075)
    91. [Fix] Allow forum notifications if topic notifications are disabled but forum notifications enabled (Bug #14765)
    92. [Fix] Fixing realpath issues for provider returning the passed value instead of disabling it. This fixes issues with confirm boxes for those hosted on Network Solutions for example. (Bug #20435)
    93. +
    94. [Fix] Try to sort last active date on memberlist correctly at least on current page (Bug #18665)
    95. 1.i. Changes since 3.0.RC8

      diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index f7c9d101a8..d021581cb2 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -1369,7 +1369,8 @@ switch ($mode) 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));")); +// 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));")); + usort($user_list, create_function('$first, $second', "global \$id_cache; return (\$id_cache[\$first]['last_visit'] == \$id_cache[\$second]['last_visit']) ? 0 : ((\$id_cache[\$first]['last_visit'] < \$id_cache[\$second]['last_visit']) ? $lesser_than : ($lesser_than * -1));")); } for ($i = 0, $end = sizeof($user_list); $i < $end; ++$i) From cc1ac794502e116f3367c12cc0e4fa272d0a29ec Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 1 Feb 2008 12:47:00 +0000 Subject: [PATCH 036/102] fixing one small typo git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8360 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/coding-guidelines.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html index 124ac74bb9..5ad2627d6e 100644 --- a/phpBB/docs/coding-guidelines.html +++ b/phpBB/docs/coding-guidelines.html @@ -1059,7 +1059,7 @@ append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp; <!-- END loopname -->
      -

      A bit later loops will be explained further. To not irretate you we will explain conditionals as well as other statements first.

      +

      A bit later loops will be explained further. To not irritate you we will explain conditionals as well as other statements first.

      Including files

      Something that existed in 2.0.x which no longer exists in 3.0.x is the ability to assign a template to a variable. This was used (for example) to output the jumpbox. Instead (perhaps better, perhaps not but certainly more flexible) we now have INCLUDE. This takes the simple form:

      From ae0fb4b070fc689a3639a0864ba1c4f3889d6c91 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Fri, 1 Feb 2008 13:12:05 +0000 Subject: [PATCH 037/102] #15120 #16029 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8362 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 4 ++++ phpBB/includes/functions_posting.php | 16 ++++++++++++++-- phpBB/posting.php | 5 +++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 2e7600b000..8931b8f347 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -115,6 +115,10 @@
    96. [Fix] Allow forum notifications if topic notifications are disabled but forum notifications enabled (Bug #14765)
    97. [Fix] Fixing realpath issues for provider returning the passed value instead of disabling it. This fixes issues with confirm boxes for those hosted on Network Solutions for example. (Bug #20435)
    98. [Fix] Try to sort last active date on memberlist correctly at least on current page (Bug #18665)
    99. +
    100. [Fix] Handle generation of form tokens when maximum time is set to -1
    101. +
    102. [Fix] Correctly delete unapproved posts without deleting the topic (Bug #15120)
    103. +
    104. [Fix] Respect signature permissions in posting (Bug #16029)
    105. +

      1.i. Changes since 3.0.RC8

      diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 33fab63235..615c65e1ad 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1332,9 +1332,21 @@ function delete_post($forum_id, $topic_id, $post_id, &$data) global $config, $phpEx, $phpbb_root_path; // Specify our post mode - $post_mode = ($data['topic_first_post_id'] == $data['topic_last_post_id']) ? 'delete_topic' : (($data['topic_first_post_id'] == $post_id) ? 'delete_first_post' : (($data['topic_last_post_id'] == $post_id) ? 'delete_last_post' : 'delete')); + $post_mode = 'delete'; + if (($data['topic_first_post_id'] === $data['topic_last_post_id']) && $data['topic_replies_real'] == 0) + { + $post_mode = 'delete_topic'; + } + else if ($data['topic_first_post_id'] == $post_id) + { + $post_mode = 'delete_first_post'; + } + else if ($data['topic_last_post_id'] == $post_id) + { + $post_mode = 'delete_last_post'; + } $sql_data = array(); - $next_post_id = 0; + $next_post_id = false; include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx); diff --git a/phpBB/posting.php b/phpBB/posting.php index 8a2ece6fde..fc83659e3e 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -582,7 +582,7 @@ if ($submit || $preview || $refresh) $post_data['enable_bbcode'] = (!$bbcode_status || isset($_POST['disable_bbcode'])) ? false : true; $post_data['enable_smilies'] = (!$smilies_status || isset($_POST['disable_smilies'])) ? false : true; $post_data['enable_urls'] = (isset($_POST['disable_magic_url'])) ? 0 : 1; - $post_data['enable_sig'] = (!$config['allow_sig']) ? false : ((isset($_POST['attach_sig']) && $user->data['is_registered']) ? true : false); + $post_data['enable_sig'] = (!$config['allow_sig'] || !$auth->acl_get('f_sigs', $forum_id) || !$auth->acl_get('u_sig')) ? false : ((isset($_POST['attach_sig']) && $user->data['is_registered']) ? true : false); if ($config['allow_topic_notify'] && $user->data['is_registered']) { @@ -1428,6 +1428,7 @@ function handle_post_delete($forum_id, $topic_id, $post_id, &$post_data) $data = array( 'topic_first_post_id' => $post_data['topic_first_post_id'], 'topic_last_post_id' => $post_data['topic_last_post_id'], + 'topic_replies_real' => $post_data['topic_replies_real'], 'topic_approved' => $post_data['topic_approved'], 'topic_type' => $post_data['topic_type'], 'post_approved' => $post_data['post_approved'], @@ -1439,7 +1440,7 @@ function handle_post_delete($forum_id, $topic_id, $post_id, &$post_data) $next_post_id = delete_post($forum_id, $topic_id, $post_id, $data); - if ($post_data['topic_first_post_id'] == $post_data['topic_last_post_id']) + if ($next_post_id === false) { add_log('mod', $forum_id, $topic_id, 'LOG_DELETE_TOPIC', $post_data['topic_title']); From 9fe2b06cacd85ff0363afe092825704026f532fa Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Fri, 1 Feb 2008 15:15:45 +0000 Subject: [PATCH 038/102] Oh well git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8364 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/styles/prosilver/template/overall_header.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html index dff22b2420..c0cb7640eb 100644 --- a/phpBB/styles/prosilver/template/overall_header.html +++ b/phpBB/styles/prosilver/template/overall_header.html @@ -57,7 +57,7 @@ */ window.onload = function() { - for (i = 0; i < onload_functions.length; i++) + for (var i = 0; i < onload_functions.length; i++) { eval(onload_functions[i]); } @@ -65,7 +65,7 @@ window.onunload = function() { - for (i = 0; i < onunload_functions.length; i++) + for (var i = 0; i < onunload_functions.length; i++) { eval(onunload_functions[i]); } From 91bde229ef6051f9455b948a0ed48c123bb9ec03 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Fri, 1 Feb 2008 16:53:49 +0000 Subject: [PATCH 039/102] IE is odd git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8366 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/styles/prosilver/template/jumpbox.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/styles/prosilver/template/jumpbox.html b/phpBB/styles/prosilver/template/jumpbox.html index 3ba7c3666d..f7b4fca609 100644 --- a/phpBB/styles/prosilver/template/jumpbox.html +++ b/phpBB/styles/prosilver/template/jumpbox.html @@ -29,5 +29,5 @@ -
      +

      From efdb743f60b9df2f5a151cd56ba3c45007cdedc8 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 2 Feb 2008 15:19:55 +0000 Subject: [PATCH 040/102] Users allowed to resign only from open and freely open groups - #19355 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8368 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/ucp/ucp_groups.php | 12 ++++++++++++ phpBB/language/en/groups.php | 6 ++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 8931b8f347..328c0b9098 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -118,6 +118,7 @@
    106. [Fix] Handle generation of form tokens when maximum time is set to -1
    107. [Fix] Correctly delete unapproved posts without deleting the topic (Bug #15120)
    108. [Fix] Respect signature permissions in posting (Bug #16029)
    109. +
    110. [Fix] Users allowed to resign only from open and freely open groups (Bug #19355)
    111. diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index a4fc818343..d6e7a30176 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -127,6 +127,18 @@ class ucp_groups } list(, $row) = each($row); + $sql = 'SELECT group_type + FROM ' . GROUPS_TABLE . ' + WHERE group_id = ' . $group_id; + $result = $db->sql_query($sql); + $group_type = (int) $db->sql_fetchfield('group_type'); + $db->sql_freeresult($result); + + if ($group_type != GROUP_OPEN && $group_type != GROUP_FREE) + { + trigger_error($user->lang['CANNOT_RESIGN_GROUP'] . $return_page); + } + if (confirm_box(true)) { group_user_del($group_id, $user->data['user_id']); diff --git a/phpBB/language/en/groups.php b/phpBB/language/en/groups.php index 7cee799535..9f72d4070f 100644 --- a/phpBB/language/en/groups.php +++ b/phpBB/language/en/groups.php @@ -40,8 +40,10 @@ $lang = array_merge($lang, array( 'ALREADY_IN_GROUP' => 'You are already a member of the selected group.', 'ALREADY_IN_GROUP_PENDING' => 'You already requested joining the selected group.', - 'CHANGED_DEFAULT_GROUP' => 'Successfully changed default group.', - + 'CANNOT_JOIN_GROUP' => 'You are not able to join this group. You are only able to join open and freely open groups.', + 'CANNOT_RESIGN_GROUP' => 'You are not able to resign from this group. You are only able to resign from open and freely open groups.', + 'CHANGED_DEFAULT_GROUP' => 'Successfully changed default group.', + 'GROUP_AVATAR' => 'Group avatar', 'GROUP_CHANGE_DEFAULT' => 'Are you sure you want to change your default membership to the group “%s”?', 'GROUP_CLOSED' => 'Closed', From cc24876726854e2e799651b1d7e40e54a2c0375b Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sun, 3 Feb 2008 22:55:10 +0000 Subject: [PATCH 041/102] merging r8373 into 3.0 branch: adding a new option to hide the entire list of subforums on listforums git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8374 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/acp_forums.html | 5 +++++ phpBB/develop/create_schema_files.php | 1 + phpBB/includes/acp/acp_forums.php | 3 +++ phpBB/includes/functions_display.php | 1 + phpBB/install/database_update.php | 11 ++++++++++- 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/sqlite_schema.sql | 1 + phpBB/language/en/acp/forums.php | 10 ++++++---- phpBB/styles/prosilver/template/forumlist_body.html | 2 +- phpBB/styles/subsilver2/template/forumlist_body.html | 2 +- 15 files changed, 35 insertions(+), 7 deletions(-) diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html index 560bc195bc..0a8c9b4c8a 100644 --- a/phpBB/adm/style/acp_forums.html +++ b/phpBB/adm/style/acp_forums.html @@ -202,6 +202,11 @@
      +
      +

      {L_LIST_SUBFORUMS_EXPLAIN}
      +
      +
      +

      {L_LIST_INDEX_EXPLAIN}
      diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 9ee9a81299..375ea8588d 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1072,6 +1072,7 @@ function get_schema_struct() 'forum_last_poster_name'=> array('VCHAR_UNI', ''), 'forum_last_poster_colour'=> array('VCHAR:6', ''), 'forum_flags' => array('TINT:4', 32), + 'display_subforum_list' => array('BOOL', 1), 'display_on_index' => array('BOOL', 1), 'enable_indexing' => array('BOOL', 1), 'enable_icons' => array('BOOL', 1), diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index bb8f437b80..d29c8dff30 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -132,6 +132,7 @@ class acp_forums 'forum_rules_link' => request_var('forum_rules_link', ''), 'forum_image' => request_var('forum_image', ''), 'forum_style' => request_var('forum_style', 0), + 'display_subforum_list' => request_var('display_subforum_list', false), 'display_on_index' => request_var('display_on_index', false), 'forum_topics_per_page' => request_var('topics_per_page', 0), 'enable_indexing' => request_var('enable_indexing', true), @@ -471,6 +472,7 @@ class acp_forums 'forum_rules_link' => '', 'forum_image' => '', 'forum_style' => 0, + 'display_subforum_list' => true, 'display_on_index' => false, 'forum_topics_per_page' => 0, 'enable_indexing' => true, @@ -670,6 +672,7 @@ class acp_forums 'S_FORUM_CAT' => ($forum_data['forum_type'] == FORUM_CAT) ? true : false, 'S_ENABLE_INDEXING' => ($forum_data['enable_indexing']) ? true : false, 'S_TOPIC_ICONS' => ($forum_data['enable_icons']) ? true : false, + 'S_DISPLAY_SUBFORUM_LIST' => ($forum_data['display_subforum_list']) ? true : false, 'S_DISPLAY_ON_INDEX' => ($forum_data['display_on_index']) ? true : false, 'S_PRUNE_ENABLE' => ($forum_data['enable_prune']) ? true : false, 'S_FORUM_LINK_TRACK' => ($forum_data['forum_flags'] & FORUM_FLAG_LINK_TRACK) ? true : false, diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 88b07305a2..b0cdd26eef 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -400,6 +400,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'S_IS_LINK' => ($row['forum_type'] == FORUM_LINK) ? true : false, 'S_UNREAD_FORUM' => $forum_unread, 'S_LOCKED_FORUM' => ($row['forum_status'] == ITEM_LOCKED) ? true : false, + 'S_LIST_SUBFORUMS' => ($row['display_subforum_list']) ? true : false, 'S_SUBFORUMS' => (sizeof($subforums_list)) ? true : false, 'FORUM_ID' => $row['forum_id'], diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 990591e8a4..a4d6c46695 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -10,7 +10,7 @@ $updates_to_version = '3.0.0'; -// Return if we "just include it" to find out for which version the database update is responsuble for +// Return if we "just include it" to find out for which version the database update is responsible for if (defined('IN_PHPBB') && defined('IN_INSTALL')) { return; @@ -473,6 +473,15 @@ $database_update_info = array( ), ), ), + // Changes from 3.0.0 to the next version + '3.0.0' => array( + // Add the following columns + 'add_columns' => array( + FORUMS_TABLE => array( + 'display_subforum_list' => array('BOOL', 1), + ), + ), + ), ); // Determine mapping database type diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index 686c59184b..3e0d981ed0 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -362,6 +362,7 @@ CREATE TABLE phpbb_forums ( forum_last_poster_name VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, forum_last_poster_colour VARCHAR(6) CHARACTER SET NONE DEFAULT '' NOT NULL, forum_flags INTEGER DEFAULT 32 NOT NULL, + display_subforum_list INTEGER DEFAULT 1 NOT NULL, display_on_index INTEGER DEFAULT 1 NOT NULL, enable_indexing INTEGER DEFAULT 1 NOT NULL, enable_icons INTEGER DEFAULT 1 NOT NULL, diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 804a970013..63a022bc6e 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -438,6 +438,7 @@ CREATE TABLE [phpbb_forums] ( [forum_last_poster_name] [varchar] (255) DEFAULT ('') NOT NULL , [forum_last_poster_colour] [varchar] (6) DEFAULT ('') NOT NULL , [forum_flags] [int] DEFAULT (32) NOT NULL , + [display_subforum_list] [int] DEFAULT (1) NOT NULL , [display_on_index] [int] DEFAULT (1) NOT NULL , [enable_indexing] [int] DEFAULT (1) NOT NULL , [enable_icons] [int] DEFAULT (1) NOT NULL , diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index 0f20b1030a..ae508f73b7 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -248,6 +248,7 @@ CREATE TABLE phpbb_forums ( forum_last_poster_name blob NOT NULL, forum_last_poster_colour varbinary(6) DEFAULT '' NOT NULL, forum_flags tinyint(4) DEFAULT '32' NOT NULL, + display_subforum_list tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, enable_indexing tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, enable_icons tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index 2d91b0259e..907f25d1c8 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -248,6 +248,7 @@ CREATE TABLE phpbb_forums ( forum_last_poster_name varchar(255) DEFAULT '' NOT NULL, forum_last_poster_colour varchar(6) DEFAULT '' NOT NULL, forum_flags tinyint(4) DEFAULT '32' NOT NULL, + display_subforum_list tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, display_on_index tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, enable_indexing tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, enable_icons tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 275de3d488..621b23690d 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -505,6 +505,7 @@ CREATE TABLE phpbb_forums ( forum_last_poster_name varchar2(765) DEFAULT '' , forum_last_poster_colour varchar2(6) DEFAULT '' , forum_flags number(4) DEFAULT '32' NOT NULL, + display_subforum_list number(1) DEFAULT '1' NOT NULL, display_on_index number(1) DEFAULT '1' NOT NULL, enable_indexing number(1) DEFAULT '1' NOT NULL, enable_icons number(1) DEFAULT '1' NOT NULL, diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index 1f20c17583..249f67a007 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -381,6 +381,7 @@ CREATE TABLE phpbb_forums ( forum_last_poster_name varchar(255) DEFAULT '' NOT NULL, forum_last_poster_colour varchar(6) DEFAULT '' NOT NULL, forum_flags INT2 DEFAULT '32' NOT NULL, + display_subforum_list INT2 DEFAULT '1' NOT NULL CHECK (display_subforum_list >= 0), display_on_index INT2 DEFAULT '1' NOT NULL CHECK (display_on_index >= 0), enable_indexing INT2 DEFAULT '1' NOT NULL CHECK (enable_indexing >= 0), enable_icons INT2 DEFAULT '1' NOT NULL CHECK (enable_icons >= 0), diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index fa5884cc5b..2ac349c3e9 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -241,6 +241,7 @@ CREATE TABLE phpbb_forums ( forum_last_poster_name varchar(255) NOT NULL DEFAULT '', forum_last_poster_colour varchar(6) NOT NULL DEFAULT '', forum_flags tinyint(4) NOT NULL DEFAULT '32', + display_subforum_list INTEGER UNSIGNED NOT NULL DEFAULT '1', display_on_index INTEGER UNSIGNED NOT NULL DEFAULT '1', enable_indexing INTEGER UNSIGNED NOT NULL DEFAULT '1', enable_icons INTEGER UNSIGNED NOT NULL DEFAULT '1', diff --git a/phpBB/language/en/acp/forums.php b/phpBB/language/en/acp/forums.php index 72c92a6740..84f280c779 100644 --- a/phpBB/language/en/acp/forums.php +++ b/phpBB/language/en/acp/forums.php @@ -114,10 +114,12 @@ $lang = array_merge($lang, array( 'GENERAL_FORUM_SETTINGS' => 'General forum settings', - 'LINK' => 'Link', - 'LIST_INDEX' => 'List subforum in parent-forum’s legend', - 'LIST_INDEX_EXPLAIN' => 'Displays this forum on the index and elsewhere as a link within the legend of its parent-forum.', - 'LOCKED' => 'Locked', + 'LINK' => 'Link', + 'LIST_INDEX' => 'List subforum in parent-forum’s legend', + 'LIST_INDEX_EXPLAIN' => 'Displays this forum on the index and elsewhere as a link within the legend of its parent-forum if the parent-forum’s “List subforums in legend” option is enabled.', + 'LIST_SUBFORUMS' => 'List subforums in legend', + 'LIST_SUBFORUMS_EXPLAIN' => 'Displays this forum’s subforums on the index and elsewhere as a link within the legend if their “List subforum in parent-forum’s legend” option is enabled.', + 'LOCKED' => 'Locked', 'MOVE_POSTS_NO_POSTABLE_FORUM' => 'The forum you selected for moving the posts to is not postable. Please select a postable forum.', 'MOVE_POSTS_TO' => 'Move posts to', diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html index 76e86ae1c2..29b75240c1 100644 --- a/phpBB/styles/prosilver/template/forumlist_body.html +++ b/phpBB/styles/prosilver/template/forumlist_body.html @@ -33,7 +33,7 @@
      {forumrow.L_MODERATOR_STR}: {forumrow.MODERATORS} -
      {forumrow.L_SUBFORUM_STR} {forumrow.SUBFORUMS} +
      {forumrow.L_SUBFORUM_STR} {forumrow.SUBFORUMS}
      {L_REDIRECTS}: {forumrow.CLICKS}
      diff --git a/phpBB/styles/subsilver2/template/forumlist_body.html b/phpBB/styles/subsilver2/template/forumlist_body.html index f850af6a30..70e4ca813f 100644 --- a/phpBB/styles/subsilver2/template/forumlist_body.html +++ b/phpBB/styles/subsilver2/template/forumlist_body.html @@ -49,7 +49,7 @@

      {forumrow.L_MODERATOR_STR}: {forumrow.MODERATORS}

      - +

      {forumrow.L_SUBFORUM_STR} {forumrow.SUBFORUMS}

      From bd31cb634d545edb0cf17e58962004d6830f3537 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Mon, 4 Feb 2008 12:10:25 +0000 Subject: [PATCH 042/102] Minor stuff: #20925, #20815 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8375 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/acp_forums.html | 2 +- phpBB/includes/session.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html index 0a8c9b4c8a..e4662d9280 100644 --- a/phpBB/adm/style/acp_forums.html +++ b/phpBB/adm/style/acp_forums.html @@ -450,7 +450,7 @@ {ICON_MOVE_UP_DISABLED} {ICON_MOVE_DOWN} - + {ICON_MOVE_UP} {ICON_MOVE_DOWN} diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 0a80f32933..affd447787 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -179,6 +179,10 @@ class session } } } + else + { + $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' : ''; From d7c5f502b4e0ef87a1d4a8d9a4fc16c79b3a5dc1 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Wed, 13 Feb 2008 16:28:37 +0000 Subject: [PATCH 043/102] Fixing converter bugs. #21215 #18575 #18435 #16565 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8379 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/constants.php | 2 +- phpBB/includes/functions_convert.php | 2 +- phpBB/includes/functions_user.php | 8 ++++++-- phpBB/install/convertors/convert_phpbb20.php | 6 ++++-- phpBB/install/convertors/functions_phpbb20.php | 2 +- phpBB/install/database_update.php | 10 ++++++++++ 6 files changed, 23 insertions(+), 7 deletions(-) diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index 8257f8a48e..eb4eb77f22 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -173,7 +173,7 @@ define('FIELD_DATE', 6); // Additional constants -define('VOTE_CONVERTED', 9999); +define('VOTE_CONVERTED', 127); // Table names define('ACL_GROUPS_TABLE', $table_prefix . 'acl_groups'); diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index ed35be3db7..477dd787a1 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -1282,7 +1282,7 @@ function restore_config($schema) // Most are... if (is_string($config_value)) { - $config_value = utf8_htmlspecialchars($config_value); + $config_value = truncate_string(utf8_htmlspecialchars($config_value), 255, false); } set_config($config_name, $config_value); diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 8782460ecf..55cf45505e 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -143,7 +143,11 @@ function user_update_name($old_name, $new_name) } /** -* Add User +* Adds an user +* +* @param mixed $user_row An array containing the following keys (and the appropriate values): username, group_id (the group to place the user in), user_email and the user_type(usually 0). Additional entries not overridden by defaults will be forwarded. +* @param string $cp_data custom profile fields, see custom_profile::build_insert_sql_array +* @return: the new user's ID. */ function user_add($user_row, $cp_data = false) { @@ -281,7 +285,7 @@ function user_add($user_row, $cp_data = false) $sql = 'SELECT group_colour FROM ' . GROUPS_TABLE . ' - WHERE group_id = ' . $user_row['group_id']; + WHERE group_id = ' . (int) $user_row['group_id']; $result = $db->sql_query_limit($sql, 1); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index 16b500d8d5..4fe59d5a0a 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -482,14 +482,16 @@ if (!$get_info) array('topic_moved_id', 0, ''), array('topic_type', 'topics.topic_type', 'phpbb_convert_topic_type'), array('topic_first_post_id', 'topics.topic_first_post_id', ''), - + array('topic_last_view_time', 'posts.post_time', ''), 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, ''), array('poll_vote_change', 0, ''), - 'left_join' => 'topics LEFT JOIN vote_desc ON topics.topic_id = vote_desc.topic_id AND topics.topic_vote = 1', + 'left_join' => array ( 'topics LEFT JOIN vote_desc ON topics.topic_id = vote_desc.topic_id AND topics.topic_vote = 1', + 'topics LEFT JOIN posts ON topics.topic_last_post_id = posts.post_id', + ), 'where' => 'topics.topic_moved_id = 0', ), diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index 1f62d80852..c4d421efee 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -455,7 +455,7 @@ function phpbb_get_birthday($birthday = '') { $birthday = (int) $birthday; - if (!$birthday || $birthday == 999999 || $birthday < 0) + if (!$birthday || $birthday == 999999 || ((version_compare(PHP_VERSION, '5.1.0') < 0) && $birthday < 0)) { return ' 0- 0- 0'; } diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index a4d6c46695..899384fb41 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1559,6 +1559,16 @@ if (version_compare($current_version, '3.0.RC5', '<=')) $no_updates = false; } + +if (version_compare($current_version, '3.0.0', '<=')) +{ + $sql = 'UPDATE ' . TOPICS_TABLE . " + SET topic_last_view_time = topic_last_post_time + WHERE topic_last_view_time = 0"; + _sql($sql, $errored, $error_ary); + + // TODO: remove all form token min times +} _write_result($no_updates, $errored, $error_ary); $error_ary = array(); From d1eca64dac0902f0c99ce89e5457caacc1ffb034 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Thu, 14 Feb 2008 12:33:11 +0000 Subject: [PATCH 044/102] #21315 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8380 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/posting.php | 1 + 1 file changed, 1 insertion(+) diff --git a/phpBB/posting.php b/phpBB/posting.php index fc83659e3e..dfe7b348a7 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -512,6 +512,7 @@ if ($save && $user->data['is_registered'] && $auth->acl_get('u_savedrafts') && ( 't' => $topic_id, 'subject' => $subject, 'message' => $message, + 'attachment_data' => $message_parser->attachment_data, ) ); From 143b5a76ad1ebd67bbe54832579c8f5e6f2f3716 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Thu, 14 Feb 2008 12:33:42 +0000 Subject: [PATCH 045/102] Update git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8381 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 328c0b9098..91d255bd78 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -119,6 +119,8 @@
    112. [Fix] Correctly delete unapproved posts without deleting the topic (Bug #15120)
    113. [Fix] Respect signature permissions in posting (Bug #16029)
    114. [Fix] Users allowed to resign only from open and freely open groups (Bug #19355)
    115. +
    116. [Fix] Assign a last viewed date to converted topics (Bug #16565)
    117. +
    118. [Fix] Many minor and/or cosmetic fixes (Including, but not limited to: #21315, #18575, #18435, #21215,)
    119. From 9e55e1738874a0ab352f91a15012b33fe1c3e9f9 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 15 Feb 2008 19:10:02 +0000 Subject: [PATCH 046/102] revamp how we query permissions. This is half-experimental actually, needs a bit of testing. Should fix the bug with low max_join_size values, but may give problems for those on very low memory settings. git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8384 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_permissions.php | 2 +- phpBB/includes/acp/auth.php | 44 +-- phpBB/includes/auth.php | 450 ++++++++++++++----------- phpBB/includes/functions_admin.php | 23 ++ phpBB/install/database_update.php | 2 +- 5 files changed, 295 insertions(+), 226 deletions(-) diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index 1b2b19d4ab..a19a350646 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -48,7 +48,7 @@ class acp_permissions $this->tpl_name = 'permission_trace'; - if ($user_id && isset($auth_admin->option_ids[$permission]) && $auth->acl_get('a_viewauth')) + if ($user_id && isset($auth_admin->acl_options['id'][$permission]) && $auth->acl_get('a_viewauth')) { $this->page_title = sprintf($user->lang['TRACE_PERMISSION'], $user->lang['acl_' . $permission]['lang']); $this->permission_trace($user_id, $forum_id, $permission); diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index 177c42f581..71872ceb6a 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -22,8 +22,6 @@ if (!defined('IN_PHPBB')) */ class auth_admin extends auth { - var $option_ids = array(); - /** * Init auth settings */ @@ -33,7 +31,7 @@ class auth_admin extends auth if (($this->acl_options = $cache->get('_acl_options')) === false) { - $sql = 'SELECT auth_option, is_global, is_local + $sql = 'SELECT auth_option_id, auth_option, is_global, is_local FROM ' . ACL_OPTIONS_TABLE . ' ORDER BY auth_option_id'; $result = $db->sql_query($sql); @@ -51,25 +49,14 @@ class auth_admin extends auth { $this->acl_options['local'][$row['auth_option']] = $local++; } + + $this->acl_options['id'][$row['auth_option']] = (int) $row['auth_option_id']; + $this->acl_options['option'][(int) $row['auth_option_id']] = $row['auth_option']; } $db->sql_freeresult($result); $cache->put('_acl_options', $this->acl_options); } - - if (!sizeof($this->option_ids)) - { - $sql = 'SELECT auth_option_id, auth_option - FROM ' . ACL_OPTIONS_TABLE; - $result = $db->sql_query($sql); - - $this->option_ids = array(); - while ($row = $db->sql_fetchrow($result)) - { - $this->option_ids[$row['auth_option']] = $row['auth_option_id']; - } - $db->sql_freeresult($result); - } } /** @@ -779,7 +766,7 @@ class auth_admin extends auth $this->acl_clear_prefetch(); // Because we just changed the options and also purged the options cache, we instantly update/regenerate it for later calls to succeed. - $this->option_ids = $this->acl_options = array(); + $this->acl_options = array(); $this->auth_admin(); return true; @@ -817,7 +804,7 @@ class auth_admin extends auth $flag = substr($flag, 0, strpos($flag, '_') + 1); // This ID (the any-flag) is set if one or more permissions are true... - $any_option_id = (int) $this->option_ids[$flag]; + $any_option_id = (int) $this->acl_options['id'][$flag]; // Remove any-flag from auth ary if (isset($auth[$flag])) @@ -829,7 +816,7 @@ class auth_admin extends auth $auth_option_ids = array((int)$any_option_id); foreach ($auth as $auth_option => $auth_setting) { - $auth_option_ids[] = (int) $this->option_ids[$auth_option]; + $auth_option_ids[] = (int) $this->acl_options['id'][$auth_option]; } $sql = "DELETE FROM $table @@ -892,7 +879,7 @@ class auth_admin extends auth { foreach ($auth as $auth_option => $setting) { - $auth_option_id = (int) $this->option_ids[$auth_option]; + $auth_option_id = (int) $this->acl_options['id'][$auth_option]; if ($setting != ACL_NO) { @@ -948,7 +935,7 @@ class auth_admin extends auth $sql_ary = array(); foreach ($auth as $auth_option => $setting) { - $auth_option_id = (int) $this->option_ids[$auth_option]; + $auth_option_id = (int) $this->acl_options['id'][$auth_option]; if ($setting != ACL_NO) { @@ -965,7 +952,7 @@ class auth_admin extends auth { $sql_ary[] = array( 'role_id' => (int) $role_id, - 'auth_option_id' => (int) $this->option_ids[$flag], + 'auth_option_id' => (int) $this->acl_options['id'][$flag], 'auth_setting' => ACL_NEVER ); } @@ -1242,13 +1229,8 @@ class auth_admin extends auth return false; } - $hold_ary = $this->acl_raw_data($from_user_id, false, false); + $hold_ary = $this->acl_raw_data_single_user($from_user_id); - if (isset($hold_ary[$from_user_id])) - { - $hold_ary = $hold_ary[$from_user_id]; - } - // Key 0 in $hold_ary are global options, all others are forum_ids // We disallow copying admin permissions @@ -1256,12 +1238,12 @@ class auth_admin extends auth { if (strpos($opt, 'a_') === 0) { - $hold_ary[0][$opt] = ACL_NEVER; + $hold_ary[0][$this->acl_options['id'][$opt]] = ACL_NEVER; } } // Force a_switchperm to be allowed - $hold_ary[0]['a_switchperm'] = ACL_YES; + $hold_ary[0][$this->acl_options['id']['a_switchperm']] = ACL_YES; $user_permissions = $this->build_bitstring($hold_ary); diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index c965149018..03f2a92ef8 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -39,7 +39,7 @@ class auth if (($this->acl_options = $cache->get('_acl_options')) === false) { - $sql = 'SELECT auth_option, is_global, is_local + $sql = 'SELECT auth_option_id, auth_option, is_global, is_local FROM ' . ACL_OPTIONS_TABLE . ' ORDER BY auth_option_id'; $result = $db->sql_query($sql); @@ -57,6 +57,9 @@ class auth { $this->acl_options['local'][$row['auth_option']] = $local++; } + + $this->acl_options['id'][$row['auth_option']] = (int) $row['auth_option_id']; + $this->acl_options['option'][(int) $row['auth_option_id']] = $row['auth_option']; } $db->sql_freeresult($result); @@ -302,7 +305,14 @@ class auth */ function acl_get_list($user_id = false, $opts = false, $forum_id = false) { - $hold_ary = $this->acl_raw_data($user_id, $opts, $forum_id); + if ($user_id !== false && !is_array($user_id) && $opts === false && $forum_id === false) + { + $hold_ary = array($user_id => $this->acl_raw_data_single_user($user_id)); + } + else + { + $hold_ary = $this->acl_raw_data($user_id, $opts, $forum_id); + } $auth_ary = array(); foreach ($hold_ary as $user_id => $forum_ary) @@ -332,12 +342,7 @@ class auth // Empty user_permissions $userdata['user_permissions'] = ''; - $hold_ary = $this->acl_raw_data($userdata['user_id'], false, false); - - if (isset($hold_ary[$userdata['user_id']])) - { - $hold_ary = $hold_ary[$userdata['user_id']]; - } + $hold_ary = $this->acl_raw_data_single_user($userdata['user_id']); // Key 0 in $hold_ary are global options, all others are forum_ids @@ -348,42 +353,11 @@ class auth { if (strpos($opt, 'a_') === 0) { - $hold_ary[0][$opt] = ACL_YES; + $hold_ary[0][$this->acl_options['id'][$opt]] = ACL_YES; } } } - // Sometimes, it can happen $hold_ary holding forums which do not exist. - // Since this function is not called that often (we are caching the data) we check for this inconsistency. - $sql = 'SELECT forum_id - FROM ' . FORUMS_TABLE . ' - WHERE ' . $db->sql_in_set('forum_id', array_keys($hold_ary), false, true); - $result = $db->sql_query($sql); - - $forum_ids = (isset($hold_ary[0])) ? array(0) : array(); - while ($row = $db->sql_fetchrow($result)) - { - $forum_ids[] = $row['forum_id']; - } - $db->sql_freeresult($result); - - // Now determine forums which do not exist and remove the unneeded information (for modding purposes it is clearly the wrong place. ;)) - $missing_forums = array_diff(array_keys($hold_ary), $forum_ids); - - if (sizeof($missing_forums)) - { - foreach ($missing_forums as $forum_id) - { - unset($hold_ary[$forum_id]); - } - - $sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . ' WHERE ' . $db->sql_in_set('forum_id', $missing_forums); - $db->sql_query($sql); - - $sql = 'DELETE FROM ' . ACL_USERS_TABLE . ' WHERE ' . $db->sql_in_set('forum_id', $missing_forums); - $db->sql_query($sql); - } - $hold_str = $this->build_bitstring($hold_ary); if ($hold_str) @@ -420,15 +394,15 @@ class auth $bitstring = array(); foreach ($this->acl_options[$ary_key] as $opt => $id) { - if (isset($auth_ary[$opt])) + if (isset($auth_ary[$this->acl_options['id'][$opt]])) { - $bitstring[$id] = $auth_ary[$opt]; + $bitstring[$id] = $auth_ary[$this->acl_options['id'][$opt]]; $option_key = substr($opt, 0, strpos($opt, '_') + 1); // If one option is allowed, the global permission for this option has to be allowed too // example: if the user has the a_ permission this means he has one or more a_* permissions - if ($auth_ary[$opt] == ACL_YES && (!isset($bitstring[$this->acl_options[$ary_key][$option_key]]) || $bitstring[$this->acl_options[$ary_key][$option_key]] == ACL_NEVER)) + if ($auth_ary[$this->acl_options['id'][$opt]] == ACL_YES && (!isset($bitstring[$this->acl_options[$ary_key][$option_key]]) || $bitstring[$this->acl_options[$ary_key][$option_key]] == ACL_NEVER)) { $bitstring[$this->acl_options[$ary_key][$option_key]] = ACL_YES; } @@ -466,8 +440,26 @@ class auth */ function acl_clear_prefetch($user_id = false) { - global $db; + global $db, $cache; + // Rebuild options cache + $cache->destroy('_role_cache'); + + $sql = 'SELECT * + FROM ' . ACL_ROLES_DATA_TABLE . ' + ORDER BY role_id ASC'; + $result = $db->sql_query($sql); + + $this->role_cache = array(); + while ($row = $db->sql_fetchrow($result)) + { + $this->role_cache[$row['role_id']][$row['auth_option_id']] = (bool) $row['auth_setting']; + } + $db->sql_freeresult($result); + + $cache->put('_role_cache', $this->role_cache); + + // Now empty user permissions $where_sql = ''; if ($user_id !== false) @@ -528,103 +520,35 @@ class auth $sql_user = ($user_id !== false) ? ((!is_array($user_id)) ? 'user_id = ' . (int) $user_id : $db->sql_in_set('user_id', array_map('intval', $user_id))) : ''; $sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? 'AND a.forum_id = ' . (int) $forum_id : 'AND ' . $db->sql_in_set('a.forum_id', array_map('intval', $forum_id))) : ''; - $sql_opts = ''; + $sql_opts = $sql_opts_select = $sql_opts_from = ''; + $hold_ary = array(); if ($opts !== false) { + $sql_opts_select = ', ao.auth_option'; + $sql_opts_from = ', ' . ACL_OPTIONS_TABLE . ' ao'; $this->build_auth_option_statement('ao.auth_option', $opts, $sql_opts); } - $hold_ary = array(); + $sql_ary = array(); - // First grab user settings ... each user has only one setting for each - // option ... so we shouldn't need any ACL_NEVER checks ... he says ... - // Grab assigned roles... - $sql = $db->sql_build_query('SELECT', array( - 'SELECT' => 'ao.auth_option, a.auth_role_id, r.auth_setting as role_auth_setting, a.user_id, a.forum_id, a.auth_setting', - - 'FROM' => array( - ACL_OPTIONS_TABLE => 'ao', - ACL_USERS_TABLE => 'a' - ), - - 'LEFT_JOIN' => array( - array( - 'FROM' => array(ACL_ROLES_DATA_TABLE => 'r'), - 'ON' => 'a.auth_role_id = r.role_id' - ) - ), - - 'WHERE' => '(ao.auth_option_id = a.auth_option_id OR ao.auth_option_id = r.auth_option_id) - ' . (($sql_user) ? 'AND a.' . $sql_user : '') . " + // Grab non-role settings - user-specific + $sql_ary[] = 'SELECT a.user_id, a.forum_id, a.auth_setting, a.auth_option_id' . $sql_opts_select . ' + FROM ' . ACL_USERS_TABLE . ' a' . $sql_opts_from . ' + WHERE a.auth_role_id = 0 ' . + (($sql_opts_from) ? 'AND a.auth_option_id = ao.auth_option_id ' : '') . + (($sql_user) ? 'AND a.' . $sql_user : '') . " $sql_forum - $sql_opts", - )); - $result = $db->sql_query($sql); + $sql_opts"; - while ($row = $db->sql_fetchrow($result)) - { - $setting = ($row['auth_role_id']) ? $row['role_auth_setting'] : $row['auth_setting']; - $hold_ary[$row['user_id']][$row['forum_id']][$row['auth_option']] = $setting; - } - $db->sql_freeresult($result); - - // Now grab group settings ... ACL_NEVER overrides ACL_YES so act appropriatley - $sql_ary[] = $db->sql_build_query('SELECT', array( - 'SELECT' => 'ug.user_id, ao.auth_option, a.forum_id, a.auth_setting, a.auth_role_id, r.auth_setting as role_auth_setting', - - 'FROM' => array( - USER_GROUP_TABLE => 'ug', - ACL_OPTIONS_TABLE => 'ao', - ACL_GROUPS_TABLE => 'a' - ), - - 'LEFT_JOIN' => array( - array( - 'FROM' => array(ACL_ROLES_DATA_TABLE => 'r'), - 'ON' => 'a.auth_role_id = r.role_id' - ) - ), - - 'WHERE' => 'ao.auth_option_id = a.auth_option_id - AND a.group_id = ug.group_id - AND ug.user_pending = 0 - ' . (($sql_user) ? 'AND ug.' . $sql_user : '') . " + // Now the role settings - user-specific + $sql_ary[] = 'SELECT a.user_id, a.forum_id, r.auth_option_id, r.auth_setting, r.auth_option_id' . $sql_opts_select . ' + FROM ' . ACL_USERS_TABLE . ' a, ' . ACL_ROLES_DATA_TABLE . ' r' . $sql_opts_from . ' + WHERE a.auth_role_id = r.role_id ' . + (($sql_opts_from) ? 'AND r.auth_option_id = ao.auth_option_id ' : '') . + (($sql_user) ? 'AND a.' . $sql_user : '') . " $sql_forum - $sql_opts" - )); - - $sql_ary[] = $db->sql_build_query('SELECT', array( - 'SELECT' => 'ug.user_id, a.forum_id, a.auth_setting, a.auth_role_id, r.auth_setting as role_auth_setting, ao.auth_option' , - - 'FROM' => array( - ACL_OPTIONS_TABLE => 'ao' - - ), - - 'LEFT_JOIN' => array( - - array( - 'FROM' => array(ACL_ROLES_DATA_TABLE => 'r'), - 'ON' => 'r.auth_option_id = ao.auth_option_id' - ), - array( - 'FROM' => array(ACL_GROUPS_TABLE => 'a'), - 'ON' => 'a.auth_role_id = r.role_id' - ), - array( - 'FROM' => array(USER_GROUP_TABLE => 'ug'), - 'ON' => 'ug.group_id = a.group_id' - ) - - ), - - 'WHERE' => 'ug.user_pending = 0 - ' . (($sql_user) ? 'AND ug.' . $sql_user : '') . " - $sql_forum - $sql_opts" - )); - + $sql_opts"; foreach ($sql_ary as $sql) { @@ -632,24 +556,62 @@ class auth while ($row = $db->sql_fetchrow($result)) { - if (!isset($hold_ary[$row['user_id']][$row['forum_id']][$row['auth_option']]) || (isset($hold_ary[$row['user_id']][$row['forum_id']][$row['auth_option']]) && $hold_ary[$row['user_id']][$row['forum_id']][$row['auth_option']] != ACL_NEVER)) + $option = ($sql_opts_select) ? $row['auth_option'] : $this->acl_options['option'][$row['auth_option_id']]; + $hold_ary[$row['user_id']][$row['forum_id']][$option] = $row['auth_setting']; + } + $db->sql_freeresult($result); + } + + $sql_ary = array(); + + // Now grab group settings - non-role specific... + $sql_ary[] = 'SELECT ug.user_id, a.forum_id, a.auth_setting, a.auth_option_id' . $sql_opts_select . ' + FROM ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug' . $sql_opts_from . ' + WHERE a.auth_role_id = 0 ' . + (($sql_opts_from) ? 'AND a.auth_option_id = ao.auth_option_id ' : '') . ' + AND a.group_id = ug.group_id + AND ug.user_pending = 0 + ' . (($sql_user) ? 'AND ug.' . $sql_user : '') . " + $sql_forum + $sql_opts"; + + // Now grab group settings - role specific... + $sql_ary[] = 'SELECT ug.user_id, a.forum_id, r.auth_setting, r.auth_option_id' . $sql_opts_select . ' + FROM ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug, ' . ACL_ROLES_DATA_TABLE . ' r' . $sql_opts_from . ' + WHERE a.auth_role_id = r.role_id ' . + (($sql_opts_from) ? 'AND r.auth_option_id = ao.auth_option_id ' : '') . ' + AND a.group_id = ug.group_id + AND ug.user_pending = 0 + ' . (($sql_user) ? 'AND ug.' . $sql_user : '') . " + $sql_forum + $sql_opts"; + + foreach ($sql_ary as $sql) + { + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $option = ($sql_opts_select) ? $row['auth_option'] : $this->acl_options['option'][$row['auth_option_id']]; + + if (!isset($hold_ary[$row['user_id']][$row['forum_id']][$option]) || (isset($hold_ary[$row['user_id']][$row['forum_id']][$option]) && $hold_ary[$row['user_id']][$row['forum_id']][$option] != ACL_NEVER)) { - $setting = ($row['auth_role_id']) ? $row['role_auth_setting'] : $row['auth_setting']; - $hold_ary[$row['user_id']][$row['forum_id']][$row['auth_option']] = $setting; - - // Check for existence of ACL_YES if an option got set to ACL_NEVER - if ($setting == ACL_NEVER) + $hold_ary[$row['user_id']][$row['forum_id']][$option] = $row['auth_setting']; + + // If we detect ACL_NEVER, we will unset the flag option (within building the bitstring it is correctly set again) + if ($row['auth_setting'] == ACL_NEVER) { - $flag = substr($row['auth_option'], 0, strpos($row['auth_option'], '_') + 1); + $flag = substr($option, 0, strpos($option, '_') + 1); if (isset($hold_ary[$row['user_id']][$row['forum_id']][$flag]) && $hold_ary[$row['user_id']][$row['forum_id']][$flag] == ACL_YES) { unset($hold_ary[$row['user_id']][$row['forum_id']][$flag]); - - if (in_array(ACL_YES, $hold_ary[$row['user_id']][$row['forum_id']])) + +/* if (in_array(ACL_YES, $hold_ary[$row['user_id']][$row['forum_id']])) { $hold_ary[$row['user_id']][$row['forum_id']][$flag] = ACL_YES; } +*/ } } } @@ -671,45 +633,43 @@ class auth $sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? 'AND a.forum_id = ' . (int) $forum_id : 'AND ' . $db->sql_in_set('a.forum_id', array_map('intval', $forum_id))) : ''; $sql_opts = ''; + $hold_ary = $sql_ary = array(); if ($opts !== false) { $this->build_auth_option_statement('ao.auth_option', $opts, $sql_opts); } - $hold_ary = array(); - - // Grab user settings... - $sql = $db->sql_build_query('SELECT', array( - 'SELECT' => 'ao.auth_option, a.auth_role_id, r.auth_setting as role_auth_setting, a.user_id, a.forum_id, a.auth_setting', - - 'FROM' => array( - ACL_OPTIONS_TABLE => 'ao', - ACL_USERS_TABLE => 'a' - ), - - 'LEFT_JOIN' => array( - array( - 'FROM' => array(ACL_ROLES_DATA_TABLE => 'r'), - 'ON' => 'a.auth_role_id = r.role_id' - ), - ), - - 'WHERE' => '(ao.auth_option_id = a.auth_option_id OR ao.auth_option_id = r.auth_option_id) - ' . (($sql_user) ? 'AND a.' . $sql_user : '') . " + // Grab user settings - non-role specific... + $sql_ary[] = 'SELECT a.user_id, a.forum_id, a.auth_setting, a.auth_option_id, ao.auth_option + FROM ' . ACL_USERS_TABLE . ' a, ' . ACL_OPTIONS_TABLE . ' ao + WHERE a.auth_role_id = 0 + AND a.auth_option_id = ao.auth_option_id ' . + (($sql_user) ? 'AND a.' . $sql_user : '') . " $sql_forum - $sql_opts", + $sql_opts + ORDER BY a.forum_id, ao.auth_option"; - 'ORDER_BY' => 'a.forum_id, ao.auth_option' - )); - $result = $db->sql_query($sql); + // Now the role settings - user-specific + $sql_ary[] = 'SELECT a.user_id, a.forum_id, r.auth_option_id, r.auth_setting, r.auth_option_id, ao.auth_option + FROM ' . ACL_USERS_TABLE . ' a, ' . ACL_ROLES_DATA_TABLE . ' r, ' . ACL_OPTIONS_TABLE . ' ao + WHERE a.auth_role_id = r.role_id + AND r.auth_option_id = ao.auth_option_id ' . + (($sql_user) ? 'AND a.' . $sql_user : '') . " + $sql_forum + $sql_opts + ORDER BY a.forum_id, ao.auth_option"; - while ($row = $db->sql_fetchrow($result)) + foreach ($sql_ary as $sql) { - $setting = ($row['auth_role_id']) ? $row['role_auth_setting'] : $row['auth_setting']; - $hold_ary[$row['user_id']][$row['forum_id']][$row['auth_option']] = $setting; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $hold_ary[$row['user_id']][$row['forum_id']][$row['auth_option']] = $row['auth_setting']; + } + $db->sql_freeresult($result); } - $db->sql_freeresult($result); return $hold_ary; } @@ -725,49 +685,153 @@ class auth $sql_forum = ($forum_id !== false) ? ((!is_array($forum_id)) ? 'AND a.forum_id = ' . (int) $forum_id : 'AND ' . $db->sql_in_set('a.forum_id', array_map('intval', $forum_id))) : ''; $sql_opts = ''; + $hold_ary = $sql_ary = array(); if ($opts !== false) { $this->build_auth_option_statement('ao.auth_option', $opts, $sql_opts); } + // Grab group settings - non-role specific... + $sql_ary[] = 'SELECT a.group_id, a.forum_id, a.auth_setting, a.auth_option_id, ao.auth_option + FROM ' . ACL_GROUPS_TABLE . ' a, ' . ACL_OPTIONS_TABLE . ' ao + WHERE a.auth_role_id = 0 + AND a.auth_option_id = ao.auth_option_id ' . + (($sql_group) ? 'AND a.' . $sql_group : '') . " + $sql_forum + $sql_opts + ORDER BY a.forum_id, ao.auth_option"; + + // Now grab group settings - role specific... + $sql_ary[] = 'SELECT a.group_id, a.forum_id, r.auth_setting, r.auth_option_id, ao.auth_option + FROM ' . ACL_GROUPS_TABLE . ' a, ' . ACL_ROLES_DATA_TABLE . ' r, ' . ACL_OPTIONS_TABLE . ' ao + WHERE a.auth_role_id = r.role_id + AND r.auth_option_id = ao.auth_option_id ' . + (($sql_group) ? 'AND a.' . $sql_group : '') . " + $sql_forum + $sql_opts + ORDER BY a.forum_id, ao.auth_option"; + + foreach ($sql_ary as $sql) + { + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $hold_ary[$row['group_id']][$row['forum_id']][$row['auth_option']] = $row['auth_setting']; + } + $db->sql_freeresult($result); + } + + return $hold_ary; + } + + /** + * Get raw acl data based on user for caching user_permissions + * This function returns the same data as acl_raw_data(), but without the user id as the first key within the array. + */ + function acl_raw_data_single_user($user_id) + { + global $db, $cache; + + // Check if the role-cache is there + if (($this->role_cache = $cache->get('_role_cache')) === false) + { + $this->role_cache = array(); + + // We pre-fetch roles + $sql = 'SELECT * + FROM ' . ACL_ROLES_DATA_TABLE . ' + ORDER BY role_id ASC'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $this->role_cache[$row['role_id']][$row['auth_option_id']] = (bool) $row['auth_setting']; + } + $db->sql_freeresult($result); + + $cache->put('_role_cache', $this->role_cache); + } + $hold_ary = array(); - // Grab group settings... - $sql = $db->sql_build_query('SELECT', array( - 'SELECT' => 'a.group_id, ao.auth_option, a.forum_id, a.auth_setting, a.auth_role_id, r.auth_setting as role_auth_setting', - - 'FROM' => array( - ACL_OPTIONS_TABLE => 'ao', - ACL_GROUPS_TABLE => 'a' - ), - - 'LEFT_JOIN' => array( - array( - 'FROM' => array(ACL_ROLES_DATA_TABLE => 'r'), - 'ON' => 'a.auth_role_id = r.role_id' - ), - ), - - 'WHERE' => '(ao.auth_option_id = a.auth_option_id OR ao.auth_option_id = r.auth_option_id) - ' . (($sql_group) ? 'AND a.' . $sql_group : '') . " - $sql_forum - $sql_opts", - - 'ORDER_BY' => 'a.forum_id, ao.auth_option' - )); + // Grab user-specific permission settings + $sql = 'SELECT forum_id, auth_option_id, auth_role_id, auth_setting + FROM ' . ACL_USERS_TABLE . ' + WHERE user_id = ' . $user_id; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { - $setting = ($row['auth_role_id']) ? $row['role_auth_setting'] : $row['auth_setting']; - $hold_ary[$row['group_id']][$row['forum_id']][$row['auth_option']] = $setting; + // If a role is assigned, assign all options included within this role. Else, only set this one option. + if ($row['auth_role_id']) + { + $hold_ary[$row['forum_id']] = (empty($hold_ary[$row['forum_id']])) ? $this->role_cache[$row['auth_role_id']] : $hold_ary[$row['forum_id']] + $this->role_cache[$row['auth_role_id']]; + } + else + { + $hold_ary[$row['forum_id']][$row['auth_option_id']] = $row['auth_setting']; + } + } + $db->sql_freeresult($result); + + // Now grab group-specific permission settings + $sql = 'SELECT a.forum_id, a.auth_option_id, a.auth_role_id, a.auth_setting + FROM ' . ACL_GROUPS_TABLE . ' a, ' . USER_GROUP_TABLE . ' ug + WHERE a.group_id = ug.group_id + AND ug.user_pending = 0 + AND ug.user_id = ' . $user_id; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if (!$row['auth_role_id']) + { + $this->_set_group_hold_ary($hold_ary[$row['forum_id']], $row['auth_option_id'], $row['auth_setting']); + } + else + { + foreach ($this->role_cache[$row['auth_role_id']] as $option_id => $setting) + { + $this->_set_group_hold_ary($hold_ary[$row['forum_id']], $option_id, $setting); + } + } } $db->sql_freeresult($result); return $hold_ary; } + /** + * Private function snippet for setting a specific piece of the hold_ary + */ + function _set_group_hold_ary(&$hold_ary, $option_id, $setting) + { + if (!isset($hold_ary[$option_id]) || (isset($hold_ary[$option_id]) && $hold_ary[$option_id] != ACL_NEVER)) + { + $hold_ary[$option_id] = $setting; + + // If we detect ACL_NEVER, we will unset the flag option (within building the bitstring it is correctly set again) + if ($setting == ACL_NEVER) + { + $flag = substr($this->acl_options['option'][$option_id], 0, strpos($this->acl_options['option'][$option_id], '_') + 1); + $flag = (int) $this->acl_options['id'][$flag]; + + if (isset($hold_ary[$flag]) && $hold_ary[$flag] == ACL_YES) + { + unset($hold_ary[$flag]); + +/* This is uncommented, because i suspect this being slightly wrong due to mixed permission classes being possible + if (in_array(ACL_YES, $hold_ary)) + { + $hold_ary[$flag] = ACL_YES; + }*/ + } + } + } + } + /** * Authentication plug-ins is largely down to Sergey Kanareykin, our thanks to him. */ diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 268eccbca4..7fd21948d0 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2998,6 +2998,29 @@ function tidy_database() { global $db; + // Here we check permission consistency + + // Sometimes, it can happen permission tables having forums listed which do not exist + $sql = 'SELECT forum_id + FROM ' . FORUMS_TABLE; + $result = $db->sql_query($sql); + + $forum_ids = array(0); + while ($row = $db->sql_fetchrow($result)) + { + $forum_ids[] = $row['forum_id']; + } + $db->sql_freeresult($result); + + // Delete those rows from the acl tables not having listed the forums above + $sql = 'DELETE FROM ' . ACL_GROUPS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_ids, true); + $db->sql_query($sql); + + $sql = 'DELETE FROM ' . ACL_USERS_TABLE . ' + WHERE ' . $db->sql_in_set('forum_id', $forum_ids, true); + $db->sql_query($sql); + set_config('database_last_gc', time(), true); } diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 899384fb41..7eeca7dbb8 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -8,7 +8,7 @@ * */ -$updates_to_version = '3.0.0'; +$updates_to_version = '3.0.1-dev'; // Return if we "just include it" to find out for which version the database update is responsible for if (defined('IN_PHPBB') && defined('IN_INSTALL')) From 435c1311276e4c7208f7be8704fa79a63bf54459 Mon Sep 17 00:00:00 2001 From: Vic D'Elfant Date: Thu, 21 Feb 2008 13:13:49 +0000 Subject: [PATCH 047/102] - New set of smilies (they're all face-shaped now), provided by camm15h. Send all your love his way! ;) - Set svn:ignore on cache/*.php git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8385 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/images/smilies/icon_arrow.gif | Bin 170 -> 407 bytes phpBB/images/smilies/icon_cool.gif | Bin 172 -> 408 bytes phpBB/images/smilies/icon_cry.gif | Bin 498 -> 1664 bytes phpBB/images/smilies/icon_e_biggrin.gif | Bin 413 -> 627 bytes phpBB/images/smilies/icon_e_confused.gif | Bin 410 -> 628 bytes phpBB/images/smilies/icon_e_geek.gif | Bin 410 -> 623 bytes phpBB/images/smilies/icon_e_sad.gif | Bin 420 -> 628 bytes phpBB/images/smilies/icon_e_smile.gif | Bin 416 -> 630 bytes phpBB/images/smilies/icon_e_surprised.gif | Bin 427 -> 415 bytes phpBB/images/smilies/icon_e_ugeek.gif | Bin 422 -> 631 bytes phpBB/images/smilies/icon_e_wink.gif | Bin 413 -> 630 bytes phpBB/images/smilies/icon_eek.gif | Bin 170 -> 619 bytes phpBB/images/smilies/icon_evil.gif | Bin 236 -> 648 bytes phpBB/images/smilies/icon_exclaim.gif | Bin 236 -> 632 bytes phpBB/images/smilies/icon_idea.gif | Bin 176 -> 411 bytes phpBB/images/smilies/icon_lol.gif | Bin 336 -> 707 bytes phpBB/images/smilies/icon_mad.gif | Bin 174 -> 646 bytes phpBB/images/smilies/icon_mrgreen.gif | Bin 349 -> 608 bytes phpBB/images/smilies/icon_neutral.gif | Bin 171 -> 621 bytes phpBB/images/smilies/icon_question.gif | Bin 248 -> 643 bytes phpBB/images/smilies/icon_razz.gif | Bin 176 -> 645 bytes phpBB/images/smilies/icon_redface.gif | Bin 650 -> 2990 bytes phpBB/images/smilies/icon_rolleyes.gif | Bin 485 -> 1153 bytes phpBB/images/smilies/icon_twisted.gif | Bin 238 -> 636 bytes 24 files changed, 0 insertions(+), 0 deletions(-) diff --git a/phpBB/images/smilies/icon_arrow.gif b/phpBB/images/smilies/icon_arrow.gif index 2880055cc0f11c60f5688ade044df280856df9a7..c0f9117b965bfeb13af1146a9abc75d255da81a7 100644 GIT binary patch literal 407 zcmZ?wbhEHb@VHs2|J%y<@07s5oqYd}3jBX7 z{qK_SzrFnb*6{v2#2@NyeEr(xS1(`uc_{J!iNyQ&?`9Q9|GO#r?~Yh)QQXgWO37iy zg~?X4XY^*qSO>c3y`IhA5UbYFkTJ>pg<+_X_1Dy6xJrDcVCPKEx_H+~M1| zZ(S|L*Nz#y-5@x1Ld}6jp&8B2?^X#Msuy~8#j-TR_3c&Jn=^ze^CDmD7yJMJKgiKA zp!k!8k%7UQK?fuN@{Wn|6}x005%mKGKfX%>+P;^pP!lvh&Wn#o@h zR9>azB*bP>R>7*uCKM?sW7?2zuA(jIBr4F*$Sjh@p~fbvCEU!N9>l}N&#NylBQ7x^ zB&e80Q$US_<6Qx$`u)h_V@%EUi@7A1S1*XsBwUsI|(;k--`O$FrBw literal 170 zcmZ?wbhEHbtSLu;wYQ>TAs=jBP*FkflM?zCbCrVb+sjSbO~t9>%IUtM${ Pu}&Z@V%kj=CI)K&O7cC% diff --git a/phpBB/images/smilies/icon_cool.gif b/phpBB/images/smilies/icon_cool.gif index cead0306c0e38e57bdb0cc85a407b995dcbdc656..6dd150375ddfa9728f62d5993212eb3a633127bc 100644 GIT binary patch literal 408 zcmV;J0cZY4Nk%w1VGjTi0M$GI0002~u@3+89R8#X{-_Q9#Ss7L8AduM{>l*k!VmxL z8~&^f>gniJOEd59?)>2x{?ZfvwGP+T)0%J_{@E3AV>)A2GktPi{<#kRy$|{BBJaHt zZed1gTsu)jF8}}kTSzRmmLvA|_W$G<>zfb$+!oi25rADLh=6XAjCh-vjbm3pUsO7} zxU$)p66n7ciiC4@XhoHfe87Pc*2XaH)gA7t5a!f5n1e&@uo1$45_xV}|Ns9000000 z00000A^8LW002AyEC2ui01p5W06+${K%P(}i*+g;PD&)?H6Rdx6j4Y>0fE4wDQsOh zyB3$1qA3Juh2cR#BnlH4?=rzeuF}C^auKR<8fXFrYZNaQDm)escmO4h7#=7g1(gXA zSqlUNdniH-2QHeN111LyToM&Gfoe4&D-uEu4S|9NBW(y92M#O`gbHdSB@k5^IUW@h zS04aTQqBP&4I2nl$61*q4H6a@83338ngE<2vJM9}n4@|my<7|{Co?8GCoHH!K>$15 CM465N literal 172 zcmZ?wbhEHb+|z`)C(1LA_rU|@;d;3=6kcSq>7bCTj>1sqIsoCSRx)8`fJ$~w+{ zJX`yX^?~=R4m2(o_)+HS{ItMiUIk0)fwE>-?dDgxjscmQ{AM&TEaGA7z8`VSO88#> SHjRW8(oK@nQq4LU7_0%kd_$xF diff --git a/phpBB/images/smilies/icon_cry.gif b/phpBB/images/smilies/icon_cry.gif index 7d54b1f994bb20c2a17c6e9e53edb39e0444b380..21a5a3c1137e283b5bdab1b936babf0ee44fc669 100644 GIT binary patch literal 1664 zcmd^;Yg1EK7==$r0w)PM=i~%p1mXmg0vXC+C>_LV!#$ulfPls#a*?3cB3kQU3pOEu z$i*^LYS6X=2IZ0fAwWm1+9Zk<3WCVZdMOHZP!P~6H6ht)zz?12U+CUn_pG&^cfC6z zGCW{iDhe^6zuTeFk-I=efBtN0Zf-VVli%>roio|aMVBYRJx6c}Nl)|xJ(ywE&GeX^ zcPRN_dLYoFmKV<8Dw@7ca8_QPl^QPD`Ce?O&)%faFZP7J80J(}aWLixuAo4Tf>s37(?KJ> z_~%KWq%V%M|7v#t8f@+wUVXqB^x)?ED=e=#pc}JHu(c8#TtjCYv9Z%QIA;&^Saw>V z;n7OdLpC^X4}L<7w{TM%nw+qHQH|vu+zI*}%zDiHfOX>A?LdRPX=j@5uK;(L)!)Yg z9ct=kG@Oc1D58xUB}o;famEfTdZVXFheZo`=0T>p4K2DfVZ4Z$tnn0d z(1I9S(Yu5F(`Qi7Og|w#U{WLIF-P4od_n85sAIfUGj>@6oTtY}@xfKhph5flx)&Rm zmTBjan`@`5(b1vq(Yv?I_4K#RsA-&SZbRm-;QhCIzmzyDdWsSVQeh-*VX z$Z=OrDKU?dp33~&Mkn%*LO3*y& z*q|(dPLOGd&H3Egsy`A50&J=xXfE0B7*U(w)g!QjsJKuv-gM~CE>%*-;S{b^d82fv z{}FDsgvarP(#7O_aR{L)*HhdZCF2q3WU4$xdfe8D6*_+VVTDXa^$EaGcp2Sc37rTL zAR2^N(KkV@y-q@PjZPGStXh+S;W`iEX-^k8wD!WsCy@nTdD=OhbE4RNCA)6CcGg7R(2Es=Xd zxHhs@w@^>E*pVdF@PDrk^H8WnnKwHkL&S+L>-N9yeI|W+o#WH~TsSt^v{`?aJba2e z*dq+~Z^^eU%os=rR>9o+uD54(3>E~7cXaakw2>e# zmb7=6y02C#Y9`@^FJtUivPL&TtkAL9RpmA^bD98ftnS6varfA2r%e?3<5cWfi*@! zrOPq0Pa{O{R3VSL)CLZwJI;bVj@ow|9P^f2{b_KV;g#sD#JTIhK{X4eRSZoFOA4&E zE?xGWjgRM;Ia^8kzR>%TOS23r6eRl<`~6;g|7yg@*31^DX`|+%tO&MH1Y{u#11keN z5Hhd|DyTR-@tBu#X^wBxK7*WjP8?uWTo6?pKs7*@va%&Sa#%9C1z8HDof#;_rJ&H~ zFsWx*ry9h3B%L5>ZUqL1B|!6=oIFuX25Dyj%JU{%Vn~@hA!8Mj(`_aU6Ueh0) diff --git a/phpBB/images/smilies/icon_e_biggrin.gif b/phpBB/images/smilies/icon_e_biggrin.gif index 0d5cd010d7668e997fdb0be4a9a240d431b89a54..08be8479b2e4374a63ef1ec7d3a0a72919f5b373 100644 GIT binary patch literal 627 zcmZ?wbhEHb>0g*E_&B{1e3!ZUeD(Lx0Nq1(e2+xzJ^$}%oyu$-@b)7X};epv}?zvXb+vO z)0E#{m0dHxyg6R+?FPXa&CWMx2>n~Z`(nRXUX0SUV+Lzxm2I5wRGAm~ZzXSYy3(O~ zp}Y{qe~0*|PN+H1DD?c{#doU&{w?Ndj#Yhj#q!@8-qH-$=l3smwG?k$>J0H9(2s)? zDE?$&WMJ@S&;dCQ6ekYs7aF{q)a~8X#MG3f)tkJ9c}y86O`dG4!rI%UC9Z6#HPc(# zjDu+s2eZ&5J5do&Z*dVW7KSZbSlC3wn`8|onf5cU;53nt^_CD~XFtf!%frvj&BY}r zqa&)f^_KY#nI=9~BR4B!Ha2-yzL^4IuKSkj>L>^_2@3Dq&&15m$3~Nk%w1VGjTi0M$PL{<{zV@*Mx<7*s+ja&BcrIVRVT5&o+U{>TtkOf&wZ z3}aV7{@fPmzZU+r4(po_{?Zfn_V)ki8UEQ7l8kt9V>nwT>9UfD-S$611K!_u(A-?H};)@7&wiT}Ubb00960 z|N8p+A^8LW002J#EC2ui01p5W000KMz@ISEx_m017$qWXmM*SLz#@U&I;AFOB@Ij^ zr%7YO`RNiluU8^qKoGV9Y38y7dOhk1kI;x_9XJws76bwWZ#@7iFB>NU0upR)eEJ06e`s3LYUsBn2#_JSaTW4{}W-1qKHP3h4#~BTYgh3n?`QH7FhJ?oAjnF)|qW HK>z?d=UbxV diff --git a/phpBB/images/smilies/icon_e_confused.gif b/phpBB/images/smilies/icon_e_confused.gif index ed8327080430360adc47e7f60ab58a247b70f333..be5b583c0c85fe2b3ef10a4cdcb332cbb5ed114c 100644 GIT binary patch literal 628 zcmZ?wbhEHbRuS1(`uTf_VQ{kwmM`2TI?`}0uZ-zDLn@01FYt^V!g`*%v<-%ZilqPYKW zrIW*q<3p@o&*uMkQlKGLE!sn;qaiOZ(QQ&sMRK@9po`xBClY^G^X}TQDKo};_Ke=G z)0F@1<-gt|_Tj>g{@cJ;n&J9xmB5T<=cyBFZq5*TcE$2Qqfl2%@&Et-fj$}%K=CIFBLjmwgAT~G zpg3`0zu4g3WZ-14C8njUV$kHyDnx=?7b6PNG$7{4@EjB_V)JvwhsQn50Z>{abr6Ey$^M0MY_1M{<#kS=o$az82-f& z{?Zfw?Hl>;BV$%GUsO72Tsw$>ZhUfHo0yI2>FDn6?bX!L{NWhxtr3`mL)_cgesf^$ z)g9*4IhBxnZed1wZdtpC71@{)!haHhTqS;9Cs9N$@bK@no-X_CAJ)b&|Nr_+J}CeI z0Q&m+A^8LW002J#EC2ui01p5W000KJz@HHEvV2Fk(#4suN;4>JkY1P>)mLL~||Gz2s?AnWW+7b7q+7xzH` EI}UTG3;+NC diff --git a/phpBB/images/smilies/icon_e_geek.gif b/phpBB/images/smilies/icon_e_geek.gif index c1947cc03bfd3778327558128b56d1ca5f81da4c..535bc9f723e951b4e2b89e8e1a31e0d0344e7f56 100644 GIT binary patch literal 623 zcmZ?wbhEHb6l4%&c;?Ok1phzD?0y^mZwb%t$1=M=M*Q2z_iqKSo0a)_~s0uzsq?m^CD+7JHJ~cu;)!!e2CS*qXKWQ%5I&e z{9?b@?pLy*-p1RWhd;Ywx#yMa=6kZQXY*e>W>A{p`v3obkjI7sQ2fcl$iU#vpaXI& zC{7&M&osCqF6*$-)P@U7rib3D1;+D4hbkJtX>DK6Db!Z8XN3b}W-3$g9DO-fL7;b0J} zNw~e`t?&{>7NazlhUQ>(g}ZV!3XILn`tj^RdsNeoUYnSW>gnk2?(Nmo(bmQ=?wJmGZdtbHSMAjue^dtSz7+8A@0f!_+}qfG zUMGHYV7u=h!haI};1{%>E^c8)=F~avst|KzJ-~qyvfdrpm=b|pCHw6k{=*M5Gcy1H z0Q&m+A^8LW002J#EC2ui01*HY000KJz@P9ZnN%XS$ZR4RIz<&4N3gk^WCM}&_gPH^ zR7{MK8hnN-#SRRKQ4iV_k|MjLi@{NV8p6GA?NggzLBgg-tGFB*=HJ`0iwln{fA zFE2hX0FetmlnIuL0HrAMAbXy=4ImpTc2oxY&LLd<>HwZ8~3hV4c79KMt7VJR) EJGc6-RR910 diff --git a/phpBB/images/smilies/icon_e_sad.gif b/phpBB/images/smilies/icon_e_sad.gif index 57f00ba6019b7498683195900d48cf19a0978e9b..7cd3016a9639eb2638c6216fc12ad2e03dcb1f10 100644 GIT binary patch literal 628 zcmZ?wbhEHbGDYnNZWd@-v)`u+QN|89!@JH-F*lt8Gr@t=nhKi?_+ ze=GfOFaN)te92+PwMB7-$yUkX4ta@gzkdDNwPVxPY08-~*6;TU{eL3y?~-swL*AsG zif`Y({oBgd5UUm+V)c49f3%0rzdK^HXY>ZT=rJ%bc-yI6?-BH|S9^O^wlu@FtEKor zqtKyxp{WyUylgd|U9tRkMBv|2o|`j-UhEgU-Yw{Dr%{;~`F4Zg|CdtlRtfz7C^Mtk z+1pn0+A)J)_ay$E67;s!__u_|%}V|M|6l)KO8z@4aP`W?SP!lLpJe{6;QhCe&)ZJ( z|Ns9$s|O)a{K>+|z~IZE19BTEP8irPHuyHl=xK=whzUu{H1#qH7;t%VyK0IGGWIIl zO!D+}b>(C=;Zycy;h1YZUxJmLUEG;P+KzkPWJ~*XY;Mfj@|><}8fLB%O16&rJQgZ^ zoIdWCe3UL;=2a13^>OhL_L01I$H!Zdxc zl6o{abr4lXhpiXvj626|Lq(8wGR32BL2e< zUsO7qX&C;w4v2tmd~#lzcO9FUjq2&>@9*yZqYV1``Tzg`{NWjxgF|j%Mzo$T?yV7i zUMJa@5`J@F-pw`K+t|T?67Rhd?bRKMgmaaUe6@}kd2U&OTqXbi`dvsWXj?he)X_^m zDf;^QA^8LW002J#EC2ui01p5W000KTz@HFetMDj1)dV7J_9`$<0JEU2IK8GQrQz`c zi-lJK5dBDoZeYE*JO;d(gH(fI*3$)Q@JMVzH5@1lK80-$g+3B23;-xTJ&`_$kv%>c z3>1huJ|;c`oj#lqI|iUSC!7hQsXh@73^NI{8ygZH84&~o4GbSQwGy|v1P8_)A3XrV z9y`v?1<^Y(KOiB^y2S-MB^@t9Bn~VQx(5X%B@J^;BMvUw=mHKSO+q6GEiwW!IUMx$ OO)P*=fx`m8AOJf__pFKl diff --git a/phpBB/images/smilies/icon_e_smile.gif b/phpBB/images/smilies/icon_e_smile.gif index 6bb8d04b72ab226d31e23512669648cadc0419c3..d1ec74c8e0cfe89418abf3ed667b8f4f69af321a 100644 GIT binary patch literal 630 zcmZ?wbhEHbbaRH#+pDtgRtfw*Ayk=&EXW;UbQxvQo4&jX3l3|F9=f$kY9K=CIFBLjmQgAT~Spg3`0 zzue%~q-g1?Evc=qpxERl$~<8LCx;Y|2;&U4-X;|peG8S@ZVGmM>?|yNtg<$o>>NVQ zZZbmLA`ClrFfj?qG^snutzcngb&+wa{=NDtX$ivO8WuR%j^WH8YgC;>X z6M0_V-8yW7vxOxM53MrQR1$6y5Iw}coYm?Nr literal 416 zcmV;R0bl+{Nk%w1VGjTi0M$PLns6Kb(i8s55dNeL|MDDiZe`bu5&z^ERZBDf=^0~J zK>o1~=)V?QNG$7{4@NpC{;Uo5_V)hV7XG;o{@E4&!Vi*+c>c8xabr6F?HhGyMY_1M z{>2dfs15$T5BcsQV^%X?R61!~JBWa8eR5u#n2qY`=H zGy3}aA^8LW002J#EC2ui01p5W000KPz@IQu(}*x4m?a`?qA2CKutOcyc$@0pur(ud<#{tYjDPS2?2ND4s6&@=&ASnk2JUoQ~kscEh zIT#cY5^EFzdpi>s3k?VXsHg&n9;6Ek4+ty*1strS3k47k2qQEcKEcAm0{|l^AQK)w zJgnj3a2vpZ5>-nx{@E4R*3)rgI{wNKeR5v>;TZYuB4buF{;UoD+!p@14pBrd zZed1aS3uW{5nog~{=E;In2ms4CX$SJ_V)IOfNonzEV{U|wU#4kTs!Z*66>1}{=yIc z;?(3lA0mxCaU?xBw~u3m=IAivYaDj6E9? z5RMrT5C#(UDEC`sJbtbb505WoOb}PVI3>_j49x);x JsDuOo06T9-psoM_ literal 427 zcmV;c0aX4+Nk%w1VGjTk0M$PL{<9AL&JvP~dFi(l>+9;`pAi4@98^Usab`-ndlX_< zIGL4-{=yIbsSWYC5&otPK{zJ*?;zyk;ag2FUQ#yx#}NM16w!+j{;dt&+}i%x760iO z{=N_X-4_4t8~(WtYEmr!!1&vheGq84eZn%Wm`dq zer)x~6Xn-9vYIZ<%g0SbFHuD?#KOImbRXBsFxI3Ld2U&KbYH-l7ytkIOFk+8|Nj60 z0Q&m+A^8LW002J#EC2ui01p5Y000Kaz@M-rK#)WVgh0srok*{U!LwPxSQ+LbB{fV# zBh7%a_z@^w?fCQ#safIJ~QfIB<`GJb?UhIl57JRb)l9gBt< zmOKCl6dIVGZWRn4ngBd9E&-|mqN4x+7$`G2Iu*7I3AwNh4GAqYA`HSDJ;fNj4`TB1(yIHCCKWyv2+w%XV3adN`rTkx0I!amXel{p;WWC83Ws-NesLUj5B61^fjx?Im)Te z@n%@Mj6s!4cloj=NnvSj)@95rEW(m~+6LlG`?yvqn@DIkF(`6!oI1te#ltgGWwxFU z?=_)KtbEK{h4uOb*lqa4p0b#-3oI5?a@o7mT}MH%k6&c(J|-@GWm#D#cDV_+43D&Q zifA(IVJLX)-Y@C8MAm!40ufh+^InNen>v}aIpx#lE>h57YU7pPAbR20+AyK2COMe{ hirLY+Ojb;NO$Nk%w1VG{rn0M$PL{<{y4%7L|(BmUSF{;Ca+(t>7LHvY2?{-g}y^WFdQ z9D8+bnr#|IIw#wd5k#GqQ%EvaMlJUC_K)3!{>c%K;f6Vpk#%TAy126c=o$az82RoZ z|Lq(8!4HqvgNT4`K0Z5}n2k$7F5&p!>gnk2?(Nmo(Qjiz?bRLbnGW3B*kV^c?y3-& zgG1=Q7JYMH{@@qz@bAmy<4Hw3=F~Y{P&w)8=arCrl8t+FWIcXfCxKig-tgY=yb=Ha z0Q&m+A^8LW002J#EC2ui022Tb000KVz@Jbkxm^r7!wDxDI)$bSZKL31P=b}|DGar! zifRTna2Y~F-!E1Jhcg;7rPnC^)V{plXNB$cLOwDhgoHjCJ_(8mJQiwq4-*xWlRh2= z1p%6lfsqq=6Q7uQn~ye@9;qHa6h4}-J~2ZOe;oh-e-KU|0v*1$2L}Yh2n-)iCI+_v z!NSA{5h_nF49o|52-yrTTqO-G!OsXObzDC-4Gshm>@?gJ2mn0Ll_`4 QATaRbvH-*ac|iaGJ3}Y7Jpcdz diff --git a/phpBB/images/smilies/icon_e_wink.gif b/phpBB/images/smilies/icon_e_wink.gif index 1957f24eac3eb079076791d68f52a558b4cad76b..fb1c1402d29e233d1e70b9e68bf430dfb9315aaf 100644 GIT binary patch literal 630 zcmZ?wbhEHb+HZzJFTPcr{sO8z@4@NWh0za>2XE(seO8~-~c@NX~wzeD{0 zw(_}IssDc~{r`!?zcsx7cJlqZDf;T=i$4z~{@oFK|Nh;q0_p45E{A#>$Ao+Qe5X`f z6jzvRl^kZA9PSVwVl{h4@78I`@AnEtd+1#65oBOsSlj298Dsr=Hh-Xt-lU$2j)uI3 zShZa{Hhuf{EicjS*%iyu4A-|;Wv8{9T{~t_nHPDeUg+iwp{WyUx>|~-wVBOmc7Cy6 z>_DT?yHx^jHwga!{~u`P&;^P=Sr{1@92j&!UI4|31N-F$hbBD>Lv}FNr5t=P7V{mwt zk)oVaD$>l5-8LbX1&0O+o64?u~W-)qk)-8D;(8$y(X{99LFyX3~Nk%w1VGjTi0M$PLwU#63zZPX!G@5W5{?ZfvqzwMb5dZQV*NhSWO3}&n+79no;onlfz#*#9;YTLCOsS) z4OJ!}ApK?wX{q#0LE0xAg!D=UURJ`NBN z6dM^45o;N6i4YSC6bl5Wr+kT{3JMnsHGF-c6DbS~78EG}5{Z_h3_c$P10p8^4!^Cz zAHx(fKO+O8DU`wm#3Mo|7dXq!*cNk5CKoIW-~|X5CQU*n4>mgpE<7Ra?oA#eH#r{p HK>z?d2m+=N diff --git a/phpBB/images/smilies/icon_eek.gif b/phpBB/images/smilies/icon_eek.gif index 5d3978106a2da37441ed17c9d05383b367570d46..cbe9b7b6ab827cad26550953f98a3039ec4c952c 100644 GIT binary patch literal 619 zcmZ?wbhEHbf{ck5EKx6=Ri^1oXp;OfK~A7T~e zWBhLu-=BvPlX@!t-4S!QWs?-)aW`OjGne1ll$C{EOhw6n`m>I*|Ro$IA+#T89UX^8LW&(x=Fa+oc6o0ZXGB89j z=zuH*#fby^iH4{qIR|qUWff6@H@K$H@ znJ_WLEs9@Qm4}&i8zU2wFn^PTrxMFSHa0yeS9ysjvx%$|#S8?_OpH`hWWO%5g_(KBgS)3r z3UhL%T68?p=iuYgVB2D$l*-1-&TBWtVPfuqZFxItE<{gIU|n0ZvqUB004HNRuZxw> N%?(a-7dS9j0|1Szvc~`b literal 170 zcmZ?wbhEHbd`4m;$l6XN^_D8SRJJ2FugV_ z;@-1W`~Ak%x7W!T7_8VEVD?C1V$(vmHm-x7t|ENQXTMbHG-$9e9m-TqP;V|s+-sI@ SDB66dp*Gz_Y_|#%gEasOPe3vN diff --git a/phpBB/images/smilies/icon_evil.gif b/phpBB/images/smilies/icon_evil.gif index ab1aa8e123fe263608d06126ce08c560ad419f97..98e6535fde06dc6dda5b81bdfeab36bde26c4b9c 100644 GIT binary patch literal 648 zcmZ?wbhEHbFDPm*LgR7k?f~ z{M*U*Zyirzveo}5690}0)E344+s6BEFaN9p>3?f@f4)-+^)~)@Q?wygZP$)XTc;_% z-zya8qWABTaB`S&W{mYeEr$3ItN(AMzkU1m?=XLIxWmtUu78L4|6LJ`_RzV0?ee6a ziudo|($N2wk<~vj`^#7T}%^5=f&heFIxW2tAJ9R?M|BsUY_VfL_EAs!X%)eE<|4#6| z*e~|~t;E0kV$ZHv{@cd)c7x!*O+5dO@%=l?-_=rbpi$`mXX$^Jh5o;mc(+R6|9@ae z&W zeg+0p>&R;!JUp_-(gHqq8i8!~w%)vljOTH&JBe~|Ff*I5bIoH^WaJAtv92q}V59$q zjVY((5;_E%otqex#6&JI9q8<3_f!d-sj#$}na5u(@^eBj1A_!xNX&x|NgZ2-gn1$+ z2RI&U6_uCp(MVjY&R?Y!R*+ek!0lD}h3$mJg+o)AgeBKqV3_3SV&~t;z+epkz~9{v literal 236 zcmZ?wbhEHbgxLc6$23bKgaO@B*VYC4FCTM|KGy!A1Lx~^8f$G|7kJ& z%VnN6ZQB2*4FCVX1}P;4DE?$&WMB|r&;e-z*~!3~slec{BxBNqoiq9;sWfXDwJwx! zTfpypu*1~B&z8VAfA?<<@2mppS1(`uyD9qriNv3W617Ef$zjI-?uh+- zr&O41HL0iK{a&H#J%SCfYIParTc;`KCAuYtJM7xA>Gf>>j)uH%-@awWSVw#41iI+W zp3xg0Vzs41CdON(uE1pKgqj15LUs8j|89u3mKj|;X0U6Hc4c1Vwgvi?DHeY=@gJ%e zn$hfhbB2(yvGKcA0#h0--)<1>YAOD*N9gTU*==+6{+<#j&2W9OU+mcx%m4rX16@97 zf#OdVMg|6N1|5(KL2=^1ezn27NyE@XQ$|x+R-?(Amt(>NcYPjqE`}MLy-lhT$`-1# zy=Bb=7?+#!S(>o&un9YRO9*pMXRu;oVrCYWXwtEjUe3tEA};DFspBmvE+%%=n9rP* zot>LoTV09mE)SPAgV4@B>P;e?c8_;4%X5m%=9lq0B*5aTq{81M$b0B8i%y6}zyaqb z4qZKwW(LN#W(5wO5TQ*?&aAu=+7g8UZ*QrJ^4bWzaXZ4Q<|E`|QZXU%U}L^wUCW83 h-beRwa5lt5Z9jeFps$EW!-S8G>>XksSXh}DtN{!ywO;@L literal 236 zcmZ?wbhEHbIRcFi`x-!pOiN%b)||f$U^p%}h}5a*XWD2sb-X$e}K^frar-lVFcywmLVPpS#r! z1_#Bw>()y8Q=}6Xa7!$m)>9ItA-k>bRM`by3r4ig~?Wb9!eyK z8Nc5v^zGZXXb+v_aED1f6|ZOWU+)nNbkWO#j0_Am3_2hl$WIPzI~?X+Fz%jeq8fHW`H8JjfP;d@J8`SnKX#9>1!+SIPvi}G_r|jamsS=X-GGV_A{^xh*_#g39GAz zUMyyn=a=Q=WDmL>E~v!MBf}*oAXGNDLVhbBhgpeWd8N{UC|(6Mb7eg>ja5#L4AuZW CnwUcX literal 176 zcmZ?wbhEHbgxLc6$23b2ZD19|4%af-@@?!ukgRQ4FCU4{{R2@|EEBy z*B}*Op!k!8k%57iK?lSGnZdvkyTOw)YwnKFWkE{fYz4;!=ddvOIHYqKtO`15eTQk+ zwr{=ctfC9V1Rm6}I;$2M@y*$pa`Z}#oqrI+!z(?kVh8VTo6X#$!E$I32lMi<45x(( UGxi&cHs4b?vq7goSdhUQ00}uk)&Kwi diff --git a/phpBB/images/smilies/icon_lol.gif b/phpBB/images/smilies/icon_lol.gif index 374ba150fb238d6a33605bb26e86d4449625a46c..3042b00d6bbe5b4abcae6f98dfe33fb7a37cde82 100644 GIT binary patch literal 707 zcmZ?wbhEHb}MMMnk4l! zLs*cm5G@Dh?`7UrDc+1sSVEvBP1+fPD`&u2NGH;22ItPqc-A2$z!ldr%I zUvm$2?j}Vu-sL{ttK3ca75(@*xO|WLGWmKj`!XgxLc6$23b2ZD19|4%af-@@>3F2n!7!vFtG{{R2@|NpQ5 zKLsg(0LA~@ey$E)D;vwK1$ZJE z)->GK{b0hvv^Z;7;HB1zIS=v}c`BF7qB`mkh55UYFL448CX~YJS?+%vC0^DXyTAT=mC2Y$ux)_YXI57TebiI diff --git a/phpBB/images/smilies/icon_mad.gif b/phpBB/images/smilies/icon_mad.gif index 1f6c3c2fb401596ec44f4a1189bde2cbc45364aa..994216615bb58667c82ffef9ca9b304245b20b3e 100644 GIT binary patch literal 646 zcmZ?wbhEHbRu+M>9BJNf>t=J|J1^xr=If0u*{ldXQfQ~Liz;@?q$KMy66!;JqO=YPLfC^N=- zQcp#oi{AgY(*N#?Y@MbYA7XXANATYj!GGI%{;lBcXvq8jQvBZ`{@F8n^Ag>nJ#_x9 z;BJUj`}XbIt{t0_!yW$J5&QpE;@=wHe|z~$GhAQK=Kudv;@?W%e@FSAU9tSPocrx; z-hU_g4%G{FwG>Yp-$A~&8wCGt+t>>B1?ELQp-@jvg z|Mu|y+s*s`sTeRoKw(5Pp!k!8k%1wBK?h_5C{7sIA2%d4>4lq03rlOs=r#4S30sLU z$}#yU7_jwfMonU5WMUE*@R!g`;NY1%k4aR3g++>)L&jN-k-^W1Da?yOLyX&AQG9_B zgSn_YgQSK@h^&OTXuP_*lVJplpdcTgtgwLLDF$yL76yh`cTQ~{At7aDh5)e`2G>wd zPG%md^?|lUE)GsjE=`hV5;GVQ6TR6=1PWCwHymhTxh{Mv?Mf4QE=I0Q?a3$l|QmqgvY>Wu}dd2y9-ai1&;|#61oi?A1*4fTwK%}XA*Gn K3F{RH25SKRZR2_X literal 174 zcmZ?wbhEHb3F2nzSlmGt}{tp7j|Nnpe z|0z%&3KV~`FfuUkGU$N#ATtRnq8x}Dvi)MJ!#Bd~+;aVBPjq--pI>tu#%(~RS|Nb#NsAkxb%rGsOVOA(Z zg_C!GdTd5iXMaavbuz=MIG{&B{uxq0@h1x-1A_~L4#?G@IB{U#+u+h9?&zQoz2)YX~q{0|3u0lobE~ literal 349 zcmZ?wbhEHbF%wyNW~cLKD&UCI$nR5;ND%)HHnR_g!O@P7OD?cW`-e>?g9-4y+Ih<{Q~#lNk5g~?X`-%6KexbE7q z>EBU-e=B(Z?dAXZPANIeI6lNGGse23A+NS5ZuX4cS1(_@fB)|Kwab4VO3Y|>e!D^N z{a&HUyvRfKLf4KNv7#ntz2p>jAx0Td zIc-Y?O?LL(#~F9a2@6|FhzJSs^NTPt-4_<;=H*~~^@{0~+%s-&eh!`WGVeZq6yW1f zHu-+)f#Zt{i3|;b8V)`mHmrWQu8G%ZB13?m{6R)GPY$b(3T-aoaG8jR+sH5 z;LGade6U~GQPko`gGJNAq7#;kr@G#2#;~znnVhs^*T0km#>C~4JR&=FdsEeR+|3R= Q;9xFbtmB<4#K>R`0GZ1@LjV8( diff --git a/phpBB/images/smilies/icon_question.gif b/phpBB/images/smilies/icon_question.gif index 9d072265bb9d7d5d4eeaaa9aadb44a49a60e5fe3..13936f71a679a0afa8e86818d16fcdc09ea2c0e8 100644 GIT binary patch literal 643 zcmZ?wbhEHb@ce%%`ELd9zf%JLE(yC?ssB4F@NXyIznh}} z4)Oon$~UV(`uerYuU@`*|NdR5w{c;z)&D0FKi?@OhZ+C7BUW1!_ir!%zcsvn9!mUw zE8P&QmKkIH?c2B4v-y+59cIty4Rq0))Kd{3V)cHnP_&26t{t2565To)^0rP>w$Wz4 z-XplMRP0c_P-R|ZX@;wee_Nwf^4>EtZ@J%a`>}n}KJcG~2g5%vPff>!tv)To04A}p!;r+Re&(VVG?FK;? zV~!*riG^h{KX>vUUM4toLd~)&foE4Nr)6@RYO(!Y!Ruhn@#~!MwPOYc8in%0We+y< ze7GY1|Nnmm8Uw|jEQ|~c@eDd3dq8pG!2X~izDX{~KvqarLs_mVUXX3V1Xf$$7zf4~ z?7dCu;u`wuv*VScq!}3OEo|HaS-ClQo#MrLIe8eZwL@8$n0UpT6x~FYGcYqtaT$v$ z#*0b`3o~2ASw@EWOK@^3X=-si;O21&mSow(tJ%cQZu)EwlMXxoY(AloBht)vS_*tk z0!jkfW(iGAOsrlq4GvC+H}XbIW9e*6Il;u^gxLc6~q5?4F69u{F}@0e+$F^zrz3jO@4oyp}v#>2=1R{ z`2YX-`F#xhd<^^7GyH$bps&p^e-cpewY&^Nd^p4X4Gi!1Fzlbske>!pj|LQfvM@3* zNHOSu#6fm4u$C@R>vD+fTM_1WrjSFOYeSph9VW&ehisimT`Ynp-iELv_k~jmS4OEzz h1Q^5k8{BNVn8hT-nI{@Cu+CwP)wEG_S5{=O1_1NkQKJ9= diff --git a/phpBB/images/smilies/icon_razz.gif b/phpBB/images/smilies/icon_razz.gif index 29da2a2fccc79981bc54db7513ca6d2374592f9d..a2627439583a8161065db6259baa0daaa1cf679b 100644 GIT binary patch literal 645 zcmZ?wbhEHb< zA`$9s{O^v~tCug{zkin;X8i92-@l^*|90}#7RCKL$oJ==#J_F4Ki?@8CR_bm!V@22 z^=~U*W{mZ}o1*`gbLSs!M+qZAm zdjyli9sZr=d%suc-!Z<~GkSOJ*z|8N|IHaf|3B-Oq)AVmP*a&L{cja_X@;wZgMMXR z z{yY@FcFbT#v-7)E0{@Qi{aefPZx`>gE0$d?#pQ95|26?##rtnN@4s6j2O5EvO8=@Y|^o?mXnfG)YfTAFvwlcl%GSX9y0cuu0WKL@j`mphYRf-kc$dsw0+qfAWV z^7ev8iGt!hJPZsxe5{vEL_}1yG=wfcc&Nax)x^(Y8f+CQ?V-!UKZi{!^aux&r-mL| zlK`)z85_?Fr32ju6bv{V9uzn>@UwhhB|1Z)^_Y;5l$}MvgvZCGF}bWWSa?Cvv6Iap zPGX|ML7}$kHVqva2?|Y|+zcfzSw1{<;j9zjaCzCFdYws8+C}5ZmjkX`db({(9tijc IC@@$909b(J*Z=?k literal 176 zcmZ?wbhEHb^3h|5y0`zsdjqAOHXV zwXw1B|EEADAfWh@g^_`Qk3k2-0hz(T5_`c@GHdRQt4o8V#Kj6YnC2W7^l?<@Q2(%O z^|TpzE=L6K%vq%4Qv0AgI88 ZPHWn(3w4)`M4Rs!oY|mbDlEug4FCb$KH>lX diff --git a/phpBB/images/smilies/icon_redface.gif b/phpBB/images/smilies/icon_redface.gif index ad7628320c3d15756c84794c8c0523f1072da640..d23a1396a0b14142aba96c7952b99baffb068eee 100644 GIT binary patch literal 2990 zcmaLYdpuP6AII@=zs<~DJn*mTqa~?47ry37?Mk=u=+7&+_g1wmxd&C zK_S)emtoVAYUzT?{>s{hA7>glh`Wu#~I*p|fBRm`q zMYzNVvoh@r#{!6l0$d_EmNDM8tSv@IWA?H(8jaz#C z&2C=58WUifdo(`(*ui-L@o3WC`Euf@8!eg2|)kFUD$SV|8| zJ;a-tdpN%5fI8c8LrGD3NnUztY(Q0UQIEBHYIwl>{QGxrr$HDV9KwSgw8Xb8IItic%|89C3G(+G70q`MkjsW5z5QPWM zIM9d#F?gh(3WRv1n1(#3f(AS?3?qv)kPU%y9Jr>5)Kb9}2x+H+1RS`l34(Co00hoz zBDY~s1tHBaQU-%UO^}5HNAZ;`Do7-OIx=`f0t4hqE)|3mKs{Fa5UvcOf=;sZpKzrY z74#8+Jr;SZC2fSIB{2ArjO1(ix>z3FzgN;l2OW6HAf3fD0{?;}<8*M3AZehp%#A=G z1fmImjlbD(73{`?5D57l2E7nS)kIEEkvS@G#eo}ma0v&VX(CzhtQRzM1jB;p%$?L8>0*?}JI&qE zW^djQAI6%gg66Ji3ky@G8f|9mp{YKb>1y)LuB#oT`W*rK(^tqN&5TrTz(_u0>WR&q z53wXWeJ(@0{J7Ipq0QV=?UB2TXXWZ8C)0Z})l=gG=30r?~N|pi>uG zZk`Sctt)UDxxG6o|4?MxQ&gpV5&t%Bg))?Dek+WrF|l-hMw{@hG4@3im5&@jp#w8CJ7wAL{64=;K}*#G%t%*v z*zkIm9jDW*CIWFMaHyqbYxP-|tWA^tyuX$qw=ngq=@4=E^_0ugdvf($MsB5ErtKU^ zk&EnujQuotlYAVXyG4!0_fmQ*kdgUT(;c*lmNF62!&k;huaQkvXy%h?pE<@1ad)jT0x=cH$f4eHc7bSH?2~$U4DTt-z}rkowod2OXABz0NR-~xiroBaq$JBwzO4H( z`8jE7RAaey5?MNE86y;L^LwIP$YJI7uMh2MPTl0{;itFP_Pnbk>k{0~gI>S;*y0y- zH5$@15x#DaQAoOjHMLB%c$tT6bNh{QB%$`(|TSh zv_#oELWP%@y59;LK*KcrCv^B3n3K3*SJAkUL3+IhNipocV*+$a_Y{2{M$hcD$|<3N%ff(Z+J;Y(XotiJ@S_&n*;JY*X;>> zJTBREG9iRWw)A;!T4q7+)>4d3>^YPWVkX{=m)7$6uYcCCvXCnE_+wQ!7IwgPOgYSv zOLDT`s_R{yV%emQ+HoWj8@#-$%ET~Dl=$M$U&OrxsDi5qT0WD>N2Nm@~o510qZ1h#fu@mp=&lCxT&z-w^{ZA7+7Aj^I>-mHSF`gKc`2# zdH1Z_vQh@i>UJPreR7|6J-Zyl{J~T;KVNfw;)77h;yOZUosVol)1uJ4ysjmLV;3uk zy|~8W!ZA&TglE=#EjqeFZ7E^Ti#Bd_N6f(i?rxvUKDhD0tyK=Z?)JOC{?KI6&cBej z|LNc-;f>QOyP8DfT@ zvcY+`54*M-I%XxW)YGkSbZ1#P^FWOfRSG}%wmi`lwa|+FzJ8bzInzxtIhXZ4r!!6` z6iHS=EsQ&>zoXUXk*@~3(l+F;0iH((7(P5WBtQq)Cf>6=sUz24V6r;Evu&_OIQ#+~ zpfdmc-wp7K8t}x~uf&T38x0cM3ugpkv7-`HY%p9W@Lrp&W*haS(Zy@+=2-90({6&?3jlAKt_ntO6TcB#JHT5;j6FLP1s2`{>{ zzy82%)yPPaxID>S+di^i43F)9xQhLX&2@NRrEhQ1k$miwjwTqKV6~ryA3u2ZWh5HqI+y4R; C&Qw$Gs7{2#K|NnmWcSgp)ZKdDmF#NyN{%1+%|LxoV z&6x4L*vr+`_5YJ6|9^e`f9A~pR}4QI8vg%z`Rh8vzsC$emo5AMNBH0A=KudDKaP*T z>0!pe!0`X+%wGqqfegj}+zPv3R$%UgcxPlMx(u7qxxxfZd?$&YQ;PGndxWo3ZY ziH`8-T?`B&DNk$k=JGRs=w-6FQO@h2ko&aap$ji#VOF!1O><{wyHRCMkfx2Ai?Slv zYA%q~j0}tnyg^Qv|J?fJ`y}Jo`B}5IcZU0i%+^)m>vp{!Bqu6#)+xQyYu&8=mRY(7 z)}5aCNL5gG*%{+AHF>K87ridk_T^KXg3qiu^$yZP~SpxtUz5smy diff --git a/phpBB/images/smilies/icon_rolleyes.gif b/phpBB/images/smilies/icon_rolleyes.gif index d7f5f2f4b18f8a141c7a5dd1e09ff106a2f9fa1e..07078216677dc741544011544ec8a2dddc380925 100644 GIT binary patch literal 1153 zcmb`EdrVtZ9LH~;&;q^pmK9oBS!ugXV?!7O=!3CBp|HUwb8NU??R}iYXky6Jm{_Bc z-E(U%+HQl5f|9XmG%_U_K9+1trrp9Cr!jF4w^dEHnYn-tQ2!vAl5@QsC<%Xi{x~^* z{662u@3d_RdAux+k=R{;p@|}N(ty4uu3x+I>&*20{M@dNns@eE(Ro~&wW6~)I&HW= z=XmXf2-scoJn*5cY4NrhT`ulrL%)sUCsWSr335kECFlvvpEZhoz0W@BA56S_=G3PP z3k#zoNvhpVcl-LDS})x(N12K!Wk3JA@mi+p?p5#5!B?{*#+ROHjrQ(I?=#MR|4l_&;>%8v7q-0(Rh*crwx5#2>CWhl7wN{(k(y!-%}wKY;Wz}8Eoom zt*)$6DP;AE`)Z9I1DHGKl=~(u@7q4Wmp}5T6}J}K%K4-Uf4DHBqbf~iRdVgd!AOLn zNTSBD7HG6b#waJzqO>p?+Xh{PVGeIPl^@Qlt{^FfWf|vGM(-~*kQXm}m)TW{6H^?Q zVY3;JU28PfW|=Va3r#axi&E)wu79^w#*bp`HHKG>C3Ti6h$hVy9?{GpX2S- zwVp{kmVAzj?A>@H(50xVQX1S}#rTPkIz4VaeMxCnCe>ux{$5N|>}XCWvg1LhbNhZT zRIfBtU@EK#)5s0WfI#0L%ldf)1Ctvv3`jq^L@aY*qTcsv2g zgD@$w!Z7dY;Mupq7+m7YbBkQE$#ISc9MK|(fb8cv-U;^eJ{e05jQ}=98x!IZwq^y> z$(Z%ubV7s3H^u$lw+03e9Ue+SZrSF+f2rj*dMsz->I0oXh`k~72>Albf^Lu$d~98; zZog2+rAAZ3!(Fi@BW%SePX-%hBf!8I6eF8~mjI0-rPGC+^~P`mzom&8W9pAG1)y23 z%pM2hzysS`;Z~Q(hr^Jjm$R&r4CEvuuo;TH4m`#;zyPxuP+&UVf9 ZmgCqDK0FR<+gsn=>Wag#NXv5me*izYggxLc6$23bKgaO@B*Xvz|NqTp_`ikW|G&xq{~!PVSNQ)^ zpx|qe3NTRo&+X?L671|4;A*62z|05~RQ$=p%EiFTpaW6>GM0fQZi6Rh*4!PT(*&f% z*$TRZ<}@?I^CYG*?eW$Pd$isBan+(fO1gn0b6dW=x%w~q}~tKE&`I~ zWZ+_80zw8BmJOU2m9Ux1yJ3o3D&v+$ZG#t4ZLVMy3?Qu_ZQMY+8CYaDcq&S-H42Fh z{c)CE%Sn@EnS+n-#i)qLlhWcv5Vs)dU<2w9+u*4hy}}}Vq4ah~j;>ScENX^v3nduQ d4TmZP8gAjeG30)Y-)<1}^LBc6#q#Y{+0qQxn=^#U(#$LKBCRcr-mMaNv0u#E!U*Ui zkXHvEQ2fcl$iU#spaXImC{7&MZ#FP8`f6Ld%8AIy+iLqZNwTpqu&}7|8c$*1SjS4Pm{Y;ty2MmrjG;_#H7j<+bo)1=Fum%8-fVfov literal 238 zcmZ?wbhEHbgxLc6$23bKgaNIF2n!7!vD80{0DM@;NRr`CxMLP|FjsU zO`B$HZ2T{m`TzgdAk{j*8D$QDUE*nK$ z7w|KG>@aokb7%R&!0WI`LE+V`jZbtHGVEq^HDzd8gshBhJhWk{9N&@6Gj#R{?N7d_ u@Ss3Q_U6Qmr`{j;vSH$AZf0`Va5JoNi_%bKV4KJmrQFw{HdRBB!5RP#AxjVd From 0a5c435102dbdfce9b773c5ba4c0a91e42141108 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 23 Feb 2008 11:26:23 +0000 Subject: [PATCH 048/102] Fix Custom BBCode {EMAIL}-Token usage - #21155 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8387 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 4 +++- phpBB/includes/acp/acp_bbcodes.php | 4 ++-- phpBB/includes/functions.php | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 91d255bd78..7e2e1a4663 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -120,7 +120,9 @@
    120. [Fix] Respect signature permissions in posting (Bug #16029)
    121. [Fix] Users allowed to resign only from open and freely open groups (Bug #19355)
    122. [Fix] Assign a last viewed date to converted topics (Bug #16565)
    123. -
    124. [Fix] Many minor and/or cosmetic fixes (Including, but not limited to: #21315, #18575, #18435, #21215,)
    125. +
    126. [Fix] Many minor and/or cosmetic fixes (Including, but not limited to: #21315, #18575, #18435, #21215)
    127. +
    128. [Feature] New option to hide the entire list of subforums on listforums
    129. +
    130. [Fix] Custom BBCode {EMAIL}-Token usage (Bug #21155)
    131. diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index 21370036ee..33e8fe7ec1 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -312,7 +312,7 @@ class acp_bbcodes '!(' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('relative_url')) . ')!e' => "\$this->bbcode_specialchars('$1')" ), 'EMAIL' => array( - '!([a-z0-9]+[a-z0-9\-\._]*@(?:(?:[0-9]{1,3}\.){3,5}[0-9]{1,3}|[a-z0-9]+[a-z0-9\-\._]*\.[a-z]+))!i' => "\$this->bbcode_specialchars('$1')" + '!(' . get_preg_expression('email') . ')!ie' => "\$this->bbcode_specialchars('$1')" ), 'TEXT' => array( '!(.*?)!es' => "str_replace(array(\"\\r\\n\", '\\\"', '\\'', '(', ')'), array(\"\\n\", '\"', ''', '(', ')'), trim('\$1'))" @@ -334,7 +334,7 @@ class acp_bbcodes $sp_tokens = array( 'URL' => '(?i)((?:' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('url')) . ')|(?:' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('www_url')) . '))(?-i)', 'LOCAL_URL' => '(?i)(' . str_replace(array('!', '\#'), array('\!', '#'), get_preg_expression('relative_url')) . ')(?-i)', - 'EMAIL' => '([a-zA-Z0-9]+[a-zA-Z0-9\-\._]*@(?:(?:[0-9]{1,3}\.){3,5}[0-9]{1,3}|[a-zA-Z0-9]+[a-zA-Z0-9\-\._]*\.[a-zA-Z]+))', + 'EMAIL' => '(' . get_preg_expression('email') . ')', 'TEXT' => '(.*?)', 'SIMPLETEXT' => '([a-zA-Z0-9-+.,_ ]+)', 'IDENTIFIER' => '([a-zA-Z0-9-_]+)', diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 385a1ea72e..43499e0eea 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2756,7 +2756,7 @@ function get_preg_expression($mode) switch ($mode) { case 'email': - return '[a-z0-9&\'\.\-_\+]+@[a-z0-9\-]+\.([a-z0-9\-]+\.)*[a-z]+'; + return '[a-z0-9&\'\.\-_\+]+@[a-z0-9\-]+\.(?:[a-z0-9\-]+\.)*[a-z]+'; break; case 'bbcode_htm': From b5a1ddffa0b424d4e8d6b7b08cbbf3eec3d264bb Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 23 Feb 2008 11:45:38 +0000 Subject: [PATCH 049/102] Do not rely on parameter returned by unlink() for verifying cache directory write permission - #19565 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8388 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/acm/acm_file.php | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 7e2e1a4663..a7c98dd417 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -123,6 +123,7 @@
    132. [Fix] Many minor and/or cosmetic fixes (Including, but not limited to: #21315, #18575, #18435, #21215)
    133. [Feature] New option to hide the entire list of subforums on listforums
    134. [Fix] Custom BBCode {EMAIL}-Token usage (Bug #21155)
    135. +
    136. [Fix] Do not rely on parameter returned by unlink() for verifying cache directory write permission (Bug #19565)
    137. diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php index 775e8d4495..5851016f3d 100644 --- a/phpBB/includes/acm/acm_file.php +++ b/phpBB/includes/acm/acm_file.php @@ -312,7 +312,7 @@ class acm if ($var_name[0] == '_') { - $this->remove_file($this->cache_dir . 'data' . $var_name . ".$phpEx"); + $this->remove_file($this->cache_dir . 'data' . $var_name . ".$phpEx", true); } else if (isset($this->vars[$var_name])) { @@ -375,7 +375,7 @@ class acm } else if ($expired) { - $this->remove_file($this->cache_dir . 'sql_' . md5($query) . ".$phpEx"); + $this->remove_file($this->cache_dir . 'sql_' . md5($query) . ".$phpEx", true); return false; } @@ -489,13 +489,15 @@ class acm /** * Removes/unlinks file */ - function remove_file($filename) + function remove_file($filename, $check = false) { - if (!@unlink($filename)) + if ($check && !@is_writeable($this->cache_dir)) { // E_USER_ERROR - not using language entry - intended. trigger_error('Unable to remove files within ' . $this->cache_dir . '. Please check directory permissions.', E_USER_ERROR); } + + return @unlink($filename); } } From 6accc46024d436e69802793956653412cde8f404 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 23 Feb 2008 13:18:33 +0000 Subject: [PATCH 050/102] some language/style/code fixes (refer to the diff of the changelog) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8389 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/index.php | 2 +- phpBB/adm/style/acp_database.html | 2 +- phpBB/docs/CHANGELOG.html | 5 +++-- phpBB/docs/INSTALL.html | 6 ++--- phpBB/docs/coding-guidelines.html | 2 +- phpBB/includes/acp/acp_attachments.php | 14 +++++------- phpBB/includes/acp/acp_main.php | 9 +++----- phpBB/includes/acp/acp_styles.php | 2 +- phpBB/includes/acp/acp_users.php | 2 +- phpBB/includes/functions.php | 22 ++++++++++++++++++- phpBB/includes/functions_admin.php | 11 ++-------- phpBB/includes/functions_content.php | 2 +- phpBB/includes/functions_profile_fields.php | 10 ++++++--- phpBB/includes/functions_upload.php | 6 ++--- phpBB/includes/ucp/ucp_attachments.php | 2 +- phpBB/includes/ucp/ucp_groups.php | 8 ++++--- phpBB/includes/ucp/ucp_profile.php | 4 ++-- phpBB/install/install_convert.php | 4 ++-- phpBB/language/en/acp/groups.php | 1 + phpBB/language/en/acp/users.php | 4 ++-- phpBB/language/en/common.php | 2 ++ phpBB/language/en/memberlist.php | 2 +- phpBB/language/en/ucp.php | 2 +- .../styles/prosilver/template/mcp_topic.html | 2 +- 24 files changed, 71 insertions(+), 55 deletions(-) diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index a3b173ac7a..0932e01aa1 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -184,7 +184,7 @@ function adm_page_footer($copyright_html = true) { global $base_memory_usage; $memory_usage -= $base_memory_usage; - $memory_usage = ($memory_usage >= 1048576) ? round((round($memory_usage / 1048576 * 100) / 100), 2) . ' ' . $user->lang['MB'] : (($memory_usage >= 1024) ? round((round($memory_usage / 1024 * 100) / 100), 2) . ' ' . $user->lang['KB'] : $memory_usage . ' ' . $user->lang['BYTES']); + $memory_usage = get_formatted_filesize($memory_usage); $debug_output .= ' | Memory Usage: ' . $memory_usage; } diff --git a/phpBB/adm/style/acp_database.html b/phpBB/adm/style/acp_database.html index 8165efe9a2..e64c5ed437 100644 --- a/phpBB/adm/style/acp_database.html +++ b/phpBB/adm/style/acp_database.html @@ -77,7 +77,7 @@ -
      {L_SELECT_ALL} :: {L_DESELECT_ALL}
      +
      {L_SELECT_ALL} :: {L_DESELECT_ALL}

      diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index a7c98dd417..e55708cfb5 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -108,8 +108,8 @@

    138. [Fix] Use HTTP_HOST in favor of SERVER_NAME for determining server url for redirection and installation (Bug #19955)
    139. [Fix] Removing s_watching_img from watch_topic_forum() function (Bug #20445)
    140. [Fix] Changing order for post review if more than one post affected (Bug #15249)
    141. -
    142. [Fix] Language typos/fixes (Bug #20425, #15719, #15429, #14669, #13479)
    143. -
    144. [Fix] Style/Template fixes (Bug #20065, #19405, #19205, #15028, #14934, #14821, #14752, #14497, #13707, #14738)
    145. +
    146. [Fix] Language typos/fixes (Bug #20425, #15719, #15429, #14669, #13479, #20795, #21095, #21405, #21715, #21725, #21755, #21865, #15689)
    147. +
    148. [Fix] Style/Template fixes (Bug #20065, #19405, #19205, #15028, #14934, #14821, #14752, #14497, #13707, #14738, #19725)
    149. [Fix] Tiny code fixes (Bug #20165, #20025, #19795, #14804)
    150. [Fix] Prepend phpbb_root_path to ranks path for displaying ranks (Bug #19075)
    151. [Fix] Allow forum notifications if topic notifications are disabled but forum notifications enabled (Bug #14765)
    152. @@ -124,6 +124,7 @@
    153. [Feature] New option to hide the entire list of subforums on listforums
    154. [Fix] Custom BBCode {EMAIL}-Token usage (Bug #21155)
    155. [Fix] Do not rely on parameter returned by unlink() for verifying cache directory write permission (Bug #19565)
    156. +
    157. [Change] Use correct string for filesize (MiB instead of MB for example)
    158. diff --git a/phpBB/docs/INSTALL.html b/phpBB/docs/INSTALL.html index 4f9e4ded70..40ae50047b 100644 --- a/phpBB/docs/INSTALL.html +++ b/phpBB/docs/INSTALL.html @@ -281,9 +281,9 @@

      4.iii. Patch file

      -

      The patch file package is for those wanting to update through the patch application, and being compfortable with it.

      +

      The patch file package is for those wanting to update through the patch application, and being comfortable with it.

      -

      The patch file is one solution for those with many Modifications (MODs) or other changes who do not want to re-add them back to all the changed files if they use the method explained above. 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 strongly recommend the Automatic update package explained below. It is also the preferred update method.

      +

      The patch file is one solution for those with many Modifications (MODs) or other changes who do not want to re-add them back to all the changed files if they use the method explained above. 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 strongly recommend the Automatic update package explained below. It is also the preferred update method.

      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.

      @@ -369,7 +369,7 @@

      Password conversion Due to the utf-8 based handling of passwords in phpBB3, it is not always possible to transfer all passwords. For passwords "lost in translation" the easiest workaround is to use the "forgotten password" function.

      -

      Path to your former board The converter expects the relative path to your old board's files. So, -for instance - if the new board is located at http://www.yourdomain.com/forum and the phpBB3 is located at http://www.yourdomain.com/phpBB3, then the correct value would be ../forum. Note that the webserver user must be able to access the source installation's files.

      +

      Path to your former board The converter expects the relative path to your old board's files. So, - for instance - if the old board is located at http://www.yourdomain.com/forum and the phpBB3 installation is located at http://www.yourdomain.com/phpBB3, then the correct value would be ../forum. Note that the webserver user must be able to access the source installation's files.

      Missing images If your default board language's language pack does not include all images, then some images might be missing in your installation. Always use a complete language pack as default language.

      diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html index 5ad2627d6e..837ae55227 100644 --- a/phpBB/docs/coding-guidelines.html +++ b/phpBB/docs/coding-guidelines.html @@ -110,7 +110,7 @@

      If entered with tabs (replace the {TAB}) both equal signs need to be on the same column.

      Linefeeds:

      -

      Ensure that your editor is saving files in the UNIX format. This means lines are terminated with a newline, not with a CR/LF combo as they are on Win32, or whatever the Mac uses. Any decent editor should be able to do this, but it might not always be the default. Know your editor. If you want advice on Windows text editors, just ask one of the developers. Some of them do their editing on Win32.

      +

      Ensure that your editor is saving files in the UNIX (LF) line ending format. This means that lines are terminated with a newline, not with Windows Line endings (CR/LF combo) as they are on Win32 or Classic Mac (CR) Line endings. Any decent editor should be able to do this, but it might not always be the default setting. Know your editor. If you want advice for an editor for your Operating System, just ask one of the developers. Some of them do their editing on Win32.

      1.ii. File Header

      diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 4d403df93b..1db1602665 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -152,7 +152,7 @@ class acp_attachments if (in_array($config_name, array('attachment_quota', 'max_filesize', 'max_filesize_pm'))) { $size_var = request_var($config_name, ''); - $this->new_config[$config_name] = $config_value = ($size_var == 'kb') ? round($config_value * 1024) : (($size_var == 'mb') ? round($config_value * 1048576) : $config_value); + $this->new_config[$config_name] = $config_value = ($size_var == 'kb') ? ($config_value << 10) : (($size_var == 'mb') ? ($config_value << 20) : $config_value); } if ($submit) @@ -500,7 +500,7 @@ class acp_attachments $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); + $max_filesize = ($size_select == 'kb') ? ($max_filesize << 10) : (($size_select == 'mb') ? ($max_filesize << 20) : $max_filesize); $allow_group = (isset($_POST['allow_group'])) ? true : false; if ($max_filesize == $config['max_filesize']) @@ -673,8 +673,7 @@ class acp_attachments } $size_format = ($ext_group_row['max_filesize'] >= 1048576) ? 'mb' : (($ext_group_row['max_filesize'] >= 1024) ? 'kb' : 'b'); - - $ext_group_row['max_filesize'] = ($ext_group_row['max_filesize'] >= 1048576) ? round($ext_group_row['max_filesize'] / 1048576 * 100) / 100 : (($ext_group_row['max_filesize'] >= 1024) ? round($ext_group_row['max_filesize'] / 1024 * 100) / 100 : $ext_group_row['max_filesize']); + $ext_group_row['max_filesize'] = get_formatted_filesize($ext_group_row['max_filesize'], false); $img_path = $config['upload_icons_path']; @@ -1000,11 +999,8 @@ class acp_attachments while ($row = $db->sql_fetchrow($result)) { - $size_lang = ($row['filesize'] >= 1048576) ? $user->lang['MB'] : (($row['filesize'] >= 1024) ? $user->lang['KB'] : $user->lang['BYTES']); - $row['filesize'] = ($row['filesize'] >= 1048576) ? round((round($row['filesize'] / 1048576 * 100) / 100), 2) : (($row['filesize'] >= 1024) ? round((round($row['filesize'] / 1024 * 100) / 100), 2) : $row['filesize']); - $template->assign_block_vars('orphan', array( - 'FILESIZE' => $row['filesize'] . ' ' . $size_lang, + 'FILESIZE' => get_formatted_filesize($row['filesize']), 'FILETIME' => $user->format_date($row['filetime']), 'REAL_FILENAME' => basename($row['real_filename']), 'PHYSICAL_FILENAME' => basename($row['physical_filename']), @@ -1410,7 +1406,7 @@ class acp_attachments { // Determine size var and adjust the value accordingly $size_var = ($value >= 1048576) ? 'mb' : (($value >= 1024) ? 'kb' : 'b'); - $value = ($value >= 1048576) ? round($value / 1048576 * 100) / 100 : (($value >= 1024) ? round($value / 1024 * 100) / 100 : $value); + $value = get_formatted_filesize($value, false); return ' '; } diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 00ea2f1689..be337a20f3 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -310,8 +310,8 @@ class acp_main $users_per_day = sprintf('%.2f', $total_users / $boarddays); $files_per_day = sprintf('%.2f', $total_files / $boarddays); - $upload_dir_size = ($config['upload_dir_size'] >= 1048576) ? sprintf('%.2f ' . $user->lang['MB'], ($config['upload_dir_size'] / 1048576)) : (($config['upload_dir_size'] >= 1024) ? sprintf('%.2f ' . $user->lang['KB'], ($config['upload_dir_size'] / 1024)) : sprintf('%.2f ' . $user->lang['BYTES'], $config['upload_dir_size'])); - + $upload_dir_size = get_formatted_filesize($config['upload_dir_size']); + $avatar_dir_size = 0; if ($avatar_dir = @opendir($phpbb_root_path . $config['avatar_path'])) @@ -325,10 +325,7 @@ class acp_main } closedir($avatar_dir); - // This bit of code translates the avatar directory size into human readable format - // Borrowed the code from the PHP.net annoted manual, origanally written by: - // Jesse (jesse@jess.on.ca) - $avatar_dir_size = ($avatar_dir_size >= 1048576) ? sprintf('%.2f ' . $user->lang['MB'], ($avatar_dir_size / 1048576)) : (($avatar_dir_size >= 1024) ? sprintf('%.2f ' . $user->lang['KB'], ($avatar_dir_size / 1024)) : sprintf('%.2f ' . $user->lang['BYTES'], $avatar_dir_size)); + $avatar_dir_size = get_formatted_filesize($avatar_dir_size); } else { diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 31e99a6b0c..88850d59b3 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -1003,7 +1003,7 @@ parse_css_file = {PARSE_CSS_FILE} 'CACHED' => $user->format_date(filemtime("{$phpbb_root_path}cache/$filename")), 'FILENAME' => $file, - 'FILESIZE' => sprintf('%.1f KB', filesize("{$phpbb_root_path}cache/$filename") / 1024), + 'FILESIZE' => sprintf('%.1f ' . $user->lang['KIB'], filesize("{$phpbb_root_path}cache/$filename") / 1024), 'MODIFIED' => $user->format_date((!$template_row['template_storedb']) ? filemtime("{$phpbb_root_path}styles/{$template_row['template_path']}/template/$tpl_file.html") : $filemtime[$file . '.html'])) ); } diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 360552c452..32bbe4e46d 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1747,7 +1747,7 @@ class acp_users 'REAL_FILENAME' => $row['real_filename'], 'COMMENT' => nl2br($row['attach_comment']), 'EXTENSION' => $row['extension'], - 'SIZE' => ($row['filesize'] >= 1048576) ? ($row['filesize'] >> 20) . ' ' . $user->lang['MB'] : (($row['filesize'] >= 1024) ? ($row['filesize'] >> 10) . ' ' . $user->lang['KB'] : $row['filesize'] . ' ' . $user->lang['BYTES']), + 'SIZE' => get_formatted_filesize($row['filesize']), 'DOWNLOAD_COUNT' => $row['download_count'], 'POST_TIME' => $user->format_date($row['filetime']), 'TOPIC_TITLE' => ($row['in_message']) ? $row['message_title'] : $row['topic_title'], diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 43499e0eea..a220bd33c6 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -198,6 +198,26 @@ function unique_id($extra = 'c') return substr($val, 4, 16); } +/** +* Return formatted string for filesizes +*/ +function get_formatted_filesize($bytes, $add_size_lang = true) +{ + global $user; + + if ($bytes >= pow(2, 20)) + { + return ($add_size_lang) ? round($bytes / 1024 / 1024, 2) . ' ' . $user->lang['MIB'] : round($bytes / 1024 / 1024, 2); + } + + if ($bytes >= pow(2, 10)) + { + return ($add_size_lang) ? round($bytes / 1024, 2) . ' ' . $user->lang['KIB'] : round($bytes / 1024, 2); + } + + return ($add_size_lang) ? ($bytes) . ' ' . $user->lang['BYTES'] : ($bytes); +} + /** * Determine whether we are approaching the maximum execution time. Should be called once * at the beginning of the script in which it's used. @@ -3451,7 +3471,7 @@ function page_footer($run_cron = true) { global $base_memory_usage; $memory_usage -= $base_memory_usage; - $memory_usage = ($memory_usage >= 1048576) ? round((round($memory_usage / 1048576 * 100) / 100), 2) . ' ' . $user->lang['MB'] : (($memory_usage >= 1024) ? round((round($memory_usage / 1024 * 100) / 100), 2) . ' ' . $user->lang['KB'] : $memory_usage . ' ' . $user->lang['BYTES']); + $memory_usage = get_formatted_filesize($memory_usage); $debug_output .= ' | Memory Usage: ' . $memory_usage; } diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 7fd21948d0..afaf165d66 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -196,7 +196,7 @@ function size_select_options($size_compare) { global $user; - $size_types_text = array($user->lang['BYTES'], $user->lang['KB'], $user->lang['MB']); + $size_types_text = array($user->lang['BYTES'], $user->lang['KIB'], $user->lang['MIB']); $size_types = array('b', 'kb', 'mb'); $s_size_options = ''; @@ -2878,14 +2878,7 @@ function get_database_size() break; } - if ($database_size !== false) - { - $database_size = ($database_size >= 1048576) ? sprintf('%.2f ' . $user->lang['MB'], ($database_size / 1048576)) : (($database_size >= 1024) ? sprintf('%.2f ' . $user->lang['KB'], ($database_size / 1024)) : sprintf('%.2f ' . $user->lang['BYTES'], $database_size)); - } - else - { - $database_size = $user->lang['NOT_AVAILABLE']; - } + $database_size = ($database_size !== false) ? get_formatted_filesize($database_size) : $user->lang['NOT_AVAILABLE']; return $database_size; } diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index a5a8683df3..f851309a1e 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -823,7 +823,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count, $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); + $filesize = get_formatted_filesize($filesize, false); $comment = bbcode_nl2br(censor_text($attachment['attach_comment'])); diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index 63b506c5b8..3797166429 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -871,13 +871,13 @@ class custom_profile } else { - $var = request_var($var_name, $profile_row['field_default_value']); + $var = request_var($var_name, (int) $profile_row['field_default_value']); } break; case FIELD_STRING: case FIELD_TEXT: - $var = utf8_normalize_nfc(request_var($var_name, $profile_row['field_default_value'], true)); + $var = utf8_normalize_nfc(request_var($var_name, (string) $profile_row['field_default_value'], true)); break; case FIELD_INT: @@ -887,10 +887,14 @@ class custom_profile } else { - $var = request_var($var_name, $profile_row['field_default_value']); + $var = request_var($var_name, (int) $profile_row['field_default_value']); } break; + case FIELD_DROPDOWN: + $var = request_var($var_name, (int) $profile_row['field_default_value']); + break; + default: $var = request_var($var_name, $profile_row['field_default_value']); break; diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index 8e4bb6284a..e75db00414 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -387,7 +387,7 @@ class filespec if ($this->upload->max_filesize && ($this->get('filesize') > $this->upload->max_filesize || $this->filesize == 0)) { $size_lang = ($this->upload->max_filesize >= 1048576) ? $user->lang['MB'] : (($this->upload->max_filesize >= 1024) ? $user->lang['KB'] : $user->lang['BYTES'] ); - $max_filesize = ($this->upload->max_filesize >= 1048576) ? round($this->upload->max_filesize / 1048576 * 100) / 100 : (($this->upload->max_filesize >= 1024) ? round($this->upload->max_filesize / 1024 * 100) / 100 : $this->upload->max_filesize); + $max_filesize = get_formatted_filesize($this->upload->max_filesize, false); $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'WRONG_FILESIZE'], $max_filesize, $size_lang); @@ -778,7 +778,7 @@ class fileupload case 2: $size_lang = ($this->max_filesize >= 1048576) ? $user->lang['MB'] : (($this->max_filesize >= 1024) ? $user->lang['KB'] : $user->lang['BYTES'] ); - $max_filesize = ($this->max_filesize >= 1048576) ? round($this->max_filesize / 1048576 * 100) / 100 : (($this->max_filesize >= 1024) ? round($this->max_filesize / 1024 * 100) / 100 : $this->max_filesize); + $max_filesize = get_formatted_filesize($this->max_filesize, false); $error = sprintf($user->lang[$this->error_prefix . 'WRONG_FILESIZE'], $max_filesize, $size_lang); break; @@ -814,7 +814,7 @@ class fileupload if ($this->max_filesize && ($file->get('filesize') > $this->max_filesize || $file->get('filesize') == 0)) { $size_lang = ($this->max_filesize >= 1048576) ? $user->lang['MB'] : (($this->max_filesize >= 1024) ? $user->lang['KB'] : $user->lang['BYTES'] ); - $max_filesize = ($this->max_filesize >= 1048576) ? round($this->max_filesize / 1048576 * 100) / 100 : (($this->max_filesize >= 1024) ? round($this->max_filesize / 1024 * 100) / 100 : $this->max_filesize); + $max_filesize = get_formatted_filesize($this->max_filesize, false); $file->error[] = sprintf($user->lang[$this->error_prefix . 'WRONG_FILESIZE'], $max_filesize, $size_lang); } diff --git a/phpBB/includes/ucp/ucp_attachments.php b/phpBB/includes/ucp/ucp_attachments.php index 2732879913..5685702de2 100644 --- a/phpBB/includes/ucp/ucp_attachments.php +++ b/phpBB/includes/ucp/ucp_attachments.php @@ -150,7 +150,7 @@ class ucp_attachments 'FILENAME' => $row['real_filename'], 'COMMENT' => bbcode_nl2br($row['attach_comment']), 'EXTENSION' => $row['extension'], - 'SIZE' => ($row['filesize'] >= 1048576) ? ($row['filesize'] >> 20) . ' ' . $user->lang['MB'] : (($row['filesize'] >= 1024) ? ($row['filesize'] >> 10) . ' ' . $user->lang['KB'] : $row['filesize'] . ' ' . $user->lang['BYTES']), + 'SIZE' => get_formatted_filesize($row['filesize']), 'DOWNLOAD_COUNT' => $row['download_count'], 'POST_TIME' => $user->format_date($row['filetime']), 'TOPIC_TITLE' => ($row['in_message']) ? $row['message_title'] : $row['topic_title'], diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index d6e7a30176..d884e0d571 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -709,8 +709,8 @@ class ucp_groups 'U_SWATCH' => append_sid("{$phpbb_root_path}adm/swatch.$phpEx", 'form=ucp&name=group_colour'), 'S_UCP_ACTION' => $this->u_action . "&action=$action&g=$group_id", - 'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024))) - ); + 'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], $config['avatar_filesize'] / 1024), + )); break; @@ -1014,6 +1014,8 @@ class ucp_groups { trigger_error($user->lang[$error] . $return_page); } + + trigger_error($user->lang['GROUP_USERS_ADDED'] . '

      ' . sprintf($user->lang['RETURN_PAGE'], '', '')); } else { @@ -1028,7 +1030,7 @@ class ucp_groups confirm_box(false, sprintf($user->lang['GROUP_CONFIRM_ADD_USER' . ((sizeof($name_ary) == 1) ? '' : 'S')], implode(', ', $name_ary)), build_hidden_fields($s_hidden_fields)); } - trigger_error($user->lang['GROUP_USERS_ADDED'] . '

      ' . sprintf($user->lang['RETURN_PAGE'], '', '')); + trigger_error($user->lang['NO_USERS_ADDED'] . '

      ' . sprintf($user->lang['RETURN_PAGE'], '', '')); break; diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 0f3cc218c3..8aacf8a244 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -594,8 +594,8 @@ class ucp_profile 'S_FORM_ENCTYPE' => ($can_upload) ? ' enctype="multipart/form-data"' : '', - 'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024)),) - ); + 'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], $config['avatar_filesize'] / 1024), + )); if ($display_gallery && $auth->acl_get('u_chgavatar') && $config['allow_avatar_local']) { diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index f1544c931a..7a2adf8ffd 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -1218,7 +1218,7 @@ class install_convert extends module $template->assign_block_vars('checks', array( 'TITLE' => "skip_rows = $skip_rows", - 'RESULT' => $rows . ((defined('DEBUG_EXTRA') && function_exists('memory_get_usage')) ? ceil(memory_get_usage()/1024) . ' KB' : ''), + 'RESULT' => $rows . ((defined('DEBUG_EXTRA') && function_exists('memory_get_usage')) ? ceil(memory_get_usage()/1024) . ' ' . $user->lang['KIB'] : ''), )); $mtime = explode(' ', microtime()); @@ -1489,7 +1489,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') && function_exists('memory_get_usage')) ? ' [' . 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) . ' ' . $user->lang['KIB'] . ']' : ''), 'RESULT' => $user->lang['DONE'], )); diff --git a/phpBB/language/en/acp/groups.php b/phpBB/language/en/acp/groups.php index f73bf063a6..714cbe7f0d 100644 --- a/phpBB/language/en/acp/groups.php +++ b/phpBB/language/en/acp/groups.php @@ -107,6 +107,7 @@ $lang = array_merge($lang, array( 'NO_GROUPS_CREATED' => 'No groups created yet.', 'NO_PERMISSIONS' => 'Do not copy permissions', 'NO_USERS' => 'You haven’t entered any users.', + 'NO_USERS_ADDED' => 'No users were added to the group.', 'SPECIAL_GROUPS' => 'Pre-defined groups', 'SPECIAL_GROUPS_EXPLAIN' => 'Pre-defined groups are special groups, they cannot be deleted or directly modified. However you can still add users and alter basic settings.', diff --git a/phpBB/language/en/acp/users.php b/phpBB/language/en/acp/users.php index 408afc4c5b..0217238a0d 100644 --- a/phpBB/language/en/acp/users.php +++ b/phpBB/language/en/acp/users.php @@ -44,10 +44,10 @@ $lang = array_merge($lang, array( 'CANNOT_BAN_FOUNDER' => 'You are not allowed to ban founder accounts.', 'CANNOT_BAN_YOURSELF' => 'You are not allowed to ban yourself.', - 'CANNOT_DEACTIVATE_BOT' => 'You are not allowed to deactivate bot accounts. Please deactivate the bot instead.', + 'CANNOT_DEACTIVATE_BOT' => 'You are not allowed to deactivate bot accounts. Please deactivate the bot within the bots page instead.', 'CANNOT_DEACTIVATE_FOUNDER' => 'You are not allowed to deactivate founder accounts.', 'CANNOT_DEACTIVATE_YOURSELF' => 'You are not allowed to deactivate your own account.', - 'CANNOT_FORCE_REACT_BOT' => 'You are not allowed to force reactivation on bot accounts. Please deactivate the bot instead.', + 'CANNOT_FORCE_REACT_BOT' => 'You are not allowed to force reactivation on bot accounts. Please deactivate the bot within the bots page instead.', 'CANNOT_FORCE_REACT_FOUNDER' => 'You are not allowed to force reactivation on founder accounts.', 'CANNOT_FORCE_REACT_YOURSELF' => 'You are not allowed to force reactivation of your own account.', 'CANNOT_REMOVE_ANONYMOUS' => 'You are not able to remove the guest user account.', diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index f7e672e22b..8e739206c5 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -278,6 +278,7 @@ $lang = array_merge($lang, array( 'JUMP_TO_PAGE' => 'Click to jump to page…', 'KB' => 'KB', + 'KIB' => 'KiB', 'LAST_POST' => 'Last post', 'LAST_UPDATED' => 'Last updated', @@ -311,6 +312,7 @@ $lang = array_merge($lang, array( 'MARK_ALL' => 'Mark all', 'MARK_FORUMS_READ' => 'Mark forums read', 'MB' => 'MB', + 'MIB' => 'MiB', 'MCP' => 'Moderator Control Panel', 'MEMBERLIST' => 'Members', 'MEMBERLIST_EXPLAIN' => 'View complete list of members', diff --git a/phpBB/language/en/memberlist.php b/phpBB/language/en/memberlist.php index a278eb1306..ad4dd83ca4 100644 --- a/phpBB/language/en/memberlist.php +++ b/phpBB/language/en/memberlist.php @@ -84,7 +84,7 @@ $lang = array_merge($lang, array( 'IM_MSNM_CONNECT' => 'MSNM is not connected.\nYou have to connect to MSNM to continue.', 'IM_NAME' => 'Your Name', 'IM_NO_DATA' => 'There is no suitable contact information for this user.', - 'IM_NO_JABBER' => 'Sorry, direct messaging of Jabber users is not supported on this server. You will need a Jabber client installed on your system to contact the recipient above.', + 'IM_NO_JABBER' => 'Sorry, direct messaging of Jabber users is not supported on this board. You will need a Jabber client installed on your system to contact the recipient above.', 'IM_RECIPIENT' => 'Recipient', 'IM_SEND' => 'Send message', 'IM_SEND_MESSAGE' => 'Send message', diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index d7006549ce..dfeb1f20dd 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -88,7 +88,7 @@ $lang = array_merge($lang, array( 'ATTACHMENTS_DELETED' => 'Attachments successfully deleted.', 'ATTACHMENT_DELETED' => 'Attachment successfully deleted.', 'AVATAR_CATEGORY' => 'Category', - 'AVATAR_EXPLAIN' => 'Maximum dimensions; width: %1$d pixels, height: %2$d pixels, file size: %3$dkB.', + 'AVATAR_EXPLAIN' => 'Maximum dimensions; width: %1$d pixels, height: %2$d pixels, file size: %3$.2lf KiB.', 'AVATAR_FEATURES_DISABLED' => 'The avatar functionality is currently disabled.', 'AVATAR_GALLERY' => 'Local gallery', 'AVATAR_GENERAL_UPLOAD_ERROR' => 'Could not upload avatar to %s.', diff --git a/phpBB/styles/prosilver/template/mcp_topic.html b/phpBB/styles/prosilver/template/mcp_topic.html index 122f861fd7..4ffd7dd4f1 100644 --- a/phpBB/styles/prosilver/template/mcp_topic.html +++ b/phpBB/styles/prosilver/template/mcp_topic.html @@ -66,7 +66,7 @@ onload_functions.push('subPanels()');
      -
      +
      From 2003152c8dd9c760135ec831b49e41adcfd02142 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 23 Feb 2008 14:06:46 +0000 Subject: [PATCH 051/102] - Remove left join for query used to retrieve already assigned users and groups within permission panel - #20235 - also test the serialize/unserialize approach for cached roles git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8390 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 2 +- phpBB/includes/acp/acp_permissions.php | 95 +++++++++++++------------- phpBB/includes/acp/auth.php | 2 +- phpBB/includes/auth.php | 18 +++-- 4 files changed, 65 insertions(+), 52 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index e55708cfb5..34686de59f 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -125,7 +125,7 @@
    159. [Fix] Custom BBCode {EMAIL}-Token usage (Bug #21155)
    160. [Fix] Do not rely on parameter returned by unlink() for verifying cache directory write permission (Bug #19565)
    161. [Change] Use correct string for filesize (MiB instead of MB for example)
    162. - +
    163. [Change] Remove left join for query used to retrieve already assigned users and groups within permission panel (Bug #20235)
    164. 1.i. Changes since 3.0.RC8

      diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index a19a350646..a9e64b74ae 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -124,7 +124,7 @@ class acp_permissions $forum_id = array(); while ($row = $db->sql_fetchrow($result)) { - $forum_id[] = $row['forum_id']; + $forum_id[] = (int) $row['forum_id']; } $db->sql_freeresult($result); } @@ -133,7 +133,7 @@ class acp_permissions $forum_id = array(); foreach (get_forum_branch($subforum_id, 'children') as $row) { - $forum_id[] = $row['forum_id']; + $forum_id[] = (int) $row['forum_id']; } } @@ -598,7 +598,7 @@ class acp_permissions $ids = array(); while ($row = $db->sql_fetchrow($result)) { - $ids[] = $row[$sql_id]; + $ids[] = (int) $row[$sql_id]; } $db->sql_freeresult($result); } @@ -1117,31 +1117,51 @@ class acp_permissions global $db, $user; $sql_forum_id = ($permission_scope == 'global') ? 'AND a.forum_id = 0' : ((sizeof($forum_id)) ? 'AND ' . $db->sql_in_set('a.forum_id', $forum_id) : 'AND a.forum_id <> 0'); - $sql_permission_option = ' AND o.auth_option ' . $db->sql_like_expression($permission_type . $db->any_char); - - $sql = $db->sql_build_query('SELECT_DISTINCT', array( - 'SELECT' => 'u.username, u.username_clean, u.user_regdate, u.user_id', - 'FROM' => array( - USERS_TABLE => 'u', - ACL_OPTIONS_TABLE => 'o', - ACL_USERS_TABLE => 'a' - ), + // Permission options are only able to be a permission set... therefore we will pre-fetch the possible options and also the possible roles + $option_ids = $role_ids = array(); - 'LEFT_JOIN' => array( - array( - 'FROM' => array(ACL_ROLES_DATA_TABLE => 'r'), - 'ON' => 'a.auth_role_id = r.role_id' - ) - ), + $sql = 'SELECT auth_option_id + FROM ' . ACL_OPTIONS_TABLE . ' + WHERE auth_option ' . $db->sql_like_expression($permission_type . $db->any_char); + $result = $db->sql_query($sql); - 'WHERE' => "(a.auth_option_id = o.auth_option_id OR r.auth_option_id = o.auth_option_id) - $sql_permission_option + while ($row = $db->sql_fetchrow($result)) + { + $option_ids[] = (int) $row['auth_option_id']; + } + $db->sql_freeresult($result); + + if (sizeof($option_ids)) + { + $sql = 'SELECT DISTINCT role_id + FROM ' . ACL_ROLES_DATA_TABLE . ' + WHERE ' . $db->sql_in_set('auth_option_id', $option_ids); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $role_ids[] = (int) $row['role_id']; + } + $db->sql_freeresult($result); + } + + if (sizeof($option_ids) && sizeof($role_ids)) + { + $sql_where = 'AND (' . $db->sql_in_set('a.auth_option_id', $option_ids) . ' OR ' . $db->sql_in_set('a.auth_role_id', $role_ids) . ')'; + } + else + { + $sql_where = 'AND ' . $db->sql_in_set('a.auth_option_id', $option_ids); + } + + // Not ideal, due to the filesort, non-use of indexes, etc. + $sql = 'SELECT DISTINCT u.user_id, u.username + FROM ' . USERS_TABLE . ' u, ' . ACL_USERS_TABLE . " a + WHERE u.user_id = a.user_id $sql_forum_id - AND u.user_id = a.user_id", - - 'ORDER_BY' => 'u.username_clean, u.user_regdate ASC' - )); + $sql_where + ORDER BY u.username_clean, u.user_regdate ASC"; $result = $db->sql_query($sql); $s_defined_user_options = ''; @@ -1153,29 +1173,12 @@ class acp_permissions } $db->sql_freeresult($result); - $sql = $db->sql_build_query('SELECT_DISTINCT', array( - 'SELECT' => 'g.group_type, g.group_name, g.group_id', - - 'FROM' => array( - GROUPS_TABLE => 'g', - ACL_OPTIONS_TABLE => 'o', - ACL_GROUPS_TABLE => 'a' - ), - - 'LEFT_JOIN' => array( - array( - 'FROM' => array(ACL_ROLES_DATA_TABLE => 'r'), - 'ON' => 'a.auth_role_id = r.role_id' - ) - ), - - 'WHERE' => "(a.auth_option_id = o.auth_option_id OR r.auth_option_id = o.auth_option_id) - $sql_permission_option + $sql = 'SELECT DISTINCT g.group_type, g.group_name, g.group_id + FROM ' . GROUPS_TABLE . ' g, ' . ACL_GROUPS_TABLE . " a + WHERE g.group_id = a.group_id $sql_forum_id - AND g.group_id = a.group_id", - - 'ORDER_BY' => 'g.group_type DESC, g.group_name ASC' - )); + $sql_where + ORDER BY g.group_type DESC, g.group_name ASC"; $result = $db->sql_query($sql); $s_defined_group_options = ''; diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index 71872ceb6a..6943f5ada1 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -113,7 +113,7 @@ class auth_admin extends auth while ($row = $db->sql_fetchrow($result)) { - $forum_ids[] = $row['forum_id']; + $forum_ids[] = (int) $row['forum_id']; } $db->sql_freeresult($result); } diff --git a/phpBB/includes/auth.php b/phpBB/includes/auth.php index 03f2a92ef8..8dd15fea64 100644 --- a/phpBB/includes/auth.php +++ b/phpBB/includes/auth.php @@ -453,10 +453,15 @@ class auth $this->role_cache = array(); while ($row = $db->sql_fetchrow($result)) { - $this->role_cache[$row['role_id']][$row['auth_option_id']] = (bool) $row['auth_setting']; + $this->role_cache[$row['role_id']][$row['auth_option_id']] = (int) $row['auth_setting']; } $db->sql_freeresult($result); + foreach ($this->role_cache as $role_id => $role_options) + { + $this->role_cache[$role_id] = serialize($role_options); + } + $cache->put('_role_cache', $this->role_cache); // Now empty user permissions @@ -747,10 +752,15 @@ class auth while ($row = $db->sql_fetchrow($result)) { - $this->role_cache[$row['role_id']][$row['auth_option_id']] = (bool) $row['auth_setting']; + $this->role_cache[$row['role_id']][$row['auth_option_id']] = (int) $row['auth_setting']; } $db->sql_freeresult($result); + foreach ($this->role_cache as $role_id => $role_options) + { + $this->role_cache[$role_id] = serialize($role_options); + } + $cache->put('_role_cache', $this->role_cache); } @@ -767,7 +777,7 @@ class auth // If a role is assigned, assign all options included within this role. Else, only set this one option. if ($row['auth_role_id']) { - $hold_ary[$row['forum_id']] = (empty($hold_ary[$row['forum_id']])) ? $this->role_cache[$row['auth_role_id']] : $hold_ary[$row['forum_id']] + $this->role_cache[$row['auth_role_id']]; + $hold_ary[$row['forum_id']] = (empty($hold_ary[$row['forum_id']])) ? unserialize($this->role_cache[$row['auth_role_id']]) : $hold_ary[$row['forum_id']] + unserialize($this->role_cache[$row['auth_role_id']]); } else { @@ -792,7 +802,7 @@ class auth } else { - foreach ($this->role_cache[$row['auth_role_id']] as $option_id => $setting) + foreach (unserialize($this->role_cache[$row['auth_role_id']]) as $option_id => $setting) { $this->_set_group_hold_ary($hold_ary[$row['forum_id']], $option_id, $setting); } From 2092f07c544b0a44aba085216eeadc84be5cec5d Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 23 Feb 2008 15:03:50 +0000 Subject: [PATCH 052/102] Correctly return sole whitespaces if used with BBCodes - #19535 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8392 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/message_parser.php | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 34686de59f..36c52a23c8 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -126,6 +126,7 @@
    165. [Fix] Do not rely on parameter returned by unlink() for verifying cache directory write permission (Bug #19565)
    166. [Change] Use correct string for filesize (MiB instead of MB for example)
    167. [Change] Remove left join for query used to retrieve already assigned users and groups within permission panel (Bug #20235)
    168. +
    169. [Fix] Correctly return sole whitespaces if used with BBCodes (Bug #19535)
    170. 1.i. Changes since 3.0.RC8

      diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 9e4b075818..e78fc271a6 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -198,7 +198,7 @@ class bbcode_firstpass extends bbcode if (!$this->check_bbcode('size', $in)) { - return ''; + return $in; } if ($config['max_' . $this->mode . '_font_size'] && $config['max_' . $this->mode . '_font_size'] < $stx) @@ -224,7 +224,7 @@ class bbcode_firstpass extends bbcode { if (!$this->check_bbcode('color', $in)) { - return ''; + return $in; } return '[color=' . $stx . ':' . $this->bbcode_uid . ']' . $in . '[/color:' . $this->bbcode_uid . ']'; @@ -237,7 +237,7 @@ class bbcode_firstpass extends bbcode { if (!$this->check_bbcode('u', $in)) { - return ''; + return $in; } return '[u:' . $this->bbcode_uid . ']' . $in . '[/u:' . $this->bbcode_uid . ']'; @@ -250,7 +250,7 @@ class bbcode_firstpass extends bbcode { if (!$this->check_bbcode('b', $in)) { - return ''; + return $in; } return '[b:' . $this->bbcode_uid . ']' . $in . '[/b:' . $this->bbcode_uid . ']'; @@ -263,7 +263,7 @@ class bbcode_firstpass extends bbcode { if (!$this->check_bbcode('i', $in)) { - return ''; + return $in; } return '[i:' . $this->bbcode_uid . ']' . $in . '[/i:' . $this->bbcode_uid . ']'; @@ -278,7 +278,7 @@ class bbcode_firstpass extends bbcode if (!$this->check_bbcode('img', $in)) { - return ''; + return $in; } $in = trim($in); @@ -340,7 +340,7 @@ class bbcode_firstpass extends bbcode if (!$this->check_bbcode('flash', $in)) { - return ''; + return $in; } $in = trim($in); @@ -377,7 +377,7 @@ class bbcode_firstpass extends bbcode { if (!$this->check_bbcode('attachment', $in)) { - return ''; + return $in; } return '[attachment=' . $stx . ':' . $this->bbcode_uid . ']' . trim($in) . '[/attachment:' . $this->bbcode_uid . ']'; @@ -457,7 +457,7 @@ class bbcode_firstpass extends bbcode { if (!$this->check_bbcode('code', $in)) { - return ''; + return $in; } // We remove the hardcoded elements from the code block here because it is not used in code blocks @@ -550,7 +550,7 @@ class bbcode_firstpass extends bbcode { if (!$this->check_bbcode('list', $in)) { - return ''; + return $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 From 7ea118198e3af9f6ff97c883a75b38bef2fc3881 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 23 Feb 2008 15:29:38 +0000 Subject: [PATCH 053/102] - Fix quote bbcode parsing adding too much closing tags on special conditions - #20735 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8393 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/message_parser.php | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 36c52a23c8..677ace42fe 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -127,6 +127,7 @@
    171. [Change] Use correct string for filesize (MiB instead of MB for example)
    172. [Change] Remove left join for query used to retrieve already assigned users and groups within permission panel (Bug #20235)
    173. [Fix] Correctly return sole whitespaces if used with BBCodes (Bug #19535)
    174. +
    175. [Fix] Quote bbcode parsing adding too much closing tags on special conditions (Bug #20735)
    176. 1.i. Changes since 3.0.RC8

      diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index e78fc271a6..41e7bc51d7 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -684,7 +684,8 @@ class bbcode_firstpass extends bbcode * #14667 - [quote]test[/quote] test ] and [ test [quote]test[/quote] (correct: parsed) * #14770 - [quote="["]test[/quote] (correct: parsed) * [quote="[i]test[/i]"]test[/quote] (correct: parsed) - * [quote="[quote]test[/quote]"]test[/quote] (correct: NOT parsed) + * [quote="[quote]test[/quote]"]test[/quote] (correct: parsed - Username displayed as [quote]test[/quote]) + * #20735 - [quote]test[/[/b]quote] test [/quote][/quote] test - (correct: quoted: "test[/[/b]quote] test" / non-quoted: "[/quote] test" - also failed if layout distorted) */ $in = str_replace("\r\n", "\n", str_replace('\"', '"', trim($in))); @@ -737,7 +738,7 @@ class bbcode_firstpass extends bbcode $out .= ' '; }*/ } - else if (preg_match('#^quote(?:="(.*?)")?$#is', $buffer, $m)) + else if (preg_match('#^quote(?:="(.*?)")?$#is', $buffer, $m) && substr($out, -1, 1) == '[') { $this->parsed_items['quote']++; From a7ad9b5ae2e145a88d2acb0917162a3973337530 Mon Sep 17 00:00:00 2001 From: Vic D'Elfant Date: Sun, 24 Feb 2008 14:38:35 +0000 Subject: [PATCH 054/102] #22035 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8395 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 18 ++++++++++ phpBB/install/schemas/schema_data.sql | 50 +++++++++++++-------------- 2 files changed, 43 insertions(+), 25 deletions(-) diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 7eeca7dbb8..73e4ad548c 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1567,7 +1567,25 @@ if (version_compare($current_version, '3.0.0', '<=')) WHERE topic_last_view_time = 0"; _sql($sql, $errored, $error_ary); + // Update smiley sizes + $smileys = array('icon_e_surprised.gif','icon_cool.gif', 'icon_lol.gif', 'icon_mad.gif', 'icon_razz.gif', 'icon_redface.gif', 'icon_cry.gif', 'icon_evil.gif', 'icon_twisted.gif', 'icon_rolleyes.gif', 'icon_exclaim.gif', 'icon_question.gif', 'icon_idea.gif', 'icon_arrow.gif', 'icon_neutral.gif', 'icon_mrgreen.gif', 'icon_e_ugeek.gif'); + foreach ($smileys as $smiley) + { + if (file_exists($phpbb_root_path . 'images/smilies/' . $smiley)) + { + list($width, $height) = getimagesize($phpbb_root_path . 'images/smilies/' . $smiley); + + $sql = 'UPDATE ' . SMILIES_TABLE . ' + SET smiley_width = ' . $width . ', smiley_height = ' . $height . " + WHERE smiley_url = '" . $db->sql_escape($smiley) . "'"; + + _sql($sql, $errored, $error_ary); + } + } + // TODO: remove all form token min times + + $no_updates = false; } _write_result($no_updates, $errored, $error_ary); diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 81b0805a8d..eb9b16841c 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -643,36 +643,36 @@ INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_heigh INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':(', 'icon_e_sad.gif', '{L_SMILIES_SAD}', 15, 17, 10); INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-(', 'icon_e_sad.gif', '{L_SMILIES_SAD}', 15, 17, 11); INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':sad:', 'icon_e_sad.gif', '{L_SMILIES_SAD}', 15, 17, 12); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':o', 'icon_e_surprised.gif', '{L_SMILIES_SURPRISED}', 15, 19, 13); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-o', 'icon_e_surprised.gif', '{L_SMILIES_SURPRISED}', 15, 19, 14); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':eek:', 'icon_e_surprised.gif', '{L_SMILIES_SURPRISED}', 15, 19, 15); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':o', 'icon_e_surprised.gif', '{L_SMILIES_SURPRISED}', 15, 17, 13); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-o', 'icon_e_surprised.gif', '{L_SMILIES_SURPRISED}', 15, 17, 14); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':eek:', 'icon_e_surprised.gif', '{L_SMILIES_SURPRISED}', 15, 17, 15); INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':shock:', 'icon_eek.gif', '{L_SMILIES_SHOCKED}', 15, 15, 16); INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':?', 'icon_e_confused.gif', '{L_SMILIES_CONFUSED}', 15, 17, 17); INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-?', 'icon_e_confused.gif', '{L_SMILIES_CONFUSED}', 15, 17, 18); INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':???:', 'icon_e_confused.gif', '{L_SMILIES_CONFUSED}', 15, 17, 19); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES ('8-)', 'icon_cool.gif', '{L_SMILIES_COOL}', 15, 15, 20); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':cool:', 'icon_cool.gif', '{L_SMILIES_COOL}', 15, 15, 21); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':lol:', 'icon_lol.gif', '{L_SMILIES_LAUGHING}', 15, 15, 22); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':x', 'icon_mad.gif', '{L_SMILIES_MAD}', 15, 15, 23); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-x', 'icon_mad.gif', '{L_SMILIES_MAD}', 15, 15, 24); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':mad:', 'icon_mad.gif', '{L_SMILIES_MAD}', 15, 15, 25); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':P', 'icon_razz.gif', '{L_SMILIES_RAZZ}', 15, 15, 26); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-P', 'icon_razz.gif', '{L_SMILIES_RAZZ}', 15, 15, 27); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':razz:', 'icon_razz.gif', '{L_SMILIES_RAZZ}', 15, 15, 28); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':oops:', 'icon_redface.gif', '{L_SMILIES_EMARRASSED}', 15, 15, 29); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':cry:', 'icon_cry.gif', '{L_SMILIES_CRYING}', 15, 15, 30); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':evil:', 'icon_evil.gif', '{L_SMILIES_EVIL}', 15, 15, 31); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':twisted:', 'icon_twisted.gif', '{L_SMILIES_TWISTED_EVIL}', 15, 15, 32); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':roll:', 'icon_rolleyes.gif', '{L_SMILIES_ROLLING_EYES}', 15, 15, 33); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':!:', 'icon_exclaim.gif', '{L_SMILIES_EXCLAMATION}', 15, 15, 34); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':?:', 'icon_question.gif', '{L_SMILIES_QUESTION}', 15, 15, 35); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':idea:', 'icon_idea.gif', '{L_SMILIES_IDEA}', 15, 15, 36); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':arrow:', 'icon_arrow.gif', '{L_SMILIES_ARROW}', 15, 15, 37); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':|', 'icon_neutral.gif', '{L_SMILIES_NEUTRAL}', 15, 15, 38); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-|', 'icon_neutral.gif', '{L_SMILIES_NEUTRAL}', 15, 15, 39); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':mrgreen:', 'icon_mrgreen.gif', '{L_SMILIES_MR_GREEN}', 15, 15, 40); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES ('8-)', 'icon_cool.gif', '{L_SMILIES_COOL}', 15, 17, 20); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':cool:', 'icon_cool.gif', '{L_SMILIES_COOL}', 15, 17, 21); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':lol:', 'icon_lol.gif', '{L_SMILIES_LAUGHING}', 15, 17, 22); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':x', 'icon_mad.gif', '{L_SMILIES_MAD}', 15, 17, 23); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-x', 'icon_mad.gif', '{L_SMILIES_MAD}', 15, 17, 24); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':mad:', 'icon_mad.gif', '{L_SMILIES_MAD}', 15, 17, 25); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':P', 'icon_razz.gif', '{L_SMILIES_RAZZ}', 15, 17, 26); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-P', 'icon_razz.gif', '{L_SMILIES_RAZZ}', 15, 17, 27); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':razz:', 'icon_razz.gif', '{L_SMILIES_RAZZ}', 15, 17, 28); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':oops:', 'icon_redface.gif', '{L_SMILIES_EMARRASSED}', 15, 17, 29); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':cry:', 'icon_cry.gif', '{L_SMILIES_CRYING}', 15, 17, 30); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':evil:', 'icon_evil.gif', '{L_SMILIES_EVIL}', 15, 17, 31); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':twisted:', 'icon_twisted.gif', '{L_SMILIES_TWISTED_EVIL}', 15, 17, 32); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':roll:', 'icon_rolleyes.gif', '{L_SMILIES_ROLLING_EYES}', 15, 17, 33); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':!:', 'icon_exclaim.gif', '{L_SMILIES_EXCLAMATION}', 15, 17, 34); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':?:', 'icon_question.gif', '{L_SMILIES_QUESTION}', 15, 17, 35); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':idea:', 'icon_idea.gif', '{L_SMILIES_IDEA}', 15, 17, 36); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':arrow:', 'icon_arrow.gif', '{L_SMILIES_ARROW}', 15, 17, 37); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':|', 'icon_neutral.gif', '{L_SMILIES_NEUTRAL}', 15, 17, 38); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-|', 'icon_neutral.gif', '{L_SMILIES_NEUTRAL}', 15, 17, 39); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':mrgreen:', 'icon_mrgreen.gif', '{L_SMILIES_MR_GREEN}', 15, 17, 40); INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':geek:', 'icon_e_geek.gif', '{L_SMILIES_GEEK}', 17, 17, 41); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':ugeek:', 'icon_e_ugeek.gif', '{L_SMILIES_UBER_GEEK}', 19, 18, 42); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':ugeek:', 'icon_e_ugeek.gif', '{L_SMILIES_UBER_GEEK}', 17, 18, 42); # -- icons INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('misc/fire.gif', 16, 16, 1, 1); From b4ca6fdc4e322470f3dae9eb98c3595a841fcb77 Mon Sep 17 00:00:00 2001 From: Vic D'Elfant Date: Mon, 25 Feb 2008 13:04:49 +0000 Subject: [PATCH 055/102] This will prevent a php warning from being printed (and the layout getting ruined) in case of a conflicting permission restriction such as open_basedir git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8400 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 7a2adf8ffd..081b1a6c31 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -407,7 +407,7 @@ class install_convert extends module $error = array(); if ($submit) { - if (!file_exists('./../' . $forum_path . '/' . $test_file)) + if (!@file_exists('./../' . $forum_path . '/' . $test_file)) { $error[] = sprintf($lang['COULD_NOT_FIND_PATH'], $forum_path); } From d6d2373582f831845fa8238cea31d73cc6f7d972 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 25 Feb 2008 18:39:05 +0000 Subject: [PATCH 056/102] allow search backends to handle regular updates too, and not just backend switches git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8402 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_search.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/phpBB/includes/acp/acp_search.php b/phpBB/includes/acp/acp_search.php index 67a3c6bf6f..cfe657491d 100644 --- a/phpBB/includes/acp/acp_search.php +++ b/phpBB/includes/acp/acp_search.php @@ -183,6 +183,17 @@ class acp_search } } + if ($updated) + { + if (method_exists($search, 'config_updated')) + { + if ($search->config_updated()) + { + trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING); + } + } + } + trigger_error($user->lang['CONFIG_UPDATED'] . $extra_message . adm_back_link($this->u_action)); } unset($cfg_array); From eaf97f2a672af99f9704171ecedc5676cf3dad7b Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 26 Feb 2008 17:13:21 +0000 Subject: [PATCH 057/102] guess we need to initialise it first git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8405 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_search.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/acp/acp_search.php b/phpBB/includes/acp/acp_search.php index cfe657491d..dc6f3d1c44 100644 --- a/phpBB/includes/acp/acp_search.php +++ b/phpBB/includes/acp/acp_search.php @@ -183,16 +183,25 @@ class acp_search } } - if ($updated) + $search = null; + $error = false; + if (!$this->init_search($config['search_type'], $search, $error)) { - if (method_exists($search, 'config_updated')) + if ($updated) { - if ($search->config_updated()) + if (method_exists($search, 'config_updated')) { - trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING); + if ($search->config_updated()) + { + trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING); + } } } } + else + { + trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING); + } trigger_error($user->lang['CONFIG_UPDATED'] . $extra_message . adm_back_link($this->u_action)); } From 30f32e8bb7e3f1c36d4931c3a9fc263f00aa1f4d Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Wed, 27 Feb 2008 15:09:04 +0000 Subject: [PATCH 058/102] Adding new validation options for ACP values git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8406 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/index.php | 100 +++++++++++++++++++++++++++++-- phpBB/language/en/acp/common.php | 5 ++ 2 files changed, 99 insertions(+), 6 deletions(-) diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index 0932e01aa1..c577cefacd 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -367,33 +367,61 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars) } /** -* Going through a config array and validate values, writing errors to $error. +* Going through a config array and validate values, writing errors to $error. The validation method accepts parameters separated by ':' for string and int. +* The first parameter defines the type to be used, the second the lower bound and the third the upper bound. Only the type is required. */ function validate_config_vars($config_vars, &$cfg_array, &$error) { global $phpbb_root_path, $user; - + $type = 0; + $min = 1; + $max = 2; + foreach ($config_vars as $config_name => $config_definition) { if (!isset($cfg_array[$config_name]) || strpos($config_name, 'legend') !== false) { continue; } - + if (!isset($config_definition['validate'])) { continue; } - - // Validate a bit. ;) String is already checked through request_var(), therefore we do not check this again - switch ($config_definition['validate']) + + $validator = explode(':', $config_definition['validate']); + // Validate a bit. ;) (0 = type, 1 = min, 2= max) + switch ($validator[$type]) { + case 'string': + $length = strlen($cfg_array[$config_name]); + // the column is a VARCHAR + $validator[$max] = (isset($validator[$max])) ? min(255, $validator[$max]) : 255; + if (isset($validator[$min]) && $length < $validator[$min]) + { + $error[] = sprintf($user->lang['SETTING_TOO_SHORT'], $user->lang[$config_definition['lang']], $validator[$min]); + } + else if (isset($validator[$max]) && $length > $validator[2]) + { + $error[] = sprintf($user->lang['SETTING_TOO_LONG'], $user->lang[$config_definition['lang']], $validator[$max]); + } + break; + case 'bool': $cfg_array[$config_name] = ($cfg_array[$config_name]) ? 1 : 0; break; case 'int': $cfg_array[$config_name] = (int) $cfg_array[$config_name]; + + if (isset($validator[$min]) && $cfg_array[$config_name] < $validator[$min]) + { + $error[] = sprintf($user->lang['SETTING_TOO_LOW'], $user->lang[$config_definition['lang']], $validator[$min]); + } + else if (isset($validator[$max]) && $cfg_array[$config_name] > $validator[$max]) + { + $error[] = sprintf($user->lang['SETTING_TOO_BIG'], $user->lang[$config_definition['lang']], $validator[$max]); + } break; // Absolute path @@ -508,4 +536,64 @@ function validate_config_vars($config_vars, &$cfg_array, &$error) return; } +/** +* Checks whatever or not a variable is OK for use in the Database +* param mixed $value_ary An array of the form array(array('lang' => ..., 'value' => ..., 'column_type' =>))' +* param mixed $error The error array +*/ +function validate_range($value_ary, &$error) +{ + global $user; + + $column_types = array( + 'BOOL' => array('php_type' => 'int', 'min' => 0, 'max' => 1), + 'USINT' => array('php_type' => 'int', 'min' => 0, 'max' => 65535), + 'UINT' => array('php_type' => 'int', 'min' => 0, 'max' => (int) 0x7fffffff), + 'INT' => array('php_type' => 'int', 'min' => (int) 0x80000000, 'max' => (int) 0x7fffffff), + 'TINT' => array('php_type' => 'int', 'min' => -128, 'max' => 127), + + 'VCHAR' => array('php_type' => 'string', 'min' => 0, 'max' => 255), + ); + foreach ($value_ary as $value) + { + $column = explode(':', $value['column_type']); + $max = $min = 0; + $type = 0; + if (!isset($column_types[$column[0]])) + { + continue; + } + else + { + $type = $column_types[$column[0]]; + } + + switch ($type['php_type']) + { + case 'string' : + $max = (isset($column[1])) ? min($column[1],$type['max']) : $type['max']; + if (strlen($value['value']) > $max) + { + $error[] = sprintf($user->lang['SETTING_TOO_LONG'], $user->lang[$value['lang']], $max); + } + + break; + + case 'int': + $min = (isset($column[1])) ? max($column[1],$type['min']) : $type['min']; + $max = (isset($column[2])) ? min($column[2],$type['max']) : $type['max']; + if ($value['value'] < $min) + { + $error[] = sprintf($user->lang['SETTING_TOO_LOW'], $user->lang[$value['lang']], $min); + } + else if ($value['value'] > $max) + { + $error[] = sprintf($user->lang['SETTING_TOO_BIG'], $user->lang[$value['lang']], $max); + } + break; + } + } + +} + ?> \ No newline at end of file diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 0c6014bc24..c3f884bc8e 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -262,6 +262,11 @@ $lang = array_merge($lang, array( 'SELECT_ANONYMOUS' => 'Select anonymous user', 'SELECT_OPTION' => 'Select option', + 'SETTING_TOO_LOW' => 'The entered value for the setting %s is too low. The minimal allowed value is %d.', + 'SETTING_TOO_BIG' => 'The entered value for the setting %s is too big. The maximal allowed value is %d.', + 'SETTING_TOO_LONG' => 'The entered value for the setting %s is too long. The maximal allowed length is %d.', + 'SETTING_TOO_SHORT' => 'The entered value for the setting %s is not long enough. The minimal allowed length is %d.', + 'UCP' => 'User Control Panel', 'USERNAMES_EXPLAIN' => 'Place each username on a separate line.', 'USER_CONTROL_PANEL' => 'User Control Panel', From 0a37e9a929f94e46564f8fe97bb419b1ce7e324d Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Wed, 27 Feb 2008 15:10:10 +0000 Subject: [PATCH 059/102] Using new validation options; #15539 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8407 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_board.php | 89 +++++++++++++++---------------- phpBB/includes/acp/acp_forums.php | 7 +++ 2 files changed, 50 insertions(+), 46 deletions(-) diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 455719110e..ed7fb69d73 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -107,9 +107,9 @@ class acp_board 'allow_avatar_local' => array('lang' => 'ALLOW_LOCAL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'allow_avatar_remote' => array('lang' => 'ALLOW_REMOTE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'allow_avatar_upload' => array('lang' => 'ALLOW_UPLOAD', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), - 'avatar_filesize' => array('lang' => 'MAX_FILESIZE', 'validate' => 'int', 'type' => 'text:4:10', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']), - 'avatar_min' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), - 'avatar_max' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), + 'avatar_filesize' => array('lang' => 'MAX_FILESIZE', 'validate' => 'int:0', 'type' => 'text:4:10', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']), + 'avatar_min' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int:0', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), + 'avatar_max' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int:0', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), 'avatar_path' => array('lang' => 'AVATAR_STORAGE_PATH', 'validate' => 'rwpath', 'type' => 'text:20:255', 'explain' => true), 'avatar_gallery_path' => array('lang' => 'AVATAR_GALLERY_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true) ) @@ -123,10 +123,10 @@ class acp_board 'vars' => array( 'legend1' => 'GENERAL_SETTINGS', 'allow_privmsg' => array('lang' => 'BOARD_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), - 'pm_max_boxes' => array('lang' => 'BOXES_MAX', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true), - 'pm_max_msgs' => array('lang' => 'BOXES_LIMIT', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true), + 'pm_max_boxes' => array('lang' => 'BOXES_MAX', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true), + 'pm_max_msgs' => array('lang' => 'BOXES_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true), 'full_folder_action' => array('lang' => 'FULL_FOLDER_ACTION', 'validate' => 'int', 'type' => 'select', 'method' => 'full_folder_select', 'explain' => true), - 'pm_edit_time' => array('lang' => 'PM_EDIT_TIME', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), + 'pm_edit_time' => array('lang' => 'PM_EDIT_TIME', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), 'legend2' => 'GENERAL_OPTIONS', 'allow_mass_pm' => array('lang' => 'ALLOW_MASS_PM', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), @@ -160,21 +160,21 @@ class acp_board 'legend2' => 'POSTING', 'bump_type' => false, - 'edit_time' => array('lang' => 'EDIT_TIME', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), + 'edit_time' => array('lang' => 'EDIT_TIME', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['MINUTES']), 'display_last_edited' => array('lang' => 'DISPLAY_LAST_EDITED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), - 'flood_interval' => array('lang' => 'FLOOD_INTERVAL', 'validate' => 'int', 'type' => 'text:3:10', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']), - 'bump_interval' => array('lang' => 'BUMP_INTERVAL', 'validate' => 'int', 'type' => 'custom', 'method' => 'bump_interval', 'explain' => true), - 'topics_per_page' => array('lang' => 'TOPICS_PER_PAGE', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => false), - 'posts_per_page' => array('lang' => 'POSTS_PER_PAGE', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => false), - 'hot_threshold' => array('lang' => 'HOT_THRESHOLD', 'validate' => 'int', 'type' => 'text:3:4', 'explain' => true), - 'max_poll_options' => array('lang' => 'MAX_POLL_OPTIONS', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => false), - 'max_post_chars' => array('lang' => 'CHAR_LIMIT', 'validate' => 'int', 'type' => 'text:4:6', 'explain' => true), - 'max_post_smilies' => array('lang' => 'SMILIES_LIMIT', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true), - 'max_post_urls' => array('lang' => 'MAX_POST_URLS', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true), - 'max_post_font_size' => array('lang' => 'MAX_POST_FONT_SIZE', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true, 'append' => ' %'), - 'max_quote_depth' => array('lang' => 'QUOTE_DEPTH_LIMIT', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true), - 'max_post_img_width' => array('lang' => 'MAX_POST_IMG_WIDTH', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), - 'max_post_img_height' => array('lang' => 'MAX_POST_IMG_HEIGHT', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), + 'flood_interval' => array('lang' => 'FLOOD_INTERVAL', 'validate' => 'int:0', 'type' => 'text:3:10', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']), + 'bump_interval' => array('lang' => 'BUMP_INTERVAL', 'validate' => 'int:0', 'type' => 'custom', 'method' => 'bump_interval', 'explain' => true), + 'topics_per_page' => array('lang' => 'TOPICS_PER_PAGE', 'validate' => 'int:1', 'type' => 'text:3:4', 'explain' => false), + 'posts_per_page' => array('lang' => 'POSTS_PER_PAGE', 'validate' => 'int:1', 'type' => 'text:3:4', 'explain' => false), + 'hot_threshold' => array('lang' => 'HOT_THRESHOLD', 'validate' => 'int:0', 'type' => 'text:3:4', 'explain' => true), + 'max_poll_options' => array('lang' => 'MAX_POLL_OPTIONS', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => false), + 'max_post_chars' => array('lang' => 'CHAR_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:6', 'explain' => true), + 'max_post_smilies' => array('lang' => 'SMILIES_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true), + 'max_post_urls' => array('lang' => 'MAX_POST_URLS', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true), + 'max_post_font_size' => array('lang' => 'MAX_POST_FONT_SIZE', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' %'), + 'max_quote_depth' => array('lang' => 'QUOTE_DEPTH_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true), + 'max_post_img_width' => array('lang' => 'MAX_POST_IMG_WIDTH', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), + 'max_post_img_height' => array('lang' => 'MAX_POST_IMG_HEIGHT', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), ) ); break; @@ -192,12 +192,12 @@ class acp_board 'allow_sig_links' => array('lang' => 'ALLOW_SIG_LINKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'legend2' => 'GENERAL_SETTINGS', - 'max_sig_chars' => array('lang' => 'MAX_SIG_LENGTH', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true), - 'max_sig_urls' => array('lang' => 'MAX_SIG_URLS', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true), - 'max_sig_font_size' => array('lang' => 'MAX_SIG_FONT_SIZE', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true, 'append' => ' %'), - 'max_sig_smilies' => array('lang' => 'MAX_SIG_SMILIES', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true), - 'max_sig_img_width' => array('lang' => 'MAX_SIG_IMG_WIDTH', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), - 'max_sig_img_height' => array('lang' => 'MAX_SIG_IMG_HEIGHT', 'validate' => 'int', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), + 'max_sig_chars' => array('lang' => 'MAX_SIG_LENGTH', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true), + 'max_sig_urls' => array('lang' => 'MAX_SIG_URLS', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true), + 'max_sig_font_size' => array('lang' => 'MAX_SIG_FONT_SIZE', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' %'), + 'max_sig_smilies' => array('lang' => 'MAX_SIG_SMILIES', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true), + 'max_sig_img_width' => array('lang' => 'MAX_SIG_IMG_WIDTH', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), + 'max_sig_img_height' => array('lang' => 'MAX_SIG_IMG_HEIGHT', 'validate' => 'int:0', 'type' => 'text:5:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']), ) ); break; @@ -207,24 +207,22 @@ class acp_board 'title' => 'ACP_REGISTER_SETTINGS', 'vars' => array( 'legend1' => 'GENERAL_SETTINGS', - 'max_name_chars' => false, - 'max_pass_chars' => false, + 'max_name_chars' => array('lang' => 'USERNAME_LENGTH', 'validate' => 'int:8:180', 'type' => false, 'method' => false, 'explain' => false,), + 'max_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:8:255', 'type' => false, 'method' => false, 'explain' => false,), 'require_activation' => array('lang' => 'ACC_ACTIVATION', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_acc_activation', 'explain' => true), - 'min_name_chars' => array('lang' => 'USERNAME_LENGTH', 'validate' => 'int', 'type' => 'custom', 'method' => 'username_length', 'explain' => true), - 'min_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int', 'type' => 'custom', 'method' => 'password_length', 'explain' => true), + 'min_name_chars' => array('lang' => 'USERNAME_LENGTH', 'validate' => 'int:1', 'type' => 'custom', 'method' => 'username_length', 'explain' => true), + 'min_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:1', 'type' => 'custom', 'method' => 'password_length', 'explain' => true), 'allow_name_chars' => array('lang' => 'USERNAME_CHARS', 'validate' => 'string', 'type' => 'select', 'method' => 'select_username_chars', '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, 'append' => ' ' . $user->lang['DAYS']), + 'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'validate' => 'int:0', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']), 'legend2' => 'GENERAL_OPTIONS', 'allow_namechange' => array('lang' => 'ALLOW_NAME_CHANGE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false), 'allow_emailreuse' => array('lang' => 'ALLOW_EMAIL_REUSE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'enable_confirm' => array('lang' => 'VISUAL_CONFIRM_REG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), - 'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), - 'max_reg_attempts' => array('lang' => 'REG_LIMIT', 'validate' => 'int', 'type' => 'text:4:4', 'explain' => true), - 'min_time_reg' => array('lang' => 'MIN_TIME_REG', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']), - 'min_time_terms' => array('lang' => 'MIN_TIME_TERMS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']), + 'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'validate' => 'int:0', 'type' => 'text:3:3', 'explain' => true), + 'max_reg_attempts' => array('lang' => 'REG_LIMIT', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true), 'legend3' => 'COPPA', 'coppa_enable' => array('lang' => 'ENABLE_COPPA', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), @@ -253,9 +251,9 @@ class acp_board 'vars' => array( 'legend1' => 'GENERAL_SETTINGS', 'limit_load' => array('lang' => 'LIMIT_LOAD', 'validate' => 'string', 'type' => 'text:4:4', 'explain' => true), - 'session_length' => array('lang' => 'SESSION_LENGTH', 'validate' => 'int', 'type' => 'text:5:10', '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, 'append' => ' ' . $user->lang['MINUTES']), + 'session_length' => array('lang' => 'SESSION_LENGTH', 'validate' => 'int:60', 'type' => 'text:5:10', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']), + 'active_sessions' => array('lang' => 'LIMIT_SESSIONS', 'validate' => 'int:0', 'type' => 'text:4:4', 'explain' => true), + 'load_online_time' => array('lang' => 'ONLINE_LENGTH', 'validate' => 'int:0', '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), @@ -305,7 +303,7 @@ class acp_board '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), + 'server_port' => array('lang' => 'SERVER_PORT', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true), 'script_path' => array('lang' => 'SCRIPT_PATH', 'validate' => 'script_path', 'type' => 'text::255', 'explain' => true), ) ); @@ -317,18 +315,17 @@ 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, 'append' => ' ' . $user->lang['DAYS']), + 'max_autologin_time' => array('lang' => 'AUTOLOGIN_LENGTH', 'validate' => 'int:0', '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, 'append' => ' ' . $user->lang['DAYS']), - 'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'validate' => 'int', 'type' => 'text:3:3', 'explain' => true), + 'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'validate' => 'int:0', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']), + 'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'validate' => 'int:0', 'type' => 'text:3:3', 'explain' => true), 'tpl_allow_php' => array('lang' => 'TPL_ALLOW_PHP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), - 'form_token_lifetime' => array('lang' => 'FORM_TIME_MAX', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']), - 'form_token_mintime' => array('lang' => 'FORM_TIME_MIN', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']), + 'form_token_lifetime' => array('lang' => 'FORM_TIME_MAX', 'validate' => 'int:-1', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['SECONDS']), 'form_token_sid_guests' => array('lang' => 'FORM_SID_GUESTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), ) @@ -343,7 +340,7 @@ class acp_board 'email_enable' => array('lang' => 'ENABLE_EMAIL', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'board_email_form' => array('lang' => 'BOARD_EMAIL_FORM', 'validate' => 'bool', 'type' => 'radio:enabled_disabled', 'explain' => true), 'email_function_name' => array('lang' => 'EMAIL_FUNCTION_NAME', 'validate' => 'string', 'type' => 'text:20:50', 'explain' => true), - 'email_package_size' => array('lang' => 'EMAIL_PACKAGE_SIZE', 'validate' => 'int', 'type' => 'text:5:5', 'explain' => true), + 'email_package_size' => array('lang' => 'EMAIL_PACKAGE_SIZE', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true), 'board_contact' => array('lang' => 'CONTACT_EMAIL', 'validate' => 'string', 'type' => 'text:25:100', 'explain' => true), 'board_email' => array('lang' => 'ADMIN_EMAIL', 'validate' => 'string', 'type' => 'text:25:100', 'explain' => true), 'board_email_sig' => array('lang' => 'EMAIL_SIG', 'validate' => 'string', 'type' => 'textarea:5:30', 'explain' => true), @@ -352,7 +349,7 @@ class acp_board 'legend2' => 'SMTP_SETTINGS', 'smtp_delivery' => array('lang' => 'USE_SMTP', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'smtp_host' => array('lang' => 'SMTP_SERVER', 'validate' => 'string', 'type' => 'text:25:50', 'explain' => false), - 'smtp_port' => array('lang' => 'SMTP_PORT', 'validate' => 'int', 'type' => 'text:4:5', 'explain' => true), + 'smtp_port' => array('lang' => 'SMTP_PORT', 'validate' => 'int:0', 'type' => 'text:4:5', 'explain' => true), 'smtp_auth_method' => array('lang' => 'SMTP_AUTH_METHOD', 'validate' => 'string', 'type' => 'select', 'method' => 'mail_auth_select', 'explain' => true), 'smtp_username' => array('lang' => 'SMTP_USERNAME', 'validate' => 'string', 'type' => 'text:25:255', 'explain' => true), 'smtp_password' => array('lang' => 'SMTP_PASSWORD', 'validate' => 'string', 'type' => 'password:25:255', 'explain' => true) diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index d29c8dff30..99e53b8667 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -918,6 +918,13 @@ class acp_forums $forum_data['prune_days'] = $forum_data['prune_viewed'] = $forum_data['prune_freq'] = 0; $errors[] = $user->lang['FORUM_DATA_NEGATIVE']; } + + $range_test_ary = array( + array('lang' => 'FORUM_TOPICS_PAGE', 'value' => $forum_data['forum_topics_per_page'], 'column_type' => 'TINT:0'), + ); + validate_range($range_test_ary, $errors); + + // Set forum flags // 1 = link tracking From 38c636deb5feafef9aec5b70d0594ab330cb427e Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Wed, 27 Feb 2008 15:10:52 +0000 Subject: [PATCH 060/102] Removing minimum times from registration git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8408 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/ucp/ucp_register.php | 17 ++++--------- .../prosilver/template/ucp_agreement.html | 21 ---------------- .../prosilver/template/ucp_register.html | 18 -------------- .../subsilver2/template/ucp_agreement.html | 24 ------------------- .../subsilver2/template/ucp_register.html | 20 ---------------- 5 files changed, 5 insertions(+), 95 deletions(-) diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 09649ebe68..8a7bc14839 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -43,14 +43,6 @@ class ucp_register $submit = (isset($_POST['submit'])) ? true : false; $change_lang = request_var('change_lang', ''); $user_lang = request_var('lang', $user->lang_name); - - - // not so fast, buddy - if (!check_form_key('ucp_register', false, '', false, $config['min_time_reg']) - && !check_form_key('ucp_register_terms', false, '', false, $config['min_time_terms'])) - { - $agreed = false; - } if ($agreed) { @@ -92,7 +84,7 @@ class ucp_register $error = $cp_data = $cp_error = array(); - // + if (!$agreed || ($coppa === false && $config['coppa_enable']) || ($coppa && !$config['coppa_enable'])) { $add_lang = ($change_lang) ? '&change_lang=' . urlencode($change_lang) : ''; @@ -142,7 +134,6 @@ class ucp_register 'S_REGISTRATION' => true, 'S_HIDDEN_FIELDS' => build_hidden_fields($s_hidden_fields), 'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register' . $add_lang . $add_coppa), - 'S_TIME' => 1000 * ((int) $config['min_time_terms']), ) ); } @@ -201,7 +192,10 @@ class ucp_register 'tz' => array('num', false, -14, 14), 'lang' => array('match', false, '#^[a-z_\-]{2,}$#i'), )); - + if (!check_form_key('ucp_register')) + { + $error[] = $user->lang['FORM_INVALID']; + } // Replace "error" strings with their real, localised form $error = preg_replace('#^([A-Z_]+)$#e', "(!empty(\$user->lang['\\1'])) ? \$user->lang['\\1'] : '\\1'", $error); @@ -544,7 +538,6 @@ class ucp_register 'S_COPPA' => $coppa, 'S_HIDDEN_FIELDS' => $s_hidden_fields, 'S_UCP_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register'), - 'S_TIME' => 1000 * ((int) $config['min_time_reg']), ) ); diff --git a/phpBB/styles/prosilver/template/ucp_agreement.html b/phpBB/styles/prosilver/template/ucp_agreement.html index 9aaee00d58..67dcb35e7b 100644 --- a/phpBB/styles/prosilver/template/ucp_agreement.html +++ b/phpBB/styles/prosilver/template/ucp_agreement.html @@ -1,26 +1,5 @@ - diff --git a/phpBB/styles/prosilver/template/ucp_register.html b/phpBB/styles/prosilver/template/ucp_register.html index 5b5309ce93..721028cef6 100644 --- a/phpBB/styles/prosilver/template/ucp_register.html +++ b/phpBB/styles/prosilver/template/ucp_register.html @@ -11,24 +11,6 @@ document.forms['register'].submit.click(); } - function disable(disabl, name) - { - document.getElementById(name).disabled = disabl; - if (disabl) - { - document.getElementById(name).className = 'button1 disabled'; - } - else - { - document.getElementById(name).className = 'button1 enabled'; - } - } - - - onload_functions.push('disable(true, "submit")'); - setInterval('disable(false, "submit")', {S_TIME}); - - // ]]> diff --git a/phpBB/styles/subsilver2/template/ucp_agreement.html b/phpBB/styles/subsilver2/template/ucp_agreement.html index c02ebe18e6..f1ea9df73a 100644 --- a/phpBB/styles/subsilver2/template/ucp_agreement.html +++ b/phpBB/styles/subsilver2/template/ucp_agreement.html @@ -1,30 +1,6 @@ - diff --git a/phpBB/styles/subsilver2/template/ucp_register.html b/phpBB/styles/subsilver2/template/ucp_register.html index 6a5adb8be8..dac9283b28 100644 --- a/phpBB/styles/subsilver2/template/ucp_register.html +++ b/phpBB/styles/subsilver2/template/ucp_register.html @@ -11,26 +11,6 @@ document.forms['register'].submit.click(); } - var old_func = window.onload; - - function disable(disabl) - { - document.getElementById("submit").disabled = disabl; - } - - function disable_and_handle() - { - if (old_func) - { - old_func(); - } - disable(true); - } - - - window.onload = disable_and_handle; - setInterval("disable(false)", {S_TIME}); - // ]]> From 19c7d7b88172915572e93f2643e34d5f1a79344c Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Wed, 27 Feb 2008 15:11:07 +0000 Subject: [PATCH 061/102] and the API git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8409 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index a220bd33c6..2e3da4c204 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2082,7 +2082,7 @@ function add_form_key($form_name) * @param bool $trigger If true, the function will triger an error when encountering an invalid form * @param int $minimum_time The minimum acceptable age for a submitted form in seconds */ -function check_form_key($form_name, $timespan = false, $return_page = '', $trigger = false, $minimum_time = false) +function check_form_key($form_name, $timespan = false, $return_page = '', $trigger = false) { global $config, $user; @@ -2091,10 +2091,6 @@ function check_form_key($form_name, $timespan = false, $return_page = '', $trigg // we enforce a minimum value of half a minute here. $timespan = ($config['form_token_lifetime'] == -1) ? -1 : max(30, $config['form_token_lifetime']); } - if ($minimum_time === false) - { - $minimum_time = (int) $config['form_token_mintime']; - } if (isset($_POST['creation_time']) && isset($_POST['form_token'])) { @@ -2103,7 +2099,7 @@ function check_form_key($form_name, $timespan = false, $return_page = '', $trigg $diff = (time() - $creation_time); - if (($diff >= $minimum_time) && (($diff <= $timespan) || $timespan == -1)) + if (($diff <= $timespan) || $timespan === -1) { $token_sid = ($user->data['user_id'] == ANONYMOUS && !empty($config['form_token_sid_guests'])) ? $user->session_id : ''; From bbebeda5f266e9f0909a00953ef938c8e85cef1f Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Wed, 27 Feb 2008 15:11:25 +0000 Subject: [PATCH 062/102] git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8410 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 677ace42fe..d75b841962 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -128,6 +128,9 @@
    177. [Change] Remove left join for query used to retrieve already assigned users and groups within permission panel (Bug #20235)
    178. [Fix] Correctly return sole whitespaces if used with BBCodes (Bug #19535)
    179. [Fix] Quote bbcode parsing adding too much closing tags on special conditions (Bug #20735)
    180. +
    181. [Change] Added sanity checks to various ACP settings
    182. +
    183. [Change] Removed minimum form times
    184. +
    185. [Fix] Check topics_per_page value in acp_forums (Bug #15539)
    186. 1.i. Changes since 3.0.RC8

      From 540879ae41c5f58e693350d8af8c005380417aa3 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Wed, 27 Feb 2008 15:25:06 +0000 Subject: [PATCH 063/102] git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8412 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 1 - 1 file changed, 1 deletion(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 2e3da4c204..e4e5d7b335 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2080,7 +2080,6 @@ function add_form_key($form_name) * @param int $timespan The maximum acceptable age for a submitted form in seconds. Defaults to the config setting. * @param string $return_page The address for the return link * @param bool $trigger If true, the function will triger an error when encountering an invalid form -* @param int $minimum_time The minimum acceptable age for a submitted form in seconds */ function check_form_key($form_name, $timespan = false, $return_page = '', $trigger = false) { From 752b452128edecc51f7db8f7ee1875f29380b42a Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Wed, 27 Feb 2008 15:50:36 +0000 Subject: [PATCH 064/102] DBAL extension motivated by #22125 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8414 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/db/dbal.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index 4964ac87f7..61344a0674 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -45,7 +45,9 @@ class dbal // Holding the last sql query on sql error var $sql_error_sql = ''; - + // Holding the error information - only populated if sql_error_triggered is set + var $sql_error_returned = array(); + // Holding transaction count var $transactions = 0; @@ -544,11 +546,11 @@ class dbal $this->sql_error_triggered = true; $this->sql_error_sql = $sql; - $error = $this->_sql_error(); + $this->sql_error_returned = $this->_sql_error(); if (!$this->return_on_error) { - $message = 'SQL ERROR [ ' . $this->sql_layer . ' ]

      ' . $error['message'] . ' [' . $error['code'] . ']'; + $message = 'SQL ERROR [ ' . $this->sql_layer . ' ]

      ' . $this->sql_error_returned['message'] . ' [' . $this->sql_error_returned['code'] . ']'; // Show complete SQL error and path to administrators only // Additionally show complete error on installation or if extended debug mode is enabled From dfa5cd59eba5def37cba02437da08fea162a9bcc Mon Sep 17 00:00:00 2001 From: Vic D'Elfant Date: Thu, 28 Feb 2008 07:42:06 +0000 Subject: [PATCH 065/102] #22285 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8417 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 2 +- phpBB/install/schemas/schema_data.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 73e4ad548c..85627b9327 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -1568,7 +1568,7 @@ if (version_compare($current_version, '3.0.0', '<=')) _sql($sql, $errored, $error_ary); // Update smiley sizes - $smileys = array('icon_e_surprised.gif','icon_cool.gif', 'icon_lol.gif', 'icon_mad.gif', 'icon_razz.gif', 'icon_redface.gif', 'icon_cry.gif', 'icon_evil.gif', 'icon_twisted.gif', 'icon_rolleyes.gif', 'icon_exclaim.gif', 'icon_question.gif', 'icon_idea.gif', 'icon_arrow.gif', 'icon_neutral.gif', 'icon_mrgreen.gif', 'icon_e_ugeek.gif'); + $smileys = array('icon_e_surprised.gif', 'icon_eek.gif', 'icon_cool.gif', 'icon_lol.gif', 'icon_mad.gif', 'icon_razz.gif', 'icon_redface.gif', 'icon_cry.gif', 'icon_evil.gif', 'icon_twisted.gif', 'icon_rolleyes.gif', 'icon_exclaim.gif', 'icon_question.gif', 'icon_idea.gif', 'icon_arrow.gif', 'icon_neutral.gif', 'icon_mrgreen.gif', 'icon_e_ugeek.gif'); foreach ($smileys as $smiley) { if (file_exists($phpbb_root_path . 'images/smilies/' . $smiley)) diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index eb9b16841c..ccfb229e74 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -646,7 +646,7 @@ INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_heigh INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':o', 'icon_e_surprised.gif', '{L_SMILIES_SURPRISED}', 15, 17, 13); INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-o', 'icon_e_surprised.gif', '{L_SMILIES_SURPRISED}', 15, 17, 14); INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':eek:', 'icon_e_surprised.gif', '{L_SMILIES_SURPRISED}', 15, 17, 15); -INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':shock:', 'icon_eek.gif', '{L_SMILIES_SHOCKED}', 15, 15, 16); +INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':shock:', 'icon_eek.gif', '{L_SMILIES_SHOCKED}', 15, 17, 16); INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':?', 'icon_e_confused.gif', '{L_SMILIES_CONFUSED}', 15, 17, 17); INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':-?', 'icon_e_confused.gif', '{L_SMILIES_CONFUSED}', 15, 17, 18); INSERT INTO phpbb_smilies (code, smiley_url, emotion, smiley_width, smiley_height, smiley_order) VALUES (':???:', 'icon_e_confused.gif', '{L_SMILIES_CONFUSED}', 15, 17, 19); From 93c34901fd1ea1748bb4f653321fb73a74b83502 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Thu, 28 Feb 2008 11:09:27 +0000 Subject: [PATCH 066/102] Minor cosmetics git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8418 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/acp/common.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index c3f884bc8e..e69597395b 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -262,10 +262,10 @@ $lang = array_merge($lang, array( 'SELECT_ANONYMOUS' => 'Select anonymous user', 'SELECT_OPTION' => 'Select option', - 'SETTING_TOO_LOW' => 'The entered value for the setting %s is too low. The minimal allowed value is %d.', - 'SETTING_TOO_BIG' => 'The entered value for the setting %s is too big. The maximal allowed value is %d.', - 'SETTING_TOO_LONG' => 'The entered value for the setting %s is too long. The maximal allowed length is %d.', - 'SETTING_TOO_SHORT' => 'The entered value for the setting %s is not long enough. The minimal allowed length is %d.', + 'SETTING_TOO_LOW' => 'The entered value for the setting “%s” is too low. The minimal allowed value is %d.', + 'SETTING_TOO_BIG' => 'The entered value for the setting “%s” is too big. The maximal allowed value is %d.', + 'SETTING_TOO_LONG' => 'The entered value for the setting “%s” is too long. The maximal allowed length is %d.', + 'SETTING_TOO_SHORT' => 'The entered value for the setting “%s” is not long enough. The minimal allowed length is %d.', 'UCP' => 'User Control Panel', 'USERNAMES_EXPLAIN' => 'Place each username on a separate line.', From 181cbcd625acf98cb55a2ef0dd11d0e72d19e122 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 28 Feb 2008 19:54:18 +0000 Subject: [PATCH 067/102] #22365 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8419 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/db/dbal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index 61344a0674..21d095155e 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -607,7 +607,7 @@ class dbal $this->sql_transaction('rollback'); } - return $error; + return $this->sql_error_returned; } /** From 3aa3ea89f98b5bc2def149e9ecaf43bd3d3d1dfa Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 28 Feb 2008 19:55:46 +0000 Subject: [PATCH 068/102] #22355 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8420 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_content.php | 2 +- phpBB/includes/functions_upload.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index f851309a1e..0d367f953f 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -822,7 +822,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count, } $filesize = $attachment['filesize']; - $size_lang = ($filesize >= 1048576) ? $user->lang['MB'] : ( ($filesize >= 1024) ? $user->lang['KB'] : $user->lang['BYTES'] ); + $size_lang = ($filesize >= 1048576) ? $user->lang['MIB'] : (($filesize >= 1024) ? $user->lang['KIB'] : $user->lang['BYTES']); $filesize = get_formatted_filesize($filesize, false); $comment = bbcode_nl2br(censor_text($attachment['attach_comment'])); diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php index e75db00414..ca4f51c12f 100644 --- a/phpBB/includes/functions_upload.php +++ b/phpBB/includes/functions_upload.php @@ -386,7 +386,7 @@ class filespec // Filesize is too big or it's 0 if it was larger than the maxsize in the upload form if ($this->upload->max_filesize && ($this->get('filesize') > $this->upload->max_filesize || $this->filesize == 0)) { - $size_lang = ($this->upload->max_filesize >= 1048576) ? $user->lang['MB'] : (($this->upload->max_filesize >= 1024) ? $user->lang['KB'] : $user->lang['BYTES'] ); + $size_lang = ($this->upload->max_filesize >= 1048576) ? $user->lang['MIB'] : (($this->upload->max_filesize >= 1024) ? $user->lang['KIB'] : $user->lang['BYTES'] ); $max_filesize = get_formatted_filesize($this->upload->max_filesize, false); $this->error[] = sprintf($user->lang[$this->upload->error_prefix . 'WRONG_FILESIZE'], $max_filesize, $size_lang); @@ -777,7 +777,7 @@ class fileupload break; case 2: - $size_lang = ($this->max_filesize >= 1048576) ? $user->lang['MB'] : (($this->max_filesize >= 1024) ? $user->lang['KB'] : $user->lang['BYTES'] ); + $size_lang = ($this->max_filesize >= 1048576) ? $user->lang['MIB'] : (($this->max_filesize >= 1024) ? $user->lang['KIB'] : $user->lang['BYTES']); $max_filesize = get_formatted_filesize($this->max_filesize, false); $error = sprintf($user->lang[$this->error_prefix . 'WRONG_FILESIZE'], $max_filesize, $size_lang); @@ -813,7 +813,7 @@ class fileupload // Filesize is too big or it's 0 if it was larger than the maxsize in the upload form if ($this->max_filesize && ($file->get('filesize') > $this->max_filesize || $file->get('filesize') == 0)) { - $size_lang = ($this->max_filesize >= 1048576) ? $user->lang['MB'] : (($this->max_filesize >= 1024) ? $user->lang['KB'] : $user->lang['BYTES'] ); + $size_lang = ($this->max_filesize >= 1048576) ? $user->lang['MIB'] : (($this->max_filesize >= 1024) ? $user->lang['KIB'] : $user->lang['BYTES']); $max_filesize = get_formatted_filesize($this->max_filesize, false); $file->error[] = sprintf($user->lang[$this->error_prefix . 'WRONG_FILESIZE'], $max_filesize, $size_lang); From 2d30ffb9b699923e9073678ba32a7cea5603d328 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Fri, 29 Feb 2008 13:40:30 +0000 Subject: [PATCH 069/102] Problem migrating old cvs working copy to svn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8422 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_board.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index ed7fb69d73..c1e94000db 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -211,7 +211,7 @@ class acp_board 'max_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:8:255', 'type' => false, 'method' => false, 'explain' => false,), 'require_activation' => array('lang' => 'ACC_ACTIVATION', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_acc_activation', 'explain' => true), - 'min_name_chars' => array('lang' => 'USERNAME_LENGTH', 'validate' => 'int:1', 'type' => 'custom', 'method' => 'username_length', 'explain' => true), + 'min_name_chars' => array('lang' => 'USERNAME_LENGTH', 'validate' => 'int:1', 'type' => 'custom:5:180', 'method' => 'username_length', 'explain' => true), 'min_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:1', 'type' => 'custom', 'method' => 'password_length', 'explain' => true), 'allow_name_chars' => array('lang' => 'USERNAME_CHARS', 'validate' => 'string', 'type' => 'select', 'method' => 'select_username_chars', 'explain' => true), 'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true), @@ -552,7 +552,14 @@ class acp_board { $l_explain = (isset($user->lang[$vars['lang'] . '_EXPLAIN'])) ? $user->lang[$vars['lang'] . '_EXPLAIN'] : ''; } - + + $content = build_cfg_template($type, $config_key, $this->new_config, $config_key, $vars); + + if (empty($content)) + { + continue; + } + $template->assign_block_vars('options', array( 'KEY' => $config_key, 'TITLE' => (isset($user->lang[$vars['lang']])) ? $user->lang[$vars['lang']] : $vars['lang'], From 33ab3d4439773cca96e40c707f302b193c22edf9 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Thu, 6 Mar 2008 19:29:59 +0000 Subject: [PATCH 070/102] Custom profile fields with date type should be timezone independend [Bug #15003] git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8424 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/functions_profile_fields.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index d75b841962..9c7a3fb7cf 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -131,6 +131,7 @@
    187. [Change] Added sanity checks to various ACP settings
    188. [Change] Removed minimum form times
    189. [Fix] Check topics_per_page value in acp_forums (Bug #15539)
    190. +
    191. [Fix] Custom profile fields with date type should be timezone independend (Bug #15003)
    192. 1.i. Changes since 3.0.RC8

      diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index 3797166429..b621095df4 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -488,7 +488,8 @@ class custom_profile else if ($day && $month && $year) { global $user; - return $user->format_date(mktime(0, 0, 0, $month, $day, $year), $user->lang['DATE_FORMAT'], true); + // d/m/y 00:00 GMT isn't necessarily on the same d/m/y in the user's timezone, so add the timezone seconds + return $user->format_date(gmmktime(0, 0, 0, $month, $day, $year) + $user->timezone + $user->dst, $user->lang['DATE_FORMAT'], true); } return $value; From 04785d807878f5b1c8572900550c8b37092f0328 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 13 Mar 2008 14:08:59 +0000 Subject: [PATCH 071/102] #22875 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8426 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/style/acp_attachments.html | 6 +++--- phpBB/adm/style/acp_bbcodes.html | 4 ++++ phpBB/adm/style/acp_database.html | 22 +++++++++++++--------- phpBB/adm/style/acp_icons.html | 20 ++++++++++++-------- phpBB/adm/style/acp_permission_roles.html | 15 ++++++++++----- phpBB/adm/style/acp_prune_forums.html | 2 +- phpBB/adm/style/acp_styles.html | 2 +- phpBB/adm/style/acp_words.html | 4 ++++ phpBB/docs/CHANGELOG.html | 2 ++ phpBB/language/en/acp/common.php | 2 ++ 10 files changed, 52 insertions(+), 27 deletions(-) diff --git a/phpBB/adm/style/acp_attachments.html b/phpBB/adm/style/acp_attachments.html index a002ad19ac..9573c34248 100644 --- a/phpBB/adm/style/acp_attachments.html +++ b/phpBB/adm/style/acp_attachments.html @@ -122,11 +122,11 @@ { if (newimage == 'no_image') { - document.image_upload_icon.src = "{PHPBB_ROOT_PATH}images/spacer.gif"; + document.getElementById('image_upload_icon').src = "{PHPBB_ROOT_PATH}images/spacer.gif"; } else { - document.image_upload_icon.src = "{PHPBB_ROOT_PATH}{IMG_PATH}/" + newimage; + document.getElementById('image_upload_icon').src = "{PHPBB_ROOT_PATH}{IMG_PATH}/" + newimage; } } @@ -192,7 +192,7 @@
      -
       src="{PHPBB_ROOT_PATH}images/spacer.gif"src="{UPLOAD_ICON_SRC}" name="image_upload_icon" alt="" title="" /> 
      +
       src="{PHPBB_ROOT_PATH}images/spacer.gif"src="{UPLOAD_ICON_SRC}" id="image_upload_icon" alt="" title="" /> 
      diff --git a/phpBB/adm/style/acp_bbcodes.html b/phpBB/adm/style/acp_bbcodes.html index a0b0016a11..c81c198fd5 100644 --- a/phpBB/adm/style/acp_bbcodes.html +++ b/phpBB/adm/style/acp_bbcodes.html @@ -103,6 +103,10 @@ {bbcodes.BBCODE_TAG} {ICON_EDIT} {ICON_DELETE} + + + {L_ACP_NO_ITEMS} + diff --git a/phpBB/adm/style/acp_database.html b/phpBB/adm/style/acp_database.html index e64c5ed437..ebc76c36a3 100644 --- a/phpBB/adm/style/acp_database.html +++ b/phpBB/adm/style/acp_database.html @@ -7,8 +7,9 @@

      {L_ACP_RESTORE_EXPLAIN}

      +
      - +
      {L_RESTORE_OPTIONS}
      @@ -16,16 +17,19 @@
      - -

      -   -   - -

      - - {S_FORM_TOKEN} +

      +   +   + +

      + {S_FORM_TOKEN}
      + +
      +

      {L_ACP_NO_ITEMS}

      +
      +

      {L_ACP_BACKUP}

      diff --git a/phpBB/adm/style/acp_icons.html b/phpBB/adm/style/acp_icons.html index 8bb8257318..86500ae047 100644 --- a/phpBB/adm/style/acp_icons.html +++ b/phpBB/adm/style/acp_icons.html @@ -43,19 +43,19 @@ function toggle_select(icon, display, select) { - var disp = document.getElementById('order_disp[' + icon + ']'); - var nodisp = document.getElementById('order_no_disp[' + icon + ']'); + var disp = document.getElementById('order_disp_' + select); + var nodisp = document.getElementById('order_no_disp_' + select); disp.disabled = !display; nodisp.disabled = display; if (display) { - document.getElementById(select).selectedIndex = 0; + document.getElementById('order_' + select).selectedIndex = 0; nodisp.className = 'disabled-options'; disp.className = ''; } else { - document.getElementById(select).selectedIndex = {S_ORDER_LIST_DISPLAY_COUNT}; + document.getElementById('order_' + select).selectedIndex = {S_ORDER_LIST_DISPLAY_COUNT}; disp.className = 'disabled-options'; nodisp.className = ''; } @@ -111,15 +111,15 @@ - + - + disabled="disabled" class="disabled-options" >{S_ORDER_LIST_DISPLAY} + disabled="disabled" class="disabled-options" >{S_ORDER_LIST_UNDISPLAY} @@ -248,6 +248,10 @@  {ICON_EDIT} {ICON_DELETE} + + + {L_ACP_NO_ITEMS} + diff --git a/phpBB/adm/style/acp_permission_roles.html b/phpBB/adm/style/acp_permission_roles.html index 725c7a5ec1..220e7dafbe 100644 --- a/phpBB/adm/style/acp_permission_roles.html +++ b/phpBB/adm/style/acp_permission_roles.html @@ -28,11 +28,11 @@

      {L_EXPLAIN}

      -
      -
      » {L_SET_ROLE_PERMISSIONS} + +
      {L_ROLE_DETAILS}
      @@ -46,6 +46,7 @@

      + {S_FORM_TOKEN}

      @@ -57,11 +58,15 @@ +

      + » {L_BACK_TO_TOP}


      +

      +

      {L_ACL_TYPE}

      @@ -107,9 +112,9 @@ {auth.mask.PERMISSION} - - - + + + diff --git a/phpBB/adm/style/acp_prune_forums.html b/phpBB/adm/style/acp_prune_forums.html index 890a3ba569..069d2c91c3 100644 --- a/phpBB/adm/style/acp_prune_forums.html +++ b/phpBB/adm/style/acp_prune_forums.html @@ -44,7 +44,7 @@

      {L_LOOK_UP_FORUMS_EXPLAIN}

      -
      +
      diff --git a/phpBB/adm/style/acp_styles.html b/phpBB/adm/style/acp_styles.html index 4b3bcddf1d..a1363fce8d 100644 --- a/phpBB/adm/style/acp_styles.html +++ b/phpBB/adm/style/acp_styles.html @@ -459,7 +459,7 @@
      -
      {COPYRIGHT}
      +
      {COPYRIGHT}
      diff --git a/phpBB/adm/style/acp_words.html b/phpBB/adm/style/acp_words.html index 9bd0bf11a0..3fa4cfc91c 100644 --- a/phpBB/adm/style/acp_words.html +++ b/phpBB/adm/style/acp_words.html @@ -62,6 +62,10 @@ {words.REPLACEMENT}  {ICON_EDIT}  {ICON_DELETE}  + + + {L_ACP_NO_ITEMS} + diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 9c7a3fb7cf..c649b6466c 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -132,6 +132,8 @@
    193. [Change] Removed minimum form times
    194. [Fix] Check topics_per_page value in acp_forums (Bug #15539)
    195. [Fix] Custom profile fields with date type should be timezone independend (Bug #15003)
    196. +
    197. [Fix] Fixing some XHTML errors/warnings within the ACP (Bug #22875)
    198. +

      1.i. Changes since 3.0.RC8

      diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index e69597395b..f8b91dd1aa 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -126,6 +126,8 @@ $lang = array_merge($lang, array( 'ACP_MOD_LOGS' => 'Moderator log', 'ACP_MOD_ROLES' => 'Moderator roles', + 'ACP_NO_ITEMS' => 'There are no items yet.', + 'ACP_ORPHAN_ATTACHMENTS' => 'Orphaned attachments', 'ACP_PERMISSIONS' => 'Permissions', From 156bf27418370b58f4c40b02c2628d8c715c07b6 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 13 Mar 2008 14:09:18 +0000 Subject: [PATCH 072/102] tiny language key correction git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8427 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/language/en/acp/board.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php index 0cc1064916..f328c05882 100644 --- a/phpBB/language/en/acp/board.php +++ b/phpBB/language/en/acp/board.php @@ -134,7 +134,7 @@ $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_FLASH' => 'Allow use of [FLASH] BBCode tag in posts. ', + 'ALLOW_POST_FLASH' => 'Allow use of [FLASH] BBCode tag in posts', 'ALLOW_POST_FLASH_EXPLAIN' => 'If disallowed the [FLASH] BBCode tag is disabled in posts. Otherwise the permission system controls which users can use the [FLASH] BBCode tag.', 'BUMP_INTERVAL' => 'Bump interval', @@ -323,7 +323,7 @@ $lang = array_merge($lang, array( 'LDAP_USER' => 'LDAP user dn', 'LDAP_USER_EXPLAIN' => 'Leave blank to use anonymous binding. If filled in phpBB uses the specified distinguished name on login attempts to find the correct user, e.g. uid=Username,ou=MyUnit,o=MyCompany,c=US. Required for Active Directory Servers.', 'LDAP_USER_FILTER' => 'LDAP user filter', - 'LDAP_USER_FILTER_EXPLAIN' => 'Optionally you can further limit the searched objects with additional filters. For example objectClass=posixGroup would result in the use of (&(uid=$username)(objectClass=posixGroup))', + 'LDAP_USER_FILTER_EXPLAIN' => 'Optionally you can further limit the searched objects with additional filters. For example objectClass=posixGroup would result in the use of (&(uid=$username)(objectClass=posixGroup))', )); // Server Settings From 58173191edc5b75434dca66edfe4405296d22572 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 13 Mar 2008 14:39:53 +0000 Subject: [PATCH 073/102] #22865 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8428 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/adm/index.php | 15 ++++++++------- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/message_parser.php | 7 +++---- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index c577cefacd..358e5a4bf2 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -390,13 +390,16 @@ function validate_config_vars($config_vars, &$cfg_array, &$error) } $validator = explode(':', $config_definition['validate']); + // Validate a bit. ;) (0 = type, 1 = min, 2= max) switch ($validator[$type]) { case 'string': $length = strlen($cfg_array[$config_name]); + // the column is a VARCHAR $validator[$max] = (isset($validator[$max])) ? min(255, $validator[$max]) : 255; + if (isset($validator[$min]) && $length < $validator[$min]) { $error[] = sprintf($user->lang['SETTING_TOO_SHORT'], $user->lang[$config_definition['lang']], $validator[$min]); @@ -406,14 +409,14 @@ function validate_config_vars($config_vars, &$cfg_array, &$error) $error[] = sprintf($user->lang['SETTING_TOO_LONG'], $user->lang[$config_definition['lang']], $validator[$max]); } break; - + case 'bool': $cfg_array[$config_name] = ($cfg_array[$config_name]) ? 1 : 0; break; case 'int': $cfg_array[$config_name] = (int) $cfg_array[$config_name]; - + if (isset($validator[$min]) && $cfg_array[$config_name] < $validator[$min]) { $error[] = sprintf($user->lang['SETTING_TOO_LOW'], $user->lang[$config_definition['lang']], $validator[$min]); @@ -576,9 +579,8 @@ function validate_range($value_ary, &$error) { $error[] = sprintf($user->lang['SETTING_TOO_LONG'], $user->lang[$value['lang']], $max); } - - break; - + break; + case 'int': $min = (isset($column[1])) ? max($column[1],$type['min']) : $type['min']; $max = (isset($column[2])) ? min($column[2],$type['max']) : $type['max']; @@ -590,10 +592,9 @@ function validate_range($value_ary, &$error) { $error[] = sprintf($user->lang['SETTING_TOO_BIG'], $user->lang[$value['lang']], $max); } - break; + break; } } - } ?> \ No newline at end of file diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index c649b6466c..de627e6217 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -133,6 +133,7 @@
    199. [Fix] Check topics_per_page value in acp_forums (Bug #15539)
    200. [Fix] Custom profile fields with date type should be timezone independend (Bug #15003)
    201. [Fix] Fixing some XHTML errors/warnings within the ACP (Bug #22875)
    202. +
    203. [Fix] Warnings if poll title/options exceed maximum characters per post (Bug #22865)
    204. diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 41e7bc51d7..674e13de49 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -1089,7 +1089,7 @@ class parse_message extends bbcode_firstpass if ((!$msg_len && $mode !== 'sig') || $config['max_' . $mode . '_chars'] && $msg_len > $config['max_' . $mode . '_chars']) { $this->warn_msg[] = (!$msg_len) ? $user->lang['TOO_FEW_CHARS'] : sprintf($user->lang['TOO_MANY_CHARS_' . strtoupper($mode)], $msg_len, $config['max_' . $mode . '_chars']); - return $this->warn_msg; + return (!$update_this_message) ? $return_message : $this->warn_msg; } } @@ -1097,7 +1097,7 @@ class parse_message extends bbcode_firstpass if ($mode !== 'sig' && utf8_clean_string($this->message) === '') { $this->warn_msg[] = $user->lang['TOO_FEW_CHARS']; - return $this->warn_msg; + return (!$update_this_message) ? $return_message : $this->warn_msg; } // Prepare BBcode (just prepares some tags for better parsing) @@ -1146,7 +1146,7 @@ class parse_message extends bbcode_firstpass if ($config['max_' . $mode . '_urls'] && $num_urls > $config['max_' . $mode . '_urls']) { $this->warn_msg[] = sprintf($user->lang['TOO_MANY_URLS'], $config['max_' . $mode . '_urls']); - return $this->warn_msg; + return (!$update_this_message) ? $return_message : $this->warn_msg; } if (!$update_this_message) @@ -1603,7 +1603,6 @@ class parse_message extends bbcode_firstpass $this->message = $poll['poll_option_text']; $bbcode_bitfield = $this->bbcode_bitfield; - $poll['poll_option_text'] = $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); $bbcode_bitfield = base64_encode(base64_decode($bbcode_bitfield) | base64_decode($this->bbcode_bitfield)); From 44708b7ebbef0c5a875954141ab751728ef15a87 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 13 Mar 2008 14:47:57 +0000 Subject: [PATCH 074/102] #22805 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8429 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/memberlist.php | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index de627e6217..ba51befde5 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -134,6 +134,7 @@
    205. [Fix] Custom profile fields with date type should be timezone independend (Bug #15003)
    206. [Fix] Fixing some XHTML errors/warnings within the ACP (Bug #22875)
    207. [Fix] Warnings if poll title/options exceed maximum characters per post (Bug #22865)
    208. +
    209. [Fix] Do not allow selecting non-authorized groups within memberlist by adjusting URL (Bug #22805 - patch provided by ToonArmy)
    210. diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index d021581cb2..7244a09591 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -1237,6 +1237,7 @@ switch ($mode) { $group_selected = request_var('search_group_id', 0); $s_group_select = ''; + $group_ids = array(); if ($auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) { @@ -1261,10 +1262,16 @@ switch ($mode) while ($row = $db->sql_fetchrow($result)) { + $group_ids[] = $row['group_id']; $s_group_select .= ''; } $db->sql_freeresult($result); + if ($group_selected !== 0 && !in_array($group_selected, $group_ids)) + { + trigger_error('NO_GROUP'); + } + $template->assign_vars(array( 'USERNAME' => $username, 'EMAIL' => $email, From 7c1b3ed62aeab31b4f226600a0585226ed44bfea Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Thu, 13 Mar 2008 15:22:33 +0000 Subject: [PATCH 075/102] #22685 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8430 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/mcp/mcp_reports.php | 2 +- phpBB/styles/prosilver/template/mcp_post.html | 2 +- phpBB/styles/subsilver2/template/mcp_post.html | 4 ++-- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index ba51befde5..a529c3dc9a 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -135,6 +135,7 @@
    211. [Fix] Fixing some XHTML errors/warnings within the ACP (Bug #22875)
    212. [Fix] Warnings if poll title/options exceed maximum characters per post (Bug #22865)
    213. [Fix] Do not allow selecting non-authorized groups within memberlist by adjusting URL (Bug #22805 - patch provided by ToonArmy)
    214. +
    215. [Fix] Correctly specify "close report action" (Bug #22685)
    216. diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php index 37ea7e5132..9419a37ab8 100755 --- a/phpBB/includes/mcp/mcp_reports.php +++ b/phpBB/includes/mcp/mcp_reports.php @@ -186,7 +186,7 @@ class mcp_reports $template->assign_vars(array( 'S_MCP_REPORT' => true, - 'S_CLOSE_ACTION' => $this->u_action . '&p=' . $post_id . '&f=' . $forum_id, + 'S_CLOSE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $post_info['forum_id'] . '&p=' . $post_id), 'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']), 'S_POST_REPORTED' => $post_info['post_reported'], 'S_POST_UNAPPROVED' => !$post_info['post_approved'], diff --git a/phpBB/styles/prosilver/template/mcp_post.html b/phpBB/styles/prosilver/template/mcp_post.html index b7c59b9a8b..b4706ec9ac 100644 --- a/phpBB/styles/prosilver/template/mcp_post.html +++ b/phpBB/styles/prosilver/template/mcp_post.html @@ -24,7 +24,7 @@ - +
      diff --git a/phpBB/styles/subsilver2/template/mcp_post.html b/phpBB/styles/subsilver2/template/mcp_post.html index 1b16f8e92b..402f25a655 100644 --- a/phpBB/styles/subsilver2/template/mcp_post.html +++ b/phpBB/styles/subsilver2/template/mcp_post.html @@ -1,7 +1,7 @@ - + @@ -39,7 +39,7 @@
      - +
      From 217dc8e6d53beb62e6aa5ccaed68b86a9282d88e Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 14 Mar 2008 12:28:08 +0000 Subject: [PATCH 076/102] #22525 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8432 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/auth/auth_apache.php | 12 +++++++++++- phpBB/includes/auth/auth_db.php | 12 +++++++++++- phpBB/includes/auth/auth_ldap.php | 12 +++++++++++- 4 files changed, 34 insertions(+), 3 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index a529c3dc9a..b50f5fcf8f 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -136,6 +136,7 @@
    217. [Fix] Warnings if poll title/options exceed maximum characters per post (Bug #22865)
    218. [Fix] Do not allow selecting non-authorized groups within memberlist by adjusting URL (Bug #22805 - patch provided by ToonArmy)
    219. [Fix] Correctly specify "close report action" (Bug #22685)
    220. +
    221. [Fix] Display "empty password error" within the login box instead of issuing a general error (Bug #22525)
    222. diff --git a/phpBB/includes/auth/auth_apache.php b/phpBB/includes/auth/auth_apache.php index ed3951dd7b..4581a1bbdb 100644 --- a/phpBB/includes/auth/auth_apache.php +++ b/phpBB/includes/auth/auth_apache.php @@ -48,8 +48,18 @@ function login_apache(&$username, &$password) if (!$password) { return array( - 'status' => LOGIN_BREAK, + 'status' => LOGIN_ERROR_PASSWORD, 'error_msg' => 'NO_PASSWORD_SUPPLIED', + 'user_row' => array('user_id' => ANONYMOUS), + ); + } + + if (!$username) + { + return array( + 'status' => LOGIN_ERROR_USERNAME, + 'error_msg' => 'LOGIN_ERROR_USERNAME', + 'user_row' => array('user_id' => ANONYMOUS), ); } diff --git a/phpBB/includes/auth/auth_db.php b/phpBB/includes/auth/auth_db.php index 432ae92d21..1a5fd9e418 100644 --- a/phpBB/includes/auth/auth_db.php +++ b/phpBB/includes/auth/auth_db.php @@ -32,8 +32,18 @@ function login_db(&$username, &$password) if (!$password) { return array( - 'status' => LOGIN_BREAK, + 'status' => LOGIN_ERROR_PASSWORD, 'error_msg' => 'NO_PASSWORD_SUPPLIED', + 'user_row' => array('user_id' => ANONYMOUS), + ); + } + + if (!$username) + { + return array( + 'status' => LOGIN_ERROR_USERNAME, + 'error_msg' => 'LOGIN_ERROR_USERNAME', + 'user_row' => array('user_id' => ANONYMOUS), ); } diff --git a/phpBB/includes/auth/auth_ldap.php b/phpBB/includes/auth/auth_ldap.php index 472927ace3..d49662fb2d 100644 --- a/phpBB/includes/auth/auth_ldap.php +++ b/phpBB/includes/auth/auth_ldap.php @@ -104,8 +104,18 @@ function login_ldap(&$username, &$password) if (!$password) { return array( - 'status' => LOGIN_BREAK, + 'status' => LOGIN_ERROR_PASSWORD, 'error_msg' => 'NO_PASSWORD_SUPPLIED', + 'user_row' => array('user_id' => ANONYMOUS), + ); + } + + if (!$username) + { + return array( + 'status' => LOGIN_ERROR_USERNAME, + 'error_msg' => 'LOGIN_ERROR_USERNAME', + 'user_row' => array('user_id' => ANONYMOUS), ); } From b7ef95ed091580df66da23fc1bca403758645fc3 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Mon, 17 Mar 2008 16:25:07 +0000 Subject: [PATCH 077/102] This should get rid of the filesorts and temp tables on index (with topic read tracking as exception). Updater still needs testing. Not yet merged to 3.1 #22715 - thanks HoL git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8436 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/develop/create_schema_files.php | 4 +- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/functions.php | 343 ++++++++++++++++---------- phpBB/includes/session.php | 9 +- phpBB/install/database_update.php | 14 ++ 5 files changed, 235 insertions(+), 136 deletions(-) diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 375ea8588d..cefdf404dd 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1144,7 +1144,7 @@ function get_schema_struct() ), 'PRIMARY_KEY' => 'group_id', 'KEYS' => array( - 'group_legend' => array('INDEX', 'group_legend'), + 'group_legend_name' => array('INDEX', array('group_legend', 'group_name')), ), ); @@ -1520,6 +1520,7 @@ function get_schema_struct() 'COLUMNS' => array( 'session_id' => array('CHAR:32', ''), 'session_user_id' => array('UINT', 0), + 'session_forum_id' => array('UINT', 0), 'session_last_visit' => array('TIMESTAMP', 0), 'session_start' => array('TIMESTAMP', 0), 'session_time' => array('TIMESTAMP', 0), @@ -1535,6 +1536,7 @@ function get_schema_struct() 'KEYS' => array( 'session_time' => array('INDEX', 'session_time'), 'session_user_id' => array('INDEX', 'session_user_id'), + 'session_forum_id' => array('INDEX', 'session_forum_id'), ), ); diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index b50f5fcf8f..ea3986cdcc 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -137,6 +137,7 @@
    223. [Fix] Do not allow selecting non-authorized groups within memberlist by adjusting URL (Bug #22805 - patch provided by ToonArmy)
    224. [Fix] Correctly specify "close report action" (Bug #22685)
    225. [Fix] Display "empty password error" within the login box instead of issuing a general error (Bug #22525)
    226. +
    227. [Fix] Clean up who is online code in page_header (Bug #22715, thanks HighwayofLife)
    228. diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index e4e5d7b335..69a9cd5fcc 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3098,6 +3098,207 @@ function msg_handler($errno, $msg_text, $errfile, $errline) return false; } +/** +* Queries the session table to get information about online guests +* @param int $forum_id Limits the search to the forum with this id +* @return int The number of active distinct guest sessions +*/ +function obtain_guest_count($forum_id = 0) +{ + global $db, $config; + + if ($forum_id) + { + $reading_sql = ' AND s.session_forum_id = ' . (int) $f; + } + else + { + $reading_sql = ''; + } + $time = (time() - (intval($config['load_online_time']) * 60)); + + // Get number of online guests + + if ($db->sql_layer === 'sqlite') + { + $sql = 'SELECT COUNT(session_ip) as num_guests + FROM ( + SELECT DISTINCT s.session_ip + FROM ' . SESSIONS_TABLE . ' s + WHERE s.session_user_id = ' . ANONYMOUS . ' + AND s.session_time >= ' . ($time - ((int) ($time % 60))) . + $reading_sql . + ')'; + } + else + { + $sql = 'SELECT COUNT(DISTINCT s.session_ip) as num_guests + FROM ' . SESSIONS_TABLE . ' s + WHERE s.session_user_id = ' . ANONYMOUS . ' + AND s.session_time >= ' . ($time - ((int) ($time % 60))) . + $reading_sql; + } + $result = $db->sql_query($sql, 60); + $guests_online = (int) $db->sql_fetchfield('num_guests'); + $db->sql_freeresult($result); + + return $guests_online; +} + +/** +* Queries the session table to get information about online users +* @param int $forum_id Limits the search to the forum with this id +* @return array An array containing the ids of online, hidden and visible users, as well as statistical info +*/ +function obtain_users_online($forum_id = 0) +{ + global $db, $config, $user; + $logged_visible_online = $logged_hidden_online = $guests_online = $prev_user_id = 0; + $reading_sql = $prev_session_ip = ''; + + if ($forum_id !== 0) + { + $reading_sql = ' AND s.session_forum_id = ' . (int) $forum_id; + } + $online_users = array( + 'online_users' => array(), + 'hidden_users' => array(), + 'total_online' => 0, + 'visible_online' => 0, + 'hidden_online' => 0, + 'guests_online' => 0, + ); + if ($config['load_online_guests']) + { + $online_users['guests_online'] = obtain_guest_count($forum_id); + } + + // a little discrete magic to cache this for 30 seconds + $time = (time() - (intval($config['load_online_time']) * 60)); + $sql = 'SELECT s.session_user_id, s.session_ip, s.session_viewonline + FROM ' . SESSIONS_TABLE . ' s + WHERE s.session_time >= ' . ($time - ((int) ($time % 30))) . + $reading_sql . + ' AND s.session_user_id <> ' . ANONYMOUS; + $result = $db->sql_query($sql, 30); + + while ($row = $db->sql_fetchrow($result)) + { + + // Skip multiple sessions for one user + if (!isset($online_users['online_users'][$row['session_user_id']])) + { + $online_users['online_users'][$row['session_user_id']] = $row['session_user_id']; + if ($row['session_viewonline']) + { + $online_users['visible_online']++; + } + else + { + $online_users['hidden_users'][$row['session_user_id']] = $row['session_user_id']; + $online_users['hidden_online']++; + } + } + } + $online_users['total_online'] = $online_users['guests_online'] + $online_users['visible_online'] + $online_users['hidden_online']; + $db->sql_freeresult($result); + + return $online_users; +} + +/** +* Uses the result of obtain_users_online to generate a localized, readable representation. +* @param mixed $online_users result of obtain_users_online - array with user_id lists for total, hidden and visible users, and statistics +* @param int $forum_id Indicate that the data is limited to one forum and not global. +* @return array An array containing the string for output to the template +*/ +function obtain_users_online_string($online_users, $forum_id = 0) +{ + global $db, $user, $auth; + $user_online_link = $online_userlist = ''; + + if (count($online_users['online_users'])) + { + $sql = 'SELECT u.username, u.username_clean, u.user_id, u.user_type, u.user_allow_viewonline, u.user_colour + FROM ' . USERS_TABLE . ' u + WHERE ' . $db->sql_in_set('u.user_id', $online_users['online_users']) . ' + ORDER BY u.username_clean ASC'; + $result = $db->sql_query($sql, 100); + + while ($row = $db->sql_fetchrow($result)) + { + // User is logged in and therefore not a guest + if ($row['user_id'] != ANONYMOUS) + { + if (isset($online_users['hidden_users'][$row['user_id']])) + { + $row['username'] = '' . $row['username'] . ''; + } + + if (!isset($online_users['hidden_users'][$row['user_id']]) || $auth->acl_get('u_viewonline')) + { + $user_online_link = get_username_string(($row['user_type'] <> USER_IGNORE) ? 'full' : 'no_profile', $row['user_id'], $row['username'], $row['user_colour']); + $online_userlist .= ($online_userlist != '') ? ', ' . $user_online_link : $user_online_link; + } + } + } + $db->sql_freeresult($result); + } + + if (!$online_userlist) + { + $online_userlist = $user->lang['NO_ONLINE_USERS']; + } + + if ($forum_id === 0) + { + $online_userlist = $user->lang['REGISTERED_USERS'] . ' ' . $online_userlist; + } + else + { + $l_online = ($online_users['guests_online'] === 1) ? $user->lang['BROWSING_FORUM_GUEST'] : $user->lang['BROWSING_FORUM_GUESTS']; + $online_userlist = sprintf($l_online, $online_userlist, $online_users['guests_online']); + } + + // Build online listing + $vars_online = array( + 'ONLINE' => array('total_online', 'l_t_user_s'), + 'REG' => array('visible_online', 'l_r_user_s'), + 'HIDDEN' => array('hidden_online', 'l_h_user_s'), + 'GUEST' => array('guests_online', 'l_g_user_s') + ); + + foreach ($vars_online as $l_prefix => $var_ary) + { + switch ($online_users[$var_ary[0]]) + { + case 0: + ${$var_ary[1]} = $user->lang[$l_prefix . '_USERS_ZERO_TOTAL']; + break; + + case 1: + ${$var_ary[1]} = $user->lang[$l_prefix . '_USER_TOTAL']; + break; + + default: + ${$var_ary[1]} = $user->lang[$l_prefix . '_USERS_TOTAL']; + break; + } + } + unset($vars_online); + + $l_online_users = sprintf($l_t_user_s, $online_users['total_online']); + $l_online_users .= sprintf($l_r_user_s, $online_users['visible_online']); + $l_online_users .= sprintf($l_h_user_s, $online_users['hidden_online']); + $l_online_users .= sprintf($l_g_user_s, $online_users['guests_online']); + + return array( + 'online_userlist' => $online_userlist, + 'l_online_users' => $l_online_users, + ); +} + + /** * Generate page header */ @@ -3141,108 +3342,14 @@ function page_header($page_title = '', $display_online_list = true) if ($config['load_online'] && $config['load_online_time'] && $display_online_list) { - $logged_visible_online = $logged_hidden_online = $guests_online = $prev_user_id = 0; - $prev_session_ip = $reading_sql = ''; - - if (!empty($_REQUEST['f'])) - { - $f = request_var('f', 0); - - $reading_sql = ' AND s.session_page ' . $db->sql_like_expression("{$db->any_char}_f_={$f}x{$db->any_char}"); - } - - // Get number of online guests - if (!$config['load_online_guests']) - { - if ($db->sql_layer === 'sqlite') - { - $sql = 'SELECT COUNT(session_ip) as num_guests - FROM ( - SELECT DISTINCT s.session_ip - FROM ' . SESSIONS_TABLE . ' s - WHERE s.session_user_id = ' . ANONYMOUS . ' - AND s.session_time >= ' . (time() - ($config['load_online_time'] * 60)) . - $reading_sql . - ')'; - } - else - { - $sql = 'SELECT COUNT(DISTINCT s.session_ip) as num_guests - FROM ' . SESSIONS_TABLE . ' s - WHERE s.session_user_id = ' . ANONYMOUS . ' - AND s.session_time >= ' . (time() - ($config['load_online_time'] * 60)) . - $reading_sql; - } - $result = $db->sql_query($sql); - $guests_online = (int) $db->sql_fetchfield('num_guests'); - $db->sql_freeresult($result); - } - - $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 . - ((!$config['load_online_guests']) ? ' AND s.session_user_id <> ' . ANONYMOUS : '') . ' - AND u.user_id = s.session_user_id - ORDER BY u.username_clean ASC, s.session_ip ASC'; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - // User is logged in and therefore not a guest - if ($row['user_id'] != ANONYMOUS) - { - // Skip multiple sessions for one user - if ($row['user_id'] != $prev_user_id) - { - if ($row['session_viewonline']) - { - $logged_visible_online++; - } - else - { - $row['username'] = '' . $row['username'] . ''; - $logged_hidden_online++; - } - - if (($row['session_viewonline']) || $auth->acl_get('u_viewonline')) - { - $user_online_link = get_username_string(($row['user_type'] <> USER_IGNORE) ? 'full' : 'no_profile', $row['user_id'], $row['username'], $row['user_colour']); - $online_userlist .= ($online_userlist != '') ? ', ' . $user_online_link : $user_online_link; - } - } - - $prev_user_id = $row['user_id']; - } - else - { - // Skip multiple sessions for one user - if ($row['session_ip'] != $prev_session_ip) - { - $guests_online++; - } - } - - $prev_session_ip = $row['session_ip']; - } - $db->sql_freeresult($result); - - if (!$online_userlist) - { - $online_userlist = $user->lang['NO_ONLINE_USERS']; - } - - if (empty($_REQUEST['f'])) - { - $online_userlist = $user->lang['REGISTERED_USERS'] . ' ' . $online_userlist; - } - else - { - $l_online = ($guests_online == 1) ? $user->lang['BROWSING_FORUM_GUEST'] : $user->lang['BROWSING_FORUM_GUESTS']; - $online_userlist = sprintf($l_online, $online_userlist, $guests_online); - } - - $total_online_users = $logged_visible_online + $logged_hidden_online + $guests_online; + + $f = request_var('f', 0); + $f = max($f, 0); + $online_users = obtain_users_online($f); + $user_online_strings = obtain_users_online_string($online_users, $f); + $l_online_users = $user_online_strings['l_online_users']; + $online_userlist = $user_online_strings['online_userlist']; + $total_online_users = $online_users['total_online']; if ($total_online_users > $config['record_online_users']) { @@ -3250,38 +3357,6 @@ function page_header($page_title = '', $display_online_list = true) set_config('record_online_date', time(), true); } - // Build online listing - $vars_online = array( - 'ONLINE' => array('total_online_users', 'l_t_user_s'), - 'REG' => array('logged_visible_online', 'l_r_user_s'), - 'HIDDEN' => array('logged_hidden_online', 'l_h_user_s'), - 'GUEST' => array('guests_online', 'l_g_user_s') - ); - - foreach ($vars_online as $l_prefix => $var_ary) - { - switch (${$var_ary[0]}) - { - case 0: - ${$var_ary[1]} = $user->lang[$l_prefix . '_USERS_ZERO_TOTAL']; - break; - - case 1: - ${$var_ary[1]} = $user->lang[$l_prefix . '_USER_TOTAL']; - break; - - default: - ${$var_ary[1]} = $user->lang[$l_prefix . '_USERS_TOTAL']; - break; - } - } - unset($vars_online); - - $l_online_users = sprintf($l_t_user_s, $total_online_users); - $l_online_users .= sprintf($l_r_user_s, $logged_visible_online); - $l_online_users .= sprintf($l_h_user_s, $logged_hidden_online); - $l_online_users .= sprintf($l_g_user_s, $guests_online); - $l_online_record = sprintf($user->lang['RECORD_ONLINE_USERS'], $config['record_online_users'], $user->format_date($config['record_online_date'])); $l_online_time = ($config['load_online_time'] == 1) ? 'VIEW_ONLINE_TIME' : 'VIEW_ONLINE_TIMES'; diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index affd447787..91b412b075 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -129,7 +129,8 @@ class session 'script_path' => str_replace(' ', '%20', htmlspecialchars($script_path)), 'root_script_path' => str_replace(' ', '%20', htmlspecialchars($root_script_path)), - 'page' => $page + 'page' => $page, + 'forum' => (isset($_REQUEST['f']) && $_REQUEST['f'] > 0) ? (int) $_REQUEST['f'] : 0, ); return $page_array; @@ -186,6 +187,8 @@ class session // 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' : ''; + + if (isset($_COOKIE[$config['cookie_name'] . '_sid']) || isset($_COOKIE[$config['cookie_name'] . '_u'])) { @@ -310,6 +313,7 @@ class session if ($this->update_session_page) { $sql_ary['session_page'] = substr($this->page['page'], 0, 199); + $sql_ary['session_forum_id'] = $this->page['forum']; } $sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " @@ -550,6 +554,7 @@ class session if ($this->update_session_page) { $sql_ary['session_page'] = substr($this->page['page'], 0, 199); + $sql_ary['session_forum_id'] = $this->page['forum']; } $sql = 'UPDATE ' . SESSIONS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " @@ -594,6 +599,7 @@ class session if ($this->update_session_page) { $sql_ary['session_page'] = (string) substr($this->page['page'], 0, 199); + $sql_ary['session_forum_id'] = $this->page['forum']; } $db->sql_return_on_error(true); @@ -627,6 +633,7 @@ class session $sql_ary['session_id'] = (string) $this->session_id; $sql_ary['session_page'] = (string) substr($this->page['page'], 0, 199); + $sql_ary['session_forum_id'] = $this->page['forum']; $sql = 'INSERT INTO ' . SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); $db->sql_query($sql); diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 85627b9327..39e0d8131e 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -480,6 +480,20 @@ $database_update_info = array( FORUMS_TABLE => array( 'display_subforum_list' => array('BOOL', 1), ), + SESSIONS_TABLE => array( + 'session_forum_id' => array('UINT', 0), + ), + ), + 'add_index' => array( + SESSIONS_TABLE => array( + 'session_forum_id' => 'session_forum_id', + ), + GROUP_TABLE => array( + 'group_legend_name' => array('group_legend', 'group_name'), + ), + ), + 'drop_keys' => array( + GROUP_TABLE => array('group_legend'), ), ), ); From afba17e5620891c54b606e218163a5845262bada Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Mon, 17 Mar 2008 22:17:35 +0000 Subject: [PATCH 078/102] meh git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8437 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 69a9cd5fcc..6d05ddabe5 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3109,7 +3109,7 @@ function obtain_guest_count($forum_id = 0) if ($forum_id) { - $reading_sql = ' AND s.session_forum_id = ' . (int) $f; + $reading_sql = ' AND s.session_forum_id = ' . (int) $forum_id; } else { From 221001a6dc86c7cd9246b6614adb24c1d88c0067 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 18 Mar 2008 10:14:37 +0000 Subject: [PATCH 079/102] - some changes to the recent session change - display errors on inserting sessions - fix database updater git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8438 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 22 +++++++++++++++------- phpBB/includes/session.php | 14 ++++++-------- phpBB/install/database_update.php | 6 +++--- phpBB/viewforum.php | 2 +- phpBB/viewonline.php | 5 ++--- 5 files changed, 27 insertions(+), 22 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 6d05ddabe5..886ea7197f 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3154,12 +3154,13 @@ function obtain_users_online($forum_id = 0) { global $db, $config, $user; $logged_visible_online = $logged_hidden_online = $guests_online = $prev_user_id = 0; - $reading_sql = $prev_session_ip = ''; + $reading_sql = ''; if ($forum_id !== 0) { $reading_sql = ' AND s.session_forum_id = ' . (int) $forum_id; } + $online_users = array( 'online_users' => array(), 'hidden_users' => array(), @@ -3168,6 +3169,7 @@ function obtain_users_online($forum_id = 0) 'hidden_online' => 0, 'guests_online' => 0, ); + if ($config['load_online_guests']) { $online_users['guests_online'] = obtain_guest_count($forum_id); @@ -3175,6 +3177,7 @@ function obtain_users_online($forum_id = 0) // a little discrete magic to cache this for 30 seconds $time = (time() - (intval($config['load_online_time']) * 60)); + $sql = 'SELECT s.session_user_id, s.session_ip, s.session_viewonline FROM ' . SESSIONS_TABLE . ' s WHERE s.session_time >= ' . ($time - ((int) ($time % 30))) . @@ -3184,7 +3187,6 @@ function obtain_users_online($forum_id = 0) while ($row = $db->sql_fetchrow($result)) { - // Skip multiple sessions for one user if (!isset($online_users['online_users'][$row['session_user_id']])) { @@ -3217,7 +3219,7 @@ function obtain_users_online_string($online_users, $forum_id = 0) global $db, $user, $auth; $user_online_link = $online_userlist = ''; - if (count($online_users['online_users'])) + if (sizeof($online_users['online_users'])) { $sql = 'SELECT u.username, u.username_clean, u.user_id, u.user_type, u.user_allow_viewonline, u.user_colour FROM ' . USERS_TABLE . ' u @@ -3225,15 +3227,21 @@ function obtain_users_online_string($online_users, $forum_id = 0) ORDER BY u.username_clean ASC'; $result = $db->sql_query($sql, 100); + $userlist_array = array(); while ($row = $db->sql_fetchrow($result)) { - // User is logged in and therefore not a guest - if ($row['user_id'] != ANONYMOUS) + // Skip multiple sessions for one user + if ($row['user_id'] != $prev_user_id) { if (isset($online_users['hidden_users'][$row['user_id']])) { $row['username'] = '' . $row['username'] . ''; } + else + { + $row['username'] = '' . $row['username'] . ''; + $logged_hidden_online++; + } if (!isset($online_users['hidden_users'][$row['user_id']]) || $auth->acl_get('u_viewonline')) { @@ -3342,11 +3350,11 @@ function page_header($page_title = '', $display_online_list = true) if ($config['load_online'] && $config['load_online_time'] && $display_online_list) { - $f = request_var('f', 0); $f = max($f, 0); $online_users = obtain_users_online($f); $user_online_strings = obtain_users_online_string($online_users, $f); + $l_online_users = $user_online_strings['l_online_users']; $online_userlist = $user_online_strings['online_userlist']; $total_online_users = $online_users['total_online']; @@ -3414,7 +3422,7 @@ function page_header($page_title = '', $display_online_list = true) $user_lang = $user->lang['USER_LANG']; if (strpos($user_lang, '-x-') !== false) { - $user_lang = substr($user_lang, 0, strpos($user_lang, '-x-')); + $user_lang = substr($user_lang, 0, strpos($user_lang, '-x-')); } // The following assigns all _common_ variables that may be used at any point in a template. diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 91b412b075..9aee53531c 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -130,7 +130,7 @@ class session 'root_script_path' => str_replace(' ', '%20', htmlspecialchars($root_script_path)), 'page' => $page, - 'forum' => (isset($_REQUEST['f']) && $_REQUEST['f'] > 0) ? (int) $_REQUEST['f'] : 0, + 'forum' => (isset($_REQUEST['f']) && $_REQUEST['f'] > 0) ? (int) $_REQUEST['f'] : 0, ); return $page_array; @@ -185,11 +185,6 @@ class session $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' : ''; - - - if (isset($_COOKIE[$config['cookie_name'] . '_sid']) || isset($_COOKIE[$config['cookie_name'] . '_u'])) { $this->cookie_data['u'] = request_var($config['cookie_name'] . '_u', 0, false, true); @@ -614,6 +609,8 @@ class session // Limit new sessions in 1 minute period (if required) if (empty($this->data['session_time']) && $config['active_sessions']) { + $db->sql_return_on_error(false); + $sql = 'SELECT COUNT(session_id) AS sessions FROM ' . SESSIONS_TABLE . ' WHERE session_time >= ' . ($this->time_now - 60); @@ -629,6 +626,9 @@ class session } } + // Since we re-create the session id here, the inserted row must be unique. Therefore, we display potential errors. + $db->sql_return_on_error(false); + $this->session_id = $this->data['session_id'] = md5(unique_id()); $sql_ary['session_id'] = (string) $this->session_id; @@ -638,8 +638,6 @@ class session $sql = 'INSERT INTO ' . SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); $db->sql_query($sql); - $db->sql_return_on_error(false); - // Regenerate autologin/persistent login key if ($session_autologin) { diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 39e0d8131e..856640b58b 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -486,14 +486,14 @@ $database_update_info = array( ), 'add_index' => array( SESSIONS_TABLE => array( - 'session_forum_id' => 'session_forum_id', + 'session_forum_id' => array('session_forum_id'), ), - GROUP_TABLE => array( + GROUPS_TABLE => array( 'group_legend_name' => array('group_legend', 'group_name'), ), ), 'drop_keys' => array( - GROUP_TABLE => array('group_legend'), + GROUPS_TABLE => array('group_legend'), ), ), ); diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 878791088d..e8e6fab47a 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -158,7 +158,7 @@ if (!$auth->acl_get('f_read', $forum_id)) $template->assign_vars(array( '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(str_replace('&', '&', build_url(array('_f_')))), + 'S_LOGIN_ACTION' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') . '&redirect=' . urlencode(str_replace('&', '&', build_url())), )); page_footer(); diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php index ea29e09660..788861915c 100644 --- a/phpBB/viewonline.php +++ b/phpBB/viewonline.php @@ -122,7 +122,7 @@ if (!$show_guests) } // Get user list -$sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_type, u.user_colour, s.session_id, s.session_time, s.session_page, s.session_ip, s.session_browser, s.session_viewonline +$sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_type, u.user_colour, s.session_id, s.session_time, s.session_page, s.session_ip, s.session_browser, s.session_viewonline, s.session_forum_id 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)) . @@ -208,8 +208,7 @@ while ($row = $db->sql_fetchrow($result)) case 'posting': case 'viewforum': case 'viewtopic': - preg_match('#_f_=([0-9]+)x#i', $row['session_page'], $forum_id); - $forum_id = (sizeof($forum_id)) ? (int) $forum_id[1] : 0; + $forum_id = $row['session_forum_id']; if ($forum_id && $auth->acl_get('f_list', $forum_id)) { From 2138667953c04edab862de7ec9019989e5eef157 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 18 Mar 2008 10:21:27 +0000 Subject: [PATCH 080/102] hmm, still bugs there git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8439 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 886ea7197f..79d20f1c8e 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3153,9 +3153,8 @@ function obtain_guest_count($forum_id = 0) function obtain_users_online($forum_id = 0) { global $db, $config, $user; - $logged_visible_online = $logged_hidden_online = $guests_online = $prev_user_id = 0; - $reading_sql = ''; + $reading_sql = ''; if ($forum_id !== 0) { $reading_sql = ' AND s.session_forum_id = ' . (int) $forum_id; @@ -3217,8 +3216,10 @@ function obtain_users_online($forum_id = 0) function obtain_users_online_string($online_users, $forum_id = 0) { global $db, $user, $auth; + $user_online_link = $online_userlist = ''; - + $prev_user_id = 0; + if (sizeof($online_users['online_users'])) { $sql = 'SELECT u.username, u.username_clean, u.user_id, u.user_type, u.user_allow_viewonline, u.user_colour @@ -3239,8 +3240,7 @@ function obtain_users_online_string($online_users, $forum_id = 0) } else { - $row['username'] = '' . $row['username'] . ''; - $logged_hidden_online++; + $row['username'] = $row['username']; } if (!isset($online_users['hidden_users'][$row['user_id']]) || $auth->acl_get('u_viewonline')) From d1d12ec9861deaf4b850cd1168182471c2712512 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 18 Mar 2008 11:10:56 +0000 Subject: [PATCH 081/102] grr git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8440 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 79d20f1c8e..283ab94cf3 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3238,10 +3238,6 @@ function obtain_users_online_string($online_users, $forum_id = 0) { $row['username'] = '' . $row['username'] . ''; } - else - { - $row['username'] = $row['username']; - } if (!isset($online_users['hidden_users'][$row['user_id']]) || $auth->acl_get('u_viewonline')) { From 5a1d2a94a3af00cee33e0add91a1c5a75c09c250 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 18 Mar 2008 11:11:16 +0000 Subject: [PATCH 082/102] do not conflict with updates git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8441 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/session.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 9aee53531c..382f76aca3 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -609,7 +609,7 @@ class session // Limit new sessions in 1 minute period (if required) if (empty($this->data['session_time']) && $config['active_sessions']) { - $db->sql_return_on_error(false); +// $db->sql_return_on_error(false); $sql = 'SELECT COUNT(session_id) AS sessions FROM ' . SESSIONS_TABLE . ' @@ -627,7 +627,8 @@ class session } // Since we re-create the session id here, the inserted row must be unique. Therefore, we display potential errors. - $db->sql_return_on_error(false); + // Commented out because it will not allow forums to update correctly +// $db->sql_return_on_error(false); $this->session_id = $this->data['session_id'] = md5(unique_id()); @@ -638,6 +639,8 @@ class session $sql = 'INSERT INTO ' . SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary); $db->sql_query($sql); + $db->sql_return_on_error(false); + // Regenerate autologin/persistent login key if ($session_autologin) { From a3b98e510e63a270985d478c4a5a2f43cbbcead6 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 18 Mar 2008 11:58:34 +0000 Subject: [PATCH 083/102] i somehow mixed my local copy with the changes git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8442 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 283ab94cf3..0b79cffda3 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3159,7 +3159,7 @@ function obtain_users_online($forum_id = 0) { $reading_sql = ' AND s.session_forum_id = ' . (int) $forum_id; } - +$config['load_online_time'] = 500000; $online_users = array( 'online_users' => array(), 'hidden_users' => array(), @@ -3182,21 +3182,21 @@ function obtain_users_online($forum_id = 0) WHERE s.session_time >= ' . ($time - ((int) ($time % 30))) . $reading_sql . ' AND s.session_user_id <> ' . ANONYMOUS; - $result = $db->sql_query($sql, 30); + $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { // Skip multiple sessions for one user if (!isset($online_users['online_users'][$row['session_user_id']])) { - $online_users['online_users'][$row['session_user_id']] = $row['session_user_id']; + $online_users['online_users'][$row['session_user_id']] = (int) $row['session_user_id']; if ($row['session_viewonline']) { $online_users['visible_online']++; } else { - $online_users['hidden_users'][$row['session_user_id']] = $row['session_user_id']; + $online_users['hidden_users'][$row['session_user_id']] = (int) $row['session_user_id']; $online_users['hidden_online']++; } } @@ -3218,21 +3218,19 @@ function obtain_users_online_string($online_users, $forum_id = 0) global $db, $user, $auth; $user_online_link = $online_userlist = ''; - $prev_user_id = 0; if (sizeof($online_users['online_users'])) { - $sql = 'SELECT u.username, u.username_clean, u.user_id, u.user_type, u.user_allow_viewonline, u.user_colour - FROM ' . USERS_TABLE . ' u - WHERE ' . $db->sql_in_set('u.user_id', $online_users['online_users']) . ' - ORDER BY u.username_clean ASC'; - $result = $db->sql_query($sql, 100); + $sql = 'SELECT username, username_clean, user_id, user_type, user_allow_viewonline, user_colour + FROM ' . USERS_TABLE . ' + WHERE ' . $db->sql_in_set('user_id', $online_users['online_users']) . ' + ORDER BY username_clean ASC'; + $result = $db->sql_query($sql); - $userlist_array = array(); while ($row = $db->sql_fetchrow($result)) { - // Skip multiple sessions for one user - if ($row['user_id'] != $prev_user_id) + // User is logged in and therefore not a guest + if ($row['user_id'] != ANONYMOUS) { if (isset($online_users['hidden_users'][$row['user_id']])) { From 6da288aace3df1e2fcf4c06c8a467cf29922f07d Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 18 Mar 2008 12:03:33 +0000 Subject: [PATCH 084/102] i think i will stop committing thinks today. :/ git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8443 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 0b79cffda3..5622b2dd6c 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3159,7 +3159,7 @@ function obtain_users_online($forum_id = 0) { $reading_sql = ' AND s.session_forum_id = ' . (int) $forum_id; } -$config['load_online_time'] = 500000; + $online_users = array( 'online_users' => array(), 'hidden_users' => array(), @@ -3182,7 +3182,7 @@ $config['load_online_time'] = 500000; WHERE s.session_time >= ' . ($time - ((int) ($time % 30))) . $reading_sql . ' AND s.session_user_id <> ' . ANONYMOUS; - $result = $db->sql_query($sql); + $result = $db->sql_query($sql, 30); while ($row = $db->sql_fetchrow($result)) { From aee4c949a8fa2892831c41edf8986feb8e1d4bd7 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 18 Mar 2008 13:29:57 +0000 Subject: [PATCH 085/102] Pertain select single link on memberlist (Bug #23235 - patch provided by Schumi) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8444 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/memberlist.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 7244a09591..18a8c9b77c 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -1187,7 +1187,7 @@ switch ($mode) 'sd' => array('sd', 'a'), 'form' => array('form', ''), 'field' => array('field', ''), - 'select_single' => array('select_single', 0), + 'select_single' => array('select_single', $select_single), 'username' => array('username', '', true), 'email' => array('email', ''), 'icq' => array('icq', ''), From 1fc205064d46b211e5a7b71ca29490aee0a9caad Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 18 Mar 2008 13:31:39 +0000 Subject: [PATCH 086/102] also #23235 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8445 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + 1 file changed, 1 insertion(+) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index ea3986cdcc..287f32f5a4 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -138,6 +138,7 @@
    229. [Fix] Correctly specify "close report action" (Bug #22685)
    230. [Fix] Display "empty password error" within the login box instead of issuing a general error (Bug #22525)
    231. [Fix] Clean up who is online code in page_header (Bug #22715, thanks HighwayofLife)
    232. +
    233. [Fix] Pertain select single link on memberlist (Bug #23235 - patch provided by Schumi)
    234. From 07829b38a1458e3a9debd0d1e0a6976baeafc224 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 18 Mar 2008 13:33:30 +0000 Subject: [PATCH 087/102] #23195 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8446 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 b942f01b8c..f7d6d0a9c4 100755 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -1702,7 +1702,7 @@ class install_install extends module if (is_dir($path) && file_exists($path . '/iso.txt')) { - $lang_file = file("{$phpbb_root_path}language/$path/iso.txt"); + $lang_file = file("$path/iso.txt"); $lang_pack = array( 'lang_iso' => basename($path), From 274bd147ca29d61db26d3a0e5c717f4a5ab36d3d Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 18 Mar 2008 13:49:54 +0000 Subject: [PATCH 088/102] Allow & and | in local part of email addresses - #22995 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8447 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/functions.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 287f32f5a4..804be705ef 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -139,6 +139,7 @@
    235. [Fix] Display "empty password error" within the login box instead of issuing a general error (Bug #22525)
    236. [Fix] Clean up who is online code in page_header (Bug #22715, thanks HighwayofLife)
    237. [Fix] Pertain select single link on memberlist (Bug #23235 - patch provided by Schumi)
    238. +
    239. [Fix] Allow & and | in local part of email addresses (Bug #22995)
    240. diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 5622b2dd6c..e61df309b3 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2771,7 +2771,7 @@ function get_preg_expression($mode) switch ($mode) { case 'email': - return '[a-z0-9&\'\.\-_\+]+@[a-z0-9\-]+\.(?:[a-z0-9\-]+\.)*[a-z]+'; + return '(?:[a-z0-9\'\.\-_\+\|]|&)+@[a-z0-9\-]+\.(?:[a-z0-9\-]+\.)*[a-z]+'; break; case 'bbcode_htm': From e1d5f76848be9564989e60189b31c5c4c4f673d7 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 18 Mar 2008 14:19:58 +0000 Subject: [PATCH 089/102] [PM] Do not display To/Bcc fields for adding users if in edit mode - changing recipients on edit is currently not a supported feature (Bug #22625) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8448 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/styles/prosilver/template/posting_editor.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/phpBB/styles/prosilver/template/posting_editor.html b/phpBB/styles/prosilver/template/posting_editor.html index 6ec79dfb8b..459efc72b3 100644 --- a/phpBB/styles/prosilver/template/posting_editor.html +++ b/phpBB/styles/prosilver/template/posting_editor.html @@ -4,7 +4,7 @@
      - +
      @@ -29,15 +29,17 @@
      +
      {L_FIND_USERNAME}
      +
      -

      {L_FIND_USERNAME}
      +

      {L_FIND_USERNAME}
      @@ -48,7 +50,9 @@
      +
      +
      From 337f1c33c9ee760db180d0628e756bed61c75020 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 18 Mar 2008 14:32:49 +0000 Subject: [PATCH 090/102] Do not error out if php_uname function disabled / Authenticating on SMTP Server (Bug #22235 - patch by HoL) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8449 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/functions_messenger.php | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 804be705ef..d2f233150a 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -140,6 +140,7 @@
    241. [Fix] Clean up who is online code in page_header (Bug #22715, thanks HighwayofLife)
    242. [Fix] Pertain select single link on memberlist (Bug #23235 - patch provided by Schumi)
    243. [Fix] Allow & and | in local part of email addresses (Bug #22995)
    244. +
    245. [Fix] Do not error out if php_uname function disabled / Authenticating on SMTP Server (Bug #22235 - patch by HoL)
    246. diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index be78ad2999..90dbc33363 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -1056,8 +1056,7 @@ class smtp_class global $user; $err_msg = ''; - $local_host = php_uname('n'); - $local_host = (empty($local_host)) ? 'localhost' : $local_host; + $local_host = (function_exists('php_uname')) ? php_uname('n') : $user->host; // If we are authenticating through pop-before-smtp, we // have to login ones before we get authenticated @@ -1332,7 +1331,7 @@ class smtp_class // Realm if (empty($tokens['realm'])) { - $tokens['realm'] = php_uname('n'); + $tokens['realm'] = (function_exists('php_uname')) ? php_uname('n') : $user->host; } // Maxbuf From c6c2d325bfb9626c33da97f477ae161b464adae0 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 18 Mar 2008 14:36:44 +0000 Subject: [PATCH 091/102] Correctly obtain to be ignored users within topic/forum notification (Bug #21795 - patch provided by dr.death) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8450 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/functions_posting.php | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index d2f233150a..7ba3ed9b67 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -141,6 +141,7 @@
    247. [Fix] Pertain select single link on memberlist (Bug #23235 - patch provided by Schumi)
    248. [Fix] Allow & and | in local part of email addresses (Bug #22995)
    249. [Fix] Do not error out if php_uname function disabled / Authenticating on SMTP Server (Bug #22235 - patch by HoL)
    250. +
    251. [Fix] Correctly obtain to be ignored users within topic/forum notification (Bug #21795 - patch provided by dr.death)
    252. diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 615c65e1ad..2f12732e8b 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1121,16 +1121,15 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id // Get banned User ID's $sql = 'SELECT ban_userid - FROM ' . BANLIST_TABLE; + FROM ' . BANLIST_TABLE . ' + WHERE ban_userid <> 0 + AND ban_exclude <> 1'; $result = $db->sql_query($sql); $sql_ignore_users = ANONYMOUS . ', ' . $user->data['user_id']; while ($row = $db->sql_fetchrow($result)) { - if (isset($row['ban_userid'])) - { - $sql_ignore_users .= ', ' . $row['ban_userid']; - } + $sql_ignore_users .= ', ' . (int) $row['ban_userid']; } $db->sql_freeresult($result); From b0bfd5c66f8f1f1cf48f9aff362036e17d387d50 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 18 Mar 2008 14:44:51 +0000 Subject: [PATCH 092/102] Correctly update board statistics for attaching orphaned files to existing posts (Bug #20185) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8451 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/includes/acp/acp_attachments.php | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 7ba3ed9b67..6d1f0759cc 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -142,6 +142,7 @@
    253. [Fix] Allow & and | in local part of email addresses (Bug #22995)
    254. [Fix] Do not error out if php_uname function disabled / Authenticating on SMTP Server (Bug #22235 - patch by HoL)
    255. [Fix] Correctly obtain to be ignored users within topic/forum notification (Bug #21795 - patch provided by dr.death)
    256. +
    257. [Fix] Correctly update board statistics for attaching orphaned files to existing posts (Bug #20185)
    258. diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 1db1602665..d6f32bda53 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -940,6 +940,7 @@ class acp_attachments AND is_orphan = 1'; $result = $db->sql_query($sql); + $files_added = $space_taken = 0; while ($row = $db->sql_fetchrow($result)) { $post_row = $post_info[$upload_list[$row['attach_id']]]; @@ -979,9 +980,18 @@ class acp_attachments WHERE topic_id = ' . $post_row['topic_id']; $db->sql_query($sql); + $space_taken += $row['filesize']; + $files_added++; + add_log('admin', 'LOG_ATTACH_FILEUPLOAD', $post_row['post_id'], $row['real_filename']); } $db->sql_freeresult($result); + + if ($files_added) + { + set_config('upload_dir_size', $config['upload_dir_size'] + $space_taken, true); + set_config('num_files', $config['num_files'] + $files_added, true); + } } } From 22deceec853f71099e9ebcc137268584599c55e0 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 21 Mar 2008 10:47:02 +0000 Subject: [PATCH 093/102] #18105 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8453 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_prune.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php index 308f83387c..a82a438db7 100644 --- a/phpBB/includes/acp/acp_prune.php +++ b/phpBB/includes/acp/acp_prune.php @@ -405,7 +405,15 @@ class acp_prune $where_sql .= ($email) ? ' AND user_email ' . $db->sql_like_expression(str_replace('*', $db->any_char, $email)) . ' ' : ''; $where_sql .= (sizeof($joined)) ? " AND user_regdate " . $key_match[$joined_select] . ' ' . gmmktime(0, 0, 0, (int) $joined[1], (int) $joined[2], (int) $joined[0]) : ''; $where_sql .= ($count !== '') ? " AND user_posts " . $key_match[$count_select] . ' ' . (int) $count . ' ' : ''; - $where_sql .= (sizeof($active)) ? " AND user_lastvisit " . $key_match[$active_select] . " " . gmmktime(0, 0, 0, (int) $active[1], (int) $active[2], (int) $active[0]) : ''; + + if (sizeof($active) && $active_select != 'lt') + { + $where_sql .= ' AND user_lastvisit ' . $key_match[$active_select] . ' ' . gmmktime(0, 0, 0, (int) $active[1], (int) $active[2], (int) $active[0]); + } + else if (sizeof($active)) + { + $where_sql .= ' AND (user_lastvisit > 0 AND user_lastvisit < ' . gmmktime(0, 0, 0, (int) $active[1], (int) $active[2], (int) $active[0]) . ')'; + } } // Protect the admin, do not prune if no options are given... From 9a236a55d3e4802a017ee7ccd3456dba55a62e75 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Fri, 21 Mar 2008 10:47:48 +0000 Subject: [PATCH 094/102] #s23535 git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8454 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/download/file.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/phpBB/download/file.php b/phpBB/download/file.php index 503c57ee26..0be562aadf 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -208,8 +208,32 @@ else $row['forum_id'] = false; if (!$auth->acl_get('u_pm_download')) { + header('HTTP/1.0 403 forbidden'); trigger_error('SORRY_AUTH_VIEW_ATTACH'); } + + // Check if the attachment is within the users scope... + $sql = 'SELECT user_id, author_id + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE msg_id = ' . $attachment['post_msg_id']; + $result = $db->sql_query($sql); + + $allowed = false; + while ($user_row = $db->sql_fetchrow($result)) + { + if ($user->data['user_id'] == $user_row['user_id'] || $user->data['user_id'] == $user_row['author_id']) + { + $allowed = true; + break; + } + } + $db->sql_freeresult($result); + + if (!$allowed) + { + header('HTTP/1.0 403 forbidden'); + trigger_error('ERROR_NO_ATTACHMENT'); + } } // disallowed? @@ -222,6 +246,7 @@ else if (!download_allowed()) { + header('HTTP/1.0 403 forbidden'); trigger_error($user->lang['LINKAGE_FORBIDDEN']); } From 33f4d78d2eceddac2278e115540450ded9db1763 Mon Sep 17 00:00:00 2001 From: Henry Sudhof Date: Sat, 22 Mar 2008 12:31:17 +0000 Subject: [PATCH 095/102] people are so imaptient git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8456 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/schemas/firebird_schema.sql | 4 +++- phpBB/install/schemas/mssql_schema.sql | 6 +++++- phpBB/install/schemas/mysql_40_schema.sql | 6 ++++-- phpBB/install/schemas/mysql_41_schema.sql | 6 ++++-- phpBB/install/schemas/oracle_schema.sql | 5 ++++- phpBB/install/schemas/postgres_schema.sql | 4 +++- phpBB/install/schemas/sqlite_schema.sql | 4 +++- 7 files changed, 26 insertions(+), 9 deletions(-) diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index 3e0d981ed0..55ab4c18e1 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -445,7 +445,7 @@ CREATE TABLE phpbb_groups ( ALTER TABLE phpbb_groups ADD PRIMARY KEY (group_id);; -CREATE INDEX phpbb_groups_group_legend ON phpbb_groups(group_legend);; +CREATE INDEX phpbb_groups_group_legend_name ON phpbb_groups(group_legend, group_name);; CREATE GENERATOR phpbb_groups_gen;; SET GENERATOR phpbb_groups_gen TO 0;; @@ -960,6 +960,7 @@ CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch(post_id);; CREATE TABLE phpbb_sessions ( session_id CHAR(32) CHARACTER SET NONE DEFAULT '' NOT NULL, session_user_id INTEGER DEFAULT 0 NOT NULL, + session_forum_id INTEGER DEFAULT 0 NOT NULL, session_last_visit INTEGER DEFAULT 0 NOT NULL, session_start INTEGER DEFAULT 0 NOT NULL, session_time INTEGER DEFAULT 0 NOT NULL, @@ -976,6 +977,7 @@ ALTER TABLE phpbb_sessions ADD PRIMARY KEY (session_id);; CREATE INDEX phpbb_sessions_session_time ON phpbb_sessions(session_time);; CREATE INDEX phpbb_sessions_session_user_id ON phpbb_sessions(session_user_id);; +CREATE INDEX phpbb_sessions_session_forum_id ON phpbb_sessions(session_forum_id);; # Table: 'phpbb_sessions_keys' CREATE TABLE phpbb_sessions_keys ( diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 63a022bc6e..a6519bd69e 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -556,7 +556,7 @@ ALTER TABLE [phpbb_groups] WITH NOCHECK ADD ) ON [PRIMARY] GO -CREATE INDEX [group_legend] ON [phpbb_groups]([group_legend]) ON [PRIMARY] +CREATE INDEX [group_legend_name] ON [phpbb_groups]([group_legend], [group_name]) ON [PRIMARY] GO @@ -1153,6 +1153,7 @@ GO CREATE TABLE [phpbb_sessions] ( [session_id] [char] (32) DEFAULT ('') NOT NULL , [session_user_id] [int] DEFAULT (0) NOT NULL , + [session_forum_id] [int] DEFAULT (0) NOT NULL , [session_last_visit] [int] DEFAULT (0) NOT NULL , [session_start] [int] DEFAULT (0) NOT NULL , [session_time] [int] DEFAULT (0) NOT NULL , @@ -1179,6 +1180,9 @@ GO CREATE INDEX [session_user_id] ON [phpbb_sessions]([session_user_id]) ON [PRIMARY] GO +CREATE INDEX [session_forum_id] ON [phpbb_sessions]([session_forum_id]) ON [PRIMARY] +GO + /* Table: 'phpbb_sessions_keys' diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index ae508f73b7..266b7707d4 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -314,7 +314,7 @@ CREATE TABLE phpbb_groups ( group_message_limit mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, group_legend tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, PRIMARY KEY (group_id), - KEY group_legend (group_legend) + KEY group_legend_name (group_legend, group_name(255)) ); @@ -660,6 +660,7 @@ CREATE TABLE phpbb_search_wordmatch ( CREATE TABLE phpbb_sessions ( session_id binary(32) DEFAULT '' NOT NULL, session_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + session_forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, session_last_visit int(11) UNSIGNED DEFAULT '0' NOT NULL, session_start int(11) UNSIGNED DEFAULT '0' NOT NULL, session_time int(11) UNSIGNED DEFAULT '0' NOT NULL, @@ -672,7 +673,8 @@ CREATE TABLE phpbb_sessions ( session_admin tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (session_id), KEY session_time (session_time), - KEY session_user_id (session_user_id) + KEY session_user_id (session_user_id), + KEY session_forum_id (session_forum_id) ); diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index 907f25d1c8..bdce42b895 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -314,7 +314,7 @@ CREATE TABLE phpbb_groups ( group_message_limit mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, group_legend tinyint(1) UNSIGNED DEFAULT '1' NOT NULL, PRIMARY KEY (group_id), - KEY group_legend (group_legend) + KEY group_legend_name (group_legend, group_name) ) CHARACTER SET `utf8` COLLATE `utf8_bin`; @@ -660,6 +660,7 @@ CREATE TABLE phpbb_search_wordmatch ( CREATE TABLE phpbb_sessions ( session_id char(32) DEFAULT '' NOT NULL, session_user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + session_forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, session_last_visit int(11) UNSIGNED DEFAULT '0' NOT NULL, session_start int(11) UNSIGNED DEFAULT '0' NOT NULL, session_time int(11) UNSIGNED DEFAULT '0' NOT NULL, @@ -672,7 +673,8 @@ CREATE TABLE phpbb_sessions ( session_admin tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, PRIMARY KEY (session_id), KEY session_time (session_time), - KEY session_user_id (session_user_id) + KEY session_user_id (session_user_id), + KEY session_forum_id (session_forum_id) ) CHARACTER SET `utf8` COLLATE `utf8_bin`; diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 621b23690d..b87fe4527a 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -607,7 +607,7 @@ CREATE TABLE phpbb_groups ( ) / -CREATE INDEX phpbb_groups_group_legend ON phpbb_groups (group_legend) +CREATE INDEX phpbb_groups_group_legend_name ON phpbb_groups (group_legend, group_name) / CREATE SEQUENCE phpbb_groups_seq @@ -1281,6 +1281,7 @@ CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch (post_id) CREATE TABLE phpbb_sessions ( session_id char(32) DEFAULT '' , session_user_id number(8) DEFAULT '0' NOT NULL, + session_forum_id number(8) DEFAULT '0' NOT NULL, session_last_visit number(11) DEFAULT '0' NOT NULL, session_start number(11) DEFAULT '0' NOT NULL, session_time number(11) DEFAULT '0' NOT NULL, @@ -1299,6 +1300,8 @@ CREATE INDEX phpbb_sessions_session_time ON phpbb_sessions (session_time) / CREATE INDEX phpbb_sessions_session_user_id ON phpbb_sessions (session_user_id) / +CREATE INDEX phpbb_sessions_session_forum_id ON phpbb_sessions (session_forum_id) +/ /* Table: 'phpbb_sessions_keys' diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index 249f67a007..84e2845963 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -459,7 +459,7 @@ CREATE TABLE phpbb_groups ( PRIMARY KEY (group_id) ); -CREATE INDEX phpbb_groups_group_legend ON phpbb_groups (group_legend); +CREATE INDEX phpbb_groups_group_legend_name ON phpbb_groups (group_legend, group_name); /* Table: 'phpbb_icons' @@ -875,6 +875,7 @@ CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch (post_id); CREATE TABLE phpbb_sessions ( session_id char(32) DEFAULT '' NOT NULL, session_user_id INT4 DEFAULT '0' NOT NULL CHECK (session_user_id >= 0), + session_forum_id INT4 DEFAULT '0' NOT NULL CHECK (session_forum_id >= 0), session_last_visit INT4 DEFAULT '0' NOT NULL CHECK (session_last_visit >= 0), session_start INT4 DEFAULT '0' NOT NULL CHECK (session_start >= 0), session_time INT4 DEFAULT '0' NOT NULL CHECK (session_time >= 0), @@ -890,6 +891,7 @@ CREATE TABLE phpbb_sessions ( CREATE INDEX phpbb_sessions_session_time ON phpbb_sessions (session_time); CREATE INDEX phpbb_sessions_session_user_id ON phpbb_sessions (session_user_id); +CREATE INDEX phpbb_sessions_session_forum_id ON phpbb_sessions (session_forum_id); /* Table: 'phpbb_sessions_keys' diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index 2ac349c3e9..f7b5b47081 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -307,7 +307,7 @@ CREATE TABLE phpbb_groups ( group_legend INTEGER UNSIGNED NOT NULL DEFAULT '1' ); -CREATE INDEX phpbb_groups_group_legend ON phpbb_groups (group_legend); +CREATE INDEX phpbb_groups_group_legend_name ON phpbb_groups (group_legend, group_name); # Table: 'phpbb_icons' CREATE TABLE phpbb_icons ( @@ -638,6 +638,7 @@ CREATE INDEX phpbb_search_wordmatch_post_id ON phpbb_search_wordmatch (post_id); CREATE TABLE phpbb_sessions ( session_id char(32) NOT NULL DEFAULT '', session_user_id INTEGER UNSIGNED NOT NULL DEFAULT '0', + session_forum_id INTEGER UNSIGNED NOT NULL DEFAULT '0', session_last_visit INTEGER UNSIGNED NOT NULL DEFAULT '0', session_start INTEGER UNSIGNED NOT NULL DEFAULT '0', session_time INTEGER UNSIGNED NOT NULL DEFAULT '0', @@ -653,6 +654,7 @@ CREATE TABLE phpbb_sessions ( CREATE INDEX phpbb_sessions_session_time ON phpbb_sessions (session_time); CREATE INDEX phpbb_sessions_session_user_id ON phpbb_sessions (session_user_id); +CREATE INDEX phpbb_sessions_session_forum_id ON phpbb_sessions (session_forum_id); # Table: 'phpbb_sessions_keys' CREATE TABLE phpbb_sessions_keys ( From d182a88b681dda2893e569b87948f7012fa230c6 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 23 Mar 2008 14:39:38 +0000 Subject: [PATCH 096/102] Forbidden should have an uppercase F git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8459 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/download/file.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/phpBB/download/file.php b/phpBB/download/file.php index 0be562aadf..9940bf9aa5 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -48,7 +48,7 @@ if (isset($_GET['avatar'])) // '==' is not a bug - . as the first char is as bad as no dot at all if (strpos($filename, '.') == false) { - header('HTTP/1.0 403 forbidden'); + header('HTTP/1.0 403 Forbidden'); if (!empty($cache)) { $cache->unload(); @@ -89,7 +89,7 @@ if (isset($_GET['avatar'])) if (!in_array($ext, array('png', 'gif', 'jpg', 'jpeg'))) { // no way such an avatar could exist. They are not following the rules, stop the show. - header("HTTP/1.0 403 forbidden"); + header("HTTP/1.0 403 Forbidden"); if (!empty($cache)) { $cache->unload(); @@ -101,7 +101,7 @@ if (isset($_GET['avatar'])) if (!$filename) { // no way such an avatar could exist. They are not following the rules, stop the show. - header("HTTP/1.0 403 forbidden"); + header("HTTP/1.0 403 Forbidden"); if (!empty($cache)) { $cache->unload(); @@ -208,7 +208,7 @@ else $row['forum_id'] = false; if (!$auth->acl_get('u_pm_download')) { - header('HTTP/1.0 403 forbidden'); + header('HTTP/1.0 403 Forbidden'); trigger_error('SORRY_AUTH_VIEW_ATTACH'); } @@ -231,7 +231,7 @@ else if (!$allowed) { - header('HTTP/1.0 403 forbidden'); + header('HTTP/1.0 403 Forbidden'); trigger_error('ERROR_NO_ATTACHMENT'); } } @@ -246,7 +246,7 @@ else if (!download_allowed()) { - header('HTTP/1.0 403 forbidden'); + header('HTTP/1.0 403 Forbidden'); trigger_error($user->lang['LINKAGE_FORBIDDEN']); } From b33b5f63eba7dbf24421bea1d7cfcfe21667736c Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 23 Mar 2008 17:11:43 +0000 Subject: [PATCH 097/102] only allow users having the a_user permission to search by email address (later on there will most likely a new permission for general email visibility) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8460 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/memberlist.php | 25 +++++++++++-------- .../prosilver/template/memberlist_search.html | 2 ++ .../template/memberlist_search.html | 4 +++ 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 6d1f0759cc..b7490eabb1 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -143,6 +143,7 @@
    259. [Fix] Do not error out if php_uname function disabled / Authenticating on SMTP Server (Bug #22235 - patch by HoL)
    260. [Fix] Correctly obtain to be ignored users within topic/forum notification (Bug #21795 - patch provided by dr.death)
    261. [Fix] Correctly update board statistics for attaching orphaned files to existing posts (Bug #20185)
    262. +
    263. [Sec] Only allow searching by email address in memberlist for users having the a_user permission (reported by evil<3)
    264. diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 18a8c9b77c..a4c6b18f8f 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -880,20 +880,22 @@ switch ($mode) $template_html = 'memberlist_body.html'; // Sorting - $sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_LOCATION'], 'c' => $user->lang['SORT_JOINED'], 'd' => $user->lang['SORT_POST_COUNT'], 'e' => $user->lang['SORT_EMAIL'], 'f' => $user->lang['WEBSITE'], 'g' => $user->lang['ICQ'], 'h' => $user->lang['AIM'], 'i' => $user->lang['MSNM'], 'j' => $user->lang['YIM'], 'k' => $user->lang['JABBER']); + $sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_LOCATION'], 'c' => $user->lang['SORT_JOINED'], 'd' => $user->lang['SORT_POST_COUNT'], 'f' => $user->lang['WEBSITE'], 'g' => $user->lang['ICQ'], 'h' => $user->lang['AIM'], 'i' => $user->lang['MSNM'], 'j' => $user->lang['YIM'], 'k' => $user->lang['JABBER']); + $sort_key_sql = array('a' => 'u.username_clean', 'b' => 'u.user_from', 'c' => 'u.user_regdate', 'd' => 'u.user_posts', 'f' => 'u.user_website', 'g' => 'u.user_icq', 'h' => 'u.user_aim', 'i' => 'u.user_msnm', 'j' => 'u.user_yim', 'k' => 'u.user_jabber'); + + if ($auth->acl_get('a_user')) + { + $sort_key_text['e'] = $user->lang['SORT_EMAIL']; + $sort_key_sql['e'] = 'u.user_email'; + } if ($auth->acl_get('u_viewonline')) { $sort_key_text['l'] = $user->lang['SORT_LAST_ACTIVE']; - } - $sort_key_text['m'] = $user->lang['SORT_RANK']; - - $sort_key_sql = array('a' => 'u.username_clean', 'b' => 'u.user_from', 'c' => 'u.user_regdate', 'd' => 'u.user_posts', 'e' => 'u.user_email', 'f' => 'u.user_website', 'g' => 'u.user_icq', 'h' => 'u.user_aim', 'i' => 'u.user_msnm', 'j' => 'u.user_yim', 'k' => 'u.user_jabber'); - - if ($auth->acl_get('u_viewonline')) - { $sort_key_sql['l'] = 'u.user_lastvisit'; } + + $sort_key_text['m'] = $user->lang['SORT_RANK']; $sort_key_sql['m'] = 'u.user_rank DESC, u.user_posts'; $sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']); @@ -969,7 +971,7 @@ switch ($mode) } $sql_where .= ($username) ? ' AND u.username_clean ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($username))) : ''; - $sql_where .= ($email) ? ' AND u.user_email ' . $db->sql_like_expression(str_replace('*', $db->any_char, $email)) . ' ' : ''; + $sql_where .= ($auth->acl_get('a_user') && $email) ? ' AND u.user_email ' . $db->sql_like_expression(str_replace('*', $db->any_char, $email)) . ' ' : ''; $sql_where .= ($icq) ? ' AND u.user_icq ' . $db->sql_like_expression(str_replace('*', $db->any_char, $icq)) . ' ' : ''; $sql_where .= ($aim) ? ' AND u.user_aim ' . $db->sql_like_expression(str_replace('*', $db->any_char, $aim)) . ' ' : ''; $sql_where .= ($yahoo) ? ' AND u.user_yim ' . $db->sql_like_expression(str_replace('*', $db->any_char, $yahoo)) . ' ' : ''; @@ -1286,6 +1288,7 @@ switch ($mode) 'IP' => $ipdomain, 'S_IP_SEARCH_ALLOWED' => ($auth->acl_getf_global('m_info')) ? true : false, + 'S_EMAIL_SEARCH_ALLOWED'=> ($auth->acl_get('a_user')) ? true : false, 'S_IN_SEARCH_POPUP' => ($form && $field) ? true : false, 'S_SEARCH_USER' => true, 'S_FORM_NAME' => $form, @@ -1485,9 +1488,9 @@ 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')) + if (!empty($data['user_allow_viewemail']) || $auth->acl_get('a_user')) { - $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']); + $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_user')) ? '' : 'mailto:' . $data['user_email']); } else { diff --git a/phpBB/styles/prosilver/template/memberlist_search.html b/phpBB/styles/prosilver/template/memberlist_search.html index 1d1d45bf8e..65c4707944 100644 --- a/phpBB/styles/prosilver/template/memberlist_search.html +++ b/phpBB/styles/prosilver/template/memberlist_search.html @@ -53,10 +53,12 @@ function insert_single(user)
      +
      +
      diff --git a/phpBB/styles/subsilver2/template/memberlist_search.html b/phpBB/styles/subsilver2/template/memberlist_search.html index fff71a90d6..96ffad00d6 100644 --- a/phpBB/styles/subsilver2/template/memberlist_search.html +++ b/phpBB/styles/subsilver2/template/memberlist_search.html @@ -84,8 +84,12 @@
      + + + + From 45673658a10cb8493801b96ceecab3acccda3e5d Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 23 Mar 2008 18:40:06 +0000 Subject: [PATCH 098/102] up the version number - RC1 is most likely due tomorrow git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8461 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/install/database_update.php | 2 +- phpBB/install/schemas/schema_data.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 856640b58b..d87b0fa459 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -8,7 +8,7 @@ * */ -$updates_to_version = '3.0.1-dev'; +$updates_to_version = '3.0.1-RC1'; // Return if we "just include it" to find out for which version the database update is responsible for if (defined('IN_PHPBB') && defined('IN_INSTALL')) diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index ccfb229e74..f0037ea4cd 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -213,7 +213,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.1-dev'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.1-RC1'); 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 50e1d938879db3385eb446eade2a3b7950b85fe3 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 24 Mar 2008 00:16:13 +0000 Subject: [PATCH 099/102] - [Fix] Do not detect the board URL as a link twice in posts (Bug #19215) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8462 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 2 +- phpBB/includes/functions_content.php | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index b7490eabb1..8b68dc680f 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -144,7 +144,7 @@
    265. [Fix] Correctly obtain to be ignored users within topic/forum notification (Bug #21795 - patch provided by dr.death)
    266. [Fix] Correctly update board statistics for attaching orphaned files to existing posts (Bug #20185)
    267. [Sec] Only allow searching by email address in memberlist for users having the a_user permission (reported by evil<3)
    268. - +
    269. [Fix] Do not detect the board URL as a link twice in posts (Bug #19215)
    270. 1.i. Changes since 3.0.RC8

      diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index 0d367f953f..9eab477a8a 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -492,6 +492,7 @@ function generate_text_for_edit($text, $uid, $flags) */ function make_clickable_callback($type, $whitespace, $url, $relative_url, $class) { + $orig_url = $url . $relative_url; $append = ''; $url = htmlspecialchars_decode($url); $relative_url = htmlspecialchars_decode($relative_url); @@ -558,29 +559,39 @@ function make_clickable_callback($type, $whitespace, $url, $relative_url, $class break; } + $short_url = (strlen($url) > 55) ? substr($url, 0, 39) . ' ... ' . substr($url, -10) : $url; + switch ($type) { case MAGIC_URL_LOCAL: $tag = 'l'; $relative_url = preg_replace('/[&?]sid=[0-9a-f]{32}$/', '', preg_replace('/([&?])sid=[0-9a-f]{32}&/', '$1', $relative_url)); $url = $url . '/' . $relative_url; - $text = ($relative_url) ? $relative_url : $url; + $text = $relative_url; + + // this url goes to http://domain.tld/path/to/board/ which + // would result in an empty link if treated as local so + // don't touch it and let MAGIC_URL_FULL take care of it. + if (!$relative_url) + { + return $orig_url . '/'; // slash is taken away by relative url pattern + } break; case MAGIC_URL_FULL: $tag = 'm'; - $text = (strlen($url) > 55) ? substr($url, 0, 39) . ' ... ' . substr($url, -10) : $url; + $text = $short_url; break; case MAGIC_URL_WWW: $tag = 'w'; $url = 'http://' . $url; - $text = (strlen($url) > 55) ? substr($url, 0, 39) . ' ... ' . substr($url, -10) : $url; + $text = $short_url; break; case MAGIC_URL_EMAIL: $tag = 'e'; - $text = (strlen($url) > 55) ? substr($url, 0, 39) . ' ... ' . substr($url, -10) : $url; + $text = $short_url; $url = 'mailto:' . $url; break; } From d02f00aa2977c63edf910c048c26d8ea793c547e Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 24 Mar 2008 00:26:24 +0000 Subject: [PATCH 100/102] - [Fix] Set correct error reporting in style.php to avoid blank pages after CSS changes (Bug #23885) git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8464 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/style.php | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 8b68dc680f..a526625b40 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -145,6 +145,7 @@
    271. [Fix] Correctly update board statistics for attaching orphaned files to existing posts (Bug #20185)
    272. [Sec] Only allow searching by email address in memberlist for users having the a_user permission (reported by evil<3)
    273. [Fix] Do not detect the board URL as a link twice in posts (Bug #19215)
    274. +
    275. [Fix] Set correct error reporting in style.php to avoid blank pages after CSS changes (Bug #23885)
    276. 1.i. Changes since 3.0.RC8

      diff --git a/phpBB/style.php b/phpBB/style.php index 75c440bb63..469e2b7727 100644 --- a/phpBB/style.php +++ b/phpBB/style.php @@ -14,6 +14,10 @@ define('IN_PHPBB', true); $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; $phpEx = substr(strrchr(__FILE__, '.'), 1); + +// Report all errors, except notices +error_reporting(E_ALL ^ E_NOTICE); + require($phpbb_root_path . 'config.' . $phpEx); if (version_compare(PHP_VERSION, '6.0.0-dev', '<')) From f170f1c929a87398d756d1e7372baa818e9f60f8 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Mon, 24 Mar 2008 12:54:59 +0000 Subject: [PATCH 101/102] oh, forgot to update the changelog... git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8469 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index a526625b40..26f7a74021 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -143,9 +143,11 @@
    277. [Fix] Do not error out if php_uname function disabled / Authenticating on SMTP Server (Bug #22235 - patch by HoL)
    278. [Fix] Correctly obtain to be ignored users within topic/forum notification (Bug #21795 - patch provided by dr.death)
    279. [Fix] Correctly update board statistics for attaching orphaned files to existing posts (Bug #20185)
    280. -
    281. [Sec] Only allow searching by email address in memberlist for users having the a_user permission (reported by evil<3)
    282. [Fix] Do not detect the board URL as a link twice in posts (Bug #19215)
    283. [Fix] Set correct error reporting in style.php to avoid blank pages after CSS changes (Bug #23885)
    284. +
    285. [Fix] If pruning users based on last activity, do not include users never logged in before (Bug #18105)
    286. +
    287. [Sec] Only allow searching by email address in memberlist for users having the a_user permission (reported by evil<3)
    288. +
    289. [Sec] Limit private message attachments to be viewable only by the recipient(s)/sender (Report #s23535) - reported by AlleyKat
    290. 1.i. Changes since 3.0.RC8

      {L_EMAIL}:   {L_AIM}: