From ac8ebfabc7a4fae591ac780f621e4e21d09d070c Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 23 Jun 2012 10:26:48 +0200 Subject: [PATCH 01/39] [ticket/10950] Use proper ' in order to fix comment. PHPBB3-10950 --- phpBB/includes/functions_privmsgs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 261ed45727..e6e8e0ab6c 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1173,7 +1173,7 @@ function phpbb_delete_user_pms($user_id) $db->sql_query($sql); } - // Reset the user´s pm count to 0 + // Reset the user's pm count to 0 if (isset($undelivered_user[$user_id])) { $sql = 'UPDATE ' . USERS_TABLE . ' From 35b18676cda35b81277a9532ac9a579abbfda09d Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 23 Jun 2012 10:28:13 +0200 Subject: [PATCH 02/39] [ticket/10950] Fix SQL coding style (indentation) in second SQL query. PHPBB3-10950 --- phpBB/includes/functions_privmsgs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index e6e8e0ab6c..d76efd2ff6 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1135,7 +1135,7 @@ function phpbb_delete_user_pms($user_id) $sql = 'SELECT msg_id, author_id, folder_id, pm_unread, pm_new FROM ' . PRIVMSGS_TO_TABLE . ' WHERE author_id = ' . $user_id . ' - AND folder_id = ' . PRIVMSGS_NO_BOX; + AND folder_id = ' . PRIVMSGS_NO_BOX; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) From 2a76b7e8690eaf19c25ed4c13540c1e1aab31cdd Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 23 Jun 2012 10:30:09 +0200 Subject: [PATCH 03/39] [ticket/10950] Remove redundant if statement. We already know author_id and folder_id. PHPBB3-10950 --- phpBB/includes/functions_privmsgs.php | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index d76efd2ff6..d75b4d92a8 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1140,19 +1140,16 @@ function phpbb_delete_user_pms($user_id) while ($row = $db->sql_fetchrow($result)) { - if ($row['author_id'] == $user_id && $row['folder_id'] == PRIVMSGS_NO_BOX) - { - // Undelivered messages - $undelivered_msg[] = $row['msg_id']; + // Undelivered messages + $undelivered_msg[] = $row['msg_id']; - if (isset($undelivered_user[$row['user_id']])) - { - ++$undelivered_user[$row['user_id']]; - } - else - { - $undelivered_user[$row['user_id']] = 1; - } + if (isset($undelivered_user[$row['user_id']])) + { + ++$undelivered_user[$row['user_id']]; + } + else + { + $undelivered_user[$row['user_id']] = 1; } $delete_ids[(int) $row['msg_id']] = (int) $row['msg_id']; From a50d1a3576b9e92dfbcfc5bb951e2985ae1872a1 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 23 Jun 2012 10:32:16 +0200 Subject: [PATCH 04/39] [ticket/10950] Move array initialisation to the front. PHPBB3-10950 --- phpBB/includes/functions_privmsgs.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index d75b4d92a8..cdfde4c7ea 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1103,13 +1103,14 @@ function phpbb_delete_user_pms($user_id) // Get PM Information for later deleting // The two queries where split, so we can use our indexes + $undelivered_msg = $undelivered_user = $delete_ids = array(); + // Part 1: get PMs the user received $sql = 'SELECT msg_id, author_id, folder_id, pm_unread, pm_new FROM ' . PRIVMSGS_TO_TABLE . ' WHERE user_id = ' . $user_id; $result = $db->sql_query($sql); - $undelivered_msg = $undelivered_user = $delete_ids = array(); while ($row = $db->sql_fetchrow($result)) { if ($row['author_id'] == $user_id && $row['folder_id'] == PRIVMSGS_NO_BOX) From 9c2930178f37ed881055da3e65286704a3a8220e Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 23 Jun 2012 10:43:43 +0200 Subject: [PATCH 05/39] [ticket/10950] Use a variable for the private message id. PHPBB3-10950 --- phpBB/includes/functions_privmsgs.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index cdfde4c7ea..d77d46d46d 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1113,10 +1113,13 @@ function phpbb_delete_user_pms($user_id) while ($row = $db->sql_fetchrow($result)) { + $msg_id = (int) $row['msg_id']; + $delete_ids[$msg_id] = $msg_id; + if ($row['author_id'] == $user_id && $row['folder_id'] == PRIVMSGS_NO_BOX) { // Undelivered messages - $undelivered_msg[] = $row['msg_id']; + $undelivered_msg[] = $msg_id; if (isset($undelivered_user[$row['user_id']])) { @@ -1127,8 +1130,6 @@ function phpbb_delete_user_pms($user_id) $undelivered_user[$row['user_id']] = 1; } } - - $delete_ids[(int) $row['msg_id']] = (int) $row['msg_id']; } $db->sql_freeresult($result); @@ -1141,8 +1142,11 @@ function phpbb_delete_user_pms($user_id) while ($row = $db->sql_fetchrow($result)) { + $msg_id = (int) $row['msg_id']; + $delete_ids[$msg_id] = $msg_id; + // Undelivered messages - $undelivered_msg[] = $row['msg_id']; + $undelivered_msg[] = $msg_id; if (isset($undelivered_user[$row['user_id']])) { @@ -1152,8 +1156,6 @@ function phpbb_delete_user_pms($user_id) { $undelivered_user[$row['user_id']] = 1; } - - $delete_ids[(int) $row['msg_id']] = (int) $row['msg_id']; } $db->sql_freeresult($result); From fce385e5bc1212d9c3233b7a1ae2212eb1626e9b Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 23 Jun 2012 10:45:36 +0200 Subject: [PATCH 06/39] [ticket/10950] Select the correct columns in SQL queries. PHPBB3-10950 --- phpBB/includes/functions_privmsgs.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index d77d46d46d..1800242b71 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1106,7 +1106,7 @@ function phpbb_delete_user_pms($user_id) $undelivered_msg = $undelivered_user = $delete_ids = array(); // Part 1: get PMs the user received - $sql = 'SELECT msg_id, author_id, folder_id, pm_unread, pm_new + $sql = 'SELECT msg_id, user_id, author_id, folder_id FROM ' . PRIVMSGS_TO_TABLE . ' WHERE user_id = ' . $user_id; $result = $db->sql_query($sql); @@ -1134,7 +1134,7 @@ function phpbb_delete_user_pms($user_id) $db->sql_freeresult($result); // Part 2: get PMs the user sent - $sql = 'SELECT msg_id, author_id, folder_id, pm_unread, pm_new + $sql = 'SELECT msg_id, user_id FROM ' . PRIVMSGS_TO_TABLE . ' WHERE author_id = ' . $user_id . ' AND folder_id = ' . PRIVMSGS_NO_BOX; From 30475856c46b3604693b6d5df22be3360ae16822 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 23 Jun 2012 10:47:26 +0200 Subject: [PATCH 07/39] [ticket/10950] Add empty line to make unset() call more visible. PHPBB3-10950 --- phpBB/includes/functions_privmsgs.php | 1 + 1 file changed, 1 insertion(+) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 1800242b71..72dd3c7d20 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1181,6 +1181,7 @@ function phpbb_delete_user_pms($user_id) user_unread_privmsg = 0 WHERE user_id = ' . $user_id; $db->sql_query($sql); + unset($undelivered_user[$user_id]); } From 49afc1f2dc3a3ee17c6abff1e94c25a8ba8b3604 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 23 Jun 2012 11:16:38 +0200 Subject: [PATCH 08/39] [ticket/10950] Correct comment for the second query. Only undelivered messages are handled. PHPBB3-10950 --- phpBB/includes/functions_privmsgs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 72dd3c7d20..afd254d6ea 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1133,7 +1133,7 @@ function phpbb_delete_user_pms($user_id) } $db->sql_freeresult($result); - // Part 2: get PMs the user sent + // Part 2: get PMs the user sent, but has yet to be received $sql = 'SELECT msg_id, user_id FROM ' . PRIVMSGS_TO_TABLE . ' WHERE author_id = ' . $user_id . ' From d30dc11f3e1ade19fd8643bdded6f11625da1bb3 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 23 Jun 2012 16:02:16 +0200 Subject: [PATCH 09/39] [ticket/10950] Add some first and simple unit tests for phpbb_delete_user_pms() Todo: Add cases to in which the msg is also deleted. PHPBB3-10950 --- tests/privmsgs/delete_user_pms_test.php | 95 +++++++++++++++ tests/privmsgs/fixtures/delete_user_pms.xml | 127 ++++++++++++++++++++ 2 files changed, 222 insertions(+) create mode 100644 tests/privmsgs/delete_user_pms_test.php create mode 100644 tests/privmsgs/fixtures/delete_user_pms.xml diff --git a/tests/privmsgs/delete_user_pms_test.php b/tests/privmsgs/delete_user_pms_test.php new file mode 100644 index 0000000000..b399d94c6d --- /dev/null +++ b/tests/privmsgs/delete_user_pms_test.php @@ -0,0 +1,95 @@ +createXMLDataSet(dirname(__FILE__).'/fixtures/delete_user_pms.xml'); + } + + public static function delete_user_pms_data() + { + return array( + // array( + // (user we delete), + // array(remaining privmsgs ids), + // array(remaining privmsgs_to), + // ), + array( + 2, + array( + array('msg_id' => 1), + array('msg_id' => 2), + ), + array( + //array('msg_id' => 1, 'user_id' => 2), + array('msg_id' => 1, 'user_id' => 3), + array('msg_id' => 1, 'user_id' => 4), + //array('msg_id' => 2, 'user_id' => 2), + array('msg_id' => 2, 'user_id' => 4), + ), + ), + array( + 3, + array( + array('msg_id' => 1), + array('msg_id' => 2), + ), + array( + array('msg_id' => 1, 'user_id' => 2), + //array('msg_id' => 1, 'user_id' => 3), + array('msg_id' => 1, 'user_id' => 4), + array('msg_id' => 2, 'user_id' => 2), + array('msg_id' => 2, 'user_id' => 4), + ), + ), + array( + 5, + array( + array('msg_id' => 1), + array('msg_id' => 2), + ), + array( + array('msg_id' => 1, 'user_id' => 2), + array('msg_id' => 1, 'user_id' => 3), + array('msg_id' => 1, 'user_id' => 4), + array('msg_id' => 2, 'user_id' => 2), + array('msg_id' => 2, 'user_id' => 4), + ), + ), + ); + } + + /** + * @dataProvider delete_user_pms_data + */ + public function test_delete_user_pms($delete_user, $remaining_privmsgs, $remaining_privmsgs_to) + { + global $db; + + $db = $this->new_dbal(); + + phpbb_delete_user_pms($delete_user); + + $sql = 'SELECT msg_id + FROM ' . PRIVMSGS_TABLE; + $result = $db->sql_query($sql); + + $this->assertEquals($remaining_privmsgs, $db->sql_fetchrowset($result)); + + $sql = 'SELECT msg_id, user_id + FROM ' . PRIVMSGS_TO_TABLE; + $result = $db->sql_query($sql); + + $this->assertEquals($remaining_privmsgs_to, $db->sql_fetchrowset($result)); + } +} diff --git a/tests/privmsgs/fixtures/delete_user_pms.xml b/tests/privmsgs/fixtures/delete_user_pms.xml new file mode 100644 index 0000000000..848164080c --- /dev/null +++ b/tests/privmsgs/fixtures/delete_user_pms.xml @@ -0,0 +1,127 @@ + + + + user_id + username + username_clean + user_new_privmsg + user_unread_privmsg + user_permissions + user_sig + user_occ + user_interests + + 2 + sender + sender + 0 + 0 + + + + + + + 3 + pm in inbox + pm in inbox + 0 + 0 + + + + + + + 4 + pm in no box + pm in no box + 2 + 2 + + + + + + + 5 + no pms + no pms + 0 + 0 + + + + + +
+ + msg_id + root_level + author_id + message_subject + message_text + + 1 + 0 + 2 + #1 + #1 + + + 2 + 0 + 2 + #2 + #2 + +
+ + msg_id + user_id + author_id + pm_new + pm_unread + folder_id + + 1 + 2 + 2 + 0 + 0 + -2 + + + 1 + 3 + 2 + 0 + 0 + 0 + + + 1 + 4 + 2 + 0 + 0 + -3 + + + 2 + 2 + 2 + 0 + 0 + -2 + + + 2 + 4 + 2 + 0 + 0 + -3 + +
+
From 7988045bda2b9fbf0dc9482ed985b5b680ce4e95 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 4 Jul 2012 13:00:04 +0200 Subject: [PATCH 10/39] [ticket/10950] Fix unit tests to reflect desired behaviour See http://wiki.phpbb.com/Deleting_Private_Messages for further explanation. PHPBB3-10950 --- tests/privmsgs/delete_user_pms_test.php | 29 +++++++- tests/privmsgs/fixtures/delete_user_pms.xml | 80 ++++++++++++++++++++- 2 files changed, 105 insertions(+), 4 deletions(-) diff --git a/tests/privmsgs/delete_user_pms_test.php b/tests/privmsgs/delete_user_pms_test.php index b399d94c6d..e5c0e82712 100644 --- a/tests/privmsgs/delete_user_pms_test.php +++ b/tests/privmsgs/delete_user_pms_test.php @@ -28,14 +28,23 @@ class phpbb_privmsgs_delete_user_pms_test extends phpbb_database_test_case 2, array( array('msg_id' => 1), - array('msg_id' => 2), + //array('msg_id' => 2), + //array('msg_id' => 3), + //array('msg_id' => 4), + //array('msg_id' => 5), ), array( //array('msg_id' => 1, 'user_id' => 2), array('msg_id' => 1, 'user_id' => 3), array('msg_id' => 1, 'user_id' => 4), //array('msg_id' => 2, 'user_id' => 2), - array('msg_id' => 2, 'user_id' => 4), + //array('msg_id' => 2, 'user_id' => 4), + //array('msg_id' => 4, 'user_id' => 3), + //array('msg_id' => 3, 'user_id' => 2), + //array('msg_id' => 4, 'user_id' => 3), + //array('msg_id' => 5, 'user_id' => 2), + //array('msg_id' => 5, 'user_id' => 3), + //array('msg_id' => 5, 'user_id' => 4), ), ), array( @@ -43,6 +52,9 @@ class phpbb_privmsgs_delete_user_pms_test extends phpbb_database_test_case array( array('msg_id' => 1), array('msg_id' => 2), + array('msg_id' => 3), + //array('msg_id' => 4), + array('msg_id' => 5), ), array( array('msg_id' => 1, 'user_id' => 2), @@ -50,6 +62,11 @@ class phpbb_privmsgs_delete_user_pms_test extends phpbb_database_test_case array('msg_id' => 1, 'user_id' => 4), array('msg_id' => 2, 'user_id' => 2), array('msg_id' => 2, 'user_id' => 4), + array('msg_id' => 3, 'user_id' => 2), + //array('msg_id' => 4, 'user_id' => 3), + array('msg_id' => 5, 'user_id' => 2), + //array('msg_id' => 5, 'user_id' => 3), + array('msg_id' => 5, 'user_id' => 4), ), ), array( @@ -57,6 +74,9 @@ class phpbb_privmsgs_delete_user_pms_test extends phpbb_database_test_case array( array('msg_id' => 1), array('msg_id' => 2), + array('msg_id' => 3), + array('msg_id' => 4), + array('msg_id' => 5), ), array( array('msg_id' => 1, 'user_id' => 2), @@ -64,6 +84,11 @@ class phpbb_privmsgs_delete_user_pms_test extends phpbb_database_test_case array('msg_id' => 1, 'user_id' => 4), array('msg_id' => 2, 'user_id' => 2), array('msg_id' => 2, 'user_id' => 4), + array('msg_id' => 3, 'user_id' => 2), + array('msg_id' => 4, 'user_id' => 3), + array('msg_id' => 5, 'user_id' => 2), + array('msg_id' => 5, 'user_id' => 3), + array('msg_id' => 5, 'user_id' => 4), ), ), ); diff --git a/tests/privmsgs/fixtures/delete_user_pms.xml b/tests/privmsgs/fixtures/delete_user_pms.xml index 848164080c..56970689a3 100644 --- a/tests/privmsgs/fixtures/delete_user_pms.xml +++ b/tests/privmsgs/fixtures/delete_user_pms.xml @@ -66,14 +66,50 @@ 0 2 #1 - #1 + + 2 - outbox + 3 - inbox + 4 - nobox + 2 0 2 #2 - #2 + + 2 - outbox + 4 - nobox + + + + 3 + 0 + 2 + #3 + + 2 - outbox + + + + 4 + 0 + 2 + #4 + + 3 - nobox + + + + 5 + 0 + 2 + #5 + + 2 - outbox + 3 - nobox + 4 - nobox + @@ -123,5 +159,45 @@ 0-3 + + 3 + 2 + 2 + 0 + 0 + -2 + + + 4 + 3 + 2 + 0 + 0 + -3 + + + 5 + 2 + 2 + 0 + 0 + -2 + + + 5 + 3 + 2 + 0 + 0 + -3 + + + 5 + 4 + 2 + 0 + 0 + -3 +
From 5c8c7b1352454fc8d1bb6e689d52d31b346d5fdb Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 4 Jul 2012 13:10:15 +0200 Subject: [PATCH 11/39] [ticket/10950] Recreated the behaviour of phpbb_delete_user_pms() - Get delete_ids, pms of the user as receipt - Get undelivered_msg, pms of the user as sender - Delete undelivered_msg, if there are only NO_BOX, OUTBOX and SENTBOX links - Correct the _new and _unread user values for the receipts - Delete delete_ids, if there are no links to them anymore - Reset _new and _unread values for the user we delete PHPBB3-10950 --- phpBB/includes/functions_privmsgs.php | 134 ++++++++++++++------------ 1 file changed, 75 insertions(+), 59 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index afd254d6ea..88388841ed 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1103,10 +1103,10 @@ function phpbb_delete_user_pms($user_id) // Get PM Information for later deleting // The two queries where split, so we can use our indexes - $undelivered_msg = $undelivered_user = $delete_ids = array(); + $undelivered_msg = $delete_ids = array(); // Part 1: get PMs the user received - $sql = 'SELECT msg_id, user_id, author_id, folder_id + $sql = 'SELECT msg_id FROM ' . PRIVMSGS_TO_TABLE . ' WHERE user_id = ' . $user_id; $result = $db->sql_query($sql); @@ -1115,26 +1115,13 @@ function phpbb_delete_user_pms($user_id) { $msg_id = (int) $row['msg_id']; $delete_ids[$msg_id] = $msg_id; - - if ($row['author_id'] == $user_id && $row['folder_id'] == PRIVMSGS_NO_BOX) - { - // Undelivered messages - $undelivered_msg[] = $msg_id; - - if (isset($undelivered_user[$row['user_id']])) - { - ++$undelivered_user[$row['user_id']]; - } - else - { - $undelivered_user[$row['user_id']] = 1; - } - } } $db->sql_freeresult($result); // Part 2: get PMs the user sent, but has yet to be received - $sql = 'SELECT msg_id, user_id + // We can not simply delete them. First we have to check, + // whether another user already received and read the message. + $sql = 'SELECT msg_id FROM ' . PRIVMSGS_TO_TABLE . ' WHERE author_id = ' . $user_id . ' AND folder_id = ' . PRIVMSGS_NO_BOX; @@ -1143,61 +1130,90 @@ function phpbb_delete_user_pms($user_id) while ($row = $db->sql_fetchrow($result)) { $msg_id = (int) $row['msg_id']; - $delete_ids[$msg_id] = $msg_id; - - // Undelivered messages - $undelivered_msg[] = $msg_id; - - if (isset($undelivered_user[$row['user_id']])) - { - ++$undelivered_user[$row['user_id']]; - } - else - { - $undelivered_user[$row['user_id']] = 1; - } + $undelivered_msg[$msg_id] = $msg_id; } $db->sql_freeresult($result); - if (empty($delete_ids)) + if (empty($delete_ids) && empty($undelivered_msg)) { return false; } $db->sql_transaction('begin'); - if (sizeof($undelivered_msg)) + if (!empty($undelivered_msg)) { - $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . ' - WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg); - $db->sql_query($sql); + // A pm is not undelivered, if for any receipt the message was moved + // from their NO_BOX to another folder. + $sql = 'SELECT msg_id + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE author_id = ' . $user_id . ' + AND folder_id <> ' . PRIVMSGS_NO_BOX . ' + AND folder_id <> ' . PRIVMSGS_OUTBOX . ' + AND folder_id <> ' . PRIVMSGS_SENTBOX; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $msg_id = (int) $row['msg_id']; + unset($undelivered_msg[$msg_id]); + } + $db->sql_freeresult($result); + + if (!empty($undelivered_msg)) + { + $undelivered_user = array(); + + // Count the messages we delete, so we can correct the user pm data + $sql = 'SELECT user_id + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE author_id = ' . $user_id . ' + AND folder_id = ' . PRIVMSGS_NO_BOX . ' + AND ' . $db->sql_in_set('msg_id', $undelivered_msg); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + if (isset($undelivered_user[$row['user_id']])) + { + ++$undelivered_user[$row['user_id']]; + } + else + { + $undelivered_user[$row['user_id']] = 1; + } + } + $db->sql_freeresult($result); + + foreach ($undelivered_user as $undelivered_user_id => $count) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_new_privmsg = user_new_privmsg - ' . $count . ', + user_unread_privmsg = user_unread_privmsg - ' . $count . ' + WHERE user_id = ' . $undelivered_user_id; + $db->sql_query($sql); + } + + $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg); + $db->sql_query($sql); + + $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . ' + WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg); + $db->sql_query($sql); + } } // Reset the user's pm count to 0 - if (isset($undelivered_user[$user_id])) - { - $sql = 'UPDATE ' . USERS_TABLE . ' - SET user_new_privmsg = 0, - user_unread_privmsg = 0 - WHERE user_id = ' . $user_id; - $db->sql_query($sql); + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_new_privmsg = 0, + user_unread_privmsg = 0 + WHERE user_id = ' . $user_id; + $db->sql_query($sql); - unset($undelivered_user[$user_id]); - } - - foreach ($undelivered_user as $_user_id => $count) - { - $sql = 'UPDATE ' . USERS_TABLE . ' - SET user_new_privmsg = user_new_privmsg - ' . $count . ', - user_unread_privmsg = user_unread_privmsg - ' . $count . ' - WHERE user_id = ' . $_user_id; - $db->sql_query($sql); - } - - // Delete private message data - $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . " - WHERE user_id = $user_id - AND " . $db->sql_in_set('msg_id', $delete_ids); + // Delete private message data of the user + $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE user_id = ' . (int) $user_id; $db->sql_query($sql); // Now we have to check which messages we can delete completely From 338d29072fd5581968f404576c6faa2dffc4f883 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 4 Jul 2012 13:14:19 +0200 Subject: [PATCH 12/39] [ticket/10950] Check $delete_ids to be not empty PHPBB3-10950 --- phpBB/includes/functions_privmsgs.php | 47 ++++++++++++++------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 88388841ed..6c0adccbed 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1216,31 +1216,34 @@ function phpbb_delete_user_pms($user_id) WHERE user_id = ' . (int) $user_id; $db->sql_query($sql); - // Now we have to check which messages we can delete completely - $sql = 'SELECT msg_id - FROM ' . PRIVMSGS_TO_TABLE . ' - WHERE ' . $db->sql_in_set('msg_id', $delete_ids); - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - unset($delete_ids[$row['msg_id']]); - } - $db->sql_freeresult($result); - if (!empty($delete_ids)) { - // Check if there are any attachments we need to remove - if (!function_exists('delete_attachments')) - { - include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); - } - - delete_attachments('message', $delete_ids, false); - - $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . ' + // Now we have to check which messages we can delete completely + $sql = 'SELECT msg_id + FROM ' . PRIVMSGS_TO_TABLE . ' WHERE ' . $db->sql_in_set('msg_id', $delete_ids); - $db->sql_query($sql); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + unset($delete_ids[$row['msg_id']]); + } + $db->sql_freeresult($result); + + if (!empty($delete_ids)) + { + // Check if there are any attachments we need to remove + if (!function_exists('delete_attachments')) + { + include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); + } + + delete_attachments('message', $delete_ids, false); + + $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . ' + WHERE ' . $db->sql_in_set('msg_id', $delete_ids); + $db->sql_query($sql); + } } // Set the remaining author id to anonymous From e68c1fb9e4d5de214c1e483531706ec300ffdb0d Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 11 Jul 2012 12:58:57 +0200 Subject: [PATCH 13/39] [ticket/10950] Use database count() and group by instead of doing that in php PHPBB3-10950 --- phpBB/includes/functions_privmsgs.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 6c0adccbed..1d45961ac4 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1143,7 +1143,7 @@ function phpbb_delete_user_pms($user_id) if (!empty($undelivered_msg)) { - // A pm is not undelivered, if for any receipt the message was moved + // A pm is delivered, if for any receipt the message was moved // from their NO_BOX to another folder. $sql = 'SELECT msg_id FROM ' . PRIVMSGS_TO_TABLE . ' @@ -1165,23 +1165,17 @@ function phpbb_delete_user_pms($user_id) $undelivered_user = array(); // Count the messages we delete, so we can correct the user pm data - $sql = 'SELECT user_id + $sql = 'SELECT user_id, COUNT(msg_id) as num_undelivered_privmsgs FROM ' . PRIVMSGS_TO_TABLE . ' WHERE author_id = ' . $user_id . ' AND folder_id = ' . PRIVMSGS_NO_BOX . ' - AND ' . $db->sql_in_set('msg_id', $undelivered_msg); + AND ' . $db->sql_in_set('msg_id', $undelivered_msg) . ' + GROUP BY user_id'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { - if (isset($undelivered_user[$row['user_id']])) - { - ++$undelivered_user[$row['user_id']]; - } - else - { - $undelivered_user[$row['user_id']] = 1; - } + $undelivered_user[$row['user_id']] = (int) $row['num_undelivered_privmsgs']; } $db->sql_freeresult($result); From d883535b102ffba8781f485ba94fae237d8376b0 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 11 Jul 2012 13:05:36 +0200 Subject: [PATCH 14/39] [ticket/10950] Remove deleted entries in tests instead of commenting them out PHPBB3-10950 --- tests/privmsgs/delete_user_pms_test.php | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/tests/privmsgs/delete_user_pms_test.php b/tests/privmsgs/delete_user_pms_test.php index e5c0e82712..a586d691e9 100644 --- a/tests/privmsgs/delete_user_pms_test.php +++ b/tests/privmsgs/delete_user_pms_test.php @@ -28,23 +28,10 @@ class phpbb_privmsgs_delete_user_pms_test extends phpbb_database_test_case 2, array( array('msg_id' => 1), - //array('msg_id' => 2), - //array('msg_id' => 3), - //array('msg_id' => 4), - //array('msg_id' => 5), ), array( - //array('msg_id' => 1, 'user_id' => 2), array('msg_id' => 1, 'user_id' => 3), array('msg_id' => 1, 'user_id' => 4), - //array('msg_id' => 2, 'user_id' => 2), - //array('msg_id' => 2, 'user_id' => 4), - //array('msg_id' => 4, 'user_id' => 3), - //array('msg_id' => 3, 'user_id' => 2), - //array('msg_id' => 4, 'user_id' => 3), - //array('msg_id' => 5, 'user_id' => 2), - //array('msg_id' => 5, 'user_id' => 3), - //array('msg_id' => 5, 'user_id' => 4), ), ), array( @@ -53,19 +40,15 @@ class phpbb_privmsgs_delete_user_pms_test extends phpbb_database_test_case array('msg_id' => 1), array('msg_id' => 2), array('msg_id' => 3), - //array('msg_id' => 4), array('msg_id' => 5), ), array( array('msg_id' => 1, 'user_id' => 2), - //array('msg_id' => 1, 'user_id' => 3), array('msg_id' => 1, 'user_id' => 4), array('msg_id' => 2, 'user_id' => 2), array('msg_id' => 2, 'user_id' => 4), array('msg_id' => 3, 'user_id' => 2), - //array('msg_id' => 4, 'user_id' => 3), array('msg_id' => 5, 'user_id' => 2), - //array('msg_id' => 5, 'user_id' => 3), array('msg_id' => 5, 'user_id' => 4), ), ), From d9a32ce6143be27b8414072694c969fa16b5329a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 16 Jul 2012 17:22:10 +0200 Subject: [PATCH 15/39] [ticket/10950] Update undelivered pm counts in batches not 1 by 1 for each user PHPBB3-10950 --- phpBB/includes/functions_privmsgs.php | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 1d45961ac4..82344d1787 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1175,16 +1175,29 @@ function phpbb_delete_user_pms($user_id) while ($row = $db->sql_fetchrow($result)) { - $undelivered_user[$row['user_id']] = (int) $row['num_undelivered_privmsgs']; + $num_pms = (int) $row['num_undelivered_privmsgs']; + $undelivered_user[$num_pms][] = (int) $row['user_id']; + + if (sizeof($undelivered_user[$num_pms]) > 50) + { + // If there are too many users affected the query might get + // too long, so we update the value for the first bunch here. + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_new_privmsg = user_new_privmsg - ' . $num_pms . ', + user_unread_privmsg = user_unread_privmsg - ' . $num_pms . ' + WHERE ' . $db->sql_in_set('user_id', $undelivered_user[$num_pms]); + $db->sql_query($sql); + unset($undelivered_user[$num_pms]); + } } $db->sql_freeresult($result); - foreach ($undelivered_user as $undelivered_user_id => $count) + foreach ($undelivered_user as $num_pms => $undelivered_user_set) { $sql = 'UPDATE ' . USERS_TABLE . ' - SET user_new_privmsg = user_new_privmsg - ' . $count . ', - user_unread_privmsg = user_unread_privmsg - ' . $count . ' - WHERE user_id = ' . $undelivered_user_id; + SET user_new_privmsg = user_new_privmsg - ' . $num_pms . ', + user_unread_privmsg = user_unread_privmsg - ' . $num_pms . ' + WHERE ' . $db->sql_in_set('user_id', $undelivered_user_set); $db->sql_query($sql); } From a9c091fad47a3b6936bc7a08617e27163189a20f Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 20 Jul 2012 16:10:40 +0200 Subject: [PATCH 16/39] [ticket/10950] Fix unit tests to fit the new pm deleting behaviour Undelivered PMs should not be delivered to recipients that have not yet received them. PHPBB3-10950 --- tests/privmsgs/delete_user_pms_test.php | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/privmsgs/delete_user_pms_test.php b/tests/privmsgs/delete_user_pms_test.php index a586d691e9..265df1596a 100644 --- a/tests/privmsgs/delete_user_pms_test.php +++ b/tests/privmsgs/delete_user_pms_test.php @@ -31,7 +31,6 @@ class phpbb_privmsgs_delete_user_pms_test extends phpbb_database_test_case ), array( array('msg_id' => 1, 'user_id' => 3), - array('msg_id' => 1, 'user_id' => 4), ), ), array( From a3517232f943fd8070c98a78f2cf731339b76a74 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 20 Jul 2012 16:13:08 +0200 Subject: [PATCH 17/39] [ticket/10950] Delete PMs for users that have not yet read the pm PHPBB3-10950 --- phpBB/includes/functions_privmsgs.php | 78 +++++++++++++++------------ phpBB/language/en/acp/users.php | 2 +- 2 files changed, 46 insertions(+), 34 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 82344d1787..0890f057d2 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1144,7 +1144,9 @@ function phpbb_delete_user_pms($user_id) if (!empty($undelivered_msg)) { // A pm is delivered, if for any receipt the message was moved - // from their NO_BOX to another folder. + // from their NO_BOX to another folder. We do not delete such + // messages, but only delete them for users, who have not yet + // received them. $sql = 'SELECT msg_id FROM ' . PRIVMSGS_TO_TABLE . ' WHERE author_id = ' . $user_id . ' @@ -1153,54 +1155,64 @@ function phpbb_delete_user_pms($user_id) AND folder_id <> ' . PRIVMSGS_SENTBOX; $result = $db->sql_query($sql); + $delivered_msg = array(); while ($row = $db->sql_fetchrow($result)) { $msg_id = (int) $row['msg_id']; + $delivered_msg[$msg_id] = $msg_id; unset($undelivered_msg[$msg_id]); } $db->sql_freeresult($result); - if (!empty($undelivered_msg)) + $undelivered_user = array(); + + // Count the messages we delete, so we can correct the user pm data + $sql = 'SELECT user_id, COUNT(msg_id) as num_undelivered_privmsgs + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE author_id = ' . $user_id . ' + AND folder_id = ' . PRIVMSGS_NO_BOX . ' + AND ' . $db->sql_in_set('msg_id', array_merge($undelivered_msg, $delivered_msg)) . ' + GROUP BY user_id'; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) { - $undelivered_user = array(); + $num_pms = (int) $row['num_undelivered_privmsgs']; + $undelivered_user[$num_pms][] = (int) $row['user_id']; - // Count the messages we delete, so we can correct the user pm data - $sql = 'SELECT user_id, COUNT(msg_id) as num_undelivered_privmsgs - FROM ' . PRIVMSGS_TO_TABLE . ' - WHERE author_id = ' . $user_id . ' - AND folder_id = ' . PRIVMSGS_NO_BOX . ' - AND ' . $db->sql_in_set('msg_id', $undelivered_msg) . ' - GROUP BY user_id'; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) - { - $num_pms = (int) $row['num_undelivered_privmsgs']; - $undelivered_user[$num_pms][] = (int) $row['user_id']; - - if (sizeof($undelivered_user[$num_pms]) > 50) - { - // If there are too many users affected the query might get - // too long, so we update the value for the first bunch here. - $sql = 'UPDATE ' . USERS_TABLE . ' - SET user_new_privmsg = user_new_privmsg - ' . $num_pms . ', - user_unread_privmsg = user_unread_privmsg - ' . $num_pms . ' - WHERE ' . $db->sql_in_set('user_id', $undelivered_user[$num_pms]); - $db->sql_query($sql); - unset($undelivered_user[$num_pms]); - } - } - $db->sql_freeresult($result); - - foreach ($undelivered_user as $num_pms => $undelivered_user_set) + if (sizeof($undelivered_user[$num_pms]) > 50) { + // If there are too many users affected the query might get + // too long, so we update the value for the first bunch here. $sql = 'UPDATE ' . USERS_TABLE . ' SET user_new_privmsg = user_new_privmsg - ' . $num_pms . ', user_unread_privmsg = user_unread_privmsg - ' . $num_pms . ' - WHERE ' . $db->sql_in_set('user_id', $undelivered_user_set); + WHERE ' . $db->sql_in_set('user_id', $undelivered_user[$num_pms]); $db->sql_query($sql); + unset($undelivered_user[$num_pms]); } + } + $db->sql_freeresult($result); + foreach ($undelivered_user as $num_pms => $undelivered_user_set) + { + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_new_privmsg = user_new_privmsg - ' . $num_pms . ', + user_unread_privmsg = user_unread_privmsg - ' . $num_pms . ' + WHERE ' . $db->sql_in_set('user_id', $undelivered_user_set); + $db->sql_query($sql); + } + + if (!empty($delivered_msg)) + { + $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE folder_id = ' . PRIVMSGS_NO_BOX . ' + AND ' . $db->sql_in_set('msg_id', $delivered_msg); + $db->sql_query($sql); + } + + if (!empty($undelivered_msg)) + { $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . ' WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg); $db->sql_query($sql); diff --git a/phpBB/language/en/acp/users.php b/phpBB/language/en/acp/users.php index 785283faea..3b82a7022d 100644 --- a/phpBB/language/en/acp/users.php +++ b/phpBB/language/en/acp/users.php @@ -59,7 +59,7 @@ $lang = array_merge($lang, array( 'DELETE_POSTS' => 'Delete posts', 'DELETE_USER' => 'Delete user', - 'DELETE_USER_EXPLAIN' => 'Please note that deleting a user is final, they cannot be recovered.', + 'DELETE_USER_EXPLAIN' => 'Please note that deleting a user is final, they cannot be recovered. Unread private messages sent by this user will be deleted and will not be available to their recipients.', 'FORCE_REACTIVATION_SUCCESS' => 'Successfully forced reactivation.', 'FOUNDER' => 'Founder', From 3036db481a40a395f9021b991dd3d659649ec831 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 20 Jul 2012 18:01:06 +0200 Subject: [PATCH 18/39] [ticket/10950] Fix grammar in comments PHPBB3-10950 --- phpBB/includes/functions_privmsgs.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 0890f057d2..b08d6e7f5c 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1118,8 +1118,8 @@ function phpbb_delete_user_pms($user_id) } $db->sql_freeresult($result); - // Part 2: get PMs the user sent, but has yet to be received - // We can not simply delete them. First we have to check, + // Part 2: get PMs the user sent, but have yet to be received + // We cannot simply delete them. First we have to check, // whether another user already received and read the message. $sql = 'SELECT msg_id FROM ' . PRIVMSGS_TO_TABLE . ' @@ -1143,7 +1143,7 @@ function phpbb_delete_user_pms($user_id) if (!empty($undelivered_msg)) { - // A pm is delivered, if for any receipt the message was moved + // A pm is delivered, if for any recipient the message was moved // from their NO_BOX to another folder. We do not delete such // messages, but only delete them for users, who have not yet // received them. From ca43a8947a67642f6d1f211f1f5e030b2526ebe2 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Fri, 20 Jul 2012 23:53:11 +0200 Subject: [PATCH 19/39] [ticket/11008] Remove eval() calls to get document[id] PHPBB3-11008 --- phpBB/adm/style/overall_header.html | 6 +----- phpBB/styles/prosilver/template/forum_fn.js | 6 +----- phpBB/styles/subsilver2/template/memberlist_search.html | 6 +----- phpBB/styles/subsilver2/template/overall_header.html | 6 +----- 4 files changed, 4 insertions(+), 20 deletions(-) diff --git a/phpBB/adm/style/overall_header.html b/phpBB/adm/style/overall_header.html index f79c0318b5..f6d0e1025f 100644 --- a/phpBB/adm/style/overall_header.html +++ b/phpBB/adm/style/overall_header.html @@ -62,11 +62,7 @@ function dE(n, s, type) */ function marklist(id, name, state) { - var parent = document.getElementById(id); - if (!parent) - { - eval('parent = document.' + id); - } + var parent = document.getElementById(id) || document[id]; if (!parent) { diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index 240fe7e51d..995b4b0ab7 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -42,11 +42,7 @@ function jumpto() */ function marklist(id, name, state) { - var parent = document.getElementById(id); - if (!parent) - { - eval('parent = document.' + id); - } + var parent = document.getElementById(id) || document[id]; if (!parent) { diff --git a/phpBB/styles/subsilver2/template/memberlist_search.html b/phpBB/styles/subsilver2/template/memberlist_search.html index 96ffad00d6..ab1ecca2ee 100644 --- a/phpBB/styles/subsilver2/template/memberlist_search.html +++ b/phpBB/styles/subsilver2/template/memberlist_search.html @@ -43,11 +43,7 @@ */ function marklist(id, name, state) { - var parent = document.getElementById(id); - if (!parent) - { - eval('parent = document.' + id); - } + var parent = document.getElementById(id) || document[id]; if (!parent) { diff --git a/phpBB/styles/subsilver2/template/overall_header.html b/phpBB/styles/subsilver2/template/overall_header.html index 5d5489338a..f08531c47f 100644 --- a/phpBB/styles/subsilver2/template/overall_header.html +++ b/phpBB/styles/subsilver2/template/overall_header.html @@ -71,11 +71,7 @@ function find_username(url) */ function marklist(id, name, state) { - var parent = document.getElementById(id); - if (!parent) - { - eval('parent = document.' + id); - } + var parent = document.getElementById(id) || document[id]; if (!parent) { From 61f7f1b8edf5cf0efb1b33495e2069a151d6baa9 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Fri, 20 Jul 2012 23:59:04 +0200 Subject: [PATCH 20/39] [ticket/11008] Change onunload_functions to not use eval() PHPBB3-11008 --- phpBB/styles/prosilver/template/login_body.html | 4 +++- phpBB/styles/prosilver/template/overall_header.html | 4 ++-- phpBB/styles/prosilver/template/posting_editor.html | 2 +- phpBB/styles/prosilver/template/search_body.html | 4 +++- phpBB/styles/prosilver/template/simple_header.html | 4 ++-- phpBB/styles/prosilver/template/ucp_register.html | 2 +- 6 files changed, 12 insertions(+), 8 deletions(-) diff --git a/phpBB/styles/prosilver/template/login_body.html b/phpBB/styles/prosilver/template/login_body.html index d8b9b01779..90d8191676 100644 --- a/phpBB/styles/prosilver/template/login_body.html +++ b/phpBB/styles/prosilver/template/login_body.html @@ -2,7 +2,9 @@ diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html index 349309ab4e..43ae83767d 100644 --- a/phpBB/styles/prosilver/template/overall_header.html +++ b/phpBB/styles/prosilver/template/overall_header.html @@ -56,7 +56,7 @@ { for (var i = 0; i < onload_functions.length; i++) { - eval(onload_functions[i]); + onload_functions[i](); } }; @@ -64,7 +64,7 @@ { for (var i = 0; i < onunload_functions.length; i++) { - eval(onunload_functions[i]); + onunload_functions[i](); } }; diff --git a/phpBB/styles/prosilver/template/posting_editor.html b/phpBB/styles/prosilver/template/posting_editor.html index d1c86e7e13..99e518d486 100644 --- a/phpBB/styles/prosilver/template/posting_editor.html +++ b/phpBB/styles/prosilver/template/posting_editor.html @@ -1,6 +1,6 @@ diff --git a/phpBB/styles/prosilver/template/search_body.html b/phpBB/styles/prosilver/template/search_body.html index a8baafa5f1..0d8797b2ff 100644 --- a/phpBB/styles/prosilver/template/search_body.html +++ b/phpBB/styles/prosilver/template/search_body.html @@ -2,7 +2,9 @@ diff --git a/phpBB/styles/prosilver/template/simple_header.html b/phpBB/styles/prosilver/template/simple_header.html index 5440d66520..6026dfd329 100644 --- a/phpBB/styles/prosilver/template/simple_header.html +++ b/phpBB/styles/prosilver/template/simple_header.html @@ -26,7 +26,7 @@ { for (var i = 0; i < onload_functions.length; i++) { - eval(onload_functions[i]); + onload_functions[i](); } } @@ -34,7 +34,7 @@ { for (var i = 0; i < onunload_functions.length; i++) { - eval(onunload_functions[i]); + onunload_functions[i](); } } diff --git a/phpBB/styles/prosilver/template/ucp_register.html b/phpBB/styles/prosilver/template/ucp_register.html index 994356efe6..e14ca6493d 100644 --- a/phpBB/styles/prosilver/template/ucp_register.html +++ b/phpBB/styles/prosilver/template/ucp_register.html @@ -12,7 +12,7 @@ } - onload_functions.push('apply_onkeypress_event()'); + onload_functions.push(apply_onkeypress_event); // ]]> From be44f32008d17c64d88eae4a7c5cae8b2773f218 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 21 Jul 2012 00:24:09 +0200 Subject: [PATCH 21/39] [ticket/11009] Backport build.xml from develop to fix Bamboo Unit Testing. PHPBB3-11009 --- build/build.xml | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/build/build.xml b/build/build.xml index c1179015eb..1b8d42a660 100644 --- a/build/build.xml +++ b/build/build.xml @@ -11,9 +11,9 @@ - - - + + + @@ -43,7 +43,13 @@ - + + + + + - + + + + From 656d2c34e0ca1424f07bb0ec2ed7b8489becbd6c Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 21 Jul 2012 15:18:16 +0200 Subject: [PATCH 22/39] [ticket/11002] Use translating option to rename the Etc/GMT options They have the invers offset of their name. So GMT+2 has the offset -7200. To avoid additional confusion, we simply overwrite their name. PHPBB3-11002 --- phpBB/includes/update_helpers.php | 80 +++++++++++++++---------------- phpBB/language/en/common.php | 29 +++++++++++ 2 files changed, 69 insertions(+), 40 deletions(-) diff --git a/phpBB/includes/update_helpers.php b/phpBB/includes/update_helpers.php index 8e8e9670b0..69d678b2f8 100644 --- a/phpBB/includes/update_helpers.php +++ b/phpBB/includes/update_helpers.php @@ -26,85 +26,85 @@ class phpbb_update_helpers switch ($timezone) { case '-12': - return 'Etc/GMT' . $offset; //'[UTC - 12] Baker Island Time' + return 'Etc/GMT+' . abs($offset); //'[UTC - 12] Baker Island Time' case '-11': - return 'Etc/GMT' . $offset; //'[UTC - 11] Niue Time, Samoa Standard Time' + return 'Etc/GMT+' . abs($offset); //'[UTC - 11] Niue Time, Samoa Standard Time' case '-10': - return 'Etc/GMT' . $offset; //'[UTC - 10] Hawaii-Aleutian Standard Time, Cook Island Time' + return 'Etc/GMT+' . abs($offset); //'[UTC - 10] Hawaii-Aleutian Standard Time, Cook Island Time' case '-9.5': - return 'Pacific/Marquesas'; //'[UTC - 9:30] Marquesas Islands Time' + return 'Pacific/Marquesas'; //'[UTC - 9:30] Marquesas Islands Time' case '-9': - return 'Etc/GMT' . $offset; //'[UTC - 9] Alaska Standard Time, Gambier Island Time' + return 'Etc/GMT+' . abs($offset); //'[UTC - 9] Alaska Standard Time, Gambier Island Time' case '-8': - return 'Etc/GMT' . $offset; //'[UTC - 8] Pacific Standard Time' + return 'Etc/GMT+' . abs($offset); //'[UTC - 8] Pacific Standard Time' case '-7': - return 'Etc/GMT' . $offset; //'[UTC - 7] Mountain Standard Time' + return 'Etc/GMT+' . abs($offset); //'[UTC - 7] Mountain Standard Time' case '-6': - return 'Etc/GMT' . $offset; //'[UTC - 6] Central Standard Time' + return 'Etc/GMT+' . abs($offset); //'[UTC - 6] Central Standard Time' case '-5': - return 'Etc/GMT' . $offset; //'[UTC - 5] Eastern Standard Time' + return 'Etc/GMT+' . abs($offset); //'[UTC - 5] Eastern Standard Time' case '-4.5': - return 'America/Caracas'; //'[UTC - 4:30] Venezuelan Standard Time' + return 'America/Caracas'; //'[UTC - 4:30] Venezuelan Standard Time' case '-4': - return 'Etc/GMT' . $offset; //'[UTC - 4] Atlantic Standard Time' + return 'Etc/GMT+' . abs($offset); //'[UTC - 4] Atlantic Standard Time' case '-3.5': - return 'America/St_Johns'; //'[UTC - 3:30] Newfoundland Standard Time' + return 'America/St_Johns'; //'[UTC - 3:30] Newfoundland Standard Time' case '-3': - return 'Etc/GMT' . $offset; //'[UTC - 3] Amazon Standard Time, Central Greenland Time' + return 'Etc/GMT+' . abs($offset); //'[UTC - 3] Amazon Standard Time, Central Greenland Time' case '-2': - return 'Etc/GMT' . $offset; //'[UTC - 2] Fernando de Noronha Time, South Georgia & the South Sandwich Islands Time' + return 'Etc/GMT+' . abs($offset); //'[UTC - 2] Fernando de Noronha Time, South Georgia & the South Sandwich Islands Time' case '-1': - return 'Etc/GMT' . $offset; //'[UTC - 1] Azores Standard Time, Cape Verde Time, Eastern Greenland Time' + return 'Etc/GMT+' . abs($offset); //'[UTC - 1] Azores Standard Time, Cape Verde Time, Eastern Greenland Time' case '0': - return (!$dst) ? 'UTC' : 'Etc/GMT+1'; //'[UTC] Western European Time, Greenwich Mean Time' + return (!$dst) ? 'UTC' : 'Etc/GMT-1'; //'[UTC] Western European Time, Greenwich Mean Time' case '1': - return 'Etc/GMT+' . $offset; //'[UTC + 1] Central European Time, West African Time' + return 'Etc/GMT-' . $offset; //'[UTC + 1] Central European Time, West African Time' case '2': - return 'Etc/GMT+' . $offset; //'[UTC + 2] Eastern European Time, Central African Time' + return 'Etc/GMT-' . $offset; //'[UTC + 2] Eastern European Time, Central African Time' case '3': - return 'Etc/GMT+' . $offset; //'[UTC + 3] Moscow Standard Time, Eastern African Time' + return 'Etc/GMT-' . $offset; //'[UTC + 3] Moscow Standard Time, Eastern African Time' case '3.5': - return 'Asia/Tehran'; //'[UTC + 3:30] Iran Standard Time' + return 'Asia/Tehran'; //'[UTC + 3:30] Iran Standard Time' case '4': - return 'Etc/GMT+' . $offset; //'[UTC + 4] Gulf Standard Time, Samara Standard Time' + return 'Etc/GMT-' . $offset; //'[UTC + 4] Gulf Standard Time, Samara Standard Time' case '4.5': - return 'Asia/Kabul'; //'[UTC + 4:30] Afghanistan Time' + return 'Asia/Kabul'; //'[UTC + 4:30] Afghanistan Time' case '5': - return 'Etc/GMT+' . $offset; //'[UTC + 5] Pakistan Standard Time, Yekaterinburg Standard Time' + return 'Etc/GMT-' . $offset; //'[UTC + 5] Pakistan Standard Time, Yekaterinburg Standard Time' case '5.5': - return 'Asia/Kolkata'; //'[UTC + 5:30] Indian Standard Time, Sri Lanka Time' + return 'Asia/Kolkata'; //'[UTC + 5:30] Indian Standard Time, Sri Lanka Time' case '5.75': - return 'Asia/Kathmandu'; //'[UTC + 5:45] Nepal Time' + return 'Asia/Kathmandu'; //'[UTC + 5:45] Nepal Time' case '6': - return 'Etc/GMT+' . $offset; //'[UTC + 6] Bangladesh Time, Bhutan Time, Novosibirsk Standard Time' + return 'Etc/GMT-' . $offset; //'[UTC + 6] Bangladesh Time, Bhutan Time, Novosibirsk Standard Time' case '6.5': - return 'Indian/Cocos'; //'[UTC + 6:30] Cocos Islands Time, Myanmar Time' + return 'Indian/Cocos'; //'[UTC + 6:30] Cocos Islands Time, Myanmar Time' case '7': - return 'Etc/GMT+' . $offset; //'[UTC + 7] Indochina Time, Krasnoyarsk Standard Time' + return 'Etc/GMT-' . $offset; //'[UTC + 7] Indochina Time, Krasnoyarsk Standard Time' case '8': - return 'Etc/GMT+' . $offset; //'[UTC + 8] Chinese Standard Time, Australian Western Standard Time, Irkutsk Standard Time' + return 'Etc/GMT-' . $offset; //'[UTC + 8] Chinese Standard Time, Australian Western Standard Time, Irkutsk Standard Time' case '8.75': - return 'Australia/Eucla'; //'[UTC + 8:45] Southeastern Western Australia Standard Time' + return 'Australia/Eucla'; //'[UTC + 8:45] Southeastern Western Australia Standard Time' case '9': - return 'Etc/GMT+' . $offset; //'[UTC + 9] Japan Standard Time, Korea Standard Time, Chita Standard Time' + return 'Etc/GMT-' . $offset; //'[UTC + 9] Japan Standard Time, Korea Standard Time, Chita Standard Time' case '9.5': - return 'Australia/ACT'; //'[UTC + 9:30] Australian Central Standard Time' + return 'Australia/ACT'; //'[UTC + 9:30] Australian Central Standard Time' case '10': - return 'Etc/GMT+' . $offset; //'[UTC + 10] Australian Eastern Standard Time, Vladivostok Standard Time' + return 'Etc/GMT-' . $offset; //'[UTC + 10] Australian Eastern Standard Time, Vladivostok Standard Time' case '10.5': - return 'Australia/Lord_Howe'; //'[UTC + 10:30] Lord Howe Standard Time' + return 'Australia/Lord_Howe'; //'[UTC + 10:30] Lord Howe Standard Time' case '11': - return 'Etc/GMT+' . $offset; //'[UTC + 11] Solomon Island Time, Magadan Standard Time' + return 'Etc/GMT-' . $offset; //'[UTC + 11] Solomon Island Time, Magadan Standard Time' case '11.5': - return 'Pacific/Norfolk'; //'[UTC + 11:30] Norfolk Island Time' + return 'Pacific/Norfolk'; //'[UTC + 11:30] Norfolk Island Time' case '12': - return 'Etc/GMT+12'; //'[UTC + 12] New Zealand Time, Fiji Time, Kamchatka Standard Time' + return 'Etc/GMT-12'; //'[UTC + 12] New Zealand Time, Fiji Time, Kamchatka Standard Time' case '12.75': - return 'Pacific/Chatham'; //'[UTC + 12:45] Chatham Islands Time' + return 'Pacific/Chatham'; //'[UTC + 12:45] Chatham Islands Time' case '13': - return 'Pacific/Tongatapu'; //'[UTC + 13] Tonga Time, Phoenix Islands Time' + return 'Pacific/Tongatapu'; //'[UTC + 13] Tonga Time, Phoenix Islands Time' case '14': - return 'Pacific/Kiritimati'; //'[UTC + 14] Line Island Time' + return 'Pacific/Kiritimati'; //'[UTC + 14] Line Island Time' default: return 'UTC'; } diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index d0afb846b4..ab66f38124 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -836,6 +836,35 @@ $lang = array_merge($lang, array( 'Dec' => 'Dec', ), + // Timezones can be translated. We use this for the Etc/GMT timezones here, + // because they are named invers to their offset. + 'timezones' => array( + 'Etc/GMT-12' => 'GMT+12', + 'Etc/GMT-11' => 'GMT+11', + 'Etc/GMT-10' => 'GMT+10', + 'Etc/GMT-9' => 'GMT+9', + 'Etc/GMT-8' => 'GMT+8', + 'Etc/GMT-7' => 'GMT+7', + 'Etc/GMT-6' => 'GMT+6', + 'Etc/GMT-5' => 'GMT+5', + 'Etc/GMT-4' => 'GMT+4', + 'Etc/GMT-3' => 'GMT+3', + 'Etc/GMT-2' => 'GMT+2', + 'Etc/GMT-1' => 'GMT+1', + 'Etc/GMT+1' => 'GMT-1', + 'Etc/GMT+2' => 'GMT-2', + 'Etc/GMT+3' => 'GMT-3', + 'Etc/GMT+4' => 'GMT-4', + 'Etc/GMT+5' => 'GMT-5', + 'Etc/GMT+6' => 'GMT-6', + 'Etc/GMT+7' => 'GMT-7', + 'Etc/GMT+8' => 'GMT-8', + 'Etc/GMT+9' => 'GMT-9', + 'Etc/GMT+10' => 'GMT-10', + 'Etc/GMT+11' => 'GMT-11', + 'Etc/GMT+12' => 'GMT-12', + ), + // The value is only an example and will get replaced by the current time on view 'dateformats' => array( 'd M Y, H:i' => '01 Jan 2007, 13:37', From 85bcdbad468cd255a02d6c48b2dcd1d128978eed Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Sat, 21 Jul 2012 16:19:01 +0200 Subject: [PATCH 23/39] [ticket/11012] Normalize $phpEx member vars to $php_ext PHPBB3-11012 --- phpBB/includes/acp/acp_styles.php | 10 +++++----- phpBB/includes/extension/controller.php | 6 +++--- phpBB/includes/extension/finder.php | 14 +++++++------- phpBB/includes/extension/manager.php | 14 +++++++------- phpBB/includes/style/style.php | 6 +++--- phpBB/includes/template/template.php | 8 ++++---- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 943bfe6a6f..d41ef571dd 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -36,11 +36,11 @@ class acp_styles protected $cache; protected $auth; protected $phpbb_root_path; - protected $phpEx; + protected $php_ext; public function main($id, $mode) { - global $db, $user, $phpbb_admin_path, $phpbb_root_path, $phpEx, $template, $request, $cache, $auth, $config; + global $db, $user, $phpbb_admin_path, $phpbb_root_path, $php_ext, $template, $request, $cache, $auth, $config; $this->db = $db; $this->user = $user; @@ -50,12 +50,12 @@ class acp_styles $this->auth = $auth; $this->config = $config; $this->phpbb_root_path = $phpbb_root_path; - $this->phpEx = $phpEx; + $this->php_ext = $php_ext; $this->default_style = $config['default_style']; $this->styles_path = $this->phpbb_root_path . $this->styles_path_absolute . '/'; - $this->u_base_action = append_sid("{$phpbb_admin_path}index.$phpEx", "i={$id}"); + $this->u_base_action = append_sid("{$phpbb_admin_path}index.$php_ext", "i={$id}"); $this->s_hidden_fields = array( 'mode' => $mode, ); @@ -939,7 +939,7 @@ class acp_styles // Preview $actions[] = array( - 'U_ACTION' => append_sid($this->phpbb_root_path . 'index.' . $this->phpEx, 'style=' . $style['style_id']), + 'U_ACTION' => append_sid($this->phpbb_root_path . 'index.' . $this->php_ext, 'style=' . $style['style_id']), 'L_ACTION' => $this->user->lang['PREVIEW'] ); } diff --git a/phpBB/includes/extension/controller.php b/phpBB/includes/extension/controller.php index c7fd439a19..ec051c756f 100644 --- a/phpBB/includes/extension/controller.php +++ b/phpBB/includes/extension/controller.php @@ -50,7 +50,7 @@ abstract class phpbb_extension_controller implements phpbb_extension_controller_ /** * @var string PHP Extension */ - protected $phpEx; + protected $php_ext; /** * @var string Relative path to board root @@ -64,14 +64,14 @@ abstract class phpbb_extension_controller implements phpbb_extension_controller_ public function __construct() { global $request, $db, $user, $template, $config; - global $phpEx, $phpbb_root_path; + global $php_ext, $phpbb_root_path; $this->request = $request; $this->db = $db; $this->user = $user; $this->template = $template; $this->config = $config; - $this->phpEx = $phpEx; + $this->php_ext = $php_ext; $this->phpbb_root_path = $phpbb_root_path; } } diff --git a/phpBB/includes/extension/finder.php b/phpBB/includes/extension/finder.php index 87ca40917d..fb19b98429 100644 --- a/phpBB/includes/extension/finder.php +++ b/phpBB/includes/extension/finder.php @@ -25,7 +25,7 @@ class phpbb_extension_finder protected $extension_manager; protected $phpbb_root_path; protected $cache; - protected $phpEx; + protected $php_ext; /** * The cache variable name used to store $this->cached_queries in $this->cache. @@ -56,16 +56,16 @@ class phpbb_extension_finder * extensions and their locations * @param string $phpbb_root_path Path to the phpbb root directory * @param phpbb_cache_driver_interface $cache A cache instance or null - * @param string $phpEx php file extension + * @param string $php_ext php file extension * @param string $cache_name The name of the cache variable, defaults to * _ext_finder */ - public function __construct(phpbb_extension_manager $extension_manager, $phpbb_root_path = '', phpbb_cache_driver_interface $cache = null, $phpEx = '.php', $cache_name = '_ext_finder') + public function __construct(phpbb_extension_manager $extension_manager, $phpbb_root_path = '', phpbb_cache_driver_interface $cache = null, $php_ext = '.php', $cache_name = '_ext_finder') { $this->extension_manager = $extension_manager; $this->phpbb_root_path = $phpbb_root_path; $this->cache = $cache; - $this->phpEx = $phpEx; + $this->php_ext = $php_ext; $this->cache_name = $cache_name; $this->query = array( @@ -251,8 +251,8 @@ class phpbb_extension_finder */ public function get_classes($cache = true) { - $this->query['extension_suffix'] .= $this->phpEx; - $this->query['core_suffix'] .= $this->phpEx; + $this->query['extension_suffix'] .= $this->php_ext; + $this->query['core_suffix'] .= $this->php_ext; $files = $this->find($cache, false); @@ -261,7 +261,7 @@ class phpbb_extension_finder { $file = preg_replace('#^includes/#', '', $file); - $classes[] = 'phpbb_' . str_replace('/', '_', substr($file, 0, -strlen($this->phpEx))); + $classes[] = 'phpbb_' . str_replace('/', '_', substr($file, 0, -strlen($this->php_ext))); } return $classes; } diff --git a/phpBB/includes/extension/manager.php b/phpBB/includes/extension/manager.php index 537c19aff8..86d8fab64b 100644 --- a/phpBB/includes/extension/manager.php +++ b/phpBB/includes/extension/manager.php @@ -23,7 +23,7 @@ if (!defined('IN_PHPBB')) class phpbb_extension_manager { protected $cache; - protected $phpEx; + protected $php_ext; protected $extensions; protected $extension_table; protected $phpbb_root_path; @@ -35,16 +35,16 @@ class phpbb_extension_manager * @param dbal $db A database connection * @param string $extension_table The name of the table holding extensions * @param string $phpbb_root_path Path to the phpbb includes directory. - * @param string $phpEx php file extension + * @param string $php_ext php file extension * @param phpbb_cache_driver_interface $cache A cache instance or null * @param string $cache_name The name of the cache variable, defaults to _ext */ - public function __construct(dbal $db, $extension_table, $phpbb_root_path, $phpEx = '.php', phpbb_cache_driver_interface $cache = null, $cache_name = '_ext') + public function __construct(dbal $db, $extension_table, $phpbb_root_path, $php_ext = '.php', phpbb_cache_driver_interface $cache = null, $cache_name = '_ext') { $this->phpbb_root_path = $phpbb_root_path; $this->db = $db; $this->cache = $cache; - $this->phpEx = $phpEx; + $this->php_ext = $php_ext; $this->extension_table = $extension_table; $this->cache_name = $cache_name; @@ -362,7 +362,7 @@ class phpbb_extension_manager RecursiveIteratorIterator::SELF_FIRST); foreach ($iterator as $file_info) { - if ($file_info->isFile() && $file_info->getFilename() == 'ext' . $this->phpEx) + if ($file_info->isFile() && $file_info->getFilename() == 'ext' . $this->php_ext) { $ext_name = $iterator->getInnerIterator()->getSubPath(); @@ -432,7 +432,7 @@ class phpbb_extension_manager } return $disabled; } - + /** * Check to see if a given extension is available on the filesystem * @@ -462,6 +462,6 @@ class phpbb_extension_manager */ public function get_finder() { - return new phpbb_extension_finder($this, $this->phpbb_root_path, $this->cache, $this->phpEx, $this->cache_name . '_finder'); + return new phpbb_extension_finder($this, $this->phpbb_root_path, $this->cache, $this->php_ext, $this->cache_name . '_finder'); } } diff --git a/phpBB/includes/style/style.php b/phpBB/includes/style/style.php index 22e0f1d67a..6b7cd31cb3 100644 --- a/phpBB/includes/style/style.php +++ b/phpBB/includes/style/style.php @@ -38,7 +38,7 @@ class phpbb_style * PHP file extension * @var string */ - private $phpEx; + private $php_ext; /** * phpBB config instance @@ -73,10 +73,10 @@ class phpbb_style * @param phpbb_style_path_provider $provider style path provider * @param phpbb_template $template template */ - public function __construct($phpbb_root_path, $phpEx, $config, $user, phpbb_style_resource_locator $locator, phpbb_style_path_provider_interface $provider, phpbb_template $template) + public function __construct($phpbb_root_path, $php_ext, $config, $user, phpbb_style_resource_locator $locator, phpbb_style_path_provider_interface $provider, phpbb_template $template) { $this->phpbb_root_path = $phpbb_root_path; - $this->phpEx = $phpEx; + $this->php_ext = $php_ext; $this->config = $config; $this->user = $user; $this->locator = $locator; diff --git a/phpBB/includes/template/template.php b/phpBB/includes/template/template.php index 8ab3c44be3..13fa845659 100644 --- a/phpBB/includes/template/template.php +++ b/phpBB/includes/template/template.php @@ -54,7 +54,7 @@ class phpbb_template * PHP file extension * @var string */ - private $phpEx; + private $php_ext; /** * phpBB config instance @@ -87,10 +87,10 @@ class phpbb_template * @param user $user current user * @param phpbb_template_locator $locator template locator */ - public function __construct($phpbb_root_path, $phpEx, $config, $user, phpbb_template_locator $locator) + public function __construct($phpbb_root_path, $php_ext, $config, $user, phpbb_template_locator $locator) { $this->phpbb_root_path = $phpbb_root_path; - $this->phpEx = $phpEx; + $this->php_ext = $php_ext; $this->config = $config; $this->user = $user; $this->locator = $locator; @@ -313,7 +313,7 @@ class phpbb_template private function _compiled_file_for_handle($handle) { $source_file = $this->locator->get_filename_for_handle($handle); - $compiled_file = $this->cachepath . str_replace('/', '.', $source_file) . '.' . $this->phpEx; + $compiled_file = $this->cachepath . str_replace('/', '.', $source_file) . '.' . $this->php_ext; return $compiled_file; } From 87b278bda7504f2f7d0a19dfa6a8552fde50e5a6 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Sat, 21 Jul 2012 16:31:26 +0200 Subject: [PATCH 24/39] [ticket/11012] Fix php_ext change in mock_extension_manager PHPBB3-11012 --- tests/mock/extension_manager.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/mock/extension_manager.php b/tests/mock/extension_manager.php index 77f799dd3b..fdda4cbadc 100644 --- a/tests/mock/extension_manager.php +++ b/tests/mock/extension_manager.php @@ -12,7 +12,7 @@ class phpbb_mock_extension_manager extends phpbb_extension_manager public function __construct($phpbb_root_path, $extensions = array()) { $this->phpbb_root_path = $phpbb_root_path; - $this->phpEx = '.php'; + $this->php_ext = '.php'; $this->extensions = $extensions; } } From 28c3ac2408426a4c78736d1b19301a0dce6c711c Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Sat, 21 Jul 2012 19:28:17 +0200 Subject: [PATCH 25/39] [ticket/10667] Fix tests under MySQL 5.5 strict mode (once again) PHPBB3-10667 --- tests/privmsgs/fixtures/delete_user_pms.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/privmsgs/fixtures/delete_user_pms.xml b/tests/privmsgs/fixtures/delete_user_pms.xml index 56970689a3..9a86501b7a 100644 --- a/tests/privmsgs/fixtures/delete_user_pms.xml +++ b/tests/privmsgs/fixtures/delete_user_pms.xml @@ -61,6 +61,8 @@ author_id message_subject message_text + to_address + bcc_address 1 0 @@ -71,6 +73,8 @@ 3 - inbox 4 - nobox + + 2 @@ -81,6 +85,8 @@ 2 - outbox 4 - nobox + + 3 @@ -90,6 +96,8 @@ 2 - outbox + + 4 @@ -99,6 +107,8 @@ 3 - nobox + + 5 @@ -110,6 +120,8 @@ 3 - nobox 4 - nobox + + From 6ed63088feb21ebce3c6fe826ab2642ba4976765 Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Sat, 21 Jul 2012 19:28:17 +0200 Subject: [PATCH 26/39] [ticket/10667] Fix tests under MySQL 5.5 strict mode (once again) PHPBB3-10667 --- tests/privmsgs/fixtures/delete_user_pms.xml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/privmsgs/fixtures/delete_user_pms.xml b/tests/privmsgs/fixtures/delete_user_pms.xml index 56970689a3..9a86501b7a 100644 --- a/tests/privmsgs/fixtures/delete_user_pms.xml +++ b/tests/privmsgs/fixtures/delete_user_pms.xml @@ -61,6 +61,8 @@ author_id message_subject message_text + to_address + bcc_address 1 0 @@ -71,6 +73,8 @@ 3 - inbox 4 - nobox + + 2 @@ -81,6 +85,8 @@ 2 - outbox 4 - nobox + + 3 @@ -90,6 +96,8 @@ 2 - outbox + + 4 @@ -99,6 +107,8 @@ 3 - nobox + + 5 @@ -110,6 +120,8 @@ 3 - nobox 4 - nobox + +
From 67665f59577092badf7eb0b5585e5ae39c52c8da Mon Sep 17 00:00:00 2001 From: Nathan Date: Sat, 14 Jul 2012 18:12:57 -0500 Subject: [PATCH 27/39] [ticket/10990] Use $user->lang['COMMA_SEPARATOR'] when appropriate PHPBB3-10990 --- phpBB/includes/acp/acp_attachments.php | 8 +++---- phpBB/includes/acp/acp_bots.php | 28 ++++++++++++------------ phpBB/includes/acp/acp_email.php | 2 +- phpBB/includes/acp/acp_inactive.php | 6 ++--- phpBB/includes/acp/acp_permissions.php | 2 +- phpBB/includes/acp/acp_prune.php | 20 ++++++++--------- phpBB/includes/acp/acp_reasons.php | 8 +++---- phpBB/includes/acp/acp_users.php | 2 +- phpBB/includes/acp/auth.php | 4 ++-- phpBB/includes/functions_admin.php | 2 +- phpBB/includes/functions_display.php | 4 ++-- phpBB/includes/functions_privmsgs.php | 2 +- phpBB/includes/functions_user.php | 8 +++---- phpBB/includes/ucp/ucp_groups.php | 5 +++-- phpBB/includes/ucp/ucp_pm_compose.php | 2 +- phpBB/includes/ucp/ucp_pm_viewfolder.php | 8 +++---- phpBB/index.php | 2 +- phpBB/install/install_convert.php | 2 +- phpBB/language/en/common.php | 2 +- phpBB/posting.php | 2 +- phpBB/viewforum.php | 2 +- phpBB/viewtopic.php | 2 +- 22 files changed, 62 insertions(+), 61 deletions(-) diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 3433d7e2cd..18a685c9b1 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -98,7 +98,7 @@ class acp_attachments } $db->sql_freeresult($result); - $l_legend_cat_images = $user->lang['SETTINGS_CAT_IMAGES'] . ' [' . $user->lang['ASSIGNED_GROUP'] . ': ' . ((!empty($s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE])) ? implode(', ', $s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE]) : $user->lang['NO_EXT_GROUP']) . ']'; + $l_legend_cat_images = $user->lang['SETTINGS_CAT_IMAGES'] . ' [' . $user->lang['ASSIGNED_GROUP'] . ': ' . ((!empty($s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE])) ? implode($user->lang['COMMA_SEPARATOR'], $s_assigned_groups[ATTACHMENT_CATEGORY_IMAGE]) : $user->lang['NO_EXT_GROUP']) . ']'; $display_vars = array( 'title' => 'ACP_ATTACHMENT_SETTINGS', @@ -916,8 +916,8 @@ class acp_attachments WHERE ' . $db->sql_in_set('attach_id', array_keys($delete_files)); $db->sql_query($sql); - add_log('admin', 'LOG_ATTACH_ORPHAN_DEL', implode(', ', $delete_files)); - $notify[] = sprintf($user->lang['LOG_ATTACH_ORPHAN_DEL'], implode(', ', $delete_files)); + add_log('admin', 'LOG_ATTACH_ORPHAN_DEL', implode($user->lang['COMMA_SEPARATOR'], $delete_files)); + $notify[] = sprintf($user->lang['LOG_ATTACH_ORPHAN_DEL'], implode($user->lang['COMMA_SEPARATOR'], $delete_files)); } $upload_list = array(); @@ -1470,7 +1470,7 @@ class acp_attachments // Grab the list of entries $ips = request_var('ips', ''); $ip_list = array_unique(explode("\n", $ips)); - $ip_list_log = implode(', ', $ip_list); + $ip_list_log = implode($user->lang['COMMA_SEPARATOR'], $ip_list); $ip_exclude = (int) $request->variable('ipexclude', false, false, phpbb_request_interface::POST); diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php index b9dd6664f4..af625e1da3 100644 --- a/phpBB/includes/acp/acp_bots.php +++ b/phpBB/includes/acp/acp_bots.php @@ -123,7 +123,7 @@ class acp_bots $cache->destroy('_bots'); - add_log('admin', 'LOG_BOT_DELETE', implode(', ', $bot_name_ary)); + add_log('admin', 'LOG_BOT_DELETE', implode($user->lang['COMMA_SEPARATOR'], $bot_name_ary)); trigger_error($user->lang['BOT_DELETED'] . adm_back_link($this->u_action)); } else @@ -157,7 +157,7 @@ class acp_bots { $error[] = $user->lang['ERR_BOT_NO_MATCHES']; } - + if ($bot_row['bot_ip'] && !preg_match('#^[\d\.,:]+$#', $bot_row['bot_ip'])) { if (!$ip_list = gethostbynamel($bot_row['bot_ip'])) @@ -176,7 +176,7 @@ class acp_bots { $error[] = $user->lang['ERR_BOT_AGENT_MATCHES_UA']; } - + $bot_name = false; if ($bot_id) { @@ -201,7 +201,7 @@ class acp_bots { $error[] = $user->lang['BOT_NAME_TAKEN']; } - + if (!sizeof($error)) { // New bot? Create a new user and group entry @@ -219,7 +219,7 @@ class acp_bots { trigger_error($user->lang['NO_BOT_GROUP'] . adm_back_link($this->u_action . "&id=$bot_id&action=$action"), E_USER_WARNING); } - + $user_id = user_add(array( 'user_type' => (int) USER_IGNORE, @@ -233,7 +233,7 @@ class acp_bots 'user_style' => (int) $bot_row['bot_style'], 'user_allow_massemail' => 0, )); - + $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'user_id' => (int) $user_id, 'bot_name' => (string) $bot_row['bot_name'], @@ -242,7 +242,7 @@ class acp_bots 'bot_ip' => (string) $bot_row['bot_ip']) ); $db->sql_query($sql); - + $log = 'ADDED'; } else if ($bot_id) @@ -289,12 +289,12 @@ class acp_bots $log = 'UPDATED'; } - + $cache->destroy('_bots'); - + add_log('admin', 'LOG_BOT_' . $log, $bot_row['bot_name']); trigger_error($user->lang['BOT_' . $log] . adm_back_link($this->u_action)); - + } } else if ($bot_id) @@ -335,11 +335,11 @@ class acp_bots 'U_ACTION' => $this->u_action . "&id=$bot_id&action=$action", 'U_BACK' => $this->u_action, 'ERROR_MSG' => (sizeof($error)) ? implode('
', $error) : '', - + 'BOT_NAME' => $bot_row['bot_name'], 'BOT_IP' => $bot_row['bot_ip'], 'BOT_AGENT' => $bot_row['bot_agent'], - + 'S_EDIT_BOT' => true, 'S_ACTIVE_OPTIONS' => $s_active_options, 'S_STYLE_OPTIONS' => $style_select, @@ -397,7 +397,7 @@ class acp_bots } $db->sql_freeresult($result); } - + /** * Validate bot name against username table */ @@ -417,7 +417,7 @@ class acp_bots $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - + return ($row) ? false : true; } } diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php index c9d149b6d7..116d74046a 100644 --- a/phpBB/includes/acp/acp_email.php +++ b/phpBB/includes/acp/acp_email.php @@ -216,7 +216,7 @@ class acp_email if ($usernames) { $usernames = explode("\n", $usernames); - add_log('admin', 'LOG_MASS_EMAIL', implode(', ', utf8_normalize_nfc($usernames))); + add_log('admin', 'LOG_MASS_EMAIL', implode($user->lang['COMMA_SEPARATOR'], utf8_normalize_nfc($usernames))); } else { diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php index 1e23c2e6cf..b416e4d1e8 100644 --- a/phpBB/includes/acp/acp_inactive.php +++ b/phpBB/includes/acp/acp_inactive.php @@ -289,8 +289,8 @@ class acp_inactive } $base_url = $this->u_action . "&$u_sort_param&users_per_page=$per_page"; - phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $inactive_count, $per_page, $start); - + phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $inactive_count, $per_page, $start); + $template->assign_vars(array( 'S_INACTIVE_USERS' => true, 'S_INACTIVE_OPTIONS' => build_select($option_ary), @@ -299,7 +299,7 @@ class acp_inactive 'S_SORT_KEY' => $s_sort_key, 'S_SORT_DIR' => $s_sort_dir, 'S_ON_PAGE' => phpbb_on_page($template, $user, $base_url, $inactive_count, $per_page, $start), - + 'USERS_PER_PAGE' => $per_page, 'U_ACTION' => $this->u_action . "&$u_sort_param&users_per_page=$per_page&start=$start", diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php index d728744c04..dd071074de 100644 --- a/phpBB/includes/acp/acp_permissions.php +++ b/phpBB/includes/acp/acp_permissions.php @@ -497,7 +497,7 @@ class acp_permissions $template->assign_vars(array( 'S_FORUM_NAMES' => (sizeof($forum_names)) ? true : false, - 'FORUM_NAMES' => implode(', ', $forum_names)) + 'FORUM_NAMES' => implode($user->lang['COMMA_SEPARATOR'], $forum_names)) ); } diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php index 240e3596ba..caa687f5ff 100644 --- a/phpBB/includes/acp/acp_prune.php +++ b/phpBB/includes/acp/acp_prune.php @@ -79,7 +79,7 @@ class acp_prune $prune_posted = request_var('prune_days', 0); $prune_viewed = request_var('prune_vieweddays', 0); $prune_all = (!$prune_posted && !$prune_viewed) ? true : false; - + $prune_flags = 0; $prune_flags += (request_var('prune_old_polls', 0)) ? 2 : 0; $prune_flags += (request_var('prune_announce', 0)) ? 4 : 0; @@ -109,7 +109,7 @@ class acp_prune $p_result['topics'] = 0; $p_result['posts'] = 0; $log_data = ''; - + do { if (!$auth->acl_get('f_list', $row['forum_id'])) @@ -129,7 +129,7 @@ class acp_prune $p_result['topics'] += $return['topics']; $p_result['posts'] += $return['posts']; } - + if ($prune_viewed) { $return = prune($row['forum_id'], 'viewed', $prunedate_viewed, $prune_flags, false); @@ -145,11 +145,11 @@ class acp_prune 'NUM_TOPICS' => $p_result['topics'], 'NUM_POSTS' => $p_result['posts']) ); - + $log_data .= (($log_data != '') ? ', ' : '') . $row['forum_name']; } while ($row = $db->sql_fetchrow($result)); - + // Sync all pruned forums at once sync('forum', 'forum_id', $prune_ids, true, true); add_log('admin', 'LOG_PRUNE', $log_data); @@ -259,7 +259,7 @@ class acp_prune { user_delete('remove', $user_id); } - + $l_log = 'LOG_PRUNE_USER_DEL_DEL'; } else @@ -273,7 +273,7 @@ class acp_prune } } - add_log('admin', $l_log, implode(', ', $usernames)); + add_log('admin', $l_log, implode($user->lang['COMMA_SEPARATOR'], $usernames)); $msg = $user->lang['USER_' . strtoupper($action) . '_SUCCESS']; } else @@ -345,7 +345,7 @@ class acp_prune { $s_find_join_time .= ''; } - + $s_find_active_time = ''; foreach ($find_time as $key => $value) { @@ -369,7 +369,7 @@ class acp_prune global $user, $db; $users = utf8_normalize_nfc(request_var('users', '', true)); - + if ($users) { $users = explode("\n", $users); @@ -409,7 +409,7 @@ class acp_prune if (sizeof($active) && (int) $active[0] == 0 && (int) $active[1] == 0 && (int) $active[2] == 0) { $where_sql .= ' AND user_lastvisit = 0'; - } + } else if (sizeof($active) && $active_select != 'lt') { $where_sql .= ' AND user_lastvisit ' . $key_match[$active_select] . ' ' . gmmktime(0, 0, 0, (int) $active[1], (int) $active[2], (int) $active[0]); diff --git a/phpBB/includes/acp/acp_reasons.php b/phpBB/includes/acp/acp_reasons.php index 479fcfba81..71e9108c2c 100644 --- a/phpBB/includes/acp/acp_reasons.php +++ b/phpBB/includes/acp/acp_reasons.php @@ -113,7 +113,7 @@ class acp_reasons $result = $db->sql_query($sql); $max_order = (int) $db->sql_fetchfield('max_reason_order'); $db->sql_freeresult($result); - + $sql_ary = array( 'reason_title' => (string) $reason_row['reason_title'], 'reason_description' => (string) $reason_row['reason_description'], @@ -171,14 +171,14 @@ class acp_reasons 'U_ACTION' => $this->u_action . "&id=$reason_id&action=$action", 'U_BACK' => $this->u_action, 'ERROR_MSG' => (sizeof($error)) ? implode('
', $error) : '', - + 'REASON_TITLE' => $reason_row['reason_title'], 'REASON_DESCRIPTION' => $reason_row['reason_description'], 'TRANSLATED_TITLE' => ($translated) ? $user->lang['report_reasons']['TITLE'][strtoupper($reason_row['reason_title'])] : '', 'TRANSLATED_DESCRIPTION'=> ($translated) ? $user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason_row['reason_title'])] : '', - 'S_AVAILABLE_TITLES' => implode(', ', array_map('htmlspecialchars', array_keys($user->lang['report_reasons']['TITLE']))), + 'S_AVAILABLE_TITLES' => implode($user->lang['COMMA_SEPARATOR'], array_map('htmlspecialchars', array_keys($user->lang['report_reasons']['TITLE']))), 'S_EDIT_REASON' => true, 'S_TRANSLATED' => $translated, 'S_ERROR' => (sizeof($error)) ? true : false, @@ -303,7 +303,7 @@ class acp_reasons do { ++$order; - + if ($row['reason_order'] != $order) { $sql = 'UPDATE ' . REPORTS_REASONS_TABLE . " diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 79c91dd7ee..62968a17b7 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -1943,7 +1943,7 @@ class acp_users $message = (sizeof($log_attachments) == 1) ? $user->lang['ATTACHMENT_DELETED'] : $user->lang['ATTACHMENTS_DELETED']; - add_log('admin', 'LOG_ATTACHMENTS_DELETED', implode(', ', $log_attachments)); + add_log('admin', 'LOG_ATTACHMENTS_DELETED', implode($user->lang['COMMA_SEPARATOR'], $log_attachments)); trigger_error($message . adm_back_link($this->u_action . '&u=' . $user_id)); } else diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php index 7d9fd267ff..6b1da46a12 100644 --- a/phpBB/includes/acp/auth.php +++ b/phpBB/includes/acp/auth.php @@ -529,8 +529,8 @@ class auth_admin extends phpbb_auth 'NAME' => $ug_name, 'CATEGORIES' => implode('
', $categories), - 'USER_GROUPS_DEFAULT' => ($user_mode == 'user' && isset($user_groups_default[$ug_id]) && sizeof($user_groups_default[$ug_id])) ? implode(', ', $user_groups_default[$ug_id]) : '', - 'USER_GROUPS_CUSTOM' => ($user_mode == 'user' && isset($user_groups_custom[$ug_id]) && sizeof($user_groups_custom[$ug_id])) ? implode(', ', $user_groups_custom[$ug_id]) : '', + 'USER_GROUPS_DEFAULT' => ($user_mode == 'user' && isset($user_groups_default[$ug_id]) && sizeof($user_groups_default[$ug_id])) ? implode($user->lang['COMMA_SEPARATOR'], $user_groups_default[$ug_id]) : '', + 'USER_GROUPS_CUSTOM' => ($user_mode == 'user' && isset($user_groups_custom[$ug_id]) && sizeof($user_groups_custom[$ug_id])) ? implode($user->lang['COMMA_SEPARATOR'], $user_groups_custom[$ug_id]) : '', 'L_ACL_TYPE' => $l_acl_type, 'S_LOCAL' => ($local) ? true : false, diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 5d19cd7adb..db83913cb8 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -439,7 +439,7 @@ function copy_forum_permissions($src_forum_id, $dest_forum_ids, $clear_dest_perm if ($add_log) { - add_log('admin', 'LOG_FORUM_COPIED_PERMISSIONS', $src_forum_name, implode(', ', $dest_forum_names)); + add_log('admin', 'LOG_FORUM_COPIED_PERMISSIONS', $src_forum_name, implode($user->lang['COMMA_SEPARATOR'], $dest_forum_names)); } $db->sql_transaction('commit'); diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 00efd281c0..a1ff7a1f99 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -411,7 +411,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod if ($display_moderators && !empty($forum_moderators[$forum_id])) { $l_moderator = (sizeof($forum_moderators[$forum_id]) == 1) ? $user->lang['MODERATOR'] : $user->lang['MODERATORS']; - $moderators_list = implode(', ', $forum_moderators[$forum_id]); + $moderators_list = implode($user->lang['COMMA_SEPARATOR'], $forum_moderators[$forum_id]); } $l_post_click_count = ($row['forum_type'] == FORUM_LINK) ? 'CLICKS' : 'POSTS'; @@ -422,7 +422,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod { $s_subforums_list[] = '' . $subforum['name'] . ''; } - $s_subforums_list = (string) implode(', ', $s_subforums_list); + $s_subforums_list = (string) implode($user->lang['COMMA_SEPARATOR'], $s_subforums_list); $catless = ($row['parent_id'] == $root_data['forum_id']) ? true : false; if ($row['forum_type'] != FORUM_LINK) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 8542e3ab0a..7a6ccf08da 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -2045,7 +2045,7 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode 'SUBJECT' => $subject, 'SENT_DATE' => $user->format_date($row['message_time']), 'MESSAGE' => $message, - 'FOLDER' => implode(', ', $row['folder']), + 'FOLDER' => implode($user->lang['COMMA_SEPARATOR'], $row['folder']), 'DECODED_MESSAGE' => $decoded_message, 'S_CURRENT_MSG' => ($row['msg_id'] == $msg_id), diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 6e658b4ef4..de603ea9d6 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -659,7 +659,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas $db->sql_query($sql); $ban_list = (!is_array($ban)) ? array_unique(explode("\n", $ban)) : $ban; - $ban_list_log = implode(', ', $ban_list); + $ban_list_log = implode($user->lang['COMMA_SEPARATOR'], $ban_list); $current_time = time(); @@ -2923,7 +2923,7 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false, $log = ($leader) ? 'LOG_MODS_ADDED' : (($pending) ? 'LOG_USERS_PENDING' : 'LOG_USERS_ADDED'); - add_log('admin', $log, $group_name, implode(', ', $username_ary)); + add_log('admin', $log, $group_name, implode($user->lang['COMMA_SEPARATOR'], $username_ary)); group_update_listings($group_id); @@ -3056,7 +3056,7 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false, if ($group_name) { - add_log('admin', $log, $group_name, implode(', ', $username_ary)); + add_log('admin', $log, $group_name, implode($user->lang['COMMA_SEPARATOR'], $username_ary)); } group_update_listings($group_id); @@ -3296,7 +3296,7 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna // Clear permissions cache of relevant users $auth->acl_clear_prefetch($user_id_ary); - add_log('admin', $log, $group_name, implode(', ', $username_ary)); + add_log('admin', $log, $group_name, implode($user->lang['COMMA_SEPARATOR'], $username_ary)); group_update_listings($group_id); diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php index aa9510b63b..65ab92e78e 100644 --- a/phpBB/includes/ucp/ucp_groups.php +++ b/phpBB/includes/ucp/ucp_groups.php @@ -846,7 +846,7 @@ class ucp_groups $base_url = $this->u_action . "&action=$action&g=$group_id"; phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $total_members, $config['topics_per_page'], $start); - + $template->assign_vars(array( 'S_LIST' => true, 'S_ACTION_OPTIONS' => $s_action_options, @@ -1069,7 +1069,8 @@ class ucp_groups 'mode' => $mode, 'action' => $action ); - confirm_box(false, $user->lang('GROUP_CONFIRM_ADD_USERS', sizeof($name_ary), implode(', ', $name_ary)), build_hidden_fields($s_hidden_fields)); + + confirm_box(false, $user->lang('GROUP_CONFIRM_ADD_USERS', sizeof($name_ary), implode($user->lang['COMMA_SEPARATOR'], $name_ary)), build_hidden_fields($s_hidden_fields)); } trigger_error($user->lang['NO_USERS_ADDED'] . '

' . sprintf($user->lang['RETURN_PAGE'], '', '')); diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 1b474457b3..d8bcd374fe 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -874,7 +874,7 @@ function compose_pm($id, $mode, $action, $user_folders = array()) $forward_text[] = sprintf($user->lang['FWD_SUBJECT'], censor_text($message_subject)); $forward_text[] = sprintf($user->lang['FWD_DATE'], $user->format_date($message_time, false, true)); $forward_text[] = sprintf($user->lang['FWD_FROM'], $quote_username_text); - $forward_text[] = sprintf($user->lang['FWD_TO'], implode(', ', $fwd_to_field['to'])); + $forward_text[] = sprintf($user->lang['FWD_TO'], implode($user->lang['COMMA_SEPARATOR'], $fwd_to_field['to'])); $message_parser->message = implode("\n", $forward_text) . "\n\n[quote="{$quote_username}"]\n" . censor_text(trim($message_parser->message)) . "\n[/quote]"; $message_subject = ((!preg_match('/^Fwd:/', $message_subject)) ? 'Fwd: ' : '') . censor_text($message_subject); diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php index dc77587452..1026f24699 100644 --- a/phpBB/includes/ucp/ucp_pm_viewfolder.php +++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php @@ -176,7 +176,7 @@ function view_folder($id, $mode, $folder_id, $folder) 'U_VIEW_PM' => ($row['pm_deleted']) ? '' : $view_message_url, 'U_REMOVE_PM' => ($row['pm_deleted']) ? $remove_message_url : '', 'U_MCP_REPORT' => (isset($row['report_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=pm_reports&mode=pm_report_details&r=' . $row['report_id']) : '', - 'RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? implode(', ', $address_list[$message_id]) : '') + 'RECIPIENTS' => ($folder_id == PRIVMSGS_OUTBOX || $folder_id == PRIVMSGS_SENTBOX) ? implode($user->lang['COMMA_SEPARATOR'], $address_list[$message_id]) : '') ); } unset($folder_info['rowset']); @@ -266,9 +266,9 @@ function view_folder($id, $mode, $folder_id, $folder) } } - // There is the chance that all recipients of the message got deleted. To avoid creating + // There is the chance that all recipients of the message got deleted. To avoid creating // exports without recipients, we add a bogus "undisclosed recipient". - if (!(isset($address[$message_id]['g']) && sizeof($address[$message_id]['g'])) && + if (!(isset($address[$message_id]['g']) && sizeof($address[$message_id]['g'])) && !(isset($address[$message_id]['u']) && sizeof($address[$message_id]['u']))) { $address[$message_id]['u'] = array(); @@ -277,7 +277,7 @@ function view_folder($id, $mode, $folder_id, $folder) } decode_message($message_row['message_text'], $message_row['bbcode_uid']); - + $data[] = array( 'subject' => censor_text($row['message_subject']), 'sender' => $row['username'], diff --git a/phpBB/index.php b/phpBB/index.php index a477a876ad..2118a39b5d 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -104,7 +104,7 @@ while ($row = $db->sql_fetchrow($result)) } $db->sql_freeresult($result); -$legend = implode(', ', $legend); +$legend = implode($user->lang['COMMA_SEPARATOR'], $legend); // Generate birthday list if required ... $birthday_list = array(); diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index db974f9903..ca3994d129 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -933,7 +933,7 @@ class install_convert extends module } else if (sizeof($missing_tables)) { - $this->p_master->error(sprintf($user->lang['TABLES_MISSING'], implode(', ', $missing_tables)) . '

