aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--build/build.xml7
-rw-r--r--build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php25
-rwxr-xr-xbuild/package.php42
-rw-r--r--phpBB/adm/style/acp_forums.html8
-rw-r--r--phpBB/adm/style/acp_groups.html2
-rw-r--r--phpBB/adm/style/acp_users_avatar.html2
-rw-r--r--phpBB/adm/style/auth_provider_ldap.html2
-rw-r--r--phpBB/adm/style/install_update.html208
-rw-r--r--phpBB/assets/javascript/core.js20
-rwxr-xr-xphpBB/bin/phpbbcli.php40
-rw-r--r--phpBB/common.php21
-rw-r--r--phpBB/composer.json9
-rw-r--r--phpBB/composer.lock162
-rw-r--r--phpBB/config/console.yml7
-rw-r--r--phpBB/config/migrator.yml7
-rw-r--r--phpBB/config/services.yml19
-rw-r--r--phpBB/develop/add_permissions.php2
-rw-r--r--phpBB/develop/benchmark.php2
-rw-r--r--phpBB/develop/merge_attachment_tables.php2
-rw-r--r--phpBB/develop/merge_post_tables.php4
-rw-r--r--phpBB/docs/CHANGELOG.html130
-rw-r--r--phpBB/docs/CREDITS.txt3
-rw-r--r--phpBB/docs/events.md105
-rw-r--r--phpBB/download/file.php21
-rw-r--r--phpBB/includes/acp/acp_board.php2
-rw-r--r--phpBB/includes/acp/acp_database.php28
-rw-r--r--phpBB/includes/acp/acp_extensions.php12
-rw-r--r--phpBB/includes/acp/acp_forums.php2
-rw-r--r--phpBB/includes/acp/acp_icons.php2
-rw-r--r--phpBB/includes/acp/acp_main.php4
-rw-r--r--phpBB/includes/acp/acp_permission_roles.php6
-rw-r--r--phpBB/includes/acp/acp_permissions.php2
-rw-r--r--phpBB/includes/acp/acp_profile.php4
-rw-r--r--phpBB/includes/acp/acp_prune.php4
-rw-r--r--phpBB/includes/acp/acp_reasons.php2
-rw-r--r--phpBB/includes/acp/acp_users.php4
-rw-r--r--phpBB/includes/acp/auth.php2
-rw-r--r--phpBB/includes/constants.php2
-rw-r--r--phpBB/includes/functions.php86
-rw-r--r--phpBB/includes/functions_admin.php16
-rw-r--r--phpBB/includes/functions_container.php291
-rw-r--r--phpBB/includes/functions_content.php25
-rw-r--r--phpBB/includes/functions_convert.php4
-rw-r--r--phpBB/includes/functions_display.php2
-rw-r--r--phpBB/includes/functions_install.php2
-rw-r--r--phpBB/includes/functions_user.php2
-rw-r--r--phpBB/includes/mcp/mcp_logs.php4
-rw-r--r--phpBB/includes/mcp/mcp_post.php1
-rw-r--r--phpBB/includes/message_parser.php2
-rw-r--r--phpBB/includes/questionnaire/questionnaire.php7
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewmessage.php12
-rw-r--r--phpBB/includes/ucp/ucp_prefs.php24
-rw-r--r--phpBB/includes/ucp/ucp_profile.php5
-rw-r--r--phpBB/install/convertors/convert_phpbb20.php7
-rw-r--r--phpBB/install/convertors/functions_phpbb20.php8
-rw-r--r--phpBB/install/database_update.php38
-rw-r--r--phpBB/install/index.php27
-rw-r--r--phpBB/install/install_convert.php48
-rw-r--r--phpBB/install/install_install.php37
-rw-r--r--phpBB/install/install_update.php60
-rw-r--r--phpBB/install/schemas/schema_data.sql2
-rw-r--r--phpBB/language/en/acp/board.php4
-rw-r--r--phpBB/language/en/acp/common.php12
-rw-r--r--phpBB/language/en/acp/forums.php4
-rw-r--r--phpBB/language/en/acp/search.php1
-rw-r--r--phpBB/language/en/cli.php44
-rw-r--r--phpBB/language/en/common.php22
-rw-r--r--phpBB/language/en/help_faq.php6
-rw-r--r--phpBB/language/en/install.php10
-rw-r--r--phpBB/language/en/memberlist.php3
-rw-r--r--phpBB/language/en/ucp.php7
-rw-r--r--phpBB/memberlist.php23
-rw-r--r--phpBB/phpbb/auth/auth.php4
-rw-r--r--phpBB/phpbb/auth/provider/oauth/token_storage.php2
-rw-r--r--phpBB/phpbb/cache/service.php2
-rw-r--r--phpBB/phpbb/config_php_file.php175
-rw-r--r--phpBB/phpbb/console/application.php29
-rw-r--r--phpBB/phpbb/console/command/extension/disable.php2
-rw-r--r--phpBB/phpbb/console/command/extension/enable.php4
-rw-r--r--phpBB/phpbb/console/command/extension/purge.php2
-rw-r--r--phpBB/phpbb/controller/helper.php17
-rw-r--r--phpBB/phpbb/cron/task/core/prune_shadow_topics.php4
-rw-r--r--phpBB/phpbb/db/driver/driver.php96
-rw-r--r--phpBB/phpbb/db/driver/driver_interface.php84
-rw-r--r--phpBB/phpbb/db/driver/factory.php435
-rw-r--r--phpBB/phpbb/db/driver/mysqli.php6
-rw-r--r--phpBB/phpbb/db/driver/postgres.php8
-rw-r--r--phpBB/phpbb/db/driver/sqlite3.php7
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/local_url_bbcode.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v310/rc2.php31
-rw-r--r--phpBB/phpbb/db/migration/migration.php6
-rw-r--r--phpBB/phpbb/db/migration/profilefield_base_migration.php94
-rw-r--r--phpBB/phpbb/db/migration/tool/config_text.php125
-rw-r--r--phpBB/phpbb/db/migrator.php2
-rw-r--r--phpBB/phpbb/db/sql_insert_buffer.php2
-rw-r--r--phpBB/phpbb/db/tools.php8
-rw-r--r--phpBB/phpbb/di/container_builder.php402
-rw-r--r--phpBB/phpbb/di/extension/config.php27
-rw-r--r--phpBB/phpbb/event/dispatcher.php5
-rw-r--r--phpBB/phpbb/event/dispatcher_interface.php40
-rw-r--r--phpBB/phpbb/event/md_exporter.php2
-rw-r--r--phpBB/phpbb/event/php_exporter.php2
-rw-r--r--phpBB/phpbb/extension/manager.php42
-rw-r--r--phpBB/phpbb/extension/metadata_manager.php4
-rw-r--r--phpBB/phpbb/filesystem.php2
-rw-r--r--phpBB/phpbb/log/log.php6
-rw-r--r--phpBB/phpbb/path_helper.php132
-rw-r--r--phpBB/phpbb/permissions.php6
-rw-r--r--phpBB/phpbb/profilefields/lang_helper.php61
-rw-r--r--phpBB/phpbb/profilefields/manager.php37
-rw-r--r--phpBB/phpbb/profilefields/type/type_bool.php29
-rw-r--r--phpBB/phpbb/profilefields/type/type_date.php13
-rw-r--r--phpBB/phpbb/profilefields/type/type_dropdown.php31
-rw-r--r--phpBB/phpbb/profilefields/type/type_int.php12
-rw-r--r--phpBB/phpbb/profilefields/type/type_interface.php9
-rw-r--r--phpBB/phpbb/profilefields/type/type_string_common.php13
-rw-r--r--phpBB/phpbb/search/base.php4
-rw-r--r--phpBB/phpbb/search/fulltext_mysql.php8
-rw-r--r--phpBB/phpbb/search/fulltext_native.php10
-rw-r--r--phpBB/phpbb/search/fulltext_postgres.php35
-rw-r--r--phpBB/phpbb/search/fulltext_sphinx.php6
-rw-r--r--phpBB/phpbb/template/twig/lexer.php2
-rw-r--r--phpBB/phpbb/viewonline_helper.php54
-rw-r--r--phpBB/search.php8
-rw-r--r--phpBB/styles/prosilver/style.cfg4
-rw-r--r--phpBB/styles/prosilver/template/ajax.js31
-rw-r--r--phpBB/styles/prosilver/template/forum_fn.js296
-rw-r--r--phpBB/styles/prosilver/template/index_body.html28
-rw-r--r--phpBB/styles/prosilver/template/jumpbox.html28
-rw-r--r--phpBB/styles/prosilver/template/mcp_ban.html4
-rw-r--r--phpBB/styles/prosilver/template/mcp_forum.html13
-rw-r--r--phpBB/styles/prosilver/template/memberlist_search.html18
-rw-r--r--phpBB/styles/prosilver/template/navbar_footer.html16
-rw-r--r--phpBB/styles/prosilver/template/navbar_header.html134
-rw-r--r--phpBB/styles/prosilver/template/pagination.html2
-rw-r--r--phpBB/styles/prosilver/template/ucp_avatar_options.html2
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_viewmessage.html6
-rw-r--r--phpBB/styles/prosilver/template/ucp_profile_profile_info.html2
-rw-r--r--phpBB/styles/prosilver/template/viewforum_body.html27
-rw-r--r--phpBB/styles/prosilver/template/viewtopic_body.html36
-rw-r--r--phpBB/styles/prosilver/template/viewtopic_topic_tools.html8
-rw-r--r--phpBB/styles/prosilver/theme/bidi.css53
-rw-r--r--phpBB/styles/prosilver/theme/buttons.css27
-rw-r--r--phpBB/styles/prosilver/theme/colours.css152
-rw-r--r--phpBB/styles/prosilver/theme/common.css196
-rw-r--r--phpBB/styles/prosilver/theme/content.css12
-rw-r--r--phpBB/styles/prosilver/theme/cp.css10
-rw-r--r--phpBB/styles/prosilver/theme/forms.css28
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_acp.gifbin0 -> 389 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_delete_cookies.gifbin0 -> 108 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_mcp.gifbin0 -> 342 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_profile.gifbin0 -> 538 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_team.gifbin0 -> 1009 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icons_button.pngbin5690 -> 6478 bytes
-rw-r--r--phpBB/styles/prosilver/theme/links.css47
-rw-r--r--phpBB/styles/prosilver/theme/print.css10
-rw-r--r--phpBB/styles/prosilver/theme/responsive.css41
-rw-r--r--phpBB/styles/prosilver/theme/tweaks.css10
-rw-r--r--phpBB/styles/subsilver2/style.cfg4
-rw-r--r--phpBB/styles/subsilver2/template/index_body.html4
-rw-r--r--phpBB/styles/subsilver2/template/mcp_ban.html4
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_search.html8
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_view.html2
-rw-r--r--phpBB/styles/subsilver2/template/ucp_groups_manage.html2
-rw-r--r--phpBB/styles/subsilver2/template/ucp_pm_viewmessage.html14
-rw-r--r--phpBB/styles/subsilver2/template/ucp_profile_avatar.html2
-rw-r--r--phpBB/styles/subsilver2/template/ucp_profile_profile_info.html2
-rw-r--r--phpBB/viewonline.php24
-rw-r--r--phpBB/viewtopic.php23
-rw-r--r--tests/auth/fixtures/oauth_tokens.xml6
-rw-r--r--tests/auth/phpbb_not_a_token.php23
-rw-r--r--tests/auth/provider_oauth_token_storage_test.php18
-rw-r--r--tests/avatar/manager_test.php1
-rw-r--r--tests/config_php_file_test.php30
-rw-r--r--tests/controller/helper_route_test.php1
-rw-r--r--tests/dbal/fixtures/migrator_config_text.xml7
-rw-r--r--tests/dbal/migrator_tool_config_text_test.php75
-rw-r--r--tests/dbal/order_lower_test.php2
-rw-r--r--tests/dbal/select_test.php4
-rw-r--r--tests/dbal/sql_insert_buffer_test.php8
-rw-r--r--tests/di/create_container_test.php145
-rw-r--r--tests/di/fixtures/config/services.yml14
-rw-r--r--tests/di/fixtures/ext/vendor/available/config/services.yml2
-rw-r--r--tests/di/fixtures/ext/vendor/disabled/config/services.yml2
-rw-r--r--tests/di/fixtures/ext/vendor/enabled/config/services.yml2
-rw-r--r--tests/di/fixtures/other_config/services.yml14
-rw-r--r--tests/event/php_exporter_test.php2
-rw-r--r--tests/extension/ext/barfoo/composer.json8
-rw-r--r--tests/extension/ext/vendor/moo/composer.json8
-rw-r--r--tests/extension/ext/vendor2/bar/composer.json8
-rw-r--r--tests/extension/ext/vendor2/foo/composer.json8
-rw-r--r--tests/extension/manager_test.php46
-rw-r--r--tests/extension/metadata_manager_test.php325
-rw-r--r--tests/filesystem/clean_path_test.php2
-rw-r--r--tests/fixtures/config.php3
-rw-r--r--tests/fixtures/config_other.php3
-rw-r--r--tests/functional/download_test.php6
-rw-r--r--tests/functional/feed_test.php6
-rw-r--r--tests/functional/fixtures/ext/foo/bar/composer.json8
-rw-r--r--tests/functional/jumpbox_test.php20
-rw-r--r--tests/functional/mcp_test.php22
-rw-r--r--tests/functional/visibility_softdelete_test.php40
-rw-r--r--tests/functions/build_url_test.php3
-rw-r--r--tests/functions/convert_30_dbms_to_31_test.php3
-rw-r--r--tests/functions/obtain_online_test.php8
-rw-r--r--tests/functions_content/get_username_string_test.php14
-rw-r--r--tests/log/function_view_log_test.php26
-rw-r--r--tests/mock/controller_helper.php5
-rw-r--r--tests/mock/phpbb_di_container_builder.php20
-rw-r--r--tests/notification/user_list_trim_test.php8
-rw-r--r--tests/path_helper/path_helper_test.php95
-rw-r--r--tests/profilefields/type_bool_test.php56
-rw-r--r--tests/profilefields/type_date_test.php36
-rw-r--r--tests/profilefields/type_dropdown_test.php48
-rw-r--r--tests/profilefields/type_int_test.php60
-rw-r--r--tests/profilefields/type_string_test.php54
-rw-r--r--tests/profilefields/type_url_test.php30
-rw-r--r--tests/security/redirect_test.php1
-rw-r--r--tests/template/template_events_test.php1
-rw-r--r--tests/template/template_test.php7
-rw-r--r--tests/template/template_test_case.php1
-rw-r--r--tests/template/template_test_case_with_tree.php1
-rw-r--r--tests/template/templates/if_nested_tags.html1
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php27
-rw-r--r--tests/test_framework/phpbb_session_test_case.php1
-rw-r--r--tests/test_framework/phpbb_test_case_helpers.php19
-rw-r--r--tests/viewonline/helper_test.php46
-rwxr-xr-xtravis/ext-sniff.sh27
233 files changed, 4717 insertions, 2011 deletions
diff --git a/build/build.xml b/build/build.xml
index f2668e2101..3c1a3e4db4 100644
--- a/build/build.xml
+++ b/build/build.xml
@@ -2,9 +2,9 @@
<project name="phpBB" description="The phpBB forum software" default="all" basedir="../">
<!-- a few settings for the build -->
- <property name="newversion" value="3.1.0-RC2-dev" />
- <property name="prevversion" value="3.1.0-RC1" />
- <property name="olderversions" value="3.0.12, 3.1.0-a1, 3.1.0-a2, 3.1.0-a3, 3.1.0-b1, 3.1.0-b2, 3.1.0-b3, 3.1.0-b4" />
+ <property name="newversion" value="3.1.0-RC3-dev" />
+ <property name="prevversion" value="3.1.0-RC2" />
+ <property name="olderversions" value="3.0.12, 3.1.0-a1, 3.1.0-a2, 3.1.0-a3, 3.1.0-b1, 3.1.0-b2, 3.1.0-b3, 3.1.0-b4, 3.1.0-RC1" />
<!-- no configuration should be needed beyond this point -->
<property name="oldversions" value="${olderversions}, ${prevversion}" />
@@ -102,6 +102,7 @@
--extensions=php
--standard=build/code_sniffer/ruleset-php-extensions.xml
--ignore=${project.basedir}/phpBB/ext/*/tests/*
+ --ignore=${project.basedir}/phpBB/ext/*/vendor/*
phpBB/ext"
dir="." returnProperty="retval-php-ext" passthru="true" />
<if>
diff --git a/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php b/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php
index 16e3427bd9..f81ec46579 100644
--- a/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php
+++ b/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php
@@ -153,19 +153,24 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff
$start_argument = $phpcsFile->findPrevious(array(T_OPEN_PARENTHESIS, T_COMMA), $argument);
$argument_class_name_start = $phpcsFile->findNext(array(T_NS_SEPARATOR, T_STRING), ($start_argument + 1), $argument);
- $argument_class_name_end = $phpcsFile->findNext($find, ($argument_class_name_start + 1), null, true);
- $argument_class_name = $phpcsFile->getTokensAsString($argument_class_name_start, ($argument_class_name_end - $argument_class_name_start - 1));
-
- if ($argument_class_name === $class_name_full)
+ // Skip the parameter if no type is defined.
+ if ($argument_class_name_start !== false)
{
- $error = 'Either use statement or full name must be used.';
- $phpcsFile->addError($error, $function_declaration, 'FullName');
- }
+ $argument_class_name_end = $phpcsFile->findNext($find, ($argument_class_name_start + 1), null, true);
- if ($argument_class_name === $class_name_short)
- {
- $ok = true;
+ $argument_class_name = $phpcsFile->getTokensAsString($argument_class_name_start, ($argument_class_name_end - $argument_class_name_start - 1));
+
+ if ($argument_class_name === $class_name_full)
+ {
+ $error = 'Either use statement or full name must be used.';
+ $phpcsFile->addError($error, $function_declaration, 'FullName');
+ }
+
+ if ($argument_class_name === $class_name_short)
+ {
+ $ok = true;
+ }
}
}
}
diff --git a/build/package.php b/build/package.php
index d66238e471..c0db0c4011 100755
--- a/build/package.php
+++ b/build/package.php
@@ -195,12 +195,6 @@ if (sizeof($package->old_packages))
* referenced files from the same or subsequent directories.
*/
$copy_relative_directories = array(
- 'adm/style/admin.css' => array(
- 'copied' => false,
- 'copy' => array(
- 'adm/images/*' => 'adm/images',
- ),
- ),
'config/' => array(
'copied' => false,
'copy' => array(
@@ -269,6 +263,42 @@ if (sizeof($package->old_packages))
}
}
+ /**
+ * We need to always copy the template and asset files that we need in
+ * the update, to ensure that the page is displayed correctly.
+ */
+ $copy_update_files = array(
+ 'adm/images/*' => 'adm/images',
+ 'adm/style/admin.css' => 'adm/style',
+ 'adm/style/admin.js' => 'adm/style',
+ 'adm/style/ajax.js' => 'adm/style',
+ 'adm/style/install_*' => 'adm/style',
+ 'assets/javascript/*' => 'assets/javascript',
+ );
+
+ foreach ($copy_update_files as $source_files => $destination_dir)
+ {
+ // Create directories along the way?
+ $directories = explode('/', $destination_dir);
+
+ chdir($dest_filename_dir . '/install/update/new');
+ foreach ($directories as $dir)
+ {
+ $dir = trim($dir);
+ if ($dir)
+ {
+ if (!file_exists('./' . $dir))
+ {
+ $package->run_command('mkdir ' . $dir);
+ }
+ chdir('./' . $dir);
+ }
+ }
+ $source_dir_files = $package->locations['old_versions'] . $package->get('simple_name') . '/' . $source_files;
+ $destination_dir = $dest_filename_dir . '/install/update/new/' . $destination_dir;
+ $package->run_command('cp ' . $source_dir_files . ' ' . $destination_dir);
+ }
+
// Build index.php file for holding the file structure
$index_contents = '<?php
diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html
index f8ea284acb..af79791ff8 100644
--- a/phpBB/adm/style/acp_forums.html
+++ b/phpBB/adm/style/acp_forums.html
@@ -284,12 +284,12 @@
<label><input type="radio" class="radio" name="enable_shadow_prune" value="0"<!-- IF not S_PRUNE_SHADOW_ENABLE --> id="enable_shadow_prune" checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<dl>
- <dt><label for="prune_shadow_freq">{L_AUTO_PRUNE_FREQ}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_FREQ_EXPLAIN}</span></dt>
- <dd><input type="number" id="prune_shadow_freq" name="prune_shadow_freq" value="{PRUNE_FREQ}" maxlength="4" size="4" min="0" max="9999" /> {L_DAYS}</dd>
+ <dt><label for="prune_shadow_freq">{L_AUTO_PRUNE_SHADOW_FREQ}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_SHADOW_FREQ_EXPLAIN}</span></dt>
+ <dd><input type="number" id="prune_shadow_freq" name="prune_shadow_freq" value="{PRUNE_SHADOW_FREQ}" maxlength="4" size="4" min="0" max="9999" /> {L_DAYS}</dd>
</dl>
<dl>
- <dt><label for="prune_shadow_days">{L_AUTO_PRUNE_DAYS}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_DAYS_EXPLAIN}</span></dt>
- <dd><input type="number" id="prune_shadow_days" name="prune_shadow_days" value="{PRUNE_DAYS}" maxlength="4" size="4" min="0" max="9999" /> {L_DAYS}</dd>
+ <dt><label for="prune_shadow_days">{L_AUTO_PRUNE_SHADOW_DAYS}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_SHADOW_DAYS_EXPLAIN}</span></dt>
+ <dd><input type="number" id="prune_shadow_days" name="prune_shadow_days" value="{PRUNE_SHADOW_DAYS}" maxlength="4" size="4" min="0" max="9999" /> {L_DAYS}</dd>
</dl>
</fieldset>
</div>
diff --git a/phpBB/adm/style/acp_groups.html b/phpBB/adm/style/acp_groups.html
index f9846ea7cd..6049673e0a 100644
--- a/phpBB/adm/style/acp_groups.html
+++ b/phpBB/adm/style/acp_groups.html
@@ -117,7 +117,7 @@
<dl>
<dt><label>{L_AVATAR_TYPE}{L_COLON}</label></dt>
<dd><select name="avatar_driver" id="avatar_driver" data-togglable-settings="true">
- <option value="">{L_NO_AVATAR_CATEGORY}</option>
+ <option value="">{L_NO_AVATAR}</option>
<!-- BEGIN avatar_drivers -->
<option value="{avatar_drivers.DRIVER}"<!-- IF avatar_drivers.SELECTED --> selected="selected"<!-- ENDIF --> data-toggle-setting="#avatar_option_{avatar_drivers.DRIVER}">{avatar_drivers.L_TITLE}</option>
<!-- END avatar_drivers -->
diff --git a/phpBB/adm/style/acp_users_avatar.html b/phpBB/adm/style/acp_users_avatar.html
index 0d06d088e8..8ad4ad710b 100644
--- a/phpBB/adm/style/acp_users_avatar.html
+++ b/phpBB/adm/style/acp_users_avatar.html
@@ -14,7 +14,7 @@
<dl>
<dt><label>{L_AVATAR_TYPE}</label></dt>
<dd><select name="avatar_driver" id="avatar_driver" data-togglable-settings="true">
- <option value="">{L_NO_AVATAR_CATEGORY}</option>
+ <option value="">{L_NO_AVATAR}</option>
<!-- BEGIN avatar_drivers -->
<option value="{avatar_drivers.DRIVER}"<!-- IF avatar_drivers.SELECTED --> selected="selected"<!-- ENDIF --> data-toggle-setting="#avatar_option_{avatar_drivers.DRIVER}">{avatar_drivers.L_TITLE}</option>
<!-- END avatar_drivers -->
diff --git a/phpBB/adm/style/auth_provider_ldap.html b/phpBB/adm/style/auth_provider_ldap.html
index 9e0567dfed..97684db396 100644
--- a/phpBB/adm/style/auth_provider_ldap.html
+++ b/phpBB/adm/style/auth_provider_ldap.html
@@ -22,7 +22,7 @@
</dl>
<dl>
<dt><label for="ldap_email">{L_LDAP_EMAIL}{L_COLON}</label><br /><span>{L_LDAP_EMAIL_EXPLAIN}</span></dt>
- <dd><input type="email" id="ldap_email" size="40" name="config[ldap_email]" value="{AUTH_LDAP_EMAIL}" /></dd>
+ <dd><input type="text" id="ldap_email" size="40" name="config[ldap_email]" value="{AUTH_LDAP_EMAIL}" /></dd>
</dl>
<dl>
<dt><label for="ldap_user">{L_LDAP_USER}{L_COLON}</label><br /><span>{L_LDAP_USER_EXPLAIN}</span></dt>
diff --git a/phpBB/adm/style/install_update.html b/phpBB/adm/style/install_update.html
index f0df138641..898233f72d 100644
--- a/phpBB/adm/style/install_update.html
+++ b/phpBB/adm/style/install_update.html
@@ -184,72 +184,105 @@
<form id="install_update" method="post" action="{U_UPDATE_ACTION}">
- <!-- IF .up_to_date -->
- <h2>{L_FILES_UP_TO_DATE}</h2>
- <p>{L_FILES_UP_TO_DATE_EXPLAIN}</p>
-
- <fieldset>
- <legend><img src="{T_IMAGE_PATH}file_up_to_date.gif" alt="{L_STATUS_UP_TO_DATE}" /></legend>
- <!-- BEGIN up_to_date -->
+ <!-- IF .deleted -->
+ <h2>{L_FILES_DELETED}</h2>
+ <div style="float: {S_CONTENT_FLOW_END};">&raquo; <a href="#" onclick="phpbb.toggleDisplay('deleted', 0); return false;">{L_TOGGLE_DISPLAY}</a></div>
+ <p>{L_FILES_DELETED_EXPLAIN}</p>
+
+ <fieldset id="deleted">
+ <legend><img src="{T_IMAGE_PATH}icon_delete.gif" alt="{L_STATUS_DELETED}" /></legend>
+ <!-- BEGIN deleted -->
<dl>
- <dd class="full" style="text-align: {S_CONTENT_FLOW_BEGIN};"><strong>{up_to_date.FILENAME}</strong></dd>
+ <dt style="width: 60%;"><strong><!-- IF deleted.DIR_PART -->{deleted.DIR_PART}<br /><!-- ENDIF -->{deleted.FILE_PART}</strong></dt>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}: 60%;">
+ <!-- IF not deleted.S_BINARY -->[<a href="{deleted.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{deleted.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
+ </dd>
</dl>
- <!-- END up_to_date -->
+ <!-- END deleted -->
</fieldset>
<!-- ENDIF -->
- <!-- IF .new -->
- <h2>{L_FILES_NEW}</h2>
- <p>{L_FILES_NEW_EXPLAIN}</p>
+ <!-- IF .conflict -->
+ <h2>{L_FILES_CONFLICT}</h2>
+ <div style="float: {S_CONTENT_FLOW_END};">&raquo; <a href="#" onclick="phpbb.toggleDisplay('conflict', 0); return false;">{L_TOGGLE_DISPLAY}</a></div>
+ <p>{L_FILES_CONFLICT_EXPLAIN}</p>
- <fieldset>
- <legend><img src="{T_IMAGE_PATH}file_new.gif" alt="{L_STATUS_NEW}" /></legend>
- <!-- BEGIN new -->
+ <!-- BEGIN conflict -->
+ <fieldset id="conflict">
+ <legend><img src="{T_IMAGE_PATH}file_conflict.gif" alt="{L_STATUS_CONFLICT}" /></legend>
<dl>
- <dt style="width: 60%;"><strong><!-- IF new.DIR_PART -->{new.DIR_PART}<br /><!-- ENDIF -->{new.FILE_PART}</strong>
- <!-- IF new.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{new.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
- </dt>
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">
- <!-- IF not new.S_BINARY -->[<a href="{new.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{new.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
- </dd>
- <!-- IF new.S_CUSTOM -->
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{new.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
- <!-- ENDIF -->
+ <dt style="width: 60%;"><strong><!-- IF conflict.DIR_PART -->{conflict.DIR_PART}<br /><!-- ENDIF -->{conflict.FILE_PART}</strong>
+ <!-- IF conflict.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{conflict.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
+ <!-- IF conflict.NUM_CONFLICTS --><br /><span>{L_NUM_CONFLICTS}{L_COLON} {conflict.NUM_CONFLICTS}</span><!-- ENDIF -->
+ </dt>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">
+ <!-- IF not conflict.S_BINARY -->[<a href="{conflict.U_SHOW_DIFF}">{L_DOWNLOAD_CONFLICTS}</a>]<br />{L_DOWNLOAD_CONFLICTS_EXPLAIN}
+ <!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
+ </dd>
+ <!-- IF conflict.S_CUSTOM -->
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{conflict.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
+ <!-- ENDIF -->
</dl>
- <!-- END new -->
+ <!-- IF conflict.S_BINARY -->
+ <dl>
+ <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="1" checked="checked" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">&nbsp;</dd>
+ </dl>
+ <!-- ELSE -->
+ <dl>
+ <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="3" checked="checked" /> {L_MERGE_NEW_FILE_OPTION}</label></dt>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">[<a href="{conflict.U_VIEW_NEW_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_MODIFIED}</a>]</dd>
+ </dl>
+ <dl>
+ <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="4" /> {L_MERGE_MOD_FILE_OPTION}</label></dt>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">[<a href="{conflict.U_VIEW_MOD_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_MODIFIED}</a>]</dd>
+ </dl>
+ <dl>
+ <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="1" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">[<a href="{conflict.U_VIEW_NO_MERGE_NEW}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd>
+ </dl>
+ <dl>
+ <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="2" /> {L_MERGE_NO_MERGE_MOD_OPTION}</label></dt>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">[<a href="{conflict.U_VIEW_NO_MERGE_MOD}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd>
+ </dl>
+ <!-- ENDIF -->
</fieldset>
+ <!-- END conflict -->
<!-- ENDIF -->
- <!-- IF .not_modified -->
- <h2>{L_FILES_NOT_MODIFIED}</h2>
- <div style="float: {S_CONTENT_FLOW_END};">&raquo; <a href="#" onclick="phpbb.toggleDisplay('not_modified', 0); return false;">{L_TOGGLE_DISPLAY}</a></div>
- <p>{L_FILES_NOT_MODIFIED_EXPLAIN}</p>
+ <!-- IF .new_conflict -->
+ <h2>{L_FILES_NEW_CONFLICT}</h2>
+ <div style="float: {S_CONTENT_FLOW_END};">&raquo; <a href="#" onclick="phpbb.toggleDisplay('new_conflict', 0); return false;">{L_TOGGLE_DISPLAY}</a></div>
+ <p>{L_FILES_NEW_CONFLICT_EXPLAIN}</p>
- <fieldset id="not_modified" style="display: none;">
- <legend><img src="{T_IMAGE_PATH}file_not_modified.gif" alt="{L_STATUS_NOT_MODIFIED}" /></legend>
- <!-- BEGIN not_modified -->
+ <fieldset id="new_conflict">
+ <legend><img src="{T_IMAGE_PATH}file_new_conflict.gif" alt="{L_STATUS_NEW_CONFLICT}" /></legend>
+ <!-- BEGIN new_conflict -->
<dl>
- <dt style="width: 60%;"><strong><!-- IF not_modified.DIR_PART -->{not_modified.DIR_PART}<br /><!-- ENDIF -->{not_modified.FILE_PART}</strong>
- <!-- IF not_modified.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{not_modified.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
- </dt>
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><!-- IF not not_modified.S_BINARY -->[<a href="{not_modified.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{not_modified.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --></dd>
- <!-- IF not_modified.S_CUSTOM -->
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{not_modified.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
- <!-- ENDIF -->
+ <dt style="width: 60%;"><strong><!-- IF new_conflict.DIR_PART -->{new_conflict.DIR_PART}<br /><!-- ENDIF -->{new_conflict.FILE_PART}</strong>
+ <!-- IF new_conflict.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{new_conflict.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
+ </dt>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">
+ <!-- IF not new_conflict.S_BINARY -->[<a href="{new_conflict.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{new_conflict.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
+ </dd>
+ <!-- IF new_conflict.S_CUSTOM -->
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{new_conflict.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
+ <!-- ENDIF -->
</dl>
- <!-- END not_modified -->
+ <!-- END new_conflict -->
</fieldset>
<!-- ENDIF -->
<!-- IF .modified -->
<h2>{L_FILES_MODIFIED}</h2>
+ <div style="float: {S_CONTENT_FLOW_END};">&raquo; <a href="#" onclick="phpbb.toggleDisplay('modified', 0); return false;">{L_TOGGLE_DISPLAY}</a></div>
<p>{L_FILES_MODIFIED_EXPLAIN}</p>
<!-- BEGIN modified -->
- <fieldset>
+ <fieldset id="modified">
<legend><img src="{T_IMAGE_PATH}file_modified.gif" alt="{L_STATUS_MODIFIED}" /></legend>
<dl>
<dt style="width: 60%;"><strong><!-- IF modified.DIR_PART -->{modified.DIR_PART}<br /><!-- ENDIF -->{modified.FILE_PART}</strong>
@@ -277,74 +310,65 @@
<!-- ENDIF -->
- <!-- IF .new_conflict -->
- <h2>{L_FILES_NEW_CONFLICT}</h2>
- <p>{L_FILES_NEW_CONFLICT_EXPLAIN}</p>
+ <!-- IF .new -->
+ <h2>{L_FILES_NEW}</h2>
+ <div style="float: {S_CONTENT_FLOW_END};">&raquo; <a href="#" onclick="phpbb.toggleDisplay('new_files', 0); return false;">{L_TOGGLE_DISPLAY}</a></div>
+ <p>{L_FILES_NEW_EXPLAIN}</p>
- <fieldset>
- <legend><img src="{T_IMAGE_PATH}file_new_conflict.gif" alt="{L_STATUS_NEW_CONFLICT}" /></legend>
- <!-- BEGIN new_conflict -->
+ <fieldset id="new_files" style="display: none;">
+ <legend><img src="{T_IMAGE_PATH}file_new.gif" alt="{L_STATUS_NEW}" /></legend>
+ <!-- BEGIN new -->
<dl>
- <dt style="width: 60%;"><strong><!-- IF new_conflict.DIR_PART -->{new_conflict.DIR_PART}<br /><!-- ENDIF -->{new_conflict.FILE_PART}</strong>
- <!-- IF new_conflict.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{new_conflict.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
+ <dt style="width: 60%;"><strong><!-- IF new.DIR_PART -->{new.DIR_PART}<br /><!-- ENDIF -->{new.FILE_PART}</strong>
+ <!-- IF new.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{new.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
</dt>
<dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">
- <!-- IF not new_conflict.S_BINARY -->[<a href="{new_conflict.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{new_conflict.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
+ <!-- IF not new.S_BINARY -->[<a href="{new.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{new.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
</dd>
- <!-- IF new_conflict.S_CUSTOM -->
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{new_conflict.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
+ <!-- IF new.S_CUSTOM -->
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{new.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
<!-- ENDIF -->
</dl>
- <!-- END new_conflict -->
+ <!-- END new -->
</fieldset>
<!-- ENDIF -->
- <!-- IF .conflict -->
- <h2>{L_FILES_CONFLICT}</h2>
- <p>{L_FILES_CONFLICT_EXPLAIN}</p>
+ <!-- IF .not_modified -->
+ <h2>{L_FILES_NOT_MODIFIED}</h2>
+ <div style="float: {S_CONTENT_FLOW_END};">&raquo; <a href="#" onclick="phpbb.toggleDisplay('not_modified', 0); return false;">{L_TOGGLE_DISPLAY}</a></div>
+ <p>{L_FILES_NOT_MODIFIED_EXPLAIN}</p>
- <!-- BEGIN conflict -->
- <fieldset>
- <legend><img src="{T_IMAGE_PATH}file_conflict.gif" alt="{L_STATUS_CONFLICT}" /></legend>
+ <fieldset id="not_modified" style="display: none;">
+ <legend><img src="{T_IMAGE_PATH}file_not_modified.gif" alt="{L_STATUS_NOT_MODIFIED}" /></legend>
+ <!-- BEGIN not_modified -->
<dl>
- <dt style="width: 60%;"><strong><!-- IF conflict.DIR_PART -->{conflict.DIR_PART}<br /><!-- ENDIF -->{conflict.FILE_PART}</strong>
- <!-- IF conflict.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{conflict.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
- <!-- IF conflict.NUM_CONFLICTS --><br /><span>{L_NUM_CONFLICTS}{L_COLON} {conflict.NUM_CONFLICTS}</span><!-- ENDIF -->
+ <dt style="width: 60%;"><strong><!-- IF not_modified.DIR_PART -->{not_modified.DIR_PART}<br /><!-- ENDIF -->{not_modified.FILE_PART}</strong>
+ <!-- IF not_modified.S_CUSTOM --><br /><span><em>{L_FILE_USED}{L_COLON} </em>{not_modified.CUSTOM_ORIGINAL}</span><!-- ENDIF -->
</dt>
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">
- <!-- IF not conflict.S_BINARY -->[<a href="{conflict.U_SHOW_DIFF}">{L_DOWNLOAD_CONFLICTS}</a>]<br />{L_DOWNLOAD_CONFLICTS_EXPLAIN}
- <!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF -->
- </dd>
- <!-- IF conflict.S_CUSTOM -->
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{conflict.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><!-- IF not not_modified.S_BINARY -->[<a href="{not_modified.U_SHOW_DIFF}" onclick="diff_popup(this.href); return false;">{not_modified.L_SHOW_DIFF}</a>]<!-- ELSE -->{L_BINARY_FILE}<!-- ENDIF --></dd>
+ <!-- IF not_modified.S_CUSTOM -->
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;"><label><input type="checkbox" name="no_update[]" value="{not_modified.FILENAME}" class="radio" /> {L_DO_NOT_UPDATE}</label></dd>
<!-- ENDIF -->
</dl>
- <!-- IF conflict.S_BINARY -->
- <dl>
- <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="1" checked="checked" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt>
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">&nbsp;</dd>
- </dl>
- <!-- ELSE -->
- <dl>
- <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="3" checked="checked" /> {L_MERGE_NEW_FILE_OPTION}</label></dt>
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">[<a href="{conflict.U_VIEW_NEW_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_MODIFIED}</a>]</dd>
- </dl>
- <dl>
- <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="4" /> {L_MERGE_MOD_FILE_OPTION}</label></dt>
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">[<a href="{conflict.U_VIEW_MOD_FILE}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_MODIFIED}</a>]</dd>
- </dl>
- <dl>
- <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="1" /> {L_MERGE_NO_MERGE_NEW_OPTION}</label></dt>
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">[<a href="{conflict.U_VIEW_NO_MERGE_NEW}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd>
- </dl>
- <dl>
- <dt style="width: 60%"><label><input type="radio" class="radio" name="conflict[{conflict.FILENAME}]" value="2" /> {L_MERGE_NO_MERGE_MOD_OPTION}</label></dt>
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 60%;">[<a href="{conflict.U_VIEW_NO_MERGE_MOD}" onclick="diff_popup(this.href); return false;">{L_SHOW_DIFF_FINAL}</a>]</dd>
- </dl>
- <!-- ENDIF -->
+ <!-- END not_modified -->
+ </fieldset>
+
+ <!-- ENDIF -->
+
+ <!-- IF .up_to_date -->
+ <h2>{L_FILES_UP_TO_DATE}</h2>
+ <div style="float: {S_CONTENT_FLOW_END};">&raquo; <a href="#" onclick="phpbb.toggleDisplay('up_to_date', 0); return false;">{L_TOGGLE_DISPLAY}</a></div>
+ <p>{L_FILES_UP_TO_DATE_EXPLAIN}</p>
+
+ <fieldset id="up_to_date" style="display: none;">
+ <legend><img src="{T_IMAGE_PATH}file_up_to_date.gif" alt="{L_STATUS_UP_TO_DATE}" /></legend>
+ <!-- BEGIN up_to_date -->
+ <dl>
+ <dd class="full" style="text-align: {S_CONTENT_FLOW_BEGIN};"><strong>{up_to_date.FILENAME}</strong></dd>
+ </dl>
+ <!-- END up_to_date -->
</fieldset>
- <!-- END conflict -->
<!-- ENDIF -->
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index 785aa141f0..b905c4c82d 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -272,7 +272,7 @@ phpbb.ajaxify = function(options) {
* Handler for AJAX errors
*/
function errorHandler(jqXHR, textStatus, errorThrown) {
- if (console && console.log) {
+ if (typeof console !== 'undefined' && console.log) {
console.log('AJAX error. status: ' + textStatus + ', message: ' + errorThrown);
}
phpbb.clearLoadingTimeout();
@@ -1296,11 +1296,29 @@ phpbb.toggleDropdown = function() {
else if ((offset + width + 2) > windowWidth) {
$this.css('margin-left', (windowWidth - offset - width - 2) + 'px');
}
+
+ // Check whether the vertical scrollbar is present.
+ $this.toggleClass('dropdown-nonscroll', this.scrollHeight === $this.innerHeight());
+
});
var freeSpace = parent.offset().left - 4;
if (direction == 'left') {
options.dropdown.css('margin-left', '-' + freeSpace + 'px');
+
+ // Try to position the notification dropdown correctly in RTL-responsive mode
+ if (options.dropdown.hasClass('dropdown-extended')) {
+ var contentWidth,
+ fullFreeSpace = freeSpace + parent.outerWidth();
+
+ options.dropdown.find('.dropdown-contents').each(function() {
+ contentWidth = parseInt($(this).outerWidth());
+ $(this).css({marginLeft: 0, left: 0});
+ });
+
+ var maxOffset = Math.min(contentWidth, fullFreeSpace) + 'px';
+ options.dropdown.css({'width': maxOffset, 'margin-left': '-' + maxOffset});
+ }
} else {
options.dropdown.css('margin-right', '-' + (windowWidth + freeSpace) + 'px');
}
diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php
index 8b8d8e43fd..ca425ad0c4 100755
--- a/phpBB/bin/phpbbcli.php
+++ b/phpBB/bin/phpbbcli.php
@@ -12,6 +12,8 @@
*
*/
+use Symfony\Component\Console\Input\ArgvInput;
+
if (php_sapi_name() != 'cli')
{
echo 'This program must be run from the command line.' . PHP_EOL;
@@ -22,26 +24,44 @@ define('IN_PHPBB', true);
$phpbb_root_path = __DIR__ . '/../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
require($phpbb_root_path . 'includes/startup.' . $phpEx);
-require($phpbb_root_path . 'config.' . $phpEx);
+require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
+
+$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
+$phpbb_class_loader->register();
+
+$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);
+extract($phpbb_config_php_file->get_all());
+
require($phpbb_root_path . 'includes/constants.' . $phpEx);
require($phpbb_root_path . 'includes/functions.' . $phpEx);
require($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
-require($phpbb_root_path . 'includes/functions_container.' . $phpEx);
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
-require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
-$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
-$phpbb_class_loader->register();
-$phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx);
-$phpbb_class_loader_ext->register();
+$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
+$phpbb_container_builder->set_dump_container(false);
+
+$input = new ArgvInput();
+
+if ($input->hasParameterOption(array('--safe-mode')))
+{
+ $phpbb_container_builder->set_use_extensions(false);
+ $phpbb_container_builder->set_dump_container(false);
+}
+else
+{
+ $phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx);
+ $phpbb_class_loader_ext->register();
+ phpbb_load_extensions_autoloaders($phpbb_root_path);
+}
-$phpbb_container = phpbb_create_update_container($phpbb_root_path, $phpEx, "$phpbb_root_path/config");
+$phpbb_container = $phpbb_container_builder->get_container();
$phpbb_container->get('request')->enable_super_globals();
require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx);
$user = $phpbb_container->get('user');
$user->add_lang('acp/common');
+$user->add_lang('cli');
$application = new \phpbb\console\application('phpBB Console', PHPBB_VERSION, $user);
-$application->register_container_commands($phpbb_container);
-$application->run();
+$application->register_container_commands($phpbb_container->get('console.command_collection'));
+$application->run($input);
diff --git a/phpBB/common.php b/phpBB/common.php
index 4b06cd1eda..f6586c40fe 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -21,11 +21,13 @@ if (!defined('IN_PHPBB'))
}
require($phpbb_root_path . 'includes/startup.' . $phpEx);
+require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
-if (file_exists($phpbb_root_path . 'config.' . $phpEx))
-{
- require($phpbb_root_path . 'config.' . $phpEx);
-}
+$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
+$phpbb_class_loader->register();
+
+$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);
+extract($phpbb_config_php_file->get_all());
if (!defined('PHPBB_INSTALLED'))
{
@@ -76,11 +78,8 @@ $phpbb_adm_relative_path = (isset($phpbb_adm_relative_path)) ? $phpbb_adm_relati
$phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : $phpbb_root_path . $phpbb_adm_relative_path;
// Include files
-require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
-
require($phpbb_root_path . 'includes/functions.' . $phpEx);
require($phpbb_root_path . 'includes/functions_content.' . $phpEx);
-require($phpbb_root_path . 'includes/functions_container.' . $phpEx);
include($phpbb_root_path . 'includes/functions_compatibility.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
@@ -89,14 +88,14 @@ require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
// Set PHP error handler to ours
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
-// Setup class loader first
-$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
-$phpbb_class_loader->register();
$phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx);
$phpbb_class_loader_ext->register();
+phpbb_load_extensions_autoloaders($phpbb_root_path);
+
// Set up container
-$phpbb_container = phpbb_create_default_container($phpbb_root_path, $phpEx);
+$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
+$phpbb_container = $phpbb_container_builder->get_container();
$phpbb_class_loader->set_cache($phpbb_container->get('cache.driver'));
$phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver'));
diff --git a/phpBB/composer.json b/phpBB/composer.json
index 53d2f873f1..9b473a3bb7 100644
--- a/phpBB/composer.json
+++ b/phpBB/composer.json
@@ -22,6 +22,13 @@
"phpunit/phpunit": "4.1.*",
"phing/phing": "2.4.*",
"sami/sami": "1.*",
- "squizlabs/php_codesniffer": "1.*"
+ "squizlabs/php_codesniffer": "1.*",
+ "symfony/browser-kit": "2.3.*",
+ "symfony/debug": "2.3.*",
+ "symfony/dom-crawler": "2.3.*",
+ "symfony/filesystem": "2.3.*",
+ "symfony/finder": "2.3.*",
+ "symfony/http-foundation": "2.3.*",
+ "symfony/process": "2.3.*"
}
}
diff --git a/phpBB/composer.lock b/phpBB/composer.lock
index 89973b93d4..751cd0695f 100644
--- a/phpBB/composer.lock
+++ b/phpBB/composer.lock
@@ -3,7 +3,7 @@
"This file locks the dependencies of your project to a known state",
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
],
- "hash": "300d29b350ca2d75b1fa169fe46470f0",
+ "hash": "dcd46c1373cfc4dacd2e1f8a79da0b91",
"packages": [
{
"name": "lusitanian/oauth",
@@ -108,17 +108,17 @@
},
{
"name": "symfony/config",
- "version": "v2.3.12",
+ "version": "v2.3.16",
"target-dir": "Symfony/Component/Config",
"source": {
"type": "git",
"url": "https://github.com/symfony/Config.git",
- "reference": "91faa2d4944d0c8a94d5b73cb7ccfb219aee9d21"
+ "reference": "259722b5f2e87d3f487630abfd40f922cf2f6900"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Config/zipball/91faa2d4944d0c8a94d5b73cb7ccfb219aee9d21",
- "reference": "91faa2d4944d0c8a94d5b73cb7ccfb219aee9d21",
+ "url": "https://api.github.com/repos/symfony/Config/zipball/259722b5f2e87d3f487630abfd40f922cf2f6900",
+ "reference": "259722b5f2e87d3f487630abfd40f922cf2f6900",
"shasum": ""
},
"require": {
@@ -154,21 +154,21 @@
],
"description": "Symfony Config Component",
"homepage": "http://symfony.com",
- "time": "2014-03-31 10:15:50"
+ "time": "2014-04-22 08:09:28"
},
{
"name": "symfony/console",
- "version": "v2.3.12",
+ "version": "v2.3.16",
"target-dir": "Symfony/Component/Console",
"source": {
"type": "git",
"url": "https://github.com/symfony/Console.git",
- "reference": "df17996d37eb113a5675ca4cc2ac45f4fc057cb7"
+ "reference": "c6c5a354a9945a5e9a9a6a495ca19558eb8639e9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Console/zipball/df17996d37eb113a5675ca4cc2ac45f4fc057cb7",
- "reference": "df17996d37eb113a5675ca4cc2ac45f4fc057cb7",
+ "url": "https://api.github.com/repos/symfony/Console/zipball/c6c5a354a9945a5e9a9a6a495ca19558eb8639e9",
+ "reference": "c6c5a354a9945a5e9a9a6a495ca19558eb8639e9",
"shasum": ""
},
"require": {
@@ -209,21 +209,21 @@
],
"description": "Symfony Console Component",
"homepage": "http://symfony.com",
- "time": "2014-03-01 17:25:29"
+ "time": "2014-05-14 13:35:53"
},
{
"name": "symfony/debug",
- "version": "v2.4.4",
+ "version": "v2.3.16",
"target-dir": "Symfony/Component/Debug",
"source": {
"type": "git",
"url": "https://github.com/symfony/Debug.git",
- "reference": "6a8eb9aba50595014fef52d6b4d99b31dfaa6f02"
+ "reference": "ca764f8af9cc4ba5d81b598c1b18b30db5508e18"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Debug/zipball/6a8eb9aba50595014fef52d6b4d99b31dfaa6f02",
- "reference": "6a8eb9aba50595014fef52d6b4d99b31dfaa6f02",
+ "url": "https://api.github.com/repos/symfony/Debug/zipball/ca764f8af9cc4ba5d81b598c1b18b30db5508e18",
+ "reference": "ca764f8af9cc4ba5d81b598c1b18b30db5508e18",
"shasum": ""
},
"require": {
@@ -234,13 +234,14 @@
"symfony/http-kernel": "~2.1"
},
"suggest": {
+ "symfony/class-loader": "",
"symfony/http-foundation": "",
"symfony/http-kernel": ""
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.4-dev"
+ "dev-master": "2.3-dev"
}
},
"autoload": {
@@ -266,21 +267,21 @@
],
"description": "Symfony Debug Component",
"homepage": "http://symfony.com",
- "time": "2014-04-16 10:34:42"
+ "time": "2014-04-29 19:42:43"
},
{
"name": "symfony/dependency-injection",
- "version": "v2.3.12",
+ "version": "v2.3.16",
"target-dir": "Symfony/Component/DependencyInjection",
"source": {
"type": "git",
"url": "https://github.com/symfony/DependencyInjection.git",
- "reference": "41e9e2078e8edf261c11be478300c8fcddb64e30"
+ "reference": "5ebd813eac59b4051705a2e29e32f211a966b6ca"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/41e9e2078e8edf261c11be478300c8fcddb64e30",
- "reference": "41e9e2078e8edf261c11be478300c8fcddb64e30",
+ "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/5ebd813eac59b4051705a2e29e32f211a966b6ca",
+ "reference": "5ebd813eac59b4051705a2e29e32f211a966b6ca",
"shasum": ""
},
"require": {
@@ -324,21 +325,21 @@
],
"description": "Symfony DependencyInjection Component",
"homepage": "http://symfony.com",
- "time": "2014-03-27 18:14:33"
+ "time": "2014-05-02 22:42:57"
},
{
"name": "symfony/event-dispatcher",
- "version": "v2.3.12",
+ "version": "v2.3.16",
"target-dir": "Symfony/Component/EventDispatcher",
"source": {
"type": "git",
"url": "https://github.com/symfony/EventDispatcher.git",
- "reference": "15645237c6ff70e74a28e8836362d82492765055"
+ "reference": "cb7cd38c081507d10997553c4c522956a4d2afab"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/15645237c6ff70e74a28e8836362d82492765055",
- "reference": "15645237c6ff70e74a28e8836362d82492765055",
+ "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/cb7cd38c081507d10997553c4c522956a4d2afab",
+ "reference": "cb7cd38c081507d10997553c4c522956a4d2afab",
"shasum": ""
},
"require": {
@@ -380,21 +381,21 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "http://symfony.com",
- "time": "2014-02-11 10:29:24"
+ "time": "2014-04-16 10:30:19"
},
{
"name": "symfony/filesystem",
- "version": "v2.4.4",
+ "version": "v2.3.16",
"target-dir": "Symfony/Component/Filesystem",
"source": {
"type": "git",
"url": "https://github.com/symfony/Filesystem.git",
- "reference": "a3af8294bcce4a7c1b2892363b0c9d8109affad4"
+ "reference": "69e476c4db31c43ab7ab797adc5fc73d20aa5571"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Filesystem/zipball/a3af8294bcce4a7c1b2892363b0c9d8109affad4",
- "reference": "a3af8294bcce4a7c1b2892363b0c9d8109affad4",
+ "url": "https://api.github.com/repos/symfony/Filesystem/zipball/69e476c4db31c43ab7ab797adc5fc73d20aa5571",
+ "reference": "69e476c4db31c43ab7ab797adc5fc73d20aa5571",
"shasum": ""
},
"require": {
@@ -403,7 +404,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.4-dev"
+ "dev-master": "2.3-dev"
}
},
"autoload": {
@@ -429,33 +430,30 @@
],
"description": "Symfony Filesystem Component",
"homepage": "http://symfony.com",
- "time": "2014-04-16 10:34:31"
+ "time": "2014-04-16 10:30:19"
},
{
"name": "symfony/http-foundation",
- "version": "v2.4.4",
+ "version": "v2.3.16",
"target-dir": "Symfony/Component/HttpFoundation",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpFoundation.git",
- "reference": "22c4dee84271ad0cd08d19f26d89f2878e11159b"
+ "reference": "ad7891d4dfe221c5a9edca64b71bdb500f5b026a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/22c4dee84271ad0cd08d19f26d89f2878e11159b",
- "reference": "22c4dee84271ad0cd08d19f26d89f2878e11159b",
+ "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/ad7891d4dfe221c5a9edca64b71bdb500f5b026a",
+ "reference": "ad7891d4dfe221c5a9edca64b71bdb500f5b026a",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
- "require-dev": {
- "symfony/expression-language": "~2.4"
- },
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.4-dev"
+ "dev-master": "2.3-dev"
}
},
"autoload": {
@@ -484,21 +482,21 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "http://symfony.com",
- "time": "2014-04-18 21:02:05"
+ "time": "2014-05-22 16:20:26"
},
{
"name": "symfony/http-kernel",
- "version": "v2.3.12",
+ "version": "v2.3.16",
"target-dir": "Symfony/Component/HttpKernel",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpKernel.git",
- "reference": "48d61b3622ca35dd924b167441a9810ad55906ce"
+ "reference": "d8c00747f592183692afaacf622c444c36092613"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/48d61b3622ca35dd924b167441a9810ad55906ce",
- "reference": "48d61b3622ca35dd924b167441a9810ad55906ce",
+ "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/d8c00747f592183692afaacf622c444c36092613",
+ "reference": "d8c00747f592183692afaacf622c444c36092613",
"shasum": ""
},
"require": {
@@ -557,21 +555,21 @@
],
"description": "Symfony HttpKernel Component",
"homepage": "http://symfony.com",
- "time": "2014-04-03 05:42:39"
+ "time": "2014-05-31 02:04:21"
},
{
"name": "symfony/routing",
- "version": "v2.3.12",
+ "version": "v2.3.16",
"target-dir": "Symfony/Component/Routing",
"source": {
"type": "git",
"url": "https://github.com/symfony/Routing.git",
- "reference": "08afcafd9af22a24a8055669f85d63b863c4711b"
+ "reference": "6e4c9024a04340b83e456a1a24597dba066dcdc9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Routing/zipball/08afcafd9af22a24a8055669f85d63b863c4711b",
- "reference": "08afcafd9af22a24a8055669f85d63b863c4711b",
+ "url": "https://api.github.com/repos/symfony/Routing/zipball/6e4c9024a04340b83e456a1a24597dba066dcdc9",
+ "reference": "6e4c9024a04340b83e456a1a24597dba066dcdc9",
"shasum": ""
},
"require": {
@@ -617,21 +615,21 @@
],
"description": "Symfony Routing Component",
"homepage": "http://symfony.com",
- "time": "2014-03-28 10:34:27"
+ "time": "2014-04-23 13:35:47"
},
{
"name": "symfony/yaml",
- "version": "v2.3.12",
+ "version": "v2.3.16",
"target-dir": "Symfony/Component/Yaml",
"source": {
"type": "git",
"url": "https://github.com/symfony/Yaml.git",
- "reference": "3acf34f6993db3d873fa77ac2cb6e595db00b88d"
+ "reference": "2e257c292cfce88bf6c894a03d0fe8d782055aee"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Yaml/zipball/3acf34f6993db3d873fa77ac2cb6e595db00b88d",
- "reference": "3acf34f6993db3d873fa77ac2cb6e595db00b88d",
+ "url": "https://api.github.com/repos/symfony/Yaml/zipball/2e257c292cfce88bf6c894a03d0fe8d782055aee",
+ "reference": "2e257c292cfce88bf6c894a03d0fe8d782055aee",
"shasum": ""
},
"require": {
@@ -666,7 +664,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "http://symfony.com",
- "time": "2014-03-04 16:04:39"
+ "time": "2014-05-12 09:13:35"
},
{
"name": "twig/twig",
@@ -2170,17 +2168,17 @@
},
{
"name": "symfony/browser-kit",
- "version": "v2.3.4",
+ "version": "v2.3.16",
"target-dir": "Symfony/Component/BrowserKit",
"source": {
"type": "git",
"url": "https://github.com/symfony/BrowserKit.git",
- "reference": "2639dc4eec81f92760e05396a93bb78000b4f5ca"
+ "reference": "bc6cb0fe5196ecfe183483791928ed525ac41728"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/2639dc4eec81f92760e05396a93bb78000b4f5ca",
- "reference": "2639dc4eec81f92760e05396a93bb78000b4f5ca",
+ "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/bc6cb0fe5196ecfe183483791928ed525ac41728",
+ "reference": "bc6cb0fe5196ecfe183483791928ed525ac41728",
"shasum": ""
},
"require": {
@@ -2223,21 +2221,21 @@
],
"description": "Symfony BrowserKit Component",
"homepage": "http://symfony.com",
- "time": "2013-07-21 12:12:18"
+ "time": "2014-04-22 14:58:51"
},
{
"name": "symfony/css-selector",
- "version": "v2.3.4",
+ "version": "v2.3.16",
"target-dir": "Symfony/Component/CssSelector",
"source": {
"type": "git",
"url": "https://github.com/symfony/CssSelector.git",
- "reference": "885544201cb24e79754da1dbd61bd779c2e4353e"
+ "reference": "2ff53e8a7870b453836e879b083b971d455e174d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/CssSelector/zipball/885544201cb24e79754da1dbd61bd779c2e4353e",
- "reference": "885544201cb24e79754da1dbd61bd779c2e4353e",
+ "url": "https://api.github.com/repos/symfony/CssSelector/zipball/2ff53e8a7870b453836e879b083b971d455e174d",
+ "reference": "2ff53e8a7870b453836e879b083b971d455e174d",
"shasum": ""
},
"require": {
@@ -2276,21 +2274,21 @@
],
"description": "Symfony CssSelector Component",
"homepage": "http://symfony.com",
- "time": "2013-07-21 12:12:18"
+ "time": "2014-05-12 09:13:35"
},
{
"name": "symfony/dom-crawler",
- "version": "v2.3.4",
+ "version": "v2.3.16",
"target-dir": "Symfony/Component/DomCrawler",
"source": {
"type": "git",
"url": "https://github.com/symfony/DomCrawler.git",
- "reference": "e05e07fe8958a304b5e135f8e65d4ae6148cf59b"
+ "reference": "5dd259d7842480fa7c5d4a45c4f911bd6fb60bc8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/e05e07fe8958a304b5e135f8e65d4ae6148cf59b",
- "reference": "e05e07fe8958a304b5e135f8e65d4ae6148cf59b",
+ "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/5dd259d7842480fa7c5d4a45c4f911bd6fb60bc8",
+ "reference": "5dd259d7842480fa7c5d4a45c4f911bd6fb60bc8",
"shasum": ""
},
"require": {
@@ -2331,21 +2329,21 @@
],
"description": "Symfony DomCrawler Component",
"homepage": "http://symfony.com",
- "time": "2013-07-21 12:12:18"
+ "time": "2014-05-26 22:15:18"
},
{
"name": "symfony/finder",
- "version": "v2.3.4",
+ "version": "v2.3.16",
"target-dir": "Symfony/Component/Finder",
"source": {
"type": "git",
"url": "https://github.com/symfony/Finder.git",
- "reference": "4a0fee5b86f5bbd9dfdc11ec124eba2915737ce1"
+ "reference": "32949721cc76afd75e4ac60d14ac3cf55b10a768"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Finder/zipball/4a0fee5b86f5bbd9dfdc11ec124eba2915737ce1",
- "reference": "4a0fee5b86f5bbd9dfdc11ec124eba2915737ce1",
+ "url": "https://api.github.com/repos/symfony/Finder/zipball/32949721cc76afd75e4ac60d14ac3cf55b10a768",
+ "reference": "32949721cc76afd75e4ac60d14ac3cf55b10a768",
"shasum": ""
},
"require": {
@@ -2380,21 +2378,21 @@
],
"description": "Symfony Finder Component",
"homepage": "http://symfony.com",
- "time": "2013-08-13 20:18:00"
+ "time": "2014-05-22 13:42:36"
},
{
"name": "symfony/process",
- "version": "v2.3.4",
+ "version": "v2.3.16",
"target-dir": "Symfony/Component/Process",
"source": {
"type": "git",
"url": "https://github.com/symfony/Process.git",
- "reference": "1e91553e1cedd0b8fb1da6ea4f89b02e21713d5b"
+ "reference": "2cd7d075df6cb0d564c069a66408b3877c07d4e3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Process/zipball/1e91553e1cedd0b8fb1da6ea4f89b02e21713d5b",
- "reference": "1e91553e1cedd0b8fb1da6ea4f89b02e21713d5b",
+ "url": "https://api.github.com/repos/symfony/Process/zipball/2cd7d075df6cb0d564c069a66408b3877c07d4e3",
+ "reference": "2cd7d075df6cb0d564c069a66408b3877c07d4e3",
"shasum": ""
},
"require": {
@@ -2429,7 +2427,7 @@
],
"description": "Symfony Process Component",
"homepage": "http://symfony.com",
- "time": "2013-08-22 06:42:25"
+ "time": "2014-05-17 21:49:26"
}
],
"aliases": [
diff --git a/phpBB/config/console.yml b/phpBB/config/console.yml
index 00b8f9cec0..06ea0e317f 100644
--- a/phpBB/config/console.yml
+++ b/phpBB/config/console.yml
@@ -1,4 +1,11 @@
services:
+ console.command_collection:
+ class: phpbb\di\service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: console.command }
+
console.command.cache.purge:
class: phpbb\console\command\cache\purge
arguments:
diff --git a/phpBB/config/migrator.yml b/phpBB/config/migrator.yml
index 202421c09f..cd04eea5c2 100644
--- a/phpBB/config/migrator.yml
+++ b/phpBB/config/migrator.yml
@@ -29,6 +29,13 @@ services:
tags:
- { name: migrator.tool }
+ migrator.tool.config_text:
+ class: phpbb\db\migration\tool\config_text
+ arguments:
+ - @config_text
+ tags:
+ - { name: migrator.tool }
+
migrator.tool.module:
class: phpbb\db\migration\tool\module
arguments:
diff --git a/phpBB/config/services.yml b/phpBB/config/services.yml
index 3743daa075..b4e387bd73 100644
--- a/phpBB/config/services.yml
+++ b/phpBB/config/services.yml
@@ -39,9 +39,6 @@ services:
cache.driver:
class: %cache.driver.class%
- cache.driver.install:
- class: phpbb\cache\driver\file
-
class_loader:
class: phpbb\class_loader
arguments:
@@ -69,6 +66,9 @@ services:
- @cache.driver
- %tables.config%
+ config.php:
+ synthetic: true
+
config_text:
class: phpbb\config\db_text
arguments:
@@ -96,6 +96,7 @@ services:
- @config
- @controller.provider
- @ext.manager
+ - @symfony_request
- %core.root_path%
- %core.php_ext%
@@ -139,6 +140,11 @@ services:
- @service_container
dbal.conn:
+ class: phpbb\db\driver\factory
+ arguments:
+ - @service_container
+
+ dbal.conn.driver:
class: %dbal.driver.class%
calls:
- [sql_connect, [%dbal.dbhost%, %dbal.dbuser%, %dbal.dbpasswd%, %dbal.dbname%, %dbal.dbport%, false, %dbal.new_link%]]
@@ -255,7 +261,6 @@ services:
arguments:
- @auth
- @config
- - @config_text
- @dbal.conn
- @user
- %core.root_path%
@@ -300,6 +305,7 @@ services:
arguments:
- @symfony_request
- @filesystem
+ - @request
- %core.root_path%
- %core.php_ext%
- %core.adm_relative_path%
@@ -355,3 +361,8 @@ services:
- @cache
- @config
- @user
+
+ viewonline_helper:
+ class: phpbb\viewonline_helper
+ arguments:
+ - @filesystem
diff --git a/phpBB/develop/add_permissions.php b/phpBB/develop/add_permissions.php
index 7639256cfd..fd419a7dde 100644
--- a/phpBB/develop/add_permissions.php
+++ b/phpBB/develop/add_permissions.php
@@ -371,7 +371,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting)
switch ($sql_type)
{
case 'insert':
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mysql':
case 'mysql4':
diff --git a/phpBB/develop/benchmark.php b/phpBB/develop/benchmark.php
index 27176c97d3..c3cf90773e 100644
--- a/phpBB/develop/benchmark.php
+++ b/phpBB/develop/benchmark.php
@@ -313,7 +313,7 @@ function make_post($new_topic_id, $forum_id, $user_id, $post_username, $text, $m
else
{
// Rollback
- if($db->sql_layer == "mysql")
+ if($db->get_sql_layer() == "mysql")
{
$sql = "DELETE FROM " . POSTS_TABLE . "
WHERE post_id = $new_post_id";
diff --git a/phpBB/develop/merge_attachment_tables.php b/phpBB/develop/merge_attachment_tables.php
index a23db829e5..dd6e12172e 100644
--- a/phpBB/develop/merge_attachment_tables.php
+++ b/phpBB/develop/merge_attachment_tables.php
@@ -48,7 +48,7 @@ $sql = "CREATE TABLE {$table_prefix}attachments
AND a.post_id = p.post_id";
$db->sql_query($sql);
-switch ($db->sql_layer)
+switch ($db->get_sql_layer())
{
case 'mysql':
case 'mysql4':
diff --git a/phpBB/develop/merge_post_tables.php b/phpBB/develop/merge_post_tables.php
index 700c509782..9e81917108 100644
--- a/phpBB/develop/merge_post_tables.php
+++ b/phpBB/develop/merge_post_tables.php
@@ -46,7 +46,7 @@ $sql = "CREATE TABLE {$table_prefix}posts
WHERE pt.post_id = p.post_id";
$db->sql_query($sql);
-switch ($db->sql_layer)
+switch ($db->get_sql_layer())
{
case 'mysql':
case 'mysql4':
@@ -142,7 +142,7 @@ while ($row = $db->sql_fetchrow($result))
}
$db->sql_freeresult($result);
-switch ($db->sql_layer)
+switch ($db->get_sql_layer())
{
case 'oracle':
$sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 2a824fa9b7..71971108b1 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -46,6 +46,7 @@
<ol>
<li><a href="#changelog">Changelog</a>
<ol style="list-style-type: lower-roman;">
+ <li><a href="#v310b3">Changes since 3.1.0-RC1</a></li>
<li><a href="#v310b3">Changes since 3.1.0-b4</a></li>
<li><a href="#v310b3">Changes since 3.1.0-b3</a></li>
<li><a href="#v310b2">Changes since 3.1.0-b2</a></li>
@@ -94,7 +95,78 @@
<div class="content">
- <a name="v310b4"></a><h3>1.i. Changes since 3.1.0-b4</h3>
+ <a name="v310RC1"></a><h3>1.i. Changes since 3.1.0-RC1</h3>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9801">PHPBB3-9801</a>] - Users on custom pages outside the board directory are being displayed on Index page</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11392">PHPBB3-11392</a>] - &quot;Make normal&quot; in quickmod tool does not ajaxify correctly</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12325">PHPBB3-12325</a>] - Automatic update should notify about outdated files</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12420">PHPBB3-12420</a>] - Reduce config.php inclusions in DIC code</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12446">PHPBB3-12446</a>] - Unnecessary db connect - function phpbb_bootstrap_enabled_exts</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12462">PHPBB3-12462</a>] - Do not use string &quot;None&quot; for different avatar options</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12515">PHPBB3-12515</a>] - FULLTEXT_POSTGRES_TS_NOT_USABLE and FULLTEXT_POSTGRES_VERSION_CHECK_EXPLAIN redundant</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12605">PHPBB3-12605</a>] - Make dropdowns uniform</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12674">PHPBB3-12674</a>] - Last edited by in PMs doesn't show user colour</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12680">PHPBB3-12680</a>] - Contact icons in viewtopic are missing alternative text</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12695">PHPBB3-12695</a>] - Undefined index: MISSING_INLINE_ATTACHMENT notice given when viewing post details</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12716">PHPBB3-12716</a>] - Wrong method call in phpbb\auth\provider\oauth\token_storage</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12759">PHPBB3-12759</a>] - Profile fields lang value db queries can cause query flood</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12760">PHPBB3-12760</a>] - Post approval icon for wrong topics in Last Post column</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12764">PHPBB3-12764</a>] - Wrong error message on install if mysqli is selected and the credentials are wrong</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12766">PHPBB3-12766</a>] - Event exporter does not like RCx as version</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12768">PHPBB3-12768</a>] - 'NOTIFICATION_REPORT_CLOSED' entry has wrong indentation</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12771">PHPBB3-12771</a>] - Bug in \phpbb\db\migration\profilefield_base_migration when used in extensions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12772">PHPBB3-12772</a>] - Fatal error when &quot;Email topic&quot; is used in topic tools</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12773">PHPBB3-12773</a>] - Fix language variable name in cli extension enable command</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12774">PHPBB3-12774</a>] - Undefined variable $phpbb_adm_relative_path in phpbb_create_install_container()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12781">PHPBB3-12781</a>] - Template regex for DEFINE has problems when enclosed by other template conditionals</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12783">PHPBB3-12783</a>] - Remove require: phpbb/phpbb from Extensions composer.json files</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12787">PHPBB3-12787</a>] - Incorrect generated url when using ajax and routing</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12788">PHPBB3-12788</a>] - Update Symfony suite from 2.3.12 to 2.3.16</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12790">PHPBB3-12790</a>] - Always use the interface when available (and not directly the class)</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12802">PHPBB3-12802</a>] - Properly handle connection errors in SQLite3</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12808">PHPBB3-12808</a>] - Small gap between username and drop-down arrow</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12810">PHPBB3-12810</a>] - In acp_forums the displayed value for prune_shadow_freq is the value of prune_freq</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12811">PHPBB3-12811</a>] - Margin Bottom not taking effect in Safari with 101% height on same element</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12815">PHPBB3-12815</a>] - Members list link hidden from guests who have permission to view members list page</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12816">PHPBB3-12816</a>] - Fix comment about logs in user_ban function</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12818">PHPBB3-12818</a>] - Deleting a log entry in MCP produces a General error</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12819">PHPBB3-12819</a>] - Wrong text on hover over &quot;Jump to page&quot; field</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12825">PHPBB3-12825</a>] - Allow the extensions to be tested with the sniffer and skip the vendors</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12830">PHPBB3-12830</a>] - .postlink is in colours.css doubled, one should be deleted</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12834">PHPBB3-12834</a>] - Viewonline only matches routes</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12839">PHPBB3-12839</a>] - Missing stylesheet when it is not updated</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12013">PHPBB3-12013</a>] - Quickmod tools and jumpbox should use new dropdown</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12099">PHPBB3-12099</a>] - path_helper returns wrong web root path for ajax requests</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12196">PHPBB3-12196</a>] - Referer vs Referrer in language files</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12197">PHPBB3-12197</a>] - Fix misleading FAQ entries</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12334">PHPBB3-12334</a>] - Add raw values of profile fields to template</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12562">PHPBB3-12562</a>] - Prosilver has no max-width</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12645">PHPBB3-12645</a>] - Update support links to 3.1 forums</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12662">PHPBB3-12662</a>] - Reorganize and modernize the header navbar</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12735">PHPBB3-12735</a>] - Remove all :link, :visited, :active link states</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12777">PHPBB3-12777</a>] - Rename extension status functions and add is_configured()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12779">PHPBB3-12779</a>] - Change order of file lists on automatic update</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12782">PHPBB3-12782</a>] - Use an interface for the phpbb event_dispatcher</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12784">PHPBB3-12784</a>] - Allow the extensions to add a custom auto loader</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12786">PHPBB3-12786</a>] - Extend profilefield_base_migration.php class</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12812">PHPBB3-12812</a>] - Add a migrator tool for config_text database changes</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12813">PHPBB3-12813</a>] - Improve responsive pagination location and fix page-jump title</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12823">PHPBB3-12823</a>] - Remove trailing whitespace from CSS files</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12824">PHPBB3-12824</a>] - Move ACP &amp; MCP links in the header to the end of the link list</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12827">PHPBB3-12827</a>] - Reorder quick-links</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12775">PHPBB3-12775</a>] - Refactor functions_container into class container_builder</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12829">PHPBB3-12829</a>] - Remove check for pgsql 8.3/8.2</li>
+ </ul>
+
+ <a name="v310b4"></a><h3>1.ii. Changes since 3.1.0-b4</h3>
<h4>Bug</h4>
<ul>
@@ -214,7 +286,7 @@
</ul>
- <a name="v310b3"></a><h3>1.ii. Changes since 3.1.0-b3</h3>
+ <a name="v310b3"></a><h3>1.iii. Changes since 3.1.0-b3</h3>
<h4>Bug</h4>
<ul>
@@ -321,7 +393,7 @@
</ul>
- <a name="v310b2"></a><h3>1.iii. Changes since 3.1.0-b2</h3>
+ <a name="v310b2"></a><h3>1.iv. Changes since 3.1.0-b2</h3>
<h4>Bug</h4>
<ul>
@@ -486,7 +558,7 @@
</ul>
- <a name="v310b1"></a><h3>1.iv. Changes since 3.1.0-b1</h3>
+ <a name="v310b1"></a><h3>1.v. Changes since 3.1.0-b1</h3>
<h4>Bug</h4>
<ul>
@@ -554,7 +626,7 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12302">PHPBB3-12302</a>] - Upgrade composer.phar to 1.0.0-alpha8</li>
</ul>
- <a name="v310a3"></a><h3>1.v. Changes since 3.1.0-a3</h3>
+ <a name="v310a3"></a><h3>1.vi. Changes since 3.1.0-a3</h3>
<h4>Bug</h4>
<ul>
@@ -701,7 +773,7 @@
</ul>
- <a name="v310a2"></a><h3>1.vi. Changes since 3.1.0-a2</h3>
+ <a name="v310a2"></a><h3>1.vii. Changes since 3.1.0-a2</h3>
<h4>Bug</h4>
<ul>
@@ -809,7 +881,7 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12147">PHPBB3-12147</a>] - Remove Travis CI notification configuration</li>
</ul>
- <a name="v310a1"></a><h3>1.vii. Changes since 3.1.0-a1</h3>
+ <a name="v310a1"></a><h3>1.viii. Changes since 3.1.0-a1</h3>
<h4>Bug</h4>
<ul>
@@ -885,7 +957,7 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11998">PHPBB3-11998</a>] - Add console / command line client environment </li>
</ul>
- <a name="v30x"></a><h3>1.viii. Changes since 3.0.x</h3>
+ <a name="v30x"></a><h3>1.ix. Changes since 3.0.x</h3>
<h4>Bug</h4>
<ul>
@@ -1566,7 +1638,7 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11913">PHPBB3-11913</a>] - Apply reorganisation of download.phpbb.com to build_announcement.php</li>
</ul>
- <a name="v3011"></a><h3>1.ix. Changes since 3.0.11</h3>
+ <a name="v3011"></a><h3>1.x. Changes since 3.0.11</h3>
<h4>Bug</h4>
<ul>
@@ -1721,7 +1793,7 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11753">PHPBB3-11753</a>] - Upgrade mysql_upgrader.php schema data.</li>
</ul>
- <a name="v3010"></a><h3>1.x. Changes since 3.0.10</h3>
+ <a name="v3010"></a><h3>1.xi. Changes since 3.0.10</h3>
<h4>Bug</h4>
<ul>
@@ -1846,7 +1918,7 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10909">PHPBB3-10909</a>] - Update Travis Test Configuration: Travis no longer supports PHP 5.3.2</li>
</ul>
- <a name="v309"></a><h3>1.xi. Changes since 3.0.9</h3>
+ <a name="v309"></a><h3>1.xii. Changes since 3.0.9</h3>
<h4>Bug</h4>
<ul>
@@ -1982,7 +2054,7 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10480">PHPBB3-10480</a>] - Automate changelog building</li>
</ul>
- <a name="v308"></a><h3>1.xii. Changes since 3.0.8</h3>
+ <a name="v308"></a><h3>1.xiii. Changes since 3.0.8</h3>
<h4> Bug
</h4>
@@ -2350,7 +2422,7 @@
</ul>
- <a name="v307-PL1"></a><h3>1.xiii. Changes since 3.0.7-PL1</h3>
+ <a name="v307-PL1"></a><h3>1.xiv. Changes since 3.0.7-PL1</h3>
<h4> Security
</h4>
<ul>
@@ -2808,13 +2880,13 @@
</ul>
- <a name="v307"></a><h3>1.xiv. Changes since 3.0.7</h3>
+ <a name="v307"></a><h3>1.xv. Changes since 3.0.7</h3>
<ul>
<li>[Sec] Do not expose forum content of forums with ACL entries but no actual permission in ATOM Feeds. (Bug #58595)</li>
</ul>
- <a name="v306"></a><h3>1.xv. Changes since 3.0.6</h3>
+ <a name="v306"></a><h3>1.xvi. Changes since 3.0.6</h3>
<ul>
<li>[Fix] Allow ban reason and length to be selected and copied in ACP and subsilver2 MCP. (Bug #51095)</li>
@@ -2918,7 +2990,7 @@
</ul>
- <a name="v305"></a><h3>1.xvi. Changes since 3.0.5</h3>
+ <a name="v305"></a><h3>1.xvii. Changes since 3.0.5</h3>
<ul>
<li>[Fix] Allow whitespaces in avatar gallery names. (Bug #44955)</li>
@@ -3140,7 +3212,7 @@
<li>[Feature] Send anonymous statistical information to phpBB on installation and update (optional).</li>
</ul>
- <a name="v304"></a><h3>1.xvii. Changes since 3.0.4</h3>
+ <a name="v304"></a><h3>1.xviii. Changes since 3.0.4</h3>
<ul>
<li>[Fix] Delete user entry from ban list table upon user deletion (Bug #40015 - Patch by TerraFrost)</li>
@@ -3229,7 +3301,7 @@
<li>[Sec] Only use forum id supplied for posting if global announcement detected. (Reported by nickvergessen)</li>
</ul>
- <a name="v303"></a><h3>1.xviii. Changes since 3.0.3</h3>
+ <a name="v303"></a><h3>1.xix. Changes since 3.0.3</h3>
<ul>
<li>[Fix] Allow mixed-case template directories to be inherited (Bug #36725)</li>
@@ -3261,7 +3333,7 @@
<li>[Sec] Ask for forum password if post within passworded forum quoted in private message. (Reported by nickvergessen)</li>
</ul>
- <a name="v302"></a><h3>1.xix. Changes since 3.0.2</h3>
+ <a name="v302"></a><h3>1.xx. Changes since 3.0.2</h3>
<ul>
<li>[Fix] Correctly set topic starter if first post in topic removed (Bug #30575 - Patch by blueray2048)</li>
@@ -3360,7 +3432,7 @@
<li>[Sec Precaution] Stricter validation of the HTTP_HOST header (Thanks to Techie-Micheal et al for pointing out possible issues in derived code)</li>
</ul>
- <a name="v301"></a><h3>1.xx. Changes since 3.0.1</h3>
+ <a name="v301"></a><h3>1.xxi. Changes since 3.0.1</h3>
<ul>
<li>[Fix] Ability to set permissions on non-mysql dbms (Bug #24955)</li>
@@ -3408,7 +3480,7 @@
<li>[Sec] Only allow urls gone through redirect() being used within login_box(). (thanks nookieman)</li>
</ul>
- <a name="v300"></a><h3>1.xxi. Changes since 3.0.0</h3>
+ <a name="v300"></a><h3>1.xxii. Changes since 3.0.0</h3>
<ul>
<li>[Change] Validate birthdays (Bug #15004)</li>
@@ -3479,7 +3551,7 @@
<li>[Fix] Find and display colliding usernames correctly when converting from one database to another (Bug #23925)</li>
</ul>
- <a name="v30rc8"></a><h3>1.xxii. Changes since 3.0.RC8</h3>
+ <a name="v30rc8"></a><h3>1.xxiii. Changes since 3.0.RC8</h3>
<ul>
<li>[Fix] Cleaned usernames contain only single spaces, so &quot;a_name&quot; and &quot;a__name&quot; are treated as the same name (Bug #15634)</li>
@@ -3488,7 +3560,7 @@
<li>[Fix] Call garbage_collection() within database updater to correctly close connections (affects Oracle for example)</li>
</ul>
- <a name="v30rc7"></a><h3>1.xxiii. Changes since 3.0.RC7</h3>
+ <a name="v30rc7"></a><h3>1.xxiv. Changes since 3.0.RC7</h3>
<ul>
<li>[Fix] Fixed MSSQL related bug in the update system</li>
@@ -3523,7 +3595,7 @@
<li>[Fix] No duplication of active topics (Bug #15474)</li>
</ul>
- <a name="v30rc6"></a><h3>1.xxiv. Changes since 3.0.RC6</h3>
+ <a name="v30rc6"></a><h3>1.xxv. Changes since 3.0.RC6</h3>
<ul>
<li>[Fix] Submitting language changes using acp_language (Bug #14736)</li>
@@ -3533,7 +3605,7 @@
<li>[Fix] Able to request new password (Bug #14743)</li>
</ul>
- <a name="v30rc5"></a><h3>1.xxv. Changes since 3.0.RC5</h3>
+ <a name="v30rc5"></a><h3>1.xxvi. Changes since 3.0.RC5</h3>
<ul>
<li>[Feature] Removing constant PHPBB_EMBEDDED in favor of using an exit_handler(); the constant was meant to achive this more or less.</li>
@@ -3596,7 +3668,7 @@
<li>[Sec] New password hashing mechanism for storing passwords (#i42)</li>
</ul>
- <a name="v30rc4"></a><h3>1.xxvi. Changes since 3.0.RC4</h3>
+ <a name="v30rc4"></a><h3>1.xxvii. Changes since 3.0.RC4</h3>
<ul>
<li>[Fix] MySQL, PostgreSQL and SQLite related database fixes (Bug #13862)</li>
@@ -3647,7 +3719,7 @@
<li>[Fix] odbc_autocommit causing existing result sets to be dropped (Bug #14182)</li>
</ul>
- <a name="v30rc3"></a><h3>1.xxvii. Changes since 3.0.RC3</h3>
+ <a name="v30rc3"></a><h3>1.xxviii. Changes since 3.0.RC3</h3>
<ul>
<li>[Fix] Fixing some subsilver2 and prosilver style issues</li>
@@ -3756,7 +3828,7 @@
</ul>
- <a name="v30rc2"></a><h3>1.xxviii. Changes since 3.0.RC2</h3>
+ <a name="v30rc2"></a><h3>1.xxix. Changes since 3.0.RC2</h3>
<ul>
<li>[Fix] Re-allow searching within the memberlist</li>
@@ -3802,7 +3874,7 @@
</ul>
- <a name="v30rc1"></a><h3>1.xxix. Changes since 3.0.RC1</h3>
+ <a name="v30rc1"></a><h3>1.xxx. Changes since 3.0.RC1</h3>
<ul>
<li>[Fix] (X)HTML issues within the templates (Bug #11255, #11255)</li>
diff --git a/phpBB/docs/CREDITS.txt b/phpBB/docs/CREDITS.txt
index a4ba4cb87c..c0b1d4dbe2 100644
--- a/phpBB/docs/CREDITS.txt
+++ b/phpBB/docs/CREDITS.txt
@@ -25,9 +25,9 @@ phpBB Lead Developer: naderman (Nils Adermann)
phpBB Developers: bantu (Andreas Fischer)
dhruv.goel92 (Dhruv Goel)
EXreaction (Nathan Guse)
- imkingdavid (David King)
marc1706 (Marc Alexander)
nickvergessen (Joas Schilling)
+ nicofuma (Tristan Darricau)
prototech (Cesar Gallegos)
For a list of phpBB Team members, please see:
@@ -55,6 +55,7 @@ phpBB Developers: A_Jelly_Doughnut (Josh Woody) [01/2010 - 11/2010]
dhn (Dominik Dröscher) [05/2007 - 01/2011]
GrahamJE (Graham Eames) [09/2005 - 11/2006]
igorw (Igor Wiedler) [08/2010 - 02/2013]
+ imkingdavid (David King) [11/2012 - 06/2014]
kellanved (Henry Sudhof) [04/2007 - 03/2011]
Oleg (Oleg Pudeyev) [01/2011 - 05/2013]
rxu (Ruslan Uzdenov) [04/2010 - 12/2012]
diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md
index 34f2c4b6ec..b6d4bfe214 100644
--- a/phpBB/docs/events.md
+++ b/phpBB/docs/events.md
@@ -246,21 +246,21 @@ index_body_block_stats_prepend
* Since: 3.1.0-b3
* Purpose: Prepend content to the statistics list on the Board index
-index_body_linklist_after
+index_body_markforums_after
===
* Locations:
+ styles/prosilver/template/index_body.html
+ styles/subsilver2/template/index_body.html
-* Since: 3.1.0-a3
-* Purpose: Add content after the linklist above the forum list on Board index
+* Since: 3.1.0-RC2
+* Purpose: Add content after the mark-read link above the forum list on Board index
-index_body_linklist_before
+index_body_markforums_before
===
* Locations:
+ styles/prosilver/template/index_body.html
+ styles/subsilver2/template/index_body.html
-* Since: 3.1.0-a3
-* Purpose: Add content before the linklist above the forum list on Board index
+* Since: 3.1.0-RC2
+* Purpose: Add content before the mark-read link above the forum list on Board index
index_body_stat_blocks_after
===
@@ -278,6 +278,38 @@ index_body_stat_blocks_before
* Since: 3.1.0-a1
* Purpose: Add new statistic blocks above the Who Is Online and Board Statistics blocks
+mcp_ban_fields_after
+===
+* Locations:
+ + styles/prosilver/template/mcp_ban.html
+ + styles/subsilver2/template/mcp_ban.html
+* Since: 3.1.0-RC3
+* Purpose: Add additional fields to the ban form in MCP
+
+mcp_ban_fields_before
+===
+* Locations:
+ + styles/prosilver/template/mcp_ban.html
+ + styles/subsilver2/template/mcp_ban.html
+* Since: 3.1.0-RC3
+* Purpose: Add additional fields to the ban form in MCP
+
+mcp_ban_unban_after
+===
+* Locations:
+ + styles/prosilver/template/mcp_ban.html
+ + styles/subsilver2/template/mcp_ban.html
+* Since: 3.1.0-RC3
+* Purpose: Add additional fields to the unban form in MCP
+
+mcp_ban_unban_before
+===
+* Locations:
+ + styles/prosilver/template/mcp_ban.html
+ + styles/subsilver2/template/mcp_ban.html
+* Since: 3.1.0-RC3
+* Purpose: Add additional fields to the unban form in MCP
+
memberlist_body_username_append
===
* Locations:
@@ -344,25 +376,54 @@ memberlist_view_user_statistics_before
* Since: 3.1.0-a1
* Purpose: Add entries before the user statistics part of any user profile
-navbar_header_username_append
+navbar_header_logged_out_content
===
* Locations:
+ styles/prosilver/template/navbar_header.html
-* Since: 3.1.0-b4
-* Purpose: Add text and HTMl after the username shown in the navbar.
+* Since: 3.1.0-RC1
+* Purpose: Add text and HTML in place of the username when not logged in.
-navbar_header_logged_out_content
+navbar_header_profile_list_after
===
* Locations:
+ styles/prosilver/template/navbar_header.html
-* Since: 3.1.0-b4
-* Purpose: Add text and HTML in place of the username when not logged in.
+* Since: 3.1.0-RC2
+* Purpose: Add links to the bottom of the profile drop-down menu in the header navbar
+
+navbar_header_profile_list_before
+===
+* Locations:
+ + styles/prosilver/template/navbar_header.html
+* Since: 3.1.0-RC2
+* Purpose: Add links to the top of the profile drop-down menu in the header navbar
+
+navbar_header_quick_links_after
+===
+* Locations:
+ + styles/prosilver/template/navbar_header.html
+* Since: 3.1.0-RC2
+* Purpose: Add links to the bottom of the quick-links drop-down menu in the header
+
+navbar_header_quick_links_before
+===
+* Locations:
+ + styles/prosilver/template/navbar_header.html
+* Since: 3.1.0-RC2
+* Purpose: Add links to the top of the quick-links drop-down menu in the header
+
+navbar_header_username_append
+===
+* Locations:
+ + styles/prosilver/template/navbar_header.html
+* Since: 3.1.0-RC1
+* Purpose: Add text and HTMl after the username shown in the navbar.
navbar_header_username_prepend
===
* Locations:
+ styles/prosilver/template/navbar_header.html
-* Since: 3.1.0-b4
+* Since: 3.1.0-RC1
+* Purpose: Add text and HTMl before the username shown in the navbar.
overall_footer_after
===
@@ -741,6 +802,24 @@ ucp_pm_viewmessage_custom_fields_before
* Purpose: Add data before the custom fields on the user profile when viewing
a private message
+ucp_pm_viewmessage_post_buttons_after
+===
+* Locations:
+ + styles/prosilver/template/ucp_pm_viewmessage.html
+ + styles/subsilver2/template/ucp_pm_viewmessage.html
+* Since: 3.1.0-RC3
+* Purpose: Add post button to private messages (next to edit, quote etc), at
+the end of the list.
+
+ucp_pm_viewmessage_post_buttons_before
+===
+* Locations:
+ + styles/prosilver/template/ucp_pm_viewmessage.html
+ + styles/subsilver2/template/ucp_pm_viewmessage.html
+* Since: 3.1.0-RC3
+* Purpose: Add post button to private messages (next to edit, quote etc), at
+the start of the list.
+
ucp_pm_viewmessage_print_head_append
===
* Locations:
diff --git a/phpBB/download/file.php b/phpBB/download/file.php
index ce2855473b..d4e0f04d2b 100644
--- a/phpBB/download/file.php
+++ b/phpBB/download/file.php
@@ -38,29 +38,31 @@ else if (isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'
if (isset($_GET['avatar']))
{
require($phpbb_root_path . 'includes/startup.' . $phpEx);
- require($phpbb_root_path . 'config.' . $phpEx);
+
+ require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
+ $phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
+ $phpbb_class_loader->register();
+
+ $phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);
+ extract($phpbb_config_php_file->get_all());
if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type))
{
exit;
}
- require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
-
require($phpbb_root_path . 'includes/constants.' . $phpEx);
require($phpbb_root_path . 'includes/functions.' . $phpEx);
- require($phpbb_root_path . 'includes/functions_container.' . $phpEx);
require($phpbb_root_path . 'includes/functions_download' . '.' . $phpEx);
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
// Setup class loader first
- $phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
- $phpbb_class_loader->register();
$phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx);
$phpbb_class_loader_ext->register();
// Set up container
- $phpbb_container = phpbb_create_default_container($phpbb_root_path, $phpEx);
+ $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
+ $phpbb_container = $phpbb_container_builder->get_container();
$phpbb_class_loader->set_cache($phpbb_container->get('cache.driver'));
$phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver'));
@@ -73,11 +75,6 @@ if (isset($_GET['avatar']))
$db = $phpbb_container->get('dbal.conn');
$phpbb_log = $phpbb_container->get('log');
- // Connect to DB
- if (!@$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, false))
- {
- exit;
- }
unset($dbpasswd);
request_var('', 0, false, false, $request);
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 74df9240a1..1811748c2f 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -410,7 +410,7 @@ class acp_board
'ip_check' => array('lang' => 'IP_VALID', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_ip_check', 'explain' => true),
'browser_check' => array('lang' => 'BROWSER_VALID', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'forwarded_for_check' => array('lang' => 'FORWARDED_FOR_VALID', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
- 'referer_validation' => array('lang' => 'REFERER_VALID', 'validate' => 'int:0:3','type' => 'custom', 'method' => 'select_ref_check', 'explain' => true),
+ 'referer_validation' => array('lang' => 'REFERRER_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,),
diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php
index 76da43341d..8f9c155ffc 100644
--- a/phpBB/includes/acp/acp_database.php
+++ b/phpBB/includes/acp/acp_database.php
@@ -90,7 +90,7 @@ class acp_database
$time = time();
$filename = 'backup_' . $time . '_' . unique_id();
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mysqli':
case 'mysql4':
@@ -133,7 +133,7 @@ class acp_database
else
{
// We might wanna empty out all that junk :D
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'sqlite':
case 'sqlite3':
@@ -320,7 +320,7 @@ class acp_database
break;
}
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mysql':
case 'mysql4':
@@ -365,10 +365,10 @@ class acp_database
{
trigger_error($user->lang['RESTORE_FAILURE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- pg_put_line($db->db_connect_id, $sub . "\n");
+ pg_put_line($db->get_db_connect_id(), $sub . "\n");
}
- pg_put_line($db->db_connect_id, "\\.\n");
- pg_end_copy($db->db_connect_id);
+ pg_put_line($db->get_db_connect_id(), "\\.\n");
+ pg_end_copy($db->get_db_connect_id());
}
}
break;
@@ -623,7 +623,7 @@ class mysql_extractor extends base_extractor
if ($new_extract === null)
{
- if ($db->sql_layer === 'mysqli' || version_compare($db->sql_server_info(true), '3.23.20', '>='))
+ if ($db->get_sql_layer() === 'mysqli' || version_compare($db->sql_server_info(true), '3.23.20', '>='))
{
$new_extract = true;
}
@@ -646,7 +646,7 @@ class mysql_extractor extends base_extractor
function write_data($table_name)
{
global $db;
- if ($db->sql_layer === 'mysqli')
+ if ($db->get_sql_layer() === 'mysqli')
{
$this->write_data_mysqli($table_name);
}
@@ -661,7 +661,7 @@ class mysql_extractor extends base_extractor
global $db;
$sql = "SELECT *
FROM $table_name";
- $result = mysqli_query($db->db_connect_id, $sql, MYSQLI_USE_RESULT);
+ $result = mysqli_query($db->get_db_connect_id(), $sql, MYSQLI_USE_RESULT);
if ($result != false)
{
$fields_cnt = mysqli_num_fields($result);
@@ -740,7 +740,7 @@ class mysql_extractor extends base_extractor
global $db;
$sql = "SELECT *
FROM $table_name";
- $result = mysql_unbuffered_query($sql, $db->db_connect_id);
+ $result = mysql_unbuffered_query($sql, $db->get_db_connect_id());
if ($result != false)
{
@@ -993,11 +993,11 @@ class sqlite_extractor extends base_extractor
{
global $db;
- $col_types = sqlite_fetch_column_types($db->db_connect_id, $table_name);
+ $col_types = sqlite_fetch_column_types($db->get_db_connect_id(), $table_name);
$sql = "SELECT *
FROM $table_name";
- $result = sqlite_unbuffered_query($db->db_connect_id, $sql);
+ $result = sqlite_unbuffered_query($db->get_db_connect_id(), $sql);
$rows = sqlite_fetch_all($result, SQLITE_ASSOC);
$sql_insert = 'INSERT INTO ' . $table_name . ' (' . implode(', ', array_keys($col_types)) . ') VALUES (';
foreach ($rows as $row)
@@ -1553,11 +1553,11 @@ class mssql_extractor extends base_extractor
{
global $db;
- if ($db->sql_layer === 'mssql')
+ if ($db->get_sql_layer() === 'mssql')
{
$this->write_data_mssql($table_name);
}
- else if($db->sql_layer === 'mssqlnative')
+ else if($db->get_sql_layer() === 'mssqlnative')
{
$this->write_data_mssqlnative($table_name);
}
diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php
index b2a6820461..aba9caaece 100644
--- a/phpBB/includes/acp/acp_extensions.php
+++ b/phpBB/includes/acp/acp_extensions.php
@@ -137,7 +137,7 @@ class acp_extensions
trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- if ($phpbb_extension_manager->enabled($ext_name))
+ if ($phpbb_extension_manager->is_enabled($ext_name))
{
redirect($this->u_action);
}
@@ -162,7 +162,7 @@ class acp_extensions
trigger_error($user->lang['EXTENSION_NOT_AVAILABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- if ($phpbb_extension_manager->enabled($ext_name))
+ if ($phpbb_extension_manager->is_enabled($ext_name))
{
redirect($this->u_action);
}
@@ -194,7 +194,7 @@ class acp_extensions
break;
case 'disable_pre':
- if (!$phpbb_extension_manager->enabled($ext_name))
+ if (!$phpbb_extension_manager->is_enabled($ext_name))
{
redirect($this->u_action);
}
@@ -209,7 +209,7 @@ class acp_extensions
break;
case 'disable':
- if (!$phpbb_extension_manager->enabled($ext_name))
+ if (!$phpbb_extension_manager->is_enabled($ext_name))
{
redirect($this->u_action);
}
@@ -234,7 +234,7 @@ class acp_extensions
break;
case 'delete_data_pre':
- if ($phpbb_extension_manager->enabled($ext_name))
+ if ($phpbb_extension_manager->is_enabled($ext_name))
{
redirect($this->u_action);
}
@@ -248,7 +248,7 @@ class acp_extensions
break;
case 'delete_data':
- if ($phpbb_extension_manager->enabled($ext_name))
+ if ($phpbb_extension_manager->is_enabled($ext_name))
{
redirect($this->u_action);
}
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index f8c463e158..adf5de44f5 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -1827,7 +1827,7 @@ class acp_forums
}
$db->sql_freeresult($result);
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mysql4':
case 'mysqli':
diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php
index b9a6ef17ce..028025b547 100644
--- a/phpBB/includes/acp/acp_icons.php
+++ b/phpBB/includes/acp/acp_icons.php
@@ -538,7 +538,7 @@ class acp_icons
// The user has already selected a smilies_pak file
if ($current == 'delete')
{
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'sqlite':
case 'sqlite3':
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index 247460ec8e..0d0d49774c 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -269,7 +269,7 @@ class acp_main
break;
case 'db_track':
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'sqlite':
case 'sqlite3':
@@ -374,7 +374,7 @@ class acp_main
foreach ($tables as $table)
{
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'sqlite':
case 'sqlite3':
diff --git a/phpBB/includes/acp/acp_permission_roles.php b/phpBB/includes/acp/acp_permission_roles.php
index 9715b9bce8..cd3616208d 100644
--- a/phpBB/includes/acp/acp_permission_roles.php
+++ b/phpBB/includes/acp/acp_permission_roles.php
@@ -253,7 +253,7 @@ class acp_permission_roles
{
$sql = 'SELECT auth_option_id, auth_option
FROM ' . ACL_OPTIONS_TABLE . "
- WHERE auth_option " . $db->sql_like_expression($permission_type . $db->any_char) . "
+ WHERE auth_option " . $db->sql_like_expression($permission_type . $db->get_any_char()) . "
AND auth_option <> '{$permission_type}'
ORDER BY auth_option_id";
$result = $db->sql_query($sql);
@@ -315,7 +315,7 @@ class acp_permission_roles
// We need to fill the auth options array with ACL_NO options ;)
$sql = 'SELECT auth_option_id, auth_option
FROM ' . ACL_OPTIONS_TABLE . "
- WHERE auth_option " . $db->sql_like_expression($permission_type . $db->any_char) . "
+ WHERE auth_option " . $db->sql_like_expression($permission_type . $db->get_any_char()) . "
AND auth_option <> '{$permission_type}'
ORDER BY auth_option_id";
$result = $db->sql_query($sql);
@@ -519,7 +519,7 @@ class acp_permission_roles
// Get complete auth array
$sql = 'SELECT auth_option, auth_option_id
FROM ' . ACL_OPTIONS_TABLE . "
- WHERE auth_option " . $db->sql_like_expression($permission_type . $db->any_char);
+ WHERE auth_option " . $db->sql_like_expression($permission_type . $db->get_any_char());
$result = $db->sql_query($sql);
$auth_settings = array();
diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php
index 6540173433..cb408e304f 100644
--- a/phpBB/includes/acp/acp_permissions.php
+++ b/phpBB/includes/acp/acp_permissions.php
@@ -1238,7 +1238,7 @@ class acp_permissions
$sql = 'SELECT auth_option_id
FROM ' . ACL_OPTIONS_TABLE . '
- WHERE auth_option ' . $db->sql_like_expression($permission_type . $db->any_char);
+ WHERE auth_option ' . $db->sql_like_expression($permission_type . $db->get_any_char());
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index c291ee43c8..fda6ef25ec 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -112,7 +112,7 @@ class acp_profile
$db->sql_query('DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . " WHERE field_id = $field_id");
$db->sql_query('DELETE FROM ' . PROFILE_LANG_TABLE . " WHERE field_id = $field_id");
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'sqlite':
case 'sqlite3':
@@ -1196,7 +1196,7 @@ class acp_profile
{
global $db;
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mysql':
case 'mysql4':
diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php
index 2ddda28afc..a10b248324 100644
--- a/phpBB/includes/acp/acp_prune.php
+++ b/phpBB/includes/acp/acp_prune.php
@@ -436,8 +436,8 @@ class acp_prune
$sort_by_types = array('username', 'user_email', 'user_posts', 'user_regdate', 'user_lastvisit');
$where_sql = '';
- $where_sql .= ($username) ? ' AND username_clean ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($username))) : '';
- $where_sql .= ($email) ? ' AND user_email ' . $db->sql_like_expression(str_replace('*', $db->any_char, $email)) . ' ' : '';
+ $where_sql .= ($username) ? ' AND username_clean ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), utf8_clean_string($username))) : '';
+ $where_sql .= ($email) ? ' AND user_email ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), $email)) . ' ' : '';
$where_sql .= $joined_sql;
$where_sql .= ($count) ? " AND user_posts " . $key_match[$count_select] . ' ' . (int) $count . ' ' : '';
diff --git a/phpBB/includes/acp/acp_reasons.php b/phpBB/includes/acp/acp_reasons.php
index 9cb5efdbe0..3d7ccf422c 100644
--- a/phpBB/includes/acp/acp_reasons.php
+++ b/phpBB/includes/acp/acp_reasons.php
@@ -219,7 +219,7 @@ class acp_reasons
$other_reason_id = (int) $db->sql_fetchfield('reason_id');
$db->sql_freeresult($result);
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
// The ugly one!
case 'mysqli':
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index d07120a65f..71880c2267 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -2384,7 +2384,7 @@ class acp_users
// Select auth options
$sql = 'SELECT auth_option, is_local, is_global
FROM ' . ACL_OPTIONS_TABLE . '
- WHERE auth_option ' . $db->sql_like_expression($db->any_char . '_') . '
+ WHERE auth_option ' . $db->sql_like_expression($db->get_any_char() . '_') . '
AND is_global = 1
ORDER BY auth_option';
$result = $db->sql_query($sql);
@@ -2404,7 +2404,7 @@ class acp_users
{
$sql = 'SELECT auth_option, is_local, is_global
FROM ' . ACL_OPTIONS_TABLE . "
- WHERE auth_option " . $db->sql_like_expression($db->any_char . '_') . "
+ WHERE auth_option " . $db->sql_like_expression($db->get_any_char() . '_') . "
AND is_local = 1
ORDER BY is_global DESC, auth_option";
$result = $db->sql_query($sql);
diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php
index 7bb8e824d6..7ff3212b72 100644
--- a/phpBB/includes/acp/auth.php
+++ b/phpBB/includes/acp/auth.php
@@ -1024,7 +1024,7 @@ class auth_admin extends \phpbb\auth\auth
// Get permission type
$sql = 'SELECT auth_option, auth_option_id
FROM ' . ACL_OPTIONS_TABLE . "
- WHERE auth_option " . $db->sql_like_expression($permission_type . $db->any_char);
+ WHERE auth_option " . $db->sql_like_expression($permission_type . $db->get_any_char());
$result = $db->sql_query($sql);
$auth_id_ary = array();
diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php
index 2287639aee..cd4e19bf1d 100644
--- a/phpBB/includes/constants.php
+++ b/phpBB/includes/constants.php
@@ -28,7 +28,7 @@ if (!defined('IN_PHPBB'))
*/
// phpBB Version
-define('PHPBB_VERSION', '3.1.0-RC2-dev');
+define('PHPBB_VERSION', '3.1.0-RC3-dev');
// QA-related
// define('PHPBB_QA', 1);
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 32acb0c9ff..8b9969aced 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -21,6 +21,37 @@ if (!defined('IN_PHPBB'))
// Common global functions
/**
+* Load the autoloaders added by the extensions.
+*
+* @param string $phpbb_root_path Path to the phpbb root directory.
+*/
+function phpbb_load_extensions_autoloaders($phpbb_root_path)
+{
+ $iterator = new \RecursiveIteratorIterator(
+ new \phpbb\recursive_dot_prefix_filter_iterator(
+ new \RecursiveDirectoryIterator(
+ $phpbb_root_path . 'ext/',
+ \FilesystemIterator::SKIP_DOTS
+ )
+ ),
+ \RecursiveIteratorIterator::SELF_FIRST
+ );
+ $iterator->setMaxDepth(2);
+
+ foreach ($iterator as $file_info)
+ {
+ if ($file_info->getFilename() === 'vendor' && $iterator->getDepth() === 2)
+ {
+ $filename = $file_info->getRealPath() . '/autoload.php';
+ if (file_exists($filename))
+ {
+ require $filename;
+ }
+ }
+ }
+}
+
+/**
* Casts a variable to the given type.
*
* @deprecated
@@ -3998,7 +4029,7 @@ function obtain_guest_count($item_id = 0, $item = 'forum')
// Get number of online guests
- if ($db->sql_layer === 'sqlite' || $db->sql_layer === 'sqlite3')
+ if ($db->get_sql_layer() === 'sqlite' || $db->get_sql_layer() === 'sqlite3')
{
$sql = 'SELECT COUNT(session_ip) as num_guests
FROM (
@@ -4881,6 +4912,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
'PRIVATE_MESSAGE_COUNT' => (!empty($user->data['user_unread_privmsg'])) ? $user->data['user_unread_privmsg'] : 0,
'CURRENT_USER_AVATAR' => phpbb_get_user_avatar($user->data),
+ 'CURRENT_USERNAME_SIMPLE' => get_username_string('no_profile', $user->data['user_id'], $user->data['username'], $user->data['user_colour']),
'CURRENT_USERNAME_FULL' => get_username_string('full', $user->data['user_id'], $user->data['username'], $user->data['user_colour']),
'UNREAD_NOTIFICATIONS_COUNT' => ($notifications !== false) ? $notifications['unread_count'] : '',
'NOTIFICATIONS_COUNT' => ($notifications !== false) ? $notifications['unread_count'] : '',
@@ -4923,7 +4955,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
'U_SEARCH_UNREAD' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=unreadposts'),
'U_SEARCH_ACTIVE_TOPICS'=> append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=active_topics'),
'U_DELETE_COOKIES' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=delete_cookies'),
- 'U_CONTACT_US' => ($config['contact_admin_form_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin') : '',
+ 'U_CONTACT_US' => ($config['contact_admin_form_enable'] && $config['email_enable']) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin') : '',
'U_TEAM' => ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile')) ? '' : append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=team'),
'U_TERMS_USE' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'),
'U_PRIVACY' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'),
@@ -5064,7 +5096,7 @@ function phpbb_generate_debug_output(phpbb\db\driver\driver_interface $db, \phpb
if (isset($GLOBALS['starttime']))
{
$totaltime = microtime(true) - $GLOBALS['starttime'];
- $debug_info[] = sprintf('<abbr title="SQL time: %.3fs / PHP time: %.3fs">Time: %.3fs</abbr>', $db->sql_time, ($totaltime - $db->sql_time), $totaltime);
+ $debug_info[] = sprintf('<abbr title="SQL time: %.3fs / PHP time: %.3fs">Time: %.3fs</abbr>', $db->get_sql_time(), ($totaltime - $db->get_sql_time()), $totaltime);
}
$debug_info[] = sprintf('<abbr title="Cached: %d">Queries: %d</abbr>', $db->sql_num_queries(true), $db->sql_num_queries());
@@ -5295,52 +5327,6 @@ function phpbb_to_numeric($input)
}
/**
-* Convert either 3.0 dbms or 3.1 db driver class name to 3.1 db driver class name.
-*
-* If $dbms is a valid 3.1 db driver class name, returns it unchanged.
-* Otherwise prepends phpbb\db\driver\ to the dbms to convert a 3.0 dbms
-* to 3.1 db driver class name.
-*
-* @param string $dbms dbms parameter
-* @return db driver class
-*/
-function phpbb_convert_30_dbms_to_31($dbms)
-{
- // Note: this check is done first because mysqli extension
- // supplies a mysqli class, and class_exists($dbms) would return
- // true for mysqli class.
- // However, per the docblock any valid 3.1 driver name should be
- // recognized by this function, and have priority over 3.0 dbms.
- if (strpos($dbms, 'phpbb\db\driver') === false && class_exists('phpbb\db\driver\\' . $dbms))
- {
- return 'phpbb\db\driver\\' . $dbms;
- }
-
- if (class_exists($dbms))
- {
- // Additionally we could check that $dbms extends phpbb\db\driver\driver.
- // http://php.net/manual/en/class.reflectionclass.php
- // Beware of possible performance issues:
- // http://stackoverflow.com/questions/294582/php-5-reflection-api-performance
- // We could check for interface implementation in all paths or
- // only when we do not prepend phpbb\db\driver\.
-
- /*
- $reflection = new \ReflectionClass($dbms);
-
- if ($reflection->isSubclassOf('phpbb\db\driver\driver'))
- {
- return $dbms;
- }
- */
-
- return $dbms;
- }
-
- throw new \RuntimeException("You have specified an invalid dbms driver: $dbms");
-}
-
-/**
* Get the board contact details (e.g. for emails)
*
* @param \phpbb\config\config $config
@@ -5369,7 +5355,7 @@ function phpbb_get_board_contact(\phpbb\config\config $config, $phpEx)
*/
function phpbb_get_board_contact_link(\phpbb\config\config $config, $phpbb_root_path, $phpEx)
{
- if ($config['contact_admin_form_enable'])
+ if ($config['contact_admin_form_enable'] && $config['email_enable'])
{
return append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin');
}
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 6bf8ce2c81..accc8a6a83 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -1435,7 +1435,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
{
case 'topic_moved':
$db->sql_transaction('begin');
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mysql4':
case 'mysqli':
@@ -2441,7 +2441,7 @@ function phpbb_cache_moderators($db, $cache, $auth)
$cache->destroy('sql', MODERATOR_CACHE_TABLE);
// Clear table
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'sqlite':
case 'sqlite3':
@@ -2491,7 +2491,7 @@ function phpbb_cache_moderators($db, $cache, $auth)
AND NOT (ug.group_leader = 1 AND g.group_skip_auth = 1)
AND ' . $db->sql_in_set('ug.user_id', $ug_id_ary) . "
AND ug.user_pending = 0
- AND o.auth_option " . $db->sql_like_expression('m_' . $db->any_char),
+ AND o.auth_option " . $db->sql_like_expression('m_' . $db->get_any_char()),
);
$sql = $db->sql_build_query('SELECT', $sql_ary_deny);
$result = $db->sql_query($sql);
@@ -2697,11 +2697,11 @@ function phpbb_update_foes($db, $auth, $group_id = false, $user_id = false)
return;
}
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mysqli':
case 'mysql4':
- $sql = 'DELETE ' . (($db->sql_layer === 'mysqli' || version_compare($db->sql_server_info(true), '4.1', '>=')) ? 'z.*' : ZEBRA_TABLE) . '
+ $sql = 'DELETE ' . (($db->get_sql_layer() === 'mysqli' || version_compare($db->sql_server_info(true), '4.1', '>=')) ? 'z.*' : ZEBRA_TABLE) . '
FROM ' . ZEBRA_TABLE . ' z, ' . USER_GROUP_TABLE . ' ug
WHERE z.zebra_id = ug.user_id
AND z.foe = 1
@@ -2854,7 +2854,7 @@ function get_database_size()
$database_size = false;
// This code is heavily influenced by a similar routine in phpMyAdmin 2.2.0
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mysql':
case 'mysql4':
@@ -2870,7 +2870,7 @@ function get_database_size()
if (preg_match('#(3\.23|[45]\.)#', $version))
{
- $db_name = (preg_match('#^(?:3\.23\.(?:[6-9]|[1-9]{2}))|[45]\.#', $version)) ? "`{$db->dbname}`" : $db->dbname;
+ $db_name = (preg_match('#^(?:3\.23\.(?:[6-9]|[1-9]{2}))|[45]\.#', $version)) ? "`{$db->get_db_name()}`" : $db->get_db_name();
$sql = 'SHOW TABLE STATUS
FROM ' . $db_name;
@@ -2946,7 +2946,7 @@ function get_database_size()
if ($row['proname'] == 'pg_database_size')
{
- $database = $db->dbname;
+ $database = $db->get_db_name();
if (strpos($database, '.') !== false)
{
list($database, ) = explode('.', $database);
diff --git a/phpBB/includes/functions_container.php b/phpBB/includes/functions_container.php
deleted file mode 100644
index 5794d2f403..0000000000
--- a/phpBB/includes/functions_container.php
+++ /dev/null
@@ -1,291 +0,0 @@
-<?php
-/**
-*
-* This file is part of the phpBB Forum Software package.
-*
-* @copyright (c) phpBB Limited <https://www.phpbb.com>
-* @license GNU General Public License, version 2 (GPL-2.0)
-*
-* For full copyright and license information, please see
-* the docs/CREDITS.txt file.
-*
-*/
-
-use Symfony\Component\Config\FileLocator;
-use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
-use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* Get DB connection from config.php.
-*
-* Used to bootstrap the container.
-*
-* @param string $config_file
-* @return \phpbb\db\driver\driver_interface
-*/
-function phpbb_bootstrap_db_connection($config_file)
-{
- require($config_file);
- $dbal_driver_class = phpbb_convert_30_dbms_to_31($dbms);
-
- $db = new $dbal_driver_class();
- $db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, defined('PHPBB_DB_NEW_LINK'));
-
- return $db;
-}
-
-/**
-* Get table prefix from config.php.
-*
-* Used to bootstrap the container.
-*
-* @param string $config_file
-* @return string table prefix
-*/
-function phpbb_bootstrap_table_prefix($config_file)
-{
- require($config_file);
- return $table_prefix;
-}
-
-/**
-* Get enabled extensions.
-*
-* Used to bootstrap the container.
-*
-* @param string $config_file
-* @param string $phpbb_root_path
-* @return array enabled extensions
-*/
-function phpbb_bootstrap_enabled_exts($config_file, $phpbb_root_path)
-{
- $db = phpbb_bootstrap_db_connection($config_file);
- $table_prefix = phpbb_bootstrap_table_prefix($config_file);
- $extension_table = $table_prefix.'ext';
-
- $sql = 'SELECT *
- FROM ' . $extension_table . '
- WHERE ext_active = 1';
-
- $result = $db->sql_query($sql);
- $rows = $db->sql_fetchrowset($result);
- $db->sql_freeresult($result);
-
- $exts = array();
- foreach ($rows as $row)
- {
- $exts[$row['ext_name']] = $phpbb_root_path . 'ext/' . $row['ext_name'] . '/';
- }
-
- return $exts;
-}
-
-/**
-* Create the ContainerBuilder object
-*
-* @param array $extensions Array of Container extension objects
-* @param string $phpbb_root_path Root path
-* @param string $php_ext PHP Extension
-* @return ContainerBuilder object
-*/
-function phpbb_create_container(array $extensions, $phpbb_root_path, $php_ext)
-{
- $container = new ContainerBuilder();
-
- foreach ($extensions as $extension)
- {
- $container->registerExtension($extension);
- $container->loadFromExtension($extension->getAlias());
- }
-
- $container->setParameter('core.root_path', $phpbb_root_path);
- $container->setParameter('core.php_ext', $php_ext);
-
- return $container;
-}
-
-/**
-* Create installer container
-*
-* @param string $phpbb_root_path Root path
-* @param string $php_ext PHP Extension
-* @return ContainerBuilder object
-*/
-function phpbb_create_install_container($phpbb_root_path, $php_ext)
-{
- $other_config_path = $phpbb_root_path . 'install/update/new/config/';
- $config_path = file_exists($other_config_path . 'services.yml') ? $other_config_path : $phpbb_root_path . 'config/';
-
- $core = new \phpbb\di\extension\core($config_path);
- $container = phpbb_create_container(array($core), $phpbb_root_path, $php_ext);
-
- $container->setParameter('core.root_path', $phpbb_root_path);
- $container->setParameter('core.adm_relative_path', $phpbb_adm_relative_path);
- $container->setParameter('core.php_ext', $php_ext);
- $container->setParameter('core.table_prefix', '');
-
- $container->register('dbal.conn')->setSynthetic(true);
-
- $container->setAlias('cache.driver', 'cache.driver.install');
-
- $container->compile();
-
- return $container;
-}
-
-/**
-* Create updater container
-*
-* @param string $phpbb_root_path Root path
-* @param string $php_ext PHP Extension
-* @param array $config_path Path to config directory
-* @return ContainerBuilder object (compiled)
-*/
-function phpbb_create_update_container($phpbb_root_path, $php_ext, $config_path)
-{
- $config_file = $phpbb_root_path . 'config.' . $php_ext;
- return phpbb_create_compiled_container(
- $config_file,
- array(
- new phpbb\di\extension\config($config_file),
- new phpbb\di\extension\core($config_path),
- ),
- array(
- new phpbb\di\pass\collection_pass(),
- new phpbb\di\pass\kernel_pass(),
- ),
- $phpbb_root_path,
- $php_ext
- );
-}
-
-/**
-* Create a compiled ContainerBuilder object
-*
-* @param array $extensions Array of Container extension objects
-* @param array $passes Array of Compiler Pass objects
-* @param string $phpbb_root_path Root path
-* @param string $php_ext PHP Extension
-* @return ContainerBuilder object (compiled)
-*/
-function phpbb_create_compiled_container($config_file, array $extensions, array $passes, $phpbb_root_path, $php_ext)
-{
- // Create the final container to be compiled and cached
- $container = phpbb_create_container($extensions, $phpbb_root_path, $php_ext);
-
- // Compile the container
- foreach ($passes as $pass)
- {
- $container->addCompilerPass($pass);
- }
- $container->compile();
-
- return $container;
-}
-
-/**
-* Create a compiled and dumped ContainerBuilder object
-*
-* @param array $extensions Array of Container extension objects
-* @param array $passes Array of Compiler Pass objects
-* @param string $phpbb_root_path Root path
-* @param string $php_ext PHP Extension
-* @return ContainerBuilder object (compiled)
-*/
-function phpbb_create_dumped_container($config_file, array $extensions, array $passes, $phpbb_root_path, $php_ext)
-{
- // Check for our cached container; if it exists, use it
- $container_filename = phpbb_container_filename($phpbb_root_path, $php_ext);
- if (file_exists($container_filename))
- {
- require($container_filename);
- return new phpbb_cache_container();
- }
-
- $container = phpbb_create_compiled_container($config_file, $extensions, $passes, $phpbb_root_path, $php_ext);
-
- // Lastly, we create our cached container class
- $dumper = new PhpDumper($container);
- $cached_container_dump = $dumper->dump(array(
- 'class' => 'phpbb_cache_container',
- 'base_class' => 'Symfony\\Component\\DependencyInjection\\ContainerBuilder',
- ));
-
- file_put_contents($container_filename, $cached_container_dump);
-
- return $container;
-}
-
-/**
-* Create an environment-specific ContainerBuilder object
-*
-* If debug is enabled, the container is re-compiled every time.
-* This ensures that the latest changes will always be reflected
-* during development.
-*
-* Otherwise it will get the existing dumped container and use
-* that one instead.
-*
-* @param array $extensions Array of Container extension objects
-* @param array $passes Array of Compiler Pass objects
-* @param string $phpbb_root_path Root path
-* @param string $php_ext PHP Extension
-* @return ContainerBuilder object (compiled)
-*/
-function phpbb_create_dumped_container_unless_debug($config_file, array $extensions, array $passes, $phpbb_root_path, $php_ext)
-{
- $container_factory = defined('DEBUG_CONTAINER') ? 'phpbb_create_compiled_container' : 'phpbb_create_dumped_container';
- return $container_factory($config_file, $extensions, $passes, $phpbb_root_path, $php_ext);
-}
-
-/**
-* Create a default ContainerBuilder object
-*
-* Contains the default configuration of the phpBB container.
-*
-* @param array $extensions Array of Container extension objects
-* @param array $passes Array of Compiler Pass objects
-* @return ContainerBuilder object (compiled)
-*/
-function phpbb_create_default_container($phpbb_root_path, $php_ext)
-{
- $config_file = $phpbb_root_path . 'config.' . $php_ext;
- $installed_exts = phpbb_bootstrap_enabled_exts($config_file, $phpbb_root_path);
-
- return phpbb_create_dumped_container_unless_debug(
- $config_file,
- array(
- new \phpbb\di\extension\config($config_file),
- new \phpbb\di\extension\core($phpbb_root_path . 'config'),
- new \phpbb\di\extension\ext($installed_exts),
- ),
- array(
- new \phpbb\di\pass\collection_pass(),
- new \phpbb\di\pass\kernel_pass(),
- ),
- $phpbb_root_path,
- $php_ext
- );
-}
-
-/**
-* Get the filename under which the dumped container will be stored.
-*
-* @param string $phpbb_root_path Root path
-* @param string $php_ext PHP Extension
-* @return Path for dumped container
-*/
-function phpbb_container_filename($phpbb_root_path, $php_ext)
-{
- $filename = str_replace(array('/', '.'), array('slash', 'dot'), $phpbb_root_path);
- return $phpbb_root_path . 'cache/container_' . $filename . '.' . $php_ext;
-}
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php
index 74b3e0c70f..ee78364083 100644
--- a/phpBB/includes/functions_content.php
+++ b/phpBB/includes/functions_content.php
@@ -174,8 +174,9 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list
$template->assign_block_vars('jumpbox_forums', array(
'FORUM_ID' => ($select_all) ? 0 : -1,
'FORUM_NAME' => ($select_all) ? $user->lang['ALL_FORUMS'] : $user->lang['SELECT_FORUM'],
- 'S_FORUM_COUNT' => $iteration)
- );
+ 'S_FORUM_COUNT' => $iteration,
+ 'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $forum_id)),
+ ));
$iteration++;
$display_jumpbox = true;
@@ -188,8 +189,9 @@ function make_jumpbox($action, $forum_id = false, $select_all = false, $acl_list
'S_FORUM_COUNT' => $iteration,
'S_IS_CAT' => ($row['forum_type'] == FORUM_CAT) ? true : false,
'S_IS_LINK' => ($row['forum_type'] == FORUM_LINK) ? true : false,
- 'S_IS_POST' => ($row['forum_type'] == FORUM_POST) ? true : false)
- );
+ 'S_IS_POST' => ($row['forum_type'] == FORUM_POST) ? true : false,
+ 'LINK' => $phpbb_path_helper->append_url_params($action, array('f' => $row['forum_id'])),
+ ));
for ($i = 0; $i < $padding; $i++)
{
@@ -1334,9 +1336,9 @@ function get_username_string($mode, $user_id, $username, $username_colour = '',
global $phpbb_root_path, $phpEx;
$_profile_cache['base_url'] = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=viewprofile&amp;u={USER_ID}');
- $_profile_cache['tpl_noprofile'] = '{USERNAME}';
+ $_profile_cache['tpl_noprofile'] = '<span class="username">{USERNAME}</span>';
$_profile_cache['tpl_noprofile_colour'] = '<span style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</span>';
- $_profile_cache['tpl_profile'] = '<a href="{PROFILE_URL}">{USERNAME}</a>';
+ $_profile_cache['tpl_profile'] = '<a href="{PROFILE_URL}" class="username">{USERNAME}</a>';
$_profile_cache['tpl_profile_colour'] = '<a href="{PROFILE_URL}" style="color: {USERNAME_COLOUR};" class="username-coloured">{USERNAME}</a>';
}
@@ -1452,16 +1454,19 @@ function get_username_string($mode, $user_id, $username, $username_colour = '',
/**
* Add an option to the quick-mod tools.
*
+ * @param string $url The recepting URL for the quickmod actions.
* @param string $option The language key for the value of the option.
* @param string $lang_string The language string to use.
*/
-function phpbb_add_quickmod_option($option, $lang_string)
+function phpbb_add_quickmod_option($url, $option, $lang_string)
{
- global $template, $user;
+ global $template, $user, $phpbb_path_helper;
+
$lang_string = $user->lang($lang_string);
$template->assign_block_vars('quickmod', array(
- 'VALUE' => $option,
- 'TITLE' => $lang_string,
+ 'VALUE' => $option,
+ 'TITLE' => $lang_string,
+ 'LINK' => $phpbb_path_helper->append_url_params($url, array('action' => $option)),
));
}
diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php
index 864a43c6e7..9d480692e9 100644
--- a/phpBB/includes/functions_convert.php
+++ b/phpBB/includes/functions_convert.php
@@ -1647,7 +1647,7 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting = ACL_NO)
switch ($sql_type)
{
case 'insert':
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mysql':
case 'mysql4':
@@ -2041,7 +2041,7 @@ function update_topics_posted()
{
global $db, $config;
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'sqlite':
case 'sqlite3':
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 5836d8816d..68b1356297 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -622,7 +622,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
'L_SUBFORUM' => ($visible_forums == 1) ? $user->lang['SUBFORUM'] : $user->lang['SUBFORUMS'],
'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'TOPICS_UNAPPROVED'),
- 'UNAPPROVED_POST_IMG' => $user->img('icon_topic_unapproved', 'POSTS_UNAPPROVED'),
+ 'UNAPPROVED_POST_IMG' => $user->img('icon_topic_unapproved', 'POSTS_UNAPPROVED_FORUM'),
));
if ($return_moderators)
diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php
index b5d1573d12..06f49e4b50 100644
--- a/phpBB/includes/functions_install.php
+++ b/phpBB/includes/functions_install.php
@@ -290,7 +290,7 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
switch ($dbms_details['DRIVER'])
{
case 'phpbb\db\driver\mysqli':
- if (version_compare(mysqli_get_server_info($db->db_connect_id), '4.1.3', '<'))
+ if (version_compare(mysqli_get_server_info($db->get_db_connect_id()), '4.1.3', '<'))
{
$error[] = $lang['INST_ERR_DB_NO_MYSQLI'];
}
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index d11193e4b0..d39be50251 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -1137,7 +1137,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
// Update log
$log_entry = ($ban_exclude) ? 'LOG_BAN_EXCLUDE_' : 'LOG_BAN_';
- // Add to moderator log, admin log and user notes
+ // Add to admin log, moderator log and user notes
add_log('admin', $log_entry . strtoupper($mode), $ban_reason, $ban_list_log);
add_log('mod', 0, 0, $log_entry . strtoupper($mode), $ban_reason, $ban_list_log);
if ($mode == 'user')
diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php
index 2945e1ec8a..92dcdb5499 100644
--- a/phpBB/includes/mcp/mcp_logs.php
+++ b/phpBB/includes/mcp/mcp_logs.php
@@ -115,7 +115,7 @@ class mcp_logs
if ($deletemark && sizeof($marked))
{
$conditions = array(
- 'forum_id' => $forum_list,
+ 'forum_id' => array('IN' => $forum_list),
'log_id' => array('IN' => $marked),
);
@@ -126,7 +126,7 @@ class mcp_logs
$keywords = utf8_normalize_nfc(request_var('keywords', '', true));
$conditions = array(
- 'forum_id' => $forum_list,
+ 'forum_id' => array('IN' => $forum_list),
'keywords' => $keywords,
);
diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php
index e81abd0c8e..1687409198 100644
--- a/phpBB/includes/mcp/mcp_post.php
+++ b/phpBB/includes/mcp/mcp_post.php
@@ -151,6 +151,7 @@ function mcp_post_details($id, $mode, $action)
if (sizeof($attachments))
{
+ $user->add_lang('viewtopic');
$update_count = array();
parse_attachments($post_info['forum_id'], $message, $attachments, $update_count);
}
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index 8d926ec70a..da27d8900d 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -1350,7 +1350,7 @@ class parse_message extends bbcode_firstpass
// NOTE: obtain_* function? chaching the table contents?
// For now setting the ttl to 10 minutes
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mssql':
case 'mssql_odbc':
diff --git a/phpBB/includes/questionnaire/questionnaire.php b/phpBB/includes/questionnaire/questionnaire.php
index b4b01a74bf..63ea432863 100644
--- a/phpBB/includes/questionnaire/questionnaire.php
+++ b/phpBB/includes/questionnaire/questionnaire.php
@@ -257,11 +257,12 @@ class phpbb_questionnaire_phpbb_data_provider
*/
function get_data()
{
- global $phpbb_root_path, $phpEx;
- include("{$phpbb_root_path}config.$phpEx");
+ global $phpbb_root_path, $phpEx, $phpbb_config_php_file;
+
+ extract($phpbb_config_php_file->get_all());
unset($dbhost, $dbport, $dbname, $dbuser, $dbpasswd); // Just a precaution
- $dbms = phpbb_convert_30_dbms_to_31($dbms);
+ $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);
// Only send certain config vars
$config_vars = array(
diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php
index fc568abc68..94383b935f 100644
--- a/phpBB/includes/ucp/ucp_pm_viewmessage.php
+++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php
@@ -85,7 +85,16 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
// Editing information
if ($message_row['message_edit_count'] && $config['display_last_edited'])
{
- $l_edited_by = '<br /><br />' . $user->lang('EDITED_TIMES_TOTAL', (int) $message_row['message_edit_count'], (!$message_row['message_edit_user']) ? $message_row['username'] : $message_row['message_edit_user'], $user->format_date($message_row['message_edit_time'], false, true));
+ if (!$message_row['message_edit_user'])
+ {
+ $display_username = get_username_string('full', $author_id, $user_info['username'], $user_info['user_colour']);
+ }
+ else
+ {
+ $edit_user_info = get_user_information($message_row['message_edit_user'], false);
+ $display_username = get_username_string('full', $message_row['message_edit_user'], $edit_user_info['username'], $edit_user_info['user_colour']);
+ }
+ $l_edited_by = '<br /><br />' . $user->lang('EDITED_TIMES_TOTAL', (int) $message_row['message_edit_count'], $display_username, $user->format_date($message_row['message_edit_time'], false, true));
}
else
{
@@ -204,6 +213,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
'AUTHOR_AVATAR' => (isset($user_info['avatar'])) ? $user_info['avatar'] : '',
'AUTHOR_JOINED' => $user->format_date($user_info['user_regdate']),
'AUTHOR_POSTS' => (int) $user_info['user_posts'],
+ 'CONTACT_USER' => $user->lang('CONTACT_USER', get_username_string('username', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username'])),
'ONLINE_IMG' => (!$config['load_onlinetrack']) ? '' : ((isset($user_info['online']) && $user_info['online']) ? $user->img('icon_user_online', $user->lang['ONLINE']) : $user->img('icon_user_offline', $user->lang['OFFLINE'])),
'S_ONLINE' => (!$config['load_onlinetrack']) ? false : ((isset($user_info['online']) && $user_info['online']) ? true : false),
diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php
index 35bb844170..df1e722fa4 100644
--- a/phpBB/includes/ucp/ucp_prefs.php
+++ b/phpBB/includes/ucp/ucp_prefs.php
@@ -115,7 +115,7 @@ class ucp_prefs
*
* @event core.ucp_prefs_personal_update_data
* @var array data Submitted display options data
- * @var array sql_ary Display options data we udpate
+ * @var array sql_ary Display options data we update
* @since 3.1.0-a1
*/
$vars = array('data', 'sql_ary');
@@ -294,7 +294,7 @@ class ucp_prefs
*
* @event core.ucp_prefs_view_update_data
* @var array data Submitted display options data
- * @var array sql_ary Display options data we udpate
+ * @var array sql_ary Display options data we update
* @since 3.1.0-a1
*/
$vars = array('data', 'sql_ary');
@@ -420,7 +420,7 @@ class ucp_prefs
*
* @event core.ucp_prefs_post_update_data
* @var array data Submitted display options data
- * @var array sql_ary Display options data we udpate
+ * @var array sql_ary Display options data we update
* @since 3.1.0-a1
*/
$vars = array('data', 'sql_ary');
@@ -451,6 +451,24 @@ class ucp_prefs
break;
}
+ /**
+ * Modify UCP preferences data before the page load
+ *
+ * @event core.ucp_prefs_modify_common
+ * @var array data Array with current/submitted UCP options data
+ * @var array error Errors data
+ * @var string mode UCP prefs operation mode
+ * @var string s_hidden_fields Hidden fields data
+ * @since 3.1.0-RC3
+ */
+ $vars = array(
+ 'data',
+ 'error',
+ 'mode',
+ 's_hidden_fields',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_modify_common', compact($vars)));
+
$template->assign_vars(array(
'L_TITLE' => $user->lang['UCP_PREFS_' . strtoupper($mode)],
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 5ba5f1e830..a315b167d7 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -393,8 +393,9 @@ class ucp_profile
}
$template->assign_vars(array(
- 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
- 'JABBER' => $data['jabber'],
+ 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
+ 'S_JABBER_ENABLED' => $config['jab_enable'],
+ 'JABBER' => $data['jabber'],
));
// Get additional profile fields and assign them to the template block var 'profile_fields'
diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php
index 6b6eabe57d..696075b07c 100644
--- a/phpBB/install/convertors/convert_phpbb20.php
+++ b/phpBB/install/convertors/convert_phpbb20.php
@@ -25,10 +25,11 @@ if (!defined('IN_PHPBB'))
exit;
}
-include($phpbb_root_path . 'config.' . $phpEx);
+$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);
+extract($phpbb_config_php_file->get_all());
unset($dbpasswd);
-$dbms = phpbb_convert_30_dbms_to_31($dbms);
+$dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);
/**
* $convertor_data provides some basic information about this convertor which is
@@ -37,7 +38,7 @@ $dbms = phpbb_convert_30_dbms_to_31($dbms);
$convertor_data = array(
'forum_name' => 'phpBB 2.0.x',
'version' => '1.0.3',
- 'phpbb_version' => '3.1.0-RC1',
+ 'phpbb_version' => '3.1.0-RC2',
'author' => '<a href="https://www.phpbb.com/">phpBB Limited</a>',
'dbms' => $dbms,
'dbhost' => $dbhost,
diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php
index 84e9e8c462..01447a6232 100644
--- a/phpBB/install/convertors/functions_phpbb20.php
+++ b/phpBB/install/convertors/functions_phpbb20.php
@@ -92,7 +92,7 @@ function phpbb_insert_forums()
$src_db->sql_query("SET NAMES 'utf8'");
}
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mssql':
case 'mssql_odbc':
@@ -289,7 +289,7 @@ function phpbb_insert_forums()
}
$src_db->sql_freeresult($result);
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'postgres':
$db->sql_query("SELECT SETVAL('" . FORUMS_TABLE . "_seq',(select case when max(forum_id)>0 then max(forum_id)+1 else 1 end from " . FORUMS_TABLE . '));');
@@ -1768,7 +1768,7 @@ function phpbb_create_userconv_table()
global $db, $src_db, $convert, $table_prefix, $user, $lang;
$map_dbms = '';
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mysql':
$map_dbms = 'mysql_40';
@@ -1796,7 +1796,7 @@ function phpbb_create_userconv_table()
break;
default:
- $map_dbms = $db->sql_layer;
+ $map_dbms = $db->get_sql_layer();
break;
}
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index c349d71563..c54c84cdbc 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -56,8 +56,14 @@ function phpbb_end_update($cache, $config)
}
require($phpbb_root_path . 'includes/startup.' . $phpEx);
+require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
+
+$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
+$phpbb_class_loader->register();
+
+$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);
+extract($phpbb_config_php_file->get_all());
-include($phpbb_root_path . 'config.' . $phpEx);
if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type))
{
die("Please read: <a href='../docs/INSTALL.html'>INSTALL.html</a> before attempting to update.");
@@ -68,13 +74,9 @@ $phpbb_adm_relative_path = (isset($phpbb_adm_relative_path)) ? $phpbb_adm_relati
$phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : $phpbb_root_path . $phpbb_adm_relative_path;
// Include files
-require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
-
require($phpbb_root_path . 'includes/functions.' . $phpEx);
require($phpbb_root_path . 'includes/functions_content.' . $phpEx);
-require($phpbb_root_path . 'includes/functions_container.' . $phpEx);
-require($phpbb_root_path . 'config.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
@@ -82,26 +84,12 @@ require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
// Set PHP error handler to ours
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
-// Setup class loader first
-$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
-$phpbb_class_loader->register();
-
// Set up container (must be done here because extensions table may not exist)
-$container_extensions = array(
- new \phpbb\di\extension\config($phpbb_root_path . 'config.' . $phpEx),
- new \phpbb\di\extension\core($phpbb_root_path . 'config/'),
-);
-$container_passes = array(
- new \phpbb\di\pass\collection_pass(),
-);
-$phpbb_container = phpbb_create_container($container_extensions, $phpbb_root_path, $phpEx);
-
-// Compile the container
-foreach ($container_passes as $pass)
-{
- $phpbb_container->addCompilerPass($pass);
-}
-$phpbb_container->compile();
+$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
+$phpbb_container_builder->set_use_extensions(false);
+$phpbb_container_builder->set_use_kernel_pass(false);
+$phpbb_container_builder->set_dump_container(false);
+$phpbb_container = $phpbb_container_builder->get_container();
// set up caching
$cache = $phpbb_container->get('cache');
@@ -176,7 +164,7 @@ header('Content-type: text/html; charset=UTF-8');
<br />
- <p><?php echo $user->lang['DATABASE_TYPE']; ?> :: <strong><?php echo $db->sql_layer; ?></strong><br />
+ <p><?php echo $user->lang['DATABASE_TYPE']; ?> :: <strong><?php echo $db->get_sql_layer(); ?></strong><br />
<?php echo $user->lang['PREVIOUS_VERSION']; ?> :: <strong><?php echo $config['version']; ?></strong><br />
<?php
diff --git a/phpBB/install/index.php b/phpBB/install/index.php
index bff7b75b18..d443c537fa 100644
--- a/phpBB/install/index.php
+++ b/phpBB/install/index.php
@@ -102,7 +102,6 @@ $phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : $phpbb_ro
phpbb_require_updated('phpbb/class_loader.' . $phpEx);
phpbb_require_updated('includes/functions.' . $phpEx);
-phpbb_require_updated('includes/functions_container.' . $phpEx);
phpbb_require_updated('includes/functions_content.' . $phpEx, true);
@@ -120,7 +119,29 @@ $phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/"
$phpbb_class_loader_ext->register();
// Set up container
-$phpbb_container = phpbb_create_install_container($phpbb_root_path, $phpEx);
+$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);
+$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
+$phpbb_container_builder->set_use_extensions(false);
+$phpbb_container_builder->set_dump_container(false);
+$phpbb_container_builder->set_use_custom_pass(false);
+$phpbb_container_builder->set_inject_config(false);
+$phpbb_container_builder->set_compile_container(false);
+
+$other_config_path = $phpbb_root_path . 'install/update/new/config/';
+$config_path = file_exists($other_config_path . 'services.yml') ? $other_config_path : $phpbb_root_path . 'config/';
+$phpbb_container_builder->set_config_path($config_path);
+
+$phpbb_container_builder->set_custom_parameters(array(
+ 'core.root_path' => $phpbb_root_path,
+ 'core.adm_relative_path' => $phpbb_adm_relative_path,
+ 'core.php_ext' => $phpEx,
+ 'core.table_prefix' => '',
+ 'cache.driver.class' => 'phpbb\cache\driver\file',
+));
+
+$phpbb_container = $phpbb_container_builder->get_container();
+$phpbb_container->register('dbal.conn.driver')->setSynthetic(true);
+$phpbb_container->compile();
$phpbb_class_loader->set_cache($phpbb_container->get('cache.driver'));
$phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver'));
@@ -688,7 +709,7 @@ class module
));
// Rollback if in transaction
- if ($db->transaction)
+ if ($db->get_transaction())
{
$db->sql_transaction('rollback');
}
diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php
index a0d5e802e6..17161b5eae 100644
--- a/phpBB/install/install_convert.php
+++ b/phpBB/install/install_convert.php
@@ -107,7 +107,7 @@ class install_convert extends module
function main($mode, $sub)
{
global $lang, $template, $phpbb_root_path, $phpEx, $cache, $config, $language, $table_prefix;
- global $convert, $request, $phpbb_container;
+ global $convert, $request, $phpbb_container, $phpbb_config_php_file;
$this->tpl_name = 'install_convert';
$this->mode = $mode;
@@ -127,7 +127,8 @@ class install_convert extends module
// Enable super globals to prevent issues with the new \phpbb\request\request object
$request->enable_super_globals();
// Create a normal container now
- $phpbb_container = phpbb_create_default_container($phpbb_root_path, $phpEx);
+ $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
+ $phpbb_container = $phpbb_container_builder->get_container();
// Create cache
$cache = $phpbb_container->get('cache');
@@ -135,11 +136,12 @@ class install_convert extends module
switch ($sub)
{
case 'intro':
- require($phpbb_root_path . 'config.' . $phpEx);
+ extract($phpbb_config_php_file->get_all());
+
require($phpbb_root_path . 'includes/constants.' . $phpEx);
require($phpbb_root_path . 'includes/functions_convert.' . $phpEx);
- $dbms = phpbb_convert_30_dbms_to_31($dbms);
+ $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);
$db = new $dbms();
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, true);
@@ -224,11 +226,12 @@ class install_convert extends module
// This is for making sure the session get not screwed due to the 3.0.x users table being completely new.
$cache->purge();
- require($phpbb_root_path . 'config.' . $phpEx);
+ extract($phpbb_config_php_file->get_all());
+
require($phpbb_root_path . 'includes/constants.' . $phpEx);
require($phpbb_root_path . 'includes/functions_convert.' . $phpEx);
- $dbms = phpbb_convert_30_dbms_to_31($dbms);
+ $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);
$db = new $dbms();
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, true);
@@ -248,7 +251,7 @@ class install_convert extends module
));
}
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'sqlite':
case 'sqlite3':
@@ -370,13 +373,14 @@ class install_convert extends module
*/
function get_convert_settings($sub)
{
- global $lang, $language, $template, $db, $phpbb_root_path, $phpEx, $config, $cache;
+ global $lang, $language, $template, $db, $phpbb_root_path, $phpEx, $config, $cache, $phpbb_config_php_file;
+
+ extract($phpbb_config_php_file->get_all());
- require($phpbb_root_path . 'config.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
require($phpbb_root_path . 'includes/functions_convert.' . $phpEx);
- $dbms = phpbb_convert_30_dbms_to_31($dbms);
+ $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);
$db = new $dbms();
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, true);
@@ -458,7 +462,8 @@ class install_convert extends module
{
$error[] = sprintf($lang['TABLE_PREFIX_SAME'], $src_table_prefix);
}
- $src_dbms = phpbb_convert_30_dbms_to_31($src_dbms);
+
+ $src_dbms = $phpbb_config_php_file->convert_30_dbms_to_31($src_dbms);
// Check table prefix
if (!sizeof($error))
@@ -614,13 +619,14 @@ class install_convert extends module
{
global $template, $user, $phpbb_root_path, $phpEx, $db, $lang, $config, $cache, $auth;
global $convert, $convert_row, $message_parser, $skip_rows, $language;
- global $request;
+ global $request, $phpbb_config_php_file;
+
+ extract($phpbb_config_php_file->get_all());
- require($phpbb_root_path . 'config.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
require($phpbb_root_path . 'includes/functions_convert.' . $phpEx);
- $dbms = phpbb_convert_30_dbms_to_31($dbms);
+ $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);
$db = new $dbms();
$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, true);
@@ -727,7 +733,7 @@ class install_convert extends module
$src_db->sql_query("SET NAMES 'binary'");
}
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'sqlite':
case 'sqlite3':
@@ -1129,7 +1135,7 @@ class install_convert extends module
if (!empty($schema['autoincrement']))
{
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'postgres':
$db->sql_query("SELECT SETVAL('" . $schema['target'] . "_seq',(select case when max(" . $schema['autoincrement'] . ")>0 then max(" . $schema['autoincrement'] . ")+1 else 1 end from " . $schema['target'] . '));');
@@ -1268,7 +1274,7 @@ class install_convert extends module
if (!empty($schema['autoincrement']))
{
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mssql':
case 'mssql_odbc':
@@ -1301,7 +1307,7 @@ class install_convert extends module
if ($sql_flag === true)
{
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
// If MySQL, we'll wait to have num_wait_rows rows to submit at once
case 'mysql':
@@ -1396,7 +1402,7 @@ class install_convert extends module
if (!empty($schema['autoincrement']))
{
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'mssql':
case 'mssql_odbc':
@@ -1635,7 +1641,7 @@ class install_convert extends module
'RESULT' => $user->lang['DONE'],
));
- if ($db->sql_error_triggered)
+ if ($db->get_sql_error_triggered())
{
$template->assign_vars(array(
'S_ERROR_BOX' => true,
@@ -1808,7 +1814,7 @@ class install_convert extends module
global $convert;
// Can we use IGNORE with this DBMS?
- $sql_ignore = (strpos($db->sql_layer, 'mysql') === 0 && !defined('DEBUG')) ? 'IGNORE ' : '';
+ $sql_ignore = (strpos($db->get_sql_layer(), 'mysql') === 0 && !defined('DEBUG')) ? 'IGNORE ' : '';
$insert_query = 'INSERT ' . $sql_ignore . 'INTO ' . $schema['target'] . ' (';
$aliases = array();
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index 5f8c0c277c..b82df84a00 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -51,7 +51,7 @@ class install_install extends module
function main($mode, $sub)
{
global $lang, $template, $language, $phpbb_root_path, $phpEx;
- global $phpbb_container, $cache, $phpbb_log, $request;
+ global $phpbb_container, $cache, $phpbb_log, $request, $phpbb_config_php_file;
switch ($sub)
{
@@ -104,7 +104,8 @@ class install_install extends module
$request->enable_super_globals();
// Create a normal container now
- $phpbb_container = phpbb_create_default_container($phpbb_root_path, $phpEx);
+ $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
+ $phpbb_container = $phpbb_container_builder->get_container();
// Sets the global variables
$cache = $phpbb_container->get('cache');
@@ -1532,10 +1533,10 @@ class install_install extends module
$_module->update_module_data($module_data, true);
// Check for last sql error happened
- if ($db->sql_error_triggered)
+ if ($db->get_sql_error_triggered())
{
- $error = $db->sql_error($db->sql_error_sql);
- $this->p_master->db_error($error['message'], $db->sql_error_sql, __LINE__, __FILE__);
+ $error = $db->sql_error($db->get_sql_error_sql());
+ $this->p_master->db_error($error['message'], $db->get_sql_error_sql(), __LINE__, __FILE__);
}
$categories[$cat_name]['id'] = (int) $module_data['module_id'];
@@ -1566,10 +1567,10 @@ class install_install extends module
$_module->update_module_data($module_data, true);
// Check for last sql error happened
- if ($db->sql_error_triggered)
+ if ($db->get_sql_error_triggered())
{
- $error = $db->sql_error($db->sql_error_sql);
- $this->p_master->db_error($error['message'], $db->sql_error_sql, __LINE__, __FILE__);
+ $error = $db->sql_error($db->get_sql_error_sql());
+ $this->p_master->db_error($error['message'], $db->get_sql_error_sql(), __LINE__, __FILE__);
}
$categories[$level2_name]['id'] = (int) $module_data['module_id'];
@@ -1606,10 +1607,10 @@ class install_install extends module
$_module->update_module_data($module_data, true);
// Check for last sql error happened
- if ($db->sql_error_triggered)
+ if ($db->get_sql_error_triggered())
{
- $error = $db->sql_error($db->sql_error_sql);
- $this->p_master->db_error($error['message'], $db->sql_error_sql, __LINE__, __FILE__);
+ $error = $db->sql_error($db->get_sql_error_sql());
+ $this->p_master->db_error($error['message'], $db->get_sql_error_sql(), __LINE__, __FILE__);
}
}
}
@@ -1772,10 +1773,10 @@ class install_install extends module
$_module->update_module_data($module_data, true);
// Check for last sql error happened
- if ($db->sql_error_triggered)
+ if ($db->get_sql_error_triggered())
{
- $error = $db->sql_error($db->sql_error_sql);
- $this->p_master->db_error($error['message'], $db->sql_error_sql, __LINE__, __FILE__);
+ $error = $db->sql_error($db->get_sql_error_sql());
+ $this->p_master->db_error($error['message'], $db->get_sql_error_sql(), __LINE__, __FILE__);
}
}
}
@@ -1824,10 +1825,10 @@ class install_install extends module
$db->sql_query('INSERT INTO ' . LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $lang_pack));
$installed_languages[] = (int) $db->sql_nextid();
- if ($db->sql_error_triggered)
+ if ($db->get_sql_error_triggered())
{
- $error = $db->sql_error($db->sql_error_sql);
- $this->p_master->db_error($error['message'], $db->sql_error_sql, __LINE__, __FILE__);
+ $error = $db->sql_error($db->get_sql_error_sql());
+ $this->p_master->db_error($error['message'], $db->get_sql_error_sql(), __LINE__, __FILE__);
}
}
}
@@ -1913,7 +1914,7 @@ class install_install extends module
if (!$user_id)
{
// If we can't insert this user then continue to the next one to avoid inconsistent data
- $this->p_master->db_error('Unable to insert bot into users table', $db->sql_error_sql, __LINE__, __FILE__, true);
+ $this->p_master->db_error('Unable to insert bot into users table', $db->get_sql_error_sql(), __LINE__, __FILE__, true);
continue;
}
diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php
index ab5fcc3f2b..28777a8d24 100644
--- a/phpBB/install/install_update.php
+++ b/phpBB/install/install_update.php
@@ -66,7 +66,7 @@ class install_update extends module
function main($mode, $sub)
{
global $template, $phpEx, $phpbb_root_path, $user, $db, $config, $cache, $auth, $language;
- global $request, $phpbb_admin_path, $phpbb_adm_relative_path, $phpbb_container;
+ global $request, $phpbb_admin_path, $phpbb_adm_relative_path, $phpbb_container, $phpbb_config_php_file;
// We must enable super globals, otherwise creating a new instance of the request class,
// using the new container with a dbal connection will fail with the following PHP Notice:
@@ -74,14 +74,14 @@ class install_update extends module
$request->enable_super_globals();
// Create a normal container now
+ $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
+ $phpbb_container_builder->set_dump_container(false);
+ $phpbb_container_builder->set_use_extensions(false);
if (file_exists($phpbb_root_path . 'install/update/new/config'))
{
- $phpbb_container = phpbb_create_update_container($phpbb_root_path, $phpEx, $phpbb_root_path . 'install/update/new/config');
- }
- else
- {
- $phpbb_container = phpbb_create_update_container($phpbb_root_path, $phpEx, $phpbb_root_path . 'config');
+ $phpbb_container_builder->set_config_path($phpbb_root_path . 'install/update/new/config');
}
+ $phpbb_container = $phpbb_container_builder->get_container();
// Writes into global $cache
$cache = $phpbb_container->get('cache');
@@ -93,7 +93,7 @@ class install_update extends module
$this->new_location = $phpbb_root_path . 'install/update/new/';
// Init DB
- require($phpbb_root_path . 'config.' . $phpEx);
+ extract($phpbb_config_php_file->get_all());
require($phpbb_root_path . 'includes/constants.' . $phpEx);
// Special options for conflicts/modified files
@@ -102,7 +102,7 @@ class install_update extends module
define('MERGE_NEW_FILE', 3);
define('MERGE_MOD_FILE', 4);
- $dbms = phpbb_convert_30_dbms_to_31($dbms);
+ $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);
$db = new $dbms();
@@ -396,7 +396,7 @@ class install_update extends module
'S_COLLECTED' => (int) $update_list['status'],
'S_TO_COLLECT' => sizeof($this->update_info['files']),
'L_IN_PROGRESS' => $user->lang['COLLECTING_FILE_DIFFS'],
- 'L_IN_PROGRESS_EXPLAIN' => sprintf($user->lang['NUMBER_OF_FILES_COLLECTED'], (int) $update_list['status'], sizeof($this->update_info['files'])),
+ 'L_IN_PROGRESS_EXPLAIN' => sprintf($user->lang['NUMBER_OF_FILES_COLLECTED'], (int) $update_list['status'], sizeof($this->update_info['files']) + sizeof($this->update_info['deleted'])),
));
return;
@@ -422,7 +422,7 @@ class install_update extends module
// Now assign the list to the template
foreach ($update_list as $status => $filelist)
{
- if ($status == 'no_update' || !sizeof($filelist) || $status == 'status')
+ if ($status == 'no_update' || !sizeof($filelist) || $status == 'status' || $status == 'status_deleted')
{
continue;
}
@@ -489,7 +489,7 @@ class install_update extends module
$all_up_to_date = true;
foreach ($update_list as $status => $filelist)
{
- if ($status != 'up_to_date' && $status != 'custom' && $status != 'status' && sizeof($filelist))
+ if ($status != 'up_to_date' && $status != 'custom' && $status != 'status' && $status != 'status_deleted' && sizeof($filelist))
{
$all_up_to_date = false;
break;
@@ -831,7 +831,7 @@ class install_update extends module
foreach ($update_list as $status => $files)
{
- if ($status == 'up_to_date' || $status == 'no_update' || $status == 'status')
+ if ($status == 'up_to_date' || $status == 'no_update' || $status == 'status' || $status == 'status_deleted')
{
continue;
}
@@ -1221,6 +1221,16 @@ class install_update extends module
$this->page_title = 'VIEWING_FILE_CONTENTS';
break;
+
+ case 'deleted':
+
+ $diff = $this->return_diff(array(), $phpbb_root_path . $original_file);
+
+ $template->assign_var('S_DIFF_NEW_FILE', true);
+ $diff_mode = 'inline';
+ $this->page_title = 'VIEWING_FILE_CONTENTS';
+
+ break;
}
$diff_mode_options = '';
@@ -1266,7 +1276,9 @@ class install_update extends module
'new_conflict' => array(),
'conflict' => array(),
'no_update' => array(),
+ 'deleted' => array(),
'status' => 0,
+ 'status_deleted'=> 0,
);
}
@@ -1345,7 +1357,31 @@ class install_update extends module
$update_list['status']++;
}
+ foreach ($this->update_info['deleted'] as $index => $file)
+ {
+ if (is_int($update_list['status_deleted']) && $index < $update_list['status_deleted'])
+ {
+ continue;
+ }
+
+ if ($num_bytes_processed >= 500 * 1024)
+ {
+ return;
+ }
+
+ if (file_exists($phpbb_root_path . $file))
+ {
+ $update_list['deleted'][] = array('filename' => $file, 'custom' => false, 'as_expected' => false);
+ $num_bytes_processed += filesize($phpbb_root_path . $file);
+ }
+
+ $update_list['status_deleted']++;
+ $update_list['status']++;
+ }
+
+ $update_list['status_deleted'] = -1;
$update_list['status'] = -1;
+
/* if (!sizeof($this->update_info['files']))
{
return $update_list;
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index 572720ff95..9cc151f728 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -273,7 +273,7 @@ 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 ('use_system_cron', '0');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.1.0-RC2-dev');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.1.0-RC3-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');
diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php
index 638e9907ac..d451bdd515 100644
--- a/phpBB/language/en/acp/board.php
+++ b/phpBB/language/en/acp/board.php
@@ -524,8 +524,8 @@ $lang = array_merge($lang, array(
'PASS_TYPE_SYMBOL' => 'Must contain symbols',
'REF_HOST' => 'Only validate host',
'REF_PATH' => 'Also validate path',
- 'REFERER_VALID' => 'Validate Referer',
- 'REFERER_VALID_EXPLAIN' => 'If enabled, the referer of POST requests will be checked against the host/script path settings. This may cause issues with boards using several domains and or external logins.',
+ 'REFERRER_VALID' => 'Validate Referrer',
+ 'REFERRER_VALID_EXPLAIN' => 'If enabled, the referrer of POST requests will be checked against the host/script path settings. This may cause issues with boards using several domains and or external logins.',
'TPL_ALLOW_PHP' => 'Allow php in templates',
'TPL_ALLOW_PHP_EXPLAIN' => 'If this option is enabled, <code>PHP</code> and <code>INCLUDEPHP</code> statements will be recognised and parsed in templates.',
));
diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php
index 8470014161..91fc1215fc 100644
--- a/phpBB/language/en/acp/common.php
+++ b/phpBB/language/en/acp/common.php
@@ -225,12 +225,6 @@ $lang = array_merge($lang, array(
'BACK' => 'Back',
- 'CLI_DESCRIPTION_CRON_LIST' => 'Prints a list of ready and unready cron jobs.',
- 'CLI_DESCRIPTION_CRON_RUN' => 'Runs all ready cron tasks.',
- 'CLI_DESCRIPTION_CRON_RUN_ARGUMENT_1' => 'Name of the task to be run',
-
- 'CLI_DESCRIPTION_OPTION_SHELL' => 'Launch the shell.',
-
'COLOUR_SWATCH' => 'Web-safe colour swatch',
'CONFIG_UPDATED' => 'Configuration updated successfully.',
'CRON_LOCK_ERROR' => 'Could not obtain cron lock.',
@@ -247,7 +241,7 @@ $lang = array_merge($lang, array(
'DOWNLOAD_AS' => 'Download as',
'DOWNLOAD_STORE' => 'Download or store file',
'DOWNLOAD_STORE_EXPLAIN' => 'You may directly download the file or save it in your <samp>store/</samp> folder.',
- 'DOWNLOADS' => 'Downloads',
+ 'DOWNLOADS' => 'Downloads',
'EDIT' => 'Edit',
'ENABLE' => 'Enable',
@@ -310,7 +304,7 @@ $lang = array_merge($lang, array(
'TASKS_NOT_READY' => 'Not ready tasks:',
'TASKS_READY' => 'Ready tasks:',
- 'TOTAL_SIZE' => 'Total size',
+ 'TOTAL_SIZE' => 'Total size',
'UCP' => 'User Control Panel',
'USERNAMES_EXPLAIN' => 'Place each username on a separate line.',
@@ -702,7 +696,7 @@ $lang = array_merge($lang, array(
'LOG_REASON_REMOVED' => '<strong>Removed report/denial reason</strong><br />» %s',
'LOG_REASON_UPDATED' => '<strong>Updated report/denial reason</strong><br />» %s',
- 'LOG_REFERER_INVALID' => '<strong>Referer validation failed</strong><br />»Referer was “<em>%1$s</em>”. The request was rejected and the session killed.',
+ 'LOG_REFERER_INVALID' => '<strong>Referrer validation failed</strong><br />»Referrer was “<em>%1$s</em>”. The request was rejected and the session killed.',
'LOG_RESET_DATE' => '<strong>Board start date reset</strong>',
'LOG_RESET_ONLINE' => '<strong>Most users online reset</strong>',
'LOG_RESYNC_FILES_STATS' => '<strong>File statistics resynchronised</strong>',
diff --git a/phpBB/language/en/acp/forums.php b/phpBB/language/en/acp/forums.php
index b4f0f060e9..541d05c255 100644
--- a/phpBB/language/en/acp/forums.php
+++ b/phpBB/language/en/acp/forums.php
@@ -44,6 +44,10 @@ $lang = array_merge($lang, array(
'AUTO_PRUNE_FREQ_EXPLAIN' => 'Time in days between pruning events.',
'AUTO_PRUNE_VIEWED' => 'Auto-prune post viewed age',
'AUTO_PRUNE_VIEWED_EXPLAIN' => 'Number of days since topic was viewed after which topic is removed.',
+ 'AUTO_PRUNE_SHADOW_FREQ' => 'Auto-prune shadow topics frequency',
+ 'AUTO_PRUNE_SHADOW_DAYS' => 'Auto-prune shadow topics age',
+ 'AUTO_PRUNE_SHADOW_DAYS_EXPLAIN' => 'Number of days after which shadow topic is removed.',
+ 'AUTO_PRUNE_SHADOW_FREQ_EXPLAIN' => 'Time in days between pruning events.',
'CONTINUE' => 'Continue',
'COPY_PERMISSIONS' => 'Copy permissions from',
diff --git a/phpBB/language/en/acp/search.php b/phpBB/language/en/acp/search.php
index f5bec89c2f..564d9dd04c 100644
--- a/phpBB/language/en/acp/search.php
+++ b/phpBB/language/en/acp/search.php
@@ -60,7 +60,6 @@ $lang = array_merge($lang, array(
'FULLTEXT_MYSQL_MAX_SEARCH_CHARS_EXPLAIN' => 'Words with no more than this many characters will be indexed for searching. You or your host can only change this setting by changing the mysql configuration.',
'FULLTEXT_POSTGRES_INCOMPATIBLE_DATABASE' => 'The PostgreSQL fulltext backend can only be used with PostgreSQL.',
- 'FULLTEXT_POSTGRES_TS_NOT_USABLE' => 'The PostgreSQL fulltext backend can only be used with PostgreSQL 8.3 and above.',
'FULLTEXT_POSTGRES_TOTAL_POSTS' => 'Total number of indexed posts',
'FULLTEXT_POSTGRES_VERSION_CHECK' => 'PostgreSQL version',
'FULLTEXT_POSTGRES_TS_NAME' => 'Text search Configuration Profile:',
diff --git a/phpBB/language/en/cli.php b/phpBB/language/en/cli.php
new file mode 100644
index 0000000000..e9eb26b154
--- /dev/null
+++ b/phpBB/language/en/cli.php
@@ -0,0 +1,44 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+/**
+* DO NOT CHANGE
+*/
+if (empty($lang) || !is_array($lang))
+{
+ $lang = array();
+}
+
+// DEVELOPERS PLEASE NOTE
+//
+// Placeholders can now contain order information, e.g. instead of
+// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
+// translators to re-order the output of data while ensuring it remains correct
+//
+// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
+// equally where a string contains only two placeholders which are used to wrap text
+// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
+
+$lang = array_merge($lang, array(
+ 'CLI_DESCRIPTION_CRON_LIST' => 'Prints a list of ready and unready cron jobs.',
+ 'CLI_DESCRIPTION_CRON_RUN' => 'Runs all ready cron tasks.',
+ 'CLI_DESCRIPTION_CRON_RUN_ARGUMENT_1' => 'Name of the task to be run',
+
+ 'CLI_DESCRIPTION_OPTION_SHELL' => 'Launch the shell.',
+ 'CLI_DESCRIPTION_OPTION_SAFE_MODE' => 'Run in Safe Mode (without extensions).',
+));
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index b9eb0fd11d..a58aec43cd 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -64,7 +64,7 @@ $lang = array_merge($lang, array(
'ACCOUNT_DEACTIVATED' => 'Your account has been manually deactivated and is only able to be reactivated by an administrator.',
'ACCOUNT_NOT_ACTIVATED' => 'Your account has not been activated yet.',
'ACP' => 'Administration Control Panel',
- 'ACP_SHORT' => 'Administer',
+ 'ACP_SHORT' => 'ACP',
'ACTIVE' => 'active',
'ACTIVE_ERROR' => 'The specified username is currently inactive. If you have problems activating your account, please contact a board administrator.',
'ADMINISTRATOR' => 'Administrator',
@@ -299,7 +299,7 @@ $lang = array_merge($lang, array(
1 => 'There is %d guest user online',
2 => 'There are %d guest users online',
),
- 'GUEST_USERS_TOTAL' => array(
+ 'GUEST_USERS_TOTAL' => array(
1 => '%d guest',
2 => '%d guests',
),
@@ -393,7 +393,7 @@ $lang = array_merge($lang, array(
'MB' => 'MB',
'MIB' => 'MiB',
'MCP' => 'Moderator Control Panel',
- 'MCP_SHORT' => 'Moderate',
+ 'MCP_SHORT' => 'MCP',
'MEMBERLIST' => 'Members',
'MEMBERLIST_EXPLAIN' => 'View complete list of members',
'MERGE' => 'Merge',
@@ -462,7 +462,7 @@ $lang = array_merge($lang, array(
'NOTIFICATION_REASON' => '<em>Reason:</em> %1$s.',
'NOTIFICATION_REPORT_PM' => '<strong>Private Message reported</strong> by %1$s:',
'NOTIFICATION_REPORT_POST' => '<strong>Post reported</strong> by %1$s:',
- 'NOTIFICATION_REPORT_CLOSED' => '<strong>Report closed</strong> by %1$s for:',
+ 'NOTIFICATION_REPORT_CLOSED' => '<strong>Report closed</strong> by %1$s for:',
'NOTIFICATION_TOPIC' => '<strong>New topic</strong> by %1$s:',
'NOTIFICATION_TOPIC_APPROVED' => '<strong>Topic approved</strong>:',
'NOTIFICATION_TOPIC_DISAPPROVED' => '<strong>Topic disapproved</strong>:',
@@ -564,6 +564,7 @@ $lang = array_merge($lang, array(
'POSTED_ON_DATE' => 'on',
'POSTS' => 'Posts',
'POSTS_UNAPPROVED' => 'At least one post in this topic has not been approved.',
+ 'POSTS_UNAPPROVED_FORUM'=> 'At least one post in this forum has not been approved.',
'POST_BY_AUTHOR' => 'by',
'POST_BY_FOE' => '<strong>%1$s</strong>, who is currently on your ignore list, made this post.',
'POST_DISPLAY' => '%1$sDisplay this post%2$s.',
@@ -594,6 +595,8 @@ $lang = array_merge($lang, array(
'PRIVATE_MESSAGING' => 'Private messaging',
'PROFILE' => 'User Control Panel',
+ 'QUICK_LINKS' => 'Quick links',
+
'RANK' => 'Rank',
'READING_FORUM' => 'Viewing topics in %s',
'READING_GLOBAL_ANNOUNCE' => 'Reading global announcement',
@@ -660,15 +663,15 @@ $lang = array_merge($lang, array(
'SEARCH_ADV_EXPLAIN' => 'View the advanced search options',
'SEARCH_KEYWORDS' => 'Search for keywords',
'SEARCHING_FORUMS' => 'Searching forums',
- 'SEARCH_ACTIVE_TOPICS' => 'View active topics',
+ 'SEARCH_ACTIVE_TOPICS' => 'Active topics',
'SEARCH_FOR' => 'Search for',
'SEARCH_FORUM' => 'Search this forum…',
- 'SEARCH_NEW' => 'View new posts',
+ 'SEARCH_NEW' => 'New posts',
'SEARCH_POSTS_BY' => 'Search posts by',
- 'SEARCH_SELF' => 'View your posts',
+ 'SEARCH_SELF' => 'Your posts',
'SEARCH_TOPIC' => 'Search this topic…',
- 'SEARCH_UNANSWERED' => 'View unanswered posts',
- 'SEARCH_UNREAD' => 'View unread posts',
+ 'SEARCH_UNANSWERED' => 'Unanswered posts',
+ 'SEARCH_UNREAD' => 'Unread posts',
'SEARCH_USER_POSTS' => 'Search user’s posts',
'SECONDS' => 'Seconds',
'SEE_ALL' => 'See All',
@@ -818,6 +821,7 @@ $lang = array_merge($lang, array(
1 => 'Viewed %d time',
2 => 'Viewed %d times',
),
+ 'VIEWING_CONTACT_ADMIN' => 'Viewing contact page',
'VIEWING_FAQ' => 'Viewing FAQ',
'VIEWING_MEMBERS' => 'Viewing member details',
'VIEWING_ONLINE' => 'Viewing who is online',
diff --git a/phpBB/language/en/help_faq.php b/phpBB/language/en/help_faq.php
index 102dffcd5b..904dc92080 100644
--- a/phpBB/language/en/help_faq.php
+++ b/phpBB/language/en/help_faq.php
@@ -121,7 +121,7 @@ $help = array(
),
array(
0 => 'How do I add a signature to my post?',
- 1 => 'To add a signature to a post you must first create one via your User Control Panel. Once created, you can check the <em>Attach a signature</em> box on the posting form to add your signature. You can also add a signature by default to all your posts by checking the appropriate radio button in your profile. If you do so, you can still prevent a signature being added to individual posts by un-checking the add signature box within the posting form.'
+ 1 => 'To add a signature to a post you must first create one via your User Control Panel. Once created, you can check the <em>Attach a signature</em> box on the posting form to add your signature. You can also add a signature by default to all your posts by checking the appropriate radio button in the User Control Panel. If you do so, you can still prevent a signature being added to individual posts by un-checking the add signature box within the posting form.'
),
array(
0 => 'How do I create a poll?',
@@ -153,7 +153,7 @@ $help = array(
),
array(
0 => 'What is the “Save” button for in topic posting?',
- 1 => 'This allows you to save passages to be completed and submitted at a later date. To reload a saved passage, visit the User Control Panel.'
+ 1 => 'This allows you to save drafts to be completed and submitted at a later date. To reload a saved draft, visit the User Control Panel.'
),
array(
0 => 'Why does my post need to be approved?',
@@ -254,7 +254,7 @@ $help = array(
),
array(
0 => 'I keep getting unwanted private messages!',
- 1 => 'You can block a user from sending you private messages by using message rules within your User Control Panel. If you are receiving abusive private messages from a particular user, inform a board administrator; they have the power to prevent a user from sending private messages.'
+ 1 => 'You can automatically delete private messages from a user by using message rules within your User Control Panel. If you are receiving abusive private messages from a particular user, report the messages to the moderators; they have the power to prevent a user from sending private messages.'
),
array(
0 => 'I have received a spamming or abusive email from someone on this board!',
diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php
index 2b7f377f5b..a2b27f0a60 100644
--- a/phpBB/language/en/install.php
+++ b/phpBB/language/en/install.php
@@ -291,8 +291,8 @@ $lang = array_merge($lang, array(
'PCRE_UTF_SUPPORT_EXPLAIN' => 'phpBB will <strong>not</strong> run if your PHP installation is not compiled with UTF-8 support in the PCRE extension.',
'PHP_GETIMAGESIZE_SUPPORT' => 'PHP function getimagesize() is available',
'PHP_GETIMAGESIZE_SUPPORT_EXPLAIN' => '<strong>Required</strong> - In order for phpBB to function correctly, the getimagesize function needs to be available.',
- 'PHP_JSON_SUPPORT' => 'PHP JSON support',
- 'PHP_JSON_SUPPORT_EXPLAIN' => '<strong>Required</strong> - In order for phpBB to function correctly, the PHP JSON extension needs to be available.',
+ 'PHP_JSON_SUPPORT' => 'PHP JSON support',
+ 'PHP_JSON_SUPPORT_EXPLAIN' => '<strong>Required</strong> - In order for phpBB to function correctly, the PHP JSON extension needs to be available.',
'PHP_OPTIONAL_MODULE' => 'Optional modules',
'PHP_OPTIONAL_MODULE_EXPLAIN' => '<strong>Optional</strong> - These modules or applications are optional. However, if they are available they will enable extra features.',
'PHP_SUPPORTED_DB' => 'Supported databases',
@@ -345,7 +345,7 @@ $lang = array_merge($lang, array(
'SUB_LICENSE' => 'License',
'SUB_SUPPORT' => 'Support',
'SUCCESSFUL_CONNECT' => 'Successful connection',
- 'SUPPORT_BODY' => 'Full support will be provided for the current stable release of phpBB3, free of charge. This includes:</p><ul><li>installation</li><li>configuration</li><li>technical questions</li><li>problems relating to potential bugs in the software</li><li>updating from Release Candidate (RC) versions to the latest stable version</li><li>converting from phpBB 2.0.x to phpBB3</li><li>converting from other discussion board software to phpBB3 (please see the <a href="https://www.phpbb.com/community/viewforum.php?f=65">Convertors Forum</a>)</li></ul><p>We encourage users still running beta versions of phpBB3 to replace their installation with a fresh copy of the latest version.</p><h2>MODs / Styles</h2><p>For issues relating to MODs, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=81">Modifications Forum</a>.<br />For issues relating to styles, templates and themes, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=80">Styles Forum</a>.<br /><br />If your question relates to a specific package, please post directly in the topic dedicated to the package.</p><h2>Obtaining Support</h2><p><a href="https://www.phpbb.com/community/viewtopic.php?f=14&amp;t=571070">The phpBB Welcome Package</a><br /><a href="https://www.phpbb.com/support/">Support Section</a><br /><a href="https://www.phpbb.com/support/documentation/3.0/quickstart/">Quick Start Guide</a><br /><br />To ensure you stay up to date with the latest news and releases, why not <a href="https://www.phpbb.com/support/">subscribe to our mailing list</a>?<br /><br />',
+ 'SUPPORT_BODY' => 'Full support will be provided for the current stable release of phpBB3, free of charge. This includes:</p><ul><li>installation</li><li>configuration</li><li>technical questions</li><li>problems relating to potential bugs in the software</li><li>updating from Release Candidate (RC) versions to the latest stable version</li><li>converting from phpBB 2.0.x to phpBB3</li><li>converting from other discussion board software to phpBB3 (please see the <a href="https://www.phpbb.com/community/viewforum.php?f=486">Convertors Forum</a>)</li></ul><p>We encourage users still running beta versions of phpBB3 to replace their installation with a fresh copy of the latest version.</p><h2>Extensions / Styles</h2><p>For issues relating to Extensions, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=451">Extensions Forum</a>.<br />For issues relating to styles, templates and themes, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=471">Styles Forum</a>.<br /><br />If your question relates to a specific package, please post directly in the topic dedicated to the package.</p><h2>Obtaining Support</h2><p><a href="https://www.phpbb.com/community/viewtopic.php?f=14&amp;t=571070">The phpBB Welcome Package</a><br /><a href="https://www.phpbb.com/support/">Support Section</a><br /><a href="https://www.phpbb.com/support/documentation/3.1/quickstart/">Quick Start Guide</a><br /><br />To ensure you stay up to date with the latest news and releases, why not <a href="https://www.phpbb.com/support/">subscribe to our mailing list</a>?<br /><br />',
'SYNC_FORUMS' => 'Starting to synchronise forums',
'SYNC_POST_COUNT' => 'Synchronising post_counts',
'SYNC_POST_COUNT_ID' => 'Synchronising post_counts from <var>entry</var> %1$s to %2$s.',
@@ -427,6 +427,8 @@ $lang = array_merge($lang, array(
'FILE_USED' => 'Information used from', // Single file
'FILES_CONFLICT' => 'Conflict files',
'FILES_CONFLICT_EXPLAIN' => 'The following files are modified and do not represent the original files from the old version. phpBB determined that these files create conflicts if they are tried to be merged. Please investigate the conflicts and try to manually resolve them or continue the update choosing the preferred merging method. If you resolve the conflicts manually check the files again after you modified them. You are also able to choose between the preferred merge method for every file. The first one will result in a file where the conflicting lines from your old file will be lost, the other one will result in losing the changes from the newer file.',
+ 'FILES_DELETED' => 'Deleted files',
+ 'FILES_DELETED_EXPLAIN' => 'The following files do not exist in the new version. These files have to be deleted from your installation.',
'FILES_MODIFIED' => 'Modified files',
'FILES_MODIFIED_EXPLAIN' => 'The following files are modified and do not represent the original files from the old version. The updated file will be a merge between your modifications and the new file.',
'FILES_NEW' => 'New files',
@@ -497,6 +499,7 @@ $lang = array_merge($lang, array(
'SELECT_DOWNLOAD_FORMAT' => 'Select download archive format',
'SELECT_FTP_SETTINGS' => 'Select FTP settings',
'SHOW_DIFF_CONFLICT' => 'Show differences/conflicts',
+ 'SHOW_DIFF_DELETED' => 'Show file contents',
'SHOW_DIFF_FINAL' => 'Show resulting file',
'SHOW_DIFF_MODIFIED' => 'Show merged differences',
'SHOW_DIFF_NEW' => 'Show file contents',
@@ -510,6 +513,7 @@ $lang = array_merge($lang, array(
'STAGE_UPDATE_FILES' => 'Update files',
'STAGE_VERSION_CHECK' => 'Version check',
'STATUS_CONFLICT' => 'Modified file producing conflicts',
+ 'STATUS_DELETED' => 'Deleted file',
'STATUS_MODIFIED' => 'Modified file',
'STATUS_NEW' => 'New file',
'STATUS_NEW_CONFLICT' => 'Conflicting new file',
diff --git a/phpBB/language/en/memberlist.php b/phpBB/language/en/memberlist.php
index e02f9ff525..1a05975892 100644
--- a/phpBB/language/en/memberlist.php
+++ b/phpBB/language/en/memberlist.php
@@ -49,7 +49,6 @@ $lang = array_merge($lang, array(
'BEFORE' => 'Before',
'CC_EMAIL' => 'Send a copy of this email to yourself.',
- 'CONTACT_USER' => 'Contact',
'CONTACT_ADMIN' => 'Contact a Board Administrator',
'DEST_LANG' => 'Language',
@@ -147,6 +146,6 @@ $lang = array_merge($lang, array(
'VIEW_FACEBOOK_PROFILE' => 'View Facebook Profile',
'VIEW_SKYPE_PROFILE' => 'View Skype Profile',
'VIEW_TWITTER_PROFILE' => 'View Twitter Profile',
- 'VIEW_YOUTUBE_CHANNEL' => 'View YouTube Channel',
+ 'VIEW_YOUTUBE_CHANNEL' => 'View YouTube Channel',
'VIEW_GOOGLEPLUS_PROFILE' => 'View Google+ Profile',
));
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php
index d4e1915076..d692828bd7 100644
--- a/phpBB/language/en/ucp.php
+++ b/phpBB/language/en/ucp.php
@@ -40,7 +40,7 @@ if (empty($lang) || !is_array($lang))
$lang = array_merge($lang, array(
'TERMS_OF_USE_CONTENT' => 'By accessing “%1$s” (hereinafter “we”, “us”, “our”, “%1$s”, “%2$s”), you agree to be legally bound by the following terms. If you do not agree to be legally bound by all of the following terms then please do not access and/or use “%1$s”. We may change these at any time and we’ll do our utmost in informing you, though it would be prudent to review this regularly yourself as your continued usage of “%1$s” after changes mean you agree to be legally bound by these terms as they are updated and/or amended.<br />
<br />
- Our forums are powered by phpBB (hereinafter “they”, “them”, “their”, “phpBB software”, “www.phpbb.com”, “phpBB Limited”, “phpBB Teams”) which is a bulletin board solution released under the “<a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>” (hereinafter “GPL”) and can be downloaded from <a href="https://www.phpbb.com/">www.phpbb.com</a>. The phpBB software only facilitates internet based discussions, the phpBB Limited are not responsible for what we allow and/or disallow as permissible content and/or conduct. For further information about phpBB, please see: <a href="https://www.phpbb.com/">https://www.phpbb.com/</a>.<br />
+ Our forums are powered by phpBB (hereinafter “they”, “them”, “their”, “phpBB software”, “www.phpbb.com”, “phpBB Limited”, “phpBB Teams”) which is a bulletin board solution released under the “<a href="http://opensource.org/licenses/gpl-2.0.php">GNU General Public License v2</a>” (hereinafter “GPL”) and can be downloaded from <a href="https://www.phpbb.com/">www.phpbb.com</a>. The phpBB software only facilitates internet based discussions; phpBB Limited is not responsible for what we allow and/or disallow as permissible content and/or conduct. For further information about phpBB, please see: <a href="https://www.phpbb.com/">https://www.phpbb.com/</a>.<br />
<br />
You agree not to post any abusive, obscene, vulgar, slanderous, hateful, threatening, sexually-orientated or any other material that may violate any laws be it of your country, the country where “%1$s” is hosted or International Law. Doing so may lead to you being immediately and permanently banned, with notification of your Internet Service Provider if deemed required by us. The IP address of all posts are recorded to aid in enforcing these conditions. You agree that “%1$s” have the right to remove, edit, move or close any topic at any time should we see fit. As a user you agree to any information you have entered to being stored in a database. While this information will not be disclosed to any third party without your consent, neither “%1$s” nor phpBB shall be held responsible for any hacking attempt that may lead to the data being compromised.
',
@@ -328,12 +328,12 @@ $lang = array_merge($lang, array(
'NOTIFICATION_TYPE_BOOKMARK' => 'Someone replies to a topic you have bookmarked',
'NOTIFICATION_TYPE_GROUP_REQUEST' => 'Someone requests to join a group you lead',
'NOTIFICATION_TYPE_IN_MODERATION_QUEUE' => 'A post or topic needs approval',
- 'NOTIFICATION_TYPE_MODERATION_QUEUE' => 'Your topics/posts are approved or disapproved by a moderator',
+ 'NOTIFICATION_TYPE_MODERATION_QUEUE' => 'Your topics/posts are approved or disapproved by a moderator',
'NOTIFICATION_TYPE_PM' => 'Someone sends you a private message',
'NOTIFICATION_TYPE_POST' => 'Someone replies to a topic to which you are subscribed',
'NOTIFICATION_TYPE_QUOTE' => 'Someone quotes you in a post',
'NOTIFICATION_TYPE_REPORT' => 'Someone reports a post',
- 'NOTIFICATION_TYPE_TOPIC' => 'Someone creates a topic in a forum to which you are subscribed',
+ 'NOTIFICATION_TYPE_TOPIC' => 'Someone creates a topic in a forum to which you are subscribed',
'NOTIFICATION_TYPE_ADMIN_ACTIVATE_USER' => 'Newly registered user requiring activation',
'NOTIFY_METHOD' => 'Notification method',
@@ -359,6 +359,7 @@ $lang = array_merge($lang, array(
),
'NO_ACTION_MODE' => 'No message action specified.',
'NO_AUTHOR' => 'No author defined for this message',
+ 'NO_AVATAR' => 'No avatar selected',
'NO_AVATAR_CATEGORY' => 'None',
'NO_AUTH_DELETE_MESSAGE' => 'You are not authorised to delete private messages.',
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index 63541dbee6..4f4dcb1b41 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -799,7 +799,7 @@ switch ($mode)
$sql = 'SELECT username, user_id, user_colour
FROM ' . USERS_TABLE . '
WHERE ' . $db->sql_in_set('user_type', array(USER_NORMAL, USER_FOUNDER)) . '
- AND username_clean ' . $db->sql_like_expression(utf8_clean_string($username_chars) . $db->any_char);
+ AND username_clean ' . $db->sql_like_expression(utf8_clean_string($username_chars) . $db->get_any_char());
$result = $db->sql_query_limit($sql, 10);
$user_list = array();
@@ -829,8 +829,14 @@ switch ($mode)
$pagination = $phpbb_container->get('pagination');
// Sorting
- $sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'c' => $user->lang['SORT_JOINED'], 'd' => $user->lang['SORT_POST_COUNT'], 'k' => $user->lang['JABBER']);
- $sort_key_sql = array('a' => 'u.username_clean', 'c' => 'u.user_regdate', 'd' => 'u.user_posts', 'k' => 'u.user_jabber');
+ $sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'c' => $user->lang['SORT_JOINED'], 'd' => $user->lang['SORT_POST_COUNT']);
+ $sort_key_sql = array('a' => 'u.username_clean', 'c' => 'u.user_regdate', 'd' => 'u.user_posts');
+
+ if ($config['jab_enable'])
+ {
+ $sort_key_text['k'] = $user->lang['JABBER'];
+ $sort_key_sql['k'] = 'u.user_jabber';
+ }
if ($auth->acl_get('a_user'))
{
@@ -920,9 +926,9 @@ switch ($mode)
$s_find_active_time .= '<option value="' . $key . '"' . $selected . '>' . $value . '</option>';
}
- $sql_where .= ($username) ? ' AND u.username_clean ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($username))) : '';
- $sql_where .= ($auth->acl_get('a_user') && $email) ? ' AND u.user_email ' . $db->sql_like_expression(str_replace('*', $db->any_char, $email)) . ' ' : '';
- $sql_where .= ($jabber) ? ' AND u.user_jabber ' . $db->sql_like_expression(str_replace('*', $db->any_char, $jabber)) . ' ' : '';
+ $sql_where .= ($username) ? ' AND u.username_clean ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), utf8_clean_string($username))) : '';
+ $sql_where .= ($auth->acl_get('a_user') && $email) ? ' AND u.user_email ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), $email)) . ' ' : '';
+ $sql_where .= ($jabber) ? ' AND u.user_jabber ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), $jabber)) . ' ' : '';
$sql_where .= (is_numeric($count) && isset($find_key_match[$count_select])) ? ' AND u.user_posts ' . $find_key_match[$count_select] . ' ' . (int) $count . ' ' : '';
if (isset($find_key_match[$joined_select]) && sizeof($joined) == 3)
@@ -1016,12 +1022,12 @@ switch ($mode)
{
for ($i = 97; $i < 123; $i++)
{
- $sql_where .= ' AND u.username_clean NOT ' . $db->sql_like_expression(chr($i) . $db->any_char);
+ $sql_where .= ' AND u.username_clean NOT ' . $db->sql_like_expression(chr($i) . $db->get_any_char());
}
}
else if ($first_char)
{
- $sql_where .= ' AND u.username_clean ' . $db->sql_like_expression(substr($first_char, 0, 1) . $db->any_char);
+ $sql_where .= ' AND u.username_clean ' . $db->sql_like_expression(substr($first_char, 0, 1) . $db->get_any_char());
}
// Are we looking at a usergroup? If so, fetch additional info
@@ -1286,6 +1292,7 @@ switch ($mode)
'S_IP_SEARCH_ALLOWED' => ($auth->acl_getf_global('m_info')) ? true : false,
'S_EMAIL_SEARCH_ALLOWED'=> ($auth->acl_get('a_user')) ? true : false,
+ 'S_JABBER_ENABLED' => $config['jab_enable'],
'S_IN_SEARCH_POPUP' => ($form && $field) ? true : false,
'S_SEARCH_USER' => ($mode == 'searchuser' || ($mode == '' && $submit)),
'S_FORM_NAME' => $form,
diff --git a/phpBB/phpbb/auth/auth.php b/phpBB/phpbb/auth/auth.php
index 20c60364d8..65249275d4 100644
--- a/phpBB/phpbb/auth/auth.php
+++ b/phpBB/phpbb/auth/auth.php
@@ -1043,7 +1043,7 @@ class auth
{
if (strpos($auth_options, '%') !== false)
{
- $sql_opts = "AND $key " . $db->sql_like_expression(str_replace('%', $db->any_char, $auth_options));
+ $sql_opts = "AND $key " . $db->sql_like_expression(str_replace('%', $db->get_any_char(), $auth_options));
}
else
{
@@ -1074,7 +1074,7 @@ class auth
{
if (strpos($option, '%') !== false)
{
- $sql[] = $key . ' ' . $db->sql_like_expression(str_replace('%', $db->any_char, $option));
+ $sql[] = $key . ' ' . $db->sql_like_expression(str_replace('%', $db->get_any_char(), $option));
}
else
{
diff --git a/phpBB/phpbb/auth/provider/oauth/token_storage.php b/phpBB/phpbb/auth/provider/oauth/token_storage.php
index fe1a376cfe..023cf402ca 100644
--- a/phpBB/phpbb/auth/provider/oauth/token_storage.php
+++ b/phpBB/phpbb/auth/provider/oauth/token_storage.php
@@ -266,7 +266,7 @@ class token_storage implements TokenStorageInterface
// Ensure that the token was serialized/unserialized correctly
if (!($token instanceof TokenInterface))
{
- $this->clearToken();
+ $this->clearToken($data['provider']);
throw new TokenNotFoundException('AUTH_PROVIDER_OAUTH_TOKEN_ERROR_INCORRECTLY_STORED');
}
diff --git a/phpBB/phpbb/cache/service.php b/phpBB/phpbb/cache/service.php
index e47177758a..d6bf150384 100644
--- a/phpBB/phpbb/cache/service.php
+++ b/phpBB/phpbb/cache/service.php
@@ -305,7 +305,7 @@ class service
{
if (($bots = $this->driver->get('_bots')) === false)
{
- switch ($this->db->sql_layer)
+ switch ($this->db->get_sql_layer())
{
case 'mssql':
case 'mssql_odbc':
diff --git a/phpBB/phpbb/config_php_file.php b/phpBB/phpbb/config_php_file.php
new file mode 100644
index 0000000000..1a562e470d
--- /dev/null
+++ b/phpBB/phpbb/config_php_file.php
@@ -0,0 +1,175 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb;
+
+class config_php_file
+{
+ /** @var string phpBB Root Path */
+ protected $phpbb_root_path;
+
+ /** @var string php file extension */
+ protected $php_ext;
+
+ /**
+ * Indicates whether the php config file has been loaded.
+ *
+ * @var bool
+ */
+ protected $config_loaded = false;
+
+ /**
+ * The content of the php config file
+ *
+ * @var array
+ */
+ protected $config_data = array();
+
+ /**
+ * The path to the config file. (Default: $phpbb_root_path . 'config.' . $php_ext)
+ *
+ * @var string
+ */
+ protected $config_file;
+
+ private $defined_vars;
+
+ /**
+ * Constructor
+ *
+ * @param string $phpbb_root_path phpBB Root Path
+ * @param string $php_ext php file extension
+ */
+ function __construct($phpbb_root_path, $php_ext)
+ {
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ $this->config_file = $this->phpbb_root_path . 'config.' . $this->php_ext;
+ }
+
+ /**
+ * Set the path to the config file.
+ *
+ * @param string $config_file
+ */
+ public function set_config_file($config_file)
+ {
+ $this->config_file = $config_file;
+ $this->config_loaded = false;
+ }
+
+ /**
+ * Returns an associative array containing the variables defined by the config file.
+ *
+ * @return bool|array Return the content of the config file or false if the file does not exists.
+ */
+ public function get_all()
+ {
+ if (!$this->load_config_file())
+ {
+ return false;
+ }
+
+ return $this->config_data;
+ }
+
+ /**
+ * Return the value of a variable defined into the config.php file and false if the variable does not exist.
+ *
+ * @param string $variable The name of the variable
+ * @return mixed
+ */
+ public function get($variable)
+ {
+ if (!$this->load_config_file())
+ {
+ return false;
+ }
+
+ return isset($this->config_data[$variable]) ? $this->config_data[$variable] : false;
+ }
+
+ /**
+ * Load the config file and store the information.
+ *
+ * @return bool True if the file was correctly loaded, false otherwise.
+ */
+ protected function load_config_file()
+ {
+ if (!$this->config_loaded)
+ {
+ if (file_exists($this->config_file))
+ {
+ $this->defined_vars = get_defined_vars();
+
+ require($this->config_file);
+ $this->config_data = array_diff_key(get_defined_vars(), $this->defined_vars);
+
+ $this->config_loaded = true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * Convert either 3.0 dbms or 3.1 db driver class name to 3.1 db driver class name.
+ *
+ * If $dbms is a valid 3.1 db driver class name, returns it unchanged.
+ * Otherwise prepends phpbb\db\driver\ to the dbms to convert a 3.0 dbms
+ * to 3.1 db driver class name.
+ *
+ * @param string $dbms dbms parameter
+ * @return string driver class
+ * @throws \RuntimeException
+ */
+ public function convert_30_dbms_to_31($dbms)
+ {
+ // Note: this check is done first because mysqli extension
+ // supplies a mysqli class, and class_exists($dbms) would return
+ // true for mysqli class.
+ // However, per the docblock any valid 3.1 driver name should be
+ // recognized by this function, and have priority over 3.0 dbms.
+ if (strpos($dbms, 'phpbb\db\driver') === false && class_exists('phpbb\db\driver\\' . $dbms))
+ {
+ return 'phpbb\db\driver\\' . $dbms;
+ }
+
+ if (class_exists($dbms))
+ {
+ // Additionally we could check that $dbms extends phpbb\db\driver\driver.
+ // http://php.net/manual/en/class.reflectionclass.php
+ // Beware of possible performance issues:
+ // http://stackoverflow.com/questions/294582/php-5-reflection-api-performance
+ // We could check for interface implementation in all paths or
+ // only when we do not prepend phpbb\db\driver\.
+
+ /*
+ $reflection = new \ReflectionClass($dbms);
+
+ if ($reflection->isSubclassOf('phpbb\db\driver\driver'))
+ {
+ return $dbms;
+ }
+ */
+
+ return $dbms;
+ }
+
+ throw new \RuntimeException("You have specified an invalid dbms driver: $dbms");
+ }
+}
diff --git a/phpBB/phpbb/console/application.php b/phpBB/phpbb/console/application.php
index b1f0635913..bc4897af18 100644
--- a/phpBB/phpbb/console/application.php
+++ b/phpBB/phpbb/console/application.php
@@ -17,7 +17,6 @@ use Symfony\Component\Console\Shell;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\DependencyInjection\TaggedContainerInterface;
class application extends \Symfony\Component\Console\Application
{
@@ -38,9 +37,26 @@ class application extends \Symfony\Component\Console\Application
*/
public function __construct($name, $version, \phpbb\user $user)
{
+ $this->user = $user;
+
parent::__construct($name, $version);
+ }
- $this->user = $user;
+ /**
+ * {@inheritdoc}
+ */
+ protected function getDefaultInputDefinition()
+ {
+ $input_definition = parent::getDefaultInputDefinition();
+
+ $input_definition->addOption(new InputOption(
+ 'safe-mode',
+ null,
+ InputOption::VALUE_NONE,
+ $this->user->lang('CLI_DESCRIPTION_OPTION_SAFE_MODE')
+ ));
+
+ return $input_definition;
}
/**
@@ -73,14 +89,13 @@ class application extends \Symfony\Component\Console\Application
/**
* Register a set of commands from the container
*
- * @param TaggedContainerInterface $container The container
- * @param string $tag The tag used to register the commands
+ * @param \phpbb\di\service_collection $command_collection The console service collection
*/
- public function register_container_commands(TaggedContainerInterface $container, $tag = 'console.command')
+ public function register_container_commands(\phpbb\di\service_collection $command_collection)
{
- foreach($container->findTaggedServiceIds($tag) as $id => $void)
+ foreach ($command_collection as $service_command)
{
- $this->add($container->get($id));
+ $this->add($service_command);
}
}
diff --git a/phpBB/phpbb/console/command/extension/disable.php b/phpBB/phpbb/console/command/extension/disable.php
index 5f0e74b984..c04848aa01 100644
--- a/phpBB/phpbb/console/command/extension/disable.php
+++ b/phpBB/phpbb/console/command/extension/disable.php
@@ -37,7 +37,7 @@ class disable extends command
$this->manager->disable($name);
$this->manager->load_extensions();
- if ($this->manager->enabled($name))
+ if ($this->manager->is_enabled($name))
{
$output->writeln("<error>Could not disable extension $name</error>");
return 1;
diff --git a/phpBB/phpbb/console/command/extension/enable.php b/phpBB/phpbb/console/command/extension/enable.php
index 0cdf26d4db..86a034cdf4 100644
--- a/phpBB/phpbb/console/command/extension/enable.php
+++ b/phpBB/phpbb/console/command/extension/enable.php
@@ -37,9 +37,9 @@ class enable extends command
$this->manager->enable($name);
$this->manager->load_extensions();
- if ($this->manager->enabled($name))
+ if ($this->manager->is_enabled($name))
{
- $this->log->add('admin', ANONYMOUS, '', 'LOG_EXTENSION_ENABLE', time(), array($name));
+ $this->log->add('admin', ANONYMOUS, '', 'LOG_EXT_ENABLE', time(), array($name));
$output->writeln("<info>Successfully enabled extension $name</info>");
return 0;
}
diff --git a/phpBB/phpbb/console/command/extension/purge.php b/phpBB/phpbb/console/command/extension/purge.php
index 4e57641d83..841598b90a 100644
--- a/phpBB/phpbb/console/command/extension/purge.php
+++ b/phpBB/phpbb/console/command/extension/purge.php
@@ -37,7 +37,7 @@ class purge extends command
$this->manager->purge($name);
$this->manager->load_extensions();
- if ($this->manager->enabled($name))
+ if ($this->manager->is_enabled($name))
{
$output->writeln("<error>Could not purge extension $name</error>");
return 1;
diff --git a/phpBB/phpbb/controller/helper.php b/phpBB/phpbb/controller/helper.php
index 930bc42a98..e330fb5b6d 100644
--- a/phpBB/phpbb/controller/helper.php
+++ b/phpBB/phpbb/controller/helper.php
@@ -40,6 +40,9 @@ class helper
*/
protected $config;
+ /* @var \phpbb\symfony_request */
+ protected $symfony_request;
+
/**
* phpBB root path
* @var string
@@ -60,14 +63,16 @@ class helper
* @param \phpbb\config\config $config Config object
* @param \phpbb\controller\provider $provider Path provider
* @param \phpbb\extension\manager $manager Extension manager object
+ * @param \phpbb\symfony_request $symfony_request Symfony Request object
* @param string $phpbb_root_path phpBB root path
* @param string $php_ext PHP extension
*/
- public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, \phpbb\controller\provider $provider, \phpbb\extension\manager $manager, $phpbb_root_path, $php_ext)
+ public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, \phpbb\controller\provider $provider, \phpbb\extension\manager $manager, \phpbb\symfony_request $symfony_request, $phpbb_root_path, $php_ext)
{
$this->template = $template;
$this->user = $user;
$this->config = $config;
+ $this->symfony_request = $symfony_request;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
$provider->find_routing_files($manager->get_finder());
@@ -151,4 +156,14 @@ class helper
return $this->render('message_body.html', $this->user->lang('INFORMATION'), $code);
}
+
+ /**
+ * Return the current url
+ *
+ * @return string
+ */
+ public function get_current_url()
+ {
+ return generate_board_url(true) . $this->symfony_request->getRequestUri();
+ }
}
diff --git a/phpBB/phpbb/cron/task/core/prune_shadow_topics.php b/phpBB/phpbb/cron/task/core/prune_shadow_topics.php
index 381483c798..83a2460454 100644
--- a/phpBB/phpbb/cron/task/core/prune_shadow_topics.php
+++ b/phpBB/phpbb/cron/task/core/prune_shadow_topics.php
@@ -45,11 +45,11 @@ class prune_shadow_topics extends \phpbb\cron\task\base implements \phpbb\cron\t
* @param string $phpbb_root_path The root path
* @param string $php_ext The PHP extension
* @param \phpbb\config\config $config The config
- * @param \phpbb\db\driver\driver $db The db connection
+ * @param \phpbb\db\driver\driver_interface $db The db connection
* @param \phpbb\log\log $log The phpBB log system
* @param \phpbb\user $user The phpBB user object
*/
- public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config, \phpbb\db\driver\driver $db, \phpbb\log\log $log, \phpbb\user $user)
+ public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\log\log $log, \phpbb\user $user)
{
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php
index 3d4aa95606..3e9110d8bc 100644
--- a/phpBB/phpbb/db/driver/driver.php
+++ b/phpBB/phpbb/db/driver/driver.php
@@ -87,6 +87,102 @@ abstract class driver implements driver_interface
}
/**
+ * {@inheritdoc}
+ */
+ public function get_sql_layer()
+ {
+ return $this->sql_layer;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_db_name()
+ {
+ return $this->dbname;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_any_char()
+ {
+ return $this->any_char;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_one_char()
+ {
+ return $this->one_char;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_db_connect_id()
+ {
+ return $this->db_connect_id;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_sql_error_triggered()
+ {
+ return $this->sql_error_triggered;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_sql_error_sql()
+ {
+ return $this->sql_error_sql;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_transaction()
+ {
+ return $this->transaction;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_sql_time()
+ {
+ return $this->sql_time;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_sql_error_returned()
+ {
+ return $this->sql_error_returned;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_multi_insert()
+ {
+ return $this->multi_insert;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set_multi_insert($multi_insert)
+ {
+ $this->multi_insert = $multi_insert;
+ }
+
+ /**
* {@inheritDoc}
*/
function sql_return_on_error($fail = false)
diff --git a/phpBB/phpbb/db/driver/driver_interface.php b/phpBB/phpbb/db/driver/driver_interface.php
index 7f7d341e2d..6722d059a5 100644
--- a/phpBB/phpbb/db/driver/driver_interface.php
+++ b/phpBB/phpbb/db/driver/driver_interface.php
@@ -16,6 +16,90 @@ namespace phpbb\db\driver;
interface driver_interface
{
/**
+ * Gets the name of the sql layer.
+ *
+ * @return string
+ */
+ public function get_sql_layer();
+
+ /**
+ * Gets the name of the database.
+ *
+ * @return string
+ */
+ public function get_db_name();
+
+ /**
+ * Wildcards for matching any (%) character within LIKE expressions
+ *
+ * @return string
+ */
+ public function get_any_char();
+
+ /**
+ * Wildcards for matching exactly one (_) character within LIKE expressions
+ *
+ * @return string
+ */
+ public function get_one_char();
+
+ /**
+ * Gets the time spent into the queries
+ *
+ * @return int
+ */
+ public function get_sql_time();
+
+ /**
+ * Gets the connect ID.
+ *
+ * @return mixed
+ */
+ public function get_db_connect_id();
+
+ /**
+ * Indicates if an error was triggered.
+ *
+ * @return bool
+ */
+ public function get_sql_error_triggered();
+
+ /**
+ * Gets the last faulty query
+ *
+ * @return string
+ */
+ public function get_sql_error_sql();
+
+ /**
+ * Indicates if we are in a transaction.
+ *
+ * @return bool
+ */
+ public function get_transaction();
+
+ /**
+ * Gets the returned error.
+ *
+ * @return array
+ */
+ public function get_sql_error_returned();
+
+ /**
+ * Indicates if multiple insertion can be used
+ *
+ * @return bool
+ */
+ public function get_multi_insert();
+
+ /**
+ * Set if multiple insertion can be used
+ *
+ * @param bool $multi_insert
+ */
+ public function set_multi_insert($multi_insert);
+
+ /**
* Gets the exact number of rows in a specified table.
*
* @param string $table_name Table name
diff --git a/phpBB/phpbb/db/driver/factory.php b/phpBB/phpbb/db/driver/factory.php
new file mode 100644
index 0000000000..f0fa18051b
--- /dev/null
+++ b/phpBB/phpbb/db/driver/factory.php
@@ -0,0 +1,435 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\driver;
+
+use \Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+* Database Abstraction Layer
+*/
+class factory implements driver_interface
+{
+ /**
+ * @var driver_interface
+ */
+ protected $driver = null;
+
+ /**
+ * @var ContainerInterface
+ */
+ protected $container;
+
+ /**
+ * Constructor.
+ *
+ * @param ContainerInterface $container A ContainerInterface instance
+ */
+ public function __construct(ContainerInterface $container)
+ {
+ $this->container = $container;
+ }
+
+ /**
+ * Return the current driver (and retrieved it from the container if necessary)
+ *
+ * @return driver_interface
+ */
+ protected function get_driver()
+ {
+ if ($this->driver === null)
+ {
+ $this->driver = $this->container->get('dbal.conn.driver');
+ }
+
+ return $this->driver;
+ }
+
+ /**
+ * Set the current driver
+ *
+ * @param driver_interface $driver
+ */
+ public function set_driver(driver_interface $driver)
+ {
+ $this->driver = $driver;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_sql_layer()
+ {
+ return $this->get_driver()->get_sql_layer();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_db_name()
+ {
+ return $this->get_driver()->get_db_name();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_any_char()
+ {
+ return $this->get_driver()->get_any_char();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_one_char()
+ {
+ return $this->get_driver()->get_one_char();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_db_connect_id()
+ {
+ return $this->get_driver()->get_db_connect_id();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_sql_error_triggered()
+ {
+ return $this->get_driver()->get_sql_error_triggered();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_sql_error_sql()
+ {
+ return $this->get_driver()->get_sql_error_sql();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_transaction()
+ {
+ return $this->get_driver()->get_transaction();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_sql_time()
+ {
+ return $this->get_driver()->get_sql_time();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_sql_error_returned()
+ {
+ return $this->get_driver()->get_sql_error_returned();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_multi_insert()
+ {
+ return $this->get_driver()->get_multi_insert();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set_multi_insert($multi_insert)
+ {
+ $this->get_driver()->set_multi_insert($multi_insert);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_row_count($table_name)
+ {
+ return $this->get_driver()->get_row_count($table_name);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_estimated_row_count($table_name)
+ {
+ return $this->get_driver()->get_estimated_row_count($table_name);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_lower_text($column_name)
+ {
+ return $this->get_driver()->sql_lower_text($column_name);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_error($sql = '')
+ {
+ return $this->get_driver()->sql_error($sql);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_buffer_nested_transactions()
+ {
+ return $this->get_driver()->sql_buffer_nested_transactions();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_bit_or($column_name, $bit, $compare = '')
+ {
+ return $this->get_driver()->sql_bit_or($column_name, $bit, $compare);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_server_info($raw = false, $use_cache = true)
+ {
+ return $this->get_driver()->sql_server_info($raw, $use_cache);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_return_on_error($fail = false)
+ {
+ return $this->get_driver()->sql_return_on_error($fail);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_build_array($query, $assoc_ary = array())
+ {
+ return $this->get_driver()->sql_build_array($query, $assoc_ary);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_fetchrowset($query_id = false)
+ {
+ return $this->get_driver()->sql_fetchrowset($query_id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_transaction($status = 'begin')
+ {
+ return $this->get_driver()->sql_transaction($status);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_concatenate($expr1, $expr2)
+ {
+ return $this->get_driver()->sql_concatenate($expr1, $expr2);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_case($condition, $action_true, $action_false = false)
+ {
+ return $this->get_driver()->sql_case($condition, $action_true, $action_false);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_build_query($query, $array)
+ {
+ return $this->get_driver()->sql_build_query($query, $array);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_fetchfield($field, $rownum = false, $query_id = false)
+ {
+ return $this->get_driver()->sql_fetchfield($field, $rownum, $query_id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_fetchrow($query_id = false)
+ {
+ return $this->get_driver()->sql_fetchrow($query_id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function cast_expr_to_bigint($expression)
+ {
+ return $this->get_driver()->cast_expr_to_bigint($expression);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_nextid()
+ {
+ return $this->get_driver()->sql_nextid();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_add_num_queries($cached = false)
+ {
+ return $this->get_driver()->sql_add_num_queries($cached);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_query_limit($query, $total, $offset = 0, $cache_ttl = 0)
+ {
+ return $this->get_driver()->sql_query_limit($query, $total, $offset, $cache_ttl);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_query($query = '', $cache_ttl = 0)
+ {
+ return $this->get_driver()->sql_query($query, $cache_ttl);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function cast_expr_to_string($expression)
+ {
+ return $this->get_driver()->cast_expr_to_string($expression);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_connect($sqlserver, $sqluser, $sqlpassword, $database, $port = false, $persistency = false, $new_link = false)
+ {
+ throw new \Exception('Disabled method.');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_bit_and($column_name, $bit, $compare = '')
+ {
+ return $this->get_driver()->sql_bit_and($column_name, $bit, $compare);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_freeresult($query_id = false)
+ {
+ return $this->get_driver()->sql_freeresult($query_id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_num_queries($cached = false)
+ {
+ return $this->get_driver()->sql_num_queries($cached);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_multi_insert($table, $sql_ary)
+ {
+ return $this->get_driver()->sql_multi_insert($table, $sql_ary);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_affectedrows()
+ {
+ return $this->get_driver()->sql_affectedrows();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_close()
+ {
+ return $this->get_driver()->sql_close();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_rowseek($rownum, &$query_id)
+ {
+ return $this->get_driver()->sql_rowseek($rownum, $query_id);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_escape($msg)
+ {
+ return $this->get_driver()->sql_escape($msg);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_like_expression($expression)
+ {
+ return $this->get_driver()->sql_like_expression($expression);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_report($mode, $query = '')
+ {
+ return $this->get_driver()->sql_report($mode, $query);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function sql_in_set($field, $array, $negate = false, $allow_empty_set = false)
+ {
+ return $this->get_driver()->sql_in_set($field, $array, $negate, $allow_empty_set);
+ }
+}
diff --git a/phpBB/phpbb/db/driver/mysqli.php b/phpBB/phpbb/db/driver/mysqli.php
index 8fc306b2cc..2ed08211ad 100644
--- a/phpBB/phpbb/db/driver/mysqli.php
+++ b/phpBB/phpbb/db/driver/mysqli.php
@@ -61,7 +61,11 @@ class mysqli extends \phpbb\db\driver\mysql_base
}
$this->db_connect_id = mysqli_init();
- @mysqli_real_connect($this->db_connect_id, $this->server, $this->user, $sqlpassword, $this->dbname, $port, $socket, MYSQLI_CLIENT_FOUND_ROWS);
+
+ if (!@mysqli_real_connect($this->db_connect_id, $this->server, $this->user, $sqlpassword, $this->dbname, $port, $socket, MYSQLI_CLIENT_FOUND_ROWS))
+ {
+ $this->db_connect_id = '';
+ }
if ($this->db_connect_id && $this->dbname != '')
{
diff --git a/phpBB/phpbb/db/driver/postgres.php b/phpBB/phpbb/db/driver/postgres.php
index a67cd9f7c2..83e9fa51f6 100644
--- a/phpBB/phpbb/db/driver/postgres.php
+++ b/phpBB/phpbb/db/driver/postgres.php
@@ -15,10 +15,11 @@ namespace phpbb\db\driver;
/**
* PostgreSQL Database Abstraction Layer
-* Minimum Requirement is Version 7.3+
+* Minimum Requirement is Version 8.3+
*/
class postgres extends \phpbb\db\driver\driver
{
+ var $multi_insert = true;
var $last_query_text = '';
var $connect_error = '';
@@ -101,11 +102,6 @@ class postgres extends \phpbb\db\driver\driver
if ($this->db_connect_id)
{
- if (version_compare($this->sql_server_info(true), '8.2', '>='))
- {
- $this->multi_insert = true;
- }
-
if ($schema !== '')
{
@pg_query($this->db_connect_id, 'SET search_path TO ' . $schema);
diff --git a/phpBB/phpbb/db/driver/sqlite3.php b/phpBB/phpbb/db/driver/sqlite3.php
index 6511c755a0..0922229e0a 100644
--- a/phpBB/phpbb/db/driver/sqlite3.php
+++ b/phpBB/phpbb/db/driver/sqlite3.php
@@ -50,9 +50,10 @@ class sqlite3 extends \phpbb\db\driver\driver
$this->dbo = new \SQLite3($this->server, SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE);
$this->db_connect_id = true;
}
- catch (Exception $e)
+ catch (\Exception $e)
{
- return array('message' => $e->getMessage());
+ $this->connect_error = $e->getMessage();
+ return array('message' => $this->connect_error);
}
return true;
@@ -280,7 +281,7 @@ class sqlite3 extends \phpbb\db\driver\driver
*/
protected function _sql_error()
{
- if (class_exists('SQLite3', false))
+ if (class_exists('SQLite3', false) && isset($this->dbo))
{
$error = array(
'message' => $this->dbo->lastErrorMsg(),
diff --git a/phpBB/phpbb/db/migration/data/v30x/local_url_bbcode.php b/phpBB/phpbb/db/migration/data/v30x/local_url_bbcode.php
index edcc69e1bf..648ae9ce96 100644
--- a/phpBB/phpbb/db/migration/data/v30x/local_url_bbcode.php
+++ b/phpBB/phpbb/db/migration/data/v30x/local_url_bbcode.php
@@ -37,7 +37,7 @@ class local_url_bbcode extends \phpbb\db\migration\migration
{
$sql = 'SELECT *
FROM ' . BBCODES_TABLE . '
- WHERE bbcode_match ' . $this->db->sql_like_expression($this->db->any_char . 'LOCAL_URL' . $this->db->any_char);
+ WHERE bbcode_match ' . $this->db->sql_like_expression($this->db->get_any_char() . 'LOCAL_URL' . $this->db->get_any_char());
$result = $this->db->sql_query($sql);
while ($row = $this->db->sql_fetchrow($result))
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php
index db3c587f82..9b08da0125 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_4.php
@@ -36,7 +36,7 @@ class release_3_0_4 extends \phpbb\db\migration\migration
public function rename_log_delete_topic()
{
- if ($this->db->sql_layer == 'oracle')
+ if ($this->db->get_sql_layer() == 'oracle')
{
// log_operation is CLOB - but we can change this later
$sql = 'UPDATE ' . $this->table_prefix . "log
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php
index d86c4d6986..1843c3f262 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_7_rc1.php
@@ -76,7 +76,7 @@ class release_3_0_7_rc1 extends \phpbb\db\migration\migration
{
// Delete all text-templates from the template_data
$sql = 'DELETE FROM ' . STYLES_TEMPLATE_DATA_TABLE . '
- WHERE template_filename ' . $this->db->sql_like_expression($this->db->any_char . '.txt');
+ WHERE template_filename ' . $this->db->sql_like_expression($this->db->get_any_char() . '.txt');
$this->sql_query($sql);
}
}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php
index 24340c8cf1..06e46d522f 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php
@@ -89,7 +89,7 @@ class release_3_0_9_rc1 extends \phpbb\db\migration\migration
// Update file extension group names to use language strings, again.
$sql = 'SELECT group_id, group_name
FROM ' . EXTENSION_GROUPS_TABLE . '
- WHERE group_name ' . $this->db->sql_like_expression('EXT_GROUP_' . $this->db->any_char);
+ WHERE group_name ' . $this->db->sql_like_expression('EXT_GROUP_' . $this->db->get_any_char());
$result = $this->db->sql_query($sql);
while ($row = $this->db->sql_fetchrow($result))
diff --git a/phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php b/phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php
index df1560f5b1..4530ebe285 100644
--- a/phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php
+++ b/phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php
@@ -18,7 +18,7 @@ class mysql_fulltext_drop extends \phpbb\db\migration\migration
public function effectively_installed()
{
// This migration is irrelevant for all non-MySQL DBMSes.
- return strpos($this->db->sql_layer, 'mysql') === false;
+ return strpos($this->db->get_sql_layer(), 'mysql') === false;
}
static public function depends_on()
diff --git a/phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php b/phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php
index ca784656e7..ea442dfb1b 100644
--- a/phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php
+++ b/phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php
@@ -18,7 +18,7 @@ class postgres_fulltext_drop extends \phpbb\db\migration\migration
public function effectively_installed()
{
// This migration is irrelevant for all non-PostgreSQL DBMSes.
- return strpos($this->db->sql_layer, 'postgres') === false;
+ return strpos($this->db->get_sql_layer(), 'postgres') === false;
}
static public function depends_on()
diff --git a/phpBB/phpbb/db/migration/data/v310/rc2.php b/phpBB/phpbb/db/migration/data/v310/rc2.php
new file mode 100644
index 0000000000..e1323659da
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/rc2.php
@@ -0,0 +1,31 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class rc2 extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\rc1',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.0-RC2')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/migration.php b/phpBB/phpbb/db/migration/migration.php
index fdfc31da3a..5f120333e1 100644
--- a/phpBB/phpbb/db/migration/migration.php
+++ b/phpBB/phpbb/db/migration/migration.php
@@ -160,11 +160,11 @@ abstract class migration
else
{
$result = $this->db->sql_query($sql);
- if ($this->db->sql_error_triggered)
+ if ($this->db->get_sql_error_triggered())
{
$this->errors[] = array(
- 'sql' => $this->db->sql_error_sql,
- 'code' => $this->db->sql_error_returned,
+ 'sql' => $this->db->get_sql_error_sql(),
+ 'code' => $this->db->get_sql_error_returned(),
);
}
}
diff --git a/phpBB/phpbb/db/migration/profilefield_base_migration.php b/phpBB/phpbb/db/migration/profilefield_base_migration.php
index 9cdd5d0927..9000949a7d 100644
--- a/phpBB/phpbb/db/migration/profilefield_base_migration.php
+++ b/phpBB/phpbb/db/migration/profilefield_base_migration.php
@@ -21,6 +21,23 @@ abstract class profilefield_base_migration extends \phpbb\db\migration\migration
protected $profilefield_data;
+ /**
+ * Language data should be in array -> each language_data in separate key
+ * array(
+ * array(
+ * 'option_id' => value,
+ * 'field_type' => value,
+ * 'lang_value' => value,
+ * ),
+ * array(
+ * 'option_id' => value,
+ * 'field_type' => value,
+ * 'lang_value' => value,
+ * ),
+ * )
+ */
+ protected $profilefield_language_data;
+
protected $user_column_name;
public function effectively_installed()
@@ -58,6 +75,13 @@ abstract class profilefield_base_migration extends \phpbb\db\migration\migration
);
}
+ public function revert_data()
+ {
+ return array(
+ array('custom', array(array($this, 'delete_custom_profile_field_data'))),
+ );
+ }
+
public function create_custom_field()
{
$sql = 'SELECT MAX(field_order) as max_field_order
@@ -79,12 +103,13 @@ abstract class profilefield_base_migration extends \phpbb\db\migration\migration
$sql = 'SELECT lang_id
FROM ' . LANG_TABLE;
$result = $this->db->sql_query($sql);
+ $lang_name = (strpos($this->profilefield_name, 'phpbb_') === 0) ? strtoupper(substr($this->profilefield_name, 6)) : strtoupper($this->profilefield_name);
while ($lang_id = (int) $this->db->sql_fetchfield('lang_id'))
{
$insert_buffer->insert(array(
- 'field_id' => $field_id,
- 'lang_id' => $lang_id,
- 'lang_name' => strtoupper(substr($this->profilefield_name, 6)),// Remove phpbb_ from field name
+ 'field_id' => (int) $field_id,
+ 'lang_id' => (int) $lang_id,
+ 'lang_name' => $lang_name,
'lang_explain' => '',
'lang_default_value' => '',
));
@@ -95,6 +120,69 @@ abstract class profilefield_base_migration extends \phpbb\db\migration\migration
}
/**
+ * Create Custom profile fields languguage entries
+ */
+ public function create_language_entries()
+ {
+ $field_id = $this->get_custom_profile_field_id();
+
+ $insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, PROFILE_FIELDS_LANG_TABLE);
+
+ $sql = 'SELECT lang_id
+ FROM ' . LANG_TABLE;
+ $result = $this->db->sql_query($sql);
+ while ($lang_id = (int) $this->db->sql_fetchfield('lang_id'))
+ {
+ foreach ($this->profilefield_language_data as $language_data)
+ {
+ $insert_buffer->insert(array_merge(array(
+ 'field_id' => (int) $field_id,
+ 'lang_id' => (int) $lang_id,
+ ), $language_data));
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ $insert_buffer->flush();
+ }
+
+ /**
+ * Clean database when reverting the migration
+ */
+ public function delete_custom_profile_field_data()
+ {
+ $field_id = $this->get_custom_profile_field_id();
+
+ $sql = 'DELETE FROM ' . PROFILE_FIELDS_TABLE . '
+ WHERE field_id = ' . (int) $field_id;
+ $this->db->sql_query($sql);
+
+ $sql = 'DELETE FROM ' . PROFILE_LANG_TABLE . '
+ WHERE field_id = ' . (int) $field_id;
+ $this->db->sql_query($sql);
+
+ $sql = 'DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . '
+ WHERE field_id = ' . (int) $field_id;
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * Get custom profile field id
+ * @return int custom profile filed id
+ */
+ public function get_custom_profile_field_id()
+ {
+ $sql = 'SELECT field_id
+ FROM ' . PROFILE_FIELDS_TABLE . "
+ WHERE field_name = '" . $this->profilefield_name . "'";
+ $result = $this->db->sql_query($sql);
+ $field_id = (int) $this->db->sql_fetchfield('field_id');
+ $this->db->sql_freeresult($result);
+
+ return $field_id;
+ }
+
+ /**
* @param int $start Start of staggering step
* @return mixed int start of the next step, null if the end was reached
*/
diff --git a/phpBB/phpbb/db/migration/tool/config_text.php b/phpBB/phpbb/db/migration/tool/config_text.php
new file mode 100644
index 0000000000..bf8ac55023
--- /dev/null
+++ b/phpBB/phpbb/db/migration/tool/config_text.php
@@ -0,0 +1,125 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\tool;
+
+/**
+* Migration config_text tool
+*/
+class config_text implements \phpbb\db\migration\tool\tool_interface
+{
+ /** @var \phpbb\config\db_text */
+ protected $config_text;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\config\db_text $config_text
+ */
+ public function __construct(\phpbb\config\db_text $config_text)
+ {
+ $this->config_text = $config_text;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_name()
+ {
+ return 'config_text';
+ }
+
+ /**
+ * Add a config_text setting.
+ *
+ * @param string $config_name The name of the config_text setting
+ * you would like to add
+ * @param mixed $config_value The value of the config_text setting
+ * @return null
+ */
+ public function add($config_name, $config_value)
+ {
+ if (!is_null($this->config_text->get($config_name)))
+ {
+ return;
+ }
+
+ $this->config_text->set($config_name, $config_value);
+ }
+
+ /**
+ * Update an existing config_text setting.
+ *
+ * @param string $config_name The name of the config_text setting you would
+ * like to update
+ * @param mixed $config_value The value of the config_text setting
+ * @return null
+ * @throws \phpbb\db\migration\exception
+ */
+ public function update($config_name, $config_value)
+ {
+ if (is_null($this->config_text->get($config_name)))
+ {
+ throw new \phpbb\db\migration\exception('CONFIG_NOT_EXIST', $config_name);
+ }
+
+ $this->config_text->set($config_name, $config_value);
+ }
+
+ /**
+ * Remove an existing config_text setting.
+ *
+ * @param string $config_name The name of the config_text setting you would
+ * like to remove
+ * @return null
+ */
+ public function remove($config_name)
+ {
+ if (is_null($this->config_text->get($config_name)))
+ {
+ return;
+ }
+
+ $this->config_text->delete($config_name);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function reverse()
+ {
+ $arguments = func_get_args();
+ $original_call = array_shift($arguments);
+
+ $call = false;
+ switch ($original_call)
+ {
+ case 'add':
+ $call = 'remove';
+ break;
+
+ case 'remove':
+ $call = 'add';
+ if (sizeof($arguments) == 1)
+ {
+ $arguments[] = '';
+ }
+ break;
+ }
+
+ if ($call)
+ {
+ return call_user_func_array(array(&$this, $call), $arguments);
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php
index c2f7b5ab23..8b089a060f 100644
--- a/phpBB/phpbb/db/migrator.php
+++ b/phpBB/phpbb/db/migrator.php
@@ -110,7 +110,7 @@ class migrator
FROM " . $this->migrations_table;
$result = $this->db->sql_query($sql);
- if (!$this->db->sql_error_triggered)
+ if (!$this->db->get_sql_error_triggered())
{
while ($migration = $this->db->sql_fetchrow($result))
{
diff --git a/phpBB/phpbb/db/sql_insert_buffer.php b/phpBB/phpbb/db/sql_insert_buffer.php
index 6b6f556571..14e3c54f09 100644
--- a/phpBB/phpbb/db/sql_insert_buffer.php
+++ b/phpBB/phpbb/db/sql_insert_buffer.php
@@ -92,7 +92,7 @@ class sql_insert_buffer
// Flush buffer if it is full or when DB does not support multi inserts.
// In the later case, the buffer will always only contain one row.
- if (!$this->db->multi_insert || sizeof($this->buffer) >= $this->max_buffered_rows)
+ if (!$this->db->get_multi_insert() || sizeof($this->buffer) >= $this->max_buffered_rows)
{
return $this->flush();
}
diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools.php
index bafd547917..ae0c695aa2 100644
--- a/phpBB/phpbb/db/tools.php
+++ b/phpBB/phpbb/db/tools.php
@@ -323,7 +323,7 @@ class tools
$this->dbms_type_map = self::get_dbms_type_map();
// Determine mapping database type
- switch ($this->db->sql_layer)
+ switch ($this->db->get_sql_layer())
{
case 'mysql':
$this->sql_layer = 'mysql_40';
@@ -354,7 +354,7 @@ class tools
break;
default:
- $this->sql_layer = $this->db->sql_layer;
+ $this->sql_layer = $this->db->get_sql_layer();
break;
}
}
@@ -377,7 +377,7 @@ class tools
*/
function sql_list_tables()
{
- switch ($this->db->sql_layer)
+ switch ($this->db->get_sql_layer())
{
case 'mysql':
case 'mysql4':
@@ -711,7 +711,7 @@ class tools
$sqlite = false;
// For SQLite we need to perform the schema changes in a much more different way
- if (($this->db->sql_layer == 'sqlite' || $this->db->sql_layer == 'sqlite3') && $this->return_statements)
+ if (($this->db->get_sql_layer() == 'sqlite' || $this->db->get_sql_layer() == 'sqlite3') && $this->return_statements)
{
$sqlite_data = array();
$sqlite = true;
diff --git a/phpBB/phpbb/di/container_builder.php b/phpBB/phpbb/di/container_builder.php
new file mode 100644
index 0000000000..553b723cc8
--- /dev/null
+++ b/phpBB/phpbb/di/container_builder.php
@@ -0,0 +1,402 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\di;
+
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
+
+class container_builder
+{
+ /** @var string phpBB Root Path */
+ protected $phpbb_root_path;
+
+ /** @var string php file extension */
+ protected $php_ext;
+
+ /**
+ * The container under construction
+ *
+ * @var ContainerBuilder
+ */
+ protected $container;
+
+ /**
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $dbal_connection = null;
+
+ /**
+ * @var array the installed extensions
+ */
+ protected $installed_exts = null;
+
+ /**
+ * Indicates whether the php config file should be injected into the container (default to true).
+ *
+ * @var bool
+ */
+ protected $inject_config = true;
+
+ /**
+ * Indicates whether extensions should be used (default to true).
+ *
+ * @var bool
+ */
+ protected $use_extensions = true;
+
+ /**
+ * Defines a custom path to find the configuration of the container (default to $this->phpbb_root_path . 'config')
+ *
+ * @var string
+ */
+ protected $config_path = null;
+
+ /**
+ * Indicates whether the phpBB compile pass should be used (default to true).
+ *
+ * @var bool
+ */
+ protected $use_custom_pass = true;
+
+ /**
+ * Indicates whether the kernel compile pass should be used (default to true).
+ *
+ * @var bool
+ */
+ protected $use_kernel_pass = true;
+
+ /**
+ * Indicates whether the container should be dumped to the filesystem (default to true).
+ *
+ * If DEBUG_CONTAINER is set this option is ignored and a new container is build.
+ *
+ * @var bool
+ */
+ protected $dump_container = true;
+
+ /**
+ * Indicates if the container should be compiled automatically (default to true).
+ *
+ * @var bool
+ */
+ protected $compile_container = true;
+
+ /**
+ * Custom parameters to inject into the container.
+ *
+ * Default to true:
+ * array(
+ * 'core.root_path', $this->phpbb_root_path,
+ * 'core.php_ext', $this->php_ext,
+ * );
+ *
+ * @var array
+ */
+ protected $custom_parameters = null;
+
+ /**
+ * @var \phpbb\config_php_file
+ */
+ protected $config_php_file;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\config_php_file $config_php_file
+ * @param string $phpbb_root_path Path to the phpbb includes directory.
+ * @param string $php_ext php file extension
+ */
+ function __construct(\phpbb\config_php_file $config_php_file, $phpbb_root_path, $php_ext)
+ {
+ $this->config_php_file = $config_php_file;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ }
+
+ /**
+ * Build and return a new Container respecting the current configuration
+ *
+ * @return \phpbb_cache_container|ContainerBuilder
+ */
+ public function get_container()
+ {
+ $container_filename = $this->get_container_filename();
+ if (!defined('DEBUG_CONTAINER') && $this->dump_container && file_exists($container_filename))
+ {
+ require($container_filename);
+ $this->container = new \phpbb_cache_container();
+ }
+ else
+ {
+ if ($this->config_path === null)
+ {
+ $this->config_path = $this->phpbb_root_path . 'config';
+ }
+ $container_extensions = array(new \phpbb\di\extension\core($this->config_path));
+
+ if ($this->use_extensions)
+ {
+ $installed_exts = $this->get_installed_extensions();
+ $container_extensions[] = new \phpbb\di\extension\ext($installed_exts);
+ }
+
+ if ($this->inject_config)
+ {
+ $container_extensions[] = new \phpbb\di\extension\config($this->config_php_file);
+ }
+
+ $this->container = $this->create_container($container_extensions);
+
+ if ($this->use_custom_pass)
+ {
+ $this->container->addCompilerPass(new \phpbb\di\pass\collection_pass());
+
+ if ($this->use_kernel_pass)
+ {
+ $this->container->addCompilerPass(new \phpbb\di\pass\kernel_pass());
+ }
+ }
+
+ $this->inject_custom_parameters();
+
+ if ($this->compile_container)
+ {
+ $this->container->compile();
+ }
+
+ if ($this->dump_container && !defined('DEBUG_CONTAINER'))
+ {
+ $this->dump_container($container_filename);
+ }
+ }
+
+ $this->container->set('config.php', $this->config_php_file);
+
+ if ($this->compile_container)
+ {
+ $this->inject_dbal();
+ }
+
+ return $this->container;
+ }
+
+ /**
+ * Set if the extensions should be used.
+ *
+ * @param bool $use_extensions
+ */
+ public function set_use_extensions($use_extensions)
+ {
+ $this->use_extensions = $use_extensions;
+ }
+
+ /**
+ * Set if the phpBB compile pass have to be used.
+ *
+ * @param bool $use_custom_pass
+ */
+ public function set_use_custom_pass($use_custom_pass)
+ {
+ $this->use_custom_pass = $use_custom_pass;
+ }
+
+ /**
+ * Set if the kernel compile pass have to be used.
+ *
+ * @param bool $use_kernel_pass
+ */
+ public function set_use_kernel_pass($use_kernel_pass)
+ {
+ $this->use_kernel_pass = $use_kernel_pass;
+ }
+
+ /**
+ * Set if the php config file should be injecting into the container.
+ *
+ * @param bool $inject_config
+ */
+ public function set_inject_config($inject_config)
+ {
+ $this->inject_config = $inject_config;
+ }
+
+ /**
+ * Set if a dump container should be used.
+ *
+ * If DEBUG_CONTAINER is set this option is ignored and a new container is build.
+ *
+ * @var bool $dump_container
+ */
+ public function set_dump_container($dump_container)
+ {
+ $this->dump_container = $dump_container;
+ }
+
+ /**
+ * Set if the container should be compiled automatically (default to true).
+ *
+ * @var bool $dump_container
+ */
+ public function set_compile_container($compile_container)
+ {
+ $this->compile_container = $compile_container;
+ }
+
+ /**
+ * Set a custom path to find the configuration of the container
+ *
+ * @param string $config_path
+ */
+ public function set_config_path($config_path)
+ {
+ $this->config_path = $config_path;
+ }
+
+ /**
+ * Set custom parameters to inject into the container.
+ *
+ * @param array $custom_parameters
+ */
+ public function set_custom_parameters($custom_parameters)
+ {
+ $this->custom_parameters = $custom_parameters;
+ }
+
+ /**
+ * Dump the container to the disk.
+ *
+ * @param string $container_filename The name of the file.
+ */
+ protected function dump_container($container_filename)
+ {
+ $dumper = new PhpDumper($this->container);
+ $cached_container_dump = $dumper->dump(array(
+ 'class' => 'phpbb_cache_container',
+ 'base_class' => 'Symfony\\Component\\DependencyInjection\\ContainerBuilder',
+ ));
+
+ file_put_contents($container_filename, $cached_container_dump);
+ }
+
+ /**
+ * Inject the connection into the container if one was opened.
+ */
+ protected function inject_dbal()
+ {
+ if ($this->dbal_connection !== null)
+ {
+ $this->container->get('dbal.conn')->set_driver($this->dbal_connection);
+ }
+ }
+
+ /**
+ * Get DB connection.
+ *
+ * @return \phpbb\db\driver\driver_interface
+ */
+ protected function get_dbal_connection()
+ {
+ if ($this->dbal_connection === null)
+ {
+ $dbal_driver_class = $this->config_php_file->convert_30_dbms_to_31($this->config_php_file->get('dbms'));
+ $this->dbal_connection = new $dbal_driver_class();
+ $this->dbal_connection->sql_connect(
+ $this->config_php_file->get('dbhost'),
+ $this->config_php_file->get('dbuser'),
+ $this->config_php_file->get('dbpasswd'),
+ $this->config_php_file->get('dbname'),
+ $this->config_php_file->get('dbport'),
+ defined('PHPBB_DB_NEW_LINK') && PHPBB_DB_NEW_LINK
+ );
+ }
+
+ return $this->dbal_connection;
+ }
+
+ /**
+ * Get enabled extensions.
+ *
+ * @return array enabled extensions
+ */
+ protected function get_installed_extensions()
+ {
+ $db = $this->get_dbal_connection();
+ $extension_table = $this->config_php_file->get('table_prefix') . 'ext';
+
+ $sql = 'SELECT *
+ FROM ' . $extension_table . '
+ WHERE ext_active = 1';
+
+ $result = $db->sql_query($sql);
+ $rows = $db->sql_fetchrowset($result);
+ $db->sql_freeresult($result);
+
+ $exts = array();
+ foreach ($rows as $row)
+ {
+ $exts[$row['ext_name']] = $this->phpbb_root_path . 'ext/' . $row['ext_name'] . '/';
+ }
+
+ return $exts;
+ }
+
+ /**
+ * Create the ContainerBuilder object
+ *
+ * @param array $extensions Array of Container extension objects
+ * @return ContainerBuilder object
+ */
+ protected function create_container(array $extensions)
+ {
+ $container = new ContainerBuilder();
+
+ foreach ($extensions as $extension)
+ {
+ $container->registerExtension($extension);
+ $container->loadFromExtension($extension->getAlias());
+ }
+
+ return $container;
+ }
+
+ /**
+ * Inject the customs parameters into the container
+ */
+ protected function inject_custom_parameters()
+ {
+ if ($this->custom_parameters === null)
+ {
+ $this->custom_parameters = array(
+ 'core.root_path' => $this->phpbb_root_path,
+ 'core.php_ext' => $this->php_ext,
+ );
+ }
+
+ foreach ($this->custom_parameters as $key => $value)
+ {
+ $this->container->setParameter($key, $value);
+ }
+ }
+
+ /**
+ * Get the filename under which the dumped container will be stored.
+ *
+ * @return string Path for dumped container
+ */
+ protected function get_container_filename()
+ {
+ $filename = str_replace(array('/', '.'), array('slash', 'dot'), $this->phpbb_root_path);
+ return $this->phpbb_root_path . 'cache/container_' . $filename . '.' . $this->php_ext;
+ }
+}
diff --git a/phpBB/phpbb/di/extension/config.php b/phpBB/phpbb/di/extension/config.php
index a7d7284f85..27ebc94bae 100644
--- a/phpBB/phpbb/di/extension/config.php
+++ b/phpBB/phpbb/di/extension/config.php
@@ -21,9 +21,12 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
*/
class config extends Extension
{
- public function __construct($config_file)
+ /** @var array */
+ protected $config_php;
+
+ public function __construct(\phpbb\config_php_file $config_php)
{
- $this->config_file = $config_file;
+ $this->config_php = $config_php;
}
/**
@@ -36,17 +39,15 @@ class config extends Extension
*/
public function load(array $config, ContainerBuilder $container)
{
- require($this->config_file);
-
- $container->setParameter('core.adm_relative_path', (isset($phpbb_adm_relative_path) ? $phpbb_adm_relative_path : 'adm/'));
- $container->setParameter('core.table_prefix', $table_prefix);
- $container->setParameter('cache.driver.class', $this->convert_30_acm_type($acm_type));
- $container->setParameter('dbal.driver.class', phpbb_convert_30_dbms_to_31($dbms));
- $container->setParameter('dbal.dbhost', $dbhost);
- $container->setParameter('dbal.dbuser', $dbuser);
- $container->setParameter('dbal.dbpasswd', $dbpasswd);
- $container->setParameter('dbal.dbname', $dbname);
- $container->setParameter('dbal.dbport', $dbport);
+ $container->setParameter('core.adm_relative_path', ($this->config_php->get('phpbb_adm_relative_path') ? $this->config_php->get('phpbb_adm_relative_path') : 'adm/'));
+ $container->setParameter('core.table_prefix', $this->config_php->get('table_prefix'));
+ $container->setParameter('cache.driver.class', $this->convert_30_acm_type($this->config_php->get('acm_type')));
+ $container->setParameter('dbal.driver.class', $this->config_php->convert_30_dbms_to_31($this->config_php->get('dbms')));
+ $container->setParameter('dbal.dbhost', $this->config_php->get('dbhost'));
+ $container->setParameter('dbal.dbuser', $this->config_php->get('dbuser'));
+ $container->setParameter('dbal.dbpasswd', $this->config_php->get('dbpasswd'));
+ $container->setParameter('dbal.dbname', $this->config_php->get('dbname'));
+ $container->setParameter('dbal.dbport', $this->config_php->get('dbport'));
$container->setParameter('dbal.new_link', defined('PHPBB_DB_NEW_LINK') && PHPBB_DB_NEW_LINK);
}
diff --git a/phpBB/phpbb/event/dispatcher.php b/phpBB/phpbb/event/dispatcher.php
index 6a2f9008be..9a786022c2 100644
--- a/phpBB/phpbb/event/dispatcher.php
+++ b/phpBB/phpbb/event/dispatcher.php
@@ -29,8 +29,11 @@ use Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher;
* extract($phpbb_dispatcher->trigger_event('core.index', compact($vars)));
*
*/
-class dispatcher extends ContainerAwareEventDispatcher
+class dispatcher extends ContainerAwareEventDispatcher implements dispatcher_interface
{
+ /**
+ * {@inheritdoc}
+ */
public function trigger_event($eventName, $data = array())
{
$event = new \phpbb\event\data($data);
diff --git a/phpBB/phpbb/event/dispatcher_interface.php b/phpBB/phpbb/event/dispatcher_interface.php
new file mode 100644
index 0000000000..50a3ef9101
--- /dev/null
+++ b/phpBB/phpbb/event/dispatcher_interface.php
@@ -0,0 +1,40 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\event;
+
+/**
+* Extension of the Symfony2 EventDispatcher
+*
+* It provides an additional `trigger_event` method, which
+* gives some syntactic sugar for dispatching events. Instead
+* of creating the event object, the method will do that for
+* you.
+*
+* Example:
+*
+* $vars = array('page_title');
+* extract($phpbb_dispatcher->trigger_event('core.index', compact($vars)));
+*
+*/
+interface dispatcher_interface extends \Symfony\Component\EventDispatcher\EventDispatcherInterface
+{
+ /**
+ * Construct and dispatch an event
+ *
+ * @param string $eventName The event name
+ * @param array $data An array containing the variables sending with the event
+ * @return mixed
+ */
+ public function trigger_event($eventName, $data = array());
+}
diff --git a/phpBB/phpbb/event/md_exporter.php b/phpBB/phpbb/event/md_exporter.php
index a11c2a457f..f7021875f3 100644
--- a/phpBB/phpbb/event/md_exporter.php
+++ b/phpBB/phpbb/event/md_exporter.php
@@ -227,7 +227,7 @@ class md_exporter
*/
public function validate_since($since)
{
- if (!preg_match('#^\d+\.\d+\.\d+(?:-(?:a|b|rc|pl)\d+)?$#', $since))
+ if (!preg_match('#^\d+\.\d+\.\d+(?:-(?:a|b|RC|pl)\d+)?$#', $since))
{
throw new \LogicException("Invalid since information found for event '{$this->current_event}'");
}
diff --git a/phpBB/phpbb/event/php_exporter.php b/phpBB/phpbb/event/php_exporter.php
index 3d2819a3a1..badbbb48fd 100644
--- a/phpBB/phpbb/event/php_exporter.php
+++ b/phpBB/phpbb/event/php_exporter.php
@@ -550,7 +550,7 @@ class php_exporter
public function validate_since($line)
{
$match = array();
- preg_match('#^\* @since (\d+\.\d+\.\d+(?:-(?:a|b|rc|pl)\d+)?)$#', ltrim($line, "\t"), $match);
+ preg_match('#^\* @since (\d+\.\d+\.\d+(?:-(?:a|b|RC|pl)\d+)?)$#', ltrim($line, "\t"), $match);
if (!isset($match[1]))
{
throw new \LogicException("Invalid '@since' information for event "
diff --git a/phpBB/phpbb/extension/manager.php b/phpBB/phpbb/extension/manager.php
index 4130e8455a..b19eb9f8a3 100644
--- a/phpBB/phpbb/extension/manager.php
+++ b/phpBB/phpbb/extension/manager.php
@@ -515,7 +515,7 @@ class manager
* @param string $name Extension name to check NOTE: Can be user input
* @return bool Depending on whether or not the extension is available
*/
- public function available($name)
+ public function is_available($name)
{
return file_exists($this->get_extension_path($name, true));
}
@@ -526,12 +526,50 @@ class manager
* @param string $name Extension name to check
* @return bool Depending on whether or not the extension is enabled
*/
- public function enabled($name)
+ public function is_enabled($name)
{
return isset($this->extensions[$name]) && $this->extensions[$name]['ext_active'];
}
/**
+ * Check to see if a given extension is disabled
+ *
+ * @param string $name Extension name to check
+ * @return bool Depending on whether or not the extension is disabled
+ */
+ public function is_disabled($name)
+ {
+ return isset($this->extensions[$name]) && !$this->extensions[$name]['ext_active'];
+ }
+
+ /**
+ * Check to see if a given extension is configured
+ *
+ * All enabled and disabled extensions are considered configured. A purged
+ * extension that is no longer in the database is not configured.
+ *
+ * @param string $name Extension name to check
+ * @return bool Depending on whether or not the extension is configured
+ */
+ public function is_configured($name)
+ {
+ return isset($this->extensions[$name]);
+ }
+
+ /**
+ * Check to see if a given extension is purged
+ *
+ * An extension is purged if it is available, not enabled and not disabled.
+ *
+ * @param string $name Extension name to check
+ * @return bool Depending on whether or not the extension is purged
+ */
+ public function is_purged($name)
+ {
+ return $this->is_available($name) && !$this->is_configured($name);
+ }
+
+ /**
* Instantiates a \phpbb\finder.
*
* @param bool $use_all_available Should we load all extensions, or just enabled ones
diff --git a/phpBB/phpbb/extension/metadata_manager.php b/phpBB/phpbb/extension/metadata_manager.php
index 014d8c79c7..1051021ea7 100644
--- a/phpBB/phpbb/extension/metadata_manager.php
+++ b/phpBB/phpbb/extension/metadata_manager.php
@@ -306,7 +306,7 @@ class metadata_manager
*/
public function validate_require_phpbb()
{
- if (!isset($this->metadata['require']['phpbb/phpbb']))
+ if (!isset($this->metadata['extra']['soft-require']['phpbb/phpbb']))
{
return false;
}
@@ -369,7 +369,7 @@ class metadata_manager
'META_REQUIRE_PHP' => (isset($this->metadata['require']['php'])) ? htmlspecialchars($this->metadata['require']['php']) : '',
'META_REQUIRE_PHP_FAIL' => !$this->validate_require_php(),
- 'META_REQUIRE_PHPBB' => (isset($this->metadata['require']['phpbb/phpbb'])) ? htmlspecialchars($this->metadata['require']['phpbb/phpbb']) : '',
+ 'META_REQUIRE_PHPBB' => (isset($this->metadata['extra']['soft-require']['phpbb/phpbb'])) ? htmlspecialchars($this->metadata['extra']['soft-require']['phpbb/phpbb']) : '',
'META_REQUIRE_PHPBB_FAIL' => !$this->validate_require_phpbb(),
'META_DISPLAY_NAME' => (isset($this->metadata['extra']['display-name'])) ? htmlspecialchars($this->metadata['extra']['display-name']) : '',
diff --git a/phpBB/phpbb/filesystem.php b/phpBB/phpbb/filesystem.php
index 683a12ab76..77517082e5 100644
--- a/phpBB/phpbb/filesystem.php
+++ b/phpBB/phpbb/filesystem.php
@@ -35,7 +35,7 @@ class filesystem
continue;
}
- if ($part === '..' && !empty($filtered) && $filtered[sizeof($filtered) - 1] !== '..')
+ if ($part === '..' && !empty($filtered) && $filtered[sizeof($filtered) - 1] !== '.' && $filtered[sizeof($filtered) - 1] !== '..')
{
array_pop($filtered);
}
diff --git a/phpBB/phpbb/log/log.php b/phpBB/phpbb/log/log.php
index bf0bfe0ae1..c522c3273f 100644
--- a/phpBB/phpbb/log/log.php
+++ b/phpBB/phpbb/log/log.php
@@ -70,7 +70,7 @@ class log implements \phpbb\log\log_interface
/**
* Event dispatcher object
- * @var \phpbb\event\dispatcher
+ * @var \phpbb\event\dispatcher_interface
*/
protected $dispatcher;
@@ -98,7 +98,7 @@ class log implements \phpbb\log\log_interface
* @param \phpbb\db\driver\driver_interface $db Database object
* @param \phpbb\user $user User object
* @param \phpbb\auth\auth $auth Auth object
- * @param \phpbb\event\dispatcher $phpbb_dispatcher Event dispatcher
+ * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher
* @param string $phpbb_root_path Root path
* @param string $relative_admin_path Relative admin root path
* @param string $php_ext PHP Extension
@@ -737,7 +737,7 @@ class log implements \phpbb\log\log_interface
for ($i = 0, $num_keywords = sizeof($keywords); $i < $num_keywords; $i++)
{
$keywords_pattern[] = preg_quote($keywords[$i], '#');
- $keywords[$i] = $this->db->sql_like_expression($this->db->any_char . $keywords[$i] . $this->db->any_char);
+ $keywords[$i] = $this->db->sql_like_expression($this->db->get_any_char() . $keywords[$i] . $this->db->get_any_char());
}
$keywords_pattern = '#' . implode('|', $keywords_pattern) . '#ui';
diff --git a/phpBB/phpbb/path_helper.php b/phpBB/phpbb/path_helper.php
index a5314d2ce1..a8592eac6c 100644
--- a/phpBB/phpbb/path_helper.php
+++ b/phpBB/phpbb/path_helper.php
@@ -24,6 +24,9 @@ class path_helper
/** @var \phpbb\filesystem */
protected $filesystem;
+ /** @var \phpbb\request\request_interface */
+ protected $request;
+
/** @var string */
protected $phpbb_root_path;
@@ -41,13 +44,16 @@ class path_helper
*
* @param \phpbb\symfony_request $symfony_request
* @param \phpbb\filesystem $filesystem
+ * @param \phpbb\request\request_interface $request
* @param string $phpbb_root_path Relative path to phpBB root
* @param string $php_ext PHP extension (php)
+ * @param mixed $adm_relative_path Relative path admin path to adm/ root
*/
- public function __construct(\phpbb\symfony_request $symfony_request, \phpbb\filesystem $filesystem, $phpbb_root_path, $php_ext, $adm_relative_path = null)
+ public function __construct(\phpbb\symfony_request $symfony_request, \phpbb\filesystem $filesystem, \phpbb\request\request_interface $request, $phpbb_root_path, $php_ext, $adm_relative_path = null)
{
$this->symfony_request = $symfony_request;
$this->filesystem = $filesystem;
+ $this->request = $request;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
$this->adm_relative_path = $adm_relative_path;
@@ -98,7 +104,13 @@ class path_helper
{
$path = substr($path, strlen($this->phpbb_root_path));
- return $this->get_web_root_path() . $path;
+ $web_root_path = $this->get_web_root_path();
+ if (substr($web_root_path, -8) === 'app.php/' && substr($path, 0, 7) === 'app.php')
+ {
+ $path = substr($path, 8);
+ }
+
+ return $this->filesystem->clean_path($web_root_path . $path);
}
return $path;
@@ -158,7 +170,7 @@ class path_helper
*/
if ($path_info === '/' && preg_match('/app\.' . $this->php_ext . '\/$/', $request_uri))
{
- return $this->web_root_path = $this->phpbb_root_path . '../';
+ return $this->web_root_path = $this->filesystem->clean_path('./../' . $this->phpbb_root_path);
}
/*
@@ -170,31 +182,111 @@ class path_helper
return $this->web_root_path = $this->phpbb_root_path;
}
+ /*
+ * Check AJAX request:
+ * If the current request is a AJAX we need to fix the paths.
+ * We need to get the root path based on the Referer, so we can use
+ * the generated URLs in the template of the Referer. If we do not
+ * generate the relative path based on the Referer, but based on the
+ * currently requested URL, the generated URLs will not point to the
+ * intended locations:
+ * Referer desired URL desired relative root path
+ * memberlist.php faq.php ./
+ * memberlist.php app.php/foo/bar ./
+ * app.php/foo memberlist.php ../
+ * app.php/foo app.php/fox ../
+ * app.php/foo/bar memberlist.php ../../
+ * ../page.php memberlist.php ./phpBB/
+ * ../sub/page.php memberlist.php ./../phpBB/
+ *
+ * The referer must be specified as a parameter in the query.
+ */
+ if ($this->request->is_ajax() && $this->symfony_request->get('_referer'))
+ {
+ $referer_web_root_path = $this->get_web_root_path_from_ajax_referer(
+ $this->symfony_request->get('_referer'),
+ $this->symfony_request->getSchemeAndHttpHost() . $this->symfony_request->getBasePath()
+ );
+ return $this->web_root_path = $this->phpbb_root_path . $referer_web_root_path;
+ }
+
// How many corrections might we need?
$corrections = substr_count($path_info, '/');
/*
- * If the script name (e.g. phpBB/app.php) exists in the
- * requestUri (e.g. phpBB/app.php/foo/template), then we
- * are have a non-rewritten URL.
+ * If the script name (e.g. phpBB/app.php) does not exists in the
+ * requestUri (e.g. phpBB/app.php/foo/template), then we are rewriting
+ * the URL. So we must reduce the slash count by 1.
*/
- if (strpos($request_uri, $script_name) === 0)
+ if (strpos($request_uri, $script_name) !== 0)
{
- /*
- * Append ../ to the end of the phpbb_root_path as many times
- * as / exists in path_info
- */
- return $this->web_root_path = $this->phpbb_root_path . str_repeat('../', $corrections);
+ $corrections--;
}
- /*
- * If we're here it means we're at a re-written path, so we must
- * correct the relative path for web URLs. We must append ../
- * to the end of the root path as many times as / exists in path_info
- * less one time (because the script, e.g. /app.php, doesn't exist in
- * the URL)
- */
- return $this->web_root_path = $this->phpbb_root_path . str_repeat('../', $corrections - 1);
+ // Prepend ../ to the phpbb_root_path as many times as / exists in path_info
+ $this->web_root_path = $this->filesystem->clean_path(
+ './' . str_repeat('../', $corrections) . $this->phpbb_root_path
+ );
+ return $this->web_root_path;
+ }
+
+ /**
+ * Get the web root path of the referer form an ajax request
+ *
+ * @param string $absolute_referer_url
+ * @param string $absolute_board_url
+ * @return string
+ */
+ public function get_web_root_path_from_ajax_referer($absolute_referer_url, $absolute_board_url)
+ {
+ // If the board URL is in the beginning of the referer, this means
+ // we the referer is in the board URL or a subdirectory of it.
+ // So we just need to count the / (slashes) in the left over part of
+ // the referer and prepend ../ the the current root_path, to get the
+ // web root path of the referer.
+ if (strpos($absolute_referer_url, $absolute_board_url) === 0)
+ {
+ $relative_referer_path = substr($absolute_referer_url, strlen($absolute_board_url));
+ $has_params = strpos($relative_referer_path, '?');
+ if ($has_params !== false)
+ {
+ $relative_referer_path = substr($relative_referer_path, 0, $has_params);
+ }
+ $corrections = substr_count($relative_referer_path, '/');
+ return $this->phpbb_root_path . str_repeat('../', $corrections - 1);
+ }
+
+ // If not, it's a bit more complicated. We go to the parent directory
+ // of the referer until we find the remaining referer in the board URL.
+ // Foreach directory we need to add a ../ to the fixed root_path.
+ // When we finally found it, we need to remove the remaining referer
+ // from the board URL, to get the boards root path.
+ // If the then append these two strings, we get our fixed web root path.
+ $fixed_root_path = '';
+ $referer_dir = $absolute_referer_url;
+ $has_params = strpos($referer_dir, '?');
+ if ($has_params !== false)
+ {
+ $referer_dir = substr($referer_dir, 0, $has_params);
+ }
+
+ // If we do not find a slash at the end of the referer, we come
+ // from a file. So the first dirname() does not need a traversal
+ // path correction.
+ if (substr($referer_dir, -1) !== '/')
+ {
+ $referer_dir = dirname($referer_dir);
+ }
+
+ while (strpos($absolute_board_url, $referer_dir) !== 0)
+ {
+ $fixed_root_path .= '../';
+ $referer_dir = dirname($referer_dir);
+ }
+
+ $fixed_root_path .= substr($absolute_board_url, strlen($referer_dir) + 1);
+ // Add trailing slash
+ return $this->phpbb_root_path . $fixed_root_path . '/';
}
/**
diff --git a/phpBB/phpbb/permissions.php b/phpBB/phpbb/permissions.php
index 3f51016c93..9b3dcadf32 100644
--- a/phpBB/phpbb/permissions.php
+++ b/phpBB/phpbb/permissions.php
@@ -17,7 +17,7 @@ class permissions
{
/**
* Event dispatcher object
- * @var \phpbb\event\dispatcher
+ * @var \phpbb\event\dispatcher_interface
*/
protected $dispatcher;
@@ -30,10 +30,10 @@ class permissions
/**
* Constructor
*
- * @param \phpbb\event\dispatcher $phpbb_dispatcher Event dispatcher
+ * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher
* @param \phpbb\user $user User Object
*/
- public function __construct(\phpbb\event\dispatcher $phpbb_dispatcher, \phpbb\user $user)
+ public function __construct(\phpbb\event\dispatcher_interface $phpbb_dispatcher, \phpbb\user $user)
{
$this->dispatcher = $phpbb_dispatcher;
$this->user = $user;
diff --git a/phpBB/phpbb/profilefields/lang_helper.php b/phpBB/phpbb/profilefields/lang_helper.php
index c055931181..2e353722b2 100644
--- a/phpBB/phpbb/profilefields/lang_helper.php
+++ b/phpBB/phpbb/profilefields/lang_helper.php
@@ -49,43 +49,50 @@ class lang_helper
}
/**
- * Get language entries for options and store them here for later use
+ * Loads preview options into language entries for options
+ *
+ * @param int $field_id
+ * @param int $lang_id
+ * @param mixed $preview_options
*/
- public function get_option_lang($field_id, $lang_id, $field_type, $preview_options)
+ public function load_preview_options($field_id, $lang_id, $preview_options)
{
- if ($preview_options !== false)
- {
- $lang_options = (!is_array($preview_options)) ? explode("\n", $preview_options) : $preview_options;
+ $lang_options = (!is_array($preview_options)) ? explode("\n", $preview_options) : $preview_options;
- foreach ($lang_options as $num => $var)
+ foreach ($lang_options as $num => $var)
+ {
+ if (!isset($this->options_lang[$field_id]))
+ {
+ $this->options_lang[$field_id] = array();
+ }
+ if (!isset($this->options_lang[$field_id][$lang_id]))
{
- if (!isset($this->options_lang[$field_id]))
- {
- $this->options_lang[$field_id] = array();
- }
- if (!isset($this->options_lang[$field_id][$lang_id]))
- {
- $this->options_lang[$field_id][$lang_id] = array();
- }
- $this->options_lang[$field_id][$lang_id][($num + 1)] = $var;
+ $this->options_lang[$field_id][$lang_id] = array();
}
+ $this->options_lang[$field_id][$lang_id][($num + 1)] = $var;
}
- else
- {
- $sql = 'SELECT option_id, lang_value
+ }
+
+ /**
+ * Fetches language entries for options from DB
+ *
+ * @param int $lang_id
+ */
+ public function load_option_lang($lang_id)
+ {
+ $sql = 'SELECT field_id, option_id, lang_value
FROM ' . $this->language_table . '
- WHERE field_id = ' . (int) $field_id . '
- AND lang_id = ' . (int) $lang_id . "
- AND field_type = '" . $this->db->sql_escape($field_type) . "'
+ WHERE lang_id = ' . (int) $lang_id . "
ORDER BY option_id";
- $result = $this->db->sql_query($sql);
- while ($row = $this->db->sql_fetchrow($result))
- {
- $this->options_lang[$field_id][$lang_id][($row['option_id'] + 1)] = $row['lang_value'];
- }
- $this->db->sql_freeresult($result);
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $this->options_lang[$row['field_id']][$lang_id][($row['option_id'] + 1)] = $row['lang_value'];
}
+
+ $this->db->sql_freeresult($result);
}
/**
diff --git a/phpBB/phpbb/profilefields/manager.php b/phpBB/phpbb/profilefields/manager.php
index 490db0419a..f3b1676799 100644
--- a/phpBB/phpbb/profilefields/manager.php
+++ b/phpBB/phpbb/profilefields/manager.php
@@ -32,7 +32,7 @@ class manager
/**
* Event dispatcher object
- * @var \phpbb\event\dispatcher
+ * @var \phpbb\event\dispatcher_interface
*/
protected $dispatcher;
@@ -73,7 +73,7 @@ class manager
*
* @param \phpbb\auth\auth $auth Auth object
* @param \phpbb\db\driver\driver_interface $db Database object
- * @param \phpbb\event\dispatcher $dispatcher Event dispatcher object
+ * @param \phpbb\event\dispatcher_interface $dispatcher Event dispatcher object
* @param \phpbb\request\request $request Request object
* @param \phpbb\template\template $template Template object
* @param \phpbb\di\service_collection $type_collection
@@ -82,7 +82,7 @@ class manager
* @param string $fields_language_table
* @param string $fields_data_table
*/
- public function __construct(\phpbb\auth\auth $auth, \phpbb\db\driver\driver_interface $db, \phpbb\event\dispatcher $dispatcher, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\di\service_collection $type_collection, \phpbb\user $user, $fields_table, $fields_language_table, $fields_data_table)
+ public function __construct(\phpbb\auth\auth $auth, \phpbb\db\driver\driver_interface $db, \phpbb\event\dispatcher_interface $dispatcher, \phpbb\request\request $request, \phpbb\template\template $template, \phpbb\di\service_collection $type_collection, \phpbb\user $user, $fields_table, $fields_language_table, $fields_data_table)
{
$this->auth = $auth;
$this->db = $db;
@@ -389,6 +389,7 @@ class manager
{
$profile_field = $this->type_collection[$ident_ary['data']['field_type']];
$value = $profile_field->get_profile_value($ident_ary['value'], $ident_ary['data']);
+ $value_raw = $profile_field->get_profile_value_raw($ident_ary['value'], $ident_ary['data']);
if ($value === null)
{
@@ -412,26 +413,28 @@ class manager
}
$tpl_fields['row'] += array(
- 'PROFILE_' . strtoupper($ident) . '_IDENT' => $ident,
- 'PROFILE_' . strtoupper($ident) . '_VALUE' => $value,
- 'PROFILE_' . strtoupper($ident) . '_CONTACT'=> $contact_url,
- 'PROFILE_' . strtoupper($ident) . '_DESC' => $field_desc,
- 'PROFILE_' . strtoupper($ident) . '_TYPE' => $ident_ary['data']['field_type'],
- 'PROFILE_' . strtoupper($ident) . '_NAME' => $this->user->lang($ident_ary['data']['lang_name']),
- 'PROFILE_' . strtoupper($ident) . '_EXPLAIN'=> $this->user->lang($ident_ary['data']['lang_explain']),
+ 'PROFILE_' . strtoupper($ident) . '_IDENT' => $ident,
+ 'PROFILE_' . strtoupper($ident) . '_VALUE' => $value,
+ 'PROFILE_' . strtoupper($ident) . '_VALUE_RAW' => $value_raw,
+ 'PROFILE_' . strtoupper($ident) . '_CONTACT' => $contact_url,
+ 'PROFILE_' . strtoupper($ident) . '_DESC' => $field_desc,
+ 'PROFILE_' . strtoupper($ident) . '_TYPE' => $ident_ary['data']['field_type'],
+ 'PROFILE_' . strtoupper($ident) . '_NAME' => $this->user->lang($ident_ary['data']['lang_name']),
+ 'PROFILE_' . strtoupper($ident) . '_EXPLAIN' => $this->user->lang($ident_ary['data']['lang_explain']),
'S_PROFILE_' . strtoupper($ident) . '_CONTACT' => $ident_ary['data']['field_is_contact'],
'S_PROFILE_' . strtoupper($ident) => true,
);
$tpl_fields['blockrow'][] = array(
- 'PROFILE_FIELD_IDENT' => $ident,
- 'PROFILE_FIELD_VALUE' => $value,
- 'PROFILE_FIELD_CONTACT' => $contact_url,
- 'PROFILE_FIELD_DESC' => $field_desc,
- 'PROFILE_FIELD_TYPE' => $ident_ary['data']['field_type'],
- 'PROFILE_FIELD_NAME' => $this->user->lang($ident_ary['data']['lang_name']),
- 'PROFILE_FIELD_EXPLAIN' => $this->user->lang($ident_ary['data']['lang_explain']),
+ 'PROFILE_FIELD_IDENT' => $ident,
+ 'PROFILE_FIELD_VALUE' => $value,
+ 'PROFILE_FIELD_VALUE_RAW' => $value_raw,
+ 'PROFILE_FIELD_CONTACT' => $contact_url,
+ 'PROFILE_FIELD_DESC' => $field_desc,
+ 'PROFILE_FIELD_TYPE' => $ident_ary['data']['field_type'],
+ 'PROFILE_FIELD_NAME' => $this->user->lang($ident_ary['data']['lang_name']),
+ 'PROFILE_FIELD_EXPLAIN' => $this->user->lang($ident_ary['data']['lang_explain']),
'S_PROFILE_CONTACT' => $ident_ary['data']['field_is_contact'],
'S_PROFILE_' . strtoupper($ident) => true,
diff --git a/phpBB/phpbb/profilefields/type/type_bool.php b/phpBB/phpbb/profilefields/type/type_bool.php
index eb8d3e47d6..0582722833 100644
--- a/phpBB/phpbb/profilefields/type/type_bool.php
+++ b/phpBB/phpbb/profilefields/type/type_bool.php
@@ -155,7 +155,7 @@ class type_bool extends type_base
if (!$this->lang_helper->is_set($field_id, $lang_id))
{
- $this->lang_helper->get_option_lang($field_id, $lang_id, FIELD_BOOL, false);
+ $this->lang_helper->load_option_lang($lang_id);
}
if (!$field_value && $field_data['field_show_novalue'])
@@ -180,6 +180,24 @@ class type_bool extends type_base
/**
* {@inheritDoc}
*/
+ public function get_profile_value_raw($field_value, $field_data)
+ {
+ if ($field_value == $field_data['field_novalue'] && !$field_data['field_show_novalue'])
+ {
+ return null;
+ }
+
+ if (!$field_value && $field_data['field_show_novalue'])
+ {
+ $field_value = $field_data['field_novalue'];
+ }
+
+ return $field_value;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public function generate_field($profile_row, $preview_options = false)
{
$profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident'];
@@ -203,7 +221,14 @@ class type_bool extends type_base
{
if (!$this->lang_helper->is_set($profile_row['field_id'], $profile_row['lang_id'], 1))
{
- $this->lang_helper->get_option_lang($profile_row['field_id'], $profile_row['lang_id'], $this->get_service_name(), $preview_options);
+ if ($preview_options)
+ {
+ $this->lang_helper->load_preview_options($profile_row['field_id'], $profile_row['lang_id'], $preview_options);
+ }
+ else
+ {
+ $this->lang_helper->load_option_lang($profile_row['lang_id']);
+ }
}
$options = $this->lang_helper->get($profile_row['field_id'], $profile_row['lang_id']);
diff --git a/phpBB/phpbb/profilefields/type/type_date.php b/phpBB/phpbb/profilefields/type/type_date.php
index 158eec6a0c..90ac9a6703 100644
--- a/phpBB/phpbb/profilefields/type/type_date.php
+++ b/phpBB/phpbb/profilefields/type/type_date.php
@@ -208,6 +208,19 @@ class type_date extends type_base
/**
* {@inheritDoc}
*/
+ public function get_profile_value_raw($field_value, $field_data)
+ {
+ if (($field_value === '' || $field_value === null) && !$field_data['field_show_novalue'])
+ {
+ return null;
+ }
+
+ return $field_value;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public function generate_field($profile_row, $preview_options = false)
{
$profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident'];
diff --git a/phpBB/phpbb/profilefields/type/type_dropdown.php b/phpBB/phpbb/profilefields/type/type_dropdown.php
index 52c9fcf86a..17ae89e1b2 100644
--- a/phpBB/phpbb/profilefields/type/type_dropdown.php
+++ b/phpBB/phpbb/profilefields/type/type_dropdown.php
@@ -135,7 +135,7 @@ class type_dropdown extends type_base
// retrieve option lang data if necessary
if (!$this->lang_helper->is_set($field_data['field_id'], $field_data['lang_id'], 1))
{
- $this->lang_helper->get_option_lang($field_data['field_id'], $field_data['lang_id'], $this->get_service_name(), false);
+ $this->lang_helper->load_option_lang($field_data['lang_id']);
}
if (!$this->lang_helper->is_set($field_data['field_id'], $field_data['lang_id'], $field_value))
@@ -160,7 +160,7 @@ class type_dropdown extends type_base
$lang_id = $field_data['lang_id'];
if (!$this->lang_helper->is_set($field_id, $lang_id))
{
- $this->lang_helper->get_option_lang($field_id, $lang_id, $this->get_service_name(), false);
+ $this->lang_helper->load_option_lang($lang_id);
}
if ($field_value == $field_data['field_novalue'] && !$field_data['field_show_novalue'])
@@ -189,6 +189,24 @@ class type_dropdown extends type_base
/**
* {@inheritDoc}
*/
+ public function get_profile_value_raw($field_value, $field_data)
+ {
+ if ($field_value == $field_data['field_novalue'] && !$field_data['field_show_novalue'])
+ {
+ return null;
+ }
+
+ if (!$field_value && $field_data['field_show_novalue'])
+ {
+ $field_value = $field_data['field_novalue'];
+ }
+
+ return $field_value;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public function generate_field($profile_row, $preview_options = false)
{
$profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident'];
@@ -199,7 +217,14 @@ class type_dropdown extends type_base
if (!$this->lang_helper->is_set($profile_row['field_id'], $profile_row['lang_id'], 1))
{
- $this->lang_helper->get_option_lang($profile_row['field_id'], $profile_row['lang_id'], $this->get_service_name(), $preview_options);
+ if ($preview_options)
+ {
+ $this->lang_helper->load_preview_options($profile_row['field_id'], $profile_row['lang_id'], $preview_options);
+ }
+ else
+ {
+ $this->lang_helper->load_option_lang($profile_row['lang_id']);
+ }
}
$profile_row['field_value'] = (int) $value;
diff --git a/phpBB/phpbb/profilefields/type/type_int.php b/phpBB/phpbb/profilefields/type/type_int.php
index 78f1c7d2c9..dd08df94c1 100644
--- a/phpBB/phpbb/profilefields/type/type_int.php
+++ b/phpBB/phpbb/profilefields/type/type_int.php
@@ -154,6 +154,18 @@ class type_int extends type_base
/**
* {@inheritDoc}
*/
+ public function get_profile_value_raw($field_value, $field_data)
+ {
+ if (($field_value === '' || $field_value === null) && !$field_data['field_show_novalue'])
+ {
+ return null;
+ }
+ return (int) $field_value;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public function generate_field($profile_row, $preview_options = false)
{
$profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident'];
diff --git a/phpBB/phpbb/profilefields/type/type_interface.php b/phpBB/phpbb/profilefields/type/type_interface.php
index 489e916fd5..2dd13fa480 100644
--- a/phpBB/phpbb/profilefields/type/type_interface.php
+++ b/phpBB/phpbb/profilefields/type/type_interface.php
@@ -94,6 +94,15 @@ interface type_interface
public function get_profile_value($field_value, $field_data);
/**
+ * Get Profile Value ID for display (the raw, unprocessed user data)
+ *
+ * @param mixed $field_value Field value as stored in the database
+ * @param array $field_data Array with requirements of the field
+ * @return mixed Field value ID to display
+ */
+ public function get_profile_value_raw($field_value, $field_data);
+
+ /**
* Get Profile Value for display
*
* When displaying a contact field, we don't want to have links already parsed and more
diff --git a/phpBB/phpbb/profilefields/type/type_string_common.php b/phpBB/phpbb/profilefields/type/type_string_common.php
index b48e3c5add..c2b951b6c9 100644
--- a/phpBB/phpbb/profilefields/type/type_string_common.php
+++ b/phpBB/phpbb/profilefields/type/type_string_common.php
@@ -112,6 +112,19 @@ abstract class type_string_common extends type_base
/**
* {@inheritDoc}
*/
+ public function get_profile_value_raw($field_value, $field_data)
+ {
+ if (!$field_value && !$field_data['field_show_novalue'])
+ {
+ return null;
+ }
+
+ return $field_value;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public function get_profile_contact_value($field_value, $field_data)
{
if (!$field_value && !$field_data['field_show_novalue'])
diff --git a/phpBB/phpbb/search/base.php b/phpBB/phpbb/search/base.php
index 861b1f9328..9395b6a273 100644
--- a/phpBB/phpbb/search/base.php
+++ b/phpBB/phpbb/search/base.php
@@ -282,7 +282,7 @@ class base
$sql_where = '';
foreach ($words as $word)
{
- $sql_where .= " OR search_keywords " . $db->sql_like_expression($db->any_char . $word . $db->any_char);
+ $sql_where .= " OR search_keywords " . $db->sql_like_expression($db->get_any_char() . $word . $db->get_any_char());
}
$sql = 'SELECT search_key
@@ -303,7 +303,7 @@ class base
$sql_where = '';
foreach ($authors as $author)
{
- $sql_where .= (($sql_where) ? ' OR ' : '') . 'search_authors ' . $db->sql_like_expression($db->any_char . ' ' . (int) $author . ' ' . $db->any_char);
+ $sql_where .= (($sql_where) ? ' OR ' : '') . 'search_authors ' . $db->sql_like_expression($db->get_any_char() . ' ' . (int) $author . ' ' . $db->get_any_char());
}
$sql = 'SELECT search_key
diff --git a/phpBB/phpbb/search/fulltext_mysql.php b/phpBB/phpbb/search/fulltext_mysql.php
index 3e8e492cd8..d4e7de31e5 100644
--- a/phpBB/phpbb/search/fulltext_mysql.php
+++ b/phpBB/phpbb/search/fulltext_mysql.php
@@ -140,7 +140,7 @@ class fulltext_mysql extends \phpbb\search\base
*/
public function init()
{
- if ($this->db->sql_layer != 'mysql4' && $this->db->sql_layer != 'mysqli')
+ if ($this->db->get_sql_layer() != 'mysql4' && $this->db->get_sql_layer() != 'mysqli')
{
return $this->user->lang['FULLTEXT_MYSQL_INCOMPATIBLE_DATABASE'];
}
@@ -764,7 +764,7 @@ class fulltext_mysql extends \phpbb\search\base
if (!isset($this->stats['post_subject']))
{
- if ($this->db->sql_layer == 'mysqli' || version_compare($this->db->sql_server_info(true), '4.1.3', '>='))
+ if ($this->db->get_sql_layer() == 'mysqli' || version_compare($this->db->sql_server_info(true), '4.1.3', '>='))
{
$alter[] = 'MODIFY post_subject varchar(255) COLLATE utf8_unicode_ci DEFAULT \'\' NOT NULL';
}
@@ -777,7 +777,7 @@ class fulltext_mysql extends \phpbb\search\base
if (!isset($this->stats['post_content']))
{
- if ($this->db->sql_layer == 'mysqli' || version_compare($this->db->sql_server_info(true), '4.1.3', '>='))
+ if ($this->db->get_sql_layer() == 'mysqli' || version_compare($this->db->sql_server_info(true), '4.1.3', '>='))
{
$alter[] = 'MODIFY post_text mediumtext COLLATE utf8_unicode_ci NOT NULL';
}
@@ -872,7 +872,7 @@ class fulltext_mysql extends \phpbb\search\base
*/
protected function get_stats()
{
- if (strpos($this->db->sql_layer, 'mysql') === false)
+ if (strpos($this->db->get_sql_layer(), 'mysql') === false)
{
$this->stats = array();
return;
diff --git a/phpBB/phpbb/search/fulltext_native.php b/phpBB/phpbb/search/fulltext_native.php
index 2fbff57990..48b0f077c7 100644
--- a/phpBB/phpbb/search/fulltext_native.php
+++ b/phpBB/phpbb/search/fulltext_native.php
@@ -758,7 +758,7 @@ class fulltext_native extends \phpbb\search\base
);
}
- switch ($this->db->sql_layer)
+ switch ($this->db->get_sql_layer())
{
case 'mysql4':
case 'mysqli':
@@ -978,7 +978,7 @@ class fulltext_native extends \phpbb\search\base
// If the cache was completely empty count the results
if (!$total_results)
{
- switch ($this->db->sql_layer)
+ switch ($this->db->get_sql_layer())
{
case 'mysql4':
case 'mysqli':
@@ -1000,7 +1000,7 @@ class fulltext_native extends \phpbb\search\base
}
else
{
- if ($this->db->sql_layer == 'sqlite' || $this->db->sql_layer == 'sqlite3')
+ if ($this->db->get_sql_layer() == 'sqlite' || $this->db->get_sql_layer() == 'sqlite3')
{
$sql = 'SELECT COUNT(topic_id) as total_results
FROM (SELECT DISTINCT t.topic_id';
@@ -1017,7 +1017,7 @@ class fulltext_native extends \phpbb\search\base
$post_visibility
$sql_fora
AND t.topic_id = p.topic_id
- $sql_time" . (($this->db->sql_layer == 'sqlite' || $this->db->sql_layer == 'sqlite3') ? ')' : '');
+ $sql_time" . (($this->db->get_sql_layer() == 'sqlite' || $this->db->get_sql_layer() == 'sqlite3') ? ')' : '');
}
$result = $this->db->sql_query($sql);
@@ -1481,7 +1481,7 @@ class fulltext_native extends \phpbb\search\base
*/
public function delete_index($acp_module, $u_action)
{
- switch ($this->db->sql_layer)
+ switch ($this->db->get_sql_layer())
{
case 'sqlite':
case 'sqlite3':
diff --git a/phpBB/phpbb/search/fulltext_postgres.php b/phpBB/phpbb/search/fulltext_postgres.php
index bdb5a86009..b3e7f51f87 100644
--- a/phpBB/phpbb/search/fulltext_postgres.php
+++ b/phpBB/phpbb/search/fulltext_postgres.php
@@ -31,18 +31,6 @@ class fulltext_postgres extends \phpbb\search\base
protected $split_words = array();
/**
- * True if PostgreSQL version supports tsearch
- * @var boolean
- */
- protected $tsearch_usable = false;
-
- /**
- * Stores the PostgreSQL version
- * @var string
- */
- protected $version;
-
- /**
* Stores the tsearch query
* @var string
*/
@@ -107,16 +95,6 @@ class fulltext_postgres extends \phpbb\search\base
$this->word_length = array('min' => $this->config['fulltext_postgres_min_word_len'], 'max' => $this->config['fulltext_postgres_max_word_len']);
- if ($this->db->sql_layer == 'postgres')
- {
- $pgsql_version = explode(',', substr($this->db->sql_server_info(), 10));
- $this->version = trim($pgsql_version[0]);
- if (version_compare($this->version, '8.3', '>='))
- {
- $this->tsearch_usable = true;
- }
- }
-
/**
* Load the UTF tools
*/
@@ -185,16 +163,11 @@ class fulltext_postgres extends \phpbb\search\base
*/
public function init()
{
- if ($this->db->sql_layer != 'postgres')
+ if ($this->db->get_sql_layer() != 'postgres')
{
return $this->user->lang['FULLTEXT_POSTGRES_INCOMPATIBLE_DATABASE'];
}
- if (!$this->tsearch_usable)
- {
- return $this->user->lang['FULLTEXT_POSTGRES_TS_NOT_USABLE'];
- }
-
return false;
}
@@ -869,7 +842,7 @@ class fulltext_postgres extends \phpbb\search\base
*/
protected function get_stats()
{
- if ($this->db->sql_layer != 'postgres')
+ if ($this->db->get_sql_layer() != 'postgres')
{
$this->stats = array();
return;
@@ -913,13 +886,13 @@ class fulltext_postgres extends \phpbb\search\base
$tpl = '
<dl>
<dt><label>' . $this->user->lang['FULLTEXT_POSTGRES_VERSION_CHECK'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_POSTGRES_VERSION_CHECK_EXPLAIN'] . '</span></dt>
- <dd>' . (($this->tsearch_usable) ? $this->user->lang['YES'] : $this->user->lang['NO']) . ' (PostgreSQL ' . $this->version . ')</dd>
+ <dd>' . (($this->db->get_sql_layer() == 'postgres') ? $this->user->lang['YES'] : $this->user->lang['NO']) . '</dd>
</dl>
<dl>
<dt><label>' . $this->user->lang['FULLTEXT_POSTGRES_TS_NAME'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_POSTGRES_TS_NAME_EXPLAIN'] . '</span></dt>
<dd><select name="config[fulltext_postgres_ts_name]">';
- if ($this->db->sql_layer == 'postgres' && $this->tsearch_usable)
+ if ($this->db->get_sql_layer() == 'postgres')
{
$sql = 'SELECT cfgname AS ts_name
FROM pg_ts_config';
diff --git a/phpBB/phpbb/search/fulltext_sphinx.php b/phpBB/phpbb/search/fulltext_sphinx.php
index 9008af338b..78c11f1180 100644
--- a/phpBB/phpbb/search/fulltext_sphinx.php
+++ b/phpBB/phpbb/search/fulltext_sphinx.php
@@ -199,7 +199,7 @@ class fulltext_sphinx
*/
public function init()
{
- if ($this->db->sql_layer != 'mysql' && $this->db->sql_layer != 'mysql4' && $this->db->sql_layer != 'mysqli' && $this->db->sql_layer != 'postgres')
+ if ($this->db->get_sql_layer() != 'mysql' && $this->db->get_sql_layer() != 'mysql4' && $this->db->get_sql_layer() != 'mysqli' && $this->db->get_sql_layer() != 'postgres')
{
return $this->user->lang['FULLTEXT_SPHINX_WRONG_DATABASE'];
}
@@ -218,11 +218,11 @@ class fulltext_sphinx
protected function config_generate()
{
// Check if Database is supported by Sphinx
- if ($this->db->sql_layer =='mysql' || $this->db->sql_layer == 'mysql4' || $this->db->sql_layer == 'mysqli')
+ if ($this->db->get_sql_layer() =='mysql' || $this->db->get_sql_layer() == 'mysql4' || $this->db->get_sql_layer() == 'mysqli')
{
$this->dbtype = 'mysql';
}
- else if ($this->db->sql_layer == 'postgres')
+ else if ($this->db->get_sql_layer() == 'postgres')
{
$this->dbtype = 'pgsql';
}
diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php
index cceefda7ef..c5dc7273ba 100644
--- a/phpBB/phpbb/template/twig/lexer.php
+++ b/phpBB/phpbb/template/twig/lexer.php
@@ -285,7 +285,7 @@ class lexer extends \Twig_Lexer
return "<!-- {$matches[1]}IF{$inner}-->";
};
- return preg_replace_callback('#<!-- (ELSE)?IF((.*?) \(*!?[\$|\.]([^\s]+)(.*?))-->#', $callback, $code);
+ return preg_replace_callback('#<!-- (ELSE)?IF((.*?) (?:\(*!?[\$|\.]([^\s]+)(.*?))?)-->#', $callback, $code);
}
/**
diff --git a/phpBB/phpbb/viewonline_helper.php b/phpBB/phpbb/viewonline_helper.php
new file mode 100644
index 0000000000..b722f9d911
--- /dev/null
+++ b/phpBB/phpbb/viewonline_helper.php
@@ -0,0 +1,54 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb;
+
+/**
+* Class to handle viewonline related tasks
+*/
+class viewonline_helper
+{
+ /** @var \phpbb\filesystem */
+ protected $filesystem;
+
+ /**
+ * @param \phpbb\filesystem $filesystem
+ */
+ public function __construct(\phpbb\filesystem $filesystem)
+ {
+ $this->filesystem = $filesystem;
+ }
+
+ /**
+ * Get user page
+ *
+ * @param string $session_page User's session page
+ * @return array Match array filled by preg_match()
+ */
+ public function get_user_page($session_page)
+ {
+ $session_page = $this->filesystem->clean_path($session_page);
+ if (strpos($session_page, './') === 0)
+ {
+ $session_page = substr($session_page, 2);
+ }
+
+ preg_match('#^((\.\./)*([a-z0-9/_-]+))#i', $session_page, $on_page);
+ if (empty($on_page))
+ {
+ $on_page[1] = '';
+ }
+
+ return $on_page;
+ }
+}
diff --git a/phpBB/search.php b/phpBB/search.php
index c01fcfede7..071db30f3d 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -145,7 +145,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
trigger_error($user->lang('TOO_FEW_AUTHOR_CHARS', (int) $config['min_search_author_chars']));
}
- $sql_where = (strpos($author, '*') !== false) ? ' username_clean ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($author))) : " username_clean = '" . $db->sql_escape(utf8_clean_string($author)) . "'";
+ $sql_where = (strpos($author, '*') !== false) ? ' username_clean ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), utf8_clean_string($author))) : " username_clean = '" . $db->sql_escape(utf8_clean_string($author)) . "'";
$sql = 'SELECT user_id
FROM ' . USERS_TABLE . "
@@ -159,7 +159,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
}
$db->sql_freeresult($result);
- $sql_where = (strpos($author, '*') !== false) ? ' post_username ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($author))) : " post_username = '" . $db->sql_escape(utf8_clean_string($author)) . "'";
+ $sql_where = (strpos($author, '*') !== false) ? ' post_username ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), utf8_clean_string($author))) : " post_username = '" . $db->sql_escape(utf8_clean_string($author)) . "'";
$sql = 'SELECT 1 as guest_post
FROM ' . POSTS_TABLE . "
@@ -172,7 +172,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
if ($found_guest_post)
{
$author_id_ary[] = ANONYMOUS;
- $sql_author_match = (strpos($author, '*') !== false) ? ' ' . $db->sql_like_expression(str_replace('*', $db->any_char, utf8_clean_string($author))) : " = '" . $db->sql_escape(utf8_clean_string($author)) . "'";
+ $sql_author_match = (strpos($author, '*') !== false) ? ' ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), utf8_clean_string($author))) : " = '" . $db->sql_escape(utf8_clean_string($author)) . "'";
}
if (!sizeof($author_id_ary))
@@ -1296,7 +1296,7 @@ $template->assign_vars(array(
if ($auth->acl_get('a_search'))
{
// Handle large objects differently for Oracle and MSSQL
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'oracle':
$sql = 'SELECT search_time, search_keywords
diff --git a/phpBB/styles/prosilver/style.cfg b/phpBB/styles/prosilver/style.cfg
index b75207bd70..520b1f0e98 100644
--- a/phpBB/styles/prosilver/style.cfg
+++ b/phpBB/styles/prosilver/style.cfg
@@ -21,8 +21,8 @@
# General Information about this style
name = prosilver
copyright = © phpBB Limited, 2007
-style_version = 3.1.0-RC1
-phpbb_version = 3.1.0-RC1
+style_version = 3.1.0-RC2
+phpbb_version = 3.1.0-RC2
# Defining a different template bitfield
# template_bitfield = lNg=
diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js
index e9f8064b9e..70bc703582 100644
--- a/phpBB/styles/prosilver/template/ajax.js
+++ b/phpBB/styles/prosilver/template/ajax.js
@@ -356,37 +356,6 @@ $('.display_post').click(function(e) {
$('#post_hidden' + post_id).hide();
});
-
-
-/**
- * This AJAXifies the quick-mod tools. The reason it cannot be a standard
- * callback / data attribute is that it requires filtering - some of the options
- * can be ajaxified, while others cannot.
- */
-phpbb.ajaxify({
- selector: '#quickmodform',
- refresh: true,
- filter: function (data) {
- var action = $('#quick-mod-select').val();
-
- if (action === 'make_normal') {
- return $(this).find('select option[value="make_global"]').length > 0;
- } else if (action === 'lock' || action === 'unlock') {
- return true;
- }
-
- if (action === 'delete_topic' || action === 'make_sticky' || action === 'make_announce' || action === 'make_global') {
- return true;
- }
-
- return false;
- }
-});
-
-$('#quick-mod-select').change(function () {
- $('#quickmodform').submit();
-});
-
$('#delete_permanent').click(function () {
if ($(this).prop('checked')) {
$('#delete_reason').hide();
diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js
index ea2b815e77..4929e14ef7 100644
--- a/phpBB/styles/prosilver/template/forum_fn.js
+++ b/phpBB/styles/prosilver/template/forum_fn.js
@@ -382,10 +382,7 @@ function parse_document(container)
*/
if (oldBrowser) {
// Fix .linklist.bulletin lists
- container.find('ul.linklist.bulletin li:first-child, ul.linklist.bulletin li.rightside:last-child').addClass('no-bulletin');
-
- // Do not run functions below for old browsers
- return;
+ container.find('ul.linklist.bulletin > li:first-child, ul.linklist.bulletin > li.rightside:last-child').addClass('no-bulletin');
}
/**
@@ -483,6 +480,167 @@ function parse_document(container)
});
/**
+ * Responsive link lists
+ */
+ container.find('.linklist:not(.navlinks, [data-skip-responsive]), .postbody .post-buttons:not([data-skip-responsive])').each(function() {
+ var $this = $(this),
+ $body = $('body'),
+ filterSkip = '.breadcrumbs, [data-skip-responsive]',
+ filterLast = '.edit-icon, .quote-icon, [data-last-responsive]',
+ persist = $this.attr('id') == 'nav-main',
+ allLinks = $this.children(),
+ links = allLinks.not(filterSkip),
+ html = '<li class="responsive-menu" style="display:none;"><a href="javascript:void(0);" class="responsive-menu-link">&nbsp;</a><div class="dropdown" style="display:none;"><div class="pointer"><div class="pointer-inner" /></div><ul class="dropdown-contents" /></div></li>',
+ filterLastList = links.filter(filterLast),
+ slack = 1; // Vertical slack space (in pixels). Determines how sensitive the script is in determining whether a line-break has occured.
+
+ if (!persist) {
+ if (links.is('.rightside'))
+ {
+ links.filter('.rightside:first').before(html);
+ $this.children('.responsive-menu').addClass('rightside');
+ }
+ else
+ {
+ $this.append(html);
+ }
+ }
+
+ var item = $this.children('.responsive-menu'),
+ menu = item.find('.dropdown-contents'),
+ lastWidth = false,
+ compact = false,
+ responsive = false,
+ copied = false;
+
+ function check() {
+ var width = $body.width();
+ if (responsive && width <= lastWidth) {
+ return;
+ }
+
+ // Unhide the quick-links menu if it has content
+ if (persist) {
+ item.addClass('hidden');
+ if (menu.find('li:not(.separator, .clone)').length || (responsive && menu.find('li.clone').length)) {
+ item.removeClass('hidden');
+ }
+ }
+
+ // Reset responsive and compact layout
+ if (responsive) {
+ responsive = false;
+ $this.removeClass('responsive');
+ links.css('display', '');
+ if (!persist) item.css('display', 'none');
+ }
+
+ if (compact) {
+ compact = false;
+ $this.removeClass('compact');
+ }
+
+ // Find tallest element
+ var maxHeight = 0;
+ allLinks.each(function() {
+ if (!$(this).height()) return;
+ maxHeight = Math.max(maxHeight, $(this).outerHeight(true));
+ });
+
+ if (maxHeight < 1) {
+ return;
+ }
+
+ // Nothing to resize if block's height is not bigger than tallest element's height
+ if ($this.height() <= (maxHeight + slack)) {
+ return;
+ }
+
+ // Enable compact layout, find tallest element, compare to height of whole block
+ compact = true;
+ $this.addClass('compact');
+
+ var compactMaxHeight = 0;
+ allLinks.each(function() {
+ if (!$(this).height()) return;
+ compactMaxHeight = Math.max(compactMaxHeight, $(this).outerHeight(true));
+ });
+
+ if ($this.height() <= (maxHeight + slack)) {
+ return;
+ }
+
+ // Compact layout did not resize block enough, switch to responsive layout
+ compact = false;
+ $this.removeClass('compact');
+ responsive = true;
+
+ if (!copied) {
+ var clone = links.clone(true);
+ clone.filter('.rightside').each(function() {
+ if (persist) $(this).addClass('clone');
+ menu.prepend(this);
+ });
+
+ if (persist) {
+ menu.prepend(clone.not('.rightside').addClass('clone'));
+ } else {
+ menu.prepend(clone.not('.rightside'));
+ }
+
+ menu.find('li.leftside, li.rightside').removeClass('leftside rightside');
+ menu.find('.inputbox').parents('li:first').css('white-space', 'normal');
+
+ if ($this.hasClass('post-buttons')) {
+ $('.button', menu).removeClass('button icon-button');
+ $('.responsive-menu-link', item).addClass('button icon-button').prepend('<span></span>');
+ }
+ copied = true;
+ }
+ else {
+ menu.children().css('display', '');
+ }
+
+ item.css('display', '');
+ $this.addClass('responsive');
+
+ // Try to not hide filtered items
+ if (filterLastList.length) {
+ links.not(filterLast).css('display', 'none');
+
+ maxHeight = 0;
+ filterLastList.each(function() {
+ if (!$(this).height()) return;
+ maxHeight = Math.max(maxHeight, $(this).outerHeight(true));
+ });
+
+ if ($this.height() <= (maxHeight + slack)) {
+ menu.children().filter(filterLast).css('display', 'none');
+ return;
+ }
+ }
+
+ // If even responsive isn't enough, use both responsive and compact at same time
+ compact = true;
+ $this.addClass('compact');
+
+ links.css('display', 'none');
+ }
+
+ if (!persist) phpbb.registerDropdown(item.find('a.responsive-menu-link'), item.find('.dropdown'));
+
+ check();
+ $(window).resize(check);
+ });
+
+ /**
+ * Do not run functions below for old browsers
+ */
+ if (oldBrowser) {
+ return;
+ }
+
+ /**
* Adjust topiclist lists with check boxes
*/
container.find('ul.topiclist dd.mark').siblings('dt').children('.list-inner').addClass('with-mark');
@@ -667,136 +825,6 @@ function parse_document(container)
});
/**
- * Responsive link lists
- */
- container.find('.linklist:not(.navlinks, [data-skip-responsive]), .postbody .post-buttons:not([data-skip-responsive])').each(function() {
- var $this = $(this),
- $body = $('body'),
- filterSkip = '.breadcrumbs, [data-skip-responsive]',
- filterLast = '.pagination, .icon-notifications, .icon-pm, .icon-logout, .icon-login, .mark-read, .edit-icon, .quote-icon',
- allLinks = $this.children(),
- links = allLinks.not(filterSkip),
- html = '<li class="responsive-menu" style="display:none;"><a href="javascript:void(0);" class="responsive-menu-link">&nbsp;</a><div class="dropdown" style="display:none;"><div class="pointer"><div class="pointer-inner" /></div><ul class="dropdown-contents" /></div></li>',
- filterLastList = links.filter(filterLast);
-
- if (links.is('.rightside'))
- {
- links.filter('.rightside:first').before(html);
- }
- else
- {
- $this.append(html);
- }
-
- var item = $this.children('.responsive-menu'),
- menu = item.find('.dropdown-contents'),
- lastWidth = false,
- compact = false,
- responsive = false,
- copied = false;
-
- function check() {
- var width = $body.width();
- if (responsive && width <= lastWidth) {
- return;
- }
-
- // Reset responsive and compact layout
- if (responsive) {
- responsive = false;
- $this.removeClass('responsive');
- links.css('display', '');
- item.css('display', 'none');
- }
-
- if (compact) {
- compact = false;
- $this.removeClass('compact');
- }
-
- // Find tallest element
- var maxHeight = 0;
- allLinks.each(function() {
- if (!$(this).height()) return;
- maxHeight = Math.max(maxHeight, $(this).outerHeight(true));
- });
-
- if (maxHeight < 1) {
- return;
- }
-
- // Nothing to resize if block's height is not bigger than tallest element's height
- if ($this.height() <= maxHeight) {
- return;
- }
-
- // Enable compact layout, find tallest element, compare to height of whole block
- compact = true;
- $this.addClass('compact');
-
- var compactMaxHeight = 0;
- allLinks.each(function() {
- if (!$(this).height()) return;
- compactMaxHeight = Math.max(compactMaxHeight, $(this).outerHeight(true));
- });
-
- if ($this.height() <= maxHeight) {
- return;
- }
-
- // Compact layout did not resize block enough, switch to responsive layout
- compact = false;
- $this.removeClass('compact');
- responsive = true;
-
- if (!copied) {
- var clone = links.clone(true);
- clone.filter('.rightside').each(function() {
- menu.prepend(this);
- });
- menu.prepend(clone.not('.rightside'));
- menu.find('li.leftside, li.rightside').removeClass('leftside rightside');
- menu.find('.inputbox').parents('li:first').css('white-space', 'normal');
-
- if ($this.hasClass('post-buttons')) {
- $('.button', menu).removeClass('button icon-button');
- $('.responsive-menu-link', item).addClass('button icon-button').prepend('<span></span>');
- }
- copied = true;
- }
- else {
- menu.children().css('display', '');
- }
-
- item.css('display', '');
- $this.addClass('responsive');
-
- // Try to not hide filtered items
- if (filterLastList.length) {
- links.not(filterLast).css('display', 'none');
-
- maxHeight = 0;
- filterLastList.each(function() {
- if (!$(this).height()) return;
- maxHeight = Math.max(maxHeight, $(this).outerHeight(true));
- });
-
- if ($this.height() <= maxHeight) {
- menu.children().filter(filterLast).css('display', 'none');
- return;
- }
- }
-
- links.css('display', 'none');
- }
-
- phpbb.registerDropdown(item.find('a.responsive-menu-link'), item.find('.dropdown'));
-
- check();
- $(window).resize(check);
- });
-
- /**
* Responsive tabs
*/
container.find('#tabs, #minitabs').not('[data-skip-responsive]').each(function() {
diff --git a/phpBB/styles/prosilver/template/index_body.html b/phpBB/styles/prosilver/template/index_body.html
index f9c5b4cf20..1e1eb22c6f 100644
--- a/phpBB/styles/prosilver/template/index_body.html
+++ b/phpBB/styles/prosilver/template/index_body.html
@@ -1,27 +1,15 @@
<!-- INCLUDE overall_header.html -->
-<p class="{S_CONTENT_FLOW_END} responsive-center<!-- IF S_USER_LOGGED_IN --> rightside<!-- ENDIF -->"><!-- IF S_USER_LOGGED_IN -->{LAST_VISIT_DATE}<!-- ELSE -->{CURRENT_TIME}<!-- ENDIF --></p>
-<!-- IF S_USER_LOGGED_IN --><p class="responsive-center">{CURRENT_TIME}<!-- IF U_MCP or U_ACP --> <br />[&nbsp;<!-- IF U_ACP --><a href="{U_ACP}" title="{L_ACP}" data-responsive-text="{L_ACP_SHORT}">{L_ACP}</a><!-- IF U_MCP -->&nbsp;|&nbsp;<!-- ENDIF --><!-- ENDIF --><!-- IF U_MCP --><a href="{U_MCP}" title="{L_MCP}" data-responsive-text="{L_MCP_SHORT}">{L_MCP}</a><!-- ENDIF -->&nbsp;]<!-- ENDIF --></p><!-- ENDIF -->
+<p class="{S_CONTENT_FLOW_END} responsive-center time<!-- IF S_USER_LOGGED_IN --> rightside<!-- ENDIF -->"><!-- IF S_USER_LOGGED_IN -->{LAST_VISIT_DATE}<!-- ELSE -->{CURRENT_TIME}<!-- ENDIF --></p>
+<!-- IF S_USER_LOGGED_IN --><p class="responsive-center time">{CURRENT_TIME}</p><!-- ENDIF -->
-<!-- EVENT index_body_linklist_before -->
-
-<!-- IF S_DISPLAY_SEARCH or (S_USER_LOGGED_IN and not S_IS_BOT) -->
-<ul class="linklist bulletin">
- <!-- IF S_DISPLAY_SEARCH -->
- <li><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a></li>
- <!-- IF S_LOAD_UNREADS -->
- <li><a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a></li>
- <!-- ENDIF -->
- <!-- IF S_USER_LOGGED_IN -->
- <li><a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a></li>
- <!-- ENDIF -->
- <li><a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></li>
- <!-- ENDIF -->
- <!-- IF not S_IS_BOT and U_MARK_FORUMS --><li class="rightside mark-read"><a href="{U_MARK_FORUMS}" accesskey="m" data-ajax="mark_forums_read">{L_MARK_FORUMS_READ}</a></li><!-- ENDIF -->
-</ul>
+<!-- EVENT index_body_markforums_before -->
+<!-- IF U_MARK_FORUMS -->
+ <div class="action-bar compact">
+ <a href="{U_MARK_FORUMS}" class="mark-read rightside" accesskey="m" data-ajax="mark_forums_read">{L_MARK_FORUMS_READ}</a>
+ </div>
<!-- ENDIF -->
-
-<!-- EVENT index_body_linklist_after -->
+<!-- EVENT index_body_markforums_after -->
<!-- INCLUDE forumlist_body.html -->
diff --git a/phpBB/styles/prosilver/template/jumpbox.html b/phpBB/styles/prosilver/template/jumpbox.html
index 47d322407d..44b479ab3f 100644
--- a/phpBB/styles/prosilver/template/jumpbox.html
+++ b/phpBB/styles/prosilver/template/jumpbox.html
@@ -10,24 +10,22 @@
<!-- ENDIF -->
<!-- IF S_DISPLAY_JUMPBOX -->
- <form method="get" id="jumpbox" action="{S_JUMPBOX_ACTION}" onsubmit="if(this.f.value == -1){return false;}">
- <!-- IF $CUSTOM_FIELDSET_CLASS -->
- <fieldset class="{$CUSTOM_FIELDSET_CLASS}">
- <!-- ELSE -->
- <fieldset class="jumpbox">
- <!-- ENDIF -->
- {HIDDEN_FIELDS_FOR_JUMPBOX}
- <label for="f" accesskey="j"><!-- IF S_IN_MCP and S_MERGE_SELECT -->{L_SELECT_TOPICS_FROM}<!-- ELSEIF S_IN_MCP -->{L_MODERATE_FORUM}<!-- ELSE -->{L_JUMP_TO}<!-- ENDIF -->{L_COLON}</label>
- <select name="f" id="f" onchange="if(this.options[this.selectedIndex].value != -1){ document.forms['jumpbox'].submit() }">
+ <div class="dropdown-container dropdown-container-{S_CONTENT_FLOW_END}<!-- IF not S_IN_MCP --> dropdown-up<!-- ENDIF --> dropdown-{S_CONTENT_FLOW_BEGIN} dropdown-button-control" id="jumpbox">
+ <span title="<!-- IF S_IN_MCP and S_MERGE_SELECT -->{L_SELECT_TOPICS_FROM}<!-- ELSEIF S_IN_MCP -->{L_MODERATE_FORUM}<!-- ELSE -->{L_JUMP_TO}<!-- ENDIF -->" class="dropdown-trigger button dropdown-select">
+ <!-- IF S_IN_MCP and S_MERGE_SELECT -->{L_SELECT_TOPICS_FROM}<!-- ELSEIF S_IN_MCP -->{L_MODERATE_FORUM}<!-- ELSE -->{L_JUMP_TO}<!-- ENDIF -->
+ </span>
+ <div class="dropdown hidden">
+ <div class="pointer"><div class="pointer-inner"></div></div>
+ <ul class="dropdown-contents">
<!-- BEGIN jumpbox_forums -->
- <!-- IF jumpbox_forums.S_FORUM_COUNT == 1 --><option value="-1">------------------</option><!-- ENDIF -->
- <option value="{jumpbox_forums.FORUM_ID}"{jumpbox_forums.SELECTED}><!-- BEGIN level -->&nbsp; &nbsp;<!-- END level -->{jumpbox_forums.FORUM_NAME}</option>
+ <!-- IF jumpbox_forums.FORUM_ID neq -1 -->
+ <li><!-- BEGIN level -->&nbsp; &nbsp;<!-- END level --><a href="{jumpbox_forums.LINK}">{jumpbox_forums.FORUM_NAME}</a></li>
+ <!-- ENDIF -->
<!-- END jumpbox_forums -->
- </select>
- <input type="submit" value="{L_GO}" class="button2" />
- </fieldset>
- </form>
+ </ul>
+ </div>
+ </div>
<!-- ELSE -->
<br /><br />
diff --git a/phpBB/styles/prosilver/template/mcp_ban.html b/phpBB/styles/prosilver/template/mcp_ban.html
index 591dbf8076..9504d16284 100644
--- a/phpBB/styles/prosilver/template/mcp_ban.html
+++ b/phpBB/styles/prosilver/template/mcp_ban.html
@@ -42,6 +42,7 @@
<p>{L_EXPLAIN}</p>
<fieldset>
+ <!-- EVENT mcp_ban_fields_before -->
<dl>
<dt><label for="ban">{L_BAN_CELL}{L_COLON}</label></dt>
<dd><label for="ban"><textarea name="ban" id="ban" class="inputbox" cols="40" rows="3">{BAN_QUANTIFIER}</textarea></label></dd>
@@ -70,6 +71,7 @@
<label for="banexclude0"><input type="radio" name="banexclude" id="banexclude0" value="0" checked="checked" /> {L_NO}</label>
</dd>
</dl>
+ <!-- EVENT mcp_ban_fields_after -->
</fieldset>
</div>
@@ -89,6 +91,7 @@
<!-- IF S_BANNED_OPTIONS -->
<fieldset>
+ <!-- EVENT mcp_ban_unban_before -->
<dl>
<dt><label for="unban">{L_BAN_CELL}{L_COLON}</label></dt>
<dd><select name="unban[]" id="unban" multiple="multiple" size="5" onchange="if (this.selectedIndex != -1) {display_details(this.options[this.selectedIndex].value);}">{BANNED_OPTIONS}</select></dd>
@@ -105,6 +108,7 @@
<dt>{L_BAN_GIVE_REASON}{L_COLON}</dt>
<dd><strong id="unbangivereason"></strong></dd>
</dl>
+ <!-- EVENT mcp_ban_unban_after -->
</fieldset>
</div>
diff --git a/phpBB/styles/prosilver/template/mcp_forum.html b/phpBB/styles/prosilver/template/mcp_forum.html
index c9f81a4099..8fdec01212 100644
--- a/phpBB/styles/prosilver/template/mcp_forum.html
+++ b/phpBB/styles/prosilver/template/mcp_forum.html
@@ -48,6 +48,13 @@
<!-- IF topicrow.S_TOPIC_REPORTED --><a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF -->
<!-- IF topicrow.S_MOVED_TOPIC and S_CAN_DELETE -->&nbsp;<a href="{topicrow.U_DELETE_TOPIC}" class="topictitle">[ {L_DELETE_SHADOW_TOPIC} ]</a><!-- ENDIF -->
<br />
+
+ <div class="responsive-show" style="display: none;">
+ <!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->
+ {L_LAST_POST} {L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL} &laquo; {topicrow.LAST_POST_TIME}<br />
+ </div>
+ <span class="responsive-show left-box" style="display: none;">{L_REPLIES}{L_COLON} <strong>{topicrow.REPLIES}</strong></span>
+
<!-- IF .topicrow.pagination -->
<div class="pagination">
<ul>
@@ -62,15 +69,11 @@
</ul>
</div>
<!-- ENDIF -->
+
<div class="responsive-hide">
<!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->
{L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} &raquo; {topicrow.FIRST_POST_TIME}
</div>
- <div class="responsive-show" style="display: none;">
- <!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->
- {L_LAST_POST} {L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL} &laquo; {topicrow.LAST_POST_TIME}<br />
- {L_REPLIES}{L_COLON} <strong>{topicrow.REPLIES}</strong>
- </div>
</div>
</dt>
diff --git a/phpBB/styles/prosilver/template/memberlist_search.html b/phpBB/styles/prosilver/template/memberlist_search.html
index 4c14baf2b6..4fba966151 100644
--- a/phpBB/styles/prosilver/template/memberlist_search.html
+++ b/phpBB/styles/prosilver/template/memberlist_search.html
@@ -29,18 +29,20 @@
<dd><input type="text" name="email" id="email" value="{EMAIL}" class="inputbox" /></dd>
</dl>
<!-- ENDIF -->
+<!-- IF S_JABBER_ENABLED -->
<dl>
<dt><label for="jabber">{L_JABBER}:</label></dt>
<dd><input type="text" name="jabber" id="jabber" value="{JABBER}" class="inputbox" /></dd>
</dl>
- <dl>
- <dt><label for="search_group_id">{L_GROUP}{L_COLON}</label></dt>
- <dd><select name="search_group_id" id="search_group_id">{S_GROUP_SELECT}</select></dd>
- </dl>
- <dl>
- <dt><label for="sk" class="label3">{L_SORT_BY}{L_COLON}</label></dt>
- <dd><select name="sk" id="sk">{S_SORT_OPTIONS}</select> <select name="sd">{S_ORDER_SELECT}</select></dd>
- </dl>
+<!-- ENDIF -->
+ <dl>
+ <dt><label for="search_group_id">{L_GROUP}{L_COLON}</label></dt>
+ <dd><select name="search_group_id" id="search_group_id">{S_GROUP_SELECT}</select></dd>
+ </dl>
+ <dl>
+ <dt><label for="sk" class="label3">{L_SORT_BY}{L_COLON}</label></dt>
+ <dd><select name="sk" id="sk">{S_SORT_OPTIONS}</select> <select name="sd">{S_ORDER_SELECT}</select></dd>
+ </dl>
</fieldset>
<fieldset class="fields1 column2">
diff --git a/phpBB/styles/prosilver/template/navbar_footer.html b/phpBB/styles/prosilver/template/navbar_footer.html
index e2259e8712..f8ca83163b 100644
--- a/phpBB/styles/prosilver/template/navbar_footer.html
+++ b/phpBB/styles/prosilver/template/navbar_footer.html
@@ -1,23 +1,25 @@
<div class="navbar">
<div class="inner">
- <ul class="linklist bulletin">
+ <ul id="nav-footer" class="linklist bulletin" role="menubar">
<li class="small-icon icon-home breadcrumbs">
<!-- IF U_SITE_HOME --><span class="crumb"><a href="{U_SITE_HOME}" data-navbar-reference="home">{L_SITE_HOME}</a></span><!-- ENDIF -->
<span class="crumb"><a href="{U_INDEX}" data-navbar-reference="index">{L_INDEX}</a></span>
<!-- EVENT overall_footer_breadcrumb_append -->
</li>
- <!-- IF not S_IS_BOT -->
- <!-- IF U_WATCH_FORUM_LINK --><li class="small-icon icon-<!-- IF S_WATCHING_FORUM -->unsubscribe<!-- ELSE -->subscribe<!-- ENDIF -->"><a href="{U_WATCH_FORUM_LINK}" title="{S_WATCH_FORUM_TITLE}" data-ajax="toggle_link" data-toggle-class="small-icon icon-<!-- IF not S_WATCHING_FORUM -->unsubscribe<!-- ELSE -->subscribe<!-- ENDIF -->" data-toggle-text="{S_WATCH_FORUM_TOGGLE}" data-toggle-url="{U_WATCH_FORUM_TOGGLE}">{S_WATCH_FORUM_TITLE}</a></li><!-- ENDIF -->
- <!-- ENDIF -->
+ <!-- IF U_WATCH_FORUM_LINK and not S_IS_BOT --><li class="small-icon icon-<!-- IF S_WATCHING_FORUM -->unsubscribe<!-- ELSE -->subscribe<!-- ENDIF -->" data-last-responsive="true"><a href="{U_WATCH_FORUM_LINK}" title="{S_WATCH_FORUM_TITLE}" data-ajax="toggle_link" data-toggle-class="small-icon icon-<!-- IF not S_WATCHING_FORUM -->unsubscribe<!-- ELSE -->subscribe<!-- ENDIF -->" data-toggle-text="{S_WATCH_FORUM_TOGGLE}" data-toggle-url="{U_WATCH_FORUM_TOGGLE}">{S_WATCH_FORUM_TITLE}</a></li><!-- ENDIF -->
+
<!-- EVENT overall_footer_timezone_before -->
<li class="rightside">{S_TIMEZONE}</li>
<!-- EVENT overall_footer_timezone_after -->
- <!-- IF not S_IS_BOT --><li class="rightside"><a href="{U_DELETE_COOKIES}" data-ajax="true" data-refresh="true">{L_DELETE_COOKIES}</a></li><!-- ENDIF -->
+ <!-- IF not S_IS_BOT -->
+ <li class="small-icon icon-delete-cookies rightside"><a href="{U_DELETE_COOKIES}" data-ajax="true" data-refresh="true" role="menuitem">{L_DELETE_COOKIES}</a></li>
+ <!-- IF S_DISPLAY_MEMBERLIST --><li class="small-icon icon-members rightside" data-last-responsive="true"><a href="{U_MEMBERLIST}" title="{L_MEMBERLIST_EXPLAIN}" role="menuitem">{L_MEMBERLIST}</a></li><!-- ENDIF -->
+ <!-- ENDIF -->
<!-- EVENT overall_footer_teamlink_before -->
- <!-- IF U_TEAM --><li class="rightside"><a href="{U_TEAM}">{L_THE_TEAM}</a></li><!-- ENDIF -->
- <!-- IF U_CONTACT_US --><li class="rightside"><a href="{U_CONTACT_US}">{L_CONTACT_US}</a></li><!-- ENDIF -->
+ <!-- IF U_TEAM --><li class="small-icon icon-team rightside" data-last-responsive="true"><a href="{U_TEAM}" role="menuitem">{L_THE_TEAM}</a></li><!-- ENDIF -->
<!-- EVENT overall_footer_teamlink_after -->
+ <!-- IF U_CONTACT_US --><li class="small-icon icon-contact rightside" data-last-responsive="true"><a href="{U_CONTACT_US}" role="menuitem">{L_CONTACT_US}</a></li><!-- ENDIF -->
</ul>
</div>
diff --git a/phpBB/styles/prosilver/template/navbar_header.html b/phpBB/styles/prosilver/template/navbar_header.html
index 67a3b553fd..a83cd5b0a2 100644
--- a/phpBB/styles/prosilver/template/navbar_header.html
+++ b/phpBB/styles/prosilver/template/navbar_header.html
@@ -1,7 +1,87 @@
-<div class="navbar">
+<div class="navbar" role="navigation">
<div class="inner">
- <ul class="linklist navlinks">
+ <ul id="nav-main" class="linklist bulletin" role="menubar">
+
+ <li id="quick-links" class="small-icon responsive-menu dropdown-container<!-- IF not S_DISPLAY_QUICK_LINKS and not S_DISPLAY_SEARCH --> hidden<!-- ENDIF -->" data-skip-responsive="true">
+ <a href="#" class="responsive-menu-link dropdown-trigger">{L_QUICK_LINKS}</a>
+ <div class="dropdown hidden">
+ <div class="pointer"><div class="pointer-inner"></div></div>
+ <ul class="dropdown-contents" role="menu">
+ <!-- EVENT navbar_header_quick_links_before -->
+
+ <!-- IF S_DISPLAY_SEARCH -->
+ <li class="separator"></li>
+ <!-- IF S_REGISTERED_USER -->
+ <li class="small-icon icon-search-self"><a href="{U_SEARCH_SELF}" role="menuitem">{L_SEARCH_SELF}</a></li>
+ <!-- ENDIF -->
+ <!-- IF S_USER_LOGGED_IN -->
+ <li class="small-icon icon-search-new"><a href="{U_SEARCH_NEW}" role="menuitem">{L_SEARCH_NEW}</a></li>
+ <!-- ENDIF -->
+ <!-- IF S_LOAD_UNREADS -->
+ <li class="small-icon icon-search-unread"><a href="{U_SEARCH_UNREAD}" role="menuitem">{L_SEARCH_UNREAD}</a></li>
+ <!-- ENDIF -->
+ <li class="small-icon icon-search-unanswered"><a href="{U_SEARCH_UNANSWERED}" role="menuitem">{L_SEARCH_UNANSWERED}</a></li>
+ <li class="small-icon icon-search-active"><a href="{U_SEARCH_ACTIVE_TOPICS}" role="menuitem">{L_SEARCH_ACTIVE_TOPICS}</a></li>
+ <!-- ENDIF -->
+ <li class="separator"></li>
+
+ <!-- EVENT navbar_header_quick_links_after -->
+ </ul>
+ </div>
+ </li>
+
+ <!-- EVENT overall_header_navigation_prepend -->
+ <li class="small-icon icon-faq" <!-- IF not S_USER_LOGGED_IN -->data-skip-responsive="true"<!-- ELSE -->data-last-responsive="true"<!-- ENDIF -->><a href="{U_FAQ}" title="{L_FAQ_EXPLAIN}" role="menuitem">{L_FAQ}</a></li>
+ <!-- EVENT overall_header_navigation_append -->
+ <!-- IF U_ACP --><li class="small-icon icon-acp" data-last-responsive="true"><a href="{U_ACP}" title="{L_ACP}" role="menuitem">{L_ACP_SHORT}</a></li><!-- ENDIF -->
+ <!-- IF U_MCP --><li class="small-icon icon-mcp" data-skip-responsive="true"><a href="{U_MCP}" title="{L_MCP}" role="menuitem">{L_MCP_SHORT}</a></li><!-- ENDIF -->
+
+ <!-- IF S_REGISTERED_USER -->
+ <li id="username_logged_in" class="rightside <!-- IF CURRENT_USER_AVATAR --> no-bulletin<!-- ENDIF -->" data-skip-responsive="true">
+ <!-- EVENT navbar_header_username_prepend -->
+ <div class="header-profile dropdown-container">
+ <a href="{U_PROFILE}" class="header-avatar dropdown-trigger"><!-- IF CURRENT_USER_AVATAR -->{CURRENT_USER_AVATAR} <!-- ENDIF -->{CURRENT_USERNAME_SIMPLE}</a>
+ <div class="dropdown hidden">
+ <div class="pointer"><div class="pointer-inner"></div></div>
+ <ul class="dropdown-contents" role="menu">
+ <!-- IF U_RESTORE_PERMISSIONS --><li class="small-icon icon-restore-permissions"><a href="{U_RESTORE_PERMISSIONS}">{L_RESTORE_PERMISSIONS}</a></li><!-- ENDIF -->
+
+ <!-- EVENT navbar_header_profile_list_before -->
+
+ <li class="small-icon icon-ucp"><a href="{U_PROFILE}" title="{L_PROFILE}" role="menuitem">{L_PROFILE}</a></li>
+ <li class="small-icon icon-profile"><a href="{U_USER_PROFILE}" title="{L_READ_PROFILE}" role="menuitem">{L_READ_PROFILE}</a></li>
+
+ <!-- EVENT navbar_header_profile_list_after -->
+
+ <li class="separator"></li>
+ <li class="small-icon icon-logout"><a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="x" role="menuitem">{L_LOGIN_LOGOUT}</a></li>
+ </ul>
+ </div>
+ </div>
+ <!-- EVENT navbar_header_username_append -->
+ </li>
+ <!-- IF S_DISPLAY_PM -->
+ <li class="small-icon icon-pm rightside" data-skip-responsive="true">
+ <a href="{U_PRIVATEMSGS}" role="menuitem"><span>{L_PRIVATE_MESSAGES} [</span><strong>{PRIVATE_MESSAGE_COUNT}</strong><span>]</span></a>
+ </li>
+ <!-- ENDIF -->
+ <!-- IF S_NOTIFICATIONS_DISPLAY -->
+ <li class="small-icon icon-notification dropdown-container dropdown-{S_CONTENT_FLOW_END} rightside" data-skip-responsive="true">
+ <a href="{U_VIEW_ALL_NOTIFICATIONS}" id="notification_list_button" class="dropdown-trigger"><span>{L_NOTIFICATIONS} [</span><strong>{NOTIFICATIONS_COUNT}</strong><span>]</span></a>
+ <!-- INCLUDE notification_dropdown.html -->
+ </li>
+ <!-- ENDIF -->
+ <!-- ELSE -->
+ <li class="small-icon icon-logout rightside" data-skip-responsive="true"><a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="x" role="menuitem">{L_LOGIN_LOGOUT}</a></li>
+ <!-- IF S_REGISTER_ENABLED and not (S_SHOW_COPPA or S_REGISTRATION) -->
+ <li class="small-icon icon-register rightside" data-skip-responsive="true"><a href="{U_REGISTER}" role="menuitem">{L_REGISTER}</a></li>
+ <!-- ENDIF -->
+ <!-- EVENT navbar_header_logged_out_content -->
+ <!-- ENDIF -->
+ </ul>
+
+ <ul id="nav-breadcrumbs" class="linklist navlinks" role="menubar">
<!-- DEFINE $MICRODATA = ' itemtype="http://data-vocabulary.org/Breadcrumb" itemscope=""' -->
<li class="small-icon icon-home breadcrumbs">
<!-- IF U_SITE_HOME --><span class="crumb"><a href="{U_SITE_HOME}"{$MICRODATA} data-navbar-reference="home">{L_SITE_HOME}</a></span><!-- ENDIF -->
@@ -14,55 +94,9 @@
<!-- EVENT overall_header_breadcrumb_append -->
</li>
- <!-- IF S_REGISTERED_USER -->
- <li id="username_logged_in" class="rightside">
- <!-- EVENT navbar_header_username_prepend -->
- <!-- IF CURRENT_USER_AVATAR -->
- <a href="{U_USER_PROFILE}" class="header-avatar">{CURRENT_USER_AVATAR}</a>
- <!-- ENDIF -->
- {CURRENT_USERNAME_FULL}
- <!-- EVENT navbar_header_username_append -->
- </li>
- <!-- ELSE -->
- <li id="logged_out" class="rightside">
- <!-- EVENT navbar_header_logged_out_content -->
- </li>
- <!-- ENDIF -->
- <!-- IF S_DISPLAY_SEARCH and not S_IN_SEARCH --><li class="responsive-search rightside" style="display: none;"><a href="{U_SEARCH}" title="{L_SEARCH_ADV_EXPLAIN}">{L_SEARCH}</a></li><!-- ENDIF -->
- </ul>
-
- <ul class="linklist bulletin">
- <!-- IF not S_IS_BOT and S_USER_LOGGED_IN -->
- <!-- IF S_NOTIFICATIONS_DISPLAY -->
- <li class="small-icon icon-notification dropdown-container dropdown-{S_CONTENT_FLOW_END}" data-skip-responsive="true">
- <a href="{U_VIEW_ALL_NOTIFICATIONS}" id="notification_list_button" class="dropdown-trigger"><span>{L_NOTIFICATIONS} [</span><strong>{NOTIFICATIONS_COUNT}</strong><span>]</span></a>
- <!-- INCLUDE notification_dropdown.html -->
- </li>
- <!-- ENDIF -->
- <!-- IF S_DISPLAY_PM -->
- <li class="small-icon icon-pm">
- <a href="{U_PRIVATEMSGS}"><span>{L_PRIVATE_MESSAGES} [</span><strong>{PRIVATE_MESSAGE_COUNT}</strong><span>]</span></a>
- </li>
- <!-- ENDIF -->
- <li class="small-icon icon-ucp">
- <a href="{U_PROFILE}" title="{L_PROFILE}" accesskey="e">{L_PROFILE}</a>
- </li>
- <!-- IF S_DISPLAY_SEARCH -->
- <li class="icon-search-self"><a href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a></li>
+ <!-- IF S_DISPLAY_SEARCH and not S_IN_SEARCH -->
+ <li class="rightside responsive-search" style="display: none;"><a href="{U_SEARCH}" title="{L_SEARCH_ADV_EXPLAIN}" role="menuitem">{L_SEARCH}</a></li>
<!-- ENDIF -->
- <!-- IF U_RESTORE_PERMISSIONS -->
- <li class="icon-restore-permissions"><a href="{U_RESTORE_PERMISSIONS}">{L_RESTORE_PERMISSIONS}</a></li>
- <!-- ENDIF -->
- <!-- ENDIF -->
-
- <!-- EVENT overall_header_navigation_append -->
- <!-- IF not S_IS_BOT -->
- <li class="small-icon icon-logout rightside no-bulletin"><a href="{U_LOGIN_LOGOUT}" title="{L_LOGIN_LOGOUT}" accesskey="x">{L_LOGIN_LOGOUT}</a></li>
- <!-- IF not S_USER_LOGGED_IN and S_REGISTER_ENABLED and not (S_SHOW_COPPA or S_REGISTRATION) --><li class="small-icon icon-register rightside no-bulletin"><a href="{U_REGISTER}">{L_REGISTER}</a></li><!-- ENDIF -->
- <!-- IF S_DISPLAY_MEMBERLIST --><li class="small-icon icon-members rightside no-bulletin"><a href="{U_MEMBERLIST}" title="{L_MEMBERLIST_EXPLAIN}">{L_MEMBERLIST}</a></li><!-- ENDIF -->
- <!-- ENDIF -->
- <li class="small-icon icon-faq rightside no-bulletin"><a href="{U_FAQ}" title="{L_FAQ_EXPLAIN}">{L_FAQ}</a></li>
- <!-- EVENT overall_header_navigation_prepend -->
</ul>
</div>
diff --git a/phpBB/styles/prosilver/template/pagination.html b/phpBB/styles/prosilver/template/pagination.html
index cde183291d..cb2c09bff7 100644
--- a/phpBB/styles/prosilver/template/pagination.html
+++ b/phpBB/styles/prosilver/template/pagination.html
@@ -7,7 +7,7 @@
<ul class="dropdown-contents">
<li>{L_JUMP_TO_PAGE}{L_COLON}</li>
<li class="page-jump-form">
- <input type="text" name="page-number" maxlength="6" title="{L_SEARCH_KEYWORDS}" class="inputbox tiny" value="" data-per-page="{PER_PAGE}" data-base-url="{BASE_URL|e('html_attr')}" data-start-name="{START_NAME}" />
+ <input type="number" name="page-number" maxlength="6" title="{L_JUMP_PAGE}" class="inputbox tiny" data-per-page="{PER_PAGE}" data-base-url="{BASE_URL|e('html_attr')}" data-start-name="{START_NAME}" />
<input class="button2" value="{L_GO}" type="button" />
</li>
</ul>
diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options.html b/phpBB/styles/prosilver/template/ucp_avatar_options.html
index 4b4581a59c..ca077fdf5b 100644
--- a/phpBB/styles/prosilver/template/ucp_avatar_options.html
+++ b/phpBB/styles/prosilver/template/ucp_avatar_options.html
@@ -17,7 +17,7 @@
<dl>
<dt><label>{L_AVATAR_TYPE}{L_COLON}</label></dt>
<dd><select name="avatar_driver" id="avatar_driver" data-togglable-settings="true">
- <option value="">{L_NO_AVATAR_CATEGORY}</option>
+ <option value="">{L_NO_AVATAR}</option>
<!-- BEGIN avatar_drivers -->
<option value="{avatar_drivers.DRIVER}"<!-- IF avatar_drivers.SELECTED --> selected="selected"<!-- ENDIF --> data-toggle-setting="#avatar_option_{avatar_drivers.DRIVER}">{avatar_drivers.L_TITLE}</option>
<!-- END avatar_drivers -->
diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html
index 84ab6ecb44..489c1c901a 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html
@@ -38,7 +38,7 @@
<dd class="profile-contact">
<strong>{L_CONTACT}{L_COLON}</strong>
<div class="dropdown-container dropdown-left">
- <a href="#" class="dropdown-trigger"><span class="imageset icon_contact"></span></a>
+ <a href="#" class="dropdown-trigger"><span class="imageset icon_contact" title="{CONTACT_USER}">{CONTACT_USER}</span></a>
<div class="dropdown hidden">
<div class="pointer"><div class="pointer-inner"></div></div>
<div class="dropdown-contents contact-icons">
@@ -49,7 +49,7 @@
<div>
<!-- ENDIF -->
<a href="<!-- IF contact.U_CONTACT -->{contact.U_CONTACT}<!-- ELSE -->{contact.U_PROFILE_AUTHOR}<!-- ENDIF -->" title="{contact.NAME}"<!-- IF $S_LAST_CELL --> class="last-cell"<!-- ENDIF --><!-- IF contact.ID eq 'jabber' --> onclick="popup(this.href, 550, 320); return false;"<!-- ENDIF -->>
- <span class="contact-icon {contact.ID}-icon"></span>
+ <span class="contact-icon {contact.ID}-icon">{contact.NAME}</span>
</a>
<!-- IF REMAINDER eq 3 or contact.S_LAST_ROW -->
</div>
@@ -67,6 +67,7 @@
<!-- IF U_DELETE or U_EDIT or U_QUOTE or U_REPORT -->
<ul class="post-buttons">
+ <!-- EVENT ucp_pm_viewmessage_post_buttons_before -->
<!-- IF U_EDIT -->
<li>
<a href="{U_EDIT}" title="{L_POST_EDIT_PM}" class="button icon-button edit-icon"><span>{L_POST_EDIT_PM}</span></a>
@@ -87,6 +88,7 @@
<a href="{U_QUOTE}" title="{L_POST_QUOTE_PM}" class="button icon-button quote-icon"><span>{L_POST_QUOTE_PM}</span></a>
</li>
<!-- ENDIF -->
+ <!-- EVENT ucp_pm_viewmessage_post_buttons_after -->
</ul>
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/ucp_profile_profile_info.html b/phpBB/styles/prosilver/template/ucp_profile_profile_info.html
index c0bf681f47..986bc92298 100644
--- a/phpBB/styles/prosilver/template/ucp_profile_profile_info.html
+++ b/phpBB/styles/prosilver/template/ucp_profile_profile_info.html
@@ -20,10 +20,12 @@
</dd>
</dl>
<!-- ENDIF -->
+ <!-- IF S_JABBER_ENABLED -->
<dl>
<dt><label for="jabber">{L_UCP_JABBER}{L_COLON}</label></dt>
<dd><input type="email" name="jabber" id="jabber" maxlength="255" value="{JABBER}" class="inputbox" /></dd>
</dl>
+ <!-- ENDIF -->
<!-- BEGIN profile_fields -->
<dl>
<dt><label<!-- IF profile_fields.FIELD_ID --> for="{profile_fields.FIELD_ID}"<!-- ENDIF -->>{profile_fields.LANG_NAME}{L_COLON}<!-- IF profile_fields.S_REQUIRED --> *<!-- ENDIF --></label>
diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html
index c44e830b9c..e8c50f79b2 100644
--- a/phpBB/styles/prosilver/template/viewforum_body.html
+++ b/phpBB/styles/prosilver/template/viewforum_body.html
@@ -1,5 +1,5 @@
<!-- INCLUDE overall_header.html -->
-<!-- IF U_MCP or U_ACP --><p class="responsive-center">[&nbsp;<!-- IF U_ACP --><a href="{U_ACP}" title="{L_ACP}" data-responsive-text="{L_ACP_SHORT}">{L_ACP}</a><!-- IF U_MCP -->&nbsp;|&nbsp;<!-- ENDIF --><!-- ENDIF --><!-- IF U_MCP --><a href="{U_MCP}" title="{L_MCP}" data-responsive-text="{L_MCP_SHORT}">{L_MCP}</a><!-- ENDIF -->&nbsp;]</p><!-- ENDIF -->
+
<h2 class="forum-title"><!-- EVENT viewforum_forum_name_prepend --><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a><!-- EVENT viewforum_forum_name_append --></h2>
<!-- IF FORUM_DESC or MODERATORS or U_MCP -->
@@ -27,15 +27,15 @@
<!-- IF S_HAS_SUBFORUM -->
<!-- IF not S_IS_BOT and U_MARK_FORUMS -->
-<ul class="linklist">
- <li class="rightside mark-read"><a href="{U_MARK_FORUMS}" data-ajax="mark_forums_read">{L_MARK_SUBFORUMS_READ}</a></li>
-</ul>
+ <div class="action-bar compact">
+ <a href="{U_MARK_FORUMS}" class="mark-read rightside" data-ajax="mark_forums_read">{L_MARK_SUBFORUMS_READ}</a>
+ </div>
<!-- ENDIF -->
<!-- INCLUDE forumlist_body.html -->
<!-- ENDIF -->
<!-- IF S_DISPLAY_POST_INFO or .pagination or TOTAL_POSTS or TOTAL_TOPICS -->
- <div class="action-bar top" <!-- IF S_HAS_SUBFORUM -->style="margin-top: 2em;"<!-- ENDIF -->>
+ <div class="action-bar top">
<!-- IF not S_IS_BOT and S_DISPLAY_POST_INFO -->
<div class="buttons">
@@ -150,6 +150,15 @@
<!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED --><a href="{topicrow.U_MCP_QUEUE}">{topicrow.UNAPPROVED_IMG}</a> <!-- ENDIF -->
<!-- IF topicrow.S_TOPIC_DELETED --><a href="{topicrow.U_MCP_QUEUE}">{DELETED_IMG}</a> <!-- ENDIF -->
<!-- IF topicrow.S_TOPIC_REPORTED --><a href="{topicrow.U_MCP_REPORT}">{REPORTED_IMG}</a><!-- ENDIF --><br />
+
+ <!-- IF not S_IS_BOT -->
+ <div class="responsive-show" style="display: none;">
+ {L_LAST_POST} {L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL} &laquo; <a href="{topicrow.U_LAST_POST}" title="{L_GOTO_LAST_POST}">{topicrow.LAST_POST_TIME}</a>
+ <!-- IF topicrow.S_POST_GLOBAL and FORUM_ID != topicrow.FORUM_ID --><br />{L_POSTED} {L_IN} <a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a><!-- ENDIF -->
+ </div>
+ <!-- IF topicrow.REPLIES --><span class="responsive-show left-box" style="display: none;">{L_REPLIES}{L_COLON} <strong>{topicrow.REPLIES}</strong></span><!-- ENDIF -->
+ <!-- ENDIF -->
+
<!-- IF .topicrow.pagination -->
<div class="pagination">
<ul>
@@ -164,19 +173,13 @@
</ul>
</div>
<!-- ENDIF -->
+
<div class="responsive-hide">
<!-- IF topicrow.S_HAS_POLL -->{POLL_IMG} <!-- ENDIF -->
<!-- IF topicrow.ATTACH_ICON_IMG -->{topicrow.ATTACH_ICON_IMG} <!-- ENDIF -->
{L_POST_BY_AUTHOR} {topicrow.TOPIC_AUTHOR_FULL} &raquo; {topicrow.FIRST_POST_TIME}
<!-- IF topicrow.S_POST_GLOBAL and FORUM_ID != topicrow.FORUM_ID --> &raquo; {L_IN} <a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a><!-- ENDIF -->
</div>
- <!-- IF not S_IS_BOT -->
- <div class="responsive-show" style="display: none;">
- {L_LAST_POST} {L_POST_BY_AUTHOR} {topicrow.LAST_POST_AUTHOR_FULL} &laquo; <a href="{topicrow.U_LAST_POST}" title="{L_GOTO_LAST_POST}">{topicrow.LAST_POST_TIME}</a>
- <!-- IF topicrow.S_POST_GLOBAL and FORUM_ID != topicrow.FORUM_ID --><br />{L_POSTED} {L_IN} <a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a><!-- ENDIF -->
- <!-- IF topicrow.REPLIES --><br />{L_REPLIES}{L_COLON} <strong>{topicrow.REPLIES}</strong><!-- ENDIF -->
- </div>
- <!-- ENDIF -->
<!-- EVENT topiclist_row_append -->
</div>
diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html
index 38836f3ee4..b764979f97 100644
--- a/phpBB/styles/prosilver/template/viewtopic_body.html
+++ b/phpBB/styles/prosilver/template/viewtopic_body.html
@@ -1,5 +1,5 @@
<!-- INCLUDE overall_header.html -->
-<!-- IF U_MCP or U_ACP --><p class="responsive-center">[&nbsp;<!-- IF U_ACP --><a href="{U_ACP}" title="{L_ACP}" data-responsive-text="{L_ACP_SHORT}">{L_ACP}</a><!-- IF U_MCP -->&nbsp;|&nbsp;<!-- ENDIF --><!-- ENDIF --><!-- IF U_MCP --><a href="{U_MCP}" title="{L_MCP}" data-responsive-text="{L_MCP_SHORT}">{L_MCP}</a><!-- ENDIF -->&nbsp;]</p><!-- ENDIF -->
+
<h2 class="topic-title"><!-- EVENT viewtopic_topic_title_prepend --><a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a><!-- EVENT viewtopic_topic_title_append --></h2>
<!-- NOTE: remove the style="display: none" when you want to have the forum description on the topic body -->
<!-- IF FORUM_DESC --><div style="display: none !important;">{FORUM_DESC}<br /></div><!-- ENDIF -->
@@ -155,7 +155,7 @@
<dd class="profile-contact">
<strong>{L_CONTACT}{L_COLON}</strong>
<div class="dropdown-container dropdown-left">
- <a href="#" class="dropdown-trigger"><span class="imageset icon_contact"></span></a>
+ <a href="#" class="dropdown-trigger"><span class="imageset icon_contact" title="{postrow.CONTACT_USER}">{postrow.CONTACT_USER}</span></a>
<div class="dropdown hidden">
<div class="pointer"><div class="pointer-inner"></div></div>
<div class="dropdown-contents contact-icons">
@@ -166,7 +166,7 @@
<div>
<!-- ENDIF -->
<a href="<!-- IF postrow.contact.U_CONTACT -->{postrow.contact.U_CONTACT}<!-- ELSE -->{postrow.contact.U_PROFILE_AUTHOR}<!-- ENDIF -->" title="{postrow.contact.NAME}"<!-- IF $S_LAST_CELL --> class="last-cell"<!-- ENDIF --><!-- IF postrow.contact.ID eq 'jabber' --> onclick="popup(this.href, 550, 320); return false;"<!-- ENDIF -->>
- <span class="contact-icon {postrow.contact.ID}-icon"></span>
+ <span class="contact-icon {postrow.contact.ID}-icon">{postrow.contact.NAME}</span>
</a>
<!-- IF REMAINDER eq 3 or postrow.contact.S_LAST_ROW -->
</div>
@@ -350,6 +350,21 @@
<!-- INCLUDE viewtopic_topic_tools.html -->
+ <!-- IF .quickmod -->
+ <div class="dropdown-container dropdown-container-{S_CONTENT_FLOW_BEGIN} dropdown-up dropdown-{S_CONTENT_FLOW_END} dropdown-button-control" id="quickmod">
+ <span title="{L_QUICK_MOD}" class="dropdown-trigger button icon-button modtools-icon dropdown-select">{L_QUICK_MOD}</span>
+ <div class="dropdown hidden">
+ <div class="pointer"><div class="pointer-inner"></div></div>
+ <ul class="dropdown-contents">
+ <!-- BEGIN quickmod -->
+ <!-- DEFINE $QUICKMOD_AJAX = (quickmod.VALUE in ['lock', 'unlock', 'delete_topic', 'restore_topic', 'make_normal', 'make_sticky', 'make_announce', 'make_global']) -->
+ <li><a href="{quickmod.LINK}"<!-- IF $QUICKMOD_AJAX --> data-ajax="true" data-refresh="true"<!-- ENDIF -->>{quickmod.TITLE}</a></li>
+ <!-- END quickmod -->
+ </ul>
+ </div>
+ </div>
+ <!-- ENDIF -->
+
<!-- IF .pagination or TOTAL_POSTS -->
<div class="pagination">
{TOTAL_POSTS}
@@ -366,21 +381,6 @@
<!-- EVENT viewtopic_body_footer_before -->
<!-- INCLUDE jumpbox.html -->
-<!-- IF .quickmod -->
- <form method="post" action="{S_MOD_ACTION}" id="quickmodform">
- <fieldset class="quickmod">
- <label for="quick-mod-select">{L_QUICK_MOD}{L_COLON}</label>
- <select name="action" id="quick-mod-select">
- <!-- BEGIN quickmod -->
- <option value="{quickmod.VALUE}">{quickmod.TITLE}</option>
- <!-- END quickmod -->
- </select>
- <input type="submit" value="{L_GO}" class="button2" />
- {S_FORM_TOKEN}
- </fieldset>
- </form>
-<!-- ENDIF -->
-
<!-- IF S_DISPLAY_ONLINE_LIST -->
<div class="stat-block online-list">
<h3><!-- IF U_VIEWONLINE --><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a><!-- ELSE -->{L_WHO_IS_ONLINE}<!-- ENDIF --></h3>
diff --git a/phpBB/styles/prosilver/template/viewtopic_topic_tools.html b/phpBB/styles/prosilver/template/viewtopic_topic_tools.html
index 5394c00f6a..2a34ebd446 100644
--- a/phpBB/styles/prosilver/template/viewtopic_topic_tools.html
+++ b/phpBB/styles/prosilver/template/viewtopic_topic_tools.html
@@ -7,16 +7,12 @@
<!-- EVENT viewtopic_topic_tools_before -->
<!-- IF U_WATCH_TOPIC -->
<li class="small-icon icon-<!-- IF S_WATCHING_TOPIC -->unsubscribe<!-- ELSE -->subscribe<!-- ENDIF -->">
- <a href="{U_WATCH_TOPIC}" class="watch-topic-link" title="{S_WATCH_TOPIC_TITLE}" data-ajax="toggle_link" data-toggle-class="small-icon icon-<!-- IF not S_WATCHING_TOPIC -->unsubscribe<!-- ELSE -->subscribe<!-- ENDIF -->" data-toggle-text="{S_WATCH_TOPIC_TOGGLE}" data-toggle-url="{U_WATCH_TOPIC_TOGGLE}" data-update-all=".watch-topic-link">
- {S_WATCH_TOPIC_TITLE}
- </a>
+ <a href="{U_WATCH_TOPIC}" class="watch-topic-link" title="{S_WATCH_TOPIC_TITLE}" data-ajax="toggle_link" data-toggle-class="small-icon icon-<!-- IF not S_WATCHING_TOPIC -->unsubscribe<!-- ELSE -->subscribe<!-- ENDIF -->" data-toggle-text="{S_WATCH_TOPIC_TOGGLE}" data-toggle-url="{U_WATCH_TOPIC_TOGGLE}" data-update-all=".watch-topic-link">{S_WATCH_TOPIC_TITLE}</a>
</li>
<!-- ENDIF -->
<!-- IF U_BOOKMARK_TOPIC -->
<li class="small-icon icon-bookmark">
- <a href="{U_BOOKMARK_TOPIC}" class="bookmark-link" title="{L_BOOKMARK_TOPIC}" data-ajax="alt_text" data-alt-text="{S_BOOKMARK_TOGGLE}" data-update-all=".bookmark-link">
- {S_BOOKMARK_TOPIC}
- </a>
+ <a href="{U_BOOKMARK_TOPIC}" class="bookmark-link" title="{L_BOOKMARK_TOPIC}" data-ajax="alt_text" data-alt-text="{S_BOOKMARK_TOGGLE}" data-update-all=".bookmark-link">{S_BOOKMARK_TOPIC}</a>
</li>
<!-- ENDIF -->
<!-- IF U_BUMP_TOPIC --><li class="small-icon icon-bump"><a href="{U_BUMP_TOPIC}" title="{L_BUMP_TOPIC}" data-ajax="true">{L_BUMP_TOPIC}</a></li><!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/theme/bidi.css b/phpBB/styles/prosilver/theme/bidi.css
index 2e9253928e..bc9e4b3965 100644
--- a/phpBB/styles/prosilver/theme/bidi.css
+++ b/phpBB/styles/prosilver/theme/bidi.css
@@ -2,7 +2,7 @@
---------------------------------------- */
/**
-* common.css
+* common.css
*/
.rtl h1 {
margin-right: 0;
@@ -59,20 +59,20 @@
/* Horizontal lists
----------------------------------------*/
-.rtl ul.linklist li {
+.rtl ul.linklist > li {
float: right;
margin-right: 0;
- margin-left: 5px;
+ margin-left: 7px;
}
-.rtl ul.linklist li.rightside, .rtl p.rightside {
+.rtl ul.linklist > li.rightside, .rtl p.rightside, .rtl a.rightside {
float: left;
- margin-right: 5px;
+ margin-right: 7px;
margin-left: 0;
text-align: left;
}
-.rtl ul.leftside li, .rtl ul.rightside li {
+.rtl ul.leftside > li, .rtl ul.rightside > li {
float: left;
}
@@ -92,11 +92,16 @@
/* Bulletin icons for list items
----------------------------------------*/
-.rtl ul.linklist.bulletin li:before {
+.rtl ul.linklist.bulletin > li:before {
padding-left: 4px;
padding-right: 0;
}
+.rtl ul.linklist li.responsive-menu a.responsive-menu-link:before {
+ left: auto;
+ right: 0;
+}
+
/* Dropdown menu
---------------------------------------- */
.rtl .dropdown-container.topic-tools {
@@ -112,6 +117,10 @@
padding-right: 10px;
}
+.rtl .dropdown-extended .header {
+ text-align: right;
+}
+
.rtl .dropdown-extended .header .header_settings {
float: left;
}
@@ -180,7 +189,7 @@
/* Misc layout styles
---------------------------------------- */
-/* column[1-2] styles are containers for two column layouts
+/* column[1-2] styles are containers for two column layouts
Also see tweaks.css */
.rtl .column1 {
float: right;
@@ -276,12 +285,15 @@
text-align: left;
}
-.rtl .forabg {
- width: 99%; /* fix for IE6 */
+.rtl #quick-links {
+ margin-left: 7px;
+ margin-right: 0;
}
-.rtl .forumbg {
- width: 99%; /* fix for IE6 */
+.rtl .header-avatar span:after {
+ float: left;
+ padding-left: 0;
+ padding-right: 2px;
}
.rtl .member-search {
@@ -424,7 +436,7 @@ ul.linklist li.small-icon > a, ul.linklist li.breadcrumbs span:first-child > a {
}
.rtl dl.icon dt .list-inner {
- padding-left: 0;
+ padding-left: 5px;
padding-right: 45px; /* Space for folder icon */
}
@@ -436,7 +448,7 @@ ul.linklist li.small-icon > a, ul.linklist li.breadcrumbs span:first-child > a {
margin-right: 2px;
}
-.rtl dd.lastpost span, .rtl ul.topiclist dd.info span, .rtl ul.topiclist dd.time span, .rtl dd.redirect span, .rtl dd.moderation span {
+.rtl dd.lastpost > span, .rtl ul.topiclist dd.info > span, .rtl ul.topiclist dd.time > span, .rtl dd.redirect > span, .rtl dd.moderation > span {
padding-left: 0;
padding-right: 5px;
}
@@ -616,7 +628,8 @@ ul.linklist li.small-icon > a, ul.linklist li.breadcrumbs span:first-child > a {
---------------------------------------- */
.rtl .small-icon {
background-position: 100% 50%;
- padding: 0 19px 0 0;
+ padding-left: 0;
+ padding-right: 19px;
}
.rtl ul.linklist li.small-icon {
@@ -1005,10 +1018,10 @@ ul.linklist li.small-icon > a, ul.linklist li.breadcrumbs span:first-child > a {
/* Forums and topics lists
----------------------------------------*/
- .rtl ul.topiclist.forums dt, .rtl ul.topiclist.topics dt {
+ .rtl ul.topiclist.forums dt {
margin-left: -250px;
}
- .rtl ul.topiclist.forums dt .list-inner, .rtl ul.topiclist.topics dt .list-inner {
+ .rtl ul.topiclist.forums dt .list-inner {
margin-left: 250px;
}
@@ -1020,11 +1033,11 @@ ul.linklist li.small-icon > a, ul.linklist li.breadcrumbs span:first-child > a {
@media only screen and (max-width: 550px), only screen and (max-device-width: 550px)
{
- .rtl ul.topiclist.forums dt, .rtl ul.topiclist.topics dt {
+ .rtl ul.topiclist.forums dt {
margin-left: 0;
}
- .rtl ul.topiclist.forums dt .list-inner, .rtl ul.topiclist.topics dt .list-inner {
+ .rtl ul.topiclist.forums dt .list-inner {
margin-left: 0;
}
}
@@ -1047,7 +1060,7 @@ ul.linklist li.small-icon > a, ul.linklist li.breadcrumbs span:first-child > a {
{
.rtl dl.details dt, .rtl dl.details dd {
float: none;
- text-align: right;
+ text-align: right;
}
.rtl dl.details dd {
diff --git a/phpBB/styles/prosilver/theme/buttons.css b/phpBB/styles/prosilver/theme/buttons.css
index c5e97d03c4..18c71d251e 100644
--- a/phpBB/styles/prosilver/theme/buttons.css
+++ b/phpBB/styles/prosilver/theme/buttons.css
@@ -21,8 +21,8 @@
vertical-align: bottom;
}
-.icon-button.dropdown-select {
- padding-right: 28px;
+.dropdown-select {
+ padding-right: 24px;
}
.icon-button:before {
@@ -35,6 +35,10 @@
width: 12px;
}
+.dropdown-select.icon-button:before {
+ margin-right: 4px;
+}
+
.dropdown-select:after {
background-position: -103px 10px;
border-left: 1px solid;
@@ -58,6 +62,10 @@
margin-right: 5px;
}
+#jumpbox .dropdown-select {
+ margin: 0;
+}
+
/* Big button images */
.reply-icon:before, .pmreply-icon:before { background-position: -20px 0; }
.reply-icon:hover:before, .pmreply-icon:hover:before { background-position: -20px -20px; }
@@ -73,7 +81,11 @@
.forwardpm-icon:before { background-position: -40px 0; }
.forwardpm-icon:hover:before { background-position: -40px -20px; }
-.tools-icon:before {
+.modtools-icon {
+ font-size: 0;
+}
+
+.tools-icon:before, .modtools-icon:before {
background-position: -80px 0;
height: 16px;
margin-top: 2px;
@@ -83,6 +95,10 @@
.dropdown-visible .tools-icon:before,
.nojs .dropdown-container:hover .tools-icon:before { background-position: -80px -20px; }
+.modtools-icon:before { background-position: -225px 0; }
+.dropdown-visible .modtools-icon:before,
+.nojs .dropdown-container:hover .modtools-icon:before { background-position: -225px -20px; }
+
/* Icon images
---------------------------------------- */
.small-icon {
@@ -96,7 +112,7 @@ ul.linklist li.small-icon {
padding-left: 0;
}
-ul.linklist.bulletin li.small-icon:before {
+ul.linklist.bulletin > li.small-icon:before {
display: none;
}
@@ -105,6 +121,7 @@ ul.linklist.bulletin li.small-icon:before {
.contact-icons.dropdown-contents {
min-width: 0;
padding: 0;
+ font-size: 0;
}
.contact-icon {
@@ -156,7 +173,7 @@ ul.linklist.bulletin li.small-icon:before {
margin-top: 2px;
}
-.post-buttons li {
+.post-buttons > li {
float: left;
margin-right: 3px;
}
diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css
index 4b7532ab8a..fce66f7efb 100644
--- a/phpBB/styles/prosilver/theme/colours.css
+++ b/phpBB/styles/prosilver/theme/colours.css
@@ -5,7 +5,7 @@ Colours and backgrounds for common.css
html, body {
color: #536482;
- background-color: #FFFFFF;
+ background-color: #F5F7FA;
}
h1 {
@@ -43,6 +43,11 @@ hr {
/* Round cornered boxes and backgrounds
---------------------------------------- */
+#wrap {
+ background-color: #FFF;
+ border-color: #E6E9ED;
+}
+
.headerbar {
background-color: #12A3EB;
background-image: url("./images/bg_header.gif");
@@ -106,7 +111,7 @@ table.zebra-list tr:nth-child(even) td, ul.zebra-list li:nth-child(even) {
----------------------------------------*/
ul.navlinks {
- border-bottom-color: #FFFFFF;
+ border-top-color: #FFFFFF;
}
/* Table styles
@@ -223,15 +228,15 @@ p.post-notice {
background-image: none;
}
-p.post-notice.deleted:before {
+p.post-notice.deleted:before {
background-image: url("./images/icon_topic_deleted.png");
}
-p.post-notice.unapproved:before {
+p.post-notice.unapproved:before {
background-image: url("./images/icon_topic_unapproved.gif");
}
-p.post-notice.reported:before, p.post-notice.error:before {
+p.post-notice.reported:before, p.post-notice.error:before {
background-image: url("./images/icon_topic_reported.gif");
}
@@ -241,16 +246,10 @@ Colours and backgrounds for links.css
-------------------------------------------------------------- */
a { color: #105289; }
-a:visited { color: #105289; }
a:hover { color: #D31141; }
-a:active { color: #368AD2; }
/* Links on gradient backgrounds */
-#search-box a:link, .navbg a:link, .forumbg .header a:link, .forabg .header a:link, th a:link {
- color: #FFFFFF;
-}
-
-#search-box a:visited, .navbg a:visited, .forumbg .header a:visited, .forabg .header a:visited, th a:visited {
+#search-box a, .navbg a, .forumbg .header a, .forabg .header a, th a {
color: #FFFFFF;
}
@@ -258,44 +257,11 @@ a:active { color: #368AD2; }
color: #A8D8FF;
}
-#search-box a:active, .navbg a:active, .forumbg .header a:active, .forabg .header a:active, th a:active {
- color: #C8E6FF;
-}
-
/* Notification mark read link */
.dropdown-extended a.mark_read {
background-color: #FFFFFF;
}
-/* Links for forum/topic lists */
-a.forumtitle {
- color: #105289;
-}
-
-/* a.forumtitle:visited { color: #105289; } */
-
-a.forumtitle:hover {
- color: #BC2A4D;
-}
-
-a.forumtitle:active {
- color: #105289;
-}
-
-a.topictitle {
- color: #105289;
-}
-
-/* a.topictitle:visited { color: #368AD2; } */
-
-a.topictitle:hover {
- color: #BC2A4D;
-}
-
-a.topictitle:active {
- color: #105289;
-}
-
/* Post body links */
.postlink {
color: #368AD2;
@@ -307,41 +273,15 @@ a.topictitle:active {
border-bottom-color: #5D8FBD;
}
-.postlink:active {
- color: #368AD2;
-}
-
.postlink:hover {
background-color: #D0E4F6;
color: #0D4473;
}
-.signature a, .signature a:visited, .signature a:hover, .signature a:active {
+.signature a, .signature a:hover {
background-color: transparent;
}
-/* Profile links */
-.postprofile a:link, .postprofile a:visited, .postprofile dt.author a {
- color: #105289;
-}
-
-.postprofile a:hover, .postprofile dt.author a:hover {
- color: #D31141;
-}
-
-.postprofile a:active {
- color: #105289;
-}
-
-/* Profile searchresults */
-.search .postprofile a {
- color: #105289;
-}
-
-.search .postprofile a:hover {
- color: #D31141;
-}
-
/* Back to top of page */
a.top {
background-image: url("./images/icon_back_top.gif");
@@ -369,7 +309,6 @@ a.arrow-right:hover {
color: #368AD2;
}
-
/*
--------------------------------------------------------------
Colours and backgrounds for content.css
@@ -658,7 +597,7 @@ dd.profile-warnings {
--------------------------------------------------------------
Colours and backgrounds for buttons.css
-------------------------------------------------------------- */
-.button, .button:visited {
+.button {
border-color: #C7C3BF;
background-color: #FFFFFF;
background-image: -moz-linear-gradient(top, #FFFFFF, #E9E9E9);
@@ -668,7 +607,11 @@ Colours and backgrounds for buttons.css
-ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#FFFFFF', EndColorStr='#E9E9E9')";
box-shadow: 0 0 0 1px #FFFFFF inset;
-webkit-box-shadow: 0 0 0 1px #FFFFFF inset;
- color: #BC2A4D;
+ color: #D31141;
+}
+
+.dropdown-select, .dropdown-select:visited {
+ color: #536482;
}
.button:hover, .dropdown-visible .dropdown-select, .nojs .dropdown-container:hover .dropdown-select {
@@ -694,24 +637,37 @@ Colours and backgrounds for buttons.css
/* Icon images
---------------------------------------- */
-.icon-faq { background-image: url("./images/icon_faq.gif"); }
-.icon-members { background-image: url("./images/icon_members.gif"); }
-.icon-home { background-image: url("./images/icon_home.gif"); }
-.icon-ucp { background-image: url("./images/icon_ucp.gif"); }
-.icon-register { background-image: url("./images/icon_register.gif"); }
-.icon-logout { background-image: url("./images/icon_logout.gif"); }
-.icon-bookmark { background-image: url("./images/icon_bookmark.gif"); }
-.icon-bump { background-image: url("./images/icon_bump.gif"); }
-.icon-subscribe { background-image: url("./images/icon_subscribe.gif"); }
-.icon-unsubscribe { background-image: url("./images/icon_unsubscribe.gif"); }
-.icon-pages { background-image: url("./images/icon_pages.gif"); }
+.icon-acp { background-image: url("./images/icon_acp.gif"); }
+.icon-bookmark { background-image: url("./images/icon_bookmark.gif"); }
+.icon-bump { background-image: url("./images/icon_bump.gif"); }
+.icon-contact { background-image: url("./images/icon_pm.gif"); }
+.icon-delete-cookies { background-image: url("./images/icon_delete_cookies.gif"); }
+.icon-download { background-image: url("./images/icon_download.gif"); }
+.icon-faq { background-image: url("./images/icon_faq.gif"); }
+.icon-home { background-image: url("./images/icon_home.gif"); }
+.icon-logout { background-image: url("./images/icon_logout.gif"); }
+.icon-mark { background-image: url("./images/icon_mark.gif"); }
+.icon-mcp { background-image: url("./images/icon_mcp.gif"); }
+.icon-members { background-image: url("./images/icon_members.gif"); }
+.icon-notification { background-image: url("./images/icon_notification.gif"); }
+.icon-pages { background-image: url("./images/icon_pages.gif"); }
+.icon-pm { background-image: url("./images/icon_pm.gif"); }
+.icon-print { background-image: url("./images/icon_print.gif"); }
+.icon-profile { background-image: url("./images/icon_profile.gif"); }
+.icon-quick-links { background-image: url("./images/icon_quick_links.gif"); }
+.icon-register { background-image: url("./images/icon_register.gif"); }
.icon-search, .responsive-search a { background-image: url("./images/icon_search.gif"); }
-.icon-notification { background-image: url("./images/icon_notification.gif"); }
-.icon-pm { background-image: url("./images/icon_pm.gif"); }
-.icon-download { background-image: url("./images/icon_download.gif"); }
-.icon-mark { background-image: url("./images/icon_mark.gif"); }
-.icon-sendemail { background-image: url("./images/icon_sendemail.gif"); }
-.icon-print { background-image: url("./images/icon_print.gif"); }
+.icon-search-active { background-image: url("./images/subforum_read.gif"); }
+.icon-search-advanced { background-image: url("./images/icon_search_adv.gif"); }
+.icon-search-new { background-image: url("./images/subforum_unread.gif"); }
+.icon-search-self { background-image: url("./images/icon_topic_latest.gif"); }
+.icon-search-unanswered { background-image: url("./images/icon_post_target.gif"); }
+.icon-search-unread { background-image: url("./images/subforum_unread.gif"); }
+.icon-sendemail { background-image: url("./images/icon_sendemail.gif"); }
+.icon-subscribe { background-image: url("./images/icon_subscribe.gif"); }
+.icon-team { background-image: url("./images/icon_team.gif"); }
+.icon-ucp { background-image: url("./images/icon_ucp.gif"); }
+.icon-unsubscribe { background-image: url("./images/icon_unsubscribe.gif"); }
/* Profile & navigation icons */
.contact-icon { background-image: url("./images/icons_contact.png"); }
@@ -814,7 +770,7 @@ ul.cplist {
#tabs .tab > a:hover {
background: #DDEDFB;
- color: #BC2A4D;
+ color: #D31141;
}
#tabs .activetab > a,
@@ -855,7 +811,7 @@ ul.cplist {
}
.responsive-tab .responsive-tab-link:hover:before {
- border-color: #BC2A4D;
+ border-color: #D31141;
}
/* UCP navigation menu
@@ -1079,7 +1035,7 @@ a.button2, input.button2, input.button3 {
}
/* <a> button in the style of the form buttons */
-a.button1, a.button1:link, a.button1:visited, a.button1:active, a.button2, a.button2:link, a.button2:visited, a.button2:active {
+a.button1, a.button2 {
color: #000000;
}
@@ -1122,7 +1078,7 @@ input.disabled {
}
.dropdown-extended ul li {
- border-bottom-color: #B9B9B9;
+ border-top-color: #B9B9B9;
}
.dropdown-extended ul li:hover {
@@ -1184,6 +1140,10 @@ ul.linklist li.responsive-menu a.responsive-menu-link:hover:before, ul.linklist
border-color: #DCDCDC;
}
+.dropdown li.separator {
+ border-color: #DCDCDC;
+}
+
/* Notifications
---------------------------------------- */
diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css
index a52f5e494d..e33bf99965 100644
--- a/phpBB/styles/prosilver/theme/common.css
+++ b/phpBB/styles/prosilver/theme/common.css
@@ -175,8 +175,18 @@ ol ol ul, ol ul ul, ul ol ul, ul ul ul {
/* Main blocks
---------------------------------------- */
#wrap {
- padding: 0 20px;
- min-width: 650px;
+ border: 1px solid transparent;
+ border-radius: 8px;
+ margin: 0 auto;
+ max-width: 1152px;
+ min-width: 625px;
+ padding: 15px;
+}
+
+@media only screen and (max-width: 1220px), only screen and (max-device-width: 1220px) {
+ #wrap {
+ margin: 0 12px;
+ }
}
#simple-wrap {
@@ -261,7 +271,7 @@ ol ol ul, ol ul ul, ul ol ul, ul ul ul {
}
.navbar {
- padding: 5px 10px 5px 10px;
+ padding: 3px 10px;
border-radius: 7px;
}
@@ -307,6 +317,10 @@ ol ol ul, ol ul ul, ul ol ul, ul ul ul {
/* Horizontal lists
----------------------------------------*/
+.navbar ul.linklist {
+ padding: 2px 0;
+}
+
ul.linklist {
display: block;
margin: 0;
@@ -322,29 +336,25 @@ ul.linklist:after {
padding: 5px 10px;
}
-ul.linklist li {
- display: block;
- list-style-type: none;
+ul.linklist > li {
float: left;
- width: auto;
- margin-right: 5px;
font-size: 1.1em;
line-height: 2.2em;
+ list-style-type: none;
+ margin-right: 7px;
padding-top: 1px;
+ width: auto;
}
-ul.linklist li.rightside, p.rightside {
+ul.linklist > li.rightside, p.rightside, a.rightside {
float: right;
margin-right: 0;
- margin-left: 5px;
+ margin-left: 7px;
text-align: right;
}
ul.navlinks {
- padding-bottom: 1px;
- margin-bottom: 1px;
- border-bottom: 1px solid transparent;
- font-weight: bold;
+ border-top: 1px solid transparent;
}
ul.leftside {
@@ -372,7 +382,7 @@ ul.linklist li.responsive-menu a.responsive-menu-link {
font-size: 16px;
position: relative;
width: 16px;
- line-height: 16.5px;
+ line-height: 20px;
text-decoration: none;
}
@@ -403,27 +413,18 @@ li.responsive-menu.dropdown-left .dropdown {
right: -6px;
}
-li.responsive-menu .dropdown .dropdown-contents {
- padding: 0 5px;
-}
-
-ul.linklist .dropdown-down .dropdown {
+ul.linklist .dropdown {
top: 22px;
}
ul.linklist .dropdown-up .dropdown {
bottom: 18px;
+ top: auto;
}
-ul.linklist .dropdown li {
- clear: both;
-}
-
-
-
/* Bulletin icons for list items
----------------------------------------*/
-ul.linklist.bulletin li:before {
+ul.linklist.bulletin > li:before {
display: inline-block;
content: "\2022";
font-size: inherit;
@@ -431,11 +432,12 @@ ul.linklist.bulletin li:before {
padding-right: 4px;
}
-ul.linklist.bulletin li:first-child:before, ul.linklist.bulletin li.rightside:last-child:before {
+ul.linklist.bulletin > li:first-child:before,
+ul.linklist.bulletin > li.rightside:last-child:before {
content: none;
}
-ul.linklist.bulletin li.no-bulletin:before {
+ul.linklist.bulletin > li.no-bulletin:before {
content: none;
}
@@ -443,20 +445,46 @@ ul.linklist.bulletin li.no-bulletin:before {
display: none !important;
}
-/* Avatar in overall_header.html */
+/* Profile in overall_header.html */
+.header-profile {
+ display: inline-block;
+ vertical-align: top;
+}
+
+.header-avatar:hover {
+ text-decoration: none;
+}
+
.header-avatar img {
margin-bottom: 2px;
- max-height: 25px;
+ max-height: 20px;
vertical-align: middle;
width: auto;
}
+.header-avatar span:after {
+ content: '\25BC';
+ display: inline-block;
+ font-size: 9px;
+ float: right;
+ padding-left: 2px;
+ opacity: 0.7;
+}
+
/* Dropdown menu
----------------------------------------*/
.dropdown-container {
position: relative;
}
+.dropdown-container-right {
+ float: right;
+}
+
+.dropdown-container-left {
+ float: left;
+}
+
.nojs .dropdown-container:hover .dropdown {
display: block !important;
}
@@ -556,14 +584,14 @@ ul.linklist.bulletin li.no-bulletin:before {
padding: 5px;
position: relative;
min-width: 40px;
- max-height: 200px;
+ max-height: 300px;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.dropdown li {
- border-bottom: 1px dotted transparent;
+ border-top: 1px dotted transparent;
float: none !important;
line-height: normal !important;
font-size: 1em !important;
@@ -575,8 +603,16 @@ ul.linklist.bulletin li.no-bulletin:before {
text-align: left;
}
-.dropdown li:last-child, .dropdown li li {
- border-bottom: 0;
+.dropdown-contents > li {
+ padding-right: 15px;
+}
+
+.dropdown-nonscroll > li {
+ padding-right: 0;
+}
+
+.dropdown li:first-child, .dropdown li.separator + li, .dropdown li li {
+ border-top: 0;
}
.dropdown li li:first-child {
@@ -596,7 +632,13 @@ ul.linklist.bulletin li.no-bulletin:before {
white-space: normal;
}
-.dropdown li:before, .dropdown li:after {
+.dropdown li.separator {
+ border-top: 1px solid transparent;
+ margin: 4px 0;
+ padding: 0;
+}
+
+.dropdown li.separator:first-child, .dropdown li.separator:last-child {
display: none !important;
}
@@ -604,6 +646,7 @@ ul.linklist.bulletin li.no-bulletin:before {
----------------------------------------*/
.breadcrumbs .crumb {
float: left;
+ font-weight: bold;
word-wrap: normal;
}
@@ -809,6 +852,10 @@ fieldset.fields1 dl.pmlist dd.recipients {
margin: 4px 0;
}
+.forabg + .action-bar {
+ margin-top: 2em;
+}
+
.action-bar:after {
clear: both;
content: '';
@@ -912,14 +959,14 @@ fieldset.fields1 dl.pmlist dd.recipients {
.phpbb_alert {
border: 1px solid transparent;
display: none;
- left: 0;
+ left: 0;
padding: 0 25px 20px 25px;
position: fixed;
- right: 0;
+ right: 0;
top: 150px;
z-index: 50;
width: 620px;
- margin: 0 auto;
+ margin: 0 auto;
}
@media only screen and (max-height: 500px), only screen and (max-device-width: 500px)
@@ -1062,6 +1109,14 @@ form > p.post-notice strong {
line-height: 20px;
}
+#jumpbox {
+ margin: 5px 0;
+}
+
+.stat-block {
+ clear: both;
+}
+
#top {
position: absolute;
top: -20px;
@@ -1099,11 +1154,7 @@ form > p.post-notice strong {
.dropdown-extended {
display: none;
- position: absolute;
- left: 0;
- width: 340px;
z-index: 1;
- top: 22px;
}
.dropdown-extended ul {
@@ -1117,24 +1168,30 @@ form > p.post-notice strong {
padding: 0;
margin: 0 !important;
float: none;
- border-bottom: 1px solid;
+ border-top: 1px solid;
list-style-type: none;
font-size: 0.95em;
clear: both;
position: relative;
}
-.dropdown-extended ul li.no_notifications {
- padding: 10px;
+.dropdown-extended ul li:first-child {
+ border-top: none;
}
-.dropdown-extended ul li:before, .dropdown-extended ul li:after {
- display: none;
+.dropdown-extended ul li.no_notifications {
+ padding: 10px;
}
.dropdown-extended .dropdown-contents {
max-height: none;
padding: 0;
+ position: absolute;
+ width: 340px;
+}
+
+.nojs .dropdown-extended .dropdown-contents {
+ position: relative;
}
.dropdown-extended .header {
@@ -1142,8 +1199,9 @@ form > p.post-notice strong {
font-family: Arial, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 11px;
font-weight: bold;
+ text-align: left;
text-shadow: 1px 1px 1px white;
- text-transform: uppercase;
+ text-transform: uppercase;
line-height: 30px;
border-bottom: 1px solid;
border-radius: 5px 5px 0 0;
@@ -1233,6 +1291,30 @@ form > p.post-notice strong {
display: block;
}
+/* Navbar specific list items
+----------------------------------------*/
+
+#quick-links {
+ margin: 0 7px 0 0;
+}
+
+#quick-links a.responsive-menu-link {
+ display: block;
+ font-size: inherit;
+ line-height: inherit;
+ margin: 0;
+ width: auto;
+}
+
+#quick-links a.responsive-menu-link:before {
+ font-size: 16px;
+ line-height: 16.5px;
+}
+
+.compact #quick-links a.responsive-menu-link {
+ font-size: 0;
+}
+
.compact .icon-notification > a > span, .compact .icon-pm > a > span {
display: none;
}
@@ -1252,3 +1334,19 @@ form > p.post-notice strong {
.dropdown-page-jump input.tiny {
width: 50px;
}
+
+.dropdown .clone {
+ display: none;
+}
+
+.responsive .dropdown .clone {
+ display: inherit;
+}
+
+.dropdown .clone + li.separator {
+ display: none;
+}
+
+.responsive .dropdown .clone + li.separator {
+ display: inherit;
+}
diff --git a/phpBB/styles/prosilver/theme/content.css b/phpBB/styles/prosilver/theme/content.css
index b99312a5be..a014f57d47 100644
--- a/phpBB/styles/prosilver/theme/content.css
+++ b/phpBB/styles/prosilver/theme/content.css
@@ -210,7 +210,7 @@ dd.time {
line-height: 200%;
}
-dd.lastpost span, ul.topiclist dd.info span, ul.topiclist dd.time span, dd.redirect span, dd.moderation span {
+dd.lastpost > span, ul.topiclist dd.info > span, ul.topiclist dd.time > span, dd.redirect > span, dd.moderation > span {
display: block;
padding-left: 5px;
}
@@ -351,10 +351,6 @@ dd.option {
line-height: 1.4em;
}
-span.corners-top, span.corners-bottom {
- display: none;
-}
-
dl.faq {
font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif;
font-size: 1.1em;
@@ -462,7 +458,7 @@ blockquote {
blockquote blockquote {
/* Nested quotes */
font-size: 1em;
- margin: 0.5em 1px 0 15px;
+ margin: 0.5em 1px 0 15px;
}
blockquote cite {
@@ -519,7 +515,7 @@ blockquote .codebox {
----------------------------------------*/
.attachbox {
float: left;
- width: auto;
+ width: auto;
max-width: 100%;
margin: 5px 5px 5px 0;
padding: 6px;
@@ -596,7 +592,7 @@ dl.file dt {
dl.file dd {
margin: 0;
- padding: 0;
+ padding: 0;
}
dl.thumbnail img {
diff --git a/phpBB/styles/prosilver/theme/cp.css b/phpBB/styles/prosilver/theme/cp.css
index e144c74f20..5149a16ec9 100644
--- a/phpBB/styles/prosilver/theme/cp.css
+++ b/phpBB/styles/prosilver/theme/cp.css
@@ -138,7 +138,7 @@ ul.cplist {
cursor: pointer;
}
-/* CP tabbed menu
+/* CP tabbed menu
----------------------------------------*/
#tabs {
margin: 20px 0 0 7px;
@@ -321,7 +321,7 @@ ol.def-rules li {
border-right-color: transparent;
}
-.pmlist li.pm_marked_colour, .pm_marked_colour,
+.pmlist li.pm_marked_colour, .pm_marked_colour,
.pmlist li.pm_replied_colour, .pm_replied_colour,
.pmlist li.pm_friend_colour, .pm_friend_colour,
.pmlist li.pm_foe_colour, .pm_foe_colour {
@@ -354,7 +354,7 @@ ol.def-rules li {
@media only screen and (max-width: 900px), only screen and (max-device-width: 900px)
{
.nojs #tabs a span, .nojs #minitabs a span {
- max-width: 40px;
+ max-width: 40px;
overflow: hidden;
text-overflow: ellipsis;
letter-spacing: -.5px;
@@ -366,8 +366,8 @@ ol.def-rules li {
margin: 0;
}
- #navigation {
- padding: 0;
+ #navigation {
+ padding: 0;
margin: 0 auto;
max-width: 320px;
}
diff --git a/phpBB/styles/prosilver/theme/forms.css b/phpBB/styles/prosilver/theme/forms.css
index 0c0a3e5ca9..f0effa01c4 100644
--- a/phpBB/styles/prosilver/theme/forms.css
+++ b/phpBB/styles/prosilver/theme/forms.css
@@ -68,7 +68,7 @@ fieldset dl {
}
fieldset dt {
- float: left;
+ float: left;
width: 40%;
text-align: left;
display: block;
@@ -201,24 +201,6 @@ fieldset.forum-selection2 {
float: right;
}
-/* Jumpbox */
-fieldset.jumpbox {
- text-align: right;
- margin-top: 15px;
- min-height: 2.5em;
-}
-
-fieldset.jumpbox select {
- max-width: 50%;
-}
-
-fieldset.quickmod {
- width: 50%;
- float: right;
- text-align: right;
- height: 2.5em;
-}
-
/* Submit button fieldset */
fieldset.submit-buttons {
text-align: center;
@@ -294,6 +276,10 @@ textarea.inputbox {
width: auto !important;
}
+input[type="number"] {
+ -moz-padding-end: inherit;
+}
+
input[type="search"] {
-webkit-appearance: textfield;
-webkit-box-sizing: content-box;
@@ -331,8 +317,8 @@ input.button3 {
font-variant: small-caps;
}
-input[type="button"], input[type="submit"], input[type="reset"], input[type="checkbox"], input[type="radio"] {
- cursor: pointer;
+input[type="button"], input[type="submit"], input[type="reset"], input[type="checkbox"], input[type="radio"] {
+ cursor: pointer;
}
/* Alternative button */
diff --git a/phpBB/styles/prosilver/theme/images/icon_acp.gif b/phpBB/styles/prosilver/theme/images/icon_acp.gif
new file mode 100644
index 0000000000..3afa98ee8f
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icon_acp.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_delete_cookies.gif b/phpBB/styles/prosilver/theme/images/icon_delete_cookies.gif
new file mode 100644
index 0000000000..f7665ebff8
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icon_delete_cookies.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_mcp.gif b/phpBB/styles/prosilver/theme/images/icon_mcp.gif
new file mode 100644
index 0000000000..80de2e53f7
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icon_mcp.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_profile.gif b/phpBB/styles/prosilver/theme/images/icon_profile.gif
new file mode 100644
index 0000000000..a0ec098460
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icon_profile.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_team.gif b/phpBB/styles/prosilver/theme/images/icon_team.gif
new file mode 100644
index 0000000000..613158257b
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/images/icon_team.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icons_button.png b/phpBB/styles/prosilver/theme/images/icons_button.png
index a45a0cc2ba..da9ae6f1b4 100644
--- a/phpBB/styles/prosilver/theme/images/icons_button.png
+++ b/phpBB/styles/prosilver/theme/images/icons_button.png
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/links.css b/phpBB/styles/prosilver/theme/links.css
index 89639dde02..890f854baa 100644
--- a/phpBB/styles/prosilver/theme/links.css
+++ b/phpBB/styles/prosilver/theme/links.css
@@ -5,19 +5,10 @@
a {
direction: ltr;
unicode-bidi: embed;
-}
-
-a:link, a:visited {
text-decoration: none;
}
-a:hover {
- text-decoration: underline;
-}
-
-a:active {
- text-decoration: none;
-}
+a:hover { text-decoration: underline; }
/* Coloured usernames */
.username-coloured {
@@ -27,11 +18,7 @@ a:active {
}
/* Links on gradient backgrounds */
-#search-box a:link, .navbg a:link, .forumbg .header a:link, .forabg .header a:link, th a:link {
- text-decoration: none;
-}
-
-#search-box a:visited, .navbg a:visited, .forumbg .header a:visited, .forabg .header a:visited, th a:visited {
+#search-box a, .navbg a, .forumbg .header a, .forabg .header a, th a {
text-decoration: none;
}
@@ -39,10 +26,6 @@ a:active {
text-decoration: underline;
}
-#search-box a:active, .navbg a:active, .forumbg .header a:active, .forabg .header a:active, th a:active {
- text-decoration: none;
-}
-
/* Navigation bar links */
ul.linklist li.small-icon > a, ul.linklist li.breadcrumbs span:first-child > a {
display: inline-block;
@@ -118,13 +101,13 @@ a.lastsubject:hover {
text-decoration: none;
}
-.signature a, .signature a:visited, .signature a:hover, .signature a:active {
+.signature a, .signature a:hover {
border: none;
text-decoration: underline;
}
/* Profile links */
-.postprofile a:link, .postprofile a:visited, .postprofile dt.author a {
+.postprofile a, .postprofile dt.author a {
font-weight: bold;
text-decoration: none;
}
@@ -133,22 +116,14 @@ a.lastsubject:hover {
text-decoration: underline;
}
-/* CSS spec requires a:link, a:visited, a:hover and a:active rules to be specified in this order. */
-/* See http://www.phpbb.com/bugs/phpbb3/59685 */
-.postprofile a:active {
- font-weight: bold;
- text-decoration: none;
-}
-
-
-/* Profile searchresults */
+/* Profile searchresults */
.search .postprofile a {
- text-decoration: none;
+ text-decoration: none;
font-weight: normal;
}
.search .postprofile a:hover {
- text-decoration: underline;
+ text-decoration: underline;
}
/* Back to top of page */
@@ -182,7 +157,7 @@ a.arrow-down { background: none no-repeat right center; }
a.arrow-left { background: none no-repeat 3px 60%; }
a.arrow-right { background: none no-repeat 95% 60%; }
-a.arrow-up, a.arrow-up:link, a.arrow-up:active, a.arrow-up:visited {
+a.arrow-up {
padding-left: 10px;
text-decoration: none;
border-bottom-width: 0;
@@ -192,7 +167,7 @@ a.arrow-up:hover {
background-position: left top;
}
-a.arrow-down, a.arrow-down:link, a.arrow-down:active, a.arrow-down:visited {
+a.arrow-down {
padding-right: 10px;
}
@@ -201,7 +176,7 @@ a.arrow-down:hover {
text-decoration: none;
}
-a.arrow-left, a.arrow-left:active, a.arrow-left:visited {
+a.arrow-left {
padding-left: 12px;
}
@@ -210,7 +185,7 @@ a.arrow-left:hover {
background-position: 0 60%;
}
-a.arrow-right, a.arrow-right:active, a.arrow-right:visited {
+a.arrow-right {
padding-right: 12px;
}
diff --git a/phpBB/styles/prosilver/theme/print.css b/phpBB/styles/prosilver/theme/print.css
index 88de620493..34129c92e8 100644
--- a/phpBB/styles/prosilver/theme/print.css
+++ b/phpBB/styles/prosilver/theme/print.css
@@ -91,11 +91,11 @@ hr {
}
/* Dont want to print url for names or titles in content area */
-.postbody .author a:link, .postbody .author a:visited,
-html>body .postbody .author a:link:after,
+.postbody .author a:link, .postbody .author a:visited,
+html>body .postbody .author a:link:after,
html>body .postbody .author a:visited:after,
-.postquote .quote-by a:link, .postquote .quote-by a:visited,
-html>body .postquote .quote-by a:link:after,
+.postquote .quote-by a:link, .postquote .quote-by a:visited,
+html>body .postquote .quote-by a:link:after,
html>body .postquote .quote-by a:visited:after,
html>body .postbody h1 a:link:after, html>body .postbody h2 a:link:after {
text-decoration: none;
@@ -119,7 +119,7 @@ html>body .postbody h1 a:link:after, html>body .postbody h2 a:link:after {
.postquote img { display: none; }
.postquote span { display: block; }
.postquote span .postquote { font-size: 100%; }
-.quote-by, blockquote cite {
+.quote-by, blockquote cite {
color: black;
display : block;
font-weight: bold;
diff --git a/phpBB/styles/prosilver/theme/responsive.css b/phpBB/styles/prosilver/theme/responsive.css
index e27a2292b3..241b4d132e 100644
--- a/phpBB/styles/prosilver/theme/responsive.css
+++ b/phpBB/styles/prosilver/theme/responsive.css
@@ -13,12 +13,15 @@ html {
}
body {
- padding: 0 5px;
+ padding: 0;
}
#wrap {
- min-width: 300px;
- padding: 0;
+ border: none;
+ border-radius: 0;
+ margin: 0;
+ min-width: 290px;
+ padding: 0 5px;
}
/* Common block wrappers
@@ -73,7 +76,7 @@ body {
.responsive-search a {
display: block;
width: 16px;
- height: 18px;
+ height: 22px;
text-indent: 99px;
overflow: hidden;
background-position: 50% 50%;
@@ -119,23 +122,23 @@ ul.topiclist li.header dt .list-inner {
min-height: 0;
}
-ul.topiclist dd {
- display: none;
+ul.topiclist dd {
+ display: none;
}
-ul.topiclist dd.mark {
- display: block;
+ul.topiclist dd.mark {
+ display: block;
}
/* Forums and topics lists
----------------------------------------*/
-ul.topiclist.forums dt, ul.topiclist.topics dt {
+ul.topiclist.forums dt {
margin-right: -250px;
}
-ul.topiclist.forums dt .list-inner, ul.topiclist.topics dt .list-inner {
+ul.topiclist.forums dt .list-inner {
margin-right: 250px;
}
-ul.topiclist.forums dd.lastpost, ul.topiclist.topics dd.lastpost {
+ul.topiclist.forums dd.lastpost {
display: block;
}
@@ -160,15 +163,15 @@ ul.topiclist.forums dd.topics dfn, ul.topiclist.topics dd.posts dfn {
@media only screen and (max-width: 550px), only screen and (max-device-width: 550px)
{
- ul.topiclist.forums dt, ul.topiclist.topics dt {
+ ul.topiclist.forums dt {
margin-right: 0;
}
- ul.topiclist.forums dt .list-inner, ul.topiclist.topics dt .list-inner {
+ ul.topiclist.forums dt .list-inner {
margin-right: 0;
}
- ul.topiclist.forums dd.lastpost, ul.topiclist.topics dd.lastpost {
+ ul.topiclist.forums dd.lastpost {
display: none;
}
}
@@ -190,8 +193,8 @@ ul.topiclist li.row dt a.subforum {
----------------------------------------*/
@media only screen and (max-width: 350px), only screen and (max-device-width: 350px)
{
- .dropdown-extended {
- width: 250px;
+ .dropdown-extended .dropdown-contents {
+ width: auto;
}
}
@@ -201,8 +204,8 @@ ul.topiclist li.row dt a.subforum {
margin: 5px 0 0;
}
-.row .pagination > ul {
- margin-top: 0;
+.row .pagination .ellipsis + li {
+ display: none !important;
}
/* Responsive tables
@@ -367,7 +370,7 @@ fieldset.quick-login label[for="autologin"] {
dl.details dt, dl.details dd {
width: auto;
float: none;
- text-align: left;
+ text-align: left;
}
dl.details dd {
diff --git a/phpBB/styles/prosilver/theme/tweaks.css b/phpBB/styles/prosilver/theme/tweaks.css
index 9a8ed5d399..ea0c66d20a 100644
--- a/phpBB/styles/prosilver/theme/tweaks.css
+++ b/phpBB/styles/prosilver/theme/tweaks.css
@@ -1,6 +1,6 @@
/* Style Sheet Tweaks
-These style definitions are IE 7 and 8 specific
+These style definitions are IE 7 and 8 specific
tweaks required due to its poor CSS support.
-------------------------------------------------*/
@@ -14,9 +14,9 @@ ul.linklist {
}
/* Align checkboxes/radio buttons nicely */
-dd label input {
- vertical-align: text-bottom;
- *vertical-align: middle;
+dd label input {
+ vertical-align: text-bottom;
+ *vertical-align: middle;
}
/* Simple fix so forum and topic lists always have a height set */
@@ -69,5 +69,5 @@ dd.option {
/* Fixes header-avatar aspect-ratio in IE8 */
.header-avatar img {
- height: 25px;
+ height: 20px;
}
diff --git a/phpBB/styles/subsilver2/style.cfg b/phpBB/styles/subsilver2/style.cfg
index 9a0c77b627..633acf66e0 100644
--- a/phpBB/styles/subsilver2/style.cfg
+++ b/phpBB/styles/subsilver2/style.cfg
@@ -21,8 +21,8 @@
# General Information about this style
name = subsilver2
copyright = © 2005 phpBB Limited
-style_version = 3.1.0-RC1
-phpbb_version = 3.1.0-RC1
+style_version = 3.1.0-RC2
+phpbb_version = 3.1.0-RC2
# Defining a different template bitfield
# template_bitfield = lNg=
diff --git a/phpBB/styles/subsilver2/template/index_body.html b/phpBB/styles/subsilver2/template/index_body.html
index 2fdd0c77c1..1a2786015f 100644
--- a/phpBB/styles/subsilver2/template/index_body.html
+++ b/phpBB/styles/subsilver2/template/index_body.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<!-- EVENT index_body_linklist_before -->
+<!-- EVENT index_body_markforums_before -->
<!-- IF U_MCP or U_ACP -->
<div id="pageheader">
@@ -10,7 +10,7 @@
<br clear="all" /><br />
<!-- ENDIF -->
-<!-- EVENT index_body_linklist_after -->
+<!-- EVENT index_body_markforums_after -->
<!-- INCLUDE forumlist_body.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_ban.html b/phpBB/styles/subsilver2/template/mcp_ban.html
index edf81c6d76..b6d77c5709 100644
--- a/phpBB/styles/subsilver2/template/mcp_ban.html
+++ b/phpBB/styles/subsilver2/template/mcp_ban.html
@@ -40,6 +40,7 @@
<tr>
<td class="row3" colspan="2">{L_EXPLAIN}</td>
</tr>
+<!-- EVENT mcp_ban_fields_before -->
<tr>
<td class="row1" width="45%" valign="top"><b>{L_BAN_CELL}{L_COLON}</b></td>
<td class="row2">
@@ -63,6 +64,7 @@
<td class="row1" valign="top"><b>{L_BAN_GIVE_REASON}{L_COLON}</b></td>
<td class="row2"><input name="bangivereason" type="text" class="post" maxlength="255" /></td>
</tr>
+<!-- EVENT mcp_ban_fields_after -->
<tr>
<td class="cat" colspan="2" align="center"><input type="submit" name="bansubmit" value="{L_SUBMIT}" class="btnmain" />&nbsp; <input type="reset" value="{L_RESET}" class="btnlite" />&nbsp;</td>
</tr>
@@ -78,6 +80,7 @@
<td class="row3" colspan="2">{L_UNBAN_EXPLAIN}</td>
</tr>
<!-- IF S_BANNED_OPTIONS -->
+ <!-- EVENT mcp_ban_unban_before -->
<tr>
<td class="row1" valign="top" width="45%"><b>{L_BAN_CELL}{L_COLON}</b></td>
<td class="row2"><select name="unban[]" multiple="multiple" size="10" style="width: 50%" onchange="if (this.selectedIndex > -1) display_details(this.options[this.selectedIndex].value); else display_details(-1);">{BANNED_OPTIONS}</select></td>
@@ -94,6 +97,7 @@
<td class="row1" valign="top"><b>{L_BAN_GIVE_REASON}{L_COLON}</b></td>
<td class="row2"><textarea style="border: 0; width: 100%" name="unbangivereason" readonly="readonly" rows="5" cols="80">&nbsp;</textarea></td>
</tr>
+ <!-- EVENT mcp_ban_unban_after -->
<tr>
<td class="cat" colspan="2" align="center"><input type="submit" name="unbansubmit" value="{L_SUBMIT}" class="btnmain" />&nbsp; <input type="reset" value="{L_RESET}" class="btnlite" />&nbsp;</td>
</tr>
diff --git a/phpBB/styles/subsilver2/template/memberlist_search.html b/phpBB/styles/subsilver2/template/memberlist_search.html
index aa6b61fe22..12dd10be2e 100644
--- a/phpBB/styles/subsilver2/template/memberlist_search.html
+++ b/phpBB/styles/subsilver2/template/memberlist_search.html
@@ -104,8 +104,12 @@
<tr>
<td class="row1"><b class="genmed">{L_GROUP}{L_COLON}</b></td>
<td class="row2" nowrap="nowrap"><select name="search_group_id">{S_GROUP_SELECT}</select></td>
- <td class="row1"><b class="genmed">{L_JABBER}{L_COLON}</b></td>
- <td class="row2"><input class="post" type="text" name="jabber" value="{JABBER}" /></td>
+ <!-- IF S_JABBER_ENABLED -->
+ <td class="row1"><b class="genmed">{L_JABBER}{L_COLON}</b></td>
+ <td class="row2"><input class="post" type="text" name="jabber" value="{JABBER}" /></td>
+ <!-- ELSE -->
+ <td colspan="2" class="row1">&nbsp;</td>
+ <!-- ENDIF -->
</tr>
<tr>
<td class="row1"><b class="genmed">{L_SORT_BY}{L_COLON}</b></td>
diff --git a/phpBB/styles/subsilver2/template/memberlist_view.html b/phpBB/styles/subsilver2/template/memberlist_view.html
index 550643ff03..00c627f62e 100644
--- a/phpBB/styles/subsilver2/template/memberlist_view.html
+++ b/phpBB/styles/subsilver2/template/memberlist_view.html
@@ -121,10 +121,12 @@
<td><a href="{U_PM}" class="imageset">{PM_IMG}</a></td>
</tr>
<!-- ENDIF -->
+ <!-- IF S_JABBER_ENABLED -->
<tr>
<td class="gen" nowrap="nowrap" align="{S_CONTENT_FLOW_END}">{L_JABBER}{L_COLON} </td>
<td><!-- IF U_JABBER --><a href="{U_JABBER}" onclick="popup(this.href, 550, 320); return false" class="imageset">{JABBER_IMG}</a><!-- ELSEIF USER_JABBER -->{USER_JABBER_IMG}<!-- ENDIF --></td>
</tr>
+ <!-- ENDIF -->
<!-- BEGIN custom_fields -->
<!-- IF custom_fields.S_PROFILE_CONTACT -->
<tr>
diff --git a/phpBB/styles/subsilver2/template/ucp_groups_manage.html b/phpBB/styles/subsilver2/template/ucp_groups_manage.html
index 3099fcb1d8..55c1c20528 100644
--- a/phpBB/styles/subsilver2/template/ucp_groups_manage.html
+++ b/phpBB/styles/subsilver2/template/ucp_groups_manage.html
@@ -78,7 +78,7 @@
<td class="row1" width="35%"><b class="genmed">{L_AVATAR_TYPE}{L_COLON}</b></td>
<td class="row2">
<select name="avatar_driver" id="avatar_driver">
- <option value="">{L_NO_AVATAR_CATEGORY}</option>
+ <option value="">{L_NO_AVATAR}</option>
<!-- BEGIN avatar_drivers -->
<option value="{avatar_drivers.DRIVER}"<!-- IF avatar_drivers.SELECTED --> selected="selected"<!-- ENDIF -->>{avatar_drivers.L_TITLE}</option>
<!-- END avatar_drivers -->
diff --git a/phpBB/styles/subsilver2/template/ucp_pm_viewmessage.html b/phpBB/styles/subsilver2/template/ucp_pm_viewmessage.html
index be1e27c5f3..9536b1f8c5 100644
--- a/phpBB/styles/subsilver2/template/ucp_pm_viewmessage.html
+++ b/phpBB/styles/subsilver2/template/ucp_pm_viewmessage.html
@@ -104,7 +104,19 @@
</tr>
<tr class="row1">
- <td><div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};">&nbsp;<!-- IF U_MESSAGE_AUTHOR --><a href="{U_MESSAGE_AUTHOR}" class="imageset">{PROFILE_IMG}</a> <!-- ENDIF --> <!-- IF U_EMAIL --><a href="{U_EMAIL}" class="imageset">{EMAIL_IMG}</a> <!-- ENDIF -->&nbsp;</div> <div class="gensmall" style="float: {S_CONTENT_FLOW_END};"><!-- IF U_EDIT --><a href="{U_EDIT}" class="imageset">{EDIT_IMG}</a> <!-- ENDIF --> <!-- IF U_QUOTE --><a href="{U_QUOTE}" class="imageset">{QUOTE_IMG}</a> <!-- ENDIF --> <!-- IF U_POST_REPLY_PM --><a href="{U_POST_REPLY_PM}" class="imageset">{REPLY_IMG}</a><!-- ENDIF -->&nbsp;</div></td>
+ <td>
+ <div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};">
+ &nbsp;<!-- IF U_MESSAGE_AUTHOR --><a href="{U_MESSAGE_AUTHOR}" class="imageset">{PROFILE_IMG}</a> <!-- ENDIF -->
+ <!-- IF U_EMAIL --><a href="{U_EMAIL}" class="imageset">{EMAIL_IMG}</a> <!-- ENDIF -->
+ &nbsp;</div>
+ <div class="gensmall" style="float: {S_CONTENT_FLOW_END};">
+ <!-- EVENT ucp_pm_viewmessage_post_buttons_before -->
+ <!-- IF U_EDIT --><a href="{U_EDIT}" class="imageset">{EDIT_IMG}</a> <!-- ENDIF -->
+ <!-- IF U_QUOTE --><a href="{U_QUOTE}" class="imageset">{QUOTE_IMG}</a> <!-- ENDIF -->
+ <!-- IF U_POST_REPLY_PM --><a href="{U_POST_REPLY_PM}" class="imageset">{REPLY_IMG}</a><!-- ENDIF -->
+ <!-- EVENT ucp_pm_viewmessage_post_buttons_after -->
+ &nbsp;</div>
+ </td>
</tr>
<tr>
diff --git a/phpBB/styles/subsilver2/template/ucp_profile_avatar.html b/phpBB/styles/subsilver2/template/ucp_profile_avatar.html
index 07b3edb498..fc52c149c6 100644
--- a/phpBB/styles/subsilver2/template/ucp_profile_avatar.html
+++ b/phpBB/styles/subsilver2/template/ucp_profile_avatar.html
@@ -28,7 +28,7 @@
<td class="row1" width="35%"><b class="genmed">{L_AVATAR_TYPE}{L_COLON}</b></td>
<td class="row2">
<select name="avatar_driver" id="avatar_driver" data-togglable-settings="true">
- <option value="">{L_NO_AVATAR_CATEGORY}</option>
+ <option value="">{L_NO_AVATAR}</option>
<!-- BEGIN avatar_drivers -->
<option value="{avatar_drivers.DRIVER}"<!-- IF avatar_drivers.SELECTED --> selected="selected"<!-- ENDIF --> data-toggle-setting=".avatar_option_{avatar_drivers.DRIVER}">{avatar_drivers.L_TITLE}</option>
<!-- END avatar_drivers -->
diff --git a/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html b/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html
index bf0aa8f899..2d0140a15d 100644
--- a/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html
+++ b/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html
@@ -12,10 +12,12 @@
<tr>
<td class="row1" colspan="2"><span class="gensmall">{L_PROFILE_INFO_NOTICE}</span></td>
</tr>
+<!-- IF S_JABBER_ENABLED -->
<tr>
<td class="row1" width="35%"><b class="genmed">{L_UCP_JABBER}{L_COLON} </b></td>
<td class="row2"><input class="post" type="text" name="jabber" size="30" maxlength="255" value="{JABBER}" /></td>
</tr>
+<!-- ENDIF -->
<!-- IF S_BIRTHDAYS_ENABLED -->
<tr>
<td class="row1" width="35%"><b class="genmed">{L_BIRTHDAY}{L_COLON} </b><br /><span class="gensmall">{L_BIRTHDAY_EXPLAIN}</span></td>
diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php
index 43b5f7f001..a03a81a15e 100644
--- a/phpBB/viewonline.php
+++ b/phpBB/viewonline.php
@@ -44,6 +44,7 @@ if (!$auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel'))
}
$pagination = $phpbb_container->get('pagination');
+$viewonline_helper = $phpbb_container->get('viewonline_helper');
$sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_JOINED'], 'c' => $user->lang['SORT_LOCATION']);
$sort_key_sql = array('a' => 'u.username_clean', 'b' => 's.session_time', 'c' => 's.session_page');
@@ -102,7 +103,7 @@ $guest_counter = 0;
// Get number of online guests (if we do not display them)
if (!$show_guests)
{
- switch ($db->sql_layer)
+ switch ($db->get_sql_layer())
{
case 'sqlite':
case 'sqlite3':
@@ -213,11 +214,7 @@ while ($row = $db->sql_fetchrow($result))
continue;
}
- preg_match('#^([a-z0-9/_-]+)#i', $row['session_page'], $on_page);
- if (!sizeof($on_page))
- {
- $on_page[1] = '';
- }
+ $on_page = $viewonline_helper->get_user_page($row['session_page']);
switch ($on_page[1])
{
@@ -298,8 +295,21 @@ while ($row = $db->sql_fetchrow($result))
break;
case 'memberlist':
- $location = (strpos($row['session_page'], 'mode=viewprofile') !== false) ? $user->lang['VIEWING_MEMBER_PROFILE'] : $user->lang['VIEWING_MEMBERS'];
$location_url = append_sid("{$phpbb_root_path}memberlist.$phpEx");
+
+ if (strpos($row['session_page'], 'mode=viewprofile') !== false)
+ {
+ $location = $user->lang['VIEWING_MEMBER_PROFILE'];
+ }
+ else if (strpos($row['session_page'], 'mode=contactadmin') !== false)
+ {
+ $location = $user->lang['VIEWING_CONTACT_ADMIN'];
+ $location_url = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contactadmin');
+ }
+ else
+ {
+ $location = $user->lang['VIEWING_MEMBERS'];
+ }
break;
case 'mcp':
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index d13d4b444f..905eecee76 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -523,6 +523,19 @@ gen_forum_auth_level('topic', $forum_id, $topic_data['forum_status']);
// Quick mod tools
$allow_change_type = ($auth->acl_get('m_', $forum_id) || ($user->data['is_registered'] && $user->data['user_id'] == $topic_data['topic_poster'])) ? true : false;
+$s_quickmod_action = append_sid(
+ "{$phpbb_root_path}mcp.$phpEx",
+ array(
+ 'f' => $forum_id,
+ 't' => $topic_id,
+ 'start' => $start,
+ 'quickmod' => 1,
+ 'redirect' => urlencode(str_replace('&amp;', '&', $viewtopic_url)),
+ ),
+ true,
+ $user->session_id
+);
+
$quickmod_array = array(
// 'key' => array('LANG_KEY', $userHasPermissions),
@@ -546,7 +559,7 @@ foreach($quickmod_array as $option => $qm_ary)
{
if (!empty($qm_ary[1]))
{
- phpbb_add_quickmod_option($option, $qm_ary[0]);
+ phpbb_add_quickmod_option($s_quickmod_action, $option, $qm_ary[0]);
}
}
@@ -631,7 +644,7 @@ $template->assign_vars(array(
'S_SELECT_SORT_DAYS' => $s_limit_days,
'S_SINGLE_MODERATOR' => (!empty($forum_moderators[$forum_id]) && sizeof($forum_moderators[$forum_id]) > 1) ? false : true,
'S_TOPIC_ACTION' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id" . (($start == 0) ? '' : "&amp;start=$start")),
- 'S_MOD_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&amp;t=$topic_id" . (($start == 0) ? '' : "&amp;start=$start") . "&amp;quickmod=1&amp;redirect=" . urlencode(str_replace('&amp;', '&', $viewtopic_url)), true, $user->session_id),
+ 'S_MOD_ACTION' => $s_quickmod_action,
'L_RETURN_TO_FORUM' => $user->lang('RETURN_TO', $topic_data['forum_name']),
'S_VIEWTOPIC' => true,
@@ -1141,6 +1154,7 @@ while ($row = $db->sql_fetchrow($result))
'username' => $row['username'],
'user_colour' => $row['user_colour'],
+ 'contact_user' => '',
'warnings' => 0,
'allow_pm' => 0,
@@ -1198,6 +1212,7 @@ while ($row = $db->sql_fetchrow($result))
'username' => $row['username'],
'user_colour' => $row['user_colour'],
+ 'contact_user' => $user->lang('CONTACT_USER', get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['username'])),
'online' => false,
'jabber' => ($row['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&amp;action=jabber&amp;u=$poster_id") : '',
@@ -1699,6 +1714,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'POSTER_AVATAR' => $user_cache[$poster_id]['avatar'],
'POSTER_WARNINGS' => $auth->acl_get('m_warn') ? $user_cache[$poster_id]['warnings'] : '',
'POSTER_AGE' => $user_cache[$poster_id]['age'],
+ 'CONTACT_USER' => $user_cache[$poster_id]['contact_user'],
'POST_DATE' => $user->format_date($row['post_time'], false, ($view == 'print') ? true : false),
'POST_SUBJECT' => $row['post_subject'],
@@ -1773,6 +1789,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
* @var int current_row_number Number of the post on this page
* @var int end Number of posts on this page
* @var int total_posts Total posts count
+ * @var int poster_id Post author id
* @var array row Array with original post and user data
* @var array cp_row Custom profile field data of the poster
* @var array attachments List of attachments
@@ -1782,12 +1799,14 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
* @since 3.1.0-a1
* @change 3.1.0-a3 Added vars start, current_row_number, end, attachments
* @change 3.1.0-b3 Added topic_data array, total_posts
+ * @change 3.1.0-RC3 Added poster_id
*/
$vars = array(
'start',
'current_row_number',
'end',
'total_posts',
+ 'poster_id',
'row',
'cp_row',
'attachments',
diff --git a/tests/auth/fixtures/oauth_tokens.xml b/tests/auth/fixtures/oauth_tokens.xml
index 9bfb5a4422..6c82e94e62 100644
--- a/tests/auth/fixtures/oauth_tokens.xml
+++ b/tests/auth/fixtures/oauth_tokens.xml
@@ -5,6 +5,12 @@
<column>session_id</column>
<column>provider</column>
<column>oauth_token</column>
+ <row>
+ <value>1</value>
+ <value>abcd</value>
+ <value>auth.provider.oauth.service.testing</value>
+ <value>{"token_class":"phpbb_not_a_token","accessToken":"error","refreshToken":0,"endOfLife":null,"extraParams":null}</value>
+ </row>
</table>
</dataset>
diff --git a/tests/auth/phpbb_not_a_token.php b/tests/auth/phpbb_not_a_token.php
new file mode 100644
index 0000000000..61cc14fa10
--- /dev/null
+++ b/tests/auth/phpbb_not_a_token.php
@@ -0,0 +1,23 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_not_a_token
+{
+ public function __construct($param1, $param2, $param3, $param4)
+ {
+ }
+
+ public function setEndOfLife()
+ {
+ }
+}
diff --git a/tests/auth/provider_oauth_token_storage_test.php b/tests/auth/provider_oauth_token_storage_test.php
index ec28e546bd..45daa9816b 100644
--- a/tests/auth/provider_oauth_token_storage_test.php
+++ b/tests/auth/provider_oauth_token_storage_test.php
@@ -13,6 +13,8 @@
use OAuth\OAuth2\Token\StdOAuth2Token;
+require_once dirname(__FILE__) . '/phpbb_not_a_token.php';
+
class phpbb_auth_provider_oauth_token_storage_test extends phpbb_database_test_case
{
protected $db;
@@ -73,6 +75,22 @@ class phpbb_auth_provider_oauth_token_storage_test extends phpbb_database_test_c
$this->assertEquals($token, $stored_token);
}
+ public function test_retrieveAccessToken_wrong_token()
+ {
+ $this->user->data['session_id'] = 'abcd';
+ try
+ {
+ $this->token_storage->retrieveAccessToken($this->service_name);
+ $this->fail('The token can not be deserialized and an exception should be thrown.');
+ }
+ catch (\OAuth\Common\Storage\Exception\TokenNotFoundException $e)
+ {
+ }
+
+ $row = $this->get_token_row_by_session_id('abcd');
+ $this->assertFalse($row);
+ }
+
public function test_retrieveAccessToken_from_db()
{
$expected_token = new StdOAuth2Token('access', 'refresh', StdOAuth2Token::EOL_NEVER_EXPIRES);
diff --git a/tests/avatar/manager_test.php b/tests/avatar/manager_test.php
index 246397ad6c..de505e2c9f 100644
--- a/tests/avatar/manager_test.php
+++ b/tests/avatar/manager_test.php
@@ -38,6 +38,7 @@ class phpbb_avatar_manager_test extends \phpbb_test_case
new phpbb_mock_request()
),
new \phpbb\filesystem(),
+ $this->getMock('\phpbb\request\request'),
$phpbb_root_path,
$phpEx
);
diff --git a/tests/config_php_file_test.php b/tests/config_php_file_test.php
new file mode 100644
index 0000000000..c2e4eb21c7
--- /dev/null
+++ b/tests/config_php_file_test.php
@@ -0,0 +1,30 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_config_php_file_test extends phpbb_test_case
+{
+ public function test_default()
+ {
+ $config_php = new \phpbb\config_php_file(dirname( __FILE__ ) . '/fixtures/', 'php');
+ $this->assertSame('bar', $config_php->get('foo'));
+ $this->assertSame(array('foo' => 'bar', 'foo_foo' => 'bar bar'), $config_php->get_all());
+ }
+
+ public function test_set_config_file()
+ {
+ $config_php = new \phpbb\config_php_file(dirname( __FILE__ ) . '/fixtures/', 'php');
+ $config_php->set_config_file(dirname( __FILE__ ) . '/fixtures/config_other.php');
+ $this->assertSame('foo', $config_php->get('bar'));
+ $this->assertSame(array('bar' => 'foo', 'bar_bar' => 'foo foo'), $config_php->get_all());
+ }
+}
diff --git a/tests/controller/helper_route_test.php b/tests/controller/helper_route_test.php
index 621efaa830..206c3a4f0b 100644
--- a/tests/controller/helper_route_test.php
+++ b/tests/controller/helper_route_test.php
@@ -26,6 +26,7 @@ class phpbb_controller_helper_route_test extends phpbb_test_case
new phpbb_mock_request()
),
new \phpbb\filesystem(),
+ $this->getMock('\phpbb\request\request'),
$phpbb_root_path,
$phpEx
);
diff --git a/tests/dbal/fixtures/migrator_config_text.xml b/tests/dbal/fixtures/migrator_config_text.xml
new file mode 100644
index 0000000000..ba8e1fcfcc
--- /dev/null
+++ b/tests/dbal/fixtures/migrator_config_text.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_config_text">
+ <column>config_name</column>
+ <column>config_value</column>
+ </table>
+</dataset>
diff --git a/tests/dbal/migrator_tool_config_text_test.php b/tests/dbal/migrator_tool_config_text_test.php
new file mode 100644
index 0000000000..b271c2d62e
--- /dev/null
+++ b/tests/dbal/migrator_tool_config_text_test.php
@@ -0,0 +1,75 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_dbal_migrator_tool_config_text_test extends phpbb_database_test_case
+{
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/migrator_config_text.xml');
+ }
+
+ public function setup()
+ {
+ parent::setup();
+
+ $this->db = $this->new_dbal();
+ $this->config_text = new \phpbb\config\db_text($this->db, 'phpbb_config_text');
+
+ $this->tool = new \phpbb\db\migration\tool\config_text($this->config_text);
+ }
+
+ public function test_add()
+ {
+ $this->tool->add('foo', 'bar');
+ $this->assertEquals('bar', $this->config_text->get('foo'));
+ }
+
+ public function test_add_twice()
+ {
+ $this->tool->add('foo', 'bar');
+ $this->assertEquals('bar', $this->config_text->get('foo'));
+
+ $this->tool->add('foo', 'bar2');
+ $this->assertEquals('bar', $this->config_text->get('foo'));
+ }
+
+ public function test_update()
+ {
+ $this->config_text->set('foo', 'bar');
+
+ $this->tool->update('foo', 'bar2');
+ $this->assertEquals('bar2', $this->config_text->get('foo'));
+ }
+
+ public function test_remove()
+ {
+ $this->config_text->set('foo', 'bar');
+
+ $this->tool->remove('foo');
+ $this->assertNull($this->config_text->get('foo'));
+ }
+
+ public function test_reverse_add()
+ {
+ $this->config_text->set('foo', 'bar');
+
+ $this->tool->reverse('add', 'foo');
+ $this->assertNull($this->config_text->get('foo'));
+ }
+
+ public function test_reverse_remove()
+ {
+ $this->tool->reverse('remove', 'foo');
+ $this->assertSame('', $this->config_text->get('foo'));
+ }
+}
diff --git a/tests/dbal/order_lower_test.php b/tests/dbal/order_lower_test.php
index b7a69c7c5d..b101d28c7d 100644
--- a/tests/dbal/order_lower_test.php
+++ b/tests/dbal/order_lower_test.php
@@ -22,7 +22,7 @@ class phpbb_dbal_order_lower_test extends phpbb_database_test_case
{
$db = $this->new_dbal();
- if (strpos($db->sql_layer, 'mysql') === 0 && version_compare($db->sql_server_info(true, false), '5.6', '>='))
+ if (strpos($db->get_sql_layer(), 'mysql') === 0 && version_compare($db->sql_server_info(true, false), '5.6', '>='))
{
$this->markTestSkipped('MySQL 5.6 fails to order things correctly. See also: http://tracker.phpbb.com/browse/PHPBB3-11571 http://bugs.mysql.com/bug.php?id=69005');
}
diff --git a/tests/dbal/select_test.php b/tests/dbal/select_test.php
index 7cac4d6a3b..e480716a49 100644
--- a/tests/dbal/select_test.php
+++ b/tests/dbal/select_test.php
@@ -219,8 +219,8 @@ class phpbb_dbal_select_test extends phpbb_database_test_case
{
$db = $this->new_dbal();
- $like_expression = str_replace('*', $db->any_char, $like_expression);
- $like_expression = str_replace('#', $db->one_char, $like_expression);
+ $like_expression = str_replace('*', $db->get_any_char(), $like_expression);
+ $like_expression = str_replace('#', $db->get_one_char(), $like_expression);
$where = ($like_expression) ? 'username_clean ' . $db->sql_like_expression($like_expression) : '';
$result = $db->sql_query('SELECT username_clean
diff --git a/tests/dbal/sql_insert_buffer_test.php b/tests/dbal/sql_insert_buffer_test.php
index 2f9ed0008f..eae0abceba 100644
--- a/tests/dbal/sql_insert_buffer_test.php
+++ b/tests/dbal/sql_insert_buffer_test.php
@@ -32,7 +32,7 @@ class phpbb_dbal_sql_insert_buffer_test extends phpbb_database_test_case
public function test_multi_insert_disabled_insert_and_flush()
{
- $this->db->multi_insert = false;
+ $this->db->set_multi_insert(false);
$this->assertTrue($this->buffer->insert($this->get_row(1)));
$this->assert_config_count(3);
$this->assertFalse($this->buffer->flush());
@@ -50,7 +50,7 @@ class phpbb_dbal_sql_insert_buffer_test extends phpbb_database_test_case
public function test_multi_insert_disabled_insert_with_flush()
{
- $this->db->multi_insert = false;
+ $this->db->set_multi_insert(false);
$this->assertTrue($this->buffer->insert($this->get_row(1)));
$this->assert_config_count(3);
$this->assertTrue($this->buffer->insert($this->get_row(2)));
@@ -68,7 +68,7 @@ class phpbb_dbal_sql_insert_buffer_test extends phpbb_database_test_case
public function test_multi_insert_disabled_insert_all_and_flush()
{
- $this->db->multi_insert = false;
+ $this->db->set_multi_insert(false);
$this->assertTrue($this->buffer->insert_all($this->get_rows(3)));
$this->assert_config_count(5);
}
@@ -93,7 +93,7 @@ class phpbb_dbal_sql_insert_buffer_test extends phpbb_database_test_case
protected function check_multi_insert_support()
{
- if (!$this->db->multi_insert)
+ if (!$this->db->get_multi_insert())
{
$this->markTestSkipped('Database does not support multi_insert');
}
diff --git a/tests/di/create_container_test.php b/tests/di/create_container_test.php
index 8bf9f636fa..559c0b122c 100644
--- a/tests/di/create_container_test.php
+++ b/tests/di/create_container_test.php
@@ -14,47 +14,135 @@
namespace
{
require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
- require_once dirname(__FILE__) . '/../../phpBB/includes/functions_container.php';
- class phpbb_di_container_test extends phpbb_test_case
+ class phpbb_di_container_test extends \phpbb_test_case
{
- public function test_phpbb_create_container()
+ protected $config_php;
+
+ /**
+ * @var \phpbb\di\container_builder
+ */
+ protected $builder;
+ protected $phpbb_root_path;
+ protected $filename;
+
+ public function setUp()
{
- $phpbb_root_path = __DIR__ . '/../../phpBB/';
- $extensions = array(
- new \phpbb\di\extension\config(__DIR__ . '/fixtures/config.php'),
- new \phpbb\di\extension\core($phpbb_root_path . 'config'),
- );
- $container = phpbb_create_container($extensions, $phpbb_root_path, 'php');
+ $this->phpbb_root_path = dirname(__FILE__) . '/';
+ $this->config_php = new \phpbb\config_php_file($this->phpbb_root_path . 'fixtures/', 'php');
+ $this->builder = new phpbb_mock_phpbb_di_container_builder($this->config_php, $this->phpbb_root_path . 'fixtures/', 'php');
+
+ $this->filename = $this->phpbb_root_path . '../tmp/container.php';
+ if (is_file($this->filename))
+ {
+ unlink($this->filename);
+ }
+
+ parent::setUp();
+ }
+ public function test_default_container()
+ {
+ $container = $this->builder->get_container();
$this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container);
+
+ // Checks the core services
+ $this->assertTrue($container->hasParameter('core'));
+
+ // Checks compile_container
+ $this->assertTrue($container->isFrozen());
+
+ // Checks inject_config
+ $this->assertTrue($container->hasParameter('dbal.dbhost'));
+
+ // Checks use_extensions
+ $this->assertTrue($container->hasParameter('enabled'));
+ $this->assertFalse($container->hasParameter('disabled'));
+ $this->assertFalse($container->hasParameter('available'));
+
+ // Checks set_custom_parameters
+ $this->assertTrue($container->hasParameter('core.root_path'));
+
+ // Checks dump_container
+ $this->assertTrue(is_file($this->filename));
+
+ // Checks the construction of a dumped container
+ $container = $this->builder->get_container();
+ $this->assertInstanceOf('phpbb_cache_container', $container);
+ $this->assertFalse($container->isFrozen());
+ $container->getParameterBag(); // needed, otherwise the container is not marked as frozen
+ $this->assertTrue($container->isFrozen());
}
- public function test_phpbb_create_install_container()
+ public function test_dump_container()
{
- $phpbb_root_path = __DIR__ . '/../../phpBB/';
- $extensions = array(
- new \phpbb\di\extension\config(__DIR__ . '/fixtures/config.php'),
- new \phpbb\di\extension\core($phpbb_root_path . 'config'),
- );
- $container = phpbb_create_install_container($phpbb_root_path, 'php');
+ $this->builder->set_dump_container(false);
+ $container = $this->builder->get_container();
+ $this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container);
+ // Checks dump_container
+ $this->assertFalse(is_file($this->filename));
+
+ // Checks the construction of a dumped container
+ $container = $this->builder->get_container();
+ $this->assertNotInstanceOf('phpbb_cache_container', $container);
$this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container);
$this->assertTrue($container->isFrozen());
}
- public function test_phpbb_create_compiled_container()
+ public function test_use_extensions()
{
- $phpbb_root_path = __DIR__ . '/../../phpBB/';
- $config_file = __DIR__ . '/fixtures/config.php';
- $extensions = array(
- new \phpbb\di\extension\config(__DIR__ . '/fixtures/config.php'),
- new \phpbb\di\extension\core($phpbb_root_path . 'config'),
- );
- $container = phpbb_create_compiled_container($config_file, $extensions, array(), $phpbb_root_path, 'php');
+ $this->builder->set_use_extensions(false);
+ $container = $this->builder->get_container();
+ $this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container);
+
+ // Checks the core services
+ $this->assertTrue($container->hasParameter('core'));
+
+ // Checks use_extensions
+ $this->assertFalse($container->hasParameter('enabled'));
+ $this->assertFalse($container->hasParameter('disabled'));
+ $this->assertFalse($container->hasParameter('available'));
+ }
+ public function test_compile_container()
+ {
+ $this->builder->set_compile_container(false);
+ $container = $this->builder->get_container();
$this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container);
- $this->assertTrue($container->isFrozen());
+
+ // Checks compile_container
+ $this->assertFalse($container->isFrozen());
+ }
+
+ public function test_inject_config()
+ {
+ $this->builder->set_inject_config(false);
+ $container = $this->builder->get_container();
+ $this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container);
+
+ // Checks inject_config
+ $this->assertFalse($container->hasParameter('dbal.dbhost'));
+ }
+
+ public function test_set_config_path()
+ {
+ $this->builder->set_config_path($this->phpbb_root_path . 'fixtures/other_config/');
+ $container = $this->builder->get_container();
+ $this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container);
+
+ $this->assertTrue($container->hasParameter('other_config'));
+ $this->assertFalse($container->hasParameter('core'));
+ }
+
+ public function test_set_custom_parameters()
+ {
+ $this->builder->set_custom_parameters(array('my_parameter' => true));
+ $container = $this->builder->get_container();
+ $this->assertInstanceOf('Symfony\Component\DependencyInjection\ContainerBuilder', $container);
+
+ $this->assertTrue($container->hasParameter('my_parameter'));
+ $this->assertFalse($container->hasParameter('core.root_path'));
}
}
}
@@ -102,5 +190,12 @@ namespace phpbb\db\driver
function sql_like_expression($expression)
{
}
+
+ function sql_fetchrowset($query_id = false)
+ {
+ return array(
+ array('ext_name' => 'vendor/enabled'),
+ );
+ }
}
}
diff --git a/tests/di/fixtures/config/services.yml b/tests/di/fixtures/config/services.yml
new file mode 100644
index 0000000000..f2a22ae109
--- /dev/null
+++ b/tests/di/fixtures/config/services.yml
@@ -0,0 +1,14 @@
+parameters:
+ core: true
+
+services:
+ config.php:
+ synthetic: true
+
+ dbal.conn:
+ class: phpbb\db\driver\factory
+ arguments:
+ - @service_container
+
+ dispatcher:
+ class: phpbb\db\driver\container_mock
diff --git a/tests/di/fixtures/ext/vendor/available/config/services.yml b/tests/di/fixtures/ext/vendor/available/config/services.yml
new file mode 100644
index 0000000000..2ced431f5a
--- /dev/null
+++ b/tests/di/fixtures/ext/vendor/available/config/services.yml
@@ -0,0 +1,2 @@
+parameters:
+ available: true
diff --git a/tests/di/fixtures/ext/vendor/disabled/config/services.yml b/tests/di/fixtures/ext/vendor/disabled/config/services.yml
new file mode 100644
index 0000000000..31ada384bf
--- /dev/null
+++ b/tests/di/fixtures/ext/vendor/disabled/config/services.yml
@@ -0,0 +1,2 @@
+parameters:
+ disabled: true
diff --git a/tests/di/fixtures/ext/vendor/enabled/config/services.yml b/tests/di/fixtures/ext/vendor/enabled/config/services.yml
new file mode 100644
index 0000000000..88a7919ed1
--- /dev/null
+++ b/tests/di/fixtures/ext/vendor/enabled/config/services.yml
@@ -0,0 +1,2 @@
+parameters:
+ enabled: true
diff --git a/tests/di/fixtures/other_config/services.yml b/tests/di/fixtures/other_config/services.yml
new file mode 100644
index 0000000000..c299bfc648
--- /dev/null
+++ b/tests/di/fixtures/other_config/services.yml
@@ -0,0 +1,14 @@
+parameters:
+ other_config: true
+
+services:
+ config.php:
+ synthetic: true
+
+ dbal.conn:
+ class: phpbb\db\driver\factory
+ arguments:
+ - @service_container
+
+ dispatcher:
+ class: phpbb\db\driver\container_mock
diff --git a/tests/event/php_exporter_test.php b/tests/event/php_exporter_test.php
index 823d90b63f..b52d68e305 100644
--- a/tests/event/php_exporter_test.php
+++ b/tests/event/php_exporter_test.php
@@ -118,6 +118,7 @@ class phpbb_event_php_exporter_test extends phpbb_test_case
array('* @since 3.1.0-a1', '3.1.0-a1'),
array('* @since 3.1.0-b3', '3.1.0-b3'),
array(' * @since 3.1.0-b3', '3.1.0-b3'),
+ array('* @since 3.1.0-RC2', '3.1.0-RC2'),
);
}
@@ -137,6 +138,7 @@ class phpbb_event_php_exporter_test extends phpbb_test_case
array('* @since 3.1.0-a1 bertie is cool'),
array('bertie* @since 3.1.0-a1'),
array('* @since 3.1-A2'),
+ array('* @since 3.1.0-rc1'),
);
}
diff --git a/tests/extension/ext/barfoo/composer.json b/tests/extension/ext/barfoo/composer.json
index d88fd413c9..05bb099707 100644
--- a/tests/extension/ext/barfoo/composer.json
+++ b/tests/extension/ext/barfoo/composer.json
@@ -13,10 +13,12 @@
"role": "N/A"
}],
"require": {
- "php": ">=5.3",
- "phpbb/phpbb": "3.1.*@dev"
+ "php": ">=5.3"
},
"extra": {
- "display-name": "phpBB BarFoo Extension"
+ "display-name": "phpBB BarFoo Extension",
+ "soft-require": {
+ "phpbb/phpbb": "3.1.*@dev"
+ }
}
}
diff --git a/tests/extension/ext/vendor/moo/composer.json b/tests/extension/ext/vendor/moo/composer.json
index b8fc544c01..d49aab47cd 100644
--- a/tests/extension/ext/vendor/moo/composer.json
+++ b/tests/extension/ext/vendor/moo/composer.json
@@ -13,10 +13,12 @@
"role": "N/A"
}],
"require": {
- "php": ">=5.3",
- "phpbb/phpbb": "3.1.*@dev"
+ "php": ">=5.3"
},
"extra": {
- "display-name": "phpBB Moo Extension"
+ "display-name": "phpBB Moo Extension",
+ "soft-require": {
+ "phpbb/phpbb": "3.1.*@dev"
+ }
}
}
diff --git a/tests/extension/ext/vendor2/bar/composer.json b/tests/extension/ext/vendor2/bar/composer.json
index 215e7d59db..9d2ed86a0c 100644
--- a/tests/extension/ext/vendor2/bar/composer.json
+++ b/tests/extension/ext/vendor2/bar/composer.json
@@ -12,10 +12,12 @@
"role": "N/A"
}],
"require": {
- "php": ">=5.3",
- "phpbb/phpbb": "3.1.*@dev"
+ "php": ">=5.3"
},
"extra": {
- "display-name": "phpBB Bar Extension"
+ "display-name": "phpBB Bar Extension",
+ "soft-require": {
+ "phpbb/phpbb": "3.1.*@dev"
+ }
}
}
diff --git a/tests/extension/ext/vendor2/foo/composer.json b/tests/extension/ext/vendor2/foo/composer.json
index 7b2a80f5d3..efcdfc338f 100644
--- a/tests/extension/ext/vendor2/foo/composer.json
+++ b/tests/extension/ext/vendor2/foo/composer.json
@@ -12,10 +12,12 @@
"role": "N/A"
}],
"require": {
- "php": ">=5.3",
- "phpbb/phpbb": "3.1.*@dev"
+ "php": ">=5.3"
},
"extra": {
- "display-name": "phpBB Foo Extension"
+ "display-name": "phpBB Foo Extension",
+ "soft-require": {
+ "phpbb/phpbb": "3.1.*@dev"
+ }
}
}
diff --git a/tests/extension/manager_test.php b/tests/extension/manager_test.php
index d9f8fbd1a4..230c90c7c7 100644
--- a/tests/extension/manager_test.php
+++ b/tests/extension/manager_test.php
@@ -32,22 +32,62 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
$this->extension_manager = $this->create_extension_manager();
}
- public function test_available()
+ public function test_all_available()
{
// barfoo and vendor3/bar should not listed due to missing composer.json. barfoo also has incorrect dir structure.
$this->assertEquals(array('vendor/moo', 'vendor2/bar', 'vendor2/foo'), array_keys($this->extension_manager->all_available()));
}
- public function test_enabled()
+ public function test_all_enabled()
{
$this->assertEquals(array('vendor2/foo'), array_keys($this->extension_manager->all_enabled()));
}
- public function test_configured()
+ public function test_all_configured()
{
$this->assertEquals(array('vendor/moo', 'vendor2/foo'), array_keys($this->extension_manager->all_configured()));
}
+ public function test_is_enabled()
+ {
+ $this->assertSame(true, $this->extension_manager->is_enabled('vendor2/foo'));
+ $this->assertSame(false, $this->extension_manager->is_enabled('vendor/moo'));
+ $this->assertSame(false, $this->extension_manager->is_enabled('vendor2/bar'));
+ $this->assertSame(false, $this->extension_manager->is_enabled('bertie/worlddominationplan'));
+ }
+
+ public function test_is_disabled()
+ {
+ $this->assertSame(false, $this->extension_manager->is_disabled('vendor2/foo'));
+ $this->assertSame(true, $this->extension_manager->is_disabled('vendor/moo'));
+ $this->assertSame(false, $this->extension_manager->is_disabled('vendor2/bar'));
+ $this->assertSame(false, $this->extension_manager->is_disabled('bertie/worlddominationplan'));
+ }
+
+ public function test_is_purged()
+ {
+ $this->assertSame(false, $this->extension_manager->is_purged('vendor2/foo'));
+ $this->assertSame(false, $this->extension_manager->is_purged('vendor/moo'));
+ $this->assertSame(true, $this->extension_manager->is_purged('vendor2/bar'));
+ $this->assertSame(false, $this->extension_manager->is_purged('bertie/worlddominationplan'));
+ }
+
+ public function test_is_configured()
+ {
+ $this->assertSame(true, $this->extension_manager->is_configured('vendor2/foo'));
+ $this->assertSame(true, $this->extension_manager->is_configured('vendor/moo'));
+ $this->assertSame(false, $this->extension_manager->is_configured('vendor2/bar'));
+ $this->assertSame(false, $this->extension_manager->is_configured('bertie/worlddominationplan'));
+ }
+
+ public function test_is_available()
+ {
+ $this->assertSame(true, $this->extension_manager->is_available('vendor2/foo'));
+ $this->assertSame(true, $this->extension_manager->is_available('vendor/moo'));
+ $this->assertSame(true, $this->extension_manager->is_available('vendor2/bar'));
+ $this->assertSame(false, $this->extension_manager->is_available('bertie/worlddominationplan'));
+ }
+
public function test_enable()
{
vendor2\bar\ext::$state = 0;
diff --git a/tests/extension/metadata_manager_test.php b/tests/extension/metadata_manager_test.php
index 3678ac0a3f..535e4fe0d5 100644
--- a/tests/extension/metadata_manager_test.php
+++ b/tests/extension/metadata_manager_test.php
@@ -19,8 +19,11 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
protected $cache;
protected $config;
protected $db;
+ protected $db_tools;
+ protected $table_prefix;
protected $phpbb_root_path;
protected $phpEx;
+ protected $migrator;
protected $template;
protected $user;
@@ -50,6 +53,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
new phpbb_mock_request()
),
new \phpbb\filesystem(),
+ $this->getMock('\phpbb\request\request'),
$this->phpbb_root_path,
$this->phpEx
),
@@ -70,7 +74,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
new \phpbb\db\migration\helper()
);
$container = new phpbb_mock_container_builder();
- $container->set('migrator', $migrator);
+ $container->set('migrator', $this->migrator);
$this->extension_manager = new \phpbb\extension\manager(
$container,
@@ -96,9 +100,10 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
{
$manager->get_metadata();
}
- catch(\phpbb\extension\exception $e){}
-
- $this->assertEquals((string) $e, $this->user->lang('FILE_NOT_FOUND', $this->phpbb_root_path . $this->extension_manager->get_extension_path($ext_name) . 'composer.json'));
+ catch (\phpbb\extension\exception $e)
+ {
+ $this->assertEquals((string) $e, $this->user->lang('FILE_NOT_FOUND', $this->phpbb_root_path . $this->extension_manager->get_extension_path($ext_name) . 'composer.json'));
+ }
}
// Should be the same as a direct json_decode of the composer.json file
@@ -112,7 +117,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
{
$metadata = $manager->get_metadata();
}
- catch(\phpbb\extension\exception $e)
+ catch (\phpbb\extension\exception $e)
{
$this->fail($e);
}
@@ -122,64 +127,42 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->assertEquals($metadata, $json);
}
- public function test_validator_non_existant()
+ public function validator_non_existing_data()
{
- $ext_name = 'validator';
-
- $manager = $this->get_metadata_manager($ext_name);
-
- // Non-existant data
- try
- {
- $manager->validate('name');
-
- $this->fail('Exception not triggered');
- }
- catch(\phpbb\extension\exception $e)
- {
- $this->assertEquals((string) $e, $this->user->lang('META_FIELD_NOT_SET', 'name'));
- }
-
- try
- {
- $manager->validate('type');
-
- $this->fail('Exception not triggered');
- }
- catch(\phpbb\extension\exception $e)
- {
- $this->assertEquals((string) $e, $this->user->lang('META_FIELD_NOT_SET', 'type'));
- }
-
- try
- {
- $manager->validate('license');
-
- $this->fail('Exception not triggered');
- }
- catch(\phpbb\extension\exception $e)
- {
- $this->assertEquals((string) $e, $this->user->lang('META_FIELD_NOT_SET', 'license'));
- }
+ return array(
+ array('name'),
+ array('type'),
+ array('license'),
+ array('version'),
+ );
+ }
+ /**
+ * @dataProvider validator_non_existing_data
+ */
+ public function test_validator_non_existing($field_name)
+ {
+ $manager = $this->get_metadata_manager('validator');
try
{
- $manager->validate('version');
-
+ $manager->validate($field_name);
$this->fail('Exception not triggered');
}
catch(\phpbb\extension\exception $e)
{
- $this->assertEquals((string) $e, $this->user->lang('META_FIELD_NOT_SET', 'version'));
+ $this->assertEquals((string) $e, $this->user->lang('META_FIELD_NOT_SET', $field_name));
}
+ }
+ public function test_validator_non_existing_authors()
+ {
+ $manager = $this->get_metadata_manager('validator');
try
{
$manager->validate_authors();
-
$this->fail('Exception not triggered');
}
- catch(\phpbb\extension\exception $e)
+ catch (\phpbb\extension\exception $e)
{
$this->assertEquals((string) $e, $this->user->lang('META_FIELD_NOT_SET', 'authors'));
}
@@ -193,72 +176,44 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
try
{
$manager->validate_authors();
-
$this->fail('Exception not triggered');
}
- catch(\phpbb\extension\exception $e)
+ catch (\phpbb\extension\exception $e)
{
$this->assertEquals((string) $e, $this->user->lang('META_FIELD_NOT_SET', 'author name'));
}
}
-
- public function test_validator_invalid()
+ public function validator_invalid_data()
{
- $ext_name = 'validator';
+ return array(
+ array('name', 'asdf'),
+ array('type', 'asdf'),
+ array('license', ''),
+ array('version', ''),
+ );
+ }
- $manager = $this->get_metadata_manager($ext_name);
+ /**
+ * @dataProvider validator_invalid_data
+ */
+ public function test_validator_invalid($field_name, $field_value)
+ {
+ $manager = $this->get_metadata_manager('validator');
// Invalid data
$manager->set_metadata(array(
- 'name' => 'asdf',
- 'type' => 'asdf',
- 'license' => '',
- 'version' => '',
+ $field_name => $field_value,
));
try
{
- $manager->validate('name');
-
+ $manager->validate($field_name);
$this->fail('Exception not triggered');
}
catch(\phpbb\extension\exception $e)
{
- $this->assertEquals((string) $e, $this->user->lang('META_FIELD_INVALID', 'name'));
- }
-
- try
- {
- $manager->validate('type');
-
- $this->fail('Exception not triggered');
- }
- catch(\phpbb\extension\exception $e)
- {
- $this->assertEquals((string) $e, $this->user->lang('META_FIELD_INVALID', 'type'));
- }
-
- try
- {
- $manager->validate('license');
-
- $this->fail('Exception not triggered');
- }
- catch(\phpbb\extension\exception $e)
- {
- $this->assertEquals((string) $e, $this->user->lang('META_FIELD_INVALID', 'license'));
- }
-
- try
- {
- $manager->validate('version');
-
- $this->fail('Exception not triggered');
- }
- catch(\phpbb\extension\exception $e)
- {
- $this->assertEquals((string) $e, $this->user->lang('META_FIELD_INVALID', 'version'));
+ $this->assertEquals((string) $e, $this->user->lang('META_FIELD_INVALID', $field_name));
}
}
@@ -286,143 +241,83 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
}
}
-
- public function test_validator_requirements()
+ public function validator_requirements_data()
{
- $ext_name = 'validator';
-
- $manager = $this->get_metadata_manager($ext_name);
- // Too high of requirements
- $manager->merge_metadata(array(
- 'require' => array(
- 'php' => '10.0.0',
- 'phpbb/phpbb' => '3.2.0', // config is set to 3.1.0
+ return array(
+ array(
+ '10.0.0',
+ '100.2.0',
+ false,
+ false,
+ 'Versions are not compared at the moment',
),
- ));
-
- try
- {
- //$this->assertEquals(false, $manager->validate_require_php());
- //$this->assertEquals(false, $manager->validate_require_phpbb());
- }
- catch(\phpbb\extension\exception $e)
- {
- $this->fail($e);
- }
-
-
- // Too high of requirements
- $manager->merge_metadata(array(
- 'require' => array(
- 'php' => '5.3.0',
- 'phpbb/phpbb' => '3.1.0-beta', // config is set to 3.1.0
+ array(
+ '5.3.0',
+ '3.1.0-beta',
+ true,
+ true,
),
- ));
-
- try
- {
- $this->assertEquals(true, $manager->validate_require_php());
- $this->assertEquals(true, $manager->validate_require_phpbb());
- }
- catch(\phpbb\extension\exception $e)
- {
- $this->fail($e);
- }
-
-
- // Too high of requirements
- $manager->merge_metadata(array(
- 'require' => array(
- 'php' => '>' . phpversion(),
- 'phpbb/phpbb' => '>3.1.0', // config is set to 3.1.0
+ array(
+ '>' . phpversion(),
+ '>3.1.0',
+ false,
+ false,
+ 'Versions are not compared at the moment',
),
- ));
-
- try
- {
- //$this->assertEquals(false, $manager->validate_require_php());
- //$this->assertEquals(false, $manager->validate_require_phpbb());
- }
- catch(\phpbb\extension\exception $e)
- {
- $this->fail($e);
- }
-
-
- // Too high of current install
- $manager->merge_metadata(array(
- 'require' => array(
- 'php' => '<' . phpversion(),
- 'phpbb/phpbb' => '<3.1.0', // config is set to 3.1.0
+ array(
+ '<' . phpversion(),
+ '<3.1.0',
+ false,
+ false,
+ 'Versions are not compared at the moment',
),
- ));
-
- try
- {
- //$this->assertEquals(false, $manager->validate_require_php());
- //$this->assertEquals(false, $manager->validate_require_phpbb());
- }
- catch(\phpbb\extension\exception $e)
- {
- $this->fail($e);
- }
-
-
- // Matching requirements
- $manager->merge_metadata(array(
- 'require' => array(
- 'php' => phpversion(),
- 'phpbb/phpbb' => '3.1.0', // config is set to 3.1.0
+ array(
+ phpversion(),
+ '3.1.0',
+ true,
+ true,
),
- ));
-
- try
- {
- $this->assertEquals(true, $manager->validate_require_php());
- $this->assertEquals(true, $manager->validate_require_phpbb());
- }
- catch(\phpbb\extension\exception $e)
- {
- $this->fail($e);
- }
-
-
- // Matching requirements
- $manager->merge_metadata(array(
- 'require' => array(
- 'php' => '>=' . phpversion(),
- 'phpbb/phpbb' => '>=3.1.0', // config is set to 3.1.0
+ array(
+ '>=' . phpversion(),
+ '>=3.1.0',
+ true,
+ true,
),
- ));
+ array(
+ '<=' . phpversion(),
+ '<=3.1.0',
+ true,
+ true,
+ ),
+ );
+ }
- try
- {
- $this->assertEquals(true, $manager->validate_require_php());
- $this->assertEquals(true, $manager->validate_require_phpbb());
- }
- catch(\phpbb\extension\exception $e)
+ /**
+ * @dataProvider validator_requirements_data
+ */
+ public function test_validator_requirements($php_version, $phpbb_version, $expected_php, $expected_phpbb, $incomplete_reason = '')
+ {
+ if ($incomplete_reason)
{
- $this->fail($e);
+ $this->markTestIncomplete($incomplete_reason);
}
-
- // Matching requirements
+ $ext_name = 'validator';
+ $manager = $this->get_metadata_manager($ext_name);
+ // Too high of requirements
$manager->merge_metadata(array(
'require' => array(
- 'php' => '<=' . phpversion(),
- 'phpbb/phpbb' => '<=3.1.0', // config is set to 3.1.0
+ 'php' => $php_version,
+ ),
+ 'extra' => array(
+ 'soft-require' => array(
+ 'phpbb/phpbb' => $phpbb_version, // config is set to 3.1.0
+ ),
),
));
- try
- {
- $this->assertEquals(true, $manager->validate_require_php());
- $this->assertEquals(true, $manager->validate_require_phpbb());
- }
- catch(\phpbb\extension\exception $e)
- {
- $this->fail($e);
- }
+ $this->assertEquals($expected_php, $manager->validate_require_php());
+ $this->assertEquals($expected_phpbb, $manager->validate_require_phpbb());
}
/**
diff --git a/tests/filesystem/clean_path_test.php b/tests/filesystem/clean_path_test.php
index 1aef0d8a0c..c585b17155 100644
--- a/tests/filesystem/clean_path_test.php
+++ b/tests/filesystem/clean_path_test.php
@@ -32,6 +32,8 @@ class phpbb_filesystem_clean_path_test extends phpbb_test_case
array('foo/bar/.', 'foo/bar'),
array('./foo/bar', './foo/bar'),
array('../foo/bar', '../foo/bar'),
+ array('./../foo/bar', './../foo/bar'),
+ array('././../foo/bar', './../foo/bar'),
array('one/two/three', 'one/two/three'),
array('one/two/../three', 'one/three'),
array('one/../two/three', 'two/three'),
diff --git a/tests/fixtures/config.php b/tests/fixtures/config.php
new file mode 100644
index 0000000000..ae9e8c22de
--- /dev/null
+++ b/tests/fixtures/config.php
@@ -0,0 +1,3 @@
+<?php
+$foo = 'bar';
+$foo_foo = 'bar bar';
diff --git a/tests/fixtures/config_other.php b/tests/fixtures/config_other.php
new file mode 100644
index 0000000000..e0ecc17bb9
--- /dev/null
+++ b/tests/fixtures/config_other.php
@@ -0,0 +1,3 @@
+<?php
+$bar = 'foo';
+$bar_bar = 'foo foo';
diff --git a/tests/functional/download_test.php b/tests/functional/download_test.php
index dbf197fcfa..6a6df14c81 100644
--- a/tests/functional/download_test.php
+++ b/tests/functional/download_test.php
@@ -205,12 +205,8 @@ class phpbb_functional_download_test extends phpbb_functional_test_case
),
));
- $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Download Topic #1']}&sid={$this->sid}");
-
$this->add_lang('posting');
- $form = $crawler->selectButton('Go')->eq(2)->form();
- $form['action']->select('delete_topic');
- $crawler = self::submit($form);
+ $crawler = $this->get_quickmod_page($this->data['topics']['Download Topic #1'], 'DELETE_TOPIC');
$this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text());
$this->add_lang('mcp');
diff --git a/tests/functional/feed_test.php b/tests/functional/feed_test.php
index a474ecf27f..7aa2d0da7d 100644
--- a/tests/functional/feed_test.php
+++ b/tests/functional/feed_test.php
@@ -619,12 +619,8 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
),
));
- $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Feeds #1 - Topic #2']}&sid={$this->sid}");
-
$this->add_lang('posting');
- $form = $crawler->selectButton('Go')->eq(2)->form();
- $form['action']->select('delete_topic');
- $crawler = self::submit($form);
+ $crawler = $this->get_quickmod_page($this->data['topics']['Feeds #1 - Topic #2'], 'DELETE_TOPIC');
$this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text());
$this->add_lang('mcp');
diff --git a/tests/functional/fixtures/ext/foo/bar/composer.json b/tests/functional/fixtures/ext/foo/bar/composer.json
index 2f91426d2a..f0c7f0e6c1 100644
--- a/tests/functional/fixtures/ext/foo/bar/composer.json
+++ b/tests/functional/fixtures/ext/foo/bar/composer.json
@@ -13,10 +13,12 @@
"role": "Developer"
}],
"require": {
- "php": ">=5.3",
- "phpbb/phpbb": "3.1.*@dev"
+ "php": ">=5.3"
},
"extra": {
- "display-name": "phpBB 3.1 Extension Testing"
+ "display-name": "phpBB 3.1 Extension Testing",
+ "soft-require": {
+ "phpbb/phpbb": "3.1.*@dev"
+ }
}
}
diff --git a/tests/functional/jumpbox_test.php b/tests/functional/jumpbox_test.php
index 9eddcb6bf6..f5a671b1b9 100644
--- a/tests/functional/jumpbox_test.php
+++ b/tests/functional/jumpbox_test.php
@@ -20,18 +20,16 @@ class phpbb_functional_jumpbox_test extends phpbb_functional_test_case
{
$this->login();
- $crawler = self::request('GET', "viewtopic.php?t=1&sid={$this->sid}");
- $form = $crawler->filter('#quickmodform')->selectButton($this->lang('GO'))->form(array(
- 'action' => 'merge_topic',
- ));
+ $this->crawler = $this->get_quickmod_page(1, 'MERGE_TOPIC');
+ $this->check_valid_jump('Your first forum');
- $crawler = self::submit($form);
- $this->assertContains($this->lang('FORUM') . ': Your first forum', $crawler->filter('#cp-main h2')->text());
- $form = $crawler->filter('#jumpbox')->selectButton($this->lang('GO'))->form(array(
- 'f' => 1,
- ));
+ $link = $this->crawler->filter('#jumpbox')->selectLink('Your first category')->link()->getUri();
+ $this->crawler = self::request('GET', substr($link, strpos($link, 'mcp.')));
+ $this->check_valid_jump('Your first category');
+ }
- $crawler = self::submit($form);
- $this->assertContains($this->lang('FORUM') . ': Your first category', $crawler->filter('#cp-main h2')->text());
+ protected function check_valid_jump($forum)
+ {
+ $this->assertContains($this->lang('FORUM') . ": $forum", $this->crawler->filter('#cp-main h2')->text(), $this->crawler->text());
}
}
diff --git a/tests/functional/mcp_test.php b/tests/functional/mcp_test.php
index e4d950ef34..40615d66a5 100644
--- a/tests/functional/mcp_test.php
+++ b/tests/functional/mcp_test.php
@@ -35,11 +35,7 @@ class phpbb_functional_mcp_test extends phpbb_functional_test_case
public function test_handle_quickmod($crawler)
{
// Test moving a post
- $form = $crawler->selectButton('Go')->eq(1)->form();
- $form['action']->select('merge');
- $crawler = self::submit($form);
-
- return $crawler;
+ return $this->get_quickmod_page(0, 'MERGE_POSTS', $crawler);
}
/**
@@ -68,4 +64,20 @@ class phpbb_functional_mcp_test extends phpbb_functional_test_case
$crawler = self::submit($form);
$this->assertContains($this->lang('POSTS_MERGED_SUCCESS'), $crawler->text());
}
+
+ public function test_delete_logs()
+ {
+ $this->login();
+ $crawler = self::request('GET', "mcp.php?i=mcp_logs&mode=front&sid={$this->sid}");
+ $this->assertGreaterThanOrEqual(1, $crawler->filter('input[type=checkbox]')->count());
+
+ $this->add_lang('mcp');
+ $form = $crawler->selectButton($this->lang('DELETE_ALL'))->form();
+ $crawler = self::submit($form);
+
+ $form = $crawler->selectButton('Yes')->form();
+ $crawler = self::submit($form);
+
+ $this->assertCount(0, $crawler->filter('input[type=checkbox]'));
+ }
}
diff --git a/tests/functional/visibility_softdelete_test.php b/tests/functional/visibility_softdelete_test.php
index 5b5f09905c..794f0cde68 100644
--- a/tests/functional/visibility_softdelete_test.php
+++ b/tests/functional/visibility_softdelete_test.php
@@ -186,11 +186,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
'forum_last_post_id' => 0,
), 'before moving #2');
- $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
-
- $form = $crawler->selectButton('Go')->eq(2)->form();
- $form['action']->select('move');
- $crawler = self::submit($form);
+ $crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #1'], 'MOVE_TOPIC');
$this->assertContainsLang('SELECT_DESTINATION_FORUM', $crawler->text());
$this->add_lang('mcp');
@@ -261,12 +257,8 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
'forum_last_post_id' => $this->data['posts']['Soft Delete Topic #1'],
), 'before softdeleting #2');
- $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
-
$this->add_lang('posting');
- $form = $crawler->selectButton('Go')->eq(2)->form();
- $form['action']->select('delete_topic');
- $crawler = self::submit($form);
+ $crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #1'], 'DELETE_TOPIC');
$this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text());
$this->add_lang('mcp');
@@ -336,11 +328,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
'forum_last_post_id' => 0,
), 'before moving #2');
- $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
-
- $form = $crawler->selectButton('Go')->eq(2)->form();
- $form['action']->select('move');
- $crawler = self::submit($form);
+ $crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #1'], 'MOVE_TOPIC');
$this->assertContainsLang('SELECT_DESTINATION_FORUM', $crawler->text());
$this->add_lang('mcp');
@@ -484,12 +472,9 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
'forum_last_post_id' => 0,
), 'before splitting #2');
- $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
+ $crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #1'], 'SPLIT_TOPIC');
$this->add_lang('mcp');
- $form = $crawler->selectButton('Go')->eq(2)->form();
- $form['action']->select('split');
- $crawler = self::submit($form);
$this->assertContainsLang('SPLIT_TOPIC_EXPLAIN', $crawler->text());
$form = $crawler->selectButton('Submit')->form(array(
@@ -546,12 +531,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
),
));
- $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #2']}&sid={$this->sid}");
-
- $form = $crawler->selectButton('Go')->eq(1)->form();
- $form['action']->select('move');
- $crawler = self::submit($form);
-
+ $crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #2'], 'MOVE_TOPIC');
$form = $crawler->selectButton('Yes')->form();
$form['to_forum_id']->select($this->data['forums']['Soft Delete #1']);
$crawler = self::submit($form);
@@ -605,9 +585,7 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
$this->assertContainsLang('BOOKMARK_ADDED', $crawler_bookmark->text());
$this->add_lang('mcp');
- $form = $crawler->selectButton('Go')->eq(1)->form();
- $form['action']->select('merge_topic');
- $crawler = self::submit($form);
+ $crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #2'], 'MERGE_TOPIC', $crawler);
$this->assertContainsLang('SELECT_MERGE', $crawler->text());
$crawler = self::request('GET', "mcp.php?f={$this->data['forums']['Soft Delete #1']}&t={$this->data['topics']['Soft Delete Topic #2']}&i=main&mode=forum_view&action=merge_topic&to_topic_id={$this->data['topics']['Soft Delete Topic #1']}");
@@ -670,12 +648,8 @@ class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_
'forum_last_post_id' => 0,
), 'before forking #2');
- $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Soft Delete Topic #1']}&sid={$this->sid}");
-
$this->add_lang('mcp');
- $form = $crawler->selectButton('Go')->eq(2)->form();
- $form['action']->select('fork');
- $crawler = self::submit($form);
+ $crawler = $this->get_quickmod_page($this->data['topics']['Soft Delete Topic #1'], 'FORK_TOPIC');
$this->assertContainsLang('FORK_TOPIC', $crawler->text());
$form = $crawler->selectButton('Yes')->form();
diff --git a/tests/functions/build_url_test.php b/tests/functions/build_url_test.php
index 7a70bddc71..06415a424e 100644
--- a/tests/functions/build_url_test.php
+++ b/tests/functions/build_url_test.php
@@ -30,10 +30,11 @@ class phpbb_build_url_test extends phpbb_test_case
new phpbb_mock_request()
),
new \phpbb\filesystem(),
+ $this->getMock('\phpbb\request\request'),
$phpbb_root_path,
'php'
);
- $phpbb_container->set('path_helper', $path_helper);
+ $phpbb_container->set('path_helper', $phpbb_path_helper);
}
public function build_url_test_data()
{
diff --git a/tests/functions/convert_30_dbms_to_31_test.php b/tests/functions/convert_30_dbms_to_31_test.php
index a3992aef5c..729c0a82f0 100644
--- a/tests/functions/convert_30_dbms_to_31_test.php
+++ b/tests/functions/convert_30_dbms_to_31_test.php
@@ -36,7 +36,8 @@ class phpbb_convert_30_dbms_to_31_test extends phpbb_test_case
{
$expected = "phpbb\\db\\driver\\$input";
- $output = phpbb_convert_30_dbms_to_31($input);
+ $config_php_file = new \phpbb\config_php_file('', '');
+ $output = $config_php_file->convert_30_dbms_to_31($input);
$this->assertEquals($expected, $output);
}
diff --git a/tests/functions/obtain_online_test.php b/tests/functions/obtain_online_test.php
index 830b52fb4c..e793a4eb82 100644
--- a/tests/functions/obtain_online_test.php
+++ b/tests/functions/obtain_online_test.php
@@ -128,19 +128,19 @@ class phpbb_functions_obtain_online_test extends phpbb_database_test_case
{
return array(
array(0, false, array(
- 'online_userlist' => 'REGISTERED_USERS 2, 3',
+ 'online_userlist' => 'REGISTERED_USERS <span class="username">2</span>, <span class="username">3</span>',
'l_online_users' => 'ONLINE_USERS_TOTAL 5 REG_USERS_TOTAL 2 HIDDEN_USERS_TOTAL 3',
)),
array(0, true, array(
- 'online_userlist' => 'REGISTERED_USERS 2, 3',
+ 'online_userlist' => 'REGISTERED_USERS <span class="username">2</span>, <span class="username">3</span>',
'l_online_users' => 'ONLINE_USERS_TOTAL_GUESTS 7 REG_USERS_TOTAL 2 HIDDEN_USERS_TOTAL 3 GUEST_USERS_TOTAL 2',
)),
array(1, false, array(
- 'online_userlist' => 'BROWSING_FORUM 3',
+ 'online_userlist' => 'BROWSING_FORUM <span class="username">3</span>',
'l_online_users' => 'ONLINE_USERS_TOTAL 2 REG_USERS_TOTAL 1 HIDDEN_USERS_TOTAL 1',
)),
array(1, true, array(
- 'online_userlist' => 'BROWSING_FORUM_GUESTS 1 3',
+ 'online_userlist' => 'BROWSING_FORUM_GUESTS 1 <span class="username">3</span>',
'l_online_users' => 'ONLINE_USERS_TOTAL_GUESTS 3 REG_USERS_TOTAL 1 HIDDEN_USERS_TOTAL 1 GUEST_USERS_TOTAL 1',
)),
array(2, false, array(
diff --git a/tests/functions_content/get_username_string_test.php b/tests/functions_content/get_username_string_test.php
index 502796d1df..01ec97f6a4 100644
--- a/tests/functions_content/get_username_string_test.php
+++ b/tests/functions_content/get_username_string_test.php
@@ -94,11 +94,11 @@ class phpbb_functions_content_get_username_string_test extends phpbb_test_case
global $phpbb_root_path, $phpEx;
return array(
- array(0, '', '', false, false, 'Guest'),
- array(ANONYMOUS, 'Anonymous', '', false, false, 'Anonymous'),
+ array(0, '', '', false, false, '<span class="username">Guest</span>'),
+ array(ANONYMOUS, 'Anonymous', '', false, false, '<span class="username">Anonymous</span>'),
array(2, 'Administrator', 'FF0000', false, false, '<a href="' . $phpbb_root_path . 'memberlist.' . $phpEx . '?mode=viewprofile&amp;u=2" style="color: #FF0000;" class="username-coloured">Administrator</a>'),
- array(5, 'User5', '', false, 'http://www.example.org/user.php?mode=show', '<a href="http://www.example.org/user.php?mode=show&amp;u=5">User5</a>'),
- array(8, 'Eight', '', false, false, '<a href="' . $phpbb_root_path . 'memberlist.php?mode=viewprofile&amp;u=8">Eight</a>'),
+ array(5, 'User5', '', false, 'http://www.example.org/user.php?mode=show', '<a href="http://www.example.org/user.php?mode=show&amp;u=5" class="username">User5</a>'),
+ array(8, 'Eight', '', false, false, '<a href="' . $phpbb_root_path . 'memberlist.php?mode=viewprofile&amp;u=8" class="username">Eight</a>'),
);
}
@@ -113,10 +113,10 @@ class phpbb_functions_content_get_username_string_test extends phpbb_test_case
public function get_username_string_no_profile_data()
{
return array(
- array(ANONYMOUS, 'Anonymous', '', false, false, 'Anonymous'),
- array(ANONYMOUS, 'Anonymous', '', '', false, 'Guest'),
+ array(ANONYMOUS, 'Anonymous', '', false, false, '<span class="username">Anonymous</span>'),
+ array(ANONYMOUS, 'Anonymous', '', '', false, '<span class="username">Guest</span>'),
array(2, 'Administrator', 'FF0000', false, false, '<span style="color: #FF0000;" class="username-coloured">Administrator</span>'),
- array(8, 'Eight', '', false, false, 'Eight'),
+ array(8, 'Eight', '', false, false, '<span class="username">Eight</span>'),
);
}
diff --git a/tests/log/function_view_log_test.php b/tests/log/function_view_log_test.php
index b7e60c7393..02e0b3912f 100644
--- a/tests/log/function_view_log_test.php
+++ b/tests/log/function_view_log_test.php
@@ -40,7 +40,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
'user_id' => 1,
'username' => 'Anonymous',
- 'username_full' => 'Anonymous',
+ 'username_full' => '<span class="username">Anonymous</span>',
'ip' => '127.0.0.1',
'time' => 1,
@@ -59,7 +59,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
'user_id' => 1,
'username' => 'Anonymous',
- 'username_full' => 'Anonymous',
+ 'username_full' => '<span class="username">Anonymous</span>',
'ip' => '127.0.0.1',
'time' => 1,
@@ -78,7 +78,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
'user_id' => 1,
'username' => 'Anonymous',
- 'username_full' => 'Anonymous',
+ 'username_full' => '<span class="username">Anonymous</span>',
'ip' => '127.0.0.1',
'time' => 1,
@@ -97,7 +97,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
'user_id' => 1,
'username' => 'Anonymous',
- 'username_full' => 'Anonymous',
+ 'username_full' => '<span class="username">Anonymous</span>',
'ip' => '127.0.0.1',
'time' => 1,
@@ -118,7 +118,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
'user_id' => 1,
'username' => 'Anonymous',
- 'username_full' => 'Anonymous',
+ 'username_full' => '<span class="username">Anonymous</span>',
'ip' => '127.0.0.1',
'time' => 1,
@@ -139,7 +139,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
'user_id' => 1,
'username' => 'Anonymous',
- 'username_full' => 'Anonymous',
+ 'username_full' => '<span class="username">Anonymous</span>',
'ip' => '127.0.0.1',
'time' => 1,
@@ -160,7 +160,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
'user_id' => 1,
'username' => 'Anonymous',
- 'username_full' => 'Anonymous',
+ 'username_full' => '<span class="username">Anonymous</span>',
'ip' => '127.0.0.1',
'time' => 1,
@@ -177,11 +177,11 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
'reportee_id' => 2,
'reportee_username' => 'admin',
- 'reportee_username_full'=> 'admin',
+ 'reportee_username_full'=> '<span class="username">admin</span>',
'user_id' => 1,
'username' => 'Anonymous',
- 'username_full' => 'Anonymous',
+ 'username_full' => '<span class="username">Anonymous</span>',
'ip' => '127.0.0.1',
'time' => 1,
@@ -196,11 +196,11 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
'reportee_id' => 1,
'reportee_username' => 'Anonymous',
- 'reportee_username_full'=> 'Anonymous',
+ 'reportee_username_full'=> '<span class="username">Anonymous</span>',
'user_id' => 1,
'username' => 'Anonymous',
- 'username_full' => 'Anonymous',
+ 'username_full' => '<span class="username">Anonymous</span>',
'ip' => '127.0.0.1',
'time' => 1,
@@ -219,7 +219,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
'user_id' => 1,
'username' => 'Anonymous',
- 'username_full' => 'Anonymous',
+ 'username_full' => '<span class="username">Anonymous</span>',
'ip' => '127.0.0.1',
'time' => 1,
@@ -238,7 +238,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
'user_id' => 1,
'username' => 'Anonymous',
- 'username_full' => 'Anonymous',
+ 'username_full' => '<span class="username">Anonymous</span>',
'ip' => '127.0.0.1',
'time' => 1,
diff --git a/tests/mock/controller_helper.php b/tests/mock/controller_helper.php
index 9f70f8e96c..f9d231258e 100644
--- a/tests/mock/controller_helper.php
+++ b/tests/mock/controller_helper.php
@@ -23,4 +23,9 @@ class phpbb_mock_controller_helper extends \phpbb\controller\helper
$provider->find_routing_files($manager->get_finder());
$this->route_collection = $provider->find($phpbb_root_path_ext)->get_routes();
}
+
+ public function get_current_url()
+ {
+ return '';
+ }
}
diff --git a/tests/mock/phpbb_di_container_builder.php b/tests/mock/phpbb_di_container_builder.php
new file mode 100644
index 0000000000..59cdf0bb2b
--- /dev/null
+++ b/tests/mock/phpbb_di_container_builder.php
@@ -0,0 +1,20 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_mock_phpbb_di_container_builder extends \phpbb\di\container_builder
+{
+ protected function get_container_filename()
+ {
+ return $this->phpbb_root_path . '../../tmp/container.' . $this->php_ext;
+ }
+}
diff --git a/tests/notification/user_list_trim_test.php b/tests/notification/user_list_trim_test.php
index 85d8961e82..851c9ec221 100644
--- a/tests/notification/user_list_trim_test.php
+++ b/tests/notification/user_list_trim_test.php
@@ -86,7 +86,7 @@ class phpbb_notification_user_list_trim_test extends phpbb_database_test_case
array('username' => '', 'poster_id' => 3),
),
),
- '<strong>Reply</strong> from A and B in topic:',
+ '<strong>Reply</strong> from A and <span class="username">B</span> in topic:',
),
array(
array(
@@ -98,7 +98,7 @@ class phpbb_notification_user_list_trim_test extends phpbb_database_test_case
array('username' => '', 'poster_id' => 4),
),
),
- '<strong>Reply</strong> from A, B, and C in topic:',
+ '<strong>Reply</strong> from A, <span class="username">B</span>, and <span class="username">C</span> in topic:',
),
array(
array(
@@ -111,7 +111,7 @@ class phpbb_notification_user_list_trim_test extends phpbb_database_test_case
array('username' => '', 'poster_id' => 5),
),
),
- '<strong>Reply</strong> from A, B, C, and D in topic:',
+ '<strong>Reply</strong> from A, <span class="username">B</span>, <span class="username">C</span>, and <span class="username">D</span> in topic:',
),
array(
array(
@@ -125,7 +125,7 @@ class phpbb_notification_user_list_trim_test extends phpbb_database_test_case
array('username' => '', 'poster_id' => 6),
),
),
- '<strong>Reply</strong> from A, B, C, and 2 others in topic:',
+ '<strong>Reply</strong> from A, <span class="username">B</span>, <span class="username">C</span>, and 2 others in topic:',
),
);
}
diff --git a/tests/path_helper/path_helper_test.php b/tests/path_helper/path_helper_test.php
index a3ad901379..27e94d6a07 100644
--- a/tests/path_helper/path_helper_test.php
+++ b/tests/path_helper/path_helper_test.php
@@ -13,6 +13,7 @@
class phpbb_path_helper_test extends phpbb_test_case
{
+ /** @var \phpbb\path_helper */
protected $path_helper;
protected $phpbb_root_path = '';
@@ -20,13 +21,15 @@ class phpbb_path_helper_test extends phpbb_test_case
{
parent::setUp();
- $this->set_phpbb_root_path();
+ $filesystem = new \phpbb\filesystem();
+ $this->set_phpbb_root_path($filesystem);
$this->path_helper = new \phpbb\path_helper(
new \phpbb\symfony_request(
new phpbb_mock_request()
),
new \phpbb\filesystem(),
+ $this->getMock('\phpbb\request\request'),
$this->phpbb_root_path,
'php'
);
@@ -40,9 +43,9 @@ class phpbb_path_helper_test extends phpbb_test_case
* any time we wish to use it in one of these functions (and
* also in general for everything else)
*/
- public function set_phpbb_root_path()
+ public function set_phpbb_root_path($filesystem)
{
- $this->phpbb_root_path = dirname(__FILE__) . './../../phpBB/';
+ $this->phpbb_root_path = $filesystem->clean_path(dirname(__FILE__) . '/../../phpBB/');
}
public function test_get_web_root_path()
@@ -53,7 +56,8 @@ class phpbb_path_helper_test extends phpbb_test_case
public function basic_update_web_root_path_data()
{
- $this->set_phpbb_root_path();
+ $filesystem = new \phpbb\filesystem();
+ $this->set_phpbb_root_path($filesystem);
return array(
array(
@@ -71,7 +75,7 @@ class phpbb_path_helper_test extends phpbb_test_case
),
array(
$this->phpbb_root_path . $this->phpbb_root_path . 'test.php',
- $this->phpbb_root_path . $this->phpbb_root_path . 'test.php',
+ $filesystem->clean_path($this->phpbb_root_path . $this->phpbb_root_path . 'test.php'),
),
);
}
@@ -81,51 +85,55 @@ class phpbb_path_helper_test extends phpbb_test_case
*/
public function test_basic_update_web_root_path($input, $expected)
{
- $this->assertEquals($expected, $this->path_helper->update_web_root_path($input, $symfony_request));
+ $this->assertEquals($expected, $this->path_helper->update_web_root_path($input));
}
public function update_web_root_path_data()
{
- $this->set_phpbb_root_path();
+ $this->set_phpbb_root_path(new \phpbb\filesystem());
return array(
array(
$this->phpbb_root_path . 'test.php',
- $this->phpbb_root_path . 'test.php',
'/',
+ null,
+ null,
+ '',
),
array(
$this->phpbb_root_path . 'test.php',
- $this->phpbb_root_path . '../test.php',
'//',
+ null,
+ null,
+ './../',
),
array(
$this->phpbb_root_path . 'test.php',
- $this->phpbb_root_path . '../test.php',
'//',
'foo/bar.php',
'bar.php',
+ './../',
),
array(
$this->phpbb_root_path . 'test.php',
- $this->phpbb_root_path . '../../test.php',
'/foo/template',
'/phpbb3-fork/phpBB/app.php/foo/template',
'/phpbb3-fork/phpBB/app.php',
+ './../../',
),
array(
$this->phpbb_root_path . 'test.php',
- $this->phpbb_root_path . '../test.php',
'/foo/template',
'/phpbb3-fork/phpBB/foo/template',
'/phpbb3-fork/phpBB/app.php',
+ './../',
),
array(
$this->phpbb_root_path . 'test.php',
- $this->phpbb_root_path . '../test.php',
'/',
'/phpbb3-fork/phpBB/app.php/',
'/phpbb3-fork/phpBB/app.php',
+ './../',
),
);
}
@@ -133,9 +141,9 @@ class phpbb_path_helper_test extends phpbb_test_case
/**
* @dataProvider update_web_root_path_data
*/
- public function test_update_web_root_path($input, $expected, $getPathInfo, $getRequestUri = null, $getScriptName = null)
+ public function test_update_web_root_path($input, $getPathInfo, $getRequestUri, $getScriptName, $correction)
{
- $symfony_request = $this->getMock("\phpbb\symfony_request", array(), array(
+ $symfony_request = $this->getMock('\phpbb\symfony_request', array(), array(
new phpbb_mock_request(),
));
$symfony_request->expects($this->any())
@@ -151,11 +159,12 @@ class phpbb_path_helper_test extends phpbb_test_case
$path_helper = new \phpbb\path_helper(
$symfony_request,
new \phpbb\filesystem(),
+ $this->getMock('\phpbb\request\request'),
$this->phpbb_root_path,
'php'
);
- $this->assertEquals($expected, $path_helper->update_web_root_path($input, $symfony_request));
+ $this->assertEquals($correction . $input, $path_helper->update_web_root_path($input, $symfony_request));
}
public function clean_url_data()
@@ -331,4 +340,58 @@ class phpbb_path_helper_test extends phpbb_test_case
{
$this->assertEquals($expected, $this->path_helper->append_url_params($url, $params, $is_amp));
}
+
+ public function get_web_root_path_from_ajax_referer_data()
+ {
+ return array(
+ array(
+ 'http://www.phpbb.com/community/route1/route2/',
+ 'http://www.phpbb.com/community',
+ '../../',
+ ),
+ array(
+ 'http://www.phpbb.com/community/route1/route2',
+ 'http://www.phpbb.com/community',
+ '../',
+ ),
+ array(
+ 'http://www.phpbb.com/community/route1',
+ 'http://www.phpbb.com/community',
+ '',
+ ),
+ array(
+ 'http://www.phpbb.com/community/',
+ 'http://www.phpbb.com/community',
+ '',
+ ),
+ array(
+ 'http://www.phpbb.com/notcommunity/route1/route2/',
+ 'http://www.phpbb.com/community',
+ '../../../community/',
+ ),
+ array(
+ 'http://www.phpbb.com/notcommunity/route1/route2',
+ 'http://www.phpbb.com/community',
+ '../../community/',
+ ),
+ array(
+ 'http://www.phpbb.com/notcommunity/route1',
+ 'http://www.phpbb.com/community',
+ '../community/',
+ ),
+ array(
+ 'http://www.phpbb.com/notcommunity/',
+ 'http://www.phpbb.com/community',
+ '../community/',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider get_web_root_path_from_ajax_referer_data
+ */
+ public function test_get_web_root_path_from_ajax_referer($referer_url, $board_url, $expected)
+ {
+ $this->assertEquals($this->phpbb_root_path . $expected, $this->path_helper->get_web_root_path_from_ajax_referer($referer_url, $board_url));
+ }
}
diff --git a/tests/profilefields/type_bool_test.php b/tests/profilefields/type_bool_test.php
index 29c118d57d..bdab179c8c 100644
--- a/tests/profilefields/type_bool_test.php
+++ b/tests/profilefields/type_bool_test.php
@@ -74,10 +74,10 @@ class phpbb_profilefield_type_bool_test extends phpbb_test_case
{
return array(
array(
- false,
- array('field_required' => true),
- 'FIELD_REQUIRED-field',
- 'Field should not accept empty values for required fields',
+ false,
+ array('field_required' => true),
+ 'FIELD_REQUIRED-field',
+ 'Field should not accept empty values for required fields',
),
);
}
@@ -130,6 +130,54 @@ class phpbb_profilefield_type_bool_test extends phpbb_test_case
$this->assertSame($expected, $result, $description);
}
+ public function profile_value_raw_data()
+ {
+ return array(
+ array(
+ '4',
+ array('field_show_novalue' => true),
+ '4',
+ 'Field should return the correct raw value',
+ ),
+ array(
+ '',
+ array('field_show_novalue' => false),
+ null,
+ 'Field should return correct raw value',
+ ),
+ array(
+ '',
+ array('field_show_novalue' => true),
+ null,
+ 'Field should return correct raw value',
+ ),
+ array(
+ null,
+ array('field_show_novalue' => false),
+ null,
+ 'Field should return correct raw value',
+ ),
+ array(
+ null,
+ array('field_show_novalue' => true),
+ null,
+ 'Field should return correct raw value',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider profile_value_raw_data
+ */
+ public function test_get_profile_value_raw($value, $field_options, $expected, $description)
+ {
+ $field_options = array_merge($this->field_options, $field_options);
+
+ $result = $this->cp->get_profile_value_raw($value, $field_options);
+
+ $this->assertSame($expected, $result, $description);
+ }
+
public function is_set_callback($field_id, $lang_id, $field_value)
{
return isset($this->options[$field_value]);
diff --git a/tests/profilefields/type_date_test.php b/tests/profilefields/type_date_test.php
index 39fe95b97f..0ad2cde9fe 100644
--- a/tests/profilefields/type_date_test.php
+++ b/tests/profilefields/type_date_test.php
@@ -179,6 +179,42 @@ class phpbb_profilefield_type_date_test extends phpbb_test_case
$this->assertSame($expected, $result, $description);
}
+ public function profile_value_raw_data()
+ {
+ return array(
+ array(
+ '',
+ array('field_show_novalue' => false),
+ null,
+ 'Field should return the correct raw value',
+ ),
+ array(
+ '',
+ array('field_show_novalue' => true),
+ '',
+ 'Field should return correct raw value',
+ ),
+ array(
+ '12/06/2014',
+ array('field_show_novalue' => true),
+ '12/06/2014',
+ 'Field should return correct raw value',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider profile_value_raw_data
+ */
+ public function test_get_profile_value_raw($value, $field_options, $expected, $description)
+ {
+ $field_options = array_merge($this->field_options, $field_options);
+
+ $result = $this->cp->get_profile_value_raw($value, $field_options);
+
+ $this->assertSame($expected, $result, $description);
+ }
+
public function return_callback_implode()
{
return implode('-', func_get_args());
diff --git a/tests/profilefields/type_dropdown_test.php b/tests/profilefields/type_dropdown_test.php
index 0e92afd504..ebecbf97f0 100644
--- a/tests/profilefields/type_dropdown_test.php
+++ b/tests/profilefields/type_dropdown_test.php
@@ -170,6 +170,54 @@ class phpbb_profilefield_type_dropdown_test extends phpbb_test_case
$this->assertSame($expected, $result, $description);
}
+ public function profile_value_raw_data()
+ {
+ return array(
+ array(
+ '4',
+ array('field_show_novalue' => true),
+ '4',
+ 'Field should return the correct raw value',
+ ),
+ array(
+ '',
+ array('field_show_novalue' => false),
+ null,
+ 'Field should null for empty value without show_novalue',
+ ),
+ array(
+ '',
+ array('field_show_novalue' => true),
+ 0,
+ 'Field should return 0 for empty value with show_novalue',
+ ),
+ array(
+ null,
+ array('field_show_novalue' => false),
+ null,
+ 'Field should return correct raw value',
+ ),
+ array(
+ null,
+ array('field_show_novalue' => true),
+ 0,
+ 'Field should return 0 for empty value with show_novalue',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider profile_value_raw_data
+ */
+ public function test_get_profile_value_raw($value, $field_options, $expected, $description)
+ {
+ $field_options = array_merge($this->field_options, $field_options);
+
+ $result = $this->cp->get_profile_value_raw($value, $field_options);
+
+ $this->assertSame($expected, $result, $description);
+ }
+
public function is_set_callback($field_id, $lang_id, $field_value)
{
return isset($this->dropdown_options[$field_value]);
diff --git a/tests/profilefields/type_int_test.php b/tests/profilefields/type_int_test.php
index 611edd32b9..ac48c10a84 100644
--- a/tests/profilefields/type_int_test.php
+++ b/tests/profilefields/type_int_test.php
@@ -169,6 +169,66 @@ class phpbb_profilefield_type_int_test extends phpbb_test_case
$this->assertSame($expected, $result, $description);
}
+ public function profile_value_raw_data()
+ {
+ return array(
+ array(
+ '10',
+ array('field_show_novalue' => true),
+ 10,
+ 'Field should return the correct raw value',
+ ),
+ array(
+ '0',
+ array('field_show_novalue' => true),
+ 0,
+ 'Field should return correct raw value',
+ ),
+ array(
+ '',
+ array('field_show_novalue' => true),
+ 0,
+ 'Field should return correct raw value',
+ ),
+ array(
+ '10',
+ array('field_show_novalue' => false),
+ 10,
+ 'Field should return the correct raw value',
+ ),
+ array(
+ '0',
+ array('field_show_novalue' => false),
+ 0,
+ 'Field should return correct raw value',
+ ),
+ array(
+ '',
+ array('field_show_novalue' => false),
+ null,
+ 'Field should return correct raw value',
+ ),
+ array(
+ 'string',
+ array('field_show_novalue' => false),
+ 0,
+ 'Field should return int cast of passed string'
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider profile_value_raw_data
+ */
+ public function test_get_profile_value_raw($value, $field_options, $expected, $description)
+ {
+ $field_options = array_merge($this->field_options, $field_options);
+
+ $result = $this->cp->get_profile_value_raw($value, $field_options);
+
+ $this->assertSame($expected, $result, $description);
+ }
+
public function return_callback_implode()
{
return implode('-', func_get_args());
diff --git a/tests/profilefields/type_string_test.php b/tests/profilefields/type_string_test.php
index cee8a1d863..f6c14ee38b 100644
--- a/tests/profilefields/type_string_test.php
+++ b/tests/profilefields/type_string_test.php
@@ -225,6 +225,60 @@ class phpbb_profilefield_type_string_test extends phpbb_test_case
$this->assertSame($expected, $result, $description);
}
+ public function profile_value_raw_data()
+ {
+ return array(
+ array(
+ '[b]bbcode test[/b]',
+ array('field_show_novalue' => true),
+ '[b]bbcode test[/b]',
+ 'Field should return the correct raw value',
+ ),
+ array(
+ '[b]bbcode test[/b]',
+ array('field_show_novalue' => false),
+ '[b]bbcode test[/b]',
+ 'Field should return correct raw value',
+ ),
+ array(
+ 125,
+ array('field_show_novalue' => false),
+ 125,
+ 'Field should return value of integer as is',
+ ),
+ array(
+ 0,
+ array('field_show_novalue' => false),
+ null,
+ 'Field should return null for empty integer without show_novalue',
+ ),
+ array(
+ 0,
+ array('field_show_novalue' => true),
+ 0,
+ 'Field should return 0 for empty integer with show_novalue',
+ ),
+ array(
+ null,
+ array('field_show_novalue' => true),
+ null,
+ 'field should return null value as is',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider profile_value_raw_data
+ */
+ public function test_get_profile_value_raw($value, $field_options, $expected, $description)
+ {
+ $field_options = array_merge($this->field_options, $field_options);
+
+ $result = $this->cp->get_profile_value_raw($value, $field_options);
+
+ $this->assertSame($expected, $result, $description);
+ }
+
public function return_callback_implode()
{
return implode('-', func_get_args());
diff --git a/tests/profilefields/type_url_test.php b/tests/profilefields/type_url_test.php
index 9957510d90..a45a28e7c7 100644
--- a/tests/profilefields/type_url_test.php
+++ b/tests/profilefields/type_url_test.php
@@ -104,6 +104,36 @@ class phpbb_profilefield_type_url_test extends phpbb_test_case
$this->assertSame($expected, $result, $description);
}
+ public function profile_value_raw_data()
+ {
+ return array(
+ array(
+ 'http://example.com',
+ array('field_show_novalue' => true),
+ 'http://example.com',
+ 'Field should return the correct raw value',
+ ),
+ array(
+ 'http://example.com',
+ array('field_show_novalue' => false),
+ 'http://example.com',
+ 'Field should return correct raw value',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider profile_value_raw_data
+ */
+ public function test_get_profile_value_raw($value, $field_options, $expected, $description)
+ {
+ $field_options = array_merge($this->field_options, $field_options);
+
+ $result = $this->cp->get_profile_value_raw($value, $field_options);
+
+ $this->assertSame($expected, $result, $description);
+ }
+
public function return_callback_implode()
{
return implode('-', func_get_args());
diff --git a/tests/security/redirect_test.php b/tests/security/redirect_test.php
index fb1011cde0..3961c2781e 100644
--- a/tests/security/redirect_test.php
+++ b/tests/security/redirect_test.php
@@ -63,6 +63,7 @@ class phpbb_security_redirect_test extends phpbb_security_test_base
new phpbb_mock_request()
),
new \phpbb\filesystem(),
+ $this->getMock('\phpbb\request\request'),
$this->phpbb_root_path,
'php'
);
diff --git a/tests/template/template_events_test.php b/tests/template/template_events_test.php
index ce3c90b78a..c415c969fe 100644
--- a/tests/template/template_events_test.php
+++ b/tests/template/template_events_test.php
@@ -143,6 +143,7 @@ Zeta test event in all',
new phpbb_mock_request()
),
new \phpbb\filesystem(),
+ $this->getMock('\phpbb\request\request'),
$phpbb_root_path,
$phpEx
);
diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index 4f5b7629d5..0bbfe3848d 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -352,6 +352,13 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array(),
"13FOOBAR|foobar",
),
+ array(
+ 'if_nested_tags.html',
+ array('S_VALUE' => true,),
+ array(),
+ array(),
+ 'inner_value',
+ ),
);
}
diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php
index 00b823b2c4..83446b5352 100644
--- a/tests/template/template_test_case.php
+++ b/tests/template/template_test_case.php
@@ -72,6 +72,7 @@ class phpbb_template_template_test_case extends phpbb_test_case
new phpbb_mock_request()
),
new \phpbb\filesystem(),
+ $this->getMock('\phpbb\request\request'),
$phpbb_root_path,
$phpEx
);
diff --git a/tests/template/template_test_case_with_tree.php b/tests/template/template_test_case_with_tree.php
index 4f778a9c1c..68ecc4b706 100644
--- a/tests/template/template_test_case_with_tree.php
+++ b/tests/template/template_test_case_with_tree.php
@@ -27,6 +27,7 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat
new phpbb_mock_request()
),
new \phpbb\filesystem(),
+ $this->getMock('\phpbb\request\request'),
$phpbb_root_path,
$phpEx
);
diff --git a/tests/template/templates/if_nested_tags.html b/tests/template/templates/if_nested_tags.html
new file mode 100644
index 0000000000..0348a31a8d
--- /dev/null
+++ b/tests/template/templates/if_nested_tags.html
@@ -0,0 +1 @@
+<!-- IF S_VALUE --><!-- DEFINE $INNER_VALUE = 'inner_value' --><!-- ENDIF -->{$INNER_VALUE}
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index eef30fbcc7..07ef826abf 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -971,12 +971,8 @@ class phpbb_functional_test_case extends phpbb_mink_test_case
*/
public function delete_topic($topic_id)
{
- $crawler = self::request('GET', "viewtopic.php?t={$topic_id}&sid={$this->sid}");
-
$this->add_lang('posting');
- $form = $crawler->selectButton('Go')->eq(1)->form();
- $form['action']->select('delete_topic');
- $crawler = self::submit($form);
+ $crawler = $this->get_quickmod_page($topic_id, 'DELETE_TOPIC');
$this->assertContainsLang('DELETE_PERMANENTLY', $crawler->text());
$this->add_lang('mcp');
@@ -1067,4 +1063,25 @@ class phpbb_functional_test_case extends phpbb_mink_test_case
return $manager;
}
+
+ /**
+ * Get quickmod page
+ *
+ * @param int $topic_id
+ * @param string $action Language key for the quickmod action
+ * @param Symfony\Component\DomCrawler\Crawler Optional crawler object to use instead of creating new one.
+ * @return Symfony\Component\DomCrawler\Crawler
+ */
+ public function get_quickmod_page($topic_id, $action, $crawler = false)
+ {
+ $this->add_lang('viewtopic');
+
+ if ($crawler === false)
+ {
+ $crawler = self::request('GET', "viewtopic.php?t={$topic_id}&sid={$this->sid}");
+ }
+ $link = $crawler->filter('#quickmod')->selectLink($this->lang($action))->link()->getUri();
+
+ return self::request('GET', substr($link, strpos($link, 'mcp.')));
+ }
}
diff --git a/tests/test_framework/phpbb_session_test_case.php b/tests/test_framework/phpbb_session_test_case.php
index 8a5d582573..d4fc174a12 100644
--- a/tests/test_framework/phpbb_session_test_case.php
+++ b/tests/test_framework/phpbb_session_test_case.php
@@ -32,6 +32,7 @@ abstract class phpbb_session_test_case extends phpbb_database_test_case
$phpbb_path_helper = new \phpbb\path_helper(
$symfony_request,
$phpbb_filesystem,
+ $this->getMock('\phpbb\request\request'),
$phpbb_root_path,
$phpEx
);
diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php
index a29b6e1955..dee70ad016 100644
--- a/tests/test_framework/phpbb_test_case_helpers.php
+++ b/tests/test_framework/phpbb_test_case_helpers.php
@@ -142,17 +142,15 @@ class phpbb_test_case_helpers
$test_config = dirname(__FILE__) . '/../test_config.php';
}
+ $config_php_file = new \phpbb\config_php_file('', '');
+
if (file_exists($test_config))
{
- include($test_config);
-
- if (!function_exists('phpbb_convert_30_dbms_to_31'))
- {
- require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
- }
+ $config_php_file->set_config_file($test_config);
+ extract($config_php_file->get_all());
$config = array_merge($config, array(
- 'dbms' => phpbb_convert_30_dbms_to_31($dbms),
+ 'dbms' => $config_php_file->convert_30_dbms_to_31($dbms),
'dbhost' => $dbhost,
'dbport' => $dbport,
'dbname' => $dbname,
@@ -183,13 +181,8 @@ class phpbb_test_case_helpers
if (isset($_SERVER['PHPBB_TEST_DBMS']))
{
- if (!function_exists('phpbb_convert_30_dbms_to_31'))
- {
- require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
- }
-
$config = array_merge($config, array(
- 'dbms' => isset($_SERVER['PHPBB_TEST_DBMS']) ? phpbb_convert_30_dbms_to_31($_SERVER['PHPBB_TEST_DBMS']) : '',
+ 'dbms' => isset($_SERVER['PHPBB_TEST_DBMS']) ? $config_php_file->convert_30_dbms_to_31($_SERVER['PHPBB_TEST_DBMS']) : '',
'dbhost' => isset($_SERVER['PHPBB_TEST_DBHOST']) ? $_SERVER['PHPBB_TEST_DBHOST'] : '',
'dbport' => isset($_SERVER['PHPBB_TEST_DBPORT']) ? $_SERVER['PHPBB_TEST_DBPORT'] : '',
'dbname' => isset($_SERVER['PHPBB_TEST_DBNAME']) ? $_SERVER['PHPBB_TEST_DBNAME'] : '',
diff --git a/tests/viewonline/helper_test.php b/tests/viewonline/helper_test.php
new file mode 100644
index 0000000000..bbbed59de7
--- /dev/null
+++ b/tests/viewonline/helper_test.php
@@ -0,0 +1,46 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_viewonline_helper_test extends phpbb_test_case
+{
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->viewonline_helper = new \phpbb\viewonline_helper(new \phpbb\filesystem());
+ }
+
+ public function session_pages_data()
+ {
+ return array(
+ array('index.php', 'index'),
+ array('foobar/test.php', 'foobar/test'),
+ array('', ''),
+ array('./../../index.php', '../../index'),
+ array('../subdir/index.php', '../subdir/index'),
+ array('../index.php', '../index'),
+ array('././index.php', 'index'),
+ array('./index.php', 'index'),
+ );
+ }
+
+ /**
+ * @dataProvider session_pages_data
+ */
+ public function test_get_user_page($session_page, $expected)
+ {
+ $on_page = $this->viewonline_helper->get_user_page($session_page);
+ $this->assertArrayHasKey(1, $on_page);
+ $this->assertSame($expected, $on_page[1]);
+ }
+}
diff --git a/travis/ext-sniff.sh b/travis/ext-sniff.sh
new file mode 100755
index 0000000000..4e557a41c1
--- /dev/null
+++ b/travis/ext-sniff.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+#
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
+#
+set -e
+set -x
+
+DB=$1
+TRAVIS_PHP_VERSION=$2
+EXTNAME=$3
+
+if [ "$TRAVIS_PHP_VERSION" == "5.5" -a "$DB" == "mysqli" ]
+then
+ phpBB/vendor/bin/phpcs \
+ -s \
+ --extensions=php \
+ --standard=build/code_sniffer/ruleset-php-extensions.xml \
+ "--ignore=phpBB/ext/$EXTNAME/tests/*" \
+ "--ignore=phpBB/ext/$EXTNAME/vendor/*" \
+ "phpBB/ext/$EXTNAME"
+fi