aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTING.md2
-rw-r--r--README.md12
-rw-r--r--build/build.xml22
-rw-r--r--build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php93
-rwxr-xr-xcomposer.pharbin1201432 -> 1585196 bytes
-rw-r--r--phpBB/adm/style/acp_attachments.html4
-rw-r--r--phpBB/adm/style/acp_avatar_options_gravatar.html4
-rw-r--r--phpBB/adm/style/acp_avatar_options_remote.html4
-rw-r--r--phpBB/adm/style/acp_captcha.html4
-rw-r--r--phpBB/adm/style/acp_forums.html12
-rw-r--r--phpBB/adm/style/acp_groups.html4
-rw-r--r--phpBB/adm/style/acp_icons.html8
-rw-r--r--phpBB/adm/style/acp_inactive.html2
-rw-r--r--phpBB/adm/style/acp_jabber.html4
-rw-r--r--phpBB/adm/style/acp_ranks.html2
-rw-r--r--phpBB/adm/style/acp_search.html10
-rw-r--r--phpBB/adm/style/installer_header.html1
-rw-r--r--phpBB/adm/style/overall_header.html1
-rw-r--r--phpBB/adm/style/simple_header.html1
-rw-r--r--phpBB/assets/javascript/core.js7
-rw-r--r--phpBB/assets/javascript/editor.js6
-rwxr-xr-xphpBB/bin/phpbbcli.php2
-rw-r--r--phpBB/common.php10
-rw-r--r--phpBB/composer.json6
-rw-r--r--phpBB/composer.lock554
-rw-r--r--phpBB/config/default/container/services.yml2
-rw-r--r--phpBB/config/default/container/services_attachment.yml8
-rw-r--r--phpBB/config/default/container/services_captcha.yml12
-rw-r--r--phpBB/config/default/container/services_console.yml50
-rw-r--r--phpBB/config/default/container/services_cron.yml1
-rw-r--r--phpBB/config/default/container/services_db.yml14
-rw-r--r--phpBB/config/default/container/services_feed.yml14
-rw-r--r--phpBB/config/default/container/services_files.yml10
-rw-r--r--phpBB/config/default/container/services_notification.yml46
-rw-r--r--phpBB/config/default/container/services_report.yml6
-rw-r--r--phpBB/config/default/container/services_routing.yml3
-rw-r--r--phpBB/config/default/container/services_text_formatter.yml2
-rw-r--r--phpBB/config/default/container/services_twig.yml6
-rw-r--r--phpBB/config/installer/container/services.yml5
-rw-r--r--phpBB/config/installer/container/services_install_navigation.yml8
-rw-r--r--phpBB/docs/CHANGELOG.html64
-rw-r--r--phpBB/docs/FAQ.html1
-rw-r--r--phpBB/docs/INSTALL.html1
-rw-r--r--phpBB/docs/README.html7
-rw-r--r--phpBB/docs/auth_api.html1
-rw-r--r--phpBB/docs/coding-guidelines.html1
-rw-r--r--phpBB/docs/nginx.sample.conf25
-rw-r--r--phpBB/includes/acp/acp_attachments.php6
-rw-r--r--phpBB/includes/acp/acp_board.php4
-rw-r--r--phpBB/includes/acp/acp_forums.php2
-rw-r--r--phpBB/includes/acp/acp_groups.php13
-rw-r--r--phpBB/includes/acp/acp_users.php17
-rw-r--r--phpBB/includes/bbcode.php36
-rw-r--r--phpBB/includes/compatibility_globals.php2
-rw-r--r--phpBB/includes/constants.php18
-rw-r--r--phpBB/includes/functions.php63
-rw-r--r--phpBB/includes/functions_acp.php33
-rw-r--r--phpBB/includes/functions_admin.php4
-rw-r--r--phpBB/includes/functions_content.php32
-rw-r--r--phpBB/includes/functions_convert.php16
-rw-r--r--phpBB/includes/functions_display.php2
-rw-r--r--phpBB/includes/functions_download.php3
-rw-r--r--phpBB/includes/functions_messenger.php5
-rw-r--r--phpBB/includes/functions_posting.php8
-rw-r--r--phpBB/includes/mcp/mcp_warn.php24
-rw-r--r--phpBB/includes/message_parser.php26
-rw-r--r--phpBB/includes/ucp/ucp_groups.php13
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php2
-rw-r--r--phpBB/includes/ucp/ucp_profile.php12
-rw-r--r--phpBB/install/convert/convertor.php4
-rw-r--r--phpBB/install/convertors/convert_phpbb20.php2
-rwxr-xr-xphpBB/install/phpbbcli.php2
-rw-r--r--phpBB/install/schemas/schema_data.sql2
-rw-r--r--phpBB/language/en/acp/common.php11
-rw-r--r--phpBB/language/en/captcha_qa.php2
-rw-r--r--phpBB/language/en/cli.php30
-rw-r--r--phpBB/language/en/common.php4
-rw-r--r--phpBB/language/en/install.php24
-rw-r--r--phpBB/language/en/ucp.php2
-rw-r--r--phpBB/memberlist.php16
-rw-r--r--phpBB/phpbb/attachment/delete.php2
-rw-r--r--phpBB/phpbb/attachment/upload.php2
-rw-r--r--phpBB/phpbb/auth/provider/oauth/oauth.php8
-rw-r--r--phpBB/phpbb/avatar/driver/upload.php14
-rw-r--r--phpBB/phpbb/cache/driver/file.php4
-rw-r--r--phpBB/phpbb/cache/driver/memory.php4
-rw-r--r--phpBB/phpbb/captcha/plugins/qa.php34
-rw-r--r--phpBB/phpbb/composer.json2
-rw-r--r--phpBB/phpbb/console/command/command.php45
-rw-r--r--phpBB/phpbb/console/command/reparser/reparse.php40
-rw-r--r--phpBB/phpbb/console/command/thumbnail/delete.php27
-rw-r--r--phpBB/phpbb/console/command/thumbnail/generate.php27
-rw-r--r--phpBB/phpbb/console/command/user/activate.php218
-rw-r--r--phpBB/phpbb/console/command/user/add.php334
-rw-r--r--phpBB/phpbb/console/command/user/delete.php170
-rw-r--r--phpBB/phpbb/console/command/user/reclean.php158
-rw-r--r--phpBB/phpbb/controller/helper.php27
-rw-r--r--phpBB/phpbb/controller/resolver.php18
-rw-r--r--phpBB/phpbb/cron/task/core/queue.php19
-rw-r--r--phpBB/phpbb/db/driver/driver.php1
-rw-r--r--phpBB/phpbb/db/migration/data/v310/alpha1.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v310/alpha2.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v310/alpha3.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v310/beta1.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v310/beta2.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v310/beta3.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v310/beta4.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v310/gold.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php13
-rw-r--r--phpBB/phpbb/db/migration/data/v310/rc1.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v310/rc2.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v310/rc3.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v310/rc4.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v310/rc5.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v310/rc6.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v311.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v312.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v312rc1.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v313.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v313rc1.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v313rc2.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v314.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v314rc1.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v314rc2.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v315.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v315rc1.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v316.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v316rc1.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v317.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v317pl1.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v317rc1.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v318.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v318rc1.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v319.php36
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v319rc1.php36
-rw-r--r--phpBB/phpbb/db/migration/data/v320/notifications_board.php2
-rw-r--r--phpBB/phpbb/db/tools/mssql.php2
-rw-r--r--phpBB/phpbb/di/container_builder.php25
-rw-r--r--phpBB/phpbb/di/extension/core.php8
-rw-r--r--phpBB/phpbb/install/helper/container_factory.php3
-rw-r--r--phpBB/phpbb/install/module/install_database/task/add_config_settings.php9
-rw-r--r--phpBB/phpbb/install/module/requirements/task/check_filesystem.php8
-rw-r--r--phpBB/phpbb/install/module/update_database/task/update.php3
-rw-r--r--phpBB/phpbb/install/module/update_filesystem/task/file_check.php1
-rw-r--r--phpBB/phpbb/install/module/update_filesystem/task/show_file_status.php21
-rw-r--r--phpBB/phpbb/install/module_base.php2
-rw-r--r--phpBB/phpbb/module/module_manager.php2
-rw-r--r--phpBB/phpbb/notification/manager.php4
-rw-r--r--phpBB/phpbb/notification/method/messenger_base.php2
-rw-r--r--phpBB/phpbb/notification/type/quote.php4
-rw-r--r--phpBB/phpbb/profilefields/type/type_int.php6
-rw-r--r--phpBB/phpbb/profilefields/type/type_string.php6
-rw-r--r--phpBB/phpbb/profilefields/type/type_text.php6
-rw-r--r--phpBB/phpbb/profilefields/type/type_url.php6
-rw-r--r--phpBB/phpbb/recursive_dot_prefix_filter_iterator.php2
-rw-r--r--phpBB/phpbb/request/request.php4
-rw-r--r--phpBB/phpbb/routing/helper.php11
-rw-r--r--phpBB/phpbb/routing/router.php31
-rw-r--r--phpBB/phpbb/search/fulltext_native.php6
-rw-r--r--phpBB/phpbb/search/fulltext_postgres.php4
-rw-r--r--phpBB/phpbb/search/fulltext_sphinx.php4
-rw-r--r--phpBB/phpbb/template/twig/environment.php21
-rw-r--r--phpBB/phpbb/textreparser/base.php3
-rw-r--r--phpBB/phpbb/user.php2
-rw-r--r--phpBB/posting.php7
-rw-r--r--phpBB/styles/prosilver/style.cfg4
-rw-r--r--phpBB/styles/prosilver/template/mcp_topic.html4
-rw-r--r--phpBB/styles/prosilver/template/navbar_header.html4
-rw-r--r--phpBB/styles/prosilver/template/overall_header.html1
-rw-r--r--phpBB/styles/prosilver/template/pagination.html2
-rw-r--r--phpBB/styles/prosilver/template/posting_editor.html2
-rw-r--r--phpBB/styles/prosilver/template/posting_poll_body.html4
-rw-r--r--phpBB/styles/prosilver/template/simple_header.html1
-rw-r--r--phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html4
-rw-r--r--phpBB/styles/prosilver/template/ucp_avatar_options_remote.html4
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html1
-rw-r--r--phpBB/styles/prosilver/template/viewtopic_print.html1
-rw-r--r--phpBB/viewforum.php55
-rw-r--r--phpBB/viewtopic.php30
-rw-r--r--phpBB/web.config7
-rw-r--r--tests/attachment/upload_test.php1
-rw-r--r--tests/auth/provider_apache_test.php3
-rw-r--r--tests/auth/provider_db_test.php3
-rw-r--r--tests/bbcode/parser_test.php2
-rw-r--r--tests/bbcode/url_bbcode_test.php2
-rw-r--r--tests/bootstrap.php5
-rw-r--r--tests/captcha/qa_test.php2
-rw-r--r--tests/compress/compress_test.php1
-rw-r--r--tests/console/cron/run_test.php1
-rw-r--r--tests/console/thumbnail_test.php3
-rw-r--r--tests/console/user/activate_test.php86
-rw-r--r--tests/console/user/add_test.php92
-rw-r--r--tests/console/user/base.php121
-rw-r--r--tests/console/user/delete_test.php93
-rw-r--r--tests/console/user/fixtures/config.xml63
-rw-r--r--tests/console/user/reclean_test.php49
-rw-r--r--tests/content_visibility/delete_post_test.php3
-rw-r--r--tests/content_visibility/set_post_visibility_test.php3
-rw-r--r--tests/content_visibility/set_topic_visibility_test.php3
-rw-r--r--tests/controller/common_helper_route.php73
-rw-r--r--tests/controller/controller_test.php60
-rw-r--r--tests/controller/ext/vendor2/foo/controller.php17
-rw-r--r--tests/controller/helper_route_adm_subdir_test.php1
-rw-r--r--tests/controller/helper_route_adm_test.php1
-rw-r--r--tests/controller/helper_route_root_test.php1
-rw-r--r--tests/controller/helper_route_slash_test.php1
-rw-r--r--tests/controller/helper_route_unclean_path_test.php1
-rw-r--r--tests/dbal/auto_increment_test.php2
-rw-r--r--tests/dbal/boolean_processor_test.php3
-rw-r--r--tests/dbal/connect_test.php2
-rw-r--r--tests/dbal/cross_join_test.php3
-rw-r--r--tests/dbal/db_tools_test.php2
-rw-r--r--tests/dbal/migrator_test.php1
-rw-r--r--tests/dbal/migrator_tool_module_test.php2
-rw-r--r--tests/dbal/migrator_tool_permission_test.php2
-rw-r--r--tests/dbal/schema_test.php2
-rw-r--r--tests/dbal/select_test.php3
-rw-r--r--tests/dbal/write_sequence_test.php2
-rw-r--r--tests/dbal/write_test.php2
-rw-r--r--tests/di/create_container_test.php1
-rw-r--r--tests/error_collector_test.php2
-rw-r--r--tests/event/exception_listener_test.php2
-rw-r--r--tests/event/md_exporter_test.php2
-rw-r--r--tests/extension/extension_base_test.php1
-rw-r--r--tests/extension/finder_test.php1
-rw-r--r--tests/extension/metadata_manager_test.php3
-rw-r--r--tests/files/types_form_test.php2
-rw-r--r--tests/files/types_local_test.php2
-rw-r--r--tests/files/types_remote_test.php1
-rw-r--r--tests/functional/download_test.php3
-rw-r--r--tests/functional/feed_test.php2
-rw-r--r--tests/functional/notification_test.php2
-rw-r--r--tests/functional/permission_roles_test.php2
-rw-r--r--tests/functional/visit_installer_test.php30
-rw-r--r--tests/functions/build_hidden_fields_for_query_params_test.php2
-rw-r--r--tests/functions/build_url_test.php2
-rw-r--r--tests/functions/convert_30_dbms_to_31_test.php2
-rw-r--r--tests/functions/generate_string_list.php3
-rw-r--r--tests/functions/get_formatted_filesize_test.php2
-rw-r--r--tests/functions/get_preg_expression_test.php2
-rw-r--r--tests/functions/get_remote_file_test.php3
-rw-r--r--tests/functions/language_select_test.php2
-rw-r--r--tests/functions/make_clickable_email_test.php3
-rw-r--r--tests/functions/make_clickable_test.php3
-rw-r--r--tests/functions/obtain_online_test.php3
-rw-r--r--tests/functions/parse_cfg_file_test.php2
-rw-r--r--tests/functions/quoteattr_test.php2
-rw-r--r--tests/functions/style_select_test.php2
-rw-r--r--tests/functions/user_delete_test.php1
-rw-r--r--tests/functions/validate_email_test.php1
-rw-r--r--tests/functions/validate_password_test.php1
-rw-r--r--tests/functions/validate_string_test.php1
-rw-r--r--tests/functions/validate_user_email_test.php1
-rw-r--r--tests/functions/validate_username_test.php2
-rw-r--r--tests/functions_acp/build_cfg_template_test.php8
-rw-r--r--tests/functions_acp/validate_config_vars_test.php1
-rw-r--r--tests/functions_acp/validate_range_test.php1
-rw-r--r--tests/functions_content/get_username_string_test.php3
-rw-r--r--tests/functions_content/phpbb_clean_search_string_test.php2
-rw-r--r--tests/functions_user/delete_user_test.php2
-rw-r--r--tests/functions_user/group_user_attributes_test.php2
-rw-r--r--tests/groupposition/legend_test.php1
-rw-r--r--tests/groupposition/teampage_test.php3
-rw-r--r--tests/lock/db_test.php2
-rw-r--r--tests/log/add_test.php2
-rw-r--r--tests/log/delete_test.php4
-rw-r--r--tests/log/function_add_log_test.php2
-rw-r--r--tests/log/function_view_log_test.php3
-rw-r--r--tests/mock/session_testable.php2
-rw-r--r--tests/network/checkdnsrr_test.php2
-rw-r--r--tests/network/ftp_fsock_pasv_epsv_test.php1
-rw-r--r--tests/network/inet_ntop_pton_test.php2
-rw-r--r--tests/network/ip_normalise_test.php2
-rw-r--r--tests/notification/group_request_test.php1
-rw-r--r--tests/notification/submit_post_base.php3
-rw-r--r--tests/notification/user_list_trim_test.php3
-rw-r--r--tests/pagination/pagination_test.php2
-rw-r--r--tests/profilefields/type_googleplus_test.php2
-rw-r--r--tests/profilefields/type_string_test.php4
-rw-r--r--tests/profilefields/type_url_test.php2
-rw-r--r--tests/random/gen_rand_string_test.php2
-rw-r--r--tests/regex/censor_test.php4
-rw-r--r--tests/regex/email_test.php2
-rw-r--r--tests/regex/ipv4_test.php2
-rw-r--r--tests/regex/ipv6_test.php2
-rw-r--r--tests/regex/password_complexity_test.php1
-rw-r--r--tests/regex/table_prefix_test.php2
-rw-r--r--tests/regex/url_test.php2
-rw-r--r--tests/request/request_test.php106
-rw-r--r--tests/request/request_var_test.php3
-rw-r--r--tests/request/type_cast_helper_test.php2
-rw-r--r--tests/security/extract_current_page_test.php1
-rw-r--r--tests/security/hash_test.php2
-rw-r--r--tests/security/redirect_test.php1
-rw-r--r--tests/session/append_sid_test.php2
-rw-r--r--tests/session/extract_page_test.php1
-rw-r--r--tests/session/garbage_collection_test.php1
-rw-r--r--tests/session/session_key_test.php1
-rw-r--r--tests/session/testable_factory.php3
-rw-r--r--tests/template/template_allfolder_test.php3
-rw-r--r--tests/template/template_events_test.php3
-rw-r--r--tests/template/template_includecss_test.php3
-rw-r--r--tests/template/template_parser_test.php1
-rw-r--r--tests/template/template_test.php1
-rw-r--r--tests/template/template_test_case.php5
-rw-r--r--tests/template/template_test_case_with_tree.php3
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php16
-rw-r--r--tests/test_framework/phpbb_session_test_case.php1
-rw-r--r--tests/test_framework/phpbb_ui_test_case.php13
-rw-r--r--tests/text_formatter/s9e/default_formatting_test.php2
-rw-r--r--tests/text_formatter/s9e/factory_test.php3
-rw-r--r--tests/text_formatter/s9e/parser_test.php2
-rw-r--r--tests/text_formatter/s9e/renderer_test.php2
-rw-r--r--tests/text_formatter/s9e/utils_test.php3
-rw-r--r--tests/text_processing/censor_text_test.php3
-rw-r--r--tests/text_processing/decode_message_test.php20
-rw-r--r--tests/text_processing/generate_text_for_display_test.php3
-rw-r--r--tests/text_processing/generate_text_for_edit_test.php3
-rw-r--r--tests/text_processing/generate_text_for_storage_test.php5
-rw-r--r--tests/text_processing/make_clickable_test.php3
-rw-r--r--tests/text_processing/message_parser_test.php3
-rw-r--r--tests/text_processing/smilies_test.php3
-rw-r--r--tests/text_processing/strip_bbcode_test.php3
-rw-r--r--tests/text_processing/tickets_data/PHPBB3-14260.html1
-rw-r--r--tests/text_processing/tickets_data/PHPBB3-14260.txt1
-rw-r--r--tests/text_processing/tickets_test.php4
-rw-r--r--tests/text_reparser/base_test.php69
-rw-r--r--tests/text_reparser/fixtures/base.xml19
-rw-r--r--tests/text_reparser/plugins/contact_admin_info_test.php3
-rw-r--r--tests/text_reparser/plugins/poll_option_test.php3
-rw-r--r--tests/text_reparser/plugins/test_row_based_plugin.php3
-rw-r--r--tests/tree/nestedset_forum_base.php2
-rw-r--r--tests/upload/filespec_test.php3
-rw-r--r--tests/upload/fileupload_test.php2
-rw-r--r--tests/upload/imagesize_test.php2
-rw-r--r--tests/user/user_loader_test.php2
-rw-r--r--tests/utf/utf8_clean_string_test.php2
-rw-r--r--tests/utf/utf8_wordwrap_test.php2
-rw-r--r--tests/wrapper/gmgetdate_test.php2
-rw-r--r--tests/wrapper/mt_rand_test.php2
-rw-r--r--tests/wrapper/phpbb_php_ini_test.php1
-rw-r--r--tests/wrapper/version_compare_test.php2
-rwxr-xr-xtravis/setup-phpbb.sh2
-rwxr-xr-xtravis/setup-webserver.sh22
344 files changed, 3467 insertions, 1044 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 6996ca22d3..3fceabda10 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -2,5 +2,5 @@
1. [Create an account on phpBB.com](http://www.phpbb.com/community/ucp.php?mode=register)
2. [Create a ticket (unless there already is one)](http://tracker.phpbb.com/secure/CreateIssue!default.jspa)
-3. Read our [Coding guidelines](https://wiki.phpbb.com/Coding_guidelines) and [Git Contribution Guidelines](http://wiki.phpbb.com/Git); if you're new to git, also read [the introduction guide](http://wiki.phpbb.com/display/DEV/Working+with+Git)
+3. Read our [Coding guidelines](https://wiki.phpbb.com/Coding_guidelines) and [Git Contribution Guidelines](http://wiki.phpbb.com/Git)
4. Send us a pull request
diff --git a/README.md b/README.md
index 1770a0b7c8..f465d7496e 100644
--- a/README.md
+++ b/README.md
@@ -2,34 +2,34 @@
## ABOUT
-phpBB is a free bulletin board written in PHP.
+phpBB is a free open-source bulletin board written in PHP.
## COMMUNITY
-Find support and lots more on [phpBB.com](http://www.phpbb.com)! Discuss the development on [area51](http://area51.phpbb.com/phpBB/index.php).
+Get your copy of phpBB, find support and lots more on [phpBB.com](http://www.phpbb.com)! Discuss the development on [area51](http://area51.phpbb.com/phpBB/index.php).
## INSTALLING DEPENDENCIES
To be able to run an installation from the repo (and not from a pre-built package) you need to run the following commands to install phpBB's dependencies.
cd phpBB
- php ../composer.phar install --dev
+ php ../composer.phar install
## CONTRIBUTE
1. [Create an account on phpBB.com](http://www.phpbb.com/community/ucp.php?mode=register)
2. [Create a ticket (unless there already is one)](http://tracker.phpbb.com/secure/CreateIssue!default.jspa)
-3. [Read our Git Contribution Guidelines](http://wiki.phpbb.com/Git); if you're new to git, also read [the introduction guide](http://wiki.phpbb.com/display/DEV/Working+with+Git)
+3. Read our [Coding guidelines](https://wiki.phpbb.com/Coding_guidelines) and [Git Contribution Guidelines](http://wiki.phpbb.com/Git)
4. Send us a pull request
## AUTOMATED TESTING
-We have unit and functional tests in order to prevent regressions. You can view the bamboo continuous integration [here](http://bamboo.phpbb.com) or check our travis build below:
+We have unit and functional tests in order to prevent regressions. You can view the bamboo continuous integration [here](http://bamboo.phpbb.com) or check our travis builds below:
* [![Build Status](https://secure.travis-ci.org/phpbb/phpbb.png?branch=master)](http://travis-ci.org/phpbb/phpbb) **master** - Latest development version
+* [![Build Status](https://secure.travis-ci.org/phpbb/phpbb.png?branch=3.2.x)](http://travis-ci.org/phpbb/phpbb) **3.2.x** - Development of version 3.2.x
* [![Build Status](https://secure.travis-ci.org/phpbb/phpbb.png?branch=3.1.x)](http://travis-ci.org/phpbb/phpbb) **3.1.x** - Development of version 3.1.x
-* [![Build Status](https://secure.travis-ci.org/phpbb/phpbb.png?branch=3.0.x)](http://travis-ci.org/phpbb/phpbb) **3.0.x** - Development of version 3.0.x
## LICENSE
diff --git a/build/build.xml b/build/build.xml
index f01ea65d48..24d935ad90 100644
--- a/build/build.xml
+++ b/build/build.xml
@@ -2,9 +2,9 @@
<project name="phpBB" description="The phpBB forum software" default="all" basedir="../">
<!-- a few settings for the build -->
- <property name="newversion" value="3.2.0-b2" />
- <property name="prevversion" value="3.2.0-b1" />
- <property name="olderversions" value="3.0.14, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.7-pl1, 3.1.8, 3.2.0-a1, 3.2.0-a2" />
+ <property name="newversion" value="3.2.0-b3-dev" />
+ <property name="prevversion" value="3.2.0-b2" />
+ <property name="olderversions" value="3.0.14, 3.1.0, 3.1.1, 3.1.2, 3.1.3, 3.1.4, 3.1.5, 3.1.6, 3.1.7, 3.1.7-pl1, 3.1.8, 3.1.9, 3.2.0-a1, 3.2.0-a2, 3.2.0-b1" />
<!-- no configuration should be needed beyond this point -->
<property name="oldversions" value="${olderversions}, ${prevversion}" />
@@ -443,6 +443,13 @@
<delete file="${dir}/vendor/symfony/http-kernel/README.md" />
<delete file="${dir}/vendor/symfony/http-kernel/phpunit.xml.dist" />
+ <delete dir="${dir}/vendor/symfony/proxy-manager-bridge/.git" />
+ <delete dir="${dir}/vendor/symfony/proxy-manager-bridge/Tests" />
+ <delete file="${dir}/vendor/symfony/proxy-manager-bridge/.gitignore" />
+ <delete file="${dir}/vendor/symfony/proxy-manager-bridge/CHANGELOG.md" />
+ <delete file="${dir}/vendor/symfony/proxy-manager-bridge/README.md" />
+ <delete file="${dir}/vendor/symfony/proxy-manager-bridge/phpunit.xml.dist" />
+
<delete dir="${dir}/vendor/symfony/routing/.git" />
<delete dir="${dir}/vendor/symfony/routing/Tests" />
<delete file="${dir}/vendor/symfony/routing/.gitignore" />
@@ -473,6 +480,15 @@
<delete file="${dir}/vendor/twig/twig/CHANGELOG" />
<delete file="${dir}/vendor/twig/twig/phpunit.xml.dist" />
<delete file="${dir}/vendor/twig/twig/README.rst" />
+
+ <delete file="${dir}/vendor/zendframework/zend-code/CONTRIBUTING.md" />
+ <delete file="${dir}/vendor/zendframework/zend-code/README.md" />
+
+ <delete file="${dir}/vendor/zendframework/zend-eventmanager/CONTRIBUTING.md" />
+ <delete file="${dir}/vendor/zendframework/zend-eventmanager/README.md" />
+
+ <delete file="${dir}/vendor/zendframework/zend-stdlib/CONTRIBUTING.md" />
+ <delete file="${dir}/vendor/zendframework/zend-stdlib/README.md" />
</target>
<target name="clean-diff-dir">
diff --git a/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php b/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php
index c04113b84e..b3cdbf7496 100644
--- a/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php
+++ b/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php
@@ -134,53 +134,19 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff
}
}
+ $old_docblock = $stackPtr;
+ while (($docblock = $phpcsFile->findNext(T_DOC_COMMENT_CLOSE_TAG, ($old_docblock + 1))) !== false)
+ {
+ $old_docblock = $docblock;
+ $ok = $this->checkDocblock($phpcsFile, $docblock, $tokens, $class_name_full, $class_name_short) ? true : $ok;
+ }
+
// Checks in type hinting
$old_function_declaration = $stackPtr;
while (($function_declaration = $phpcsFile->findNext(T_FUNCTION, ($old_function_declaration + 1))) !== false)
{
$old_function_declaration = $function_declaration;
- // Check docblocks
- $find = array(
- T_COMMENT,
- T_DOC_COMMENT_CLOSE_TAG,
- T_DOC_COMMENT,
- T_CLASS,
- T_FUNCTION,
- T_OPEN_TAG,
- );
-
- $comment_end = $phpcsFile->findPrevious($find, ($function_declaration - 1));
- if ($comment_end !== false)
- {
- if ($tokens[$comment_end]['code'] === T_DOC_COMMENT_CLOSE_TAG)
- {
- $comment_start = $tokens[$comment_end]['comment_opener'];
- foreach ($tokens[$comment_start]['comment_tags'] as $tag) {
- if ($tokens[$tag]['content'] !== '@param' && $tokens[$tag]['content'] !== '@return' && $tokens[$tag]['content'] !== '@throws') {
- continue;
- }
-
- $classes = $tokens[($tag + 2)]['content'];
- $space = strpos($classes, ' ');
- if ($space !== false) {
- $classes = substr($classes, 0, $space);
- }
-
- $tab = strpos($classes, "\t");
- if ($tab !== false) {
- $classes = substr($classes, 0, $tab);
- }
-
- $classes = explode('|', str_replace('[]', '', $classes));
- foreach ($classes as $class)
- {
- $ok = $this->check($phpcsFile, $class, $class_name_full, $class_name_short, $tokens[$tag + 2]['line']) ? true : $ok;
- }
- }
- }
- }
-
// Check type hint
$params = $phpcsFile->getMethodParameters($function_declaration);
foreach ($params as $param)
@@ -239,4 +205,49 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff
return false;
}
+
+ /**
+ * @param PHP_CodeSniffer_File $phpcsFile
+ * @param int $field
+ * @param array $tokens
+ * @param string $class_name_full
+ * @param string $class_name_short
+ * @param bool $ok
+ *
+ * @return bool
+ */
+ private function checkDocblock(PHP_CodeSniffer_File $phpcsFile, $comment_end, $tokens, $class_name_full, $class_name_short)
+ {
+ $ok = false;
+
+ $comment_start = $tokens[$comment_end]['comment_opener'];
+ foreach ($tokens[$comment_start]['comment_tags'] as $tag)
+ {
+ if (!in_array($tokens[$tag]['content'], array('@param', '@var', '@return', '@throws'), true))
+ {
+ continue;
+ }
+
+ $classes = $tokens[($tag + 2)]['content'];
+ $space = strpos($classes, ' ');
+ if ($space !== false)
+ {
+ $classes = substr($classes, 0, $space);
+ }
+
+ $tab = strpos($classes, "\t");
+ if ($tab !== false)
+ {
+ $classes = substr($classes, 0, $tab);
+ }
+
+ $classes = explode('|', str_replace('[]', '', $classes));
+ foreach ($classes as $class)
+ {
+ $ok = $this->check($phpcsFile, $class, $class_name_full, $class_name_short, $tokens[$tag + 2]['line']) ? true : $ok;
+ }
+ }
+
+ return $ok;
+ }
}
diff --git a/composer.phar b/composer.phar
index 7826664865..fca2a8d72d 100755
--- a/composer.phar
+++ b/composer.phar
Binary files differ
diff --git a/phpBB/adm/style/acp_attachments.html b/phpBB/adm/style/acp_attachments.html
index da8a0096ea..e1f7f140c9 100644
--- a/phpBB/adm/style/acp_attachments.html
+++ b/phpBB/adm/style/acp_attachments.html
@@ -196,7 +196,7 @@
</dl>
<dl>
<dt><label for="extgroup_filesize">{L_MAX_EXTGROUP_FILESIZE}{L_COLON}</label></dt>
- <dd><input type="number" id="extgroup_filesize" size="3" maxlength="15" name="max_filesize" value="{EXTGROUP_FILESIZE}" /> <select name="size_select">{S_EXT_GROUP_SIZE_OPTIONS}</select></dd>
+ <dd><input type="number" id="extgroup_filesize" min="0" max="999999999999999" step="any" name="max_filesize" value="{EXTGROUP_FILESIZE}" /> <select name="size_select">{S_EXT_GROUP_SIZE_OPTIONS}</select></dd>
</dl>
<dl>
<dt><label for="assigned_extensions">{L_ASSIGNED_EXTENSIONS}{L_COLON}</label></dt>
@@ -346,7 +346,7 @@
<td><a href="{orphan.U_FILE}">{orphan.REAL_FILENAME}</a></td>
<td>{orphan.FILETIME}</td>
<td>{orphan.FILESIZE}</td>
- <td><strong>{L_ATTACH_ID}{L_COLON} </strong><input type="number" name="post_id[{orphan.ATTACH_ID}]" maxlength="10" value="{orphan.POST_ID}" style="width: 75%;" /></td>
+ <td><strong>{L_ATTACH_ID}{L_COLON} </strong><input type="number" min="0" max="9999999999" name="post_id[{orphan.ATTACH_ID}]" value="{orphan.POST_ID}" style="width: 75%;" /></td>
<td><input type="checkbox" class="radio" name="add[{orphan.ATTACH_ID}]" /></td>
<td><input type="checkbox" class="radio" name="delete[{orphan.ATTACH_ID}]" /></td>
</tr>
diff --git a/phpBB/adm/style/acp_avatar_options_gravatar.html b/phpBB/adm/style/acp_avatar_options_gravatar.html
index 0c2e8cc984..d5906ba87d 100644
--- a/phpBB/adm/style/acp_avatar_options_gravatar.html
+++ b/phpBB/adm/style/acp_avatar_options_gravatar.html
@@ -5,7 +5,7 @@
<dl>
<dt><label for="avatar_gravatar_width">{L_GRAVATAR_AVATAR_SIZE}{L_COLON}</label><br /><span>{L_GRAVATAR_AVATAR_SIZE_EXPLAIN}</span></dt>
<dd>
- <input type="number" name="avatar_gravatar_width" id="avatar_gravatar_width" size="3" value="{AVATAR_GRAVATAR_WIDTH}" class="inputbox autowidth" /> {L_PIXEL} &times;&nbsp;
- <input type="number" name="avatar_gravatar_height" id="avatar_gravatar_height" size="3" value="{AVATAR_GRAVATAR_HEIGHT}" class="inputbox autowidth" /> {L_PIXEL}
+ <input type="number" name="avatar_gravatar_width" id="avatar_gravatar_width" min="{AVATAR_MIN_WIDTH}" max="{AVATAR_MAX_WIDTH}" value="{AVATAR_GRAVATAR_WIDTH}" class="inputbox autowidth" /> {L_PIXEL} &times;&nbsp;
+ <input type="number" name="avatar_gravatar_height" id="avatar_gravatar_height" min="{AVATAR_MIN_HEIGHT}" max="{AVATAR_MAX_HEIGHT}" value="{AVATAR_GRAVATAR_HEIGHT}" class="inputbox autowidth" /> {L_PIXEL}
</dd>
</dl>
diff --git a/phpBB/adm/style/acp_avatar_options_remote.html b/phpBB/adm/style/acp_avatar_options_remote.html
index 1c0e3db599..e64d13686c 100644
--- a/phpBB/adm/style/acp_avatar_options_remote.html
+++ b/phpBB/adm/style/acp_avatar_options_remote.html
@@ -5,7 +5,7 @@
<dl>
<dt><label for="avatar_remote_width">{L_LINK_REMOTE_SIZE}{L_COLON}</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt>
<dd>
- <input type="number" name="avatar_remote_width" id="avatar_remote_width" size="3" value="{AVATAR_REMOTE_WIDTH}" class="inputbox autowidth" /> {L_PIXEL} &times;&nbsp;
- <input type="number" name="avatar_remote_height" id="avatar_remote_height" size="3" value="{AVATAR_REMOTE_HEIGHT}" class="inputbox autowidth" /> {L_PIXEL}
+ <input type="number" name="avatar_remote_width" id="avatar_remote_width" min="{AVATAR_MIN_WIDTH}" max="{AVATAR_MAX_WIDTH}" value="{AVATAR_REMOTE_WIDTH}" class="inputbox autowidth" /> {L_PIXEL} &times;&nbsp;
+ <input type="number" name="avatar_remote_height" id="avatar_remote_height" min="{AVATAR_MIN_HEIGHT}" max="{AVATAR_MAX_HEIGHT}" value="{AVATAR_REMOTE_HEIGHT}" class="inputbox autowidth" /> {L_PIXEL}
</dd>
</dl>
diff --git a/phpBB/adm/style/acp_captcha.html b/phpBB/adm/style/acp_captcha.html
index 0efbbac51e..4353becd2f 100644
--- a/phpBB/adm/style/acp_captcha.html
+++ b/phpBB/adm/style/acp_captcha.html
@@ -27,11 +27,11 @@
</dl>
<dl>
<dt><label for="max_reg_attempts">{L_REG_LIMIT}{L_COLON}</label><br /><span>{L_REG_LIMIT_EXPLAIN}</span></dt>
- <dd><input id="max_reg_attempts" type="number" size="4" maxlength="4" min="0" max="9999" name="max_reg_attempts" value="{REG_LIMIT}" /></dd>
+ <dd><input id="max_reg_attempts" type="number" min="0" max="9999" name="max_reg_attempts" value="{REG_LIMIT}" /></dd>
</dl>
<dl>
<dt><label for="max_login_attempts">{L_MAX_LOGIN_ATTEMPTS}{L_COLON}</label><br /><span>{L_MAX_LOGIN_ATTEMPTS_EXPLAIN}</span></dt>
- <dd><input id="max_login_attempts" type="number" size="4" maxlength="4" min="0" max="9999" name="max_login_attempts" value="{MAX_LOGIN_ATTEMPTS}" /></dd>
+ <dd><input id="max_login_attempts" type="number" min="0" max="9999" name="max_login_attempts" value="{MAX_LOGIN_ATTEMPTS}" /></dd>
</dl>
<dl>
<dt><label for="enable_post_confirm">{L_VISUAL_CONFIRM_POST}{L_COLON}</label><br /><span>{L_VISUAL_CONFIRM_POST_EXPLAIN}</span></dt>
diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html
index dcad90d7bc..965438ff67 100644
--- a/phpBB/adm/style/acp_forums.html
+++ b/phpBB/adm/style/acp_forums.html
@@ -242,7 +242,7 @@
</dl>
<dl>
<dt><label for="topics_per_page">{L_FORUM_TOPICS_PAGE}{L_COLON}</label><br /><span>{L_FORUM_TOPICS_PAGE_EXPLAIN}</span></dt>
- <dd><input type="number" id="topics_per_page" name="topics_per_page" value="{TOPICS_PER_PAGE}" size="4" maxlength="4" min="0" max="9999" /></dd>
+ <dd><input type="number" id="topics_per_page" name="topics_per_page" value="{TOPICS_PER_PAGE}" min="0" max="9999" /></dd>
</dl>
<!-- EVENT acp_forums_normal_settings_append -->
</fieldset>
@@ -257,15 +257,15 @@
</dl>
<dl>
<dt><label for="prune_freq">{L_AUTO_PRUNE_FREQ}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_FREQ_EXPLAIN}</span></dt>
- <dd><input type="number" id="prune_freq" name="prune_freq" value="{PRUNE_FREQ}" maxlength="4" size="4" min="0" max="9999" /> {L_DAYS}</dd>
+ <dd><input type="number" id="prune_freq" name="prune_freq" value="{PRUNE_FREQ}" min="0" max="9999" /> {L_DAYS}</dd>
</dl>
<dl>
<dt><label for="prune_days">{L_AUTO_PRUNE_DAYS}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_DAYS_EXPLAIN}</span></dt>
- <dd><input type="number" id="prune_days" name="prune_days" value="{PRUNE_DAYS}" maxlength="4" size="4" min="0" max="9999" /> {L_DAYS}</dd>
+ <dd><input type="number" id="prune_days" name="prune_days" value="{PRUNE_DAYS}" min="0" max="9999" /> {L_DAYS}</dd>
</dl>
<dl>
<dt><label for="prune_viewed">{L_AUTO_PRUNE_VIEWED}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_VIEWED_EXPLAIN}</span></dt>
- <dd><input type="number" id="prune_viewed" name="prune_viewed" value="{PRUNE_VIEWED}" maxlength="4" size="4" min="0" max="9999" /> {L_DAYS}</dd>
+ <dd><input type="number" id="prune_viewed" name="prune_viewed" value="{PRUNE_VIEWED}" min="0" max="9999" /> {L_DAYS}</dd>
</dl>
<dl>
<dt><label for="prune_old_polls">{L_PRUNE_OLD_POLLS}{L_COLON}</label><br /><span>{L_PRUNE_OLD_POLLS_EXPLAIN}</span></dt>
@@ -289,11 +289,11 @@
</dl>
<dl>
<dt><label for="prune_shadow_freq">{L_AUTO_PRUNE_SHADOW_FREQ}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_SHADOW_FREQ_EXPLAIN}</span></dt>
- <dd><input type="number" id="prune_shadow_freq" name="prune_shadow_freq" value="{PRUNE_SHADOW_FREQ}" maxlength="4" size="4" min="0" max="9999" /> {L_DAYS}</dd>
+ <dd><input type="number" id="prune_shadow_freq" name="prune_shadow_freq" value="{PRUNE_SHADOW_FREQ}" min="0" max="9999" /> {L_DAYS}</dd>
</dl>
<dl>
<dt><label for="prune_shadow_days">{L_AUTO_PRUNE_SHADOW_DAYS}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_SHADOW_DAYS_EXPLAIN}</span></dt>
- <dd><input type="number" id="prune_shadow_days" name="prune_shadow_days" value="{PRUNE_SHADOW_DAYS}" maxlength="4" size="4" min="0" max="9999" /> {L_DAYS}</dd>
+ <dd><input type="number" id="prune_shadow_days" name="prune_shadow_days" value="{PRUNE_SHADOW_DAYS}" min="0" max="9999" /> {L_DAYS}</dd>
</dl>
<!-- EVENT acp_forums_prune_settings_append -->
</fieldset>
diff --git a/phpBB/adm/style/acp_groups.html b/phpBB/adm/style/acp_groups.html
index ffde27a437..26d7030531 100644
--- a/phpBB/adm/style/acp_groups.html
+++ b/phpBB/adm/style/acp_groups.html
@@ -86,11 +86,11 @@
<legend>{L_GROUP_SETTINGS_SAVE}</legend>
<dl>
<dt><label for="group_message_limit">{L_GROUP_MESSAGE_LIMIT}{L_COLON}</label><br /><span>{L_GROUP_MESSAGE_LIMIT_EXPLAIN}</span></dt>
- <dd><input name="group_message_limit" type="number" id="group_message_limit" maxlength="4" size="4" min="0" max="9999" value="{GROUP_MESSAGE_LIMIT}" /></dd>
+ <dd><input name="group_message_limit" type="number" id="group_message_limit" min="0" max="9999" value="{GROUP_MESSAGE_LIMIT}" /></dd>
</dl>
<dl>
<dt><label for="group_max_recipients">{L_GROUP_MAX_RECIPIENTS}{L_COLON}</label><br /><span>{L_GROUP_MAX_RECIPIENTS_EXPLAIN}</span></dt>
- <dd><input name="group_max_recipients" type="number" id="group_max_recipients" maxlength="10" size="4" value="{GROUP_MAX_RECIPIENTS}" /></dd>
+ <dd><input name="group_max_recipients" type="number" id="group_max_recipients" min="0" max="9999" value="{GROUP_MAX_RECIPIENTS}" /></dd>
</dl>
<dl>
<dt><label for="group_colour">{L_GROUP_COLOR}{L_COLON}</label><br /><span>{L_GROUP_COLOR_EXPLAIN}</span></dt>
diff --git a/phpBB/adm/style/acp_icons.html b/phpBB/adm/style/acp_icons.html
index e723129e37..5493cbde0a 100644
--- a/phpBB/adm/style/acp_icons.html
+++ b/phpBB/adm/style/acp_icons.html
@@ -111,8 +111,8 @@
<td><input class="text post" type="text" name="code[{items.IMG}]" value="{items.CODE}" size="10" maxlength="50" /></td>
<td><input class="text post" type="text" name="emotion[{items.IMG}]" value="{items.EMOTION}" size="10" maxlength="50" /></td>
<!-- ENDIF -->
- <td><input class="text post" type="number" size="3" name="width[{items.IMG}]" value="{items.WIDTH}" /></td>
- <td><input class="text post" type="number" size="3" name="height[{items.IMG}]" value="{items.HEIGHT}" /></td>
+ <td><input class="text post" type="number" min="0" max="999" name="width[{items.IMG}]" value="{items.WIDTH}" /></td>
+ <td><input class="text post" type="number" min="0" max="999" name="height[{items.IMG}]" value="{items.HEIGHT}" /></td>
<!-- IF not S_SMILIES -->
<td><input class="text post" type="text" name="alt[{items.IMG}]" value="{items.ALT}" size="10" maxlength="50" /></td>
<!-- ENDIF -->
@@ -142,8 +142,8 @@
<td style="vertical-align: top;"><img src="{IMG_SRC}" id="add_image_src" alt="" title="" /></td>
<td><input class="text post" type="text" name="add_code" id="add_code" value="{CODE}" size="10" maxlength="50" /></td>
<td><input class="text post" type="text" name="add_emotion" id="add_emotion" value="{EMOTION}" size="10" maxlength="50" /></td>
- <td><input class="text post" type="number" size="3" name="add_width" id="add_width" value="{WIDTH}" /></td>
- <td><input class="text post" type="number" size="3" name="add_height" id="add_height" value="{HEIGHT}" /></td>
+ <td><input class="text post" type="number" min="0" max="999" name="add_width" id="add_width" value="{WIDTH}" /></td>
+ <td><input class="text post" type="number" min="0" max="999" name="add_height" id="add_height" value="{HEIGHT}" /></td>
<td><input type="checkbox" class="radio" name="add_display_on_posting" checked="checked" onclick="toggle_select('add', this.checked, 'add_order');"/></td>
<td><select id="order_add_order" name="add_order">
<optgroup id="order_disp_add_order" label="{L_DISPLAY_POSTING}">{S_ADD_ORDER_LIST_DISPLAY}</optgroup>
diff --git a/phpBB/adm/style/acp_inactive.html b/phpBB/adm/style/acp_inactive.html
index 2aa3051f53..2e17bea47d 100644
--- a/phpBB/adm/style/acp_inactive.html
+++ b/phpBB/adm/style/acp_inactive.html
@@ -52,7 +52,7 @@
</table>
<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}<!-- IF .pagination -->&nbsp;{L_USERS_PER_PAGE}{L_COLON} <input class="inputbox autowidth" type="number" name="users_per_page" id="users_per_page" size="3" value="{USERS_PER_PAGE}" /><!-- ENDIF -->
+ {L_DISPLAY_LOG}{L_COLON} &nbsp;{S_LIMIT_DAYS}&nbsp;{L_SORT_BY}{L_COLON} {S_SORT_KEY} {S_SORT_DIR}<!-- IF .pagination -->&nbsp;{L_USERS_PER_PAGE}{L_COLON} <input class="inputbox autowidth" type="number" name="users_per_page" id="users_per_page" min="0" max="999" value="{USERS_PER_PAGE}" /><!-- ENDIF -->
<input class="button2" type="submit" value="{L_GO}" name="sort" />
</fieldset>
diff --git a/phpBB/adm/style/acp_jabber.html b/phpBB/adm/style/acp_jabber.html
index 9246987f1f..3c3b895624 100644
--- a/phpBB/adm/style/acp_jabber.html
+++ b/phpBB/adm/style/acp_jabber.html
@@ -31,7 +31,7 @@
</dl>
<dl>
<dt><label for="jab_port">{L_JAB_PORT}{L_COLON}</label><br /><span>{L_JAB_PORT_EXPLAIN}</span></dt>
- <dd><input type="number" id="jab_port" name="jab_port" value="{JAB_PORT}" maxlength="5" size="5" /></dd>
+ <dd><input type="number" id="jab_port" name="jab_port" value="{JAB_PORT}" min="0" max="99999" /></dd>
</dl>
<dl>
<dt><label for="jab_username">{L_JAB_USERNAME}{L_COLON}</label><br /><span>{L_JAB_USERNAME_EXPLAIN}</span></dt>
@@ -50,7 +50,7 @@
<!-- ENDIF -->
<dl>
<dt><label for="jab_package_size">{L_JAB_PACKAGE_SIZE}{L_COLON}</label><br /><span>{L_JAB_PACKAGE_SIZE_EXPLAIN}</span></dt>
- <dd><input type="number" id="jab_package_size" name="jab_package_size" value="{JAB_PACKAGE_SIZE}" maxlength="5" size="5" min="0" max="99999" /></dd>
+ <dd><input type="number" id="jab_package_size" name="jab_package_size" value="{JAB_PACKAGE_SIZE}" min="0" max="99999" /></dd>
</dl>
</fieldset>
diff --git a/phpBB/adm/style/acp_ranks.html b/phpBB/adm/style/acp_ranks.html
index fa06513b98..e67c9acd80 100644
--- a/phpBB/adm/style/acp_ranks.html
+++ b/phpBB/adm/style/acp_ranks.html
@@ -44,7 +44,7 @@
<div id="posts"<!-- IF S_SPECIAL_RANK --> style="display: none;"<!-- ENDIF -->>
<dl>
<dt><label for="min_posts">{L_RANK_MINIMUM}{L_COLON}</label></dt>
- <dd><input name="min_posts" type="number" id="min_posts" maxlength="10" value="{MIN_POSTS}" /></dd>
+ <dd><input name="min_posts" type="number" id="min_posts" min="0" max="9999999999" value="{MIN_POSTS}" /></dd>
</dl>
</div>
diff --git a/phpBB/adm/style/acp_search.html b/phpBB/adm/style/acp_search.html
index 1cde52acf3..f7ad3c5e89 100644
--- a/phpBB/adm/style/acp_search.html
+++ b/phpBB/adm/style/acp_search.html
@@ -18,11 +18,11 @@
</dl>
<dl>
<dt><label for="search_interval">{L_SEARCH_INTERVAL}{L_COLON}</label><br /><span>{L_SEARCH_INTERVAL_EXPLAIN}</span></dt>
- <dd><input id="search_interval" type="number" size="4" maxlength="4" min="0" max="9999" name="config[search_interval]" value="{SEARCH_INTERVAL}" /> {L_SECONDS}</dd>
+ <dd><input id="search_interval" type="number" min="0" max="9999" name="config[search_interval]" value="{SEARCH_INTERVAL}" /> {L_SECONDS}</dd>
</dl>
<dl>
<dt><label for="search_anonymous_interval">{L_SEARCH_GUEST_INTERVAL}{L_COLON}</label><br /><span>{L_SEARCH_GUEST_INTERVAL_EXPLAIN}</span></dt>
- <dd><input id="search_anonymous_interval" type="number" size="4" maxlength="4" min="0" max="9999" name="config[search_anonymous_interval]" value="{SEARCH_GUEST_INTERVAL}" /> {L_SECONDS}</dd>
+ <dd><input id="search_anonymous_interval" type="number" min="0" max="9999" name="config[search_anonymous_interval]" value="{SEARCH_GUEST_INTERVAL}" /> {L_SECONDS}</dd>
</dl>
<dl>
<dt><label for="limit_search_load">{L_LIMIT_SEARCH_LOAD}{L_COLON}</label><br /><span>{L_LIMIT_SEARCH_LOAD_EXPLAIN}</span></dt>
@@ -30,15 +30,15 @@
</dl>
<dl>
<dt><label for="min_search_author_chars">{L_MIN_SEARCH_AUTHOR_CHARS}{L_COLON}</label><br /><span>{L_MIN_SEARCH_AUTHOR_CHARS_EXPLAIN}</span></dt>
- <dd><input id="min_search_author_chars" type="number" size="4" maxlength="4" min="0" max="9999" name="config[min_search_author_chars]" value="{MIN_SEARCH_AUTHOR_CHARS}" /></dd>
+ <dd><input id="min_search_author_chars" type="number" min="0" max="9999" name="config[min_search_author_chars]" value="{MIN_SEARCH_AUTHOR_CHARS}" /></dd>
</dl>
<dl>
<dt><label for="max_num_search_keywords">{L_MAX_NUM_SEARCH_KEYWORDS}{L_COLON}</label><br /><span>{L_MAX_NUM_SEARCH_KEYWORDS_EXPLAIN}</span></dt>
- <dd><input id="max_num_search_keywords" type="number" size="4" maxlength="4" min="0" max="9999" name="config[max_num_search_keywords]" value="{MAX_NUM_SEARCH_KEYWORDS}" /></dd>
+ <dd><input id="max_num_search_keywords" type="number" min="0" max="9999" name="config[max_num_search_keywords]" value="{MAX_NUM_SEARCH_KEYWORDS}" /></dd>
</dl>
<dl>
<dt><label for="search_store_results">{L_SEARCH_STORE_RESULTS}{L_COLON}</label><br /><span>{L_SEARCH_STORE_RESULTS_EXPLAIN}</span></dt>
- <dd><input id="search_store_results" type="number" size="4" maxlength="6" min="0" max="999999" name="config[search_store_results]" value="{SEARCH_STORE_RESULTS}" /> {L_SECONDS}</dd>
+ <dd><input id="search_store_results" type="number" min="0" max="999999" name="config[search_store_results]" value="{SEARCH_STORE_RESULTS}" /> {L_SECONDS}</dd>
</dl>
</fieldset>
diff --git a/phpBB/adm/style/installer_header.html b/phpBB/adm/style/installer_header.html
index 775caa7c67..704db9e174 100644
--- a/phpBB/adm/style/installer_header.html
+++ b/phpBB/adm/style/installer_header.html
@@ -2,6 +2,7 @@
<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
<meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- IF META -->{META}<!-- ENDIF -->
<title>{PAGE_TITLE}</title>
diff --git a/phpBB/adm/style/overall_header.html b/phpBB/adm/style/overall_header.html
index 9266372ab8..f227f729fd 100644
--- a/phpBB/adm/style/overall_header.html
+++ b/phpBB/adm/style/overall_header.html
@@ -2,6 +2,7 @@
<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- IF META -->{META}<!-- ENDIF -->
<title>{PAGE_TITLE}</title>
diff --git a/phpBB/adm/style/simple_header.html b/phpBB/adm/style/simple_header.html
index f62a7a900e..9f47b2052b 100644
--- a/phpBB/adm/style/simple_header.html
+++ b/phpBB/adm/style/simple_header.html
@@ -2,6 +2,7 @@
<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- IF META -->{META}<!-- ENDIF -->
<title>{PAGE_TITLE}</title>
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index 5844537fc8..b00da3caff 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -1541,6 +1541,13 @@ phpbb.toggleSelectSettings = function(el) {
var $this = $(this),
$setting = $($this.data('toggle-setting'));
$setting.toggle($this.is(':selected'));
+
+ // Disable any input elements that are not visible right now
+ if ($this.is(':selected')) {
+ $($this.data('toggle-setting') + ' input').prop('disabled', false);
+ } else {
+ $($this.data('toggle-setting') + ' input').prop('disabled', true);
+ }
});
};
diff --git a/phpBB/assets/javascript/editor.js b/phpBB/assets/javascript/editor.js
index df353bc29d..332ab42e37 100644
--- a/phpBB/assets/javascript/editor.js
+++ b/phpBB/assets/javascript/editor.js
@@ -414,6 +414,12 @@ function getCaretPosition(txtarea) {
if ($('#attach-panel').length) {
phpbb.showDragNDrop(textarea);
}
+
+ $('textarea').on('keydown', function (e) {
+ if (e.which === 13 && (e.metaKey || e.ctrlKey)) {
+ $(this).closest('form').submit();
+ }
+ });
});
})(jQuery);
diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php
index 72f1785931..804a7e09a0 100755
--- a/phpBB/bin/phpbbcli.php
+++ b/phpBB/bin/phpbbcli.php
@@ -68,6 +68,8 @@ $phpbb_container = $phpbb_container_builder->get_container();
$phpbb_container->get('request')->enable_super_globals();
require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx);
+register_compatibility_globals();
+
/* @var $user \phpbb\user */
$user = $phpbb_container->get('user');
$user->data['user_id'] = ANONYMOUS;
diff --git a/phpBB/common.php b/phpBB/common.php
index 48bd13e80d..d12966168b 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -43,7 +43,13 @@ if (!defined('PHPBB_INSTALLED'))
// available as used by the redirect function
$server_name = (!empty($_SERVER['HTTP_HOST'])) ? strtolower($_SERVER['HTTP_HOST']) : ((!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME'));
$server_port = (!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT');
- $secure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 1 : 0;
+ $secure = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 1 : 0;
+
+ if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https')
+ {
+ $secure = 1;
+ $server_port = 443;
+ }
$script_name = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : getenv('PHP_SELF');
if (!$script_name)
@@ -128,6 +134,8 @@ $phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver'));
require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx);
+register_compatibility_globals();
+
// Add own hook handler
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
diff --git a/phpBB/composer.json b/phpBB/composer.json
index b0c9b57cb6..3fe1c90718 100644
--- a/phpBB/composer.json
+++ b/phpBB/composer.json
@@ -43,6 +43,7 @@
"symfony/finder": "2.8.*",
"symfony/http-foundation": "2.8.*",
"symfony/http-kernel": "2.8.*",
+ "symfony/proxy-manager-bridge": "2.8.*",
"symfony/routing": "2.8.*",
"symfony/twig-bridge": "2.8.*",
"symfony/yaml": "2.8.*",
@@ -64,5 +65,10 @@
"branch-alias": {
"dev-master": "3.2.x-dev"
}
+ },
+ "config": {
+ "platform": {
+ "php": "5.4"
+ }
}
}
diff --git a/phpBB/composer.lock b/phpBB/composer.lock
index d10c94a75f..c6a0c3e854 100644
--- a/phpBB/composer.lock
+++ b/phpBB/composer.lock
@@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "hash": "9cbb41222e71eb86e0ef9118baafc691",
- "content-hash": "03a990fa2d088c89afe4824d2d53e873",
+ "hash": "b82925c74b2b12ce589973243a9fab68",
+ "content-hash": "fee6d87604f3053b51c0947ded841cfe",
"packages": [
{
"name": "bantu/ini-get-wrapper",
@@ -285,16 +285,16 @@
},
{
"name": "lusitanian/oauth",
- "version": "v0.8.6",
+ "version": "v0.8.9",
"source": {
"type": "git",
"url": "https://github.com/Lusitanian/PHPoAuthLib.git",
- "reference": "769fea1bb53845c7b03cca97cbdd0708e9ec26da"
+ "reference": "29bda6e176df6c292a9b1c43ae8a44d56a87c30b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Lusitanian/PHPoAuthLib/zipball/769fea1bb53845c7b03cca97cbdd0708e9ec26da",
- "reference": "769fea1bb53845c7b03cca97cbdd0708e9ec26da",
+ "url": "https://api.github.com/repos/Lusitanian/PHPoAuthLib/zipball/29bda6e176df6c292a9b1c43ae8a44d56a87c30b",
+ "reference": "29bda6e176df6c292a9b1c43ae8a44d56a87c30b",
"shasum": ""
},
"require": {
@@ -348,7 +348,7 @@
"oauth",
"security"
],
- "time": "2015-12-21 00:06:34"
+ "time": "2016-02-24 00:20:18"
},
{
"name": "marc1706/fast-image-size",
@@ -402,17 +402,80 @@
"time": "2015-08-21 11:40:30"
},
{
+ "name": "ocramius/proxy-manager",
+ "version": "1.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Ocramius/ProxyManager.git",
+ "reference": "57e9272ec0e8deccf09421596e0e2252df440e11"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Ocramius/ProxyManager/zipball/57e9272ec0e8deccf09421596e0e2252df440e11",
+ "reference": "57e9272ec0e8deccf09421596e0e2252df440e11",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "zendframework/zend-code": ">2.2.5,<3.0"
+ },
+ "require-dev": {
+ "ext-phar": "*",
+ "phpunit/phpunit": "~4.0",
+ "squizlabs/php_codesniffer": "1.5.*"
+ },
+ "suggest": {
+ "ocramius/generated-hydrator": "To have very fast object to array to object conversion for ghost objects",
+ "zendframework/zend-json": "To have the JsonRpc adapter (Remote Object feature)",
+ "zendframework/zend-soap": "To have the Soap adapter (Remote Object feature)",
+ "zendframework/zend-stdlib": "To use the hydrator proxy",
+ "zendframework/zend-xmlrpc": "To have the XmlRpc adapter (Remote Object feature)"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.0.x-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "ProxyManager\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Marco Pivetta",
+ "email": "ocramius@gmail.com",
+ "homepage": "http://ocramius.github.com/"
+ }
+ ],
+ "description": "A library providing utilities to generate, instantiate and generally operate with Object Proxies",
+ "homepage": "https://github.com/Ocramius/ProxyManager",
+ "keywords": [
+ "aop",
+ "lazy loading",
+ "proxy",
+ "proxy pattern",
+ "service proxies"
+ ],
+ "time": "2015-08-09 04:28:19"
+ },
+ {
"name": "paragonie/random_compat",
- "version": "v1.2.0",
+ "version": "v1.2.2",
"source": {
"type": "git",
"url": "https://github.com/paragonie/random_compat.git",
- "reference": "b0e69d10852716b2ccbdff69c75c477637220790"
+ "reference": "b3313b618f4edd76523572531d5d7e22fe747430"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/paragonie/random_compat/zipball/b0e69d10852716b2ccbdff69c75c477637220790",
- "reference": "b0e69d10852716b2ccbdff69c75c477637220790",
+ "url": "https://api.github.com/repos/paragonie/random_compat/zipball/b3313b618f4edd76523572531d5d7e22fe747430",
+ "reference": "b3313b618f4edd76523572531d5d7e22fe747430",
"shasum": ""
},
"require": {
@@ -447,7 +510,7 @@
"pseudorandom",
"random"
],
- "time": "2016-02-06 03:52:05"
+ "time": "2016-03-11 19:54:08"
},
{
"name": "patchwork/utf8",
@@ -540,16 +603,16 @@
},
{
"name": "react/promise",
- "version": "v2.2.1",
+ "version": "v2.2.2",
"source": {
"type": "git",
"url": "https://github.com/reactphp/promise.git",
- "reference": "3b6fca09c7d56321057fa8867c8dbe1abf648627"
+ "reference": "3aacad8bf10c7d83e6fa2089d413529888c2bedf"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/reactphp/promise/zipball/3b6fca09c7d56321057fa8867c8dbe1abf648627",
- "reference": "3b6fca09c7d56321057fa8867c8dbe1abf648627",
+ "url": "https://api.github.com/repos/reactphp/promise/zipball/3aacad8bf10c7d83e6fa2089d413529888c2bedf",
+ "reference": "3aacad8bf10c7d83e6fa2089d413529888c2bedf",
"shasum": ""
},
"require": {
@@ -580,20 +643,20 @@
}
],
"description": "A lightweight implementation of CommonJS Promises/A for PHP",
- "time": "2015-07-03 13:48:55"
+ "time": "2016-02-26 19:09:02"
},
{
"name": "s9e/text-formatter",
- "version": "0.4.10",
+ "version": "0.4.11",
"source": {
"type": "git",
"url": "https://github.com/s9e/TextFormatter.git",
- "reference": "dc6b7b069d17fc18c8a40cce9e1048e25aa11fec"
+ "reference": "e6dc4615081b1668742076aa05d11aa0f7b00103"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/s9e/TextFormatter/zipball/dc6b7b069d17fc18c8a40cce9e1048e25aa11fec",
- "reference": "dc6b7b069d17fc18c8a40cce9e1048e25aa11fec",
+ "url": "https://api.github.com/repos/s9e/TextFormatter/zipball/e6dc4615081b1668742076aa05d11aa0f7b00103",
+ "reference": "e6dc4615081b1668742076aa05d11aa0f7b00103",
"shasum": ""
},
"require": {
@@ -640,26 +703,29 @@
"parser",
"shortcodes"
],
- "time": "2016-02-11 14:03:12"
+ "time": "2016-02-21 20:38:42"
},
{
"name": "symfony/config",
- "version": "v2.8.2",
+ "version": "v2.8.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/config.git",
- "reference": "41ee6c70758f40fa1dbf90d019ae0a66c4a09e74"
+ "reference": "0f8f94e6a32b5c480024eed5fa5cbd2790d0ad19"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/config/zipball/41ee6c70758f40fa1dbf90d019ae0a66c4a09e74",
- "reference": "41ee6c70758f40fa1dbf90d019ae0a66c4a09e74",
+ "url": "https://api.github.com/repos/symfony/config/zipball/0f8f94e6a32b5c480024eed5fa5cbd2790d0ad19",
+ "reference": "0f8f94e6a32b5c480024eed5fa5cbd2790d0ad19",
"shasum": ""
},
"require": {
"php": ">=5.3.9",
"symfony/filesystem": "~2.3|~3.0.0"
},
+ "suggest": {
+ "symfony/yaml": "To use the yaml reference dumper"
+ },
"type": "library",
"extra": {
"branch-alias": {
@@ -690,20 +756,20 @@
],
"description": "Symfony Config Component",
"homepage": "https://symfony.com",
- "time": "2016-01-03 15:33:41"
+ "time": "2016-02-22 16:12:45"
},
{
"name": "symfony/console",
- "version": "v2.8.2",
+ "version": "v2.8.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
- "reference": "d0239fb42f98dd02e7d342f793c5d2cdee0c478d"
+ "reference": "56cc5caf051189720b8de974e4746090aaa10d44"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/console/zipball/d0239fb42f98dd02e7d342f793c5d2cdee0c478d",
- "reference": "d0239fb42f98dd02e7d342f793c5d2cdee0c478d",
+ "url": "https://api.github.com/repos/symfony/console/zipball/56cc5caf051189720b8de974e4746090aaa10d44",
+ "reference": "56cc5caf051189720b8de974e4746090aaa10d44",
"shasum": ""
},
"require": {
@@ -750,20 +816,20 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
- "time": "2016-01-14 08:33:16"
+ "time": "2016-02-28 16:20:50"
},
{
"name": "symfony/debug",
- "version": "v2.8.2",
+ "version": "v2.8.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/debug.git",
- "reference": "386364a0e71158615ab9ae76b74bf84efc0bac7e"
+ "reference": "8e255a0c551d443a8159e3da95b5f99997d100fd"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/debug/zipball/386364a0e71158615ab9ae76b74bf84efc0bac7e",
- "reference": "386364a0e71158615ab9ae76b74bf84efc0bac7e",
+ "url": "https://api.github.com/repos/symfony/debug/zipball/8e255a0c551d443a8159e3da95b5f99997d100fd",
+ "reference": "8e255a0c551d443a8159e3da95b5f99997d100fd",
"shasum": ""
},
"require": {
@@ -807,20 +873,20 @@
],
"description": "Symfony Debug Component",
"homepage": "https://symfony.com",
- "time": "2016-01-13 10:28:07"
+ "time": "2016-01-27 05:14:19"
},
{
"name": "symfony/dependency-injection",
- "version": "v2.8.2",
+ "version": "v2.8.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/dependency-injection.git",
- "reference": "ba94a914e244e0d05f0aaef460d5558d5541d2b1"
+ "reference": "62251761a7615435b22ccf562384c588b431be44"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/ba94a914e244e0d05f0aaef460d5558d5541d2b1",
- "reference": "ba94a914e244e0d05f0aaef460d5558d5541d2b1",
+ "url": "https://api.github.com/repos/symfony/dependency-injection/zipball/62251761a7615435b22ccf562384c588b431be44",
+ "reference": "62251761a7615435b22ccf562384c588b431be44",
"shasum": ""
},
"require": {
@@ -869,20 +935,20 @@
],
"description": "Symfony DependencyInjection Component",
"homepage": "https://symfony.com",
- "time": "2016-01-12 17:46:01"
+ "time": "2016-02-28 16:34:46"
},
{
"name": "symfony/event-dispatcher",
- "version": "v2.8.2",
+ "version": "v2.8.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
- "reference": "ee278f7c851533e58ca307f66305ccb9188aceda"
+ "reference": "78c468665c9568c3faaa9c416a7134308f2d85c3"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/ee278f7c851533e58ca307f66305ccb9188aceda",
- "reference": "ee278f7c851533e58ca307f66305ccb9188aceda",
+ "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/78c468665c9568c3faaa9c416a7134308f2d85c3",
+ "reference": "78c468665c9568c3faaa9c416a7134308f2d85c3",
"shasum": ""
},
"require": {
@@ -929,20 +995,20 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
- "time": "2016-01-13 10:28:07"
+ "time": "2016-01-27 05:14:19"
},
{
"name": "symfony/filesystem",
- "version": "v2.8.2",
+ "version": "v2.8.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/filesystem.git",
- "reference": "637b64d0ee10f44ae98dbad651b1ecdf35a11e8c"
+ "reference": "65cb36b6539b1d446527d60457248f30d045464d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/filesystem/zipball/637b64d0ee10f44ae98dbad651b1ecdf35a11e8c",
- "reference": "637b64d0ee10f44ae98dbad651b1ecdf35a11e8c",
+ "url": "https://api.github.com/repos/symfony/filesystem/zipball/65cb36b6539b1d446527d60457248f30d045464d",
+ "reference": "65cb36b6539b1d446527d60457248f30d045464d",
"shasum": ""
},
"require": {
@@ -978,20 +1044,20 @@
],
"description": "Symfony Filesystem Component",
"homepage": "https://symfony.com",
- "time": "2016-01-13 10:28:07"
+ "time": "2016-02-22 15:02:30"
},
{
"name": "symfony/finder",
- "version": "v2.8.2",
+ "version": "v2.8.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
- "reference": "c90fabdd97e431ee19b6383999cf35334dff27da"
+ "reference": "877bb4b16ea573cc8c024e9590888fcf7eb7e0f7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/finder/zipball/c90fabdd97e431ee19b6383999cf35334dff27da",
- "reference": "c90fabdd97e431ee19b6383999cf35334dff27da",
+ "url": "https://api.github.com/repos/symfony/finder/zipball/877bb4b16ea573cc8c024e9590888fcf7eb7e0f7",
+ "reference": "877bb4b16ea573cc8c024e9590888fcf7eb7e0f7",
"shasum": ""
},
"require": {
@@ -1027,20 +1093,20 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
- "time": "2016-01-14 08:26:52"
+ "time": "2016-02-22 16:12:45"
},
{
"name": "symfony/http-foundation",
- "version": "v2.8.2",
+ "version": "v2.8.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
- "reference": "9194b33c71da8ef4d05d22964376f2f9c95a1bfd"
+ "reference": "6f4e41c41e7d352ed9adf71ff6f2ec1756490a1b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/http-foundation/zipball/9194b33c71da8ef4d05d22964376f2f9c95a1bfd",
- "reference": "9194b33c71da8ef4d05d22964376f2f9c95a1bfd",
+ "url": "https://api.github.com/repos/symfony/http-foundation/zipball/6f4e41c41e7d352ed9adf71ff6f2ec1756490a1b",
+ "reference": "6f4e41c41e7d352ed9adf71ff6f2ec1756490a1b",
"shasum": ""
},
"require": {
@@ -1081,20 +1147,20 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com",
- "time": "2016-01-13 10:28:07"
+ "time": "2016-02-28 16:20:50"
},
{
"name": "symfony/http-kernel",
- "version": "v2.8.2",
+ "version": "v2.8.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
- "reference": "dbe146efdc040dc87cc730a926c7858bb3c3b3bc"
+ "reference": "67ca6a98d8d7cf243ccb4b716deab2342f409a4d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/http-kernel/zipball/dbe146efdc040dc87cc730a926c7858bb3c3b3bc",
- "reference": "dbe146efdc040dc87cc730a926c7858bb3c3b3bc",
+ "url": "https://api.github.com/repos/symfony/http-kernel/zipball/67ca6a98d8d7cf243ccb4b716deab2342f409a4d",
+ "reference": "67ca6a98d8d7cf243ccb4b716deab2342f409a4d",
"shasum": ""
},
"require": {
@@ -1163,20 +1229,20 @@
],
"description": "Symfony HttpKernel Component",
"homepage": "https://symfony.com",
- "time": "2016-01-14 12:00:59"
+ "time": "2016-02-28 21:06:17"
},
{
"name": "symfony/polyfill-mbstring",
- "version": "v1.0.1",
+ "version": "v1.1.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-mbstring.git",
- "reference": "49ff736bd5d41f45240cec77b44967d76e0c3d25"
+ "reference": "1289d16209491b584839022f29257ad859b8532d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/49ff736bd5d41f45240cec77b44967d76e0c3d25",
- "reference": "49ff736bd5d41f45240cec77b44967d76e0c3d25",
+ "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/1289d16209491b584839022f29257ad859b8532d",
+ "reference": "1289d16209491b584839022f29257ad859b8532d",
"shasum": ""
},
"require": {
@@ -1188,7 +1254,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0-dev"
+ "dev-master": "1.1-dev"
}
},
"autoload": {
@@ -1222,20 +1288,20 @@
"portable",
"shim"
],
- "time": "2015-11-20 09:19:13"
+ "time": "2016-01-20 09:13:37"
},
{
"name": "symfony/polyfill-php54",
- "version": "v1.0.1",
+ "version": "v1.1.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php54.git",
- "reference": "2c9f6d98eb30dc04fe0b06f9cc92a55acea5bdcc"
+ "reference": "9ba741ca01c77282ecf5796c2c1d667f03454ffb"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/2c9f6d98eb30dc04fe0b06f9cc92a55acea5bdcc",
- "reference": "2c9f6d98eb30dc04fe0b06f9cc92a55acea5bdcc",
+ "url": "https://api.github.com/repos/symfony/polyfill-php54/zipball/9ba741ca01c77282ecf5796c2c1d667f03454ffb",
+ "reference": "9ba741ca01c77282ecf5796c2c1d667f03454ffb",
"shasum": ""
},
"require": {
@@ -1244,7 +1310,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0-dev"
+ "dev-master": "1.1-dev"
}
},
"autoload": {
@@ -1280,20 +1346,20 @@
"portable",
"shim"
],
- "time": "2015-11-04 20:28:58"
+ "time": "2016-01-25 19:13:00"
},
{
"name": "symfony/polyfill-php55",
- "version": "v1.0.1",
+ "version": "v1.1.1",
"source": {
"type": "git",
"url": "https://github.com/symfony/polyfill-php55.git",
- "reference": "3adc962a6250c02adb508e85ecfa6fcfee9eec47"
+ "reference": "b4f3f07d91702f8f926339fc4fcf81671d8c27e6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/3adc962a6250c02adb508e85ecfa6fcfee9eec47",
- "reference": "3adc962a6250c02adb508e85ecfa6fcfee9eec47",
+ "url": "https://api.github.com/repos/symfony/polyfill-php55/zipball/b4f3f07d91702f8f926339fc4fcf81671d8c27e6",
+ "reference": "b4f3f07d91702f8f926339fc4fcf81671d8c27e6",
"shasum": ""
},
"require": {
@@ -1303,7 +1369,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0-dev"
+ "dev-master": "1.1-dev"
}
},
"autoload": {
@@ -1336,20 +1402,74 @@
"portable",
"shim"
],
- "time": "2015-11-04 20:28:58"
+ "time": "2016-01-20 09:13:37"
+ },
+ {
+ "name": "symfony/proxy-manager-bridge",
+ "version": "v2.8.4",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/proxy-manager-bridge.git",
+ "reference": "713ed53cf1da3f41288c608d2d0ddb44d6b07304"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/proxy-manager-bridge/zipball/713ed53cf1da3f41288c608d2d0ddb44d6b07304",
+ "reference": "713ed53cf1da3f41288c608d2d0ddb44d6b07304",
+ "shasum": ""
+ },
+ "require": {
+ "ocramius/proxy-manager": "~0.4|~1.0|~2.0",
+ "php": ">=5.3.9",
+ "symfony/dependency-injection": "~2.8|~3.0.0"
+ },
+ "require-dev": {
+ "symfony/config": "~2.3|~3.0.0"
+ },
+ "type": "symfony-bridge",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.8-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Bridge\\ProxyManager\\": ""
+ },
+ "exclude-from-classmap": [
+ "/Tests/"
+ ]
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony ProxyManager Bridge",
+ "homepage": "https://symfony.com",
+ "time": "2016-03-04 07:54:35"
},
{
"name": "symfony/routing",
- "version": "v2.8.2",
+ "version": "v2.8.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/routing.git",
- "reference": "5451a8a1874fd4e6a4dd347ea611d86cd8441735"
+ "reference": "ae38e64bae52753c0f4a1a6583f5ba9bb2b742ab"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/routing/zipball/5451a8a1874fd4e6a4dd347ea611d86cd8441735",
- "reference": "5451a8a1874fd4e6a4dd347ea611d86cd8441735",
+ "url": "https://api.github.com/repos/symfony/routing/zipball/ae38e64bae52753c0f4a1a6583f5ba9bb2b742ab",
+ "reference": "ae38e64bae52753c0f4a1a6583f5ba9bb2b742ab",
"shasum": ""
},
"require": {
@@ -1372,6 +1492,7 @@
"symfony/config": "For using the all-in-one router or any loader",
"symfony/dependency-injection": "For loading routes from a service",
"symfony/expression-language": "For using expression matching",
+ "symfony/http-foundation": "For using a Symfony Request object",
"symfony/yaml": "For using the YAML loader"
},
"type": "library",
@@ -1410,20 +1531,20 @@
"uri",
"url"
],
- "time": "2016-01-11 16:43:36"
+ "time": "2016-02-04 13:53:00"
},
{
"name": "symfony/twig-bridge",
- "version": "v2.8.2",
+ "version": "v2.8.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/twig-bridge.git",
- "reference": "e33b512de4b769a1c728cd6775e22668ae89fca9"
+ "reference": "ba898e4714734948dc00c4d776e1d6be165ff8c4"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/e33b512de4b769a1c728cd6775e22668ae89fca9",
- "reference": "e33b512de4b769a1c728cd6775e22668ae89fca9",
+ "url": "https://api.github.com/repos/symfony/twig-bridge/zipball/ba898e4714734948dc00c4d776e1d6be165ff8c4",
+ "reference": "ba898e4714734948dc00c4d776e1d6be165ff8c4",
"shasum": ""
},
"require": {
@@ -1491,20 +1612,20 @@
],
"description": "Symfony Twig Bridge",
"homepage": "https://symfony.com",
- "time": "2016-01-12 17:46:01"
+ "time": "2016-02-22 15:02:30"
},
{
"name": "symfony/yaml",
- "version": "v2.8.2",
+ "version": "v2.8.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
- "reference": "34c8a4b51e751e7ea869b8262f883d008a2b81b8"
+ "reference": "2a4ee40acb880c56f29fb1b8886e7ffe94f3b995"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/yaml/zipball/34c8a4b51e751e7ea869b8262f883d008a2b81b8",
- "reference": "34c8a4b51e751e7ea869b8262f883d008a2b81b8",
+ "url": "https://api.github.com/repos/symfony/yaml/zipball/2a4ee40acb880c56f29fb1b8886e7ffe94f3b995",
+ "reference": "2a4ee40acb880c56f29fb1b8886e7ffe94f3b995",
"shasum": ""
},
"require": {
@@ -1540,20 +1661,20 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
- "time": "2016-01-13 10:28:07"
+ "time": "2016-02-23 07:41:20"
},
{
"name": "twig/twig",
- "version": "v1.23.3",
+ "version": "v1.24.0",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
- "reference": "ae53fc2c312fdee63773b75cb570304f85388b08"
+ "reference": "3e5aa30ebfbafd5951fb1b01e338e1800ce7e0e8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/twigphp/Twig/zipball/ae53fc2c312fdee63773b75cb570304f85388b08",
- "reference": "ae53fc2c312fdee63773b75cb570304f85388b08",
+ "url": "https://api.github.com/repos/twigphp/Twig/zipball/3e5aa30ebfbafd5951fb1b01e338e1800ce7e0e8",
+ "reference": "3e5aa30ebfbafd5951fb1b01e338e1800ce7e0e8",
"shasum": ""
},
"require": {
@@ -1566,7 +1687,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.23-dev"
+ "dev-master": "1.24-dev"
}
},
"autoload": {
@@ -1601,7 +1722,161 @@
"keywords": [
"templating"
],
- "time": "2016-01-11 14:02:19"
+ "time": "2016-01-25 21:22:18"
+ },
+ {
+ "name": "zendframework/zend-code",
+ "version": "2.5.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/zendframework/zend-code.git",
+ "reference": "5d998f261ec2a55171c71da57a11622745680153"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/zendframework/zend-code/zipball/5d998f261ec2a55171c71da57a11622745680153",
+ "reference": "5d998f261ec2a55171c71da57a11622745680153",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.23",
+ "zendframework/zend-eventmanager": "~2.5"
+ },
+ "require-dev": {
+ "doctrine/common": ">=2.1",
+ "fabpot/php-cs-fixer": "1.7.*",
+ "phpunit/phpunit": "~4.0",
+ "zendframework/zend-stdlib": "~2.5",
+ "zendframework/zend-version": "~2.5"
+ },
+ "suggest": {
+ "doctrine/common": "Doctrine\\Common >=2.1 for annotation features",
+ "zendframework/zend-stdlib": "Zend\\Stdlib component"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.5-dev",
+ "dev-develop": "2.6-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Zend\\Code\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "description": "provides facilities to generate arbitrary code using an object oriented interface",
+ "homepage": "https://github.com/zendframework/zend-code",
+ "keywords": [
+ "code",
+ "zf2"
+ ],
+ "time": "2015-06-03 15:31:59"
+ },
+ {
+ "name": "zendframework/zend-eventmanager",
+ "version": "2.5.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/zendframework/zend-eventmanager.git",
+ "reference": "d94a16039144936f107f906896349900fd634443"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/zendframework/zend-eventmanager/zipball/d94a16039144936f107f906896349900fd634443",
+ "reference": "d94a16039144936f107f906896349900fd634443",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.23",
+ "zendframework/zend-stdlib": "~2.5"
+ },
+ "require-dev": {
+ "fabpot/php-cs-fixer": "1.7.*",
+ "phpunit/phpunit": "~4.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.5-dev",
+ "dev-develop": "2.6-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Zend\\EventManager\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "homepage": "https://github.com/zendframework/zend-eventmanager",
+ "keywords": [
+ "eventmanager",
+ "zf2"
+ ],
+ "time": "2015-06-03 15:32:01"
+ },
+ {
+ "name": "zendframework/zend-stdlib",
+ "version": "2.5.1",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/zendframework/zend-stdlib.git",
+ "reference": "cc8e90a60dd5d44b9730b77d07b97550091da1ae"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/zendframework/zend-stdlib/zipball/cc8e90a60dd5d44b9730b77d07b97550091da1ae",
+ "reference": "cc8e90a60dd5d44b9730b77d07b97550091da1ae",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.23"
+ },
+ "require-dev": {
+ "fabpot/php-cs-fixer": "1.7.*",
+ "phpunit/phpunit": "~4.0",
+ "zendframework/zend-config": "~2.5",
+ "zendframework/zend-eventmanager": "~2.5",
+ "zendframework/zend-filter": "~2.5",
+ "zendframework/zend-inputfilter": "~2.5",
+ "zendframework/zend-serializer": "~2.5",
+ "zendframework/zend-servicemanager": "~2.5"
+ },
+ "suggest": {
+ "zendframework/zend-eventmanager": "To support aggregate hydrator usage",
+ "zendframework/zend-filter": "To support naming strategy hydrator usage",
+ "zendframework/zend-serializer": "Zend\\Serializer component",
+ "zendframework/zend-servicemanager": "To support hydrator plugin manager usage"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.5-dev",
+ "dev-develop": "2.6-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Zend\\Stdlib\\": "src/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "BSD-3-Clause"
+ ],
+ "homepage": "https://github.com/zendframework/zend-stdlib",
+ "keywords": [
+ "stdlib",
+ "zf2"
+ ],
+ "time": "2015-06-03 15:32:03"
}
],
"packages-dev": [
@@ -2496,16 +2771,16 @@
},
{
"name": "sebastian/environment",
- "version": "1.3.3",
+ "version": "1.3.5",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/environment.git",
- "reference": "6e7133793a8e5a5714a551a8324337374be209df"
+ "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6e7133793a8e5a5714a551a8324337374be209df",
- "reference": "6e7133793a8e5a5714a551a8324337374be209df",
+ "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf",
+ "reference": "dc7a29032cf72b54f36dac15a1ca5b3a1b6029bf",
"shasum": ""
},
"require": {
@@ -2542,7 +2817,7 @@
"environment",
"hhvm"
],
- "time": "2015-12-02 08:37:27"
+ "time": "2016-02-26 18:40:46"
},
{
"name": "sebastian/exporter",
@@ -2700,16 +2975,16 @@
},
{
"name": "squizlabs/php_codesniffer",
- "version": "2.5.0",
+ "version": "2.5.1",
"source": {
"type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
- "reference": "e4fb41d5d0387d556e2c25534d630b3cce90ea67"
+ "reference": "6731851d6aaf1d0d6c58feff1065227b7fda3ba8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/e4fb41d5d0387d556e2c25534d630b3cce90ea67",
- "reference": "e4fb41d5d0387d556e2c25534d630b3cce90ea67",
+ "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/6731851d6aaf1d0d6c58feff1065227b7fda3ba8",
+ "reference": "6731851d6aaf1d0d6c58feff1065227b7fda3ba8",
"shasum": ""
},
"require": {
@@ -2727,7 +3002,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.0.x-dev"
+ "dev-master": "2.x-dev"
}
},
"autoload": {
@@ -2773,20 +3048,20 @@
"phpcs",
"standards"
],
- "time": "2015-12-11 00:12:46"
+ "time": "2016-01-19 23:39:10"
},
{
"name": "symfony/browser-kit",
- "version": "v2.8.2",
+ "version": "v2.8.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/browser-kit.git",
- "reference": "a93dffaf763182acad12a4c42c7efc372899891e"
+ "reference": "6b2085020b4e86fcb7ae44c3ab8ddb91774b33d2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/browser-kit/zipball/a93dffaf763182acad12a4c42c7efc372899891e",
- "reference": "a93dffaf763182acad12a4c42c7efc372899891e",
+ "url": "https://api.github.com/repos/symfony/browser-kit/zipball/6b2085020b4e86fcb7ae44c3ab8ddb91774b33d2",
+ "reference": "6b2085020b4e86fcb7ae44c3ab8ddb91774b33d2",
"shasum": ""
},
"require": {
@@ -2830,20 +3105,20 @@
],
"description": "Symfony BrowserKit Component",
"homepage": "https://symfony.com",
- "time": "2016-01-12 17:46:01"
+ "time": "2016-01-27 11:34:40"
},
{
"name": "symfony/css-selector",
- "version": "v2.8.2",
+ "version": "v2.8.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
- "reference": "ac06d8173bd80790536c0a4a634a7d705b91f54f"
+ "reference": "8d83ff9777cdbd83e7f90d9c48f4729823791a5e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/css-selector/zipball/ac06d8173bd80790536c0a4a634a7d705b91f54f",
- "reference": "ac06d8173bd80790536c0a4a634a7d705b91f54f",
+ "url": "https://api.github.com/repos/symfony/css-selector/zipball/8d83ff9777cdbd83e7f90d9c48f4729823791a5e",
+ "reference": "8d83ff9777cdbd83e7f90d9c48f4729823791a5e",
"shasum": ""
},
"require": {
@@ -2883,20 +3158,20 @@
],
"description": "Symfony CssSelector Component",
"homepage": "https://symfony.com",
- "time": "2016-01-03 15:33:41"
+ "time": "2016-01-27 05:14:19"
},
{
"name": "symfony/dom-crawler",
- "version": "v2.8.2",
+ "version": "v2.8.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/dom-crawler.git",
- "reference": "650d37aacb1fa0dcc24cced483169852b3a0594e"
+ "reference": "e1a4b4c83f5ee6f5902f1d53035e3718909a0c11"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/650d37aacb1fa0dcc24cced483169852b3a0594e",
- "reference": "650d37aacb1fa0dcc24cced483169852b3a0594e",
+ "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/e1a4b4c83f5ee6f5902f1d53035e3718909a0c11",
+ "reference": "e1a4b4c83f5ee6f5902f1d53035e3718909a0c11",
"shasum": ""
},
"require": {
@@ -2939,20 +3214,20 @@
],
"description": "Symfony DomCrawler Component",
"homepage": "https://symfony.com",
- "time": "2016-01-03 15:33:41"
+ "time": "2016-02-28 16:20:50"
},
{
"name": "symfony/process",
- "version": "v2.8.2",
+ "version": "v2.8.3",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
- "reference": "6f1979c3b0f4c22c77a8a8971afaa7dd07f082ac"
+ "reference": "7dedd5b60550f33dca16dd7e94ef8aca8b67bbfe"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/process/zipball/6f1979c3b0f4c22c77a8a8971afaa7dd07f082ac",
- "reference": "6f1979c3b0f4c22c77a8a8971afaa7dd07f082ac",
+ "url": "https://api.github.com/repos/symfony/process/zipball/7dedd5b60550f33dca16dd7e94ef8aca8b67bbfe",
+ "reference": "7dedd5b60550f33dca16dd7e94ef8aca8b67bbfe",
"shasum": ""
},
"require": {
@@ -2988,7 +3263,7 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
- "time": "2016-01-06 09:59:23"
+ "time": "2016-02-02 13:33:15"
}
],
"aliases": [],
@@ -2999,5 +3274,8 @@
"platform": {
"php": ">=5.4,<7.1"
},
- "platform-dev": []
+ "platform-dev": [],
+ "platform-overrides": {
+ "php": "5.4"
+ }
}
diff --git a/phpBB/config/default/container/services.yml b/phpBB/config/default/container/services.yml
index f5f85fbcad..2ccda6a38e 100644
--- a/phpBB/config/default/container/services.yml
+++ b/phpBB/config/default/container/services.yml
@@ -161,7 +161,7 @@ services:
version_helper:
class: phpbb\version_helper
- scope: prototype
+ shared: false
arguments:
- '@cache'
- '@config'
diff --git a/phpBB/config/default/container/services_attachment.yml b/phpBB/config/default/container/services_attachment.yml
index f448367473..c56ced21f4 100644
--- a/phpBB/config/default/container/services_attachment.yml
+++ b/phpBB/config/default/container/services_attachment.yml
@@ -1,7 +1,7 @@
services:
attachment.delete:
class: phpbb\attachment\delete
- scope: prototype
+ shared: false
arguments:
- '@config'
- '@dbal.conn'
@@ -12,7 +12,7 @@ services:
attachment.manager:
class: phpbb\attachment\manager
- scope: prototype
+ shared: false
arguments:
- '@attachment.delete'
- '@attachment.resync'
@@ -20,13 +20,13 @@ services:
attachment.resync:
class: phpbb\attachment\resync
- scope: prototype
+ shared: false
arguments:
- '@dbal.conn'
attachment.upload:
class: phpbb\attachment\upload
- scope: prototype
+ shared: false
arguments:
- '@auth'
- '@cache'
diff --git a/phpBB/config/default/container/services_captcha.yml b/phpBB/config/default/container/services_captcha.yml
index a1d063ada8..e462c43bb8 100644
--- a/phpBB/config/default/container/services_captcha.yml
+++ b/phpBB/config/default/container/services_captcha.yml
@@ -6,7 +6,7 @@ services:
- '@captcha.plugins.service_collection'
# ----- Captcha plugins -----
-# Scope MUST be prototype for all the plugins to work.
+# Service MUST NOT be shared for all the plugins to work.
captcha.plugins.service_collection:
class: phpbb\di\service_collection
arguments:
@@ -16,7 +16,7 @@ services:
core.captcha.plugins.gd:
class: phpbb\captcha\plugins\gd
- scope: prototype
+ shared: false
calls:
- [set_name, [core.captcha.plugins.gd]]
tags:
@@ -24,7 +24,7 @@ services:
core.captcha.plugins.gd_wave:
class: phpbb\captcha\plugins\gd_wave
- scope: prototype
+ shared: false
calls:
- [set_name, [core.captcha.plugins.gd_wave]]
tags:
@@ -32,7 +32,7 @@ services:
core.captcha.plugins.nogd:
class: phpbb\captcha\plugins\nogd
- scope: prototype
+ shared: false
calls:
- [set_name, [core.captcha.plugins.nogd]]
tags:
@@ -40,7 +40,7 @@ services:
core.captcha.plugins.qa:
class: phpbb\captcha\plugins\qa
- scope: prototype
+ shared: false
arguments:
- '%tables.captcha_qa_questions%'
- '%tables.captcha_qa_answers%'
@@ -52,7 +52,7 @@ services:
core.captcha.plugins.recaptcha:
class: phpbb\captcha\plugins\recaptcha
- scope: prototype
+ shared: false
calls:
- [set_name, [core.captcha.plugins.recaptcha]]
tags:
diff --git a/phpBB/config/default/container/services_console.yml b/phpBB/config/default/container/services_console.yml
index 2055fb68c5..3f27ee666a 100644
--- a/phpBB/config/default/container/services_console.yml
+++ b/phpBB/config/default/container/services_console.yml
@@ -219,3 +219,53 @@ services:
- '@user'
tags:
- { name: console.command }
+
+ console.command.user.activate:
+ class: phpbb\console\command\user\activate
+ arguments:
+ - '@user'
+ - '@dbal.conn'
+ - '@config'
+ - '@language'
+ - '@log'
+ - '@notification_manager'
+ - '@user_loader'
+ - '%core.root_path%'
+ - '%core.php_ext%'
+ tags:
+ - { name: console.command }
+
+ console.command.user.add:
+ class: phpbb\console\command\user\add
+ arguments:
+ - '@user'
+ - '@dbal.conn'
+ - '@config'
+ - '@language'
+ - '@passwords.manager'
+ - '%core.root_path%'
+ - '%core.php_ext%'
+ tags:
+ - { name: console.command }
+
+ console.command.user.delete:
+ class: phpbb\console\command\user\delete
+ arguments:
+ - '@user'
+ - '@dbal.conn'
+ - '@language'
+ - '@log'
+ - '@user_loader'
+ - '%core.root_path%'
+ - '%core.php_ext%'
+ tags:
+ - { name: console.command }
+
+ console.command.user.reclean:
+ class: phpbb\console\command\user\reclean
+ arguments:
+ - '@user'
+ - '@dbal.conn'
+ - '@language'
+ tags:
+ - { name: console.command }
diff --git a/phpBB/config/default/container/services_cron.yml b/phpBB/config/default/container/services_cron.yml
index dd3982a659..0b95a96190 100644
--- a/phpBB/config/default/container/services_cron.yml
+++ b/phpBB/config/default/container/services_cron.yml
@@ -75,6 +75,7 @@ services:
- '%core.root_path%'
- '%core.php_ext%'
- '@config'
+ - '%core.cache_dir%'
calls:
- [set_name, [cron.task.core.queue]]
tags:
diff --git a/phpBB/config/default/container/services_db.yml b/phpBB/config/default/container/services_db.yml
index 20b3426e7e..30c5a7fc7f 100644
--- a/phpBB/config/default/container/services_db.yml
+++ b/phpBB/config/default/container/services_db.yml
@@ -31,10 +31,10 @@ services:
factory: ['@dbal.extractor.factory', get]
# ----- DB Extractors for different drivers -----
-# Scope MUST be prototype for all the handlers to work correctly.
+# Service MUST NOT be shared for all the handlers to work correctly.
dbal.extractor.extractors.mssql_extractor:
class: phpbb\db\extractor\mssql_extractor
- scope: prototype
+ shared: false
arguments:
- '%core.root_path%'
- '@request'
@@ -42,7 +42,7 @@ services:
dbal.extractor.extractors.mysql_extractor:
class: phpbb\db\extractor\mysql_extractor
- scope: prototype
+ shared: false
arguments:
- '%core.root_path%'
- '@request'
@@ -50,7 +50,7 @@ services:
dbal.extractor.extractors.oracle_extractor:
class: phpbb\db\extractor\oracle_extractor
- scope: prototype
+ shared: false
arguments:
- '%core.root_path%'
- '@request'
@@ -58,7 +58,7 @@ services:
dbal.extractor.extractors.postgres_extractor:
class: phpbb\db\extractor\postgres_extractor
- scope: prototype
+ shared: false
arguments:
- '%core.root_path%'
- '@request'
@@ -66,7 +66,7 @@ services:
dbal.extractor.extractors.sqlite3_extractor:
class: phpbb\db\extractor\sqlite3_extractor
- scope: prototype
+ shared: false
arguments:
- '%core.root_path%'
- '@request'
@@ -74,7 +74,7 @@ services:
dbal.extractor.extractors.sqlite_extractor:
class: phpbb\db\extractor\sqlite_extractor
- scope: prototype
+ shared: false
arguments:
- '%core.root_path%'
- '@request'
diff --git a/phpBB/config/default/container/services_feed.yml b/phpBB/config/default/container/services_feed.yml
index 443016160b..bec8649672 100644
--- a/phpBB/config/default/container/services_feed.yml
+++ b/phpBB/config/default/container/services_feed.yml
@@ -23,7 +23,7 @@ services:
feed.forum:
class: phpbb\feed\forum
- scope: prototype
+ shared: false
arguments:
- '@feed.helper'
- '@config'
@@ -36,7 +36,7 @@ services:
feed.forums:
class: phpbb\feed\forums
- scope: prototype
+ shared: false
arguments:
- '@feed.helper'
- '@config'
@@ -49,7 +49,7 @@ services:
feed.news:
class: phpbb\feed\news
- scope: prototype
+ shared: false
arguments:
- '@feed.helper'
- '@config'
@@ -62,7 +62,7 @@ services:
feed.overall:
class: phpbb\feed\overall
- scope: prototype
+ shared: false
arguments:
- '@feed.helper'
- '@config'
@@ -75,7 +75,7 @@ services:
feed.topic:
class: phpbb\feed\topic
- scope: prototype
+ shared: false
arguments:
- '@feed.helper'
- '@config'
@@ -88,7 +88,7 @@ services:
feed.topics:
class: phpbb\feed\topics
- scope: prototype
+ shared: false
arguments:
- '@feed.helper'
- '@config'
@@ -101,7 +101,7 @@ services:
feed.topics_active:
class: phpbb\feed\topics_active
- scope: prototype
+ shared: false
arguments:
- '@feed.helper'
- '@config'
diff --git a/phpBB/config/default/container/services_files.yml b/phpBB/config/default/container/services_files.yml
index 88414d89a9..cf51ebdab8 100644
--- a/phpBB/config/default/container/services_files.yml
+++ b/phpBB/config/default/container/services_files.yml
@@ -6,7 +6,7 @@ services:
files.filespec:
class: phpbb\files\filespec
- scope: prototype
+ shared: false
arguments:
- '@filesystem'
- '@language'
@@ -18,7 +18,7 @@ services:
files.upload:
class: phpbb\files\upload
- scope: prototype
+ shared: false
arguments:
- '@filesystem'
- '@files.factory'
@@ -28,7 +28,7 @@ services:
files.types.form:
class: phpbb\files\types\form
- scope: prototype
+ shared: false
arguments:
- '@files.factory'
- '@language'
@@ -38,7 +38,7 @@ services:
files.types.local:
class: phpbb\files\types\form
- scope: prototype
+ shared: false
arguments:
- '@files.factory'
- '@language'
@@ -47,7 +47,7 @@ services:
files.types.remote:
class: phpbb\files\types\remote
- scope: prototype
+ shared: false
arguments:
- '@config'
- '@files.factory'
diff --git a/phpBB/config/default/container/services_notification.yml b/phpBB/config/default/container/services_notification.yml
index 0cf64f7f24..6c3cea3dbc 100644
--- a/phpBB/config/default/container/services_notification.yml
+++ b/phpBB/config/default/container/services_notification.yml
@@ -15,7 +15,7 @@ services:
- '%tables.user_notifications%'
# ----- Notification's types -----
-# Scope MUST be prototype for all the plugins to work.
+# Service MUST NOT be shared for all the plugins to work.
notification.type_collection:
class: phpbb\di\service_collection
arguments:
@@ -36,7 +36,7 @@ services:
notification.type.admin_activate_user:
class: phpbb\notification\type\admin_activate_user
- scope: prototype
+ shared: false
parent: notification.type.base
calls:
- [set_user_loader, ['@user_loader']]
@@ -46,42 +46,42 @@ services:
notification.type.approve_post:
class: phpbb\notification\type\approve_post
- scope: prototype
+ shared: false
parent: notification.type.post
tags:
- { name: notification.type }
notification.type.approve_topic:
class: phpbb\notification\type\approve_topic
- scope: prototype
+ shared: false
parent: notification.type.topic
tags:
- { name: notification.type }
notification.type.bookmark:
class: phpbb\notification\type\bookmark
- scope: prototype
+ shared: false
parent: notification.type.post
tags:
- { name: notification.type }
notification.type.disapprove_post:
class: phpbb\notification\type\disapprove_post
- scope: prototype
+ shared: false
parent: notification.type.post
tags:
- { name: notification.type }
notification.type.disapprove_topic:
class: phpbb\notification\type\disapprove_topic
- scope: prototype
+ shared: false
parent: notification.type.topic
tags:
- { name: notification.type }
notification.type.group_request:
class: phpbb\notification\type\group_request
- scope: prototype
+ shared: false
parent: notification.type.base
calls:
- [set_user_loader, ['@user_loader']]
@@ -90,14 +90,14 @@ services:
notification.type.group_request_approved:
class: phpbb\notification\type\group_request_approved
- scope: prototype
+ shared: false
parent: notification.type.base
tags:
- { name: notification.type }
notification.type.pm:
class: phpbb\notification\type\pm
- scope: prototype
+ shared: false
parent: notification.type.base
calls:
- [set_user_loader, ['@user_loader']]
@@ -107,7 +107,7 @@ services:
notification.type.post:
class: phpbb\notification\type\post
- scope: prototype
+ shared: false
parent: notification.type.base
calls:
- [set_user_loader, ['@user_loader']]
@@ -117,14 +117,14 @@ services:
notification.type.post_in_queue:
class: phpbb\notification\type\post_in_queue
- scope: prototype
+ shared: false
parent: notification.type.post
tags:
- { name: notification.type }
notification.type.quote:
class: phpbb\notification\type\quote
- scope: prototype
+ shared: false
parent: notification.type.post
calls:
- [set_utils, ['@text_formatter.utils']]
@@ -133,35 +133,35 @@ services:
notification.type.report_pm:
class: phpbb\notification\type\report_pm
- scope: prototype
+ shared: false
parent: notification.type.pm
tags:
- { name: notification.type }
notification.type.report_pm_closed:
class: phpbb\notification\type\report_pm_closed
- scope: prototype
+ shared: false
parent: notification.type.pm
tags:
- { name: notification.type }
notification.type.report_post:
class: phpbb\notification\type\report_post
- scope: prototype
+ shared: false
parent: notification.type.post
tags:
- { name: notification.type }
notification.type.report_post_closed:
class: phpbb\notification\type\report_post_closed
- scope: prototype
+ shared: false
parent: notification.type.post
tags:
- { name: notification.type }
notification.type.topic:
class: phpbb\notification\type\topic
- scope: prototype
+ shared: false
parent: notification.type.base
calls:
- [set_user_loader, ['@user_loader']]
@@ -171,13 +171,13 @@ services:
notification.type.topic_in_queue:
class: phpbb\notification\type\topic_in_queue
- scope: prototype
+ shared: false
parent: notification.type.topic
tags:
- { name: notification.type }
# ----- Notification's methods -----
-# Scope MUST be prototype for all the plugins to work.
+# Service MUST NOT be shared for all the plugins to work.
notification.method_collection:
class: phpbb\di\service_collection
arguments:
@@ -187,7 +187,7 @@ services:
notification.method.board:
class: phpbb\notification\method\board
- scope: prototype # scope MUST be prototype for this to work!
+ shared: false
arguments:
- '@user_loader'
- '@dbal.conn'
@@ -201,7 +201,7 @@ services:
notification.method.email:
class: phpbb\notification\method\email
- scope: prototype
+ shared: false
arguments:
- '@user_loader'
- '@user'
@@ -213,7 +213,7 @@ services:
notification.method.jabber:
class: phpbb\notification\method\jabber
- scope: prototype
+ shared: false
arguments:
- '@user_loader'
- '@user'
diff --git a/phpBB/config/default/container/services_report.yml b/phpBB/config/default/container/services_report.yml
index eaaf6ae4c4..2c5b3bf3d5 100644
--- a/phpBB/config/default/container/services_report.yml
+++ b/phpBB/config/default/container/services_report.yml
@@ -29,10 +29,10 @@ services:
- '@user'
# ----- Report handlers -----
-# Scope MUST be prototype for all the handlers to work correctly.
+# Service MUST NOT be shared for all the handlers to work correctly.
phpbb.report.handlers.report_handler_pm:
class: phpbb\report\report_handler_pm
- scope: prototype
+ shared: false
arguments:
- '@dbal.conn.driver'
- '@dispatcher'
@@ -43,7 +43,7 @@ services:
phpbb.report.handlers.report_handler_post:
class: phpbb\report\report_handler_post
- scope: prototype
+ shared: false
arguments:
- '@dbal.conn.driver'
- '@dispatcher'
diff --git a/phpBB/config/default/container/services_routing.yml b/phpBB/config/default/container/services_routing.yml
index 3cb74ca2b1..3048145a2f 100644
--- a/phpBB/config/default/container/services_routing.yml
+++ b/phpBB/config/default/container/services_routing.yml
@@ -5,9 +5,8 @@ services:
- '@service_container'
- '@routing.chained_resources_locator'
- '@routing.delegated_loader'
- - '%core.root_path%'
- '%core.php_ext%'
- - '%core.environment%'
+ - '%core.cache_dir%'
router.listener:
class: Symfony\Component\HttpKernel\EventListener\RouterListener
diff --git a/phpBB/config/default/container/services_text_formatter.yml b/phpBB/config/default/container/services_text_formatter.yml
index 943a79cd65..a9f2efdb16 100644
--- a/phpBB/config/default/container/services_text_formatter.yml
+++ b/phpBB/config/default/container/services_text_formatter.yml
@@ -1,5 +1,5 @@
parameters:
- text_formatter.cache.dir: '%core.root_path%cache/%core.environment%/'
+ text_formatter.cache.dir: '%core.cache_dir%'
text_formatter.cache.parser.key: _text_formatter_parser
text_formatter.cache.renderer.key: _text_formatter_renderer
diff --git a/phpBB/config/default/container/services_twig.yml b/phpBB/config/default/container/services_twig.yml
index 2dbf444e0c..3ca6d62c07 100644
--- a/phpBB/config/default/container/services_twig.yml
+++ b/phpBB/config/default/container/services_twig.yml
@@ -1,5 +1,5 @@
parameters:
- core.template.cache_path: '%core.root_path%cache/%core.environment%/twig/'
+ core.template.cache_path: '%core.cache_dir%twig/'
services:
template.twig.environment:
@@ -8,14 +8,16 @@ services:
- '@config'
- '@filesystem'
- '@path_helper'
- - '@service_container'
- '%core.template.cache_path%'
- '@ext.manager'
- '@template.twig.loader'
- []
+ calls:
+ - [setLexer, ['@template.twig.lexer']]
template.twig.lexer:
class: phpbb\template\twig\lexer
+ lazy: true
arguments:
- '@template.twig.environment'
diff --git a/phpBB/config/installer/container/services.yml b/phpBB/config/installer/container/services.yml
index 20d790e9a6..4c3ed3bfcb 100644
--- a/phpBB/config/installer/container/services.yml
+++ b/phpBB/config/installer/container/services.yml
@@ -12,7 +12,7 @@ services:
cache.driver:
class: '%cache.driver.class%'
arguments:
- - '%core.root_path%/cache/installer/'
+ - '%core.cache_dir%'
config:
class: phpbb\config\config
@@ -81,11 +81,12 @@ services:
- '@config'
- '@filesystem'
- '@path_helper'
- - '@service_container'
- '%core.template.cache_path%'
- null
- '@template.twig.loader'
- []
+ calls:
+ - [setLexer, ['@template.twig.lexer']]
console.exception_subscriber:
class: phpbb\console\exception_subscriber
diff --git a/phpBB/config/installer/container/services_install_navigation.yml b/phpBB/config/installer/container/services_install_navigation.yml
index 4fc6abb6eb..d7151eb1c6 100644
--- a/phpBB/config/installer/container/services_install_navigation.yml
+++ b/phpBB/config/installer/container/services_install_navigation.yml
@@ -13,7 +13,7 @@ services:
installer.navigation.main_navigation:
class: phpbb\install\helper\navigation\main_navigation
- scope: prototype
+ shared: false
tags:
- { name: installer.navigation }
@@ -21,7 +21,7 @@ services:
class: phpbb\install\helper\navigation\install_navigation
arguments:
- '@installer.helper.install_helper'
- scope: prototype
+ shared: false
tags:
- { name: installer.navigation }
@@ -29,7 +29,7 @@ services:
class: phpbb\install\helper\navigation\update_navigation
arguments:
- '@installer.helper.install_helper'
- scope: prototype
+ shared: false
tags:
- { name: installer.navigation }
@@ -37,6 +37,6 @@ services:
class: phpbb\install\helper\navigation\convertor_navigation
arguments:
- '@installer.helper.install_helper'
- scope: prototype
+ shared: false
tags:
- { name: installer.navigation }
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 342b377ab3..8090290fe1 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -2,6 +2,7 @@
<html dir="ltr" lang="en">
<head>
<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="" />
<meta name="description" content="phpBB 3.1.x Changelog" />
<title>phpBB &bull; Changelog</title>
@@ -53,6 +54,7 @@
<li><a href="#v320a2">Changes since 3.2.0-a2</a></li>
<li><a href="#v320a1">Changes since 3.2.0-a1</a></li>
<li><a href="#v31x">Changes since 3.1.x</a></li>
+ <li><a href="#v318">Changes since 3.1.8</a></li>
<li><a href="#v317pl1">Changes since 3.1.7-PL1</a></li>
<li><a href="#v317">Changes since 3.1.7</a></li>
<li><a href="#v316">Changes since 3.1.6</a></li>
@@ -470,6 +472,68 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14265">PHPBB3-14265</a>] - Make all tables available in the container</li>
</ul>
+ <a name="v318"></a><h3>Changes since 3.1.8</h3>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8058">PHPBB3-8058</a>] - Default style in ACP-&gt;Board Settings not observing offset</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13028">PHPBB3-13028</a>] - &quot;View unanswered posts&quot; link should be called instead &quot;View unanswered topics&quot;</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13264">PHPBB3-13264</a>] - Editing an unapproved post as a moderator/admin approves it</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13521">PHPBB3-13521</a>] - Q&amp;A Captcha ACP, required fields error corrupts inputted data</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13630">PHPBB3-13630</a>] - NULL value parsed into $select_single can cause 403 Forbidden on certain restrictive hosting environments for &quot;Find a Member&quot; function within Private Message composition</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13681">PHPBB3-13681</a>] - Email queue shouldn't be cached by opcache</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13683">PHPBB3-13683</a>] - Controller generates urls with absolute path of phpbb's root</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13842">PHPBB3-13842</a>] - Missing rewrite module on IIS7 leads to an error</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13977">PHPBB3-13977</a>] - Fatal error entering UCP if bookmarked topic was deleted</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14132">PHPBB3-14132</a>] - SQL Error when creating a new subject on fresh installation</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14136">PHPBB3-14136</a>] - IE compatibility meta is missing in overall_header.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14241">PHPBB3-14241</a>] - Security bug into Spambot control Questions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14272">PHPBB3-14272</a>] - Use valid html5 input elements in forms</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14290">PHPBB3-14290</a>] - Function set_modified_headers() never sends 304 'Not Modified' header</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14408">PHPBB3-14408</a>] - Remove span corners</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14422">PHPBB3-14422</a>] - Support cmd+enter &amp; ctrl+enter for submitting message</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14437">PHPBB3-14437</a>] - Place Inline Images on Post get scrambled up -- not follow the order you place them in.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14443">PHPBB3-14443</a>] - jabber notification-template prefix &quot;short&quot; breaks resolution of paths in extensions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14475">PHPBB3-14475</a>] - Do not log upon automatically removing users form newly registered users group</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14481">PHPBB3-14481</a>] - phpBB does not obey HTTP_X_FORWARDED_PORT header</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14483">PHPBB3-14483</a>] - call to header(arg, arg) function sendHeaders() in Response.php causes Error 500 in app.php generated links</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14496">PHPBB3-14496</a>] - Automatic update relies on cache creating files in cache folder</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14500">PHPBB3-14500</a>] - Duplicate newversion in build.xml</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14514">PHPBB3-14514</a>] - Users get skipped in passwords_convert_p1 migration</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14519">PHPBB3-14519</a>] - Do not query database for unread notifications if all are retrieved</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14532">PHPBB3-14532</a>] - Database column default incorrectly escaped on MSSQL</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14533">PHPBB3-14533</a>] - &quot;U_NOTIFICATION_SETTINGS&quot; doesn't return the correct URL</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14536">PHPBB3-14536</a>] - Force timestamp to be integer in user::format_date()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14559">PHPBB3-14559</a>] - Attachments' behaviour in quotes</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14562">PHPBB3-14562</a>] - Extension's permissions don't have language fallback</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14570">PHPBB3-14570</a>] - Board versions for 3.2.x can be accidentally downgraded to 3.1.x</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14577">PHPBB3-14577</a>] - Stop using sizeof() inside for() loop</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10356">PHPBB3-10356</a>] - Username search should find all users for administrators instead of NORMALs and FOUNDERs only</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12305">PHPBB3-12305</a>] - Add new event core.viewforum_get_topic_id_sql to control forum topic listing</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14134">PHPBB3-14134</a>] - Send warning notification PM in user's language.</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14316">PHPBB3-14316</a>] - Add memberlist_view.html template events before/after the custom fields and zebra links</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14365">PHPBB3-14365</a>] - Add core event to the function topic_review() </li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14366">PHPBB3-14366</a>] - Add core events to the function decode_message()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14395">PHPBB3-14395</a>] - Add event core.viewtopic_add_quickmod_option_after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14471">PHPBB3-14471</a>] - Add filedata var to the core.avatar_driver_upload_move_file_before event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14486">PHPBB3-14486</a>] - Add an event and fix an event in login_box()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14508">PHPBB3-14508</a>] - Change language notice on account activation</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14540">PHPBB3-14540</a>] - Adjust class recursive_dot_prefix_filter_iterator to increase performance</li>
+ </ul>
+ <h4>New Feature</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12684">PHPBB3-12684</a>] - Add a command to add a user from the CLI</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14189">PHPBB3-14189</a>] - [PHP] - core.gen_sort_selects_after</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14538">PHPBB3-14538</a>] - Update composer dependencies</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-14565">PHPBB3-14565</a>] - Updates composer to 1.0.0-b2</li>
+ </ul>
+
<a name="v317pl1"></a><h3>Changes since 3.1.7-PL1</h3>
<h4>Bug</h4>
diff --git a/phpBB/docs/FAQ.html b/phpBB/docs/FAQ.html
index 4786d8d796..5f3a425cda 100644
--- a/phpBB/docs/FAQ.html
+++ b/phpBB/docs/FAQ.html
@@ -2,6 +2,7 @@
<html dir="ltr" lang="en">
<head>
<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="" />
<meta name="description" content="phpBB 3.1.x frequently asked questions" />
<title>phpBB &bull; FAQ</title>
diff --git a/phpBB/docs/INSTALL.html b/phpBB/docs/INSTALL.html
index 86b320d197..c0e0dce2a7 100644
--- a/phpBB/docs/INSTALL.html
+++ b/phpBB/docs/INSTALL.html
@@ -2,6 +2,7 @@
<html dir="ltr" lang="en">
<head>
<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="" />
<meta name="description" content="phpBB 3.1.x Installation, updating and conversion informations" />
<title>phpBB &bull; Install</title>
diff --git a/phpBB/docs/README.html b/phpBB/docs/README.html
index 96af78f48a..a7906ac802 100644
--- a/phpBB/docs/README.html
+++ b/phpBB/docs/README.html
@@ -2,8 +2,9 @@
<html dir="ltr" lang="en">
<head>
<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="" />
-<meta name="description" content="phpBB 3.1.x Readme" />
+<meta name="description" content="phpBB 3.2.x Readme" />
<title>phpBB &bull; Readme</title>
<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen" />
@@ -20,7 +21,7 @@
<div id="doc-description">
<a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a>
- <h1>phpBB 3.1.x Readme</h1>
+ <h1>phpBB 3.2.x Readme</h1>
<p style="display: none;"><a href="#start_here">Skip</a></p>
</div>
@@ -224,7 +225,7 @@
<div class="content">
- <p>This is a stable release of phpBB. The 3.1.x line is feature frozen, with point releases principally including fixes for bugs and security issues. Feature alterations and minor feature additions may be done if deemed absolutely required. The next major release will be phpBB 3.2 which is currently under development. Please do not post questions asking when 3.2 will be available, no release date has been set.</p>
+ <p>This is a stable release of phpBB. The 3.2.x line is feature frozen, with point releases principally including fixes for bugs and security issues. Feature alterations and minor feature additions may be done if deemed absolutely required. The next major release will be phpBB 3.3 which is currently under development. Please do not post questions asking when 3.3 will be available, no release date has been set.</p>
<p>Those interested in the development of phpBB should keep an eye on the development forums to see how things are progressing:</p>
diff --git a/phpBB/docs/auth_api.html b/phpBB/docs/auth_api.html
index 27d090c296..960fa76417 100644
--- a/phpBB/docs/auth_api.html
+++ b/phpBB/docs/auth_api.html
@@ -2,6 +2,7 @@
<html dir="ltr" lang="en">
<head>
<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="" />
<meta name="description" content="This is an explanation of how to use the phpBB auth/acl API" />
<title>phpBB3 &bull; Auth API</title>
diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html
index 26189235ef..eb0fb60de2 100644
--- a/phpBB/docs/coding-guidelines.html
+++ b/phpBB/docs/coding-guidelines.html
@@ -2,6 +2,7 @@
<html dir="ltr" lang="en">
<head>
<meta charset="utf-8">
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="keywords" content="" />
<meta name="description" content="Ascraeus coding guidelines document" />
<title>phpBB3 &bull; Coding Guidelines</title>
diff --git a/phpBB/docs/nginx.sample.conf b/phpBB/docs/nginx.sample.conf
index 2ead3552fd..c415720e9c 100644
--- a/phpBB/docs/nginx.sample.conf
+++ b/phpBB/docs/nginx.sample.conf
@@ -62,7 +62,7 @@ http {
root /path/to/phpbb;
location / {
- # phpbb uses index.htm
+ # phpBB uses index.htm
index index.php index.html index.htm;
try_files $uri $uri/ @rewriteapp;
}
@@ -92,6 +92,29 @@ http {
fastcgi_pass php;
}
+ # Correctly pass scripts for installer
+ location /install/ {
+ # phpBB uses index.htm
+ try_files $uri $uri/ @rewrite_installapp;
+
+ # Pass the php scripts to fastcgi server specified in upstream declaration.
+ location ~ \.php(/|$) {
+ # Unmodified fastcgi_params from nginx distribution.
+ include fastcgi_params;
+ # Necessary for php.
+ fastcgi_split_path_info ^(.+\.php)(/.*)$;
+ fastcgi_param PATH_INFO $fastcgi_path_info;
+ fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
+ fastcgi_param DOCUMENT_ROOT $realpath_root;
+ try_files $uri $uri/ /install/app.php$is_args$args;
+ fastcgi_pass php;
+ }
+ }
+
+ location @rewrite_installapp {
+ rewrite ^(.*)$ /install/app.php/$1 last;
+ }
+
# Deny access to version control system directories.
location ~ /\.svn|/\.git {
deny all;
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php
index 6e9360f599..07ec6713a0 100644
--- a/phpBB/includes/acp/acp_attachments.php
+++ b/phpBB/includes/acp/acp_attachments.php
@@ -1431,7 +1431,7 @@ class acp_attachments
$row['group_name'] = $user->lang['NOT_ASSIGNED'];
$group_name[] = $row;
- for ($i = 0; $i < sizeof($group_name); $i++)
+ for ($i = 0, $groups_size = sizeof($group_name); $i < $groups_size; $i++)
{
if ($default_group === false)
{
@@ -1744,8 +1744,8 @@ class acp_attachments
$size_var = $filesize['si_identifier'];
$value = $filesize['value'];
- // size="8" and maxlength="15" attributes as a fallback for browsers that do not support type="number" yet.
- return '<input type="number" id="' . $key . '" size="8" maxlength="15" min="0" name="config[' . $key . ']" value="' . $value . '" /> <select name="' . $key . '">' . size_select_options($size_var) . '</select>';
+ // size and maxlength must not be specified for input of type number
+ return '<input type="number" id="' . $key . '" min="0" max="999999999999999" step="any" name="config[' . $key . ']" value="' . $value . '" /> <select name="' . $key . '">' . size_select_options($size_var) . '</select>';
}
/**
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 9d65c48bed..f08f5356c8 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -868,7 +868,7 @@ class acp_board
{
global $user;
- return '<input id="' . $key . '" type="number" size="3" maxlength="3" min="1" max="999" name="config[min_name_chars]" value="' . $value . '" /> ' . $user->lang['MIN_CHARS'] . '&nbsp;&nbsp;<input type="number" size="3" maxlength="3" min="8" max="180" name="config[max_name_chars]" value="' . $this->new_config['max_name_chars'] . '" /> ' . $user->lang['MAX_CHARS'];
+ return '<input id="' . $key . '" type="number" min="1" max="999" name="config[min_name_chars]" value="' . $value . '" /> ' . $user->lang['MIN_CHARS'] . '&nbsp;&nbsp;<input type="number" min="8" max="180" name="config[max_name_chars]" value="' . $this->new_config['max_name_chars'] . '" /> ' . $user->lang['MAX_CHARS'];
}
/**
@@ -896,7 +896,7 @@ class acp_board
{
global $user;
- return '<input id="' . $key . '" type="number" size="3" maxlength="3" min="1" max="999" name="config[min_pass_chars]" value="' . $value . '" /> ' . $user->lang['MIN_CHARS'] . '&nbsp;&nbsp;<input type="number" size="3" maxlength="3" min="8" max="255" name="config[max_pass_chars]" value="' . $this->new_config['max_pass_chars'] . '" /> ' . $user->lang['MAX_CHARS'];
+ return '<input id="' . $key . '" type="number" min="1" max="999" name="config[min_pass_chars]" value="' . $value . '" /> ' . $user->lang['MIN_CHARS'] . '&nbsp;&nbsp;<input type="number" min="8" max="255" name="config[max_pass_chars]" value="' . $this->new_config['max_pass_chars'] . '" /> ' . $user->lang['MAX_CHARS'];
}
/**
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index c5d2d0ea09..3ea9d81887 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -1420,7 +1420,7 @@ class acp_forums
$diff = sizeof($moved_forums) * 2;
$moved_ids = array();
- for ($i = 0; $i < sizeof($moved_forums); ++$i)
+ for ($i = 0, $size = sizeof($moved_forums); $i < $size; ++$i)
{
$moved_ids[] = $moved_forums[$i]['forum_id'];
}
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php
index ba39a1a60c..6bd3e71c2e 100644
--- a/phpBB/includes/acp/acp_groups.php
+++ b/phpBB/includes/acp/acp_groups.php
@@ -325,10 +325,11 @@ class acp_groups
$avatar_data = null;
$avatar_error = array();
+ /** @var \phpbb\avatar\manager $phpbb_avatar_manager */
+ $phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
+
if ($config['allow_avatar'])
{
- /* @var $phpbb_avatar_manager \phpbb\avatar\manager */
- $phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
$avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers();
// This is normalised data, without the group_ prefix
@@ -669,6 +670,14 @@ class acp_groups
$avatars_enabled = false;
$selected_driver = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', $avatar_data['avatar_type']));
+ // Assign min and max values before generating avatar driver html
+ $template->assign_vars(array(
+ 'AVATAR_MIN_WIDTH' => $config['avatar_min_width'],
+ 'AVATAR_MAX_WIDTH' => $config['avatar_max_width'],
+ 'AVATAR_MIN_HEIGHT' => $config['avatar_min_height'],
+ 'AVATAR_MAX_HEIGHT' => $config['avatar_max_height'],
+ ));
+
foreach ($avatar_drivers as $current_driver)
{
$driver = $phpbb_avatar_manager->get_driver($current_driver);
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 0ee6452ada..5091fcae7e 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -1838,11 +1838,11 @@ class acp_users
case 'avatar':
$avatars_enabled = false;
+ /** @var \phpbb\avatar\manager $phpbb_avatar_manager */
+ $phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
if ($config['allow_avatar'])
{
- /* @var $phpbb_avatar_manager \phpbb\avatar\manager */
- $phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
$avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers();
// This is normalised data, without the user_ prefix
@@ -1903,6 +1903,14 @@ class acp_users
$selected_driver = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', $user_row['user_avatar_type']));
+ // Assign min and max values before generating avatar driver html
+ $template->assign_vars(array(
+ 'AVATAR_MIN_WIDTH' => $config['avatar_min_width'],
+ 'AVATAR_MAX_WIDTH' => $config['avatar_max_width'],
+ 'AVATAR_MIN_HEIGHT' => $config['avatar_min_height'],
+ 'AVATAR_MAX_HEIGHT' => $config['avatar_max_height'],
+ ));
+
foreach ($avatar_drivers as $current_driver)
{
$driver = $phpbb_avatar_manager->get_driver($current_driver);
@@ -2073,7 +2081,10 @@ class acp_users
// Replace "error" strings with their real, localised form
$error = array_map(array($user, 'lang'), $error);
- $decoded_message = generate_text_for_edit($signature, $bbcode_uid, $bbcode_bitfield);
+ if ($request->is_set_post('preview'))
+ {
+ $decoded_message = generate_text_for_edit($signature, $bbcode_uid, $bbcode_bitfield);
+ }
/** @var \phpbb\controller\helper $controller_helper */
$controller_helper = $phpbb_container->get('controller.helper');
diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php
index eb6133d013..e8492a82a3 100644
--- a/phpBB/includes/bbcode.php
+++ b/phpBB/includes/bbcode.php
@@ -154,14 +154,13 @@ class bbcode
$phpbb_container->get('config'),
$phpbb_container->get('filesystem'),
$phpbb_container->get('path_helper'),
- $phpbb_container,
- $phpbb_container->getParameter('core.root_path') . 'cache/',
+ $phpbb_container->getParameter('core.cache_dir'),
$phpbb_container->get('ext.manager'),
new \phpbb\template\twig\loader(
$phpbb_filesystem
)
),
- $phpbb_container->getParameter('core.root_path') . 'cache/',
+ $phpbb_container->getParameter('core.cache_dir'),
$phpbb_container->get('user'),
$phpbb_container->get('template.twig.extensions.collection'),
$phpbb_extension_manager
@@ -219,20 +218,25 @@ class bbcode
{
switch ($bbcode_id)
{
- case 0:
+ case BBCODE_ID_QUOTE:
$this->bbcode_cache[$bbcode_id] = array(
'str' => array(
'[/quote:$uid]' => $this->bbcode_tpl('quote_close', $bbcode_id)
),
'preg' => array(
'#\[quote(?:=&quot;(.*?)&quot;)?:$uid\]((?!\[quote(?:=&quot;.*?&quot;)?:$uid\]).)?#is' => function ($match) {
+ if (!isset($match[2]))
+ {
+ $match[2] = '';
+ }
+
return $this->bbcode_second_pass_quote($match[1], $match[2]);
},
)
);
break;
- case 1:
+ case BBCODE_ID_B:
$this->bbcode_cache[$bbcode_id] = array(
'str' => array(
'[b:$uid]' => $this->bbcode_tpl('b_open', $bbcode_id),
@@ -241,7 +245,7 @@ class bbcode
);
break;
- case 2:
+ case BBCODE_ID_I:
$this->bbcode_cache[$bbcode_id] = array(
'str' => array(
'[i:$uid]' => $this->bbcode_tpl('i_open', $bbcode_id),
@@ -250,7 +254,7 @@ class bbcode
);
break;
- case 3:
+ case BBCODE_ID_URL:
$this->bbcode_cache[$bbcode_id] = array(
'preg' => array(
'#\[url:$uid\]((.*?))\[/url:$uid\]#s' => $this->bbcode_tpl('url', $bbcode_id),
@@ -259,7 +263,7 @@ class bbcode
);
break;
- case 4:
+ case BBCODE_ID_IMG:
if ($user->optionget('viewimg'))
{
$this->bbcode_cache[$bbcode_id] = array(
@@ -278,7 +282,7 @@ class bbcode
}
break;
- case 5:
+ case BBCODE_ID_SIZE:
$this->bbcode_cache[$bbcode_id] = array(
'preg' => array(
'#\[size=([\-\+]?\d+):$uid\](.*?)\[/size:$uid\]#s' => $this->bbcode_tpl('size', $bbcode_id),
@@ -286,7 +290,7 @@ class bbcode
);
break;
- case 6:
+ case BBCODE_ID_COLOR:
$this->bbcode_cache[$bbcode_id] = array(
'preg' => array(
'!\[color=(#[0-9a-f]{3}|#[0-9a-f]{6}|[a-z\-]+):$uid\](.*?)\[/color:$uid\]!is' => $this->bbcode_tpl('color', $bbcode_id),
@@ -294,7 +298,7 @@ class bbcode
);
break;
- case 7:
+ case BBCODE_ID_U:
$this->bbcode_cache[$bbcode_id] = array(
'str' => array(
'[u:$uid]' => $this->bbcode_tpl('u_open', $bbcode_id),
@@ -303,7 +307,7 @@ class bbcode
);
break;
- case 8:
+ case BBCODE_ID_CODE:
$this->bbcode_cache[$bbcode_id] = array(
'preg' => array(
'#\[code(?:=([a-z]+))?:$uid\](.*?)\[/code:$uid\]#is' => function ($match) {
@@ -313,7 +317,7 @@ class bbcode
);
break;
- case 9:
+ case BBCODE_ID_LIST:
$this->bbcode_cache[$bbcode_id] = array(
'preg' => array(
'#(\[\/?(list|\*):[mou]?:?$uid\])[\n]{1}#' => "\$1",
@@ -333,7 +337,7 @@ class bbcode
);
break;
- case 10:
+ case BBCODE_ID_EMAIL:
$this->bbcode_cache[$bbcode_id] = array(
'preg' => array(
'#\[email:$uid\]((.*?))\[/email:$uid\]#is' => $this->bbcode_tpl('email', $bbcode_id),
@@ -342,7 +346,7 @@ class bbcode
);
break;
- case 11:
+ case BBCODE_ID_FLASH:
if ($user->optionget('viewflash'))
{
$this->bbcode_cache[$bbcode_id] = array(
@@ -361,7 +365,7 @@ class bbcode
}
break;
- case 12:
+ case BBCODE_ID_ATTACH:
$this->bbcode_cache[$bbcode_id] = array(
'str' => array(
'[/attachment:$uid]' => $this->bbcode_tpl('inline_attachment_close', $bbcode_id)
diff --git a/phpBB/includes/compatibility_globals.php b/phpBB/includes/compatibility_globals.php
index ae532c0f13..dc7a593693 100644
--- a/phpBB/includes/compatibility_globals.php
+++ b/phpBB/includes/compatibility_globals.php
@@ -75,5 +75,3 @@ function register_compatibility_globals()
/* @var $template \phpbb\template\template */
$template = $phpbb_container->get('template');
}
-
-register_compatibility_globals();
diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php
index 8d09f73182..b3792dd8b9 100644
--- a/phpBB/includes/constants.php
+++ b/phpBB/includes/constants.php
@@ -28,7 +28,7 @@ if (!defined('IN_PHPBB'))
*/
// phpBB Version
-@define('PHPBB_VERSION', '3.2.0-b2');
+@define('PHPBB_VERSION', '3.2.0-b3-dev');
// QA-related
// define('PHPBB_QA', 1);
@@ -182,6 +182,22 @@ define('BBCODE_UID_LEN', 8);
// Number of core BBCodes
define('NUM_CORE_BBCODES', 12);
+define('NUM_PREDEFINED_BBCODES', 22);
+
+// BBCode IDs
+define('BBCODE_ID_QUOTE', 0);
+define('BBCODE_ID_B', 1);
+define('BBCODE_ID_I', 2);
+define('BBCODE_ID_URL', 3);
+define('BBCODE_ID_IMG', 4);
+define('BBCODE_ID_SIZE', 5);
+define('BBCODE_ID_COLOR', 6);
+define('BBCODE_ID_U', 7);
+define('BBCODE_ID_CODE', 8);
+define('BBCODE_ID_LIST', 9);
+define('BBCODE_ID_EMAIL', 10);
+define('BBCODE_ID_FLASH', 11);
+define('BBCODE_ID_ATTACH', 12);
// BBCode hard limit
define('BBCODE_LIMIT', 1511);
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 5125a601d6..497403b1e5 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -96,7 +96,7 @@ function gen_rand_string_friendly($num_chars = 8)
*/
function unique_id()
{
- return bin2hex(random_bytes(6));
+ return bin2hex(random_bytes(8));
}
/**
@@ -1648,6 +1648,12 @@ function generate_board_url($without_script_path = false)
$server_name = $user->host;
$server_port = $request->server('SERVER_PORT', 0);
+ $forwarded_proto = $request->server('HTTP_X_FORWARDED_PROTO');
+
+ if (!empty($forwarded_proto) && $forwarded_proto === 'https')
+ {
+ $server_port = 443;
+ }
// Forcing server vars is the only way to specify/override the protocol
if ($config['force_server_vars'] || !$server_name)
@@ -1813,6 +1819,7 @@ function redirect($url, $return = false, $disable_cd_check = false)
echo '<html dir="' . $user->lang['DIRECTION'] . '" lang="' . $user->lang['USER_LANG'] . '">';
echo '<head>';
echo '<meta charset="utf-8">';
+ echo '<meta http-equiv="X-UA-Compatible" content="IE=edge">';
echo '<meta http-equiv="refresh" content="0; url=' . str_replace('&', '&amp;', $url) . '" />';
echo '<title>' . $user->lang['REDIRECT'] . '</title>';
echo '</head>';
@@ -2233,6 +2240,21 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
$user->setup();
}
+ /**
+ * This event allows an extension to modify the login process
+ *
+ * @event core.login_box_before
+ * @var string redirect Redirect string
+ * @var string l_explain Explain language string
+ * @var string l_success Success language string
+ * @var bool admin Is admin?
+ * @var bool s_display Display full login form?
+ * @var string err Error string
+ * @since 3.1.9-RC1
+ */
+ $vars = array('redirect', 'l_explain', 'l_success', 'admin', 's_display', 'err');
+ extract($phpbb_dispatcher->trigger_event('core.login_box_before', compact($vars)));
+
// Print out error if user tries to authenticate as an administrator without having the privileges...
if ($admin && !$auth->acl_get('a_'))
{
@@ -2245,7 +2267,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
trigger_error('NO_AUTH_ADMIN');
}
- if ($request->is_set_post('login') || ($request->is_set('login') && $request->variable('login', '') == 'external'))
+ if (empty($err) && ($request->is_set_post('login') || ($request->is_set('login') && $request->variable('login', '') == 'external')))
{
// Get credential
if ($admin)
@@ -2314,11 +2336,11 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
*
* @event core.login_box_redirect
* @var string redirect Redirect string
- * @var boolean admin Is admin?
- * @var bool return If true, do not redirect but return the sanitized URL.
+ * @var bool admin Is admin?
* @since 3.1.0-RC5
+ * @changed 3.1.9-RC1 Removed undefined return variable
*/
- $vars = array('redirect', 'admin', 'return');
+ $vars = array('redirect', 'admin');
extract($phpbb_dispatcher->trigger_event('core.login_box_redirect', compact($vars)));
// append/replace SID (may change during the session for AOL users)
@@ -2730,7 +2752,8 @@ function get_preg_expression($mode)
return array(
'#<!\-\- e \-\-><a href="mailto:(.*?)">.*?</a><!\-\- e \-\->#',
'#<!\-\- l \-\-><a (?:class="[\w-]+" )?href="(.*?)(?:(&amp;|\?)sid=[0-9a-f]{32})?">.*?</a><!\-\- l \-\->#',
- '#<!\-\- ([mw]) \-\-><a (?:class="[\w-]+" )?href="(.*?)">(.*?)</a><!\-\- \1 \-\->#',
+ '#<!\-\- ([mw]) \-\-><a (?:class="[\w-]+" )?href="http://(.*?)">\2</a><!\-\- \1 \-\->#',
+ '#<!\-\- ([mw]) \-\-><a (?:class="[\w-]+" )?href="(.*?)">.*?</a><!\-\- \1 \-\->#',
'#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/.*? \/><!\-\- s\1 \-\->#',
'#<!\-\- .*? \-\->#s',
'#<.*?>#s',
@@ -3307,6 +3330,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
echo '<html dir="ltr">';
echo '<head>';
echo '<meta charset="utf-8">';
+ echo '<meta http-equiv="X-UA-Compatible" content="IE=edge">';
echo '<title>' . $msg_title . '</title>';
echo '<style type="text/css">' . "\n" . '/* <![CDATA[ */' . "\n";
echo '* { margin: 0; padding: 0; } html { font-size: 100%; height: 100%; margin-bottom: 1px; background-color: #E4EDF0; } body { font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif; color: #536482; background: #E4EDF0; font-size: 62.5%; margin: 0; } ';
@@ -4071,7 +4095,7 @@ function phpbb_get_avatar($row, $alt, $ignore_config = false, $lazy = false)
/**
* Generate page header
*/
-function page_header($page_title = '', $display_online_list = false, $item_id = 0, $item = 'forum')
+function page_header($page_title = '', $display_online_list = false, $item_id = 0, $item = 'forum', $send_headers = true)
{
global $db, $config, $template, $SID, $_SID, $_EXTRA_URL, $user, $auth, $phpEx, $phpbb_root_path;
global $phpbb_dispatcher, $request, $phpbb_container, $phpbb_admin_path;
@@ -4416,17 +4440,22 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
'SITE_LOGO_IMG' => $user->img('site_logo'),
));
- // An array of http headers that phpbb will set. The following event may override these.
- $http_headers = array(
- // application/xhtml+xml not used because of IE
- 'Content-type' => 'text/html; charset=UTF-8',
- 'Cache-Control' => 'private, no-cache="set-cookie"',
- 'Expires' => gmdate('D, d M Y H:i:s', time()) . ' GMT',
- );
- if (!empty($user->data['is_bot']))
+ $http_headers = array();
+
+ if ($send_headers)
{
- // Let reverse proxies know we detected a bot.
- $http_headers['X-PHPBB-IS-BOT'] = 'yes';
+ // An array of http headers that phpbb will set. The following event may override these.
+ $http_headers += array(
+ // application/xhtml+xml not used because of IE
+ 'Content-type' => 'text/html; charset=UTF-8',
+ 'Cache-Control' => 'private, no-cache="set-cookie"',
+ 'Expires' => gmdate('D, d M Y H:i:s', time()) . ' GMT',
+ );
+ if (!empty($user->data['is_bot']))
+ {
+ // Let reverse proxies know we detected a bot.
+ $http_headers['X-PHPBB-IS-BOT'] = 'yes';
+ }
}
/**
diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php
index dc43957933..766669480d 100644
--- a/phpBB/includes/functions_acp.php
+++ b/phpBB/includes/functions_acp.php
@@ -258,46 +258,49 @@ function build_cfg_template($tpl_type, $key, &$new_ary, $config_key, $vars)
case 'text':
case 'url':
case 'email':
- case 'color':
- case 'date':
- case 'time':
- case 'datetime':
- case 'datetime-local':
- case 'month':
- case 'range':
- case 'search':
case 'tel':
- case 'week':
+ case 'search':
+ // maxlength and size are only valid for these types and will be
+ // ignored for other input types.
$size = (int) $tpl_type[1];
$maxlength = (int) $tpl_type[2];
$tpl = '<input id="' . $key . '" type="' . $tpl_type[0] . '"' . (($size) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength) ? $maxlength : 255) . '" name="' . $name . '" value="' . $new_ary[$config_key] . '"' . (($tpl_type[0] === 'password') ? ' autocomplete="off"' : '') . ' />';
break;
+ case 'color':
+ case 'datetime':
+ case 'datetime-local':
+ case 'month':
+ case 'week':
+ $tpl = '<input id="' . $key . '" type="' . $tpl_type[0] . '" name="' . $name . '" value="' . $new_ary[$config_key] . '" />';
+ break;
+
+ case 'date':
+ case 'time':
case 'number':
- $max = $maxlength = '';
+ case 'range':
+ $max = '';
$min = ( isset($tpl_type[1]) ) ? (int) $tpl_type[1] : false;
if ( isset($tpl_type[2]) )
{
$max = (int) $tpl_type[2];
- $maxlength = strlen( (string) $max );
}
- $tpl = '<input id="' . $key . '" type="number" maxlength="' . (( $maxlength != '' ) ? $maxlength : 255) . '"' . (( $min != '' ) ? ' min="' . $min . '"' : '') . (( $max != '' ) ? ' max="' . $max . '"' : '') . ' name="' . $name . '" value="' . $new_ary[$config_key] . '" />';
+ $tpl = '<input id="' . $key . '" type="' . $tpl_type[0] . '"' . (( $min != '' ) ? ' min="' . $min . '"' : '') . (( $max != '' ) ? ' max="' . $max . '"' : '') . ' name="' . $name . '" value="' . $new_ary[$config_key] . '" />';
break;
case 'dimension':
- $max = $maxlength = $size = '';
+ $max = '';
$min = (int) $tpl_type[1];
if ( isset($tpl_type[2]) )
{
$max = (int) $tpl_type[2];
- $size = $maxlength = strlen( (string) $max );
}
- $tpl = '<input id="' . $key . '" type="number"' . (( $size != '' ) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength != '') ? $maxlength : 255) . '"' . (( $min !== '' ) ? ' min="' . $min . '"' : '') . (( $max != '' ) ? ' max="' . $max . '"' : '') . ' name="config[' . $config_key . '_width]" value="' . $new_ary[$config_key . '_width'] . '" /> x <input type="number"' . (( $size != '' ) ? ' size="' . $size . '"' : '') . ' maxlength="' . (($maxlength != '') ? $maxlength : 255) . '"' . (( $min !== '' ) ? ' min="' . $min . '"' : '') . (( $max != '' ) ? ' max="' . $max . '"' : '') . ' name="config[' . $config_key . '_height]" value="' . $new_ary[$config_key . '_height'] . '" />';
+ $tpl = '<input id="' . $key . '" type="number"' . (( $min !== '' ) ? ' min="' . $min . '"' : '') . (( $max != '' ) ? ' max="' . $max . '"' : '') . ' name="config[' . $config_key . '_width]" value="' . $new_ary[$config_key . '_width'] . '" /> x <input type="number"' . (( $min !== '' ) ? ' min="' . $min . '"' : '') . (( $max != '' ) ? ' max="' . $max . '"' : '') . ' name="config[' . $config_key . '_height]" value="' . $new_ary[$config_key . '_height'] . '" />';
break;
case 'textarea':
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index a0073ec158..a84cbd9311 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -2999,8 +2999,8 @@ function add_permission_language()
$lang_files = $finder
->prefix('permissions_')
->suffix(".$phpEx")
- ->core_path('language/' . $user->lang_name . '/')
- ->extension_directory('/language/' . $user->lang_name)
+ ->core_path('language/')
+ ->extension_directory('/language')
->find();
foreach ($lang_files as $lang_file => $ext_name)
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php
index 39a3f0352f..fd7fc478bd 100644
--- a/phpBB/includes/functions_content.php
+++ b/phpBB/includes/functions_content.php
@@ -469,7 +469,7 @@ function decode_message(&$message, $bbcode_uid = '')
$message = str_replace($match, $replace, $message);
$match = get_preg_expression('bbcode_htm');
- $replace = array('\1', '\1', '\3', '\1', '', '');
+ $replace = array('\1', '\1', '\2', '\2', '\1', '', '');
$message = preg_replace($match, $replace, $message);
}
@@ -1091,17 +1091,8 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count_a
unset($new_attachment_data);
}
- // Sort correctly
- if ($config['display_order'])
- {
- // Ascending sort
- krsort($attachments);
- }
- else
- {
- // Descending sort
- ksort($attachments);
- }
+ // Make sure attachments are properly ordered
+ ksort($attachments);
foreach ($attachments as $attachment)
{
@@ -1309,8 +1300,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count_a
$attachments = $compiled_attachments;
unset($compiled_attachments);
- $tpl_size = sizeof($attachments);
-
$unset_tpl = array();
preg_match_all('#<!\-\- ia([0-9]+) \-\->(.*?)<!\-\- ia\1 \-\->#', $message, $matches, PREG_PATTERN_ORDER);
@@ -1318,8 +1307,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count_a
$replace = array();
foreach ($matches[0] as $num => $capture)
{
- // Flip index if we are displaying the reverse way
- $index = ($config['display_order']) ? ($tpl_size-($matches[1][$num] + 1)) : $matches[1][$num];
+ $index = $matches[1][$num];
$replace['from'][] = $matches[0][$num];
$replace['to'][] = (isset($attachments[$index])) ? $attachments[$index] : sprintf($user->lang['MISSING_INLINE_ATTACHMENT'], $matches[2][array_search($index, $matches[1])]);
@@ -1334,6 +1322,18 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count_a
$unset_tpl = array_unique($unset_tpl);
+ // Sort correctly
+ if ($config['display_order'])
+ {
+ // Ascending sort
+ krsort($attachments);
+ }
+ else
+ {
+ // Descending sort
+ ksort($attachments);
+ }
+
// Needed to let not display the inlined attachments at the end of the post again
foreach ($unset_tpl as $index)
{
diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php
index 3575768782..27d3658e36 100644
--- a/phpBB/includes/functions_convert.php
+++ b/phpBB/includes/functions_convert.php
@@ -479,7 +479,7 @@ function import_avatar_gallery($gallery_name = '', $subdirs_as_galleries = false
$dir->close();
}
- for ($i = 0; $i < sizeof($dirlist); ++$i)
+ for ($i = 0, $end = sizeof($dirlist); $i < $end; ++$i)
{
$dir = $dirlist[$i];
@@ -1425,7 +1425,7 @@ function get_path($src_path, $src_url, $test_file)
$path_array = array();
$phpbb_parts = explode('/', $script_path);
- for ($i = 0; $i < sizeof($url_parts); ++$i)
+ for ($i = 0, $end = sizeof($url_parts); $i < $end; ++$i)
{
if ($i < sizeof($phpbb_parts[$i]) && $url_parts[$i] == $phpbb_parts[$i])
{
@@ -1435,7 +1435,7 @@ function get_path($src_path, $src_url, $test_file)
else
{
$path = '';
- for ($j = $i; $j < sizeof($phpbb_parts); ++$j)
+ for ($j = $i, $end2 = sizeof($phpbb_parts); $j < $end2; ++$j)
{
$path .= '../';
}
@@ -2267,7 +2267,7 @@ function convert_bbcode($message, $convert_size = true, $extended_bbcodes = fals
"\n\n"
);
- for ($i = 0; $i < sizeof($str_from); ++$i)
+ for ($i = 0, $end = sizeof($str_from); $i < $end; ++$i)
{
$origx[] = '#\\' . str_replace(']', '\\]', $str_from[$i]) . '#is';
$replx[] = $str_to[$i];
@@ -2276,7 +2276,7 @@ function convert_bbcode($message, $convert_size = true, $extended_bbcodes = fals
if (preg_match_all('#\[email=([^\]]+)\](.*?)\[/email\]#i', $message, $m))
{
- for ($i = 0; $i < sizeof($m[1]); ++$i)
+ for ($i = 0, $end = sizeof($m[1]); $i < $end; ++$i)
{
if ($m[1][$i] == $m[2][$i])
{
@@ -2340,7 +2340,7 @@ function copy_file($src, $trg, $overwrite = false, $die_on_failure = true, $sour
$parts = explode('/', $trg);
unset($parts[sizeof($parts) - 1]);
- for ($i = 0; $i < sizeof($parts); ++$i)
+ for ($i = 0, $end = sizeof($parts); $i < $end; ++$i)
{
$path .= $parts[$i] . '/';
@@ -2440,7 +2440,7 @@ function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_
if ($copy_subdirs)
{
- for ($i = 0; $i < sizeof($dirlist); ++$i)
+ for ($i = 0, $end = sizeof($dirlist); $i < $end; ++$i)
{
$dir = $dirlist[$i];
@@ -2475,7 +2475,7 @@ function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_
$convert->p_master->error(sprintf($str, implode('<br />', $bad_dirs)), __LINE__, __FILE__);
}
- for ($i = 0; $i < sizeof($filelist); ++$i)
+ for ($i = 0, $end = sizeof($filelist); $i < $end; ++$i)
{
copy_file($src . $filelist[$i], $trg . $filelist[$i], $overwrite, $die_on_failure, $source_relative_path);
}
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index afda10ebee..4726676e2d 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -1076,7 +1076,7 @@ function display_custom_bbcodes()
global $db, $template, $user, $phpbb_dispatcher;
// Start counting from 22 for the bbcode ids (every bbcode takes two ids - opening/closing)
- $num_predefined_bbcodes = 22;
+ $num_predefined_bbcodes = NUM_PREDEFINED_BBCODES;
$sql_ary = array(
'SELECT' => 'b.bbcode_id, b.bbcode_tag, b.bbcode_helpline',
diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php
index 916655e77c..b295d4cd1e 100644
--- a/phpBB/includes/functions_download.php
+++ b/phpBB/includes/functions_download.php
@@ -108,6 +108,7 @@ function wrap_img_in_html($src, $title)
echo '<html>';
echo '<head>';
echo '<meta charset="utf-8">';
+ echo '<meta http-equiv="X-UA-Compatible" content="IE=edge">';
echo '<title>' . $title . '</title>';
echo '</head>';
echo '<body>';
@@ -412,7 +413,7 @@ function set_modified_headers($stamp, $browser)
global $request;
// let's see if we have to send the file at all
- $last_load = $request->header('Modified-Since') ? strtotime(trim($request->header('Modified-Since'))) : false;
+ $last_load = $request->header('If-Modified-Since') ? strtotime(trim($request->header('If-Modified-Since'))) : false;
if (strpos(strtolower($browser), 'msie 6.0') === false && !phpbb_is_greater_ie_version($browser, 7))
{
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index e8d4e0d7f1..3fa96afb29 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -639,14 +639,13 @@ class messenger
$phpbb_container->get('config'),
$phpbb_container->get('filesystem'),
$phpbb_container->get('path_helper'),
- $phpbb_container,
- $phpbb_container->getParameter('core.root_path') . 'cache/',
+ $phpbb_container->getParameter('core.cache_dir'),
$phpbb_container->get('ext.manager'),
new \phpbb\template\twig\loader(
$phpbb_filesystem
)
),
- $phpbb_container->getParameter('core.root_path') . 'cache/',
+ $phpbb_container->getParameter('core.cache_dir'),
$phpbb_container->get('user'),
$phpbb_container->get('template.twig.extensions.collection'),
$phpbb_extension_manager
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 58753122cc..2bc7ed471e 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -1492,6 +1492,10 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll_ary, &$data
break;
}
}
+ else if (isset($data_ary['post_visibility']) && $data_ary['post_visibility'] !== false)
+ {
+ $post_visibility = $data_ary['post_visibility'];
+ }
// MODs/Extensions are able to force any visibility on posts
if (isset($data_ary['force_approved_state']))
@@ -2299,7 +2303,9 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll_ary, &$data
$params = $add_anchor = '';
- if ($post_visibility == ITEM_APPROVED)
+ if ($post_visibility == ITEM_APPROVED ||
+ ($auth->acl_get('m_softdelete', $data_ary['forum_id']) && $post_visibility == ITEM_DELETED) ||
+ ($auth->acl_get('m_approve', $data_ary['forum_id']) && in_array($post_visibility, array(ITEM_UNAPPROVED, ITEM_REAPPROVE))))
{
$params .= '&amp;t=' . $data_ary['topic_id'];
diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php
index 0b66aae030..0e80372f43 100644
--- a/phpBB/includes/mcp/mcp_warn.php
+++ b/phpBB/includes/mcp/mcp_warn.php
@@ -530,12 +530,28 @@ function add_warning($user_row, $warning, $send_pm = true, $post_id = 0)
include_once($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx);
- $user_row['user_lang'] = (file_exists($phpbb_root_path . 'language/' . $user_row['user_lang'] . "/mcp.$phpEx")) ? $user_row['user_lang'] : $config['default_lang'];
- include($phpbb_root_path . 'language/' . basename($user_row['user_lang']) . "/mcp.$phpEx");
+ // Attempt to translate warning to language of user being warned if user's language differs from issuer's language
+ if ($user_row['user_lang'] != $user->lang_name)
+ {
+ $lang = array();
+
+ $user_row['user_lang'] = (file_exists($phpbb_root_path . 'language/' . basename($user_row['user_lang']) . "/mcp." . $phpEx)) ? $user_row['user_lang'] : $config['default_lang'];
+ include($phpbb_root_path . 'language/' . basename($user_row['user_lang']) . "/mcp." . $phpEx);
+
+ $warn_pm_subject = $lang['WARNING_PM_SUBJECT'];
+ $warn_pm_body = sprintf($lang['WARNING_PM_BODY'], $warning);
+
+ unset($lang);
+ }
+ else
+ {
+ $warn_pm_subject = $user->lang('WARNING_PM_SUBJECT');
+ $warn_pm_body = $user->lang('WARNING_PM_BODY', $warning);
+ }
$message_parser = new parse_message();
- $message_parser->message = $user->lang('WARNING_PM_BODY', $warning);
+ $message_parser->message = $warn_pm_body;
$message_parser->parse(true, true, true, false, false, true, true);
$pm_data = array(
@@ -553,7 +569,7 @@ function add_warning($user_row, $warning, $send_pm = true, $post_id = 0)
'address_list' => array('u' => array($user_row['user_id'] => 'to')),
);
- submit_pm('post', $user->lang('WARNING_PM_SUBJECT'), $pm_data, false);
+ submit_pm('post', $warn_pm_subject, $pm_data, false);
}
$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_WARNING', false, array($user_row['username']));
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index 97e0dd9f0d..258837e4e2 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -141,67 +141,67 @@ class bbcode_firstpass extends bbcode
// To perform custom validation in extension, use $this->validate_bbcode_by_extension()
// method which accepts variable number of parameters
$this->bbcodes = array(
- 'code' => array('bbcode_id' => 8, 'regexp' => array('#\[code(?:=([a-z]+))?\](.+\[/code\])#uis' => function ($match) use($bbcode_class)
+ 'code' => array('bbcode_id' => BBCODE_ID_CODE, 'regexp' => array('#\[code(?:=([a-z]+))?\](.+\[/code\])#uis' => function ($match) use($bbcode_class)
{
return $bbcode_class->bbcode_code($match[1], $match[2]);
}
)),
- 'quote' => array('bbcode_id' => 0, 'regexp' => array('#\[quote(?:=&quot;(.*?)&quot;)?\](.+)\[/quote\]#uis' => function ($match) use($bbcode_class)
+ 'quote' => array('bbcode_id' => BBCODE_ID_QUOTE, 'regexp' => array('#\[quote(?:=&quot;(.*?)&quot;)?\](.+)\[/quote\]#uis' => function ($match) use($bbcode_class)
{
return $bbcode_class->bbcode_quote($match[0]);
}
)),
- 'attachment' => array('bbcode_id' => 12, 'regexp' => array('#\[attachment=([0-9]+)\](.*?)\[/attachment\]#uis' => function ($match) use($bbcode_class)
+ 'attachment' => array('bbcode_id' => BBCODE_ID_ATTACH, 'regexp' => array('#\[attachment=([0-9]+)\](.*?)\[/attachment\]#uis' => function ($match) use($bbcode_class)
{
return $bbcode_class->bbcode_attachment($match[1], $match[2]);
}
)),
- 'b' => array('bbcode_id' => 1, 'regexp' => array('#\[b\](.*?)\[/b\]#uis' => function ($match) use($bbcode_class)
+ 'b' => array('bbcode_id' => BBCODE_ID_B, 'regexp' => array('#\[b\](.*?)\[/b\]#uis' => function ($match) use($bbcode_class)
{
return $bbcode_class->bbcode_strong($match[1]);
}
)),
- 'i' => array('bbcode_id' => 2, 'regexp' => array('#\[i\](.*?)\[/i\]#uis' => function ($match) use($bbcode_class)
+ 'i' => array('bbcode_id' => BBCODE_ID_I, 'regexp' => array('#\[i\](.*?)\[/i\]#uis' => function ($match) use($bbcode_class)
{
return $bbcode_class->bbcode_italic($match[1]);
}
)),
- 'url' => array('bbcode_id' => 3, 'regexp' => array('#\[url(=(.*))?\](?(1)((?s).*(?-s))|(.*))\[/url\]#uiU' => function ($match) use($bbcode_class)
+ 'url' => array('bbcode_id' => BBCODE_ID_URL, 'regexp' => array('#\[url(=(.*))?\](?(1)((?s).*(?-s))|(.*))\[/url\]#uiU' => function ($match) use($bbcode_class)
{
return $bbcode_class->validate_url($match[2], ($match[3]) ? $match[3] : $match[4]);
}
)),
- 'img' => array('bbcode_id' => 4, 'regexp' => array('#\[img\](.*)\[/img\]#uiU' => function ($match) use($bbcode_class)
+ 'img' => array('bbcode_id' => BBCODE_ID_IMG, 'regexp' => array('#\[img\](.*)\[/img\]#uiU' => function ($match) use($bbcode_class)
{
return $bbcode_class->bbcode_img($match[1]);
}
)),
- 'size' => array('bbcode_id' => 5, 'regexp' => array('#\[size=([\-\+]?\d+)\](.*?)\[/size\]#uis' => function ($match) use($bbcode_class)
+ 'size' => array('bbcode_id' => BBCODE_ID_SIZE, 'regexp' => array('#\[size=([\-\+]?\d+)\](.*?)\[/size\]#uis' => function ($match) use($bbcode_class)
{
return $bbcode_class->bbcode_size($match[1], $match[2]);
}
)),
- 'color' => array('bbcode_id' => 6, 'regexp' => array('!\[color=(#[0-9a-f]{3}|#[0-9a-f]{6}|[a-z\-]+)\](.*?)\[/color\]!uis' => function ($match) use($bbcode_class)
+ 'color' => array('bbcode_id' => BBCODE_ID_COLOR, 'regexp' => array('!\[color=(#[0-9a-f]{3}|#[0-9a-f]{6}|[a-z\-]+)\](.*?)\[/color\]!uis' => function ($match) use($bbcode_class)
{
return $bbcode_class->bbcode_color($match[1], $match[2]);
}
)),
- 'u' => array('bbcode_id' => 7, 'regexp' => array('#\[u\](.*?)\[/u\]#uis' => function ($match) use($bbcode_class)
+ 'u' => array('bbcode_id' => BBCODE_ID_U, 'regexp' => array('#\[u\](.*?)\[/u\]#uis' => function ($match) use($bbcode_class)
{
return $bbcode_class->bbcode_underline($match[1]);
}
)),
- 'list' => array('bbcode_id' => 9, 'regexp' => array('#\[list(?:=(?:[a-z0-9]|disc|circle|square))?].*\[/list]#uis' => function ($match) use($bbcode_class)
+ 'list' => array('bbcode_id' => BBCODE_ID_LIST, 'regexp' => array('#\[list(?:=(?:[a-z0-9]|disc|circle|square))?].*\[/list]#uis' => function ($match) use($bbcode_class)
{
return $bbcode_class->bbcode_parse_list($match[0]);
}
)),
- 'email' => array('bbcode_id' => 10, 'regexp' => array('#\[email=?(.*?)?\](.*?)\[/email\]#uis' => function ($match) use($bbcode_class)
+ 'email' => array('bbcode_id' => BBCODE_ID_EMAIL, 'regexp' => array('#\[email=?(.*?)?\](.*?)\[/email\]#uis' => function ($match) use($bbcode_class)
{
return $bbcode_class->validate_email($match[1], $match[2]);
}
)),
- 'flash' => array('bbcode_id' => 11, 'regexp' => array('#\[flash=([0-9]+),([0-9]+)\](.*?)\[/flash\]#ui' => function ($match) use($bbcode_class)
+ 'flash' => array('bbcode_id' => BBCODE_ID_FLASH, 'regexp' => array('#\[flash=([0-9]+),([0-9]+)\](.*?)\[/flash\]#ui' => function ($match) use($bbcode_class)
{
return $bbcode_class->bbcode_flash($match[1], $match[2], $match[3]);
}
diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php
index 1273ea9723..faffbe5bdc 100644
--- a/phpBB/includes/ucp/ucp_groups.php
+++ b/phpBB/includes/ucp/ucp_groups.php
@@ -472,10 +472,11 @@ class ucp_groups
$avatar_data = null;
$avatar_error = array();
+ /** @var \phpbb\avatar\manager $phpbb_avatar_manager */
+ $phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
+
if ($config['allow_avatar'])
{
- /* @var $phpbb_avatar_manager \phpbb\avatar\manager */
- $phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
$avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers();
// This is normalised data, without the group_ prefix
@@ -658,6 +659,14 @@ class ucp_groups
$avatars_enabled = false;
$selected_driver = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', $avatar_data['avatar_type']));
+ // Assign min and max values before generating avatar driver html
+ $template->assign_vars(array(
+ 'AVATAR_MIN_WIDTH' => $config['avatar_min_width'],
+ 'AVATAR_MAX_WIDTH' => $config['avatar_max_width'],
+ 'AVATAR_MIN_HEIGHT' => $config['avatar_min_height'],
+ 'AVATAR_MAX_HEIGHT' => $config['avatar_max_height'],
+ ));
+
foreach ($avatar_drivers as $current_driver)
{
$driver = $phpbb_avatar_manager->get_driver($current_driver);
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index e707c251fe..1132271689 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -157,7 +157,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
'S_SHOW_PM_BOX' => true,
'S_ALLOW_MASS_PM' => ($config['allow_mass_pm'] && $auth->acl_get('u_masspm')) ? true : false,
'S_GROUP_OPTIONS' => ($config['allow_mass_pm'] && $auth->acl_get('u_masspm_group')) ? $group_options : '',
- 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=searchuser&amp;form=postform&amp;field=username_list&amp;select_single=$select_single"),
+ 'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=searchuser&amp;form=postform&amp;field=username_list&amp;select_single=" . (int) $select_single),
));
}
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 4ac8e0f17d..c65bb83eae 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -544,7 +544,10 @@ class ucp_profile
// Replace "error" strings with their real, localised form
$error = array_map(array($user, 'lang'), $error);
- $decoded_message = generate_text_for_edit($signature, $bbcode_uid, $bbcode_bitfield);
+ if ($request->is_set_post('preview'))
+ {
+ $decoded_message = generate_text_for_edit($signature, $bbcode_uid, $bbcode_flags);
+ }
/** @var \phpbb\controller\helper $controller_helper */
$controller_helper = $phpbb_container->get('controller.helper');
@@ -661,6 +664,13 @@ class ucp_profile
$selected_driver = $phpbb_avatar_manager->clean_driver_name($request->variable('avatar_driver', $user->data['user_avatar_type']));
+ $template->assign_vars(array(
+ 'AVATAR_MIN_WIDTH' => $config['avatar_min_width'],
+ 'AVATAR_MAX_WIDTH' => $config['avatar_max_width'],
+ 'AVATAR_MIN_HEIGHT' => $config['avatar_min_height'],
+ 'AVATAR_MAX_HEIGHT' => $config['avatar_max_height'],
+ ));
+
foreach ($avatar_drivers as $current_driver)
{
$driver = $phpbb_avatar_manager->get_driver($current_driver);
diff --git a/phpBB/install/convert/convertor.php b/phpBB/install/convert/convertor.php
index 2dae356c26..5a3799a7a1 100644
--- a/phpBB/install/convert/convertor.php
+++ b/phpBB/install/convert/convertor.php
@@ -373,7 +373,7 @@ class convertor
$val = array($val);
}
- for ($j = 0; $j < sizeof($val); ++$j)
+ for ($j = 0, $size = sizeof($val); $j < $size; ++$j)
{
if (preg_match('/LEFT JOIN ([a-z0-9_]+) AS ([a-z0-9_]+)/i', $val[$j], $m))
{
@@ -1044,7 +1044,7 @@ class convertor
OR config_name = 'convert_db_user'");
$db->sql_query('DELETE FROM ' . SESSIONS_TABLE);
- @unlink($phpbb_root_path . 'cache/data_global.' . $phpEx);
+ @unlink($phpbb_container->getParameter('core.cache_dir') . 'data_global.' . $phpEx);
phpbb_cache_moderators($db, $cache, $auth);
// And finally, add a note to the log
diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php
index 6312ad076d..977670c94c 100644
--- a/phpBB/install/convertors/convert_phpbb20.php
+++ b/phpBB/install/convertors/convert_phpbb20.php
@@ -38,7 +38,7 @@ $dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);
$convertor_data = array(
'forum_name' => 'phpBB 2.0.x',
'version' => '1.0.3',
- 'phpbb_version' => '3.2.0-b2',
+ 'phpbb_version' => '3.2.0-b3-dev',
'author' => '<a href="https://www.phpbb.com/">phpBB Limited</a>',
'dbms' => $dbms,
'dbhost' => $dbhost,
diff --git a/phpBB/install/phpbbcli.php b/phpBB/install/phpbbcli.php
index 34fb79b07c..87eab84b5a 100755
--- a/phpBB/install/phpbbcli.php
+++ b/phpBB/install/phpbbcli.php
@@ -23,7 +23,7 @@ if (php_sapi_name() !== 'cli')
define('IN_PHPBB', true);
define('IN_INSTALL', true);
define('PHPBB_ENVIRONMENT', 'production');
-define('PHPBB_VERSION', '3.2.0-b2');
+define('PHPBB_VERSION', '3.2.0-b3-dev');
$phpbb_root_path = __DIR__ . '/../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index 12e0daa87e..9791174e0f 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -276,7 +276,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0
INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('use_system_cron', '0');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.2.0-b2');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.2.0-b3-dev');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400');
diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php
index 4a70aafc6f..f30d1e7198 100644
--- a/phpBB/language/en/acp/common.php
+++ b/phpBB/language/en/acp/common.php
@@ -225,6 +225,16 @@ $lang = array_merge($lang, array(
'BACK' => 'Back',
+ 'CANNOT_CHANGE_FILE_GROUP' => 'Unable to change file group',
+ 'CANNOT_CHANGE_FILE_PERMISSIONS' => 'Unable to change file permissions',
+ 'CANNOT_COPY_FILES' => 'Unable to copy files',
+ 'CANNOT_CREATE_SYMLINK' => 'Unable to create a symlink',
+ 'CANNOT_DELETE_FILES' => 'Unable to delete files from the system',
+ 'CANNOT_DUMP_FILE' => 'Unable to dump file',
+ 'CANNOT_MIRROR_DIRECTORY' => 'Unable to mirror directory',
+ 'CANNOT_RENAME_FILE' => 'Unable to rename a file from the system',
+ 'CANNOT_TOUCH_FILES' => 'Unable to determine if the file exists',
+
'CONTAINER_EXCEPTION' => 'phpBB encountered an error building the container due to an installed extension. For this reason, all extensions have been temporarily disabled. Please try purging your forum cache. All extensions will automatically be re-enabled once the container error is resolved. If this error continues, please visit <a href="https://www.phpbb.com/support">phpBB.com</a> for support.',
'EXCEPTION' => 'Exception',
@@ -606,6 +616,7 @@ $lang = array_merge($lang, array(
'LOG_ERROR_JABBER' => '<strong>Jabber error</strong><br />» %s',
'LOG_ERROR_EMAIL' => '<strong>Email error</strong><br />» %s',
+ 'LOG_ERROR_CAPTCHA' => '<strong>CAPTCHA error</strong><br />» %s',
'LOG_FORUM_ADD' => '<strong>Created new forum</strong><br />» %s',
'LOG_FORUM_COPIED_PERMISSIONS' => '<strong>Copied forum permissions</strong> from %1$s<br />» %2$s',
diff --git a/phpBB/language/en/captcha_qa.php b/phpBB/language/en/captcha_qa.php
index f764a83f24..28011eb636 100644
--- a/phpBB/language/en/captcha_qa.php
+++ b/phpBB/language/en/captcha_qa.php
@@ -40,6 +40,7 @@ $lang = array_merge($lang, array(
'CAPTCHA_QA' => 'Q&amp;A',
'CONFIRM_QUESTION_EXPLAIN' => 'This question is a means of preventing automated form submissions by spambots.',
'CONFIRM_QUESTION_WRONG' => 'You have provided an invalid answer to the question.',
+ 'CONFIRM_QUESTION_MISSING' => 'Questions for the captcha could not be retrieved. Please contact a board administrator.',
'QUESTION_ANSWERS' => 'Answers',
'ANSWERS_EXPLAIN' => 'Please enter valid answers to the question, one per line.',
@@ -60,5 +61,4 @@ $lang = array_merge($lang, array(
'QA_ERROR_MSG' => 'Please fill in all fields and enter at least one answer.',
'QA_LAST_QUESTION' => 'You cannot delete all questions while the plugin is active.',
-
));
diff --git a/phpBB/language/en/cli.php b/phpBB/language/en/cli.php
index 1c549e5f9f..db4b5f9ec6 100644
--- a/phpBB/language/en/cli.php
+++ b/phpBB/language/en/cli.php
@@ -82,6 +82,21 @@ $lang = array_merge($lang, array(
'CLI_DESCRIPTION_THUMBNAIL_GENERATE' => 'Generate all missing thumbnails.',
'CLI_DESCRIPTION_THUMBNAIL_RECREATE' => 'Recreate all thumbnails.',
+ 'CLI_DESCRIPTION_USER_ACTIVATE' => 'Activate (or deactivate) a user account.',
+ 'CLI_DESCRIPTION_USER_ACTIVATE_USERNAME' => 'Username of the account to activate.',
+ 'CLI_DESCRIPTION_USER_ACTIVATE_DEACTIVATE' => 'Deactivate the user’s account',
+ 'CLI_DESCRIPTION_USER_ACTIVATE_ACTIVE' => 'The user is already active.',
+ 'CLI_DESCRIPTION_USER_ACTIVATE_INACTIVE' => 'The user is already inactive.',
+ 'CLI_DESCRIPTION_USER_ADD' => 'Add a new user.',
+ 'CLI_DESCRIPTION_USER_ADD_OPTION_USERNAME' => 'Username of the new user',
+ 'CLI_DESCRIPTION_USER_ADD_OPTION_PASSWORD' => 'Password of the new user',
+ 'CLI_DESCRIPTION_USER_ADD_OPTION_EMAIL' => 'E-mail address of the new user',
+ 'CLI_DESCRIPTION_USER_ADD_OPTION_NOTIFY' => 'Send account activation email to the new user (not sent by default)',
+ 'CLI_DESCRIPTION_USER_DELETE' => 'Delete a user account.',
+ 'CLI_DESCRIPTION_USER_DELETE_USERNAME' => 'Username of the user to delete',
+ 'CLI_DESCRIPTION_USER_DELETE_OPTION_POSTS' => 'Delete all posts by the user. Without this option, the user’s posts will be retained.',
+ 'CLI_DESCRIPTION_USER_RECLEAN' => 'Re-clean usernames.',
+
'CLI_EXTENSION_DISABLE_FAILURE' => 'Could not disable extension %s',
'CLI_EXTENSION_DISABLE_SUCCESS' => 'Successfully disabled extension %s',
'CLI_EXTENSION_ENABLE_FAILURE' => 'Could not enable extension %s',
@@ -118,9 +133,24 @@ $lang = array_merge($lang, array(
'CLI_THUMBNAIL_NOTHING_TO_GENERATE' => 'No thumbnails to generate.',
'CLI_THUMBNAIL_NOTHING_TO_DELETE' => 'No thumbnails to delete.',
+
+ 'CLI_USER_ADD_SUCCESS' => 'Successfully added user %s.',
+ 'CLI_USER_DELETE_CONFIRM' => 'Are you sure you want to delete ‘%s’? [y/N]',
+ 'CLI_USER_RECLEAN_START' => 'Re-cleaning usernames',
+ 'CLI_USER_RECLEAN_DONE' => [
+ 0 => 'Re-cleaning complete. No usernames needed to be cleaned.',
+ 1 => 'Re-cleaning complete. %d username was cleaned.',
+ 2 => 'Re-cleaning complete. %d usernames were cleaned.',
+ ],
));
// Additional help for commands.
$lang = array_merge($lang, array(
'CLI_HELP_CRON_RUN' => $lang['CLI_DESCRIPTION_CRON_RUN'] . ' Optionally you can specify a cron task name to run only the specified cron task.',
+ 'CLI_HELP_USER_ACTIVATE' => 'Activate a user account, or deactivate an account using the <info>--deactivate</info> option.
+To optionally send an activation email to the user, use the <info>--send-email</info> option.',
+ 'CLI_HELP_USER_ADD' => 'The <info>%command.name%</info> command adds a new user:
+If this command is run without options, you will be prompted to enter them.
+To optionally send an email to the new user, use the <info>--send-email</info> option.',
+ 'CLI_HELP_USER_RECLEAN' => 'Re-clean usernames will check all stored usernames and ensure clean versions are also stored. Cleaned usernames are a case insensitive form, NFC normalized and transformed to ASCII.',
));
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index a473e0d091..f501dc074d 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -677,7 +677,7 @@ $lang = array_merge($lang, array(
'SEARCH_POSTS_BY' => 'Search posts by',
'SEARCH_SELF' => 'Your posts',
'SEARCH_TOPIC' => 'Search this topic…',
- 'SEARCH_UNANSWERED' => 'Unanswered posts',
+ 'SEARCH_UNANSWERED' => 'Unanswered topics',
'SEARCH_UNREAD' => 'Unread posts',
'SEARCH_USER_POSTS' => 'Search user’s posts',
'SECONDS' => 'Seconds',
@@ -822,7 +822,7 @@ $lang = array_merge($lang, array(
'USERS' => 'Users',
'USE_PERMISSIONS' => 'Test out user’s permissions',
- 'USER_NEW_PERMISSION_DISALLOWED' => 'We are sorry, but you are not authorised to use this feature. You may have just registered here and may need to participate more to be able to use this feature.',
+ 'USER_NEW_PERMISSION_DISALLOWED' => 'We are sorry, but you are not authorised to use this feature. You may have just registered here and may need to participate more in discussions to be able to use this feature.',
'VARIANT_DATE_SEPARATOR' => ' / ', // Used in date format dropdown, eg: "Today, 13:37 / 01 Jan 2007, 13:37" ... to join a relative date with calendar date
'VIEWED' => 'Viewed',
diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php
index ba35aa24c9..88cbaf1533 100644
--- a/phpBB/language/en/install.php
+++ b/phpBB/language/en/install.php
@@ -90,15 +90,19 @@ $lang = array_merge($lang, array(
// Requirements translation
$lang = array_merge($lang, array(
// Filesystem requirements
- 'FILE_NOT_EXISTS' => 'File not exists',
- 'FILE_NOT_EXISTS_EXPLAIN' => 'To be able to install phpBB the %1$s file needs to exist.',
- 'FILE_NOT_WRITABLE' => 'File not writable',
- 'FILE_NOT_WRITABLE_EXPLAIN' => 'To be able to install phpBB the %1$s file needs to be writable.',
-
- 'DIRECTORY_NOT_EXISTS' => 'Directory not exists',
- 'DIRECTORY_NOT_EXISTS_EXPLAIN' => 'To be able to install phpBB the %1$s directory needs to exist.',
- 'DIRECTORY_NOT_WRITABLE' => 'Directory not writable',
- 'DIRECTORY_NOT_WRITABLE_EXPLAIN' => 'To be able to install phpBB the %1$s directory needs to be writable.',
+ 'FILE_NOT_EXISTS' => 'File does not exist',
+ 'FILE_NOT_EXISTS_EXPLAIN' => 'To be able to install phpBB the %1$s file needs to exist.',
+ 'FILE_NOT_EXISTS_EXPLAIN_OPTIONAL' => 'It is recommended that the %1$s file exist for a better forum user experience.',
+ 'FILE_NOT_WRITABLE' => 'File is not writable',
+ 'FILE_NOT_WRITABLE_EXPLAIN' => 'To be able to install phpBB the %1$s file needs to be writable.',
+ 'FILE_NOT_WRITABLE_EXPLAIN_OPTIONAL' => 'It is recommended that the %1$s file be writable for a better forum user experience.',
+
+ 'DIRECTORY_NOT_EXISTS' => 'Directory does not exist',
+ 'DIRECTORY_NOT_EXISTS_EXPLAIN' => 'To be able to install phpBB the %1$s directory needs to exist.',
+ 'DIRECTORY_NOT_EXISTS_EXPLAIN_OPTIONAL' => 'It is recommended that the %1$s directory exist for a better forum user experience.',
+ 'DIRECTORY_NOT_WRITABLE' => 'Directory is not writable',
+ 'DIRECTORY_NOT_WRITABLE_EXPLAIN' => 'To be able to install phpBB the %1$s directory needs to be writable.',
+ 'DIRECTORY_NOT_WRITABLE_EXPLAIN_OPTIONAL' => 'It is recommended that the %1$s directory be writable for a better forum user experience.',
// Server requirements
'PHP_VERSION_REQD' => 'PHP version',
@@ -523,7 +527,7 @@ $lang = array_merge($lang, array(
// Finish conversion
'CONVERT_COMPLETE' => 'Conversion completed',
- 'CONVERT_COMPLETE_EXPLAIN' => 'You have now successfully converted your board to phpBB 3.2. You can now login and <a href="../">access your board</a>. Please ensure that the settings were transferred correctly before enabling your board by deleting the install directory. Remember that help on using phpBB is available online via the <a href="https://www.phpbb.com/support/docs/en/3.2/ug/">Documentation</a> and the <a href="https://www.phpbb.com/community/viewforum.php?f=466">support forums</a>.',
+ 'CONVERT_COMPLETE_EXPLAIN' => 'You have now successfully converted your board to phpBB 3.2. You can now login and <a href="../">access your board</a>. Please ensure that the settings were transferred correctly before enabling your board by deleting the install directory. Remember that help on using phpBB is available online via the <a href="https://www.phpbb.com/support/docs/en/3.3/ug/">Documentation</a> and the <a href="https://www.phpbb.com/community/viewforum.php?f=466">support forums</a>.',
'CONV_ERROR_ATTACH_FTP_DIR' => 'FTP upload for attachments is enabled at the old board. Please disable the FTP upload option and make sure a valid upload directory is specified, then copy all attachment files to this new web accessible directory. Once you have done this, restart the convertor.',
'CONV_ERROR_CONFIG_EMPTY' => 'There is no configuration information available for the conversion.',
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php
index 6063f71d98..ec7f3fe714 100644
--- a/phpBB/language/en/ucp.php
+++ b/phpBB/language/en/ucp.php
@@ -66,7 +66,7 @@ $lang = array_merge($lang, array(
'ACCOUNT_COPPA' => 'Your account has been created but has to be approved, please check your email for details.',
'ACCOUNT_EMAIL_CHANGED' => 'Your account has been updated. However, this board requires account reactivation on email changes. An activation key has been sent to the new email address you provided. Please check your email for further information.',
'ACCOUNT_EMAIL_CHANGED_ADMIN' => 'Your account has been updated. However, this board requires account reactivation by the administrators on email changes. An email has been sent to them and you will be informed when your account has been reactivated.',
- 'ACCOUNT_INACTIVE' => 'Your account has been created. However, this board requires account activation, an activation key has been sent to the email address you provided. Please check your email for further information.',
+ 'ACCOUNT_INACTIVE' => 'Your account has been created. However, this board requires account activation. An activation key has been sent to the email address you provided. Please check your email for further information and also be sure to check your junk mail box. It may take a while to get the email depending on your email provider.',
'ACCOUNT_INACTIVE_ADMIN' => 'Your account has been created. However, this board requires account activation by the administrator group. An email has been sent to them and you will be informed when your account has been activated.',
'ACTIVATION_EMAIL_SENT' => 'The activation email has been sent to your email address.',
'ACTIVATION_EMAIL_SENT_ADMIN' => 'The activation email has been sent to the administrators email addresses.',
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index 759a899de1..bfa28d8d11 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -93,6 +93,12 @@ $default_key = 'c';
$sort_key = $request->variable('sk', $default_key);
$sort_dir = $request->variable('sd', 'a');
+$user_types = array(USER_NORMAL, USER_FOUNDER);
+if ($auth->acl_get('a_user'))
+{
+ $user_types[] = USER_INACTIVE;
+}
+
// What do you want to do today? ... oops, I think that line is taken ...
switch ($mode)
{
@@ -834,7 +840,7 @@ switch ($mode)
$sql = 'SELECT username, user_id, user_colour
FROM ' . USERS_TABLE . '
- WHERE ' . $db->sql_in_set('user_type', array(USER_NORMAL, USER_FOUNDER)) . '
+ WHERE ' . $db->sql_in_set('user_type', $user_types) . '
AND username_clean ' . $db->sql_like_expression(utf8_clean_string($username_chars) . $db->get_any_char());
$result = $db->sql_query_limit($sql, 10);
$user_list = array();
@@ -1231,11 +1237,6 @@ switch ($mode)
);
extract($phpbb_dispatcher->trigger_event('core.memberlist_modify_sql_query_data', compact($vars)));
- $user_types = array(USER_NORMAL, USER_FOUNDER);
- if ($auth->acl_get('a_user'))
- {
- $user_types[] = USER_INACTIVE;
- }
// Count the users ...
$sql = 'SELECT COUNT(u.user_id) AS total_users
FROM ' . USERS_TABLE . " u$sql_from
@@ -1279,7 +1280,8 @@ switch ($mode)
}
$param = call_user_func_array(array($request, 'variable'), $call);
- $param = urlencode($key) . '=' . ((is_string($param)) ? urlencode($param) : $param);
+ // Encode strings, convert everything else to int in order to prevent empty parameters.
+ $param = urlencode($key) . '=' . ((is_string($param)) ? urlencode($param) : (int) $param);
$params[] = $param;
if ($key != 'first_char')
diff --git a/phpBB/phpbb/attachment/delete.php b/phpBB/phpbb/attachment/delete.php
index e093da8865..922f24b5dc 100644
--- a/phpBB/phpbb/attachment/delete.php
+++ b/phpBB/phpbb/attachment/delete.php
@@ -29,7 +29,7 @@ class delete
/** @var driver_interface */
protected $db;
- /** @var \phpbb\event\dispatcher */
+ /** @var dispatcher */
protected $dispatcher;
/** @var filesystem */
diff --git a/phpBB/phpbb/attachment/upload.php b/phpBB/phpbb/attachment/upload.php
index 957558768b..f9863b372c 100644
--- a/phpBB/phpbb/attachment/upload.php
+++ b/phpBB/phpbb/attachment/upload.php
@@ -39,7 +39,7 @@ class upload
/** @var \phpbb\files\upload Upload class */
protected $files_upload;
- /** @var \phpbb\language\language */
+ /** @var language */
protected $language;
/** @var guesser Mimetype guesser */
diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php
index bfeac2dd32..dd7736db4e 100644
--- a/phpBB/phpbb/auth/provider/oauth/oauth.php
+++ b/phpBB/phpbb/auth/provider/oauth/oauth.php
@@ -280,7 +280,13 @@ class oauth extends \phpbb\auth\provider\base
}
$uri_factory = new \OAuth\Common\Http\Uri\UriFactory();
- $current_uri = $uri_factory->createFromSuperGlobalArray($this->request->get_super_global(\phpbb\request\request_interface::SERVER));
+ $super_globals = $this->request->get_super_global(\phpbb\request\request_interface::SERVER);
+ if (!empty($super_globals['HTTP_X_FORWARDED_PROTO']) && $super_globals['HTTP_X_FORWARDED_PROTO'] === 'https')
+ {
+ $super_globals['HTTPS'] = 'on';
+ $super_globals['SERVER_PORT'] = 443;
+ }
+ $current_uri = $uri_factory->createFromSuperGlobalArray($super_globals);
$current_uri->setQuery($query);
$this->current_uri = $current_uri;
diff --git a/phpBB/phpbb/avatar/driver/upload.php b/phpBB/phpbb/avatar/driver/upload.php
index a0c23cb624..2640e1ad1e 100644
--- a/phpBB/phpbb/avatar/driver/upload.php
+++ b/phpBB/phpbb/avatar/driver/upload.php
@@ -179,17 +179,29 @@ class upload extends \phpbb\avatar\driver\driver
$destination = '';
}
+ $filedata = array(
+ 'filename' => $file->get('filename'),
+ 'filesize' => $file->get('filesize'),
+ 'mimetype' => $file->get('mimetype'),
+ 'extension' => $file->get('extension'),
+ 'physical_filename' => $file->get('realname'),
+ 'real_filename' => $file->get('uploadname'),
+ );
+
/**
* Before moving new file in place (and eventually overwriting the existing avatar with the newly uploaded avatar)
*
* @event core.avatar_driver_upload_move_file_before
+ * @var array filedata Array containing uploaded file data
* @var string destination Destination directory where the file is going to be moved
* @var string prefix Prefix for the avatar filename
* @var array row Array with avatar row data
* @var array error Array of errors, if filled in by this event file will not be moved
* @since 3.1.6-RC1
+ * @changed 3.1.9-RC1 Added filedata
*/
$vars = array(
+ 'filedata',
'destination',
'prefix',
'row',
@@ -197,6 +209,8 @@ class upload extends \phpbb\avatar\driver\driver
);
extract($this->dispatcher->trigger_event('core.avatar_driver_upload_move_file_before', compact($vars)));
+ unset($filedata);
+
if (!sizeof($error))
{
// Move file and overwrite any existing image
diff --git a/phpBB/phpbb/cache/driver/file.php b/phpBB/phpbb/cache/driver/file.php
index d994394249..a210d877f0 100644
--- a/phpBB/phpbb/cache/driver/file.php
+++ b/phpBB/phpbb/cache/driver/file.php
@@ -32,9 +32,9 @@ class file extends \phpbb\cache\driver\base
*/
function __construct($cache_dir = null)
{
- global $phpbb_root_path, $phpbb_container;
+ global $phpbb_container;
- $this->cache_dir = !is_null($cache_dir) ? $cache_dir : $phpbb_root_path . 'cache/' . $phpbb_container->getParameter('core.environment') . '/';
+ $this->cache_dir = !is_null($cache_dir) ? $cache_dir : $phpbb_container->getParameter('core.cache_dir');
$this->filesystem = new \phpbb\filesystem\filesystem();
if (!is_dir($this->cache_dir))
diff --git a/phpBB/phpbb/cache/driver/memory.php b/phpBB/phpbb/cache/driver/memory.php
index baae22d809..cc03804705 100644
--- a/phpBB/phpbb/cache/driver/memory.php
+++ b/phpBB/phpbb/cache/driver/memory.php
@@ -25,9 +25,9 @@ abstract class memory extends \phpbb\cache\driver\base
*/
function __construct()
{
- global $phpbb_root_path, $dbname, $table_prefix;
+ global $phpbb_root_path, $dbname, $table_prefix, $phpbb_container;
- $this->cache_dir = $phpbb_root_path . 'cache/';
+ $this->cache_dir = $phpbb_container->getParameter('core.cache_dir');
$this->key_prefix = substr(md5($dbname . $table_prefix), 0, 8) . '_';
if (!isset($this->extension) || !extension_loaded($this->extension))
diff --git a/phpBB/phpbb/captcha/plugins/qa.php b/phpBB/phpbb/captcha/plugins/qa.php
index 4df8a86432..7f804850a4 100644
--- a/phpBB/phpbb/captcha/plugins/qa.php
+++ b/phpBB/phpbb/captcha/plugins/qa.php
@@ -100,6 +100,28 @@ class qa
$db->sql_freeresult($result);
}
+ // final fallback to any language
+ if (!sizeof($this->question_ids))
+ {
+ $this->question_lang = '';
+
+ $sql = 'SELECT q.question_id, q.lang_iso
+ FROM ' . $this->table_captcha_questions . ' q, ' . $this->table_captcha_answers . ' a
+ WHERE q.question_id = a.question_id
+ GROUP BY lang_iso';
+ $result = $db->sql_query($sql, 7200);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ if (empty($this->question_lang))
+ {
+ $this->question_lang = $row['lang_iso'];
+ }
+ $this->question_ids[$row['question_id']] = $row['question_id'];
+ }
+ $db->sql_freeresult($result);
+ }
+
// okay, if there is a confirm_id, we try to load that confirm's state. If not, we try to find one
if (!$this->load_answer() && (!$this->load_confirm_id() || !$this->load_answer()))
{
@@ -198,10 +220,12 @@ class qa
*/
function get_template()
{
- global $template;
+ global $phpbb_log, $template, $user;
- if ($this->is_solved())
+ if ($this->is_solved() || empty($this->question_text) || !count($this->question_ids))
{
+ /** @var \phpbb\log\log_interface $phpbb_log */
+ $phpbb_log->add('critical', $user->data['user_id'], $user->ip, 'LOG_ERROR_CAPTCHA', time(), array($user->lang('CONFIRM_QUESTION_MISSING')));
return false;
}
else
@@ -363,13 +387,15 @@ class qa
*/
function validate()
{
- global $user;
+ global $phpbb_log, $user;
$error = '';
if (!sizeof($this->question_ids))
{
- return false;
+ /** @var \phpbb\log\log_interface $phpbb_log */
+ $phpbb_log->add('critical', $user->data['user_id'], $user->ip, 'LOG_ERROR_CAPTCHA', time(), array($user->lang('CONFIRM_QUESTION_MISSING')));
+ return $user->lang('CONFIRM_QUESTION_MISSING');
}
if (!$this->confirm_id)
diff --git a/phpBB/phpbb/composer.json b/phpBB/phpbb/composer.json
index 758125234f..0b6299d6bc 100644
--- a/phpBB/phpbb/composer.json
+++ b/phpBB/phpbb/composer.json
@@ -26,7 +26,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "3.2.x-dev"
+ "dev-master": "3.3.x-dev"
}
}
}
diff --git a/phpBB/phpbb/console/command/command.php b/phpBB/phpbb/console/command/command.php
index 638c989da2..0124c00d22 100644
--- a/phpBB/phpbb/console/command/command.php
+++ b/phpBB/phpbb/console/command/command.php
@@ -13,6 +13,10 @@
namespace phpbb\console\command;
+use Symfony\Component\Console\Helper\ProgressBar;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Style\SymfonyStyle;
+
abstract class command extends \Symfony\Component\Console\Command\Command
{
/** @var \phpbb\user */
@@ -28,4 +32,45 @@ abstract class command extends \Symfony\Component\Console\Command\Command
$this->user = $user;
parent::__construct();
}
+
+ /**
+ * Create a styled progress bar
+ *
+ * @param int $max Max value for the progress bar
+ * @param SymfonyStyle $io Symfony style output decorator
+ * @param OutputInterface $output The output stream, used to print messages
+ * @param bool $message Should we display message output under the progress bar?
+ * @return ProgressBar
+ */
+ public function create_progress_bar($max, SymfonyStyle $io, OutputInterface $output, $message = false)
+ {
+ $progress = $io->createProgressBar($max);
+ if ($output->getVerbosity() === OutputInterface::VERBOSITY_VERBOSE)
+ {
+ $progress->setFormat('<info>[%percent:3s%%]</info> %message%');
+ $progress->setOverwrite(false);
+ }
+ else if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE)
+ {
+ $progress->setFormat('<info>[%current:s%/%max:s%]</info><comment>[%elapsed%/%estimated%][%memory%]</comment> %message%');
+ $progress->setOverwrite(false);
+ }
+ else
+ {
+ $io->newLine(2);
+ $progress->setFormat(
+ " %current:s%/%max:s% %bar% %percent:3s%%\n" .
+ " " . ($message ? '%message%' : ' ') . " %elapsed:6s%/%estimated:-6s% %memory:6s%\n");
+ $progress->setBarWidth(60);
+ }
+
+ if (!defined('PHP_WINDOWS_VERSION_BUILD'))
+ {
+ $progress->setEmptyBarCharacter('â–‘'); // light shade character \u2591
+ $progress->setProgressCharacter('');
+ $progress->setBarCharacter('â–“'); // dark shade character \u2593
+ }
+
+ return $progress;
+ }
}
diff --git a/phpBB/phpbb/console/command/reparser/reparse.php b/phpBB/phpbb/console/command/reparser/reparse.php
index ddc97a1d1d..b10bd56a58 100644
--- a/phpBB/phpbb/console/command/reparser/reparse.php
+++ b/phpBB/phpbb/console/command/reparser/reparse.php
@@ -122,44 +122,6 @@ class reparse extends \phpbb\console\command\command
}
/**
- * Create a styled progress bar
- *
- * @param integer $max Max value for the progress bar
- * @return \Symfony\Component\Console\Helper\ProgressBar
- */
- protected function create_progress_bar($max)
- {
- $progress = $this->io->createProgressBar($max);
- if ($this->output->getVerbosity() === OutputInterface::VERBOSITY_VERBOSE)
- {
- $progress->setFormat('<info>[%percent:3s%%]</info> %message%');
- $progress->setOverwrite(false);
- }
- else if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE)
- {
- $progress->setFormat('<info>[%current:s%/%max:s%]</info><comment>[%elapsed%/%estimated%][%memory%]</comment> %message%');
- $progress->setOverwrite(false);
- }
- else
- {
- $this->io->newLine(2);
- $progress->setFormat(
- " %current:s%/%max:s% %bar% %percent:3s%%\n" .
- " %message% %elapsed:6s%/%estimated:-6s% %memory:6s%\n");
- $progress->setBarWidth(60);
- }
-
- if (!defined('PHP_WINDOWS_VERSION_BUILD'))
- {
- $progress->setEmptyBarCharacter('â–‘'); // light shade character \u2591
- $progress->setProgressCharacter('');
- $progress->setBarCharacter('â–“'); // dark shade character \u2593
- }
-
- return $progress;
- }
-
- /**
* Executes the command reparser:reparse
*
* @param InputInterface $input
@@ -258,7 +220,7 @@ class reparse extends \phpbb\console\command\command
$this->io->section($this->user->lang('CLI_REPARSER_REPARSE_REPARSING', preg_replace('(^text_reparser\\.)', '', $name), $min, $max));
- $progress = $this->create_progress_bar($max);
+ $progress = $this->create_progress_bar($max, $this->io, $this->output, true);
$progress->setMessage($this->user->lang('CLI_REPARSER_REPARSE_REPARSING_START', preg_replace('(^text_reparser\\.)', '', $name)));
$progress->start();
diff --git a/phpBB/phpbb/console/command/thumbnail/delete.php b/phpBB/phpbb/console/command/thumbnail/delete.php
index e8e4cf568e..cfa9891fbc 100644
--- a/phpBB/phpbb/console/command/thumbnail/delete.php
+++ b/phpBB/phpbb/console/command/thumbnail/delete.php
@@ -91,32 +91,7 @@ class delete extends \phpbb\console\command\command
WHERE thumbnail = 1';
$result = $this->db->sql_query($sql);
- $progress = $io->createProgressBar($nb_missing_thumbnails);
- if ($output->getVerbosity() === OutputInterface::VERBOSITY_VERBOSE)
- {
- $progress->setFormat('<info>[%percent:3s%%]</info> %message%');
- $progress->setOverwrite(false);
- }
- else if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE)
- {
- $progress->setFormat('<info>[%current:s%/%max:s%]</info><comment>[%elapsed%/%estimated%][%memory%]</comment> %message%');
- $progress->setOverwrite(false);
- }
- else
- {
- $io->newLine(2);
- $progress->setFormat(
- " %current:s%/%max:s% %bar% %percent:3s%%\n" .
- " %elapsed:6s%/%estimated:-6s% %memory:6s%\n");
- $progress->setBarWidth(60);
- }
-
- if (!defined('PHP_WINDOWS_VERSION_BUILD'))
- {
- $progress->setEmptyBarCharacter('â–‘'); // light shade character \u2591
- $progress->setProgressCharacter('');
- $progress->setBarCharacter('â–“'); // dark shade character \u2593
- }
+ $progress = $this->create_progress_bar($nb_missing_thumbnails, $io, $output);
$progress->setMessage($this->user->lang('CLI_THUMBNAIL_DELETING'));
diff --git a/phpBB/phpbb/console/command/thumbnail/generate.php b/phpBB/phpbb/console/command/thumbnail/generate.php
index e677db3a97..64f7555336 100644
--- a/phpBB/phpbb/console/command/thumbnail/generate.php
+++ b/phpBB/phpbb/console/command/thumbnail/generate.php
@@ -115,32 +115,7 @@ class generate extends \phpbb\console\command\command
require($this->phpbb_root_path . 'includes/functions_posting.' . $this->php_ext);
}
- $progress = $io->createProgressBar($nb_missing_thumbnails);
- if ($output->getVerbosity() === OutputInterface::VERBOSITY_VERBOSE)
- {
- $progress->setFormat('<info>[%percent:3s%%]</info> %message%');
- $progress->setOverwrite(false);
- }
- else if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE)
- {
- $progress->setFormat('<info>[%current:s%/%max:s%]</info><comment>[%elapsed%/%estimated%][%memory%]</comment> %message%');
- $progress->setOverwrite(false);
- }
- else
- {
- $io->newLine(2);
- $progress->setFormat(
- " %current:s%/%max:s% %bar% %percent:3s%%\n" .
- " %elapsed:6s%/%estimated:-6s% %memory:6s%\n");
- $progress->setBarWidth(60);
- }
-
- if (!defined('PHP_WINDOWS_VERSION_BUILD'))
- {
- $progress->setEmptyBarCharacter('â–‘'); // light shade character \u2591
- $progress->setProgressCharacter('');
- $progress->setBarCharacter('â–“'); // dark shade character \u2593
- }
+ $progress = $this->create_progress_bar($nb_missing_thumbnails, $io, $output);
$progress->setMessage($this->user->lang('CLI_THUMBNAIL_GENERATING'));
diff --git a/phpBB/phpbb/console/command/user/activate.php b/phpBB/phpbb/console/command/user/activate.php
new file mode 100644
index 0000000000..9c85718b4c
--- /dev/null
+++ b/phpBB/phpbb/console/command/user/activate.php
@@ -0,0 +1,218 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+namespace phpbb\console\command\user;
+
+use phpbb\config\config;
+use phpbb\console\command\command;
+use phpbb\db\driver\driver_interface;
+use phpbb\language\language;
+use phpbb\log\log_interface;
+use phpbb\notification\manager;
+use phpbb\user;
+use phpbb\user_loader;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Style\SymfonyStyle;
+
+class activate extends command
+{
+ /** @var driver_interface */
+ protected $db;
+
+ /** @var config */
+ protected $config;
+
+ /** @var language */
+ protected $language;
+
+ /** @var log_interface */
+ protected $log;
+
+ /** @var manager */
+ protected $notifications;
+
+ /** @var user_loader */
+ protected $user_loader;
+
+ /**
+ * phpBB root path
+ *
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * PHP extension.
+ *
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * Construct method
+ *
+ * @param user $user
+ * @param driver_interface $db
+ * @param config $config
+ * @param language $language
+ * @param log_interface $log
+ * @param manager $notifications
+ * @param user_loader $user_loader
+ * @param string $phpbb_root_path
+ * @param string $php_ext
+ */
+ public function __construct(user $user, driver_interface $db, config $config, language $language, log_interface $log, manager $notifications, user_loader $user_loader, $phpbb_root_path, $php_ext)
+ {
+ $this->db = $db;
+ $this->config = $config;
+ $this->language = $language;
+ $this->log = $log;
+ $this->notifications = $notifications;
+ $this->user_loader = $user_loader;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+
+ $this->language->add_lang('acp/users');
+ parent::__construct($user);
+ }
+
+ /**
+ * Sets the command name and description
+ *
+ * @return null
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('user:activate')
+ ->setDescription($this->language->lang('CLI_DESCRIPTION_USER_ACTIVATE'))
+ ->setHelp($this->language->lang('CLI_HELP_USER_ACTIVATE'))
+ ->addArgument(
+ 'username',
+ InputArgument::REQUIRED,
+ $this->language->lang('CLI_DESCRIPTION_USER_ACTIVATE_USERNAME')
+ )
+ ->addOption(
+ 'deactivate',
+ 'd',
+ InputOption::VALUE_NONE,
+ $this->language->lang('CLI_DESCRIPTION_USER_ACTIVATE_DEACTIVATE')
+ )
+ ->addOption(
+ 'send-email',
+ null,
+ InputOption::VALUE_NONE,
+ $this->language->lang('CLI_DESCRIPTION_USER_ADD_OPTION_NOTIFY')
+ )
+ ;
+ }
+
+ /**
+ * Executes the command user:activate
+ *
+ * Activate (or deactivate) a user account
+ *
+ * @param InputInterface $input The input stream used to get the options
+ * @param OutputInterface $output The output stream, used to print messages
+ *
+ * @return int 0 if all is well, 1 if any errors occurred
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $io = new SymfonyStyle($input, $output);
+
+ $name = $input->getArgument('username');
+ $mode = ($input->getOption('deactivate')) ? 'deactivate' : 'activate';
+
+ $user_id = $this->user_loader->load_user_by_username($name);
+ $user_row = $this->user_loader->get_user($user_id);
+
+ if ($user_row['user_id'] == ANONYMOUS)
+ {
+ $io->error($this->language->lang('NO_USER'));
+ return 1;
+ }
+
+ // Check if the user is already active (or inactive)
+ if ($mode == 'activate' && $user_row['user_type'] != USER_INACTIVE)
+ {
+ $io->error($this->language->lang('CLI_DESCRIPTION_USER_ACTIVATE_ACTIVE'));
+ return 1;
+ }
+ else if ($mode == 'deactivate' && $user_row['user_type'] == USER_INACTIVE)
+ {
+ $io->error($this->language->lang('CLI_DESCRIPTION_USER_ACTIVATE_INACTIVE'));
+ return 1;
+ }
+
+ // Activate the user account
+ if (!function_exists('user_active_flip'))
+ {
+ require($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
+ }
+
+ user_active_flip($mode, $user_row['user_id']);
+
+ // Notify the user upon activation
+ if ($mode == 'activate' && $this->config['require_activation'] == USER_ACTIVATION_ADMIN)
+ {
+ $this->send_notification($user_row, $input);
+ }
+
+ // Log and display the result
+ $msg = ($mode == 'activate') ? 'USER_ADMIN_ACTIVATED' : 'USER_ADMIN_DEACTIVED';
+ $log = ($mode == 'activate') ? 'LOG_USER_ACTIVE' : 'LOG_USER_INACTIVE';
+
+ $this->log->add('admin', ANONYMOUS, '', $log, false, array($user_row['username']));
+ $this->log->add('user', ANONYMOUS, '', $log . '_USER', false, array(
+ 'reportee_id' => $user_row['user_id']
+ ));
+
+ $io->success($this->language->lang($msg));
+
+ return 0;
+ }
+
+ /**
+ * Send account activation notification to user
+ *
+ * @param array $user_row The user data array
+ * @param InputInterface $input The input stream used to get the options
+ * @return null
+ */
+ protected function send_notification($user_row, InputInterface $input)
+ {
+ $this->notifications->delete_notifications('notification.type.admin_activate_user', $user_row['user_id']);
+
+ if ($input->getOption('send-email'))
+ {
+ if (!class_exists('messenger'))
+ {
+ require($this->phpbb_root_path . 'includes/functions_messenger.' . $this->php_ext);
+ }
+
+ $messenger = new \messenger(false);
+ $messenger->template('admin_welcome_activated', $user_row['user_lang']);
+ $messenger->set_addresses($user_row);
+ $messenger->anti_abuse_headers($this->config, $this->user);
+ $messenger->assign_vars(array(
+ 'USERNAME' => htmlspecialchars_decode($user_row['username']))
+ );
+
+ $messenger->send(NOTIFY_EMAIL);
+ }
+ }
+}
diff --git a/phpBB/phpbb/console/command/user/add.php b/phpBB/phpbb/console/command/user/add.php
new file mode 100644
index 0000000000..c60a059251
--- /dev/null
+++ b/phpBB/phpbb/console/command/user/add.php
@@ -0,0 +1,334 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+namespace phpbb\console\command\user;
+
+use phpbb\config\config;
+use phpbb\console\command\command;
+use phpbb\db\driver\driver_interface;
+use phpbb\exception\runtime_exception;
+use phpbb\language\language;
+use phpbb\passwords\manager;
+use phpbb\user;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Question\Question;
+use Symfony\Component\Console\Style\SymfonyStyle;
+
+class add extends command
+{
+ /** @var array Array of interactively acquired options */
+ protected $data;
+
+ /** @var driver_interface */
+ protected $db;
+
+ /** @var config */
+ protected $config;
+
+ /** @var language */
+ protected $language;
+
+ /** @var manager */
+ protected $password_manager;
+
+ /**
+ * phpBB root path
+ *
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * PHP extension.
+ *
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * Construct method
+ *
+ * @param user $user
+ * @param driver_interface $db
+ * @param config $config
+ * @param language $language
+ * @param manager $password_manager
+ * @param string $phpbb_root_path
+ * @param string $php_ext
+ */
+ public function __construct(user $user, driver_interface $db, config $config, language $language, manager $password_manager, $phpbb_root_path, $php_ext)
+ {
+ $this->db = $db;
+ $this->config = $config;
+ $this->language = $language;
+ $this->password_manager = $password_manager;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+
+ $this->language->add_lang('ucp');
+ parent::__construct($user);
+ }
+
+ /**
+ * Sets the command name and description
+ *
+ * @return null
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('user:add')
+ ->setDescription($this->language->lang('CLI_DESCRIPTION_USER_ADD'))
+ ->setHelp($this->language->lang('CLI_HELP_USER_ADD'))
+ ->addOption(
+ 'username',
+ 'U',
+ InputOption::VALUE_REQUIRED,
+ $this->language->lang('CLI_DESCRIPTION_USER_ADD_OPTION_USERNAME')
+ )
+ ->addOption(
+ 'password',
+ 'P',
+ InputOption::VALUE_REQUIRED,
+ $this->language->lang('CLI_DESCRIPTION_USER_ADD_OPTION_PASSWORD')
+ )
+ ->addOption(
+ 'email',
+ 'E',
+ InputOption::VALUE_REQUIRED,
+ $this->language->lang('CLI_DESCRIPTION_USER_ADD_OPTION_EMAIL')
+ )
+ ->addOption(
+ 'send-email',
+ null,
+ InputOption::VALUE_NONE,
+ $this->language->lang('CLI_DESCRIPTION_USER_ADD_OPTION_NOTIFY')
+ )
+ ;
+ }
+
+ /**
+ * Executes the command user:add
+ *
+ * Adds a new user to the database. If options are not provided, it will ask for the username, password and email.
+ * User is added to the registered user group. Language and timezone default to $config settings.
+ *
+ * @param InputInterface $input The input stream used to get the options
+ * @param OutputInterface $output The output stream, used to print messages
+ *
+ * @return int 0 if all is well, 1 if any errors occurred
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $io = new SymfonyStyle($input, $output);
+
+ try
+ {
+ $this->validate_user_data();
+ $group_id = $this->get_group_id();
+ }
+ catch (runtime_exception $e)
+ {
+ $io->error($e->getMessage());
+ return 1;
+ }
+
+ $user_row = array(
+ 'username' => $this->data['username'],
+ 'user_password' => $this->password_manager->hash($this->data['new_password']),
+ 'user_email' => $this->data['email'],
+ 'group_id' => $group_id,
+ 'user_timezone' => $this->config['board_timezone'],
+ 'user_lang' => $this->config['default_lang'],
+ 'user_type' => USER_NORMAL,
+ 'user_regdate' => time(),
+ );
+
+ $user_id = (int) user_add($user_row);
+
+ if (!$user_id)
+ {
+ $io->error($this->language->lang('AUTH_NO_PROFILE_CREATED'));
+ return 1;
+ }
+
+ if ($input->getOption('send-email') && $this->config['email_enable'])
+ {
+ $this->send_activation_email($user_id);
+ }
+
+ $io->success($this->language->lang('CLI_USER_ADD_SUCCESS', $this->data['username']));
+
+ return 0;
+ }
+
+ /**
+ * Interacts with the user.
+ *
+ * @param InputInterface $input An InputInterface instance
+ * @param OutputInterface $output An OutputInterface instance
+ */
+ protected function interact(InputInterface $input, OutputInterface $output)
+ {
+ $helper = $this->getHelper('question');
+
+ $this->data = array(
+ 'username' => $input->getOption('username'),
+ 'new_password' => $input->getOption('password'),
+ 'email' => $input->getOption('email'),
+ );
+
+ if (!$this->data['username'])
+ {
+ $question = new Question($this->ask_user('USERNAME'));
+ $this->data['username'] = $helper->ask($input, $output, $question);
+ }
+
+ if (!$this->data['new_password'])
+ {
+ $question = new Question($this->ask_user('PASSWORD'));
+ $question->setValidator(function ($value) use ($helper, $input, $output) {
+ $question = new Question($this->ask_user('CONFIRM_PASSWORD'));
+ $question->setHidden(true);
+ if ($helper->ask($input, $output, $question) != $value)
+ {
+ throw new runtime_exception($this->language->lang('NEW_PASSWORD_ERROR'));
+ }
+ return $value;
+ });
+ $question->setHidden(true);
+ $question->setMaxAttempts(5);
+
+ $this->data['new_password'] = $helper->ask($input, $output, $question);
+ }
+
+ if (!$this->data['email'])
+ {
+ $question = new Question($this->ask_user('EMAIL_ADDRESS'));
+ $this->data['email'] = $helper->ask($input, $output, $question);
+ }
+ }
+
+ /**
+ * Validate the submitted user data
+ *
+ * @throws runtime_exception if any data fails validation
+ * @return null
+ */
+ protected function validate_user_data()
+ {
+ if (!function_exists('validate_data'))
+ {
+ require($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
+ }
+
+ $error = validate_data($this->data, array(
+ 'username' => array(
+ array('string', false, $this->config['min_name_chars'], $this->config['max_name_chars']),
+ array('username', '')),
+ 'new_password' => array(
+ array('string', false, $this->config['min_pass_chars'], $this->config['max_pass_chars']),
+ array('password')),
+ 'email' => array(
+ array('string', false, 6, 60),
+ array('user_email')),
+ ));
+
+ if ($error)
+ {
+ throw new runtime_exception(implode("\n", array_map(array($this->language, 'lang'), $error)));
+ }
+ }
+
+ /**
+ * Get the group id
+ *
+ * Go and find in the database the group_id corresponding to 'REGISTERED'
+ *
+ * @throws runtime_exception if the group id does not exist in database.
+ * @return null
+ */
+ protected function get_group_id()
+ {
+ $sql = 'SELECT group_id
+ FROM ' . GROUPS_TABLE . "
+ WHERE group_name = '" . $this->db->sql_escape('REGISTERED') . "'
+ AND group_type = " . GROUP_SPECIAL;
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if (!$row || !$row['group_id'])
+ {
+ throw new runtime_exception($this->language->lang('NO_GROUP'));
+ }
+
+ return $row['group_id'];
+ }
+
+ /**
+ * Send account activation email
+ *
+ * @param int $user_id The new user's id
+ * @return null
+ */
+ protected function send_activation_email($user_id)
+ {
+ switch ($this->config['require_activation'])
+ {
+ case USER_ACTIVATION_SELF:
+ $email_template = 'user_welcome_inactive';
+ $user_actkey = gen_rand_string(mt_rand(6, 10));
+ break;
+ case USER_ACTIVATION_ADMIN:
+ $email_template = 'admin_welcome_inactive';
+ $user_actkey = gen_rand_string(mt_rand(6, 10));
+ break;
+ default:
+ $email_template = 'user_welcome';
+ $user_actkey = '';
+ break;
+ }
+
+ if (!class_exists('messenger'))
+ {
+ require($this->phpbb_root_path . 'includes/functions_messenger.' . $this->php_ext);
+ }
+
+ $messenger = new \messenger(false);
+ $messenger->template($email_template, $this->user->lang_name);
+ $messenger->to($this->data['email'], $this->data['username']);
+ $messenger->anti_abuse_headers($this->config, $this->user);
+ $messenger->assign_vars(array(
+ 'WELCOME_MSG' => htmlspecialchars_decode($this->language->lang('WELCOME_SUBJECT', $this->config['sitename'])),
+ 'USERNAME' => htmlspecialchars_decode($this->data['username']),
+ 'PASSWORD' => htmlspecialchars_decode($this->data['new_password']),
+ 'U_ACTIVATE' => generate_board_url() . "/ucp.{$this->php_ext}?mode=activate&u=$user_id&k=$user_actkey")
+ );
+
+ $messenger->send(NOTIFY_EMAIL);
+ }
+
+ /**
+ * Helper to translate questions to the user
+ *
+ * @param string $key The language key
+ * @return string The language key translated with a colon and space appended
+ */
+ protected function ask_user($key)
+ {
+ return $this->language->lang($key) . $this->language->lang('COLON') . ' ';
+ }
+}
diff --git a/phpBB/phpbb/console/command/user/delete.php b/phpBB/phpbb/console/command/user/delete.php
new file mode 100644
index 0000000000..8593541c1a
--- /dev/null
+++ b/phpBB/phpbb/console/command/user/delete.php
@@ -0,0 +1,170 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+namespace phpbb\console\command\user;
+
+use phpbb\console\command\command;
+use phpbb\db\driver\driver_interface;
+use phpbb\language\language;
+use phpbb\log\log_interface;
+use phpbb\user;
+use phpbb\user_loader;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Question\ConfirmationQuestion;
+use Symfony\Component\Console\Style\SymfonyStyle;
+
+class delete extends command
+{
+ /** @var driver_interface */
+ protected $db;
+
+ /** @var language */
+ protected $language;
+
+ /** @var log_interface */
+ protected $log;
+
+ /** @var user_loader */
+ protected $user_loader;
+
+ /**
+ * phpBB root path
+ *
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * PHP extension.
+ *
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * Construct method
+ *
+ * @param user $user
+ * @param driver_interface $db
+ * @param language $language
+ * @param log_interface $log
+ * @param user_loader $user_loader
+ * @param string $phpbb_root_path
+ * @param string $php_ext
+ */
+ public function __construct(user $user, driver_interface $db, language $language, log_interface $log, user_loader $user_loader, $phpbb_root_path, $php_ext)
+ {
+ $this->db = $db;
+ $this->language = $language;
+ $this->log = $log;
+ $this->user_loader = $user_loader;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+
+ $this->language->add_lang('acp/users');
+ parent::__construct($user);
+ }
+
+ /**
+ * Sets the command name and description
+ *
+ * @return null
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('user:delete')
+ ->setDescription($this->language->lang('CLI_DESCRIPTION_USER_DELETE'))
+ ->addArgument(
+ 'username',
+ InputArgument::REQUIRED,
+ $this->language->lang('CLI_DESCRIPTION_USER_DELETE_USERNAME')
+ )
+ ->addOption(
+ 'delete-posts',
+ null,
+ InputOption::VALUE_NONE,
+ $this->language->lang('CLI_DESCRIPTION_USER_DELETE_OPTION_POSTS')
+ )
+ ;
+ }
+
+ /**
+ * Executes the command user:delete
+ *
+ * Deletes a user from the database. An option to delete the user's posts
+ * is available, by default posts will be retained.
+ *
+ * @param InputInterface $input The input stream used to get the options
+ * @param OutputInterface $output The output stream, used to print messages
+ *
+ * @return int 0 if all is well, 1 if any errors occurred
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $name = $input->getArgument('username');
+ $mode = ($input->getOption('delete-posts')) ? 'remove' : 'retain';
+
+ if ($name)
+ {
+ $io = new SymfonyStyle($input, $output);
+
+ $user_id = $this->user_loader->load_user_by_username($name);
+ $user_row = $this->user_loader->get_user($user_id);
+
+ if ($user_row['user_id'] == ANONYMOUS)
+ {
+ $io->error($this->language->lang('NO_USER'));
+ return 1;
+ }
+
+ if (!function_exists('user_delete'))
+ {
+ require($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
+ }
+
+ user_delete($mode, $user_row['user_id'], $user_row['username']);
+
+ $this->log->add('admin', ANONYMOUS, '', 'LOG_USER_DELETED', false, array($user_row['username']));
+
+ $io->success($this->language->lang('USER_DELETED'));
+ }
+
+ return 0;
+ }
+
+ /**
+ * Interacts with the user.
+ * Confirm they really want to delete the account...last chance!
+ *
+ * @param InputInterface $input An InputInterface instance
+ * @param OutputInterface $output An OutputInterface instance
+ */
+ protected function interact(InputInterface $input, OutputInterface $output)
+ {
+ $helper = $this->getHelper('question');
+
+ $question = new ConfirmationQuestion(
+ $this->language->lang('CLI_USER_DELETE_CONFIRM', $input->getArgument('username')),
+ false
+ );
+
+ if (!$helper->ask($input, $output, $question))
+ {
+ $input->setArgument('username', false);
+ }
+ }
+}
diff --git a/phpBB/phpbb/console/command/user/reclean.php b/phpBB/phpbb/console/command/user/reclean.php
new file mode 100644
index 0000000000..1a89f13382
--- /dev/null
+++ b/phpBB/phpbb/console/command/user/reclean.php
@@ -0,0 +1,158 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+namespace phpbb\console\command\user;
+
+use phpbb\console\command\command;
+use phpbb\db\driver\driver_interface;
+use phpbb\language\language;
+use phpbb\user;
+use Symfony\Component\Console\Helper\ProgressBar;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Style\SymfonyStyle;
+
+class reclean extends command
+{
+ /** @var driver_interface */
+ protected $db;
+
+ /** @var language */
+ protected $language;
+
+ /** @var int A count of the number of re-cleaned user names */
+ protected $processed;
+
+ /** @var ProgressBar */
+ protected $progress;
+
+ /**
+ * Construct method
+ *
+ * @param user $user
+ * @param driver_interface $db
+ * @param language $language
+ */
+ public function __construct(user $user, driver_interface $db, language $language)
+ {
+ $this->db = $db;
+ $this->language = $language;
+
+ parent::__construct($user);
+ }
+
+ /**
+ * Sets the command name and description
+ *
+ * @return null
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('user:reclean')
+ ->setDescription($this->language->lang('CLI_DESCRIPTION_USER_RECLEAN'))
+ ->setHelp($this->language->lang('CLI_HELP_USER_RECLEAN'))
+ ;
+ }
+
+ /**
+ * Executes the command user:reclean
+ *
+ * Cleans user names that are unclean.
+ *
+ * @param InputInterface $input The input stream used to get the options
+ * @param OutputInterface $output The output stream, used to print messages
+ *
+ * @return int 0 if all is well, 1 if any errors occurred
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $io = new SymfonyStyle($input, $output);
+
+ $io->section($this->language->lang('CLI_USER_RECLEAN_START'));
+
+ $this->processed = 0;
+
+ $this->progress = $this->create_progress_bar($this->get_count(), $io, $output);
+ $this->progress->setMessage($this->language->lang('CLI_USER_RECLEAN_START'));
+ $this->progress->start();
+
+ $stage = 0;
+ while ($stage !== true)
+ {
+ $stage = $this->reclean_usernames($stage);
+ }
+
+ $this->progress->finish();
+
+ $io->newLine(2);
+ $io->success($this->language->lang('CLI_USER_RECLEAN_DONE', $this->processed));
+
+ return 0;
+ }
+
+ /**
+ * Re-clean user names
+ * Only user names that are unclean will be re-cleaned
+ *
+ * @param int $start An offset index
+ * @return bool|int Return the next offset index or true if all records have been processed.
+ */
+ protected function reclean_usernames($start = 0)
+ {
+ $limit = 500;
+ $i = 0;
+
+ $this->db->sql_transaction('begin');
+
+ $sql = 'SELECT user_id, username, username_clean FROM ' . USERS_TABLE;
+ $result = $this->db->sql_query_limit($sql, $limit, $start);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $i++;
+ $username_clean = $this->db->sql_escape(utf8_clean_string($row['username']));
+
+ if ($username_clean != $row['username_clean'])
+ {
+ $sql = 'UPDATE ' . USERS_TABLE . "
+ SET username_clean = '$username_clean'
+ WHERE user_id = {$row['user_id']}";
+ $this->db->sql_query($sql);
+
+ $this->processed++;
+ }
+
+ $this->progress->advance();
+ }
+ $this->db->sql_freeresult($result);
+
+ $this->db->sql_transaction('commit');
+
+ return ($i < $limit) ? true : $start + $i;
+ }
+
+ /**
+ * Get the count of users in the database
+ *
+ * @return int
+ */
+ protected function get_count()
+ {
+ $sql = 'SELECT COUNT(user_id) AS count FROM ' . USERS_TABLE;
+ $result = $this->db->sql_query($sql);
+ $count = (int) $this->db->sql_fetchfield('count');
+ $this->db->sql_freeresult($result);
+
+ return $count;
+ }
+}
diff --git a/phpBB/phpbb/controller/helper.php b/phpBB/phpbb/controller/helper.php
index e98de0e771..664b4f4e0f 100644
--- a/phpBB/phpbb/controller/helper.php
+++ b/phpBB/phpbb/controller/helper.php
@@ -52,15 +52,15 @@ class helper
protected $routing_helper;
/**
- * Constructor
- *
- * @param \phpbb\template\template $template Template object
- * @param \phpbb\user $user User object
- * @param \phpbb\config\config $config Config object
- * @param \phpbb\symfony_request $symfony_request Symfony Request object
- * @param \phpbb\request\request_interface $request phpBB request object
- * @param \phpbb\routing\helper $routing_helper Helper to generate the routes
- */
+ * Constructor
+ *
+ * @param \phpbb\template\template $template Template object
+ * @param \phpbb\user $user User object
+ * @param \phpbb\config\config $config Config object
+ * @param \phpbb\symfony_request $symfony_request Symfony Request object
+ * @param \phpbb\request\request_interface $request phpBB request object
+ * @param \phpbb\routing\helper $routing_helper Helper to generate the routes
+ */
public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, \phpbb\symfony_request $symfony_request, \phpbb\request\request_interface $request, \phpbb\routing\helper $routing_helper)
{
$this->template = $template;
@@ -80,12 +80,13 @@ class helper
* @param bool $display_online_list Do we display online users list
* @param int $item_id Restrict online users to item id
* @param string $item Restrict online users to a certain session item, e.g. forum for session_forum_id
+ * @param bool $send_headers Whether headers should be sent by page_header(). Defaults to false for controllers.
*
* @return Response object containing rendered page
*/
- public function render($template_file, $page_title = '', $status_code = 200, $display_online_list = false, $item_id = 0, $item = 'forum')
+ public function render($template_file, $page_title = '', $status_code = 200, $display_online_list = false, $item_id = 0, $item = 'forum', $send_headers = false)
{
- page_header($page_title, $display_online_list, $item_id, $item);
+ page_header($page_title, $display_online_list, $item_id, $item, $send_headers);
$this->template->set_filenames(array(
'body' => $template_file,
@@ -93,7 +94,9 @@ class helper
page_footer(true, false, false);
- return new Response($this->template->assign_display('body'), $status_code);
+ $headers = !empty($this->user->data['is_bot']) ? array('X-PHPBB-IS-BOT' => 'yes') : array();
+
+ return new Response($this->template->assign_display('body'), $status_code, $headers);
}
/**
diff --git a/phpBB/phpbb/controller/resolver.php b/phpBB/phpbb/controller/resolver.php
index 4f432c3323..f8dffc12de 100644
--- a/phpBB/phpbb/controller/resolver.php
+++ b/phpBB/phpbb/controller/resolver.php
@@ -126,9 +126,21 @@ class resolver implements ControllerResolverInterface
*/
public function getArguments(Request $request, $controller)
{
- // At this point, $controller contains the object and method name
- list($object, $method) = $controller;
- $mirror = new \ReflectionMethod($object, $method);
+ // At this point, $controller should be a callable
+ if (is_array($controller))
+ {
+ list($object, $method) = $controller;
+ $mirror = new \ReflectionMethod($object, $method);
+ }
+ else if (is_object($controller) && !$controller instanceof \Closure)
+ {
+ $mirror = new \ReflectionObject($controller);
+ $mirror = $mirror->getMethod('__invoke');
+ }
+ else
+ {
+ $mirror = new \ReflectionFunction($controller);
+ }
$arguments = array();
$parameters = $mirror->getParameters();
diff --git a/phpBB/phpbb/cron/task/core/queue.php b/phpBB/phpbb/cron/task/core/queue.php
index a9345a44df..eca69a5041 100644
--- a/phpBB/phpbb/cron/task/core/queue.php
+++ b/phpBB/phpbb/cron/task/core/queue.php
@@ -20,20 +20,23 @@ class queue extends \phpbb\cron\task\base
{
protected $phpbb_root_path;
protected $php_ext;
+ protected $cache_dir;
protected $config;
/**
- * Constructor.
- *
- * @param string $phpbb_root_path The root path
- * @param string $php_ext PHP file extension
- * @param \phpbb\config\config $config The config
- */
- public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config)
+ * Constructor.
+ *
+ * @param string $phpbb_root_path The root path
+ * @param string $php_ext PHP file extension
+ * @param \phpbb\config\config $config The config
+ * @param string $cache_dir phpBB cache directory
+ */
+ public function __construct($phpbb_root_path, $php_ext, \phpbb\config\config $config, $cache_dir)
{
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
$this->config = $config;
+ $this->cache_dir = $cache_dir;
}
/**
@@ -60,7 +63,7 @@ class queue extends \phpbb\cron\task\base
*/
public function is_runnable()
{
- return file_exists($this->phpbb_root_path . 'cache/queue.' . $this->php_ext);
+ return file_exists($this->cache_dir . 'queue.' . $this->php_ext);
}
/**
diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php
index 30cb667344..214c5590e7 100644
--- a/phpBB/phpbb/db/driver/driver.php
+++ b/phpBB/phpbb/db/driver/driver.php
@@ -1041,6 +1041,7 @@ abstract class driver implements driver_interface
<html dir="ltr">
<head>
<meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>SQL Report</title>
<link href="' . htmlspecialchars($phpbb_path_helper->update_web_root_path($phpbb_root_path) . $phpbb_path_helper->get_adm_relative_path()) . 'style/admin.css" rel="stylesheet" type="text/css" media="screen" />
</head>
diff --git a/phpBB/phpbb/db/migration/data/v310/alpha1.php b/phpBB/phpbb/db/migration/data/v310/alpha1.php
index 1df85bc64c..4a48d2830a 100644
--- a/phpBB/phpbb/db/migration/data/v310/alpha1.php
+++ b/phpBB/phpbb/db/migration/data/v310/alpha1.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v310;
class alpha1 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-a1', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v310/alpha2.php b/phpBB/phpbb/db/migration/data/v310/alpha2.php
index 78bc755ec9..bfbcc4f6f5 100644
--- a/phpBB/phpbb/db/migration/data/v310/alpha2.php
+++ b/phpBB/phpbb/db/migration/data/v310/alpha2.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v310;
class alpha2 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-a2', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v310/alpha3.php b/phpBB/phpbb/db/migration/data/v310/alpha3.php
index 574d19d2f4..bb0f904fd4 100644
--- a/phpBB/phpbb/db/migration/data/v310/alpha3.php
+++ b/phpBB/phpbb/db/migration/data/v310/alpha3.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v310;
class alpha3 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-a3', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v310/beta1.php b/phpBB/phpbb/db/migration/data/v310/beta1.php
index 84887bd58e..9feba5235d 100644
--- a/phpBB/phpbb/db/migration/data/v310/beta1.php
+++ b/phpBB/phpbb/db/migration/data/v310/beta1.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v310;
class beta1 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-b1', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v310/beta2.php b/phpBB/phpbb/db/migration/data/v310/beta2.php
index 458e305c7b..d5e31ce4cb 100644
--- a/phpBB/phpbb/db/migration/data/v310/beta2.php
+++ b/phpBB/phpbb/db/migration/data/v310/beta2.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v310;
class beta2 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-b2', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v310/beta3.php b/phpBB/phpbb/db/migration/data/v310/beta3.php
index a6c62bf936..78c61e8e90 100644
--- a/phpBB/phpbb/db/migration/data/v310/beta3.php
+++ b/phpBB/phpbb/db/migration/data/v310/beta3.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v310;
class beta3 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-b3', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v310/beta4.php b/phpBB/phpbb/db/migration/data/v310/beta4.php
index 3e91d95178..e634785c38 100644
--- a/phpBB/phpbb/db/migration/data/v310/beta4.php
+++ b/phpBB/phpbb/db/migration/data/v310/beta4.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v310;
class beta4 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-b4', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v310/gold.php b/phpBB/phpbb/db/migration/data/v310/gold.php
index e84c7ee951..188851f87d 100644
--- a/phpBB/phpbb/db/migration/data/v310/gold.php
+++ b/phpBB/phpbb/db/migration/data/v310/gold.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v310;
class gold extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php b/phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php
index aad8e44681..295f2d2a14 100644
--- a/phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php
+++ b/phpBB/phpbb/db/migration/data/v310/passwords_convert_p1.php
@@ -56,19 +56,16 @@ class passwords_convert_p1 extends \phpbb\db\migration\migration
{
// Use $CP$ prefix for passwords that need to
// be converted and set pass convert to false.
- $update_users[$user_id] = array(
- 'user_password' => '$CP$' . $row['user_password'],
- 'user_pass_convert' => 0,
- );
+ $update_users[$user_id] = '$CP$' . $row['user_password'];
}
}
$this->db->sql_freeresult($result);
- foreach ($update_users as $user_id => $user_data)
+ foreach ($update_users as $user_id => $user_password)
{
- $sql = 'UPDATE ' . $this->table_prefix . 'users
- SET ' . $this->db->sql_build_array('UPDATE', $user_data) . '
- WHERE user_id = ' . $user_id;
+ $sql = 'UPDATE ' . $this->table_prefix . "users
+ SET user_password = '" . $this->db->sql_escape($user_password) . "'
+ WHERE user_id = $user_id";
$this->sql_query($sql);
}
diff --git a/phpBB/phpbb/db/migration/data/v310/rc1.php b/phpBB/phpbb/db/migration/data/v310/rc1.php
index 10ba7fefff..751208c6ca 100644
--- a/phpBB/phpbb/db/migration/data/v310/rc1.php
+++ b/phpBB/phpbb/db/migration/data/v310/rc1.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v310;
class rc1 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-RC1', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v310/rc2.php b/phpBB/phpbb/db/migration/data/v310/rc2.php
index e1323659da..5cd0393a13 100644
--- a/phpBB/phpbb/db/migration/data/v310/rc2.php
+++ b/phpBB/phpbb/db/migration/data/v310/rc2.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v310;
class rc2 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-RC2', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v310/rc3.php b/phpBB/phpbb/db/migration/data/v310/rc3.php
index 0e6a452251..9fb483ef6a 100644
--- a/phpBB/phpbb/db/migration/data/v310/rc3.php
+++ b/phpBB/phpbb/db/migration/data/v310/rc3.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v310;
class rc3 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-RC3', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v310/rc4.php b/phpBB/phpbb/db/migration/data/v310/rc4.php
index 47de8291c1..0d756c762c 100644
--- a/phpBB/phpbb/db/migration/data/v310/rc4.php
+++ b/phpBB/phpbb/db/migration/data/v310/rc4.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v310;
class rc4 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-RC4', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v310/rc5.php b/phpBB/phpbb/db/migration/data/v310/rc5.php
index 5b6f70e32e..d92537d877 100644
--- a/phpBB/phpbb/db/migration/data/v310/rc5.php
+++ b/phpBB/phpbb/db/migration/data/v310/rc5.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v310;
class rc5 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-RC5', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v310/rc6.php b/phpBB/phpbb/db/migration/data/v310/rc6.php
index b84f2edcc9..1df502a1e4 100644
--- a/phpBB/phpbb/db/migration/data/v310/rc6.php
+++ b/phpBB/phpbb/db/migration/data/v310/rc6.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v310;
class rc6 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.0-RC6', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v31x/v311.php b/phpBB/phpbb/db/migration/data/v31x/v311.php
index 00844dd4c0..b9d6ed3053 100644
--- a/phpBB/phpbb/db/migration/data/v31x/v311.php
+++ b/phpBB/phpbb/db/migration/data/v31x/v311.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v31x;
class v311 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.1', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v31x/v312.php b/phpBB/phpbb/db/migration/data/v31x/v312.php
index bf49935f4d..114c2b959b 100644
--- a/phpBB/phpbb/db/migration/data/v31x/v312.php
+++ b/phpBB/phpbb/db/migration/data/v31x/v312.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v31x;
class v312 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.2', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v31x/v312rc1.php b/phpBB/phpbb/db/migration/data/v31x/v312rc1.php
index d4b133fc01..e2408d432b 100644
--- a/phpBB/phpbb/db/migration/data/v31x/v312rc1.php
+++ b/phpBB/phpbb/db/migration/data/v31x/v312rc1.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v31x;
class v312rc1 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.2-RC1', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v31x/v313.php b/phpBB/phpbb/db/migration/data/v31x/v313.php
index 5a4e21a9b7..b86788da16 100644
--- a/phpBB/phpbb/db/migration/data/v31x/v313.php
+++ b/phpBB/phpbb/db/migration/data/v31x/v313.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v31x;
class v313 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.3', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v31x/v313rc1.php b/phpBB/phpbb/db/migration/data/v31x/v313rc1.php
index e50754f805..b1dcc03364 100644
--- a/phpBB/phpbb/db/migration/data/v31x/v313rc1.php
+++ b/phpBB/phpbb/db/migration/data/v31x/v313rc1.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v31x;
class v313rc1 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.3-RC1', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v31x/v313rc2.php b/phpBB/phpbb/db/migration/data/v31x/v313rc2.php
index d832d6f502..b701dca5ed 100644
--- a/phpBB/phpbb/db/migration/data/v31x/v313rc2.php
+++ b/phpBB/phpbb/db/migration/data/v31x/v313rc2.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v31x;
class v313rc2 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.3-RC2', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v31x/v314.php b/phpBB/phpbb/db/migration/data/v31x/v314.php
index b7793ca569..82dbbf29c9 100644
--- a/phpBB/phpbb/db/migration/data/v31x/v314.php
+++ b/phpBB/phpbb/db/migration/data/v31x/v314.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v31x;
class v314 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.4', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v31x/v314rc1.php b/phpBB/phpbb/db/migration/data/v31x/v314rc1.php
index 10cdbe3f9c..e7baf0c2ce 100644
--- a/phpBB/phpbb/db/migration/data/v31x/v314rc1.php
+++ b/phpBB/phpbb/db/migration/data/v31x/v314rc1.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v31x;
class v314rc1 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.4-RC1', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v31x/v314rc2.php b/phpBB/phpbb/db/migration/data/v31x/v314rc2.php
index b75b7a9be8..3fc5bf2ad5 100644
--- a/phpBB/phpbb/db/migration/data/v31x/v314rc2.php
+++ b/phpBB/phpbb/db/migration/data/v31x/v314rc2.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v31x;
class v314rc2 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.4-RC2', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v31x/v315.php b/phpBB/phpbb/db/migration/data/v31x/v315.php
index 778cdf717e..d5eacf8dd3 100644
--- a/phpBB/phpbb/db/migration/data/v31x/v315.php
+++ b/phpBB/phpbb/db/migration/data/v31x/v315.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v31x;
class v315 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.5', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v31x/v315rc1.php b/phpBB/phpbb/db/migration/data/v31x/v315rc1.php
index 4cf4472aa7..a58b6a0f2a 100644
--- a/phpBB/phpbb/db/migration/data/v31x/v315rc1.php
+++ b/phpBB/phpbb/db/migration/data/v31x/v315rc1.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v31x;
class v315rc1 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.5-RC1', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v31x/v316.php b/phpBB/phpbb/db/migration/data/v31x/v316.php
index cec113eff2..b3e0060ced 100644
--- a/phpBB/phpbb/db/migration/data/v31x/v316.php
+++ b/phpBB/phpbb/db/migration/data/v31x/v316.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v31x;
class v316 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.6', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v31x/v316rc1.php b/phpBB/phpbb/db/migration/data/v31x/v316rc1.php
index 487cd05e5d..6badfb68d4 100644
--- a/phpBB/phpbb/db/migration/data/v31x/v316rc1.php
+++ b/phpBB/phpbb/db/migration/data/v31x/v316rc1.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v31x;
class v316rc1 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.6-RC1', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v31x/v317.php b/phpBB/phpbb/db/migration/data/v31x/v317.php
index 15ba2a1feb..d95be06ba6 100644
--- a/phpBB/phpbb/db/migration/data/v31x/v317.php
+++ b/phpBB/phpbb/db/migration/data/v31x/v317.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v31x;
class v317 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.7', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v31x/v317pl1.php b/phpBB/phpbb/db/migration/data/v31x/v317pl1.php
index 2e1b0e9b9d..1cb39b03f0 100644
--- a/phpBB/phpbb/db/migration/data/v31x/v317pl1.php
+++ b/phpBB/phpbb/db/migration/data/v31x/v317pl1.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v31x;
class v317pl1 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.7-pl1', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v31x/v317rc1.php b/phpBB/phpbb/db/migration/data/v31x/v317rc1.php
index fa24819094..77759daa66 100644
--- a/phpBB/phpbb/db/migration/data/v31x/v317rc1.php
+++ b/phpBB/phpbb/db/migration/data/v31x/v317rc1.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v31x;
class v317rc1 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.7-RC1', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v31x/v318.php b/phpBB/phpbb/db/migration/data/v31x/v318.php
index b254279a5d..7663529d3a 100644
--- a/phpBB/phpbb/db/migration/data/v31x/v318.php
+++ b/phpBB/phpbb/db/migration/data/v31x/v318.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v31x;
class v318 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.8', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v31x/v318rc1.php b/phpBB/phpbb/db/migration/data/v31x/v318rc1.php
index 8bae95c7d6..2cab5c96d4 100644
--- a/phpBB/phpbb/db/migration/data/v31x/v318rc1.php
+++ b/phpBB/phpbb/db/migration/data/v31x/v318rc1.php
@@ -15,6 +15,11 @@ namespace phpbb\db\migration\data\v31x;
class v318rc1 extends \phpbb\db\migration\migration
{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.8-RC1', '>=');
+ }
+
static public function depends_on()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v31x/v319.php b/phpBB/phpbb/db/migration/data/v31x/v319.php
new file mode 100644
index 0000000000..f773814028
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v319.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v319 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.9', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v319rc1',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.9')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v319rc1.php b/phpBB/phpbb/db/migration/data/v31x/v319rc1.php
new file mode 100644
index 0000000000..9805b45572
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v319rc1.php
@@ -0,0 +1,36 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v319rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.1.9-RC1', '>=');
+ }
+
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v318',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.9-RC1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v320/notifications_board.php b/phpBB/phpbb/db/migration/data/v320/notifications_board.php
index 8a76ebab58..ac1b3a0f2c 100644
--- a/phpBB/phpbb/db/migration/data/v320/notifications_board.php
+++ b/phpBB/phpbb/db/migration/data/v320/notifications_board.php
@@ -34,7 +34,7 @@ class notifications_board extends \phpbb\db\migration\migration
public function update_module()
{
$sql = 'UPDATE ' . MODULES_TABLE . "
- SET auth = 'cfg_allow_board_notifications'
+ SET module_auth = 'cfg_allow_board_notifications'
WHERE module_basename = 'ucp_notifications'
AND module_mode = 'notification_list'";
$this->sql_query($sql);
diff --git a/phpBB/phpbb/db/tools/mssql.php b/phpBB/phpbb/db/tools/mssql.php
index a90a85bbb2..87719acd21 100644
--- a/phpBB/phpbb/db/tools/mssql.php
+++ b/phpBB/phpbb/db/tools/mssql.php
@@ -605,7 +605,7 @@ class mssql extends tools
if (!empty($column_data['default']))
{
// 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 . ']';
+ $statements[] = 'ALTER TABLE [' . $table_name . '] ADD CONSTRAINT [DF_' . $table_name . '_' . $column_name . '_1] ' . $column_data['default'] . ' FOR [' . $column_name . ']';
}
if (!empty($indexes))
diff --git a/phpBB/phpbb/di/container_builder.php b/phpBB/phpbb/di/container_builder.php
index 2fb248082f..b6854673c2 100644
--- a/phpBB/phpbb/di/container_builder.php
+++ b/phpBB/phpbb/di/container_builder.php
@@ -14,6 +14,8 @@
namespace phpbb\di;
use phpbb\filesystem\filesystem;
+use Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator;
+use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper;
use Symfony\Component\Config\ConfigCache;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
@@ -460,7 +462,10 @@ class container_builder
{
try
{
- $dumper = new PhpDumper($this->container);
+ $dumper = new PhpDumper($this->container);
+ $proxy_dumper = new ProxyDumper();
+ $dumper->setProxyDumper($proxy_dumper);
+
$cached_container_dump = $dumper->dump(array(
'class' => 'phpbb_cache_container',
'base_class' => 'Symfony\\Component\\DependencyInjection\\ContainerBuilder',
@@ -483,6 +488,7 @@ class container_builder
protected function create_container(array $extensions)
{
$container = new ContainerBuilder(new ParameterBag($this->get_core_parameters()));
+ $container->setProxyInstantiator(new RuntimeInstantiator());
$extensions_alias = array();
@@ -522,6 +528,7 @@ class container_builder
'core.php_ext' => $this->php_ext,
'core.environment' => $this->get_environment(),
'core.debug' => defined('DEBUG') ? DEBUG : false,
+ 'core.cache_dir' => $this->get_cache_dir(),
),
$this->get_env_parameters()
);
@@ -555,7 +562,13 @@ class container_builder
*/
protected function get_container_filename()
{
- return $this->get_cache_dir() . 'container_' . md5($this->phpbb_root_path) . '.' . $this->php_ext;
+ $container_params = [
+ 'phpbb_root_path' => $this->phpbb_root_path,
+ 'use_extensions' => $this->use_extensions,
+ 'config_path' => $this->config_path,
+ ];
+
+ return $this->get_cache_dir() . 'container_' . md5(implode(',', $container_params)) . '.' . $this->php_ext;
}
/**
@@ -565,7 +578,13 @@ class container_builder
*/
protected function get_autoload_filename()
{
- return $this->get_cache_dir() . 'autoload_' . md5($this->phpbb_root_path) . '.' . $this->php_ext;
+ $container_params = [
+ 'phpbb_root_path' => $this->phpbb_root_path,
+ 'use_extensions' => $this->use_extensions,
+ 'config_path' => $this->config_path,
+ ];
+
+ return $this->get_cache_dir() . 'autoload_' . md5(implode(',', $container_params)) . '.' . $this->php_ext;
}
/**
diff --git a/phpBB/phpbb/di/extension/core.php b/phpBB/phpbb/di/extension/core.php
index c48a80a558..29c0b0e44e 100644
--- a/phpBB/phpbb/di/extension/core.php
+++ b/phpBB/phpbb/di/extension/core.php
@@ -24,6 +24,8 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
*/
class core extends Extension
{
+ const TWIG_OPTIONS_POSITION = 6;
+
/**
* Config path
* @var string
@@ -71,7 +73,7 @@ class core extends Extension
// Set the Twig options if defined in the environment
$definition = $container->getDefinition('template.twig.environment');
- $twig_environment_options = $definition->getArgument(7);
+ $twig_environment_options = $definition->getArgument(static::TWIG_OPTIONS_POSITION);
if ($config['twig']['debug'])
{
$twig_environment_options['debug'] = true;
@@ -81,8 +83,8 @@ class core extends Extension
$twig_environment_options['auto_reload'] = true;
}
- // Replace the 8th argument, the options passed to the environment
- $definition->replaceArgument(7, $twig_environment_options);
+ // Replace the 7th argument, the options passed to the environment
+ $definition->replaceArgument(static::TWIG_OPTIONS_POSITION, $twig_environment_options);
if ($config['twig']['enable_debug_extension'])
{
diff --git a/phpBB/phpbb/install/helper/container_factory.php b/phpBB/phpbb/install/helper/container_factory.php
index 5cf4f8a283..9e372fecde 100644
--- a/phpBB/phpbb/install/helper/container_factory.php
+++ b/phpBB/phpbb/install/helper/container_factory.php
@@ -183,6 +183,9 @@ class container_factory
// Get compatibilty globals and constants
$this->update_helper->include_file('includes/compatibility_globals.' . $this->php_ext);
+
+ register_compatibility_globals();
+
$this->update_helper->include_file('includes/constants.' . $this->php_ext);
}
}
diff --git a/phpBB/phpbb/install/module/install_database/task/add_config_settings.php b/phpBB/phpbb/install/module/install_database/task/add_config_settings.php
index 20b7679ec1..7a2df01de6 100644
--- a/phpBB/phpbb/install/module/install_database/task/add_config_settings.php
+++ b/phpBB/phpbb/install/module/install_database/task/add_config_settings.php
@@ -129,12 +129,19 @@ class add_config_settings extends \phpbb\install\task_base
$this->db->sql_return_on_error(true);
$server_name = $this->install_config->get('server_name');
- $cookie_domain = $this->install_config->get('cookie_domain');
$current_time = time();
$user_ip = phpbb_ip_normalise($this->iohandler->get_server_variable('REMOTE_ADDR'));
$user_ip = ($user_ip === false) ? '' : $user_ip;
$referer = $this->iohandler->get_server_variable('REFERER');
+ // Calculate cookie domain
+ $cookie_domain = $server_name;
+
+ if (strpos($cookie_domain, 'www.') === 0)
+ {
+ $cookie_domain = substr($cookie_domain, 3);
+ }
+
// Set default config and post data, this applies to all DB's
$sql_ary = array(
'INSERT INTO ' . $this->config_table . " (config_name, config_value)
diff --git a/phpBB/phpbb/install/module/requirements/task/check_filesystem.php b/phpBB/phpbb/install/module/requirements/task/check_filesystem.php
index 2aec3915e0..868af39433 100644
--- a/phpBB/phpbb/install/module/requirements/task/check_filesystem.php
+++ b/phpBB/phpbb/install/module/requirements/task/check_filesystem.php
@@ -177,7 +177,9 @@ class check_filesystem extends \phpbb\install\task_base
if (!($exists && $writable))
{
$title = ($exists) ? 'FILE_NOT_WRITABLE' : 'FILE_NOT_EXISTS';
- $description = array($title . '_EXPLAIN', $file);
+ $lang_suffix = '_EXPLAIN';
+ $lang_suffix .= ($failable) ? '_OPTIONAL' : '';
+ $description = array($title . $lang_suffix, $file);
if ($failable)
{
@@ -244,7 +246,9 @@ class check_filesystem extends \phpbb\install\task_base
if (!($exists && $writable))
{
$title = ($exists) ? 'DIRECTORY_NOT_WRITABLE' : 'DIRECTORY_NOT_EXISTS';
- $description = array($title . '_EXPLAIN', $dir);
+ $lang_suffix = '_EXPLAIN';
+ $lang_suffix .= ($failable) ? '_OPTIONAL' : '';
+ $description = array($title . $lang_suffix, $dir);
if ($failable)
{
diff --git a/phpBB/phpbb/install/module/update_database/task/update.php b/phpBB/phpbb/install/module/update_database/task/update.php
index 4b2baf2c23..9fed2317e9 100644
--- a/phpBB/phpbb/install/module/update_database/task/update.php
+++ b/phpBB/phpbb/install/module/update_database/task/update.php
@@ -142,6 +142,7 @@ class update extends task_base
$this->migrator->set_migrations($migrations);
$migration_count = count($this->migrator->get_migrations());
$this->iohandler->set_task_count($migration_count, true);
+ $this->installer_config->set_task_progress_count($migration_count);
$progress_count = $this->installer_config->get('database_update_count', 0);
while (!$this->migrator->finished())
@@ -183,8 +184,6 @@ class update extends task_base
);
}
- $this->iohandler->finish_progress('INLINE_UPDATE_SUCCESSFUL');
-
$this->iohandler->add_success_message('INLINE_UPDATE_SUCCESSFUL');
$this->config->delete('version_update_from');
diff --git a/phpBB/phpbb/install/module/update_filesystem/task/file_check.php b/phpBB/phpbb/install/module/update_filesystem/task/file_check.php
index 5dbee6c259..f4b3870148 100644
--- a/phpBB/phpbb/install/module/update_filesystem/task/file_check.php
+++ b/phpBB/phpbb/install/module/update_filesystem/task/file_check.php
@@ -166,6 +166,7 @@ class file_check extends task_base
}
$this->installer_config->set('update_files', $file_update_info);
+ $this->installer_config->set('update_info', array());
}
/**
diff --git a/phpBB/phpbb/install/module/update_filesystem/task/show_file_status.php b/phpBB/phpbb/install/module/update_filesystem/task/show_file_status.php
index c46c05500a..7f18950cf6 100644
--- a/phpBB/phpbb/install/module/update_filesystem/task/show_file_status.php
+++ b/phpBB/phpbb/install/module/update_filesystem/task/show_file_status.php
@@ -66,11 +66,7 @@ class show_file_status extends task_base
$this->cache = $container->get('cache.driver');
// Initialize compression file updater
- $compression_method = $this->installer_config->get('compression_method', '');
$this->file_updater = $file_updater_factory->get('compression');
- $conflict_archive = $this->file_updater->init($compression_method);
-
- $this->installer_config->set('update_file_conflict_archive', $conflict_archive);
parent::__construct(false);
}
@@ -96,6 +92,10 @@ class show_file_status extends task_base
// Create archive for merge conflicts
if (!empty($merge_conflicts))
{
+ $compression_method = $this->installer_config->get('compression_method', '');
+ $conflict_archive = $this->file_updater->init($compression_method);
+ $this->installer_config->set('update_file_conflict_archive', $conflict_archive);
+
foreach ($merge_conflicts as $filename)
{
$this->file_updater->create_new_file(
@@ -111,9 +111,9 @@ class show_file_status extends task_base
'DOWNLOAD_CONFLICTS',
'DOWNLOAD_CONFLICTS_EXPLAIN'
);
- }
- $this->file_updater->close();
+ $this->file_updater->close();
+ }
// Render update file statuses
$file_update_info = $this->installer_config->get('update_files', array());
@@ -140,10 +140,13 @@ class show_file_status extends task_base
}
else
{
+ $conflict_archive_path = $this->installer_config->get('update_file_conflict_archive', null);
+
// Remove archive
- $this->filesystem->remove(
- $this->installer_config->get('update_file_conflict_archive', null)
- );
+ if ($conflict_archive_path !== null && $this->filesystem->exists($conflict_archive_path))
+ {
+ $this->filesystem->remove($conflict_archive_path);
+ }
$this->installer_config->set('update_file_conflict_archive', null);
}
diff --git a/phpBB/phpbb/install/module_base.php b/phpBB/phpbb/install/module_base.php
index 527447b4a1..93c10bd656 100644
--- a/phpBB/phpbb/install/module_base.php
+++ b/phpBB/phpbb/install/module_base.php
@@ -172,7 +172,7 @@ abstract class module_base implements module_interface
$this->iohandler->send_response();
// Stop execution if resource limit is reached
- if ($this->install_config->get_time_remaining() <= 0 || $this->install_config->get_memory_remaining() <= 0)
+ if ($iterator->valid() && ($this->install_config->get_time_remaining() <= 0 || $this->install_config->get_memory_remaining() <= 0))
{
throw new resource_limit_reached_exception();
}
diff --git a/phpBB/phpbb/module/module_manager.php b/phpBB/phpbb/module/module_manager.php
index a812d06736..7ae16cdb61 100644
--- a/phpBB/phpbb/module/module_manager.php
+++ b/phpBB/phpbb/module/module_manager.php
@@ -356,7 +356,7 @@ class module_manager
$diff = sizeof($moved_modules) * 2;
$moved_ids = array();
- for ($i = 0; $i < sizeof($moved_modules); ++$i)
+ for ($i = 0, $size = sizeof($moved_modules); $i < $size; ++$i)
{
$moved_ids[] = $moved_modules[$i]['module_id'];
}
diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php
index ea1b800dc5..3265bcb629 100644
--- a/phpBB/phpbb/notification/manager.php
+++ b/phpBB/phpbb/notification/manager.php
@@ -899,6 +899,8 @@ class manager
{
$notification_type_ids = $this->cache->get('notification_type_ids');
+ $this->db->sql_transaction('begin');
+
if ($notification_type_ids === false)
{
$notification_type_ids = array();
@@ -933,6 +935,8 @@ class manager
$this->cache->put('notification_type_ids', $notification_type_ids);
}
+ $this->db->sql_transaction('commit');
+
return $notification_type_ids[$notification_type_name];
}
diff --git a/phpBB/phpbb/notification/method/messenger_base.php b/phpBB/phpbb/notification/method/messenger_base.php
index 97bad524e1..812cd6a911 100644
--- a/phpBB/phpbb/notification/method/messenger_base.php
+++ b/phpBB/phpbb/notification/method/messenger_base.php
@@ -104,7 +104,7 @@ abstract class messenger_base extends \phpbb\notification\method\base
$messenger->assign_vars(array_merge(array(
'USERNAME' => $user['username'],
- 'U_NOTIFICATION_SETTINGS' => generate_board_url() . '/ucp.' . $this->php_ext . '?i=ucp_notifications',
+ 'U_NOTIFICATION_SETTINGS' => generate_board_url() . '/ucp.' . $this->php_ext . '?i=ucp_notifications&amp;mode=notification_options',
), $notification->get_email_template_variables()));
$messenger->send($notify_method);
diff --git a/phpBB/phpbb/notification/type/quote.php b/phpBB/phpbb/notification/type/quote.php
index 684463c8c3..323c18b204 100644
--- a/phpBB/phpbb/notification/type/quote.php
+++ b/phpBB/phpbb/notification/type/quote.php
@@ -115,14 +115,14 @@ class quote extends \phpbb\notification\type\post
));
// Find the new users to notify
- $notifications = array_keys($this->find_users_for_notification($post));
+ $notifications = $this->find_users_for_notification($post);
// Find the notifications we must delete
$remove_notifications = array_diff(array_keys($old_notifications), array_keys($notifications));
// Find the notifications we must add
$add_notifications = array();
- foreach (array_diff(array_keys($notifications), $old_notifications) as $user_id)
+ foreach (array_diff(array_keys($notifications), array_keys($old_notifications)) as $user_id)
{
$add_notifications[$user_id] = $notifications[$user_id];
}
diff --git a/phpBB/phpbb/profilefields/type/type_int.php b/phpBB/phpbb/profilefields/type/type_int.php
index dd08df94c1..9dc0181cb8 100644
--- a/phpBB/phpbb/profilefields/type/type_int.php
+++ b/phpBB/phpbb/profilefields/type/type_int.php
@@ -61,9 +61,9 @@ class type_int extends type_base
public function get_options($default_lang_id, $field_data)
{
$options = array(
- 0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => '<input type="number" min="0" max="99999" name="field_length" size="5" value="' . $field_data['field_length'] . '" />'),
- 1 => array('TITLE' => $this->user->lang['MIN_FIELD_NUMBER'], 'FIELD' => '<input type="number" min="0" max="99999" name="field_minlen" size="5" value="' . $field_data['field_minlen'] . '" />'),
- 2 => array('TITLE' => $this->user->lang['MAX_FIELD_NUMBER'], 'FIELD' => '<input type="number" min="0" max="99999" name="field_maxlen" size="5" value="' . $field_data['field_maxlen'] . '" />'),
+ 0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => '<input type="number" min="0" max="99999" name="field_length" value="' . $field_data['field_length'] . '" />'),
+ 1 => array('TITLE' => $this->user->lang['MIN_FIELD_NUMBER'], 'FIELD' => '<input type="number" min="0" max="99999" name="field_minlen" value="' . $field_data['field_minlen'] . '" />'),
+ 2 => array('TITLE' => $this->user->lang['MAX_FIELD_NUMBER'], 'FIELD' => '<input type="number" min="0" max="99999" name="field_maxlen" value="' . $field_data['field_maxlen'] . '" />'),
3 => array('TITLE' => $this->user->lang['DEFAULT_VALUE'], 'FIELD' => '<input type="number" name="field_default_value" value="' . $field_data['field_default_value'] . '" />'),
);
diff --git a/phpBB/phpbb/profilefields/type/type_string.php b/phpBB/phpbb/profilefields/type/type_string.php
index 67befc457d..a8432eaae5 100644
--- a/phpBB/phpbb/profilefields/type/type_string.php
+++ b/phpBB/phpbb/profilefields/type/type_string.php
@@ -61,9 +61,9 @@ class type_string extends type_string_common
public function get_options($default_lang_id, $field_data)
{
$options = array(
- 0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => '<input type="number" min="0" name="field_length" size="5" value="' . $field_data['field_length'] . '" />'),
- 1 => array('TITLE' => $this->user->lang['MIN_FIELD_CHARS'], 'FIELD' => '<input type="number" min="0" name="field_minlen" size="5" value="' . $field_data['field_minlen'] . '" />'),
- 2 => array('TITLE' => $this->user->lang['MAX_FIELD_CHARS'], 'FIELD' => '<input type="number" min="0" name="field_maxlen" size="5" value="' . $field_data['field_maxlen'] . '" />'),
+ 0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => '<input type="number" min="0" max="99999" name="field_length" value="' . $field_data['field_length'] . '" />'),
+ 1 => array('TITLE' => $this->user->lang['MIN_FIELD_CHARS'], 'FIELD' => '<input type="number" min="0" max="99999" name="field_minlen" value="' . $field_data['field_minlen'] . '" />'),
+ 2 => array('TITLE' => $this->user->lang['MAX_FIELD_CHARS'], 'FIELD' => '<input type="number" min="0 max="99999"" name="field_maxlen" value="' . $field_data['field_maxlen'] . '" />'),
3 => array('TITLE' => $this->user->lang['FIELD_VALIDATION'], 'FIELD' => '<select name="field_validation">' . $this->validate_options($field_data) . '</select>'),
);
diff --git a/phpBB/phpbb/profilefields/type/type_text.php b/phpBB/phpbb/profilefields/type/type_text.php
index bacf60a213..79ee82351a 100644
--- a/phpBB/phpbb/profilefields/type/type_text.php
+++ b/phpBB/phpbb/profilefields/type/type_text.php
@@ -61,9 +61,9 @@ class type_text extends type_string_common
public function get_options($default_lang_id, $field_data)
{
$options = array(
- 0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => '<input type="number" min="0" max="99999" name="rows" size="5" value="' . $field_data['rows'] . '" /> ' . $this->user->lang['ROWS'] . '</dd><dd><input type="number" min="0" max="99999" name="columns" size="5" value="' . $field_data['columns'] . '" /> ' . $this->user->lang['COLUMNS'] . ' <input type="hidden" name="field_length" value="' . $field_data['field_length'] . '" />'),
- 1 => array('TITLE' => $this->user->lang['MIN_FIELD_CHARS'], 'FIELD' => '<input type="number" min="0" max="9999999999" name="field_minlen" size="10" value="' . $field_data['field_minlen'] . '" />'),
- 2 => array('TITLE' => $this->user->lang['MAX_FIELD_CHARS'], 'FIELD' => '<input type="number" min="0" max="9999999999" name="field_maxlen" size="10" value="' . $field_data['field_maxlen'] . '" />'),
+ 0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => '<input type="number" min="0" max="99999" name="rows" value="' . $field_data['rows'] . '" /> ' . $this->user->lang['ROWS'] . '</dd><dd><input type="number" min="0" max="99999" name="columns" value="' . $field_data['columns'] . '" /> ' . $this->user->lang['COLUMNS'] . ' <input type="hidden" name="field_length" value="' . $field_data['field_length'] . '" />'),
+ 1 => array('TITLE' => $this->user->lang['MIN_FIELD_CHARS'], 'FIELD' => '<input type="number" min="0" max="9999999999" name="field_minlen" value="' . $field_data['field_minlen'] . '" />'),
+ 2 => array('TITLE' => $this->user->lang['MAX_FIELD_CHARS'], 'FIELD' => '<input type="number" min="0" max="9999999999" name="field_maxlen" value="' . $field_data['field_maxlen'] . '" />'),
3 => array('TITLE' => $this->user->lang['FIELD_VALIDATION'], 'FIELD' => '<select name="field_validation">' . $this->validate_options($field_data) . '</select>'),
);
diff --git a/phpBB/phpbb/profilefields/type/type_url.php b/phpBB/phpbb/profilefields/type/type_url.php
index fe0bffd582..375cf5b19a 100644
--- a/phpBB/phpbb/profilefields/type/type_url.php
+++ b/phpBB/phpbb/profilefields/type/type_url.php
@@ -29,9 +29,9 @@ class type_url extends type_string
public function get_options($default_lang_id, $field_data)
{
$options = array(
- 0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => '<input type="number" min="0" name="field_length" size="5" value="' . $field_data['field_length'] . '" />'),
- 1 => array('TITLE' => $this->user->lang['MIN_FIELD_CHARS'], 'FIELD' => '<input type="number" min="0" name="field_minlen" size="5" value="' . $field_data['field_minlen'] . '" />'),
- 2 => array('TITLE' => $this->user->lang['MAX_FIELD_CHARS'], 'FIELD' => '<input type="number" min="0" name="field_maxlen" size="5" value="' . $field_data['field_maxlen'] . '" />'),
+ 0 => array('TITLE' => $this->user->lang['FIELD_LENGTH'], 'FIELD' => '<input type="number" min="0" max="99999" name="field_length" value="' . $field_data['field_length'] . '" />'),
+ 1 => array('TITLE' => $this->user->lang['MIN_FIELD_CHARS'], 'FIELD' => '<input type="number" min="0" max="99999" name="field_minlen" value="' . $field_data['field_minlen'] . '" />'),
+ 2 => array('TITLE' => $this->user->lang['MAX_FIELD_CHARS'], 'FIELD' => '<input type="number" min="0" max="99999" name="field_maxlen" value="' . $field_data['field_maxlen'] . '" />'),
);
return $options;
diff --git a/phpBB/phpbb/recursive_dot_prefix_filter_iterator.php b/phpBB/phpbb/recursive_dot_prefix_filter_iterator.php
index 2500ba0cf8..1446551b8b 100644
--- a/phpBB/phpbb/recursive_dot_prefix_filter_iterator.php
+++ b/phpBB/phpbb/recursive_dot_prefix_filter_iterator.php
@@ -25,6 +25,6 @@ class recursive_dot_prefix_filter_iterator extends \RecursiveFilterIterator
public function accept()
{
$filename = $this->current()->getFilename();
- return !$this->current()->isDir() || $filename[0] !== '.';
+ return $filename[0] !== '.' || !$this->current()->isDir();
}
}
diff --git a/phpBB/phpbb/request/request.php b/phpBB/phpbb/request/request.php
index 56ce3999ed..4cac6fbaea 100644
--- a/phpBB/phpbb/request/request.php
+++ b/phpBB/phpbb/request/request.php
@@ -325,7 +325,9 @@ class request implements \phpbb\request\request_interface
*/
public function is_secure()
{
- return $this->server('HTTPS') == 'on';
+ $https = $this->server('HTTPS');
+ $https = $this->server('HTTP_X_FORWARDED_PROTO') === 'https' ? 'on' : $https;
+ return !empty($https) && $https !== 'off';
}
/**
diff --git a/phpBB/phpbb/routing/helper.php b/phpBB/phpbb/routing/helper.php
index f56974a354..c15608dce5 100644
--- a/phpBB/phpbb/routing/helper.php
+++ b/phpBB/phpbb/routing/helper.php
@@ -104,6 +104,15 @@ class helper
$context = new RequestContext();
$context->fromRequest($this->symfony_request);
+ if ($this->config['force_server_vars'])
+ {
+ $context->setHost($this->config['server_name']);
+ $context->setScheme(substr($this->config['server_protocol'], 0, -3));
+ $context->setHttpPort($this->config['server_port']);
+ $context->setHttpsPort($this->config['server_port']);
+ $context->setBaseUrl(rtrim($this->config['script_path'], '/'));
+ }
+
$script_name = $this->symfony_request->getScriptName();
$page_name = substr($script_name, -1, 1) == '/' ? '' : utf8_basename($script_name);
@@ -119,7 +128,7 @@ class helper
$base_url = str_replace('/' . $page_name, empty($this->config['enable_mod_rewrite']) ? '/app.' . $this->php_ext : '', $base_url);
// We need to update the base url to move to the directory of the app.php file if the current script is not app.php
- if ($page_name !== 'app.php')
+ if ($page_name !== 'app.php' && !$this->config['force_server_vars'])
{
if (empty($this->config['enable_mod_rewrite']))
{
diff --git a/phpBB/phpbb/routing/router.php b/phpBB/phpbb/routing/router.php
index 5d237b6433..f19886fb0b 100644
--- a/phpBB/phpbb/routing/router.php
+++ b/phpBB/phpbb/routing/router.php
@@ -49,13 +49,6 @@ class router implements RouterInterface
protected $loader;
/**
- * phpBB root path
- *
- * @var string
- */
- protected $phpbb_root_path;
-
- /**
* PHP file extensions
*
* @var string
@@ -63,13 +56,6 @@ class router implements RouterInterface
protected $php_ext;
/**
- * Name of the current environment
- *
- * @var string
- */
- protected $environment;
-
- /**
* @var \Symfony\Component\Routing\Matcher\UrlMatcherInterface|null
*/
protected $matcher;
@@ -90,24 +76,27 @@ class router implements RouterInterface
protected $route_collection;
/**
+ * @var string
+ */
+ protected $cache_dir;
+
+ /**
* Construct method
*
* @param ContainerInterface $container DI container
* @param resources_locator_interface $resources_locator Resources locator
* @param LoaderInterface $loader Resources loader
- * @param string $phpbb_root_path phpBB root path
* @param string $php_ext PHP file extension
- * @param string $environment Name of the current environment
+ * @param string $cache_dir phpBB cache directory
*/
- public function __construct(ContainerInterface $container, resources_locator_interface $resources_locator, LoaderInterface $loader, $phpbb_root_path, $php_ext, $environment)
+ public function __construct(ContainerInterface $container, resources_locator_interface $resources_locator, LoaderInterface $loader, $php_ext, $cache_dir)
{
$this->container = $container;
$this->resources_locator = $resources_locator;
$this->loader = $loader;
- $this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
- $this->environment = $environment;
$this->context = new RequestContext();
+ $this->cache_dir = $cache_dir;
}
/**
@@ -211,7 +200,7 @@ class router implements RouterInterface
{
try
{
- $cache = new ConfigCache("{$this->phpbb_root_path}cache/{$this->environment}/url_matcher.{$this->php_ext}", defined('DEBUG'));
+ $cache = new ConfigCache("{$this->cache_dir}url_matcher.{$this->php_ext}", defined('DEBUG'));
if (!$cache->isFresh())
{
$dumper = new PhpMatcherDumper($this->get_routes());
@@ -266,7 +255,7 @@ class router implements RouterInterface
{
try
{
- $cache = new ConfigCache("{$this->phpbb_root_path}cache/{$this->environment}/url_generator.{$this->php_ext}", defined('DEBUG'));
+ $cache = new ConfigCache("{$this->cache_dir}url_generator.{$this->php_ext}", defined('DEBUG'));
if (!$cache->isFresh())
{
$dumper = new PhpGeneratorDumper($this->get_routes());
diff --git a/phpBB/phpbb/search/fulltext_native.php b/phpBB/phpbb/search/fulltext_native.php
index 521eebb7ee..0fec092d52 100644
--- a/phpBB/phpbb/search/fulltext_native.php
+++ b/phpBB/phpbb/search/fulltext_native.php
@@ -1968,15 +1968,15 @@ class fulltext_native extends \phpbb\search\base
</dl>
<dl>
<dt><label for="fulltext_native_min_chars">' . $this->user->lang['MIN_SEARCH_CHARS'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['MIN_SEARCH_CHARS_EXPLAIN'] . '</span></dt>
- <dd><input id="fulltext_native_min_chars" type="number" size="3" maxlength="3" min="0" max="255" name="config[fulltext_native_min_chars]" value="' . (int) $this->config['fulltext_native_min_chars'] . '" /></dd>
+ <dd><input id="fulltext_native_min_chars" type="number" min="0" max="255" name="config[fulltext_native_min_chars]" value="' . (int) $this->config['fulltext_native_min_chars'] . '" /></dd>
</dl>
<dl>
<dt><label for="fulltext_native_max_chars">' . $this->user->lang['MAX_SEARCH_CHARS'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['MAX_SEARCH_CHARS_EXPLAIN'] . '</span></dt>
- <dd><input id="fulltext_native_max_chars" type="number" size="3" maxlength="3" min="0" max="255" name="config[fulltext_native_max_chars]" value="' . (int) $this->config['fulltext_native_max_chars'] . '" /></dd>
+ <dd><input id="fulltext_native_max_chars" type="number" min="0" max="255" name="config[fulltext_native_max_chars]" value="' . (int) $this->config['fulltext_native_max_chars'] . '" /></dd>
</dl>
<dl>
<dt><label for="fulltext_native_common_thres">' . $this->user->lang['COMMON_WORD_THRESHOLD'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['COMMON_WORD_THRESHOLD_EXPLAIN'] . '</span></dt>
- <dd><input id="fulltext_native_common_thres" type="text" size="3" maxlength="3" name="config[fulltext_native_common_thres]" value="' . (double) $this->config['fulltext_native_common_thres'] . '" /> %</dd>
+ <dd><input id="fulltext_native_common_thres" type="text" name="config[fulltext_native_common_thres]" value="' . (double) $this->config['fulltext_native_common_thres'] . '" /> %</dd>
</dl>
';
diff --git a/phpBB/phpbb/search/fulltext_postgres.php b/phpBB/phpbb/search/fulltext_postgres.php
index 42425cbc6b..8dbc7212a1 100644
--- a/phpBB/phpbb/search/fulltext_postgres.php
+++ b/phpBB/phpbb/search/fulltext_postgres.php
@@ -1087,11 +1087,11 @@ class fulltext_postgres extends \phpbb\search\base
</dl>
<dl>
<dt><label for="fulltext_postgres_min_word_len">' . $this->user->lang['FULLTEXT_POSTGRES_MIN_WORD_LEN'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_POSTGRES_MIN_WORD_LEN_EXPLAIN'] . '</span></dt>
- <dd><input id="fulltext_postgres_min_word_len" type="number" size="3" maxlength="3" min="0" max="255" name="config[fulltext_postgres_min_word_len]" value="' . (int) $this->config['fulltext_postgres_min_word_len'] . '" /></dd>
+ <dd><input id="fulltext_postgres_min_word_len" type="number" min="0" max="255" name="config[fulltext_postgres_min_word_len]" value="' . (int) $this->config['fulltext_postgres_min_word_len'] . '" /></dd>
</dl>
<dl>
<dt><label for="fulltext_postgres_max_word_len">' . $this->user->lang['FULLTEXT_POSTGRES_MAX_WORD_LEN'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_POSTGRES_MAX_WORD_LEN_EXPLAIN'] . '</span></dt>
- <dd><input id="fulltext_postgres_max_word_len" type="number" size="3" maxlength="3" min="0" max="255" name="config[fulltext_postgres_max_word_len]" value="' . (int) $this->config['fulltext_postgres_max_word_len'] . '" /></dd>
+ <dd><input id="fulltext_postgres_max_word_len" type="number" min="0" max="255" name="config[fulltext_postgres_max_word_len]" value="' . (int) $this->config['fulltext_postgres_max_word_len'] . '" /></dd>
</dl>
';
diff --git a/phpBB/phpbb/search/fulltext_sphinx.php b/phpBB/phpbb/search/fulltext_sphinx.php
index 504065e8cd..89c615e087 100644
--- a/phpBB/phpbb/search/fulltext_sphinx.php
+++ b/phpBB/phpbb/search/fulltext_sphinx.php
@@ -952,11 +952,11 @@ class fulltext_sphinx
</dl>
<dl>
<dt><label for="fulltext_sphinx_port">' . $this->user->lang['FULLTEXT_SPHINX_PORT'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_SPHINX_PORT_EXPLAIN'] . '</span></dt>
- <dd><input id="fulltext_sphinx_port" type="number" size="4" maxlength="10" name="config[fulltext_sphinx_port]" value="' . $this->config['fulltext_sphinx_port'] . '" /></dd>
+ <dd><input id="fulltext_sphinx_port" type="number" min="0" max="9999999999" name="config[fulltext_sphinx_port]" value="' . $this->config['fulltext_sphinx_port'] . '" /></dd>
</dl>
<dl>
<dt><label for="fulltext_sphinx_indexer_mem_limit">' . $this->user->lang['FULLTEXT_SPHINX_INDEXER_MEM_LIMIT'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_SPHINX_INDEXER_MEM_LIMIT_EXPLAIN'] . '</span></dt>
- <dd><input id="fulltext_sphinx_indexer_mem_limit" type="number" size="4" maxlength="10" name="config[fulltext_sphinx_indexer_mem_limit]" value="' . $this->config['fulltext_sphinx_indexer_mem_limit'] . '" /> ' . $this->user->lang['MIB'] . '</dd>
+ <dd><input id="fulltext_sphinx_indexer_mem_limit" type="number" min="0" max="9999999999" name="config[fulltext_sphinx_indexer_mem_limit]" value="' . $this->config['fulltext_sphinx_indexer_mem_limit'] . '" /> ' . $this->user->lang['MIB'] . '</dd>
</dl>
<dl>
<dt><label for="fulltext_sphinx_config_file">' . $this->user->lang['FULLTEXT_SPHINX_CONFIG_FILE'] . $this->user->lang['COLON'] . '</label><br /><span>' . $this->user->lang['FULLTEXT_SPHINX_CONFIG_FILE_EXPLAIN'] . '</span></dt>
diff --git a/phpBB/phpbb/template/twig/environment.php b/phpBB/phpbb/template/twig/environment.php
index 56c85c8d71..179412a2e3 100644
--- a/phpBB/phpbb/template/twig/environment.php
+++ b/phpBB/phpbb/template/twig/environment.php
@@ -50,20 +50,18 @@ class environment extends \Twig_Environment
* @param \phpbb\config\config $phpbb_config The phpBB configuration
* @param \phpbb\filesystem\filesystem $filesystem
* @param \phpbb\path_helper $path_helper phpBB path helper
- * @param \Symfony\Component\DependencyInjection\ContainerInterface $container The dependency injection container
* @param string $cache_path The path to the cache directory
* @param \phpbb\extension\manager $extension_manager phpBB extension manager
* @param \Twig_LoaderInterface $loader Twig loader interface
* @param array $options Array of options to pass to Twig
*/
- public function __construct(\phpbb\config\config $phpbb_config, \phpbb\filesystem\filesystem $filesystem, \phpbb\path_helper $path_helper, \Symfony\Component\DependencyInjection\ContainerInterface $container, $cache_path, \phpbb\extension\manager $extension_manager = null, \Twig_LoaderInterface $loader = null, $options = array())
+ public function __construct(\phpbb\config\config $phpbb_config, \phpbb\filesystem\filesystem $filesystem, \phpbb\path_helper $path_helper, $cache_path, \phpbb\extension\manager $extension_manager = null, \Twig_LoaderInterface $loader = null, $options = array())
{
$this->phpbb_config = $phpbb_config;
$this->filesystem = $filesystem;
$this->phpbb_path_helper = $path_helper;
$this->extension_manager = $extension_manager;
- $this->container = $container;
$this->phpbb_root_path = $this->phpbb_path_helper->get_phpbb_root_path();
$this->web_root_path = $this->phpbb_path_helper->get_web_root_path();
@@ -77,25 +75,10 @@ class environment extends \Twig_Environment
'autoescape' => false,
), $options);
- return parent::__construct($loader, $options);
+ parent::__construct($loader, $options);
}
/**
- * {@inheritdoc}
- */
- public function getLexer()
- {
- if (null === $this->lexer)
- {
- $this->lexer = $this->container->get('template.twig.lexer');
- $this->lexer->set_environment($this);
- }
-
- return $this->lexer;
- }
-
-
- /**
* Get the list of enabled phpBB extensions
*
* Used in EVENT node
diff --git a/phpBB/phpbb/textreparser/base.php b/phpBB/phpbb/textreparser/base.php
index 3e5ee248a1..afa5ccacad 100644
--- a/phpBB/phpbb/textreparser/base.php
+++ b/phpBB/phpbb/textreparser/base.php
@@ -230,7 +230,8 @@ abstract class base implements reparser_interface
$unparsed['enable_img_bbcode'],
$unparsed['enable_flash_bbcode'],
$unparsed['enable_quote_bbcode'],
- $unparsed['enable_url_bbcode']
+ $unparsed['enable_url_bbcode'],
+ 'reparse'
);
// Save the new text if it has changed and it's not a dry run
diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php
index 5262e10e87..305510851c 100644
--- a/phpBB/phpbb/user.php
+++ b/phpBB/phpbb/user.php
@@ -595,7 +595,7 @@ class user extends \phpbb\session
$utc = new \DateTimeZone('UTC');
}
- $time = new $this->datetime($this, "@$gmepoch", $utc);
+ $time = new $this->datetime($this, '@' . (int) $gmepoch, $utc);
$time->setTimezone($this->timezone);
return $time->format($format, $forcedate);
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 6cfb877f75..4986909148 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -104,7 +104,7 @@ $vars = array(
extract($phpbb_dispatcher->trigger_event('core.modify_posting_parameters', compact($vars)));
// Was cancel pressed? If so then redirect to the appropriate page
-if ($cancel || ($current_time - $lastclick < 2 && $submit))
+if ($cancel)
{
$f = ($forum_id) ? 'f=' . $forum_id . '&amp;' : '';
$redirect = ($post_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", $f . 'p=' . $post_id) . '#p' . $post_id : (($topic_id) ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", $f . 't=' . $topic_id) : (($forum_id) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id) : append_sid("{$phpbb_root_path}index.$phpEx")));
@@ -602,7 +602,7 @@ if ($post_data['post_attachment'] && !$submit && !$refresh && !$preview && $mode
WHERE post_msg_id = $post_id
AND in_message = 0
AND is_orphan = 0
- ORDER BY filetime DESC";
+ ORDER BY attach_id DESC";
$result = $db->sql_query($sql);
$message_parser->attachment_data = array_merge($message_parser->attachment_data, $db->sql_fetchrowset($result));
$db->sql_freeresult($result);
@@ -1593,6 +1593,9 @@ $message_parser->decode_message($post_data['bbcode_uid']);
if ($generate_quote)
{
+ // Remove attachment bbcode tags from the quoted message to avoid mixing with the new post attachments if any
+ $message_parser->message = preg_replace('#\[attachment=([0-9]+)\](.*?)\[\/attachment\]#uis', '\\2', $message_parser->message);
+
if ($config['allow_bbcode'])
{
$message_parser->message = $phpbb_container->get('text_formatter.utils')->generate_quote(
diff --git a/phpBB/styles/prosilver/style.cfg b/phpBB/styles/prosilver/style.cfg
index dd77b75520..690c35ca7a 100644
--- a/phpBB/styles/prosilver/style.cfg
+++ b/phpBB/styles/prosilver/style.cfg
@@ -21,8 +21,8 @@
# General Information about this style
name = prosilver
copyright = © phpBB Limited, 2007
-style_version = 3.2.0-b2
-phpbb_version = 3.2.0-b2
+style_version = 3.2.0-b3-dev
+phpbb_version = 3.2.0-b3-dev
# Defining a different template bitfield
# template_bitfield = lNg=
diff --git a/phpBB/styles/prosilver/template/mcp_topic.html b/phpBB/styles/prosilver/template/mcp_topic.html
index 0c0ecfaa07..32e5f0236c 100644
--- a/phpBB/styles/prosilver/template/mcp_topic.html
+++ b/phpBB/styles/prosilver/template/mcp_topic.html
@@ -34,7 +34,7 @@
<fieldset id="display-panel" class="fields2" role="tabpanel">
<dl>
<dt><label for="posts_per_page">{L_POSTS_PER_PAGE}{L_COLON}</label><br /><span>{L_POSTS_PER_PAGE_EXPLAIN}</span></dt>
- <dd><input class="inputbox autowidth" type="number" min="0" name="posts_per_page" id="posts_per_page" size="6" value="{POSTS_PER_PAGE}" /></dd>
+ <dd><input class="inputbox autowidth" type="number" min="0" max="999999" name="posts_per_page" id="posts_per_page" value="{POSTS_PER_PAGE}" /></dd>
</dl>
<dl>
<dt><label>{L_DISPLAY_POSTS}{L_COLON}</label></dt>
@@ -73,7 +73,7 @@
<dl>
<dt><label for="to_topic_id">{L_MERGE_TOPIC_ID}{L_COLON}</label></dt>
<dd>
- <input class="inputbox autowidth" type="number" min="0" size="6" name="to_topic_id" id="to_topic_id" value="{TO_TOPIC_ID}" />
+ <input class="inputbox autowidth" type="number" min="0" max="999999" name="to_topic_id" id="to_topic_id" value="{TO_TOPIC_ID}" />
<a href="{U_SELECT_TOPIC}" >{L_SELECT_TOPIC}</a>
</dd>
<!-- IF TO_TOPIC_INFO --><dd>{TO_TOPIC_INFO}</dd><!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/navbar_header.html b/phpBB/styles/prosilver/template/navbar_header.html
index 788989f4c5..7925bd6362 100644
--- a/phpBB/styles/prosilver/template/navbar_header.html
+++ b/phpBB/styles/prosilver/template/navbar_header.html
@@ -180,10 +180,10 @@
<!-- EVENT overall_header_breadcrumbs_before -->
<li class="breadcrumbs">
<!-- IF U_SITE_HOME -->
- <span class="crumb" {$MICRODATA}><a href="{U_SITE_HOME}" data-navbar-reference="home"><i class="icon fa-home fa-fw" aria-hidden="true"></i><span>{L_SITE_HOME}</span></a></span>
+ <span class="crumb" {$MICRODATA}><a href="{U_SITE_HOME}" itemprop="url" data-navbar-reference="home"><i class="icon fa-home fa-fw" aria-hidden="true"></i><span itemprop="title">{L_SITE_HOME}</span></a></span>
<!-- ENDIF -->
<!-- EVENT overall_header_breadcrumb_prepend -->
- <span class="crumb" {$MICRODATA}><a href="{U_INDEX}" accesskey="h" data-navbar-reference="index"><!-- IF not U_SITE_HOME --><i class="icon fa-home fa-fw"></i><!-- ENDIF --><span>{L_INDEX}</span></a></span>
+ <span class="crumb" {$MICRODATA}><a href="{U_INDEX}" itemprop="url" accesskey="h" data-navbar-reference="index"><!-- IF not U_SITE_HOME --><i class="icon fa-home fa-fw"></i><!-- ENDIF --><span itemprop="title">{L_INDEX}</span></a></span>
<!-- BEGIN navlinks -->
<!-- EVENT overall_header_navlink_prepend -->
diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html
index 823d5e1c12..8a3eb65cd4 100644
--- a/phpBB/styles/prosilver/template/overall_header.html
+++ b/phpBB/styles/prosilver/template/overall_header.html
@@ -2,6 +2,7 @@
<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
<meta charset="utf-8" />
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1" />
{META}
<title><!-- IF UNREAD_NOTIFICATIONS_COUNT -->({UNREAD_NOTIFICATIONS_COUNT}) <!-- ENDIF --><!-- IF not S_VIEWTOPIC and not S_VIEWFORUM -->{SITENAME} - <!-- ENDIF --><!-- IF S_IN_MCP -->{L_MCP} - <!-- ELSEIF S_IN_UCP -->{L_UCP} - <!-- ENDIF -->{PAGE_TITLE}<!-- IF S_VIEWTOPIC or S_VIEWFORUM --> - {SITENAME}<!-- ENDIF --></title>
diff --git a/phpBB/styles/prosilver/template/pagination.html b/phpBB/styles/prosilver/template/pagination.html
index e8483331f4..78b0df84e0 100644
--- a/phpBB/styles/prosilver/template/pagination.html
+++ b/phpBB/styles/prosilver/template/pagination.html
@@ -7,7 +7,7 @@
<ul class="dropdown-contents">
<li>{L_JUMP_TO_PAGE}{L_COLON}</li>
<li class="page-jump-form">
- <input type="number" name="page-number" min="1" maxlength="6" title="{L_JUMP_PAGE}" class="inputbox tiny" data-per-page="{PER_PAGE}" data-base-url="{BASE_URL|e('html_attr')}" data-start-name="{START_NAME}" />
+ <input type="number" name="page-number" min="1" max="999999" title="{L_JUMP_PAGE}" class="inputbox tiny" data-per-page="{PER_PAGE}" data-base-url="{BASE_URL|e('html_attr')}" data-start-name="{START_NAME}" />
<input class="button2" value="{L_GO}" type="button" />
</li>
</ul>
diff --git a/phpBB/styles/prosilver/template/posting_editor.html b/phpBB/styles/prosilver/template/posting_editor.html
index ae7bc4a6a7..0d526cd72f 100644
--- a/phpBB/styles/prosilver/template/posting_editor.html
+++ b/phpBB/styles/prosilver/template/posting_editor.html
@@ -164,7 +164,7 @@
<!-- IF S_TOPIC_TYPE_ANNOUNCE or S_TOPIC_TYPE_STICKY -->
<dl>
<dt><label for="topic_time_limit">{L_STICK_TOPIC_FOR}{L_COLON}</label></dt>
- <dd><label for="topic_time_limit"><input type="number" min="0" max="999" name="topic_time_limit" id="topic_time_limit" size="3" maxlength="3" value="{TOPIC_TIME_LIMIT}" class="inputbox autowidth" /> {L_DAYS}</label></dd>
+ <dd><label for="topic_time_limit"><input type="number" min="0" max="999" name="topic_time_limit" id="topic_time_limit" value="{TOPIC_TIME_LIMIT}" class="inputbox autowidth" /> {L_DAYS}</label></dd>
<dd>{L_STICK_TOPIC_FOR_EXPLAIN}</dd>
</dl>
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/posting_poll_body.html b/phpBB/styles/prosilver/template/posting_poll_body.html
index dcaec14a93..ee7100aded 100644
--- a/phpBB/styles/prosilver/template/posting_poll_body.html
+++ b/phpBB/styles/prosilver/template/posting_poll_body.html
@@ -27,12 +27,12 @@
<dl>
<dt><label for="poll_max_options">{L_POLL_MAX_OPTIONS}{L_COLON}</label></dt>
- <dd><input type="number" min="0" max="999" name="poll_max_options" id="poll_max_options" size="3" maxlength="3" value="{POLL_MAX_OPTIONS}" class="inputbox autowidth" /></dd>
+ <dd><input type="number" min="0" max="999" name="poll_max_options" id="poll_max_options" value="{POLL_MAX_OPTIONS}" class="inputbox autowidth" /></dd>
<dd>{L_POLL_MAX_OPTIONS_EXPLAIN}</dd>
</dl>
<dl>
<dt><label for="poll_length">{L_POLL_FOR}{L_COLON}</label></dt>
- <dd><label for="poll_length"><input type="number" min="0" max="999" name="poll_length" id="poll_length" size="3" maxlength="3" value="{POLL_LENGTH}" class="inputbox autowidth" /> {L_DAYS}</label></dd>
+ <dd><label for="poll_length"><input type="number" min="0" max="999" name="poll_length" id="poll_length" value="{POLL_LENGTH}" class="inputbox autowidth" /> {L_DAYS}</label></dd>
<dd>{L_POLL_FOR_EXPLAIN}</dd>
</dl>
diff --git a/phpBB/styles/prosilver/template/simple_header.html b/phpBB/styles/prosilver/template/simple_header.html
index 954eebd011..0e889b476d 100644
--- a/phpBB/styles/prosilver/template/simple_header.html
+++ b/phpBB/styles/prosilver/template/simple_header.html
@@ -2,6 +2,7 @@
<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
<meta charset="utf-8" />
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1" />
{META}
<title>{SITENAME} &bull; <!-- IF S_IN_MCP -->{L_MCP} &bull; <!-- ELSEIF S_IN_UCP -->{L_UCP} &bull; <!-- ENDIF -->{PAGE_TITLE}</title>
diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html b/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html
index d08345130e..130a7c2cca 100644
--- a/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html
+++ b/phpBB/styles/prosilver/template/ucp_avatar_options_gravatar.html
@@ -5,7 +5,7 @@
<dl>
<dt><label for="avatar_gravatar_width">{L_GRAVATAR_AVATAR_SIZE}{L_COLON}</label><br /><span>{L_GRAVATAR_AVATAR_SIZE_EXPLAIN}</span></dt>
<dd>
- <label for="avatar_gravatar_width"><input type="text" name="avatar_gravatar_width" id="avatar_gravatar_width" size="3" value="{AVATAR_GRAVATAR_WIDTH}" class="inputbox autowidth" /> {L_PIXEL}</label> &times;&nbsp;
- <label for="avatar_gravatar_height"><input type="text" name="avatar_gravatar_height" id="avatar_gravatar_height" size="3" value="{AVATAR_GRAVATAR_HEIGHT}" class="inputbox autowidth" /> {L_PIXEL}</label>
+ <label for="avatar_gravatar_width"><input type="number" name="avatar_gravatar_width" id="avatar_gravatar_width" min="{AVATAR_MIN_WIDTH}" max="{AVATAR_MAX_WIDTH}" value="{AVATAR_GRAVATAR_WIDTH}" class="inputbox autowidth" /> {L_PIXEL}</label> &times;&nbsp;
+ <label for="avatar_gravatar_height"><input type="number" name="avatar_gravatar_height" id="avatar_gravatar_height" min="{AVATAR_MIN_HEIGHT}" max="{AVATAR_MAX_HEIGHT}" value="{AVATAR_GRAVATAR_HEIGHT}" class="inputbox autowidth" /> {L_PIXEL}</label>
</dd>
</dl>
diff --git a/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html b/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html
index 014a76aff8..8e175623ac 100644
--- a/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html
+++ b/phpBB/styles/prosilver/template/ucp_avatar_options_remote.html
@@ -5,7 +5,7 @@
<dl>
<dt><label for="avatar_remote_width">{L_LINK_REMOTE_SIZE}{L_COLON}</label><br /><span>{L_LINK_REMOTE_SIZE_EXPLAIN}</span></dt>
<dd>
- <label for="avatar_remote_width"><input type="text" name="avatar_remote_width" id="avatar_remote_width" size="3" value="{AVATAR_REMOTE_WIDTH}" class="inputbox autowidth" /> {L_PIXEL}</label> &times;&nbsp;
- <label for="avatar_remote_height"><input type="text" name="avatar_remote_height" id="avatar_remote_height" size="3" value="{AVATAR_REMOTE_HEIGHT}" class="inputbox autowidth" /> {L_PIXEL}</label>
+ <label for="avatar_remote_width"><input type="number" name="avatar_remote_width" id="avatar_remote_width" min="{AVATAR_MIN_WIDTH}" max="{AVATAR_MAX_WIDTH}" value="{AVATAR_REMOTE_WIDTH}" class="inputbox autowidth" /> {L_PIXEL}</label> &times;&nbsp;
+ <label for="avatar_remote_height"><input type="number" name="avatar_remote_height" id="avatar_remote_height" min="{AVATAR_MIN_HEIGHT}" max="{AVATAR_MAX_HEIGHT}" value="{AVATAR_REMOTE_HEIGHT}" class="inputbox autowidth" /> {L_PIXEL}</label>
</dd>
</dl>
diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html
index 70beec8256..9377eeb9f5 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html
@@ -2,6 +2,7 @@
<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
<meta charset="utf-8" />
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="robots" content="noindex" />
{META}
<title>{SITENAME} &bull; {PAGE_TITLE}</title>
diff --git a/phpBB/styles/prosilver/template/viewtopic_print.html b/phpBB/styles/prosilver/template/viewtopic_print.html
index 796111dd3c..3c1ed4c3f1 100644
--- a/phpBB/styles/prosilver/template/viewtopic_print.html
+++ b/phpBB/styles/prosilver/template/viewtopic_print.html
@@ -2,6 +2,7 @@
<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
<meta charset="utf-8" />
+<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="robots" content="noindex" />
{META}
<title>{SITENAME} &bull; {PAGE_TITLE}</title>
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index c9a081cc0e..7db5b8759c 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -277,14 +277,42 @@ if ($sort_days)
{
$min_post_time = time() - ($sort_days * 86400);
- $sql = 'SELECT COUNT(topic_id) AS num_topics
- FROM ' . TOPICS_TABLE . "
- WHERE forum_id = $forum_id
- AND (topic_last_post_time >= $min_post_time
- OR topic_type = " . POST_ANNOUNCE . '
- OR topic_type = ' . POST_GLOBAL . ')
- AND ' . $phpbb_content_visibility->get_visibility_sql('topic', $forum_id);
- $result = $db->sql_query($sql);
+ $sql_array = array(
+ 'SELECT' => 'COUNT(t.topic_id) AS num_topics',
+ 'FROM' => array(
+ TOPICS_TABLE => 't',
+ ),
+ 'WHERE' => 't.forum_id = ' . $forum_id . '
+ AND (t.topic_last_post_time >= ' . $min_post_time . '
+ OR t.topic_type = ' . POST_ANNOUNCE . '
+ OR t.topic_type = ' . POST_GLOBAL . ')
+ AND ' . $phpbb_content_visibility->get_visibility_sql('topic', $forum_id, 't.'),
+ );
+
+ /**
+ * Modify the sort data SQL query for getting additional fields if needed
+ *
+ * @event core.viewforum_modify_sort_data_sql
+ * @var int forum_id The forum_id whose topics are being listed
+ * @var int start Variable containing start for pagination
+ * @var int sort_days The oldest topic displayable in elapsed days
+ * @var string sort_key The sorting by. It is one of the first character of (in low case):
+ * Author, Post time, Replies, Subject, Views
+ * @var string sort_dir Either "a" for ascending or "d" for descending
+ * @var array sql_array The SQL array to get the data of all topics
+ * @since 3.1.9-RC1
+ */
+ $vars = array(
+ 'forum_id',
+ 'start',
+ 'sort_days',
+ 'sort_key',
+ 'sort_dir',
+ 'sql_array',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.viewforum_modify_sort_data_sql', compact($vars)));
+
+ $result = $db->sql_query($db->sql_build_query('SELECT', $sql_array));
$topics_count = (int) $db->sql_fetchfield('num_topics');
$db->sql_freeresult($result);
@@ -399,15 +427,16 @@ $sql_array = array(
* @event core.viewforum_get_topic_data
* @var array forum_data Array with forum data
* @var array sql_array The SQL array to get the data of all topics
-* @var array forum_id The forum_id whose topics are being listed
-* @var array topics_count The total number of topics for display
-* @var array sort_days The oldest topic displayable in elapsed days
-* @var array sort_key The sorting by. It is one of the first character of (in low case):
+* @var int forum_id The forum_id whose topics are being listed
+* @var int topics_count The total number of topics for display
+* @var int sort_days The oldest topic displayable in elapsed days
+* @var string sort_key The sorting by. It is one of the first character of (in low case):
* Author, Post time, Replies, Subject, Views
-* @var array sort_dir Either "a" for ascending or "d" for descending
+* @var string sort_dir Either "a" for ascending or "d" for descending
* @since 3.1.0-a1
* @change 3.1.0-RC4 Added forum_data var
* @change 3.1.4-RC1 Added forum_id, topics_count, sort_days, sort_key and sort_dir vars
+* @change 3.1.9-RC1 Fix types of properties
*/
$vars = array(
'forum_data',
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 87de7c79a4..ded0f9aacc 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -590,6 +590,33 @@ $quickmod_array = array(
'topic_logs' => array('VIEW_TOPIC_LOGS', $auth->acl_get('m_', $forum_id)),
);
+/**
+* Event to modify data in the quickmod_array before it gets sent to the
+* phpbb_add_quickmod_option function.
+*
+* @event core.viewtopic_add_quickmod_option_before
+* @var int forum_id Forum ID
+* @var int post_id Post ID
+* @var array quickmod_array Array with quick moderation options data
+* @var array topic_data Array with topic data
+* @var int topic_id Topic ID
+* @var array topic_tracking_info Array with topic tracking data
+* @var string viewtopic_url URL to the topic page
+* @var bool allow_change_type Topic change permissions check
+* @since 3.1.9-RC1
+*/
+$vars = array(
+ 'forum_id',
+ 'post_id',
+ 'quickmod_array',
+ 'topic_data',
+ 'topic_id',
+ 'topic_tracking_info',
+ 'viewtopic_url',
+ 'allow_change_type',
+);
+extract($phpbb_dispatcher->trigger_event('core.viewtopic_add_quickmod_option_before', compact($vars)));
+
foreach ($quickmod_array as $option => $qm_ary)
{
if (!empty($qm_ary[1]))
@@ -1455,7 +1482,7 @@ if (sizeof($attach_list))
FROM ' . ATTACHMENTS_TABLE . '
WHERE ' . $db->sql_in_set('post_msg_id', $attach_list) . '
AND in_message = 0
- ORDER BY filetime DESC, post_msg_id ASC';
+ ORDER BY attach_id DESC, post_msg_id ASC';
$result = $db->sql_query($sql);
while ($row = $db->sql_fetchrow($result))
@@ -1597,6 +1624,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
{
$parse_flags = ($user_cache[$poster_id]['sig_bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0) | OPTION_FLAG_SMILIES;
$user_cache[$poster_id]['sig'] = generate_text_for_display($user_cache[$poster_id]['sig'], $user_cache[$poster_id]['sig_bbcode_uid'], $user_cache[$poster_id]['sig_bbcode_bitfield'], $parse_flags, true);
+ $user_cache[$poster_id]['sig_parsed'] = true;
}
// Parse the message and subject
diff --git a/phpBB/web.config b/phpBB/web.config
index c7a1240453..99a1fe6023 100644
--- a/phpBB/web.config
+++ b/phpBB/web.config
@@ -1,12 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
- <configSections>
- <sectionGroup name="system.webServer" >
- <sectionGroup name="rewrite">
- <section name="rules" overrideModeDefault="Allow" />
- </sectionGroup>
- </sectionGroup>
- </configSections>
<system.webServer>
<rewrite>
<rules>
diff --git a/tests/attachment/upload_test.php b/tests/attachment/upload_test.php
index 295b6b15c9..235ecd082a 100644
--- a/tests/attachment/upload_test.php
+++ b/tests/attachment/upload_test.php
@@ -11,7 +11,6 @@
*
*/
-require_once(dirname(__FILE__) . '/../../phpBB/includes/functions.php');
require_once(dirname(__FILE__) . '/../../phpBB/includes/functions_posting.php');
class phpbb_attachment_upload_test extends \phpbb_database_test_case
diff --git a/tests/auth/provider_apache_test.php b/tests/auth/provider_apache_test.php
index 60423acbc1..7d77d763fb 100644
--- a/tests/auth/provider_apache_test.php
+++ b/tests/auth/provider_apache_test.php
@@ -11,9 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
-
class phpbb_auth_provider_apache_test extends phpbb_database_test_case
{
protected $provider;
diff --git a/tests/auth/provider_db_test.php b/tests/auth/provider_db_test.php
index 38dbfa1fcb..6ff77da564 100644
--- a/tests/auth/provider_db_test.php
+++ b/tests/auth/provider_db_test.php
@@ -11,9 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
-
class phpbb_auth_provider_db_test extends phpbb_database_test_case
{
public function getDataSet()
diff --git a/tests/bbcode/parser_test.php b/tests/bbcode/parser_test.php
index 14736627f3..5677e49636 100644
--- a/tests/bbcode/parser_test.php
+++ b/tests/bbcode/parser_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/bbcode.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/message_parser.php';
diff --git a/tests/bbcode/url_bbcode_test.php b/tests/bbcode/url_bbcode_test.php
index 83176abe4c..3f8ad6022f 100644
--- a/tests/bbcode/url_bbcode_test.php
+++ b/tests/bbcode/url_bbcode_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/bbcode.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/message_parser.php';
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index 86e1e5314b..18977bac88 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -23,7 +23,10 @@ require_once $phpbb_root_path . 'includes/startup.php';
$table_prefix = 'phpbb_';
require_once $phpbb_root_path . 'includes/constants.php';
require_once $phpbb_root_path . 'phpbb/class_loader.' . $phpEx;
-require_once($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
+require_once $phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx;
+require_once $phpbb_root_path . 'includes/functions.' . $phpEx;
+require_once $phpbb_root_path . 'includes/functions_content.' . $phpEx;
+require_once $phpbb_root_path . 'includes/functions_compatibility.' . $phpEx;
$phpbb_class_loader_mock = new \phpbb\class_loader('phpbb_mock_', $phpbb_root_path . '../tests/mock/', "php");
$phpbb_class_loader_mock->register();
diff --git a/tests/captcha/qa_test.php b/tests/captcha/qa_test.php
index 4aa5e714f5..7ec4be69f5 100644
--- a/tests/captcha/qa_test.php
+++ b/tests/captcha/qa_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_captcha_qa_test extends \phpbb_database_test_case
{
protected $request;
diff --git a/tests/compress/compress_test.php b/tests/compress/compress_test.php
index 56c406b206..c071a049a8 100644
--- a/tests/compress/compress_test.php
+++ b/tests/compress/compress_test.php
@@ -11,7 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_admin.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_compress.php';
diff --git a/tests/console/cron/run_test.php b/tests/console/cron/run_test.php
index d6c7b21781..b4a0203325 100644
--- a/tests/console/cron/run_test.php
+++ b/tests/console/cron/run_test.php
@@ -16,7 +16,6 @@ use Symfony\Component\Console\Tester\CommandTester;
use phpbb\console\command\cron\run;
require_once dirname(__FILE__) . '/tasks/simple.php';
-require_once dirname(__FILE__) . '/../../../phpBB/includes/functions.php';
class phpbb_console_command_cron_run_test extends phpbb_database_test_case
{
diff --git a/tests/console/thumbnail_test.php b/tests/console/thumbnail_test.php
index 45d7adacb9..439e3623fa 100644
--- a/tests/console/thumbnail_test.php
+++ b/tests/console/thumbnail_test.php
@@ -11,9 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_compatibility.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Tester\CommandTester;
use phpbb\console\command\thumbnail\generate;
diff --git a/tests/console/user/activate_test.php b/tests/console/user/activate_test.php
new file mode 100644
index 0000000000..1588a76e47
--- /dev/null
+++ b/tests/console/user/activate_test.php
@@ -0,0 +1,86 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+use Symfony\Component\Console\Application;
+use Symfony\Component\Console\Tester\CommandTester;
+use phpbb\console\command\user\activate;
+
+require_once dirname(__FILE__) . '/base.php';
+
+class phpbb_console_user_activate_test extends phpbb_console_user_base
+{
+ protected $notifications;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->notifications = $this->getMockBuilder('\phpbb\notification\manager')
+ ->disableOriginalConstructor()
+ ->getMock();
+ }
+
+ public function get_command_tester()
+ {
+ $application = new Application();
+ $application->add(new activate(
+ $this->user,
+ $this->db,
+ $this->config,
+ $this->language,
+ $this->log,
+ $this->notifications,
+ $this->user_loader,
+ $this->phpbb_root_path,
+ $this->php_ext
+ ));
+
+ $command = $application->find('user:activate');
+ $this->command_name = $command->getName();
+
+ return new CommandTester($command);
+ }
+
+ public function activate_test_data()
+ {
+ return array(
+ // Test an inactive user
+ array('Test', false, 'USER_ADMIN_ACTIVATED'),
+ array('Test', true, 'CLI_DESCRIPTION_USER_ACTIVATE_INACTIVE'),
+
+ // Test an active user
+ array('Test 2', false, 'CLI_DESCRIPTION_USER_ACTIVATE_ACTIVE'),
+ array('Test 2', true, 'USER_ADMIN_DEACTIVED'),
+
+ // Test a non existent user
+ array('Foo', false, 'NO_USER'),
+ array('Foo', true, 'NO_USER'),
+ );
+ }
+
+ /**
+ * @dataProvider activate_test_data
+ */
+ public function test_activate($username, $deactivate, $expected)
+ {
+ $command_tester = $this->get_command_tester();
+
+ $command_tester->execute(array(
+ 'command' => $this->command_name,
+ 'username' => $username,
+ '--deactivate' => $deactivate,
+ ));
+
+ $this->assertContains($expected, $command_tester->getDisplay());
+ }
+}
diff --git a/tests/console/user/add_test.php b/tests/console/user/add_test.php
new file mode 100644
index 0000000000..8641bf87b6
--- /dev/null
+++ b/tests/console/user/add_test.php
@@ -0,0 +1,92 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+use Symfony\Component\Console\Application;
+use Symfony\Component\Console\Tester\CommandTester;
+use phpbb\console\command\user\add;
+
+require_once dirname(__FILE__) . '/base.php';
+
+class phpbb_console_user_add_test extends phpbb_console_user_base
+{
+ public function get_command_tester()
+ {
+ $application = new Application();
+ $application->add(new add(
+ $this->user,
+ $this->db,
+ $this->config,
+ $this->language,
+ $this->passwords_manager,
+ $this->phpbb_root_path,
+ $this->php_ext
+ ));
+
+ $command = $application->find('user:add');
+ $this->command_name = $command->getName();
+ $this->question = $command->getHelper('question');
+ return new CommandTester($command);
+ }
+
+ public function test_add_no_dialog()
+ {
+ $command_tester = $this->get_command_tester();
+
+ $this->assertEquals(2, $this->get_user_id('Admin'));
+
+ $command_tester->execute(array(
+ 'command' => $this->command_name,
+ '--username' => 'foo',
+ '--password' => 'bar',
+ '--email' => 'foo@test.com'
+ ));
+
+ $this->assertNotEquals(null, $this->get_user_id('foo'));
+ $this->assertContains('CLI_USER_ADD_SUCCESS', $command_tester->getDisplay());
+ }
+
+ public function test_add_dialog()
+ {
+ $command_tester = $this->get_command_tester();
+
+ $this->assertEquals(2, $this->get_user_id('Admin'));
+
+ $this->question->setInputStream($this->getInputStream("bar\npassword\npassword\nbar@test.com\n"));
+
+ $command_tester->execute(array(
+ 'command' => $this->command_name,
+ ));
+
+ $this->assertNotEquals(null, $this->get_user_id('bar'));
+ $this->assertContains('CLI_USER_ADD_SUCCESS', $command_tester->getDisplay());
+
+ }
+
+ public function test_add_no_dialog_invalid()
+ {
+ $command_tester = $this->get_command_tester();
+
+ $this->assertEquals(3, $this->get_user_id('Test'));
+
+ $command_tester->execute(array(
+ 'command' => $this->command_name,
+ '--username' => 'Test',
+ '--password' => '1',
+ '--email' => 'foo'
+ ));
+
+ $this->assertContains('USERNAME_TAKEN', $command_tester->getDisplay());
+ $this->assertContains('TOO_SHORT', $command_tester->getDisplay());
+ $this->assertContains('EMAIL_INVALID', $command_tester->getDisplay());
+ }
+}
diff --git a/tests/console/user/base.php b/tests/console/user/base.php
new file mode 100644
index 0000000000..b84c0bb267
--- /dev/null
+++ b/tests/console/user/base.php
@@ -0,0 +1,121 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+abstract class phpbb_console_user_base extends phpbb_database_test_case
+{
+ protected $db;
+ protected $config;
+ protected $user;
+ protected $language;
+ protected $log;
+ protected $passwords_manager;
+ protected $command_name;
+ protected $question;
+ protected $user_loader;
+ protected $phpbb_root_path;
+ protected $php_ext;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__) . '/fixtures/config.xml');
+ }
+
+ public function setUp()
+ {
+ global $auth, $db, $cache, $config, $user, $phpbb_dispatcher, $phpbb_container, $phpbb_root_path, $phpEx;
+
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $phpbb_container = new phpbb_mock_container_builder();
+ $phpbb_container->set('cache.driver', new phpbb_mock_cache());
+ $phpbb_container->set('notification_manager', new phpbb_mock_notification_manager());
+
+ $auth = $this->getMock('\phpbb\auth\auth');
+
+ $cache = $phpbb_container->get('cache.driver');
+
+ $config = $this->config = new \phpbb\config\config(array(
+ 'board_timezone' => 'UTC',
+ 'default_lang' => 'en',
+ 'email_enable' => false,
+ 'min_name_chars' => 3,
+ 'max_name_chars' => 10,
+ 'min_pass_chars' => 3,
+ 'max_pass_chars' => 10,
+ 'pass_complex' => 'PASS_TYPE_ANY',
+ ));
+
+ $db = $this->db = $this->new_dbal();
+
+ $this->language = $this->getMockBuilder('\phpbb\language\language')
+ ->disableOriginalConstructor()
+ ->getMock();
+ $this->language->expects($this->any())
+ ->method('lang')
+ ->will($this->returnArgument(0));
+ $user = $this->user = $this->getMock('\phpbb\user', array(), array(
+ $this->language,
+ '\phpbb\datetime'
+ ));
+
+ $this->user_loader = new \phpbb\user_loader($db, $phpbb_root_path, $phpEx, USERS_TABLE);
+
+ $driver_helper = new \phpbb\passwords\driver\helper($this->config);
+ $passwords_drivers = array(
+ 'passwords.driver.bcrypt_2y' => new \phpbb\passwords\driver\bcrypt_2y($this->config, $driver_helper),
+ 'passwords.driver.bcrypt' => new \phpbb\passwords\driver\bcrypt($this->config, $driver_helper),
+ 'passwords.driver.salted_md5' => new \phpbb\passwords\driver\salted_md5($this->config, $driver_helper),
+ 'passwords.driver.phpass' => new \phpbb\passwords\driver\phpass($this->config, $driver_helper),
+ );
+
+ $passwords_helper = new \phpbb\passwords\helper;
+ $this->passwords_manager = new \phpbb\passwords\manager($this->config, $passwords_drivers, $passwords_helper, array_keys($passwords_drivers));
+
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $phpEx;
+
+ $this->log = $this->getMockBuilder('\phpbb\log\log')
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $phpbb_container->set('auth.provider.db', new phpbb_mock_auth_provider());
+ $provider_collection = new \phpbb\auth\provider_collection($phpbb_container, $config);
+ $provider_collection->add('auth.provider.db');
+ $phpbb_container->set(
+ 'auth.provider_collection',
+ $provider_collection
+ );
+
+ parent::setUp();
+ }
+
+ public function get_user_id($username)
+ {
+ $sql = 'SELECT user_id
+ FROM ' . USERS_TABLE . '
+ WHERE ' . 'username = ' . "'" . $username . "'";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ return $row['user_id'];
+ }
+
+ public function getInputStream($input)
+ {
+ $stream = fopen('php://memory', 'r+', false);
+ fputs($stream, $input);
+ rewind($stream);
+
+ return $stream;
+ }
+}
diff --git a/tests/console/user/delete_test.php b/tests/console/user/delete_test.php
new file mode 100644
index 0000000000..88f91afab1
--- /dev/null
+++ b/tests/console/user/delete_test.php
@@ -0,0 +1,93 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+use Symfony\Component\Console\Application;
+use Symfony\Component\Console\Tester\CommandTester;
+use phpbb\console\command\user\delete;
+
+require_once dirname(__FILE__) . '/base.php';
+
+class phpbb_console_user_delete_test extends phpbb_console_user_base
+{
+ public function get_command_tester()
+ {
+ $application = new Application();
+ $application->add(new delete(
+ $this->user,
+ $this->db,
+ $this->language,
+ $this->log,
+ $this->user_loader,
+ $this->phpbb_root_path,
+ $this->php_ext
+ ));
+
+ $command = $application->find('user:delete');
+ $this->command_name = $command->getName();
+ $this->question = $command->getHelper('question');
+
+ return new CommandTester($command);
+ }
+
+ public function test_delete()
+ {
+ $command_tester = $this->get_command_tester();
+
+ $this->assertEquals(3, $this->get_user_id('Test'));
+
+ $this->question->setInputStream($this->getInputStream("yes\n"));
+
+ $command_tester->execute(array(
+ 'command' => $this->command_name,
+ 'username' => 'Test',
+ '--delete-posts' => false,
+ ));
+
+ $this->assertNull($this->get_user_id('Test'));
+ $this->assertContains('USER_DELETED', $command_tester->getDisplay());
+ }
+
+ public function test_delete_non_user()
+ {
+ $command_tester = $this->get_command_tester();
+
+ $this->assertNull($this->get_user_id('Foo'));
+
+ $this->question->setInputStream($this->getInputStream("yes\n"));
+
+ $command_tester->execute(array(
+ 'command' => $this->command_name,
+ 'username' => 'Foo',
+ '--delete-posts' => false,
+ ));
+
+ $this->assertContains('NO_USER', $command_tester->getDisplay());
+ }
+
+ public function test_delete_cancel()
+ {
+ $command_tester = $this->get_command_tester();
+
+ $this->assertEquals(3, $this->get_user_id('Test'));
+
+ $this->question->setInputStream($this->getInputStream("no\n"));
+
+ $command_tester->execute(array(
+ 'command' => $this->command_name,
+ 'username' => 'Test',
+ '--delete-posts' => false,
+ ));
+
+ $this->assertNotNull($this->get_user_id('Test'));
+ }
+}
diff --git a/tests/console/user/fixtures/config.xml b/tests/console/user/fixtures/config.xml
new file mode 100644
index 0000000000..a988ba463f
--- /dev/null
+++ b/tests/console/user/fixtures/config.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>user_permissions</column>
+ <column>username</column>
+ <column>username_clean</column>
+ <column>user_sig</column>
+ <column>user_type</column>
+ <row>
+ <value>1</value>
+ <value></value>
+ <value>Guest</value>
+ <value>guest</value>
+ <value></value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value></value>
+ <value>Admin</value>
+ <value>admin</value>
+ <value></value>
+ <value>3</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value></value>
+ <value>Test</value>
+ <value>test</value>
+ <value></value>
+ <value>1</value>
+ </row>
+ <row>
+ <value>4</value>
+ <value></value>
+ <value>Test 2</value>
+ <value>test 2</value>
+ <value></value>
+ <value>0</value>
+ </row>
+ <row>
+ <value>5</value>
+ <value></value>
+ <value>Test Unclean</value>
+ <value>Test Unclean</value>
+ <value></value>
+ <value>0</value>
+ </row>
+ </table>
+ <table name="phpbb_groups">
+ <column>group_id</column>
+ <column>group_name</column>
+ <column>group_type</column>
+ <column>group_desc</column>
+ <row>
+ <value>1</value>
+ <value>REGISTERED</value>
+ <value>3</value>
+ <value>foobar</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/console/user/reclean_test.php b/tests/console/user/reclean_test.php
new file mode 100644
index 0000000000..1bf0b8ef5a
--- /dev/null
+++ b/tests/console/user/reclean_test.php
@@ -0,0 +1,49 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+use Symfony\Component\Console\Application;
+use Symfony\Component\Console\Tester\CommandTester;
+use phpbb\console\command\user\reclean;
+
+require_once dirname(__FILE__) . '/base.php';
+
+class phpbb_console_user_reclean_test extends phpbb_console_user_base
+{
+ public function get_command_tester()
+ {
+ $application = new Application();
+ $application->add(new reclean(
+ $this->user,
+ $this->db,
+ $this->language
+ ));
+
+ $command = $application->find('user:reclean');
+ $this->command_name = $command->getName();
+
+ return new CommandTester($command);
+ }
+
+ public function test_reclean()
+ {
+ $command_tester = $this->get_command_tester();
+
+ $exit_status = $command_tester->execute(array('command' => $this->command_name));
+ $this->assertSame(0, $exit_status);
+
+ $result = $this->db->sql_query('SELECT user_id FROM ' . USERS_TABLE . " WHERE username_clean = 'test unclean'");
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+ $this->assertNotNull($row['user_id']);
+ }
+}
diff --git a/tests/content_visibility/delete_post_test.php b/tests/content_visibility/delete_post_test.php
index ba0a21a1a4..4ea95b0a96 100644
--- a/tests/content_visibility/delete_post_test.php
+++ b/tests/content_visibility/delete_post_test.php
@@ -11,11 +11,8 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_admin.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_posting.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
require_once dirname(__FILE__) . '/../mock/search.php';
class phpbb_content_visibility_delete_post_test extends phpbb_database_test_case
diff --git a/tests/content_visibility/set_post_visibility_test.php b/tests/content_visibility/set_post_visibility_test.php
index 6375ce8f6d..e33a1f30d5 100644
--- a/tests/content_visibility/set_post_visibility_test.php
+++ b/tests/content_visibility/set_post_visibility_test.php
@@ -11,11 +11,8 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_admin.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_posting.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
class phpbb_content_visibility_set_post_visibility_test extends phpbb_database_test_case
{
diff --git a/tests/content_visibility/set_topic_visibility_test.php b/tests/content_visibility/set_topic_visibility_test.php
index f4d65f9ce3..78431396c3 100644
--- a/tests/content_visibility/set_topic_visibility_test.php
+++ b/tests/content_visibility/set_topic_visibility_test.php
@@ -11,11 +11,8 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_admin.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_posting.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
class phpbb_content_visibility_set_topic_visibility_test extends phpbb_database_test_case
{
diff --git a/tests/controller/common_helper_route.php b/tests/controller/common_helper_route.php
index 72c5328b0b..367c15a667 100644
--- a/tests/controller/common_helper_route.php
+++ b/tests/controller/common_helper_route.php
@@ -11,13 +11,23 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
abstract class phpbb_controller_common_helper_route extends phpbb_test_case
{
protected $root_path;
+ private $user;
+ private $config;
+ private $template;
+ private $extension_manager;
+ private $request;
+ private $symfony_request;
+ private $provider;
+ private $filesystem;
+ private $phpbb_path_helper;
+ private $helper;
+ private $router;
+ private $routing_helper;
public function setUp()
{
@@ -64,6 +74,8 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
protected function generate_route_objects()
{
+ global $request;
+
$this->request = new phpbb_mock_request();
$this->request->overwrite('SCRIPT_NAME', $this->get_uri(), \phpbb\request\request_interface::SERVER);
$this->request->overwrite('SCRIPT_FILENAME', $this->get_script_name(), \phpbb\request\request_interface::SERVER);
@@ -71,6 +83,8 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
$this->request->overwrite('SERVER_NAME', 'localhost', \phpbb\request\request_interface::SERVER);
$this->request->overwrite('SERVER_PORT', '80', \phpbb\request\request_interface::SERVER);
+ $request = $this->request;
+
$this->symfony_request = new \phpbb\symfony_request(
$this->request
);
@@ -97,7 +111,6 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
$this->config,
$this->filesystem,
$this->phpbb_path_helper,
- $container,
$cache_path,
null,
$loader,
@@ -109,7 +122,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
)
);
$this->template = new phpbb\template\twig\twig($this->phpbb_path_helper, $this->config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $this->user)));
- $container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig));
+ $twig->setLexer(new \phpbb\template\twig\lexer($twig));
$this->extension_manager = new phpbb_mock_extension_manager(
dirname(__FILE__) . '/',
@@ -126,7 +139,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
new \phpbb\routing\file_locator($this->filesystem, dirname(__FILE__) . '/')
);
$resources_locator = new \phpbb\routing\resources_locator\default_resources_locator(dirname(__FILE__) . '/', PHPBB_ENVIRONMENT, $this->extension_manager);
- $this->router = new phpbb_mock_router($container, $resources_locator, $loader, dirname(__FILE__) . '/', 'php', PHPBB_ENVIRONMENT);
+ $this->router = new phpbb_mock_router($container, $resources_locator, $loader, dirname(__FILE__) . '/', 'php');
// Set correct current phpBB root path
$this->root_path = $this->get_phpbb_root_path();
@@ -173,7 +186,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '0'));
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php');
$this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->symfony_request, $this->request, $this->routing_helper);
- $this->assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id), $description);
+ static::assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id), $description);
}
public function helper_url_data_with_rewrite()
@@ -217,7 +230,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '1'));
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php');
$this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->symfony_request, $this->request, $this->routing_helper);
- $this->assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id), $description);
+ static::assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id), $description);
}
public function helper_url_data_absolute()
@@ -261,7 +274,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '0'));
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php');
$this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->symfony_request, $this->request, $this->routing_helper);
- $this->assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::ABSOLUTE_URL), $description);
+ static::assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::ABSOLUTE_URL), $description);
}
public function helper_url_data_relative_path()
@@ -305,7 +318,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '0'));
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php');
$this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->symfony_request, $this->request, $this->routing_helper);
- $this->assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::RELATIVE_PATH), $description);
+ static::assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::RELATIVE_PATH), $description);
}
public function helper_url_data_network()
@@ -349,7 +362,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '0'));
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php');
$this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->symfony_request, $this->request, $this->routing_helper);
- $this->assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::NETWORK_PATH), $description);
+ static::assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::NETWORK_PATH), $description);
}
public function helper_url_data_absolute_with_rewrite()
@@ -393,7 +406,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '1'));
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php');
$this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->symfony_request, $this->request, $this->routing_helper);
- $this->assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::ABSOLUTE_URL), $description);
+ static::assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::ABSOLUTE_URL), $description);
}
public function helper_url_data_relative_path_with_rewrite()
@@ -434,7 +447,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '1'));
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php');
$this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->symfony_request, $this->request, $this->routing_helper);
- $this->assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::RELATIVE_PATH), $description);
+ static::assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::RELATIVE_PATH), $description);
}
public function helper_url_data_network_with_rewrite()
@@ -475,9 +488,41 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
*/
public function test_helper_url_network_with_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
{
- $this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '1'));
+ $this->config = new \phpbb\config\config(['enable_mod_rewrite' => '1']);
+ $this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php');
+ $this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->symfony_request, $this->request, $this->routing_helper);
+ static::assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::NETWORK_PATH), $description);
+ }
+
+ public function helper_url_data_force_server_vars()
+ {
+ return array(
+ array(false, true, 'my_server', 443, '/my/board', 'http://', UrlGeneratorInterface::ABSOLUTE_URL, 'http://my_server:443/my/board/app.php/foo'),
+ array(true, true, 'my_server', 444, '/my/board', 'https://', UrlGeneratorInterface::ABSOLUTE_URL, 'https://my_server:444/my/board/foo'),
+ array(false, true, 'my_server', 443, '/my/board', 'http://', UrlGeneratorInterface::NETWORK_PATH, '//my_server:443/my/board/app.php/foo'),
+ array(true, true, 'my_server', 444, '/my/board', 'https://', UrlGeneratorInterface::NETWORK_PATH, '//my_server:444/my/board/foo'),
+ array(false, true, 'my_server', 443, '/my/board', 'http://', UrlGeneratorInterface::ABSOLUTE_PATH, '/my/board/app.php/foo'),
+ array(true, true, 'my_server', 443, '/my/board', 'http://', UrlGeneratorInterface::ABSOLUTE_PATH, '/my/board/foo'),
+ array(false, true, 'my_server', 443, '/my/board', 'http://', UrlGeneratorInterface::RELATIVE_PATH, 'app.php/foo'),
+ array(true, true, 'my_server', 443, '/my/board', 'http://', UrlGeneratorInterface::RELATIVE_PATH, 'foo'), );
+ }
+
+ /**
+ * @dataProvider helper_url_data_force_server_vars()
+ */
+ public function test_helper_url_force_server_vars($enable_mod_rewrite, $force_server_vars, $server_name, $server_port, $script_path, $server_protocol, $type, $expected)
+ {
+ $this->config = new \phpbb\config\config(array(
+ 'enable_mod_rewrite' => $enable_mod_rewrite,
+ 'force_server_vars' => $force_server_vars,
+ 'server_name' => $server_name,
+ 'server_port' => $server_port,
+ 'script_path' => $script_path,
+ 'server_protocol' => $server_protocol,
+ ));
+
$this->routing_helper = new \phpbb\routing\helper($this->config, $this->router, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php');
$this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->symfony_request, $this->request, $this->routing_helper);
- $this->assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::NETWORK_PATH), $description);
+ static::assertEquals($expected, $this->helper->route('controller1', array(), false, false, $type));
}
}
diff --git a/tests/controller/controller_test.php b/tests/controller/controller_test.php
index 431b26b2bc..d921d0eade 100644
--- a/tests/controller/controller_test.php
+++ b/tests/controller/controller_test.php
@@ -11,7 +11,8 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+include_once(__DIR__ . '/ext/vendor2/foo/controller.php');
+include_once(__DIR__.'/phpbb/controller/foo.php');
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Config\FileLocator;
@@ -47,7 +48,7 @@ class phpbb_controller_controller_test extends phpbb_test_case
new \phpbb\routing\file_locator(new \phpbb\filesystem\filesystem(), dirname(__FILE__) . '/')
);
$resources_locator = new \phpbb\routing\resources_locator\default_resources_locator(dirname(__FILE__) . '/', PHPBB_ENVIRONMENT, $this->extension_manager);
- $router = new phpbb_mock_router($container, $resources_locator, $loader, dirname(__FILE__) . '/', 'php', PHPBB_ENVIRONMENT);
+ $router = new phpbb_mock_router($container, $resources_locator, $loader, dirname(__FILE__) . '/', 'php');
$routes = $router->get_routes();
// This will need to be updated if any new routes are defined
@@ -66,7 +67,7 @@ class phpbb_controller_controller_test extends phpbb_test_case
$this->assertNull($routes->get('controller_noroute'));
}
- public function test_controller_resolver()
+ protected function get_foo_container()
{
$container = new ContainerBuilder();
// YamlFileLoader only uses one path at a time, so we need to loop
@@ -77,26 +78,59 @@ class phpbb_controller_controller_test extends phpbb_test_case
$loader->load('services.yml');
}
- // Autoloading classes within the tests folder does not work
- // so I'll include them manually.
- if (!class_exists('vendor2\\foo\\controller'))
- {
- include(__DIR__ . '/ext/vendor2/foo/controller.php');
- }
- if (!class_exists('phpbb\\controller\\foo'))
- {
- include(__DIR__.'/phpbb/controller/foo.php');
- }
+ return $container;
+ }
+
+ public function test_controller_resolver()
+ {
+ $container = $this->get_foo_container();
$resolver = new \phpbb\controller\resolver($container, dirname(__FILE__) . '/');
$symfony_request = new Request();
$symfony_request->attributes->set('_controller', 'foo.controller:handle');
$this->assertEquals($resolver->getController($symfony_request), array(new foo\controller, 'handle'));
+ $this->assertEquals(array('foo'), $resolver->getArguments($symfony_request, $resolver->getController($symfony_request)));
$symfony_request = new Request();
$symfony_request->attributes->set('_controller', 'core_foo.controller:bar');
$this->assertEquals($resolver->getController($symfony_request), array(new phpbb\controller\foo, 'bar'));
+ $this->assertEquals(array(), $resolver->getArguments($symfony_request, $resolver->getController($symfony_request)));
+ }
+
+ public function data_get_arguments()
+ {
+ return array(
+ array(array(new foo\controller(), 'handle2'), array('foo', 0)),
+ array(array(new foo\controller(), 'handle_fail'), array('default'), array('no_default' => 'default')),
+ array(new foo\controller(), array(), array()),
+ array(array(new foo\controller(), 'handle_fail'), array(), array(), '\phpbb\controller\exception', 'CONTROLLER_ARGUMENT_VALUE_MISSING'),
+ array('', array(), array(), '\ReflectionException', 'Function () does not exist'),
+ array(new phpbb\controller\foo, array(), array(), '\ReflectionException', 'Method __invoke does not exist'),
+ );
+ }
+
+ /**
+ * @dataProvider data_get_arguments
+ */
+ public function test_get_arguments($input, $expected, $set_attributes = array(), $exception = '', $exception_message = '')
+ {
+ $container = $this->get_foo_container();
+
+ $resolver = new \phpbb\controller\resolver($container, dirname(__FILE__) . '/');
+ $symfony_request = new Request();
+
+ foreach ($set_attributes as $name => $value)
+ {
+ $symfony_request->attributes->set($name, $value);
+ }
+
+ if (!empty($exception))
+ {
+ $this->setExpectedException($exception, $exception_message);
+ }
+
+ $this->assertEquals($expected, $resolver->getArguments($symfony_request, $input));
}
}
diff --git a/tests/controller/ext/vendor2/foo/controller.php b/tests/controller/ext/vendor2/foo/controller.php
index ce2233b3c9..cabcae042b 100644
--- a/tests/controller/ext/vendor2/foo/controller.php
+++ b/tests/controller/ext/vendor2/foo/controller.php
@@ -11,8 +11,23 @@ class controller
*
* @return null
*/
- public function handle()
+ public function handle($optional = 'foo')
{
return new Response('Test', 200);
}
+
+ public function handle2($foo = 'foo', $very_optional = 0)
+ {
+ return new Response('Test2', 200);
+ }
+
+ public function handle_fail($no_default)
+ {
+ return new Response('Test_fail', 200);
+ }
+
+ public function __invoke()
+ {
+ $this->handle();
+ }
}
diff --git a/tests/controller/helper_route_adm_subdir_test.php b/tests/controller/helper_route_adm_subdir_test.php
index f27ac81b04..a1bf1b8805 100644
--- a/tests/controller/helper_route_adm_subdir_test.php
+++ b/tests/controller/helper_route_adm_subdir_test.php
@@ -11,7 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/common_helper_route.php';
class phpbb_controller_helper_route_adm_subdir_test extends phpbb_controller_common_helper_route
diff --git a/tests/controller/helper_route_adm_test.php b/tests/controller/helper_route_adm_test.php
index 86dc36ef1f..6ee394eaaa 100644
--- a/tests/controller/helper_route_adm_test.php
+++ b/tests/controller/helper_route_adm_test.php
@@ -11,7 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/common_helper_route.php';
class phpbb_controller_helper_route_adm_test extends phpbb_controller_common_helper_route
diff --git a/tests/controller/helper_route_root_test.php b/tests/controller/helper_route_root_test.php
index 63a2f2f8f7..12462e076d 100644
--- a/tests/controller/helper_route_root_test.php
+++ b/tests/controller/helper_route_root_test.php
@@ -11,7 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/common_helper_route.php';
class phpbb_controller_helper_route_test extends phpbb_controller_common_helper_route
diff --git a/tests/controller/helper_route_slash_test.php b/tests/controller/helper_route_slash_test.php
index 3db5ec19e5..c781a6943e 100644
--- a/tests/controller/helper_route_slash_test.php
+++ b/tests/controller/helper_route_slash_test.php
@@ -11,7 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/common_helper_route.php';
class phpbb_controller_helper_route_slash_test extends phpbb_controller_common_helper_route
diff --git a/tests/controller/helper_route_unclean_path_test.php b/tests/controller/helper_route_unclean_path_test.php
index 9d8b62bc1c..80f1a99fff 100644
--- a/tests/controller/helper_route_unclean_path_test.php
+++ b/tests/controller/helper_route_unclean_path_test.php
@@ -11,7 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/common_helper_route.php';
class phpbb_controller_helper_route_unclean_path_test extends phpbb_controller_common_helper_route
diff --git a/tests/dbal/auto_increment_test.php b/tests/dbal/auto_increment_test.php
index 39eb6835ff..950a4fc8f7 100644
--- a/tests/dbal/auto_increment_test.php
+++ b/tests/dbal/auto_increment_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_dbal_auto_increment_test extends phpbb_database_test_case
{
protected $db;
diff --git a/tests/dbal/boolean_processor_test.php b/tests/dbal/boolean_processor_test.php
index 226f5307b2..c69f60a1a8 100644
--- a/tests/dbal/boolean_processor_test.php
+++ b/tests/dbal/boolean_processor_test.php
@@ -11,9 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
-
class phpbb_boolean_processor_test extends phpbb_database_test_case
{
public function getDataSet()
diff --git a/tests/dbal/connect_test.php b/tests/dbal/connect_test.php
index edf57189cb..3933dab798 100644
--- a/tests/dbal/connect_test.php
+++ b/tests/dbal/connect_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_dbal_connect_test extends phpbb_database_test_case
{
public function getDataSet()
diff --git a/tests/dbal/cross_join_test.php b/tests/dbal/cross_join_test.php
index 7ba937ccc6..be9258c58b 100644
--- a/tests/dbal/cross_join_test.php
+++ b/tests/dbal/cross_join_test.php
@@ -11,9 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
-
class phpbb_dbal_cross_join_test extends phpbb_database_test_case
{
public function getDataSet()
diff --git a/tests/dbal/db_tools_test.php b/tests/dbal/db_tools_test.php
index aa0b6ccf48..b884b4ab95 100644
--- a/tests/dbal/db_tools_test.php
+++ b/tests/dbal/db_tools_test.php
@@ -11,8 +11,6 @@
*
*/
-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 */
diff --git a/tests/dbal/migrator_test.php b/tests/dbal/migrator_test.php
index f52e6ea63d..48c99ad1d0 100644
--- a/tests/dbal/migrator_test.php
+++ b/tests/dbal/migrator_test.php
@@ -11,7 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/migration/dummy.php';
require_once dirname(__FILE__) . '/migration/unfulfillable.php';
require_once dirname(__FILE__) . '/migration/if.php';
diff --git a/tests/dbal/migrator_tool_module_test.php b/tests/dbal/migrator_tool_module_test.php
index a71334f23f..c2252c8d10 100644
--- a/tests/dbal/migrator_tool_module_test.php
+++ b/tests/dbal/migrator_tool_module_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_dbal_migrator_tool_module_test extends phpbb_database_test_case
{
public function getDataSet()
diff --git a/tests/dbal/migrator_tool_permission_test.php b/tests/dbal/migrator_tool_permission_test.php
index bfb2e07080..d84f6a68ff 100644
--- a/tests/dbal/migrator_tool_permission_test.php
+++ b/tests/dbal/migrator_tool_permission_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_dbal_migrator_tool_permission_test extends phpbb_database_test_case
{
public $group_ids = array(
diff --git a/tests/dbal/schema_test.php b/tests/dbal/schema_test.php
index f13c7ce032..59965655ad 100644
--- a/tests/dbal/schema_test.php
+++ b/tests/dbal/schema_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_dbal_schema_test extends phpbb_database_test_case
{
public function getDataSet()
diff --git a/tests/dbal/select_test.php b/tests/dbal/select_test.php
index b7074552ba..0dac66fc46 100644
--- a/tests/dbal/select_test.php
+++ b/tests/dbal/select_test.php
@@ -11,9 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
-
class phpbb_dbal_select_test extends phpbb_database_test_case
{
public function getDataSet()
diff --git a/tests/dbal/write_sequence_test.php b/tests/dbal/write_sequence_test.php
index a1b589c578..a2d5921797 100644
--- a/tests/dbal/write_sequence_test.php
+++ b/tests/dbal/write_sequence_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_dbal_write_sequence_test extends phpbb_database_test_case
{
public function getDataSet()
diff --git a/tests/dbal/write_test.php b/tests/dbal/write_test.php
index 2426f2b0be..98709fb043 100644
--- a/tests/dbal/write_test.php
+++ b/tests/dbal/write_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_dbal_write_test extends phpbb_database_test_case
{
public function getDataSet()
diff --git a/tests/di/create_container_test.php b/tests/di/create_container_test.php
index 2d94f1d778..4dd0583ebe 100644
--- a/tests/di/create_container_test.php
+++ b/tests/di/create_container_test.php
@@ -13,7 +13,6 @@
namespace
{
- require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/fixtures/ext/vendor/enabled_4/di/extension.php';
class phpbb_di_container_test extends \phpbb_test_case
diff --git a/tests/error_collector_test.php b/tests/error_collector_test.php
index ddbe2e3af1..273284c8fc 100644
--- a/tests/error_collector_test.php
+++ b/tests/error_collector_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../phpBB/includes/functions.php';
-
class phpbb_error_collector_test extends phpbb_test_case
{
public function setUp()
diff --git a/tests/event/exception_listener_test.php b/tests/event/exception_listener_test.php
index e643fadf2c..08679a3ed8 100644
--- a/tests/event/exception_listener_test.php
+++ b/tests/event/exception_listener_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class exception_listener extends phpbb_test_case
{
public function phpbb_exception_data()
diff --git a/tests/event/md_exporter_test.php b/tests/event/md_exporter_test.php
index a6c1dc78de..607f442fdf 100644
--- a/tests/event/md_exporter_test.php
+++ b/tests/event/md_exporter_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_event_md_exporter_test extends phpbb_test_case
{
static public function crawl_eventsmd_data()
diff --git a/tests/extension/extension_base_test.php b/tests/extension/extension_base_test.php
index 775a23e198..e0c2e6d549 100644
--- a/tests/extension/extension_base_test.php
+++ b/tests/extension/extension_base_test.php
@@ -10,7 +10,6 @@
* the docs/CREDITS.txt file.
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/ext/vendor2/bar/migrations/bar.php';
require_once dirname(__FILE__) . '/ext/vendor2/bar/migrations/foo.php';
require_once dirname(__FILE__) . '/ext/vendor2/bar/migrations/migration.php';
diff --git a/tests/extension/finder_test.php b/tests/extension/finder_test.php
index 463b69e9a9..71de2c2fc5 100644
--- a/tests/extension/finder_test.php
+++ b/tests/extension/finder_test.php
@@ -10,7 +10,6 @@
* the docs/CREDITS.txt file.
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
class phpbb_extension_finder_test extends phpbb_test_case
{
diff --git a/tests/extension/metadata_manager_test.php b/tests/extension/metadata_manager_test.php
index 53bd3d109b..19b99ee0ce 100644
--- a/tests/extension/metadata_manager_test.php
+++ b/tests/extension/metadata_manager_test.php
@@ -65,7 +65,6 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->config,
$filesystem,
$phpbb_path_helper,
- $container,
$cache_path,
null,
$loader,
@@ -112,7 +111,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->user = new \phpbb\user($lang, '\phpbb\datetime');
$this->template = new phpbb\template\twig\twig($phpbb_path_helper, $this->config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $this->user)));
- $container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig));
+ $twig->setLexer(new \phpbb\template\twig\lexer($twig));
}
// Should fail from missing composer.json
diff --git a/tests/files/types_form_test.php b/tests/files/types_form_test.php
index efcece49d1..925babb47f 100644
--- a/tests/files/types_form_test.php
+++ b/tests/files/types_form_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_files_types_form_test extends phpbb_test_case
{
private $path;
diff --git a/tests/files/types_local_test.php b/tests/files/types_local_test.php
index f4fa7fad3f..31070de107 100644
--- a/tests/files/types_local_test.php
+++ b/tests/files/types_local_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_files_types_local_test extends phpbb_test_case
{
private $path;
diff --git a/tests/files/types_remote_test.php b/tests/files/types_remote_test.php
index 476d8ed3ba..d103771c04 100644
--- a/tests/files/types_remote_test.php
+++ b/tests/files/types_remote_test.php
@@ -11,7 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/type_foo.php';
class phpbb_files_types_remote_test extends phpbb_test_case
diff --git a/tests/functional/download_test.php b/tests/functional/download_test.php
index 1e863210e6..e2f1d065be 100644
--- a/tests/functional/download_test.php
+++ b/tests/functional/download_test.php
@@ -11,10 +11,7 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_posting.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
/**
* @group functional
diff --git a/tests/functional/feed_test.php b/tests/functional/feed_test.php
index dad5ca7e1a..3792b0a23c 100644
--- a/tests/functional/feed_test.php
+++ b/tests/functional/feed_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
/**
* @group functional
*/
diff --git a/tests/functional/notification_test.php b/tests/functional/notification_test.php
index 87c36dd4d1..5c6b87d50b 100644
--- a/tests/functional/notification_test.php
+++ b/tests/functional/notification_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
/**
* @group functional
*/
diff --git a/tests/functional/permission_roles_test.php b/tests/functional/permission_roles_test.php
index 82d5be68c3..e6506fb37c 100644
--- a/tests/functional/permission_roles_test.php
+++ b/tests/functional/permission_roles_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once __DIR__ . '/../../phpBB/includes/functions.php';
-
/**
* @group functional
*/
diff --git a/tests/functional/visit_installer_test.php b/tests/functional/visit_installer_test.php
new file mode 100644
index 0000000000..b4a75c0b51
--- /dev/null
+++ b/tests/functional/visit_installer_test.php
@@ -0,0 +1,30 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+/**
+* @group functional
+*/
+class phpbb_functional_visit_installer_test extends phpbb_functional_test_case
+{
+ public function test_visit_installer()
+ {
+ self::request('GET', 'install/', [], false);
+ $this->assertContains('<meta http-equiv="refresh" content="0; url=./app.php" />', $this->get_content());
+
+ self::request('GET', 'install/index.html', [], false);
+ $this->assertContains('<meta http-equiv="refresh" content="0; url=./app.php" />', $this->get_content());
+
+ self::request('GET', 'install/app.php');
+ $this->assertContains('installation system', $this->get_content());
+ }
+}
diff --git a/tests/functions/build_hidden_fields_for_query_params_test.php b/tests/functions/build_hidden_fields_for_query_params_test.php
index 14cb4b9a94..aee7a569d4 100644
--- a/tests/functions/build_hidden_fields_for_query_params_test.php
+++ b/tests/functions/build_hidden_fields_for_query_params_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_build_hidden_fields_for_query_params_test extends phpbb_test_case
{
public function build_hidden_fields_for_query_params_test_data()
diff --git a/tests/functions/build_url_test.php b/tests/functions/build_url_test.php
index 3e19b51f02..91a4a9ec66 100644
--- a/tests/functions/build_url_test.php
+++ b/tests/functions/build_url_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_build_url_test extends phpbb_test_case
{
protected function setUp()
diff --git a/tests/functions/convert_30_dbms_to_31_test.php b/tests/functions/convert_30_dbms_to_31_test.php
index 729c0a82f0..1405d81eb3 100644
--- a/tests/functions/convert_30_dbms_to_31_test.php
+++ b/tests/functions/convert_30_dbms_to_31_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_convert_30_dbms_to_31_test extends phpbb_test_case
{
public function convert_30_dbms_to_31_data()
diff --git a/tests/functions/generate_string_list.php b/tests/functions/generate_string_list.php
index bcf0c09fe4..6eddb1395e 100644
--- a/tests/functions/generate_string_list.php
+++ b/tests/functions/generate_string_list.php
@@ -11,9 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_generate_string_list_test extends phpbb_test_case
{
public $user;
diff --git a/tests/functions/get_formatted_filesize_test.php b/tests/functions/get_formatted_filesize_test.php
index 635753d737..290515b64f 100644
--- a/tests/functions/get_formatted_filesize_test.php
+++ b/tests/functions/get_formatted_filesize_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_get_formatted_filesize_test extends phpbb_test_case
{
public function get_formatted_filesize_test_data()
diff --git a/tests/functions/get_preg_expression_test.php b/tests/functions/get_preg_expression_test.php
index e74017d315..b8254b03ea 100644
--- a/tests/functions/get_preg_expression_test.php
+++ b/tests/functions/get_preg_expression_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_functions_get_preg_expression_test extends phpbb_test_case
{
public function data_path_remove_dot_trailing_slash()
diff --git a/tests/functions/get_remote_file_test.php b/tests/functions/get_remote_file_test.php
index 781a73a462..1550aa37e6 100644
--- a/tests/functions/get_remote_file_test.php
+++ b/tests/functions/get_remote_file_test.php
@@ -11,9 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_compatibility.php';
-
/**
* @group slow
*/
diff --git a/tests/functions/language_select_test.php b/tests/functions/language_select_test.php
index 6762ead5a1..2d1296d72f 100644
--- a/tests/functions/language_select_test.php
+++ b/tests/functions/language_select_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_functions_language_select_test extends phpbb_database_test_case
{
public function getDataSet()
diff --git a/tests/functions/make_clickable_email_test.php b/tests/functions/make_clickable_email_test.php
index 4c802d0487..f32b4339a8 100644
--- a/tests/functions/make_clickable_email_test.php
+++ b/tests/functions/make_clickable_email_test.php
@@ -11,9 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
-
class phpbb_functions_make_clickable_email_test extends phpbb_test_case
{
protected function setUp()
diff --git a/tests/functions/make_clickable_test.php b/tests/functions/make_clickable_test.php
index 63beeb06b2..48fc2c19fb 100644
--- a/tests/functions/make_clickable_test.php
+++ b/tests/functions/make_clickable_test.php
@@ -11,9 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
-
class phpbb_functions_make_clickable_test extends phpbb_test_case
{
/**
diff --git a/tests/functions/obtain_online_test.php b/tests/functions/obtain_online_test.php
index e793a4eb82..778753e5d2 100644
--- a/tests/functions/obtain_online_test.php
+++ b/tests/functions/obtain_online_test.php
@@ -11,9 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
-
class phpbb_functions_obtain_online_test extends phpbb_database_test_case
{
public function getDataSet()
diff --git a/tests/functions/parse_cfg_file_test.php b/tests/functions/parse_cfg_file_test.php
index b47e25fbc1..017a931f28 100644
--- a/tests/functions/parse_cfg_file_test.php
+++ b/tests/functions/parse_cfg_file_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_functions_parse_cfg_file extends phpbb_test_case
{
public function parse_cfg_file_data()
diff --git a/tests/functions/quoteattr_test.php b/tests/functions/quoteattr_test.php
index 6e191f9610..dbad7a99d8 100644
--- a/tests/functions/quoteattr_test.php
+++ b/tests/functions/quoteattr_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_quoteattr_test extends phpbb_test_case
{
public function quoteattr_test_data()
diff --git a/tests/functions/style_select_test.php b/tests/functions/style_select_test.php
index a918f83155..27f0e68c88 100644
--- a/tests/functions/style_select_test.php
+++ b/tests/functions/style_select_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_functions_style_select_test extends phpbb_database_test_case
{
public function getDataSet()
diff --git a/tests/functions/user_delete_test.php b/tests/functions/user_delete_test.php
index bd6b53c59f..480b5fc5e1 100644
--- a/tests/functions/user_delete_test.php
+++ b/tests/functions/user_delete_test.php
@@ -11,7 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
class phpbb_functions_user_delete_test extends phpbb_database_test_case
diff --git a/tests/functions/validate_email_test.php b/tests/functions/validate_email_test.php
index b46509fda7..7f8b2679d4 100644
--- a/tests/functions/validate_email_test.php
+++ b/tests/functions/validate_email_test.php
@@ -7,7 +7,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
require_once dirname(__FILE__) . '/../mock/user.php';
require_once dirname(__FILE__) . '/validate_data_helper.php';
diff --git a/tests/functions/validate_password_test.php b/tests/functions/validate_password_test.php
index c5942e79bf..5e34c8baba 100644
--- a/tests/functions/validate_password_test.php
+++ b/tests/functions/validate_password_test.php
@@ -11,7 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
require_once dirname(__FILE__) . '/validate_data_helper.php';
diff --git a/tests/functions/validate_string_test.php b/tests/functions/validate_string_test.php
index 24026e4c9f..7aca14c334 100644
--- a/tests/functions/validate_string_test.php
+++ b/tests/functions/validate_string_test.php
@@ -12,7 +12,6 @@
*/
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
require_once dirname(__FILE__) . '/validate_data_helper.php';
class phpbb_functions_validate_string_test extends phpbb_test_case
diff --git a/tests/functions/validate_user_email_test.php b/tests/functions/validate_user_email_test.php
index 951d5794e6..8dcec88103 100644
--- a/tests/functions/validate_user_email_test.php
+++ b/tests/functions/validate_user_email_test.php
@@ -11,7 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
require_once dirname(__FILE__) . '/../mock/user.php';
require_once dirname(__FILE__) . '/validate_data_helper.php';
diff --git a/tests/functions/validate_username_test.php b/tests/functions/validate_username_test.php
index 4fa5af7ff3..d310f58036 100644
--- a/tests/functions/validate_username_test.php
+++ b/tests/functions/validate_username_test.php
@@ -11,9 +11,7 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
require_once dirname(__FILE__) . '/../mock/cache.php';
require_once dirname(__FILE__) . '/validate_data_helper.php';
diff --git a/tests/functions_acp/build_cfg_template_test.php b/tests/functions_acp/build_cfg_template_test.php
index a8d7ae6f09..2e3a8adac7 100644
--- a/tests/functions_acp/build_cfg_template_test.php
+++ b/tests/functions_acp/build_cfg_template_test.php
@@ -68,7 +68,7 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case
array('config_key_name_width' => 10, 'config_key_name_height' => 20),
'config_key_name',
array(),
- '<input id="number_key_name" type="number" size="2" maxlength="2" min="5" max="15" name="config[config_key_name_width]" value="10" /> x <input type="number" size="2" maxlength="2" min="5" max="15" name="config[config_key_name_height]" value="20" />',
+ '<input id="number_key_name" type="number" min="5" max="15" name="config[config_key_name_width]" value="10" /> x <input type="number" min="5" max="15" name="config[config_key_name_height]" value="20" />',
),
array(
array('dimension', 0, 15),
@@ -76,7 +76,7 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case
array('config_key_name_width' => 10, 'config_key_name_height' => 20),
'config_key_name',
array(),
- '<input id="number_key_name" type="number" size="2" maxlength="2" min="0" max="15" name="config[config_key_name_width]" value="10" /> x <input type="number" size="2" maxlength="2" min="0" max="15" name="config[config_key_name_height]" value="20" />',
+ '<input id="number_key_name" type="number" min="0" max="15" name="config[config_key_name_width]" value="10" /> x <input type="number" min="0" max="15" name="config[config_key_name_height]" value="20" />',
),
);
}
@@ -104,7 +104,7 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case
array('config_key_name' => 10),
'config_key_name',
array(),
- '<input id="number_key_name" type="number" maxlength="2" min="5" max="15" name="config[config_key_name]" value="10" />',
+ '<input id="number_key_name" type="number" min="5" max="15" name="config[config_key_name]" value="10" />',
),
array(
array('number', -1, 9999),
@@ -112,7 +112,7 @@ class phpbb_functions_acp_build_cfg_template_test extends phpbb_test_case
array('config_key_name' => 10),
'config_key_name',
array(),
- '<input id="number_key_name" type="number" maxlength="4" min="-1" max="9999" name="config[config_key_name]" value="10" />',
+ '<input id="number_key_name" type="number" min="-1" max="9999" name="config[config_key_name]" value="10" />',
),
);
}
diff --git a/tests/functions_acp/validate_config_vars_test.php b/tests/functions_acp/validate_config_vars_test.php
index 32738e4351..5c31888291 100644
--- a/tests/functions_acp/validate_config_vars_test.php
+++ b/tests/functions_acp/validate_config_vars_test.php
@@ -12,7 +12,6 @@
*/
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_acp.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
class phpbb_functions_acp_validate_config_vars_test extends phpbb_test_case
{
diff --git a/tests/functions_acp/validate_range_test.php b/tests/functions_acp/validate_range_test.php
index 6408e29a26..9e9154a43c 100644
--- a/tests/functions_acp/validate_range_test.php
+++ b/tests/functions_acp/validate_range_test.php
@@ -11,7 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_acp.php';
class phpbb_functions_acp_validate_range_test extends phpbb_test_case
diff --git a/tests/functions_content/get_username_string_test.php b/tests/functions_content/get_username_string_test.php
index 01ec97f6a4..e79342d05d 100644
--- a/tests/functions_content/get_username_string_test.php
+++ b/tests/functions_content/get_username_string_test.php
@@ -11,9 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
-
class phpbb_functions_content_get_username_string_test extends phpbb_test_case
{
public function setUp()
diff --git a/tests/functions_content/phpbb_clean_search_string_test.php b/tests/functions_content/phpbb_clean_search_string_test.php
index abd107097c..34ae0575c5 100644
--- a/tests/functions_content/phpbb_clean_search_string_test.php
+++ b/tests/functions_content/phpbb_clean_search_string_test.php
@@ -11,8 +11,6 @@
*
*/
-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()
diff --git a/tests/functions_user/delete_user_test.php b/tests/functions_user/delete_user_test.php
index 6d2e1fa20a..25042d9f1b 100644
--- a/tests/functions_user/delete_user_test.php
+++ b/tests/functions_user/delete_user_test.php
@@ -7,9 +7,7 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
class phpbb_functions_user_delete_user_test extends phpbb_database_test_case
{
diff --git a/tests/functions_user/group_user_attributes_test.php b/tests/functions_user/group_user_attributes_test.php
index 6ccada44f8..3124d57ba0 100644
--- a/tests/functions_user/group_user_attributes_test.php
+++ b/tests/functions_user/group_user_attributes_test.php
@@ -11,9 +11,7 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
class phpbb_functions_user_group_user_attributes_test extends phpbb_database_test_case
{
diff --git a/tests/groupposition/legend_test.php b/tests/groupposition/legend_test.php
index 566a8a2935..02ddb7cbce 100644
--- a/tests/groupposition/legend_test.php
+++ b/tests/groupposition/legend_test.php
@@ -11,7 +11,6 @@
*
*/
-
class phpbb_groupposition_legend_test extends phpbb_database_test_case
{
public function getDataSet()
diff --git a/tests/groupposition/teampage_test.php b/tests/groupposition/teampage_test.php
index dff52f7a43..3b916670f7 100644
--- a/tests/groupposition/teampage_test.php
+++ b/tests/groupposition/teampage_test.php
@@ -11,9 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
-
class phpbb_groupposition_teampage_test extends phpbb_database_test_case
{
public function getDataSet()
diff --git a/tests/lock/db_test.php b/tests/lock/db_test.php
index 389eab4152..5fbfa26554 100644
--- a/tests/lock/db_test.php
+++ b/tests/lock/db_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_lock_db_test extends phpbb_database_test_case
{
private $db;
diff --git a/tests/log/add_test.php b/tests/log/add_test.php
index ea1ae74d53..604c8364dc 100644
--- a/tests/log/add_test.php
+++ b/tests/log/add_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_log_add_test extends phpbb_database_test_case
{
public function getDataSet()
diff --git a/tests/log/delete_test.php b/tests/log/delete_test.php
index fe4c3835cb..e8b75d01d9 100644
--- a/tests/log/delete_test.php
+++ b/tests/log/delete_test.php
@@ -11,10 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
-
class phpbb_log_delete_test extends phpbb_database_test_case
{
protected $log;
diff --git a/tests/log/function_add_log_test.php b/tests/log/function_add_log_test.php
index cdfeb52996..3b5537fc13 100644
--- a/tests/log/function_add_log_test.php
+++ b/tests/log/function_add_log_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_compatibility.php';
-
class phpbb_log_function_add_log_test extends phpbb_database_test_case
{
public function getDataSet()
diff --git a/tests/log/function_view_log_test.php b/tests/log/function_view_log_test.php
index 81b1f4a78c..ee9c3e5893 100644
--- a/tests/log/function_view_log_test.php
+++ b/tests/log/function_view_log_test.php
@@ -11,10 +11,7 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_admin.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
require_once dirname(__FILE__) . '/../mock/user.php';
require_once dirname(__FILE__) . '/../mock/cache.php';
diff --git a/tests/mock/session_testable.php b/tests/mock/session_testable.php
index 29dd2a5bff..2f24978ba8 100644
--- a/tests/mock/session_testable.php
+++ b/tests/mock/session_testable.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
/**
* Extends the session class to overwrite the setting of cookies.
*
diff --git a/tests/network/checkdnsrr_test.php b/tests/network/checkdnsrr_test.php
index a3852b2656..6503a4c40b 100644
--- a/tests/network/checkdnsrr_test.php
+++ b/tests/network/checkdnsrr_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
/**
* @group slow
*/
diff --git a/tests/network/ftp_fsock_pasv_epsv_test.php b/tests/network/ftp_fsock_pasv_epsv_test.php
index 6ed9d61dc0..4ec21b6f75 100644
--- a/tests/network/ftp_fsock_pasv_epsv_test.php
+++ b/tests/network/ftp_fsock_pasv_epsv_test.php
@@ -11,7 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_transfer.php';
/**
diff --git a/tests/network/inet_ntop_pton_test.php b/tests/network/inet_ntop_pton_test.php
index fae40ad74e..dbd58ce783 100644
--- a/tests/network/inet_ntop_pton_test.php
+++ b/tests/network/inet_ntop_pton_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_network_inet_ntop_pton_test extends phpbb_test_case
{
public function data_provider()
diff --git a/tests/network/ip_normalise_test.php b/tests/network/ip_normalise_test.php
index 1acfd4521d..52e594e115 100644
--- a/tests/network/ip_normalise_test.php
+++ b/tests/network/ip_normalise_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_network_ip_normalise_test extends phpbb_test_case
{
public function data_provider()
diff --git a/tests/notification/group_request_test.php b/tests/notification/group_request_test.php
index d16e198861..92e758a336 100644
--- a/tests/notification/group_request_test.php
+++ b/tests/notification/group_request_test.php
@@ -12,7 +12,6 @@
*/
require_once dirname(__FILE__) . '/base.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
class phpbb_notification_group_request_test extends phpbb_tests_notification_base
{
diff --git a/tests/notification/submit_post_base.php b/tests/notification/submit_post_base.php
index 14ca4499d2..21559c42a5 100644
--- a/tests/notification/submit_post_base.php
+++ b/tests/notification/submit_post_base.php
@@ -15,10 +15,7 @@ use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_posting.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
abstract class phpbb_notification_submit_post_base extends phpbb_database_test_case
{
diff --git a/tests/notification/user_list_trim_test.php b/tests/notification/user_list_trim_test.php
index 9f6eb492f6..7d4dff6024 100644
--- a/tests/notification/user_list_trim_test.php
+++ b/tests/notification/user_list_trim_test.php
@@ -11,9 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_notification_user_list_trim_test extends phpbb_database_test_case
{
protected $notification;
diff --git a/tests/pagination/pagination_test.php b/tests/pagination/pagination_test.php
index 6a3b46cdae..024b6fc02d 100644
--- a/tests/pagination/pagination_test.php
+++ b/tests/pagination/pagination_test.php
@@ -46,7 +46,7 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
new \phpbb\routing\file_locator($filesystem, dirname(__FILE__) . '/')
);
$resources_locator = new \phpbb\routing\resources_locator\default_resources_locator(dirname(__FILE__) . '/', PHPBB_ENVIRONMENT, $manager);
- $router = new phpbb_mock_router(new phpbb_mock_container_builder(), $resources_locator, $loader, dirname(__FILE__) . '/', 'php', PHPBB_ENVIRONMENT);
+ $router = new phpbb_mock_router(new phpbb_mock_container_builder(), $resources_locator, $loader, dirname(__FILE__) . '/', 'php');
$request = new phpbb_mock_request();
$request->overwrite('SCRIPT_NAME', '/app.php', \phpbb\request\request_interface::SERVER);
diff --git a/tests/profilefields/type_googleplus_test.php b/tests/profilefields/type_googleplus_test.php
index 6faf939231..9222362214 100644
--- a/tests/profilefields/type_googleplus_test.php
+++ b/tests/profilefields/type_googleplus_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once __DIR__ . '/../../phpBB/includes/utf/utf_tools.php';
-
class phpbb_profilefield_type_googleplus_test extends phpbb_test_case
{
protected $field;
diff --git a/tests/profilefields/type_string_test.php b/tests/profilefields/type_string_test.php
index 447ab32a00..7c7fa3f3e6 100644
--- a/tests/profilefields/type_string_test.php
+++ b/tests/profilefields/type_string_test.php
@@ -11,10 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
-
class phpbb_profilefield_type_string_test extends phpbb_test_case
{
protected $cp;
diff --git a/tests/profilefields/type_url_test.php b/tests/profilefields/type_url_test.php
index a0f93fe1f6..1d90e2c34c 100644
--- a/tests/profilefields/type_url_test.php
+++ b/tests/profilefields/type_url_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_profilefield_type_url_test extends phpbb_test_case
{
protected $cp;
diff --git a/tests/random/gen_rand_string_test.php b/tests/random/gen_rand_string_test.php
index 1d12d0622c..a9d1ea20de 100644
--- a/tests/random/gen_rand_string_test.php
+++ b/tests/random/gen_rand_string_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_random_gen_rand_string_test extends phpbb_test_case
{
const TEST_COUNT = 100;
diff --git a/tests/regex/censor_test.php b/tests/regex/censor_test.php
index 5625b0020b..5a516b71de 100644
--- a/tests/regex/censor_test.php
+++ b/tests/regex/censor_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_regex_censor_test extends phpbb_test_case
{
public function censor_test_data()
@@ -41,4 +39,4 @@ class phpbb_regex_censor_test extends phpbb_test_case
$this->assertRegExp($regex, $subject);
}
-} \ No newline at end of file
+}
diff --git a/tests/regex/email_test.php b/tests/regex/email_test.php
index ede35c49bc..5187b8bda6 100644
--- a/tests/regex/email_test.php
+++ b/tests/regex/email_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_regex_email_test extends phpbb_test_case
{
protected $regex;
diff --git a/tests/regex/ipv4_test.php b/tests/regex/ipv4_test.php
index 62c2567517..e21a2d77fa 100644
--- a/tests/regex/ipv4_test.php
+++ b/tests/regex/ipv4_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_regex_ipv4_test extends phpbb_test_case
{
protected $regex;
diff --git a/tests/regex/ipv6_test.php b/tests/regex/ipv6_test.php
index 41039c819d..223161df7f 100644
--- a/tests/regex/ipv6_test.php
+++ b/tests/regex/ipv6_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_regex_ipv6_test extends phpbb_test_case
{
protected $regex;
diff --git a/tests/regex/password_complexity_test.php b/tests/regex/password_complexity_test.php
index 8a1a9edd41..933dc1ac91 100644
--- a/tests/regex/password_complexity_test.php
+++ b/tests/regex/password_complexity_test.php
@@ -11,7 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../../phpBB/includes/functions_user.php';
class phpbb_password_complexity_test extends phpbb_test_case
diff --git a/tests/regex/table_prefix_test.php b/tests/regex/table_prefix_test.php
index c593085b25..bf7b59ccc6 100644
--- a/tests/regex/table_prefix_test.php
+++ b/tests/regex/table_prefix_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_regex_table_prefix_test extends phpbb_test_case
{
public function table_prefix_test_data()
diff --git a/tests/regex/url_test.php b/tests/regex/url_test.php
index e5d7c3256a..5e2a22bf73 100644
--- a/tests/regex/url_test.php
+++ b/tests/regex/url_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_regex_url_test extends phpbb_test_case
{
public function url_test_data()
diff --git a/tests/request/request_test.php b/tests/request/request_test.php
index 131abe6aac..ebaea1f9ef 100644
--- a/tests/request/request_test.php
+++ b/tests/request/request_test.php
@@ -13,7 +13,10 @@
class phpbb_request_test extends phpbb_test_case
{
+ /** @var \phpbb\request\type_cast_helper_interface */
private $type_cast_helper;
+
+ /** @var \phpbb\request\request */
private $request;
protected function setUp()
@@ -143,15 +146,112 @@ class phpbb_request_test extends phpbb_test_case
$this->assertTrue($this->request->is_ajax());
}
- public function test_is_secure()
+ public function data_is_secure()
+ {
+ return array(
+ array(
+ array(
+ 'HTTPS' => 'on',
+ ),
+ true,
+ ),
+ array(
+ array(
+ 'HTTPS' => '1',
+ ),
+ true,
+ ),
+ array(
+ array(
+ 'HTTPS' => 'yes',
+ ),
+ true,
+ ),
+ array(
+ array(
+ 'HTTPS' => 1,
+ ),
+ true,
+ ),
+ array(
+ array(
+ 'HTTPS' => 'off',
+ ),
+ false,
+ ),
+ array(
+ array(
+ 'HTTPS' => '0',
+ ),
+ false,
+ ),
+ array(
+ array(
+ 'HTTPS' => 0,
+ ),
+ false,
+ ),
+ array(
+ array(
+ 'HTTPS' => '',
+ ),
+ false,
+ ),
+ array(
+ array(
+ 'HTTPS' => 'off',
+ 'HTTP_X_FORWARDED_PROTO' => 'https',
+ ),
+ true,
+ ),
+ array(
+ array(
+ 'HTTPS' => 'on',
+ 'HTTP_X_FORWARDED_PROTO' => 'http',
+ ),
+ true,
+ ),
+ array(
+ array(
+ 'HTTPS' => 'off',
+ 'HTTP_X_FORWARDED_PROTO' => 'http',
+ ),
+ false,
+ ),
+ array(
+ array(
+ 'HTTP_X_FORWARDED_PROTO' => 'http',
+ ),
+ false,
+ ),
+ array(
+ array(
+ 'HTTP_X_FORWARDED_PROTO' => 'https',
+ ),
+ true,
+ ),
+ array(
+ array(
+ 'HTTPS' => 'on',
+ 'HTTP_X_FORWARDED_PROTO' => 'http',
+ ),
+ true,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider data_is_secure
+ */
+ public function test_is_secure($server_data, $expected)
{
$this->assertFalse($this->request->is_secure());
$this->request->enable_super_globals();
- $_SERVER['HTTPS'] = 'on';
+ $_SERVER = $server_data;
$this->request = new \phpbb\request\request($this->type_cast_helper);
- $this->assertTrue($this->request->is_secure());
+ $this->assertSame($expected, $this->request->is_secure());
}
public function test_variable_names()
diff --git a/tests/request/request_var_test.php b/tests/request/request_var_test.php
index b409e5ef25..84c81c4e84 100644
--- a/tests/request/request_var_test.php
+++ b/tests/request/request_var_test.php
@@ -11,9 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_compatibility.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
-
class phpbb_request_var_test extends phpbb_test_case
{
/**
diff --git a/tests/request/type_cast_helper_test.php b/tests/request/type_cast_helper_test.php
index d6ee1dc728..143c05aa9c 100644
--- a/tests/request/type_cast_helper_test.php
+++ b/tests/request/type_cast_helper_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
-
class phpbb_type_cast_helper_test extends phpbb_test_case
{
private $type_cast_helper;
diff --git a/tests/security/extract_current_page_test.php b/tests/security/extract_current_page_test.php
index 767b901a43..f764449eca 100644
--- a/tests/security/extract_current_page_test.php
+++ b/tests/security/extract_current_page_test.php
@@ -13,7 +13,6 @@
require_once dirname(__FILE__) . '/base.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
class phpbb_security_extract_current_page_test extends phpbb_security_test_base
{
diff --git a/tests/security/hash_test.php b/tests/security/hash_test.php
index 0494c55c6d..84d4fcf479 100644
--- a/tests/security/hash_test.php
+++ b/tests/security/hash_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_compatibility.php';
-
class phpbb_security_hash_test extends phpbb_test_case
{
public function setUp()
diff --git a/tests/security/redirect_test.php b/tests/security/redirect_test.php
index 62781f3ee6..40cb7d2f04 100644
--- a/tests/security/redirect_test.php
+++ b/tests/security/redirect_test.php
@@ -13,7 +13,6 @@
require_once dirname(__FILE__) . '/base.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
class phpbb_security_redirect_test extends phpbb_security_test_base
{
diff --git a/tests/session/append_sid_test.php b/tests/session/append_sid_test.php
index 2a1d94514f..4e5a238644 100644
--- a/tests/session/append_sid_test.php
+++ b/tests/session/append_sid_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_session_append_sid_test extends phpbb_test_case
{
diff --git a/tests/session/extract_page_test.php b/tests/session/extract_page_test.php
index 96445ef9b3..88eb7b2c1a 100644
--- a/tests/session/extract_page_test.php
+++ b/tests/session/extract_page_test.php
@@ -12,7 +12,6 @@
*/
require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
class phpbb_session_extract_page_test extends phpbb_session_test_case
{
diff --git a/tests/session/garbage_collection_test.php b/tests/session/garbage_collection_test.php
index 3fad81c68b..3dc591a328 100644
--- a/tests/session/garbage_collection_test.php
+++ b/tests/session/garbage_collection_test.php
@@ -12,7 +12,6 @@
*/
require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
class phpbb_session_garbage_collection_test extends phpbb_session_test_case
{
diff --git a/tests/session/session_key_test.php b/tests/session/session_key_test.php
index bf3dfcaa3c..2499ea1d55 100644
--- a/tests/session/session_key_test.php
+++ b/tests/session/session_key_test.php
@@ -11,7 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../test_framework/phpbb_session_test_case.php';
class phpbb_session_login_keys_test extends phpbb_session_test_case
diff --git a/tests/session/testable_factory.php b/tests/session/testable_factory.php
index 7819063505..6f8b49122b 100644
--- a/tests/session/testable_factory.php
+++ b/tests/session/testable_factory.php
@@ -73,7 +73,7 @@ class phpbb_session_testable_factory
public function get_session(\phpbb\db\driver\driver_interface $dbal)
{
// set up all the global variables used by session
- global $SID, $_SID, $db, $config, $cache, $request, $phpbb_container;
+ global $SID, $_SID, $db, $config, $cache, $request, $phpbb_container, $phpbb_root_path;
$request = $this->request = new phpbb_mock_request(
array(),
@@ -95,6 +95,7 @@ class phpbb_session_testable_factory
new phpbb_mock_auth_provider()
);
$phpbb_container->setParameter('core.environment', PHPBB_ENVIRONMENT);
+ $phpbb_container->setParameter('core.cache_dir', $phpbb_root_path . 'cache/' . PHPBB_ENVIRONMENT . '/');
$provider_collection = new \phpbb\auth\provider_collection($phpbb_container, $config);
$provider_collection->add('auth.provider.db');
$phpbb_container->set(
diff --git a/tests/template/template_allfolder_test.php b/tests/template/template_allfolder_test.php
index 9a0f1f512e..9a0a42fabd 100644
--- a/tests/template/template_allfolder_test.php
+++ b/tests/template/template_allfolder_test.php
@@ -64,7 +64,6 @@ class phpbb_template_allfolder_test extends phpbb_template_template_test_case
$config,
$filesystem,
$path_helper,
- $container,
$cache_path,
$this->extension_manager,
$loader,
@@ -76,7 +75,7 @@ class phpbb_template_allfolder_test extends phpbb_template_template_test_case
)
);
$this->template = new \phpbb\template\twig\twig($path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $this->user)), $this->extension_manager);
- $container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig));
+ $twig->setLexer(new \phpbb\template\twig\lexer($twig));
$this->template_path = $this->test_path . '/templates';
$this->ext_template_path = 'tests/extension/ext/vendor4/bar/styles/all/template';
diff --git a/tests/template/template_events_test.php b/tests/template/template_events_test.php
index 54e08652a1..e245c90aee 100644
--- a/tests/template/template_events_test.php
+++ b/tests/template/template_events_test.php
@@ -158,7 +158,6 @@ Zeta test event in all',
$config,
$filesystem,
$path_helper,
- $container,
$cache_path,
$this->extension_manager,
$loader,
@@ -170,7 +169,7 @@ Zeta test event in all',
)
);
$this->template = new \phpbb\template\twig\twig($path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $this->user)), $this->extension_manager);
- $container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig));
+ $twig->setLexer(new \phpbb\template\twig\lexer($twig));
$this->template->set_custom_style(((!empty($style_names)) ? $style_names : 'silver'), array($this->template_path));
}
diff --git a/tests/template/template_includecss_test.php b/tests/template/template_includecss_test.php
index ac62e820ae..764652c9c2 100644
--- a/tests/template/template_includecss_test.php
+++ b/tests/template/template_includecss_test.php
@@ -50,7 +50,6 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te
$config,
$filesystem,
$this->phpbb_path_helper,
- $container,
$cache_path,
null,
$loader,
@@ -80,7 +79,7 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te
)
)
);
- $container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig));
+ $twig->setLexer(new \phpbb\template\twig\lexer($twig));
$this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path));
}
diff --git a/tests/template/template_parser_test.php b/tests/template/template_parser_test.php
index d32fe78391..938b1bc8b8 100644
--- a/tests/template/template_parser_test.php
+++ b/tests/template/template_parser_test.php
@@ -11,7 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/template_test_case.php';
class phpbb_template_template_parser_test extends phpbb_template_template_test_case
diff --git a/tests/template/template_test.php b/tests/template/template_test.php
index 33dc4ca551..63e7cb869a 100644
--- a/tests/template/template_test.php
+++ b/tests/template/template_test.php
@@ -11,7 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/template_test_case.php';
class phpbb_template_template_test extends phpbb_template_template_test_case
diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php
index 3c97d30edc..e52d3b76dd 100644
--- a/tests/template/template_test_case.php
+++ b/tests/template/template_test_case.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_template_template_test_case extends phpbb_test_case
{
protected $lang;
@@ -104,7 +102,6 @@ class phpbb_template_template_test_case extends phpbb_test_case
$config,
$filesystem,
$path_helper,
- $container,
$cache_path,
null,
$loader,
@@ -116,7 +113,7 @@ class phpbb_template_template_test_case extends phpbb_test_case
)
);
$this->template = new phpbb\template\twig\twig($path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $this->user)));
- $container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig));
+ $twig->setLexer(new \phpbb\template\twig\lexer($twig));
$this->template->set_custom_style('tests', $this->template_path);
}
diff --git a/tests/template/template_test_case_with_tree.php b/tests/template/template_test_case_with_tree.php
index bf5de6b85e..ff35d16120 100644
--- a/tests/template/template_test_case_with_tree.php
+++ b/tests/template/template_test_case_with_tree.php
@@ -45,7 +45,6 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat
$config,
$filesystem,
$this->phpbb_path_helper,
- $container,
$cache_path,
null,
$loader,
@@ -57,7 +56,7 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat
)
);
$this->template = new phpbb\template\twig\twig($this->phpbb_path_helper, $config, $context, $twig, $cache_path, $this->user, array(new \phpbb\template\twig\extension($context, $this->user)));
- $container->set('template.twig.lexer', new \phpbb\template\twig\lexer($twig));
+ $twig->setLexer(new \phpbb\template\twig\lexer($twig));
$this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path));
}
}
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index 53519617b3..20b89aba4e 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -209,10 +209,11 @@ class phpbb_functional_test_case extends phpbb_test_case
{
if (!$this->cache)
{
- global $phpbb_container;
+ global $phpbb_container, $phpbb_root_path;
$phpbb_container = new phpbb_mock_container_builder();
$phpbb_container->setParameter('core.environment', PHPBB_ENVIRONMENT);
+ $phpbb_container->setParameter('core.cache_dir', $phpbb_root_path . 'cache/' . PHPBB_ENVIRONMENT . '/');
$this->cache = new \phpbb\cache\driver\file;
}
@@ -383,9 +384,18 @@ class phpbb_functional_test_case extends phpbb_test_case
@unlink($phpbb_root_path . 'cache/install_lock');
}
- global $phpbb_container, $cache, $phpbb_dispatcher, $request, $user, $auth, $db, $config, $phpbb_log, $symfony_request, $phpbb_filesystem, $phpbb_path_helper, $phpbb_extension_manager, $template;
+ global $phpbb_container;
$phpbb_container->reset();
- unset($phpbb_container, $cache, $phpbb_dispatcher, $request, $user, $auth, $db, $config, $phpbb_log, $symfony_request, $phpbb_filesystem, $phpbb_path_helper, $phpbb_extension_manager, $template);
+
+ $blacklist = ['phpbb_class_loader_mock', 'phpbb_class_loader_ext', 'phpbb_class_loader'];
+
+ foreach (array_keys($GLOBALS) as $key)
+ {
+ if (is_object($GLOBALS[$key]) && !in_array($key, $blacklist, true))
+ {
+ unset($GLOBALS[$key]);
+ }
+ }
}
public function install_ext($extension)
diff --git a/tests/test_framework/phpbb_session_test_case.php b/tests/test_framework/phpbb_session_test_case.php
index 1c1930e88d..b3d7780d14 100644
--- a/tests/test_framework/phpbb_session_test_case.php
+++ b/tests/test_framework/phpbb_session_test_case.php
@@ -11,7 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../session/testable_factory.php';
require_once dirname(__FILE__) . '/../session/testable_facade.php';
diff --git a/tests/test_framework/phpbb_ui_test_case.php b/tests/test_framework/phpbb_ui_test_case.php
index b5ac3a576b..c8ca2a9003 100644
--- a/tests/test_framework/phpbb_ui_test_case.php
+++ b/tests/test_framework/phpbb_ui_test_case.php
@@ -256,9 +256,18 @@ class phpbb_ui_test_case extends phpbb_test_case
@unlink($phpbb_root_path . 'cache/install_lock');
}
- global $phpbb_container, $cache, $phpbb_dispatcher, $request, $user, $auth, $db, $config, $phpbb_log, $symfony_request, $phpbb_filesystem, $phpbb_path_helper, $phpbb_extension_manager, $template;
+ global $phpbb_container;
$phpbb_container->reset();
- unset($phpbb_container, $cache, $phpbb_dispatcher, $request, $user, $auth, $db, $config, $phpbb_log, $symfony_request, $phpbb_filesystem, $phpbb_path_helper, $phpbb_extension_manager, $template);
+
+ $blacklist = ['phpbb_class_loader_mock', 'phpbb_class_loader_ext', 'phpbb_class_loader'];
+
+ foreach (array_keys($GLOBALS) as $key)
+ {
+ if (is_object($GLOBALS[$key]) && !in_array($key, $blacklist, true))
+ {
+ unset($GLOBALS[$key]);
+ }
+ }
}
static protected function get_db()
diff --git a/tests/text_formatter/s9e/default_formatting_test.php b/tests/text_formatter/s9e/default_formatting_test.php
index 1f7df15434..a41e5da507 100644
--- a/tests/text_formatter/s9e/default_formatting_test.php
+++ b/tests/text_formatter/s9e/default_formatting_test.php
@@ -10,8 +10,6 @@
* the docs/CREDITS.txt file.
*
*/
-require_once __DIR__ . '/../../../phpBB/includes/functions.php';
-require_once __DIR__ . '/../../../phpBB/includes/functions_content.php';
class phpbb_textformatter_s9e_default_formatting_test extends phpbb_test_case
{
diff --git a/tests/text_formatter/s9e/factory_test.php b/tests/text_formatter/s9e/factory_test.php
index 8f8ec7ebc7..e74337decc 100644
--- a/tests/text_formatter/s9e/factory_test.php
+++ b/tests/text_formatter/s9e/factory_test.php
@@ -10,8 +10,7 @@
* the docs/CREDITS.txt file.
*
*/
-require_once __DIR__ . '/../../../phpBB/includes/functions.php';
-require_once __DIR__ . '/../../../phpBB/includes/functions_content.php';
+
require_once __DIR__ . '/../../test_framework/phpbb_database_test_case.php';
class phpbb_textformatter_s9e_factory_test extends phpbb_database_test_case
diff --git a/tests/text_formatter/s9e/parser_test.php b/tests/text_formatter/s9e/parser_test.php
index 3b72e713e1..4b9bbf9bb2 100644
--- a/tests/text_formatter/s9e/parser_test.php
+++ b/tests/text_formatter/s9e/parser_test.php
@@ -10,8 +10,6 @@
* the docs/CREDITS.txt file.
*
*/
-require_once __DIR__ . '/../../../phpBB/includes/functions.php';
-require_once __DIR__ . '/../../../phpBB/includes/functions_content.php';
class phpbb_textformatter_s9e_parser_test extends phpbb_test_case
{
diff --git a/tests/text_formatter/s9e/renderer_test.php b/tests/text_formatter/s9e/renderer_test.php
index ad5bfa78fc..2b034259c9 100644
--- a/tests/text_formatter/s9e/renderer_test.php
+++ b/tests/text_formatter/s9e/renderer_test.php
@@ -10,8 +10,6 @@
* the docs/CREDITS.txt file.
*
*/
-require_once __DIR__ . '/../../../phpBB/includes/functions.php';
-require_once __DIR__ . '/../../../phpBB/includes/functions_content.php';
class phpbb_textformatter_s9e_renderer_test extends phpbb_test_case
{
diff --git a/tests/text_formatter/s9e/utils_test.php b/tests/text_formatter/s9e/utils_test.php
index dade259790..719d3cda88 100644
--- a/tests/text_formatter/s9e/utils_test.php
+++ b/tests/text_formatter/s9e/utils_test.php
@@ -11,9 +11,6 @@
*
*/
-require_once __DIR__ . '/../../../phpBB/includes/functions.php';
-require_once __DIR__ . '/../../../phpBB/includes/functions_content.php';
-
class phpbb_textformatter_s9e_utils_test extends phpbb_test_case
{
/**
diff --git a/tests/text_processing/censor_text_test.php b/tests/text_processing/censor_text_test.php
index 983a5ba2d3..eda2bbb1b3 100644
--- a/tests/text_processing/censor_text_test.php
+++ b/tests/text_processing/censor_text_test.php
@@ -11,9 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
-
class phpbb_text_processing_censor_text_test extends phpbb_test_case
{
public function censor_text_data()
diff --git a/tests/text_processing/decode_message_test.php b/tests/text_processing/decode_message_test.php
index 7de599f2b1..e2402e721a 100644
--- a/tests/text_processing/decode_message_test.php
+++ b/tests/text_processing/decode_message_test.php
@@ -11,11 +11,17 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
-
class phpbb_text_processing_decode_message_test extends phpbb_test_case
{
+ public function setUp()
+ {
+ parent::setUp();
+
+ global $phpbb_dispatcher;
+
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ }
+
/**
* @dataProvider get_legacy_tests
*/
@@ -46,6 +52,14 @@ class phpbb_text_processing_decode_message_test extends phpbb_test_case
'<!-- m --><a class="postlink" href="http://www.phpbb.com">http://www.phpbb.com</a><!-- m -->',
'http://www.phpbb.com'
),
+ array(
+ '<!-- m --><a class="postlink" href="http://www.phpbb.com">this is just text</a><!-- m -->',
+ 'http://www.phpbb.com'
+ ),
+ array(
+ '<!-- m --><a class="postlink" href="http://www.phpbb.com/some/more/link/that/is/shortened">http://www.phpbb.com/some/ ... /shortened</a><!-- m -->',
+ 'http://www.phpbb.com/some/more/link/that/is/shortened'
+ ),
/**
* Fails as per PHPBB3-8420
* @link http://tracker.phpbb.com/browse/PHPBB3-8420
diff --git a/tests/text_processing/generate_text_for_display_test.php b/tests/text_processing/generate_text_for_display_test.php
index dba3713447..dfbd0977a0 100644
--- a/tests/text_processing/generate_text_for_display_test.php
+++ b/tests/text_processing/generate_text_for_display_test.php
@@ -11,9 +11,6 @@
*
*/
-require_once __DIR__ . '/../../phpBB/includes/functions.php';
-require_once __DIR__ . '/../../phpBB/includes/functions_content.php';
-
class phpbb_text_processing_generate_text_for_display_test extends phpbb_test_case
{
public function setUp()
diff --git a/tests/text_processing/generate_text_for_edit_test.php b/tests/text_processing/generate_text_for_edit_test.php
index 105e8da86b..8258a196f5 100644
--- a/tests/text_processing/generate_text_for_edit_test.php
+++ b/tests/text_processing/generate_text_for_edit_test.php
@@ -11,9 +11,6 @@
*
*/
-require_once __DIR__ . '/../../phpBB/includes/functions.php';
-require_once __DIR__ . '/../../phpBB/includes/functions_content.php';
-
class phpbb_text_processing_generate_text_for_edit_test extends phpbb_test_case
{
/**
diff --git a/tests/text_processing/generate_text_for_storage_test.php b/tests/text_processing/generate_text_for_storage_test.php
index 474f6d8f0f..f0588fec4f 100644
--- a/tests/text_processing/generate_text_for_storage_test.php
+++ b/tests/text_processing/generate_text_for_storage_test.php
@@ -11,11 +11,6 @@
*
*/
-require_once __DIR__ . '/../../phpBB/includes/functions.php';
-require_once __DIR__ . '/../../phpBB/includes/functions_compatibility.php';
-require_once __DIR__ . '/../../phpBB/includes/functions_content.php';
-require_once __DIR__ . '/../../phpBB/includes/utf/utf_tools.php';
-
class phpbb_text_processing_generate_text_for_storage_test extends phpbb_test_case
{
public function setUp()
diff --git a/tests/text_processing/make_clickable_test.php b/tests/text_processing/make_clickable_test.php
index 95e304dd97..3c8539c612 100644
--- a/tests/text_processing/make_clickable_test.php
+++ b/tests/text_processing/make_clickable_test.php
@@ -11,9 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
-
class phpbb_text_processing_make_clickable_test extends phpbb_test_case
{
public function make_clickable_data()
diff --git a/tests/text_processing/message_parser_test.php b/tests/text_processing/message_parser_test.php
index bee1b3fca3..a3dbf644f6 100644
--- a/tests/text_processing/message_parser_test.php
+++ b/tests/text_processing/message_parser_test.php
@@ -12,10 +12,7 @@
*/
require_once __DIR__ . '/../../phpBB/includes/bbcode.php';
-require_once __DIR__ . '/../../phpBB/includes/functions.php';
-require_once __DIR__ . '/../../phpBB/includes/functions_content.php';
require_once __DIR__ . '/../../phpBB/includes/message_parser.php';
-require_once __DIR__ . '/../../phpBB/includes/utf/utf_tools.php';
class phpbb_text_processing_message_parser_test extends phpbb_test_case
{
diff --git a/tests/text_processing/smilies_test.php b/tests/text_processing/smilies_test.php
index 3bbe065d36..ebdbe7dadc 100644
--- a/tests/text_processing/smilies_test.php
+++ b/tests/text_processing/smilies_test.php
@@ -11,9 +11,6 @@
*
*/
-require_once __DIR__ . '/../../phpBB/includes/functions.php';
-require_once __DIR__ . '/../../phpBB/includes/functions_content.php';
-
class phpbb_text_processing_smilies_test extends phpbb_test_case
{
/**
diff --git a/tests/text_processing/strip_bbcode_test.php b/tests/text_processing/strip_bbcode_test.php
index 827d8d4a52..9acedc2872 100644
--- a/tests/text_processing/strip_bbcode_test.php
+++ b/tests/text_processing/strip_bbcode_test.php
@@ -11,9 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions_content.php';
-
class phpbb_text_processing_strip_bbcode_test extends phpbb_test_case
{
public function test_legacy()
diff --git a/tests/text_processing/tickets_data/PHPBB3-14260.html b/tests/text_processing/tickets_data/PHPBB3-14260.html
new file mode 100644
index 0000000000..c7e7cad237
--- /dev/null
+++ b/tests/text_processing/tickets_data/PHPBB3-14260.html
@@ -0,0 +1 @@
+<a href="http://example.org/article/S0883-9441%2811%290483-7/pdf" class="postlink">http://example.org/article/S0883-9441(11)0483-7/pdf</a> \ No newline at end of file
diff --git a/tests/text_processing/tickets_data/PHPBB3-14260.txt b/tests/text_processing/tickets_data/PHPBB3-14260.txt
new file mode 100644
index 0000000000..f95523c00e
--- /dev/null
+++ b/tests/text_processing/tickets_data/PHPBB3-14260.txt
@@ -0,0 +1 @@
+http://example.org/article/S0883-9441(11)0483-7/pdf \ No newline at end of file
diff --git a/tests/text_processing/tickets_test.php b/tests/text_processing/tickets_test.php
index 8c48a3f4a9..6230191a69 100644
--- a/tests/text_processing/tickets_test.php
+++ b/tests/text_processing/tickets_test.php
@@ -11,10 +11,6 @@
*
*/
-require_once __DIR__ . '/../../phpBB/includes/functions.php';
-require_once __DIR__ . '/../../phpBB/includes/functions_content.php';
-require_once __DIR__ . '/../../phpBB/includes/utf/utf_tools.php';
-
class phpbb_text_processing_tickets_test extends phpbb_test_case
{
/**
diff --git a/tests/text_reparser/base_test.php b/tests/text_reparser/base_test.php
new file mode 100644
index 0000000000..af2d56ea51
--- /dev/null
+++ b/tests/text_reparser/base_test.php
@@ -0,0 +1,69 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+require_once __DIR__ . '/../test_framework/phpbb_database_test_case.php';
+
+class phpbb_textreparser_base_test extends phpbb_database_test_case
+{
+ protected $db;
+
+ public function setUp()
+ {
+ global $config;
+ if (!isset($config))
+ {
+ $config = new \phpbb\config\config(array());
+ }
+ $this->get_test_case_helpers()->set_s9e_services();
+ $this->db = $this->new_dbal();
+ parent::setUp();
+ }
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(__DIR__ . '/fixtures/base.xml');
+ }
+
+ protected function get_reparser()
+ {
+ return new \phpbb\textreparser\plugins\post_text($this->db, POSTS_TABLE);
+ }
+
+ protected function get_rows(array $ids)
+ {
+ $sql = 'SELECT post_id AS id, post_text AS text
+ FROM ' . POSTS_TABLE . '
+ WHERE ' . $this->db->sql_in_set('post_id', $ids) . '
+ ORDER BY id';
+ $result = $this->db->sql_query($sql);
+ $rows = $this->db->sql_fetchrowset($result);
+ $this->db->sql_freeresult($result);
+
+ return $rows;
+ }
+
+ public function test_reparse_empty()
+ {
+ $this->get_reparser()->reparse_range(1, 1);
+
+ $this->assertEquals(
+ array(
+ array(
+ 'id' => 1,
+ 'text' => '<t></t>'
+ )
+ ),
+ $this->get_rows(array(1))
+ );
+ }
+}
diff --git a/tests/text_reparser/fixtures/base.xml b/tests/text_reparser/fixtures/base.xml
new file mode 100644
index 0000000000..a4921a8823
--- /dev/null
+++ b/tests/text_reparser/fixtures/base.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_posts">
+ <column>post_id</column>
+ <column>enable_bbcode</column>
+ <column>enable_smilies</column>
+ <column>enable_magic_url</column>
+ <column>post_text</column>
+ <column>bbcode_uid</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value></value>
+ <value>abcd1234</value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/text_reparser/plugins/contact_admin_info_test.php b/tests/text_reparser/plugins/contact_admin_info_test.php
index 1dc03834b6..757b02be39 100644
--- a/tests/text_reparser/plugins/contact_admin_info_test.php
+++ b/tests/text_reparser/plugins/contact_admin_info_test.php
@@ -10,8 +10,7 @@
* the docs/CREDITS.txt file.
*
*/
-require_once __DIR__ . '/../../../phpBB/includes/functions.php';
-require_once __DIR__ . '/../../../phpBB/includes/functions_content.php';
+
require_once __DIR__ . '/../../test_framework/phpbb_database_test_case.php';
class phpbb_textreparser_contact_admin_info_test extends phpbb_database_test_case
diff --git a/tests/text_reparser/plugins/poll_option_test.php b/tests/text_reparser/plugins/poll_option_test.php
index dfa3a030ed..177faac51d 100644
--- a/tests/text_reparser/plugins/poll_option_test.php
+++ b/tests/text_reparser/plugins/poll_option_test.php
@@ -10,8 +10,7 @@
* the docs/CREDITS.txt file.
*
*/
-require_once __DIR__ . '/../../../phpBB/includes/functions.php';
-require_once __DIR__ . '/../../../phpBB/includes/functions_content.php';
+
require_once __DIR__ . '/../../test_framework/phpbb_database_test_case.php';
class phpbb_textreparser_poll_option_test extends phpbb_database_test_case
diff --git a/tests/text_reparser/plugins/test_row_based_plugin.php b/tests/text_reparser/plugins/test_row_based_plugin.php
index e8218dfdd6..3e9ff09448 100644
--- a/tests/text_reparser/plugins/test_row_based_plugin.php
+++ b/tests/text_reparser/plugins/test_row_based_plugin.php
@@ -10,8 +10,7 @@
* the docs/CREDITS.txt file.
*
*/
-require_once __DIR__ . '/../../../phpBB/includes/functions.php';
-require_once __DIR__ . '/../../../phpBB/includes/functions_content.php';
+
require_once __DIR__ . '/../../test_framework/phpbb_database_test_case.php';
abstract class phpbb_textreparser_test_row_based_plugin extends phpbb_database_test_case
diff --git a/tests/tree/nestedset_forum_base.php b/tests/tree/nestedset_forum_base.php
index 647fcef2af..3daa75b2e4 100644
--- a/tests/tree/nestedset_forum_base.php
+++ b/tests/tree/nestedset_forum_base.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_tests_tree_nestedset_forum_base extends phpbb_database_test_case
{
public function getDataSet()
diff --git a/tests/upload/filespec_test.php b/tests/upload/filespec_test.php
index 1351b46002..18b6deed1f 100644
--- a/tests/upload/filespec_test.php
+++ b/tests/upload/filespec_test.php
@@ -11,9 +11,6 @@
*
*/
-require_once __DIR__ . '/../../phpBB/includes/functions.php';
-require_once __DIR__ . '/../../phpBB/includes/utf/utf_tools.php';
-
class phpbb_filespec_test extends phpbb_test_case
{
const TEST_COUNT = 100;
diff --git a/tests/upload/fileupload_test.php b/tests/upload/fileupload_test.php
index 05cb8dcf93..fb72823f08 100644
--- a/tests/upload/fileupload_test.php
+++ b/tests/upload/fileupload_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once __DIR__ . '/../../phpBB/includes/functions.php';
-require_once __DIR__ . '/../../phpBB/includes/utf/utf_tools.php';
require_once __DIR__ . '/../mock/filespec.php';
class phpbb_fileupload_test extends phpbb_test_case
diff --git a/tests/upload/imagesize_test.php b/tests/upload/imagesize_test.php
index d20e866dab..5429bb5c5e 100644
--- a/tests/upload/imagesize_test.php
+++ b/tests/upload/imagesize_test.php
@@ -12,8 +12,6 @@
*
*/
-require_once(__DIR__ . '/../../phpBB/includes/functions.php');
-
class phpbb_upload_imagesize_test extends \phpbb_test_case
{
/** @var \FastImageSize\FastImageSize */
diff --git a/tests/user/user_loader_test.php b/tests/user/user_loader_test.php
index 8d1f43707b..f871f324ca 100644
--- a/tests/user/user_loader_test.php
+++ b/tests/user/user_loader_test.php
@@ -11,8 +11,6 @@
*
*/
-include_once(__DIR__ . '/../../phpBB/includes/utf/utf_tools.php');
-
class phpbb_user_loader_test extends phpbb_database_test_case
{
protected $db;
diff --git a/tests/utf/utf8_clean_string_test.php b/tests/utf/utf8_clean_string_test.php
index 2bb65387e0..4b3c8a5a25 100644
--- a/tests/utf/utf8_clean_string_test.php
+++ b/tests/utf/utf8_clean_string_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
-
class phpbb_utf_utf8_clean_string_test extends phpbb_test_case
{
public function cleanable_strings()
diff --git a/tests/utf/utf8_wordwrap_test.php b/tests/utf/utf8_wordwrap_test.php
index ab053e2911..8906595d33 100644
--- a/tests/utf/utf8_wordwrap_test.php
+++ b/tests/utf/utf8_wordwrap_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/utf/utf_tools.php';
-
class phpbb_utf_utf8_wordwrap_test extends phpbb_test_case
{
public function test_utf8_wordwrap_ascii()
diff --git a/tests/wrapper/gmgetdate_test.php b/tests/wrapper/gmgetdate_test.php
index 2e55a78d21..08ee491c0f 100644
--- a/tests/wrapper/gmgetdate_test.php
+++ b/tests/wrapper/gmgetdate_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_wrapper_gmgetdate_test extends phpbb_test_case
{
public static function phpbb_gmgetdate_data()
diff --git a/tests/wrapper/mt_rand_test.php b/tests/wrapper/mt_rand_test.php
index d190182286..8d370dee2a 100644
--- a/tests/wrapper/mt_rand_test.php
+++ b/tests/wrapper/mt_rand_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_wrapper_mt_rand_test extends phpbb_test_case
{
public function test_max_equals_min()
diff --git a/tests/wrapper/phpbb_php_ini_test.php b/tests/wrapper/phpbb_php_ini_test.php
index 9f46a78d5b..5827744702 100644
--- a/tests/wrapper/phpbb_php_ini_test.php
+++ b/tests/wrapper/phpbb_php_ini_test.php
@@ -12,7 +12,6 @@
*/
require_once dirname(__FILE__) . '/phpbb_php_ini_fake.php';
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
class phpbb_wrapper_phpbb_php_ini_test extends phpbb_test_case
{
diff --git a/tests/wrapper/version_compare_test.php b/tests/wrapper/version_compare_test.php
index 93d9e0117d..8260d99504 100644
--- a/tests/wrapper/version_compare_test.php
+++ b/tests/wrapper/version_compare_test.php
@@ -11,8 +11,6 @@
*
*/
-require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
-
class phpbb_wrapper_version_compare_test extends phpbb_test_case
{
public function test_two_parameters()
diff --git a/travis/setup-phpbb.sh b/travis/setup-phpbb.sh
index 0beaa9ec8c..f9fd9522ca 100755
--- a/travis/setup-phpbb.sh
+++ b/travis/setup-phpbb.sh
@@ -37,5 +37,5 @@ then
fi
cd phpBB
-php ../composer.phar install --dev --no-interaction --prefer-source
+php ../composer.phar install --dev --no-interaction
cd ..
diff --git a/travis/setup-webserver.sh b/travis/setup-webserver.sh
index 911ba12f3c..3369d740fe 100755
--- a/travis/setup-webserver.sh
+++ b/travis/setup-webserver.sh
@@ -57,20 +57,12 @@ else
fi
# nginx
-echo "
- server {
- listen 80;
- root $PHPBB_ROOT_PATH/;
- index index.php index.html;
-
- location ~ \.php {
- include fastcgi_params;
- fastcgi_split_path_info ^(.+\.php)(/.*)$;
- fastcgi_param PATH_INFO \$fastcgi_path_info;
- fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
- fastcgi_pass unix:$APP_SOCK;
- }
- }
-" | sudo tee $NGINX_CONF > /dev/null
+cat $DIR/../phpBB/docs/nginx.sample.conf \
+| sed "s/root \/path\/to\/phpbb/root $(echo $PHPBB_ROOT_PATH | sed -e 's/\\/\\\\/g' -e 's/\//\\\//g' -e 's/&/\\\&/g')/g" \
+| sed -e '1,/The actual board domain/d' \
+| sed -e '/If running php as fastcgi/,$d' \
+| sed -e "s/fastcgi_pass php;/fastcgi_pass unix:$(echo $APP_SOCK | sed -e 's/\\/\\\\/g' -e 's/\//\\\//g' -e 's/&/\\\&/g');/g" \
+| sed -e 's/#listen 80/listen 80/' \
+| sudo tee $NGINX_CONF
sudo service nginx start