From 65921ae67a98fa1aa9010ffd433e6420dd224e81 Mon Sep 17 00:00:00 2001 From: Raimon Date: Sun, 13 Nov 2011 20:10:51 +0100 Subject: [PATCH 001/117] [ticket/10453] PM viewmessage page is misplacing the online icon PHPBB3-10453 http://tracker.phpbb.com/browse/PHPBB3-10453 --- .../template/ucp_pm_message_header.html | 29 +++++++++---------- .../prosilver/template/ucp_pm_viewfolder.html | 1 - .../template/ucp_pm_viewmessage.html | 11 ++++--- phpBB/styles/prosilver/theme/colours.css | 6 ---- phpBB/styles/prosilver/theme/cp.css | 27 ++--------------- 5 files changed, 24 insertions(+), 50 deletions(-) diff --git a/phpBB/styles/prosilver/template/ucp_pm_message_header.html b/phpBB/styles/prosilver/template/ucp_pm_message_header.html index fcebab0868..a1017d4b44 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_message_header.html +++ b/phpBB/styles/prosilver/template/ucp_pm_message_header.html @@ -1,25 +1,28 @@

{L_TITLE}: {CUR_FOLDER_NAME}

-
+
+ + - - + diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html b/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html index d7e02e405e..c9f28cec64 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html +++ b/phpBB/styles/prosilver/template/ucp_pm_viewfolder.html @@ -2,7 +2,6 @@ -
diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html index df0cf25e82..79c2c0355f 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html +++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html @@ -1,18 +1,21 @@ - + +
+
+ -
+
{L_VIEW_PREVIOUS_HISTORY} {L_VIEW_NEXT_HISTORY}
-
-
+
+
diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css index e98ce237bc..b9e4491feb 100644 --- a/phpBB/styles/prosilver/theme/colours.css +++ b/phpBB/styles/prosilver/theme/colours.css @@ -884,12 +884,6 @@ dl.mini dt { color: #000000 !important; } -/* PM panel adjustments */ -.pm-panel-header, -#cp-main .pm-message-nav { - border-bottom-color: #A4B3BF; -} - /* PM marking colours */ .pmlist li.pm_message_reported_colour, .pm_message_reported_colour { border-left-color: #BC2A4D; diff --git a/phpBB/styles/prosilver/theme/cp.css b/phpBB/styles/prosilver/theme/cp.css index b574b0ae1f..9d04371115 100644 --- a/phpBB/styles/prosilver/theme/cp.css +++ b/phpBB/styles/prosilver/theme/cp.css @@ -349,31 +349,10 @@ dl.mini dd { } /* PM panel adjustments */ -.pm-panel-header { - margin: 0; - padding-bottom: 10px; - border-bottom: 1px dashed #A4B3BF; -} - .reply-all { - display: block; - padding-top: 4px; - clear: both; - float: left; -} - -.pm-panel-message { - padding-top: 10px; -} - -.pm-return-to { - padding-top: 23px; -} - -#cp-main .pm-message-nav { - margin: 0; - padding: 2px 10px 5px 10px; - border-bottom: 1px dashed #A4B3BF; + margin-bottom: -60px; + position: absolute; + margin-left: 200px; } /* PM Message history */ From c0ffc8386ccad6a6a3070faed1ae748f61ac9858 Mon Sep 17 00:00:00 2001 From: Raimon Date: Mon, 14 Nov 2011 21:38:10 +0100 Subject: [PATCH 002/117] [ticket/10453] PM viewmessage page is misplacing the online icon Removed the position: absolute value, and made it so that if the buttons are bigger the text move with it, also added support for bidi.css (text right to left). PHPBB3-10453 http://tracker.phpbb.com/browse/PHPBB3-10453 --- .../prosilver/template/ucp_pm_message_header.html | 8 +------- phpBB/styles/prosilver/theme/bidi.css | 13 +++++++++++++ phpBB/styles/prosilver/theme/cp.css | 13 ++++++++++--- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/phpBB/styles/prosilver/template/ucp_pm_message_header.html b/phpBB/styles/prosilver/template/ucp_pm_message_header.html index a1017d4b44..c3b7e54f45 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_message_header.html +++ b/phpBB/styles/prosilver/template/ucp_pm_message_header.html @@ -6,18 +6,12 @@

{FOLDER_STATUS}

- - - diff --git a/phpBB/styles/prosilver/theme/bidi.css b/phpBB/styles/prosilver/theme/bidi.css index f441784d85..c4a46b432c 100644 --- a/phpBB/styles/prosilver/theme/bidi.css +++ b/phpBB/styles/prosilver/theme/bidi.css @@ -591,6 +591,19 @@ /* PM Styles ----------------------------------------*/ +/* PM panel adjustments */ +.rtl .reply-all a.right { + background-position: 5% 60%; +} + +.rtl .reply-all a.right:hover { + background-position: 3% 60%; +} + +.rtl .reply-all { + padding-left: 5px; +} + /* Defined rules list for PM options */ .rtl ol.def-rules { padding-right: 0; diff --git a/phpBB/styles/prosilver/theme/cp.css b/phpBB/styles/prosilver/theme/cp.css index 9d04371115..6f45d13cef 100644 --- a/phpBB/styles/prosilver/theme/cp.css +++ b/phpBB/styles/prosilver/theme/cp.css @@ -349,10 +349,17 @@ dl.mini dd { } /* PM panel adjustments */ +.reply-all a.left { + background-position: 3px 60%; +} + +.reply-all a.left:hover { + background-position: 0px 60%; +} + .reply-all { - margin-bottom: -60px; - position: absolute; - margin-left: 200px; + font-size: 11px; + padding-top: 5px; } /* PM Message history */ From c4a19a4e3eb4fe068146a33fa0cf958a14f7871b Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sun, 27 Nov 2011 00:17:22 -0500 Subject: [PATCH 003/117] [ticket/10500] Fix phpbb_template_compile instantiation. The required $allow_php argument was missing. PHPBB3-10500 --- phpBB/develop/compile_template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/develop/compile_template.php b/phpBB/develop/compile_template.php index e741e909d8..32d1d321f1 100644 --- a/phpBB/develop/compile_template.php +++ b/phpBB/develop/compile_template.php @@ -20,5 +20,5 @@ include($phpbb_root_path . 'includes/template_compile.'.$phpEx); $file = $argv[1]; -$compile = new phpbb_template_compile(); +$compile = new phpbb_template_compile(false); echo $compile->compile_file($file); From 552df1f6eb79599bbf48743b0ce35cba35a956c6 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sun, 27 Nov 2011 00:38:29 -0500 Subject: [PATCH 004/117] [ticket/10500] Use correct class name in @uses. PHPBB3-10500 --- phpBB/includes/template/template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/template/template.php b/phpBB/includes/template/template.php index 228ea93513..267d637150 100644 --- a/phpBB/includes/template/template.php +++ b/phpBB/includes/template/template.php @@ -306,7 +306,7 @@ class phpbb_template * * @param string $handle Handle of the template to load * @return phpbb_template_renderer Template renderer object, or null on failure - * @uses template_compile is used to compile template source + * @uses phpbb_template_compile is used to compile template source */ private function _tpl_load($handle) { From 18aa4e4ecd55b846ead8e15853164bb5742099ef Mon Sep 17 00:00:00 2001 From: David King Date: Thu, 15 Dec 2011 15:13:11 +0000 Subject: [PATCH 005/117] [ticket/10535] Remove email confirm check on registration form PHPBB3-10535 --- phpBB/includes/ucp/ucp_register.php | 9 --------- phpBB/styles/prosilver/template/ucp_register.html | 4 ---- phpBB/styles/subsilver2/template/ucp_register.html | 4 ---- 3 files changed, 17 deletions(-) diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index fe09d0a9fe..56efc4706f 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -100,7 +100,6 @@ class ucp_register $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', '')), 'lang' => $user->lang_name, 'tz' => request_var('tz', (float) $config['board_timezone']), )); @@ -189,7 +188,6 @@ class ucp_register 'new_password' => request_var('new_password', '', true), 'password_confirm' => request_var('password_confirm', '', true), 'email' => strtolower(request_var('email', '')), - 'email_confirm' => strtolower(request_var('email_confirm', '')), 'lang' => basename(request_var('lang', $user->lang_name)), 'tz' => request_var('tz', (float) $timezone), ); @@ -208,7 +206,6 @@ class ucp_register 'email' => array( array('string', false, 6, 60), array('email')), - 'email_confirm' => array('string', false, 6, 60), 'tz' => array('num', false, -14, 14), 'lang' => array('language_iso_name'), )); @@ -253,11 +250,6 @@ class ucp_register { $error[] = $user->lang['NEW_PASSWORD_ERROR']; } - - if ($data['email'] != $data['email_confirm']) - { - $error[] = $user->lang['NEW_EMAIL_ERROR']; - } } if (!sizeof($error)) @@ -472,7 +464,6 @@ class ucp_register 'PASSWORD' => $data['new_password'], 'PASSWORD_CONFIRM' => $data['password_confirm'], 'EMAIL' => $data['email'], - 'EMAIL_CONFIRM' => $data['email_confirm'], 'L_REG_COND' => $l_reg_cond, 'L_USERNAME_EXPLAIN' => $user->lang($config['allow_name_chars'] . '_EXPLAIN', $user->lang('CHARACTERS', (int) $config['min_name_chars']), $user->lang('CHARACTERS', (int) $config['max_name_chars'])), diff --git a/phpBB/styles/prosilver/template/ucp_register.html b/phpBB/styles/prosilver/template/ucp_register.html index dd0e5ad02a..30ed37eecc 100644 --- a/phpBB/styles/prosilver/template/ucp_register.html +++ b/phpBB/styles/prosilver/template/ucp_register.html @@ -38,10 +38,6 @@
-
-
-
-

{L_PASSWORD_EXPLAIN}
diff --git a/phpBB/styles/subsilver2/template/ucp_register.html b/phpBB/styles/subsilver2/template/ucp_register.html index ad6fb8d056..0c3533292d 100644 --- a/phpBB/styles/subsilver2/template/ucp_register.html +++ b/phpBB/styles/subsilver2/template/ucp_register.html @@ -41,10 +41,6 @@ {L_EMAIL_ADDRESS}: - - {L_CONFIRM_EMAIL}: - - {L_PASSWORD}:
{L_PASSWORD_EXPLAIN} From d73c3a297e1f31320c054685d5e38cb72a6357f3 Mon Sep 17 00:00:00 2001 From: David King Date: Thu, 15 Dec 2011 23:15:24 +0000 Subject: [PATCH 006/117] [ticket/10535] Removed email confirm from UCP, removed unused language entries PHPBB3-10535 --- phpBB/includes/ucp/ucp_profile.php | 7 ------- phpBB/language/en/ucp.php | 4 ---- .../styles/prosilver/template/ucp_profile_reg_details.html | 6 ------ 3 files changed, 17 deletions(-) diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 6eb11e6e59..2bc438e042 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -47,7 +47,6 @@ class ucp_profile $data = array( 'username' => utf8_normalize_nfc(request_var('username', $user->data['username'], true)), 'email' => strtolower(request_var('email', $user->data['user_email'])), - 'email_confirm' => strtolower(request_var('email_confirm', '')), 'new_password' => request_var('new_password', '', true), 'cur_password' => request_var('cur_password', '', true), 'password_confirm' => request_var('password_confirm', '', true), @@ -66,7 +65,6 @@ class ucp_profile 'email' => array( array('string', false, 6, 60), array('email')), - 'email_confirm' => array('string', true, 6, 60), ); if ($auth->acl_get('u_chgname') && $config['allow_namechange']) @@ -79,11 +77,6 @@ class ucp_profile $error = validate_data($data, $check_ary); - if ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email'] && $data['email_confirm'] != $data['email']) - { - $error[] = ($data['email_confirm']) ? 'NEW_EMAIL_ERROR' : 'NEW_EMAIL_CONFIRM_EMPTY'; - } - if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && $data['password_confirm'] != $data['new_password']) { $error[] = ($data['password_confirm']) ? 'NEW_PASSWORD_ERROR' : 'NEW_PASSWORD_CONFIRM_EMPTY'; diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php index 59e5cb1952..227b1c92a3 100644 --- a/phpBB/language/en/ucp.php +++ b/phpBB/language/en/ucp.php @@ -123,8 +123,6 @@ $lang = array_merge($lang, array( 'CLICK_RETURN_FOLDER' => '%1$sReturn to your “%3$s” folder%2$s', 'CONFIRMATION' => 'Confirmation of registration', 'CONFIRM_CHANGES' => 'Confirm changes', - 'CONFIRM_EMAIL' => 'Confirm e-mail address', - 'CONFIRM_EMAIL_EXPLAIN' => 'You only need to specify this if you are changing your e-mail address.', 'CONFIRM_EXPLAIN' => 'To prevent automated registrations the board requires you to enter a confirmation code. The code is displayed in the image you should see below. If you are visually impaired or cannot otherwise read this code please contact the %sBoard Administrator%s.', 'VC_REFRESH' => 'Refresh confirmation code', 'VC_REFRESH_EXPLAIN' => 'If you cannot read the code you can request a new one by clicking the button.', @@ -283,8 +281,6 @@ $lang = array_merge($lang, array( 'MOVE_TO_FOLDER' => 'Move to folder', 'MOVE_UP' => 'Move up', - 'NEW_EMAIL_CONFIRM_EMPTY' => 'You did not enter a confirm e-mail address.', - 'NEW_EMAIL_ERROR' => 'The e-mail addresses you entered do not match.', 'NEW_FOLDER_NAME' => 'New folder name', 'NEW_PASSWORD' => 'New password', 'NEW_PASSWORD_CONFIRM_EMPTY' => 'You did not enter a confirm password.', diff --git a/phpBB/styles/prosilver/template/ucp_profile_reg_details.html b/phpBB/styles/prosilver/template/ucp_profile_reg_details.html index 9c3e98d053..9d4a9e3463 100644 --- a/phpBB/styles/prosilver/template/ucp_profile_reg_details.html +++ b/phpBB/styles/prosilver/template/ucp_profile_reg_details.html @@ -20,12 +20,6 @@
{EMAIL}
- -
-

{L_CONFIRM_EMAIL_EXPLAIN}
-
-
-

{L_CHANGE_PASSWORD_EXPLAIN}
From fd58a0ad374cfd535b0aff2f4bf1564a479fcdd0 Mon Sep 17 00:00:00 2001 From: David King Date: Thu, 15 Dec 2011 23:17:21 +0000 Subject: [PATCH 007/117] [ticket/10535] Forgot a subsilver2 change. *doh* PHPBB3-10535 --- .../styles/subsilver2/template/ucp_profile_reg_details.html | 6 ------ 1 file changed, 6 deletions(-) diff --git a/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html b/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html index 1b1c28fa3b..96e2e26683 100644 --- a/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html +++ b/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html @@ -22,12 +22,6 @@ {L_EMAIL_ADDRESS}: {EMAIL} - - - {L_CONFIRM_EMAIL}:
{L_CONFIRM_EMAIL_EXPLAIN} - - - {L_NEW_PASSWORD}:
{L_CHANGE_PASSWORD_EXPLAIN} From b8ddd329225894ecd181146be799f0f8a085fcc4 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Fri, 23 Dec 2011 01:45:41 -0500 Subject: [PATCH 008/117] [ticket/7432] Explain what users are inactive in more detail. PHPBB3-7432 --- phpBB/language/en/acp/common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index ef8d6f1cb3..79caa07d98 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -405,7 +405,7 @@ $lang = array_merge($lang, array( 'INACTIVE_REASON_UNKNOWN' => 'Unknown', 'INACTIVE_USERS' => 'Inactive users', 'INACTIVE_USERS_EXPLAIN' => 'This is a list of users who have registered but whose accounts are inactive. You can activate, delete or remind (by sending an e-mail) these users if you wish.', - 'INACTIVE_USERS_EXPLAIN_INDEX' => 'This is a list of the last 10 registered users who have inactive accounts. A full list is available from the appropriate menu item or by following the link below from where you can activate, delete or remind (by sending an e-mail) these users if you wish.', + 'INACTIVE_USERS_EXPLAIN_INDEX' => 'This is a list of the last 10 registered users who have inactive accounts. Accounts are inactive either because account activation was enabled in user registration settings and these users’ accounts have not yet been activated, or because these accounts have been deactivated. A full list is available from the appropriate menu item or by following the link below from where you can activate, delete or remind (by sending an e-mail) these users if you wish.', 'NO_INACTIVE_USERS' => 'No inactive users', From 4baa2bb52c47b0b0e316c3a25f34e7bc27075ffd Mon Sep 17 00:00:00 2001 From: David King Date: Fri, 23 Dec 2011 21:55:49 +0000 Subject: [PATCH 009/117] [ticket/10535] Removed email confirm field from acp_users module PHPBB3-10535 --- phpBB/adm/style/acp_users_overview.html | 4 ---- phpBB/includes/acp/acp_users.php | 7 ------- 2 files changed, 11 deletions(-) diff --git a/phpBB/adm/style/acp_users_overview.html b/phpBB/adm/style/acp_users_overview.html index 9237e45daf..1f10e7f66e 100644 --- a/phpBB/adm/style/acp_users_overview.html +++ b/phpBB/adm/style/acp_users_overview.html @@ -45,10 +45,6 @@
-
-

{L_CONFIRM_EMAIL_EXPLAIN}
-
-

{L_CHANGE_PASSWORD_EXPLAIN}
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index c1ad28ca14..cf5650a901 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -757,7 +757,6 @@ class acp_users 'username' => utf8_normalize_nfc(request_var('user', $user_row['username'], true)), 'user_founder' => request_var('user_founder', ($user_row['user_type'] == USER_FOUNDER) ? 1 : 0), 'email' => strtolower(request_var('user_email', $user_row['user_email'])), - 'email_confirm' => strtolower(request_var('email_confirm', '')), 'new_password' => request_var('new_password', '', true), 'password_confirm' => request_var('password_confirm', '', true), ); @@ -789,7 +788,6 @@ class acp_users array('string', false, 6, 60), array('email', $user_row['user_email']) ), - 'email_confirm' => array('string', true, 6, 60) ); } @@ -800,11 +798,6 @@ class acp_users $error[] = 'NEW_PASSWORD_ERROR'; } - if ($data['email'] != $user_row['user_email'] && $data['email_confirm'] != $data['email']) - { - $error[] = 'NEW_EMAIL_ERROR'; - } - if (!check_form_key($form_name)) { $error[] = 'FORM_INVALID'; From fc297a710e56d938afce83de401b103c72218a1b Mon Sep 17 00:00:00 2001 From: p Date: Fri, 23 Dec 2011 22:10:34 +0000 Subject: [PATCH 010/117] [ticket/10535] Delete email confirm from installer PHPBB3-10535 --- phpBB/install/install_install.php | 23 +++++++------------ phpBB/language/en/install.php | 1 - .../phpbb_functional_test_case.php | 3 +-- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 21fe355447..cfef1861cf 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -690,7 +690,7 @@ class install_install extends module $error = array(); // Check the entered email address and password - if ($data['admin_name'] == '' || $data['admin_pass1'] == '' || $data['admin_pass2'] == '' || $data['board_email1'] == '' || $data['board_email2'] == '') + if ($data['admin_name'] == '' || $data['admin_pass1'] == '' || $data['admin_pass2'] == '' || $data['board_email'] == '') { $error[] = $lang['INST_ERR_MISSING_DATA']; } @@ -722,12 +722,7 @@ class install_install extends module $error[] = $lang['INST_ERR_PASSWORD_TOO_LONG']; } - if ($data['board_email1'] != $data['board_email2'] && $data['board_email1'] != '') - { - $error[] = $lang['INST_ERR_EMAIL_MISMATCH']; - } - - if ($data['board_email1'] != '' && !preg_match('/^' . get_preg_expression('email') . '$/i', $data['board_email1'])) + if ($data['board_email'] != '' && !preg_match('/^' . get_preg_expression('email') . '$/i', $data['board_email'])) { $error[] = $lang['INST_ERR_EMAIL_INVALID']; } @@ -1251,11 +1246,11 @@ class install_install extends module WHERE config_name = 'server_port'", 'UPDATE ' . $data['table_prefix'] . "config - SET config_value = '" . $db->sql_escape($data['board_email1']) . "' + SET config_value = '" . $db->sql_escape($data['board_email']) . "' WHERE config_name = 'board_email'", 'UPDATE ' . $data['table_prefix'] . "config - SET config_value = '" . $db->sql_escape($data['board_email1']) . "' + SET config_value = '" . $db->sql_escape($data['board_email']) . "' WHERE config_name = 'board_contact'", 'UPDATE ' . $data['table_prefix'] . "config @@ -1315,7 +1310,7 @@ class install_install extends module 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 = " . $db->sql_escape(phpbb_email_hash($data['board_email1'])) . ", username_clean = '" . $db->sql_escape(utf8_clean_string($data['admin_name'])) . "' + 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_email']) . "', user_dateformat='" . $db->sql_escape($lang['default_dateformat']) . "', user_email_hash = " . $db->sql_escape(phpbb_email_hash($data['board_email'])) . ", username_clean = '" . $db->sql_escape(utf8_clean_string($data['admin_name'])) . "' WHERE username = 'Admin'", 'UPDATE ' . $data['table_prefix'] . "moderator_cache @@ -1831,7 +1826,7 @@ class install_install extends module $messenger->template('installed', $data['language']); - $messenger->to($data['board_email1'], $data['admin_name']); + $messenger->to($data['board_email'], $data['admin_name']); $messenger->anti_abuse_headers($config, $user); @@ -1890,8 +1885,7 @@ class install_install extends module 'admin_name' => utf8_normalize_nfc(request_var('admin_name', '', true)), 'admin_pass1' => request_var('admin_pass1', '', true), 'admin_pass2' => request_var('admin_pass2', '', true), - 'board_email1' => strtolower(request_var('board_email1', '')), - 'board_email2' => strtolower(request_var('board_email2', '')), + 'board_email' => strtolower(request_var('board_email', '')), 'img_imagick' => request_var('img_imagick', ''), 'ftp_path' => request_var('ftp_path', ''), 'ftp_user' => request_var('ftp_user', ''), @@ -1930,8 +1924,7 @@ class install_install extends module 'admin_name' => array('lang' => 'ADMIN_USERNAME', 'type' => 'text:25:100', 'explain' => true), 'admin_pass1' => array('lang' => 'ADMIN_PASSWORD', 'type' => 'password:25:100', 'explain' => true), 'admin_pass2' => array('lang' => 'ADMIN_PASSWORD_CONFIRM', 'type' => 'password:25:100', 'explain' => false), - 'board_email1' => array('lang' => 'CONTACT_EMAIL', 'type' => 'text:25:100', 'explain' => false), - 'board_email2' => array('lang' => 'CONTACT_EMAIL_CONFIRM', 'type' => 'text:25:100', 'explain' => false), + 'board_email' => array('lang' => 'CONTACT_EMAIL', 'type' => 'text:25:100', 'explain' => false), ); var $advanced_config_options = array( 'legend1' => 'ACP_EMAIL_SETTINGS', diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 57a5de07eb..2ceb14a3d8 100644 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -72,7 +72,6 @@ $lang = array_merge($lang, array( 'CONFIG_FILE_WRITTEN' => 'The configuration file has been written. You may now proceed to the next step of the installation.', 'CONFIG_PHPBB_EMPTY' => 'The phpBB3 config variable for “%s” is empty.', 'CONFIG_RETRY' => 'Retry', - 'CONTACT_EMAIL_CONFIRM' => 'Confirm contact e-mail', 'CONTINUE_CONVERT' => 'Continue conversion', 'CONTINUE_CONVERT_BODY' => 'A previous conversion attempt has been determined. You are now able to choose between starting a new conversion or continuing the conversion.', 'CONTINUE_LAST' => 'Continue last statements', diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php index 63b9d52bf0..9c9fa4fcee 100644 --- a/tests/test_framework/phpbb_functional_test_case.php +++ b/tests/test_framework/phpbb_functional_test_case.php @@ -102,8 +102,7 @@ class phpbb_functional_test_case extends phpbb_test_case 'admin_name' => 'admin', 'admin_pass1' => 'admin', 'admin_pass2' => 'admin', - 'board_email1' => 'nobody@example.com', - 'board_email2' => 'nobody@example.com', + 'board_email' => 'nobody@example.com', )); $parseURL = parse_url(self::$config['phpbb_functional_url']); From c9733ad7195995a9f28ecbbc8aa3e94a05527114 Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 18 Dec 2011 16:28:35 +0800 Subject: [PATCH 011/117] [ticket/10532] Fix $start out of range for pre-made searches PHPBB3-10532 --- phpBB/search.php | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/phpBB/search.php b/phpBB/search.php index 2aa61401cf..07be438ab4 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -471,26 +471,33 @@ if ($keywords || $author || $author_id || $search_id || $submit) if ($search_id) { - if ($sql) + if ($sql || $search_id == 'unreadposts') { - // only return up to 1000 ids (the last one will be removed later) - $result = $db->sql_query_limit($sql, 1001 - $start, $start); - - while ($row = $db->sql_fetchrow($result)) + if ($sql) { - $id_ary[] = (int) $row[$field]; + // only return up to 1000 ids (the last one will be removed later) + $result = $db->sql_query_limit($sql, 1001); + + while ($row = $db->sql_fetchrow($result)) + { + $id_ary[] = (int) $row[$field]; + } + $db->sql_freeresult($result); + } + else if ($search_id == 'unreadposts') + { + $id_ary = array_keys(get_unread_topics($user->data['user_id'], $sql_where, $sql_sort, 1001)); } - $db->sql_freeresult($result); - $total_match_count = sizeof($id_ary) + $start; - $id_ary = array_slice($id_ary, 0, $per_page); - } - else if ($search_id == 'unreadposts') - { - $id_ary = array_keys(get_unread_topics($user->data['user_id'], $sql_where, $sql_sort, 1001 - $start, $start)); - - $total_match_count = sizeof($id_ary) + $start; - $id_ary = array_slice($id_ary, 0, $per_page); + if ($total_match_count = sizeof($id_ary)) + { + // Make sure $start is set to the last page if it exceeds the amount + if ($start < 0 || $start >= $total_match_count) + { + $start = ($start < 0) ? 0 : floor(($total_match_count - 1) / $per_page) * $per_page; + } + $id_ary = array_slice($id_ary, $start, $per_page); + } } else { From cb7bb31129a38cbdbeb682e869e51b1199b43bfb Mon Sep 17 00:00:00 2001 From: rxu Date: Sat, 14 Jan 2012 15:50:47 +0800 Subject: [PATCH 012/117] [ticket/10532] Adjust total match count and limit Set a variable for the limit of total matches count. Adjust total match count to limit to provide proper $start value calculation. Adjust $start value if no matches were found. PHPBB3-10532 --- phpBB/search.php | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/phpBB/search.php b/phpBB/search.php index 07be438ab4..3956478371 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -469,14 +469,18 @@ if ($keywords || $author || $author_id || $search_id || $submit) $per_page = ($show_results == 'posts') ? $config['posts_per_page'] : $config['topics_per_page']; $total_match_count = 0; + // Set limit for the $total_match_count to reduce server load + $total_matches_limit = 1000; + $found_more_search_matches = false; + if ($search_id) { if ($sql || $search_id == 'unreadposts') { if ($sql) { - // only return up to 1000 ids (the last one will be removed later) - $result = $db->sql_query_limit($sql, 1001); + // Only return up to $total_matches_limit+1 ids (the last one will be removed later) + $result = $db->sql_query_limit($sql, ($total_matches_limit + 1)); while ($row = $db->sql_fetchrow($result)) { @@ -486,11 +490,19 @@ if ($keywords || $author || $author_id || $search_id || $submit) } else if ($search_id == 'unreadposts') { - $id_ary = array_keys(get_unread_topics($user->data['user_id'], $sql_where, $sql_sort, 1001)); + // Only return up to $total_matches_limit+1 ids (the last one will be removed later) + $id_ary = array_keys(get_unread_topics($user->data['user_id'], $sql_where, $sql_sort, ($total_matches_limit + 1))); } if ($total_match_count = sizeof($id_ary)) { + // Limit the number to $total_matches_limit for pre-made searches + if ($total_match_count > $total_matches_limit) + { + $found_more_search_matches = true; + $total_match_count = $total_matches_limit; + } + // Make sure $start is set to the last page if it exceeds the amount if ($start < 0 || $start >= $total_match_count) { @@ -498,6 +510,11 @@ if ($keywords || $author || $author_id || $search_id || $submit) } $id_ary = array_slice($id_ary, $start, $per_page); } + else + { + // Set $start to 0 if no matches were found + $start = 0; + } } else { @@ -550,10 +567,8 @@ if ($keywords || $author || $author_id || $search_id || $submit) $icons = $cache->obtain_icons(); // Output header - if ($search_id && ($total_match_count > 1000)) + if ($found_more_search_matches) { - // limit the number to 1000 for pre-made searches - $total_match_count--; $l_search_matches = sprintf($user->lang['FOUND_MORE_SEARCH_MATCHES'], $total_match_count); } else From 7295e5824aed6f5ec32cfab0ad17cfa2c24855ac Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Mon, 16 Jan 2012 14:35:29 +0200 Subject: [PATCH 013/117] [ticket/10380] BIDI support for imageset BIDI support for imageset conversion script, added RTL imageset entries to prosilver and subsilver2, fixed small bug in imageset.css, changed spacing in code to match phpbb coding guidelines PHPBB3-10380 --- phpBB/develop/imageset_to_css.php | 162 +++++++++++++++---- phpBB/styles/prosilver/theme/bidi.css | 30 ++++ phpBB/styles/prosilver/theme/imageset.css | 1 - phpBB/styles/subsilver2/theme/stylesheet.css | 38 +++++ 4 files changed, 199 insertions(+), 32 deletions(-) diff --git a/phpBB/develop/imageset_to_css.php b/phpBB/develop/imageset_to_css.php index 3d55808319..3db005a054 100644 --- a/phpBB/develop/imageset_to_css.php +++ b/phpBB/develop/imageset_to_css.php @@ -17,14 +17,14 @@ ob_start(); // Get global and English images $images_global = get_imageset($imageset_path); -if($images_global === false) +if ($images_global === false) { echo 'imageset.cfg was not found.'; echo ob_get_clean(); return; } $images_en = get_imageset($imageset_path, 'en'); -if($images_en === false) +if ($images_en === false) { echo 'English imageset.cfg was not found.'; echo ob_get_clean(); @@ -32,7 +32,7 @@ if($images_en === false) } // Remove duplicate images -foreach($images_en as $key => $row) +foreach ($images_en as $key => $row) { unset($images_global[$key]); } @@ -52,13 +52,16 @@ $replace = array( // $replace = array_merge($replace, get_replacements($images_global)); $replace = array_merge($replace, get_replacements($images_global), get_replacements($images_en)); +// BIDI code +$bidi_code = css($images_global, './images/', true); + // Get all CSS files, parse them $files = list_files($theme_path, 'css'); -if($files === false || !count($files)) +if ($files === false || !count($files)) { echo 'No CSS files found in theme directory.
'; } -else for($i=0; $i'; + continue; } } - if(md5($data) == $hash) + if (basename($file) == 'bidi.css' && strpos($data, '/* Former imageset */') === false && strlen($bidi_code)) + { + // Add bidi data + $data .= "\n/* Former imageset */\n" . $bidi_code; + $bidi_code = ''; + echo 'Note: RTL imageset entries were added at the end of file below:
'; + } + if (md5($data) == $hash) { echo 'Nothing to replace in ', $file, '
'; } @@ -84,9 +95,9 @@ else for($i=0; $i $row) +foreach ($list as $key => $row) { - if($row['skip']) + if ($row['skip']) { echo 'Unable to generate code to add to CSS files because some images are missing or invalid. See errors above.'; echo ob_get_clean(); @@ -112,14 +123,22 @@ span.imageset { /* English images for fallback */ ' . css($images_en, './en/'); +if (strlen($bidi_code)) +{ + $code .= "\n/* RTL imageset entries */\n" . $bidi_code; +} echo 'Code to add to CSS file:', dump_code($code, 'imageset.css'); + $list = list_languages($imageset_path); -for($i=0; $i'; $skip = true; @@ -162,7 +190,7 @@ function get_imageset($path, $lang = '') else { $size = @getimagesize($filename); - if($size === false) + if ($size === false) { echo 'Error: file ', $filename, ' is not a valid image
'; $skip = true; @@ -188,7 +216,7 @@ function get_imageset($path, $lang = '') function get_replacements($list) { $result = array(); - foreach($list as $key => $row) + foreach ($list as $key => $row) { $key = '{' . strtoupper($key); $result[$key . '_SRC}'] = strlen($row['file']) ? ($row['lang'] ? './' . $row['lang'] : './images') . '/' . $row['file'] : ''; @@ -201,9 +229,12 @@ function get_replacements($list) function list_files($dir, $ext) { $res = @opendir($dir); - if($res === false) return false; + if ($res === false) + { + return false; + } $files = array(); - while(($file = readdir($res)) !== false) + while (($file = readdir($res)) !== false) { $list = explode('.', $file); if(count($list) > 1 && strtolower($list[count($list) - 1]) == $ext) @@ -218,13 +249,19 @@ function list_files($dir, $ext) function list_languages($dir) { $res = @opendir($dir); - if($res === false) return array(); - $files = array(); - while(($file = readdir($res)) !== false) + if ($res === false) { - if(substr($file, 0, 1) == '.') continue; + return array(); + } + $files = array(); + while (($file = readdir($res)) !== false) + { + if (substr($file, 0, 1) == '.') + { + continue; + } $filename = $dir . '/' . $file; - if(is_dir($filename) && file_exists($filename . '/imageset.cfg')) + if (is_dir($filename) && file_exists($filename . '/imageset.cfg')) { $files[] = $file; } @@ -236,7 +273,7 @@ function list_languages($dir) function dump_code($code, $filename = 'file.txt') { $hash = md5($code); - if(isset($_GET['download']) && $_GET['download'] === $hash) + if (isset($_GET['download']) && $_GET['download'] === $hash) { // Download file ob_end_clean(); @@ -256,18 +293,81 @@ function dump_code($code, $filename = 'file.txt') echo '
'; } -function css($list, $path = './') +function css($list, $path = './', $bidi = false) { $code = ''; - foreach($list as $key => $row) + // Change value to true if you want images to be grouped up by size + $group = $bidi; + if ($group) { - if(!strlen($row['file'])) continue; - $code .= '.imageset.' . substr($key, 4) . ' { + // group up images by size + $groups = array(); + foreach ($list as $key => $row) + { + if (!strlen($row['file'])) + { + continue; + } + $groups[$row['width'] . '*' . $row['height']][] = $key; + } + foreach ($groups as $size => $keys) + { + $extra = ''; + for ($i=0; $i $row) + { + if (!strlen($row['file'])) + { + continue; + } + $code .= ($bidi ? '.rtl ' : '') . '.imageset.' . substr($key, 4) . ' {'; + if ($bidi) + { + $code .= ' + padding-right: ' . $row['width'] . 'px; + padding-left: 0; +} +'; + } + else + { + $code .= ' background-image: url("' . $path . $row['file'] . '"); padding-left: ' . $row['width'] . 'px; padding-top: ' . $row['height'] . 'px; } '; + } + } } return $code; } diff --git a/phpBB/styles/prosilver/theme/bidi.css b/phpBB/styles/prosilver/theme/bidi.css index 81b916d373..6d77cb43f0 100644 --- a/phpBB/styles/prosilver/theme/bidi.css +++ b/phpBB/styles/prosilver/theme/bidi.css @@ -755,3 +755,33 @@ .rtl #wrap, .rtl .headerbar, .rtl #site-description, .rtl .navbar { position: relative; } + +/* Former imageset */ +.rtl .imageset.site_logo { + padding-right: 139px; + padding-left: 0; +} +.rtl .imageset.forum_link, .rtl .imageset.forum_read, .rtl .imageset.forum_read_locked, .rtl .imageset.forum_read_subforum, .rtl .imageset.forum_unread, .rtl .imageset.forum_unread_locked, .rtl .imageset.forum_unread_subforum, .rtl .imageset.topic_moved, .rtl .imageset.topic_read, .rtl .imageset.topic_read_mine, .rtl .imageset.topic_read_hot, .rtl .imageset.topic_read_hot_mine, .rtl .imageset.topic_read_locked, .rtl .imageset.topic_read_locked_mine, .rtl .imageset.topic_unread, .rtl .imageset.topic_unread_mine, .rtl .imageset.topic_unread_hot, .rtl .imageset.topic_unread_hot_mine, .rtl .imageset.topic_unread_locked, .rtl .imageset.topic_unread_locked_mine, .rtl .imageset.sticky_read, .rtl .imageset.sticky_read_mine, .rtl .imageset.sticky_read_locked, .rtl .imageset.sticky_read_locked_mine, .rtl .imageset.sticky_unread, .rtl .imageset.sticky_unread_mine, .rtl .imageset.sticky_unread_locked, .rtl .imageset.sticky_unread_locked_mine, .rtl .imageset.announce_read, .rtl .imageset.announce_read_mine, .rtl .imageset.announce_read_locked, .rtl .imageset.announce_read_locked_mine, .rtl .imageset.announce_unread, .rtl .imageset.announce_unread_mine, .rtl .imageset.announce_unread_locked, .rtl .imageset.announce_unread_locked_mine, .rtl .imageset.global_read, .rtl .imageset.global_read_mine, .rtl .imageset.global_read_locked, .rtl .imageset.global_read_locked_mine, .rtl .imageset.global_unread, .rtl .imageset.global_unread_mine, .rtl .imageset.global_unread_locked, .rtl .imageset.global_unread_locked_mine, .rtl .imageset.pm_read, .rtl .imageset.pm_unread { + padding-right: 27px; + padding-left: 0; +} +.rtl .imageset.subforum_read, .rtl .imageset.subforum_unread, .rtl .imageset.icon_post_target, .rtl .imageset.icon_post_target_unread, .rtl .imageset.icon_topic_latest, .rtl .imageset.icon_topic_newest { + padding-right: 11px; + padding-left: 0; +} +.rtl .imageset.icon_back_top { + padding-right: 11px; + padding-left: 0; +} +.rtl .imageset.icon_contact_aim, .rtl .imageset.icon_contact_email, .rtl .imageset.icon_contact_icq, .rtl .imageset.icon_contact_jabber, .rtl .imageset.icon_contact_msnm, .rtl .imageset.icon_contact_www, .rtl .imageset.icon_contact_yahoo, .rtl .imageset.icon_post_delete, .rtl .imageset.icon_post_info, .rtl .imageset.icon_post_report, .rtl .imageset.icon_user_warn { + padding-right: 20px; + padding-left: 0; +} +.rtl .imageset.icon_topic_attach { + padding-right: 7px; + padding-left: 0; +} +.rtl .imageset.icon_topic_reported, .rtl .imageset.icon_topic_unapproved { + padding-right: 16px; + padding-left: 0; +} \ No newline at end of file diff --git a/phpBB/styles/prosilver/theme/imageset.css b/phpBB/styles/prosilver/theme/imageset.css index cebab7845d..cb99e9e715 100644 --- a/phpBB/styles/prosilver/theme/imageset.css +++ b/phpBB/styles/prosilver/theme/imageset.css @@ -4,7 +4,6 @@ span.imageset { background: transparent none 0 0 no-repeat; margin: 0; padding: 0; - padding-right: 0 !important; width: 0; height: 0; overflow: hidden; diff --git a/phpBB/styles/subsilver2/theme/stylesheet.css b/phpBB/styles/subsilver2/theme/stylesheet.css index a753c914ba..427fe85e37 100644 --- a/phpBB/styles/subsilver2/theme/stylesheet.css +++ b/phpBB/styles/subsilver2/theme/stylesheet.css @@ -1099,3 +1099,41 @@ a.imageset { padding-left: 97px; padding-top: 27px; } + +/* RTL imageset entries */ +.rtl .imageset.site_logo { + padding-right: 170px; + padding-left: 0; +} +.rtl .imageset.upload_bar { + padding-right: 280px; + padding-left: 0; +} +.rtl .imageset.poll_left, .rtl .imageset.poll_right { + padding-right: 4px; + padding-left: 0; +} +.rtl .imageset.poll_center { + padding-right: 1px; + padding-left: 0; +} +.rtl .imageset.forum_link, .rtl .imageset.forum_read, .rtl .imageset.forum_read_locked, .rtl .imageset.forum_read_subforum, .rtl .imageset.forum_unread, .rtl .imageset.forum_unread_locked, .rtl .imageset.forum_unread_subforum { + padding-right: 46px; + padding-left: 0; +} +.rtl .imageset.topic_moved, .rtl .imageset.topic_read, .rtl .imageset.topic_read_mine, .rtl .imageset.topic_read_hot, .rtl .imageset.topic_read_hot_mine, .rtl .imageset.topic_read_locked, .rtl .imageset.topic_read_locked_mine, .rtl .imageset.topic_unread, .rtl .imageset.topic_unread_mine, .rtl .imageset.topic_unread_hot, .rtl .imageset.topic_unread_hot_mine, .rtl .imageset.topic_unread_locked, .rtl .imageset.topic_unread_locked_mine, .rtl .imageset.sticky_read, .rtl .imageset.sticky_read_mine, .rtl .imageset.sticky_read_locked, .rtl .imageset.sticky_read_locked_mine, .rtl .imageset.sticky_unread, .rtl .imageset.sticky_unread_mine, .rtl .imageset.sticky_unread_locked, .rtl .imageset.sticky_unread_locked_mine, .rtl .imageset.announce_read, .rtl .imageset.announce_read_mine, .rtl .imageset.announce_read_locked, .rtl .imageset.announce_read_locked_mine, .rtl .imageset.announce_unread, .rtl .imageset.announce_unread_mine, .rtl .imageset.announce_unread_locked, .rtl .imageset.announce_unread_locked_mine, .rtl .imageset.global_read, .rtl .imageset.global_read_mine, .rtl .imageset.global_read_locked, .rtl .imageset.global_read_locked_mine, .rtl .imageset.global_unread, .rtl .imageset.global_unread_mine, .rtl .imageset.global_unread_locked, .rtl .imageset.global_unread_locked_mine, .rtl .imageset.pm_read, .rtl .imageset.pm_unread, .rtl .imageset.icon_topic_reported, .rtl .imageset.icon_topic_unapproved { + padding-right: 19px; + padding-left: 0; +} +.rtl .imageset.icon_post_target, .rtl .imageset.icon_post_target_unread { + padding-right: 12px; + padding-left: 0; +} +.rtl .imageset.icon_topic_attach { + padding-right: 14px; + padding-left: 0; +} +.rtl .imageset.icon_topic_latest, .rtl .imageset.icon_topic_newest { + padding-right: 18px; + padding-left: 0; +} From 99164cd20b9d8ca77b1e9a54e0958cdb580945d0 Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 17 Jan 2011 00:01:04 +0700 Subject: [PATCH 014/117] [ticket/9831] Correctly store checkbox default value for boolean CPF. PHPBB3-9831 --- phpBB/includes/acp/acp_profile.php | 27 ++++++++++++++++++--- phpBB/includes/functions_profile_fields.php | 4 +-- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index 2e43b0545a..09a7a2f9ed 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -504,11 +504,26 @@ class acp_profile } } } - /* else if ($field_type == FIELD_BOOL && $key == 'field_default_value') + else if ($field_type == FIELD_BOOL && $key == 'field_default_value') { - // Get the number of options if this key is 'field_maxlen' - $var = request_var('field_default_value', 0); - }*/ + // 'field_length' == 1 defines radio buttons. Possible values are 1 or 2 only. + // 'field_length' == 2 defines checkbox. Possible values are 0 or 1 only. + // If we switch the type on step 2, we have to adjust field value. + // 1 is a common value for the checkbox and radio buttons. + + // If we switch to the checkbox type but former radio buttons value was 2, + // which is not the case for the checkbox, set it to 0 (unchecked). + if ($cp->vars['field_length'] == 2 && $var == 2) + { + $var = 0; + } + // If we switch to the radio buttons but the former checkbox value was 0, + // which is not the case for the radio buttons, set it to 0. + else if ($cp->vars['field_length'] == 1 && $var == 0) + { + $var = 2; + } + } else if ($field_type == FIELD_INT && $key == 'field_default_value') { // Permit an empty string @@ -676,6 +691,10 @@ class acp_profile { $_new_key_ary[$key] = utf8_normalize_nfc(request_var($key, array(array('')), true)); } + else if ($field_type == FIELD_BOOL && $key == 'field_default_value') + { + $_new_key_ary[$key] = request_var($key, $cp->vars[$key]); + } else { if (!isset($_REQUEST[$key])) diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index 1eae2a9ad6..7874608009 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -625,10 +625,10 @@ class custom_profile $profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident']; $user_ident = $profile_row['field_ident']; - // checkbox - only testing for isset + // checkbox - set the value to "true" if it has been set to 1 if ($profile_row['field_type'] == FIELD_BOOL && $profile_row['field_length'] == 2) { - $value = (isset($_REQUEST[$profile_row['field_ident']])) ? true : ((!isset($user->profile_fields[$user_ident]) || $preview) ? $default_value : $user->profile_fields[$user_ident]); + $value = (isset($_REQUEST[$profile_row['field_ident']]) && request_var($profile_row['field_ident'], $default_value) == 1) ? true : ((!isset($user->profile_fields[$user_ident]) || $preview) ? $default_value : $user->profile_fields[$user_ident]); } else if ($profile_row['field_type'] == FIELD_INT) { From d4c3d4b21d4951b6cd3d4038988278a3667f2827 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Fri, 20 Jan 2012 12:41:00 +0200 Subject: [PATCH 015/117] [ticket/10378] Imageset to css convertor typo Imageset to css convertor typo PHPBB3-10378 --- phpBB/develop/imageset_to_css.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/develop/imageset_to_css.php b/phpBB/develop/imageset_to_css.php index 3d55808319..9983a85202 100644 --- a/phpBB/develop/imageset_to_css.php +++ b/phpBB/develop/imageset_to_css.php @@ -10,7 +10,7 @@ $phpbb_root_path = '../'; $style = 'subsilver2'; $imageset_path = $phpbb_root_path . 'styles/' . $style . '/imageset'; -$theme_path = $phpbb_root_path . 'styles/' . $style . '/theme2'; +$theme_path = $phpbb_root_path . 'styles/' . $style . '/theme'; // Start output buffering ob_start(); From c54c06e98cc39568c8259e74091ddddb36d2921c Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Fri, 20 Jan 2012 12:41:36 +0200 Subject: [PATCH 016/117] [ticket/10378] Missing entries from imageset to css conversion Adding missing entries from imageset to css conversion to prosilver/theme/en/stylesheet.css PHPBB3-10378 --- phpBB/styles/prosilver/theme/en/stylesheet.css | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/phpBB/styles/prosilver/theme/en/stylesheet.css b/phpBB/styles/prosilver/theme/en/stylesheet.css index 62d6b86726..d17f9a5be4 100644 --- a/phpBB/styles/prosilver/theme/en/stylesheet.css +++ b/phpBB/styles/prosilver/theme/en/stylesheet.css @@ -11,6 +11,22 @@ ul.profile-icons li.pm-icon { width: 28px; height: 20px; } ul.profile-icons li.quote-icon { width: 54px; height: 20px; } ul.profile-icons li.edit-icon { width: 42px; height: 20px; } +/* Online image */ +.online { background-image: url("./icon_user_online.gif"); } + +/* Big button images */ +.reply-icon span { background-image: url("./button_topic_reply.gif"); } +.post-icon span { background-image: url("./button_topic_new.gif"); } +.locked-icon span { background-image: url("./button_topic_locked.gif"); } +.pmreply-icon span { background-image: url("./button_pm_reply.gif") ;} +.newpm-icon span { background-image: url("./button_pm_new.gif") ;} +.forwardpm-icon span { background-image: url("./button_pm_forward.gif") ;} + +/* Icon images */ +.pm-icon, .pm-icon a { background-image: url("./icon_contact_pm.gif"); } +.quote-icon, .quote-icon a { background-image: url("./icon_post_quote.gif"); } +.edit-icon, .edit-icon a { background-image: url("./icon_post_edit.gif"); } + /* EN Language Pack */ .imageset.icon_contact_pm { background-image: url("./icon_contact_pm.gif"); From ac492d8f1e7ef3420ebaee35131e342a39dfda10 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 22 Aug 2011 23:33:34 +0200 Subject: [PATCH 017/117] [ticket/10076] Move EHLO/HELO code into its own method. PHPBB3-10076 --- phpBB/includes/functions_messenger.php | 62 ++++++++++++++++---------- 1 file changed, 39 insertions(+), 23 deletions(-) diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 13d9b6a5cb..ccc17865f6 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -1286,30 +1286,10 @@ class smtp_class } } - // Try EHLO first - $this->server_send("EHLO {$local_host}"); - if ($err_msg = $this->server_parse('250', __LINE__)) + $hello_result = $this->hello($local_host); + if (!is_null($hello_result)) { - // a 503 response code means that we're already authenticated - if ($this->numeric_response_code == 503) - { - return false; - } - - // If EHLO fails, we try HELO - $this->server_send("HELO {$local_host}"); - if ($err_msg = $this->server_parse('250', __LINE__)) - { - return ($this->numeric_response_code == 503) ? false : $err_msg; - } - } - - foreach ($this->responses as $response) - { - $response = explode(' ', $response); - $response_code = $response[0]; - unset($response[0]); - $this->commands[$response_code] = implode(' ', $response); + return $hello_result; } // If we are not authenticated yet, something might be wrong if no username and passwd passed @@ -1355,6 +1335,42 @@ class smtp_class return $this->$method($username, $password); } + /** + * SMTP EHLO/HELO + * + * @return mixed Null if the authentication process is supposed to continue + * False if already authenticated + * Error message (string) otherwise + */ + protected function hello($hostname) + { + // Try EHLO first + $this->server_send("EHLO $hostname"); + if ($err_msg = $this->server_parse('250', __LINE__)) + { + // a 503 response code means that we're already authenticated + if ($this->numeric_response_code == 503) + { + return false; + } + + // If EHLO fails, we try HELO + $this->server_send("HELO $hostname"); + if ($err_msg = $this->server_parse('250', __LINE__)) + { + return ($this->numeric_response_code == 503) ? false : $err_msg; + } + } + + foreach ($this->responses as $response) + { + $response = explode(' ', $response); + $response_code = $response[0]; + unset($response[0]); + $this->commands[$response_code] = implode(' ', $response); + } + } + /** * Pop before smtp authentication */ From 237ddf9d22e0aeccad5e1db022de3a890871849f Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 22 Aug 2011 23:50:02 +0200 Subject: [PATCH 018/117] [ticket/10076] STARTTLS support for SMTP via smtp_class. PHPBB3-10076 --- phpBB/includes/functions_messenger.php | 57 ++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index ccc17865f6..f4e49b1b18 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -1136,6 +1136,7 @@ class smtp_class { var $server_response = ''; var $socket = 0; + protected $socket_tls = false; var $responses = array(); var $commands = array(); var $numeric_response_code = 0; @@ -1292,6 +1293,25 @@ class smtp_class return $hello_result; } + // SMTP STARTTLS (RFC 3207) + if (!$this->socket_tls) + { + $this->socket_tls = $this->starttls(); + + if ($this->socket_tls) + { + // Switched to TLS + // RFC 3207: "The client MUST discard any knowledge obtained from the server, [...]" + // So say hello again + $hello_result = $this->hello($local_host); + + if (!is_null($hello_result)) + { + return $hello_result; + } + } + } + // If we are not authenticated yet, something might be wrong if no username and passwd passed if (!$username || !$password) { @@ -1371,6 +1391,43 @@ class smtp_class } } + /** + * SMTP STARTTLS (RFC 3207) + * + * @return bool Returns true if TLS was started + * Otherwise false + */ + protected function starttls() + { + if (!function_exists('stream_socket_enable_crypto')) + { + return false; + } + + if (!isset($this->commands['STARTTLS'])) + { + return false; + } + + $this->server_send('STARTTLS'); + + if ($err_msg = $this->server_parse('220', __LINE__)) + { + return false; + } + + $result = false; + $stream_meta = stream_get_meta_data($this->socket); + + if (socket_set_blocking($this->socket, 1)); + { + $result = stream_socket_enable_crypto($this->socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT); + socket_set_blocking($this->socket, (int) $stream_meta['blocked']); + } + + return $result; + } + /** * Pop before smtp authentication */ From be74b5286cbf625109524c2e1a73c51e0dbccb30 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Fri, 3 Feb 2012 03:42:53 -0500 Subject: [PATCH 019/117] [ticket/10614] Add a script to enable, disable and view status of extensions. PHPBB3-10614 --- phpBB/develop/extensions.php | 135 +++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 phpBB/develop/extensions.php diff --git a/phpBB/develop/extensions.php b/phpBB/develop/extensions.php new file mode 100644 index 0000000000..87bdd21d1a --- /dev/null +++ b/phpBB/develop/extensions.php @@ -0,0 +1,135 @@ + +// +// Enables the specified extension. +// +// extensions.php disable +// +// Disables the specified extension. + +define('IN_PHPBB', 1); +define('ANONYMOUS', 1); +$phpEx = substr(strrchr(__FILE__, '.'), 1); +$phpbb_root_path = './../'; + +include($phpbb_root_path . 'common.'.$phpEx); + +function usage() +{ + echo "Please see comments in extensions.php for usage\n"; + exit(2); +} + +function list_extensions() +{ + global $db, $phpbb_root_path; + + $sql = "SELECT ext_name, ext_active from " . EXT_TABLE; + + $result = $db->sql_query($sql); + $extensions = array(); + while ($row = $db->sql_fetchrow($result)) + { + $extensions[$row['ext_name']]['active'] = (bool) $row['ext_active']; + if (file_exists($phpbb_root_path . 'ext/' . $row['ext_name'])) + { + $extensions[$row['ext_name']]['present'] = true; + } + else + { + $extensions[$row['ext_name']]['present'] = false; + } + } + + $iterator = new DirectoryIterator($phpbb_root_path . 'ext'); + foreach ($iterator as $file) + { + // ignore hidden files + // php refuses to subscript iterator objects + $file = "$file"; + if ($file[0] != '.') + { + if (!array_key_exists($file, $extensions)) + { + $extensions[$file] = array('active' => false, 'present' => true); + } + } + } + + ksort($extensions); + foreach ($extensions as $name => $ext) + { + $present = $ext['active'] ? 'P' : 'M'; + $active = $ext['active'] ? 'A' : 'I'; + printf("%-20s %s %s\n", $name, $present, $active); + } +} + +function enable_extension($name) +{ + global $phpbb_extension_manager; + + $phpbb_extension_manager->enable($name); +} + +function disable_extension($name) +{ + global $phpbb_extension_manager; + + $phpbb_extension_manager->disable($name); +} + +function validate_argument_count($count) +{ + global $argv; + + if (count($argv) <= $count) + { + usage(); + } +} + +validate_argument_count(1); + +$action = $argv[1]; + +switch ($action) +{ + case 'list': + list_extensions(); + break; + + case 'enable': + validate_argument_count(2); + enable_extension($argv[2]); + break; + + case 'disable': + validate_argument_count(2); + disable_extension($argv[2]); + break; + + default: + usage(); +} From 879c92e8a2b27586d6531de705ded49c6f662ffa Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Fri, 3 Feb 2012 15:38:52 +0200 Subject: [PATCH 020/117] [ticket/10569] Invalid string comparison in subsilver2 Fixing invalid string comparison in ucp_main_front.html in subsilver2 PHPBB3-10569 --- phpBB/styles/subsilver2/template/ucp_main_front.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/styles/subsilver2/template/ucp_main_front.html b/phpBB/styles/subsilver2/template/ucp_main_front.html index fdef0bd949..dc945c83d6 100644 --- a/phpBB/styles/subsilver2/template/ucp_main_front.html +++ b/phpBB/styles/subsilver2/template/ucp_main_front.html @@ -48,11 +48,11 @@ {L_ACTIVE_IN_FORUM}: - {ACTIVE_FORUM}
[ {ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT} ]- + {ACTIVE_FORUM}
[ {ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT} ]- {L_ACTIVE_IN_TOPIC}: - {ACTIVE_TOPIC}
[ {ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT} ]- + {ACTIVE_TOPIC}
[ {ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT} ]- From d2a34961498a03b77885af6a20497e87d36ad7ef Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Fri, 3 Feb 2012 16:00:14 +0200 Subject: [PATCH 021/117] [ticket/10616] Add template inheritance to default styles Adding template inheritance field to prosilver and subsilver2 PHPBB3-10616 --- phpBB/styles/prosilver/template/template.cfg | 5 +++++ phpBB/styles/subsilver2/template/template.cfg | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/phpBB/styles/prosilver/template/template.cfg b/phpBB/styles/prosilver/template/template.cfg index d31dcb7356..0b0533573a 100644 --- a/phpBB/styles/prosilver/template/template.cfg +++ b/phpBB/styles/prosilver/template/template.cfg @@ -23,3 +23,8 @@ version = 3.0.10 # Defining a different template bitfield template_bitfield = lNg= + +# Template inheritance +# See http://blog.phpbb.com/2008/07/31/templating-just-got-easier/ +# Set value to empty to ignore template inheritance +inherit_from = prosilver diff --git a/phpBB/styles/subsilver2/template/template.cfg b/phpBB/styles/subsilver2/template/template.cfg index 4e5c36af99..d557edba87 100644 --- a/phpBB/styles/subsilver2/template/template.cfg +++ b/phpBB/styles/subsilver2/template/template.cfg @@ -21,3 +21,7 @@ name = subsilver2 copyright = © phpBB Group, 2003 version = 3.0.10 +# Template inheritance +# See http://blog.phpbb.com/2008/07/31/templating-just-got-easier/ +# Set value to empty to ignore template inheritance +inherit_from = subsilver2 From 4aef6ea979befe9c40b3253ed10678a4eeb74160 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Fri, 3 Feb 2012 16:09:48 +0200 Subject: [PATCH 022/117] [ticket/10616] Ignore template inheritance that points to self Ignore template inheritance if it points to self PHPBB3-10616 --- phpBB/includes/functions.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 1eefaee651..4d2a00f2db 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3322,6 +3322,11 @@ function parse_cfg_file($filename, $lines = false) $parsed_items[$key] = $value; } + + if (isset($parsed_items['inherit_from']) && isset($parsed_items['name']) && $parsed_items['inherit_from'] == $parsed_items['name']) + { + unset($parsed_items['inherit_from']); + } return $parsed_items; } From 326ff46ef7812f9f725e680e5202364c6b25bb4b Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Fri, 3 Feb 2012 16:19:42 +0200 Subject: [PATCH 023/117] [ticket/10616] Add template inheritance to exported template Add template inheritance when exporting template.cfg PHPBB3-10616 --- phpBB/includes/acp/acp_styles.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 5a7902755e..d7b0484af8 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -99,11 +99,11 @@ parse_css_file = {PARSE_CSS_FILE} $this->template_cfg .= ' # Some configuration options -# -# You can use this function to inherit templates from another template. -# The template of the given name has to be installed. -# Templates cannot inherit from inheriting templates. -#'; +# Template inheritance +# See http://blog.phpbb.com/2008/07/31/templating-just-got-easier/ +# Set value to empty or this template name to ignore template inheritance. +inherit_from = {INHERIT_FROM} +'; $this->imageset_keys = array( 'logos' => array( @@ -2047,9 +2047,7 @@ parse_css_file = {PARSE_CSS_FILE} // Export template core code if ($mode == 'template' || $inc_template) { - $template_cfg = str_replace(array('{MODE}', '{NAME}', '{COPYRIGHT}', '{VERSION}'), array($mode, $style_row['template_name'], $style_row['template_copyright'], $config['version']), $this->template_cfg); - - $use_template_name = ''; + $use_template_name = $style_row['template_name']; // Add the inherit from variable, depending on it's use... if ($style_row['template_inherits_id']) @@ -2063,7 +2061,8 @@ parse_css_file = {PARSE_CSS_FILE} $db->sql_freeresult($result); } - $template_cfg .= ($use_template_name) ? "\ninherit_from = $use_template_name" : "\n#inherit_from = "; + $template_cfg = str_replace(array('{MODE}', '{NAME}', '{COPYRIGHT}', '{VERSION}', '{INHERIT_FROM}'), array($mode, $style_row['template_name'], $style_row['template_copyright'], $config['version'], $use_template_name), $this->template_cfg); + $template_cfg .= "\n\nbbcode_bitfield = {$style_row['bbcode_bitfield']}"; $data[] = array( From 225892f506e0a109e710534fee64a11614921d88 Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Fri, 3 Feb 2012 16:14:48 +0000 Subject: [PATCH 024/117] [ticket/9914] Add backup warning to updater. PHPBB3-9914 --- phpBB/adm/style/install_update.html | 5 +++++ phpBB/language/en/install.php | 1 + 2 files changed, 6 insertions(+) diff --git a/phpBB/adm/style/install_update.html b/phpBB/adm/style/install_update.html index 22d21d8314..818889c89b 100644 --- a/phpBB/adm/style/install_update.html +++ b/phpBB/adm/style/install_update.html @@ -43,6 +43,11 @@

{WARNING_MSG}

+ +
+

{L_NOTICE}

+

{L_BACKUP_NOTICE}

+
diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index f69ca40613..bbf407f1dc 100644 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -52,6 +52,7 @@ $lang = array_merge($lang, array( 'BLANK_PREFIX_FOUND' => 'A scan of your tables has shown a valid installation using no table prefix.', 'BOARD_NOT_INSTALLED' => 'No installation found', 'BOARD_NOT_INSTALLED_EXPLAIN' => 'The phpBB Unified Convertor Framework requires a default installation of phpBB3 to function, please proceed by first installing phpBB3.', + 'BACKUP_NOTICE' => 'Please backup your board before updating in case any problems arise during the update process.', 'CATEGORY' => 'Category', 'CACHE_STORE' => 'Cache type', From d035dc3eef617adbd9dc7ba09e088f5dcc3cb905 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Fri, 3 Feb 2012 16:00:03 -0500 Subject: [PATCH 025/117] [ticket/10618] Replace phpBB 3.0 with phpBB 3 for 3.1. PHPBB3-10618 --- phpBB/language/en/install.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index 858065b643..c8cf257f37 100644 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -78,7 +78,7 @@ $lang = array_merge($lang, array( 'CONTINUE_OLD_CONVERSION' => 'Continue previously started conversion', 'CONVERT' => 'Convert', 'CONVERT_COMPLETE' => 'Conversion completed', - 'CONVERT_COMPLETE_EXPLAIN' => 'You have now successfully converted your board to phpBB 3.0. You can now login and access your board. Please ensure that the settings were transferred correctly before enabling your board by deleting the install directory. Remember that help on using phpBB is available online via the Documentation and the support forums.', + 'CONVERT_COMPLETE_EXPLAIN' => 'You have now successfully converted your board to phpBB 3. You can now login and access your board. Please ensure that the settings were transferred correctly before enabling your board by deleting the install directory. Remember that help on using phpBB is available online via the Documentation and the support forums.', 'CONVERT_INTRO' => 'Welcome to the phpBB Unified Convertor Framework', 'CONVERT_INTRO_BODY' => 'From here, you are able to import data from other (installed) board systems. The list below shows all the conversion modules currently available. If there is no convertor shown in this list for the board software you wish to convert from, please check our website where further conversion modules may be available for download.', 'CONVERT_NEW_CONVERSION' => 'New conversion', @@ -155,7 +155,7 @@ $lang = array_merge($lang, array( 'DLL_XML' => 'XML support [ Jabber ]', 'DLL_ZLIB' => 'zlib compression support [ gz, .tar.gz, .zip ]', 'DL_CONFIG' => 'Download config', - 'DL_CONFIG_EXPLAIN' => 'You may download the complete config.php to your own PC. You will then need to upload the file manually, replacing any existing config.php in your phpBB 3.0 root directory. Please remember to upload the file in ASCII format (see your FTP application documentation if you are unsure how to achieve this). When you have uploaded the config.php please click “Done” to move to the next stage.', + 'DL_CONFIG_EXPLAIN' => 'You may download the complete config.php to your own PC. You will then need to upload the file manually, replacing any existing config.php in your phpBB 3 root directory. Please remember to upload the file in ASCII format (see your FTP application documentation if you are unsure how to achieve this). When you have uploaded the config.php please click “Done” to move to the next stage.', 'DL_DOWNLOAD' => 'Download', 'DONE' => 'Done', @@ -331,7 +331,7 @@ $lang = array_merge($lang, array( 'STAGE_ADVANCED_EXPLAIN' => 'The settings on this page are only necessary to set if you know that you require something different from the default. If you are unsure, just proceed to the next page, as these settings can be altered from the Administration Control Panel later.', 'STAGE_CONFIG_FILE' => 'Configuration file', 'STAGE_CREATE_TABLE' => 'Create database tables', - 'STAGE_CREATE_TABLE_EXPLAIN' => 'The database tables used by phpBB 3.0 have been created and populated with some initial data. Proceed to the next screen to finish installing phpBB.', + 'STAGE_CREATE_TABLE_EXPLAIN' => 'The database tables used by phpBB 3 have been created and populated with some initial data. Proceed to the next screen to finish installing phpBB.', 'STAGE_DATABASE' => 'Database settings', 'STAGE_FINAL' => 'Final stage', 'STAGE_INTRO' => 'Introduction', From ccf0cf649daabc600e8a79680e29c7bfbba32cac Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Fri, 3 Feb 2012 15:55:44 -0500 Subject: [PATCH 026/117] [ticket/10535] Delete no longer needed email confirm language entries. PHPBB3-10535 --- phpBB/language/en/common.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index b51d34335f..bec4bd9ef7 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -614,7 +614,6 @@ $lang = array_merge($lang, array( 'TOO_LONG_USER_PASSWORD' => 'The password you entered is too long.', 'TOO_LONG_USERNAME' => 'The username you entered is too long.', 'TOO_LONG_EMAIL' => 'The e-mail address you entered is too long.', - 'TOO_LONG_EMAIL_CONFIRM' => 'The e-mail address confirmation you entered is too long.', 'TOO_LONG_WEBSITE' => 'The website address you entered is too long.', 'TOO_LONG_YIM' => 'The Yahoo! Messenger name you entered is too long.', @@ -636,7 +635,6 @@ $lang = array_merge($lang, array( 'TOO_SHORT_USER_PASSWORD' => 'The password you entered is too short.', 'TOO_SHORT_USERNAME' => 'The username you entered is too short.', 'TOO_SHORT_EMAIL' => 'The e-mail address you entered is too short.', - 'TOO_SHORT_EMAIL_CONFIRM' => 'The e-mail address confirmation you entered is too short.', 'TOO_SHORT_WEBSITE' => 'The website address you entered is too short.', 'TOO_SHORT_YIM' => 'The Yahoo! Messenger name you entered is too short.', From c0b3239bf39f6a052dd8f481561ca0442f19ede8 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 4 Feb 2012 00:31:59 +0100 Subject: [PATCH 027/117] [ticket/10512] Call startup.php from tests/bootstrap.php PHPBB3-10512 --- tests/bootstrap.php | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 16aed68405..2fb805043e 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -10,25 +10,9 @@ define('IN_PHPBB', true); $phpbb_root_path = 'phpBB/'; $phpEx = 'php'; +require_once $phpbb_root_path . 'includes/startup.php'; + $table_prefix = 'phpbb_'; - -if (!defined('E_DEPRECATED')) -{ - define('E_DEPRECATED', 8192); -} -error_reporting(E_ALL & ~E_DEPRECATED); - -// If we are on PHP >= 6.0.0 we do not need some code -if (version_compare(PHP_VERSION, '6.0.0-dev', '>=')) -{ - define('STRIP', false); -} -else -{ - @set_magic_quotes_runtime(0); - define('STRIP', (get_magic_quotes_gpc()) ? true : false); -} - require_once $phpbb_root_path . 'includes/constants.php'; require_once 'test_framework/phpbb_test_case_helpers.php'; From 42d9edc4f268d4f0894bc140c2aefffbd87e3361 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 4 Feb 2012 00:57:39 +0100 Subject: [PATCH 028/117] [ticket/10495] Update request/type_cast_helper for PHP 5.4 magic_quotes_gpc drop PHPBB3-10495 --- phpBB/includes/request/type_cast_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/request/type_cast_helper.php b/phpBB/includes/request/type_cast_helper.php index 5aa0372328..561e8fc251 100644 --- a/phpBB/includes/request/type_cast_helper.php +++ b/phpBB/includes/request/type_cast_helper.php @@ -34,7 +34,7 @@ class phpbb_request_type_cast_helper implements phpbb_request_type_cast_helper_i */ public function __construct() { - if (version_compare(PHP_VERSION, '6.0.0-dev', '>=')) + if (version_compare(PHP_VERSION, '5.4.0-dev', '>=')) { $this->strip = false; } From f832f5a4ee88459dae6fda7e1b303b15f84768dc Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 5 Feb 2012 22:03:02 +0800 Subject: [PATCH 029/117] [ticket/9831] Fix saving unchecked checkbox field value PHPBB3-9831 --- phpBB/includes/acp/acp_profile.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index 09a7a2f9ed..a591474fce 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -511,6 +511,14 @@ class acp_profile // If we switch the type on step 2, we have to adjust field value. // 1 is a common value for the checkbox and radio buttons. + // Adjust unchecked checkbox value. + // If we return or save settings from 2nd/3rd page + // and the checkbox is unchecked, set the value to 0. + if (isset($_REQUEST['step']) && !isset($_REQUEST[$key])) + { + $var = 0; + } + // If we switch to the checkbox type but former radio buttons value was 2, // which is not the case for the checkbox, set it to 0 (unchecked). if ($cp->vars['field_length'] == 2 && $var == 2) From 9e15d83022ef3d02b2f17a064578b73e304bb26f Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Mon, 6 Feb 2012 16:49:50 +0100 Subject: [PATCH 030/117] [ticket/10614] Better usage output PHPBB3-10614 --- phpBB/develop/extensions.php | 50 +++++++++++++++--------------------- 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/phpBB/develop/extensions.php b/phpBB/develop/extensions.php index 87bdd21d1a..8f466caf0c 100644 --- a/phpBB/develop/extensions.php +++ b/phpBB/develop/extensions.php @@ -1,32 +1,10 @@ -// -// Enables the specified extension. -// -// extensions.php disable -// -// Disables the specified extension. +/** +* +* @copyright (c) 2012 phpBB Group +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 +* +*/ define('IN_PHPBB', 1); define('ANONYMOUS', 1); @@ -37,7 +15,21 @@ include($phpbb_root_path . 'common.'.$phpEx); function usage() { - echo "Please see comments in extensions.php for usage\n"; + echo "Usage: extensions.php COMMAND [OPTION]...\n"; + echo "Console extension manager.\n"; + echo "\n"; + echo "list:\n"; + echo " Lists all extensions in the database and the filesystem.\n"; + echo " Next to each extension name are two flags:\n"; + echo "\n"; + echo " * P|M - present|missing: whether the extension exists in the filesystem\n"; + echo " * A|I - active|inactive: whether the extension is activated in the database\n"; + echo "\n"; + echo "enable NAME:\n"; + echo " Enables the specified extension.\n"; + echo "\n"; + echo "disable NAME:\n"; + echo " Disables the specified extension.\n"; exit(2); } From 62288b3c05049cb02732204af062e0baa1191992 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Tue, 7 Feb 2012 22:03:24 +0200 Subject: [PATCH 031/117] [ticket/10569] Invalid string comparison in prosilver Fixing invalid string comparison in ucp_main_front.html in prosilver PHPBB3-10569 --- phpBB/styles/prosilver/template/ucp_main_front.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/styles/prosilver/template/ucp_main_front.html b/phpBB/styles/prosilver/template/ucp_main_front.html index 39c5d4f396..4a6fa3bf86 100644 --- a/phpBB/styles/prosilver/template/ucp_main_front.html +++ b/phpBB/styles/prosilver/template/ucp_main_front.html @@ -34,8 +34,8 @@
{L_JOINED}:
{JOINED}
{L_VISITED}:
{LAST_VISIT_YOU}
{L_TOTAL_POSTS}:
{POSTS} | {L_SEARCH_YOUR_POSTS}
({POSTS_DAY} / {POSTS_PCT}){POSTS}
-
{L_ACTIVE_IN_FORUM}:
{ACTIVE_FORUM}
({ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT})
-
{L_ACTIVE_IN_TOPIC}:
{ACTIVE_TOPIC}
({ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT})
+
{L_ACTIVE_IN_FORUM}:
{ACTIVE_FORUM}
({ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT})
+
{L_ACTIVE_IN_TOPIC}:
{ACTIVE_TOPIC}
({ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT})
{L_YOUR_WARNINGS}:
{WARNING_IMG} [{WARNINGS}]
From 6cf7f205903767bf44d1ee1de796d5f3a00774cd Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Thu, 9 Feb 2012 01:34:37 +0200 Subject: [PATCH 032/117] [ticket/10634] Changing p_master::is_full_class Changing p_master::is_full_class to check allow all module types, not only current type PHPBB3-10634 --- phpBB/includes/functions_module.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index b7bb770031..db7defdc48 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -923,6 +923,6 @@ class p_master */ protected function is_full_class($basename) { - return (substr($basename, 0, 6) === 'phpbb_' || substr($basename, 0, strlen($this->p_class) + 1) === $this->p_class . '_'); + return (preg_match('/^(phpbb|ucp|mcp|acp)_/', $basename)); } } From ad8ab099301c283b3606459dc9a84f08793f42e5 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Thu, 9 Feb 2012 01:34:50 +0200 Subject: [PATCH 033/117] [ticket/10634] Specify module type when viewing profile Specify module type when checking for enabled modules when viewing user's profile PHPBB3-10634 --- phpBB/memberlist.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index 1201aceff9..cf2cb5b06d 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -571,11 +571,11 @@ switch ($mode) $module->list_modules('ucp'); $module->list_modules('mcp'); - $user_notes_enabled = ($module->loaded('notes', 'user_notes')) ? true : false; - $warn_user_enabled = ($module->loaded('warn', 'warn_user')) ? true : false; - $zebra_enabled = ($module->loaded('zebra')) ? true : false; - $friends_enabled = ($module->loaded('zebra', 'friends')) ? true : false; - $foes_enabled = ($module->loaded('zebra', 'foes')) ? true : false; + $user_notes_enabled = ($module->loaded('mcp_notes', 'user_notes')) ? true : false; + $warn_user_enabled = ($module->loaded('mcp_warn', 'warn_user')) ? true : false; + $zebra_enabled = ($module->loaded('ucp_zebra')) ? true : false; + $friends_enabled = ($module->loaded('ucp_zebra', 'friends')) ? true : false; + $foes_enabled = ($module->loaded('ucp_zebra', 'foes')) ? true : false; unset($module); } From b222030ca78f8eb980baffeec793723978e75c3a Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Thu, 9 Feb 2012 01:02:00 +0100 Subject: [PATCH 034/117] [ticket/10614] Make script accessible from anywhere PHPBB3-10614 --- phpBB/develop/extensions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/develop/extensions.php b/phpBB/develop/extensions.php index 8f466caf0c..4e673459d2 100644 --- a/phpBB/develop/extensions.php +++ b/phpBB/develop/extensions.php @@ -9,7 +9,7 @@ define('IN_PHPBB', 1); define('ANONYMOUS', 1); $phpEx = substr(strrchr(__FILE__, '.'), 1); -$phpbb_root_path = './../'; +$phpbb_root_path = __DIR__.'/../'; include($phpbb_root_path . 'common.'.$phpEx); From 5ccd6b0c7a2952f01b636e7319ed8ae4be8faa77 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Thu, 9 Feb 2012 01:03:17 +0100 Subject: [PATCH 035/117] [ticket/10614] Tweak list output, show state, purge cache, handle missing exts PHPBB3-10614 --- phpBB/develop/extensions.php | 29 ++++++++++++++++++---------- phpBB/includes/extension/manager.php | 20 ++++++++++++++++++- 2 files changed, 38 insertions(+), 11 deletions(-) diff --git a/phpBB/develop/extensions.php b/phpBB/develop/extensions.php index 4e673459d2..287957f52a 100644 --- a/phpBB/develop/extensions.php +++ b/phpBB/develop/extensions.php @@ -22,8 +22,9 @@ function usage() echo " Lists all extensions in the database and the filesystem.\n"; echo " Next to each extension name are two flags:\n"; echo "\n"; - echo " * P|M - present|missing: whether the extension exists in the filesystem\n"; - echo " * A|I - active|inactive: whether the extension is activated in the database\n"; + echo " * present|missing: whether the extension exists in the filesystem\n"; + echo " * active|inactive: whether the extension is activated in the database\n"; + echo " * state: the current persisted installation state\n"; echo "\n"; echo "enable NAME:\n"; echo " Enables the specified extension.\n"; @@ -35,15 +36,18 @@ function usage() function list_extensions() { - global $db, $phpbb_root_path; + global $db, $cache, $phpbb_root_path; - $sql = "SELECT ext_name, ext_active from " . EXT_TABLE; + $cache->destroy('_ext'); + + $sql = "SELECT ext_name, ext_active, ext_state from " . EXT_TABLE; $result = $db->sql_query($sql); $extensions = array(); while ($row = $db->sql_fetchrow($result)) { $extensions[$row['ext_name']]['active'] = (bool) $row['ext_active']; + $extensions[$row['ext_name']]['state'] = (bool) $row['ext_state']; if (file_exists($phpbb_root_path . 'ext/' . $row['ext_name'])) { $extensions[$row['ext_name']]['present'] = true; @@ -64,7 +68,7 @@ function list_extensions() { if (!array_key_exists($file, $extensions)) { - $extensions[$file] = array('active' => false, 'present' => true); + $extensions[$file] = array('active' => false, 'present' => true, 'state' => false); } } } @@ -72,22 +76,27 @@ function list_extensions() ksort($extensions); foreach ($extensions as $name => $ext) { - $present = $ext['active'] ? 'P' : 'M'; - $active = $ext['active'] ? 'A' : 'I'; - printf("%-20s %s %s\n", $name, $present, $active); + $present = $ext['present'] ? 'present' : 'missing'; + $active = $ext['active'] ? 'active' : 'inactive'; + $state = json_encode(unserialize($ext['state'])); + printf("%-20s %-7s %-7s %-20s\n", $name, $present, $active, $state); } } function enable_extension($name) { - global $phpbb_extension_manager; + global $phpbb_extension_manager, $cache; + + $cache->destroy('_ext'); $phpbb_extension_manager->enable($name); } function disable_extension($name) { - global $phpbb_extension_manager; + global $phpbb_extension_manager, $cache; + + $cache->destroy('_ext'); $phpbb_extension_manager->disable($name); } diff --git a/phpBB/includes/extension/manager.php b/phpBB/includes/extension/manager.php index 438578e7e7..b7f76d0400 100644 --- a/phpBB/includes/extension/manager.php +++ b/phpBB/includes/extension/manager.php @@ -132,6 +132,12 @@ class phpbb_extension_manager */ public function enable_step($name) { + $ext_path = $this->get_extension_path($name); + if (!file_exists($ext_path)) + { + throw new InvalidArgumentException('The provided extension does not exist.'); + } + // ignore extensions that are already enabled if (isset($this->extensions[$name]) && $this->extensions[$name]['ext_active']) { @@ -152,7 +158,7 @@ class phpbb_extension_manager ); $this->extensions[$name] = $extension_data; - $this->extensions[$name]['ext_path'] = $this->get_extension_path($extension_data['ext_name']); + $this->extensions[$name]['ext_path'] = $ext_path; ksort($this->extensions); $sql = 'UPDATE ' . $this->extension_table . ' @@ -195,6 +201,12 @@ class phpbb_extension_manager */ public function disable_step($name) { + $ext_path = $this->get_extension_path($name); + if (!file_exists($ext_path)) + { + throw new InvalidArgumentException('The provided extension does not exist.'); + } + // ignore extensions that are already disabled if (!isset($this->extensions[$name]) || !$this->extensions[$name]['ext_active']) { @@ -262,6 +274,12 @@ class phpbb_extension_manager */ public function purge_step($name) { + $ext_path = $this->get_extension_path($name); + if (!file_exists($ext_path)) + { + throw new InvalidArgumentException('The provided extension does not exist.'); + } + // ignore extensions that do not exist if (!isset($this->extensions[$name])) { From fb83a5f6c07fe1d3755d868b93bb632802ab7fb7 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Thu, 9 Feb 2012 01:03:51 +0100 Subject: [PATCH 036/117] [ticket/10614] Add purge command PHPBB3-10614 --- phpBB/develop/extensions.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/phpBB/develop/extensions.php b/phpBB/develop/extensions.php index 287957f52a..81bfecc45f 100644 --- a/phpBB/develop/extensions.php +++ b/phpBB/develop/extensions.php @@ -31,6 +31,9 @@ function usage() echo "\n"; echo "disable NAME:\n"; echo " Disables the specified extension.\n"; + echo "\n"; + echo "purge NAME:\n"; + echo " Purges the specified extension.\n"; exit(2); } @@ -101,6 +104,15 @@ function disable_extension($name) $phpbb_extension_manager->disable($name); } +function purge_extension($name) +{ + global $phpbb_extension_manager, $cache; + + $cache->destroy('_ext'); + + $phpbb_extension_manager->purge($name); +} + function validate_argument_count($count) { global $argv; @@ -131,6 +143,11 @@ switch ($action) disable_extension($argv[2]); break; + case 'purge': + validate_argument_count(2); + purge_extension($argv[2]); + break; + default: usage(); } From 36728d3414e513f0b4aede75d53316e208e5eceb Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Thu, 9 Feb 2012 01:36:06 +0100 Subject: [PATCH 037/117] [ticket/10614] Refactor list command to use manager API PHPBB3-10614 --- phpBB/develop/extensions.php | 78 +++++++++------------------- phpBB/includes/extension/manager.php | 12 ++++- 2 files changed, 35 insertions(+), 55 deletions(-) diff --git a/phpBB/develop/extensions.php b/phpBB/develop/extensions.php index 81bfecc45f..4a5b0c7643 100644 --- a/phpBB/develop/extensions.php +++ b/phpBB/develop/extensions.php @@ -20,11 +20,6 @@ function usage() echo "\n"; echo "list:\n"; echo " Lists all extensions in the database and the filesystem.\n"; - echo " Next to each extension name are two flags:\n"; - echo "\n"; - echo " * present|missing: whether the extension exists in the filesystem\n"; - echo " * active|inactive: whether the extension is activated in the database\n"; - echo " * state: the current persisted installation state\n"; echo "\n"; echo "enable NAME:\n"; echo " Enables the specified extension.\n"; @@ -39,76 +34,51 @@ function usage() function list_extensions() { - global $db, $cache, $phpbb_root_path; + global $phpbb_extension_manager; - $cache->destroy('_ext'); + $phpbb_extension_manager->load_extensions(); - $sql = "SELECT ext_name, ext_active, ext_state from " . EXT_TABLE; + echo "Enabled:\n"; + $enabled = array_keys($phpbb_extension_manager->all_enabled()); + print_extensions($enabled); + echo "\n"; - $result = $db->sql_query($sql); - $extensions = array(); - while ($row = $db->sql_fetchrow($result)) + echo "Disabled:\n"; + $disabled = array_keys($phpbb_extension_manager->all_disabled()); + print_extensions($disabled); + echo "\n"; + + echo "Not installed:\n"; + $all = array_keys($phpbb_extension_manager->all_available()); + $purged = array_diff($all, $enabled, $disabled); + print_extensions($purged); +} + +function print_extensions($exts) +{ + foreach ($exts as $ext) { - $extensions[$row['ext_name']]['active'] = (bool) $row['ext_active']; - $extensions[$row['ext_name']]['state'] = (bool) $row['ext_state']; - if (file_exists($phpbb_root_path . 'ext/' . $row['ext_name'])) - { - $extensions[$row['ext_name']]['present'] = true; - } - else - { - $extensions[$row['ext_name']]['present'] = false; - } - } - - $iterator = new DirectoryIterator($phpbb_root_path . 'ext'); - foreach ($iterator as $file) - { - // ignore hidden files - // php refuses to subscript iterator objects - $file = "$file"; - if ($file[0] != '.') - { - if (!array_key_exists($file, $extensions)) - { - $extensions[$file] = array('active' => false, 'present' => true, 'state' => false); - } - } - } - - ksort($extensions); - foreach ($extensions as $name => $ext) - { - $present = $ext['present'] ? 'present' : 'missing'; - $active = $ext['active'] ? 'active' : 'inactive'; - $state = json_encode(unserialize($ext['state'])); - printf("%-20s %-7s %-7s %-20s\n", $name, $present, $active, $state); + echo "- $ext\n"; } } function enable_extension($name) { - global $phpbb_extension_manager, $cache; - - $cache->destroy('_ext'); + global $phpbb_extension_manager; $phpbb_extension_manager->enable($name); } function disable_extension($name) { - global $phpbb_extension_manager, $cache; - - $cache->destroy('_ext'); + global $phpbb_extension_manager; $phpbb_extension_manager->disable($name); } function purge_extension($name) { - global $phpbb_extension_manager, $cache; - - $cache->destroy('_ext'); + global $phpbb_extension_manager; $phpbb_extension_manager->purge($name); } diff --git a/phpBB/includes/extension/manager.php b/phpBB/includes/extension/manager.php index b7f76d0400..b8643b39ee 100644 --- a/phpBB/includes/extension/manager.php +++ b/phpBB/includes/extension/manager.php @@ -61,7 +61,7 @@ class phpbb_extension_manager * * @return null */ - protected function load_extensions() + public function load_extensions() { $sql = 'SELECT * FROM ' . $this->extension_table; @@ -173,6 +173,8 @@ class phpbb_extension_manager $this->db->sql_query($sql); } + $this->cache->destroy($this->cache_name); + return !$active; } @@ -231,6 +233,8 @@ class phpbb_extension_manager WHERE ext_name = '" . $this->db->sql_escape($name) . "'"; $this->db->sql_query($sql); + $this->cache->destroy($this->cache_name); + return true; } @@ -246,6 +250,8 @@ class phpbb_extension_manager WHERE ext_name = '" . $this->db->sql_escape($name) . "'"; $this->db->sql_query($sql); + $this->cache->destroy($this->cache_name); + return false; } @@ -310,6 +316,8 @@ class phpbb_extension_manager WHERE ext_name = '" . $this->db->sql_escape($name) . "'"; $this->db->sql_query($sql); + $this->cache->destroy($this->cache_name); + return true; } @@ -319,6 +327,8 @@ class phpbb_extension_manager WHERE ext_name = '" . $this->db->sql_escape($name) . "'"; $this->db->sql_query($sql); + $this->cache->destroy($this->cache_name); + return false; } From 68e4c667fa5f29f7974b83549a2a9bb8bbd8abc5 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Thu, 9 Feb 2012 01:37:53 +0100 Subject: [PATCH 038/117] [ticket/10614] Remove ext manager exceptions for now PHPBB3-10614 --- phpBB/includes/extension/manager.php | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/phpBB/includes/extension/manager.php b/phpBB/includes/extension/manager.php index b8643b39ee..12b626d69f 100644 --- a/phpBB/includes/extension/manager.php +++ b/phpBB/includes/extension/manager.php @@ -132,12 +132,6 @@ class phpbb_extension_manager */ public function enable_step($name) { - $ext_path = $this->get_extension_path($name); - if (!file_exists($ext_path)) - { - throw new InvalidArgumentException('The provided extension does not exist.'); - } - // ignore extensions that are already enabled if (isset($this->extensions[$name]) && $this->extensions[$name]['ext_active']) { @@ -158,7 +152,7 @@ class phpbb_extension_manager ); $this->extensions[$name] = $extension_data; - $this->extensions[$name]['ext_path'] = $ext_path; + $this->extensions[$name]['ext_path'] = $this->get_extension_path($extension_data['ext_name']); ksort($this->extensions); $sql = 'UPDATE ' . $this->extension_table . ' @@ -203,12 +197,6 @@ class phpbb_extension_manager */ public function disable_step($name) { - $ext_path = $this->get_extension_path($name); - if (!file_exists($ext_path)) - { - throw new InvalidArgumentException('The provided extension does not exist.'); - } - // ignore extensions that are already disabled if (!isset($this->extensions[$name]) || !$this->extensions[$name]['ext_active']) { @@ -280,12 +268,6 @@ class phpbb_extension_manager */ public function purge_step($name) { - $ext_path = $this->get_extension_path($name); - if (!file_exists($ext_path)) - { - throw new InvalidArgumentException('The provided extension does not exist.'); - } - // ignore extensions that do not exist if (!isset($this->extensions[$name])) { From 78de29b7ce5b8c1c34749bb68813840f7e6c4b7b Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Thu, 9 Feb 2012 01:39:45 +0100 Subject: [PATCH 039/117] [ticket/10614] Check if cache exists before destroying it PHPBB3-10614 --- phpBB/includes/extension/manager.php | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/extension/manager.php b/phpBB/includes/extension/manager.php index 12b626d69f..56092410f2 100644 --- a/phpBB/includes/extension/manager.php +++ b/phpBB/includes/extension/manager.php @@ -167,7 +167,10 @@ class phpbb_extension_manager $this->db->sql_query($sql); } - $this->cache->destroy($this->cache_name); + if ($this->cache) + { + $this->cache->destroy($this->cache_name); + } return !$active; } @@ -221,7 +224,10 @@ class phpbb_extension_manager WHERE ext_name = '" . $this->db->sql_escape($name) . "'"; $this->db->sql_query($sql); - $this->cache->destroy($this->cache_name); + if ($this->cache) + { + $this->cache->destroy($this->cache_name); + } return true; } @@ -238,7 +244,10 @@ class phpbb_extension_manager WHERE ext_name = '" . $this->db->sql_escape($name) . "'"; $this->db->sql_query($sql); - $this->cache->destroy($this->cache_name); + if ($this->cache) + { + $this->cache->destroy($this->cache_name); + } return false; } @@ -298,7 +307,10 @@ class phpbb_extension_manager WHERE ext_name = '" . $this->db->sql_escape($name) . "'"; $this->db->sql_query($sql); - $this->cache->destroy($this->cache_name); + if ($this->cache) + { + $this->cache->destroy($this->cache_name); + } return true; } @@ -309,7 +321,10 @@ class phpbb_extension_manager WHERE ext_name = '" . $this->db->sql_escape($name) . "'"; $this->db->sql_query($sql); - $this->cache->destroy($this->cache_name); + if ($this->cache) + { + $this->cache->destroy($this->cache_name); + } return false; } From 6858485964fda2d43fd7622123ffce796b2fd365 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 9 Feb 2012 14:08:58 +0100 Subject: [PATCH 040/117] [ticket/10636] Resolve variable name ($sql_ary) conflict in cache_moderators(). Regression from 4c77903129749008cd08c346006d2a57cf6ff544. PHPBB3-10636 --- phpBB/includes/functions_admin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 7fdf874456..2fd58a11e9 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2330,7 +2330,7 @@ function cache_moderators() $ug_id_ary = array_keys($hold_ary); // Remove users who have group memberships with DENY moderator permissions - $sql_ary = array( + $sql_ary_deny = array( 'SELECT' => 'a.forum_id, ug.user_id, g.group_id', 'FROM' => array( @@ -2357,7 +2357,7 @@ function cache_moderators() AND ug.user_pending = 0 AND o.auth_option " . $db->sql_like_expression('m_' . $db->any_char), ); - $sql = $db->sql_build_query('SELECT', $sql_ary); + $sql = $db->sql_build_query('SELECT', $sql_ary_deny); $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) From f894da0d25f2ecc4c8f3c039dd9f40607137d4ca Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 9 Feb 2012 15:13:29 +0100 Subject: [PATCH 041/117] [ticket/10633] Stop leaking filename of attachments when thumbnail is requested While filenames are chosen at random and there is no correlation between the original filename and the new filesystem filename, there is a correlation between filesystem filename and filesytem filename of thumbnails. Adjust error message to no longer include the physical filename and make it consistent with the error message that is shown when there is no attachment at all. This information was mostly useless for regular users (i.e. non-admins) anyway. PHPBB3-10633 --- phpBB/download/file.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/download/file.php b/phpBB/download/file.php index c17f0cf018..bf277c69fa 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -424,7 +424,7 @@ function send_file_to_browser($attachment, $upload_dir, $category) if (!@file_exists($filename)) { send_status_line(404, 'Not Found'); - trigger_error($user->lang['ERROR_NO_ATTACHMENT'] . '

' . sprintf($user->lang['FILE_NOT_FOUND_404'], $filename)); + trigger_error('ERROR_NO_ATTACHMENT'); } // Correct the mime type - we force application/octetstream for all files, except images From 35d5d527dbe2de1a608e6af4b004ed807ff22743 Mon Sep 17 00:00:00 2001 From: James King Date: Wed, 8 Feb 2012 01:33:08 +0000 Subject: [PATCH 042/117] [ticket/10606] Fix incorrect hidden fields array name in page_header(). Regression from dfb7cc625a37c6345fa647ee3a21f890ba5c9649. PHPBB3-10606 --- 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 4d2a00f2db..0320230a7d 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -4553,7 +4553,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0 foreach ($_EXTRA_URL as $url_param) { $url_param = explode('=', $url_param, 2); - $s_hidden_fields[$url_param[0]] = $url_param[1]; + $s_search_hidden_fields[$url_param[0]] = $url_param[1]; } } From a962e788542dac43a365afde295babf3ee681535 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 9 Feb 2012 15:29:21 +0100 Subject: [PATCH 043/117] [ticket/10606] Also correctly use $s_search_hidden_fields in view(forum|topic). Regression from dfb7cc625a37c6345fa647ee3a21f890ba5c9649. PHPBB3-10606 --- phpBB/viewforum.php | 2 +- phpBB/viewtopic.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 588f60b589..6fec662b02 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -278,7 +278,7 @@ if (!empty($_EXTRA_URL)) foreach ($_EXTRA_URL as $url_param) { $url_param = explode('=', $url_param, 2); - $s_hidden_fields[$url_param[0]] = $url_param[1]; + $s_search_hidden_fields[$url_param[0]] = $url_param[1]; } } diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 01cd6a28a8..74420a25c7 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -607,7 +607,7 @@ if (!empty($_EXTRA_URL)) foreach ($_EXTRA_URL as $url_param) { $url_param = explode('=', $url_param, 2); - $s_hidden_fields[$url_param[0]] = $url_param[1]; + $s_search_hidden_fields[$url_param[0]] = $url_param[1]; } } From 345e8e084fd5ab7f99442ce6515a786a90806e2e Mon Sep 17 00:00:00 2001 From: rxu Date: Fri, 10 Feb 2012 00:31:13 +0800 Subject: [PATCH 044/117] [ticket/9084] Don't hide 'non-entered' dropdown CPF value if not required PHPBB3-9084 --- phpBB/includes/functions_profile_fields.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index 1eae2a9ad6..79701429e6 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -571,7 +571,7 @@ class custom_profile $this->get_option_lang($field_id, $lang_id, FIELD_DROPDOWN, false); } - if ($value == $ident_ary['data']['field_novalue']) + if ($value == $ident_ary['data']['field_novalue'] && $ident_ary['data']['field_required']) { return NULL; } From 11606c86073db42b0455a654d35d6ff38fb70105 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Thu, 9 Feb 2012 21:58:39 +0200 Subject: [PATCH 045/117] [ticket/10637] Leftovers from implementation of extensions Replacing code in includes/functions_admin.php that was missed in ticket 10323 PHPBB3-10637 --- phpBB/includes/functions_admin.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 7fdf874456..7b4393f383 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -847,15 +847,13 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync = } // Remove the message from the search index - $search_type = basename($config['search_type']); + $search_type = $config['search_type']; - if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) + if (!class_exists($search_type)) { trigger_error('NO_SUCH_SEARCH_MODULE'); } - include_once("{$phpbb_root_path}includes/search/$search_type.$phpEx"); - $error = false; $search = new $search_type($error); From 1d72a47ea6f47ec95b201ea4a3b9a9e0ea34da9a Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Thu, 9 Feb 2012 22:13:13 +0200 Subject: [PATCH 046/117] [ticket/10637] Leftovers from implementation of extensions in mcp_main Replacing code in includes/mcp/mcp_main.php that was missed in ticket 10323 PHPBB3-10637 --- phpBB/includes/mcp/mcp_main.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php index 10e5956fc2..a21c67924d 100644 --- a/phpBB/includes/mcp/mcp_main.php +++ b/phpBB/includes/mcp/mcp_main.php @@ -907,16 +907,11 @@ function mcp_fork_topic($topic_ids) if (!isset($search_type) && $topic_row['enable_indexing']) { // Select the search method and do some additional checks to ensure it can actually be utilised - $search_type = basename($config['search_type']); - - if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) - { - trigger_error('NO_SUCH_SEARCH_MODULE'); - } + $search_type = $config['search_type']; if (!class_exists($search_type)) { - include("{$phpbb_root_path}includes/search/$search_type.$phpEx"); + trigger_error('NO_SUCH_SEARCH_MODULE'); } $error = false; From 92303d2dacdd7be3fad4d2ffba84c0d30fcadeaf Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Thu, 9 Feb 2012 22:17:33 +0200 Subject: [PATCH 047/117] [ticket/10637] Leftovers from implementation of extensions in mcp_post Replacing code in includes/mcp/mcp_post.php that was missed in ticket 10323 PHPBB3-10637 --- phpBB/includes/mcp/mcp_post.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php index ee79928eb1..2a52a858b3 100644 --- a/phpBB/includes/mcp/mcp_post.php +++ b/phpBB/includes/mcp/mcp_post.php @@ -464,12 +464,10 @@ function change_poster(&$post_info, $userdata) } // refresh search cache of this post - $search_type = basename($config['search_type']); + $search_type = $config['search_type']; - if (file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) + if (class_exists($search_type)) { - require("{$phpbb_root_path}includes/search/$search_type.$phpEx"); - // We do some additional checks in the module to ensure it can actually be utilised $error = false; $search = new $search_type($error); From a1a1b61ae8507276f7191be84a8782c0b0218f9c Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Thu, 9 Feb 2012 22:22:32 +0200 Subject: [PATCH 048/117] [ticket/10637] Leftovers from implementation of extensions in develop tools Replacing code in development tools that was missed in ticket 10323 PHPBB3-10637 --- phpBB/develop/create_search_index.php | 1 - phpBB/develop/search_fill.php | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/phpBB/develop/create_search_index.php b/phpBB/develop/create_search_index.php index 28001035f6..1de20f3099 100644 --- a/phpBB/develop/create_search_index.php +++ b/phpBB/develop/create_search_index.php @@ -25,7 +25,6 @@ $phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../'; $phpEx = substr(strrchr(__FILE__, '.'), 1); require($phpbb_root_path . 'common.' . $phpEx); require($phpbb_root_path . 'includes/acp/acp_search.' . $phpEx); -require($phpbb_root_path . 'includes/search/' . $class_name . '.' . $phpEx); $user->session_begin(); $auth->acl($user->data); diff --git a/phpBB/develop/search_fill.php b/phpBB/develop/search_fill.php index 371c8c74cc..4c0b607778 100644 --- a/phpBB/develop/search_fill.php +++ b/phpBB/develop/search_fill.php @@ -34,13 +34,11 @@ $user->setup(); $search_type = $config['search_type']; -if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) +if (!class_exists($search_type)) { trigger_error('NO_SUCH_SEARCH_MODULE'); } -require($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx); - $error = false; $search = new $search_type($error); From caeadf85d00ce90b8ea141bcb9a05d229ff1b5b4 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Thu, 9 Feb 2012 22:24:46 +0200 Subject: [PATCH 049/117] [ticket/10637] Leftovers from implementation of extensions in convertor Replacing code in convertor that was missed in ticket 10323 PHPBB3-10637 --- phpBB/install/install_convert.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index 5a868004ef..db974f9903 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -735,22 +735,20 @@ class install_convert extends module $this->p_master->error(sprintf($user->lang['COULD_NOT_FIND_PATH'], $convert->options['forum_path']), __LINE__, __FILE__); } - $search_type = basename(trim($config['search_type'])); + $search_type = $config['search_type']; // For conversions we are a bit less strict and set to a search backend we know exist... - if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) + if (!class_exists($search_type)) { - $search_type = 'fulltext_native'; + $search_type = 'phpbb_search_fulltext_native'; set_config('search_type', $search_type); } - if (!file_exists($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx)) + if (!class_exists($search_type)) { trigger_error('NO_SUCH_SEARCH_MODULE'); } - require($phpbb_root_path . 'includes/search/' . $search_type . '.' . $phpEx); - $error = false; $convert->fulltext_search = new $search_type($error); From 2a5e30db9e13bc5c8895774291137a9dccb3a2c4 Mon Sep 17 00:00:00 2001 From: Patrick Webster Date: Sat, 11 Feb 2012 01:40:01 -0600 Subject: [PATCH 050/117] [ticket/10641] Update MCP template with new plurality forms Updates the MCP template according to PHPBB3-10345 PHPBB3-10641 --- phpBB/styles/prosilver/template/mcp_front.html | 12 +++--------- .../styles/subsilver2/template/mcp_front.html | 18 ------------------ 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/phpBB/styles/prosilver/template/mcp_front.html b/phpBB/styles/prosilver/template/mcp_front.html index 21431b4bc1..e9635e528c 100644 --- a/phpBB/styles/prosilver/template/mcp_front.html +++ b/phpBB/styles/prosilver/template/mcp_front.html @@ -10,7 +10,7 @@

{L_LATEST_UNAPPROVED}

-

{L_UNAPPROVED_TOTAL}

+

{L_UNAPPROVED_TOTAL}

    @@ -40,8 +40,6 @@
- -

{L_UNAPPROVED_POSTS_ZERO_TOTAL}

@@ -64,7 +62,7 @@

{L_LATEST_REPORTED}

-

{L_REPORTS_TOTAL}

+

{L_REPORTS_TOTAL}

    @@ -92,8 +90,6 @@
- -

{L_REPORTS_ZERO_TOTAL}

@@ -105,7 +101,7 @@

{L_LATEST_REPORTED_PMS}

-

{L_PM_REPORTS_TOTAL}

+

{L_PM_REPORTS_TOTAL}

    @@ -133,8 +129,6 @@
- -

{L_PM_REPORTS_ZERO_TOTAL}

diff --git a/phpBB/styles/subsilver2/template/mcp_front.html b/phpBB/styles/subsilver2/template/mcp_front.html index f4b146f4c5..7c17e13c52 100644 --- a/phpBB/styles/subsilver2/template/mcp_front.html +++ b/phpBB/styles/subsilver2/template/mcp_front.html @@ -24,16 +24,10 @@ {unapproved.POST_TIME} - - - {L_UNAPPROVED_POSTS_ZERO_TOTAL} - - {L_UNAPPROVED_TOTAL} - {S_HIDDEN_FIELDS}   @@ -70,16 +64,10 @@ {report.REPORTER_FULL} {report.REPORT_TIME} - - - {L_REPORTS_ZERO_TOTAL} - - {L_REPORTS_TOTAL} -

@@ -107,16 +95,10 @@ {pm_report.REPORTER_FULL} {pm_report.REPORT_TIME} - - - {L_PM_REPORTS_ZERO_TOTAL} - - {L_PM_REPORTS_TOTAL} -

From 2814021d3ff3be4d57166ac8da224807cabb5367 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sat, 11 Feb 2012 15:08:05 -0500 Subject: [PATCH 051/117] [ticket/10614] Unbreak all_available on extension manager. By default RecursiveIteratorIterator skips all directories. This results in extension manager not finding any extensions. Add RecursiveIteratorIterator::SELF_FIRST to correct this. PHPBB3-10614 --- phpBB/includes/extension/manager.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/extension/manager.php b/phpBB/includes/extension/manager.php index 56092410f2..c38f0df32e 100644 --- a/phpBB/includes/extension/manager.php +++ b/phpBB/includes/extension/manager.php @@ -354,7 +354,8 @@ class phpbb_extension_manager $available = array(); $iterator = new RecursiveIteratorIterator( - new RecursiveDirectoryIterator($this->phpbb_root_path . 'ext/')); + new RecursiveDirectoryIterator($this->phpbb_root_path . 'ext/'), + RecursiveIteratorIterator::SELF_FIRST); foreach ($iterator as $file_info) { if ($file_info->isFile() && $file_info->getFilename() == 'ext' . $this->phpEx) From 87914d2788b54a5e59f54431a4745e62d42de907 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sat, 11 Feb 2012 17:31:22 -0500 Subject: [PATCH 052/117] [ticket/10614] Change not installed heading to available. "Not installed" implies that extensions listed there can be installed, but the operation is called enable. Reduce the confusion by using "available" for the heading, this matches extension manager code. PHPBB3-10614 --- phpBB/develop/extensions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/develop/extensions.php b/phpBB/develop/extensions.php index 4a5b0c7643..2f7c3d1167 100644 --- a/phpBB/develop/extensions.php +++ b/phpBB/develop/extensions.php @@ -48,7 +48,7 @@ function list_extensions() print_extensions($disabled); echo "\n"; - echo "Not installed:\n"; + echo "Available:\n"; $all = array_keys($phpbb_extension_manager->all_available()); $purged = array_diff($all, $enabled, $disabled); print_extensions($purged); From 6d227894f59c14dbc1f907bfd4d7cd5bb0df3dcd Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Mon, 13 Feb 2012 12:28:01 +0200 Subject: [PATCH 053/117] [ticket/10645] Missing CSS for checkboxes Missing CSS for checkboxes, invalid cursor for radio input PHPBB3-10645 --- phpBB/adm/style/admin.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css index 666f4921ba..ceda824e5a 100644 --- a/phpBB/adm/style/admin.css +++ b/phpBB/adm/style/admin.css @@ -1007,11 +1007,11 @@ fieldset.submit-buttons legend { /* Input field styles ---------------------------------------- */ -input.radio, input.permissions-checkbox { +input.radio, input.checkbox, input.permissions-checkbox { width: auto !important; background-color: transparent; border: none; - cursor: default; + cursor: pointer; } input.full, From 5aad71b22017dea39a4a549d4e3b1b939789c1ce Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Wed, 15 Feb 2012 18:46:27 +0200 Subject: [PATCH 054/117] [ticket/10652] Fixing typo in template class Fixing typo in template class that prevents template inheritance from working PHPBB3-10652 --- phpBB/includes/template/template.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/template/template.php b/phpBB/includes/template/template.php index 43dec7dbf5..9297b759ac 100644 --- a/phpBB/includes/template/template.php +++ b/phpBB/includes/template/template.php @@ -128,7 +128,7 @@ class phpbb_template { $templates = array($template_name => $template_path); - if ($fallback_template_path !== false) + if ($fallback_template_name !== false) { $templates[$fallback_template_name] = $fallback_template_path; } From 9f2a2a03a83f6d26ee6dc77debdba66dcab4d9a5 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Sat, 18 Feb 2012 00:04:32 +0200 Subject: [PATCH 055/117] [ticket/10655] Error in template inheritance test Fixing error in template inheritance test PHPBB3-10655 --- tests/template/template_inheritance_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/template/template_inheritance_test.php b/tests/template/template_inheritance_test.php index 3a03de6427..b637166ba6 100644 --- a/tests/template/template_inheritance_test.php +++ b/tests/template/template_inheritance_test.php @@ -71,6 +71,6 @@ class phpbb_template_template_inheritance_test extends phpbb_template_template_t $this->template_locator = new phpbb_template_locator(); $this->template_provider = new phpbb_template_path_provider(); $this->template = new phpbb_template($phpbb_root_path, $phpEx, $config, $user, $this->template_locator, $this->template_provider); - $this->template->set_custom_template($this->template_path, 'tests', $this->parent_template_path); + $this->template->set_custom_template($this->template_path, 'tests', $this->parent_template_path, 'parent'); } } From c3265c913817e5e774d30993c181d70e853b60d4 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 20 Feb 2012 01:52:33 +0100 Subject: [PATCH 056/117] [ticket/10639] Do not allow negative post count as rank's minimum posts PHPBB3-10639 --- phpBB/includes/acp/acp_ranks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_ranks.php b/phpBB/includes/acp/acp_ranks.php index dfd7511427..ea057cd84c 100644 --- a/phpBB/includes/acp/acp_ranks.php +++ b/phpBB/includes/acp/acp_ranks.php @@ -52,7 +52,7 @@ class acp_ranks } $rank_title = utf8_normalize_nfc(request_var('title', '', true)); $special_rank = request_var('special_rank', 0); - $min_posts = ($special_rank) ? 0 : request_var('min_posts', 0); + $min_posts = ($special_rank) ? 0 : max(0, request_var('min_posts', 0)); $rank_image = request_var('rank_image', ''); // The rank image has to be a jpg, gif or png From afcf9cbc8617462853d3b42e4dfc9f1f46051e79 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 20 Feb 2012 02:14:23 +0100 Subject: [PATCH 057/117] [ticket/10630] Perform array_unique on authors array before creating the query This is needed to avoid an additional appearance for an author for every post he made. PHPBB3-10630 --- phpBB/includes/search/fulltext_mysql.php | 2 +- phpBB/includes/search/fulltext_native.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 29cdd8ee9a..52372a14d8 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -707,7 +707,7 @@ class fulltext_mysql extends search_backend */ function index_remove($post_ids, $author_ids, $forum_ids) { - $this->destroy_cache(array(), $author_ids); + $this->destroy_cache(array(), array_unique($author_ids)); } /** diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index 727e3aaffb..b63205fd76 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -1334,7 +1334,7 @@ class fulltext_native extends search_backend $db->sql_query($sql); } - $this->destroy_cache(array_unique($word_texts), $author_ids); + $this->destroy_cache(array_unique($word_texts), array_unique($author_ids)); } /** From ef154b78a169402e7f968cd2189b69b041a73543 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 20 Feb 2012 02:16:41 +0100 Subject: [PATCH 058/117] [ticket/10630] Use sql_like_expression() method instead of hardcoded LIKE '%x%' PHPBB3-10630 --- phpBB/includes/search/search.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/search/search.php b/phpBB/includes/search/search.php index 2f20d11495..df7c8a0892 100644 --- a/phpBB/includes/search/search.php +++ b/phpBB/includes/search/search.php @@ -295,7 +295,7 @@ class search_backend $sql_where = ''; foreach ($authors as $author) { - $sql_where .= (($sql_where) ? ' OR ' : '') . 'search_authors LIKE \'% ' . (int) $author . ' %\''; + $sql_where .= (($sql_where) ? ' OR ' : '') . 'search_authors ' . $db->sql_like_expression($db->any_char . ' ' . (int) $author . ' ' . $db->any_char); } $sql = 'SELECT search_key From 340a8f19d687efab84de9335e7c40cabeef90acf Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 21 Feb 2012 11:25:22 +0100 Subject: [PATCH 059/117] [ticket/10456] Add tabindex to subsilver2 captcha Did not set tabindex on registration page, as the hole page does not have any. PHPBB3-10456 --- phpBB/styles/subsilver2/template/captcha_default.html | 2 +- phpBB/styles/subsilver2/template/captcha_qa.html | 2 +- phpBB/styles/subsilver2/template/login_body.html | 2 +- phpBB/styles/subsilver2/template/posting_body.html | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/phpBB/styles/subsilver2/template/captcha_default.html b/phpBB/styles/subsilver2/template/captcha_default.html index 4c65f81643..e2edf0b810 100644 --- a/phpBB/styles/subsilver2/template/captcha_default.html +++ b/phpBB/styles/subsilver2/template/captcha_default.html @@ -12,6 +12,6 @@ {L_CONFIRM_CODE}:
{L_CONFIRM_CODE_EXPLAIN} - + tabindex="{$CAPTCHA_TAB_INDEX}" /> diff --git a/phpBB/styles/subsilver2/template/captcha_qa.html b/phpBB/styles/subsilver2/template/captcha_qa.html index 23d2a92f68..acc9cdcdfb 100644 --- a/phpBB/styles/subsilver2/template/captcha_qa.html +++ b/phpBB/styles/subsilver2/template/captcha_qa.html @@ -3,6 +3,6 @@ {QA_CONFIRM_QUESTION}:
{L_CONFIRM_QUESTION_EXPLAIN} - + tabindex="{$CAPTCHA_TAB_INDEX}" /> diff --git a/phpBB/styles/subsilver2/template/login_body.html b/phpBB/styles/subsilver2/template/login_body.html index 262341e0c0..ba316517a9 100644 --- a/phpBB/styles/subsilver2/template/login_body.html +++ b/phpBB/styles/subsilver2/template/login_body.html @@ -68,7 +68,7 @@ - + diff --git a/phpBB/styles/subsilver2/template/posting_body.html b/phpBB/styles/subsilver2/template/posting_body.html index fec6d7ff6c..d7947caf2f 100644 --- a/phpBB/styles/subsilver2/template/posting_body.html +++ b/phpBB/styles/subsilver2/template/posting_body.html @@ -333,6 +333,7 @@ + From 3762bf5e99f0ac4202aec117a959b64efc98deff Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Tue, 21 Feb 2012 18:19:14 +0200 Subject: [PATCH 060/117] [ticket/10663] Adding nested directory to finder test Adding nested directory to finder test, triggering finder bug PHPBB3-10663 --- tests/extension/ext/foo/type/dummy/empty.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 tests/extension/ext/foo/type/dummy/empty.txt diff --git a/tests/extension/ext/foo/type/dummy/empty.txt b/tests/extension/ext/foo/type/dummy/empty.txt new file mode 100644 index 0000000000..e69de29bb2 From 41870c40954bdd0faad2ce4b01fb416a03eed4e0 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 21 Feb 2012 18:32:08 +0100 Subject: [PATCH 061/117] [ticket/10663] Extension finder should not find subdirs with directory filter The directory filter pattern now has a $ in the end, do avoid subdirectories from being matched as well. PHPBB3-10663 --- phpBB/includes/extension/finder.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpBB/includes/extension/finder.php b/phpBB/includes/extension/finder.php index e5e5e4983e..23b9f1c658 100644 --- a/phpBB/includes/extension/finder.php +++ b/phpBB/includes/extension/finder.php @@ -375,6 +375,10 @@ class phpbb_extension_finder { $directory_pattern = preg_quote(DIRECTORY_SEPARATOR . str_replace('/', DIRECTORY_SEPARATOR, $directory) . DIRECTORY_SEPARATOR, '#'); } + if ($is_dir) + { + $directory_pattern .= '$'; + } $directory_pattern = '#' . $directory_pattern . '#'; $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST); From cbd20c1bbe3b8b8c628dde77f8ddf1c159eedb1c Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Tue, 7 Feb 2012 17:19:24 +0100 Subject: [PATCH 062/117] [ticket/10667] Fix tests under MySQL 5.5 strict mode PHPBB3-10667 --- tests/extension/fixtures/extensions.xml | 3 +++ tests/group_positions/fixtures/group_positions.xml | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/tests/extension/fixtures/extensions.xml b/tests/extension/fixtures/extensions.xml index 65cb71c7a4..6eb6fd11a5 100644 --- a/tests/extension/fixtures/extensions.xml +++ b/tests/extension/fixtures/extensions.xml @@ -3,13 +3,16 @@
ext_nameext_active + ext_state foo 1 + vendor/moo 0 +
diff --git a/tests/group_positions/fixtures/group_positions.xml b/tests/group_positions/fixtures/group_positions.xml index 55b1c2e08d..00ea18fe4f 100644 --- a/tests/group_positions/fixtures/group_positions.xml +++ b/tests/group_positions/fixtures/group_positions.xml @@ -4,20 +4,24 @@ group_id group_teampage group_legend + group_desc 1 0 0 + 2 1 0 + 3 2 1 + From 8e1e48a7b69b78e10297869e3aaf224e5c12e493 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 23 Feb 2012 10:55:57 +0100 Subject: [PATCH 063/117] [ticket/8636] Add resync option to topic_view moderation page PHPBB3-8636 --- phpBB/includes/mcp/mcp_topic.php | 11 +++++++++++ phpBB/styles/prosilver/template/mcp_topic.html | 1 + phpBB/styles/subsilver2/template/mcp_topic.html | 1 + 3 files changed, 13 insertions(+) diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index d7cc1e795a..7d4edaf362 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -50,6 +50,16 @@ function mcp_topic_view($id, $mode, $action) $submitted_id_list = request_var('post_ids', array(0)); $checked_ids = $post_id_list = request_var('post_id_list', array(0)); + // Resync Topic? + if ($action == 'resync') + { + if (!function_exists('mcp_resync_topics')) + { + include($phpbb_root_path . 'includes/mcp/mcp_forum.' . $phpEx); + } + mcp_resync_topics(array($topic_id)); + } + // Split Topic? if ($action == 'split_all' || $action == 'split_beyond') { @@ -320,6 +330,7 @@ function mcp_topic_view($id, $mode, $action) 'S_CAN_APPROVE' => ($has_unapproved_posts && $auth->acl_get('m_approve', $topic_info['forum_id'])) ? true : false, 'S_CAN_LOCK' => ($auth->acl_get('m_lock', $topic_info['forum_id'])) ? true : false, 'S_CAN_REPORT' => ($auth->acl_get('m_report', $topic_info['forum_id'])) ? true : false, + 'S_CAN_SYNC' => $auth->acl_get('m_', $topic_info['forum_id']), 'S_REPORT_VIEW' => ($action == 'reports') ? true : false, 'S_MERGE_VIEW' => ($action == 'merge') ? true : false, 'S_SPLIT_VIEW' => ($action == 'split') ? true : false, diff --git a/phpBB/styles/prosilver/template/mcp_topic.html b/phpBB/styles/prosilver/template/mcp_topic.html index a4d2a0f600..2a5f52f038 100644 --- a/phpBB/styles/prosilver/template/mcp_topic.html +++ b/phpBB/styles/prosilver/template/mcp_topic.html @@ -158,6 +158,7 @@ onload_functions.push('subPanels()'); +   diff --git a/phpBB/styles/subsilver2/template/mcp_topic.html b/phpBB/styles/subsilver2/template/mcp_topic.html index 13865d26ee..f9f9382ff2 100644 --- a/phpBB/styles/subsilver2/template/mcp_topic.html +++ b/phpBB/styles/subsilver2/template/mcp_topic.html @@ -135,6 +135,7 @@ +   From 30c08bfe5bcfa9e9a62cf8a018dd32d2a7e11b81 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 23 Feb 2012 16:25:47 +0100 Subject: [PATCH 064/117] [ticket/10458] Fix xHTML errors when print-viewing PMs PHPBB3-10458 --- .../prosilver/template/ucp_pm_viewmessage_print.html | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html index e72d9bba6e..bafb64dbc8 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html +++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html @@ -1,10 +1,7 @@ - - - - + @@ -16,7 +13,7 @@
- + diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html index 79c2c0355f..1840732b64 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html +++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html @@ -2,7 +2,7 @@ -
+
diff --git a/phpBB/styles/prosilver/theme/cp.css b/phpBB/styles/prosilver/theme/cp.css index e28887d60f..aed88831a8 100644 --- a/phpBB/styles/prosilver/theme/cp.css +++ b/phpBB/styles/prosilver/theme/cp.css @@ -358,7 +358,7 @@ dl.mini dd { } .reply-all { - font-size: 11px; + font-size: 11px; padding-top: 5px; } From d3091da5eade90aac1b13244d04bd1fb342bcc59 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 21 Feb 2012 01:08:04 +0100 Subject: [PATCH 070/117] [ticket/9220] Remove margin on table.table1 so it's centered in the blue box. The problem here was, that we use width: 100% in combination with the negative margin. This causes the element to be just moved to the side, so it's not centered anymore. width: auto would fix this, but it causes strange behaviour on IE and looks even more ugly. So I decided to just remove the margin at all. The border is now 1px thicker for all sides. PHPBB3-9220 --- .../styles/prosilver/template/memberlist_body.html | 2 +- .../prosilver/template/memberlist_leaders.html | 4 ++-- phpBB/styles/prosilver/template/search_body.html | 2 +- .../styles/prosilver/template/viewonline_body.html | 2 +- phpBB/styles/prosilver/theme/common.css | 14 +++++++++++++- phpBB/styles/prosilver/theme/tweaks.css | 4 ---- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html index 9e6f8c3aab..5ea774bf06 100644 --- a/phpBB/styles/prosilver/template/memberlist_body.html +++ b/phpBB/styles/prosilver/template/memberlist_body.html @@ -80,7 +80,7 @@
-
+
diff --git a/phpBB/styles/prosilver/template/memberlist_leaders.html b/phpBB/styles/prosilver/template/memberlist_leaders.html index 3917498050..26e299d261 100644 --- a/phpBB/styles/prosilver/template/memberlist_leaders.html +++ b/phpBB/styles/prosilver/template/memberlist_leaders.html @@ -4,7 +4,7 @@ -
+
@@ -37,7 +37,7 @@ -
+
diff --git a/phpBB/styles/prosilver/template/search_body.html b/phpBB/styles/prosilver/template/search_body.html index 6616b95a73..4b1d30d77d 100644 --- a/phpBB/styles/prosilver/template/search_body.html +++ b/phpBB/styles/prosilver/template/search_body.html @@ -98,7 +98,7 @@ -
+
diff --git a/phpBB/styles/prosilver/template/viewonline_body.html b/phpBB/styles/prosilver/template/viewonline_body.html index b111d743f9..3f1f0e64bf 100644 --- a/phpBB/styles/prosilver/template/viewonline_body.html +++ b/phpBB/styles/prosilver/template/viewonline_body.html @@ -7,7 +7,7 @@ -
+
diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index 8b5e09297e..7eb00bd808 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -418,7 +418,19 @@ table.info tbody th { } .forumbg table.table1 { - margin: 0 -2px -1px -1px; + margin: 0; +} + +.forumbg-table > .inner { + margin: 0 -1px; +} + +.forumbg-table > .inner > span.corners-top { + margin: 0 -4px -1px -4px; +} + +.forumbg-table > .inner > span.corners-bottom { + margin: -1px -4px 0 -4px; } /* Misc layout styles diff --git a/phpBB/styles/prosilver/theme/tweaks.css b/phpBB/styles/prosilver/theme/tweaks.css index f7322c2cce..5e11b2122b 100644 --- a/phpBB/styles/prosilver/theme/tweaks.css +++ b/phpBB/styles/prosilver/theme/tweaks.css @@ -87,10 +87,6 @@ dl.icon { float: none; } -* html .forumbg table.table1 { - margin: 0 -2px 0px -1px; -} - /* Headerbar height fix for IE7 and below */ * html #site-description p { margin-bottom: 1.0em; From 5924bc1d027b427e4bc5df78bbac617e006d3633 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 27 Feb 2012 19:13:31 +0100 Subject: [PATCH 071/117] [ticket/10672] Fix total post count language string in statistics and feed PHPBB3-10672 --- phpBB/feed.php | 2 +- phpBB/index.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/feed.php b/phpBB/feed.php index 00247c1958..fcf42a83ae 100644 --- a/phpBB/feed.php +++ b/phpBB/feed.php @@ -1106,7 +1106,7 @@ class phpbb_feed_forums extends phpbb_feed_base global $user; $item_row['statistics'] = $user->lang('TOTAL_TOPICS', (int) $row['forum_topics']) - . ' ' . $this->separator_stats . ' ' . $user->lang('TOTAL_POSTS_OTHER', (int) $row['forum_posts']); + . ' ' . $this->separator_stats . ' ' . $user->lang('TOTAL_POSTS_COUNT', (int) $row['forum_posts']); } } } diff --git a/phpBB/index.php b/phpBB/index.php index 5f2254ac7f..f1243bb336 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -114,7 +114,7 @@ if ($config['load_birthdays'] && $config['allow_birthdays'] && $auth->acl_gets(' // Assign index specific vars $template->assign_vars(array( - 'TOTAL_POSTS' => $user->lang('TOTAL_POSTS', (int) $config['num_posts']), + 'TOTAL_POSTS' => $user->lang('TOTAL_POSTS_COUNT', (int) $config['num_posts']), 'TOTAL_TOPICS' => $user->lang('TOTAL_TOPICS', (int) $config['num_topics']), 'TOTAL_USERS' => $user->lang('TOTAL_USERS', (int) $config['num_users']), 'NEWEST_USER' => $user->lang('NEWEST_USER', get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])), From 864606feede3b25bc94142c79727638c8231f79b Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Wed, 29 Feb 2012 21:55:22 +0000 Subject: [PATCH 072/117] [ticket/10680] Add /phpBB/ext/* to .gitignore PHPBB3-10680 --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 1ac01d9b2d..d875beb784 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /phpBB/cache/*.php /phpBB/cache/queue.php.lock /phpBB/config.php +/phpBB/ext/* /phpBB/files/* /phpBB/images/avatars/gallery/* /phpBB/images/avatars/upload/* From 470b79c9e38ea5c37fe5f4685618e5794b6954ad Mon Sep 17 00:00:00 2001 From: Bruno Ais Date: Fri, 24 Feb 2012 07:41:08 +0000 Subject: [PATCH 073/117] [ticket/8652] Sending 2 emails on 2 replies This is a fix for the problem of the system sending 2 emails when there are 2 replies to a topic where the user is subscribed in a topic and the forum that contains the topic. This simple fix seems to solve the problem. In simple tests I made it shows it does. PHPBB3-8652 --- phpBB/includes/functions_posting.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 77d92e26e2..38f542264c 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1286,6 +1286,12 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id { $msg_users[] = $row; $update_notification[$row['notify_type']][] = $row['user_id']; + if ($row['notify_type'] === 'topic') + { + // Using SQL characteristics. If it didn't exist it isn't added. + // It's very rare to find someone that is registered in topic and noone is registered in the forum + $update_notification['forum'][] = $row['user_id']; + } } } unset($notify_rows); From b74530259faa6197d7215d957c180280210a93e0 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 2 Mar 2012 00:19:42 +0100 Subject: [PATCH 074/117] [ticket/8652] Comment for also updating forum watch table in user_notification. PHPBB3-8652 --- phpBB/includes/functions_posting.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 38f542264c..f920be9c4b 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1286,10 +1286,18 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id { $msg_users[] = $row; $update_notification[$row['notify_type']][] = $row['user_id']; + + /* + * We also update the forums watch table for this user when we are + * sending out a topic notification to prevent sending out another + * notification in case this user is also subscribed to the forum + * this topic was posted in. + * Since an UPDATE query is used, this has no effect on users only + * subscribed to the topic (i.e. no row is created) and should not + * be a performance issue. + */ if ($row['notify_type'] === 'topic') { - // Using SQL characteristics. If it didn't exist it isn't added. - // It's very rare to find someone that is registered in topic and noone is registered in the forum $update_notification['forum'][] = $row['user_id']; } } From efe25a0b49c7445bef665ab28fc979e485e49289 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 29 Oct 2011 15:31:29 +0200 Subject: [PATCH 075/117] [ticket/9813] Use SHOW TABLE STATUS to get search stats for native on MySQL. PHPBB3-9813 --- phpBB/includes/search/fulltext_native.php | 38 +++++++++++++++++------ 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index b63205fd76..e5eee50fdb 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -1461,17 +1461,35 @@ class fulltext_native extends search_backend { global $db; - $sql = 'SELECT COUNT(*) as total_words - FROM ' . SEARCH_WORDLIST_TABLE; - $result = $db->sql_query($sql); - $this->stats['total_words'] = (int) $db->sql_fetchfield('total_words'); - $db->sql_freeresult($result); + switch ($db->sql_layer) + { + case 'mysql4': + case 'mysqli': + $sql = "SHOW TABLE STATUS LIKE '" . SEARCH_WORDLIST_TABLE . "'"; + $result = $db->sql_query($sql); + $this->stats['total_words'] = (int) $db->sql_fetchfield('Rows'); + $db->sql_freeresult($result); - $sql = 'SELECT COUNT(*) as total_matches - FROM ' . SEARCH_WORDMATCH_TABLE; - $result = $db->sql_query($sql); - $this->stats['total_matches'] = (int) $db->sql_fetchfield('total_matches'); - $db->sql_freeresult($result); + $sql = "SHOW TABLE STATUS LIKE '" . SEARCH_WORDMATCH_TABLE . "'"; + $result = $db->sql_query($sql); + $this->stats['total_matches'] = (int) $db->sql_fetchfield('Rows'); + $db->sql_freeresult($result); + break; + + default: + $sql = 'SELECT COUNT(*) as total_words + FROM ' . SEARCH_WORDLIST_TABLE; + $result = $db->sql_query($sql); + $this->stats['total_words'] = (int) $db->sql_fetchfield('total_words'); + $db->sql_freeresult($result); + + $sql = 'SELECT COUNT(*) as total_matches + FROM ' . SEARCH_WORDMATCH_TABLE; + $result = $db->sql_query($sql); + $this->stats['total_matches'] = (int) $db->sql_fetchfield('total_matches'); + $db->sql_freeresult($result); + break; + } } /** From 97cf433dea658127ed60c70ea47d1c3830964f25 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 12 Dec 2011 02:41:48 +0100 Subject: [PATCH 076/117] [ticket/9813] Use table status row count only if greater than 100000 or exact. PHPBB3-9813 --- phpBB/includes/search/fulltext_native.php | 67 ++++++++++++++--------- 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index e5eee50fdb..69937ff9c9 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -1458,38 +1458,53 @@ class fulltext_native extends search_backend } function get_stats() + { + $this->stats['total_words'] = $this->get_table_row_count(SEARCH_WORDLIST_TABLE); + $this->stats['total_matches'] = $this->get_table_row_count(SEARCH_WORDMATCH_TABLE); + } + + /** + * Gets statistics for a specific database table. + * + * @param string $table_name Table name + * + * @return string Row count. Prefixed with ~ if estimated. + * + * @access protected + */ + function get_table_row_count($table_name) { global $db; - switch ($db->sql_layer) + if (stripos($db->sql_layer, 'mysql') === 0) { - case 'mysql4': - case 'mysqli': - $sql = "SHOW TABLE STATUS LIKE '" . SEARCH_WORDLIST_TABLE . "'"; - $result = $db->sql_query($sql); - $this->stats['total_words'] = (int) $db->sql_fetchfield('Rows'); - $db->sql_freeresult($result); + $sql = "SHOW TABLE STATUS + LIKE '" . $table_name . "'"; + $result = $db->sql_query($sql); + $table_status = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - $sql = "SHOW TABLE STATUS LIKE '" . SEARCH_WORDMATCH_TABLE . "'"; - $result = $db->sql_query($sql); - $this->stats['total_matches'] = (int) $db->sql_fetchfield('Rows'); - $db->sql_freeresult($result); - break; - - default: - $sql = 'SELECT COUNT(*) as total_words - FROM ' . SEARCH_WORDLIST_TABLE; - $result = $db->sql_query($sql); - $this->stats['total_words'] = (int) $db->sql_fetchfield('total_words'); - $db->sql_freeresult($result); - - $sql = 'SELECT COUNT(*) as total_matches - FROM ' . SEARCH_WORDMATCH_TABLE; - $result = $db->sql_query($sql); - $this->stats['total_matches'] = (int) $db->sql_fetchfield('total_matches'); - $db->sql_freeresult($result); - break; + if (isset($table_status['Engine'])) + { + if ($table_status['Engine'] === 'MyISAM') + { + return $table_status['Rows']; + } + else if ($table_status['Engine'] === 'InnoDB' && $table_status['Rows'] > 100000) + { + return '~' . $table_status['Rows']; + } + } } + + // Get exact row count by actually counting rows + $sql = 'SELECT COUNT(*) AS rows_total + FROM ' . $table_name; + $result = $db->sql_query($sql); + $rows_total = $db->sql_fetchfield('rows_total'); + $db->sql_freeresult($result); + + return $rows_total; } /** From f9953fc3395e6b206c0789d40f89f9d2463348e7 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 18 Feb 2012 19:29:32 +0100 Subject: [PATCH 077/117] [ticket/10653] Add ability to count table rows to database abstraction layer. PHPBB3-10653 --- phpBB/includes/db/dbal.php | 35 ++++++++++++ phpBB/includes/db/mysql.php | 70 +++++++++++++++++++++++ phpBB/includes/db/mysqli.php | 70 +++++++++++++++++++++++ phpBB/includes/search/fulltext_native.php | 46 +-------------- 4 files changed, 177 insertions(+), 44 deletions(-) diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index 230c9c8ed7..5d456c2ff0 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -900,6 +900,41 @@ class dbal return true; } + + /** + * Gets the estimated number of rows in a specified table. + * + * @param string $table_name Table name + * + * @return string Number of rows in $table_name. + * Prefixed with ~ if estimated (otherwise exact). + * + * @access public + */ + function get_estimated_row_count($table_name) + { + return $this->get_row_count($table_name); + } + + /** + * Gets the exact number of rows in a specified table. + * + * @param string $table_name Table name + * + * @return string Exact number of rows in $table_name. + * + * @access public + */ + function get_row_count($table_name) + { + $sql = 'SELECT COUNT(*) AS rows_total + FROM ' . $this->sql_escape($table_name); + $result = $this->sql_query($sql); + $rows_total = $this->sql_fetchfield('rows_total'); + $this->sql_freeresult($result); + + return $rows_total; + } } /** diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php index 1e24c79577..87413e808d 100644 --- a/phpBB/includes/db/mysql.php +++ b/phpBB/includes/db/mysql.php @@ -318,6 +318,76 @@ class dbal_mysql extends dbal return @mysql_real_escape_string($msg, $this->db_connect_id); } + /** + * Gets the estimated number of rows in a specified table. + * + * @param string $table_name Table name + * + * @return string Number of rows in $table_name. + * Prefixed with ~ if estimated (otherwise exact). + * + * @access public + */ + function get_estimated_row_count($table_name) + { + $table_status = $this->get_table_status($table_name); + + if (isset($table_status['Engine'])) + { + if ($table_status['Engine'] === 'MyISAM') + { + return $table_status['Rows']; + } + else if ($table_status['Engine'] === 'InnoDB' && $table_status['Rows'] > 100000) + { + return '~' . $table_status['Rows']; + } + } + + return $this->get_row_count($table_name); + } + + /** + * Gets the exact number of rows in a specified table. + * + * @param string $table_name Table name + * + * @return string Exact number of rows in $table_name. + * + * @access public + */ + function get_row_count($table_name) + { + $table_status = $this->get_table_status($table_name); + + if (isset($table_status['Engine']) && $table_status['Engine'] === 'MyISAM') + { + return $table_status['Rows']; + } + + return parent::get_row_count($table_name); + } + + /** + * Gets some information about the specified table. + * + * @param string $table_name Table name + * + * @return array + * + * @access protected + */ + function get_table_status($table_name) + { + $sql = "SHOW TABLE STATUS + LIKE '" . $this->sql_escape($table_name) . "'"; + $result = $this->sql_query($sql); + $table_status = $this->sql_fetchrow($result); + $this->sql_freeresult($result); + + return $table_status; + } + /** * Build LIKE expression * @access private diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php index 456ce906d0..49b2789ce6 100644 --- a/phpBB/includes/db/mysqli.php +++ b/phpBB/includes/db/mysqli.php @@ -315,6 +315,76 @@ class dbal_mysqli extends dbal return @mysqli_real_escape_string($this->db_connect_id, $msg); } + /** + * Gets the estimated number of rows in a specified table. + * + * @param string $table_name Table name + * + * @return string Number of rows in $table_name. + * Prefixed with ~ if estimated (otherwise exact). + * + * @access public + */ + function get_estimated_row_count($table_name) + { + $table_status = $this->get_table_status($table_name); + + if (isset($table_status['Engine'])) + { + if ($table_status['Engine'] === 'MyISAM') + { + return $table_status['Rows']; + } + else if ($table_status['Engine'] === 'InnoDB' && $table_status['Rows'] > 100000) + { + return '~' . $table_status['Rows']; + } + } + + return $this->get_row_count($table_name); + } + + /** + * Gets the exact number of rows in a specified table. + * + * @param string $table_name Table name + * + * @return string Exact number of rows in $table_name. + * + * @access public + */ + function get_row_count($table_name) + { + $table_status = $this->get_table_status($table_name); + + if (isset($table_status['Engine']) && $table_status['Engine'] === 'MyISAM') + { + return $table_status['Rows']; + } + + return parent::get_row_count($table_name); + } + + /** + * Gets some information about the specified table. + * + * @param string $table_name Table name + * + * @return array + * + * @access protected + */ + function get_table_status($table_name) + { + $sql = "SHOW TABLE STATUS + LIKE '" . $this->sql_escape($table_name) . "'"; + $result = $this->sql_query($sql); + $table_status = $this->sql_fetchrow($result); + $this->sql_freeresult($result); + + return $table_status; + } + /** * Build LIKE expression * @access private diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index 69937ff9c9..dc961f3c8a 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -1458,53 +1458,11 @@ class fulltext_native extends search_backend } function get_stats() - { - $this->stats['total_words'] = $this->get_table_row_count(SEARCH_WORDLIST_TABLE); - $this->stats['total_matches'] = $this->get_table_row_count(SEARCH_WORDMATCH_TABLE); - } - - /** - * Gets statistics for a specific database table. - * - * @param string $table_name Table name - * - * @return string Row count. Prefixed with ~ if estimated. - * - * @access protected - */ - function get_table_row_count($table_name) { global $db; - if (stripos($db->sql_layer, 'mysql') === 0) - { - $sql = "SHOW TABLE STATUS - LIKE '" . $table_name . "'"; - $result = $db->sql_query($sql); - $table_status = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - if (isset($table_status['Engine'])) - { - if ($table_status['Engine'] === 'MyISAM') - { - return $table_status['Rows']; - } - else if ($table_status['Engine'] === 'InnoDB' && $table_status['Rows'] > 100000) - { - return '~' . $table_status['Rows']; - } - } - } - - // Get exact row count by actually counting rows - $sql = 'SELECT COUNT(*) AS rows_total - FROM ' . $table_name; - $result = $db->sql_query($sql); - $rows_total = $db->sql_fetchfield('rows_total'); - $db->sql_freeresult($result); - - return $rows_total; + $this->stats['total_words'] = $db->get_estimated_row_count(SEARCH_WORDLIST_TABLE); + $this->stats['total_matches'] = $db->get_estimated_row_count(SEARCH_WORDMATCH_TABLE); } /** From 6df721b21528e4d9881fa191159b123bb2b6b33f Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 4 Mar 2012 01:59:40 +0100 Subject: [PATCH 078/117] [ticket/10653] Unit tests for get_row_count() and get_estimated_row_count(). PHPBB3-10653 --- tests/dbal/select_test.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/dbal/select_test.php b/tests/dbal/select_test.php index 05b0e68e29..9d46b47b17 100644 --- a/tests/dbal/select_test.php +++ b/tests/dbal/select_test.php @@ -357,4 +357,29 @@ class phpbb_dbal_select_test extends phpbb_database_test_case $this->assertSame(false, $row); } + + public function test_get_row_count() + { + $this->assertSame( + 3, + (int) $this->new_dbal()->get_row_count('phpbb_users'), + "Failed asserting that user table has exactly 3 rows." + ); + } + + public function test_get_estimated_row_count() + { + $actual = $this->new_dbal()->get_estimated_row_count('phpbb_users'); + + if (is_string($actual) && isset($actual[0]) && $actual[0] === '~') + { + $actual = substr($actual, -1); + } + + $this->assertGreaterThan( + 1, + $actual, + "Failed asserting that estimated row count of user table is greater than 1." + ); + } } From f3af5945e3675c4d799000908c88475ee7016ac4 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 4 Mar 2012 22:11:45 +0100 Subject: [PATCH 079/117] [ticket/10653] Fix parameter to substr() in unit tests. Should be 1, not -1. PHPBB3-10653 --- tests/dbal/select_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/dbal/select_test.php b/tests/dbal/select_test.php index 9d46b47b17..21b12777dc 100644 --- a/tests/dbal/select_test.php +++ b/tests/dbal/select_test.php @@ -373,7 +373,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case if (is_string($actual) && isset($actual[0]) && $actual[0] === '~') { - $actual = substr($actual, -1); + $actual = substr($actual, 1); } $this->assertGreaterThan( From 785c75254e763a24cf56765ca9a7e02140982497 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 5 Mar 2012 00:29:28 +0100 Subject: [PATCH 080/117] [ticket/9813] Also use estimated row count of posts table for fulltext mysql. Since this is 'only' for statistics anyway, using an estimated value does no harm. Also, if MyISAM is the underlying storage engine for the posts table, the value will actually be exact. PHPBB3-9813 --- phpBB/includes/search/fulltext_mysql.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 52372a14d8..54cc894f6a 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -896,11 +896,7 @@ class fulltext_mysql extends search_backend } $db->sql_freeresult($result); - $sql = 'SELECT COUNT(post_id) as total_posts - FROM ' . POSTS_TABLE; - $result = $db->sql_query($sql); - $this->stats['total_posts'] = (int) $db->sql_fetchfield('total_posts'); - $db->sql_freeresult($result); + $this->stats['total_posts'] = $db->get_estimated_row_count(POSTS_TABLE); } /** From a98117b22967db2c475988a0b271d827cf0f9af6 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Mon, 5 Mar 2012 02:41:42 +0200 Subject: [PATCH 081/117] [feature/append_var] Adding append_var template class function Adding append_var template class function PHPBB3-10666 --- phpBB/includes/template/context.php | 19 ++++++++++++++++++- phpBB/includes/template/template.php | 17 ++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/template/context.php b/phpBB/includes/template/context.php index 65a3531bc5..ec09da1cf3 100644 --- a/phpBB/includes/template/context.php +++ b/phpBB/includes/template/context.php @@ -53,7 +53,9 @@ class phpbb_template_context } /** - * Assign a single variable to a single key + * Assign a single scalar value to a single key. + * + * Value can be a string, an integer or a boolean. * * @param string $varname Variable name * @param string $varval Value to assign to variable @@ -65,6 +67,21 @@ class phpbb_template_context return true; } + /** + * Append text to the string value stored in a key. + * + * Text is appended using the string concatenation operator (.). + * + * @param string $varname Variable name + * @param string $varval Value to append to variable + */ + public function append_var($varname, $varval) + { + $this->rootref[$varname] = (isset($this->rootref[$varname]) ? $this->rootref[$varname] : '') . $varval; + + return true; + } + /** * Returns a reference to template data array. * diff --git a/phpBB/includes/template/template.php b/phpBB/includes/template/template.php index 9297b759ac..bac5445511 100644 --- a/phpBB/includes/template/template.php +++ b/phpBB/includes/template/template.php @@ -378,7 +378,9 @@ class phpbb_template } /** - * Assign a single variable to a single key + * Assign a single scalar value to a single key. + * + * Value can be a string, an integer or a boolean. * * @param string $varname Variable name * @param string $varval Value to assign to variable @@ -388,6 +390,19 @@ class phpbb_template $this->context->assign_var($varname, $varval); } + /** + * Append text to the string value stored in a key. + * + * Text is appended using the string concatenation operator (.). + * + * @param string $varname Variable name + * @param string $varval Value to append to variable + */ + public function append_var($varname, $varval) + { + $this->context->append_var($varname, $varval); + } + // Docstring is copied from phpbb_template_context method with the same name. /** * Assign key variable pairs from an array to a specified block From 6e5fc53f0d1e456ea1047f061287488504b98f65 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Tue, 6 Mar 2012 19:28:46 -0500 Subject: [PATCH 082/117] [ticket/10685] Refactor template test defaults for php 5.4 compatibility. PHPBB3-10685 --- tests/template/template_inheritance_test.php | 7 +++++-- tests/template/template_test_case.php | 11 ++++++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/template/template_inheritance_test.php b/tests/template/template_inheritance_test.php index b637166ba6..6987ae6c73 100644 --- a/tests/template/template_inheritance_test.php +++ b/tests/template/template_inheritance_test.php @@ -62,9 +62,12 @@ class phpbb_template_template_inheritance_test extends phpbb_template_template_t $this->run_template($file, $vars, $block_vars, $destroy, $expected, $cache_file); } - protected function setup_engine() + protected function setup_engine(array $new_config = array()) { - global $phpbb_root_path, $phpEx, $config, $user; + global $phpbb_root_path, $phpEx, $user; + + $defaults = $this->config_defaults(); + $config = new phpbb_config(array_merge($defaults, $new_config)); $this->template_path = dirname(__FILE__) . '/templates'; $this->parent_template_path = dirname(__FILE__) . '/parent_templates'; diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php index a78837516b..5b60785fee 100644 --- a/tests/template/template_test_case.php +++ b/tests/template/template_test_case.php @@ -46,15 +46,20 @@ class phpbb_template_template_test_case extends phpbb_test_case return str_replace("\n\n", "\n", implode("\n", array_map('trim', explode("\n", trim($result))))); } - protected function setup_engine(array $new_config = array()) + protected function config_defaults() { - global $phpbb_root_path, $phpEx, $user; - $defaults = array( 'load_tplcompile' => true, 'tpl_allow_php' => false, ); + return $defaults; + } + protected function setup_engine(array $new_config = array()) + { + global $phpbb_root_path, $phpEx, $user; + + $defaults = $this->config_defaults(); $config = new phpbb_config(array_merge($defaults, $new_config)); $this->template_path = dirname(__FILE__) . '/templates'; From 6e207e3f691d309bf00deb0c44818fb9072b4a13 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Tue, 6 Mar 2012 19:42:33 -0500 Subject: [PATCH 083/117] [ticket/10618] Change phpBB 3 to phpBB 3.1. PHPBB3-10618 --- phpBB/language/en/install.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index c8cf257f37..82ea95011a 100644 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -78,7 +78,7 @@ $lang = array_merge($lang, array( 'CONTINUE_OLD_CONVERSION' => 'Continue previously started conversion', 'CONVERT' => 'Convert', 'CONVERT_COMPLETE' => 'Conversion completed', - 'CONVERT_COMPLETE_EXPLAIN' => 'You have now successfully converted your board to phpBB 3. You can now login and access your board. Please ensure that the settings were transferred correctly before enabling your board by deleting the install directory. Remember that help on using phpBB is available online via the Documentation and the support forums.', + 'CONVERT_COMPLETE_EXPLAIN' => 'You have now successfully converted your board to phpBB 3.1. You can now login and access your board. Please ensure that the settings were transferred correctly before enabling your board by deleting the install directory. Remember that help on using phpBB is available online via the Documentation and the support forums.', 'CONVERT_INTRO' => 'Welcome to the phpBB Unified Convertor Framework', 'CONVERT_INTRO_BODY' => 'From here, you are able to import data from other (installed) board systems. The list below shows all the conversion modules currently available. If there is no convertor shown in this list for the board software you wish to convert from, please check our website where further conversion modules may be available for download.', 'CONVERT_NEW_CONVERSION' => 'New conversion', @@ -155,7 +155,7 @@ $lang = array_merge($lang, array( 'DLL_XML' => 'XML support [ Jabber ]', 'DLL_ZLIB' => 'zlib compression support [ gz, .tar.gz, .zip ]', 'DL_CONFIG' => 'Download config', - 'DL_CONFIG_EXPLAIN' => 'You may download the complete config.php to your own PC. You will then need to upload the file manually, replacing any existing config.php in your phpBB 3 root directory. Please remember to upload the file in ASCII format (see your FTP application documentation if you are unsure how to achieve this). When you have uploaded the config.php please click “Done” to move to the next stage.', + 'DL_CONFIG_EXPLAIN' => 'You may download the complete config.php to your own PC. You will then need to upload the file manually, replacing any existing config.php in your phpBB 3.1 root directory. Please remember to upload the file in ASCII format (see your FTP application documentation if you are unsure how to achieve this). When you have uploaded the config.php please click “Done” to move to the next stage.', 'DL_DOWNLOAD' => 'Download', 'DONE' => 'Done', @@ -331,7 +331,7 @@ $lang = array_merge($lang, array( 'STAGE_ADVANCED_EXPLAIN' => 'The settings on this page are only necessary to set if you know that you require something different from the default. If you are unsure, just proceed to the next page, as these settings can be altered from the Administration Control Panel later.', 'STAGE_CONFIG_FILE' => 'Configuration file', 'STAGE_CREATE_TABLE' => 'Create database tables', - 'STAGE_CREATE_TABLE_EXPLAIN' => 'The database tables used by phpBB 3 have been created and populated with some initial data. Proceed to the next screen to finish installing phpBB.', + 'STAGE_CREATE_TABLE_EXPLAIN' => 'The database tables used by phpBB 3.1 have been created and populated with some initial data. Proceed to the next screen to finish installing phpBB.', 'STAGE_DATABASE' => 'Database settings', 'STAGE_FINAL' => 'Final stage', 'STAGE_INTRO' => 'Introduction', From 89a0cbc57e98d182f2696c49e182c57fb63b88c7 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Wed, 7 Mar 2012 18:00:57 -0500 Subject: [PATCH 084/117] [ticket/7432] Delete redundant reference to "appropriate menu item". PHPBB3-7432 --- phpBB/language/en/acp/common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 79caa07d98..958b9c7598 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -405,7 +405,7 @@ $lang = array_merge($lang, array( 'INACTIVE_REASON_UNKNOWN' => 'Unknown', 'INACTIVE_USERS' => 'Inactive users', 'INACTIVE_USERS_EXPLAIN' => 'This is a list of users who have registered but whose accounts are inactive. You can activate, delete or remind (by sending an e-mail) these users if you wish.', - 'INACTIVE_USERS_EXPLAIN_INDEX' => 'This is a list of the last 10 registered users who have inactive accounts. Accounts are inactive either because account activation was enabled in user registration settings and these users’ accounts have not yet been activated, or because these accounts have been deactivated. A full list is available from the appropriate menu item or by following the link below from where you can activate, delete or remind (by sending an e-mail) these users if you wish.', + 'INACTIVE_USERS_EXPLAIN_INDEX' => 'This is a list of the last 10 registered users who have inactive accounts. Accounts are inactive either because account activation was enabled in user registration settings and these users’ accounts have not yet been activated, or because these accounts have been deactivated. A full list is available by following the link below from where you can activate, delete or remind (by sending an e-mail) these users if you wish.', 'NO_INACTIVE_USERS' => 'No inactive users', From ebdd03872a9759532805b0319931bb3381ac790f Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Thu, 8 Mar 2012 01:01:16 +0200 Subject: [PATCH 085/117] [feature/append_var] Adding test case Adding test case for append_var PHPBB3-10666 --- tests/template/template_test.php | 36 ++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/template/template_test.php b/tests/template/template_test.php index 419c90bd2a..76b1af68d8 100644 --- a/tests/template/template_test.php +++ b/tests/template/template_test.php @@ -347,6 +347,42 @@ class phpbb_template_template_test extends phpbb_template_template_test_case $this->assertEquals($expected, $this->display('container'), "Testing assign_display($file)"); } + public function test_append_var_without_assign_var() + { + $this->template->set_filenames(array( + 'append_var' => 'variable.html' + )); + + $items = array('This ', 'is ', 'a ', 'test'); + $expecting = implode('', $items); + + foreach ($items as $word) + { + $this->template->append_var('VARIABLE', $word); + } + + $this->assertEquals($expecting, $this->display('append_var')); + } + + public function test_append_var_with_assign_var() + { + $this->template->set_filenames(array( + 'append_var' => 'variable.html' + )); + + $start = 'This '; + $items = array('is ', 'a ', 'test'); + $expecting = $start . implode('', $items); + + $this->template->assign_var('VARIABLE', $start); + foreach ($items as $word) + { + $this->template->append_var('VARIABLE', $word); + } + + $this->assertEquals($expecting, $this->display('append_var')); + } + public function test_php() { $this->setup_engine(array('tpl_allow_php' => true)); From 01d90e59a8c311778a832ba4920e4c5a85b1256f Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 5 Mar 2012 00:42:36 +0100 Subject: [PATCH 086/117] [ticket/9813] Only get posts table row count if we detected a fulltext index. PHPBB3-9813 --- phpBB/includes/search/fulltext_mysql.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 54cc894f6a..779ec1d216 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -896,7 +896,7 @@ class fulltext_mysql extends search_backend } $db->sql_freeresult($result); - $this->stats['total_posts'] = $db->get_estimated_row_count(POSTS_TABLE); + $this->stats['total_posts'] = empty($this->stats) ? 0 : $db->get_estimated_row_count(POSTS_TABLE); } /** From c11607bdd1ad4209a7697f0dc8d46ea81795b14c Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Wed, 7 Mar 2012 12:11:18 +0100 Subject: [PATCH 087/117] [ticket/10653] Call get_row_count of base class in mysql get_estimated_row_count There is no point in fetching the table status again. PHPBB3-10653 --- phpBB/includes/db/mysql.php | 2 +- phpBB/includes/db/mysqli.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php index 87413e808d..1ccb785150 100644 --- a/phpBB/includes/db/mysql.php +++ b/phpBB/includes/db/mysql.php @@ -344,7 +344,7 @@ class dbal_mysql extends dbal } } - return $this->get_row_count($table_name); + return parent::get_row_count($table_name); } /** diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php index 49b2789ce6..a311b8cda6 100644 --- a/phpBB/includes/db/mysqli.php +++ b/phpBB/includes/db/mysqli.php @@ -341,7 +341,7 @@ class dbal_mysqli extends dbal } } - return $this->get_row_count($table_name); + return parent::get_row_count($table_name); } /** From 025de9ee191654825f6ba09a4804e6ef3633b8cb Mon Sep 17 00:00:00 2001 From: rxu Date: Thu, 8 Mar 2012 14:57:47 +0800 Subject: [PATCH 088/117] [ticket/10684] Send notifications for users with stale bans PHPBB3-10684 --- phpBB/includes/functions_posting.php | 36 +++++++++++++++------------- phpBB/includes/functions_user.php | 29 ++++++++++++++++++++++ 2 files changed, 48 insertions(+), 17 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index f920be9c4b..faf904467f 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1180,28 +1180,23 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id $topic_title = ($topic_notification) ? $topic_title : $subject; $topic_title = censor_text($topic_title); - // Get banned User ID's - $sql = 'SELECT ban_userid - 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)) + // Exclude guests, current user and banned users from notifications + if (!function_exists('phpbb_get_banned_users_ids')) { - $sql_ignore_users .= ', ' . (int) $row['ban_userid']; + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); } - $db->sql_freeresult($result); + $sql_ignore_users = phpbb_get_banned_users_ids(); + $sql_ignore_users[ANONYMOUS] = ANONYMOUS; + $sql_ignore_users[$user->data['user_id']] = $user->data['user_id']; $notify_rows = array(); // -- get forum_userids || topic_userids $sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber FROM ' . (($topic_notification) ? TOPICS_WATCH_TABLE : FORUMS_WATCH_TABLE) . ' w, ' . USERS_TABLE . ' u - WHERE w.' . (($topic_notification) ? 'topic_id' : 'forum_id') . ' = ' . (($topic_notification) ? $topic_id : $forum_id) . " - AND w.user_id NOT IN ($sql_ignore_users) - AND w.notify_status = " . NOTIFY_YES . ' + WHERE w.' . (($topic_notification) ? 'topic_id' : 'forum_id') . ' = ' . (($topic_notification) ? $topic_id : $forum_id) . ' + AND ' . $db->sql_in_set('w.user_id', $sql_ignore_users, true) . ' + AND w.notify_status = ' . NOTIFY_YES . ' AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ') AND u.user_id = w.user_id'; $result = $db->sql_query($sql); @@ -1225,16 +1220,23 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id // forum notification is sent to those not already receiving topic notifications if ($topic_notification) { + // Add users who has been already notified to ignore list if (sizeof($notify_rows)) { - $sql_ignore_users .= ', ' . implode(', ', array_keys($notify_rows)); + foreach ($notify_rows as $user_id => $row) + { + if (!isset($sql_ignore_users[$user_id])) + { + $sql_ignore_users[$user_id] = $user_id; + } + } } $sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber FROM ' . FORUMS_WATCH_TABLE . ' fw, ' . USERS_TABLE . " u WHERE fw.forum_id = $forum_id - AND fw.user_id NOT IN ($sql_ignore_users) - AND fw.notify_status = " . NOTIFY_YES . ' + AND " . $db->sql_in_set('fw.user_id', $sql_ignore_users, true) . ' + AND fw.notify_status = ' . NOTIFY_YES . ' AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ') AND u.user_id = fw.user_id'; $result = $db->sql_query($sql); diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 6b5cca8abb..aea94a0d34 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -3587,4 +3587,33 @@ function remove_newly_registered($user_id, $user_data = false) return $user_data['group_id']; } +/** +* Get a list of banned users' ids, ignoring stale buns which were not wiped yet. +* +* @return array Array of banned users' ids if any, empty array otherwise +*/ +function phpbb_get_banned_users_ids() +{ + global $db; + + // Get banned User ID's + // Ignore stale bans which were not wiped yet + $banned_ids_list = array(); + $sql = 'SELECT ban_userid + FROM ' . BANLIST_TABLE . ' + WHERE ban_userid <> 0 + AND ban_exclude <> 1 + AND (ban_end > ' . time() . ' + OR ban_end = 0)'; + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + $user_id = (int) $row['ban_userid']; + $banned_ids_list[$user_id] = $user_id; + } + $db->sql_freeresult($result); + + return $banned_ids_list; +} + ?> \ No newline at end of file From ee6783109ad7af70665c98d6bbc12d170bc0f892 Mon Sep 17 00:00:00 2001 From: rxu Date: Fri, 9 Mar 2012 16:41:49 +0800 Subject: [PATCH 089/117] [ticket/10684] Fix 2 typos in comment lines. PHPBB3-10684 --- phpBB/includes/functions_posting.php | 2 +- phpBB/includes/functions_user.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index faf904467f..ce9762284d 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1220,7 +1220,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id // forum notification is sent to those not already receiving topic notifications if ($topic_notification) { - // Add users who has been already notified to ignore list + // Add users who have been already notified to ignore list if (sizeof($notify_rows)) { foreach ($notify_rows as $user_id => $row) diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index aea94a0d34..dec8d09082 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -3588,7 +3588,7 @@ function remove_newly_registered($user_id, $user_data = false) } /** -* Get a list of banned users' ids, ignoring stale buns which were not wiped yet. +* Get a list of banned users' ids, ignoring stale bans which were not wiped yet. * * @return array Array of banned users' ids if any, empty array otherwise */ From cd61de4bfdd1818d173e7413e53d8fd3d7ce1913 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Fri, 9 Mar 2012 04:31:03 -0500 Subject: [PATCH 090/117] [ticket/9084] Explain the logic. PHPBB3-9084 --- phpBB/includes/functions_profile_fields.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index 79701429e6..d44be16184 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -571,6 +571,11 @@ class custom_profile $this->get_option_lang($field_id, $lang_id, FIELD_DROPDOWN, false); } + // If a dropdown field is required, users + // cannot choose the "no value" option. + // They must choose one of the other options. + // Therefore, here we treat a value equal to + // the "no value" as a lack of value, i.e. NULL. if ($value == $ident_ary['data']['field_novalue'] && $ident_ary['data']['field_required']) { return NULL; From f563647e4b97fc62aa91bc3bf7c81fcc715f17c3 Mon Sep 17 00:00:00 2001 From: rxu Date: Fri, 9 Mar 2012 22:35:13 +0800 Subject: [PATCH 091/117] [ticket/10684] Remove isset() for $sql_ignore_users update PHPBB3-10684 --- phpBB/includes/functions_posting.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index ce9762284d..c9b4267c35 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1225,10 +1225,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id { foreach ($notify_rows as $user_id => $row) { - if (!isset($sql_ignore_users[$user_id])) - { - $sql_ignore_users[$user_id] = $user_id; - } + $sql_ignore_users[$user_id] = $user_id; } } From 89a6cb2886dfd4659e6db67e27e42c4df763f723 Mon Sep 17 00:00:00 2001 From: rxu Date: Sat, 10 Mar 2012 00:17:39 +0800 Subject: [PATCH 092/117] [ticket/10684] Refactor $sql_ignore_users array update PHPBB3-10684 --- phpBB/includes/functions_posting.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index c9b4267c35..af26d8ed0f 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1214,21 +1214,15 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id 'method' => $row['user_notify_type'], 'allowed' => false ); + + // Add users who have been already notified to ignore list + $sql_ignore_users[$row['user_id']] = $row['user_id']; } $db->sql_freeresult($result); // forum notification is sent to those not already receiving topic notifications if ($topic_notification) { - // Add users who have been already notified to ignore list - if (sizeof($notify_rows)) - { - foreach ($notify_rows as $user_id => $row) - { - $sql_ignore_users[$user_id] = $user_id; - } - } - $sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber FROM ' . FORUMS_WATCH_TABLE . ' fw, ' . USERS_TABLE . " u WHERE fw.forum_id = $forum_id @@ -1272,7 +1266,6 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id } } - // Now, we have to do a little step before really sending, we need to distinguish our users a little bit. ;) $msg_users = $delete_ids = $update_notification = array(); foreach ($notify_rows as $user_id => $row) From a79b3490c2b21d283d7bc1f15c4923180e0f10b2 Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 11 Mar 2012 00:56:07 +0800 Subject: [PATCH 093/117] [ticket/10684] Cast user_id to integer PHPBB3-10684 --- phpBB/includes/functions_posting.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index af26d8ed0f..073ce1ff4e 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1203,8 +1203,9 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id while ($row = $db->sql_fetchrow($result)) { - $notify_rows[$row['user_id']] = array( - 'user_id' => $row['user_id'], + $notify_user_id = (int) $row['user_id']; + $notify_rows[$notify_user_id] = array( + 'user_id' => $notify_user_id, 'username' => $row['username'], 'user_email' => $row['user_email'], 'user_jabber' => $row['user_jabber'], @@ -1216,7 +1217,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id ); // Add users who have been already notified to ignore list - $sql_ignore_users[$row['user_id']] = $row['user_id']; + $sql_ignore_users[$notify_user_id] = $notify_user_id; } $db->sql_freeresult($result); @@ -1234,8 +1235,9 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id while ($row = $db->sql_fetchrow($result)) { - $notify_rows[$row['user_id']] = array( - 'user_id' => $row['user_id'], + $notify_user_id = (int) $row['user_id']; + $notify_rows[$notify_user_id] = array( + 'user_id' => $notify_user_id, 'username' => $row['username'], 'user_email' => $row['user_email'], 'user_jabber' => $row['user_jabber'], From 24f1896b3c1591fd73eedd014dc6ebb214804f4d Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Sun, 11 Mar 2012 09:42:56 +0000 Subject: [PATCH 094/117] [ticket/10697] Updating gitignore to match develop branch PHPBB3-10697 --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 7d789c59a1..d875beb784 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,10 @@ *~ /phpunit.xml +/phpBB/cache/*.html /phpBB/cache/*.php /phpBB/cache/queue.php.lock /phpBB/config.php +/phpBB/ext/* /phpBB/files/* /phpBB/images/avatars/gallery/* /phpBB/images/avatars/upload/* From 321d0d9b56011e049b245b6d54975b6c67b3b15b Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 12 Mar 2012 01:44:00 +0800 Subject: [PATCH 095/117] [ticket/10684] Adjust pm_notifications() to handle stale bans - Add parameter (array) to the function phpbb_get_banned_users_ids() - Fix function pm_notification() to handle users with stale bans PHPBB3-10684 --- phpBB/includes/functions_privmsgs.php | 17 ++++++----------- phpBB/includes/functions_user.php | 14 +++++++++----- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index c40ceb088f..8303fc3754 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1622,6 +1622,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i $subject = censor_text($subject); + // Exclude guests, current user and banned users from notifications unset($recipients[ANONYMOUS], $recipients[$user->data['user_id']]); if (!sizeof($recipients)) @@ -1629,18 +1630,12 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i return; } - // Get banned User ID's - $sql = 'SELECT ban_userid - FROM ' . BANLIST_TABLE . ' - WHERE ' . $db->sql_in_set('ban_userid', array_map('intval', array_keys($recipients))) . ' - AND ban_exclude = 0'; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) + if (!function_exists('phpbb_get_banned_users_ids')) { - unset($recipients[$row['ban_userid']]); + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); } - $db->sql_freeresult($result); + $banned_users = phpbb_get_banned_users_ids(array_keys($recipients)); + $recipients = array_diff(array_map('intval', array_keys($recipients)), $banned_users); if (!sizeof($recipients)) { @@ -1649,7 +1644,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i $sql = 'SELECT user_id, username, user_email, user_lang, user_notify_pm, user_notify_type, user_jabber FROM ' . USERS_TABLE . ' - WHERE ' . $db->sql_in_set('user_id', array_map('intval', array_keys($recipients))); + WHERE ' . $db->sql_in_set('user_id', $recipients); $result = $db->sql_query($sql); $msg_list_ary = array(); diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index dec8d09082..8f40401f0b 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -3588,22 +3588,26 @@ function remove_newly_registered($user_id, $user_data = false) } /** -* Get a list of banned users' ids, ignoring stale bans which were not wiped yet. +* Get a list of banned users' ids, ignoring stale bans which were not cleaned yet. * +* @param array $users_ids_array Array of users' ids to check for banning, +* leave empty to get complete list of banned ids * @return array Array of banned users' ids if any, empty array otherwise */ -function phpbb_get_banned_users_ids() +function phpbb_get_banned_users_ids($users_ids_array = array()) { global $db; + $sql_users_ids = (!empty($users_ids_array)) ? $db->sql_in_set('ban_userid', $users_ids_array) : 'ban_userid <> 0'; + // Get banned User ID's // Ignore stale bans which were not wiped yet $banned_ids_list = array(); $sql = 'SELECT ban_userid - FROM ' . BANLIST_TABLE . ' - WHERE ban_userid <> 0 + FROM ' . BANLIST_TABLE . " + WHERE $sql_users_ids AND ban_exclude <> 1 - AND (ban_end > ' . time() . ' + AND (ban_end > " . time() . ' OR ban_end = 0)'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) From da395edbca3e25d1758a6b8c26d14c2e48f112d9 Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 12 Mar 2012 01:47:28 +0800 Subject: [PATCH 096/117] [ticket/10684] Remove intval mapping for array keys PHP manual for arrays http://php.net/manual/en/language.types.array.php states that the following key cast will occur: Strings containing valid integers will be cast to the integer type. E.g. the key "8" will actually be stored under 8. Thus, no intval mapping for numeric array keys is needed. PHPBB3-10684 --- phpBB/includes/functions_privmsgs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 8303fc3754..4ea8f74153 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1635,7 +1635,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i include($phpbb_root_path . 'includes/functions_user.' . $phpEx); } $banned_users = phpbb_get_banned_users_ids(array_keys($recipients)); - $recipients = array_diff(array_map('intval', array_keys($recipients)), $banned_users); + $recipients = array_diff(array_keys($recipients), $banned_users); if (!sizeof($recipients)) { From ff8d5237688beee9ea36848e1ac49565e538c2cd Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 12 Mar 2012 01:57:51 +0800 Subject: [PATCH 097/117] [ticket/10684] Rename function phpbb_get_banned_users_ids() parameter PHPBB3-10684 --- phpBB/includes/functions_user.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 8f40401f0b..8c42a5bb42 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -3590,15 +3590,15 @@ function remove_newly_registered($user_id, $user_data = false) /** * Get a list of banned users' ids, ignoring stale bans which were not cleaned yet. * -* @param array $users_ids_array Array of users' ids to check for banning, -* leave empty to get complete list of banned ids +* @param array $users_ids Array of users' ids to check for banning, +* leave empty to get complete list of banned ids * @return array Array of banned users' ids if any, empty array otherwise */ -function phpbb_get_banned_users_ids($users_ids_array = array()) +function phpbb_get_banned_users_ids($users_ids = array()) { global $db; - $sql_users_ids = (!empty($users_ids_array)) ? $db->sql_in_set('ban_userid', $users_ids_array) : 'ban_userid <> 0'; + $sql_users_ids = (!empty($users_ids)) ? $db->sql_in_set('ban_userid', $users_ids) : 'ban_userid <> 0'; // Get banned User ID's // Ignore stale bans which were not wiped yet From 3b7a6a3eface3389b48358206fff3cb22615dc30 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 12 Mar 2012 00:39:12 +0100 Subject: [PATCH 098/117] [ticket/10689] Fix "First character"-option in "Find a member"-search PHPBB3-10689 --- phpBB/memberlist.php | 1 + 1 file changed, 1 insertion(+) diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index b3c0bae16a..2a2ee407a0 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -1346,6 +1346,7 @@ switch ($mode) if ($mode) { $params[] = "mode=$mode"; + $u_first_char_params[] = "mode=$mode"; } $sort_params[] = "mode=$mode"; From 33dce916e2ed58f1823f3b3fc1b2d72ae3c6686a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 14 Mar 2012 22:22:22 +0100 Subject: [PATCH 099/117] [ticket/10690] Fix undefined UNAPPROVED_POSTS_ZERO_TOTAL in queue PHPBB3-10690 --- phpBB/language/en/mcp.php | 1 + phpBB/styles/prosilver/template/mcp_queue.html | 2 +- phpBB/styles/subsilver2/template/mcp_queue.html | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php index 664365b1ec..bd25d403ab 100644 --- a/phpBB/language/en/mcp.php +++ b/phpBB/language/en/mcp.php @@ -238,6 +238,7 @@ $lang = array_merge($lang, array( 'NO_POST' => 'You have to select a post in order to warn the user for a post.', 'NO_POST_REPORT' => 'This post was not reported.', 'NO_POST_SELECTED' => 'You must select at least one post to perform this action.', + 'NO_POSTS_QUEUE' => 'There are no posts waiting for approval.', 'NO_REASON_DISAPPROVAL' => 'Please give an appropriate reason for disapproval.', 'NO_REPORT' => 'No report found', 'NO_REPORTS' => 'No reports found', diff --git a/phpBB/styles/prosilver/template/mcp_queue.html b/phpBB/styles/prosilver/template/mcp_queue.html index 5f16ebe7d0..f86678ebe4 100644 --- a/phpBB/styles/prosilver/template/mcp_queue.html +++ b/phpBB/styles/prosilver/template/mcp_queue.html @@ -78,7 +78,7 @@ -

{L_NO_TOPICS_QUEUE}{L_UNAPPROVED_POSTS_ZERO_TOTAL}

+

{L_NO_TOPICS_QUEUE}{L_NO_POSTS_QUEUE}

diff --git a/phpBB/styles/subsilver2/template/mcp_queue.html b/phpBB/styles/subsilver2/template/mcp_queue.html index 6e39ccd272..d13af91888 100644 --- a/phpBB/styles/subsilver2/template/mcp_queue.html +++ b/phpBB/styles/subsilver2/template/mcp_queue.html @@ -27,7 +27,7 @@
- + From 71afba0dedd2fcc4e478e191acc23277df8209c9 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Thu, 15 Mar 2012 22:46:06 -0400 Subject: [PATCH 100/117] [task/php54] Refactor error_reporting call slightly. Separate error level assignment into a variable in this commit so that the only difference between Olympus and Ascraeus is the addition of logic altering $level. PHPBB3-10615 --- phpBB/includes/startup.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/startup.php b/phpBB/includes/startup.php index bbe2f127f1..178fb30435 100644 --- a/phpBB/includes/startup.php +++ b/phpBB/includes/startup.php @@ -19,7 +19,8 @@ if (!defined('E_DEPRECATED')) { define('E_DEPRECATED', 8192); } -error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED); +$level = E_ALL & ~E_NOTICE & ~E_DEPRECATED; +error_reporting($level); /* * Remove variables created by register_globals from the global scope From 5efdbfa5e4e3c00c08167cdfff912ee4937f4fd2 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Thu, 15 Mar 2012 22:47:42 -0400 Subject: [PATCH 101/117] [task/php54] Disable E_STRICT in Olympus when running on PHP 5.4. We cannot use static in Olympus because it must be PHP 4 compatible. Therefore disable E_STRICT for Olympus. This commit should be reverted for Ascraeus. PHPBB3-10615 --- phpBB/includes/startup.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/phpBB/includes/startup.php b/phpBB/includes/startup.php index 178fb30435..cf216a65db 100644 --- a/phpBB/includes/startup.php +++ b/phpBB/includes/startup.php @@ -20,6 +20,21 @@ if (!defined('E_DEPRECATED')) define('E_DEPRECATED', 8192); } $level = E_ALL & ~E_NOTICE & ~E_DEPRECATED; +if (version_compare(PHP_VERSION, '5.4.0-dev', '>=')) +{ + // PHP 5.4 adds E_STRICT to E_ALL. + // Our utf8 normalizer triggers E_STRICT output on PHP 5.4. + // Unfortunately it cannot be made E_STRICT-clean while + // continuing to work on PHP 4. + // Therefore, in phpBB 3.0.x we disable E_STRICT on PHP 5.4+, + // while phpBB 3.1 will fix utf8 normalizer. + // E_STRICT is defined starting with PHP 5 + if (!defined('E_STRICT')) + { + define('E_STRICT', 2048); + } + $level &= ~E_STRICT; +} error_reporting($level); /* From ccdd176b72250be2e8f72bd13147679a5f2a263b Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Fri, 16 Mar 2012 04:56:41 -0400 Subject: [PATCH 102/117] [task/php54-ascraeus] Bring p_master#module_auth into PHP 5 era. Split module_auth into a static and a non-static version. Call the static version statically and the non-static version non-statically. PHPBB3-10615 --- phpBB/includes/acp/acp_users.php | 2 +- phpBB/includes/functions_module.php | 22 +++++++++++++++++----- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 97f4b1b5fd..cf6716c322 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -128,7 +128,7 @@ class acp_users $dropdown_modes = array(); while ($row = $db->sql_fetchrow($result)) { - if (!$this->p_master->module_auth($row['module_auth'])) + if (!$this->p_master->module_auth_self($row['module_auth'])) { continue; } diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index db7defdc48..1c1bc42a11 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -128,7 +128,7 @@ class p_master foreach ($this->module_cache['modules'] as $key => $row) { // Not allowed to view module? - if (!$this->module_auth($row['module_auth'])) + if (!$this->module_auth_self($row['module_auth'])) { unset($this->module_cache['modules'][$key]); continue; @@ -315,9 +315,23 @@ class p_master } /** - * Check module authorisation + * Check module authorisation. + * + * This is a non-static version that uses $this->acl_forum_id + * for the forum id. */ - function module_auth($module_auth, $forum_id = false) + function module_auth_self($module_auth) + { + return self::module_auth($module_auth, $this->acl_forum_id); + } + + /** + * Check module authorisation. + * + * This is a static version, it must be given $forum_id. + * See also module_auth_self. + */ + static function module_auth($module_auth, $forum_id) { global $auth, $config; global $request; @@ -365,8 +379,6 @@ class p_master // Make sure $id seperation is working fine $module_auth = str_replace(' , ', ',', $module_auth); - $forum_id = ($forum_id === false) ? $this->acl_forum_id : $forum_id; - $is_auth = false; 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\']', '$request->variable(\'\\1\', false)'), $module_auth) . ');'); From c551b46115c889ac955649fe5513fb1d39d9979e Mon Sep 17 00:00:00 2001 From: Dhruv Goel Date: Mon, 19 Mar 2012 17:11:30 +0530 Subject: [PATCH 103/117] [ticket/10691] Fixed the speed of creating search index $time is now initialized after each batch iteration. Speed for each batch iteration of creating search index is fixed. PHPBB3-10691 --- phpBB/develop/create_search_index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/develop/create_search_index.php b/phpBB/develop/create_search_index.php index 28001035f6..c1a7125d61 100644 --- a/phpBB/develop/create_search_index.php +++ b/phpBB/develop/create_search_index.php @@ -36,7 +36,6 @@ $search_errors = array(); $search = new $class_name($search_errors); $batch_size = isset($argv[2]) ? $argv[2] : 2000; -$time = time(); if (method_exists($search, 'create_index')) { @@ -68,6 +67,7 @@ else while ($post_counter <= $max_post_id) { $row_count = 0; + $time = time(); printf("Processing posts with %d <= post_id <= %d\n", $post_counter + 1, From 2005c339ff26bf189fb818f0e25d6c0954b9702a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 20 Mar 2012 17:45:08 +0100 Subject: [PATCH 104/117] =?UTF-8?q?[ticket/10717]=20Fix=20profile=20field?= =?UTF-8?q?=20sample=20in=20prosilver=C2=B4s=20memberlist=5Fview.html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PHPBB3-10717 --- phpBB/styles/prosilver/template/memberlist_view.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html index cfec07cff0..2758a7e6cc 100644 --- a/phpBB/styles/prosilver/template/memberlist_view.html +++ b/phpBB/styles/prosilver/template/memberlist_view.html @@ -69,7 +69,7 @@
{L_JABBER}:
{L_SEND_JABBER_MESSAGE}
{L_JABBER}:
{USER_JABBER}
-
{postrow.PROFILE_FIELD1_NAME}:
{postrow.PROFILE_FIELD1_VALUE}
+
{PROFILE_FIELD1_NAME}:
{PROFILE_FIELD1_VALUE}
From 92f771eb82b64bb35e0cd42534ddd0306a6aef68 Mon Sep 17 00:00:00 2001 From: Dhruv Goel Date: Thu, 22 Mar 2012 03:10:14 +0530 Subject: [PATCH 105/117] [ticket/10704] minor typo in a comment Make sure $id separation is working fine PHPBB3-10704 --- phpBB/includes/functions_module.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index db7defdc48..ae4f0f238e 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -362,7 +362,7 @@ class p_master $module_auth = implode(' ', $tokens); - // Make sure $id seperation is working fine + // Make sure $id separation is working fine $module_auth = str_replace(' , ', ',', $module_auth); $forum_id = ($forum_id === false) ? $this->acl_forum_id : $forum_id; From 4dafcc2525fa72f2bd91760fae49e51ff9d1a0ef Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Wed, 21 Mar 2012 22:57:29 +0000 Subject: [PATCH 106/117] [task/travis] Adding Travis Continuous Intergration Support PHPBB3-10718 --- .travis.yml | 33 +++++++++++++++++++++++++++++++++ travis/mysql.travis.xml | 28 ++++++++++++++++++++++++++++ travis/postgres.travis.xml | 30 ++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 .travis.yml create mode 100644 travis/mysql.travis.xml create mode 100644 travis/postgres.travis.xml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..e091954e0e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,33 @@ +language: php +php: + - 5.2 + - 5.3 + - 5.4 + +env: + - DB=mysql + - DB=postgres + +before_script: + - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres; fi" + - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'create database phpbb_tests;' -U postgres; fi" + - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS phpbb_tests;'; fi" + - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.2' ]; then pear install --force phpunit/DbUnit; fi" + - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.3' ]; then pyrus install --force phpunit/DbUnit; fi" + - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.4' ]; then pyrus install --force phpunit/DbUnit; fi" + - phpenv rehash + +script: + - phpunit --configuration travis/$DB.travis.xml + +notifications: + email: + recipients: + - m@michaelcullum.com + on_success: never + on_failure: always + +branches: + only: + develop + task/travis diff --git a/travis/mysql.travis.xml b/travis/mysql.travis.xml new file mode 100644 index 0000000000..a849f50136 --- /dev/null +++ b/travis/mysql.travis.xml @@ -0,0 +1,28 @@ + + + + + ../tests/ + + + + + + + + + + + + + diff --git a/travis/postgres.travis.xml b/travis/postgres.travis.xml new file mode 100644 index 0000000000..e44696a335 --- /dev/null +++ b/travis/postgres.travis.xml @@ -0,0 +1,30 @@ + + + + + ../tests/ + + + + + + + + + + + + + + + From 9120c7691e28ca298eb83ebbe12a82c2723cfeee Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Wed, 21 Mar 2012 23:25:50 +0000 Subject: [PATCH 107/117] [task/travis] Removing development information PHPBB3-10718 --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e091954e0e..8e870ca9c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,11 +23,12 @@ script: notifications: email: recipients: - - m@michaelcullum.com + - dev-team@phpbb.com on_success: never - on_failure: always + on_failure: change branches: only: develop + develop-olympus task/travis From 4325bbf4c601332614f456df969983d85829e931 Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Wed, 21 Mar 2012 23:30:56 +0000 Subject: [PATCH 108/117] [task/travis] Add automated testing to readme PHPBB3-10718 --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 6b94f898a3..f7dfc4926e 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,12 @@ Find support and lots more on [phpBB.com](http://www.phpbb.com)! Discuss the dev 3. [Read our Git Contribution Guidelines](http://wiki.phpbb.com/Git); if you're new to git, also read [the introduction guide](http://wiki.phpbb.com/display/DEV/Working+with+Git) 4. Send us a pull request +## AUTOMATED TESTING + +We have unit and functional tests in order to prevent regressions. You can view the bamboo continuous integration [here](http://bamboo.phpbb.com) or check our travis build below. +Develop - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb3.png?branch=develop)](http://travis-ci.org/phpbb/phpbb3) +Develop-Olympus - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb3.png?branch=develop-olympus)](http://travis-ci.org/phpbb/phpbb3) + ## LICENSE [GNU General Public License v2](http://opensource.org/licenses/gpl-2.0.php) From 5a9dd1994fc20aaebe3145540b630826d7333998 Mon Sep 17 00:00:00 2001 From: rxu Date: Thu, 22 Mar 2012 21:19:01 +0800 Subject: [PATCH 109/117] [ticket/10684] Adjust function and parameter name, minor changes. PHPBB3-10684 --- phpBB/includes/functions_posting.php | 4 ++-- phpBB/includes/functions_privmsgs.php | 4 ++-- phpBB/includes/functions_user.php | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 073ce1ff4e..7f45b2da8c 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1181,11 +1181,11 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id $topic_title = censor_text($topic_title); // Exclude guests, current user and banned users from notifications - if (!function_exists('phpbb_get_banned_users_ids')) + if (!function_exists('phpbb_get_banned_user_ids')) { include($phpbb_root_path . 'includes/functions_user.' . $phpEx); } - $sql_ignore_users = phpbb_get_banned_users_ids(); + $sql_ignore_users = phpbb_get_banned_user_ids(); $sql_ignore_users[ANONYMOUS] = ANONYMOUS; $sql_ignore_users[$user->data['user_id']] = $user->data['user_id']; diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 4ea8f74153..447920cfd5 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1630,11 +1630,11 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i return; } - if (!function_exists('phpbb_get_banned_users_ids')) + if (!function_exists('phpbb_get_banned_user_ids')) { include($phpbb_root_path . 'includes/functions_user.' . $phpEx); } - $banned_users = phpbb_get_banned_users_ids(array_keys($recipients)); + $banned_users = phpbb_get_banned_user_ids(array_keys($recipients)); $recipients = array_diff(array_keys($recipients), $banned_users); if (!sizeof($recipients)) diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 8c42a5bb42..10fb57ea97 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -3588,24 +3588,24 @@ function remove_newly_registered($user_id, $user_data = false) } /** -* Get a list of banned users' ids, ignoring stale bans which were not cleaned yet. +* Gets user ids of currently banned registered users. * -* @param array $users_ids Array of users' ids to check for banning, +* @param array $user_ids Array of users' ids to check for banning, * leave empty to get complete list of banned ids * @return array Array of banned users' ids if any, empty array otherwise */ -function phpbb_get_banned_users_ids($users_ids = array()) +function phpbb_get_banned_user_ids($user_ids = array()) { global $db; - $sql_users_ids = (!empty($users_ids)) ? $db->sql_in_set('ban_userid', $users_ids) : 'ban_userid <> 0'; + $sql_user_ids = (!empty($user_ids)) ? $db->sql_in_set('ban_userid', $user_ids) : 'ban_userid <> 0'; // Get banned User ID's // Ignore stale bans which were not wiped yet $banned_ids_list = array(); $sql = 'SELECT ban_userid FROM ' . BANLIST_TABLE . " - WHERE $sql_users_ids + WHERE $sql_user_ids AND ban_exclude <> 1 AND (ban_end > " . time() . ' OR ban_end = 0)'; From d1980f6ad616e800ff82299ceafc5c8c763c6570 Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Thu, 22 Mar 2012 13:32:58 +0000 Subject: [PATCH 110/117] [task/travis] Fixing some travis issues PHPBB3-10718 --- .travis.yml | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8e870ca9c2..bf97a20850 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ notifications: email: recipients: - dev-team@phpbb.com - on_success: never + on_success: change on_failure: change branches: diff --git a/README.md b/README.md index f7dfc4926e..51e65176c6 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,8 @@ Find support and lots more on [phpBB.com](http://www.phpbb.com)! Discuss the dev ## AUTOMATED TESTING We have unit and functional tests in order to prevent regressions. You can view the bamboo continuous integration [here](http://bamboo.phpbb.com) or check our travis build below. -Develop - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb3.png?branch=develop)](http://travis-ci.org/phpbb/phpbb3) -Develop-Olympus - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb3.png?branch=develop-olympus)](http://travis-ci.org/phpbb/phpbb3) +develop - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb3.png?branch=develop)](http://travis-ci.org/phpbb/phpbb3) +develop-olympus - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb3.png?branch=develop-olympus)](http://travis-ci.org/phpbb/phpbb3) ## LICENSE From c7f65fba627680e7de81ae6c7ea9c1e0fc4359ea Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Thu, 22 Mar 2012 14:13:25 +0000 Subject: [PATCH 111/117] [task/travis] Rename travis phpunit config files PHPBB3-10718 --- .travis.yml | 2 +- travis/{mysql.travis.xml => phpunit-mysql-travis.xml} | 0 travis/{postgres.travis.xml => phpunit-postgres-travis.xml} | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename travis/{mysql.travis.xml => phpunit-mysql-travis.xml} (100%) rename travis/{postgres.travis.xml => phpunit-postgres-travis.xml} (100%) diff --git a/.travis.yml b/.travis.yml index bf97a20850..d638e1cccd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ before_script: - phpenv rehash script: - - phpunit --configuration travis/$DB.travis.xml + - phpunit --configuration travis/phpunit-$DB-travis.xml notifications: email: diff --git a/travis/mysql.travis.xml b/travis/phpunit-mysql-travis.xml similarity index 100% rename from travis/mysql.travis.xml rename to travis/phpunit-mysql-travis.xml diff --git a/travis/postgres.travis.xml b/travis/phpunit-postgres-travis.xml similarity index 100% rename from travis/postgres.travis.xml rename to travis/phpunit-postgres-travis.xml From 115ee7f3b815567cf598178225022b2d7d7f5310 Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Thu, 22 Mar 2012 14:44:36 +0000 Subject: [PATCH 112/117] [task/travis] Some more small travis fixes PHPBB3-10718 --- .travis.yml | 6 ------ travis/phpunit-mysql-travis.xml | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index d638e1cccd..78221d588c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,9 +26,3 @@ notifications: - dev-team@phpbb.com on_success: change on_failure: change - -branches: - only: - develop - develop-olympus - task/travis diff --git a/travis/phpunit-mysql-travis.xml b/travis/phpunit-mysql-travis.xml index a849f50136..807dfbcdaa 100644 --- a/travis/phpunit-mysql-travis.xml +++ b/travis/phpunit-mysql-travis.xml @@ -8,7 +8,7 @@ processIsolation="false" stopOnFailure="false" syntaxCheck="true" - strict="true" + strict="true" bootstrap="../tests/bootstrap.php"> From 4000d8051d4e7c07338d48023c4f4c82610a2ddb Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Wed, 21 Mar 2012 23:33:13 +0000 Subject: [PATCH 113/117] [task/travis] Dropping support for 5.2 in develop branch PHPBB3-10718 --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 78221d588c..e2cb463911 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,5 @@ language: php php: - - 5.2 - 5.3 - 5.4 From e034eb96b777978c4b32dad89b46a7fc6e85f52e Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Thu, 22 Mar 2012 14:56:55 +0000 Subject: [PATCH 114/117] [task/travis-develop2] Update version from 5.3 to 5.3.2 PHPBB3-10718 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e2cb463911..8c07f48372 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ language: php php: - - 5.3 + - 5.3.2 - 5.4 env: From 0172ced4e202e5d8dfb0086a0370007113f39c5b Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Thu, 22 Mar 2012 00:06:46 +0000 Subject: [PATCH 115/117] [ticket/10719] Revert "Skip functional tests on PHP 5.2" This reverts commit 9c861a0350ae67f06a38ee6efc890412a32751f4. PHPBB3-10719 --- phpunit.xml.all | 4 ---- phpunit.xml.dist | 4 ---- phpunit.xml.functional | 4 ---- tests/bootstrap.php | 6 +----- 4 files changed, 1 insertion(+), 17 deletions(-) diff --git a/phpunit.xml.all b/phpunit.xml.all index b835a38c20..fde3bbb1a7 100644 --- a/phpunit.xml.all +++ b/phpunit.xml.all @@ -14,10 +14,6 @@ ./tests/ - ./tests/functional - - - ./tests/functional diff --git a/phpunit.xml.dist b/phpunit.xml.dist index da31dce5e3..27dee48aac 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -14,10 +14,6 @@ ./tests/ - ./tests/functional - - - ./tests/functional diff --git a/phpunit.xml.functional b/phpunit.xml.functional index 91d569e65b..9facbcff8b 100644 --- a/phpunit.xml.functional +++ b/phpunit.xml.functional @@ -14,10 +14,6 @@ ./tests/ - ./tests/functional - - - ./tests/functional diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 302701e3b3..f103d8f15a 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -25,8 +25,4 @@ require_once 'test_framework/phpbb_test_case_helpers.php'; require_once 'test_framework/phpbb_test_case.php'; require_once 'test_framework/phpbb_database_test_case.php'; require_once 'test_framework/phpbb_database_test_connection_manager.php'; - -if (version_compare(PHP_VERSION, '5.3.0-dev', '>=')) -{ - require_once 'test_framework/phpbb_functional_test_case.php'; -} +require_once 'test_framework/phpbb_functional_test_case.php'; From 0ed66ad0e8d11c802520046b446aa5622a637df9 Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Thu, 22 Mar 2012 16:00:10 +0000 Subject: [PATCH 116/117] [task/travis] Exclude functional and slow tests PHPBB3-10718 --- travis/phpunit-mysql-travis.xml | 6 ++++++ travis/phpunit-postgres-travis.xml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/travis/phpunit-mysql-travis.xml b/travis/phpunit-mysql-travis.xml index 807dfbcdaa..79215c8de1 100644 --- a/travis/phpunit-mysql-travis.xml +++ b/travis/phpunit-mysql-travis.xml @@ -16,6 +16,12 @@ + + + slow + + + diff --git a/travis/phpunit-postgres-travis.xml b/travis/phpunit-postgres-travis.xml index e44696a335..02db76ae78 100644 --- a/travis/phpunit-postgres-travis.xml +++ b/travis/phpunit-postgres-travis.xml @@ -16,6 +16,12 @@ + + + slow + + + From 841d11c6cd90d331c2923ba7851dd5f813203ddf Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Thu, 22 Mar 2012 16:09:58 +0000 Subject: [PATCH 117/117] [task/travis] Refactor php version check for dbunit install PHPBB3-10718 --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 78221d588c..d73bbd2a48 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,9 +12,7 @@ before_script: - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres; fi" - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'create database phpbb_tests;' -U postgres; fi" - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS phpbb_tests;'; fi" - - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.2' ]; then pear install --force phpunit/DbUnit; fi" - - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.3' ]; then pyrus install --force phpunit/DbUnit; fi" - - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.4' ]; then pyrus install --force phpunit/DbUnit; fi" + - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.2' ]; then pear install --force phpunit/DbUnit; else pyrus install --force phpunit/DbUnit; fi" - phpenv rehash script:
{L_NO_TOPICS_QUEUE}{L_UNAPPROVED_POSTS_ZERO_TOTAL}{L_NO_TOPICS_QUEUE}{L_NO_POSTS_QUEUE}