From bcaf65d7cd951b9a453cac413c420cb418b42f8d Mon Sep 17 00:00:00 2001 From: Patrick Webster Date: Sat, 3 Sep 2011 17:26:36 -0500 Subject: [PATCH 001/279] [ticket/10349] Unit tests: Remove comments while loading schema files Perform the same operations that the installer does when preparing the schema files. These functions come straight from /includes/functions_install.php and /includes/functions_admin.php. PHPBB3-10349 --- ...phpbb_database_test_connection_manager.php | 59 ++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php index a7559e2183..78be831ecb 100644 --- a/tests/test_framework/phpbb_database_test_connection_manager.php +++ b/tests/test_framework/phpbb_database_test_connection_manager.php @@ -234,7 +234,12 @@ class phpbb_database_test_connection_manager } $filename = $directory . $schema . '_schema.sql'; - $sql = $this->split_sql(file_get_contents($filename)); + $remove_remarks = $this->dbms['COMMENTS']; + + $queries = file_get_contents($filename); + $this->$remove_remarks($queries); + + $sql = $this->split_sql($queries); foreach ($sql as $query) { @@ -279,6 +284,49 @@ class phpbb_database_test_connection_manager return $data; } + /** + * remove_remarks will strip the sql comment lines out of an uploaded sql file + */ + protected function remove_remarks(&$sql) + { + $sql = preg_replace('/\n{2,}/', "\n", preg_replace('/^#.*$/m', "\n", $sql)); + } + + /** + * remove_comments will strip the sql comment lines out of an uploaded sql file + * specifically for mssql and postgres type files in the install.... + */ + protected function remove_comments(&$output) + { + $lines = explode("\n", $output); + $output = ''; + + // try to keep mem. use down + $linecount = sizeof($lines); + + $in_comment = false; + for ($i = 0; $i < $linecount; $i++) + { + if (trim($lines[$i]) == '/*') + { + $in_comment = true; + } + + if (!$in_comment) + { + $output .= $lines[$i] . "\n"; + } + + if (trim($lines[$i]) == '*/') + { + $in_comment = false; + } + } + + unset($lines); + return $output; + } + /** * Map a phpBB dbms driver name to dbms data array */ @@ -289,46 +337,55 @@ class phpbb_database_test_connection_manager 'SCHEMA' => 'firebird', 'DELIM' => ';;', 'PDO' => 'firebird', + 'COMMENTS' => 'remove_remarks', ), 'mysqli' => array( 'SCHEMA' => 'mysql_41', 'DELIM' => ';', 'PDO' => 'mysql', + 'COMMENTS' => 'remove_remarks', ), 'mysql' => array( 'SCHEMA' => 'mysql', 'DELIM' => ';', 'PDO' => 'mysql', + 'COMMENTS' => 'remove_remarks', ), 'mssql' => array( 'SCHEMA' => 'mssql', 'DELIM' => 'GO', 'PDO' => 'odbc', + 'COMMENTS' => 'remove_comments', ), 'mssql_odbc'=> array( 'SCHEMA' => 'mssql', 'DELIM' => 'GO', 'PDO' => 'odbc', + 'COMMENTS' => 'remove_comments', ), 'mssqlnative' => array( 'SCHEMA' => 'mssql', 'DELIM' => 'GO', 'PDO' => 'sqlsrv', + 'COMMENTS' => 'remove_comments', ), 'oracle' => array( 'SCHEMA' => 'oracle', 'DELIM' => '/', 'PDO' => 'oci', + 'COMMENTS' => 'remove_comments', ), 'postgres' => array( 'SCHEMA' => 'postgres', 'DELIM' => ';', 'PDO' => 'pgsql', + 'COMMENTS' => 'remove_comments', ), 'sqlite' => array( 'SCHEMA' => 'sqlite', 'DELIM' => ';', 'PDO' => 'sqlite2', + 'COMMENTS' => 'remove_remarks', ), ); From 4bc11db0ffc3b387e4ad38b0d9ceccfa58f2738d Mon Sep 17 00:00:00 2001 From: Patrick Webster Date: Tue, 20 Sep 2011 23:23:03 -0500 Subject: [PATCH 002/279] [ticket/10349] Unit tests: Consolidate schema comment removal functions PHPBB3-10349 --- ...phpbb_database_test_connection_manager.php | 69 +++---------------- 1 file changed, 11 insertions(+), 58 deletions(-) diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php index 78be831ecb..547361b41d 100644 --- a/tests/test_framework/phpbb_database_test_connection_manager.php +++ b/tests/test_framework/phpbb_database_test_connection_manager.php @@ -234,12 +234,11 @@ class phpbb_database_test_connection_manager } $filename = $directory . $schema . '_schema.sql'; - $remove_remarks = $this->dbms['COMMENTS']; $queries = file_get_contents($filename); - $this->$remove_remarks($queries); + $sql = $this->remove_comments($queries); - $sql = $this->split_sql($queries); + $sql = $this->split_sql($sql); foreach ($sql as $query) { @@ -271,60 +270,23 @@ class phpbb_database_test_connection_manager unset($data[key($data)]); } - if ($this->config['dbms'] == 'sqlite') - { - // remove comment lines starting with # - they are not proper sqlite - // syntax and break sqlite2 - foreach ($data as $i => $query) - { - $data[$i] = preg_replace('/^#.*$/m', "\n", $query); - } - } - return $data; } /** - * remove_remarks will strip the sql comment lines out of an uploaded sql file + * Removes comments from schema files + * + * Note: This performs the functions of remove_remarks() and remove_comments() used during installation */ - protected function remove_remarks(&$sql) + protected function remove_comments($sql) { + // Remove /* */ comments (http://ostermiller.org/findcomment.html) + $sql = preg_replace('#/\*(.|[\r\n])*?\*/#', "\n", $sql); + + // Remove # style comments $sql = preg_replace('/\n{2,}/', "\n", preg_replace('/^#.*$/m', "\n", $sql)); - } - /** - * remove_comments will strip the sql comment lines out of an uploaded sql file - * specifically for mssql and postgres type files in the install.... - */ - protected function remove_comments(&$output) - { - $lines = explode("\n", $output); - $output = ''; - - // try to keep mem. use down - $linecount = sizeof($lines); - - $in_comment = false; - for ($i = 0; $i < $linecount; $i++) - { - if (trim($lines[$i]) == '/*') - { - $in_comment = true; - } - - if (!$in_comment) - { - $output .= $lines[$i] . "\n"; - } - - if (trim($lines[$i]) == '*/') - { - $in_comment = false; - } - } - - unset($lines); - return $output; + return $sql; } /** @@ -337,55 +299,46 @@ class phpbb_database_test_connection_manager 'SCHEMA' => 'firebird', 'DELIM' => ';;', 'PDO' => 'firebird', - 'COMMENTS' => 'remove_remarks', ), 'mysqli' => array( 'SCHEMA' => 'mysql_41', 'DELIM' => ';', 'PDO' => 'mysql', - 'COMMENTS' => 'remove_remarks', ), 'mysql' => array( 'SCHEMA' => 'mysql', 'DELIM' => ';', 'PDO' => 'mysql', - 'COMMENTS' => 'remove_remarks', ), 'mssql' => array( 'SCHEMA' => 'mssql', 'DELIM' => 'GO', 'PDO' => 'odbc', - 'COMMENTS' => 'remove_comments', ), 'mssql_odbc'=> array( 'SCHEMA' => 'mssql', 'DELIM' => 'GO', 'PDO' => 'odbc', - 'COMMENTS' => 'remove_comments', ), 'mssqlnative' => array( 'SCHEMA' => 'mssql', 'DELIM' => 'GO', 'PDO' => 'sqlsrv', - 'COMMENTS' => 'remove_comments', ), 'oracle' => array( 'SCHEMA' => 'oracle', 'DELIM' => '/', 'PDO' => 'oci', - 'COMMENTS' => 'remove_comments', ), 'postgres' => array( 'SCHEMA' => 'postgres', 'DELIM' => ';', 'PDO' => 'pgsql', - 'COMMENTS' => 'remove_comments', ), 'sqlite' => array( 'SCHEMA' => 'sqlite', 'DELIM' => ';', 'PDO' => 'sqlite2', - 'COMMENTS' => 'remove_remarks', ), ); From 26e84b12e817dd5e86a82c379a03a67f9f1bacd1 Mon Sep 17 00:00:00 2001 From: Patrick Webster Date: Wed, 28 Sep 2011 01:52:08 -0500 Subject: [PATCH 003/279] [ticket/10349] Use new schema comment function in installer This is what now runs in the unit tests. The COMMENTS field in the dbms data is no longer needed, so it has been removed. PHPBB3-10349 --- phpBB/includes/functions_admin.php | 35 ---------------------------- phpBB/includes/functions_install.php | 20 +++++++--------- phpBB/install/install_install.php | 6 ++--- 3 files changed, 11 insertions(+), 50 deletions(-) diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index f7e19f3e7d..0c83674054 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -2293,41 +2293,6 @@ function auto_prune($forum_id, $prune_mode, $prune_flags, $prune_days, $prune_fr return; } -/** -* remove_comments will strip the sql comment lines out of an uploaded sql file -* specifically for mssql and postgres type files in the install.... -*/ -function remove_comments(&$output) -{ - $lines = explode("\n", $output); - $output = ''; - - // try to keep mem. use down - $linecount = sizeof($lines); - - $in_comment = false; - for ($i = 0; $i < $linecount; $i++) - { - if (trim($lines[$i]) == '/*') - { - $in_comment = true; - } - - if (!$in_comment) - { - $output .= $lines[$i] . "\n"; - } - - if (trim($lines[$i]) == '*/') - { - $in_comment = false; - } - } - - unset($lines); - return $output; -} - /** * Cache moderators, called whenever permissions are changed via admin_permissions. Changes of username * and group names must be carried through for the moderators table diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index 992e8d6bb0..270fa0f0b3 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -50,7 +50,6 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20 'SCHEMA' => 'firebird', 'MODULE' => 'interbase', 'DELIM' => ';;', - 'COMMENTS' => 'remove_remarks', 'DRIVER' => 'firebird', 'AVAILABLE' => true, '2.0.x' => false, @@ -60,7 +59,6 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20 'SCHEMA' => 'mysql_41', 'MODULE' => 'mysqli', 'DELIM' => ';', - 'COMMENTS' => 'remove_remarks', 'DRIVER' => 'mysqli', 'AVAILABLE' => true, '2.0.x' => true, @@ -70,7 +68,6 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20 'SCHEMA' => 'mysql', 'MODULE' => 'mysql', 'DELIM' => ';', - 'COMMENTS' => 'remove_remarks', 'DRIVER' => 'mysql', 'AVAILABLE' => true, '2.0.x' => true, @@ -80,7 +77,6 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20 'SCHEMA' => 'mssql', 'MODULE' => 'mssql', 'DELIM' => 'GO', - 'COMMENTS' => 'remove_comments', 'DRIVER' => 'mssql', 'AVAILABLE' => true, '2.0.x' => true, @@ -90,7 +86,6 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20 'SCHEMA' => 'mssql', 'MODULE' => 'odbc', 'DELIM' => 'GO', - 'COMMENTS' => 'remove_comments', 'DRIVER' => 'mssql_odbc', 'AVAILABLE' => true, '2.0.x' => true, @@ -100,7 +95,6 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20 'SCHEMA' => 'mssql', 'MODULE' => 'sqlsrv', 'DELIM' => 'GO', - 'COMMENTS' => 'remove_comments', 'DRIVER' => 'mssqlnative', 'AVAILABLE' => true, '2.0.x' => false, @@ -110,7 +104,6 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20 'SCHEMA' => 'oracle', 'MODULE' => 'oci8', 'DELIM' => '/', - 'COMMENTS' => 'remove_comments', 'DRIVER' => 'oracle', 'AVAILABLE' => true, '2.0.x' => false, @@ -120,7 +113,6 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20 'SCHEMA' => 'postgres', 'MODULE' => 'pgsql', 'DELIM' => ';', - 'COMMENTS' => 'remove_comments', 'DRIVER' => 'postgres', 'AVAILABLE' => true, '2.0.x' => true, @@ -130,7 +122,6 @@ function get_available_dbms($dbms = false, $return_unavailable = false, $only_20 'SCHEMA' => 'sqlite', 'MODULE' => 'sqlite', 'DELIM' => ';', - 'COMMENTS' => 'remove_remarks', 'DRIVER' => 'sqlite', 'AVAILABLE' => true, '2.0.x' => false, @@ -514,11 +505,18 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix, } /** -* remove_remarks will strip the sql comment lines out of an uploaded sql file +* Removes comments from schema files +* */ -function remove_remarks(&$sql) +function remove_comments($sql) { + // Remove /* */ comments (http://ostermiller.org/findcomment.html) + $sql = preg_replace('#/\*(.|[\r\n])*?\*/#', "\n", $sql); + + // Remove # style comments $sql = preg_replace('/\n{2,}/', "\n", preg_replace('/^#.*$/m', "\n", $sql)); + + return $sql; } /** diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 9fe0c8aed5..9b37ee2be3 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -1173,14 +1173,13 @@ class install_install extends module $dbms_schema = 'schemas/' . $available_dbms[$data['dbms']]['SCHEMA'] . '_schema.sql'; // How should we treat this schema? - $remove_remarks = $available_dbms[$data['dbms']]['COMMENTS']; $delimiter = $available_dbms[$data['dbms']]['DELIM']; $sql_query = @file_get_contents($dbms_schema); $sql_query = preg_replace('#phpbb_#i', $data['table_prefix'], $sql_query); - $remove_remarks($sql_query); + $sql_query = remove_comments($sql_query); $sql_query = split_sql_file($sql_query, $delimiter); @@ -1218,8 +1217,7 @@ class install_install extends module // Change language strings... $sql_query = preg_replace_callback('#\{L_([A-Z0-9\-_]*)\}#s', 'adjust_language_keys_callback', $sql_query); - // Since there is only one schema file we know the comment style and are able to remove it directly with remove_remarks - remove_remarks($sql_query); + $sql_query = remove_comments($sql_query); $sql_query = split_sql_file($sql_query, ';'); foreach ($sql_query as $sql) From b4dcd4193e7ea52753eb3957bb247b768dc48d12 Mon Sep 17 00:00:00 2001 From: Patrick Webster Date: Wed, 28 Sep 2011 11:27:39 -0500 Subject: [PATCH 004/279] [ticket/10349] Update function comment PHPBB3-10349 --- tests/test_framework/phpbb_database_test_connection_manager.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php index 547361b41d..5feab16496 100644 --- a/tests/test_framework/phpbb_database_test_connection_manager.php +++ b/tests/test_framework/phpbb_database_test_connection_manager.php @@ -275,8 +275,6 @@ class phpbb_database_test_connection_manager /** * Removes comments from schema files - * - * Note: This performs the functions of remove_remarks() and remove_comments() used during installation */ protected function remove_comments($sql) { From baac9e5d150dab88ed6f1eca8ca61bc4468ab01c Mon Sep 17 00:00:00 2001 From: Patrick Webster Date: Sat, 29 Oct 2011 17:10:10 -0500 Subject: [PATCH 005/279] [ticket/10349] Removed duplicated functions from schema loading in tests PHPBB3-10349 --- phpBB/includes/functions_install.php | 1 - ...phpbb_database_test_connection_manager.php | 47 ++----------------- 2 files changed, 4 insertions(+), 44 deletions(-) diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php index 270fa0f0b3..6438f35ccc 100644 --- a/phpBB/includes/functions_install.php +++ b/phpBB/includes/functions_install.php @@ -506,7 +506,6 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix, /** * Removes comments from schema files -* */ function remove_comments($sql) { diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php index 5feab16496..770cc84d7e 100644 --- a/tests/test_framework/phpbb_database_test_connection_manager.php +++ b/tests/test_framework/phpbb_database_test_connection_manager.php @@ -7,6 +7,8 @@ * */ +require_once dirname(__FILE__) . '/../../phpBB/includes/functions_install.php'; + class phpbb_database_test_connection_manager { private $config; @@ -236,9 +238,9 @@ class phpbb_database_test_connection_manager $filename = $directory . $schema . '_schema.sql'; $queries = file_get_contents($filename); - $sql = $this->remove_comments($queries); + $sql = remove_comments($queries); - $sql = $this->split_sql($sql); + $sql = split_sql_file($sql, $this->dbms['DELIM']); foreach ($sql as $query) { @@ -246,47 +248,6 @@ class phpbb_database_test_connection_manager } } - /** - * Split contents of an SQL file into an array of SQL statements - * - * Note: This method is not the same as split_sql_file from functions_install. - * - * @param string $sql Raw contents of an SQL file - * - * @return Array of runnable SQL statements - */ - protected function split_sql($sql) - { - $sql = str_replace("\r" , '', $sql); - $data = preg_split('/' . preg_quote($this->dbms['DELIM'], '/') . '$/m', $sql); - - $data = array_map('trim', $data); - - // The empty case - $end_data = end($data); - - if (empty($end_data)) - { - unset($data[key($data)]); - } - - return $data; - } - - /** - * Removes comments from schema files - */ - protected function remove_comments($sql) - { - // Remove /* */ comments (http://ostermiller.org/findcomment.html) - $sql = preg_replace('#/\*(.|[\r\n])*?\*/#', "\n", $sql); - - // Remove # style comments - $sql = preg_replace('/\n{2,}/', "\n", preg_replace('/^#.*$/m', "\n", $sql)); - - return $sql; - } - /** * Map a phpBB dbms driver name to dbms data array */ From bb40789552d1620d0281df8a41a020f826ca8739 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 30 Oct 2011 12:46:10 +0100 Subject: [PATCH 006/279] [ticket/10434] Add script for creating search index from CLI. PHPBB3-10434 --- phpBB/develop/create_search_index.php | 137 ++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 phpBB/develop/create_search_index.php diff --git a/phpBB/develop/create_search_index.php b/phpBB/develop/create_search_index.php new file mode 100644 index 0000000000..374a4cf0a1 --- /dev/null +++ b/phpBB/develop/create_search_index.php @@ -0,0 +1,137 @@ +session_begin(); +$auth->acl($user->data); +$user->setup('acp/search'); + +$search_name = ucfirst(strtolower(str_replace('_', ' ', $class_name))); +$search_errors = array(); +$search = new $class_name($search_errors); + +$batch_size = isset($argv[2]) ? $argv[2] : 2000; +$time = time(); + +if (method_exists($search, 'create_index')) +{ + if ($error = $search->create_index(null, '')) + { + var_dump($error); + exit(1); + } +} +else +{ + $sql = 'SELECT forum_id, enable_indexing + FROM ' . FORUMS_TABLE; + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + $forums[$row['forum_id']] = (bool) $row['enable_indexing']; + } + $db->sql_freeresult($result); + + $sql = 'SELECT post_id + FROM ' . POSTS_TABLE . ' + ORDER BY post_id DESC'; + $result = $db->sql_query_limit($sql, 1); + $max_post_id = (int) $db->sql_fetchfield('post_id'); + + $post_counter = 0; + while ($post_counter <= $max_post_id) + { + $row_count = 0; + + printf("Processing posts with %d <= post_id <= %d\n", + $post_counter + 1, + $post_counter + $batch_size + ); + + $sql = 'SELECT post_id, post_subject, post_text, poster_id, forum_id + FROM ' . POSTS_TABLE . ' + WHERE post_id >= ' . (int) ($post_counter + 1) . ' + AND post_id <= ' . (int) ($post_counter + $batch_size); + $result = $db->sql_query($sql); + + $buffer = $db->sql_buffer_nested_transactions(); + + if ($buffer) + { + $rows = $db->sql_fetchrowset($result); + $rows[] = false; // indicate end of array for while loop below + + $db->sql_freeresult($result); + } + + $i = 0; + while ($row = ($buffer ? $rows[$i++] : $db->sql_fetchrow($result))) + { + // Indexing enabled for this forum or global announcement? + // Global announcements get indexed by default. + if (!$row['forum_id'] || !empty($forums[$row['forum_id']])) + { + ++$row_count; + + $search->index('post', + $row['post_id'], + $row['post_text'], + $row['post_subject'], + $row['poster_id'], + $row['forum_id'] + ); + + if ($row_count % 10 == 0) + { + echo '.'; + } + } + } + + $delta = (time() - $time); + $delta = $delta <= 0 ? 1 : $delta; + printf(" %d posts/sec\n", $row_count / $delta); + + if (!$buffer) + { + $db->sql_freeresult($result); + } + + $post_counter += $batch_size; + } +} + +$search->tidy(); + +add_log('admin', 'LOG_SEARCH_INDEX_CREATED', $search_name); + +echo $user->lang['SEARCH_INDEX_CREATED'] . "\n"; +echo 'Peak Memory Usage: ' . get_formatted_filesize(memory_get_peak_usage()) . "\n"; + +exit(0); From 65921ae67a98fa1aa9010ffd433e6420dd224e81 Mon Sep 17 00:00:00 2001 From: Raimon Date: Sun, 13 Nov 2011 20:10:51 +0100 Subject: [PATCH 007/279] [ticket/10453] PM viewmessage page is misplacing the online icon PHPBB3-10453 http://tracker.phpbb.com/browse/PHPBB3-10453 --- .../template/ucp_pm_message_header.html | 29 +++++++++---------- .../prosilver/template/ucp_pm_viewfolder.html | 1 - .../template/ucp_pm_viewmessage.html | 11 ++++--- phpBB/styles/prosilver/theme/colours.css | 6 ---- phpBB/styles/prosilver/theme/cp.css | 27 ++--------------- 5 files changed, 24 insertions(+), 50 deletions(-) diff --git a/phpBB/styles/prosilver/template/ucp_pm_message_header.html b/phpBB/styles/prosilver/template/ucp_pm_message_header.html index fcebab0868..a1017d4b44 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_message_header.html +++ b/phpBB/styles/prosilver/template/ucp_pm_message_header.html @@ -1,25 +1,28 @@

{L_TITLE}: {CUR_FOLDER_NAME}

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

{FOLDER_STATUS}

- - - diff --git a/phpBB/styles/prosilver/theme/bidi.css b/phpBB/styles/prosilver/theme/bidi.css index f441784d85..c4a46b432c 100644 --- a/phpBB/styles/prosilver/theme/bidi.css +++ b/phpBB/styles/prosilver/theme/bidi.css @@ -591,6 +591,19 @@ /* PM Styles ----------------------------------------*/ +/* PM panel adjustments */ +.rtl .reply-all a.right { + background-position: 5% 60%; +} + +.rtl .reply-all a.right:hover { + background-position: 3% 60%; +} + +.rtl .reply-all { + padding-left: 5px; +} + /* Defined rules list for PM options */ .rtl ol.def-rules { padding-right: 0; diff --git a/phpBB/styles/prosilver/theme/cp.css b/phpBB/styles/prosilver/theme/cp.css index 9d04371115..6f45d13cef 100644 --- a/phpBB/styles/prosilver/theme/cp.css +++ b/phpBB/styles/prosilver/theme/cp.css @@ -349,10 +349,17 @@ dl.mini dd { } /* PM panel adjustments */ +.reply-all a.left { + background-position: 3px 60%; +} + +.reply-all a.left:hover { + background-position: 0px 60%; +} + .reply-all { - margin-bottom: -60px; - position: absolute; - margin-left: 200px; + font-size: 11px; + padding-top: 5px; } /* PM Message history */ From a9d7b1f9a144a6354638e6ef30e42cec2463f1b8 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 21 Nov 2011 00:57:53 +0100 Subject: [PATCH 009/279] [develop-olympus] Increment version number to 3.0.11-dev in develop-olympus. --- phpBB/includes/constants.php | 2 +- phpBB/install/database_update.php | 2 +- phpBB/install/schemas/schema_data.sql | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php index ec7b8c7123..a0444ea594 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.10-RC1'); +define('PHPBB_VERSION', '3.0.11-dev'); // QA-related // define('PHPBB_QA', 1); diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 9ca011c8aa..1d96f40fdf 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -8,7 +8,7 @@ * */ -define('UPDATES_TO_VERSION', '3.0.10-RC1'); +define('UPDATES_TO_VERSION', '3.0.11-dev'); // Enter any version to update from to test updates. The version within the db will not be updated. define('DEBUG_FROM_VERSION', false); diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 4f5bf23c58..fcc372ae93 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.10-RC1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.0.11-dev'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400'); From 3ce5b1d3867b4276985dde78d5a3d021f26ca2a7 Mon Sep 17 00:00:00 2001 From: RMcGirr83 Date: Sat, 16 Jul 2011 08:22:29 -0400 Subject: [PATCH 010/279] [ticket/10280] Change the display of user activation settings in the ACP. Use a select box to be consistent with other settings. PHPBB3-10280 --- phpBB/includes/acp/acp_board.php | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 3ed5f40368..8c761e51fe 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -234,7 +234,7 @@ class acp_board 'max_name_chars' => array('lang' => 'USERNAME_LENGTH', 'validate' => 'int:8:180', 'type' => false, 'method' => false, 'explain' => false,), 'max_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:8:255', 'type' => false, 'method' => false, 'explain' => false,), - 'require_activation' => array('lang' => 'ACC_ACTIVATION', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_acc_activation', 'explain' => true), + 'require_activation' => array('lang' => 'ACC_ACTIVATION', 'validate' => 'int', 'type' => 'select', 'method' => 'select_acc_activation', 'explain' => true), 'new_member_post_limit' => array('lang' => 'NEW_MEMBER_POST_LIMIT', 'validate' => 'int:0:255', 'type' => 'text:4:4', 'explain' => true, 'append' => ' ' . $user->lang['POSTS']), 'new_member_group_default'=> array('lang' => 'NEW_MEMBER_GROUP_DEFAULT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'min_name_chars' => array('lang' => 'USERNAME_LENGTH', 'validate' => 'int:1', 'type' => 'custom:5:180', 'method' => 'username_length', 'explain' => true), @@ -768,24 +768,28 @@ class acp_board /** * Select account activation method */ - function select_acc_activation($value, $key = '') + function select_acc_activation($selected_value, $value) { global $user, $config; - $radio_ary = array( - USER_ACTIVATION_DISABLE => 'ACC_DISABLE', - USER_ACTIVATION_NONE => 'ACC_NONE', + $act_ary = array( + 'ACC_DISABLE' => USER_ACTIVATION_DISABLE, + 'ACC_NONE' => USER_ACTIVATION_NONE, ); - if ($config['email_enable']) { - $radio_ary[USER_ACTIVATION_SELF] = 'ACC_USER'; - $radio_ary[USER_ACTIVATION_ADMIN] = 'ACC_ADMIN'; + $act_ary['ACC_USER'] = USER_ACTIVATION_SELF; + $act_ary['ACC_ADMIN'] = USER_ACTIVATION_ADMIN; + } + $act_options = ''; + + foreach ($act_ary as $key => $value) + { + $selected = ($selected_value == $value) ? ' selected="selected"' : ''; + $act_options .= ''; } - $radio_text = h_radio('config[require_activation]', $radio_ary, $value, 'require_activation', $key, '
'); - - return $radio_text; + return $act_options; } /** From 0cb83f99abd67c33fecc511b2e7ac6a49acf058d Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sat, 26 Nov 2011 17:32:40 -0500 Subject: [PATCH 011/279] [ticket/10093] Document phpbb.hooks.commit-msg.fatal setting. PHPBB3-10093 --- git-tools/hooks/commit-msg | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/git-tools/hooks/commit-msg b/git-tools/hooks/commit-msg index 4f6ae71d4b..03a602c16c 100755 --- a/git-tools/hooks/commit-msg +++ b/git-tools/hooks/commit-msg @@ -11,6 +11,11 @@ # # ln -s ../../git-tools/hooks/commit-msg \\ # .git/hooks/commit-msg +# +# You can configure whether invalid commit messages abort commits: +# +# git config phpbb.hooks.commit-msg.fatal true (abort, this is the default) +# git config phpbb.hooks.commit-msg.fatal false (warn only, do not abort) config_ns="phpbb.hooks.commit-msg"; From 26d01d4408a25d70e2bbe32992a1c348ddefff04 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sat, 26 Nov 2011 17:35:10 -0500 Subject: [PATCH 012/279] [ticket/10093] Respect phpbb.hooks.commit-msg.fatal on syntax errors. PHPBB3-10093 --- git-tools/hooks/commit-msg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-tools/hooks/commit-msg b/git-tools/hooks/commit-msg index 03a602c16c..39d5bb3350 100755 --- a/git-tools/hooks/commit-msg +++ b/git-tools/hooks/commit-msg @@ -254,7 +254,7 @@ do echo ">> $line" >&2; echo -n "Expecting: " >&2; echo "$expecting" | sed 's/ /, /g' >&2; - exit $err; + quit $err; fi i=$(( $i + 1 )); From 6a3ee0996e1b4faf765d72e7249f505fafd5812d Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sat, 26 Nov 2011 17:41:25 -0500 Subject: [PATCH 013/279] [ticket/10093] Refactor complaining in commit-msg hook for color support. PHPBB3-10093 --- git-tools/hooks/commit-msg | 39 +++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/git-tools/hooks/commit-msg b/git-tools/hooks/commit-msg index 39d5bb3350..5c51127dcc 100755 --- a/git-tools/hooks/commit-msg +++ b/git-tools/hooks/commit-msg @@ -60,6 +60,11 @@ quit() fi } +complain() +{ + echo "$@" +} + # Check for empty commit message if ! grep -qv '^#' "$1" then @@ -75,9 +80,9 @@ msg=$(grep -v '^#' "$1" |grep -nE '.{81,}') if [ $? -eq 0 ] then - echo "The following lines are greater than 80 characters long:" >&2; - echo >&2 - echo "$msg" >&2; + complain "The following lines are greater than 80 characters long:" >&2; + complain >&2 + complain "$msg" >&2; quit $ERR_LENGTH; fi @@ -131,9 +136,9 @@ do # Don't be too strict. # Commits may be temporary, intended to be squashed later. # Just issue a warning here. - echo "Warning: heading should be a sentence beginning with a capital letter." 1>&2 - echo "You entered:" 1>&2 - echo "$line" 1>&2 + complain "Warning: heading should be a sentence beginning with a capital letter." 1>&2 + complain "You entered:" 1>&2 + complain "$line" 1>&2 fi # restore exit code (exit $result) @@ -165,7 +170,7 @@ do echo "$line" | grep -Eq "^#"; ;; *) - echo "Unrecognised token $expect" >&2; + complain "Unrecognised token $expect" >&2; quit $err; ;; esac @@ -236,7 +241,7 @@ do expecting="eof"; ;; *) - echo "Unrecognised token $expect" >&2; + complain "Unrecognised token $expect" >&2; quit 254; ;; esac @@ -250,10 +255,10 @@ do else # None of the expected line formats matched # Guess we'll call it a day here then - echo "Syntax error on line $i:" >&2; - echo ">> $line" >&2; - echo -n "Expecting: " >&2; - echo "$expecting" | sed 's/ /, /g' >&2; + complain "Syntax error on line $i:" >&2; + complain ">> $line" >&2; + complain -n "Expecting: " >&2; + complain "$expecting" | sed 's/ /, /g' >&2; quit $err; fi @@ -263,7 +268,7 @@ done # If EOF is expected exit cleanly echo "$expecting" | grep -q "eof" || ( # Unexpected EOF, error - echo "Unexpected EOF encountered" >&2; + complain "Unexpected EOF encountered" >&2; quit $ERR_EOF; ) && ( # Do post scan checks @@ -274,8 +279,8 @@ echo "$expecting" | grep -q "eof" || ( if [ ! -z "$dupes" ] then - echo "The following tickets are repeated:" >&2; - echo "$dupes" | sed 's/ /\n/g;s/^/* /g' >&2; + complain "The following tickets are repeated:" >&2; + complain "$dupes" | sed 's/ /\n/g;s/^/* /g' >&2; quit $ERR_FOOTER; fi fi @@ -283,8 +288,8 @@ echo "$expecting" | grep -q "eof" || ( if [ $ticket -gt 0 ] then echo "$tickets" | grep -Eq "\bPHPBB3-$ticket\b" || ( - echo "Ticket ID [$ticket] of branch missing from list of tickets:" >&2; - echo "$tickets" | sed 's/ /\n/g;s/^/* /g' >&2; + complain "Ticket ID [$ticket] of branch missing from list of tickets:" >&2; + complain "$tickets" | sed 's/ /\n/g;s/^/* /g' >&2; quit $ERR_FOOTER; ) || exit $?; fi From 92cdf08d48cba4eac30708ab089aae917db13970 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sat, 26 Nov 2011 18:04:03 -0500 Subject: [PATCH 014/279] [ticket/10093] Use color in commit-msg hook warning/error messages. By default color is used if the message is printed to a tty, phpbb.hooks.commit-msg.color configuration setting can override this. PHPBB3-10093 --- git-tools/hooks/commit-msg | 51 +++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/git-tools/hooks/commit-msg b/git-tools/hooks/commit-msg index 5c51127dcc..959c4e3979 100755 --- a/git-tools/hooks/commit-msg +++ b/git-tools/hooks/commit-msg @@ -16,6 +16,13 @@ # # git config phpbb.hooks.commit-msg.fatal true (abort, this is the default) # git config phpbb.hooks.commit-msg.fatal false (warn only, do not abort) +# +# Warning/error messages use color by default if the output is a terminal +# ("output" here is normally standard error when you run git commit). +# To force or disable the use of color: +# +# git config phpbb.hooks.commit-msg.color true (force color output) +# git config phpbb.hooks.commit-msg.color false (disable color output) config_ns="phpbb.hooks.commit-msg"; @@ -60,9 +67,51 @@ quit() fi } +use_color() +{ + if [ -z "$use_color_cached" ] + then + case $(git config --bool $config_ns.color) + in + false) + use_color_cached=1 + ;; + true) + use_color_cached=0 + ;; + *) + # tty detection in shell: + # http://hwi.ath.cx/jsh/list/shext/isatty.sh.html + tty 0>/dev/stdout >/dev/null 2>&1 + use_color_cached=$? + ;; + esac + fi + # return value is the flag inverted - + # if return value is 0, this means use color + return $use_color_cached +} + complain() { - echo "$@" + if use_color + then + # Careful: our argument may include arguments to echo like -n + # ANSI color codes: + # http://pueblo.sourceforge.net/doc/manual/ansi_color_codes.html + printf "\033[31m\033[1m" + if [ "$1" = "-n" ] + then + echo "$@" + printf "\033[10m" + else + # This will print one trailing space. + # Not sure how to avoid this at the moment. + echo "$@" $(printf "\033[10m") + fi + else + echo "$@" + fi } # Check for empty commit message From 74ae7d03391c4a836364a3e63881f6079837a8e4 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Thu, 1 Dec 2011 01:46:33 +0200 Subject: [PATCH 015/279] [ticket/10399] Correctly encoding template component urls (3.0) Correctly encoding template component urls PHPBB3-10399 --- phpBB/includes/functions.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index c2b099d48a..98a2b3028b 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -4612,11 +4612,11 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0 'S_SEARCH_HIDDEN_FIELDS' => build_hidden_fields($s_search_hidden_fields), - 'T_THEME_PATH' => "{$web_path}styles/" . $user->theme['theme_path'] . '/theme', - 'T_TEMPLATE_PATH' => "{$web_path}styles/" . $user->theme['template_path'] . '/template', - 'T_SUPER_TEMPLATE_PATH' => (isset($user->theme['template_inherit_path']) && $user->theme['template_inherit_path']) ? "{$web_path}styles/" . $user->theme['template_inherit_path'] . '/template' : "{$web_path}styles/" . $user->theme['template_path'] . '/template', - 'T_IMAGESET_PATH' => "{$web_path}styles/" . $user->theme['imageset_path'] . '/imageset', - 'T_IMAGESET_LANG_PATH' => "{$web_path}styles/" . $user->theme['imageset_path'] . '/imageset/' . $user->lang_name, + 'T_THEME_PATH' => "{$web_path}styles/" . rawurlencode($user->theme['theme_path']) . '/theme', + 'T_TEMPLATE_PATH' => "{$web_path}styles/" . rawurlencode($user->theme['template_path']) . '/template', + 'T_SUPER_TEMPLATE_PATH' => (isset($user->theme['template_inherit_path']) && $user->theme['template_inherit_path']) ? "{$web_path}styles/" . rawurlencode($user->theme['template_inherit_path']) . '/template' : "{$web_path}styles/" . rawurlencode($user->theme['template_path']) . '/template', + 'T_IMAGESET_PATH' => "{$web_path}styles/" . rawurlencode($user->theme['imageset_path']) . '/imageset', + 'T_IMAGESET_LANG_PATH' => "{$web_path}styles/" . rawurlencode($user->theme['imageset_path']) . '/imageset/' . $user->lang_name, 'T_IMAGES_PATH' => "{$web_path}images/", 'T_SMILIES_PATH' => "{$web_path}{$config['smilies_path']}/", 'T_AVATAR_PATH' => "{$web_path}{$config['avatar_path']}/", @@ -4624,13 +4624,13 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0 'T_ICONS_PATH' => "{$web_path}{$config['icons_path']}/", 'T_RANKS_PATH' => "{$web_path}{$config['ranks_path']}/", 'T_UPLOAD_PATH' => "{$web_path}{$config['upload_path']}/", - 'T_STYLESHEET_LINK' => (!$user->theme['theme_storedb']) ? "{$web_path}styles/" . $user->theme['theme_path'] . '/theme/stylesheet.css' : append_sid("{$phpbb_root_path}style.$phpEx", 'id=' . $user->theme['style_id'] . '&lang=' . $user->lang_name), + 'T_STYLESHEET_LINK' => (!$user->theme['theme_storedb']) ? "{$web_path}styles/" . rawurlencode($user->theme['theme_path']) . '/theme/stylesheet.css' : append_sid("{$phpbb_root_path}style.$phpEx", 'id=' . $user->theme['style_id'] . '&lang=' . $user->lang_name), 'T_STYLESHEET_NAME' => $user->theme['theme_name'], - 'T_THEME_NAME' => $user->theme['theme_path'], - 'T_TEMPLATE_NAME' => $user->theme['template_path'], - 'T_SUPER_TEMPLATE_NAME' => (isset($user->theme['template_inherit_path']) && $user->theme['template_inherit_path']) ? $user->theme['template_inherit_path'] : $user->theme['template_path'], - 'T_IMAGESET_NAME' => $user->theme['imageset_path'], + 'T_THEME_NAME' => rawurlencode($user->theme['theme_path']), + 'T_TEMPLATE_NAME' => rawurlencode($user->theme['template_path']), + 'T_SUPER_TEMPLATE_NAME' => rawurlencode((isset($user->theme['template_inherit_path']) && $user->theme['template_inherit_path']) ? $user->theme['template_inherit_path'] : $user->theme['template_path']), + 'T_IMAGESET_NAME' => rawurlencode($user->theme['imageset_path']), 'T_IMAGESET_LANG_NAME' => $user->data['user_lang'], 'T_IMAGES' => 'images', 'T_SMILIES' => $config['smilies_path'], From 88cad5523e7cdac6826dd8581e27e22a65afda26 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sat, 3 Dec 2011 16:40:05 -0500 Subject: [PATCH 016/279] [ticket/10093] Make commit-msg always not fatal by nuking all fatal logic. PHPBB3-10093 --- git-tools/hooks/commit-msg | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/git-tools/hooks/commit-msg b/git-tools/hooks/commit-msg index 959c4e3979..e5a4c5e60b 100755 --- a/git-tools/hooks/commit-msg +++ b/git-tools/hooks/commit-msg @@ -12,11 +12,6 @@ # ln -s ../../git-tools/hooks/commit-msg \\ # .git/hooks/commit-msg # -# You can configure whether invalid commit messages abort commits: -# -# git config phpbb.hooks.commit-msg.fatal true (abort, this is the default) -# git config phpbb.hooks.commit-msg.fatal false (warn only, do not abort) -# # Warning/error messages use color by default if the output is a terminal # ("output" here is normally standard error when you run git commit). # To force or disable the use of color: @@ -26,13 +21,6 @@ config_ns="phpbb.hooks.commit-msg"; -if [ "$(git config --bool $config_ns.fatal)" = "false" ] -then - fatal=0; -else - fatal=1; -fi - debug_level=$(git config --int $config_ns.debug || echo 0); # Error codes @@ -59,12 +47,9 @@ debug() quit() { - if [ $1 -gt 0 ] && [ $1 -ne $ERR_UNKNOWN ] && [ $fatal -eq 0 ] - then - exit 0; - else - exit $1; - fi + # Now we always exit with success, since git will trash + # entered commit message if commit-msg hook exits with a failure. + exit 0 } use_color() From 8e59699424f4870e4ad77542b0e37eca696a18a3 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sat, 3 Dec 2011 16:42:04 -0500 Subject: [PATCH 017/279] [ticket/10093] Use correct ANSI code for clearing color. PHPBB3-10093 --- git-tools/hooks/commit-msg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-tools/hooks/commit-msg b/git-tools/hooks/commit-msg index e5a4c5e60b..52969670ca 100755 --- a/git-tools/hooks/commit-msg +++ b/git-tools/hooks/commit-msg @@ -88,11 +88,11 @@ complain() if [ "$1" = "-n" ] then echo "$@" - printf "\033[10m" + printf "\033[0m" else # This will print one trailing space. # Not sure how to avoid this at the moment. - echo "$@" $(printf "\033[10m") + echo "$@" $(printf "\033[0m") fi else echo "$@" From 0ad81a4cdcfc3611ec77417e1bc9b12aecd69def Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sat, 3 Dec 2011 17:42:10 -0500 Subject: [PATCH 018/279] [ticket/10511] Fix a grammar defect in permissions language. PHPBB3-10511 --- phpBB/language/en/acp/permissions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/language/en/acp/permissions.php b/phpBB/language/en/acp/permissions.php index cf248cffdb..00ba01d7d3 100644 --- a/phpBB/language/en/acp/permissions.php +++ b/phpBB/language/en/acp/permissions.php @@ -273,7 +273,7 @@ $lang = array_merge($lang, array( 'TRACE_WHO' => 'Who', 'TRACE_TOTAL' => 'Total', - 'USERS_NOT_ASSIGNED' => 'No user assigned to this role', + 'USERS_NOT_ASSIGNED' => 'No users are assigned to this role', 'USER_IS_MEMBER_OF_DEFAULT' => 'is a member of the following pre-defined groups', 'USER_IS_MEMBER_OF_CUSTOM' => 'is a member of the following user defined groups', From 5b9c83512765373fec3000dd39ba1154412281e3 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Sat, 3 Dec 2011 17:44:58 -0500 Subject: [PATCH 019/279] [ticket/9876] Distinctly name user and forum roles for newly registered users. PHPBB3-9876 --- phpBB/language/en/acp/permissions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/language/en/acp/permissions.php b/phpBB/language/en/acp/permissions.php index cf248cffdb..8ad1db5d93 100644 --- a/phpBB/language/en/acp/permissions.php +++ b/phpBB/language/en/acp/permissions.php @@ -171,7 +171,7 @@ $lang = array_merge($lang, array( 'ROLE_FORUM_POLLS' => 'Standard Access + Polls', 'ROLE_FORUM_READONLY' => 'Read Only Access', 'ROLE_FORUM_STANDARD' => 'Standard Access', - 'ROLE_FORUM_NEW_MEMBER' => 'Newly registered User', + 'ROLE_FORUM_NEW_MEMBER' => 'Newly Registered User Access', 'ROLE_MOD_FULL' => 'Full Moderator', 'ROLE_MOD_QUEUE' => 'Queue Moderator', 'ROLE_MOD_SIMPLE' => 'Simple Moderator', @@ -181,7 +181,7 @@ $lang = array_merge($lang, array( 'ROLE_USER_NOAVATAR' => 'No Avatar', 'ROLE_USER_NOPM' => 'No Private Messages', 'ROLE_USER_STANDARD' => 'Standard Features', - 'ROLE_USER_NEW_MEMBER' => 'Newly registered User', + 'ROLE_USER_NEW_MEMBER' => 'Newly Registered User Features', 'ROLE_DESCRIPTION_ADMIN_FORUM' => 'Can access the forum management and forum permission settings.', From 1842323ca9a59b8cc34c1af43db6d703cf996d33 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Sun, 4 Dec 2011 11:43:55 +0200 Subject: [PATCH 020/279] [ticket/10399] Correctly encoding template component urls (3.0) Changes in style.php PHPBB3-10399 --- phpBB/style.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/phpBB/style.php b/phpBB/style.php index 916aa8ce5c..f1b41c6a85 100644 --- a/phpBB/style.php +++ b/phpBB/style.php @@ -216,10 +216,10 @@ if ($id) // Parse Theme Data $replace = array( - '{T_THEME_PATH}' => "{$phpbb_root_path}styles/" . $theme['theme_path'] . '/theme', - '{T_TEMPLATE_PATH}' => "{$phpbb_root_path}styles/" . $theme['template_path'] . '/template', - '{T_IMAGESET_PATH}' => "{$phpbb_root_path}styles/" . $theme['imageset_path'] . '/imageset', - '{T_IMAGESET_LANG_PATH}' => "{$phpbb_root_path}styles/" . $theme['imageset_path'] . '/imageset/' . $user_image_lang, + '{T_THEME_PATH}' => "{$phpbb_root_path}styles/" . rawurlencode($theme['theme_path']) . '/theme', + '{T_TEMPLATE_PATH}' => "{$phpbb_root_path}styles/" . rawurlencode($theme['template_path']) . '/template', + '{T_IMAGESET_PATH}' => "{$phpbb_root_path}styles/" . rawurlencode($theme['imageset_path']) . '/imageset', + '{T_IMAGESET_LANG_PATH}' => "{$phpbb_root_path}styles/" . rawurlencode($theme['imageset_path']) . '/imageset/' . $user_image_lang, '{T_STYLESHEET_NAME}' => $theme['theme_name'], '{S_USER_LANG}' => $user['user_lang'] ); @@ -248,7 +248,7 @@ if ($id) $img_data = &$img_array[$img]; $imgsrc = ($img_data['image_lang'] ? $img_data['image_lang'] . '/' : '') . $img_data['image_filename']; $imgs[$img] = array( - 'src' => $phpbb_root_path . 'styles/' . $theme['imageset_path'] . '/imageset/' . $imgsrc, + 'src' => $phpbb_root_path . 'styles/' . rawurlencode($theme['imageset_path']) . '/imageset/' . $imgsrc, 'width' => $img_data['image_width'], 'height' => $img_data['image_height'], ); From cd4958f72c249b9254f7038432cbe7a390dd93bf Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Thu, 15 Dec 2011 14:44:09 +0200 Subject: [PATCH 021/279] [ticket/10507] Sort styles in acp Sort styles by name in admin control panel PHPBB3-10507 --- phpBB/includes/acp/acp_styles.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 3bc8c86500..38f4c57bd8 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -540,6 +540,7 @@ parse_css_file = {PARSE_CSS_FILE} global $user, $template, $db, $config, $phpbb_root_path, $phpEx; $sql_from = ''; + $sql_sort = 'LOWER(' . $mode . '_name)'; $style_count = array(); switch ($mode) @@ -571,6 +572,9 @@ parse_css_file = {PARSE_CSS_FILE} case 'imageset': $sql_from = STYLES_IMAGESET_TABLE; break; + + default: + trigger_error($user->lang['NO_MODE'] . adm_back_link($this->u_action), E_USER_WARNING); } $l_prefix = strtoupper($mode); @@ -594,7 +598,8 @@ parse_css_file = {PARSE_CSS_FILE} ); $sql = "SELECT * - FROM $sql_from"; + FROM $sql_from + ORDER BY $sql_sort ASC"; $result = $db->sql_query($sql); $installed = array(); From 80149d0c872292cf7cf7be8aa1eca5641f7cd708 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Thu, 15 Dec 2011 16:18:52 +0200 Subject: [PATCH 022/279] [ticket/10507] DBAL unit test Unit test for ORDER BY LOWER(style_name) PHPBB3-10507 --- tests/dbal/fixtures/styles.xml | 39 +++++++++++++++++++++ tests/dbal/order_lower_test.php | 62 +++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 tests/dbal/fixtures/styles.xml create mode 100644 tests/dbal/order_lower_test.php diff --git a/tests/dbal/fixtures/styles.xml b/tests/dbal/fixtures/styles.xml new file mode 100644 index 0000000000..47b384c47f --- /dev/null +++ b/tests/dbal/fixtures/styles.xml @@ -0,0 +1,39 @@ + + + + style_id + style_name + style_copyright + style_active + template_id + theme_id + imageset_id + + 1 + prosilver + &copy; phpBB Group + 1 + 1 + 1 + 1 + + + 2 + prosilver2 + &copy; phpBB Group + 0 + 2 + 2 + 2 + + + 3 + Prosilver1 + &copy; phpBB Group + 0 + 3 + 3 + 3 + +
+
diff --git a/tests/dbal/order_lower_test.php b/tests/dbal/order_lower_test.php new file mode 100644 index 0000000000..fd1c950252 --- /dev/null +++ b/tests/dbal/order_lower_test.php @@ -0,0 +1,62 @@ +createXMLDataSet(dirname(__FILE__).'/fixtures/styles.xml'); + } + + public function test_cross_join() + { + $db = $this->new_dbal(); + + // http://tracker.phpbb.com/browse/PHPBB3-10507 + // Test ORDER BY LOWER(style_name) + $db->sql_return_on_error(true); + + $sql = 'SELECT * FROM phpbb_styles ORDER BY LOWER(style_name)'; + $result = $db->sql_query($sql); + + $db->sql_return_on_error(false); + + $this->assertEquals(array( + array( + 'style_id' => 1, + 'style_name' => 'prosilver', + 'style_copyright' => '© phpBB Group', + 'style_active' => 1, + 'template_id' => 1, + 'theme_id' => 1, + 'imageset_id' => 1 + ), + array( + 'style_id' => 3, + 'style_name' => 'Prosilver1', + 'style_copyright' => '© phpBB Group', + 'style_active' => 0, + 'template_id' => 3, + 'theme_id' => 3, + 'imageset_id' => 3 + ), + array( + 'style_id' => 2, + 'style_name' => 'prosilver2', + 'style_copyright' => '© phpBB Group', + 'style_active' => 0, + 'template_id' => 2, + 'theme_id' => 2, + 'imageset_id' => 2 + ) + ), + $db->sql_fetchrowset($result) + ); + } +} From 82fff947c641665b80941814813e07e898a7676c Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 19 Dec 2011 14:24:39 +0100 Subject: [PATCH 023/279] [ticket/10538] Call htmlspecialchars_decode() on Jabber and SMTP passwords. PHPBB3-10538 --- phpBB/includes/functions_messenger.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 91b361183c..6549693333 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -568,7 +568,7 @@ class messenger if (!$use_queue) { include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx); - $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], $config['jab_password'], $config['jab_use_ssl']); + $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password']), $config['jab_use_ssl']); if (!$this->jabber->connect()) { @@ -769,7 +769,7 @@ class queue } include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx); - $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], $config['jab_password'], $config['jab_use_ssl']); + $this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], htmlspecialchars_decode($config['jab_password']), $config['jab_use_ssl']); if (!$this->jabber->connect()) { @@ -1022,7 +1022,7 @@ function smtpmail($addresses, $subject, $message, &$err_msg, $headers = false) } // Let me in. This function handles the complete authentication process - if ($err_msg = $smtp->log_into_server($config['smtp_host'], $config['smtp_username'], $config['smtp_password'], $config['smtp_auth_method'])) + if ($err_msg = $smtp->log_into_server($config['smtp_host'], $config['smtp_username'], htmlspecialchars_decode($config['smtp_password']), $config['smtp_auth_method'])) { $smtp->close_session($err_msg); return false; From fa2edf518748e3ec812857cf913235793216a027 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Fri, 23 Dec 2011 00:26:26 -0500 Subject: [PATCH 024/279] [ticket/10546] Add missing argument to adm_back_link in acp_captcha. PHPBB3-10546 --- phpBB/includes/acp/acp_captcha.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php index 1893eed14f..469a367bba 100644 --- a/phpBB/includes/acp/acp_captcha.php +++ b/phpBB/includes/acp/acp_captcha.php @@ -96,7 +96,7 @@ class acp_captcha } else if ($submit) { - trigger_error($user->lang['FORM_INVALID'] . adm_back_link(), E_USER_WARNING); + trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING); } else { From 7779dae2cc256eafb6fa9dc1bc882b52c4b1d8ca Mon Sep 17 00:00:00 2001 From: Igor Wiedler Date: Fri, 25 Jun 2010 15:19:10 +0200 Subject: [PATCH 025/279] [ticket/9681] Add password length to security settings PHPBB3-9681 --- phpBB/includes/acp/acp_board.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php index 8c761e51fe..f437dca8f9 100644 --- a/phpBB/includes/acp/acp_board.php +++ b/phpBB/includes/acp/acp_board.php @@ -383,6 +383,8 @@ class acp_board 'referer_validation' => array('lang' => 'REFERER_VALID', 'validate' => 'int:0:3','type' => 'custom', 'method' => 'select_ref_check', 'explain' => true), 'check_dnsbl' => array('lang' => 'CHECK_DNSBL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), 'email_check_mx' => array('lang' => 'EMAIL_CHECK_MX', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true), + 'max_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:8:255', 'type' => false, 'method' => false, 'explain' => false,), + 'min_pass_chars' => array('lang' => 'PASSWORD_LENGTH', 'validate' => 'int:1', 'type' => 'custom', 'method' => 'password_length', 'explain' => true), 'pass_complex' => array('lang' => 'PASSWORD_TYPE', 'validate' => 'string', 'type' => 'select', 'method' => 'select_password_chars', 'explain' => true), 'chg_passforce' => array('lang' => 'FORCE_PASS_CHANGE', 'validate' => 'int:0', 'type' => 'text:3:3', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']), 'max_login_attempts' => array('lang' => 'MAX_LOGIN_ATTEMPTS', 'validate' => 'int:0', 'type' => 'text:3:3', 'explain' => true), From b8ddd329225894ecd181146be799f0f8a085fcc4 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Fri, 23 Dec 2011 01:45:41 -0500 Subject: [PATCH 026/279] [ticket/7432] Explain what users are inactive in more detail. PHPBB3-7432 --- phpBB/language/en/acp/common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index ef8d6f1cb3..79caa07d98 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -405,7 +405,7 @@ $lang = array_merge($lang, array( 'INACTIVE_REASON_UNKNOWN' => 'Unknown', 'INACTIVE_USERS' => 'Inactive users', 'INACTIVE_USERS_EXPLAIN' => 'This is a list of users who have registered but whose accounts are inactive. You can activate, delete or remind (by sending an e-mail) these users if you wish.', - 'INACTIVE_USERS_EXPLAIN_INDEX' => 'This is a list of the last 10 registered users who have inactive accounts. A full list is available from the appropriate menu item or by following the link below from where you can activate, delete or remind (by sending an e-mail) these users if you wish.', + 'INACTIVE_USERS_EXPLAIN_INDEX' => 'This is a list of the last 10 registered users who have inactive accounts. Accounts are inactive either because account activation was enabled in user registration settings and these users’ accounts have not yet been activated, or because these accounts have been deactivated. A full list is available from the appropriate menu item or by following the link below from where you can activate, delete or remind (by sending an e-mail) these users if you wish.', 'NO_INACTIVE_USERS' => 'No inactive users', From d9fef488af150107b753b3c30e15ab5bf6d9da38 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 26 Jul 2011 17:48:17 +0200 Subject: [PATCH 027/279] [ticket/9079] Display backtrace on all E_USER_ERROR errors, not only SQL errors PHPBB3-9079 --- phpBB/includes/db/dbal.php | 5 ----- phpBB/includes/functions.php | 7 +++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index b4c1a72e1c..230c9c8ed7 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -662,12 +662,7 @@ class dbal // The DEBUG_EXTRA constant is for development only! if ((isset($auth) && $auth->acl_get('a_')) || defined('IN_INSTALL') || defined('DEBUG_EXTRA')) { - // Print out a nice backtrace... - $backtrace = get_backtrace(); - $message .= ($sql) ? '

SQL

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

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

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

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

BACKTRACE
' . $backtrace : ''; - $msg_text .= '
'; + $msg_text = $log_text; } if ((defined('DEBUG') || defined('IN_CRON') || defined('IMAGE_OUTPUT')) && isset($db)) { // let's avoid loops $db->sql_return_on_error(true); - add_log('critical', 'LOG_GENERAL_ERROR', $msg_title, $msg_text); + add_log('critical', 'LOG_GENERAL_ERROR', $msg_title, $log_text); $db->sql_return_on_error(false); } From fa003bb5fd2fa87f5fec2b19d14fcd4a4eb9b052 Mon Sep 17 00:00:00 2001 From: Richard Foote Date: Thu, 22 Dec 2011 00:45:16 -0500 Subject: [PATCH 029/279] [ticket/10542] Remove class="postlink" in subsilver2 faq_body.html class="postlink" is not defined in stylesheet.css so remove it from styles/subsilver2/template/faq_body.html PHPBB3-10542 --- phpBB/styles/subsilver2/template/faq_body.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/styles/subsilver2/template/faq_body.html b/phpBB/styles/subsilver2/template/faq_body.html index bbd9b82b19..6a4df3659c 100644 --- a/phpBB/styles/subsilver2/template/faq_body.html +++ b/phpBB/styles/subsilver2/template/faq_body.html @@ -13,7 +13,7 @@ {faq_block.BLOCK_TITLE}
- {faq_block.faq_row.FAQ_QUESTION}
+ {faq_block.faq_row.FAQ_QUESTION}

From 38c2d4da35b6c00e2ef2f6b271eda2c020974eee Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Fri, 23 Dec 2011 02:24:11 -0500 Subject: [PATCH 030/279] [ticket/10428] Compare $data to false strictly. Users may pass 0 or '' for $data, this should cause the user-specified $data code path to be taken. PHPBB3-10428 --- phpBB/includes/acp/acp_users.php | 8 ++++---- phpBB/includes/session.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 4f58434a43..724d450c99 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -2345,7 +2345,7 @@ class acp_users { global $user; - $var = ($data) ? $data : $user_row['user_options']; + $var = ($data !== false) ? $data : $user_row['user_options']; if ($value && !($var & 1 << $user->keyoptions[$key])) { @@ -2357,10 +2357,10 @@ class acp_users } else { - return ($data) ? $var : false; + return ($data !== false) ? $var : false; } - if (!$data) + if ($data === false) { $user_row['user_options'] = $var; return true; @@ -2378,7 +2378,7 @@ class acp_users { global $user; - $var = ($data) ? $data : $user_row['user_options']; + $var = ($data !== false) ? $data : $user_row['user_options']; return ($var & 1 << $user->keyoptions[$key]) ? true : false; } } diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index caadcbafaa..50b6ac7406 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -2343,7 +2343,7 @@ class user extends session { if (!isset($this->keyvalues[$key])) { - $var = ($data) ? $data : $this->data['user_options']; + $var = ($data !== false) ? $data : $this->data['user_options']; $this->keyvalues[$key] = ($var & 1 << $this->keyoptions[$key]) ? true : false; } @@ -2355,7 +2355,7 @@ class user extends session */ function optionset($key, $value, $data = false) { - $var = ($data) ? $data : $this->data['user_options']; + $var = ($data !== false) ? $data : $this->data['user_options']; if ($value && !($var & 1 << $this->keyoptions[$key])) { @@ -2367,10 +2367,10 @@ class user extends session } else { - return ($data) ? $var : false; + return ($data !== false) ? $var : false; } - if (!$data) + if ($data === false) { $this->data['user_options'] = $var; return true; From 16ae99eec8e34ec6d542c1e4d82bd288bc0d0026 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Fri, 23 Dec 2011 02:29:48 -0500 Subject: [PATCH 031/279] [ticket/10428] Dispose of $this->keyvalues cache for optionget. It does not work properly when custom $data is provided, and making it work will make the code so complicated that any benefits from having this cache in the first place will be nullified. Just get rid of it. PHPBB3-10428 --- phpBB/includes/session.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 50b6ac7406..d988426a87 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -1507,7 +1507,6 @@ class user extends session // Able to add new options (up to id 31) var $keyoptions = array('viewimg' => 0, 'viewflash' => 1, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'bbcode' => 8, 'smilies' => 9, 'popuppm' => 10, 'sig_bbcode' => 15, 'sig_smilies' => 16, 'sig_links' => 17); - var $keyvalues = array(); /** * Constructor to set the lang path @@ -2341,13 +2340,8 @@ class user extends session */ function optionget($key, $data = false) { - if (!isset($this->keyvalues[$key])) - { - $var = ($data !== false) ? $data : $this->data['user_options']; - $this->keyvalues[$key] = ($var & 1 << $this->keyoptions[$key]) ? true : false; - } - - return $this->keyvalues[$key]; + $var = ($data !== false) ? $data : $this->data['user_options']; + return ($var & 1 << $this->keyoptions[$key]) ? true : false; } /** From 99c102344ebe3b4a6c18e36c8bea8f3bdd997f2e Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Fri, 23 Dec 2011 12:52:51 -0500 Subject: [PATCH 032/279] [ticket/10428] Use phpbb_optionget/set in optionget/set for DRYness. PHPBB3-10428 --- phpBB/includes/acp/acp_users.php | 28 ++++++++++++---------------- phpBB/includes/session.php | 28 ++++++++++++---------------- 2 files changed, 24 insertions(+), 32 deletions(-) diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index 724d450c99..e433c46db3 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -2347,27 +2347,23 @@ class acp_users $var = ($data !== false) ? $data : $user_row['user_options']; - if ($value && !($var & 1 << $user->keyoptions[$key])) - { - $var += 1 << $user->keyoptions[$key]; - } - else if (!$value && ($var & 1 << $user->keyoptions[$key])) - { - $var -= 1 << $user->keyoptions[$key]; - } - else - { - return ($data !== false) ? $var : false; - } + $new_var = phpbb_optionset($user->keyoptions[$key], $value, $var); if ($data === false) { - $user_row['user_options'] = $var; - return true; + if ($new_var != $var) + { + $user_row['user_options'] = $new_var; + return true; + } + else + { + return false; + } } else { - return $var; + return $new_var; } } @@ -2379,7 +2375,7 @@ class acp_users global $user; $var = ($data !== false) ? $data : $user_row['user_options']; - return ($var & 1 << $user->keyoptions[$key]) ? true : false; + return phpbb_optionget($user->keyoptions[$key], $var); } } diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index d988426a87..457071e01e 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -2341,7 +2341,7 @@ class user extends session function optionget($key, $data = false) { $var = ($data !== false) ? $data : $this->data['user_options']; - return ($var & 1 << $this->keyoptions[$key]) ? true : false; + return phpbb_optionget($this->keyoptions[$key], $var); } /** @@ -2351,27 +2351,23 @@ class user extends session { $var = ($data !== false) ? $data : $this->data['user_options']; - if ($value && !($var & 1 << $this->keyoptions[$key])) - { - $var += 1 << $this->keyoptions[$key]; - } - else if (!$value && ($var & 1 << $this->keyoptions[$key])) - { - $var -= 1 << $this->keyoptions[$key]; - } - else - { - return ($data !== false) ? $var : false; - } + $new_var = phpbb_optionset($this->keyoptions[$key], $value, $var); if ($data === false) { - $this->data['user_options'] = $var; - return true; + if ($new_var != $var) + { + $this->data['user_options'] = $new_var; + return true; + } + else + { + return false; + } } else { - return $var; + return $new_var; } } From 10453b67525a0e26a3c859df4dab46907189af72 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Fri, 23 Dec 2011 22:59:55 -0500 Subject: [PATCH 033/279] [ticket/10428] Documentation for optionget/optionset functions. PHPBB3-10428 --- phpBB/includes/acp/acp_users.php | 23 +++++++++++++++++++++-- phpBB/includes/session.php | 17 +++++++++++++++-- 2 files changed, 36 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php index e433c46db3..363c900edc 100644 --- a/phpBB/includes/acp/acp_users.php +++ b/phpBB/includes/acp/acp_users.php @@ -2339,7 +2339,19 @@ class acp_users } /** - * Optionset replacement for this module based on $user->optionset + * Set option bit field for user options in a user row array. + * + * Optionset replacement for this module based on $user->optionset. + * + * @param array $user_row Row from the users table. + * @param int $key Option key, as defined in $user->keyoptions property. + * @param bool $value True to set the option, false to clear the option. + * @param int $data Current bit field value, or false to use $user_row['user_options'] + * @return int|bool If $data is false, the bit field is modified and + * written back to $user_row['user_options'], and + * return value is true if the bit field changed and + * false otherwise. If $data is not false, the new + * bitfield value is returned. */ function optionset(&$user_row, $key, $value, $data = false) { @@ -2368,7 +2380,14 @@ class acp_users } /** - * Optionget replacement for this module based on $user->optionget + * Get option bit field from user options in a user row array. + * + * Optionget replacement for this module based on $user->optionget. + * + * @param array $user_row Row from the users table. + * @param int $key option key, as defined in $user->keyoptions property. + * @param int $data bit field value to use, or false to use $user_row['user_options'] + * @return bool true if the option is set in the bit field, false otherwise */ function optionget(&$user_row, $key, $data = false) { diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 457071e01e..a894242a39 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -2336,7 +2336,11 @@ class user extends session } /** - * Get option bit field from user options + * Get option bit field from user options. + * + * @param int $key option key, as defined in $keyoptions property. + * @param int $data bit field value to use, or false to use $this->data['user_options'] + * @return bool true if the option is set in the bit field, false otherwise */ function optionget($key, $data = false) { @@ -2345,7 +2349,16 @@ class user extends session } /** - * Set option bit field for user options + * Set option bit field for user options. + * + * @param int $key Option key, as defined in $keyoptions property. + * @param bool $value True to set the option, false to clear the option. + * @param int $data Current bit field value, or false to use $this->data['user_options'] + * @return int|bool If $data is false, the bit field is modified and + * written back to $this->data['user_options'], and + * return value is true if the bit field changed and + * false otherwise. If $data is not false, the new + * bitfield value is returned. */ function optionset($key, $value, $data = false) { From d5dc70cbe3be0f18666a0dc7e972b9d6766291af Mon Sep 17 00:00:00 2001 From: Richard Foote Date: Thu, 29 Dec 2011 16:27:48 -0500 Subject: [PATCH 034/279] [ticket/10407] Fix check for empty image paths in convertor This applies to avatar_path,avatar_gallery_path,smilies_path and upload_path. Currently, the convertor gets each path from the config table and adds a trailing slash. If there is no entry in the config table for the path, the path can never be empty because of the added trailing slash. This patch will temporarily remove the trailing slash, then check if the path is empty. PHPBB3-10407 --- phpBB/includes/functions_convert.php | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index 4a359dcade..4663fe46cc 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -424,7 +424,10 @@ function import_avatar_gallery($gallery_name = '', $subdirs_as_galleries = false $relative_path = empty($convert->convertor['source_path_absolute']); - if (empty($convert->convertor['avatar_gallery_path'])) + // strip trailing slash + $trimmed_avatar_gallery_path = rtrim($convert->convertor['avatar_gallery_path'], '/'); + + if (empty($trimmed_avatar_gallery_path)) { $convert->p_master->error(sprintf($user->lang['CONV_ERROR_NO_GALLERY_PATH'], 'import_avatar_gallery()'), __LINE__, __FILE__); } @@ -588,7 +591,10 @@ function import_attachment($source, $use_target = false) global $convert, $phpbb_root_path, $config, $user; - if (empty($convert->convertor['upload_path'])) + // strip trailing slash + $trimmed_upload_path = rtrim($convert->convertor['upload_path'], '/'); + + if (empty($trimmed_upload_path)) { $convert->p_master->error(sprintf($user->lang['CONV_ERROR_NO_UPLOAD_DIR'], 'import_attachment()'), __LINE__, __FILE__); } @@ -647,7 +653,10 @@ function import_smiley($source, $use_target = false) global $convert, $phpbb_root_path, $config, $user; - if (!isset($convert->convertor['smilies_path'])) + // strip trailing slash + $trimmed_smilies_path = rtrim($convert->convertor['smilies_path'], '/'); + + if (empty($trimmed_smilies_path)) { $convert->p_master->error(sprintf($user->lang['CONV_ERROR_NO_SMILIES_PATH'], 'import_smiley()'), __LINE__, __FILE__); } @@ -667,7 +676,10 @@ function import_avatar($source, $use_target = false, $user_id = false) global $convert, $phpbb_root_path, $config, $user; - if (!isset($convert->convertor['avatar_path'])) + // strip trailing slash + $trimmed_avatar_path = rtrim($convert->convertor['avatar_path'], '/'); + + if (empty($trimmed_avatar_path)) { $convert->p_master->error(sprintf($user->lang['CONV_ERROR_NO_AVATAR_PATH'], 'import_avatar()'), __LINE__, __FILE__); } From 17991823ea72ef973852fd9d0a9c516703f2137e Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 31 Dec 2011 16:05:02 +0000 Subject: [PATCH 035/279] [ticket/9916] Updating License in the header PHPBB3-9916 --- tests/bbcode/url_bbcode_test.php | 2 +- tests/bootstrap.php | 2 +- tests/dbal/cross_join_test.php | 2 +- tests/dbal/db_tools_test.php | 2 +- tests/dbal/order_lower_test.php | 2 +- tests/dbal/select_test.php | 2 +- tests/dbal/write_test.php | 2 +- tests/error_collector_test.php | 2 +- tests/mock/cache.php | 2 +- tests/mock/session_testable.php | 2 +- tests/mock_user.php | 2 +- tests/network/checkdnsrr_test.php | 2 +- tests/network/ftp_fsock_pasv_epsv_test.php | 2 +- tests/profile/custom_test.php | 2 +- tests/random/gen_rand_string_test.php | 2 +- tests/regex/censor_test.php | 2 +- tests/regex/email_test.php | 2 +- tests/regex/ipv4_test.php | 2 +- tests/regex/ipv6_test.php | 2 +- tests/regex/password_complexity_test.php | 2 +- tests/regex/table_prefix_test.php | 2 +- tests/regex/url_test.php | 2 +- tests/request/request_var_test.php | 2 +- tests/security/base.php | 2 +- tests/security/extract_current_page_test.php | 2 +- tests/security/hash_test.php | 2 +- tests/security/redirect_test.php | 2 +- tests/session/append_sid_test.php | 2 +- tests/session/continue_test.php | 2 +- tests/session/init_test.php | 2 +- tests/session/testable_factory.php | 2 +- tests/template/template_test.php | 2 +- tests/test_framework/phpbb_database_test_case.php | 2 +- tests/test_framework/phpbb_database_test_connection_manager.php | 2 +- tests/test_framework/phpbb_test_case.php | 2 +- tests/test_framework/phpbb_test_case_helpers.php | 2 +- tests/text_processing/censor_text_test.php | 2 +- tests/text_processing/make_clickable_test.php | 2 +- tests/user/lang_test.php | 2 +- tests/utf/normalizer_test.php | 2 +- tests/utf/utf8_clean_string_test.php | 2 +- tests/utf/utf8_wordwrap_test.php | 2 +- tests/wrapper/gmgetdate_test.php | 2 +- tests/wrapper/mt_rand_test.php | 2 +- tests/wrapper/version_compare_test.php | 2 +- 45 files changed, 45 insertions(+), 45 deletions(-) diff --git a/tests/bbcode/url_bbcode_test.php b/tests/bbcode/url_bbcode_test.php index cd85dbd0d9..15bdfc434f 100644 --- a/tests/bbcode/url_bbcode_test.php +++ b/tests/bbcode/url_bbcode_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2010 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 6f3c93a374..16aed68405 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2008 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/dbal/cross_join_test.php b/tests/dbal/cross_join_test.php index 7110c7a2ea..6c6b8a8449 100644 --- a/tests/dbal/cross_join_test.php +++ b/tests/dbal/cross_join_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/dbal/db_tools_test.php b/tests/dbal/db_tools_test.php index c0c66b5be7..fbde636b58 100644 --- a/tests/dbal/db_tools_test.php +++ b/tests/dbal/db_tools_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/dbal/order_lower_test.php b/tests/dbal/order_lower_test.php index fd1c950252..b50494d506 100644 --- a/tests/dbal/order_lower_test.php +++ b/tests/dbal/order_lower_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/dbal/select_test.php b/tests/dbal/select_test.php index 8ddd27465d..05b0e68e29 100644 --- a/tests/dbal/select_test.php +++ b/tests/dbal/select_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2008 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/dbal/write_test.php b/tests/dbal/write_test.php index 4709d45fa5..596c50a220 100644 --- a/tests/dbal/write_test.php +++ b/tests/dbal/write_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2008 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/error_collector_test.php b/tests/error_collector_test.php index e1ac32f5ac..d67dea3719 100644 --- a/tests/error_collector_test.php +++ b/tests/error_collector_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/mock/cache.php b/tests/mock/cache.php index 020574b0bb..650545c3d6 100644 --- a/tests/mock/cache.php +++ b/tests/mock/cache.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2008 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/mock/session_testable.php b/tests/mock/session_testable.php index 47089cb94b..70a58fb6cc 100644 --- a/tests/mock/session_testable.php +++ b/tests/mock/session_testable.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2008 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/mock_user.php b/tests/mock_user.php index 5b89ea3e19..ec14ce430e 100644 --- a/tests/mock_user.php +++ b/tests/mock_user.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/network/checkdnsrr_test.php b/tests/network/checkdnsrr_test.php index 5a756dcef8..1942a50f06 100644 --- a/tests/network/checkdnsrr_test.php +++ b/tests/network/checkdnsrr_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2010 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/network/ftp_fsock_pasv_epsv_test.php b/tests/network/ftp_fsock_pasv_epsv_test.php index 6ad811e3ca..22f17785b8 100644 --- a/tests/network/ftp_fsock_pasv_epsv_test.php +++ b/tests/network/ftp_fsock_pasv_epsv_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/profile/custom_test.php b/tests/profile/custom_test.php index 585182e583..1f33b45ba9 100644 --- a/tests/profile/custom_test.php +++ b/tests/profile/custom_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/random/gen_rand_string_test.php b/tests/random/gen_rand_string_test.php index 115c55e4e2..3317c78ed9 100644 --- a/tests/random/gen_rand_string_test.php +++ b/tests/random/gen_rand_string_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2010 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/regex/censor_test.php b/tests/regex/censor_test.php index fa9104e71d..5929092e07 100644 --- a/tests/regex/censor_test.php +++ b/tests/regex/censor_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2010 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/regex/email_test.php b/tests/regex/email_test.php index 0695b801d5..17f93259c3 100644 --- a/tests/regex/email_test.php +++ b/tests/regex/email_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2010 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/regex/ipv4_test.php b/tests/regex/ipv4_test.php index 9829547508..38a3aa4a8e 100644 --- a/tests/regex/ipv4_test.php +++ b/tests/regex/ipv4_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2010 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/regex/ipv6_test.php b/tests/regex/ipv6_test.php index 1b2018403c..d24217b346 100644 --- a/tests/regex/ipv6_test.php +++ b/tests/regex/ipv6_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2010 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/regex/password_complexity_test.php b/tests/regex/password_complexity_test.php index 21e8d12a0a..07453555ee 100644 --- a/tests/regex/password_complexity_test.php +++ b/tests/regex/password_complexity_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2010 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/regex/table_prefix_test.php b/tests/regex/table_prefix_test.php index 67a18b4fbc..33bdd4ae2d 100644 --- a/tests/regex/table_prefix_test.php +++ b/tests/regex/table_prefix_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/regex/url_test.php b/tests/regex/url_test.php index c3a336063a..b395f5cae2 100644 --- a/tests/regex/url_test.php +++ b/tests/regex/url_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2010 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/request/request_var_test.php b/tests/request/request_var_test.php index fa17b1909f..8e609c00af 100644 --- a/tests/request/request_var_test.php +++ b/tests/request/request_var_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2008 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/security/base.php b/tests/security/base.php index db9c884cf4..2658798237 100644 --- a/tests/security/base.php +++ b/tests/security/base.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2008 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/security/extract_current_page_test.php b/tests/security/extract_current_page_test.php index 71c7a3a397..4911f7b452 100644 --- a/tests/security/extract_current_page_test.php +++ b/tests/security/extract_current_page_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2008 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/security/hash_test.php b/tests/security/hash_test.php index 19a3822145..0c2580c19b 100644 --- a/tests/security/hash_test.php +++ b/tests/security/hash_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/security/redirect_test.php b/tests/security/redirect_test.php index 70ba8527b1..4848a938c6 100644 --- a/tests/security/redirect_test.php +++ b/tests/security/redirect_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2008 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/session/append_sid_test.php b/tests/session/append_sid_test.php index 1a3ad633e3..88f6f0718e 100644 --- a/tests/session/append_sid_test.php +++ b/tests/session/append_sid_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/session/continue_test.php b/tests/session/continue_test.php index 6737562a0a..c4f7f8d75b 100644 --- a/tests/session/continue_test.php +++ b/tests/session/continue_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/session/init_test.php b/tests/session/init_test.php index 1181fab636..2ce6c4a4ac 100644 --- a/tests/session/init_test.php +++ b/tests/session/init_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/session/testable_factory.php b/tests/session/testable_factory.php index f3ef19a257..00f79738ef 100644 --- a/tests/session/testable_factory.php +++ b/tests/session/testable_factory.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/template/template_test.php b/tests/template/template_test.php index 5005710220..aaee7bb4a0 100644 --- a/tests/template/template_test.php +++ b/tests/template/template_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2008 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/test_framework/phpbb_database_test_case.php b/tests/test_framework/phpbb_database_test_case.php index e1b368dcea..fdb662b284 100644 --- a/tests/test_framework/phpbb_database_test_case.php +++ b/tests/test_framework/phpbb_database_test_case.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2008 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php index 7a45d87583..c734c90a1a 100644 --- a/tests/test_framework/phpbb_database_test_connection_manager.php +++ b/tests/test_framework/phpbb_database_test_connection_manager.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/test_framework/phpbb_test_case.php b/tests/test_framework/phpbb_test_case.php index f189da3671..8b16f02638 100644 --- a/tests/test_framework/phpbb_test_case.php +++ b/tests/test_framework/phpbb_test_case.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2008 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php index 0acdce32e0..9a7ab2d237 100644 --- a/tests/test_framework/phpbb_test_case_helpers.php +++ b/tests/test_framework/phpbb_test_case_helpers.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2008 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/text_processing/censor_text_test.php b/tests/text_processing/censor_text_test.php index 2843f0b20b..8fcdb7ef85 100644 --- a/tests/text_processing/censor_text_test.php +++ b/tests/text_processing/censor_text_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/text_processing/make_clickable_test.php b/tests/text_processing/make_clickable_test.php index 29b982d709..8697907311 100644 --- a/tests/text_processing/make_clickable_test.php +++ b/tests/text_processing/make_clickable_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2008 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/user/lang_test.php b/tests/user/lang_test.php index 6c60583a7b..d33f430955 100644 --- a/tests/user/lang_test.php +++ b/tests/user/lang_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/utf/normalizer_test.php b/tests/utf/normalizer_test.php index 1dc69e283e..92230cfcc9 100644 --- a/tests/utf/normalizer_test.php +++ b/tests/utf/normalizer_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/utf/utf8_clean_string_test.php b/tests/utf/utf8_clean_string_test.php index e5a771eafa..70bd549d5b 100644 --- a/tests/utf/utf8_clean_string_test.php +++ b/tests/utf/utf8_clean_string_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2008 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/utf/utf8_wordwrap_test.php b/tests/utf/utf8_wordwrap_test.php index 03fa9dc38c..39fdf73308 100644 --- a/tests/utf/utf8_wordwrap_test.php +++ b/tests/utf/utf8_wordwrap_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2008 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/wrapper/gmgetdate_test.php b/tests/wrapper/gmgetdate_test.php index 0b4c3378a9..a838cfdba9 100644 --- a/tests/wrapper/gmgetdate_test.php +++ b/tests/wrapper/gmgetdate_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/wrapper/mt_rand_test.php b/tests/wrapper/mt_rand_test.php index c8bcb3d14c..eba0bf2faa 100644 --- a/tests/wrapper/mt_rand_test.php +++ b/tests/wrapper/mt_rand_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/tests/wrapper/version_compare_test.php b/tests/wrapper/version_compare_test.php index f718cfd16b..8b42eb4bee 100644 --- a/tests/wrapper/version_compare_test.php +++ b/tests/wrapper/version_compare_test.php @@ -3,7 +3,7 @@ * * @package testing * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ From 0fc37fb3972845f76848c1e64d5edfe4b8cd0972 Mon Sep 17 00:00:00 2001 From: Unknown Date: Sun, 1 Jan 2012 10:35:50 +0000 Subject: [PATCH 036/279] [ticket/9916] Changing coding guidelines license PHPBB3-9916 --- phpBB/docs/coding-guidelines.html | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html index 7d51b26dca..cd113a7226 100644 --- a/phpBB/docs/coding-guidelines.html +++ b/phpBB/docs/coding-guidelines.html @@ -129,9 +129,8 @@ /** * * @package {PACKAGENAME} -* @version $Id: $ * @copyright (c) 2007 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */
@@ -2322,7 +2321,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
-

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

+

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

From 5e52734c240e5ecfb812202cd4cae305be9290c5 Mon Sep 17 00:00:00 2001 From: Unknown Date: Mon, 2 Jan 2012 15:09:38 +0000 Subject: [PATCH 037/279] [ticket/9916] Changing header in non-distributed files PHPBB3-9916 --- build/build_changelog.php | 2 +- build/build_diff.php | 5 ++--- build/build_helper.php | 3 +-- build/diff_class.php | 3 +-- build/package.php | 3 +-- git-tools/merge.php | 2 +- git-tools/setup_github_network.php | 2 +- phpBB/develop/change_smiley_ref.php | 2 -- phpBB/develop/check_flash_bbcodes.php | 3 +-- phpBB/develop/create_schema_files.php | 3 +-- phpBB/develop/create_search_index.php | 2 +- phpBB/develop/create_variable_overview.php | 2 -- phpBB/develop/fill.php | 2 -- phpBB/develop/generate_utf_casefold.php | 3 +-- phpBB/develop/generate_utf_confusables.php | 3 +-- phpBB/develop/generate_utf_tables.php | 3 +-- phpBB/develop/merge_post_tables.php | 1 - phpBB/develop/mysql_upgrader.php | 3 +-- phpBB/develop/utf_normalizer_test.php | 3 +-- phpBB/docs/AUTHORS | 2 +- phpBB/docs/CHANGELOG.html | 2 +- phpBB/docs/FAQ.html | 4 ++-- phpBB/docs/INSTALL.html | 4 ++-- phpBB/docs/README.html | 2 +- phpBB/docs/auth_api.html | 2 +- phpBB/docs/hook_system.html | 2 +- 26 files changed, 25 insertions(+), 43 deletions(-) diff --git a/build/build_changelog.php b/build/build_changelog.php index 4eb5ebd83b..1e80959adf 100755 --- a/build/build_changelog.php +++ b/build/build_changelog.php @@ -4,7 +4,7 @@ * * @package build * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU General Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/build/build_diff.php b/build/build_diff.php index 6a6070228f..0824b53caa 100755 --- a/build/build_diff.php +++ b/build/build_diff.php @@ -3,9 +3,8 @@ /** * * @package build -* @version $Id$ * @copyright (c) 2010 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ @@ -388,7 +387,7 @@ function build_header($mode, $filenames, $header) $html .= "## {$filename['phpbb_filename']}\n"; } } - $html .= "## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2 \n"; + $html .= "## License: http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 \n"; $html .= "############################################################## \n"; $html .= "\n"; diff --git a/build/build_helper.php b/build/build_helper.php index 2d9b86b3c3..d6169b913b 100644 --- a/build/build_helper.php +++ b/build/build_helper.php @@ -2,9 +2,8 @@ /** * * @package build -* @version $Id$ * @copyright (c) 2010 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/build/diff_class.php b/build/diff_class.php index 4625ffde24..2d8555400d 100644 --- a/build/diff_class.php +++ b/build/diff_class.php @@ -2,10 +2,9 @@ /** * * @package build -* @version $Id$ * @copyright (c) 2000 Geoffrey T. Dairiki * @copyright (c) 2010 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/build/package.php b/build/package.php index 4ce644e8ca..48f42b3572 100755 --- a/build/package.php +++ b/build/package.php @@ -3,9 +3,8 @@ /** * * @package build -* @version $Id$ * @copyright (c) 2010 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/git-tools/merge.php b/git-tools/merge.php index cbd84b896f..034bd2032c 100755 --- a/git-tools/merge.php +++ b/git-tools/merge.php @@ -4,7 +4,7 @@ * * @package phpBB3 * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/git-tools/setup_github_network.php b/git-tools/setup_github_network.php index e4e212eef6..5f2e1609a7 100755 --- a/git-tools/setup_github_network.php +++ b/git-tools/setup_github_network.php @@ -4,7 +4,7 @@ * * @package phpBB3 * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/phpBB/develop/change_smiley_ref.php b/phpBB/develop/change_smiley_ref.php index db65dd52d4..3d6dd45d6f 100644 --- a/phpBB/develop/change_smiley_ref.php +++ b/phpBB/develop/change_smiley_ref.php @@ -5,8 +5,6 @@ * begin : Tuesday, February 25, 2003 * copyright : (C) 2003 The phpBB Group * email : support@phpbb.com - * - * $Id$ * ***************************************************************************/ diff --git a/phpBB/develop/check_flash_bbcodes.php b/phpBB/develop/check_flash_bbcodes.php index b0fa399209..2ce288ee3e 100644 --- a/phpBB/develop/check_flash_bbcodes.php +++ b/phpBB/develop/check_flash_bbcodes.php @@ -2,9 +2,8 @@ /** * * @package phpBB3 -* @version $Id$ * @copyright (c) 2009, 2010 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 7f37b94453..d44efb8870 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -2,9 +2,8 @@ /** * * @package phpBB3 -* @version $Id$ * @copyright (c) 2006 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * * This file creates new schema files for every database. * The filenames will be prefixed with an underscore to not overwrite the current schema files. diff --git a/phpBB/develop/create_search_index.php b/phpBB/develop/create_search_index.php index 374a4cf0a1..28001035f6 100644 --- a/phpBB/develop/create_search_index.php +++ b/phpBB/develop/create_search_index.php @@ -3,7 +3,7 @@ * * @package phpBB3 * @copyright (c) 2011 phpBB Group -* @license http://opensource.org/licenses/gpl-license.php GNU Public License +* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2 * */ diff --git a/phpBB/develop/create_variable_overview.php b/phpBB/develop/create_variable_overview.php index fe7cacf0d1..a786fc6866 100644 --- a/phpBB/develop/create_variable_overview.php +++ b/phpBB/develop/create_variable_overview.php @@ -1,8 +1,6 @@ . +* along with this program. If not, see * */ diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index a0690819d2..2d3b6a6809 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -2182,7 +2182,7 @@
-

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

+

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

diff --git a/phpBB/docs/FAQ.html b/phpBB/docs/FAQ.html index 83d7a342e0..dbcefc44c1 100644 --- a/phpBB/docs/FAQ.html +++ b/phpBB/docs/FAQ.html @@ -110,7 +110,7 @@ I want to sue you because i think you host an illegal board!
-

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

+

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

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

@@ -328,7 +328,7 @@ I want to sue you because i think you host an illegal board!
-

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

+

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

diff --git a/phpBB/docs/INSTALL.html b/phpBB/docs/INSTALL.html index e5ba479d9e..c54e408be2 100644 --- a/phpBB/docs/INSTALL.html +++ b/phpBB/docs/INSTALL.html @@ -82,7 +82,7 @@
  • Webserver configuration
  • -
  • Disclaimer
  • +
  • Copyright and disclaimer
  • @@ -431,7 +431,7 @@
    -

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

    +

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

    diff --git a/phpBB/docs/README.html b/phpBB/docs/README.html index 7ceb698ac4..aa60d7dd25 100644 --- a/phpBB/docs/README.html +++ b/phpBB/docs/README.html @@ -339,7 +339,7 @@
    -

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

    +

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

    diff --git a/phpBB/docs/auth_api.html b/phpBB/docs/auth_api.html index 88618fa640..29469c21ac 100644 --- a/phpBB/docs/auth_api.html +++ b/phpBB/docs/auth_api.html @@ -275,7 +275,7 @@ $auth_admin = new auth_admin();
    -

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

    +

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

    diff --git a/phpBB/docs/hook_system.html b/phpBB/docs/hook_system.html index a5fad0d530..1b8131efaf 100644 --- a/phpBB/docs/hook_system.html +++ b/phpBB/docs/hook_system.html @@ -867,7 +867,7 @@ function phpbb_hook_register(&$hook)
    -

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

    +

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

    From 24cf7f1d29bdfba636d9692a02188b9cddba4e1f Mon Sep 17 00:00:00 2001 From: Richard Foote Date: Mon, 2 Jan 2012 13:09:21 -0500 Subject: [PATCH 038/279] [ticket/10407] Fix check for empty image paths in convertor This applies to avatar_path,avatar_gallery_path,smilies_path and upload_path. Currently, the convertor gets each path from the config table and adds a trailing slash. If there is no entry in the config table for the path, the path can never be empty because of the added trailing slash. This patch will check the path without the trailing slash to see if the path is actually empty. PHPBB3-10407 --- phpBB/includes/functions_convert.php | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php index 4663fe46cc..3b26f417e9 100644 --- a/phpBB/includes/functions_convert.php +++ b/phpBB/includes/functions_convert.php @@ -424,10 +424,8 @@ function import_avatar_gallery($gallery_name = '', $subdirs_as_galleries = false $relative_path = empty($convert->convertor['source_path_absolute']); - // strip trailing slash - $trimmed_avatar_gallery_path = rtrim($convert->convertor['avatar_gallery_path'], '/'); - - if (empty($trimmed_avatar_gallery_path)) + // check for trailing slash + if (rtrim($convert->convertor['avatar_gallery_path'], '/') === '') { $convert->p_master->error(sprintf($user->lang['CONV_ERROR_NO_GALLERY_PATH'], 'import_avatar_gallery()'), __LINE__, __FILE__); } @@ -591,10 +589,8 @@ function import_attachment($source, $use_target = false) global $convert, $phpbb_root_path, $config, $user; - // strip trailing slash - $trimmed_upload_path = rtrim($convert->convertor['upload_path'], '/'); - - if (empty($trimmed_upload_path)) + // check for trailing slash + if (rtrim($convert->convertor['upload_path'], '/') === '') { $convert->p_master->error(sprintf($user->lang['CONV_ERROR_NO_UPLOAD_DIR'], 'import_attachment()'), __LINE__, __FILE__); } @@ -653,10 +649,8 @@ function import_smiley($source, $use_target = false) global $convert, $phpbb_root_path, $config, $user; - // strip trailing slash - $trimmed_smilies_path = rtrim($convert->convertor['smilies_path'], '/'); - - if (empty($trimmed_smilies_path)) + // check for trailing slash + if (rtrim($convert->convertor['smilies_path'], '/') === '') { $convert->p_master->error(sprintf($user->lang['CONV_ERROR_NO_SMILIES_PATH'], 'import_smiley()'), __LINE__, __FILE__); } @@ -676,10 +670,8 @@ function import_avatar($source, $use_target = false, $user_id = false) global $convert, $phpbb_root_path, $config, $user; - // strip trailing slash - $trimmed_avatar_path = rtrim($convert->convertor['avatar_path'], '/'); - - if (empty($trimmed_avatar_path)) + // check for trailing slash + if (rtrim($convert->convertor['avatar_path'], '/') === '') { $convert->p_master->error(sprintf($user->lang['CONV_ERROR_NO_AVATAR_PATH'], 'import_avatar()'), __LINE__, __FILE__); } From 23363efaaacd2bec39a51c27db51a2777e7a4c21 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Mon, 2 Jan 2012 21:07:40 +0200 Subject: [PATCH 039/279] [ticket/10563] Show deactivated styles below active styles in acp Separates active and deactivated styles in styles list in acp PHPBB3-10563 --- phpBB/adm/style/acp_styles.html | 6 ++++++ phpBB/includes/acp/acp_styles.php | 3 +++ phpBB/language/en/acp/styles.php | 1 + 3 files changed, 10 insertions(+) diff --git a/phpBB/adm/style/acp_styles.html b/phpBB/adm/style/acp_styles.html index 098cc723d9..6aa1c0ccc9 100644 --- a/phpBB/adm/style/acp_styles.html +++ b/phpBB/adm/style/acp_styles.html @@ -402,6 +402,12 @@ {L_INSTALLED} + + + + {L_INACTIVE_STYLES} + + {installed.NAME} * diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index e25061d6f0..5a7902755e 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -547,6 +547,7 @@ parse_css_file = {PARSE_CSS_FILE} { case 'style': $sql_from = STYLES_TABLE; + $sql_sort = 'style_active DESC, ' . $sql_sort; $sql = 'SELECT user_style, COUNT(user_style) AS style_count FROM ' . USERS_TABLE . ' @@ -635,6 +636,8 @@ parse_css_file = {PARSE_CSS_FILE} 'NAME' => $row[$mode . '_name'], 'STYLE_COUNT' => ($mode == 'style' && isset($style_count[$row['style_id']])) ? $style_count[$row['style_id']] : 0, + + 'S_INACTIVE' => ($mode == 'style' && !$row['style_active']) ? true : false, ) ); } diff --git a/phpBB/language/en/acp/styles.php b/phpBB/language/en/acp/styles.php index 3c8c4a328f..3194a2ebd6 100644 --- a/phpBB/language/en/acp/styles.php +++ b/phpBB/language/en/acp/styles.php @@ -267,6 +267,7 @@ $lang = array_merge($lang, array( 'IMG_USER_ICON9' => 'User defined image 9', 'IMG_USER_ICON10' => 'User defined image 10', + 'INACTIVE_STYLES' => 'Inactive styles', 'INCLUDE_DIMENSIONS' => 'Include dimensions', 'INCLUDE_IMAGESET' => 'Include imageset', 'INCLUDE_TEMPLATE' => 'Include template', From c9733ad7195995a9f28ecbbc8aa3e94a05527114 Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 18 Dec 2011 16:28:35 +0800 Subject: [PATCH 040/279] [ticket/10532] Fix $start out of range for pre-made searches PHPBB3-10532 --- phpBB/search.php | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/phpBB/search.php b/phpBB/search.php index 2aa61401cf..07be438ab4 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -471,26 +471,33 @@ if ($keywords || $author || $author_id || $search_id || $submit) if ($search_id) { - if ($sql) + if ($sql || $search_id == 'unreadposts') { - // only return up to 1000 ids (the last one will be removed later) - $result = $db->sql_query_limit($sql, 1001 - $start, $start); - - while ($row = $db->sql_fetchrow($result)) + if ($sql) { - $id_ary[] = (int) $row[$field]; + // only return up to 1000 ids (the last one will be removed later) + $result = $db->sql_query_limit($sql, 1001); + + while ($row = $db->sql_fetchrow($result)) + { + $id_ary[] = (int) $row[$field]; + } + $db->sql_freeresult($result); + } + else if ($search_id == 'unreadposts') + { + $id_ary = array_keys(get_unread_topics($user->data['user_id'], $sql_where, $sql_sort, 1001)); } - $db->sql_freeresult($result); - $total_match_count = sizeof($id_ary) + $start; - $id_ary = array_slice($id_ary, 0, $per_page); - } - else if ($search_id == 'unreadposts') - { - $id_ary = array_keys(get_unread_topics($user->data['user_id'], $sql_where, $sql_sort, 1001 - $start, $start)); - - $total_match_count = sizeof($id_ary) + $start; - $id_ary = array_slice($id_ary, 0, $per_page); + if ($total_match_count = sizeof($id_ary)) + { + // Make sure $start is set to the last page if it exceeds the amount + if ($start < 0 || $start >= $total_match_count) + { + $start = ($start < 0) ? 0 : floor(($total_match_count - 1) / $per_page) * $per_page; + } + $id_ary = array_slice($id_ary, $start, $per_page); + } } else { From cb7bb31129a38cbdbeb682e869e51b1199b43bfb Mon Sep 17 00:00:00 2001 From: rxu Date: Sat, 14 Jan 2012 15:50:47 +0800 Subject: [PATCH 041/279] [ticket/10532] Adjust total match count and limit Set a variable for the limit of total matches count. Adjust total match count to limit to provide proper $start value calculation. Adjust $start value if no matches were found. PHPBB3-10532 --- phpBB/search.php | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/phpBB/search.php b/phpBB/search.php index 07be438ab4..3956478371 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -469,14 +469,18 @@ if ($keywords || $author || $author_id || $search_id || $submit) $per_page = ($show_results == 'posts') ? $config['posts_per_page'] : $config['topics_per_page']; $total_match_count = 0; + // Set limit for the $total_match_count to reduce server load + $total_matches_limit = 1000; + $found_more_search_matches = false; + if ($search_id) { if ($sql || $search_id == 'unreadposts') { if ($sql) { - // only return up to 1000 ids (the last one will be removed later) - $result = $db->sql_query_limit($sql, 1001); + // Only return up to $total_matches_limit+1 ids (the last one will be removed later) + $result = $db->sql_query_limit($sql, ($total_matches_limit + 1)); while ($row = $db->sql_fetchrow($result)) { @@ -486,11 +490,19 @@ if ($keywords || $author || $author_id || $search_id || $submit) } else if ($search_id == 'unreadposts') { - $id_ary = array_keys(get_unread_topics($user->data['user_id'], $sql_where, $sql_sort, 1001)); + // Only return up to $total_matches_limit+1 ids (the last one will be removed later) + $id_ary = array_keys(get_unread_topics($user->data['user_id'], $sql_where, $sql_sort, ($total_matches_limit + 1))); } if ($total_match_count = sizeof($id_ary)) { + // Limit the number to $total_matches_limit for pre-made searches + if ($total_match_count > $total_matches_limit) + { + $found_more_search_matches = true; + $total_match_count = $total_matches_limit; + } + // Make sure $start is set to the last page if it exceeds the amount if ($start < 0 || $start >= $total_match_count) { @@ -498,6 +510,11 @@ if ($keywords || $author || $author_id || $search_id || $submit) } $id_ary = array_slice($id_ary, $start, $per_page); } + else + { + // Set $start to 0 if no matches were found + $start = 0; + } } else { @@ -550,10 +567,8 @@ if ($keywords || $author || $author_id || $search_id || $submit) $icons = $cache->obtain_icons(); // Output header - if ($search_id && ($total_match_count > 1000)) + if ($found_more_search_matches) { - // limit the number to 1000 for pre-made searches - $total_match_count--; $l_search_matches = sprintf($user->lang['FOUND_MORE_SEARCH_MATCHES'], $total_match_count); } else From aa21bc2a733c1690ad7a371f962c244542135a43 Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 15 Jan 2012 18:18:04 +0800 Subject: [PATCH 042/279] [ticket/10589] Add alias to 'user_birthday' in $leap_year_birthdays definition PHPBB3-10589 --- phpBB/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/index.php b/phpBB/index.php index 0105a0a1bd..46694a6ec2 100644 --- a/phpBB/index.php +++ b/phpBB/index.php @@ -89,7 +89,7 @@ if ($config['load_birthdays'] && $config['allow_birthdays'] && $auth->acl_gets(' $leap_year_birthdays = ''; if ($now['mday'] == 28 && $now['mon'] == 2 && !$user->format_date(time(), 'L')) { - $leap_year_birthdays = " OR user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', 29, 2)) . "%'"; + $leap_year_birthdays = " OR u.user_birthday LIKE '" . $db->sql_escape(sprintf('%2d-%2d-', 29, 2)) . "%'"; } $sql = 'SELECT u.user_id, u.username, u.user_colour, u.user_birthday From 99164cd20b9d8ca77b1e9a54e0958cdb580945d0 Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 17 Jan 2011 00:01:04 +0700 Subject: [PATCH 043/279] [ticket/9831] Correctly store checkbox default value for boolean CPF. PHPBB3-9831 --- phpBB/includes/acp/acp_profile.php | 27 ++++++++++++++++++--- phpBB/includes/functions_profile_fields.php | 4 +-- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index 2e43b0545a..09a7a2f9ed 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -504,11 +504,26 @@ class acp_profile } } } - /* else if ($field_type == FIELD_BOOL && $key == 'field_default_value') + else if ($field_type == FIELD_BOOL && $key == 'field_default_value') { - // Get the number of options if this key is 'field_maxlen' - $var = request_var('field_default_value', 0); - }*/ + // 'field_length' == 1 defines radio buttons. Possible values are 1 or 2 only. + // 'field_length' == 2 defines checkbox. Possible values are 0 or 1 only. + // If we switch the type on step 2, we have to adjust field value. + // 1 is a common value for the checkbox and radio buttons. + + // If we switch to the checkbox type but former radio buttons value was 2, + // which is not the case for the checkbox, set it to 0 (unchecked). + if ($cp->vars['field_length'] == 2 && $var == 2) + { + $var = 0; + } + // If we switch to the radio buttons but the former checkbox value was 0, + // which is not the case for the radio buttons, set it to 0. + else if ($cp->vars['field_length'] == 1 && $var == 0) + { + $var = 2; + } + } else if ($field_type == FIELD_INT && $key == 'field_default_value') { // Permit an empty string @@ -676,6 +691,10 @@ class acp_profile { $_new_key_ary[$key] = utf8_normalize_nfc(request_var($key, array(array('')), true)); } + else if ($field_type == FIELD_BOOL && $key == 'field_default_value') + { + $_new_key_ary[$key] = request_var($key, $cp->vars[$key]); + } else { if (!isset($_REQUEST[$key])) diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index 1eae2a9ad6..7874608009 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -625,10 +625,10 @@ class custom_profile $profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident']; $user_ident = $profile_row['field_ident']; - // checkbox - only testing for isset + // checkbox - set the value to "true" if it has been set to 1 if ($profile_row['field_type'] == FIELD_BOOL && $profile_row['field_length'] == 2) { - $value = (isset($_REQUEST[$profile_row['field_ident']])) ? true : ((!isset($user->profile_fields[$user_ident]) || $preview) ? $default_value : $user->profile_fields[$user_ident]); + $value = (isset($_REQUEST[$profile_row['field_ident']]) && request_var($profile_row['field_ident'], $default_value) == 1) ? true : ((!isset($user->profile_fields[$user_ident]) || $preview) ? $default_value : $user->profile_fields[$user_ident]); } else if ($profile_row['field_type'] == FIELD_INT) { From 2cf586a37206df3528237a2c91e255539c95a513 Mon Sep 17 00:00:00 2001 From: Richard Foote Date: Tue, 17 Jan 2012 12:31:27 -0500 Subject: [PATCH 044/279] [ticket/10580] Remove checking of server timezone and DST when registering Remove checking of server timezone and DST. It causes a problem by selecting the wrong timezone when registering when the board_timezone is 1 hour less than the server timezone. PHPBB3-10580 --- phpBB/includes/ucp/ucp_register.php | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index 4e8729db56..6ad3a55589 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -165,24 +165,8 @@ class ucp_register $captcha->init(CONFIRM_REG); } - // Try to manually determine the timezone and adjust the dst if the server date/time complies with the default setting +/- 1 - $timezone = date('Z') / 3600; - $is_dst = date('I'); - - if ($config['board_timezone'] == $timezone || $config['board_timezone'] == ($timezone - 1)) - { - $timezone = ($is_dst) ? $timezone - 1 : $timezone; - - if (!isset($user->lang['tz_zones'][(string) $timezone])) - { - $timezone = $config['board_timezone']; - } - } - else - { - $is_dst = $config['board_dst']; - $timezone = $config['board_timezone']; - } + $is_dst = $config['board_dst']; + $timezone = $config['board_timezone']; $data = array( 'username' => utf8_normalize_nfc(request_var('username', '', true)), From 879c92e8a2b27586d6531de705ded49c6f662ffa Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Fri, 3 Feb 2012 15:38:52 +0200 Subject: [PATCH 045/279] [ticket/10569] Invalid string comparison in subsilver2 Fixing invalid string comparison in ucp_main_front.html in subsilver2 PHPBB3-10569 --- phpBB/styles/subsilver2/template/ucp_main_front.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/styles/subsilver2/template/ucp_main_front.html b/phpBB/styles/subsilver2/template/ucp_main_front.html index fdef0bd949..dc945c83d6 100644 --- a/phpBB/styles/subsilver2/template/ucp_main_front.html +++ b/phpBB/styles/subsilver2/template/ucp_main_front.html @@ -48,11 +48,11 @@ {L_ACTIVE_IN_FORUM}: - {ACTIVE_FORUM}
    [ {ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT} ]- + {ACTIVE_FORUM}
    [ {ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT} ]- {L_ACTIVE_IN_TOPIC}: - {ACTIVE_TOPIC}
    [ {ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT} ]- + {ACTIVE_TOPIC}
    [ {ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT} ]- From d2a34961498a03b77885af6a20497e87d36ad7ef Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Fri, 3 Feb 2012 16:00:14 +0200 Subject: [PATCH 046/279] [ticket/10616] Add template inheritance to default styles Adding template inheritance field to prosilver and subsilver2 PHPBB3-10616 --- phpBB/styles/prosilver/template/template.cfg | 5 +++++ phpBB/styles/subsilver2/template/template.cfg | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/phpBB/styles/prosilver/template/template.cfg b/phpBB/styles/prosilver/template/template.cfg index d31dcb7356..0b0533573a 100644 --- a/phpBB/styles/prosilver/template/template.cfg +++ b/phpBB/styles/prosilver/template/template.cfg @@ -23,3 +23,8 @@ version = 3.0.10 # Defining a different template bitfield template_bitfield = lNg= + +# Template inheritance +# See http://blog.phpbb.com/2008/07/31/templating-just-got-easier/ +# Set value to empty to ignore template inheritance +inherit_from = prosilver diff --git a/phpBB/styles/subsilver2/template/template.cfg b/phpBB/styles/subsilver2/template/template.cfg index 4e5c36af99..d557edba87 100644 --- a/phpBB/styles/subsilver2/template/template.cfg +++ b/phpBB/styles/subsilver2/template/template.cfg @@ -21,3 +21,7 @@ name = subsilver2 copyright = © phpBB Group, 2003 version = 3.0.10 +# Template inheritance +# See http://blog.phpbb.com/2008/07/31/templating-just-got-easier/ +# Set value to empty to ignore template inheritance +inherit_from = subsilver2 From 4aef6ea979befe9c40b3253ed10678a4eeb74160 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Fri, 3 Feb 2012 16:09:48 +0200 Subject: [PATCH 047/279] [ticket/10616] Ignore template inheritance that points to self Ignore template inheritance if it points to self PHPBB3-10616 --- phpBB/includes/functions.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 1eefaee651..4d2a00f2db 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3322,6 +3322,11 @@ function parse_cfg_file($filename, $lines = false) $parsed_items[$key] = $value; } + + if (isset($parsed_items['inherit_from']) && isset($parsed_items['name']) && $parsed_items['inherit_from'] == $parsed_items['name']) + { + unset($parsed_items['inherit_from']); + } return $parsed_items; } From 326ff46ef7812f9f725e680e5202364c6b25bb4b Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Fri, 3 Feb 2012 16:19:42 +0200 Subject: [PATCH 048/279] [ticket/10616] Add template inheritance to exported template Add template inheritance when exporting template.cfg PHPBB3-10616 --- phpBB/includes/acp/acp_styles.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php index 5a7902755e..d7b0484af8 100644 --- a/phpBB/includes/acp/acp_styles.php +++ b/phpBB/includes/acp/acp_styles.php @@ -99,11 +99,11 @@ parse_css_file = {PARSE_CSS_FILE} $this->template_cfg .= ' # Some configuration options -# -# You can use this function to inherit templates from another template. -# The template of the given name has to be installed. -# Templates cannot inherit from inheriting templates. -#'; +# Template inheritance +# See http://blog.phpbb.com/2008/07/31/templating-just-got-easier/ +# Set value to empty or this template name to ignore template inheritance. +inherit_from = {INHERIT_FROM} +'; $this->imageset_keys = array( 'logos' => array( @@ -2047,9 +2047,7 @@ parse_css_file = {PARSE_CSS_FILE} // Export template core code if ($mode == 'template' || $inc_template) { - $template_cfg = str_replace(array('{MODE}', '{NAME}', '{COPYRIGHT}', '{VERSION}'), array($mode, $style_row['template_name'], $style_row['template_copyright'], $config['version']), $this->template_cfg); - - $use_template_name = ''; + $use_template_name = $style_row['template_name']; // Add the inherit from variable, depending on it's use... if ($style_row['template_inherits_id']) @@ -2063,7 +2061,8 @@ parse_css_file = {PARSE_CSS_FILE} $db->sql_freeresult($result); } - $template_cfg .= ($use_template_name) ? "\ninherit_from = $use_template_name" : "\n#inherit_from = "; + $template_cfg = str_replace(array('{MODE}', '{NAME}', '{COPYRIGHT}', '{VERSION}', '{INHERIT_FROM}'), array($mode, $style_row['template_name'], $style_row['template_copyright'], $config['version'], $use_template_name), $this->template_cfg); + $template_cfg .= "\n\nbbcode_bitfield = {$style_row['bbcode_bitfield']}"; $data[] = array( From 225892f506e0a109e710534fee64a11614921d88 Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Fri, 3 Feb 2012 16:14:48 +0000 Subject: [PATCH 049/279] [ticket/9914] Add backup warning to updater. PHPBB3-9914 --- phpBB/adm/style/install_update.html | 5 +++++ phpBB/language/en/install.php | 1 + 2 files changed, 6 insertions(+) diff --git a/phpBB/adm/style/install_update.html b/phpBB/adm/style/install_update.html index 22d21d8314..818889c89b 100644 --- a/phpBB/adm/style/install_update.html +++ b/phpBB/adm/style/install_update.html @@ -43,6 +43,11 @@

    {WARNING_MSG}

    + +
    +

    {L_NOTICE}

    +

    {L_BACKUP_NOTICE}

    +
    diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php index f69ca40613..bbf407f1dc 100644 --- a/phpBB/language/en/install.php +++ b/phpBB/language/en/install.php @@ -52,6 +52,7 @@ $lang = array_merge($lang, array( 'BLANK_PREFIX_FOUND' => 'A scan of your tables has shown a valid installation using no table prefix.', 'BOARD_NOT_INSTALLED' => 'No installation found', 'BOARD_NOT_INSTALLED_EXPLAIN' => 'The phpBB Unified Convertor Framework requires a default installation of phpBB3 to function, please proceed by first installing phpBB3.', + 'BACKUP_NOTICE' => 'Please backup your board before updating in case any problems arise during the update process.', 'CATEGORY' => 'Category', 'CACHE_STORE' => 'Cache type', From c0b3239bf39f6a052dd8f481561ca0442f19ede8 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 4 Feb 2012 00:31:59 +0100 Subject: [PATCH 050/279] [ticket/10512] Call startup.php from tests/bootstrap.php PHPBB3-10512 --- tests/bootstrap.php | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 16aed68405..2fb805043e 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -10,25 +10,9 @@ define('IN_PHPBB', true); $phpbb_root_path = 'phpBB/'; $phpEx = 'php'; +require_once $phpbb_root_path . 'includes/startup.php'; + $table_prefix = 'phpbb_'; - -if (!defined('E_DEPRECATED')) -{ - define('E_DEPRECATED', 8192); -} -error_reporting(E_ALL & ~E_DEPRECATED); - -// If we are on PHP >= 6.0.0 we do not need some code -if (version_compare(PHP_VERSION, '6.0.0-dev', '>=')) -{ - define('STRIP', false); -} -else -{ - @set_magic_quotes_runtime(0); - define('STRIP', (get_magic_quotes_gpc()) ? true : false); -} - require_once $phpbb_root_path . 'includes/constants.php'; require_once 'test_framework/phpbb_test_case_helpers.php'; From f832f5a4ee88459dae6fda7e1b303b15f84768dc Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 5 Feb 2012 22:03:02 +0800 Subject: [PATCH 051/279] [ticket/9831] Fix saving unchecked checkbox field value PHPBB3-9831 --- phpBB/includes/acp/acp_profile.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php index 09a7a2f9ed..a591474fce 100644 --- a/phpBB/includes/acp/acp_profile.php +++ b/phpBB/includes/acp/acp_profile.php @@ -511,6 +511,14 @@ class acp_profile // If we switch the type on step 2, we have to adjust field value. // 1 is a common value for the checkbox and radio buttons. + // Adjust unchecked checkbox value. + // If we return or save settings from 2nd/3rd page + // and the checkbox is unchecked, set the value to 0. + if (isset($_REQUEST['step']) && !isset($_REQUEST[$key])) + { + $var = 0; + } + // If we switch to the checkbox type but former radio buttons value was 2, // which is not the case for the checkbox, set it to 0 (unchecked). if ($cp->vars['field_length'] == 2 && $var == 2) From 62288b3c05049cb02732204af062e0baa1191992 Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Tue, 7 Feb 2012 22:03:24 +0200 Subject: [PATCH 052/279] [ticket/10569] Invalid string comparison in prosilver Fixing invalid string comparison in ucp_main_front.html in prosilver PHPBB3-10569 --- phpBB/styles/prosilver/template/ucp_main_front.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/styles/prosilver/template/ucp_main_front.html b/phpBB/styles/prosilver/template/ucp_main_front.html index 39c5d4f396..4a6fa3bf86 100644 --- a/phpBB/styles/prosilver/template/ucp_main_front.html +++ b/phpBB/styles/prosilver/template/ucp_main_front.html @@ -34,8 +34,8 @@
    {L_JOINED}:
    {JOINED}
    {L_VISITED}:
    {LAST_VISIT_YOU}
    {L_TOTAL_POSTS}:
    {POSTS} | {L_SEARCH_YOUR_POSTS}
    ({POSTS_DAY} / {POSTS_PCT}){POSTS}
    -
    {L_ACTIVE_IN_FORUM}:
    {ACTIVE_FORUM}
    ({ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT})
    -
    {L_ACTIVE_IN_TOPIC}:
    {ACTIVE_TOPIC}
    ({ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT})
    +
    {L_ACTIVE_IN_FORUM}:
    {ACTIVE_FORUM}
    ({ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT})
    +
    {L_ACTIVE_IN_TOPIC}:
    {ACTIVE_TOPIC}
    ({ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT})
    {L_YOUR_WARNINGS}:
    {WARNING_IMG} [{WARNINGS}]
    From f894da0d25f2ecc4c8f3c039dd9f40607137d4ca Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 9 Feb 2012 15:13:29 +0100 Subject: [PATCH 053/279] [ticket/10633] Stop leaking filename of attachments when thumbnail is requested While filenames are chosen at random and there is no correlation between the original filename and the new filesystem filename, there is a correlation between filesystem filename and filesytem filename of thumbnails. Adjust error message to no longer include the physical filename and make it consistent with the error message that is shown when there is no attachment at all. This information was mostly useless for regular users (i.e. non-admins) anyway. PHPBB3-10633 --- phpBB/download/file.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/download/file.php b/phpBB/download/file.php index c17f0cf018..bf277c69fa 100644 --- a/phpBB/download/file.php +++ b/phpBB/download/file.php @@ -424,7 +424,7 @@ function send_file_to_browser($attachment, $upload_dir, $category) if (!@file_exists($filename)) { send_status_line(404, 'Not Found'); - trigger_error($user->lang['ERROR_NO_ATTACHMENT'] . '

    ' . sprintf($user->lang['FILE_NOT_FOUND_404'], $filename)); + trigger_error('ERROR_NO_ATTACHMENT'); } // Correct the mime type - we force application/octetstream for all files, except images From 35d5d527dbe2de1a608e6af4b004ed807ff22743 Mon Sep 17 00:00:00 2001 From: James King Date: Wed, 8 Feb 2012 01:33:08 +0000 Subject: [PATCH 054/279] [ticket/10606] Fix incorrect hidden fields array name in page_header(). Regression from dfb7cc625a37c6345fa647ee3a21f890ba5c9649. PHPBB3-10606 --- phpBB/includes/functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 4d2a00f2db..0320230a7d 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -4553,7 +4553,7 @@ function page_header($page_title = '', $display_online_list = true, $item_id = 0 foreach ($_EXTRA_URL as $url_param) { $url_param = explode('=', $url_param, 2); - $s_hidden_fields[$url_param[0]] = $url_param[1]; + $s_search_hidden_fields[$url_param[0]] = $url_param[1]; } } From a962e788542dac43a365afde295babf3ee681535 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 9 Feb 2012 15:29:21 +0100 Subject: [PATCH 055/279] [ticket/10606] Also correctly use $s_search_hidden_fields in view(forum|topic). Regression from dfb7cc625a37c6345fa647ee3a21f890ba5c9649. PHPBB3-10606 --- phpBB/viewforum.php | 2 +- phpBB/viewtopic.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 588f60b589..6fec662b02 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -278,7 +278,7 @@ if (!empty($_EXTRA_URL)) foreach ($_EXTRA_URL as $url_param) { $url_param = explode('=', $url_param, 2); - $s_hidden_fields[$url_param[0]] = $url_param[1]; + $s_search_hidden_fields[$url_param[0]] = $url_param[1]; } } diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 01cd6a28a8..74420a25c7 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -607,7 +607,7 @@ if (!empty($_EXTRA_URL)) foreach ($_EXTRA_URL as $url_param) { $url_param = explode('=', $url_param, 2); - $s_hidden_fields[$url_param[0]] = $url_param[1]; + $s_search_hidden_fields[$url_param[0]] = $url_param[1]; } } From 345e8e084fd5ab7f99442ce6515a786a90806e2e Mon Sep 17 00:00:00 2001 From: rxu Date: Fri, 10 Feb 2012 00:31:13 +0800 Subject: [PATCH 056/279] [ticket/9084] Don't hide 'non-entered' dropdown CPF value if not required PHPBB3-9084 --- phpBB/includes/functions_profile_fields.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index 1eae2a9ad6..79701429e6 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -571,7 +571,7 @@ class custom_profile $this->get_option_lang($field_id, $lang_id, FIELD_DROPDOWN, false); } - if ($value == $ident_ary['data']['field_novalue']) + if ($value == $ident_ary['data']['field_novalue'] && $ident_ary['data']['field_required']) { return NULL; } From 17f5c6bf71f560be2f4e2ecabae83ab2973bec47 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 18 Feb 2012 12:00:12 +0100 Subject: [PATCH 057/279] [ticket/10605] Check for orphan privmsgs when deleting a user Also moved the hole code into a new function. PHPBB3-10605 --- phpBB/includes/functions_privmsgs.php | 116 ++++++++++++++++++++++++++ phpBB/includes/functions_user.php | 58 +------------ 2 files changed, 120 insertions(+), 54 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index c40ceb088f..30cff8ed72 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1083,6 +1083,122 @@ function delete_pm($user_id, $msg_ids, $folder_id) return true; } +/** +* Delete all PM(s) for a given user and delete the ones without references +*/ +function delete_user_pms($user_id) +{ + global $db, $user, $phpbb_root_path, $phpEx; + + $user_id = (int) $user_id; + + if (!$user_id) + { + return false; + } + + // Get PM Information for later deleting + $sql = 'SELECT msg_id, author_id, folder_id, pm_unread, pm_new + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE user_id = ' . $user_id . ' + OR (author_id = ' . $user_id . ' + AND folder_id = ' . PRIVMSGS_NO_BOX . ')'; + $result = $db->sql_query($sql); + + $undelivered_msg = $undelivered_user = $delete_rows = array(); + $num_unread = $num_new = $num_deleted = 0; + 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_user[$row['user_id']][] = true; + } + + $delete_rows[$row['msg_id']] = 1; + } + $db->sql_freeresult($result); + + if (!sizeof($delete_rows)) + { + return false; + } + + $db->sql_transaction('begin'); + + if (sizeof($undelivered_msg)) + { + $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . ' + WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg); + $db->sql_query($sql); + } + + foreach ($undelivered_user as $_user_id => $ary) + { + if ($_user_id == $user_id) + { + continue; + } + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_new_privmsg = user_new_privmsg - ' . sizeof($ary) . ', + user_unread_privmsg = user_unread_privmsg - ' . sizeof($ary) . ' + 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', array_keys($delete_rows)); + $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', array_keys($delete_rows)); + $result = $db->sql_query($sql); + + while ($row = $db->sql_fetchrow($result)) + { + unset($delete_rows[$row['msg_id']]); + } + $db->sql_freeresult($result); + + $delete_ids = array_keys($delete_rows); + + if (sizeof($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 - this way users are still able to read messages from users being removed + $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' + SET author_id = ' . ANONYMOUS . ' + WHERE author_id = ' . $user_id; + $db->sql_query($sql); + + $sql = 'UPDATE ' . PRIVMSGS_TABLE . ' + SET author_id = ' . ANONYMOUS . ' + WHERE author_id = ' . $user_id; + $db->sql_query($sql); + + $db->sql_transaction('commit'); + + return true; +} + /** * Rebuild message header */ diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 6b5cca8abb..20923ea495 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -528,62 +528,12 @@ function user_delete($mode, $user_id, $post_username = false) WHERE session_user_id = ' . $user_id; $db->sql_query($sql); - // Remove any undelivered mails... - $sql = 'SELECT msg_id, user_id - FROM ' . PRIVMSGS_TO_TABLE . ' - WHERE author_id = ' . $user_id . ' - AND folder_id = ' . PRIVMSGS_NO_BOX; - $result = $db->sql_query($sql); - - $undelivered_msg = $undelivered_user = array(); - while ($row = $db->sql_fetchrow($result)) + // Clean the private messages tables from the user + if (!function_exists('delete_user_pms')) { - $undelivered_msg[] = $row['msg_id']; - $undelivered_user[$row['user_id']][] = true; - } - $db->sql_freeresult($result); - - if (sizeof($undelivered_msg)) - { - $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . ' - WHERE ' . $db->sql_in_set('msg_id', $undelivered_msg); - $db->sql_query($sql); - } - - $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . ' - WHERE author_id = ' . $user_id . ' - AND folder_id = ' . PRIVMSGS_NO_BOX; - $db->sql_query($sql); - - // Delete all to-information - $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . ' - WHERE user_id = ' . $user_id; - $db->sql_query($sql); - - // Set the remaining author id to anonymous - this way users are still able to read messages from users being removed - $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' - SET author_id = ' . ANONYMOUS . ' - WHERE author_id = ' . $user_id; - $db->sql_query($sql); - - $sql = 'UPDATE ' . PRIVMSGS_TABLE . ' - SET author_id = ' . ANONYMOUS . ' - WHERE author_id = ' . $user_id; - $db->sql_query($sql); - - foreach ($undelivered_user as $_user_id => $ary) - { - if ($_user_id == $user_id) - { - continue; - } - - $sql = 'UPDATE ' . USERS_TABLE . ' - SET user_new_privmsg = user_new_privmsg - ' . sizeof($ary) . ', - user_unread_privmsg = user_unread_privmsg - ' . sizeof($ary) . ' - WHERE user_id = ' . $_user_id; - $db->sql_query($sql); + include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); } + delete_user_pms($user_id); $db->sql_transaction('commit'); From 11c5a6621389af854170d3190432d3f414c77618 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 18 Feb 2012 23:31:31 +0100 Subject: [PATCH 058/279] [ticket/10658] Use get_user_rank() for group ranks on group view. The old code was buggy because it did not prefix the path with the phpBB root path which causes problems with bridges and other URL rewriting. PHPBB3-10658 --- phpBB/memberlist.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index b3c0bae16a..cfa1631dbe 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -1221,21 +1221,16 @@ switch ($mode) // Misusing the avatar function for displaying group avatars... $avatar_img = get_user_avatar($group_row['group_avatar'], $group_row['group_avatar_type'], $group_row['group_avatar_width'], $group_row['group_avatar_height'], 'GROUP_AVATAR'); + // ... same for group rank $rank_title = $rank_img = $rank_img_src = ''; if ($group_row['group_rank']) { - if (isset($ranks['special'][$group_row['group_rank']])) + get_user_rank($group_row['group_rank'], false, $rank_title, $rank_img, $rank_img_src); + + if ($rank_img) { - $rank_title = $ranks['special'][$group_row['group_rank']]['rank_title']; + $rank_img .= '
    '; } - $rank_img = (!empty($ranks['special'][$group_row['group_rank']]['rank_image'])) ? '' . $ranks['special'][$group_row['group_rank']]['rank_title'] . '
    ' : ''; - $rank_img_src = (!empty($ranks['special'][$group_row['group_rank']]['rank_image'])) ? $config['ranks_path'] . '/' . $ranks['special'][$group_row['group_rank']]['rank_image'] : ''; - } - else - { - $rank_title = ''; - $rank_img = ''; - $rank_img_src = ''; } $template->assign_vars(array( From c3265c913817e5e774d30993c181d70e853b60d4 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 20 Feb 2012 01:52:33 +0100 Subject: [PATCH 059/279] [ticket/10639] Do not allow negative post count as rank's minimum posts PHPBB3-10639 --- phpBB/includes/acp/acp_ranks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_ranks.php b/phpBB/includes/acp/acp_ranks.php index dfd7511427..ea057cd84c 100644 --- a/phpBB/includes/acp/acp_ranks.php +++ b/phpBB/includes/acp/acp_ranks.php @@ -52,7 +52,7 @@ class acp_ranks } $rank_title = utf8_normalize_nfc(request_var('title', '', true)); $special_rank = request_var('special_rank', 0); - $min_posts = ($special_rank) ? 0 : request_var('min_posts', 0); + $min_posts = ($special_rank) ? 0 : max(0, request_var('min_posts', 0)); $rank_image = request_var('rank_image', ''); // The rank image has to be a jpg, gif or png From afcf9cbc8617462853d3b42e4dfc9f1f46051e79 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 20 Feb 2012 02:14:23 +0100 Subject: [PATCH 060/279] [ticket/10630] Perform array_unique on authors array before creating the query This is needed to avoid an additional appearance for an author for every post he made. PHPBB3-10630 --- phpBB/includes/search/fulltext_mysql.php | 2 +- phpBB/includes/search/fulltext_native.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 29cdd8ee9a..52372a14d8 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -707,7 +707,7 @@ class fulltext_mysql extends search_backend */ function index_remove($post_ids, $author_ids, $forum_ids) { - $this->destroy_cache(array(), $author_ids); + $this->destroy_cache(array(), array_unique($author_ids)); } /** diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index 727e3aaffb..b63205fd76 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -1334,7 +1334,7 @@ class fulltext_native extends search_backend $db->sql_query($sql); } - $this->destroy_cache(array_unique($word_texts), $author_ids); + $this->destroy_cache(array_unique($word_texts), array_unique($author_ids)); } /** From ef154b78a169402e7f968cd2189b69b041a73543 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 20 Feb 2012 02:16:41 +0100 Subject: [PATCH 061/279] [ticket/10630] Use sql_like_expression() method instead of hardcoded LIKE '%x%' PHPBB3-10630 --- phpBB/includes/search/search.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/search/search.php b/phpBB/includes/search/search.php index 2f20d11495..df7c8a0892 100644 --- a/phpBB/includes/search/search.php +++ b/phpBB/includes/search/search.php @@ -295,7 +295,7 @@ class search_backend $sql_where = ''; foreach ($authors as $author) { - $sql_where .= (($sql_where) ? ' OR ' : '') . 'search_authors LIKE \'% ' . (int) $author . ' %\''; + $sql_where .= (($sql_where) ? ' OR ' : '') . 'search_authors ' . $db->sql_like_expression($db->any_char . ' ' . (int) $author . ' ' . $db->any_char); } $sql = 'SELECT search_key From cd5c01ac2da2ec316e997e8850e1b2d326191e56 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 21 Feb 2012 11:10:10 +0100 Subject: [PATCH 062/279] [ticket/9089] Add tabindex to PM recipient box, to allow tabbing to the subject I also added tabindex 1 to the buttons for adding the recipients. Also note, that duplicated tabindex are fine: http://www.w3.org/TR/html4/interact/forms.html#adef-tabindex PHPBB3-9089 --- phpBB/styles/prosilver/template/posting_editor.html | 6 +++--- phpBB/styles/subsilver2/template/ucp_header.html | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/phpBB/styles/prosilver/template/posting_editor.html b/phpBB/styles/prosilver/template/posting_editor.html index 5f7fb8408e..e7c1dc21eb 100644 --- a/phpBB/styles/prosilver/template/posting_editor.html +++ b/phpBB/styles/prosilver/template/posting_editor.html @@ -37,10 +37,10 @@
    -
    +
    {L_FIND_USERNAME}
    -
    -
    +
    +
    diff --git a/phpBB/styles/subsilver2/template/ucp_header.html b/phpBB/styles/subsilver2/template/ucp_header.html index ea64dcb299..1566a15929 100644 --- a/phpBB/styles/subsilver2/template/ucp_header.html +++ b/phpBB/styles/subsilver2/template/ucp_header.html @@ -26,7 +26,7 @@ {L_USERNAMES}: -
    +
    [ {L_FIND_USERNAME} ] @@ -41,7 +41,7 @@ -
      
      
    +
      
      
    From 340a8f19d687efab84de9335e7c40cabeef90acf Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 21 Feb 2012 11:25:22 +0100 Subject: [PATCH 063/279] [ticket/10456] Add tabindex to subsilver2 captcha Did not set tabindex on registration page, as the hole page does not have any. PHPBB3-10456 --- phpBB/styles/subsilver2/template/captcha_default.html | 2 +- phpBB/styles/subsilver2/template/captcha_qa.html | 2 +- phpBB/styles/subsilver2/template/login_body.html | 2 +- phpBB/styles/subsilver2/template/posting_body.html | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/phpBB/styles/subsilver2/template/captcha_default.html b/phpBB/styles/subsilver2/template/captcha_default.html index 4c65f81643..e2edf0b810 100644 --- a/phpBB/styles/subsilver2/template/captcha_default.html +++ b/phpBB/styles/subsilver2/template/captcha_default.html @@ -12,6 +12,6 @@ {L_CONFIRM_CODE}:
    {L_CONFIRM_CODE_EXPLAIN} - + tabindex="{$CAPTCHA_TAB_INDEX}" /> diff --git a/phpBB/styles/subsilver2/template/captcha_qa.html b/phpBB/styles/subsilver2/template/captcha_qa.html index 23d2a92f68..acc9cdcdfb 100644 --- a/phpBB/styles/subsilver2/template/captcha_qa.html +++ b/phpBB/styles/subsilver2/template/captcha_qa.html @@ -3,6 +3,6 @@ {QA_CONFIRM_QUESTION}:
    {L_CONFIRM_QUESTION_EXPLAIN} - + tabindex="{$CAPTCHA_TAB_INDEX}" /> diff --git a/phpBB/styles/subsilver2/template/login_body.html b/phpBB/styles/subsilver2/template/login_body.html index 262341e0c0..ba316517a9 100644 --- a/phpBB/styles/subsilver2/template/login_body.html +++ b/phpBB/styles/subsilver2/template/login_body.html @@ -68,7 +68,7 @@ - + diff --git a/phpBB/styles/subsilver2/template/posting_body.html b/phpBB/styles/subsilver2/template/posting_body.html index fec6d7ff6c..d7947caf2f 100644 --- a/phpBB/styles/subsilver2/template/posting_body.html +++ b/phpBB/styles/subsilver2/template/posting_body.html @@ -333,6 +333,7 @@ + From 8e1e48a7b69b78e10297869e3aaf224e5c12e493 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 23 Feb 2012 10:55:57 +0100 Subject: [PATCH 064/279] [ticket/8636] Add resync option to topic_view moderation page PHPBB3-8636 --- phpBB/includes/mcp/mcp_topic.php | 11 +++++++++++ phpBB/styles/prosilver/template/mcp_topic.html | 1 + phpBB/styles/subsilver2/template/mcp_topic.html | 1 + 3 files changed, 13 insertions(+) diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php index d7cc1e795a..7d4edaf362 100644 --- a/phpBB/includes/mcp/mcp_topic.php +++ b/phpBB/includes/mcp/mcp_topic.php @@ -50,6 +50,16 @@ function mcp_topic_view($id, $mode, $action) $submitted_id_list = request_var('post_ids', array(0)); $checked_ids = $post_id_list = request_var('post_id_list', array(0)); + // Resync Topic? + if ($action == 'resync') + { + if (!function_exists('mcp_resync_topics')) + { + include($phpbb_root_path . 'includes/mcp/mcp_forum.' . $phpEx); + } + mcp_resync_topics(array($topic_id)); + } + // Split Topic? if ($action == 'split_all' || $action == 'split_beyond') { @@ -320,6 +330,7 @@ function mcp_topic_view($id, $mode, $action) 'S_CAN_APPROVE' => ($has_unapproved_posts && $auth->acl_get('m_approve', $topic_info['forum_id'])) ? true : false, 'S_CAN_LOCK' => ($auth->acl_get('m_lock', $topic_info['forum_id'])) ? true : false, 'S_CAN_REPORT' => ($auth->acl_get('m_report', $topic_info['forum_id'])) ? true : false, + 'S_CAN_SYNC' => $auth->acl_get('m_', $topic_info['forum_id']), 'S_REPORT_VIEW' => ($action == 'reports') ? true : false, 'S_MERGE_VIEW' => ($action == 'merge') ? true : false, 'S_SPLIT_VIEW' => ($action == 'split') ? true : false, diff --git a/phpBB/styles/prosilver/template/mcp_topic.html b/phpBB/styles/prosilver/template/mcp_topic.html index a4d2a0f600..2a5f52f038 100644 --- a/phpBB/styles/prosilver/template/mcp_topic.html +++ b/phpBB/styles/prosilver/template/mcp_topic.html @@ -158,6 +158,7 @@ onload_functions.push('subPanels()'); +   diff --git a/phpBB/styles/subsilver2/template/mcp_topic.html b/phpBB/styles/subsilver2/template/mcp_topic.html index 13865d26ee..f9f9382ff2 100644 --- a/phpBB/styles/subsilver2/template/mcp_topic.html +++ b/phpBB/styles/subsilver2/template/mcp_topic.html @@ -135,6 +135,7 @@ +  
    From 8f3fba885859e00646531632558d75b609ecf813 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 26 Feb 2012 01:58:17 +0100 Subject: [PATCH 065/279] [ticket/10532] Put $total_match_count assignment onto its own line. PHPBB3-10532 --- phpBB/search.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phpBB/search.php b/phpBB/search.php index 3956478371..87e40832a5 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -494,7 +494,8 @@ if ($keywords || $author || $author_id || $search_id || $submit) $id_ary = array_keys(get_unread_topics($user->data['user_id'], $sql_where, $sql_sort, ($total_matches_limit + 1))); } - if ($total_match_count = sizeof($id_ary)) + $total_match_count = sizeof($id_ary); + if ($total_match_count) { // Limit the number to $total_matches_limit for pre-made searches if ($total_match_count > $total_matches_limit) From 459e8dc09522d8e54ce82182a99ebddf2362a737 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 26 Feb 2012 02:15:39 +0100 Subject: [PATCH 066/279] [ticket/10532] Get rid of inline calculation of $start, remove duplicated check PHPBB3-10532 --- phpBB/search.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/phpBB/search.php b/phpBB/search.php index 87e40832a5..3006c0e5d9 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -505,10 +505,15 @@ if ($keywords || $author || $author_id || $search_id || $submit) } // Make sure $start is set to the last page if it exceeds the amount - if ($start < 0 || $start >= $total_match_count) + if ($start < 0) { - $start = ($start < 0) ? 0 : floor(($total_match_count - 1) / $per_page) * $per_page; + $start = 0; } + else if ($start >= $total_match_count) + { + $start = floor(($total_match_count - 1) / $per_page) * $per_page; + } + $id_ary = array_slice($id_ary, $start, $per_page); } else From 6548a3094f2981a19ff001e67596befab4159ecd Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 26 Feb 2012 02:19:12 +0100 Subject: [PATCH 067/279] [ticket/10532] Remove one unnecessary level of if block nesting. PHPBB3-10532 --- phpBB/search.php | 81 +++++++++++++++++++++++------------------------- 1 file changed, 39 insertions(+), 42 deletions(-) diff --git a/phpBB/search.php b/phpBB/search.php index 3006c0e5d9..d89bc79225 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -475,57 +475,54 @@ if ($keywords || $author || $author_id || $search_id || $submit) if ($search_id) { - if ($sql || $search_id == 'unreadposts') + if ($sql) { - if ($sql) - { - // Only return up to $total_matches_limit+1 ids (the last one will be removed later) - $result = $db->sql_query_limit($sql, ($total_matches_limit + 1)); + // Only return up to $total_matches_limit+1 ids (the last one will be removed later) + $result = $db->sql_query_limit($sql, ($total_matches_limit + 1)); - while ($row = $db->sql_fetchrow($result)) - { - $id_ary[] = (int) $row[$field]; - } - $db->sql_freeresult($result); - } - else if ($search_id == 'unreadposts') + while ($row = $db->sql_fetchrow($result)) { - // Only return up to $total_matches_limit+1 ids (the last one will be removed later) - $id_ary = array_keys(get_unread_topics($user->data['user_id'], $sql_where, $sql_sort, ($total_matches_limit + 1))); - } - - $total_match_count = sizeof($id_ary); - if ($total_match_count) - { - // Limit the number to $total_matches_limit for pre-made searches - if ($total_match_count > $total_matches_limit) - { - $found_more_search_matches = true; - $total_match_count = $total_matches_limit; - } - - // Make sure $start is set to the last page if it exceeds the amount - if ($start < 0) - { - $start = 0; - } - else if ($start >= $total_match_count) - { - $start = floor(($total_match_count - 1) / $per_page) * $per_page; - } - - $id_ary = array_slice($id_ary, $start, $per_page); - } - else - { - // Set $start to 0 if no matches were found - $start = 0; + $id_ary[] = (int) $row[$field]; } + $db->sql_freeresult($result); + } + else if ($search_id == 'unreadposts') + { + // Only return up to $total_matches_limit+1 ids (the last one will be removed later) + $id_ary = array_keys(get_unread_topics($user->data['user_id'], $sql_where, $sql_sort, ($total_matches_limit + 1))); } else { $search_id = ''; } + + $total_match_count = sizeof($id_ary); + if ($total_match_count) + { + // Limit the number to $total_matches_limit for pre-made searches + if ($total_match_count > $total_matches_limit) + { + $found_more_search_matches = true; + $total_match_count = $total_matches_limit; + } + + // Make sure $start is set to the last page if it exceeds the amount + if ($start < 0) + { + $start = 0; + } + else if ($start >= $total_match_count) + { + $start = floor(($total_match_count - 1) / $per_page) * $per_page; + } + + $id_ary = array_slice($id_ary, $start, $per_page); + } + else + { + // Set $start to 0 if no matches were found + $start = 0; + } } // make sure that some arrays are always in the same order From 7a061cfc6ea52f86d623e496d7355413739b6254 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 26 Feb 2012 02:29:49 +0100 Subject: [PATCH 068/279] [ticket/10532] Remove unnecessary parentheses around calculations of addition. PHPBB3-10532 --- phpBB/search.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/search.php b/phpBB/search.php index d89bc79225..8cb2020630 100644 --- a/phpBB/search.php +++ b/phpBB/search.php @@ -478,7 +478,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) if ($sql) { // Only return up to $total_matches_limit+1 ids (the last one will be removed later) - $result = $db->sql_query_limit($sql, ($total_matches_limit + 1)); + $result = $db->sql_query_limit($sql, $total_matches_limit + 1); while ($row = $db->sql_fetchrow($result)) { @@ -489,7 +489,7 @@ if ($keywords || $author || $author_id || $search_id || $submit) else if ($search_id == 'unreadposts') { // Only return up to $total_matches_limit+1 ids (the last one will be removed later) - $id_ary = array_keys(get_unread_topics($user->data['user_id'], $sql_where, $sql_sort, ($total_matches_limit + 1))); + $id_ary = array_keys(get_unread_topics($user->data['user_id'], $sql_where, $sql_sort, $total_matches_limit + 1)); } else { From d3d8793c1fb161c6450e50c09062c5e4fc9b11aa Mon Sep 17 00:00:00 2001 From: Vjacheslav Trushkin Date: Sun, 26 Feb 2012 16:54:31 +0200 Subject: [PATCH 069/279] [ticket/10453] Fixing spacing Fixing spacing PHPBB3-10453 --- phpBB/styles/prosilver/template/ucp_pm_message_header.html | 2 +- phpBB/styles/prosilver/template/ucp_pm_viewmessage.html | 2 +- phpBB/styles/prosilver/theme/cp.css | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/styles/prosilver/template/ucp_pm_message_header.html b/phpBB/styles/prosilver/template/ucp_pm_message_header.html index c3b7e54f45..ae66dd0a36 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_message_header.html +++ b/phpBB/styles/prosilver/template/ucp_pm_message_header.html @@ -11,7 +11,7 @@ - +
    diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html index 79c2c0355f..1840732b64 100644 --- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html +++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html @@ -2,7 +2,7 @@ -
    +
    diff --git a/phpBB/styles/prosilver/theme/cp.css b/phpBB/styles/prosilver/theme/cp.css index e28887d60f..aed88831a8 100644 --- a/phpBB/styles/prosilver/theme/cp.css +++ b/phpBB/styles/prosilver/theme/cp.css @@ -358,7 +358,7 @@ dl.mini dd { } .reply-all { - font-size: 11px; + font-size: 11px; padding-top: 5px; } From 45f39c6d1f2adc318d521bd9eb75d80f0750fdb8 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sat, 18 Feb 2012 12:16:21 +0100 Subject: [PATCH 070/279] [ticket/10605] Delete orphan private messages on update PHPBB3-10605 --- phpBB/install/database_update.php | 42 +++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index a1b7dcd47f..b6298ca651 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -2024,6 +2024,48 @@ function change_database_data(&$no_updates, $version) // No changes from 3.0.10-RC3 to 3.0.10 case '3.0.10-RC3': break; + + // Changes from 3.0.10 to 3.0.11-RC1 + case '3.0.10': + // Delete orphan private messages + $batch_size = 500; + + $sql_array = array( + 'SELECT' => 'p.msg_id', + 'FROM' => array( + PRIVMSGS_TABLE => 'p', + ), + 'LEFT_JOIN' => array( + array( + 'FROM' => array(PRIVMSGS_TO_TABLE, 't'), + 'ON' => 'p.msg_id = t.msg_id', + ), + ), + 'WHERE' => 't.user_id IS NULL'; + $sql = $db->sql_build_query('SELECT', $sql_array); + + do + { + $result = $db->sql_query_limit($sql, $batch_size); + + $delete_pms = array(); + while ($row = $db->sql_fetchrow($result)) + { + $delete_pms[] = (int) $row['msg_id']; + } + $db->sql_freeresult($result); + + if (!empty($delete_pms)) + { + $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . ' + WHERE ' . $db->sql_in_set('msg_id', $delete_pms); + $db->sql_query($sql); + } + } + while (sizeof($delete_pms) == $batch_size); + + $no_updates = false; + break; } } From d3091da5eade90aac1b13244d04bd1fb342bcc59 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 21 Feb 2012 01:08:04 +0100 Subject: [PATCH 071/279] [ticket/9220] Remove margin on table.table1 so it's centered in the blue box. The problem here was, that we use width: 100% in combination with the negative margin. This causes the element to be just moved to the side, so it's not centered anymore. width: auto would fix this, but it causes strange behaviour on IE and looks even more ugly. So I decided to just remove the margin at all. The border is now 1px thicker for all sides. PHPBB3-9220 --- .../styles/prosilver/template/memberlist_body.html | 2 +- .../prosilver/template/memberlist_leaders.html | 4 ++-- phpBB/styles/prosilver/template/search_body.html | 2 +- .../styles/prosilver/template/viewonline_body.html | 2 +- phpBB/styles/prosilver/theme/common.css | 14 +++++++++++++- phpBB/styles/prosilver/theme/tweaks.css | 4 ---- 6 files changed, 18 insertions(+), 10 deletions(-) diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html index 9e6f8c3aab..5ea774bf06 100644 --- a/phpBB/styles/prosilver/template/memberlist_body.html +++ b/phpBB/styles/prosilver/template/memberlist_body.html @@ -80,7 +80,7 @@
    -
    +
    diff --git a/phpBB/styles/prosilver/template/memberlist_leaders.html b/phpBB/styles/prosilver/template/memberlist_leaders.html index 3917498050..26e299d261 100644 --- a/phpBB/styles/prosilver/template/memberlist_leaders.html +++ b/phpBB/styles/prosilver/template/memberlist_leaders.html @@ -4,7 +4,7 @@ -
    +
    @@ -37,7 +37,7 @@ -
    +
    diff --git a/phpBB/styles/prosilver/template/search_body.html b/phpBB/styles/prosilver/template/search_body.html index 6616b95a73..4b1d30d77d 100644 --- a/phpBB/styles/prosilver/template/search_body.html +++ b/phpBB/styles/prosilver/template/search_body.html @@ -98,7 +98,7 @@ -
    +
    diff --git a/phpBB/styles/prosilver/template/viewonline_body.html b/phpBB/styles/prosilver/template/viewonline_body.html index b111d743f9..3f1f0e64bf 100644 --- a/phpBB/styles/prosilver/template/viewonline_body.html +++ b/phpBB/styles/prosilver/template/viewonline_body.html @@ -7,7 +7,7 @@ -
    +
    diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css index 8b5e09297e..7eb00bd808 100644 --- a/phpBB/styles/prosilver/theme/common.css +++ b/phpBB/styles/prosilver/theme/common.css @@ -418,7 +418,19 @@ table.info tbody th { } .forumbg table.table1 { - margin: 0 -2px -1px -1px; + margin: 0; +} + +.forumbg-table > .inner { + margin: 0 -1px; +} + +.forumbg-table > .inner > span.corners-top { + margin: 0 -4px -1px -4px; +} + +.forumbg-table > .inner > span.corners-bottom { + margin: -1px -4px 0 -4px; } /* Misc layout styles diff --git a/phpBB/styles/prosilver/theme/tweaks.css b/phpBB/styles/prosilver/theme/tweaks.css index f7322c2cce..5e11b2122b 100644 --- a/phpBB/styles/prosilver/theme/tweaks.css +++ b/phpBB/styles/prosilver/theme/tweaks.css @@ -87,10 +87,6 @@ dl.icon { float: none; } -* html .forumbg table.table1 { - margin: 0 -2px 0px -1px; -} - /* Headerbar height fix for IE7 and below */ * html #site-description p { margin-bottom: 1.0em; From 17dc8c6c5c0e651a305961fae579c59d09abf88d Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 27 Feb 2012 17:16:42 +0100 Subject: [PATCH 072/279] [ticket/9089] Add tabindex to pm/topic/post icon-options aswell PHPBB3-9089 --- phpBB/styles/prosilver/template/posting_editor.html | 4 ++-- phpBB/styles/subsilver2/template/posting_body.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/styles/prosilver/template/posting_editor.html b/phpBB/styles/prosilver/template/posting_editor.html index e7c1dc21eb..67ba74a690 100644 --- a/phpBB/styles/prosilver/template/posting_editor.html +++ b/phpBB/styles/prosilver/template/posting_editor.html @@ -87,8 +87,8 @@
    - - + +
    diff --git a/phpBB/styles/subsilver2/template/posting_body.html b/phpBB/styles/subsilver2/template/posting_body.html index fec6d7ff6c..dbdf6b230c 100644 --- a/phpBB/styles/subsilver2/template/posting_body.html +++ b/phpBB/styles/subsilver2/template/posting_body.html @@ -127,7 +127,7 @@
    From 470b79c9e38ea5c37fe5f4685618e5794b6954ad Mon Sep 17 00:00:00 2001 From: Bruno Ais Date: Fri, 24 Feb 2012 07:41:08 +0000 Subject: [PATCH 073/279] [ticket/8652] Sending 2 emails on 2 replies This is a fix for the problem of the system sending 2 emails when there are 2 replies to a topic where the user is subscribed in a topic and the forum that contains the topic. This simple fix seems to solve the problem. In simple tests I made it shows it does. PHPBB3-8652 --- phpBB/includes/functions_posting.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 77d92e26e2..38f542264c 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1286,6 +1286,12 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id { $msg_users[] = $row; $update_notification[$row['notify_type']][] = $row['user_id']; + if ($row['notify_type'] === 'topic') + { + // Using SQL characteristics. If it didn't exist it isn't added. + // It's very rare to find someone that is registered in topic and noone is registered in the forum + $update_notification['forum'][] = $row['user_id']; + } } } unset($notify_rows); From b74530259faa6197d7215d957c180280210a93e0 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Fri, 2 Mar 2012 00:19:42 +0100 Subject: [PATCH 074/279] [ticket/8652] Comment for also updating forum watch table in user_notification. PHPBB3-8652 --- phpBB/includes/functions_posting.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 38f542264c..f920be9c4b 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1286,10 +1286,18 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id { $msg_users[] = $row; $update_notification[$row['notify_type']][] = $row['user_id']; + + /* + * We also update the forums watch table for this user when we are + * sending out a topic notification to prevent sending out another + * notification in case this user is also subscribed to the forum + * this topic was posted in. + * Since an UPDATE query is used, this has no effect on users only + * subscribed to the topic (i.e. no row is created) and should not + * be a performance issue. + */ if ($row['notify_type'] === 'topic') { - // Using SQL characteristics. If it didn't exist it isn't added. - // It's very rare to find someone that is registered in topic and noone is registered in the forum $update_notification['forum'][] = $row['user_id']; } } From efe25a0b49c7445bef665ab28fc979e485e49289 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 29 Oct 2011 15:31:29 +0200 Subject: [PATCH 075/279] [ticket/9813] Use SHOW TABLE STATUS to get search stats for native on MySQL. PHPBB3-9813 --- phpBB/includes/search/fulltext_native.php | 38 +++++++++++++++++------ 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index b63205fd76..e5eee50fdb 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -1461,17 +1461,35 @@ class fulltext_native extends search_backend { global $db; - $sql = 'SELECT COUNT(*) as total_words - FROM ' . SEARCH_WORDLIST_TABLE; - $result = $db->sql_query($sql); - $this->stats['total_words'] = (int) $db->sql_fetchfield('total_words'); - $db->sql_freeresult($result); + switch ($db->sql_layer) + { + case 'mysql4': + case 'mysqli': + $sql = "SHOW TABLE STATUS LIKE '" . SEARCH_WORDLIST_TABLE . "'"; + $result = $db->sql_query($sql); + $this->stats['total_words'] = (int) $db->sql_fetchfield('Rows'); + $db->sql_freeresult($result); - $sql = 'SELECT COUNT(*) as total_matches - FROM ' . SEARCH_WORDMATCH_TABLE; - $result = $db->sql_query($sql); - $this->stats['total_matches'] = (int) $db->sql_fetchfield('total_matches'); - $db->sql_freeresult($result); + $sql = "SHOW TABLE STATUS LIKE '" . SEARCH_WORDMATCH_TABLE . "'"; + $result = $db->sql_query($sql); + $this->stats['total_matches'] = (int) $db->sql_fetchfield('Rows'); + $db->sql_freeresult($result); + break; + + default: + $sql = 'SELECT COUNT(*) as total_words + FROM ' . SEARCH_WORDLIST_TABLE; + $result = $db->sql_query($sql); + $this->stats['total_words'] = (int) $db->sql_fetchfield('total_words'); + $db->sql_freeresult($result); + + $sql = 'SELECT COUNT(*) as total_matches + FROM ' . SEARCH_WORDMATCH_TABLE; + $result = $db->sql_query($sql); + $this->stats['total_matches'] = (int) $db->sql_fetchfield('total_matches'); + $db->sql_freeresult($result); + break; + } } /** From 97cf433dea658127ed60c70ea47d1c3830964f25 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 12 Dec 2011 02:41:48 +0100 Subject: [PATCH 076/279] [ticket/9813] Use table status row count only if greater than 100000 or exact. PHPBB3-9813 --- phpBB/includes/search/fulltext_native.php | 67 ++++++++++++++--------- 1 file changed, 41 insertions(+), 26 deletions(-) diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index e5eee50fdb..69937ff9c9 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -1458,38 +1458,53 @@ class fulltext_native extends search_backend } function get_stats() + { + $this->stats['total_words'] = $this->get_table_row_count(SEARCH_WORDLIST_TABLE); + $this->stats['total_matches'] = $this->get_table_row_count(SEARCH_WORDMATCH_TABLE); + } + + /** + * Gets statistics for a specific database table. + * + * @param string $table_name Table name + * + * @return string Row count. Prefixed with ~ if estimated. + * + * @access protected + */ + function get_table_row_count($table_name) { global $db; - switch ($db->sql_layer) + if (stripos($db->sql_layer, 'mysql') === 0) { - case 'mysql4': - case 'mysqli': - $sql = "SHOW TABLE STATUS LIKE '" . SEARCH_WORDLIST_TABLE . "'"; - $result = $db->sql_query($sql); - $this->stats['total_words'] = (int) $db->sql_fetchfield('Rows'); - $db->sql_freeresult($result); + $sql = "SHOW TABLE STATUS + LIKE '" . $table_name . "'"; + $result = $db->sql_query($sql); + $table_status = $db->sql_fetchrow($result); + $db->sql_freeresult($result); - $sql = "SHOW TABLE STATUS LIKE '" . SEARCH_WORDMATCH_TABLE . "'"; - $result = $db->sql_query($sql); - $this->stats['total_matches'] = (int) $db->sql_fetchfield('Rows'); - $db->sql_freeresult($result); - break; - - default: - $sql = 'SELECT COUNT(*) as total_words - FROM ' . SEARCH_WORDLIST_TABLE; - $result = $db->sql_query($sql); - $this->stats['total_words'] = (int) $db->sql_fetchfield('total_words'); - $db->sql_freeresult($result); - - $sql = 'SELECT COUNT(*) as total_matches - FROM ' . SEARCH_WORDMATCH_TABLE; - $result = $db->sql_query($sql); - $this->stats['total_matches'] = (int) $db->sql_fetchfield('total_matches'); - $db->sql_freeresult($result); - break; + if (isset($table_status['Engine'])) + { + if ($table_status['Engine'] === 'MyISAM') + { + return $table_status['Rows']; + } + else if ($table_status['Engine'] === 'InnoDB' && $table_status['Rows'] > 100000) + { + return '~' . $table_status['Rows']; + } + } } + + // Get exact row count by actually counting rows + $sql = 'SELECT COUNT(*) AS rows_total + FROM ' . $table_name; + $result = $db->sql_query($sql); + $rows_total = $db->sql_fetchfield('rows_total'); + $db->sql_freeresult($result); + + return $rows_total; } /** From f9953fc3395e6b206c0789d40f89f9d2463348e7 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sat, 18 Feb 2012 19:29:32 +0100 Subject: [PATCH 077/279] [ticket/10653] Add ability to count table rows to database abstraction layer. PHPBB3-10653 --- phpBB/includes/db/dbal.php | 35 ++++++++++++ phpBB/includes/db/mysql.php | 70 +++++++++++++++++++++++ phpBB/includes/db/mysqli.php | 70 +++++++++++++++++++++++ phpBB/includes/search/fulltext_native.php | 46 +-------------- 4 files changed, 177 insertions(+), 44 deletions(-) diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index 230c9c8ed7..5d456c2ff0 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -900,6 +900,41 @@ class dbal return true; } + + /** + * Gets the estimated number of rows in a specified table. + * + * @param string $table_name Table name + * + * @return string Number of rows in $table_name. + * Prefixed with ~ if estimated (otherwise exact). + * + * @access public + */ + function get_estimated_row_count($table_name) + { + return $this->get_row_count($table_name); + } + + /** + * Gets the exact number of rows in a specified table. + * + * @param string $table_name Table name + * + * @return string Exact number of rows in $table_name. + * + * @access public + */ + function get_row_count($table_name) + { + $sql = 'SELECT COUNT(*) AS rows_total + FROM ' . $this->sql_escape($table_name); + $result = $this->sql_query($sql); + $rows_total = $this->sql_fetchfield('rows_total'); + $this->sql_freeresult($result); + + return $rows_total; + } } /** diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php index 1e24c79577..87413e808d 100644 --- a/phpBB/includes/db/mysql.php +++ b/phpBB/includes/db/mysql.php @@ -318,6 +318,76 @@ class dbal_mysql extends dbal return @mysql_real_escape_string($msg, $this->db_connect_id); } + /** + * Gets the estimated number of rows in a specified table. + * + * @param string $table_name Table name + * + * @return string Number of rows in $table_name. + * Prefixed with ~ if estimated (otherwise exact). + * + * @access public + */ + function get_estimated_row_count($table_name) + { + $table_status = $this->get_table_status($table_name); + + if (isset($table_status['Engine'])) + { + if ($table_status['Engine'] === 'MyISAM') + { + return $table_status['Rows']; + } + else if ($table_status['Engine'] === 'InnoDB' && $table_status['Rows'] > 100000) + { + return '~' . $table_status['Rows']; + } + } + + return $this->get_row_count($table_name); + } + + /** + * Gets the exact number of rows in a specified table. + * + * @param string $table_name Table name + * + * @return string Exact number of rows in $table_name. + * + * @access public + */ + function get_row_count($table_name) + { + $table_status = $this->get_table_status($table_name); + + if (isset($table_status['Engine']) && $table_status['Engine'] === 'MyISAM') + { + return $table_status['Rows']; + } + + return parent::get_row_count($table_name); + } + + /** + * Gets some information about the specified table. + * + * @param string $table_name Table name + * + * @return array + * + * @access protected + */ + function get_table_status($table_name) + { + $sql = "SHOW TABLE STATUS + LIKE '" . $this->sql_escape($table_name) . "'"; + $result = $this->sql_query($sql); + $table_status = $this->sql_fetchrow($result); + $this->sql_freeresult($result); + + return $table_status; + } + /** * Build LIKE expression * @access private diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php index 456ce906d0..49b2789ce6 100644 --- a/phpBB/includes/db/mysqli.php +++ b/phpBB/includes/db/mysqli.php @@ -315,6 +315,76 @@ class dbal_mysqli extends dbal return @mysqli_real_escape_string($this->db_connect_id, $msg); } + /** + * Gets the estimated number of rows in a specified table. + * + * @param string $table_name Table name + * + * @return string Number of rows in $table_name. + * Prefixed with ~ if estimated (otherwise exact). + * + * @access public + */ + function get_estimated_row_count($table_name) + { + $table_status = $this->get_table_status($table_name); + + if (isset($table_status['Engine'])) + { + if ($table_status['Engine'] === 'MyISAM') + { + return $table_status['Rows']; + } + else if ($table_status['Engine'] === 'InnoDB' && $table_status['Rows'] > 100000) + { + return '~' . $table_status['Rows']; + } + } + + return $this->get_row_count($table_name); + } + + /** + * Gets the exact number of rows in a specified table. + * + * @param string $table_name Table name + * + * @return string Exact number of rows in $table_name. + * + * @access public + */ + function get_row_count($table_name) + { + $table_status = $this->get_table_status($table_name); + + if (isset($table_status['Engine']) && $table_status['Engine'] === 'MyISAM') + { + return $table_status['Rows']; + } + + return parent::get_row_count($table_name); + } + + /** + * Gets some information about the specified table. + * + * @param string $table_name Table name + * + * @return array + * + * @access protected + */ + function get_table_status($table_name) + { + $sql = "SHOW TABLE STATUS + LIKE '" . $this->sql_escape($table_name) . "'"; + $result = $this->sql_query($sql); + $table_status = $this->sql_fetchrow($result); + $this->sql_freeresult($result); + + return $table_status; + } + /** * Build LIKE expression * @access private diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php index 69937ff9c9..dc961f3c8a 100644 --- a/phpBB/includes/search/fulltext_native.php +++ b/phpBB/includes/search/fulltext_native.php @@ -1458,53 +1458,11 @@ class fulltext_native extends search_backend } function get_stats() - { - $this->stats['total_words'] = $this->get_table_row_count(SEARCH_WORDLIST_TABLE); - $this->stats['total_matches'] = $this->get_table_row_count(SEARCH_WORDMATCH_TABLE); - } - - /** - * Gets statistics for a specific database table. - * - * @param string $table_name Table name - * - * @return string Row count. Prefixed with ~ if estimated. - * - * @access protected - */ - function get_table_row_count($table_name) { global $db; - if (stripos($db->sql_layer, 'mysql') === 0) - { - $sql = "SHOW TABLE STATUS - LIKE '" . $table_name . "'"; - $result = $db->sql_query($sql); - $table_status = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - if (isset($table_status['Engine'])) - { - if ($table_status['Engine'] === 'MyISAM') - { - return $table_status['Rows']; - } - else if ($table_status['Engine'] === 'InnoDB' && $table_status['Rows'] > 100000) - { - return '~' . $table_status['Rows']; - } - } - } - - // Get exact row count by actually counting rows - $sql = 'SELECT COUNT(*) AS rows_total - FROM ' . $table_name; - $result = $db->sql_query($sql); - $rows_total = $db->sql_fetchfield('rows_total'); - $db->sql_freeresult($result); - - return $rows_total; + $this->stats['total_words'] = $db->get_estimated_row_count(SEARCH_WORDLIST_TABLE); + $this->stats['total_matches'] = $db->get_estimated_row_count(SEARCH_WORDMATCH_TABLE); } /** From 6df721b21528e4d9881fa191159b123bb2b6b33f Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 4 Mar 2012 01:59:40 +0100 Subject: [PATCH 078/279] [ticket/10653] Unit tests for get_row_count() and get_estimated_row_count(). PHPBB3-10653 --- tests/dbal/select_test.php | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/dbal/select_test.php b/tests/dbal/select_test.php index 05b0e68e29..9d46b47b17 100644 --- a/tests/dbal/select_test.php +++ b/tests/dbal/select_test.php @@ -357,4 +357,29 @@ class phpbb_dbal_select_test extends phpbb_database_test_case $this->assertSame(false, $row); } + + public function test_get_row_count() + { + $this->assertSame( + 3, + (int) $this->new_dbal()->get_row_count('phpbb_users'), + "Failed asserting that user table has exactly 3 rows." + ); + } + + public function test_get_estimated_row_count() + { + $actual = $this->new_dbal()->get_estimated_row_count('phpbb_users'); + + if (is_string($actual) && isset($actual[0]) && $actual[0] === '~') + { + $actual = substr($actual, -1); + } + + $this->assertGreaterThan( + 1, + $actual, + "Failed asserting that estimated row count of user table is greater than 1." + ); + } } From f3af5945e3675c4d799000908c88475ee7016ac4 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Sun, 4 Mar 2012 22:11:45 +0100 Subject: [PATCH 079/279] [ticket/10653] Fix parameter to substr() in unit tests. Should be 1, not -1. PHPBB3-10653 --- tests/dbal/select_test.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/dbal/select_test.php b/tests/dbal/select_test.php index 9d46b47b17..21b12777dc 100644 --- a/tests/dbal/select_test.php +++ b/tests/dbal/select_test.php @@ -373,7 +373,7 @@ class phpbb_dbal_select_test extends phpbb_database_test_case if (is_string($actual) && isset($actual[0]) && $actual[0] === '~') { - $actual = substr($actual, -1); + $actual = substr($actual, 1); } $this->assertGreaterThan( From 785c75254e763a24cf56765ca9a7e02140982497 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 5 Mar 2012 00:29:28 +0100 Subject: [PATCH 080/279] [ticket/9813] Also use estimated row count of posts table for fulltext mysql. Since this is 'only' for statistics anyway, using an estimated value does no harm. Also, if MyISAM is the underlying storage engine for the posts table, the value will actually be exact. PHPBB3-9813 --- phpBB/includes/search/fulltext_mysql.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 52372a14d8..54cc894f6a 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -896,11 +896,7 @@ class fulltext_mysql extends search_backend } $db->sql_freeresult($result); - $sql = 'SELECT COUNT(post_id) as total_posts - FROM ' . POSTS_TABLE; - $result = $db->sql_query($sql); - $this->stats['total_posts'] = (int) $db->sql_fetchfield('total_posts'); - $db->sql_freeresult($result); + $this->stats['total_posts'] = $db->get_estimated_row_count(POSTS_TABLE); } /** From 89a0cbc57e98d182f2696c49e182c57fb63b88c7 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Wed, 7 Mar 2012 18:00:57 -0500 Subject: [PATCH 081/279] [ticket/7432] Delete redundant reference to "appropriate menu item". PHPBB3-7432 --- phpBB/language/en/acp/common.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 79caa07d98..958b9c7598 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -405,7 +405,7 @@ $lang = array_merge($lang, array( 'INACTIVE_REASON_UNKNOWN' => 'Unknown', 'INACTIVE_USERS' => 'Inactive users', 'INACTIVE_USERS_EXPLAIN' => 'This is a list of users who have registered but whose accounts are inactive. You can activate, delete or remind (by sending an e-mail) these users if you wish.', - 'INACTIVE_USERS_EXPLAIN_INDEX' => 'This is a list of the last 10 registered users who have inactive accounts. Accounts are inactive either because account activation was enabled in user registration settings and these users’ accounts have not yet been activated, or because these accounts have been deactivated. A full list is available from the appropriate menu item or by following the link below from where you can activate, delete or remind (by sending an e-mail) these users if you wish.', + 'INACTIVE_USERS_EXPLAIN_INDEX' => 'This is a list of the last 10 registered users who have inactive accounts. Accounts are inactive either because account activation was enabled in user registration settings and these users’ accounts have not yet been activated, or because these accounts have been deactivated. A full list is available by following the link below from where you can activate, delete or remind (by sending an e-mail) these users if you wish.', 'NO_INACTIVE_USERS' => 'No inactive users', From 01d90e59a8c311778a832ba4920e4c5a85b1256f Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Mon, 5 Mar 2012 00:42:36 +0100 Subject: [PATCH 082/279] [ticket/9813] Only get posts table row count if we detected a fulltext index. PHPBB3-9813 --- phpBB/includes/search/fulltext_mysql.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php index 54cc894f6a..779ec1d216 100644 --- a/phpBB/includes/search/fulltext_mysql.php +++ b/phpBB/includes/search/fulltext_mysql.php @@ -896,7 +896,7 @@ class fulltext_mysql extends search_backend } $db->sql_freeresult($result); - $this->stats['total_posts'] = $db->get_estimated_row_count(POSTS_TABLE); + $this->stats['total_posts'] = empty($this->stats) ? 0 : $db->get_estimated_row_count(POSTS_TABLE); } /** From c11607bdd1ad4209a7697f0dc8d46ea81795b14c Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Wed, 7 Mar 2012 12:11:18 +0100 Subject: [PATCH 083/279] [ticket/10653] Call get_row_count of base class in mysql get_estimated_row_count There is no point in fetching the table status again. PHPBB3-10653 --- phpBB/includes/db/mysql.php | 2 +- phpBB/includes/db/mysqli.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php index 87413e808d..1ccb785150 100644 --- a/phpBB/includes/db/mysql.php +++ b/phpBB/includes/db/mysql.php @@ -344,7 +344,7 @@ class dbal_mysql extends dbal } } - return $this->get_row_count($table_name); + return parent::get_row_count($table_name); } /** diff --git a/phpBB/includes/db/mysqli.php b/phpBB/includes/db/mysqli.php index 49b2789ce6..a311b8cda6 100644 --- a/phpBB/includes/db/mysqli.php +++ b/phpBB/includes/db/mysqli.php @@ -341,7 +341,7 @@ class dbal_mysqli extends dbal } } - return $this->get_row_count($table_name); + return parent::get_row_count($table_name); } /** From bb7e86c2b1920c5820d4c9cca7ec76bd25835fa1 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Thu, 8 Mar 2012 15:19:15 +0100 Subject: [PATCH 084/279] [ticket/10658] Do not fetch ranks into the $ranks array, it is no longer used. PHPBB3-10658 --- phpBB/memberlist.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index cfa1631dbe..3dd5bd24b6 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -62,11 +62,6 @@ $default_key = 'c'; $sort_key = request_var('sk', $default_key); $sort_dir = request_var('sd', 'a'); - -// Grab rank information for later -$ranks = $cache->obtain_ranks(); - - // What do you want to do today? ... oops, I think that line is taken ... switch ($mode) { From 025de9ee191654825f6ba09a4804e6ef3633b8cb Mon Sep 17 00:00:00 2001 From: rxu Date: Thu, 8 Mar 2012 14:57:47 +0800 Subject: [PATCH 085/279] [ticket/10684] Send notifications for users with stale bans PHPBB3-10684 --- phpBB/includes/functions_posting.php | 36 +++++++++++++++------------- phpBB/includes/functions_user.php | 29 ++++++++++++++++++++++ 2 files changed, 48 insertions(+), 17 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index f920be9c4b..faf904467f 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1180,28 +1180,23 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id $topic_title = ($topic_notification) ? $topic_title : $subject; $topic_title = censor_text($topic_title); - // Get banned User ID's - $sql = 'SELECT ban_userid - FROM ' . BANLIST_TABLE . ' - WHERE ban_userid <> 0 - AND ban_exclude <> 1'; - $result = $db->sql_query($sql); - - $sql_ignore_users = ANONYMOUS . ', ' . $user->data['user_id']; - while ($row = $db->sql_fetchrow($result)) + // Exclude guests, current user and banned users from notifications + if (!function_exists('phpbb_get_banned_users_ids')) { - $sql_ignore_users .= ', ' . (int) $row['ban_userid']; + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); } - $db->sql_freeresult($result); + $sql_ignore_users = phpbb_get_banned_users_ids(); + $sql_ignore_users[ANONYMOUS] = ANONYMOUS; + $sql_ignore_users[$user->data['user_id']] = $user->data['user_id']; $notify_rows = array(); // -- get forum_userids || topic_userids $sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber FROM ' . (($topic_notification) ? TOPICS_WATCH_TABLE : FORUMS_WATCH_TABLE) . ' w, ' . USERS_TABLE . ' u - WHERE w.' . (($topic_notification) ? 'topic_id' : 'forum_id') . ' = ' . (($topic_notification) ? $topic_id : $forum_id) . " - AND w.user_id NOT IN ($sql_ignore_users) - AND w.notify_status = " . NOTIFY_YES . ' + WHERE w.' . (($topic_notification) ? 'topic_id' : 'forum_id') . ' = ' . (($topic_notification) ? $topic_id : $forum_id) . ' + AND ' . $db->sql_in_set('w.user_id', $sql_ignore_users, true) . ' + AND w.notify_status = ' . NOTIFY_YES . ' AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ') AND u.user_id = w.user_id'; $result = $db->sql_query($sql); @@ -1225,16 +1220,23 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id // forum notification is sent to those not already receiving topic notifications if ($topic_notification) { + // Add users who has been already notified to ignore list if (sizeof($notify_rows)) { - $sql_ignore_users .= ', ' . implode(', ', array_keys($notify_rows)); + foreach ($notify_rows as $user_id => $row) + { + if (!isset($sql_ignore_users[$user_id])) + { + $sql_ignore_users[$user_id] = $user_id; + } + } } $sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber FROM ' . FORUMS_WATCH_TABLE . ' fw, ' . USERS_TABLE . " u WHERE fw.forum_id = $forum_id - AND fw.user_id NOT IN ($sql_ignore_users) - AND fw.notify_status = " . NOTIFY_YES . ' + AND " . $db->sql_in_set('fw.user_id', $sql_ignore_users, true) . ' + AND fw.notify_status = ' . NOTIFY_YES . ' AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ') AND u.user_id = fw.user_id'; $result = $db->sql_query($sql); diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 6b5cca8abb..aea94a0d34 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -3587,4 +3587,33 @@ function remove_newly_registered($user_id, $user_data = false) return $user_data['group_id']; } +/** +* Get a list of banned users' ids, ignoring stale buns which were not wiped yet. +* +* @return array Array of banned users' ids if any, empty array otherwise +*/ +function phpbb_get_banned_users_ids() +{ + global $db; + + // Get banned User ID's + // Ignore stale bans which were not wiped yet + $banned_ids_list = array(); + $sql = 'SELECT ban_userid + FROM ' . BANLIST_TABLE . ' + WHERE ban_userid <> 0 + AND ban_exclude <> 1 + AND (ban_end > ' . time() . ' + OR ban_end = 0)'; + $result = $db->sql_query($sql); + while ($row = $db->sql_fetchrow($result)) + { + $user_id = (int) $row['ban_userid']; + $banned_ids_list[$user_id] = $user_id; + } + $db->sql_freeresult($result); + + return $banned_ids_list; +} + ?> \ No newline at end of file From ee6783109ad7af70665c98d6bbc12d170bc0f892 Mon Sep 17 00:00:00 2001 From: rxu Date: Fri, 9 Mar 2012 16:41:49 +0800 Subject: [PATCH 086/279] [ticket/10684] Fix 2 typos in comment lines. PHPBB3-10684 --- phpBB/includes/functions_posting.php | 2 +- phpBB/includes/functions_user.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index faf904467f..ce9762284d 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1220,7 +1220,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id // forum notification is sent to those not already receiving topic notifications if ($topic_notification) { - // Add users who has been already notified to ignore list + // Add users who have been already notified to ignore list if (sizeof($notify_rows)) { foreach ($notify_rows as $user_id => $row) diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index aea94a0d34..dec8d09082 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -3588,7 +3588,7 @@ function remove_newly_registered($user_id, $user_data = false) } /** -* Get a list of banned users' ids, ignoring stale buns which were not wiped yet. +* Get a list of banned users' ids, ignoring stale bans which were not wiped yet. * * @return array Array of banned users' ids if any, empty array otherwise */ From cd61de4bfdd1818d173e7413e53d8fd3d7ce1913 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Fri, 9 Mar 2012 04:31:03 -0500 Subject: [PATCH 087/279] [ticket/9084] Explain the logic. PHPBB3-9084 --- phpBB/includes/functions_profile_fields.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/phpBB/includes/functions_profile_fields.php b/phpBB/includes/functions_profile_fields.php index 79701429e6..d44be16184 100644 --- a/phpBB/includes/functions_profile_fields.php +++ b/phpBB/includes/functions_profile_fields.php @@ -571,6 +571,11 @@ class custom_profile $this->get_option_lang($field_id, $lang_id, FIELD_DROPDOWN, false); } + // If a dropdown field is required, users + // cannot choose the "no value" option. + // They must choose one of the other options. + // Therefore, here we treat a value equal to + // the "no value" as a lack of value, i.e. NULL. if ($value == $ident_ary['data']['field_novalue'] && $ident_ary['data']['field_required']) { return NULL; From f563647e4b97fc62aa91bc3bf7c81fcc715f17c3 Mon Sep 17 00:00:00 2001 From: rxu Date: Fri, 9 Mar 2012 22:35:13 +0800 Subject: [PATCH 088/279] [ticket/10684] Remove isset() for $sql_ignore_users update PHPBB3-10684 --- phpBB/includes/functions_posting.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index ce9762284d..c9b4267c35 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1225,10 +1225,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id { foreach ($notify_rows as $user_id => $row) { - if (!isset($sql_ignore_users[$user_id])) - { - $sql_ignore_users[$user_id] = $user_id; - } + $sql_ignore_users[$user_id] = $user_id; } } From fbe8086697481f5068a9897c9e629f048a553ee4 Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Fri, 9 Mar 2012 16:10:02 +0000 Subject: [PATCH 089/279] [ticket/10694] Update PHP warning to 5.3.2 PHPBB3-10694 --- phpBB/includes/acp/acp_main.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index c8df21f5a9..5ecf54a9bc 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -398,7 +398,7 @@ class acp_main // Version check $user->add_lang('install'); - if ($auth->acl_get('a_server') && version_compare(PHP_VERSION, '5.2.0', '<')) + if ($auth->acl_get('a_server') && version_compare(PHP_VERSION, '5.3.2', '<')) { $template->assign_vars(array( 'S_PHP_VERSION_OLD' => true, From 89a6cb2886dfd4659e6db67e27e42c4df763f723 Mon Sep 17 00:00:00 2001 From: rxu Date: Sat, 10 Mar 2012 00:17:39 +0800 Subject: [PATCH 090/279] [ticket/10684] Refactor $sql_ignore_users array update PHPBB3-10684 --- phpBB/includes/functions_posting.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index c9b4267c35..af26d8ed0f 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1214,21 +1214,15 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id 'method' => $row['user_notify_type'], 'allowed' => false ); + + // Add users who have been already notified to ignore list + $sql_ignore_users[$row['user_id']] = $row['user_id']; } $db->sql_freeresult($result); // forum notification is sent to those not already receiving topic notifications if ($topic_notification) { - // Add users who have been already notified to ignore list - if (sizeof($notify_rows)) - { - foreach ($notify_rows as $user_id => $row) - { - $sql_ignore_users[$user_id] = $user_id; - } - } - $sql = 'SELECT u.user_id, u.username, u.user_email, u.user_lang, u.user_notify_type, u.user_jabber FROM ' . FORUMS_WATCH_TABLE . ' fw, ' . USERS_TABLE . " u WHERE fw.forum_id = $forum_id @@ -1272,7 +1266,6 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id } } - // Now, we have to do a little step before really sending, we need to distinguish our users a little bit. ;) $msg_users = $delete_ids = $update_notification = array(); foreach ($notify_rows as $user_id => $row) From 668c61686b09e12e7f245fc6a402a1b1f6272f1c Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Sat, 10 Mar 2012 16:47:07 +0000 Subject: [PATCH 091/279] [ticket/10694] Adjusting details link to 5.3 announcement PHPBB3-10694 --- phpBB/includes/acp/acp_main.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index 5ecf54a9bc..e529ae0e5a 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -402,7 +402,7 @@ class acp_main { $template->assign_vars(array( 'S_PHP_VERSION_OLD' => true, - 'L_PHP_VERSION_OLD' => sprintf($user->lang['PHP_VERSION_OLD'], '', ''), + 'L_PHP_VERSION_OLD' => sprintf($user->lang['PHP_VERSION_OLD'], '', ''), )); } From a79b3490c2b21d283d7bc1f15c4923180e0f10b2 Mon Sep 17 00:00:00 2001 From: rxu Date: Sun, 11 Mar 2012 00:56:07 +0800 Subject: [PATCH 092/279] [ticket/10684] Cast user_id to integer PHPBB3-10684 --- phpBB/includes/functions_posting.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index af26d8ed0f..073ce1ff4e 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1203,8 +1203,9 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id while ($row = $db->sql_fetchrow($result)) { - $notify_rows[$row['user_id']] = array( - 'user_id' => $row['user_id'], + $notify_user_id = (int) $row['user_id']; + $notify_rows[$notify_user_id] = array( + 'user_id' => $notify_user_id, 'username' => $row['username'], 'user_email' => $row['user_email'], 'user_jabber' => $row['user_jabber'], @@ -1216,7 +1217,7 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id ); // Add users who have been already notified to ignore list - $sql_ignore_users[$row['user_id']] = $row['user_id']; + $sql_ignore_users[$notify_user_id] = $notify_user_id; } $db->sql_freeresult($result); @@ -1234,8 +1235,9 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id while ($row = $db->sql_fetchrow($result)) { - $notify_rows[$row['user_id']] = array( - 'user_id' => $row['user_id'], + $notify_user_id = (int) $row['user_id']; + $notify_rows[$notify_user_id] = array( + 'user_id' => $notify_user_id, 'username' => $row['username'], 'user_email' => $row['user_email'], 'user_jabber' => $row['user_jabber'], From 24f1896b3c1591fd73eedd014dc6ebb214804f4d Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Sun, 11 Mar 2012 09:42:56 +0000 Subject: [PATCH 093/279] [ticket/10697] Updating gitignore to match develop branch PHPBB3-10697 --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 7d789c59a1..d875beb784 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,10 @@ *~ /phpunit.xml +/phpBB/cache/*.html /phpBB/cache/*.php /phpBB/cache/queue.php.lock /phpBB/config.php +/phpBB/ext/* /phpBB/files/* /phpBB/images/avatars/gallery/* /phpBB/images/avatars/upload/* From 321d0d9b56011e049b245b6d54975b6c67b3b15b Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 12 Mar 2012 01:44:00 +0800 Subject: [PATCH 094/279] [ticket/10684] Adjust pm_notifications() to handle stale bans - Add parameter (array) to the function phpbb_get_banned_users_ids() - Fix function pm_notification() to handle users with stale bans PHPBB3-10684 --- phpBB/includes/functions_privmsgs.php | 17 ++++++----------- phpBB/includes/functions_user.php | 14 +++++++++----- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index c40ceb088f..8303fc3754 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1622,6 +1622,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i $subject = censor_text($subject); + // Exclude guests, current user and banned users from notifications unset($recipients[ANONYMOUS], $recipients[$user->data['user_id']]); if (!sizeof($recipients)) @@ -1629,18 +1630,12 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i return; } - // Get banned User ID's - $sql = 'SELECT ban_userid - FROM ' . BANLIST_TABLE . ' - WHERE ' . $db->sql_in_set('ban_userid', array_map('intval', array_keys($recipients))) . ' - AND ban_exclude = 0'; - $result = $db->sql_query($sql); - - while ($row = $db->sql_fetchrow($result)) + if (!function_exists('phpbb_get_banned_users_ids')) { - unset($recipients[$row['ban_userid']]); + include($phpbb_root_path . 'includes/functions_user.' . $phpEx); } - $db->sql_freeresult($result); + $banned_users = phpbb_get_banned_users_ids(array_keys($recipients)); + $recipients = array_diff(array_map('intval', array_keys($recipients)), $banned_users); if (!sizeof($recipients)) { @@ -1649,7 +1644,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i $sql = 'SELECT user_id, username, user_email, user_lang, user_notify_pm, user_notify_type, user_jabber FROM ' . USERS_TABLE . ' - WHERE ' . $db->sql_in_set('user_id', array_map('intval', array_keys($recipients))); + WHERE ' . $db->sql_in_set('user_id', $recipients); $result = $db->sql_query($sql); $msg_list_ary = array(); diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index dec8d09082..8f40401f0b 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -3588,22 +3588,26 @@ function remove_newly_registered($user_id, $user_data = false) } /** -* Get a list of banned users' ids, ignoring stale bans which were not wiped yet. +* Get a list of banned users' ids, ignoring stale bans which were not cleaned yet. * +* @param array $users_ids_array Array of users' ids to check for banning, +* leave empty to get complete list of banned ids * @return array Array of banned users' ids if any, empty array otherwise */ -function phpbb_get_banned_users_ids() +function phpbb_get_banned_users_ids($users_ids_array = array()) { global $db; + $sql_users_ids = (!empty($users_ids_array)) ? $db->sql_in_set('ban_userid', $users_ids_array) : 'ban_userid <> 0'; + // Get banned User ID's // Ignore stale bans which were not wiped yet $banned_ids_list = array(); $sql = 'SELECT ban_userid - FROM ' . BANLIST_TABLE . ' - WHERE ban_userid <> 0 + FROM ' . BANLIST_TABLE . " + WHERE $sql_users_ids AND ban_exclude <> 1 - AND (ban_end > ' . time() . ' + AND (ban_end > " . time() . ' OR ban_end = 0)'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) From da395edbca3e25d1758a6b8c26d14c2e48f112d9 Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 12 Mar 2012 01:47:28 +0800 Subject: [PATCH 095/279] [ticket/10684] Remove intval mapping for array keys PHP manual for arrays http://php.net/manual/en/language.types.array.php states that the following key cast will occur: Strings containing valid integers will be cast to the integer type. E.g. the key "8" will actually be stored under 8. Thus, no intval mapping for numeric array keys is needed. PHPBB3-10684 --- phpBB/includes/functions_privmsgs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 8303fc3754..4ea8f74153 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1635,7 +1635,7 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i include($phpbb_root_path . 'includes/functions_user.' . $phpEx); } $banned_users = phpbb_get_banned_users_ids(array_keys($recipients)); - $recipients = array_diff(array_map('intval', array_keys($recipients)), $banned_users); + $recipients = array_diff(array_keys($recipients), $banned_users); if (!sizeof($recipients)) { From ff8d5237688beee9ea36848e1ac49565e538c2cd Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 12 Mar 2012 01:57:51 +0800 Subject: [PATCH 096/279] [ticket/10684] Rename function phpbb_get_banned_users_ids() parameter PHPBB3-10684 --- phpBB/includes/functions_user.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 8f40401f0b..8c42a5bb42 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -3590,15 +3590,15 @@ function remove_newly_registered($user_id, $user_data = false) /** * Get a list of banned users' ids, ignoring stale bans which were not cleaned yet. * -* @param array $users_ids_array Array of users' ids to check for banning, -* leave empty to get complete list of banned ids +* @param array $users_ids Array of users' ids to check for banning, +* leave empty to get complete list of banned ids * @return array Array of banned users' ids if any, empty array otherwise */ -function phpbb_get_banned_users_ids($users_ids_array = array()) +function phpbb_get_banned_users_ids($users_ids = array()) { global $db; - $sql_users_ids = (!empty($users_ids_array)) ? $db->sql_in_set('ban_userid', $users_ids_array) : 'ban_userid <> 0'; + $sql_users_ids = (!empty($users_ids)) ? $db->sql_in_set('ban_userid', $users_ids) : 'ban_userid <> 0'; // Get banned User ID's // Ignore stale bans which were not wiped yet From 3b7a6a3eface3389b48358206fff3cb22615dc30 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 12 Mar 2012 00:39:12 +0100 Subject: [PATCH 097/279] [ticket/10689] Fix "First character"-option in "Find a member"-search PHPBB3-10689 --- phpBB/memberlist.php | 1 + 1 file changed, 1 insertion(+) diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index b3c0bae16a..2a2ee407a0 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -1346,6 +1346,7 @@ switch ($mode) if ($mode) { $params[] = "mode=$mode"; + $u_first_char_params[] = "mode=$mode"; } $sort_params[] = "mode=$mode"; From ba6943a6a0ea50af772dc6e94f13b56292cd9f37 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 12 Mar 2012 10:11:52 +0100 Subject: [PATCH 098/279] [ticket/10605] Prefix function with phpbb_ and use true instead of 1 PHPBB3-10605 --- phpBB/includes/functions_privmsgs.php | 4 ++-- phpBB/includes/functions_user.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 30cff8ed72..34f16ea9da 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1086,7 +1086,7 @@ function delete_pm($user_id, $msg_ids, $folder_id) /** * Delete all PM(s) for a given user and delete the ones without references */ -function delete_user_pms($user_id) +function phpbb_delete_user_pms($user_id) { global $db, $user, $phpbb_root_path, $phpEx; @@ -1116,7 +1116,7 @@ function delete_user_pms($user_id) $undelivered_user[$row['user_id']][] = true; } - $delete_rows[$row['msg_id']] = 1; + $delete_rows[$row['msg_id']] = true; } $db->sql_freeresult($result); diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 20923ea495..92a7b8e0e9 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -529,11 +529,11 @@ function user_delete($mode, $user_id, $post_username = false) $db->sql_query($sql); // Clean the private messages tables from the user - if (!function_exists('delete_user_pms')) + if (!function_exists('phpbb_delete_user_pms')) { include($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx); } - delete_user_pms($user_id); + phpbb_delete_user_pms($user_id); $db->sql_transaction('commit'); From 71afba0dedd2fcc4e478e191acc23277df8209c9 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Thu, 15 Mar 2012 22:46:06 -0400 Subject: [PATCH 099/279] [task/php54] Refactor error_reporting call slightly. Separate error level assignment into a variable in this commit so that the only difference between Olympus and Ascraeus is the addition of logic altering $level. PHPBB3-10615 --- phpBB/includes/startup.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/startup.php b/phpBB/includes/startup.php index bbe2f127f1..178fb30435 100644 --- a/phpBB/includes/startup.php +++ b/phpBB/includes/startup.php @@ -19,7 +19,8 @@ if (!defined('E_DEPRECATED')) { define('E_DEPRECATED', 8192); } -error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED); +$level = E_ALL & ~E_NOTICE & ~E_DEPRECATED; +error_reporting($level); /* * Remove variables created by register_globals from the global scope From 5efdbfa5e4e3c00c08167cdfff912ee4937f4fd2 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Thu, 15 Mar 2012 22:47:42 -0400 Subject: [PATCH 100/279] [task/php54] Disable E_STRICT in Olympus when running on PHP 5.4. We cannot use static in Olympus because it must be PHP 4 compatible. Therefore disable E_STRICT for Olympus. This commit should be reverted for Ascraeus. PHPBB3-10615 --- phpBB/includes/startup.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/phpBB/includes/startup.php b/phpBB/includes/startup.php index 178fb30435..cf216a65db 100644 --- a/phpBB/includes/startup.php +++ b/phpBB/includes/startup.php @@ -20,6 +20,21 @@ if (!defined('E_DEPRECATED')) define('E_DEPRECATED', 8192); } $level = E_ALL & ~E_NOTICE & ~E_DEPRECATED; +if (version_compare(PHP_VERSION, '5.4.0-dev', '>=')) +{ + // PHP 5.4 adds E_STRICT to E_ALL. + // Our utf8 normalizer triggers E_STRICT output on PHP 5.4. + // Unfortunately it cannot be made E_STRICT-clean while + // continuing to work on PHP 4. + // Therefore, in phpBB 3.0.x we disable E_STRICT on PHP 5.4+, + // while phpBB 3.1 will fix utf8 normalizer. + // E_STRICT is defined starting with PHP 5 + if (!defined('E_STRICT')) + { + define('E_STRICT', 2048); + } + $level &= ~E_STRICT; +} error_reporting($level); /* From c551b46115c889ac955649fe5513fb1d39d9979e Mon Sep 17 00:00:00 2001 From: Dhruv Goel Date: Mon, 19 Mar 2012 17:11:30 +0530 Subject: [PATCH 101/279] [ticket/10691] Fixed the speed of creating search index $time is now initialized after each batch iteration. Speed for each batch iteration of creating search index is fixed. PHPBB3-10691 --- phpBB/develop/create_search_index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/develop/create_search_index.php b/phpBB/develop/create_search_index.php index 28001035f6..c1a7125d61 100644 --- a/phpBB/develop/create_search_index.php +++ b/phpBB/develop/create_search_index.php @@ -36,7 +36,6 @@ $search_errors = array(); $search = new $class_name($search_errors); $batch_size = isset($argv[2]) ? $argv[2] : 2000; -$time = time(); if (method_exists($search, 'create_index')) { @@ -68,6 +67,7 @@ else while ($post_counter <= $max_post_id) { $row_count = 0; + $time = time(); printf("Processing posts with %d <= post_id <= %d\n", $post_counter + 1, From 97d4f168f588288df071e4a8b107b9ffb8b0355f Mon Sep 17 00:00:00 2001 From: Richard Foote Date: Mon, 19 Mar 2012 15:08:28 -0400 Subject: [PATCH 102/279] [ticket/10675] Add disk full language string when posting attachments Add language string visible by admins only for when the disk does not have enough free space to upload attachments. PHPBB3-10675 --- phpBB/includes/functions_posting.php | 9 ++++++++- phpBB/language/en/posting.php | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index f920be9c4b..b40fd67927 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -497,7 +497,14 @@ function upload_attachment($form_name, $forum_id, $local = false, $local_storage { if ($free_space <= $file->get('filesize')) { - $filedata['error'][] = $user->lang['ATTACH_QUOTA_REACHED']; + if ($auth->acl_get('a_')) + { + $filedata['error'][] = $user->lang['ATTACH_DISK_FULL']; + } + else + { + $filedata['error'][] = $user->lang['ATTACH_QUOTA_REACHED']; + } $filedata['post_attach'] = false; $file->remove(); diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index f8d265dddd..dd0ba7fc6d 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -42,6 +42,7 @@ $lang = array_merge($lang, array( 'ADD_POLL' => 'Poll creation', 'ADD_POLL_EXPLAIN' => 'If you do not want to add a poll to your topic leave the fields blank.', 'ALREADY_DELETED' => 'Sorry but this message is already deleted.', + 'ATTACH_DISK_FULL' => 'There is not enough free disk space to post this attachment', 'ATTACH_QUOTA_REACHED' => 'Sorry, the board attachment quota has been reached.', 'ATTACH_SIG' => 'Attach a signature (signatures can be altered via the UCP)', From 70d88965c795a5e392605fe556df580773a505c3 Mon Sep 17 00:00:00 2001 From: Richard Foote Date: Mon, 19 Mar 2012 23:19:21 -0400 Subject: [PATCH 103/279] [ticket/10708] Check converted passwords for multi-byte characters Check for multi-byte characters in converted passwords. PHPBB3-10708 --- phpBB/includes/auth/auth_db.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/auth/auth_db.php b/phpBB/includes/auth/auth_db.php index c20196d019..1c6cdf7832 100644 --- a/phpBB/includes/auth/auth_db.php +++ b/phpBB/includes/auth/auth_db.php @@ -163,7 +163,7 @@ function login_db($username, $password, $ip = '', $browser = '', $forwarded_for $password_old_format = (!STRIP) ? addslashes($password_old_format) : $password_old_format; $password_new_format = ''; - set_var($password_new_format, stripslashes($password_old_format), 'string'); + set_var($password_new_format, stripslashes($password_old_format), 'string', true); if ($password == $password_new_format) { From 2005c339ff26bf189fb818f0e25d6c0954b9702a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 20 Mar 2012 17:45:08 +0100 Subject: [PATCH 104/279] =?UTF-8?q?[ticket/10717]=20Fix=20profile=20field?= =?UTF-8?q?=20sample=20in=20prosilver=C2=B4s=20memberlist=5Fview.html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PHPBB3-10717 --- phpBB/styles/prosilver/template/memberlist_view.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html index cfec07cff0..2758a7e6cc 100644 --- a/phpBB/styles/prosilver/template/memberlist_view.html +++ b/phpBB/styles/prosilver/template/memberlist_view.html @@ -69,7 +69,7 @@
    {L_JABBER}:
    {L_SEND_JABBER_MESSAGE}
    {L_JABBER}:
    {USER_JABBER}
    -
    {postrow.PROFILE_FIELD1_NAME}:
    {postrow.PROFILE_FIELD1_VALUE}
    +
    {PROFILE_FIELD1_NAME}:
    {PROFILE_FIELD1_VALUE}
    From c2169f689955dfb3d6fe48bd0186e06583d7f7a4 Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Wed, 21 Mar 2012 09:17:16 +0000 Subject: [PATCH 105/279] [feature/events-dispatcher] Adding phpBB/vendor to .gitignore PHPBB3-9550 --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 7d789c59a1..59f7f49e65 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ /phpBB/images/avatars/gallery/* /phpBB/images/avatars/upload/* /phpBB/store/* +/phpBB/vendor /tests/phpbb_unit_tests.sqlite2 /tests/test_config.php /tests/tmp/* From 4dafcc2525fa72f2bd91760fae49e51ff9d1a0ef Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Wed, 21 Mar 2012 22:57:29 +0000 Subject: [PATCH 106/279] [task/travis] Adding Travis Continuous Intergration Support PHPBB3-10718 --- .travis.yml | 33 +++++++++++++++++++++++++++++++++ travis/mysql.travis.xml | 28 ++++++++++++++++++++++++++++ travis/postgres.travis.xml | 30 ++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 .travis.yml create mode 100644 travis/mysql.travis.xml create mode 100644 travis/postgres.travis.xml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000000..e091954e0e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,33 @@ +language: php +php: + - 5.2 + - 5.3 + - 5.4 + +env: + - DB=mysql + - DB=postgres + +before_script: + - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres; fi" + - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'create database phpbb_tests;' -U postgres; fi" + - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS phpbb_tests;'; fi" + - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.2' ]; then pear install --force phpunit/DbUnit; fi" + - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.3' ]; then pyrus install --force phpunit/DbUnit; fi" + - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.4' ]; then pyrus install --force phpunit/DbUnit; fi" + - phpenv rehash + +script: + - phpunit --configuration travis/$DB.travis.xml + +notifications: + email: + recipients: + - m@michaelcullum.com + on_success: never + on_failure: always + +branches: + only: + develop + task/travis diff --git a/travis/mysql.travis.xml b/travis/mysql.travis.xml new file mode 100644 index 0000000000..a849f50136 --- /dev/null +++ b/travis/mysql.travis.xml @@ -0,0 +1,28 @@ + + + + + ../tests/ + + + + + + + + + + + + + diff --git a/travis/postgres.travis.xml b/travis/postgres.travis.xml new file mode 100644 index 0000000000..e44696a335 --- /dev/null +++ b/travis/postgres.travis.xml @@ -0,0 +1,30 @@ + + + + + ../tests/ + + + + + + + + + + + + + + + From 9120c7691e28ca298eb83ebbe12a82c2723cfeee Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Wed, 21 Mar 2012 23:25:50 +0000 Subject: [PATCH 107/279] [task/travis] Removing development information PHPBB3-10718 --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index e091954e0e..8e870ca9c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,11 +23,12 @@ script: notifications: email: recipients: - - m@michaelcullum.com + - dev-team@phpbb.com on_success: never - on_failure: always + on_failure: change branches: only: develop + develop-olympus task/travis From 4325bbf4c601332614f456df969983d85829e931 Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Wed, 21 Mar 2012 23:30:56 +0000 Subject: [PATCH 108/279] [task/travis] Add automated testing to readme PHPBB3-10718 --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 6b94f898a3..f7dfc4926e 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,12 @@ Find support and lots more on [phpBB.com](http://www.phpbb.com)! Discuss the dev 3. [Read our Git Contribution Guidelines](http://wiki.phpbb.com/Git); if you're new to git, also read [the introduction guide](http://wiki.phpbb.com/display/DEV/Working+with+Git) 4. Send us a pull request +## AUTOMATED TESTING + +We have unit and functional tests in order to prevent regressions. You can view the bamboo continuous integration [here](http://bamboo.phpbb.com) or check our travis build below. +Develop - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb3.png?branch=develop)](http://travis-ci.org/phpbb/phpbb3) +Develop-Olympus - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb3.png?branch=develop-olympus)](http://travis-ci.org/phpbb/phpbb3) + ## LICENSE [GNU General Public License v2](http://opensource.org/licenses/gpl-2.0.php) From 5a9dd1994fc20aaebe3145540b630826d7333998 Mon Sep 17 00:00:00 2001 From: rxu Date: Thu, 22 Mar 2012 21:19:01 +0800 Subject: [PATCH 109/279] [ticket/10684] Adjust function and parameter name, minor changes. PHPBB3-10684 --- phpBB/includes/functions_posting.php | 4 ++-- phpBB/includes/functions_privmsgs.php | 4 ++-- phpBB/includes/functions_user.php | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 073ce1ff4e..7f45b2da8c 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1181,11 +1181,11 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id $topic_title = censor_text($topic_title); // Exclude guests, current user and banned users from notifications - if (!function_exists('phpbb_get_banned_users_ids')) + if (!function_exists('phpbb_get_banned_user_ids')) { include($phpbb_root_path . 'includes/functions_user.' . $phpEx); } - $sql_ignore_users = phpbb_get_banned_users_ids(); + $sql_ignore_users = phpbb_get_banned_user_ids(); $sql_ignore_users[ANONYMOUS] = ANONYMOUS; $sql_ignore_users[$user->data['user_id']] = $user->data['user_id']; diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 4ea8f74153..447920cfd5 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1630,11 +1630,11 @@ function pm_notification($mode, $author, $recipients, $subject, $message, $msg_i return; } - if (!function_exists('phpbb_get_banned_users_ids')) + if (!function_exists('phpbb_get_banned_user_ids')) { include($phpbb_root_path . 'includes/functions_user.' . $phpEx); } - $banned_users = phpbb_get_banned_users_ids(array_keys($recipients)); + $banned_users = phpbb_get_banned_user_ids(array_keys($recipients)); $recipients = array_diff(array_keys($recipients), $banned_users); if (!sizeof($recipients)) diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index 8c42a5bb42..10fb57ea97 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -3588,24 +3588,24 @@ function remove_newly_registered($user_id, $user_data = false) } /** -* Get a list of banned users' ids, ignoring stale bans which were not cleaned yet. +* Gets user ids of currently banned registered users. * -* @param array $users_ids Array of users' ids to check for banning, +* @param array $user_ids Array of users' ids to check for banning, * leave empty to get complete list of banned ids * @return array Array of banned users' ids if any, empty array otherwise */ -function phpbb_get_banned_users_ids($users_ids = array()) +function phpbb_get_banned_user_ids($user_ids = array()) { global $db; - $sql_users_ids = (!empty($users_ids)) ? $db->sql_in_set('ban_userid', $users_ids) : 'ban_userid <> 0'; + $sql_user_ids = (!empty($user_ids)) ? $db->sql_in_set('ban_userid', $user_ids) : 'ban_userid <> 0'; // Get banned User ID's // Ignore stale bans which were not wiped yet $banned_ids_list = array(); $sql = 'SELECT ban_userid FROM ' . BANLIST_TABLE . " - WHERE $sql_users_ids + WHERE $sql_user_ids AND ban_exclude <> 1 AND (ban_end > " . time() . ' OR ban_end = 0)'; From d1980f6ad616e800ff82299ceafc5c8c763c6570 Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Thu, 22 Mar 2012 13:32:58 +0000 Subject: [PATCH 110/279] [task/travis] Fixing some travis issues PHPBB3-10718 --- .travis.yml | 2 +- README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8e870ca9c2..bf97a20850 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ notifications: email: recipients: - dev-team@phpbb.com - on_success: never + on_success: change on_failure: change branches: diff --git a/README.md b/README.md index f7dfc4926e..51e65176c6 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,8 @@ Find support and lots more on [phpBB.com](http://www.phpbb.com)! Discuss the dev ## AUTOMATED TESTING We have unit and functional tests in order to prevent regressions. You can view the bamboo continuous integration [here](http://bamboo.phpbb.com) or check our travis build below. -Develop - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb3.png?branch=develop)](http://travis-ci.org/phpbb/phpbb3) -Develop-Olympus - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb3.png?branch=develop-olympus)](http://travis-ci.org/phpbb/phpbb3) +develop - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb3.png?branch=develop)](http://travis-ci.org/phpbb/phpbb3) +develop-olympus - [![Build Status](https://secure.travis-ci.org/phpbb/phpbb3.png?branch=develop-olympus)](http://travis-ci.org/phpbb/phpbb3) ## LICENSE From c7f65fba627680e7de81ae6c7ea9c1e0fc4359ea Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Thu, 22 Mar 2012 14:13:25 +0000 Subject: [PATCH 111/279] [task/travis] Rename travis phpunit config files PHPBB3-10718 --- .travis.yml | 2 +- travis/{mysql.travis.xml => phpunit-mysql-travis.xml} | 0 travis/{postgres.travis.xml => phpunit-postgres-travis.xml} | 0 3 files changed, 1 insertion(+), 1 deletion(-) rename travis/{mysql.travis.xml => phpunit-mysql-travis.xml} (100%) rename travis/{postgres.travis.xml => phpunit-postgres-travis.xml} (100%) diff --git a/.travis.yml b/.travis.yml index bf97a20850..d638e1cccd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ before_script: - phpenv rehash script: - - phpunit --configuration travis/$DB.travis.xml + - phpunit --configuration travis/phpunit-$DB-travis.xml notifications: email: diff --git a/travis/mysql.travis.xml b/travis/phpunit-mysql-travis.xml similarity index 100% rename from travis/mysql.travis.xml rename to travis/phpunit-mysql-travis.xml diff --git a/travis/postgres.travis.xml b/travis/phpunit-postgres-travis.xml similarity index 100% rename from travis/postgres.travis.xml rename to travis/phpunit-postgres-travis.xml From 115ee7f3b815567cf598178225022b2d7d7f5310 Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Thu, 22 Mar 2012 14:44:36 +0000 Subject: [PATCH 112/279] [task/travis] Some more small travis fixes PHPBB3-10718 --- .travis.yml | 6 ------ travis/phpunit-mysql-travis.xml | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index d638e1cccd..78221d588c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,9 +26,3 @@ notifications: - dev-team@phpbb.com on_success: change on_failure: change - -branches: - only: - develop - develop-olympus - task/travis diff --git a/travis/phpunit-mysql-travis.xml b/travis/phpunit-mysql-travis.xml index a849f50136..807dfbcdaa 100644 --- a/travis/phpunit-mysql-travis.xml +++ b/travis/phpunit-mysql-travis.xml @@ -8,7 +8,7 @@ processIsolation="false" stopOnFailure="false" syntaxCheck="true" - strict="true" + strict="true" bootstrap="../tests/bootstrap.php"> From 0ed66ad0e8d11c802520046b446aa5622a637df9 Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Thu, 22 Mar 2012 16:00:10 +0000 Subject: [PATCH 113/279] [task/travis] Exclude functional and slow tests PHPBB3-10718 --- travis/phpunit-mysql-travis.xml | 6 ++++++ travis/phpunit-postgres-travis.xml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/travis/phpunit-mysql-travis.xml b/travis/phpunit-mysql-travis.xml index 807dfbcdaa..79215c8de1 100644 --- a/travis/phpunit-mysql-travis.xml +++ b/travis/phpunit-mysql-travis.xml @@ -16,6 +16,12 @@ + + + slow + + + diff --git a/travis/phpunit-postgres-travis.xml b/travis/phpunit-postgres-travis.xml index e44696a335..02db76ae78 100644 --- a/travis/phpunit-postgres-travis.xml +++ b/travis/phpunit-postgres-travis.xml @@ -16,6 +16,12 @@ + + + slow + + + From 841d11c6cd90d331c2923ba7851dd5f813203ddf Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Thu, 22 Mar 2012 16:09:58 +0000 Subject: [PATCH 114/279] [task/travis] Refactor php version check for dbunit install PHPBB3-10718 --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 78221d588c..d73bbd2a48 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,9 +12,7 @@ before_script: - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'DROP DATABASE IF EXISTS phpbb_tests;' -U postgres; fi" - sh -c "if [ '$DB' = 'pgsql' ]; then psql -c 'create database phpbb_tests;' -U postgres; fi" - sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS phpbb_tests;'; fi" - - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.2' ]; then pear install --force phpunit/DbUnit; fi" - - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.3' ]; then pyrus install --force phpunit/DbUnit; fi" - - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.4' ]; then pyrus install --force phpunit/DbUnit; fi" + - sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.2' ]; then pear install --force phpunit/DbUnit; else pyrus install --force phpunit/DbUnit; fi" - phpenv rehash script: From 5bcdfe94dd487441565c00450b3a8efcaeecd840 Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Fri, 23 Mar 2012 06:40:15 +0000 Subject: [PATCH 115/279] [ticket/10723] Stop Travis running all tests on sqlite Correct information so all tests don't run on sqlite PHPBB3-10723 --- travis/phpunit-mysql-travis.xml | 14 +++++++------- travis/phpunit-postgres-travis.xml | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/travis/phpunit-mysql-travis.xml b/travis/phpunit-mysql-travis.xml index 79215c8de1..36845a7f71 100644 --- a/travis/phpunit-mysql-travis.xml +++ b/travis/phpunit-mysql-travis.xml @@ -23,12 +23,12 @@ - - - - - - - + + + + + + + diff --git a/travis/phpunit-postgres-travis.xml b/travis/phpunit-postgres-travis.xml index 02db76ae78..461a53bcb1 100644 --- a/travis/phpunit-postgres-travis.xml +++ b/travis/phpunit-postgres-travis.xml @@ -25,12 +25,12 @@ - - - - - - - + + + + + + + From 2768db44f557cd5db4b54a287ecb1d2fcbe94140 Mon Sep 17 00:00:00 2001 From: HTF Date: Sat, 24 Mar 2012 15:13:04 +0000 Subject: [PATCH 116/279] [ticket/10129] Remove apostrophes and plurals in ACP user management -> permissions language file as per ticket. PHPBB3-10129 --- phpBB/language/en/acp/common.php | 8 ++++---- phpBB/language/en/acp/permissions.php | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php index 958b9c7598..e64ba3c371 100644 --- a/phpBB/language/en/acp/common.php +++ b/phpBB/language/en/acp/common.php @@ -96,10 +96,10 @@ $lang = array_merge($lang, array( 'ACP_GLOBAL_MODERATORS' => 'Global moderators', 'ACP_GLOBAL_PERMISSIONS' => 'Global permissions', 'ACP_GROUPS' => 'Groups', - 'ACP_GROUPS_FORUM_PERMISSIONS' => 'Groups’ forum permissions', + 'ACP_GROUPS_FORUM_PERMISSIONS' => 'Group forum permissions', 'ACP_GROUPS_MANAGE' => 'Manage groups', 'ACP_GROUPS_MANAGEMENT' => 'Group management', - 'ACP_GROUPS_PERMISSIONS' => 'Groups’ permissions', + 'ACP_GROUPS_PERMISSIONS' => 'Group permissions', 'ACP_ICONS' => 'Topic icons', 'ACP_ICONS_SMILIES' => 'Topic icons/smilies', @@ -172,9 +172,9 @@ $lang = array_merge($lang, array( 'ACP_THEMES' => 'Themes', 'ACP_UPDATE' => 'Updating', - 'ACP_USERS_FORUM_PERMISSIONS' => 'Users’ forum permissions', + 'ACP_USERS_FORUM_PERMISSIONS' => 'User forum permissions', 'ACP_USERS_LOGS' => 'User logs', - 'ACP_USERS_PERMISSIONS' => 'Users’ permissions', + 'ACP_USERS_PERMISSIONS' => 'User permissions', 'ACP_USER_ATTACH' => 'Attachments', 'ACP_USER_AVATAR' => 'Avatar', 'ACP_USER_FEEDBACK' => 'Feedback', diff --git a/phpBB/language/en/acp/permissions.php b/phpBB/language/en/acp/permissions.php index 016be51282..c0396cc247 100644 --- a/phpBB/language/en/acp/permissions.php +++ b/phpBB/language/en/acp/permissions.php @@ -40,10 +40,10 @@ $lang = array_merge($lang, array(

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

    Global Permissions

    -

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

    +

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

    Forum Based Permissions

    -

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

    +

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

    Permission Roles

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

    @@ -83,13 +83,13 @@ $lang = array_merge($lang, array( 'ACP_FORUM_PERMISSIONS_COPY_EXPLAIN' => 'Here you can copy forum permissions from one forum to one or more other forums.', 'ACP_GLOBAL_MODERATORS_EXPLAIN' => 'Here you can assign global moderator permissions to users or groups. These moderators are like ordinary moderators except they have access to every forum on your board.', 'ACP_GROUPS_FORUM_PERMISSIONS_EXPLAIN' => 'Here you can assign forum permissions to groups.', - 'ACP_GROUPS_PERMISSIONS_EXPLAIN' => 'Here you can assign global permissions to groups - user permissions, global moderator permissions and administrator permissions. User permissions include capabilities such as the use of avatars, sending private messages, et cetera; global moderator permissions such as approving posts, manage topics, manage bans, et cetera and lastly administrator permissions such as altering permissions, define custom BBCodes, manage forums, et cetera. Individual users permissions should only be changed in rare occasions, the preferred method is putting users in groups and assigning the group’s permissions.', + 'ACP_GROUPS_PERMISSIONS_EXPLAIN' => 'Here you can assign global permissions to groups - user permissions, global moderator permissions and administrator permissions. User permissions include capabilities such as the use of avatars, sending private messages, et cetera; global moderator permissions such as approving posts, manage topics, manage bans, et cetera and lastly administrator permissions such as altering permissions, define custom BBCodes, manage forums, et cetera. Individual user permissions should only be changed in rare occasions, the preferred method is putting users in groups and assigning the group permissions.', 'ACP_ADMIN_ROLES_EXPLAIN' => 'Here you are able to manage the roles for administrative permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.', 'ACP_FORUM_ROLES_EXPLAIN' => 'Here you are able to manage the roles for forum permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.', 'ACP_MOD_ROLES_EXPLAIN' => 'Here you are able to manage the roles for moderative permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.', 'ACP_USER_ROLES_EXPLAIN' => 'Here you are able to manage the roles for user permissions. Roles are effective permissions, if you change a role the items having this role assigned will change its permissions too.', 'ACP_USERS_FORUM_PERMISSIONS_EXPLAIN' => 'Here you can assign forum permissions to users.', - 'ACP_USERS_PERMISSIONS_EXPLAIN' => 'Here you can assign global permissions to users - user permissions, global moderator permissions and administrator permissions. User permissions include capabilities such as the use of avatars, sending private messages, et cetera; global moderator permissions such as approving posts, manage topics, manage bans, et cetera and lastly administrator permissions such as altering permissions, define custom BBCodes, manage forums, et cetera. To alter these settings for large numbers of users the Group permissions system is the preferred method. User’s permissions should only be changed in rare occasions, the preferred method is putting users in groups and assigning the group’s permissions.', + 'ACP_USERS_PERMISSIONS_EXPLAIN' => 'Here you can assign global permissions to users - user permissions, global moderator permissions and administrator permissions. User permissions include capabilities such as the use of avatars, sending private messages, et cetera; global moderator permissions such as approving posts, manage topics, manage bans, et cetera and lastly administrator permissions such as altering permissions, define custom BBCodes, manage forums, et cetera. To alter these settings for large numbers of users the Group permissions system is the preferred method. User permissions should only be changed in rare occasions, the preferred method is putting users in groups and assigning the group permissions.', 'ACP_VIEW_ADMIN_PERMISSIONS_EXPLAIN' => 'Here you can view the effective administrative permissions assigned to the selected users/groups.', 'ACP_VIEW_GLOBAL_MOD_PERMISSIONS_EXPLAIN' => 'Here you can view the global moderative permissions assigned to the selected users/groups.', 'ACP_VIEW_FORUM_PERMISSIONS_EXPLAIN' => 'Here you can view the forum permissions assigned to the selected users/groups and forums.', @@ -225,8 +225,8 @@ $lang = array_merge($lang, array( 'SELECT_TYPE' => 'Select type', 'SET_PERMISSIONS' => 'Set permissions', 'SET_ROLE_PERMISSIONS' => 'Set role permissions', - 'SET_USERS_PERMISSIONS' => 'Set users permissions', - 'SET_USERS_FORUM_PERMISSIONS' => 'Set users forum permissions', + 'SET_USERS_PERMISSIONS' => 'Set user permissions', + 'SET_USERS_FORUM_PERMISSIONS' => 'Set user forum permissions', 'TRACE_DEFAULT' => 'By default every permission is NO (unset). So the permission can be overwritten by other settings.', 'TRACE_FOR' => 'Trace for', From e8830f605f73a0c8fa5c3ea579ee18f295b81600 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 27 Mar 2012 01:18:02 +0200 Subject: [PATCH 117/279] [ticket/10605] Use unset() instead of checking user_id over and over again. PHPBB3-10605 --- phpBB/includes/functions_privmsgs.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 34f16ea9da..59dea50094 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1134,13 +1134,9 @@ function phpbb_delete_user_pms($user_id) $db->sql_query($sql); } + unset($undelivered_user[$user_id]); foreach ($undelivered_user as $_user_id => $ary) { - if ($_user_id == $user_id) - { - continue; - } - $sql = 'UPDATE ' . USERS_TABLE . ' SET user_new_privmsg = user_new_privmsg - ' . sizeof($ary) . ', user_unread_privmsg = user_unread_privmsg - ' . sizeof($ary) . ' From 2203bc204e55c33e2e9b212eeb0c7bf2e3060851 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 27 Mar 2012 01:29:29 +0200 Subject: [PATCH 118/279] [ticket/10605] Turn $undelivered_user into a real array of counters. PHPBB3-10605 --- phpBB/includes/functions_privmsgs.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 59dea50094..352bd4d15d 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1113,7 +1113,15 @@ function phpbb_delete_user_pms($user_id) { // Undelivered messages $undelivered_msg[] = $row['msg_id']; - $undelivered_user[$row['user_id']][] = true; + + if (isset($undelivered_user[$row['user_id']])) + { + ++$undelivered_user[$row['user_id']]; + } + else + { + $undelivered_user[$row['user_id']] = 1; + } } $delete_rows[$row['msg_id']] = true; @@ -1135,11 +1143,11 @@ function phpbb_delete_user_pms($user_id) } unset($undelivered_user[$user_id]); - foreach ($undelivered_user as $_user_id => $ary) + foreach ($undelivered_user as $_user_id => $count) { $sql = 'UPDATE ' . USERS_TABLE . ' - SET user_new_privmsg = user_new_privmsg - ' . sizeof($ary) . ', - user_unread_privmsg = user_unread_privmsg - ' . sizeof($ary) . ' + SET user_new_privmsg = user_new_privmsg - ' . $count . ', + user_unread_privmsg = user_unread_privmsg - ' . $count . ' WHERE user_id = ' . $_user_id; $db->sql_query($sql); } From dbc7a69ad2bf6b062a4d7a40d62be29a410b5c18 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 27 Mar 2012 01:30:52 +0200 Subject: [PATCH 119/279] [ticket/10605] Remove unused variable declarations. PHPBB3-10605 --- phpBB/includes/functions_privmsgs.php | 1 - 1 file changed, 1 deletion(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 352bd4d15d..4ff0c53420 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1106,7 +1106,6 @@ function phpbb_delete_user_pms($user_id) $result = $db->sql_query($sql); $undelivered_msg = $undelivered_user = $delete_rows = array(); - $num_unread = $num_new = $num_deleted = 0; while ($row = $db->sql_fetchrow($result)) { if ($row['author_id'] == $user_id && $row['folder_id'] == PRIVMSGS_NO_BOX) From 9040f18d7cf9de137acbac6072dc2ffd3cede1b5 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 27 Mar 2012 01:35:01 +0200 Subject: [PATCH 120/279] [ticket/10605] Remove unnecessary array_keys calls on $delete_rows. PHPBB3-10605 --- 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 4ff0c53420..00029a1986 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1123,7 +1123,7 @@ function phpbb_delete_user_pms($user_id) } } - $delete_rows[$row['msg_id']] = true; + $delete_rows[(int) $row['msg_id']] = (int) $row['msg_id']; } $db->sql_freeresult($result); @@ -1154,13 +1154,13 @@ function phpbb_delete_user_pms($user_id) // Delete private message data $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . " WHERE user_id = $user_id - AND " . $db->sql_in_set('msg_id', array_keys($delete_rows)); + AND " . $db->sql_in_set('msg_id', $delete_rows); $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', array_keys($delete_rows)); + WHERE ' . $db->sql_in_set('msg_id', $delete_rows); $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) From dd53d0576d8256e37074cc23dd5b9769acc12d1a Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 27 Mar 2012 01:39:49 +0200 Subject: [PATCH 121/279] [ticket/10605] Remove unnecessary $delete_ids array. PHPBB3-10605 --- phpBB/includes/functions_privmsgs.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 00029a1986..23f582641b 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1169,9 +1169,7 @@ function phpbb_delete_user_pms($user_id) } $db->sql_freeresult($result); - $delete_ids = array_keys($delete_rows); - - if (sizeof($delete_ids)) + if (!empty($delete_rows)) { // Check if there are any attachments we need to remove if (!function_exists('delete_attachments')) @@ -1179,10 +1177,10 @@ function phpbb_delete_user_pms($user_id) include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); } - delete_attachments('message', $delete_ids, false); + delete_attachments('message', $delete_rows, false); $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . ' - WHERE ' . $db->sql_in_set('msg_id', $delete_ids); + WHERE ' . $db->sql_in_set('msg_id', $delete_rows); $db->sql_query($sql); } From ad073d22b9e543d5842af7b8ef94fe7e6b443504 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 27 Mar 2012 01:43:09 +0200 Subject: [PATCH 122/279] [ticket/10605] Break long comment into multiple lines 80 chars short. PHPBB3-10605 --- 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 23f582641b..e7beae3fab 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1184,7 +1184,8 @@ function phpbb_delete_user_pms($user_id) $db->sql_query($sql); } - // Set the remaining author id to anonymous - this way users are still able to read messages from users being removed + // Set the remaining author id to anonymous + // This way users are still able to read messages from users being removed $sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . ' SET author_id = ' . ANONYMOUS . ' WHERE author_id = ' . $user_id; From 9c8aab4d32a001ae66fe005b7124737fc5ad7dd6 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 27 Mar 2012 02:02:17 +0200 Subject: [PATCH 123/279] [ticket/10605] Rename $delete_rows to $delete_ids. PHPBB3-10605 --- phpBB/includes/functions_privmsgs.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index e7beae3fab..576da4d439 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1105,7 +1105,7 @@ function phpbb_delete_user_pms($user_id) AND folder_id = ' . PRIVMSGS_NO_BOX . ')'; $result = $db->sql_query($sql); - $undelivered_msg = $undelivered_user = $delete_rows = array(); + $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) @@ -1123,11 +1123,11 @@ function phpbb_delete_user_pms($user_id) } } - $delete_rows[(int) $row['msg_id']] = (int) $row['msg_id']; + $delete_ids[(int) $row['msg_id']] = (int) $row['msg_id']; } $db->sql_freeresult($result); - if (!sizeof($delete_rows)) + if (empty($delete_ids)) { return false; } @@ -1154,22 +1154,22 @@ function phpbb_delete_user_pms($user_id) // Delete private message data $sql = 'DELETE FROM ' . PRIVMSGS_TO_TABLE . " WHERE user_id = $user_id - AND " . $db->sql_in_set('msg_id', $delete_rows); + AND " . $db->sql_in_set('msg_id', $delete_ids); $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_rows); + WHERE ' . $db->sql_in_set('msg_id', $delete_ids); $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) { - unset($delete_rows[$row['msg_id']]); + unset($delete_ids[$row['msg_id']]); } $db->sql_freeresult($result); - if (!empty($delete_rows)) + if (!empty($delete_ids)) { // Check if there are any attachments we need to remove if (!function_exists('delete_attachments')) @@ -1177,10 +1177,10 @@ function phpbb_delete_user_pms($user_id) include($phpbb_root_path . 'includes/functions_admin.' . $phpEx); } - delete_attachments('message', $delete_rows, false); + delete_attachments('message', $delete_ids, false); $sql = 'DELETE FROM ' . PRIVMSGS_TABLE . ' - WHERE ' . $db->sql_in_set('msg_id', $delete_rows); + WHERE ' . $db->sql_in_set('msg_id', $delete_ids); $db->sql_query($sql); } From 0397b462174887bda3fea4bcebf9a26f6b591a3e Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 27 Mar 2012 17:29:03 +0200 Subject: [PATCH 124/279] [ticket/10605] Split query to be able to use indexes PHPBB3-10605 --- phpBB/includes/functions_privmsgs.php | 34 ++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index 576da4d439..dd81e8f92d 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1098,11 +1098,11 @@ function phpbb_delete_user_pms($user_id) } // Get PM Information for later deleting + // The two queries where split, so we can use our indexes + // 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 . ' - OR (author_id = ' . $user_id . ' - AND folder_id = ' . PRIVMSGS_NO_BOX . ')'; + WHERE user_id = ' . $user_id; $result = $db->sql_query($sql); $undelivered_msg = $undelivered_user = $delete_ids = array(); @@ -1127,6 +1127,34 @@ 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 + FROM ' . PRIVMSGS_TO_TABLE . ' + WHERE author_id = ' . $user_id . ' + AND folder_id = ' . PRIVMSGS_NO_BOX; + $result = $db->sql_query($sql); + + 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']; + + 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']; + } + $db->sql_freeresult($result); + if (empty($delete_ids)) { return false; From b9324577aca6f7f7632b609e975e510e25d8ec86 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 27 Mar 2012 17:32:55 +0200 Subject: [PATCH 125/279] =?UTF-8?q?[ticket/10605]=20Reset=20user=C2=B4s=20?= =?UTF-8?q?pm=20count=20to=200=20when=20deleting=20his=20PMs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PHPBB3-10605 --- phpBB/includes/functions_privmsgs.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php index dd81e8f92d..14a6d83b2a 100644 --- a/phpBB/includes/functions_privmsgs.php +++ b/phpBB/includes/functions_privmsgs.php @@ -1169,7 +1169,17 @@ function phpbb_delete_user_pms($user_id) $db->sql_query($sql); } - unset($undelivered_user[$user_id]); + // 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); + unset($undelivered_user[$user_id]); + } + foreach ($undelivered_user as $_user_id => $count) { $sql = 'UPDATE ' . USERS_TABLE . ' From 1789e0948bd3a06392d8f919d80889ed5bbf2583 Mon Sep 17 00:00:00 2001 From: David King Date: Wed, 28 Mar 2012 17:05:45 -0400 Subject: [PATCH 126/279] [ticket/10732] Add config_dev.php and config_test.php to .gitignore PHPBB3-10732 --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index d875beb784..e6e017f85e 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ /phpBB/cache/*.php /phpBB/cache/queue.php.lock /phpBB/config.php +/phpBB/config_dev.php +/phpBB/config_test.php /phpBB/ext/* /phpBB/files/* /phpBB/images/avatars/gallery/* From fff9f6611eddffb4c509d6e5126c0b0c9723f345 Mon Sep 17 00:00:00 2001 From: Jan Schejbal Date: Thu, 29 Mar 2012 04:16:34 +0200 Subject: [PATCH 127/279] [ticket/10730] Added label tag around "select" text in post splitting UI Added label tags around the "select" text in the post splitting UI in the MCP. Had to add IDs based on the post ID to the select boxes to allow label to work. Tested in Firefox and Chrome. PHPBB3-10730 --- phpBB/styles/prosilver/template/mcp_topic.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/styles/prosilver/template/mcp_topic.html b/phpBB/styles/prosilver/template/mcp_topic.html index 2a5f52f038..5dbc8d670c 100644 --- a/phpBB/styles/prosilver/template/mcp_topic.html +++ b/phpBB/styles/prosilver/template/mcp_topic.html @@ -106,7 +106,7 @@ onload_functions.push('subPanels()');
    - +

    {postrow.POST_SUBJECT}

    {postrow.MINI_POST_IMG} {L_POSTED} {postrow.POST_DATE} {L_POST_BY_AUTHOR} {postrow.POST_AUTHOR_FULL} [ {L_POST_DETAILS} ]

    From 9391d423c05818e5f18ddbe051e1713c835f4404 Mon Sep 17 00:00:00 2001 From: Michael Cullum Date: Fri, 30 Mar 2012 19:04:20 +0100 Subject: [PATCH 128/279] [feature/event-dispatcher] Adding composer.phar to .gitignore for olympus To keep the .gitignore's the same. PHPBB3-9550 --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index e6e017f85e..de26e1dd1e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ /phpBB/cache/*.html /phpBB/cache/*.php /phpBB/cache/queue.php.lock +/phpBB/composer.phar /phpBB/config.php /phpBB/config_dev.php /phpBB/config_test.php From b8b342be2d238616b96ace9acbe8af2e18ba1e7a Mon Sep 17 00:00:00 2001 From: Richard Foote Date: Sat, 31 Mar 2012 12:46:44 -0400 Subject: [PATCH 129/279] [Ticket/10675] Correct language string ATTACH_DISK_FULL Add period to ATTACH_DISK_FULL language string PHPBB3-10675 --- phpBB/language/en/posting.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php index dd0ba7fc6d..24f3204c57 100644 --- a/phpBB/language/en/posting.php +++ b/phpBB/language/en/posting.php @@ -42,7 +42,7 @@ $lang = array_merge($lang, array( 'ADD_POLL' => 'Poll creation', 'ADD_POLL_EXPLAIN' => 'If you do not want to add a poll to your topic leave the fields blank.', 'ALREADY_DELETED' => 'Sorry but this message is already deleted.', - 'ATTACH_DISK_FULL' => 'There is not enough free disk space to post this attachment', + 'ATTACH_DISK_FULL' => 'There is not enough free disk space to post this attachment.', 'ATTACH_QUOTA_REACHED' => 'Sorry, the board attachment quota has been reached.', 'ATTACH_SIG' => 'Attach a signature (signatures can be altered via the UCP)', From b1b530f92cca7eb115e096ea8901133d421771d2 Mon Sep 17 00:00:00 2001 From: Hari Sankar R Date: Sun, 1 Apr 2012 18:25:50 +0530 Subject: [PATCH 130/279] [ticket/10731] Fixed addquote() to work on opera browser. In opera, window.getSelection() returned incorrect values, should be using document.getSelection() instead. Fixed in prosilver and subsilver2 templates. PHPBB3-10731 --- phpBB/styles/prosilver/template/editor.js | 4 ++-- phpBB/styles/subsilver2/template/editor.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/styles/prosilver/template/editor.js b/phpBB/styles/prosilver/template/editor.js index cfdb54f54b..c16b0ef703 100644 --- a/phpBB/styles/prosilver/template/editor.js +++ b/phpBB/styles/prosilver/template/editor.js @@ -219,7 +219,7 @@ function addquote(post_id, username, l_wrote) // Get text selection - not only the post content :( // IE9 must use the document.selection method but has the *.getSelection so we just force no IE - if (window.getSelection && !is_ie) + if (window.getSelection && !is_ie && !window.opera) { theSelection = window.getSelection().toString(); } @@ -456,4 +456,4 @@ function getCaretPosition(txtarea) } return caretPos; -} \ No newline at end of file +} diff --git a/phpBB/styles/subsilver2/template/editor.js b/phpBB/styles/subsilver2/template/editor.js index 7cc5de9034..151cf53ff1 100644 --- a/phpBB/styles/subsilver2/template/editor.js +++ b/phpBB/styles/subsilver2/template/editor.js @@ -221,7 +221,7 @@ function addquote(post_id, username, l_wrote) // Get text selection - not only the post content :( // IE9 must use the document.selection method but has the *.getSelection so we just force no IE - if (window.getSelection && !is_ie) + if (window.getSelection && !is_ie && !window.opera) { theSelection = window.getSelection().toString(); } @@ -459,4 +459,4 @@ function getCaretPosition(txtarea) } return caretPos; -} \ No newline at end of file +} From 42101fe8d48cbdbe1a4e73bd9cc388a9e4b490c5 Mon Sep 17 00:00:00 2001 From: Hari Sankar R Date: Mon, 2 Apr 2012 16:26:23 +0530 Subject: [PATCH 131/279] [ticket/10699] Long h2 title breaks div.minitabs in MCP Fixed overlapping of Subject title over the minitabs. Added css property to cp.css under MCP Specific tweaks. Wrapped h2 and #minitabs under .tabs-container with clear: both PHPBB3-10699 --- phpBB/styles/prosilver/template/mcp_topic.html | 4 ++-- phpBB/styles/prosilver/theme/cp.css | 17 +++++++++++++++++ phpBB/styles/prosilver/theme/tweaks.css | 10 ++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/phpBB/styles/prosilver/template/mcp_topic.html b/phpBB/styles/prosilver/template/mcp_topic.html index 5dbc8d670c..e8d5ceada4 100644 --- a/phpBB/styles/prosilver/template/mcp_topic.html +++ b/phpBB/styles/prosilver/template/mcp_topic.html @@ -1,5 +1,5 @@ - +

    {L_TOPIC}: {TOPIC_TITLE}

    - +
    {L_NO_TOPIC_ICON}{L_NO_PM_ICON} {L_NO_TOPIC_ICON}{L_NO_PM_ICON}