aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.travis.yml2
-rw-r--r--build/build.xml89
-rw-r--r--build/code_sniffer/ruleset-php-legacy.xml12
-rw-r--r--build/code_sniffer/ruleset-php-strict.xml12
-rw-r--r--phpBB/adm/style/acp_attachments.html47
-rw-r--r--phpBB/adm/style/acp_logs.html2
-rw-r--r--phpBB/adm/style/admin.css14
-rw-r--r--phpBB/assets/javascript/core.js3
-rw-r--r--phpBB/common.php2
-rw-r--r--phpBB/composer.json5
-rw-r--r--phpBB/composer.lock162
-rw-r--r--phpBB/develop/export_events_for_wiki.php340
-rw-r--r--phpBB/docs/events.md73
-rw-r--r--phpBB/feed.php2
-rw-r--r--phpBB/includes/acp/acp_attachments.php22
-rw-r--r--phpBB/includes/acp/acp_ban.php2
-rw-r--r--phpBB/includes/acp/acp_bbcodes.php16
-rw-r--r--phpBB/includes/acp/acp_board.php1
-rw-r--r--phpBB/includes/acp/acp_bots.php27
-rw-r--r--phpBB/includes/acp/acp_captcha.php1
-rw-r--r--phpBB/includes/acp/acp_database.php2
-rw-r--r--phpBB/includes/acp/acp_extensions.php6
-rw-r--r--phpBB/includes/acp/acp_forums.php27
-rw-r--r--phpBB/includes/acp/acp_groups.php4
-rw-r--r--phpBB/includes/acp/acp_icons.php3
-rw-r--r--phpBB/includes/acp/acp_logs.php4
-rw-r--r--phpBB/includes/acp/acp_permission_roles.php2
-rw-r--r--phpBB/includes/acp/acp_permissions.php1
-rw-r--r--phpBB/includes/acp/acp_php_info.php2
-rw-r--r--phpBB/includes/acp/acp_profile.php2
-rw-r--r--phpBB/includes/acp/acp_prune.php16
-rw-r--r--phpBB/includes/acp/acp_ranks.php1
-rw-r--r--phpBB/includes/acp/acp_users.php103
-rw-r--r--phpBB/includes/acp/acp_words.php3
-rw-r--r--phpBB/includes/acp/auth.php1
-rw-r--r--phpBB/includes/captcha/captcha_gd.php21
-rw-r--r--phpBB/includes/constants.php1
-rw-r--r--phpBB/includes/functions.php37
-rw-r--r--phpBB/includes/functions_acp.php8
-rw-r--r--phpBB/includes/functions_admin.php78
-rw-r--r--phpBB/includes/functions_compatibility.php46
-rw-r--r--phpBB/includes/functions_content.php59
-rw-r--r--phpBB/includes/functions_display.php13
-rw-r--r--phpBB/includes/functions_messenger.php7
-rw-r--r--phpBB/includes/functions_module.php3
-rw-r--r--phpBB/includes/functions_posting.php89
-rw-r--r--phpBB/includes/functions_privmsgs.php19
-rw-r--r--phpBB/includes/functions_upload.php2
-rw-r--r--phpBB/includes/functions_user.php28
-rw-r--r--phpBB/includes/mcp/info/mcp_pm_reports.php2
-rw-r--r--phpBB/includes/mcp/mcp_ban.php2
-rw-r--r--phpBB/includes/mcp/mcp_forum.php4
-rw-r--r--phpBB/includes/mcp/mcp_front.php4
-rw-r--r--phpBB/includes/mcp/mcp_main.php4
-rw-r--r--phpBB/includes/mcp/mcp_pm_reports.php4
-rw-r--r--phpBB/includes/mcp/mcp_post.php2
-rw-r--r--phpBB/includes/mcp/mcp_queue.php50
-rw-r--r--phpBB/includes/mcp/mcp_reports.php8
-rw-r--r--phpBB/includes/mcp/mcp_topic.php6
-rw-r--r--phpBB/includes/message_parser.php2
-rw-r--r--phpBB/includes/ucp/info/ucp_auth_link.php2
-rw-r--r--phpBB/includes/ucp/ucp_main.php2
-rw-r--r--phpBB/includes/ucp/ucp_notifications.php2
-rw-r--r--phpBB/includes/ucp/ucp_pm.php1
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php3
-rw-r--r--phpBB/includes/ucp/ucp_pm_options.php22
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewmessage.php15
-rw-r--r--phpBB/includes/ucp/ucp_prefs.php12
-rw-r--r--phpBB/includes/ucp/ucp_zebra.php10
-rw-r--r--phpBB/includes/utf/utf_normalizer.php6
-rw-r--r--phpBB/index.php4
-rw-r--r--phpBB/install/convertors/functions_phpbb20.php2
-rw-r--r--phpBB/install/database_update.php2
-rw-r--r--phpBB/install/install_install.php65
-rw-r--r--phpBB/install/schemas/schema_data.sql1
-rw-r--r--phpBB/language/en/acp/attachments.php9
-rw-r--r--phpBB/language/en/acp/board.php2
-rw-r--r--phpBB/language/en/acp/common.php14
-rw-r--r--phpBB/language/en/acp/extensions.php1
-rw-r--r--phpBB/language/en/acp/permissions.php1
-rw-r--r--phpBB/language/en/acp/posting.php6
-rw-r--r--phpBB/language/en/common.php9
-rw-r--r--phpBB/language/en/email/admin_activate.txt3
-rw-r--r--phpBB/language/en/email/admin_send_email.txt1
-rw-r--r--phpBB/language/en/email/admin_welcome_activated.txt2
-rw-r--r--phpBB/language/en/email/admin_welcome_inactive.txt2
-rw-r--r--phpBB/language/en/email/email_notify.txt2
-rw-r--r--phpBB/language/en/email/installed.txt2
-rw-r--r--phpBB/language/en/email/pm_report_closed.txt3
-rw-r--r--phpBB/language/en/email/pm_report_deleted.txt3
-rw-r--r--phpBB/language/en/email/post_approved.txt2
-rw-r--r--phpBB/language/en/email/short/post_approved.txt2
-rw-r--r--phpBB/language/en/email/user_activate.txt2
-rw-r--r--phpBB/language/en/email/user_activate_inactive.txt2
-rw-r--r--phpBB/language/en/email/user_activate_passwd.txt2
-rw-r--r--phpBB/language/en/email/user_reactivate_account.txt2
-rw-r--r--phpBB/language/en/email/user_remind_inactive.txt2
-rw-r--r--phpBB/language/en/email/user_resend_inactive.txt2
-rw-r--r--phpBB/language/en/email/user_welcome.txt2
-rw-r--r--phpBB/language/en/email/user_welcome_inactive.txt2
-rw-r--r--phpBB/language/en/groups.php2
-rw-r--r--phpBB/language/en/help_bbcode.php2
-rw-r--r--phpBB/language/en/help_faq.php2
-rw-r--r--phpBB/language/en/mcp.php2
-rw-r--r--phpBB/language/en/posting.php2
-rw-r--r--phpBB/language/en/search.php5
-rw-r--r--phpBB/language/en/ucp.php8
-rw-r--r--phpBB/language/en/viewtopic.php2
-rw-r--r--phpBB/mcp.php22
-rw-r--r--phpBB/memberlist.php17
-rw-r--r--phpBB/phpbb/content_visibility.php74
-rw-r--r--phpBB/phpbb/db/migration/data/v310/auth_provider_oauth2.php40
-rw-r--r--phpBB/phpbb/db/migration/data/v310/board_contact_name.php30
-rw-r--r--phpBB/phpbb/db/migration/data/v310/softdelete_p1.php9
-rw-r--r--phpBB/phpbb/db/migrator.php15
-rw-r--r--phpBB/phpbb/db/tools.php306
-rw-r--r--phpBB/phpbb/event/md_exporter.php439
-rw-r--r--phpBB/phpbb/event/php_exporter.php608
-rw-r--r--phpBB/phpbb/event/recursive_event_filter_iterator.php70
-rw-r--r--phpBB/phpbb/log/log.php54
-rw-r--r--phpBB/phpbb/notification/type/approve_post.php8
-rw-r--r--phpBB/phpbb/notification/type/base.php8
-rw-r--r--phpBB/phpbb/notification/type/bookmark.php12
-rw-r--r--phpBB/phpbb/notification/type/post.php49
-rw-r--r--phpBB/phpbb/notification/type/post_in_queue.php8
-rw-r--r--phpBB/phpbb/notification/type/quote.php31
-rw-r--r--phpBB/phpbb/notification/type/type_interface.php7
-rw-r--r--phpBB/phpbb/permissions.php2
-rw-r--r--phpBB/phpbb/user.php12
-rw-r--r--phpBB/posting.php48
-rw-r--r--phpBB/report.php2
-rw-r--r--phpBB/search.php17
-rw-r--r--phpBB/styles/prosilver/template/ajax.js4
-rw-r--r--phpBB/styles/prosilver/template/captcha_default.html2
-rw-r--r--phpBB/styles/prosilver/template/captcha_qa.html2
-rw-r--r--phpBB/styles/prosilver/template/captcha_recaptcha.html2
-rw-r--r--phpBB/styles/prosilver/template/confirm_body.html2
-rw-r--r--phpBB/styles/prosilver/template/confirm_delete_body.html2
-rw-r--r--phpBB/styles/prosilver/template/drafts.html2
-rw-r--r--phpBB/styles/prosilver/template/faq_body.html8
-rw-r--r--phpBB/styles/prosilver/template/login_body.html2
-rw-r--r--phpBB/styles/prosilver/template/login_forum.html4
-rw-r--r--phpBB/styles/prosilver/template/mcp_approve.html2
-rw-r--r--phpBB/styles/prosilver/template/mcp_footer.html3
-rw-r--r--phpBB/styles/prosilver/template/mcp_header.html2
-rw-r--r--phpBB/styles/prosilver/template/mcp_message.html2
-rw-r--r--phpBB/styles/prosilver/template/mcp_move.html2
-rw-r--r--phpBB/styles/prosilver/template/memberlist_body.html2
-rw-r--r--phpBB/styles/prosilver/template/memberlist_view.html11
-rw-r--r--phpBB/styles/prosilver/template/message_body.html2
-rw-r--r--phpBB/styles/prosilver/template/navbar_footer.html10
-rw-r--r--phpBB/styles/prosilver/template/navbar_header.html11
-rw-r--r--phpBB/styles/prosilver/template/posting_layout.html4
-rw-r--r--phpBB/styles/prosilver/template/posting_pm_header.html3
-rw-r--r--phpBB/styles/prosilver/template/posting_pm_layout.html2
-rw-r--r--phpBB/styles/prosilver/template/quickreply_editor.html2
-rw-r--r--phpBB/styles/prosilver/template/search_results.html2
-rw-r--r--phpBB/styles/prosilver/template/ucp_agreement.html4
-rw-r--r--phpBB/styles/prosilver/template/ucp_footer.html3
-rw-r--r--phpBB/styles/prosilver/template/ucp_header.html2
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_message_header.html12
-rw-r--r--phpBB/styles/prosilver/template/viewforum_body.html2
-rw-r--r--phpBB/styles/prosilver/template/viewonline_body.html2
-rw-r--r--phpBB/styles/prosilver/template/viewonline_whois.html2
-rw-r--r--phpBB/styles/prosilver/template/viewtopic_body.html6
-rw-r--r--phpBB/styles/prosilver/template/viewtopic_topic_tools.html4
-rw-r--r--phpBB/styles/prosilver/theme/bidi.css6
-rw-r--r--phpBB/styles/prosilver/theme/buttons.css21
-rw-r--r--phpBB/styles/prosilver/theme/colours.css10
-rw-r--r--phpBB/styles/prosilver/theme/common.css18
-rw-r--r--phpBB/styles/prosilver/theme/forms.css2
-rwxr-xr-x[-rw-r--r--]phpBB/styles/prosilver/theme/images/icon_print.gifbin424 -> 204 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/icon_sendemail.gifbin531 -> 303 bytes
-rw-r--r--phpBB/styles/subsilver2/template/breadcrumbs.html2
-rw-r--r--phpBB/styles/subsilver2/template/index_body.html9
-rw-r--r--phpBB/styles/subsilver2/template/viewtopic_body.html2
-rw-r--r--phpBB/ucp.php2
-rw-r--r--phpBB/viewforum.php20
-rw-r--r--phpBB/viewonline.php4
-rw-r--r--phpBB/viewtopic.php82
-rw-r--r--tests/dbal/db_tools_test.php54
-rw-r--r--tests/dbal/migration/revert.php8
-rw-r--r--tests/dbal/migrator_test.php6
-rw-r--r--tests/event/export_php_test.php45
-rw-r--r--tests/event/fixtures/default.test9
-rw-r--r--tests/event/fixtures/duplicate_event.test19
-rw-r--r--tests/event/fixtures/extra_description.test11
-rw-r--r--tests/event/fixtures/missing_var.test17
-rw-r--r--tests/event/fixtures/none.test6
-rw-r--r--tests/event/fixtures/trigger.test15
-rw-r--r--tests/event/fixtures/trigger_many_vars.test65
-rw-r--r--tests/event/md_exporter_test.php67
-rw-r--r--tests/event/php_exporter_test.php722
-rw-r--r--tests/functional/visibility_disapprove_test.php (renamed from tests/functional/disapprove_test.php)2
-rw-r--r--tests/functional/visibility_reapprove_test.php416
-rw-r--r--tests/functional/visibility_softdelete_test.php (renamed from tests/functional/softdelete_test.php)2
-rw-r--r--tests/functions/validate_with_method_test.php39
-rw-r--r--tests/functions_content/phpbb_clean_search_string_test.php38
-rw-r--r--tests/log/fixtures/full_log.xml24
-rw-r--r--tests/log/function_view_log_test.php62
-rw-r--r--tests/notification/submit_post_type_quote_test.php3
-rw-r--r--tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_subloop.html2
-rw-r--r--tests/template/datasets/ext_trivial/styles/silver/template/event_subloop.html3
-rw-r--r--tests/template/template_events_test.php21
-rw-r--r--tests/template/template_test.php19
-rw-r--r--tests/template/templates/loop_nested_include.html4
-rw-r--r--tests/template/templates/loop_nested_include1.html5
-rw-r--r--tests/test_framework/phpbb_database_test_connection_manager.php17
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php8
209 files changed, 4537 insertions, 1129 deletions
diff --git a/.travis.yml b/.travis.yml
index a65b1ccd2b..88c902cd4d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -40,3 +40,5 @@ matrix:
env: DB=mariadb
- php: 5.4
env: DB=postgres
+ allow_failures:
+ - php: hhvm
diff --git a/build/build.xml b/build/build.xml
index 3a2a66b113..c1f81fb947 100644
--- a/build/build.xml
+++ b/build/build.xml
@@ -273,6 +273,10 @@
<delete dir="${dir}/develop" />
<delete dir="${dir}/install/data" />
+ <phingcall target="clean-vendor-dir">
+ <property name="dir" value="${dir}" />
+ </phingcall>
+
<echo msg="Setting permissions for checkout of ${revision} in ${dir}" />
<!-- set permissions of all files to 644, directories to 755 -->
<exec dir="${dir}" command="find . -type f|xargs chmod 644" escape="false" />
@@ -284,6 +288,91 @@
<chmod mode="0777" file="${dir}/images/avatars/upload" />
</target>
+ <target name="clean-vendor-dir">
+ <!-- Delete unrelated files from vendor/, see PHPBB3-12390 -->
+ <delete dir="${dir}/vendor/lusitanian/oauth/examples" />
+ <delete dir="${dir}/vendor/lusitanian/oauth/tests" />
+ <delete file="${dir}/vendor/lusitanian/oauth/.gitignore" />
+ <delete file="${dir}/vendor/lusitanian/oauth/.travis.yml" />
+ <delete file="${dir}/vendor/lusitanian/oauth/phpunit.xml.dist" />
+ <delete file="${dir}/vendor/lusitanian/oauth/README.md" />
+
+ <delete dir="${dir}/vendor/psr/log/Psr/Log/Test" />
+ <delete file="${dir}/vendor/psr/log/.gitignore" />
+ <delete file="${dir}/vendor/psr/log/README.md" />
+
+ <delete dir="${dir}/vendor/symfony/config/Symfony/Component/Config/Tests" />
+ <delete file="${dir}/vendor/symfony/config/Symfony/Component/Config/.gitignore" />
+ <delete file="${dir}/vendor/symfony/config/Symfony/Component/Config/CHANGELOG.md" />
+ <delete file="${dir}/vendor/symfony/config/Symfony/Component/Config/README.md" />
+ <delete file="${dir}/vendor/symfony/config/Symfony/Component/Config/phpunit.xml.dist" />
+
+ <delete dir="${dir}/vendor/symfony/console/Symfony/Component/Console/Tests" />
+ <delete file="${dir}/vendor/symfony/console/Symfony/Component/Console/.gitignore" />
+ <delete file="${dir}/vendor/symfony/console/Symfony/Component/Console/CHANGELOG.md" />
+ <delete file="${dir}/vendor/symfony/console/Symfony/Component/Console/README.md" />
+ <delete file="${dir}/vendor/symfony/console/Symfony/Component/Console/phpunit.xml.dist" />
+
+ <delete dir="${dir}/vendor/symfony/debug/Symfony/Component/Debug/Tests" />
+ <delete file="${dir}/vendor/symfony/debug/Symfony/Component/Debug/.gitignore" />
+ <delete file="${dir}/vendor/symfony/debug/Symfony/Component/Debug/CHANGELOG.md" />
+ <delete file="${dir}/vendor/symfony/debug/Symfony/Component/Debug/README.md" />
+ <delete file="${dir}/vendor/symfony/debug/Symfony/Component/Debug/phpunit.xml.dist" />
+
+ <delete dir="${dir}/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/Tests" />
+ <delete file="${dir}/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/.gitignore" />
+ <delete file="${dir}/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/CHANGELOG.md" />
+ <delete file="${dir}/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/README.md" />
+ <delete file="${dir}/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/phpunit.xml.dist" />
+
+ <delete dir="${dir}/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/Tests" />
+ <delete file="${dir}/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/.gitignore" />
+ <delete file="${dir}/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/CHANGELOG.md" />
+ <delete file="${dir}/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/README.md" />
+ <delete file="${dir}/vendor/symfony/event-dispatcher/Symfony/Component/EventDispatcher/phpunit.xml.dist" />
+
+ <delete dir="${dir}/vendor/symfony/filesystem/Symfony/Component/Filesystem/Tests" />
+ <delete file="${dir}/vendor/symfony/filesystem/Symfony/Component/Filesystem/.gitignore" />
+ <delete file="${dir}/vendor/symfony/filesystem/Symfony/Component/Filesystem/CHANGELOG.md" />
+ <delete file="${dir}/vendor/symfony/filesystem/Symfony/Component/Filesystem/README.md" />
+ <delete file="${dir}/vendor/symfony/filesystem/Symfony/Component/Filesystem/phpunit.xml.dist" />
+
+ <delete dir="${dir}/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Tests" />
+ <delete file="${dir}/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/.gitignore" />
+ <delete file="${dir}/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/CHANGELOG.md" />
+ <delete file="${dir}/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/README.md" />
+ <delete file="${dir}/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/phpunit.xml.dist" />
+
+ <delete dir="${dir}/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Tests" />
+ <delete file="${dir}/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/.gitignore" />
+ <delete file="${dir}/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/CHANGELOG.md" />
+ <delete file="${dir}/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/README.md" />
+ <delete file="${dir}/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/phpunit.xml.dist" />
+
+ <delete dir="${dir}/vendor/symfony/routing/Symfony/Component/Routing/Tests" />
+ <delete file="${dir}/vendor/symfony/routing/Symfony/Component/Routing/.gitignore" />
+ <delete file="${dir}/vendor/symfony/routing/Symfony/Component/Routing/CHANGELOG.md" />
+ <delete file="${dir}/vendor/symfony/routing/Symfony/Component/Routing/README.md" />
+ <delete file="${dir}/vendor/symfony/routing/Symfony/Component/Routing/phpunit.xml.dist" />
+
+ <delete dir="${dir}/vendor/symfony/yaml/Symfony/Component/Yaml/Tests" />
+ <delete file="${dir}/vendor/symfony/yaml/Symfony/Component/Yaml/.gitignore" />
+ <delete file="${dir}/vendor/symfony/yaml/Symfony/Component/Yaml/CHANGELOG.md" />
+ <delete file="${dir}/vendor/symfony/yaml/Symfony/Component/Yaml/README.md" />
+ <delete file="${dir}/vendor/symfony/yaml/Symfony/Component/Yaml/phpunit.xml.dist" />
+
+ <delete dir="${dir}/vendor/twig/twig/doc" />
+ <delete dir="${dir}/vendor/twig/twig/ext" />
+ <delete dir="${dir}/vendor/twig/twig/test" />
+ <delete file="${dir}/vendor/twig/twig/.editorconfig" />
+ <delete file="${dir}/vendor/twig/twig/.gitignore" />
+ <delete file="${dir}/vendor/twig/twig/.travis.yml" />
+ <delete file="${dir}/vendor/twig/twig/AUTHORS" />
+ <delete file="${dir}/vendor/twig/twig/CHANGELOG" />
+ <delete file="${dir}/vendor/twig/twig/phpunit.xml.dist" />
+ <delete file="${dir}/vendor/twig/twig/README.markdown" />
+ </target>
+
<target name="clean-diff-dir">
<delete dir="${dir}/cache" />
<delete dir="${dir}/docs" />
diff --git a/build/code_sniffer/ruleset-php-legacy.xml b/build/code_sniffer/ruleset-php-legacy.xml
index 550c919b5d..65eb0a8622 100644
--- a/build/code_sniffer/ruleset-php-legacy.xml
+++ b/build/code_sniffer/ruleset-php-legacy.xml
@@ -41,6 +41,18 @@
</rule>
<rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing.SpacingAfterHint" />
+ <!-- There MUST NOT be trailing whitespace at the end of lines. -->
+ <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace" />
+
+ <!-- There MUST NOT be whitespace before the first content of a file -->
+ <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile" />
+
+ <!-- There MUST NOT be whitespace after the last content of a file -->
+ <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile" />
+
+ <!-- Functions MUST NOT contain multiple empty lines in a row -->
+ <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" />
+
<!-- The ?> closing tag MUST be omitted from files containing only PHP. -->
<rule ref="Zend.Files.ClosingTag" />
diff --git a/build/code_sniffer/ruleset-php-strict.xml b/build/code_sniffer/ruleset-php-strict.xml
index 5e3c26a616..f2d5b86dd1 100644
--- a/build/code_sniffer/ruleset-php-strict.xml
+++ b/build/code_sniffer/ruleset-php-strict.xml
@@ -22,18 +22,6 @@
<!-- PHP keywords MUST be in lower case. -->
<rule ref="Generic.PHP.LowerCaseKeyword" />
- <!-- There MUST NOT be trailing whitespace at the end of lines. -->
- <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace" />
-
- <!-- There MUST NOT be whitespace before the first content of a file -->
- <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile" />
-
- <!-- There MUST NOT be whitespace after the last content of a file -->
- <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile" />
-
- <!-- Functions MUST NOT contain multiple empty lines in a row -->
- <rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines" />
-
<!-- Classes etc. MUST be namespaced -->
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace" />
diff --git a/phpBB/adm/style/acp_attachments.html b/phpBB/adm/style/acp_attachments.html
index 82fb229fae..5d35666fdd 100644
--- a/phpBB/adm/style/acp_attachments.html
+++ b/phpBB/adm/style/acp_attachments.html
@@ -378,7 +378,7 @@
<fieldset class="tabulated">
<legend>{L_TITLE}</legend>
- <div class="pagination">
+ <div class="pagination top-pagination">
<!-- IF .pagination or TOTAL_FILES -->
{L_NUMBER_FILES}{L_COLON} {TOTAL_FILES} &bull; {L_TOTAL_SIZE}{L_COLON} {TOTAL_SIZE}
<!-- IF .pagination -->
@@ -389,13 +389,14 @@
<!-- ENDIF -->
</div>
+<!-- IF .attachments -->
<table class="table1 zebra-table">
<thead>
<tr>
<th>{L_FILENAME}</th>
<th>{L_POSTED}</th>
- <th>{L_FILESIZE}</th>
- <th>{L_DELETE}</th>
+ <th class="centered-text">{L_FILESIZE}</th>
+ <th class="centered-text">{L_MARK}</th>
</tr>
</thead>
<tbody>
@@ -406,25 +407,19 @@
<!-- ELSE --><a href="{attachments.U_FILE}" style="font-weight: bold;">{attachments.REAL_FILENAME}</a><br /><!-- IF attachments.COMMENT -->{attachments.COMMENT}<br /><!-- ENDIF -->{attachments.L_DOWNLOAD_COUNT}<br />{L_TOPIC}{L_COLON} <a href="{attachments.U_VIEW_TOPIC}">{attachments.TOPIC_TITLE}</a><!-- ENDIF -->
</td>
<td>{attachments.FILETIME}<br />{L_POST_BY_AUTHOR} {attachments.ATTACHMENT_POSTER}</td>
- <td>{attachments.FILESIZE}</td>
- <td><input type="checkbox" class="radio" name="delete[{attachments.ATTACH_ID}]" /></td>
+ <td class="centered-text">{attachments.FILESIZE}</td>
+ <td class="centered-text"><input type="checkbox" class="radio" name="delete[{attachments.ATTACH_ID}]" /></td>
</tr>
<!-- END attachments -->
- <tr class="row4">
- <td colspan="3">&nbsp;</td>
- <td class="small"><a href="#" onclick="marklist('attachments', 'delete', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('attachments', 'delete', false); return false;">{L_UNMARK_ALL}</a></td>
- </tr>
</tbody>
</table>
+<!-- ELSE -->
+ <div class="errorbox">
+ <p>{L_NO_ATTACHMENTS}</p>
+ </div>
+<!-- ENDIF -->
<!-- IF TOTAL_FILES -->
- <fieldset class="display-options">
- {L_DISPLAY_LOG}{L_COLON} &nbsp;{S_LIMIT_DAYS}&nbsp;{L_SORT_BY}{L_COLON} {S_SORT_KEY} {S_SORT_DIR}
- <input class="button2" type="submit" value="{L_GO}" name="sort" />
- </fieldset>
-
- <hr />
-
<div class="pagination">
{L_NUMBER_FILES}{L_COLON} {TOTAL_FILES} &bull; {L_TOTAL_SIZE}{L_COLON} {TOTAL_SIZE}
<!-- IF .pagination -->
@@ -435,10 +430,22 @@
</div>
<!-- ENDIF -->
- <p class="submit-buttons">
- <input class="button1" type="submit" id="submit" name="submit" value="{L_SUBMIT}" />&nbsp;
- <input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
- </p>
+ <fieldset class="display-options">
+ {L_DISPLAY_LOG}{L_COLON} &nbsp;{S_LIMIT_DAYS}&nbsp;{L_SORT_BY}{L_COLON} {S_SORT_KEY} {S_SORT_DIR}
+ <input class="button2" type="submit" value="{L_GO}" name="sort" />
+ </fieldset>
+
+ <hr />
+
+<!-- IF .attachments -->
+ <fieldset class="quick">
+ <input class="button2" type="submit" name="submit" value="{L_DELETE_MARKED}" /><br />
+ <p class="small">
+ <a href="#" onclick="marklist('attachments', 'delete', true); return false;">{L_MARK_ALL}</a> &bull;
+ <a href="#" onclick="marklist('attachments', 'delete', false); return false;">{L_UNMARK_ALL}</a>
+ </p>
+ </fieldset>
+<!-- ENDIF -->
{S_FORM_TOKEN}
</fieldset>
</form>
diff --git a/phpBB/adm/style/acp_logs.html b/phpBB/adm/style/acp_logs.html
index 592b5bbc16..9343b9b509 100644
--- a/phpBB/adm/style/acp_logs.html
+++ b/phpBB/adm/style/acp_logs.html
@@ -13,7 +13,7 @@
</fieldset>
<!-- IF .pagination -->
-<div class="pagination" style="float: right; margin: 15px 0 2px 0">
+<div class="pagination top-pagination">
<!-- INCLUDE pagination.html -->
</div>
<!-- ENDIF -->
diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css
index 22bbf404ea..6f2d65afc0 100644
--- a/phpBB/adm/style/admin.css
+++ b/phpBB/adm/style/admin.css
@@ -102,6 +102,10 @@ hr {
height: 1px;
}
+.centered-text {
+ text-align: center;
+}
+
.small {
font-size: 0.85em;
}
@@ -1126,11 +1130,14 @@ input.langvalue, textarea.langvalue {
}
optgroup, select {
+ background-color: #FAFAFA;
+ border: 1px solid #666666;
font-family: Verdana, Helvetica, Arial, sans-serif;
font-size: 0.85em;
font-weight: normal;
font-style: normal;
cursor: pointer;
+ padding: 1px;
vertical-align: middle;
width: auto;
color: #000;
@@ -1238,7 +1245,7 @@ fieldset.display-options {
border: none;
background-color: transparent;
text-align: center;
- font-size: 0.75em;
+ font-size: 0.85em;
}
fieldset.display-options select, fieldset.display-options input, fieldset.display-options label {
@@ -1663,11 +1670,16 @@ input.button1:focus, input.button2:focus {
/* Pagination
---------------------------------------- */
.pagination {
+ font-size: .85em;
height: 1%; /* IE tweak (holly hack) */
width: auto;
text-align: right;
margin-top: 5px;
+}
+
+.top-pagination {
float: right;
+ margin: 15px 0 2px 0;
}
.rtl .pagination {
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index ac866f7c78..4920a1167f 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -26,6 +26,7 @@ phpbb.loadingIndicator = function() {
if (!loadingIndicator.is(':visible')) {
loadingIndicator.fadeIn(phpbb.alertTime);
// Wait fifteen seconds and display an error if nothing has been returned by then.
+ phpbb.clearLoadingTimeout();
phpbbAlertTimer = setTimeout(function() {
if (loadingIndicator.is(':visible')) {
phpbb.alert($('#phpbb_alert').attr('data-l-err'), $('#phpbb_alert').attr('data-l-timeout-processing-req'));
@@ -315,7 +316,7 @@ phpbb.ajaxify = function(options) {
refresh = false;
}
- setTimeout(function() {
+ phpbbAlertTimer = setTimeout(function() {
if (refresh) {
window.location = res.REFRESH_DATA.url;
}
diff --git a/phpBB/common.php b/phpBB/common.php
index b1da2215fb..12dbe5a62c 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -151,6 +151,6 @@ if (!$config['use_system_cron'])
* please use the core.user_setup event instead!
*
* @event core.common
-* @since 3.1-A1
+* @since 3.1.0-a1
*/
$phpbb_dispatcher->dispatch('core.common');
diff --git a/phpBB/composer.json b/phpBB/composer.json
index 3cf83a8fe9..f005fff805 100644
--- a/phpBB/composer.json
+++ b/phpBB/composer.json
@@ -1,5 +1,8 @@
{
- "minimum-stability": "beta",
+ "_readme": [
+ "You MUST update the clean-vendor-dir target in build/build.xml",
+ "accordingly when adding or upgrading dependencies."
+ ],
"require": {
"lusitanian/oauth": "0.2.*",
"symfony/config": "2.3.*",
diff --git a/phpBB/composer.lock b/phpBB/composer.lock
index c0eb7afcbb..ee83dee047 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": "cc83663b780856890f787b9b4d6ea474",
+ "hash": "9b683acbc766a345d90de958db4e7f48",
"packages": [
{
"name": "lusitanian/oauth",
@@ -108,17 +108,17 @@
},
{
"name": "symfony/config",
- "version": "v2.3.4",
+ "version": "v2.3.12",
"target-dir": "Symfony/Component/Config",
"source": {
"type": "git",
"url": "https://github.com/symfony/Config.git",
- "reference": "65a927c15ca5a911ba2fa277a5457fa8129505b0"
+ "reference": "91faa2d4944d0c8a94d5b73cb7ccfb219aee9d21"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Config/zipball/65a927c15ca5a911ba2fa277a5457fa8129505b0",
- "reference": "65a927c15ca5a911ba2fa277a5457fa8129505b0",
+ "url": "https://api.github.com/repos/symfony/Config/zipball/91faa2d4944d0c8a94d5b73cb7ccfb219aee9d21",
+ "reference": "91faa2d4944d0c8a94d5b73cb7ccfb219aee9d21",
"shasum": ""
},
"require": {
@@ -136,14 +136,16 @@
"Symfony\\Component\\Config\\": ""
}
},
- "notification-url": "http://packagist.org/downloads/",
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "email": "fabien@symfony.com",
+ "homepage": "http://fabien.potencier.org",
+ "role": "Lead Developer"
},
{
"name": "Symfony Community",
@@ -152,21 +154,21 @@
],
"description": "Symfony Config Component",
"homepage": "http://symfony.com",
- "time": "2013-08-06 05:49:23"
+ "time": "2014-03-31 10:15:50"
},
{
"name": "symfony/console",
- "version": "v2.3.6",
+ "version": "v2.3.12",
"target-dir": "Symfony/Component/Console",
"source": {
"type": "git",
"url": "https://github.com/symfony/Console.git",
- "reference": "f880062d56edefb25b36f2defa65aafe65959dc7"
+ "reference": "df17996d37eb113a5675ca4cc2ac45f4fc057cb7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Console/zipball/f880062d56edefb25b36f2defa65aafe65959dc7",
- "reference": "f880062d56edefb25b36f2defa65aafe65959dc7",
+ "url": "https://api.github.com/repos/symfony/Console/zipball/df17996d37eb113a5675ca4cc2ac45f4fc057cb7",
+ "reference": "df17996d37eb113a5675ca4cc2ac45f4fc057cb7",
"shasum": ""
},
"require": {
@@ -196,7 +198,9 @@
"authors": [
{
"name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "email": "fabien@symfony.com",
+ "homepage": "http://fabien.potencier.org",
+ "role": "Lead Developer"
},
{
"name": "Symfony Community",
@@ -205,7 +209,7 @@
],
"description": "Symfony Console Component",
"homepage": "http://symfony.com",
- "time": "2013-09-25 06:04:15"
+ "time": "2014-03-01 17:25:29"
},
{
"name": "symfony/debug",
@@ -245,14 +249,16 @@
"Symfony\\Component\\Debug\\": ""
}
},
- "notification-url": "http://packagist.org/downloads/",
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "email": "fabien@symfony.com",
+ "homepage": "http://fabien.potencier.org",
+ "role": "Lead Developer"
},
{
"name": "Symfony Community",
@@ -265,17 +271,17 @@
},
{
"name": "symfony/dependency-injection",
- "version": "v2.3.4",
+ "version": "v2.3.12",
"target-dir": "Symfony/Component/DependencyInjection",
"source": {
"type": "git",
"url": "https://github.com/symfony/DependencyInjection.git",
- "reference": "3678aa969e5bfeb8515a1f3047c63e8104723f5c"
+ "reference": "41e9e2078e8edf261c11be478300c8fcddb64e30"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/3678aa969e5bfeb8515a1f3047c63e8104723f5c",
- "reference": "3678aa969e5bfeb8515a1f3047c63e8104723f5c",
+ "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/41e9e2078e8edf261c11be478300c8fcddb64e30",
+ "reference": "41e9e2078e8edf261c11be478300c8fcddb64e30",
"shasum": ""
},
"require": {
@@ -301,14 +307,16 @@
"Symfony\\Component\\DependencyInjection\\": ""
}
},
- "notification-url": "http://packagist.org/downloads/",
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "email": "fabien@symfony.com",
+ "homepage": "http://fabien.potencier.org",
+ "role": "Lead Developer"
},
{
"name": "Symfony Community",
@@ -317,21 +325,21 @@
],
"description": "Symfony DependencyInjection Component",
"homepage": "http://symfony.com",
- "time": "2013-07-25 17:13:25"
+ "time": "2014-03-27 18:14:33"
},
{
"name": "symfony/event-dispatcher",
- "version": "v2.3.4",
+ "version": "v2.3.12",
"target-dir": "Symfony/Component/EventDispatcher",
"source": {
"type": "git",
"url": "https://github.com/symfony/EventDispatcher.git",
- "reference": "41c9826457c65fa3cf746f214985b7ca9cba42f8"
+ "reference": "15645237c6ff70e74a28e8836362d82492765055"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/41c9826457c65fa3cf746f214985b7ca9cba42f8",
- "reference": "41c9826457c65fa3cf746f214985b7ca9cba42f8",
+ "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/15645237c6ff70e74a28e8836362d82492765055",
+ "reference": "15645237c6ff70e74a28e8836362d82492765055",
"shasum": ""
},
"require": {
@@ -362,7 +370,9 @@
"authors": [
{
"name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "email": "fabien@symfony.com",
+ "homepage": "http://fabien.potencier.org",
+ "role": "Lead Developer"
},
{
"name": "Symfony Community",
@@ -371,7 +381,7 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "http://symfony.com",
- "time": "2013-07-21 12:12:18"
+ "time": "2014-02-11 10:29:24"
},
{
"name": "symfony/filesystem",
@@ -402,14 +412,16 @@
"Symfony\\Component\\Filesystem\\": ""
}
},
- "notification-url": "http://packagist.org/downloads/",
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "email": "fabien@symfony.com",
+ "homepage": "http://fabien.potencier.org",
+ "role": "Lead Developer"
},
{
"name": "Symfony Community",
@@ -452,14 +464,16 @@
"Symfony/Component/HttpFoundation/Resources/stubs"
]
},
- "notification-url": "http://packagist.org/downloads/",
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "email": "fabien@symfony.com",
+ "homepage": "http://fabien.potencier.org",
+ "role": "Lead Developer"
},
{
"name": "Symfony Community",
@@ -472,17 +486,17 @@
},
{
"name": "symfony/http-kernel",
- "version": "v2.3.4",
+ "version": "v2.3.12",
"target-dir": "Symfony/Component/HttpKernel",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpKernel.git",
- "reference": "9d35da40f07bbe7a4f8dfbc41555d2b69de674bf"
+ "reference": "48d61b3622ca35dd924b167441a9810ad55906ce"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/9d35da40f07bbe7a4f8dfbc41555d2b69de674bf",
- "reference": "9d35da40f07bbe7a4f8dfbc41555d2b69de674bf",
+ "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/48d61b3622ca35dd924b167441a9810ad55906ce",
+ "reference": "48d61b3622ca35dd924b167441a9810ad55906ce",
"shasum": ""
},
"require": {
@@ -523,14 +537,16 @@
"Symfony\\Component\\HttpKernel\\": ""
}
},
- "notification-url": "http://packagist.org/downloads/",
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "email": "fabien@symfony.com",
+ "homepage": "http://fabien.potencier.org",
+ "role": "Lead Developer"
},
{
"name": "Symfony Community",
@@ -539,21 +555,21 @@
],
"description": "Symfony HttpKernel Component",
"homepage": "http://symfony.com",
- "time": "2013-08-27 08:58:24"
+ "time": "2014-04-03 05:42:39"
},
{
"name": "symfony/routing",
- "version": "v2.3.4",
+ "version": "v2.3.12",
"target-dir": "Symfony/Component/Routing",
"source": {
"type": "git",
"url": "https://github.com/symfony/Routing.git",
- "reference": "69af3f07dbf3ae93dd513dbc373f561cb2e7f143"
+ "reference": "08afcafd9af22a24a8055669f85d63b863c4711b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Routing/zipball/69af3f07dbf3ae93dd513dbc373f561cb2e7f143",
- "reference": "69af3f07dbf3ae93dd513dbc373f561cb2e7f143",
+ "url": "https://api.github.com/repos/symfony/Routing/zipball/08afcafd9af22a24a8055669f85d63b863c4711b",
+ "reference": "08afcafd9af22a24a8055669f85d63b863c4711b",
"shasum": ""
},
"require": {
@@ -581,14 +597,16 @@
"Symfony\\Component\\Routing\\": ""
}
},
- "notification-url": "http://packagist.org/downloads/",
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "email": "fabien@symfony.com",
+ "homepage": "http://fabien.potencier.org",
+ "role": "Lead Developer"
},
{
"name": "Symfony Community",
@@ -597,21 +615,21 @@
],
"description": "Symfony Routing Component",
"homepage": "http://symfony.com",
- "time": "2013-08-23 15:14:07"
+ "time": "2014-03-28 10:34:27"
},
{
"name": "symfony/yaml",
- "version": "v2.3.4",
+ "version": "v2.3.12",
"target-dir": "Symfony/Component/Yaml",
"source": {
"type": "git",
"url": "https://github.com/symfony/Yaml.git",
- "reference": "5a279f1b5f5e1045a6c432354d9ea727ff3a9847"
+ "reference": "3acf34f6993db3d873fa77ac2cb6e595db00b88d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Yaml/zipball/5a279f1b5f5e1045a6c432354d9ea727ff3a9847",
- "reference": "5a279f1b5f5e1045a6c432354d9ea727ff3a9847",
+ "url": "https://api.github.com/repos/symfony/Yaml/zipball/3acf34f6993db3d873fa77ac2cb6e595db00b88d",
+ "reference": "3acf34f6993db3d873fa77ac2cb6e595db00b88d",
"shasum": ""
},
"require": {
@@ -635,7 +653,9 @@
"authors": [
{
"name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "email": "fabien@symfony.com",
+ "homepage": "http://fabien.potencier.org",
+ "role": "Lead Developer"
},
{
"name": "Symfony Community",
@@ -644,7 +664,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "http://symfony.com",
- "time": "2013-08-24 15:26:22"
+ "time": "2014-03-04 16:04:39"
},
{
"name": "twig/twig",
@@ -743,7 +763,9 @@
"authors": [
{
"name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "email": "fabien@symfony.com",
+ "homepage": "http://fabien.potencier.org",
+ "role": "Lead Developer"
}
],
"description": "A simple PHP Web Scraper",
@@ -1430,16 +1452,16 @@
},
{
"name": "squizlabs/php_codesniffer",
- "version": "1.5.0RC4",
+ "version": "1.5.2",
"source": {
"type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
- "reference": "146a9b54e4adeaca0a3ae073e0a8a03570d6cc43"
+ "reference": "a76a39b317ce8106abe6264daa505e24e1731860"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/146a9b54e4adeaca0a3ae073e0a8a03570d6cc43",
- "reference": "146a9b54e4adeaca0a3ae073e0a8a03570d6cc43",
+ "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/a76a39b317ce8106abe6264daa505e24e1731860",
+ "reference": "a76a39b317ce8106abe6264daa505e24e1731860",
"shasum": ""
},
"require": {
@@ -1496,7 +1518,7 @@
"phpcs",
"standards"
],
- "time": "2013-09-26 00:14:02"
+ "time": "2014-02-04 23:49:58"
},
{
"name": "symfony/browser-kit",
@@ -1542,7 +1564,9 @@
"authors": [
{
"name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "email": "fabien@symfony.com",
+ "homepage": "http://fabien.potencier.org",
+ "role": "Lead Developer"
},
{
"name": "Symfony Community",
@@ -1589,7 +1613,9 @@
"authors": [
{
"name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "email": "fabien@symfony.com",
+ "homepage": "http://fabien.potencier.org",
+ "role": "Lead Developer"
},
{
"name": "Symfony Community",
@@ -1646,7 +1672,9 @@
"authors": [
{
"name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "email": "fabien@symfony.com",
+ "homepage": "http://fabien.potencier.org",
+ "role": "Lead Developer"
},
{
"name": "Symfony Community",
@@ -1693,7 +1721,9 @@
"authors": [
{
"name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "email": "fabien@symfony.com",
+ "homepage": "http://fabien.potencier.org",
+ "role": "Lead Developer"
},
{
"name": "Symfony Community",
@@ -1740,7 +1770,9 @@
"authors": [
{
"name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "email": "fabien@symfony.com",
+ "homepage": "http://fabien.potencier.org",
+ "role": "Lead Developer"
},
{
"name": "Symfony Community",
@@ -1755,7 +1787,7 @@
"aliases": [
],
- "minimum-stability": "beta",
+ "minimum-stability": "stable",
"stability-flags": [
],
diff --git a/phpBB/develop/export_events_for_wiki.php b/phpBB/develop/export_events_for_wiki.php
index 3021b64e05..f4ebb42cf4 100644
--- a/phpBB/develop/export_events_for_wiki.php
+++ b/phpBB/develop/export_events_for_wiki.php
@@ -16,316 +16,84 @@ $phpbb_root_path = __DIR__ . '/../';
function usage()
{
- echo "Usage: export_events_for_wiki.php COMMAND\n";
+ echo "Usage: export_events_for_wiki.php COMMAND [EXTENSION]\n";
echo "\n";
- echo "acp:\n";
- echo " Export all events for files in the acp style.\n";
+ echo "COMMAND:\n";
+ echo " all:\n";
+ echo " Generate the complete wikipage for https://wiki.phpbb.com/Event_List\n";
echo "\n";
- echo "styles:\n";
- echo " Export all events for files in the prosilver and subsilver2 styles.\n";
+ echo " php:\n";
+ echo " Generate the PHP event section of Event_List\n";
+ echo "\n";
+ echo " adm:\n";
+ echo " Generate the ACP Template event section of Event_List\n";
+ echo "\n";
+ echo " styles:\n";
+ echo " Generate the Styles Template event section of Event_List\n";
+ echo "\n";
+ echo "EXTENSION (Optional):\n";
+ echo " If not given, only core events will be exported.\n";
+ echo " Otherwise only events from the extension will be exported.\n";
echo "\n";
- echo "php:\n";
- echo " Export all events for php-files.\n";
exit(2);
}
-function export_from_eventsmd($phpbb_root_path, $filter)
+function validate_argument_count($arguments, $count)
{
- $file_content = file_get_contents($phpbb_root_path . 'docs/events.md');
-
- $events = explode("\n\n", $file_content);
- foreach ($events as $event)
+ if ($arguments <= $count)
{
- // Last row of the file
- if (strpos($event, "\n===\n") === false) continue;
-
- list($event_name, $details) = explode("\n===\n", $event);
-
- if ($filter == 'acp' && strpos($event_name, 'acp_') !== 0) continue;
- if ($filter == 'styles' && strpos($event_name, 'acp_') === 0) continue;
-
- list($file_details, $details) = explode("\n* Since: ", $details);
- list($version, $explanition) = explode("\n* Purpose: ", $details);
-
- echo "|- id=\"{$event_name}\"\n";
- echo "| [[#{$event_name}|{$event_name}]] || ";
-
- if (strpos($file_details, "* Locations:\n + ") === 0)
- {
- $file_details = substr($file_details, strlen("* Locations:\n + "));
- $files = explode("\n + ", $file_details);
- $prosilver = $subsilver2 = $adm = array();
- foreach ($files as $file)
- {
- if (strpos($file, 'styles/prosilver/template/') === 0)
- {
- $prosilver[] = substr($file, strlen('styles/prosilver/template/'));
- }
- if (strpos($file, 'styles/subsilver2/template/') === 0)
- {
- $subsilver2[] = substr($file, strlen('styles/subsilver2/template/'));
- }
- if (strpos($file, 'adm/style/') === 0)
- {
- $adm[] = substr($file, strlen('adm/style/'));
- }
- }
- if ($filter == 'acp')
- {
- echo implode(', ', $adm);
- }
- else
- {
- echo implode(', ', $prosilver) . ' || ' . implode(', ', $subsilver2);
- }
- }
- else if ($filter == 'acp')
- {
- echo substr($file_details, strlen("* Location: adm/style/"));
- }
- echo " || {$version} || " . str_replace("\n", ' ', $explanition) . "\n";
-
+ usage();
}
}
-function export_from_php($phpbb_root_path)
-{
- $files = get_file_list($phpbb_root_path);
- $events = array();
- foreach ($files as $file)
- {
- $file_events = check_for_events($phpbb_root_path, $file);
- if (!empty($file_events))
- {
- $events = array_merge($events, $file_events);
- }
- }
-
- ksort($events);
+validate_argument_count($argc, 1);
- foreach ($events as $event)
- {
- echo '|- id="' . $event['event'] . '"' . "\n";
- echo '| [[#' . $event['event'] . '|' . $event['event'] . ']] || ' . $event['file'] . ' || ' . implode(', ', $event['arguments']) . ' || ' . $event['since'] . ' || ' . $event['description'] . "\n";
- }
-}
+$action = $argv[1];
+$extension = isset($argv[2]) ? $argv[2] : null;
+require __DIR__ . '/../phpbb/event/php_exporter.' . $phpEx;
+require __DIR__ . '/../phpbb/event/md_exporter.' . $phpEx;
+require __DIR__ . '/../phpbb/event/recursive_event_filter_iterator.' . $phpEx;
+require __DIR__ . '/../phpbb/recursive_dot_prefix_filter_iterator.' . $phpEx;
-function check_for_events($phpbb_root_path, $file)
+switch ($action)
{
- $events = array();
- $content = file_get_contents($phpbb_root_path . $file);
-
- if (strpos($content, "phpbb_dispatcher->trigger_event('") || strpos($content, "phpbb_dispatcher->dispatch('"))
- {
- $lines = explode("\n", $content);
- for ($i = 0, $num_lines = sizeof($lines); $i < $num_lines; $i++)
- {
- $event_line = 0;
- $found_trigger_event = strpos($lines[$i], "phpbb_dispatcher->trigger_event('");
- if ($found_trigger_event !== false)
- {
- $event_line = $i;
- $event_name = $lines[$event_line];
- $event_name = substr($event_name, $found_trigger_event + strlen("phpbb_dispatcher->trigger_event('"));
- $event_name = substr($event_name, 0, strpos($event_name, "'"));
+ case 'all':
+ echo '__FORCETOC__' . "\n";
- $current_line = trim($lines[$event_line]);
- $arguments = array();
- $found_inline_array = strpos($current_line, "', compact(array('");
- if ($found_inline_array !== false)
- {
- $varsarray = substr($current_line, $found_inline_array + strlen("', compact(array('"), -6);
- $arguments = explode("', '", $varsarray);
- }
-
- if (empty($arguments))
- {
- // Find $vars array lines
- $find_varsarray_line = 1;
- while (strpos($lines[$event_line - $find_varsarray_line], "vars = array('") === false)
- {
- $find_varsarray_line++;
-
- if ($find_varsarray_line > min(50, $event_line))
- {
- throw new LogicException('Can not find "$vars = array()"-line for event "' . $event_name . '" in file "' . $file . '"');
- }
- }
- $varsarray = substr(trim($lines[$event_line - $find_varsarray_line]), strlen("\$vars = array('"), -3);
- $arguments = explode("', '", $varsarray);
- }
-
- // Validate $vars array with @var
- $find_vars_line = 3;
- $doc_vars = array();
- while (strpos(trim($lines[$event_line - $find_vars_line]), '*') === 0)
- {
- $var_line = trim($lines[$event_line - $find_vars_line]);
- $var_line = preg_replace('!\s+!', ' ', $var_line);
- if (strpos($var_line, '* @var ') === 0)
- {
- $doc_line = explode(' ', $var_line);
- if (isset($doc_line[3]))
- {
- $doc_vars[] = $doc_line[3];
- }
- }
- $find_vars_line++;
- }
- if (sizeof($arguments) !== sizeof($doc_vars) && array_intersect($arguments, $doc_vars))
- {
- throw new LogicException('$vars array does not match the list of @var tags for event "' . $event_name . '" in file "' . $file . '"');
- }
- }
- $found_dispatch = strpos($lines[$i], "phpbb_dispatcher->dispatch('");
- if ($found_dispatch !== false)
- {
- $event_line = $i;
- $event_name = $lines[$event_line];
- $event_name = substr($event_name, $found_dispatch + strlen("phpbb_dispatcher->dispatch('"));
- $event_name = substr($event_name, 0, strpos($event_name, "'"));
- $arguments = array();
- }
-
- if ($event_line)
- {
- // Validate @event name
- $find_event_line = 1;
- while (strpos($lines[$event_line - $find_event_line], '* @event ') === false)
- {
- $find_event_line++;
-
- if ($find_event_line > min(50, $event_line))
- {
- throw new LogicException('Can not find @event tag for event "' . $event_name . '" in file "' . $file . '"');
- }
- }
- $event_name_tag = substr(trim($lines[$event_line - $find_event_line]), strlen('* @event '));
- if ($event_name_tag !== $event_name)
- {
- throw new LogicException('Event name does not match @event tag for event "' . $event_name . '" in file "' . $file . '"');
- }
-
- // Find @since
- $find_since_line = 1;
- while (strpos($lines[$event_line - $find_since_line], '* @since ') === false)
- {
- $find_since_line++;
-
- if ($find_since_line > min(50, $event_line))
- {
- throw new LogicException('Can not find @since tag for event "' . $event_name . '" in file "' . $file . '"');
- }
- }
- $since = substr(trim($lines[$event_line - $find_since_line]), strlen('* @since '));
- $since = ($since == '3.1-A1') ? '3.1.0-a1' : $since;
-
- // Find event description line
- $find_description_line = 3;
- while (strpos(trim($lines[$event_line - $find_description_line]), '*') === 0)
- {
- $find_description_line++;
-
- if ($find_description_line > min(50, $event_line))
- {
- throw new LogicException('Can not find description-line for event "' . $event_name . '" in file "' . $file . '"');
- }
- }
- $description = substr(trim($lines[$event_line - $find_description_line + 1]), strlen('* '));
+ case 'php':
+ $exporter = new \phpbb\event\php_exporter($phpbb_root_path, $extension);
+ $exporter->crawl_phpbb_directory_php();
+ echo $exporter->export_events_for_wiki();
- $events[$event_name] = array(
- 'event' => $event_name,
- 'file' => $file,
- 'arguments' => $arguments,
- 'since' => $since,
- 'description' => $description,
- );
- }
+ if ($action === 'php')
+ {
+ break;
}
- }
-
- return $events;
-}
+ echo "\n";
+ // no break;
-/**
-* Returns a list of files in that directory
-*
-* Works recursive with any depth
-*
-* @param string $dir Directory to go through
-* @return array List of files (including directories from within $dir
-*/
-function get_file_list($dir, $path = '')
-{
- try
- {
- $iterator = new \DirectoryIterator($dir);
- }
- catch (Exception $e)
- {
- return array();
- }
+ case 'styles':
+ $exporter = new \phpbb\event\md_exporter($phpbb_root_path, $extension);
+ $exporter->crawl_phpbb_directory_styles('docs/events.md');
+ echo $exporter->export_events_for_wiki();
- $files = array();
- foreach ($iterator as $file_info)
- {
- if ($file_info->isDot())
+ if ($action === 'styles')
{
- continue;
+ break;
}
+ echo "\n";
+ // no break;
- // Do not scan some directories
- if ($file_info->isDir() && (
- ($path == '' && in_array($file_info->getFilename(), array('cache', 'develop', 'ext', 'files', 'language', 'store', 'vendor')))
- || ($path == '/includes' && in_array($file_info->getFilename(), array('utf')))
- || ($path == '/phpbb/db/migration' && in_array($file_info->getFilename(), array('data')))
- || ($path == '/phpbb' && in_array($file_info->getFilename(), array('event')))
- ))
- {
- continue;
- }
- else if ($file_info->isDir())
- {
- $sub_dir = get_file_list($file_info->getPath() . '/' . $file_info->getFilename(), $path . '/' . $file_info->getFilename());
- foreach ($sub_dir as $file)
- {
- $files[] = $file_info->getFilename() . '/' . $file;
- }
- }
- else if (substr($file_info->getFilename(), -4) == '.php')
+ case 'adm':
+ $exporter = new \phpbb\event\md_exporter($phpbb_root_path, $extension);
+ $exporter->crawl_phpbb_directory_adm('docs/events.md');
+ echo $exporter->export_events_for_wiki();
+
+ if ($action === 'all')
{
- $files[] = $file_info->getFilename();
+ echo "\n" . '[[Category:Events and Listeners]]' . "\n";
}
- }
-
- return $files;
-}
-
-function validate_argument_count($arguments, $count)
-{
- if ($arguments <= $count)
- {
- usage();
- }
-}
-
-validate_argument_count($argc, 1);
-
-$action = $argv[1];
-
-switch ($action)
-{
- case 'acp':
- export_from_eventsmd($phpbb_root_path, 'acp');
- break;
-
- case 'styles':
- export_from_eventsmd($phpbb_root_path, 'styles');
- break;
-
- case 'php':
- export_from_php($phpbb_root_path);
- break;
+ break;
default:
usage();
diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md
index 6897c3f22e..a1637046cc 100644
--- a/phpBB/docs/events.md
+++ b/phpBB/docs/events.md
@@ -66,13 +66,13 @@ acp_simple_header_body_before
acp_simple_header_head_append
===
-* Location: adm/style/overall_header.html
+* Location: adm/style/simple_header.html
* Since: 3.1.0-a1
* Purpose: Add assets within the `<head>` tags in the simple header of the ACP
acp_users_overview_options_append
===
-* Location: adm/style/acp_users.html
+* Location: adm/style/acp_users_overview.html
* Since: 3.1.0-a1
* Purpose: Add options and settings on user overview page
@@ -91,7 +91,7 @@ acp_users_signature_editor_buttons_before
* Purpose: Add content before BBCode posting buttons in the ACP user signature
forumlist_body_category_header_after
-====
+===
* Locations:
+ styles/prosilver/template/forumlist_body.html
+ styles/subsilver2/template/forumlist_body.html
@@ -99,7 +99,7 @@ forumlist_body_category_header_after
* Purpose: Add content after the header of the category on the forum list.
forumlist_body_category_header_before
-====
+===
* Locations:
+ styles/prosilver/template/forumlist_body.html
+ styles/subsilver2/template/forumlist_body.html
@@ -107,7 +107,7 @@ forumlist_body_category_header_before
* Purpose: Add content before the header of the category on the forum list.
forumlist_body_last_post_title_prepend
-====
+===
* Locations:
+ styles/prosilver/template/forumlist_body.html
+ styles/subsilver2/template/forumlist_body.html
@@ -115,7 +115,7 @@ forumlist_body_last_post_title_prepend
* Purpose: Add content before the post title of the latest post in a forum on the forum list.
forumlist_body_subforums_after
-====
+===
* Locations:
+ styles/prosilver/template/forumlist_body.html
+ styles/subsilver2/template/forumlist_body.html
@@ -123,7 +123,7 @@ forumlist_body_subforums_after
* Purpose: Add content after the list of subforums (if any) for each forum on the forum list.
forumlist_body_subforums_before
-====
+===
* Locations:
+ styles/prosilver/template/forumlist_body.html
+ styles/subsilver2/template/forumlist_body.html
@@ -131,7 +131,7 @@ forumlist_body_subforums_before
* Purpose: Add content before the list of subforums (if any) for each forum on the forum list.
forumlist_body_last_row_after
-====
+===
* Locations:
+ styles/prosilver/template/forumlist_body.html
+ styles/subsilver2/template/forumlist_body.html
@@ -275,6 +275,38 @@ overall_footer_page_body_after
* Since: 3.1.0-b3
* Purpose: Add content after the page-body, but before the footer
+overall_footer_teamlink_after
+===
+* Locations:
+ + styles/prosilver/template/navbar_footer.html
+ + styles/subsilver2/template/index_body.html
+* Since: 3.1.0-b3
+* Purpose: Add contents after the team-link in the footer
+
+overall_footer_teamlink_before
+===
+* Locations:
+ + styles/prosilver/template/navbar_footer.html
+ + styles/subsilver2/template/index_body.html
+* Since: 3.1.0-b3
+* Purpose: Add contents before the team-link in the footer
+
+overall_footer_timezone_after
+===
+* Locations:
+ + styles/prosilver/template/navbar_footer.html
+ + styles/subsilver2/template/breadcrumbs.html
+* Since: 3.1.0-b3
+* Purpose: Add content to the navbar in the page footer, after "Timezone"
+
+overall_footer_timezone_before
+===
+* Locations:
+ + styles/prosilver/template/navbar_footer.html
+ + styles/subsilver2/template/breadcrumbs.html
+* Since: 3.1.0-b3
+* Purpose: Add content to the navbar in the page footer, before "Timezone"
+
overall_header_body_before
===
* Locations:
@@ -423,6 +455,7 @@ simple_footer_after
===
* Locations:
+ styles/prosilver/template/simple_footer.html
+ + styles/subsilver2/template/simple_footer.html
* Since: 3.1.0-a1
* Purpose: Add content directly prior to the `</body>` tag of the simple footer
@@ -454,6 +487,22 @@ topiclist_row_append
* Since: 3.1.0-a1
* Purpose: Add content into topic rows (inside the elements containing topic titles)
+ucp_pm_viewmessage_contact_fields_after
+===
+* Locations:
+ + styles/prosilver/template/ucp_pm_viewmessage.html
+* Since: 3.1.0-b1
+* Purpose: Add data after the contact fields on the user profile when viewing
+a private message
+
+ucp_pm_viewmessage_contact_fields_before
+===
+* Locations:
+ + styles/prosilver/template/ucp_pm_viewmessage.html
+* Since: 3.1.0-b1
+* Purpose: Add data before the contact fields on the user profile when viewing
+a private message
+
ucp_pm_viewmessage_custom_fields_after
===
* Locations:
@@ -549,16 +598,16 @@ Display Options screen
ucp_friend_list_before
===
* Locations:
- + styles/prosilver/template/ucp_zebra_friends.html
- + styles/subsilver2/template/ucp_zebra_friends.html
+ + styles/prosilver/template/ucp_zebra_friends.html
+ + styles/subsilver2/template/ucp_zebra_friends.html
* Since: 3.1.0-a4
* Purpose: Add optional elements before list of friends in UCP
ucp_friend_list_after
===
* Locations:
- + styles/prosilver/template/ucp_zebra_friends.html
- + styles/subsilver2/template/ucp_zebra_friends.html
+ + styles/prosilver/template/ucp_zebra_friends.html
+ + styles/subsilver2/template/ucp_zebra_friends.html
* Since: 3.1.0-a4
* Purpose: Add optional elements after list of friends in UCP
diff --git a/phpBB/feed.php b/phpBB/feed.php
index c31a6b6b1d..9ff8c66b9d 100644
--- a/phpBB/feed.php
+++ b/phpBB/feed.php
@@ -37,7 +37,7 @@ if (!empty($config['feed_http_auth']) && request_var('auth', '') == 'http')
}
$auth->acl($user->data);
-$user->setup();
+$user->setup('viewtopic');
// Initial var setup
$forum_id = request_var('f', 0);
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php
index f68fd76587..1aaf1f9c09 100644
--- a/phpBB/includes/acp/acp_attachments.php
+++ b/phpBB/includes/acp/acp_attachments.php
@@ -147,7 +147,6 @@ class acp_attachments
'secure_allow_empty_referer' => array('lang' => 'SECURE_EMPTY_REFERRER', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'check_attachment_content' => array('lang' => 'CHECK_CONTENT', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
-
'legend2' => $l_legend_cat_images,
'img_display_inlined' => array('lang' => 'DISPLAY_INLINED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'img_create_thumbnail' => array('lang' => 'CREATE_THUMBNAIL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
@@ -1115,11 +1114,6 @@ class acp_attachments
if ($stats_error)
{
$error[] = $stats_error;
-
- // Show option to resync stats
- $this->template->assign_vars(array(
- 'S_ACTION_OPTIONS' => $auth->acl_get('a_board'),
- ));
}
$template->assign_vars(array(
@@ -1292,7 +1286,7 @@ class acp_attachments
/**
* Set config attachment stat values
*
- * @param $stats array Array of config key => value pairs to set.
+ * @param $stats array Array of config key => value pairs to set.
* @return null
*/
public function set_attachment_stats($stats)
@@ -1306,7 +1300,7 @@ class acp_attachments
/**
* Check accuracy of attachment statistics.
*
- * @param $resync bool Resync stats if they're incorrect.
+ * @param $resync bool Resync stats if they're incorrect.
* @return bool|string Returns false if stats are correct or error message
* otherwise.
*/
@@ -1317,11 +1311,19 @@ class acp_attachments
// Get current files stats
$num_files = (int) $this->config['num_files'];
- $total_size = (float) $this->config['upload_dir_size'];
+ $total_size = (float) $this->config['upload_dir_size'];
if (($num_files != $stats['num_files']) || ($total_size != $stats['upload_dir_size']))
{
- return $this->user->lang('FILES_STATS_WRONG', (int) $stats['num_files'], get_formatted_filesize($stats['upload_dir_size']));
+ $u_resync = $this->u_action . '&amp;action=stats';
+
+ return $this->user->lang(
+ 'FILES_STATS_WRONG',
+ (int) $stats['num_files'],
+ get_formatted_filesize($stats['upload_dir_size']),
+ '<a href="' . $u_resync . '">',
+ '</a>'
+ );
}
return false;
}
diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php
index 3ed9c225f5..41095f1382 100644
--- a/phpBB/includes/acp/acp_ban.php
+++ b/phpBB/includes/acp/acp_ban.php
@@ -109,7 +109,7 @@ class acp_ban
'L_NO_BAN_CELL' => $l_no_ban_cell,
'S_USERNAME_BAN' => ($mode == 'user') ? true : false,
-
+
'U_ACTION' => $this->u_action,
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=acp_ban&amp;field=ban'),
));
diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php
index 84382b6276..4b9072d12a 100644
--- a/phpBB/includes/acp/acp_bbcodes.php
+++ b/phpBB/includes/acp/acp_bbcodes.php
@@ -142,7 +142,7 @@ class acp_bbcodes
case 'create':
$sql_ary = $hidden_fields = array();
-
+
/**
* Modify custom bbcode data before the modify/create action
*
@@ -159,7 +159,16 @@ class acp_bbcodes
* submitting form when $warn_text is true
* @since 3.1.0-a3
*/
- $vars = array('action', 'sql_ary', 'bbcode_id', 'display_on_posting', 'bbcode_match', 'bbcode_tpl', 'bbcode_helpline', 'hidden_fields');
+ $vars = array(
+ 'action',
+ 'sql_ary',
+ 'bbcode_id',
+ 'display_on_posting',
+ 'bbcode_match',
+ 'bbcode_tpl',
+ 'bbcode_helpline',
+ 'hidden_fields',
+ );
extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_modify_create', compact($vars)));
$warn_text = preg_match('%<[^>]*\{text[\d]*\}[^>]*>%i', $bbcode_tpl);
@@ -210,7 +219,6 @@ class acp_bbcodes
trigger_error($user->lang['BBCODE_TAG_DEF_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING);
}
-
if (strlen($bbcode_helpline) > 255)
{
trigger_error($user->lang['BBCODE_HELPLINE_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING);
@@ -311,7 +319,7 @@ class acp_bbcodes
$db->sql_query('DELETE FROM ' . BBCODES_TABLE . " WHERE bbcode_id = $bbcode_id");
$cache->destroy('sql', BBCODES_TABLE);
add_log('admin', 'LOG_BBCODE_DELETE', $row['bbcode_tag']);
-
+
if ($request->is_ajax())
{
$json_response = new \phpbb\json_response;
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 2c0eb95cd5..6b52fbbdb2 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -434,6 +434,7 @@ class acp_board
'email_function_name' => array('lang' => 'EMAIL_FUNCTION_NAME', 'validate' => 'string', 'type' => 'text:20:50', 'explain' => true),
'email_package_size' => array('lang' => 'EMAIL_PACKAGE_SIZE', 'validate' => 'int:0', 'type' => 'number:0:99999', 'explain' => true),
'board_contact' => array('lang' => 'CONTACT_EMAIL', 'validate' => 'email', 'type' => 'email:25:100', 'explain' => true),
+ 'board_contact_name' => array('lang' => 'CONTACT_EMAIL_NAME', 'validate' => 'string', 'type' => 'text:25:50', 'explain' => true),
'board_email' => array('lang' => 'ADMIN_EMAIL', 'validate' => 'email', 'type' => 'email:25:100', 'explain' => true),
'board_email_sig' => array('lang' => 'EMAIL_SIG', 'validate' => 'string', 'type' => 'textarea:5:30', 'explain' => true),
'board_hide_emails' => array('lang' => 'BOARD_HIDE_EMAILS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php
index e28a8d6451..7384f719bf 100644
--- a/phpBB/includes/acp/acp_bots.php
+++ b/phpBB/includes/acp/acp_bots.php
@@ -157,7 +157,7 @@ class acp_bots
{
$error[] = $user->lang['ERR_BOT_NO_MATCHES'];
}
-
+
if ($bot_row['bot_ip'] && !preg_match('#^[\d\.,:]+$#', $bot_row['bot_ip']))
{
if (!$ip_list = gethostbynamel($bot_row['bot_ip']))
@@ -176,7 +176,7 @@ class acp_bots
{
$error[] = $user->lang['ERR_BOT_AGENT_MATCHES_UA'];
}
-
+
$bot_name = false;
if ($bot_id)
{
@@ -201,7 +201,7 @@ class acp_bots
{
$error[] = $user->lang['BOT_NAME_TAKEN'];
}
-
+
if (!sizeof($error))
{
// New bot? Create a new user and group entry
@@ -219,7 +219,6 @@ class acp_bots
{
trigger_error($user->lang['NO_BOT_GROUP'] . adm_back_link($this->u_action . "&amp;id=$bot_id&amp;action=$action"), E_USER_WARNING);
}
-
$user_id = user_add(array(
'user_type' => (int) USER_IGNORE,
@@ -233,7 +232,7 @@ class acp_bots
'user_style' => (int) $bot_row['bot_style'],
'user_allow_massemail' => 0,
));
-
+
$sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $db->sql_build_array('INSERT', array(
'user_id' => (int) $user_id,
'bot_name' => (string) $bot_row['bot_name'],
@@ -242,7 +241,7 @@ class acp_bots
'bot_ip' => (string) $bot_row['bot_ip'])
);
$db->sql_query($sql);
-
+
$log = 'ADDED';
}
else if ($bot_id)
@@ -289,12 +288,12 @@ class acp_bots
$log = 'UPDATED';
}
-
+
$cache->destroy('_bots');
-
+
add_log('admin', 'LOG_BOT_' . $log, $bot_row['bot_name']);
trigger_error($user->lang['BOT_' . $log] . adm_back_link($this->u_action));
-
+
}
}
else if ($bot_id)
@@ -335,11 +334,11 @@ class acp_bots
'U_ACTION' => $this->u_action . "&amp;id=$bot_id&amp;action=$action",
'U_BACK' => $this->u_action,
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
-
+
'BOT_NAME' => $bot_row['bot_name'],
'BOT_IP' => $bot_row['bot_ip'],
'BOT_AGENT' => $bot_row['bot_agent'],
-
+
'S_EDIT_BOT' => true,
'S_ACTIVE_OPTIONS' => $s_active_options,
'S_STYLE_OPTIONS' => $style_select,
@@ -352,7 +351,7 @@ class acp_bots
break;
}
-
+
if ($request->is_ajax() && ($action == 'activate' || $action == 'deactivate'))
{
$json_response = new \phpbb\json_response;
@@ -397,7 +396,7 @@ class acp_bots
}
$db->sql_freeresult($result);
}
-
+
/**
* Validate bot name against username table
*/
@@ -417,7 +416,7 @@ class acp_bots
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
-
+
return ($row) ? false : true;
}
}
diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php
index 1a083c20ac..71defda09f 100644
--- a/phpBB/includes/acp/acp_captcha.php
+++ b/phpBB/includes/acp/acp_captcha.php
@@ -36,7 +36,6 @@ class acp_captcha
$selected = (isset($captchas['available'][$selected]) || isset($captchas['unavailable'][$selected])) ? $selected : $config['captcha_plugin'];
$configure = request_var('configure', false);
-
// Oh, they are just here for the view
if (isset($_GET['captcha_demo']))
{
diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php
index 8afc3709b9..d28ee5b067 100644
--- a/phpBB/includes/acp/acp_database.php
+++ b/phpBB/includes/acp/acp_database.php
@@ -1180,7 +1180,6 @@ class postgres_extractor extends base_extractor
}
$db->sql_freeresult($result);
-
// Get the listing of primary keys.
$sql_pri_keys = "SELECT ic.relname as index_name, bc.relname as tab_name, ta.attname as column_name, i.indisunique as unique_key, i.indisprimary as primary_key
FROM pg_class bc, pg_class ic, pg_index i, pg_attribute ta, pg_attribute ia
@@ -1280,7 +1279,6 @@ class postgres_extractor extends base_extractor
$ary_type[] = pg_field_type($result, $i);
$ary_name[] = pg_field_name($result, $i);
-
$sql = "SELECT pg_get_expr(d.adbin, d.adrelid) as rowdefault
FROM pg_attrdef d, pg_class c
WHERE (c.relname = '{$table_name}')
diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php
index 1de6987624..21a1909ac1 100644
--- a/phpBB/includes/acp/acp_extensions.php
+++ b/phpBB/includes/acp/acp_extensions.php
@@ -242,7 +242,7 @@ class acp_extensions
public function list_enabled_exts(\phpbb\extension\manager $phpbb_extension_manager)
{
$enabled_extension_meta_data = array();
-
+
foreach ($phpbb_extension_manager->all_enabled() as $name => $location)
{
$md_manager = $phpbb_extension_manager->create_extension_metadata_manager($name, $this->template);
@@ -284,7 +284,7 @@ class acp_extensions
public function list_disabled_exts(\phpbb\extension\manager $phpbb_extension_manager)
{
$disabled_extension_meta_data = array();
-
+
foreach ($phpbb_extension_manager->all_disabled() as $name => $location)
{
$md_manager = $phpbb_extension_manager->create_extension_metadata_manager($name, $this->template);
@@ -329,7 +329,7 @@ class acp_extensions
$uninstalled = array_diff_key($phpbb_extension_manager->all_available(), $phpbb_extension_manager->all_configured());
$available_extension_meta_data = array();
-
+
foreach ($uninstalled as $name => $location)
{
$md_manager = $phpbb_extension_manager->create_extension_metadata_manager($name, $this->template);
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index c47d9bc185..160bfc05de 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -158,7 +158,7 @@ class acp_forums
* @event core.acp_manage_forums_request_data
* @var string action Type of the action: add|edit
* @var array forum_data Array with new forum data
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('action', 'forum_data');
extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_request_data', compact($vars)));
@@ -484,7 +484,7 @@ class acp_forums
* empty when creating new forum
* @var array forum_data Array with new forum data
* @var string parents_list List of parent options
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('action', 'update', 'forum_id', 'row', 'forum_data', 'parents_list');
extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_initialise_data', compact($vars)));
@@ -705,9 +705,18 @@ class acp_forums
* ensure to update the template variables
* S_ERROR and ERROR_MSG to display it
* @var array template_data Array with new forum data
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
- $vars = array('action', 'update', 'forum_id', 'row', 'forum_data', 'parents_list', 'errors', 'template_data');
+ $vars = array(
+ 'action',
+ 'update',
+ 'forum_id',
+ 'row',
+ 'forum_data',
+ 'parents_list',
+ 'errors',
+ 'template_data',
+ );
extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_display_form', compact($vars)));
$template->assign_vars($template_data);
@@ -946,7 +955,7 @@ class acp_forums
* @var array forum_data Array with new forum data
* @var array errors Array of errors, should be strings and not
* language key.
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('forum_data', 'errors');
extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_validate_data', compact($vars)));
@@ -1054,7 +1063,7 @@ class acp_forums
* @var array forum_data_sql Array with data we are going to update
* If forum_data_sql[forum_id] is set, we update
* that forum, otherwise a new one is created.
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('forum_data', 'forum_data_sql');
extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_update_data_before', compact($vars)));
@@ -1347,7 +1356,7 @@ class acp_forums
* ensure to set forum_data_sql[forum_id]
* @var array errors Array of errors, should be strings and not
* language key.
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('forum_data', 'forum_data_sql', 'is_new_forum', 'errors');
extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_update_data_after', compact($vars)));
@@ -1385,7 +1394,7 @@ class acp_forums
* @var int to_id If of the new parent forum
* @var array errors Array of errors, should be strings and not
* language key.
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('from_id', 'to_id', 'errors');
extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_move_children', compact($vars)));
@@ -1489,7 +1498,7 @@ class acp_forums
* @var array errors Array of errors, should be strings and not
* language key. If this array is not empty,
* The content will not be moved.
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('from_id', 'to_id', 'sync', 'errors');
extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_move_content', compact($vars)));
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php
index 7ecedcf51e..c52289aa72 100644
--- a/phpBB/includes/acp/acp_groups.php
+++ b/phpBB/includes/acp/acp_groups.php
@@ -53,7 +53,6 @@ class acp_groups
$start = request_var('start', 0);
$update = (isset($_POST['update'])) ? true : false;
-
// Clear some vars
$group_row = array();
@@ -140,7 +139,7 @@ class acp_groups
if (confirm_box(true))
{
$group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'];
- group_user_attributes('default', $group_id, $mark_ary, false, $group_name, $group_row);
+ group_user_attributes('default', $group_id, $mark_ary, false, $group_name, $group_row);
trigger_error($user->lang['GROUP_DEFS_UPDATED'] . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id));
}
else
@@ -331,7 +330,6 @@ class acp_groups
}
}
-
// Did we submit?
if ($update)
{
diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php
index 20b1f56182..9c7acf506c 100644
--- a/phpBB/includes/acp/acp_icons.php
+++ b/phpBB/includes/acp/acp_icons.php
@@ -203,7 +203,6 @@ class acp_icons
unset($_images[$row[$fields . '_url']]);
}
-
if ($row[$fields . '_id'] == $icon_id)
{
$after = true;
@@ -781,7 +780,7 @@ class acp_icons
$cache->destroy('_icons');
$cache->destroy('sql', $table);
-
+
if ($request->is_ajax())
{
$json_response = new \phpbb\json_response;
diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php
index 10852e3a68..2c795bb77b 100644
--- a/phpBB/includes/acp/acp_logs.php
+++ b/phpBB/includes/acp/acp_logs.php
@@ -118,7 +118,7 @@ class acp_logs
if ($mode == 'mod')
{
$forum_box = '<option value="0">' . $user->lang['ALL_FORUMS'] . '</option>' . make_forum_select($forum_id);
-
+
$template->assign_vars(array(
'S_SHOW_FORUMS' => true,
'S_FORUM_BOX' => $forum_box)
@@ -149,7 +149,7 @@ class acp_logs
foreach ($log_data as $row)
{
$data = array();
-
+
$checks = array('viewtopic', 'viewlogs', 'viewforum');
foreach ($checks as $check)
{
diff --git a/phpBB/includes/acp/acp_permission_roles.php b/phpBB/includes/acp/acp_permission_roles.php
index aca45575d3..812e22a025 100644
--- a/phpBB/includes/acp/acp_permission_roles.php
+++ b/phpBB/includes/acp/acp_permission_roles.php
@@ -270,7 +270,7 @@ class acp_permission_roles
case 'edit':
if ($action == 'edit')
- {
+ {
$sql = 'SELECT *
FROM ' . ACL_ROLES_TABLE . '
WHERE role_id = ' . $role_id;
diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php
index e7dc03db5c..1924e2075b 100644
--- a/phpBB/includes/acp/acp_permissions.php
+++ b/phpBB/includes/acp/acp_permissions.php
@@ -330,7 +330,6 @@ class acp_permissions
}
}
-
// Setting permissions screen
$s_hidden_fields = build_hidden_fields(array(
'user_id' => $user_id,
diff --git a/phpBB/includes/acp/acp_php_info.php b/phpBB/includes/acp/acp_php_info.php
index 125b77529f..13d2fd770a 100644
--- a/phpBB/includes/acp/acp_php_info.php
+++ b/phpBB/includes/acp/acp_php_info.php
@@ -81,7 +81,7 @@ class acp_php_info
$template->assign_var('PHPINFO', $output);
}
-
+
function remove_spaces($matches)
{
return '<a name="' . str_replace(' ', '_', $matches[1]) . '">';
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index 4d316d84e4..b42b852fba 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -485,7 +485,6 @@ class acp_profile
}
$db->sql_freeresult($result);
-
$sql = 'SELECT lang_id, lang_name, lang_explain, lang_default_value
FROM ' . PROFILE_LANG_TABLE . '
WHERE lang_id <> ' . $this->edit_lang_id . "
@@ -1116,7 +1115,6 @@ class acp_profile
}
}
-
$db->sql_transaction('begin');
if ($action == 'create')
diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php
index d0e5dfb5f4..3850e7efe7 100644
--- a/phpBB/includes/acp/acp_prune.php
+++ b/phpBB/includes/acp/acp_prune.php
@@ -79,7 +79,7 @@ class acp_prune
$prune_posted = request_var('prune_days', 0);
$prune_viewed = request_var('prune_vieweddays', 0);
$prune_all = (!$prune_posted && !$prune_viewed) ? true : false;
-
+
$prune_flags = 0;
$prune_flags += (request_var('prune_old_polls', 0)) ? 2 : 0;
$prune_flags += (request_var('prune_announce', 0)) ? 4 : 0;
@@ -109,7 +109,7 @@ class acp_prune
$p_result['topics'] = 0;
$p_result['posts'] = 0;
$log_data = '';
-
+
do
{
if (!$auth->acl_get('f_list', $row['forum_id']))
@@ -129,7 +129,7 @@ class acp_prune
$p_result['topics'] += $return['topics'];
$p_result['posts'] += $return['posts'];
}
-
+
if ($prune_viewed)
{
$return = prune($row['forum_id'], 'viewed', $prunedate_viewed, $prune_flags, false);
@@ -145,11 +145,11 @@ class acp_prune
'NUM_TOPICS' => $p_result['topics'],
'NUM_POSTS' => $p_result['posts'])
);
-
+
$log_data .= (($log_data != '') ? ', ' : '') . $row['forum_name'];
}
while ($row = $db->sql_fetchrow($result));
-
+
// Sync all pruned forums at once
sync('forum', 'forum_id', $prune_ids, true, true);
add_log('admin', 'LOG_PRUNE', $log_data);
@@ -256,7 +256,7 @@ class acp_prune
if ($deleteposts)
{
user_delete('remove', $user_ids);
-
+
$l_log = 'LOG_PRUNE_USER_DEL_DEL';
}
else
@@ -444,7 +444,7 @@ class acp_prune
if (sizeof($active) && (int) $active[0] == 0 && (int) $active[1] == 0 && (int) $active[2] == 0)
{
$where_sql .= ' AND user_lastvisit = 0';
- }
+ }
else if (sizeof($active) && $active_select != 'lt')
{
$where_sql .= ' AND user_lastvisit ' . $key_match[$active_select] . ' ' . gmmktime(0, 0, 0, (int) $active[1], (int) $active[2], (int) $active[0]);
@@ -533,7 +533,7 @@ class acp_prune
WHERE u.user_id <> ' . ANONYMOUS . '
AND u.user_type <> ' . USER_FOUNDER .
((!empty($user_ids)) ? 'AND ' . $db->sql_in_set('p.poster_id', $user_ids) : '') . '
- AND p.post_visibility = ' . ITEM_UNAPPROVED . '
+ AND ' . $db->sql_in_set('p.post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE)) . '
AND u.user_id = p.poster_id
GROUP BY p.poster_id
HAVING queue_posts ' . $key_match[$queue_select] . ' ' . $posts_on_queue;
diff --git a/phpBB/includes/acp/acp_ranks.php b/phpBB/includes/acp/acp_ranks.php
index 73e1de44d9..55028cc882 100644
--- a/phpBB/includes/acp/acp_ranks.php
+++ b/phpBB/includes/acp/acp_ranks.php
@@ -214,7 +214,6 @@ class acp_ranks
'MIN_POSTS' => (isset($ranks['rank_min']) && !$ranks['rank_special']) ? $ranks['rank_min'] : 0)
);
-
return;
break;
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index a720334ed2..de8f1b48c6 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -657,6 +657,7 @@ class acp_users
{
if ($topic_id_ary[$row['topic_id']][ITEM_APPROVED] == $row['topic_posts_approved']
&& $topic_id_ary[$row['topic_id']][ITEM_UNAPPROVED] == $row['topic_posts_unapproved']
+ && $topic_id_ary[$row['topic_id']][ITEM_REAPPROVE] == $row['topic_posts_unapproved']
&& $topic_id_ary[$row['topic_id']][ITEM_DELETED] == $row['topic_posts_softdeleted'])
{
$move_topic_ary[] = $row['topic_id'];
@@ -735,7 +736,6 @@ class acp_users
sync('forum', 'forum_id', $forum_id_ary, false, true);
}
-
add_log('admin', 'LOG_USER_MOVE_POSTS', $user_row['username'], $forum_info['forum_name']);
add_log('user', $user_id, 'LOG_USER_MOVE_POSTS_USER', $forum_info['forum_name']);
@@ -772,7 +772,7 @@ class acp_users
* @event core.acp_users_overview_run_quicktool
* @var array user_row Current user data
* @var string action Quick tool that should be run
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('action', 'user_row');
extract($phpbb_dispatcher->trigger_event('core.acp_users_overview_run_quicktool', compact($vars)));
@@ -893,7 +893,7 @@ class acp_users
* @var array user_row Current user data
* @var array data Submitted user data
* @var array sql_ary User data we udpate
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('user_row', 'data', 'sql_ary');
extract($phpbb_dispatcher->trigger_event('core.acp_users_overview_modify_data', compact($vars)));
@@ -1008,7 +1008,7 @@ class acp_users
* @event core.acp_users_display_overview
* @var array user_row Array with user data
* @var array quick_tool_ary Ouick tool options
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('user_row', 'quick_tool_ary');
extract($phpbb_dispatcher->trigger_event('core.acp_users_display_overview', compact($vars)));
@@ -1050,7 +1050,7 @@ class acp_users
$sql = 'SELECT COUNT(post_id) as posts_in_queue
FROM ' . POSTS_TABLE . '
WHERE poster_id = ' . $user_id . '
- AND post_visibility = ' . ITEM_UNAPPROVED;
+ AND ' . $db->sql_in_set('post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE));
$result = $db->sql_query($sql);
$user_row['posts_in_queue'] = (int) $db->sql_fetchfield('posts_in_queue');
$db->sql_freeresult($result);
@@ -1329,7 +1329,6 @@ class acp_users
}
}
-
$template->assign_block_vars('warn', array(
'ID' => $row['warning_id'],
'USERNAME' => ($row['log_operation']) ? get_username_string('full', $row['mod_user_id'], $row['mod_username'], $row['mod_user_colour']) : '-',
@@ -1379,7 +1378,6 @@ class acp_users
$data['bday_year'] = request_var('bday_year', $data['bday_year']);
$data['user_birthday'] = sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']);
-
if ($submit)
{
$error = validate_data($data, array(
@@ -1503,6 +1501,17 @@ class acp_users
'notify' => request_var('notify', $user_row['user_notify']),
);
+ /**
+ * Modify users preferences data
+ *
+ * @event core.acp_users_prefs_modify_data
+ * @var array data Array with users preferences data
+ * @var array user_row Array with user data
+ * @since 3.1.0-b3
+ */
+ $vars = array('data', 'user_row');
+ extract($phpbb_dispatcher->trigger_event('core.acp_users_prefs_modify_data', compact($vars)));
+
if ($submit)
{
$error = validate_data($data, array(
@@ -1559,37 +1568,53 @@ class acp_users
'user_notify' => $data['notify'],
);
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
- WHERE user_id = $user_id";
- $db->sql_query($sql);
+ /**
+ * Modify SQL query before users preferences are updated
+ *
+ * @event core.acp_users_prefs_modify_sql
+ * @var array data Array with users preferences data
+ * @var array user_row Array with user data
+ * @var array sql_ary SQL array with users preferences data to update
+ * @var array error Array with errors data
+ * @since 3.1.0-b3
+ */
+ $vars = array('data', 'user_row', 'sql_ary', 'error');
+ extract($phpbb_dispatcher->trigger_event('core.acp_users_prefs_modify_sql', compact($vars)));
- // Check if user has an active session
- if ($user_row['session_id'])
+ if (!sizeof($error))
{
- // We'll update the session if user_allow_viewonline has changed and the user is a bot
- // Or if it's a regular user and the admin set it to hide the session
- if ($user_row['user_allow_viewonline'] != $sql_ary['user_allow_viewonline'] && $user_row['user_type'] == USER_IGNORE
- || $user_row['user_allow_viewonline'] && !$sql_ary['user_allow_viewonline'])
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
+ WHERE user_id = $user_id";
+ $db->sql_query($sql);
+
+ // Check if user has an active session
+ if ($user_row['session_id'])
{
- // We also need to check if the user has the permission to cloak.
- $user_auth = new \phpbb\auth\auth();
- $user_auth->acl($user_row);
+ // We'll update the session if user_allow_viewonline has changed and the user is a bot
+ // Or if it's a regular user and the admin set it to hide the session
+ if ($user_row['user_allow_viewonline'] != $sql_ary['user_allow_viewonline'] && $user_row['user_type'] == USER_IGNORE
+ || $user_row['user_allow_viewonline'] && !$sql_ary['user_allow_viewonline'])
+ {
+ // We also need to check if the user has the permission to cloak.
+ $user_auth = new \phpbb\auth\auth();
+ $user_auth->acl($user_row);
- $session_sql_ary = array(
- 'session_viewonline' => ($user_auth->acl_get('u_hideonline')) ? $sql_ary['user_allow_viewonline'] : true,
- );
+ $session_sql_ary = array(
+ 'session_viewonline' => ($user_auth->acl_get('u_hideonline')) ? $sql_ary['user_allow_viewonline'] : true,
+ );
- $sql = 'UPDATE ' . SESSIONS_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $session_sql_ary) . "
- WHERE session_user_id = $user_id";
- $db->sql_query($sql);
+ $sql = 'UPDATE ' . SESSIONS_TABLE . '
+ SET ' . $db->sql_build_array('UPDATE', $session_sql_ary) . "
+ WHERE session_user_id = $user_id";
+ $db->sql_query($sql);
- unset($user_auth);
+ unset($user_auth);
+ }
}
- }
- trigger_error($user->lang['USER_PREFS_UPDATED'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
+ trigger_error($user->lang['USER_PREFS_UPDATED'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
+ }
}
// Replace "error" strings with their real, localised form
@@ -1653,7 +1678,7 @@ class acp_users
}
$timezone_selects = phpbb_timezone_select($user, $data['tz'], true);
- $template->assign_vars(array(
+ $user_prefs_data = array(
'S_PREFS' => true,
'S_JABBER_DISABLED' => ($config['jab_enable'] && $user_row['user_jabber'] && @extension_loaded('xml')) ? false : true,
@@ -1693,9 +1718,22 @@ class acp_users
'S_STYLE_OPTIONS' => style_select($data['style']),
'S_TZ_OPTIONS' => $timezone_selects['tz_select'],
'S_TZ_DATE_OPTIONS' => $timezone_selects['tz_dates'],
- )
);
+ /**
+ * Modify users preferences data before assigning it to the template
+ *
+ * @event core.acp_users_prefs_modify_template_data
+ * @var array data Array with users preferences data
+ * @var array user_row Array with user data
+ * @var array user_prefs_data Array with users preferences data to be assigned to the template
+ * @since 3.1.0-b3
+ */
+ $vars = array('data', 'user_row', 'user_prefs_data');
+ extract($phpbb_dispatcher->trigger_event('core.acp_users_prefs_modify_template_data', compact($vars)));
+
+ $template->assign_vars($user_prefs_data);
+
break;
case 'avatar':
@@ -2243,7 +2281,6 @@ class acp_users
$error = array();
}
-
$sql = 'SELECT ug.*, g.*
FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . " ug
WHERE ug.user_id = $user_id
diff --git a/phpBB/includes/acp/acp_words.php b/phpBB/includes/acp/acp_words.php
index d8d14ba4ad..859b586302 100644
--- a/phpBB/includes/acp/acp_words.php
+++ b/phpBB/includes/acp/acp_words.php
@@ -101,7 +101,7 @@ class acp_words
'word' => $word,
'replacement' => $replacement
);
-
+
if ($word_id)
{
$db->sql_query('UPDATE ' . WORDS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . ' WHERE word_id = ' . $word_id);
@@ -162,7 +162,6 @@ class acp_words
break;
}
-
$template->assign_vars(array(
'U_ACTION' => $this->u_action,
'S_HIDDEN_FIELDS' => $s_hidden_fields)
diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php
index 5404efded3..c95dd1d153 100644
--- a/phpBB/includes/acp/auth.php
+++ b/phpBB/includes/acp/auth.php
@@ -139,7 +139,6 @@ class auth_admin extends \phpbb\auth\auth
$auth2 = &$auth;
}
-
$hold_ary[$userdata['user_id']] = array();
foreach ($forum_ids as $f_id)
{
diff --git a/phpBB/includes/captcha/captcha_gd.php b/phpBB/includes/captcha/captcha_gd.php
index 3a82457c4a..e7c01c040a 100644
--- a/phpBB/includes/captcha/captcha_gd.php
+++ b/phpBB/includes/captcha/captcha_gd.php
@@ -32,7 +32,7 @@ class captcha
function execute($code, $seed)
{
global $config;
-
+
mt_srand($seed);
// Create image
@@ -160,13 +160,13 @@ class captcha
function wave($img)
{
global $config;
-
+
$period_x = mt_rand(12,18);
$period_y = mt_rand(7,14);
$amp_x = mt_rand(5,10);
- $amp_y = mt_rand(2,4);
+ $amp_y = mt_rand(2,4);
$socket = mt_rand(0,100);
-
+
$dampen_x = mt_rand($this->width/5, $this->width/2);
$dampen_y = mt_rand($this->height/5, $this->height/2);
$direction_x = (mt_rand (0, 1));
@@ -185,7 +185,7 @@ class captcha
}
return $img;
}
-
+
/**
* Noise line
*/
@@ -236,7 +236,7 @@ class captcha
}
function captcha_noise_bg_bitmaps()
- {
+ {
return array(
'width' => 15,
'height' => 5,
@@ -300,7 +300,7 @@ class captcha
function captcha_bitmaps()
{
global $config;
-
+
$chars = array(
'A' => array(
array(
@@ -1681,7 +1681,7 @@ class captcha
'J' => $chars['J'][mt_rand(0, min(sizeof($chars['J']), $config['captcha_gd_fonts']) -1)],
'K' => $chars['K'][mt_rand(0, min(sizeof($chars['K']), $config['captcha_gd_fonts']) -1)],
'L' => $chars['L'][mt_rand(0, min(sizeof($chars['L']), $config['captcha_gd_fonts']) -1)],
- 'M' => $chars['M'][mt_rand(0, min(sizeof($chars['M']), $config['captcha_gd_fonts']) -1)],
+ 'M' => $chars['M'][mt_rand(0, min(sizeof($chars['M']), $config['captcha_gd_fonts']) -1)],
'N' => $chars['N'][mt_rand(0, min(sizeof($chars['N']), $config['captcha_gd_fonts']) -1)],
'O' => $chars['O'][mt_rand(0, min(sizeof($chars['O']), $config['captcha_gd_fonts']) -1)],
'P' => $chars['P'][mt_rand(0, min(sizeof($chars['P']), $config['captcha_gd_fonts']) -1)],
@@ -2196,7 +2196,7 @@ class colour_manager
{
$mode = $this->mode;
}
-
+
if (!is_array($colour))
{
if (isset($this->named_rgb[$colour]))
@@ -2352,7 +2352,6 @@ class colour_manager
$colour3[0] += 180;
$colour4[0] += 210;
-
$results[] = $this->allocate($colour2, $mode);
$results[] = $this->allocate($colour3, $mode);
$results[] = $this->allocate($colour4, $mode);
@@ -2390,7 +2389,7 @@ class colour_manager
}
// This is a hard problem. I chicken out and try to maintain readability at the cost of less randomness.
-
+
while ($count > 0)
{
$colour[1] = ($colour[1] + mt_rand(40,60)) % 99;
diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php
index 11bbcd4154..a59b4a8add 100644
--- a/phpBB/includes/constants.php
+++ b/phpBB/includes/constants.php
@@ -91,6 +91,7 @@ define('ITEM_MOVED', 2);
define('ITEM_UNAPPROVED', 0); // => has not yet been approved
define('ITEM_APPROVED', 1); // => has been approved, and has not been soft deleted
define('ITEM_DELETED', 2); // => has been soft deleted
+define('ITEM_REAPPROVE', 3); // => has been edited and needs to be re-approved
// Forum Flags
define('FORUM_FLAG_LINK_TRACK', 1);
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 69f7c3f162..92fe090823 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -1005,24 +1005,6 @@ function phpbb_get_timezone_identifiers($selected_timezone)
}
/**
-* Pick a timezone
-*
-* @param string $default A timezone to select
-* @param boolean $truncate Shall we truncate the options text
-*
-* @return string Returns the options for timezone selector only
-*
-* @deprecated
-*/
-function tz_select($default = '', $truncate = false)
-{
- global $user;
-
- $timezone_select = phpbb_timezone_select($user, $default, $truncate);
- return $timezone_select['tz_select'];
-}
-
-/**
* Options to pick a timezone and date/time
*
* @param \phpbb\user $user Object of the current user
@@ -2022,7 +2004,7 @@ function append_sid($url, $params = false, $is_amp = true, $session_id = false)
* the global one (false)
* @var bool|string append_sid_overwrite Overwrite function (string
* URL) or not (false)
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('url', 'params', 'is_amp', 'session_id', 'append_sid_overwrite');
extract($phpbb_dispatcher->trigger_event('core.append_sid', compact($vars)));
@@ -2712,7 +2694,6 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
WHERE user_id = " . $user->data['user_id'];
$db->sql_query($sql);
-
if ($request->is_ajax())
{
$u_action .= '&confirm_uid=' . $user->data['user_id'] . '&sess=' . $user->session_id . '&sid=' . $user->session_id;
@@ -3849,6 +3830,16 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
if (defined('IN_INSTALL') || defined('DEBUG') || isset($auth) && $auth->acl_get('a_'))
{
$msg_text = $log_text;
+
+ // If this is defined there already was some output
+ // So let's not break it
+ if (defined('IN_DB_UPDATE'))
+ {
+ echo '<div class="errorbox">' . $msg_text . '</div>';
+
+ $db->sql_return_on_error(true);
+ phpbb_end_update($cache, $config);
+ }
}
if ((defined('IN_CRON') || defined('IMAGE_OUTPUT')) && isset($db))
@@ -4735,7 +4726,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
* @var int item_id Restrict online users to item id
* @var bool page_header_override Shall we return instead of running
* the rest of page_header()
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('page_title', 'display_online_list', 'item_id', 'item', 'page_header_override');
extract($phpbb_dispatcher->trigger_event('core.page_header', compact($vars)));
@@ -5100,7 +5091,7 @@ function page_footer($run_cron = true, $display_template = true, $exit_handler =
* @var bool run_cron Shall we run cron tasks
* @var bool page_footer_override Shall we return instead of running
* the rest of page_footer()
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('run_cron', 'page_footer_override');
extract($phpbb_dispatcher->trigger_event('core.page_footer', compact($vars)));
@@ -5208,7 +5199,7 @@ function garbage_collection()
* Unload some objects, to free some memory, before we finish our task
*
* @event core.garbage_collection
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$phpbb_dispatcher->dispatch('core.garbage_collection');
}
diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php
index cb44ed2794..2c66f6009c 100644
--- a/phpBB/includes/functions_acp.php
+++ b/phpBB/includes/functions_acp.php
@@ -41,7 +41,7 @@ function adm_page_header($page_title)
* @var string page_title Page title
* @var bool adm_page_header_override Shall we return instead of
* running the rest of adm_page_header()
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('page_title', 'adm_page_header_override');
extract($phpbb_dispatcher->trigger_event('core.adm_page_header', compact($vars)));
@@ -132,7 +132,7 @@ function adm_page_footer($copyright_html = true)
* @var bool copyright_html Shall we display the copyright?
* @var bool adm_page_footer_override Shall we return instead of
* running the rest of adm_page_footer()
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('copyright_html', 'adm_page_footer_override');
extract($phpbb_dispatcher->trigger_event('core.adm_page_footer', compact($vars)));
@@ -396,7 +396,7 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars)
* @var string name Should be used for the name attribute
* @var array vars Array with the options for the config
* @var string tpl The resulting html code we display
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('tpl_type', 'key', 'new', 'name', 'vars', 'tpl');
extract($phpbb_dispatcher->trigger_event('core.build_config_template', compact($vars)));
@@ -606,7 +606,7 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
* @var array error Array of errors, the errors should
* be strings only, language keys are
* not replaced afterwards
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('cfg_array', 'config_name', 'config_definition', 'error');
extract($phpbb_dispatcher->trigger_event('core.validate_config_variable', compact($vars)));
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index d72f89b6ac..50b3b61eaa 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -736,8 +736,6 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
// Notifications types to delete
$delete_notifications_types = array(
'quote',
- 'bookmark',
- 'post',
'approve_post',
'post_in_queue',
);
@@ -746,7 +744,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
* Perform additional actions before post(s) deletion
*
* @event core.delete_posts_before
- * @var string where_type Variable containing posts deletion mode
+ * @var string where_type Variable containing posts deletion mode
* @var mixed where_ids Array or comma separated list of posts ids to delete
* @var bool auto_sync Flag indicating if topics/forums should be synchronized
* @var bool posted_sync Flag indicating if topics_posted table should be resynchronized
@@ -755,7 +753,15 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
* @var array delete_notifications_types Array with notifications types to delete
* @since 3.1.0-a4
*/
- $vars = array('where_type', 'where_ids', 'auto_sync', 'posted_sync', 'post_count_sync', 'call_delete_topics', 'delete_notifications_types');
+ $vars = array(
+ 'where_type',
+ 'where_ids',
+ 'auto_sync',
+ 'posted_sync',
+ 'post_count_sync',
+ 'call_delete_topics',
+ 'delete_notifications_types',
+ );
extract($phpbb_dispatcher->trigger_event('core.delete_posts_before', compact($vars)));
if ($where_type === 'range')
@@ -907,12 +913,20 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
* @var array poster_ids Array with deleted posts' author ids
* @var array topic_ids Array with deleted posts' topic ids
* @var array forum_ids Array with deleted posts' forum ids
- * @var string where_type Variable containing posts deletion mode
+ * @var string where_type Variable containing posts deletion mode
* @var mixed where_ids Array or comma separated list of posts ids to delete
* @var array delete_notifications_types Array with notifications types to delete
* @since 3.1.0-a4
*/
- $vars = array('post_ids', 'poster_ids', 'topic_ids', 'forum_ids', 'where_type', 'where_ids', 'delete_notifications_types');
+ $vars = array(
+ 'post_ids',
+ 'poster_ids',
+ 'topic_ids',
+ 'forum_ids',
+ 'where_type',
+ 'where_ids',
+ 'delete_notifications_types',
+ );
extract($phpbb_dispatcher->trigger_event('core.delete_posts_in_transaction', compact($vars)));
$db->sql_transaction('commit');
@@ -925,12 +939,20 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
* @var array poster_ids Array with deleted posts' author ids
* @var array topic_ids Array with deleted posts' topic ids
* @var array forum_ids Array with deleted posts' forum ids
- * @var string where_type Variable containing posts deletion mode
+ * @var string where_type Variable containing posts deletion mode
* @var mixed where_ids Array or comma separated list of posts ids to delete
* @var array delete_notifications_types Array with notifications types to delete
* @since 3.1.0-a4
*/
- $vars = array('post_ids', 'poster_ids', 'topic_ids', 'forum_ids', 'where_type', 'where_ids', 'delete_notifications_types');
+ $vars = array(
+ 'post_ids',
+ 'poster_ids',
+ 'topic_ids',
+ 'forum_ids',
+ 'where_type',
+ 'where_ids',
+ 'delete_notifications_types',
+ );
extract($phpbb_dispatcher->trigger_event('core.delete_posts_after', compact($vars)));
// Resync topics_posted table
@@ -1489,7 +1511,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
ITEM_DELETED => (!empty($topics_softdeleted)) ? ' WHERE ' . $db->sql_in_set('topic_id', $topics_softdeleted) : '',
);
- foreach ($topic_visiblities as $visibility => $sql_where)
+ foreach ($update_ary as $visibility => $sql_where)
{
if ($sql_where)
{
@@ -1778,7 +1800,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
{
$forum_data[$forum_id]['topics_approved'] = $row['total_topics'];
}
- else if ($row['topic_visibility'] == ITEM_UNAPPROVED)
+ else if ($row['topic_visibility'] == ITEM_UNAPPROVED || $row['topic_visibility'] == ITEM_REAPPROVE)
{
$forum_data[$forum_id]['topics_unapproved'] = $row['total_topics'];
}
@@ -2001,7 +2023,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
{
$topic_data[$topic_id]['posts_approved'] = $row['total_posts'];
}
- else if ($row['post_visibility'] == ITEM_UNAPPROVED)
+ else if ($row['post_visibility'] == ITEM_UNAPPROVED || $row['post_visibility'] == ITEM_REAPPROVE)
{
$topic_data[$topic_id]['posts_unapproved'] = $row['total_posts'];
}
@@ -2023,7 +2045,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
$topic_data[$topic_id]['first_post_id'] = (!empty($topic_data[$topic_id]['first_post_id'])) ? min($topic_data[$topic_id]['first_post_id'], $row['first_post_id']) : $row['first_post_id'];
$topic_data[$topic_id]['last_post_id'] = max($topic_data[$topic_id]['last_post_id'], $row['last_post_id']);
- if ($topic_data[$topic_id]['visibility'] == ITEM_UNAPPROVED)
+ if ($topic_data[$topic_id]['visibility'] == ITEM_UNAPPROVED || $topic_data[$topic_id]['visibility'] == ITEM_REAPPROVE)
{
// Soft delete status is stronger than unapproved.
$topic_data[$topic_id]['visibility'] = $row['post_visibility'];
@@ -2581,20 +2603,6 @@ function phpbb_cache_moderators($db, $cache, $auth)
}
/**
-* Cache moderators. Called whenever permissions are changed
-* via admin_permissions. Changes of usernames and group names
-* must be carried through for the moderators table.
-*
-* @deprecated 3.1
-* @return null
-*/
-function cache_moderators()
-{
- global $db, $cache, $auth;
- return phpbb_cache_moderators($db, $cache, $auth);
-}
-
-/**
* View log
*
* @param string $mode The mode defines which log_type is used and from which log the entry is retrieved
@@ -2744,20 +2752,6 @@ function phpbb_update_foes($db, $auth, $group_id = false, $user_id = false)
}
/**
-* Removes moderators and administrators from foe lists.
-*
-* @deprecated 3.1
-* @param array|bool $group_id If an array, remove all members of this group from foe lists, or false to ignore
-* @param array|bool $user_id If an array, remove this user from foe lists, or false to ignore
-* @return null
-*/
-function update_foes($group_id = false, $user_id = false)
-{
- global $db, $auth;
- return phpbb_update_foes($db, $auth, $group_id, $user_id);
-}
-
-/**
* Lists inactive users
*/
function view_inactive_users(&$users, &$user_count, $limit = 0, $offset = 0, $limit_days = 0, $sort_by = 'user_inactive_time DESC')
@@ -2929,7 +2923,7 @@ function get_database_size()
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
-
+
$sql = 'SELECT ((SUM(size) * 8.0) * 1024.0) as dbsize
FROM sysfiles';
@@ -2938,7 +2932,7 @@ function get_database_size()
// Azure stats are stored elsewhere
if (strpos($row['mssql_version'], 'SQL Azure') !== false)
{
- $sql = 'SELECT ((SUM(reserved_page_count) * 8.0) * 1024.0) as dbsize
+ $sql = 'SELECT ((SUM(reserved_page_count) * 8.0) * 1024.0) as dbsize
FROM sys.dm_db_partition_stats';
}
}
diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php
index 164dd4cb99..c2db53f86c 100644
--- a/phpBB/includes/functions_compatibility.php
+++ b/phpBB/includes/functions_compatibility.php
@@ -116,3 +116,49 @@ function phpbb_clean_path($path)
return $phpbb_path_helper->clean_path($path);
}
+
+/**
+* Pick a timezone
+*
+* @param string $default A timezone to select
+* @param boolean $truncate Shall we truncate the options text
+*
+* @return string Returns the options for timezone selector only
+*
+* @deprecated
+*/
+function tz_select($default = '', $truncate = false)
+{
+ global $user;
+
+ $timezone_select = phpbb_timezone_select($user, $default, $truncate);
+ return $timezone_select['tz_select'];
+}
+
+/**
+* Cache moderators. Called whenever permissions are changed
+* via admin_permissions. Changes of usernames and group names
+* must be carried through for the moderators table.
+*
+* @deprecated 3.1
+* @return null
+*/
+function cache_moderators()
+{
+ global $db, $cache, $auth;
+ return phpbb_cache_moderators($db, $cache, $auth);
+}
+
+/**
+* Removes moderators and administrators from foe lists.
+*
+* @deprecated 3.1
+* @param array|bool $group_id If an array, remove all members of this group from foe lists, or false to ignore
+* @param array|bool $user_id If an array, remove this user from foe lists, or false to ignore
+* @return null
+*/
+function update_foes($group_id = false, $user_id = false)
+{
+ global $db, $auth;
+ return phpbb_update_foes($db, $auth, $group_id, $user_id);
+}
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php
index dd9201165b..bb94967606 100644
--- a/phpBB/includes/functions_content.php
+++ b/phpBB/includes/functions_content.php
@@ -20,6 +20,7 @@ if (!defined('IN_PHPBB'))
* make_jumpbox()
* bump_topic_allowed()
* get_context()
+* phpbb_clean_search_string()
* decode_message()
* strip_bbcode()
* generate_text_for_display()
@@ -360,6 +361,23 @@ function get_context($text, $words, $length = 400)
}
/**
+* Cleans a search string by removing single wildcards from it and replacing multiple spaces with a single one.
+*
+* @param string $search_string The full search string which should be cleaned.
+*
+* @return string The cleaned search string without any wildcards and multiple spaces.
+*/
+function phpbb_clean_search_string($search_string)
+{
+ // This regular expressions matches every single wildcard.
+ // That means one after a whitespace or the beginning of the string or one before a whitespace or the end of the string.
+ $search_string = preg_replace('#(?<=^|\s)\*+(?=\s|$)#', '', $search_string);
+ $search_string = trim($search_string);
+ $search_string = preg_replace(array('#\s+#u', '#\*+#u'), array(' ', '*'), $search_string);
+ return $search_string;
+}
+
+/**
* Decode text whereby text is coming from the db and expected to be pre-parsed content
* We are placing this outside of the message parser because we are often in need of it...
*/
@@ -427,13 +445,13 @@ function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text
* @var string bitfield The BBCode Bitfield
* @var int flags The BBCode Flags
* @var bool censor_text Whether or not to apply word censors
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('text', 'uid', 'bitfield', 'flags', 'censor_text');
extract($phpbb_dispatcher->trigger_event('core.modify_text_for_display_before', compact($vars)));
if ($censor_text)
- {
+ {
$text = censor_text($text);
}
@@ -469,7 +487,7 @@ function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text
* @var string uid The BBCode UID
* @var string bitfield The BBCode Bitfield
* @var int flags The BBCode Flags
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('text', 'uid', 'bitfield', 'flags');
extract($phpbb_dispatcher->trigger_event('core.modify_text_for_display_after', compact($vars)));
@@ -481,7 +499,7 @@ function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text
* For parsing custom parsed text to be stored within the database.
* This function additionally returns the uid and bitfield that needs to be stored.
* Expects $text to be the value directly from request_var() and in it's non-parsed form
-*
+*
* @param string $text The text to be replaced with the parsed one
* @param string $uid The BBCode uid for this parse
* @param string $bitfield The BBCode bitfield for this parse
@@ -507,9 +525,17 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb
* @var bool allow_bbcode Whether or not to parse BBCode
* @var bool allow_urls Whether or not to parse URLs
* @var bool allow_smilies Whether or not to parse Smilies
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
- $vars = array('text', 'uid', 'bitfield', 'flags', 'allow_bbcode', 'allow_urls', 'allow_smilies');
+ $vars = array(
+ 'text',
+ 'uid',
+ 'bitfield',
+ 'flags',
+ 'allow_bbcode',
+ 'allow_urls',
+ 'allow_smilies',
+ );
extract($phpbb_dispatcher->trigger_event('core.modify_text_for_storage_before', compact($vars)));
$uid = $bitfield = '';
@@ -547,7 +573,7 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb
* @var string uid The BBCode UID
* @var string bitfield The BBCode Bitfield
* @var int flags The BBCode Flags
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('text', 'uid', 'bitfield', 'flags');
extract($phpbb_dispatcher->trigger_event('core.modify_text_for_storage_after', compact($vars)));
@@ -570,7 +596,7 @@ function generate_text_for_edit($text, $uid, $flags)
* @var string text The text to parse
* @var string uid The BBCode UID
* @var int flags The BBCode Flags
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('text', 'uid', 'flags');
extract($phpbb_dispatcher->trigger_event('core.modify_text_for_edit_before', compact($vars)));
@@ -583,7 +609,7 @@ function generate_text_for_edit($text, $uid, $flags)
* @event core.modify_text_for_edit_after
* @var string text The text to parse
* @var int flags The BBCode Flags
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('text', 'flags');
extract($phpbb_dispatcher->trigger_event('core.modify_text_for_edit_after', compact($vars)));
@@ -1374,7 +1400,7 @@ function get_username_string($mode, $user_id, $username, $username_colour = '',
{
$username_string = str_replace(array('{PROFILE_URL}', '{USERNAME_COLOUR}', '{USERNAME}'), array($profile_url, $username_colour, $username), (!$username_colour) ? $_profile_cache['tpl_profile'] : $_profile_cache['tpl_profile_colour']);
}
-
+
/**
* Use this event to change the output of get_username_string()
*
@@ -1390,9 +1416,18 @@ function get_username_string($mode, $user_id, $username, $username_colour = '',
* profile url.
* @var string username_string The string that has been generated
* @var array _profile_cache Array of original return templates
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
- $vars = array('mode', 'user_id', 'username', 'username_colour', 'guest_username', 'custom_profile_url', 'username_string', '_profile_cache');
+ $vars = array(
+ 'mode',
+ 'user_id',
+ 'username',
+ 'username_colour',
+ 'guest_username',
+ 'custom_profile_url',
+ 'username_string',
+ '_profile_cache',
+ );
extract($phpbb_dispatcher->trigger_event('core.modify_username_string', compact($vars)));
return $username_string;
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 2b11d00f1e..353f0be04b 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -138,7 +138,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
*
* @event core.display_forums_modify_sql
* @var array sql_ary The SQL array to get the data of the forums
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('sql_ary');
extract($phpbb_dispatcher->trigger_event('core.display_forums_modify_sql', compact($vars)));
@@ -161,7 +161,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
* @event core.display_forums_modify_row
* @var int branch_root_id Last top-level forum
* @var array row The data of the forum
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('branch_root_id', 'row');
extract($phpbb_dispatcher->trigger_event('core.display_forums_modify_row', compact($vars)));
@@ -318,7 +318,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
* @var int branch_root_id Current top-level forum
* @var int parent_id Current parent forum
* @var array row The data of the forum
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('forum_rows', 'subforums', 'branch_root_id', 'parent_id', 'row');
extract($phpbb_dispatcher->trigger_event('core.display_forums_modify_forum_rows', compact($vars)));
@@ -568,7 +568,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
* @event core.display_forums_modify_template_vars
* @var array forum_row Template data of the forum
* @var array row The data of the forum
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('forum_row', 'row');
extract($phpbb_dispatcher->trigger_event('core.display_forums_modify_template_vars', compact($vars)));
@@ -900,7 +900,6 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold
$folder_new .= '_locked';
}
-
$folder_img = ($unread_topic) ? $folder_new : $folder;
$folder_alt = ($unread_topic) ? 'UNREAD_POSTS' : (($topic_row['topic_status'] == ITEM_LOCKED) ? 'TOPIC_LOCKED' : 'NO_UNREAD_POSTS');
@@ -975,7 +974,7 @@ function display_custom_bbcodes()
* @event core.display_custom_bbcodes_modify_row
* @var array custom_tags Template data of the bbcode
* @var array row The data of the bbcode
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('custom_tags', 'row');
extract($phpbb_dispatcher->trigger_event('core.display_custom_bbcodes_modify_row', compact($vars)));
@@ -990,7 +989,7 @@ function display_custom_bbcodes()
* Display custom bbcodes
*
* @event core.display_custom_bbcodes
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$phpbb_dispatcher->dispatch('core.display_custom_bbcodes');
}
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index 907252f6d8..79a5aeda1a 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -484,14 +484,17 @@ class messenger
$use_queue = true;
}
+ $contact_name = htmlspecialchars_decode($config['board_contact_name']);
+ $board_contact = (($contact_name !== '') ? '"' . mail_encode($contact_name) . '" ' : '') . '<' . $config['board_contact'] . '>';
+
if (empty($this->replyto))
{
- $this->replyto = '<' . $config['board_contact'] . '>';
+ $this->replyto = $board_contact;
}
if (empty($this->from))
{
- $this->from = '<' . $config['board_contact'] . '>';
+ $this->from = $board_contact;
}
$encode_eol = ($config['smtp_delivery']) ? "\r\n" : $this->eol;
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php
index be066de0f0..04efcb7b2e 100644
--- a/phpBB/includes/functions_module.php
+++ b/phpBB/includes/functions_module.php
@@ -398,6 +398,7 @@ class p_master
'cfg_([a-z0-9_]+)' => '(int) $config[\'\\1\']',
'request_([a-zA-Z0-9_]+)' => '$request->variable(\'\\1\', false)',
'ext_([a-zA-Z0-9_/]+)' => 'array_key_exists(\'\\1\', $phpbb_extension_manager->all_enabled())',
+ 'authmethod_([a-z0-9_\\\\]+)' => '($config[\'auth_method\'] === \'\\1\')',
);
/**
@@ -409,7 +410,7 @@ class p_master
* @var string module_auth The module_auth of the current
* module
* @var int forum_id The current forum_id
- * @since 3.1-A3
+ * @since 3.1.0-a3
*/
$vars = array('valid_tokens', 'module_auth', 'forum_id');
extract($phpbb_dispatcher->trigger_event('core.module_auth', compact($vars)));
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 51bbcb8bae..547ea69e81 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -133,7 +133,7 @@ function generate_smilies($mode, $forum_id)
* @var string mode Mode of the smilies: window|inline
* @var int forum_id The forum ID we are currently in
* @var bool display_link Shall we display the "more smilies" link?
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('mode', 'forum_id', 'display_link');
extract($phpbb_dispatcher->trigger_event('core.generate_smilies_after', compact($vars)));
@@ -173,7 +173,6 @@ function update_post_information($type, $ids, $return_update_sql = false)
$ids = array($ids);
}
-
$update_sql = $empty_forums = $not_empty_forums = array();
if ($type != 'topic')
@@ -1296,7 +1295,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data, $is_soft = false, $
{
$sql_data[FORUMS_TABLE] .= 'forum_posts_approved = forum_posts_approved - 1, forum_topics_approved = forum_topics_approved - 1';
}
- else if ($data['topic_visibility'] == ITEM_UNAPPROVED)
+ else if ($data['topic_visibility'] == ITEM_UNAPPROVED || $data['post_visibility'] == ITEM_REAPPROVE)
{
$sql_data[FORUMS_TABLE] .= 'forum_posts_unapproved = forum_posts_unapproved - 1, forum_topics_unapproved = forum_topics_unapproved - 1';
}
@@ -1403,7 +1402,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data, $is_soft = false, $
{
$phpbb_content_visibility->remove_post_from_statistic($data, $sql_data);
}
- else if ($data['post_visibility'] == ITEM_UNAPPROVED)
+ else if ($data['post_visibility'] == ITEM_UNAPPROVED || $data['post_visibility'] == ITEM_REAPPROVE)
{
$sql_data[FORUMS_TABLE] = (($sql_data[FORUMS_TABLE]) ? $sql_data[FORUMS_TABLE] . ', ' : '') . 'forum_posts_unapproved = forum_posts_unapproved - 1';
$sql_data[TOPICS_TABLE] = (($sql_data[TOPICS_TABLE]) ? $sql_data[TOPICS_TABLE] . ', ' : '') . 'topic_posts_unapproved = topic_posts_unapproved - 1';
@@ -1497,7 +1496,17 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
* @var bool update_search_index Flag indicating if the search index will be updated
* @since 3.1.0-a4
*/
- extract($phpbb_dispatcher->trigger_event('core.modify_submit_post_data', compact(array('mode', 'subject', 'username', 'topic_type', 'poll', 'data', 'update_message', 'update_search_index'))));
+ $vars = array(
+ 'mode',
+ 'subject',
+ 'username',
+ 'topic_type',
+ 'poll',
+ 'data',
+ 'update_message',
+ 'update_search_index',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.modify_submit_post_data', compact($vars)));
// We do not handle erasing posts here
if ($mode == 'delete')
@@ -1555,16 +1564,25 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
{
// Post not approved, but in queue
$post_visibility = ITEM_UNAPPROVED;
+ switch ($post_mode)
+ {
+ case 'edit_first_post':
+ case 'edit':
+ case 'edit_last_post':
+ case 'edit_topic':
+ $post_visibility = ITEM_REAPPROVE;
+ break;
+ }
}
// MODs/Extensions are able to force any visibility on posts
if (isset($data['force_approved_state']))
{
- $post_visibility = (in_array((int) $data['force_approved_state'], array(ITEM_APPROVED, ITEM_UNAPPROVED, ITEM_DELETED))) ? (int) $data['force_approved_state'] : $post_visibility;
+ $post_visibility = (in_array((int) $data['force_approved_state'], array(ITEM_APPROVED, ITEM_UNAPPROVED, ITEM_DELETED, ITEM_REAPPROVE))) ? (int) $data['force_approved_state'] : $post_visibility;
}
if (isset($data['force_visibility']))
{
- $post_visibility = (in_array((int) $data['force_visibility'], array(ITEM_APPROVED, ITEM_UNAPPROVED, ITEM_DELETED))) ? (int) $data['force_visibility'] : $post_visibility;
+ $post_visibility = (in_array((int) $data['force_visibility'], array(ITEM_APPROVED, ITEM_UNAPPROVED, ITEM_DELETED, ITEM_REAPPROVE))) ? (int) $data['force_visibility'] : $post_visibility;
}
// Start the transaction here
@@ -2032,6 +2050,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
$first_post_has_topic_info = ($post_mode == 'edit_first_post' &&
(($post_visibility == ITEM_DELETED && $data['topic_posts_softdeleted'] == 1) ||
($post_visibility == ITEM_UNAPPROVED && $data['topic_posts_unapproved'] == 1) ||
+ ($post_visibility == ITEM_REAPPROVE && $data['topic_posts_unapproved'] == 1) ||
($post_visibility == ITEM_APPROVED && $data['topic_posts_approved'] == 1)));
// Fix the post's and topic's visibility and first/last post information, when the post is edited
if (($post_mode != 'post' && $post_mode != 'reply') && $data['post_visibility'] != $post_visibility)
@@ -2039,7 +2058,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
// If the post was not approved, it could also be the starter,
// so we sync the starter after approving/restoring, to ensure that the stats are correct
// Same applies for the last post
- $is_starter = ($post_mode == 'edit_first_post' || $data['post_visibility'] != ITEM_APPROVED);
+ $is_starter = ($post_mode == 'edit_first_post' || $post_mode == 'edit_topic' || $data['post_visibility'] != ITEM_APPROVED);
$is_latest = ($post_mode == 'edit_last_post' || $post_mode == 'edit_topic' || $data['post_visibility'] != ITEM_APPROVED);
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
@@ -2272,43 +2291,51 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
case 'edit_first_post':
case 'edit':
case 'edit_last_post':
- if ($data['topic_visibility'] != ITEM_APPROVED)
- {
- $phpbb_notifications->delete_notifications('topic', $data['topic_id']);
- }
-
- $phpbb_notifications->delete_notifications(array(
- 'quote',
- 'bookmark',
- 'post',
- ), $data['post_id']);
+ // Nothing to do here
break;
}
}
- else if ($post_visibility == ITEM_DELETED)
+ else if ($post_visibility == ITEM_REAPPROVE)
{
switch ($mode)
{
+ case 'edit_topic':
+ case 'edit_first_post':
+ $phpbb_notifications->add_notifications('topic_in_queue', $notification_data);
+
+ // Delete the approve_post notification so we can notify the user again,
+ // when his post got reapproved
+ $phpbb_notifications->delete_notifications('approve_post', $notification_data['post_id']);
+ break;
+
+ case 'edit':
+ case 'edit_last_post':
+ $phpbb_notifications->add_notifications('post_in_queue', $notification_data);
+
+ // Delete the approve_post notification so we can notify the user again,
+ // when his post got reapproved
+ $phpbb_notifications->delete_notifications('approve_post', $notification_data['post_id']);
+ break;
+
case 'post':
case 'reply':
case 'quote':
// Nothing to do here
break;
-
+ }
+ }
+ else if ($post_visibility == ITEM_DELETED)
+ {
+ switch ($mode)
+ {
+ case 'post':
+ case 'reply':
+ case 'quote':
case 'edit_topic':
case 'edit_first_post':
case 'edit':
case 'edit_last_post':
- if ($data['topic_visibility'] != ITEM_APPROVED)
- {
- $phpbb_notifications->delete_notifications('topic', $data['topic_id']);
- }
-
- $phpbb_notifications->delete_notifications(array(
- 'quote',
- 'bookmark',
- 'post',
- ), $data['post_id']);
+ // Nothing to do here
break;
}
}
@@ -2345,7 +2372,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
* @var string url The "Return to topic" URL
* @var array data Array of post data about the
* submitted post
- * @since 3.1-A3
+ * @since 3.1.0-a3
*/
$vars = array('url', 'data');
extract($phpbb_dispatcher->trigger_event('core.submit_post_end', compact($vars)));
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 17d67b4a23..352e3b8c1f 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -314,7 +314,6 @@ function check_rule(&$rules, &$rule_row, &$message_row, $user_id)
break;
}
-
if (!$result)
{
return false;
@@ -1575,7 +1574,7 @@ function get_folder_status($folder_id, $folder)
*/
function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
{
- global $db, $auth, $config, $phpEx, $template, $user, $phpbb_root_path, $phpbb_container;
+ global $db, $auth, $config, $phpEx, $template, $user, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher;
// We do not handle erasing pms here
if ($mode == 'delete')
@@ -1585,6 +1584,18 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
$current_time = time();
+ /**
+ * Get all parts of the PM that are to be submited to the DB.
+ *
+ * @event core.submit_pm_before
+ * @var string mode PM Post mode - post|reply|quote|quotepost|forward|edit
+ * @var string subject Subject of the private message
+ * @var array data The whole row data of the PM.
+ * @since 3.1.0-b3
+ */
+ $vars = array('mode', 'subject', 'data');
+ extract($phpbb_dispatcher->trigger_event('core.submit_pm_before', compact($vars)));
+
// Collect some basic information about which tables and which rows to update/insert
$sql_data = array();
$root_level = 0;
@@ -2018,10 +2029,10 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
$decoded_message = bbcode_nl2br($decoded_message);
}
-
+
$parse_flags = ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0);
$parse_flags |= ($row['enable_smilies'] ? OPTION_FLAG_SMILIES : 0);
-
+
$message = generate_text_for_display($message, $row['bbcode_uid'], $row['bbcode_bitfield'], $parse_flags, false);
$subject = censor_text($subject);
diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php
index 9d61e39c98..b4e165502b 100644
--- a/phpBB/includes/functions_upload.php
+++ b/phpBB/includes/functions_upload.php
@@ -475,7 +475,7 @@ class fileerror extends filespec
class fileupload
{
var $allowed_extensions = array();
- var $disallowed_content = array('body', 'head', 'html', 'img', 'plaintext', 'a href', 'pre', 'script', 'table', 'title');
+ var $disallowed_content = array('body', 'head', 'html', 'img', 'plaintext', 'a href', 'pre', 'script', 'table', 'title');
var $max_filesize = 0;
var $min_width = 0;
var $min_height = 0;
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 6682622d94..dcc0d727a1 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -143,7 +143,7 @@ function user_update_name($old_name, $new_name)
* @event core.update_username
* @var string old_name The old username that is replaced
* @var string new_name The new username
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('old_name', 'new_name');
extract($phpbb_dispatcher->trigger_event('core.update_username', compact($vars)));
@@ -259,7 +259,7 @@ function user_add($user_row, $cp_data = false)
*
* @event core.user_add_modify_data
* @var array sql_ary Array of data to be inserted when a user is added
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('sql_ary');
extract($phpbb_dispatcher->trigger_event('core.user_add_modify_data', compact($vars)));
@@ -386,7 +386,7 @@ function user_delete($mode, $user_ids, $retain_username = true)
* @var array user_ids IDs of the deleted user
* @var mixed retain_username True if username should be retained
* or false if not
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('mode', 'user_ids', 'retain_username');
extract($phpbb_dispatcher->trigger_event('core.delete_user_before', compact($vars)));
@@ -615,7 +615,7 @@ function user_delete($mode, $user_ids, $retain_username = true)
* @var array user_ids IDs of the deleted user
* @var mixed retain_username True if username should be retained
* or false if not
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('mode', 'user_ids', 'retain_username');
extract($phpbb_dispatcher->trigger_event('core.delete_user_after', compact($vars)));
@@ -1326,9 +1326,18 @@ function validate_data($data, $val_ary)
{
$function = array_shift($validate);
array_unshift($validate, $data[$var]);
- $function_prefix = (function_exists('phpbb_validate_' . $function)) ? 'phpbb_validate_' : 'validate_';
- if ($result = call_user_func_array($function_prefix . $function, $validate))
+ if (is_array($function))
+ {
+ $result = call_user_func_array(array($function[0], 'validate_' . $function[1]), $validate);
+ }
+ else
+ {
+ $function_prefix = (function_exists('phpbb_validate_' . $function)) ? 'phpbb_validate_' : 'validate_';
+ $result = call_user_func_array($function_prefix . $function, $validate);
+ }
+
+ if ($result)
{
// Since errors are checked later for their language file existence, we need to make sure custom errors are not adjusted.
$error[] = (empty($user->lang[$result . '_' . strtoupper($var)])) ? $result : $result . '_' . strtoupper($var);
@@ -2077,7 +2086,6 @@ function get_avatar_filename($avatar_entry)
{
global $config;
-
if ($avatar_entry[0] === 'g')
{
$avatar_group = true;
@@ -2504,7 +2512,7 @@ function group_delete($group_id, $group_name = false)
* @event core.delete_group_after
* @var int group_id ID of the deleted group
* @var string group_name Name of the deleted group
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('group_id', 'group_name');
extract($phpbb_dispatcher->trigger_event('core.delete_group_after', compact($vars)));
@@ -2752,7 +2760,7 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false,
* @var string group_name Name of the group
* @var array user_id_ary IDs of the users which are removed
* @var array username_ary names of the users which are removed
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('group_id', 'group_name', 'user_id_ary', 'username_ary');
extract($phpbb_dispatcher->trigger_event('core.group_delete_user_before', compact($vars)));
@@ -3198,7 +3206,7 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal
* @var array group_attributes Group attributes which were changed
* @var array update_listing Update the list of moderators and foes
* @var array sql_ary User attributes which were changed
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('group_id', 'user_id_ary', 'group_attributes', 'update_listing', 'sql_ary');
extract($phpbb_dispatcher->trigger_event('core.user_set_default_group', compact($vars)));
diff --git a/phpBB/includes/mcp/info/mcp_pm_reports.php b/phpBB/includes/mcp/info/mcp_pm_reports.php
index 07dc564b19..d530a917cb 100644
--- a/phpBB/includes/mcp/info/mcp_pm_reports.php
+++ b/phpBB/includes/mcp/info/mcp_pm_reports.php
@@ -19,7 +19,7 @@ class mcp_pm_reports_info
'title' => 'MCP_PM_REPORTS',
'version' => '1.0.0',
'modes' => array(
- 'pm_reports' => array('title' => 'MCP_PM_REPORTS_OPEN', 'auth' => 'aclf_m_report', 'cat' => array('MCP_REPORTS')),
+ 'pm_reports' => array('title' => 'MCP_PM_REPORTS_OPEN', 'auth' => 'aclf_m_report', 'cat' => array('MCP_REPORTS')),
'pm_reports_closed' => array('title' => 'MCP_PM_REPORTS_CLOSED', 'auth' => 'aclf_m_report', 'cat' => array('MCP_REPORTS')),
'pm_report_details' => array('title' => 'MCP_PM_REPORT_DETAILS', 'auth' => 'aclf_m_report', 'cat' => array('MCP_REPORTS')),
),
diff --git a/phpBB/includes/mcp/mcp_ban.php b/phpBB/includes/mcp/mcp_ban.php
index d3bc336293..925d0878fc 100644
--- a/phpBB/includes/mcp/mcp_ban.php
+++ b/phpBB/includes/mcp/mcp_ban.php
@@ -171,7 +171,7 @@ class mcp_ban
case 'user':
$pre_fill = (string) $db->sql_fetchfield('username');
break;
-
+
case 'ip':
$pre_fill = (string) $db->sql_fetchfield('user_ip');
break;
diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php
index 7c1c61dae7..b4f7f4d70a 100644
--- a/phpBB/includes/mcp/mcp_forum.php
+++ b/phpBB/includes/mcp/mcp_forum.php
@@ -224,7 +224,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
$topic_title = censor_text($row['topic_title']);
- $topic_unapproved = ($row['topic_visibility'] == ITEM_UNAPPROVED && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false;
+ $topic_unapproved = (($row['topic_visibility'] == ITEM_UNAPPROVED || $row['topic_visibility'] == ITEM_REAPPROVE) && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false;
$posts_unapproved = ($row['topic_visibility'] == ITEM_APPROVED && $row['topic_posts_unapproved'] && $auth->acl_get('m_approve', $row['forum_id'])) ? true : false;
$topic_deleted = $row['topic_visibility'] == ITEM_DELETED;
$u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? $url . '&amp;i=queue&amp;mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . '&amp;t=' . $row['topic_id'] : '';
@@ -302,7 +302,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
* @event core.mcp_view_forum_modify_topicrow
* @var array row Array with topic data
* @var array topic_row Template array with topic data
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('row', 'topic_row');
extract($phpbb_dispatcher->trigger_event('core.mcp_view_forum_modify_topicrow', compact($vars)));
diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php
index 44cab5d910..aee43c471d 100644
--- a/phpBB/includes/mcp/mcp_front.php
+++ b/phpBB/includes/mcp/mcp_front.php
@@ -39,7 +39,7 @@ function mcp_front_view($id, $mode, $action)
$sql = 'SELECT COUNT(post_id) AS total
FROM ' . POSTS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_list) . '
- AND post_visibility = ' . ITEM_UNAPPROVED;
+ AND ' . $db->sql_in_set('post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE));
$result = $db->sql_query($sql);
$total = (int) $db->sql_fetchfield('total');
$db->sql_freeresult($result);
@@ -60,7 +60,7 @@ function mcp_front_view($id, $mode, $action)
$sql = 'SELECT post_id
FROM ' . POSTS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_list) . '
- AND post_visibility = ' . ITEM_UNAPPROVED . '
+ AND ' . $db->sql_in_set('post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE)) . '
ORDER BY post_time DESC';
$result = $db->sql_query_limit($sql, 5);
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index 55440bf192..6b2e9266b3 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -493,7 +493,7 @@ function mcp_move_topic($topic_ids)
{
$topics_moved++;
}
- elseif ($topic_info['topic_visibility'] == ITEM_UNAPPROVED)
+ elseif ($topic_info['topic_visibility'] == ITEM_UNAPPROVED || $topic_info['topic_visibility'] == ITEM_REAPPROVE)
{
$topics_moved_unapproved++;
}
@@ -1230,6 +1230,7 @@ function mcp_fork_topic($topic_ids)
$total_topics++;
break;
case ITEM_UNAPPROVED:
+ case ITEM_REAPPROVE:
$total_topics_unapproved++;
break;
case ITEM_DELETED:
@@ -1316,6 +1317,7 @@ function mcp_fork_topic($topic_ids)
$total_posts++;
break;
case ITEM_UNAPPROVED:
+ case ITEM_REAPPROVE:
$total_posts_unapproved++;
break;
case ITEM_DELETED:
diff --git a/phpBB/includes/mcp/mcp_pm_reports.php b/phpBB/includes/mcp/mcp_pm_reports.php
index 008984b1c3..b0a06dd6ce 100644
--- a/phpBB/includes/mcp/mcp_pm_reports.php
+++ b/phpBB/includes/mcp/mcp_pm_reports.php
@@ -170,7 +170,7 @@ class mcp_pm_reports
'U_MCP_USER_NOTES' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&amp;mode=user_notes&amp;u=' . $pm_info['author_id']),
'U_MCP_WARN_REPORTER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $report['user_id']) : '',
'U_MCP_WARN_USER' => ($auth->acl_get('m_warn')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&amp;mode=warn_user&amp;u=' . $pm_info['author_id']) : '',
-
+
'EDIT_IMG' => $user->img('icon_post_edit', $user->lang['EDIT_POST']),
'MINI_POST_IMG' => $user->img('icon_post_target', 'POST'),
@@ -304,7 +304,7 @@ class mcp_pm_reports
$template->assign_vars(array(
'L_EXPLAIN' => ($mode == 'pm_reports') ? $user->lang['MCP_PM_REPORTS_OPEN_EXPLAIN'] : $user->lang['MCP_PM_REPORTS_CLOSED_EXPLAIN'],
'L_TITLE' => ($mode == 'pm_reports') ? $user->lang['MCP_PM_REPORTS_OPEN'] : $user->lang['MCP_PM_REPORTS_CLOSED'],
-
+
'S_PM' => true,
'S_MCP_ACTION' => $this->u_action,
'S_CLOSED' => ($mode == 'pm_reports_closed') ? true : false,
diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php
index e2d6cd15c9..5925575577 100644
--- a/phpBB/includes/mcp/mcp_post.php
+++ b/phpBB/includes/mcp/mcp_post.php
@@ -203,7 +203,7 @@ function mcp_post_details($id, $mode, $action)
'S_CAN_DELETE_POST' => $auth->acl_get('m_delete', $post_info['forum_id']),
'S_POST_REPORTED' => ($post_info['post_reported']) ? true : false,
- 'S_POST_UNAPPROVED' => ($post_info['post_visibility'] == ITEM_UNAPPROVED) ? true : false,
+ 'S_POST_UNAPPROVED' => ($post_info['post_visibility'] == ITEM_UNAPPROVED || $post_info['post_visibility'] == ITEM_REAPPROVE) ? true : false,
'S_POST_DELETED' => ($post_info['post_visibility'] == ITEM_DELETED) ? true : false,
'S_POST_LOCKED' => ($post_info['post_edit_locked']) ? true : false,
'S_USER_NOTES' => true,
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index 8d998919e5..a71bc997e9 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -115,10 +115,10 @@ class mcp_queue
if (!empty($topic_id_list))
{
- $post_visibility = ($mode == 'deleted_topics') ? ITEM_DELETED : ITEM_UNAPPROVED;
+ $post_visibility = ($mode == 'deleted_topics') ? ITEM_DELETED : array(ITEM_UNAPPROVED, ITEM_REAPPROVE);
$sql = 'SELECT post_id
FROM ' . POSTS_TABLE . '
- WHERE post_visibility = ' . $post_visibility . '
+ WHERE ' . $db->sql_in_set('post_visibility', $post_visibility) . '
AND ' . $db->sql_in_set('topic_id', $topic_id_list);
$result = $db->sql_query($sql);
@@ -281,7 +281,7 @@ class mcp_queue
'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;p=$post_id&amp;f=$forum_id"),
'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']),
'S_POST_REPORTED' => $post_info['post_reported'],
- 'S_POST_UNAPPROVED' => ($post_info['post_visibility'] == ITEM_UNAPPROVED),
+ 'S_POST_UNAPPROVED' => $post_info['post_visibility'] == ITEM_UNAPPROVED || $post_info['post_visibility'] == ITEM_REAPPROVE,
'S_POST_LOCKED' => $post_info['post_edit_locked'],
'S_USER_NOTES' => true,
'S_POST_DELETED' => ($post_info['post_visibility'] == ITEM_DELETED),
@@ -298,7 +298,6 @@ class mcp_queue
'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'),
-
'RETURN_QUEUE' => sprintf($user->lang['RETURN_QUEUE'], '<a href="' . append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue' . (($topic_id) ? '&amp;mode=unapproved_topics' : '&amp;mode=unapproved_posts')) . '&amp;start=' . $start . '">', '</a>'),
'RETURN_POST' => sprintf($user->lang['RETURN_POST'], '<a href="' . $post_url . '">', '</a>'),
'RETURN_TOPIC_SIMPLE' => sprintf($user->lang['RETURN_TOPIC_SIMPLE'], '<a href="' . $topic_url . '">', '</a>'),
@@ -331,7 +330,7 @@ class mcp_queue
$m_perm = 'm_approve';
$is_topics = ($mode == 'unapproved_topics' || $mode == 'deleted_topics') ? true : false;
$is_restore = ($mode == 'deleted_posts' || $mode == 'deleted_topics') ? true : false;
- $visibility_const = (!$is_restore) ? ITEM_UNAPPROVED : ITEM_DELETED;
+ $visibility_const = (!$is_restore) ? array(ITEM_UNAPPROVED, ITEM_REAPPROVE) : ITEM_DELETED;
$user->add_lang(array('viewtopic', 'viewforum'));
@@ -419,7 +418,7 @@ class mcp_queue
$sql = 'SELECT p.post_id
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . ' t' . (($sort_order_sql[0] == 'u') ? ', ' . USERS_TABLE . ' u' : '') . '
WHERE ' . $db->sql_in_set('p.forum_id', $forum_list) . '
- AND p.post_visibility = ' . $visibility_const . '
+ AND ' . $db->sql_in_set('p.post_visibility', $visibility_const) . '
' . (($sort_order_sql[0] == 'u') ? 'AND u.user_id = p.poster_id' : '') . '
' . (($topic_id) ? 'AND p.topic_id = ' . $topic_id : '') . "
AND t.topic_id = p.topic_id
@@ -472,7 +471,7 @@ class mcp_queue
$sql = 'SELECT t.forum_id, t.topic_id, t.topic_title, t.topic_title AS post_subject, t.topic_time AS post_time, t.topic_poster AS poster_id, t.topic_first_post_id AS post_id, t.topic_attachment AS post_attachment, t.topic_first_poster_name AS username, t.topic_first_poster_colour AS user_colour
FROM ' . TOPICS_TABLE . ' t
WHERE ' . $db->sql_in_set('forum_id', $forum_list) . '
- AND topic_visibility = ' . $visibility_const . "
+ AND ' . $db->sql_in_set('topic_visibility', $visibility_const) . "
AND topic_delete_user <> 0
$limit_time_sql
ORDER BY $sort_order_sql";
@@ -660,11 +659,18 @@ class mcp_queue
}
$phpbb_notifications->delete_notifications('post_in_queue', $post_id);
- $phpbb_notifications->add_notifications(array(
- 'quote',
- 'bookmark',
- 'post',
- ), $post_data);
+ // Only add notifications, if we are not reapproving post
+ // When the topic was already approved, but was edited and
+ // now needs re-approval, we don't want to notify the users
+ // again.
+ if ($post_data['post_visibility'] == ITEM_UNAPPROVED)
+ {
+ $phpbb_notifications->add_notifications(array(
+ 'quote',
+ 'bookmark',
+ 'post',
+ ), $post_data);
+ }
$phpbb_notifications->mark_notifications_read(array(
'quote',
@@ -832,10 +838,18 @@ class mcp_queue
));
$phpbb_notifications->delete_notifications('topic_in_queue', $topic_id);
- $phpbb_notifications->add_notifications(array(
- 'quote',
- 'topic',
- ), $topic_data);
+
+ // Only add notifications, if we are not reapproving post
+ // When the topic was already approved, but was edited and
+ // now needs re-approval, we don't want to notify the users
+ // again.
+ if ($topic_data['topic_visibility'] == ITEM_UNAPPROVED)
+ {
+ $phpbb_notifications->add_notifications(array(
+ 'quote',
+ 'topic',
+ ), $topic_data);
+ }
$phpbb_notifications->mark_notifications_read('quote', $topic_data['post_id'], $user->data['user_id']);
$phpbb_notifications->mark_notifications_read('topic', $topic_id, $user->data['user_id']);
@@ -1060,7 +1074,7 @@ class mcp_queue
if ($is_disapproving)
{
$l_log_message = ($log_data['type'] == 'topic') ? 'LOG_TOPIC_DISAPPROVED' : 'LOG_POST_DISAPPROVED';
- add_log('mod', $log_data['forum_id'], $log_data['topic_id'], $l_log_message, $log_data['post_subject'], $disapprove_reason);
+ add_log('mod', $log_data['forum_id'], $log_data['topic_id'], $l_log_message, $log_data['post_subject'], $disapprove_reason, $log_data['post_username']);
}
else
{
@@ -1126,7 +1140,6 @@ class mcp_queue
$post_data['disapprove_reason'] .= ($reason) ? "\n\n" . $reason : '';
}
-
if ($disapprove_all_posts_in_topic && $topic_information[$topic_id]['topic_posts_unapproved'] == 1)
{
// If there is only 1 post when disapproving the topic,
@@ -1144,7 +1157,6 @@ class mcp_queue
unset($lang_reasons, $post_info, $disapprove_reason, $disapprove_reason_lang);
-
if ($num_disapproved_topics)
{
$success_msg = ($num_disapproved_topics == 1) ? 'TOPIC' : 'TOPICS';
diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php
index 8026e071cd..5681b83212 100644
--- a/phpBB/includes/mcp/mcp_reports.php
+++ b/phpBB/includes/mcp/mcp_reports.php
@@ -98,10 +98,10 @@ class mcp_reports
$post_id = $report['post_id'];
$report_id = $report['report_id'];
-
+
$parse_post_flags = $report['reported_post_enable_bbcode'] ? OPTION_FLAG_BBCODE : 0;
$parse_post_flags += $report['reported_post_enable_smilies'] ? OPTION_FLAG_SMILIES : 0;
- $parse_post_flags += $report['reported_post_enable_magic_url'] ? OPTION_FLAG_LINKS : 0;
+ $parse_post_flags += $report['reported_post_enable_magic_url'] ? OPTION_FLAG_LINKS : 0;
$post_info = get_post_data(array($post_id), 'm_report', true);
@@ -144,7 +144,6 @@ class mcp_reports
$post_unread = (isset($topic_tracking_info[$post_info['topic_id']]) && $post_info['post_time'] > $topic_tracking_info[$post_info['topic_id']]) ? true : false;
-
$report['report_text'] = make_clickable(bbcode_nl2br($report['report_text']));
if ($post_info['post_attachment'] && $auth->acl_get('u_download') && $auth->acl_get('f_download', $post_info['forum_id']))
@@ -187,7 +186,7 @@ class mcp_reports
'S_CLOSE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $post_info['forum_id'] . '&amp;p=' . $post_id),
'S_CAN_VIEWIP' => $auth->acl_get('m_info', $post_info['forum_id']),
'S_POST_REPORTED' => $post_info['post_reported'],
- 'S_POST_UNAPPROVED' => ($post_info['post_visibility'] == ITEM_UNAPPROVED),
+ 'S_POST_UNAPPROVED' => $post_info['post_visibility'] == ITEM_UNAPPROVED || $post_info['post_visibility'] == ITEM_REAPPROVE,
'S_POST_LOCKED' => $post_info['post_edit_locked'],
'S_REPORT_CLOSED' => $report['report_closed'],
'S_USER_NOTES' => true,
@@ -578,7 +577,6 @@ function close_report($report_id_list, $mode, $action, $pm = false)
}
$db->sql_query($sql);
-
if (sizeof($close_report_posts))
{
if ($pm)
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php
index cdb88bf2bf..48efa330d4 100644
--- a/phpBB/includes/mcp/mcp_topic.php
+++ b/phpBB/includes/mcp/mcp_topic.php
@@ -212,7 +212,7 @@ function mcp_topic_view($id, $mode, $action)
parse_attachments($topic_info['forum_id'], $message, $attachments[$row['post_id']], $update_count);
}
- if ($row['post_visibility'] == ITEM_UNAPPROVED)
+ if ($row['post_visibility'] == ITEM_UNAPPROVED || $row['post_visibility'] == ITEM_REAPPROVE)
{
$has_unapproved_posts = true;
}
@@ -239,7 +239,7 @@ function mcp_topic_view($id, $mode, $action)
'MINI_POST_IMG' => ($post_unread) ? $user->img('icon_post_target_unread', 'UNREAD_POST') : $user->img('icon_post_target', 'POST'),
'S_POST_REPORTED' => ($row['post_reported'] && $auth->acl_get('m_report', $topic_info['forum_id'])),
- 'S_POST_UNAPPROVED' => ($row['post_visibility'] == ITEM_UNAPPROVED && $auth->acl_get('m_approve', $topic_info['forum_id'])),
+ 'S_POST_UNAPPROVED' => (($row['post_visibility'] == ITEM_UNAPPROVED || $row['post_visibility'] == ITEM_REAPPROVE) && $auth->acl_get('m_approve', $topic_info['forum_id'])),
'S_POST_DELETED' => ($row['post_visibility'] == ITEM_DELETED && $auth->acl_get('m_approve', $topic_info['forum_id'])),
'S_CHECKED' => (($submitted_id_list && !in_array(intval($row['post_id']), $submitted_id_list)) || in_array(intval($row['post_id']), $checked_ids)) ? true : false,
'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false,
@@ -462,7 +462,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
while ($row = $db->sql_fetchrow($result))
{
// If split from selected post (split_beyond), we split the unapproved items too.
- if ($row['post_visibility'] == ITEM_UNAPPROVED && !$auth->acl_get('m_approve', $row['forum_id']))
+ if (($row['post_visibility'] == ITEM_UNAPPROVED || $row['post_visibility'] == ITEM_REAPPROVE) && !$auth->acl_get('m_approve', $row['forum_id']))
{
// continue;
}
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index ad6743b3a3..17a350bab3 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -104,7 +104,7 @@ class bbcode_firstpass extends bbcode
function bbcode_init($allow_custom_bbcode = true)
{
global $phpbb_dispatcher;
-
+
static $rowset;
// This array holds all bbcode data. BBCodes will be processed in this
diff --git a/phpBB/includes/ucp/info/ucp_auth_link.php b/phpBB/includes/ucp/info/ucp_auth_link.php
index ee88b15ea8..3a34232d28 100644
--- a/phpBB/includes/ucp/info/ucp_auth_link.php
+++ b/phpBB/includes/ucp/info/ucp_auth_link.php
@@ -19,7 +19,7 @@ class ucp_auth_link_info
'title' => 'UCP_AUTH_LINK',
'version' => '1.0.0',
'modes' => array(
- 'auth_link' => array('title' => 'UCP_AUTH_LINK_MANAGE', 'auth' => '', 'cat' => array('UCP_PROFILE')),
+ 'auth_link' => array('title' => 'UCP_AUTH_LINK_MANAGE', 'auth' => 'authmethod_oauth', 'cat' => array('UCP_PROFILE')),
),
);
}
diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php
index b4b14b11d7..11ba2fba4d 100644
--- a/phpBB/includes/ucp/ucp_main.php
+++ b/phpBB/includes/ucp/ucp_main.php
@@ -619,7 +619,6 @@ class ucp_main
break;
}
-
$template->assign_vars(array(
'L_TITLE' => $user->lang['UCP_MAIN_' . strtoupper($mode)],
@@ -691,7 +690,6 @@ class ucp_main
AND t.topic_id = tw.topic_id
AND ' . $db->sql_in_set('t.forum_id', $forbidden_forum_ary, true, true),
-
'ORDER_BY' => 't.topic_last_post_time DESC'
);
diff --git a/phpBB/includes/ucp/ucp_notifications.php b/phpBB/includes/ucp/ucp_notifications.php
index 7c487b9073..f3b72d12aa 100644
--- a/phpBB/includes/ucp/ucp_notifications.php
+++ b/phpBB/includes/ucp/ucp_notifications.php
@@ -99,7 +99,7 @@ class ucp_notifications
meta_refresh(3, $this->u_action);
$message = $user->lang['NOTIFICATIONS_MARK_ALL_READ_SUCCESS'];
-
+
if ($request->is_ajax())
{
$json_response = new \phpbb\json_response();
diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php
index 7e13b5b9c6..74dc08d875 100644
--- a/phpBB/includes/ucp/ucp_pm.php
+++ b/phpBB/includes/ucp/ucp_pm.php
@@ -172,7 +172,6 @@ class ucp_pm
trigger_error('NO_AUTH_READ_HOLD_MESSAGE');
}
-
// First Handle Mark actions and moving messages
$submit_mark = (isset($_POST['submit_mark'])) ? true : false;
$move_pm = (isset($_POST['move_pm'])) ? true : false;
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index 3d95dc9a97..e5a1c1b915 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -586,7 +586,6 @@ function compose_pm($id, $mode, $action, $user_folders = array())
);
$s_hidden_fields .= build_address_field($address_list);
-
confirm_box(false, 'SAVE_DRAFT', $s_hidden_fields);
}
}
@@ -748,7 +747,6 @@ function compose_pm($id, $mode, $action, $user_folders = array())
$return_box_url = ($action === 'post' || $action === 'edit') ? $outbox_folder_url : $inbox_folder_url;
$return_box_lang = ($action === 'post' || $action === 'edit') ? 'PM_OUTBOX' : 'PM_INBOX';
-
$save_message = ($action === 'edit') ? $user->lang['MESSAGE_EDITED'] : $user->lang['MESSAGE_STORED'];
$message = $save_message . '<br /><br />' . $user->lang('VIEW_PRIVATE_MESSAGE', '<a href="' . $return_message_url . '">', '</a>');
@@ -1006,7 +1004,6 @@ function compose_pm($id, $mode, $action, $user_folders = array())
// Build hidden address list
$s_hidden_address_field = build_address_field($address_list);
-
$bbcode_checked = (isset($enable_bbcode)) ? !$enable_bbcode : (($config['allow_bbcode'] && $auth->acl_get('u_pm_bbcode')) ? !$user->optionget('bbcode') : 1);
$smilies_checked = (isset($enable_smilies)) ? !$enable_smilies : (($config['allow_smilies'] && $auth->acl_get('u_pm_smilies')) ? !$user->optionget('smilies') : 1);
$urls_checked = (isset($enable_urls)) ? !$enable_urls : 0;
diff --git a/phpBB/includes/ucp/ucp_pm_options.php b/phpBB/includes/ucp/ucp_pm_options.php
index 26ce6ed28f..71c96a25b6 100644
--- a/phpBB/includes/ucp/ucp_pm_options.php
+++ b/phpBB/includes/ucp/ucp_pm_options.php
@@ -65,7 +65,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
trigger_error($message);
}
}
-
+
// Add Folder
if (isset($_POST['addfolder']))
{
@@ -226,7 +226,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
// Move Messages
case 1:
$num_moved = move_pm($user->data['user_id'], $user->data['message_limit'], $msg_ids, $move_to, $remove_folder_id);
-
+
// Something went wrong, only partially moved?
if ($num_moved != $folder_row['pm_count'])
{
@@ -418,7 +418,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
$result = $db->sql_query($sql);
$num_messages = (int) $db->sql_fetchfield('num_messages');
$db->sql_freeresult($result);
-
+
$folder[PRIVMSGS_INBOX] = array(
'folder_name' => $user->lang['PM_INBOX'],
'message_status' => $user->lang('FOLDER_MESSAGE_STATUS', $user->lang('MESSAGES_COUNT', (int) $user->data['message_limit']), $num_messages),
@@ -691,7 +691,7 @@ function define_rule_option($hardcoded, $rule_option, $rule_lang, $check_ary)
function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule_conditions)
{
global $db, $template, $auth, $user;
-
+
$template->assign_vars(array(
'S_COND_DEFINED' => true,
'S_COND_SELECT' => (!$hardcoded && isset($global_rule_conditions[$rule_option])) ? true : false)
@@ -715,7 +715,7 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
{
case 'text':
$rule_string = utf8_normalize_nfc(request_var('rule_string', '', true));
-
+
$template->assign_vars(array(
'S_TEXT_CONDITION' => true,
'CURRENT_STRING' => $rule_string,
@@ -729,7 +729,7 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
case 'user':
$rule_user_id = request_var('rule_user_id', 0);
$rule_string = utf8_normalize_nfc(request_var('rule_string', '', true));
-
+
if ($rule_string && !$rule_user_id)
{
$sql = 'SELECT user_id
@@ -791,10 +791,10 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
{
$sql .= 'WHERE';
}
-
- $sql .= " (g.group_name NOT IN ('GUESTS', 'BOTS') OR g.group_type <> " . GROUP_SPECIAL . ')
+
+ $sql .= " (g.group_name NOT IN ('GUESTS', 'BOTS') OR g.group_type <> " . GROUP_SPECIAL . ')
ORDER BY g.group_type DESC, g.group_name ASC';
-
+
$result = $db->sql_query($sql);
$s_group_options = '';
@@ -807,7 +807,7 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
$s_class = ($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '';
$s_selected = ($row['group_id'] == $rule_group_id) ? ' selected="selected"' : '';
-
+
$s_group_options .= '<option value="' . $row['group_id'] . '"' . $s_class . $s_selected . '>' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
}
$db->sql_freeresult($result);
@@ -845,7 +845,7 @@ function show_defined_rules($user_id, $check_lang, $rule_lang, $action_lang, $fo
WHERE user_id = ' . $user_id . '
ORDER BY rule_id ASC';
$result = $db->sql_query($sql);
-
+
$count = 0;
while ($row = $db->sql_fetchrow($result))
{
diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php
index 03064a31d3..364d0caf25 100644
--- a/phpBB/includes/ucp/ucp_pm_viewmessage.php
+++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php
@@ -248,9 +248,18 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
* @var array message_row Array with message data
* @var array cp_row Array with senders custom profile field data
* @var array msg_data Template array with message data
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
- $vars = array('id', 'mode', 'folder_id', 'msg_id', 'folder', 'message_row', 'cp_row', 'msg_data');
+ $vars = array(
+ 'id',
+ 'mode',
+ 'folder_id',
+ 'msg_id',
+ 'folder',
+ 'message_row',
+ 'cp_row',
+ 'msg_data',
+ );
extract($phpbb_dispatcher->trigger_event('core.ucp_pm_view_messsage', compact($vars)));
$template->assign_vars($msg_data);
@@ -274,7 +283,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
{
$template->assign_block_vars('dl_method', $method);
}
-
+
foreach ($attachments as $attachment)
{
$template->assign_block_vars('attachment', array(
diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php
index e80cc2dce3..e3339c4c0b 100644
--- a/phpBB/includes/ucp/ucp_prefs.php
+++ b/phpBB/includes/ucp/ucp_prefs.php
@@ -64,7 +64,7 @@ class ucp_prefs
* @var bool submit Do we display the form only
* or did the user press submit
* @var array data Array with current ucp options data
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('submit', 'data');
extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_personal_data', compact($vars)));
@@ -113,7 +113,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
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('data', 'sql_ary');
extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_personal_update_data', compact($vars)));
@@ -243,7 +243,7 @@ class ucp_prefs
* @var bool submit Do we display the form only
* or did the user press submit
* @var array data Array with current ucp options data
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('submit', 'data');
extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_view_data', compact($vars)));
@@ -292,7 +292,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
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('data', 'sql_ary');
extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_view_update_data', compact($vars)));
@@ -394,7 +394,7 @@ class ucp_prefs
* @var bool submit Do we display the form only
* or did the user press submit
* @var array data Array with current ucp options data
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('submit', 'data');
extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_post_data', compact($vars)));
@@ -418,7 +418,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
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('data', 'sql_ary');
extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_post_update_data', compact($vars)));
diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php
index 090f9bf34c..bf9a15027a 100644
--- a/phpBB/includes/ucp/ucp_zebra.php
+++ b/phpBB/includes/ucp/ucp_zebra.php
@@ -62,7 +62,7 @@ class ucp_zebra
* @event core.ucp_remove_zebra
* @var string mode Zebra type: friends|foes
* @var array user_ids User ids we remove
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('mode', 'user_ids');
extract($phpbb_dispatcher->trigger_event('core.ucp_remove_zebra', compact($vars)));
@@ -207,7 +207,7 @@ class ucp_zebra
* friends|foes
* @var array sql_ary Array of
* entries we add
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('mode', 'sql_ary');
extract($phpbb_dispatcher->trigger_event('core.ucp_add_zebra', compact($vars)));
@@ -224,15 +224,15 @@ class ucp_zebra
}
}
}
-
+
if ($request->is_ajax())
{
$message = ($updated) ? $user->lang[$l_mode . '_UPDATED'] : implode('<br />', $error);
-
+
$json_response = new \phpbb\json_response;
$json_response->send(array(
'success' => $updated,
-
+
'MESSAGE_TITLE' => $user->lang['INFORMATION'],
'MESSAGE_TEXT' => $message,
'REFRESH_DATA' => array(
diff --git a/phpBB/includes/utf/utf_normalizer.php b/phpBB/includes/utf/utf_normalizer.php
index a208552d53..f8c9c76d4f 100644
--- a/phpBB/includes/utf/utf_normalizer.php
+++ b/phpBB/includes/utf/utf_normalizer.php
@@ -479,7 +479,6 @@ class utf_normalizer
continue;
}
-
// STEP 1: Decompose current char
// We have found a character that is either:
@@ -527,7 +526,6 @@ class utf_normalizer
$utf_seq = array($utf_char);
}
-
// STEP 2: Capture the starter
// Check out the combining class of the first character of the UTF sequence
@@ -683,7 +681,6 @@ class utf_normalizer
}
}
-
// STEP 3: Capture following combining modifiers
while ($pos < $len)
@@ -752,7 +749,6 @@ class utf_normalizer
}
}
-
// STEP 4: Sort and combine
// Here we sort...
@@ -991,7 +987,6 @@ class utf_normalizer
$tmp_pos = $last_cc = $sort = $dump = 0;
$utf_sort = array();
-
// Main loop
do
{
@@ -1047,7 +1042,6 @@ class utf_normalizer
continue;
}
-
// STEP 1: Decide what to do with current char
// Now, in that order:
diff --git a/phpBB/index.php b/phpBB/index.php
index 32bc118e8c..1c481d4363 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -63,7 +63,7 @@ if (($mark_notification = $request->variable('mark_notification', 0)))
redirect(append_sid($phpbb_root_path . $redirect));
}
- redirect($notification->get_url());
+ redirect($notification->get_redirect_url());
}
}
}
@@ -188,7 +188,7 @@ $page_title = $user->lang['INDEX'];
*
* @event core.index_modify_page_title
* @var string page_title Title of the index page
-* @since 3.1-A1
+* @since 3.1.0-a1
*/
$vars = array('page_title');
extract($phpbb_dispatcher->trigger_event('core.index_modify_page_title', compact($vars)));
diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php
index 29e5f7ab09..f3b8c82131 100644
--- a/phpBB/install/convertors/functions_phpbb20.php
+++ b/phpBB/install/convertors/functions_phpbb20.php
@@ -71,7 +71,6 @@ function phpbb_insert_forums()
$prune_enabled = (int) $src_db->sql_fetchfield('config_value');
$src_db->sql_freeresult($result);
-
// Insert categories
$sql = 'SELECT cat_id, cat_title
FROM ' . $convert->src_table_prefix . 'categories
@@ -571,7 +570,6 @@ function phpbb_convert_authentication($mode)
// What we will do is handling all 2.0.x admins as founder to replicate what is common in 2.0.x.
// After conversion the main admin need to make sure he is removing permissions and the founder status if wanted.
-
// Grab user ids of users with user_level of ADMIN
$sql = "SELECT user_id
FROM {$convert->src_table_prefix}users
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index bad51e2fe3..6c9eeb6a75 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -169,6 +169,8 @@ header('Content-type: text/html; charset=UTF-8');
<?php
+define('IN_DB_UPDATE', true);
+
/**
* @todo firebird/mysql update?
*/
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index c749b54f40..191be59258 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -217,7 +217,6 @@ class install_install extends module
'S_LEGEND' => false,
));
-
// Check for getimagesize
if (@function_exists('getimagesize'))
{
@@ -535,7 +534,6 @@ class install_install extends module
$url = (!in_array(false, $passed)) ? $this->p_master->module_url . "?mode=$mode&amp;sub=database&amp;language=$language" : $this->p_master->module_url . "?mode=$mode&amp;sub=requirements&amp;language=$language ";
$submit = (!in_array(false, $passed)) ? $lang['INSTALL_START'] : $lang['INSTALL_TEST'];
-
$template->assign_vars(array(
'L_SUBMIT' => $submit,
'S_HIDDEN' => $s_hidden_fields,
@@ -1649,6 +1647,45 @@ class install_install extends module
$_module->move_module_by($row, 'move_up', 5);
}
+ if ($module_class == 'mcp')
+ {
+ // Move pm report details module 3 down...
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_basename = 'mcp_pm_reports'
+ AND module_class = 'mcp'
+ AND module_mode = 'pm_report_details'";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $_module->move_module_by($row, 'move_down', 3);
+
+ // Move closed pm reports module 3 down...
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_basename = 'mcp_pm_reports'
+ AND module_class = 'mcp'
+ AND module_mode = 'pm_reports_closed'";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $_module->move_module_by($row, 'move_down', 3);
+
+ // Move open pm reports module 3 down...
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_basename = 'mcp_pm_reports'
+ AND module_class = 'mcp'
+ AND module_mode = 'pm_reports'";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $_module->move_module_by($row, 'move_down', 3);
+ }
+
if ($module_class == 'ucp')
{
// Move attachment module 4 down...
@@ -1662,6 +1699,30 @@ class install_install extends module
$db->sql_freeresult($result);
$_module->move_module_by($row, 'move_down', 4);
+
+ // Move notification options module 4 down...
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_basename = 'ucp_notifications'
+ AND module_class = 'ucp'
+ AND module_mode = 'notification_options'";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $_module->move_module_by($row, 'move_down', 4);
+
+ // Move OAuth module 5 down...
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_basename = 'ucp_auth_link'
+ AND module_class = 'ucp'
+ AND module_mode = 'auth_link'";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $_module->move_module_by($row, 'move_down', 5);
}
// And now for the special ones
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index bc76bf55b9..fbf1374346 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -56,6 +56,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_min_width',
INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_path', 'images/avatars/upload');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_salt', 'phpbb_avatar');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_contact', 'contact@yourdomain.tld');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_contact_name', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_disable', '0');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_disable_msg', '');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email', 'address@yourdomain.tld');
diff --git a/phpBB/language/en/acp/attachments.php b/phpBB/language/en/acp/attachments.php
index c7d68d29c2..6ca2865383 100644
--- a/phpBB/language/en/acp/attachments.php
+++ b/phpBB/language/en/acp/attachments.php
@@ -107,6 +107,9 @@ $lang = array_merge($lang, array(
'EXT_GROUP_REAL_MEDIA' => 'Real Media',
'EXT_GROUP_WINDOWS_MEDIA' => 'Windows Media',
+ 'FILES_GONE' => 'Some of the attachments you selected for deletion do not exist. They may have been already deleted. Attachments that did exist were deleted.',
+ 'FILES_STATS_WRONG' => 'Your file statistics are likely inaccurate and need to be resynchronised. Actual values: number of attachments = %1$d, total size of attachments = %2$s.<br />Click %3$shere%4$s to resynchronise them.',
+
'GO_TO_EXTENSIONS' => 'Go to extension management screen',
'GROUP_NAME' => 'Group name',
@@ -130,6 +133,7 @@ $lang = array_merge($lang, array(
'NOT_ALLOWED_IN_PM' => 'Only allowed in posts',
'NOT_ALLOWED_IN_PM_POST' => 'Not allowed',
'NOT_ASSIGNED' => 'Not assigned',
+ 'NO_ATTACHMENTS' => 'No attachments found for this period.',
'NO_EXT_GROUP' => 'None',
'NO_EXT_GROUP_NAME' => 'No group name entered',
'NO_EXT_GROUP_SPECIFIED' => 'No extension group specified.',
@@ -143,8 +147,9 @@ $lang = array_merge($lang, array(
'ORDER_ALLOW_DENY' => 'Allow',
'ORDER_DENY_ALLOW' => 'Deny',
- 'REMOVE_ALLOWED_IPS' => 'Remove or un-exclude <em>allowed</em> IPs/hostnames',
- 'REMOVE_DISALLOWED_IPS' => 'Remove or un-exclude <em>disallowed</em> IPs/hostnames',
+ 'REMOVE_ALLOWED_IPS' => 'Remove or un-exclude <em>allowed</em> IPs/hostnames',
+ 'REMOVE_DISALLOWED_IPS' => 'Remove or un-exclude <em>disallowed</em> IPs/hostnames',
+ 'RESYNC_FILES_STATS_CONFIRM' => 'Are you sure you wish to resynchronise file statistics?',
'SEARCH_IMAGICK' => 'Search for Imagemagick',
'SECURE_ALLOW_DENY' => 'Allow/Deny list',
diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php
index 4d5d8ee69b..e21d959e40 100644
--- a/phpBB/language/en/acp/board.php
+++ b/phpBB/language/en/acp/board.php
@@ -524,6 +524,8 @@ $lang = array_merge($lang, array(
'BOARD_HIDE_EMAILS_EXPLAIN' => 'This function keeps email addresses completely private.',
'CONTACT_EMAIL' => 'Contact email address',
'CONTACT_EMAIL_EXPLAIN' => 'This address will be used whenever a specific contact point is needed, e.g. spam, error output, etc. It will always be used as the <samp>From</samp> and <samp>Reply-To</samp> address in emails.',
+ 'CONTACT_EMAIL_NAME' => 'Contact name',
+ 'CONTACT_EMAIL_NAME_EXPLAIN' => 'This is the contact name that e-mail recipients will see. If you don’t want to have a contact name, leave this field empty.',
'EMAIL_FUNCTION_NAME' => 'Email function name',
'EMAIL_FUNCTION_NAME_EXPLAIN' => 'The email function used to send mails through PHP.',
'EMAIL_PACKAGE_SIZE' => 'Email package size',
diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php
index 5794a7c833..6f6a5f901f 100644
--- a/phpBB/language/en/acp/common.php
+++ b/phpBB/language/en/acp/common.php
@@ -85,7 +85,6 @@ $lang = array_merge($lang, array(
'ACP_EXTENSION_MANAGEMENT' => 'Extension management',
'ACP_EXTENSIONS' => 'Manage extensions',
-
'ACP_FORUM_BASED_PERMISSIONS' => 'Forum based permissions',
'ACP_FORUM_LOGS' => 'Forum logs',
'ACP_FORUM_MANAGEMENT' => 'Forum management',
@@ -241,9 +240,6 @@ $lang = array_merge($lang, array(
'EXPORT_DOWNLOAD' => 'Download',
'EXPORT_STORE' => 'Store',
- 'FILES_GONE' => 'Some of the attachments you selected for deletion do not exist. They may have been already deleted. Attachments that did exist were deleted.',
- 'FILES_STATS_WRONG' => 'Your files statistics are probably inaccurate and need to be resynchronised. Actual values: number of attachments = %1$d, total size of attachments = %2$s.',
-
'GENERAL_OPTIONS' => 'General options',
'GENERAL_SETTINGS' => 'General settings',
'GLOBAL_MASK' => 'Global permission mask',
@@ -286,8 +282,6 @@ $lang = array_merge($lang, array(
'REMIND' => 'Remind',
'RESYNC' => 'Resynchronise',
- 'RESYNC_FILES_STATS' => 'Resynchronise files statistics',
- 'RESYNC_FILES_STATS_EXPLAIN' => 'Recalculates the total number and size of files attached to posts and private messages.',
'SELECT_ANONYMOUS' => 'Select anonymous user',
'SELECT_OPTION' => 'Select option',
@@ -388,7 +382,6 @@ $lang = array_merge($lang, array(
'RESET_ONLINE' => 'Reset most users ever online',
'RESET_ONLINE_CONFIRM' => 'Are you sure you wish to reset the most users ever online counter?',
'RESET_ONLINE_SUCCESS' => 'Most users ever online reset',
- 'RESYNC_FILES_STATS_CONFIRM' => 'Are you sure you wish to resynchronise files statistics?',
'RESYNC_POSTCOUNTS' => 'Resynchronise post counts',
'RESYNC_POSTCOUNTS_EXPLAIN' => 'Only existing posts will be taken into consideration. Pruned posts will not be counted.',
'RESYNC_POSTCOUNTS_CONFIRM' => 'Are you sure you wish to resynchronise post counts?',
@@ -557,7 +550,7 @@ $lang = array_merge($lang, array(
'LOG_PM_REPORT_CLOSED' => '<strong>Closed PM report</strong><br />» %s',
'LOG_PM_REPORT_DELETED' => '<strong>Deleted PM report</strong><br />» %s',
'LOG_POST_APPROVED' => '<strong>Approved post</strong><br />» %s',
- 'LOG_POST_DISAPPROVED' => '<strong>Disapproved post “%1$s” with the following reason</strong><br />» %2$s',
+ 'LOG_POST_DISAPPROVED' => '<strong>Disapproved post “%1$s” written by “%3$s” for the following reason</strong><br />» %2$s',
'LOG_POST_EDITED' => '<strong>Edited post “%1$s” written by</strong><br />» %2$s',
'LOG_POST_RESTORED' => '<strong>Restored post</strong><br />» %s',
'LOG_REPORT_CLOSED' => '<strong>Closed report</strong><br />» %s',
@@ -570,7 +563,7 @@ $lang = array_merge($lang, array(
'LOG_TOPIC_APPROVED' => '<strong>Approved topic</strong><br />» %s',
'LOG_TOPIC_RESTORED' => '<strong>Restored topic</strong><br />» %s',
- 'LOG_TOPIC_DISAPPROVED' => '<strong>Disapproved topic “%1$s” with the following reason</strong><br />%2$s',
+ 'LOG_TOPIC_DISAPPROVED' => '<strong>Disapproved topic “%1$s” written by “%3$s” for the following reason</strong><br />» %2$s',
'LOG_TOPIC_RESYNC' => '<strong>Resynchronised topic counters</strong><br />» %s',
'LOG_TOPIC_TYPE_CHANGED' => '<strong>Changed topic type</strong><br />» %s',
'LOG_UNLOCK' => '<strong>Unlocked topic</strong><br />» %s',
@@ -684,7 +677,6 @@ $lang = array_merge($lang, array(
'LOG_PURGE_CACHE' => '<strong>Purged cache</strong>',
'LOG_PURGE_SESSIONS' => '<strong>Purged sessions</strong>',
-
'LOG_RANK_ADDED' => '<strong>Added new rank</strong><br />» %s',
'LOG_RANK_REMOVED' => '<strong>Removed rank</strong><br />» %s',
'LOG_RANK_UPDATED' => '<strong>Updated rank</strong><br />» %s',
@@ -696,7 +688,7 @@ $lang = array_merge($lang, array(
'LOG_REFERER_INVALID' => '<strong>Referer validation failed</strong><br />»Referer 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>Files statistics resynchronised</strong>',
+ 'LOG_RESYNC_FILES_STATS' => '<strong>File statistics resynchronised</strong>',
'LOG_RESYNC_POSTCOUNTS' => '<strong>User post counts resynchronised</strong>',
'LOG_RESYNC_POST_MARKING' => '<strong>Dotted topics resynchronised</strong>',
'LOG_RESYNC_STATS' => '<strong>Post, topic and user statistics resynchronised</strong>',
diff --git a/phpBB/language/en/acp/extensions.php b/phpBB/language/en/acp/extensions.php
index baa7d01763..39881668c4 100644
--- a/phpBB/language/en/acp/extensions.php
+++ b/phpBB/language/en/acp/extensions.php
@@ -33,7 +33,6 @@ if (empty($lang) || !is_array($lang))
// 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(
'EXTENSION' => 'Extension',
'EXTENSIONS' => 'Extensions',
diff --git a/phpBB/language/en/acp/permissions.php b/phpBB/language/en/acp/permissions.php
index 6e3ba6876a..36af461f87 100644
--- a/phpBB/language/en/acp/permissions.php
+++ b/phpBB/language/en/acp/permissions.php
@@ -182,7 +182,6 @@ $lang = array_merge($lang, array(
'ROLE_USER_STANDARD' => 'Standard Features',
'ROLE_USER_NEW_MEMBER' => 'Newly Registered User Features',
-
'ROLE_DESCRIPTION_ADMIN_FORUM' => 'Can access the forum management and forum permission settings.',
'ROLE_DESCRIPTION_ADMIN_FULL' => 'Has access to all administrative functions of this board.<br />Not recommended.',
'ROLE_DESCRIPTION_ADMIN_STANDARD' => 'Has access to most administrative features but is not allowed to use server or system related tools.',
diff --git a/phpBB/language/en/acp/posting.php b/phpBB/language/en/acp/posting.php
index ea3eadb0dd..cf570d844f 100644
--- a/phpBB/language/en/acp/posting.php
+++ b/phpBB/language/en/acp/posting.php
@@ -85,8 +85,8 @@ $lang = array_merge($lang, array(
'URL' => 'A valid URL using any protocol (http, ftp, etc… cannot be used for javascript exploits). If none is given, “http://” is prefixed to the string.',
'LOCAL_URL' => 'A local URL. The URL must be relative to the topic page and cannot contain a server name or protocol, as links are prefixed with “%s”',
'RELATIVE_URL' => 'A relative URL. You can use this to match parts of a URL, but be careful: a full URL is a valid relative URL. When you want to use relative URLs of your board, use the LOCAL_URL token.',
- 'COLOR' => 'A HTML colour, can be either in the numeric form <samp>#FF1234</samp> or a <a href="http://www.w3.org/TR/CSS21/syndata.html#value-def-color">CSS colour keyword</a> such as <samp>fuchsia</samp> or <samp>InactiveBorder</samp>'
- )
+ 'COLOR' => 'A HTML colour, can be either in the numeric form <samp>#FF1234</samp> or a <a href="http://www.w3.org/TR/CSS21/syndata.html#value-def-color">CSS colour keyword</a> such as <samp>fuchsia</samp> or <samp>InactiveBorder</samp>',
+ ),
));
// Smilies and topic icons
@@ -109,8 +109,6 @@ $lang = array_merge($lang, array(
'DISPLAY_POSTING' => 'On posting page',
'DISPLAY_POSTING_NO' => 'Not on posting page',
-
-
'EDIT_ICONS' => 'Edit icons',
'EDIT_SMILIES' => 'Edit smilies',
'EMOTION' => 'Emotion',
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index 677b228cc6..569ec776f5 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -422,14 +422,16 @@ $lang = array_merge($lang, array(
'NOT_WATCHING_FORUM' => 'You are no longer subscribed to updates on this forum.',
'NOT_WATCHING_TOPIC' => 'You are no longer subscribed to this topic.',
'NOTIFICATIONS' => 'Notifications',
- // This applies for NOTIFICATION_BOOKMARK, NOTIFICATION_POST, and NOTIFICATION_QUOTE.
+ // This applies for NOTIFICATION_BOOKMARK and NOTIFICATION_POST.
// %1$s will return a list of users that's concatenated using "," and "and" - see STRING_LIST
// Once the user count reaches 5 users or more, the list is trimmed using NOTIFICATION_X_OTHERS
+ // Once the user count reaches 20 users or more, the list is trimmed using NOTIFICATION_MANY_OTHERS
// Examples:
// A replied...
// A and B replied...
// A, B and C replied...
// A, B, C and 2 others replied...
+ // A, B, C and others replied...
'NOTIFICATION_BOOKMARK' => array(
1 => '%1$s replied to the topic “%2$s” you have bookmarked.',
),
@@ -454,7 +456,8 @@ $lang = array_merge($lang, array(
'NOTIFICATION_TOPIC_IN_QUEUE' => 'A new topic titled "%2$s" was posted by %1$s and needs approval.',
'NOTIFICATION_TYPE_NOT_EXIST' => 'The notification type "%s" is missing from the file system.',
'NOTIFICATION_ADMIN_ACTIVATE_USER' => 'The user “%1$s” is newly registered and requires activation.',
- // Used in conjuction with NOTIFICATION_BOOKMARK, NOTIFICATION_POST, and NOTIFICATION_QUOTE.
+ // Used in conjuction with NOTIFICATION_BOOKMARK and NOTIFICATION_POST.
+ 'NOTIFICATION_MANY_OTHERS' => 'others',
'NOTIFICATION_X_OTHERS' => array(
2 => '%d others',
),
@@ -1370,7 +1373,7 @@ $lang = array_merge($lang, array(
'D M d, Y g:i a' => 'Mon Jan 01, 2007 1:37 pm',
'F jS, Y, g:i a' => 'January 1st, 2007, 1:37 pm',
'|d M Y|, H:i' => 'Today, 13:37 / 01 Jan 2007, 13:37',
- '|F jS, Y|, g:i a' => 'Today, 1:37 pm / January 1st, 2007, 1:37 pm'
+ '|F jS, Y|, g:i a' => 'Today, 1:37 pm / January 1st, 2007, 1:37 pm',
),
// The default dateformat which will be used on new installs in this language
diff --git a/phpBB/language/en/email/admin_activate.txt b/phpBB/language/en/email/admin_activate.txt
index 8b11f1b450..a53ab1269e 100644
--- a/phpBB/language/en/email/admin_activate.txt
+++ b/phpBB/language/en/email/admin_activate.txt
@@ -10,5 +10,4 @@ Use this link to view the user's profile:
Use this link to activate the account:
{U_ACTIVATE}
-
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/admin_send_email.txt b/phpBB/language/en/email/admin_send_email.txt
index b778496258..7345a040fd 100644
--- a/phpBB/language/en/email/admin_send_email.txt
+++ b/phpBB/language/en/email/admin_send_email.txt
@@ -10,5 +10,4 @@ Message sent to you follows:
{MESSAGE}
-
{EMAIL_SIG}
diff --git a/phpBB/language/en/email/admin_welcome_activated.txt b/phpBB/language/en/email/admin_welcome_activated.txt
index cfdb69bdcb..2e136ac530 100644
--- a/phpBB/language/en/email/admin_welcome_activated.txt
+++ b/phpBB/language/en/email/admin_welcome_activated.txt
@@ -6,4 +6,4 @@ Your account on "{SITENAME}" has been activated by an administrator, you may log
Your password has been securely stored in our database and cannot be retrieved. In the event that it is forgotten, you will be able to reset it using the email address associated with your account.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/admin_welcome_inactive.txt b/phpBB/language/en/email/admin_welcome_inactive.txt
index 8605956318..f9a57b9fe3 100644
--- a/phpBB/language/en/email/admin_welcome_inactive.txt
+++ b/phpBB/language/en/email/admin_welcome_inactive.txt
@@ -16,4 +16,4 @@ Your password has been securely stored in our database and cannot be retrieved.
Thank you for registering.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/email_notify.txt b/phpBB/language/en/email/email_notify.txt
index 725b52f0cc..43c9098a4f 100644
--- a/phpBB/language/en/email/email_notify.txt
+++ b/phpBB/language/en/email/email_notify.txt
@@ -14,4 +14,4 @@ A message from {FROM_USERNAME} may also be included below. Please note that this
----------
-{MESSAGE} \ No newline at end of file
+{MESSAGE}
diff --git a/phpBB/language/en/email/installed.txt b/phpBB/language/en/email/installed.txt
index 8f63d07635..93444581f2 100644
--- a/phpBB/language/en/email/installed.txt
+++ b/phpBB/language/en/email/installed.txt
@@ -16,4 +16,4 @@ Useful information regarding the phpBB software can be found in the docs folder
In order to keep your board safe and secure, we highly recommended keeping current with software releases. For your convenience, a mailing list is available at the page referenced above.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/pm_report_closed.txt b/phpBB/language/en/email/pm_report_closed.txt
index 1b9f4a6658..0202b9d374 100644
--- a/phpBB/language/en/email/pm_report_closed.txt
+++ b/phpBB/language/en/email/pm_report_closed.txt
@@ -4,5 +4,4 @@ Hello {USERNAME},
You are receiving this notification because the report you filed regarding the private message "{PM_SUBJECT}" at "{SITENAME}" has been tended to by a moderator or administrator. The report is now closed. If you have further questions, please contact {CLOSER_NAME} by private message.
-
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/pm_report_deleted.txt b/phpBB/language/en/email/pm_report_deleted.txt
index a868837841..991ed59f31 100644
--- a/phpBB/language/en/email/pm_report_deleted.txt
+++ b/phpBB/language/en/email/pm_report_deleted.txt
@@ -4,5 +4,4 @@ Hello {USERNAME},
You are receiving this notification because the report you filed regarding the private message "{PM_SUBJECT}" at "{SITENAME}" was deleted by a moderator or administrator.
-
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/post_approved.txt b/phpBB/language/en/email/post_approved.txt
index a02dba142a..854d785f5f 100644
--- a/phpBB/language/en/email/post_approved.txt
+++ b/phpBB/language/en/email/post_approved.txt
@@ -10,4 +10,4 @@ If you want to view the post, click the following link:
If you want to view the topic, click the following link:
{U_VIEW_TOPIC}
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/short/post_approved.txt b/phpBB/language/en/email/short/post_approved.txt
index a02dba142a..854d785f5f 100644
--- a/phpBB/language/en/email/short/post_approved.txt
+++ b/phpBB/language/en/email/short/post_approved.txt
@@ -10,4 +10,4 @@ If you want to view the post, click the following link:
If you want to view the topic, click the following link:
{U_VIEW_TOPIC}
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/user_activate.txt b/phpBB/language/en/email/user_activate.txt
index 7d7960c4c5..b949b68651 100644
--- a/phpBB/language/en/email/user_activate.txt
+++ b/phpBB/language/en/email/user_activate.txt
@@ -6,4 +6,4 @@ Your account on "{SITENAME}" has been deactivated, most likely due to changes ma
{U_ACTIVATE}
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/user_activate_inactive.txt b/phpBB/language/en/email/user_activate_inactive.txt
index a90773d48c..7743420698 100644
--- a/phpBB/language/en/email/user_activate_inactive.txt
+++ b/phpBB/language/en/email/user_activate_inactive.txt
@@ -4,4 +4,4 @@ Hello {USERNAME},
Your account on "{SITENAME}" has been deactivated, most likely due to changes made to your profile. The administrator of the board will need to activate it before you can log in. You will receive another notification when this has occurred.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/user_activate_passwd.txt b/phpBB/language/en/email/user_activate_passwd.txt
index 695be115f8..965d5a552c 100644
--- a/phpBB/language/en/email/user_activate_passwd.txt
+++ b/phpBB/language/en/email/user_activate_passwd.txt
@@ -14,4 +14,4 @@ Password: {PASSWORD}
You can of course change this password yourself via the profile page. If you have any difficulties please contact the board administrator.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/user_reactivate_account.txt b/phpBB/language/en/email/user_reactivate_account.txt
index 385c09f4c5..7564b0a8e4 100644
--- a/phpBB/language/en/email/user_reactivate_account.txt
+++ b/phpBB/language/en/email/user_reactivate_account.txt
@@ -15,4 +15,4 @@ Please visit the following link to reactivate your account:
{U_ACTIVATE}
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/user_remind_inactive.txt b/phpBB/language/en/email/user_remind_inactive.txt
index 1ba28329f6..1f136b56f2 100644
--- a/phpBB/language/en/email/user_remind_inactive.txt
+++ b/phpBB/language/en/email/user_remind_inactive.txt
@@ -8,4 +8,4 @@ This notification is a reminder that your account at "{SITENAME}", created on {R
Thank you for registering at "{SITENAME}", we look forward to your participation.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/user_resend_inactive.txt b/phpBB/language/en/email/user_resend_inactive.txt
index b9b95ce9e5..d975a07b13 100644
--- a/phpBB/language/en/email/user_resend_inactive.txt
+++ b/phpBB/language/en/email/user_resend_inactive.txt
@@ -16,4 +16,4 @@ Please visit the following link in order to activate your account:
Thank you for registering.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/user_welcome.txt b/phpBB/language/en/email/user_welcome.txt
index aaead86afc..f299b7b23e 100644
--- a/phpBB/language/en/email/user_welcome.txt
+++ b/phpBB/language/en/email/user_welcome.txt
@@ -14,4 +14,4 @@ Your password has been securely stored in our database and cannot be retrieved.
Thank you for registering.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/email/user_welcome_inactive.txt b/phpBB/language/en/email/user_welcome_inactive.txt
index 5cbb3af3de..b4300d0032 100644
--- a/phpBB/language/en/email/user_welcome_inactive.txt
+++ b/phpBB/language/en/email/user_welcome_inactive.txt
@@ -18,4 +18,4 @@ Your password has been securely stored in our database and cannot be retrieved.
Thank you for registering.
-{EMAIL_SIG} \ No newline at end of file
+{EMAIL_SIG}
diff --git a/phpBB/language/en/groups.php b/phpBB/language/en/groups.php
index 6155d34a8c..c36d87f793 100644
--- a/phpBB/language/en/groups.php
+++ b/phpBB/language/en/groups.php
@@ -81,7 +81,7 @@ $lang = array_merge($lang, array(
'NOT_LEADER_OF_GROUP' => 'The requested operation cannot be taken because you are not a leader of the selected group.',
'NOT_MEMBER_OF_GROUP' => 'The requested operation cannot be taken because you are not a member of the selected group or your membership has not been approved yet.',
'NOT_RESIGN_FROM_DEFAULT_GROUP' => 'You are not allowed to resign from your default group.',
-
+
'PRIMARY_GROUP' => 'Primary group',
'REMOVE_SELECTED' => 'Remove selected',
diff --git a/phpBB/language/en/help_bbcode.php b/phpBB/language/en/help_bbcode.php
index d627ac3908..61263752b2 100644
--- a/phpBB/language/en/help_bbcode.php
+++ b/phpBB/language/en/help_bbcode.php
@@ -109,5 +109,5 @@ $help = array(
array(
0 => 'Can I add my own tags?',
1 => 'If you are an administrator on this board and have the proper permissions, you can add further BBCodes through the Custom BBCodes section.'
- )
+ ),
);
diff --git a/phpBB/language/en/help_faq.php b/phpBB/language/en/help_faq.php
index 94e6622685..d803ec91e4 100644
--- a/phpBB/language/en/help_faq.php
+++ b/phpBB/language/en/help_faq.php
@@ -337,5 +337,5 @@ $help = array(
array(
0 => 'Who do I contact about abusive and/or legal matters related to this board?',
1 => 'Any of the administrators listed on the “The team” page should be an appropriate point of contact for your complaints. If this still gets no response then you should contact the owner of the domain (do a <a href="http://www.google.com/search?q=whois">whois lookup</a>) or, if this is running on a free service (e.g. Yahoo!, free.fr, f2s.com, etc.), the management or abuse department of that service. Please note that the phpBB Group has <strong>absolutely no jurisdiction</strong> and cannot in any way be held liable over how, where or by whom this board is used. Do not contact the phpBB Group in relation to any legal (cease and desist, liable, defamatory comment, etc.) matter <strong>not directly related</strong> to the phpBB.com website or the discrete software of phpBB itself. If you do email phpBB Group <strong>about any third party</strong> use of this software then you should expect a terse response or no response at all.'
- )
+ ),
);
diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php
index b75e0ea495..dffa40db2f 100644
--- a/phpBB/language/en/mcp.php
+++ b/phpBB/language/en/mcp.php
@@ -426,6 +426,6 @@ $lang = array_merge($lang, array(
'SPAM' => 'The reported message has the only purpose to advertise for a website or another product.',
'OFF_TOPIC' => 'The reported message is off topic.',
'OTHER' => 'The reported message does not fit into any other category, please use the further information field.',
- )
+ ),
),
));
diff --git a/phpBB/language/en/posting.php b/phpBB/language/en/posting.php
index c1d8cef7de..e3b6101310 100644
--- a/phpBB/language/en/posting.php
+++ b/phpBB/language/en/posting.php
@@ -53,7 +53,7 @@ $lang = array_merge($lang, array(
'BBCODE_IS_OFF' => '%sBBCode%s is <em>OFF</em>',
'BBCODE_IS_ON' => '%sBBCode%s is <em>ON</em>',
'BBCODE_I_HELP' => 'Italic text: [i]text[/i]',
- 'BBCODE_L_HELP' => 'List: [list][*]text[/list]',
+ 'BBCODE_L_HELP' => 'List: [list][*]text[/list]',
'BBCODE_LISTITEM_HELP' => 'List item: [*]text',
'BBCODE_O_HELP' => 'Ordered list: e.g. [list=1][*]First point[/list] or [list=a][*]Point a[/list]',
'BBCODE_P_HELP' => 'Insert image: [img]http://image_url[/img]',
diff --git a/phpBB/language/en/search.php b/phpBB/language/en/search.php
index f65022fbcb..13aa66514c 100644
--- a/phpBB/language/en/search.php
+++ b/phpBB/language/en/search.php
@@ -69,7 +69,10 @@ $lang = array_merge($lang, array(
'NO_RECENT_SEARCHES' => 'No searches have been carried out recently.',
'NO_SEARCH' => 'Sorry but you are not permitted to use the search system.',
'NO_SEARCH_RESULTS' => 'No suitable matches were found.',
- 'NO_SEARCH_TIME' => 'Sorry but you cannot use search at this time. Please try again in a few minutes.',
+ 'NO_SEARCH_TIME' => array(
+ 1 => 'Sorry but you cannot use search at this time. Please try again in %d second.',
+ 2 => 'Sorry but you cannot use search at this time. Please try again in %d seconds.',
+ ),
'NO_SEARCH_UNREADS' => 'Sorry but searching for unread posts has been disabled on this board.',
'WORD_IN_NO_POST' => 'No posts were found because the word <strong>%s</strong> is not contained in any post.',
'WORDS_IN_NO_POST' => 'No posts were found because the words <strong>%s</strong> are not contained in any post.',
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php
index 40c8bd9f8e..79d2b9fa3a 100644
--- a/phpBB/language/en/ucp.php
+++ b/phpBB/language/en/ucp.php
@@ -412,6 +412,7 @@ $lang = array_merge($lang, array(
'PM_SENTBOX' => 'Sent messages',
'PM_SUBJECT' => 'Message subject',
'PM_TO' => 'Send to',
+ 'PM_TOOLS' => 'Message tools',
'PM_USERS_REMOVED_NO_PM' => 'Some users couldn’t be added as they have disabled private message receipt.',
'POST_EDIT_PM' => 'Edit message',
'POST_FORWARD_PM' => 'Forward message',
@@ -602,14 +603,14 @@ $lang = array_merge($lang, array(
'PLACE_INTO_FOLDER' => 'Place into folder',
'MARK_AS_READ' => 'Mark as read',
'MARK_AS_IMPORTANT' => 'Mark message',
- 'DELETE_MESSAGE' => 'Delete message'
+ 'DELETE_MESSAGE' => 'Delete message',
),
'PM_CHECK' => array(
'SUBJECT' => 'Subject',
'SENDER' => 'Sender',
'MESSAGE' => 'Message',
'STATUS' => 'Message status',
- 'TO' => 'Sent To'
+ 'TO' => 'Sent To',
),
'PM_RULE' => array(
'IS_LIKE' => 'is like',
@@ -625,10 +626,9 @@ $lang = array_merge($lang, array(
'ANSWERED' => 'answered',
'FORWARDED' => 'forwarded',
'TO_GROUP' => 'to my default usergroup',
- 'TO_ME' => 'to me'
+ 'TO_ME' => 'to me',
),
-
'GROUPS_EXPLAIN' => 'Usergroups enable board admins to better administer users. By default you will be placed in a specific group, this is your default group. This group defines how you may appear to other users, for example your username colouration, avatar, rank, etc. Depending on whether the administrator allows it you may be allowed to change your default group. You may also be placed in or allowed to join other groups. Some groups may give you additional permissions to view content or increase your capabilities in other areas.',
'GROUP_LEADER' => 'Leaderships',
'GROUP_MEMBER' => 'Memberships',
diff --git a/phpBB/language/en/viewtopic.php b/phpBB/language/en/viewtopic.php
index b566f4b5c0..afbad5a0d6 100644
--- a/phpBB/language/en/viewtopic.php
+++ b/phpBB/language/en/viewtopic.php
@@ -58,7 +58,7 @@ $lang = array_merge($lang, array(
1 => 'Last edited by %2$s on %3$s, edited %1$d time in total.',
2 => 'Last edited by %2$s on %3$s, edited %1$d times in total.',
),
- 'EMAIL_TOPIC' => 'Email friend',
+ 'EMAIL_TOPIC' => 'Email topic',
'ERROR_NO_ATTACHMENT' => 'The selected attachment does not exist anymore.',
'FILE_NOT_FOUND_404' => 'The file <strong>%s</strong> does not exist.',
diff --git a/phpBB/mcp.php b/phpBB/mcp.php
index 1449346deb..3555eb3b48 100644
--- a/phpBB/mcp.php
+++ b/phpBB/mcp.php
@@ -197,7 +197,8 @@ if ($quickmod)
* @var bool is_valid_action Flag indicating if the action was handled properly
* @since 3.1.0-a4
*/
- extract($phpbb_dispatcher->trigger_event('core.modify_quickmod_options', compact(array('module', 'action', 'is_valid_action'))));
+ $vars = array('module', 'action', 'is_valid_action');
+ extract($phpbb_dispatcher->trigger_event('core.modify_quickmod_options', compact($vars)));
if (!$is_valid_action)
{
@@ -266,7 +267,16 @@ if (!$user_id && $username == '')
* @var int id Parent module id
* @since 3.1.0-b2
*/
-$vars = array('module', 'mode', 'user_id', 'forum_id', 'topic_id', 'post_id', 'username', 'id');
+$vars = array(
+ 'module',
+ 'mode',
+ 'user_id',
+ 'forum_id',
+ 'topic_id',
+ 'post_id',
+ 'username',
+ 'id',
+);
extract($phpbb_dispatcher->trigger_event('core.modify_mcp_modules_display_option', compact($vars)));
// Load and execute the relevant module
@@ -677,7 +687,7 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql,
case 'unapproved_posts':
case 'deleted_posts':
- $visibility_const = ($mode == 'unapproved_posts') ? ITEM_UNAPPROVED : ITEM_DELETED;
+ $visibility_const = ($mode == 'unapproved_posts') ? array(ITEM_UNAPPROVED, ITEM_REAPPROVE) : ITEM_DELETED;
$type = 'posts';
$default_key = 't';
$default_dir = 'd';
@@ -686,7 +696,7 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql,
$sql = 'SELECT COUNT(p.post_id) AS total
FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
$where_sql " . $db->sql_in_set('p.forum_id', ($forum_id) ? array($forum_id) : array_intersect(get_forum_list('f_read'), get_forum_list('m_approve'))) . '
- AND p.post_visibility = ' . $visibility_const . '
+ AND ' . $db->sql_in_set('p.post_visibility', $visibility_const) .'
AND t.topic_id = p.topic_id
AND t.topic_visibility <> p.post_visibility';
@@ -698,7 +708,7 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql,
case 'unapproved_topics':
case 'deleted_topics':
- $visibility_const = ($mode == 'unapproved_topics') ? ITEM_UNAPPROVED : ITEM_DELETED;
+ $visibility_const = ($mode == 'unapproved_topics') ? array(ITEM_UNAPPROVED, ITEM_REAPPROVE) : ITEM_DELETED;
$type = 'topics';
$default_key = 't';
$default_dir = 'd';
@@ -706,7 +716,7 @@ function mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql,
$sql = 'SELECT COUNT(topic_id) AS total
FROM ' . TOPICS_TABLE . "
$where_sql " . $db->sql_in_set('forum_id', ($forum_id) ? array($forum_id) : array_intersect(get_forum_list('f_read'), get_forum_list('m_approve'))) . '
- AND topic_visibility = ' . $visibility_const;
+ AND ' . $db->sql_in_set('topic_visibility', $visibility_const);
if ($min_time)
{
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index 8fceb4ac5b..63c8dc0c08 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -601,10 +601,19 @@ switch ($mode)
* enabled?
* @var bool friend Is the user friend?
* @var bool foe Is the user foe?
- * @since 3.1-A1
+ * @since 3.1.0-a1
* @changed 3.1.0-b2 Added friend and foe status
*/
- $vars = array('member', 'user_notes_enabled', 'warn_user_enabled', 'zebra_enabled', 'friends_enabled', 'foes_enabled', 'friend', 'foe');
+ $vars = array(
+ 'member',
+ 'user_notes_enabled',
+ 'warn_user_enabled',
+ 'zebra_enabled',
+ 'friends_enabled',
+ 'foes_enabled',
+ 'friend',
+ 'foe',
+ );
extract($phpbb_dispatcher->trigger_event('core.memberlist_view_profile', compact($vars)));
$template->assign_vars(show_profile($member, $user_notes_enabled, $warn_user_enabled));
@@ -624,7 +633,7 @@ switch ($mode)
$sql = 'SELECT COUNT(post_id) as posts_in_queue
FROM ' . POSTS_TABLE . '
WHERE poster_id = ' . $user_id . '
- AND post_visibility = ' . ITEM_UNAPPROVED;
+ AND ' . $db->sql_in_set('post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE));
$result = $db->sql_query($sql);
$member['posts_in_queue'] = (int) $db->sql_fetchfield('posts_in_queue');
$db->sql_freeresult($result);
@@ -1755,7 +1764,7 @@ function show_profile($data, $user_notes_enabled = false, $warn_user_enabled = f
* @event core.memberlist_prepare_profile_data
* @var array data Array with user's data
* @var array template_data Template array with user's data
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('data', 'template_data');
extract($phpbb_dispatcher->trigger_event('core.memberlist_prepare_profile_data', compact($vars)));
diff --git a/phpBB/phpbb/content_visibility.php b/phpBB/phpbb/content_visibility.php
index f3db37e478..881a8f2c54 100644
--- a/phpBB/phpbb/content_visibility.php
+++ b/phpBB/phpbb/content_visibility.php
@@ -215,23 +215,23 @@ class content_visibility
/**
* Change visibility status of one post or all posts of a topic
*
- * @param $visibility int Element of {ITEM_APPROVED, ITEM_DELETED}
+ * @param $visibility int Element of {ITEM_APPROVED, ITEM_DELETED, ITEM_REAPPROVE}
* @param $post_id mixed Post ID or array of post IDs to act on,
* if it is empty, all posts of topic_id will be modified
* @param $topic_id int Topic where $post_id is found
* @param $forum_id int Forum where $topic_id is found
* @param $user_id int User performing the action
* @param $time int Timestamp when the action is performed
- * @param $reason string Reason why the visibilty was changed.
+ * @param $reason string Reason why the visibility was changed.
* @param $is_starter bool Is this the first post of the topic changed?
* @param $is_latest bool Is this the last post of the topic changed?
* @param $limit_visibility mixed Limit updating per topic_id to a certain visibility
* @param $limit_delete_time mixed Limit updating per topic_id to a certain deletion time
- * @return array Changed post data, empty array if an error occured.
+ * @return array Changed post data, empty array if an error occurred.
*/
public function set_post_visibility($visibility, $post_id, $topic_id, $forum_id, $user_id, $time, $reason, $is_starter, $is_latest, $limit_visibility = false, $limit_delete_time = false)
{
- if (!in_array($visibility, array(ITEM_APPROVED, ITEM_DELETED)))
+ if (!in_array($visibility, array(ITEM_APPROVED, ITEM_DELETED, ITEM_REAPPROVE)))
{
return array();
}
@@ -326,7 +326,7 @@ class content_visibility
// Update users postcounts
foreach ($postcounts as $num_posts => $poster_ids)
{
- if ($visibility == ITEM_DELETED)
+ if (in_array($visibility, array(ITEM_REAPPROVE, ITEM_DELETED)))
{
$sql = 'UPDATE ' . $this->users_table . '
SET user_posts = 0
@@ -387,54 +387,36 @@ class content_visibility
// Update the topic's reply count and the forum's post count
if ($update_topic_postcount)
{
- $cur_posts = $cur_unapproved_posts = $cur_softdeleted_posts = 0;
+ $field_alias = array(
+ ITEM_APPROVED => 'posts_approved',
+ ITEM_UNAPPROVED => 'posts_unapproved',
+ ITEM_DELETED => 'posts_softdeleted',
+ ITEM_REAPPROVE => 'posts_unapproved',
+ );
+ $cur_posts = array_fill_keys($field_alias, 0);
+
foreach ($postcount_visibility as $post_visibility => $visibility_posts)
{
- // We need to substract the posts from the counters ...
- if ($post_visibility == ITEM_APPROVED)
- {
- $cur_posts += $visibility_posts;
- }
- else if ($post_visibility == ITEM_UNAPPROVED)
- {
- $cur_unapproved_posts += $visibility_posts;
- }
- else if ($post_visibility == ITEM_DELETED)
- {
- $cur_softdeleted_posts += $visibility_posts;
- }
+ $cur_posts[$field_alias[(int) $post_visibility]] += $visibility_posts;
}
$sql_ary = array();
- if ($visibility == ITEM_DELETED)
+ $recipient_field = $field_alias[$visibility];
+
+ foreach ($cur_posts as $field => $count)
{
- if ($cur_posts)
- {
- $sql_ary['posts_approved'] = ' - ' . $cur_posts;
- }
- if ($cur_unapproved_posts)
+ // Decrease the count for the old statuses.
+ if ($count && $field != $recipient_field)
{
- $sql_ary['posts_unapproved'] = ' - ' . $cur_unapproved_posts;
- }
- if ($cur_posts + $cur_unapproved_posts)
- {
- $sql_ary['posts_softdeleted'] = ' + ' . ($cur_posts + $cur_unapproved_posts);
+ $sql_ary[$field] = " - $count";
}
}
- else
+ // Add up the count from all statuses excluding the recipient status.
+ $count_increase = array_sum(array_diff($cur_posts, array($recipient_field)));
+
+ if ($count_increase)
{
- if ($cur_unapproved_posts)
- {
- $sql_ary['posts_unapproved'] = ' - ' . $cur_unapproved_posts;
- }
- if ($cur_softdeleted_posts)
- {
- $sql_ary['posts_softdeleted'] = ' - ' . $cur_softdeleted_posts;
- }
- if ($cur_softdeleted_posts + $cur_unapproved_posts)
- {
- $sql_ary['posts_approved'] = ' + ' . ($cur_softdeleted_posts + $cur_unapproved_posts);
- }
+ $sql_ary[$recipient_field] = " + $count_increase";
}
if (sizeof($sql_ary))
@@ -475,7 +457,7 @@ class content_visibility
* as soft deleted.
* If you want to update all posts, use the force option.
*
- * @param $visibility int Element of {ITEM_APPROVED, ITEM_DELETED}
+ * @param $visibility int Element of {ITEM_APPROVED, ITEM_DELETED, ITEM_REAPPROVE}
* @param $topic_id mixed Topic ID to act on
* @param $forum_id int Forum where $topic_id is found
* @param $user_id int User performing the action
@@ -486,7 +468,7 @@ class content_visibility
*/
public function set_topic_visibility($visibility, $topic_id, $forum_id, $user_id, $time, $reason, $force_update_all = false)
{
- if (!in_array($visibility, array(ITEM_APPROVED, ITEM_DELETED)))
+ if (!in_array($visibility, array(ITEM_APPROVED, ITEM_DELETED, ITEM_REAPPROVE)))
{
return array();
}
@@ -532,7 +514,7 @@ class content_visibility
}
else if (!$force_update_all && $original_topic_data['topic_visibility'] == ITEM_APPROVED && $visibility == ITEM_DELETED)
{
- // If we're soft deleting a topic we only approved posts are soft deleted.
+ // If we're soft deleting a topic we only mark approved posts as soft deleted.
$this->set_post_visibility($visibility, false, $topic_id, $forum_id, $user_id, $time, '', true, true, $original_topic_data['topic_visibility']);
}
else
diff --git a/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth2.php b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth2.php
new file mode 100644
index 0000000000..692647dcde
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/auth_provider_oauth2.php
@@ -0,0 +1,40 @@
+<?php
+/**
+*
+* @package migration
+* @copyright (c) 2014 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class auth_provider_oauth2 extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\auth_provider_oauth',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(
+ array($this, 'update_auth_link_module_auth'),
+ )),
+ );
+ }
+
+ public function update_auth_link_module_auth()
+ {
+ $sql = 'UPDATE ' . MODULES_TABLE . "
+ SET module_auth = 'authmethod_oauth'
+ WHERE module_class = 'ucp'
+ AND module_basename = 'ucp_auth_link'
+ AND module_mode = 'auth_link'
+ AND module_auth = ''";
+ $this->db->sql_query($sql);
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/board_contact_name.php b/phpBB/phpbb/db/migration/data/v310/board_contact_name.php
new file mode 100644
index 0000000000..37b4d50545
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/board_contact_name.php
@@ -0,0 +1,30 @@
+<?php
+/**
+*
+* @package migration
+* @copyright (c) 2014 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class board_contact_name extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return isset($this->config['board_contact_name']);
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\beta2');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('board_contact_name', '')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php b/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php
index d5da54b888..10243dc77f 100644
--- a/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php
+++ b/phpBB/phpbb/db/migration/data/v310/softdelete_p1.php
@@ -149,6 +149,15 @@ class softdelete_p1 extends \phpbb\db\migration\migration
$limit = 10;
$converted_forums = 0;
+ if (!$start)
+ {
+ // Preserve the forum_posts value for link forums as it represents redirects.
+ $sql = 'UPDATE ' . $this->table_prefix . 'forums
+ SET forum_posts_approved = forum_posts
+ WHERE forum_type = ' . FORUM_LINK;
+ $this->db->sql_query($sql);
+ }
+
$sql = 'SELECT forum_id, topic_visibility, COUNT(topic_id) AS sum_topics, SUM(topic_posts_approved) AS sum_posts_approved, SUM(topic_posts_unapproved) AS sum_posts_unapproved
FROM ' . $this->table_prefix . 'topics
GROUP BY forum_id, topic_visibility
diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php
index d3bbbc63c5..5ad8563e5c 100644
--- a/phpBB/phpbb/db/migrator.php
+++ b/phpBB/phpbb/db/migrator.php
@@ -509,10 +509,17 @@ class migrator
throw new \phpbb\db\migration\exception('MIGRATION_INVALID_DATA_CUSTOM_NOT_CALLABLE', $step);
}
- return array(
- $parameters[0],
- array($last_result),
- );
+ if ($reverse)
+ {
+ return false;
+ }
+ else
+ {
+ return array(
+ $parameters[0],
+ array($last_result),
+ );
+ }
break;
default:
diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools.php
index 7616849465..2b0132075b 100644
--- a/phpBB/phpbb/db/tools.php
+++ b/phpBB/phpbb/db/tools.php
@@ -34,6 +34,12 @@ class tools
var $dbms_type_map = array();
/**
+ * Is the used MS SQL Server a SQL Server 2000?
+ * @var bool
+ */
+ protected $is_sql_server_2000;
+
+ /**
* Get the column types for every database we support
*
* @return array
@@ -892,7 +898,7 @@ class tools
}
}
- // Add unqiue indexes?
+ // Add unique indexes?
if (!empty($schema_changes['add_unique_index']))
{
foreach ($schema_changes['add_unique_index'] as $table => $index_array)
@@ -1303,7 +1309,7 @@ class tools
}
/**
- * Check if a specified index exists in table. Does not return PRIMARY KEY and UNIQUE indexes.
+ * Check if a specified index exists in table. Does not return PRIMARY KEY indexes.
*
* @param string $table_name Table to check the index at
* @param string $index_name The index name to check
@@ -1846,50 +1852,46 @@ class tools
case 'mssql':
case 'mssqlnative':
- $sql = "SELECT CAST(SERVERPROPERTY('productversion') AS VARCHAR(25)) AS mssql_version";
- $result = $this->db->sql_query($sql);
- $row = $this->db->sql_fetchrow($result);
- $this->db->sql_freeresult($result);
+ // We need the data here
+ $old_return_statements = $this->return_statements;
+ $this->return_statements = true;
- // Remove default constraints
- if ($row['mssql_version'][0] == '8') // SQL Server 2000
- {
- // http://msdn.microsoft.com/en-us/library/aa175912%28v=sql.80%29.aspx
- // Deprecated in SQL Server 2005
- $statements[] = "DECLARE @drop_default_name VARCHAR(100), @cmd VARCHAR(1000)
- SET @drop_default_name =
- (SELECT so.name FROM sysobjects so
- JOIN sysconstraints sc ON so.id = sc.constid
- WHERE object_name(so.parent_obj) = '{$table_name}'
- AND so.xtype = 'D'
- AND sc.colid = (SELECT colid FROM syscolumns
- WHERE id = object_id('{$table_name}')
- AND name = '{$column_name}'))
- IF @drop_default_name <> ''
- BEGIN
- SET @cmd = 'ALTER TABLE [{$table_name}] DROP CONSTRAINT [' + @drop_default_name + ']'
- EXEC(@cmd)
- END";
- }
- else
- {
- $sql = "SELECT dobj.name AS def_name
- FROM sys.columns col
- LEFT OUTER JOIN sys.objects dobj ON (dobj.object_id = col.default_object_id AND dobj.type = 'D')
- WHERE col.object_id = object_id('{$table_name}')
- AND col.name = '{$column_name}'
- AND dobj.name IS NOT NULL";
- $result = $this->db->sql_query($sql);
- $row = $this->db->sql_fetchrow($result);
- $this->db->sql_freeresult($result);
+ $indexes = $this->mssql_get_existing_indexes($table_name, $column_name);
- if ($row)
+ // Drop any indexes
+ $recreate_indexes = array();
+ if (!empty($indexes))
+ {
+ foreach ($indexes as $index_name => $index_data)
{
- $statements[] = 'ALTER TABLE [' . $table_name . '] DROP CONSTRAINT [' . $row['def_name'] . ']';
+ $result = $this->sql_index_drop($table_name, $index_name);
+ $statements = array_merge($statements, $result);
+ if (sizeof($index_data) > 1)
+ {
+ // Remove this column from the index and recreate it
+ $recreate_indexes[$index_name] = array_diff($index_data, array($column_name));
+ }
}
}
+ // Drop default value constraint
+ $result = $this->mssql_get_drop_default_constraints_queries($table_name, $column_name);
+ $statements = array_merge($statements, $result);
+
+ // Remove the column
$statements[] = 'ALTER TABLE [' . $table_name . '] DROP COLUMN [' . $column_name . ']';
+
+ if (!empty($recreate_indexes))
+ {
+ // Recreate indexes after we removed the column
+ foreach ($recreate_indexes as $index_name => $index_data)
+ {
+ $result = $this->sql_create_index($table_name, $index_name, $index_data);
+ $statements = array_merge($statements, $result);
+ }
+ }
+
+ $this->return_statements = $old_return_statements;
break;
case 'mysql_40':
@@ -2371,53 +2373,46 @@ class tools
case 'mssql':
case 'mssqlnative':
+ // We need the data here
+ $old_return_statements = $this->return_statements;
+ $this->return_statements = true;
+
+ $indexes = $this->mssql_get_existing_indexes($table_name, $column_name);
+
+ // Drop any indexes
+ if (!empty($indexes))
+ {
+ foreach ($indexes as $index_name => $index_data)
+ {
+ $result = $this->sql_index_drop($table_name, $index_name);
+ $statements = array_merge($statements, $result);
+ }
+ }
+
+ // Drop default value constraint
+ $result = $this->mssql_get_drop_default_constraints_queries($table_name, $column_name);
+ $statements = array_merge($statements, $result);
+
+ // Change the column
$statements[] = 'ALTER TABLE [' . $table_name . '] ALTER COLUMN [' . $column_name . '] ' . $column_data['column_type_sql'];
if (!empty($column_data['default']))
{
- $sql = "SELECT CAST(SERVERPROPERTY('productversion') AS VARCHAR(25)) AS mssql_version";
- $result = $this->db->sql_query($sql);
- $row = $this->db->sql_fetchrow($result);
- $this->db->sql_freeresult($result);
+ // Add new default value constraint
+ $statements[] = 'ALTER TABLE [' . $table_name . '] ADD CONSTRAINT [DF_' . $table_name . '_' . $column_name . '_1] ' . $this->db->sql_escape($column_data['default']) . ' FOR [' . $column_name . ']';
+ }
- // Using TRANSACT-SQL for this statement because we do not want to have colliding data if statements are executed at a later stage
- if ($row['mssql_version'][0] == '8') // SQL Server 2000
- {
- $statements[] = "DECLARE @drop_default_name VARCHAR(100), @cmd VARCHAR(1000)
- SET @drop_default_name =
- (SELECT so.name FROM sysobjects so
- JOIN sysconstraints sc ON so.id = sc.constid
- WHERE object_name(so.parent_obj) = '{$table_name}'
- AND so.xtype = 'D'
- AND sc.colid = (SELECT colid FROM syscolumns
- WHERE id = object_id('{$table_name}')
- AND name = '{$column_name}'))
- IF @drop_default_name <> ''
- BEGIN
- SET @cmd = 'ALTER TABLE [{$table_name}] DROP CONSTRAINT [' + @drop_default_name + ']'
- EXEC(@cmd)
- END
- SET @cmd = 'ALTER TABLE [{$table_name}] ADD CONSTRAINT [DF_{$table_name}_{$column_name}_1] {$column_data['default']} FOR [{$column_name}]'
- EXEC(@cmd)";
- }
- else
+ if (!empty($indexes))
+ {
+ // Recreate indexes after we changed the column
+ foreach ($indexes as $index_name => $index_data)
{
- $statements[] = "DECLARE @drop_default_name VARCHAR(100), @cmd VARCHAR(1000)
- SET @drop_default_name =
- (SELECT dobj.name FROM sys.columns col
- LEFT OUTER JOIN sys.objects dobj ON (dobj.object_id = col.default_object_id AND dobj.type = 'D')
- WHERE col.object_id = object_id('{$table_name}')
- AND col.name = '{$column_name}'
- AND dobj.name IS NOT NULL)
- IF @drop_default_name <> ''
- BEGIN
- SET @cmd = 'ALTER TABLE [{$table_name}] DROP CONSTRAINT [' + @drop_default_name + ']'
- EXEC(@cmd)
- END
- SET @cmd = 'ALTER TABLE [{$table_name}] ADD CONSTRAINT [DF_{$table_name}_{$column_name}_1] {$column_data['default']} FOR [{$column_name}]'
- EXEC(@cmd)";
+ $result = $this->sql_create_index($table_name, $index_name, $index_data);
+ $statements = array_merge($statements, $result);
}
}
+
+ $this->return_statements = $old_return_statements;
break;
case 'mysql_40':
@@ -2551,4 +2546,159 @@ class tools
return $this->_sql_run_sql($statements);
}
+
+ /**
+ * Get queries to drop the default constraints of a column
+ *
+ * We need to drop the default constraints of a column,
+ * before being able to change their type or deleting them.
+ *
+ * @param string $table_name
+ * @param string $column_name
+ * @return array Array with SQL statements
+ */
+ protected function mssql_get_drop_default_constraints_queries($table_name, $column_name)
+ {
+ $statements = array();
+ if ($this->mssql_is_sql_server_2000())
+ {
+ // http://msdn.microsoft.com/en-us/library/aa175912%28v=sql.80%29.aspx
+ // Deprecated in SQL Server 2005
+ $sql = "SELECT so.name AS def_name
+ FROM sysobjects so
+ JOIN sysconstraints sc ON so.id = sc.constid
+ WHERE object_name(so.parent_obj) = '{$table_name}'
+ AND so.xtype = 'D'
+ AND sc.colid = (SELECT colid FROM syscolumns
+ WHERE id = object_id('{$table_name}')
+ AND name = '{$column_name}')";
+ }
+ else
+ {
+ $sql = "SELECT dobj.name AS def_name
+ FROM sys.columns col
+ LEFT OUTER JOIN sys.objects dobj ON (dobj.object_id = col.default_object_id AND dobj.type = 'D')
+ WHERE col.object_id = object_id('{$table_name}')
+ AND col.name = '{$column_name}'
+ AND dobj.name IS NOT NULL";
+ }
+
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $statements[] = 'ALTER TABLE [' . $table_name . '] DROP CONSTRAINT [' . $row['def_name'] . ']';
+ }
+ $this->db->sql_freeresult($result);
+
+ return $statements;
+ }
+
+ /**
+ * Get a list with existing indexes for the column
+ *
+ * @param string $table_name
+ * @param string $column_name
+ * @return array Array with Index name => columns
+ */
+ protected function mssql_get_existing_indexes($table_name, $column_name)
+ {
+ $existing_indexes = array();
+ if ($this->mssql_is_sql_server_2000())
+ {
+ // http://msdn.microsoft.com/en-us/library/aa175912%28v=sql.80%29.aspx
+ // Deprecated in SQL Server 2005
+ $sql = "SELECT DISTINCT ix.name AS phpbb_index_name
+ FROM sysindexes ix
+ INNER JOIN sysindexkeys ixc
+ ON ixc.id = ix.id
+ AND ixc.indid = ix.indid
+ INNER JOIN syscolumns cols
+ ON cols.colid = ixc.colid
+ AND cols.id = ix.id
+ WHERE ix.id = object_id('{$table_name}')
+ AND cols.name = '{$column_name}'";
+ }
+ else
+ {
+ $sql = "SELECT DISTINCT ix.name AS phpbb_index_name
+ FROM sys.indexes ix
+ INNER JOIN sys.index_columns ixc
+ ON ixc.object_id = ix.object_id
+ AND ixc.index_id = ix.index_id
+ INNER JOIN sys.columns cols
+ ON cols.column_id = ixc.column_id
+ AND cols.object_id = ix.object_id
+ WHERE ix.object_id = object_id('{$table_name}')
+ AND cols.name = '{$column_name}'";
+ }
+
+ $result = $this->db->sql_query($sql);
+ $existing_indexes = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $existing_indexes[$row['phpbb_index_name']] = array();
+ }
+ $this->db->sql_freeresult($result);
+
+ if (empty($existing_indexes))
+ {
+ return array();
+ }
+
+ if ($this->mssql_is_sql_server_2000())
+ {
+ $sql = "SELECT DISTINCT ix.name AS phpbb_index_name, cols.name AS phpbb_column_name
+ FROM sysindexes ix
+ INNER JOIN sysindexkeys ixc
+ ON ixc.id = ix.id
+ AND ixc.indid = ix.indid
+ INNER JOIN syscolumns cols
+ ON cols.colid = ixc.colid
+ AND cols.id = ix.id
+ WHERE ix.id = object_id('{$table_name}')
+ AND " . $this->db->sql_in_set('ix.name', array_keys($existing_indexes));
+ }
+ else
+ {
+ $sql = "SELECT DISTINCT ix.name AS phpbb_index_name, cols.name AS phpbb_column_name
+ FROM sys.indexes ix
+ INNER JOIN sys.index_columns ixc
+ ON ixc.object_id = ix.object_id
+ AND ixc.index_id = ix.index_id
+ INNER JOIN sys.columns cols
+ ON cols.column_id = ixc.column_id
+ AND cols.object_id = ix.object_id
+ WHERE ix.object_id = object_id('{$table_name}')
+ AND " . $this->db->sql_in_set('ix.name', array_keys($existing_indexes));
+ }
+
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $existing_indexes[$row['phpbb_index_name']][] = $row['phpbb_column_name'];
+ }
+ $this->db->sql_freeresult($result);
+
+ return $existing_indexes;
+ }
+
+ /**
+ * Is the used MS SQL Server a SQL Server 2000?
+ *
+ * @return bool
+ */
+ protected function mssql_is_sql_server_2000()
+ {
+ if ($this->is_sql_server_2000 === null)
+ {
+ $sql = "SELECT CAST(SERVERPROPERTY('productversion') AS VARCHAR(25)) AS mssql_version";
+ $result = $this->db->sql_query($sql);
+ $properties = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+ $this->is_sql_server_2000 = $properties['mssql_version'][0] == '8';
+ }
+
+ return $this->is_sql_server_2000;
+ }
}
diff --git a/phpBB/phpbb/event/md_exporter.php b/phpBB/phpbb/event/md_exporter.php
new file mode 100644
index 0000000000..af86882885
--- /dev/null
+++ b/phpBB/phpbb/event/md_exporter.php
@@ -0,0 +1,439 @@
+<?php
+/**
+*
+* @package phpBB3
+* @copyright (c) 2014 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+namespace phpbb\event;
+
+/**
+* Class md_exporter
+* Crawls through a markdown file and grabs all events
+*
+* @package phpbb\event
+*/
+class md_exporter
+{
+ /** @var string Path where we look for files*/
+ protected $path;
+
+ /** @var string phpBB Root Path */
+ protected $root_path;
+
+ /** @var string */
+ protected $filter;
+
+ /** @var string */
+ protected $current_event;
+
+ /** @var array */
+ protected $events;
+
+ /**
+ * @param string $phpbb_root_path
+ * @param mixed $extension String 'vendor/ext' to filter, null for phpBB core
+ */
+ public function __construct($phpbb_root_path, $extension = null)
+ {
+ $this->root_path = $phpbb_root_path;
+ $this->path = $this->root_path;
+ if ($extension)
+ {
+ $this->path .= 'ext/' . $extension . '/';
+ }
+
+ $this->events = array();
+ $this->events_by_file = array();
+ $this->filter = $this->current_event = '';
+ }
+
+ /**
+ * Get the list of all events
+ *
+ * @return array Array with events: name => details
+ */
+ public function get_events()
+ {
+ return $this->events;
+ }
+
+ /**
+ * @param string $md_file Relative from phpBB root
+ * @return int Number of events found
+ * @throws \LogicException
+ */
+ public function crawl_phpbb_directory_adm($md_file)
+ {
+ $this->crawl_eventsmd($md_file, 'adm');
+
+ $file_list = $this->get_recursive_file_list($this->path . 'adm/style/');
+ foreach ($file_list as $file)
+ {
+ $file_name = 'adm/style/' . $file;
+ $this->validate_events_from_file($file_name, $this->crawl_file_for_events($file_name));
+ }
+
+ return sizeof($this->events);
+ }
+
+ /**
+ * @param string $md_file Relative from phpBB root
+ * @return int Number of events found
+ * @throws \LogicException
+ */
+ public function crawl_phpbb_directory_styles($md_file)
+ {
+ $this->crawl_eventsmd($md_file, 'styles');
+
+ $styles = array('prosilver', 'subsilver2');
+ foreach ($styles as $style)
+ {
+ $file_list = $this->get_recursive_file_list(
+ $this->path . 'styles/' . $style . '/template/'
+ );
+
+ foreach ($file_list as $file)
+ {
+ $file_name = 'styles/' . $style . '/template/' . $file;
+ $this->validate_events_from_file($file_name, $this->crawl_file_for_events($file_name));
+ }
+ }
+
+ return sizeof($this->events);
+ }
+
+ /**
+ * @param string $md_file Relative from phpBB root
+ * @param string $filter Should be 'styles' or 'adm'
+ * @return int Number of events found
+ * @throws \LogicException
+ */
+ public function crawl_eventsmd($md_file, $filter)
+ {
+ if (!file_exists($this->path . $md_file))
+ {
+ throw new \LogicException("The event docs file '{$md_file}' could not be found");
+ }
+
+ $file_content = file_get_contents($this->path . $md_file);
+ $this->filter = $filter;
+
+ $events = explode("\n\n", $file_content);
+ foreach ($events as $event)
+ {
+ // Last row of the file
+ if (strpos($event, "\n===\n") === false)
+ {
+ continue;
+ }
+
+ list($event_name, $details) = explode("\n===\n", $event, 2);
+ $this->validate_event_name($event_name);
+ $this->current_event = $event_name;
+
+ if (isset($this->events[$this->current_event]))
+ {
+ throw new \LogicException("The event '{$this->current_event}' is defined multiple times");
+ }
+
+ if (($this->filter == 'adm' && strpos($this->current_event, 'acp_') !== 0)
+ || ($this->filter == 'styles' && strpos($this->current_event, 'acp_') === 0))
+ {
+ continue;
+ }
+
+ list($file_details, $details) = explode("\n* Since: ", $details, 2);
+ list($since, $description) = explode("\n* Purpose: ", $details, 2);
+
+ $files = $this->validate_file_list($file_details);
+ $since = $this->validate_since($since);
+
+ $this->events[$event_name] = array(
+ 'event' => $this->current_event,
+ 'files' => $files,
+ 'since' => $since,
+ 'description' => $description,
+ );
+ }
+
+ return sizeof($this->events);
+ }
+
+ /**
+ * Format the php events as a wiki table
+ * @return string Number of events found
+ */
+ public function export_events_for_wiki()
+ {
+ if ($this->filter === 'adm')
+ {
+ $wiki_page = '= ACP Template Events =' . "\n";
+ $wiki_page .= '{| class="zebra sortable" cellspacing="0" cellpadding="5"' . "\n";
+ $wiki_page .= '! Identifier !! Placement !! Added in Release !! Explanation' . "\n";
+ }
+ else
+ {
+ $wiki_page = '= Template Events =' . "\n";
+ $wiki_page .= '{| class="zebra sortable" cellspacing="0" cellpadding="5"' . "\n";
+ $wiki_page .= '! Identifier !! Prosilver Placement (If applicable) !! Subsilver Placement (If applicable) !! Added in Release !! Explanation' . "\n";
+ }
+
+ foreach ($this->events as $event_name => $event)
+ {
+ $wiki_page .= "|- id=\"{$event_name}\"\n";
+ $wiki_page .= "| [[#{$event_name}|{$event_name}]] || ";
+
+ if ($this->filter === 'adm')
+ {
+ $wiki_page .= implode(', ', $event['files']['adm']);
+ }
+ else
+ {
+ $wiki_page .= implode(', ', $event['files']['prosilver']) . ' || ' . implode(', ', $event['files']['subsilver2']);
+ }
+
+ $wiki_page .= " || {$event['since']} || " . str_replace("\n", ' ', $event['description']) . "\n";
+ }
+ $wiki_page .= '|}' . "\n";
+
+ return $wiki_page;
+ }
+
+ /**
+ * Validates a template event name
+ *
+ * @param $event_name
+ * @return null
+ * @throws \LogicException
+ */
+ public function validate_event_name($event_name)
+ {
+ if (!preg_match('#^([a-z][a-z0-9]*(?:_[a-z][a-z0-9]*)+)$#', $event_name))
+ {
+ throw new \LogicException("Invalid event name '{$event_name}'");
+ }
+ }
+
+ /**
+ * Validate "Since" Information
+ *
+ * @param string $since
+ * @return string
+ * @throws \LogicException
+ */
+ public function validate_since($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}'");
+ }
+
+ return $since;
+ }
+
+ /**
+ * Validate the files list
+ *
+ * @param string $file_details
+ * @return array
+ * @throws \LogicException
+ */
+ public function validate_file_list($file_details)
+ {
+ $files_list = array(
+ 'prosilver' => array(),
+ 'subsilver2' => array(),
+ 'adm' => array(),
+ );
+
+ // Multi file list
+ if (strpos($file_details, "* Locations:\n + ") === 0)
+ {
+ $file_details = substr($file_details, strlen("* Locations:\n + "));
+ $files = explode("\n + ", $file_details);
+ foreach ($files as $file)
+ {
+ if (!file_exists($this->path . $file) || substr($file, -5) !== '.html')
+ {
+ throw new \LogicException("Invalid file '{$file}' not found for event '{$this->current_event}'", 1);
+ }
+
+ if (($this->filter !== 'adm') && strpos($file, 'styles/prosilver/template/') === 0)
+ {
+ $files_list['prosilver'][] = substr($file, strlen('styles/prosilver/template/'));
+ }
+ else if (($this->filter !== 'adm') && strpos($file, 'styles/subsilver2/template/') === 0)
+ {
+ $files_list['subsilver2'][] = substr($file, strlen('styles/subsilver2/template/'));
+ }
+ else if (($this->filter === 'adm') && strpos($file, 'adm/style/') === 0)
+ {
+ $files_list['adm'][] = substr($file, strlen('adm/style/'));
+ }
+ else
+ {
+ throw new \LogicException("Invalid file '{$file}' not found for event '{$this->current_event}'", 2);
+ }
+
+ $this->events_by_file[$file][] = $this->current_event;
+ }
+ }
+ else if ($this->filter == 'adm')
+ {
+ $file = substr($file_details, strlen('* Location: '));
+ if (!file_exists($this->path . $file) || substr($file, -5) !== '.html')
+ {
+ throw new \LogicException("Invalid file '{$file}' not found for event '{$this->current_event}'", 1);
+ }
+
+ $files_list['adm'][] = substr($file, strlen('adm/style/'));
+
+ $this->events_by_file[$file][] = $this->current_event;
+ }
+ else
+ {
+ throw new \LogicException("Invalid file list found for event '{$this->current_event}'", 2);
+ }
+
+ return $files_list;
+ }
+
+ /**
+ * Get all template events in a template file
+ *
+ * @param string $file
+ * @return array
+ * @throws \LogicException
+ */
+ public function crawl_file_for_events($file)
+ {
+ if (!file_exists($this->path . $file))
+ {
+ throw new \LogicException("File '{$file}' does not exist", 1);
+ }
+
+ $event_list = array();
+ $file_content = file_get_contents($this->path . $file);
+
+ $events = explode('<!-- EVENT ', $file_content);
+ // Remove the code before the first event
+ array_shift($events);
+ foreach ($events as $event)
+ {
+ $event = explode(' -->', $event, 2);
+ $event_list[] = array_shift($event);
+ }
+
+ return $event_list;
+ }
+
+ /**
+ * Validates whether all events from $file are in the md file and vice-versa
+ *
+ * @param string $file
+ * @param array $events
+ * @return true
+ * @throws \LogicException
+ */
+ public function validate_events_from_file($file, array $events)
+ {
+ if (empty($this->events_by_file[$file]) && empty($events))
+ {
+ return true;
+ }
+ else if (empty($this->events_by_file[$file]))
+ {
+ $event_list = implode("', '", $events);
+ throw new \LogicException("File '{$file}' should not contain events, but contains: "
+ . "'{$event_list}'", 1);
+ }
+ else if (empty($events))
+ {
+ $event_list = implode("', '", $this->events_by_file[$file]);
+ throw new \LogicException("File '{$file}' contains no events, but should contain: "
+ . "'{$event_list}'", 1);
+ }
+
+ $missing_events_from_file = array();
+ foreach ($this->events_by_file[$file] as $event)
+ {
+ if (!in_array($event, $events))
+ {
+ $missing_events_from_file[] = $event;
+ }
+ }
+
+ if (!empty($missing_events_from_file))
+ {
+ $event_list = implode("', '", $missing_events_from_file);
+ throw new \LogicException("File '{$file}' does not contain events: '{$event_list}'", 2);
+ }
+
+ $missing_events_from_md = array();
+ foreach ($events as $event)
+ {
+ if (!in_array($event, $this->events_by_file[$file]))
+ {
+ $missing_events_from_md[] = $event;
+ }
+ }
+
+ if (!empty($missing_events_from_md))
+ {
+ $event_list = implode("', '", $missing_events_from_md);
+ throw new \LogicException("File '{$file}' contains additional events: '{$event_list}'", 3);
+ }
+
+ return true;
+ }
+
+ /**
+ * Returns a list of files in $dir
+ *
+ * Works recursive with any depth
+ *
+ * @param string $dir Directory to go through
+ * @return array List of files (including directories)
+ */
+ public function get_recursive_file_list($dir)
+ {
+ try
+ {
+ $iterator = new \RecursiveIteratorIterator(
+ new \phpbb\recursive_dot_prefix_filter_iterator(
+ new \RecursiveDirectoryIterator(
+ $dir,
+ \FilesystemIterator::SKIP_DOTS
+ )
+ ),
+ \RecursiveIteratorIterator::SELF_FIRST
+ );
+ }
+ catch (\Exception $e)
+ {
+ return array();
+ }
+
+ $files = array();
+ foreach ($iterator as $file_info)
+ {
+ /** @var \RecursiveDirectoryIterator $file_info */
+ if ($file_info->isDir())
+ {
+ continue;
+ }
+
+ $relative_path = $iterator->getInnerIterator()->getSubPathname();
+
+ if (substr($relative_path, -5) == '.html')
+ {
+ $files[] = str_replace(DIRECTORY_SEPARATOR, '/', $relative_path);
+ }
+ }
+
+ return $files;
+ }
+}
diff --git a/phpBB/phpbb/event/php_exporter.php b/phpBB/phpbb/event/php_exporter.php
new file mode 100644
index 0000000000..d86ee3c045
--- /dev/null
+++ b/phpBB/phpbb/event/php_exporter.php
@@ -0,0 +1,608 @@
+<?php
+/**
+*
+* @package phpBB3
+* @copyright (c) 2014 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+namespace phpbb\event;
+
+/**
+* Class php_exporter
+* Crawls through a list of files and grabs all php-events
+*
+* @package phpbb\event
+*/
+class php_exporter
+{
+ /** @var string Path where we look for files*/
+ protected $path;
+
+ /** @var string phpBB Root Path */
+ protected $root_path;
+
+ /** @var string */
+ protected $current_file;
+
+ /** @var string */
+ protected $current_event;
+
+ /** @var int */
+ protected $current_event_line;
+
+ /** @var array */
+ protected $events;
+
+ /** @var array */
+ protected $file_lines;
+
+ /**
+ * @param string $phpbb_root_path
+ * @param mixed $extension String 'vendor/ext' to filter, null for phpBB core
+ */
+ public function __construct($phpbb_root_path, $extension = null)
+ {
+ $this->root_path = $phpbb_root_path;
+ $this->path = $phpbb_root_path;
+ $this->events = $this->file_lines = array();
+ $this->current_file = $this->current_event = '';
+ $this->current_event_line = 0;
+
+ $this->path = $this->root_path;
+ if ($extension)
+ {
+ $this->path .= 'ext/' . $extension . '/';
+ }
+ }
+
+ /**
+ * Get the list of all events
+ *
+ * @return array Array with events: name => details
+ */
+ public function get_events()
+ {
+ return $this->events;
+ }
+
+ /**
+ * Set current event data
+ *
+ * @param string $name Name of the current event (used for error messages)
+ * @param int $line Line where the current event is placed in
+ * @return null
+ */
+ public function set_current_event($name, $line)
+ {
+ $this->current_event = $name;
+ $this->current_event_line = $line;
+ }
+
+ /**
+ * Set the content of this file
+ *
+ * @param array $content Array with the lines of the file
+ * @return null
+ */
+ public function set_content($content)
+ {
+ $this->file_lines = $content;
+ }
+
+ /**
+ * Crawl the phpBB/ directory for php events
+ * @return int The number of events found
+ */
+ public function crawl_phpbb_directory_php()
+ {
+ $files = $this->get_recursive_file_list();
+ $this->events = array();
+ foreach ($files as $file)
+ {
+ $this->crawl_php_file($file);
+ }
+ ksort($this->events);
+
+ return sizeof($this->events);
+ }
+
+ /**
+ * Returns a list of files in $dir
+ *
+ * @return array List of files (including the path)
+ */
+ public function get_recursive_file_list()
+ {
+ try
+ {
+ $iterator = new \RecursiveIteratorIterator(
+ new \phpbb\event\recursive_event_filter_iterator(
+ new \RecursiveDirectoryIterator(
+ $this->path,
+ \FilesystemIterator::SKIP_DOTS
+ ),
+ $this->path
+ ),
+ \RecursiveIteratorIterator::LEAVES_ONLY
+ );
+ }
+ catch (\Exception $e)
+ {
+ return array();
+ }
+
+ $files = array();
+ foreach ($iterator as $file_info)
+ {
+ /** @var \RecursiveDirectoryIterator $file_info */
+ $relative_path = $iterator->getInnerIterator()->getSubPathname();
+ $files[] = str_replace(DIRECTORY_SEPARATOR, '/', $relative_path);
+ }
+
+ return $files;
+ }
+
+ /**
+ * Format the php events as a wiki table
+ * @return string
+ */
+ public function export_events_for_wiki()
+ {
+ $wiki_page = '= PHP Events (Hook Locations) =' . "\n";
+ $wiki_page .= '{| class="sortable zebra" cellspacing="0" cellpadding="5"' . "\n";
+ $wiki_page .= '! Identifier !! Placement !! Arguments !! Added in Release !! Explanation' . "\n";
+ foreach ($this->events as $event)
+ {
+ $wiki_page .= '|- id="' . $event['event'] . '"' . "\n";
+ $wiki_page .= '| [[#' . $event['event'] . '|' . $event['event'] . ']] || ' . $event['file'] . ' || ' . implode(', ', $event['arguments']) . ' || ' . $event['since'] . ' || ' . $event['description'] . "\n";
+ }
+ $wiki_page .= '|}' . "\n";
+
+ return $wiki_page;
+ }
+
+ /**
+ * @param string $file
+ * @return int Number of events found in this file
+ * @throws \LogicException
+ */
+ public function crawl_php_file($file)
+ {
+ $this->current_file = $file;
+ $this->file_lines = array();
+ $content = file_get_contents($this->path . $this->current_file);
+ $num_events_found = 0;
+
+ if (strpos($content, "dispatcher->trigger_event('") || strpos($content, "dispatcher->dispatch('"))
+ {
+ $this->set_content(explode("\n", $content));
+ for ($i = 0, $num_lines = sizeof($this->file_lines); $i < $num_lines; $i++)
+ {
+ $event_line = false;
+ $found_trigger_event = strpos($this->file_lines[$i], "dispatcher->trigger_event('");
+ $arguments = array();
+ if ($found_trigger_event !== false)
+ {
+ $event_line = $i;
+ $this->set_current_event($this->get_event_name($event_line, false), $event_line);
+
+ // Find variables of the event
+ $arguments = $this->get_vars_from_array();
+ $doc_vars = $this->get_vars_from_docblock();
+ $this->validate_vars_docblock_array($arguments, $doc_vars);
+ }
+ else
+ {
+ $found_dispatch = strpos($this->file_lines[$i], "dispatcher->dispatch('");
+ if ($found_dispatch !== false)
+ {
+ $event_line = $i;
+ $this->set_current_event($this->get_event_name($event_line, true), $event_line);
+ }
+ }
+
+ if ($event_line)
+ {
+ // Validate @event
+ $event_line_num = $this->find_event();
+ $this->validate_event($this->current_event, $this->file_lines[$event_line_num]);
+
+ // Validate @since
+ $since_line_num = $this->find_since();
+ $since = $this->validate_since($this->file_lines[$since_line_num]);
+
+ // Find event description line
+ $description_line_num = $this->find_description();
+ $description = substr(trim($this->file_lines[$description_line_num]), strlen('* '));
+
+ if (isset($this->events[$this->current_event]))
+ {
+ throw new \LogicException("The event '{$this->current_event}' from file "
+ . "'{$this->current_file}:{$event_line_num}' already exists in file "
+ . "'{$this->events[$this->current_event]['file']}'", 10);
+ }
+
+ sort($arguments);
+ $this->events[$this->current_event] = array(
+ 'event' => $this->current_event,
+ 'file' => $this->current_file,
+ 'arguments' => $arguments,
+ 'since' => $since,
+ 'description' => $description,
+ );
+ $num_events_found++;
+ }
+ }
+ }
+
+ return $num_events_found;
+ }
+
+ /**
+ * Find the name of the event inside the dispatch() line
+ *
+ * @param int $event_line
+ * @param bool $is_dispatch Do we look for dispatch() or trigger_event() ?
+ * @return string Name of the event
+ * @throws \LogicException
+ */
+ public function get_event_name($event_line, $is_dispatch)
+ {
+ $event_text_line = $this->file_lines[$event_line];
+ $event_text_line = ltrim($event_text_line, "\t");
+
+ if ($is_dispatch)
+ {
+ $regex = '#\$([a-z](?:[a-z0-9_]|->)*)';
+ $regex .= '->dispatch\(';
+ $regex .= '\'' . $this->preg_match_event_name() . '\'';
+ $regex .= '\);#';
+ }
+ else
+ {
+ $regex = '#extract\(\$([a-z](?:[a-z0-9_]|->)*)';
+ $regex .= '->trigger_event\(';
+ $regex .= '\'' . $this->preg_match_event_name() . '\'';
+ $regex .= ', compact\(\$vars\)\)\);#';
+ }
+
+ $match = array();
+ preg_match($regex, $event_text_line, $match);
+ if (!isset($match[2]))
+ {
+ throw new \LogicException("Can not find event name in line '{$event_text_line}' "
+ . "in file '{$this->current_file}:{$event_line}'", 1);
+ }
+
+ return $match[2];
+ }
+
+ /**
+ * Returns a regex match for the event name
+ *
+ * @return string
+ */
+ protected function preg_match_event_name()
+ {
+ return '([a-z][a-z0-9_]*(?:\.[a-z][a-z0-9_]*)+)';
+ }
+
+ /**
+ * Find the $vars array
+ *
+ * @return array List of variables
+ * @throws \LogicException
+ */
+ public function get_vars_from_array()
+ {
+ $line = ltrim($this->file_lines[$this->current_event_line - 1], "\t");
+ if ($line === ');')
+ {
+ $vars_array = $this->get_vars_from_multi_line_array();
+ }
+ else
+ {
+ $vars_array = $this->get_vars_from_single_line_array($line);
+ }
+
+ foreach ($vars_array as $var)
+ {
+ if (!preg_match('#^([a-zA-Z_][a-zA-Z0-9_]*)$#', $var))
+ {
+ throw new \LogicException("Found invalid var '{$var}' in array for event '{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 3);
+ }
+ }
+
+ sort($vars_array);
+ return $vars_array;
+ }
+
+ /**
+ * Find the variables in single line array
+ *
+ * @param string $line
+ * @param bool $throw_multiline Throw an exception when there are too
+ * many arguments in one line.
+ * @return array List of variables
+ * @throws \LogicException
+ */
+ public function get_vars_from_single_line_array($line, $throw_multiline = true)
+ {
+ $match = array();
+ preg_match('#^\$vars = array\(\'([a-zA-Z0-9_\' ,]+)\'\);$#', $line, $match);
+
+ if (isset($match[1]))
+ {
+ $vars_array = explode("', '", $match[1]);
+ if ($throw_multiline && sizeof($vars_array) > 6)
+ {
+ throw new \LogicException('Should use multiple lines for $vars definition '
+ . "for event '{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 2);
+ }
+ return $vars_array;
+ }
+ else
+ {
+ throw new \LogicException("Can not find '\$vars = array();'-line for event '{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 1);
+ }
+ }
+
+ /**
+ * Find the variables in single line array
+ *
+ * @return array List of variables
+ * @throws \LogicException
+ */
+ public function get_vars_from_multi_line_array()
+ {
+ $current_vars_line = 2;
+ $var_lines = array();
+ while (ltrim($this->file_lines[$this->current_event_line - $current_vars_line], "\t") !== '$vars = array(')
+ {
+ $var_lines[] = substr(trim($this->file_lines[$this->current_event_line - $current_vars_line]), 0, -1);
+
+ $current_vars_line++;
+ if ($current_vars_line > $this->current_event_line)
+ {
+ // Reached the start of the file
+ throw new \LogicException("Can not find end of \$vars array for event '{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 2);
+ }
+ }
+
+ return $this->get_vars_from_single_line_array('$vars = array(' . implode(", ", $var_lines) . ');', false);
+ }
+
+ /**
+ * Find the $vars array
+ *
+ * @return array List of variables
+ * @throws \LogicException
+ */
+ public function get_vars_from_docblock()
+ {
+ $doc_vars = array();
+ $current_doc_line = 1;
+ $found_comment_end = false;
+ while (ltrim($this->file_lines[$this->current_event_line - $current_doc_line], "\t") !== '/**')
+ {
+ if (ltrim($this->file_lines[$this->current_event_line - $current_doc_line], "\t") === '*/')
+ {
+ $found_comment_end = true;
+ }
+
+ if ($found_comment_end)
+ {
+ $var_line = trim($this->file_lines[$this->current_event_line - $current_doc_line]);
+ $var_line = preg_replace('!\s+!', ' ', $var_line);
+ if (strpos($var_line, '* @var ') === 0)
+ {
+ $doc_line = explode(' ', $var_line, 5);
+ if (sizeof($doc_line) !== 5)
+ {
+ throw new \LogicException("Found invalid line '{$this->file_lines[$this->current_event_line - $current_doc_line]}' "
+ . "for event '{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 1);
+ }
+ $doc_vars[] = $doc_line[3];
+ }
+ }
+
+ $current_doc_line++;
+ if ($current_doc_line > $this->current_event_line)
+ {
+ // Reached the start of the file
+ throw new \LogicException("Can not find end of docblock for event '{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 2);
+ }
+ }
+
+ if (empty($doc_vars))
+ {
+ // Reached the start of the file
+ throw new \LogicException("Can not find @var lines for event '{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 3);
+ }
+
+ foreach ($doc_vars as $var)
+ {
+ if (!preg_match('#^([a-zA-Z_][a-zA-Z0-9_]*)$#', $var))
+ {
+ throw new \LogicException("Found invalid @var '{$var}' in docblock for event "
+ . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 4);
+ }
+ }
+
+ sort($doc_vars);
+ return $doc_vars;
+ }
+
+ /**
+ * Find the "@since" Information line
+ *
+ * @return int Absolute line number
+ * @throws \LogicException
+ */
+ public function find_since()
+ {
+ return $this->find_tag('since', array('event', 'var'));
+ }
+
+ /**
+ * Find the "@event" Information line
+ *
+ * @return int Absolute line number
+ */
+ public function find_event()
+ {
+ return $this->find_tag('event', array());
+ }
+
+ /**
+ * Find a "@*" Information line
+ *
+ * @param string $find_tag Name of the tag we are trying to find
+ * @param array $disallowed_tags List of tags that must not appear between
+ * the tag and the actual event
+ * @return int Absolute line number
+ * @throws \LogicException
+ */
+ public function find_tag($find_tag, $disallowed_tags)
+ {
+ $find_tag_line = 0;
+ $found_comment_end = false;
+ while (strpos(ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t"), '* @' . $find_tag . ' ') !== 0)
+ {
+ if ($found_comment_end && ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t") === '/**')
+ {
+ // Reached the start of this doc block
+ throw new \LogicException("Can not find '@{$find_tag}' information for event "
+ . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 1);
+ }
+
+ foreach ($disallowed_tags as $disallowed_tag)
+ {
+ if ($found_comment_end && strpos(ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t"), '* @' . $disallowed_tag) === 0)
+ {
+ // Found @var after the @since
+ throw new \LogicException("Found '@{$disallowed_tag}' information after '@{$find_tag}' for event "
+ . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 3);
+ }
+ }
+
+ if (ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t") === '*/')
+ {
+ $found_comment_end = true;
+ }
+
+ $find_tag_line++;
+ if ($find_tag_line >= $this->current_event_line)
+ {
+ // Reached the start of the file
+ throw new \LogicException("Can not find '@{$find_tag}' information for event "
+ . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 2);
+ }
+ }
+
+ return $this->current_event_line - $find_tag_line;
+ }
+
+ /**
+ * Find a "@*" Information line
+ *
+ * @return int Absolute line number
+ * @throws \LogicException
+ */
+ public function find_description()
+ {
+ $find_desc_line = 0;
+ while (ltrim($this->file_lines[$this->current_event_line - $find_desc_line], "\t") !== '/**')
+ {
+ $find_desc_line++;
+ if ($find_desc_line > $this->current_event_line)
+ {
+ // Reached the start of the file
+ throw new \LogicException("Can not find a description for event "
+ . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 1);
+ }
+ }
+
+ $find_desc_line = $this->current_event_line - $find_desc_line + 1;
+
+ $desc = trim($this->file_lines[$find_desc_line]);
+ if (strpos($desc, '* @') === 0 || $desc[0] !== '*' || substr($desc, 1) == '')
+ {
+ // First line of the doc block is a @-line, empty or only contains "*"
+ throw new \LogicException("Can not find a description for event "
+ . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 2);
+ }
+
+ return $find_desc_line;
+ }
+
+ /**
+ * Validate "@since" Information
+ *
+ * @param string $line
+ * @return string
+ * @throws \LogicException
+ */
+ public function validate_since($line)
+ {
+ $match = array();
+ 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 "
+ . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'");
+ }
+
+ return $match[1];
+ }
+
+ /**
+ * Validate "@event" Information
+ *
+ * @param string $event_name
+ * @param string $line
+ * @return string
+ * @throws \LogicException
+ */
+ public function validate_event($event_name, $line)
+ {
+ $event = substr(ltrim($line, "\t"), strlen('* @event '));
+
+ if ($event !== trim($event))
+ {
+ throw new \LogicException("Invalid '@event' information for event "
+ . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 1);
+ }
+
+ if ($event !== $event_name)
+ {
+ throw new \LogicException("Event name does not match '@event' tag for event "
+ . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'", 2);
+ }
+
+ return $event;
+ }
+
+ /**
+ * Validates that two arrays contain the same strings
+ *
+ * @param array $vars_array Variables found in the array line
+ * @param array $vars_docblock Variables found in the doc block
+ * @return null
+ * @throws \LogicException
+ */
+ public function validate_vars_docblock_array($vars_array, $vars_docblock)
+ {
+ $vars_array = array_unique($vars_array);
+ $vars_docblock = array_unique($vars_docblock);
+ $sizeof_vars_array = sizeof($vars_array);
+
+ if ($sizeof_vars_array !== sizeof($vars_docblock) || $sizeof_vars_array !== sizeof(array_intersect($vars_array, $vars_docblock)))
+ {
+ throw new \LogicException("\$vars array does not match the list of '@var' tags for event "
+ . "'{$this->current_event}' in file '{$this->current_file}:{$this->current_event_line}'");
+ }
+ }
+}
diff --git a/phpBB/phpbb/event/recursive_event_filter_iterator.php b/phpBB/phpbb/event/recursive_event_filter_iterator.php
new file mode 100644
index 0000000000..ef2f2ec0ed
--- /dev/null
+++ b/phpBB/phpbb/event/recursive_event_filter_iterator.php
@@ -0,0 +1,70 @@
+<?php
+/**
+*
+* @package event
+* @copyright (c) 2014 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+namespace phpbb\event;
+
+/**
+* Class recursive_event_filter_iterator
+*
+* This filter ignores directories and files starting with a dot.
+* It also skips some directories that do not contain events anyway,
+* such as e.g. files/, store/ and vendor/
+*
+* @package phpbb\event
+*/
+class recursive_event_filter_iterator extends \RecursiveFilterIterator
+{
+ protected $root_path;
+
+ /**
+ * Construct
+ *
+ * @param \RecursiveIterator $iterator
+ * @param string $root_path
+ */
+ public function __construct(\RecursiveIterator $iterator, $root_path)
+ {
+ $this->root_path = str_replace(DIRECTORY_SEPARATOR, '/', $root_path);
+ parent::__construct($iterator);
+ }
+
+ /**
+ * Return the inner iterator's children contained in a recursive_event_filter_iterator
+ *
+ * @return recursive_event_filter_iterator
+ */
+ public function getChildren() {
+ return new self($this->getInnerIterator()->getChildren(), $this->root_path);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ public function accept()
+ {
+ $relative_path = str_replace(DIRECTORY_SEPARATOR, '/', $this->current());
+ $filename = $this->current()->getFilename();
+
+ return (substr($relative_path, -4) === '.php' || $this->current()->isDir())
+ && $filename[0] !== '.'
+ && strpos($relative_path, $this->root_path . 'cache/') !== 0
+ && strpos($relative_path, $this->root_path . 'develop/') !== 0
+ && strpos($relative_path, $this->root_path . 'docs/') !== 0
+ && strpos($relative_path, $this->root_path . 'ext/') !== 0
+ && strpos($relative_path, $this->root_path . 'files/') !== 0
+ && strpos($relative_path, $this->root_path . 'includes/utf/') !== 0
+ && strpos($relative_path, $this->root_path . 'language/') !== 0
+ && strpos($relative_path, $this->root_path . 'phpbb/db/migration/data/') !== 0
+ && strpos($relative_path, $this->root_path . 'phpbb/event/') !== 0
+ && strpos($relative_path, $this->root_path . 'store/') !== 0
+ && strpos($relative_path, $this->root_path . 'tests/') !== 0
+ && strpos($relative_path, $this->root_path . 'vendor/') !== 0
+ ;
+ }
+}
diff --git a/phpBB/phpbb/log/log.php b/phpBB/phpbb/log/log.php
index 44fba06d9d..e4c5ce47d9 100644
--- a/phpBB/phpbb/log/log.php
+++ b/phpBB/phpbb/log/log.php
@@ -305,9 +305,17 @@ class log implements \phpbb\log\log_interface
* @var array sql_ary Array with log data we insert into the
* database. If sql_ary[log_type] is not set,
* we won't add the entry to the database.
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
- $vars = array('mode', 'user_id', 'log_ip', 'log_operation', 'log_time', 'additional_data', 'sql_ary');
+ $vars = array(
+ 'mode',
+ 'user_id',
+ 'log_ip',
+ 'log_operation',
+ 'log_time',
+ 'additional_data',
+ 'sql_ary',
+ );
extract($this->dispatcher->trigger_event('core.add_log', compact($vars)));
// We didn't find a log_type, so we don't save it in the database.
@@ -403,9 +411,23 @@ class log implements \phpbb\log\log_interface
* is false, no entries will be returned.
* @var string sql_additional Additional conditions for the entries,
* e.g.: 'AND l.forum_id = 1'
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
- $vars = array('mode', 'count_logs', 'limit', 'offset', 'forum_id', 'topic_id', 'user_id', 'log_time', 'sort_by', 'keywords', 'profile_url', 'log_type', 'sql_additional');
+ $vars = array(
+ 'mode',
+ 'count_logs',
+ 'limit',
+ 'offset',
+ 'forum_id',
+ 'topic_id',
+ 'user_id',
+ 'log_time',
+ 'sort_by',
+ 'keywords',
+ 'profile_url',
+ 'log_type',
+ 'sql_additional',
+ );
extract($this->dispatcher->trigger_event('core.get_logs_modify_type', compact($vars)));
if ($log_type === false)
@@ -499,7 +521,7 @@ class log implements \phpbb\log\log_interface
* @event core.get_logs_modify_entry_data
* @var array row Entry data from the database
* @var array log_entry_data Entry's data which is returned
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('row', 'log_entry_data');
extract($this->dispatcher->trigger_event('core.get_logs_modify_entry_data', compact($vars)));
@@ -520,7 +542,7 @@ class log implements \phpbb\log\log_interface
$num_args = 0;
if (!is_array($this->user->lang[$row['log_operation']]))
{
- $num_args = substr_count($log[$i]['action'], '%');
+ $num_args = substr_count($this->user->lang[$row['log_operation']], '%');
}
else
{
@@ -576,7 +598,7 @@ class log implements \phpbb\log\log_interface
* get the permission data
* @var array reportee_id_list Array of additional user IDs we
* get the username strings for
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('log', 'topic_id_list', 'reportee_id_list');
extract($this->dispatcher->trigger_event('core.get_logs_get_additional_data', compact($vars)));
@@ -643,9 +665,23 @@ class log implements \phpbb\log\log_interface
$operations = array();
foreach ($this->user->lang as $key => $value)
{
- if (substr($key, 0, 4) == 'LOG_' && preg_match($keywords_pattern, $value))
+ if (substr($key, 0, 4) == 'LOG_')
{
- $operations[] = $key;
+ if (is_array($value))
+ {
+ foreach ($value as $plural_value)
+ {
+ if (preg_match($keywords_pattern, $plural_value))
+ {
+ $operations[] = $key;
+ break;
+ }
+ }
+ }
+ else if (preg_match($keywords_pattern, $value))
+ {
+ $operations[] = $key;
+ }
}
}
diff --git a/phpBB/phpbb/notification/type/approve_post.php b/phpBB/phpbb/notification/type/approve_post.php
index e51ff12b3e..5912ad62b4 100644
--- a/phpBB/phpbb/notification/type/approve_post.php
+++ b/phpBB/phpbb/notification/type/approve_post.php
@@ -138,4 +138,12 @@ class approve_post extends \phpbb\notification\type\post
{
return 'post_approved';
}
+
+ /**
+ * {inheritDoc}
+ */
+ public function get_redirect_url()
+ {
+ return $this->get_url();
+ }
}
diff --git a/phpBB/phpbb/notification/type/base.php b/phpBB/phpbb/notification/type/base.php
index 0719540bdb..7d08521d40 100644
--- a/phpBB/phpbb/notification/type/base.php
+++ b/phpBB/phpbb/notification/type/base.php
@@ -276,6 +276,14 @@ abstract class base implements \phpbb\notification\type\type_interface
}
/**
+ * {inheritDoc}
+ */
+ public function get_redirect_url()
+ {
+ return $this->get_url();
+ }
+
+ /**
* Prepare to output the notification to the template
*
* @return array Template variables
diff --git a/phpBB/phpbb/notification/type/bookmark.php b/phpBB/phpbb/notification/type/bookmark.php
index 003998677d..c981695f74 100644
--- a/phpBB/phpbb/notification/type/bookmark.php
+++ b/phpBB/phpbb/notification/type/bookmark.php
@@ -110,10 +110,14 @@ class bookmark extends \phpbb\notification\type\post
unset($notify_users[$row['user_id']]);
$notification = $this->notification_manager->get_item_type_class($this->get_type(), $row);
- $sql = 'UPDATE ' . $this->notifications_table . '
- SET ' . $this->db->sql_build_array('UPDATE', $notification->add_responders($post)) . '
- WHERE notification_id = ' . $row['notification_id'];
- $this->db->sql_query($sql);
+ $update_responders = $notification->add_responders($post);
+ if (!empty($update_responders))
+ {
+ $sql = 'UPDATE ' . $this->notifications_table . '
+ SET ' . $this->db->sql_build_array('UPDATE', $update_responders) . '
+ WHERE notification_id = ' . $row['notification_id'];
+ $this->db->sql_query($sql);
+ }
}
$this->db->sql_freeresult($result);
diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php
index f973becc3b..93fbcbde22 100644
--- a/phpBB/phpbb/notification/type/post.php
+++ b/phpBB/phpbb/notification/type/post.php
@@ -152,10 +152,14 @@ class post extends \phpbb\notification\type\base
unset($notify_users[$row['user_id']]);
$notification = $this->notification_manager->get_item_type_class($this->get_type(), $row);
- $sql = 'UPDATE ' . $this->notifications_table . '
- SET ' . $this->db->sql_build_array('UPDATE', $notification->add_responders($post)) . '
- WHERE notification_id = ' . $row['notification_id'];
- $this->db->sql_query($sql);
+ $update_responders = $notification->add_responders($post);
+ if (!empty($update_responders))
+ {
+ $sql = 'UPDATE ' . $this->notifications_table . '
+ SET ' . $this->db->sql_build_array('UPDATE', $update_responders) . '
+ WHERE notification_id = ' . $row['notification_id'];
+ $this->db->sql_query($sql);
+ }
}
$this->db->sql_freeresult($result);
@@ -206,7 +210,11 @@ class post extends \phpbb\notification\type\base
}
}
- if ($trimmed_responders_cnt)
+ if ($trimmed_responders_cnt > 20)
+ {
+ $usernames[] = $this->user->lang('NOTIFICATION_MANY_OTHERS');
+ }
+ else if ($trimmed_responders_cnt)
{
$usernames[] = $this->user->lang('NOTIFICATION_X_OTHERS', $trimmed_responders_cnt);
}
@@ -270,6 +278,14 @@ class post extends \phpbb\notification\type\base
}
/**
+ * {inheritDoc}
+ */
+ public function get_redirect_url()
+ {
+ return append_sid($this->phpbb_root_path . 'viewtopic.' . $this->php_ext, "t={$this->item_parent_id}&amp;view=unread#unread");
+ }
+
+ /**
* Users needed to query before this notification can be displayed
*
* @return array Array of user_ids
@@ -384,19 +400,27 @@ class post extends \phpbb\notification\type\base
// Do not add them as a responder if they were the original poster that created the notification
if ($this->get_data('poster_id') == $post['poster_id'])
{
- return array('notification_data' => serialize($this->get_data(false)));
+ return array();
}
$responders = $this->get_data('responders');
$responders = ($responders === null) ? array() : $responders;
+ // Do not add more than 25 responders,
+ // we trim the username list to "a, b, c and x others" anyway
+ // so there is no use to add all of them anyway.
+ if (sizeof($responders) > 25)
+ {
+ return array();
+ }
+
foreach ($responders as $responder)
{
// Do not add them as a responder multiple times
if ($responder['poster_id'] == $post['poster_id'])
{
- return array('notification_data' => serialize($this->get_data(false)));
+ return array();
}
}
@@ -407,6 +431,15 @@ class post extends \phpbb\notification\type\base
$this->set_data('responders', $responders);
- return array('notification_data' => serialize($this->get_data(false)));
+ $serialized_data = serialize($this->get_data(false));
+
+ // If the data is longer then 4000 characters, it would cause a SQL error.
+ // We don't add the username to the list if this is the case.
+ if (utf8_strlen($serialized_data) >= 4000)
+ {
+ return array();
+ }
+
+ return array('notification_data' => $serialized_data);
}
}
diff --git a/phpBB/phpbb/notification/type/post_in_queue.php b/phpBB/phpbb/notification/type/post_in_queue.php
index db16763583..56dfcce588 100644
--- a/phpBB/phpbb/notification/type/post_in_queue.php
+++ b/phpBB/phpbb/notification/type/post_in_queue.php
@@ -119,6 +119,14 @@ class post_in_queue extends \phpbb\notification\type\post
}
/**
+ * {inheritDoc}
+ */
+ public function get_redirect_url()
+ {
+ return parent::get_url();
+ }
+
+ /**
* Function for preparing the data for insertion in an SQL query
* (The service handles insertion)
*
diff --git a/phpBB/phpbb/notification/type/quote.php b/phpBB/phpbb/notification/type/quote.php
index 745430e114..f4b4d763eb 100644
--- a/phpBB/phpbb/notification/type/quote.php
+++ b/phpBB/phpbb/notification/type/quote.php
@@ -113,29 +113,6 @@ class quote extends \phpbb\notification\type\post
$notify_users = $this->check_user_notification_options($auth_read[$post['forum_id']]['f_read'], $options);
- // Try to find the users who already have been notified about replies and have not read the topic since and just update their notifications
- $update_notifications = array();
- $sql = 'SELECT n.*
- FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
- WHERE n.notification_type_id = ' . (int) $this->notification_type_id . '
- AND n.item_parent_id = ' . (int) self::get_item_parent_id($post) . '
- AND n.notification_read = 0
- AND nt.notification_type_id = n.notification_type_id
- AND nt.notification_type_enabled = 1';
- $result = $this->db->sql_query($sql);
- while ($row = $this->db->sql_fetchrow($result))
- {
- // Do not create a new notification
- unset($notify_users[$row['user_id']]);
-
- $notification = $this->notification_manager->get_item_type_class($this->get_type(), $row);
- $sql = 'UPDATE ' . $this->notifications_table . '
- SET ' . $this->db->sql_build_array('UPDATE', $notification->add_responders($post)) . '
- WHERE notification_id = ' . $row['notification_id'];
- $this->db->sql_query($sql);
- }
- $this->db->sql_freeresult($result);
-
return $notify_users;
}
@@ -191,6 +168,14 @@ class quote extends \phpbb\notification\type\post
}
/**
+ * {inheritDoc}
+ */
+ public function get_redirect_url()
+ {
+ return $this->get_url();
+ }
+
+ /**
* Get email template
*
* @return string|bool
diff --git a/phpBB/phpbb/notification/type/type_interface.php b/phpBB/phpbb/notification/type/type_interface.php
index e3e6898172..2f465aae2b 100644
--- a/phpBB/phpbb/notification/type/type_interface.php
+++ b/phpBB/phpbb/notification/type/type_interface.php
@@ -99,6 +99,13 @@ interface type_interface
public function get_url();
/**
+ * Get the url to redirect after the item has been marked as read
+ *
+ * @return string URL
+ */
+ public function get_redirect_url();
+
+ /**
* URL to unsubscribe to this notification
*
* @param string|bool $method Method name to unsubscribe from (email|jabber|etc), False to unsubscribe from all notifications for this item
diff --git a/phpBB/phpbb/permissions.php b/phpBB/phpbb/permissions.php
index a3fddb0b9e..3cf39b5126 100644
--- a/phpBB/phpbb/permissions.php
+++ b/phpBB/phpbb/permissions.php
@@ -57,7 +57,7 @@ class permissions
* 'lang' => 'ACL_U_VIEWPROFILE',
* 'cat' => 'profile',
* ),
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('types', 'categories', 'permissions');
extract($phpbb_dispatcher->trigger_event('core.permissions', compact($vars)));
diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php
index b9b3896606..18b7a3d096 100644
--- a/phpBB/phpbb/user.php
+++ b/phpBB/phpbb/user.php
@@ -143,9 +143,17 @@ class user extends \phpbb\session
* that are absolutely needed globally using this
* event. Use local events otherwise.
* @var mixed style_id Style we are going to display
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
- $vars = array('user_data', 'user_lang_name', 'user_date_format', 'user_timezone', 'lang_set', 'lang_set_ext', 'style_id');
+ $vars = array(
+ 'user_data',
+ 'user_lang_name',
+ 'user_date_format',
+ 'user_timezone',
+ 'lang_set',
+ 'lang_set_ext',
+ 'style_id',
+ );
extract($phpbb_dispatcher->trigger_event('core.user_setup', compact($vars)));
$this->data = $user_data;
diff --git a/phpBB/posting.php b/phpBB/posting.php
index f592402fc6..cfd6524e62 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -52,7 +52,7 @@ $current_time = time();
/**
* This event allows you to alter the above parameters, such as submit and mode
-*
+*
* Note: $refresh must be true to retain previously submitted form data.
*
* Note: The template class will not work properly until $user->setup() is
@@ -74,15 +74,30 @@ $current_time = time();
* viewtopic or viewforum depending on if the user
* is posting a new topic or editing a post)
* @var bool refresh Whether or not to retain previously submitted data
-* @var string mode What action to take if the form has been sumitted
+* @var string mode What action to take if the form has been submitted
* post|reply|quote|edit|delete|bump|smilies|popup
* @var array error Any error strings; a non-empty array aborts
* form submission.
* NOTE: Should be actual language strings, NOT
* language keys.
-* @since 3.1-A1
+* @since 3.1.0-a1
*/
-$vars = array('post_id', 'topic_id', 'forum_id', 'draft_id', 'lastclick', 'submit', 'preview', 'save', 'load', 'delete', 'cancel', 'refresh', 'mode', 'error');
+$vars = array(
+ 'post_id',
+ 'topic_id',
+ 'forum_id',
+ 'draft_id',
+ 'lastclick',
+ 'submit',
+ 'preview',
+ 'save',
+ 'load',
+ 'delete',
+ 'cancel',
+ 'refresh',
+ 'mode',
+ 'error',
+);
extract($phpbb_dispatcher->trigger_event('core.modify_posting_parameters', compact($vars)));
// Was cancel pressed? If so then redirect to the appropriate page
@@ -1548,9 +1563,30 @@ $template->assign_vars(array(
* This event allows you to modify template variables for the posting screen
*
* @event core.posting_modify_template_vars
-* @since 3.1-A1
+* @var array post_data Array with post data
+* @var array moderators Array with forum moderators
+* @var string mode What action to take if the form is submitted
+* post|reply|quote|edit|delete|bump|smilies|popup
+* @var string page_title Title of the mode page
+* @var bool s_topic_icons Whether or not to show the topic icons
+* @var string form_enctype If attachments are allowed for this form the value of
+* this is "multipart/form-data" else it is the empty string
+* @var string s_action The URL to submit the POST data to
+* @var string s_hidden_fields The concatenated input tags of the form's hidden fields
+* @since 3.1.0-a1
+* @change 3.1.0-b3 Added vars post_data, moderators, mode, page_title, s_topic_icons, form_enctype, s_action, s_hidden_fields
*/
-$phpbb_dispatcher->dispatch('core.posting_modify_template_vars');
+$vars = array(
+ 'post_data',
+ 'moderators',
+ 'mode',
+ 'page_title',
+ 's_topic_icons',
+ 'form_enctype',
+ 's_action',
+ 's_hidden_fields',
+);
+extract($phpbb_dispatcher->trigger_event('core.posting_modify_template_vars', compact($vars)));
// Build custom bbcodes array
display_custom_bbcodes();
diff --git a/phpBB/report.php b/phpBB/report.php
index 1adee028dc..f37a2f9d5c 100644
--- a/phpBB/report.php
+++ b/phpBB/report.php
@@ -136,7 +136,7 @@ else
$message .= '<br /><br />' . sprintf($user->lang['RETURN_PM'], '<a href="' . $redirect_url . '">', '</a>');
trigger_error($message);
}
-
+
$reported_post_text = $report_data['message_text'];
$reported_post_bitfield = $report_data['bbcode_bitfield'];
$reported_post_uid = $report_data['bbcode_uid'];
diff --git a/phpBB/search.php b/phpBB/search.php
index 4756a941f5..dfb53c6896 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -108,7 +108,7 @@ if ($interval && !in_array($search_id, array('unreadposts', 'unanswered', 'activ
if ($user->data['user_last_search'] > time() - $interval)
{
$template->assign_var('S_NO_SEARCH', true);
- trigger_error('NO_SEARCH_TIME');
+ trigger_error($user->lang('NO_SEARCH_TIME', (int) ($user->data['user_last_search'] + $interval - time())));
}
}
@@ -561,9 +561,9 @@ if ($keywords || $author || $author_id || $search_id || $submit)
}
// define some vars for urls
- $hilit = implode('|', explode(' ', preg_replace('#\s+#u', ' ', str_replace(array('+', '-', '|', '(', ')', '&quot;'), ' ', $keywords))));
- // Do not allow *only* wildcard being used for hilight
- $hilit = (strspn($hilit, '*') === strlen($hilit)) ? '' : $hilit;
+ // A single wildcard will make the search results look ugly
+ $hilit = phpbb_clean_search_string(str_replace(array('+', '-', '|', '(', ')', '&quot;'), ' ', $keywords));
+ $hilit = str_replace(' ', '|', $hilit);
$u_hilit = urlencode(htmlspecialchars_decode(str_replace('|', ' ', $hilit)));
$u_show_results = '&amp;sr=' . $show_results;
@@ -681,7 +681,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
* @var string sql_select The SQL SELECT string used by search to get topic data
* @var string sql_from The SQL FROM string used by search to get topic data
* @var string sql_where The SQL WHERE string used by search to get topic data
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('sql_select', 'sql_from', 'sql_where');
extract($phpbb_dispatcher->trigger_event('core.search_get_topic_data', compact($vars)));
@@ -850,7 +850,8 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$hilit_array = array_filter(explode('|', $hilit), 'strlen');
foreach ($hilit_array as $key => $value)
{
- $hilit_array[$key] = str_replace('\*', '\w*?', preg_quote($value, '#'));
+ $hilit_array[$key] = phpbb_clean_search_string($value);
+ $hilit_array[$key] = str_replace('\*', '\w*?', preg_quote($hilit_array[$key], '#'));
$hilit_array[$key] = preg_replace('#(^|\s)\\\\w\*\?(\s|$)#', '$1\w+?$2', $hilit_array[$key]);
}
$hilit = implode('|', $hilit_array);
@@ -878,7 +879,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$unread_topic = (isset($topic_tracking_info[$forum_id][$row['topic_id']]) && $row['topic_last_post_time'] > $topic_tracking_info[$forum_id][$row['topic_id']]) ? true : false;
- $topic_unapproved = ($row['topic_visibility'] == ITEM_UNAPPROVED && $auth->acl_get('m_approve', $forum_id)) ? true : false;
+ $topic_unapproved = (($row['topic_visibility'] == ITEM_UNAPPROVED || $row['topic_visibility'] == ITEM_REAPPROVE) && $auth->acl_get('m_approve', $forum_id)) ? true : false;
$posts_unapproved = ($row['topic_visibility'] == ITEM_APPROVED && $row['topic_posts_unapproved'] && $auth->acl_get('m_approve', $forum_id)) ? true : false;
$topic_deleted = $row['topic_visibility'] == ITEM_DELETED;
$u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&amp;t=$result_topic_id", true, $user->session_id) : '';
@@ -1003,7 +1004,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
* @event core.search_modify_tpl_ary
* @var array row Array with topic data
* @var array tpl_ary Template block array with topic data
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('row', 'tpl_ary');
extract($phpbb_dispatcher->trigger_event('core.search_modify_tpl_ary', compact($vars)));
diff --git a/phpBB/styles/prosilver/template/ajax.js b/phpBB/styles/prosilver/template/ajax.js
index d2a070d11b..bc68e5ae0c 100644
--- a/phpBB/styles/prosilver/template/ajax.js
+++ b/phpBB/styles/prosilver/template/ajax.js
@@ -8,7 +8,7 @@
* @param int Delay in ms until darkenwrapper's click event is triggered
*/
phpbb.closeDarkenWrapper = function(delay) {
- setTimeout(function() {
+ phpbbAlertTimer = setTimeout(function() {
$('#darkenwrapper').trigger('click');
}, delay);
};
@@ -244,10 +244,12 @@ phpbb.addAjaxCallback('vote_poll', function(res) {
var option = $(this);
var option_id = option.attr('data-poll-option-id');
var voted = (typeof res.user_votes[option_id] !== 'undefined') ? true : false;
+ var most_voted = (res.vote_counts[option_id] == most_votes) ? true : false;
var percent = (!res.total_votes) ? 0 : Math.round((res.vote_counts[option_id] / res.total_votes) * 100);
var percent_rel = (most_votes == 0) ? 0 : Math.round((res.vote_counts[option_id] / most_votes) * 100);
option.toggleClass('voted', voted);
+ option.toggleClass('most-votes', most_voted);
// Update the bars
var bar = option.find('.resultbar div');
diff --git a/phpBB/styles/prosilver/template/captcha_default.html b/phpBB/styles/prosilver/template/captcha_default.html
index c9c5295d13..550962db67 100644
--- a/phpBB/styles/prosilver/template/captcha_default.html
+++ b/phpBB/styles/prosilver/template/captcha_default.html
@@ -2,7 +2,7 @@
<div class="panel">
<div class="inner">
- <h3>{L_CONFIRMATION}</h3>
+ <h3 class="captcha-title">{L_CONFIRMATION}</h3>
<p>{L_CONFIRM_EXPLAIN}</p>
<fieldset class="fields2">
diff --git a/phpBB/styles/prosilver/template/captcha_qa.html b/phpBB/styles/prosilver/template/captcha_qa.html
index c179f6dc20..1671987f63 100644
--- a/phpBB/styles/prosilver/template/captcha_qa.html
+++ b/phpBB/styles/prosilver/template/captcha_qa.html
@@ -2,7 +2,7 @@
<div class="panel">
<div class="inner">
- <h3>{L_CONFIRMATION}</h3>
+ <h3 class="captcha-title">{L_CONFIRMATION}</h3>
<fieldset class="fields2">
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/captcha_recaptcha.html b/phpBB/styles/prosilver/template/captcha_recaptcha.html
index aad1008241..bde0c9df13 100644
--- a/phpBB/styles/prosilver/template/captcha_recaptcha.html
+++ b/phpBB/styles/prosilver/template/captcha_recaptcha.html
@@ -2,7 +2,7 @@
<div class="panel">
<div class="inner">
- <h3>{L_CONFIRMATION}</h3>
+ <h3 class="captcha-title">{L_CONFIRMATION}</h3>
<p>{L_CONFIRM_EXPLAIN}</p>
<fieldset class="fields2">
diff --git a/phpBB/styles/prosilver/template/confirm_body.html b/phpBB/styles/prosilver/template/confirm_body.html
index a0428025cf..aaea5cfd05 100644
--- a/phpBB/styles/prosilver/template/confirm_body.html
+++ b/phpBB/styles/prosilver/template/confirm_body.html
@@ -17,7 +17,7 @@
<div class="panel">
<div class="inner">
- <h2>{MESSAGE_TITLE}</h2>
+ <h2 class="message-title">{MESSAGE_TITLE}</h2>
<p>{MESSAGE_TEXT}</p>
<fieldset class="submit-buttons">
diff --git a/phpBB/styles/prosilver/template/confirm_delete_body.html b/phpBB/styles/prosilver/template/confirm_delete_body.html
index dc09974d1c..2d4dde5cd5 100644
--- a/phpBB/styles/prosilver/template/confirm_delete_body.html
+++ b/phpBB/styles/prosilver/template/confirm_delete_body.html
@@ -33,7 +33,7 @@
<div class="panel">
<div class="inner">
- <h2>{MESSAGE_TITLE}</h2>
+ <h2 class="message-title">{MESSAGE_TITLE}</h2>
<p>{MESSAGE_TEXT}</p>
diff --git a/phpBB/styles/prosilver/template/drafts.html b/phpBB/styles/prosilver/template/drafts.html
index 4b2e1bf0c6..ea2849a485 100644
--- a/phpBB/styles/prosilver/template/drafts.html
+++ b/phpBB/styles/prosilver/template/drafts.html
@@ -4,7 +4,7 @@
<div class="panel">
<div class="inner">
- <h3>{L_LOAD_DRAFT}</h3>
+ <h3 class="draft-title">{L_LOAD_DRAFT}</h3>
<p>{L_LOAD_DRAFT_EXPLAIN}</p>
</div>
diff --git a/phpBB/styles/prosilver/template/faq_body.html b/phpBB/styles/prosilver/template/faq_body.html
index 46f738aa3a..53205d14e9 100644
--- a/phpBB/styles/prosilver/template/faq_body.html
+++ b/phpBB/styles/prosilver/template/faq_body.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<h2>{L_FAQ_TITLE}</h2>
+<h2 class="faq-title">{L_FAQ_TITLE}</h2>
<div class="panel bg1" id="faqlinks">
@@ -24,16 +24,12 @@
</div>
</div>
-
-
-<div class="clear"></div>
-
<!-- BEGIN faq_block -->
<div class="panel <!-- IF faq_block.S_ROW_COUNT is odd -->bg1<!-- ELSE -->bg2<!-- ENDIF -->">
<div class="inner">
<div class="content">
- <h2>{faq_block.BLOCK_TITLE}</h2>
+ <h2 class="faq-title">{faq_block.BLOCK_TITLE}</h2>
<!-- BEGIN faq_row -->
<dl class="faq">
<dt id="f{faq_block.S_ROW_COUNT}r{faq_block.faq_row.S_ROW_COUNT}"><strong>{faq_block.faq_row.FAQ_QUESTION}</strong></dt>
diff --git a/phpBB/styles/prosilver/template/login_body.html b/phpBB/styles/prosilver/template/login_body.html
index 38d9f8c68b..c852ffd5f2 100644
--- a/phpBB/styles/prosilver/template/login_body.html
+++ b/phpBB/styles/prosilver/template/login_body.html
@@ -5,7 +5,7 @@
<div class="inner">
<div class="content">
- <h2><!-- IF LOGIN_EXPLAIN -->{LOGIN_EXPLAIN}<!-- ELSE -->{L_LOGIN}<!-- ENDIF --></h2>
+ <h2 class="login-title"><!-- IF LOGIN_EXPLAIN -->{LOGIN_EXPLAIN}<!-- ELSE -->{L_LOGIN}<!-- ENDIF --></h2>
<fieldset <!-- IF not S_CONFIRM_CODE -->class="fields1"<!-- ELSE -->class="fields2"<!-- ENDIF -->>
<!-- IF LOGIN_ERROR --><div class="error">{LOGIN_ERROR}</div><!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/login_forum.html b/phpBB/styles/prosilver/template/login_forum.html
index c83a625b3f..18a95c0a8f 100644
--- a/phpBB/styles/prosilver/template/login_forum.html
+++ b/phpBB/styles/prosilver/template/login_forum.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<!-- IF FORUM_NAME --><h2><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2><!-- ENDIF -->
+<!-- IF FORUM_NAME --><h2 class="forum-title"><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2><!-- ENDIF -->
<form id="login_forum" method="post" action="{S_LOGIN_ACTION}">
{S_FORM_TOKEN}
@@ -8,7 +8,7 @@
<div class="inner">
<div class="content">
- <h2>{L_LOGIN}</h2>
+ <h2 class="login-title">{L_LOGIN}</h2>
<p>{L_LOGIN_FORUM}</p>
diff --git a/phpBB/styles/prosilver/template/mcp_approve.html b/phpBB/styles/prosilver/template/mcp_approve.html
index ab7f92e262..14472bcf4f 100644
--- a/phpBB/styles/prosilver/template/mcp_approve.html
+++ b/phpBB/styles/prosilver/template/mcp_approve.html
@@ -34,7 +34,7 @@
<div class="content">
- <h2>{MESSAGE_TITLE}</h2>
+ <h2 class="message-title">{MESSAGE_TITLE}</h2>
<!-- IF ADDITIONAL_MSG --><p class="error">{ADDITIONAL_MSG}</p><!-- ENDIF -->
<fieldset>
diff --git a/phpBB/styles/prosilver/template/mcp_footer.html b/phpBB/styles/prosilver/template/mcp_footer.html
index e5768bdc6b..89ce7c34ab 100644
--- a/phpBB/styles/prosilver/template/mcp_footer.html
+++ b/phpBB/styles/prosilver/template/mcp_footer.html
@@ -1,9 +1,8 @@
</div>
- <div class="clear"></div>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/prosilver/template/mcp_header.html b/phpBB/styles/prosilver/template/mcp_header.html
index 2b2105e770..bdfa254741 100644
--- a/phpBB/styles/prosilver/template/mcp_header.html
+++ b/phpBB/styles/prosilver/template/mcp_header.html
@@ -42,7 +42,7 @@
<div id="cp-main" class="mcp-main panel-container">
<!-- IF MESSAGE -->
<div class="content">
- <h2>{L_MESSAGE}</h2>
+ <h2 class="message-title">{L_MESSAGE}</h2>
<p class="error">{MESSAGE}</p>
<p><!-- BEGIN return_links -->{return_links.MESSAGE_LINK}<br /><br /><!-- END return_links --></p>
</div>
diff --git a/phpBB/styles/prosilver/template/mcp_message.html b/phpBB/styles/prosilver/template/mcp_message.html
index 7102c658c4..062103b91c 100644
--- a/phpBB/styles/prosilver/template/mcp_message.html
+++ b/phpBB/styles/prosilver/template/mcp_message.html
@@ -1,7 +1,7 @@
<!-- INCLUDE mcp_header.html -->
<div class="content">
- <h2>{MESSAGE_TITLE}</h2>
+ <h2 class="message-title">{MESSAGE_TITLE}</h2>
<p>{MESSAGE_TEXT}</p>
</div>
diff --git a/phpBB/styles/prosilver/template/mcp_move.html b/phpBB/styles/prosilver/template/mcp_move.html
index c2ee25f0d9..d028fffeb4 100644
--- a/phpBB/styles/prosilver/template/mcp_move.html
+++ b/phpBB/styles/prosilver/template/mcp_move.html
@@ -37,7 +37,7 @@
<div class="inner">
<div class="content">
- <h2>{MESSAGE_TITLE}</h2>
+ <h2 class="message-title">{MESSAGE_TITLE}</h2>
<!-- IF ADDITIONAL_MSG --><p>{ADDITIONAL_MSG}</p><!-- ENDIF -->
<fieldset>
diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html
index 7ba289cfd6..dd5e27a10e 100644
--- a/phpBB/styles/prosilver/template/memberlist_body.html
+++ b/phpBB/styles/prosilver/template/memberlist_body.html
@@ -14,7 +14,7 @@
<!-- IF S_SHOW_GROUP -->
- <h2<!-- IF GROUP_COLOR --> style="color:#{GROUP_COLOR};"<!-- ENDIF -->>{GROUP_NAME}</h2>
+ <h2 class="group-title"<!-- IF GROUP_COLOR --> style="color:#{GROUP_COLOR};"<!-- ENDIF -->>{GROUP_NAME}</h2>
<p>{GROUP_DESC} {GROUP_TYPE}</p>
<p>
<!-- IF AVATAR_IMG -->{AVATAR_IMG}<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html
index 57d6fe0911..3ef3f7ca07 100644
--- a/phpBB/styles/prosilver/template/memberlist_view.html
+++ b/phpBB/styles/prosilver/template/memberlist_view.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<h2>{PAGE_TITLE}</h2>
+<h2 class="memberlist-title">{PAGE_TITLE}</h2>
<form method="post" action="{S_PROFILE_ACTION}" id="viewprofile">
<div class="panel bg1<!-- IF S_ONLINE --> online<!-- ENDIF -->">
@@ -50,14 +50,14 @@
<!-- ENDIF -->
</dl>
- <span class="clear"></span></div>
+ </div>
</div>
<!-- EVENT memberlist_view_contact_before -->
<div class="panel bg2">
<div class="inner">
- <div class="column1">
+ <div class="column1">
<h3>{L_CONTACT_USER} {USERNAME}</h3>
<dl class="details">
@@ -103,7 +103,8 @@
<!-- EVENT memberlist_view_user_statistics_after -->
</dl>
</div>
- <span class="clear"></span></div>
+
+ </div>
</div>
<!-- EVENT memberlist_view_contact_after -->
@@ -115,7 +116,7 @@
<div class="postbody"><div class="signature standalone">{SIGNATURE}</div></div>
- <span class="clear"></span></div>
+ </div>
</div>
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/message_body.html b/phpBB/styles/prosilver/template/message_body.html
index a844246055..8062fed9a0 100644
--- a/phpBB/styles/prosilver/template/message_body.html
+++ b/phpBB/styles/prosilver/template/message_body.html
@@ -6,7 +6,7 @@
<div class="panel" id="message">
<div class="inner">
- <h2>{MESSAGE_TITLE}</h2>
+ <h2 class="message-title">{MESSAGE_TITLE}</h2>
<p>{MESSAGE_TEXT}</p>
<!-- IF SCRIPT_NAME == "search" and not S_BOARD_DISABLED and not S_NO_SEARCH and L_RETURN_TO_SEARCH_ADV --><p><a href="{U_SEARCH}" class="arrow-{S_CONTENT_FLOW_BEGIN}">{L_RETURN_TO_SEARCH_ADV}</a></p><!-- ENDIF -->
</div>
diff --git a/phpBB/styles/prosilver/template/navbar_footer.html b/phpBB/styles/prosilver/template/navbar_footer.html
index 32cbecdf8c..13e50dae19 100644
--- a/phpBB/styles/prosilver/template/navbar_footer.html
+++ b/phpBB/styles/prosilver/template/navbar_footer.html
@@ -2,15 +2,21 @@
<div class="inner">
<ul class="linklist bulletin">
- <li class="small-icon icon-home breadcrumbs"><!-- IF U_SITE_HOME --><span class="crumb"><a href="{U_SITE_HOME}">{L_SITE_HOME}</a> <strong>&#8249;</strong></span> <!-- ENDIF --><span class="crumb"><a href="{U_INDEX}">{L_INDEX}</a></span>
+ <li class="small-icon icon-home breadcrumbs">
+ <!-- IF U_SITE_HOME --><span class="crumb"><a href="{U_SITE_HOME}">{L_SITE_HOME}</a></span><!-- ENDIF -->
+ <span class="crumb"><a href="{U_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 -->
+ <!-- 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 U_TEAM --><li class="rightside"><a href="{U_TEAM}">{L_THE_TEAM}</a><!-- ENDIF -->
+ <!-- EVENT overall_footer_teamlink_before -->
+ <!-- IF U_TEAM --><li class="rightside"><a href="{U_TEAM}">{L_THE_TEAM}</a></li><!-- ENDIF -->
+ <!-- EVENT overall_footer_teamlink_after -->
</ul>
</div>
diff --git a/phpBB/styles/prosilver/template/navbar_header.html b/phpBB/styles/prosilver/template/navbar_header.html
index 259aec75ed..7fbaa1254f 100644
--- a/phpBB/styles/prosilver/template/navbar_header.html
+++ b/phpBB/styles/prosilver/template/navbar_header.html
@@ -3,17 +3,14 @@
<ul class="linklist navlinks">
<!-- 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}>{L_SITE_HOME}</a> <strong>&#8249;</strong></span> <!-- ENDIF -->
- <span class="crumb"><a href="{U_INDEX}" accesskey="h"{$MICRODATA}>{L_INDEX}</a></span>
- <!-- BEGIN navlinks --> <span class="crumb"><strong>&#8249;</strong> <a href="{navlinks.U_VIEW_FORUM}"{$MICRODATA}>{navlinks.FORUM_NAME}</a></span><!-- END navlinks -->
+ <li class="small-icon icon-home breadcrumbs">
+ <!-- IF U_SITE_HOME --><span class="crumb"><a href="{U_SITE_HOME}"{$MICRODATA}>{L_SITE_HOME}</a></span><!-- ENDIF -->
+ <span class="crumb"><a href="{U_INDEX}" accesskey="h"{$MICRODATA}>{L_INDEX}</a></span>
+ <!-- BEGIN navlinks --><span class="crumb"><a href="{navlinks.U_VIEW_FORUM}"{$MICRODATA}>{navlinks.FORUM_NAME}</a></span><!-- END navlinks -->
<!-- EVENT overall_header_breadcrumb_append -->
</li>
<!-- IF S_REGISTERED_USER --><li id="username_logged_in" class="rightside"><!-- IF CURRENT_USER_AVATAR --><a href="{U_USER_PROFILE}" class="header-avatar">{CURRENT_USER_AVATAR}</a> <!-- ENDIF -->{USERNAME_FULL}</li><!-- ENDIF -->
- <!-- IF U_EMAIL_TOPIC --><li class="rightside"><a href="{U_EMAIL_TOPIC}" title="{L_EMAIL_TOPIC}" class="sendemail">{L_EMAIL_TOPIC}</a></li><!-- ENDIF -->
- <!-- IF U_EMAIL_PM --><li class="rightside"><a href="{U_EMAIL_PM}" title="{L_EMAIL_PM}" class="sendemail">{L_EMAIL_PM}</a></li><!-- ENDIF -->
- <!-- IF U_PRINT_TOPIC --><li class="rightside"><a href="{U_PRINT_TOPIC}" title="{L_PRINT_TOPIC}" accesskey="p" class="print">{L_PRINT_TOPIC}</a></li><!-- ENDIF -->
- <!-- IF U_PRINT_PM --><li class="rightside"><a href="{U_PRINT_PM}" title="{L_PRINT_PM}" accesskey="p" class="print">{L_PRINT_PM}</a></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>
diff --git a/phpBB/styles/prosilver/template/posting_layout.html b/phpBB/styles/prosilver/template/posting_layout.html
index 0b9ddedf47..4ef0954200 100644
--- a/phpBB/styles/prosilver/template/posting_layout.html
+++ b/phpBB/styles/prosilver/template/posting_layout.html
@@ -1,9 +1,9 @@
<!-- INCLUDE overall_header.html -->
<!-- IF TOPIC_TITLE -->
- <h2><a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></h2>
+ <h2 class="posting-title"><a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></h2>
<!-- ELSE -->
- <h2><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2>
+ <h2 class="posting-title"><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2>
<!-- ENDIF -->
<!-- IF S_FORUM_RULES -->
diff --git a/phpBB/styles/prosilver/template/posting_pm_header.html b/phpBB/styles/prosilver/template/posting_pm_header.html
index 114b361e9a..dea50b5daf 100644
--- a/phpBB/styles/prosilver/template/posting_pm_header.html
+++ b/phpBB/styles/prosilver/template/posting_pm_header.html
@@ -76,7 +76,6 @@
</dl>
</div>
<!-- ENDIF -->
-
- <div class="clear"></div>
+
<!-- ENDIF -->
</fieldset>
diff --git a/phpBB/styles/prosilver/template/posting_pm_layout.html b/phpBB/styles/prosilver/template/posting_pm_layout.html
index c9b4a915ae..3bdadd06ca 100644
--- a/phpBB/styles/prosilver/template/posting_pm_layout.html
+++ b/phpBB/styles/prosilver/template/posting_pm_layout.html
@@ -15,7 +15,7 @@
<!-- IF S_DISPLAY_PREVIEW --><!-- INCLUDE posting_preview.html --><!-- ENDIF -->
-<h2>{L_TITLE}</h2>
+<h2 class="posting-title">{L_TITLE}</h2>
<div class="panel" id="pmheader-postingbox">
<div class="inner">
diff --git a/phpBB/styles/prosilver/template/quickreply_editor.html b/phpBB/styles/prosilver/template/quickreply_editor.html
index 8da9919db8..6a8846626e 100644
--- a/phpBB/styles/prosilver/template/quickreply_editor.html
+++ b/phpBB/styles/prosilver/template/quickreply_editor.html
@@ -2,7 +2,7 @@
<!-- EVENT quickreply_editor_panel_before -->
<div class="panel">
<div class="inner">
- <h2>{L_QUICKREPLY}</h2>
+ <h2 class="quickreply-title">{L_QUICKREPLY}</h2>
<fieldset class="fields1">
<dl style="clear: left;">
<dt><label for="subject">{L_SUBJECT}{L_COLON}</label></dt>
diff --git a/phpBB/styles/prosilver/template/search_results.html b/phpBB/styles/prosilver/template/search_results.html
index 3307c68627..818b8ee642 100644
--- a/phpBB/styles/prosilver/template/search_results.html
+++ b/phpBB/styles/prosilver/template/search_results.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<h2><!-- IF SEARCH_TITLE -->{SEARCH_TITLE}<!-- ELSE -->{SEARCH_MATCHES}<!-- ENDIF --><!-- IF SEARCH_WORDS -->{L_COLON} <a href="{U_SEARCH_WORDS}">{SEARCH_WORDS}</a><!-- ENDIF --></h2>
+<h2 class="searchresults-title"><!-- IF SEARCH_TITLE -->{SEARCH_TITLE}<!-- ELSE -->{SEARCH_MATCHES}<!-- ENDIF --><!-- IF SEARCH_WORDS -->{L_COLON} <a href="{U_SEARCH_WORDS}">{SEARCH_WORDS}</a><!-- ENDIF --></h2>
<!-- IF SEARCHED_QUERY --> <p>{L_SEARCHED_QUERY}{L_COLON} <strong>{SEARCHED_QUERY}</strong></p><!-- ENDIF -->
<!-- IF IGNORED_WORDS --> <p>{L_IGNORED_TERMS}{L_COLON} <strong>{IGNORED_WORDS}</strong></p><!-- ENDIF -->
<!-- IF PHRASE_SEARCH_DISABLED --> <p><strong>{L_PHRASE_SEARCH_DISABLED}</strong></p><!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/ucp_agreement.html b/phpBB/styles/prosilver/template/ucp_agreement.html
index 6c96be864a..b52acdd955 100644
--- a/phpBB/styles/prosilver/template/ucp_agreement.html
+++ b/phpBB/styles/prosilver/template/ucp_agreement.html
@@ -33,7 +33,7 @@
<div class="panel">
<div class="inner">
<div class="content">
- <h2>{SITENAME} - {L_REGISTRATION}</h2>
+ <h2 class="sitename-title">{SITENAME} - {L_REGISTRATION}</h2>
<p><!-- IF S_SHOW_COPPA -->{L_COPPA_BIRTHDAY}<!-- ELSE -->{L_TERMS_OF_USE}<!-- ENDIF --></p>
</div>
</div>
@@ -60,7 +60,7 @@
<div class="panel">
<div class="inner">
<div class="content">
- <h2>{SITENAME} - {AGREEMENT_TITLE}</h2>
+ <h2 class="sitename-title">{SITENAME} - {AGREEMENT_TITLE}</h2>
<p>{AGREEMENT_TEXT}</p>
<hr class="dashed" />
<p><a href="{U_BACK}" class="button2">{L_BACK}</a></p>
diff --git a/phpBB/styles/prosilver/template/ucp_footer.html b/phpBB/styles/prosilver/template/ucp_footer.html
index ea546f7a82..f2f1a68db3 100644
--- a/phpBB/styles/prosilver/template/ucp_footer.html
+++ b/phpBB/styles/prosilver/template/ucp_footer.html
@@ -1,9 +1,8 @@
</div>
- <div class="clear"></div>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- IF S_COMPOSE_PM -->
<div>{S_FORM_TOKEN}</div>
diff --git a/phpBB/styles/prosilver/template/ucp_header.html b/phpBB/styles/prosilver/template/ucp_header.html
index 8ce2c54294..102ea5a3a0 100644
--- a/phpBB/styles/prosilver/template/ucp_header.html
+++ b/phpBB/styles/prosilver/template/ucp_header.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<h2>{L_UCP}</h2>
+<h2 class="ucp-title">{L_UCP}</h2>
<div id="tabs">
<ul>
diff --git a/phpBB/styles/prosilver/template/ucp_pm_message_header.html b/phpBB/styles/prosilver/template/ucp_pm_message_header.html
index a6ef3fc7dd..840eba4c83 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_message_header.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_message_header.html
@@ -15,6 +15,18 @@
</div>
<!-- ENDIF -->
+ <!-- IF not S_IS_BOT and U_PRINT_PM -->
+ <div class="dropdown-container dropdown-button-control topic-tools">
+ <span title="{L_PM_TOOLS}" class="dropdown-trigger dropdown-select dropdown-select-icon tools-icon"><span></span></span>
+ <div class="dropdown hidden">
+ <div class="pointer"><div class="pointer-inner"></div></div>
+ <ul class="dropdown-contents">
+ <!-- IF U_PRINT_PM --><li class="small-icon icon-print"><a href="{U_PRINT_PM}" title="{L_PRINT_PM}" accesskey="p">{L_PRINT_PM}</a></li><!-- ENDIF -->
+ </ul>
+ </div>
+ </div>
+ <!-- ENDIF -->
+
<!-- IF TOTAL_MESSAGES or S_VIEW_MESSAGE -->
<ul class="linklist">
<li class="rightside pagination">
diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html
index 7372834dd3..33d309bcb8 100644
--- a/phpBB/styles/prosilver/template/viewforum_body.html
+++ b/phpBB/styles/prosilver/template/viewforum_body.html
@@ -1,6 +1,6 @@
<!-- 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><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2>
+<h2 class="forum-title"><a href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2>
<!-- IF FORUM_DESC or MODERATORS or U_MCP -->
<div>
diff --git a/phpBB/styles/prosilver/template/viewonline_body.html b/phpBB/styles/prosilver/template/viewonline_body.html
index 13f459b57f..553e322f92 100644
--- a/phpBB/styles/prosilver/template/viewonline_body.html
+++ b/phpBB/styles/prosilver/template/viewonline_body.html
@@ -1,6 +1,6 @@
<!-- INCLUDE overall_header.html -->
-<h2>{TOTAL_REGISTERED_USERS_ONLINE}</h2>
+<h2 class="viewonline-title">{TOTAL_REGISTERED_USERS_ONLINE}</h2>
<p>{TOTAL_GUEST_USERS_ONLINE}<!-- IF S_SWITCH_GUEST_DISPLAY --> &bull; <a href="{U_SWITCH_GUEST_DISPLAY}">{L_SWITCH_GUEST_DISPLAY}</a><!-- ENDIF --></p>
<ul class="linklist">
diff --git a/phpBB/styles/prosilver/template/viewonline_whois.html b/phpBB/styles/prosilver/template/viewonline_whois.html
index 8abd933efa..031f18afdc 100644
--- a/phpBB/styles/prosilver/template/viewonline_whois.html
+++ b/phpBB/styles/prosilver/template/viewonline_whois.html
@@ -1,6 +1,6 @@
<!-- INCLUDE simple_header.html -->
-<h2>{L_WHOIS}</h2>
+<h2 class="whois-title">{L_WHOIS}</h2>
<div class="panel">
<div class="inner">
diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html
index 4e3561c4a2..01a49d6888 100644
--- a/phpBB/styles/prosilver/template/viewtopic_body.html
+++ b/phpBB/styles/prosilver/template/viewtopic_body.html
@@ -1,6 +1,6 @@
<!-- 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><!-- EVENT viewtopic_topic_title_prepend --><a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></h2>
+<h2 class="topic-title"><!-- EVENT viewtopic_topic_title_prepend --><a href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a></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 -->
@@ -67,12 +67,12 @@
<div class="inner">
<div class="content">
- <h2>{POLL_QUESTION}</h2>
+ <h2 class="poll-title">{POLL_QUESTION}</h2>
<p class="author">{L_POLL_LENGTH}<!-- IF S_CAN_VOTE and L_POLL_LENGTH --><br /><!-- ENDIF --><!-- IF S_CAN_VOTE --><span class="poll_max_votes">{L_MAX_VOTES}</span><!-- ENDIF --></p>
<fieldset class="polls">
<!-- BEGIN poll_option -->
- <dl class="<!-- IF poll_option.POLL_OPTION_VOTED -->voted<!-- ENDIF -->"<!-- IF poll_option.POLL_OPTION_VOTED --> title="{L_POLL_VOTED_OPTION}"<!-- ENDIF --> data-poll-option-id="{poll_option.POLL_OPTION_ID}">
+ <dl class="<!-- IF poll_option.POLL_OPTION_VOTED -->voted<!-- ENDIF --><!-- IF poll_option.POLL_OPTION_MOST_VOTES --> most-votes<!-- ENDIF -->"<!-- IF poll_option.POLL_OPTION_VOTED --> title="{L_POLL_VOTED_OPTION}"<!-- ENDIF --> data-poll-option-id="{poll_option.POLL_OPTION_ID}">
<dt><!-- IF S_CAN_VOTE --><label for="vote_{poll_option.POLL_OPTION_ID}">{poll_option.POLL_OPTION_CAPTION}</label><!-- ELSE -->{poll_option.POLL_OPTION_CAPTION}<!-- ENDIF --></dt>
<!-- IF S_CAN_VOTE --><dd style="width: auto;" class="poll_option_select"><!-- IF S_IS_MULTI_CHOICE --><input type="checkbox" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> /><!-- ELSE --><input type="radio" name="vote_id[]" id="vote_{poll_option.POLL_OPTION_ID}" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> /><!-- ENDIF --></dd><!-- ENDIF -->
<dd class="resultbar<!-- IF not S_DISPLAY_RESULTS --> hidden<!-- ENDIF -->"><div class="<!-- IF poll_option.POLL_OPTION_PCT < 20 -->pollbar1<!-- ELSEIF poll_option.POLL_OPTION_PCT < 40 -->pollbar2<!-- ELSEIF poll_option.POLL_OPTION_PCT < 60 -->pollbar3<!-- ELSEIF poll_option.POLL_OPTION_PCT < 80 -->pollbar4<!-- ELSE -->pollbar5<!-- ENDIF -->" style="width:{poll_option.POLL_OPTION_PERCENT_REL};">{poll_option.POLL_OPTION_RESULT}</div></dd>
diff --git a/phpBB/styles/prosilver/template/viewtopic_topic_tools.html b/phpBB/styles/prosilver/template/viewtopic_topic_tools.html
index fcce2267c4..89f34d1b3a 100644
--- a/phpBB/styles/prosilver/template/viewtopic_topic_tools.html
+++ b/phpBB/styles/prosilver/template/viewtopic_topic_tools.html
@@ -1,4 +1,4 @@
-<!-- IF not S_IS_BOT and (U_WATCH_TOPIC or U_BOOKMARK_TOPIC or U_BUMP_TOPIC or S_HAS_ATTACHMENTS or S_DISPLAY_TOPIC_TOOLS) -->
+<!-- IF not S_IS_BOT and (U_WATCH_TOPIC or U_BOOKMARK_TOPIC or U_BUMP_TOPIC or S_HAS_ATTACHMENTS or U_EMAIL_TOPIC or U_PRINT_TOPIC or S_DISPLAY_TOPIC_TOOLS) -->
<div class="dropdown-container dropdown-button-control topic-tools">
<span title="{L_TOPIC_TOOLS}" class="dropdown-trigger dropdown-select dropdown-select-icon tools-icon"><span></span></span>
<div class="dropdown hidden">
@@ -20,6 +20,8 @@
</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 -->
+ <!-- IF U_EMAIL_TOPIC --><li class="small-icon icon-sendemail"><a href="{U_EMAIL_TOPIC}" title="{L_EMAIL_TOPIC}">{L_EMAIL_TOPIC}</a></li><!-- ENDIF -->
+ <!-- IF U_PRINT_TOPIC --><li class="small-icon icon-print"><a href="{U_PRINT_TOPIC}" title="{L_PRINT_TOPIC}" accesskey="p">{L_PRINT_TOPIC}</a></li><!-- ENDIF -->
<!-- IF S_HAS_ATTACHMENTS -->
<li class="small-icon icon-download">
<a class="dropdown-toggle-submenu" href="{U_DOWNLOAD_ALL_ATTACHMENTS}" title="{L_DOWNLOAD_ALL_ATTACHMENTS}">{L_DOWNLOAD_ALL_ATTACHMENTS}</a>
diff --git a/phpBB/styles/prosilver/theme/bidi.css b/phpBB/styles/prosilver/theme/bidi.css
index 850726db89..0d5e1cf829 100644
--- a/phpBB/styles/prosilver/theme/bidi.css
+++ b/phpBB/styles/prosilver/theme/bidi.css
@@ -552,12 +552,6 @@ ul.linklist li.small-icon > a, ul.linklist li.breadcrumbs span:first-child > a {
margin: 0 1px 0 5px;
}
-/* Sub-header (navigation bar)
---------------------------------------------- */
-.rtl a.print, .rtl a.sendemail {
- text-align: right;
-}
-
/* Icon images
---------------------------------------- */
.rtl .small-icon {
diff --git a/phpBB/styles/prosilver/theme/buttons.css b/phpBB/styles/prosilver/theme/buttons.css
index 93c325e416..3422af8b64 100644
--- a/phpBB/styles/prosilver/theme/buttons.css
+++ b/phpBB/styles/prosilver/theme/buttons.css
@@ -101,27 +101,6 @@
.dropdown-visible .dropdown-select.tools-icon:before,
.nojs .dropdown-container:hover .dropdown-select.tools-icon:before { background-position: -80px -20px; }
-/* Sub-header (navigation bar)
---------------------------------------------- */
-a.print, a.sendemail {
- display: block;
- overflow: hidden;
- height: 18px;
- text-indent: -5000px;
- text-align: left;
- background-repeat: no-repeat;
-}
-
-a.print {
- background-image: none;
- width: 22px;
-}
-
-a.sendemail {
- background-image: none;
- width: 22px;
-}
-
/* Icon images
---------------------------------------- */
.small-icon {
diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css
index 5f6ca4929c..30650e7411 100644
--- a/phpBB/styles/prosilver/theme/colours.css
+++ b/phpBB/styles/prosilver/theme/colours.css
@@ -665,14 +665,6 @@ fieldset.polls dd div {
Colours and backgrounds for buttons.css
-------------------------------------------------------------- */
-a.print {
- background-image: url("./images/icon_print.gif");
-}
-
-a.sendemail {
- background-image: url("./images/icon_sendemail.gif");
-}
-
.buttons div a, .dropdown-select {
border-color: #C7C3BF;
background-color: #FFFFFF;
@@ -736,6 +728,8 @@ a.sendemail {
.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"); }
/* Profile & navigation icons */
.email-icon, .email-icon a { background-image: url("./images/icon_contact_email.gif"); }
diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css
index 298d310ab1..3d5a0a433d 100644
--- a/phpBB/styles/prosilver/theme/common.css
+++ b/phpBB/styles/prosilver/theme/common.css
@@ -433,11 +433,11 @@ ul.linklist.bulletin li:before {
}
ul.linklist.bulletin li:first-child:before, ul.linklist.bulletin li.rightside:last-child:before {
- display: none;
+ content: none;
}
ul.linklist.bulletin li.no-bulletin:before {
- display: none;
+ content: none;
}
.responsive-menu:before {
@@ -597,9 +597,20 @@ ul.linklist.bulletin li.no-bulletin:before {
/* Responsive breadcrumbs
----------------------------------------*/
.breadcrumbs .crumb {
+ float: left;
word-wrap: normal;
}
+.breadcrumbs .crumb:before {
+ content: '‹';
+ font-weight: bold;
+ padding: 0 0.5em;
+}
+
+.breadcrumbs .crumb:first-child:before {
+ content: none;
+}
+
.breadcrumbs .crumb a {
display: inline-block;
white-space: nowrap;
@@ -1078,7 +1089,7 @@ form > p.post-notice strong {
.dropdown-extended .footer {
text-align: center;
- font-size: 1.2em;
+ font-size: 1.1em;
}
.dropdown-extended ul li a, .notification_list dt > a, .dropdown-extended .footer > a {
@@ -1096,6 +1107,7 @@ form > p.post-notice strong {
.notification_list ul li p {
margin: 0;
+ font-size: 1em;
}
.notification_list div.notifications {
diff --git a/phpBB/styles/prosilver/theme/forms.css b/phpBB/styles/prosilver/theme/forms.css
index 64d2df2d1a..88f2bd65c5 100644
--- a/phpBB/styles/prosilver/theme/forms.css
+++ b/phpBB/styles/prosilver/theme/forms.css
@@ -284,7 +284,7 @@ fieldset.submit-buttons input {
input.inputbox { width: 85%; }
input.medium { width: 50%; }
input.narrow { width: 25%; }
-input.tiny { width: 125px; }
+input.tiny { width: 150px; }
textarea.inputbox {
width: 85%;
diff --git a/phpBB/styles/prosilver/theme/images/icon_print.gif b/phpBB/styles/prosilver/theme/images/icon_print.gif
index a71dfdde70..e464e304ea 100644..100755
--- a/phpBB/styles/prosilver/theme/images/icon_print.gif
+++ b/phpBB/styles/prosilver/theme/images/icon_print.gif
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/icon_sendemail.gif b/phpBB/styles/prosilver/theme/images/icon_sendemail.gif
index f6b8aa10e1..92a39c8af9 100644
--- a/phpBB/styles/prosilver/theme/images/icon_sendemail.gif
+++ b/phpBB/styles/prosilver/theme/images/icon_sendemail.gif
Binary files differ
diff --git a/phpBB/styles/subsilver2/template/breadcrumbs.html b/phpBB/styles/subsilver2/template/breadcrumbs.html
index 09ee9a8606..47cb82c790 100644
--- a/phpBB/styles/subsilver2/template/breadcrumbs.html
+++ b/phpBB/styles/subsilver2/template/breadcrumbs.html
@@ -4,7 +4,9 @@
<td class="row1">
<p class="breadcrumbs"><!-- IF U_SITE_HOME --><a href="{U_SITE_HOME}"{$MICRODATA}>{L_SITE_HOME}</a> <strong>&#187;</strong> <!-- ENDIF --><a href="{U_INDEX}"{$MICRODATA}>{L_INDEX}</a><!-- BEGIN navlinks --> &#187; <a href="{navlinks.U_VIEW_FORUM}"{$MICRODATA}>{navlinks.FORUM_NAME}</a><!-- END navlinks -->
<!-- EVENT overall_header_breadcrumb_append --></p>
+ <!-- EVENT overall_footer_timezone_before -->
<p class="datetime">{S_TIMEZONE}</p>
+ <!-- EVENT overall_footer_timezone_after -->
</td>
</tr>
</table>
diff --git a/phpBB/styles/subsilver2/template/index_body.html b/phpBB/styles/subsilver2/template/index_body.html
index ea4cc76171..9e859eac0e 100644
--- a/phpBB/styles/subsilver2/template/index_body.html
+++ b/phpBB/styles/subsilver2/template/index_body.html
@@ -15,7 +15,14 @@
<!-- INCLUDE forumlist_body.html -->
<!-- IF not S_IS_BOT or U_TEAM -->
-<span class="gensmall"><!-- IF not S_IS_BOT --><a href="{U_DELETE_COOKIES}">{L_DELETE_COOKIES}</a><!-- ENDIF --><!-- IF not S_IS_BOT and U_TEAM --> | <!-- ENDIF --><!-- IF U_TEAM --><a href="{U_TEAM}">{L_THE_TEAM}</a><!-- ENDIF --></span><br />
+<span class="gensmall">
+ <!-- IF not S_IS_BOT --><a href="{U_DELETE_COOKIES}">{L_DELETE_COOKIES}</a><!-- ENDIF -->
+ <!-- IF not S_IS_BOT and U_TEAM --> | <!-- ENDIF -->
+ <!-- EVENT overall_footer_teamlink_before -->
+ <!-- IF U_TEAM --><a href="{U_TEAM}">{L_THE_TEAM}</a><!-- ENDIF -->
+ <!-- EVENT overall_footer_teamlink_after -->
+</span>
+<br />
<!-- ENDIF -->
<br clear="all" />
diff --git a/phpBB/styles/subsilver2/template/viewtopic_body.html b/phpBB/styles/subsilver2/template/viewtopic_body.html
index a5a50780fe..307ed0f391 100644
--- a/phpBB/styles/subsilver2/template/viewtopic_body.html
+++ b/phpBB/styles/subsilver2/template/viewtopic_body.html
@@ -80,7 +80,7 @@
<!-- BEGIN poll_option -->
<tr>
<!-- IF S_CAN_VOTE -->
- <td>
+ <td<!-- IF poll_option.POLL_OPTION_MOST_VOTES --> class="most-votes"<!-- ENDIF -->>
<!-- IF S_IS_MULTI_CHOICE -->
<input type="checkbox" class="radio" name="vote_id[]" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> />
<!-- ELSE -->
diff --git a/phpBB/ucp.php b/phpBB/ucp.php
index eaa40a07a2..73eaeaa127 100644
--- a/phpBB/ucp.php
+++ b/phpBB/ucp.php
@@ -337,7 +337,7 @@ if (!$config['allow_topic_notify'] && !$config['allow_forum_notify'])
* @var p_master module Object holding all modules and their status
* @var mixed id Active module category (can be the int or string)
* @var string mode Active module
-* @since 3.1-A1
+* @since 3.1.0-a1
*/
$vars = array('module', 'id', 'mode');
extract($phpbb_dispatcher->trigger_event('core.ucp_display_module_before', compact($vars)));
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index 4da0267284..8da8a0cdcc 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -387,7 +387,7 @@ $sql_array = array(
*
* @event core.viewforum_get_topic_data
* @var array sql_array The SQL array to get the data of all topics
-* @since 3.1-A1
+* @since 3.1.0-a1
*/
$vars = array('sql_array');
extract($phpbb_dispatcher->trigger_event('core.viewforum_get_topic_data', compact($vars)));
@@ -582,7 +582,7 @@ if (sizeof($shadow_topic_list))
*
* @event core.viewforum_get_shadowtopic_data
* @var array sql_array SQL array to get the data of any shadowtopics
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('sql_array');
extract($phpbb_dispatcher->trigger_event('core.viewforum_get_shadowtopic_data', compact($vars)));
@@ -653,6 +653,18 @@ $template->assign_vars(array(
$topic_list = ($store_reverse) ? array_merge($announcement_list, array_reverse($topic_list)) : array_merge($announcement_list, $topic_list);
$topic_tracking_info = $tracking_topics = array();
+/**
+* Modify topics data before we display the viewforum page
+*
+* @event core.viewforum_modify_topics_data
+* @var array topic_list Array with current viewforum page topic ids
+* @var array rowset Array with topics data (in topic_id => topic_data format)
+* @var int total_topic_count Forum's total topic count
+* @since 3.1.0-b3
+*/
+$vars = array('topic_list', 'rowset', 'total_topic_count');
+extract($phpbb_dispatcher->trigger_event('core.viewforum_modify_topics_data', compact($vars)));
+
// Okay, lets dump out the page ...
if (sizeof($topic_list))
{
@@ -737,7 +749,7 @@ if (sizeof($topic_list))
$view_topic_url_params = 'f=' . $row['forum_id'] . '&amp;t=' . $topic_id;
$view_topic_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", $view_topic_url_params);
- $topic_unapproved = ($row['topic_visibility'] == ITEM_UNAPPROVED && $auth->acl_get('m_approve', $row['forum_id']));
+ $topic_unapproved = (($row['topic_visibility'] == ITEM_UNAPPROVED || $row['topic_visibility'] == ITEM_REAPPROVE) && $auth->acl_get('m_approve', $row['forum_id']));
$posts_unapproved = ($row['topic_visibility'] == ITEM_APPROVED && $row['topic_posts_unapproved'] && $auth->acl_get('m_approve', $row['forum_id']));
$topic_deleted = $row['topic_visibility'] == ITEM_DELETED;
@@ -807,7 +819,7 @@ if (sizeof($topic_list))
* @event core.viewforum_modify_topicrow
* @var array row Array with topic data
* @var array topic_row Template array with topic data
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('row', 'topic_row');
extract($phpbb_dispatcher->trigger_event('core.viewforum_modify_topicrow', compact($vars)));
diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php
index 1738005786..9b462b2656 100644
--- a/phpBB/viewonline.php
+++ b/phpBB/viewonline.php
@@ -143,7 +143,7 @@ $sql_ary = array(
* @var bool show_guests Do we display guests in the list
* @var int guest_counter Number of guests displayed
* @var array forum_data Array with forum data
-* @since 3.1-A1
+* @since 3.1.0-a1
* @change 3.1.0-a2 Added vars guest_counter and forum_data
*/
$vars = array('sql_ary', 'show_guests', 'guest_counter', 'forum_data');
@@ -351,7 +351,7 @@ while ($row = $db->sql_fetchrow($result))
* @var string location Page name to displayed in the list
* @var string location_url Page url to displayed in the list
* @var array forum_data Array with forum data
- * @since 3.1-A1
+ * @since 3.1.0-a1
* @change 3.1.0-a2 Added var forum_data
*/
$vars = array('on_page', 'row', 'location', 'location_url', 'forum_data');
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 1a74ad3e38..36d7533254 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -266,7 +266,7 @@ if ($topic_data['topic_visibility'] != ITEM_APPROVED && !$auth->acl_get('m_appro
if ($post_id)
{
// are we where we are supposed to be?
- if ($topic_data['post_visibility'] == ITEM_UNAPPROVED && !$auth->acl_get('m_approve', $topic_data['forum_id']))
+ if (($topic_data['post_visibility'] == ITEM_UNAPPROVED || $topic_data['post_visibility'] == ITEM_REAPPROVE) && !$auth->acl_get('m_approve', $topic_data['forum_id']))
{
// If post_id was submitted, we try at least to display the topic as a last resort...
if ($topic_id)
@@ -422,17 +422,11 @@ else
$highlight_match = $highlight = '';
if ($hilit_words)
{
- foreach (explode(' ', trim($hilit_words)) as $word)
- {
- if (trim($word))
- {
- $word = str_replace('\*', '\w+?', preg_quote($word, '#'));
- $word = preg_replace('#(^|\s)\\\\w\*\?(\s|$)#', '$1\w+?$2', $word);
- $highlight_match .= (($highlight_match != '') ? '|' : '') . $word;
- }
- }
-
- $highlight = urlencode($hilit_words);
+ $highlight_match = phpbb_clean_search_string($hilit_words);
+ $highlight = urlencode($highlight_match);
+ $highlight_match = str_replace('\*', '\w+?', preg_quote($highlight_match, '#'));
+ $highlight_match = preg_replace('#(?<=^|\s)\\\\w\*\?(?=\s|$)#', '\w+?', $highlight_match);
+ $highlight_match = str_replace(' ', '|', $highlight_match);
}
// Make sure $start is set to the last page if it exceeds the amount
@@ -864,6 +858,7 @@ if (!empty($topic_data['poll_start']))
$option_pct_txt = sprintf("%.1d%%", round($option_pct * 100));
$option_pct_rel = ($poll_most > 0) ? $poll_option['poll_option_total'] / $poll_most : 0;
$option_pct_rel_txt = sprintf("%.1d%%", round($option_pct_rel * 100));
+ $option_most_votes = ($poll_option['poll_option_total'] > 0 && $poll_option['poll_option_total'] == $poll_most) ? true : false;
$template->assign_block_vars('poll_option', array(
'POLL_OPTION_ID' => $poll_option['poll_option_id'],
@@ -874,6 +869,7 @@ if (!empty($topic_data['poll_start']))
'POLL_OPTION_PCT' => round($option_pct * 100),
'POLL_OPTION_WIDTH' => round($option_pct * 250),
'POLL_OPTION_VOTED' => (in_array($poll_option['poll_option_id'], $cur_voted_id)) ? true : false,
+ 'POLL_OPTION_MOST_VOTES' => $option_most_votes,
));
}
@@ -1003,10 +999,20 @@ $sql_ary = array(
* @var string sort_dir Direction the posts are sorted by
* @var int start Pagination information
* @var array sql_ary The SQL array to get the data of posts and posters
-* @since 3.1-A1
+* @since 3.1.0-a1
* @change 3.1.0-a2 Added vars forum_id, topic_id, topic_data, post_list, sort_days, sort_key, sort_dir, start
*/
-$vars = array('forum_id', 'topic_id', 'topic_data', 'post_list', 'sort_days', 'sort_key', 'sort_dir', 'start', 'sql_ary');
+$vars = array(
+ 'forum_id',
+ 'topic_id',
+ 'topic_data',
+ 'post_list',
+ 'sort_days',
+ 'sort_key',
+ 'sort_dir',
+ 'start',
+ 'sql_ary',
+);
extract($phpbb_dispatcher->trigger_event('core.viewtopic_get_post_data', compact($vars)));
$sql = $db->sql_build_query('SELECT', $sql_ary);
@@ -1032,7 +1038,7 @@ while ($row = $db->sql_fetchrow($result))
{
$attach_list[] = (int) $row['post_id'];
- if ($row['post_visibility'] == ITEM_UNAPPROVED)
+ if ($row['post_visibility'] == ITEM_UNAPPROVED || $row['post_visibility'] == ITEM_REAPPROVE)
{
$has_attachments = true;
}
@@ -1079,7 +1085,7 @@ while ($row = $db->sql_fetchrow($result))
* @event core.viewtopic_post_rowset_data
* @var array rowset_data Array with the rowset data for this post
* @var array row Array with original user and post data
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('rowset_data', 'row');
extract($phpbb_dispatcher->trigger_event('core.viewtopic_post_rowset_data', compact($vars)));
@@ -1135,7 +1141,7 @@ while ($row = $db->sql_fetchrow($result))
* @var array user_cache_data Array with the user's data
* @var int poster_id Poster's user id
* @var array row Array with original user and post data
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('user_cache_data', 'poster_id', 'row');
extract($phpbb_dispatcher->trigger_event('core.viewtopic_cache_guest_data', compact($vars)));
@@ -1195,7 +1201,7 @@ while ($row = $db->sql_fetchrow($result))
* @var array user_cache_data Array with the user's data
* @var int poster_id Poster's user id
* @var array row Array with original user and post data
- * @since 3.1-A1
+ * @since 3.1.0-a1
*/
$vars = array('user_cache_data', 'poster_id', 'row');
extract($phpbb_dispatcher->trigger_event('core.viewtopic_cache_user_data', compact($vars)));
@@ -1646,7 +1652,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'S_HAS_ATTACHMENTS' => (!empty($attachments[$row['post_id']])) ? true : false,
'S_MULTIPLE_ATTACHMENTS' => !empty($attachments[$row['post_id']]) && sizeof($attachments[$row['post_id']]) > 1,
- 'S_POST_UNAPPROVED' => ($row['post_visibility'] == ITEM_UNAPPROVED) ? true : false,
+ 'S_POST_UNAPPROVED' => ($row['post_visibility'] == ITEM_UNAPPROVED || $row['post_visibility'] == ITEM_REAPPROVE) ? true : false,
'S_POST_DELETED' => ($row['post_visibility'] == ITEM_DELETED) ? true : false,
'L_POST_DELETED_MESSAGE' => $l_deleted_message,
'S_POST_REPORTED' => ($row['post_reported'] && $auth->acl_get('m_report', $forum_id)) ? true : false,
@@ -1674,15 +1680,29 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
* @var int start Start item of this page
* @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 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
* @var array user_poster_data Poster's data from user cache
* @var array post_row Template block array of the post
- * @since 3.1-A1
+ * @var array topic_data Array with topic data
+ * @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
*/
- $vars = array('start', 'current_row_number', 'end', 'row', 'cp_row', 'attachments', 'user_poster_data', 'post_row');
+ $vars = array(
+ 'start',
+ 'current_row_number',
+ 'end',
+ 'total_posts',
+ 'row',
+ 'cp_row',
+ 'attachments',
+ 'user_poster_data',
+ 'post_row',
+ 'topic_data',
+ );
extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_post_row', compact($vars)));
$i = $current_row_number;
@@ -1729,14 +1749,28 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
* @var int start Start item of this page
* @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 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
* @var array user_poster_data Poster's data from user cache
* @var array post_row Template block array of the post
+ * @var array topic_data Array with topic data
* @since 3.1.0-a3
+ * @change 3.1.0-b3 Added topic_data array, total_posts
*/
- $vars = array('start', 'current_row_number', 'end', 'row', 'cp_row', 'attachments', 'user_poster_data', 'post_row');
+ $vars = array(
+ 'start',
+ 'current_row_number',
+ 'end',
+ 'total_posts',
+ 'row',
+ 'cp_row',
+ 'attachments',
+ 'user_poster_data',
+ 'post_row',
+ 'topic_data',
+ );
extract($phpbb_dispatcher->trigger_event('core.viewtopic_post_row_after', compact($vars)));
$i = $current_row_number;
@@ -1880,11 +1914,11 @@ $page_title = $topic_data['topic_title'] . ($start ? ' - ' . sprintf($user->lang
* You can use this event to modify the page title of the viewtopic page
*
* @event core.viewtopic_modify_page_title
-* @var string page_title Title of the index page
+* @var string page_title Title of the viewtopic page
* @var array topic_data Array with topic data
* @var int forum_id Forum ID of the topic
* @var int start Start offset used to calculate the page
-* @since 3.1-A1
+* @since 3.1.0-a1
*/
$vars = array('page_title', 'topic_data', 'forum_id', 'start');
extract($phpbb_dispatcher->trigger_event('core.viewtopic_modify_page_title', compact($vars)));
diff --git a/tests/dbal/db_tools_test.php b/tests/dbal/db_tools_test.php
index e25335165a..df8f22083b 100644
--- a/tests/dbal/db_tools_test.php
+++ b/tests/dbal/db_tools_test.php
@@ -11,7 +11,9 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
class phpbb_dbal_db_tools_test extends phpbb_database_test_case
{
+ /** @var \phpbb\db\driver\driver_interface */
protected $db;
+ /** @var \phpbb\db\tools */
protected $tools;
protected $table_exists;
protected $table_data;
@@ -207,6 +209,32 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
$this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'column_does_not_exist'));
}
+ public function test_column_change_with_index()
+ {
+ // Create column
+ $this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12012'));
+ $this->assertTrue($this->tools->sql_column_add('prefix_table_name', 'c_bug_12012', array('DECIMAL', 0)));
+ $this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12012'));
+
+ // Create index over the column
+ $this->assertFalse($this->tools->sql_index_exists('prefix_table_name', 'i_bug_12012'));
+ $this->assertTrue($this->tools->sql_create_index('prefix_table_name', 'i_bug_12012', array('c_bug_12012', 'c_bool')));
+ $this->assertTrue($this->tools->sql_index_exists('prefix_table_name', 'i_bug_12012'));
+
+ // Change type from int to string
+ $this->assertTrue($this->tools->sql_column_change('prefix_table_name', 'c_bug_12012', array('VCHAR:100', '')));
+
+ // Remove the index
+ $this->assertTrue($this->tools->sql_index_exists('prefix_table_name', 'i_bug_12012'));
+ $this->assertTrue($this->tools->sql_index_drop('prefix_table_name', 'i_bug_12012'));
+ $this->assertFalse($this->tools->sql_index_exists('prefix_table_name', 'i_bug_12012'));
+
+ // Remove the column
+ $this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12012'));
+ $this->assertTrue($this->tools->sql_column_remove('prefix_table_name', 'c_bug_12012'));
+ $this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12012'));
+ }
+
public function test_column_remove()
{
$this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_int_size'));
@@ -216,6 +244,28 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
$this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_int_size'));
}
+ public function test_column_remove_with_index()
+ {
+ // Create column
+ $this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12012_2'));
+ $this->assertTrue($this->tools->sql_column_add('prefix_table_name', 'c_bug_12012_2', array('UINT', 4)));
+ $this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12012_2'));
+
+ // Create index over the column
+ $this->assertFalse($this->tools->sql_index_exists('prefix_table_name', 'i_bug_12012_2'));
+ $this->assertTrue($this->tools->sql_create_index('prefix_table_name', 'i_bug_12012_2', array('c_bug_12012_2', 'c_bool')));
+ $this->assertTrue($this->tools->sql_index_exists('prefix_table_name', 'i_bug_12012_2'));
+
+ $this->assertFalse($this->tools->sql_index_exists('prefix_table_name', 'i_bug_12012_3'));
+ $this->assertTrue($this->tools->sql_create_index('prefix_table_name', 'i_bug_12012_3', array('c_bug_12012_2')));
+ $this->assertTrue($this->tools->sql_index_exists('prefix_table_name', 'i_bug_12012_3'));
+
+ // Remove the column
+ $this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12012_2'));
+ $this->assertTrue($this->tools->sql_column_remove('prefix_table_name', 'c_bug_12012_2'));
+ $this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_bug_12012_2'));
+ }
+
public function test_column_remove_primary()
{
$this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_id'));
@@ -252,7 +302,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
$this->assertFalse($this->tools->sql_table_exists('prefix_test_table'));
}
- public function test_peform_schema_changes_drop_tables()
+ public function test_perform_schema_changes_drop_tables()
{
$db_tools = $this->getMock('\phpbb\db\tools', array(
'sql_table_exists',
@@ -278,7 +328,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
));
}
- public function test_peform_schema_changes_drop_columns()
+ public function test_perform_schema_changes_drop_columns()
{
$db_tools = $this->getMock('\phpbb\db\tools', array(
'sql_column_exists',
diff --git a/tests/dbal/migration/revert.php b/tests/dbal/migration/revert.php
index c2520f4d8a..1c98710ffb 100644
--- a/tests/dbal/migration/revert.php
+++ b/tests/dbal/migration/revert.php
@@ -35,6 +35,14 @@ class phpbb_dbal_migration_revert extends \phpbb\db\migration\migration
{
return array(
array('config.add', array('foobartest', 0)),
+ array('custom', array(array(&$this, 'my_custom_function'))),
);
}
+
+ function my_custom_function()
+ {
+ global $migrator_test_revert_counter;
+
+ $migrator_test_revert_counter += 1;
+ }
}
diff --git a/tests/dbal/migrator_test.php b/tests/dbal/migrator_test.php
index c18c49b2a0..cc3e92071f 100644
--- a/tests/dbal/migrator_test.php
+++ b/tests/dbal/migrator_test.php
@@ -174,10 +174,14 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
public function test_revert()
{
+ global $migrator_test_revert_counter;
+
// Make sure there are no other migrations in the db, this could cause issues
$this->db->sql_query("DELETE FROM phpbb_migrations");
$this->migrator->load_migration_state();
+ $migrator_test_revert_counter = 0;
+
$this->migrator->set_migrations(array('phpbb_dbal_migration_revert', 'phpbb_dbal_migration_revert_with_dependency'));
$this->assertFalse($this->migrator->migration_state('phpbb_dbal_migration_revert'));
@@ -219,6 +223,8 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
{
$this->fail('Revert did not remove test_column.');
}
+
+ $this->assertEquals(1, $migrator_test_revert_counter, 'Revert did call custom function again');
}
public function test_fail()
diff --git a/tests/event/export_php_test.php b/tests/event/export_php_test.php
new file mode 100644
index 0000000000..f38b524ffe
--- /dev/null
+++ b/tests/event/export_php_test.php
@@ -0,0 +1,45 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2014 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+class phpbb_event_export_php_test extends phpbb_test_case
+{
+ /** @var \phpbb\event\php_exporter */
+ protected $exporter;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ global $phpbb_root_path;
+ $this->exporter = new \phpbb\event\php_exporter($phpbb_root_path);
+ }
+
+ static public function crawl_php_file_data()
+ {
+ global $phpbb_root_path;
+ $exporter = new \phpbb\event\php_exporter($phpbb_root_path);
+ $files = $exporter->get_recursive_file_list($phpbb_root_path);
+
+ $data_provider = array();
+ foreach ($files as $file)
+ {
+ $data_provider[] = array($file);
+ }
+
+ return $data_provider;
+ }
+
+ /**
+ * @dataProvider crawl_php_file_data
+ */
+ public function test_crawl_php_file($file)
+ {
+ $this->assertGreaterThanOrEqual(0, $this->exporter->crawl_php_file($file));
+ }
+}
diff --git a/tests/event/fixtures/default.test b/tests/event/fixtures/default.test
new file mode 100644
index 0000000000..edfe4823dc
--- /dev/null
+++ b/tests/event/fixtures/default.test
@@ -0,0 +1,9 @@
+<?php
+
+/**
+* Description
+*
+* @event default.dispatch
+* @since 3.1.0-b2
+*/
+$phpbb_dispatcher->dispatch('default.dispatch');
diff --git a/tests/event/fixtures/duplicate_event.test b/tests/event/fixtures/duplicate_event.test
new file mode 100644
index 0000000000..b042ca0377
--- /dev/null
+++ b/tests/event/fixtures/duplicate_event.test
@@ -0,0 +1,19 @@
+<?php
+
+ /**
+ * Event after the post data has been assigned to the template
+ *
+ * @event duplicate.trigger
+ * @var int start Start item of this page
+ * @since 3.1.0-a3
+ */
+ $vars = array('start');
+ extract($phpbb_dispatcher->trigger_event('duplicate.trigger', compact($vars)));
+
+ /**
+ * Event after the post data has been assigned to the template
+ *
+ * @event duplicate.trigger
+ * @since 3.1.0-b1
+ */
+ $phpbb_dispatcher->dispatch('duplicate.trigger');
diff --git a/tests/event/fixtures/extra_description.test b/tests/event/fixtures/extra_description.test
new file mode 100644
index 0000000000..ce8f97ce89
--- /dev/null
+++ b/tests/event/fixtures/extra_description.test
@@ -0,0 +1,11 @@
+<?php
+
+/**
+* Description
+*
+* NOTE: This will not be exported
+*
+* @event extra_description.dispatch
+* @since 3.1.0-b2
+*/
+$phpbb_dispatcher->dispatch('extra_description.dispatch');
diff --git a/tests/event/fixtures/missing_var.test b/tests/event/fixtures/missing_var.test
new file mode 100644
index 0000000000..7ced5e93dc
--- /dev/null
+++ b/tests/event/fixtures/missing_var.test
@@ -0,0 +1,17 @@
+<?php
+
+ /**
+ * Event after the post data has been assigned to the template
+ *
+ * @event core.trigger
+ * @var int start Start item of this page
+ * @var int current_row_number Number of the post on this page
+ * @var int end Number of posts on this page
+ * @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
+ * @var array user_poster_data Poster's data from user cache
+ * @since 3.1.0-a3
+ */
+ $vars = array('start', 'current_row_number', 'end', 'row', 'cp_row', 'attachments', 'user_poster_data', 'post_row');
+ extract($phpbb_dispatcher->trigger_event('core.trigger', compact($vars)));
diff --git a/tests/event/fixtures/none.test b/tests/event/fixtures/none.test
new file mode 100644
index 0000000000..6e2267024b
--- /dev/null
+++ b/tests/event/fixtures/none.test
@@ -0,0 +1,6 @@
+<?php
+
+/**
+* Hi there :)
+*/
+echo 1 + 2;
diff --git a/tests/event/fixtures/trigger.test b/tests/event/fixtures/trigger.test
new file mode 100644
index 0000000000..7cd6a7b956
--- /dev/null
+++ b/tests/event/fixtures/trigger.test
@@ -0,0 +1,15 @@
+<?php
+
+ /**
+ * Event after the post data has been assigned to the template
+ *
+ * @event core.trigger
+ * @var int start Start item of this page
+ * @var int current_row_number Number of the post on this page
+ * @var int end Number of posts on this page
+ * @var array row Array with original post and user data
+ * @var array cp_row Custom profile field data of the poster
+ * @since 3.1.0-a3
+ */
+ $vars = array('start', 'current_row_number', 'end', 'row', 'cp_row');
+ extract($phpbb_dispatcher->trigger_event('core.trigger', compact($vars)));
diff --git a/tests/event/fixtures/trigger_many_vars.test b/tests/event/fixtures/trigger_many_vars.test
new file mode 100644
index 0000000000..a624138588
--- /dev/null
+++ b/tests/event/fixtures/trigger_many_vars.test
@@ -0,0 +1,65 @@
+<?php
+
+ /**
+ * This event allows you to modify template variables for the posting screen
+ *
+ * @event core.posting_modify_template_vars
+ * @var array post_data Array with post data
+ * @var array moderators Array with forum moderators
+ * @var string mode What action to take if the form is submitted
+ * post|reply|quote|edit|delete|bump|smilies|popup
+ * @var string page_title Title of the mode page
+ * @var bool s_topic_icons Whether or not to show the topic icons
+ * @var string form_enctype If attachments are allowed for this form
+ * "multipart/form-data" or empty string
+ * @var string s_action The URL to submit the POST data to
+ * @var string s_hidden_fields Concatenated hidden input tags of posting form
+ * @var int post_id ID of the post
+ * @var int topic_id ID of the topic
+ * @var int forum_id ID of the forum
+ * @var bool submit Whether or not the form has been submitted
+ * @var bool preview Whether or not the post is being previewed
+ * @var bool save Whether or not a draft is being saved
+ * @var bool load Whether or not a draft is being loaded
+ * @var bool delete Whether or not the post is being deleted
+ * @var bool cancel Whether or not to cancel the form (returns to
+ * viewtopic or viewforum depending on if the user
+ * is posting a new topic or editing a post)
+ * @var array error Any error strings; a non-empty array aborts
+ * form submission.
+ * NOTE: Should be actual language strings, NOT
+ * language keys.
+ * @var bool refresh Whether or not to retain previously submitted data
+ * @var array page_data Posting page data that should be passed to the
+ * posting page via $template->assign_vars()
+ * @var object message_parser The message parser object
+ * @since 3.1.0-a1
+ * @change 3.1.0-b3 Added vars post_data, moderators, mode, page_title,
+ * s_topic_icons, form_enctype, s_action, s_hidden_fields,
+ * post_id, topic_id, forum_id, submit, preview, save, load,
+ * delete, cancel, refresh, error, page_data, message_parser
+ */
+ $vars = array(
+ 'post_data',
+ 'moderators',
+ 'mode',
+ 'page_title',
+ 's_topic_icons',
+ 'form_enctype',
+ 's_action',
+ 's_hidden_fields',
+ 'post_id',
+ 'topic_id',
+ 'forum_id',
+ 'submit',
+ 'preview',
+ 'save',
+ 'load',
+ 'delete',
+ 'cancel',
+ 'refresh',
+ 'error',
+ 'page_data',
+ 'message_parser',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.posting_modify_template_vars', compact($vars)));
diff --git a/tests/event/md_exporter_test.php b/tests/event/md_exporter_test.php
new file mode 100644
index 0000000000..b62b55accd
--- /dev/null
+++ b/tests/event/md_exporter_test.php
@@ -0,0 +1,67 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2014 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+class phpbb_event_md_exporter_test extends phpbb_test_case
+{
+
+ static public function crawl_eventsmd_data()
+ {
+ return array(
+ array('styles'),
+ array('adm'),
+ );
+ }
+
+ /**
+ * @dataProvider crawl_eventsmd_data
+ */
+ public function test_crawl_eventsmd($filter)
+ {
+ global $phpbb_root_path;
+ $exporter = new \phpbb\event\md_exporter($phpbb_root_path);
+ $this->assertGreaterThan(0, $exporter->crawl_eventsmd('docs/events.md', $filter));
+ }
+
+ static public function crawl_template_file_data()
+ {
+ global $phpbb_root_path;
+ $exporter = new \phpbb\event\md_exporter($phpbb_root_path);
+ $data_provider = array();
+
+ $styles = array(
+ 'adm/style/' => 'adm',
+ 'styles/prosilver/template/' => 'styles',
+ 'styles/subsilver2/template/' => 'styles',
+ );
+ foreach ($styles as $path => $filter)
+ {
+ $files = $exporter->get_recursive_file_list($phpbb_root_path . $path, $path);
+ foreach ($files as $file)
+ {
+ $data_provider[] = array($filter, $path . $file);
+ }
+ }
+
+ return $data_provider;
+ }
+
+ /**
+ * @dataProvider crawl_template_file_data
+ */
+ public function test_crawl_template_file($filter, $file)
+ {
+ global $phpbb_root_path;
+ $exporter = new \phpbb\event\md_exporter($phpbb_root_path);
+ $exporter->crawl_eventsmd('docs/events.md', $filter);
+ $events = $exporter->crawl_file_for_events($file);
+
+ $this->assertGreaterThanOrEqual(0, sizeof($events));
+ $this->assertTrue($exporter->validate_events_from_file($file, $events));
+ }
+}
diff --git a/tests/event/php_exporter_test.php b/tests/event/php_exporter_test.php
new file mode 100644
index 0000000000..9917f8309b
--- /dev/null
+++ b/tests/event/php_exporter_test.php
@@ -0,0 +1,722 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2014 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+class phpbb_event_php_exporter_test extends phpbb_test_case
+{
+ /** @var \phpbb\event\php_exporter */
+ protected $exporter;
+
+ public function setUp()
+ {
+ parent::setUp();
+ $this->exporter = new \phpbb\event\php_exporter(dirname(__FILE__) . '/fixtures/');
+ }
+
+ static public function crawl_php_file_data()
+ {
+ return array(
+ array(
+ 'default.test',
+ array(
+ 'default.dispatch' => array(
+ 'event' => 'default.dispatch',
+ 'file' => 'default.test',
+ 'arguments' => array(),
+ 'since' => '3.1.0-b2',
+ 'description' => 'Description',
+ ),
+ ),
+ ),
+ array(
+ 'extra_description.test',
+ array(
+ 'extra_description.dispatch' => array(
+ 'event' => 'extra_description.dispatch',
+ 'file' => 'extra_description.test',
+ 'arguments' => array(),
+ 'since' => '3.1.0-b2',
+ 'description' => 'Description',
+ ),
+ ),
+ ),
+ array(
+ 'trigger.test',
+ array(
+ 'core.trigger' => array(
+ 'event' => 'core.trigger',
+ 'file' => 'trigger.test',
+ 'arguments' => array('cp_row', 'current_row_number', 'end', 'row', 'start'),
+ 'since' => '3.1.0-a3',
+ 'description' => 'Event after the post data has been assigned to the template',
+ ),
+ ),
+ ),
+ array(
+ 'trigger_many_vars.test',
+ array(
+ 'core.posting_modify_template_vars' => array(
+ 'event' => 'core.posting_modify_template_vars',
+ 'file' => 'trigger_many_vars.test',
+ 'arguments' => array(
+ 'cancel', 'delete', 'error', 'form_enctype', 'forum_id',
+ 'load', 'message_parser', 'mode', 'moderators', 'page_data',
+ 'page_title', 'post_data', 'post_id', 'preview', 'refresh',
+ 's_action', 's_hidden_fields', 's_topic_icons', 'save',
+ 'submit', 'topic_id',
+ ),
+ 'since' => '3.1.0-a1',
+ 'description' => 'This event allows you to modify template variables for the posting screen',
+ ),
+ ),
+ ),
+ array(
+ 'none.test',
+ array(),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider crawl_php_file_data
+ */
+ public function test_crawl_php_file($file, $expected)
+ {
+ $this->exporter->crawl_php_file($file);
+ $this->assertEquals($expected, $this->exporter->get_events());
+ }
+
+ static public function crawl_php_file_throws_data()
+ {
+ return array(
+ array('missing_var.test', null),
+ array('duplicate_event.test', 10),
+ );
+ }
+
+ /**
+ * @dataProvider crawl_php_file_throws_data
+ */
+ public function test_crawl_php_file_throws($file, $exception_code)
+ {
+ $this->setExpectedException('LogicException', '', $exception_code);
+ $this->exporter->crawl_php_file($file);
+ }
+
+ static public function validate_since_data()
+ {
+ return array(
+ 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'),
+ );
+ }
+
+ /**
+ * @dataProvider validate_since_data
+ */
+ public function test_validate_since($since, $expected)
+ {
+ $this->assertEquals($expected, $this->exporter->validate_since($since));
+ }
+
+ static public function validate_since_throws_data()
+ {
+ return array(
+ array(' * @since 3.1.0-a1'),
+ array('* @since 3.1.0-a1 '),
+ array('* @since 3.1.0-a1 bertie is cool'),
+ array('bertie* @since 3.1.0-a1'),
+ array('* @since 3.1-A2'),
+ );
+ }
+
+ /**
+ * @dataProvider validate_since_throws_data
+ * @expectedException LogicException
+ */
+ public function test_validate_since_throws($since)
+ {
+ $this->exporter->validate_since($since);
+ }
+
+ static public function validate_event_data()
+ {
+ return array(
+ array('test.event', '* @event test.event', 'test.event'),
+ array('test.event2', ' * @event test.event2', 'test.event2'),
+ );
+ }
+
+ /**
+ * @dataProvider validate_event_data
+ */
+ public function test_validate_event($event_name, $event, $expected)
+ {
+ $this->assertEquals($expected, $this->exporter->validate_event($event_name, $event));
+ }
+
+ static public function validate_event_throws_data()
+ {
+ return array(
+ array('test.event', ' * @event test.event', 1),
+ array('test.event', '* @event test.event bertie is cool', 2),
+ array('test.event', 'bertie* @event test.event', 2),
+ );
+ }
+
+ /**
+ * @dataProvider validate_event_throws_data
+ * @expectedException LogicException
+ */
+ public function test_validate_event_throws($event_name, $event, $exception_code)
+ {
+ $this->setExpectedException('LogicException', '', $exception_code);
+ $this->exporter->validate_event($event_name, $event);
+ }
+
+ static public function validate_vars_docblock_array_data()
+ {
+ return array(
+ array(array('abc', 'def'), array('abc', 'def')),
+ );
+ }
+
+ /**
+ * @dataProvider validate_vars_docblock_array_data
+ */
+ public function test_validate_vars_docblock_array($vars_array, $vars_docblock)
+ {
+ $this->assertNull($this->exporter->validate_vars_docblock_array($vars_array, $vars_docblock));
+ }
+
+ static public function validate_vars_docblock_array_throws_data()
+ {
+ return array(
+ array(array('abc', 'def'), array()),
+ array(array('abc', 'def'), array('abc')),
+ array(array('abc', 'defg'), array('abc', 'def')),
+ array(array('abc'), array('abc', 'def')),
+ array(array(), array('abc', 'def')),
+ );
+ }
+
+ /**
+ * @dataProvider validate_vars_docblock_array_throws_data
+ * @expectedException LogicException
+ */
+ public function test_validate_vars_docblock_array_throws($vars_array, $vars_docblock)
+ {
+ $this->exporter->validate_vars_docblock_array($vars_array, $vars_docblock);
+ }
+
+ static public function get_dispatch_name_data()
+ {
+ return array(
+ array("\$phpbb_dispatcher->dispatch('dispatch.one2');", 'dispatch.one2'),
+ array("\t\$phpbb_dispatcher->dispatch('dispatch.one2.thr_ee4');", 'dispatch.one2.thr_ee4'),
+ array("\$this->dispatcher->dispatch('dispatch.one2');", 'dispatch.one2'),
+ array("\$phpbb_dispatcher->dispatch('dis_patch.one');", 'dis_patch.one'),
+ );
+ }
+
+ /**
+ * @dataProvider get_dispatch_name_data
+ */
+ public function test_get_dispatch_name($event_line, $expected)
+ {
+ $this->exporter->set_content(array($event_line));
+ $this->assertEquals($expected, $this->exporter->get_event_name(0, true));
+ }
+
+ static public function get_dispatch_name_throws_data()
+ {
+ return array(
+ array("\$phpbb_dispatcher->dispatch();"),
+ array("\$phpbb_dispatcher->dispatch('');"),
+ array("\$phpbb_dispatcher->dispatch('dispatch.2one');"),
+ array("\$phpbb_dispatcher->dispatch('dispatch');"),
+ );
+ }
+
+ /**
+ * @dataProvider get_dispatch_name_throws_data
+ * @expectedException LogicException
+ */
+ public function test_get_dispatch_name_throws($event_line)
+ {
+ $this->exporter->set_content(array($event_line));
+ $this->exporter->get_event_name(0, true);
+ }
+
+ static public function get_trigger_event_name_data()
+ {
+ return array(
+ array("extract(\$phpbb_dispatcher->trigger_event('dispatch.one2', compact(\$vars)));", 'dispatch.one2'),
+ array("\textract(\$phpbb_dispatcher->trigger_event('dispatch.one2.thr_ee4', compact(\$vars)));", 'dispatch.one2.thr_ee4'),
+ array("extract(\$this->dispatcher->trigger_event('dispatch.one2', compact(\$vars)));", 'dispatch.one2'),
+ array("extract(\$phpbb_dispatcher->trigger_event('dis_patch.one', compact(\$vars)));", 'dis_patch.one'),
+ );
+ }
+
+ /**
+ * @dataProvider get_trigger_event_name_data
+ */
+ public function test_get_trigger_event_name($event_line, $expected)
+ {
+ $this->exporter->set_content(array($event_line));
+ $this->assertEquals($expected, $this->exporter->get_event_name(0, false));
+ }
+
+ static public function get_trigger_event_name_throws_data()
+ {
+ return array(
+ array("extract(\$phpbb_dispatcher->trigger_event());"),
+ array("extract(\$phpbb_dispatcher->trigger_event(''));"),
+ array("extract(\$phpbb_dispatcher->trigger_event('dispatch.2one'));"),
+ array("extract(\$phpbb_dispatcher->trigger_event('dispatch'));"),
+ array("extract(\$phpbb_dispatcher->trigger_event('dispatch.one', \$vars));"),
+ array("extract(\$phpbb_dispatcher->trigger_event('dispatch.one', compact(\$var)));"),
+ array("extract(\$phpbb_dispatcher->trigger_event('dispatch.one', compact(\$array)));"),
+ array("\$phpbb_dispatcher->trigger_event('dis_patch.one', compact(\$vars));", 'dis_patch.one'),
+ );
+ }
+
+ /**
+ * @dataProvider get_trigger_event_name_throws_data
+ * @expectedException LogicException
+ */
+ public function test_get_trigger_event_name_throws($event_line)
+ {
+ $this->exporter->set_content(array($event_line));
+ $this->exporter->get_event_name(0, false);
+ }
+
+ static public function get_vars_from_array_data()
+ {
+ return array(
+ array(
+ array(
+ '/**',
+ '*/',
+ '$vars = array(\'bertie\');',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 3,
+ array('bertie'),
+ ),
+ array(
+ array(
+ "\t/**",
+ "\t*/",
+ "\t\$vars = array('_Strange123', 'phpBB3_Test');",
+ "\t\$this->dispatcher->dispatch('test');",
+ ),
+ 3,
+ array('_Strange123', 'phpBB3_Test'),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider get_vars_from_array_data
+ */
+ public function test_get_vars_from_array($lines, $event_line, $expected)
+ {
+ $this->exporter->set_current_event('', $event_line);
+ $this->exporter->set_content($lines);
+ $this->assertEquals($expected, $this->exporter->get_vars_from_array());
+ }
+
+ static public function get_vars_from_array_throws_data()
+ {
+ return array(
+ array(
+ array(
+ '/**',
+ '*/',
+ '$phpbb_dispatcher->trigger_event(\'test\', compact($vars));',
+ ),
+ 2,
+ 1,
+ ),
+ array(
+ array(
+ '/**',
+ '*/',
+ '$vars = $bertie;',
+ '$phpbb_dispatcher->trigger_event(\'test\', compact($vars));',
+ ),
+ 3,
+ 1,
+ ),
+ array(
+ array(
+ '/**',
+ '*/',
+ '$vars = array(\'$bertie\');',
+ '$phpbb_dispatcher->trigger_event(\'test\', compact($vars));',
+ ),
+ 3,
+ 1,
+ ),
+ array(
+ array(
+ '/**',
+ '*/',
+ '$vars = array();',
+ '$phpbb_dispatcher->trigger_event(\'test\', compact($vars));',
+ ),
+ 3,
+ 1,
+ ),
+ array(
+ array(
+ '/**',
+ '*/',
+ '$vars = array(\'t1\', \'t2\', \'t3\', \'t4\', \'t5\', \'t6\', \'t7\');',
+ '$phpbb_dispatcher->trigger_event(\'test\', compact($vars));',
+ ),
+ 3,
+ 2,
+ ),
+ array(
+ array(
+ '/**',
+ '*/',
+ '$vars = array(\'test2\', \'\');',
+ '$phpbb_dispatcher->trigger_event(\'test\', compact($vars));',
+ ),
+ 3,
+ 3,
+ ),
+ array(
+ array(
+ '/**',
+ '*/',
+ '$vars = array(\'bertie\'\');',
+ '$phpbb_dispatcher->trigger_event(\'test\', compact($vars));',
+ ),
+ 3,
+ 3,
+ ),
+ array(
+ array(
+ '/**',
+ '*/',
+ '$vars = array(\'bertie\',\'basically_valid\');',
+ '$phpbb_dispatcher->trigger_event(\'test\', compact($vars));',
+ ),
+ 3,
+ 3,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider get_vars_from_array_throws_data
+ * @expectedException LogicException
+ */
+ public function test_get_vars_from_array_throws($lines, $event_line, $exception_code)
+ {
+ $this->setExpectedException('LogicException', '', $exception_code);
+
+ $this->exporter->set_current_event('', $event_line);
+ $this->exporter->set_content($lines);
+ $this->exporter->get_vars_from_array();
+ }
+
+ static public function get_vars_from_docblock_data()
+ {
+ return array(
+ array(
+ array(
+ '/**',
+ '* @var int name1 Description',
+ '* @var array name2 Description test',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 4,
+ array('name1', 'name2'),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider get_vars_from_docblock_data
+ */
+ public function test_get_vars_from_docblock($lines, $event_line, $expected)
+ {
+ $this->exporter->set_current_event('', $event_line);
+ $this->exporter->set_content($lines);
+ $this->assertEquals($expected, $this->exporter->get_vars_from_docblock());
+ }
+
+ static public function get_vars_from_docblock_throws_data()
+ {
+ return array(
+ array(
+ array(
+ '$vars = array();',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 1,
+ 2,
+ ),
+ array(
+ array(
+ '/**',
+ '* @var int name1',
+ '* @var array name2 Description test',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 4,
+ 1,
+ ),
+ array(
+ array(
+ '/**',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 2,
+ 3,
+ ),
+ array(
+ array(
+ '/**',
+ '* @var int name1 Description',
+ '* @var array $name2 Description',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 4,
+ 4,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider get_vars_from_docblock_throws_data
+ * @expectedException LogicException
+ */
+ public function test_get_vars_from_docblock_throws($lines, $event_line, $exception_code)
+ {
+ $this->setExpectedException('LogicException', '', $exception_code);
+
+ $this->exporter->set_current_event('', $event_line);
+ $this->exporter->set_content($lines);
+ $this->exporter->get_vars_from_docblock();
+ }
+
+ static public function find_since_data()
+ {
+ return array(
+ array(
+ array(
+ '/**',
+ '* @since 3.1.0-a1',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 3,
+ 1,
+ ),
+ array(
+ array(
+ '* @since 3.1.0-a1',
+ '/**',
+ '* @since 3.1.0-a1',
+ '* @changed 3.1.0-a2',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 5,
+ 2,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider find_since_data
+ */
+ public function test_find_since($lines, $event_line, $expected)
+ {
+ $this->exporter->set_current_event('', $event_line);
+ $this->exporter->set_content($lines);
+ $this->assertEquals($expected, $this->exporter->find_since());
+ }
+
+ static public function find_since_throws_data()
+ {
+ return array(
+ array(
+ array(
+ '/**',
+ '* @since 3.1.0-a1',
+ '*/',
+ '/**',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 5,
+ 1,
+ ),
+ array(
+ array(
+ '/**',
+ '* @changed 3.1.0-a1',
+ '* @changed 3.1.0-a2',
+ '* @changed 3.1.0-a3',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 5,
+ 2,
+ ),
+ array(
+ array(
+ '/**',
+ '* @since 3.1.0-a2',
+ '* @var',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 4,
+ 3,
+ ),
+ array(
+ array(
+ '/**',
+ '* @since 3.1.0-a2',
+ '* @event',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 4,
+ 3,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider find_since_throws_data
+ * @expectedException LogicException
+ */
+ public function test_find_since_throws($lines, $event_line, $exception_code)
+ {
+ $this->setExpectedException('LogicException', '', $exception_code);
+
+ $this->exporter->set_current_event('', $event_line);
+ $this->exporter->set_content($lines);
+ $this->exporter->find_since();
+ }
+
+ static public function find_description_data()
+ {
+ return array(
+ array(
+ array(
+ '/**',
+ '* Hello Bertie!',
+ '* @since 3.1.0-a1',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 4,
+ 1,
+ ),
+ array(
+ array(
+ ' /**',
+ ' * Hello Bertie!',
+ ' *',
+ ' * @since 3.1.0-a1',
+ ' * @changed 3.1.0-a2',
+ ' */',
+ ' $phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 6,
+ 1,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider find_description_data
+ */
+ public function test_find_description($lines, $event_line, $expected)
+ {
+ $this->exporter->set_current_event('', $event_line);
+ $this->exporter->set_content($lines);
+ $this->assertEquals($expected, $this->exporter->find_description());
+ }
+
+ static public function find_description_throws_data()
+ {
+ return array(
+ array(
+ array(
+ '$vars = array();',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 1,
+ 1,
+ ),
+ array(
+ array(
+ '/**',
+ '* @changed 3.1.0-a1',
+ '* @changed 3.1.0-a2',
+ '* @changed 3.1.0-a3',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 5,
+ 2,
+ ),
+ array(
+ array(
+ '/**',
+ '*',
+ '* @since 3.1.0-a2',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 4,
+ 2,
+ ),
+ array(
+ array(
+ '/**',
+ '* ',
+ '* @event',
+ '*/',
+ '$phpbb_dispatcher->dispatch(\'test\');',
+ ),
+ 4,
+ 2,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider find_description_throws_data
+ * @expectedException LogicException
+ */
+ public function test_find_description_throws($lines, $event_line, $exception_code)
+ {
+ $this->setExpectedException('LogicException', '', $exception_code);
+
+ $this->exporter->set_current_event('', $event_line);
+ $this->exporter->set_content($lines);
+ $this->exporter->find_description();
+ }
+}
diff --git a/tests/functional/disapprove_test.php b/tests/functional/visibility_disapprove_test.php
index ea594b1062..ca6f6f5f37 100644
--- a/tests/functional/disapprove_test.php
+++ b/tests/functional/visibility_disapprove_test.php
@@ -10,7 +10,7 @@
/**
* @group functional
*/
-class phpbb_functional_disapprove_test extends phpbb_functional_test_case
+class phpbb_functional_visibility_disapprove_test extends phpbb_functional_test_case
{
protected $data = array();
diff --git a/tests/functional/visibility_reapprove_test.php b/tests/functional/visibility_reapprove_test.php
new file mode 100644
index 0000000000..70134ef724
--- /dev/null
+++ b/tests/functional/visibility_reapprove_test.php
@@ -0,0 +1,416 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2014 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_visibility_reapprove_test extends phpbb_functional_test_case
+{
+ protected $data = array();
+
+ public function test_setup_forums()
+ {
+ $this->login();
+ $this->admin_login();
+
+ $crawler = self::request('GET', "adm/index.php?i=acp_forums&mode=manage&sid={$this->sid}");
+ $form = $crawler->selectButton('addforum')->form(array(
+ 'forum_name' => 'Reapprove Test #1',
+ ));
+ $crawler = self::submit($form);
+ $form = $crawler->selectButton('update')->form(array(
+ 'forum_perm_from' => 2,
+ ));
+ $crawler = self::submit($form);
+
+ // Set flood interval to 0
+ $this->set_flood_interval(0);
+ }
+
+ public function test_create_posts()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Reapprove Test #1',
+ ),
+ ));
+
+ $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 0,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => 0,
+ ), 'initial comparison');
+
+ // Test creating topic #1
+ $post = $this->create_topic($this->data['forums']['Reapprove Test #1'], 'Reapprove Test Topic #1', 'This is a test topic posted by the testing framework.');
+ $crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
+
+ $this->assertContains('Reapprove Test Topic #1', $crawler->filter('h2')->text());
+ $this->data['topics']['Reapprove Test Topic #1'] = (int) $post['topic_id'];
+ $this->data['posts']['Reapprove Test Topic #1'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p');
+
+ $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Reapprove Test Topic #1'],
+ ), 'after creating topic #1');
+
+ $this->logout();
+ $this->create_user('reapprove_testuser');
+ $this->add_user_group('NEWLY_REGISTERED', array('reapprove_testuser'));
+ $this->login('reapprove_testuser');
+
+ // Test creating a reply
+ $post2 = $this->create_post($this->data['forums']['Reapprove Test #1'], $post['topic_id'], 'Re: Reapprove Test Topic #1-#2', 'This is a test post posted by the testing framework.', array(), 'POST_STORED_MOD');
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #1']}&sid={$this->sid}");
+ $this->assertNotContains('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text());
+
+ $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 1,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Reapprove Test Topic #1'],
+ ), 'after replying');
+
+ // Test creating topic #2
+ $post = $this->create_topic($this->data['forums']['Reapprove Test #1'], 'Reapprove Test Topic #2', 'This is a test topic posted by the testing framework.', array(), 'POST_STORED_MOD');
+ $crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Reapprove Test #1']}&sid={$this->sid}");
+
+ $this->assertNotContains('Reapprove Test Topic #2', $crawler->filter('html')->text());
+
+ $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 2,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 1,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Reapprove Test Topic #1'],
+ ), 'after creating topic #2');
+
+ $this->logout();
+ }
+
+ public function test_approve_post()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Reapprove Test #1',
+ ),
+ 'topics' => array(
+ 'Reapprove Test Topic #1',
+ 'Reapprove Test Topic #2',
+ ),
+ 'posts' => array(
+ 'Reapprove Test Topic #1',
+ 'Re: Reapprove Test Topic #1-#2',
+ 'Reapprove Test Topic #2',
+ ),
+ ));
+
+ $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 2,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 1,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Reapprove Test Topic #1'],
+ ), 'before approving post');
+
+ $this->add_lang('posting');
+ $this->add_lang('viewtopic');
+ $this->add_lang('mcp');
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #1']}&sid={$this->sid}");
+ $this->assertContains('Reapprove Test Topic #1', $crawler->filter('h2')->text());
+ $this->assertContains('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text());
+
+ $form = $crawler->selectButton($this->lang('APPROVE'))->form();
+ $crawler = self::submit($form);
+ $form = $crawler->selectButton($this->lang('YES'))->form();
+ $crawler = self::submit($form);
+ $this->assertContainsLang('POST_APPROVED_SUCCESS', $crawler->text());
+
+ $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
+ 'forum_posts_approved' => 2,
+ 'forum_posts_unapproved' => 1,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 1,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Re: Reapprove Test Topic #1-#2'],
+ ), 'after approving post');
+
+ $link = $crawler->selectLink($this->lang('RETURN_PAGE', '', ''))->link();
+ $link_url = $link->getUri();
+ $this->assertContains('viewtopic.php?f=' . $this->data['forums']['Reapprove Test #1'] . '&t=' . $this->data['topics']['Reapprove Test Topic #1'], $link_url);
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #1']}&sid={$this->sid}");
+ $this->assertContains('Reapprove Test Topic #1', $crawler->filter('h2')->text());
+ $this->assertContains('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text());
+ }
+
+ public function test_approve_topic()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Reapprove Test #1',
+ ),
+ 'topics' => array(
+ 'Reapprove Test Topic #1',
+ 'Reapprove Test Topic #2',
+ ),
+ 'posts' => array(
+ 'Reapprove Test Topic #1',
+ 'Re: Reapprove Test Topic #1-#2',
+ 'Reapprove Test Topic #2',
+ ),
+ ));
+
+ $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
+ 'forum_posts_approved' => 2,
+ 'forum_posts_unapproved' => 1,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 1,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Re: Reapprove Test Topic #1-#2'],
+ ), 'before approving topic');
+
+ $this->add_lang('posting');
+ $this->add_lang('viewtopic');
+ $this->add_lang('mcp');
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #2']}&sid={$this->sid}");
+ $this->assertContains('Reapprove Test Topic #2', $crawler->filter('h2')->text());
+
+ $form = $crawler->selectButton($this->lang('APPROVE'))->form();
+ $crawler = self::submit($form);
+ $form = $crawler->selectButton($this->lang('YES'))->form();
+ $crawler = self::submit($form);
+ //@todo $this->assertContainsLang('TOPIC_APPROVED_SUCCESS', $crawler->text());
+ $this->assertContainsLang('POST_APPROVED_SUCCESS', $crawler->text());
+
+ $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
+ 'forum_posts_approved' => 3,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 2,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Reapprove Test Topic #2'],
+ ), 'after approving topic');
+
+ $link = $crawler->selectLink($this->lang('RETURN_PAGE', '', ''))->link();
+ $link_url = $link->getUri();
+ $this->assertContains('viewtopic.php?f=' . $this->data['topic']['Reapprove Test Topic #2'], $link_url);
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #2']}&sid={$this->sid}");
+ $this->assertContains('Reapprove Test Topic #2', $crawler->filter('h2')->text());
+ }
+
+ public function test_edit_posts()
+ {
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Reapprove Test #1',
+ ),
+ 'topics' => array(
+ 'Reapprove Test Topic #1',
+ 'Reapprove Test Topic #2',
+ ),
+ 'posts' => array(
+ 'Reapprove Test Topic #1',
+ 'Re: Reapprove Test Topic #1-#2',
+ 'Reapprove Test Topic #2',
+ ),
+ ));
+ $this->add_lang('posting');
+
+ $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
+ 'forum_posts_approved' => 3,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 2,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Reapprove Test Topic #2'],
+ ), 'before editing post');
+
+ $this->login('reapprove_testuser');
+ $this->add_user_group('NEWLY_REGISTERED', array('reapprove_testuser'));
+
+ // Test editing a post
+ $posting_url = "posting.php?mode=edit&f={$this->data['forums']['Reapprove Test #1']}&p={$this->data['posts']['Re: Reapprove Test Topic #1-#2']}&sid={$this->sid}";
+ $form_data = array(
+ 'message' => 'Post edited by testing framework',
+ 'subject' => 'Re: Reapprove Test Topic #1-#2',
+ 'post' => true,
+ );
+ $this->submit_post($posting_url, 'EDIT_POST', $form_data, 'POST_EDITED_MOD');
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #1']}&sid={$this->sid}");
+ $this->assertNotContains('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text());
+ $this->assertNotContains('Post edited by testing framework', $crawler->filter('#page-body')->text());
+
+ $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
+ 'forum_posts_approved' => 2,
+ 'forum_posts_unapproved' => 1,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 2,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Reapprove Test Topic #2'],
+ ), 'after editing post');
+
+ // Test editing a topic
+ $posting_url = "posting.php?mode=edit&f={$this->data['forums']['Reapprove Test #1']}&p={$this->data['posts']['Reapprove Test Topic #2']}&sid={$this->sid}";
+ $form_data = array(
+ 'message' => 'Post edited by testing framework',
+ 'subject' => 'Reapprove Test Topic #2',
+ 'post' => true,
+ );
+ $this->submit_post($posting_url, 'EDIT_POST', $form_data, 'POST_EDITED_MOD');
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #2']}&sid={$this->sid}", array(), false);
+ self::assert_response_html(404);
+ $this->assertNotContains('Reapprove Test Topic #2', $crawler->filter('#page-body')->text());
+ $this->assertNotContains('Post edited by testing framework', $crawler->filter('#page-body')->text());
+
+ $this->assert_forum_details($this->data['forums']['Reapprove Test #1'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 2,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 1,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => $this->data['posts']['Reapprove Test Topic #1'],
+ ), 'after editing topic');
+
+ $this->logout();
+ $this->login();
+
+ $crawler = self::request('GET', "viewtopic.php?t={$this->data['topics']['Reapprove Test Topic #1']}&sid={$this->sid}");
+ $this->assertContains('Re: Reapprove Test Topic #1-#2', $crawler->filter('#page-body')->text());
+ $this->assertContains('Post edited by testing framework', $crawler->filter('#page-body')->text());
+ }
+
+ public function test_approve_post_again()
+ {
+ $this->test_approve_post();
+ }
+
+ public function test_approve_topic_again()
+ {
+ $this->test_approve_topic();
+ }
+
+ public function test_reset_flood_interval()
+ {
+ $this->login();
+ $this->admin_login();
+
+ // Set flood interval back to 15
+ $this->set_flood_interval(15);
+ }
+
+ protected function assert_forum_details($forum_id, $details, $additional_error_message = '')
+ {
+ $this->db = $this->get_db();
+
+ $sql = 'SELECT ' . implode(', ', array_keys($details)) . '
+ FROM phpbb_forums
+ WHERE forum_id = ' . (int) $forum_id;
+ $result = $this->db->sql_query($sql);
+ $data = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $this->assertEquals($details, $data, "Forum {$forum_id} does not match expected {$additional_error_message}");
+ }
+
+ protected function set_flood_interval($flood_interval)
+ {
+ $crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_board&mode=post');
+
+ $form = $crawler->selectButton('Submit')->form();
+ $values = $form->getValues();
+
+ $values["config[flood_interval]"] = $flood_interval;
+ $form->setValues($values);
+ $crawler = self::submit($form);
+ $this->assertGreaterThan(0, $crawler->filter('.successbox')->count());
+ }
+
+ protected function load_ids($data)
+ {
+ $this->db = $this->get_db();
+
+ if (!empty($data['forums']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_forums
+ WHERE ' . $this->db->sql_in_set('forum_name', $data['forums']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['forum_name'], $data['forums']))
+ {
+ $this->data['forums'][$row['forum_name']] = (int) $row['forum_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ if (!empty($data['topics']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_topics
+ WHERE ' . $this->db->sql_in_set('topic_title', $data['topics']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['topic_title'], $data['topics']))
+ {
+ $this->data['topics'][$row['topic_title']] = (int) $row['topic_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ if (!empty($data['posts']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_posts
+ WHERE ' . $this->db->sql_in_set('post_subject', $data['posts']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['post_subject'], $data['posts']))
+ {
+ $this->data['posts'][$row['post_subject']] = (int) $row['post_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+ }
+}
diff --git a/tests/functional/softdelete_test.php b/tests/functional/visibility_softdelete_test.php
index 1c86d00b9b..f8ada9687c 100644
--- a/tests/functional/softdelete_test.php
+++ b/tests/functional/visibility_softdelete_test.php
@@ -10,7 +10,7 @@
/**
* @group functional
*/
-class phpbb_functional_softdelete_test extends phpbb_functional_test_case
+class phpbb_functional_visibility_softdelete_test extends phpbb_functional_test_case
{
protected $data = array();
diff --git a/tests/functions/validate_with_method_test.php b/tests/functions/validate_with_method_test.php
new file mode 100644
index 0000000000..86d7b9571c
--- /dev/null
+++ b/tests/functions/validate_with_method_test.php
@@ -0,0 +1,39 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2014 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
+require_once dirname(__FILE__) . '/validate_data_helper.php';
+
+class phpbb_functions_validate_with_method_test extends phpbb_test_case
+{
+ protected $helper;
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ $this->helper = new phpbb_functions_validate_data_helper($this);
+ }
+
+ public function test_validate_date()
+ {
+ $this->helper->assert_valid_data(array(
+ 'method_call' => array(
+ array(),
+ true,
+ array(array(array($this, 'with_method'), false)),
+ ),
+ ));
+ }
+
+ public function validate_with_method($bool, $optional = false)
+ {
+ return ! $bool;
+ }
+}
diff --git a/tests/functions_content/phpbb_clean_search_string_test.php b/tests/functions_content/phpbb_clean_search_string_test.php
new file mode 100644
index 0000000000..de642c9040
--- /dev/null
+++ b/tests/functions_content/phpbb_clean_search_string_test.php
@@ -0,0 +1,38 @@
+<?php
+/**
+*
+* @package testing
+* @copyright (c) 2014 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
+
+class phpbb_functions_content_phpbb_clean_search_string_test extends phpbb_test_case
+{
+ public function phpbb_clean_search_string_data()
+ {
+ return array(
+ array('*', ''),
+ array('* *', ''),
+ array('test', 'test'),
+ array(' test ', 'test'),
+ array(' test * ', 'test'),
+ array('test* *', 'test*'),
+ array('* *test*', '*test*'),
+ array('test test * test', 'test test test'),
+ array(' some wild*cards * between wo*rds ', 'some wild*cards between wo*rds'),
+ array(' we * now have*** multiple wild***cards * ', 'we now have* multiple wild*cards'),
+ array('pi is *** . * **** * *****', 'pi is .'),
+ );
+ }
+
+ /**
+ * @dataProvider phpbb_clean_search_string_data
+ */
+ public function test_phpbb_clean_search_string($search_string, $expected)
+ {
+ $this->assertEquals($expected, phpbb_clean_search_string($search_string));
+ }
+}
diff --git a/tests/log/fixtures/full_log.xml b/tests/log/fixtures/full_log.xml
index a10c224e0e..ef35884444 100644
--- a/tests/log/fixtures/full_log.xml
+++ b/tests/log/fixtures/full_log.xml
@@ -119,6 +119,30 @@
<value>LOG_USER</value>
<value>a:1:{i:0;s:5:"guest";}</value>
</row>
+ <row>
+ <value>10</value>
+ <value>3</value>
+ <value>1</value>
+ <value>0</value>
+ <value>0</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_SINGULAR_PLURAL</value>
+ <value>a:1:{i:0;i:2;}</value>
+ </row>
+ <row>
+ <value>11</value>
+ <value>1</value>
+ <value>1</value>
+ <value>15</value>
+ <value>3</value>
+ <value>0</value>
+ <value>127.0.0.1</value>
+ <value>1</value>
+ <value>LOG_MOD3</value>
+ <value>a:1:{i:0;s:5:"guest";}</value>
+ </row>
</table>
<table name="phpbb_users">
<column>user_id</column>
diff --git a/tests/log/function_view_log_test.php b/tests/log/function_view_log_test.php
index 2ddf7522f4..542d0adf9d 100644
--- a/tests/log/function_view_log_test.php
+++ b/tests/log/function_view_log_test.php
@@ -206,6 +206,46 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
'viewforum' => '',
'action' => 'LOG_USER guest',
),
+ 10 => array(
+ 'id' => 10,
+
+ 'reportee_id' => 0,
+ 'reportee_username' => '',
+ 'reportee_username_full'=> '',
+
+ 'user_id' => 1,
+ 'username' => 'Anonymous',
+ 'username_full' => 'Anonymous',
+
+ 'ip' => '127.0.0.1',
+ 'time' => 1,
+ 'forum_id' => 0,
+ 'topic_id' => 0,
+
+ 'viewforum' => '',
+ 'action' => 'LOG_SINGULAR_PLURAL 2',
+ ),
+ 11 => array(
+ 'id' => 11,
+
+ 'reportee_id' => 0,
+ 'reportee_username' => '',
+ 'reportee_username_full'=> '',
+
+ 'user_id' => 1,
+ 'username' => 'Anonymous',
+ 'username_full' => 'Anonymous',
+
+ 'ip' => '127.0.0.1',
+ 'time' => 1,
+ 'forum_id' => 15,
+ 'topic_id' => 3,
+
+ 'viewforum' => '',
+ 'action' => 'LOG_MOD3 guest ',
+ 'viewtopic' => '',
+ 'viewlogs' => '',
+ ),
);
$test_cases = array(
@@ -277,10 +317,25 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
'user', 0, 5, 0, 0, 0, 2,
),
array(
- 'expected' => array(8, 9),
+ 'expected' => array(8, 9, 10),
'expected_returned' => 0,
'users', 0,
),
+ array(
+ 'expected' => array(1),
+ 'expected_returned' => 0,
+ 'admin', false, 5, 0, 0, 0, 0, 0, 'l.log_id ASC', 'install',
+ ),
+ array(
+ 'expected' => array(10),
+ 'expected_returned' => 0,
+ 'user', false, 5, 0, 0, 0, 0, 0, 'l.log_id ASC', 'plural',
+ ),
+ array(
+ 'expected' => array(11),
+ 'expected_returned' => 0,
+ 'mod', 0, 5, 0, 15, 3,
+ ),
);
foreach ($test_cases as $case => $case_data)
@@ -333,6 +388,11 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
'LOG_INSTALL_INSTALLED' => 'installed: %s',
'LOG_USER' => 'User<br /> %s',
'LOG_MOD2' => 'Mod2',
+ 'LOG_MOD3' => 'Mod3: %1$s, %2$s',
+ 'LOG_SINGULAR_PLURAL' => array(
+ 1 => 'singular',
+ 2 => 'plural (%d)',
+ ),
);
$phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
diff --git a/tests/notification/submit_post_type_quote_test.php b/tests/notification/submit_post_type_quote_test.php
index a849cb7b1b..9956f3b58e 100644
--- a/tests/notification/submit_post_type_quote_test.php
+++ b/tests/notification/submit_post_type_quote_test.php
@@ -55,7 +55,7 @@ class phpbb_notification_submit_post_type_quote_test extends phpbb_notification_
* 2 => Poster, should NOT receive a notification
* 3 => Quoted, should receive a notification
* 4 => Quoted, but unauthed to read, should NOT receive a notification
- * 5 => Quoted, but already notified, should NOT receive a new notification
+ * 5 => Quoted, but already notified, should STILL receive a new notification
* 6 => Quoted, but option disabled, should NOT receive a notification
* 7 => Quoted, option set to default, should receive a notification
*/
@@ -78,6 +78,7 @@ class phpbb_notification_submit_post_type_quote_test extends phpbb_notification_
array(
array('user_id' => 3, 'item_id' => 2, 'item_parent_id' => 1),
array('user_id' => 5, 'item_id' => 1, 'item_parent_id' => 1),
+ array('user_id' => 5, 'item_id' => 2, 'item_parent_id' => 1),
array('user_id' => 7, 'item_id' => 2, 'item_parent_id' => 1),
),
),
diff --git a/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_subloop.html b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_subloop.html
new file mode 100644
index 0000000000..4fdba859f3
--- /dev/null
+++ b/tests/template/datasets/ext_trivial/ext/trivial/styles/all/template/event/test_event_subloop.html
@@ -0,0 +1,2 @@
+[{event_loop.S_ROW_COUNT}<!-- BEGIN subloop -->[subloop:{event_loop.subloop.S_ROW_COUNT}]
+<!-- END subloop -->]
diff --git a/tests/template/datasets/ext_trivial/styles/silver/template/event_subloop.html b/tests/template/datasets/ext_trivial/styles/silver/template/event_subloop.html
new file mode 100644
index 0000000000..233b32a4c7
--- /dev/null
+++ b/tests/template/datasets/ext_trivial/styles/silver/template/event_subloop.html
@@ -0,0 +1,3 @@
+<!-- BEGIN event_loop -->
+event_loop<!-- EVENT test_event_subloop -->
+<!-- END event_loop -->
diff --git a/tests/template/template_events_test.php b/tests/template/template_events_test.php
index 41e00e86a7..d09f22944f 100644
--- a/tests/template/template_events_test.php
+++ b/tests/template/template_events_test.php
@@ -90,14 +90,33 @@ Zeta test event in all',
array(),
'event_loop0|event_loop1|event_loop2',
),
+ array(
+ 'EVENT with subloop in loop',
+ 'ext_trivial',
+ array('silver'),
+ 'event_subloop.html',
+ array(),
+ array(
+ 'event_loop' => array(array()),
+ 'event_loop.subloop' => array(array()),
+ ),
+ array(),
+ 'event_loop[0[subloop:0]]',
+ 'Event files are missing opened parent loops: PHPBB3-12382',
+ ),
);
}
/**
* @dataProvider template_data
*/
- public function test_event($desc, $dataset, $style_names, $file, array $vars, array $block_vars, array $destroy, $expected)
+ public function test_event($desc, $dataset, $style_names, $file, array $vars, array $block_vars, array $destroy, $expected, $incomplete_message = '')
{
+ if ($incomplete_message)
+ {
+ $this->markTestIncomplete($incomplete_message);
+ }
+
// Reset the engine state
$this->setup_engine_for_events($dataset, $style_names);
diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index 74baa3d5b6..49804c26c5 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -320,6 +320,18 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
array(),
"barbarbar1bar1",
),
+ array(
+ 'loop_nested_include.html',
+ array(),
+ array(
+ 'test_loop' => array(array('foo' => 'bar'), array('foo' => 'bar1')),
+ 'test_loop.inner' => array(array('myinner' => 'works')),
+ ),
+ array(),
+ "[bar|[bar|]][bar1|[bar1|[bar1|works]]]",
+ array(),
+ 'Included files are missing opened parent loops: PHPBB3-12382',
+ ),
/* Does not pass with the current implementation.
array(
'loop_reuse.html',
@@ -363,8 +375,13 @@ class phpbb_template_template_test extends phpbb_template_template_test_case
/**
* @dataProvider template_data
*/
- public function test_template($file, array $vars, array $block_vars, array $destroy, $expected, $lang_vars = array())
+ public function test_template($file, array $vars, array $block_vars, array $destroy, $expected, $lang_vars = array(), $incomplete_message = '')
{
+ if ($incomplete_message)
+ {
+ $this->markTestIncomplete($incomplete_message);
+ }
+
$this->run_template($file, $vars, $block_vars, $destroy, $expected, $lang_vars);
}
diff --git a/tests/template/templates/loop_nested_include.html b/tests/template/templates/loop_nested_include.html
new file mode 100644
index 0000000000..eaad46cc5b
--- /dev/null
+++ b/tests/template/templates/loop_nested_include.html
@@ -0,0 +1,4 @@
+<!-- BEGIN test_loop -->
+[{test_loop.foo}
+ |<!-- INCLUDE loop_nested_include1.html -->]
+<!-- END test_loop -->
diff --git a/tests/template/templates/loop_nested_include1.html b/tests/template/templates/loop_nested_include1.html
new file mode 100644
index 0000000000..0f1a180b4d
--- /dev/null
+++ b/tests/template/templates/loop_nested_include1.html
@@ -0,0 +1,5 @@
+[{test_loop.foo}|
+<!-- BEGIN inner -->
+[{test_loop.foo}|
+{test_loop.inner.myinner}]
+<!-- END inner -->]
diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php
index f6429b1ccb..887dad5b50 100644
--- a/tests/test_framework/phpbb_database_test_connection_manager.php
+++ b/tests/test_framework/phpbb_database_test_connection_manager.php
@@ -12,8 +12,11 @@ require_once dirname(__FILE__) . '/phpbb_database_connection_odbc_pdo_wrapper.ph
class phpbb_database_test_connection_manager
{
+ /** @var array */
private $config;
+ /** @var array */
private $dbms;
+ /** @var \PDO */
private $pdo;
/**
@@ -363,9 +366,21 @@ class phpbb_database_test_connection_manager
$table_name,
$table_data
);
+
foreach ($queries as $query)
{
- $this->pdo->exec($query);
+ if ($query === 'begin')
+ {
+ $this->pdo->beginTransaction();
+ }
+ else if ($query === 'commit')
+ {
+ $this->pdo->commit();
+ }
+ else
+ {
+ $this->pdo->exec($query);
+ }
}
}
}
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index 1f372fff0c..3759097319 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -422,7 +422,7 @@ class phpbb_functional_test_case extends phpbb_test_case
}
else
{
- $db->sql_multi_insert(STYLES_TABLE, array(
+ $db->sql_multi_insert(STYLES_TABLE, array(array(
'style_id' => $style_id,
'style_name' => $style_path,
'style_copyright' => '',
@@ -431,7 +431,7 @@ class phpbb_functional_test_case extends phpbb_test_case
'bbcode_bitfield' => 'kNg=',
'style_parent_id' => $parent_style_id,
'style_parent_tree' => $parent_style_path,
- ));
+ )));
}
}
@@ -522,8 +522,8 @@ class phpbb_functional_test_case extends phpbb_test_case
'user_email' => 'nobody@example.com',
'user_type' => 0,
'user_lang' => 'en',
- 'user_timezone' => 0,
- 'user_dateformat' => '',
+ 'user_timezone' => 'UTC',
+ 'user_dateformat' => 'r',
'user_password' => $passwords_manager->hash($username . $username),
);
return user_add($user_row);