From 65921ae67a98fa1aa9010ffd433e6420dd224e81 Mon Sep 17 00:00:00 2001 From: Raimon Date: Sun, 13 Nov 2011 20:10:51 +0100 Subject: [PATCH 01/95] [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 02/95] [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 03/95] [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 04/95] [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 05/95] [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 06/95] [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 07/95] [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 08/95] [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 09/95] [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 d9fef488af150107b753b3c30e15ab5bf6d9da38 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 26 Jul 2011 17:48:17 +0200 Subject: [PATCH 10/95] [ticket/9079] Display backtrace on all E_USER_ERROR errors, not only SQL errors PHPBB3-9079 --- phpBB/includes/db/dbal.php | 5 ----- phpBB/includes/functions.php | 7 +++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index b4c1a72e1c..230c9c8ed7 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -662,12 +662,7 @@ class dbal // The DEBUG_EXTRA constant is for development only! if ((isset($auth) && $auth->acl_get('a_')) || defined('IN_INSTALL') || defined('DEBUG_EXTRA')) { - // Print out a nice backtrace... - $backtrace = get_backtrace(); - $message .= ($sql) ? '

SQL

' . htmlspecialchars($sql) : ''; - $message .= ($backtrace) ? '

BACKTRACE
' . $backtrace : ''; - $message .= '
'; } else { diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 852fc683f2..f625f70c0f 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3853,6 +3853,13 @@ function msg_handler($errno, $msg_text, $errfile, $errline) } } + if (defined('IN_INSTALL') || defined('DEBUG_EXTRA') || isset($auth) && $auth->acl_get('a_')) + { + $backtrace = get_backtrace(); + $msg_text .= ($backtrace) ? '

BACKTRACE
' . $backtrace : ''; + $msg_text .= '
'; + } + if ((defined('DEBUG') || defined('IN_CRON') || defined('IMAGE_OUTPUT')) && isset($db)) { // let's avoid loops From b6999237f456443b0b325f2ebee1f990ee7f5116 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sat, 24 Dec 2011 01:24:09 -0500 Subject: [PATCH 11/95] [ticket/9079] Always log backtrace to error log when logging errors. PHPBB3-9079 --- phpBB/includes/functions.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index f625f70c0f..1eefaee651 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3853,18 +3853,23 @@ function msg_handler($errno, $msg_text, $errfile, $errline) } } + $log_text = $msg_text; + $backtrace = get_backtrace(); + if ($backtrace) + { + $log_text .= '

BACKTRACE
' . $backtrace; + } + if (defined('IN_INSTALL') || defined('DEBUG_EXTRA') || isset($auth) && $auth->acl_get('a_')) { - $backtrace = get_backtrace(); - $msg_text .= ($backtrace) ? '

BACKTRACE
' . $backtrace : ''; - $msg_text .= '
'; + $msg_text = $log_text; } if ((defined('DEBUG') || defined('IN_CRON') || defined('IMAGE_OUTPUT')) && isset($db)) { // let's avoid loops $db->sql_return_on_error(true); - add_log('critical', 'LOG_GENERAL_ERROR', $msg_title, $msg_text); + add_log('critical', 'LOG_GENERAL_ERROR', $msg_title, $log_text); $db->sql_return_on_error(false); } From fc297a710e56d938afce83de401b103c72218a1b Mon Sep 17 00:00:00 2001 From: p Date: Fri, 23 Dec 2011 22:10:34 +0000 Subject: [PATCH 12/95] [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 ffde8c8e06c4d37bef5cde280d520c0791ed2c67 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Fri, 6 Jan 2012 17:20:41 +0100 Subject: [PATCH 13/95] [ticket/10477] Normalize loaded module names to be class names or xcp_ prefixed PHPBB3-10477 --- phpBB/includes/functions_module.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index d810285313..a6015b1eac 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -804,6 +804,13 @@ class p_master */ function load($class, $name, $mode = false) { + // new modules use the full class names, old ones are always called _, e.g. acp_board + // in the latter case this function may be called as load(acp, board) + if (!class_exists($name) && substr($name, 0, strlen($class) + 1) !== $class . '_') + { + $name = $class . '_' . $name; + } + $this->p_class = $class; $this->p_name = $name; From 3e36ac6678affa5f8578d29aee6bd2c27fb766b7 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Thu, 12 Jan 2012 22:25:14 -0500 Subject: [PATCH 14/95] [ticket/10579] Delete extra v2 from license block. PHPBB3-10579 --- 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 f1e45c57cc..5372cfac7b 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -3,7 +3,7 @@ * * @package search * @copyright (c) 2005 phpBB Group -* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 v2 +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ From 3f754d118d8fbd36dcefbeea470ecb267e87ace6 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Thu, 12 Jan 2012 22:13:28 -0500 Subject: [PATCH 15/95] [ticket/10477] Document parameters to p_master#load. PHPBB3-10477 --- phpBB/includes/functions_module.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index a6015b1eac..653623a336 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -438,6 +438,8 @@ class p_master * Loads currently active module * * This method loads a given module, passing it the relevant id and mode. + * + * @param string $mode mode, as passed through to the module */ function load_active($mode = false, $module_url = false, $execute_module = true) { @@ -801,11 +803,16 @@ class p_master /** * Load module as the current active one without the need for registering it + * + * @param string $class module class (acp/mcp/ucp) + * @param string $name module name (e.g. zebra for the ucp_zebra module) + * @param string $mode mode, as passed through to the module + * */ function load($class, $name, $mode = false) { // new modules use the full class names, old ones are always called _, e.g. acp_board - // in the latter case this function may be called as load(acp, board) + // in the latter case this function may be called as load('acp', 'board') if (!class_exists($name) && substr($name, 0, strlen($class) + 1) !== $class . '_') { $name = $class . '_' . $name; From 82c05a7ed6cde2ce1a217b988382167aa94fcf03 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Fri, 13 Jan 2012 12:59:29 +0100 Subject: [PATCH 16/95] [ticket/10477] Correctly document module (base)name parameter PHPBB3-10477 --- phpBB/includes/functions_module.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index 653623a336..b7bb770031 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -805,7 +805,8 @@ class p_master * Load module as the current active one without the need for registering it * * @param string $class module class (acp/mcp/ucp) - * @param string $name module name (e.g. zebra for the ucp_zebra module) + * @param string $name module name (class name of the module, or its basename + * phpbb_ext_foo_acp_bar_module, ucp_zebra or zebra) * @param string $mode mode, as passed through to the module * */ From c9733ad7195995a9f28ecbbc8aa3e94a05527114 Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 18 Dec 2011 16:28:35 +0800 Subject: [PATCH 17/95] [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 18/95] [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 aa21bc2a733c1690ad7a371f962c244542135a43 Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 15 Jan 2012 18:18:04 +0800 Subject: [PATCH 19/95] [ticket/10589] Add alias to 'user_birthday' in $leap_year_birthdays definition PHPBB3-10589 --- phpBB/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/index.php b/phpBB/index.php index 0105a0a1bd..46694a6ec2 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -89,7 +89,7 @@ if ($config['load_birthdays'] && $config['allow_birthdays'] && $auth->acl_gets(' $leap_year_birthdays = ''; if ($now['mday'] == 28 && $now['mon'] == 2 && !$user->format_date(time(), 'L')) { - $leap_year_birthdays = " OR user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', 29, 2)) . "%'"; + $leap_year_birthdays = " OR u.user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', 29, 2)) . "%'"; } $sql = 'SELECT u.user_id, u.username, u.user_colour, u.user_birthday From 7295e5824aed6f5ec32cfab0ad17cfa2c24855ac Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Mon, 16 Jan 2012 14:35:29 +0200 Subject: [PATCH 20/95] [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 21/95] [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 22/95] [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 23/95] [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 2cf586a37206df3528237a2c91e255539c95a513 Mon Sep 17 00:00:00 2001 From: Richard Foote Date: Tue, 17 Jan 2012 12:31:27 -0500 Subject: [PATCH 24/95] [ticket/10580] Remove checking of server timezone and DST when registering Remove checking of server timezone and DST. It causes a problem by selecting the wrong timezone when registering when the board_timezone is 1 hour less than the server timezone. PHPBB3-10580 --- phpBB/includes/ucp/ucp_register.php | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 4e8729db56..6ad3a55589 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -165,24 +165,8 @@ class ucp_register $captcha->init(CONFIRM_REG); } - // Try to manually determine the timezone and adjust the dst if the server date/time complies with the default setting +/- 1 - $timezone = date('Z') / 3600; - $is_dst = date('I'); - - if ($config['board_timezone'] == $timezone || $config['board_timezone'] == ($timezone - 1)) - { - $timezone = ($is_dst) ? $timezone - 1 : $timezone; - - if (!isset($user->lang['tz_zones'][(string) $timezone])) - { - $timezone = $config['board_timezone']; - } - } - else - { - $is_dst = $config['board_dst']; - $timezone = $config['board_timezone']; - } + $is_dst = $config['board_dst']; + $timezone = $config['board_timezone']; $data = array( 'username' => utf8_normalize_nfc(request_var('username', '', true)), From ac492d8f1e7ef3420ebaee35131e342a39dfda10 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 22 Aug 2011 23:33:34 +0200 Subject: [PATCH 25/95] [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 26/95] [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 27/95] [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 28/95] [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 29/95] [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 30/95] [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 31/95] [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 32/95] [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 33/95] [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 34/95] [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 35/95] [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 36/95] [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 37/95] [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 38/95] [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 39/95] [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 40/95] [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 41/95] [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 42/95] [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 43/95] [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 44/95] [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 45/95] [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 46/95] [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 47/95] [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 48/95] [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 49/95] [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 50/95] [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 51/95] [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 52/95] [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 53/95] [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 54/95] [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 55/95] [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 56/95] [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 57/95] [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 58/95] [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 59/95] [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 60/95] [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 61/95] [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 62/95] [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 63/95] [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 64/95] [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 65/95] [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 66/95] [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 67/95] [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 68/95] [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 69/95] [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 70/95] [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 30c08bfe5bcfa9e9a62cf8a018dd32d2a7e11b81 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 23 Feb 2012 16:25:47 +0100 Subject: [PATCH 71/95] [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 77/95] [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 78/95] [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 79/95] [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 80/95] [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 81/95] [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 82/95] [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 83/95] [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 84/95] [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 85/95] [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 86/95] [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 87/95] [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 88/95] [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 89/95] [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 90/95] [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 91/95] [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 92/95] [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 93/95] [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 94/95] [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 cd61de4bfdd1818d173e7413e53d8fd3d7ce1913 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Fri, 9 Mar 2012 04:31:03 -0500 Subject: [PATCH 95/95] [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;