aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore9
-rw-r--r--.travis.yml9
-rw-r--r--CONTRIBUTING.md6
-rw-r--r--README.md6
-rw-r--r--build/build.xml18
-rwxr-xr-xbuild/build_changelog.php2
-rw-r--r--build/code_sniffer/phpbb/Sniffs/Commenting/FileCommentSniff.php6
-rw-r--r--build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php118
-rwxr-xr-xbuild/package.php1
-rw-r--r--build/sami-all.conf.php30
-rw-r--r--build/sami-checkout.conf.php (renamed from build/sami.conf.php)15
-rwxr-xr-xcomposer.pharbin960311 -> 1075150 bytes
-rw-r--r--phpBB/adm/style/acp_email.html2
-rw-r--r--phpBB/adm/style/acp_forums.html7
-rw-r--r--phpBB/adm/style/acp_icons.html16
-rw-r--r--phpBB/adm/style/acp_users_profile.html4
-rw-r--r--phpBB/adm/style/install_header.html2
-rw-r--r--phpBB/adm/style/install_update_diff.html2
-rw-r--r--phpBB/adm/style/overall_header.html2
-rw-r--r--phpBB/adm/style/simple_header.html1
-rw-r--r--phpBB/assets/javascript/core.js7
-rw-r--r--phpBB/assets/javascript/plupload.js8
-rw-r--r--phpBB/common.php2
-rw-r--r--phpBB/composer.lock191
-rw-r--r--phpBB/config/auth.yml (renamed from phpBB/config/auth_providers.yml)14
-rw-r--r--phpBB/config/avatar.yml (renamed from phpBB/config/avatars.yml)21
-rw-r--r--phpBB/config/captcha.yml17
-rw-r--r--phpBB/config/console.yml1
-rw-r--r--phpBB/config/content.yml72
-rw-r--r--phpBB/config/cron.yml (renamed from phpBB/config/cron_tasks.yml)22
-rw-r--r--phpBB/config/db.yml (renamed from phpBB/config/migrator.yml)18
-rw-r--r--phpBB/config/event.yml34
-rw-r--r--phpBB/config/mimetype_guesser.yml (renamed from phpBB/config/mimetype_guessers.yml)21
-rw-r--r--phpBB/config/notification.yml (renamed from phpBB/config/notifications.yml)74
-rw-r--r--phpBB/config/parameters.yml17
-rw-r--r--phpBB/config/password.yml (renamed from phpBB/config/passwords.yml)56
-rw-r--r--phpBB/config/profilefield.yml (renamed from phpBB/config/profilefields.yml)1
-rw-r--r--phpBB/config/routing.yml2
-rw-r--r--phpBB/config/services.yml216
-rw-r--r--phpBB/config/tables.yml3
-rw-r--r--phpBB/config/user.yml19
-rw-r--r--phpBB/develop/add_permissions.php4
-rw-r--r--phpBB/develop/create_schema_files.php3
-rw-r--r--phpBB/develop/mysql_upgrader.php12
-rw-r--r--phpBB/develop/regex_idn.php151
-rw-r--r--phpBB/docs/CHANGELOG.html611
-rw-r--r--phpBB/docs/CREDITS.txt5
-rw-r--r--phpBB/docs/FAQ.html79
-rw-r--r--phpBB/docs/INSTALL.html101
-rw-r--r--phpBB/docs/README.html102
-rw-r--r--phpBB/docs/assets/css/stylesheet.css (renamed from phpBB/docs/stylesheet.css)100
-rw-r--r--phpBB/docs/assets/images/bg_header.gif (renamed from phpBB/docs/bg_header.gif)bin690 -> 690 bytes
-rw-r--r--phpBB/docs/assets/images/icon_back_top.gifbin0 -> 204 bytes
-rw-r--r--phpBB/docs/assets/images/site_logo.gifbin0 -> 5070 bytes
-rw-r--r--phpBB/docs/auth_api.html62
-rw-r--r--phpBB/docs/coding-guidelines.html411
-rw-r--r--phpBB/docs/corners_left.gifbin55 -> 0 bytes
-rw-r--r--phpBB/docs/corners_left.pngbin195 -> 0 bytes
-rw-r--r--phpBB/docs/corners_right.gifbin56 -> 0 bytes
-rw-r--r--phpBB/docs/corners_right.pngbin201 -> 0 bytes
-rw-r--r--phpBB/docs/events.md382
-rw-r--r--phpBB/docs/site_logo.gifbin3430 -> 0 bytes
-rw-r--r--phpBB/faq.php26
-rw-r--r--phpBB/includes/acp/acp_attachments.php2
-rw-r--r--phpBB/includes/acp/acp_ban.php81
-rw-r--r--phpBB/includes/acp/acp_bbcodes.php4
-rw-r--r--phpBB/includes/acp/acp_board.php79
-rw-r--r--phpBB/includes/acp/acp_email.php117
-rw-r--r--phpBB/includes/acp/acp_extensions.php7
-rw-r--r--phpBB/includes/acp/acp_main.php4
-rw-r--r--phpBB/includes/acp/acp_profile.php2
-rw-r--r--phpBB/includes/acp/acp_prune.php8
-rw-r--r--phpBB/includes/acp/acp_search.php1
-rw-r--r--phpBB/includes/acp/acp_styles.php68
-rw-r--r--phpBB/includes/acp/acp_users.php54
-rw-r--r--phpBB/includes/acp/info/acp_styles.php1
-rw-r--r--phpBB/includes/bbcode.php22
-rw-r--r--phpBB/includes/constants.php2
-rw-r--r--phpBB/includes/functions.php236
-rw-r--r--phpBB/includes/functions_acp.php13
-rw-r--r--phpBB/includes/functions_admin.php112
-rw-r--r--phpBB/includes/functions_compatibility.php34
-rw-r--r--phpBB/includes/functions_content.php46
-rw-r--r--phpBB/includes/functions_convert.php1
-rw-r--r--phpBB/includes/functions_display.php109
-rw-r--r--phpBB/includes/functions_download.php12
-rw-r--r--phpBB/includes/functions_mcp.php54
-rw-r--r--phpBB/includes/functions_messenger.php2
-rw-r--r--phpBB/includes/functions_posting.php71
-rw-r--r--phpBB/includes/functions_privmsgs.php36
-rw-r--r--phpBB/includes/functions_user.php73
-rw-r--r--phpBB/includes/mcp/mcp_ban.php128
-rw-r--r--phpBB/includes/mcp/mcp_forum.php16
-rw-r--r--phpBB/includes/mcp/mcp_front.php2
-rw-r--r--phpBB/includes/mcp/mcp_logs.php2
-rw-r--r--phpBB/includes/mcp/mcp_main.php21
-rw-r--r--phpBB/includes/mcp/mcp_queue.php96
-rw-r--r--phpBB/includes/mcp/mcp_topic.php48
-rw-r--r--phpBB/includes/mcp/mcp_warn.php18
-rw-r--r--phpBB/includes/message_parser.php66
-rw-r--r--phpBB/includes/startup.php28
-rw-r--r--phpBB/includes/ucp/ucp_auth_link.php5
-rw-r--r--phpBB/includes/ucp/ucp_login_link.php8
-rw-r--r--phpBB/includes/ucp/ucp_notifications.php38
-rw-r--r--phpBB/includes/ucp/ucp_pm.php24
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php99
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewmessage.php19
-rw-r--r--phpBB/includes/ucp/ucp_prefs.php8
-rw-r--r--phpBB/includes/ucp/ucp_profile.php80
-rw-r--r--phpBB/includes/ucp/ucp_register.php49
-rw-r--r--phpBB/index.php2
-rw-r--r--phpBB/install/convertors/convert_phpbb20.php2
-rw-r--r--phpBB/install/database_update.php26
-rw-r--r--phpBB/install/install_convert.php4
-rw-r--r--phpBB/install/install_install.php44
-rw-r--r--phpBB/install/schemas/schema.json3356
-rw-r--r--phpBB/install/schemas/schema_data.sql4
-rw-r--r--phpBB/language/en/acp/board.php11
-rw-r--r--phpBB/language/en/acp/common.php1
-rw-r--r--phpBB/language/en/acp/permissions.php2
-rw-r--r--phpBB/language/en/acp/profile.php2
-rw-r--r--phpBB/language/en/acp/search.php4
-rw-r--r--phpBB/language/en/acp/styles.php1
-rw-r--r--phpBB/language/en/email/short/newtopic_notify.txt2
-rw-r--r--phpBB/language/en/email/short/topic_notify.txt2
-rw-r--r--phpBB/language/en/help_faq.php76
-rw-r--r--phpBB/language/en/install.php10
-rw-r--r--phpBB/language/en/mcp.php2
-rw-r--r--phpBB/language/en/memberlist.php4
-rw-r--r--phpBB/language/en/migrator.php4
-rw-r--r--phpBB/language/en/search.php1
-rw-r--r--phpBB/language/en/ucp.php3
-rw-r--r--phpBB/mcp.php22
-rw-r--r--phpBB/memberlist.php68
-rw-r--r--phpBB/phpbb/auth/auth.php6
-rw-r--r--phpBB/phpbb/auth/provider/apache.php4
-rw-r--r--phpBB/phpbb/auth/provider/db.php8
-rw-r--r--phpBB/phpbb/auth/provider/ldap.php2
-rw-r--r--phpBB/phpbb/auth/provider_collection.php8
-rw-r--r--phpBB/phpbb/avatar/driver/local.php4
-rw-r--r--phpBB/phpbb/avatar/driver/remote.php18
-rw-r--r--phpBB/phpbb/avatar/manager.php40
-rw-r--r--phpBB/phpbb/cache/driver/file.php14
-rw-r--r--phpBB/phpbb/cache/driver/memory.php16
-rw-r--r--phpBB/phpbb/captcha/plugins/recaptcha.php6
-rw-r--r--phpBB/phpbb/config/db.php4
-rw-r--r--phpBB/phpbb/config/db_text.php2
-rw-r--r--phpBB/phpbb/console/command/cache/purge.php4
-rw-r--r--phpBB/phpbb/console/command/db/console_migrator_output_handler.php69
-rw-r--r--phpBB/phpbb/console/command/db/migrate.php42
-rw-r--r--phpBB/phpbb/content_visibility.php104
-rw-r--r--phpBB/phpbb/controller/helper.php53
-rw-r--r--phpBB/phpbb/cron/manager.php1
-rw-r--r--phpBB/phpbb/cron/task/core/queue.php2
-rw-r--r--phpBB/phpbb/db/driver/mysqli.php3
-rw-r--r--phpBB/phpbb/db/html_migrator_output_handler.php48
-rw-r--r--phpBB/phpbb/db/log_wrapper_migrator_output_handler.php95
-rw-r--r--phpBB/phpbb/db/migration/container_aware_migration.php36
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php57
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_13.php37
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_13_pl1.php37
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_13_rc1.php37
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php9
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php65
-rw-r--r--phpBB/phpbb/db/migration/data/v310/bot_update.php150
-rw-r--r--phpBB/phpbb/db/migration/data/v310/captcha_plugins.php8
-rw-r--r--phpBB/phpbb/db/migration/data/v310/contact_admin_form.php5
-rw-r--r--phpBB/phpbb/db/migration/data/v310/gold.php32
-rw-r--r--phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php41
-rw-r--r--phpBB/phpbb/db/migration/data/v310/notifications_use_full_name.php78
-rw-r--r--phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php41
-rw-r--r--phpBB/phpbb/db/migration/data/v310/rc5.php33
-rw-r--r--phpBB/phpbb/db/migration/data/v310/rc6.php31
-rw-r--r--phpBB/phpbb/db/migration/data/v310/remove_acp_styles_cache.php51
-rw-r--r--phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php3
-rw-r--r--phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php20
-rw-r--r--phpBB/phpbb/db/migration/data/v310/style_update_p1.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/m_softdelete_global.php31
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/plupload_last_gc_dynamic.php31
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/profilefield_remove_underscore_from_alpha.php47
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/profilefield_yahoo_update_url.php38
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/style_update.php136
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/update_custom_bbcodes_with_idn.php70
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v311.php32
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v312.php31
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v312rc1.php32
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v313.php31
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v313rc1.php35
-rw-r--r--phpBB/phpbb/db/migration/data/v31x/v313rc2.php32
-rw-r--r--phpBB/phpbb/db/migration/profilefield_base_migration.php5
-rw-r--r--phpBB/phpbb/db/migration/tool/module.php1
-rw-r--r--phpBB/phpbb/db/migration/tool/permission.php3
-rw-r--r--phpBB/phpbb/db/migrator.php111
-rw-r--r--phpBB/phpbb/db/migrator_output_handler_interface.php31
-rw-r--r--phpBB/phpbb/db/null_migrator_output_handler.php (renamed from travis/sami.conf.php)15
-rw-r--r--phpBB/phpbb/db/tools.php18
-rw-r--r--phpBB/phpbb/di/extension/config.php28
-rw-r--r--phpBB/phpbb/error_collector.php17
-rw-r--r--phpBB/phpbb/event/dispatcher.php35
-rw-r--r--phpBB/phpbb/event/dispatcher_interface.php10
-rw-r--r--phpBB/phpbb/event/kernel_exception_subscriber.php59
-rw-r--r--phpBB/phpbb/event/kernel_terminate_subscriber.php2
-rw-r--r--phpBB/phpbb/event/php_exporter.php14
-rw-r--r--phpBB/phpbb/exception/exception_interface.php29
-rw-r--r--phpBB/phpbb/exception/http_exception.php70
-rw-r--r--phpBB/phpbb/exception/runtime_exception.php52
-rw-r--r--phpBB/phpbb/extension/metadata_manager.php34
-rw-r--r--phpBB/phpbb/feed/base.php11
-rw-r--r--phpBB/phpbb/file_downloader.php120
-rw-r--r--phpBB/phpbb/log/log.php44
-rw-r--r--phpBB/phpbb/message/admin_form.php1
-rw-r--r--phpBB/phpbb/message/form.php2
-rw-r--r--phpBB/phpbb/message/topic_form.php2
-rw-r--r--phpBB/phpbb/notification/manager.php73
-rw-r--r--phpBB/phpbb/notification/type/admin_activate_user.php2
-rw-r--r--phpBB/phpbb/notification/type/post.php1
-rw-r--r--phpBB/phpbb/notification/type/topic.php1
-rw-r--r--phpBB/phpbb/pagination.php46
-rw-r--r--phpBB/phpbb/passwords/driver/bcrypt.php2
-rw-r--r--phpBB/phpbb/passwords/driver/bcrypt_wcf2.php2
-rw-r--r--phpBB/phpbb/passwords/driver/helper.php20
-rw-r--r--phpBB/phpbb/passwords/driver/md5_mybb.php2
-rw-r--r--phpBB/phpbb/passwords/driver/md5_phpbb2.php9
-rw-r--r--phpBB/phpbb/passwords/driver/md5_vb.php2
-rw-r--r--phpBB/phpbb/passwords/driver/salted_md5.php2
-rw-r--r--phpBB/phpbb/passwords/driver/sha1.php2
-rw-r--r--phpBB/phpbb/passwords/driver/sha1_smf.php2
-rw-r--r--phpBB/phpbb/passwords/driver/sha1_wcf1.php2
-rw-r--r--phpBB/phpbb/passwords/driver/sha_xf1.php4
-rw-r--r--phpBB/phpbb/path_helper.php48
-rw-r--r--phpBB/phpbb/plupload/plupload.php2
-rw-r--r--phpBB/phpbb/profilefields/type/type_base.php16
-rw-r--r--phpBB/phpbb/profilefields/type/type_bool.php42
-rw-r--r--phpBB/phpbb/profilefields/type/type_string_common.php10
-rw-r--r--phpBB/phpbb/profilefields/type/type_url.php2
-rw-r--r--phpBB/phpbb/request/request.php25
-rw-r--r--phpBB/phpbb/request/request_interface.php10
-rw-r--r--phpBB/phpbb/search/fulltext_native.php23
-rw-r--r--phpBB/phpbb/search/fulltext_sphinx.php5
-rw-r--r--phpBB/phpbb/session.php61
-rw-r--r--phpBB/phpbb/symfony_request.php13
-rw-r--r--phpBB/phpbb/template/twig/twig.php37
-rw-r--r--phpBB/phpbb/user.php2
-rw-r--r--phpBB/phpbb/user_loader.php7
-rw-r--r--phpBB/phpbb/version_helper.php43
-rw-r--r--phpBB/posting.php205
-rw-r--r--phpBB/report.php18
-rw-r--r--phpBB/search.php134
-rw-r--r--phpBB/styles/prosilver/style.cfg4
-rw-r--r--phpBB/styles/prosilver/template/captcha_default.html4
-rw-r--r--phpBB/styles/prosilver/template/captcha_qa.html4
-rw-r--r--phpBB/styles/prosilver/template/captcha_recaptcha.html19
-rw-r--r--phpBB/styles/prosilver/template/confirm_delete_body.html4
-rw-r--r--phpBB/styles/prosilver/template/forum_fn.js260
-rw-r--r--phpBB/styles/prosilver/template/forumlist_body.html8
-rw-r--r--phpBB/styles/prosilver/template/index_body.html2
-rw-r--r--phpBB/styles/prosilver/template/mcp_front.html10
-rw-r--r--phpBB/styles/prosilver/template/mcp_logs.html12
-rw-r--r--phpBB/styles/prosilver/template/mcp_notes_user.html12
-rw-r--r--phpBB/styles/prosilver/template/memberlist_email.html12
-rw-r--r--phpBB/styles/prosilver/template/memberlist_search.html3
-rw-r--r--phpBB/styles/prosilver/template/memberlist_view.html1
-rw-r--r--phpBB/styles/prosilver/template/navbar_footer.html2
-rw-r--r--phpBB/styles/prosilver/template/overall_footer.html4
-rw-r--r--phpBB/styles/prosilver/template/overall_header.html11
-rw-r--r--phpBB/styles/prosilver/template/posting_buttons.html3
-rw-r--r--phpBB/styles/prosilver/template/posting_editor.html4
-rw-r--r--phpBB/styles/prosilver/template/search_results.html12
-rw-r--r--phpBB/styles/prosilver/template/simple_footer.html2
-rw-r--r--phpBB/styles/prosilver/template/simple_header.html6
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_message_header.html1
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_viewmessage.html3
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html2
-rw-r--r--phpBB/styles/prosilver/template/ucp_profile_autologin_keys.html14
-rw-r--r--phpBB/styles/prosilver/template/ucp_profile_profile_info.html4
-rw-r--r--phpBB/styles/prosilver/template/ucp_profile_reg_details.html2
-rw-r--r--phpBB/styles/prosilver/template/viewforum_body.html14
-rw-r--r--phpBB/styles/prosilver/template/viewtopic_body.html18
-rw-r--r--phpBB/styles/prosilver/template/viewtopic_print.html2
-rw-r--r--phpBB/styles/prosilver/theme/bidi.css71
-rw-r--r--phpBB/styles/prosilver/theme/buttons.css1
-rw-r--r--phpBB/styles/prosilver/theme/colours.css15
-rw-r--r--phpBB/styles/prosilver/theme/common.css18
-rw-r--r--phpBB/styles/prosilver/theme/content.css5
-rw-r--r--phpBB/styles/prosilver/theme/cp.css8
-rw-r--r--phpBB/styles/prosilver/theme/responsive.css25
-rw-r--r--phpBB/styles/subsilver2/style.cfg4
-rw-r--r--phpBB/styles/subsilver2/template/confirm_delete_body.html2
-rw-r--r--phpBB/styles/subsilver2/template/forumlist_body.html6
-rw-r--r--phpBB/styles/subsilver2/template/index.htm2
-rw-r--r--phpBB/styles/subsilver2/template/index_body.html2
-rw-r--r--phpBB/styles/subsilver2/template/mcp_front.html10
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_body.html12
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_email.html6
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_search.html3
-rw-r--r--phpBB/styles/subsilver2/template/overall_footer.html2
-rw-r--r--phpBB/styles/subsilver2/template/overall_header.html2
-rw-r--r--phpBB/styles/subsilver2/template/posting_buttons.html19
-rw-r--r--phpBB/styles/subsilver2/template/posting_poll_body.html2
-rw-r--r--phpBB/styles/subsilver2/template/search_results.html6
-rw-r--r--phpBB/styles/subsilver2/template/simple_header.html2
-rw-r--r--phpBB/styles/subsilver2/template/ucp_avatar_options_local.html6
-rw-r--r--phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html4
-rw-r--r--phpBB/styles/subsilver2/template/ucp_profile_autologin_keys.html6
-rw-r--r--phpBB/styles/subsilver2/template/ucp_profile_profile_info.html2
-rw-r--r--phpBB/styles/subsilver2/template/ucp_profile_reg_details.html2
-rw-r--r--phpBB/styles/subsilver2/template/viewforum_body.html18
-rw-r--r--phpBB/styles/subsilver2/template/viewtopic_body.html14
-rw-r--r--phpBB/styles/subsilver2/template/viewtopic_print.html4
-rw-r--r--phpBB/styles/subsilver2/theme/images/index.htm2
-rw-r--r--phpBB/styles/subsilver2/theme/stylesheet.css4
-rw-r--r--phpBB/ucp.php16
-rw-r--r--phpBB/viewforum.php52
-rw-r--r--phpBB/viewtopic.php72
-rw-r--r--phpBB/web.config12
-rw-r--r--phpunit.xml.dist11
-rw-r--r--tests/auth/provider_db_test.php9
-rw-r--r--tests/avatar/fixtures/users.xml28
-rw-r--r--tests/avatar/manager_test.php56
-rw-r--r--tests/bootstrap.php6
-rw-r--r--tests/cache/cache_memory.php64
-rw-r--r--tests/cache/cache_memory_test.php129
-rw-r--r--tests/cache/fixtures/cache_memory.xml77
-rw-r--r--tests/composer.json5
-rw-r--r--tests/composer.lock66
-rw-r--r--tests/console/cache/purge_test.php95
-rw-r--r--tests/console/cron/run_test.php1
-rw-r--r--tests/content_visibility/delete_post_test.php3
-rw-r--r--tests/content_visibility/get_forums_visibility_sql_test.php3
-rw-r--r--tests/content_visibility/get_global_visibility_sql_test.php3
-rw-r--r--tests/content_visibility/get_visibility_sql_test.php3
-rw-r--r--tests/content_visibility/set_post_visibility_test.php6
-rw-r--r--tests/content_visibility/set_topic_visibility_test.php3
-rw-r--r--tests/controller/common_helper_route.php229
-rw-r--r--tests/controller/config/routing.yml2
-rw-r--r--tests/controller/controller_test.php2
-rw-r--r--tests/controller/ext/vendor2/foo/config/routing.yml2
-rw-r--r--tests/controller/ext/vendor2/foo/config/routing_2.yml4
-rw-r--r--tests/controller/ext/vendor2/foo/subfolder/config/routing.yml2
-rw-r--r--tests/controller/helper_route_other_app.php37
-rw-r--r--tests/datetime/from_format_test.php28
-rw-r--r--tests/dbal/db_tools_test.php7
-rw-r--r--tests/dbal/migrator_test.php8
-rw-r--r--tests/error_collector_test.php30
-rw-r--r--tests/event/exception_listener_test.php100
-rw-r--r--tests/event/fixtures/trigger_wspace.test15
-rw-r--r--tests/event/php_exporter_test.php16
-rw-r--r--tests/extension/manager_test.php4
-rw-r--r--tests/extension/metadata_manager_test.php5
-rw-r--r--tests/functional/acp_attachments_test.php78
-rw-r--r--tests/functional/acp_groups_test.php4
-rw-r--r--tests/functional/acp_profile_field_test.php71
-rw-r--r--tests/functional/acp_registration_test.php55
-rw-r--r--tests/functional/auth_test.php19
-rw-r--r--tests/functional/avatar_acp_groups_test.php4
-rw-r--r--tests/functional/avatar_acp_users_test.php4
-rw-r--r--tests/functional/avatar_ucp_groups_test.php4
-rw-r--r--tests/functional/avatar_ucp_users_test.php4
-rw-r--r--tests/functional/common_avatar_test_case.php (renamed from tests/functional/common_avatar_test.php)4
-rw-r--r--tests/functional/common_groups_test_case.php (renamed from tests/functional/common_groups_test.php)2
-rw-r--r--tests/functional/download_test.php15
-rw-r--r--tests/functional/feed_test.php37
-rw-r--r--tests/functional/fileupload_form_test.php23
-rw-r--r--tests/functional/fixtures/ext/foo/bar/config/routing.yml18
-rw-r--r--tests/functional/fixtures/ext/foo/foo/config/resource.yml2
-rw-r--r--tests/functional/memberlist_test.php28
-rw-r--r--tests/functional/notification_test.php2
-rw-r--r--tests/functional/prune_shadow_topic_test.php6
-rw-r--r--tests/functional/registration_test.php15
-rw-r--r--tests/functional/ucp_groups_test.php4
-rw-r--r--tests/functional/viewforum_paging_test.php256
-rw-r--r--tests/functions/build_url_test.php5
-rw-r--r--tests/functions/get_remote_file_test.php4
-rw-r--r--tests/functions/make_clickable_email_test.php222
-rw-r--r--tests/functions/make_clickable_test.php180
-rw-r--r--tests/functions/validate_username_test.php1
-rw-r--r--tests/functions_acp/insert_config_array_test.php (renamed from tests/functions/insert_config_array_test.php)2
-rw-r--r--tests/functions_acp/validate_config_vars_test.php87
-rw-r--r--tests/mock/controller_helper.php3
-rw-r--r--tests/mock/event_dispatcher.php13
-rw-r--r--tests/mock/file_downloader.php27
-rw-r--r--tests/mock/metadata_manager.php2
-rw-r--r--tests/mock/request.php21
-rw-r--r--tests/notification/base.php3
-rw-r--r--tests/notification/group_request_test.php1
-rw-r--r--tests/notification/submit_post_base.php5
-rw-r--r--tests/pagination/config/routing.yml4
-rw-r--r--tests/pagination/pagination_test.php42
-rw-r--r--tests/pagination/templates/pagination_double_nested.html19
-rw-r--r--tests/pagination/templates/pagination_sub.html17
-rw-r--r--tests/passwords/drivers_test.php2
-rw-r--r--tests/passwords/manager_test.php20
-rw-r--r--tests/path_helper/path_helper_test.php40
-rw-r--r--tests/profilefields/type_string_test.php24
-rw-r--r--tests/profilefields/type_url_test.php40
-rw-r--r--tests/regex/url_test.php2
-rw-r--r--tests/search/fixtures/posts.xml10
-rw-r--r--tests/search/native_test.php50
-rw-r--r--tests/security/base.php50
-rw-r--r--tests/security/extract_current_page_test.php49
-rw-r--r--tests/security/redirect_test.php4
-rw-r--r--tests/session/extract_page_test.php47
-rw-r--r--tests/session/session_key_test.php19
-rw-r--r--tests/template/ext/include/css/styles/all/theme/child_only.css0
-rw-r--r--tests/template/ext/include/css/styles/all/theme/test.css0
-rw-r--r--tests/template/template_includecss_test.php86
-rw-r--r--tests/template/templates/includecss.html11
-rw-r--r--tests/test_framework/phpbb_database_test_case.php47
-rw-r--r--tests/test_framework/phpbb_database_test_connection_manager.php19
-rw-r--r--tests/test_framework/phpbb_functional_test_case.php35
-rw-r--r--tests/test_framework/phpbb_session_test_case.php6
-rw-r--r--tests/test_framework/phpbb_test_case.php2
-rw-r--r--tests/test_framework/phpbb_ui_test_case.php204
-rw-r--r--tests/tree/nestedset_forum_base.php2
-rw-r--r--tests/ui/quick_links_test.php27
-rw-r--r--tests/upload/filespec_test.php5
-rw-r--r--tests/version/version_fetch_test.php1
-rw-r--r--tests/version/version_helper_remote_test.php173
-rw-r--r--tests/version/version_test.php3
-rw-r--r--tests/wrapper/gmgetdate_test.php13
-rwxr-xr-xtravis/check-sami-parse-errors.sh2
-rwxr-xr-xtravis/install-phpbb-test-dependencies.sh16
-rw-r--r--travis/phpunit-mariadb-travis.xml4
-rw-r--r--travis/phpunit-mysql-travis.xml4
-rw-r--r--travis/phpunit-mysqli-travis.xml4
-rw-r--r--travis/phpunit-postgres-travis.xml4
-rw-r--r--travis/phpunit-sqlite3-travis.xml4
-rwxr-xr-xtravis/setup-phpbb.sh1
428 files changed, 10459 insertions, 6080 deletions
diff --git a/.gitignore b/.gitignore
index de503c10ad..2b2d8d0ac6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,9 +1,8 @@
*~
/phpunit.xml
-/phpBB/cache/twig/*
-/phpBB/cache/*.html
-/phpBB/cache/*.php
-/phpBB/cache/*.lock
+/phpBB/cache/*
+!/phpBB/cache/.htaccess
+!/phpBB/cache/index.html
/phpBB/composer.phar
/phpBB/config*.php
/phpBB/ext/*
@@ -11,6 +10,7 @@
/phpBB/images/avatars/gallery/*
/phpBB/images/avatars/upload/*
/phpBB/images/ranks/*
+/phpBB/install/schemas/schema.json
/phpBB/language/*
!/phpBB/language/en
/phpBB/store/*
@@ -21,3 +21,4 @@
/tests/phpbb_unit_tests.sqlite*
/tests/test_config*.php
/tests/tmp/*
+/tests/vendor
diff --git a/.travis.yml b/.travis.yml
index cbba07b16d..e68ba5f501 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,13 +16,18 @@ matrix:
env: DB=postgres
- php: 5.4
env: DB=sqlite3
+ - php: 5.4
+ env: DB=mysqli;SLOWTESTS=1
- php: 5.5
env: DB=mysqli
- php: 5.6
env: DB=mysqli
+ - php: 7.0
+ env: DB=mysqli
- php: hhvm
env: DB=mysqli
allow_failures:
+ - php: 7.0
- php: hhvm
fast_finish: true
@@ -34,12 +39,14 @@ install:
before_script:
- travis/setup-database.sh $DB $TRAVIS_PHP_VERSION
+ - phantomjs --webdriver=8910 > /dev/null &
script:
- travis/phing-sniff.sh $DB $TRAVIS_PHP_VERSION
- travis/check-sami-parse-errors.sh $DB $TRAVIS_PHP_VERSION
- travis/check-image-icc-profiles.sh $DB $TRAVIS_PHP_VERSION
- travis/check-executable-files.sh $DB $TRAVIS_PHP_VERSION ./
- - phpBB/vendor/bin/phpunit --configuration travis/phpunit-$DB-travis.xml
+ - sh -c "if [ '$SLOWTESTS' != '1' ]; then phpBB/vendor/bin/phpunit --configuration travis/phpunit-$DB-travis.xml; fi"
+ - sh -c "if [ '$SLOWTESTS' = '1' ]; then phpBB/vendor/bin/phpunit --configuration travis/phpunit-$DB-travis.xml --group slow; fi"
- sh -c "if [ '$TRAVIS_PHP_VERSION' = '5.3.3' -a '$DB' = 'mysqli' -a '$TRAVIS_PULL_REQUEST' != 'false' ]; then git-tools/commit-msg-hook-range.sh origin/$TRAVIS_BRANCH..FETCH_HEAD; fi"
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000000..6996ca22d3
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,6 @@
+## 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 [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)
+4. Send us a pull request
diff --git a/README.md b/README.md
index e6fb17f95f..1770a0b7c8 100644
--- a/README.md
+++ b/README.md
@@ -27,9 +27,9 @@ To be able to run an installation from the repo (and not from a pre-built packag
We have unit and functional tests in order to prevent regressions. You can view the bamboo continuous integration [here](http://bamboo.phpbb.com) or check our travis build below:
-* develop [![Build Status](https://secure.travis-ci.org/phpbb/phpbb.png?branch=develop)](http://travis-ci.org/phpbb/phpbb)
-* develop-ascraeus [![Build Status](https://secure.travis-ci.org/phpbb/phpbb.png?branch=develop-ascraeus)](http://travis-ci.org/phpbb/phpbb)
-* develop-olympus [![Build Status](https://secure.travis-ci.org/phpbb/phpbb.png?branch=develop-olympus)](http://travis-ci.org/phpbb/phpbb)
+* [![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.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 8ac7c1758c..b0a9190898 100644
--- a/build/build.xml
+++ b/build/build.xml
@@ -2,9 +2,9 @@
<project name="phpBB" description="The phpBB forum software" default="all" basedir="../">
<!-- a few settings for the build -->
- <property name="newversion" value="3.1.0-RC5-dev" />
- <property name="prevversion" value="3.1.0-RC4" />
- <property name="olderversions" value="3.0.12, 3.1.0-a1, 3.1.0-a2, 3.1.0-a3, 3.1.0-b1, 3.1.0-b2, 3.1.0-b3, 3.1.0-b4, 3.1.0-RC1, 3.1.0-RC2, 3.1.0-RC3" />
+ <property name="newversion" value="3.1.4-dev" />
+ <property name="prevversion" value="3.1.3" />
+ <property name="olderversions" value="3.0.12, 3.0.13, 3.0.13-PL1, 3.1.0, 3.1.1, 3.1.2" />
<!-- no configuration should be needed beyond this point -->
<property name="oldversions" value="${olderversions}, ${prevversion}" />
@@ -117,9 +117,16 @@
</if>
</target>
+ <!-- Builds docs for current branch into build/api/output/master -->
<target name="docs">
<exec dir="."
- command="phpBB/vendor/bin/sami.php update build/sami.conf.php"
+ command="phpBB/vendor/bin/sami.php update build/sami-checkout.conf.php"
+ passthru="true" />
+ </target>
+ <!-- Builds docs for multiple branches/tags into build/api/output/$branch -->
+ <target name="docs-all">
+ <exec dir="."
+ command="phpBB/vendor/bin/sami.php update build/sami-all.conf.php"
passthru="true" />
</target>
@@ -273,6 +280,9 @@
</else>
</if>
+ <!-- Create schema.json -->
+ <exec dir="${dir}" command="php develop/create_schema_files.php" />
+
<delete file="${dir}/config.php" />
<delete dir="${dir}/develop" />
<delete dir="${dir}/install/data" />
diff --git a/build/build_changelog.php b/build/build_changelog.php
index be0fb625ea..2d38480f9f 100755
--- a/build/build_changelog.php
+++ b/build/build_changelog.php
@@ -20,7 +20,7 @@ if ($_SERVER['argc'] != 2)
$fixVersion = $_SERVER['argv'][1];
-$query = 'project = PHPBB3
+$query = 'project IN (PHPBB3, SECURITY)
AND resolution = Fixed
AND fixVersion = "' . $fixVersion . '"
AND status IN ("Unverified Fix", Closed)';
diff --git a/build/code_sniffer/phpbb/Sniffs/Commenting/FileCommentSniff.php b/build/code_sniffer/phpbb/Sniffs/Commenting/FileCommentSniff.php
index fa7d3b40c1..8337cf02ee 100644
--- a/build/code_sniffer/phpbb/Sniffs/Commenting/FileCommentSniff.php
+++ b/build/code_sniffer/phpbb/Sniffs/Commenting/FileCommentSniff.php
@@ -84,12 +84,12 @@ class phpbb_Sniffs_Commenting_FileCommentSniff implements PHP_CodeSniffer_Sniff
$line = $tokens[$i]['content'];
// Check that each line starts with a '*'
- if (substr($line, 0, 1) !== '*')
+ if (substr($line, 0, 1) !== '*' && substr($line, 0, 2) !== ' *')
{
- $message = 'The file doc comment should not be idented.';
+ $message = 'The file doc comment should not be indented.';
$phpcsFile->addWarning($message, $i);
}
- else if (preg_match('/^\*\s+@([\w]+)\s+(.*)$/', $line, $match) !== 0)
+ else if (preg_match('/^[ ]?\*\s+@([\w]+)\s+(.*)$/', $line, $match) !== 0)
{
if (!isset($tags[$match[1]]))
{
diff --git a/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php b/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php
index f81ec46579..18cb8ba82e 100644
--- a/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php
+++ b/build/code_sniffer/phpbb/Sniffs/Namespaces/UnusedUseSniff.php
@@ -24,6 +24,23 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff
return array(T_USE);
}
+ protected function check($phpcsFile, $found_name, $full_name, $short_name, $line)
+ {
+
+ if ($found_name === $full_name)
+ {
+ $error = 'Either use statement or full name must be used.';
+ $phpcsFile->addError($error, $line, 'FullName');
+ }
+
+ if ($found_name === $short_name)
+ {
+ return true;
+ }
+
+ return false;
+ }
+
/**
* {@inheritdoc}
*/
@@ -74,16 +91,7 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff
$simple_class_name = trim($phpcsFile->getTokensAsString($simple_class_name_start, ($simple_class_name_end - $simple_class_name_start)));
- if ($simple_class_name === $class_name_full)
- {
- $error = 'Either use statement or full name must be used.';
- $phpcsFile->addError($error, $simple_statement, 'FullName');
- }
-
- if ($simple_class_name === $class_name_short)
- {
- $ok = true;
- }
+ $ok = $this->check($phpcsFile, $simple_class_name, $class_name_full, $class_name_short, $simple_statement) ? true : $ok;
}
}
@@ -98,16 +106,7 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff
$paamayim_nekudotayim_class_name = trim($phpcsFile->getTokensAsString($paamayim_nekudotayim_class_name_start + 1, ($paamayim_nekudotayim_class_name_end - $paamayim_nekudotayim_class_name_start)));
- if ($paamayim_nekudotayim_class_name === $class_name_full)
- {
- $error = 'Either use statement or full name must be used.';
- $phpcsFile->addError($error, $paamayim_nekudotayim, 'FullName');
- }
-
- if ($paamayim_nekudotayim_class_name === $class_name_short)
- {
- $ok = true;
- }
+ $ok = $this->check($phpcsFile, $paamayim_nekudotayim_class_name, $class_name_full, $class_name_short, $paamayim_nekudotayim) ? true : $ok;
}
// Checks in implements
@@ -126,16 +125,7 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff
$implements_class_name = trim($phpcsFile->getTokensAsString($implements_class_name_start, ($implements_class_name_end - $implements_class_name_start)));
- if ($implements_class_name === $class_name_full)
- {
- $error = 'Either use statement or full name must be used.';
- $phpcsFile->addError($error, $implements, 'FullName');
- }
-
- if ($implements_class_name === $class_name_short)
- {
- $ok = true;
- }
+ $ok = $this->check($phpcsFile, $implements_class_name, $class_name_full, $class_name_short, $implements) ? true : $ok;
}
}
@@ -145,34 +135,64 @@ class phpbb_Sniffs_Namespaces_UnusedUseSniff implements PHP_CodeSniffer_Sniff
{
$old_function_declaration = $function_declaration;
- $end_function = $phpcsFile->findNext(array(T_CLOSE_PARENTHESIS), ($function_declaration + 1));
- $old_argument = $function_declaration;
- while (($argument = $phpcsFile->findNext(T_VARIABLE, ($old_argument + 1), $end_function)) !== false)
+ // Check docblocks
+ $find = array(
+ T_COMMENT,
+ T_DOC_COMMENT,
+ T_CLASS,
+ T_FUNCTION,
+ T_OPEN_TAG,
+ );
+
+ $comment_end = $phpcsFile->findPrevious($find, ($function_declaration - 1));
+ if ($comment_end !== false)
{
- $old_argument = $argument;
-
- $start_argument = $phpcsFile->findPrevious(array(T_OPEN_PARENTHESIS, T_COMMA), $argument);
- $argument_class_name_start = $phpcsFile->findNext(array(T_NS_SEPARATOR, T_STRING), ($start_argument + 1), $argument);
-
- // Skip the parameter if no type is defined.
- if ($argument_class_name_start !== false)
+ if (!$tokens[$comment_end]['code'] !== T_DOC_COMMENT)
{
- $argument_class_name_end = $phpcsFile->findNext($find, ($argument_class_name_start + 1), null, true);
-
- $argument_class_name = $phpcsFile->getTokensAsString($argument_class_name_start, ($argument_class_name_end - $argument_class_name_start - 1));
+ $comment_start = ($phpcsFile->findPrevious(T_DOC_COMMENT, ($comment_end - 1), null, true) + 1);
+ $comment = $phpcsFile->getTokensAsString($comment_start, ($comment_end - $comment_start + 1));
- if ($argument_class_name === $class_name_full)
+ try
{
- $error = 'Either use statement or full name must be used.';
- $phpcsFile->addError($error, $function_declaration, 'FullName');
+ $comment_parser = new PHP_CodeSniffer_CommentParser_FunctionCommentParser($comment, $phpcsFile);
+ $comment_parser->parse();
+
+ // Check @param
+ foreach ($comment_parser->getParams() as $param) {
+ $type = $param->getType();
+ $types = explode('|', str_replace('[]', '', $type));
+ foreach ($types as $type)
+ {
+ $ok = $this->check($phpcsFile, $type, $class_name_full, $class_name_short, $param->getLine() + $comment_start) ? true : $ok;
+ }
+ }
+
+ // Check @return
+ $return = $comment_parser->getReturn();
+ if ($return !== null)
+ {
+ $type = $return->getValue();
+ $types = explode('|', str_replace('[]', '', $type));
+ foreach ($types as $type)
+ {
+ $ok = $this->check($phpcsFile, $type, $class_name_full, $class_name_short, $return->getLine() + $comment_start) ? true : $ok;
+ }
+ }
}
-
- if ($argument_class_name === $class_name_short)
+ catch (PHP_CodeSniffer_CommentParser_ParserException $e)
{
- $ok = true;
+ $line = ($e->getLineWithinComment() + $comment_start);
+ $phpcsFile->addError($e->getMessage(), $line, 'FailedParse');
}
}
}
+
+ // Check type hint
+ $params = $phpcsFile->getMethodParameters($function_declaration);
+ foreach ($params as $param)
+ {
+ $ok = $this->check($phpcsFile, $param['type_hint'], $class_name_full, $class_name_short, $function_declaration) ? true : $ok;
+ }
}
if (!$ok)
diff --git a/build/package.php b/build/package.php
index c0db0c4011..d168957ca5 100755
--- a/build/package.php
+++ b/build/package.php
@@ -394,6 +394,7 @@ if (sizeof($package->old_packages))
$package->run_command('mkdir ' . $package->get('files_directory') . '/release');
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/docs ' . $package->get('files_directory') . '/release');
$package->run_command('cp -Rp ' . $package->get('dest_dir') . '/install ' . $package->get('files_directory') . '/release');
+ $package->run_command('cp -Rp ' . $package->get('dest_dir') . '/vendor ' . $package->get('files_directory') . '/release');
$package->run_command('rm -v ' . $package->get('files_directory') . '/release/install/install_install.php');
$package->run_command('rm -v ' . $package->get('files_directory') . '/release/install/install_update.php');
diff --git a/build/sami-all.conf.php b/build/sami-all.conf.php
new file mode 100644
index 0000000000..68350fee8f
--- /dev/null
+++ b/build/sami-all.conf.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.
+*
+*/
+
+require __DIR__ . '/sami-checkout.conf.php';
+
+$config['versions'] = Sami\Version\GitVersionCollection::create(__DIR__ . '/../')
+ /*
+ This would be nice, but currently causes various problems that need
+ debugging.
+ ->addFromTags('release-3.0.*')
+ ->add('develop-olympus', '3.0-next (olympus)')
+ ->addFromTags('release-3.1.*')
+ ->add('develop-ascraeus', '3.1-next (ascraeus)')
+ ->add('develop')
+ */
+ ->add('develop-olympus')
+ ->add('develop-ascraeus')
+;
+
+return new Sami\Sami($iterator, $config);
diff --git a/build/sami.conf.php b/build/sami-checkout.conf.php
index 78d532631c..abbf1d257e 100644
--- a/build/sami.conf.php
+++ b/build/sami-checkout.conf.php
@@ -31,23 +31,8 @@ $iterator = Symfony\Component\Finder\Finder::create()
->notPath('data')
;
-$versions = Sami\Version\GitVersionCollection::create(__DIR__ . '/../')
- /*
- This would be nice, but currently causes various problems that need
- debugging.
- ->addFromTags('release-3.0.*')
- ->add('develop-olympus', '3.0-next (olympus)')
- ->addFromTags('release-3.1.*')
- ->add('develop-ascraeus', '3.1-next (ascraeus)')
- ->add('develop')
- */
- ->add('develop-olympus')
- ->add('develop-ascraeus')
-;
-
$config = array(
'theme' => 'enhanced',
- 'versions' => $versions,
'title' => 'phpBB API Documentation',
'build_dir' => __DIR__.'/api/output/%version%',
'cache_dir' => __DIR__.'/api/cache/%version%',
diff --git a/composer.phar b/composer.phar
index 1e9ca731cd..3481b599b7 100755
--- a/composer.phar
+++ b/composer.phar
Binary files differ
diff --git a/phpBB/adm/style/acp_email.html b/phpBB/adm/style/acp_email.html
index 950ecb40b0..63acd7fcc1 100644
--- a/phpBB/adm/style/acp_email.html
+++ b/phpBB/adm/style/acp_email.html
@@ -47,6 +47,8 @@
<dd><input id="send" type="checkbox" class="radio" name="send_immediately" checked="checked" /></dd>
</dl>
+<!-- EVENT acp_email_options_after -->
+
<p class="submit-buttons">
<input class="button1" type="submit" id="submit" name="submit" value="{L_SEND_EMAIL}" />&nbsp;
<input class="button2" type="reset" id="reset" name="reset" value="{L_RESET}" />
diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html
index af79791ff8..756092a1f0 100644
--- a/phpBB/adm/style/acp_forums.html
+++ b/phpBB/adm/style/acp_forums.html
@@ -111,6 +111,7 @@
<fieldset>
<legend>{L_FORUM_SETTINGS}</legend>
+ <!-- EVENT acp_forums_main_settings_prepend -->
<dl>
<dt><label for="forum_type">{L_FORUM_TYPE}{L_COLON}</label></dt>
<dd><select id="forum_type" name="forum_type" onchange="display_options(this.options[this.selectedIndex].value);">{S_FORUM_TYPE_OPTIONS}</select></dd>
@@ -182,6 +183,7 @@
<dt><label for="forum_style">{L_FORUM_STYLE}{L_COLON}</label></dt>
<dd><select id="forum_style" name="forum_style"><option value="0">{L_DEFAULT_STYLE}</option>{S_STYLES_OPTIONS}</select></dd>
</dl>
+ <!-- EVENT acp_forums_main_settings_append -->
</fieldset>
<div id="forum_cat_options">
@@ -198,6 +200,7 @@
<div id="forum_post_options">
<fieldset>
<legend>{L_GENERAL_FORUM_SETTINGS}</legend>
+ <!-- EVENT acp_forums_normal_settings_prepend -->
<dl>
<dt><label for="forum_status">{L_FORUM_STATUS}{L_COLON}</label></dt>
<dd><select id="forum_status" name="forum_status">{S_STATUS_OPTIONS}</select></dd>
@@ -246,6 +249,7 @@
<fieldset>
<legend>{L_FORUM_PRUNE_SETTINGS}</legend>
+ <!-- EVENT acp_forums_prune_settings_prepend -->
<dl>
<dt><label for="enable_prune">{L_FORUM_AUTO_PRUNE}{L_COLON}</label><br /><span>{L_FORUM_AUTO_PRUNE_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="enable_prune" value="1"<!-- IF S_PRUNE_ENABLE --> id="enable_prune" checked="checked"<!-- ENDIF --> /> {L_YES}</label>
@@ -291,6 +295,7 @@
<dt><label for="prune_shadow_days">{L_AUTO_PRUNE_SHADOW_DAYS}{L_COLON}</label><br /><span>{L_AUTO_PRUNE_SHADOW_DAYS_EXPLAIN}</span></dt>
<dd><input type="number" id="prune_shadow_days" name="prune_shadow_days" value="{PRUNE_SHADOW_DAYS}" maxlength="4" size="4" min="0" max="9999" /> {L_DAYS}</dd>
</dl>
+ <!-- EVENT acp_forums_prune_settings_append -->
</fieldset>
</div>
@@ -317,6 +322,7 @@
<div id="forum_rules_options">
<fieldset>
<legend>{L_FORUM_RULES}</legend>
+ <!-- EVENT acp_forums_rules_settings_prepend -->
<dl>
<dt><label for="forum_rules_link">{L_FORUM_RULES_LINK}{L_COLON}</label><br /><span>{L_FORUM_RULES_LINK_EXPLAIN}</span></dt>
<dd><input class="text medium" type="text" id="forum_rules_link" name="forum_rules_link" value="{FORUM_RULES_LINK}" maxlength="255" /></dd>
@@ -334,6 +340,7 @@
<label><input type="checkbox" class="radio" name="rules_parse_smilies"<!-- IF S_SMILIES_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_SMILIES}</label>
<label><input type="checkbox" class="radio" name="rules_parse_urls"<!-- IF S_URLS_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_URLS}</label></dd>
</dl>
+ <!-- EVENT acp_forums_rules_settings_append -->
</fieldset>
</div>
diff --git a/phpBB/adm/style/acp_icons.html b/phpBB/adm/style/acp_icons.html
index 9117052d87..f18dad0ef6 100644
--- a/phpBB/adm/style/acp_icons.html
+++ b/phpBB/adm/style/acp_icons.html
@@ -7,7 +7,7 @@
<script type="text/javascript" defer="defer">
// <![CDATA[
<!-- IF S_ADD_CODE -->
-
+
var smiley = Array();
<!-- BEGIN smile -->
smiley['{smile.SMILEY_URL}'] = Array();
@@ -37,10 +37,10 @@
}
}
}
-
+
<!-- ENDIF -->
-
+
function toggle_select(icon, display, select)
{
var disp = document.getElementById('order_disp_' + select);
@@ -101,7 +101,7 @@
<tbody>
<!-- BEGIN items -->
<tr>
-
+
<td style="text-align: center;"><img src="{items.IMG_SRC}" alt="" title="" /><input type="hidden" name="image[{items.IMG}]" value="1" /></td>
<td style="vertical-align: top;">[{items.IMG}]</td>
<!-- IF S_SMILIES -->
@@ -121,7 +121,7 @@
<optgroup id="order_disp_{items.S_ROW_COUNT}" label="{L_DISPLAY_POSTING}" <!-- IF not items.POSTING_CHECKED -->disabled="disabled" class="disabled-options" <!-- ENDIF -->>{S_ORDER_LIST_DISPLAY}</optgroup>
<optgroup id="order_no_disp_{items.S_ROW_COUNT}" label="{L_DISPLAY_POSTING_NO}" <!-- IF items.POSTING_CHECKED -->disabled="disabled" class="disabled-options" <!-- ENDIF -->>{S_ORDER_LIST_UNDISPLAY}</optgroup>
</select></td>
- <!-- ENDIF -->
+ <!-- ENDIF -->
<!-- IF S_ADD -->
<td><input type="checkbox" class="radio" name="add_img[{items.IMG}]" value="1" /></td>
<!-- ENDIF -->
@@ -147,6 +147,8 @@
</tr>
<!-- ENDIF -->
<!-- ELSE -->
+ </thead>
+ <tbody>
<tr class="row3">
<td colspan="{COLSPAN}">{L_NO_ICONS}</td>
</tr>
@@ -174,7 +176,7 @@
<fieldset>
<legend>{L_IMPORT}</legend>
-
+
<!-- IF not S_PAK_OPTIONS -->
<p>{L_NO_PAK_OPTIONS}</p>
@@ -259,7 +261,7 @@
</table>
<div class="pagination">
<!-- IF .pagination -->
- <!-- INCLUDE pagination.html -->
+ <!-- INCLUDE pagination.html -->
<!-- ENDIF -->
</div>
<p class="quick">
diff --git a/phpBB/adm/style/acp_users_profile.html b/phpBB/adm/style/acp_users_profile.html
index d32348ff1c..573534fc95 100644
--- a/phpBB/adm/style/acp_users_profile.html
+++ b/phpBB/adm/style/acp_users_profile.html
@@ -2,6 +2,7 @@
<fieldset>
<legend>{L_USER_PROFILE}</legend>
+ <!-- EVENT acp_users_profile_before -->
<dl>
<dt><label for="jabber">{L_UCP_JABBER}{L_COLON}</label></dt>
<dd><input type="email" id="jabber" name="jabber" value="{JABBER}" /></dd>
@@ -10,6 +11,7 @@
<dt><label for="birthday">{L_BIRTHDAY}{L_COLON}</label><br /><span>{L_BIRTHDAY_EXPLAIN}</span></dt>
<dd>{L_DAY}{L_COLON} <select id="birthday" name="bday_day">{S_BIRTHDAY_DAY_OPTIONS}</select> {L_MONTH}{L_COLON} <select name="bday_month">{S_BIRTHDAY_MONTH_OPTIONS}</select> {L_YEAR}{L_COLON} <select name="bday_year">{S_BIRTHDAY_YEAR_OPTIONS}</select></dd>
</dl>
+ <!-- EVENT acp_users_profile_after -->
</fieldset>
<!-- IF .profile_fields -->
@@ -26,7 +28,7 @@
<!-- END profile_fields -->
</fieldset>
<!-- ENDIF -->
-
+ <!-- EVENT acp_users_profile_custom_after -->
<fieldset class="quick">
<input class="button1" type="submit" name="update" value="{L_SUBMIT}" />
{S_FORM_TOKEN}
diff --git a/phpBB/adm/style/install_header.html b/phpBB/adm/style/install_header.html
index c818a4fc6d..6f7f129d39 100644
--- a/phpBB/adm/style/install_header.html
+++ b/phpBB/adm/style/install_header.html
@@ -2,7 +2,7 @@
<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
<meta charset="utf-8">
-<meta name="viewport" content="width=device-width" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- IF META -->{META}<!-- ENDIF -->
<title>{PAGE_TITLE}</title>
diff --git a/phpBB/adm/style/install_update_diff.html b/phpBB/adm/style/install_update_diff.html
index 150ef37e0e..5f80084705 100644
--- a/phpBB/adm/style/install_update_diff.html
+++ b/phpBB/adm/style/install_update_diff.html
@@ -2,7 +2,7 @@
<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
<meta charset="utf-8">
-<meta name="viewport" content="width=device-width" />
+<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 f1f7eee282..ada88edff2 100644
--- a/phpBB/adm/style/overall_header.html
+++ b/phpBB/adm/style/overall_header.html
@@ -2,7 +2,7 @@
<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
<meta charset="utf-8">
-<meta name="viewport" content="width=device-width" />
+<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 d0b9bf62ed..f62a7a900e 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 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 6ddbba7515..806db7d35f 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -386,7 +386,8 @@ phpbb.ajaxify = function(options) {
type: method,
data: data,
success: returnHandler,
- error: errorHandler
+ error: errorHandler,
+ cache: false
});
request.always(function() {
$loadingIndicator.fadeOut(phpbb.alertTime);
@@ -407,7 +408,9 @@ phpbb.ajaxify = function(options) {
$elements.find('input:submit').click(function () {
var $this = $(this);
- $this.siblings('[data-clicked]').removeAttr('data-clicked');
+ // Remove data-clicked attribute from any submit button of form
+ $this.parents('form:first').find('input:submit[data-clicked]').removeAttr('data-clicked');
+
$this.attr('data-clicked', 'true');
});
}
diff --git a/phpBB/assets/javascript/plupload.js b/phpBB/assets/javascript/plupload.js
index 5445e83e15..a58c71e64d 100644
--- a/phpBB/assets/javascript/plupload.js
+++ b/phpBB/assets/javascript/plupload.js
@@ -34,6 +34,14 @@ phpbb.plupload.initialize = function() {
if (uploader.features.dragdrop) {
$('#drag-n-drop-message').show();
}
+
+ // Ensure "Add files" button position is correctly calculated.
+ if ($('#attach-panel-multi').is(':visible')) {
+ uploader.refresh();
+ }
+ $('[data-subpanel="attach-panel"]').one('click', function() {
+ uploader.refresh();
+ });
});
};
diff --git a/phpBB/common.php b/phpBB/common.php
index f6586c40fe..0782bd7321 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -104,7 +104,7 @@ require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx);
// 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('\phpbb\template\template', 'display')));
+$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
$phpbb_hook_finder = $phpbb_container->get('hook_finder');
foreach ($phpbb_hook_finder->find() as $hook)
diff --git a/phpBB/composer.lock b/phpBB/composer.lock
index b686bfef5c..07ae59f863 100644
--- a/phpBB/composer.lock
+++ b/phpBB/composer.lock
@@ -108,17 +108,17 @@
},
{
"name": "symfony/config",
- "version": "v2.3.19",
+ "version": "v2.3.21",
"target-dir": "Symfony/Component/Config",
"source": {
"type": "git",
"url": "https://github.com/symfony/Config.git",
- "reference": "b34d2b32a92938476f0689486e7a11ea1aeb079e"
+ "reference": "f9fac999dbc2c6aabd749c034d938b5f9aa5fb7d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Config/zipball/b34d2b32a92938476f0689486e7a11ea1aeb079e",
- "reference": "b34d2b32a92938476f0689486e7a11ea1aeb079e",
+ "url": "https://api.github.com/repos/symfony/Config/zipball/f9fac999dbc2c6aabd749c034d938b5f9aa5fb7d",
+ "reference": "f9fac999dbc2c6aabd749c034d938b5f9aa5fb7d",
"shasum": ""
},
"require": {
@@ -152,21 +152,21 @@
],
"description": "Symfony Config Component",
"homepage": "http://symfony.com",
- "time": "2014-08-02 07:53:48"
+ "time": "2014-09-23 05:15:05"
},
{
"name": "symfony/console",
- "version": "v2.3.19",
+ "version": "v2.3.21",
"target-dir": "Symfony/Component/Console",
"source": {
"type": "git",
"url": "https://github.com/symfony/Console.git",
- "reference": "a2723f99716c2fa6411e2eb5842edbe680e4b462"
+ "reference": "aa12ac573c583a74c2cb26ad9be478e119f04ad1"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Console/zipball/a2723f99716c2fa6411e2eb5842edbe680e4b462",
- "reference": "a2723f99716c2fa6411e2eb5842edbe680e4b462",
+ "url": "https://api.github.com/repos/symfony/Console/zipball/aa12ac573c583a74c2cb26ad9be478e119f04ad1",
+ "reference": "aa12ac573c583a74c2cb26ad9be478e119f04ad1",
"shasum": ""
},
"require": {
@@ -205,21 +205,21 @@
],
"description": "Symfony Console Component",
"homepage": "http://symfony.com",
- "time": "2014-08-07 15:55:24"
+ "time": "2014-10-05 13:45:10"
},
{
"name": "symfony/debug",
- "version": "v2.3.19",
+ "version": "v2.3.21",
"target-dir": "Symfony/Component/Debug",
"source": {
"type": "git",
"url": "https://github.com/symfony/Debug.git",
- "reference": "91e3a1480c67601d2406cd938735abe0243e1c95"
+ "reference": "883f847ad179e92549a8cea372b08e5ef47ffe40"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Debug/zipball/91e3a1480c67601d2406cd938735abe0243e1c95",
- "reference": "91e3a1480c67601d2406cd938735abe0243e1c95",
+ "url": "https://api.github.com/repos/symfony/Debug/zipball/883f847ad179e92549a8cea372b08e5ef47ffe40",
+ "reference": "883f847ad179e92549a8cea372b08e5ef47ffe40",
"shasum": ""
},
"require": {
@@ -261,21 +261,21 @@
],
"description": "Symfony Debug Component",
"homepage": "http://symfony.com",
- "time": "2014-07-07 10:13:42"
+ "time": "2014-10-09 16:42:17"
},
{
"name": "symfony/dependency-injection",
- "version": "v2.3.19",
+ "version": "v2.3.21",
"target-dir": "Symfony/Component/DependencyInjection",
"source": {
"type": "git",
"url": "https://github.com/symfony/DependencyInjection.git",
- "reference": "5ee5795515be251c56057d79154e561ee1efecd2"
+ "reference": "e2324e1c8c39faa5f27e6170b278d7f631574141"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/5ee5795515be251c56057d79154e561ee1efecd2",
- "reference": "5ee5795515be251c56057d79154e561ee1efecd2",
+ "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/e2324e1c8c39faa5f27e6170b278d7f631574141",
+ "reference": "e2324e1c8c39faa5f27e6170b278d7f631574141",
"shasum": ""
},
"require": {
@@ -317,21 +317,21 @@
],
"description": "Symfony DependencyInjection Component",
"homepage": "http://symfony.com",
- "time": "2014-08-27 08:32:18"
+ "time": "2014-10-01 05:38:33"
},
{
"name": "symfony/event-dispatcher",
- "version": "v2.3.19",
+ "version": "v2.3.21",
"target-dir": "Symfony/Component/EventDispatcher",
"source": {
"type": "git",
"url": "https://github.com/symfony/EventDispatcher.git",
- "reference": "2c64e46d7e22bcafcab4413ff62bc389abf87ea5"
+ "reference": "3e0b837811fadd73c833c7c06a92201d953df59d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/2c64e46d7e22bcafcab4413ff62bc389abf87ea5",
- "reference": "2c64e46d7e22bcafcab4413ff62bc389abf87ea5",
+ "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/3e0b837811fadd73c833c7c06a92201d953df59d",
+ "reference": "3e0b837811fadd73c833c7c06a92201d953df59d",
"shasum": ""
},
"require": {
@@ -371,21 +371,21 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "http://symfony.com",
- "time": "2014-07-25 15:00:14"
+ "time": "2014-10-01 05:39:06"
},
{
"name": "symfony/filesystem",
- "version": "v2.3.19",
+ "version": "v2.3.21",
"target-dir": "Symfony/Component/Filesystem",
"source": {
"type": "git",
"url": "https://github.com/symfony/Filesystem.git",
- "reference": "007359d2822d5eba4f04f6507bc9b46877c622b4"
+ "reference": "1c3a5fab445d1d4a5d57f8fbf1379696c9785942"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Filesystem/zipball/007359d2822d5eba4f04f6507bc9b46877c622b4",
- "reference": "007359d2822d5eba4f04f6507bc9b46877c622b4",
+ "url": "https://api.github.com/repos/symfony/Filesystem/zipball/1c3a5fab445d1d4a5d57f8fbf1379696c9785942",
+ "reference": "1c3a5fab445d1d4a5d57f8fbf1379696c9785942",
"shasum": ""
},
"require": {
@@ -418,21 +418,21 @@
],
"description": "Symfony Filesystem Component",
"homepage": "http://symfony.com",
- "time": "2014-08-31 03:30:23"
+ "time": "2014-09-22 08:32:35"
},
{
"name": "symfony/http-foundation",
- "version": "v2.3.19",
+ "version": "v2.3.21",
"target-dir": "Symfony/Component/HttpFoundation",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpFoundation.git",
- "reference": "d0125fed988da9e189864c2e6de967b3ee7f1d98"
+ "reference": "30c90f08f948dd43e7310beae7a85c02ad2b655d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/d0125fed988da9e189864c2e6de967b3ee7f1d98",
- "reference": "d0125fed988da9e189864c2e6de967b3ee7f1d98",
+ "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/30c90f08f948dd43e7310beae7a85c02ad2b655d",
+ "reference": "30c90f08f948dd43e7310beae7a85c02ad2b655d",
"shasum": ""
},
"require": {
@@ -468,21 +468,21 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "http://symfony.com",
- "time": "2014-09-03 07:39:11"
+ "time": "2014-10-23 13:11:04"
},
{
"name": "symfony/http-kernel",
- "version": "v2.3.19",
+ "version": "v2.3.21",
"target-dir": "Symfony/Component/HttpKernel",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpKernel.git",
- "reference": "a24817f69012b23ce7c554af6b4c7b53235c7c55"
+ "reference": "0154ff659004d4148e8da0f2bdb672efe55e6ee5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/a24817f69012b23ce7c554af6b4c7b53235c7c55",
- "reference": "a24817f69012b23ce7c554af6b4c7b53235c7c55",
+ "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/0154ff659004d4148e8da0f2bdb672efe55e6ee5",
+ "reference": "0154ff659004d4148e8da0f2bdb672efe55e6ee5",
"shasum": ""
},
"require": {
@@ -539,21 +539,21 @@
],
"description": "Symfony HttpKernel Component",
"homepage": "http://symfony.com",
- "time": "2014-09-03 09:45:27"
+ "time": "2014-10-24 05:54:08"
},
{
"name": "symfony/routing",
- "version": "v2.3.19",
+ "version": "v2.3.21",
"target-dir": "Symfony/Component/Routing",
"source": {
"type": "git",
"url": "https://github.com/symfony/Routing.git",
- "reference": "aa2beef5d5f1d84250b5ca73a4056c0504e5969e"
+ "reference": "f7f8ebf9c99e5ebfdb908c3558a818c2883eab1f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Routing/zipball/aa2beef5d5f1d84250b5ca73a4056c0504e5969e",
- "reference": "aa2beef5d5f1d84250b5ca73a4056c0504e5969e",
+ "url": "https://api.github.com/repos/symfony/Routing/zipball/f7f8ebf9c99e5ebfdb908c3558a818c2883eab1f",
+ "reference": "f7f8ebf9c99e5ebfdb908c3558a818c2883eab1f",
"shasum": ""
},
"require": {
@@ -563,6 +563,7 @@
"doctrine/common": "~2.2",
"psr/log": "~1.0",
"symfony/config": "~2.2",
+ "symfony/http-foundation": "~2.3",
"symfony/yaml": "~2.0"
},
"suggest": {
@@ -597,21 +598,21 @@
],
"description": "Symfony Routing Component",
"homepage": "http://symfony.com",
- "time": "2014-08-15 09:05:55"
+ "time": "2014-10-13 12:38:27"
},
{
"name": "symfony/yaml",
- "version": "v2.3.19",
+ "version": "v2.3.21",
"target-dir": "Symfony/Component/Yaml",
"source": {
"type": "git",
"url": "https://github.com/symfony/Yaml.git",
- "reference": "71ceeca3d8164f0c5313127b24ad056071ccf2c6"
+ "reference": "34687c6236f1dfcebc874fbebd8da74d90f9f64f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Yaml/zipball/71ceeca3d8164f0c5313127b24ad056071ccf2c6",
- "reference": "71ceeca3d8164f0c5313127b24ad056071ccf2c6",
+ "url": "https://api.github.com/repos/symfony/Yaml/zipball/34687c6236f1dfcebc874fbebd8da74d90f9f64f",
+ "reference": "34687c6236f1dfcebc874fbebd8da74d90f9f64f",
"shasum": ""
},
"require": {
@@ -644,7 +645,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "http://symfony.com",
- "time": "2014-08-28 01:42:35"
+ "time": "2014-10-01 05:38:33"
},
{
"name": "twig/twig",
@@ -702,21 +703,21 @@
"packages-dev": [
{
"name": "fabpot/goutte",
- "version": "v1.0.3",
+ "version": "v1.0.7",
"source": {
"type": "git",
- "url": "https://github.com/fabpot/Goutte.git",
- "reference": "75c9f23c4122caf4ea3e87a42a00b471366e707f"
+ "url": "https://github.com/FriendsOfPHP/Goutte.git",
+ "reference": "794b196e76bdd37b5155cdecbad311f0a3b07625"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/fabpot/Goutte/zipball/75c9f23c4122caf4ea3e87a42a00b471366e707f",
- "reference": "75c9f23c4122caf4ea3e87a42a00b471366e707f",
+ "url": "https://api.github.com/repos/FriendsOfPHP/Goutte/zipball/794b196e76bdd37b5155cdecbad311f0a3b07625",
+ "reference": "794b196e76bdd37b5155cdecbad311f0a3b07625",
"shasum": ""
},
"require": {
"ext-curl": "*",
- "guzzle/http": ">=3.0.5,<3.8-dev",
+ "guzzle/http": "~3.1",
"php": ">=5.3.0",
"symfony/browser-kit": "~2.1",
"symfony/css-selector": "~2.1",
@@ -725,8 +726,8 @@
"symfony/process": "~2.1"
},
"require-dev": {
- "guzzle/plugin-history": ">=3.0.5,<3.8-dev",
- "guzzle/plugin-mock": ">=3.0.5,<3.8-dev"
+ "guzzle/plugin-history": "~3.1",
+ "guzzle/plugin-mock": "~3.1"
},
"type": "application",
"extra": {
@@ -746,9 +747,7 @@
"authors": [
{
"name": "Fabien Potencier",
- "email": "fabien@symfony.com",
- "homepage": "http://fabien.potencier.org",
- "role": "Lead Developer"
+ "email": "fabien@symfony.com"
}
],
"description": "A simple PHP Web Scraper",
@@ -756,7 +755,7 @@
"keywords": [
"scraper"
],
- "time": "2013-08-16 06:03:22"
+ "time": "2014-10-09 15:52:51"
},
{
"name": "guzzle/common",
@@ -1591,16 +1590,16 @@
},
{
"name": "sami/sami",
- "version": "v1.3",
+ "version": "v1.4",
"source": {
"type": "git",
- "url": "https://github.com/fabpot/Sami.git",
- "reference": "76f2ed80b3420f7e2f6dcd5b7218b5a5781f4110"
+ "url": "https://github.com/FriendsOfPHP/Sami.git",
+ "reference": "70f29c781f7bef30181c814b9471b2ceac694454"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/fabpot/Sami/zipball/76f2ed80b3420f7e2f6dcd5b7218b5a5781f4110",
- "reference": "76f2ed80b3420f7e2f6dcd5b7218b5a5781f4110",
+ "url": "https://api.github.com/repos/FriendsOfPHP/Sami/zipball/70f29c781f7bef30181c814b9471b2ceac694454",
+ "reference": "70f29c781f7bef30181c814b9471b2ceac694454",
"shasum": ""
},
"require": {
@@ -1621,7 +1620,7 @@
"type": "application",
"extra": {
"branch-alias": {
- "dev-master": "1.3-dev"
+ "dev-master": "1.4-dev"
}
},
"autoload": {
@@ -1636,9 +1635,7 @@
"authors": [
{
"name": "Fabien Potencier",
- "email": "fabien@symfony.com",
- "homepage": "http://fabien.potencier.org",
- "role": "Lead Developer"
+ "email": "fabien@symfony.com"
}
],
"description": "Sami, an API documentation generator",
@@ -1646,7 +1643,7 @@
"keywords": [
"phpdoc"
],
- "time": "2013-11-30 17:16:25"
+ "time": "2014-06-25 11:24:03"
},
{
"name": "sebastian/comparator",
@@ -1987,17 +1984,17 @@
},
{
"name": "symfony/browser-kit",
- "version": "v2.3.19",
+ "version": "v2.3.21",
"target-dir": "Symfony/Component/BrowserKit",
"source": {
"type": "git",
"url": "https://github.com/symfony/BrowserKit.git",
- "reference": "262d698efaa788ce24ff9c987378789bf3f81ce9"
+ "reference": "6a403eedacb56d32dc2cc657cfeac09d640ae6bc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/262d698efaa788ce24ff9c987378789bf3f81ce9",
- "reference": "262d698efaa788ce24ff9c987378789bf3f81ce9",
+ "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/6a403eedacb56d32dc2cc657cfeac09d640ae6bc",
+ "reference": "6a403eedacb56d32dc2cc657cfeac09d640ae6bc",
"shasum": ""
},
"require": {
@@ -2038,21 +2035,21 @@
],
"description": "Symfony BrowserKit Component",
"homepage": "http://symfony.com",
- "time": "2014-08-05 07:20:55"
+ "time": "2014-09-22 08:32:35"
},
{
"name": "symfony/css-selector",
- "version": "v2.3.19",
+ "version": "v2.3.21",
"target-dir": "Symfony/Component/CssSelector",
"source": {
"type": "git",
"url": "https://github.com/symfony/CssSelector.git",
- "reference": "8953d325d3341c246abadb79be172de95ef80664"
+ "reference": "d9943386b648d21746bed25cc24f61fab1387943"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/CssSelector/zipball/8953d325d3341c246abadb79be172de95ef80664",
- "reference": "8953d325d3341c246abadb79be172de95ef80664",
+ "url": "https://api.github.com/repos/symfony/CssSelector/zipball/d9943386b648d21746bed25cc24f61fab1387943",
+ "reference": "d9943386b648d21746bed25cc24f61fab1387943",
"shasum": ""
},
"require": {
@@ -2089,21 +2086,21 @@
],
"description": "Symfony CssSelector Component",
"homepage": "http://symfony.com",
- "time": "2014-08-27 08:24:06"
+ "time": "2014-10-09 12:30:02"
},
{
"name": "symfony/dom-crawler",
- "version": "v2.3.19",
+ "version": "v2.3.21",
"target-dir": "Symfony/Component/DomCrawler",
"source": {
"type": "git",
"url": "https://github.com/symfony/DomCrawler.git",
- "reference": "bad8d98561f071639fa67b20680bffcc256ce252"
+ "reference": "64b90870ee3a4e88c9a7a12861683864de029d31"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/bad8d98561f071639fa67b20680bffcc256ce252",
- "reference": "bad8d98561f071639fa67b20680bffcc256ce252",
+ "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/64b90870ee3a4e88c9a7a12861683864de029d31",
+ "reference": "64b90870ee3a4e88c9a7a12861683864de029d31",
"shasum": ""
},
"require": {
@@ -2142,21 +2139,21 @@
],
"description": "Symfony DomCrawler Component",
"homepage": "http://symfony.com",
- "time": "2014-08-21 00:21:59"
+ "time": "2014-10-01 05:38:33"
},
{
"name": "symfony/finder",
- "version": "v2.3.19",
+ "version": "v2.3.21",
"target-dir": "Symfony/Component/Finder",
"source": {
"type": "git",
"url": "https://github.com/symfony/Finder.git",
- "reference": "f7a5a5a3b1fc0ec9a1a5b4429223a8726e0f4b55"
+ "reference": "fc25dab213d14468c39f12d47e5b79a72b898d4d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Finder/zipball/f7a5a5a3b1fc0ec9a1a5b4429223a8726e0f4b55",
- "reference": "f7a5a5a3b1fc0ec9a1a5b4429223a8726e0f4b55",
+ "url": "https://api.github.com/repos/symfony/Finder/zipball/fc25dab213d14468c39f12d47e5b79a72b898d4d",
+ "reference": "fc25dab213d14468c39f12d47e5b79a72b898d4d",
"shasum": ""
},
"require": {
@@ -2189,21 +2186,21 @@
],
"description": "Symfony Finder Component",
"homepage": "http://symfony.com",
- "time": "2014-08-31 04:03:32"
+ "time": "2014-10-01 05:39:06"
},
{
"name": "symfony/process",
- "version": "v2.3.19",
+ "version": "v2.3.21",
"target-dir": "Symfony/Component/Process",
"source": {
"type": "git",
"url": "https://github.com/symfony/Process.git",
- "reference": "b8fc0e4b6750e4c458a38d038e6b4d538d4fe2bb"
+ "reference": "0434822691030547f2439d30ff68758c5576a0ce"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Process/zipball/b8fc0e4b6750e4c458a38d038e6b4d538d4fe2bb",
- "reference": "b8fc0e4b6750e4c458a38d038e6b4d538d4fe2bb",
+ "url": "https://api.github.com/repos/symfony/Process/zipball/0434822691030547f2439d30ff68758c5576a0ce",
+ "reference": "0434822691030547f2439d30ff68758c5576a0ce",
"shasum": ""
},
"require": {
@@ -2236,7 +2233,7 @@
],
"description": "Symfony Process Component",
"homepage": "http://symfony.com",
- "time": "2014-08-28 09:02:24"
+ "time": "2014-10-01 05:38:33"
}
],
"aliases": [
diff --git a/phpBB/config/auth_providers.yml b/phpBB/config/auth.yml
index 89303a684a..88a90ca2d6 100644
--- a/phpBB/config/auth_providers.yml
+++ b/phpBB/config/auth.yml
@@ -1,4 +1,9 @@
services:
+# ----- Auth management -----
+ auth:
+ class: phpbb\auth\auth
+
+# ----- Auth providers -----
auth.provider_collection:
class: phpbb\auth\provider_collection
arguments:
@@ -6,6 +11,7 @@ services:
- @config
tags:
- { name: service_collection, tag: auth.provider }
+
auth.provider.db:
class: phpbb\auth\provider\db
arguments:
@@ -19,6 +25,7 @@ services:
- %core.php_ext%
tags:
- { name: auth.provider }
+
auth.provider.apache:
class: phpbb\auth\provider\apache
arguments:
@@ -31,6 +38,7 @@ services:
- %core.php_ext%
tags:
- { name: auth.provider }
+
auth.provider.ldap:
class: phpbb\auth\provider\ldap
arguments:
@@ -40,6 +48,7 @@ services:
- @user
tags:
- { name: auth.provider }
+
auth.provider.oauth:
class: phpbb\auth\provider\oauth\oauth
arguments:
@@ -57,12 +66,15 @@ services:
- %core.php_ext%
tags:
- { name: auth.provider }
+
+# ----- OAuth services providers -----
auth.provider.oauth.service_collection:
class: phpbb\di\service_collection
arguments:
- @service_container
tags:
- { name: service_collection, tag: auth.provider.oauth.service }
+
auth.provider.oauth.service.bitly:
class: phpbb\auth\provider\oauth\service\bitly
arguments:
@@ -70,6 +82,7 @@ services:
- @request
tags:
- { name: auth.provider.oauth.service }
+
auth.provider.oauth.service.facebook:
class: phpbb\auth\provider\oauth\service\facebook
arguments:
@@ -77,6 +90,7 @@ services:
- @request
tags:
- { name: auth.provider.oauth.service }
+
auth.provider.oauth.service.google:
class: phpbb\auth\provider\oauth\service\google
arguments:
diff --git a/phpBB/config/avatars.yml b/phpBB/config/avatar.yml
index 8e5b1fdbfe..5292489715 100644
--- a/phpBB/config/avatars.yml
+++ b/phpBB/config/avatar.yml
@@ -1,4 +1,18 @@
services:
+ avatar.manager:
+ class: phpbb\avatar\manager
+ arguments:
+ - @config
+ - @avatar.driver_collection
+
+# ----- Avatar drivers -----
+ avatar.driver_collection:
+ class: phpbb\di\service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: avatar.driver }
+
avatar.driver.gravatar:
class: phpbb\avatar\driver\gravatar
arguments:
@@ -51,10 +65,3 @@ services:
- [set_name, [avatar.driver.upload]]
tags:
- { name: avatar.driver }
-
- avatar.driver_collection:
- class: phpbb\di\service_collection
- arguments:
- - @service_container
- tags:
- - { name: service_collection, tag: avatar.driver }
diff --git a/phpBB/config/captcha.yml b/phpBB/config/captcha.yml
index bca37767af..e3f617e909 100644
--- a/phpBB/config/captcha.yml
+++ b/phpBB/config/captcha.yml
@@ -1,8 +1,3 @@
-parameters:
- tables.captcha_qa_questions: %core.table_prefix%captcha_questions
- tables.captcha_qa_answers: %core.table_prefix%captcha_answers
- tables.captcha_qa_confirm: %core.table_prefix%qa_confirm
-
services:
captcha.factory:
class: phpbb\captcha\factory
@@ -10,6 +5,8 @@ services:
- @service_container
- @captcha.plugins.service_collection
+# ----- Captcha plugins -----
+# Scope MUST be prototype for all the plugins to work.
captcha.plugins.service_collection:
class: phpbb\di\service_collection
arguments:
@@ -19,7 +16,7 @@ services:
core.captcha.plugins.gd:
class: phpbb\captcha\plugins\gd
- scope: prototype # scope MUST be prototype for this to work!
+ scope: prototype
calls:
- [set_name, [core.captcha.plugins.gd]]
tags:
@@ -27,7 +24,7 @@ services:
core.captcha.plugins.gd_wave:
class: phpbb\captcha\plugins\gd_wave
- scope: prototype # scope MUST be prototype for this to work!
+ scope: prototype
calls:
- [set_name, [core.captcha.plugins.gd_wave]]
tags:
@@ -35,7 +32,7 @@ services:
core.captcha.plugins.nogd:
class: phpbb\captcha\plugins\nogd
- scope: prototype # scope MUST be prototype for this to work!
+ scope: prototype
calls:
- [set_name, [core.captcha.plugins.nogd]]
tags:
@@ -43,7 +40,7 @@ services:
core.captcha.plugins.qa:
class: phpbb\captcha\plugins\qa
- scope: prototype # scope MUST be prototype for this to work!
+ scope: prototype
arguments:
- %tables.captcha_qa_questions%
- %tables.captcha_qa_answers%
@@ -55,7 +52,7 @@ services:
core.captcha.plugins.recaptcha:
class: phpbb\captcha\plugins\recaptcha
- scope: prototype # scope MUST be prototype for this to work!
+ scope: prototype
calls:
- [set_name, [core.captcha.plugins.recaptcha]]
tags:
diff --git a/phpBB/config/console.yml b/phpBB/config/console.yml
index 540908164a..1e18a7dd37 100644
--- a/phpBB/config/console.yml
+++ b/phpBB/config/console.yml
@@ -84,6 +84,7 @@ services:
- @config
- @cache
- @log
+ - %core.root_path%
tags:
- { name: console.command }
diff --git a/phpBB/config/content.yml b/phpBB/config/content.yml
new file mode 100644
index 0000000000..4d9ee31335
--- /dev/null
+++ b/phpBB/config/content.yml
@@ -0,0 +1,72 @@
+services:
+ content.visibility:
+ class: phpbb\content_visibility
+ arguments:
+ - @auth
+ - @config
+ - @dispatcher
+ - @dbal.conn
+ - @user
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.forums%
+ - %tables.posts%
+ - %tables.topics%
+ - %tables.users%
+
+ groupposition.legend:
+ class: phpbb\groupposition\legend
+ arguments:
+ - @dbal.conn
+ - @user
+
+ groupposition.teampage:
+ class: phpbb\groupposition\teampage
+ arguments:
+ - @dbal.conn
+ - @user
+ - @cache.driver
+
+ message.form.admin:
+ class: phpbb\message\admin_form
+ arguments:
+ - @auth
+ - @config
+ - @config_text
+ - @dbal.conn
+ - @user
+ - %core.root_path%
+ - %core.php_ext%
+
+ message.form.topic:
+ class: phpbb\message\topic_form
+ arguments:
+ - @auth
+ - @config
+ - @dbal.conn
+ - @user
+ - %core.root_path%
+ - %core.php_ext%
+
+ message.form.user:
+ class: phpbb\message\user_form
+ arguments:
+ - @auth
+ - @config
+ - @dbal.conn
+ - @user
+ - %core.root_path%
+ - %core.php_ext%
+
+ pagination:
+ class: phpbb\pagination
+ arguments:
+ - @template
+ - @user
+ - @controller.helper
+ - @dispatcher
+
+ viewonline_helper:
+ class: phpbb\viewonline_helper
+ arguments:
+ - @filesystem
diff --git a/phpBB/config/cron_tasks.yml b/phpBB/config/cron.yml
index acf9a48bf9..7a90c39733 100644
--- a/phpBB/config/cron_tasks.yml
+++ b/phpBB/config/cron.yml
@@ -1,4 +1,26 @@
services:
+ cron.manager:
+ class: phpbb\cron\manager
+ arguments:
+ - @cron.task_collection
+ - %core.root_path%
+ - %core.php_ext%
+
+ cron.lock_db:
+ class: phpbb\lock\db
+ arguments:
+ - cron_lock
+ - @config
+ - @dbal.conn
+
+# ----- Cron tasks -----
+ cron.task_collection:
+ class: phpbb\di\service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: cron.task }
+
cron.task.core.prune_all_forums:
class: phpbb\cron\task\core\prune_all_forums
arguments:
diff --git a/phpBB/config/migrator.yml b/phpBB/config/db.yml
index cd04eea5c2..d11669d8a3 100644
--- a/phpBB/config/migrator.yml
+++ b/phpBB/config/db.yml
@@ -1,7 +1,24 @@
services:
+ dbal.conn:
+ class: phpbb\db\driver\factory
+ arguments:
+ - @service_container
+
+ dbal.conn.driver:
+ class: %dbal.driver.class%
+ calls:
+ - [sql_connect, [%dbal.dbhost%, %dbal.dbuser%, %dbal.dbpasswd%, %dbal.dbname%, %dbal.dbport%, false, %dbal.new_link%]]
+
+ dbal.tools:
+ class: phpbb\db\tools
+ arguments:
+ - @dbal.conn
+
+# ----- Migrator -----
migrator:
class: phpbb\db\migrator
arguments:
+ - @service_container
- @config
- @dbal.conn
- @dbal.tools
@@ -15,6 +32,7 @@ services:
migrator.helper:
class: phpbb\db\migration\helper
+# ----- Migrator's tools -----
migrator.tool_collection:
class: phpbb\di\service_collection
arguments:
diff --git a/phpBB/config/event.yml b/phpBB/config/event.yml
new file mode 100644
index 0000000000..599b3cbb40
--- /dev/null
+++ b/phpBB/config/event.yml
@@ -0,0 +1,34 @@
+services:
+ dispatcher:
+ class: phpbb\event\dispatcher
+ arguments:
+ - @service_container
+
+ hook_finder:
+ class: phpbb\hook\finder
+ arguments:
+ - %core.root_path%
+ - %core.php_ext%
+ - @cache.driver
+
+ kernel_request_subscriber:
+ class: phpbb\event\kernel_request_subscriber
+ arguments:
+ - @ext.manager
+ - %core.root_path%
+ - %core.php_ext%
+ tags:
+ - { name: kernel.event_subscriber }
+
+ kernel_exception_subscriber:
+ class: phpbb\event\kernel_exception_subscriber
+ arguments:
+ - @template
+ - @user
+ tags:
+ - { name: kernel.event_subscriber }
+
+ kernel_terminate_subscriber:
+ class: phpbb\event\kernel_terminate_subscriber
+ tags:
+ - { name: kernel.event_subscriber }
diff --git a/phpBB/config/mimetype_guessers.yml b/phpBB/config/mimetype_guesser.yml
index 0115146deb..2e89ed3c1f 100644
--- a/phpBB/config/mimetype_guessers.yml
+++ b/phpBB/config/mimetype_guesser.yml
@@ -1,11 +1,11 @@
-parameters:
- mimetype.guesser.priority.lowest: -2
- mimetype.guesser.priority.low: -1
- mimetype.guesser.priority.default: 0
- mimetype.guesser.priority.high: 1
- mimetype.guesser.priority.highest: 2
-
services:
+ mimetype.guesser_collection:
+ class: phpbb\di\service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: mimetype.guessers }
+
mimetype.fileinfo_mimetype_guesser:
class: Symfony\Component\HttpFoundation\File\MimeType\FileinfoMimeTypeGuesser
tags:
@@ -30,13 +30,6 @@ services:
tags:
- { name: mimetype.guessers }
- mimetype.guesser_collection:
- class: phpbb\di\service_collection
- arguments:
- - @service_container
- tags:
- - { name: service_collection, tag: mimetype.guessers }
-
mimetype.guesser:
class: phpbb\mimetype\guesser
arguments:
diff --git a/phpBB/config/notifications.yml b/phpBB/config/notification.yml
index 5675e76a99..b17a172fb5 100644
--- a/phpBB/config/notifications.yml
+++ b/phpBB/config/notification.yml
@@ -1,21 +1,34 @@
services:
- notification.type_collection:
- class: phpbb\di\service_collection
+ notification_manager:
+ class: phpbb\notification\manager
arguments:
+ - @notification.type_collection
+ - @notification.method_collection
- @service_container
- tags:
- - { name: service_collection, tag: notification.type }
+ - @user_loader
+ - @config
+ - @dispatcher
+ - @dbal.conn
+ - @cache
+ - @user
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.notification_types%
+ - %tables.notifications%
+ - %tables.user_notifications%
- notification.method_collection:
+# ----- Notification's types -----
+# Scope MUST be prototype for all the plugins to work.
+ notification.type_collection:
class: phpbb\di\service_collection
arguments:
- @service_container
tags:
- - { name: service_collection, tag: notification.method }
+ - { name: service_collection, tag: notification.type }
notification.type.approve_post:
class: phpbb\notification\type\approve_post
- scope: prototype # scope MUST be prototype for this to work! # scope MUST be prototype for this to work!
+ scope: prototype
arguments:
- @user_loader
- @dbal.conn
@@ -33,7 +46,7 @@ services:
notification.type.approve_topic:
class: phpbb\notification\type\approve_topic
- scope: prototype # scope MUST be prototype for this to work!
+ scope: prototype
arguments:
- @user_loader
- @dbal.conn
@@ -51,7 +64,7 @@ services:
notification.type.bookmark:
class: phpbb\notification\type\bookmark
- scope: prototype # scope MUST be prototype for this to work!
+ scope: prototype
arguments:
- @user_loader
- @dbal.conn
@@ -69,7 +82,7 @@ services:
notification.type.disapprove_post:
class: phpbb\notification\type\disapprove_post
- scope: prototype # scope MUST be prototype for this to work!
+ scope: prototype
arguments:
- @user_loader
- @dbal.conn
@@ -87,7 +100,7 @@ services:
notification.type.disapprove_topic:
class: phpbb\notification\type\disapprove_topic
- scope: prototype # scope MUST be prototype for this to work!
+ scope: prototype
arguments:
- @user_loader
- @dbal.conn
@@ -105,7 +118,7 @@ services:
notification.type.group_request:
class: phpbb\notification\type\group_request
- scope: prototype # scope MUST be prototype for this to work!
+ scope: prototype
arguments:
- @user_loader
- @dbal.conn
@@ -123,7 +136,7 @@ services:
notification.type.group_request_approved:
class: phpbb\notification\type\group_request_approved
- scope: prototype # scope MUST be prototype for this to work!
+ scope: prototype
arguments:
- @user_loader
- @dbal.conn
@@ -141,7 +154,7 @@ services:
notification.type.pm:
class: phpbb\notification\type\pm
- scope: prototype # scope MUST be prototype for this to work!
+ scope: prototype
arguments:
- @user_loader
- @dbal.conn
@@ -159,7 +172,7 @@ services:
notification.type.post:
class: phpbb\notification\type\post
- scope: prototype # scope MUST be prototype for this to work!
+ scope: prototype
arguments:
- @user_loader
- @dbal.conn
@@ -177,7 +190,7 @@ services:
notification.type.post_in_queue:
class: phpbb\notification\type\post_in_queue
- scope: prototype # scope MUST be prototype for this to work!
+ scope: prototype
arguments:
- @user_loader
- @dbal.conn
@@ -195,7 +208,7 @@ services:
notification.type.quote:
class: phpbb\notification\type\quote
- scope: prototype # scope MUST be prototype for this to work!
+ scope: prototype
arguments:
- @user_loader
- @dbal.conn
@@ -213,7 +226,7 @@ services:
notification.type.report_pm:
class: phpbb\notification\type\report_pm
- scope: prototype # scope MUST be prototype for this to work!
+ scope: prototype
arguments:
- @user_loader
- @dbal.conn
@@ -231,7 +244,7 @@ services:
notification.type.report_pm_closed:
class: phpbb\notification\type\report_pm_closed
- scope: prototype # scope MUST be prototype for this to work!
+ scope: prototype
arguments:
- @user_loader
- @dbal.conn
@@ -249,7 +262,7 @@ services:
notification.type.report_post:
class: phpbb\notification\type\report_post
- scope: prototype # scope MUST be prototype for this to work!
+ scope: prototype
arguments:
- @user_loader
- @dbal.conn
@@ -267,7 +280,7 @@ services:
notification.type.report_post_closed:
class: phpbb\notification\type\report_post_closed
- scope: prototype # scope MUST be prototype for this to work!
+ scope: prototype
arguments:
- @user_loader
- @dbal.conn
@@ -285,7 +298,7 @@ services:
notification.type.topic:
class: phpbb\notification\type\topic
- scope: prototype # scope MUST be prototype for this to work!
+ scope: prototype
arguments:
- @user_loader
- @dbal.conn
@@ -303,7 +316,7 @@ services:
notification.type.topic_in_queue:
class: phpbb\notification\type\topic_in_queue
- scope: prototype # scope MUST be prototype for this to work!
+ scope: prototype
arguments:
- @user_loader
- @dbal.conn
@@ -321,7 +334,7 @@ services:
notification.type.admin_activate_user:
class: phpbb\notification\type\admin_activate_user
- scope: prototype # scope MUST be prototype for this to work!
+ scope: prototype
arguments:
- @user_loader
- @dbal.conn
@@ -336,10 +349,19 @@ services:
- %tables.user_notifications%
tags:
- { name: notification.type }
+
+# ----- Notification's methods -----
+# Scope MUST be prototype for all the plugins to work.
+ notification.method_collection:
+ class: phpbb\di\service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: notification.method }
notification.method.email:
class: phpbb\notification\method\email
- scope: prototype # scope MUST be prototype for this to work!
+ scope: prototype
arguments:
- @user_loader
- @dbal.conn
@@ -354,7 +376,7 @@ services:
notification.method.jabber:
class: phpbb\notification\method\jabber
- scope: prototype # scope MUST be prototype for this to work!
+ scope: prototype
arguments:
- @user_loader
- @dbal.conn
diff --git a/phpBB/config/parameters.yml b/phpBB/config/parameters.yml
index b076ea3ecb..8ecc1428f4 100644
--- a/phpBB/config/parameters.yml
+++ b/phpBB/config/parameters.yml
@@ -1,3 +1,20 @@
parameters:
+ # Disable the usage of the super globals (_GET, _POST, _SERVER...)
core.disable_super_globals: true
+
+ # Datetime class to use
datetime.class: \phpbb\datetime
+
+ # Mimetype guesser priorities
+ mimetype.guesser.priority.lowest: -2
+ mimetype.guesser.priority.low: -1
+ mimetype.guesser.priority.default: 0
+ mimetype.guesser.priority.high: 1
+ mimetype.guesser.priority.highest: 2
+
+ # List of default password driver types
+ passwords.algorithms:
+ - passwords.driver.bcrypt_2y
+ - passwords.driver.bcrypt
+ - passwords.driver.salted_md5
+ - passwords.driver.phpass
diff --git a/phpBB/config/passwords.yml b/phpBB/config/password.yml
index 3dc217286f..cb45ec3d42 100644
--- a/phpBB/config/passwords.yml
+++ b/phpBB/config/password.yml
@@ -1,11 +1,29 @@
-parameters:
- passwords.algorithms:
- - passwords.driver.bcrypt_2y
- - passwords.driver.bcrypt
- - passwords.driver.salted_md5
- - passwords.driver.phpass
-
services:
+# ----- Password management -----
+ passwords.manager:
+ class: phpbb\passwords\manager
+ arguments:
+ - @config
+ - @passwords.driver_collection
+ - @passwords.helper
+ - %passwords.algorithms%
+
+ passwords.helper:
+ class: phpbb\passwords\helper
+
+ passwords.driver_helper:
+ class: phpbb\passwords\driver\helper
+ arguments:
+ - @config
+
+# ----- Password's drivers -----
+ passwords.driver_collection:
+ class: phpbb\di\service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: passwords.driver }
+
passwords.driver.bcrypt:
class: phpbb\passwords\driver\bcrypt
arguments:
@@ -83,6 +101,7 @@ services:
arguments:
- @request
- @passwords.driver.salted_md5
+ - @passwords.driver_helper
- %core.root_path%
- %core.php_ext%
tags:
@@ -103,26 +122,3 @@ services:
- @passwords.driver_helper
tags:
- { name: passwords.driver }
-
- passwords.driver_collection:
- class: phpbb\di\service_collection
- arguments:
- - @service_container
- tags:
- - { name: service_collection, tag: passwords.driver }
-
- passwords.driver_helper:
- class: phpbb\passwords\driver\helper
- arguments:
- - @config
-
- passwords.manager:
- class: phpbb\passwords\manager
- arguments:
- - @config
- - @passwords.driver_collection
- - @passwords.helper
- - %passwords.algorithms%
-
- passwords.helper:
- class: phpbb\passwords\helper
diff --git a/phpBB/config/profilefields.yml b/phpBB/config/profilefield.yml
index ce2a84b12b..5ccfef9148 100644
--- a/phpBB/config/profilefields.yml
+++ b/phpBB/config/profilefield.yml
@@ -19,6 +19,7 @@ services:
- @dbal.conn
- %tables.profile_fields_options_language%
+# ----- Profile fields types -----
profilefields.type_collection:
class: phpbb\di\service_collection
arguments:
diff --git a/phpBB/config/routing.yml b/phpBB/config/routing.yml
index d8e890d063..94146e1ec2 100644
--- a/phpBB/config/routing.yml
+++ b/phpBB/config/routing.yml
@@ -1,7 +1,7 @@
# Structure:
#
# foo_controller:
-# pattern: /foo
+# path: /foo
# defaults: { _controller: foo_sevice:method }
#
# The above will be accessed via app.php?controller=foo and it will
diff --git a/phpBB/config/services.yml b/phpBB/config/services.yml
index cca655263f..8667cbbf84 100644
--- a/phpBB/config/services.yml
+++ b/phpBB/config/services.yml
@@ -1,34 +1,23 @@
imports:
- - { resource: tables.yml }
- - { resource: cron_tasks.yml }
- - { resource: notifications.yml }
- - { resource: migrator.yml }
- - { resource: avatars.yml }
- - { resource: feed.yml }
- - { resource: auth_providers.yml }
- - { resource: console.yml }
- - { resource: mimetype_guessers.yml }
- - { resource: passwords.yml }
- - { resource: profilefields.yml }
+ - { resource: auth.yml }
+ - { resource: avatar.yml }
- { resource: captcha.yml }
+ - { resource: console.yml }
+ - { resource: content.yml }
+ - { resource: cron.yml }
+ - { resource: db.yml }
+ - { resource: event.yml }
+ - { resource: feed.yml }
+ - { resource: mimetype_guesser.yml }
+ - { resource: notification.yml }
+ - { resource: password.yml }
+ - { resource: profilefield.yml }
+ - { resource: user.yml }
+
+ - { resource: tables.yml }
- { resource: parameters.yml }
services:
- acl.permissions:
- class: phpbb\permissions
- arguments:
- - @dispatcher
- - @user
-
- auth:
- class: phpbb\auth\auth
-
- avatar.manager:
- class: phpbb\avatar\manager
- arguments:
- - @config
- - @avatar.driver_collection
-
cache:
class: phpbb\cache\service
arguments:
@@ -77,20 +66,6 @@ services:
- @dbal.conn
- %tables.config_text%
- content.visibility:
- class: phpbb\content_visibility
- arguments:
- - @auth
- - @config
- - @dbal.conn
- - @user
- - %core.root_path%
- - %core.php_ext%
- - %tables.forums%
- - %tables.posts%
- - %tables.topics%
- - %tables.users%
-
controller.helper:
class: phpbb\controller\helper
arguments:
@@ -100,6 +75,7 @@ services:
- @controller.provider
- @ext.manager
- @symfony_request
+ - @request
- @filesystem
- %core.root_path%
- %core.php_ext%
@@ -117,47 +93,6 @@ services:
calls:
- [find, [%core.root_path%]]
- cron.task_collection:
- class: phpbb\di\service_collection
- arguments:
- - @service_container
- tags:
- - { name: service_collection, tag: cron.task }
-
- cron.manager:
- class: phpbb\cron\manager
- arguments:
- - @cron.task_collection
- - %core.root_path%
- - %core.php_ext%
-
- cron.lock_db:
- class: phpbb\lock\db
- arguments:
- - cron_lock
- - @config
- - @dbal.conn
-
- dispatcher:
- class: phpbb\event\dispatcher
- arguments:
- - @service_container
-
- dbal.conn:
- class: phpbb\db\driver\factory
- arguments:
- - @service_container
-
- dbal.conn.driver:
- class: %dbal.driver.class%
- calls:
- - [sql_connect, [%dbal.dbhost%, %dbal.dbuser%, %dbal.dbpasswd%, %dbal.dbname%, %dbal.dbport%, false, %dbal.new_link%]]
-
- dbal.tools:
- class: phpbb\db\tools
- arguments:
- - @dbal.conn
-
ext.manager:
class: phpbb\extension\manager
arguments:
@@ -174,18 +109,8 @@ services:
filesystem:
class: phpbb\filesystem
- groupposition.legend:
- class: phpbb\groupposition\legend
- arguments:
- - @dbal.conn
- - @user
-
- groupposition.teampage:
- class: phpbb\groupposition\teampage
- arguments:
- - @dbal.conn
- - @user
- - @cache.driver
+ file_downloader:
+ class: phpbb\file_downloader
http_kernel:
class: Symfony\Component\HttpKernel\HttpKernel
@@ -193,35 +118,6 @@ services:
- @dispatcher
- @controller.resolver
- hook_finder:
- class: phpbb\hook\finder
- arguments:
- - %core.root_path%
- - %core.php_ext%
- - @cache.driver
-
- kernel_request_subscriber:
- class: phpbb\event\kernel_request_subscriber
- arguments:
- - @ext.manager
- - %core.root_path%
- - %core.php_ext%
- tags:
- - { name: kernel.event_subscriber }
-
- kernel_exception_subscriber:
- class: phpbb\event\kernel_exception_subscriber
- arguments:
- - @template
- - @user
- tags:
- - { name: kernel.event_subscriber }
-
- kernel_terminate_subscriber:
- class: phpbb\event\kernel_terminate_subscriber
- tags:
- - { name: kernel.event_subscriber }
-
log:
class: phpbb\log\log
arguments:
@@ -234,61 +130,6 @@ services:
- %core.php_ext%
- %tables.log%
- message.form.admin:
- class: phpbb\message\admin_form
- arguments:
- - @auth
- - @config
- - @config_text
- - @dbal.conn
- - @user
- - %core.root_path%
- - %core.php_ext%
-
- message.form.topic:
- class: phpbb\message\topic_form
- arguments:
- - @auth
- - @config
- - @dbal.conn
- - @user
- - %core.root_path%
- - %core.php_ext%
-
- message.form.user:
- class: phpbb\message\user_form
- arguments:
- - @auth
- - @config
- - @dbal.conn
- - @user
- - %core.root_path%
- - %core.php_ext%
-
- notification_manager:
- class: phpbb\notification\manager
- arguments:
- - @notification.type_collection
- - @notification.method_collection
- - @service_container
- - @user_loader
- - @config
- - @dbal.conn
- - @cache
- - @user
- - %core.root_path%
- - %core.php_ext%
- - %tables.notification_types%
- - %tables.notifications%
- - %tables.user_notifications%
-
- pagination:
- class: phpbb\pagination
- arguments:
- - @template
- - @user
- - @controller.helper
-
path_helper:
class: phpbb\path_helper
arguments:
@@ -318,6 +159,8 @@ services:
- null
- %core.disable_super_globals%
+ # WARNING: The Symfony request does not escape the input and should be used very carefully
+ # prefer the phpbb request (service @request) as possible
symfony_request:
class: phpbb\symfony_request
arguments:
@@ -335,28 +178,11 @@ services:
template_context:
class: phpbb\template\context
- user:
- class: phpbb\user
- arguments:
- - %datetime.class%
-
- user_loader:
- class: phpbb\user_loader
- arguments:
- - @dbal.conn
- - %core.root_path%
- - %core.php_ext%
- - %tables.users%
-
version_helper:
class: phpbb\version_helper
scope: prototype
arguments:
- @cache
- @config
+ - @file_downloader
- @user
-
- viewonline_helper:
- class: phpbb\viewonline_helper
- arguments:
- - @filesystem
diff --git a/phpBB/config/tables.yml b/phpBB/config/tables.yml
index e4f7bda89b..2fe2a33be8 100644
--- a/phpBB/config/tables.yml
+++ b/phpBB/config/tables.yml
@@ -1,6 +1,9 @@
parameters:
tables.auth_provider_oauth_token_storage: %core.table_prefix%oauth_tokens
tables.auth_provider_oauth_account_assoc: %core.table_prefix%oauth_accounts
+ tables.captcha_qa_questions: %core.table_prefix%captcha_questions
+ tables.captcha_qa_answers: %core.table_prefix%captcha_answers
+ tables.captcha_qa_confirm: %core.table_prefix%qa_confirm
tables.config: %core.table_prefix%config
tables.config_text: %core.table_prefix%config_text
tables.ext: %core.table_prefix%ext
diff --git a/phpBB/config/user.yml b/phpBB/config/user.yml
new file mode 100644
index 0000000000..1ca853ea45
--- /dev/null
+++ b/phpBB/config/user.yml
@@ -0,0 +1,19 @@
+services:
+ acl.permissions:
+ class: phpbb\permissions
+ arguments:
+ - @dispatcher
+ - @user
+
+ user:
+ class: phpbb\user
+ arguments:
+ - %datetime.class%
+
+ user_loader:
+ class: phpbb\user_loader
+ arguments:
+ - @dbal.conn
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.users%
diff --git a/phpBB/develop/add_permissions.php b/phpBB/develop/add_permissions.php
index fd419a7dde..a5279f8f13 100644
--- a/phpBB/develop/add_permissions.php
+++ b/phpBB/develop/add_permissions.php
@@ -198,9 +198,9 @@ $prefixes = array('f_', 'a_', 'm_', 'u_');
foreach ($prefixes as $prefix)
{
$var = $prefix . 'permissions';
- if (sizeof($$var))
+ if (sizeof(${$var}))
{
- foreach ($$var as $auth_option => $l_ary)
+ foreach (${$var} as $auth_option => $l_ary)
{
$sql_ary = array(
'auth_option' => $auth_option,
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php
index b1e981795f..60ffe04330 100644
--- a/phpBB/develop/create_schema_files.php
+++ b/phpBB/develop/create_schema_files.php
@@ -51,10 +51,9 @@ $classes = $finder->core_path('phpbb/')
$db = new \phpbb\db\driver\sqlite();
$schema_generator = new \phpbb\db\migration\schema_generator($classes, new \phpbb\config\config(array()), $db, new \phpbb\db\tools($db, true), $phpbb_root_path, $phpEx, $table_prefix);
$schema_data = $schema_generator->get_schema();
-$dbms_type_map = phpbb\db\tools::get_dbms_type_map();
$fp = fopen($schema_path . 'schema.json', 'wb');
fwrite($fp, json_encode($schema_data, JSON_PRETTY_PRINT));
fclose($fp);
-echo 'done';
+echo 'Successfully created schema file';
diff --git a/phpBB/develop/mysql_upgrader.php b/phpBB/develop/mysql_upgrader.php
index 5c558f0b8e..698be9d303 100644
--- a/phpBB/develop/mysql_upgrader.php
+++ b/phpBB/develop/mysql_upgrader.php
@@ -62,10 +62,14 @@ echo "USE $dbname;$newline$newline";
@set_time_limit(0);
-require($phpbb_root_path . 'includes/db/schema_data.' . $phpEx);
-require($phpbb_root_path . 'phpbb/db/tools.' . $phpEx);
-
-$dbms_type_map = phpbb\db\tools::get_dbms_type_map();
+$finder = new \phpbb\finder(new \phpbb\filesystem(), $phpbb_root_path);
+$classes = $finder->core_path('phpbb/')
+ ->directory('/db/migration/data')
+ ->get_classes();
+
+$schema_generator = new \phpbb\db\migration\schema_generator($classes, $config, $db, new \phpbb\db\tools($db, true), $phpbb_root_path, $phpEx, $table_prefix);
+$schema_data = $schema_generator->get_schema();
+$dbms_type_map = \phpbb\db\tools::get_dbms_type_map();
foreach ($schema_data as $table_name => $table_data)
{
diff --git a/phpBB/develop/regex_idn.php b/phpBB/develop/regex_idn.php
new file mode 100644
index 0000000000..d871695c50
--- /dev/null
+++ b/phpBB/develop/regex_idn.php
@@ -0,0 +1,151 @@
+<?php
+//
+// Security message:
+//
+// This script is potentially dangerous.
+// Remove or comment the next line (die(".... ) to enable this script.
+// Do NOT FORGET to either remove this script or disable it after you have used it.
+//
+die("Please read the first lines of this script for instructions on how to enable it");
+
+// IP regular expressions
+
+$dec_octet = '(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])';
+$h16 = '[\dA-F]{1,4}';
+$ipv4 = "(?:$dec_octet\.){3}$dec_octet";
+$ls32 = "(?:$h16:$h16|$ipv4)";
+
+$ipv6_construct = array(
+ array(false, '', '{6}', $ls32),
+ array(false, '::', '{0,5}', "(?:$h16(?::$h16)?|$ipv4)"),
+ array('', ':', '{4}', $ls32),
+ array('{1,2}', ':', '{3}', $ls32),
+ array('{1,3}', ':', '{2}', $ls32),
+ array('{1,4}', ':', '', $ls32),
+ array('{1,5}', ':', false, $ls32),
+ array('{1,6}', ':', false, $h16),
+ array('{1,7}', ':', false, ''),
+ array(false, '::', false, '')
+);
+
+$ipv6 = '(?:';
+foreach ($ipv6_construct as $ip_type)
+{
+ $ipv6 .= '(?:';
+ if ($ip_type[0] !== false)
+ {
+ $ipv6 .= "(?:$h16:)" . $ip_type[0];
+ }
+ $ipv6 .= $ip_type[1];
+ if ($ip_type[2] !== false)
+ {
+ $ipv6 .= "(?:$h16:)" . $ip_type[2];
+ }
+ $ipv6 .= $ip_type[3] . ')|';
+}
+$ipv6 = substr($ipv6, 0, -1) . ')';
+
+echo 'IPv4: ' . $ipv4 . "<br /><br />\n\nIPv6: " . $ipv6 . "<br /><br />\n\n";
+
+// URL regular expressions
+
+/* IDN2008 characters derivation
+** http://unicode.org/faq/idn.html#33 - IDN FAQ: derivation of valid characters in terms of Unicode properties
+** http://unicode.org/reports/tr46/ - Unicode Technical Standard #46. Unicode IDNA Compatibility Processing
+** http://www.unicode.org/Public/UNIDATA/DerivedNormalizationProps.txt - Unicode Character Database
+*/
+/*
+** Remove Control Characters and Whitespace (as in IDNA2003)
+*/
+$no_cc = '\p{C}\p{Z}';
+/*
+** Remove Symbols, Punctuation, non-decimal Numbers, and Enclosing Marks
+*/
+$no_symbol = '\p{S}\p{P}\p{Nl}\p{No}\p{Me}';
+/*
+** Remove characters used for archaic Hangul (Korean) - \p{HST=L} and \p{HST=V}
+** as per http://unicode.org/Public/UNIDATA/HangulSyllableType.txt
+*/
+$no_hangul = '\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}';
+/*
+** Remove three blocks of technical or archaic symbols.
+*/
+$no_cdm = '\x{20D0}-\x{20FF}'; // \p{block=Combining_Diacritical_Marks_For_Symbols}
+$no_musical = '\x{1D100}-\x{1D1FF}'; // \p{block=Musical_Symbols}
+$no_ancient_greek_musical = '\x{1D200}-\x{1D24F}'; // \p{block=Ancient_Greek_Musical_Notation}
+/* Remove certain exceptions:
+** U+0640 ARABIC TATWEEL
+** U+07FA NKO LAJANYALAN
+** U+302E HANGUL SINGLE DOT TONE MARK
+** U+302F HANGUL DOUBLE DOT TONE MARK
+** U+3031 VERTICAL KANA REPEAT MARK
+** U+3032 VERTICAL KANA REPEAT WITH VOICED SOUND MARK
+** ..
+** U+3035 VERTICAL KANA REPEAT MARK LOWER HALF
+** U+303B VERTICAL IDEOGRAPHIC ITERATION MARK
+*/
+$no_certain_exceptions = '\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}';
+/* Add certain exceptions:
+** U+00B7 MIDDLE DOT
+** U+0375 GREEK LOWER NUMERAL SIGN
+** U+05F3 HEBREW PUNCTUATION GERESH
+** U+05F4 HEBREW PUNCTUATION GERSHAYIM
+** U+30FB KATAKANA MIDDLE DOT
+** U+002D HYPHEN-MINUS
+** U+06FD ARABIC SIGN SINDHI AMPERSAND
+** U+06FE ARABIC SIGN SINDHI POSTPOSITION MEN
+** U+0F0B TIBETAN MARK INTERSYLLABIC TSHEG
+** U+3007 IDEOGRAPHIC NUMBER ZERO
+*/
+$add_certain_exceptions = '\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}';
+/* Add special exceptions (Deviations):
+** U+00DF LATIN SMALL LETTER SHARP S
+** U+03C2 GREEK SMALL LETTER FINAL SIGMA
+** U+200C ZERO WIDTH NON-JOINER
+** U+200D ZERO WIDTH JOINER
+*/
+$add_deviations = '\x{00DF}\x{03C2}\x{200C}\x{200D}';
+
+// Concatenate remove/add regexes respectively
+$remove_chars = "$no_cc$no_symbol$no_hangul$no_cdm$no_musical$no_ancient_greek_musical$no_certain_exceptions";
+$add_chars = "$add_certain_exceptions$add_deviations";
+
+// Initialize inline mode
+$inline = false;
+
+do
+{
+ $inline = !$inline;
+
+ $pct_encoded = "%[\dA-F]{2}";
+ $unreserved = "$add_chars\pL0-9\-._~";
+ $sub_delims = ($inline) ? '!$&\'(*+,;=' : '!$&\'()*+,;=';
+ $scheme = ($inline) ? '[a-z][a-z\d+]*': '[a-z][a-z\d+\-.]*' ; // avoid automatic parsing of "word" in "last word.http://..."
+ $pchar = "(?:[^$remove_chars]*[$unreserved$sub_delims:@|]+|$pct_encoded)"; // rfc: no "|"
+
+ $reg_name = "(?:[^$remove_chars]*[$unreserved$sub_delims:@|]+|$pct_encoded)+"; // rfc: * instead of + and no "|" and no "@" and no ":" (included instead of userinfo)
+ //$userinfo = "(?:(?:[$unreserved$sub_delims:]+|$pct_encoded))*";
+ $ipv4_simple = '[0-9.]+';
+ $ipv6_simple = '\[[a-z0-9.]+:[a-z0-9.]+:[a-z0-9.:]+\]';
+ $host = "(?:$reg_name|$ipv4_simple|$ipv6_simple)";
+ $port = '\d*';
+ //$authority = "(?:$userinfo@)?$host(?::$port)?";
+ $authority = "$host(?::$port)?";
+ $segment = "$pchar*";
+ $path_abempty = "(?:/$segment)*";
+ $hier_part = "/{2}$authority$path_abempty";
+ $query = "(?:[^$remove_chars]*[$unreserved$sub_delims:@/?|]+|$pct_encoded)*"; // pchar | "/" | "?", rfc: no "|"
+ $fragment = $query;
+
+ $url = "$scheme:$hier_part(?:\?$query)?(?:\#$fragment)?";
+ echo (($inline) ? 'URL inline: ' : 'URL: ') . $url . "<br /><br />\n\n";
+
+ // no scheme, shortened authority, but host has to start with www.
+ $www_url = "www\.$reg_name(?::$port)?$path_abempty(?:\?$query)?(?:\#$fragment)?";
+ echo (($inline) ? 'www.URL_inline: ' : 'www.URL: ') . $www_url . "<br /><br />\n\n";
+
+ // no schema and no authority
+ $relative_url = "$segment$path_abempty(?:\?$query)?(?:\#$fragment)?";
+ echo (($inline) ? 'relative URL inline: ' : 'relative URL: ') . $relative_url . "<br /><br />\n\n";
+}
+while ($inline);
diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 7b46129c6c..9710014b56 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -4,9 +4,9 @@
<meta charset="utf-8">
<meta name="keywords" content="" />
<meta name="description" content="phpBB 3.1.x Changelog" />
-<title>phpBB3 &bull; Changelog</title>
+<title>phpBB &bull; Changelog</title>
-<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
+<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
</head>
@@ -16,15 +16,15 @@
<a id="top" name="top" accesskey="t"></a>
<div id="page-header">
<div class="headerbar">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div id="doc-description">
- <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a>
+ <a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a>
<h1>phpBB 3.1.x Changelog</h1>
<p style="display: none;"><a href="#start_here">Skip</a></p>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
</div>
@@ -34,18 +34,28 @@
<!-- BEGIN DOCUMENT -->
-<p>This is a non-exhaustive (but still near complete) changelog for phpBB 3.1.x including release candidate versions. Our thanks to all those people who've contributed bug reports and code fixes.</p>
+<p class="paragraph main-description">
+ This is a non-exhaustive (but still near complete) changelog for phpBB 3.1.x including release candidate versions.
+ Our thanks to all those people who've contributed bug reports and code fixes.
+</p>
<h1>Changelog</h1>
<div class="paragraph menu">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
<ol>
<li><a href="#changelog">Changelog</a>
- <ol style="list-style-type: lower-roman;">
+ <ul>
+ <li><a href="#v312">Changes since 3.1.3-RC1</a></li>
+ <li><a href="#v312">Changes since 3.1.2</a></li>
+ <li><a href="#v311">Changes since 3.1.1</a></li>
+ <li><a href="#v310">Changes since 3.1.0</a></li>
+ <li><a href="#v310RC6">Changes since 3.1.0-RC6</a></li>
+ <li><a href="#v310RC5">Changes since 3.1.0-RC5</a></li>
+ <li><a href="#v310RC4">Changes since 3.1.0-RC4</a></li>
<li><a href="#v310RC3">Changes since 3.1.0-RC3</a></li>
<li><a href="#v310RC2">Changes since 3.1.0-RC2</a></li>
<li><a href="#v310RC1">Changes since 3.1.0-RC1</a></li>
@@ -57,6 +67,8 @@
<li><a href="#v310a2">Changes since 3.1.0-a2</a></li>
<li><a href="#v310a1">Changes since 3.1.0-a1</a></li>
<li><a href="#v30x">Changes since 3.0.x</a></li>
+ <li><a href="#v3013">Changes since 3.0.13</a></li>
+ <li><a href="#v3012">Changes since 3.0.12</a></li>
<li><a href="#v3011">Changes since 3.0.11</a></li>
<li><a href="#v3010">Changes since 3.0.10</a></li>
<li><a href="#v309">Changes since 3.0.9</a></li>
@@ -78,14 +90,14 @@
<li><a href="#v30rc3">Changes since RC-3</a></li>
<li><a href="#v30rc2">Changes since RC-2</a></li>
<li><a href="#v30rc1">Changes since RC-1</a></li>
- </ol>
+ </ul>
</li>
<li><a href="#disclaimer">Copyright and disclaimer</a></li>
</ol>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -93,11 +105,358 @@
<a name="changelog"></a><h2>1. Changelog</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <a name="v310RC3"></a><h3>1.i. Changes since 3.1.0-RC3</h3>
+ <a name="v313rc1"></a><h3>Changes since 3.1.3-RC1</h3>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12933">PHPBB3-12933</a>] - The search operator for partial matches does not work</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13544">PHPBB3-13544</a>] - Migrations' &quot;permission.permission_unset&quot; deletes all permissions instead of just the one stated</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13556">PHPBB3-13556</a>] - Translated exceptions from file_downloader are handled incorrectly</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13557">PHPBB3-13557</a>] - Migrations for 3.0.13 and PL1 are missing</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13553">PHPBB3-13553</a>] - Controller helper needs a message handler to replace error handler</li>
+ </ul>
+
+ <a name="v312"></a><h3>Changes since 3.1.2</h3>
+
+ <h4>Security</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13519">PHPBB3-13519</a>] - Correctly validate imagick path as path and not string</li>
+ </ul>
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9100">PHPBB3-9100</a>] - Inline attachments are not being inserted at the cursor</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11613">PHPBB3-11613</a>] - Cookies do not work for netbios domain</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12089">PHPBB3-12089</a>] - Make HTTP status code error messages more informative</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12642">PHPBB3-12642</a>] - Custom profile field isn't displayed</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12698">PHPBB3-12698</a>] - Replace all instances of magic numbers with constants in javascript</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12866">PHPBB3-12866</a>] - Wrong profile field validation options</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13098">PHPBB3-13098</a>] - Repair Yahoo contact field</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13192">PHPBB3-13192</a>] - confirm_box() action contains app.php when enable_mod_rewrite is set</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13238">PHPBB3-13238</a>] - \phpbb\db\migration\data\v310\mysql_fulltext_drop tries to drop non existent indexes</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13272">PHPBB3-13272</a>] - Changed Files packages do not include vendor directory</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13282">PHPBB3-13282</a>] - PostgreSQL error when creating boolean/dropdown custom profile fields</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13302">PHPBB3-13302</a>] - ACP links to docs need to be updated to 3.1 URLs</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13307">PHPBB3-13307</a>] - develop/mysql_upgrader.php does not work anymore</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13319">PHPBB3-13319</a>] - Icons/smilies table improperly formed when no images present</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13346">PHPBB3-13346</a>] - Missing space in posting_editor.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13357">PHPBB3-13357</a>] - LOG_MOVED_TOPIC Language var missing</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13358">PHPBB3-13358</a>] - Add class for retrieving remote file data</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13362">PHPBB3-13362</a>] - The whole cache dir (excluding the .htaccess and index.html files) should be ignored by git</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13366">PHPBB3-13366</a>] - Dynamic config for &quot;plupload_last_gc&quot; is static</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13381">PHPBB3-13381</a>] - Code Sniffer complains about 3.1.2 migration</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13385">PHPBB3-13385</a>] - Add free result after running update query in $config-&gt;set_atomic()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13391">PHPBB3-13391</a>] - subsilver2 poll options must have a setting of 1 when editing a post</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13393">PHPBB3-13393</a>] - Invalid parameters passed to call_user_func_array in version_helper.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13396">PHPBB3-13396</a>] - Multibyte chars cause attachment upload to fail</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13400">PHPBB3-13400</a>] - Add a new message for high server loads during search</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13405">PHPBB3-13405</a>] - A typo in style_update_p1.php migration may prevent updating in some circumstances</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13406">PHPBB3-13406</a>] - ADD INDEX syntax may cause an error in earlier MySQL versions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13420">PHPBB3-13420</a>] - Prune users bug - filter all with 0 posts</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13427">PHPBB3-13427</a>] - Add template events to MCP front before/after each list</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13431">PHPBB3-13431</a>] - Wrong margin-left for RTL sites in Internet Explorer mobile view</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13432">PHPBB3-13432</a>] - Migrator module tool does not add the needed module language file</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13441">PHPBB3-13441</a>] - functions_convert fails to set global moderators default group</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13442">PHPBB3-13442</a>] - UTF-8 symbols for database host</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13448">PHPBB3-13448</a>] - \phpbb\messenger-&gt;template can't find email templates in extensions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13453">PHPBB3-13453</a>] - Sort params in Canonical URL</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13470">PHPBB3-13470</a>] - Mass email says &quot;user doesn't exist&quot; when all users is selected</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13486">PHPBB3-13486</a>] - Call to undefined method phpbb\db\driver\factory::sql_escpape() on database update</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13489">PHPBB3-13489</a>] - Allow the migrations to use the DI container</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13490">PHPBB3-13490</a>] - Unicode chars are broken in edit message after preview</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13492">PHPBB3-13492</a>] - Custom BBCode URL tokens do not support IDN</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13504">PHPBB3-13504</a>] - &quot;Array&quot; is displayed when searching, or when unanswered posts or active topics are selected</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13507">PHPBB3-13507</a>] - Large images in posts can cause horizontal scrollbars</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13511">PHPBB3-13511</a>] - The &quot;Unused Use&quot; Sniff is broken</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13530">PHPBB3-13530</a>] - Fix undefined variables in migrations and tests</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13534">PHPBB3-13534</a>] - Non-existent path in attachment settings causes travis failure</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13543">PHPBB3-13543</a>] - Slow tests fail on 3.1 and 3.2</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11033">PHPBB3-11033</a>] - FULLTEXT_SPHINX_NO_CONFIG_DATA references unrequired field</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12567">PHPBB3-12567</a>] - [proSilver] - viewtopic_body.html: Change 'back2top' anchor in to '#top'</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12926">PHPBB3-12926</a>] - Support for IDN (IRI)</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13266">PHPBB3-13266</a>] - Enabling twig dump function if DEBUG is defined</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13306">PHPBB3-13306</a>] - Add error level to the error collector</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13312">PHPBB3-13312</a>] - [event] - Add core event to the mass email form</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13368">PHPBB3-13368</a>] - Add the forum_data var to the core.viewforum_get_topic_ids_data event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13370">PHPBB3-13370</a>] - Add ability to call class methods more easily in the convertor framework</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13389">PHPBB3-13389</a>] - Replace pattern with path in routing.yml</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13402">PHPBB3-13402</a>] - Code Sniffer, unused use, check the function doc blocks</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13409">PHPBB3-13409</a>] - Add event to modify search parameters before searching</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13419">PHPBB3-13419</a>] - Add template event at the end of the file</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13422">PHPBB3-13422</a>] - Add new events in save custom cookies and set custom ban type</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13428">PHPBB3-13428</a>] - Add core events to memberlist.php for teampage</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13430">PHPBB3-13430</a>] - Add event for modifying prune SQL</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13435">PHPBB3-13435</a>] - Add core event to modify submit_post() sql data</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13437">PHPBB3-13437</a>] - [Template] - viewtopic_body_post_author_before/after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13439">PHPBB3-13439</a>] - [event] - Add event to run code at beginning of ACP users overview</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13440">PHPBB3-13440</a>] - [event] - Add event to process when a user fails a login attempt</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13449">PHPBB3-13449</a>] - Add viewforum.php core event after the topic data has been assigned to template </li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13466">PHPBB3-13466</a>] - Add bbcode_uid and bitfield to event core.message_parser_check_message</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13478">PHPBB3-13478</a>] - Add core event core.bbcode_cache_init_end</li>
+ </ul>
+ <h4>Sub-task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13141">PHPBB3-13141</a>] - Add an event to allow applying additional permissions to MCP access besides f_read</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13146">PHPBB3-13146</a>] - Add an event to allow changing the result of calling get_forums_visibility_sql()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13147">PHPBB3-13147</a>] - Add an event to change get_global_visibility_sql()'s results</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13148">PHPBB3-13148</a>] - Add an event to creating a final way to modify edit logs output</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13154">PHPBB3-13154</a>] - Add an event to edit user list for notifications</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13158">PHPBB3-13158</a>] - Add an event to allow adding extra auth checks when the user is posting</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13159">PHPBB3-13159</a>] - Add an event to allow extra auth checks when reporting posts</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13160">PHPBB3-13160</a>] - Add an event to viewtopic before viewing permissions</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12924">PHPBB3-12924</a>] - Meta tags should be self-closing</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13528">PHPBB3-13528</a>] - Boolean checkbox profile fields display &quot;1&quot; instead of selected value</li>
+ </ul>
+
+
+ <a name="v311"></a><h3>Changes since 3.1.1</h3>
+
+ <h4>Security</h4>
+ <ul>
+ <li>[SECURITY-171] - Version helper does not properly escape version info</li>
+ <li>[SECURITY-169] - AJAX request with unexpected referrer causes infinite loop</li>
+ </ul>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10442">PHPBB3-10442</a>] - XHTML is invalid when a forum link without redirect counter is present</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10744">PHPBB3-10744</a>] - Prevent user from installing styles with reserved directory names</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11863">PHPBB3-11863</a>] - User registration settings show incorrectly as disabled when board-wide emails are disabled</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12703">PHPBB3-12703</a>] - Notification System sends exact same SQL query multiple times</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13083">PHPBB3-13083</a>] - Language correction in NO_ENTRIES in acp_logs</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13100">PHPBB3-13100</a>] - Don't display &quot;delete reason&quot; dialog for shadow-topics</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13193">PHPBB3-13193</a>] - Post counts in Private Messages should link to the user's posts</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13197">PHPBB3-13197</a>] - Group Avatar not deleted from users</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13204">PHPBB3-13204</a>] - Login flood control error supresses incorrect credential error</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13209">PHPBB3-13209</a>] - Boolean (Yes/No) custom profile field doesn't show given name</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13216">PHPBB3-13216</a>] - Datetime tests fail randomly</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13228">PHPBB3-13228</a>] - &quot;Code: Select all&quot; font-size too big in Private Messages</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13239">PHPBB3-13239</a>] - Can´t upload Attachments on iOS</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13241">PHPBB3-13241</a>] - Topics are being duplicated in multipage forums</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13242">PHPBB3-13242</a>] - Validation error in Contact a Board Administrator</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13243">PHPBB3-13243</a>] - Debug error when clicking Re-check all versions on ACP manage extensions page</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13251">PHPBB3-13251</a>] - Database password containing special characters no longer accepted after upgrade to 3.1.0</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13253">PHPBB3-13253</a>] - MCP queue link in active topics search is missing</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13265">PHPBB3-13265</a>] - &quot;Edit profile&quot; link on view-own-profile page should only show if user has permission to edit</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13270">PHPBB3-13270</a>] - Upgrading from 3.0.12 to 3.1.1 does not display moderator soft delete permissions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13277">PHPBB3-13277</a>] - Move Up &amp; Down does not take work in Internet Explorer</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13280">PHPBB3-13280</a>] - $user-&gt;page['page'] - is invalid resulting in confirm_box() not working correctly</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13284">PHPBB3-13284</a>] - Message body not included in email topic message </li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13298">PHPBB3-13298</a>] - Use mysql_free_result to free result sets which were requested using mysql_query()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13300">PHPBB3-13300</a>] - Jabber field still shown in profile when feature is disabled</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13301">PHPBB3-13301</a>] - Apache Authentication is probably broken</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13303">PHPBB3-13303</a>] - Migrator caught in loop calculating dependencies</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13315">PHPBB3-13315</a>] - Upgrade from 3.0.12 to 3.1.1 resets CAPTCHA selection</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13316">PHPBB3-13316</a>] - reCAPTCHA does not work on secured connection</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13318">PHPBB3-13318</a>] - login_username doesn't have multibyte parameter set to true</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13323">PHPBB3-13323</a>] - posting.php can pass invalid auth option to acl_get()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13332">PHPBB3-13332</a>] - Insufficient information passed to password drivers for converted boards</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13337">PHPBB3-13337</a>] - Mark subforums read triggers error if subforums contain no topics</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13338">PHPBB3-13338</a>] - Some tests fail when run on their own</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13342">PHPBB3-13342</a>] - 310/captcha_plugins migration changes recaptcha to nogd</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13349">PHPBB3-13349</a>] - Incorrect entities used for breadcrumb separator in CSS</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13354">PHPBB3-13354</a>] - Unknown column 'topic_logs' in 'where clause' when deleting topic log in MCP</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13376">PHPBB3-13376</a>] - deregister_globals() does not work correctly when $_COOKIE['GLOBALS'] is specified</li>
+ </ul>
+
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12681">PHPBB3-12681</a>] - Cache the compiled routes and dump the url_generator</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12885">PHPBB3-12885</a>] - Wrong index page title when using Board Index text</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13023">PHPBB3-13023</a>] - [event] - Add Event posting_editor_buttons_custom_tags_before</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13133">PHPBB3-13133</a>] - Allow @vendor_extname in INCLUDECSS</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13182">PHPBB3-13182</a>] - [event] - Add posting.php core event to allow modifying the message before parsing</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13220">PHPBB3-13220</a>] - [event] - Add template events to memberlist_search.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13290">PHPBB3-13290</a>] - [event] - Add template event index_body_forumlist_body_after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13294">PHPBB3-13294</a>] - [event] - Add message_parser.php core event for additional message handling before parsing</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13297">PHPBB3-13297</a>] - Add unicode modifier to url/email regular expression patterns</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13309">PHPBB3-13309</a>] - [event] - Add ACP template event acp_email_options_after</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13310">PHPBB3-13310</a>] - [event] - Add core event core.acp_email_modify_sql</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13326">PHPBB3-13326</a>] - Add viewtopic_url variable to a viewtopic event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13328">PHPBB3-13328</a>] - [event] - Add event core.mcp_view_forum_modify_sql</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13347">PHPBB3-13347</a>] - [event] - Add new template events to acp_forums.html</li>
+ </ul>
+
+ <h4>New Feature</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12962">PHPBB3-12962</a>] - Use phantomjs and webdriver for UI testing</li>
+ </ul>
+
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13324">PHPBB3-13324</a>] - Composer no longer downloads sami/sami and fabpot/goutte</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13325">PHPBB3-13325</a>] - Make installing dependencies for tests more user friendly or optional</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13331">PHPBB3-13331</a>] - Sami run as part of phing MUST NOT switch branches</li>
+ </ul>
+
+
+ <a name="v310"></a><h3>Changes since 3.1.0</h3>
+
+ <h4>Security</h4>
+ <ul>
+ <li>[SECURITY-164] - Cross Site Scripting via PATH_INFO in page_name variable</li>
+ </ul>
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13248">PHPBB3-13248</a>] - Login functions need to use provider collection for retrieving provider</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13267">PHPBB3-13267</a>] - Automatic Update instructions indicate that only the install folder is necessary</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13268">PHPBB3-13268</a>] - MSSQL's get_existing_indexes() function improperly appends ternary result</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13271">PHPBB3-13271</a>] - Anonymous users can CC themselves on emails sent to admin via contact form</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13262">PHPBB3-13262</a>] - Add note to docs about htaccess file when upgrading 3.0 to 3.1</li>
+ </ul>
+
+ <a name="v310RC6"></a><h3>Changes since 3.1.0-RC6</h3>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13126">PHPBB3-13126</a>] - More detailed output for migrations needed</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13208">PHPBB3-13208</a>] - Security issues are not pulled into the changelog</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13210">PHPBB3-13210</a>] - Queue Cron Job checks for wrong config variable queue_interval_config</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13211">PHPBB3-13211</a>] - Add possibility to save migrations output to log</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13221">PHPBB3-13221</a>] - Can't upgrade to 3.1 from 3.0.11 and older</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13223">PHPBB3-13223</a>] - Using get_username_string() for email template variables causes HTML markup in emails</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13225">PHPBB3-13225</a>] - phpbb_hash() undefined in phpbb\db\migration\data\v30x\release_3_0_5_rc1.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13226">PHPBB3-13226</a>] - Stray $rank_img in memberlist.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13227">PHPBB3-13227</a>] - Remote avatars do not work with cURL wrapper</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13229">PHPBB3-13229</a>] - Memberlist is getting overloaded with redundant SQL queries</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13230">PHPBB3-13230</a>] - Deprecated phpbb_clean_path() does not work anymore</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13231">PHPBB3-13231</a>] - The migration contact_admin_form must depends on config_db_text</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13232">PHPBB3-13232</a>] - Email queue does not get run</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13234">PHPBB3-13234</a>] - Remember me cookie gets unset by admin reauthentication</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13207">PHPBB3-13207</a>] - Default subscription notification setting for new users does not include email</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13215">PHPBB3-13215</a>] - Update Symfony Components to 2.3.21</li>
+ </ul>
+
+ <a name="v310RC5"></a><h3>Changes since 3.1.0-RC5</h3>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12530">PHPBB3-12530</a>] - Visual confirmation is breaking layout in prosilver's mobile mode</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12568">PHPBB3-12568</a>] - docs/README.html references MODs instead of extensions</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13124">PHPBB3-13124</a>] - PHP event extractor too strict on doc blocks</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13138">PHPBB3-13138</a>] - Banned users cause infinite recursion</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13140">PHPBB3-13140</a>] - Header links don't re-appear on window size increase</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13161">PHPBB3-13161</a>] - PHP Warnings issued from phpbb database test case</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13163">PHPBB3-13163</a>] - Header Navbar Responsiveness Broken</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13164">PHPBB3-13164</a>] - Data sent to core.submit_post_end event does not include fresh post_visibility</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13168">PHPBB3-13168</a>] - Warning displayed in PHP 5.6 for mbstring.http_input</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13169">PHPBB3-13169</a>] - Responsive forms not displaying correctly in RTL</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13171">PHPBB3-13171</a>] - Can not delete posts and soft delete topics in MCP topic view</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13174">PHPBB3-13174</a>] - Minor HTML error in ucp_pm_viewmessage.html (needs closing &lt;/div&gt;)</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13177">PHPBB3-13177</a>] - Post count-based ranks do not display in viewtopic</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13181">PHPBB3-13181</a>] - Sphinx config template should use place holders for database credentials</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13186">PHPBB3-13186</a>] - Do not link post count to author search if search disabled</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13187">PHPBB3-13187</a>] - INSTALL.html is not valid HTML</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13188">PHPBB3-13188</a>] - Sphinx index() function triggers slow queries that time out replies</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13190">PHPBB3-13190</a>] - phpbb_session_login_keys_test::test_reset_keys fails on develop-ascraeus</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13194">PHPBB3-13194</a>] - BBCode isn't parsed when issuing a warning for a post</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13203">PHPBB3-13203</a>] - Use constant time comparison method for comparing password hashes</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13217">PHPBB3-13217</a>] - Remember me cookie leak</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13218">PHPBB3-13218</a>] - Missing token check in acp_styles</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13221">PHPBB3-13221</a>] - Can't upgrade to 3.1 from 3.0.11 and older</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13223">PHPBB3-13223</a>] - Using get_username_string() for email template variables causes HTML markup in emails</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12796">PHPBB3-12796</a>] - View own Profile should have an edit button</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12799">PHPBB3-12799</a>] - Place the events for f_brunoais_read_other</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13041">PHPBB3-13041</a>] - help_faq.php language file needs to be revised</li>
+ </ul>
+ <h4>New Feature</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13205">PHPBB3-13205</a>] - Add mark all PMs read button</li>
+ </ul>
+
+
+ <a name="v310RC4"></a><h3>Changes since 3.1.0-RC4</h3>
+
+ <h4>Bug</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10729">PHPBB3-10729</a>] - Post editor information is not updated when user being deleted with posts</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11224">PHPBB3-11224</a>] - SQL cache destroy does not destroy queries to tables joined</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12368">PHPBB3-12368</a>] - Updating database fails in upgrade from 3.0 when trying twice without purging the cache</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12489">PHPBB3-12489</a>] - Description for Contact link in custom profile fields</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12657">PHPBB3-12657</a>] - Add a test file for cli command cache:purge</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12858">PHPBB3-12858</a>] - 'GMT' is hard coded and not pulled from language files</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12889">PHPBB3-12889</a>] - multi-select element in unban email-adresses not limited in width</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13011">PHPBB3-13011</a>] - Javascript bug when selecting first one or two characters of a post</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13027">PHPBB3-13027</a>] - PM folder full percentage could be a bit more accurate</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13033">PHPBB3-13033</a>] - Duplicate entry SQL error thrown when running notifications_use_full_name migration</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13045">PHPBB3-13045</a>] - Pragma header not specified as response header by RFC2616</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13048">PHPBB3-13048</a>] - AJAX requests are being stored to session_page</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13055">PHPBB3-13055</a>] - String profile fields validation limits content to latin chars only</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13070">PHPBB3-13070</a>] - Wrong hook name is registered for array(template, display)</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13071">PHPBB3-13071</a>] - total_match_count is used before core.search_get_posts_data event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13080">PHPBB3-13080</a>] - Responsive design - language variable to long</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13082">PHPBB3-13082</a>] - Search box does not displayed proper in admin cp when no logs listed</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13085">PHPBB3-13085</a>] - Fix typo in oauth.php</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13086">PHPBB3-13086</a>] - Update ACP_MASS_EMAIL_EXPLAIN language key</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13087">PHPBB3-13087</a>] - WLM link is empty in viewtopic</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13097">PHPBB3-13097</a>] - Fix missing unit type in forms.css</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13104">PHPBB3-13104</a>] - Responsive tabs display bug in IE11</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13105">PHPBB3-13105</a>] - Future dates are displayed as &quot;Tomorrow&quot; with relative date format</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13111">PHPBB3-13111</a>] - Debug output when editing DropDown Custom Fields with multiple languages</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13113">PHPBB3-13113</a>] - The routes are not always generated for the good app.php file</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13116">PHPBB3-13116</a>] - Topic and post approval notifications got interchanged</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13117">PHPBB3-13117</a>] - Installation fails on MySQL 5.7 because auto_increment columns can be NULL</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13118">PHPBB3-13118</a>] - datetime.class parameter not used in user class</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13120">PHPBB3-13120</a>] - phpbb_load_extensions_autoloaders() doesn't work very well with the extensions behind a symlink</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13121">PHPBB3-13121</a>] - Customise Purge Cache always returns user to Styles page</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13125">PHPBB3-13125</a>] - Uploaded avatars are not displayed in IE &lt;= 7</li>
+ </ul>
+ <h4>Improvement</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12408">PHPBB3-12408</a>] - Add quick setting for &quot;default guest style&quot; to ACP board settings</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12985">PHPBB3-12985</a>] - Add event to modify the redirect after a successful login</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12993">PHPBB3-12993</a>] - Add event to get_user_rank() function</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13025">PHPBB3-13025</a>] - Add template events for buttons on viewforum and viewtopic</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13059">PHPBB3-13059</a>] - Add core event to generate_page_link() to allow modifying pagination URLs</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13072">PHPBB3-13072</a>] - Add total_match_count to core.search_get_topic_data event</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13077">PHPBB3-13077</a>] - Change module order in Customise tab for better usability</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13094">PHPBB3-13094</a>] - Remove the search box if there are no new posts to search for</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13107">PHPBB3-13107</a>] - Add template events to forum row in forumlist_body.html</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13108">PHPBB3-13108</a>] - Add core event to the parse_attachments() function to allow modifying files info</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13110">PHPBB3-13110</a>] - Add core event to the page_footer() function to allow handling overall output</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13122">PHPBB3-13122</a>] - phpbb_wrapper_gmgetdate_test intermittently fails</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13134">PHPBB3-13134</a>] - Add core event to the root of the function display_forums()</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13137">PHPBB3-13137</a>] - Remove schema.json from repository</li>
+ </ul>
+ <h4>Sub-task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12929">PHPBB3-12929</a>] - Add an event when getting the information for PM composal</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12930">PHPBB3-12930</a>] - Add an event to the query getting the post for quoting in a PM</li>
+ </ul>
+ <h4>Task</h4>
+ <ul>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10794">PHPBB3-10794</a>] - Make schema available at runtime</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12987">PHPBB3-12987</a>] - Cleanup the services.yml file</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13106">PHPBB3-13106</a>] - Remove the \phpbb\di\pass\kernel_pass class</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13119">PHPBB3-13119</a>] - Add events to mcp and acp ban modules</li>
+ <li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13123">PHPBB3-13123</a>] - Add events to allow post blocking and post pre/past processing</li>
+ </ul>
+
+ <a name="v310RC3"></a><h3>Changes since 3.1.0-RC3</h3>
<h4>Bug</h4>
<ul>
@@ -187,7 +546,7 @@
</ul>
- <a name="v310RC2"></a><h3>1.ii. Changes since 3.1.0-RC2</h3>
+ <a name="v310RC2"></a><h3>Changes since 3.1.0-RC2</h3>
<h4>Bug</h4>
<ul>
@@ -311,7 +670,7 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12948">PHPBB3-12948</a>] - Remove Travis CI &quot;broken opcache on PHP 5.5.7 and 5.5.8&quot; workaround.</li>
</ul>
- <a name="v310RC1"></a><h3>1.iii. Changes since 3.1.0-RC1</h3>
+ <a name="v310RC1"></a><h3>Changes since 3.1.0-RC1</h3>
<h4>Bug</h4>
<ul>
@@ -382,7 +741,7 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12829">PHPBB3-12829</a>] - Remove check for pgsql 8.3/8.2</li>
</ul>
- <a name="v310b4"></a><h3>1.iv. Changes since 3.1.0-b4</h3>
+ <a name="v310b4"></a><h3>Changes since 3.1.0-b4</h3>
<h4>Bug</h4>
<ul>
@@ -502,7 +861,7 @@
</ul>
- <a name="v310b3"></a><h3>1.v. Changes since 3.1.0-b3</h3>
+ <a name="v310b3"></a><h3>Changes since 3.1.0-b3</h3>
<h4>Bug</h4>
<ul>
@@ -609,7 +968,7 @@
</ul>
- <a name="v310b2"></a><h3>1.vi. Changes since 3.1.0-b2</h3>
+ <a name="v310b2"></a><h3>Changes since 3.1.0-b2</h3>
<h4>Bug</h4>
<ul>
@@ -774,7 +1133,7 @@
</ul>
- <a name="v310b1"></a><h3>1.vii. Changes since 3.1.0-b1</h3>
+ <a name="v310b1"></a><h3>Changes since 3.1.0-b1</h3>
<h4>Bug</h4>
<ul>
@@ -842,7 +1201,7 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12302">PHPBB3-12302</a>] - Upgrade composer.phar to 1.0.0-alpha8</li>
</ul>
- <a name="v310a3"></a><h3>1.viii. Changes since 3.1.0-a3</h3>
+ <a name="v310a3"></a><h3>Changes since 3.1.0-a3</h3>
<h4>Bug</h4>
<ul>
@@ -989,7 +1348,7 @@
</ul>
- <a name="v310a2"></a><h3>1.ix. Changes since 3.1.0-a2</h3>
+ <a name="v310a2"></a><h3>Changes since 3.1.0-a2</h3>
<h4>Bug</h4>
<ul>
@@ -1097,7 +1456,7 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12147">PHPBB3-12147</a>] - Remove Travis CI notification configuration</li>
</ul>
- <a name="v310a1"></a><h3>1.x. Changes since 3.1.0-a1</h3>
+ <a name="v310a1"></a><h3>Changes since 3.1.0-a1</h3>
<h4>Bug</h4>
<ul>
@@ -1173,7 +1532,7 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11998">PHPBB3-11998</a>] - Add console / command line client environment </li>
</ul>
- <a name="v30x"></a><h3>1.xi. Changes since 3.0.x</h3>
+ <a name="v30x"></a><h3>Changes since 3.0.x</h3>
<h4>Bug</h4>
<ul>
@@ -1854,7 +2213,152 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11913">PHPBB3-11913</a>] - Apply reorganisation of download.phpbb.com to build_announcement.php</li>
</ul>
- <a name="v3011"></a><h3>1.xii. Changes since 3.0.11</h3>
+ <a name="v3013"></a><h3>Changes since 3.0.13</h3>
+
+<h4>Bug</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12933">PHPBB3-12933</a>] - The search operator for partial matches does not work</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13549">PHPBB3-13549</a>] - Compare ORIG_PATH_INFO with SCRIPT_NAME for checking trailing paths</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13554">PHPBB3-13554</a>] - Advertisement of feature release in red indicates a problem</li>
+</ul>
+
+ <a name="v3012"></a><h3>Changes since 3.0.12</h3>
+
+<h4>Security</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13531">PHPBB3-13531</a>] - Disallow trailing paths (e.g. using the PATH_INFO feature) to prevent path-relative CSS injection</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13526">PHPBB3-13526</a>] - Correctly validate ucp_pm_options form key</li>
+</ul>
+<h4>Bug</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-6703">PHPBB3-6703</a>] - Problem with russian letter while converting from 2.0.x</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-8960">PHPBB3-8960</a>] - Allow changing allow_avatar_remote when images/avatars/upload is not writable</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9420">PHPBB3-9420</a>] - BBCode - Unable to use a proper URI token</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9724">PHPBB3-9724</a>] - Wrong return &quot;Return to ACP&quot;</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-9725">PHPBB3-9725</a>] - MSSQL Schema is not azure compatible</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10023">PHPBB3-10023</a>] - Password change requirement notification in UCP is not noticable</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10423">PHPBB3-10423</a>] - Searching for the term &quot;test *&quot; will highlight nearly every word and displays htmlspecialchars as htmlentities.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10442">PHPBB3-10442</a>] - XHTML is invalid when a forum link without redirect counter is present</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10687">PHPBB3-10687</a>] - UNABLE_GET_IMAGE_SIZE text misleading for remote avatars</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10729">PHPBB3-10729</a>] - Post editor information is not updated when user being deleted with posts</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10776">PHPBB3-10776</a>] - Grammar errors in docs/README.html</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10796">PHPBB3-10796</a>] - SQL Azure does not allow SELECT FROM sysfiles</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10851">PHPBB3-10851</a>] - HTML files containing certain tags being rejected as possible attack vectors with &quot;Check attachment file&quot; set to &quot;No&quot;</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10863">PHPBB3-10863</a>] - Permission mask does not accurately show some forum permissions if user has MOD parmissions</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10917">PHPBB3-10917</a>] - Updater notice &quot;Update files are out of date...&quot; when updating to unreleased version</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10985">PHPBB3-10985</a>] - Error bbcode.html not found when updating with custom style inheriting from prosilver</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11062">PHPBB3-11062</a>] - In Automatic Update, new language strings from install.php are only loaded from English</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11224">PHPBB3-11224</a>] - SQL cache destroy does not destroy queries to tables joined</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11288">PHPBB3-11288</a>] - &quot;Fulltext native&quot; search fooled by hyphens</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11480">PHPBB3-11480</a>] - Prevent Private Message system from returning &quot;Unknown folder&quot; when inbox folder is full</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11613">PHPBB3-11613</a>] - Cookies do not work for netbios domain</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11686">PHPBB3-11686</a>] - Not checking for phpBB Debug errors on functional tests</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11699">PHPBB3-11699</a>] - PHP Lint Test should exclude selected subdirectories of the build directory.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11726">PHPBB3-11726</a>] - Don't run lint tests on Travis on postgres</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11762">PHPBB3-11762</a>] - generate_text_for_display() treats &quot;0&quot; as an empty string</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11789">PHPBB3-11789</a>] - Inline css with color value in subsilver2</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11794">PHPBB3-11794</a>] - Coding Guidelines document says to place a comma after every array element, but fails to do so itself</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11799">PHPBB3-11799</a>] - Anti Abuse Headers missing for sendpassword</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11811">PHPBB3-11811</a>] - Chrome 30 adds outline to focused elements</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11821">PHPBB3-11821</a>] - Wrong comma usage &quot;You are receiving this notification&quot;</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11823">PHPBB3-11823</a>] - Travis-CI webserver not matching PHP files with anything after the .php</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11829">PHPBB3-11829</a>] - Closed reports may seem open in detailed view</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11860">PHPBB3-11860</a>] - .htaccess not working for Apache 2.4</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11864">PHPBB3-11864</a>] - Do not call exit after display_progress_bar in acp_forums</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11879">PHPBB3-11879</a>] - Compatibility error in forum_fn.js: .live should be replaced with .on</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11968">PHPBB3-11968</a>] - Travis Image are broken due to repository rename</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12037">PHPBB3-12037</a>] - acp_inactive.html has hard-coded text</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12048">PHPBB3-12048</a>] - Custom BBCodes Fail to Render Language Strings with a Number</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12061">PHPBB3-12061</a>] - Keyboard shortcut alt+h doesn't work properly in firefox</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12072">PHPBB3-12072</a>] - Missing word &quot;send&quot; in comment in schema_data.sql</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12093">PHPBB3-12093</a>] - IE 11 javascript selection is no longer supported</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12118">PHPBB3-12118</a>] - Add noindex meta tag to subsilver2 pm/topic view-print template</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12119">PHPBB3-12119</a>] - Remove keywords and description meta tags from prosilver view-print templates</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12120">PHPBB3-12120</a>] - Update docs/AUTHORS for 3.0.13-RC1</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12140">PHPBB3-12140</a>] - Avoid endless loop in build script</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12161">PHPBB3-12161</a>] - build/save directories are no longer created</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12162">PHPBB3-12162</a>] - Binary files missing from update packages</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12176">PHPBB3-12176</a>] - No error shown when attempting to delete a founder</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12186">PHPBB3-12186</a>] - MCP should open &quot;Reported posts&quot; instead of PM Reports</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12188">PHPBB3-12188</a>] - Add php 5.6 to travis tests</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12202">PHPBB3-12202</a>] - Variables read from style.cfg etc. should be htmlspecialchared</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12205">PHPBB3-12205</a>] - Custom Profile Field display bug</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12210">PHPBB3-12210</a>] - dbtools::sql_create_table incorrectly throws error related to auto-increment length on non auto-increment fields</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12310">PHPBB3-12310</a>] - SMTP username and password should not autocomplete during install</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12316">PHPBB3-12316</a>] - develop-ascraeus build status missing from &quot;Automated Testing&quot; section in README.md</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12353">PHPBB3-12353</a>] - User attachments in ACP are not displaying every attachment</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12359">PHPBB3-12359</a>] - Day and Month of Birthday Misaligned When Editing</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12381">PHPBB3-12381</a>] - Broken error message when selecting invalid DB driver</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12397">PHPBB3-12397</a>] - db_tools::sql_unique_index_exists() has wrong doc block</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12429">PHPBB3-12429</a>] - Update phpunit to 3.8+</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12467">PHPBB3-12467</a>] - Add config_*.php and tests_config_*.php to .gitignore</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12472">PHPBB3-12472</a>] - Set fast finish for .travis.yml</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12485">PHPBB3-12485</a>] - Broken tests due to absolute exclude</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12492">PHPBB3-12492</a>] - DB_TEST: Special chars are not supported.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12540">PHPBB3-12540</a>] - WRONG_FILESIZE contains broken placeholders</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12660">PHPBB3-12660</a>] - Undefined offset error when phpinfo() disabled and debug enabled</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12695">PHPBB3-12695</a>] - Undefined index: MISSING_INLINE_ATTACHMENT notice given when viewing post details</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12720">PHPBB3-12720</a>] - Git commit hook should not require commit message to start with a capital letter</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12741">PHPBB3-12741</a>] - Functional tests on Travis fail since php update last night</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12755">PHPBB3-12755</a>] - Remote upload stuck in infinite loop if server sends keep-alive</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13086">PHPBB3-13086</a>] - Update ACP_MASS_EMAIL_EXPLAIN language key</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13096">PHPBB3-13096</a>] - ldap_escape() added to PHP 5.6.0</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13138">PHPBB3-13138</a>] - Banned users cause infinite recursion</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13168">PHPBB3-13168</a>] - Warning displayed in PHP 5.6 for mbstring.http_input</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13234">PHPBB3-13234</a>] - Remember me cookie gets unset by admin reauthentication</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13341">PHPBB3-13341</a>] - Tests fail when generating coverage report</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13376">PHPBB3-13376</a>] - deregister_globals() does not work correctly when $_COOKIE['GLOBALS'] - is specified</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13519">PHPBB3-13519</a>] - Correctly validate imagick path as path and not string</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13523">PHPBB3-13523</a>] - PHP 5.2 Unit Tests no longer work due to deprecated PHPUnit PEAR channel</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13527">PHPBB3-13527</a>] - Escape information received from version server</li>
+</ul>
+<h4>Improvement</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10037">PHPBB3-10037</a>] - Add Smiley Buttons in Signature Editor</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10174">PHPBB3-10174</a>] - Rename &quot;Ban usernames&quot; to &quot;Ban users&quot; in ACP</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10549">PHPBB3-10549</a>] - Languages variables should be used, not hardcoded</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10555">PHPBB3-10555</a>] - Copyright notice in overall_header.html is not translatable</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10945">PHPBB3-10945</a>] - Show entered search query in the search box when no results are found.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11254">PHPBB3-11254</a>] - Check CRLF line endings in the test suite</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11295">PHPBB3-11295</a>] - Drop tables for postgres in the test suite</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11297">PHPBB3-11297</a>] - Running tests doc should mention dbunit dependency</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11704">PHPBB3-11704</a>] - phing build script does not include vendor folder, even if there are dependencies</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11766">PHPBB3-11766</a>] - Remove Quote and Edit button when topic is lock</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11801">PHPBB3-11801</a>] - missing semi colons in css</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11814">PHPBB3-11814</a>] - Topic reply notification email text change</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12035">PHPBB3-12035</a>] - Add a link to user's posts in the ACP user overview page</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12106">PHPBB3-12106</a>] - Document exceptions to &quot;Disable Board&quot; in ACP.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12146">PHPBB3-12146</a>] - Add color demo when editing a group from the UCP</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12247">PHPBB3-12247</a>] - include poster's username in email notifications of posts that get approved by moderators</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12259">PHPBB3-12259</a>] - Too many redundant tests are run on Travis</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12468">PHPBB3-12468</a>] - Allow mbstring.http_input='' besides 'pass' for PHP 5.6 compatibility</li>
+</ul>
+<h4>Task</h4>
+<ul>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10839">PHPBB3-10839</a>] - Remove phpunit.xml.functional and always include functional tests</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11509">PHPBB3-11509</a>] - Travis should check commit message format</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11876">PHPBB3-11876</a>] - Upgrade package checksums from MD5 to SHA256</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11877">PHPBB3-11877</a>] - Create package download links and checksums for announcement via script</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11920">PHPBB3-11920</a>] - Add MariaDB tests to Travis-CI</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11951">PHPBB3-11951</a>] - Add MariaDB to supported RDBMS list</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11970">PHPBB3-11970</a>] - Use 'set -x' in Travis CI setup scripts</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12046">PHPBB3-12046</a>] - Use PHP_BINARY environment variable in lint unit test</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12056">PHPBB3-12056</a>] - Make sure each unit test runs on its own</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12147">PHPBB3-12147</a>] - Remove Travis CI notification configuration</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12302">PHPBB3-12302</a>] - Upgrade composer.phar to 1.0.0-alpha8</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12318">PHPBB3-12318</a>] - Correctly setup HHVM functional tests on Travis CI</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12319">PHPBB3-12319</a>] - Backport Travis CI HHVM environment enabling to develop-olympus.</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12320">PHPBB3-12320</a>] - No longer allow Travis CI HHVM environment to fail</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12341">PHPBB3-12341</a>] - Add tests for get_username_string()</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12384">PHPBB3-12384</a>] - Run Travis CI HHVM tests against MySQLi instead of MySQL</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12417">PHPBB3-12417</a>] - hhvm-nightly 2014.04.16~precise breaks tests</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12495">PHPBB3-12495</a>] - Add Sami to composer dependencies and build script</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12582">PHPBB3-12582</a>] - Strip away copyrighted ICC profile from images</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-12917">PHPBB3-12917</a>] - Move commit check and file executable checks to 5.3.3 build on travis</li>
+<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-13324">PHPBB3-13324</a>] - Composer no longer downloads sami/sami and fabpot/goutte</li>
+</ul>
+
+ <a name="v3011"></a><h3>Changes since 3.0.11</h3>
<h4>Bug</h4>
<ul>
@@ -2009,7 +2513,7 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-11753">PHPBB3-11753</a>] - Upgrade mysql_upgrader.php schema data.</li>
</ul>
- <a name="v3010"></a><h3>1.xiii. Changes since 3.0.10</h3>
+ <a name="v3010"></a><h3>Changes since 3.0.10</h3>
<h4>Bug</h4>
<ul>
@@ -2134,7 +2638,7 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10909">PHPBB3-10909</a>] - Update Travis Test Configuration: Travis no longer supports PHP 5.3.2</li>
</ul>
- <a name="v309"></a><h3>1.xiv. Changes since 3.0.9</h3>
+ <a name="v309"></a><h3>Changes since 3.0.9</h3>
<h4>Bug</h4>
<ul>
@@ -2270,7 +2774,7 @@
<li>[<a href="http://tracker.phpbb.com/browse/PHPBB3-10480">PHPBB3-10480</a>] - Automate changelog building</li>
</ul>
- <a name="v308"></a><h3>1.xv. Changes since 3.0.8</h3>
+ <a name="v308"></a><h3>Changes since 3.0.8</h3>
<h4> Bug
</h4>
@@ -2335,7 +2839,7 @@
</li>
<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9924'>PHPBB3-9924</a>] - $template-&gt;display hook does not pass $template instance
</li>
-<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9925'>PHPBB3-9925</a>] - prosilver logo margin bug in IE 6-7-8
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9925'>PHPBB3-9925</a>] - prosilver logo margin bug in IE 6-7-8
</li>
<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9928'>PHPBB3-9928</a>] - Do not link &quot;login to your board&quot; to the &quot;send statistics&quot; page after completed update.
</li>
@@ -2343,7 +2847,7 @@
</li>
<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9932'>PHPBB3-9932</a>] - The Bing bot is not added when converting.
</li>
-<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9933'>PHPBB3-9933</a>] - Wrong handling of consecutive multiple asterisks in word censor
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9933'>PHPBB3-9933</a>] - Wrong handling of consecutive multiple asterisks in word censor
</li>
<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9934'>PHPBB3-9934</a>] - Mass Mail missing under the system tab on a fresh install
</li>
@@ -2355,7 +2859,7 @@
</li>
<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9948'>PHPBB3-9948</a>] - Inline quicktime files won&#39;t display
</li>
-<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9949'>PHPBB3-9949</a>] - $user-&gt;lang() is not handling arguments as per documentation
+<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9949'>PHPBB3-9949</a>] - $user-&gt;lang() is not handling arguments as per documentation
</li>
<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-9950'>PHPBB3-9950</a>] - Problem with localized button images after uprading from 3.0.7-PL1 to 3.0.8
</li>
@@ -2518,7 +3022,7 @@
<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-10250'>PHPBB3-10250</a>] - phpBB Logo needs the Registered Trademark Symbol
</li>
</ul>
-
+
<h4> Improvement
</h4>
<ul>
@@ -2575,7 +3079,7 @@
<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-10186'>PHPBB3-10186</a>] - UCP signature panel displays when not authed for signatures
</li>
</ul>
-
+
<h4> New Feature
</h4>
<ul>
@@ -2586,7 +3090,7 @@
<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-10110'>PHPBB3-10110</a>] - Redis caching module
</li>
</ul>
-
+
<h4> Task
</h4>
<ul>
@@ -2625,7 +3129,7 @@
<li>[<a href='http://tracker.phpbb.com/browse/PHPBB3-10107'>PHPBB3-10107</a>] - Improve docs for non-apache webserver configuration
</li>
</ul>
-
+
<h4> Sub-task
</h4>
<ul>
@@ -2637,8 +3141,8 @@
</li>
</ul>
+ <a name="v307-PL1"></a><h3>Changes since 3.0.7-PL1</h3>
- <a name="v307-PL1"></a><h3>1.xvi. Changes since 3.0.7-PL1</h3>
<h4> Security
</h4>
<ul>
@@ -3095,14 +3599,13 @@
</li>
</ul>
-
- <a name="v307"></a><h3>1.xvii. Changes since 3.0.7</h3>
+ <a name="v307"></a><h3>Changes since 3.0.7</h3>
<ul>
<li>[Sec] Do not expose forum content of forums with ACL entries but no actual permission in ATOM Feeds. (Bug #58595)</li>
</ul>
- <a name="v306"></a><h3>1.xviii. Changes since 3.0.6</h3>
+ <a name="v306"></a><h3>Changes since 3.0.6</h3>
<ul>
<li>[Fix] Allow ban reason and length to be selected and copied in ACP and subsilver2 MCP. (Bug #51095)</li>
@@ -3206,7 +3709,7 @@
</ul>
- <a name="v305"></a><h3>1.xix. Changes since 3.0.5</h3>
+ <a name="v305"></a><h3>Changes since 3.0.5</h3>
<ul>
<li>[Fix] Allow whitespaces in avatar gallery names. (Bug #44955)</li>
@@ -3428,7 +3931,7 @@
<li>[Feature] Send anonymous statistical information to phpBB on installation and update (optional).</li>
</ul>
- <a name="v304"></a><h3>1.xx. Changes since 3.0.4</h3>
+ <a name="v304"></a><h3>Changes since 3.0.4</h3>
<ul>
<li>[Fix] Delete user entry from ban list table upon user deletion (Bug #40015 - Patch by TerraFrost)</li>
@@ -3517,7 +4020,7 @@
<li>[Sec] Only use forum id supplied for posting if global announcement detected. (Reported by nickvergessen)</li>
</ul>
- <a name="v303"></a><h3>1.xxi. Changes since 3.0.3</h3>
+ <a name="v303"></a><h3>Changes since 3.0.3</h3>
<ul>
<li>[Fix] Allow mixed-case template directories to be inherited (Bug #36725)</li>
@@ -3549,7 +4052,7 @@
<li>[Sec] Ask for forum password if post within passworded forum quoted in private message. (Reported by nickvergessen)</li>
</ul>
- <a name="v302"></a><h3>1.xxii. Changes since 3.0.2</h3>
+ <a name="v302"></a><h3>Changes since 3.0.2</h3>
<ul>
<li>[Fix] Correctly set topic starter if first post in topic removed (Bug #30575 - Patch by blueray2048)</li>
@@ -3648,7 +4151,7 @@
<li>[Sec Precaution] Stricter validation of the HTTP_HOST header (Thanks to Techie-Micheal et al for pointing out possible issues in derived code)</li>
</ul>
- <a name="v301"></a><h3>1.xxiii. Changes since 3.0.1</h3>
+ <a name="v301"></a><h3>Changes since 3.0.1</h3>
<ul>
<li>[Fix] Ability to set permissions on non-mysql dbms (Bug #24955)</li>
@@ -3696,7 +4199,7 @@
<li>[Sec] Only allow urls gone through redirect() being used within login_box(). (thanks nookieman)</li>
</ul>
- <a name="v300"></a><h3>1.xxiv. Changes since 3.0.0</h3>
+ <a name="v300"></a><h3>Changes since 3.0.0</h3>
<ul>
<li>[Change] Validate birthdays (Bug #15004)</li>
@@ -3767,7 +4270,7 @@
<li>[Fix] Find and display colliding usernames correctly when converting from one database to another (Bug #23925)</li>
</ul>
- <a name="v30rc8"></a><h3>1.xxv. Changes since 3.0.RC8</h3>
+ <a name="v30rc8"></a><h3>Changes since 3.0.RC8</h3>
<ul>
<li>[Fix] Cleaned usernames contain only single spaces, so &quot;a_name&quot; and &quot;a__name&quot; are treated as the same name (Bug #15634)</li>
@@ -3776,7 +4279,7 @@
<li>[Fix] Call garbage_collection() within database updater to correctly close connections (affects Oracle for example)</li>
</ul>
- <a name="v30rc7"></a><h3>1.xxvi. Changes since 3.0.RC7</h3>
+ <a name="v30rc7"></a><h3>Changes since 3.0.RC7</h3>
<ul>
<li>[Fix] Fixed MSSQL related bug in the update system</li>
@@ -3811,7 +4314,7 @@
<li>[Fix] No duplication of active topics (Bug #15474)</li>
</ul>
- <a name="v30rc6"></a><h3>1.xxvii. Changes since 3.0.RC6</h3>
+ <a name="v30rc6"></a><h3>Changes since 3.0.RC6</h3>
<ul>
<li>[Fix] Submitting language changes using acp_language (Bug #14736)</li>
@@ -3821,7 +4324,7 @@
<li>[Fix] Able to request new password (Bug #14743)</li>
</ul>
- <a name="v30rc5"></a><h3>1.xxviii. Changes since 3.0.RC5</h3>
+ <a name="v30rc5"></a><h3>Changes since 3.0.RC5</h3>
<ul>
<li>[Feature] Removing constant PHPBB_EMBEDDED in favor of using an exit_handler(); the constant was meant to achive this more or less.</li>
@@ -3884,7 +4387,7 @@
<li>[Sec] New password hashing mechanism for storing passwords (#i42)</li>
</ul>
- <a name="v30rc4"></a><h3>1.xxix. Changes since 3.0.RC4</h3>
+ <a name="v30rc4"></a><h3>Changes since 3.0.RC4</h3>
<ul>
<li>[Fix] MySQL, PostgreSQL and SQLite related database fixes (Bug #13862)</li>
@@ -3935,7 +4438,7 @@
<li>[Fix] odbc_autocommit causing existing result sets to be dropped (Bug #14182)</li>
</ul>
- <a name="v30rc3"></a><h3>1.xxx. Changes since 3.0.RC3</h3>
+ <a name="v30rc3"></a><h3>Changes since 3.0.RC3</h3>
<ul>
<li>[Fix] Fixing some subsilver2 and prosilver style issues</li>
@@ -4044,7 +4547,7 @@
</ul>
- <a name="v30rc2"></a><h3>1.xxxi. Changes since 3.0.RC2</h3>
+ <a name="v30rc2"></a><h3>Changes since 3.0.RC2</h3>
<ul>
<li>[Fix] Re-allow searching within the memberlist</li>
@@ -4090,7 +4593,7 @@
</ul>
- <a name="v30rc1"></a><h3>1.xxxii. Changes since 3.0.RC1</h3>
+ <a name="v30rc1"></a><h3>Changes since 3.0.RC1</h3>
<ul>
<li>[Fix] (X)HTML issues within the templates (Bug #11255, #11255)</li>
@@ -4213,7 +4716,7 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -4221,7 +4724,7 @@
<a name="disclaimer"></a><h2>2. Copyright and disclaimer</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -4231,7 +4734,7 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- END DOCUMENT -->
diff --git a/phpBB/docs/CREDITS.txt b/phpBB/docs/CREDITS.txt
index c0b1d4dbe2..e3f2b325e8 100644
--- a/phpBB/docs/CREDITS.txt
+++ b/phpBB/docs/CREDITS.txt
@@ -24,10 +24,10 @@ phpBB Lead Developer: naderman (Nils Adermann)
phpBB Developers: bantu (Andreas Fischer)
dhruv.goel92 (Dhruv Goel)
- EXreaction (Nathan Guse)
+ Elsensee (Oliver Schramm)
marc1706 (Marc Alexander)
nickvergessen (Joas Schilling)
- nicofuma (Tristan Darricau)
+ Nicofuma (Tristan Darricau)
prototech (Cesar Gallegos)
For a list of phpBB Team members, please see:
@@ -53,6 +53,7 @@ phpBB Developers: A_Jelly_Doughnut (Josh Woody) [01/2010 - 11/2010]
ckwalsh (Cullen Walsh) [01/2010 - 07/2011]
DavidMJ (David M.) [12/2005 - 08/2009]
dhn (Dominik Dröscher) [05/2007 - 01/2011]
+ EXreaction (Nathan Guse) [07/2012 - 05/2014]
GrahamJE (Graham Eames) [09/2005 - 11/2006]
igorw (Igor Wiedler) [08/2010 - 02/2013]
imkingdavid (David King) [11/2012 - 06/2014]
diff --git a/phpBB/docs/FAQ.html b/phpBB/docs/FAQ.html
index 1180c898dd..0b3b421e72 100644
--- a/phpBB/docs/FAQ.html
+++ b/phpBB/docs/FAQ.html
@@ -4,9 +4,9 @@
<meta charset="utf-8">
<meta name="keywords" content="" />
<meta name="description" content="phpBB 3.1.x frequently asked questions" />
-<title>phpBB3 &bull; FAQ</title>
+<title>phpBB &bull; FAQ</title>
-<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
+<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
</head>
@@ -16,16 +16,16 @@
<a id="top" name="top" accesskey="t"></a>
<div id="page-header">
<div class="headerbar">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div id="doc-description">
- <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a>
+ <a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a>
<h1>phpBB 3.1.x FAQ</h1>
<p>phpBB 3.1.x frequently asked questions</p>
<p style="display: none;"><a href="#start_here">Skip</a></p>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
</div>
@@ -35,12 +35,17 @@
<!-- BEGIN DOCUMENT -->
- <p>This is a very basic Frequently Asked Questions (FAQ) page which attempts to answer some of the more commonly asked questions. It is by no means exhaustive and should be used in combination with the 'built-in' User FAQ within phpBB3, the community forums and our IRC channel (see <a href="README.html">README</a> for details).</p>
+ <p class="paragraph main-description">
+ This is a very basic Frequently Asked Questions (FAQ) page which attempts to answer some of the
+ more commonly asked questions. It is by no means exhaustive and should be used in combination with
+ the 'built-in' User FAQ within phpBB3, the community forums and our IRC channel
+ (see <a href="README.html">README</a> for details).
+ </p>
<h1>FAQ</h1>
<div class="paragraph menu">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -66,7 +71,7 @@
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -74,11 +79,11 @@
<a name="install"></a><h2>I am finding phpBB too difficult to install. Will you do it for me?</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
-<p>Simple answer, no we will not. We are not being difficult when we say this we are actually trying to help you. phpBB has a reputation for being easy to install, that reputation is we believe well deserved. It is a simple process of unarchiving a single file, uploading the resulting directory/files to their intended location and entering some data in a web based form. The sequence of events, what to type where, etc. is covered in detail in the accompanying <a href="INSTALL.html">INSTALL.html</a> documentation. If you cannot install phpBB3 the chances are you will be unable to administer or update it.</p>
+<p>Simple answer, no we will not. We are not being difficult when we say this we are actually trying to help you. phpBB has a reputation for being easy to install, that reputation is we believe well deserved. It is a simple process of unarchiving a single file, uploading the resulting directory/files to their intended location and entering some data in a web based form. The sequence of events, what to type where, etc. is covered in detail in the accompanying <a href="INSTALL.html">INSTALL.html</a> documentation. If you cannot install phpBB the chances are you will be unable to administer or update it.</p>
<p>There are people, companies (unrelated to your hosting provider), etc. that will install your forum, either for free or for a payment. We do not recommend you make use of these offers. Unless the service is provided by your hosting company you will have to divulge passwords and other sensitive details. If you did not know how to use an ATM would you give a passer-by your bank card and PIN and ask them to show you what to do? No, probably not! The same applies to your hosting account details!</p>
@@ -88,7 +93,7 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -99,7 +104,7 @@ A board is dealing in warez/porn/etc., you need to prevent them doing this!<br /
I want to sue you because i think you host an illegal board!</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -111,7 +116,7 @@ I want to sue you because i think you host an illegal board!</h2>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -119,7 +124,7 @@ I want to sue you because i think you host an illegal board!</h2>
<a name="viewonline"></a><h2>According to viewonline a user is doing/reading something they should not be able to!</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -131,7 +136,7 @@ I want to sue you because i think you host an illegal board!</h2>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -139,7 +144,7 @@ I want to sue you because i think you host an illegal board!</h2>
<a name="mail"></a><h2>I keep getting Mail sending errors when I (or my users) post/send PM's/etc.!</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -151,7 +156,7 @@ I want to sue you because i think you host an illegal board!</h2>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -159,7 +164,7 @@ I want to sue you because i think you host an illegal board!</h2>
<a name="mail_language"></a><h2>My users are complaining that emails are not in their selected language!</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -171,7 +176,7 @@ I want to sue you because i think you host an illegal board!</h2>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -179,7 +184,7 @@ I want to sue you because i think you host an illegal board!</h2>
<a name="aol_browser"></a><h2>My AOL based users keep getting logged out!</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -193,7 +198,7 @@ I want to sue you because i think you host an illegal board!</h2>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -201,7 +206,7 @@ I want to sue you because i think you host an illegal board!</h2>
<a name="avatars"></a><h2>I am unable to upload avatars from my computer, regardless of the settings.</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -213,7 +218,7 @@ I want to sue you because i think you host an illegal board!</h2>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -221,7 +226,7 @@ I want to sue you because i think you host an illegal board!</h2>
<a name="gallery_avatars"></a><h2>I just cannot get gallery avatars to appear!</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -231,7 +236,7 @@ I want to sue you because i think you host an illegal board!</h2>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -239,17 +244,17 @@ I want to sue you because i think you host an illegal board!</h2>
<a name="permissions"></a><h2>How do I use/set permissions?</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
-<p>Please read the paragraph about permissions in our extensive <a href="https://www.phpbb.com/support/documentation/3.0/">online documentation</a>.</p>
+<p>Please read the paragraph about permissions in our extensive <a href="https://www.phpbb.com/support/docs/en/3.1/ug/">online documentation</a>.</p>
</div>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -257,7 +262,7 @@ I want to sue you because i think you host an illegal board!</h2>
<a name="login_issues"></a><h2>I (or my users) cannot stay logged in to the forum!</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -269,7 +274,7 @@ I want to sue you because i think you host an illegal board!</h2>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -277,7 +282,7 @@ I want to sue you because i think you host an illegal board!</h2>
<a name="logout_issues"></a><h2>My users are complaining about being logged out too quickly!</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -287,7 +292,7 @@ I want to sue you because i think you host an illegal board!</h2>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -295,11 +300,11 @@ I want to sue you because i think you host an illegal board!</h2>
<a name="not_answered"></a><h2>My question isn't answered here!</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
-<p>Please read our <a href="https://www.phpbb.com/support/documentation/3.0/">extensive user documentation</a> first, it may just explain what you want to know.</p>
+<p>Please read our <a href="https://www.phpbb.com/support/docs/en/3.1/ug/">extensive user documentation</a> first, it may just explain what you want to know.</p>
<p>Feel free to search our community forum for the information you require. <strong>PLEASE DO NOT</strong> post your question without having first used search, chances are someone has already asked and answered your question. You can find our board here:</p>
@@ -309,7 +314,7 @@ I want to sue you because i think you host an illegal board!</h2>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -317,7 +322,7 @@ I want to sue you because i think you host an illegal board!</h2>
<a name="disclaimer"></a><h2>Copyright and disclaimer</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -327,7 +332,7 @@ I want to sue you because i think you host an illegal board!</h2>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- END DOCUMENT -->
diff --git a/phpBB/docs/INSTALL.html b/phpBB/docs/INSTALL.html
index e3e12a3176..4050636b38 100644
--- a/phpBB/docs/INSTALL.html
+++ b/phpBB/docs/INSTALL.html
@@ -4,9 +4,9 @@
<meta charset="utf-8">
<meta name="keywords" content="" />
<meta name="description" content="phpBB 3.1.x Installation, updating and conversion informations" />
-<title>phpBB3 &bull; Install</title>
+<title>phpBB &bull; Install</title>
-<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
+<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
</head>
@@ -16,16 +16,16 @@
<a id="top" name="top" accesskey="t"></a>
<div id="page-header">
<div class="headerbar">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div id="doc-description">
- <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a>
+ <a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a>
<h1>phpBB 3.1.x Install</h1>
<p>phpBB 3.1.x Installation, updating and conversion informations</p>
<p style="display: none;"><a href="#start_here">Skip</a></p>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
</div>
@@ -35,16 +35,22 @@
<!-- BEGIN DOCUMENT -->
-<p><strong>Please read this document completely before proceeding with installation, updating or converting.</strong></p>
-
-<p>This document will walk you through the basics on installing, updating and converting the forum software.</p>
+<div class="paragraph">
+ <p><strong>Please read this document completely before proceeding with installation, updating or converting.</strong></p>
-<p>A basic overview of running phpBB3 can be found in the accompanying <a href="README.html">README</a> file. Please ensure you read that document in addition to this! For more detailed information on using, installing, updating and converting phpBB3 you should read <a href="https://www.phpbb.com/support/documentation/3.0/">the documentation</a> available online.</p>
+ <p>This document will walk you through the basics on installing, updating and converting the forum software.</p>
+ <p>
+ A basic overview of running phpBB can be found in the accompanying <a href="README.html">README</a> file.
+ Please ensure you read that document in addition to this! For more detailed information on using, installing,
+ updating and converting phpBB you should read <a href="https://www.phpbb.com/support/docs/en/3.1/ug/">the documentation</a>
+ available online.
+ </p>
+</div>
<h1>Install</h1>
<div class="paragraph menu">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -82,7 +88,7 @@
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -90,7 +96,7 @@
<a name="quickinstall"></a><h2>1. Quick install</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -114,7 +120,7 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -122,7 +128,7 @@
<a name="require"></a><h2>2. Requirements</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -142,10 +148,11 @@
</ul>
</li>
<li><strong>PHP 5.3.3+</strong> with support for the database you intend to use.</li>
- <li>The following PHP modules are required:</li>
+ <li>The following PHP modules are required:
<ul>
<li>json</li>
</ul>
+ </li>
<li>getimagesize() function must be enabled.</li>
<li>Presence of the following modules within PHP will provide access to additional features, but they are not required:
<ul>
@@ -164,7 +171,7 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -172,27 +179,27 @@
<a name="install"></a><h2>3. New installation</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <p>Installation of phpBB3 will vary according to your server and database. If you have <em>shell access</em> to your account (via telnet or ssh for example) you may want to upload the entire phpBB3 archive (in binary mode!) to a directory on your host and unarchive it there.</p>
+ <p>Installation of phpBB will vary according to your server and database. If you have <em>shell access</em> to your account (via telnet or ssh for example) you may want to upload the entire phpBB archive (in binary mode!) to a directory on your host and unarchive it there.</p>
- <p>If you do not have shell access or do not wish to use it, you will need to decompress the phpBB3 archive to a local directory on your system using your favourite compression program, e.g. winzip, rar, zip, etc. From there you must FTP <strong>ALL</strong> the files it contains (being sure to retain the directory structure and filenames) to your host. Please ensure that the cases of filenames are retained, do <strong>NOT</strong> force filenames to all lower or upper case as doing so will cause errors later.</p>
+ <p>If you do not have shell access or do not wish to use it, you will need to decompress the phpBB archive to a local directory on your system using your favourite compression program, e.g. winzip, rar, zip, etc. From there you must FTP <strong>ALL</strong> the files it contains (being sure to retain the directory structure and filenames) to your host. Please ensure that the cases of filenames are retained, do <strong>NOT</strong> force filenames to all lower or upper case as doing so will cause errors later.</p>
<p>All .php, .sql, .cfg, .css, .js, .html, .htaccess and .txt files should be uploaded in <strong>ASCII</strong> mode, while all graphics should be uploaded in <strong>BINARY</strong> mode. If you are unfamiliar with what this means please refer to your FTP client documentation. In most cases this is all handled transparantly by your ftp client, but if you encounter problems later you should be sure the files were uploaded correctly as described here.</p>
- <p>phpBB3 comes supplied with British English as its standard language. However, a number of separate packs for different languages are available. If you are not a native English speaker you may wish to install one or more of these packages before continuing. The installation process below will allow you to select a default language from those available (you can, of course, change this default at a later stage). For more details on language packs, where to obtain them and how to install them please see the <a href="README.html#i18n">README</a>.</p>
+ <p>phpBB comes supplied with British English as its standard language. However, a number of separate packs for different languages are available. If you are not a native English speaker you may wish to install one or more of these packages before continuing. The installation process below will allow you to select a default language from those available (you can, of course, change this default at a later stage). For more details on language packs, where to obtain them and how to install them please see the <a href="README.html#i18n">README</a>.</p>
- <p>Once all the files have been uploaded to your site, you should point your browser at this location with the addition of <code>/install/</code>. For example, if your domain name is <code>www.example.com</code> and you placed the phpBB3 files in the directory <code>/phpBB3</code> off your web root you would enter <code>http://www.example.com/phpBB3/install/</code> or (alternatively) <code>http://www.example.com/phpBB3/install/index.php</code> into your browser. When you have done this, you should see the <strong><em>phpBB3 Introduction</em></strong> screen appear.</p>
+ <p>Once all the files have been uploaded to your site, you should point your browser at this location with the addition of <code>/install/</code>. For example, if your domain name is <code>www.example.com</code> and you placed the phpBB files in the directory <code>/phpBB3</code> off your web root you would enter <code>http://www.example.com/phpBB3/install/</code> or (alternatively) <code>http://www.example.com/phpBB3/install/index.php</code> into your browser. When you have done this, you should see the <strong><em>phpBB Introduction</em></strong> screen appear.</p>
<h4>Introduction:</h4>
- <p>The initial screen gives you a short introduction into phpBB. It allows you to read the license phpBB3 is released under (General Public License v2) and provides information about how you can receive support. To start the installation, use the <strong><em>INSTALL</em></strong> tab.</p>
+ <p>The initial screen gives you a short introduction into phpBB. It allows you to read the license phpBB is released under (General Public License v2) and provides information about how you can receive support. To start the installation, use the <strong><em>INSTALL</em></strong> tab.</p>
<h4>Requirements</h4>
- <p>The first page you will see after starting the installation is the Requirements list. phpBB3 automatically checks whether everything that it needs to run properly is installed on your server. You need to have at least the minimum PHP version installed, and at least one database available to continue the installation. Also important, is that all shown folders are available and have the correct permissions. Please see the description of each section to find out whether they are optional or required for phpBB3 to run. If everything is in order, you can continue the installation with <em>Start Install</em>.</p>
+ <p>The first page you will see after starting the installation is the Requirements list. phpBB automatically checks whether everything that it needs to run properly is installed on your server. You need to have at least the minimum PHP version installed, and at least one database available to continue the installation. Also important, is that all shown folders are available and have the correct permissions. Please see the description of each section to find out whether they are optional or required for phpBB to run. If everything is in order, you can continue the installation with <em>Start Install</em>.</p>
<h4>Database settings</h4>
@@ -212,7 +219,7 @@
<p>You don't need to change the Prefix for tables in database setting, unless you plan on using multipe phpBB installations on one database. In this case, you can use a different prefix for each installation to make it work.</p>
- <p>After you entered your details, you can continue with the <em>Proceed to next step</em> button. Now phpBB3 will check whether the data you entered will lead to a successful database connection and whether tables with the same prefix already exist.</p>
+ <p>After you entered your details, you can continue with the <em>Proceed to next step</em> button. Now phpBB will check whether the data you entered will lead to a successful database connection and whether tables with the same prefix already exist.</p>
<p>A <em>Could not connect to the database</em> error means that you didn't enter the database data correctly and it is not possible for phpBB to connect. Make sure that everything you entered is in order and try again. Again, if you are unsure about your database settings, please contact your host.</p>
@@ -222,7 +229,7 @@
<h4>Administrator details</h4>
- <p>Now you have to create your administration user. This user will have full administration access and he/she will be the first user on your forum. All fields on this page are required. You can also set the default language of your forum on this page. In a vanilla phpBB3 installation, we only include British English. You can download further languages from <a href="https://www.phpbb.com/">www.phpbb.com</a>, and add them before installing or later.</p>
+ <p>Now you have to create your administration user. This user will have full administration access and he/she will be the first user on your forum. All fields on this page are required. You can also set the default language of your forum on this page. In a vanilla phpBB installation, we only include British English. You can download further languages from <a href="https://www.phpbb.com/">www.phpbb.com</a>, and add them before installing or later.</p>
<h4>Configuration file</h4>
@@ -236,7 +243,7 @@
<p>If the installation was successful, you can now use the <em>Login</em> button to visit the Administration Control Panel. Congratulations, you have installed phpBB successfully. But there is still work ahead!</p>
- <p>If you are unable to get phpBB3 installed even after reading this guide, please look at the support section of the installer's introduction page to find out where you can ask for further assistance.</p>
+ <p>If you are unable to get phpBB installed even after reading this guide, please look at the support section of the installer's introduction page to find out where you can ask for further assistance.</p>
<p>At this point if you are converting from phpBB 2.0.x, you should refer to the <a href="#convert">conversion steps</a> for further information. If not, you should remove the install directory from your server as you will only be able to access the Administration Control Panel whilst it is present.</p>
@@ -244,7 +251,7 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -252,19 +259,19 @@
<a name="update"></a><h2>4. Updating from stable releases of phpBB 3.1.x</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
-<p>If you are currently using a stable release of phpBB3, updating to this version is straightforward. You would have downloaded one of four packages and your choice determines what you need to do. <strong>Note</strong>: Before updating, we heavily recommend you do a <em>full backup of your database and existing phpBB3 files</em>! If you are unsure how to achieve this please ask your hosting provider for advice.</p>
+<p>If you are currently using a stable release of phpBB, updating to this version is straightforward. You would have downloaded one of four packages and your choice determines what you need to do. <strong>Note</strong>: Before updating, we heavily recommend you do a <em>full backup of your database and existing phpBB files</em>! If you are unsure how to achieve this please ask your hosting provider for advice.</p>
-<p><strong>Please make sure you update your phpBB3 source files too, even if you run the <code>database_update.php</code> file.</strong></p>
+<p><strong>Please make sure you update your phpBB source files too, even if you run the <code>database_update.php</code> file.</strong></p>
<a name="update_full"></a><h3>4.i. Full package</h3>
<p>The full package is normally meant for new installations only, but if you want to replace all source files, this package comes in handy.</p>
- <p>First, you should make a copy of your existing <code>config.php</code> file; keep it in a safe place! Next, delete all the existing phpBB3 files, you may want to leave your <code>files/</code> and <code>images/</code> directorie in place. You can leave alternative styles in place too. With this complete, you can upload the new phpBB files (see <a href="#install">New installation</a> for details if necessary). Once complete, copy back your saved <code>config.php</code>, replacing the new one. Another method is to just <strong>replace</strong> the existing files with the files from the full package - though make sure you do <strong>not</strong> overwrite your config.php file.</p>
+ <p>First, you should make a copy of your existing <code>config.php</code> file; keep it in a safe place! Next, delete all the existing phpBB files, you may want to leave your <code>files/</code> and <code>images/</code> directories in place. You can leave alternative styles in place too. With this complete, you can upload the new phpBB files (see <a href="#install">New installation</a> for details if necessary). Once complete, copy back your saved <code>config.php</code>, replacing the new one. Another method is to just <strong>replace</strong> the existing files with the files from the full package - though make sure you do <strong>not</strong> overwrite your config.php file.</p>
<p>You should now run <code>install/database_update.php</code> which, depending on your previous version, will make a number of database changes. You may receive <em>FAILURES</em> during this procedure. They should not be a cause for concern unless you see an actual <em>ERROR</em>, in which case the script will stop (in this case you should seek help via our forums or bug tracker).</p>
@@ -296,14 +303,14 @@
<p>This update method is the recommended method for updating. This package detects changed files automatically and merges in changes if needed.</p>
- <p>The automatic update package will update the board from a given version to the latest version. A number of automatic update files are available, and you should choose the one that corresponds to the version of the board that you are currently running. For example, if your current version is <strong>3.0.10</strong>, you need the <code>phpBB-3.0.10_to_3.0.11.zip/tar.bz2</code> file.</p>
+ <p>The automatic update package will update the board from a given version to the latest version. A number of automatic update files are available, and you should choose the one that corresponds to the version of the board that you are currently running. For example, if your current version is <strong>3.0.12</strong>, you need the <code>phpBB-3.0.12_to_3.0.13.zip/tar.bz2</code> file.</p>
<p>To perform the update, either follow the instructions from the <strong>Administration Control Panel-&gt;System</strong> Tab - this should point out that you are running an outdated version and will guide you through the update - or follow the instructions listed below.</p>
<ul>
<li>Go to the <a href="https://www.phpbb.com/downloads/">downloads page</a> and download the latest update package listed there, matching your current version.</li>
- <li>Upload the uncompressed archive contents to your phpBB installation - only the install folder is required. Upload the whole install folder, retaining the file structure.</li>
- <li>After the install folder is present, phpBB3 will go offline automatically.</li>
+ <li>Upload the uncompressed archive contents to your phpBB installation - only the <code>install/</code> and <code>vendor/</code> folders are required. Upload these folders in their entirety, retaining the file structure.</li>
+ <li>After the install folder is present, phpBB will go offline automatically.</li>
<li>Point your browser to the install directory, for example <code>http://www.example.com/phpBB3/install/</code></li>
<li>Choose the "Update" Tab and follow the instructions</li>
</ul>
@@ -320,7 +327,7 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -346,7 +353,7 @@
<li>The <code>store/</code> directory</li>
</ul></li>
- <li>Upload the contents of the 3.1.x Full Package into your forum's directory.</li>
+ <li>Upload the contents of the 3.1.x Full Package into your forum's directory. Make sure the root level .htaccess file is included in the upload.</li>
<li>Browse to install/database_update.php</li>
<li>Delete the <code>install/</code> directory</li>
</ol>
@@ -362,7 +369,7 @@
<a name="convert"></a><h2>6. Conversion from phpBB 2.0.x to phpBB 3.1.x</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -417,7 +424,7 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -425,17 +432,17 @@
<a name="postinstall"></a><h2>7. Important (security related) post-Install tasks for all installation methods</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <p>Once you have successfully installed phpBB3 you <strong>MUST</strong> ensure you remove the entire <code>install/</code> directory. Leaving the install directory in place is a <em>very serious potential security issue</em> which may lead to deletion or alteration of files, etc. Please note that until this directory is removed, phpBB will not operate and a warning message will be displayed. Beyond this <strong>essential</strong> deletion, you may also wish to delete the docs/ directory if you wish.</p>
+ <p>Once you have successfully installed phpBB you <strong>MUST</strong> ensure you remove the entire <code>install/</code> directory. Leaving the install directory in place is a <em>very serious potential security issue</em> which may lead to deletion or alteration of files, etc. Please note that until this directory is removed, phpBB will not operate and a warning message will be displayed. Beyond this <strong>essential</strong> deletion, you may also wish to delete the docs/ directory if you wish.</p>
<p>With these directories deleted, you should proceed to the administration panel. Depending on how the installation completed, you may have been directed there automatically. If not, login as the administrator you specified during install/conversion and click the <strong>Administration Control Panel</strong> link at the bottom of any page. Ensure that details specified on the <strong>General</strong> tab are correct!</p>
<a name="avatars"></a><h3>6.i. Uploadable avatars</h3>
- <p>phpBB3 supports several methods for allowing users to select their own <em>avatar</em> (an avatar is a small image generally unique to a user and displayed just below their username in posts).</p>
+ <p>phpBB supports several methods for allowing users to select their own <em>avatar</em> (an avatar is a small image generally unique to a user and displayed just below their username in posts).</p>
<p>Two of these options allow users to upload an avatar from their machine or a remote location (via a URL). If you wish to enable this function you should first ensure the correct path for uploadable avatars is set in <strong>Administration Control Panel -&gt; General -&gt; Board Configuration -&gt; Avatar settings</strong>. By default this is <code>images/avatars/uploads</code>, but you can set it to whatever you like, just ensure the configuration setting is updated. You must also ensure this directory can be written to by the webserver. Usually this means you have to alter its permissions to allow anyone to read and write to it. Exactly how you should do this depends on your FTP client or server operating system.</p>
@@ -455,15 +462,15 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
<a name="anti_spam"></a><h2>8. Anti-Spam Measures</h2>
-
+
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
<p>Like any online site that allows user input, your board could be subject to unwanted posts; often referred to as <a href="http://en.wikipedia.org/wiki/Forum_spam">forum spam</a>. The vast majority of these attacks will be from automated computer programs known as <a href="http://en.wikipedia.org/wiki/Spambot">spambots</a>. The attacks, generally, are not personal as the spammers are just trying to find accessible targets. phpBB has a number of anti-spam measures built in, including a range of CAPTCHAs. However, administrators are strongly urged to read and follow the advice for <a href="https://www.phpbb.com/support/spam/">Preventing Spam in phpBB</a> as soon as possible after completing the installation of your board.</p>
@@ -471,7 +478,7 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -479,7 +486,7 @@
<a name="disclaimer"></a><h2>9. Copyright and disclaimer</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -489,7 +496,7 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- END DOCUMENT -->
diff --git a/phpBB/docs/README.html b/phpBB/docs/README.html
index e64d3dd8f2..f5ac3ecacd 100644
--- a/phpBB/docs/README.html
+++ b/phpBB/docs/README.html
@@ -4,9 +4,9 @@
<meta charset="utf-8">
<meta name="keywords" content="" />
<meta name="description" content="phpBB 3.1.x Readme" />
-<title>phpBB3 &bull; Readme</title>
+<title>phpBB &bull; Readme</title>
-<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
+<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
</head>
@@ -16,15 +16,15 @@
<a id="top" name="top" accesskey="t"></a>
<div id="page-header">
<div class="headerbar">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div id="doc-description">
- <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a>
+ <a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a>
<h1>phpBB 3.1.x Readme</h1>
<p style="display: none;"><a href="#start_here">Skip</a></p>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
</div>
@@ -34,25 +34,29 @@
<!-- BEGIN DOCUMENT -->
- <p>Thank you for downloading phpBB3. This README will guide you through the basics of installation and operation of phpBB3. Please ensure you read this and the accompanying documentation fully <strong>before</strong> proceeding with the installation.</p>
+ <p class="paragraph main-description">
+ Thank you for downloading phpBB. This README will guide you through the basics of installation
+ and operation of phpBB. Please ensure you read this and the accompanying documentation fully
+ <strong>before</strong> proceeding with the installation.
+ </p>
<h1>Readme</h1>
<div class="paragraph menu">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
<ol>
- <li><a href="#install">Installing phpBB3</a></li>
- <li><a href="#run">Running phpBB3</a>
+ <li><a href="#install">Installing phpBB</a></li>
+ <li><a href="#run">Running phpBB</a>
<ol style="list-style-type: lower-roman;">
<li><a href="#i18n">Languages (Internationalisation - i18n)</a></li>
<li><a href="#styles">Styles</a></li>
- <li><a href="#mods">Modifications</a></li>
+ <li><a href="#extensions">Extensions</a></li>
</ol>
</li>
- <li><a href="#help">Getting help with phpBB3</a>
+ <li><a href="#help">Getting help with phpBB</a>
<ol style="list-style-type: lower-roman;">
<li><a href="#docs">Documentation</a></li>
<li><a href="#kb">Knowledge Base</a></li>
@@ -73,15 +77,15 @@
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
- <a name="install"></a><h2>1. Installing phpBB3</h2>
+ <a name="install"></a><h2>1. Installing phpBB</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
<p>Installation, update and conversion instructions can be found in the <a href="INSTALL.html">INSTALL</a> document in this directory. If you are intending on converting from a phpBB 2.0.x or 3.0.x installation we highly recommend that you backup any existing data before proceeding!</p>
@@ -110,15 +114,15 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
- <a name="run"></a><h2>2. Running phpBB3</h2>
+ <a name="run"></a><h2>2. Running phpBB</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -132,55 +136,55 @@
<p>This is the <em>official</em> location for all supported language sets. If you download a package from a 3rd party site you do so with the understanding that we cannot offer support. Please do not ask for support if you download a language pack from a 3rd party site.</p>
- <p>Installation of these packages is straightforward: simply download the required language pack, uncompress (unzip) it and via FTP transfer the included <code>language</code> and <code>styles</code> folders to the root of your board installation. The language can then be installed via the Administration Control Panel of your board: <code>System tab -&gt; General Tasks -&gt; Language packs</code>. A more detailed description of the process is in the Knowledge Base article, <a href="https://www.phpbb.com/kb/article/how-to-install-a-language-pack/">How to Install a Language Pack</a>.</p>
+ <p>Installation of these packages is straightforward: simply download the required language pack, uncompress (unzip) it and via FTP transfer the included <code>language</code> and <code>styles</code> folders to the root of your board installation. The language can then be installed via the Administration Control Panel of your board: <code>Customise tab -&gt; Language management -&gt; Language packs</code>. A more detailed description of the process is in the Knowledge Base article, <a href="https://www.phpbb.com/kb/article/how-to-install-a-language-pack/">How to Install a Language Pack</a>.</p>
- <p>If your language is not available, please visit our <a href="https://www.phpbb.com/community/viewforum.php?f=66">[3.0.x] Translations</a> forum where you will find topics on translations in progress. Should you wish to volunteer to translate a language not currently available or assist in maintaining an existing language pack, you can <a href="https://www.phpbb.com/languages/apply.php">Apply to become a translator</a>.</p>
+ <p>If your language is not available, please visit our <a href="https://www.phpbb.com/community/viewforum.php?f=491">[3.1.x] Translations</a> forum where you will find topics on translations in progress. Should you wish to volunteer to translate a language not currently available or assist in maintaining an existing language pack, you can <a href="https://www.phpbb.com/languages/apply.php">Apply to become a translator</a>.</p>
<a name="styles"></a><h3>2.ii. Styles</h3>
- <p>Although we are rather proud of the included styles, we realise that they may not be to everyone's taste. Therefore, phpBB3 allows styles to be switched with relative ease. First, you need to locate and download a style you like. You can find them listed in the <a href="https://www.phpbb.com/customise/db/styles-2/">Styles</a> section of our <a href="https://www.phpbb.com/customise/db/">Customisation Database</a>.</p>
+ <p>Although we are rather proud of the included styles, we realise that they may not be to everyone's taste. Therefore, phpBB allows styles to be switched with relative ease. First, you need to locate and download a style you like. You can find them listed in the <a href="https://www.phpbb.com/customise/db/styles-2/">Styles</a> section of our <a href="https://www.phpbb.com/customise/db/">Customisation Database</a>.</p>
<p>For more information about styles, please see: <a href="https://www.phpbb.com/styles/">https://www.phpbb.com/styles/</a></p>
<p><strong>Please note</strong> that 3rd party styles downloaded for versions of phpBB2 will <strong>not</strong> work in phpBB3. It is also important to ensure that the style is updated to match the current version of the phpBB software you are using.</p>
- <p>Once you have downloaded a style, the usual next step is to unarchive (or upload the unarchived contents of) the package into your <code>styles/</code> directory. You then need to visit <code>Administration Control Panel -&gt; Styles tab</code> where you should see the new style available. Click &quot;Install&quot; to install the style.</p>
+ <p>Once you have downloaded a style, the usual next step is to unarchive (or upload the unarchived contents of) the package into your <code>styles/</code> directory. You then need to visit <code>Administration Control Panel -&gt; Customise tab -&gt; Style management -&gt; Install Styles</code> where you should see the new style available. Click &quot;Install style&quot; to install the style.</p>
- <p><strong>Please note</strong> that to improve efficiency, the software caches certain data. For this reason, if you create your own style or modify existing ones, please remember to &quot;Refresh&quot; the appropriate style components <code>Administration Control Panel -&gt; Styles tab -&gt; Style Components</code> screen. You may also need to reload the page you have changed in your web browser to overcome browser caching. If the changed components are not refreshed you will not see your changes taking effect.</p>
+ <p><strong>Please note</strong> that to improve efficiency, the software caches certain data. For this reason, if you create your own style or modify existing ones, please remember to purge the board cache by clicking the <code>Run now</code> button next to the <code>Purge the cache</code> option in the index page of the Administration Control Panel. You may also need to reload the page you have changed in your web browser to overcome browser caching. If the cache is not purged, you will not see your changes taking effect.</p>
- <a name="mods"></a><h3>2.iii. Modifications</h3>
+ <a name="extensions"></a><h3>2.iii. Extensions</h3>
- <p>We are proud to have a thriving modifications community. These third party modifications to the standard phpBB software, known as <strong>MODs</strong>, extend its capabilities still further. You can browse through many of the MODs in the <a href="https://www.phpbb.com/customise/db/modifications-1/">Modifications</a> section of our <a href="https://www.phpbb.com/customise/db/">Customisation Database</a>.</p>
+ <p>We are proud to have a thriving extensions community. These third party extensions to the standard phpBB software, extend its capabilities still further. You can browse through many of the extensions in the <a href="https://www.phpbb.com/customise/db/extensions-36">Extensions</a> section of our <a href="https://www.phpbb.com/customise/db/">Customisation Database</a>.</p>
- <p>For more information about MODs, please see: <a href="https://www.phpbb.com/mods/">https://www.phpbb.com/mods/</a></p>
+ <p>For more information about extensions, please see: <a href="https://www.phpbb.com/extensions">https://www.phpbb.com/extensions</a></p>
- <p><strong>Please remember</strong> that any bugs or other issues that occur after you have added any modification should <strong>NOT</strong> be reported to the bug tracker (see below). First remove the MOD and see if the problem is resolved. Any support for a MOD should only be sought in the &quot;Discussion/Support&quot; forum for that MOD.</p>
+ <p><strong>Please remember</strong> that any bugs or other issues that occur after you have added any extension should <strong>NOT</strong> be reported to the bug tracker (see below). First disable the extension and see if the problem is resolved. Any support for an extension should only be sought in the &quot;Discussion/Support&quot; forum for that extension.</p>
- <p>Also remember that any modifications, particularly those which modify the database in any way, may render upgrading your forum to future versions more difficult. With all this said, many users have and continue to utilise many of the MODs already available with great success.</p>
+ <p>Also remember that any extensions which modify the database in any way, may render upgrading your forum to future versions more difficult.</p>
</div>
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
-<a name="help"></a><h2>3. Getting help with phpBB3</h2>
+<a name="help"></a><h2>3. Getting help with phpBB</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <p>phpBB3 can sometimes seem a little daunting to new users, particularly with regards to the permission system. The first thing you should do is check the <a href="FAQ.html">FAQ</a>, which covers a few basic getting started questions. If you need additional help there are several places you can find it.</p>
+ <p>phpBB can sometimes seem a little daunting to new users, particularly with regards to the permission system. The first thing you should do is check the <a href="FAQ.html">FAQ</a>, which covers a few basic getting started questions. If you need additional help there are several places you can find it.</p>
- <a name="docs"></a><h3>3.i. phpBB3 Documentation</h3>
+ <a name="docs"></a><h3>3.i. phpBB Documentation</h3>
<p>Comprehensive documentation is now available on the phpBB website:</p>
- <p><a href="https://www.phpbb.com/support/documentation/3.0/">https://www.phpbb.com/support/documentation/3.0/</a></p>
+ <p><a href="https://www.phpbb.com/support/docs/en/3.1/ug/">https://www.phpbb.com/support/docs/en/3.1/ug/</a></p>
<p>This covers everything from installation to setting permissions and managing users.</p>
@@ -208,7 +212,7 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -216,7 +220,7 @@
<a name="status"></a><h2>4. Status of this version</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -232,7 +236,7 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -240,20 +244,20 @@
<a name="bugs"></a><h2>5. Reporting Bugs</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
- <p>The phpBB Limited uses a bug tracking system to store, list and manage all reported bugs, it can be found at the location listed below. Please <strong>DO NOT</strong> post bug reports to our forums. In addition please <strong>DO NOT</strong> use the bug tracker for support requests. Posting such a request will only see you directed to the support forums (while taking time away from working on real bugs).</p>
+ <p>The phpBB developers use a bug tracking system to store, list and manage all reported bugs, it can be found at the location listed below. Please <strong>DO NOT</strong> post bug reports to our forums. In addition please <strong>DO NOT</strong> use the bug tracker for support requests. Posting such a request will only see you directed to the support forums (while taking time away from working on real bugs).</p>
<p><a href="http://tracker.phpbb.com/browse/PHPBB3">http://tracker.phpbb.com/browse/PHPBB3</a></p>
<p>While we very much appreciate receiving bug reports (the more reports the more stable phpBB will be) we ask you carry out a few steps before adding new entries:</p>
<ul>
- <li>First, determine if your bug is reproduceable; how to determine this depends on the bug in question. Only if the bug is reproduceable is it likely to be a problem with phpBB3 (or in some way connected). If something cannot be reproduced it may turn out to have been your hosting provider working on something, a user doing something silly, etc. Bug reports for non-reproduceable events can slow down our attempts to fix real, reproduceable issues<br /><br /></li>
+ <li>First, determine if your bug is reproduceable; how to determine this depends on the bug in question. Only if the bug is reproduceable is it likely to be a problem with phpBB (or in some way connected). If something cannot be reproduced it may turn out to have been your hosting provider working on something, a user doing something silly, etc. Bug reports for non-reproduceable events can slow down our attempts to fix real, reproduceable issues<br /><br /></li>
<li>Next, please read or search through the existing bug reports to see if <em>your</em> bug (or one very similar to it) is already listed. If it is please add to that existing bug rather than creating a new duplicate entry (all this does is slow us down).<br /><br /></li>
- <li>Check the forums (use search!) to see if people have discussed anything that sounds similar to what you are seeing. However, as noted above please <strong>DO NOT</strong> post your particular bug to the forum unless it's non-reproduceable or you are sure it&rsquo;s related to something you have done rather than phpBB3<br /><br /></li>
+ <li>Check the forums (use search!) to see if people have discussed anything that sounds similar to what you are seeing. However, as noted above please <strong>DO NOT</strong> post your particular bug to the forum unless it's non-reproduceable or you are sure it&rsquo;s related to something you have done rather than phpBB<br /><br /></li>
<li>If no existing bug exists then please feel free to add it</li>
</ul>
@@ -267,7 +271,7 @@
<p>The relevant database type/version is listed within the administration control panel.</p>
- <p>Please be as detailed as you can in your report, and if possible, list the steps required to duplicate the problem. If you have a patch that fixes the issue, please attach it to the ticket or submit a pull request to our repository <a href="https://github.com/phpbb/phpbb3">on GitHub</a>.</p>
+ <p>Please be as detailed as you can in your report, and if possible, list the steps required to duplicate the problem. If you have a patch that fixes the issue, please attach it to the ticket or submit a pull request to our repository <a href="https://github.com/phpbb/phpbb">on GitHub</a>.</p>
<p>If you create a patch, it is very much appreciated (but not required) if you follow the phpBB coding guidelines. Please note that the coding guidelines are somewhat different between different versions of phpBB. For phpBB 3.1.x the coding guidelines may be found here: <a href="http://area51.phpbb.com/docs/31x/coding-guidelines.html">http://area51.phpbb.com/docs/31x/coding-guidelines.html</a></p>
@@ -283,7 +287,7 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -291,7 +295,7 @@
<a name="curbugs"></a><h2>6. Overview of current bug list</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -307,7 +311,7 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -315,13 +319,13 @@
<a name="php"></a><h2>7. PHP compatibility issues</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
<p>phpBB 3.1.x takes advantage of new features added in PHP 5.3. We recommend that you upgrade to the latest stable release of PHP5 to run phpBB. The minimum version required is PHP 5.3.3.</p>
- <p>Please remember that running any application on a development (unstable, e.g. a beta release) version of PHP can lead to strange/unexpected results which may appear to be bugs in the application. Therefore, we recommend you upgrade to the newest stable version of PHP before running phpBB3. If you are running a development version of PHP please check any bugs you find on a system running a stable release before submitting.</p>
+ <p>Please remember that running any application on a development (unstable, e.g. a beta release) version of PHP can lead to strange/unexpected results which may appear to be bugs in the application. Therefore, we recommend you upgrade to the newest stable version of PHP before running phpBB. If you are running a development version of PHP please check any bugs you find on a system running a stable release before submitting.</p>
<p>This board has been developed and tested under Linux and Windows (amongst others) running Apache using MySQL 3.23, 4.x, 5.x, MariaDB 5.x, MSSQL Server 2000, PostgreSQL 8.x, Oracle 8, SQLite 2 and SQLite 3. Versions of PHP used range from 5.3.x to 5.4.x without problem.</p>
@@ -333,7 +337,7 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -341,7 +345,7 @@
<a name="disclaimer"></a><h2>8. Copyright and disclaimer</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -351,7 +355,7 @@
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- END DOCUMENT -->
diff --git a/phpBB/docs/stylesheet.css b/phpBB/docs/assets/css/stylesheet.css
index 6b8f5994c0..192a6f9f79 100644
--- a/phpBB/docs/stylesheet.css
+++ b/phpBB/docs/assets/css/stylesheet.css
@@ -11,13 +11,21 @@ body {
font-family: Verdana, Helvetica, Arial, sans-serif;
color: #828282;
background-color: #FFFFFF;
- font-size: 12px;
+ font-size: 10px;
margin: 0;
padding: 12px 0;
}
img { border-width: 0; }
+ul, ol {
+ font-size: 1.1em;
+}
+
+ul ul, ol ol {
+ font-size: inherit;
+}
+
p {
line-height: 1.3em;
font-size: 1.1em;
@@ -70,7 +78,7 @@ h3 {
border-bottom: 1px solid #CCCCCC;
margin-bottom: 3px;
padding-bottom: 2px;
- font-size: 1.05em;
+ font-size: 1.1em;
color: #115098;
margin-top: 20px;
}
@@ -80,7 +88,7 @@ h4 {
font-weight: bold;
margin-bottom: 3px;
padding-bottom: 2px;
- font-size: 1.05em;
+ font-size: 1.1em;
color: #115098;
margin-top: 20px;
}
@@ -104,6 +112,7 @@ code {
border-width: 1px;
border-style: solid;
background-color: #FAFAFA;
+ padding: 0 4px;
}
#wrap {
@@ -145,44 +154,16 @@ a#logo:hover {
.headerbar {
background: #ebebeb none repeat-x 0 0;
+ border-radius: 7px;
color: #FFFFFF;
margin-bottom: 4px;
- padding: 0 5px;
-}
-
-span.corners-top, span.corners-bottom, span.corners-top span, span.corners-bottom span {
- font-size: 1px;
- line-height: 1px;
- display: block;
- height: 5px;
- background-repeat: no-repeat;
-}
-
-span.corners-top {
- background-image: none;
- background-position: 0 0;
- margin: 0 -5px;
-}
-
-span.corners-top span {
- background-image: none;
- background-position: 100% 0;
-}
-
-span.corners-bottom {
- background-image: none;
- background-position: 0 100%;
- margin: 0 -5px;
- clear: both;
-}
-
-span.corners-bottom span {
- background-image: none;
- background-position: 100% 100%;
+ padding: 5px;
}
.paragraph {
- padding: 0 10px;
+ border-radius: 7px;
+ font-size: 1.1em;
+ padding: 5px 10px;
margin-bottom: 4px;
background-repeat: no-repeat;
background-position: 100% 0;
@@ -197,6 +178,10 @@ span.corners-bottom span {
color: #000000;
}
+.main-description {
+ font-size: 1.15em;
+}
+
.content {
color: #333333;
}
@@ -222,7 +207,7 @@ hr {
.headerbar {
background-color: #12A3EB;
- background-image: url("bg_header.gif");
+ background-image: url("../images/bg_header.gif");
color: #FFFFFF;
}
@@ -231,23 +216,6 @@ hr {
color: #28313F;
}
-
-span.corners-top {
- background-image: url("corners_left.png");
-}
-
-span.corners-top span {
- background-image: url("corners_right.png");
-}
-
-span.corners-bottom {
- background-image: url("corners_left.png");
-}
-
-span.corners-bottom span {
- background-image: url("corners_right.png");
-}
-
.error {
color: #BC2A4D;
}
@@ -257,10 +225,6 @@ a:visited { color: #105289; }
a:hover { color: #D31141; }
a:active { color: #368AD2; }
-.paragraph span.corners-top, .paragraph span.corners-bottom {
- margin: 0 -10px;
-}
-
.content {
padding: 0;
line-height: 1.48em;
@@ -288,13 +252,17 @@ a:active { color: #368AD2; }
}
* html hr { margin: 0; }
-* html span.corners-top, * html span.corners-bottom { background-image: url("corners_left.gif"); }
-* html span.corners-top span, * html span.corners-bottom span { background-image: url("corners_right.gif"); }
-.back2top {
- clear: both;
+.top {
+ background: url("../images/icon_back_top.gif") no-repeat top left;
+ text-decoration: none;
+ width: 11px;
height: 11px;
- text-align: right;
+ display: block;
+ float: right;
+ overflow: hidden;
+ letter-spacing: 1000px;
+ text-indent: 11px;
}
.content ol, .content ul {
@@ -350,3 +318,9 @@ a:active { color: #368AD2; }
clear: both;
margin-right: 1em;
}
+
+.inner:after {
+ clear: both;
+ content: '';
+ display: block;
+}
diff --git a/phpBB/docs/bg_header.gif b/phpBB/docs/assets/images/bg_header.gif
index 351de9f46a..351de9f46a 100644
--- a/phpBB/docs/bg_header.gif
+++ b/phpBB/docs/assets/images/bg_header.gif
Binary files differ
diff --git a/phpBB/docs/assets/images/icon_back_top.gif b/phpBB/docs/assets/images/icon_back_top.gif
new file mode 100644
index 0000000000..4d2b8f3822
--- /dev/null
+++ b/phpBB/docs/assets/images/icon_back_top.gif
Binary files differ
diff --git a/phpBB/docs/assets/images/site_logo.gif b/phpBB/docs/assets/images/site_logo.gif
new file mode 100644
index 0000000000..2517fbedd6
--- /dev/null
+++ b/phpBB/docs/assets/images/site_logo.gif
Binary files differ
diff --git a/phpBB/docs/auth_api.html b/phpBB/docs/auth_api.html
index 703e7a18c1..d571e72dd4 100644
--- a/phpBB/docs/auth_api.html
+++ b/phpBB/docs/auth_api.html
@@ -6,7 +6,7 @@
<meta name="description" content="This is an explanation of how to use the phpBB auth/acl API" />
<title>phpBB3 &bull; Auth API</title>
-<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
+<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
</head>
@@ -16,16 +16,16 @@
<a id="top" name="top" accesskey="t"></a>
<div id="page-header">
<div class="headerbar">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div id="doc-description">
- <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a>
+ <a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a>
<h1>Auth API</h1>
<p>This is an explanation of how to use the phpBB auth/acl API</p>
<p style="display: none;"><a href="#start_here">Skip</a></p>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
</div>
@@ -35,12 +35,12 @@
<!-- BEGIN DOCUMENT -->
- <p>This is an explanation of how to use the phpBB auth/acl API.</p>
+ <p class="paragraph main-description">This is an explanation of how to use the phpBB auth/acl API.</p>
<h1>Auth API</h1>
<div class="paragraph menu">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -65,7 +65,7 @@
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -73,7 +73,7 @@
<a name="intro"></a><h2>1. Introduction</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -86,8 +86,8 @@
<p>To use any methods contained with the <code>auth</code> class it first needs to be instantiated. This is best achieved early in the execution of the script in the following manner:</p>
<div class="codebox"><pre>
-$auth = new phpbb\auth\auth();
- </pre></div>
+$auth = new phpbb\auth\auth();</pre>
+ </div>
<p>Once an instance of the class has been created you are free to call the various methods it contains. Please note that should you wish to use the <code>auth_admin</code> methods you will need to instantiate this separately but in the same way.</p>
@@ -95,7 +95,7 @@ $auth = new phpbb\auth\auth();
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -103,7 +103,7 @@ $auth = new phpbb\auth\auth();
<a name="methods"></a><h2>2. Methods</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -114,8 +114,8 @@ $auth = new phpbb\auth\auth();
<p>The <code>acl</code> method is the initialisation routine for all the acl functions. If you intend calling any acl method you must first call this. The method takes as its one and only required parameter an associative array containing user information as stored in the database. This array must contain at least the following information; user_id, user_permissions and user_type. It is called in the following way:</p>
<div class="codebox"><pre>
-$auth-&gt;acl(<code>userdata</code>);
- </pre></div>
+$auth-&gt;acl(<code>userdata</code>);</pre>
+ </div>
<p>Where userdata is the array containing the aforementioned data.</p>
@@ -124,8 +124,8 @@ $auth-&gt;acl(<code>userdata</code>);
<p>This method is the primary way of determining what a user can and cannot do for a given option globally or in a given forum. The method should be called in the following way:</p>
<div class="codebox"><pre>
-$result = $auth-&gt;acl_get(<code>option</code>[, <code>forum</code>]);
- </pre></div>
+$result = $auth-&gt;acl_get(<code>option</code>[, <code>forum</code>]);</pre>
+ </div>
<p>Where option is a string representing the required option, e.g. 'f_list', 'm_edit', 'a_adduser', etc. By adding a ! in front of the option, e.g. '!f_list' the result of this method will be negated. The optional forum term is the integer forum_id.</p>
@@ -142,8 +142,8 @@ $result = $auth-&gt;acl_get(<code>option</code>[, <code>forum</code>]);
<p>The method should be called thus:</p>
<div class="codebox"><pre>
-$result = $auth-&gt;acl_gets(<code>option1</code>[, <code>option2</code>, ..., <code>optionN</code>, <code>forum</code>]);
- </pre></div>
+$result = $auth-&gt;acl_gets(<code>option1</code>[, <code>option2</code>, ..., <code>optionN</code>, <code>forum</code>]);</pre>
+ </div>
<p>As with the <code>acl_get</code> method the options are strings representing the required permissions to check. The forum again is an integer representing a given forum_id.</p>
@@ -154,16 +154,16 @@ $result = $auth-&gt;acl_gets(<code>option1</code>[, <code>option2</code>, ..., <
<p>This method is used to find out in which forums a user is allowed to carry out an operation or to find out in which forums he is not allowed to carry out an operation. The method should be called in the following way:</p>
<div class="codebox"><pre>
-$result = $auth-&gt;acl_getf(<code>option</code>[, <code>clean</code>]);
- </pre></div>
+$result = $auth-&gt;acl_getf(<code>option</code>[, <code>clean</code>]);</pre>
+ </div>
<p>Just like in the <code>acl_get</code> method the option is a string specifying the permission which has to be checked (negation using ! is allowed). The second parameter is a boolean. If it is set to false this method returns all forums with either zero or a positive integer. If it is set to true only those forums with a positive integer as the result will be returned.</p>
<p>The method returns an associative array of the form:</p>
<div class="codebox"><pre>
-array(<em>forum_id1</em> =&gt; array(<em>option</em> =&gt; <em>integer</em>), <em>forum_id2</em> =&gt; ...)
- </pre></div>
+array(<em>forum_id1</em> =&gt; array(<em>option</em> =&gt; <em>integer</em>), <em>forum_id2</em> =&gt; ...)</pre>
+ </div>
<p>Where option is the option passed to the method and integer is either zero or a positive integer and the same <code>acl_get(option, forum_id)</code> would return.</p>
@@ -172,8 +172,8 @@ array(<em>forum_id1</em> =&gt; array(<em>option</em> =&gt; <em>integer</em>), <e
<p>This method is used to find out whether a user has a permission in at least one forum or globally. This method is similar to checking whether <code>acl_getf(option, true)</code> returned one or more forums but it's faster. It should be called in the following way:</p>
<div class="codebox"><pre>
-$result = $auth-&gt;acl_getf_global(<code>option</code>)
- </pre></div>
+$result = $auth-&gt;acl_getf_global(<code>option</code>)</pre>
+ </div>
<p>As with the previous methods option is a string specifying the permission which has to be checked.</p>
@@ -230,7 +230,7 @@ $result = $auth-&gt;acl_get_list($user_id, $permissions, $forum_id);
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -238,7 +238,7 @@ $result = $auth-&gt;acl_get_list($user_id, $permissions, $forum_id);
<a name="admin_related"></a><h2>3. Admin related functions</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -247,8 +247,8 @@ $result = $auth-&gt;acl_get_list($user_id, $permissions, $forum_id);
<p>To use any methods this class contains it first needs to be instantiated separately from <code>auth</code>. This is achieved in the same way as <code>auth</code>:</p>
<div class="codebox"><pre>
-$auth_admin = new auth_admin();
- </pre></div>
+$auth_admin = new auth_admin();</pre>
+ </div>
<p>This instance gives you access to both the methods of this specific class and that of <code>auth</code>.</p>
@@ -256,7 +256,7 @@ $auth_admin = new auth_admin();
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -264,7 +264,7 @@ $auth_admin = new auth_admin();
<a name="disclaimer"></a><h2>4. Copyright and disclaimer</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -274,7 +274,7 @@ $auth_admin = new auth_admin();
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- END DOCUMENT -->
diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html
index 98cfe0e717..4c5fe73543 100644
--- a/phpBB/docs/coding-guidelines.html
+++ b/phpBB/docs/coding-guidelines.html
@@ -6,7 +6,7 @@
<meta name="description" content="Ascraeus coding guidelines document" />
<title>phpBB3 &bull; Coding Guidelines</title>
-<link href="stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
+<link href="assets/css/stylesheet.css" rel="stylesheet" type="text/css" media="screen, projection" />
</head>
@@ -16,16 +16,16 @@
<a id="top" name="top" accesskey="t"></a>
<div id="page-header">
<div class="headerbar">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div id="doc-description">
- <a href="../index.php" id="logo"><img src="site_logo.gif" alt="" /></a>
+ <a href="../index.php" id="logo"><img src="assets/images/site_logo.gif" alt="" /></a>
<h1>Coding Guidelines</h1>
<p>Ascraeus coding guidelines document</p>
<p style="display: none;"><a href="#start_here">Skip</a></p>
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
</div>
@@ -35,12 +35,14 @@
<!-- BEGIN DOCUMENT -->
-<p>These are the phpBB Coding Guidelines for Ascraeus, all attempts should be made to follow them as closely as possible.</p>
+<p class="paragraph main-description">
+ These are the phpBB Coding Guidelines for Ascraeus, all attempts should be made to follow them as closely as possible.
+</p>
<h1>Coding Guidelines</h1>
<div class="paragraph menu">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -89,7 +91,7 @@
</div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -97,7 +99,7 @@
<a name="defaults"></a><h2>1. Defaults</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -109,8 +111,8 @@
<div class="codebox"><pre>
{TAB}$mode{TAB}{TAB}= $request->variable('mode', '');
-{TAB}$search_id{TAB}= $request->variable('search_id', '');
- </pre></div>
+{TAB}$search_id{TAB}= $request->variable('search_id', '');</pre>
+ </div>
<p>If entered with tabs (replace the {TAB}) both equal signs need to be on the same column.</p>
@@ -133,8 +135,8 @@
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
-*/
- </pre></div>
+*/</pre>
+ </div>
<p>Please see the <a href="#locations">File Locations section</a> for the correct package name.</p>
@@ -157,8 +159,8 @@
/**
*/
-{CODE}
- </pre></div>
+{CODE}</pre>
+ </div>
<h4>Files containing only functions:</h4>
@@ -185,8 +187,8 @@ Small code snipped, mostly one or two defines or an if statement
/**
* {DOCUMENTATION}
*/
-class ...
- </pre></div>
+class ...</pre>
+ </div>
<a name="locations"></a><h3>1.iii. File Locations</h3>
@@ -274,7 +276,7 @@ PHPBB_QA (Set board to QA-Mode, which means the updater also c
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -282,7 +284,7 @@ PHPBB_QA (Set board to QA-Mode, which means the updater also c
<a name="code"></a><h2>2. Code Layout/Guidelines</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -317,8 +319,8 @@ for ($i = 0; $i &lt; $outer_size; $i++)
{
foo($i, $j);
}
-}
- </pre></div>
+}</pre>
+ </div>
<h4>Function Names:</h4>
<p>Functions should also be named descriptively. We're not programming in C here, we don't want to write functions called things like "stristr()". Again, all lower-case names with words separated by a single underscore character in PHP, and camel caps in JavaScript. Function names should be prefixed with "phpbb_" and preferably have a verb in them somewhere. Good function names are <code>phpbb_print_login_status()</code>, <code>phpbb_get_user_data()</code>, etc. Constructor functions in JavaScript should begin with a capital letter.</p>
@@ -344,14 +346,14 @@ phpbb/
dir/
class_name.php
subdir/
- class_name.php
- </pre></div>
+ class_name.php</pre>
+ </div>
<div class="codebox"><pre>
\phpbb\class_name - phpbb/class_name.php
\phpbb\dir\class_name - phpbb/dir/class_name.php
-\phpbb\dir\subdir\class_name - phpbb/dir/subdir/class_name.php
- </pre></div>
+\phpbb\dir\subdir\class_name - phpbb/dir/subdir/class_name.php</pre>
+ </div>
<h4>Summary:</h4>
@@ -377,8 +379,8 @@ while (condition)
do_stuff();
for ($i = 0; $i &lt; size; $i++)
- do_stuff($i);
- </pre></div>
+ do_stuff($i);</pre>
+ </div>
<p class="good">// These are all right. </p>
<div class="codebox"><pre>
@@ -395,8 +397,8 @@ while (condition)
for ($i = 0; $i &lt; size; $i++)
{
do_stuff();
-}
- </pre></div>
+}</pre>
+ </div>
<h4>Where to put the braces:</h4>
<p>In PHP code, braces always go on their own line. The closing brace should also always be at the same column as the corresponding opening brace, examples:</p>
@@ -427,8 +429,8 @@ while (condition)
function do_stuff()
{
...
-}
- </pre></div>
+}</pre>
+ </div>
<p>In JavaScript code, braces always go on the same line:</p>
@@ -451,8 +453,8 @@ while (condition) {
function do_stuff() {
...
-}
- </pre></div>
+}</pre>
+ </div>
<h4>Use spaces between tokens:</h4>
<p>This is another simple, easy step that helps keep code readable without much effort. Whenever you write an assignment, expression, etc.. Always leave <em>one</em> space between the tokens. Basically, write code as if it was English. Put spaces between variable names and operators. Don't put spaces just after an opening bracket or before a closing bracket. Don't put spaces just before a comma or a semicolon. This is best shown with a few examples, examples:</p>
@@ -476,26 +478,26 @@ for($i=0; $i&lt;$size; $i++) ...
for ($i = 0; $i &lt; $size; $i++) ...
$i=($j &lt; $size)?0:1;
-$i = ($j &lt; $size) ? 0 : 1;
- </pre></div>
+$i = ($j &lt; $size) ? 0 : 1;</pre>
+ </div>
<h4>Operator precedence:</h4>
<p>Do you know the exact precedence of all the operators in PHP? Neither do I. Don't guess. Always make it obvious by using brackets to force the precedence of an equation so you know what it does. Remember to not over-use this, as it may harden the readability. Basically, do not enclose single expressions. Examples:</p>
<p class="bad">// what's the result? who knows. </p>
- <div class="codebox"><pre>
-$bool = ($i &lt; 7 &amp;&amp; $j &gt; 8 || $k == 4);
- </pre></div>
+ <div class="codebox">
+ <pre>$bool = ($i &lt; 7 &amp;&amp; $j &gt; 8 || $k == 4);</pre>
+ </div>
<p class="bad">// now you can be certain what I'm doing here.</p>
- <div class="codebox"><pre>
-$bool = (($i &lt; 7) &amp;&amp; (($j &lt; 8) || ($k == 4)));
- </pre></div>
+ <div class="codebox">
+ <pre>$bool = (($i &lt; 7) &amp;&amp; (($j &lt; 8) || ($k == 4)));</pre>
+ </div>
<p class="good">// But this one is even better, because it is easier on the eye but the intention is preserved</p>
- <div class="codebox"><pre>
-$bool = ($i &lt; 7 &amp;&amp; ($j &lt; 8 || $k == 4));
- </pre></div>
+ <div class="codebox">
+ <pre>$bool = ($i &lt; 7 &amp;&amp; ($j &lt; 8 || $k == 4));</pre>
+ </div>
<h4>Quoting strings:</h4>
<p>There are two different ways to quote strings in PHP - either with single quotes or with double quotes. The main difference is that the parser does variable interpolation in double-quoted strings, but not in single quoted strings. Because of this, you should <em>always</em> use single quotes <em>unless</em> you specifically need variable interpolation to be done on that string. This way, we can save the parser the trouble of parsing a bunch of strings where no interpolation needs to be done.</p>
@@ -505,25 +507,25 @@ $bool = ($i &lt; 7 &amp;&amp; ($j &lt; 8 || $k == 4));
<div class="codebox"><pre>
$str = "This is a really long string with no variables for the parser to find.";
-do_stuff("$str");
- </pre></div>
+do_stuff("$str");</pre>
+ </div>
<p class="good">// right</p>
<div class="codebox"><pre>
$str = 'This is a really long string with no variables for the parser to find.';
-do_stuff($str);
- </pre></div>
+do_stuff($str);</pre>
+ </div>
<p class="bad">// Sometimes single quotes are just not right</p>
<div class="codebox"><pre>
-$post_url = $phpbb_root_path . 'posting.' . $phpEx . '?mode=' . $mode . '&amp;amp;start=' . $start;
- </pre></div>
+$post_url = $phpbb_root_path . 'posting.' . $phpEx . '?mode=' . $mode . '&amp;amp;start=' . $start;</pre>
+ </div>
<p class="good">// Double quotes are sometimes needed to not overcrowd the line with concatenations.</p>
<div class="codebox"><pre>
-$post_url = "{$phpbb_root_path}posting.$phpEx?mode=$mode&amp;amp;start=$start";
- </pre></div>
+$post_url = "{$phpbb_root_path}posting.$phpEx?mode=$mode&amp;amp;start=$start";</pre>
+ </div>
<p>In SQL statements mixing single and double quotes is partly allowed (following the guidelines listed here about SQL formatting), else one should try to only use one method - mostly single quotes.</p>
@@ -535,40 +537,40 @@ $post_url = "{$phpbb_root_path}posting.$phpEx?mode=$mode&amp;amp;start=$start";
$foo = array(
'bar' => 42,
'boo' => 23
-);
- </pre></div>
+);</pre>
+ </div>
<p class="good">// right </p>
<div class="codebox"><pre>
$foo = array(
'bar' => 42,
'boo' => 23,
-);
- </pre></div>
+);</pre>
+ </div>
<h4>Associative array keys:</h4>
<p>In PHP, it's legal to use a literal string as a key to an associative array without quoting that string. We don't want to do this -- the string should always be quoted to avoid confusion. Note that this is only when we're using a literal, not when we're using a variable, examples:</p>
<p class="bad">// wrong</p>
- <div class="codebox"><pre>
-$foo = $assoc_array[blah];
- </pre></div>
+ <div class="codebox">
+ <pre>$foo = $assoc_array[blah];</pre>
+ </div>
<p class="good">// right </p>
- <div class="codebox"><pre>
-$foo = $assoc_array['blah'];
- </pre></div>
+ <div class="codebox">
+ <pre>$foo = $assoc_array['blah'];</pre>
+ </div>
<p class="bad">// wrong</p>
- <div class="codebox"><pre>
-$foo = $assoc_array["$var"];
- </pre></div>
+ <div class="codebox">
+ <pre>$foo = $assoc_array["$var"];</pre>
+ </div>
<p class="good">// right </p>
- <div class="codebox"><pre>
-$foo = $assoc_array[$var];
- </pre></div>
+ <div class="codebox">
+ <pre>$foo = $assoc_array[$var];</pre>
+ </div>
<h4>Comments:</h4>
<p>Each complex function should be preceded by a comment that tells a programmer everything they need to know to use that function. The meaning of every parameter, the expected input, and the output are required as a minimal comment. The function's behaviour in error conditions (and what those error conditions are) should also be present - but mostly included within the comment about the output.<br /><br />Especially important to document are any assumptions the code makes, or preconditions for its proper operation. Any one of the developers should be able to look at any part of the application and figure out what's going on in a reasonable amount of time.<br /><br />Avoid using <code>/* */</code> comment blocks for one-line comments, <code>//</code> should be used for one/two-liners.</p>
@@ -582,8 +584,8 @@ $foo = $assoc_array[$var];
<p class="bad">// wrong </p>
<div class="codebox"><pre>
$array[++$i] = $j;
-$array[$i++] = $k;
- </pre></div>
+$array[$i++] = $k;</pre>
+ </div>
<p class="good">// right </p>
<div class="codebox"><pre>
@@ -591,39 +593,38 @@ $i++;
$array[$i] = $j;
$array[$i] = $k;
-$i++;
- </pre></div>
+$i++;</pre>
+ </div>
<h4>Inline conditionals:</h4>
<p>Inline conditionals should only be used to do very simple things. Preferably, they will only be used to do assignments, and not for function calls or anything complex at all. They can be harmful to readability if used incorrectly, so don't fall in love with saving typing by using them, examples:</p>
<p class="bad">// Bad place to use them</p>
<div class="codebox"><pre>
-($i &lt; $size &amp;&amp; $j &gt; $size) ? do_stuff($foo) : do_stuff($bar);
- </pre></div>
+($i &lt; $size &amp;&amp; $j &gt; $size) ? do_stuff($foo) : do_stuff($bar);</pre>
+ </div>
<p class="good">// OK place to use them </p>
<div class="codebox"><pre>
-$min = ($i &lt; $j) ? $i : $j;
- </pre></div>
+$min = ($i &lt; $j) ? $i : $j;</pre>
+ </div>
<h4>Don't use uninitialized variables.</h4>
<p>For phpBB3, we intend to use a higher level of run-time error reporting. This will mean that the use of an uninitialized variable will be reported as a warning. These warnings can be avoided by using the built-in isset() function to check whether a variable has been set - but preferably the variable is always existing. For checking if an array has a key set this can come in handy though, examples:</p>
<p class="bad">// Wrong </p>
- <div class="codebox"><pre>
-if ($forum) ...
- </pre></div>
+ <div class="codebox">
+ <pre>if ($forum) ...</pre>
+ </div>
<p class="good">// Right </p>
- <div class="codebox"><pre>
-if (isset($forum)) ...
- </pre></div>
+ <div class="codebox">
+ <pre>if (isset($forum)) ...</pre></div>
<p class="good">// Also possible</p>
- <div class="codebox"><pre>
-if (isset($forum) &amp;&amp; $forum == 5)
- </pre></div>
+ <div class="codebox">
+ <pre>if (isset($forum) &amp;&amp; $forum == 5)</pre>
+ </div>
<p>The <code>empty()</code> function is useful if you want to check if a variable is not set or being empty (an empty string, 0 as an integer or string, NULL, false, an empty array or a variable declared, but without a value in a class). Therefore empty should be used in favor of <code>isset($array) &amp;&amp; sizeof($array) &gt; 0</code> - this can be written in a shorter way as <code>!empty($array)</code>.</p>
@@ -640,8 +641,8 @@ switch ($mode)
case 'mode2':
// I am doing something completely different here
break;
-}
- </pre></div>
+}</pre>
+ </div>
<p class="good">// Good </p>
<div class="codebox"><pre>
@@ -658,8 +659,8 @@ switch ($mode)
default:
// Always assume that a case was not caught
break;
-}
- </pre></div>
+}</pre>
+ </div>
<p class="good">// Also good, if you have more code between the case and the break </p>
<div class="codebox"><pre>
@@ -682,8 +683,8 @@ switch ($mode)
// Always assume that a case was not caught
break;
-}
- </pre></div>
+}</pre>
+ </div>
<p>Even if the break for the default case is not needed, it is sometimes better to include it just for readability and completeness.</p>
@@ -710,8 +711,8 @@ switch ($mode)
// Always assume that a case was not caught
break;
-}
- </pre></div>
+}</pre>
+ </div>
<h4>Class Members</h4>
<p>Use the explicit visibility qualifiers <code>public</code>, <code>private</code> and <code>protected</code> for all properties instead of <code>var</code>.
@@ -721,14 +722,14 @@ switch ($mode)
<p class="bad">//Wrong </p>
<div class="codebox"><pre>
var $x;
-private static function f()
- </pre></div>
+private static function f()</pre>
+ </div>
<p class="good">// Right </p>
<div class="codebox"><pre>
public $x;
-static private function f()
- </pre></div>
+static private function f()</pre>
+ </div>
<h4>Constants</h4>
<p>Prefer class constants over global constants created with <code>define()</code>.</p>
@@ -748,8 +749,8 @@ $sql = 'SELECT *
&lt;-one tab-&gt;WHERE a = 1
&lt;-two tabs-&gt;AND (b = 2
&lt;-three tabs-&gt;OR b = 3)
-&lt;-one tab-&gt;ORDER BY b';
- </pre></div>
+&lt;-one tab-&gt;ORDER BY b';</pre>
+ </div>
<p>Here the example with the tabs applied:</p>
@@ -759,8 +760,8 @@ $sql = 'SELECT *
WHERE a = 1
AND (b = 2
OR b = 3)
- ORDER BY b';
- </pre></div>
+ ORDER BY b';</pre>
+ </div>
<h4>SQL Quotes: </h4>
<p>Use double quotes where applicable. (The variables in these examples are typecasted to integers beforehand.) Examples: </p>
@@ -769,16 +770,16 @@ $sql = 'SELECT *
<div class="codebox"><pre>
"UPDATE " . SOME_TABLE . " SET something = something_else WHERE a = $b";
-'UPDATE ' . SOME_TABLE . ' SET something = ' . $user_id . ' WHERE a = ' . $something;
- </pre></div>
+'UPDATE ' . SOME_TABLE . ' SET something = ' . $user_id . ' WHERE a = ' . $something;</pre>
+ </div>
<p class="good">// These are right. </p>
<div class="codebox"><pre>
'UPDATE ' . SOME_TABLE . " SET something = something_else WHERE a = $b";
-'UPDATE ' . SOME_TABLE . " SET something = $user_id WHERE a = $something";
- </pre></div>
+'UPDATE ' . SOME_TABLE . " SET something = $user_id WHERE a = $something";</pre>
+ </div>
<p>In other words use single quotes where no variable substitution is required or where the variable involved shouldn't appear within double quotes. Otherwise use double quotes.</p>
@@ -789,15 +790,15 @@ $sql = 'SELECT *
<div class="codebox"><pre>
$sql = 'SELECT *
FROM ' . SOME_TABLE . '
- WHERE a != 2';
- </pre></div>
+ WHERE a != 2';</pre>
+ </div>
<p class="good">// This is right. </p>
<div class="codebox"><pre>
$sql = 'SELECT *
FROM ' . SOME_TABLE . '
- WHERE a &lt;&gt; 2';
- </pre></div>
+ WHERE a &lt;&gt; 2';</pre>
+ </div>
<h4>Common DBAL methods: </h4>
@@ -808,8 +809,8 @@ $sql = 'SELECT *
<div class="codebox"><pre>
$sql = 'SELECT *
FROM ' . SOME_TABLE . "
- WHERE username = '" . $db-&gt;sql_escape($username) . "'";
- </pre></div>
+ WHERE username = '" . $db-&gt;sql_escape($username) . "'";</pre>
+ </div>
<h4>sql_query_limit():</h4>
@@ -830,8 +831,8 @@ $sql_ary = array(
'moredata' =&gt; $another_int,
);
-$db-&gt;sql_query('INSERT INTO ' . SOME_TABLE . ' ' . $db-&gt;sql_build_array('INSERT', $sql_ary));
- </pre></div>
+$db-&gt;sql_query('INSERT INTO ' . SOME_TABLE . ' ' . $db-&gt;sql_build_array('INSERT', $sql_ary));</pre>
+ </div>
<p>To complete the example, this is how an update statement would look like:</p>
@@ -845,8 +846,8 @@ $sql_ary = array(
$sql = 'UPDATE ' . SOME_TABLE . '
SET ' . $db-&gt;sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . (int) $user_id;
-$db-&gt;sql_query($sql);
- </pre></div>
+$db-&gt;sql_query($sql);</pre>
+ </div>
<p>The <code>$db-&gt;sql_build_array()</code> function supports the following modes: <code>INSERT</code> (example above), <code>INSERT_SELECT</code> (building query for <code>INSERT INTO table (...) SELECT value, column ...</code> statements), <code>UPDATE</code> (example above) and <code>SELECT</code> (for building WHERE statement [AND logic]).</p>
@@ -869,8 +870,8 @@ $sql_ary[] = array(
'moredata' =&gt; $another_int_2,
);
-$db->sql_multi_insert(SOME_TABLE, $sql_ary);
- </pre></div>
+$db->sql_multi_insert(SOME_TABLE, $sql_ary);</pre>
+ </div>
<h4>sql_in_set():</h4>
@@ -880,22 +881,22 @@ $db->sql_multi_insert(SOME_TABLE, $sql_ary);
$sql = 'SELECT *
FROM ' . FORUMS_TABLE . '
WHERE ' . $db-&gt;sql_in_set('forum_id', $forum_ids);
-$db-&gt;sql_query($sql);
- </pre></div>
+$db-&gt;sql_query($sql);</pre>
+ </div>
<p>Based on the number of values in $forum_ids, the query can look differently.</p>
<p class="good">// SQL Statement if $forum_ids = array(1, 2, 3);</p>
<div class="codebox"><pre>
-SELECT FROM phpbb_forums WHERE forum_id IN (1, 2, 3)
- </pre></div>
+SELECT FROM phpbb_forums WHERE forum_id IN (1, 2, 3)</pre>
+ </div>
<p class="good">// SQL Statement if $forum_ids = array(1) or $forum_ids = 1</p>
<div class="codebox"><pre>
-SELECT FROM phpbb_forums WHERE forum_id = 1
- </pre></div>
+SELECT FROM phpbb_forums WHERE forum_id = 1</pre>
+ </div>
<p>Of course the same is possible for doing a negative match against a number of values:</p>
@@ -903,22 +904,22 @@ SELECT FROM phpbb_forums WHERE forum_id = 1
$sql = 'SELECT *
FROM ' . FORUMS_TABLE . '
WHERE ' . $db-&gt;sql_in_set('forum_id', $forum_ids, <strong>true</strong>);
-$db-&gt;sql_query($sql);
- </pre></div>
+$db-&gt;sql_query($sql);</pre>
+ </div>
<p>Based on the number of values in $forum_ids, the query can look differently here too.</p>
<p class="good">// SQL Statement if $forum_ids = array(1, 2, 3);</p>
<div class="codebox"><pre>
-SELECT FROM phpbb_forums WHERE forum_id <strong>NOT</strong> IN (1, 2, 3)
- </pre></div>
+SELECT FROM phpbb_forums WHERE forum_id <strong>NOT</strong> IN (1, 2, 3)</pre>
+ </div>
<p class="good">// SQL Statement if $forum_ids = array(1) or $forum_ids = 1</p>
<div class="codebox"><pre>
-SELECT FROM phpbb_forums WHERE forum_id <strong>&lt;&gt;</strong> 1
- </pre></div>
+SELECT FROM phpbb_forums WHERE forum_id <strong>&lt;&gt;</strong> 1</pre>
+ </div>
<p>If the given array is empty, an error will be produced.</p>
@@ -948,8 +949,8 @@ $sql_array = array(
'ORDER_BY' =&gt; 'left_id',
);
-$sql = $db-&gt;sql_build_query('SELECT', $sql_array);
- </pre></div>
+$sql = $db-&gt;sql_build_query('SELECT', $sql_array);</pre>
+ </div>
<p>The possible first parameter for sql_build_query() is SELECT or SELECT_DISTINCT. As you can see, the logic is pretty self-explaining. For the LEFT_JOIN key, just add another array if you want to join on to tables for example. The added benefit of using this construct is that you are able to easily build the query statement based on conditions - for example the above LEFT_JOIN is only necessary if server side topic tracking is enabled; a slight adjustement would be:</p>
@@ -984,8 +985,8 @@ else
// Here we read the cookie data
}
-$sql = $db-&gt;sql_build_query('SELECT', $sql_array);
- </pre></div>
+$sql = $db-&gt;sql_build_query('SELECT', $sql_array);</pre>
+ </div>
<a name="optimizing"></a><h3>2.iv. Optimizations</h3>
@@ -997,16 +998,16 @@ $sql = $db-&gt;sql_build_query('SELECT', $sql_array);
for ($i = 0; $i &lt; sizeof($post_data); $i++)
{
do_something();
-}
- </pre></div>
+}</pre>
+ </div>
<p class="good">// You are able to assign the (not changing) result within the loop itself</p>
<div class="codebox"><pre>
for ($i = 0, $size = sizeof($post_data); $i &lt; $size; $i++)
{
do_something();
-}
- </pre></div>
+}</pre>
+ </div>
<h4>Use of in_array(): </h4>
<p>Try to avoid using in_array() on huge arrays, and try to not place them into loops if the array to check consist of more than 20 entries. in_array() can be very time consuming and uses a lot of cpu processing time. For little checks it is not noticeable, but if checked against a huge array within a loop those checks alone can take several seconds. If you need this functionality, try using isset() on the arrays keys instead, actually shifting the values into keys and vice versa. A call to <code>isset($array[$var])</code> is a lot faster than <code>in_array($var, array_keys($array))</code> for example.</p>
@@ -1028,29 +1029,29 @@ for ($i = 0, $size = sizeof($post_data); $i &lt; $size; $i++)
<p class="bad">// Old method, do not use it</p>
<div class="codebox"><pre>
$start = (isset($HTTP_GET_VARS['start'])) ? intval($HTTP_GET_VARS['start']) : intval($HTTP_POST_VARS['start']);
-$submit = (isset($HTTP_POST_VARS['submit'])) ? true : false;
- </pre></div>
+$submit = (isset($HTTP_POST_VARS['submit'])) ? true : false;</pre>
+ </div>
<p class="good">// Use request var and define a default variable (use the correct type)</p>
<div class="codebox"><pre>
$start = $request->variable('start', 0);
-$submit = $request->is_set_post('submit');
- </pre></div>
+$submit = $request->is_set_post('submit');</pre>
+ </div>
<p class="bad">// $start is an int, the following use of $request->variable() therefore is not allowed</p>
<div class="codebox"><pre>
-$start = $request->variable('start', '0');
- </pre></div>
+$start = $request->variable('start', '0');</pre>
+ </div>
<p class="good">// Getting an array, keys are integers, value defaults to 0</p>
<div class="codebox"><pre>
-$mark_array = $request->variable('mark', array(0));
- </pre></div>
+$mark_array = $request->variable('mark', array(0));</pre>
+ </div>
<p class="good">// Getting an array, keys are strings, value defaults to 0</p>
<div class="codebox"><pre>
-$action_ary = $request->variable('action', array('' =&gt; 0));
- </pre></div>
+$action_ary = $request->variable('action', array('' =&gt; 0));</pre>
+ </div>
<h4>Login checks/redirection: </h4>
<p>To show a forum login box use <code>login_forum_box($forum_data)</code>, else use the <code>login_box()</code> function.</p>
@@ -1073,8 +1074,8 @@ $action_ary = $request->variable('action', array('' =&gt; 0));
{
trigger_error('FORM_INVALID');
}
- }
- </pre></div>
+ }</pre>
+ </div>
<p>The string passed to <code>add_form_key()</code> needs to match the string passed to <code>check_form_key()</code>. Another requirement for this to work correctly is that all forms include the <code>{S_FORM_TOKEN}</code> template variable.</p>
@@ -1085,8 +1086,8 @@ $action_ary = $request->variable('action', array('' =&gt; 0));
<div class="codebox"><pre>
$user-&gt;session_begin();
$auth-&gt;acl($user-&gt;data);
-$user-&gt;setup();
- </pre></div>
+$user-&gt;setup();</pre>
+ </div>
<p>The <code>$user-&gt;setup()</code> call can be used to pass on additional language definition and a custom style (used in viewforum).</p>
@@ -1094,16 +1095,16 @@ $user-&gt;setup();
<p>All messages/errors should be outputted by calling <code>trigger_error()</code> using the appropriate message type and language string. Example:</p>
<div class="codebox"><pre>
-trigger_error('NO_FORUM');
- </pre></div>
+trigger_error('NO_FORUM');</pre>
+ </div>
<div class="codebox"><pre>
-trigger_error($user-&gt;lang['NO_FORUM']);
- </pre></div>
+trigger_error($user-&gt;lang['NO_FORUM']);</pre>
+ </div>
<div class="codebox"><pre>
-trigger_error('NO_MODE', E_USER_ERROR);
- </pre></div>
+trigger_error('NO_MODE', E_USER_ERROR);</pre>
+ </div>
<h4>Url formatting</h4>
@@ -1112,8 +1113,8 @@ trigger_error('NO_MODE', E_USER_ERROR);
<p>The <code>append_sid()</code> function from 2.0.x is available too, though it does not handle url alterations automatically. Please have a look at the code documentation if you want to get more details on how to use append_sid(). A sample call to append_sid() can look like this:</p>
<div class="codebox"><pre>
-append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;amp;g=' . $row['group_id'])
- </pre></div>
+append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;amp;g=' . $row['group_id'])</pre>
+ </div>
<h4>General function usage: </h4>
@@ -1169,14 +1170,14 @@ append_sid(&quot;{$phpbb_root_path}memberlist.$phpEx&quot;, 'mode=group&amp;amp;
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
<a name="styling"></a><h2>3. Styling</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
<a name="cfgfiles"></a><h3>3.i. Style Config Files</h3>
@@ -1193,8 +1194,8 @@ phpbb_version = 3.1.0
# Parent style
# Set value to empty or to this style's name if this style does not have a parent style
-parent = prosilver
- </pre></div>
+parent = prosilver</pre>
+ </div>
<a name="genstyling"></a><h3>3.2. General Styling Rules</h3>
<p>Templates should be produced in a consistent manner. Where appropriate they should be based off an existing copy, e.g. index, viewforum or viewtopic (the combination of which implement a range of conditional and variable forms). Please also note that the indentation and coding guidelines also apply to templates where possible.</p>
@@ -1252,14 +1253,14 @@ parent = prosilver
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
<a name="templating"></a><h2>4. Templating</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
<a name="templates"></a><h3>4.i. General Templating</h3>
@@ -1748,7 +1749,7 @@ This may span multiple lines.
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -1758,7 +1759,7 @@ This may span multiple lines.
<a name="charsets"></a><h2>5. Character Sets and Encodings</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -1821,7 +1822,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -1829,7 +1830,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<a name="translation"></a><h2>6. Translation (<abbr title="Internationalisation">i18n</abbr>/<abbr title="Localisation">L10n</abbr>) Guidelines</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -2356,8 +2357,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
'PAGE_OF' =&gt; 'Page %s of %s',
/* Just grabbing the replacements as they
come and hope they are in the right order */
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p>&hellip; a clearer way to show explicit replacement ordering is to do:</p>
@@ -2366,8 +2367,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
'PAGE_OF' =&gt; 'Page %1$s of %2$s',
/* Explicit ordering of the replacements,
even if they are the same order as English */
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p>Why bother at all? Because some languages, the string transliterated back to English might read something like:</p>
@@ -2376,8 +2377,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
'PAGE_OF' =&gt; 'Total of %2$s pages, currently on page %1$s',
/* Explicit ordering of the replacements,
reversed compared to English as the total comes first */
- ...
- </pre></div>
+ ...</pre>
+ </div>
<a name="usingplurals"></a><h3>6.iv. Using plurals</h3>
@@ -2395,8 +2396,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<div class="codebox"><pre>
...
$user->lang('NUMBER_OF_ELEPHANTS', $number_of_elephants);
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p>And the English translation would be:</p>
@@ -2407,8 +2408,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
1 => 'You have 1 elephant', // Singular
2 => 'You have %d elephants', // Plural
),
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p>While the Bosnian translation can have more cases:</p>
@@ -2420,16 +2421,16 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
2 => 'You have %d slona', // Used for 5, 6,
3 => ...
),
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p><strong>NOTE:</strong> It is okay to use plurals for an unknown number compared to a single item, when the number is not known and displayed:</p>
<div class="codebox"><pre>
...
'MODERATOR' => 'Moderator', // Your board has 1 moderator
'MODERATORS' => 'Moderators', // Your board has multiple moderators
- ...
- </pre></div>
+ ...</pre>
+ </div>
<a name="writingstyle"></a><h3>6.v. Writing Style</h3>
@@ -2443,8 +2444,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
...
'CONV_ERROR_NO_AVATAR_PATH'
=&gt; 'Note to developer: you must specify $convertor['avatar_path'] to use %s.',
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p class="good">// Good - Literal straight quotes should be escaped with a backslash, ie: \</p>
@@ -2452,8 +2453,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
...
'CONV_ERROR_NO_AVATAR_PATH'
=&gt; 'Note to developer: you must specify $convertor[\'avatar_path\'] to use %s.',
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p>However, because phpBB3 now uses UTF-8 as its sole encoding, we can actually use this to our advantage and not have to remember to escape a straight quote when we don't have to:</p>
@@ -2462,24 +2463,24 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<div class="codebox"><pre>
...
'USE_PERMISSIONS' =&gt; 'Test out user's permissions',
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p class="good">// Okay - However, non-programmers wouldn't type "user\'s" automatically</p>
<div class="codebox"><pre>
...
'USE_PERMISSIONS' =&gt; 'Test out user\'s permissions',
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p class="good">// Best - Use the Unicode Right-Single-Quotation-Mark character</p>
<div class="codebox"><pre>
...
'USE_PERMISSIONS' =&gt; 'Test out user&rsquo;s permissions',
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p>The <code>&quot;</code> (straight double quote), <code>&lt;</code> (less-than sign) and <code>&gt;</code> (greater-than sign) characters can all be used as displayed glyphs or as part of HTML markup, for example:</p>
@@ -2489,8 +2490,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
...
'FOO_BAR' =&gt; 'PHP version &lt; 5.3.3.&lt;br /&gt;
Visit &quot;Downloads&quot; at &lt;a href=&quot;http://www.php.net/&quot;&gt;www.php.net&lt;/a&gt;.',
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p class="good">// Okay - No more invalid HTML, but &quot;&amp;quot;&quot; is rather clumsy</p>
@@ -2498,8 +2499,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
...
'FOO_BAR' =&gt; 'PHP version &amp;lt; 5.3.3.&lt;br /&gt;
Visit &amp;quot;Downloads&amp;quot; at &lt;a href=&quot;http://www.php.net/&quot;&gt;www.php.net&lt;/a&gt;.',
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p class="good">// Best - No more invalid HTML, and usage of correct typographical quotation marks</p>
@@ -2507,8 +2508,8 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
...
'FOO_BAR' =&gt; 'PHP version &amp;lt; 5.3.3.&lt;br /&gt;
Visit &ldquo;Downloads&rdquo; at &lt;a href=&quot;http://www.php.net/&quot;&gt;www.php.net&lt;/a&gt;.',
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p>Lastly, the <code>&amp;</code> (ampersand) must always be entitised regardless of where it is used:</p>
@@ -2517,16 +2518,16 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<div class="codebox"><pre>
...
'FOO_BAR' =&gt; '&lt;a href=&quot;http://somedomain.tld/?foo=1&amp;bar=2&quot;&gt;Foo &amp; Bar&lt;/a&gt;.',
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p class="good">// Good - Valid HTML, amperands are correctly entitised in all cases</p>
<div class="codebox"><pre>
...
'FOO_BAR' =&gt; '&lt;a href=&quot;http://somedomain.tld/?foo=1&amp;amp;bar=2&quot;&gt;Foo &amp;amp; Bar&lt;/a&gt;.',
- ...
- </pre></div>
+ ...</pre>
+ </div>
<p>As for how these charcters are entered depends very much on choice of Operating System, current language locale/keyboard configuration and native abilities of the text editor used to edit phpBB language files. Please see <a href="http://en.wikipedia.org/wiki/Unicode#Input_methods">http://en.wikipedia.org/wiki/Unicode#Input_methods</a> for more information.</p>
@@ -2538,7 +2539,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<hr />
@@ -2546,7 +2547,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<a name="disclaimer"></a><h2>7. Copyright and disclaimer</h2>
<div class="paragraph">
- <div class="inner"><span class="corners-top"><span></span></span>
+ <div class="inner">
<div class="content">
@@ -2556,7 +2557,7 @@ if (utf8_case_fold_nfc($string1) == utf8_case_fold_nfc($string2))
<div class="back2top"><a href="#wrap" class="top">Back to Top</a></div>
- <span class="corners-bottom"><span></span></span></div>
+ </div>
</div>
<!-- END DOCUMENT -->
diff --git a/phpBB/docs/corners_left.gif b/phpBB/docs/corners_left.gif
deleted file mode 100644
index 206e50368d..0000000000
--- a/phpBB/docs/corners_left.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/docs/corners_left.png b/phpBB/docs/corners_left.png
deleted file mode 100644
index 256bde3daa..0000000000
--- a/phpBB/docs/corners_left.png
+++ /dev/null
Binary files differ
diff --git a/phpBB/docs/corners_right.gif b/phpBB/docs/corners_right.gif
deleted file mode 100644
index 0ba66d50b2..0000000000
--- a/phpBB/docs/corners_right.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/docs/corners_right.png b/phpBB/docs/corners_right.png
deleted file mode 100644
index df41823b4c..0000000000
--- a/phpBB/docs/corners_right.png
+++ /dev/null
Binary files differ
diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md
index 8792dc507c..a76da95f7b 100644
--- a/phpBB/docs/events.md
+++ b/phpBB/docs/events.md
@@ -16,11 +16,59 @@ acp_bbcodes_edit_fieldsets_after
* Since: 3.1.0-a3
* Purpose: Add settings to BBCode add/edit form
+acp_email_options_after
+===
+* Location: adm/style/acp_email.html
+* Since: 3.1.2-RC1
+* Purpose: Add settings to mass email form
+
+acp_forums_main_settings_append
+===
+* Location: adm/style/acp_forums.html
+* Since: 3.1.2-RC1
+* Purpose: Add settings to forums at end of main settings section
+
+acp_forums_main_settings_prepend
+===
+* Location: adm/style/acp_forums.html
+* Since: 3.1.2-RC1
+* Purpose: Add settings to forums before main settings section
+
acp_forums_normal_settings_append
===
* Location: adm/style/acp_forums.html
* Since: 3.1.0-a1
-* Purpose: Add settings to forums
+* Purpose: Add settings to forums at end of normal settings section
+
+acp_forums_normal_settings_prepend
+===
+* Location: adm/style/acp_forums.html
+* Since: 3.1.2-RC1
+* Purpose: Add settings to forums before normal settings section
+
+acp_forums_prune_settings_append
+===
+* Location: adm/style/acp_forums.html
+* Since: 3.1.2-RC1
+* Purpose: Add settings to forums at end of prune settings section
+
+acp_forums_prune_settings_prepend
+===
+* Location: adm/style/acp_forums.html
+* Since: 3.1.2-RC1
+* Purpose: Add settings to forums before prune settings section
+
+acp_forums_rules_settings_append
+===
+* Location: adm/style/acp_forums.html
+* Since: 3.1.2-RC1
+* Purpose: Add settings to forums at end of rules settings section
+
+acp_forums_rules_settings_prepend
+===
+* Location: adm/style/acp_forums.html
+* Since: 3.1.2-RC1
+* Purpose: Add settings to forums before rules settings section
acp_group_options_before
===
@@ -111,7 +159,7 @@ acp_ranks_list_column_before
* Locations:
+ adm/style/acp_ranks.html
* Since: 3.1.0-RC3
-* Purpose: Add content after the last column (but before the action column)
+* Purpose: Add content after the last column (but before the action column)
in the ranks list in the ACP
acp_ranks_list_header_after
@@ -126,9 +174,30 @@ acp_ranks_list_header_before
* Locations:
+ adm/style/acp_ranks.html
* Since: 3.1.0-RC3
-* Purpose: Add content after the last header-column (but before the action column)
+* Purpose: Add content after the last header-column (but before the action column)
in the ranks list in the ACP
+acp_users_profile_before
+===
+* Locations:
+ + adm/style/acp_users_profile.html
+* Since: 3.1.4-RC1
+* Purpose: Add content before the profile details when editing a user in the ACP
+
+acp_users_profile_after
+===
+* Locations:
+ + adm/style/acp_users_profile.html
+* Since: 3.1.4-RC1
+* Purpose: Add content after the profile details but before the custom profile fields when editing a user in the ACP
+
+acp_users_profile_custom_after
+===
+* Locations:
+ + adm/style/acp_users_profile.html
+* Since: 3.1.4-RC1
+* Purpose: Add content after the the custom profile fields when editing a user in the ACP
+
acp_simple_footer_after
===
* Location: adm/style/simple_footer.html
@@ -224,6 +293,38 @@ forumlist_body_category_header_before
* Since: 3.1.0-a4
* Purpose: Add content before the header of the category on the forum list.
+forumlist_body_forum_row_after
+===
+* Locations:
+ + styles/prosilver/template/forumlist_body.html
+ + styles/subsilver2/template/forumlist_body.html
+* Since: 3.1.0-RC5
+* Purpose: Add content after the forum list item.
+
+forumlist_body_forum_row_append
+===
+* Locations:
+ + styles/prosilver/template/forumlist_body.html
+ + styles/subsilver2/template/forumlist_body.html
+* Since: 3.1.0-RC5
+* Purpose: Add content at the start of the forum list item.
+
+forumlist_body_forum_row_before
+===
+* Locations:
+ + styles/prosilver/template/forumlist_body.html
+ + styles/subsilver2/template/forumlist_body.html
+* Since: 3.1.0-RC5
+* Purpose: Add content before the forum list item.
+
+forumlist_body_forum_row_prepend
+===
+* Locations:
+ + styles/prosilver/template/forumlist_body.html
+ + styles/subsilver2/template/forumlist_body.html
+* Since: 3.1.0-RC5
+* Purpose: Add content at the end of the forum list item.
+
forumlist_body_last_post_title_prepend
===
* Locations:
@@ -304,6 +405,14 @@ index_body_block_stats_prepend
* Since: 3.1.0-b3
* Purpose: Prepend content to the statistics list on the Board index
+index_body_forumlist_body_after
+===
+* Locations:
+ + styles/prosilver/template/index_body.html
+ + styles/subsilver2/template/index_body.html
+* Since: 3.1.1
+* Purpose: Add content after the forum list body on the index page
+
index_body_markforums_after
===
* Locations:
@@ -368,6 +477,46 @@ mcp_ban_unban_before
* Since: 3.1.0-RC3
* Purpose: Add additional fields to the unban form in MCP
+mcp_front_latest_logs_after
+===
+* Locations:
+ + styles/prosilver/template/mcp_front.html
+ + styles/subsilver2/template/mcp_front.html
+* Since: 3.1.3-RC1
+* Purpose: Add content after latest logs list
+
+mcp_front_latest_logs_before
+===
+* Locations:
+ + styles/prosilver/template/mcp_front.html
+ + styles/subsilver2/template/mcp_front.html
+* Since: 3.1.3-RC1
+* Purpose: Add content before latest logs list
+
+mcp_front_latest_reported_before
+===
+* Locations:
+ + styles/prosilver/template/mcp_front.html
+ + styles/subsilver2/template/mcp_front.html
+* Since: 3.1.3-RC1
+* Purpose: Add content before latest reported posts list
+
+mcp_front_latest_reported_pms_before
+===
+* Locations:
+ + styles/prosilver/template/mcp_front.html
+ + styles/subsilver2/template/mcp_front.html
+* Since: 3.1.3-RC1
+* Purpose: Add content before latest reported private messages list
+
+mcp_front_latest_unapproved_before
+===
+* Locations:
+ + styles/prosilver/template/mcp_front.html
+ + styles/subsilver2/template/mcp_front.html
+* Since: 3.1.3-RC1
+* Purpose: Add content before latest unapproved posts list
+
memberlist_body_username_append
===
* Locations:
@@ -386,6 +535,30 @@ memberlist_body_username_prepend
* Purpose: Add information before every username in the memberlist. Works in
all display modes (leader, group and normal memberlist).
+memberlist_search_fields_after
+===
+* Locations:
+ + styles/prosilver/template/memberlist_search.html
+ + styles/subsilver2/template/memberlist_search.html
+* Since: 3.1.2-RC1
+* Purpose: Add information after the search fields column.
+
+memberlist_search_fields_before
+===
+* Locations:
+ + styles/prosilver/template/memberlist_search.html
+ + styles/subsilver2/template/memberlist_search.html
+* Since: 3.1.2-RC1
+* Purpose: Add information before the search fields column.
+
+memberlist_search_sorting_options_before
+===
+* Locations:
+ + styles/prosilver/template/memberlist_search.html
+ + styles/subsilver2/template/memberlist_search.html
+* Since: 3.1.2-RC1
+* Purpose: Add information before the search sorting options field.
+
memberlist_view_contact_after
===
* Locations:
@@ -523,6 +696,14 @@ overall_footer_after
* Since: 3.1.0-a1
* Purpose: Add content at the end of the file, directly prior to the `</body>` tag
+overall_footer_body_after
+===
+* Locations:
+ + styles/prosilver/template/overall_footer.html
+ + styles/subsilver2/template/overall_footer.html
+* Since: 3.1.3-RC1
+* Purpose: Add content before the `</body>` tag but after the $SCRIPTS var, i.e. after the js scripts have been loaded
+
overall_footer_breadcrumb_append
===
* Locations:
@@ -611,14 +792,6 @@ overall_header_body_before
* Since: 3.1.0-b2
* Purpose: Add content to the header body
-overall_header_navbar_before
-===
-* Locations:
- + styles/prosilver/template/overall_header.html
- + styles/subsilver2/template/overall_header.html
-* Since: 3.1.4-RC1
-* Purpose: Add content before the navigation bar
-
overall_header_breadcrumb_append
===
* Locations:
@@ -667,6 +840,14 @@ overall_header_head_append
* Since: 3.1.0-a1
* Purpose: Add asset calls directly before the `</head>` tag
+overall_header_navbar_before
+===
+* Locations:
+ + styles/prosilver/template/overall_header.html
+ + styles/subsilver2/template/overall_header.html
+* Since: 3.1.4-RC1
+* Purpose: Add content before the navigation bar
+
overall_header_navigation_append
===
* Locations:
@@ -707,6 +888,13 @@ overall_header_page_body_before
* Since: 3.1.0-b3
* Purpose: Add content after the page-header, but before the page-body
+overall_header_searchbox_before
+===
+* Locations:
+ + styles/prosilver/template/overall_header.html
+* Since: 3.1.4-RC1
+* Purpose: Add content before the search box in the header
+
overall_header_stylesheets_after
===
* Locations:
@@ -732,6 +920,14 @@ posting_editor_buttons_before
* Since: 3.1.0-a3
* Purpose: Add content before the BBCode posting buttons
+posting_editor_buttons_custom_tags_before
+===
+* Locations:
+ + styles/prosilver/template/posting_buttons.html
+ + styles/subsilver2/template/posting_buttons.html
+* Since: 3.1.2-RC1
+* Purpose: Add content inside the BBCode posting buttons and before the customs BBCode
+
posting_editor_message_after
===
* Locations:
@@ -820,6 +1016,22 @@ quickreply_editor_message_before
* Since: 3.1.0-a4
* Purpose: Add content before the quick reply textbox
+search_results_header_after
+===
+* Locations:
+ + styles/prosilver/template/search_results.html
+ + styles/subsilver2/template/search_results.html
+* Since: 3.1.4-RC1
+* Purpose: Add content after the header of the search results
+
+search_results_header_before
+===
+* Locations:
+ + styles/prosilver/template/search_results.html
+ + styles/subsilver2/template/search_results.html
+* Since: 3.1.4-RC1
+* Purpose: Add content before the header of the search results.
+
search_results_post_after
===
* Locations:
@@ -850,6 +1062,14 @@ search_results_postprofile_before
* Since: 3.1.0-b3
* Purpose: Add content directly before the post author in search results (posts view mode)
+search_results_searchbox_after
+===
+* Locations:
+ + styles/prosilver/template/search_results.html
+ + styles/subsilver2/template/search_results.html
+* Since: 3.1.4-RC1
+* Purpose: Add content right after the searchbox of the search results.
+
search_results_topic_after
===
* Locations:
@@ -987,7 +1207,7 @@ ucp_pm_viewmessage_post_buttons_after
+ styles/prosilver/template/ucp_pm_viewmessage.html
+ styles/subsilver2/template/ucp_pm_viewmessage.html
* Since: 3.1.0-RC3
-* Purpose: Add post button to private messages (next to edit, quote etc), at
+* Purpose: Add post button to private messages (next to edit, quote etc), at
the end of the list.
ucp_pm_viewmessage_post_buttons_before
@@ -996,7 +1216,7 @@ ucp_pm_viewmessage_post_buttons_before
+ styles/prosilver/template/ucp_pm_viewmessage.html
+ styles/subsilver2/template/ucp_pm_viewmessage.html
* Since: 3.1.0-RC3
-* Purpose: Add post button to private messages (next to edit, quote etc), at
+* Purpose: Add post button to private messages (next to edit, quote etc), at
the start of the list.
ucp_pm_viewmessage_print_head_append
@@ -1075,6 +1295,38 @@ ucp_prefs_view_select_menu_append
* Purpose: Add options to the bottom of the drop-down lists block of the Edit
Display Options screen
+ucp_profile_profile_info_before
+===
+* Locations:
+ + styles/prosilver/template/ucp_profile_profile_info.html
+ + styles/subsilver2/template/ucp_profile_profile_info.html
+* Since: 3.1.4-RC1
+* Purpose: Add options in profile page fieldset - before jabber field.
+
+ucp_profile_profile_info_after
+===
+* Locations:
+ + styles/prosilver/template/ucp_profile_profile_info.html
+ + styles/subsilver2/template/ucp_profile_profile_info.html
+* Since: 3.1.4-RC1
+* Purpose: Add options in profile page fieldset - after custom profile fields.
+
+ucp_profile_register_details_before
+===
+* Locations:
+ + styles/prosilver/template/ucp_profile_reg_details.html
+ + styles/subsilver2/template/ucp_profile_reg_details.html
+* Since: 3.1.4-RC1
+* Purpose: Add options in profile page fieldset - before first field.
+
+ucp_profile_register_details_after
+===
+* Locations:
+ + styles/prosilver/template/ucp_profile_reg_details.html
+ + styles/subsilver2/template/ucp_profile_reg_details.html
+* Since: 3.1.4-RC1
+* Purpose: Add options in profile page fieldset - after confirm password field.
+
ucp_register_credentials_before
===
* Locations:
@@ -1131,6 +1383,70 @@ ucp_friend_list_after
* Since: 3.1.0-a4
* Purpose: Add optional elements after list of friends in UCP
+viewforum_buttons_bottom_before
+===
+* Locations:
+ + styles/prosilver/template/viewforum_body.html
+ + styles/subsilver2/template/viewforum_body.html
+* Since: 3.1.0-RC5
+* Purpose: Add buttons before New Topic button on the bottom of the topic's list
+
+viewforum_buttons_bottom_after
+===
+* Locations:
+ + styles/prosilver/template/viewforum_body.html
+ + styles/subsilver2/template/viewforum_body.html
+* Since: 3.1.0-RC5
+* Purpose: Add buttons after New Topic button on the bottom of the topic's list
+
+viewforum_buttons_top_before
+===
+* Locations:
+ + styles/prosilver/template/viewforum_body.html
+ + styles/subsilver2/template/viewforum_body.html
+* Since: 3.1.0-RC5
+* Purpose: Add buttons before New Topic button on the top of the topic's list
+
+viewforum_buttons_top_after
+===
+* Locations:
+ + styles/prosilver/template/viewforum_body.html
+ + styles/subsilver2/template/viewforum_body.html
+* Since: 3.1.0-RC5
+* Purpose: Add buttons after New Topic button on the top of the topic's list
+
+viewtopic_buttons_bottom_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-RC5
+* Purpose: Add buttons before Post Reply button on the bottom of the posts's list
+
+viewtopic_buttons_bottom_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-RC5
+* Purpose: Add buttons after Post Reply button on the bottom of the posts's list
+
+viewtopic_buttons_top_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-RC5
+* Purpose: Add buttons before Post Reply button on the top of the posts's list
+
+viewtopic_buttons_top_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.0-RC5
+* Purpose: Add buttons after Post Reply button on the top of the posts's list
+
viewforum_forum_name_append
===
* Locations:
@@ -1155,6 +1471,14 @@ viewtopic_print_head_append
* Since: 3.1.0-a1
* Purpose: Add asset calls directly before the `</head>` tag of the Print Topic screen
+viewtopic_body_pagination_top_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.4-RC1
+* Purpose: Add content after the pagination at top
+
viewtopic_body_avatar_after
===
* Locations:
@@ -1231,6 +1555,22 @@ viewtopic_body_poll_question_prepend
* Since: 3.1.0-b3
* Purpose: Add content directly before the poll question on the View topic screen
+viewtopic_body_post_author_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.3-RC1
+* Purpose: Add content directly after the post author on the view topic screen
+
+viewtopic_body_post_author_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.3-RC1
+* Purpose: Add content directly before the post author on the view topic screen
+
viewtopic_body_post_buttons_after
===
* Locations:
@@ -1291,6 +1631,22 @@ viewtopic_body_postrow_post_content_footer
* Since: 3.1.0-RC4
* Purpose: Add data at the end of the posts.
+viewtopic_body_postrow_post_details_after
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.4-RC1
+* Purpose: Add content after the post details
+
+viewtopic_body_postrow_post_details_before
+===
+* Locations:
+ + styles/prosilver/template/viewtopic_body.html
+ + styles/subsilver2/template/viewtopic_body.html
+* Since: 3.1.4-RC1
+* Purpose: Add content before the post details
+
viewtopic_body_postrow_post_notices_after
===
* Locations:
diff --git a/phpBB/docs/site_logo.gif b/phpBB/docs/site_logo.gif
deleted file mode 100644
index 909114c377..0000000000
--- a/phpBB/docs/site_logo.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/faq.php b/phpBB/faq.php
index 0b4aa33073..5fe155eab0 100644
--- a/phpBB/faq.php
+++ b/phpBB/faq.php
@@ -35,8 +35,30 @@ switch ($mode)
break;
default:
- $l_title = $user->lang['FAQ_EXPLAIN'];
- $user->add_lang('faq', false, true);
+ $page_title = $user->lang['FAQ_EXPLAIN'];
+ $ext_name = $lang_file = '';
+
+ /**
+ * You can use this event display a custom help page
+ *
+ * @event core.faq_mode_validation
+ * @var string page_title Title of the page
+ * @var string mode FAQ that is going to be displayed
+ * @var string lang_file Language file containing the help data
+ * @var string ext_name Vendor and extension name where the help
+ * language file can be loaded from
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'page_title',
+ 'mode',
+ 'lang_file',
+ 'ext_name',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.faq_mode_validation', compact($vars)));
+
+ $l_title = $page_title;
+ $user->add_lang(($lang_file) ? $lang_file : 'faq', false, true, $ext_name);
break;
}
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php
index 2372c1f73c..67fba1094d 100644
--- a/phpBB/includes/acp/acp_attachments.php
+++ b/phpBB/includes/acp/acp_attachments.php
@@ -153,7 +153,7 @@ class acp_attachments
'img_create_thumbnail' => array('lang' => 'CREATE_THUMBNAIL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'img_max_thumb_width' => array('lang' => 'MAX_THUMB_WIDTH', 'validate' => 'int:0:999999999999999', 'type' => 'number:0:999999999999999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
'img_min_thumb_filesize' => array('lang' => 'MIN_THUMB_FILESIZE', 'validate' => 'int:0:999999999999999', 'type' => 'number:0:999999999999999', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
- 'img_imagick' => array('lang' => 'IMAGICK_PATH', 'validate' => 'string', 'type' => 'text:20:200', 'explain' => true, 'append' => '&nbsp;&nbsp;<span>[ <a href="' . $this->u_action . '&amp;action=imgmagick">' . $user->lang['SEARCH_IMAGICK'] . '</a> ]</span>'),
+ 'img_imagick' => array('lang' => 'IMAGICK_PATH', 'validate' => 'absolute_path', 'type' => 'text:20:200', 'explain' => true, 'append' => '&nbsp;&nbsp;<span>[ <a href="' . $this->u_action . '&amp;action=imgmagick">' . $user->lang['SEARCH_IMAGICK'] . '</a> ]</span>'),
'img_max' => array('lang' => 'MAX_IMAGE_SIZE', 'validate' => 'int:0:9999', 'type' => 'dimension:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
'img_link' => array('lang' => 'IMAGE_LINK_SIZE', 'validate' => 'int:0:9999', 'type' => 'dimension:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
)
diff --git a/phpBB/includes/acp/acp_ban.php b/phpBB/includes/acp/acp_ban.php
index 361ef2666c..b555f46a94 100644
--- a/phpBB/includes/acp/acp_ban.php
+++ b/phpBB/includes/acp/acp_ban.php
@@ -25,14 +25,13 @@ class acp_ban
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $cache;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
+ global $user, $template, $request, $phpbb_dispatcher;
+ global $phpbb_root_path, $phpEx;
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
- $bansubmit = (isset($_POST['bansubmit'])) ? true : false;
- $unbansubmit = (isset($_POST['unbansubmit'])) ? true : false;
- $current_time = time();
+ $bansubmit = $request->is_set_post('bansubmit');
+ $unbansubmit = $request->is_set_post('unbansubmit');
$user->add_lang(array('acp/ban', 'acp/users'));
$this->tpl_name = 'acp_ban';
@@ -48,23 +47,79 @@ class acp_ban
if ($bansubmit)
{
// Grab the list of entries
- $ban = utf8_normalize_nfc(request_var('ban', '', true));
- $ban_len = request_var('banlength', 0);
- $ban_len_other = request_var('banlengthother', '');
- $ban_exclude = request_var('banexclude', 0);
- $ban_reason = utf8_normalize_nfc(request_var('banreason', '', true));
- $ban_give_reason = utf8_normalize_nfc(request_var('bangivereason', '', true));
+ $ban = $request->variable('ban', '', true);
+ $ban_length = $request->variable('banlength', 0);
+ $ban_length_other = $request->variable('banlengthother', '');
+ $ban_exclude = $request->variable('banexclude', 0);
+ $ban_reason = $request->variable('banreason', '', true);
+ $ban_give_reason = $request->variable('bangivereason', '', true);
if ($ban)
{
- user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reason, $ban_give_reason);
+ $abort_ban = false;
+ /**
+ * Use this event to modify the ban details before the ban is performed
+ *
+ * @event core.acp_ban_before
+ * @var string mode One of the following: user, ip, email
+ * @var string ban Either string or array with usernames, ips or email addresses
+ * @var int ban_length Ban length in minutes
+ * @var string ban_length_other Ban length as a date (YYYY-MM-DD)
+ * @var bool ban_exclude Are we banning or excluding from another ban
+ * @var string ban_reason Ban reason displayed to moderators
+ * @var string ban_give_reason Ban reason displayed to the banned user
+ * @var mixed abort_ban Either false, or an error message that is displayed to the user.
+ * If a string is given the bans are not issued.
+ * @since 3.1.0-RC5
+ */
+ $vars = array(
+ 'mode',
+ 'ban',
+ 'ban_length',
+ 'ban_length_other',
+ 'ban_exclude',
+ 'ban_reason',
+ 'ban_give_reason',
+ 'abort_ban',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.acp_ban_before', compact($vars)));
+
+ if ($abort_ban)
+ {
+ trigger_error($abort_ban . adm_back_link($this->u_action));
+ }
+ user_ban($mode, $ban, $ban_length, $ban_length_other, $ban_exclude, $ban_reason, $ban_give_reason);
+
+ /**
+ * Use this event to perform actions after the ban has been performed
+ *
+ * @event core.acp_ban_after
+ * @var string mode One of the following: user, ip, email
+ * @var string ban Either string or array with usernames, ips or email addresses
+ * @var int ban_length Ban length in minutes
+ * @var string ban_length_other Ban length as a date (YYYY-MM-DD)
+ * @var bool ban_exclude Are we banning or excluding from another ban
+ * @var string ban_reason Ban reason displayed to moderators
+ * @var string ban_give_reason Ban reason displayed to the banned user
+ * @since 3.1.0-RC5
+ */
+ $vars = array(
+ 'mode',
+ 'ban',
+ 'ban_length',
+ 'ban_length_other',
+ 'ban_exclude',
+ 'ban_reason',
+ 'ban_give_reason',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.acp_ban_after', compact($vars)));
trigger_error($user->lang['BAN_UPDATE_SUCCESSFUL'] . adm_back_link($this->u_action));
}
}
else if ($unbansubmit)
{
- $ban = request_var('unban', array(''));
+ $ban = $request->variable('unban', array(''));
if ($ban)
{
diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php
index 130a3ef542..e245eea069 100644
--- a/phpBB/includes/acp/acp_bbcodes.php
+++ b/phpBB/includes/acp/acp_bbcodes.php
@@ -409,7 +409,9 @@ class acp_bbcodes
{
$bbcode_match = trim($bbcode_match);
$bbcode_tpl = trim($bbcode_tpl);
- $utf8 = strpos($bbcode_match, 'INTTEXT') !== false;
+
+ // Allow unicode characters for URL|LOCAL_URL|RELATIVE_URL|INTTEXT tokens
+ $utf8 = preg_match('/(URL|LOCAL_URL|RELATIVE_URL|INTTEXT)/', $bbcode_match);
$utf8_pcre_properties = phpbb_pcre_utf8_support();
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 9c9e32b57c..63e2647f02 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -65,13 +65,16 @@ class acp_board
'default_lang' => array('lang' => 'DEFAULT_LANGUAGE', 'validate' => 'lang', 'type' => 'select', 'function' => 'language_select', 'params' => array('{CONFIG_VALUE}'), 'explain' => false),
'default_dateformat' => array('lang' => 'DEFAULT_DATE_FORMAT', 'validate' => 'string', 'type' => 'custom', 'method' => 'dateformat_select', 'explain' => true),
'board_timezone' => array('lang' => 'SYSTEM_TIMEZONE', 'validate' => 'timezone', 'type' => 'custom', 'method' => 'timezone_select', 'explain' => true),
- 'default_style' => array('lang' => 'DEFAULT_STYLE', 'validate' => 'int', 'type' => 'select', 'function' => 'style_select', 'params' => array('{CONFIG_VALUE}', false), 'explain' => false),
+
+ 'legend2' => 'BOARD_STYLE',
+ 'default_style' => array('lang' => 'DEFAULT_STYLE', 'validate' => 'int', 'type' => 'select', 'function' => 'style_select', 'params' => array('{CONFIG_VALUE}', false), 'explain' => true),
+ 'guest_style' => array('lang' => 'GUEST_STYLE', 'validate' => 'int', 'type' => 'select', 'function' => 'style_select', 'params' => array($this->guest_style_get(), false), 'explain' => true),
'override_user_style' => array('lang' => 'OVERRIDE_STYLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
- 'legend2' => 'WARNINGS',
+ 'legend3' => 'WARNINGS',
'warnings_expire_days' => array('lang' => 'WARNINGS_EXPIRE', 'validate' => 'int:0:9999', 'type' => 'number:0:9999', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
- 'legend3' => 'ACP_SUBMIT_CHANGES',
+ 'legend4' => 'ACP_SUBMIT_CHANGES',
)
);
break;
@@ -509,6 +512,14 @@ class acp_board
continue;
}
+ if ($config_name == 'guest_style')
+ {
+ if (isset($cfg_array[$config_name])) {
+ $this->guest_style_set($cfg_array[$config_name]);
+ }
+ continue;
+ }
+
$this->new_config[$config_name] = $config_value = $cfg_array[$config_name];
if ($config_name == 'email_function_name')
@@ -604,7 +615,15 @@ class acp_board
{
add_log('admin', 'LOG_CONFIG_' . strtoupper($mode));
- trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($this->u_action));
+ $message = $user->lang('CONFIG_UPDATED');
+ $message_type = E_USER_NOTICE;
+ if (!$config['email_enable'] && in_array($mode, array('email', 'registration')) &&
+ in_array($config['require_activation'], array(USER_ACTIVATION_SELF, USER_ACTIVATION_ADMIN)))
+ {
+ $message .= '<br /><br />' . $user->lang('ACC_ACTIVATION_WARNING');
+ $message_type = E_USER_WARNING;
+ }
+ trigger_error($message . adm_back_link($this->u_action), $message_type);
}
$this->tpl_name = 'acp_board';
@@ -781,20 +800,19 @@ class acp_board
global $user, $config;
$act_ary = array(
- 'ACC_DISABLE' => USER_ACTIVATION_DISABLE,
- 'ACC_NONE' => USER_ACTIVATION_NONE,
+ 'ACC_DISABLE' => array(true, USER_ACTIVATION_DISABLE),
+ 'ACC_NONE' => array(true, USER_ACTIVATION_NONE),
+ 'ACC_USER' => array($config['email_enable'], USER_ACTIVATION_SELF),
+ 'ACC_ADMIN' => array($config['email_enable'], USER_ACTIVATION_ADMIN),
);
- if ($config['email_enable'])
- {
- $act_ary['ACC_USER'] = USER_ACTIVATION_SELF;
- $act_ary['ACC_ADMIN'] = USER_ACTIVATION_ADMIN;
- }
- $act_options = '';
- foreach ($act_ary as $key => $value)
+ $act_options = '';
+ foreach ($act_ary as $key => $data)
{
+ list($available, $value) = $data;
$selected = ($selected_value == $value) ? ' selected="selected"' : '';
- $act_options .= '<option value="' . $value . '"' . $selected . '>' . $user->lang[$key] . '</option>';
+ $class = (!$available) ? ' class="disabled-option"' : '';
+ $act_options .= '<option value="' . $value . '"' . $selected . $class . '>' . $user->lang($key) . '</option>';
}
return $act_options;
@@ -912,6 +930,39 @@ class acp_board
}
/**
+ * Get guest style
+ */
+ public function guest_style_get()
+ {
+ global $db;
+
+ $sql = 'SELECT user_style
+ FROM ' . USERS_TABLE . '
+ WHERE user_id = ' . ANONYMOUS;
+ $result = $db->sql_query($sql);
+
+ $style = (int) $db->sql_fetchfield('user_style');
+ $db->sql_freeresult($result);
+
+ return $style;
+ }
+
+ /**
+ * Set guest style
+ *
+ * @param int $style_id The style ID
+ */
+ public function guest_style_set($style_id)
+ {
+ global $db;
+
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET user_style = ' . (int) $style_id . '
+ WHERE user_id = ' . ANONYMOUS;
+ $db->sql_query($sql);
+ }
+
+ /**
* Select default dateformat
*/
function dateformat_select($value, $key)
diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php
index fe55b36e67..fda9d50779 100644
--- a/phpBB/includes/acp/acp_email.php
+++ b/phpBB/includes/acp/acp_email.php
@@ -26,7 +26,7 @@ class acp_email
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
+ global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $phpbb_dispatcher;
$user->add_lang('acp/email');
$this->tpl_name = 'acp_email';
@@ -40,6 +40,7 @@ class acp_email
$error = array();
$usernames = request_var('usernames', '', true);
+ $usernames = (!empty($usernames)) ? explode("\n", $usernames) : array();
$group_id = request_var('g', 0);
$subject = utf8_normalize_nfc(request_var('subject', '', true));
$message = utf8_normalize_nfc(request_var('message', '', true));
@@ -69,14 +70,18 @@ class acp_email
if (!sizeof($error))
{
- if ($usernames)
+ if (!empty($usernames))
{
// If giving usernames the admin is able to email inactive users too...
- $sql = 'SELECT username, user_email, user_jabber, user_notify_type, user_lang
- FROM ' . USERS_TABLE . '
- WHERE ' . $db->sql_in_set('username_clean', array_map('utf8_clean_string', explode("\n", $usernames))) . '
- AND user_allow_massemail = 1
- ORDER BY user_lang, user_notify_type'; // , SUBSTRING(user_email FROM INSTR(user_email, '@'))
+ $sql_ary = array(
+ 'SELECT' => 'username, user_email, user_jabber, user_notify_type, user_lang',
+ 'FROM' => array(
+ USERS_TABLE => '',
+ ),
+ 'WHERE' => $db->sql_in_set('username_clean', array_map('utf8_clean_string', $usernames)) . '
+ AND user_allow_massemail = 1',
+ 'ORDER_BY' => 'user_lang, user_notify_type',
+ );
}
else
{
@@ -123,8 +128,18 @@ class acp_email
),
);
}
- $sql = $db->sql_build_query('SELECT', $sql_ary);
}
+ /**
+ * Modify sql query to change the list of users the email is sent to
+ *
+ * @event core.acp_email_modify_sql
+ * @var array sql_ary Array which is used to build the sql query
+ * @since 3.1.2-RC1
+ */
+ $vars = array('sql_ary');
+ extract($phpbb_dispatcher->trigger_event('core.acp_email_modify_sql', compact($vars)));
+
+ $sql = $db->sql_build_query('SELECT', $sql_ary);
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
@@ -180,6 +195,39 @@ class acp_email
$errored = false;
+ $email_template = 'admin_send_email';
+ $template_data = array(
+ 'CONTACT_EMAIL' => phpbb_get_board_contact($config, $phpEx),
+ 'MESSAGE' => htmlspecialchars_decode($message),
+ );
+ $generate_log_entry = true;
+
+ /**
+ * Modify email template data before the emails are sent
+ *
+ * @event core.acp_email_send_before
+ * @var string email_template The template to be used for sending the email
+ * @var string subject The subject of the email
+ * @var array template_data Array with template data assigned to email template
+ * @var bool generate_log_entry If false, no log entry will be created
+ * @var array usernames Usernames which will be displayed in log entry, if it will be created
+ * @var int group_id The group this email will be sent to
+ * @var bool use_queue If true, email queue will be used for sending
+ * @var int priority Priority of sent emails
+ * @since 3.1.3-RC1
+ */
+ $vars = array(
+ 'email_template',
+ 'subject',
+ 'template_data',
+ 'generate_log_entry',
+ 'usernames',
+ 'group_id',
+ 'use_queue',
+ 'priority',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.acp_email_send_before', compact($vars)));
+
for ($i = 0, $size = sizeof($email_list); $i < $size; $i++)
{
$used_lang = $email_list[$i][0]['lang'];
@@ -193,17 +241,14 @@ class acp_email
$messenger->im($email_row['jabber'], $email_row['name']);
}
- $messenger->template('admin_send_email', $used_lang);
+ $messenger->template($email_template, $used_lang);
$messenger->anti_abuse_headers($config, $user);
$messenger->subject(htmlspecialchars_decode($subject));
$messenger->set_mail_priority($priority);
- $messenger->assign_vars(array(
- 'CONTACT_EMAIL' => phpbb_get_board_contact($config, $phpEx),
- 'MESSAGE' => htmlspecialchars_decode($message))
- );
+ $messenger->assign_vars($template_data);
if (!($messenger->send($used_method)))
{
@@ -214,24 +259,26 @@ class acp_email
$messenger->save_queue();
- if ($usernames)
+ if ($generate_log_entry)
{
- $usernames = explode("\n", $usernames);
- add_log('admin', 'LOG_MASS_EMAIL', implode(', ', utf8_normalize_nfc($usernames)));
- }
- else
- {
- if ($group_id)
+ if (!empty($usernames))
{
- $group_name = get_group_name($group_id);
+ add_log('admin', 'LOG_MASS_EMAIL', implode(', ', utf8_normalize_nfc($usernames)));
}
else
{
- // Not great but the logging routine doesn't cope well with localising on the fly
- $group_name = $user->lang['ALL_USERS'];
- }
+ if ($group_id)
+ {
+ $group_name = get_group_name($group_id);
+ }
+ else
+ {
+ // Not great but the logging routine doesn't cope well with localising on the fly
+ $group_name = $user->lang['ALL_USERS'];
+ }
- add_log('admin', 'LOG_MASS_EMAIL', $group_name);
+ add_log('admin', 'LOG_MASS_EMAIL', $group_name);
+ }
}
if (!$errored)
@@ -267,17 +314,31 @@ class acp_email
$s_priority_options .= '<option value="' . MAIL_NORMAL_PRIORITY . '" selected="selected">' . $user->lang['MAIL_NORMAL_PRIORITY'] . '</option>';
$s_priority_options .= '<option value="' . MAIL_HIGH_PRIORITY . '">' . $user->lang['MAIL_HIGH_PRIORITY'] . '</option>';
- $template->assign_vars(array(
+ $template_data = array(
'S_WARNING' => (sizeof($error)) ? true : false,
'WARNING_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
'U_ACTION' => $this->u_action,
'S_GROUP_OPTIONS' => $select_list,
- 'USERNAMES' => $usernames,
+ 'USERNAMES' => implode("\n", $usernames),
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&amp;form=acp_email&amp;field=usernames'),
'SUBJECT' => $subject,
'MESSAGE' => $message,
- 'S_PRIORITY_OPTIONS' => $s_priority_options)
+ 'S_PRIORITY_OPTIONS' => $s_priority_options,
);
+ /**
+ * Modify custom email template data before we display the form
+ *
+ * @event core.acp_email_display
+ * @var array template_data Array with template data assigned to email template
+ * @var array exclude Array with groups which are excluded from group selection
+ * @var array usernames Usernames which will be displayed in form
+ *
+ * @since 3.1.4-RC1
+ */
+ $vars = array('template_data', 'exclude', 'usernames');
+ extract($phpbb_dispatcher->trigger_event('core.acp_email_display', compact($vars)));
+
+ $template->assign_vars($template_data);
}
}
diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php
index 9bdd8eb458..0c9bc0deab 100644
--- a/phpBB/includes/acp/acp_extensions.php
+++ b/phpBB/includes/acp/acp_extensions.php
@@ -174,11 +174,6 @@ class acp_extensions
trigger_error($user->lang['EXTENSION_NOT_ENABLEABLE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- if ($phpbb_extension_manager->is_enabled($ext_name))
- {
- redirect($this->u_action);
- }
-
try
{
while ($phpbb_extension_manager->enable_step($ext_name))
@@ -537,7 +532,7 @@ class acp_extensions
$version_check = $meta['extra']['version-check'];
- $version_helper = new \phpbb\version_helper($this->cache, $this->config, $this->user);
+ $version_helper = new \phpbb\version_helper($this->cache, $this->config, new \phpbb\file_downloader(), $this->user);
$version_helper->set_current_version($meta['version']);
$version_helper->set_file_location($version_check['host'], $version_check['directory'], $version_check['filename']);
$version_helper->force_stability($this->config['extension_force_unstable'] ? 'unstable' : null);
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index 2a28226d6c..48ca05a118 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -655,8 +655,8 @@ class acp_main
'S_MBSTRING_LOADED' => true,
'S_MBSTRING_FUNC_OVERLOAD_FAIL' => (intval(@ini_get('mbstring.func_overload')) & (MB_OVERLOAD_MAIL | MB_OVERLOAD_STRING)),
'S_MBSTRING_ENCODING_TRANSLATION_FAIL' => (@ini_get('mbstring.encoding_translation') != 0),
- 'S_MBSTRING_HTTP_INPUT_FAIL' => (@ini_get('mbstring.http_input') != 'pass'),
- 'S_MBSTRING_HTTP_OUTPUT_FAIL' => (@ini_get('mbstring.http_output') != 'pass'),
+ 'S_MBSTRING_HTTP_INPUT_FAIL' => !in_array(@ini_get('mbstring.http_input'), array('pass', '')),
+ 'S_MBSTRING_HTTP_OUTPUT_FAIL' => !in_array(@ini_get('mbstring.http_output'), array('pass', '')),
));
}
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index 046281596c..97c1f62077 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -460,7 +460,7 @@ class acp_profile
if (!$cp->vars[$key] && $action == 'edit')
{
- $cp->vars[$key] = $$key;
+ $cp->vars[$key] = ${$key};
}
$field_data = $cp->vars;
diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php
index a10b248324..6eb213fd7a 100644
--- a/phpBB/includes/acp/acp_prune.php
+++ b/phpBB/includes/acp/acp_prune.php
@@ -397,7 +397,7 @@ class acp_prune
$joined_after = request_var('joined_after', '');
$active = request_var('active', '');
- $count = request_var('count', 0);
+ $count = ($request->variable('count', '') === '') ? false : $request->variable('count', 0);
$active = ($active) ? explode('-', $active) : array();
$joined_before = ($joined_before) ? explode('-', $joined_before) : array();
@@ -439,7 +439,7 @@ class acp_prune
$where_sql .= ($username) ? ' AND username_clean ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), utf8_clean_string($username))) : '';
$where_sql .= ($email) ? ' AND user_email ' . $db->sql_like_expression(str_replace('*', $db->get_any_char(), $email)) . ' ' : '';
$where_sql .= $joined_sql;
- $where_sql .= ($count) ? " AND user_posts " . $key_match[$count_select] . ' ' . (int) $count . ' ' : '';
+ $where_sql .= ($count !== false) ? " AND user_posts " . $key_match[$count_select] . ' ' . (int) $count . ' ' : '';
// First handle pruning of users who never logged in, last active date is 0000-00-00
if (sizeof($active) && (int) $active[0] == 0 && (int) $active[1] == 0 && (int) $active[2] == 0)
@@ -507,7 +507,7 @@ class acp_prune
AND ug.user_id <> ' . ANONYMOUS . '
AND u.user_type <> ' . USER_FOUNDER . '
AND ug.user_pending = 0 ' .
- ((!empty($user_ids)) ? 'AND ' . $db->sql_in_set('ug.user_id', $user_ids) : '') . '
+ ((!empty($user_ids)) ? ' AND ' . $db->sql_in_set('ug.user_id', $user_ids) : '') . '
AND u.user_id = ug.user_id';
$result = $db->sql_query($sql);
@@ -533,7 +533,7 @@ class acp_prune
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . ' u
WHERE u.user_id <> ' . ANONYMOUS . '
AND u.user_type <> ' . USER_FOUNDER .
- ((!empty($user_ids)) ? 'AND ' . $db->sql_in_set('p.poster_id', $user_ids) : '') . '
+ ((!empty($user_ids)) ? ' AND ' . $db->sql_in_set('p.poster_id', $user_ids) : '') . '
AND ' . $db->sql_in_set('p.post_visibility', array(ITEM_UNAPPROVED, ITEM_REAPPROVE)) . '
AND u.user_id = p.poster_id
GROUP BY p.poster_id
diff --git a/phpBB/includes/acp/acp_search.php b/phpBB/includes/acp/acp_search.php
index eddc6871f8..9ff999567a 100644
--- a/phpBB/includes/acp/acp_search.php
+++ b/phpBB/includes/acp/acp_search.php
@@ -449,7 +449,6 @@ class acp_search
$search = null;
$error = false;
- $search_options = '';
foreach ($search_types as $type)
{
if ($this->init_search($type, $search, $error) || !method_exists($search, 'index_created'))
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index 2a02e3e845..6bd27a8bca 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -29,14 +29,31 @@ class acp_styles
protected $styles_path;
protected $styles_path_absolute = 'styles';
protected $default_style = 0;
+ protected $styles_list_cols = 0;
+ protected $reserved_style_names = array('adm', 'admin', 'all');
+ /** @var \phpbb\db\driver\driver_interface */
protected $db;
+
+ /** @var \phpbb\user */
protected $user;
+
+ /** @var \phpbb\template\template */
protected $template;
+
+ /** @var \phpbb\request\request_interface */
protected $request;
+
+ /** @var \phpbb\cache\driver\driver_interface */
protected $cache;
+
+ /** @var \phpbb\auth\auth */
protected $auth;
+
+ /** @var string */
protected $phpbb_root_path;
+
+ /** @var string */
protected $php_ext;
public function main($id, $mode)
@@ -70,11 +87,6 @@ class acp_styles
$action = $this->request->variable('action', '');
$post_actions = array('install', 'activate', 'deactivate', 'uninstall');
- if ($action && in_array($action, $post_actions) && !check_link_hash($request->variable('hash', ''), $action))
- {
- trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
- }
-
foreach ($post_actions as $key)
{
if ($this->request->is_set_post($key))
@@ -83,6 +95,18 @@ class acp_styles
}
}
+ // The uninstall action uses confirm_box() to verify the validity of the request,
+ // so there is no need to check for a valid token here.
+ if (in_array($action, $post_actions) && $action != 'uninstall')
+ {
+ $is_valid_request = check_link_hash($request->variable('hash', ''), $action) || check_form_key('styles_management');
+
+ if (!$is_valid_request)
+ {
+ trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
+ }
+ }
+
if ($action != '')
{
$this->s_hidden_fields['action'] = $action;
@@ -122,6 +146,8 @@ class acp_styles
*/
protected function frontend()
{
+ add_form_key('styles_management');
+
// Check mode
switch ($this->mode)
{
@@ -133,33 +159,11 @@ class acp_styles
$this->welcome_message('INSTALL_STYLES', 'INSTALL_STYLES_EXPLAIN');
$this->show_available();
return;
- case 'cache':
- $this->action_cache();
- return;
}
trigger_error($this->user->lang['NO_MODE'] . adm_back_link($this->u_action), E_USER_WARNING);
}
/**
- * Purge cache
- */
- protected function action_cache()
- {
- global $db, $cache, $auth;
-
- $this->config->increment('assets_version', 1);
- $this->cache->purge();
-
- // Clear permissions
- $this->auth->acl_clear_prefetch();
- phpbb_cache_moderators($db, $cache, $auth);
-
- add_log('admin', 'LOG_PURGE_CACHE');
-
- trigger_error($this->user->lang['PURGED_CACHE'] . adm_back_link($this->u_base_action), E_USER_NOTICE);
- }
-
- /**
* Install style(s)
*/
protected function action_install()
@@ -177,6 +181,12 @@ class acp_styles
$last_installed = false;
foreach ($dirs as $dir)
{
+ if (in_array($dir, $this->reserved_style_names))
+ {
+ $messages[] = $this->user->lang('STYLE_NAME_RESERVED', htmlspecialchars($dir));
+ continue;
+ }
+
$found = false;
foreach ($styles as &$style)
{
@@ -822,7 +832,7 @@ class acp_styles
* Update styles tree
*
* @param array $styles Styles list, passed as reference
- * @param array $style Current style, false if root
+ * @param array|false $style Current style, false if root
* @return bool True if something was updated, false if not
*/
protected function update_styles_tree(&$styles, $style = false)
@@ -1104,7 +1114,7 @@ class acp_styles
/**
* Install style
*
- * @param $style style data
+ * @param array $style style data
* @return int Style id
*/
protected function install_style($style)
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 31b033604d..8c17fb6311 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -173,6 +173,21 @@ class acp_users
$delete_type = request_var('delete_type', '');
$ip = request_var('ip', 'ip');
+ /**
+ * Run code at beginning of ACP users overview
+ *
+ * @event core.acp_users_overview_before
+ * @var array user_row Current user data
+ * @var string mode Active module
+ * @var string action Module that should be run
+ * @var bool submit Do we display the form only
+ * or did the user press submit
+ * @var array error Array holding error messages
+ * @since 3.1.3-RC1
+ */
+ $vars = array('user_row', 'mode', 'action', 'submit', 'error');
+ extract($phpbb_dispatcher->trigger_event('core.acp_users_overview_before', compact($vars)));
+
if ($submit)
{
if ($delete)
@@ -1362,6 +1377,19 @@ class acp_users
$data['bday_year'] = request_var('bday_year', $data['bday_year']);
$data['user_birthday'] = sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']);
+ /**
+ * Modify user data on editing profile in ACP
+ *
+ * @event core.acp_users_modify_profile
+ * @var array data Array with user profile data
+ * @var bool submit Flag indicating if submit button has been pressed
+ * @var int user_id The user id
+ * @var array user_row Array with the full user data
+ * @since 3.1.4-RC1
+ */
+ $vars = array('data', 'submit', 'user_id', 'user_row');
+ extract($phpbb_dispatcher->trigger_event('core.acp_users_modify_profile', compact($vars)));
+
if ($submit)
{
$error = validate_data($data, array(
@@ -1386,6 +1414,18 @@ class acp_users
$error[] = 'FORM_INVALID';
}
+ /**
+ * Validate profile data in ACP before submitting to the database
+ *
+ * @event core.acp_users_profile_validate
+ * @var bool submit Flag indicating if submit button has been pressed
+ * @var array data Array with user profile data
+ * @var array error Array with the form errors
+ * @since 3.1.4-RC1
+ */
+ $vars = array('submit', 'data', 'error');
+ extract($phpbb_dispatcher->trigger_event('core.acp_users_profile_validate', compact($vars)));
+
if (!sizeof($error))
{
$sql_ary = array(
@@ -1393,6 +1433,20 @@ class acp_users
'user_birthday' => $data['user_birthday'],
);
+ /**
+ * Modify profile data in ACP before submitting to the database
+ *
+ * @event core.acp_users_profile_modify_sql_ary
+ * @var array cp_data Array with the user custom profile fields data
+ * @var array data Array with user profile data
+ * @var int user_id The user id
+ * @var array user_row Array with the full user data
+ * @var array sql_ary Array with sql data
+ * @since 3.1.4-RC1
+ */
+ $vars = array('cp_data', 'data', 'user_id', 'user_row', 'sql_ary');
+ extract($phpbb_dispatcher->trigger_event('core.acp_users_profile_modify_sql_ary', compact($vars)));
+
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
WHERE user_id = $user_id";
diff --git a/phpBB/includes/acp/info/acp_styles.php b/phpBB/includes/acp/info/acp_styles.php
index 1a9865aa1d..c0ab005502 100644
--- a/phpBB/includes/acp/info/acp_styles.php
+++ b/phpBB/includes/acp/info/acp_styles.php
@@ -22,7 +22,6 @@ class acp_styles_info
'modes' => array(
'style' => array('title' => 'ACP_STYLES', 'auth' => 'acl_a_styles', 'cat' => array('ACP_STYLE_MANAGEMENT')),
'install' => array('title' => 'ACP_STYLES_INSTALL', 'auth' => 'acl_a_styles', 'cat' => array('ACP_STYLE_MANAGEMENT')),
- 'cache' => array('title' => 'ACP_STYLES_CACHE', 'auth' => 'acl_a_styles', 'cat' => array('ACP_STYLE_MANAGEMENT')),
),
);
}
diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php
index 3460db4882..5f6dcde448 100644
--- a/phpBB/includes/bbcode.php
+++ b/phpBB/includes/bbcode.php
@@ -129,7 +129,7 @@ class bbcode
*/
function bbcode_cache_init()
{
- global $phpbb_root_path, $phpEx, $config, $user, $phpbb_extension_manager, $phpbb_path_helper;
+ global $phpbb_root_path, $phpEx, $config, $user, $phpbb_dispatcher, $phpbb_extension_manager, $phpbb_path_helper;
if (empty($this->template_filename))
{
@@ -388,6 +388,26 @@ class bbcode
break;
}
}
+
+ $bbcode_cache = $this->bbcode_cache;
+ $bbcode_bitfield = $this->bbcode_bitfield;
+ $bbcode_uid = $this->bbcode_uid;
+
+ /**
+ * Use this event to modify the bbcode_cache
+ *
+ * @event core.bbcode_cache_init_end
+ * @var array bbcode_cache The array of cached search and replace patterns of bbcodes
+ * @var string bbcode_bitfield The bbcode bitfield
+ * @var string bbcode_uid The bbcode uid
+ * @since 3.1.3-RC1
+ */
+ $vars = array('bbcode_cache', 'bbcode_bitfield', 'bbcode_uid');
+ extract($phpbb_dispatcher->trigger_event('core.bbcode_cache_init_end', compact($vars)));
+
+ $this->bbcode_cache = $bbcode_cache;
+ $this->bbcode_bitfield = $bbcode_bitfield;
+ $this->bbcode_uid = $bbcode_uid;
}
/**
diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php
index b72e4ab6d4..321a87b4b0 100644
--- a/phpBB/includes/constants.php
+++ b/phpBB/includes/constants.php
@@ -28,7 +28,7 @@ if (!defined('IN_PHPBB'))
*/
// phpBB Version
-define('PHPBB_VERSION', '3.1.0-RC5-dev');
+define('PHPBB_VERSION', '3.1.4-dev');
// QA-related
// define('PHPBB_QA', 1);
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index fe03efddf2..573df9e55d 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -31,7 +31,7 @@ function phpbb_load_extensions_autoloaders($phpbb_root_path)
new \phpbb\recursive_dot_prefix_filter_iterator(
new \RecursiveDirectoryIterator(
$phpbb_root_path . 'ext/',
- \FilesystemIterator::SKIP_DOTS
+ \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS
)
),
\RecursiveIteratorIterator::SELF_FIRST
@@ -1150,10 +1150,43 @@ function phpbb_timezone_select($template, $user, $default = '', $truncate = fals
function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $user_id = 0)
{
global $db, $user, $config;
- global $request, $phpbb_container;
+ global $request, $phpbb_container, $phpbb_dispatcher;
$post_time = ($post_time === 0 || $post_time > time()) ? time() : (int) $post_time;
+ $should_markread = true;
+
+ /**
+ * This event is used for performing actions directly before marking forums,
+ * topics or posts as read.
+ *
+ * It is also possible to prevent the marking. For that, the $should_markread parameter
+ * should be set to FALSE.
+ *
+ * @event core.markread_before
+ * @var string mode Variable containing marking mode value
+ * @var mixed forum_id Variable containing forum id, or false
+ * @var mixed topic_id Variable containing topic id, or false
+ * @var int post_time Variable containing post time
+ * @var int user_id Variable containing the user id
+ * @var bool should_markread Flag indicating if the markread should be done or not.
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'mode',
+ 'forum_id',
+ 'topic_id',
+ 'post_time',
+ 'user_id',
+ 'should_markread',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.markread_before', compact($vars)));
+
+ if (!$should_markread)
+ {
+ return;
+ }
+
if ($mode == 'all')
{
if ($forum_id === false || !sizeof($forum_id))
@@ -1648,6 +1681,7 @@ function get_complete_topic_tracking($forum_id, $topic_ids, $global_announce_lis
function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $sql_limit = 1001, $sql_limit_offset = 0)
{
global $config, $db, $user;
+ global $phpbb_dispatcher;
$user_id = ($user_id === false) ? (int) $user->data['user_id'] : (int) $user_id;
@@ -1691,6 +1725,24 @@ function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $s
$sql_sort",
);
+ /**
+ * Change SQL query for fetching unread topics data
+ *
+ * @event core.get_unread_topics_modify_sql
+ * @var array sql_array Fully assembled SQL query with keys SELECT, FROM, LEFT_JOIN, WHERE
+ * @var int last_mark User's last_mark time
+ * @var string sql_extra Extra WHERE SQL statement
+ * @var string sql_sort ORDER BY SQL sorting statement
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'sql_array',
+ 'last_mark',
+ 'sql_extra',
+ 'sql_sort',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.get_unread_topics_modify_sql', compact($vars)));
+
$sql = $db->sql_build_query('SELECT', $sql_array);
$result = $db->sql_query_limit($sql, $sql_limit, $sql_limit_offset);
@@ -2396,26 +2448,7 @@ function build_url($strip_vars = false)
{
global $config, $user, $phpbb_path_helper;
- $php_ext = $phpbb_path_helper->get_php_ext();
- $page = $user->page['page'];
-
- // We need to be cautious here.
- // On some situations, the redirect path is an absolute URL, sometimes a relative path
- // For a relative path, let's prefix it with $phpbb_root_path to point to the correct location,
- // else we use the URL directly.
- $url_parts = parse_url($page);
-
- // URL
- if ($url_parts === false || empty($url_parts['scheme']) || empty($url_parts['host']))
- {
- // Remove 'app.php/' from the page, when rewrite is enabled
- if ($config['enable_mod_rewrite'] && strpos($page, 'app.' . $php_ext . '/') === 0)
- {
- $page = substr($page, strlen('app.' . $php_ext . '/'));
- }
-
- $page = $phpbb_path_helper->get_phpbb_root_path() . $page;
- }
+ $page = $phpbb_path_helper->get_valid_page($user->page['page'], $config['enable_mod_rewrite']);
// Append SID
$redirect = append_sid($page, false, false);
@@ -2657,7 +2690,7 @@ function check_form_key($form_name, $timespan = false)
function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_body.html', $u_action = '')
{
global $user, $template, $db, $request;
- global $phpEx, $phpbb_root_path, $request;
+ global $config, $phpbb_path_helper;
if (isset($_POST['cancel']))
{
@@ -2719,8 +2752,8 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
}
// re-add sid / transform & to &amp; for user->page (user->page is always using &)
- $use_page = ($u_action) ? $phpbb_root_path . $u_action : $phpbb_root_path . str_replace('&', '&amp;', $user->page['page']);
- $u_action = reapply_sid($use_page);
+ $use_page = ($u_action) ? $u_action : str_replace('&', '&amp;', $user->page['page']);
+ $u_action = reapply_sid($phpbb_path_helper->get_valid_page($use_page, $config['enable_mod_rewrite']));
$u_action .= ((strpos($u_action, '?') === false) ? '?' : '&amp;') . 'confirm_key=' . $confirm_key;
$template->assign_vars(array(
@@ -2768,7 +2801,7 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = false, $s_display = true)
{
global $db, $user, $template, $auth, $phpEx, $phpbb_root_path, $config;
- global $request, $phpbb_container;
+ global $request, $phpbb_container, $phpbb_dispatcher;
$err = '';
@@ -2854,6 +2887,18 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
{
$redirect = request_var('redirect', "{$phpbb_root_path}index.$phpEx");
+ /**
+ * This event allows an extension to modify the redirection when a user successfully logs in
+ *
+ * @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.
+ * @since 3.1.0-RC5
+ */
+ $vars = array('redirect', 'admin', 'return');
+ extract($phpbb_dispatcher->trigger_event('core.login_box_redirect', compact($vars)));
+
// append/replace SID (may change during the session for AOL users)
$redirect = reapply_sid($redirect);
@@ -2875,19 +2920,6 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
// Special cases... determine
switch ($result['status'])
{
- case LOGIN_ERROR_ATTEMPTS:
-
- $captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']);
- $captcha->init(CONFIRM_LOGIN);
- // $captcha->reset();
-
- $template->assign_vars(array(
- 'CAPTCHA_TEMPLATE' => $captcha->get_template(),
- ));
-
- $err = $user->lang[$result['error_msg']];
- break;
-
case LOGIN_ERROR_PASSWORD_CONVERT:
$err = sprintf(
$user->lang[$result['error_msg']],
@@ -2898,6 +2930,17 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
);
break;
+ case LOGIN_ERROR_ATTEMPTS:
+
+ $captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']);
+ $captcha->init(CONFIRM_LOGIN);
+ // $captcha->reset();
+
+ $template->assign_vars(array(
+ 'CAPTCHA_TEMPLATE' => $captcha->get_template(),
+ ));
+ // no break;
+
// Username, password, etc...
default:
$err = $user->lang[$result['error_msg']];
@@ -2910,6 +2953,19 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
break;
}
+
+ /**
+ * This event allows an extension to process when a user fails a login attempt
+ *
+ * @event core.login_box_failed
+ * @var array result Login result data
+ * @var string username User name used to login
+ * @var string password Password used to login
+ * @var string err Error message
+ * @since 3.1.3-RC1
+ */
+ $vars = array('result', 'username', 'password', 'err');
+ extract($phpbb_dispatcher->trigger_event('core.login_box_failed', compact($vars)));
}
// Assign credential for username/password pair
@@ -3289,7 +3345,7 @@ function get_preg_expression($mode)
case 'email':
// Regex written by James Watts and Francisco Jose Martin Moreno
// http://fightingforalostcause.net/misc/2006/compare-email-regex.php
- return '([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*(?:[\w\!\#$\%\'\*\+\-\/\=\?\^\`{\|\}\~]|&amp;)+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,63})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)';
+ return '((?:[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*(?:[\w\!\#$\%\'\*\+\-\/\=\?\^\`{\|\}\~]|&amp;)+)@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,63})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)';
break;
case 'bbcode_htm':
@@ -3315,23 +3371,33 @@ function get_preg_expression($mode)
break;
case 'url':
+ // generated with regex_idn.php file in the develop folder
+ return "[a-z][a-z\d+\-.]*:/{2}(?:(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})+|[0-9.]+|\[[a-z0-9.]+:[a-z0-9.]+:[a-z0-9.:]+\])(?::\d*)?(?:/(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?";
+ break;
+
case 'url_inline':
- $inline = ($mode == 'url') ? ')' : '';
- $scheme = ($mode == 'url') ? '[a-z\d+\-.]' : '[a-z\d+]'; // avoid automatic parsing of "word" in "last word.http://..."
- // generated with regex generation file in the develop folder
- return "[a-z]$scheme*:/{2}(?:(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})+|[0-9.]+|\[[a-z0-9.]+:[a-z0-9.]+:[a-z0-9.:]+\])(?::\d*)?(?:/(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?";
+ // generated with regex_idn.php file in the develop folder
+ return "[a-z][a-z\d+]*:/{2}(?:(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@|]+|%[\dA-F]{2})+|[0-9.]+|\[[a-z0-9.]+:[a-z0-9.]+:[a-z0-9.:]+\])(?::\d*)?(?:/(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@/?|]+|%[\dA-F]{2})*)?";
break;
case 'www_url':
+ // generated with regex_idn.php file in the develop folder
+ return "www\.(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})+(?::\d*)?(?:/(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?";
+ break;
+
case 'www_url_inline':
- $inline = ($mode == 'www_url') ? ')' : '';
- return "www\.(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})+(?::\d*)?(?:/(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?";
+ // generated with regex_idn.php file in the develop folder
+ return "www\.(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@|]+|%[\dA-F]{2})+(?::\d*)?(?:/(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@/?|]+|%[\dA-F]{2})*)?";
break;
case 'relative_url':
+ // generated with regex_idn.php file in the develop folder
+ return "(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})*(?:/(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'()*+,;=:@/?|]+|%[\dA-F]{2})*)?";
+ break;
+
case 'relative_url_inline':
- $inline = ($mode == 'relative_url') ? ')' : '';
- return "(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*(?:/(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?";
+ // generated with regex_idn.php file in the develop folder
+ return "(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@|]+|%[\dA-F]{2})*(?:/(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[^\p{C}\p{Z}\p{S}\p{P}\p{Nl}\p{No}\p{Me}\x{1100}-\x{115F}\x{A960}-\x{A97C}\x{1160}-\x{11A7}\x{D7B0}-\x{D7C6}\x{20D0}-\x{20FF}\x{1D100}-\x{1D1FF}\x{1D200}-\x{1D24F}\x{0640}\x{07FA}\x{302E}\x{302F}\x{3031}-\x{3035}\x{303B}]*[\x{00B7}\x{0375}\x{05F3}\x{05F4}\x{30FB}\x{002D}\x{06FD}\x{06FE}\x{0F0B}\x{3007}\x{00DF}\x{03C2}\x{200C}\x{200D}\pL0-9\-._~!$&'(*+,;=:@/?|]+|%[\dA-F]{2})*)?";
break;
case 'table_prefix':
@@ -4179,9 +4245,10 @@ function obtain_users_online($item_id = 0, $item = 'forum')
*/
function obtain_users_online_string($online_users, $item_id = 0, $item = 'forum')
{
- global $config, $db, $user, $auth;
+ global $config, $db, $user, $auth, $phpbb_dispatcher;
- $user_online_link = $online_userlist = '';
+ $guests_online = $hidden_online = $l_online_users = $online_userlist = $visible_online = '';
+ $user_online_link = $rowset = array();
// Need caps version of $item for language-strings
$item_caps = strtoupper($item);
@@ -4191,9 +4258,28 @@ function obtain_users_online_string($online_users, $item_id = 0, $item = 'forum'
FROM ' . USERS_TABLE . '
WHERE ' . $db->sql_in_set('user_id', $online_users['online_users']) . '
ORDER BY username_clean ASC';
+
+ /**
+ * Modify SQL query to obtain online users data
+ *
+ * @event core.obtain_users_online_string_sql
+ * @var array online_users Array with online users data
+ * from obtain_users_online()
+ * @var int item_id Restrict online users to item id
+ * @var string item Restrict online users to a certain
+ * session item, e.g. forum for
+ * session_forum_id
+ * @var string sql SQL query to obtain users online data
+ * @since 3.1.4-RC1
+ */
+ $vars = array('online_users', 'item_id', 'item', 'sql');
+ extract($phpbb_dispatcher->trigger_event('core.obtain_users_online_string_sql', compact($vars)));
+
$result = $db->sql_query($sql);
+ $rowset = $db->sql_fetchrowset($result);
+ $db->sql_freeresult($result);
- while ($row = $db->sql_fetchrow($result))
+ foreach ($rowset as $row)
{
// User is logged in and therefore not a guest
if ($row['user_id'] != ANONYMOUS)
@@ -4205,13 +4291,12 @@ function obtain_users_online_string($online_users, $item_id = 0, $item = 'forum'
if (!isset($online_users['hidden_users'][$row['user_id']]) || $auth->acl_get('u_viewonline'))
{
- $user_online_link = get_username_string(($row['user_type'] <> USER_IGNORE) ? 'full' : 'no_profile', $row['user_id'], $row['username'], $row['user_colour']);
- $online_userlist .= ($online_userlist != '') ? ', ' . $user_online_link : $user_online_link;
+ $user_online_link[$row['user_id']] = get_username_string(($row['user_type'] <> USER_IGNORE) ? 'full' : 'no_profile', $row['user_id'], $row['username'], $row['user_colour']);
}
}
}
- $db->sql_freeresult($result);
}
+ $online_userlist = implode(', ', $user_online_link);
if (!$online_userlist)
{
@@ -4244,6 +4329,33 @@ function obtain_users_online_string($online_users, $item_id = 0, $item = 'forum'
$l_online_users = $user->lang('ONLINE_USERS_TOTAL', (int) $online_users['total_online'], $visible_online, $hidden_online);
}
+ /**
+ * Modify online userlist data
+ *
+ * @event core.obtain_users_online_string_modify
+ * @var array online_users Array with online users data
+ * from obtain_users_online()
+ * @var int item_id Restrict online users to item id
+ * @var string item Restrict online users to a certain
+ * session item, e.g. forum for
+ * session_forum_id
+ * @var array rowset Array with online users data
+ * @var array user_online_link Array with online users items (usernames)
+ * @var string online_userlist String containing users online list
+ * @var string l_online_users String with total online users count info
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'online_users',
+ 'item_id',
+ 'item',
+ 'rowset',
+ 'user_online_link',
+ 'online_userlist',
+ 'l_online_users',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.obtain_users_online_string_modify', compact($vars)));
+
return array(
'online_userlist' => $online_userlist,
'l_online_users' => $l_online_users,
@@ -5242,7 +5354,7 @@ function page_footer($run_cron = true, $display_template = true, $exit_handler =
// Call cron-type script
$call_cron = false;
- if (!defined('IN_CRON') && !$config['use_system_cron'] && $run_cron && !$config['board_disable'] && !$user->data['is_bot'] && !$cache->get('cron.lock_check'))
+ if (!defined('IN_CRON') && !$config['use_system_cron'] && $run_cron && !$config['board_disable'] && !$user->data['is_bot'] && !$cache->get('_cron.lock_check'))
{
$call_cron = true;
$time_now = (!empty($user->time_now) && is_int($user->time_now)) ? $user->time_now : time();
@@ -5274,10 +5386,22 @@ function page_footer($run_cron = true, $display_template = true, $exit_handler =
}
else
{
- $cache->put('cron.lock_check', true, 300);
+ $cache->put('_cron.lock_check', true, 60);
}
}
+ /**
+ * Execute code and/or modify output before displaying the template.
+ *
+ * @event core.page_footer_after
+ * @var bool display_template Whether or not to display the template
+ * @var bool exit_handler Whether or not to run the exit_handler()
+ *
+ * @since 3.1.0-RC5
+ */
+ $vars = array('display_template', 'exit_handler');
+ extract($phpbb_dispatcher->trigger_event('core.page_footer_after', compact($vars)));
+
if ($display_template)
{
$template->display('body');
diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php
index e30c6da505..a53a54368e 100644
--- a/phpBB/includes/functions_acp.php
+++ b/phpBB/includes/functions_acp.php
@@ -550,6 +550,9 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
$cfg_array[$config_name] = trim($destination);
+ // Absolute file path
+ case 'absolute_path':
+ case 'absolute_path_writable':
// Path being relative (still prefixed by phpbb_root_path), but with the ability to escape the root dir...
case 'path':
case 'wpath':
@@ -568,20 +571,22 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
break;
}
- if (!file_exists($phpbb_root_path . $cfg_array[$config_name]))
+ $path = in_array($config_definition['validate'], array('wpath', 'path', 'rpath', 'rwpath')) ? $phpbb_root_path . $cfg_array[$config_name] : $cfg_array[$config_name];
+
+ if (!file_exists($path))
{
$error[] = sprintf($user->lang['DIRECTORY_DOES_NOT_EXIST'], $cfg_array[$config_name]);
}
- if (file_exists($phpbb_root_path . $cfg_array[$config_name]) && !is_dir($phpbb_root_path . $cfg_array[$config_name]))
+ if (file_exists($path) && !is_dir($path))
{
$error[] = sprintf($user->lang['DIRECTORY_NOT_DIR'], $cfg_array[$config_name]);
}
// Check if the path is writable
- if ($config_definition['validate'] == 'wpath' || $config_definition['validate'] == 'rwpath')
+ if ($config_definition['validate'] == 'wpath' || $config_definition['validate'] == 'rwpath' || $config_definition['validate'] === 'absolute_path_writable')
{
- if (file_exists($phpbb_root_path . $cfg_array[$config_name]) && !phpbb_is_writable($phpbb_root_path . $cfg_array[$config_name]))
+ if (file_exists($path) && !phpbb_is_writable($path))
{
$error[] = sprintf($user->lang['DIRECTORY_NOT_WRITABLE'], $cfg_array[$config_name]);
}
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index e3e8657afb..79f9db2f3f 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -618,7 +618,7 @@ function move_posts($post_ids, $topic_id, $auto_sync = true)
*/
function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_sync = true, $call_delete_posts = true)
{
- global $db, $config, $phpbb_container;
+ global $db, $config, $phpbb_container, $phpbb_dispatcher;
$approved_topics = 0;
$forum_ids = $topic_ids = array();
@@ -672,6 +672,20 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
$table_ary = array(BOOKMARKS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, POLL_VOTES_TABLE, POLL_OPTIONS_TABLE, TOPICS_WATCH_TABLE, TOPICS_TABLE);
+ /**
+ * Perform additional actions before topic(s) deletion
+ *
+ * @event core.delete_topics_before_query
+ * @var array table_ary Array of tables from which all rows will be deleted that hold a topic_id occuring in topic_ids
+ * @var array topic_ids Array of topic ids to delete
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'table_ary',
+ 'topic_ids',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.delete_topics_before_query', compact($vars)));
+
foreach ($table_ary as $table)
{
$sql = "DELETE FROM $table
@@ -680,6 +694,18 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
}
unset($table_ary);
+ /**
+ * Perform additional actions after topic(s) deletion
+ *
+ * @event core.delete_topics_after_query
+ * @var array topic_ids Array of topic ids that were deleted
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'topic_ids',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.delete_topics_after_query', compact($vars)));
+
$moved_topic_ids = array();
// update the other forums
@@ -2311,7 +2337,7 @@ function sync($mode, $where_type = '', $where_ids = '', $resync_parents = false,
*/
function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync = true)
{
- global $db;
+ global $db, $phpbb_dispatcher;
if (!is_array($forum_id))
{
@@ -2351,6 +2377,21 @@ function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync
$sql_and .= ' AND topic_status = ' . ITEM_MOVED . " AND topic_last_post_time < $prune_date";
}
+ /**
+ * Use this event to modify the SQL that selects topics to be pruned
+ *
+ * @event core.prune_sql
+ * @var string forum_id The forum id
+ * @var string prune_mode The prune mode
+ * @var string prune_date The prune date
+ * @var int prune_flags The prune flags
+ * @var bool auto_sync Whether or not to perform auto sync
+ * @var string sql_and SQL text appended to where clause
+ * @since 3.1.3-RC1
+ */
+ $vars = array('forum_id', 'prune_mode', 'prune_date', 'prune_flags', 'auto_sync', 'sql_and');
+ extract($phpbb_dispatcher->trigger_event('core.prune_sql', compact($vars)));
+
$sql = 'SELECT topic_id
FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('forum_id', $forum_id) . "
@@ -2512,6 +2553,7 @@ function phpbb_cache_moderators($db, $cache, $auth)
{
$usernames_ary[$row['user_id']] = $row['username'];
}
+ $db->sql_freeresult($result);
foreach ($hold_ary as $user_id => $forum_id_ary)
{
@@ -2806,6 +2848,7 @@ function view_inactive_users(&$users, &$user_count, $limit = 0, $offset = 0, $li
$users[] = $row;
}
+ $db->sql_freeresult($result);
return $offset;
}
@@ -2980,68 +3023,21 @@ function get_database_size()
/**
* Retrieve contents from remotely stored file
+*
+* @deprecated 3.1.2 Use file_downloader instead
*/
function get_remote_file($host, $directory, $filename, &$errstr, &$errno, $port = 80, $timeout = 6)
{
- global $user;
-
- if ($fsock = @fsockopen($host, $port, $errno, $errstr, $timeout))
- {
- @fputs($fsock, "GET $directory/$filename HTTP/1.0\r\n");
- @fputs($fsock, "HOST: $host\r\n");
- @fputs($fsock, "Connection: close\r\n\r\n");
-
- $timer_stop = time() + $timeout;
- stream_set_timeout($fsock, $timeout);
-
- $file_info = '';
- $get_info = false;
-
- while (!@feof($fsock))
- {
- if ($get_info)
- {
- $file_info .= @fread($fsock, 1024);
- }
- else
- {
- $line = @fgets($fsock, 1024);
- if ($line == "\r\n")
- {
- $get_info = true;
- }
- else if (stripos($line, '404 not found') !== false)
- {
- $errstr = $user->lang('FILE_NOT_FOUND', $filename);
- return false;
- }
- }
+ global $phpbb_container;
- $stream_meta_data = stream_get_meta_data($fsock);
+ // Get file downloader and assign $errstr and $errno
+ $file_downloader = $phpbb_container->get('file_downloader');
- if (!empty($stream_meta_data['timed_out']) || time() >= $timer_stop)
- {
- $errstr = $user->lang['FSOCK_TIMEOUT'];
- return false;
- }
- }
- @fclose($fsock);
- }
- else
- {
- if ($errstr)
- {
- $errstr = utf8_convert_message($errstr);
- return false;
- }
- else
- {
- $errstr = $user->lang['FSOCK_DISABLED'];
- return false;
- }
- }
+ $file_data = $file_downloader->get($host, $directory, $filename, $port, $timeout);
+ $errstr = $file_downloader->get_error_string();
+ $errno = $file_downloader->get_error_number();
- return $file_info;
+ return $file_data;
}
/*
diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php
index ea092c83bc..43952ae57a 100644
--- a/phpBB/includes/functions_compatibility.php
+++ b/phpBB/includes/functions_compatibility.php
@@ -101,18 +101,21 @@ function phpbb_clean_path($path)
}
else if (!$phpbb_path_helper)
{
+ global $phpbb_root_path, $phpEx;
+
// The container is not yet loaded, use a new instance
if (!class_exists('\phpbb\path_helper'))
{
- global $phpbb_root_path, $phpEx;
require($phpbb_root_path . 'phpbb/path_helper.' . $phpEx);
}
+ $request = new phpbb\request\request();
$phpbb_path_helper = new phpbb\path_helper(
new phpbb\symfony_request(
- new phpbb\request\request()
+ $request
),
new phpbb\filesystem(),
+ $request,
$phpbb_root_path,
$phpEx
);
@@ -165,3 +168,30 @@ function update_foes($group_id = false, $user_id = false)
global $db, $auth;
return phpbb_update_foes($db, $auth, $group_id, $user_id);
}
+
+/**
+* Get user rank title and image
+*
+* @param int $user_rank the current stored users rank id
+* @param int $user_posts the users number of posts
+* @param string &$rank_title the rank title will be stored here after execution
+* @param string &$rank_img the rank image as full img tag is stored here after execution
+* @param string &$rank_img_src the rank image source is stored here after execution
+*
+* @deprecated 3.1.0-RC5 (To be removed: 3.3.0)
+*
+* Note: since we do not want to break backwards-compatibility, this function will only properly assign ranks to guests if you call it for them with user_posts == false
+*/
+function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src)
+{
+ global $phpbb_root_path, $phpEx;
+ if (!function_exists('phpbb_get_user_rank'))
+ {
+ include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
+ }
+
+ $rank_data = phpbb_get_user_rank(array('user_rank' => $user_rank), $user_posts);
+ $rank_title = $rank_data['title'];
+ $rank_img = $rank_data['img'];
+ $rank_img_src = $rank_data['img_src'];
+}
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php
index f275ed1dd1..6f861b8607 100644
--- a/phpBB/includes/functions_content.php
+++ b/phpBB/includes/functions_content.php
@@ -78,7 +78,7 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key,
foreach ($sorts as $name => $sort_ary)
{
$key = $sort_ary['key'];
- $selected = $$sort_ary['key'];
+ $selected = ${$sort_ary['key']};
// Check if the key is selectable. If not, we reset to the default or first key found.
// This ensures the values are always valid. We also set $sort_dir/sort_key/etc. to the
@@ -87,12 +87,12 @@ function gen_sort_selects(&$limit_days, &$sort_by_text, &$sort_days, &$sort_key,
{
if ($sort_ary['default'] !== false)
{
- $selected = $$key = $sort_ary['default'];
+ $selected = ${$key} = $sort_ary['default'];
}
else
{
@reset($sort_ary['options']);
- $selected = $$key = key($sort_ary['options']);
+ $selected = ${$key} = key($sort_ary['options']);
}
}
@@ -712,7 +712,7 @@ function make_clickable_callback($type, $whitespace, $url, $relative_url, $class
break;
}
- $short_url = (strlen($url) > 55) ? substr($url, 0, 39) . ' ... ' . substr($url, -10) : $url;
+ $short_url = (utf8_strlen($url) > 55) ? utf8_substr($url, 0, 39) . ' ... ' . utf8_substr($url, -10) : $url;
switch ($type)
{
@@ -788,28 +788,28 @@ function make_clickable($text, $server_url = false, $class = 'postlink')
// relative urls for this board
$magic_url_match_args[$server_url][] = array(
- '#(^|[\n\t (>.])(' . preg_quote($server_url, '#') . ')/(' . get_preg_expression('relative_url_inline') . ')#i',
+ '#(^|[\n\t (>.])(' . preg_quote($server_url, '#') . ')/(' . get_preg_expression('relative_url_inline') . ')#iu',
MAGIC_URL_LOCAL,
$local_class,
);
// matches a xxxx://aaaaa.bbb.cccc. ...
$magic_url_match_args[$server_url][] = array(
- '#(^|[\n\t (>.])(' . get_preg_expression('url_inline') . ')#i',
+ '#(^|[\n\t (>.])(' . get_preg_expression('url_inline') . ')#iu',
MAGIC_URL_FULL,
$class,
);
// matches a "www.xxxx.yyyy[/zzzz]" kinda lazy URL thing
$magic_url_match_args[$server_url][] = array(
- '#(^|[\n\t (>])(' . get_preg_expression('www_url_inline') . ')#i',
+ '#(^|[\n\t (>])(' . get_preg_expression('www_url_inline') . ')#iu',
MAGIC_URL_WWW,
$class,
);
// matches an email@domain type address at the start of a line, or after a space or after what might be a BBCode.
$magic_url_match_args[$server_url][] = array(
- '/(^|[\n\t (>])(' . get_preg_expression('email') . ')/i',
+ '/(^|[\n\t (>])(' . get_preg_expression('email') . ')/iu',
MAGIC_URL_EMAIL,
'',
);
@@ -912,7 +912,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
return;
}
- global $template, $cache, $user;
+ global $template, $cache, $user, $phpbb_dispatcher;
global $extensions, $config, $phpbb_root_path, $phpEx;
//
@@ -1187,6 +1187,34 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
);
}
+ /**
+ * Use this event to modify the attachment template data.
+ *
+ * This event is triggered once per attachment.
+ *
+ * @event core.parse_attachments_modify_template_data
+ * @var array attachment Array with attachment data
+ * @var array block_array Template data of the attachment
+ * @var int display_cat Attachment category data
+ * @var string download_link Attachment download link
+ * @var array extensions Array with attachment extensions data
+ * @var mixed forum_id The forum id the attachments are displayed in (false if in private message)
+ * @var bool preview Flag indicating if we are in post preview mode
+ * @var array update_count Array with attachment ids to update download count
+ * @since 3.1.0-RC5
+ */
+ $vars = array(
+ 'attachment',
+ 'block_array',
+ 'display_cat',
+ 'download_link',
+ 'extensions',
+ 'forum_id',
+ 'preview',
+ 'update_count',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.parse_attachments_modify_template_data', compact($vars)));
+
$template->assign_block_vars('_file', $block_array);
$compiled_attachments[] = $template->assign_display('attachment_tpl');
diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php
index 9d480692e9..61ab4721c4 100644
--- a/phpBB/includes/functions_convert.php
+++ b/phpBB/includes/functions_convert.php
@@ -2148,6 +2148,7 @@ function fix_empty_primary_groups()
}
$sql = 'SELECT user_id FROM ' . USER_GROUP_TABLE . ' WHERE group_id = ' . get_group_id('global_moderators');
+ $result = $db->sql_query($sql);
$user_ids = array();
while ($row = $db->sql_fetchrow($result))
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 85d9496061..b62b514293 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -375,6 +375,28 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
get_moderators($forum_moderators, $forum_ids_moderator);
}
+ /**
+ * Event to perform additional actions before the forum list is being generated
+ *
+ * @event core.display_forums_before
+ * @var array active_forum_ary Array with forum data to display active topics
+ * @var bool display_moderators Flag indicating if we display forum moderators
+ * @var array forum_moderators Array with forum moderators list
+ * @var array forum_rows Data array of all forums we display
+ * @var bool return_moderators Flag indicating if moderators list should be returned
+ * @var array root_data Array with the root forum data
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'active_forum_ary',
+ 'display_moderators',
+ 'forum_moderators',
+ 'forum_rows',
+ 'return_moderators',
+ 'root_data',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.display_forums_before', compact($vars)));
+
// Used to tell whatever we have to create a dummy category or not.
$last_catless = true;
foreach ($forum_rows as $row)
@@ -649,6 +671,28 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
'UNAPPROVED_POST_IMG' => $user->img('icon_topic_unapproved', 'POSTS_UNAPPROVED_FORUM'),
));
+ /**
+ * Event to perform additional actions after the forum list has been generated
+ *
+ * @event core.display_forums_after
+ * @var array active_forum_ary Array with forum data to display active topics
+ * @var bool display_moderators Flag indicating if we display forum moderators
+ * @var array forum_moderators Array with forum moderators list
+ * @var array forum_rows Data array of all forums we display
+ * @var bool return_moderators Flag indicating if moderators list should be returned
+ * @var array root_data Array with the root forum data
+ * @since 3.1.0-RC5
+ */
+ $vars = array(
+ 'active_forum_ary',
+ 'display_moderators',
+ 'forum_moderators',
+ 'forum_rows',
+ 'return_moderators',
+ 'root_data',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.display_forums_after', compact($vars)));
+
if ($return_moderators)
{
return array($active_forum_ary, $forum_moderators);
@@ -1402,17 +1446,34 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
/**
* Get user rank title and image
*
-* @param int $user_rank the current stored users rank id
+* @param array $user_data the current stored users data
* @param int $user_posts the users number of posts
-* @param string &$rank_title the rank title will be stored here after execution
-* @param string &$rank_img the rank image as full img tag is stored here after execution
-* @param string &$rank_img_src the rank image source is stored here after execution
+*
+* @return array An associative array containing the rank title (title), the rank image source (img) and the rank image as full img tag (img)
*
* Note: since we do not want to break backwards-compatibility, this function will only properly assign ranks to guests if you call it for them with user_posts == false
*/
-function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank_img_src)
+function phpbb_get_user_rank($user_data, $user_posts)
{
- global $ranks, $config, $phpbb_root_path, $phpbb_path_helper;
+ global $ranks, $config, $phpbb_root_path, $phpbb_path_helper, $phpbb_dispatcher;
+
+ $user_rank_data = array(
+ 'title' => null,
+ 'img' => null,
+ 'img_src' => null,
+ );
+
+ /**
+ * Preparing a user's rank before displaying
+ *
+ * @event core.modify_user_rank
+ * @var array user_data Array with user's data
+ * @var int user_posts User_posts to change
+ * @since 3.1.0-RC4
+ */
+
+ $vars = array('user_data', 'user_posts');
+ extract($phpbb_dispatcher->trigger_event('core.modify_user_rank', compact($vars)));
if (empty($ranks))
{
@@ -1420,11 +1481,14 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank
$ranks = $cache->obtain_ranks();
}
- if (!empty($user_rank))
+ if (!empty($user_data['user_rank']))
{
- $rank_title = (isset($ranks['special'][$user_rank]['rank_title'])) ? $ranks['special'][$user_rank]['rank_title'] : '';
- $rank_img_src = (!empty($ranks['special'][$user_rank]['rank_image'])) ? $phpbb_path_helper->update_web_root_path($phpbb_root_path . $config['ranks_path'] . '/' . $ranks['special'][$user_rank]['rank_image']) : '';
- $rank_img = (!empty($ranks['special'][$user_rank]['rank_image'])) ? '<img src="' . $rank_img_src . '" alt="' . $ranks['special'][$user_rank]['rank_title'] . '" title="' . $ranks['special'][$user_rank]['rank_title'] . '" />' : '';
+
+ $user_rank_data['title'] = (isset($ranks['special'][$user_data['user_rank']]['rank_title'])) ? $ranks['special'][$user_data['user_rank']]['rank_title'] : '';
+
+ $user_rank_data['img_src'] = (!empty($ranks['special'][$user_data['user_rank']]['rank_image'])) ? $phpbb_path_helper->update_web_root_path($phpbb_root_path . $config['ranks_path'] . '/' . $ranks['special'][$user_data['user_rank']]['rank_image']) : '';
+
+ $user_rank_data['img'] = (!empty($ranks['special'][$user_data['user_rank']]['rank_image'])) ? '<img src="' . $user_rank_data['img_src'] . '" alt="' . $ranks['special'][$user_data['user_rank']]['rank_title'] . '" title="' . $ranks['special'][$user_data['user_rank']]['rank_title'] . '" />' : '';
}
else if ($user_posts !== false)
{
@@ -1434,28 +1498,29 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank
{
if ($user_posts >= $rank['rank_min'])
{
- $rank_title = $rank['rank_title'];
- $rank_img_src = (!empty($rank['rank_image'])) ? $phpbb_path_helper->update_web_root_path($phpbb_root_path . $config['ranks_path'] . '/' . $rank['rank_image']) : '';
- $rank_img = (!empty($rank['rank_image'])) ? '<img src="' . $rank_img_src . '" alt="' . $rank['rank_title'] . '" title="' . $rank['rank_title'] . '" />' : '';
+ $user_rank_data['title'] = $rank['rank_title'];
+ $user_rank_data['img_src'] = (!empty($rank['rank_image'])) ? $phpbb_path_helper->update_web_root_path($phpbb_root_path . $config['ranks_path'] . '/' . $rank['rank_image']) : '';
+ $user_rank_data['img'] = (!empty($rank['rank_image'])) ? '<img src="' . $user_rank_data['img_src'] . '" alt="' . $rank['rank_title'] . '" title="' . $rank['rank_title'] . '" />' : '';
break;
}
}
}
}
+
+ return $user_rank_data;
}
/**
* Prepare profile data
*/
-function phpbb_show_profile($data, $user_notes_enabled = false, $warn_user_enabled = false)
+function phpbb_show_profile($data, $user_notes_enabled = false, $warn_user_enabled = false, $check_can_receive_pm = true)
{
global $config, $auth, $user, $phpEx, $phpbb_root_path, $phpbb_dispatcher;
$username = $data['username'];
$user_id = $data['user_id'];
- $rank_title = $rank_img = $rank_img_src = '';
- get_user_rank($data['user_rank'], (($user_id == ANONYMOUS) ? false : $data['user_posts']), $rank_title, $rank_img, $rank_img_src);
+ $user_rank_data = phpbb_get_user_rank($data, (($user_id == ANONYMOUS) ? false : $data['user_posts']));
if ((!empty($data['user_allow_viewemail']) && $auth->acl_get('u_sendemail')) || $auth->acl_get('a_user'))
{
@@ -1516,7 +1581,7 @@ function phpbb_show_profile($data, $user_notes_enabled = false, $warn_user_enabl
}
// Can this user receive a Private Message?
- $can_receive_pm = (
+ $can_receive_pm = $check_can_receive_pm && (
// They must be a "normal" user
$data['user_type'] != USER_IGNORE &&
@@ -1536,7 +1601,7 @@ function phpbb_show_profile($data, $user_notes_enabled = false, $warn_user_enabl
// Dump it out to the template
$template_data = array(
'AGE' => $age,
- 'RANK_TITLE' => $rank_title,
+ 'RANK_TITLE' => $user_rank_data['title'],
'JOINED' => $user->format_date($data['user_regdate']),
'LAST_ACTIVE' => (empty($last_active)) ? ' - ' : $user->format_date($last_active),
'POSTS' => ($data['user_posts']) ? $data['user_posts'] : 0,
@@ -1552,8 +1617,8 @@ function phpbb_show_profile($data, $user_notes_enabled = false, $warn_user_enabl
'AVATAR_IMG' => phpbb_get_user_avatar($data),
'ONLINE_IMG' => (!$config['load_onlinetrack']) ? '' : (($online) ? $user->img('icon_user_online', 'ONLINE') : $user->img('icon_user_offline', 'OFFLINE')),
'S_ONLINE' => ($config['load_onlinetrack'] && $online) ? true : false,
- 'RANK_IMG' => $rank_img,
- 'RANK_IMG_SRC' => $rank_img_src,
+ 'RANK_IMG' => $user_rank_data['img'],
+ 'RANK_IMG_SRC' => $user_rank_data['img_src'],
'S_JABBER_ENABLED' => ($config['jab_enable']) ? true : false,
'S_WARNINGS' => ($auth->acl_getf_global('m_') || $auth->acl_get('m_warn')) ? true : false,
@@ -1565,8 +1630,8 @@ function phpbb_show_profile($data, $user_notes_enabled = false, $warn_user_enabl
'U_EMAIL' => $email,
'U_JABBER' => ($data['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&amp;action=jabber&amp;u=' . $user_id) : '',
- 'USER_JABBER' => $data['user_jabber'],
- 'USER_JABBER_IMG' => ($data['user_jabber']) ? $user->img('icon_contact_jabber', $data['user_jabber']) : '',
+ 'USER_JABBER' => ($config['jab_enable']) ? $data['user_jabber'] : '',
+ 'USER_JABBER_IMG' => ($config['jab_enable'] && $data['user_jabber']) ? $user->img('icon_contact_jabber', $data['user_jabber']) : '',
'L_SEND_EMAIL_USER' => $user->lang('SEND_EMAIL_USER', $username),
'L_CONTACT_USER' => $user->lang('CONTACT_USER', $username),
diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php
index 704939b176..254e65ae3d 100644
--- a/phpBB/includes/functions_download.php
+++ b/phpBB/includes/functions_download.php
@@ -50,7 +50,7 @@ function send_avatar_to_browser($file, $browser)
$image_data = @getimagesize($file_path);
header('Content-Type: ' . image_type_to_mime_type($image_data[2]));
- if ((strpos(strtolower($user->browser), 'msie') !== false) && !phpbb_is_greater_ie_version($browser, 7))
+ if ((strpos(strtolower($browser), 'msie') !== false) && !phpbb_is_greater_ie_version($browser, 7))
{
header('Content-Disposition: attachment; ' . header_filename($file));
@@ -210,11 +210,6 @@ function send_file_to_browser($attachment, $upload_dir, $category)
}
}
- if ($size)
- {
- header("Content-Length: $size");
- }
-
// Close the db connection before sending the file etc.
file_gc(false);
@@ -238,6 +233,11 @@ function send_file_to_browser($attachment, $upload_dir, $category)
exit;
}
+ if ($size)
+ {
+ header("Content-Length: $size");
+ }
+
// Try to deliver in chunks
@set_time_limit(0);
diff --git a/phpBB/includes/functions_mcp.php b/phpBB/includes/functions_mcp.php
index 811d49f1de..ed96dcf338 100644
--- a/phpBB/includes/functions_mcp.php
+++ b/phpBB/includes/functions_mcp.php
@@ -368,7 +368,7 @@ function phpbb_get_pm_data($pm_ids)
*/
function phpbb_mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by_sql, &$sort_order_sql, &$total, $forum_id = 0, $topic_id = 0, $where_sql = 'WHERE')
{
- global $db, $user, $auth, $template;
+ global $db, $user, $auth, $template, $phpbb_dispatcher;
$sort_days = request_var('st', 0);
$min_time = ($sort_days) ? time() - ($sort_days * 86400) : 0;
@@ -553,6 +553,56 @@ function phpbb_mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by
break;
}
+ // Default total to -1 to allow editing by the event
+ $total = -1;
+
+ /**
+ * This event allows you to control the SQL query used to get the total number
+ * of reports the user can access.
+ *
+ * This total is used for the pagination and for displaying the total number
+ * of reports to the user
+ *
+ *
+ * @event core.mcp_sorting_query_before
+ * @var string sql The current SQL search string
+ * @var string mode An id related to the module(s) the user is viewing
+ * @var string type Which kind of information is this being used for displaying. Posts, topics, etc...
+ * @var int forum_id The forum id of the posts the user is trying to access, if not 0
+ * @var int topic_id The topic id of the posts the user is trying to access, if not 0
+ * @var int sort_days The max age of the oldest report to be shown, in days
+ * @var string sort_key The way the user has decided to sort the data.
+ * The valid values must be in the keys of the sort_by_* variables
+ * @var string sort_dir Either 'd' for "DESC" or 'a' for 'ASC' in the SQL query
+ * @var int limit_days The possible max ages of the oldest report for the user to choose, in days.
+ * @var array sort_by_sql SQL text (values) for the possible names of the ways of sorting data (keys).
+ * @var array sort_by_text Language text (values) for the possible names of the ways of sorting data (keys).
+ * @var int min_time Integer with the minimum post time that the user is searching for
+ * @var int limit_time_sql Time limiting options used in the SQL query.
+ * @var int total The total number of reports that exist. Only set if you want to override the result
+ * @var string where_sql Extra information included in the WHERE clause. It must end with "WHERE" or "AND" or "OR".
+ * Set to "WHERE" and set total above -1 to override the total value
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'sql',
+ 'mode',
+ 'type',
+ 'forum_id',
+ 'topic_id',
+ 'sort_days',
+ 'sort_key',
+ 'sort_dir',
+ 'limit_days',
+ 'sort_by_sql',
+ 'sort_by_text',
+ 'min_time',
+ 'limit_time_sql',
+ 'total',
+ 'where_sql',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_sorting_query_before', compact($vars)));
+
if (!isset($sort_by_sql[$sort_key]))
{
$sort_key = $default_key;
@@ -584,7 +634,7 @@ function phpbb_mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by
$total = (int) $db->sql_fetchfield('total');
$db->sql_freeresult($result);
}
- else
+ else if ($total < -1)
{
$total = -1;
}
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index 045e555d05..fbac3e6f1d 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -510,7 +510,7 @@ class messenger
foreach ($address_ary as $which_ary)
{
- $$type .= (($$type != '') ? ', ' : '') . (($which_ary['name'] != '') ? mail_encode($which_ary['name'], $encode_eol) . ' <' . $which_ary['email'] . '>' : $which_ary['email']);
+ ${$type} .= ((${$type} != '') ? ', ' : '') . (($which_ary['name'] != '') ? mail_encode($which_ary['name'], $encode_eol) . ' <' . $which_ary['email'] . '>' : $which_ary['email']);
}
}
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 1fdc7ee9ea..a06d6f4c35 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -1036,8 +1036,8 @@ function load_drafts($topic_id = 0, $forum_id = 0, $id = 0, $pm_action = '', $ms
*/
function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id = 0, $show_quote_button = true)
{
- global $user, $auth, $db, $template, $bbcode, $cache;
- global $config, $phpbb_root_path, $phpEx, $phpbb_container;
+ global $user, $auth, $db, $template, $cache;
+ global $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher;
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
$sql_sort = ($mode == 'post_review') ? 'ASC' : 'DESC';
@@ -1094,13 +1094,11 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
$sql = $db->sql_build_query('SELECT', $sql_ary);
$result = $db->sql_query($sql);
- $bbcode_bitfield = '';
$rowset = array();
$has_attachments = false;
while ($row = $db->sql_fetchrow($result))
{
$rowset[$row['post_id']] = $row;
- $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']);
if ($row['post_attachment'])
{
@@ -1109,13 +1107,6 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
}
$db->sql_freeresult($result);
- // Instantiate BBCode class
- if (!isset($bbcode) && $bbcode_bitfield !== '')
- {
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
- $bbcode = new bbcode(base64_encode($bbcode_bitfield));
- }
-
// Grab extensions
$extensions = $attachments = array();
if ($has_attachments && $auth->acl_get('u_download') && $auth->acl_get('f_download', $forum_id))
@@ -1176,7 +1167,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
$post_anchor = ($mode == 'post_review') ? 'ppr' . $row['post_id'] : 'pr' . $row['post_id'];
$u_show_post = append_sid($phpbb_root_path . 'viewtopic.' . $phpEx, "f=$forum_id&amp;t=$topic_id&amp;p={$row['post_id']}&amp;view=show#p{$row['post_id']}");
- $template->assign_block_vars($mode . '_row', array(
+ $post_row = array(
'POST_AUTHOR_FULL' => get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR_COLOUR' => get_username_string('colour', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR' => get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username']),
@@ -1195,9 +1186,37 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
'POST_ID' => $row['post_id'],
'U_MINI_POST' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . '#p' . $row['post_id'],
'U_MCP_DETAILS' => ($auth->acl_get('m_info', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=post_details&amp;f=' . $forum_id . '&amp;p=' . $row['post_id'], true, $user->session_id) : '',
- 'POSTER_QUOTE' => ($show_quote_button && $auth->acl_get('f_reply', $forum_id)) ? addslashes(get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username'])) : '')
+ 'POSTER_QUOTE' => ($show_quote_button && $auth->acl_get('f_reply', $forum_id)) ? addslashes(get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['post_username'])) : '',
);
+ $current_row_number = $i;
+
+ /**
+ * Event to modify the template data block for topic reviews
+ *
+ * @event core.topic_review_modify_row
+ * @var string mode The review mode
+ * @var int topic_id The topic that is being reviewed
+ * @var int forum_id The topic's forum
+ * @var int cur_post_id Post offset id
+ * @var int current_row_number Number of the current row being iterated
+ * @var array post_row Template block array of the current post
+ * @var array row Array with original post and user data
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'mode',
+ 'topic_id',
+ 'forum_id',
+ 'cur_post_id',
+ 'current_row_number',
+ 'post_row',
+ 'row',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.topic_review_modify_row', compact($vars)));
+
+ $template->assign_block_vars($mode . '_row', $post_row);
+
// Display not already displayed Attachments for this post, we already parsed them. ;)
if (!empty($attachments[$row['post_id']]))
{
@@ -1825,6 +1844,30 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
break;
}
+ /**
+ * Modify sql query data for post submitting
+ *
+ * @event core.submit_post_modify_sql_data
+ * @var array data Array with the data for the post
+ * @var array poll Array with the poll data for the post
+ * @var string post_mode Variable containing posting mode value
+ * @var bool sql_data Array with the data for the posting SQL query
+ * @var string subject Variable containing post subject value
+ * @var int topic_type Variable containing topic type value
+ * @var string username Variable containing post author name
+ * @since 3.1.3-RC1
+ */
+ $vars = array(
+ 'data',
+ 'poll',
+ 'post_mode',
+ 'sql_data',
+ 'subject',
+ 'topic_type',
+ 'username',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.submit_post_modify_sql_data', compact($vars)));
+
// Submit new topic
if ($post_mode == 'post')
{
@@ -2384,6 +2427,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
* @var int topic_type Variable containing topic type value
* @var array poll Array with the poll data for the post
* @var array data Array with the data for the post
+ * @var int post_visibility Variable containing up to date post visibility
* @var bool update_message Flag indicating if the post will be updated
* @var bool update_search_index Flag indicating if the search index will be updated
* @var string url The "Return to topic" URL
@@ -2399,6 +2443,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
'topic_type',
'poll',
'data',
+ 'post_visibility',
'update_message',
'update_search_index',
'url',
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index ad142b1cca..8e1561b842 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -914,6 +914,24 @@ function update_unread_status($unread, $msg_id, $user_id, $folder_id)
}
}
+function mark_folder_read($user_id, $folder_id)
+{
+ global $db;
+
+ $sql = 'SELECT msg_id
+ FROM ' . PRIVMSGS_TO_TABLE . '
+ WHERE folder_id = ' . ((int) $folder_id) . '
+ AND user_id = ' . ((int) $user_id) . '
+ AND pm_unread = 1';
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ update_unread_status(true, $row['msg_id'], $user_id, $folder_id);
+ }
+ $db->sql_freeresult($result);
+}
+
/**
* Handle all actions possible with marked messages
*/
@@ -1397,9 +1415,9 @@ function rebuild_header($check_ary)
$_types = array('u', 'g');
foreach ($_types as $type)
{
- if (sizeof($$type))
+ if (sizeof(${$type}))
{
- foreach ($$type as $id)
+ foreach (${$type} as $id)
{
$address[$type][$id] = $check_type;
}
@@ -1939,7 +1957,7 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
*/
function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode = false)
{
- global $db, $user, $config, $template, $phpbb_root_path, $phpEx, $auth, $bbcode;
+ global $db, $user, $config, $template, $phpbb_root_path, $phpEx, $auth;
// Select all receipts and the author from the pm we currently view, to only display their pm-history
$sql = 'SELECT author_id, user_id
@@ -1991,7 +2009,6 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
$title = $row['message_subject'];
$rowset = array();
- $bbcode_bitfield = '';
$folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm') . '&amp;folder=';
do
@@ -2007,7 +2024,6 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
else
{
$rowset[$row['msg_id']] = $row;
- $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']);
}
}
while ($row = $db->sql_fetchrow($result));
@@ -2018,16 +2034,6 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
return false;
}
- // Instantiate BBCode class
- if ((empty($bbcode) || $bbcode === false) && $bbcode_bitfield !== '')
- {
- if (!class_exists('bbcode'))
- {
- include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
- }
- $bbcode = new bbcode(base64_encode($bbcode_bitfield));
- }
-
$title = censor_text($title);
$url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm');
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index e4479f07b0..9cd662027e 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -44,13 +44,13 @@ function user_get_id_name(&$user_id_ary, &$username_ary, $user_type = false)
$which_ary = ($user_id_ary) ? 'user_id_ary' : 'username_ary';
- if ($$which_ary && !is_array($$which_ary))
+ if (${$which_ary} && !is_array(${$which_ary}))
{
- $$which_ary = array($$which_ary);
+ ${$which_ary} = array(${$which_ary});
}
- $sql_in = ($which_ary == 'user_id_ary') ? array_map('intval', $$which_ary) : array_map('utf8_clean_string', $$which_ary);
- unset($$which_ary);
+ $sql_in = ($which_ary == 'user_id_ary') ? array_map('intval', ${$which_ary}) : array_map('utf8_clean_string', ${$which_ary});
+ unset(${$which_ary});
$user_id_ary = $username_ary = array();
@@ -161,9 +161,10 @@ function user_update_name($old_name, $new_name)
*
* @param mixed $user_row An array containing the following keys (and the appropriate values): username, group_id (the group to place the user in), user_email and the user_type(usually 0). Additional entries not overridden by defaults will be forwarded.
* @param string $cp_data custom profile fields, see custom_profile::build_insert_sql_array
+* @param array $notifications_data The notifications settings for the new user
* @return the new user's ID.
*/
-function user_add($user_row, $cp_data = false)
+function user_add($user_row, $cp_data = false, $notifications_data = null)
{
global $db, $user, $auth, $config, $phpbb_root_path, $phpEx;
global $phpbb_dispatcher, $phpbb_container;
@@ -347,6 +348,31 @@ function user_add($user_row, $cp_data = false)
set_config('newest_user_colour', $row['group_colour'], true);
}
+ // Use default notifications settings if notifications_data is not set
+ if ($notifications_data === null)
+ {
+ $notifications_data = array(
+ array(
+ 'item_type' => 'notification.type.post',
+ 'method' => 'notification.method.email',
+ ),
+ array(
+ 'item_type' => 'notification.type.topic',
+ 'method' => 'notification.method.email',
+ ),
+ );
+ }
+
+ // Subscribe user to notifications if necessary
+ if (!empty($notifications_data))
+ {
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+ foreach ($notifications_data as $subscription)
+ {
+ $phpbb_notifications->add_subscription($subscription['item_type'], 0, $subscription['method'], $user_id);
+ }
+ }
+
/**
* Event that returns user id, user detals and user CPF of newly registared user
*
@@ -372,7 +398,7 @@ function user_add($user_row, $cp_data = false)
*/
function user_delete($mode, $user_ids, $retain_username = true)
{
- global $cache, $config, $db, $user, $phpbb_dispatcher;
+ global $cache, $config, $db, $user, $phpbb_dispatcher, $phpbb_container;
global $phpbb_root_path, $phpEx;
$db->sql_transaction('begin');
@@ -646,6 +672,9 @@ function user_delete($mode, $user_ids, $retain_username = true)
}
phpbb_delete_users_pms($user_ids);
+ $phpbb_notifications = $phpbb_container->get('notification_manager');
+ $phpbb_notifications->delete_notifications('notification.type.admin_activate_user', $user_ids);
+
$db->sql_transaction('commit');
/**
@@ -677,7 +706,7 @@ function user_delete($mode, $user_ids, $retain_username = true)
*/
function user_active_flip($mode, $user_id_ary, $reason = INACTIVE_MANUAL)
{
- global $config, $db, $user, $auth;
+ global $config, $db, $user, $auth, $phpbb_dispatcher;
$deactivated = $activated = 0;
$sql_statements = array();
@@ -730,6 +759,21 @@ function user_active_flip($mode, $user_id_ary, $reason = INACTIVE_MANUAL)
}
$db->sql_freeresult($result);
+ /**
+ * Check or modify activated/deactivated users data before submitting it to the database
+ *
+ * @event core.user_active_flip_before
+ * @var string mode User type changing mode, can be: flip|activate|deactivate
+ * @var int reason Reason for changing user type, can be: INACTIVE_REGISTER|INACTIVE_PROFILE|INACTIVE_MANUAL|INACTIVE_REMIND
+ * @var int activated The number of users to be activated
+ * @var int deactivated The number of users to be deactivated
+ * @var array user_id_ary Array with user ids to change user type
+ * @var array sql_statements Array with users data to submit to the database, keys: user ids, values: arrays with user data
+ * @since 3.1.4-RC1
+ */
+ $vars = array('mode', 'reason', 'activated', 'deactivated', 'user_id_ary', 'sql_statements');
+ extract($phpbb_dispatcher->trigger_event('core.user_active_flip_before', compact($vars)));
+
if (sizeof($sql_statements))
{
foreach ($sql_statements as $user_id => $sql_ary)
@@ -743,6 +787,21 @@ function user_active_flip($mode, $user_id_ary, $reason = INACTIVE_MANUAL)
$auth->acl_clear_prefetch(array_keys($sql_statements));
}
+ /**
+ * Perform additional actions after the users have been activated/deactivated
+ *
+ * @event core.user_active_flip_after
+ * @var string mode User type changing mode, can be: flip|activate|deactivate
+ * @var int reason Reason for changing user type, can be: INACTIVE_REGISTER|INACTIVE_PROFILE|INACTIVE_MANUAL|INACTIVE_REMIND
+ * @var int activated The number of users to be activated
+ * @var int deactivated The number of users to be deactivated
+ * @var array user_id_ary Array with user ids to change user type
+ * @var array sql_statements Array with users data to submit to the database, keys: user ids, values: arrays with user data
+ * @since 3.1.4-RC1
+ */
+ $vars = array('mode', 'reason', 'activated', 'deactivated', 'user_id_ary', 'sql_statements');
+ extract($phpbb_dispatcher->trigger_event('core.user_active_flip_after', compact($vars)));
+
if ($deactivated)
{
set_config_count('num_users', $deactivated * (-1), true);
diff --git a/phpBB/includes/mcp/mcp_ban.php b/phpBB/includes/mcp/mcp_ban.php
index e6fac3b80c..4d2151fded 100644
--- a/phpBB/includes/mcp/mcp_ban.php
+++ b/phpBB/includes/mcp/mcp_ban.php
@@ -25,7 +25,7 @@ class mcp_ban
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $cache;
+ global $db, $user, $auth, $template, $request, $phpbb_dispatcher;
global $phpbb_root_path, $phpEx;
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
@@ -33,55 +33,133 @@ class mcp_ban
// Include the admin banning interface...
include($phpbb_root_path . 'includes/acp/acp_ban.' . $phpEx);
- $bansubmit = (isset($_POST['bansubmit'])) ? true : false;
- $unbansubmit = (isset($_POST['unbansubmit'])) ? true : false;
- $current_time = time();
+ $bansubmit = $request->is_set_post('bansubmit');
+ $unbansubmit = $request->is_set_post('unbansubmit');
$user->add_lang(array('acp/ban', 'acp/users'));
$this->tpl_name = 'mcp_ban';
+ /**
+ * Use this event to pass perform actions when a ban is issued or revoked
+ *
+ * @event core.mcp_ban_main
+ * @var bool bansubmit True if a ban is issued
+ * @var bool unbansubmit True if a ban is removed
+ * @var string mode Mode of the ban that is being worked on
+ * @since 3.1.0-RC5
+ */
+ $vars = array(
+ 'bansubmit',
+ 'unbansubmit',
+ 'mode',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_ban_main', compact($vars)));
+
// Ban submitted?
if ($bansubmit)
{
// Grab the list of entries
- $ban = request_var('ban', '', ($mode === 'user') ? true : false);
-
- if ($mode === 'user')
- {
- $ban = utf8_normalize_nfc($ban);
- }
-
- $ban_len = request_var('banlength', 0);
- $ban_len_other = request_var('banlengthother', '');
- $ban_exclude = request_var('banexclude', 0);
- $ban_reason = utf8_normalize_nfc(request_var('banreason', '', true));
- $ban_give_reason = utf8_normalize_nfc(request_var('bangivereason', '', true));
+ $ban = $request->variable('ban', '', $mode === 'user');
+ $ban_length = $request->variable('banlength', 0);
+ $ban_length_other = $request->variable('banlengthother', '');
+ $ban_exclude = $request->variable('banexclude', 0);
+ $ban_reason = $request->variable('banreason', '', true);
+ $ban_give_reason = $request->variable('bangivereason', '', true);
if ($ban)
{
if (confirm_box(true))
{
- user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reason, $ban_give_reason);
+ $abort_ban = false;
+ /**
+ * Use this event to modify the ban details before the ban is performed
+ *
+ * @event core.mcp_ban_before
+ * @var string mode One of the following: user, ip, email
+ * @var string ban Either string or array with usernames, ips or email addresses
+ * @var int ban_length Ban length in minutes
+ * @var string ban_length_other Ban length as a date (YYYY-MM-DD)
+ * @var bool ban_exclude Are we banning or excluding from another ban
+ * @var string ban_reason Ban reason displayed to moderators
+ * @var string ban_give_reason Ban reason displayed to the banned user
+ * @var mixed abort_ban Either false, or an error message that is displayed to the user.
+ * If a string is given the bans are not issued.
+ * @since 3.1.0-RC5
+ */
+ $vars = array(
+ 'mode',
+ 'ban',
+ 'ban_length',
+ 'ban_length_other',
+ 'ban_exclude',
+ 'ban_reason',
+ 'ban_give_reason',
+ 'abort_ban',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_ban_before', compact($vars)));
+
+ if ($abort_ban)
+ {
+ trigger_error($abort_ban);
+ }
+ user_ban($mode, $ban, $ban_length, $ban_length_other, $ban_exclude, $ban_reason, $ban_give_reason);
+
+ /**
+ * Use this event to perform actions after the ban has been performed
+ *
+ * @event core.mcp_ban_after
+ * @var string mode One of the following: user, ip, email
+ * @var string ban Either string or array with usernames, ips or email addresses
+ * @var int ban_length Ban length in minutes
+ * @var string ban_length_other Ban length as a date (YYYY-MM-DD)
+ * @var bool ban_exclude Are we banning or excluding from another ban
+ * @var string ban_reason Ban reason displayed to moderators
+ * @var string ban_give_reason Ban reason displayed to the banned user
+ * @since 3.1.0-RC5
+ */
+ $vars = array(
+ 'mode',
+ 'ban',
+ 'ban_length',
+ 'ban_length_other',
+ 'ban_exclude',
+ 'ban_reason',
+ 'ban_give_reason',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_ban_after', compact($vars)));
trigger_error($user->lang['BAN_UPDATE_SUCCESSFUL'] . '<br /><br /><a href="' . $this->u_action . '">&laquo; ' . $user->lang['BACK_TO_PREV'] . '</a>');
}
else
{
- confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields(array(
+ $hidden_fields = array(
'mode' => $mode,
'ban' => $ban,
'bansubmit' => true,
- 'banlength' => $ban_len,
- 'banlengthother' => $ban_len_other,
+ 'banlength' => $ban_length,
+ 'banlengthother' => $ban_length_other,
'banexclude' => $ban_exclude,
'banreason' => $ban_reason,
- 'bangivereason' => $ban_give_reason)));
+ 'bangivereason' => $ban_give_reason,
+ );
+
+ /**
+ * Use this event to pass data from the ban form to the confirmation screen
+ *
+ * @event core.mcp_ban_confirm
+ * @var array hidden_fields Hidden fields that are passed through the confirm screen
+ * @since 3.1.0-RC5
+ */
+ $vars = array('hidden_fields');
+ extract($phpbb_dispatcher->trigger_event('core.mcp_ban_confirm', compact($vars)));
+
+ confirm_box(false, $user->lang['CONFIRM_OPERATION'], build_hidden_fields($hidden_fields));
}
}
}
else if ($unbansubmit)
{
- $ban = request_var('unban', array(''));
+ $ban = $request->variable('unban', array(''));
if ($ban)
{
@@ -157,9 +235,9 @@ class mcp_ban
}
// As a "service" we will check if any post id is specified and populate the username of the poster id if given
- $post_id = request_var('p', 0);
- $user_id = request_var('u', 0);
- $username = $pre_fill = false;
+ $post_id = $request->variable('p', 0);
+ $user_id = $request->variable('u', 0);
+ $pre_fill = false;
if ($user_id && $user_id <> ANONYMOUS)
{
diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php
index 0c6acaa908..c18ca1aa1d 100644
--- a/phpBB/includes/mcp/mcp_forum.php
+++ b/phpBB/includes/mcp/mcp_forum.php
@@ -165,6 +165,22 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
AND ' . $phpbb_content_visibility->get_visibility_sql('topic', $forum_id, 't.') . "
$limit_time_sql
ORDER BY t.topic_type DESC, $sort_order_sql";
+
+ /**
+ * Modify SQL query before MCP forum view topic list is queried
+ *
+ * @event core.mcp_view_forum_modify_sql
+ * @var string sql SQL query for forum view topic list
+ * @var int forum_id ID of the forum
+ * @var string limit_time_sql SQL query part for limit time
+ * @var string sort_order_sql SQL query part for sort order
+ * @var int topics_per_page Number of topics per page
+ * @var int start Start value
+ * @since 3.1.2-RC1
+ */
+ $vars = array('sql', 'forum_id', 'limit_time_sql', 'sort_order_sql', 'topics_per_page', 'start');
+ extract($phpbb_dispatcher->trigger_event('core.mcp_view_forum_modify_sql', compact($vars)));
+
$result = $db->sql_query_limit($sql, $topics_per_page, $start);
$topic_list = $topic_tracking_info = array();
diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php
index ebcf7ce643..500db55456 100644
--- a/phpBB/includes/mcp/mcp_front.php
+++ b/phpBB/includes/mcp/mcp_front.php
@@ -234,6 +234,7 @@ function mcp_front_view($id, $mode, $action)
'ATTACH_ICON_IMG' => ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && $row['post_attachment']) ? $user->img('icon_topic_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
));
}
+ $db->sql_freeresult($result);
}
$template->assign_vars(array(
@@ -290,6 +291,7 @@ function mcp_front_view($id, $mode, $action)
$pm_by_id[(int) $row['msg_id']] = $row;
$pm_list[] = (int) $row['msg_id'];
}
+ $db->sql_freeresult($result);
$address_list = get_recipient_strings($pm_by_id);
diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php
index 92dcdb5499..9c76f0df90 100644
--- a/phpBB/includes/mcp/mcp_logs.php
+++ b/phpBB/includes/mcp/mcp_logs.php
@@ -137,7 +137,7 @@ class mcp_logs
if ($mode == 'topic_logs')
{
- $conditions['topic_logs'] = $topic_id;
+ $conditions['topic_id'] = $topic_id;
}
$phpbb_log->delete('mod', $conditions);
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index 74bf687fc8..1241b8bd0e 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -754,7 +754,8 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = ''
{
global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container;
- if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_delete')))
+ $check_permission = ($is_soft) ? 'm_softdelete' : 'm_delete';
+ if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array($check_permission)))
{
return;
}
@@ -812,8 +813,17 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = ''
$user->add_lang('posting');
+ // If there are only shadow topics, we neither need a reason nor softdelete
+ $sql = 'SELECT topic_id
+ FROM ' . TOPICS_TABLE . '
+ WHERE ' . $db->sql_in_set('topic_id', $topic_ids) . '
+ AND topic_moved_id = 0';
+ $result = $db->sql_query_limit($sql, 1);
+ $only_shadow = !$db->sql_fetchfield('topic_id');
+ $db->sql_freeresult($result);
+
$only_softdeleted = false;
- if ($auth->acl_get('m_delete', $forum_id) && $auth->acl_get('m_softdelete', $forum_id))
+ if (!$only_shadow && $auth->acl_get('m_delete', $forum_id) && $auth->acl_get('m_softdelete', $forum_id))
{
// If there are only soft deleted topics, we display a message why the option is not available
$sql = 'SELECT topic_id
@@ -826,6 +836,7 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = ''
}
$template->assign_vars(array(
+ 'S_SHADOW_TOPICS' => $only_shadow,
'S_SOFTDELETED' => $only_softdeleted,
'S_TOPIC_MODE' => true,
'S_ALLOWED_DELETE' => $auth->acl_get('m_delete', $forum_id),
@@ -838,7 +849,7 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = ''
$l_confirm .= '_PERMANENTLY';
$s_hidden_fields['delete_permanent'] = '1';
}
- else if (!$auth->acl_get('m_softdelete', $forum_id))
+ else if ($only_shadow || !$auth->acl_get('m_softdelete', $forum_id))
{
$s_hidden_fields['delete_permanent'] = '1';
}
@@ -882,7 +893,8 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',
{
global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container;
- if (!phpbb_check_ids($post_ids, POSTS_TABLE, 'post_id', array('m_softdelete')))
+ $check_permission = ($is_soft) ? 'm_softdelete' : 'm_delete';
+ if (!phpbb_check_ids($post_ids, POSTS_TABLE, 'post_id', array($check_permission)))
{
return;
}
@@ -1264,6 +1276,7 @@ function mcp_fork_topic($topic_ids)
$db->sql_query('INSERT INTO ' . POLL_OPTIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
}
+ $db->sql_freeresult($result);
}
$sql = 'SELECT *
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index bfd30a5be2..82c3bc9ab0 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -616,7 +616,7 @@ class mcp_queue
*/
static public function approve_posts($action, $post_id_list, $id, $mode)
{
- global $db, $template, $user, $config, $request, $phpbb_container;
+ global $db, $template, $user, $config, $request, $phpbb_container, $phpbb_dispatcher;
global $phpEx, $phpbb_root_path;
if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))
@@ -745,11 +745,11 @@ class mcp_queue
if (!$post_data['topic_posts_approved'])
{
- $phpbb_notifications->add_notifications('notification.type.approve_post', $post_data);
+ $phpbb_notifications->add_notifications('notification.type.approve_topic', $post_data);
}
else
{
- $phpbb_notifications->add_notifications('notification.type.approve_topic', $post_data);
+ $phpbb_notifications->add_notifications('notification.type.approve_post', $post_data);
}
}
}
@@ -764,6 +764,30 @@ class mcp_queue
$success_msg = (sizeof($post_info) == 1) ? 'POST_' . strtoupper($action) . 'D_SUCCESS' : 'POSTS_' . strtoupper($action) . 'D_SUCCESS';
}
+ /**
+ * Perform additional actions during post(s) approval
+ *
+ * @event core.approve_posts_after
+ * @var string action Variable containing the action we perform on the posts ('approve' or 'restore')
+ * @var array post_info Array containing info for all posts being approved
+ * @var array topic_info Array containing info for all parent topics of the posts
+ * @var int num_topics Variable containing number of topics
+ * @var bool notify_poster Variable telling if the post should be notified or not
+ * @var string success_msg Variable containing the language key for the success message
+ * @var string redirect Variable containing the redirect url
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'action',
+ 'post_info',
+ 'topic_info',
+ 'num_topics',
+ 'notify_poster',
+ 'success_msg',
+ 'redirect',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.approve_posts_after', compact($vars)));
+
meta_refresh(3, $redirect);
$message = $user->lang[$success_msg];
@@ -840,7 +864,7 @@ class mcp_queue
static public function approve_topics($action, $topic_id_list, $id, $mode)
{
global $db, $template, $user, $config;
- global $phpEx, $phpbb_root_path, $request, $phpbb_container;
+ global $phpEx, $phpbb_root_path, $request, $phpbb_container, $phpbb_dispatcher;
if (!phpbb_check_ids($topic_id_list, TOPICS_TABLE, 'topic_id', array('m_approve')))
{
@@ -945,6 +969,28 @@ class mcp_queue
}
}
+ /**
+ * Perform additional actions during topics(s) approval
+ *
+ * @event core.approve_topics_after
+ * @var string action Variable containing the action we perform on the posts ('approve' or 'restore')
+ * @var mixed topic_info Array containing info for all topics being approved
+ * @var array first_post_ids Array containing ids of all first posts
+ * @var bool notify_poster Variable telling if the poster should be notified or not
+ * @var string success_msg Variable containing the language key for the success message
+ * @var string redirect Variable containing the redirect url
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'action',
+ 'topic_info',
+ 'first_post_ids',
+ 'notify_poster',
+ 'success_msg',
+ 'redirect',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.approve_topics_after', compact($vars)));
+
meta_refresh(3, $redirect);
$message = $user->lang[$success_msg];
@@ -1008,7 +1054,7 @@ class mcp_queue
*/
static public function disapprove_posts($post_id_list, $id, $mode)
{
- global $db, $template, $user, $config, $phpbb_container;
+ global $db, $template, $user, $config, $phpbb_container, $phpbb_dispatcher;
global $phpEx, $phpbb_root_path, $request;
if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))
@@ -1239,8 +1285,6 @@ class mcp_queue
}
}
- unset($lang_reasons, $post_info, $disapprove_reason, $disapprove_reason_lang);
-
if ($num_disapproved_topics)
{
$success_msg = ($num_disapproved_topics == 1) ? 'TOPIC' : 'TOPICS';
@@ -1275,6 +1319,44 @@ class mcp_queue
}
}
+ /**
+ * Perform additional actions during post(s) disapproval
+ *
+ * @event core.disapprove_posts_after
+ * @var array post_info Array containing info for all posts being disapproved
+ * @var array topic_information Array containing information for the topics
+ * @var array topic_posts_unapproved Array containing list of topic ids and the count of disapproved posts in them
+ * @var array post_disapprove_list Array containing list of posts and their topic id
+ * @var int num_disapproved_topics Variable containing the number of disapproved topics
+ * @var int num_disapproved_posts Variable containing the number of disapproved posts
+ * @var array lang_reasons Array containing the language keys for reasons
+ * @var string disapprove_reason Variable containing the language key for the success message
+ * @var string disapprove_reason_lang Variable containing the language key for the success message
+ * @var bool is_disapproving Variable telling if anything is going to be disapproved
+ * @var bool notify_poster Variable telling if the post should be notified or not
+ * @var string success_msg Variable containing the language key for the success message
+ * @var string redirect Variable containing the redirect url
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'post_info',
+ 'topic_information',
+ 'topic_posts_unapproved',
+ 'post_disapprove_list',
+ 'num_disapproved_topics',
+ 'num_disapproved_posts',
+ 'lang_reasons',
+ 'disapprove_reason',
+ 'disapprove_reason_lang',
+ 'is_disapproving',
+ 'notify_poster',
+ 'success_msg',
+ 'redirect',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.disapprove_posts_after', compact($vars)));
+
+ unset($lang_reasons, $post_info, $disapprove_reason, $disapprove_reason_lang);
+
meta_refresh(3, $redirect);
$message = $user->lang[$success_msg];
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php
index 1698b080c9..8347830d0f 100644
--- a/phpBB/includes/mcp/mcp_topic.php
+++ b/phpBB/includes/mcp/mcp_topic.php
@@ -25,7 +25,7 @@ if (!defined('IN_PHPBB'))
function mcp_topic_view($id, $mode, $action)
{
global $phpEx, $phpbb_root_path, $config;
- global $template, $db, $user, $auth, $cache, $phpbb_container;
+ global $template, $db, $user, $auth, $cache, $phpbb_container, $phpbb_dispatcher;
$url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . phpbb_extra_url());
@@ -147,21 +147,13 @@ function mcp_topic_view($id, $mode, $action)
$result = $db->sql_query_limit($sql, $posts_per_page, $start);
$rowset = $post_id_list = array();
- $bbcode_bitfield = '';
while ($row = $db->sql_fetchrow($result))
{
$rowset[] = $row;
$post_id_list[] = $row['post_id'];
- $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']);
}
$db->sql_freeresult($result);
- if ($bbcode_bitfield !== '')
- {
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
- $bbcode = new bbcode(base64_encode($bbcode_bitfield));
- }
-
$topic_tracking_info = array();
// Get topic tracking info
@@ -228,7 +220,7 @@ function mcp_topic_view($id, $mode, $action)
$post_unread = (isset($topic_tracking_info[$topic_id]) && $row['post_time'] > $topic_tracking_info[$topic_id]) ? true : false;
- $template->assign_block_vars('postrow', array(
+ $post_row = array(
'POST_AUTHOR_FULL' => get_username_string('full', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR_COLOUR' => get_username_string('colour', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
'POST_AUTHOR' => get_username_string('username', $row['poster_id'], $row['username'], $row['user_colour'], $row['post_username']),
@@ -250,9 +242,43 @@ function mcp_topic_view($id, $mode, $action)
'U_POST_DETAILS' => "$url&amp;i=$id&amp;p={$row['post_id']}&amp;mode=post_details" . (($forum_id) ? "&amp;f=$forum_id" : ''),
'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $topic_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $topic_info['forum_id'] . '&amp;p=' . $row['post_id']) : '',
- 'U_MCP_REPORT' => ($auth->acl_get('m_report', $topic_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $topic_info['forum_id'] . '&amp;p=' . $row['post_id']) : '')
+ 'U_MCP_REPORT' => ($auth->acl_get('m_report', $topic_info['forum_id'])) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $topic_info['forum_id'] . '&amp;p=' . $row['post_id']) : '',
);
+ $current_row_number = $i;
+
+ /**
+ * Event to modify the template data block for topic reviews in the MCP
+ *
+ * @event core.mcp_topic_review_modify_row
+ * @var int id ID of the tab we are displaying
+ * @var string mode Mode of the MCP page we are displaying
+ * @var int topic_id The topic ID we are currently reviewing
+ * @var int forum_id The forum ID we are currently in
+ * @var int start Start item of this page
+ * @var int current_row_number Number of the post on this page
+ * @var array post_row Template block array of the current post
+ * @var array row Array with original post and user data
+ * @var array topic_info Array with topic data
+ * @var int total Total posts count
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'id',
+ 'mode',
+ 'topic_id',
+ 'forum_id',
+ 'start',
+ 'current_row_number',
+ 'post_row',
+ 'row',
+ 'topic_info',
+ 'total',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.mcp_topic_review_modify_row', compact($vars)));
+
+ $template->assign_block_vars('postrow', $post_row);
+
// Display not already displayed Attachments for this post, we already parsed them. ;)
if (!empty($attachments[$row['post_id']]))
{
diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php
index 106b025757..d724b8703b 100644
--- a/phpBB/includes/mcp/mcp_warn.php
+++ b/phpBB/includes/mcp/mcp_warn.php
@@ -332,16 +332,16 @@ class mcp_warn
// We want to make the message available here as a reminder
// Parse the message and subject
- $parse_flags = OPTION_FLAG_SMILIES | ($row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0);
+ $parse_flags = OPTION_FLAG_SMILIES | ($user_row['bbcode_bitfield'] ? OPTION_FLAG_BBCODE : 0);
$message = generate_text_for_display($user_row['post_text'], $user_row['bbcode_uid'], $user_row['bbcode_bitfield'], $parse_flags, true);
// Generate the appropriate user information for the user we are looking at
- if (!function_exists('get_user_rank'))
+ if (!function_exists('phpbb_get_user_rank'))
{
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
}
- get_user_rank($user_row['user_rank'], $user_row['user_posts'], $rank_title, $rank_img, $rank_img_src);
+ $user_rank_data = phpbb_get_user_rank($user_row, $user_row['user_posts']);
$avatar_img = phpbb_get_user_avatar($user_row);
$template->assign_vars(array(
@@ -350,13 +350,13 @@ class mcp_warn
'POST' => $message,
'USERNAME' => $user_row['username'],
'USER_COLOR' => (!empty($user_row['user_colour'])) ? $user_row['user_colour'] : '',
- 'RANK_TITLE' => $rank_title,
+ 'RANK_TITLE' => $user_rank_data['title'],
'JOINED' => $user->format_date($user_row['user_regdate']),
'POSTS' => ($user_row['user_posts']) ? $user_row['user_posts'] : 0,
'WARNINGS' => ($user_row['user_warnings']) ? $user_row['user_warnings'] : 0,
'AVATAR_IMG' => $avatar_img,
- 'RANK_IMG' => $rank_img,
+ 'RANK_IMG' => $user_rank_data['img'],
'L_WARNING_POST_DEFAULT' => sprintf($user->lang['WARNING_POST_DEFAULT'], generate_board_url() . "/viewtopic.$phpEx?f=$forum_id&amp;p=$post_id#p$post_id"),
@@ -486,18 +486,18 @@ class mcp_warn
}
// Generate the appropriate user information for the user we are looking at
- if (!function_exists('get_user_rank'))
+ if (!function_exists('phpbb_get_user_rank'))
{
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
}
- get_user_rank($user_row['user_rank'], $user_row['user_posts'], $rank_title, $rank_img, $rank_img_src);
+ $user_rank_data = phpbb_get_user_rank($user_row, $user_row['user_posts']);
$avatar_img = phpbb_get_user_avatar($user_row);
// OK, they didn't submit a warning so lets build the page for them to do so
$template->assign_vars(array(
'U_POST_ACTION' => $this->u_action,
- 'RANK_TITLE' => $rank_title,
+ 'RANK_TITLE' => $user_rank_data['title'],
'JOINED' => $user->format_date($user_row['user_regdate']),
'POSTS' => ($user_row['user_posts']) ? $user_row['user_posts'] : 0,
'WARNINGS' => ($user_row['user_warnings']) ? $user_row['user_warnings'] : 0,
@@ -508,7 +508,7 @@ class mcp_warn
'U_PROFILE' => get_username_string('profile', $user_row['user_id'], $user_row['username'], $user_row['user_colour']),
'AVATAR_IMG' => $avatar_img,
- 'RANK_IMG' => $rank_img,
+ 'RANK_IMG' => $user_rank_data['img'],
'S_CAN_NOTIFY' => $s_can_notify,
));
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index 92ace7b585..04a2726d22 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -313,7 +313,7 @@ class bbcode_firstpass extends bbcode
$in = str_replace(' ', '%20', $in);
// Checking urls
- if (!preg_match('#^' . get_preg_expression('url') . '$#i', $in) && !preg_match('#^' . get_preg_expression('www_url') . '$#i', $in))
+ if (!preg_match('#^' . get_preg_expression('url') . '$#iu', $in) && !preg_match('#^' . get_preg_expression('www_url') . '$#iu', $in))
{
return '[img]' . $in . '[/img]';
}
@@ -381,8 +381,8 @@ class bbcode_firstpass extends bbcode
$in = str_replace(' ', '%20', $in);
// Make sure $in is a URL.
- if (!preg_match('#^' . get_preg_expression('url') . '$#i', $in) &&
- !preg_match('#^' . get_preg_expression('www_url') . '$#i', $in))
+ if (!preg_match('#^' . get_preg_expression('url') . '$#iu', $in) &&
+ !preg_match('#^' . get_preg_expression('www_url') . '$#iu', $in))
{
return '[flash=' . $width . ',' . $height . ']' . $in . '[/flash]';
}
@@ -973,9 +973,9 @@ class bbcode_firstpass extends bbcode
$url = str_replace(' ', '%20', $url);
// Checking urls
- if (preg_match('#^' . get_preg_expression('url') . '$#i', $url) ||
- preg_match('#^' . get_preg_expression('www_url') . '$#i', $url) ||
- preg_match('#^' . preg_quote(generate_board_url(), '#') . get_preg_expression('relative_url') . '$#i', $url))
+ if (preg_match('#^' . get_preg_expression('url') . '$#iu', $url) ||
+ preg_match('#^' . get_preg_expression('www_url') . '$#iu', $url) ||
+ preg_match('#^' . preg_quote(generate_board_url(), '#') . get_preg_expression('relative_url') . '$#iu', $url))
{
$valid = true;
}
@@ -1103,7 +1103,7 @@ class parse_message extends bbcode_firstpass
*/
function parse($allow_bbcode, $allow_magic_url, $allow_smilies, $allow_img_bbcode = true, $allow_flash_bbcode = true, $allow_quote_bbcode = true, $allow_url_bbcode = true, $update_this_message = true, $mode = 'post')
{
- global $config, $db, $user;
+ global $config, $db, $user, $phpbb_dispatcher;
$this->mode = $mode;
@@ -1158,6 +1158,58 @@ class parse_message extends bbcode_firstpass
}
}
+ /**
+ * This event can be used for additional message checks/cleanup before parsing
+ *
+ * @event core.message_parser_check_message
+ * @var bool allow_bbcode Do we allow BBCodes
+ * @var bool allow_magic_url Do we allow magic urls
+ * @var bool allow_smilies Do we allow smilies
+ * @var bool allow_img_bbcode Do we allow image BBCode
+ * @var bool allow_flash_bbcode Do we allow flash BBCode
+ * @var bool allow_quote_bbcode Do we allow quote BBCode
+ * @var bool allow_url_bbcode Do we allow url BBCode
+ * @var bool update_this_message Do we alter the parsed message
+ * @var string mode Posting mode
+ * @var string message The message text to parse
+ * @var string bbcode_bitfield The bbcode_bitfield before parsing
+ * @var string bbcode_uid The bbcode_uid before parsing
+ * @var bool return Do we return after the event is triggered if $warn_msg is not empty
+ * @var array warn_msg Array of the warning messages
+ * @since 3.1.2-RC1
+ * @change 3.1.3-RC1 Added vars $bbcode_bitfield and $bbcode_uid
+ */
+ $message = $this->message;
+ $warn_msg = $this->warn_msg;
+ $return = false;
+ $bbcode_bitfield = $this->bbcode_bitfield;
+ $bbcode_uid = $this->bbcode_uid;
+ $vars = array(
+ 'allow_bbcode',
+ 'allow_magic_url',
+ 'allow_smilies',
+ 'allow_img_bbcode',
+ 'allow_flash_bbcode',
+ 'allow_quote_bbcode',
+ 'allow_url_bbcode',
+ 'update_this_message',
+ 'mode',
+ 'message',
+ 'bbcode_bitfield',
+ 'bbcode_uid',
+ 'return',
+ 'warn_msg',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.message_parser_check_message', compact($vars)));
+ $this->message = $message;
+ $this->warn_msg = $warn_msg;
+ $this->bbcode_bitfield = $bbcode_bitfield;
+ $this->bbcode_uid = $bbcode_uid;
+ if ($return && !empty($this->warn_msg))
+ {
+ return (!$update_this_message) ? $return_message : $this->warn_msg;
+ }
+
// Prepare BBcode (just prepares some tags for better parsing)
if ($allow_bbcode && strpos($this->message, '[') !== false)
{
diff --git a/phpBB/includes/startup.php b/phpBB/includes/startup.php
index 50fcd11bee..2885c80541 100644
--- a/phpBB/includes/startup.php
+++ b/phpBB/includes/startup.php
@@ -69,31 +69,13 @@ function deregister_globals()
{
if (isset($not_unset[$varname]))
{
- // Hacking attempt. No point in continuing unless it's a COOKIE (so a cookie called GLOBALS doesn't lock users out completely)
- if ($varname !== 'GLOBALS' || isset($_GET['GLOBALS']) || isset($_POST['GLOBALS']) || isset($_SERVER['GLOBALS']) || isset($_SESSION['GLOBALS']) || isset($_ENV['GLOBALS']) || isset($_FILES['GLOBALS']))
+ // Hacking attempt. No point in continuing.
+ if (isset($_COOKIE[$varname]))
{
- exit;
- }
- else
- {
- $cookie = &$_COOKIE;
- while (isset($cookie['GLOBALS']))
- {
- if (!is_array($cookie['GLOBALS']))
- {
- break;
- }
-
- foreach ($cookie['GLOBALS'] as $registered_var => $value)
- {
- if (!isset($not_unset[$registered_var]))
- {
- unset($GLOBALS[$registered_var]);
- }
- }
- $cookie = &$cookie['GLOBALS'];
- }
+ echo "Clear your cookies. ";
}
+ echo "Malicious variable name detected. Contact the administrator and ask them to disable register_globals.";
+ exit;
}
unset($GLOBALS[$varname]);
diff --git a/phpBB/includes/ucp/ucp_auth_link.php b/phpBB/includes/ucp/ucp_auth_link.php
index a595ce46c3..748f0fdec2 100644
--- a/phpBB/includes/ucp/ucp_auth_link.php
+++ b/phpBB/includes/ucp/ucp_auth_link.php
@@ -34,11 +34,12 @@ class ucp_auth_link
*/
public function main($id, $mode)
{
- global $config, $request, $template, $phpbb_container, $user;
+ global $request, $template, $phpbb_container, $user;
$error = array();
- $auth_provider = $phpbb_container->get('auth.provider.' . $config['auth_method']);
+ $provider_collection = $phpbb_container->get('auth.provider_collection');
+ $auth_provider = $provider_collection->get_provider();
// confirm that the auth provider supports this page
$provider_data = $auth_provider->get_auth_link_data();
diff --git a/phpBB/includes/ucp/ucp_login_link.php b/phpBB/includes/ucp/ucp_login_link.php
index 5ca5df00f7..bfe4804286 100644
--- a/phpBB/includes/ucp/ucp_login_link.php
+++ b/phpBB/includes/ucp/ucp_login_link.php
@@ -39,7 +39,7 @@ class ucp_login_link
*/
function main($id, $mode)
{
- global $config, $phpbb_container, $request, $template, $user;
+ global $phpbb_container, $request, $template, $user;
global $phpbb_root_path, $phpEx;
// Initialize necessary variables
@@ -57,8 +57,8 @@ class ucp_login_link
}
// Use the auth_provider requested even if different from configured
- $auth_provider = 'auth.provider.' . $request->variable('auth_provider', $config['auth_method']);
- $auth_provider = $phpbb_container->get($auth_provider);
+ $provider_collection = $phpbb_container->get('auth.provider_collection');
+ $auth_provider = $provider_collection->get_provider($request->variable('auth_provider', ''));
// Set the link_method to login_link
$data['link_method'] = 'login_link';
@@ -75,7 +75,7 @@ class ucp_login_link
{
if ($request->is_set_post('login'))
{
- $login_username = $request->variable('login_username', '', false, \phpbb\request\request_interface::POST);
+ $login_username = $request->variable('login_username', '', true, \phpbb\request\request_interface::POST);
$login_password = $request->untrimmed_variable('login_password', '', true, \phpbb\request\request_interface::POST);
$login_result = $auth_provider->login($login_username, $login_password);
diff --git a/phpBB/includes/ucp/ucp_notifications.php b/phpBB/includes/ucp/ucp_notifications.php
index 5691302b83..b0aeaba227 100644
--- a/phpBB/includes/ucp/ucp_notifications.php
+++ b/phpBB/includes/ucp/ucp_notifications.php
@@ -95,35 +95,25 @@ class ucp_notifications
case 'notification_list':
default:
// Mark all items read
- if ($request->variable('mark', '') == 'all' && (confirm_box(true) || check_link_hash($request->variable('token', ''), 'mark_all_notifications_read')))
+ if ($request->variable('mark', '') == 'all' && check_link_hash($request->variable('token', ''), 'mark_all_notifications_read'))
{
- if (confirm_box(true))
- {
- $phpbb_notifications->mark_notifications_read(false, false, $user->data['user_id'], $form_time);
-
- meta_refresh(3, $this->u_action);
- $message = $user->lang['NOTIFICATIONS_MARK_ALL_READ_SUCCESS'];
+ $phpbb_notifications->mark_notifications_read(false, false, $user->data['user_id'], $form_time);
- if ($request->is_ajax())
- {
- $json_response = new \phpbb\json_response();
- $json_response->send(array(
- 'MESSAGE_TITLE' => $user->lang['INFORMATION'],
- 'MESSAGE_TEXT' => $message,
- 'success' => true,
- ));
- }
- $message .= '<br /><br />' . $user->lang('RETURN_UCP', '<a href="' . $this->u_action . '">', '</a>');
+ meta_refresh(3, $this->u_action);
+ $message = $user->lang['NOTIFICATIONS_MARK_ALL_READ_SUCCESS'];
- trigger_error($message);
- }
- else
+ if ($request->is_ajax())
{
- confirm_box(false, 'NOTIFICATIONS_MARK_ALL_READ', build_hidden_fields(array(
- 'mark' => 'all',
- 'form_time' => $form_time,
- )));
+ $json_response = new \phpbb\json_response();
+ $json_response->send(array(
+ 'MESSAGE_TITLE' => $user->lang['INFORMATION'],
+ 'MESSAGE_TEXT' => $message,
+ 'success' => true,
+ ));
}
+ $message .= '<br /><br />' . $user->lang('RETURN_UCP', '<a href="' . $this->u_action . '">', '</a>');
+
+ trigger_error($message);
}
// Mark specific notifications read
diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php
index 7a8c694870..425a56cf6c 100644
--- a/phpBB/includes/ucp/ucp_pm.php
+++ b/phpBB/includes/ucp/ucp_pm.php
@@ -45,7 +45,7 @@ class ucp_pm
function main($id, $mode)
{
- global $user, $template, $phpbb_root_path, $auth, $phpEx, $db, $config;
+ global $user, $template, $phpbb_root_path, $auth, $phpEx, $db, $config, $request;
if (!$user->data['is_registered'])
{
@@ -246,6 +246,27 @@ class ucp_pm
$folder_id = (int) $row['folder_id'];
}
+ if ($request->variable('mark', '') == 'all' && check_link_hash($request->variable('token', ''), 'mark_all_pms_read'))
+ {
+ mark_folder_read($user->data['user_id'], $folder_id);
+
+ meta_refresh(3, $this->u_action);
+ $message = $user->lang['PM_MARK_ALL_READ_SUCCESS'];
+
+ if ($request->is_ajax())
+ {
+ $json_response = new \phpbb\json_response();
+ $json_response->send(array(
+ 'MESSAGE_TITLE' => $user->lang['INFORMATION'],
+ 'MESSAGE_TEXT' => $message,
+ 'success' => true,
+ ));
+ }
+ $message .= '<br /><br />' . $user->lang('RETURN_UCP', '<a href="' . $this->u_action . '">', '</a>');
+
+ trigger_error($message);
+ }
+
$message_row = array();
if ($action == 'view_message' && $msg_id)
{
@@ -332,6 +353,7 @@ class ucp_pm
'U_SENTBOX' => $this->u_action . '&amp;folder=sentbox',
'U_CREATE_FOLDER' => $this->u_action . '&amp;mode=options',
'U_CURRENT_FOLDER' => $this->u_action . '&amp;folder=' . $folder_id,
+ 'U_MARK_ALL' => $this->u_action . '&amp;folder=' . $folder_id . '&amp;mark=all&amp;token=' . generate_link_hash('mark_all_pms_read'),
'S_IN_INBOX' => ($folder_id == PRIVMSGS_INBOX) ? true : false,
'S_IN_OUTBOX' => ($folder_id == PRIVMSGS_OUTBOX) ? true : false,
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index 01c2041f42..51018e3a5d 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -27,8 +27,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
{
global $template, $db, $auth, $user, $cache;
global $phpbb_root_path, $phpEx, $config;
- global $request;
- global $phpbb_container;
+ global $request, $phpbb_dispatcher, $phpbb_container;
// Damn php and globals - i know, this is horrible
// Needed for handle_message_list_actions()
@@ -91,6 +90,32 @@ function compose_pm($id, $mode, $action, $user_folders = array())
// we include the language file here
$user->add_lang('viewtopic');
+ /**
+ * Modify the default vars before composing a PM
+ *
+ * @event core.ucp_pm_compose_modify_data
+ * @var int msg_id post_id in the page request
+ * @var int to_user_id The id of whom the message is to
+ * @var int to_group_id The id of the group the message is to
+ * @var bool submit Whether the form has been submitted
+ * @var bool preview Whether the user is previewing the PM or not
+ * @var string action One of: post, reply, quote, forward, quotepost, edit, delete, smilies
+ * @var bool delete Whether the user is deleting the PM
+ * @var int reply_to_all Value of reply_to_all request variable.
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'msg_id',
+ 'to_user_id',
+ 'to_group_id',
+ 'submit',
+ 'preview',
+ 'action',
+ 'delete',
+ 'reply_to_all',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_modify_data', compact($vars)));
+
// Output PM_TO box if message composing
if ($action != 'edit')
{
@@ -233,6 +258,42 @@ function compose_pm($id, $mode, $action, $user_folders = array())
if ($sql)
{
+ /**
+ * Alter sql query to get message for user to write the PM
+ *
+ * @event core.ucp_pm_compose_compose_pm_basic_info_query_before
+ * @var string sql String with the query to be executed
+ * @var array forum_list List of forums that contain the posts
+ * @var int visibility_const Integer with one of the possible ITEM_* constant values
+ * @var int msg_id topic_id in the page request
+ * @var int to_user_id The id of whom the message is to
+ * @var int to_group_id The id of the group whom the message is to
+ * @var bool submit Whether the user is sending the PM or not
+ * @var bool preview Whether the user is previewing the PM or not
+ * @var string action One of: post, reply, quote, forward, quotepost, edit, delete, smilies
+ * @var bool delete Whether the user is deleting the PM
+ * @var int reply_to_all Value of reply_to_all request variable.
+ * @var string limit_time_sql String with the SQL code to limit the time interval of the post (Note: May be empty string)
+ * @var string sort_order_sql String with the ORDER BY SQL code used in this query
+ * @since 3.1.0-RC5
+ */
+ $vars = array(
+ 'sql',
+ 'forum_list',
+ 'visibility_const',
+ 'msg_id',
+ 'to_user_id',
+ 'to_group_id',
+ 'submit',
+ 'preview',
+ 'action',
+ 'delete',
+ 'reply_to_all',
+ 'limit_time_sql',
+ 'sort_order_sql',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_compose_pm_basic_info_query_before', compact($vars)));
+
$result = $db->sql_query($sql);
$post = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
@@ -267,6 +328,40 @@ function compose_pm($id, $mode, $action, $user_folders = array())
trigger_error('NOT_AUTHORISED');
}
+ /**
+ * Get the result of querying for the post to be quoted in the pm message
+ *
+ * @event core.ucp_pm_compose_quotepost_query_after
+ * @var string sql The original SQL used in the query
+ * @var array post Associative array with the data of the quoted post
+ * @var array msg_id The post_id that was searched to get the message for quoting
+ * @var int visibility_const Visibility of the quoted post (one of the possible ITEM_* constant values)
+ * @var int topic_id Topic ID of the quoted post
+ * @var int to_user_id Users the message is sent to
+ * @var int to_group_id Groups the message is sent to
+ * @var bool submit Whether the user is sending the PM or not
+ * @var bool preview Whether the user is previewing the PM or not
+ * @var string action One of: post, reply, quote, forward, quotepost, edit, delete, smilies
+ * @var bool delete If deleting message
+ * @var int reply_to_all Value of reply_to_all request variable.
+ * @since 3.1.0-RC5
+ */
+ $vars = array(
+ 'sql',
+ 'post',
+ 'msg_id',
+ 'visibility_const',
+ 'topic_id',
+ 'to_user_id',
+ 'to_group_id',
+ 'submit',
+ 'preview',
+ 'action',
+ 'delete',
+ 'reply_to_all',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.ucp_pm_compose_quotepost_query_after', compact($vars)));
+
// Passworded forum?
if ($post['forum_id'])
{
diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php
index d5a1dbae87..d81c4ce7fe 100644
--- a/phpBB/includes/ucp/ucp_pm_viewmessage.php
+++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php
@@ -53,15 +53,6 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
// Grab icons
$icons = $cache->obtain_icons();
- $bbcode = false;
-
- // Instantiate BBCode if need be
- if ($message_row['bbcode_bitfield'])
- {
- include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
- $bbcode = new bbcode($message_row['bbcode_bitfield']);
- }
-
// Load the custom profile fields
if ($config['load_cpf_pm'])
{
@@ -197,7 +188,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
$u_pm = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose&amp;u=' . $author_id);
}
- if ($user_info['user_jabber'] && $auth->acl_get('u_sendim'))
+ if ($config['jab_enable'] && $user_info['user_jabber'] && $auth->acl_get('u_sendim'))
{
$u_jabber = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=contact&amp;action=jabber&amp;u=' . $author_id);
}
@@ -213,6 +204,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
'AUTHOR_AVATAR' => (isset($user_info['avatar'])) ? $user_info['avatar'] : '',
'AUTHOR_JOINED' => $user->format_date($user_info['user_regdate']),
'AUTHOR_POSTS' => (int) $user_info['user_posts'],
+ 'U_AUTHOR_POSTS' => ($config['load_search'] && $auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$author_id&amp;sr=posts") : '',
'CONTACT_USER' => $user->lang('CONTACT_USER', get_username_string('username', $author_id, $user_info['username'], $user_info['user_colour'], $user_info['username'])),
'ONLINE_IMG' => (!$config['load_onlinetrack']) ? '' : ((isset($user_info['online']) && $user_info['online']) ? $user->img('icon_user_online', $user->lang['ONLINE']) : $user->img('icon_user_offline', $user->lang['OFFLINE'])),
@@ -403,12 +395,15 @@ function get_user_information($user_id, $user_row)
$user_row['avatar'] = ($user->optionget('viewavatars')) ? phpbb_get_user_avatar($user_row) : '';
- if (!function_exists('get_user_rank'))
+ if (!function_exists('phpbb_get_user_rank'))
{
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
}
- get_user_rank($user_row['user_rank'], $user_row['user_posts'], $user_row['rank_title'], $user_row['rank_image'], $user_row['rank_image_src']);
+ $user_rank_data = phpbb_get_user_rank($user_row, $user_row['user_posts']);
+ $user_row['rank_title'] = $user_rank_data['title'];
+ $user_row['rank_image'] = $user_rank_data['img'];
+ $user_row['rank_image_src'] = $user_rank_data['img_src'];
if ((!empty($user_row['user_allow_viewemail']) && $auth->acl_get('u_sendemail')) || $auth->acl_get('a_email'))
{
diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php
index 2195500b57..1d3fb19f67 100644
--- a/phpBB/includes/ucp/ucp_prefs.php
+++ b/phpBB/includes/ucp/ucp_prefs.php
@@ -67,9 +67,11 @@ class ucp_prefs
* @var bool submit Do we display the form only
* or did the user press submit
* @var array data Array with current ucp options data
+ * @var array error Array with list of errors
* @since 3.1.0-a1
+ * @changed 3.1.4-rc1 Added error variable to the event
*/
- $vars = array('submit', 'data');
+ $vars = array('submit', 'data', 'error');
extract($phpbb_dispatcher->trigger_event('core.ucp_prefs_personal_data', compact($vars)));
if ($submit)
@@ -83,11 +85,11 @@ class ucp_prefs
$data['user_style'] = (int) $user->data['user_style'];
}
- $error = validate_data($data, array(
+ $error = array_merge(validate_data($data, array(
'dateformat' => array('string', false, 1, 30),
'lang' => array('language_iso_name'),
'tz' => array('timezone'),
- ));
+ )), $error);
if (!check_form_key('ucp_prefs_personal'))
{
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 361dc831aa..8d8d42e742 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -32,7 +32,7 @@ class ucp_profile
function main($id, $mode)
{
global $cache, $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
- global $request, $phpbb_container;
+ global $request, $phpbb_container, $phpbb_dispatcher;
$user->add_lang('posting');
@@ -54,6 +54,17 @@ class ucp_profile
'password_confirm' => $request->variable('password_confirm', '', true),
);
+ /**
+ * Modify user registration data on editing account settings in UCP
+ *
+ * @event core.ucp_profile_reg_details_data
+ * @var array data Array with current or updated user registration data
+ * @var bool submit Flag indicating if submit button has been pressed
+ * @since 3.1.4-RC1
+ */
+ $vars = array('data', 'submit');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_profile_reg_details_data', compact($vars)));
+
add_form_key('ucp_reg_details');
if ($submit)
@@ -103,6 +114,18 @@ class ucp_profile
$error[] = 'FORM_INVALID';
}
+ /**
+ * Validate user data on editing registration data in UCP
+ *
+ * @event core.ucp_profile_reg_details_validate
+ * @var array data Array with user profile data
+ * @var bool submit Flag indicating if submit button has been pressed
+ * @var array error Array of any generated errors
+ * @since 3.1.4-RC1
+ */
+ $vars = array('data', 'submit', 'error');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_profile_reg_details_validate', compact($vars)));
+
if (!sizeof($error))
{
$sql_ary = array(
@@ -200,6 +223,17 @@ class ucp_profile
$sql_ary['user_newpasswd'] = '';
}
+ /**
+ * Modify user registration data before submitting it to the database
+ *
+ * @event core.ucp_profile_reg_details_sql_ary
+ * @var array data Array with current or updated user registration data
+ * @var array sql_ary Array with user registration data to submit to the database
+ * @since 3.1.4-RC1
+ */
+ $vars = array('data', 'sql_ary');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_profile_reg_details_sql_ary', compact($vars)));
+
if (sizeof($sql_ary))
{
$sql = 'UPDATE ' . USERS_TABLE . '
@@ -285,6 +319,17 @@ class ucp_profile
$data['user_birthday'] = sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']);
}
+ /**
+ * Modify user data on editing profile in UCP
+ *
+ * @event core.ucp_profile_modify_profile_info
+ * @var array data Array with user profile data
+ * @var bool submit Flag indicating if submit button has been pressed
+ * @since 3.1.4-RC1
+ */
+ $vars = array('data', 'submit');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_profile_modify_profile_info', compact($vars)));
+
add_form_key('ucp_profile_info');
if ($submit)
@@ -320,6 +365,18 @@ class ucp_profile
$error[] = 'FORM_INVALID';
}
+ /**
+ * Validate user data on editing profile in UCP
+ *
+ * @event core.ucp_profile_validate_profile_info
+ * @var array data Array with user profile data
+ * @var bool submit Flag indicating if submit button has been pressed
+ * @var array error Array of any generated errors
+ * @since 3.1.4-RC1
+ */
+ $vars = array('data', 'submit', 'error');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_profile_validate_profile_info', compact($vars)));
+
if (!sizeof($error))
{
$data['notify'] = $user->data['user_notify_type'];
@@ -341,6 +398,18 @@ class ucp_profile
$sql_ary['user_birthday'] = $data['user_birthday'];
}
+ /**
+ * Modify profile data in UCP before submitting to the database
+ *
+ * @event core.ucp_profile_info_modify_sql_ary
+ * @var array cp_data Array with the user custom profile fields data
+ * @var array data Array with user profile data
+ * @var array sql_ary user options data we update
+ * @since 3.1.4-RC1
+ */
+ $vars = array('cp_data', 'data', 'sql_ary');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_profile_info_modify_sql_ary', compact($vars)));
+
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE user_id = ' . $user->data['user_id'];
@@ -655,9 +724,14 @@ class ucp_profile
{
if (!empty($keys))
{
+ foreach ($keys as $key => $id)
+ {
+ $keys[$key] = $db->sql_like_expression($id . $db->get_any_char());
+ }
+ $sql_where = '(key_id ' . implode(' OR key_id ', $keys) . ')';
$sql = 'DELETE FROM ' . SESSIONS_KEYS_TABLE . '
WHERE user_id = ' . (int) $user->data['user_id'] . '
- AND ' . $db->sql_in_set('key_id', $keys) ;
+ AND ' . $sql_where ;
$db->sql_query($sql);
@@ -681,7 +755,7 @@ class ucp_profile
while ($row = $db->sql_fetchrow($result))
{
$template->assign_block_vars('sessions', array(
- 'KEY' => $row['key_id'],
+ 'KEY' => substr($row['key_id'], 0, 8),
'IP' => $row['last_ip'],
'LOGIN_TIME' => $user->format_date($row['last_login']),
));
diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php
index 9a15967bae..0ee45b0706 100644
--- a/phpBB/includes/ucp/ucp_register.php
+++ b/phpBB/includes/ucp/ucp_register.php
@@ -30,10 +30,11 @@ class ucp_register
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
- global $request, $phpbb_container;
+ global $request, $phpbb_container, $phpbb_dispatcher;
//
- if ($config['require_activation'] == USER_ACTIVATION_DISABLE)
+ if ($config['require_activation'] == USER_ACTIVATION_DISABLE ||
+ (in_array($config['require_activation'], array(USER_ACTIVATION_SELF, USER_ACTIVATION_ADMIN)) && !$config['email_enable']))
{
trigger_error('UCP_REGISTER_DISABLE');
}
@@ -87,8 +88,8 @@ class ucp_register
if (!empty($login_link_data))
{
// Confirm that we have all necessary data
- $auth_provider = 'auth.provider.' . $request->variable('auth_provider', $config['auth_method']);
- $auth_provider = $phpbb_container->get($auth_provider);
+ $provider_collection = $phpbb_container->get('auth.provider_collection');
+ $auth_provider = $provider_collection->get_provider($request->variable('auth_provider', ''));
$result = $auth_provider->login_link_has_necessary_data($login_link_data);
if ($result !== null)
@@ -196,6 +197,19 @@ class ucp_register
'lang' => basename(request_var('lang', $user->lang_name)),
'tz' => request_var('tz', $timezone),
);
+ /**
+ * Add UCP register data before they are assigned to the template or submitted
+ *
+ * To assign data to the template, use $template->assign_vars()
+ *
+ * @event core.ucp_register_data_before
+ * @var bool submit Do we display the form only
+ * or did the user press submit
+ * @var array data Array with current ucp registration data
+ * @since 3.1.4-RC1
+ */
+ $vars = array('submit', 'data');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_register_data_before', compact($vars)));
// Check and initialize some variables if needed
if ($submit)
@@ -256,6 +270,19 @@ class ucp_register
$error[] = $user->lang['NEW_PASSWORD_ERROR'];
}
}
+ /**
+ * Check UCP registration data after they are submitted
+ *
+ * @event core.ucp_register_data_after
+ * @var bool submit Do we display the form only
+ * or did the user press submit
+ * @var array data Array with current ucp registration data
+ * @var array cp_data Array with custom profile fields data
+ * @var array error Array with list of errors
+ * @since 3.1.4-RC1
+ */
+ $vars = array('submit', 'data', 'cp_data', 'error');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_register_data_after', compact($vars)));
if (!sizeof($error))
{
@@ -318,6 +345,20 @@ class ucp_register
{
$user_row['user_new'] = 1;
}
+ /**
+ * Add into $user_row before user_add
+ *
+ * user_add allows adding more data into the users table
+ *
+ * @event core.ucp_register_user_row_after
+ * @var bool submit Do we display the form only
+ * or did the user press submit
+ * @var array cp_data Array with custom profile fields data
+ * @var array user_row Array with current ucp registration data
+ * @since 3.1.4-RC1
+ */
+ $vars = array('submit', 'cp_data', 'user_row');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_register_user_row_after', compact($vars)));
// Register user...
$user_id = user_add($user_row, $cp_data);
diff --git a/phpBB/index.php b/phpBB/index.php
index a36d74e0e9..df6932f6c0 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -185,7 +185,7 @@ $template->assign_vars(array(
'U_MCP' => ($auth->acl_get('m_') || $auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=main&amp;mode=front', true, $user->session_id) : '')
);
-$page_title = $user->lang['INDEX'];
+$page_title = ($config['board_index_text'] !== '') ? $config['board_index_text'] : $user->lang['INDEX'];
/**
* You can use this event to modify the page title and load data for the index
diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php
index 4ec408a670..511f850679 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.1.0-RC4',
+ 'phpbb_version' => '3.1.3',
'author' => '<a href="https://www.phpbb.com/">phpBB Limited</a>',
'dbms' => $dbms,
'dbhost' => $dbhost,
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 8016ff349b..80fd40a944 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -174,6 +174,8 @@ define('IN_DB_UPDATE', true);
// End startup code
$migrator = $phpbb_container->get('migrator');
+$migrator->set_output_handler(new \phpbb\db\log_wrapper_migrator_output_handler($user, new \phpbb\db\html_migrator_output_handler($user), $phpbb_root_path . 'store/migrations_' . time() . '.log'));
+
$migrator->create_migrations_table();
$phpbb_extension_manager = $phpbb_container->get('ext.manager');
@@ -199,8 +201,6 @@ $safe_time_limit = min(15, ($phpbb_ini->get_int('max_execution_time') / 2));
while (!$migrator->finished())
{
- $migration_start_time = microtime(true);
-
try
{
$migrator->update();
@@ -219,28 +219,6 @@ while (!$migrator->finished())
$migrator->last_run_migration['state']
);
- if (isset($migrator->last_run_migration['effectively_installed']) && $migrator->last_run_migration['effectively_installed'])
- {
- echo $user->lang('MIGRATION_EFFECTIVELY_INSTALLED', $migrator->last_run_migration['name']);
- }
- else
- {
- if ($migrator->last_run_migration['task'] == 'process_data_step' && $state['migration_data_done'])
- {
- echo $user->lang('MIGRATION_DATA_DONE', $migrator->last_run_migration['name'], (microtime(true) - $migration_start_time));
- }
- else if ($migrator->last_run_migration['task'] == 'process_data_step')
- {
- echo $user->lang('MIGRATION_DATA_IN_PROGRESS', $migrator->last_run_migration['name'], (microtime(true) - $migration_start_time));
- }
- else if ($state['migration_schema_done'])
- {
- echo $user->lang('MIGRATION_SCHEMA_DONE', $migrator->last_run_migration['name'], (microtime(true) - $migration_start_time));
- }
- }
-
- echo "<br />\n";
-
// Are we approaching the time limit? If so we want to pause the update and continue after refreshing
if ((time() - $update_start_time) >= $safe_time_limit)
{
diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php
index 17161b5eae..e16c79474b 100644
--- a/phpBB/install/install_convert.php
+++ b/phpBB/install/install_convert.php
@@ -599,7 +599,7 @@ class install_convert extends module
'S_EXPLAIN' => $vars['explain'],
'S_LEGEND' => false,
'TITLE_EXPLAIN' => ($vars['explain']) ? $lang[$vars['lang'] . '_EXPLAIN'] : '',
- 'CONTENT' => $this->p_master->input_field($config_key, $vars['type'], $$config_key, $options),
+ 'CONTENT' => $this->p_master->input_field($config_key, $vars['type'], ${$config_key}, $options),
)
);
}
@@ -2014,7 +2014,7 @@ class install_convert extends module
{
$value = $fields[1][$firstkey];
}
- else if (is_array($fields[2]))
+ else if (is_array($fields[2]) && !is_callable($fields[2]))
{
// Execute complex function/eval/typecast
$value = $fields[1];
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index 20b211dde9..3a6858a254 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -1175,8 +1175,31 @@ class install_install extends module
}
// Ok we have the db info go ahead and work on building the table
- $db_table_schema = @file_get_contents('schemas/schema.json');
- $db_table_schema = json_decode($db_table_schema, true);
+ if (file_exists('schemas/schema.json'))
+ {
+ $db_table_schema = @file_get_contents('schemas/schema.json');
+ $db_table_schema = json_decode($db_table_schema, true);
+ }
+ else
+ {
+ global $phpbb_root_path, $phpEx, $table_prefix;
+ $table_prefix = 'phpbb_';
+
+ if (!defined('CONFIG_TABLE'))
+ {
+ // We need to include the constants file for the table constants
+ // when we generate the schema from the migration files.
+ include($phpbb_root_path . 'includes/constants.' . $phpEx);
+ }
+
+ $finder = new \phpbb\finder(new \phpbb\filesystem(), $phpbb_root_path, null, $phpEx);
+ $classes = $finder->core_path('phpbb/db/migration/data/')
+ ->get_classes();
+
+ $sqlite_db = new \phpbb\db\driver\sqlite();
+ $schema_generator = new \phpbb\db\migration\schema_generator($classes, new \phpbb\config\config(array()), $sqlite_db, new \phpbb\db\tools($sqlite_db, true), $phpbb_root_path, $phpEx, $table_prefix);
+ $db_table_schema = $schema_generator->get_schema();
+ }
if (!defined('CONFIG_TABLE'))
{
@@ -1654,6 +1677,19 @@ class install_install extends module
$db->sql_freeresult($result);
$_module->move_module_by($row, 'move_up', 5);
+
+ // Move extension management module 1 up...
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_langname = 'ACP_EXTENSION_MANAGEMENT'
+ AND module_class = 'acp'
+ AND module_mode = ''
+ AND module_basename = ''";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ $_module->move_module_by($row, 'move_up', 1);
}
if ($module_class == 'mcp')
@@ -1926,7 +1962,7 @@ class install_install extends module
'bot_ip' => (string) $bot_ary[1],
));
- $result = $db->sql_query($sql);
+ $db->sql_query($sql);
}
}
@@ -2047,7 +2083,7 @@ class install_install extends module
return array(
'language' => basename(request_var('language', '')),
'dbms' => request_var('dbms', ''),
- 'dbhost' => request_var('dbhost', ''),
+ 'dbhost' => request_var('dbhost', '', true),
'dbport' => request_var('dbport', ''),
'dbuser' => request_var('dbuser', ''),
'dbpasswd' => request_var('dbpasswd', '', true),
diff --git a/phpBB/install/schemas/schema.json b/phpBB/install/schemas/schema.json
deleted file mode 100644
index b71b1fecbe..0000000000
--- a/phpBB/install/schemas/schema.json
+++ /dev/null
@@ -1,3356 +0,0 @@
-{
- "phpbb_acl_groups": {
- "COLUMNS": {
- "group_id": [
- "UINT",
- 0
- ],
- "forum_id": [
- "UINT",
- 0
- ],
- "auth_option_id": [
- "UINT",
- 0
- ],
- "auth_role_id": [
- "UINT",
- 0
- ],
- "auth_setting": [
- "TINT:2",
- 0
- ]
- },
- "KEYS": {
- "group_id": [
- "INDEX",
- "group_id"
- ],
- "auth_opt_id": [
- "INDEX",
- "auth_option_id"
- ],
- "auth_role_id": [
- "INDEX",
- "auth_role_id"
- ]
- }
- },
- "phpbb_acl_options": {
- "COLUMNS": {
- "auth_option_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "auth_option": [
- "VCHAR:50",
- ""
- ],
- "is_global": [
- "BOOL",
- 0
- ],
- "is_local": [
- "BOOL",
- 0
- ],
- "founder_only": [
- "BOOL",
- 0
- ]
- },
- "PRIMARY_KEY": "auth_option_id",
- "KEYS": {
- "auth_option": [
- "UNIQUE",
- [
- "auth_option"
- ]
- ]
- }
- },
- "phpbb_acl_roles": {
- "COLUMNS": {
- "role_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "role_name": [
- "VCHAR_UNI",
- ""
- ],
- "role_description": [
- "TEXT_UNI",
- ""
- ],
- "role_type": [
- "VCHAR:10",
- ""
- ],
- "role_order": [
- "USINT",
- 0
- ]
- },
- "PRIMARY_KEY": "role_id",
- "KEYS": {
- "role_type": [
- "INDEX",
- "role_type"
- ],
- "role_order": [
- "INDEX",
- "role_order"
- ]
- }
- },
- "phpbb_acl_roles_data": {
- "COLUMNS": {
- "role_id": [
- "UINT",
- 0
- ],
- "auth_option_id": [
- "UINT",
- 0
- ],
- "auth_setting": [
- "TINT:2",
- 0
- ]
- },
- "PRIMARY_KEY": [
- "role_id",
- "auth_option_id"
- ],
- "KEYS": {
- "ath_op_id": [
- "INDEX",
- "auth_option_id"
- ]
- }
- },
- "phpbb_acl_users": {
- "COLUMNS": {
- "user_id": [
- "UINT",
- 0
- ],
- "forum_id": [
- "UINT",
- 0
- ],
- "auth_option_id": [
- "UINT",
- 0
- ],
- "auth_role_id": [
- "UINT",
- 0
- ],
- "auth_setting": [
- "TINT:2",
- 0
- ]
- },
- "KEYS": {
- "user_id": [
- "INDEX",
- "user_id"
- ],
- "auth_option_id": [
- "INDEX",
- "auth_option_id"
- ],
- "auth_role_id": [
- "INDEX",
- "auth_role_id"
- ]
- }
- },
- "phpbb_attachments": {
- "COLUMNS": {
- "attach_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "post_msg_id": [
- "UINT",
- 0
- ],
- "topic_id": [
- "UINT",
- 0
- ],
- "in_message": [
- "BOOL",
- 0
- ],
- "poster_id": [
- "UINT",
- 0
- ],
- "is_orphan": [
- "BOOL",
- 1
- ],
- "physical_filename": [
- "VCHAR",
- ""
- ],
- "real_filename": [
- "VCHAR",
- ""
- ],
- "download_count": [
- "UINT",
- 0
- ],
- "attach_comment": [
- "TEXT_UNI",
- ""
- ],
- "extension": [
- "VCHAR:100",
- ""
- ],
- "mimetype": [
- "VCHAR:100",
- ""
- ],
- "filesize": [
- "UINT:20",
- 0
- ],
- "filetime": [
- "TIMESTAMP",
- 0
- ],
- "thumbnail": [
- "BOOL",
- 0
- ]
- },
- "PRIMARY_KEY": "attach_id",
- "KEYS": {
- "filetime": [
- "INDEX",
- "filetime"
- ],
- "post_msg_id": [
- "INDEX",
- "post_msg_id"
- ],
- "topic_id": [
- "INDEX",
- "topic_id"
- ],
- "poster_id": [
- "INDEX",
- "poster_id"
- ],
- "is_orphan": [
- "INDEX",
- "is_orphan"
- ]
- }
- },
- "phpbb_banlist": {
- "COLUMNS": {
- "ban_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "ban_userid": [
- "UINT",
- 0
- ],
- "ban_ip": [
- "VCHAR:40",
- ""
- ],
- "ban_email": [
- "VCHAR_UNI:100",
- ""
- ],
- "ban_start": [
- "TIMESTAMP",
- 0
- ],
- "ban_end": [
- "TIMESTAMP",
- 0
- ],
- "ban_exclude": [
- "BOOL",
- 0
- ],
- "ban_reason": [
- "VCHAR_UNI",
- ""
- ],
- "ban_give_reason": [
- "VCHAR_UNI",
- ""
- ]
- },
- "PRIMARY_KEY": "ban_id",
- "KEYS": {
- "ban_end": [
- "INDEX",
- "ban_end"
- ],
- "ban_user": [
- "INDEX",
- [
- "ban_userid",
- "ban_exclude"
- ]
- ],
- "ban_email": [
- "INDEX",
- [
- "ban_email",
- "ban_exclude"
- ]
- ],
- "ban_ip": [
- "INDEX",
- [
- "ban_ip",
- "ban_exclude"
- ]
- ]
- }
- },
- "phpbb_bbcodes": {
- "COLUMNS": {
- "bbcode_id": [
- "USINT",
- 0
- ],
- "bbcode_tag": [
- "VCHAR:16",
- ""
- ],
- "bbcode_helpline": [
- "VCHAR_UNI",
- ""
- ],
- "display_on_posting": [
- "BOOL",
- 0
- ],
- "bbcode_match": [
- "TEXT_UNI",
- ""
- ],
- "bbcode_tpl": [
- "MTEXT_UNI",
- ""
- ],
- "first_pass_match": [
- "MTEXT_UNI",
- ""
- ],
- "first_pass_replace": [
- "MTEXT_UNI",
- ""
- ],
- "second_pass_match": [
- "MTEXT_UNI",
- ""
- ],
- "second_pass_replace": [
- "MTEXT_UNI",
- ""
- ]
- },
- "PRIMARY_KEY": "bbcode_id",
- "KEYS": {
- "display_on_post": [
- "INDEX",
- "display_on_posting"
- ]
- }
- },
- "phpbb_bookmarks": {
- "COLUMNS": {
- "topic_id": [
- "UINT",
- 0
- ],
- "user_id": [
- "UINT",
- 0
- ]
- },
- "PRIMARY_KEY": [
- "topic_id",
- "user_id"
- ]
- },
- "phpbb_bots": {
- "COLUMNS": {
- "bot_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "bot_active": [
- "BOOL",
- 1
- ],
- "bot_name": [
- "STEXT_UNI",
- ""
- ],
- "user_id": [
- "UINT",
- 0
- ],
- "bot_agent": [
- "VCHAR",
- ""
- ],
- "bot_ip": [
- "VCHAR",
- ""
- ]
- },
- "PRIMARY_KEY": "bot_id",
- "KEYS": {
- "bot_active": [
- "INDEX",
- "bot_active"
- ]
- }
- },
- "phpbb_config": {
- "COLUMNS": {
- "config_name": [
- "VCHAR",
- ""
- ],
- "config_value": [
- "VCHAR_UNI",
- ""
- ],
- "is_dynamic": [
- "BOOL",
- 0
- ]
- },
- "PRIMARY_KEY": "config_name",
- "KEYS": {
- "is_dynamic": [
- "INDEX",
- "is_dynamic"
- ]
- }
- },
- "phpbb_config_text": {
- "COLUMNS": {
- "config_name": [
- "VCHAR",
- ""
- ],
- "config_value": [
- "MTEXT",
- ""
- ]
- },
- "PRIMARY_KEY": "config_name"
- },
- "phpbb_confirm": {
- "COLUMNS": {
- "confirm_id": [
- "CHAR:32",
- ""
- ],
- "session_id": [
- "CHAR:32",
- ""
- ],
- "confirm_type": [
- "TINT:3",
- 0
- ],
- "code": [
- "VCHAR:8",
- ""
- ],
- "seed": [
- "UINT:10",
- 0
- ],
- "attempts": [
- "UINT",
- 0
- ]
- },
- "PRIMARY_KEY": [
- "session_id",
- "confirm_id"
- ],
- "KEYS": {
- "confirm_type": [
- "INDEX",
- "confirm_type"
- ]
- }
- },
- "phpbb_disallow": {
- "COLUMNS": {
- "disallow_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "disallow_username": [
- "VCHAR_UNI:255",
- ""
- ]
- },
- "PRIMARY_KEY": "disallow_id"
- },
- "phpbb_drafts": {
- "COLUMNS": {
- "draft_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "user_id": [
- "UINT",
- 0
- ],
- "topic_id": [
- "UINT",
- 0
- ],
- "forum_id": [
- "UINT",
- 0
- ],
- "save_time": [
- "TIMESTAMP",
- 0
- ],
- "draft_subject": [
- "STEXT_UNI",
- ""
- ],
- "draft_message": [
- "MTEXT_UNI",
- ""
- ]
- },
- "PRIMARY_KEY": "draft_id",
- "KEYS": {
- "save_time": [
- "INDEX",
- "save_time"
- ]
- }
- },
- "phpbb_ext": {
- "COLUMNS": {
- "ext_name": [
- "VCHAR",
- ""
- ],
- "ext_active": [
- "BOOL",
- 0
- ],
- "ext_state": [
- "TEXT",
- ""
- ]
- },
- "KEYS": {
- "ext_name": [
- "UNIQUE",
- "ext_name"
- ]
- }
- },
- "phpbb_extension_groups": {
- "COLUMNS": {
- "group_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "group_name": [
- "VCHAR_UNI",
- ""
- ],
- "cat_id": [
- "TINT:2",
- 0
- ],
- "allow_group": [
- "BOOL",
- 0
- ],
- "download_mode": [
- "BOOL",
- 1
- ],
- "upload_icon": [
- "VCHAR",
- ""
- ],
- "max_filesize": [
- "UINT:20",
- 0
- ],
- "allowed_forums": [
- "TEXT",
- ""
- ],
- "allow_in_pm": [
- "BOOL",
- 0
- ]
- },
- "PRIMARY_KEY": "group_id"
- },
- "phpbb_extensions": {
- "COLUMNS": {
- "extension_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "group_id": [
- "UINT",
- 0
- ],
- "extension": [
- "VCHAR:100",
- ""
- ]
- },
- "PRIMARY_KEY": "extension_id"
- },
- "phpbb_forums": {
- "COLUMNS": {
- "forum_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "parent_id": [
- "UINT",
- 0
- ],
- "left_id": [
- "UINT",
- 0
- ],
- "right_id": [
- "UINT",
- 0
- ],
- "forum_parents": [
- "MTEXT",
- ""
- ],
- "forum_name": [
- "STEXT_UNI",
- ""
- ],
- "forum_desc": [
- "TEXT_UNI",
- ""
- ],
- "forum_desc_bitfield": [
- "VCHAR:255",
- ""
- ],
- "forum_desc_options": [
- "UINT:11",
- 7
- ],
- "forum_desc_uid": [
- "VCHAR:8",
- ""
- ],
- "forum_link": [
- "VCHAR_UNI",
- ""
- ],
- "forum_password": [
- "VCHAR:255",
- ""
- ],
- "forum_style": [
- "UINT",
- 0
- ],
- "forum_image": [
- "VCHAR",
- ""
- ],
- "forum_rules": [
- "TEXT_UNI",
- ""
- ],
- "forum_rules_link": [
- "VCHAR_UNI",
- ""
- ],
- "forum_rules_bitfield": [
- "VCHAR:255",
- ""
- ],
- "forum_rules_options": [
- "UINT:11",
- 7
- ],
- "forum_rules_uid": [
- "VCHAR:8",
- ""
- ],
- "forum_topics_per_page": [
- "TINT:4",
- 0
- ],
- "forum_type": [
- "TINT:4",
- 0
- ],
- "forum_status": [
- "TINT:4",
- 0
- ],
- "forum_last_post_id": [
- "UINT",
- 0
- ],
- "forum_last_poster_id": [
- "UINT",
- 0
- ],
- "forum_last_post_subject": [
- "STEXT_UNI",
- ""
- ],
- "forum_last_post_time": [
- "TIMESTAMP",
- 0
- ],
- "forum_last_poster_name": [
- "VCHAR_UNI",
- ""
- ],
- "forum_last_poster_colour": [
- "VCHAR:6",
- ""
- ],
- "forum_flags": [
- "TINT:4",
- 32
- ],
- "display_on_index": [
- "BOOL",
- 1
- ],
- "enable_indexing": [
- "BOOL",
- 1
- ],
- "enable_icons": [
- "BOOL",
- 1
- ],
- "enable_prune": [
- "BOOL",
- 0
- ],
- "prune_next": [
- "TIMESTAMP",
- 0
- ],
- "prune_days": [
- "UINT",
- 0
- ],
- "prune_viewed": [
- "UINT",
- 0
- ],
- "prune_freq": [
- "UINT",
- 0
- ],
- "display_subforum_list": [
- "BOOL",
- 1
- ],
- "forum_options": [
- "UINT:20",
- 0
- ],
- "enable_shadow_prune": [
- "BOOL",
- 0
- ],
- "prune_shadow_days": [
- "UINT",
- 7
- ],
- "prune_shadow_freq": [
- "UINT",
- 1
- ],
- "prune_shadow_next": [
- "INT:11",
- 0
- ],
- "forum_posts_approved": [
- "UINT",
- 0
- ],
- "forum_posts_unapproved": [
- "UINT",
- 0
- ],
- "forum_posts_softdeleted": [
- "UINT",
- 0
- ],
- "forum_topics_approved": [
- "UINT",
- 0
- ],
- "forum_topics_unapproved": [
- "UINT",
- 0
- ],
- "forum_topics_softdeleted": [
- "UINT",
- 0
- ]
- },
- "PRIMARY_KEY": "forum_id",
- "KEYS": {
- "left_right_id": [
- "INDEX",
- [
- "left_id",
- "right_id"
- ]
- ],
- "forum_lastpost_id": [
- "INDEX",
- "forum_last_post_id"
- ]
- }
- },
- "phpbb_forums_access": {
- "COLUMNS": {
- "forum_id": [
- "UINT",
- 0
- ],
- "user_id": [
- "UINT",
- 0
- ],
- "session_id": [
- "CHAR:32",
- ""
- ]
- },
- "PRIMARY_KEY": [
- "forum_id",
- "user_id",
- "session_id"
- ]
- },
- "phpbb_forums_track": {
- "COLUMNS": {
- "user_id": [
- "UINT",
- 0
- ],
- "forum_id": [
- "UINT",
- 0
- ],
- "mark_time": [
- "TIMESTAMP",
- 0
- ]
- },
- "PRIMARY_KEY": [
- "user_id",
- "forum_id"
- ]
- },
- "phpbb_forums_watch": {
- "COLUMNS": {
- "forum_id": [
- "UINT",
- 0
- ],
- "user_id": [
- "UINT",
- 0
- ],
- "notify_status": [
- "BOOL",
- 0
- ]
- },
- "KEYS": {
- "forum_id": [
- "INDEX",
- "forum_id"
- ],
- "user_id": [
- "INDEX",
- "user_id"
- ],
- "notify_stat": [
- "INDEX",
- "notify_status"
- ]
- }
- },
- "phpbb_groups": {
- "COLUMNS": {
- "group_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "group_type": [
- "TINT:4",
- 1
- ],
- "group_founder_manage": [
- "BOOL",
- 0
- ],
- "group_skip_auth": [
- "BOOL",
- 0
- ],
- "group_name": [
- "VCHAR_CI",
- ""
- ],
- "group_desc": [
- "TEXT_UNI",
- ""
- ],
- "group_desc_bitfield": [
- "VCHAR:255",
- ""
- ],
- "group_desc_options": [
- "UINT:11",
- 7
- ],
- "group_desc_uid": [
- "VCHAR:8",
- ""
- ],
- "group_display": [
- "BOOL",
- 0
- ],
- "group_avatar": [
- "VCHAR",
- ""
- ],
- "group_avatar_type": [
- "VCHAR:255",
- ""
- ],
- "group_avatar_width": [
- "USINT",
- 0
- ],
- "group_avatar_height": [
- "USINT",
- 0
- ],
- "group_rank": [
- "UINT",
- 0
- ],
- "group_colour": [
- "VCHAR:6",
- ""
- ],
- "group_sig_chars": [
- "UINT",
- 0
- ],
- "group_receive_pm": [
- "BOOL",
- 0
- ],
- "group_message_limit": [
- "UINT",
- 0
- ],
- "group_legend": [
- "UINT",
- 0
- ],
- "group_max_recipients": [
- "UINT",
- 0
- ]
- },
- "PRIMARY_KEY": "group_id",
- "KEYS": {
- "group_legend_name": [
- "INDEX",
- [
- "group_legend",
- "group_name"
- ]
- ]
- }
- },
- "phpbb_icons": {
- "COLUMNS": {
- "icons_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "icons_url": [
- "VCHAR",
- ""
- ],
- "icons_width": [
- "TINT:4",
- 0
- ],
- "icons_height": [
- "TINT:4",
- 0
- ],
- "icons_order": [
- "UINT",
- 0
- ],
- "display_on_posting": [
- "BOOL",
- 1
- ]
- },
- "PRIMARY_KEY": "icons_id",
- "KEYS": {
- "display_on_posting": [
- "INDEX",
- "display_on_posting"
- ]
- }
- },
- "phpbb_lang": {
- "COLUMNS": {
- "lang_id": [
- "TINT:4",
- null,
- "auto_increment"
- ],
- "lang_iso": [
- "VCHAR:30",
- ""
- ],
- "lang_dir": [
- "VCHAR:30",
- ""
- ],
- "lang_english_name": [
- "VCHAR_UNI:100",
- ""
- ],
- "lang_local_name": [
- "VCHAR_UNI:255",
- ""
- ],
- "lang_author": [
- "VCHAR_UNI:255",
- ""
- ]
- },
- "PRIMARY_KEY": "lang_id",
- "KEYS": {
- "lang_iso": [
- "INDEX",
- "lang_iso"
- ]
- }
- },
- "phpbb_log": {
- "COLUMNS": {
- "log_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "log_type": [
- "TINT:4",
- 0
- ],
- "user_id": [
- "UINT",
- 0
- ],
- "forum_id": [
- "UINT",
- 0
- ],
- "topic_id": [
- "UINT",
- 0
- ],
- "reportee_id": [
- "UINT",
- 0
- ],
- "log_ip": [
- "VCHAR:40",
- ""
- ],
- "log_time": [
- "TIMESTAMP",
- 0
- ],
- "log_operation": [
- "TEXT_UNI",
- ""
- ],
- "log_data": [
- "MTEXT_UNI",
- ""
- ]
- },
- "PRIMARY_KEY": "log_id",
- "KEYS": {
- "log_type": [
- "INDEX",
- "log_type"
- ],
- "forum_id": [
- "INDEX",
- "forum_id"
- ],
- "topic_id": [
- "INDEX",
- "topic_id"
- ],
- "reportee_id": [
- "INDEX",
- "reportee_id"
- ],
- "user_id": [
- "INDEX",
- "user_id"
- ]
- }
- },
- "phpbb_login_attempts": {
- "COLUMNS": {
- "attempt_ip": [
- "VCHAR:40",
- ""
- ],
- "attempt_browser": [
- "VCHAR:150",
- ""
- ],
- "attempt_forwarded_for": [
- "VCHAR:255",
- ""
- ],
- "attempt_time": [
- "TIMESTAMP",
- 0
- ],
- "user_id": [
- "UINT",
- 0
- ],
- "username": [
- "VCHAR_UNI:255",
- 0
- ],
- "username_clean": [
- "VCHAR_CI",
- 0
- ]
- },
- "KEYS": {
- "att_ip": [
- "INDEX",
- [
- "attempt_ip",
- "attempt_time"
- ]
- ],
- "att_for": [
- "INDEX",
- [
- "attempt_forwarded_for",
- "attempt_time"
- ]
- ],
- "att_time": [
- "INDEX",
- [
- "attempt_time"
- ]
- ],
- "user_id": [
- "INDEX",
- "user_id"
- ]
- }
- },
- "phpbb_migrations": {
- "COLUMNS": {
- "migration_name": [
- "VCHAR",
- ""
- ],
- "migration_depends_on": [
- "TEXT",
- ""
- ],
- "migration_schema_done": [
- "BOOL",
- 0
- ],
- "migration_data_done": [
- "BOOL",
- 0
- ],
- "migration_data_state": [
- "TEXT",
- ""
- ],
- "migration_start_time": [
- "TIMESTAMP",
- 0
- ],
- "migration_end_time": [
- "TIMESTAMP",
- 0
- ]
- },
- "PRIMARY_KEY": "migration_name"
- },
- "phpbb_moderator_cache": {
- "COLUMNS": {
- "forum_id": [
- "UINT",
- 0
- ],
- "user_id": [
- "UINT",
- 0
- ],
- "username": [
- "VCHAR_UNI:255",
- ""
- ],
- "group_id": [
- "UINT",
- 0
- ],
- "group_name": [
- "VCHAR_UNI",
- ""
- ],
- "display_on_index": [
- "BOOL",
- 1
- ]
- },
- "KEYS": {
- "disp_idx": [
- "INDEX",
- "display_on_index"
- ],
- "forum_id": [
- "INDEX",
- "forum_id"
- ]
- }
- },
- "phpbb_modules": {
- "COLUMNS": {
- "module_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "module_enabled": [
- "BOOL",
- 1
- ],
- "module_display": [
- "BOOL",
- 1
- ],
- "module_basename": [
- "VCHAR",
- ""
- ],
- "module_class": [
- "VCHAR:10",
- ""
- ],
- "parent_id": [
- "UINT",
- 0
- ],
- "left_id": [
- "UINT",
- 0
- ],
- "right_id": [
- "UINT",
- 0
- ],
- "module_langname": [
- "VCHAR",
- ""
- ],
- "module_mode": [
- "VCHAR",
- ""
- ],
- "module_auth": [
- "VCHAR",
- ""
- ]
- },
- "PRIMARY_KEY": "module_id",
- "KEYS": {
- "left_right_id": [
- "INDEX",
- [
- "left_id",
- "right_id"
- ]
- ],
- "module_enabled": [
- "INDEX",
- "module_enabled"
- ],
- "class_left_id": [
- "INDEX",
- [
- "module_class",
- "left_id"
- ]
- ]
- }
- },
- "phpbb_notification_types": {
- "COLUMNS": {
- "notification_type_id": [
- "USINT",
- null,
- "auto_increment"
- ],
- "notification_type_name": [
- "VCHAR:255",
- ""
- ],
- "notification_type_enabled": [
- "BOOL",
- 1
- ]
- },
- "PRIMARY_KEY": [
- "notification_type_id"
- ],
- "KEYS": {
- "type": [
- "UNIQUE",
- [
- "notification_type_name"
- ]
- ]
- }
- },
- "phpbb_notifications": {
- "COLUMNS": {
- "notification_id": [
- "UINT:10",
- null,
- "auto_increment"
- ],
- "notification_type_id": [
- "USINT",
- 0
- ],
- "item_id": [
- "UINT",
- 0
- ],
- "item_parent_id": [
- "UINT",
- 0
- ],
- "user_id": [
- "UINT",
- 0
- ],
- "notification_read": [
- "BOOL",
- 0
- ],
- "notification_time": [
- "TIMESTAMP",
- 1
- ],
- "notification_data": [
- "TEXT_UNI",
- ""
- ]
- },
- "PRIMARY_KEY": "notification_id",
- "KEYS": {
- "item_ident": [
- "INDEX",
- [
- "notification_type_id",
- "item_id"
- ]
- ],
- "user": [
- "INDEX",
- [
- "user_id",
- "notification_read"
- ]
- ]
- }
- },
- "phpbb_oauth_accounts": {
- "COLUMNS": {
- "user_id": [
- "UINT",
- 0
- ],
- "provider": [
- "VCHAR",
- ""
- ],
- "oauth_provider_id": [
- "TEXT_UNI",
- ""
- ]
- },
- "PRIMARY_KEY": [
- "user_id",
- "provider"
- ]
- },
- "phpbb_oauth_tokens": {
- "COLUMNS": {
- "user_id": [
- "UINT",
- 0
- ],
- "session_id": [
- "CHAR:32",
- ""
- ],
- "provider": [
- "VCHAR",
- ""
- ],
- "oauth_token": [
- "MTEXT",
- ""
- ]
- },
- "KEYS": {
- "user_id": [
- "INDEX",
- "user_id"
- ],
- "provider": [
- "INDEX",
- "provider"
- ]
- }
- },
- "phpbb_poll_options": {
- "COLUMNS": {
- "poll_option_id": [
- "TINT:4",
- 0
- ],
- "topic_id": [
- "UINT",
- 0
- ],
- "poll_option_text": [
- "TEXT_UNI",
- ""
- ],
- "poll_option_total": [
- "UINT",
- 0
- ]
- },
- "KEYS": {
- "poll_opt_id": [
- "INDEX",
- "poll_option_id"
- ],
- "topic_id": [
- "INDEX",
- "topic_id"
- ]
- }
- },
- "phpbb_poll_votes": {
- "COLUMNS": {
- "topic_id": [
- "UINT",
- 0
- ],
- "poll_option_id": [
- "TINT:4",
- 0
- ],
- "vote_user_id": [
- "UINT",
- 0
- ],
- "vote_user_ip": [
- "VCHAR:40",
- ""
- ]
- },
- "KEYS": {
- "topic_id": [
- "INDEX",
- "topic_id"
- ],
- "vote_user_id": [
- "INDEX",
- "vote_user_id"
- ],
- "vote_user_ip": [
- "INDEX",
- "vote_user_ip"
- ]
- }
- },
- "phpbb_posts": {
- "COLUMNS": {
- "post_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "topic_id": [
- "UINT",
- 0
- ],
- "forum_id": [
- "UINT",
- 0
- ],
- "poster_id": [
- "UINT",
- 0
- ],
- "icon_id": [
- "UINT",
- 0
- ],
- "poster_ip": [
- "VCHAR:40",
- ""
- ],
- "post_time": [
- "TIMESTAMP",
- 0
- ],
- "post_reported": [
- "BOOL",
- 0
- ],
- "enable_bbcode": [
- "BOOL",
- 1
- ],
- "enable_smilies": [
- "BOOL",
- 1
- ],
- "enable_magic_url": [
- "BOOL",
- 1
- ],
- "enable_sig": [
- "BOOL",
- 1
- ],
- "post_username": [
- "VCHAR_UNI:255",
- ""
- ],
- "post_subject": [
- "STEXT_UNI",
- "",
- "true_sort"
- ],
- "post_text": [
- "MTEXT_UNI",
- ""
- ],
- "post_checksum": [
- "VCHAR:32",
- ""
- ],
- "post_attachment": [
- "BOOL",
- 0
- ],
- "bbcode_bitfield": [
- "VCHAR:255",
- ""
- ],
- "bbcode_uid": [
- "VCHAR:8",
- ""
- ],
- "post_postcount": [
- "BOOL",
- 1
- ],
- "post_edit_time": [
- "TIMESTAMP",
- 0
- ],
- "post_edit_reason": [
- "STEXT_UNI",
- ""
- ],
- "post_edit_user": [
- "UINT",
- 0
- ],
- "post_edit_count": [
- "USINT",
- 0
- ],
- "post_edit_locked": [
- "BOOL",
- 0
- ],
- "post_visibility": [
- "TINT:3",
- 0
- ],
- "post_delete_time": [
- "TIMESTAMP",
- 0
- ],
- "post_delete_reason": [
- "STEXT_UNI",
- ""
- ],
- "post_delete_user": [
- "UINT",
- 0
- ]
- },
- "PRIMARY_KEY": "post_id",
- "KEYS": {
- "forum_id": [
- "INDEX",
- "forum_id"
- ],
- "topic_id": [
- "INDEX",
- "topic_id"
- ],
- "poster_ip": [
- "INDEX",
- "poster_ip"
- ],
- "poster_id": [
- "INDEX",
- "poster_id"
- ],
- "tid_post_time": [
- "INDEX",
- [
- "topic_id",
- "post_time"
- ]
- ],
- "post_username": [
- "INDEX",
- [
- "post_username:255"
- ]
- ],
- "post_visibility": [
- "INDEX",
- [
- "post_visibility"
- ]
- ]
- }
- },
- "phpbb_privmsgs": {
- "COLUMNS": {
- "msg_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "root_level": [
- "UINT",
- 0
- ],
- "author_id": [
- "UINT",
- 0
- ],
- "icon_id": [
- "UINT",
- 0
- ],
- "author_ip": [
- "VCHAR:40",
- ""
- ],
- "message_time": [
- "TIMESTAMP",
- 0
- ],
- "enable_bbcode": [
- "BOOL",
- 1
- ],
- "enable_smilies": [
- "BOOL",
- 1
- ],
- "enable_magic_url": [
- "BOOL",
- 1
- ],
- "enable_sig": [
- "BOOL",
- 1
- ],
- "message_subject": [
- "STEXT_UNI",
- ""
- ],
- "message_text": [
- "MTEXT_UNI",
- ""
- ],
- "message_edit_reason": [
- "STEXT_UNI",
- ""
- ],
- "message_edit_user": [
- "UINT",
- 0
- ],
- "message_attachment": [
- "BOOL",
- 0
- ],
- "bbcode_bitfield": [
- "VCHAR:255",
- ""
- ],
- "bbcode_uid": [
- "VCHAR:8",
- ""
- ],
- "message_edit_time": [
- "TIMESTAMP",
- 0
- ],
- "message_edit_count": [
- "USINT",
- 0
- ],
- "to_address": [
- "TEXT_UNI",
- ""
- ],
- "bcc_address": [
- "TEXT_UNI",
- ""
- ],
- "message_reported": [
- "BOOL",
- 0
- ]
- },
- "PRIMARY_KEY": "msg_id",
- "KEYS": {
- "author_ip": [
- "INDEX",
- "author_ip"
- ],
- "message_time": [
- "INDEX",
- "message_time"
- ],
- "author_id": [
- "INDEX",
- "author_id"
- ],
- "root_level": [
- "INDEX",
- "root_level"
- ]
- }
- },
- "phpbb_privmsgs_folder": {
- "COLUMNS": {
- "folder_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "user_id": [
- "UINT",
- 0
- ],
- "folder_name": [
- "VCHAR_UNI",
- ""
- ],
- "pm_count": [
- "UINT",
- 0
- ]
- },
- "PRIMARY_KEY": "folder_id",
- "KEYS": {
- "user_id": [
- "INDEX",
- "user_id"
- ]
- }
- },
- "phpbb_privmsgs_rules": {
- "COLUMNS": {
- "rule_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "user_id": [
- "UINT",
- 0
- ],
- "rule_check": [
- "UINT",
- 0
- ],
- "rule_connection": [
- "UINT",
- 0
- ],
- "rule_string": [
- "VCHAR_UNI",
- ""
- ],
- "rule_user_id": [
- "UINT",
- 0
- ],
- "rule_group_id": [
- "UINT",
- 0
- ],
- "rule_action": [
- "UINT",
- 0
- ],
- "rule_folder_id": [
- "INT:11",
- 0
- ]
- },
- "PRIMARY_KEY": "rule_id",
- "KEYS": {
- "user_id": [
- "INDEX",
- "user_id"
- ]
- }
- },
- "phpbb_privmsgs_to": {
- "COLUMNS": {
- "msg_id": [
- "UINT",
- 0
- ],
- "user_id": [
- "UINT",
- 0
- ],
- "author_id": [
- "UINT",
- 0
- ],
- "pm_deleted": [
- "BOOL",
- 0
- ],
- "pm_new": [
- "BOOL",
- 1
- ],
- "pm_unread": [
- "BOOL",
- 1
- ],
- "pm_replied": [
- "BOOL",
- 0
- ],
- "pm_marked": [
- "BOOL",
- 0
- ],
- "pm_forwarded": [
- "BOOL",
- 0
- ],
- "folder_id": [
- "INT:11",
- 0
- ]
- },
- "KEYS": {
- "msg_id": [
- "INDEX",
- "msg_id"
- ],
- "author_id": [
- "INDEX",
- "author_id"
- ],
- "usr_flder_id": [
- "INDEX",
- [
- "user_id",
- "folder_id"
- ]
- ]
- }
- },
- "phpbb_profile_fields": {
- "COLUMNS": {
- "field_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "field_name": [
- "VCHAR_UNI",
- ""
- ],
- "field_type": [
- "VCHAR:100",
- ""
- ],
- "field_ident": [
- "VCHAR:20",
- ""
- ],
- "field_length": [
- "VCHAR:20",
- ""
- ],
- "field_minlen": [
- "VCHAR",
- ""
- ],
- "field_maxlen": [
- "VCHAR",
- ""
- ],
- "field_novalue": [
- "VCHAR_UNI",
- ""
- ],
- "field_default_value": [
- "VCHAR_UNI",
- ""
- ],
- "field_validation": [
- "VCHAR_UNI:20",
- ""
- ],
- "field_required": [
- "BOOL",
- 0
- ],
- "field_show_on_reg": [
- "BOOL",
- 0
- ],
- "field_hide": [
- "BOOL",
- 0
- ],
- "field_no_view": [
- "BOOL",
- 0
- ],
- "field_active": [
- "BOOL",
- 0
- ],
- "field_order": [
- "UINT",
- 0
- ],
- "field_show_profile": [
- "BOOL",
- 0
- ],
- "field_show_on_vt": [
- "BOOL",
- 0
- ],
- "field_show_novalue": [
- "BOOL",
- 0
- ],
- "field_show_on_pm": [
- "BOOL",
- 0
- ],
- "field_show_on_ml": [
- "BOOL",
- 0
- ],
- "field_is_contact": [
- "BOOL",
- 0
- ],
- "field_contact_desc": [
- "VCHAR",
- ""
- ],
- "field_contact_url": [
- "VCHAR",
- ""
- ]
- },
- "PRIMARY_KEY": "field_id",
- "KEYS": {
- "fld_type": [
- "INDEX",
- "field_type"
- ],
- "fld_ordr": [
- "INDEX",
- "field_order"
- ]
- }
- },
- "phpbb_profile_fields_data": {
- "COLUMNS": {
- "user_id": [
- "UINT",
- 0
- ],
- "pf_phpbb_interests": [
- "MTEXT",
- ""
- ],
- "pf_phpbb_occupation": [
- "MTEXT",
- ""
- ],
- "pf_phpbb_facebook": [
- "VCHAR",
- ""
- ],
- "pf_phpbb_googleplus": [
- "VCHAR",
- ""
- ],
- "pf_phpbb_icq": [
- "VCHAR",
- ""
- ],
- "pf_phpbb_location": [
- "VCHAR",
- ""
- ],
- "pf_phpbb_skype": [
- "VCHAR",
- ""
- ],
- "pf_phpbb_twitter": [
- "VCHAR",
- ""
- ],
- "pf_phpbb_website": [
- "VCHAR",
- ""
- ],
- "pf_phpbb_wlm": [
- "VCHAR",
- ""
- ],
- "pf_phpbb_yahoo": [
- "VCHAR",
- ""
- ],
- "pf_phpbb_youtube": [
- "VCHAR",
- ""
- ],
- "pf_phpbb_aol": [
- "VCHAR",
- ""
- ]
- },
- "PRIMARY_KEY": "user_id"
- },
- "phpbb_profile_fields_lang": {
- "COLUMNS": {
- "field_id": [
- "UINT",
- 0
- ],
- "lang_id": [
- "UINT",
- 0
- ],
- "option_id": [
- "UINT",
- 0
- ],
- "field_type": [
- "VCHAR:100",
- ""
- ],
- "lang_value": [
- "VCHAR_UNI",
- ""
- ]
- },
- "PRIMARY_KEY": [
- "field_id",
- "lang_id",
- "option_id"
- ]
- },
- "phpbb_profile_lang": {
- "COLUMNS": {
- "field_id": [
- "UINT",
- 0
- ],
- "lang_id": [
- "UINT",
- 0
- ],
- "lang_name": [
- "VCHAR_UNI",
- ""
- ],
- "lang_explain": [
- "TEXT_UNI",
- ""
- ],
- "lang_default_value": [
- "VCHAR_UNI",
- ""
- ]
- },
- "PRIMARY_KEY": [
- "field_id",
- "lang_id"
- ]
- },
- "phpbb_ranks": {
- "COLUMNS": {
- "rank_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "rank_title": [
- "VCHAR_UNI",
- ""
- ],
- "rank_min": [
- "UINT",
- 0
- ],
- "rank_special": [
- "BOOL",
- 0
- ],
- "rank_image": [
- "VCHAR",
- ""
- ]
- },
- "PRIMARY_KEY": "rank_id"
- },
- "phpbb_reports": {
- "COLUMNS": {
- "report_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "reason_id": [
- "USINT",
- 0
- ],
- "post_id": [
- "UINT",
- 0
- ],
- "user_id": [
- "UINT",
- 0
- ],
- "user_notify": [
- "BOOL",
- 0
- ],
- "report_closed": [
- "BOOL",
- 0
- ],
- "report_time": [
- "TIMESTAMP",
- 0
- ],
- "report_text": [
- "MTEXT_UNI",
- ""
- ],
- "pm_id": [
- "UINT",
- 0
- ],
- "reported_post_enable_bbcode": [
- "BOOL",
- 1
- ],
- "reported_post_enable_smilies": [
- "BOOL",
- 1
- ],
- "reported_post_enable_magic_url": [
- "BOOL",
- 1
- ],
- "reported_post_text": [
- "MTEXT_UNI",
- ""
- ],
- "reported_post_uid": [
- "VCHAR:8",
- ""
- ],
- "reported_post_bitfield": [
- "VCHAR:255",
- ""
- ]
- },
- "PRIMARY_KEY": "report_id",
- "KEYS": {
- "post_id": [
- "INDEX",
- [
- "post_id"
- ]
- ],
- "pm_id": [
- "INDEX",
- [
- "pm_id"
- ]
- ]
- }
- },
- "phpbb_reports_reasons": {
- "COLUMNS": {
- "reason_id": [
- "USINT",
- null,
- "auto_increment"
- ],
- "reason_title": [
- "VCHAR_UNI",
- ""
- ],
- "reason_description": [
- "MTEXT_UNI",
- ""
- ],
- "reason_order": [
- "USINT",
- 0
- ]
- },
- "PRIMARY_KEY": "reason_id"
- },
- "phpbb_search_results": {
- "COLUMNS": {
- "search_key": [
- "VCHAR:32",
- ""
- ],
- "search_time": [
- "TIMESTAMP",
- 0
- ],
- "search_keywords": [
- "MTEXT_UNI",
- ""
- ],
- "search_authors": [
- "MTEXT",
- ""
- ]
- },
- "PRIMARY_KEY": "search_key"
- },
- "phpbb_search_wordlist": {
- "COLUMNS": {
- "word_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "word_text": [
- "VCHAR_UNI",
- ""
- ],
- "word_common": [
- "BOOL",
- 0
- ],
- "word_count": [
- "UINT",
- 0
- ]
- },
- "PRIMARY_KEY": "word_id",
- "KEYS": {
- "wrd_txt": [
- "UNIQUE",
- "word_text"
- ],
- "wrd_cnt": [
- "INDEX",
- "word_count"
- ]
- }
- },
- "phpbb_search_wordmatch": {
- "COLUMNS": {
- "post_id": [
- "UINT",
- 0
- ],
- "word_id": [
- "UINT",
- 0
- ],
- "title_match": [
- "BOOL",
- 0
- ]
- },
- "KEYS": {
- "word_id": [
- "INDEX",
- "word_id"
- ],
- "post_id": [
- "INDEX",
- "post_id"
- ],
- "un_mtch": [
- "UNIQUE",
- [
- "word_id",
- "post_id",
- "title_match"
- ]
- ]
- }
- },
- "phpbb_sessions": {
- "COLUMNS": {
- "session_id": [
- "CHAR:32",
- ""
- ],
- "session_user_id": [
- "UINT",
- 0
- ],
- "session_last_visit": [
- "TIMESTAMP",
- 0
- ],
- "session_start": [
- "TIMESTAMP",
- 0
- ],
- "session_time": [
- "TIMESTAMP",
- 0
- ],
- "session_ip": [
- "VCHAR:40",
- ""
- ],
- "session_browser": [
- "VCHAR:150",
- ""
- ],
- "session_forwarded_for": [
- "VCHAR:255",
- ""
- ],
- "session_page": [
- "VCHAR_UNI",
- ""
- ],
- "session_viewonline": [
- "BOOL",
- 1
- ],
- "session_autologin": [
- "BOOL",
- 0
- ],
- "session_admin": [
- "BOOL",
- 0
- ],
- "session_forum_id": [
- "UINT",
- 0
- ]
- },
- "PRIMARY_KEY": "session_id",
- "KEYS": {
- "session_time": [
- "INDEX",
- "session_time"
- ],
- "session_user_id": [
- "INDEX",
- "session_user_id"
- ],
- "session_fid": [
- "INDEX",
- [
- "session_forum_id"
- ]
- ]
- }
- },
- "phpbb_sessions_keys": {
- "COLUMNS": {
- "key_id": [
- "CHAR:32",
- ""
- ],
- "user_id": [
- "UINT",
- 0
- ],
- "last_ip": [
- "VCHAR:40",
- ""
- ],
- "last_login": [
- "TIMESTAMP",
- 0
- ]
- },
- "PRIMARY_KEY": [
- "key_id",
- "user_id"
- ],
- "KEYS": {
- "last_login": [
- "INDEX",
- "last_login"
- ]
- }
- },
- "phpbb_sitelist": {
- "COLUMNS": {
- "site_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "site_ip": [
- "VCHAR:40",
- ""
- ],
- "site_hostname": [
- "VCHAR",
- ""
- ],
- "ip_exclude": [
- "BOOL",
- 0
- ]
- },
- "PRIMARY_KEY": "site_id"
- },
- "phpbb_smilies": {
- "COLUMNS": {
- "smiley_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "code": [
- "VCHAR_UNI:50",
- ""
- ],
- "emotion": [
- "VCHAR_UNI:50",
- ""
- ],
- "smiley_url": [
- "VCHAR:50",
- ""
- ],
- "smiley_width": [
- "USINT",
- 0
- ],
- "smiley_height": [
- "USINT",
- 0
- ],
- "smiley_order": [
- "UINT",
- 0
- ],
- "display_on_posting": [
- "BOOL",
- 1
- ]
- },
- "PRIMARY_KEY": "smiley_id",
- "KEYS": {
- "display_on_post": [
- "INDEX",
- "display_on_posting"
- ]
- }
- },
- "phpbb_styles": {
- "COLUMNS": {
- "style_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "style_name": [
- "VCHAR_UNI:255",
- ""
- ],
- "style_copyright": [
- "VCHAR_UNI",
- ""
- ],
- "style_active": [
- "BOOL",
- 1
- ],
- "style_path": [
- "VCHAR:100",
- ""
- ],
- "bbcode_bitfield": [
- "VCHAR:255",
- "kNg="
- ],
- "style_parent_id": [
- "UINT:4",
- 0
- ],
- "style_parent_tree": [
- "TEXT",
- ""
- ]
- },
- "PRIMARY_KEY": "style_id",
- "KEYS": {
- "style_name": [
- "UNIQUE",
- "style_name"
- ]
- }
- },
- "phpbb_teampage": {
- "COLUMNS": {
- "teampage_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "group_id": [
- "UINT",
- 0
- ],
- "teampage_name": [
- "VCHAR_UNI:255",
- ""
- ],
- "teampage_position": [
- "UINT",
- 0
- ],
- "teampage_parent": [
- "UINT",
- 0
- ]
- },
- "PRIMARY_KEY": "teampage_id"
- },
- "phpbb_topics": {
- "COLUMNS": {
- "topic_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "forum_id": [
- "UINT",
- 0
- ],
- "icon_id": [
- "UINT",
- 0
- ],
- "topic_attachment": [
- "BOOL",
- 0
- ],
- "topic_reported": [
- "BOOL",
- 0
- ],
- "topic_title": [
- "STEXT_UNI",
- "",
- "true_sort"
- ],
- "topic_poster": [
- "UINT",
- 0
- ],
- "topic_time": [
- "TIMESTAMP",
- 0
- ],
- "topic_time_limit": [
- "TIMESTAMP",
- 0
- ],
- "topic_views": [
- "UINT",
- 0
- ],
- "topic_status": [
- "TINT:3",
- 0
- ],
- "topic_type": [
- "TINT:3",
- 0
- ],
- "topic_first_post_id": [
- "UINT",
- 0
- ],
- "topic_first_poster_name": [
- "VCHAR_UNI:255",
- "",
- "true_sort"
- ],
- "topic_first_poster_colour": [
- "VCHAR:6",
- ""
- ],
- "topic_last_post_id": [
- "UINT",
- 0
- ],
- "topic_last_poster_id": [
- "UINT",
- 0
- ],
- "topic_last_poster_name": [
- "VCHAR_UNI",
- ""
- ],
- "topic_last_poster_colour": [
- "VCHAR:6",
- ""
- ],
- "topic_last_post_subject": [
- "STEXT_UNI",
- ""
- ],
- "topic_last_post_time": [
- "TIMESTAMP",
- 0
- ],
- "topic_last_view_time": [
- "TIMESTAMP",
- 0
- ],
- "topic_moved_id": [
- "UINT",
- 0
- ],
- "topic_bumped": [
- "BOOL",
- 0
- ],
- "topic_bumper": [
- "UINT",
- 0
- ],
- "poll_title": [
- "STEXT_UNI",
- ""
- ],
- "poll_start": [
- "TIMESTAMP",
- 0
- ],
- "poll_length": [
- "TIMESTAMP",
- 0
- ],
- "poll_max_options": [
- "TINT:4",
- 1
- ],
- "poll_last_vote": [
- "TIMESTAMP",
- 0
- ],
- "poll_vote_change": [
- "BOOL",
- 0
- ],
- "topic_visibility": [
- "TINT:3",
- 0
- ],
- "topic_delete_time": [
- "TIMESTAMP",
- 0
- ],
- "topic_delete_reason": [
- "STEXT_UNI",
- ""
- ],
- "topic_delete_user": [
- "UINT",
- 0
- ],
- "topic_posts_approved": [
- "UINT",
- 0
- ],
- "topic_posts_unapproved": [
- "UINT",
- 0
- ],
- "topic_posts_softdeleted": [
- "UINT",
- 0
- ]
- },
- "PRIMARY_KEY": "topic_id",
- "KEYS": {
- "forum_id": [
- "INDEX",
- "forum_id"
- ],
- "forum_id_type": [
- "INDEX",
- [
- "forum_id",
- "topic_type"
- ]
- ],
- "last_post_time": [
- "INDEX",
- "topic_last_post_time"
- ],
- "fid_time_moved": [
- "INDEX",
- [
- "forum_id",
- "topic_last_post_time",
- "topic_moved_id"
- ]
- ],
- "topic_visibility": [
- "INDEX",
- [
- "topic_visibility"
- ]
- ],
- "forum_vis_last": [
- "INDEX",
- [
- "forum_id",
- "topic_visibility",
- "topic_last_post_id"
- ]
- ]
- }
- },
- "phpbb_topics_posted": {
- "COLUMNS": {
- "user_id": [
- "UINT",
- 0
- ],
- "topic_id": [
- "UINT",
- 0
- ],
- "topic_posted": [
- "BOOL",
- 0
- ]
- },
- "PRIMARY_KEY": [
- "user_id",
- "topic_id"
- ]
- },
- "phpbb_topics_track": {
- "COLUMNS": {
- "user_id": [
- "UINT",
- 0
- ],
- "topic_id": [
- "UINT",
- 0
- ],
- "forum_id": [
- "UINT",
- 0
- ],
- "mark_time": [
- "TIMESTAMP",
- 0
- ]
- },
- "PRIMARY_KEY": [
- "user_id",
- "topic_id"
- ],
- "KEYS": {
- "forum_id": [
- "INDEX",
- "forum_id"
- ],
- "topic_id": [
- "INDEX",
- [
- "topic_id"
- ]
- ]
- }
- },
- "phpbb_topics_watch": {
- "COLUMNS": {
- "topic_id": [
- "UINT",
- 0
- ],
- "user_id": [
- "UINT",
- 0
- ],
- "notify_status": [
- "BOOL",
- 0
- ]
- },
- "KEYS": {
- "topic_id": [
- "INDEX",
- "topic_id"
- ],
- "user_id": [
- "INDEX",
- "user_id"
- ],
- "notify_stat": [
- "INDEX",
- "notify_status"
- ]
- }
- },
- "phpbb_user_group": {
- "COLUMNS": {
- "group_id": [
- "UINT",
- 0
- ],
- "user_id": [
- "UINT",
- 0
- ],
- "group_leader": [
- "BOOL",
- 0
- ],
- "user_pending": [
- "BOOL",
- 1
- ]
- },
- "KEYS": {
- "group_id": [
- "INDEX",
- "group_id"
- ],
- "user_id": [
- "INDEX",
- "user_id"
- ],
- "group_leader": [
- "INDEX",
- "group_leader"
- ]
- }
- },
- "phpbb_user_notifications": {
- "COLUMNS": {
- "item_type": [
- "VCHAR:255",
- ""
- ],
- "item_id": [
- "UINT",
- 0
- ],
- "user_id": [
- "UINT",
- 0
- ],
- "method": [
- "VCHAR:255",
- ""
- ],
- "notify": [
- "BOOL",
- 1
- ]
- }
- },
- "phpbb_users": {
- "COLUMNS": {
- "user_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "user_type": [
- "TINT:2",
- 0
- ],
- "group_id": [
- "UINT",
- 3
- ],
- "user_permissions": [
- "MTEXT",
- ""
- ],
- "user_perm_from": [
- "UINT",
- 0
- ],
- "user_ip": [
- "VCHAR:40",
- ""
- ],
- "user_regdate": [
- "TIMESTAMP",
- 0
- ],
- "username": [
- "VCHAR_CI",
- ""
- ],
- "username_clean": [
- "VCHAR_CI",
- ""
- ],
- "user_password": [
- "VCHAR:255",
- ""
- ],
- "user_passchg": [
- "TIMESTAMP",
- 0
- ],
- "user_email": [
- "VCHAR_UNI:100",
- ""
- ],
- "user_email_hash": [
- "BINT",
- 0
- ],
- "user_birthday": [
- "VCHAR:10",
- ""
- ],
- "user_lastvisit": [
- "TIMESTAMP",
- 0
- ],
- "user_lastmark": [
- "TIMESTAMP",
- 0
- ],
- "user_lastpost_time": [
- "TIMESTAMP",
- 0
- ],
- "user_lastpage": [
- "VCHAR_UNI:200",
- ""
- ],
- "user_last_confirm_key": [
- "VCHAR:10",
- ""
- ],
- "user_last_search": [
- "TIMESTAMP",
- 0
- ],
- "user_warnings": [
- "TINT:4",
- 0
- ],
- "user_last_warning": [
- "TIMESTAMP",
- 0
- ],
- "user_login_attempts": [
- "TINT:4",
- 0
- ],
- "user_inactive_reason": [
- "TINT:2",
- 0
- ],
- "user_inactive_time": [
- "TIMESTAMP",
- 0
- ],
- "user_posts": [
- "UINT",
- 0
- ],
- "user_lang": [
- "VCHAR:30",
- ""
- ],
- "user_timezone": [
- "VCHAR:100",
- ""
- ],
- "user_dateformat": [
- "VCHAR_UNI:30",
- "d M Y H:i"
- ],
- "user_style": [
- "UINT",
- 0
- ],
- "user_rank": [
- "UINT",
- 0
- ],
- "user_colour": [
- "VCHAR:6",
- ""
- ],
- "user_new_privmsg": [
- "INT:4",
- 0
- ],
- "user_unread_privmsg": [
- "INT:4",
- 0
- ],
- "user_last_privmsg": [
- "TIMESTAMP",
- 0
- ],
- "user_message_rules": [
- "BOOL",
- 0
- ],
- "user_full_folder": [
- "INT:11",
- -3
- ],
- "user_emailtime": [
- "TIMESTAMP",
- 0
- ],
- "user_topic_show_days": [
- "USINT",
- 0
- ],
- "user_topic_sortby_type": [
- "VCHAR:1",
- "t"
- ],
- "user_topic_sortby_dir": [
- "VCHAR:1",
- "d"
- ],
- "user_post_show_days": [
- "USINT",
- 0
- ],
- "user_post_sortby_type": [
- "VCHAR:1",
- "t"
- ],
- "user_post_sortby_dir": [
- "VCHAR:1",
- "a"
- ],
- "user_notify": [
- "BOOL",
- 0
- ],
- "user_notify_pm": [
- "BOOL",
- 1
- ],
- "user_notify_type": [
- "TINT:4",
- 0
- ],
- "user_allow_pm": [
- "BOOL",
- 1
- ],
- "user_allow_viewonline": [
- "BOOL",
- 1
- ],
- "user_allow_viewemail": [
- "BOOL",
- 1
- ],
- "user_allow_massemail": [
- "BOOL",
- 1
- ],
- "user_options": [
- "UINT:11",
- 230271
- ],
- "user_avatar": [
- "VCHAR",
- ""
- ],
- "user_avatar_type": [
- "VCHAR:255",
- ""
- ],
- "user_avatar_width": [
- "USINT",
- 0
- ],
- "user_avatar_height": [
- "USINT",
- 0
- ],
- "user_sig": [
- "MTEXT_UNI",
- ""
- ],
- "user_sig_bbcode_uid": [
- "VCHAR:8",
- ""
- ],
- "user_sig_bbcode_bitfield": [
- "VCHAR:255",
- ""
- ],
- "user_jabber": [
- "VCHAR_UNI",
- ""
- ],
- "user_actkey": [
- "VCHAR:32",
- ""
- ],
- "user_newpasswd": [
- "VCHAR:255",
- ""
- ],
- "user_form_salt": [
- "VCHAR_UNI:32",
- ""
- ],
- "user_new": [
- "BOOL",
- 1
- ],
- "user_reminded": [
- "TINT:4",
- 0
- ],
- "user_reminded_time": [
- "TIMESTAMP",
- 0
- ]
- },
- "PRIMARY_KEY": "user_id",
- "KEYS": {
- "user_birthday": [
- "INDEX",
- "user_birthday"
- ],
- "user_email_hash": [
- "INDEX",
- "user_email_hash"
- ],
- "user_type": [
- "INDEX",
- "user_type"
- ],
- "username_clean": [
- "UNIQUE",
- "username_clean"
- ]
- }
- },
- "phpbb_warnings": {
- "COLUMNS": {
- "warning_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "user_id": [
- "UINT",
- 0
- ],
- "post_id": [
- "UINT",
- 0
- ],
- "log_id": [
- "UINT",
- 0
- ],
- "warning_time": [
- "TIMESTAMP",
- 0
- ]
- },
- "PRIMARY_KEY": "warning_id"
- },
- "phpbb_words": {
- "COLUMNS": {
- "word_id": [
- "UINT",
- null,
- "auto_increment"
- ],
- "word": [
- "VCHAR_UNI",
- ""
- ],
- "replacement": [
- "VCHAR_UNI",
- ""
- ]
- },
- "PRIMARY_KEY": "word_id"
- },
- "phpbb_zebra": {
- "COLUMNS": {
- "user_id": [
- "UINT",
- 0
- ],
- "zebra_id": [
- "UINT",
- 0
- ],
- "friend": [
- "BOOL",
- 0
- ],
- "foe": [
- "BOOL",
- 0
- ]
- },
- "PRIMARY_KEY": [
- "user_id",
- "zebra_id"
- ]
- }
-} \ No newline at end of file
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index baabe90f2a..a39bb365d6 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -273,7 +273,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0
INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('use_system_cron', '0');
-INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.1.0-RC5-dev');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.1.4-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');
@@ -805,7 +805,7 @@ INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_len
INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_aol', 'profilefields.type.string', 'phpbb_aol', '40', '5', '255', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 5, 1, '', '');
INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_icq', 'profilefields.type.string', 'phpbb_icq', '20', '3', '15', '', '', '[0-9]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 6, 1, 'SEND_ICQ_MESSAGE', 'https://www.icq.com/people/%s/');
INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_wlm', 'profilefields.type.string', 'phpbb_wlm', '40', '5', '255', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 7, 1, '', '');
-INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_yahoo', 'profilefields.type.string', 'phpbb_yahoo', '40', '5', '255', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 8, 1, 'SEND_YIM_MESSAGE', 'http://edit.yahoo.com/config/send_webmesg?.target=%s&amp;.src=pg');
+INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_yahoo', 'profilefields.type.string', 'phpbb_yahoo', '40', '5', '255', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 8, 1, 'SEND_YIM_MESSAGE', 'ymsgr:sendim?%s');
INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_facebook', 'profilefields.type.string', 'phpbb_facebook', '20', '5', '50', '', '', '[\w.]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 9, 1, 'VIEW_FACEBOOK_PROFILE', 'http://facebook.com/%s/');
INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_twitter', 'profilefields.type.string', 'phpbb_twitter', '20', '1', '15', '', '', '[\w_]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 10, 1, 'VIEW_TWITTER_PROFILE', 'http://twitter.com/%s');
INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_skype', 'profilefields.type.string', 'phpbb_skype', '20', '6', '32', '', '', '[a-zA-Z][\w\.,\-_]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 11, 1, 'VIEW_SKYPE_PROFILE', 'skype:%s?userinfo');
diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php
index 24cfe4556b..8d6c1c141d 100644
--- a/phpBB/language/en/acp/board.php
+++ b/phpBB/language/en/acp/board.php
@@ -41,17 +41,21 @@ $lang = array_merge($lang, array(
'ACP_BOARD_SETTINGS_EXPLAIN' => 'Here you can determine the basic operation of your board, give it a fitting name and description, and among other settings adjust the default values for timezone and language.',
'BOARD_INDEX_TEXT' => 'Board index text',
'BOARD_INDEX_TEXT_EXPLAIN' => 'This text is displayed as the board index in the board’s breadcrumbs. If not specified, it will default to “Board index”.',
+ 'BOARD_STYLE' => 'Board style',
'CUSTOM_DATEFORMAT' => 'Custom…',
'DEFAULT_DATE_FORMAT' => 'Date format',
'DEFAULT_DATE_FORMAT_EXPLAIN' => 'The date format is the same as the PHP <code>date</code> function.',
'DEFAULT_LANGUAGE' => 'Default language',
'DEFAULT_STYLE' => 'Default style',
+ 'DEFAULT_STYLE_EXPLAIN' => 'The default style for new users.',
'DISABLE_BOARD' => 'Disable board',
'DISABLE_BOARD_EXPLAIN' => 'This will make the board unavailable to users who are neither administrators nor moderators. You can also enter a short (255 character) message to display if you wish.',
'DISPLAY_LAST_SUBJECT' => 'Display subject of last added post on forum list',
'DISPLAY_LAST_SUBJECT_EXPLAIN' => 'The subject of the last added post will be displayed in the forum list with a hyperlink to the post. Subjects from password protected forums and forums in which user doesn’t have read access are not shown.',
+ 'GUEST_STYLE' => 'Guest style',
+ 'GUEST_STYLE_EXPLAIN' => 'The board style for guests.',
'OVERRIDE_STYLE' => 'Override user style',
- 'OVERRIDE_STYLE_EXPLAIN' => 'Replaces user’s style with the default.',
+ 'OVERRIDE_STYLE_EXPLAIN' => 'Replaces user’s (and guest’s) style with the style as defined under "Default style".',
'SITE_DESC' => 'Site description',
'SITE_HOME_TEXT' => 'Main website text',
'SITE_HOME_TEXT_EXPLAIN' => 'This text will be displayed as a link to your website homepage in the board’s breadcrumbs. If not specified, it will default to “Home”.',
@@ -217,7 +221,8 @@ $lang = array_merge($lang, array(
'ACP_REGISTER_SETTINGS_EXPLAIN' => 'Here you are able to define registration and profile related settings.',
'ACC_ACTIVATION' => 'Account activation',
- 'ACC_ACTIVATION_EXPLAIN' => 'This determines whether users have immediate access to the board or if confirmation is required. You can also completely disable new registrations. “Board-wide email” must be enabled in order to use user or admin activation.',
+ 'ACC_ACTIVATION_EXPLAIN' => 'This determines whether users have immediate access to the board or if confirmation is required. You can also completely disable new registrations. <em>“Board-wide email” must be enabled in order to use user or admin activation.</em>',
+ 'ACC_ACTIVATION_WARNING' => 'Please note that the currently selected activation method requires emails to be enabled, otherwise registration will be disabled. We recommend to either select a different activation method or reenable emails.',
'NEW_MEMBER_POST_LIMIT' => 'New member post limit',
'NEW_MEMBER_POST_LIMIT_EXPLAIN' => 'New members are within the <em>Newly Registered Users</em> group until they reach this number of posts. You can use this group to keep them from using the PM system or to review their posts. <strong>A value of 0 disables this feature.</strong>',
'NEW_MEMBER_GROUP_DEFAULT' => 'Set Newly Registered Users group to default',
@@ -552,7 +557,7 @@ $lang = array_merge($lang, array(
'EMAIL_SIG' => 'Email signature',
'EMAIL_SIG_EXPLAIN' => 'This text will be attached to all emails the board sends.',
'ENABLE_EMAIL' => 'Enable board-wide emails',
- 'ENABLE_EMAIL_EXPLAIN' => 'If this is set to disabled no emails will be sent by the board at all. <em>Note the user and admin account activation settings require this setting to be enabled. If currently using “user” or “admin” activation in the activation settings, disabling this setting will require no activation of new accounts.</em>',
+ 'ENABLE_EMAIL_EXPLAIN' => 'If this is set to disabled no emails will be sent by the board at all. <em>Note the user and admin account activation settings require this setting to be enabled. If currently using “user” or “admin” activation in the activation settings, disabling this setting will disable registration.</em>',
'SMTP_AUTH_METHOD' => 'Authentication method for SMTP',
'SMTP_AUTH_METHOD_EXPLAIN' => 'Only used if a username/password is set, ask your provider if you are unsure which method to use.',
'SMTP_CRAM_MD5' => 'CRAM-MD5',
diff --git a/phpBB/language/en/acp/common.php b/phpBB/language/en/acp/common.php
index 91fc1215fc..fdbc4aebd0 100644
--- a/phpBB/language/en/acp/common.php
+++ b/phpBB/language/en/acp/common.php
@@ -558,6 +558,7 @@ $lang = array_merge($lang, array(
'LOG_LOCK_POST' => '<strong>Locked post</strong><br />» %s',
'LOG_MERGE' => '<strong>Merged posts</strong> into topic<br />» %s',
'LOG_MOVE' => '<strong>Moved topic</strong><br />» from %1$s to %2$s',
+ 'LOG_MOVED_TOPIC' => '<strong>Moved topic</strong><br />» %s',
'LOG_PM_REPORT_CLOSED' => '<strong>Closed PM report</strong><br />» %s',
'LOG_PM_REPORT_DELETED' => '<strong>Deleted PM report</strong><br />» %s',
'LOG_POST_APPROVED' => '<strong>Approved post</strong><br />» %s',
diff --git a/phpBB/language/en/acp/permissions.php b/phpBB/language/en/acp/permissions.php
index 8654a9e88c..1ade2d6eb8 100644
--- a/phpBB/language/en/acp/permissions.php
+++ b/phpBB/language/en/acp/permissions.php
@@ -54,7 +54,7 @@ $lang = array_merge($lang, array(
<br />
- <p>For further information on setting up and managing permissions on your phpBB3 board, please see <a href="https://www.phpbb.com/support/documentation/3.0/quickstart/quick_permissions.html">Chapter 1.5 of our Quick Start Guide</a>.</p>
+ <p>For further information on setting up and managing permissions on your phpBB3 board, please see the section on <a href="https://www.phpbb.com/support/docs/en/3.1/ug/quickstart/permissions/">Setting permissions of our Quick Start Guide</a>.</p>
',
'ACL_NEVER' => 'Never',
diff --git a/phpBB/language/en/acp/profile.php b/phpBB/language/en/acp/profile.php
index 5972f8a18e..d365aeb183 100644
--- a/phpBB/language/en/acp/profile.php
+++ b/phpBB/language/en/acp/profile.php
@@ -99,7 +99,7 @@ $lang = array_merge($lang, array(
'FIELD_IDENT_EXPLAIN' => 'The field identification is a name to identify the profile field within the database and the templates.',
'FIELD_INT' => 'Numbers',
'FIELD_IS_CONTACT' => 'Display field as a contact field',
- 'FIELD_IS_CONTACT_EXPLAIN' => 'Contact fields are displayed within the contact section of the user profile and are displayed differently in the mini profile next to posts and private messages.',
+ 'FIELD_IS_CONTACT_EXPLAIN' => 'Contact fields are displayed within the contact section of the user profile and are displayed differently in the mini profile next to posts and private messages. You can use <samp>%s</samp> as a placeholder variable which will be replaced by a value provided by the user.',
'FIELD_LENGTH' => 'Length of input box',
'FIELD_NOT_FOUND' => 'Profile field not found.',
'FIELD_STRING' => 'Single text field',
diff --git a/phpBB/language/en/acp/search.php b/phpBB/language/en/acp/search.php
index 564d9dd04c..bda965b615 100644
--- a/phpBB/language/en/acp/search.php
+++ b/phpBB/language/en/acp/search.php
@@ -83,8 +83,8 @@ $lang = array_merge($lang, array(
'FULLTEXT_SPHINX_PORT_EXPLAIN' => 'Port on which the sphinx search daemon (searchd) listens. Leave empty to use the default Sphinx API port 9312',
'FULLTEXT_SPHINX_WRONG_DATABASE' => 'The sphinx search for phpBB supports MySQL and PostgreSQL only.',
'FULLTEXT_SPHINX_CONFIG_FILE' => 'Sphinx config file',
- 'FULLTEXT_SPHINX_CONFIG_FILE_EXPLAIN' => 'The generated content of the sphinx config file. This data needs to be pasted into the sphinx.conf which is used by sphinx search daemon.',
- 'FULLTEXT_SPHINX_NO_CONFIG_DATA' => 'The sphinx data and config directory paths are not defined. Please define them to generate the config file.',
+ 'FULLTEXT_SPHINX_CONFIG_FILE_EXPLAIN' => 'The generated content of the sphinx config file. This data needs to be pasted into the sphinx.conf which is used by sphinx search daemon. Replace the [dbuser] and [dbpassword] placeholders with your database credentials.',
+ 'FULLTEXT_SPHINX_NO_CONFIG_DATA' => 'The sphinx data directory path is not defined. Please define the path and submit to generate the config file.',
'GENERAL_SEARCH_SETTINGS' => 'General search settings',
'GO_TO_SEARCH_INDEX' => 'Go to search index page',
diff --git a/phpBB/language/en/acp/styles.php b/phpBB/language/en/acp/styles.php
index 506d569d56..e6b05c8282 100644
--- a/phpBB/language/en/acp/styles.php
+++ b/phpBB/language/en/acp/styles.php
@@ -74,6 +74,7 @@ $lang = array_merge($lang, array(
'STYLE_INSTALLED_RETURN_INSTALLED_STYLES' => 'Return to installed styles list',
'STYLE_INSTALLED_RETURN_UNINSTALLED_STYLES' => 'Install more styles',
'STYLE_NAME' => 'Style name',
+ 'STYLE_NAME_RESERVED' => 'Style "%s" can not be installed, because the name is reserved.',
'STYLE_NOT_INSTALLED' => 'Style "%s" was not installed.',
'STYLE_PATH' => 'Style path',
'STYLE_UNINSTALL' => 'Uninstall',
diff --git a/phpBB/language/en/email/short/newtopic_notify.txt b/phpBB/language/en/email/short/newtopic_notify.txt
index bf6799e5be..5089e7dcb8 100644
--- a/phpBB/language/en/email/short/newtopic_notify.txt
+++ b/phpBB/language/en/email/short/newtopic_notify.txt
@@ -2,7 +2,7 @@ Subject: New topic notification - "{FORUM_NAME}"
Hello {USERNAME},
-You are receiving this notification because you are watching the forum "{FORUM_NAME}" at "{SITENAME}". This forum has received a new topic<!-- IF AUTHOR_NAME --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit, "{TOPIC_TITLE}". You can use the following link to view the forum, no more notifications will be sent until you visit the forum.
+You are receiving this notification because you are watching the forum "{FORUM_NAME}" at "{SITENAME}". This forum has received a new topic<!-- IF AUTHOR_NAME !== '' --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit, "{TOPIC_TITLE}". You can use the following link to view the forum, no more notifications will be sent until you visit the forum.
{U_FORUM}
diff --git a/phpBB/language/en/email/short/topic_notify.txt b/phpBB/language/en/email/short/topic_notify.txt
index 472375fb22..529478eae2 100644
--- a/phpBB/language/en/email/short/topic_notify.txt
+++ b/phpBB/language/en/email/short/topic_notify.txt
@@ -2,7 +2,7 @@ Subject: Topic reply notification - "{TOPIC_TITLE}"
Hello {USERNAME},
-You are receiving this notification because you are watching the topic "{TOPIC_TITLE}" at "{SITENAME}". This topic has received a reply<!-- IF AUTHOR_NAME --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit. You can use the following link to view the replies made, no more notifications will be sent until you visit the topic.
+You are receiving this notification because you are watching the topic "{TOPIC_TITLE}" at "{SITENAME}". This topic has received a reply<!-- IF AUTHOR_NAME !== '' --> by {AUTHOR_NAME}<!-- ENDIF --> since your last visit. You can use the following link to view the replies made, no more notifications will be sent until you visit the topic.
If you want to view the newest post made since your last visit, click the following link:
{U_NEWEST_POST}
diff --git a/phpBB/language/en/help_faq.php b/phpBB/language/en/help_faq.php
index 904dc92080..8f08ac1cd3 100644
--- a/phpBB/language/en/help_faq.php
+++ b/phpBB/language/en/help_faq.php
@@ -36,44 +36,40 @@ $help = array(
1 => 'Login and Registration Issues'
),
array(
- 0 => 'Why can’t I login?',
- 1 => 'There are several reasons why this could occur. First, ensure your username and password are correct. If they are, contact the board owner to make sure you haven’t been banned. It is also possible the website owner has a configuration error on their end, and they would need to fix it.'
- ),
- array(
- 0 => 'Why do I need to register at all?',
+ 0 => 'Why do I need to register?',
1 => 'You may not have to, it is up to the administrator of the board as to whether you need to register in order to post messages. However; registration will give you access to additional features not available to guest users such as definable avatar images, private messaging, emailing of fellow users, usergroup subscription, etc. It only takes a few moments to register so it is recommended you do so.'
),
array(
- 0 => 'Why do I get logged off automatically?',
- 1 => 'If you do not check the <em>Remember me</em> box when you login, the board will only keep you logged in for a preset time. This prevents misuse of your account by anyone else. To stay logged in, check the box during login. This is not recommended if you access the board from a shared computer, e.g. library, internet cafe, university computer lab, etc. If you do not see this checkbox, it means the board administrator has disabled this feature.'
- ),
- array(
- 0 => 'How do I prevent my username appearing in the online user listings?',
- 1 => 'Within your User Control Panel, under “Board preferences”, you will find the option <em>Hide your online status</em>. Enable this option with <samp>Yes</samp> and you will only appear to the administrators, moderators and yourself. You will be counted as a hidden user.'
+ 0 => 'What is COPPA?',
+ 1 => 'COPPA, or the Children’s Online Privacy Protection Act of 1998, is a law in the United States requiring websites which can potentially collect information from minors under the age of 13 to have written parental consent or some other method of legal guardian acknowledgment, allowing the collection of personally identifiable information from a minor under the age of 13. If you are unsure if this applies to you as someone trying to register or to the website you are trying to register on, contact legal counsel for assistance. Please note that phpBB Limited and the owners of this board cannot provide legal advice and is not a point of contact for legal concerns of any kind, except as outlined in question “Who do I contact about abusive and/or legal matters related to this board?”.',
),
array(
- 0 => 'I’ve lost my password!',
- 1 => 'Don’t panic! While your password cannot be retrieved, it can easily be reset. Visit the login page and click <em>I’ve forgotten my password</em>. Follow the instructions and you should be able to log in again shortly.'
+ 0 => 'Why can’t I register?',
+ 1 => 'It is possible a board administrator has disabled registration to prevent new visitors from signing up. A board administrator could have also banned your IP address or disallowed the username you are attempting to register. Contact a board administrator for assistance.',
),
array(
0 => 'I registered but cannot login!',
1 => 'First, check your username and password. If they are correct, then one of two things may have happened. If COPPA support is enabled and you specified being under 13 years old during registration, you will have to follow the instructions you received. Some boards will also require new registrations to be activated, either by yourself or by an administrator before you can logon; this information was present during registration. If you were sent an email, follow the instructions. If you did not receive an email, you may have provided an incorrect email address or the email may have been picked up by a spam filer. If you are sure the email address you provided is correct, try contacting an administrator.'
),
array(
+ 0 => 'Why can’t I login?',
+ 1 => 'There are several reasons why this could occur. First, ensure your username and password are correct. If they are, contact a board administrator to make sure you haven’t been banned. It is also possible the website owner has a configuration error on their end, and they would need to fix it.',
+ ),
+ array(
0 => 'I registered in the past but cannot login any more?!',
1 => 'It is possible an administrator has deactivated or deleted your account for some reason. Also, many boards periodically remove users who have not posted for a long time to reduce the size of the database. If this has happened, try registering again and being more involved in discussions.'
),
array(
- 0 => 'What is COPPA?',
- 1 => 'COPPA, or the Child Online Privacy and Protection Act of 1998, is a law in the United States requiring websites which can potentially collect information from minors under the age of 13 to have written parental consent or some other method of legal guardian acknowledgment, allowing the collection of personally identifiable information from a minor under the age of 13. If you are unsure if this applies to you as someone trying to register or to the website you are trying to register on, contact legal counsel for assistance. Please note that the phpBB Limited cannot provide legal advice and is not a point of contact for legal concerns of any kind, except as outlined below.',
+ 0 => 'I’ve lost my password!',
+ 1 => 'Don’t panic! While your password cannot be retrieved, it can easily be reset. Visit the login page and click <em>I forgot my password</em>. Follow the instructions and you should be able to log in again shortly.<br />However, if you are not able to reset your password, contact a board administrator.',
),
array(
- 0 => 'Why can’t I register?',
- 1 => 'It is possible the website owner has banned your IP address or disallowed the username you are attempting to register. The website owner could have also disabled registration to prevent new visitors from signing up. Contact a board administrator for assistance.',
+ 0 => 'Why do I get logged off automatically?',
+ 1 => 'If you do not check the <em>Remember me</em> box when you login, the board will only keep you logged in for a preset time. This prevents misuse of your account by anyone else. To stay logged in, check the <em>Remember me</em> box during login. This is not recommended if you access the board from a shared computer, e.g. library, internet cafe, university computer lab, etc. If you do not see this checkbox, it means a board administrator has disabled this feature.',
),
array(
0 => 'What does the “Delete all board cookies” do?',
- 1 => '“Delete all board cookies” deletes the cookies created by phpBB which keep you authenticated and logged into the board. It also provides functions such as read tracking if they have been enabled by the board owner. If you are having login or logout problems, deleting board cookies may help.',
+ 1 => '“Delete all board cookies” deletes the cookies created by phpBB which keep you authenticated and logged into the board. Cookies also provide functions such as read tracking if they have been enabled by a board administrator. If you are having login or logout problems, deleting board cookies may help.',
),
array(
0 => '--',
@@ -81,7 +77,11 @@ $help = array(
),
array(
0 => 'How do I change my settings?',
- 1 => 'If you are a registered user, all your settings are stored in the board database. To alter them, visit your User Control Panel; a link can usually be found at the top of board pages. This system will allow you to change all your settings and preferences.'
+ 1 => 'If you are a registered user, all your settings are stored in the board database. To alter them, visit your User Control Panel; a link can usually be found by clicking on your username at the top of board pages. This system will allow you to change all your settings and preferences.',
+ ),
+ array(
+ 0 => 'How do I prevent my username appearing in the online user listings?',
+ 1 => 'Within your User Control Panel, under “Board preferences”, you will find the option <em>Hide your online status</em>. Enable this option and you will only appear to the administrators, moderators and yourself. You will be counted as a hidden user.'
),
array(
0 => 'The times are not correct!',
@@ -93,11 +93,15 @@ $help = array(
),
array(
0 => 'My language is not in the list!',
- 1 => 'Either the administrator has not installed your language or nobody has translated this board into your language. Try asking the board administrator if they can install the language pack you need. If the language pack does not exist, feel free to create a new translation. More information can be found at the phpBB website (see link at the bottom of board pages).'
+ 1 => 'Either the administrator has not installed your language or nobody has translated this board into your language. Try asking a board administrator if they can install the language pack you need. If the language pack does not exist, feel free to create a new translation. More information can be found at the <a href="https://www.phpbb.com/">phpBB</a>&reg; website.',
),
array(
- 0 => 'How do I show an image along with my username?',
- 1 => 'There are two images which may appear along with a username when viewing posts. One of them may be an image associated with your rank, generally in the form of stars, blocks or dots, indicating how many posts you have made or your status on the board. Another, usually a larger image, is known as an avatar and is generally unique or personal to each user. It is up to the board administrator to enable avatars and to choose the way in which avatars can be made available. If you are unable to use avatars, contact a board administrator and ask them for their reasons.'
+ 0 => 'What are the images next to my username?',
+ 1 => 'There are two images which may appear along with a username when viewing posts. One of them may be an image associated with your rank, generally in the form of stars, blocks or dots, indicating how many posts you have made or your status on the board. Another, usually larger, image is known as an avatar and is generally unique or personal to each user.',
+ ),
+ array(
+ 0 => 'How do I display an avatar?',
+ 1 => 'Within your User Control Panel, under “Profile” you can add an avatar by using one of the four following methods: Gravatar, Gallery, Remote or Upload. It is up to the board administrator to enable avatars and to choose the way in which avatars can be made available. If you are unable to use avatars, contact a board administrator.',
),
array(
0 => 'What is my rank and how do I change it?',
@@ -112,8 +116,8 @@ $help = array(
1 => 'Posting Issues'
),
array(
- 0 => 'How do I post a topic in a forum?',
- 1 => 'To post a new topic in a forum, click the relevant button on either the forum or topic screens. You may need to register before you can post a message. A list of your permissions in each forum is available at the bottom of the forum and topic screens. Example: You can post new topics, You can vote in polls, etc.'
+ 0 => 'How do I create a new topic or post a reply?',
+ 1 => 'To post a new topic in a forum, click "New Topic". To post a reply to a topic, click "Post Reply". You may need to register before you can post a message. A list of your permissions in each forum is available at the bottom of the forum and topic screens. Example: You can post new topics, You can post attachments, etc.',
),
array(
0 => 'How do I edit or delete a post?',
@@ -282,7 +286,7 @@ $help = array(
),
array(
0 => 'Why does my search return no results?',
- 1 => 'Your search was probably too vague and included many common terms which are not indexed by phpBB3. Be more specific and use the options available within Advanced search.'
+ 1 => 'Your search was probably too vague and included many common terms which are not indexed by phpBB. Be more specific and use the options available within Advanced search.',
),
array(
0 => 'Why does my search return a blank page!?',
@@ -294,19 +298,23 @@ $help = array(
),
array(
0 => 'How can I find my own posts and topics?',
- 1 => 'Your own posts can be retrieved either by clicking the “Search user’s posts” within the User Control Panel or via your own profile page. To search for your topics, use the Advanced search page and fill in the various options appropriately.'
+ 1 => 'Your own posts can be retrieved either by clicking the “Show your posts” link within the User Control Panel or by clicking the “Search user’s posts” link via your own profile page or by clicking the “Quick links” menu at the top of the board. To search for your topics, use the Advanced search page and fill in the various options appropriately.',
),
array(
0 => '--',
- 1 => 'Topic Subscriptions and Bookmarks'
+ 1 => 'Subscriptions and Bookmarks',
),
array(
0 => 'What is the difference between bookmarking and subscribing?',
- 1 => 'Bookmarking in phpBB3 is much like bookmarking in your web browser. You aren’t alerted when there’s an update, but you can come back to the topic later. Subscribing, however, will notify you when there is an update to the topic or forum on the board via your preferred method or methods.'
+ 1 => 'In phpBB 3.0, bookmarking topics worked much like bookmarking in a web browser. You were not alerted when there was an update. As of phpBB 3.1, bookmarking is more like subscribing to a topic. You can be notified when a bookmarked topic is updated. Subscribing, however, will notify you when there is an update to a topic or forum on the board. Notification options for bookmarks and subscriptions can be configured in the User Control Panel, under “Board preferences”.',
+ ),
+ array(
+ 0 => 'How do I bookmark or subscribe to specific topics?',
+ 1 => 'You can bookmark or subscribe to a specific topic by clicking the appropriate link in the “Topic tools” menu, conveniently located near the top and bottom of a topic discussion.<br />Replying to a topic with the “Notify me when a reply is posted” option checked will also subscribe you to the topic.',
),
array(
- 0 => 'How do I subscribe to specific forums or topics?',
- 1 => 'To subscribe to a specific forum, click the “Subscribe forum” link upon entering the forum. To subscribe to a topic, reply to the topic with the subscribe checkbox checked or click the “Subscribe topic” link within the topic itself.'
+ 0 => 'How do I subscribe to specific forums?',
+ 1 => 'To subscribe to a specific forum, click the “Subscribe forum” link, at the bottom of page, upon entering the forum.',
),
array(
0 => 'How do I remove my subscriptions?',
@@ -326,11 +334,11 @@ $help = array(
),
array(
0 => '--',
- 1 => 'phpBB 3 Issues'
+ 1 => 'phpBB Issues',
),
array(
0 => 'Who wrote this bulletin board?',
- 1 => 'This software (in its unmodified form) is produced, released and is copyright <a href="https://www.phpbb.com/">phpBB Limited</a>. It is made available under the GNU General Public License and may be freely distributed. See the link for more details.'
+ 1 => 'This software (in its unmodified form) is produced, released and is copyright <a href="https://www.phpbb.com/">phpBB Limited</a>. It is made available under the GNU General Public License, version 2 (GPL-2.0) and may be freely distributed. See <a href="https://www.phpbb.com/about/">About phpBB</a> for more details.',
),
array(
0 => 'Why isn’t X feature available?',
@@ -340,4 +348,8 @@ $help = array(
0 => 'Who do I contact about abusive and/or legal matters related to this board?',
1 => 'Any of the administrators listed on the “The team” page should be an appropriate point of contact for your complaints. If this still gets no response then you should contact the owner of the domain (do a <a href="http://www.google.com/search?q=whois">whois lookup</a>) or, if this is running on a free service (e.g. Yahoo!, free.fr, f2s.com, etc.), the management or abuse department of that service. Please note that the phpBB Limited has <strong>absolutely no jurisdiction</strong> and cannot in any way be held liable over how, where or by whom this board is used. Do not contact the phpBB Limited in relation to any legal (cease and desist, liable, defamatory comment, etc.) matter <strong>not directly related</strong> to the phpBB.com website or the discrete software of phpBB itself. If you do email phpBB Limited <strong>about any third party</strong> use of this software then you should expect a terse response or no response at all.'
),
+ array(
+ 0 => 'How do I contact a board administrator?',
+ 1 => 'All users of the board can use the “Contact us” form, if the option was enabled by the board administrator.<br />Members of the board can also use the “The team” link.',
+ ),
);
diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php
index a2b27f0a60..dd22e84fcb 100644
--- a/phpBB/language/en/install.php
+++ b/phpBB/language/en/install.php
@@ -80,7 +80,7 @@ $lang = array_merge($lang, array(
'CONTINUE_OLD_CONVERSION' => 'Continue previously started conversion',
'CONVERT' => 'Convert',
'CONVERT_COMPLETE' => 'Conversion completed',
- 'CONVERT_COMPLETE_EXPLAIN' => 'You have now successfully converted your board to phpBB 3.1. 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/documentation/3.0/">Documentation</a> and the <a href="https://www.phpbb.com/community/viewforum.php?f=46">support forums</a>.',
+ 'CONVERT_COMPLETE_EXPLAIN' => 'You have now successfully converted your board to phpBB 3.1. 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.1/ug/">Documentation</a> and the <a href="https://www.phpbb.com/community/viewforum.php?f=466">support forums</a>.',
'CONVERT_INTRO' => 'Welcome to the phpBB Unified Convertor Framework',
'CONVERT_INTRO_BODY' => 'From here, you are able to import data from other (installed) board systems. The list below shows all the conversion modules currently available. If there is no convertor shown in this list for the board software you wish to convert from, please check our website where further conversion modules may be available for download.',
'CONVERT_NEW_CONVERSION' => 'New conversion',
@@ -192,7 +192,7 @@ $lang = array_merge($lang, array(
<h2>Convert an existing board to phpBB3</h2>
<p>The phpBB Unified Convertor Framework supports the conversion of phpBB 2.0.x and other board systems to phpBB3. If you have an existing board that you wish to convert, please <a href="%2$s">proceed to the convertor</a>.</p>
<h2>Go live with your phpBB3!</h2>
- <p>Clicking the button below will take you to a form for submitting statistical data to phpBB in your Administration Control Panel (ACP). We would appreciate it if you could help us by sending that information. Afterwards you should take some time to examine the options available to you. Remember that help is available online via the <a href="https://www.phpbb.com/support/documentation/3.0/">Documentation</a>, <a href="%3$s">README</a> and the <a href="https://www.phpbb.com/community/viewforum.php?f=46">Support Forums</a>.</p><p><strong>Please delete, move or rename the install directory before using your board. While this directory exists, only the Administration Control Panel (ACP) will be accessible.</strong>',
+ <p>Clicking the button below will take you to a form for submitting statistical data to phpBB in your Administration Control Panel (ACP). We would appreciate it if you could help us by sending that information. Afterwards you should take some time to examine the options available to you. Remember that help is available online via the <a href="https://www.phpbb.com/support/docs/en/3.1/ug/">Documentation</a>, <a href="%3$s">README</a> and the <a href="https://www.phpbb.com/community/viewforum.php?f=466">Support Forums</a>.</p><p><strong>Please delete, move or rename the install directory before using your board. While this directory exists, only the Administration Control Panel (ACP) will be accessible.</strong>',
'INSTALL_INTRO' => 'Welcome to Installation',
'INSTALL_INTRO_BODY' => 'With this option, it is possible to install phpBB3 onto your server.</p><p>In order to proceed, you will need your database settings. If you do not know your database settings, please contact your host and ask for them. You will not be able to continue without them. You need:</p>
@@ -274,7 +274,7 @@ $lang = array_merge($lang, array(
'MAKE_FOLDER_WRITABLE' => 'Please make sure that this folder exists and is writable by the webserver then try again:<br />»<strong>%s</strong>.',
'MAKE_FOLDERS_WRITABLE' => 'Please make sure that these folders exist and are writable by the webserver then try again:<br />»<strong>%s</strong>.',
- 'MYSQL_SCHEMA_UPDATE_REQUIRED' => 'Your MySQL database schema for phpBB is outdated. phpBB detected a schema for MySQL 3.x/4.x, but the server runs on MySQL %2$s.<br /><strong>Before you proceed the update, you need to upgrade the schema.</strong><br /><br />Please refer to the <a href="https://www.phpbb.com/kb/article/doesnt-have-a-default-value-errors/">Knowledge Base article about upgrading the MySQL schema</a>. If you encounter problems, please use <a href="https://www.phpbb.com/community/viewforum.php?f=46">our support forums</a>.',
+ 'MYSQL_SCHEMA_UPDATE_REQUIRED' => 'Your MySQL database schema for phpBB is outdated. phpBB detected a schema for MySQL 3.x/4.x, but the server runs on MySQL %2$s.<br /><strong>Before you proceed the update, you need to upgrade the schema.</strong><br /><br />Please refer to the <a href="https://www.phpbb.com/kb/article/doesnt-have-a-default-value-errors/">Knowledge Base article about upgrading the MySQL schema</a>. If you encounter problems, please use <a href="https://www.phpbb.com/community/viewforum.php?f=466">our support forums</a>.',
'NAMING_CONFLICT' => 'Naming conflict: %s and %s are both aliases<br /><br />%s',
'NEXT_STEP' => 'Proceed to next step',
@@ -345,7 +345,7 @@ $lang = array_merge($lang, array(
'SUB_LICENSE' => 'License',
'SUB_SUPPORT' => 'Support',
'SUCCESSFUL_CONNECT' => 'Successful connection',
- 'SUPPORT_BODY' => 'Full support will be provided for the current stable release of phpBB3, free of charge. This includes:</p><ul><li>installation</li><li>configuration</li><li>technical questions</li><li>problems relating to potential bugs in the software</li><li>updating from Release Candidate (RC) versions to the latest stable version</li><li>converting from phpBB 2.0.x to phpBB3</li><li>converting from other discussion board software to phpBB3 (please see the <a href="https://www.phpbb.com/community/viewforum.php?f=486">Convertors Forum</a>)</li></ul><p>We encourage users still running beta versions of phpBB3 to replace their installation with a fresh copy of the latest version.</p><h2>Extensions / Styles</h2><p>For issues relating to Extensions, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=451">Extensions Forum</a>.<br />For issues relating to styles, templates and themes, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=471">Styles Forum</a>.<br /><br />If your question relates to a specific package, please post directly in the topic dedicated to the package.</p><h2>Obtaining Support</h2><p><a href="https://www.phpbb.com/community/viewtopic.php?f=14&amp;t=571070">The phpBB Welcome Package</a><br /><a href="https://www.phpbb.com/support/">Support Section</a><br /><a href="https://www.phpbb.com/support/documentation/3.1/quickstart/">Quick Start Guide</a><br /><br />To ensure you stay up to date with the latest news and releases, why not <a href="https://www.phpbb.com/support/">subscribe to our mailing list</a>?<br /><br />',
+ 'SUPPORT_BODY' => 'Full support will be provided for the current stable release of phpBB3, free of charge. This includes:</p><ul><li>installation</li><li>configuration</li><li>technical questions</li><li>problems relating to potential bugs in the software</li><li>updating from Release Candidate (RC) versions to the latest stable version</li><li>converting from phpBB 2.0.x to phpBB3</li><li>converting from other discussion board software to phpBB3 (please see the <a href="https://www.phpbb.com/community/viewforum.php?f=486">Convertors Forum</a>)</li></ul><p>We encourage users still running beta versions of phpBB3 to replace their installation with a fresh copy of the latest version.</p><h2>Extensions / Styles</h2><p>For issues relating to Extensions, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=451">Extensions Forum</a>.<br />For issues relating to styles, templates and themes, please post in the appropriate <a href="https://www.phpbb.com/community/viewforum.php?f=471">Styles Forum</a>.<br /><br />If your question relates to a specific package, please post directly in the topic dedicated to the package.</p><h2>Obtaining Support</h2><p><a href="https://www.phpbb.com/community/viewtopic.php?f=14&amp;t=571070">The phpBB Welcome Package</a><br /><a href="https://www.phpbb.com/support/">Support Section</a><br /><a href="https://www.phpbb.com/support/docs/en/3.1/ug/quickstart/">Quick Start Guide</a><br /><br />To ensure you stay up to date with the latest news and releases, why not <a href="https://www.phpbb.com/support/">subscribe to our mailing list</a>?<br /><br />',
'SYNC_FORUMS' => 'Starting to synchronise forums',
'SYNC_POST_COUNT' => 'Synchronising post_counts',
'SYNC_POST_COUNT_ID' => 'Synchronising post_counts from <var>entry</var> %1$s to %2$s.',
@@ -547,7 +547,7 @@ $lang = array_merge($lang, array(
<ul style="margin-left: 20px; font-size: 1.1em;">
<li>Go to the <a href="https://www.phpbb.com/downloads/" title="https://www.phpbb.com/downloads/">phpBB.com downloads page</a> and download the "Automatic Update Package" archive.<br /><br /></li>
<li>Unpack the archive.<br /><br /></li>
- <li>Upload the complete uncompressed install folder to your phpBB root directory (where your config.php file is).<br /><br /></li>
+ <li>Upload the complete uncompressed "install" and "vendor" folders to your phpBB root directory (where your config.php file is).<br /><br /></li>
</ul>
<p>Once uploaded your board will be offline for normal users due to the install directory you uploaded now present.<br /><br />
diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php
index bc0fd03520..a961068657 100644
--- a/phpBB/language/en/mcp.php
+++ b/phpBB/language/en/mcp.php
@@ -237,7 +237,7 @@ $lang = array_merge($lang, array(
'NOT_MODERATOR' => 'You are not a moderator of this forum.',
'NO_DESTINATION_FORUM' => 'Please select a forum for destination.',
'NO_DESTINATION_FORUM_FOUND' => 'There is no destination forum available.',
- 'NO_ENTRIES' => 'No log entries for this period.',
+ 'NO_ENTRIES' => 'No log entries.',
'NO_FEEDBACK' => 'No feedback exists for this user.',
'NO_FINAL_TOPIC_SELECTED' => 'You have to select a destination topic for merging posts.',
'NO_MATCHES_FOUND' => 'No matches found.',
diff --git a/phpBB/language/en/memberlist.php b/phpBB/language/en/memberlist.php
index 1a05975892..5605f8f4b5 100644
--- a/phpBB/language/en/memberlist.php
+++ b/phpBB/language/en/memberlist.php
@@ -48,12 +48,14 @@ $lang = array_merge($lang, array(
'BEFORE' => 'Before',
- 'CC_EMAIL' => 'Send a copy of this email to yourself.',
+ 'CC_SENDER' => 'Send a copy of this email to yourself.',
'CONTACT_ADMIN' => 'Contact a Board Administrator',
'DEST_LANG' => 'Language',
'DEST_LANG_EXPLAIN' => 'Select an appropriate language (if available) for the recipient of this message.',
+ 'EDIT_PROFILE' => 'Edit profile',
+
'EMAIL_BODY_EXPLAIN' => 'This message will be sent as plain text, do not include any HTML or BBCode. The return address for this message will be set to your email address.',
'EMAIL_DISABLED' => 'Sorry but all email related functions have been disabled.',
'EMAIL_SENT' => 'The email has been sent.',
diff --git a/phpBB/language/en/migrator.php b/phpBB/language/en/migrator.php
index 7199d21d96..f5a56816c2 100644
--- a/phpBB/language/en/migrator.php
+++ b/phpBB/language/en/migrator.php
@@ -41,12 +41,16 @@ $lang = array_merge($lang, array(
'GROUP_NOT_EXIST' => 'The group "%s" unexpectedly does not exist.',
+ 'MIGRATION_APPLY_DEPENDENCIES' => 'Apply dependencies of %s.',
'MIGRATION_DATA_DONE' => 'Installed Data: %1$s; Time: %2$.2f seconds',
'MIGRATION_DATA_IN_PROGRESS' => 'Installing Data: %1$s; Time: %2$.2f seconds',
+ 'MIGRATION_DATA_RUNNING' => 'Installing Data: %s.',
'MIGRATION_EFFECTIVELY_INSTALLED' => 'Migration already effectively installed (skipped): %s',
'MIGRATION_EXCEPTION_ERROR' => 'Something went wrong during the request and an exception was thrown. The changes made before the error occurred were reversed to the best of our abilities, but you should check the board for errors.',
'MIGRATION_NOT_FULFILLABLE' => 'The migration "%1$s" is not fulfillable, missing migration "%2$s".',
+ 'MIGRATION_NOT_VALID' => '%s is not a valid migration.',
'MIGRATION_SCHEMA_DONE' => 'Installed Schema: %1$s; Time: %2$.2f seconds',
+ 'MIGRATION_SCHEMA_RUNNING' => 'Installing Schema: %s.',
'MODULE_ERROR' => 'An error occurred while creating a module: %s',
'MODULE_INFO_FILE_NOT_EXIST' => 'A required module info file is missing: %2$s',
diff --git a/phpBB/language/en/search.php b/phpBB/language/en/search.php
index ec5dd99eb8..13e5bf7a97 100644
--- a/phpBB/language/en/search.php
+++ b/phpBB/language/en/search.php
@@ -71,6 +71,7 @@ $lang = array_merge($lang, array(
'NO_RECENT_SEARCHES' => 'No searches have been carried out recently.',
'NO_SEARCH' => 'Sorry but you are not permitted to use the search system.',
'NO_SEARCH_RESULTS' => 'No suitable matches were found.',
+ 'NO_SEARCH_LOAD' => 'Sorry but you cannot use search at this time. The server has high load. Please try again later.',
'NO_SEARCH_TIME' => array(
1 => 'Sorry but you cannot use search at this time. Please try again in %d second.',
2 => 'Sorry but you cannot use search at this time. Please try again in %d seconds.',
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php
index 101292e171..07751d1f7f 100644
--- a/phpBB/language/en/ucp.php
+++ b/phpBB/language/en/ucp.php
@@ -417,6 +417,8 @@ $lang = array_merge($lang, array(
'PM_FROM_REMOVED_AUTHOR' => 'This message was sent by a user no longer registered.',
'PM_ICON' => 'PM icon',
'PM_INBOX' => 'Inbox',
+ 'PM_MARK_ALL_READ' => 'Mark all messages read',
+ 'PM_MARK_ALL_READ_SUCCESS' => 'All private messages in this folder have been marked read',
'PM_NO_USERS' => 'The requested users to be added do not exist.',
'PM_OUTBOX' => 'Outbox',
'PM_SENTBOX' => 'Sent messages',
@@ -589,6 +591,7 @@ $lang = array_merge($lang, array(
),
'VIEW_PREVIOUS_HISTORY' => 'Previous PM in history',
'VIEW_PREVIOUS_PM' => 'Previous PM',
+ 'VIEW_PROFILE' => 'View profile',
'VIEW_SIGS' => 'Display signatures',
'VIEW_SMILIES' => 'Display smilies as images',
'VIEW_TOPICS_DAYS' => 'Display topics from previous days',
diff --git a/phpBB/mcp.php b/phpBB/mcp.php
index 25765b1af7..f9d46db528 100644
--- a/phpBB/mcp.php
+++ b/phpBB/mcp.php
@@ -137,6 +137,28 @@ if ($forum_id && !$auth->acl_get('f_read', $forum_id))
trigger_error('NOT_AUTHORISED');
}
+/**
+* Allow applying additional permissions to MCP access besides f_read
+*
+* @event core.mcp_global_f_read_auth_after
+* @var string action The action the user tried to execute
+* @var int forum_id The forum the user tried to access
+* @var string mode The MCP module the user is trying to access
+* @var p_master module Module system class
+* @var bool quickmod True if the user is accessing using quickmod tools
+* @var int topic_id The topic the user tried to access
+* @since 3.1.3-RC1
+*/
+$vars = array(
+ 'action',
+ 'forum_id',
+ 'mode',
+ 'module',
+ 'quickmod',
+ 'topic_id',
+);
+extract($phpbb_dispatcher->trigger_event('core.mcp_global_f_read_auth_after', compact($vars)));
+
if ($forum_id)
{
$module->acl_forum_id = $forum_id;
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index 4f4dcb1b41..e64dab635b 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -173,6 +173,22 @@ switch ($mode)
'ORDER_BY' => 'u.username_clean ASC',
);
+ /**
+ * Modify the query used to get the users for the team page
+ *
+ * @event core.memberlist_team_modify_query
+ * @var array sql_ary Array containing the query
+ * @var array group_ids Array of group ids
+ * @var array teampage_data The teampage data
+ * @since 3.1.3-RC1
+ */
+ $vars = array(
+ 'sql_ary',
+ 'group_ids',
+ 'teampage_data',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.memberlist_team_modify_query', compact($vars)));
+
$result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary));
$user_ary = $user_ids = $group_users = array();
@@ -283,21 +299,20 @@ switch ($mode)
continue;
}
- $rank_title = $rank_img = $rank_img_src = '';
- get_user_rank($row['user_rank'], (($row['user_id'] == ANONYMOUS) ? false : $row['user_posts']), $rank_title, $rank_img, $rank_img_src);
+ $user_rank_data = phpbb_get_user_rank($row, (($row['user_id'] == ANONYMOUS) ? false : $row['user_posts']));
- $template->assign_block_vars('group.user', array(
+ $template_vars = array(
'USER_ID' => $row['user_id'],
'FORUMS' => $row['forums'],
'FORUM_OPTIONS' => (isset($row['forums_options'])) ? true : false,
- 'RANK_TITLE' => $rank_title,
+ 'RANK_TITLE' => $user_rank_data['title'],
'GROUP_NAME' => $groups_ary[$row['default_group']]['group_name'],
'GROUP_COLOR' => $groups_ary[$row['default_group']]['group_colour'],
'U_GROUP' => $groups_ary[$row['default_group']]['u_group'],
- 'RANK_IMG' => $rank_img,
- 'RANK_IMG_SRC' => $rank_img_src,
+ 'RANK_IMG' => $user_rank_data['img'],
+ 'RANK_IMG_SRC' => $user_rank_data['img_src'],
'U_PM' => ($config['allow_privmsg'] && $auth->acl_get('u_sendpm') && ($row['user_allow_pm'] || $auth->acl_gets('a_', 'm_') || $auth->acl_getf_global('m_'))) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose&amp;u=' . $row['user_id']) : '',
@@ -305,7 +320,25 @@ switch ($mode)
'USERNAME' => get_username_string('username', $row['user_id'], $row['username'], $row['user_colour']),
'USER_COLOR' => get_username_string('colour', $row['user_id'], $row['username'], $row['user_colour']),
'U_VIEW_PROFILE' => get_username_string('profile', $row['user_id'], $row['username'], $row['user_colour']),
- ));
+ );
+
+ /**
+ * Modify the template vars for displaying the user in the groups on the teampage
+ *
+ * @event core.memberlist_team_modify_template_vars
+ * @var array template_vars Array containing the query
+ * @var array row Array containing the action user row
+ * @var array groups_ary Array of groups with all users that should be displayed
+ * @since 3.1.3-RC1
+ */
+ $vars = array(
+ 'template_vars',
+ 'row',
+ 'groups_ary',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.memberlist_team_modify_template_vars', compact($vars)));
+
+ $template->assign_block_vars('group.user', $template_vars);
if ($config['teampage_memberships'] != 2)
{
@@ -682,6 +715,7 @@ switch ($mode)
'U_MCP_QUEUE' => ($auth->acl_getf_global('m_approve')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue', true, $user->session_id) : '',
'U_SWITCH_PERMISSIONS' => ($auth->acl_get('a_switchperm') && $user->data['user_id'] != $user_id) ? append_sid("{$phpbb_root_path}ucp.$phpEx", "mode=switch_perm&amp;u={$user_id}&amp;hash=" . generate_link_hash('switchperm')) : '',
+ 'U_EDIT_SELF' => ($user_id == $user->data['user_id'] && $auth->acl_get('u_chgprofileinfo')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=ucp_profile&amp;mode=profile_info') : '',
'S_USER_NOTES' => ($user_notes_enabled) ? true : false,
'S_WARN_USER' => ($warn_user_enabled) ? true : false,
@@ -1080,14 +1114,18 @@ switch ($mode)
$avatar_img = phpbb_get_group_avatar($group_row);
// ... same for group rank
- $rank_title = $rank_img = $rank_img_src = '';
+ $user_rank_data = array(
+ 'title' => null,
+ 'img' => null,
+ 'img_src' => null,
+ );
if ($group_row['group_rank'])
{
- get_user_rank($group_row['group_rank'], false, $rank_title, $rank_img, $rank_img_src);
+ $user_rank_data = phpbb_get_user_rank($group_row, false);
- if ($rank_img)
+ if ($user_rank_data['img'])
{
- $rank_img .= '<br />';
+ $user_rank_data['img'] .= '<br />';
}
}
@@ -1096,11 +1134,11 @@ switch ($mode)
'GROUP_NAME' => ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'],
'GROUP_COLOR' => $group_row['group_colour'],
'GROUP_TYPE' => $user->lang['GROUP_IS_' . $group_row['l_group_type']],
- 'GROUP_RANK' => $rank_title,
+ 'GROUP_RANK' => $user_rank_data['title'],
'AVATAR_IMG' => $avatar_img,
- 'RANK_IMG' => $rank_img,
- 'RANK_IMG_SRC' => $rank_img_src,
+ 'RANK_IMG' => $user_rank_data['img'],
+ 'RANK_IMG_SRC' => $user_rank_data['img_src'],
'U_PM' => ($auth->acl_get('u_sendpm') && $auth->acl_get('u_masspm_group') && $group_row['group_receive_pm'] && $config['allow_privmsg'] && $config['allow_mass_pm']) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=compose&amp;g=' . $group_id) : '',)
);
@@ -1423,7 +1461,7 @@ switch ($mode)
$cp_row = (isset($profile_fields_cache[$user_id])) ? $cp->generate_profile_fields_template_data($profile_fields_cache[$user_id], false) : array();
}
- $memberrow = array_merge(phpbb_show_profile($row), array(
+ $memberrow = array_merge(phpbb_show_profile($row, false, false, false), array(
'ROW_NUMBER' => $i + ($start + 1),
'S_CUSTOM_PROFILE' => (isset($cp_row['row']) && sizeof($cp_row['row'])) ? true : false,
diff --git a/phpBB/phpbb/auth/auth.php b/phpBB/phpbb/auth/auth.php
index 38755ccf99..b59f0e60ec 100644
--- a/phpBB/phpbb/auth/auth.php
+++ b/phpBB/phpbb/auth/auth.php
@@ -927,11 +927,11 @@ class auth
*/
function login($username, $password, $autologin = false, $viewonline = 1, $admin = 0)
{
- global $config, $db, $user, $phpbb_root_path, $phpEx, $phpbb_container;
+ global $db, $user, $phpbb_root_path, $phpEx, $phpbb_container;
- $method = trim(basename($config['auth_method']));
+ $provider_collection = $phpbb_container->get('auth.provider_collection');
- $provider = $phpbb_container->get('auth.provider.' . $method);
+ $provider = $provider_collection->get_provider();
if ($provider)
{
$login = $provider->login($username, $password);
diff --git a/phpBB/phpbb/auth/provider/apache.php b/phpBB/phpbb/auth/provider/apache.php
index 9137a77210..aa5bf64335 100644
--- a/phpBB/phpbb/auth/provider/apache.php
+++ b/phpBB/phpbb/auth/provider/apache.php
@@ -137,7 +137,7 @@ class apache extends \phpbb\auth\provider\base
return array(
'status' => LOGIN_SUCCESS_CREATE_PROFILE,
'error_msg' => false,
- 'user_row' => user_row_apache($php_auth_user, $php_auth_pw),
+ 'user_row' => $this->user_row($php_auth_user, $php_auth_pw),
);
}
@@ -185,7 +185,7 @@ class apache extends \phpbb\auth\provider\base
}
// create the user if he does not exist yet
- user_add(user_row_apache($php_auth_user, $php_auth_pw));
+ user_add($this->user_row($php_auth_user, $php_auth_pw));
$sql = 'SELECT *
FROM ' . USERS_TABLE . "
diff --git a/phpBB/phpbb/auth/provider/db.php b/phpBB/phpbb/auth/provider/db.php
index 722eeffa9a..d8c5fb72de 100644
--- a/phpBB/phpbb/auth/provider/db.php
+++ b/phpBB/phpbb/auth/provider/db.php
@@ -87,7 +87,7 @@ class db extends \phpbb\auth\provider\base
$username_clean = utf8_clean_string($username);
- $sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_type, user_login_attempts
+ $sql = 'SELECT *
FROM ' . USERS_TABLE . "
WHERE username_clean = '" . $this->db->sql_escape($username_clean) . "'";
$result = $this->db->sql_query($sql);
@@ -123,7 +123,7 @@ class db extends \phpbb\auth\provider\base
'username_clean' => $username_clean,
);
$sql = 'INSERT INTO ' . LOGIN_ATTEMPT_TABLE . $this->db->sql_build_array('INSERT', $attempt_data);
- $result = $this->db->sql_query($sql);
+ $this->db->sql_query($sql);
}
else
{
@@ -175,7 +175,7 @@ class db extends \phpbb\auth\provider\base
}
// Check password ...
- if ($this->passwords_manager->check($password, $row['user_password']))
+ if ($this->passwords_manager->check($password, $row['user_password'], $row))
{
// Check for old password hash...
if ($this->passwords_manager->convert_flag || strlen($row['user_password']) == 32)
@@ -232,7 +232,7 @@ class db extends \phpbb\auth\provider\base
// Give status about wrong password...
return array(
'status' => ($show_captcha) ? LOGIN_ERROR_ATTEMPTS : LOGIN_ERROR_PASSWORD,
- 'error_msg' => ($show_captcha) ? 'LOGIN_ERROR_ATTEMPTS' : 'LOGIN_ERROR_PASSWORD',
+ 'error_msg' => 'LOGIN_ERROR_PASSWORD',
'user_row' => $row,
);
}
diff --git a/phpBB/phpbb/auth/provider/ldap.php b/phpBB/phpbb/auth/provider/ldap.php
index d32e7504eb..c71950c698 100644
--- a/phpBB/phpbb/auth/provider/ldap.php
+++ b/phpBB/phpbb/auth/provider/ldap.php
@@ -306,7 +306,7 @@ class ldap extends \phpbb\auth\provider\base
return array(
'TEMPLATE_FILE' => 'auth_provider_ldap.html',
'TEMPLATE_VARS' => array(
- 'AUTH_LDAP_DN' => $new_config['ldap_base_dn'],
+ 'AUTH_LDAP_BASE_DN' => $new_config['ldap_base_dn'],
'AUTH_LDAP_EMAIL' => $new_config['ldap_email'],
'AUTH_LDAP_PASSORD' => $new_config['ldap_password'],
'AUTH_LDAP_PORT' => $new_config['ldap_port'],
diff --git a/phpBB/phpbb/auth/provider_collection.php b/phpBB/phpbb/auth/provider_collection.php
index a74a2135dc..8e7e9e2cc1 100644
--- a/phpBB/phpbb/auth/provider_collection.php
+++ b/phpBB/phpbb/auth/provider_collection.php
@@ -38,6 +38,7 @@ class provider_collection extends \phpbb\di\service_collection
/**
* Get an auth provider.
*
+ * @param string $provider_name The name of the auth provider
* @return object Default auth provider selected in config if it
* does exist. Otherwise the standard db auth
* provider.
@@ -46,11 +47,12 @@ class provider_collection extends \phpbb\di\service_collection
* auth provider exist. The db auth provider
* should always exist in a phpBB installation.
*/
- public function get_provider()
+ public function get_provider($provider_name = '')
{
- if ($this->offsetExists('auth.provider.' . basename(trim($this->config['auth_method']))))
+ $provider_name = ($provider_name !== '') ? $provider_name : basename(trim($this->config['auth_method']));
+ if ($this->offsetExists('auth.provider.' . $provider_name))
{
- return $this->offsetGet('auth.provider.' . basename(trim($this->config['auth_method'])));
+ return $this->offsetGet('auth.provider.' . $provider_name);
}
// Revert to db auth provider if selected method does not exist
else if ($this->offsetExists('auth.provider.db'))
diff --git a/phpBB/phpbb/avatar/driver/local.php b/phpBB/phpbb/avatar/driver/local.php
index 07b3ed59de..8888686b2d 100644
--- a/phpBB/phpbb/avatar/driver/local.php
+++ b/phpBB/phpbb/avatar/driver/local.php
@@ -154,7 +154,7 @@ class local extends \phpbb\avatar\driver\driver
*/
protected function get_avatar_list($user)
{
- $avatar_list = ($this->cache == null) ? false : $this->cache->get('avatar_local_list');
+ $avatar_list = ($this->cache == null) ? false : $this->cache->get('_avatar_local_list');
if ($avatar_list === false)
{
@@ -192,7 +192,7 @@ class local extends \phpbb\avatar\driver\driver
if ($this->cache != null)
{
- $this->cache->put('avatar_local_list', $avatar_list, 86400);
+ $this->cache->put('_avatar_local_list', $avatar_list, 86400);
}
}
diff --git a/phpBB/phpbb/avatar/driver/remote.php b/phpBB/phpbb/avatar/driver/remote.php
index 1bd7f6c927..4b0ee3f06f 100644
--- a/phpBB/phpbb/avatar/driver/remote.php
+++ b/phpBB/phpbb/avatar/driver/remote.php
@@ -130,8 +130,24 @@ class remote extends \phpbb\avatar\driver\driver
{
// Timeout after 1 second
stream_set_timeout($file_stream, 1);
+ // read some data to ensure headers are present
+ fread($file_stream, 1024);
$meta = stream_get_meta_data($file_stream);
- foreach ($meta['wrapper_data'] as $header)
+
+ if (isset($meta['wrapper_data']['headers']) && is_array($meta['wrapper_data']['headers']))
+ {
+ $headers = $meta['wrapper_data']['headers'];
+ }
+ else if (isset($meta['wrapper_data']) && is_array($meta['wrapper_data']))
+ {
+ $headers = $meta['wrapper_data'];
+ }
+ else
+ {
+ $headers = array();
+ }
+
+ foreach ($headers as $header)
{
$header = preg_split('/ /', $header, 2);
if (strtr(strtolower(trim($header[0], ':')), '_', '-') === 'content-type')
diff --git a/phpBB/phpbb/avatar/manager.php b/phpBB/phpbb/avatar/manager.php
index 42ae61a9a2..8d83152ed6 100644
--- a/phpBB/phpbb/avatar/manager.php
+++ b/phpBB/phpbb/avatar/manager.php
@@ -326,17 +326,41 @@ class manager
$driver->delete($avatar_data);
}
- $result = self::$default_row;
+ $result = $this->prefix_avatar_columns($prefix, self::$default_row);
- foreach ($result as $key => $value)
+ $sql = 'UPDATE ' . $table . '
+ SET ' . $db->sql_build_array('UPDATE', $result) . '
+ WHERE ' . $prefix . 'id = ' . (int) $avatar_data['id'];
+ $db->sql_query($sql);
+
+ // Make sure we also delete this avatar from the users
+ if ($prefix === 'group_')
{
- $result[$prefix . $key] = $value;
- unset($result[$key]);
+ $result = $this->prefix_avatar_columns('user_', self::$default_row);
+
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET ' . $db->sql_build_array('UPDATE', $result) . "
+ WHERE user_avatar = '" . $db->sql_escape($avatar_data['avatar']) . "'";
+ $db->sql_query($sql);
}
+ }
- $sql = 'UPDATE ' . $table . '
- SET ' . $db->sql_build_array('UPDATE', $result) . '
- WHERE ' . $prefix . 'id = ' . (int) $avatar_data['id'];
- $db->sql_query($sql);
+ /**
+ * Prefix avatar columns
+ *
+ * @param string $prefix Column prefix
+ * @param array $data Column data
+ *
+ * @return array Column data with prefixed column names
+ */
+ public function prefix_avatar_columns($prefix, $data)
+ {
+ foreach ($data as $key => $value)
+ {
+ $data[$prefix . $key] = $value;
+ unset($data[$key]);
+ }
+
+ return $data;
}
}
diff --git a/phpBB/phpbb/cache/driver/file.php b/phpBB/phpbb/cache/driver/file.php
index fd5bce4515..9a7c4aec7f 100644
--- a/phpBB/phpbb/cache/driver/file.php
+++ b/phpBB/phpbb/cache/driver/file.php
@@ -279,6 +279,7 @@ class file extends \phpbb\cache\driver\base
if ($var_name[0] == '_')
{
global $phpEx;
+ $var_name = $this->clean_varname($var_name);
return file_exists($this->cache_dir . 'data' . $var_name . ".$phpEx");
}
else
@@ -334,6 +335,7 @@ class file extends \phpbb\cache\driver\base
{
global $phpEx;
+ $filename = $this->clean_varname($filename);
$file = "{$this->cache_dir}$filename.$phpEx";
$type = substr($filename, 0, strpos($filename, '_'));
@@ -516,6 +518,7 @@ class file extends \phpbb\cache\driver\base
{
global $phpEx;
+ $filename = $this->clean_varname($filename);
$file = "{$this->cache_dir}$filename.$phpEx";
$lock = new \phpbb\lock\flock($file);
@@ -584,4 +587,15 @@ class file extends \phpbb\cache\driver\base
return $return_value;
}
+
+ /**
+ * Replace slashes in the file name
+ *
+ * @param string $varname name of a cache variable
+ * @return string $varname name that is safe to use as a filename
+ */
+ protected function clean_varname($varname)
+ {
+ return str_replace('/', '-', $varname);
+ }
}
diff --git a/phpBB/phpbb/cache/driver/memory.php b/phpBB/phpbb/cache/driver/memory.php
index 56308be8da..0b0e323e3d 100644
--- a/phpBB/phpbb/cache/driver/memory.php
+++ b/phpBB/phpbb/cache/driver/memory.php
@@ -208,12 +208,24 @@ abstract class memory extends \phpbb\cache\driver\base
// determine which tables this query belongs to
// Some queries use backticks, namely the get_database_size() query
// don't check for conformity, the SQL would error and not reach here.
- if (!preg_match('/FROM \\(?(`?\\w+`?(?: \\w+)?(?:, ?`?\\w+`?(?: \\w+)?)*)\\)?/', $query, $regs))
+ if (!preg_match_all('/(?:FROM \\(?(`?\\w+`?(?: \\w+)?(?:, ?`?\\w+`?(?: \\w+)?)*)\\)?)|(?:JOIN (`?\\w+`?(?: \\w+)?))/', $query, $regs, PREG_SET_ORDER))
{
// Bail out if the match fails.
return $query_result;
}
- $tables = array_map('trim', explode(',', $regs[1]));
+
+ $tables = array();
+ foreach ($regs as $match)
+ {
+ if ($match[0][0] == 'F')
+ {
+ $tables = array_merge($tables, array_map('trim', explode(',', $match[1])));
+ }
+ else
+ {
+ $tables[] = $match[2];
+ }
+ }
foreach ($tables as $table_name)
{
diff --git a/phpBB/phpbb/captcha/plugins/recaptcha.php b/phpBB/phpbb/captcha/plugins/recaptcha.php
index ea446d7bc3..584f3afec1 100644
--- a/phpBB/phpbb/captcha/plugins/recaptcha.php
+++ b/phpBB/phpbb/captcha/plugins/recaptcha.php
@@ -26,8 +26,10 @@ class recaptcha extends captcha_abstract
var $challenge;
var $response;
- // PHP4 Constructor
- function phpbb_recaptcha()
+ /**
+ * Constructor
+ */
+ public function __construct()
{
global $request;
$this->recaptcha_server = $request->is_secure() ? $this->recaptcha_server_secure : $this->recaptcha_server;
diff --git a/phpBB/phpbb/config/db.php b/phpBB/phpbb/config/db.php
index ef20ebf62a..26489bdd34 100644
--- a/phpBB/phpbb/config/db.php
+++ b/phpBB/phpbb/config/db.php
@@ -145,9 +145,9 @@ class db extends \phpbb\config\config
$sql .= " AND config_value = '" . $this->db->sql_escape($old_value) . "'";
}
- $result = $this->db->sql_query($sql);
+ $this->db->sql_query($sql);
- if (!$this->db->sql_affectedrows($result) && isset($this->config[$key]))
+ if (!$this->db->sql_affectedrows() && isset($this->config[$key]))
{
return false;
}
diff --git a/phpBB/phpbb/config/db_text.php b/phpBB/phpbb/config/db_text.php
index b1e3ef5da4..ddc7c9aef0 100644
--- a/phpBB/phpbb/config/db_text.php
+++ b/phpBB/phpbb/config/db_text.php
@@ -154,6 +154,6 @@ class db_text
$sql = 'DELETE
FROM ' . $this->table . '
WHERE ' . $this->db->sql_in_set('config_name', $keys, false, true);
- $result = $this->db->sql_query($sql);
+ $this->db->sql_query($sql);
}
}
diff --git a/phpBB/phpbb/console/command/cache/purge.php b/phpBB/phpbb/console/command/cache/purge.php
index ec8229200c..d0c2ef6f72 100644
--- a/phpBB/phpbb/console/command/cache/purge.php
+++ b/phpBB/phpbb/console/command/cache/purge.php
@@ -26,7 +26,7 @@ class purge extends \phpbb\console\command\command
/** @var \phpbb\auth\auth */
protected $auth;
- /** @var \phpbb\log\log */
+ /** @var \phpbb\log\log_interface */
protected $log;
/** @var \phpbb\config\config */
@@ -42,7 +42,7 @@ class purge extends \phpbb\console\command\command
* @param \phpbb\log\log $log Logger instance
* @param \phpbb\config\config $config Config instance
*/
- public function __construct(\phpbb\user $user, \phpbb\cache\driver\driver_interface $cache, \phpbb\db\driver\driver_interface $db, \phpbb\auth\auth $auth, \phpbb\log\log $log, \phpbb\config\config $config)
+ public function __construct(\phpbb\user $user, \phpbb\cache\driver\driver_interface $cache, \phpbb\db\driver\driver_interface $db, \phpbb\auth\auth $auth, \phpbb\log\log_interface $log, \phpbb\config\config $config)
{
$this->cache = $cache;
$this->db = $db;
diff --git a/phpBB/phpbb/console/command/db/console_migrator_output_handler.php b/phpBB/phpbb/console/command/db/console_migrator_output_handler.php
new file mode 100644
index 0000000000..b9741a3838
--- /dev/null
+++ b/phpBB/phpbb/console/command/db/console_migrator_output_handler.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.
+*
+*/
+
+namespace phpbb\console\command\db;
+
+use phpbb\user;
+use phpbb\db\migrator_output_handler_interface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class console_migrator_output_handler implements migrator_output_handler_interface
+{
+ /**
+ * User object.
+ *
+ * @var user
+ */
+ private $user;
+
+ /**
+ * Console output object.
+ *
+ * @var OutputInterface
+ */
+ private $output;
+
+ /**
+ * Constructor
+ *
+ * @param user $user User object
+ * @param OutputInterface $output Console output object
+ */
+ public function __construct(user $user, OutputInterface $output)
+ {
+ $this->user = $user;
+ $this->output = $output;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write($message, $verbosity)
+ {
+ if ($verbosity <= $this->output->getVerbosity())
+ {
+ $translated_message = call_user_func_array(array($this->user, 'lang'), $message);
+
+ if ($verbosity === migrator_output_handler_interface::VERBOSITY_NORMAL)
+ {
+ $translated_message = '<info>' . $translated_message . '</info>';
+ }
+ else if ($verbosity === migrator_output_handler_interface::VERBOSITY_VERBOSE)
+ {
+ $translated_message = '<comment>' . $translated_message . '</comment>';
+ }
+
+ $this->output->writeln($translated_message);
+ }
+ }
+}
diff --git a/phpBB/phpbb/console/command/db/migrate.php b/phpBB/phpbb/console/command/db/migrate.php
index 86545c237d..87c2a057d1 100644
--- a/phpBB/phpbb/console/command/db/migrate.php
+++ b/phpBB/phpbb/console/command/db/migrate.php
@@ -32,13 +32,17 @@ class migrate extends \phpbb\console\command\command
/** @var \phpbb\log\log */
protected $log;
- function __construct(\phpbb\user $user, \phpbb\db\migrator $migrator, \phpbb\extension\manager $extension_manager, \phpbb\config\config $config, \phpbb\cache\service $cache, \phpbb\log\log $log)
+ /** @var string phpBB root path */
+ protected $phpbb_root_path;
+
+ function __construct(\phpbb\user $user, \phpbb\db\migrator $migrator, \phpbb\extension\manager $extension_manager, \phpbb\config\config $config, \phpbb\cache\service $cache, \phpbb\log\log $log, $phpbb_root_path)
{
$this->migrator = $migrator;
$this->extension_manager = $extension_manager;
$this->config = $config;
$this->cache = $cache;
$this->log = $log;
+ $this->phpbb_root_path = $phpbb_root_path;
parent::__construct($user);
$this->user->add_lang(array('common', 'install', 'migrator'));
}
@@ -53,14 +57,16 @@ class migrate extends \phpbb\console\command\command
protected function execute(InputInterface $input, OutputInterface $output)
{
+ $this->migrator->set_output_handler(new \phpbb\db\log_wrapper_migrator_output_handler($this->user, new console_migrator_output_handler($this->user, $output), $this->phpbb_root_path . 'store/migrations_' . time() . '.log'));
+
$this->migrator->create_migrations_table();
+ $this->cache->purge();
+
$this->load_migrations();
$orig_version = $this->config['version'];
while (!$this->migrator->finished())
{
- $migration_start_time = microtime(true);
-
try
{
$this->migrator->update();
@@ -71,36 +77,6 @@ class migrate extends \phpbb\console\command\command
$this->finalise_update();
return 1;
}
-
- $migration_stop_time = microtime(true) - $migration_start_time;
-
- $state = array_merge(
- array(
- 'migration_schema_done' => false,
- 'migration_data_done' => false,
- ),
- $this->migrator->last_run_migration['state']
- );
-
- if (!empty($this->migrator->last_run_migration['effectively_installed']))
- {
- $msg = $this->user->lang('MIGRATION_EFFECTIVELY_INSTALLED', $this->migrator->last_run_migration['name']);
- $output->writeln("<comment>$msg</comment>");
- }
- else if ($this->migrator->last_run_migration['task'] == 'process_data_step' && $state['migration_data_done'])
- {
- $msg = $this->user->lang('MIGRATION_DATA_DONE', $this->migrator->last_run_migration['name'], $migration_stop_time);
- $output->writeln("<info>$msg</info>");
- }
- else if ($this->migrator->last_run_migration['task'] == 'process_data_step')
- {
- $output->writeln($this->user->lang('MIGRATION_DATA_IN_PROGRESS', $this->migrator->last_run_migration['name'], $migration_stop_time));
- }
- else if ($state['migration_schema_done'])
- {
- $msg = $this->user->lang('MIGRATION_SCHEMA_DONE', $this->migrator->last_run_migration['name'], $migration_stop_time);
- $output->writeln("<info>$msg</info>");
- }
}
if ($orig_version != $this->config['version'])
diff --git a/phpBB/phpbb/content_visibility.php b/phpBB/phpbb/content_visibility.php
index 8bd537586e..700009da6a 100644
--- a/phpBB/phpbb/content_visibility.php
+++ b/phpBB/phpbb/content_visibility.php
@@ -44,6 +44,12 @@ class content_visibility
protected $config;
/**
+ * Event dispatcher object
+ * @var \phpbb\event\dispatcher_interface
+ */
+ protected $phpbb_dispatcher;
+
+ /**
* phpBB root path
* @var string
*/
@@ -60,6 +66,7 @@ class content_visibility
*
* @param \phpbb\auth\auth $auth Auth object
* @param \phpbb\config\config $config Config object
+ * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher object
* @param \phpbb\db\driver\driver_interface $db Database object
* @param \phpbb\user $user User object
* @param string $phpbb_root_path Root path
@@ -69,10 +76,11 @@ class content_visibility
* @param string $topics_table Topics table name
* @param string $users_table Users table name
*/
- public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\user $user, $phpbb_root_path, $php_ext, $forums_table, $posts_table, $topics_table, $users_table)
+ public function __construct(\phpbb\auth\auth $auth, \phpbb\config\config $config, \phpbb\event\dispatcher_interface $phpbb_dispatcher, \phpbb\db\driver\driver_interface $db, \phpbb\user $user, $phpbb_root_path, $php_ext, $forums_table, $posts_table, $topics_table, $users_table)
{
$this->auth = $auth;
$this->config = $config;
+ $this->phpbb_dispatcher = $phpbb_dispatcher;
$this->db = $db;
$this->user = $user;
$this->phpbb_root_path = $phpbb_root_path;
@@ -135,12 +143,43 @@ class content_visibility
*/
public function get_visibility_sql($mode, $forum_id, $table_alias = '')
{
+ $where_sql = '';
+
+ $get_visibility_sql_overwrite = false;
+
+ /**
+ * Allow changing the result of calling get_visibility_sql
+ *
+ * @event core.phpbb_content_visibility_get_visibility_sql_before
+ * @var string where_sql Extra visibility conditions. It must end with either an SQL "AND" or an "OR"
+ * @var string mode Either "topic" or "post" depending on the query this is being used in
+ * @var array forum_id The forum id in which the search is made.
+ * @var string table_alias Table alias to prefix in SQL queries
+ * @var mixed get_visibility_sql_overwrite If a string, forces the function to return get_forums_visibility_sql_overwrite after executing the event
+ * If false, get_visibility_sql continues normally
+ * It must be either boolean or string
+ * @since 3.1.4-RC1
+ */
+ $vars = array(
+ 'where_sql',
+ 'mode',
+ 'forum_id',
+ 'table_alias',
+ 'get_visibility_sql_overwrite',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.phpbb_content_visibility_get_visibility_sql_before', compact($vars)));
+
+ if ($get_visibility_sql_overwrite !== false)
+ {
+ return $get_visibility_sql_overwrite;
+ }
+
if ($this->auth->acl_get('m_approve', $forum_id))
{
- return '1 = 1';
+ return $where_sql . '1 = 1';
}
- return $table_alias . $mode . '_visibility = ' . ITEM_APPROVED;
+ return $where_sql . $table_alias . $mode . '_visibility = ' . ITEM_APPROVED;
}
/**
@@ -160,6 +199,36 @@ class content_visibility
$approve_forums = array_intersect($forum_ids, array_keys($this->auth->acl_getf('m_approve', true)));
+ $get_forums_visibility_sql_overwrite = false;
+ /**
+ * Allow changing the result of calling get_forums_visibility_sql
+ *
+ * @event core.phpbb_content_visibility_get_forums_visibility_before
+ * @var string where_sql The action the user tried to execute
+ * @var string mode Either "topic" or "post" depending on the query this is being used in
+ * @var array forum_ids Array of forum ids which the posts/topics are limited to
+ * @var string table_alias Table alias to prefix in SQL queries
+ * @var array approve_forums Array of forums where the user has m_approve permissions
+ * @var mixed get_forums_visibility_sql_overwrite If a string, forces the function to return get_forums_visibility_sql_overwrite after executing the event
+ * If false, get_forums_visibility_sql continues normally
+ * It must be either boolean or string
+ * @since 3.1.3-RC1
+ */
+ $vars = array(
+ 'where_sql',
+ 'mode',
+ 'forum_ids',
+ 'table_alias',
+ 'approve_forums',
+ 'get_forums_visibility_sql_overwrite',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.phpbb_content_visibility_get_forums_visibility_before', compact($vars)));
+
+ if ($get_forums_visibility_sql_overwrite !== false)
+ {
+ return $get_forums_visibility_sql_overwrite;
+ }
+
if (sizeof($approve_forums))
{
// Remove moderator forums from the rest
@@ -206,6 +275,35 @@ class content_visibility
$approve_forums = array_diff(array_keys($this->auth->acl_getf('m_approve', true)), $exclude_forum_ids);
+ $visibility_sql_overwrite = null;
+
+ /**
+ * Allow changing the result of calling get_global_visibility_sql
+ *
+ * @event core.phpbb_content_visibility_get_global_visibility_before
+ * @var array where_sqls The action the user tried to execute
+ * @var string mode Either "topic" or "post" depending on the query this is being used in
+ * @var array exclude_forum_ids Array of forum ids the current user doesn't have access to
+ * @var string table_alias Table alias to prefix in SQL queries
+ * @var array approve_forums Array of forums where the user has m_approve permissions
+ * @var string visibility_sql_overwrite Forces the function to return an implosion of where_sqls (joined by "OR")
+ * @since 3.1.3-RC1
+ */
+ $vars = array(
+ 'where_sqls',
+ 'mode',
+ 'exclude_forum_ids',
+ 'table_alias',
+ 'approve_forums',
+ 'visibility_sql_overwrite',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.phpbb_content_visibility_get_global_visibility_before', compact($vars)));
+
+ if ($visibility_sql_overwrite)
+ {
+ return $visibility_sql_overwrite;
+ }
+
if (sizeof($exclude_forum_ids))
{
$where_sqls[] = '(' . $this->db->sql_in_set($table_alias . 'forum_id', $exclude_forum_ids, true) . '
diff --git a/phpBB/phpbb/controller/helper.php b/phpBB/phpbb/controller/helper.php
index fc19b855c0..c6c470e91b 100644
--- a/phpBB/phpbb/controller/helper.php
+++ b/phpBB/phpbb/controller/helper.php
@@ -44,6 +44,9 @@ class helper
/* @var \phpbb\symfony_request */
protected $symfony_request;
+ /* @var \phpbb\request\request_interface */
+ protected $request;
+
/**
* @var \phpbb\filesystem The filesystem object
*/
@@ -70,16 +73,18 @@ class helper
* @param \phpbb\controller\provider $provider Path provider
* @param \phpbb\extension\manager $manager Extension manager object
* @param \phpbb\symfony_request $symfony_request Symfony Request object
+ * @param \phpbb\request\request_interface $request phpBB request object
* @param \phpbb\filesystem $filesystem The filesystem object
* @param string $phpbb_root_path phpBB root path
* @param string $php_ext PHP file extension
*/
- public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, \phpbb\controller\provider $provider, \phpbb\extension\manager $manager, \phpbb\symfony_request $symfony_request, \phpbb\filesystem $filesystem, $phpbb_root_path, $php_ext)
+ public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, \phpbb\controller\provider $provider, \phpbb\extension\manager $manager, \phpbb\symfony_request $symfony_request, \phpbb\request\request_interface $request, \phpbb\filesystem $filesystem, $phpbb_root_path, $php_ext)
{
$this->template = $template;
$this->user = $user;
$this->config = $config;
$this->symfony_request = $symfony_request;
+ $this->request = $request;
$this->filesystem = $filesystem;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
@@ -140,17 +145,20 @@ class helper
// If enable_mod_rewrite is false we need to replace the current front-end by app.php, otherwise we need to remove it.
$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 (empty($this->config['enable_mod_rewrite']))
- {
- $base_url = str_replace('/app.' . $this->php_ext, '/' . $this->phpbb_root_path . 'app.' . $this->php_ext, $base_url);
- }
- else
+ // 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')
{
- $base_url .= preg_replace(get_preg_expression('path_remove_dot_trailing_slash'), '$2', $this->phpbb_root_path);
+ if (empty($this->config['enable_mod_rewrite']))
+ {
+ $base_url = str_replace('/app.' . $this->php_ext, '/' . $this->phpbb_root_path . 'app.' . $this->php_ext, $base_url);
+ }
+ else
+ {
+ $base_url .= preg_replace(get_preg_expression('path_remove_dot_trailing_slash'), '$2', $this->phpbb_root_path);
+ }
}
- $base_url = $this->filesystem->clean_path($base_url);
+ $base_url = $this->request->escape($this->filesystem->clean_path($base_url), true);
$context->setBaseUrl($base_url);
@@ -176,15 +184,34 @@ class helper
* @param string $message The error message
* @param int $code The error code (e.g. 404, 500, 503, etc.)
* @return Response A Response instance
+ *
+ * @deprecated 3.1.3 (To be removed: 3.3.0) Use exceptions instead.
*/
public function error($message, $code = 500)
{
+ return $this->message($message, array(), 'INFORMATION', $code);
+ }
+
+ /**
+ * Output a message
+ *
+ * In case of an error, please throw an exception instead
+ *
+ * @param string $message The message to display (must be a language variable)
+ * @param array $parameters The parameters to use with the language var
+ * @param string $title Title for the message (must be a language variable)
+ * @param int $code The HTTP status code (e.g. 404, 500, 503, etc.)
+ * @return Response A Response instance
+ */
+ public function message($message, array $parameters = array(), $title = 'INFORMATION', $code = 200)
+ {
+ array_unshift($parameters, $message);
$this->template->assign_vars(array(
- 'MESSAGE_TEXT' => $message,
- 'MESSAGE_TITLE' => $this->user->lang('INFORMATION'),
+ 'MESSAGE_TEXT' => call_user_func_array(array($this->user, 'lang'), $parameters),
+ 'MESSAGE_TITLE' => $this->user->lang($title),
));
- return $this->render('message_body.html', $this->user->lang('INFORMATION'), $code);
+ return $this->render('message_body.html', $this->user->lang($title), $code);
}
/**
@@ -194,6 +221,6 @@ class helper
*/
public function get_current_url()
{
- return generate_board_url(true) . $this->symfony_request->getRequestUri();
+ return generate_board_url(true) . $this->request->escape($this->symfony_request->getRequestUri(), true);
}
}
diff --git a/phpBB/phpbb/cron/manager.php b/phpBB/phpbb/cron/manager.php
index 5c8ac04b77..079ce8107e 100644
--- a/phpBB/phpbb/cron/manager.php
+++ b/phpBB/phpbb/cron/manager.php
@@ -73,6 +73,7 @@ class manager
*/
public function find_one_ready_task()
{
+ shuffle($this->tasks);
foreach ($this->tasks as $task)
{
if ($task->is_ready())
diff --git a/phpBB/phpbb/cron/task/core/queue.php b/phpBB/phpbb/cron/task/core/queue.php
index 796a96d7f5..a9345a44df 100644
--- a/phpBB/phpbb/cron/task/core/queue.php
+++ b/phpBB/phpbb/cron/task/core/queue.php
@@ -73,6 +73,6 @@ class queue extends \phpbb\cron\task\base
*/
public function should_run()
{
- return $this->config['last_queue_run'] < time() - $this->config['queue_interval_config'];
+ return $this->config['last_queue_run'] < time() - $this->config['queue_interval'];
}
}
diff --git a/phpBB/phpbb/db/driver/mysqli.php b/phpBB/phpbb/db/driver/mysqli.php
index 2ed08211ad..c0ddfbf76c 100644
--- a/phpBB/phpbb/db/driver/mysqli.php
+++ b/phpBB/phpbb/db/driver/mysqli.php
@@ -34,8 +34,7 @@ class mysqli extends \phpbb\db\driver\mysql_base
return $this->sql_error('');
}
- // Mysqli extension supports persistent connection since PHP 5.3.0
- $this->persistency = (version_compare(PHP_VERSION, '5.3.0', '>=')) ? $persistency : false;
+ $this->persistency = $persistency;
$this->user = $sqluser;
// If persistent connection, set dbhost to localhost when empty and prepend it with 'p:' prefix
diff --git a/phpBB/phpbb/db/html_migrator_output_handler.php b/phpBB/phpbb/db/html_migrator_output_handler.php
new file mode 100644
index 0000000000..e37c667463
--- /dev/null
+++ b/phpBB/phpbb/db/html_migrator_output_handler.php
@@ -0,0 +1,48 @@
+<?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;
+
+use phpbb\user;
+
+class html_migrator_output_handler implements migrator_output_handler_interface
+{
+ /**
+ * User object.
+ *
+ * @var user
+ */
+ private $user;
+
+ /**
+ * Constructor
+ *
+ * @param user $user User object
+ */
+ public function __construct(user $user)
+ {
+ $this->user = $user;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write($message, $verbosity)
+ {
+ if ($verbosity <= migrator_output_handler_interface::VERBOSITY_VERBOSE)
+ {
+ $final_message = call_user_func_array(array($this->user, 'lang'), $message);
+ echo $final_message . "<br />\n";
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/log_wrapper_migrator_output_handler.php b/phpBB/phpbb/db/log_wrapper_migrator_output_handler.php
new file mode 100644
index 0000000000..94c293dc45
--- /dev/null
+++ b/phpBB/phpbb/db/log_wrapper_migrator_output_handler.php
@@ -0,0 +1,95 @@
+<?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;
+
+use phpbb\user;
+
+class log_wrapper_migrator_output_handler implements migrator_output_handler_interface
+{
+ /**
+ * User object.
+ *
+ * @var user
+ */
+ protected $user;
+
+ /**
+ * A migrator output handler
+ *
+ * @var migrator_output_handler_interface
+ */
+ protected $migrator;
+
+ /**
+ * Log file handle
+ * @var resource
+ */
+ protected $file_handle = false;
+
+ /**
+ * Constructor
+ *
+ * @param user $user User object
+ * @param migrator_output_handler_interface $migrator Migrator output handler
+ * @param string $log_file File to log to
+ */
+ public function __construct(user $user, migrator_output_handler_interface $migrator, $log_file)
+ {
+ $this->user = $user;
+ $this->migrator = $migrator;
+ $this->file_open($log_file);
+ }
+
+ /**
+ * Open file for logging
+ *
+ * @param string $file File to open
+ */
+ protected function file_open($file)
+ {
+ if (phpbb_is_writable(dirname($file)))
+ {
+ $this->file_handle = fopen($file, 'w');
+ }
+ else
+ {
+ throw new \RuntimeException('Unable to write to migrator log file');
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write($message, $verbosity)
+ {
+ $this->migrator->write($message, $verbosity);
+
+ if ($this->file_handle !== false)
+ {
+ $translated_message = call_user_func_array(array($this->user, 'lang'), $message) . "\n";
+
+ if ($verbosity <= migrator_output_handler_interface::VERBOSITY_NORMAL)
+ {
+ $translated_message = '[INFO] ' . $translated_message;
+ }
+ else
+ {
+ $translated_message = '[DEBUG] ' . $translated_message;
+ }
+
+ fwrite($this->file_handle, $translated_message);
+ fflush($this->file_handle);
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/container_aware_migration.php b/phpBB/phpbb/db/migration/container_aware_migration.php
new file mode 100644
index 0000000000..3b4b49b04b
--- /dev/null
+++ b/phpBB/phpbb/db/migration/container_aware_migration.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;
+
+use Symfony\Component\DependencyInjection\ContainerAwareInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+* Abstract base class for container aware database migrations.
+*/
+abstract class container_aware_migration extends migration implements ContainerAwareInterface
+{
+ /**
+ * @var ContainerInterface
+ */
+ protected $container;
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setContainer(ContainerInterface $container = null)
+ {
+ $this->container = $container;
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php
index 8600472cca..f9f6d9f7f7 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_12_rc1.php
@@ -31,7 +31,6 @@ class release_3_0_12_rc1 extends \phpbb\db\migration\migration
{
return array(
array('custom', array(array(&$this, 'update_module_auth'))),
- array('custom', array(array(&$this, 'update_bots'))),
array('custom', array(array(&$this, 'disable_bots_from_receiving_pms'))),
array('config.update', array('version', '3.0.12-RC1')),
@@ -70,60 +69,4 @@ class release_3_0_12_rc1 extends \phpbb\db\migration\migration
AND module_mode = \'signature\'';
$this->sql_query($sql);
}
-
- public function update_bots()
- {
- // Update bots
- if (!function_exists('user_delete'))
- {
- include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
- }
-
- $bots_updates = array(
- // Bot Deletions
- 'NG-Search [Bot]' => false,
- 'Nutch/CVS [Bot]' => false,
- 'OmniExplorer [Bot]' => false,
- 'Seekport [Bot]' => false,
- 'Synoo [Bot]' => false,
- 'WiseNut [Bot]' => false,
-
- // Bot Updates
- // Bot name to bot user agent map
- 'Baidu [Spider]' => 'Baiduspider',
- 'Exabot [Bot]' => 'Exabot',
- 'Voyager [Bot]' => 'voyager/',
- 'W3C [Validator]' => 'W3C_Validator',
- );
-
- foreach ($bots_updates as $bot_name => $bot_agent)
- {
- $sql = 'SELECT user_id
- FROM ' . USERS_TABLE . '
- WHERE user_type = ' . USER_IGNORE . "
- AND username_clean = '" . $this->db->sql_escape(utf8_clean_string($bot_name)) . "'";
- $result = $this->db->sql_query($sql);
- $bot_user_id = (int) $this->db->sql_fetchfield('user_id');
- $this->db->sql_freeresult($result);
-
- if ($bot_user_id)
- {
- if ($bot_agent === false)
- {
- $sql = 'DELETE FROM ' . BOTS_TABLE . "
- WHERE user_id = $bot_user_id";
- $this->sql_query($sql);
-
- user_delete('retain', $bot_user_id);
- }
- else
- {
- $sql = 'UPDATE ' . BOTS_TABLE . "
- SET bot_agent = '" . $this->db->sql_escape($bot_agent) . "'
- WHERE user_id = $bot_user_id";
- $this->sql_query($sql);
- }
- }
- }
- }
}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_13.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_13.php
new file mode 100644
index 0000000000..310fcc70fc
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_13.php
@@ -0,0 +1,37 @@
+<?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\v30x;
+
+class release_3_0_13 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.13', '>=') && phpbb_version_compare($this->config['version'], '3.1.0-dev', '<');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_13_rc1');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('if', array(
+ phpbb_version_compare($this->config['version'], '3.0.13', '<'),
+ array('config.update', array('version', '3.0.13')),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_13_pl1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_13_pl1.php
new file mode 100644
index 0000000000..b12a96a7fb
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_13_pl1.php
@@ -0,0 +1,37 @@
+<?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\v30x;
+
+class release_3_0_13_pl1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.13-PL1', '>=') && phpbb_version_compare($this->config['version'], '3.1.0-dev', '<');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_13');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('if', array(
+ phpbb_version_compare($this->config['version'], '3.0.13-PL1', '<'),
+ array('config.update', array('version', '3.0.13-PL1')),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_13_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_13_rc1.php
new file mode 100644
index 0000000000..9ea68fa862
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_13_rc1.php
@@ -0,0 +1,37 @@
+<?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\v30x;
+
+class release_3_0_13_rc1 extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ return phpbb_version_compare($this->config['version'], '3.0.13-RC1', '>=') && phpbb_version_compare($this->config['version'], '3.1.0-dev', '<');
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v30x\release_3_0_12');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('if', array(
+ phpbb_version_compare($this->config['version'], '3.0.13-RC1', '<'),
+ array('config.update', array('version', '3.0.13-RC1')),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php
index f593c32181..003ccf8f18 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php
@@ -13,7 +13,9 @@
namespace phpbb\db\migration\data\v30x;
-class release_3_0_5_rc1 extends \phpbb\db\migration\migration
+use phpbb\db\migration\container_aware_migration;
+
+class release_3_0_5_rc1 extends container_aware_migration
{
public function effectively_installed()
{
@@ -55,6 +57,7 @@ class release_3_0_5_rc1 extends \phpbb\db\migration\migration
public function hash_old_passwords()
{
+ $passwords_manager = $this->container->get('passwords.manager');
$sql = 'SELECT user_id, user_password
FROM ' . $this->table_prefix . 'users
WHERE user_pass_convert = 1';
@@ -65,7 +68,7 @@ class release_3_0_5_rc1 extends \phpbb\db\migration\migration
if (strlen($row['user_password']) == 32)
{
$sql_ary = array(
- 'user_password' => phpbb_hash($row['user_password']),
+ 'user_password' => '$CP$' . $passwords_manager->hash($row['user_password'], 'passwords.driver.salted_md5'),
);
$this->sql_query('UPDATE ' . $this->table_prefix . 'users SET ' . $this->db->sql_build_array('UPDATE', $sql_ary) . ' WHERE user_id = ' . $row['user_id']);
@@ -107,7 +110,7 @@ class release_3_0_5_rc1 extends \phpbb\db\migration\migration
// Select auth_option_ids... the largest id will be preserved
$sql = 'SELECT auth_option_id
FROM ' . ACL_OPTIONS_TABLE . "
- WHERE auth_option = '" . $db->sql_escape($option) . "'
+ WHERE auth_option = '" . $this->db->sql_escape($option) . "'
ORDER BY auth_option_id DESC";
// sql_query_limit not possible here, due to bug in postgresql layer
$result = $this->db->sql_query($sql);
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php
index 4e863fa143..22fd51543b 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_8_rc1.php
@@ -30,7 +30,6 @@ class release_3_0_8_rc1 extends \phpbb\db\migration\migration
return array(
array('custom', array(array(&$this, 'update_file_extension_group_names'))),
array('custom', array(array(&$this, 'update_module_auth'))),
- array('custom', array(array(&$this, 'update_bots'))),
array('custom', array(array(&$this, 'delete_orphan_shadow_topics'))),
array('module.add', array(
'acp',
@@ -114,70 +113,6 @@ class release_3_0_8_rc1 extends \phpbb\db\migration\migration
$this->sql_query($sql);
}
- public function update_bots()
- {
- $bot_name = 'Bing [Bot]';
- $bot_name_clean = utf8_clean_string($bot_name);
-
- $sql = 'SELECT user_id
- FROM ' . USERS_TABLE . "
- WHERE username_clean = '" . $this->db->sql_escape($bot_name_clean) . "'";
- $result = $this->db->sql_query($sql);
- $bing_already_added = (bool) $this->db->sql_fetchfield('user_id');
- $this->db->sql_freeresult($result);
-
- if (!$bing_already_added)
- {
- $bot_agent = 'bingbot/';
- $bot_ip = '';
- $sql = 'SELECT group_id, group_colour
- FROM ' . GROUPS_TABLE . "
- WHERE group_name = 'BOTS'";
- $result = $this->db->sql_query($sql);
- $group_row = $this->db->sql_fetchrow($result);
- $this->db->sql_freeresult($result);
-
- if (!$group_row)
- {
- // default fallback, should never get here
- $group_row['group_id'] = 6;
- $group_row['group_colour'] = '9E8DA7';
- }
-
- if (!function_exists('user_add'))
- {
- include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
- }
-
- $user_row = array(
- 'user_type' => USER_IGNORE,
- 'group_id' => $group_row['group_id'],
- 'username' => $bot_name,
- 'user_regdate' => time(),
- 'user_password' => '',
- 'user_colour' => $group_row['group_colour'],
- 'user_email' => '',
- 'user_lang' => $this->config['default_lang'],
- 'user_style' => $this->config['default_style'],
- 'user_timezone' => 0,
- 'user_dateformat' => $this->config['default_dateformat'],
- 'user_allow_massemail' => 0,
- );
-
- $user_id = user_add($user_row);
-
- $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $this->db->sql_build_array('INSERT', array(
- 'bot_active' => 1,
- 'bot_name' => (string) $bot_name,
- 'user_id' => (int) $user_id,
- 'bot_agent' => (string) $bot_agent,
- 'bot_ip' => (string) $bot_ip,
- ));
-
- $this->sql_query($sql);
- }
- }
-
public function delete_orphan_shadow_topics()
{
// Delete shadow topics pointing to not existing topics
diff --git a/phpBB/phpbb/db/migration/data/v310/bot_update.php b/phpBB/phpbb/db/migration/data/v310/bot_update.php
new file mode 100644
index 0000000000..39b16c68f8
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/bot_update.php
@@ -0,0 +1,150 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class bot_update extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\rc6');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array(&$this, 'update_bing_bot'))),
+ array('custom', array(array(&$this, 'update_bots'))),
+ );
+ }
+
+ public function update_bing_bot()
+ {
+ $bot_name = 'Bing [Bot]';
+ $bot_name_clean = utf8_clean_string($bot_name);
+
+ $sql = 'SELECT user_id
+ FROM ' . USERS_TABLE . "
+ WHERE username_clean = '" . $this->db->sql_escape($bot_name_clean) . "'";
+ $result = $this->db->sql_query($sql);
+ $bing_already_added = (bool) $this->db->sql_fetchfield('user_id');
+ $this->db->sql_freeresult($result);
+
+ if (!$bing_already_added)
+ {
+ $bot_agent = 'bingbot/';
+ $bot_ip = '';
+ $sql = 'SELECT group_id, group_colour
+ FROM ' . GROUPS_TABLE . "
+ WHERE group_name = 'BOTS'";
+ $result = $this->db->sql_query($sql);
+ $group_row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if (!$group_row)
+ {
+ // default fallback, should never get here
+ $group_row['group_id'] = 6;
+ $group_row['group_colour'] = '9E8DA7';
+ }
+
+ if (!function_exists('user_add'))
+ {
+ include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
+ }
+
+ $user_row = array(
+ 'user_type' => USER_IGNORE,
+ 'group_id' => $group_row['group_id'],
+ 'username' => $bot_name,
+ 'user_regdate' => time(),
+ 'user_password' => '',
+ 'user_colour' => $group_row['group_colour'],
+ 'user_email' => '',
+ 'user_lang' => $this->config['default_lang'],
+ 'user_style' => $this->config['default_style'],
+ 'user_timezone' => 0,
+ 'user_dateformat' => $this->config['default_dateformat'],
+ 'user_allow_massemail' => 0,
+ );
+
+ $user_id = user_add($user_row);
+
+ $sql = 'INSERT INTO ' . BOTS_TABLE . ' ' . $this->db->sql_build_array('INSERT', array(
+ 'bot_active' => 1,
+ 'bot_name' => (string) $bot_name,
+ 'user_id' => (int) $user_id,
+ 'bot_agent' => (string) $bot_agent,
+ 'bot_ip' => (string) $bot_ip,
+ ));
+
+ $this->sql_query($sql);
+ }
+ }
+
+ public function update_bots()
+ {
+ // Update bots
+ if (!function_exists('user_delete'))
+ {
+ include($this->phpbb_root_path . 'includes/functions_user.' . $this->php_ext);
+ }
+
+ $bots_updates = array(
+ // Bot Deletions
+ 'NG-Search [Bot]' => false,
+ 'Nutch/CVS [Bot]' => false,
+ 'OmniExplorer [Bot]' => false,
+ 'Seekport [Bot]' => false,
+ 'Synoo [Bot]' => false,
+ 'WiseNut [Bot]' => false,
+
+ // Bot Updates
+ // Bot name to bot user agent map
+ 'Baidu [Spider]' => 'Baiduspider',
+ 'Exabot [Bot]' => 'Exabot',
+ 'Voyager [Bot]' => 'voyager/',
+ 'W3C [Validator]' => 'W3C_Validator',
+ );
+
+ foreach ($bots_updates as $bot_name => $bot_agent)
+ {
+ $sql = 'SELECT user_id
+ FROM ' . USERS_TABLE . '
+ WHERE user_type = ' . USER_IGNORE . "
+ AND username_clean = '" . $this->db->sql_escape(utf8_clean_string($bot_name)) . "'";
+ $result = $this->db->sql_query($sql);
+ $bot_user_id = (int) $this->db->sql_fetchfield('user_id');
+ $this->db->sql_freeresult($result);
+
+ if ($bot_user_id)
+ {
+ if ($bot_agent === false)
+ {
+ $sql = 'DELETE FROM ' . BOTS_TABLE . "
+ WHERE user_id = $bot_user_id";
+ $this->sql_query($sql);
+
+ user_delete('retain', $bot_user_id);
+ }
+ else
+ {
+ $sql = 'UPDATE ' . BOTS_TABLE . "
+ SET bot_agent = '" . $this->db->sql_escape($bot_agent) . "'
+ WHERE user_id = $bot_user_id";
+ $this->sql_query($sql);
+ }
+ }
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/captcha_plugins.php b/phpBB/phpbb/db/migration/data/v310/captcha_plugins.php
index 13071e9891..328c08f1ec 100644
--- a/phpBB/phpbb/db/migration/data/v310/captcha_plugins.php
+++ b/phpBB/phpbb/db/migration/data/v310/captcha_plugins.php
@@ -25,9 +25,13 @@ class captcha_plugins extends \phpbb\db\migration\migration
public function update_data()
{
$captcha_plugin = $this->config['captcha_plugin'];
- if (strpos($this->config['captcha_plugin'], 'phpbb_captcha_') === 0)
+ if (strpos($captcha_plugin, 'phpbb_captcha_') === 0)
{
- $captcha_plugin = substr($this->config['captcha_plugin'], strlen('phpbb_captcha_'));
+ $captcha_plugin = substr($captcha_plugin, strlen('phpbb_captcha_'));
+ }
+ else if (strpos($captcha_plugin, 'phpbb_') === 0)
+ {
+ $captcha_plugin = substr($captcha_plugin, strlen('phpbb_'));
}
return array(
diff --git a/phpBB/phpbb/db/migration/data/v310/contact_admin_form.php b/phpBB/phpbb/db/migration/data/v310/contact_admin_form.php
index c2dd09ddf6..5736369f1a 100644
--- a/phpBB/phpbb/db/migration/data/v310/contact_admin_form.php
+++ b/phpBB/phpbb/db/migration/data/v310/contact_admin_form.php
@@ -20,6 +20,11 @@ class contact_admin_form extends \phpbb\db\migration\migration
return isset($this->config['contact_admin_form_enable']);
}
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\config_db_text');
+ }
+
public function update_data()
{
return array(
diff --git a/phpBB/phpbb/db/migration/data/v310/gold.php b/phpBB/phpbb/db/migration/data/v310/gold.php
new file mode 100644
index 0000000000..e84c7ee951
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/gold.php
@@ -0,0 +1,32 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class gold extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\rc6',
+ '\phpbb\db\migration\data\v310\bot_update',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.0')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php b/phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php
index 4530ebe285..e04a705c91 100644
--- a/phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php
+++ b/phpBB/phpbb/db/migration/data/v310/mysql_fulltext_drop.php
@@ -15,10 +15,18 @@ namespace phpbb\db\migration\data\v310;
class mysql_fulltext_drop extends \phpbb\db\migration\migration
{
+ protected $indexes;
+
public function effectively_installed()
{
// This migration is irrelevant for all non-MySQL DBMSes.
- return strpos($this->db->get_sql_layer(), 'mysql') === false;
+ if (strpos($this->db->get_sql_layer(), 'mysql') === false)
+ {
+ return true;
+ }
+
+ $this->find_indexes_to_drop();
+ return empty($this->indexes);
}
static public function depends_on()
@@ -30,6 +38,11 @@ class mysql_fulltext_drop extends \phpbb\db\migration\migration
public function update_schema()
{
+ if (empty($this->indexes))
+ {
+ return array();
+ }
+
/*
* Drop FULLTEXT indexes related to MySQL fulltext search.
* Doing so is equivalent to dropping the search index from the ACP.
@@ -40,12 +53,28 @@ class mysql_fulltext_drop extends \phpbb\db\migration\migration
*/
return array(
'drop_keys' => array(
- $this->table_prefix . 'posts' => array(
- 'post_subject',
- 'post_text',
- 'post_content',
- ),
+ $this->table_prefix . 'posts' => $this->indexes,
),
);
}
+
+ public function find_indexes_to_drop()
+ {
+ if ($this->indexes !== null)
+ {
+ return $this->indexes;
+ }
+
+ $this->indexes = array();
+ $potential_keys = array('post_subject', 'post_text', 'post_content');
+ foreach ($potential_keys as $key)
+ {
+ if ($this->db_tools->sql_index_exists($this->table_prefix . 'posts', $key))
+ {
+ $this->indexes[] = $key;
+ }
+ }
+
+ return $this->indexes;
+ }
}
diff --git a/phpBB/phpbb/db/migration/data/v310/notifications_use_full_name.php b/phpBB/phpbb/db/migration/data/v310/notifications_use_full_name.php
index f749b32119..112c1e85e8 100644
--- a/phpBB/phpbb/db/migration/data/v310/notifications_use_full_name.php
+++ b/phpBB/phpbb/db/migration/data/v310/notifications_use_full_name.php
@@ -92,10 +92,41 @@ class notifications_use_full_name extends \phpbb\db\migration\migration
foreach ($this->notification_types as $notification_type)
{
- $sql = 'UPDATE ' . NOTIFICATION_TYPES_TABLE . "
- SET notification_type_name = 'notification.type.{$notification_type}'
- WHERE notification_type_name = '{$notification_type}'";
- $this->db->sql_query($sql);
+ $sql = 'SELECT notification_type_id
+ FROM ' . NOTIFICATION_TYPES_TABLE . "
+ WHERE notification_type_name = 'notification.type.{$notification_type}'";
+ $result = $this->db->sql_query($sql);
+ $new_type_id = (int) $this->db->sql_fetchfield('notification_type_id');
+ $this->db->sql_freeresult($result);
+
+ if ($new_type_id)
+ {
+ // New type name already exists,
+ // so we delete the old type and update the type id of existing entries.
+ $sql = 'SELECT notification_type_id
+ FROM ' . NOTIFICATION_TYPES_TABLE . "
+ WHERE notification_type_name = '{$notification_type}'";
+ $result = $this->db->sql_query($sql);
+ $old_type_id = (int) $this->db->sql_fetchfield('notification_type_id');
+ $this->db->sql_freeresult($result);
+
+ $sql = 'UPDATE ' . NOTIFICATIONS_TABLE . '
+ SET notification_type_id = ' . (int) $new_type_id . '
+ WHERE notification_type_id = ' . (int) $old_type_id;
+ $this->db->sql_query($sql);
+
+ $sql = 'DELETE FROM ' . NOTIFICATION_TYPES_TABLE . "
+ WHERE notification_type_name = '{$notification_type}'";
+ $this->db->sql_query($sql);
+ }
+ else
+ {
+ // Otherwise we just update the name
+ $sql = 'UPDATE ' . NOTIFICATION_TYPES_TABLE . "
+ SET notification_type_name = 'notification.type.{$notification_type}'
+ WHERE notification_type_name = '{$notification_type}'";
+ $this->db->sql_query($sql);
+ }
$sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . "
SET item_type = 'notification.type.{$notification_type}'
@@ -108,10 +139,41 @@ class notifications_use_full_name extends \phpbb\db\migration\migration
{
foreach ($this->notification_types as $notification_type)
{
- $sql = 'UPDATE ' . NOTIFICATION_TYPES_TABLE . "
- SET notification_type_name = '{$notification_type}'
- WHERE notification_type_name = 'notification.type.{$notification_type}'";
- $this->db->sql_query($sql);
+ $sql = 'SELECT notification_type_id
+ FROM ' . NOTIFICATION_TYPES_TABLE . "
+ WHERE notification_type_name = '{$notification_type}'";
+ $result = $this->db->sql_query($sql);
+ $new_type_id = (int) $this->db->sql_fetchfield('notification_type_id');
+ $this->db->sql_freeresult($result);
+
+ if ($new_type_id)
+ {
+ // New type name already exists,
+ // so we delete the old type and update the type id of existing entries.
+ $sql = 'SELECT notification_type_id
+ FROM ' . NOTIFICATION_TYPES_TABLE . "
+ WHERE notification_type_name = 'notification.type.{$notification_type}'";
+ $result = $this->db->sql_query($sql);
+ $old_type_id = (int) $this->db->sql_fetchfield('notification_type_id');
+ $this->db->sql_freeresult($result);
+
+ $sql = 'UPDATE ' . NOTIFICATIONS_TABLE . '
+ SET notification_type_id = ' . (int) $new_type_id . '
+ WHERE notification_type_id = ' . (int) $old_type_id;
+ $this->db->sql_query($sql);
+
+ $sql = 'DELETE FROM ' . NOTIFICATION_TYPES_TABLE . "
+ WHERE notification_type_name = 'notification.type.{$notification_type}'";
+ $this->db->sql_query($sql);
+ }
+ else
+ {
+ // Otherwise we just update the name
+ $sql = 'UPDATE ' . NOTIFICATION_TYPES_TABLE . "
+ SET notification_type_name = '{$notification_type}'
+ WHERE notification_type_name = 'notification.type.{$notification_type}'";
+ $this->db->sql_query($sql);
+ }
$sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . "
SET item_type = '{$notification_type}'
diff --git a/phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php b/phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php
index ea442dfb1b..3457c19478 100644
--- a/phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php
+++ b/phpBB/phpbb/db/migration/data/v310/postgres_fulltext_drop.php
@@ -15,10 +15,18 @@ namespace phpbb\db\migration\data\v310;
class postgres_fulltext_drop extends \phpbb\db\migration\migration
{
+ protected $indexes;
+
public function effectively_installed()
{
// This migration is irrelevant for all non-PostgreSQL DBMSes.
- return strpos($this->db->get_sql_layer(), 'postgres') === false;
+ if (strpos($this->db->get_sql_layer(), 'postgres') === false)
+ {
+ return true;
+ }
+
+ $this->find_indexes_to_drop();
+ return empty($this->indexes);
}
static public function depends_on()
@@ -30,6 +38,11 @@ class postgres_fulltext_drop extends \phpbb\db\migration\migration
public function update_schema()
{
+ if (empty($this->indexes))
+ {
+ return array();
+ }
+
/*
* Drop FULLTEXT indexes related to PostgreSQL fulltext search.
* Doing so is equivalent to dropping the search index from the ACP.
@@ -40,12 +53,28 @@ class postgres_fulltext_drop extends \phpbb\db\migration\migration
*/
return array(
'drop_keys' => array(
- $this->table_prefix . 'posts' => array(
- 'post_subject',
- 'post_text',
- 'post_content',
- ),
+ $this->table_prefix . 'posts' => $this->indexes,
),
);
}
+
+ public function find_indexes_to_drop()
+ {
+ if ($this->indexes !== null)
+ {
+ return $this->indexes;
+ }
+
+ $this->indexes = array();
+ $potential_keys = array('post_subject', 'post_text', 'post_content');
+ foreach ($potential_keys as $key)
+ {
+ if ($this->db_tools->sql_index_exists($this->table_prefix . 'posts', $key))
+ {
+ $this->indexes[] = $key;
+ }
+ }
+
+ return $this->indexes;
+ }
}
diff --git a/phpBB/phpbb/db/migration/data/v310/rc5.php b/phpBB/phpbb/db/migration/data/v310/rc5.php
new file mode 100644
index 0000000000..5b6f70e32e
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/rc5.php
@@ -0,0 +1,33 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class rc5 extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\rc4',
+ '\phpbb\db\migration\data\v310\profilefield_field_validation_length',
+ '\phpbb\db\migration\data\v310\remove_acp_styles_cache',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.0-RC5')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/rc6.php b/phpBB/phpbb/db/migration/data/v310/rc6.php
new file mode 100644
index 0000000000..b84f2edcc9
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/rc6.php
@@ -0,0 +1,31 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class rc6 extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\rc5',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.0-RC6')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/remove_acp_styles_cache.php b/phpBB/phpbb/db/migration/data/v310/remove_acp_styles_cache.php
new file mode 100644
index 0000000000..7b84539814
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/remove_acp_styles_cache.php
@@ -0,0 +1,51 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v310;
+
+class remove_acp_styles_cache extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ $sql = 'SELECT module_id
+ FROM ' . MODULES_TABLE . "
+ WHERE module_class = 'acp'
+ AND module_langname = 'ACP_STYLES_CACHE'";
+ $result = $this->db->sql_query($sql);
+ $module_id = $this->db->sql_fetchfield('module_id');
+ $this->db->sql_freeresult($result);
+
+ return !$module_id;
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\rc4');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('module.remove', array(
+ 'acp',
+ 'ACP_STYLE_MANAGEMENT',
+ array(
+ 'module_basename' => 'acp_styles',
+ 'module_langname' => 'ACP_STYLES_CACHE',
+ 'module_mode' => 'cache',
+ 'module_auth' => 'acl_a_styles',
+ ),
+ )),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php b/phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php
index d5f9076196..8211457dc6 100644
--- a/phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php
+++ b/phpBB/phpbb/db/migration/data/v310/reset_missing_captcha_plugin.php
@@ -29,7 +29,8 @@ class reset_missing_captcha_plugin extends \phpbb\db\migration\migration
{
return array(
array('if', array(
- (!is_file($this->phpbb_root_path . "includes/captcha/plugins/{$this->config['captcha_plugin']}_plugin." . $this->php_ext)),
+ (is_dir($this->phpbb_root_path . 'includes/captcha/plugins/') &&
+ !is_file($this->phpbb_root_path . "includes/captcha/plugins/{$this->config['captcha_plugin']}_plugin." . $this->php_ext)),
array('config.update', array('captcha_plugin', 'phpbb_captcha_nogd')),
)),
);
diff --git a/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php b/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php
index 58845b88ec..85b90da5fa 100644
--- a/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php
+++ b/phpBB/phpbb/db/migration/data/v310/soft_delete_mod_convert.php
@@ -13,12 +13,14 @@
namespace phpbb\db\migration\data\v310;
+use phpbb\db\migration\container_aware_migration;
+
/**
* Migration to convert the Soft Delete MOD for 3.0
*
* https://www.phpbb.com/customise/db/mod/soft_delete/
*/
-class soft_delete_mod_convert extends \phpbb\db\migration\migration
+class soft_delete_mod_convert extends container_aware_migration
{
static public function depends_on()
{
@@ -115,19 +117,11 @@ class soft_delete_mod_convert extends \phpbb\db\migration\migration
}
}
+ /**
+ * @return \phpbb\content_visibility
+ */
protected function get_content_visibility()
{
- return new \phpbb\content_visibility(
- new \phpbb\auth\auth(),
- $this->config,
- $this->db,
- new \phpbb\user('\phpbb\datetime'),
- $this->phpbb_root_path,
- $this->php_ext,
- $this->table_prefix . 'forums',
- $this->table_prefix . 'posts',
- $this->table_prefix . 'topics',
- $this->table_prefix . 'users'
- );
+ return $this->container->get('content.visibility');
}
}
diff --git a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php
index 5a3a1d5de7..e8d3a3af64 100644
--- a/phpBB/phpbb/db/migration/data/v310/style_update_p1.php
+++ b/phpBB/phpbb/db/migration/data/v310/style_update_p1.php
@@ -92,7 +92,7 @@ class style_update_p1 extends \phpbb\db\migration\migration
else
{
$sql = 'SELECT s.style_id, t.template_path, t.template_id, t.bbcode_bitfield, t.template_inherits_id, t.template_inherit_path, c.theme_path, c.theme_id
- FROM ' . STYLES_TABLE . ' s, ' . $this->table_prefix . 'styles_template t, ' . $this->table_prefix . "stles_theme c
+ FROM ' . STYLES_TABLE . ' s, ' . $this->table_prefix . 'styles_template t, ' . $this->table_prefix . "styles_theme c
WHERE t.template_id = s.template_id
AND c.theme_id = s.theme_id";
}
diff --git a/phpBB/phpbb/db/migration/data/v31x/m_softdelete_global.php b/phpBB/phpbb/db/migration/data/v31x/m_softdelete_global.php
new file mode 100644
index 0000000000..dd7e20e762
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/m_softdelete_global.php
@@ -0,0 +1,31 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class m_softdelete_global extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v31x\v311');
+ }
+
+ public function update_data()
+ {
+ return array(
+ // Make m_softdelete global. The add method will take care of updating
+ // it if it already exists.
+ array('permission.add', array('m_softdelete', true)),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/plupload_last_gc_dynamic.php b/phpBB/phpbb/db/migration/data/v31x/plupload_last_gc_dynamic.php
new file mode 100644
index 0000000000..0783d707c5
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/plupload_last_gc_dynamic.php
@@ -0,0 +1,31 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class plupload_last_gc_dynamic extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v31x\v312');
+ }
+
+ public function update_data()
+ {
+ return array(
+ // Make plupload_last_gc dynamic.
+ array('config.remove', array('plupload_last_gc')),
+ array('config.add', array('plupload_last_gc', 0, 1)),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/profilefield_remove_underscore_from_alpha.php b/phpBB/phpbb/db/migration/data/v31x/profilefield_remove_underscore_from_alpha.php
new file mode 100644
index 0000000000..60491f8de8
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/profilefield_remove_underscore_from_alpha.php
@@ -0,0 +1,47 @@
+<?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 profilefield_remove_underscore_from_alpha extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v31x\v311');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'remove_underscore_from_alpha_validations'))),
+ );
+ }
+
+ public function remove_underscore_from_alpha_validations()
+ {
+ $this->update_validation_rule('[\w]+', '[a-zA-Z0-9]+');
+ $this->update_validation_rule('[\w_]+', '[\w]+');
+ $this->update_validation_rule('[\w.]+', '[a-zA-Z0-9.]+');
+ $this->update_validation_rule('[\w\x20_+\-\[\]]+', '[\w\x20+\-\[\]]+');
+ $this->update_validation_rule('[a-zA-Z][\w\.,\-_]+', '[a-zA-Z][\w\.,\-]+');
+ }
+
+ public function update_validation_rule($old_validation, $new_validation)
+ {
+ $sql = 'UPDATE ' . PROFILE_FIELDS_TABLE . "
+ SET field_validation = '" . $this->db->sql_escape($new_validation) . "'
+ WHERE field_validation = '" . $this->db->sql_escape($old_validation) . "'";
+ $this->db->sql_query($sql);
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/profilefield_yahoo_update_url.php b/phpBB/phpbb/db/migration/data/v31x/profilefield_yahoo_update_url.php
new file mode 100644
index 0000000000..4df9083bdf
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/profilefield_yahoo_update_url.php
@@ -0,0 +1,38 @@
+<?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 profilefield_yahoo_update_url extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v31x\v312');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'update_contact_url'))),
+ );
+ }
+
+ public function update_contact_url()
+ {
+ $sql = 'UPDATE ' . $this->table_prefix . "profile_fields
+ SET field_contact_url = 'ymsgr:sendim?%s'
+ WHERE field_name = 'phpbb_yahoo'
+ AND field_contact_url = 'http://edit.yahoo.com/config/send_webmesg?.target=%s&amp;.src=pg'";
+ $this->sql_query($sql);
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/style_update.php b/phpBB/phpbb/db/migration/data/v31x/style_update.php
new file mode 100644
index 0000000000..bb030bbe6d
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/style_update.php
@@ -0,0 +1,136 @@
+<?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 style_update extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\gold');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'update_installed_styles'))),
+ );
+ }
+
+ public function update_installed_styles()
+ {
+ // Get all currently available styles
+ $styles = $this->find_style_dirs();
+ $style_paths = $style_ids = array();
+
+ $sql = 'SELECT style_path, style_id
+ FROM ' . $this->table_prefix . 'styles';
+ $result = $this->db->sql_query($sql);
+ while ($styles_row = $this->db->sql_fetchrow())
+ {
+ if (in_array($styles_row['style_path'], $styles))
+ {
+ $style_paths[] = $styles_row['style_path'];
+ $style_ids[] = $styles_row['style_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ // Install prosilver if no style is available and prosilver can be installed
+ if (empty($style_paths) && in_array('prosilver', $styles))
+ {
+ // Try to parse config file
+ $cfg = parse_cfg_file($this->phpbb_root_path . 'styles/prosilver/style.cfg');
+
+ // Stop running this if prosilver cfg file can't be read
+ if (empty($cfg))
+ {
+ throw new \RuntimeException('No styles available and could not fall back to prosilver.');
+ }
+
+ $style = array(
+ 'style_name' => 'prosilver',
+ 'style_copyright' => '&copy; phpBB Limited',
+ 'style_active' => 1,
+ 'style_path' => 'prosilver',
+ 'bbcode_bitfield' => 'kNg=',
+ 'style_parent_id' => 0,
+ 'style_parent_tree' => '',
+ );
+
+ // Add to database
+ $this->db->sql_transaction('begin');
+
+ $sql = 'INSERT INTO ' . $this->table_prefix . 'styles
+ ' . $this->db->sql_build_array('INSERT', $style);
+ $this->db->sql_query($sql);
+
+ $style_id = $this->db->sql_nextid();
+ $style_ids[] = $style_id;
+
+ $this->db->sql_transaction('commit');
+
+ // Set prosilver to default style
+ $this->config->set('default_style', $style_id);
+ }
+ else if (empty($styles) && empty($available_styles))
+ {
+ throw new \RuntimeException('No valid styles available');
+ }
+
+ // Make sure default style is available
+ if (!in_array($this->config['default_style'], $style_ids))
+ {
+ $this->config->set('default_style', array_pop($style_ids));
+ }
+
+ // Reset users to default style if their user_style is nonexistent
+ $sql = 'UPDATE ' . $this->table_prefix . "users
+ SET user_style = {$this->config['default_style']}
+ WHERE " . $this->db->sql_in_set('user_style', $style_ids, true, true);
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * Find all directories that have styles
+ * Copied from acp_styles
+ *
+ * @return array Directory names
+ */
+ protected function find_style_dirs()
+ {
+ $styles = array();
+ $styles_path = $this->phpbb_root_path . 'styles/';
+
+ $dp = @opendir($styles_path);
+ if ($dp)
+ {
+ while (($file = readdir($dp)) !== false)
+ {
+ $dir = $styles_path . $file;
+ if ($file[0] == '.' || !is_dir($dir))
+ {
+ continue;
+ }
+
+ if (file_exists("{$dir}/style.cfg"))
+ {
+ $styles[] = $file;
+ }
+ }
+ closedir($dp);
+ }
+
+ return $styles;
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/update_custom_bbcodes_with_idn.php b/phpBB/phpbb/db/migration/data/v31x/update_custom_bbcodes_with_idn.php
new file mode 100644
index 0000000000..854ed1f568
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/update_custom_bbcodes_with_idn.php
@@ -0,0 +1,70 @@
+<?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 update_custom_bbcodes_with_idn extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v312',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'update_bbcodes_table'))),
+ );
+ }
+
+ public function update_bbcodes_table()
+ {
+ if (!class_exists('acp_bbcodes'))
+ {
+ include($this->phpbb_root_path . 'includes/acp/acp_bbcodes.' . $this->php_ext);
+ }
+
+ $bbcodes = new \acp_bbcodes();
+
+ $sql = 'SELECT bbcode_id, bbcode_match, bbcode_tpl
+ FROM ' . BBCODES_TABLE;
+ $result = $this->sql_query($sql);
+
+ $sql_ary = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $data = array();
+ if (preg_match('/(URL|LOCAL_URL|RELATIVE_URL)/', $row['bbcode_match']))
+ {
+ $data = $bbcodes->build_regexp($row['bbcode_match'], $row['bbcode_tpl']);
+ $sql_ary[$row['bbcode_id']] = array(
+ 'first_pass_match' => $data['first_pass_match'],
+ 'first_pass_replace' => $data['first_pass_replace'],
+ 'second_pass_match' => $data['second_pass_match'],
+ 'second_pass_replace' => $data['second_pass_replace']
+ );
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ foreach ($sql_ary as $bbcode_id => $bbcode_data)
+ {
+ $sql = 'UPDATE ' . BBCODES_TABLE . '
+ SET ' . $this->db->sql_build_array('UPDATE', $bbcode_data) . '
+ WHERE bbcode_id = ' . (int) $bbcode_id;
+ $this->sql_query($sql);
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v311.php b/phpBB/phpbb/db/migration/data/v31x/v311.php
new file mode 100644
index 0000000000..00844dd4c0
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v311.php
@@ -0,0 +1,32 @@
+<?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 v311 extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v310\gold',
+ '\phpbb\db\migration\data\v31x\style_update',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v312.php b/phpBB/phpbb/db/migration/data/v31x/v312.php
new file mode 100644
index 0000000000..bf49935f4d
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v312.php
@@ -0,0 +1,31 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v312 extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v312rc1',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.2')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v312rc1.php b/phpBB/phpbb/db/migration/data/v31x/v312rc1.php
new file mode 100644
index 0000000000..d4b133fc01
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v312rc1.php
@@ -0,0 +1,32 @@
+<?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 v312rc1 extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v311',
+ '\phpbb\db\migration\data\v31x\m_softdelete_global',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.2-RC1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v313.php b/phpBB/phpbb/db/migration/data/v31x/v313.php
new file mode 100644
index 0000000000..5a4e21a9b7
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v313.php
@@ -0,0 +1,31 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v31x;
+
+class v313 extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v31x\v313rc2',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.3')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v313rc1.php b/phpBB/phpbb/db/migration/data/v31x/v313rc1.php
new file mode 100644
index 0000000000..e50754f805
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v313rc1.php
@@ -0,0 +1,35 @@
+<?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 v313rc1 extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v30x\release_3_0_13_rc1',
+ '\phpbb\db\migration\data\v31x\plupload_last_gc_dynamic',
+ '\phpbb\db\migration\data\v31x\profilefield_remove_underscore_from_alpha',
+ '\phpbb\db\migration\data\v31x\profilefield_yahoo_update_url',
+ '\phpbb\db\migration\data\v31x\update_custom_bbcodes_with_idn',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.3-RC1')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v31x/v313rc2.php b/phpBB/phpbb/db/migration/data/v31x/v313rc2.php
new file mode 100644
index 0000000000..d832d6f502
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v31x/v313rc2.php
@@ -0,0 +1,32 @@
+<?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 v313rc2 extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array(
+ '\phpbb\db\migration\data\v30x\release_3_0_13_pl1',
+ '\phpbb\db\migration\data\v31x\v313rc1',
+ );
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.update', array('version', '3.1.3-RC2')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/profilefield_base_migration.php b/phpBB/phpbb/db/migration/profilefield_base_migration.php
index 9000949a7d..da1a38e2fa 100644
--- a/phpBB/phpbb/db/migration/profilefield_base_migration.php
+++ b/phpBB/phpbb/db/migration/profilefield_base_migration.php
@@ -13,7 +13,7 @@
namespace phpbb\db\migration;
-abstract class profilefield_base_migration extends \phpbb\db\migration\migration
+abstract class profilefield_base_migration extends container_aware_migration
{
protected $profilefield_name;
@@ -237,8 +237,7 @@ abstract class profilefield_base_migration extends \phpbb\db\migration\migration
if ($profile_row === null)
{
- global $phpbb_container;
- $manager = $phpbb_container->get('profilefields.manager');
+ $manager = $this->container->get('profilefields.manager');
$profile_row = $manager->build_insert_sql_array(array());
}
diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php
index db43046a95..035625b095 100644
--- a/phpBB/phpbb/db/migration/tool/module.php
+++ b/phpBB/phpbb/db/migration/tool/module.php
@@ -475,6 +475,7 @@ class module implements \phpbb\db\migration\tool\tool_interface
if (!class_exists('acp_modules'))
{
include($this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext);
+ $this->user->add_lang('acp/modules');
}
$acp_modules = new \acp_modules();
$module = $acp_modules->get_module_infos($basename, $class, true);
diff --git a/phpBB/phpbb/db/migration/tool/permission.php b/phpBB/phpbb/db/migration/tool/permission.php
index 5cfbc5ca00..1a91127d2d 100644
--- a/phpBB/phpbb/db/migration/tool/permission.php
+++ b/phpBB/phpbb/db/migration/tool/permission.php
@@ -537,7 +537,8 @@ class permission implements \phpbb\db\migration\tool\tool_interface
}
$sql = 'DELETE FROM ' . ACL_ROLES_DATA_TABLE . '
- WHERE ' . $this->db->sql_in_set('auth_option_id', $to_remove);
+ WHERE ' . $this->db->sql_in_set('auth_option_id', $to_remove) . '
+ AND role_id = ' . (int) $role_id;
$this->db->sql_query($sql);
break;
diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php
index 44bea3c5d2..7fc3e787e2 100644
--- a/phpBB/phpbb/db/migrator.php
+++ b/phpBB/phpbb/db/migrator.php
@@ -13,11 +13,19 @@
namespace phpbb\db;
+use Symfony\Component\DependencyInjection\ContainerAwareInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
/**
* The migrator is responsible for applying new migrations in the correct order.
*/
class migrator
{
+ /**
+ * @var ContainerInterface
+ */
+ protected $container;
+
/** @var \phpbb\config\config */
protected $config;
@@ -59,6 +67,13 @@ class migrator
protected $migrations = array();
/**
+ * Array of migrations that have been determined to be fulfillable
+ *
+ * @var array
+ */
+ protected $fulfillable_migrations = array();
+
+ /**
* 'name,' 'class,' and 'state' of the last migration run
*
* 'effectively_installed' set and set to true if the migration was effectively_installed
@@ -68,10 +83,18 @@ class migrator
public $last_run_migration = false;
/**
+ * The output handler. A null handler is configured by default.
+ *
+ * @var migrator_output_handler_interface
+ */
+ public $output_handler;
+
+ /**
* Constructor of the database migrator
*/
- public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\db\tools $db_tools, $migrations_table, $phpbb_root_path, $php_ext, $table_prefix, $tools, \phpbb\db\migration\helper $helper)
+ public function __construct(ContainerInterface $container, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\db\tools $db_tools, $migrations_table, $phpbb_root_path, $php_ext, $table_prefix, $tools, \phpbb\db\migration\helper $helper)
{
+ $this->container = $container;
$this->config = $config;
$this->db = $db;
$this->db_tools = $db_tools;
@@ -84,6 +107,8 @@ class migrator
$this->table_prefix = $table_prefix;
+ $this->output_handler = new null_migrator_output_handler();
+
foreach ($tools as $tool)
{
$this->tools[$tool->get_name()] = $tool;
@@ -95,6 +120,16 @@ class migrator
}
/**
+ * Set the output handler.
+ *
+ * @param migrator_output_handler $handler The output handler
+ */
+ public function set_output_handler(migrator_output_handler_interface $handler)
+ {
+ $this->output_handler = $handler;
+ }
+
+ /**
* Loads all migrations and their application state from the database.
*
* @return null
@@ -146,6 +181,18 @@ class migrator
*/
public function update()
{
+ $this->container->get('dispatcher')->disable();
+ $this->update_do();
+ $this->container->get('dispatcher')->enable();
+ }
+
+ /**
+ * Effectively runs a single update step from the next migration to be applied.
+ *
+ * @return null
+ */
+ protected function update_do()
+ {
foreach ($this->migrations as $name)
{
if (!isset($this->migration_state[$name]) ||
@@ -161,6 +208,10 @@ class migrator
return;
}
}
+ else
+ {
+ $this->output_handler->write(array('MIGRATION_EFFECTIVELY_INSTALLED', $name), migrator_output_handler_interface::VERBOSITY_DEBUG);
+ }
}
}
@@ -175,6 +226,7 @@ class migrator
{
if (!class_exists($name))
{
+ $this->output_handler->write(array('MIGRATION_NOT_VALID', $name), migrator_output_handler_interface::VERBOSITY_DEBUG);
return false;
}
@@ -191,6 +243,11 @@ class migrator
'migration_end_time' => 0,
);
+ if (!empty($state['migration_depends_on']))
+ {
+ $this->output_handler->write(array('MIGRATION_APPLY_DEPENDENCIES', $name), migrator_output_handler_interface::VERBOSITY_DEBUG);
+ }
+
foreach ($state['migration_depends_on'] as $depend)
{
if ($this->unfulfillable($depend) !== false)
@@ -227,6 +284,8 @@ class migrator
);
$this->last_run_migration['effectively_installed'] = true;
+
+ $this->output_handler->write(array('MIGRATION_EFFECTIVELY_INSTALLED', $name), migrator_output_handler_interface::VERBOSITY_VERBOSE);
}
else
{
@@ -238,28 +297,48 @@ class migrator
if (!$state['migration_schema_done'])
{
+ $this->output_handler->write(array('MIGRATION_SCHEMA_RUNNING', $name), migrator_output_handler_interface::VERBOSITY_VERBOSE);
+
$this->last_run_migration['task'] = 'process_schema_step';
+ $elapsed_time = microtime(true);
$steps = $this->helper->get_schema_steps($migration->update_schema());
$result = $this->process_data_step($steps, $state['migration_data_state']);
+ $elapsed_time = microtime(true) - $elapsed_time;
$state['migration_data_state'] = ($result === true) ? '' : $result;
$state['migration_schema_done'] = ($result === true);
+
+ $this->output_handler->write(array('MIGRATION_SCHEMA_DONE', $name, $elapsed_time), migrator_output_handler_interface::VERBOSITY_NORMAL);
}
else if (!$state['migration_data_done'])
{
try
{
+ $this->output_handler->write(array('MIGRATION_DATA_RUNNING', $name), migrator_output_handler_interface::VERBOSITY_VERBOSE);
+
$this->last_run_migration['task'] = 'process_data_step';
+
+ $elapsed_time = microtime(true);
$result = $this->process_data_step($migration->update_data(), $state['migration_data_state']);
+ $elapsed_time = microtime(true) - $elapsed_time;
$state['migration_data_state'] = ($result === true) ? '' : $result;
$state['migration_data_done'] = ($result === true);
$state['migration_end_time'] = ($result === true) ? time() : 0;
+
+ if ($state['migration_schema_done'])
+ {
+ $this->output_handler->write(array('MIGRATION_DATA_DONE', $name, $elapsed_time), migrator_output_handler_interface::VERBOSITY_NORMAL);
+ }
+ else
+ {
+ $this->output_handler->write(array('MIGRATION_DATA_IN_PROGRESS', $name, $elapsed_time), migrator_output_handler_interface::VERBOSITY_VERY_VERBOSE);
+ }
}
catch (\phpbb\db\migration\exception $e)
{
// Revert the schema changes
- $this->revert($name);
+ $this->revert_do($name);
// Rethrow exception
throw $e;
@@ -279,10 +358,22 @@ class migrator
* check if revert() needs to be called again use the migration_state() method.
*
* @param string $migration String migration name to revert (including any that depend on this migration)
- * @return null
*/
public function revert($migration)
{
+ $this->container->get('dispatcher')->disable();
+ $this->revert_do($migration);
+ $this->container->get('dispatcher')->enable();
+ }
+
+ /**
+ * Effectively runs a single revert step from the last migration installed
+ *
+ * @param string $migration String migration name to revert (including any that depend on this migration)
+ * @return null
+ */
+ protected function revert_do($migration)
+ {
if (!isset($this->migration_state[$migration]))
{
// Not installed
@@ -293,7 +384,7 @@ class migrator
{
if (!empty($state['migration_depends_on']) && in_array($migration, $state['migration_depends_on']))
{
- $this->revert($name);
+ $this->revert_do($name);
}
}
@@ -602,7 +693,7 @@ class migrator
*/
public function unfulfillable($name)
{
- if (isset($this->migration_state[$name]))
+ if (isset($this->migration_state[$name]) || isset($this->fulfillable_migrations[$name]))
{
return false;
}
@@ -623,6 +714,7 @@ class migrator
return $unfulfillable;
}
}
+ $this->fulfillable_migrations[$name] = true;
return false;
}
@@ -683,7 +775,14 @@ class migrator
*/
protected function get_migration($name)
{
- return new $name($this->config, $this->db, $this->db_tools, $this->phpbb_root_path, $this->php_ext, $this->table_prefix);
+ $migration = new $name($this->config, $this->db, $this->db_tools, $this->phpbb_root_path, $this->php_ext, $this->table_prefix);
+
+ if ($migration instanceof ContainerAwareInterface)
+ {
+ $migration->setContainer($this->container);
+ }
+
+ return $migration;
}
/**
diff --git a/phpBB/phpbb/db/migrator_output_handler_interface.php b/phpBB/phpbb/db/migrator_output_handler_interface.php
new file mode 100644
index 0000000000..a923af99f6
--- /dev/null
+++ b/phpBB/phpbb/db/migrator_output_handler_interface.php
@@ -0,0 +1,31 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db;
+
+interface migrator_output_handler_interface
+{
+ const VERBOSITY_QUIET = 0;
+ const VERBOSITY_NORMAL = 1;
+ const VERBOSITY_VERBOSE = 2;
+ const VERBOSITY_VERY_VERBOSE = 3;
+ const VERBOSITY_DEBUG = 4;
+
+ /**
+ * Write output using the configured closure.
+ *
+ * @param string|array $message The message to write or an array containing the language key and all of its parameters.
+ * @param int $verbosity The verbosity of the message.
+ */
+ public function write($message, $verbosity);
+}
diff --git a/travis/sami.conf.php b/phpBB/phpbb/db/null_migrator_output_handler.php
index 8e7cfa42e9..0e8cfbb049 100644
--- a/travis/sami.conf.php
+++ b/phpBB/phpbb/db/null_migrator_output_handler.php
@@ -11,9 +11,14 @@
*
*/
-require __DIR__ . '/../build/' . basename(__FILE__);
+namespace phpbb\db;
-// Removing the versions array key will make Sami use the current branch.
-unset($config['versions']);
-
-return new Sami\Sami($iterator, $config);
+class null_migrator_output_handler implements migrator_output_handler_interface
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function write($message, $verbosity)
+ {
+ }
+}
diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools.php
index 3567570137..775deccc30 100644
--- a/phpBB/phpbb/db/tools.php
+++ b/phpBB/phpbb/db/tools.php
@@ -1512,7 +1512,7 @@ class tools
$sql .= (strpos($column_data[1], '0x') === 0) ? "DEFAULT {$column_data[1]} " : "DEFAULT '{$column_data[1]}' ";
}
- if (!is_null($column_data[1]))
+ if (!is_null($column_data[1]) || (isset($column_data[2]) && $column_data[2] == 'auto_increment'))
{
$sql .= 'NOT NULL';
}
@@ -1574,7 +1574,15 @@ class tools
}
else
{
- $default_val = "'" . $column_data[1] . "'";
+ // Integers need to have 0 instead of empty string as default
+ if (strpos($column_type, 'INT') === 0)
+ {
+ $default_val = '0';
+ }
+ else
+ {
+ $default_val = "'" . $column_data[1] . "'";
+ }
$return_array['null'] = 'NULL';
$sql .= 'NULL ';
}
@@ -2175,7 +2183,7 @@ class tools
}
// no break
case 'mysql_41':
- $statements[] = 'ALTER TABLE ' . $table_name . ' ADD INDEX ' . $index_name . '(' . implode(', ', $column) . ')';
+ $statements[] = 'ALTER TABLE ' . $table_name . ' ADD INDEX ' . $index_name . ' (' . implode(', ', $column) . ')';
break;
case 'mssql':
@@ -2643,7 +2651,7 @@ class tools
AND cols.id = ix.id
WHERE ix.id = object_id('{$table_name}')
AND cols.name = '{$column_name}'
- AND INDEXPROPERTY(ix.id, ix.name, 'IsUnique') = " . ($unique) ? '1' : '0';
+ AND INDEXPROPERTY(ix.id, ix.name, 'IsUnique') = " . ($unique ? '1' : '0');
}
else
{
@@ -2657,7 +2665,7 @@ class tools
AND cols.object_id = ix.object_id
WHERE ix.object_id = object_id('{$table_name}')
AND cols.name = '{$column_name}'
- AND ix.is_unique = " . ($unique) ? '1' : '0';
+ AND ix.is_unique = " . ($unique ? '1' : '0');
}
break;
diff --git a/phpBB/phpbb/di/extension/config.php b/phpBB/phpbb/di/extension/config.php
index 27ebc94bae..7984a783df 100644
--- a/phpBB/phpbb/di/extension/config.php
+++ b/phpBB/phpbb/di/extension/config.php
@@ -39,16 +39,24 @@ class config extends Extension
*/
public function load(array $config, ContainerBuilder $container)
{
- $container->setParameter('core.adm_relative_path', ($this->config_php->get('phpbb_adm_relative_path') ? $this->config_php->get('phpbb_adm_relative_path') : 'adm/'));
- $container->setParameter('core.table_prefix', $this->config_php->get('table_prefix'));
- $container->setParameter('cache.driver.class', $this->convert_30_acm_type($this->config_php->get('acm_type')));
- $container->setParameter('dbal.driver.class', $this->config_php->convert_30_dbms_to_31($this->config_php->get('dbms')));
- $container->setParameter('dbal.dbhost', $this->config_php->get('dbhost'));
- $container->setParameter('dbal.dbuser', $this->config_php->get('dbuser'));
- $container->setParameter('dbal.dbpasswd', $this->config_php->get('dbpasswd'));
- $container->setParameter('dbal.dbname', $this->config_php->get('dbname'));
- $container->setParameter('dbal.dbport', $this->config_php->get('dbport'));
- $container->setParameter('dbal.new_link', defined('PHPBB_DB_NEW_LINK') && PHPBB_DB_NEW_LINK);
+ $parameters = array(
+ 'core.adm_relative_path' => $this->config_php->get('phpbb_adm_relative_path') ? $this->config_php->get('phpbb_adm_relative_path') : 'adm/',
+ 'core.table_prefix' => $this->config_php->get('table_prefix'),
+ 'cache.driver.class' => $this->convert_30_acm_type($this->config_php->get('acm_type')),
+ 'dbal.driver.class' => $this->config_php->convert_30_dbms_to_31($this->config_php->get('dbms')),
+ 'dbal.dbhost' => $this->config_php->get('dbhost'),
+ 'dbal.dbuser' => $this->config_php->get('dbuser'),
+ 'dbal.dbpasswd' => $this->config_php->get('dbpasswd'),
+ 'dbal.dbname' => $this->config_php->get('dbname'),
+ 'dbal.dbport' => $this->config_php->get('dbport'),
+ 'dbal.new_link' => defined('PHPBB_DB_NEW_LINK') && PHPBB_DB_NEW_LINK,
+ );
+ $parameter_bag = $container->getParameterBag();
+
+ foreach ($parameters as $parameter => $value)
+ {
+ $container->setParameter($parameter, $parameter_bag->escapeValue($value));
+ }
}
/**
diff --git a/phpBB/phpbb/error_collector.php b/phpBB/phpbb/error_collector.php
index 7141f83174..bf8efd1065 100644
--- a/phpBB/phpbb/error_collector.php
+++ b/phpBB/phpbb/error_collector.php
@@ -16,15 +16,28 @@ namespace phpbb;
class error_collector
{
var $errors;
+ var $error_types;
- function __construct()
+ /**
+ * Constructor.
+ *
+ * The variable $error_types may be set to a mask of PHP error types that
+ * the collector should keep, e.g. `E_ALL`. If unset, the current value of
+ * the error_reporting() function will be used to determine which errors
+ * the collector will keep.
+ *
+ * @see PHPBB3-13306
+ * @param int|null $error_types
+ */
+ function __construct($error_types = null)
{
$this->errors = array();
+ $this->error_types = $error_types;
}
function install()
{
- set_error_handler(array(&$this, 'error_handler'));
+ set_error_handler(array(&$this, 'error_handler'), ($this->error_types !== null) ? $this->error_types : error_reporting());
}
function uninstall()
diff --git a/phpBB/phpbb/event/dispatcher.php b/phpBB/phpbb/event/dispatcher.php
index 9a786022c2..1c4abeb108 100644
--- a/phpBB/phpbb/event/dispatcher.php
+++ b/phpBB/phpbb/event/dispatcher.php
@@ -14,6 +14,7 @@
namespace phpbb\event;
use Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher;
+use Symfony\Component\EventDispatcher\Event;
/**
* Extension of the Symfony2 EventDispatcher
@@ -32,6 +33,11 @@ use Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher;
class dispatcher extends ContainerAwareEventDispatcher implements dispatcher_interface
{
/**
+ * @var bool
+ */
+ protected $disabled = false;
+
+ /**
* {@inheritdoc}
*/
public function trigger_event($eventName, $data = array())
@@ -40,4 +46,33 @@ class dispatcher extends ContainerAwareEventDispatcher implements dispatcher_int
$this->dispatch($eventName, $event);
return $event->get_data_filtered(array_keys($data));
}
+
+ /**
+ * {@inheritdoc}
+ */
+ public function dispatch($eventName, Event $event = null)
+ {
+ if ($this->disabled)
+ {
+ return $event;
+ }
+
+ return parent::dispatch($eventName, $event);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function disable()
+ {
+ $this->disabled = true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function enable()
+ {
+ $this->disabled = false;
+ }
}
diff --git a/phpBB/phpbb/event/dispatcher_interface.php b/phpBB/phpbb/event/dispatcher_interface.php
index 50a3ef9101..c66aa98260 100644
--- a/phpBB/phpbb/event/dispatcher_interface.php
+++ b/phpBB/phpbb/event/dispatcher_interface.php
@@ -37,4 +37,14 @@ interface dispatcher_interface extends \Symfony\Component\EventDispatcher\EventD
* @return mixed
*/
public function trigger_event($eventName, $data = array());
+
+ /**
+ * Disable the event dispatcher.
+ */
+ public function disable();
+
+ /**
+ * Enable the event dispatcher.
+ */
+ public function enable();
}
diff --git a/phpBB/phpbb/event/kernel_exception_subscriber.php b/phpBB/phpbb/event/kernel_exception_subscriber.php
index 44e87507f9..eb7831ad34 100644
--- a/phpBB/phpbb/event/kernel_exception_subscriber.php
+++ b/phpBB/phpbb/event/kernel_exception_subscriber.php
@@ -14,9 +14,10 @@
namespace phpbb\event;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+use Symfony\Component\HttpFoundation\JsonResponse;
+use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
-use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpFoundation\Response;
class kernel_exception_subscriber implements EventSubscriberInterface
@@ -53,23 +54,55 @@ class kernel_exception_subscriber implements EventSubscriberInterface
*/
public function on_kernel_exception(GetResponseForExceptionEvent $event)
{
- page_header($this->user->lang('INFORMATION'));
-
$exception = $event->getException();
- $this->template->assign_vars(array(
- 'MESSAGE_TITLE' => $this->user->lang('INFORMATION'),
- 'MESSAGE_TEXT' => $exception->getMessage(),
- ));
+ $message = $exception->getMessage();
+
+ if ($exception instanceof \phpbb\exception\exception_interface)
+ {
+ $message = call_user_func_array(array($this->user, 'lang'), array_merge(array($message), $exception->get_parameters()));
+ }
+
+ if (!$event->getRequest()->isXmlHttpRequest())
+ {
+ page_header($this->user->lang('INFORMATION'));
+
+ $this->template->assign_vars(array(
+ 'MESSAGE_TITLE' => $this->user->lang('INFORMATION'),
+ 'MESSAGE_TEXT' => $message,
+ ));
+
+ $this->template->set_filenames(array(
+ 'body' => 'message_body.html',
+ ));
+
+ page_footer(true, false, false);
+
+ $response = new Response($this->template->assign_display('body'), 500);
+ }
+ else
+ {
+ $data = array();
+
+ if (!empty($message))
+ {
+ $data['message'] = $message;
+ }
+
+ if (defined('DEBUG'))
+ {
+ $data['trace'] = $exception->getTrace();
+ }
- $this->template->set_filenames(array(
- 'body' => 'message_body.html',
- ));
+ $response = new JsonResponse($data, 500);
+ }
- page_footer(true, false, false);
+ if ($exception instanceof HttpExceptionInterface)
+ {
+ $response->setStatusCode($exception->getStatusCode());
+ $response->headers->add($exception->getHeaders());
+ }
- $status_code = $exception instanceof HttpException ? $exception->getStatusCode() : 500;
- $response = new Response($this->template->assign_display('body'), $status_code);
$event->setResponse($response);
}
diff --git a/phpBB/phpbb/event/kernel_terminate_subscriber.php b/phpBB/phpbb/event/kernel_terminate_subscriber.php
index 57e4840380..3a709f73fd 100644
--- a/phpBB/phpbb/event/kernel_terminate_subscriber.php
+++ b/phpBB/phpbb/event/kernel_terminate_subscriber.php
@@ -35,7 +35,7 @@ class kernel_terminate_subscriber implements EventSubscriberInterface
public static function getSubscribedEvents()
{
return array(
- KernelEvents::TERMINATE => 'on_kernel_terminate',
+ KernelEvents::TERMINATE => array('on_kernel_terminate', ~PHP_INT_MAX),
);
}
}
diff --git a/phpBB/phpbb/event/php_exporter.php b/phpBB/phpbb/event/php_exporter.php
index badbbb48fd..35144eeeec 100644
--- a/phpBB/phpbb/event/php_exporter.php
+++ b/phpBB/phpbb/event/php_exporter.php
@@ -253,7 +253,7 @@ class php_exporter
public function get_event_name($event_line, $is_dispatch)
{
$event_text_line = $this->file_lines[$event_line];
- $event_text_line = ltrim($event_text_line, "\t");
+ $event_text_line = ltrim($event_text_line, "\t ");
if ($is_dispatch)
{
@@ -389,7 +389,7 @@ class php_exporter
$found_comment_end = false;
while (ltrim($this->file_lines[$this->current_event_line - $current_doc_line], "\t") !== '/**')
{
- if (ltrim($this->file_lines[$this->current_event_line - $current_doc_line], "\t") === '*/')
+ if (ltrim($this->file_lines[$this->current_event_line - $current_doc_line], "\t ") === '*/')
{
$found_comment_end = true;
}
@@ -471,7 +471,7 @@ class php_exporter
{
$find_tag_line = 0;
$found_comment_end = false;
- while (strpos(ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t"), '* @' . $find_tag . ' ') !== 0)
+ while (strpos(ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t "), '* @' . $find_tag . ' ') !== 0)
{
if ($found_comment_end && ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t") === '/**')
{
@@ -482,7 +482,7 @@ class php_exporter
foreach ($disallowed_tags as $disallowed_tag)
{
- if ($found_comment_end && strpos(ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t"), '* @' . $disallowed_tag) === 0)
+ if ($found_comment_end && strpos(ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t "), '* @' . $disallowed_tag) === 0)
{
// Found @var after the @since
throw new \LogicException("Found '@{$disallowed_tag}' information after '@{$find_tag}' for event "
@@ -490,7 +490,7 @@ class php_exporter
}
}
- if (ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t") === '*/')
+ if (ltrim($this->file_lines[$this->current_event_line - $find_tag_line], "\t ") === '*/')
{
$found_comment_end = true;
}
@@ -550,7 +550,7 @@ class php_exporter
public function validate_since($line)
{
$match = array();
- preg_match('#^\* @since (\d+\.\d+\.\d+(?:-(?:a|b|RC|pl)\d+)?)$#', ltrim($line, "\t"), $match);
+ preg_match('#^\* @since (\d+\.\d+\.\d+(?:-(?:a|b|RC|pl)\d+)?)$#', ltrim($line, "\t "), $match);
if (!isset($match[1]))
{
throw new \LogicException("Invalid '@since' information for event "
@@ -570,7 +570,7 @@ class php_exporter
*/
public function validate_event($event_name, $line)
{
- $event = substr(ltrim($line, "\t"), strlen('* @event '));
+ $event = substr(ltrim($line, "\t "), strlen('* @event '));
if ($event !== trim($event))
{
diff --git a/phpBB/phpbb/exception/exception_interface.php b/phpBB/phpbb/exception/exception_interface.php
new file mode 100644
index 0000000000..e8526a35f5
--- /dev/null
+++ b/phpBB/phpbb/exception/exception_interface.php
@@ -0,0 +1,29 @@
+<?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\exception;
+
+/**
+ * Interface exception_interface
+ *
+ * Define an exception which support a language var as message.
+ */
+interface exception_interface
+{
+ /**
+ * Return the arguments associated with the message if it's a language var.
+ *
+ * @return array
+ */
+ public function get_parameters();
+}
diff --git a/phpBB/phpbb/exception/http_exception.php b/phpBB/phpbb/exception/http_exception.php
new file mode 100644
index 0000000000..0e6ffe4f59
--- /dev/null
+++ b/phpBB/phpbb/exception/http_exception.php
@@ -0,0 +1,70 @@
+<?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\exception;
+
+use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
+
+/**
+ * Class http_exception
+ */
+class http_exception extends runtime_exception implements HttpExceptionInterface
+{
+ /**
+ * Http status code.
+ *
+ * @var integer
+ */
+ private $status_code;
+
+ /**
+ * Additional headers to set in the response.
+ *
+ * @var array
+ */
+ private $headers;
+
+ /**
+ * Constructor
+ *
+ * @param integer $status_code The http status code.
+ * @param string $message The Exception message to throw (must be a language variable).
+ * @param array $parameters The parameters to use with the language var.
+ * @param \Exception $previous The previous exception used for the exception chaining.
+ * @param array $headers Additional headers to set in the response.
+ * @param integer $code The Exception code.
+ */
+ public function __construct($status_code, $message = "", array $parameters = array(), \Exception $previous = null, array $headers = array(), $code = 0)
+ {
+ $this->status_code = $status_code;
+ $this->headers = $headers;
+
+ parent::__construct($message, $parameters, $previous, $code);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getStatusCode()
+ {
+ return $this->status_code;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getHeaders()
+ {
+ return $this->headers;
+ }
+}
diff --git a/phpBB/phpbb/exception/runtime_exception.php b/phpBB/phpbb/exception/runtime_exception.php
new file mode 100644
index 0000000000..6568bbf86f
--- /dev/null
+++ b/phpBB/phpbb/exception/runtime_exception.php
@@ -0,0 +1,52 @@
+<?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\exception;
+
+/**
+ * Class runtime_exception
+ *
+ * Define an exception which support a language var as message.
+ */
+class runtime_exception extends \RuntimeException implements exception_interface
+{
+ /**
+ * Parameters to use with the language var.
+ *
+ * @var array
+ */
+ private $parameters;
+
+ /**
+ * Constructor
+ *
+ * @param string $message The Exception message to throw (must be a language variable).
+ * @param array $parameters The parameters to use with the language var.
+ * @param \Exception $previous The previous runtime_exception used for the runtime_exception chaining.
+ * @param integer $code The Exception code.
+ */
+ public function __construct($message = "", array $parameters = array(), \Exception $previous = null, $code = 0)
+ {
+ $this->parameters = $parameters;
+
+ parent::__construct($message, $code, $previous);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_parameters()
+ {
+ return $this->parameters;
+ }
+}
diff --git a/phpBB/phpbb/extension/metadata_manager.php b/phpBB/phpbb/extension/metadata_manager.php
index edca8ee1af..a64d88fe39 100644
--- a/phpBB/phpbb/extension/metadata_manager.php
+++ b/phpBB/phpbb/extension/metadata_manager.php
@@ -177,6 +177,7 @@ class metadata_manager
throw new \phpbb\extension\exception($this->user->lang('FILE_JSON_DECODE_ERR', $this->metadata_file));
}
+ array_walk_recursive($metadata, array($this, 'sanitize_json'));
$this->metadata = $metadata;
return true;
@@ -184,6 +185,17 @@ class metadata_manager
}
/**
+ * Sanitize input from JSON array using htmlspecialchars()
+ *
+ * @param mixed $value Value of array row
+ * @param string $key Key of array row
+ */
+ public function sanitize_json(&$value, $key)
+ {
+ $value = htmlspecialchars($value);
+ }
+
+ /**
* This array handles the cleaning of the array
*
* @return array Contains the cleaned metadata array
@@ -337,30 +349,30 @@ class metadata_manager
public function output_template_data()
{
$this->template->assign_vars(array(
- 'META_NAME' => htmlspecialchars($this->metadata['name']),
- 'META_TYPE' => htmlspecialchars($this->metadata['type']),
- 'META_DESCRIPTION' => (isset($this->metadata['description'])) ? htmlspecialchars($this->metadata['description']) : '',
+ 'META_NAME' => $this->metadata['name'],
+ 'META_TYPE' => $this->metadata['type'],
+ 'META_DESCRIPTION' => (isset($this->metadata['description'])) ? $this->metadata['description'] : '',
'META_HOMEPAGE' => (isset($this->metadata['homepage'])) ? $this->metadata['homepage'] : '',
- 'META_VERSION' => (isset($this->metadata['version'])) ? htmlspecialchars($this->metadata['version']) : '',
- 'META_TIME' => (isset($this->metadata['time'])) ? htmlspecialchars($this->metadata['time']) : '',
- 'META_LICENSE' => htmlspecialchars($this->metadata['license']),
+ 'META_VERSION' => (isset($this->metadata['version'])) ? $this->metadata['version'] : '',
+ 'META_TIME' => (isset($this->metadata['time'])) ? $this->metadata['time'] : '',
+ 'META_LICENSE' => $this->metadata['license'],
- 'META_REQUIRE_PHP' => (isset($this->metadata['require']['php'])) ? htmlspecialchars($this->metadata['require']['php']) : '',
+ 'META_REQUIRE_PHP' => (isset($this->metadata['require']['php'])) ? $this->metadata['require']['php'] : '',
'META_REQUIRE_PHP_FAIL' => !$this->validate_require_php(),
- 'META_REQUIRE_PHPBB' => (isset($this->metadata['extra']['soft-require']['phpbb/phpbb'])) ? htmlspecialchars($this->metadata['extra']['soft-require']['phpbb/phpbb']) : '',
+ 'META_REQUIRE_PHPBB' => (isset($this->metadata['extra']['soft-require']['phpbb/phpbb'])) ? $this->metadata['extra']['soft-require']['phpbb/phpbb'] : '',
'META_REQUIRE_PHPBB_FAIL' => !$this->validate_require_phpbb(),
- 'META_DISPLAY_NAME' => (isset($this->metadata['extra']['display-name'])) ? htmlspecialchars($this->metadata['extra']['display-name']) : '',
+ 'META_DISPLAY_NAME' => (isset($this->metadata['extra']['display-name'])) ? $this->metadata['extra']['display-name'] : '',
));
foreach ($this->metadata['authors'] as $author)
{
$this->template->assign_block_vars('meta_authors', array(
- 'AUTHOR_NAME' => htmlspecialchars($author['name']),
+ 'AUTHOR_NAME' => $author['name'],
'AUTHOR_EMAIL' => (isset($author['email'])) ? $author['email'] : '',
'AUTHOR_HOMEPAGE' => (isset($author['homepage'])) ? $author['homepage'] : '',
- 'AUTHOR_ROLE' => (isset($author['role'])) ? htmlspecialchars($author['role']) : '',
+ 'AUTHOR_ROLE' => (isset($author['role'])) ? $author['role'] : '',
));
}
}
diff --git a/phpBB/phpbb/feed/base.php b/phpBB/phpbb/feed/base.php
index e31854160a..322e2ee9f1 100644
--- a/phpBB/phpbb/feed/base.php
+++ b/phpBB/phpbb/feed/base.php
@@ -67,6 +67,9 @@ abstract class base
*/
var $separator_stats = "\xE2\x80\x94"; // &mdash;
+ /** @var mixed Query result handle */
+ protected $result;
+
/**
* Constructor
*
@@ -229,9 +232,7 @@ abstract class base
function get_item()
{
- static $result;
-
- if (!isset($result))
+ if (!isset($this->result))
{
if (!$this->get_sql())
{
@@ -240,10 +241,10 @@ abstract class base
// Query database
$sql = $this->db->sql_build_query('SELECT', $this->sql);
- $result = $this->db->sql_query_limit($sql, $this->num_items);
+ $this->result = $this->db->sql_query_limit($sql, $this->num_items);
}
- return $this->db->sql_fetchrow($result);
+ return $this->db->sql_fetchrow($this->result);
}
function user_viewprofile($row)
diff --git a/phpBB/phpbb/file_downloader.php b/phpBB/phpbb/file_downloader.php
new file mode 100644
index 0000000000..462b87ca51
--- /dev/null
+++ b/phpBB/phpbb/file_downloader.php
@@ -0,0 +1,120 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb;
+
+class file_downloader
+{
+ /** @var string Error string */
+ protected $error_string = '';
+
+ /** @var int Error number */
+ protected $error_number = 0;
+
+ /**
+ * Retrieve contents from remotely stored file
+ *
+ * @param string $host File host
+ * @param string $directory Directory file is in
+ * @param string $filename Filename of file to retrieve
+ * @param int $port Port to connect to; default: 80
+ * @param int $timeout Connection timeout in seconds; default: 6
+ *
+ * @return mixed File data as string if file can be read and there is no
+ * timeout, false if there were errors or the connection timed out
+ *
+ * @throws \phpbb\exception\runtime_exception If data can't be retrieved and no error
+ * message is returned
+ */
+ public function get($host, $directory, $filename, $port = 80, $timeout = 6)
+ {
+ // Set default values for error variables
+ $this->error_number = 0;
+ $this->error_string = '';
+
+ if ($socket = @fsockopen($host, $port, $this->error_number, $this->error_string, $timeout))
+ {
+ @fputs($socket, "GET $directory/$filename HTTP/1.0\r\n");
+ @fputs($socket, "HOST: $host\r\n");
+ @fputs($socket, "Connection: close\r\n\r\n");
+
+ $timer_stop = time() + $timeout;
+ stream_set_timeout($socket, $timeout);
+
+ $file_info = '';
+ $get_info = false;
+
+ while (!@feof($socket))
+ {
+ if ($get_info)
+ {
+ $file_info .= @fread($socket, 1024);
+ }
+ else
+ {
+ $line = @fgets($socket, 1024);
+ if ($line == "\r\n")
+ {
+ $get_info = true;
+ }
+ else if (stripos($line, '404 not found') !== false)
+ {
+ throw new \phpbb\exception\runtime_exception('FILE_NOT_FOUND', array($filename));
+ }
+ }
+
+ $stream_meta_data = stream_get_meta_data($socket);
+
+ if (!empty($stream_meta_data['timed_out']) || time() >= $timer_stop)
+ {
+ throw new \phpbb\exception\runtime_exception('FSOCK_TIMEOUT');
+ }
+ }
+ @fclose($socket);
+ }
+ else
+ {
+ if ($this->error_string)
+ {
+ $this->error_string = utf8_convert_message($this->error_string);
+ return false;
+ }
+ else
+ {
+ throw new \phpbb\exception\runtime_exception('FSOCK_DISABLED');
+ }
+ }
+
+ return $file_info;
+ }
+
+ /**
+ * Get error string
+ *
+ * @return string Error string
+ */
+ public function get_error_string()
+ {
+ return $this->error_string;
+ }
+
+ /**
+ * Get error number
+ *
+ * @return int Error number
+ */
+ public function get_error_number()
+ {
+ return $this->error_number;
+ }
+}
diff --git a/phpBB/phpbb/log/log.php b/phpBB/phpbb/log/log.php
index 2af8b50b54..0c5205530b 100644
--- a/phpBB/phpbb/log/log.php
+++ b/phpBB/phpbb/log/log.php
@@ -708,6 +708,50 @@ class log implements \phpbb\log\log_interface
}
}
+ /**
+ * Allow modifying or execute extra final filter on log entries
+ *
+ * @event core.get_logs_after
+ * @var array log Array with all our log entries
+ * @var array topic_id_list Array of topic ids, for which we
+ * get the permission data
+ * @var array reportee_id_list Array of additional user IDs we
+ * get the username strings for
+ * @var string mode Mode of the entries we display
+ * @var bool count_logs Do we count all matching entries?
+ * @var int limit Limit the number of entries
+ * @var int offset Offset when fetching the entries
+ * @var mixed forum_id Limit entries to the forum_id,
+ * can also be an array of forum_ids
+ * @var int topic_id Limit entries to the topic_id
+ * @var int user_id Limit entries to the user_id
+ * @var int log_time Limit maximum age of log entries
+ * @var string sort_by SQL order option
+ * @var string keywords Will only return entries that have the
+ * keywords in log_operation or log_data
+ * @var string profile_url URL to the users profile
+ * @var int log_type The type of logs it was filtered
+ * @since 3.1.3-RC1
+ */
+ $vars = array(
+ 'log',
+ 'topic_id_list',
+ 'reportee_id_list',
+ 'mode',
+ 'count_logs',
+ 'limit',
+ 'offset',
+ 'forum_id',
+ 'topic_id',
+ 'user_id',
+ 'log_time',
+ 'sort_by',
+ 'keywords',
+ 'profile_url',
+ 'log_type',
+ );
+ extract($this->dispatcher->trigger_event('core.get_logs_after', compact($vars)));
+
return $log;
}
diff --git a/phpBB/phpbb/message/admin_form.php b/phpBB/phpbb/message/admin_form.php
index 93db59880c..96b8d3499e 100644
--- a/phpBB/phpbb/message/admin_form.php
+++ b/phpBB/phpbb/message/admin_form.php
@@ -178,6 +178,7 @@ class admin_form extends form
'S_CONTACT_ADMIN' => true,
'S_CONTACT_FORM' => $this->config['contact_admin_form_enable'],
'S_IS_REGISTERED' => $this->user->data['is_registered'],
+ 'S_POST_ACTION' => append_sid($this->phpbb_root_path . 'memberlist.' . $this->phpEx, 'mode=contactadmin'),
'CONTACT_INFO' => $l_admin_info,
'MESSAGE' => $this->body,
diff --git a/phpBB/phpbb/message/form.php b/phpBB/phpbb/message/form.php
index 076b41dc07..21d4de0b4d 100644
--- a/phpBB/phpbb/message/form.php
+++ b/phpBB/phpbb/message/form.php
@@ -146,7 +146,7 @@ abstract class form
WHERE user_id = ' . $this->user->data['user_id'];
$this->db->sql_query($sql);
- if ($this->cc_sender)
+ if ($this->cc_sender && $this->user->data['is_registered'])
{
$this->message->cc_sender();
}
diff --git a/phpBB/phpbb/message/topic_form.php b/phpBB/phpbb/message/topic_form.php
index 1e0f2a1945..174643bb81 100644
--- a/phpBB/phpbb/message/topic_form.php
+++ b/phpBB/phpbb/message/topic_form.php
@@ -117,7 +117,7 @@ class topic_form extends form
'TOPIC_NAME' => htmlspecialchars_decode($this->topic_row['topic_title']),
'U_TOPIC' => generate_board_url() . '/viewtopic.' . $this->phpEx . '?f=' . $this->topic_row['forum_id'] . '&t=' . $this->topic_id,
));
-
+ $this->message->set_body($this->body);
$this->message->add_recipient(
$this->recipient_name,
$this->recipient_address,
diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php
index 81b450ebbd..db92170dd8 100644
--- a/phpBB/phpbb/notification/manager.php
+++ b/phpBB/phpbb/notification/manager.php
@@ -24,6 +24,9 @@ class manager
protected $notification_types;
/** @var array */
+ protected $subscription_types;
+
+ /** @var array */
protected $notification_methods;
/** @var ContainerInterface */
@@ -35,6 +38,9 @@ class manager
/** @var \phpbb\config\config */
protected $config;
+ /** @var \phpbb\event\dispatcher_interface */
+ protected $phpbb_dispatcher;
+
/** @var \phpbb\db\driver\driver_interface */
protected $db;
@@ -67,6 +73,7 @@ class manager
* @param ContainerInterface $phpbb_container
* @param \phpbb\user_loader $user_loader
* @param \phpbb\config\config $config
+ * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher
* @param \phpbb\db\driver\driver_interface $db
* @param \phpbb\cache\service $cache
* @param \phpbb\user $user
@@ -78,7 +85,7 @@ class manager
*
* @return \phpbb\notification\manager
*/
- public function __construct($notification_types, $notification_methods, ContainerInterface $phpbb_container, \phpbb\user_loader $user_loader, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, $user, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table)
+ public function __construct($notification_types, $notification_methods, ContainerInterface $phpbb_container, \phpbb\user_loader $user_loader, \phpbb\config\config $config, \phpbb\event\dispatcher_interface $phpbb_dispatcher, \phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, $user, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table)
{
$this->notification_types = $notification_types;
$this->notification_methods = $notification_methods;
@@ -86,6 +93,7 @@ class manager
$this->user_loader = $user_loader;
$this->config = $config;
+ $this->phpbb_dispatcher = $phpbb_dispatcher;
$this->db = $db;
$this->cache = $cache;
$this->user = $user;
@@ -289,7 +297,7 @@ class manager
WHERE notification_time <= " . (int) $time .
(($notification_type_name !== false) ? ' AND ' .
(is_array($notification_type_name) ? $this->db->sql_in_set('notification_type_id', $this->get_notification_type_ids($notification_type_name)) : 'notification_type_id = ' . $this->get_notification_type_id($notification_type_name)) : '') .
- (($item_parent_id !== false) ? ' AND ' . (is_array($item_parent_id) ? $this->db->sql_in_set('item_parent_id', $item_parent_id) : 'item_parent_id = ' . (int) $item_parent_id) : '') .
+ (($item_parent_id !== false) ? ' AND ' . (is_array($item_parent_id) ? $this->db->sql_in_set('item_parent_id', $item_parent_id, false, true) : 'item_parent_id = ' . (int) $item_parent_id) : '') .
(($user_id !== false) ? ' AND ' . (is_array($user_id) ? $this->db->sql_in_set('user_id', $user_id) : 'user_id = ' . (int) $user_id) : '');
$this->db->sql_query($sql);
}
@@ -347,6 +355,26 @@ class manager
// find out which users want to receive this type of notification
$notify_users = $this->get_item_type_class($notification_type_name)->find_users_for_notification($data, $options);
+ /**
+ * Allow filtering the notify_users array for a notification that is about to be sent.
+ * Here, $notify_users is already filtered by f_read and the ignored list included in the options variable
+ *
+ * @event core.notification_manager_add_notifications
+ * @var string notification_type_name The forum id from where the topic belongs
+ * @var array data Data specific for the notification_type_name used will be inserted
+ * @var array notify_users The array of userid that are going to be notified for this notification. Set to array() to cancel.
+ * @var array options The options that were used when this method was called (read only)
+ *
+ * @since 3.1.3-RC1
+ */
+ $vars = array(
+ 'notification_type_name',
+ 'data',
+ 'notify_users',
+ 'options',
+ );
+ extract($this->phpbb_dispatcher->trigger_event('core.notification_manager_add_notifications', compact($vars)));
+
$this->add_notifications_for_users($notification_type_name, $data, $notify_users);
return $notify_users;
@@ -524,33 +552,36 @@ class manager
*/
public function get_subscription_types()
{
- $subscription_types = array();
-
- foreach ($this->notification_types as $type_name => $data)
+ if ($this->subscription_types === null)
{
- $type = $this->get_item_type_class($type_name);
+ $this->subscription_types = array();
- if ($type instanceof \phpbb\notification\type\type_interface && $type->is_available())
+ foreach ($this->notification_types as $type_name => $data)
{
- $options = array_merge(array(
- 'id' => $type->get_type(),
- 'lang' => 'NOTIFICATION_TYPE_' . strtoupper($type->get_type()),
- 'group' => 'NOTIFICATION_GROUP_MISCELLANEOUS',
- ), (($type::$notification_option !== false) ? $type::$notification_option : array()));
+ $type = $this->get_item_type_class($type_name);
- $subscription_types[$options['group']][$options['id']] = $options;
+ if ($type instanceof \phpbb\notification\type\type_interface && $type->is_available())
+ {
+ $options = array_merge(array(
+ 'id' => $type->get_type(),
+ 'lang' => 'NOTIFICATION_TYPE_' . strtoupper($type->get_type()),
+ 'group' => 'NOTIFICATION_GROUP_MISCELLANEOUS',
+ ), (($type::$notification_option !== false) ? $type::$notification_option : array()));
+
+ $this->subscription_types[$options['group']][$options['id']] = $options;
+ }
}
- }
- // Move Miscellaneous to the very last section
- if (isset($subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS']))
- {
- $miscellaneous = $subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS'];
- unset($subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS']);
- $subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS'] = $miscellaneous;
+ // Move Miscellaneous to the very last section
+ if (isset($this->subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS']))
+ {
+ $miscellaneous = $this->subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS'];
+ unset($this->subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS']);
+ $this->subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS'] = $miscellaneous;
+ }
}
- return $subscription_types;
+ return $this->subscription_types;
}
/**
diff --git a/phpBB/phpbb/notification/type/admin_activate_user.php b/phpBB/phpbb/notification/type/admin_activate_user.php
index 038ca3726e..dfc0157558 100644
--- a/phpBB/phpbb/notification/type/admin_activate_user.php
+++ b/phpBB/phpbb/notification/type/admin_activate_user.php
@@ -131,7 +131,7 @@ class admin_activate_user extends \phpbb\notification\type\base
public function get_email_template_variables()
{
$board_url = generate_board_url();
- $username = $this->user_loader->get_username($this->item_id, 'no_profile');
+ $username = $this->user_loader->get_username($this->item_id, 'username');
return array(
'USERNAME' => htmlspecialchars_decode($username),
diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php
index d9e74f2e95..421eff6372 100644
--- a/phpBB/phpbb/notification/type/post.php
+++ b/phpBB/phpbb/notification/type/post.php
@@ -357,6 +357,7 @@ class post extends \phpbb\notification\type\base
{
$tracking_data[$row['user_id']] = $row['mark_time'];
}
+ $this->db->sql_freeresult($result);
return $tracking_data;
}
diff --git a/phpBB/phpbb/notification/type/topic.php b/phpBB/phpbb/notification/type/topic.php
index cf0ec77099..5f57087b73 100644
--- a/phpBB/phpbb/notification/type/topic.php
+++ b/phpBB/phpbb/notification/type/topic.php
@@ -257,6 +257,7 @@ class topic extends \phpbb\notification\type\base
{
$tracking_data[$row['user_id']] = $row['mark_time'];
}
+ $this->db->sql_freeresult($result);
return $tracking_data;
}
diff --git a/phpBB/phpbb/pagination.php b/phpBB/phpbb/pagination.php
index 8aba41d651..7a81c25ad2 100644
--- a/phpBB/phpbb/pagination.php
+++ b/phpBB/phpbb/pagination.php
@@ -21,18 +21,26 @@ class pagination
/** @var \phpbb\user */
protected $user;
+ /** @var \phpbb\controller\helper */
+ protected $helper;
+
+ /** @var \phpbb\event\dispatcher_interface */
+ protected $phpbb_dispatcher;
+
/**
* Constructor
*
- * @param \phpbb\template\template $template
- * @param \phpbb\user $user
- * @param \phpbb\controller\helper $helper
+ * @param \phpbb\template\template $template
+ * @param \phpbb\user $user
+ * @param \phpbb\controller\helper $helper
+ * @param \phpbb\event\dispatcher_interface $phpbb_dispatcher
*/
- public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper)
+ public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\controller\helper $helper, \phpbb\event\dispatcher_interface $phpbb_dispatcher)
{
$this->template = $template;
$this->user = $user;
$this->helper = $helper;
+ $this->phpbb_dispatcher = $phpbb_dispatcher;
}
/**
@@ -50,6 +58,36 @@ class pagination
*/
protected function generate_page_link($base_url, $on_page, $start_name, $per_page)
{
+ // A listener can set this variable to the new pagination URL
+ // to override the generate_page_link() function generated value
+ $generate_page_link_override = false;
+
+ /**
+ * Execute code and/or override generate_page_link()
+ *
+ * To override the generate_page_link() function generated value
+ * set $generate_page_link_override to the new URL value
+ *
+ * @event core.pagination_generate_page_link
+ * @var string base_url is url prepended to all links generated within the function
+ * If you use page numbers inside your controller route, base_url should contains a placeholder (%d)
+ * for the page. Also be sure to specify the pagination path information into the start_name argument
+ * @var string on_page is the page for which we want to generate the link
+ * @var string start_name is the name of the parameter containing the first item of the given page (example: start=20)
+ * If you use page numbers inside your controller route, start name should be the string
+ * that should be removed for the first page (example: /page/%d)
+ * @var int per_page the number of items, posts, etc. to display per page, used to determine the number of pages to produce
+ * @var bool|string generate_page_link_override Shall we return custom pagination link (string URL) or not (false)
+ * @since 3.1.0-RC5
+ */
+ $vars = array('base_url', 'on_page', 'start_name', 'per_page', 'generate_page_link_override');
+ extract($this->phpbb_dispatcher->trigger_event('core.pagination_generate_page_link', compact($vars)));
+
+ if ($generate_page_link_override)
+ {
+ return $generate_page_link_override;
+ }
+
if (!is_string($base_url))
{
if (is_array($base_url['routes']))
diff --git a/phpBB/phpbb/passwords/driver/bcrypt.php b/phpBB/phpbb/passwords/driver/bcrypt.php
index 23add37a56..eab1c3d569 100644
--- a/phpBB/phpbb/passwords/driver/bcrypt.php
+++ b/phpBB/phpbb/passwords/driver/bcrypt.php
@@ -68,7 +68,7 @@ class bcrypt extends base
return false;
}
- if ($hash == $this->hash($password, $salt))
+ if ($this->helper->string_compare($hash, $this->hash($password, $salt)))
{
return true;
}
diff --git a/phpBB/phpbb/passwords/driver/bcrypt_wcf2.php b/phpBB/phpbb/passwords/driver/bcrypt_wcf2.php
index 2d6f897a7b..0eee98d7b7 100644
--- a/phpBB/phpbb/passwords/driver/bcrypt_wcf2.php
+++ b/phpBB/phpbb/passwords/driver/bcrypt_wcf2.php
@@ -78,7 +78,7 @@ class bcrypt_wcf2 extends base
return false;
}
// Works for standard WCF 2.x, i.e. WBB4 and similar
- return $hash === $this->bcrypt->hash($this->bcrypt->hash($password, $salt), $salt);
+ return $this->helper->string_compare($hash, $this->bcrypt->hash($this->bcrypt->hash($password, $salt), $salt));
}
}
}
diff --git a/phpBB/phpbb/passwords/driver/helper.php b/phpBB/phpbb/passwords/driver/helper.php
index 2b3ebce53a..caa65080ac 100644
--- a/phpBB/phpbb/passwords/driver/helper.php
+++ b/phpBB/phpbb/passwords/driver/helper.php
@@ -142,4 +142,24 @@ class helper
}
return $random;
}
+
+ /**
+ * Compare two strings byte by byte
+ *
+ * @param string $string_a The first string
+ * @param string $string_b The second string
+ *
+ * @return bool True if strings are the same, false if not
+ */
+ public function string_compare($string_a, $string_b)
+ {
+ $difference = strlen($string_a) != strlen($string_b);
+
+ for ($i = 0; $i < strlen($string_a) && $i < strlen($string_b); $i++)
+ {
+ $difference |= $string_a[$i] != $string_b[$i];
+ }
+
+ return $difference === 0;
+ }
}
diff --git a/phpBB/phpbb/passwords/driver/md5_mybb.php b/phpBB/phpbb/passwords/driver/md5_mybb.php
index 61ea8dafd8..f631ceae78 100644
--- a/phpBB/phpbb/passwords/driver/md5_mybb.php
+++ b/phpBB/phpbb/passwords/driver/md5_mybb.php
@@ -54,7 +54,7 @@ class md5_mybb extends base
else
{
// Works for myBB 1.1.x, 1.2.x, 1.4.x, 1.6.x
- return $hash === md5(md5($user_row['user_passwd_salt']) . md5($password));
+ return $this->helper->string_compare($hash, md5(md5($user_row['user_passwd_salt']) . md5($password)));
}
}
}
diff --git a/phpBB/phpbb/passwords/driver/md5_phpbb2.php b/phpBB/phpbb/passwords/driver/md5_phpbb2.php
index 86a4b62ea5..bd8cc51e5a 100644
--- a/phpBB/phpbb/passwords/driver/md5_phpbb2.php
+++ b/phpBB/phpbb/passwords/driver/md5_phpbb2.php
@@ -23,6 +23,9 @@ class md5_phpbb2 extends base
/** @var \phpbb\passwords\driver\salted_md5 */
protected $salted_md5;
+ /** @var \phpbb\passwords\driver\helper */
+ protected $helper;
+
/** @var string phpBB root path */
protected $phpbb_root_path;
@@ -34,13 +37,15 @@ class md5_phpbb2 extends base
*
* @param \phpbb\request\request $request phpBB request object
* @param \phpbb\passwords\driver\salted_md5 $salted_md5 Salted md5 driver
+ * @param \phpbb\passwords\driver\helper $helper Driver helper
* @param string $phpbb_root_path phpBB root path
* @param string $php_ext PHP file extension
*/
- public function __construct($request, \phpbb\passwords\driver\salted_md5 $salted_md5, $phpbb_root_path, $php_ext)
+ public function __construct($request, salted_md5 $salted_md5, helper $helper, $phpbb_root_path, $php_ext)
{
$this->request = $request;
$this->salted_md5 = $salted_md5;
+ $this->helper = $helper;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
}
@@ -105,7 +110,7 @@ class md5_phpbb2 extends base
include($this->phpbb_root_path . 'includes/utf/data/recode_basic.' . $this->php_ext);
}
- if (md5($password_old_format) === $hash || md5(\utf8_to_cp1252($password_old_format)) === $hash
+ if ($this->helper->string_compare(md5($password_old_format), $hash) || $this->helper->string_compare(md5(\utf8_to_cp1252($password_old_format)), $hash)
|| $this->salted_md5->check(md5($password_old_format), $hash) === true
|| $this->salted_md5->check(md5(\utf8_to_cp1252($password_old_format)), $hash) === true)
{
diff --git a/phpBB/phpbb/passwords/driver/md5_vb.php b/phpBB/phpbb/passwords/driver/md5_vb.php
index c83c32a596..280b7114c7 100644
--- a/phpBB/phpbb/passwords/driver/md5_vb.php
+++ b/phpBB/phpbb/passwords/driver/md5_vb.php
@@ -54,7 +54,7 @@ class md5_vb extends base
else
{
// Works for vB 3.8.x, 4.x.x, 5.0.x
- return $hash === md5(md5($password) . $user_row['user_passwd_salt']);
+ return $this->helper->string_compare($hash, md5(md5($password) . $user_row['user_passwd_salt']));
}
}
}
diff --git a/phpBB/phpbb/passwords/driver/salted_md5.php b/phpBB/phpbb/passwords/driver/salted_md5.php
index 97a2b9154b..81ac010785 100644
--- a/phpBB/phpbb/passwords/driver/salted_md5.php
+++ b/phpBB/phpbb/passwords/driver/salted_md5.php
@@ -107,7 +107,7 @@ class salted_md5 extends base
return md5($password) === $hash;
}
- return $hash === $this->hash($password, $hash);
+ return $this->helper->string_compare($hash, $this->hash($password, $hash));
}
/**
diff --git a/phpBB/phpbb/passwords/driver/sha1.php b/phpBB/phpbb/passwords/driver/sha1.php
index 0852fd32fc..1abead42cd 100644
--- a/phpBB/phpbb/passwords/driver/sha1.php
+++ b/phpBB/phpbb/passwords/driver/sha1.php
@@ -47,6 +47,6 @@ class sha1 extends base
*/
public function check($password, $hash, $user_row = array())
{
- return (strlen($hash) == 40) ? $hash === sha1($password) : false;
+ return (strlen($hash) == 40) ? $this->helper->string_compare($hash, sha1($password)) : false;
}
}
diff --git a/phpBB/phpbb/passwords/driver/sha1_smf.php b/phpBB/phpbb/passwords/driver/sha1_smf.php
index ec64bd6afb..b30d87265e 100644
--- a/phpBB/phpbb/passwords/driver/sha1_smf.php
+++ b/phpBB/phpbb/passwords/driver/sha1_smf.php
@@ -46,6 +46,6 @@ class sha1_smf extends base
*/
public function check($password, $hash, $user_row = array())
{
- return (strlen($hash) == 40) ? $hash === $this->hash($password, $user_row) : false;
+ return (strlen($hash) == 40) ? $this->helper->string_compare($hash, $this->hash($password, $user_row)) : false;
}
}
diff --git a/phpBB/phpbb/passwords/driver/sha1_wcf1.php b/phpBB/phpbb/passwords/driver/sha1_wcf1.php
index 919fa2bb71..68006486c4 100644
--- a/phpBB/phpbb/passwords/driver/sha1_wcf1.php
+++ b/phpBB/phpbb/passwords/driver/sha1_wcf1.php
@@ -54,7 +54,7 @@ class sha1_wcf1 extends base
else
{
// Works for standard WCF 1.x, i.e. WBB3 and similar
- return $hash === sha1($user_row['user_passwd_salt'] . sha1($user_row['user_passwd_salt'] . sha1($password)));
+ return $this->helper->string_compare($hash, sha1($user_row['user_passwd_salt'] . sha1($user_row['user_passwd_salt'] . sha1($password))));
}
}
}
diff --git a/phpBB/phpbb/passwords/driver/sha_xf1.php b/phpBB/phpbb/passwords/driver/sha_xf1.php
index 7a1ea1450a..9d8f01796e 100644
--- a/phpBB/phpbb/passwords/driver/sha_xf1.php
+++ b/phpBB/phpbb/passwords/driver/sha_xf1.php
@@ -54,8 +54,8 @@ class sha_xf1 extends base
else
{
// Works for xenforo 1.0, 1.1
- if ($hash === sha1(sha1($password) . $user_row['user_passwd_salt'])
- || $hash === hash('sha256', hash('sha256', $password) . $user_row['user_passwd_salt']))
+ if ($this->helper->string_compare($hash, sha1(sha1($password) . $user_row['user_passwd_salt']))
+ || $this->helper->string_compare($hash, hash('sha256', hash('sha256', $password) . $user_row['user_passwd_salt'])))
{
return true;
}
diff --git a/phpBB/phpbb/path_helper.php b/phpBB/phpbb/path_helper.php
index 936564d8b6..5400c1c5a6 100644
--- a/phpBB/phpbb/path_helper.php
+++ b/phpBB/phpbb/path_helper.php
@@ -154,6 +154,7 @@ class path_helper
return $this->web_root_path;
}
+ // We do not need to escape $path_info, $request_uri and $script_name because we can not find their content in the result.
// Path info (e.g. /foo/bar)
$path_info = $this->filesystem->clean_path($this->symfony_request->getPathInfo());
@@ -203,9 +204,12 @@ class path_helper
*/
if ($this->request->is_ajax() && $this->symfony_request->get('_referer'))
{
+ // We need to escape $absolute_board_url because it can be partially concatenated to the result.
+ $absolute_board_url = $this->request->escape($this->symfony_request->getSchemeAndHttpHost() . $this->symfony_request->getBasePath(), true);
+
$referer_web_root_path = $this->get_web_root_path_from_ajax_referer(
$this->symfony_request->get('_referer'),
- $this->symfony_request->getSchemeAndHttpHost() . $this->symfony_request->getBasePath()
+ $absolute_board_url
);
return $this->web_root_path = $this->phpbb_root_path . $referer_web_root_path;
}
@@ -278,10 +282,16 @@ class path_helper
$referer_dir = dirname($referer_dir);
}
- while (strpos($absolute_board_url, $referer_dir) !== 0)
+ while (($dir_position = strpos($absolute_board_url, $referer_dir)) !== 0)
{
$fixed_root_path .= '../';
$referer_dir = dirname($referer_dir);
+
+ // Just return phpbb_root_path if we reach the top directory
+ if ($referer_dir === '.')
+ {
+ return $this->phpbb_root_path;
+ }
}
$fixed_root_path .= substr($absolute_board_url, strlen($referer_dir) + 1);
@@ -445,4 +455,38 @@ class path_helper
return $url_parts['base'] . (($params) ? '?' . $this->glue_url_params($params) : '');
}
+
+ /**
+ * Get a valid page
+ *
+ * @param string $page The page to verify
+ * @param bool $mod_rewrite Whether mod_rewrite is enabled, default: false
+ *
+ * @return string A valid page based on given page and mod_rewrite
+ */
+ public function get_valid_page($page, $mod_rewrite = false)
+ {
+ // We need to be cautious here.
+ // On some situations, the redirect path is an absolute URL, sometimes a relative path
+ // For a relative path, let's prefix it with $phpbb_root_path to point to the correct location,
+ // else we use the URL directly.
+ $url_parts = parse_url($page);
+
+ // URL
+ if ($url_parts === false || empty($url_parts['scheme']) || empty($url_parts['host']))
+ {
+ // Remove 'app.php/' from the page, when rewrite is enabled.
+ // Treat app.php as a reserved file name and remove on mod rewrite
+ // even if it might not be in the phpBB root.
+ if ($mod_rewrite && ($app_position = strpos($page, 'app.' . $this->php_ext . '/')) !== false)
+ {
+ $page = substr($page, 0, $app_position) . substr($page, $app_position + strlen('app.' . $this->php_ext . '/'));
+ }
+
+ // Remove preceding slashes from page name and prepend root path
+ $page = $this->get_phpbb_root_path() . ltrim($page, '/\\');
+ }
+
+ return $page;
+ }
}
diff --git a/phpBB/phpbb/plupload/plupload.php b/phpBB/phpbb/plupload/plupload.php
index 3c686a552f..fcce5b3bd8 100644
--- a/phpBB/phpbb/plupload/plupload.php
+++ b/phpBB/phpbb/plupload/plupload.php
@@ -326,7 +326,7 @@ class plupload
$tmp_file = $this->temporary_filepath($upload['tmp_name']);
- if (!move_uploaded_file($upload['tmp_name'], $tmp_file))
+ if (!phpbb_is_writable($this->temporary_directory) || !move_uploaded_file($upload['tmp_name'], $tmp_file))
{
$this->emit_error(103, 'PLUPLOAD_ERR_MOVE_UPLOADED');
}
diff --git a/phpBB/phpbb/profilefields/type/type_base.php b/phpBB/phpbb/profilefields/type/type_base.php
index c770a0d93c..9b4bada26d 100644
--- a/phpBB/phpbb/profilefields/type/type_base.php
+++ b/phpBB/phpbb/profilefields/type/type_base.php
@@ -133,7 +133,7 @@ abstract class type_base implements type_interface
{
foreach ($field_data[$key] as $lang_id => $options)
{
- $field_data[$key][$lang_id] = explode("\n", $options);
+ $field_data[$key][$lang_id] = is_array($options) ? $options : explode("\n", $options);
}
return $current_value;
@@ -158,7 +158,19 @@ abstract class type_base implements type_interface
}
else
{
- return $this->request->variable($key, '', true);
+ $default_value = '';
+ $lang_fields = array(
+ 'l_lang_name',
+ 'l_lang_explain',
+ 'l_lang_default_value',
+ 'l_lang_options',
+ );
+
+ if (in_array($key, $lang_fields))
+ {
+ $default_value = array(0 => '');
+ }
+ return $this->request->variable($key, $default_value, true);
}
}
diff --git a/phpBB/phpbb/profilefields/type/type_bool.php b/phpBB/phpbb/profilefields/type/type_bool.php
index 0582722833..f6f3f17a6c 100644
--- a/phpBB/phpbb/profilefields/type/type_bool.php
+++ b/phpBB/phpbb/profilefields/type/type_bool.php
@@ -173,7 +173,7 @@ class type_bool extends type_base
}
else
{
- return $this->lang_helper->is_set($field_id, $lang_id, $field_value + 1);
+ return $this->lang_helper->is_set($field_id, $lang_id, $field_value + 1) ? $this->lang_helper->get($field_id, $lang_id, $field_value + 1) : null;
}
}
@@ -352,7 +352,7 @@ class type_bool extends type_base
}
}
- if ($step == 3 && ($field_data[$key] || $action != 'edit') && $key == 'l_lang_options')
+ if ($key == 'l_lang_options' && $this->request->is_set($key))
{
$field_data[$key] = $this->request->variable($key, array(0 => array('')), true);
@@ -367,29 +367,29 @@ class type_bool extends type_base
*/
public function prepare_hidden_fields($step, $key, $action, &$field_data)
{
- if ($key == 'l_lang_options' && $this->request->is_set('l_lang_options'))
+ if ($key == 'field_default_value')
{
- return $this->request->variable($key, array(array('')), true);
- }
- else if ($key == 'field_default_value')
- {
- return $this->request->variable($key, $field_data[$key]);
- }
- else
- {
- if (!$this->request->is_set($key))
- {
- return false;
- }
- else if ($key == 'field_ident' && isset($field_data[$key]))
- {
- return $field_data[$key];
- }
- else
+ $field_length = $this->request->variable('field_length', 0);
+
+ // Do a simple is set check if using checkbox.
+ if ($field_length == 2)
{
- return ($key == 'lang_options') ? $this->request->variable($key, array(''), true) : $this->request->variable($key, '', true);
+ return $this->request->is_set($key);
}
+ return $this->request->variable($key, $field_data[$key], true);
+ }
+
+ $default_lang_options = array(
+ 'l_lang_options' => array(0 => array('')),
+ 'lang_options' => array(0 => ''),
+ );
+
+ if (isset($default_lang_options[$key]) && $this->request->is_set($key))
+ {
+ return $this->request->variable($key, $default_lang_options[$key], true);
}
+
+ return parent::prepare_hidden_fields($step, $key, $action, $field_data);
}
/**
diff --git a/phpBB/phpbb/profilefields/type/type_string_common.php b/phpBB/phpbb/profilefields/type/type_string_common.php
index ff33a7b49c..f5e1992044 100644
--- a/phpBB/phpbb/profilefields/type/type_string_common.php
+++ b/phpBB/phpbb/profilefields/type/type_string_common.php
@@ -18,11 +18,11 @@ abstract class type_string_common extends type_base
protected $validation_options = array(
'CHARS_ANY' => '.*',
'NUMBERS_ONLY' => '[0-9]+',
- 'ALPHA_ONLY' => '[\w]+',
- 'ALPHA_UNDERSCORE' => '[\w_]+',
- 'ALPHA_DOTS' => '[\w.]+',
- 'ALPHA_SPACERS' => '[\w\x20_+\-\[\]]+',
- 'ALPHA_PUNCTUATION' => '[a-zA-Z][\w\.,\-_]+',
+ 'ALPHA_ONLY' => '[a-zA-Z0-9]+',
+ 'ALPHA_UNDERSCORE' => '[\w]+',
+ 'ALPHA_DOTS' => '[a-zA-Z0-9.]+',
+ 'ALPHA_SPACERS' => '[\w\x20+\-\[\]]+',
+ 'ALPHA_PUNCTUATION' => '[a-zA-Z][\w\.,\-]+',
'LETTER_NUM_ONLY' => '[\p{Lu}\p{Ll}0-9]+',
'LETTER_NUM_UNDERSCORE' => '[\p{Lu}\p{Ll}0-9_]+',
'LETTER_NUM_DOTS' => '[\p{Lu}\p{Ll}0-9.]+',
diff --git a/phpBB/phpbb/profilefields/type/type_url.php b/phpBB/phpbb/profilefields/type/type_url.php
index bc8ac869d0..fe0bffd582 100644
--- a/phpBB/phpbb/profilefields/type/type_url.php
+++ b/phpBB/phpbb/profilefields/type/type_url.php
@@ -64,7 +64,7 @@ class type_url extends type_string
return false;
}
- if (!preg_match('#^' . get_preg_expression('url') . '$#i', $field_value))
+ if (!preg_match('#^' . get_preg_expression('url') . '$#iu', $field_value))
{
return $this->user->lang('FIELD_INVALID_URL', $this->get_field_name($field_data['lang_name']));
}
diff --git a/phpBB/phpbb/request/request.php b/phpBB/phpbb/request/request.php
index ea9854894c..56ce3999ed 100644
--- a/phpBB/phpbb/request/request.php
+++ b/phpBB/phpbb/request/request.php
@@ -275,7 +275,7 @@ class request implements \phpbb\request\request_interface
*/
public function file($form_name)
{
- return $this->variable($form_name, array('name' => 'none'), false, \phpbb\request\request_interface::FILES);
+ return $this->variable($form_name, array('name' => 'none'), true, \phpbb\request\request_interface::FILES);
}
/**
@@ -416,4 +416,27 @@ class request implements \phpbb\request\request_interface
{
return $this->input[$super_global];
}
+
+ /**
+ * {@inheritdoc}
+ */
+ public function escape($var, $multibyte)
+ {
+ if (is_array($var))
+ {
+ $result = array();
+ foreach ($var as $key => $value)
+ {
+ $this->type_cast_helper->set_var($key, $key, gettype($key), $multibyte);
+ $result[$key] = $this->escape($value, $multibyte);
+ }
+ $var = $result;
+ }
+ else
+ {
+ $this->type_cast_helper->set_var($var, $var, 'string', $multibyte);
+ }
+
+ return $var;
+ }
}
diff --git a/phpBB/phpbb/request/request_interface.php b/phpBB/phpbb/request/request_interface.php
index 3236f73990..47b3b3a4ed 100644
--- a/phpBB/phpbb/request/request_interface.php
+++ b/phpBB/phpbb/request/request_interface.php
@@ -142,4 +142,14 @@ interface request_interface
* @return array The original array of the requested super global.
*/
public function get_super_global($super_global = \phpbb\request\request_interface::REQUEST);
+
+ /**
+ * Escape a string variable.
+ *
+ * @param mixed $value The contents to fill with
+ * @param bool $multibyte Indicates whether string values may contain UTF-8 characters.
+ * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks.
+ * @return string|array
+ */
+ public function escape($value, $multibyte);
}
diff --git a/phpBB/phpbb/search/fulltext_native.php b/phpBB/phpbb/search/fulltext_native.php
index 48b0f077c7..4d02dd1cbf 100644
--- a/phpBB/phpbb/search/fulltext_native.php
+++ b/phpBB/phpbb/search/fulltext_native.php
@@ -300,7 +300,7 @@ class fulltext_native extends \phpbb\search\base
$this->search_query = $keywords;
$exact_words = array();
- preg_match_all('#([^\\s+\\-|*()]+)(?:$|[\\s+\\-|()])#u', $keywords, $exact_words);
+ preg_match_all('#([^\\s+\\-|()]+)(?:$|[\\s+\\-|()])#u', $keywords, $exact_words);
$exact_words = $exact_words[1];
$common_ids = $words = array();
@@ -434,7 +434,7 @@ class fulltext_native extends \phpbb\search\base
// throw an error if we shall not ignore unexistant words
else if (!$ignore_no_id && sizeof($non_common_words))
{
- trigger_error(sprintf($user->lang['WORDS_IN_NO_POST'], implode($user->lang['COMMA_SEPARATOR'], $non_common_words)));
+ trigger_error(sprintf($this->user->lang['WORDS_IN_NO_POST'], implode($this->user->lang['COMMA_SEPARATOR'], $non_common_words)));
}
unset($non_common_words);
}
@@ -823,6 +823,13 @@ class fulltext_native extends \phpbb\search\base
);
}
+ // if using mysql and the total result count is not calculated yet, get it from the db
+ if (!$total_results && $is_mysql)
+ {
+ // Also count rows for the query as if there was not LIMIT. Add SQL_CALC_FOUND_ROWS to SQL
+ $sql_array['SELECT'] = 'SQL_CALC_FOUND_ROWS ' . $sql_array['SELECT'];
+ }
+
$sql_array['WHERE'] = implode(' AND ', $sql_where);
$sql_array['GROUP_BY'] = ($group_by) ? (($type == 'posts') ? 'p.post_id' : 'p.topic_id') . ', ' . $sort_by_sql[$sort_key] : '';
$sql_array['ORDER_BY'] = $sql_sort;
@@ -838,19 +845,9 @@ class fulltext_native extends \phpbb\search\base
}
$this->db->sql_freeresult($result);
- // if we use mysql and the total result count is not cached yet, retrieve it from the db
if (!$total_results && $is_mysql)
{
- // Count rows for the executed queries. Replace $select within $sql with SQL_CALC_FOUND_ROWS, and run it
- $sql_array_copy = $sql_array;
- $sql_array_copy['SELECT'] = 'SQL_CALC_FOUND_ROWS p.post_id ';
-
- $sql_calc = $this->db->sql_build_query('SELECT', $sql_array_copy);
- unset($sql_array_copy);
-
- $this->db->sql_query($sql_calc);
- $this->db->sql_freeresult($result);
-
+ // Get the number of results as calculated by MySQL
$sql_count = 'SELECT FOUND_ROWS() as total_results';
$result = $this->db->sql_query($sql_count);
$total_results = (int) $this->db->sql_fetchfield('total_results');
diff --git a/phpBB/phpbb/search/fulltext_sphinx.php b/phpBB/phpbb/search/fulltext_sphinx.php
index 79d68d2ae1..eb53ca6d40 100644
--- a/phpBB/phpbb/search/fulltext_sphinx.php
+++ b/phpBB/phpbb/search/fulltext_sphinx.php
@@ -256,8 +256,8 @@ class fulltext_sphinx
array('type', $this->dbtype . ' # mysql or pgsql'),
// This config value sql_host needs to be changed incase sphinx and sql are on different servers
array('sql_host', $dbhost . ' # SQL server host sphinx connects to'),
- array('sql_user', $dbuser),
- array('sql_pass', $dbpasswd),
+ array('sql_user', '[dbuser]'),
+ array('sql_pass', '[dbpassword]'),
array('sql_db', $dbname),
array('sql_port', $dbport . ' # optional, default is 3306 for mysql and 5432 for pgsql'),
array('sql_query_pre', 'SET NAMES \'utf8\''),
@@ -715,6 +715,7 @@ class fulltext_sphinx
),
'ON' => 'p1.topic_id = p2.topic_id',
)),
+ 'WHERE' => 'p2.post_id = ' . ((int) $post_id),
);
$sql = $this->db->sql_build_query('SELECT', $sql_array);
diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php
index da8b848fa5..bedd581725 100644
--- a/phpBB/phpbb/session.php
+++ b/phpBB/phpbb/session.php
@@ -31,10 +31,11 @@ class session
var $update_session_page = true;
/**
- * Extract current session page
- *
- * @param string $root_path current root path (phpbb_root_path)
- */
+ * Extract current session page
+ *
+ * @param string $root_path current root path (phpbb_root_path)
+ * @return array
+ */
static function extract_current_page($root_path)
{
global $request, $symfony_request, $phpbb_filesystem;
@@ -42,8 +43,8 @@ class session
$page_array = array();
// First of all, get the request uri...
- $script_name = $symfony_request->getScriptName();
- $args = explode('&', $symfony_request->getQueryString());
+ $script_name = $request->escape($symfony_request->getScriptName(), true);
+ $args = $request->escape(explode('&', $symfony_request->getQueryString()), true);
// If we are unable to get the script name we use REQUEST_URI as a failover and note it within the page array for easier support...
if (!$script_name)
@@ -61,8 +62,8 @@ class session
// Since some browser do not encode correctly we need to do this with some "special" characters...
// " -> %22, ' => %27, < -> %3C, > -> %3E
- $find = array('"', "'", '<', '>');
- $replace = array('%22', '%27', '%3C', '%3E');
+ $find = array('"', "'", '<', '>', '&quot;', '&lt;', '&gt;');
+ $replace = array('%22', '%27', '%3C', '%3E', '%22', '%3C', '%3E');
foreach ($args as $key => $argument)
{
@@ -87,7 +88,7 @@ class session
$symfony_request_path = $phpbb_filesystem->clean_path($symfony_request->getPathInfo());
if ($symfony_request_path !== '/')
{
- $page_name .= $symfony_request_path;
+ $page_name .= str_replace('%2F', '/', urlencode($symfony_request_path));
}
// current directory within the phpBB root (for example: adm)
@@ -129,6 +130,10 @@ class session
$script_path .= (substr($script_path, -1, 1) == '/') ? '' : '/';
$root_script_path .= (substr($root_script_path, -1, 1) == '/') ? '' : '/';
+ $forum_id = $request->variable('f', 0);
+ // maximum forum id value is maximum value of mediumint unsigned column
+ $forum_id = ($forum_id > 0 && $forum_id < 16777215) ? $forum_id : 0;
+
$page_array += array(
'page_name' => $page_name,
'page_dir' => $page_dir,
@@ -138,7 +143,7 @@ class session
'root_script_path' => str_replace(' ', '%20', htmlspecialchars($root_script_path)),
'page' => $page,
- 'forum' => request_var('f', 0),
+ 'forum' => $forum_id,
);
return $page_array;
@@ -581,6 +586,11 @@ class session
$provider = $provider_collection->get_provider();
$this->data = $provider->autologin();
+ if ($user_id !== false && sizeof($this->data) && $this->data['user_id'] != $user_id)
+ {
+ $this->data = array();
+ }
+
if (sizeof($this->data))
{
$this->cookie_data['k'] = '';
@@ -598,11 +608,18 @@ class session
AND k.user_id = u.user_id
AND k.key_id = '" . $db->sql_escape(md5($this->cookie_data['k'])) . "'";
$result = $db->sql_query($sql);
- $this->data = $db->sql_fetchrow($result);
+ $user_data = $db->sql_fetchrow($result);
+
+ if ($user_id === false || (isset($user_data['user_id']) && $user_id == $user_data['user_id']))
+ {
+ $this->data = $user_data;
+ $bot = false;
+ }
+
$db->sql_freeresult($result);
- $bot = false;
}
- else if ($user_id !== false && !sizeof($this->data))
+
+ if ($user_id !== false && !sizeof($this->data))
{
$this->cookie_data['k'] = '';
$this->cookie_data['u'] = $user_id;
@@ -1050,7 +1067,7 @@ class session
$name_data = rawurlencode($config['cookie_name'] . '_' . $name) . '=' . rawurlencode($cookiedata);
$expire = gmdate('D, d-M-Y H:i:s \\G\\M\\T', $cookietime);
- $domain = (!$config['cookie_domain'] || $config['cookie_domain'] == 'localhost' || $config['cookie_domain'] == '127.0.0.1') ? '' : '; domain=' . $config['cookie_domain'];
+ $domain = (!$config['cookie_domain'] || $config['cookie_domain'] == '127.0.0.1' || strpos($config['cookie_domain'], '.') === false) ? '' : '; domain=' . $config['cookie_domain'];
header('Set-Cookie: ' . $name_data . (($cookietime) ? '; expires=' . $expire : '') . '; path=' . $config['cookie_path'] . $domain . ((!$config['cookie_secure']) ? '' : '; secure') . ';' . (($httponly) ? ' HttpOnly' : ''), false);
}
@@ -1069,7 +1086,7 @@ class session
*/
function check_ban($user_id = false, $user_ips = false, $user_email = false, $return = false)
{
- global $config, $db;
+ global $config, $db, $phpbb_dispatcher;
if (defined('IN_CHECK_BAN') || defined('SKIP_CHECK_BAN'))
{
@@ -1183,6 +1200,20 @@ class session
}
$db->sql_freeresult($result);
+ /**
+ * Event to set custom ban type
+ *
+ * @event core.session_set_custom_ban
+ * @var bool return If $return is false this routine does not return on finding a banned user, it outputs a relevant message and stops execution
+ * @var bool banned Check if user already banned
+ * @var array|false ban_row Ban data
+ * @var string ban_triggered_by Method that caused ban, can be your custom method
+ * @since 3.1.3-RC1
+ */
+ $ban_row = isset($ban_row) ? $ban_row : false;
+ $vars = array('return', 'banned', 'ban_row', 'ban_triggered_by');
+ extract($phpbb_dispatcher->trigger_event('core.session_set_custom_ban', compact($vars)));
+
if ($banned && !$return)
{
global $template, $phpbb_root_path, $phpEx;
diff --git a/phpBB/phpbb/symfony_request.php b/phpBB/phpbb/symfony_request.php
index bf9ddec493..2931cae3cc 100644
--- a/phpBB/phpbb/symfony_request.php
+++ b/phpBB/phpbb/symfony_request.php
@@ -15,6 +15,10 @@ namespace phpbb;
use Symfony\Component\HttpFoundation\Request;
+/**
+ * WARNING: The Symfony request does not escape the input and should be used very carefully
+ * prefer the phpbb request as possible
+ */
class symfony_request extends Request
{
/**
@@ -24,21 +28,12 @@ class symfony_request extends Request
*/
public function __construct(\phpbb\request\request_interface $phpbb_request)
{
- // This function is meant to sanitize the global input arrays
- $sanitizer = function(&$value, $key) {
- $type_cast_helper = new \phpbb\request\type_cast_helper();
- $type_cast_helper->set_var($value, $value, gettype($value), true);
- };
-
$get_parameters = $phpbb_request->get_super_global(\phpbb\request\request_interface::GET);
$post_parameters = $phpbb_request->get_super_global(\phpbb\request\request_interface::POST);
$server_parameters = $phpbb_request->get_super_global(\phpbb\request\request_interface::SERVER);
$files_parameters = $phpbb_request->get_super_global(\phpbb\request\request_interface::FILES);
$cookie_parameters = $phpbb_request->get_super_global(\phpbb\request\request_interface::COOKIE);
- array_walk_recursive($get_parameters, $sanitizer);
- array_walk_recursive($post_parameters, $sanitizer);
-
parent::__construct($get_parameters, $post_parameters, array(), $cookie_parameters, $files_parameters, $server_parameters);
}
}
diff --git a/phpBB/phpbb/template/twig/twig.php b/phpBB/phpbb/template/twig/twig.php
index a3b002f350..bd754d9bbd 100644
--- a/phpBB/phpbb/template/twig/twig.php
+++ b/phpBB/phpbb/template/twig/twig.php
@@ -115,6 +115,11 @@ class twig extends \phpbb\template\base
)
);
+ if (defined('DEBUG'))
+ {
+ $this->twig->addExtension(new \Twig_Extension_Debug());
+ }
+
$lexer = new \phpbb\template\twig\lexer($this->twig);
$this->twig->setLexer($lexer);
@@ -189,13 +194,24 @@ class twig extends \phpbb\template\base
{
$path = $this->phpbb_root_path . trim($directory, '/') . "/{$name}/";
$template_path = $path . 'template/';
+ $theme_path = $path . 'theme/';
+ $is_valid_dir = false;
if (is_dir($template_path))
{
+ $is_valid_dir = true;
+ $paths[] = $template_path;
+ }
+ if (is_dir($theme_path))
+ {
+ $is_valid_dir = true;
+ $paths[] = $theme_path;
+ }
+
+ if ($is_valid_dir)
+ {
// Add the base style directory as a safe directory
$this->twig->getLoader()->addSafeDirectory($path);
-
- $paths[] = $template_path;
}
}
}
@@ -253,25 +269,38 @@ class twig extends \phpbb\template\base
{
$ext_style_template_path = $ext_path . $template_dir['ext_path'];
$ext_style_path = dirname($ext_style_template_path);
+ $ext_style_theme_path = $ext_style_path . 'theme/';
}
else
{
$ext_style_path = $ext_path . 'styles/' . $template_dir['name'] . '/';
$ext_style_template_path = $ext_style_path . 'template/';
+ $ext_style_theme_path = $ext_style_path . 'theme/';
}
}
else
{
$ext_style_path = $ext_path . 'styles/' . $template_dir . '/';
$ext_style_template_path = $ext_style_path . 'template/';
+ $ext_style_theme_path = $ext_style_path . 'theme/';
}
+ $is_valid_dir = false;
if (is_dir($ext_style_template_path))
{
+ $is_valid_dir = true;
+ $paths[] = $ext_style_template_path;
+ }
+ if (is_dir($ext_style_theme_path))
+ {
+ $is_valid_dir = true;
+ $paths[] = $ext_style_theme_path;
+ }
+
+ if ($is_valid_dir)
+ {
// Add the base style directory as a safe directory
$this->twig->getLoader()->addSafeDirectory($ext_style_path);
-
- $paths[] = $ext_style_template_path;
}
}
diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php
index ea98034434..882e9cef26 100644
--- a/phpBB/phpbb/user.php
+++ b/phpBB/phpbb/user.php
@@ -717,7 +717,7 @@ class user extends \phpbb\session
$utc = new \DateTimeZone('UTC');
}
- $time = new \phpbb\datetime($this, "@$gmepoch", $utc);
+ $time = new $this->datetime($this, "@$gmepoch", $utc);
$time->setTimezone($this->timezone);
return $time->format($format, $forcedate);
diff --git a/phpBB/phpbb/user_loader.php b/phpBB/phpbb/user_loader.php
index c9707ee432..24e663b150 100644
--- a/phpBB/phpbb/user_loader.php
+++ b/phpBB/phpbb/user_loader.php
@@ -212,7 +212,7 @@ class user_loader
return '';
}
- if (!function_exists('get_user_rank'))
+ if (!function_exists('phpbb_get_user_rank'))
{
include($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext);
}
@@ -223,7 +223,10 @@ class user_loader
'rank_img_src',
);
- get_user_rank($user['user_rank'], (($user['user_id'] == ANONYMOUS) ? false : $user['user_posts']), $rank['rank_title'], $rank['rank_img'], $rank['rank_img_src']);
+ $user_rank_data = phpbb_get_user_rank($user, (($user['user_id'] == ANONYMOUS) ? false : $user['user_posts']));
+ $rank['rank_title'] = $user_rank_data['title'];
+ $rank['rank_img'] = $user_rank_data['img'];
+ $rank['rank_img_src'] = $user_rank_data['img_src'];
return $rank;
}
diff --git a/phpBB/phpbb/version_helper.php b/phpBB/phpbb/version_helper.php
index 968a57428f..e4f68f5aab 100644
--- a/phpBB/phpbb/version_helper.php
+++ b/phpBB/phpbb/version_helper.php
@@ -50,6 +50,9 @@ class version_helper
/** @var \phpbb\config\config */
protected $config;
+ /** @var \phpbb\file_downloader */
+ protected $file_downloader;
+
/** @var \phpbb\user */
protected $user;
@@ -58,12 +61,14 @@ class version_helper
*
* @param \phpbb\cache\service $cache
* @param \phpbb\config\config $config
+ * @param \phpbb\file_downloader $file_downloader
* @param \phpbb\user $user
*/
- public function __construct(\phpbb\cache\service $cache, \phpbb\config\config $config, \phpbb\user $user)
+ public function __construct(\phpbb\cache\service $cache, \phpbb\config\config $config, \phpbb\file_downloader $file_downloader, \phpbb\user $user)
{
$this->cache = $cache;
$this->config = $config;
+ $this->file_downloader = $file_downloader;
$this->user = $user;
if (defined('PHPBB_QA'))
@@ -239,7 +244,7 @@ class version_helper
*/
public function get_versions($force_update = false, $force_cache = false)
{
- $cache_file = 'versioncheck_' . $this->host . $this->path . $this->file;
+ $cache_file = '_versioncheck_' . $this->host . $this->path . $this->file;
$info = $this->cache->get($cache_file);
@@ -249,16 +254,33 @@ class version_helper
}
else if ($info === false || $force_update)
{
- $errstr = $errno = '';
- $info = get_remote_file($this->host, $this->path, $this->file, $errstr, $errno);
+ try {
+ $info = $this->file_downloader->get($this->host, $this->path, $this->file);
+ }
+ catch (\phpbb\exception\runtime_exception $exception)
+ {
+ $prepare_parameters = array_merge(array($exception->getMessage()), $exception->get_parameters());
+ throw new \RuntimeException(call_user_func_array(array($this->user, 'lang'), $prepare_parameters));
+ }
+ $error_string = $this->file_downloader->get_error_string();
- if (!empty($errstr))
+ if (!empty($error_string))
{
- throw new \RuntimeException($errstr);
+ throw new \RuntimeException($error_string);
}
$info = json_decode($info, true);
+ // Sanitize any data we retrieve from a server
+ if (!empty($info))
+ {
+ $json_sanitizer = function (&$value, $key) {
+ $type_cast_helper = new \phpbb\request\type_cast_helper();
+ $type_cast_helper->set_var($value, $value, gettype($value), true);
+ };
+ array_walk_recursive($info, $json_sanitizer);
+ }
+
if (empty($info['stable']) && empty($info['unstable']))
{
$this->user->add_lang('acp/common');
@@ -266,15 +288,6 @@ class version_helper
throw new \RuntimeException($this->user->lang('VERSIONCHECK_FAIL'));
}
- // Replace & with &amp; on announcement links
- foreach ($info as $stability => $branches)
- {
- foreach ($branches as $branch => $branch_data)
- {
- $info[$stability][$branch]['announcement'] = str_replace('&', '&amp;', $branch_data['announcement']);
- }
- }
-
$info['stable'] = (empty($info['stable'])) ? array() : $info['stable'];
$info['unstable'] = (empty($info['unstable'])) ? $info['stable'] : $info['unstable'];
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 18572a3a6c..a65ba46fc9 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -73,7 +73,6 @@ $current_time = time();
* @var bool preview Whether or not the post is being previewed
* @var bool save Whether or not a draft is being saved
* @var bool load Whether or not a draft is being loaded
-* @var bool delete Whether or not the post is being deleted
* @var bool cancel Whether or not to cancel the form (returns to
* viewtopic or viewforum depending on if the user
* is posting a new topic or editing a post)
@@ -85,6 +84,7 @@ $current_time = time();
* NOTE: Should be actual language strings, NOT
* language keys.
* @since 3.1.0-a1
+* @change 3.1.2-RC1 Removed 'delete' var as it does not exist
*/
$vars = array(
'post_id',
@@ -96,7 +96,6 @@ $vars = array(
'preview',
'save',
'load',
- 'delete',
'cancel',
'refresh',
'mode',
@@ -345,6 +344,48 @@ switch ($mode)
}
break;
}
+/**
+* This event allows you to do extra auth checks and verify if the user
+* has the required permissions
+*
+* Extensions should only change the error and is_authed variables.
+*
+* @event core.modify_posting_auth
+* @var int post_id ID of the post
+* @var int topic_id ID of the topic
+* @var int forum_id ID of the forum
+* @var int draft_id ID of the draft
+* @var int lastclick Timestamp of when the form was last loaded
+* @var bool submit Whether or not the form has been submitted
+* @var bool preview Whether or not the post is being previewed
+* @var bool save Whether or not a draft is being saved
+* @var bool load Whether or not a draft is being loaded
+* @var bool refresh Whether or not to retain previously submitted data
+* @var string mode What action to take if the form has been submitted
+* post|reply|quote|edit|delete|bump|smilies|popup
+* @var array error Any error strings; a non-empty array aborts
+* form submission.
+* NOTE: Should be actual language strings, NOT
+* language keys.
+* @var bool is_authed Does the user have the required permissions?
+* @since 3.1.3-RC1
+*/
+$vars = array(
+ 'post_id',
+ 'topic_id',
+ 'forum_id',
+ 'draft_id',
+ 'lastclick',
+ 'submit',
+ 'preview',
+ 'save',
+ 'load',
+ 'refresh',
+ 'mode',
+ 'error',
+ 'is_authed',
+);
+extract($phpbb_dispatcher->trigger_event('core.modify_posting_auth', compact($vars)));
if (!$is_authed)
{
@@ -870,6 +911,43 @@ if ($submit || $preview || $refresh)
// Parse Attachments - before checksum is calculated
$message_parser->parse_attachments('fileupload', $mode, $forum_id, $submit, $preview, $refresh);
+ /**
+ * This event allows you to modify message text before parsing
+ *
+ * @event core.posting_modify_message_text
+ * @var array post_data Array with post data
+ * @var string mode What action to take if the form is submitted
+ * post|reply|quote|edit|delete|bump|smilies|popup
+ * @var int post_id ID of the post
+ * @var int topic_id ID of the topic
+ * @var int forum_id ID of the forum
+ * @var bool submit Whether or not the form has been submitted
+ * @var bool preview Whether or not the post is being previewed
+ * @var bool save Whether or not a draft is being saved
+ * @var bool load Whether or not a draft is being loaded
+ * @var bool cancel Whether or not to cancel the form (returns to
+ * viewtopic or viewforum depending on if the user
+ * is posting a new topic or editing a post)
+ * @var bool refresh Whether or not to retain previously submitted data
+ * @var object message_parser The message parser object
+ * @since 3.1.2-RC1
+ */
+ $vars = array(
+ 'post_data',
+ 'mode',
+ 'post_id',
+ 'topic_id',
+ 'forum_id',
+ 'submit',
+ 'preview',
+ 'save',
+ 'load',
+ 'cancel',
+ 'refresh',
+ 'message_parser',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.posting_modify_message_text', compact($vars)));
+
// Grab md5 'checksum' of new message
$message_md5 = md5($message_parser->message);
@@ -1125,7 +1203,7 @@ if ($submit || $preview || $refresh)
break;
}
- if (!$auth->acl_get($auth_option, $forum_id))
+ if ($auth_option != '' && !$auth->acl_get($auth_option, $forum_id))
{
// There is a special case where a user edits his post whereby the topic type got changed by an admin/mod.
// Another case would be a mod not having sticky permissions for example but edit permissions.
@@ -1155,6 +1233,34 @@ if ($submit || $preview || $refresh)
}
}
+ /**
+ * This event allows you to define errors before the post action is performed
+ *
+ * @event core.posting_modify_submission_errors
+ * @var array post_data Array with post data
+ * @var string mode What action to take if the form is submitted
+ * post|reply|quote|edit|delete|bump|smilies|popup
+ * @var string page_title Title of the mode page
+ * @var int post_id ID of the post
+ * @var int topic_id ID of the topic
+ * @var int forum_id ID of the forum
+ * @var bool submit Whether or not the form has been submitted
+ * @var array error Any error strings; a non-empty array aborts form submission.
+ * NOTE: Should be actual language strings, NOT language keys.
+ * @since 3.1.0-RC5
+ */
+ $vars = array(
+ 'post_data',
+ 'mode',
+ 'page_title',
+ 'post_id',
+ 'topic_id',
+ 'forum_id',
+ 'submit',
+ 'error',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.posting_modify_submission_errors', compact($vars)));
+
// Store message, sync counters
if (!sizeof($error) && $submit)
{
@@ -1246,9 +1352,87 @@ if ($submit || $preview || $refresh)
// post's poster, not the poster of the current post). See: PHPBB3-11769 for more information.
$post_author_name = ((!$user->data['is_registered'] || $mode == 'edit') && $post_data['username'] !== '') ? $post_data['username'] : '';
+ /**
+ * This event allows you to define errors before the post action is performed
+ *
+ * @event core.posting_modify_submit_post_before
+ * @var array post_data Array with post data
+ * @var array poll Array with poll data
+ * @var array data Array with post data going to be stored in the database
+ * @var string mode What action to take if the form is submitted
+ * post|reply|quote|edit|delete
+ * @var string page_title Title of the mode page
+ * @var int post_id ID of the post
+ * @var int topic_id ID of the topic
+ * @var int forum_id ID of the forum
+ * @var string post_author_name Author name for guest posts
+ * @var bool update_message Boolean if the post message was changed
+ * @var bool update_subject Boolean if the post subject was changed
+ * @var bool submit Whether or not the form has been submitted
+ * @var array error Any error strings; a non-empty array aborts form submission.
+ * NOTE: Should be actual language strings, NOT language keys.
+ * @since 3.1.0-RC5
+ */
+ $vars = array(
+ 'post_data',
+ 'poll',
+ 'data',
+ 'mode',
+ 'page_title',
+ 'post_id',
+ 'topic_id',
+ 'forum_id',
+ 'post_author_name',
+ 'update_message',
+ 'update_subject',
+ 'submit',
+ 'error',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.posting_modify_submit_post_before', compact($vars)));
+
// The last parameter tells submit_post if search indexer has to be run
$redirect_url = submit_post($mode, $post_data['post_subject'], $post_author_name, $post_data['topic_type'], $poll, $data, $update_message, ($update_message || $update_subject) ? true : false);
+ /**
+ * This event allows you to define errors after the post action is performed
+ *
+ * @event core.posting_modify_submit_post_after
+ * @var array post_data Array with post data
+ * @var array poll Array with poll data
+ * @var array data Array with post data going to be stored in the database
+ * @var string mode What action to take if the form is submitted
+ * post|reply|quote|edit|delete
+ * @var string page_title Title of the mode page
+ * @var int post_id ID of the post
+ * @var int topic_id ID of the topic
+ * @var int forum_id ID of the forum
+ * @var string post_author_name Author name for guest posts
+ * @var bool update_message Boolean if the post message was changed
+ * @var bool update_subject Boolean if the post subject was changed
+ * @var string redirect_url URL the user is going to be redirected to
+ * @var bool submit Whether or not the form has been submitted
+ * @var array error Any error strings; a non-empty array aborts form submission.
+ * NOTE: Should be actual language strings, NOT language keys.
+ * @since 3.1.0-RC5
+ */
+ $vars = array(
+ 'post_data',
+ 'poll',
+ 'data',
+ 'mode',
+ 'page_title',
+ 'post_id',
+ 'topic_id',
+ 'forum_id',
+ 'post_author_name',
+ 'update_message',
+ 'update_subject',
+ 'redirect_url',
+ 'submit',
+ 'error',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.posting_modify_submit_post_after', compact($vars)));
+
if ($config['enable_post_confirm'] && !$user->data['is_registered'] && (isset($captcha) && $captcha->is_solved() === true) && ($mode == 'post' || $mode == 'reply' || $mode == 'quote'))
{
$captcha->reset();
@@ -1333,9 +1517,13 @@ if (!sizeof($error) && $preview)
'L_MAX_VOTES' => $user->lang('MAX_OPTIONS_SELECT', (int) $post_data['poll_max_options']),
));
- $parse_poll->message = implode("\n", $post_data['poll_options']);
- $parse_poll->format_display($post_data['enable_bbcode'], $post_data['enable_urls'], $post_data['enable_smilies']);
- $preview_poll_options = explode('<br />', $parse_poll->message);
+ $preview_poll_options = array();
+ foreach ($post_data['poll_options'] as $poll_option)
+ {
+ $parse_poll->message = $poll_option;
+ $parse_poll->format_display($post_data['enable_bbcode'], $post_data['enable_urls'], $post_data['enable_smilies']);
+ $preview_poll_options[] = $parse_poll->message;
+ }
unset($parse_poll);
foreach ($preview_poll_options as $key => $option)
@@ -1552,7 +1740,7 @@ $page_data = array(
'POST_DATE' => ($post_data['post_time']) ? $user->format_date($post_data['post_time']) : '',
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
'TOPIC_TIME_LIMIT' => (int) $post_data['topic_time_limit'],
- 'EDIT_REASON' => $request->variable('edit_reason', ''),
+ 'EDIT_REASON' => $request->variable('edit_reason', '', true),
'SHOW_PANEL' => $request->variable('show_panel', ''),
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id"),
'U_VIEW_TOPIC' => ($mode != 'post') ? append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id") : '',
@@ -1621,7 +1809,6 @@ $page_data = array(
* @var bool preview Whether or not the post is being previewed
* @var bool save Whether or not a draft is being saved
* @var bool load Whether or not a draft is being loaded
-* @var bool delete Whether or not the post is being deleted
* @var bool cancel Whether or not to cancel the form (returns to
* viewtopic or viewforum depending on if the user
* is posting a new topic or editing a post)
@@ -1638,6 +1825,7 @@ $page_data = array(
* s_topic_icons, form_enctype, s_action, s_hidden_fields,
* post_id, topic_id, forum_id, submit, preview, save, load,
* delete, cancel, refresh, error, page_data, message_parser
+* @change 3.1.2-RC1 Removed 'delete' var as it does not exist
*/
$vars = array(
'post_data',
@@ -1655,7 +1843,6 @@ $vars = array(
'preview',
'save',
'load',
- 'delete',
'cancel',
'refresh',
'error',
diff --git a/phpBB/report.php b/phpBB/report.php
index 1b5d3c9d46..3ea6bb40c5 100644
--- a/phpBB/report.php
+++ b/phpBB/report.php
@@ -99,6 +99,24 @@ if ($post_id)
// Check required permissions
$acl_check_ary = array('f_list' => 'POST_NOT_EXIST', 'f_read' => 'USER_CANNOT_READ', 'f_report' => 'USER_CANNOT_REPORT');
+ /**
+ * This event allows you to do extra auth checks and verify if the user
+ * has the required permissions
+ *
+ * @event core.report_post_auth
+ * @var array forum_data All data available from the forums table on this post's forum
+ * @var array report_data All data available from the topics and the posts tables on this post (and its topic)
+ * @var array acl_check_ary An array with the ACL to be tested. The evaluation is made in the same order as the array is sorted
+ * The key is the ACL name and the value is the language key for the error message.
+ * @since 3.1.3-RC1
+ */
+ $vars = array(
+ 'forum_data',
+ 'report_data',
+ 'acl_check_ary',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.report_post_auth', compact($vars)));
+
foreach ($acl_check_ary as $acl => $error)
{
if (!$auth->acl_get($acl, $forum_id))
diff --git a/phpBB/search.php b/phpBB/search.php
index 93f12f4310..cece37f29c 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -101,7 +101,7 @@ if (!$auth->acl_get('u_search') || !$auth->acl_getf_global('f_search') || !$conf
if ($user->load && $config['limit_search_load'] && ($user->load > doubleval($config['limit_search_load'])))
{
$template->assign_var('S_NO_SEARCH', true);
- trigger_error('NO_SEARCH_TIME');
+ trigger_error('NO_SEARCH_LOAD');
}
// It is applicable if the configuration setting is non-zero, and the user cannot
@@ -311,6 +311,26 @@ if ($keywords || $author || $author_id || $search_id || $submit)
// define some variables needed for retrieving post_id/topic_id information
$sort_by_sql = array('a' => 'u.username_clean', 't' => (($show_results == 'posts') ? 'p.post_time' : 't.topic_last_post_time'), 'f' => 'f.forum_id', 'i' => 't.topic_title', 's' => (($show_results == 'posts') ? 'p.post_subject' : 't.topic_title'));
+ /**
+ * Event to modify the SQL parameters before pre-made searches
+ *
+ * @event core.search_modify_param_before
+ * @var string keywords String of the specified keywords
+ * @var array sort_by_sql Array of SQL sorting instructions
+ * @var array ex_fid_ary Array of excluded forum ids
+ * @var array author_id_ary Array of exclusive author ids
+ * @var string search_id The id of the search request
+ * @since 3.1.3-RC1
+ */
+ $vars = array(
+ 'keywords',
+ 'sort_by_sql',
+ 'ex_fid_ary',
+ 'author_id_ary',
+ 'search_id',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.search_modify_param_before', compact($vars)));
+
// pre-made searches
$sql = $field = $l_search_title = '';
if ($search_id)
@@ -553,16 +573,6 @@ if ($keywords || $author || $author_id || $search_id || $submit)
// Grab icons
$icons = $cache->obtain_icons();
- // Output header
- if ($found_more_search_matches)
- {
- $l_search_matches = $user->lang('FOUND_MORE_SEARCH_MATCHES', (int) $total_match_count);
- }
- else
- {
- $l_search_matches = $user->lang('FOUND_SEARCH_MATCHES', (int) $total_match_count);
- }
-
// define some vars for urls
// A single wildcard will make the search results look ugly
$hilit = phpbb_clean_search_string(str_replace(array('+', '-', '|', '(', ')', '&quot;'), ' ', $keywords));
@@ -584,44 +594,6 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$u_search .= ($search_fields != 'all') ? '&amp;sf=' . $search_fields : '';
$u_search .= ($return_chars != 300) ? '&amp;ch=' . $return_chars : '';
- // Check if search backend supports phrase search or not
- $phrase_search_disabled = '';
- if (strpos(html_entity_decode($keywords), '"') !== false && method_exists($search, 'supports_phrase_search'))
- {
- $phrase_search_disabled = $search->supports_phrase_search() ? false : true;
- }
-
- $pagination->generate_template_pagination($u_search, 'pagination', 'start', $total_match_count, $per_page, $start);
-
- $template->assign_vars(array(
- 'SEARCH_TITLE' => $l_search_title,
- 'SEARCH_MATCHES' => $l_search_matches,
- 'SEARCH_WORDS' => $keywords,
- 'SEARCHED_QUERY' => $search->get_search_query(),
- 'IGNORED_WORDS' => (!empty($common_words)) ? implode(' ', $common_words) : '',
-
- 'PHRASE_SEARCH_DISABLED' => $phrase_search_disabled,
-
- 'TOTAL_MATCHES' => $total_match_count,
- 'SEARCH_IN_RESULTS' => ($search_id) ? false : true,
-
- 'S_SELECT_SORT_DIR' => $s_sort_dir,
- 'S_SELECT_SORT_KEY' => $s_sort_key,
- 'S_SELECT_SORT_DAYS' => $s_limit_days,
- 'S_SEARCH_ACTION' => $u_search,
- 'S_SHOW_TOPICS' => ($show_results == 'posts') ? false : true,
-
- 'GOTO_PAGE_IMG' => $user->img('icon_post_target', 'GOTO_PAGE'),
- 'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'),
- 'REPORTED_IMG' => $user->img('icon_topic_reported', 'TOPIC_REPORTED'),
- 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'TOPIC_UNAPPROVED'),
- 'DELETED_IMG' => $user->img('icon_topic_deleted', 'TOPIC_DELETED'),
- 'POLL_IMG' => $user->img('icon_topic_poll', 'TOPIC_POLL'),
- 'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
-
- 'U_SEARCH_WORDS' => $u_search,
- ));
-
if ($sql_where)
{
if ($show_results == 'posts')
@@ -739,9 +711,11 @@ if ($keywords || $author || $author_id || $search_id || $submit)
* @var string sql_select The SQL SELECT string used by search to get topic data
* @var string sql_from The SQL FROM string used by search to get topic data
* @var string sql_where The SQL WHERE string used by search to get topic data
+ * @var int total_match_count The total number of search matches
* @since 3.1.0-a1
+ * @changed 3.1.0-RC5 Added total_match_count
*/
- $vars = array('sql_select', 'sql_from', 'sql_where');
+ $vars = array('sql_select', 'sql_from', 'sql_where', 'total_match_count');
extract($phpbb_dispatcher->trigger_event('core.search_get_topic_data', compact($vars)));
$sql = "SELECT $sql_select
@@ -823,7 +797,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
}
else
{
- $bbcode_bitfield = $text_only_message = '';
+ $text_only_message = '';
$attach_list = array();
while ($row = $db->sql_fetchrow($result))
@@ -843,7 +817,6 @@ if ($keywords || $author || $author_id || $search_id || $submit)
if ($return_chars == -1 || utf8_strlen($text_only_message) < ($return_chars + 3))
{
$row['display_text_only'] = false;
- $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']);
// Does this post have an attachment? If so, add it to the list
if ($row['post_attachment'] && $config['allow_attachments'])
@@ -863,13 +836,6 @@ if ($keywords || $author || $author_id || $search_id || $submit)
unset($text_only_message);
- // Instantiate BBCode if needed
- if ($bbcode_bitfield !== '')
- {
- include_once($phpbb_root_path . 'includes/bbcode.' . $phpEx);
- $bbcode = new bbcode(base64_encode($bbcode_bitfield));
- }
-
// Pull attachment data
if (sizeof($attach_list))
{
@@ -968,7 +934,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$posts_unapproved = ($row['topic_visibility'] == ITEM_APPROVED && $row['topic_posts_unapproved'] && $auth->acl_get('m_approve', $forum_id)) ? true : false;
$topic_deleted = $row['topic_visibility'] == ITEM_DELETED;
$u_mcp_queue = ($topic_unapproved || $posts_unapproved) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=' . (($topic_unapproved) ? 'approve_details' : 'unapproved_posts') . "&amp;t=$result_topic_id", true, $user->session_id) : '';
- $u_mcp_queue = (!$u_mcp_queue && $topic_deleted) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;mode=deleted_topics&amp;t=$result_topic_id", true, $user->session_id) : '';
+ $u_mcp_queue = (!$u_mcp_queue && $topic_deleted) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;mode=deleted_topics&amp;t=$result_topic_id", true, $user->session_id) : $u_mcp_queue;
$row['topic_title'] = preg_replace('#(?!<.*)(?<!\w)(' . $hilit . ')(?!\w|[^<>]*(?:</s(?:cript|tyle))?>)#is', '<span class="posthilit">$1</span>', $row['topic_title']);
@@ -1149,6 +1115,54 @@ if ($keywords || $author || $author_id || $search_id || $submit)
}
unset($rowset);
+ // Output header
+ if ($found_more_search_matches)
+ {
+ $l_search_matches = $user->lang('FOUND_MORE_SEARCH_MATCHES', (int) $total_match_count);
+ }
+ else
+ {
+ $l_search_matches = $user->lang('FOUND_SEARCH_MATCHES', (int) $total_match_count);
+ }
+
+ // Check if search backend supports phrase search or not
+ $phrase_search_disabled = '';
+ if (strpos(html_entity_decode($keywords), '"') !== false && method_exists($search, 'supports_phrase_search'))
+ {
+ $phrase_search_disabled = $search->supports_phrase_search() ? false : true;
+ }
+
+ $pagination->generate_template_pagination($u_search, 'pagination', 'start', $total_match_count, $per_page, $start);
+
+ $template->assign_vars(array(
+ 'SEARCH_TITLE' => $l_search_title,
+ 'SEARCH_MATCHES' => $l_search_matches,
+ 'SEARCH_WORDS' => $keywords,
+ 'SEARCHED_QUERY' => $search->get_search_query(),
+ 'IGNORED_WORDS' => (!empty($common_words)) ? implode(' ', $common_words) : '',
+
+ 'PHRASE_SEARCH_DISABLED' => $phrase_search_disabled,
+
+ 'TOTAL_MATCHES' => $total_match_count,
+ 'SEARCH_IN_RESULTS' => ($search_id) ? false : true,
+
+ 'S_SELECT_SORT_DIR' => $s_sort_dir,
+ 'S_SELECT_SORT_KEY' => $s_sort_key,
+ 'S_SELECT_SORT_DAYS' => $s_limit_days,
+ 'S_SEARCH_ACTION' => $u_search,
+ 'S_SHOW_TOPICS' => ($show_results == 'posts') ? false : true,
+
+ 'GOTO_PAGE_IMG' => $user->img('icon_post_target', 'GOTO_PAGE'),
+ 'NEWEST_POST_IMG' => $user->img('icon_topic_newest', 'VIEW_NEWEST_POST'),
+ 'REPORTED_IMG' => $user->img('icon_topic_reported', 'TOPIC_REPORTED'),
+ 'UNAPPROVED_IMG' => $user->img('icon_topic_unapproved', 'TOPIC_UNAPPROVED'),
+ 'DELETED_IMG' => $user->img('icon_topic_deleted', 'TOPIC_DELETED'),
+ 'POLL_IMG' => $user->img('icon_topic_poll', 'TOPIC_POLL'),
+ 'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'),
+
+ 'U_SEARCH_WORDS' => $u_search,
+ ));
+
/**
* Modify the title and/or load data for the search results page
*
diff --git a/phpBB/styles/prosilver/style.cfg b/phpBB/styles/prosilver/style.cfg
index 1c4315f937..34a7618f86 100644
--- a/phpBB/styles/prosilver/style.cfg
+++ b/phpBB/styles/prosilver/style.cfg
@@ -21,8 +21,8 @@
# General Information about this style
name = prosilver
copyright = © phpBB Limited, 2007
-style_version = 3.1.0-RC4
-phpbb_version = 3.1.0-RC4
+style_version = 3.1.3
+phpbb_version = 3.1.3
# Defining a different template bitfield
# template_bitfield = lNg=
diff --git a/phpBB/styles/prosilver/template/captcha_default.html b/phpBB/styles/prosilver/template/captcha_default.html
index 550962db67..02899bcafd 100644
--- a/phpBB/styles/prosilver/template/captcha_default.html
+++ b/phpBB/styles/prosilver/template/captcha_default.html
@@ -1,5 +1,5 @@
<!-- IF S_TYPE == 1 -->
-<div class="panel">
+<div class="panel captcha-panel">
<div class="inner">
<h3 class="captcha-title">{L_CONFIRMATION}</h3>
@@ -10,7 +10,7 @@
<dl>
<dt><label for="confirm_code">{L_CONFIRM_CODE}{L_COLON}</label></dt>
- <dd><img src="{CONFIRM_IMAGE_LINK}" alt="{L_CONFIRM_CODE}" /></dd>
+ <dd class="captcha captcha-image"><img src="{CONFIRM_IMAGE_LINK}" alt="{L_CONFIRM_CODE}" /></dd>
<dd><input type="text" name="confirm_code" id="confirm_code" size="8" maxlength="8" tabindex="{$CAPTCHA_TAB_INDEX}" class="inputbox narrow" title="{L_CONFIRM_CODE}" />
<!-- IF S_CONFIRM_REFRESH --><input type="submit" name="refresh_vc" id="refresh_vc" class="button2" value="{L_VC_REFRESH}" /><!-- ENDIF -->
<input type="hidden" name="confirm_id" id="confirm_id" value="{CONFIRM_ID}" /></dd>
diff --git a/phpBB/styles/prosilver/template/captcha_qa.html b/phpBB/styles/prosilver/template/captcha_qa.html
index 1671987f63..b8c6678066 100644
--- a/phpBB/styles/prosilver/template/captcha_qa.html
+++ b/phpBB/styles/prosilver/template/captcha_qa.html
@@ -1,5 +1,5 @@
<!-- IF S_TYPE == 1 -->
-<div class="panel">
+<div class="panel captcha-panel">
<div class="inner">
<h3 class="captcha-title">{L_CONFIRMATION}</h3>
@@ -8,7 +8,7 @@
<dl>
<dt><label>{QA_CONFIRM_QUESTION}{L_COLON}</label><br /><span>{L_CONFIRM_QUESTION_EXPLAIN}</span></dt>
- <dd>
+ <dd class="captcha">
<input type="text" tabindex="{$CAPTCHA_TAB_INDEX}" name="qa_answer" id="answer" size="45" class="inputbox autowidth" title="{L_ANSWER}" />
<input type="hidden" name="qa_confirm_id" id="qa_confirm_id" value="{QA_CONFIRM_ID}" />
</dd>
diff --git a/phpBB/styles/prosilver/template/captcha_recaptcha.html b/phpBB/styles/prosilver/template/captcha_recaptcha.html
index bde0c9df13..fee0f7423e 100644
--- a/phpBB/styles/prosilver/template/captcha_recaptcha.html
+++ b/phpBB/styles/prosilver/template/captcha_recaptcha.html
@@ -1,5 +1,5 @@
<!-- IF S_TYPE == 1 -->
-<div class="panel">
+<div class="panel captcha-panel">
<div class="inner">
<h3 class="captcha-title">{L_CONFIRMATION}</h3>
@@ -11,24 +11,16 @@
<!-- IF S_RECAPTCHA_AVAILABLE -->
<dl>
<dt><label>{L_CONFIRM_CODE}{L_COLON}</label><br /><span>{L_RECAPTCHA_EXPLAIN}</span></dt>
- <dd>
- <script type="text/javascript">
- // <![CDATA[
+ <dd class="captcha">
+ <script>
var RecaptchaOptions = {
lang : '{LA_RECAPTCHA_LANG}',
theme : 'clean',
tabindex : <!-- IF $CAPTCHA_TAB_INDEX -->{$CAPTCHA_TAB_INDEX}<!-- ELSE -->10<!-- ENDIF -->
};
- // ]]>
- </script>
- <script type="text/javascript" src="{RECAPTCHA_SERVER}/challenge?k={RECAPTCHA_PUBKEY}{RECAPTCHA_ERRORGET}"></script>
- <script type="text/javascript">
- // <![CDATA[
- <!-- IF S_CONTENT_DIRECTION eq 'rtl' -->
- document.getElementById('recaptcha_table').style.direction = 'ltr';
- <!-- ENDIF -->
- // ]]>
</script>
+ <script src="{RECAPTCHA_SERVER}/challenge?k={RECAPTCHA_PUBKEY}{RECAPTCHA_ERRORGET}"></script>
+
<noscript>
<div>
<object data="{RECAPTCHA_SERVER}/noscript?k={RECAPTCHA_PUBKEY}{RECAPTCHA_ERRORGET}" type="text/html" height="300" width="500"></object><br />
@@ -37,6 +29,7 @@
</div>
</noscript>
+ <a href="http://www.google.com/intl/{LA_RECAPTCHA_LANG}/policies/" target="_blank" class="recaptcha-responsive" style="display: none"><img alt="" width="71" height="36" src="{RECAPTCHA_SERVER}/img/clean/logo.png"></a>
</dd>
</dl>
<!-- ELSE -->
diff --git a/phpBB/styles/prosilver/template/confirm_delete_body.html b/phpBB/styles/prosilver/template/confirm_delete_body.html
index f164b5f357..f0a7ab2bdb 100644
--- a/phpBB/styles/prosilver/template/confirm_delete_body.html
+++ b/phpBB/styles/prosilver/template/confirm_delete_body.html
@@ -2,6 +2,7 @@
<form action="{S_CONFIRM_ACTION}" method="post">
<p>{MESSAGE_TEXT}</p>
+ <!-- IF not S_SHADOW_TOPICS -->
<!-- IF not S_SOFTDELETED and S_ALLOWED_DELETE and S_ALLOWED_SOFTDELETE -->
<label>
<strong>{L_DELETE_PERMANENTLY}{L_COLON}</strong>
@@ -14,6 +15,7 @@
<strong>{L_DELETE_REASON}{L_COLON}</strong><br /><span>{L_DELETE_REASON_EXPLAIN}</span><br />
<input type="text" name="delete_reason" value="" class="inputbox autowidth" maxlength="120" size="45" />
</label>
+ <!-- ENDIF -->
<fieldset class="submit-buttons">
<input type="button" name="confirm" value="{L_YES}" class="button1" />&nbsp;
@@ -33,6 +35,7 @@
<p>{MESSAGE_TEXT}</p>
+ <!-- IF not S_SHADOW_TOPICS -->
<fieldset class="fields1">
<!-- IF not S_SOFTDELETED and S_ALLOWED_DELETE and S_ALLOWED_SOFTDELETE -->
<dl>
@@ -51,6 +54,7 @@
<dd><input type="text" name="delete_reason" id="delete_reason" value="" class="inputbox autowidth" maxlength="120" size="45" /></dd>
</dl>
</fieldset>
+ <!-- ENDIF -->
<fieldset class="submit-buttons">
{S_HIDDEN_FIELDS}
diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js
index 1280ceb8ac..7a377a4973 100644
--- a/phpBB/styles/prosilver/template/forum_fn.js
+++ b/phpBB/styles/prosilver/template/forum_fn.js
@@ -1,5 +1,3 @@
-/* global phpbb */
-
/**
* phpBB3 forum functions
*/
@@ -321,7 +319,8 @@ function parseDocument($container) {
'use strict';
var test = document.createElement('div'),
- oldBrowser = (typeof test.style.borderRadius == 'undefined');
+ oldBrowser = (typeof test.style.borderRadius == 'undefined'),
+ $body = $('body');
/**
* Reset avatar dimensions when changing URL or EMAIL
@@ -348,7 +347,7 @@ function parseDocument($container) {
$container.find('.pagination .dropdown-trigger').click(function() {
var $dropdownContainer = $(this).parent();
// Wait a little bit to make sure the dropdown has activated
- setTimeout(function() {
+ setTimeout(function() {
if ($dropdownContainer.hasClass('dropdown-visible')) {
$dropdownContainer.find('input.inputbox').focus();
}
@@ -356,7 +355,7 @@ function parseDocument($container) {
});
/**
- * Adjust HTML code for IE8 and older versions
+ * Adjust HTML code for IE8 and older versions
*/
if (oldBrowser) {
// Fix .linklist.bulletin lists
@@ -364,7 +363,7 @@ function parseDocument($container) {
}
/**
- * Resize navigation block to keep all links on same line
+ * Resize navigation (breadcrumbs) block to keep all links on same line
*/
$container.find('.navlinks').each(function() {
var $this = $(this),
@@ -377,12 +376,19 @@ function parseDocument($container) {
function resize() {
var width = 0,
- diff = $left.outerWidth(true) - $left.width();
+ diff = $left.outerWidth(true) - $left.width(),
+ minWidth = Math.max($this.width() / 3, 240),
+ maxWidth;
$right.each(function() {
- width += $(this).outerWidth(true);
+ var $this = $(this);
+ if ($this.is(':visible')) {
+ width += $this.outerWidth(true);
+ }
});
- $left.css('max-width', Math.floor($this.width() - width - diff) + 'px');
+
+ maxWidth = $this.width() - width - diff;
+ $left.css('max-width', Math.floor(Math.max(maxWidth, minWidth)) + 'px');
}
resize();
@@ -394,7 +400,6 @@ function parseDocument($container) {
*/
$container.find('.breadcrumbs:not([data-skip-responsive])').each(function() {
var $this = $(this),
- $body = $('body'),
$links = $this.find('.crumb'),
length = $links.length,
classes = ['wrapped-max', 'wrapped-wide', 'wrapped-medium', 'wrapped-small', 'wrapped-tiny'],
@@ -412,7 +417,13 @@ function parseDocument($container) {
// Function that checks breadcrumbs
function check() {
var height = $this.height(),
- width = $body.width();
+ width;
+
+ // Test max-width set in code for .navlinks above
+ width = parseInt($this.css('max-width'));
+ if (!width) {
+ width = $body.width();
+ }
maxHeight = parseInt($this.css('line-height'));
$links.each(function() {
@@ -461,159 +472,173 @@ function parseDocument($container) {
*/
$container.find('.linklist:not(.navlinks, [data-skip-responsive]), .postbody .post-buttons:not([data-skip-responsive])').each(function() {
var $this = $(this),
- $body = $('body'),
filterSkip = '.breadcrumbs, [data-skip-responsive]',
filterLast = '.edit-icon, .quote-icon, [data-last-responsive]',
- persist = $this.attr('id') == 'nav-main',
- $allLinks = $this.children(),
- $links = $allLinks.not(filterSkip),
- html = '<li class="responsive-menu" style="display:none;"><a href="javascript:void(0);" class="responsive-menu-link">&nbsp;</a><div class="dropdown" style="display:none;"><div class="pointer"><div class="pointer-inner" /></div><ul class="dropdown-contents" /></div></li>',
- $filterLastList = $links.filter(filterLast),
- slack = 1; // Vertical slack space (in pixels). Determines how sensitive the script is in determining whether a line-break has occured.
-
- if (!persist) {
- if ($links.is('.rightside')) {
- $links.filter('.rightside:first').before(html);
+ $linksAll = $this.children(),
+ $linksNotSkip = $linksAll.not(filterSkip), // All items that can potentially be hidden
+ $linksFirst = $linksNotSkip.not(filterLast), // The items that will be hidden first
+ $linksLast = $linksNotSkip.filter(filterLast), // The items that will be hidden last
+ persistent = $this.attr('id') == 'nav-main', // Does this list already have a menu (such as quick-links)?
+ html = '<li class="responsive-menu hidden"><a href="javascript:void(0);" class="responsive-menu-link">&nbsp;</a><div class="dropdown hidden"><div class="pointer"><div class="pointer-inner" /></div><ul class="dropdown-contents" /></div></li>',
+ slack = 3; // Vertical slack space (in pixels). Determines how sensitive the script is in determining whether a line-break has occured.
+
+ // Add a hidden drop-down menu to each links list (except those that already have one)
+ if (!persistent) {
+ if ($linksNotSkip.is('.rightside')) {
+ $linksNotSkip.filter('.rightside:first').before(html);
$this.children('.responsive-menu').addClass('rightside');
} else {
$this.append(html);
}
}
- var $item = $this.children('.responsive-menu'),
- $menu = $item.find('.dropdown-contents'),
+ // Set some object references and initial states
+ var $menu = $this.children('.responsive-menu'),
+ $menuContents = $menu.find('.dropdown-contents'),
+ persistentContent = $menuContents.find('li:not(.separator)').length,
lastWidth = false,
compact = false,
- responsive = false,
- copied = false;
+ responsive1 = false,
+ responsive2 = false,
+ copied1 = false,
+ copied2 = false,
+ maxHeight = 0;
+
+ // Find the tallest element in the list (we assume that all elements are roughly the same height)
+ $linksAll.each(function() {
+ if (!$(this).height()) {
+ return;
+ }
+ maxHeight = Math.max(maxHeight, $(this).outerHeight(true));
+ });
+ if (maxHeight < 1) {
+ return; // Shouldn't be possible, but just in case, abort
+ } else {
+ maxHeight = maxHeight + slack;
+ }
function check() {
var width = $body.width();
- if (responsive && width <= lastWidth) {
+ // We can't make it any smaller than this, so just skip
+ if (responsive2 && compact && (width <= lastWidth)) {
return;
}
-
- // Unhide the quick-links menu if it has content
- if (persist) {
- $item.addClass('hidden');
- if ($menu.find('li:not(.separator, .clone)').length || (responsive && $menu.find('li.clone').length)) {
- $item.removeClass('hidden');
- }
- }
+ lastWidth = width;
// Reset responsive and compact layout
- if (responsive) {
- $this.removeClass('responsive');
- $links.css('display', '');
- if (!persist) {
- $item.css('display', 'none');
- }
+ if (responsive1 || responsive2) {
+ $linksNotSkip.removeClass('hidden');
+ $menuContents.children('.clone').addClass('hidden');
+ responsive1 = responsive2 = false;
}
-
if (compact) {
$this.removeClass('compact');
+ compact = false;
}
- // Find tallest element
- var maxHeight = 0;
- $allLinks.each(function() {
- if (!$(this).height()) {
- return;
- }
- maxHeight = Math.max(maxHeight, $(this).outerHeight(true));
- });
-
- if (maxHeight < 1) {
- return;
+ // Unhide the quick-links menu if it has "persistent" content
+ if (persistent && persistentContent) {
+ $menu.removeClass('hidden');
+ } else {
+ $menu.addClass('hidden');
}
// Nothing to resize if block's height is not bigger than tallest element's height
- if ($this.height() <= (maxHeight + slack)) {
+ if ($this.height() <= maxHeight) {
return;
}
- // Enable compact layout, find tallest element, compare to height of whole block
- $this.addClass('compact');
-
- var compactMaxHeight = 0;
- $allLinks.each(function() {
- if (!$(this).height()) {
- return;
- }
- compactMaxHeight = Math.max(compactMaxHeight, $(this).outerHeight(true));
- });
-
- if ($this.height() <= (maxHeight + slack)) {
+ // STEP 1: Compact
+ if (!compact) {
+ $this.addClass('compact');
+ compact = true;
+ }
+ if ($this.height() <= maxHeight) {
return;
}
- // Compact layout did not resize block enough, switch to responsive layout
- $this.removeClass('compact');
- responsive = true;
-
- if (!copied) {
- var clone = $links.clone(true);
- clone.filter('.rightside').each(function() {
- if (persist) {
- $(this).addClass('clone');
- }
- $menu.prepend(this);
- });
-
- if (persist) {
- $menu.prepend(clone.not('.rightside').addClass('clone'));
- } else {
- $menu.prepend(clone.not('.rightside'));
- }
-
- $menu.find('li.leftside, li.rightside').removeClass('leftside rightside');
- $menu.find('.inputbox').parents('li:first').css('white-space', 'normal');
+ // STEP 2: First responsive set - compact
+ if (compact) {
+ $this.removeClass('compact');
+ compact = false;
+ }
+ // Copy the list items to the dropdown
+ if (!copied1) {
+ var $clones1 = $linksFirst.clone();
+ $menuContents.prepend($clones1.addClass('clone clone-first').removeClass('leftside rightside'));
if ($this.hasClass('post-buttons')) {
- $('.button', $menu).removeClass('button icon-button');
- $('.responsive-menu-link', $item).addClass('button icon-button').prepend('<span></span>');
+ $('.button', $menuContents).removeClass('button icon-button');
+ $('.responsive-menu-link', $menu).addClass('button icon-button').prepend('<span></span>');
}
- copied = true;
- } else {
- $menu.children().css('display', '');
+ copied1 = true;
+ }
+ if (!responsive1) {
+ $linksFirst.addClass('hidden');
+ responsive1 = true;
+ $menuContents.children('.clone-first').removeClass('hidden');
+ $menu.removeClass('hidden');
+ }
+ if ($this.height() <= maxHeight) {
+ return;
}
- $item.css('display', '');
- $this.addClass('responsive');
-
- // Try to not hide filtered items
- if ($filterLastList.length) {
- $links.not(filterLast).css('display', 'none');
-
- maxHeight = 0;
- $filterLastList.each(function() {
- if (!$(this).height()) return;
- maxHeight = Math.max(maxHeight, $(this).outerHeight(true));
- });
-
- if ($this.height() <= (maxHeight + slack)) {
- $menu.children().filter(filterLast).css('display', 'none');
- return;
- }
+ // STEP 3: First responsive set + compact
+ if (!compact) {
+ $this.addClass('compact');
+ compact = true;
+ }
+ if ($this.height() <= maxHeight) {
+ return;
}
- // If even responsive isn't enough, use both responsive and compact at same time
- compact = true;
- $this.addClass('compact');
+ // STEP 4: Last responsive set - compact
+ if (!$linksLast.length) {
+ return; // No other links to hide, can't do more
+ }
+ if (compact) {
+ $this.removeClass('compact');
+ compact = false;
+ }
+ // Copy the list items to the dropdown
+ if (!copied2) {
+ var $clones2 = $linksLast.clone();
+ $menuContents.prepend($clones2.addClass('clone clone-last').removeClass('leftside rightside'));
+ copied2 = true;
+ }
+ if (!responsive2) {
+ $linksLast.addClass('hidden');
+ responsive2 = true;
+ $menuContents.children('.clone-last').removeClass('hidden');
+ }
+ if ($this.height() <= maxHeight) {
+ return;
+ }
- $links.css('display', 'none');
+ // STEP 5: Last responsive set + compact
+ if (!compact) {
+ $this.addClass('compact');
+ compact = true;
+ }
}
- if (!persist) {
- phpbb.registerDropdown($item.find('a.responsive-menu-link'), $item.find('.dropdown'));
+ if (!persistent) {
+ phpbb.registerDropdown($menu.find('a.responsive-menu-link'), $menu.find('.dropdown'), false);
}
+ // If there are any images in the links list, run the check again after they have loaded
+ $linksAll.find('img').each(function() {
+ $(this).load(function() {
+ check();
+ });
+ });
+
check();
$(window).resize(check);
});
/**
- * Do not run functions below for old browsers
+ * Do not run functions below for old browsers
*/
if (oldBrowser) {
return;
@@ -747,7 +772,7 @@ function parseDocument($container) {
$this.addClass('show-header');
}
});
-
+
headersLength = headers.length;
// Add header text to each cell as <dfn>
@@ -804,7 +829,6 @@ function parseDocument($container) {
*/
$container.find('#tabs, #minitabs').not('[data-skip-responsive]').each(function() {
var $this = $(this),
- $body = $('body'),
$ul = $this.children(),
$tabs = $ul.children().not('[data-skip-responsive]'),
$links = $tabs.children('a'),
diff --git a/phpBB/styles/prosilver/template/forumlist_body.html b/phpBB/styles/prosilver/template/forumlist_body.html
index 22859b2452..f2e03630ff 100644
--- a/phpBB/styles/prosilver/template/forumlist_body.html
+++ b/phpBB/styles/prosilver/template/forumlist_body.html
@@ -26,7 +26,9 @@
<!-- EVENT forumlist_body_category_header_after -->
<!-- IF not forumrow.S_IS_CAT -->
+ <!-- EVENT forumlist_body_forum_row_before -->
<li class="row">
+ <!-- EVENT forumlist_body_forum_row_prepend -->
<dl class="icon {forumrow.FORUM_IMG_STYLE}">
<dt title="{forumrow.FORUM_FOLDER_IMG_ALT}">
<!-- IF forumrow.S_UNREAD_FORUM --><a href="{forumrow.U_VIEWFORUM}" class="icon-link"></a><!-- ENDIF -->
@@ -43,7 +45,7 @@
<!-- EVENT forumlist_body_subforums_before -->
<br /><strong>{forumrow.L_SUBFORUM_STR}{L_COLON}</strong>
<!-- BEGIN subforum -->
- <a href="{forumrow.subforum.U_SUBFORUM}" class="subforum<!-- IF forumrow.subforum.S_UNREAD --> unread<!-- ELSE --> read<!-- ENDIF -->" title="<!-- IF forumrow.subforum.UNREAD -->{L_UNREAD_POSTS}<!-- ELSE -->{L_NO_UNREAD_POSTS}<!-- ENDIF -->">{forumrow.subforum.SUBFORUM_NAME}</a><!-- IF not forumrow.subforum.S_LAST_ROW -->{L_COMMA_SEPARATOR}<!-- ENDIF -->
+ <a href="{forumrow.subforum.U_SUBFORUM}" class="subforum<!-- IF forumrow.subforum.S_UNREAD --> unread<!-- ELSE --> read<!-- ENDIF -->" title="<!-- IF forumrow.subforum.S_UNREAD -->{L_UNREAD_POSTS}<!-- ELSE -->{L_NO_UNREAD_POSTS}<!-- ENDIF -->">{forumrow.subforum.SUBFORUM_NAME}</a><!-- IF not forumrow.subforum.S_LAST_ROW -->{L_COMMA_SEPARATOR}<!-- ENDIF -->
<!-- END subforum -->
<!-- EVENT forumlist_body_subforums_after -->
<!-- ENDIF -->
@@ -78,9 +80,13 @@
{L_POST_BY_AUTHOR} {forumrow.LAST_POSTER_FULL}
<!-- IF not S_IS_BOT --><a href="{forumrow.U_LAST_POST}">{LAST_POST_IMG}</a> <!-- ENDIF --><br />{forumrow.LAST_POST_TIME}<!-- ELSE -->{L_NO_POSTS}<br />&nbsp;<!-- ENDIF --></span>
</dd>
+ <!-- ELSE -->
+ <dd>&nbsp;</dd>
<!-- ENDIF -->
</dl>
+ <!-- EVENT forumlist_body_forum_row_append -->
</li>
+ <!-- EVENT forumlist_body_forum_row_after -->
<!-- ENDIF -->
<!-- IF forumrow.S_LAST_ROW -->
diff --git a/phpBB/styles/prosilver/template/index_body.html b/phpBB/styles/prosilver/template/index_body.html
index 1e1eb22c6f..f620b6e966 100644
--- a/phpBB/styles/prosilver/template/index_body.html
+++ b/phpBB/styles/prosilver/template/index_body.html
@@ -13,6 +13,8 @@
<!-- INCLUDE forumlist_body.html -->
+<!-- EVENT index_body_forumlist_body_after -->
+
<!-- IF not S_USER_LOGGED_IN and not S_IS_BOT -->
<form method="post" action="{S_LOGIN_ACTION}" class="headerspace">
<h3><a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a><!-- IF S_REGISTER_ENABLED -->&nbsp; &bull; &nbsp;<a href="{U_REGISTER}">{L_REGISTER}</a><!-- ENDIF --></h3>
diff --git a/phpBB/styles/prosilver/template/mcp_front.html b/phpBB/styles/prosilver/template/mcp_front.html
index 44295611cf..8fe7dfdf65 100644
--- a/phpBB/styles/prosilver/template/mcp_front.html
+++ b/phpBB/styles/prosilver/template/mcp_front.html
@@ -2,6 +2,8 @@
<h2>{PAGE_TITLE}</h2>
+<!-- EVENT mcp_front_latest_unapproved_before -->
+
<!-- IF S_SHOW_UNAPPROVED -->
<form id="mcp_queue" method="post" action="{S_MCP_QUEUE_ACTION}">
@@ -59,6 +61,8 @@
</form>
<!-- ENDIF -->
+<!-- EVENT mcp_front_latest_reported_before -->
+
<!-- IF S_SHOW_REPORTS -->
<div class="panel">
<div class="inner">
@@ -100,6 +104,8 @@
</div>
<!-- ENDIF -->
+<!-- EVENT mcp_front_latest_reported_pms_before -->
+
<!-- IF S_SHOW_PM_REPORTS -->
<div class="panel">
<div class="inner">
@@ -141,6 +147,8 @@
</div>
<!-- ENDIF -->
+<!-- EVENT mcp_front_latest_logs_before -->
+
<!-- IF S_SHOW_LOGS -->
<div class="panel">
<div class="inner">
@@ -180,4 +188,6 @@
</div>
<!-- ENDIF -->
+<!-- EVENT mcp_front_latest_logs_after -->
+
<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/prosilver/template/mcp_logs.html b/phpBB/styles/prosilver/template/mcp_logs.html
index eaa3838f17..4f74085968 100644
--- a/phpBB/styles/prosilver/template/mcp_logs.html
+++ b/phpBB/styles/prosilver/template/mcp_logs.html
@@ -22,10 +22,10 @@
<table class="table1">
<thead>
<tr>
- <th>{L_USERNAME}</th>
- <th style="text-align: center">{L_IP}</th>
- <th style="text-align: center">{L_TIME}</th>
- <th>{L_ACTION}</th>
+ <th class="name">{L_USERNAME}</th>
+ <th class="center">{L_IP}</th>
+ <th class="center">{L_TIME}</th>
+ <th class="name">{L_ACTION}</th>
<!-- IF S_CLEAR_ALLOWED --><th>{L_MARK}</th><!-- ENDIF -->
</tr>
</thead>
@@ -34,8 +34,8 @@
<!-- BEGIN log -->
<!-- IF log.S_ROW_COUNT is even --><tr class="bg1"><!-- ELSE --><tr class="bg2"><!-- ENDIF -->
<td>{log.USERNAME}</td>
- <td style="text-align: center">{log.IP}</td>
- <td style="text-align: center">{log.DATE}</td>
+ <td class="center">{log.IP}</td>
+ <td class="center">{log.DATE}</td>
<td>{log.ACTION}<br />
{log.DATA}
</td>
diff --git a/phpBB/styles/prosilver/template/mcp_notes_user.html b/phpBB/styles/prosilver/template/mcp_notes_user.html
index ec317b141a..3e8d47eb9d 100644
--- a/phpBB/styles/prosilver/template/mcp_notes_user.html
+++ b/phpBB/styles/prosilver/template/mcp_notes_user.html
@@ -65,9 +65,9 @@
<table class="table1">
<thead>
<tr>
- <th>{L_REPORT_BY}</th>
- <th style="text-align: center">{L_IP}</th>
- <th style="text-align: center">{L_TIME}</th>
+ <th class="name reportby">{L_REPORT_BY}</th>
+ <th class="center">{L_IP}</th>
+ <th class="center">{L_TIME}</th>
<th>{L_ACTION_NOTE}</th>
<!-- IF S_CLEAR_ALLOWED --><th>{L_MARK}</th><!-- ENDIF -->
</tr>
@@ -76,11 +76,11 @@
<!-- BEGIN usernotes -->
<!-- IF usernotes.S_ROW_COUNT is even --><tr class="bg1"><!-- ELSE --><tr class="bg2"><!-- ENDIF -->
<td>{usernotes.REPORT_BY}</td>
- <td style="text-align: center">{usernotes.IP}</td>
- <td style="text-align: center">{usernotes.REPORT_AT}</td>
+ <td class="center">{usernotes.IP}</td>
+ <td class="center">{usernotes.REPORT_AT}</td>
<td>{usernotes.ACTION}</td>
- <!-- IF S_CLEAR_ALLOWED --><td style="width: 5%; text-align: center;"><input type="checkbox" name="marknote[]" id="note-{usernotes.ID}" value="{usernotes.ID}" /></td><!-- ENDIF -->
+ <!-- IF S_CLEAR_ALLOWED --><td class="center" style="width: 5%;"><input type="checkbox" name="marknote[]" id="note-{usernotes.ID}" value="{usernotes.ID}" /></td><!-- ENDIF -->
</tr>
<!-- BEGINELSE -->
<tr>
diff --git a/phpBB/styles/prosilver/template/memberlist_email.html b/phpBB/styles/prosilver/template/memberlist_email.html
index 865f0b883c..4a9f764d07 100644
--- a/phpBB/styles/prosilver/template/memberlist_email.html
+++ b/phpBB/styles/prosilver/template/memberlist_email.html
@@ -40,21 +40,21 @@
</dl>
<!-- ELSEIF S_CONTACT_ADMIN-->
<dl>
- <dt><label>{L_RECIPIENT}:</label></dt>
+ <dt><label>{L_RECIPIENT}{L_COLON}</label></dt>
<dd><strong>{L_ADMINISTRATOR}</strong></dd>
</dl>
<!-- IF not S_IS_REGISTERED -->
<dl>
- <dt><label for="email">{L_SENDER_EMAIL_ADDRESS}:</label></dt>
+ <dt><label for="email">{L_SENDER_EMAIL_ADDRESS}{L_COLON}</label></dt>
<dd><input class="inputbox autowidth" type="text" name="email" id="email" size="50" maxlength="100" tabindex="1" value="{EMAIL}" /></dd>
</dl>
<dl>
- <dt><label for="name">{L_SENDER_NAME}:</label></dt>
+ <dt><label for="name">{L_SENDER_NAME}{L_COLON}</label></dt>
<dd><input class="inputbox autowidth" type="text" name="name" id="name" size="50" tabindex="2" value="{NAME}" /></dd>
</dl>
<!-- ENDIF -->
<dl>
- <dt><label for="subject">{L_SUBJECT}:</label></dt>
+ <dt><label for="subject">{L_SUBJECT}{L_COLON}</label></dt>
<dd><input class="inputbox autowidth" type="text" name="subject" id="subject" size="50" tabindex="3" value="{SUBJECT}" /></dd>
</dl>
<!-- ELSE -->
@@ -77,10 +77,12 @@
<span>{L_EMAIL_BODY_EXPLAIN}</span></dt>
<dd><textarea class="inputbox" name="message" id="message" rows="15" cols="76" tabindex="4">{MESSAGE}</textarea></dd>
</dl>
+ <!-- IF S_REGISTERED_USER -->
<dl>
<dt>&nbsp;</dt>
- <dd><label for="cc_email"><input type="checkbox" name="cc_email" id="cc_email" value="1" checked="checked" tabindex="5" /> {L_CC_EMAIL}</label></dd>
+ <dd><label for="cc_sender"><input type="checkbox" name="cc_sender" id="cc_sender" value="1" checked="checked" tabindex="5" /> {L_CC_SENDER}</label></dd>
</dl>
+ <!-- ENDIF -->
</fieldset>
</div>
diff --git a/phpBB/styles/prosilver/template/memberlist_search.html b/phpBB/styles/prosilver/template/memberlist_search.html
index 4fba966151..ef5d29a8fa 100644
--- a/phpBB/styles/prosilver/template/memberlist_search.html
+++ b/phpBB/styles/prosilver/template/memberlist_search.html
@@ -6,6 +6,7 @@
<p>{L_FIND_USERNAME_EXPLAIN}</p>
+ <!-- EVENT memberlist_search_fields_before -->
<fieldset class="fields1 column1">
<dl style="overflow: visible;">
<dt><label for="username">{L_USERNAME}{L_COLON}</label></dt>
@@ -39,6 +40,7 @@
<dt><label for="search_group_id">{L_GROUP}{L_COLON}</label></dt>
<dd><select name="search_group_id" id="search_group_id">{S_GROUP_SELECT}</select></dd>
</dl>
+ <!-- EVENT memberlist_search_sorting_options_before -->
<dl>
<dt><label for="sk" class="label3">{L_SORT_BY}{L_COLON}</label></dt>
<dd><select name="sk" id="sk">{S_SORT_OPTIONS}</select> <select name="sd">{S_ORDER_SELECT}</select></dd>
@@ -66,6 +68,7 @@
<dd><input class="inputbox medium" type="text" name="ip" id="ip" value="{IP}" /></dd>
</dl>
<!-- ENDIF -->
+ <!-- EVENT memberlist_search_fields_after -->
</fieldset>
<div class="clear"></div>
diff --git a/phpBB/styles/prosilver/template/memberlist_view.html b/phpBB/styles/prosilver/template/memberlist_view.html
index eb151af8df..5d8e6ec8a8 100644
--- a/phpBB/styles/prosilver/template/memberlist_view.html
+++ b/phpBB/styles/prosilver/template/memberlist_view.html
@@ -20,6 +20,7 @@
<dt>{L_USERNAME}{L_COLON}</dt>
<dd>
<!-- IF USER_COLOR --><span style="color: {USER_COLOR}; font-weight: bold;"><!-- ELSE --><span><!-- ENDIF -->{USERNAME}</span>
+ <!-- IF U_EDIT_SELF --> [ <a href="{U_EDIT_SELF}">{L_EDIT_PROFILE}</a> ]<!-- ENDIF -->
<!-- IF U_USER_ADMIN --> [ <a href="{U_USER_ADMIN}">{L_USER_ADMIN}</a> ]<!-- ENDIF -->
<!-- IF U_USER_BAN --> [ <a href="{U_USER_BAN}">{L_USER_BAN}</a> ]<!-- ENDIF -->
<!-- IF U_SWITCH_PERMISSIONS --> [ <a href="{U_SWITCH_PERMISSIONS}">{L_USE_PERMISSIONS}</a> ]<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/navbar_footer.html b/phpBB/styles/prosilver/template/navbar_footer.html
index 4a9275c898..b5a705d567 100644
--- a/phpBB/styles/prosilver/template/navbar_footer.html
+++ b/phpBB/styles/prosilver/template/navbar_footer.html
@@ -1,4 +1,4 @@
-<div class="navbar">
+<div class="navbar" role="navigation">
<div class="inner">
<ul id="nav-footer" class="linklist bulletin" role="menubar">
diff --git a/phpBB/styles/prosilver/template/overall_footer.html b/phpBB/styles/prosilver/template/overall_footer.html
index 275859ac97..8749ce60e8 100644
--- a/phpBB/styles/prosilver/template/overall_footer.html
+++ b/phpBB/styles/prosilver/template/overall_footer.html
@@ -3,7 +3,7 @@
<!-- EVENT overall_footer_page_body_after -->
-<div id="page-footer">
+<div id="page-footer" role="contentinfo">
<!-- INCLUDE navbar_footer.html -->
<div class="copyright">
@@ -48,5 +48,7 @@
<!-- IF S_PLUPLOAD --><!-- INCLUDE plupload.html --><!-- ENDIF -->
{$SCRIPTS}
+<!-- EVENT overall_footer_body_after -->
+
</body>
</html>
diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html
index ac17421163..e0c8e51d25 100644
--- a/phpBB/styles/prosilver/template/overall_header.html
+++ b/phpBB/styles/prosilver/template/overall_header.html
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
-<meta charset="utf-8">
-<meta name="viewport" content="width=device-width" />
+<meta charset="utf-8" />
+<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>
@@ -59,7 +59,7 @@
<div id="wrap">
<a id="top" class="anchor" accesskey="t"></a>
<div id="page-header">
- <div class="headerbar">
+ <div class="headerbar" role="banner">
<div class="inner">
<div id="site-description">
@@ -69,8 +69,9 @@
<p class="skiplink"><a href="#start_here">{L_SKIP}</a></p>
</div>
+ <!-- EVENT overall_header_searchbox_before -->
<!-- IF S_DISPLAY_SEARCH and not S_IN_SEARCH -->
- <div id="search-box" class="search-box search-header">
+ <div id="search-box" class="search-box search-header" role="search">
<form action="{U_SEARCH}" method="get" id="search">
<fieldset>
<input name="keywords" id="keywords" type="search" maxlength="128" title="{L_SEARCH_KEYWORDS}" class="inputbox search tiny" size="20" value="{SEARCH_WORDS}" placeholder="{L_SEARCH_MINI}" />
@@ -91,7 +92,7 @@
<!-- EVENT overall_header_page_body_before -->
<a id="start_here" class="anchor"></a>
- <div id="page-body">
+ <div id="page-body" role="main">
<!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN and (U_MCP or U_ACP) -->
<div id="information" class="rules">
<div class="inner">
diff --git a/phpBB/styles/prosilver/template/posting_buttons.html b/phpBB/styles/prosilver/template/posting_buttons.html
index 3dad6606bb..1555b12369 100644
--- a/phpBB/styles/prosilver/template/posting_buttons.html
+++ b/phpBB/styles/prosilver/template/posting_buttons.html
@@ -92,6 +92,9 @@
<!-- ENDIF -->
</select>
<input type="button" class="button2 bbcode-color" name="bbpalette" id="bbpalette" value="{L_FONT_COLOR}" onclick="change_palette();" title="{L_BBCODE_S_HELP}" />
+
+ <!-- EVENT posting_editor_buttons_custom_tags_before -->
+
<!-- BEGIN custom_tags -->
<input type="button" class="button2 bbcode-{custom_tags.BBCODE_TAG_CLEAN}" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})" title="{custom_tags.BBCODE_HELPLINE}" />
<!-- END custom_tags -->
diff --git a/phpBB/styles/prosilver/template/posting_editor.html b/phpBB/styles/prosilver/template/posting_editor.html
index 333e61008e..e68e6a97e5 100644
--- a/phpBB/styles/prosilver/template/posting_editor.html
+++ b/phpBB/styles/prosilver/template/posting_editor.html
@@ -1,5 +1,5 @@
<fieldset class="fields1">
-<!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
+ <!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
<!-- IF S_SHOW_TOPIC_ICONS or S_SHOW_PM_ICONS -->
<dl>
@@ -42,7 +42,7 @@
<a href="#" onclick="insert_text('{smiley.A_SMILEY_CODE}', true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" /></a>
<!-- END smiley -->
<!-- ENDIF -->
- <!-- IF S_SHOW_SMILEY_LINK and S_SMILIES_ALLOWED-->
+ <!-- IF S_SHOW_SMILEY_LINK and S_SMILIES_ALLOWED -->
<br /><a href="{U_MORE_SMILIES}" onclick="popup(this.href, 750, 350, '_phpbbsmilies'); return false;">{L_MORE_SMILIES}</a>
<!-- ENDIF -->
diff --git a/phpBB/styles/prosilver/template/search_results.html b/phpBB/styles/prosilver/template/search_results.html
index 970a7bcdd1..f76afe3767 100644
--- a/phpBB/styles/prosilver/template/search_results.html
+++ b/phpBB/styles/prosilver/template/search_results.html
@@ -1,21 +1,25 @@
<!-- INCLUDE overall_header.html -->
+<!-- EVENT search_results_header_before -->
+
<h2 class="searchresults-title"><!-- IF SEARCH_TITLE -->{SEARCH_TITLE}<!-- ELSE -->{SEARCH_MATCHES}<!-- ENDIF --><!-- IF SEARCH_WORDS -->{L_COLON} <a href="{U_SEARCH_WORDS}">{SEARCH_WORDS}</a><!-- ENDIF --></h2>
<!-- IF SEARCHED_QUERY --> <p>{L_SEARCHED_QUERY}{L_COLON} <strong>{SEARCHED_QUERY}</strong></p><!-- ENDIF -->
<!-- IF IGNORED_WORDS --> <p>{L_IGNORED_TERMS}{L_COLON} <strong>{IGNORED_WORDS}</strong></p><!-- ENDIF -->
<!-- IF PHRASE_SEARCH_DISABLED --> <p><strong>{L_PHRASE_SEARCH_DISABLED}</strong></p><!-- ENDIF -->
<!-- IF SEARCH_TOPIC -->
- <p><a class="arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH_TOPIC}">{L_RETURN_TO_TOPIC}</a></p>
+ <p class="return-link"><a class="arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH_TOPIC}">{L_RETURN_TO_TOPIC}</a></p>
<!-- ELSE -->
- <p><a class="arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH}" title="{L_SEARCH_ADV}">{L_GO_TO_SEARCH_ADV}</a></p>
+ <p class="advanced-search-link"><a class="arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_SEARCH}" title="{L_SEARCH_ADV}">{L_GO_TO_SEARCH_ADV}</a></p>
<!-- ENDIF -->
+<!-- EVENT search_results_header_after -->
+
<!-- IF .pagination or SEARCH_MATCHES or TOTAL_MATCHES or PAGE_NUMBER -->
<div class="action-bar top">
<!-- IF TOTAL_MATCHES > 0 -->
- <div class="search-box">
+ <div class="search-box" role="search">
<form method="post" action="{S_SEARCH_ACTION}">
<fieldset>
<input class="inputbox search tiny" type="search" name="add_keywords" id="add_keywords" value="" placeholder="{L_SEARCH_IN_RESULTS}" />
@@ -26,6 +30,8 @@
</div>
<!-- ENDIF -->
+ <!-- EVENT search_results_searchbox_after -->
+
<div class="pagination">
{SEARCH_MATCHES}
<!-- IF .pagination -->
diff --git a/phpBB/styles/prosilver/template/simple_footer.html b/phpBB/styles/prosilver/template/simple_footer.html
index d5d0f45fa9..123f8992f2 100644
--- a/phpBB/styles/prosilver/template/simple_footer.html
+++ b/phpBB/styles/prosilver/template/simple_footer.html
@@ -1,6 +1,6 @@
</div>
- <div class="copyright">{CREDIT_LINE}
+ <div class="copyright" role="contentinfo">{CREDIT_LINE}
<!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF -->
<!-- IF DEBUG_OUTPUT --><br />{DEBUG_OUTPUT}<!-- ENDIF -->
</div>
diff --git a/phpBB/styles/prosilver/template/simple_header.html b/phpBB/styles/prosilver/template/simple_header.html
index 6d22a074be..ab4f855a97 100644
--- a/phpBB/styles/prosilver/template/simple_header.html
+++ b/phpBB/styles/prosilver/template/simple_header.html
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
-<meta charset="utf-8">
-<meta name="viewport" content="width=device-width" />
+<meta charset="utf-8" />
+<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>
@@ -36,4 +36,4 @@
<div id="wrap">
<a id="top" class="anchor" accesskey="t"></a>
- <div id="page-body">
+ <div id="page-body" role="main">
diff --git a/phpBB/styles/prosilver/template/ucp_pm_message_header.html b/phpBB/styles/prosilver/template/ucp_pm_message_header.html
index d777de908d..7be51e0034 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_message_header.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_message_header.html
@@ -48,6 +48,7 @@
<!-- IF S_VIEW_MESSAGE -->
<a class="arrow-{S_CONTENT_FLOW_BEGIN}" href="{U_CURRENT_FOLDER}">{L_RETURN_TO_FOLDER}</a>
<!-- ELSEIF FOLDER_CUR_MESSAGES neq 0 -->
+ <!-- IF U_MARK_ALL --><a href="{U_MARK_ALL}" class="mark">{L_PM_MARK_ALL_READ}</a> &bull; <!-- ENDIF -->
{TOTAL_MESSAGES}
<!-- IF .pagination -->
<!-- INCLUDE pagination.html -->
diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html
index ddd95780d7..02c5f5b1a5 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage.html
@@ -29,7 +29,7 @@
<!-- IF RANK_TITLE or RANK_IMG --><dd class="profile-rank">{RANK_TITLE}<!-- IF RANK_TITLE and RANK_IMG --><br /><!-- ENDIF -->{RANK_IMG}</dd><!-- ENDIF -->
- <dd class="profile-posts"><strong>{L_POSTS}{L_COLON}</strong> {AUTHOR_POSTS}</dd>
+ <dd class="profile-posts"><strong>{L_POSTS}{L_COLON}</strong> <!-- IF U_AUTHOR_POSTS != '' --><a href="{U_AUTHOR_POSTS}">{AUTHOR_POSTS}</a><!-- ELSE -->{AUTHOR_POSTS}<!-- ENDIF --></dd>
<!-- IF AUTHOR_JOINED --><dd class="profile-joined"><strong>{L_JOINED}{L_COLON}</strong> {AUTHOR_JOINED}</dd><!-- ENDIF -->
<!-- EVENT ucp_pm_viewmessage_custom_fields_before -->
@@ -62,6 +62,7 @@
</div>
<!-- ENDIF -->
<!-- END contact -->
+ </div>
</div>
</div>
</dd>
diff --git a/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html b/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html
index ce0f4941a5..7fe0d67077 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_viewmessage_print.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
-<meta charset="utf-8">
+<meta charset="utf-8" />
<meta name="robots" content="noindex" />
{META}
<title>{SITENAME} &bull; {PAGE_TITLE}</title>
diff --git a/phpBB/styles/prosilver/template/ucp_profile_autologin_keys.html b/phpBB/styles/prosilver/template/ucp_profile_autologin_keys.html
index 6fec0b8aed..65909b7068 100644
--- a/phpBB/styles/prosilver/template/ucp_profile_autologin_keys.html
+++ b/phpBB/styles/prosilver/template/ucp_profile_autologin_keys.html
@@ -10,19 +10,19 @@
<table class="table1">
<thead>
<tr>
- <th>{L_LOGIN_KEY}</th>
- <th>{L_IP}</th>
- <th>{L_LOGIN_TIME}</th>
- <th class="mark">{L_MARK}</th>
+ <th class="name">{L_LOGIN_KEY}</th>
+ <th class="center">{L_IP}</th>
+ <th class="center">{L_LOGIN_TIME}</th>
+ <th class="center mark">{L_MARK}</th>
</tr>
</thead>
<tbody>
<!-- BEGIN sessions -->
<!-- IF sessions.S_ROW_COUNT is even --><tr class="bg1"><!-- ELSE --><tr class="bg2"><!-- ENDIF -->
<td><label for="{sessions.KEY}">{sessions.KEY}</label></td>
- <td style="text-align: center">{sessions.IP}</td>
- <td style="text-align: center">{sessions.LOGIN_TIME}</td>
- <td style="text-align: center" class="mark"><input type="checkbox" name="keys[]" value="{sessions.KEY}" id="{sessions.KEY}" /></td>
+ <td class="center">{sessions.IP}</td>
+ <td class="center">{sessions.LOGIN_TIME}</td>
+ <td class="center mark"><input type="checkbox" name="keys[]" value="{sessions.KEY}" id="{sessions.KEY}" /></td>
</tr>
<!-- BEGINELSE -->
<tr><td colspan="4" class="bg1" style="text-align: center">{L_PROFILE_NO_AUTOLOGIN_KEYS}</td></tr>
diff --git a/phpBB/styles/prosilver/template/ucp_profile_profile_info.html b/phpBB/styles/prosilver/template/ucp_profile_profile_info.html
index 986bc92298..69eda8c42c 100644
--- a/phpBB/styles/prosilver/template/ucp_profile_profile_info.html
+++ b/phpBB/styles/prosilver/template/ucp_profile_profile_info.html
@@ -2,7 +2,7 @@
<form id="ucp" method="post" action="{S_UCP_ACTION}"{S_FORM_ENCTYPE}>
-<h2>{L_TITLE}</h2>
+<h2>{L_TITLE} <span class="small">[ <a href="{U_USER_PROFILE}" title="{L_VIEW_PROFILE}">{L_VIEW_PROFILE}</a> ]</span></h2>
<div class="panel">
<div class="inner">
@@ -10,6 +10,7 @@
<fieldset>
<!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
+ <!-- EVENT ucp_profile_profile_info_before -->
<!-- IF S_BIRTHDAYS_ENABLED -->
<dl>
<dt><label for="bday_day">{L_BIRTHDAY}{L_COLON}</label><br /><span>{L_BIRTHDAY_EXPLAIN}</span></dt>
@@ -34,6 +35,7 @@
<dd>{profile_fields.FIELD}</dd>
</dl>
<!-- END profile_fields -->
+ <!-- EVENT ucp_profile_profile_info_after -->
</fieldset>
</div>
diff --git a/phpBB/styles/prosilver/template/ucp_profile_reg_details.html b/phpBB/styles/prosilver/template/ucp_profile_reg_details.html
index 4b26bc2e99..2642b7a419 100644
--- a/phpBB/styles/prosilver/template/ucp_profile_reg_details.html
+++ b/phpBB/styles/prosilver/template/ucp_profile_reg_details.html
@@ -12,6 +12,7 @@
<fieldset>
<!-- IF ERROR --><p class="error">{ERROR}</p><!-- ENDIF -->
+ <!-- EVENT ucp_profile_register_details_before -->
<dl>
<dt><label <!-- IF S_CHANGE_USERNAME -->for="username"<!-- ENDIF -->>{L_USERNAME}{L_COLON}</label><br /><span>{L_USERNAME_EXPLAIN}</span></dt>
<dd><!-- IF S_CHANGE_USERNAME --><input type="text" name="username" id="username" value="{USERNAME}" class="inputbox" title="{L_USERNAME}" /><!-- ELSE --><strong>{USERNAME}</strong><!-- ENDIF --></dd>
@@ -30,6 +31,7 @@
<dd><input type="password" name="password_confirm" id="password_confirm" maxlength="255" value="{PASSWORD_CONFIRM}" class="inputbox" title="{L_CONFIRM_PASSWORD}" /></dd>
</dl>
<!-- ENDIF -->
+ <!-- EVENT ucp_profile_register_details_after -->
</fieldset>
</div>
</div>
diff --git a/phpBB/styles/prosilver/template/viewforum_body.html b/phpBB/styles/prosilver/template/viewforum_body.html
index 4362d50b37..a0a0cd547a 100644
--- a/phpBB/styles/prosilver/template/viewforum_body.html
+++ b/phpBB/styles/prosilver/template/viewforum_body.html
@@ -39,14 +39,18 @@
<!-- IF not S_IS_BOT and S_DISPLAY_POST_INFO -->
<div class="buttons">
+ <!-- EVENT viewforum_buttons_top_before -->
+
<a href="{U_POST_NEW_TOPIC}" class="button icon-button <!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->post-icon<!-- ENDIF -->" title="<!-- IF S_IS_LOCKED -->{L_FORUM_LOCKED}<!-- ELSE -->{L_POST_TOPIC}<!-- ENDIF -->">
<!-- IF S_IS_LOCKED -->{L_BUTTON_FORUM_LOCKED}<!-- ELSE -->{L_BUTTON_NEW_TOPIC}<!-- ENDIF -->
</a>
+
+ <!-- EVENT viewforum_buttons_top_after -->
</div>
<!-- ENDIF -->
<!-- IF S_DISPLAY_SEARCHBOX -->
- <div class="search-box">
+ <div class="search-box" role="search">
<form method="get" id="forum-search" action="{S_SEARCHBOX_ACTION}">
<fieldset>
<input class="inputbox search tiny" type="search" name="keywords" id="search_keywords" size="20" placeholder="{L_SEARCH_FORUM}" />
@@ -60,7 +64,7 @@
<div class="pagination">
<!-- IF not S_IS_BOT and U_MARK_TOPICS and .topicrow --><a href="{U_MARK_TOPICS}" class="mark" accesskey="m" data-ajax="mark_topics_read">{L_MARK_TOPICS_READ}</a> &bull; <!-- ENDIF -->
- {TOTAL_TOPICS}
+ {TOTAL_TOPICS}
<!-- IF .pagination -->
<!-- INCLUDE pagination.html -->
<!-- ELSE -->
@@ -227,15 +231,19 @@
<div class="action-bar bottom">
<!-- IF not S_IS_BOT and S_DISPLAY_POST_INFO -->
<div class="buttons">
+ <!-- EVENT viewforum_buttons_bottom_before -->
+
<a href="{U_POST_NEW_TOPIC}" class="button icon-button <!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->post-icon<!-- ENDIF -->" title="<!-- IF S_IS_LOCKED -->{L_FORUM_LOCKED}<!-- ELSE -->{L_POST_TOPIC}<!-- ENDIF -->">
<!-- IF S_IS_LOCKED -->{L_BUTTON_FORUM_LOCKED}<!-- ELSE -->{L_BUTTON_NEW_TOPIC}<!-- ENDIF -->
</a>
+
+ <!-- EVENT viewforum_buttons_bottom_after -->
</div>
<!-- ENDIF -->
<div class="pagination">
<!-- IF not S_IS_BOT and U_MARK_TOPICS and .topicrow --><a href="{U_MARK_TOPICS}" data-ajax="mark_topics_read">{L_MARK_TOPICS_READ}</a> &bull; <!-- ENDIF -->
- {TOTAL_TOPICS}
+ {TOTAL_TOPICS}
<!-- IF .pagination -->
<!-- INCLUDE pagination.html -->
<!-- ELSE -->
diff --git a/phpBB/styles/prosilver/template/viewtopic_body.html b/phpBB/styles/prosilver/template/viewtopic_body.html
index 127a3ca1aa..5b8078877e 100644
--- a/phpBB/styles/prosilver/template/viewtopic_body.html
+++ b/phpBB/styles/prosilver/template/viewtopic_body.html
@@ -28,17 +28,21 @@
<div class="action-bar top">
<div class="buttons">
+ <!-- EVENT viewtopic_buttons_top_before -->
+
<!-- IF not S_IS_BOT and S_DISPLAY_REPLY_INFO -->
<a href="{U_POST_REPLY_TOPIC}" class="button icon-button <!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->reply-icon<!-- ENDIF -->" title="<!-- IF S_IS_LOCKED -->{L_TOPIC_LOCKED}<!-- ELSE -->{L_POST_REPLY}<!-- ENDIF -->">
<!-- IF S_IS_LOCKED -->{L_BUTTON_TOPIC_LOCKED}<!-- ELSE -->{L_BUTTON_POST_REPLY}<!-- ENDIF -->
</a>
<!-- ENDIF -->
+
+ <!-- EVENT viewtopic_buttons_top_after -->
</div>
<!-- INCLUDE viewtopic_topic_tools.html -->
<!-- IF S_DISPLAY_SEARCHBOX -->
- <div class="search-box">
+ <div class="search-box" role="search">
<form method="get" id="topic-search" action="{S_SEARCHBOX_ACTION}">
<fieldset>
<input class="inputbox search tiny" type="search" name="keywords" id="search_keywords" size="20" placeholder="{L_SEARCH_TOPIC}" />
@@ -60,7 +64,7 @@
<!-- ENDIF -->
</div>
<!-- ENDIF -->
-
+ <!-- EVENT viewtopic_body_pagination_top_after -->
</div>
<!-- IF S_HAS_POLL -->
@@ -133,7 +137,9 @@
<!-- ENDIF -->
<!-- EVENT viewtopic_body_avatar_after -->
</div>
+ <!-- EVENT viewtopic_body_post_author_before -->
<!-- IF not postrow.U_POST_AUTHOR --><strong>{postrow.POST_AUTHOR_FULL}</strong><!-- ELSE -->{postrow.POST_AUTHOR_FULL}<!-- ENDIF -->
+ <!-- EVENT viewtopic_body_post_author_after -->
</dt>
<!-- IF postrow.RANK_TITLE or postrow.RANK_IMG --><dd class="profile-rank">{postrow.RANK_TITLE}<!-- IF postrow.RANK_TITLE and postrow.RANK_IMG --><br /><!-- ENDIF -->{postrow.RANK_IMG}</dd><!-- ENDIF -->
@@ -243,7 +249,9 @@
<!-- ENDIF -->
<!-- ENDIF -->
+ <!-- EVENT viewtopic_body_postrow_post_details_before -->
<p class="author"><!-- IF S_IS_BOT -->{postrow.MINI_POST_IMG}<!-- ELSE --><a href="{postrow.U_MINI_POST}">{postrow.MINI_POST_IMG}</a><!-- ENDIF --><span class="responsive-hide">{L_POST_BY_AUTHOR} <strong>{postrow.POST_AUTHOR_FULL}</strong> &raquo; </span>{postrow.POST_DATE} </p>
+ <!-- EVENT viewtopic_body_postrow_post_details_after -->
<!-- IF postrow.S_POST_UNAPPROVED -->
<form method="post" class="mcp_approve" action="{postrow.U_APPROVE_ACTION}">
@@ -309,7 +317,7 @@
</div>
- <div class="back2top"><a href="#wrap" class="top" title="{L_BACK_TO_TOP}">{L_BACK_TO_TOP}</a></div>
+ <div class="back2top"><a href="#top" class="top" title="{L_BACK_TO_TOP}">{L_BACK_TO_TOP}</a></div>
</div>
</div>
@@ -338,11 +346,15 @@
<!-- EVENT viewtopic_body_topic_actions_before -->
<div class="action-bar bottom">
<div class="buttons">
+ <!-- EVENT viewtopic_buttons_bottom_before -->
+
<!-- IF not S_IS_BOT and S_DISPLAY_REPLY_INFO -->
<a href="{U_POST_REPLY_TOPIC}" class="button icon-button <!-- IF S_IS_LOCKED -->locked-icon<!-- ELSE -->reply-icon<!-- ENDIF -->" title="<!-- IF S_IS_LOCKED -->{L_TOPIC_LOCKED}<!-- ELSE -->{L_POST_REPLY}<!-- ENDIF -->">
<!-- IF S_IS_LOCKED -->{L_BUTTON_TOPIC_LOCKED}<!-- ELSE -->{L_BUTTON_POST_REPLY}<!-- ENDIF -->
</a>
<!-- ENDIF -->
+
+ <!-- EVENT viewtopic_buttons_bottom_after -->
</div>
<!-- INCLUDE viewtopic_topic_tools.html -->
diff --git a/phpBB/styles/prosilver/template/viewtopic_print.html b/phpBB/styles/prosilver/template/viewtopic_print.html
index 5c44f58adb..66199295bb 100644
--- a/phpBB/styles/prosilver/template/viewtopic_print.html
+++ b/phpBB/styles/prosilver/template/viewtopic_print.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
-<meta charset="utf-8">
+<meta charset="utf-8" />
<meta name="robots" content="noindex" />
{META}
<title>{SITENAME} &bull; {PAGE_TITLE}</title>
diff --git a/phpBB/styles/prosilver/theme/bidi.css b/phpBB/styles/prosilver/theme/bidi.css
index 65123af4e5..d9bf9f9fa5 100644
--- a/phpBB/styles/prosilver/theme/bidi.css
+++ b/phpBB/styles/prosilver/theme/bidi.css
@@ -313,6 +313,13 @@ li.breadcrumbs span:first-child > a {
padding-right: 19px;
}
+/* Notification mark read link */
+.rtl .dropdown-extended a.mark_read {
+ border-radius: 0 3px 3px 0;
+ left: 0;
+ right: auto;
+}
+
.rtl a.top {
float: left;
}
@@ -1061,17 +1068,6 @@ li.breadcrumbs span:first-child > a {
text-align: right;
}
- @media only screen and (max-width: 550px), only screen and (max-device-width: 550px)
- {
- .rtl ul.topiclist.forums dt {
- margin-left: 0;
- }
-
- .rtl ul.topiclist.forums dt .list-inner {
- margin-left: 0;
- }
- }
-
.rtl table.responsive.show-header thead, .rtl table.responsive.show-header th:first-child {
text-align: right !important;
}
@@ -1086,19 +1082,6 @@ li.breadcrumbs span:first-child > a {
float: none;
}
- @media only screen and (max-width: 500px), only screen and (max-device-width: 500px)
- {
- .rtl dl.details dt, .rtl dl.details dd {
- float: none;
- text-align: right;
- }
-
- .rtl dl.details dd {
- margin-left: 0;
- margin-right: 20px;
- }
- }
-
/* Post
----------------------------------------*/
.rtl .postprofile, .rtl .postbody, .rtl .search .postbody {
@@ -1121,4 +1104,44 @@ li.breadcrumbs span:first-child > a {
.rtl .has-profile .post-buttons {
left: 20px;
}
+
+ /* Forms
+ ----------------------------------------*/
+ .rtl fieldset dt, .rtl fieldset.fields1 dt, .rtl fieldset.fields2 dt {
+ float: none;
+ }
+
+ .rtl fieldset dd, .rtl fieldset.fields1 dd, .rtl fieldset.fields2 dd {
+ margin-right: 20px;
+ }
+}
+
+@media only screen and (max-width: 550px), only screen and (max-device-width: 550px)
+{
+ /* .topiclist lists
+ ----------------------------------------*/
+ .rtl ul.topiclist.forums dt {
+ margin-left: 0;
+ }
+
+ .rtl ul.topiclist.forums dt .list-inner {
+ margin-left: 0;
+ }
+}
+
+@media only screen and (max-width: 500px), only screen and (max-device-width: 500px)
+{
+ .rtl dl.details dt, .rtl dl.details dd {
+ float: none;
+ text-align: right;
+ }
+
+ .rtl dl.details dd {
+ margin-left: 0;
+ margin-right: 20px;
+ }
+
+ .captcha-panel dd.captcha {
+ margin-right: 0;
+ }
}
diff --git a/phpBB/styles/prosilver/theme/buttons.css b/phpBB/styles/prosilver/theme/buttons.css
index d600e76b44..aecac4defd 100644
--- a/phpBB/styles/prosilver/theme/buttons.css
+++ b/phpBB/styles/prosilver/theme/buttons.css
@@ -8,6 +8,7 @@
cursor: pointer;
display: inline-block;
height: 18px;
+ line-height: 18px;
font-size: 13px;
white-space: nowrap;
border: 1px solid transparent;
diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css
index 505b18288b..4743b4b39b 100644
--- a/phpBB/styles/prosilver/theme/colours.css
+++ b/phpBB/styles/prosilver/theme/colours.css
@@ -96,7 +96,9 @@ table.zebra-list tr:nth-child(even) td, ul.zebra-list li:nth-child(even) {
background-color: #e1ebf2;
}
-.bg3 { background-color: #cadceb; }
+.bg3 {
+ background-color: #cadceb;
+}
.ucprowbg {
background-color: #DCDEE2;
@@ -164,9 +166,9 @@ dl.details dd {
---------------------------------------- */
.pagination li a {
- color: #5C758C;
background-color: #ECEDEE;
border-color: #B4BAC0;
+ color: #5C758C;
}
.pagination li.ellipsis span {
@@ -175,14 +177,14 @@ dl.details dd {
}
.pagination li.active span {
- color: #FFFFFF;
background-color: #4692BF;
border-color: #4692BF;
+ color: #FFFFFF;
}
.pagination li a:hover, .pagination .dropdown-visible a.dropdown-trigger, .nojs .pagination .dropdown-container:hover a.dropdown-trigger {
- border-color: #368AD2;
background-color: #368AD2;
+ border-color: #368AD2;
color: #FFFFFF;
}
@@ -263,13 +265,13 @@ a:hover { color: #D31141; }
/* Post body links */
.postlink {
- color: #368AD2;
border-bottom-color: #368AD2;
+ color: #368AD2;
}
.postlink:visited {
- color: #5D8FBD;
border-bottom-color: #5D8FBD;
+ color: #5D8FBD;
}
.postlink:hover {
@@ -656,7 +658,6 @@ Colours and backgrounds for buttons.css
.icon-register { background-image: url("./images/icon_register.gif"); }
.icon-search, .responsive-search a { background-image: url("./images/icon_search.gif"); }
.icon-search-active { background-image: url("./images/subforum_read.gif"); }
-.icon-search-advanced { background-image: url("./images/icon_search_adv.gif"); }
.icon-search-new { background-image: url("./images/subforum_unread.gif"); }
.icon-search-self { background-image: url("./images/icon_topic_latest.gif"); }
.icon-search-unanswered { background-image: url("./images/icon_post_target.gif"); }
diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css
index 090046f54f..11e3314f17 100644
--- a/phpBB/styles/prosilver/theme/common.css
+++ b/phpBB/styles/prosilver/theme/common.css
@@ -601,7 +601,7 @@ ul.linklist.bulletin > li.no-bulletin:before {
}
.breadcrumbs .crumb:before {
- content: '‹';
+ content: '\2039';
font-weight: bold;
padding: 0 0.5em;
}
@@ -671,6 +671,8 @@ table.table1 tbody th {
/* Specific column styles */
table.table1 .name { text-align: left; }
+table.table1 .center { text-align: center; }
+table.table1 .reportby { width: 15%; }
table.table1 .posts { text-align: center; width: 7%; }
table.table1 .joined { text-align: left; width: 15%; }
table.table1 .active { text-align: left; width: 15%; }
@@ -1289,18 +1291,10 @@ ul.linklist:after,
width: 50px;
}
-.dropdown .clone {
+.dropdown .clone.hidden + li.separator {
display: none;
}
-.responsive .dropdown .clone {
- display: inherit;
-}
-
-.dropdown .clone + li.separator {
- display: none;
-}
-
-.responsive .dropdown .clone + li.separator {
- display: inherit;
+.dropdown .clone.hidden + li {
+ border-top: none;
}
diff --git a/phpBB/styles/prosilver/theme/content.css b/phpBB/styles/prosilver/theme/content.css
index 9388496c53..e73f8c9d54 100644
--- a/phpBB/styles/prosilver/theme/content.css
+++ b/phpBB/styles/prosilver/theme/content.css
@@ -276,6 +276,9 @@ dd.option {
.postbody img.postimage {
max-width: 100%;
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
}
.search .postbody {
@@ -497,7 +500,7 @@ blockquote.uncited {
text-transform: uppercase;
border-bottom: 1px solid transparent;
margin-bottom: 3px;
- font-size: 0.8em;
+ font-size: 0.8em !important;
font-weight: bold;
display: block;
}
diff --git a/phpBB/styles/prosilver/theme/cp.css b/phpBB/styles/prosilver/theme/cp.css
index 014bb91e7a..81b6d9bf64 100644
--- a/phpBB/styles/prosilver/theme/cp.css
+++ b/phpBB/styles/prosilver/theme/cp.css
@@ -59,10 +59,6 @@ ul.cplist {
border-bottom: none;
}
-#cp-main .postbody p {
- font-size: 1.1em;
-}
-
#cp-main .pm-message {
border: 1px solid transparent;
margin: 10px 0;
@@ -78,6 +74,10 @@ ul.cplist {
margin-top: 0;
}
+.panel-container .postbody p.author {
+ font-size: 1.1em;
+}
+
#cp-main .buttons {
margin-left: 0;
}
diff --git a/phpBB/styles/prosilver/theme/responsive.css b/phpBB/styles/prosilver/theme/responsive.css
index ed3ba61334..8653042a69 100644
--- a/phpBB/styles/prosilver/theme/responsive.css
+++ b/phpBB/styles/prosilver/theme/responsive.css
@@ -350,6 +350,31 @@ fieldset.quick-login label[for="autologin"] {
select, .inputbox {
max-width: 260px;
}
+
+ .captcha-panel dd.captcha {
+ margin-left: 0;
+ }
+
+ .captcha-panel dd.captcha-image img {
+ width: 100%;
+ }
+
+ #recaptcha_challenge_image,
+ #recaptcha_response_field,
+ .recaptchatable #recaptcha_image {
+ width: 100% !important;
+ height: auto !important;
+ }
+
+ .recaptchatable tr td:last-child {
+ display: none;
+ }
+
+ .captcha-panel .recaptcha-responsive {
+ display: inline-block !important;
+ margin-top: 10px;
+ vertical-align: middle;
+ }
}
@media only screen and (max-width: 430px), only screen and (max-device-width: 430px) {
diff --git a/phpBB/styles/subsilver2/style.cfg b/phpBB/styles/subsilver2/style.cfg
index 0c0bd04456..8f3f55ec87 100644
--- a/phpBB/styles/subsilver2/style.cfg
+++ b/phpBB/styles/subsilver2/style.cfg
@@ -21,8 +21,8 @@
# General Information about this style
name = subsilver2
copyright = © 2005 phpBB Limited
-style_version = 3.1.0-RC4
-phpbb_version = 3.1.0-RC4
+style_version = 3.1.3
+phpbb_version = 3.1.3
# Defining a different template bitfield
# template_bitfield = lNg=
diff --git a/phpBB/styles/subsilver2/template/confirm_delete_body.html b/phpBB/styles/subsilver2/template/confirm_delete_body.html
index 18df397fc3..44aec9b60a 100644
--- a/phpBB/styles/subsilver2/template/confirm_delete_body.html
+++ b/phpBB/styles/subsilver2/template/confirm_delete_body.html
@@ -14,6 +14,7 @@
<p class="gen">{MESSAGE_TEXT}</p>
<br />
+ <!-- IF not S_SHADOW_TOPICS -->
<table border="0" width="90%" cellspacing="2" cellpadding="1">
<!-- IF not S_SOFTDELETED and S_ALLOWED_DELETE and S_ALLOWED_SOFTDELETE -->
<tr>
@@ -30,6 +31,7 @@
</tr>
</table>
<br />
+ <!-- ENDIF -->
{S_HIDDEN_FIELDS}
<input type="submit" name="confirm" value="{L_YES}" class="btnmain" />&nbsp;&nbsp;
diff --git a/phpBB/styles/subsilver2/template/forumlist_body.html b/phpBB/styles/subsilver2/template/forumlist_body.html
index 0d522a6959..6c9b64827a 100644
--- a/phpBB/styles/subsilver2/template/forumlist_body.html
+++ b/phpBB/styles/subsilver2/template/forumlist_body.html
@@ -39,7 +39,9 @@
<td class="catdiv" colspan="3">&nbsp;</td>
</tr>
<!-- ENDIF -->
+ <!-- EVENT forumlist_body_forum_row_before -->
<tr>
+ <!-- EVENT forumlist_body_forum_row_prepend -->
<td class="row1" width="50" align="center">{forumrow.FORUM_FOLDER_IMG}</td>
<td class="row1" width="100%">
<!-- IF forumrow.FORUM_IMAGE -->
@@ -54,7 +56,7 @@
<!-- EVENT forumlist_body_subforums_before -->
<p class="forumdesc"><strong>{forumrow.L_SUBFORUM_STR}{L_COLON}</strong>
<!-- BEGIN subforum -->
- <a href="{forumrow.subforum.U_SUBFORUM}" class="subforum<!-- IF forumrow.subforum.S_UNREAD --> unread<!-- ELSE --> read<!-- ENDIF -->" title="<!-- IF forumrow.subforum.UNREAD -->{L_UNREAD_POSTS}<!-- ELSE -->{L_NO_UNREAD_POSTS}<!-- ENDIF -->">{forumrow.subforum.SUBFORUM_NAME}</a><!-- IF not forumrow.subforum.S_LAST_ROW -->{L_COMMA_SEPARATOR}<!-- ENDIF -->
+ <a href="{forumrow.subforum.U_SUBFORUM}" class="subforum<!-- IF forumrow.subforum.S_UNREAD --> unread<!-- ELSE --> read<!-- ENDIF -->" title="<!-- IF forumrow.subforum.S_UNREAD -->{L_UNREAD_POSTS}<!-- ELSE -->{L_NO_UNREAD_POSTS}<!-- ENDIF -->">{forumrow.subforum.SUBFORUM_NAME}</a><!-- IF not forumrow.subforum.S_LAST_ROW -->{L_COMMA_SEPARATOR}<!-- ENDIF -->
<!-- END subforum -->
</p>
<!-- EVENT forumlist_body_subforums_after -->
@@ -83,7 +85,9 @@
<p class="topicdetails">{L_NO_POSTS}</p>
<!-- ENDIF -->
</td>
+ <!-- EVENT forumlist_body_forum_row_append -->
</tr>
+ <!-- EVENT forumlist_body_forum_row_after -->
<!-- ENDIF -->
<!-- EVENT forumlist_body_last_row_after -->
<!-- BEGINELSE -->
diff --git a/phpBB/styles/subsilver2/template/index.htm b/phpBB/styles/subsilver2/template/index.htm
index 4763c05f0e..a1356823e2 100644
--- a/phpBB/styles/subsilver2/template/index.htm
+++ b/phpBB/styles/subsilver2/template/index.htm
@@ -1,7 +1,7 @@
<html>
<head>
<title>subSilver created by subBlue Design</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body bgcolor="#FFFFFF" text="#000000">
diff --git a/phpBB/styles/subsilver2/template/index_body.html b/phpBB/styles/subsilver2/template/index_body.html
index 1a2786015f..bfc2229221 100644
--- a/phpBB/styles/subsilver2/template/index_body.html
+++ b/phpBB/styles/subsilver2/template/index_body.html
@@ -14,6 +14,8 @@
<!-- INCLUDE forumlist_body.html -->
+<!-- EVENT index_body_forumlist_body_after -->
+
<!-- IF not S_IS_BOT or U_TEAM -->
<span class="gensmall">
<!-- IF not S_IS_BOT --><a href="{U_DELETE_COOKIES}">{L_DELETE_COOKIES}</a><!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/mcp_front.html b/phpBB/styles/subsilver2/template/mcp_front.html
index 7c17e13c52..55adb3b550 100644
--- a/phpBB/styles/subsilver2/template/mcp_front.html
+++ b/phpBB/styles/subsilver2/template/mcp_front.html
@@ -1,5 +1,7 @@
<!-- INCLUDE mcp_header.html -->
+<!-- EVENT mcp_front_latest_unapproved_before -->
+
<!-- IF S_SHOW_UNAPPROVED -->
<form name="mcp_queue" method="post" action="{S_MCP_QUEUE_ACTION}">
@@ -44,6 +46,8 @@
<br clear="all" /><br />
<!-- ENDIF -->
+<!-- EVENT mcp_front_latest_reported_before -->
+
<!-- IF S_SHOW_REPORTS -->
<table class="tablebg" width="100%" cellspacing="1">
<tr>
@@ -73,6 +77,8 @@
<br clear="all" /><br />
<!-- ENDIF -->
+<!-- EVENT mcp_front_latest_reported_pms_before -->
+
<!-- IF S_SHOW_PM_REPORTS -->
<table class="tablebg" width="100%" cellspacing="1">
<tr>
@@ -104,6 +110,8 @@
<br clear="all" /><br />
<!-- ENDIF -->
+<!-- EVENT mcp_front_latest_logs_before -->
+
<!-- IF S_SHOW_LOGS -->
<table class="tablebg" width="100%" cellspacing="1" cellpadding="4" border="0" align="{S_CONTENT_FLOW_END}">
<tr>
@@ -134,4 +142,6 @@
<br clear="all" />
<!-- ENDIF -->
+<!-- EVENT mcp_front_latest_logs_after -->
+
<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/memberlist_body.html b/phpBB/styles/subsilver2/template/memberlist_body.html
index ecfb4b69c5..d412a6a64b 100644
--- a/phpBB/styles/subsilver2/template/memberlist_body.html
+++ b/phpBB/styles/subsilver2/template/memberlist_body.html
@@ -39,11 +39,10 @@
<table class="tablebg" width="100%" cellspacing="1">
<tr>
<th nowrap="nowrap">#</th>
- <th nowrap="nowrap" width="25%" align="{S_CONTENT_FLOW_BEGIN}"><a href="{U_SORT_USERNAME}">{L_USERNAME}</a></th>
+ <th nowrap="nowrap" width="36%" align="{S_CONTENT_FLOW_BEGIN}"><a href="{U_SORT_USERNAME}">{L_USERNAME}</a></th>
<th nowrap="nowrap" width="15%"><a href="{U_SORT_JOINED}">{L_JOINED}</a></th>
<th nowrap="nowrap" width="10%"><a href="{U_SORT_POSTS}">{L_POSTS}</a></th>
<th nowrap="nowrap" width="15%"><a href="{U_SORT_RANK}">{L_RANK}</a></th>
- <th nowrap="nowrap" width="11%">{L_SEND_MESSAGE}</th>
<th nowrap="nowrap" width="11%"><a href="{U_SORT_EMAIL}">{L_EMAIL}</a></th>
<!-- IF S_IN_SEARCH_POPUP and not S_SELECT_SINGLE --><th width="2%" nowrap="nowrap">{L_MARK}</th><!-- ENDIF -->
</tr>
@@ -52,11 +51,11 @@
<!-- IF S_SHOW_GROUP -->
<!-- IF memberrow.S_FIRST_ROW and memberrow.S_GROUP_LEADER -->
<tr class="row3">
- <td colspan="8"><b class="gensmall">{L_GROUP_LEADER}</b></td>
+ <td colspan="7"><b class="gensmall">{L_GROUP_LEADER}</b></td>
</tr>
<!-- ELSEIF not memberrow.S_GROUP_LEADER and not $S_MEMBER_HEADER -->
<tr class="row3">
- <td colspan="8"><b class="gensmall">{L_GROUP_MEMBERS}</b></td>
+ <td colspan="7"><b class="gensmall">{L_GROUP_MEMBERS}</b></td>
</tr>
<!-- DEFINE $S_MEMBER_HEADER = 1 -->
<!-- ENDIF -->
@@ -69,7 +68,6 @@
<td class="genmed" align="center" nowrap="nowrap">&nbsp;{memberrow.JOINED}&nbsp;</td>
<td class="gen" align="center">{memberrow.POSTS}</td>
<td class="gen" align="center"><!-- IF memberrow.RANK_IMG -->{memberrow.RANK_IMG}<!-- ELSE -->{memberrow.RANK_TITLE}<!-- ENDIF --></td>
- <td class="gen" align="center">&nbsp;<!-- IF memberrow.U_PM --><a href="{memberrow.U_PM}" class="imageset">{PM_IMG}</a><!-- ENDIF -->&nbsp;</td>
<td class="gen" align="center">&nbsp;<!-- IF memberrow.U_EMAIL --><a href="{memberrow.U_EMAIL}" class="imageset">{EMAIL_IMG}</a><!-- ENDIF -->&nbsp;</td>
<!-- IF memberrow.S_PROFILE_FIELD1 -->
<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
@@ -81,7 +79,7 @@
<!-- BEGINELSE -->
<tr>
- <td class="row1" colspan="<!-- IF S_IN_SEARCH_POPUP -->9<!-- ELSE -->8<!-- ENDIF -->" align="center">
+ <td class="row1" colspan="<!-- IF S_IN_SEARCH_POPUP -->8<!-- ELSE -->7<!-- ENDIF -->" align="center">
<span class="gen"><!-- IF S_SHOW_GROUP -->{L_NO_GROUP_MEMBERS}<!-- ELSE -->{L_NO_MEMBERS}<!-- ENDIF --></span>
</td>
</tr>
@@ -89,7 +87,7 @@
<!-- END memberrow -->
<tr>
- <td class="cat" colspan="<!-- IF S_IN_SEARCH_POPUP -->9<!-- ELSE -->8<!-- ENDIF -->" align="center"><!-- IF S_IN_SEARCH_POPUP and not S_SELECT_SINGLE --><input class="btnlite" type="submit" value="{L_SELECT_MARKED}" /><!-- ELSE --><span class="gensmall">{L_SELECT_SORT_METHOD}{L_COLON}</span>&nbsp;<select name="sk">{S_MODE_SELECT}</select>&nbsp; <span class="gensmall">{L_ORDER}</span>&nbsp;<select name="sd">{S_ORDER_SELECT}</select>&nbsp; <input type="submit" name="submit" value="{L_SUBMIT}" class="btnlite" /><!-- ENDIF --></td>
+ <td class="cat" colspan="<!-- IF S_IN_SEARCH_POPUP -->8<!-- ELSE -->7<!-- ENDIF -->" align="center"><!-- IF S_IN_SEARCH_POPUP and not S_SELECT_SINGLE --><input class="btnlite" type="submit" value="{L_SELECT_MARKED}" /><!-- ELSE --><span class="gensmall">{L_SELECT_SORT_METHOD}{L_COLON}</span>&nbsp;<select name="sk">{S_MODE_SELECT}</select>&nbsp; <span class="gensmall">{L_ORDER}</span>&nbsp;<select name="sd">{S_ORDER_SELECT}</select>&nbsp; <input type="submit" name="submit" value="{L_SUBMIT}" class="btnlite" /><!-- ENDIF --></td>
</tr>
</table>
{S_FORM_TOKEN}
diff --git a/phpBB/styles/subsilver2/template/memberlist_email.html b/phpBB/styles/subsilver2/template/memberlist_email.html
index 13ff4baace..1416aa0c10 100644
--- a/phpBB/styles/subsilver2/template/memberlist_email.html
+++ b/phpBB/styles/subsilver2/template/memberlist_email.html
@@ -66,17 +66,19 @@
<td class="row1" valign="top"><b class="genmed">{L_MESSAGE_BODY}</b><br /><span class="gensmall">{L_EMAIL_BODY_EXPLAIN}</span></td>
<td class="row2"><textarea class="post" name="message" rows="15" cols="76" tabindex="3">{MESSAGE}</textarea></td>
</tr>
+ <!-- IF S_REGISTERED_USER -->
<tr>
<td class="row1" valign="top"><span class="gen"><b>{L_OPTIONS}</b></span></td>
<td class="row2">
<table cellspacing="0" cellpadding="1" border="0">
<tr>
- <td><input type="checkbox" class="radio" name="cc_email" value="1" checked="checked" /></td>
- <td class="gen">{L_CC_EMAIL}</td>
+ <td><input type="checkbox" class="radio" name="cc_sender" value="1" checked="checked" /></td>
+ <td class="gen">{L_CC_SENDER}</td>
</tr>
</table>
</td>
</tr>
+ <!-- ENDIF -->
<tr>
<td class="cat" colspan="2" align="center"><input type="submit" tabindex="6" name="submit" class="btnmain" value="{L_SEND_EMAIL}" /></td>
</tr>
diff --git a/phpBB/styles/subsilver2/template/memberlist_search.html b/phpBB/styles/subsilver2/template/memberlist_search.html
index 12dd10be2e..2096062607 100644
--- a/phpBB/styles/subsilver2/template/memberlist_search.html
+++ b/phpBB/styles/subsilver2/template/memberlist_search.html
@@ -66,6 +66,7 @@
<form method="post" action="{S_MODE_ACTION}" name="search">
+<!-- EVENT memberlist_search_fields_before -->
<table class="tablebg" width="100%" cellspacing="1">
<tr>
<th colspan="4">{L_FIND_USERNAME}</th>
@@ -111,6 +112,7 @@
<td colspan="2" class="row1">&nbsp;</td>
<!-- ENDIF -->
</tr>
+<!-- EVENT memberlist_search_sorting_options_before -->
<tr>
<td class="row1"><b class="genmed">{L_SORT_BY}{L_COLON}</b></td>
<td class="row2" nowrap="nowrap"><select name="sk">{S_SORT_OPTIONS}</select> <select name="sd">{S_ORDER_SELECT}</select>&nbsp;</td>
@@ -120,6 +122,7 @@
<td class="cat" colspan="4" align="center"><input class="btnmain" type="submit" name="submit" value="{L_SEARCH}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" /></td>
</tr>
</table>
+<!-- EVENT memberlist_search_fields_after -->
{S_FORM_TOKEN}
</form>
diff --git a/phpBB/styles/subsilver2/template/overall_footer.html b/phpBB/styles/subsilver2/template/overall_footer.html
index 42ee17f2ed..176110c58d 100644
--- a/phpBB/styles/subsilver2/template/overall_footer.html
+++ b/phpBB/styles/subsilver2/template/overall_footer.html
@@ -23,5 +23,7 @@
{$SCRIPTS}
+<!-- EVENT overall_footer_body_after -->
+
</body>
</html>
diff --git a/phpBB/styles/subsilver2/template/overall_header.html b/phpBB/styles/subsilver2/template/overall_header.html
index 1361242471..f3693eb865 100644
--- a/phpBB/styles/subsilver2/template/overall_header.html
+++ b/phpBB/styles/subsilver2/template/overall_header.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
-<meta charset="utf-8">
+<meta charset="utf-8" />
{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/subsilver2/template/posting_buttons.html b/phpBB/styles/subsilver2/template/posting_buttons.html
index d1c0f79a16..516cd0922b 100644
--- a/phpBB/styles/subsilver2/template/posting_buttons.html
+++ b/phpBB/styles/subsilver2/template/posting_buttons.html
@@ -69,21 +69,18 @@
<!-- ENDIF -->
</select></span>
</div>
- <!-- EVENT posting_editor_buttons_after -->
-<!-- ENDIF -->
- </td>
-</tr>
-<!-- IF S_BBCODE_ALLOWED and .custom_tags -->
- <tr valign="middle" align="{S_CONTENT_FLOW_BEGIN}">
- <td colspan="2">
+ <!-- EVENT posting_editor_buttons_custom_tags_before -->
+ <!-- IF .custom_tags -->
<div id="custom-bbcode-buttons">
- <!-- BEGIN custom_tags -->
+ <!-- BEGIN custom_tags -->
<input type="button" class="btnbbcode bbcode-{custom_tags.BBCODE_TAG_CLEAN}" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})"<!-- IF custom_tags.BBCODE_HELPLINE !== '' --> onmouseover="helpline('cb_{custom_tags.BBCODE_ID}')" onmouseout="helpline('tip')"<!-- ENDIF --> />
- <!-- END custom_tags -->
+ <!-- END custom_tags -->
</div>
- </td>
- </tr>
+ <!-- ENDIF -->
+ <!-- EVENT posting_editor_buttons_after -->
<!-- ENDIF -->
+ </td>
+</tr>
<!-- IF S_BBCODE_ALLOWED -->
<tr>
<td<!-- IF $S_SIGNATURE or S_EDIT_DRAFT --> colspan="2"<!-- ENDIF -->><input type="text" readonly="readonly" name="helpbox" style="width:100%" class="helpline" value="{L_STYLES_TIP}" /></td>
diff --git a/phpBB/styles/subsilver2/template/posting_poll_body.html b/phpBB/styles/subsilver2/template/posting_poll_body.html
index 67996eaf33..8d98b36c86 100644
--- a/phpBB/styles/subsilver2/template/posting_poll_body.html
+++ b/phpBB/styles/subsilver2/template/posting_poll_body.html
@@ -15,7 +15,7 @@
</tr>
<tr>
<td class="row1"><b class="genmed">{L_POLL_MAX_OPTIONS}{L_COLON}</b><br /><span class="gensmall">{L_POLL_MAX_OPTIONS_EXPLAIN}</span></td>
- <td class="row2"><input class="post" type="number" min="1" max="999" name="poll_max_options" size="3" maxlength="3" value="{POLL_MAX_OPTIONS}" /></td>
+ <td class="row2"><input class="post" type="number" min="0" max="999" name="poll_max_options" size="3" maxlength="3" value="{POLL_MAX_OPTIONS}" /></td>
</tr>
<tr>
<td class="row1"><b class="genmed">{L_POLL_FOR}{L_COLON}</b></td>
diff --git a/phpBB/styles/subsilver2/template/search_results.html b/phpBB/styles/subsilver2/template/search_results.html
index 23d0b3a146..6f651b2618 100644
--- a/phpBB/styles/subsilver2/template/search_results.html
+++ b/phpBB/styles/subsilver2/template/search_results.html
@@ -1,5 +1,7 @@
<!-- INCLUDE overall_header.html -->
+<!-- EVENT search_results_header_before -->
+
<form method="post" action="{S_SEARCH_ACTION}">
<table width="100%" cellspacing="1">
@@ -8,10 +10,12 @@
</tr>
<tr>
<td class="genmed"><!-- IF SEARCH_TOPIC -->{L_SEARCHED_TOPIC}{L_COLON} <a href="{U_SEARCH_TOPIC}"><b>{SEARCH_TOPIC}</b></a><br /><!-- ENDIF --><!-- IF SEARCH_WORDS -->{L_SEARCHED_FOR}{L_COLON} <a href="{U_SEARCH_WORDS}"><b>{SEARCH_WORDS}</b></a><!-- ENDIF --><!-- IF IGNORED_WORDS --> {L_IGNORED_TERMS}{L_COLON} <b>{IGNORED_WORDS}</b><!-- ENDIF --></td>
- <td align="{S_CONTENT_FLOW_END}"><!-- IF SEARCH_IN_RESULTS --><span class="genmed">{L_SEARCH_IN_RESULTS}{L_COLON} </span><input class="post" type="text" name="add_keywords" value="" /> <input class="btnlite" type="submit" name="submit" value="{L_GO}" /><!-- ENDIF --></td>
+ <td align="{S_CONTENT_FLOW_END}"><!-- EVENT search_results_searchbox_after --><!-- IF SEARCH_IN_RESULTS --><span class="genmed">{L_SEARCH_IN_RESULTS}{L_COLON} </span><input class="post" type="text" name="add_keywords" value="" /> <input class="btnlite" type="submit" name="submit" value="{L_GO}" /><!-- ENDIF --></td>
</tr>
</table>
+<!-- EVENT search_results_header_after -->
+
<br clear="all" />
<!-- IF S_SHOW_TOPICS -->
diff --git a/phpBB/styles/subsilver2/template/simple_header.html b/phpBB/styles/subsilver2/template/simple_header.html
index d292c4594a..3abf89719f 100644
--- a/phpBB/styles/subsilver2/template/simple_header.html
+++ b/phpBB/styles/subsilver2/template/simple_header.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
-<meta charset="utf-8">
+<meta charset="utf-8" />
{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/subsilver2/template/ucp_avatar_options_local.html b/phpBB/styles/subsilver2/template/ucp_avatar_options_local.html
index 7beddfc109..919cf49e44 100644
--- a/phpBB/styles/subsilver2/template/ucp_avatar_options_local.html
+++ b/phpBB/styles/subsilver2/template/ucp_avatar_options_local.html
@@ -14,19 +14,19 @@
<!-- BEGIN avatar_local_row -->
<tr>
<!-- BEGIN avatar_local_col -->
- <td class="row1" align="center"><img src="{avatar_local_col.avatar_local_col.AVATAR_IMAGE}" alt="{avatar_local_col.avatar_local_col.AVATAR_NAME}" title="{avatar_local_col.avatar_local_col.AVATAR_NAME}" /></td>
+ <td class="row1" align="center" id="av-{avatar_local_row.S_ROW_COUNT}-{avatar_local_row.avatar_local_col.S_ROW_COUNT}"><img src="{avatar_local_row.avatar_local_col.AVATAR_IMAGE}" alt="{avatar_local_row.avatar_local_col.AVATAR_NAME}" title="{avatar_local_row.avatar_local_col.AVATAR_NAME}" /></td>
<!-- END avatar_local_col -->
</tr>
<tr>
<!-- BEGIN avatar_local_option -->
- <td class="row2" align="center"><input type="radio" class="radio" name="avatar_local_file" value="{avatar_local_col.avatar_local_option.S_OPTIONS_AVATAR}" /></td>
+ <td class="row2" align="center"><input type="radio" class="radio" name="avatar_local_file" id="av-{avatar_local_row.S_ROW_COUNT}-{avatar_local_row.avatar_local_col.S_ROW_COUNT}" value="{avatar_local_row.avatar_local_option.S_OPTIONS_AVATAR}" /></td>
<!-- END avatar_local_option -->
</tr>
<!-- BEGINELSE -->
<tr>
<td class="row1" colspan="2">{L_NO_AVATAR_CATEGORY}</td>
</tr>
- <!-- END avatar_local_col -->
+ <!-- END avatar_local_row -->
</table>
</td>
</tr>
diff --git a/phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html b/phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html
index f70f39f9d8..fd5e390d83 100644
--- a/phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html
+++ b/phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
-<meta charset="utf-8">
+<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>{SITENAME} :: {PAGE_TITLE}</title>
@@ -78,7 +78,7 @@ hr.sep {
<td width="10%" nowrap="nowrap">{L_PM_FROM}{L_COLON}&nbsp;</td>
<td><b>{MESSAGE_AUTHOR}</b> [ {SENT_DATE} ]</td>
</tr>
-
+
<!-- IF S_TO_RECIPIENT -->
<tr>
<td width="10%" nowrap="nowrap">{L_TO}{L_COLON}</td>
diff --git a/phpBB/styles/subsilver2/template/ucp_profile_autologin_keys.html b/phpBB/styles/subsilver2/template/ucp_profile_autologin_keys.html
index 3f63319b59..087ae89743 100644
--- a/phpBB/styles/subsilver2/template/ucp_profile_autologin_keys.html
+++ b/phpBB/styles/subsilver2/template/ucp_profile_autologin_keys.html
@@ -16,9 +16,9 @@
</tr>
<tr>
<th>{L_LOGIN_KEY}</th>
- <th>{L_IP}</th>
- <th>{L_LOGIN_TIME}</th>
- <th>{L_MARK}</th>
+ <th class="center">{L_IP}</th>
+ <th class="center">{L_LOGIN_TIME}</th>
+ <th class="center">{L_MARK}</th>
</tr>
<!-- BEGIN sessions -->
<!-- IF sessions.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html b/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html
index 2d0140a15d..bfc2dd0244 100644
--- a/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html
+++ b/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html
@@ -12,6 +12,7 @@
<tr>
<td class="row1" colspan="2"><span class="gensmall">{L_PROFILE_INFO_NOTICE}</span></td>
</tr>
+<!-- EVENT ucp_profile_profile_info_before -->
<!-- IF S_JABBER_ENABLED -->
<tr>
<td class="row1" width="35%"><b class="genmed">{L_UCP_JABBER}{L_COLON} </b></td>
@@ -34,6 +35,7 @@
<td class="row2">{profile_fields.FIELD}<!-- IF profile_fields.ERROR --><br /><span class="gensmall error">{profile_fields.ERROR}</span><!-- ENDIF --></td>
</tr>
<!-- END profile_fields -->
+<!-- EVENT ucp_profile_profile_info_after -->
<tr>
<td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" name="reset" /></td>
</tr>
diff --git a/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html b/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html
index d8fe84bf79..090d729326 100644
--- a/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html
+++ b/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html
@@ -14,6 +14,7 @@
<td class="row3" colspan="2" align="center"><span class="gensmall error">{ERROR}</span></td>
</tr>
<!-- ENDIF -->
+<!-- EVENT ucp_profile_register_details_before -->
<tr>
<td class="row1" width="35%"><b class="genmed">{L_USERNAME}{L_COLON} </b><br /><span class="gensmall">{L_USERNAME_EXPLAIN}</span></td>
<td class="row2"><!-- IF S_CHANGE_USERNAME --><input type="text" class="post" name="username" size="30" value="{USERNAME}" /><!-- ELSE --><b class="gen">{USERNAME}</b><!-- ENDIF --></td>
@@ -32,6 +33,7 @@
<td class="row2"><input type="password" class="post" name="password_confirm" size="30" maxlength="255" value="{PASSWORD_CONFIRM}" /></td>
</tr>
<!-- ENDIF -->
+<!-- EVENT ucp_profile_register_details_after -->
<tr>
<th colspan="2">{L_CONFIRM_CHANGES}</th>
</tr>
diff --git a/phpBB/styles/subsilver2/template/viewforum_body.html b/phpBB/styles/subsilver2/template/viewforum_body.html
index e34d1807e6..925581ffcd 100644
--- a/phpBB/styles/subsilver2/template/viewforum_body.html
+++ b/phpBB/styles/subsilver2/template/viewforum_body.html
@@ -150,9 +150,16 @@
<!-- IF S_DISPLAY_POST_INFO or TOTAL_TOPICS -->
<table width="100%" cellspacing="1">
<tr>
+ <td align="{S_CONTENT_FLOW_BEGIN}" valign="middle" nowrap="nowrap">
+ <!-- EVENT viewforum_buttons_top_before -->
+
<!-- IF S_DISPLAY_POST_INFO and not S_IS_BOT -->
- <td align="{S_CONTENT_FLOW_BEGIN}" valign="middle"><a href="{U_POST_NEW_TOPIC}" class="imageset">{POST_IMG}</a></td>
+ <a href="{U_POST_NEW_TOPIC}" class="imageset">{POST_IMG}</a>
<!-- ENDIF -->
+
+ <!-- EVENT viewforum_buttons_top_after -->
+ </td>
+
<!-- IF TOTAL_TOPICS -->
<td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}<br /></td>
<td class="gensmall" nowrap="nowrap">&nbsp;[ {TOTAL_TOPICS} ]&nbsp;</td>
@@ -273,9 +280,16 @@
<!-- IF S_DISPLAY_POST_INFO or TOTAL_TOPICS -->
<table width="100%" cellspacing="1">
<tr>
+ <td align="{S_CONTENT_FLOW_BEGIN}" valign="middle" nowrap="nowrap">
+ <!-- EVENT viewforum_buttons_bottom_before -->
+
<!-- IF S_DISPLAY_POST_INFO and not S_IS_BOT -->
- <td align="{S_CONTENT_FLOW_BEGIN}" valign="middle"><a href="{U_POST_NEW_TOPIC}" class="imageset">{POST_IMG}</a></td>
+ <a href="{U_POST_NEW_TOPIC}" class="imageset">{POST_IMG}</a>
<!-- ENDIF -->
+
+ <!-- EVENT viewforum_buttons_bottom_after -->
+ </td>
+
<!-- IF TOTAL_TOPICS -->
<td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}<br /></td>
<td class="gensmall" nowrap="nowrap">&nbsp;[ {TOTAL_TOPICS} ]&nbsp;</td>
diff --git a/phpBB/styles/subsilver2/template/viewtopic_body.html b/phpBB/styles/subsilver2/template/viewtopic_body.html
index 838f6c5f03..721aa5cb01 100644
--- a/phpBB/styles/subsilver2/template/viewtopic_body.html
+++ b/phpBB/styles/subsilver2/template/viewtopic_body.html
@@ -32,15 +32,19 @@
<table width="100%" cellspacing="1">
<tr>
<td align="{S_CONTENT_FLOW_BEGIN}" valign="middle" nowrap="nowrap">
+ <!-- EVENT viewtopic_buttons_top_before -->
+
<!-- IF not S_IS_BOT -->
<!-- IF S_DISPLAY_POST_INFO --><a href="{U_POST_NEW_TOPIC}" class="imageset">{POST_IMG}</a>&nbsp;<!-- ENDIF -->
<!-- IF S_DISPLAY_REPLY_INFO --><a href="{U_POST_REPLY_TOPIC}" class="imageset">{REPLY_IMG}</a><!-- ENDIF -->
<!-- ENDIF -->
+
+ <!-- EVENT viewtopic_buttons_top_after -->
</td>
<!-- IF TOTAL_POSTS -->
<td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}<br /></td>
<td class="gensmall" nowrap="nowrap">&nbsp;[ {TOTAL_POSTS} ]&nbsp;</td>
- <td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- INCLUDE pagination.html --></td>
+ <td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- INCLUDE pagination.html --><!-- EVENT viewtopic_body_pagination_top_after --></td>
<!-- ENDIF -->
</tr>
</table>
@@ -159,8 +163,11 @@
<a id="unread" class="anchor"<!-- IF S_UNREAD_VIEW --> data-url="{postrow.U_MINI_POST}"<!-- ENDIF -->></a>
<!-- ENDIF -->
<a name="p{postrow.POST_ID}" class="anchor"></a>
+ <!-- EVENT viewtopic_body_post_author_before -->
<b class="postauthor"<!-- IF postrow.POST_AUTHOR_COLOUR --> style="color: {postrow.POST_AUTHOR_COLOUR}"<!-- ENDIF -->>{postrow.POST_AUTHOR}</b>
+ <!-- EVENT viewtopic_body_post_author_after -->
</td>
+ <!-- EVENT viewtopic_body_postrow_post_details_before -->
<td width="100%" height="25">
<table width="100%" cellspacing="0">
<tr>
@@ -171,6 +178,7 @@
</tr>
</table>
</td>
+ <!-- EVENT viewtopic_body_postrow_post_details_after -->
</tr>
<!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
@@ -371,10 +379,14 @@
<table width="100%" cellspacing="1">
<tr>
<td align="{S_CONTENT_FLOW_BEGIN}" valign="middle" nowrap="nowrap">
+ <!-- EVENT viewtopic_buttons_bottom_before -->
+
<!-- IF not S_IS_BOT -->
<!-- IF S_DISPLAY_POST_INFO --><a href="{U_POST_NEW_TOPIC}" class="imageset">{POST_IMG}</a>&nbsp;<!-- ENDIF -->
<!-- IF S_DISPLAY_REPLY_INFO --><a href="{U_POST_REPLY_TOPIC}" class="imageset">{REPLY_IMG}</a><!-- ENDIF -->
<!-- ENDIF -->
+
+ <!-- EVENT viewtopic_buttons_bottom_after -->
</td>
<!-- IF TOTAL_POSTS -->
<td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}<br /></td>
diff --git a/phpBB/styles/subsilver2/template/viewtopic_print.html b/phpBB/styles/subsilver2/template/viewtopic_print.html
index a99d807cf2..9497fda121 100644
--- a/phpBB/styles/subsilver2/template/viewtopic_print.html
+++ b/phpBB/styles/subsilver2/template/viewtopic_print.html
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
<head>
-<meta charset="utf-8">
+<meta charset="utf-8" />
<meta name="robots" content="noindex" />
<title>{SITENAME} :: {PAGE_TITLE}</title>
@@ -23,7 +23,7 @@ td {
line-height: 150%;
}
-.code, .codecontent,
+.code, .codecontent,
.quote, .quotecontent {
margin: 0 5px 0 5px;
padding: 5px;
diff --git a/phpBB/styles/subsilver2/theme/images/index.htm b/phpBB/styles/subsilver2/theme/images/index.htm
index 29531416fe..957f68a803 100644
--- a/phpBB/styles/subsilver2/theme/images/index.htm
+++ b/phpBB/styles/subsilver2/theme/images/index.htm
@@ -1,7 +1,7 @@
<html>
<head>
<title>subSilver created by subBlue Design</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body bgcolor="#FFFFFF" text="#000000">
diff --git a/phpBB/styles/subsilver2/theme/stylesheet.css b/phpBB/styles/subsilver2/theme/stylesheet.css
index 3c7ff23db5..7764020567 100644
--- a/phpBB/styles/subsilver2/theme/stylesheet.css
+++ b/phpBB/styles/subsilver2/theme/stylesheet.css
@@ -322,6 +322,10 @@ th {
padding: 7px 5px;
}
+th.center {
+ text-align: center;
+}
+
td {
padding: 2px;
}
diff --git a/phpBB/ucp.php b/phpBB/ucp.php
index 182bc2e285..8c74ca1f3c 100644
--- a/phpBB/ucp.php
+++ b/phpBB/ucp.php
@@ -164,6 +164,22 @@ switch ($mode)
$cookie_name = str_replace($config['cookie_name'] . '_', '', $cookie_name);
+ /**
+ * Event to save custom cookies from deletion
+ *
+ * @event core.ucp_delete_cookies
+ * @var string cookie_name Cookie name to checking
+ * @var bool retain_cookie Do we retain our cookie or not, true if retain
+ * @since 3.1.3-RC1
+ */
+ $retain_cookie = false;
+ $vars = array('cookie_name', 'retain_cookie');
+ extract($phpbb_dispatcher->trigger_event('core.ucp_delete_cookies', compact($vars)));
+ if ($retain_cookie)
+ {
+ continue;
+ }
+
// Polls are stored as {cookie_name}_poll_{topic_id}, cookie_name_ got removed, therefore checking for poll_
if (strpos($cookie_name, 'poll_') !== 0)
{
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index 6379da6802..cd55114bad 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -370,7 +370,7 @@ $template->assign_vars(array(
'U_MCP' => ($auth->acl_get('m_', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", "f=$forum_id&amp;i=main&amp;mode=forum_view", true, $user->session_id) : '',
'U_POST_NEW_TOPIC' => ($auth->acl_get('f_post', $forum_id) || $user->data['user_id'] == ANONYMOUS) ? append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=post&amp;f=' . $forum_id) : '',
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . ((strlen($u_sort_param)) ? "&amp;$u_sort_param" : '') . (($start == 0) ? '' : "&amp;start=$start")),
- 'U_CANONICAL' => generate_board_url() . '/' . append_sid("viewforum.$phpEx", "f=$forum_id" . ((strlen($u_sort_param)) ? "&amp;$u_sort_param" : '') . (($start) ? "&amp;start=$start" : ''), true, ''),
+ 'U_CANONICAL' => generate_board_url() . '/' . append_sid("viewforum.$phpEx", "f=$forum_id" . (($start) ? "&amp;start=$start" : ''), true, ''),
'U_MARK_TOPICS' => ($user->data['is_registered'] || $config['load_anon_lastread']) ? append_sid("{$phpbb_root_path}viewforum.$phpEx", 'hash=' . generate_link_hash('global') . "&amp;f=$forum_id&amp;mark=topics&amp;mark_time=" . time()) : '',
));
@@ -391,15 +391,29 @@ $sql_array = array(
/**
* Event to modify the SQL query before the topic data is retrieved
*
+* It may also be used to override the above assigned template vars
+*
* @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):
+* Author, Post time, Replies, Subject, Views
+* @var array 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.0-RC4 Added forum_data var
+* @change 3.1.4-RC1 Added forum_id, topics_count, sort_days, sort_key and sort_dir vars
*/
$vars = array(
'forum_data',
'sql_array',
+ 'forum_id',
+ 'topics_count',
+ 'sort_days',
+ 'sort_key',
+ 'sort_dir',
);
extract($phpbb_dispatcher->trigger_event('core.viewforum_get_topic_data', compact($vars)));
@@ -504,8 +518,8 @@ if ($start > $topics_count / 2)
// Select the sort order
$direction = (($sort_dir == 'd') ? 'ASC' : 'DESC');
- $sql_limit = $pagination->reverse_limit($start, $sql_limit, $topics_count);
- $sql_start = $pagination->reverse_start($start, $sql_limit, $topics_count);
+ $sql_limit = $pagination->reverse_limit($start, $sql_limit, $topics_count - sizeof($announcement_list));
+ $sql_start = $pagination->reverse_start($start, $sql_limit, $topics_count - sizeof($announcement_list));
}
else
{
@@ -554,6 +568,7 @@ $sql_ary = array(
* Event to modify the SQL query before the topic ids data is retrieved
*
* @event core.viewforum_get_topic_ids_data
+* @var array forum_data Data about the forum
* @var array sql_ary SQL query array to get the topic ids data
* @var string sql_approved Topic visibility SQL string
* @var int sql_limit Number of records to select
@@ -564,8 +579,11 @@ $sql_ary = array(
* @var bool store_reverse Flag indicating if we select from the late pages
*
* @since 3.1.0-RC4
+*
+* @changed 3.1.3 Added forum_data
*/
$vars = array(
+ 'forum_data',
'sql_ary',
'sql_approved',
'sql_limit',
@@ -694,10 +712,10 @@ if ($s_display_active)
// We need to remove the global announcements from the forums total topic count,
// otherwise the number is different from the one on the forum list
-$total_topic_count = $topics_count - sizeof($global_announce_forums);
+$total_topic_count = $topics_count - sizeof($announcement_list);
$base_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id" . ((strlen($u_sort_param)) ? "&amp;$u_sort_param" : ''));
-$pagination->generate_template_pagination($base_url, 'pagination', 'start', $topics_count, $config['topics_per_page'], $start);
+$pagination->generate_template_pagination($base_url, 'pagination', 'start', $total_topic_count, $config['topics_per_page'], $start);
$template->assign_vars(array(
'TOTAL_TOPICS' => ($s_display_active) ? false : $user->lang('VIEW_FORUM_TOPICS', (int) $total_topic_count),
@@ -883,6 +901,28 @@ if (sizeof($topic_list))
$s_type_switch = ($row['topic_type'] == POST_ANNOUNCE || $row['topic_type'] == POST_GLOBAL) ? 1 : 0;
+ /**
+ * Event after the topic data has been assigned to the template
+ *
+ * @event core.viewforum_topic_row_after
+ * @var array row Array with the topic data
+ * @var array rowset Array with topics data (in topic_id => topic_data format)
+ * @var bool s_type_switch Flag indicating if the topic type is [global] announcement
+ * @var int topic_id The topic ID
+ * @var array topic_list Array with current viewforum page topic ids
+ * @var array topic_row Template array with topic data
+ * @since 3.1.3-RC1
+ */
+ $vars = array(
+ 'row',
+ 'rowset',
+ 's_type_switch',
+ 'topic_id',
+ 'topic_list',
+ 'topic_row',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.viewforum_topic_row_after', compact($vars)));
+
if ($unread_topic)
{
$mark_forum_read = false;
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index f8b4a54f05..131230897f 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -336,8 +336,41 @@ if (($topic_data['topic_type'] == POST_STICKY || $topic_data['topic_type'] == PO
// Setup look and feel
$user->setup('viewtopic', $topic_data['forum_style']);
+$overrides_f_read_check = false;
+$overrides_forum_password_check = false;
+$topic_tracking_info = isset($topic_tracking_info) ? $topic_tracking_info : null;
+
+/**
+* Event to apply extra permissions and to override original phpBB's f_read permission and forum password check
+* on viewtopic access
+*
+* @event core.viewtopic_before_f_read_check
+* @var int forum_id The forum id from where the topic belongs
+* @var int topic_id The id of the topic the user tries to access
+* @var int post_id The id of the post the user tries to start viewing at.
+* It may be 0 for none given.
+* @var array topic_data All the information from the topic and forum tables for this topic
+* It includes posts information if post_id is not 0
+* @var bool overrides_f_read_check Set true to remove f_read check afterwards
+* @var bool overrides_forum_password_check Set true to remove forum_password check afterwards
+* @var array topic_tracking_info Information upon calling get_topic_tracking()
+* Set it to NULL to allow auto-filling later.
+* Set it to an array to override original data.
+* @since 3.1.3-RC1
+*/
+$vars = array(
+ 'forum_id',
+ 'topic_id',
+ 'post_id',
+ 'topic_data',
+ 'overrides_f_read_check',
+ 'overrides_forum_password_check',
+ 'topic_tracking_info',
+);
+extract($phpbb_dispatcher->trigger_event('core.viewtopic_before_f_read_check', compact($vars)));
+
// Start auth check
-if (!$auth->acl_get('f_read', $forum_id))
+if (!$overrides_f_read_check && !$auth->acl_get('f_read', $forum_id))
{
if ($user->data['user_id'] != ANONYMOUS)
{
@@ -349,7 +382,7 @@ if (!$auth->acl_get('f_read', $forum_id))
// Forum is passworded ... check whether access has been granted to this
// user this session, if not show login box
-if ($topic_data['forum_password'])
+if (!$overrides_forum_password_check && $topic_data['forum_password'])
{
login_forum_box($topic_data);
}
@@ -616,7 +649,9 @@ $base_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=
* @var int topic_id Topic ID
* @var array topic_tracking_info Array with topic tracking data
* @var int total_posts Topic total posts count
+* @var string viewtopic_url URL to the topic page
* @since 3.1.0-RC4
+* @change 3.1.2-RC1 Added viewtopic_url
*/
$vars = array(
'base_url',
@@ -628,6 +663,7 @@ $vars = array(
'topic_id',
'topic_tracking_info',
'total_posts',
+ 'viewtopic_url',
);
extract($phpbb_dispatcher->trigger_event('core.viewtopic_assign_template_vars_before', compact($vars)));
@@ -689,7 +725,7 @@ $template->assign_vars(array(
'U_TOPIC' => "{$server_path}viewtopic.$phpEx?f=$forum_id&amp;t=$topic_id",
'U_FORUM' => $server_path,
'U_VIEW_TOPIC' => $viewtopic_url,
- 'U_CANONICAL' => generate_board_url() . '/' . append_sid("viewtopic.$phpEx", "t=$topic_id" . ((strlen($u_sort_param)) ? "&amp;$u_sort_param" : '') . (($start) ? "&amp;start=$start" : ''), true, ''),
+ 'U_CANONICAL' => generate_board_url() . '/' . append_sid("viewtopic.$phpEx", "t=$topic_id" . (($start) ? "&amp;start=$start" : ''), true, ''),
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id),
'U_VIEW_OLDER_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;view=previous"),
'U_VIEW_NEWER_TOPIC' => append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;view=next"),
@@ -979,7 +1015,6 @@ else
// Container for user details, only process once
$post_list = $user_cache = $id_cache = $attachments = $attach_list = $rowset = $update_count = $post_edit_list = $post_delete_list = array();
$has_unapproved_attachments = $has_approved_attachments = $display_notice = false;
-$bbcode_bitfield = '';
$i = $i_total = 0;
// Go ahead and pull all data for this topic
@@ -1145,15 +1180,6 @@ while ($row = $db->sql_fetchrow($result))
$rowset[$row['post_id']] = $rowset_data;
- // Define the global bbcode bitfield, will be used to load bbcodes
- $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['bbcode_bitfield']);
-
- // Is a signature attached? Are we going to display it?
- if ($row['enable_sig'] && $config['allow_sig'] && $user->optionget('viewsigs'))
- {
- $bbcode_bitfield = $bbcode_bitfield | base64_decode($row['user_sig_bbcode_bitfield']);
- }
-
// Cache various user specific data ... so we don't have to recompute
// this each time the same user appears on this page
if (!isset($user_cache[$poster_id]))
@@ -1203,7 +1229,10 @@ while ($row = $db->sql_fetchrow($result))
$user_cache[$poster_id] = $user_cache_data;
- get_user_rank($row['user_rank'], false, $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']);
+ $user_rank_data = phpbb_get_user_rank($row, false);
+ $user_cache[$poster_id]['rank_title'] = $user_rank_data['title'];
+ $user_cache[$poster_id]['rank_image'] = $user_rank_data['img'];
+ $user_cache[$poster_id]['rank_image_src'] = $user_rank_data['img_src'];
}
else
{
@@ -1244,8 +1273,8 @@ while ($row = $db->sql_fetchrow($result))
'contact_user' => $user->lang('CONTACT_USER', get_username_string('username', $poster_id, $row['username'], $row['user_colour'], $row['username'])),
'online' => false,
- 'jabber' => ($row['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&amp;action=jabber&amp;u=$poster_id") : '',
- 'search' => ($auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$poster_id&amp;sr=posts") : '',
+ 'jabber' => ($config['jab_enable'] && $row['user_jabber'] && $auth->acl_get('u_sendim')) ? append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=contact&amp;action=jabber&amp;u=$poster_id") : '',
+ 'search' => ($config['load_search'] && $auth->acl_get('u_search')) ? append_sid("{$phpbb_root_path}search.$phpEx", "author_id=$poster_id&amp;sr=posts") : '',
'author_full' => get_username_string('full', $poster_id, $row['username'], $row['user_colour']),
'author_colour' => get_username_string('colour', $poster_id, $row['username'], $row['user_colour']),
@@ -1267,7 +1296,10 @@ while ($row = $db->sql_fetchrow($result))
$user_cache[$poster_id] = $user_cache_data;
- get_user_rank($row['user_rank'], $row['user_posts'], $user_cache[$poster_id]['rank_title'], $user_cache[$poster_id]['rank_image'], $user_cache[$poster_id]['rank_image_src']);
+ $user_rank_data = phpbb_get_user_rank($row, $row['user_posts']);
+ $user_cache[$poster_id]['rank_title'] = $user_rank_data['title'];
+ $user_cache[$poster_id]['rank_image'] = $user_rank_data['img'];
+ $user_cache[$poster_id]['rank_image_src'] = $user_rank_data['img_src'];
if ((!empty($row['user_allow_viewemail']) && $auth->acl_get('u_sendemail')) || $auth->acl_get('a_email'))
{
@@ -1421,12 +1453,6 @@ if (sizeof($attach_list))
}
}
-// Instantiate BBCode if need be
-if ($bbcode_bitfield !== '')
-{
- $bbcode = new bbcode(base64_encode($bbcode_bitfield));
-}
-
// Get the list of users who can receive private messages
$can_receive_pm_list = $auth->acl_get_list(array_keys($user_cache), 'u_readpm');
$can_receive_pm_list = (empty($can_receive_pm_list) || !isset($can_receive_pm_list[0]['u_readpm'])) ? array() : $can_receive_pm_list[0]['u_readpm'];
diff --git a/phpBB/web.config b/phpBB/web.config
index a73c328626..99a1fe6023 100644
--- a/phpBB/web.config
+++ b/phpBB/web.config
@@ -1,6 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
+ <rewrite>
+ <rules>
+ <rule name="Extension Routes" stopProcessing="true">
+ <match url="^(.*)$" ignoreCase="true" />
+ <conditions>
+ <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
+ <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
+ </conditions>
+ <action type="Rewrite" url="app.php" appendQueryString="true" />
+ </rule>
+ </rules>
+ </rewrite>
<security>
<requestFiltering>
<hiddenSegments>
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 3475742288..c6e539b7ba 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -16,6 +16,7 @@
<directory suffix="_test.php">./tests</directory>
<exclude>./tests/functional</exclude>
<exclude>./tests/lint_test.php</exclude>
+ <exclude>./tests/ui</exclude>
</testsuite>
<testsuite name="phpBB Functional Tests">
<directory suffix="_test.php">./tests/functional</directory>
@@ -23,6 +24,10 @@
<testsuite name="phpBB Lint Test">
<file>./tests/lint_test.php</file>
</testsuite>
+ <testsuite name="phpBB UI Tests">
+ <directory suffix="_test.php" phpVersion="5.3.19"
+ phpVersionOperator=">=">./tests/ui</directory>
+ </testsuite>
</testsuites>
<groups>
@@ -32,15 +37,9 @@
</groups>
<filter>
- <blacklist>
- <directory>./tests</directory>
- </blacklist>
<whitelist>
<directory suffix=".php">./phpBB/includes/</directory>
<directory suffix=".php">./phpBB/phpbb/</directory>
- <exclude>
- <directory suffix=".php">./phpBB/includes/captcha/</directory>
- </exclude>
</whitelist>
</filter>
</phpunit>
diff --git a/tests/auth/provider_db_test.php b/tests/auth/provider_db_test.php
index e33eae6b54..09ca0816bf 100644
--- a/tests/auth/provider_db_test.php
+++ b/tests/auth/provider_db_test.php
@@ -78,7 +78,14 @@ class phpbb_auth_provider_db_test extends phpbb_database_test_case
),
);
- $this->assertEquals($expected, $provider->login('foobar', 'example'));
+ $login_return = $provider->login('foobar', 'example');
+ $this->assertEquals($expected['status'], $login_return['status']);
+ $this->assertEquals($expected['error_msg'], $login_return['error_msg']);
+
+ foreach ($expected['user_row'] as $key => $value)
+ {
+ $this->assertEquals($value, $login_return['user_row'][$key]);
+ }
// Check if convert works
$login_return = $provider->login('foobar2', 'example');
diff --git a/tests/avatar/fixtures/users.xml b/tests/avatar/fixtures/users.xml
index 3e6586e909..1773d438c2 100644
--- a/tests/avatar/fixtures/users.xml
+++ b/tests/avatar/fixtures/users.xml
@@ -29,5 +29,33 @@
<value></value>
<value></value>
</row>
+ <row>
+ <value>3</value>
+ <value>foo</value>
+ <value></value>
+ <value></value>
+ <value>g5_1414350991.jpg</value>
+ <value>avatar.driver.upload</value>
+ <value>80</value>
+ <value>80</value>
+ </row>
+ </table>
+ <table name="phpbb_groups">
+ <column>group_id</column>
+ <column>group_type</column>
+ <column>group_name</column>
+ <column>group_avatar</column>
+ <column>group_avatar_type</column>
+ <column>group_avatar_width</column>
+ <column>group_avatar_height</column>
+ <row>
+ <value>5</value>
+ <value>3</value>
+ <value>ADMINISTRATORS</value>
+ <value>g5_1414350991.jpg</value>
+ <value>avatar.driver.upload</value>
+ <value>80</value>
+ <value>80</value>
+ </row>
</table>
</dataset>
diff --git a/tests/avatar/manager_test.php b/tests/avatar/manager_test.php
index 81c153aed4..a109a7b5de 100644
--- a/tests/avatar/manager_test.php
+++ b/tests/avatar/manager_test.php
@@ -299,17 +299,32 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
public function data_handle_avatar_delete()
{
return array(
- array(array(
- 'avatar' => '',
- 'avatar_type' => '',
- 'avatar_width' => 0,
- 'avatar_height' => 0,
- ), 1, array(
- 'avatar' => 'foobar@example.com',
- 'avatar_type' => 'avatar.driver.gravatar',
- 'avatar_width' => '16',
- 'avatar_height' => '16',
- ), USERS_TABLE, 'user_'),
+ array(
+ array(
+ 'avatar' => '',
+ 'avatar_type' => '',
+ 'avatar_width' => 0,
+ 'avatar_height' => 0,
+ ), 1, array(
+ 'avatar' => 'foobar@example.com',
+ 'avatar_type' => 'avatar.driver.gravatar',
+ 'avatar_width' => '16',
+ 'avatar_height' => '16',
+ ), USERS_TABLE, 'user_',
+ ),
+ array(
+ array(
+ 'avatar' => '',
+ 'avatar_type' => '',
+ 'avatar_width' => 0,
+ 'avatar_height' => 0,
+ ), 5, array(
+ 'avatar' => 'g5_1414350991.jpg',
+ 'avatar_type' => 'avatar.driver.upload',
+ 'avatar_width' => '80',
+ 'avatar_height' => '80'
+ ), GROUPS_TABLE, 'group_',
+ ),
);
}
@@ -333,4 +348,23 @@ class phpbb_avatar_manager_test extends \phpbb_database_test_case
$this->assertEquals($value, $row[$key]);
}
}
+
+ /**
+ * @dependsOn test_handle_avatar_delete
+ */
+ public function test_user_group_avatar_deleted()
+ {
+ $sql = 'SELECT * FROM ' . USERS_TABLE . '
+ WHERE user_id = 3';
+ $result = $this->db->sql_query_limit($sql, 1);
+ $row = $this->manager->clean_row($this->db->sql_fetchrow($result), 'user');
+ $this->db->sql_freeresult($result);
+
+ $this->assertEquals(array(
+ 'avatar' => '',
+ 'avatar_type' => '',
+ 'avatar_width' => 0,
+ 'avatar_height' => 0,
+ ), $row);
+ }
}
diff --git a/tests/bootstrap.php b/tests/bootstrap.php
index 40c6ef7dfa..0e81f4372a 100644
--- a/tests/bootstrap.php
+++ b/tests/bootstrap.php
@@ -33,3 +33,9 @@ require_once 'test_framework/phpbb_test_case.php';
require_once 'test_framework/phpbb_database_test_case.php';
require_once 'test_framework/phpbb_database_test_connection_manager.php';
require_once 'test_framework/phpbb_functional_test_case.php';
+require_once 'test_framework/phpbb_ui_test_case.php';
+
+if (version_compare(PHP_VERSION, '5.3.19', ">=") && file_exists(__DIR__ . '/vendor/autoload.php'))
+{
+ require_once __DIR__ . '/vendor/autoload.php';
+}
diff --git a/tests/cache/cache_memory.php b/tests/cache/cache_memory.php
new file mode 100644
index 0000000000..806edb963a
--- /dev/null
+++ b/tests/cache/cache_memory.php
@@ -0,0 +1,64 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+class phpbb_cache_memory extends \phpbb\cache\driver\memory
+{
+ protected $data = array();
+
+ /**
+ * Set cache path
+ */
+ function phpbb_cache_memory()
+ {
+ }
+
+ /**
+ * Fetch an item from the cache
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @return mixed Cached data
+ */
+ function _read($var)
+ {
+ return $this->data[$var];
+ }
+
+ /**
+ * Store data in the cache
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @param mixed $data Data to store
+ * @param int $ttl Time-to-live of cached data
+ * @return bool True if the operation succeeded
+ */
+ function _write($var, $data, $ttl = 2592000)
+ {
+ $this->data[$var] = $data;
+ return true;
+ }
+
+ /**
+ * Remove an item from the cache
+ *
+ * @access protected
+ * @param string $var Cache key
+ * @return bool True if the operation succeeded
+ */
+ function _delete($var)
+ {
+ unset($this->data[$var]);
+ return true;
+ }
+}
diff --git a/tests/cache/cache_memory_test.php b/tests/cache/cache_memory_test.php
new file mode 100644
index 0000000000..9f92e8d8dc
--- /dev/null
+++ b/tests/cache/cache_memory_test.php
@@ -0,0 +1,129 @@
+<?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 dirname(__FILE__) . '/cache_memory.php';
+
+class phpbb_cache_memory_test extends phpbb_database_test_case
+{
+ protected $cache;
+ protected $db;
+
+ public function getDataSet()
+ {
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/cache_memory.xml');
+ }
+
+ protected function setUp()
+ {
+ global $db;
+ parent::setUp();
+
+ $this->cache = new phpbb_cache_memory();
+ $db = $this->new_dbal();
+ $this->db = $db;
+ }
+
+ static public function cache_single_query_data()
+ {
+ return array(
+ array(
+ array(
+ array(
+ 'SELECT * FROM ' . POSTS_TABLE,
+ 3,
+ ),
+ ),
+ POSTS_TABLE,
+ ),
+ array(
+ array(
+ array(
+ 'SELECT * FROM ' . POSTS_TABLE,
+ 3,
+ ),
+ array(
+ 'SELECT * FROM ' . POSTS_TABLE . ' p
+ LEFT JOIN ' . TOPICS_TABLE . ' t ON p.topic_id = t.topic_id',
+ 3,
+ ),
+ ),
+ POSTS_TABLE,
+ ),
+ array(
+ array(
+ array(
+ 'SELECT * FROM ' . POSTS_TABLE,
+ 3,
+ ),
+ array(
+ 'SELECT * FROM ' . POSTS_TABLE . ' p
+ LEFT JOIN ' . TOPICS_TABLE . ' t ON p.topic_id = t.topic_id',
+ 3,
+ ),
+ array(
+ 'SELECT * FROM ' . POSTS_TABLE . ' p
+ LEFT JOIN ' . TOPICS_TABLE . ' t ON p.topic_id = t.topic_id
+ LEFT JOIN ' . USERS_TABLE . ' u ON p.poster_id = u.user_id',
+ 3,
+ ),
+ ),
+ POSTS_TABLE,
+ ),
+ array(
+ array(
+ array(
+ 'SELECT * FROM ' . POSTS_TABLE . ' p
+ LEFT JOIN ' . TOPICS_TABLE . ' t ON p.topic_id = t.topic_id',
+ 3,
+ ),
+ array(
+ 'SELECT * FROM ' . POSTS_TABLE . ' p
+ LEFT JOIN ' . TOPICS_TABLE . ' t ON p.topic_id = t.topic_id
+ LEFT JOIN ' . USERS_TABLE . ' u ON p.poster_id = u.user_id',
+ 3,
+ ),
+ ),
+ TOPICS_TABLE,
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider cache_single_query_data
+ */
+ public function test_cache_single_query($sql_queries, $table)
+ {
+ foreach ($sql_queries as $query)
+ {
+ $sql_request_res = $this->db->sql_query($query[0]);
+
+ $this->cache->sql_save($this->db, $query[0], $sql_request_res, 1);
+
+ $results = array();
+ $query_id = $this->cache->sql_load($query[0]);
+ while ($row = $this->cache->sql_fetchrow($query_id))
+ {
+ $results[] = $row;
+ }
+ $this->cache->sql_freeresult($query_id);
+ $this->assertEquals($query[1], sizeof($results));
+ }
+
+ $this->cache->destroy('sql', $table);
+
+ foreach ($sql_queries as $query)
+ {
+ $this->assertNotEquals(false, $this->cache->sql_load($query[0]));
+ }
+ }
+}
diff --git a/tests/cache/fixtures/cache_memory.xml b/tests/cache/fixtures/cache_memory.xml
new file mode 100644
index 0000000000..9c19ebb7ba
--- /dev/null
+++ b/tests/cache/fixtures/cache_memory.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<dataset>
+ <table name="phpbb_topics">
+ <column>topic_id</column>
+ <column>forum_id</column>
+ <column>topic_title</column>
+ <column>topic_first_post_id</column>
+ <column>topic_last_post_id</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>Topic</value>
+ <value>2</value>
+ <value>2</value>
+ </row>
+ </table>
+ <table name="phpbb_posts">
+ <column>post_id</column>
+ <column>poster_id</column>
+ <column>topic_id</column>
+ <column>forum_id</column>
+ <column>post_text</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>1</value>
+ <value>Post 1</value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>2</value>
+ <value>1</value>
+ <value>1</value>
+ <value>Post 2</value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>3</value>
+ <value>1</value>
+ <value>1</value>
+ <value>Post 3</value>
+ </row>
+ </table>
+ <table name="phpbb_users">
+ <column>user_id</column>
+ <column>user_posts</column>
+ <column>username</column>
+ <column>username_clean</column>
+ <column>user_permissions</column>
+ <column>user_sig</column>
+ <row>
+ <value>1</value>
+ <value>1</value>
+ <value>user 1</value>
+ <value>user 1</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>2</value>
+ <value>1</value>
+ <value>user 2</value>
+ <value>user 2</value>
+ <value></value>
+ <value></value>
+ </row>
+ <row>
+ <value>3</value>
+ <value>1</value>
+ <value>user 3</value>
+ <value>user 3</value>
+ <value></value>
+ <value></value>
+ </row>
+ </table>
+</dataset>
diff --git a/tests/composer.json b/tests/composer.json
new file mode 100644
index 0000000000..69512f30a6
--- /dev/null
+++ b/tests/composer.json
@@ -0,0 +1,5 @@
+{
+ "require-dev": {
+ "facebook/webdriver": "dev-master"
+ }
+}
diff --git a/tests/composer.lock b/tests/composer.lock
new file mode 100644
index 0000000000..f714495d84
--- /dev/null
+++ b/tests/composer.lock
@@ -0,0 +1,66 @@
+{
+ "_readme": [
+ "This file locks the dependencies of your project to a known state",
+ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"
+ ],
+ "hash": "cf1d8a4841e5e669b148e0df6645a788",
+ "packages": [
+
+ ],
+ "packages-dev": [
+ {
+ "name": "facebook/webdriver",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/facebook/php-webdriver.git",
+ "reference": "b6e002e5bf811a8edba393ce6872322c1b7cf796"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/b6e002e5bf811a8edba393ce6872322c1b7cf796",
+ "reference": "b6e002e5bf811a8edba393ce6872322c1b7cf796",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.19"
+ },
+ "require-dev": {
+ "phpdocumentor/phpdocumentor": "2.*",
+ "phpunit/phpunit": "3.7.*"
+ },
+ "type": "library",
+ "autoload": {
+ "classmap": [
+ "lib/"
+ ]
+ },
+ "notification-url": "http://packagist.org/downloads/",
+ "license": [
+ "Apache-2.0"
+ ],
+ "description": "A php client for WebDriver",
+ "homepage": "https://github.com/facebook/php-webdriver",
+ "keywords": [
+ "facebook",
+ "php",
+ "selenium",
+ "webdriver"
+ ],
+ "time": "2014-08-05 02:55:46"
+ }
+ ],
+ "aliases": [
+
+ ],
+ "minimum-stability": "stable",
+ "stability-flags": {
+ "facebook/webdriver": 20
+ },
+ "platform": [
+
+ ],
+ "platform-dev": [
+
+ ]
+}
diff --git a/tests/console/cache/purge_test.php b/tests/console/cache/purge_test.php
new file mode 100644
index 0000000000..96988c1028
--- /dev/null
+++ b/tests/console/cache/purge_test.php
@@ -0,0 +1,95 @@
+<?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\cache\purge;
+
+require_once dirname(__FILE__) . '/../../../phpBB/includes/functions_admin.php';
+
+class phpbb_console_command_cache_purge_test extends phpbb_test_case
+{
+ protected $cache_dir;
+ protected $cache;
+ protected $command_name;
+ protected $db;
+ protected $config;
+
+ public function __construct()
+ {
+ $this->cache_dir = dirname(__FILE__) . '/tmp/cache/';
+ }
+
+ protected function setUp()
+ {
+ if (file_exists($this->cache_dir))
+ {
+ // cache directory possibly left after aborted
+ // or failed run earlier
+ $this->remove_cache_dir();
+ }
+ $this->create_cache_dir();
+
+ $this->cache = new \phpbb\cache\driver\file($this->cache_dir);
+
+ $this->db = $this->getMock('\phpbb\db\driver\driver_interface');
+
+ $this->config = new \phpbb\config\config(array('assets_version' => 1));
+ $this->user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
+ }
+
+ public function test_purge()
+ {
+ $this->cache->put('test_key', 'test_value');
+
+ $this->assertEquals(
+ 'test_value',
+ $this->cache->get('test_key'),
+ 'File ACM put and get'
+ );
+
+ $command_tester = $this->get_command_tester();
+ $exit_status = $command_tester->execute(array('command' => $this->command_name));
+
+ $this->assertSame(false, $this->cache->get('test_key'));
+ $this->assertSame(2, $this->config['assets_version']);
+ }
+
+ private function create_cache_dir()
+ {
+ $this->get_test_case_helpers()->makedirs($this->cache_dir);
+ }
+
+ private function remove_cache_dir()
+ {
+ $iterator = new DirectoryIterator($this->cache_dir);
+ foreach ($iterator as $file)
+ {
+ if ($file != '.' && $file != '..')
+ {
+ unlink($this->cache_dir . '/' . $file);
+ }
+ }
+ rmdir($this->cache_dir);
+ }
+
+ public function get_command_tester()
+ {
+ $application = new Application();
+ $application->add(new purge($this->user, $this->cache, $this->db, $this->getMock('\phpbb\auth\auth'), new \phpbb\log\null(), $this->config));
+
+ $command = $application->find('cache:purge');
+ $this->command_name = $command->getName();
+ return new CommandTester($command);
+ }
+}
diff --git a/tests/console/cron/run_test.php b/tests/console/cron/run_test.php
index 029dc5249b..f76e967484 100644
--- a/tests/console/cron/run_test.php
+++ b/tests/console/cron/run_test.php
@@ -16,6 +16,7 @@ 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/content_visibility/delete_post_test.php b/tests/content_visibility/delete_post_test.php
index 65dda3ce48..6ad6351a0c 100644
--- a/tests/content_visibility/delete_post_test.php
+++ b/tests/content_visibility/delete_post_test.php
@@ -296,6 +296,7 @@ class phpbb_content_visibility_delete_post_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
$phpbb_config = new \phpbb\config\config(array('num_posts' => 3, 'num_topics' => 1));
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
set_config_count(null, null, null, $phpbb_config);
// Create auth mock
@@ -312,7 +313,7 @@ class phpbb_content_visibility_delete_post_test extends phpbb_database_test_case
$phpbb_container = new phpbb_mock_container_builder();
$phpbb_container->set('notification_manager', new phpbb_mock_notification_manager());
- $phpbb_container->set('content.visibility', new \phpbb\content_visibility($auth, $phpbb_config, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE));
+ $phpbb_container->set('content.visibility', new \phpbb\content_visibility($auth, $phpbb_config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE));
delete_post($forum_id, $topic_id, $post_id, $data, $is_soft, $reason);
diff --git a/tests/content_visibility/get_forums_visibility_sql_test.php b/tests/content_visibility/get_forums_visibility_sql_test.php
index fe7ab36436..28e463ecb5 100644
--- a/tests/content_visibility/get_forums_visibility_sql_test.php
+++ b/tests/content_visibility/get_forums_visibility_sql_test.php
@@ -136,7 +136,8 @@ class phpbb_content_visibility_get_forums_visibility_sql_test extends phpbb_data
->will($this->returnValueMap($permissions));
$user = new \phpbb\user('\phpbb\datetime');
$config = new phpbb\config\config(array());
- $content_visibility = new \phpbb\content_visibility($auth, $config, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $content_visibility = new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
$result = $db->sql_query('SELECT ' . $mode . '_id
FROM ' . $table . '
diff --git a/tests/content_visibility/get_global_visibility_sql_test.php b/tests/content_visibility/get_global_visibility_sql_test.php
index 43a80c792b..586bae8668 100644
--- a/tests/content_visibility/get_global_visibility_sql_test.php
+++ b/tests/content_visibility/get_global_visibility_sql_test.php
@@ -136,7 +136,8 @@ class phpbb_content_visibility_get_global_visibility_sql_test extends phpbb_data
->will($this->returnValueMap($permissions));
$user = new \phpbb\user('\phpbb\datetime');
$config = new phpbb\config\config(array());
- $content_visibility = new \phpbb\content_visibility($auth, $config, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $content_visibility = new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
$result = $db->sql_query('SELECT ' . $mode . '_id
FROM ' . $table . '
diff --git a/tests/content_visibility/get_visibility_sql_test.php b/tests/content_visibility/get_visibility_sql_test.php
index f718e6c29a..9ae2d2fdc4 100644
--- a/tests/content_visibility/get_visibility_sql_test.php
+++ b/tests/content_visibility/get_visibility_sql_test.php
@@ -83,7 +83,8 @@ class phpbb_content_visibility_get_visibility_sql_test extends phpbb_database_te
->will($this->returnValueMap($permissions));
$user = new \phpbb\user('\phpbb\datetime');
$config = new phpbb\config\config(array());
- $content_visibility = new \phpbb\content_visibility($auth, $config, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $content_visibility = new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
$result = $db->sql_query('SELECT ' . $mode . '_id
FROM ' . $table . '
diff --git a/tests/content_visibility/set_post_visibility_test.php b/tests/content_visibility/set_post_visibility_test.php
index ab79fbc2ee..36ebf58374 100644
--- a/tests/content_visibility/set_post_visibility_test.php
+++ b/tests/content_visibility/set_post_visibility_test.php
@@ -126,7 +126,8 @@ class phpbb_content_visibility_set_post_visibility_test extends phpbb_database_t
$auth = $this->getMock('\phpbb\auth\auth');
$user = new \phpbb\user('\phpbb\datetime');
$config = new phpbb\config\config(array());
- $content_visibility = new \phpbb\content_visibility($auth, $config, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $content_visibility = new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
$content_visibility->set_post_visibility($visibility, $post_id, $topic_id, $forum_id, $user_id, $time, $reason, $is_starter, $is_latest);
@@ -176,7 +177,8 @@ class phpbb_content_visibility_set_post_visibility_test extends phpbb_database_t
$auth = $this->getMock('\phpbb\auth\auth');
$user = new \phpbb\user('\phpbb\datetime');
$config = new phpbb\config\config(array());
- $content_visibility = new \phpbb\content_visibility($auth, $config, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $content_visibility = new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
$content_visibility->set_post_visibility(ITEM_DELETED, $post_id, $topic_id, $forum_id, $user_id, $time, $reason, $is_starter, $is_latest);
diff --git a/tests/content_visibility/set_topic_visibility_test.php b/tests/content_visibility/set_topic_visibility_test.php
index 4d02a55490..6c34f42167 100644
--- a/tests/content_visibility/set_topic_visibility_test.php
+++ b/tests/content_visibility/set_topic_visibility_test.php
@@ -90,7 +90,8 @@ class phpbb_content_visibility_set_topic_visibility_test extends phpbb_database_
$auth = $this->getMock('\phpbb\auth\auth');
$user = new \phpbb\user('\phpbb\datetime');
$config = new phpbb\config\config(array());
- $content_visibility = new \phpbb\content_visibility($auth, $config, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $content_visibility = new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
$content_visibility->set_topic_visibility($visibility, $topic_id, $forum_id, $user_id, $time, $reason, $force_update_all);
diff --git a/tests/controller/common_helper_route.php b/tests/controller/common_helper_route.php
index 1751578a75..6723e3bc52 100644
--- a/tests/controller/common_helper_route.php
+++ b/tests/controller/common_helper_route.php
@@ -56,23 +56,28 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
return 'app.php';
}
+ protected function path_to_app()
+ {
+ return '';
+ }
+
protected function generate_route_objects()
{
- $request = new phpbb_mock_request();
- $request->overwrite('SCRIPT_NAME', $this->get_uri(), \phpbb\request\request_interface::SERVER);
- $request->overwrite('SCRIPT_FILENAME', $this->get_script_name(), \phpbb\request\request_interface::SERVER);
- $request->overwrite('REQUEST_URI', $this->get_uri(), \phpbb\request\request_interface::SERVER);
- $request->overwrite('SERVER_NAME', 'localhost', \phpbb\request\request_interface::SERVER);
- $request->overwrite('SERVER_PORT', '80', \phpbb\request\request_interface::SERVER);
+ $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);
+ $this->request->overwrite('REQUEST_URI', $this->get_uri(), \phpbb\request\request_interface::SERVER);
+ $this->request->overwrite('SERVER_NAME', 'localhost', \phpbb\request\request_interface::SERVER);
+ $this->request->overwrite('SERVER_PORT', '80', \phpbb\request\request_interface::SERVER);
$this->symfony_request = new \phpbb\symfony_request(
- $request
+ $this->request
);
$this->filesystem = new \phpbb\filesystem();
$this->phpbb_path_helper = new \phpbb\path_helper(
$this->symfony_request,
$this->filesystem,
- $this->getMock('\phpbb\request\request'),
+ $this->request,
$phpbb_root_path,
$phpEx
);
@@ -93,30 +98,30 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
public function helper_url_data_no_rewrite()
{
return array(
- array('controller2', array('t' => 1, 'f' => 2), true, false, '/app.php/foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
- array('controller2', array('t' => 1, 'f' => 2), false, false, '/app.php/foo/bar?t=1&f=2', 'parameters in params-argument as array'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, '/app.php/foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, '/app.php/foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
+ array('controller2', array('t' => 1, 'f' => 2), true, false, '/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller2', array('t' => 1, 'f' => 2), false, false, '/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, '/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, '/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
// Custom sid parameter
- array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', '/app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
- array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', '/app.php/foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', '/app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', '/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', '/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', '/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
// Testing anchors
- array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, '/app.php/foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
- array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, '/app.php/foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, '/app.php/foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, '/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, '/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, '/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
// Anchors and custom sid
- array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '/app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
- array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', '/app.php/foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '/app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', '/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
// Empty parameters should not append the &amp; or ?
- array('controller2', array(), true, false, '/app.php/foo/bar', 'no params using empty array'),
- array('controller2', array(), false, false, '/app.php/foo/bar', 'no params using empty array'),
- array('controller3', array('p' => 3), true, false, '/app.php/foo/bar/p-3', 'no params using empty array'),
+ array('controller2', array(), true, false, '/' . $this->path_to_app() . 'app.php/foo/bar', 'no params using empty array'),
+ array('controller2', array(), false, false, '/' . $this->path_to_app() . 'app.php/foo/bar', 'no params using empty array'),
+ array('controller3', array('p' => 3), true, false, '/' . $this->path_to_app() . 'app.php/foo/bar/p-3', 'no params using empty array'),
);
}
@@ -125,37 +130,37 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
*/
public function test_helper_url_no_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
{
- $this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, $this->symfony_request, $this->filesystem, $this->root_path, 'php', dirname(__FILE__) . '/');
+ $this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php', dirname(__FILE__) . '/');
$this->assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id));
}
public function helper_url_data_with_rewrite()
{
return array(
- array('controller2', array('t' => 1, 'f' => 2), true, false, '/foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
- array('controller2', array('t' => 1, 'f' => 2), false, false, '/foo/bar?t=1&f=2', 'parameters in params-argument as array'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, '/foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, '/foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
+ array('controller2', array('t' => 1, 'f' => 2), true, false, '/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller2', array('t' => 1, 'f' => 2), false, false, '/' . $this->path_to_app() . 'foo/bar?t=1&f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, '/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, '/' . $this->path_to_app() . 'foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
// Custom sid parameter
- array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', '/foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
- array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', '/foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', '/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', '/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', '/' . $this->path_to_app() . 'foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', '/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
// Testing anchors
- array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, '/foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
- array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, '/foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, '/foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, '/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, '/' . $this->path_to_app() . 'foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, '/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
// Anchors and custom sid
- array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '/foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
- array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', '/foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', '/' . $this->path_to_app() . 'foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
// Empty parameters should not append the &amp; or ?
- array('controller2', array(), true, false, '/foo/bar', 'no params using empty array'),
- array('controller2', array(), false, false, '/foo/bar', 'no params using empty array'),
- array('controller3', array('p' => 3), true, false, '/foo/bar/p-3', 'no params using empty array'),
+ array('controller2', array(), true, false, '/' . $this->path_to_app() . 'foo/bar', 'no params using empty array'),
+ array('controller2', array(), false, false, '/' . $this->path_to_app() . 'foo/bar', 'no params using empty array'),
+ array('controller3', array('p' => 3), true, false, '/' . $this->path_to_app() . 'foo/bar/p-3', 'no params using empty array'),
);
}
@@ -165,37 +170,37 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
public function test_helper_url_with_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
{
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '1'));
- $this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, $this->symfony_request, $this->filesystem, $this->root_path, 'php', dirname(__FILE__) . '/');
+ $this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php', dirname(__FILE__) . '/');
$this->assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id));
}
public function helper_url_data_absolute()
{
return array(
- array('controller2', array('t' => 1, 'f' => 2), true, false, 'http://localhost/app.php/foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
- array('controller2', array('t' => 1, 'f' => 2), false, false, 'http://localhost/app.php/foo/bar?t=1&f=2', 'parameters in params-argument as array'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, 'http://localhost/app.php/foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, 'http://localhost/app.php/foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
+ array('controller2', array('t' => 1, 'f' => 2), true, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller2', array('t' => 1, 'f' => 2), false, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
// Custom sid parameter
- array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', 'http://localhost/app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
- array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', 'http://localhost/app.php/foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', 'http://localhost/app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
// Testing anchors
- array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'http://localhost/app.php/foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
- array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, 'http://localhost/app.php/foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'http://localhost/app.php/foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
// Anchors and custom sid
- array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'http://localhost/app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
- array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', 'http://localhost/app.php/foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'http://localhost/app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
// Empty parameters should not append the &amp; or ?
- array('controller2', array(), true, false, 'http://localhost/app.php/foo/bar', 'no params using empty array'),
- array('controller2', array(), false, false, 'http://localhost/app.php/foo/bar', 'no params using empty array'),
- array('controller3', array('p' => 3), true, false, 'http://localhost/app.php/foo/bar/p-3', 'no params using empty array'),
+ array('controller2', array(), true, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar', 'no params using empty array'),
+ array('controller2', array(), false, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar', 'no params using empty array'),
+ array('controller3', array('p' => 3), true, false, 'http://localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3', 'no params using empty array'),
);
}
@@ -205,7 +210,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
public function test_helper_url_absolute($route, $params, $is_amp, $session_id, $expected, $description)
{
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '0'));
- $this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, $this->symfony_request, $this->filesystem, $this->root_path, 'php', dirname(__FILE__) . '/');
+ $this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php', dirname(__FILE__) . '/');
$this->assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::ABSOLUTE_URL));
}
@@ -245,37 +250,37 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
public function test_helper_url_relative_path($route, $params, $is_amp, $session_id, $expected, $description)
{
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '0'));
- $this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, $this->symfony_request, $this->filesystem, $this->root_path, 'php', dirname(__FILE__) . '/');
+ $this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php', dirname(__FILE__) . '/');
$this->assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::RELATIVE_PATH));
}
public function helper_url_data_network()
{
return array(
- array('controller2', array('t' => 1, 'f' => 2), true, false, '//localhost/app.php/foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
- array('controller2', array('t' => 1, 'f' => 2), false, false, '//localhost/app.php/foo/bar?t=1&f=2', 'parameters in params-argument as array'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, '//localhost/app.php/foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, '//localhost/app.php/foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
+ array('controller2', array('t' => 1, 'f' => 2), true, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller2', array('t' => 1, 'f' => 2), false, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
// Custom sid parameter
- array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', '//localhost/app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
- array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', '//localhost/app.php/foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', '//localhost/app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', '//localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', '//localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', '//localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
// Testing anchors
- array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, '//localhost/app.php/foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
- array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, '//localhost/app.php/foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, '//localhost/app.php/foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
// Anchors and custom sid
- array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '//localhost/app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
- array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', '//localhost/app.php/foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '//localhost/app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '//localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', '//localhost/' . $this->path_to_app() . 'app.php/foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '//localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
// Empty parameters should not append the &amp; or ?
- array('controller2', array(), true, false, '//localhost/app.php/foo/bar', 'no params using empty array'),
- array('controller2', array(), false, false, '//localhost/app.php/foo/bar', 'no params using empty array'),
- array('controller3', array('p' => 3), true, false, '//localhost/app.php/foo/bar/p-3', 'no params using empty array'),
+ array('controller2', array(), true, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar', 'no params using empty array'),
+ array('controller2', array(), false, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar', 'no params using empty array'),
+ array('controller3', array('p' => 3), true, false, '//localhost/' . $this->path_to_app() . 'app.php/foo/bar/p-3', 'no params using empty array'),
);
}
@@ -285,37 +290,37 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
public function test_helper_url_network($route, $params, $is_amp, $session_id, $expected, $description)
{
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '0'));
- $this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, $this->symfony_request, $this->filesystem, $this->root_path, 'php', dirname(__FILE__) . '/');
+ $this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php', dirname(__FILE__) . '/');
$this->assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::NETWORK_PATH));
}
//TODO
public function helper_url_data_absolute_with_rewrite()
{
return array(
- array('controller2', array('t' => 1, 'f' => 2), true, false, 'http://localhost/foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
- array('controller2', array('t' => 1, 'f' => 2), false, false, 'http://localhost/foo/bar?t=1&f=2', 'parameters in params-argument as array'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, 'http://localhost/foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, 'http://localhost/foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
+ array('controller2', array('t' => 1, 'f' => 2), true, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller2', array('t' => 1, 'f' => 2), false, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar?t=1&f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
// Custom sid parameter
- array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', 'http://localhost/foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
- array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', 'http://localhost/foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', 'http://localhost/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
// Testing anchors
- array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'http://localhost/foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
- array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, 'http://localhost/foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'http://localhost/foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
// Anchors and custom sid
- array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'http://localhost/foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
- array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', 'http://localhost/foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'http://localhost/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', 'http://localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
// Empty parameters should not append the &amp; or ?
- array('controller2', array(), true, false, 'http://localhost/foo/bar', 'no params using empty array'),
- array('controller2', array(), false, false, 'http://localhost/foo/bar', 'no params using empty array'),
- array('controller3', array('p' => 3), true, false, 'http://localhost/foo/bar/p-3', 'no params using empty array'),
+ array('controller2', array(), true, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar', 'no params using empty array'),
+ array('controller2', array(), false, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar', 'no params using empty array'),
+ array('controller3', array('p' => 3), true, false, 'http://localhost/' . $this->path_to_app() . 'foo/bar/p-3', 'no params using empty array'),
);
}
@@ -325,7 +330,7 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
public function test_helper_url_absolute_with_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
{
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '1'));
- $this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, $this->symfony_request, $this->filesystem, $this->root_path, 'php', dirname(__FILE__) . '/');
+ $this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php', dirname(__FILE__) . '/');
$this->assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::ABSOLUTE_URL));
}
@@ -365,37 +370,37 @@ abstract class phpbb_controller_common_helper_route extends phpbb_test_case
public function test_helper_url_relative_path_with_rewrite($route, $params, $is_amp, $session_id, $expected, $description)
{
$this->config = new \phpbb\config\config(array('enable_mod_rewrite' => '1'));
- $this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, $this->symfony_request, $this->filesystem, $this->root_path, 'php', dirname(__FILE__) . '/');
+ $this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php', dirname(__FILE__) . '/');
$this->assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::RELATIVE_PATH));
}
public function helper_url_data_network_with_rewrite()
{
return array(
- array('controller2', array('t' => 1, 'f' => 2), true, false, '//localhost/foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
- array('controller2', array('t' => 1, 'f' => 2), false, false, '//localhost/foo/bar?t=1&f=2', 'parameters in params-argument as array'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, '//localhost/foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, '//localhost/foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
+ array('controller2', array('t' => 1, 'f' => 2), true, false, '//localhost/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller2', array('t' => 1, 'f' => 2), false, false, '//localhost/' . $this->path_to_app() . 'foo/bar?t=1&f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, false, '//localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2', 'parameters in params-argument as array'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), false, false, '//localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&f=2', 'parameters in params-argument as array'),
// Custom sid parameter
- array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', '//localhost/foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
- array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', '//localhost/foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', '//localhost/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2), true, 'custom-sid', '//localhost/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2), false, 'custom-sid', '//localhost/' . $this->path_to_app() . 'foo/bar?t=1&f=2&sid=custom-sid', 'params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2), true, 'custom-sid', '//localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid', 'params-argument (array) using session_id'),
// Testing anchors
- array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, '//localhost/foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
- array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, '//localhost/foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, '//localhost/foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, false, '//localhost/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, false, '//localhost/' . $this->path_to_app() . 'foo/bar?t=1&f=2#anchor', 'anchor in params-argument (array)'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, false, '//localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2#anchor', 'anchor in params-argument (array)'),
// Anchors and custom sid
- array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '//localhost/foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
- array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', '//localhost/foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
- array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '//localhost/foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '//localhost/' . $this->path_to_app() . 'foo/bar?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller2', array('t' => 1, 'f' => 2, '#' => 'anchor'), false, 'custom-sid', '//localhost/' . $this->path_to_app() . 'foo/bar?t=1&f=2&sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
+ array('controller3', array('p' => 3, 't' => 1, 'f' => 2, '#' => 'anchor'), true, 'custom-sid', '//localhost/' . $this->path_to_app() . 'foo/bar/p-3?t=1&amp;f=2&amp;sid=custom-sid#anchor', 'anchor in params-argument (array) using session_id'),
// Empty parameters should not append the &amp; or ?
- array('controller2', array(), true, false, '//localhost/foo/bar', 'no params using empty array'),
- array('controller2', array(), false, false, '//localhost/foo/bar', 'no params using empty array'),
- array('controller3', array('p' => 3), true, false, '//localhost/foo/bar/p-3', 'no params using empty array'),
+ array('controller2', array(), true, false, '//localhost/' . $this->path_to_app() . 'foo/bar', 'no params using empty array'),
+ array('controller2', array(), false, false, '//localhost/' . $this->path_to_app() . 'foo/bar', 'no params using empty array'),
+ array('controller3', array('p' => 3), true, false, '//localhost/' . $this->path_to_app() . 'foo/bar/p-3', 'no params using empty array'),
);
}
@@ -405,7 +410,7 @@ 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->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, $this->symfony_request, $this->filesystem, $this->root_path, 'php', dirname(__FILE__) . '/');
+ $this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $this->provider, $this->extension_manager, $this->symfony_request, $this->request, $this->filesystem, $this->root_path, 'php', dirname(__FILE__) . '/');
$this->assertEquals($expected, $this->helper->route($route, $params, $is_amp, $session_id, UrlGeneratorInterface::NETWORK_PATH));
}
}
diff --git a/tests/controller/config/routing.yml b/tests/controller/config/routing.yml
index 175b11f130..1e7df02684 100644
--- a/tests/controller/config/routing.yml
+++ b/tests/controller/config/routing.yml
@@ -1,3 +1,3 @@
core_controller:
- pattern: /core_foo
+ path: /core_foo
defaults: { _controller: core_foo.controller:bar }
diff --git a/tests/controller/controller_test.php b/tests/controller/controller_test.php
index 58bcf0ef81..62feee3fed 100644
--- a/tests/controller/controller_test.php
+++ b/tests/controller/controller_test.php
@@ -11,6 +11,8 @@
*
*/
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
diff --git a/tests/controller/ext/vendor2/foo/config/routing.yml b/tests/controller/ext/vendor2/foo/config/routing.yml
index 6cc275d96d..e3e8ee5f98 100644
--- a/tests/controller/ext/vendor2/foo/config/routing.yml
+++ b/tests/controller/ext/vendor2/foo/config/routing.yml
@@ -1,5 +1,5 @@
controller1:
- pattern: /foo
+ path: /foo
defaults: { _controller: foo.controller:handle }
include_controller2:
diff --git a/tests/controller/ext/vendor2/foo/config/routing_2.yml b/tests/controller/ext/vendor2/foo/config/routing_2.yml
index d987a65aea..ee05898c66 100644
--- a/tests/controller/ext/vendor2/foo/config/routing_2.yml
+++ b/tests/controller/ext/vendor2/foo/config/routing_2.yml
@@ -1,6 +1,6 @@
controller2:
- pattern: /bar
+ path: /bar
defaults: { _controller: foo.controller:handle }
controller3:
- pattern: /bar/p-{p}
+ path: /bar/p-{p}
defaults: { _controller: foo.controller:handle }
diff --git a/tests/controller/ext/vendor2/foo/subfolder/config/routing.yml b/tests/controller/ext/vendor2/foo/subfolder/config/routing.yml
index b4d8d19107..20810a8f25 100644
--- a/tests/controller/ext/vendor2/foo/subfolder/config/routing.yml
+++ b/tests/controller/ext/vendor2/foo/subfolder/config/routing.yml
@@ -1,3 +1,3 @@
controller_noroute:
- pattern: /donotfindthis
+ path: /donotfindthis
defaults: { _controller: foo.controller:handle }
diff --git a/tests/controller/helper_route_other_app.php b/tests/controller/helper_route_other_app.php
new file mode 100644
index 0000000000..e5513a5180
--- /dev/null
+++ b/tests/controller/helper_route_other_app.php
@@ -0,0 +1,37 @@
+<?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 dirname(__FILE__) . '/common_helper_route.php';
+
+class phpbb_controller_helper_route_other_app_test extends phpbb_controller_common_helper_route
+{
+ protected function get_phpbb_root_path()
+ {
+ return './../';
+ }
+
+ protected function get_uri()
+ {
+ return '/foo/app.php';
+ }
+
+ protected function get_script_name()
+ {
+ return 'app.php';
+ }
+
+ protected function path_to_app()
+ {
+ return 'foo/';
+ }
+}
diff --git a/tests/datetime/from_format_test.php b/tests/datetime/from_format_test.php
index 0f87abc180..8968619bb5 100644
--- a/tests/datetime/from_format_test.php
+++ b/tests/datetime/from_format_test.php
@@ -60,44 +60,44 @@ class phpbb_datetime_from_format_test extends phpbb_test_case
// If the current time is too close to the testing time,
// the relative time will use "x minutes ago" instead of "today ..."
// So we use 18:01 in the morning and 06:01 in the afternoon.
- $testing_time = date('H') <= 12 ? '06:01' : '18:01';
+ $testing_time = gmdate('H') <= 12 ? '18:01' : '06:01';
return array(
array(
- date('Y-m-d', time() + 2 * 86400) . ' ' . $testing_time, false,
- date('Y-m-d', time() + 2 * 86400) . ' ' . $testing_time,
+ gmdate('Y-m-d', time() + 2 * 86400) . ' ' . $testing_time, false,
+ gmdate('Y-m-d', time() + 2 * 86400) . ' ' . $testing_time,
),
array(
- date('Y-m-d', time() + 86400) . ' ' . $testing_time, false,
+ gmdate('Y-m-d', time() + 86400) . ' ' . $testing_time, false,
'Tomorrow ' . $testing_time,
),
array(
- date('Y-m-d', time() + 86400) . ' ' . $testing_time, true,
- date('Y-m-d', time() + 86400) . ' ' . $testing_time,
+ gmdate('Y-m-d', time() + 86400) . ' ' . $testing_time, true,
+ gmdate('Y-m-d', time() + 86400) . ' ' . $testing_time,
),
array(
- date('Y-m-d') . ' ' . $testing_time, false,
+ gmdate('Y-m-d') . ' ' . $testing_time, false,
'Today ' . $testing_time,
),
array(
- date('Y-m-d') . ' ' . $testing_time, true,
- date('Y-m-d') . ' ' . $testing_time,
+ gmdate('Y-m-d') . ' ' . $testing_time, true,
+ gmdate('Y-m-d') . ' ' . $testing_time,
),
array(
- date('Y-m-d', time() - 86400) . ' ' . $testing_time, false,
+ gmdate('Y-m-d', time() - 86400) . ' ' . $testing_time, false,
'Yesterday ' . $testing_time,
),
array(
- date('Y-m-d', time() - 86400) . ' ' . $testing_time, true,
- date('Y-m-d', time() - 86400) . ' ' . $testing_time,
+ gmdate('Y-m-d', time() - 86400) . ' ' . $testing_time, true,
+ gmdate('Y-m-d', time() - 86400) . ' ' . $testing_time,
),
array(
- date('Y-m-d', time() - 2 * 86400) . ' ' . $testing_time, false,
- date('Y-m-d', time() - 2 * 86400) . ' ' . $testing_time,
+ gmdate('Y-m-d', time() - 2 * 86400) . ' ' . $testing_time, false,
+ gmdate('Y-m-d', time() - 2 * 86400) . ' ' . $testing_time,
),
);
}
diff --git a/tests/dbal/db_tools_test.php b/tests/dbal/db_tools_test.php
index 51f9daacfb..5832b966d8 100644
--- a/tests/dbal/db_tools_test.php
+++ b/tests/dbal/db_tools_test.php
@@ -415,4 +415,11 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
$this->tools->sql_create_unique_index('prefix_table_name', 'i_uniq_ts_id', array('c_timestamp', 'c_id'));
$this->assertTrue($this->tools->sql_unique_index_exists('prefix_table_name', 'i_uniq_ts_id'));
}
+
+ public function test_create_int_default_null()
+ {
+ $this->assertFalse($this->tools->sql_column_exists('prefix_table_name', 'c_bug_13282'));
+ $this->assertTrue($this->tools->sql_column_add('prefix_table_name', 'c_bug_13282', array('TINT:2')));
+ $this->assertTrue($this->tools->sql_column_exists('prefix_table_name', 'c_bug_13282'));
+ }
}
diff --git a/tests/dbal/migrator_test.php b/tests/dbal/migrator_test.php
index 10a9444d63..4c4306888c 100644
--- a/tests/dbal/migrator_test.php
+++ b/tests/dbal/migrator_test.php
@@ -46,7 +46,10 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
new \phpbb\db\migration\tool\config($this->config),
);
+ $container = new phpbb_mock_container_builder();
+
$this->migrator = new \phpbb\db\migrator(
+ $container,
$this->config,
$this->db,
$this->db_tools,
@@ -57,9 +60,8 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
$tools,
new \phpbb\db\migration\helper()
);
-
- $container = new phpbb_mock_container_builder();
- $container->set('migrator', $migrator);
+ $container->set('migrator', $this->migrator);
+ $container->set('dispatcher', new phpbb_mock_event_dispatcher());
$user = new \phpbb\user('\phpbb\datetime');
$this->extension_manager = new \phpbb\extension\manager(
diff --git a/tests/error_collector_test.php b/tests/error_collector_test.php
index 1d8ef367f5..b92c4fa6bb 100644
--- a/tests/error_collector_test.php
+++ b/tests/error_collector_test.php
@@ -17,7 +17,7 @@ class phpbb_error_collector_test extends phpbb_test_case
{
public function test_collection()
{
- $collector = new \phpbb\error_collector;
+ $collector = new \phpbb\error_collector(E_ALL | E_STRICT); // php set_error_handler() default
$collector->install();
// Cause a warning
@@ -35,4 +35,32 @@ class phpbb_error_collector_test extends phpbb_test_case
$this->assertStringStartsWith('Errno 2: Division by zero at ', $error_contents);
$this->assertStringEndsWith(" line $line", $error_contents);
}
+
+ public function test_collection_with_mask()
+ {
+ $collector = new \phpbb\error_collector(E_ALL & ~E_NOTICE); // not collecting notices
+ $collector->install();
+
+ // Cause a warning
+ 1/0; $line = __LINE__;
+
+ // Cause a notice
+ $array = array('ITEM' => 'value');
+ $value = $array[ITEM]; $line2 = __LINE__;
+
+ $collector->uninstall();
+
+ // The notice should not be collected
+ $this->assertEmpty($collector->errors[1]);
+
+ list($errno, $msg_text, $errfile, $errline) = $collector->errors[0];
+ $error_contents = $collector->format_errors();
+
+ $this->assertEquals($errno, 2);
+
+ // Unfortunately $error_contents will contain the full path here,
+ // because the tests directory is outside of phpbb root path.
+ $this->assertStringStartsWith('Errno 2: Division by zero at ', $error_contents);
+ $this->assertStringEndsWith(" line $line", $error_contents);
+ }
}
diff --git a/tests/event/exception_listener_test.php b/tests/event/exception_listener_test.php
new file mode 100644
index 0000000000..4d3453cd83
--- /dev/null
+++ b/tests/event/exception_listener_test.php
@@ -0,0 +1,100 @@
+<?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 dirname(__FILE__) . '/../../phpBB/includes/functions.php';
+
+class exception_listener extends phpbb_test_case
+{
+ public function phpbb_exception_data()
+ {
+ return array(
+ array(
+ true,
+ new \Exception(),
+ array(
+ 'status_code' => 500,
+ ),
+ ),
+ array(
+ true,
+ new \Exception('AJAX_ERROR_TEXT'),
+ array(
+ 'status_code' => 500,
+ 'content' => 'AJAX_ERROR_TEXT',
+ ),
+ ),
+ array(
+ true,
+ new \phpbb\exception\runtime_exception('AJAX_ERROR_TEXT'),
+ array(
+ 'status_code' => 500,
+ 'content' => 'Something went wrong when processing your request.',
+ ),
+ ),
+ array(
+ true,
+ new \Symfony\Component\HttpKernel\Exception\HttpException(404, 'AJAX_ERROR_TEXT'),
+ array(
+ 'status_code' => 404,
+ 'content' => 'AJAX_ERROR_TEXT',
+ ),
+ ),
+ array(
+ true,
+ new \phpbb\exception\http_exception(404, 'AJAX_ERROR_TEXT'),
+ array(
+ 'status_code' => 404,
+ 'content' => 'Something went wrong when processing your request.',
+ ),
+ ),
+ array(
+ true,
+ new \phpbb\exception\http_exception(404, 'CURRENT_TIME', array('today')),
+ array(
+ 'status_code' => 404,
+ 'content' => 'It is currently today',
+ ),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider phpbb_exception_data
+ */
+ public function test_phpbb_exception($is_ajax, $exception, $expected)
+ {
+ $request = \Symfony\Component\HttpFoundation\Request::create('test.php', 'GET', array(), array(), array(), $is_ajax ? array('HTTP_X_REQUESTED_WITH' => 'XMLHttpRequest') : array());
+
+ $template = $this->getMockBuilder('\phpbb\template\twig\twig')
+ ->disableOriginalConstructor()
+ ->getMock();
+
+ $user = new \phpbb\user('\phpbb\datetime');
+ $user->add_lang('common');
+
+ $exception_listener = new \phpbb\event\kernel_exception_subscriber($template, $user);
+
+ $event = new \Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent($this->getMock('Symfony\Component\HttpKernel\HttpKernelInterface'), $request, \Symfony\Component\HttpKernel\HttpKernelInterface::MASTER_REQUEST, $exception);
+ $exception_listener->on_kernel_exception($event);
+
+ $response = $event->getResponse();
+
+ $this->assertEquals($expected['status_code'], $response->getStatusCode());
+ $this->assertEquals($is_ajax, $response instanceof \Symfony\Component\HttpFoundation\JsonResponse);
+
+ if (isset($expected['content']))
+ {
+ $this->assertContains($expected['content'], $response->getContent());
+ }
+ }
+}
diff --git a/tests/event/fixtures/trigger_wspace.test b/tests/event/fixtures/trigger_wspace.test
new file mode 100644
index 0000000000..0334a9c80b
--- /dev/null
+++ b/tests/event/fixtures/trigger_wspace.test
@@ -0,0 +1,15 @@
+<?php
+
+ /**
+ * Event after the post data has been assigned to the template
+ *
+ * @event core.trigger
+ * @var int start Start item of this page
+ * @var int current_row_number Number of the post on this page
+ * @var int end Number of posts on this page
+ * @var array row Array with original post and user data
+ * @var array cp_row Custom profile field data of the poster
+ * @since 3.1.0-a3
+ */
+ $vars = array('start', 'current_row_number', 'end', 'row', 'cp_row');
+ extract($phpbb_dispatcher->trigger_event('core.trigger', compact($vars)));
diff --git a/tests/event/php_exporter_test.php b/tests/event/php_exporter_test.php
index b52d68e305..692a57f93c 100644
--- a/tests/event/php_exporter_test.php
+++ b/tests/event/php_exporter_test.php
@@ -62,6 +62,18 @@ class phpbb_event_php_exporter_test extends phpbb_test_case
),
),
array(
+ 'trigger_wspace.test',
+ array(
+ 'core.trigger' => array(
+ 'event' => 'core.trigger',
+ 'file' => 'trigger_wspace.test',
+ 'arguments' => array('cp_row', 'current_row_number', 'end', 'row', 'start'),
+ 'since' => '3.1.0-a3',
+ 'description' => 'Event after the post data has been assigned to the template',
+ ),
+ ),
+ ),
+ array(
'trigger_many_vars.test',
array(
'core.posting_modify_template_vars' => array(
@@ -119,6 +131,7 @@ class phpbb_event_php_exporter_test extends phpbb_test_case
array('* @since 3.1.0-b3', '3.1.0-b3'),
array(' * @since 3.1.0-b3', '3.1.0-b3'),
array('* @since 3.1.0-RC2', '3.1.0-RC2'),
+ array(' * @since 3.1.0-a1', '3.1.0-a1'),
);
}
@@ -133,7 +146,6 @@ class phpbb_event_php_exporter_test extends phpbb_test_case
static public function validate_since_throws_data()
{
return array(
- array(' * @since 3.1.0-a1'),
array('* @since 3.1.0-a1 '),
array('* @since 3.1.0-a1 bertie is cool'),
array('bertie* @since 3.1.0-a1'),
@@ -156,6 +168,7 @@ class phpbb_event_php_exporter_test extends phpbb_test_case
return array(
array('test.event', '* @event test.event', 'test.event'),
array('test.event2', ' * @event test.event2', 'test.event2'),
+ array('test.event', ' * @event test.event', 'test.event'),
);
}
@@ -170,7 +183,6 @@ class phpbb_event_php_exporter_test extends phpbb_test_case
static public function validate_event_throws_data()
{
return array(
- array('test.event', ' * @event test.event', 1),
array('test.event', '* @event test.event bertie is cool', 2),
array('test.event', 'bertie* @event test.event', 2),
);
diff --git a/tests/extension/manager_test.php b/tests/extension/manager_test.php
index 5c7cad89f6..0eeb060936 100644
--- a/tests/extension/manager_test.php
+++ b/tests/extension/manager_test.php
@@ -156,7 +156,10 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
$table_prefix = 'phpbb_';
$user = new \phpbb\user('\phpbb\user');
+ $container = new phpbb_mock_container_builder();
+
$migrator = new \phpbb\db\migrator(
+ $container,
$config,
$db,
$db_tools,
@@ -167,7 +170,6 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
array(),
new \phpbb\db\migration\helper()
);
- $container = new phpbb_mock_container_builder();
$container->set('migrator', $migrator);
return new \phpbb\extension\manager(
diff --git a/tests/extension/metadata_manager_test.php b/tests/extension/metadata_manager_test.php
index 8e27b39459..2a746d3792 100644
--- a/tests/extension/metadata_manager_test.php
+++ b/tests/extension/metadata_manager_test.php
@@ -62,7 +62,10 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
new \phpbb\template\context()
);
+ $container = new phpbb_mock_container_builder();
+
$this->migrator = new \phpbb\db\migrator(
+ $container,
$this->config,
$this->db,
$this->db_tools,
@@ -73,7 +76,6 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
array(),
new \phpbb\db\migration\helper()
);
- $container = new phpbb_mock_container_builder();
$container->set('migrator', $this->migrator);
$this->extension_manager = new \phpbb\extension\manager(
@@ -123,6 +125,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
}
$json = json_decode(file_get_contents($this->phpbb_root_path . 'ext/vendor2/foo/composer.json'), true);
+ array_walk_recursive($json, array($manager, 'sanitize_json'));
$this->assertEquals($metadata, $json);
}
diff --git a/tests/functional/acp_attachments_test.php b/tests/functional/acp_attachments_test.php
new file mode 100644
index 0000000000..8e810a508a
--- /dev/null
+++ b/tests/functional/acp_attachments_test.php
@@ -0,0 +1,78 @@
+<?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_acp_attachments_test extends phpbb_functional_test_case
+{
+ public function data_imagick_path_linux()
+ {
+ return array(
+ array('/usr/bin', 'Configuration updated successfully'),
+ array('/usr/foobar', 'The entered path “/usr/foobar” does not exist.'),
+ array('/usr/bin/which', 'The entered path “/usr/bin/which” is not a directory.'),
+ );
+ }
+
+ /**
+ * @dataProvider data_imagick_path_linux
+ */
+ public function test_imagick_path_linux($imagick_path, $expected)
+ {
+ if (strtolower(substr(PHP_OS, 0, 5)) !== 'linux')
+ {
+ $this->markTestSkipped('Unable to test linux specific paths on other OS.');
+ }
+
+ $this->login();
+ $this->admin_login();
+
+ $crawler = self::request('GET', 'adm/index.php?i=attachments&mode=attach&sid=' . $this->sid);
+
+ $form = $crawler->selectButton('Submit')->form(array('config[img_imagick]' => $imagick_path));
+
+ $crawler = self::submit($form);
+ $this->assertContains($expected, $crawler->filter('#main')->text());
+ }
+
+ public function data_imagick_path_windows()
+ {
+ return array(
+ array('C:\Windows', 'Configuration updated successfully'),
+ array('C:\Windows\foobar1', 'The entered path “C:\Windows\foobar1” does not exist.'),
+ array('C:\Windows\explorer.exe', 'The entered path “C:\Windows\explorer.exe” is not a directory.'),
+ );
+ }
+
+ /**
+ * @dataProvider data_imagick_path_windows
+ */
+ public function test_imagick_path_windows($imagick_path, $expected)
+ {
+ if (strtolower(substr(PHP_OS, 0, 3)) !== 'win')
+ {
+ $this->markTestSkipped('Unable to test windows specific paths on other OS.');
+ }
+
+ $this->login();
+ $this->admin_login();
+
+ $crawler = self::request('GET', 'adm/index.php?i=attachments&mode=attach&sid=' . $this->sid);
+
+ $form = $crawler->selectButton('Submit')->form(array('config[img_imagick]' => $imagick_path));
+
+ $crawler = self::submit($form);
+ $this->assertContains($expected, $crawler->filter('#main')->text());
+ }
+}
diff --git a/tests/functional/acp_groups_test.php b/tests/functional/acp_groups_test.php
index 4eb4747572..9dfdc93474 100644
--- a/tests/functional/acp_groups_test.php
+++ b/tests/functional/acp_groups_test.php
@@ -11,12 +11,12 @@
*
*/
-require_once dirname(__FILE__) . '/common_groups_test.php';
+require_once dirname(__FILE__) . '/common_groups_test_case.php';
/**
* @group functional
*/
-class phpbb_functional_acp_groups_test extends phpbb_functional_common_groups_test
+class phpbb_functional_acp_groups_test extends phpbb_functional_common_groups_test_case
{
protected $form_data;
diff --git a/tests/functional/acp_profile_field_test.php b/tests/functional/acp_profile_field_test.php
new file mode 100644
index 0000000000..88df782faa
--- /dev/null
+++ b/tests/functional/acp_profile_field_test.php
@@ -0,0 +1,71 @@
+<?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_acp_profile_field_test extends phpbb_functional_test_case
+{
+ public function setUp()
+ {
+ parent::setUp();
+
+ $this->login();
+ $this->admin_login();
+ $this->add_lang('acp/profile');
+ }
+
+ public function data_add_profile_field()
+ {
+ return array(
+ array('bool', 'profilefields.type.bool',
+ array(
+ 'lang_options[0]' => 'foo',
+ 'lang_options[1]' => 'bar',
+ ),
+ array(),
+ ),
+ array('dropdown', 'profilefields.type.dropdown',
+ array(
+ 'lang_options' => "foo\nbar\nbar\nfoo",
+ ),
+ array(),
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider data_add_profile_field
+ */
+ public function test_add_profile_field($name, $type, $page1_settings, $page2_settings)
+ {
+ // Custom profile fields page
+ $crawler = self::request('GET', 'adm/index.php?i=acp_profile&mode=profile&sid=' . $this->sid);
+ // these language strings are html
+ $form = $crawler->selectButton('Create new field')->form(array(
+ 'field_ident' => $name,
+ 'field_type' => $type,
+ ));
+ $crawler = self::submit($form);
+
+ // Fill form for profile field options
+ $form = $crawler->selectButton('Profile type specific options')->form($page1_settings);
+ $crawler = self::submit($form);
+
+ // Fill form for profile field specific options
+ $form = $crawler->selectButton('Save')->form($page2_settings);
+ $crawler= self::submit($form);
+
+ $this->assertContainsLang('ADDED_PROFILE_FIELD', $crawler->text());
+ }
+}
diff --git a/tests/functional/acp_registration_test.php b/tests/functional/acp_registration_test.php
new file mode 100644
index 0000000000..ef9843679e
--- /dev/null
+++ b/tests/functional/acp_registration_test.php
@@ -0,0 +1,55 @@
+<?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_acp_registration_test extends phpbb_functional_test_case
+{
+ protected function set_email_enable($db, $status)
+ {
+ $sql = "UPDATE phpbb_config
+ SET config_value = '" . (($status) ? '1' : '0') . "'
+ WHERE config_name = 'email_enable'";
+ $db->sql_query($sql);
+
+ $this->purge_cache();
+ }
+
+ public function test_submitting_activation_method()
+ {
+ $db = $this->get_db();
+
+ $this->set_email_enable($db, false);
+
+ $this->add_lang('acp/board');
+ $this->login();
+ $this->admin_login();
+
+ $crawler = self::request('GET', 'adm/index.php?i=acp_board&mode=registration&sid=' . $this->sid);
+ $this->assertContainsLang('ACP_REGISTER_SETTINGS_EXPLAIN', $this->get_content());
+
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $form['config[require_activation]']->select(USER_ACTIVATION_ADMIN);
+ $crawler = self::submit($form);
+ $this->assertContainsLang('ACC_ACTIVATION_WARNING', $crawler->filter('div.main')->text());
+
+ $crawler = self::request('GET', 'adm/index.php?i=acp_board&mode=registration&sid=' . $this->sid);
+ $form = $crawler->selectButton($this->lang('SUBMIT'))->form();
+ $form['config[require_activation]']->select(USER_ACTIVATION_NONE);
+ $crawler = self::submit($form);
+ $this->assertNotContainsLang('ACC_ACTIVATION_WARNING', $crawler->filter('div.main')->text());
+
+ $this->set_email_enable($db, true);
+ }
+}
diff --git a/tests/functional/auth_test.php b/tests/functional/auth_test.php
index b4b4279bf1..76e1709afb 100644
--- a/tests/functional/auth_test.php
+++ b/tests/functional/auth_test.php
@@ -34,6 +34,25 @@ class phpbb_functional_auth_test extends phpbb_functional_test_case
}
/**
+ * @dependsOn test_login_other
+ */
+ public function test_login_ucp_other_auth_provider()
+ {
+ global $cache, $config;
+ $cache = new phpbb_mock_null_cache;
+ $db = $this->get_db();
+ $sql = 'UPDATE ' . CONFIG_TABLE . " SET config_value = 'foobar' WHERE config_name = 'auth_method'";
+ $db->sql_query($sql);
+ $config['auth_method'] = 'foobar';
+ $this->login('anothertestuser');
+ $crawler = self::request('GET', 'index.php');
+ $this->assertContains('anothertestuser', $crawler->filter('#username_logged_in')->text());
+ $sql = 'UPDATE ' . CONFIG_TABLE . " SET config_value = 'db' WHERE config_name = 'auth_method'";
+ $db->sql_query($sql);
+ $config['auth_method'] = 'db';
+ }
+
+ /**
* @depends test_login
*/
public function test_logout()
diff --git a/tests/functional/avatar_acp_groups_test.php b/tests/functional/avatar_acp_groups_test.php
index 925335a2f7..ca8c84ab2e 100644
--- a/tests/functional/avatar_acp_groups_test.php
+++ b/tests/functional/avatar_acp_groups_test.php
@@ -11,12 +11,12 @@
*
*/
-require_once dirname(__FILE__) . '/common_avatar_test.php';
+require_once dirname(__FILE__) . '/common_avatar_test_case.php';
/**
* @group functional
*/
-class phpbb_functional_avatar_acp_groups_test extends phpbb_functional_common_avatar_test
+class phpbb_functional_avatar_acp_groups_test extends phpbb_functional_common_avatar_test_case
{
public function get_url()
{
diff --git a/tests/functional/avatar_acp_users_test.php b/tests/functional/avatar_acp_users_test.php
index 5eca473157..8b05a28658 100644
--- a/tests/functional/avatar_acp_users_test.php
+++ b/tests/functional/avatar_acp_users_test.php
@@ -11,12 +11,12 @@
*
*/
-require_once dirname(__FILE__) . '/common_avatar_test.php';
+require_once dirname(__FILE__) . '/common_avatar_test_case.php';
/**
* @group functional
*/
-class phpbb_functional_avatar_acp_users_test extends phpbb_functional_common_avatar_test
+class phpbb_functional_avatar_acp_users_test extends phpbb_functional_common_avatar_test_case
{
public function get_url()
{
diff --git a/tests/functional/avatar_ucp_groups_test.php b/tests/functional/avatar_ucp_groups_test.php
index 1e8ca911c6..52ef67543e 100644
--- a/tests/functional/avatar_ucp_groups_test.php
+++ b/tests/functional/avatar_ucp_groups_test.php
@@ -10,12 +10,12 @@
* the docs/CREDITS.txt file.
*
*/
-require_once dirname(__FILE__) . '/common_avatar_test.php';
+require_once dirname(__FILE__) . '/common_avatar_test_case.php';
/**
* @group functional
*/
-class phpbb_functional_avatar_ucp_groups_test extends phpbb_functional_common_avatar_test
+class phpbb_functional_avatar_ucp_groups_test extends phpbb_functional_common_avatar_test_case
{
public function get_url()
{
diff --git a/tests/functional/avatar_ucp_users_test.php b/tests/functional/avatar_ucp_users_test.php
index 972bfa0fb2..2f0832e092 100644
--- a/tests/functional/avatar_ucp_users_test.php
+++ b/tests/functional/avatar_ucp_users_test.php
@@ -11,12 +11,12 @@
*
*/
-require_once dirname(__FILE__) . '/common_avatar_test.php';
+require_once dirname(__FILE__) . '/common_avatar_test_case.php';
/**
* @group functional
*/
-class phpbb_functional_avatar_ucp_users_test extends phpbb_functional_common_avatar_test
+class phpbb_functional_avatar_ucp_users_test extends phpbb_functional_common_avatar_test_case
{
public function get_url()
{
diff --git a/tests/functional/common_avatar_test.php b/tests/functional/common_avatar_test_case.php
index 82d7136c98..924eb1273c 100644
--- a/tests/functional/common_avatar_test.php
+++ b/tests/functional/common_avatar_test_case.php
@@ -14,7 +14,7 @@
/**
* @group functional
*/
-abstract class phpbb_functional_common_avatar_test extends phpbb_functional_test_case
+abstract class phpbb_functional_common_avatar_test_case extends phpbb_functional_test_case
{
private $path;
private $form_content;
@@ -62,7 +62,7 @@ abstract class phpbb_functional_common_avatar_test extends phpbb_functional_test
{
if (is_array($value))
{
- $form[$key]->$value[0]($value[1]);
+ $form[$key]->{$value[0]}($value[1]);
}
else
{
diff --git a/tests/functional/common_groups_test.php b/tests/functional/common_groups_test_case.php
index 748d4d5e0a..521b7c84d2 100644
--- a/tests/functional/common_groups_test.php
+++ b/tests/functional/common_groups_test_case.php
@@ -14,7 +14,7 @@
/**
* @group functional
*/
-abstract class phpbb_functional_common_groups_test extends phpbb_functional_test_case
+abstract class phpbb_functional_common_groups_test_case extends phpbb_functional_test_case
{
abstract protected function get_url();
diff --git a/tests/functional/download_test.php b/tests/functional/download_test.php
index 4e4995c21e..1e863210e6 100644
--- a/tests/functional/download_test.php
+++ b/tests/functional/download_test.php
@@ -66,6 +66,11 @@ class phpbb_functional_download_test extends phpbb_functional_test_case
public function test_download_accessible()
{
+ if (!class_exists('finfo'))
+ {
+ $this->markTestSkipped('Unable to run test with fileinfo disabled');
+ }
+
$this->load_ids(array(
'forums' => array(
'Download #1',
@@ -118,6 +123,11 @@ class phpbb_functional_download_test extends phpbb_functional_test_case
public function test_download_softdeleted_post()
{
+ if (!class_exists('finfo'))
+ {
+ $this->markTestSkipped('Unable to run test with fileinfo disabled');
+ }
+
$this->load_ids(array(
'forums' => array(
'Download #1',
@@ -180,6 +190,11 @@ class phpbb_functional_download_test extends phpbb_functional_test_case
public function test_download_softdeleted_topic()
{
+ if (!class_exists('finfo'))
+ {
+ $this->markTestSkipped('Unable to run test with fileinfo disabled');
+ }
+
$this->load_ids(array(
'forums' => array(
'Download #1',
diff --git a/tests/functional/feed_test.php b/tests/functional/feed_test.php
index 7aa2d0da7d..9041c8dc69 100644
--- a/tests/functional/feed_test.php
+++ b/tests/functional/feed_test.php
@@ -322,15 +322,9 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
$post = $this->create_topic($this->data['forums']['Feeds #news'], 'Feeds #news - Topic #1', 'This is a test topic posted by the testing framework.');
$this->data['topics']['Feeds #news - Topic #1'] = (int) $post['topic_id'];
- // Travis is too fast, so we have to wait
- sleep(1);
-
$post = $this->create_topic($this->data['forums']['Feeds #news'], 'Feeds #news - Topic #2', 'This is a test topic posted by the testing framework.');
$crawler = self::request('GET', "viewtopic.php?t={$post['topic_id']}&sid={$this->sid}");
- // Travis is too fast, so we have to wait
- sleep(1);
-
$this->assertContains('Feeds #news - Topic #2', $crawler->filter('html')->text());
$this->data['topics']['Feeds #news - Topic #2'] = (int) $post['topic_id'];
$this->data['posts']['Feeds #news - Topic #2'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p');
@@ -456,9 +450,6 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
$post = $this->create_topic($this->data['forums']['Feeds #1'], 'Feeds #1 - Topic #1', 'This is a test topic posted by the testing framework.');
$this->data['topics']['Feeds #1 - Topic #1'] = (int) $post['topic_id'];
- // Travis is too fast, so we have to wait
- sleep(1);
-
$post = $this->create_topic($this->data['forums']['Feeds #1.1'], 'Feeds #1.1 - Topic #1', 'This is a test topic posted by the testing framework.');
$this->data['topics']['Feeds #1.1 - Topic #1'] = (int) $post['topic_id'];
}
@@ -494,9 +485,6 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
$post = $this->create_topic($this->data['forums']['Feeds #1'], 'Feeds #1 - Topic #2', 'This is a test topic posted by the testing framework.');
$this->data['topics']['Feeds #1 - Topic #2'] = (int) $post['topic_id'];
- // Travis is too fast, so we have to wait
- sleep(1);
-
// Test creating a reply
$post2 = $this->create_post($this->data['forums']['Feeds #1'], $post['topic_id'], 'Re: Feeds #1 - Topic #2', 'This is a test post posted by the testing framework.');
$crawler = self::request('GET', "viewtopic.php?t={$post2['topic_id']}&sid={$this->sid}");
@@ -852,9 +840,7 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
'Feeds #1.1',
),
));
-
- // We have to wait because of the flood interval.
- sleep(15);
+ $this->set_flood_interval(0);
$this->login('disapprove_user');
$post = $this->create_topic($this->data['forums']['Feeds #1.1'], 'Feeds #1.1 - Topic #3', 'This is a test topic posted by the testing framework.', array(), 'POST_STORED_MOD');
@@ -862,6 +848,27 @@ class phpbb_functional_feed_test extends phpbb_functional_test_case
$crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Feeds #1.1']}&sid={$this->sid}");
$this->assertNotContains('Feeds #1.1 - Topic #3', $crawler->filter('html')->text());
+
+ $this->logout();
+ $this->set_flood_interval(15);
+ }
+
+ protected function set_flood_interval($flood_interval)
+ {
+ $this->login();
+ $this->admin_login();
+
+ $crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_board&mode=post');
+
+ $form = $crawler->selectButton('Submit')->form();
+ $values = $form->getValues();
+
+ $values["config[flood_interval]"] = $flood_interval;
+ $form->setValues($values);
+ $crawler = self::submit($form);
+ $this->assertGreaterThan(0, $crawler->filter('.successbox')->count());
+
+ $this->logout();
}
public function test_feeds_unapproved_topic_admin()
diff --git a/tests/functional/fileupload_form_test.php b/tests/functional/fileupload_form_test.php
index b8c48389e0..d381fa1ae2 100644
--- a/tests/functional/fileupload_form_test.php
+++ b/tests/functional/fileupload_form_test.php
@@ -93,23 +93,32 @@ class phpbb_functional_fileupload_form_test extends phpbb_functional_test_case
$this->login();
$this->admin_login();
$this->add_lang('ucp');
- $crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_attachments&mode=attach');
- $form = $crawler->selectButton('Submit')->form();
- $values = $form->getValues();
+ // Make sure check_attachment_content is set to false
+ $crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_attachments&mode=attach');
- $values["config[check_attachment_content]"] = 0;
- $form->setValues($values);
- $crawler = self::submit($form);
+ $form = $crawler->selectButton('Submit')->form(array(
+ 'config[check_attachment_content]' => 0,
+ 'config[img_imagick]' => '',
+ ));
+ self::submit($form);
// Request index for correct URL
- $crawler = self::request('GET', 'index.php?sid=' . $this->sid);
+ self::request('GET', 'index.php?sid=' . $this->sid);
$crawler = $this->upload_file('disallowed.jpg', 'image/jpeg');
// Hitting the UNABLE_GET_IMAGE_SIZE error means we passed the
// DISALLOWED_CONTENT check
$this->assertContainsLang('UNABLE_GET_IMAGE_SIZE', $crawler->text());
+
+ // Reset check_attachment_content to default (enabled)
+ $crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_attachments&mode=attach');
+
+ $form = $crawler->selectButton('Submit')->form(array(
+ 'config[check_attachment_content]' => 1,
+ ));
+ self::submit($form);
}
public function test_too_large()
diff --git a/tests/functional/fixtures/ext/foo/bar/config/routing.yml b/tests/functional/fixtures/ext/foo/bar/config/routing.yml
index 08bc73038f..374a58046d 100644
--- a/tests/functional/fixtures/ext/foo/bar/config/routing.yml
+++ b/tests/functional/fixtures/ext/foo/bar/config/routing.yml
@@ -1,35 +1,35 @@
foo_bar_controller:
- pattern: /foo/bar
+ path: /foo/bar
defaults: { _controller: foo_bar.controller:handle }
foo_baz_controller:
- pattern: /foo/baz
+ path: /foo/baz
defaults: { _controller: foo_bar.controller:baz }
foo_template_controller:
- pattern: /foo/template
+ path: /foo/template
defaults: { _controller: foo_bar.controller:template }
foo_exception_controller:
- pattern: /foo/exception
+ path: /foo/exception
defaults: { _controller: foo_bar.controller:exception }
foo_login_redirect_controller:
- pattern: /foo/login_redirect
+ path: /foo/login_redirect
defaults: { _controller: foo_bar.controller:login_redirect }
foo_redirect_controller:
- pattern: /foo/redirect
+ path: /foo/redirect
defaults: { _controller: foo_bar.controller:redirect }
foo_index_controller:
- pattern: /index
+ path: /index
defaults: { _controller: foo_bar.controller:redirect }
foo_tests_index_controller:
- pattern: /tests/index
+ path: /tests/index
defaults: { _controller: foo_bar.controller:redirect }
foo_tests_dotdot_index_controller:
- pattern: /tests/../index
+ path: /tests/../index
defaults: { _controller: foo_bar.controller:redirect }
diff --git a/tests/functional/fixtures/ext/foo/foo/config/resource.yml b/tests/functional/fixtures/ext/foo/foo/config/resource.yml
index ed1d018016..4f2b9cce70 100644
--- a/tests/functional/fixtures/ext/foo/foo/config/resource.yml
+++ b/tests/functional/fixtures/ext/foo/foo/config/resource.yml
@@ -1,3 +1,3 @@
foo_foo_controller:
- pattern: /foo
+ path: /foo
defaults: { _controller: foo_foo.controller:handle }
diff --git a/tests/functional/memberlist_test.php b/tests/functional/memberlist_test.php
index c76ba6e37d..1da5c39401 100644
--- a/tests/functional/memberlist_test.php
+++ b/tests/functional/memberlist_test.php
@@ -106,4 +106,32 @@ class phpbb_functional_memberlist_test extends phpbb_functional_test_case
$this->assertContains('admin', $crawler->eq(0)->text());
$this->assertNotContains('admin', $crawler->eq(1)->text());
}
+
+ public function test_group_rank()
+ {
+ copy(__DIR__ . '/fixtures/files/valid.jpg', __DIR__ . '/../../phpBB/images/ranks/valid.jpg');
+
+ $this->login();
+ $this->admin_login();
+ $this->add_lang(array('acp/groups', 'acp/posting'));
+
+ // Set a group rank to the registered users
+ $crawler = self::request('GET', "adm/index.php?sid={$this->sid}&i=acp_groups&mode=manage&action=edit&g=2");
+ $form = $crawler->selectButton('Submit')->form();
+ $form['group_rank']->select('1');
+ $crawler = self::submit($form);
+ $this->assertContainsLang('GROUP_UPDATED', $crawler->filter('.successbox')->text());
+
+ // Set a rank image for site_admin
+ $crawler = self::request('GET', "adm/index.php?sid={$this->sid}&i=acp_ranks&mode=ranks&action=edit&id=1");
+ $form = $crawler->selectButton('Submit')->form();
+ $form['rank_image']->select('valid.jpg');
+ $crawler = self::submit($form);
+ $this->assertContainsLang('RANK_UPDATED', $crawler->filter('.successbox')->text());
+
+ $crawler = self::request('GET', 'memberlist.php?mode=group&g=2');
+ $this->assertContains('memberlist-test-user', $crawler->text());
+
+ unlink(__DIR__ . '/../../phpBB/images/ranks/valid.jpg');
+ }
}
diff --git a/tests/functional/notification_test.php b/tests/functional/notification_test.php
index 667d268b1e..ec03f7a6a4 100644
--- a/tests/functional/notification_test.php
+++ b/tests/functional/notification_test.php
@@ -82,8 +82,6 @@ class phpbb_functional_notification_test extends phpbb_functional_test_case
// Get form token
$link = $crawler->selectLink($this->lang('NOTIFICATIONS_MARK_ALL_READ'))->link()->getUri();
$crawler = self::request('GET', substr($link, strpos($link, 'ucp.')));
- $form = $crawler->selectButton($this->lang('YES'))->form();
- $crawler = self::submit($form);
$this->assertEquals(0, $crawler->filter('#notification_list_button strong')->text());
}
}
diff --git a/tests/functional/prune_shadow_topic_test.php b/tests/functional/prune_shadow_topic_test.php
index 84f07e9802..c014119b98 100644
--- a/tests/functional/prune_shadow_topic_test.php
+++ b/tests/functional/prune_shadow_topic_test.php
@@ -62,7 +62,7 @@ class phpbb_functional_prune_shadow_topic_test extends phpbb_functional_test_cas
$crawler = self::request('GET', "viewtopic.php?t={$this->post['topic_id']}&sid={$this->sid}");
$this->assertContains('Prune Shadow #1', $crawler->filter('html')->text());
- $this->data['topics']['Prune Shadow #1'] = (int) $post['topic_id'];
+ $this->data['topics']['Prune Shadow #1'] = (int) $this->post['topic_id'];
$this->data['posts']['Prune Shadow #1'] = (int) $this->get_parameter_from_link($crawler->filter('.post')->selectLink($this->lang('POST', '', ''))->link()->getUri(), 'p');
$this->assert_forum_details($this->data['forums']['Prune Shadow'], array(
@@ -129,8 +129,8 @@ class phpbb_functional_prune_shadow_topic_test extends phpbb_functional_test_cas
$result = $this->db->sql_query($sql);
$crawler = self::request('GET', "viewforum.php?f={$this->data['forums']['Prune Shadow']}&sid={$this->sid}");
- $cron_link = $crawler->filter('img')->last()->attr('src');
- $crawler = self::request('GET', $cron_link . "&sid={$this->sid}", array(), false);
+ $this->assertNotEmpty($crawler->filter('img')->last()->attr('src'));
+ self::request('GET', "cron.php?cron_type=cron.task.core.prune_shadow_topics&f={$this->data['forums']['Prune Shadow']}&sid={$this->sid}", array(), false);
$this->assert_forum_details($this->data['forums']['Prune Shadow'], array(
'forum_posts_approved' => 0,
diff --git a/tests/functional/registration_test.php b/tests/functional/registration_test.php
index 45a684db19..690f4ae9f2 100644
--- a/tests/functional/registration_test.php
+++ b/tests/functional/registration_test.php
@@ -45,12 +45,23 @@ class phpbb_functional_registration_test extends phpbb_functional_test_case
$form = $crawler->selectButton('Submit')->form(array(
'username' => 'user-reg-test',
'email' => 'user-reg-test@phpbb.com',
- 'new_password' => 'testtest',
- 'password_confirm' => 'testtest',
+ 'new_password' => 'user-reg-testuser-reg-test',
+ 'password_confirm' => 'user-reg-testuser-reg-test',
));
$form['tz']->select('Europe/Berlin');
$crawler = self::submit($form);
$this->assertContainsLang('ACCOUNT_ADDED', $crawler->filter('#message')->text());
}
+
+ /**
+ * @depends test_register_new_account
+ */
+ public function test_default_subscription_options()
+ {
+ $this->login('user-reg-test');
+ $crawler = self::request('GET', 'ucp.php?i=ucp_notifications&mode=notification_options&sid=' . $this->sid);
+ $this->assert_checkbox_is_checked($crawler, 'notification.type.post_notification.method.email');
+ $this->assert_checkbox_is_checked($crawler, 'notification.type.topic_notification.method.email');
+ }
}
diff --git a/tests/functional/ucp_groups_test.php b/tests/functional/ucp_groups_test.php
index 2b075b37a5..cd18a0fcae 100644
--- a/tests/functional/ucp_groups_test.php
+++ b/tests/functional/ucp_groups_test.php
@@ -11,12 +11,12 @@
*
*/
-require_once dirname(__FILE__) . '/common_groups_test.php';
+require_once dirname(__FILE__) . '/common_groups_test_case.php';
/**
* @group functional
*/
-class phpbb_functional_ucp_groups_test extends phpbb_functional_common_groups_test
+class phpbb_functional_ucp_groups_test extends phpbb_functional_common_groups_test_case
{
protected $db;
diff --git a/tests/functional/viewforum_paging_test.php b/tests/functional/viewforum_paging_test.php
new file mode 100644
index 0000000000..4a574bebbb
--- /dev/null
+++ b/tests/functional/viewforum_paging_test.php
@@ -0,0 +1,256 @@
+<?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 viewforum_paging_test extends phpbb_functional_test_case
+{
+ protected $data = array();
+
+ public function test_setup_forums()
+ {
+ $this->login();
+ $this->admin_login();
+
+ $crawler = self::request('GET', "adm/index.php?i=acp_forums&mode=manage&sid={$this->sid}");
+ $form = $crawler->selectButton('addforum')->form(array(
+ 'forum_name' => 'Viewforum Pagination Test #1',
+ ));
+ $crawler = self::submit($form);
+ $form = $crawler->selectButton('update')->form(array(
+ 'forum_perm_from' => 2,
+ ));
+ self::submit($form);
+
+ $crawler = self::request('GET', "adm/index.php?i=acp_forums&mode=manage&sid={$this->sid}");
+ $form = $crawler->selectButton('addforum')->form(array(
+ 'forum_name' => 'Viewforum Pagination Test #2',
+ ));
+ $crawler = self::submit($form);
+ $form = $crawler->selectButton('update')->form(array(
+ 'forum_perm_from' => 2,
+ ));
+ self::submit($form);
+
+ $this->set_post_settings(array(
+ 'flood_interval' => 0,
+ 'topics_per_page' => 3,
+ ));
+ }
+
+ public function test_create_posts()
+ {
+ $this->login();
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Viewforum Pagination Test #1',
+ 'Viewforum Pagination Test #2',
+ ),
+ ));
+
+ $this->assert_forum_details($this->data['forums']['Viewforum Pagination Test #1'], array(
+ 'forum_posts_approved' => 0,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 0,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ 'forum_last_post_id' => 0,
+ ), 'initial comparison');
+
+ for ($topic_id = 1; $topic_id <= 6; $topic_id++)
+ {
+ $this->create_topic($this->data['forums']['Viewforum Pagination Test #1'], 'Viewforum Pagination TestTopic #' . $topic_id, 'This is a test topic posted by the testing framework.');
+ }
+
+ $this->create_topic($this->data['forums']['Viewforum Pagination Test #2'], 'Viewforum Pagination TestTopic #GA1', 'This is a test topic posted by the testing framework.', array(
+ 'topic_type' => POST_GLOBAL,
+ ));
+
+ $this->assert_forum_details($this->data['forums']['Viewforum Pagination Test #1'], array(
+ 'forum_posts_approved' => 6,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 6,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ ), 'after creating topics');
+
+ $this->assert_forum_details($this->data['forums']['Viewforum Pagination Test #2'], array(
+ 'forum_posts_approved' => 1,
+ 'forum_posts_unapproved' => 0,
+ 'forum_posts_softdeleted' => 0,
+ 'forum_topics_approved' => 1,
+ 'forum_topics_unapproved' => 0,
+ 'forum_topics_softdeleted' => 0,
+ ), 'after creating GA');
+
+ // Set flood interval back to 15
+ $this->admin_login();
+ $this->set_post_settings(array(
+ 'flood_interval' => 15,
+ ));
+ }
+
+ public function test_viewforum_first_page()
+ {
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Viewforum Pagination Test #1',
+ 'Viewforum Pagination Test #2',
+ ),
+ ));
+ $crawler = self::request('GET', 'viewforum.php?f=' . $this->data['forums']['Viewforum Pagination Test #1']);
+
+ // Test the topics that are displayed
+ $topiclists = $crawler->filter('.forumbg .topics');
+ $this->assertEquals(2, $topiclists->count());
+ $topiclist = $topiclists->eq(0)->filter('li');
+ $this->assertStringEndsWith('TestTopic #GA1', $topiclist->eq(0)->filter('.topictitle')->text());
+ $topiclist = $topiclists->eq(1)->filter('li');
+ $this->assertStringEndsWith('TestTopic #6', $topiclist->eq(0)->filter('.topictitle')->text());
+ $this->assertStringEndsWith('TestTopic #5', $topiclist->eq(1)->filter('.topictitle')->text());
+ $this->assertStringEndsWith('TestTopic #4', $topiclist->eq(2)->filter('.topictitle')->text());
+
+ // Test the pagination, should only have: 1 - 2 - Next
+ $this->assertEquals(2, $crawler->filter('div.pagination')->count());
+ $top_pagination = $crawler->filter('div.pagination')->eq(0);
+ $this->assertEquals(3, $top_pagination->filter('li')->count(), 'Number of pagination items on page 1 does not match');
+ $this->assertContains('1', $top_pagination->filter('li')->eq(0)->text());
+ $this->assertContains('2', $top_pagination->filter('li')->eq(1)->text());
+ $this->assertContainsLang('NEXT', $top_pagination->filter('li')->eq(2)->text());
+ }
+
+ public function test_viewforum_second_page()
+ {
+ $this->load_ids(array(
+ 'forums' => array(
+ 'Viewforum Pagination Test #1',
+ 'Viewforum Pagination Test #2',
+ ),
+ ));
+ $crawler = self::request('GET', 'viewforum.php?f=' . $this->data['forums']['Viewforum Pagination Test #1'] . '&start=3');
+
+ // Test the topics that are displayed
+ $topiclists = $crawler->filter('.forumbg .topics');
+ $this->assertEquals(2, $topiclists->count());
+ $topiclist = $topiclists->eq(0)->filter('li');
+ $this->assertStringEndsWith('TestTopic #GA1', $topiclist->eq(0)->filter('.topictitle')->text());
+ $topiclist = $topiclists->eq(1)->filter('li');
+ $this->assertStringEndsWith('TestTopic #3', $topiclist->eq(0)->filter('.topictitle')->text());
+ $this->assertStringEndsWith('TestTopic #2', $topiclist->eq(1)->filter('.topictitle')->text());
+ $this->assertStringEndsWith('TestTopic #1', $topiclist->eq(2)->filter('.topictitle')->text());
+
+ // Test the pagination, should only have: Previous - 1 - 2
+ $this->assertEquals(2, $crawler->filter('div.pagination')->count());
+ $top_pagination = $crawler->filter('div.pagination')->eq(0);
+ $this->assertEquals(3, $top_pagination->filter('li')->count(), 'Number of pagination items on page 2 does not match');
+ $this->assertContainsLang('PREVIOUS', $top_pagination->filter('li')->eq(0)->text());
+ $this->assertContains('1', $top_pagination->filter('li')->eq(1)->text());
+ $this->assertContains('2', $top_pagination->filter('li')->eq(2)->text());
+ }
+
+ protected function assert_forum_details($forum_id, $details, $additional_error_message = '')
+ {
+ $this->db = $this->get_db();
+
+ $sql = 'SELECT ' . implode(', ', array_keys($details)) . '
+ FROM phpbb_forums
+ WHERE forum_id = ' . (int) $forum_id;
+ $result = $this->db->sql_query($sql);
+ $data = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $this->assertEquals($details, $data, "Forum {$forum_id} does not match expected {$additional_error_message}");
+ }
+
+ /**
+ * Sets the post setting via the ACP page
+ *
+ * @param array $settings
+ */
+ protected function set_post_settings($settings)
+ {
+ $crawler = self::request('GET', 'adm/index.php?sid=' . $this->sid . '&i=acp_board&mode=post');
+
+ $form = $crawler->selectButton('Submit')->form();
+ $values = $form->getValues();
+
+ foreach ($settings as $setting => $value)
+ {
+ $values["config[{$setting}]"] = $value;
+ }
+ $form->setValues($values);
+ $crawler = self::submit($form);
+ $this->assertGreaterThan(0, $crawler->filter('.successbox')->count());
+ }
+
+ /**
+ * Loads forum, topic and post IDs
+ *
+ * @param array $data
+ */
+ protected function load_ids($data)
+ {
+ $this->db = $this->get_db();
+
+ if (!empty($data['forums']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_forums
+ WHERE ' . $this->db->sql_in_set('forum_name', $data['forums']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['forum_name'], $data['forums']))
+ {
+ $this->data['forums'][$row['forum_name']] = (int) $row['forum_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ if (!empty($data['topics']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_topics
+ WHERE ' . $this->db->sql_in_set('topic_title', $data['topics']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['topic_title'], $data['topics']))
+ {
+ $this->data['topics'][$row['topic_title']] = (int) $row['topic_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ if (!empty($data['posts']))
+ {
+ $sql = 'SELECT *
+ FROM phpbb_posts
+ WHERE ' . $this->db->sql_in_set('post_subject', $data['posts']);
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (in_array($row['post_subject'], $data['posts']))
+ {
+ $this->data['posts'][$row['post_subject']] = (int) $row['post_id'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+ }
+ }
+}
diff --git a/tests/functions/build_url_test.php b/tests/functions/build_url_test.php
index 06415a424e..a59b94c744 100644
--- a/tests/functions/build_url_test.php
+++ b/tests/functions/build_url_test.php
@@ -69,6 +69,11 @@ class phpbb_build_url_test extends phpbb_test_case
array('f', 'style', 't'),
'http://test.phpbb.com/viewtopic.php?',
),
+ array(
+ 'posting.php?f=2&mode=delete&p=20%22%3Cscript%3Ealert%281%29%3B%3C%2Fscript%3E',
+ false,
+ 'phpBB/posting.php?f=2&amp;mode=delete&amp;p=20%22%3Cscript%3Ealert%281%29%3B%3C%2Fscript%3E',
+ )
);
}
diff --git a/tests/functions/get_remote_file_test.php b/tests/functions/get_remote_file_test.php
index d412dce164..612d82273e 100644
--- a/tests/functions/get_remote_file_test.php
+++ b/tests/functions/get_remote_file_test.php
@@ -21,6 +21,10 @@ class phpbb_functions_get_remote_file extends phpbb_test_case
{
public function test_version_phpbb_com()
{
+ global $phpbb_container;
+ $phpbb_container = new phpbb_mock_container_builder();
+ $phpbb_container->set('file_downloader', new \phpbb\file_downloader());
+
$hostname = 'version.phpbb.com';
if (!phpbb_checkdnsrr($hostname, 'A'))
diff --git a/tests/functions/make_clickable_email_test.php b/tests/functions/make_clickable_email_test.php
new file mode 100644
index 0000000000..4c802d0487
--- /dev/null
+++ b/tests/functions/make_clickable_email_test.php
@@ -0,0 +1,222 @@
+<?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 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()
+ {
+ parent::setUp();
+
+ global $config, $user, $request;
+ $user = new phpbb_mock_user();
+ $request = new phpbb_mock_request();
+ }
+
+ /**
+ * 'e' tag for email addresses html
+ **/
+ public function data_test_make_clickable_email_positive()
+ {
+ return array(
+ array(
+ 'nobody@phpbb.com',
+ '<!-- e --><a href="mailto:nobody@phpbb.com">nobody@phpbb.com</a><!-- e -->'
+ ),
+ array(
+ 'Nobody@sub.phpbb.com',
+ '<!-- e --><a href="mailto:Nobody@sub.phpbb.com">Nobody@sub.phpbb.com</a><!-- e -->'
+ ),
+ array(
+ 'alice.bob@foo.phpbb.com',
+ '<!-- e --><a href="mailto:alice.bob@foo.phpbb.com">alice.bob@foo.phpbb.com</a><!-- e -->'
+ ),
+ array(
+ 'alice-foo@bar.phpbb.com',
+ '<!-- e --><a href="mailto:alice-foo@bar.phpbb.com">alice-foo@bar.phpbb.com</a><!-- e -->'
+ ),
+ array(
+ 'alice_foo@bar.phpbb.com',
+ '<!-- e --><a href="mailto:alice_foo@bar.phpbb.com">alice_foo@bar.phpbb.com</a><!-- e -->'
+ ),
+ array(
+ 'alice+tag@foo.phpbb.com',
+ '<!-- e --><a href="mailto:alice+tag@foo.phpbb.com">alice+tag@foo.phpbb.com</a><!-- e -->'
+ ),
+ array(
+ 'alice&amp;tag@foo.phpbb.com',
+ '<!-- e --><a href="mailto:alice&amp;tag@foo.phpbb.com">alice&amp;tag@foo.phpbb.com</a><!-- e -->'
+ ),
+ array(
+ 'alice@phpbb.australia',
+ '<!-- e --><a href="mailto:alice@phpbb.australia">alice@phpbb.australia</a><!-- e -->'
+ ),
+
+ // Test shortened text for email > 55 characters long
+ // Email text should be turned into: first 39 chars + ' ... ' + last 10 chars
+ array(
+ 'alice@phpbb.topZlevelZdomainZnamesZcanZbeZupZtoZsixtyZthreeZcharactersZlong',
+ '<!-- e --><a href="mailto:alice@phpbb.topZlevelZdomainZnamesZcanZbeZupZtoZsixtyZthreeZcharactersZlong">alice@phpbb.topZlevelZdomainZnamesZcanZ ... ctersZlong</a><!-- e -->'
+ ),
+ array(
+ 'l3tt3rsAndNumb3rs@domain.com',
+ '<!-- e --><a href="mailto:l3tt3rsAndNumb3rs@domain.com">l3tt3rsAndNumb3rs@domain.com</a><!-- e -->'
+ ),
+ array(
+ 'has-dash@domain.com',
+ '<!-- e --><a href="mailto:has-dash@domain.com">has-dash@domain.com</a><!-- e -->'
+ ),
+ array(
+ 'hasApostrophe.o\'leary@domain.org',
+ '<!-- e --><a href="mailto:hasApostrophe.o\'leary@domain.org">hasApostrophe.o\'leary@domain.org</a><!-- e -->'
+ ),
+ array(
+ 'uncommonTLD@domain.museum',
+ '<!-- e --><a href="mailto:uncommonTLD@domain.museum">uncommonTLD@domain.museum</a><!-- e -->'
+ ),
+ array(
+ 'uncommonTLD@domain.travel',
+ '<!-- e --><a href="mailto:uncommonTLD@domain.travel">uncommonTLD@domain.travel</a><!-- e -->'
+ ),
+ array(
+ 'uncommonTLD@domain.mobi',
+ '<!-- e --><a href="mailto:uncommonTLD@domain.mobi">uncommonTLD@domain.mobi</a><!-- e -->'
+ ),
+ array(
+ 'countryCodeTLD@domain.uk',
+ '<!-- e --><a href="mailto:countryCodeTLD@domain.uk">countryCodeTLD@domain.uk</a><!-- e -->'
+ ),
+ array(
+ 'countryCodeTLD@domain.rw',
+ '<!-- e --><a href="mailto:countryCodeTLD@domain.rw">countryCodeTLD@domain.rw</a><!-- e -->'
+ ),
+ array(
+ 'numbersInDomain@911.com',
+ '<!-- e --><a href="mailto:numbersInDomain@911.com">numbersInDomain@911.com</a><!-- e -->'
+ ),
+ array(
+ 'underscore_inLocal@domain.net',
+ '<!-- e --><a href="mailto:underscore_inLocal@domain.net">underscore_inLocal@domain.net</a><!-- e -->'
+ ),
+ array(
+ 'IPInsteadOfDomain@127.0.0.1',
+ '<!-- e --><a href="mailto:IPInsteadOfDomain@127.0.0.1">IPInsteadOfDomain@127.0.0.1</a><!-- e -->'
+ ),
+ array(
+ 'IPAndPort@127.0.0.1:25',
+ '<!-- e --><a href="mailto:IPAndPort@127.0.0.1:25">IPAndPort@127.0.0.1:25</a><!-- e -->'
+ ),
+ array(
+ 'subdomain@sub.domain.com',
+ '<!-- e --><a href="mailto:subdomain@sub.domain.com">subdomain@sub.domain.com</a><!-- e -->'
+ ),
+ array(
+ 'local@dash-inDomain.com',
+ '<!-- e --><a href="mailto:local@dash-inDomain.com">local@dash-inDomain.com</a><!-- e -->'
+ ),
+ array(
+ 'dot.inLocal@foo.com',
+ '<!-- e --><a href="mailto:dot.inLocal@foo.com">dot.inLocal@foo.com</a><!-- e -->'
+ ),
+ array(
+ 'a@singleLetterLocal.org',
+ '<!-- e --><a href="mailto:a@singleLetterLocal.org">a@singleLetterLocal.org</a><!-- e -->'
+ ),
+ array(
+ 'singleLetterDomain@x.org',
+ '<!-- e --><a href="mailto:singleLetterDomain@x.org">singleLetterDomain@x.org</a><!-- e -->'
+ ),
+ array(
+ '&amp;*=?^+{}\'~@validCharsInLocal.net',
+ '<!-- e --><a href="mailto:&amp;*=?^+{}\'~@validCharsInLocal.net">&amp;*=?^+{}\'~@validCharsInLocal.net</a><!-- e -->'
+ ),
+ array(
+ 'foor@bar.newTLD',
+ '<!-- e --><a href="mailto:foor@bar.newTLD">foor@bar.newTLD</a><!-- e -->'
+ ),
+ );
+ }
+
+ public function data_test_make_clickable_email_negative()
+ {
+ return array(
+ array('foo.example.com'), // @ is missing
+ array('.foo.example.com'), // . as first character
+ array('Foo.@example.com'), // . is last in local part
+ array('foo..123@example.com'), // . doubled
+ array('a@b@c@example.com'), // @ doubled
+
+ // Emails with invalid characters
+ // (only 'valid' pieces having localparts prepended with one of the \n \t ( > chars should parsed if any)
+ array('()[]\;:,<>@example.com'), // invalid characters
+ array('abc(def@example.com', 'abc(<!-- e --><a href="mailto:def@example.com">def@example.com</a><!-- e -->'), // invalid character (
+ array('abc)def@example.com'), // invalid character )
+ array('abc[def@example.com'), // invalid character [
+ array('abc]def@example.com'), // invalid character ]
+ array('abc\def@example.com'), // invalid character \
+ array('abc;def@example.com'), // invalid character ;
+ array('abc:def@example.com'), // invalid character :
+ array('abc,def@example.com'), // invalid character ,
+ array('abc<def@example.com'), // invalid character <
+ array('abc>def@example.com', 'abc><!-- e --><a href="mailto:def@example.com">def@example.com</a><!-- e -->'), // invalid character >
+
+ // http://fightingforalostcause.net/misc/2006/compare-email-regex.php
+ array('missingDomain@.com'),
+ array('@missingLocal.org'),
+ array('missingatSign.net'),
+ array('missingDot@com'),
+ array('two@@signs.com'),
+ // Trailing colon is ignored
+ array('colonButNoPort@127.0.0.1:', '<!-- e --><a href="mailto:colonButNoPort@127.0.0.1">colonButNoPort@127.0.0.1</a><!-- e -->:'),
+
+ array(''),
+ // Trailing part after the 3rd dot is ignored
+ array('someone-else@127.0.0.1.26', '<!-- e --><a href="mailto:someone-else@127.0.0.1">someone-else@127.0.0.1</a><!-- e -->.26'),
+
+ array('.localStartsWithDot@domain.com'),
+ array('localEndsWithDot.@domain.com'),
+ array('two..consecutiveDots@domain.com'),
+ array('domainStartsWithDash@-domain.com'),
+ array('domainEndsWithDash@domain-.com'),
+ array('numbersInTLD@domain.c0m'),
+ array('missingTLD@domain.'),
+ array('! "#$%(),/;<>[]`|@invalidCharsInLocal.org'),
+ array('invalidCharsInDomain@! "#$%(),/;<>_[]`|.org'),
+ array('local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org'),
+ // The domain zone name part after the 63rd char is ignored
+ array(
+ 'alice@phpbb.topZlevelZdomainZnamesZcanZbeZupZtoZsixtyZthreeZcharactersZlongZ',
+ '<!-- e --><a href="mailto:alice@phpbb.topZlevelZdomainZnamesZcanZbeZupZtoZsixtyZthreeZcharactersZlong">alice@phpbb.topZlevelZdomainZnamesZcanZ ... ctersZlong</a><!-- e -->Z'
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider data_test_make_clickable_email_positive
+ */
+ public function test_email_matching_positive($email, $expected)
+ {
+ $this->assertSame($expected, make_clickable($email));
+ }
+
+ /**
+ * @dataProvider data_test_make_clickable_email_negative
+ */
+ public function test_email_matching_negative($email, $expected = null)
+ {
+ $expected = ($expected) ?: $email;
+ $this->assertSame($expected, make_clickable($email));
+ }
+}
diff --git a/tests/functions/make_clickable_test.php b/tests/functions/make_clickable_test.php
new file mode 100644
index 0000000000..63beeb06b2
--- /dev/null
+++ b/tests/functions/make_clickable_test.php
@@ -0,0 +1,180 @@
+<?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 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
+{
+ /**
+ * Tags:
+ * 'm' - full URL like xxxx://aaaaa.bbb.cccc.
+ * 'l' - local relative board URL like http://domain.tld/path/to/board/index.php
+ * 'w' - URL without http/https protocol like www.xxxx.yyyy[/zzzz] aka 'lazy' URLs
+ * 'e' - email@domain type address
+ *
+ * Classes:
+ * "postlink-local" for 'l' URLs
+ * "postlink" for the rest of URLs
+ * empty for email addresses
+ **/
+ public function data_test_make_clickable_url_positive()
+ {
+ return array(
+ array(
+ 'http://www.phpbb.com/community/',
+ '<!-- m --><a class="postlink" href="http://www.phpbb.com/community/">http://www.phpbb.com/community/</a><!-- m -->'
+ ),
+ array(
+ 'http://www.phpbb.com/path/file.ext#section',
+ '<!-- m --><a class="postlink" href="http://www.phpbb.com/path/file.ext#section">http://www.phpbb.com/path/file.ext#section</a><!-- m -->'
+ ),
+ array(
+ 'ftp://ftp.phpbb.com/',
+ '<!-- m --><a class="postlink" href="ftp://ftp.phpbb.com/">ftp://ftp.phpbb.com/</a><!-- m -->'
+ ),
+ array(
+ 'sip://bantu@phpbb.com',
+ '<!-- m --><a class="postlink" href="sip://bantu@phpbb.com">sip://bantu@phpbb.com</a><!-- m -->'
+ ),
+ array(
+ 'www.phpbb.com/community/',
+ '<!-- w --><a class="postlink" href="http://www.phpbb.com/community/">www.phpbb.com/community/</a><!-- w -->'
+ ),
+ array(
+ 'http://testhost/viewtopic.php?t=1',
+ '<!-- l --><a class="postlink-local" href="http://testhost/viewtopic.php?t=1">viewtopic.php?t=1</a><!-- l -->'
+ ),
+ array(
+ 'email@domain.com',
+ '<!-- e --><a href="mailto:email@domain.com">email@domain.com</a><!-- e -->'
+ ),
+ // Test appending punctuation mark to the URL
+ array(
+ 'http://testhost/viewtopic.php?t=1!',
+ '<!-- l --><a class="postlink-local" href="http://testhost/viewtopic.php?t=1">viewtopic.php?t=1</a><!-- l -->!'
+ ),
+ array(
+ 'www.phpbb.com/community/?',
+ '<!-- w --><a class="postlink" href="http://www.phpbb.com/community/">www.phpbb.com/community/</a><!-- w -->?'
+ ),
+ // Test shortened text for URL > 55 characters long
+ // URL text should be turned into: first 39 chars + ' ... ' + last 10 chars
+ array(
+ 'http://www.phpbb.com/community/path/to/long/url/file.ext#section',
+ '<!-- m --><a class="postlink" href="http://www.phpbb.com/community/path/to/long/url/file.ext#section">http://www.phpbb.com/community/path/to/ ... xt#section</a><!-- m -->'
+ ),
+ );
+ }
+
+ public function data_test_make_clickable_url_idn()
+ {
+ return array(
+ array(
+ 'http://www.täst.de/community/',
+ '<!-- m --><a class="postlink" href="http://www.täst.de/community/">http://www.täst.de/community/</a><!-- m -->'
+ ),
+ array(
+ 'http://www.täst.de/path/file.ext#section',
+ '<!-- m --><a class="postlink" href="http://www.täst.de/path/file.ext#section">http://www.täst.de/path/file.ext#section</a><!-- m -->'
+ ),
+ array(
+ 'ftp://ftp.täst.de/',
+ '<!-- m --><a class="postlink" href="ftp://ftp.täst.de/">ftp://ftp.täst.de/</a><!-- m -->'
+ ),
+ array(
+ 'sip://bantu@täst.de',
+ '<!-- m --><a class="postlink" href="sip://bantu@täst.de">sip://bantu@täst.de</a><!-- m -->'
+ ),
+ array(
+ 'www.täst.de/community/',
+ '<!-- w --><a class="postlink" href="http://www.täst.de/community/">www.täst.de/community/</a><!-- w -->'
+ ),
+ // Test appending punctuation mark to the URL
+ array(
+ 'http://домен.рф/viewtopic.php?t=1!',
+ '<!-- m --><a class="postlink" href="http://домен.рф/viewtopic.php?t=1">http://домен.рф/viewtopic.php?t=1</a><!-- m -->!'
+ ),
+ array(
+ 'www.домен.рф/сообщество/?',
+ '<!-- w --><a class="postlink" href="http://www.домен.рф/сообщество/">www.домен.рф/сообщество/</a><!-- w -->?'
+ ),
+ // Test shortened text for URL > 55 characters long
+ // URL text should be turned into: first 39 chars + ' ... ' + last 10 chars
+ array(
+ 'http://www.домен.рф/сообщество/путь/по/длинной/ссылке/file.ext#section',
+ '<!-- m --><a class="postlink" href="http://www.домен.рф/сообщество/путь/по/длинной/ссылке/file.ext#section">http://www.домен.рф/сообщество/путь/по/ ... xt#section</a><!-- m -->'
+ ),
+
+ // IDN with invalid characters shouldn't be parsed correctly (only 'valid' part)
+ array(
+ 'http://www.täst╫.de',
+ '<!-- m --><a class="postlink" href="http://www.täst">http://www.täst</a><!-- m -->╫.de'
+ ),
+ // IDN in emails is unsupported yet
+ array('почта@домен.рф', 'почта@домен.рф'),
+ );
+ }
+
+ public function data_test_make_clickable_local_url_idn()
+ {
+ return array(
+ array(
+ 'http://www.домен.рф/viewtopic.php?t=1',
+ '<!-- l --><a class="postlink-local" href="http://www.домен.рф/viewtopic.php?t=1">viewtopic.php?t=1</a><!-- l -->'
+ ),
+ // Test appending punctuation mark to the URL
+ array(
+ 'http://www.домен.рф/viewtopic.php?t=1!',
+ '<!-- l --><a class="postlink-local" href="http://www.домен.рф/viewtopic.php?t=1">viewtopic.php?t=1</a><!-- l -->!'
+ ),
+ array(
+ 'http://www.домен.рф/сообщество/?',
+ '<!-- l --><a class="postlink-local" href="http://www.домен.рф/сообщество/">сообщество/</a><!-- l -->?'
+ ),
+ );
+ }
+
+ protected function setUp()
+ {
+ parent::setUp();
+
+ global $config, $user, $request;
+ $user = new phpbb_mock_user();
+ $request = new phpbb_mock_request();
+ }
+
+ /**
+ * @dataProvider data_test_make_clickable_url_positive
+ */
+ public function test_urls_matching_positive($url, $expected)
+ {
+ $this->assertSame($expected, make_clickable($url));
+ }
+
+ /**
+ * @dataProvider data_test_make_clickable_url_idn
+ */
+ public function test_urls_matching_idn($url, $expected)
+ {
+ $this->assertSame($expected, make_clickable($url));
+ }
+
+ /**
+ * @dataProvider data_test_make_clickable_local_url_idn
+ */
+ public function test_local_urls_matching_idn($url, $expected)
+ {
+ $this->assertSame($expected, make_clickable($url, "http://www.домен.рф"));
+ }
+}
diff --git a/tests/functions/validate_username_test.php b/tests/functions/validate_username_test.php
index dc9f685f04..4fa5af7ff3 100644
--- a/tests/functions/validate_username_test.php
+++ b/tests/functions/validate_username_test.php
@@ -11,6 +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';
diff --git a/tests/functions/insert_config_array_test.php b/tests/functions_acp/insert_config_array_test.php
index bfcb05862e..1264b35bf4 100644
--- a/tests/functions/insert_config_array_test.php
+++ b/tests/functions_acp/insert_config_array_test.php
@@ -11,6 +11,8 @@
*
*/
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions_acp.php';
+
class phpbb_functions_insert_config_array_test extends phpbb_test_case
{
public function config_display_vars()
diff --git a/tests/functions_acp/validate_config_vars_test.php b/tests/functions_acp/validate_config_vars_test.php
index 3c9af4a889..4bf6ba3984 100644
--- a/tests/functions_acp/validate_config_vars_test.php
+++ b/tests/functions_acp/validate_config_vars_test.php
@@ -162,4 +162,91 @@ class phpbb_functions_acp_validate_config_vars_test extends phpbb_test_case
$this->assertEquals($expected, $phpbb_error);
}
+
+ public function data_validate_path_linux()
+ {
+ return array(
+ array('/usr/bin', 'absolute_path', true),
+ array('/usr/bin/', 'absolute_path:50:200', true),
+ array('/usr/bin/which', 'absolute_path', 'DIRECTORY_NOT_DIR'),
+ array('/foo/bar', 'absolute_path', 'DIRECTORY_DOES_NOT_EXIST'),
+ array('C:\Windows', 'absolute_path', 'DIRECTORY_DOES_NOT_EXIST'),
+ array('.', 'absolute_path', true),
+ array('', 'absolute_path', true),
+ array('mkdir /foo/bar', 'absolute_path', 'DIRECTORY_DOES_NOT_EXIST'),
+ // Make sure above command didn't do anything
+ array('/foo/bar', 'absolute_path', 'DIRECTORY_DOES_NOT_EXIST'),
+ );
+ }
+
+ /**
+ * @dataProvider data_validate_path_linux
+ */
+ public function test_validate_path_linux($path, $validation_type, $expected)
+ {
+ if (strtolower(substr(PHP_OS, 0, 5)) !== 'linux')
+ {
+ $this->markTestSkipped('Unable to test linux specific paths on other OS.');
+ }
+
+ $error = array();
+ $config_ary = array(
+ 'path' => $path,
+ );
+
+ validate_config_vars(array(
+ 'path' => array('lang' => 'FOOBAR', 'validate' => $validation_type),
+ ),
+ $config_ary,
+ $error
+ );
+ }
+
+ public function data_validate_path_windows()
+ {
+ return array(
+ array('C:\Windows', 'absolute_path', true),
+ array('C:\Windows\\', 'absolute_path:50:200', true),
+ array('C:\Windows\explorer.exe', 'absolute_path', 'DIRECTORY_NOT_DIR'),
+ array('C:\foobar', 'absolute_path', 'DIRECTORY_DOES_NOT_EXIST'),
+ array('/usr/bin', 'absolute_path', 'DIRECTORY_DOES_NOT_EXIST'),
+ array('.', 'absolute_path', true),
+ array('', 'absolute_path', true),
+ array('mkdir C:\Windows\foobar', 'absolute_path', 'DIRECTORY_DOES_NOT_EXIST'),
+ // Make sure above command didn't do anything
+ array('C:\Windows\foobar', 'absolute_path', 'DIRECTORY_DOES_NOT_EXIST'),
+ );
+ }
+
+ /**
+ * @dataProvider data_validate_path_windows
+ */
+ public function test_validate_path_windows($path, $validation_type, $expected)
+ {
+ if (strtolower(substr(PHP_OS, 0, 3)) !== 'win')
+ {
+ $this->markTestSkipped('Unable to test windows specific paths on other OS.');
+ }
+
+ $error = array();
+ $config_ary = array(
+ 'path' => $path,
+ );
+
+ validate_config_vars(array(
+ 'path' => array('lang' => 'FOOBAR', 'validate' => $validation_type),
+ ),
+ $config_ary,
+ $error
+ );
+
+ if ($expected === true)
+ {
+ $this->assertEmpty($error);
+ }
+ else
+ {
+ $this->assertEquals(array($expected), $error);
+ }
+ }
}
diff --git a/tests/mock/controller_helper.php b/tests/mock/controller_helper.php
index 9c13c309f2..ae3e7bf432 100644
--- a/tests/mock/controller_helper.php
+++ b/tests/mock/controller_helper.php
@@ -13,12 +13,13 @@
class phpbb_mock_controller_helper extends \phpbb\controller\helper
{
- public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, \phpbb\controller\provider $provider, \phpbb\extension\manager $manager, \phpbb\symfony_request $symfony_request, \phpbb\filesystem $filesystem, $phpbb_root_path, $php_ext, $phpbb_root_path_ext)
+ public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, \phpbb\controller\provider $provider, \phpbb\extension\manager $manager, \phpbb\symfony_request $symfony_request, \phpbb\request\request_interface $request, \phpbb\filesystem $filesystem, $phpbb_root_path, $php_ext, $phpbb_root_path_ext)
{
$this->template = $template;
$this->user = $user;
$this->config = $config;
$this->symfony_request = $symfony_request;
+ $this->request = $request;
$this->filesystem = $filesystem;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
diff --git a/tests/mock/event_dispatcher.php b/tests/mock/event_dispatcher.php
index 613551bffd..fa8b4a1036 100644
--- a/tests/mock/event_dispatcher.php
+++ b/tests/mock/event_dispatcher.php
@@ -11,9 +11,18 @@
*
*/
-class phpbb_mock_event_dispatcher
+class phpbb_mock_event_dispatcher extends \phpbb\event\dispatcher
{
- public function trigger_event($eventName, $data)
+ /**
+ * Constructor.
+ *
+ * Overwrite the constructor to get rid of ContainerInterface param instance
+ */
+ public function __construct()
+ {
+ }
+
+ public function trigger_event($eventName, $data = array())
{
return array();
}
diff --git a/tests/mock/file_downloader.php b/tests/mock/file_downloader.php
new file mode 100644
index 0000000000..d8951cebf6
--- /dev/null
+++ b/tests/mock/file_downloader.php
@@ -0,0 +1,27 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+class phpbb_mock_file_downloader extends \phpbb\file_downloader
+{
+ public $data;
+
+ public function set($data)
+ {
+ $this->data = $data;
+ }
+
+ public function get($host, $directory, $filename, $port = 80, $timeout = 6)
+ {
+ return $this->data;
+ }
+}
diff --git a/tests/mock/metadata_manager.php b/tests/mock/metadata_manager.php
index 16900a0fc1..2443fad560 100644
--- a/tests/mock/metadata_manager.php
+++ b/tests/mock/metadata_manager.php
@@ -15,11 +15,13 @@ class phpbb_mock_metadata_manager extends \phpbb\extension\metadata_manager
{
public function set_metadata($metadata)
{
+ array_walk_recursive($metadata, array($this, 'sanitize_json'));
$this->metadata = $metadata;
}
public function merge_metadata($metadata)
{
+ array_walk_recursive($metadata, array($this, 'sanitize_json'));
$this->metadata = array_merge($this->metadata, $metadata);
}
}
diff --git a/tests/mock/request.php b/tests/mock/request.php
index 304fcf0eaf..e7217a94a9 100644
--- a/tests/mock/request.php
+++ b/tests/mock/request.php
@@ -114,4 +114,25 @@ class phpbb_mock_request implements \phpbb\request\request_interface
{
$this->data[$super_global] = array_merge($this->data[$super_global], $values);
}
+
+ public function escape($var, $multibyte)
+ {
+ $type_cast_helper = new \phpbb\request\type_cast_helper();
+ if (is_array($var))
+ {
+ $result = array();
+ foreach ($var as $key => $value)
+ {
+ $type_cast_helper->set_var($key, $key, gettype($key), $multibyte);
+ $result[$key] = $this->escape($value, $multibyte);
+ }
+ $var = $result;
+ }
+ else
+ {
+ $type_cast_helper->set_var($var, $var, 'string', $multibyte);
+ }
+
+ return $var;
+ }
}
diff --git a/tests/notification/base.php b/tests/notification/base.php
index c97b7c24e2..162feae557 100644
--- a/tests/notification/base.php
+++ b/tests/notification/base.php
@@ -66,6 +66,8 @@ abstract class phpbb_tests_notification_base extends phpbb_database_test_case
$phpbb_root_path,
$phpEx
);
+
+ $this->phpbb_dispatcher = new phpbb_mock_event_dispatcher();
$phpbb_container = $this->container = new phpbb_mock_container_builder();
@@ -75,6 +77,7 @@ abstract class phpbb_tests_notification_base extends phpbb_database_test_case
$this->container,
$this->user_loader,
$this->config,
+ $this->phpbb_dispatcher,
$this->db,
$this->cache,
$this->user,
diff --git a/tests/notification/group_request_test.php b/tests/notification/group_request_test.php
index afbc586601..0d1bda95ce 100644
--- a/tests/notification/group_request_test.php
+++ b/tests/notification/group_request_test.php
@@ -12,6 +12,7 @@
*/
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 684dd99280..5e770f71c9 100644
--- a/tests/notification/submit_post_base.php
+++ b/tests/notification/submit_post_base.php
@@ -100,7 +100,8 @@ abstract class phpbb_notification_submit_post_base extends phpbb_database_test_c
// Container
$phpbb_container = new phpbb_mock_container_builder();
- $phpbb_container->set('content.visibility', new \phpbb\content_visibility($auth, $config, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE));
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
+ $phpbb_container->set('content.visibility', new \phpbb\content_visibility($auth, $config, $phpbb_dispatcher, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE));
$user_loader = new \phpbb\user_loader($db, $phpbb_root_path, $phpEx, USERS_TABLE);
@@ -122,7 +123,7 @@ abstract class phpbb_notification_submit_post_base extends phpbb_database_test_c
// Notification Manager
$phpbb_notifications = new \phpbb\notification\manager($notification_types_array, array(),
- $phpbb_container, $user_loader, $config, $db, $cache, $user,
+ $phpbb_container, $user_loader, $config, $phpbb_dispatcher, $db, $cache, $user,
$phpbb_root_path, $phpEx,
NOTIFICATION_TYPES_TABLE, NOTIFICATIONS_TABLE, USER_NOTIFICATIONS_TABLE);
$phpbb_container->set('notification_manager', $phpbb_notifications);
diff --git a/tests/pagination/config/routing.yml b/tests/pagination/config/routing.yml
index dd667274cd..2ce082c9d1 100644
--- a/tests/pagination/config/routing.yml
+++ b/tests/pagination/config/routing.yml
@@ -1,6 +1,6 @@
core_controller:
- pattern: /test
+ path: /test
defaults: { _controller: core_foo.controller:bar, page: 1}
core_page_controller:
- pattern: /test/page/{page}
+ path: /test/page/{page}
defaults: { _controller: core_foo.controller:bar}
diff --git a/tests/pagination/pagination_test.php b/tests/pagination/pagination_test.php
index 95856dd07d..ea6dd999c3 100644
--- a/tests/pagination/pagination_test.php
+++ b/tests/pagination/pagination_test.php
@@ -28,7 +28,7 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
global $phpbb_dispatcher;
- $phpbb_dispatcher = new phpbb_mock_event_dispatcher;
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
$this->user = $this->getMock('\phpbb\user', array(), array('\phpbb\datetime'));
$this->user->expects($this->any())
->method('lang')
@@ -57,8 +57,8 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
$request
);
- $this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $provider, $manager, $symfony_request, $filesystem, '', 'php', dirname(__FILE__) . '/');
- $this->pagination = new \phpbb\pagination($this->template, $this->user, $this->helper);
+ $this->helper = new phpbb_mock_controller_helper($this->template, $this->user, $this->config, $provider, $manager, $symfony_request, $request, $filesystem, '', 'php', dirname(__FILE__) . '/');
+ $this->pagination = new \phpbb\pagination($this->template, $this->user, $this->helper, $phpbb_dispatcher);
}
public function generate_template_pagination_data()
@@ -172,6 +172,42 @@ class phpbb_pagination_pagination_test extends phpbb_template_template_test_case
$this->assertEquals(str_replace("\t", '', $expect), $this->display('test'));
}
+ /**
+ * @dataProvider generate_template_pagination_data
+ */
+ public function test_generate_template_pagination_sub($base_url, $start_name, $num_items, $per_page, $start_item, $expect)
+ {
+ // Block needs to be assigned before pagination
+ $this->template->assign_block_vars('sub', array(
+ 'FOO' => 'bar',
+ ));
+
+ $this->pagination->generate_template_pagination($base_url, 'sub.pagination', $start_name, $num_items, $per_page, $start_item);
+ $this->template->set_filenames(array('test' => 'pagination_sub.html'));
+
+ $this->assertEquals(str_replace("\t", '', $expect), $this->display('test'));
+ }
+
+ /**
+ * @dataProvider generate_template_pagination_data
+ */
+ public function test_generate_template_pagination_double_nested($base_url, $start_name, $num_items, $per_page, $start_item, $expect)
+ {
+ // Block needs to be assigned before pagination
+ $this->template->assign_block_vars('sub', array(
+ 'FOO' => 'bar',
+ ));
+
+ $this->template->assign_block_vars('sub.level2', array(
+ 'BAR' => 'foo',
+ ));
+
+ $this->pagination->generate_template_pagination($base_url, 'sub.level2.pagination', $start_name, $num_items, $per_page, $start_item);
+ $this->template->set_filenames(array('test' => 'pagination_double_nested.html'));
+
+ $this->assertEquals(str_replace("\t", '', $expect), $this->display('test'));
+ }
+
public function on_page_data()
{
return array(
diff --git a/tests/pagination/templates/pagination_double_nested.html b/tests/pagination/templates/pagination_double_nested.html
new file mode 100644
index 0000000000..c179248233
--- /dev/null
+++ b/tests/pagination/templates/pagination_double_nested.html
@@ -0,0 +1,19 @@
+pagination
+<!-- BEGIN sub -->
+<!-- BEGIN level2 -->
+:per_page:{sub.level2.PER_PAGE}
+:current_page:{sub.level2.CURRENT_PAGE}
+:base_url:{sub.level2.BASE_URL}
+<!-- BEGIN pagination -->
+<!-- IF sub.level2.pagination.S_IS_PREV -->:previous:{sub.level2.pagination.PAGE_NUMBER}:{sub.level2.pagination.PAGE_URL}
+<!-- ELSEIF sub.level2.pagination.S_IS_CURRENT -->:current:{sub.level2.pagination.PAGE_NUMBER}:{sub.level2.pagination.PAGE_URL}
+<!-- ELSEIF sub.level2.pagination.S_IS_ELLIPSIS -->:ellipsis:{sub.level2.pagination.PAGE_NUMBER}:{sub.level2.pagination.PAGE_URL}
+<!-- ELSEIF sub.level2.pagination.S_IS_NEXT -->:next:{sub.level2.pagination.PAGE_NUMBER}:{sub.level2.pagination.PAGE_URL}
+<!-- ELSE -->:else:{sub.level2.pagination.PAGE_NUMBER}:{sub.level2.pagination.PAGE_URL}
+<!-- ENDIF -->
+<!-- END pagination -->
+<!-- IF sub.level2.U_PREVIOUS_PAGE -->:u_prev:{sub.level2.U_PREVIOUS_PAGE}<!-- ENDIF -->
+
+<!-- IF sub.level2.U_NEXT_PAGE -->:u_next:{sub.level2.U_NEXT_PAGE}<!-- ENDIF -->
+<!-- END level2 -->
+<!-- END sub -->
diff --git a/tests/pagination/templates/pagination_sub.html b/tests/pagination/templates/pagination_sub.html
new file mode 100644
index 0000000000..4ec14039e0
--- /dev/null
+++ b/tests/pagination/templates/pagination_sub.html
@@ -0,0 +1,17 @@
+pagination
+<!-- BEGIN sub -->
+:per_page:{sub.PER_PAGE}
+:current_page:{sub.CURRENT_PAGE}
+:base_url:{sub.BASE_URL}
+<!-- BEGIN pagination -->
+<!-- IF sub.pagination.S_IS_PREV -->:previous:{sub.pagination.PAGE_NUMBER}:{sub.pagination.PAGE_URL}
+<!-- ELSEIF sub.pagination.S_IS_CURRENT -->:current:{sub.pagination.PAGE_NUMBER}:{sub.pagination.PAGE_URL}
+<!-- ELSEIF sub.pagination.S_IS_ELLIPSIS -->:ellipsis:{sub.pagination.PAGE_NUMBER}:{sub.pagination.PAGE_URL}
+<!-- ELSEIF sub.pagination.S_IS_NEXT -->:next:{sub.pagination.PAGE_NUMBER}:{sub.pagination.PAGE_URL}
+<!-- ELSE -->:else:{sub.pagination.PAGE_NUMBER}:{sub.pagination.PAGE_URL}
+<!-- ENDIF -->
+<!-- END pagination -->
+<!-- IF sub.U_PREVIOUS_PAGE -->:u_prev:{sub.U_PREVIOUS_PAGE}<!-- ENDIF -->
+
+<!-- IF sub.U_NEXT_PAGE -->:u_next:{sub.U_NEXT_PAGE}<!-- ENDIF -->
+<!-- END sub -->
diff --git a/tests/passwords/drivers_test.php b/tests/passwords/drivers_test.php
index ccfb05c40f..5f9fd523c9 100644
--- a/tests/passwords/drivers_test.php
+++ b/tests/passwords/drivers_test.php
@@ -35,7 +35,7 @@ class phpbb_passwords_helper_test extends \phpbb_test_case
'passwords.driver.md5_vb' => new \phpbb\passwords\driver\md5_vb($config, $this->driver_helper),
'passwords.driver.sha_xf1' => new \phpbb\passwords\driver\sha_xf1($config, $this->driver_helper),
);
- $this->passwords_drivers['passwords.driver.md5_phpbb2'] = new \phpbb\passwords\driver\md5_phpbb2($request, $this->passwords_drivers['passwords.driver.salted_md5'], $phpbb_root_path, $php_ext);
+ $this->passwords_drivers['passwords.driver.md5_phpbb2'] = new \phpbb\passwords\driver\md5_phpbb2($request, $this->passwords_drivers['passwords.driver.salted_md5'], $this->driver_helper, $phpbb_root_path, $php_ext);
$this->passwords_drivers['passwords.driver.bcrypt_wcf2'] = new \phpbb\passwords\driver\bcrypt_wcf2($this->passwords_drivers['passwords.driver.bcrypt'], $this->driver_helper);
}
diff --git a/tests/passwords/manager_test.php b/tests/passwords/manager_test.php
index e46cf820f2..333834ee07 100644
--- a/tests/passwords/manager_test.php
+++ b/tests/passwords/manager_test.php
@@ -41,7 +41,7 @@ class phpbb_passwords_manager_test extends \phpbb_test_case
'passwords.driver.md5_vb' => new \phpbb\passwords\driver\md5_vb($config, $this->driver_helper),
'passwords.driver.sha_xf1' => new \phpbb\passwords\driver\sha_xf1($config, $this->driver_helper),
);
- $this->passwords_drivers['passwords.driver.md5_phpbb2'] = new \phpbb\passwords\driver\md5_phpbb2($request, $this->passwords_drivers['passwords.driver.salted_md5'], $phpbb_root_path, $php_ext);
+ $this->passwords_drivers['passwords.driver.md5_phpbb2'] = new \phpbb\passwords\driver\md5_phpbb2($request, $this->passwords_drivers['passwords.driver.salted_md5'], $this->driver_helper, $phpbb_root_path, $php_ext);
$this->passwords_drivers['passwords.driver.bcrypt_wcf2'] = new \phpbb\passwords\driver\bcrypt_wcf2($this->passwords_drivers['passwords.driver.bcrypt'], $this->driver_helper);
$this->helper = new \phpbb\passwords\helper;
@@ -326,4 +326,22 @@ class phpbb_passwords_manager_test extends \phpbb_test_case
$this->assertFalse($this->manager->hash(str_repeat('a', 1024 * 1024 * 16)));
$this->assertLessThanOrEqual(5, time() - $start_time);
}
+
+ public function data_test_string_compare()
+ {
+ return array(
+ array('foo', 'bar', false),
+ array(1, '1', false),
+ array('one', 'one', true),
+ array('foobar', 'foobaf', false),
+ );
+ }
+
+ /**
+ * @dataProvider data_test_string_compare
+ */
+ public function test_string_compare($a, $b, $expected)
+ {
+ $this->assertSame($expected, $this->driver_helper->string_compare($a, $b));
+ }
}
diff --git a/tests/path_helper/path_helper_test.php b/tests/path_helper/path_helper_test.php
index 3832307897..73f0e6bafc 100644
--- a/tests/path_helper/path_helper_test.php
+++ b/tests/path_helper/path_helper_test.php
@@ -411,6 +411,21 @@ class phpbb_path_helper_test extends phpbb_test_case
'http://www.phpbb.com/community',
'../community/',
),
+ array(
+ 'http://www.phpbb.com/foobar',
+ 'http://www.phpbb.com',
+ '',
+ ),
+ array(
+ 'http://www.foobar.com',
+ 'http://www.phpbb.com',
+ '/www.phpbb.com/',
+ ),
+ array(
+ 'foobar',
+ 'http://www.phpbb.com/community',
+ '',
+ )
);
}
@@ -421,4 +436,29 @@ class phpbb_path_helper_test extends phpbb_test_case
{
$this->assertEquals($this->phpbb_root_path . $expected, $this->path_helper->get_web_root_path_from_ajax_referer($referer_url, $board_url));
}
+
+ public function data_get_valid_page()
+ {
+ return array(
+ // array( current page , mod_rewrite setting , expected output )
+ array('index', true, 'index'),
+ array('index', false, 'index'),
+ array('foo/index', true, 'foo/index'),
+ array('foo/index', false, 'foo/index'),
+ array('app.php/foo', true, 'foo'),
+ array('app.php/foo', false, 'app.php/foo'),
+ array('/../app.php/foo', true, '../foo'),
+ array('/../app.php/foo', false, '../app.php/foo'),
+ array('/../example/app.php/foo/bar', true, '../example/foo/bar'),
+ array('/../example/app.php/foo/bar', false, '../example/app.php/foo/bar'),
+ );
+ }
+
+ /**
+ * @dataProvider data_get_valid_page
+ */
+ public function test_get_valid_page($page, $mod_rewrite, $expected)
+ {
+ $this->assertEquals($this->phpbb_root_path . $expected, $this->path_helper->get_valid_page($page, $mod_rewrite));
+ }
}
diff --git a/tests/profilefields/type_string_test.php b/tests/profilefields/type_string_test.php
index a7be087fb5..0417afbfab 100644
--- a/tests/profilefields/type_string_test.php
+++ b/tests/profilefields/type_string_test.php
@@ -133,37 +133,49 @@ class phpbb_profilefield_type_string_test extends phpbb_test_case
),
array(
'ö äö äö ä',
- array('field_validation' => '[\w]+'),
+ array('field_validation' => '[a-zA-Z0-9]+'),
'FIELD_INVALID_CHARS_ALPHA_ONLY-field',
'Required field should reject UTF-8 in alpha only field',
),
array(
+ 'a_abc',
+ array('field_validation' => '[a-zA-Z0-9]+'),
+ 'FIELD_INVALID_CHARS_ALPHA_ONLY-field',
+ 'Required field should reject underscore in alpha only field',
+ ),
+ array(
'Hello',
- array('field_validation' => '[\w]+'),
+ array('field_validation' => '[a-zA-Z0-9]+'),
false,
'Required field should accept a characters only field',
),
array(
'Valid.Username123',
- array('field_validation' => '[\w.]+'),
+ array('field_validation' => '[a-zA-Z0-9.]+'),
false,
'Required field should accept a alphanumeric field with dots',
),
array(
'Invalid.,username123',
- array('field_validation' => '[\w.]+'),
+ array('field_validation' => '[a-zA-Z0-9.]+'),
'FIELD_INVALID_CHARS_ALPHA_DOTS-field',
'Required field should reject field with comma',
),
array(
+ 'Invalid._username123',
+ array('field_validation' => '[a-zA-Z0-9.]+'),
+ 'FIELD_INVALID_CHARS_ALPHA_DOTS-field',
+ 'Required field should reject field with underscore',
+ ),
+ array(
'skype.test.name,_this',
- array('field_validation' => '[a-zA-Z][\w\.,\-_]+'),
+ array('field_validation' => '[a-zA-Z][\w\.,\-]+'),
false,
'Required field should accept alphanumeric field with punctuations',
),
array(
'1skype.this.should.faila',
- array('field_validation' => '[a-zA-Z][\w\.,\-_]+'),
+ array('field_validation' => '[a-zA-Z][\w\.,\-]+'),
'FIELD_INVALID_CHARS_ALPHA_PUNCTUATION-field',
'Required field should reject field having invalid input for the given validation',
),
diff --git a/tests/profilefields/type_url_test.php b/tests/profilefields/type_url_test.php
index 372c07418f..cc37f04f30 100644
--- a/tests/profilefields/type_url_test.php
+++ b/tests/profilefields/type_url_test.php
@@ -89,6 +89,32 @@ class phpbb_profilefield_type_url_test extends phpbb_test_case
'FIELD_INVALID_URL-field',
'Field should reject invalid URL having multi value parameters',
),
+
+ // IDN url type profilefields
+ array(
+ 'http://www.täst.de',
+ array(),
+ false,
+ 'Field should accept valid IDN',
+ ),
+ array(
+ 'http://täst.de/index.html?param1=test&param2=awesome',
+ array(),
+ false,
+ 'Field should accept valid IDN URL with params',
+ ),
+ array(
+ 'http://домен.рф/index.html/тест/path?document=get',
+ array(),
+ false,
+ 'Field should accept valid IDN URL',
+ ),
+ array(
+ 'http://домен.рф/index.html/тест/path?document[]=DocType%20test&document[]=AnotherDoc',
+ array(),
+ 'FIELD_INVALID_URL-field',
+ 'Field should reject invalid IDN URL having multi value parameters',
+ ),
);
}
@@ -119,6 +145,20 @@ class phpbb_profilefield_type_url_test extends phpbb_test_case
'http://example.com',
'Field should return correct raw value',
),
+
+ // IDN tests
+ array(
+ 'http://täst.de',
+ array('field_show_novalue' => true),
+ 'http://täst.de',
+ 'Field should return the correct raw value',
+ ),
+ array(
+ 'http://домен.рф',
+ array('field_show_novalue' => false),
+ 'http://домен.рф',
+ 'Field should return correct raw value',
+ ),
);
}
diff --git a/tests/regex/url_test.php b/tests/regex/url_test.php
index d3487a9c16..e5d7c3256a 100644
--- a/tests/regex/url_test.php
+++ b/tests/regex/url_test.php
@@ -32,6 +32,6 @@ class phpbb_regex_url_test extends phpbb_test_case
*/
public function test_url($url, $expected)
{
- $this->assertEquals($expected, preg_match('#^' . get_preg_expression('url') . '$#i', $url));
+ $this->assertEquals($expected, preg_match('#^' . get_preg_expression('url') . '$#iu', $url));
}
}
diff --git a/tests/search/fixtures/posts.xml b/tests/search/fixtures/posts.xml
index 7b249ee303..16232b8f39 100644
--- a/tests/search/fixtures/posts.xml
+++ b/tests/search/fixtures/posts.xml
@@ -19,6 +19,11 @@
<value>commonword</value>
<value>commonword</value>
</row>
+ <row>
+ <value>baaz</value>
+ <value>baaz</value>
+ <value>baaz</value>
+ </row>
</table>
<table name="phpbb_search_wordlist">
<column>word_id</column>
@@ -39,5 +44,10 @@
<value>commonword</value>
<value>1</value>
</row>
+ <row>
+ <value>4</value>
+ <value>baaz</value>
+ <value>0</value>
+ </row>
</table>
</dataset>
diff --git a/tests/search/native_test.php b/tests/search/native_test.php
index f681a62fce..61fde7d098 100644
--- a/tests/search/native_test.php
+++ b/tests/search/native_test.php
@@ -35,6 +35,8 @@ class phpbb_search_native_test extends phpbb_search_test_case
$this->db = $this->new_dbal();
$error = null;
$class = self::get_search_wrapper('\phpbb\search\fulltext_native');
+ $config['fulltext_native_min_chars'] = 2;
+ $config['fulltext_native_max_chars'] = 14;
$this->search = new $class($error, $phpbb_root_path, $phpEx, null, $config, $this->db, $user);
}
@@ -56,6 +58,54 @@ class phpbb_search_native_test extends phpbb_search_test_case
array(),
),
array(
+ 'baaz*',
+ 'all',
+ true,
+ array('\'baaz%\''),
+ array(),
+ array(),
+ ),
+ array(
+ 'ba*az',
+ 'all',
+ true,
+ array('\'ba%az\''),
+ array(),
+ array(),
+ ),
+ array(
+ 'ba*z',
+ 'all',
+ true,
+ array('\'ba%z\''),
+ array(),
+ array(),
+ ),
+ array(
+ 'baa* baaz*',
+ 'all',
+ true,
+ array('\'baa%\'', '\'baaz%\''),
+ array(),
+ array(),
+ ),
+ array(
+ 'ba*z baa*',
+ 'all',
+ true,
+ array('\'ba%z\'', '\'baa%\''),
+ array(),
+ array(),
+ ),
+ array(
+ 'baaz* commonword',
+ 'all',
+ true,
+ array('\'baaz%\''),
+ array(),
+ array('commonword'),
+ ),
+ array(
'foo bar',
'all',
true,
diff --git a/tests/security/base.php b/tests/security/base.php
index 5519cac441..330408b448 100644
--- a/tests/security/base.php
+++ b/tests/security/base.php
@@ -13,6 +13,8 @@
abstract class phpbb_security_test_base extends phpbb_test_case
{
+ protected $server = array();
+
/**
* Set up the required user object and server variables for the suites
*/
@@ -21,17 +23,18 @@ abstract class phpbb_security_test_base extends phpbb_test_case
global $user, $phpbb_root_path, $phpEx, $request, $symfony_request, $phpbb_filesystem;
// Put this into a global function being run by every test to init a proper user session
- $server['HTTP_HOST'] = 'localhost';
- $server['SERVER_NAME'] = 'localhost';
- $server['SERVER_ADDR'] = '127.0.0.1';
- $server['SERVER_PORT'] = 80;
- $server['REMOTE_ADDR'] = '127.0.0.1';
- $server['QUERY_STRING'] = '';
- $server['REQUEST_URI'] = '/tests/';
- $server['SCRIPT_NAME'] = '/tests/index.php';
- $server['PHP_SELF'] = '/tests/index.php';
- $server['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Windows; U; Windows NT 6.0; de; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14';
- $server['HTTP_ACCEPT_LANGUAGE'] = 'de-de,de;q=0.8,en-us;q=0.5,en;q=0.3';
+ $this->server['HTTP_HOST'] = 'localhost';
+ $this->server['SERVER_NAME'] = 'localhost';
+ $this->server['SERVER_ADDR'] = '127.0.0.1';
+ $this->server['SERVER_PORT'] = 80;
+ $this->server['REMOTE_ADDR'] = '127.0.0.1';
+ $this->server['QUERY_STRING'] = '';
+ $this->server['REQUEST_URI'] = '/tests/';
+ $this->server['SCRIPT_NAME'] = '/tests/index.php';
+ $this->server['SCRIPT_FILENAME'] = '/var/www/tests/index.php';
+ $this->server['PHP_SELF'] = '/tests/index.php';
+ $this->server['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Windows; U; Windows NT 6.0; de; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14';
+ $this->server['HTTP_ACCEPT_LANGUAGE'] = 'de-de,de;q=0.8,en-us;q=0.5,en;q=0.3';
/*
[HTTP_ACCEPT_ENCODING] => gzip,deflate
@@ -40,31 +43,18 @@ abstract class phpbb_security_test_base extends phpbb_test_case
[SCRIPT_FILENAME] => /var/www/tests/index.php
*/
- $request = new phpbb_mock_request(array(), array(), array(), $server);
- $symfony_request = $this->getMock("\phpbb\symfony_request", array(), array(
- $request,
- ));
- $symfony_request->expects($this->any())
- ->method('getScriptName')
- ->will($this->returnValue($server['SCRIPT_NAME']));
- $symfony_request->expects($this->any())
- ->method('getQueryString')
- ->will($this->returnValue($server['QUERY_STRING']));
- $symfony_request->expects($this->any())
- ->method('getBasePath')
- ->will($this->returnValue($server['REQUEST_URI']));
- $symfony_request->expects($this->any())
- ->method('getPathInfo')
- ->will($this->returnValue('/'));
- $phpbb_filesystem = new \phpbb\filesystem($symfony_request, $phpbb_root_path, $phpEx);
+ $request = new phpbb_mock_request(array(), array(), array(), $this->server);
+ $symfony_request = new \phpbb\symfony_request($request);
+
+ $phpbb_filesystem = new \phpbb\filesystem();
// Set no user and trick a bit to circumvent errors
$user = new \phpbb\user('\phpbb\datetime');
$user->lang = true;
- $user->browser = $server['HTTP_USER_AGENT'];
+ $user->browser = $this->server['HTTP_USER_AGENT'];
$user->referer = '';
$user->forwarded_for = '';
- $user->host = $server['HTTP_HOST'];
+ $user->host = $this->server['HTTP_HOST'];
$user->page = \phpbb\session::extract_current_page($phpbb_root_path);
}
diff --git a/tests/security/extract_current_page_test.php b/tests/security/extract_current_page_test.php
index 58dea68dc8..767b901a43 100644
--- a/tests/security/extract_current_page_test.php
+++ b/tests/security/extract_current_page_test.php
@@ -20,33 +20,25 @@ class phpbb_security_extract_current_page_test extends phpbb_security_test_base
public function security_variables()
{
return array(
- array('http://localhost/phpBB/index.php', 'mark=forums&x="><script>alert(/XSS/);</script>', 'mark=forums&x=%22%3E%3Cscript%3Ealert(/XSS/);%3C/script%3E'),
- array('http://localhost/phpBB/index.php', 'mark=forums&x=%22%3E%3Cscript%3Ealert(/XSS/);%3C/script%3E', 'mark=forums&x=%22%3E%3Cscript%3Ealert(/XSS/);%3C/script%3E'),
+ array('mark=forums&x="><script>alert(/XSS/);</script>', 'mark=forums&x=%22%3E%3Cscript%3Ealert%28%2FXSS%2F%29%3B%3C%2Fscript%3E'),
+ array('mark=forums&x=%22%3E%3Cscript%3Ealert(/XSS/);%3C/script%3E', 'mark=forums&x=%22%3E%3Cscript%3Ealert%28%2FXSS%2F%29%3B%3C%2Fscript%3E'),
+ array('mark=forums&x=%22%3E%3Cscript%3Ealert%28%2FXSS%2F%29%3B%3C%2Fscript%3E', 'mark=forums&x=%22%3E%3Cscript%3Ealert%28%2FXSS%2F%29%3B%3C%2Fscript%3E'),
);
}
/**
* @dataProvider security_variables
*/
- public function test_query_string_php_self($url, $query_string, $expected)
+ public function test_query_string_php_self($query_string, $expected)
{
global $symfony_request, $request;
- $symfony_request = $this->getMock("\phpbb\symfony_request", array(), array(
- $request,
- ));
- $symfony_request->expects($this->any())
- ->method('getScriptName')
- ->will($this->returnValue($url));
- $symfony_request->expects($this->any())
- ->method('getQueryString')
- ->will($this->returnValue($query_string));
- $symfony_request->expects($this->any())
- ->method('getBasePath')
- ->will($this->returnValue($server['REQUEST_URI']));
- $symfony_request->expects($this->any())
- ->method('getPathInfo')
- ->will($this->returnValue('/'));
+ $this->server['REQUEST_URI'] = '';
+ $this->server['QUERY_STRING'] = $query_string;
+
+ $request = new phpbb_mock_request(array(), array(), array(), $this->server);
+ $symfony_request = new \phpbb\symfony_request($request);
+
$result = \phpbb\session::extract_current_page('./');
$label = 'Running extract_current_page on ' . $query_string . ' with PHP_SELF filled.';
@@ -56,25 +48,14 @@ class phpbb_security_extract_current_page_test extends phpbb_security_test_base
/**
* @dataProvider security_variables
*/
- public function test_query_string_request_uri($url, $query_string, $expected)
+ public function test_query_string_request_uri($query_string, $expected)
{
global $symfony_request, $request;
- $symfony_request = $this->getMock("\phpbb\symfony_request", array(), array(
- $request,
- ));
- $symfony_request->expects($this->any())
- ->method('getScriptName')
- ->will($this->returnValue($url));
- $symfony_request->expects($this->any())
- ->method('getQueryString')
- ->will($this->returnValue($query_string));
- $symfony_request->expects($this->any())
- ->method('getBasePath')
- ->will($this->returnValue($server['REQUEST_URI']));
- $symfony_request->expects($this->any())
- ->method('getPathInfo')
- ->will($this->returnValue('/'));
+ $this->server['QUERY_STRING'] = $query_string;
+
+ $request = new phpbb_mock_request(array(), array(), array(), $this->server);
+ $symfony_request = new \phpbb\symfony_request($request);
$result = \phpbb\session::extract_current_page('./');
diff --git a/tests/security/redirect_test.php b/tests/security/redirect_test.php
index 3961c2781e..21fb103ed1 100644
--- a/tests/security/redirect_test.php
+++ b/tests/security/redirect_test.php
@@ -73,6 +73,8 @@ class phpbb_security_redirect_test extends phpbb_security_test_base
protected function setUp()
{
+ global $phpbb_dispatcher;
+
parent::setUp();
$GLOBALS['config'] = array(
@@ -80,6 +82,8 @@ class phpbb_security_redirect_test extends phpbb_security_test_base
);
$this->path_helper = $this->get_path_helper();
+
+ $phpbb_dispatcher = new phpbb_mock_event_dispatcher();
}
/**
diff --git a/tests/session/extract_page_test.php b/tests/session/extract_page_test.php
index f314d35f87..f0d1cdb60e 100644
--- a/tests/session/extract_page_test.php
+++ b/tests/session/extract_page_test.php
@@ -12,6 +12,7 @@
*/
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
{
@@ -99,7 +100,7 @@ class phpbb_session_extract_page_test extends phpbb_session_test_case
// ^-- Ignored because .. returns different directory in live vs testing
'query_string' => '',
'script_path' => '/phpBB/adm/',
- //'root_script_path' => '/phpBB/',
+ //'root_script_path' => '/phpBB/adm/',
//'page' => 'adm/index.php',
'forum' => 0,
),
@@ -108,15 +109,15 @@ class phpbb_session_extract_page_test extends phpbb_session_test_case
'./',
'/phpBB/adm/app.php',
'page=1&test=2',
- '/phpBB/',
+ '/phpBB/adm/',
'/foo/bar',
array(
'page_name' => 'app.php/foo/bar',
- 'page_dir' => '',
+ //'page_dir' => '',
'query_string' => 'page=1&test=2',
- 'script_path' => '/phpBB/',
- 'root_script_path' => '/phpBB/',
- 'page' => 'app.php/foo/bar?page=1&test=2',
+ 'script_path' => '/phpBB/adm/',
+ //'root_script_path' => '/phpBB/adm/',
+ //'page' => 'app.php/foo/bar?page=1&test=2',
'forum' => 0,
),
),
@@ -142,23 +143,25 @@ class phpbb_session_extract_page_test extends phpbb_session_test_case
/** @dataProvider extract_current_page_data */
function test_extract_current_page($root_path, $getScriptName, $getQueryString, $getBasePath, $getPathInfo, $expected)
{
- global $symfony_request;
+ global $symfony_request, $request, $phpbb_filesystem;
+
+ $phpbb_filesystem = new \phpbb\filesystem();
+
+ $server['HTTP_HOST'] = 'localhost';
+ $server['SERVER_NAME'] = 'localhost';
+ $server['SERVER_ADDR'] = '127.0.0.1';
+ $server['SERVER_PORT'] = 80;
+ $server['REMOTE_ADDR'] = '127.0.0.1';
+ $server['QUERY_STRING'] = $getQueryString;
+ $server['REQUEST_URI'] = $getScriptName . $getPathInfo . ($getQueryString === '' ? '' : '?' . $getQueryString);
+ $server['SCRIPT_NAME'] = $getScriptName;
+ $server['SCRIPT_FILENAME'] = '/var/www/' . $getScriptName;
+ $server['PHP_SELF'] = $getScriptName;
+ $server['HTTP_USER_AGENT'] = 'Mozilla/5.0 (Windows; U; Windows NT 6.0; de; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14';
+ $server['HTTP_ACCEPT_LANGUAGE'] = 'de-de,de;q=0.8,en-us;q=0.5,en;q=0.3';
- $symfony_request = $this->getMock("\phpbb\symfony_request", array(), array(
- new phpbb_mock_request(),
- ));
- $symfony_request->expects($this->any())
- ->method('getScriptName')
- ->will($this->returnValue($getScriptName));
- $symfony_request->expects($this->any())
- ->method('getQueryString')
- ->will($this->returnValue($getQueryString));
- $symfony_request->expects($this->any())
- ->method('getBasePath')
- ->will($this->returnValue($getBasePath));
- $symfony_request->expects($this->any())
- ->method('getPathInfo')
- ->will($this->returnValue($getPathInfo));
+ $request = new phpbb_mock_request(array(), array(), array(), $server);
+ $symfony_request = new \phpbb\symfony_request($request);
$output = \phpbb\session::extract_current_page($root_path);
diff --git a/tests/session/session_key_test.php b/tests/session/session_key_test.php
index 31a470615c..bf3dfcaa3c 100644
--- a/tests/session/session_key_test.php
+++ b/tests/session/session_key_test.php
@@ -11,6 +11,7 @@
*
*/
+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
@@ -28,13 +29,14 @@ class phpbb_session_login_keys_test extends phpbb_session_test_case
// With AutoLogin setup
$this->session_factory->merge_config_data(array('allow_autologin' => true));
$session = $this->session_factory->get_session($this->db);
+
// Using a user_id and key that is already in the database
$session->cookie_data['u'] = $this->user_id;
$session->cookie_data['k'] = $this->key_id;
- // Try to access session
- $session->session_create($this->user_id, false, $this->user_id);
- $this->assertEquals($this->user_id, $session->data['user_id'], "session should automatically login");
+ // Try to access session with the session key
+ $session->session_create(false, false, false);
+ $this->assertEquals($this->user_id, $session->data['user_id'], 'User should be logged in by the session key');
}
public function test_reset_keys()
@@ -42,14 +44,19 @@ class phpbb_session_login_keys_test extends phpbb_session_test_case
// With AutoLogin setup
$this->session_factory->merge_config_data(array('allow_autologin' => true));
$session = $this->session_factory->get_session($this->db);
+
// Reset of the keys for this user
$session->reset_login_keys($this->user_id);
+
// Using a user_id and key that was in the database (before reset)
$session->cookie_data['u'] = $this->user_id;
$session->cookie_data['k'] = $this->key_id;
- // Try to access session
- $session->session_create($this->user_id, false, $this->user_id);
- $this->assertNotEquals($this->user_id, $session->data['user_id'], "session should be cleared");
+ // Try to access session with the session key
+ $session->session_create(false, false, $this->user_id);
+ $this->assertNotEquals($this->user_id, $session->data['user_id'], 'User is not logged in because the session key is invalid');
+
+ $session->session_create($this->user_id, false, false);
+ $this->assertEquals($this->user_id, $session->data['user_id'], 'User should be logged in because we create a new session');
}
}
diff --git a/tests/template/ext/include/css/styles/all/theme/child_only.css b/tests/template/ext/include/css/styles/all/theme/child_only.css
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/template/ext/include/css/styles/all/theme/child_only.css
diff --git a/tests/template/ext/include/css/styles/all/theme/test.css b/tests/template/ext/include/css/styles/all/theme/test.css
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/tests/template/ext/include/css/styles/all/theme/test.css
diff --git a/tests/template/template_includecss_test.php b/tests/template/template_includecss_test.php
index ab91dd7a49..49bd9dec8b 100644
--- a/tests/template/template_includecss_test.php
+++ b/tests/template/template_includecss_test.php
@@ -15,18 +15,90 @@ require_once dirname(__FILE__) . '/template_test_case_with_tree.php';
class phpbb_template_template_includecss_test extends phpbb_template_template_test_case_with_tree
{
- public function test_includecss_compilation()
+ protected function setup_engine(array $new_config = array())
+ {
+ global $phpbb_root_path, $phpEx, $user;
+
+ $defaults = $this->config_defaults();
+ $config = new \phpbb\config\config(array_merge($defaults, $new_config));
+
+ $this->phpbb_path_helper = new \phpbb\path_helper(
+ new \phpbb\symfony_request(
+ new phpbb_mock_request()
+ ),
+ new \phpbb\filesystem(),
+ $this->getMock('\phpbb\request\request'),
+ $phpbb_root_path,
+ $phpEx
+ );
+
+ $this->template_path = $this->test_path . '/templates';
+ $this->parent_template_path = $this->test_path . '/parent_templates';
+ $this->template = new phpbb\template\twig\twig(
+ $this->phpbb_path_helper,
+ $config,
+ $user,
+ new phpbb\template\context(),
+ new phpbb_mock_extension_manager(
+ dirname(__FILE__) . '/',
+ array(
+ 'include/css' => array(
+ 'ext_name' => 'include/css',
+ 'ext_active' => '1',
+ 'ext_path' => 'ext/include/css/',
+ ),
+ )
+ )
+ );
+ $this->template->set_custom_style('tests', array($this->template_path, $this->parent_template_path));
+ }
+
+ public function template_data()
+ {
+ $url_base = explode('/', dirname(__FILE__));
+ foreach ($url_base as &$dir)
+ {
+ $dir = rawurlencode($dir);
+ }
+ $url_base = implode('/', $url_base);
+
+ return array(
+ /*
+ array(
+ // vars
+ // expected
+ ),
+ */
+ array(
+ array('TEST' => 1),
+ '<link href="tests/template/templates/child_only.css?assets_version=1" rel="stylesheet" type="text/css" media="screen, projection" />',
+ ),
+ array(
+ array('TEST' => 2),
+ '<link href="tests/template/parent_templates/parent_only.css?assets_version=1" rel="stylesheet" type="text/css" media="screen, projection" />',
+ ),
+ array(
+ array('TEST' => 3),
+ '<link href="' . $url_base . '/ext/include/css/styles/all/theme/test.css?assets_version=1" rel="stylesheet" type="text/css" media="screen, projection" />',
+ ),
+ array(
+ array('TEST' => 4),
+ '<link href="' . $url_base . '/ext/include/css/styles/all/theme/child_only.css?assets_version=1" rel="stylesheet" type="text/css" media="screen, projection" />',
+ ),
+ );
+ }
+
+ /**
+ * @dataProvider template_data
+ */
+ public function test_includecss_compilation($vars, $expected)
{
// Reset the engine state
$this->setup_engine(array('assets_version' => 1));
- // Prepare correct result
- $scripts = array(
- '<link href="tests/template/templates/child_only.css?assets_version=1" rel="stylesheet" type="text/css" media="screen, projection" />',
- '<link href="tests/template/parent_templates/parent_only.css?assets_version=1" rel="stylesheet" type="text/css" media="screen, projection" />',
- );
+ $this->template->assign_vars($vars);
// Run test
- $this->run_template('includecss.html', array(), array(), array(), implode('', $scripts));
+ $this->run_template('includecss.html', array(), array(), array(), $expected);
}
}
diff --git a/tests/template/templates/includecss.html b/tests/template/templates/includecss.html
index a09e44f240..23e3c426d7 100644
--- a/tests/template/templates/includecss.html
+++ b/tests/template/templates/includecss.html
@@ -1,3 +1,10 @@
-<!-- INCLUDECSS child_only.css -->
-<!-- INCLUDECSS parent_only.css -->
+<!-- IF TEST === 1 -->
+ <!-- INCLUDECSS child_only.css -->
+<!-- ELSEIF TEST === 2 -->
+ <!-- INCLUDECSS parent_only.css -->
+<!-- ELSEIF TEST === 3 -->
+ <!-- INCLUDECSS @include_css/test.css -->
+<!-- ELSEIF TEST === 4 -->
+ <!-- INCLUDECSS @include_css/child_only.css -->
+<!-- ENDIF -->
{$STYLESHEETS}
diff --git a/tests/test_framework/phpbb_database_test_case.php b/tests/test_framework/phpbb_database_test_case.php
index 9dbb7150f1..fc1a3632f4 100644
--- a/tests/test_framework/phpbb_database_test_case.php
+++ b/tests/test_framework/phpbb_database_test_case.php
@@ -54,46 +54,43 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
static public function setUpBeforeClass()
{
+ global $phpbb_root_path, $phpEx;
+
$setup_extensions = static::setup_extensions();
- self::$schema_file = '';
+
+ $finder = new \phpbb\finder(new \phpbb\filesystem(), $phpbb_root_path, null, $phpEx);
+ $finder->core_path('phpbb/db/migration/data/');
if (!empty($setup_extensions))
{
- $schema_md5 = md5(serialize($setup_extensions));
-
- self::$schema_file = __DIR__ . '/../tmp/' . $schema_md5 . '.json';
- self::$phpbb_schema_copy = __DIR__ . '/../tmp/schema_phpbb_copy.json';
- self::$install_schema_file = __DIR__ . '/../../phpBB/install/schemas/schema.json';
-
- if (!file_exists(self::$schema_file))
- {
- global $phpbb_root_path, $phpEx, $table_prefix;
+ $finder->set_extensions($setup_extensions)
+ ->extension_directory('/migrations');
+ }
+ $classes = $finder->get_classes();
- $finder = new \phpbb\finder(new \phpbb\filesystem(), $phpbb_root_path, null, $phpEx);
- $classes = $finder->core_path('phpbb/db/migration/data/')
- ->set_extensions($setup_extensions)
- ->extension_directory('/migrations')
- ->get_classes();
+ $schema_sha1 = sha1(serialize($classes));
+ self::$schema_file = __DIR__ . '/../tmp/' . $schema_sha1 . '.json';
+ self::$install_schema_file = __DIR__ . '/../../phpBB/install/schemas/schema.json';
- $db = new \phpbb\db\driver\sqlite();
- $schema_generator = new \phpbb\db\migration\schema_generator($classes, new \phpbb\config\config(array()), $db, new \phpbb\db\tools($db, true), $phpbb_root_path, $phpEx, $table_prefix);
- $schema_data = $schema_generator->get_schema();
+ if (!file_exists(self::$schema_file))
+ {
- file_put_contents(self::$schema_file, json_encode($schema_data));
- }
+ global $table_prefix;
- copy(self::$install_schema_file, self::$phpbb_schema_copy);
- copy(self::$schema_file, self::$install_schema_file);
+ $db = new \phpbb\db\driver\sqlite();
+ $schema_generator = new \phpbb\db\migration\schema_generator($classes, new \phpbb\config\config(array()), $db, new \phpbb\db\tools($db, true), $phpbb_root_path, $phpEx, $table_prefix);
+ file_put_contents(self::$schema_file, json_encode($schema_generator->get_schema()));
}
+ copy(self::$schema_file, self::$install_schema_file);
+
parent::setUpBeforeClass();
}
static public function tearDownAfterClass()
{
- if (self::$schema_file !== '')
+ if (file_exists(self::$install_schema_file))
{
- copy(self::$phpbb_schema_copy, self::$install_schema_file);
- unlink(self::$schema_file);
+ unlink(self::$install_schema_file);
}
parent::tearDownAfterClass();
diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php
index 92e2080dba..5d643e43e2 100644
--- a/tests/test_framework/phpbb_database_test_connection_manager.php
+++ b/tests/test_framework/phpbb_database_test_connection_manager.php
@@ -356,8 +356,23 @@ class phpbb_database_test_connection_manager
}
// Ok we have the db info go ahead and work on building the table
- $db_table_schema = file_get_contents($directory . 'schema.json');
- $db_table_schema = json_decode($db_table_schema, true);
+ if (file_exists($directory . 'schema.json'))
+ {
+ $db_table_schema = file_get_contents($directory . 'schema.json');
+ $db_table_schema = json_decode($db_table_schema, true);
+ }
+ else
+ {
+ global $phpbb_root_path, $phpEx, $table_prefix;
+
+ $finder = new \phpbb\finder(new \phpbb\filesystem(), $phpbb_root_path, null, $phpEx);
+ $classes = $finder->core_path('phpbb/db/migration/data/')
+ ->get_classes();
+
+ $db = new \phpbb\db\driver\sqlite();
+ $schema_generator = new \phpbb\db\migration\schema_generator($classes, new \phpbb\config\config(array()), $db, new \phpbb\db\tools($db, true), $phpbb_root_path, $phpEx, $table_prefix);
+ $db_table_schema = $schema_generator->get_schema();
+ }
$db_tools = new \phpbb\db\tools($db, true);
foreach ($db_table_schema as $table_name => $table_data)
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index 49cc72363e..844caa8f54 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -38,6 +38,7 @@ class phpbb_functional_test_case extends phpbb_test_case
static protected $config = array();
static protected $already_installed = false;
+ static protected $last_post_timestamp = 0;
static public function setUpBeforeClass()
{
@@ -226,7 +227,9 @@ class phpbb_functional_test_case extends phpbb_test_case
$db = $this->get_db();
$db_tools = new \phpbb\db\tools($db);
+ $container = new phpbb_mock_container_builder();
$migrator = new \phpbb\db\migrator(
+ $container,
$config,
$db,
$db_tools,
@@ -237,8 +240,8 @@ class phpbb_functional_test_case extends phpbb_test_case
array(),
new \phpbb\db\migration\helper()
);
- $container = new phpbb_mock_container_builder();
$container->set('migrator', $migrator);
+ $container->set('dispatcher', new phpbb_mock_event_dispatcher());
$user = new \phpbb\user('\phpbb\datetime');
$extension_manager = new \phpbb\extension\manager(
@@ -407,6 +410,18 @@ class phpbb_functional_test_case extends phpbb_test_case
$form = $crawler->selectButton('Enable')->form();
$crawler = self::submit($form);
$this->add_lang('acp/extensions');
+
+ $meta_refresh = $crawler->filter('meta[http-equiv="refresh"]');
+
+ // Wait for extension to be fully enabled
+ while (sizeof($meta_refresh))
+ {
+ preg_match('#url=.+/(adm+.+)#', $meta_refresh->attr('content'), $match);
+ $url = $match[1];
+ $crawler = self::request('POST', $url);
+ $meta_refresh = $crawler->filter('meta[http-equiv="refresh"]');
+ }
+
$this->assertContainsLang('EXTENSION_ENABLE_SUCCESS', $crawler->filter('div.successbox')->text());
$this->logout();
@@ -556,12 +571,10 @@ class phpbb_functional_test_case extends phpbb_test_case
$cache = new phpbb_mock_null_cache;
$cache_driver = new \phpbb\cache\driver\null();
- $phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
- $phpbb_container
- ->expects($this->any())
- ->method('get')
- ->with('cache.driver')
- ->will($this->returnValue($cache_driver));
+ $phpbb_container = new phpbb_mock_container_builder();
+ $phpbb_container->set('cache.driver', $cache_driver);
+ $phpbb_notifications = new phpbb_mock_notification_manager();
+ $phpbb_container->set('notification_manager', $phpbb_notifications);
if (!function_exists('utf_clean_string'))
{
@@ -884,7 +897,7 @@ class phpbb_functional_test_case extends phpbb_test_case
*/
static public function assert_response_status_code($status_code = 200)
{
- self::assertEquals($status_code, self::$client->getResponse()->getStatus());
+ self::assertEquals($status_code, self::$client->getResponse()->getStatus(), 'HTTP status code does not match');
}
public function assert_filter($crawler, $expr, $msg = null)
@@ -1100,6 +1113,12 @@ class phpbb_functional_test_case extends phpbb_test_case
*/
protected function submit_message($posting_url, $posting_contains, $form_data)
{
+ if (time() == self::$last_post_timestamp)
+ {
+ // Travis is too fast, so we have to wait to not mix up the post/topic order
+ sleep(1);
+ }
+ self::$last_post_timestamp = time();
$crawler = self::request('GET', $posting_url);
$this->assertContains($this->lang($posting_contains), $crawler->filter('html')->text());
diff --git a/tests/test_framework/phpbb_session_test_case.php b/tests/test_framework/phpbb_session_test_case.php
index d4fc174a12..1bf0277fe0 100644
--- a/tests/test_framework/phpbb_session_test_case.php
+++ b/tests/test_framework/phpbb_session_test_case.php
@@ -11,13 +11,19 @@
*
*/
+require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
require_once dirname(__FILE__) . '/../session/testable_factory.php';
require_once dirname(__FILE__) . '/../session/testable_facade.php';
abstract class phpbb_session_test_case extends phpbb_database_test_case
{
+ /** @var phpbb_session_testable_factory */
protected $session_factory;
+
+ /** @var phpbb_session_testable_facade */
protected $session_facade;
+
+ /** @var \phpbb\db\driver\driver_interface */
protected $db;
function setUp()
diff --git a/tests/test_framework/phpbb_test_case.php b/tests/test_framework/phpbb_test_case.php
index c39f7835d1..01d26fb67d 100644
--- a/tests/test_framework/phpbb_test_case.php
+++ b/tests/test_framework/phpbb_test_case.php
@@ -26,7 +26,7 @@ class phpbb_test_case extends PHPUnit_Framework_TestCase
'PHP_Token_Stream' => array('customTokens'),
'PHP_Token_Stream_CachingFactory' => array('cache'),
- 'phpbb_database_test_case' => array('already_connected'),
+ 'phpbb_database_test_case' => array('already_connected', 'last_post_timestamp'),
);
}
diff --git a/tests/test_framework/phpbb_ui_test_case.php b/tests/test_framework/phpbb_ui_test_case.php
new file mode 100644
index 0000000000..c8ac492e25
--- /dev/null
+++ b/tests/test_framework/phpbb_ui_test_case.php
@@ -0,0 +1,204 @@
+<?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__ . '/../../phpBB/includes/functions_install.php';
+
+class phpbb_ui_test_case extends phpbb_test_case
+{
+ static protected $host = '127.0.0.1';
+ static protected $port = 8910;
+
+ /**
+ * @var \RemoteWebDriver
+ */
+ static protected $webDriver;
+
+ static protected $config;
+ static protected $root_url;
+ static protected $already_installed = false;
+
+ static public function setUpBeforeClass()
+ {
+ parent::setUpBeforeClass();
+
+ if (version_compare(PHP_VERSION, '5.3.19', '<'))
+ {
+ self::markTestSkipped('UI test case requires at least PHP 5.3.19.');
+ }
+ else if (!class_exists('\RemoteWebDriver'))
+ {
+ self::markTestSkipped(
+ 'Could not find RemoteWebDriver class. ' .
+ 'Run "php ../composer.phar install" from the tests folder.'
+ );
+ }
+
+ self::$config = phpbb_test_case_helpers::get_test_config();
+ self::$root_url = self::$config['phpbb_functional_url'];
+
+ // Important: this is used both for installation and by
+ // test cases for querying the tables.
+ // Therefore table prefix must be set before a board is
+ // installed, and also before each test case is run.
+ self::$config['table_prefix'] = 'phpbb_';
+
+ if (!isset(self::$config['phpbb_functional_url']))
+ {
+ self::markTestSkipped('phpbb_functional_url was not set in test_config and wasn\'t set as PHPBB_FUNCTIONAL_URL environment variable either.');
+ }
+
+ if (!self::$webDriver)
+ {
+ try {
+ $capabilities = array(\WebDriverCapabilityType::BROWSER_NAME => 'firefox');
+ self::$webDriver = RemoteWebDriver::create(self::$host . ':' . self::$port, $capabilities);
+ } catch (WebDriverCurlException $e) {
+ self::markTestSkipped('PhantomJS webserver is not running.');
+ }
+ }
+
+ if (!self::$already_installed)
+ {
+ self::install_board();
+ self::$already_installed = true;
+ }
+ }
+
+ static public function visit($path)
+ {
+ self::$webDriver->get(self::$root_url . $path);
+ }
+
+ static protected function recreate_database($config)
+ {
+ $db_conn_mgr = new phpbb_database_test_connection_manager($config);
+ $db_conn_mgr->recreate_db();
+ }
+
+ static public function find_element($type, $value)
+ {
+ return self::$webDriver->findElement(WebDriverBy::$type($value));
+ }
+
+ static public function submit($type = 'id', $value = 'submit')
+ {
+ $element = self::find_element($type, $value);
+ $element->click();
+ }
+
+ static public function install_board()
+ {
+ global $phpbb_root_path, $phpEx;
+
+ self::recreate_database(self::$config);
+
+ $config_file = $phpbb_root_path . "config.$phpEx";
+ $config_file_dev = $phpbb_root_path . "config_dev.$phpEx";
+ $config_file_test = $phpbb_root_path . "config_test.$phpEx";
+
+ if (file_exists($config_file))
+ {
+ if (!file_exists($config_file_dev))
+ {
+ rename($config_file, $config_file_dev);
+ }
+ else
+ {
+ unlink($config_file);
+ }
+ }
+
+ $parseURL = parse_url(self::$config['phpbb_functional_url']);
+
+ self::visit('install/index.php?mode=install&language=en');
+ self::assertContains('Welcome to Installation', self::find_element('id', 'main')->getText());
+
+ // install/index.php?mode=install&sub=requirements
+ self::submit();
+ self::assertContains('Installation compatibility', self::find_element('id', 'main')->getText());
+
+ // install/index.php?mode=install&sub=database
+ self::submit();
+ self::assertContains('Database configuration', self::find_element('id', 'main')->getText());
+
+ self::find_element('id','dbms')->sendKeys(str_replace('phpbb\db\driver\\', '', self::$config['dbms']));
+ self::find_element('id','dbhost')->sendKeys(self::$config['dbhost']);
+ self::find_element('id','dbport')->sendKeys(self::$config['dbport']);
+ self::find_element('id','dbname')->sendKeys(self::$config['dbname']);
+ self::find_element('id','dbuser')->sendKeys(self::$config['dbuser']);
+ self::find_element('id','dbpasswd')->sendKeys(self::$config['dbpasswd']);
+
+ // Need to clear default phpbb_ prefix
+ self::find_element('id','table_prefix')->clear();
+ self::find_element('id','table_prefix')->sendKeys(self::$config['table_prefix']);
+
+ // install/index.php?mode=install&sub=database
+ self::submit();
+ self::assertContains('Successful connection', self::find_element('id','main')->getText());
+
+ // install/index.php?mode=install&sub=administrator
+ self::submit();
+ self::assertContains('Administrator configuration', self::find_element('id','main')->getText());
+
+ self::find_element('id','admin_name')->sendKeys('admin');
+ self::find_element('id','admin_pass1')->sendKeys('adminadmin');
+ self::find_element('id','admin_pass2')->sendKeys('adminadmin');
+ self::find_element('id','board_email')->sendKeys('nobody@example.com');
+
+ // install/index.php?mode=install&sub=administrator
+ self::submit();
+ self::assertContains('Tests passed', self::find_element('id','main')->getText());
+
+ // install/index.php?mode=install&sub=config_file
+ self::submit();
+
+ // Installer has created a config.php file, we will overwrite it with a
+ // config file of our own in order to get the DEBUG constants defined
+ $config_php_data = phpbb_create_config_file_data(self::$config, self::$config['dbms'], true, false, true);
+ $config_created = file_put_contents($config_file, $config_php_data) !== false;
+ if (!$config_created)
+ {
+ self::markTestSkipped("Could not write $config_file file.");
+ }
+
+ if (strpos(self::find_element('id','main')->getText(), 'The configuration file has been written') === false)
+ {
+ self::submit('id', 'dldone');
+ }
+ self::assertContains('The configuration file has been written', self::find_element('id','main')->getText());
+
+ // install/index.php?mode=install&sub=advanced
+ self::submit();
+ self::assertContains('The settings on this page are only necessary to set if you know that you require something different from the default.', self::find_element('id','main')->getText());
+
+ self::find_element('id','smtp_delivery')->sendKeys('1');
+ self::find_element('id','smtp_host')->sendKeys('nxdomain.phpbb.com');
+ self::find_element('id','smtp_user')->sendKeys('nxuser');
+ self::find_element('id','smtp_pass')->sendKeys('nxpass');
+ self::find_element('id','server_protocol')->sendKeys($parseURL['scheme'] . '://');
+ self::find_element('id','server_name')->sendKeys('localhost');
+ self::find_element('id','server_port')->sendKeys(isset($parseURL['port']) ? $parseURL['port'] : 80);
+ self::find_element('id','script_path')->sendKeys($parseURL['path']);
+
+ // install/index.php?mode=install&sub=create_table
+ self::submit();
+ self::assertContains('The database tables used by phpBB', self::find_element('id','main')->getText());
+ self::assertContains('have been created and populated with some initial data.', self::find_element('id','main')->getText());
+
+ // install/index.php?mode=install&sub=final
+ self::submit();
+ self::assertContains('You have successfully installed', self::find_element('id', 'main')->getText());
+
+ copy($config_file, $config_file_test);
+ }
+}
diff --git a/tests/tree/nestedset_forum_base.php b/tests/tree/nestedset_forum_base.php
index 449b2e5ca8..c56be1f81e 100644
--- a/tests/tree/nestedset_forum_base.php
+++ b/tests/tree/nestedset_forum_base.php
@@ -11,6 +11,8 @@
*
*/
+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/ui/quick_links_test.php b/tests/ui/quick_links_test.php
new file mode 100644
index 0000000000..5bddb44a8b
--- /dev/null
+++ b/tests/ui/quick_links_test.php
@@ -0,0 +1,27 @@
+<?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 ui
+*/
+class quick_links_test extends phpbb_ui_test_case
+{
+
+ public function test_quick_links()
+ {
+ $this->visit('index.php');
+ $this->assertEmpty(self::find_element('className', 'dropdown')->getText());
+ self::find_element('className', 'dropdown-toggle')->click();
+ $this->assertNotNull(self::find_element('className', 'dropdown')->getText());
+ }
+}
diff --git a/tests/upload/filespec_test.php b/tests/upload/filespec_test.php
index d8fa82e2b5..05547dcd00 100644
--- a/tests/upload/filespec_test.php
+++ b/tests/upload/filespec_test.php
@@ -266,6 +266,11 @@ class phpbb_filespec_test extends phpbb_test_case
*/
public function test_is_image_get_mimetype($filename, $mimetype, $expected)
{
+ if (!class_exists('finfo') && strtolower(substr(PHP_OS, 0, 3)) === 'win')
+ {
+ $this->markTestSkipped('Unable to test mimetype guessing without fileinfo support on Windows');
+ }
+
$filespec = $this->get_filespec(array('tmp_name' => $this->path . $filename, 'type' => $mimetype));
$filespec->get_mimetype($this->path . $filename);
$this->assertEquals($expected, $filespec->is_image());
diff --git a/tests/version/version_fetch_test.php b/tests/version/version_fetch_test.php
index 05eac58a52..cfc87183cf 100644
--- a/tests/version/version_fetch_test.php
+++ b/tests/version/version_fetch_test.php
@@ -33,6 +33,7 @@ class phpbb_version_helper_fetch_test extends phpbb_test_case
new \phpbb\config\config(array(
'version' => '3.1.0',
)),
+ new \phpbb\file_downloader(),
new \phpbb\user('\phpbb\datetime')
);
}
diff --git a/tests/version/version_helper_remote_test.php b/tests/version/version_helper_remote_test.php
new file mode 100644
index 0000000000..65ae7646b9
--- /dev/null
+++ b/tests/version/version_helper_remote_test.php
@@ -0,0 +1,173 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+class version_helper_remote_test extends \phpbb_test_case
+{
+ protected $file_downloader;
+ protected $cache;
+ protected $version_helper;
+
+ public function setUp()
+ {
+ parent::setUp();
+
+ global $phpbb_root_path, $phpEx;
+
+ include_once($phpbb_root_path . 'includes/functions.' . $phpEx);
+
+ $config = new \phpbb\config\config(array(
+ 'version' => '3.1.0',
+ ));
+ $container = new \phpbb_mock_container_builder();
+ $db = new \phpbb\db\driver\factory($container);
+ $this->cache = $this->getMock('\phpbb\cache\service', array('get'), array(new \phpbb\cache\driver\null(), $config, $db, '../../', 'php'));
+ $this->cache->expects($this->any())
+ ->method('get')
+ ->with($this->anything())
+ ->will($this->returnValue(false));
+ $this->file_downloader = new phpbb_mock_file_downloader();
+
+ $this->version_helper = new \phpbb\version_helper(
+ $this->cache,
+ $config,
+ $this->file_downloader,
+ new \phpbb\user('\phpbb\datetime')
+ );
+ $this->user = new \phpbb\user('\phpbb\datetime');
+ $this->user->add_lang('acp/common');
+ }
+
+ public function provider_get_versions()
+ {
+ return array(
+ array('', false),
+ array('foobar', false),
+ array('{
+ "stable": {
+ "1.0": {
+ "current": "1.0.1",
+ "download": "https://www.phpbb.com/customise/db/download/104136",
+ "announcement": "https://www.phpbb.com/customise/db/extension/boardrules/",
+ "eol": null,
+ "security": false
+ }
+ }
+}', true, array (
+ 'stable' => array (
+ '1.0' => array (
+ 'current' => '1.0.1',
+ 'download' => 'https://www.phpbb.com/customise/db/download/104136',
+ 'announcement' => 'https://www.phpbb.com/customise/db/extension/boardrules/',
+ 'eol' => NULL,
+ 'security' => false,
+ ),
+ ),
+ 'unstable' => array (
+ '1.0' => array (
+ 'current' => '1.0.1',
+ 'download' => 'https://www.phpbb.com/customise/db/download/104136',
+ 'announcement' => 'https://www.phpbb.com/customise/db/extension/boardrules/',
+ 'eol' => NULL,
+ 'security' => false,
+ ),
+ ),
+ )),
+ array('{
+ "foobar": {
+ "1.0": {
+ "current": "1.0.1",
+ "download": "https://www.phpbb.com/customise/db/download/104136",
+ "announcement": "https://www.phpbb.com/customise/db/extension/boardrules/",
+ "eol": null,
+ "security": false
+ }
+ }
+}', false),
+ array('{
+ "stable": {
+ "1.0": {
+ "current": "1.0.1<script>alert(\'foo\');</script>",
+ "download": "https://www.phpbb.com/customise/db/download/104136<script>alert(\'foo\');</script>",
+ "announcement": "https://www.phpbb.com/customise/db/extension/boardrules/<script>alert(\'foo\');</script>",
+ "eol": "<script>alert(\'foo\');</script>",
+ "security": "<script>alert(\'foo\');</script>"
+ }
+ }
+}', true, array (
+ 'stable' => array (
+ '1.0' => array (
+ 'current' => '1.0.1&lt;script&gt;alert(\'foo\');&lt;/script&gt;',
+ 'download' => 'https://www.phpbb.com/customise/db/download/104136&lt;script&gt;alert(\'foo\');&lt;/script&gt;',
+ 'announcement' => 'https://www.phpbb.com/customise/db/extension/boardrules/&lt;script&gt;alert(\'foo\');&lt;/script&gt;',
+ 'eol' => '&lt;script&gt;alert(\'foo\');&lt;/script&gt;',
+ 'security' => '&lt;script&gt;alert(\'foo\');&lt;/script&gt;',
+ ),
+ ),
+ 'unstable' => array (
+ '1.0' => array (
+ 'current' => '1.0.1&lt;script&gt;alert(\'foo\');&lt;/script&gt;',
+ 'download' => 'https://www.phpbb.com/customise/db/download/104136&lt;script&gt;alert(\'foo\');&lt;/script&gt;',
+ 'announcement' => 'https://www.phpbb.com/customise/db/extension/boardrules/&lt;script&gt;alert(\'foo\');&lt;/script&gt;',
+ 'eol' => '&lt;script&gt;alert(\'foo\');&lt;/script&gt;',
+ 'security' => '&lt;script&gt;alert(\'foo\');&lt;/script&gt;',
+ ),
+ ),
+ )),
+ array('{
+ "unstable": {
+ "1.0": {
+ "current": "1.0.1<script>alert(\'foo\');</script>",
+ "download": "https://www.phpbb.com/customise/db/download/104136<script>alert(\'foo\');</script>",
+ "announcement": "https://www.phpbb.com/customise/db/extension/boardrules/<script>alert(\'foo\');</script>",
+ "eol": "<script>alert(\'foo\');</script>",
+ "security": "<script>alert(\'foo\');</script>"
+ }
+ }
+}', true, array (
+ 'unstable' => array (
+ '1.0' => array (
+ 'current' => '1.0.1&lt;script&gt;alert(\'foo\');&lt;/script&gt;',
+ 'download' => 'https://www.phpbb.com/customise/db/download/104136&lt;script&gt;alert(\'foo\');&lt;/script&gt;',
+ 'announcement' => 'https://www.phpbb.com/customise/db/extension/boardrules/&lt;script&gt;alert(\'foo\');&lt;/script&gt;',
+ 'eol' => '&lt;script&gt;alert(\'foo\');&lt;/script&gt;',
+ 'security' => '&lt;script&gt;alert(\'foo\');&lt;/script&gt;',
+ ),
+ ),
+ 'stable' => array(),
+ )),
+ );
+ }
+
+ /**
+ * @dataProvider provider_get_versions
+ */
+ public function test_get_versions($input, $valid_data, $expected_return = '')
+ {
+ $this->file_downloader->set($input);
+
+ if (!$valid_data)
+ {
+ try {
+ $return = $this->version_helper->get_versions();
+ } catch (\RuntimeException $e) {
+ $this->assertEquals((string)$e->getMessage(), $this->user->lang('VERSIONCHECK_FAIL'));
+ }
+ }
+ else
+ {
+ $return = $this->version_helper->get_versions();
+ }
+
+ $this->assertEquals($expected_return, $return);
+ }
+}
diff --git a/tests/version/version_test.php b/tests/version/version_test.php
index ba31c79a79..528f1602d6 100644
--- a/tests/version/version_test.php
+++ b/tests/version/version_test.php
@@ -30,6 +30,7 @@ class phpbb_version_helper_test extends phpbb_test_case
new \phpbb\config\config(array(
'version' => '3.1.0',
)),
+ new \phpbb\file_downloader(),
new \phpbb\user('\phpbb\datetime')
);
}
@@ -208,6 +209,7 @@ class phpbb_version_helper_test extends phpbb_test_case
new \phpbb\config\config(array(
'version' => $current_version,
)),
+ new \phpbb\file_downloader(),
new \phpbb\user('\phpbb\datetime'),
))
->getMock()
@@ -318,6 +320,7 @@ class phpbb_version_helper_test extends phpbb_test_case
new \phpbb\config\config(array(
'version' => $current_version,
)),
+ new \phpbb\file_downloader(),
new \phpbb\user('\phpbb\datetime'),
))
->getMock()
diff --git a/tests/wrapper/gmgetdate_test.php b/tests/wrapper/gmgetdate_test.php
index dc0e38544d..2e55a78d21 100644
--- a/tests/wrapper/gmgetdate_test.php
+++ b/tests/wrapper/gmgetdate_test.php
@@ -50,7 +50,18 @@ class phpbb_wrapper_gmgetdate_test extends phpbb_test_case
$date_array['year']
);
- $this->assertEquals($expected, $actual);
+ // Calling second-granularity time functions twice isn't guaranteed to
+ // give the same results. As long as they're in the right order, allow
+ // a 1 second difference.
+ $this->assertGreaterThanOrEqual(
+ $expected, $actual,
+ 'Expected second time to be after (or equal to) the previous one'
+ );
+ $this->assertLessThanOrEqual(
+ 1,
+ abs($actual - $expected),
+ "Expected $actual to be within 1 second of $expected."
+ );
if (isset($current_timezone))
{
diff --git a/travis/check-sami-parse-errors.sh b/travis/check-sami-parse-errors.sh
index 847c54a61a..c3338e34db 100755
--- a/travis/check-sami-parse-errors.sh
+++ b/travis/check-sami-parse-errors.sh
@@ -20,7 +20,7 @@ then
# and
# https://github.com/fabpot/Sami/issues/117
errors=$(
- unbuffer phpBB/vendor/bin/sami.php parse travis/sami.conf.php -v | \
+ unbuffer phpBB/vendor/bin/sami.php parse build/sami-checkout.conf.php -v | \
sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" | \
grep "ERROR: " | \
tee /dev/tty | \
diff --git a/travis/install-phpbb-test-dependencies.sh b/travis/install-phpbb-test-dependencies.sh
new file mode 100755
index 0000000000..25743ff2b1
--- /dev/null
+++ b/travis/install-phpbb-test-dependencies.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+#
+# This file is part of the phpBB Forum Software package.
+#
+# @copyright (c) phpBB Limited <https://www.phpbb.com>
+# @license GNU General Public License, version 2 (GPL-2.0)
+#
+# For full copyright and license information, please see
+# the docs/CREDITS.txt file.
+#
+set -e
+set -x
+
+cd tests
+php ../composer.phar install --dev --no-interaction --prefer-source
+cd ..
diff --git a/travis/phpunit-mariadb-travis.xml b/travis/phpunit-mariadb-travis.xml
index aa245a8224..53a206b9b0 100644
--- a/travis/phpunit-mariadb-travis.xml
+++ b/travis/phpunit-mariadb-travis.xml
@@ -16,10 +16,14 @@
<directory suffix="_test.php">../tests</directory>
<exclude>../tests/functional</exclude>
<exclude>../tests/lint_test.php</exclude>
+ <exclude>../tests/ui</exclude>
</testsuite>
<testsuite name="phpBB Functional Tests">
<directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory>
</testsuite>
+ <testsuite name="phpBB UI Tests">
+ <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/ui</directory>
+ </testsuite>
</testsuites>
<groups>
diff --git a/travis/phpunit-mysql-travis.xml b/travis/phpunit-mysql-travis.xml
index 21122ccaeb..d0d3e3c0c0 100644
--- a/travis/phpunit-mysql-travis.xml
+++ b/travis/phpunit-mysql-travis.xml
@@ -16,10 +16,14 @@
<directory suffix="_test.php">../tests</directory>
<exclude>../tests/functional</exclude>
<exclude>../tests/lint_test.php</exclude>
+ <exclude>../tests/ui</exclude>
</testsuite>
<testsuite name="phpBB Functional Tests">
<directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory>
</testsuite>
+ <testsuite name="phpBB UI Tests">
+ <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/ui</directory>
+ </testsuite>
</testsuites>
<groups>
diff --git a/travis/phpunit-mysqli-travis.xml b/travis/phpunit-mysqli-travis.xml
index 60c279d774..4c963895fc 100644
--- a/travis/phpunit-mysqli-travis.xml
+++ b/travis/phpunit-mysqli-travis.xml
@@ -16,6 +16,7 @@
<directory suffix="_test.php">../tests</directory>
<exclude>../tests/functional</exclude>
<exclude>../tests/lint_test.php</exclude>
+ <exclude>../tests/ui</exclude>
</testsuite>
<testsuite name="phpBB Lint Test">
<file>../tests/lint_test.php</file>
@@ -23,6 +24,9 @@
<testsuite name="phpBB Functional Tests">
<directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory>
</testsuite>
+ <testsuite name="phpBB UI Tests">
+ <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/ui</directory>
+ </testsuite>
</testsuites>
<groups>
diff --git a/travis/phpunit-postgres-travis.xml b/travis/phpunit-postgres-travis.xml
index 956278e90c..fa497a1264 100644
--- a/travis/phpunit-postgres-travis.xml
+++ b/travis/phpunit-postgres-travis.xml
@@ -16,10 +16,14 @@
<directory suffix="_test.php">../tests</directory>
<exclude>../tests/functional</exclude>
<exclude>../tests/lint_test.php</exclude>
+ <exclude>../tests/ui</exclude>
</testsuite>
<testsuite name="phpBB Functional Tests">
<directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory>
</testsuite>
+ <testsuite name="phpBB UI Tests">
+ <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/ui</directory>
+ </testsuite>
</testsuites>
<groups>
diff --git a/travis/phpunit-sqlite3-travis.xml b/travis/phpunit-sqlite3-travis.xml
index 72b8b8c8ca..5baab791e0 100644
--- a/travis/phpunit-sqlite3-travis.xml
+++ b/travis/phpunit-sqlite3-travis.xml
@@ -16,10 +16,14 @@
<directory suffix="_test.php">../tests</directory>
<exclude>../tests/functional</exclude>
<exclude>../tests/lint_test.php</exclude>
+ <exclude>../tests/ui</exclude>
</testsuite>
<testsuite name="phpBB Functional Tests">
<directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/functional</directory>
</testsuite>
+ <testsuite name="phpBB UI Tests">
+ <directory suffix="_test.php" phpVersion="5.3.19" phpVersionOperator=">=">../tests/ui</directory>
+ </testsuite>
</testsuites>
<groups>
diff --git a/travis/setup-phpbb.sh b/travis/setup-phpbb.sh
index d829772196..205f23b876 100755
--- a/travis/setup-phpbb.sh
+++ b/travis/setup-phpbb.sh
@@ -33,6 +33,7 @@ fi
if [ `php -r "echo (int) version_compare(PHP_VERSION, '5.3.19', '>=');"` == "1" ]
then
travis/setup-webserver.sh
+ travis/install-phpbb-test-dependencies.sh
fi
cd phpBB