' . $user->lang['CHECK_TABLE_PREFIX'], __LINE__, __FILE__); + $this->p_master->error(sprintf($user->lang['TABLES_MISSING'], implode($user->lang['COMMA_SEPARATOR'], $missing_tables)) . '

' . $user->lang['CHECK_TABLE_PREFIX'], __LINE__, __FILE__); } $url = $this->save_convert_progress('&confirm=1'); diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php index d0afb846b4..f3dba1cba3 100644 --- a/phpBB/language/en/common.php +++ b/phpBB/language/en/common.php @@ -134,7 +134,7 @@ $lang = array_merge($lang, array( 'COLLAPSE_VIEW' => 'Collapse view', 'CLOSE_WINDOW' => 'Close window', 'COLOUR_SWATCH' => 'Colour swatch', - 'COMMA_SEPARATOR' => ', ', // Used in pagination of ACP & prosilver, use localised comma if appropriate, eg: Ideographic or Arabic + 'COMMA_SEPARATOR' => ', ', // Comma used to join lists into a single string, use localised comma if appropriate, eg: Ideographic or Arabic 'CONFIRM' => 'Confirm', 'CONFIRM_CODE' => 'Confirmation code', 'CONFIRM_CODE_EXPLAIN' => 'Enter the code exactly as it appears. All letters are case insensitive.', diff --git a/phpBB/posting.php b/phpBB/posting.php index 7f57f693af..a17578e343 100644 --- a/phpBB/posting.php +++ b/phpBB/posting.php @@ -1362,7 +1362,7 @@ $template->assign_vars(array( 'FORUM_NAME' => $post_data['forum_name'], 'FORUM_DESC' => ($post_data['forum_desc']) ? generate_text_for_display($post_data['forum_desc'], $post_data['forum_desc_uid'], $post_data['forum_desc_bitfield'], $post_data['forum_desc_options']) : '', 'TOPIC_TITLE' => censor_text($post_data['topic_title']), - 'MODERATORS' => (sizeof($moderators)) ? implode(', ', $moderators[$forum_id]) : '', + 'MODERATORS' => (sizeof($moderators)) ? implode($user->lang['COMMA_SEPARATOR'], $moderators[$forum_id]) : '', 'USERNAME' => ((!$preview && $mode != 'quote') || $preview) ? $post_data['username'] : '', 'SUBJECT' => $post_data['post_subject'], 'MESSAGE' => $post_data['post_text'], diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 18d247f0b6..f4781a09ff 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -289,7 +289,7 @@ if (!empty($_EXTRA_URL)) } $template->assign_vars(array( - 'MODERATORS' => (!empty($moderators[$forum_id])) ? implode(', ', $moderators[$forum_id]) : '', + 'MODERATORS' => (!empty($moderators[$forum_id])) ? implode($user->lang['COMMA_SEPARATOR'], $moderators[$forum_id]) : '', 'POST_IMG' => ($forum_data['forum_status'] == ITEM_LOCKED) ? $user->img('button_topic_locked', $post_alt) : $user->img('button_topic_new', $post_alt), 'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'), diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 349f53cbe2..b6df14d42d 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -602,7 +602,7 @@ $template->assign_vars(array( 'PAGE_NUMBER' => phpbb_on_page($template, $user, $base_url, $total_posts, $config['posts_per_page'], $start), 'TOTAL_POSTS' => $user->lang('VIEW_TOPIC_POSTS', (int) $total_posts), 'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=main&mode=topic_view&f=$forum_id&t=$topic_id" . (($start == 0) ? '' : "&start=$start") . ((strlen($u_sort_param)) ? "&$u_sort_param" : ''), true, $user->session_id) : '', - 'MODERATORS' => (isset($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id])) ? implode(', ', $forum_moderators[$forum_id]) : '', + 'MODERATORS' => (isset($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id])) ? implode($user->lang['COMMA_SEPARATOR'], $forum_moderators[$forum_id]) : '', 'POST_IMG' => ($topic_data['forum_status'] == ITEM_LOCKED) ? $user->img('button_topic_locked', 'FORUM_LOCKED') : $user->img('button_topic_new', 'POST_NEW_TOPIC'), 'QUOTE_IMG' => $user->img('icon_post_quote', 'REPLY_WITH_QUOTE'), From eb5e33a7683e7eebaa5c180c00693d5d061c057c Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Sun, 22 Jul 2012 14:39:10 -0500 Subject: [PATCH 28/39] [ticket/10990] Do not use comma separator when storing it as a log. PHPBB3-10990 --- phpBB/includes/acp/acp_attachments.php | 4 ++-- phpBB/includes/acp/acp_bots.php | 2 +- phpBB/includes/acp/acp_email.php | 2 +- phpBB/includes/acp/acp_prune.php | 2 +- phpBB/includes/functions_admin.php | 2 +- phpBB/includes/functions_user.php | 8 ++++---- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 18a685c9b1..af22ed57e8 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -916,7 +916,7 @@ class acp_attachments WHERE ' . $db->sql_in_set('attach_id', array_keys($delete_files)); $db->sql_query($sql); - add_log('admin', 'LOG_ATTACH_ORPHAN_DEL', implode($user->lang['COMMA_SEPARATOR'], $delete_files)); + add_log('admin', 'LOG_ATTACH_ORPHAN_DEL', implode(', ', $delete_files)); $notify[] = sprintf($user->lang['LOG_ATTACH_ORPHAN_DEL'], implode($user->lang['COMMA_SEPARATOR'], $delete_files)); } @@ -1470,7 +1470,7 @@ class acp_attachments // Grab the list of entries $ips = request_var('ips', ''); $ip_list = array_unique(explode("\n", $ips)); - $ip_list_log = implode($user->lang['COMMA_SEPARATOR'], $ip_list); + $ip_list_log = implode(', ', $ip_list); $ip_exclude = (int) $request->variable('ipexclude', false, false, phpbb_request_interface::POST); diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php index af625e1da3..d53971ed08 100644 --- a/phpBB/includes/acp/acp_bots.php +++ b/phpBB/includes/acp/acp_bots.php @@ -123,7 +123,7 @@ class acp_bots $cache->destroy('_bots'); - add_log('admin', 'LOG_BOT_DELETE', implode($user->lang['COMMA_SEPARATOR'], $bot_name_ary)); + add_log('admin', 'LOG_BOT_DELETE', implode(', ', $bot_name_ary)); trigger_error($user->lang['BOT_DELETED'] . adm_back_link($this->u_action)); } else diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php index 116d74046a..c9d149b6d7 100644 --- a/phpBB/includes/acp/acp_email.php +++ b/phpBB/includes/acp/acp_email.php @@ -216,7 +216,7 @@ class acp_email if ($usernames) { $usernames = explode("\n", $usernames); - add_log('admin', 'LOG_MASS_EMAIL', implode($user->lang['COMMA_SEPARATOR'], utf8_normalize_nfc($usernames))); + add_log('admin', 'LOG_MASS_EMAIL', implode(', ', utf8_normalize_nfc($usernames))); } else { diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php index caa687f5ff..d867eb0297 100644 --- a/phpBB/includes/acp/acp_prune.php +++ b/phpBB/includes/acp/acp_prune.php @@ -273,7 +273,7 @@ class acp_prune } } - add_log('admin', $l_log, implode($user->lang['COMMA_SEPARATOR'], $usernames)); + add_log('admin', $l_log, implode(', ', $usernames)); $msg = $user->lang['USER_' . strtoupper($action) . '_SUCCESS']; } else diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index db83913cb8..5d19cd7adb 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -439,7 +439,7 @@ function copy_forum_permissions($src_forum_id, $dest_forum_ids, $clear_dest_perm if ($add_log) { - add_log('admin', 'LOG_FORUM_COPIED_PERMISSIONS', $src_forum_name, implode($user->lang['COMMA_SEPARATOR'], $dest_forum_names)); + add_log('admin', 'LOG_FORUM_COPIED_PERMISSIONS', $src_forum_name, implode(', ', $dest_forum_names)); } $db->sql_transaction('commit'); diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index de603ea9d6..6e658b4ef4 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -659,7 +659,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas $db->sql_query($sql); $ban_list = (!is_array($ban)) ? array_unique(explode("\n", $ban)) : $ban; - $ban_list_log = implode($user->lang['COMMA_SEPARATOR'], $ban_list); + $ban_list_log = implode(', ', $ban_list); $current_time = time(); @@ -2923,7 +2923,7 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false, $log = ($leader) ? 'LOG_MODS_ADDED' : (($pending) ? 'LOG_USERS_PENDING' : 'LOG_USERS_ADDED'); - add_log('admin', $log, $group_name, implode($user->lang['COMMA_SEPARATOR'], $username_ary)); + add_log('admin', $log, $group_name, implode(', ', $username_ary)); group_update_listings($group_id); @@ -3056,7 +3056,7 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false, if ($group_name) { - add_log('admin', $log, $group_name, implode($user->lang['COMMA_SEPARATOR'], $username_ary)); + add_log('admin', $log, $group_name, implode(', ', $username_ary)); } group_update_listings($group_id); @@ -3296,7 +3296,7 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna // Clear permissions cache of relevant users $auth->acl_clear_prefetch($user_id_ary); - add_log('admin', $log, $group_name, implode($user->lang['COMMA_SEPARATOR'], $username_ary)); + add_log('admin', $log, $group_name, implode(', ', $username_ary)); group_update_listings($group_id); From 577dbf89518521f581117df9575363c3a2e16b5f Mon Sep 17 00:00:00 2001 From: Nathan Guse Date: Sun, 22 Jul 2012 14:48:39 -0500 Subject: [PATCH 29/39] [ticket/10990] Changes for develop PHPBB3-10990 --- phpBB/includes/acp/acp_attachments.php | 2 +- phpBB/includes/acp/acp_bots.php | 26 +++++++++++------------ phpBB/includes/acp/acp_inactive.php | 6 +++--- phpBB/includes/acp/acp_prune.php | 18 ++++++++-------- phpBB/includes/mcp/mcp_pm_reports.php | 2 +- phpBB/includes/search/fulltext_native.php | 2 +- phpBB/index.php | 2 +- 7 files changed, 29 insertions(+), 29 deletions(-) diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index af22ed57e8..eccc935a6e 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -1074,7 +1074,7 @@ class acp_attachments $error[] = $user->lang['FILES_GONE']; } add_log('admin', 'LOG_ATTACHMENTS_DELETED', implode(', ', $deleted_filenames)); - $notify[] = sprintf($user->lang['LOG_ATTACHMENTS_DELETED'], implode(', ', $deleted_filenames)); + $notify[] = sprintf($user->lang['LOG_ATTACHMENTS_DELETED'], implode($user->lang['COMMA_SEPARATOR'], $deleted_filenames)); } else { diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php index d53971ed08..b9dd6664f4 100644 --- a/phpBB/includes/acp/acp_bots.php +++ b/phpBB/includes/acp/acp_bots.php @@ -157,7 +157,7 @@ class acp_bots { $error[] = $user->lang['ERR_BOT_NO_MATCHES']; } - + if ($bot_row['bot_ip'] && !preg_match('#^[\d\.,:]+$#', $bot_row['bot_ip'])) { if (!$ip_list = gethostbynamel($bot_row['bot_ip'])) @@ -176,7 +176,7 @@ class acp_bots { $error[] = $user->lang['ERR_BOT_AGENT_MATCHES_UA']; } - + $bot_name = false; if ($bot_id) { @@ -201,7 +201,7 @@ class acp_bots { $error[] = $user->lang['BOT_NAME_TAKEN']; } - + if (!sizeof($error)) { // New bot? Create a new user and group entry @@ -219,7 +219,7 @@ class acp_bots { trigger_error($user->lang['NO_BOT_GROUP'] . adm_back_link($this->u_action . "&id=$bot_id&action=$action"), E_USER_WARNING); } - + $user_id = user_add(array( 'user_type' => (int) USER_IGNORE, @@ -233,7 +233,7 @@ class acp_bots 'user_style' => (int) $bot_row['bot_style'], 'user_allow_massemail' => 0, )); - + $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array( 'user_id' => (int) $user_id, 'bot_name' => (string) $bot_row['bot_name'], @@ -242,7 +242,7 @@ class acp_bots 'bot_ip' => (string) $bot_row['bot_ip']) ); $db->sql_query($sql); - + $log = 'ADDED'; } else if ($bot_id) @@ -289,12 +289,12 @@ class acp_bots $log = 'UPDATED'; } - + $cache->destroy('_bots'); - + add_log('admin', 'LOG_BOT_' . $log, $bot_row['bot_name']); trigger_error($user->lang['BOT_' . $log] . adm_back_link($this->u_action)); - + } } else if ($bot_id) @@ -335,11 +335,11 @@ class acp_bots 'U_ACTION' => $this->u_action . "&id=$bot_id&action=$action", 'U_BACK' => $this->u_action, 'ERROR_MSG' => (sizeof($error)) ? implode('
', $error) : '', - + 'BOT_NAME' => $bot_row['bot_name'], 'BOT_IP' => $bot_row['bot_ip'], 'BOT_AGENT' => $bot_row['bot_agent'], - + 'S_EDIT_BOT' => true, 'S_ACTIVE_OPTIONS' => $s_active_options, 'S_STYLE_OPTIONS' => $style_select, @@ -397,7 +397,7 @@ class acp_bots } $db->sql_freeresult($result); } - + /** * Validate bot name against username table */ @@ -417,7 +417,7 @@ class acp_bots $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - + return ($row) ? false : true; } } diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php index b416e4d1e8..1e23c2e6cf 100644 --- a/phpBB/includes/acp/acp_inactive.php +++ b/phpBB/includes/acp/acp_inactive.php @@ -289,8 +289,8 @@ class acp_inactive } $base_url = $this->u_action . "&$u_sort_param&users_per_page=$per_page"; - phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $inactive_count, $per_page, $start); - + phpbb_generate_template_pagination($template, $base_url, 'pagination', 'start', $inactive_count, $per_page, $start); + $template->assign_vars(array( 'S_INACTIVE_USERS' => true, 'S_INACTIVE_OPTIONS' => build_select($option_ary), @@ -299,7 +299,7 @@ class acp_inactive 'S_SORT_KEY' => $s_sort_key, 'S_SORT_DIR' => $s_sort_dir, 'S_ON_PAGE' => phpbb_on_page($template, $user, $base_url, $inactive_count, $per_page, $start), - + 'USERS_PER_PAGE' => $per_page, 'U_ACTION' => $this->u_action . "&$u_sort_param&users_per_page=$per_page&start=$start", diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php index d867eb0297..240e3596ba 100644 --- a/phpBB/includes/acp/acp_prune.php +++ b/phpBB/includes/acp/acp_prune.php @@ -79,7 +79,7 @@ class acp_prune $prune_posted = request_var('prune_days', 0); $prune_viewed = request_var('prune_vieweddays', 0); $prune_all = (!$prune_posted && !$prune_viewed) ? true : false; - + $prune_flags = 0; $prune_flags += (request_var('prune_old_polls', 0)) ? 2 : 0; $prune_flags += (request_var('prune_announce', 0)) ? 4 : 0; @@ -109,7 +109,7 @@ class acp_prune $p_result['topics'] = 0; $p_result['posts'] = 0; $log_data = ''; - + do { if (!$auth->acl_get('f_list', $row['forum_id'])) @@ -129,7 +129,7 @@ class acp_prune $p_result['topics'] += $return['topics']; $p_result['posts'] += $return['posts']; } - + if ($prune_viewed) { $return = prune($row['forum_id'], 'viewed', $prunedate_viewed, $prune_flags, false); @@ -145,11 +145,11 @@ class acp_prune 'NUM_TOPICS' => $p_result['topics'], 'NUM_POSTS' => $p_result['posts']) ); - + $log_data .= (($log_data != '') ? ', ' : '') . $row['forum_name']; } while ($row = $db->sql_fetchrow($result)); - + // Sync all pruned forums at once sync('forum', 'forum_id', $prune_ids, true, true); add_log('admin', 'LOG_PRUNE', $log_data); @@ -259,7 +259,7 @@ class acp_prune { user_delete('remove', $user_id); } - + $l_log = 'LOG_PRUNE_USER_DEL_DEL'; } else @@ -345,7 +345,7 @@ class acp_prune { $s_find_join_time .= ''; } - + $s_find_active_time = ''; foreach ($find_time as $key => $value) { @@ -369,7 +369,7 @@ class acp_prune global $user, $db; $users = utf8_normalize_nfc(request_var('users', '', true)); - + if ($users) { $users = explode("\n", $users); @@ -409,7 +409,7 @@ class acp_prune if (sizeof($active) && (int) $active[0] == 0 && (int) $active[1] == 0 && (int) $active[2] == 0) { $where_sql .= ' AND user_lastvisit = 0'; - } + } else if (sizeof($active) && $active_select != 'lt') { $where_sql .= ' AND user_lastvisit ' . $key_match[$active_select] . ' ' . gmmktime(0, 0, 0, (int) $active[1], (int) $active[2], (int) $active[0]); diff --git a/phpBB/includes/mcp/mcp_pm_reports.php b/phpBB/includes/mcp/mcp_pm_reports.php index 41e912fff9..24e531517c 100644 --- a/phpBB/includes/mcp/mcp_pm_reports.php +++ b/phpBB/includes/mcp/mcp_pm_reports.php @@ -291,7 +291,7 @@ class mcp_pm_reports 'REPORT_ID' => $row['report_id'], 'REPORT_TIME' => $user->format_date($row['report_time']), - 'RECIPIENTS' => implode(', ', $address_list[$row['msg_id']]), + 'RECIPIENTS' => implode($user->lang['COMMA_SEPARATOR'], $address_list[$row['msg_id']]), 'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $row['message_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '', )); } diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index 3e029c86d0..1e2074b1b1 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -334,7 +334,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base // throw an error if we shall not ignore unexistant words else if (!$ignore_no_id && sizeof($non_common_words)) { - trigger_error(sprintf($user->lang['WORDS_IN_NO_POST'], implode(', ', $non_common_words))); + trigger_error(sprintf($user->lang['WORDS_IN_NO_POST'], implode($user->lang['COMMA_SEPARATOR'], $non_common_words))); } unset($non_common_words); } diff --git a/phpBB/index.php b/phpBB/index.php index 2118a39b5d..c13f3c06ab 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -157,7 +157,7 @@ $template->assign_vars(array( 'NEWEST_USER' => $user->lang('NEWEST_USER', get_username_string('full', $config['newest_user_id'], $config['newest_username'], $config['newest_user_colour'])), 'LEGEND' => $legend, - 'BIRTHDAY_LIST' => (empty($birthday_list)) ? '' : implode(', ', $birthday_list), + 'BIRTHDAY_LIST' => (empty($birthday_list)) ? '' : implode($user->lang['COMMA_SEPARATOR'], $birthday_list), 'FORUM_IMG' => $user->img('forum_read', 'NO_UNREAD_POSTS'), 'FORUM_UNREAD_IMG' => $user->img('forum_unread', 'UNREAD_POSTS'), From 10172887fd47e86eefbabd6f5e755cd93279960d Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 17 Jul 2012 18:48:10 +0200 Subject: [PATCH 30/39] [ticket/10965] Introduce a new profile field option to display no value By default the 3.0.10 behaviour is kept, profile fields will not show up if they have either not yet been selected or in case of an optional dropdown field if the novalue option was selected. PHPBB3-10965 --- phpBB/adm/style/acp_profile.html | 4 +++ phpBB/develop/create_schema_files.php | 1 + phpBB/includes/acp/acp_profile.php | 6 +++- phpBB/includes/functions_profile_fields.php | 31 +++++++++++++-------- phpBB/install/database_update.php | 8 ++++++ phpBB/install/schemas/firebird_schema.sql | 1 + phpBB/install/schemas/mssql_schema.sql | 1 + phpBB/install/schemas/mysql_40_schema.sql | 1 + phpBB/install/schemas/mysql_41_schema.sql | 1 + phpBB/install/schemas/oracle_schema.sql | 1 + phpBB/install/schemas/postgres_schema.sql | 1 + phpBB/install/schemas/sqlite_schema.sql | 1 + phpBB/language/en/acp/profile.php | 2 ++ 13 files changed, 46 insertions(+), 13 deletions(-) diff --git a/phpBB/adm/style/acp_profile.html b/phpBB/adm/style/acp_profile.html index 85d37568c2..1c9c038f8f 100644 --- a/phpBB/adm/style/acp_profile.html +++ b/phpBB/adm/style/acp_profile.html @@ -63,6 +63,10 @@

{L_REQUIRED_FIELD_EXPLAIN}
checked="checked" />
+
+

{L_SHOW_NOVALUE_FIELD_EXPLAIN}
+
checked="checked" />
+

{L_HIDE_PROFILE_FIELD_EXPLAIN}
checked="checked" />
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index d44efb8870..496ac22e90 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1448,6 +1448,7 @@ function get_schema_struct() 'field_default_value' => array('VCHAR_UNI', ''), 'field_validation' => array('VCHAR_UNI:20', ''), 'field_required' => array('BOOL', 0), + 'field_show_novalue' => array('BOOL', 0), 'field_show_on_reg' => array('BOOL', 0), 'field_show_on_vt' => array('BOOL', 0), 'field_show_profile' => array('BOOL', 0), diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index a591474fce..19223847f0 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -365,6 +365,7 @@ class acp_profile $field_row = array_merge($default_values[$field_type], array( 'field_ident' => str_replace(' ', '_', utf8_clean_string(request_var('field_ident', '', true))), 'field_required' => 0, + 'field_show_novalue'=> 0, 'field_hide' => 0, 'field_show_profile'=> 0, 'field_no_view' => 0, @@ -380,7 +381,7 @@ class acp_profile // $exclude contains the data we gather in each step $exclude = array( - 1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_show_on_vt', 'field_required', 'field_hide', 'field_show_profile', 'field_no_view'), + 1 => array('field_ident', 'lang_name', 'lang_explain', 'field_option_none', 'field_show_on_reg', 'field_show_on_vt', 'field_required', 'field_show_novalue', 'field_hide', 'field_show_profile', 'field_no_view'), 2 => array('field_length', 'field_maxlen', 'field_minlen', 'field_validation', 'field_novalue', 'field_default_value'), 3 => array('l_lang_name', 'l_lang_explain', 'l_lang_default_value', 'l_lang_options') ); @@ -405,6 +406,7 @@ class acp_profile // Visibility Options... $visibility_ary = array( 'field_required', + 'field_show_novalue', 'field_show_on_reg', 'field_show_on_vt', 'field_show_profile', @@ -757,6 +759,7 @@ class acp_profile $template->assign_vars(array( 'S_STEP_ONE' => true, 'S_FIELD_REQUIRED' => ($cp->vars['field_required']) ? true : false, + 'S_FIELD_SHOW_NOVALUE'=> ($cp->vars['field_show_novalue']) ? true : false, 'S_SHOW_ON_REG' => ($cp->vars['field_show_on_reg']) ? true : false, 'S_SHOW_ON_VT' => ($cp->vars['field_show_on_vt']) ? true : false, 'S_FIELD_HIDE' => ($cp->vars['field_hide']) ? true : false, @@ -1073,6 +1076,7 @@ class acp_profile 'field_default_value' => $cp->vars['field_default_value'], 'field_validation' => $cp->vars['field_validation'], 'field_required' => $cp->vars['field_required'], + 'field_show_novalue' => $cp->vars['field_show_novalue'], 'field_show_on_reg' => $cp->vars['field_show_on_reg'], 'field_show_on_vt' => $cp->vars['field_show_on_vt'], 'field_hide' => $cp->vars['field_hide'], diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index 16c193c15a..5391b781fa 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -122,7 +122,7 @@ class custom_profile case FIELD_BOOL: $field_value = (bool) $field_value; - + if (!$field_value && $field_data['field_required']) { return 'FIELD_REQUIRED'; @@ -134,7 +134,7 @@ class custom_profile { return false; } - + $field_value = (int) $field_value; if ($field_value < $field_data['field_minlen']) @@ -521,7 +521,7 @@ class custom_profile switch ($this->profile_types[$field_type]) { case 'int': - if ($value === '') + if ($value === '' && !$ident_ary['data']['field_show_novalue']) { return NULL; } @@ -530,7 +530,7 @@ class custom_profile case 'string': case 'text': - if (!$value) + if (!$value && !$ident_ary['data']['field_show_novalue']) { return NULL; } @@ -548,7 +548,7 @@ class custom_profile $month = (isset($date[1])) ? (int) $date[1] : 0; $year = (isset($date[2])) ? (int) $date[2] : 0; - if (!$day && !$month && !$year) + if (!$day && !$month && !$year && !$ident_ary['data']['field_show_novalue']) { return NULL; } @@ -571,12 +571,7 @@ 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']) + if ($value == $ident_ary['data']['field_novalue'] && !$ident_ary['data']['field_show_novalue']) { return NULL; } @@ -586,7 +581,14 @@ class custom_profile // User not having a value assigned if (!isset($this->options_lang[$field_id][$lang_id][$value])) { - return NULL; + if ($ident_ary['data']['field_show_novalue']) + { + $value = $ident_ary['data']['field_novalue']; + } + else + { + return NULL; + } } return $this->options_lang[$field_id][$lang_id][$value]; @@ -600,6 +602,11 @@ class custom_profile $this->get_option_lang($field_id, $lang_id, FIELD_BOOL, false); } + if (!$value && $ident_ary['data']['field_show_novalue']) + { + $value = $ident_ary['data']['field_default_value']; + } + if ($ident_ary['data']['field_length'] == 1) { return (isset($this->options_lang[$field_id][$lang_id][(int) $value])) ? $this->options_lang[$field_id][$lang_id][(int) $value] : NULL; diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index c1fe144c62..2901bc76ee 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -995,6 +995,14 @@ function database_update_info() '3.0.10-RC3' => array(), // No changes from 3.0.10 to 3.0.11-RC1 '3.0.10' => array(), + // Changes from 3.0.11-RC1 to 3.0.11-RC2 + '3.0.5' => array( + 'add_columns' => array( + PROFILE_FIELDS_TABLE => array( + 'field_show_novalue' => array('BOOL', 0), + ), + ), + ), /** @todo DROP LOGIN_ATTEMPT_TABLE.attempt_id in 3.0.12-RC1 */ ); diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql index 73052f0a22..eae692f529 100644 --- a/phpBB/install/schemas/firebird_schema.sql +++ b/phpBB/install/schemas/firebird_schema.sql @@ -807,6 +807,7 @@ CREATE TABLE phpbb_profile_fields ( field_default_value VARCHAR(255) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, field_validation VARCHAR(20) CHARACTER SET UTF8 DEFAULT '' NOT NULL COLLATE UNICODE, field_required INTEGER DEFAULT 0 NOT NULL, + field_show_novalue INTEGER DEFAULT 0 NOT NULL, field_show_on_reg INTEGER DEFAULT 0 NOT NULL, field_show_on_vt INTEGER DEFAULT 0 NOT NULL, field_show_profile INTEGER DEFAULT 0 NOT NULL, diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql index 8ed3ba7e12..0b2f8368de 100644 --- a/phpBB/install/schemas/mssql_schema.sql +++ b/phpBB/install/schemas/mssql_schema.sql @@ -974,6 +974,7 @@ CREATE TABLE [phpbb_profile_fields] ( [field_default_value] [varchar] (255) DEFAULT ('') NOT NULL , [field_validation] [varchar] (20) DEFAULT ('') NOT NULL , [field_required] [int] DEFAULT (0) NOT NULL , + [field_show_novalue] [int] DEFAULT (0) NOT NULL , [field_show_on_reg] [int] DEFAULT (0) NOT NULL , [field_show_on_vt] [int] DEFAULT (0) NOT NULL , [field_show_profile] [int] DEFAULT (0) NOT NULL , diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql index 42b7291d9d..969cbe0472 100644 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ b/phpBB/install/schemas/mysql_40_schema.sql @@ -571,6 +571,7 @@ CREATE TABLE phpbb_profile_fields ( field_default_value blob NOT NULL, field_validation varbinary(60) DEFAULT '' NOT NULL, field_required tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + field_show_novalue tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, field_show_on_vt tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, field_show_profile tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql index 7a6d0ae188..15d34894d8 100644 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ b/phpBB/install/schemas/mysql_41_schema.sql @@ -571,6 +571,7 @@ CREATE TABLE phpbb_profile_fields ( field_default_value varchar(255) DEFAULT '' NOT NULL, field_validation varchar(20) DEFAULT '' NOT NULL, field_required tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, + field_show_novalue tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, field_show_on_reg tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, field_show_on_vt tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, field_show_profile tinyint(1) UNSIGNED DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 6e7ec31efc..af7b2b60ec 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -1085,6 +1085,7 @@ CREATE TABLE phpbb_profile_fields ( field_default_value varchar2(765) DEFAULT '' , field_validation varchar2(60) DEFAULT '' , field_required number(1) DEFAULT '0' NOT NULL, + field_show_novalue number(1) DEFAULT '0' NOT NULL, field_show_on_reg number(1) DEFAULT '0' NOT NULL, field_show_on_vt number(1) DEFAULT '0' NOT NULL, field_show_profile number(1) DEFAULT '0' NOT NULL, diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index 38f167bc7b..0a05a7cd75 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -761,6 +761,7 @@ CREATE TABLE phpbb_profile_fields ( field_default_value varchar(255) DEFAULT '' NOT NULL, field_validation varchar(20) DEFAULT '' NOT NULL, field_required INT2 DEFAULT '0' NOT NULL CHECK (field_required >= 0), + field_show_novalue INT2 DEFAULT '0' NOT NULL CHECK (field_show_novalue >= 0), field_show_on_reg INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_reg >= 0), field_show_on_vt INT2 DEFAULT '0' NOT NULL CHECK (field_show_on_vt >= 0), field_show_profile INT2 DEFAULT '0' NOT NULL CHECK (field_show_profile >= 0), diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql index c0574244ca..be7faa4688 100644 --- a/phpBB/install/schemas/sqlite_schema.sql +++ b/phpBB/install/schemas/sqlite_schema.sql @@ -554,6 +554,7 @@ CREATE TABLE phpbb_profile_fields ( field_default_value varchar(255) NOT NULL DEFAULT '', field_validation varchar(20) NOT NULL DEFAULT '', field_required INTEGER UNSIGNED NOT NULL DEFAULT '0', + field_show_novalue INTEGER UNSIGNED NOT NULL DEFAULT '0', field_show_on_reg INTEGER UNSIGNED NOT NULL DEFAULT '0', field_show_on_vt INTEGER UNSIGNED NOT NULL DEFAULT '0', field_show_profile INTEGER UNSIGNED NOT NULL DEFAULT '0', diff --git a/phpBB/language/en/acp/profile.php b/phpBB/language/en/acp/profile.php index a25dcd174b..e193d9303c 100644 --- a/phpBB/language/en/acp/profile.php +++ b/phpBB/language/en/acp/profile.php @@ -131,6 +131,8 @@ $lang = array_merge($lang, array( 'SAVE' => 'Save', 'SECOND_OPTION' => 'Second option', + 'SHOW_NOVALUE_FIELD' => 'Show field if no value was selected', + 'SHOW_NOVALUE_FIELD_EXPLAIN' => 'Determines if the profile field should be displayed if no value was selected for optional fields or if no value has been selected yet for required fields.', 'STEP_1_EXPLAIN_CREATE' => 'Here you can enter the first basic parameters of your new profile field. This information is needed for the second step where you’ll be able to set remaining options and tweak your profile field further.', 'STEP_1_EXPLAIN_EDIT' => 'Here you can change the basic parameters of your profile field. The relevant options are re-calculated within the second step.', 'STEP_1_TITLE_CREATE' => 'Add profile field', From 19237f561396c9a2f096c9d01acc857fe92b89ba Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Tue, 17 Jul 2012 20:28:01 +0200 Subject: [PATCH 31/39] [ticket/10965] Database update was referring to 3.0.5 instead of 3.0.11-RC1 PHPBB3-10965 --- phpBB/install/database_update.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 2901bc76ee..c51286f25f 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -996,7 +996,7 @@ function database_update_info() // No changes from 3.0.10 to 3.0.11-RC1 '3.0.10' => array(), // Changes from 3.0.11-RC1 to 3.0.11-RC2 - '3.0.5' => array( + '3.0.11-RC1' => array( 'add_columns' => array( PROFILE_FIELDS_TABLE => array( 'field_show_novalue' => array('BOOL', 0), From 2f5692d4bbdf3e5a39d9a22b83354f5db9638fa8 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 23 Jul 2012 22:38:38 +0200 Subject: [PATCH 32/39] [ticket/10965] Make sure all profile fields are always grabbed on viewtopic PHPBB3-10965 --- phpBB/includes/functions_profile_fields.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index 5391b781fa..8a5571fcce 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -456,6 +456,8 @@ class custom_profile $user_fields = array(); + $user_ids = $user_id; + // Go through the fields in correct order foreach (array_keys($this->profile_cache) as $used_ident) { @@ -464,6 +466,12 @@ class custom_profile $user_fields[$user_id][$used_ident]['value'] = $row['pf_' . $used_ident]; $user_fields[$user_id][$used_ident]['data'] = $this->profile_cache[$used_ident]; } + + foreach ($user_ids as $user_id) + { + $user_fields[$user_id][$used_ident]['value'] = ''; + $user_fields[$user_id][$used_ident]['data'] = $this->profile_cache[$used_ident]; + } } return $user_fields; From 296fadfca463327752395ff2124e4a2c99cbacbe Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Mon, 23 Jul 2012 23:35:48 +0200 Subject: [PATCH 33/39] [ticket/10965] Profile data is only grabbed when show_novalue is enabled PHPBB3-10965 --- phpBB/includes/functions_profile_fields.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index 8a5571fcce..8573533c2c 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -469,8 +469,11 @@ class custom_profile foreach ($user_ids as $user_id) { - $user_fields[$user_id][$used_ident]['value'] = ''; - $user_fields[$user_id][$used_ident]['data'] = $this->profile_cache[$used_ident]; + if (!isset($user_fields[$user_id][$used_ident]) && $this->profile_cache[$used_ident]['field_show_novalue']) + { + $user_fields[$user_id][$used_ident]['value'] = ''; + $user_fields[$user_id][$used_ident]['data'] = $this->profile_cache[$used_ident]; + } } } From 9f073e4c75cbb214eca6a4342c8a1dfe9fd9b94c Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 23 Jul 2012 23:30:20 +0200 Subject: [PATCH 34/39] [prep-release-3.0.11] Bumping version number for 3.0.11-RC2. --- build/build.xml | 4 ++-- phpBB/includes/constants.php | 2 +- phpBB/install/database_update.php | 6 +++++- phpBB/install/schemas/schema_data.sql | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/build/build.xml b/build/build.xml index c1179015eb..a624050750 100644 --- a/build/build.xml +++ b/build/build.xml @@ -2,9 +2,9 @@ - + - + diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index 5b72d89795..f8296a8e84 100644 --- a/phpBB/includes/constants.php +++ b/phpBB/includes/constants.php @@ -25,7 +25,7 @@ if (!defined('IN_PHPBB')) */ // phpBB Version -define('PHPBB_VERSION', '3.0.11-RC1'); +define('PHPBB_VERSION', '3.0.11-RC2'); // QA-related // define('PHPBB_QA', 1); diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index c51286f25f..95b3401a7e 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -8,7 +8,7 @@ * */ -define('UPDATES_TO_VERSION', '3.0.11-RC1'); +define('UPDATES_TO_VERSION', '3.0.11-RC2'); // Enter any version to update from to test updates. The version within the db will not be updated. define('DEBUG_FROM_VERSION', false); @@ -2098,6 +2098,10 @@ function change_database_data(&$no_updates, $version) $no_updates = false; break; + + // No changes from 3.0.11-RC1 to 3.0.11-RC2 + case '3.0.11-RC1': + break; } } diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 99b8f7f96d..cdfb4edc66 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -246,7 +246,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page', INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.11-RC1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.11-RC2'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400'); From ece4a2edb7f098bb4f0db7d1e2b6d8d405260b13 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 23 Jul 2012 23:36:15 +0200 Subject: [PATCH 35/39] [prep-release-3.0.11] Update Changelog for 3.0.11-RC2 release. --- phpBB/docs/CHANGELOG.html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 71e28be9bc..4d44a88634 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -158,6 +158,14 @@
  • [PHPBB3-10890] - test_sql_fetchrow_returns_false_when_empty() fails on MSSQL and Oracle
  • [PHPBB3-10908] - No remote avatar size limit results in files limited only by PHP memory limit
  • [PHPBB3-10913] - Admin is logged out when accessing any url under adm/ without session id
  • +
  • [PHPBB3-10441] - Update to docs/README.html
  • +
  • [PHPBB3-10773] - ACP phpBB logo needs registered trademark symbol
  • +
  • [PHPBB3-10935] - Limit number of PM rules per user
  • +
  • [PHPBB3-10937] - Comment removal functions: Backward compatibility broken
  • +
  • [PHPBB3-10950] - Deleting user with undelivered PMs causes SQL error
  • +
  • [PHPBB3-10952] - includes/constants.php version number incorrect
  • +
  • [PHPBB3-10965] - Dropdown CPF now shows in profile when no value is selected
  • +
  • [PHPBB3-10978] - Typo in prosilvers ucp_groups_membership.html
  • Improvement

      @@ -188,6 +196,7 @@
    • [PHPBB3-10891] - Allow specifying test config file name via environment variable
    • [PHPBB3-10892] - Cosmetic improvements to RUNNING_TESTS.txt
    • [PHPBB3-10898] - Do not write ?> into config.php to avoid whitespace output
    • +
    • [PHPBB3-10925] - Clarify that SQLite3 is not supported for phpBB 3.0.x

    New Feature

      From eeb7b1bac31a623cae3a025c5f0f59a417b3b9b8 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Mon, 23 Jul 2012 17:08:40 -0700 Subject: [PATCH 36/39] [ticket/11025] Make last topic titles in forum list Bold This small style tweak will make the truncated last topic titles shown in the forum list BOLD for better visual impact. PHPBB3-11025 --- phpBB/styles/prosilver/template/forumlist_body.html | 2 +- phpBB/styles/subsilver2/template/forumlist_body.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html index 723c2ffeda..9b10f33ae3 100644 --- a/phpBB/styles/prosilver/template/forumlist_body.html +++ b/phpBB/styles/prosilver/template/forumlist_body.html @@ -51,7 +51,7 @@ {UNAPPROVED_IMG} {L_LAST_POST} - {forumrow.LAST_POST_SUBJECT_TRUNCATED}
      + {forumrow.LAST_POST_SUBJECT_TRUNCATED}
      {L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL} {LAST_POST_IMG}
      {forumrow.LAST_POST_TIME}{L_NO_POSTS}
        diff --git a/phpBB/styles/subsilver2/template/forumlist_body.html b/phpBB/styles/subsilver2/template/forumlist_body.html index b9a1102df0..95ed94070f 100644 --- a/phpBB/styles/subsilver2/template/forumlist_body.html +++ b/phpBB/styles/subsilver2/template/forumlist_body.html @@ -61,7 +61,7 @@
    -

    {forumrow.LAST_POST_SUBJECT_TRUNCATED}

    +

    {forumrow.LAST_POST_SUBJECT_TRUNCATED}

    {UNAPPROVED_IMG} {forumrow.LAST_POST_TIME}

    {forumrow.LAST_POSTER_FULL} From 8c337a260bf96d3d6f25973029579cc89abe67ae Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Mon, 23 Jul 2012 18:33:32 -0700 Subject: [PATCH 37/39] [ticket/11025] Replace with and/or class for semantic styling PHPBB3-11025 --- phpBB/styles/prosilver/template/forumlist_body.html | 2 +- phpBB/styles/prosilver/theme/links.css | 5 +++++ phpBB/styles/subsilver2/template/forumlist_body.html | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html index 9b10f33ae3..488658d806 100644 --- a/phpBB/styles/prosilver/template/forumlist_body.html +++ b/phpBB/styles/prosilver/template/forumlist_body.html @@ -51,7 +51,7 @@ {UNAPPROVED_IMG} {L_LAST_POST} - {forumrow.LAST_POST_SUBJECT_TRUNCATED}
    + {forumrow.LAST_POST_SUBJECT_TRUNCATED}
    {L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL} {LAST_POST_IMG}
    {forumrow.LAST_POST_TIME}{L_NO_POSTS}
      diff --git a/phpBB/styles/prosilver/theme/links.css b/phpBB/styles/prosilver/theme/links.css index 3cb6e928b5..886e2a13de 100644 --- a/phpBB/styles/prosilver/theme/links.css +++ b/phpBB/styles/prosilver/theme/links.css @@ -66,6 +66,11 @@ a.topictitle:hover { text-decoration: underline; } +a.lastsubject { + font-weight: bold; + text-decoration: none; +} + /* Post body links */ .postlink { text-decoration: none; diff --git a/phpBB/styles/subsilver2/template/forumlist_body.html b/phpBB/styles/subsilver2/template/forumlist_body.html index 95ed94070f..8e3c6b1f79 100644 --- a/phpBB/styles/subsilver2/template/forumlist_body.html +++ b/phpBB/styles/subsilver2/template/forumlist_body.html @@ -61,7 +61,7 @@

    -

    {forumrow.LAST_POST_SUBJECT_TRUNCATED}

    +

    {forumrow.LAST_POST_SUBJECT_TRUNCATED}

    {UNAPPROVED_IMG} {forumrow.LAST_POST_TIME}

    {forumrow.LAST_POSTER_FULL} From 4ff644890a9cf10abca784ffc8dc4b41a61aa79c Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Mon, 23 Jul 2012 18:43:28 -0700 Subject: [PATCH 38/39] [ticket/11025] Replace with and/or class for semantic styling in subsilver2 PHPBB3-11025 --- phpBB/styles/subsilver2/template/forumlist_body.html | 2 +- phpBB/styles/subsilver2/theme/stylesheet.css | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/phpBB/styles/subsilver2/template/forumlist_body.html b/phpBB/styles/subsilver2/template/forumlist_body.html index 8e3c6b1f79..521eaf3c16 100644 --- a/phpBB/styles/subsilver2/template/forumlist_body.html +++ b/phpBB/styles/subsilver2/template/forumlist_body.html @@ -61,7 +61,7 @@

    -

    {forumrow.LAST_POST_SUBJECT_TRUNCATED}

    +

    {forumrow.LAST_POST_SUBJECT_TRUNCATED}

    {UNAPPROVED_IMG} {forumrow.LAST_POST_TIME}

    {forumrow.LAST_POSTER_FULL} diff --git a/phpBB/styles/subsilver2/theme/stylesheet.css b/phpBB/styles/subsilver2/theme/stylesheet.css index 18d15a8d41..4bb9e6f9bf 100644 --- a/phpBB/styles/subsilver2/theme/stylesheet.css +++ b/phpBB/styles/subsilver2/theme/stylesheet.css @@ -422,6 +422,11 @@ a.topictitle:visited { text-decoration: none; } +a.lastsubject { + font-weight: bold; + text-decoration: none; +} + th a, th a:visited { color: #FFA34F !important; From edec4a492e20d71486574ab94b4141d2f355b6fd Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Mon, 23 Jul 2012 18:47:23 -0700 Subject: [PATCH 39/39] [ticket/11025] Add underline for hover to classes PHPBB3-11025 --- phpBB/styles/prosilver/theme/links.css | 4 ++++ phpBB/styles/subsilver2/theme/stylesheet.css | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/phpBB/styles/prosilver/theme/links.css b/phpBB/styles/prosilver/theme/links.css index 886e2a13de..66c3aed03e 100644 --- a/phpBB/styles/prosilver/theme/links.css +++ b/phpBB/styles/prosilver/theme/links.css @@ -71,6 +71,10 @@ a.lastsubject { text-decoration: none; } +a.lastsubject:hover { + text-decoration: underline; +} + /* Post body links */ .postlink { text-decoration: none; diff --git a/phpBB/styles/subsilver2/theme/stylesheet.css b/phpBB/styles/subsilver2/theme/stylesheet.css index 4bb9e6f9bf..9e258ea778 100644 --- a/phpBB/styles/subsilver2/theme/stylesheet.css +++ b/phpBB/styles/subsilver2/theme/stylesheet.css @@ -427,6 +427,10 @@ a.lastsubject { text-decoration: none; } +a.lastsubject:hover { + text-decoration: underline; +} + th a, th a:visited { color: #FFA34F !important;