aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/adm/index.php4
-rw-r--r--phpBB/adm/style/acp_permissions.html11
-rw-r--r--phpBB/adm/style/admin.css67
-rw-r--r--phpBB/adm/style/installer_footer.html21
-rw-r--r--phpBB/adm/style/installer_form.html56
-rw-r--r--phpBB/adm/style/installer_header.html57
-rw-r--r--phpBB/adm/style/installer_install.html13
-rw-r--r--phpBB/adm/style/installer_main.html6
-rw-r--r--phpBB/adm/style/permission_mask.html20
-rw-r--r--phpBB/adm/style/tooltip.js304
-rw-r--r--phpBB/app.php4
-rw-r--r--phpBB/assets/javascript/editor.js64
-rw-r--r--phpBB/assets/javascript/installer.js400
-rwxr-xr-xphpBB/bin/phpbbcli.php26
-rw-r--r--phpBB/common.php27
-rw-r--r--phpBB/composer.json38
-rw-r--r--phpBB/composer.lock820
-rw-r--r--phpBB/config/default/config.yml0
-rw-r--r--phpBB/config/default/container/parameters.yml (renamed from phpBB/config/parameters.yml)0
-rw-r--r--phpBB/config/default/container/services.yml (renamed from phpBB/config/services.yml)92
-rw-r--r--phpBB/config/default/container/services_auth.yml (renamed from phpBB/config/auth.yml)0
-rw-r--r--phpBB/config/default/container/services_avatar.yml (renamed from phpBB/config/avatar.yml)4
-rw-r--r--phpBB/config/default/container/services_captcha.yml (renamed from phpBB/config/captcha.yml)0
-rw-r--r--phpBB/config/default/container/services_console.yml (renamed from phpBB/config/console.yml)45
-rw-r--r--phpBB/config/default/container/services_content.yml (renamed from phpBB/config/content.yml)0
-rw-r--r--phpBB/config/default/container/services_cron.yml (renamed from phpBB/config/cron.yml)0
-rw-r--r--phpBB/config/default/container/services_db.yml81
-rw-r--r--phpBB/config/default/container/services_event.yml (renamed from phpBB/config/event.yml)9
-rw-r--r--phpBB/config/default/container/services_feed.yml (renamed from phpBB/config/feed.yml)21
-rw-r--r--phpBB/config/default/container/services_files.yml3
-rw-r--r--phpBB/config/default/container/services_help.yml27
-rw-r--r--phpBB/config/default/container/services_http.yml23
-rw-r--r--phpBB/config/default/container/services_language.yml22
-rw-r--r--phpBB/config/default/container/services_migrator.yml (renamed from phpBB/config/db.yml)16
-rw-r--r--phpBB/config/default/container/services_mimetype_guesser.yml (renamed from phpBB/config/mimetype_guesser.yml)0
-rw-r--r--phpBB/config/default/container/services_module.yml10
-rw-r--r--phpBB/config/default/container/services_notification.yml222
-rw-r--r--phpBB/config/default/container/services_password.yml (renamed from phpBB/config/password.yml)0
-rw-r--r--phpBB/config/default/container/services_php.yml3
-rw-r--r--phpBB/config/default/container/services_profilefield.yml (renamed from phpBB/config/profilefield.yml)0
-rw-r--r--phpBB/config/default/container/services_report.yml53
-rw-r--r--phpBB/config/default/container/services_routing.yml31
-rw-r--r--phpBB/config/default/container/services_text_formatter.yml69
-rw-r--r--phpBB/config/default/container/services_text_reparser.yml70
-rw-r--r--phpBB/config/default/container/services_twig.yml65
-rw-r--r--phpBB/config/default/container/services_user.yml (renamed from phpBB/config/user.yml)1
-rw-r--r--phpBB/config/default/container/tables.yml (renamed from phpBB/config/tables.yml)5
-rw-r--r--phpBB/config/default/routing/feed.yml35
-rw-r--r--phpBB/config/default/routing/help.yml7
-rw-r--r--phpBB/config/default/routing/report.yml17
-rw-r--r--phpBB/config/default/routing/routing.yml24
-rw-r--r--phpBB/config/development/config.yml10
-rw-r--r--phpBB/config/development/container/environment.yml3
-rw-r--r--phpBB/config/development/container/parameters.yml2
-rw-r--r--phpBB/config/development/container/services.yml2
-rw-r--r--phpBB/config/development/routing/environment.yml2
-rw-r--r--phpBB/config/installer/config.yml2
-rw-r--r--phpBB/config/installer/container/environment.yml3
-rw-r--r--phpBB/config/installer/container/parameters.yml2
-rw-r--r--phpBB/config/installer/container/services.yml70
-rw-r--r--phpBB/config/installer/container/services_install_console.yml36
-rw-r--r--phpBB/config/installer/container/services_install_controller.yml34
-rw-r--r--phpBB/config/installer/container/services_install_data.yml44
-rw-r--r--phpBB/config/installer/container/services_install_database.yml51
-rw-r--r--phpBB/config/installer/container/services_install_filesystem.yml27
-rw-r--r--phpBB/config/installer/container/services_install_finish.yml33
-rw-r--r--phpBB/config/installer/container/services_install_navigation.yml27
-rw-r--r--phpBB/config/installer/container/services_install_obtain_data.yml66
-rw-r--r--phpBB/config/installer/container/services_install_requirements.yml36
-rw-r--r--phpBB/config/installer/container/services_installer.yml87
-rw-r--r--phpBB/config/installer/routing/environment.yml2
-rw-r--r--phpBB/config/installer/routing/installer.yml22
-rw-r--r--phpBB/config/notification.yml390
-rw-r--r--phpBB/config/production/config.yml2
-rw-r--r--phpBB/config/production/container/environment.yml3
-rw-r--r--phpBB/config/production/container/parameters.yml2
-rw-r--r--phpBB/config/production/container/services.yml2
-rw-r--r--phpBB/config/production/routing/environment.yml2
-rw-r--r--phpBB/config/routing.yml9
-rw-r--r--phpBB/config/test/config.yml5
-rw-r--r--phpBB/config/test/container/environment.yml3
-rw-r--r--phpBB/config/test/container/parameters.yml2
-rw-r--r--phpBB/config/test/container/services.yml2
-rw-r--r--phpBB/config/test/routing/environment.yml2
-rw-r--r--phpBB/cron.php4
-rw-r--r--phpBB/develop/add_permissions.php1
-rw-r--r--phpBB/develop/check_flash_bbcodes.php8
-rw-r--r--phpBB/develop/create_schema_files.php7
-rw-r--r--phpBB/develop/create_search_index.php2
-rw-r--r--phpBB/develop/fill.php4
-rw-r--r--phpBB/develop/generate_utf_tables.php290
-rw-r--r--phpBB/develop/imageset_to_css.php2
-rw-r--r--phpBB/develop/lang_duplicates.php2
-rw-r--r--phpBB/develop/lang_migrate_help_lang.php312
-rw-r--r--phpBB/develop/mysql_upgrader.php9
-rw-r--r--phpBB/develop/unicode_testing.php35
-rw-r--r--phpBB/develop/update_email_hash.php2
-rw-r--r--phpBB/develop/utf_normalizer_test.php394
-rw-r--r--phpBB/docs/INSTALL.html4
-rw-r--r--phpBB/docs/README.html4
-rw-r--r--phpBB/docs/events.md213
-rw-r--r--phpBB/docs/install-config.sample.yml35
-rw-r--r--phpBB/download/file.php34
-rw-r--r--phpBB/faq.php95
-rw-r--r--phpBB/feed.php222
-rw-r--r--phpBB/includes/acp/acp_attachments.php122
-rw-r--r--phpBB/includes/acp/acp_bbcodes.php51
-rw-r--r--phpBB/includes/acp/acp_board.php30
-rw-r--r--phpBB/includes/acp/acp_bots.php24
-rw-r--r--phpBB/includes/acp/acp_captcha.php17
-rw-r--r--phpBB/includes/acp/acp_contact.php6
-rw-r--r--phpBB/includes/acp/acp_database.php1690
-rw-r--r--phpBB/includes/acp/acp_disallow.php10
-rw-r--r--phpBB/includes/acp/acp_email.php16
-rw-r--r--phpBB/includes/acp/acp_extensions.php14
-rw-r--r--phpBB/includes/acp/acp_forums.php168
-rw-r--r--phpBB/includes/acp/acp_groups.php76
-rw-r--r--phpBB/includes/acp/acp_icons.php49
-rw-r--r--phpBB/includes/acp/acp_inactive.php28
-rw-r--r--phpBB/includes/acp/acp_jabber.php34
-rw-r--r--phpBB/includes/acp/acp_language.php58
-rw-r--r--phpBB/includes/acp/acp_logs.php23
-rw-r--r--phpBB/includes/acp/acp_main.php48
-rw-r--r--phpBB/includes/acp/acp_modules.php641
-rw-r--r--phpBB/includes/acp/acp_permission_roles.php26
-rw-r--r--phpBB/includes/acp/acp_permissions.php70
-rw-r--r--phpBB/includes/acp/acp_profile.php44
-rw-r--r--phpBB/includes/acp/acp_prune.php72
-rw-r--r--phpBB/includes/acp/acp_ranks.php20
-rw-r--r--phpBB/includes/acp/acp_reasons.php14
-rw-r--r--phpBB/includes/acp/acp_search.php42
-rw-r--r--phpBB/includes/acp/acp_send_statistics.php2
-rw-r--r--phpBB/includes/acp/acp_styles.php30
-rw-r--r--phpBB/includes/acp/acp_update.php1
-rw-r--r--phpBB/includes/acp/acp_users.php314
-rw-r--r--phpBB/includes/acp/acp_words.php21
-rw-r--r--phpBB/includes/acp/auth.php58
-rw-r--r--phpBB/includes/acp/info/acp_attachments.php1
-rw-r--r--phpBB/includes/acp/info/acp_ban.php1
-rw-r--r--phpBB/includes/acp/info/acp_bbcodes.php1
-rw-r--r--phpBB/includes/acp/info/acp_board.php1
-rw-r--r--phpBB/includes/acp/info/acp_bots.php1
-rw-r--r--phpBB/includes/acp/info/acp_captcha.php1
-rw-r--r--phpBB/includes/acp/info/acp_database.php1
-rw-r--r--phpBB/includes/acp/info/acp_disallow.php1
-rw-r--r--phpBB/includes/acp/info/acp_email.php1
-rw-r--r--phpBB/includes/acp/info/acp_extensions.php1
-rw-r--r--phpBB/includes/acp/info/acp_forums.php1
-rw-r--r--phpBB/includes/acp/info/acp_groups.php1
-rw-r--r--phpBB/includes/acp/info/acp_icons.php1
-rw-r--r--phpBB/includes/acp/info/acp_inactive.php1
-rw-r--r--phpBB/includes/acp/info/acp_jabber.php1
-rw-r--r--phpBB/includes/acp/info/acp_language.php1
-rw-r--r--phpBB/includes/acp/info/acp_logs.php1
-rw-r--r--phpBB/includes/acp/info/acp_main.php1
-rw-r--r--phpBB/includes/acp/info/acp_modules.php1
-rw-r--r--phpBB/includes/acp/info/acp_permission_roles.php1
-rw-r--r--phpBB/includes/acp/info/acp_permissions.php1
-rw-r--r--phpBB/includes/acp/info/acp_php_info.php1
-rw-r--r--phpBB/includes/acp/info/acp_profile.php1
-rw-r--r--phpBB/includes/acp/info/acp_prune.php1
-rw-r--r--phpBB/includes/acp/info/acp_ranks.php1
-rw-r--r--phpBB/includes/acp/info/acp_reasons.php1
-rw-r--r--phpBB/includes/acp/info/acp_search.php1
-rw-r--r--phpBB/includes/acp/info/acp_send_statistics.php1
-rw-r--r--phpBB/includes/acp/info/acp_styles.php1
-rw-r--r--phpBB/includes/acp/info/acp_update.php1
-rw-r--r--phpBB/includes/acp/info/acp_users.php1
-rw-r--r--phpBB/includes/acp/info/acp_words.php1
-rw-r--r--phpBB/includes/bbcode.php57
-rw-r--r--phpBB/includes/compatibility_globals.php74
-rw-r--r--phpBB/includes/constants.php8
-rw-r--r--phpBB/includes/functions.php973
-rw-r--r--phpBB/includes/functions_acp.php4
-rw-r--r--phpBB/includes/functions_admin.php50
-rw-r--r--phpBB/includes/functions_compatibility.php325
-rw-r--r--phpBB/includes/functions_compress.php69
-rw-r--r--phpBB/includes/functions_content.php171
-rw-r--r--phpBB/includes/functions_convert.php34
-rw-r--r--phpBB/includes/functions_display.php53
-rw-r--r--phpBB/includes/functions_download.php4
-rw-r--r--phpBB/includes/functions_install.php31
-rw-r--r--phpBB/includes/functions_jabber.php3
-rw-r--r--phpBB/includes/functions_mcp.php9
-rw-r--r--phpBB/includes/functions_messenger.php73
-rw-r--r--phpBB/includes/functions_module.php10
-rw-r--r--phpBB/includes/functions_posting.php89
-rw-r--r--phpBB/includes/functions_privmsgs.php73
-rw-r--r--phpBB/includes/functions_upload.php56
-rw-r--r--phpBB/includes/functions_url_matcher.php112
-rw-r--r--phpBB/includes/functions_user.php223
-rw-r--r--phpBB/includes/mcp/info/mcp_ban.php1
-rw-r--r--phpBB/includes/mcp/info/mcp_logs.php1
-rw-r--r--phpBB/includes/mcp/info/mcp_main.php1
-rw-r--r--phpBB/includes/mcp/info/mcp_notes.php1
-rw-r--r--phpBB/includes/mcp/info/mcp_pm_reports.php1
-rw-r--r--phpBB/includes/mcp/info/mcp_queue.php1
-rw-r--r--phpBB/includes/mcp/info/mcp_reports.php1
-rw-r--r--phpBB/includes/mcp/info/mcp_warn.php1
-rw-r--r--phpBB/includes/mcp/mcp_forum.php44
-rw-r--r--phpBB/includes/mcp/mcp_front.php4
-rw-r--r--phpBB/includes/mcp/mcp_logs.php29
-rw-r--r--phpBB/includes/mcp/mcp_main.php117
-rw-r--r--phpBB/includes/mcp/mcp_notes.php41
-rw-r--r--phpBB/includes/mcp/mcp_pm_reports.php14
-rw-r--r--phpBB/includes/mcp/mcp_post.php27
-rw-r--r--phpBB/includes/mcp/mcp_queue.php70
-rw-r--r--phpBB/includes/mcp/mcp_reports.php51
-rw-r--r--phpBB/includes/mcp/mcp_topic.php77
-rw-r--r--phpBB/includes/mcp/mcp_warn.php49
-rw-r--r--phpBB/includes/message_parser.php286
-rw-r--r--phpBB/includes/questionnaire/questionnaire.php2
-rw-r--r--phpBB/includes/startup.php43
-rw-r--r--phpBB/includes/ucp/info/ucp_attachments.php1
-rw-r--r--phpBB/includes/ucp/info/ucp_auth_link.php1
-rw-r--r--phpBB/includes/ucp/info/ucp_groups.php1
-rw-r--r--phpBB/includes/ucp/info/ucp_main.php1
-rw-r--r--phpBB/includes/ucp/info/ucp_notifications.php3
-rw-r--r--phpBB/includes/ucp/info/ucp_pm.php1
-rw-r--r--phpBB/includes/ucp/info/ucp_prefs.php1
-rw-r--r--phpBB/includes/ucp/info/ucp_profile.php1
-rw-r--r--phpBB/includes/ucp/info/ucp_zebra.php1
-rw-r--r--phpBB/includes/ucp/ucp_activate.php21
-rw-r--r--phpBB/includes/ucp/ucp_attachments.php11
-rw-r--r--phpBB/includes/ucp/ucp_auth_link.php1
-rw-r--r--phpBB/includes/ucp/ucp_confirm.php4
-rw-r--r--phpBB/includes/ucp/ucp_groups.php81
-rw-r--r--phpBB/includes/ucp/ucp_login_link.php1
-rw-r--r--phpBB/includes/ucp/ucp_main.php20
-rw-r--r--phpBB/includes/ucp/ucp_notifications.php20
-rw-r--r--phpBB/includes/ucp/ucp_pm.php26
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php82
-rw-r--r--phpBB/includes/ucp/ucp_pm_options.php67
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewfolder.php19
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewmessage.php5
-rw-r--r--phpBB/includes/ucp/ucp_prefs.php58
-rw-r--r--phpBB/includes/ucp/ucp_profile.php148
-rw-r--r--phpBB/includes/ucp/ucp_register.php22
-rw-r--r--phpBB/includes/ucp/ucp_remind.php7
-rw-r--r--phpBB/includes/ucp/ucp_resend.php6
-rw-r--r--phpBB/includes/ucp/ucp_zebra.php2
-rw-r--r--phpBB/includes/utf/data/utf_canonical_comp.php2
-rw-r--r--phpBB/includes/utf/data/utf_canonical_decomp.php2
-rw-r--r--phpBB/includes/utf/data/utf_compatibility_decomp.php2
-rw-r--r--phpBB/includes/utf/data/utf_nfc_qc.php2
-rw-r--r--phpBB/includes/utf/data/utf_nfkc_qc.php2
-rw-r--r--phpBB/includes/utf/data/utf_normalizer_common.php4
-rw-r--r--phpBB/includes/utf/utf_normalizer.php1509
-rw-r--r--phpBB/includes/utf/utf_tools.php748
-rw-r--r--phpBB/index.php8
-rw-r--r--phpBB/install/convertors/convert_phpbb20.php4
-rw-r--r--phpBB/install/convertors/functions_phpbb20.php51
-rw-r--r--phpBB/install/data/confusables.php8
-rw-r--r--phpBB/install/data/new_normalizer.php197
-rw-r--r--phpBB/install/database_update.php41
-rw-r--r--phpBB/install/index.php66
-rw-r--r--phpBB/install/install_convert.php101
-rw-r--r--phpBB/install/install_install.php185
-rw-r--r--phpBB/install/install_update.php76
-rw-r--r--phpBB/install/schemas/schema_data.sql48
-rw-r--r--phpBB/install_new/app.php79
-rw-r--r--phpBB/install_new/phpbbcli.php66
-rw-r--r--phpBB/language/en/acp/attachments.php6
-rw-r--r--phpBB/language/en/acp/board.php1
-rw-r--r--phpBB/language/en/acp/groups.php4
-rw-r--r--phpBB/language/en/acp/permissions_phpbb.php1
-rw-r--r--phpBB/language/en/cli.php32
-rw-r--r--phpBB/language/en/common.php6
-rw-r--r--phpBB/language/en/help/bbcode.php66
-rw-r--r--phpBB/language/en/help/faq.php186
-rw-r--r--phpBB/language/en/install.php7
-rw-r--r--phpBB/language/en/install_new.php315
-rw-r--r--phpBB/language/en/mcp.php1
-rw-r--r--phpBB/language/en/ucp.php1
-rw-r--r--phpBB/mcp.php30
-rw-r--r--phpBB/memberlist.php89
-rw-r--r--phpBB/phpbb/auth/auth.php1
-rw-r--r--phpBB/phpbb/auth/provider/db.php1
-rw-r--r--phpBB/phpbb/avatar/driver/driver.php7
-rw-r--r--phpBB/phpbb/avatar/driver/gravatar.php12
-rw-r--r--phpBB/phpbb/avatar/driver/local.php8
-rw-r--r--phpBB/phpbb/avatar/driver/remote.php33
-rw-r--r--phpBB/phpbb/avatar/driver/upload.php15
-rw-r--r--phpBB/phpbb/cache/driver/base.php15
-rw-r--r--phpBB/phpbb/cache/driver/dummy.php (renamed from phpBB/phpbb/cache/driver/null.php)8
-rw-r--r--phpBB/phpbb/cache/driver/eaccelerator.php4
-rw-r--r--phpBB/phpbb/cache/driver/file.php43
-rw-r--r--phpBB/phpbb/cache/driver/memory.php12
-rw-r--r--phpBB/phpbb/captcha/plugins/captcha_abstract.php18
-rw-r--r--phpBB/phpbb/captcha/plugins/gd.php16
-rw-r--r--phpBB/phpbb/captcha/plugins/qa.php44
-rw-r--r--phpBB/phpbb/captcha/plugins/recaptcha.php18
-rw-r--r--phpBB/phpbb/composer.json2
-rw-r--r--phpBB/phpbb/console/application.php71
-rw-r--r--phpBB/phpbb/console/command/db/migrate.php8
-rw-r--r--phpBB/phpbb/console/command/reparser/list_all.php69
-rw-r--r--phpBB/phpbb/console/command/reparser/reparse.php305
-rw-r--r--phpBB/phpbb/console/command/thumbnail/delete.php178
-rw-r--r--phpBB/phpbb/console/command/thumbnail/generate.php204
-rw-r--r--phpBB/phpbb/console/command/thumbnail/recreate.php72
-rw-r--r--phpBB/phpbb/controller/exception.php2
-rw-r--r--phpBB/phpbb/controller/helper.php104
-rw-r--r--phpBB/phpbb/controller/provider.php92
-rw-r--r--phpBB/phpbb/controller/resolver.php18
-rw-r--r--phpBB/phpbb/cron/task/core/prune_forum.php2
-rw-r--r--phpBB/phpbb/cron/task/core/prune_shadow_topics.php2
-rw-r--r--phpBB/phpbb/cron/task/core/tidy_plupload.php8
-rw-r--r--phpBB/phpbb/db/driver/driver.php16
-rw-r--r--phpBB/phpbb/db/driver/mssql.php56
-rw-r--r--phpBB/phpbb/db/driver/mssql_odbc.php32
-rw-r--r--phpBB/phpbb/db/driver/mssqlnative.php34
-rw-r--r--phpBB/phpbb/db/driver/mysql.php56
-rw-r--r--phpBB/phpbb/db/driver/mysqli.php49
-rw-r--r--phpBB/phpbb/db/driver/oracle.php59
-rw-r--r--phpBB/phpbb/db/driver/postgres.php45
-rw-r--r--phpBB/phpbb/db/driver/sqlite.php34
-rw-r--r--phpBB/phpbb/db/driver/sqlite3.php12
-rw-r--r--phpBB/phpbb/db/extractor/base_extractor.php252
-rw-r--r--phpBB/phpbb/db/extractor/exception/extractor_not_initialized_exception.php24
-rw-r--r--phpBB/phpbb/db/extractor/exception/invalid_format_exception.php22
-rw-r--r--phpBB/phpbb/db/extractor/extractor_interface.php80
-rw-r--r--phpBB/phpbb/db/extractor/factory.php79
-rw-r--r--phpBB/phpbb/db/extractor/mssql_extractor.php524
-rw-r--r--phpBB/phpbb/db/extractor/mysql_extractor.php403
-rw-r--r--phpBB/phpbb/db/extractor/oracle_extractor.php265
-rw-r--r--phpBB/phpbb/db/extractor/postgres_extractor.php339
-rw-r--r--phpBB/phpbb/db/extractor/sqlite3_extractor.php151
-rw-r--r--phpBB/phpbb/db/extractor/sqlite_extractor.php149
-rw-r--r--phpBB/phpbb/db/log_wrapper_migrator_output_handler.php11
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_5_rc1.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php2
-rw-r--r--phpBB/phpbb/db/migration/data/v310/acp_prune_users_module.php11
-rw-r--r--phpBB/phpbb/db/migration/data/v310/dev.php11
-rw-r--r--phpBB/phpbb/db/migration/data/v310/notifications_board.php73
-rw-r--r--phpBB/phpbb/db/migration/data/v320/allowed_schemes_links.php24
-rw-r--r--phpBB/phpbb/db/migration/data/v320/announce_global_permission.php41
-rw-r--r--phpBB/phpbb/db/migration/data/v320/log_post_id.php44
-rw-r--r--phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php83
-rw-r--r--phpBB/phpbb/db/migration/migration.php6
-rw-r--r--phpBB/phpbb/db/migration/profilefield_base_migration.php1
-rw-r--r--phpBB/phpbb/db/migration/schema_generator.php4
-rw-r--r--phpBB/phpbb/db/migration/tool/module.php59
-rw-r--r--phpBB/phpbb/db/migrator.php4
-rw-r--r--phpBB/phpbb/db/tools/factory.php43
-rw-r--r--phpBB/phpbb/db/tools/mssql.php793
-rw-r--r--phpBB/phpbb/db/tools/postgres.php613
-rw-r--r--phpBB/phpbb/db/tools/tools.php (renamed from phpBB/phpbb/db/tools.php)1009
-rw-r--r--phpBB/phpbb/db/tools/tools_interface.php202
-rw-r--r--phpBB/phpbb/di/container_builder.php576
-rw-r--r--phpBB/phpbb/di/extension/container_configuration.php46
-rw-r--r--phpBB/phpbb/di/extension/core.php98
-rw-r--r--phpBB/phpbb/di/extension/ext.php67
-rw-r--r--phpBB/phpbb/di/ordered_service_collection.php117
-rw-r--r--phpBB/phpbb/di/pass/collection_pass.php22
-rw-r--r--phpBB/phpbb/di/service_collection.php27
-rw-r--r--phpBB/phpbb/di/service_collection_iterator.php2
-rw-r--r--phpBB/phpbb/event/kernel_exception_subscriber.php2
-rw-r--r--phpBB/phpbb/event/kernel_request_subscriber.php82
-rw-r--r--phpBB/phpbb/event/kernel_terminate_subscriber.php2
-rw-r--r--phpBB/phpbb/event/md_exporter.php11
-rw-r--r--phpBB/phpbb/extension/di/extension_base.php138
-rw-r--r--phpBB/phpbb/extension/exception.php6
-rw-r--r--phpBB/phpbb/extension/manager.php26
-rw-r--r--phpBB/phpbb/extension/metadata_manager.php26
-rw-r--r--phpBB/phpbb/feed/attachments_base.php2
-rw-r--r--phpBB/phpbb/feed/base.php217
-rw-r--r--phpBB/phpbb/feed/controller/feed.php389
-rw-r--r--phpBB/phpbb/feed/exception/feed_exception.php21
-rw-r--r--phpBB/phpbb/feed/exception/feed_unavailable_exception.php19
-rw-r--r--phpBB/phpbb/feed/exception/no_feed_exception.php22
-rw-r--r--phpBB/phpbb/feed/exception/no_forum_exception.php22
-rw-r--r--phpBB/phpbb/feed/exception/no_topic_exception.php22
-rw-r--r--phpBB/phpbb/feed/exception/unauthorized_exception.php19
-rw-r--r--phpBB/phpbb/feed/exception/unauthorized_forum_exception.php22
-rw-r--r--phpBB/phpbb/feed/exception/unauthorized_topic_exception.php22
-rw-r--r--phpBB/phpbb/feed/factory.php127
-rw-r--r--phpBB/phpbb/feed/feed_interface.php67
-rw-r--r--phpBB/phpbb/feed/forum.php82
-rw-r--r--phpBB/phpbb/feed/forums.php49
-rw-r--r--phpBB/phpbb/feed/helper.php78
-rw-r--r--phpBB/phpbb/feed/news.php43
-rw-r--r--phpBB/phpbb/feed/overall.php46
-rw-r--r--phpBB/phpbb/feed/post_base.php39
-rw-r--r--phpBB/phpbb/feed/topic.php83
-rw-r--r--phpBB/phpbb/feed/topic_base.php38
-rw-r--r--phpBB/phpbb/feed/topics.php42
-rw-r--r--phpBB/phpbb/feed/topics_active.php58
-rw-r--r--phpBB/phpbb/filesystem.php35
-rw-r--r--phpBB/phpbb/filesystem/exception/filesystem_exception.php42
-rw-r--r--phpBB/phpbb/filesystem/filesystem.php916
-rw-r--r--phpBB/phpbb/filesystem/filesystem_interface.php284
-rw-r--r--phpBB/phpbb/finder.php4
-rw-r--r--phpBB/phpbb/group/helper.php40
-rw-r--r--phpBB/phpbb/help/controller/bbcode.php85
-rw-r--r--phpBB/phpbb/help/controller/controller.php76
-rw-r--r--phpBB/phpbb/help/controller/faq.php165
-rw-r--r--phpBB/phpbb/help/controller/help.php160
-rw-r--r--phpBB/phpbb/help/manager.php137
-rw-r--r--phpBB/phpbb/install/console/command/install/config/show.php131
-rw-r--r--phpBB/phpbb/install/console/command/install/config/validate.php132
-rw-r--r--phpBB/phpbb/install/console/command/install/install.php206
-rw-r--r--phpBB/phpbb/install/controller/helper.php362
-rw-r--r--phpBB/phpbb/install/controller/install.php202
-rw-r--r--phpBB/phpbb/install/controller/installer_index.php81
-rw-r--r--phpBB/phpbb/install/exception/cannot_build_container_exception.php22
-rw-r--r--phpBB/phpbb/install/exception/installer_config_not_writable_exception.php22
-rw-r--r--phpBB/phpbb/install/exception/installer_exception.php24
-rw-r--r--phpBB/phpbb/install/exception/invalid_dbms_exception.php22
-rw-r--r--phpBB/phpbb/install/exception/resource_limit_reached_exception.php22
-rw-r--r--phpBB/phpbb/install/exception/user_interaction_required_exception.php25
-rw-r--r--phpBB/phpbb/install/helper/config.php386
-rw-r--r--phpBB/phpbb/install/helper/container_factory.php162
-rw-r--r--phpBB/phpbb/install/helper/database.php456
-rw-r--r--phpBB/phpbb/install/helper/install_helper.php60
-rw-r--r--phpBB/phpbb/install/helper/iohandler/ajax_iohandler.php293
-rw-r--r--phpBB/phpbb/install/helper/iohandler/cli_iohandler.php265
-rw-r--r--phpBB/phpbb/install/helper/iohandler/exception/iohandler_not_implemented_exception.php19
-rw-r--r--phpBB/phpbb/install/helper/iohandler/factory.php81
-rw-r--r--phpBB/phpbb/install/helper/iohandler/iohandler_base.php190
-rw-r--r--phpBB/phpbb/install/helper/iohandler/iohandler_interface.php174
-rw-r--r--phpBB/phpbb/install/helper/navigation/install_navigation.php75
-rw-r--r--phpBB/phpbb/install/helper/navigation/main_navigation.php48
-rw-r--r--phpBB/phpbb/install/helper/navigation/navigation_interface.php43
-rw-r--r--phpBB/phpbb/install/helper/navigation/navigation_provider.php121
-rw-r--r--phpBB/phpbb/install/installer.php264
-rw-r--r--phpBB/phpbb/install/installer_configuration.php140
-rw-r--r--phpBB/phpbb/install/module/install_data/module.php28
-rw-r--r--phpBB/phpbb/install/module/install_data/task/add_bots.php237
-rw-r--r--phpBB/phpbb/install/module/install_data/task/add_languages.php121
-rw-r--r--phpBB/phpbb/install/module/install_data/task/add_modules.php462
-rw-r--r--phpBB/phpbb/install/module/install_database/module.php28
-rw-r--r--phpBB/phpbb/install/module/install_database/task/add_config_settings.php341
-rw-r--r--phpBB/phpbb/install/module/install_database/task/add_default_data.php163
-rw-r--r--phpBB/phpbb/install/module/install_database/task/create_schema.php214
-rw-r--r--phpBB/phpbb/install/module/install_filesystem/module.php28
-rw-r--r--phpBB/phpbb/install/module/install_filesystem/task/create_config_file.php235
-rw-r--r--phpBB/phpbb/install/module/install_finish/module.php28
-rw-r--r--phpBB/phpbb/install/module/install_finish/task/notify_user.php157
-rw-r--r--phpBB/phpbb/install/module/install_finish/task/populate_migrations.php70
-rw-r--r--phpBB/phpbb/install/module/obtain_data/module.php33
-rw-r--r--phpBB/phpbb/install/module/obtain_data/task/obtain_admin_data.php219
-rw-r--r--phpBB/phpbb/install/module/obtain_data/task/obtain_board_data.php186
-rw-r--r--phpBB/phpbb/install/module/obtain_data/task/obtain_database_data.php271
-rw-r--r--phpBB/phpbb/install/module/obtain_data/task/obtain_email_data.php167
-rw-r--r--phpBB/phpbb/install/module/obtain_data/task/obtain_imagick_path.php89
-rw-r--r--phpBB/phpbb/install/module/obtain_data/task/obtain_server_data.php203
-rw-r--r--phpBB/phpbb/install/module/requirements/module.php110
-rw-r--r--phpBB/phpbb/install/module/requirements/task/check_filesystem.php273
-rw-r--r--phpBB/phpbb/install/module/requirements/task/check_server_environment.php190
-rw-r--r--phpBB/phpbb/install/module_base.php218
-rw-r--r--phpBB/phpbb/install/module_interface.php63
-rw-r--r--phpBB/phpbb/install/task_base.php53
-rw-r--r--phpBB/phpbb/install/task_interface.php61
-rw-r--r--phpBB/phpbb/language/exception/invalid_plural_rule_exception.php22
-rw-r--r--phpBB/phpbb/language/exception/language_exception.php22
-rw-r--r--phpBB/phpbb/language/exception/language_file_not_found.php22
-rw-r--r--phpBB/phpbb/language/language.php632
-rw-r--r--phpBB/phpbb/language/language_file_helper.php71
-rw-r--r--phpBB/phpbb/language/language_file_loader.php206
-rw-r--r--phpBB/phpbb/log/dummy.php (renamed from phpBB/phpbb/log/null.php)4
-rw-r--r--phpBB/phpbb/log/log.php15
-rw-r--r--phpBB/phpbb/log/log_interface.php16
-rw-r--r--phpBB/phpbb/module/exception/module_exception.php19
-rw-r--r--phpBB/phpbb/module/exception/module_not_found_exception.php19
-rw-r--r--phpBB/phpbb/module/module_manager.php564
-rw-r--r--phpBB/phpbb/notification/exception.php6
-rw-r--r--phpBB/phpbb/notification/manager.php554
-rw-r--r--phpBB/phpbb/notification/method/base.php130
-rw-r--r--phpBB/phpbb/notification/method/board.php398
-rw-r--r--phpBB/phpbb/notification/method/email.php23
-rw-r--r--phpBB/phpbb/notification/method/jabber.php25
-rw-r--r--phpBB/phpbb/notification/method/messenger_base.php24
-rw-r--r--phpBB/phpbb/notification/method/method_interface.php104
-rw-r--r--phpBB/phpbb/notification/type/admin_activate_user.php24
-rw-r--r--phpBB/phpbb/notification/type/approve_post.php25
-rw-r--r--phpBB/phpbb/notification/type/approve_topic.php26
-rw-r--r--phpBB/phpbb/notification/type/base.php75
-rw-r--r--phpBB/phpbb/notification/type/bookmark.php34
-rw-r--r--phpBB/phpbb/notification/type/disapprove_post.php23
-rw-r--r--phpBB/phpbb/notification/type/disapprove_topic.php23
-rw-r--r--phpBB/phpbb/notification/type/group_request.php16
-rw-r--r--phpBB/phpbb/notification/type/group_request_approved.php8
-rw-r--r--phpBB/phpbb/notification/type/pm.php32
-rw-r--r--phpBB/phpbb/notification/type/post.php64
-rw-r--r--phpBB/phpbb/notification/type/post_in_queue.php23
-rw-r--r--phpBB/phpbb/notification/type/quote.php57
-rw-r--r--phpBB/phpbb/notification/type/report_pm.php16
-rw-r--r--phpBB/phpbb/notification/type/report_pm_closed.php23
-rw-r--r--phpBB/phpbb/notification/type/report_post.php12
-rw-r--r--phpBB/phpbb/notification/type/report_post_closed.php23
-rw-r--r--phpBB/phpbb/notification/type/topic.php32
-rw-r--r--phpBB/phpbb/notification/type/topic_in_queue.php23
-rw-r--r--phpBB/phpbb/notification/type/type_interface.php16
-rw-r--r--phpBB/phpbb/path_helper.php6
-rw-r--r--phpBB/phpbb/permissions.php1
-rw-r--r--phpBB/phpbb/profilefields/type/type_date.php2
-rw-r--r--phpBB/phpbb/report/controller/report.php319
-rw-r--r--phpBB/phpbb/report/exception/already_reported_exception.php19
-rw-r--r--phpBB/phpbb/report/exception/empty_report_exception.php22
-rw-r--r--phpBB/phpbb/report/exception/entity_not_found_exception.php19
-rw-r--r--phpBB/phpbb/report/exception/factory_invalid_argument_exception.php21
-rw-r--r--phpBB/phpbb/report/exception/invalid_report_exception.php21
-rw-r--r--phpBB/phpbb/report/exception/pm_reporting_disabled_exception.php22
-rw-r--r--phpBB/phpbb/report/exception/report_permission_denied_exception.php19
-rw-r--r--phpBB/phpbb/report/handler_factory.php56
-rw-r--r--phpBB/phpbb/report/report_handler.php104
-rw-r--r--phpBB/phpbb/report/report_handler_interface.php43
-rw-r--r--phpBB/phpbb/report/report_handler_pm.php137
-rw-r--r--phpBB/phpbb/report/report_handler_post.php175
-rw-r--r--phpBB/phpbb/report/report_reason_list_provider.php78
-rw-r--r--phpBB/phpbb/request/deactivated_super_global.php2
-rw-r--r--phpBB/phpbb/routing/helper.php153
-rw-r--r--phpBB/phpbb/routing/router.php460
-rw-r--r--phpBB/phpbb/search/fulltext_mysql.php6
-rw-r--r--phpBB/phpbb/search/fulltext_native.php40
-rw-r--r--phpBB/phpbb/search/fulltext_postgres.php2
-rw-r--r--phpBB/phpbb/search/fulltext_sphinx.php17
-rw-r--r--phpBB/phpbb/session.php43
-rw-r--r--phpBB/phpbb/template/asset.php15
-rw-r--r--phpBB/phpbb/template/exception/user_object_not_available.php22
-rw-r--r--phpBB/phpbb/template/twig/environment.php53
-rw-r--r--phpBB/phpbb/template/twig/extension.php15
-rw-r--r--phpBB/phpbb/template/twig/extension/routing.php43
-rw-r--r--phpBB/phpbb/template/twig/lexer.php11
-rw-r--r--phpBB/phpbb/template/twig/loader.php22
-rw-r--r--phpBB/phpbb/template/twig/node/includeasset.php2
-rw-r--r--phpBB/phpbb/template/twig/twig.php63
-rw-r--r--phpBB/phpbb/textformatter/cache_interface.php31
-rw-r--r--phpBB/phpbb/textformatter/data_access.php228
-rw-r--r--phpBB/phpbb/textformatter/parser_interface.php112
-rw-r--r--phpBB/phpbb/textformatter/renderer_interface.php92
-rw-r--r--phpBB/phpbb/textformatter/s9e/factory.php570
-rw-r--r--phpBB/phpbb/textformatter/s9e/parser.php396
-rw-r--r--phpBB/phpbb/textformatter/s9e/quote_helper.php81
-rw-r--r--phpBB/phpbb/textformatter/s9e/renderer.php314
-rw-r--r--phpBB/phpbb/textformatter/s9e/utils.php139
-rw-r--r--phpBB/phpbb/textformatter/utils_interface.php71
-rw-r--r--phpBB/phpbb/textreparser/base.php243
-rw-r--r--phpBB/phpbb/textreparser/plugins/contact_admin_info.php69
-rw-r--r--phpBB/phpbb/textreparser/plugins/forum_description.php38
-rw-r--r--phpBB/phpbb/textreparser/plugins/forum_rules.php38
-rw-r--r--phpBB/phpbb/textreparser/plugins/group_description.php38
-rw-r--r--phpBB/phpbb/textreparser/plugins/pm_text.php40
-rw-r--r--phpBB/phpbb/textreparser/plugins/poll_option.php74
-rw-r--r--phpBB/phpbb/textreparser/plugins/poll_title.php50
-rw-r--r--phpBB/phpbb/textreparser/plugins/post_text.php40
-rw-r--r--phpBB/phpbb/textreparser/plugins/user_signature.php73
-rw-r--r--phpBB/phpbb/textreparser/reparser_interface.php32
-rw-r--r--phpBB/phpbb/textreparser/row_based_plugin.php117
-rw-r--r--phpBB/phpbb/user.php338
-rw-r--r--phpBB/phpbb/user_loader.php14
-rw-r--r--phpBB/phpbb/viewonline_helper.php6
-rw-r--r--phpBB/posting.php99
-rw-r--r--phpBB/report.php323
-rw-r--r--phpBB/search.php53
-rw-r--r--phpBB/styles/all/template/feed.xml.twig37
-rw-r--r--phpBB/styles/prosilver/style.cfg4
-rw-r--r--phpBB/styles/prosilver/template/attachment.html79
-rw-r--r--phpBB/styles/prosilver/template/bbcode.html39
-rw-r--r--phpBB/styles/prosilver/template/captcha_recaptcha.html2
-rw-r--r--phpBB/styles/prosilver/template/jumpbox.html6
-rw-r--r--phpBB/styles/prosilver/template/mcp_forum.html6
-rw-r--r--phpBB/styles/prosilver/template/memberlist_body.html2
-rw-r--r--phpBB/styles/prosilver/template/overall_header.html16
-rw-r--r--phpBB/styles/prosilver/template/posting_topic_review.html2
-rw-r--r--phpBB/styles/prosilver/template/ucp_notifications.html2
-rw-r--r--phpBB/styles/prosilver/template/ucp_pm_history.html2
-rw-r--r--phpBB/styles/prosilver/theme/base.css115
-rw-r--r--phpBB/styles/prosilver/theme/buttons.css8
-rw-r--r--phpBB/styles/prosilver/theme/colours.css213
-rw-r--r--phpBB/styles/prosilver/theme/common.css113
-rw-r--r--phpBB/styles/prosilver/theme/content.css21
-rw-r--r--phpBB/styles/prosilver/theme/forms.css1
-rw-r--r--phpBB/styles/prosilver/theme/images/bg_button.gifbin182 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/images/gradient.gifbin549 -> 0 bytes
-rw-r--r--phpBB/styles/prosilver/theme/links.css4
-rw-r--r--phpBB/styles/prosilver/theme/normalize.css424
-rw-r--r--phpBB/styles/prosilver/theme/stylesheet.css3
-rw-r--r--phpBB/styles/prosilver/theme/tweaks.css12
-rw-r--r--phpBB/styles/prosilver/theme/utilities.css57
-rw-r--r--phpBB/styles/subsilver2/style.cfg32
-rw-r--r--phpBB/styles/subsilver2/template/attachment.html125
-rw-r--r--phpBB/styles/subsilver2/template/bbcode.html69
-rw-r--r--phpBB/styles/subsilver2/template/breadcrumbs.html14
-rw-r--r--phpBB/styles/subsilver2/template/captcha_default.html17
-rw-r--r--phpBB/styles/subsilver2/template/captcha_qa.html8
-rw-r--r--phpBB/styles/subsilver2/template/captcha_recaptcha.html36
-rw-r--r--phpBB/styles/subsilver2/template/confirm_body.html28
-rw-r--r--phpBB/styles/subsilver2/template/confirm_delete_body.html55
-rw-r--r--phpBB/styles/subsilver2/template/faq_body.html63
-rw-r--r--phpBB/styles/subsilver2/template/forumlist_body.html98
-rw-r--r--phpBB/styles/subsilver2/template/index.htm16
-rw-r--r--phpBB/styles/subsilver2/template/index_body.html142
-rw-r--r--phpBB/styles/subsilver2/template/jumpbox.html19
-rw-r--r--phpBB/styles/subsilver2/template/login_body.html111
-rw-r--r--phpBB/styles/subsilver2/template/login_body_oauth.html7
-rw-r--r--phpBB/styles/subsilver2/template/login_forum.html56
-rw-r--r--phpBB/styles/subsilver2/template/mcp_approve.html49
-rw-r--r--phpBB/styles/subsilver2/template/mcp_ban.html120
-rw-r--r--phpBB/styles/subsilver2/template/mcp_footer.html27
-rw-r--r--phpBB/styles/subsilver2/template/mcp_forum.html95
-rw-r--r--phpBB/styles/subsilver2/template/mcp_front.html147
-rw-r--r--phpBB/styles/subsilver2/template/mcp_header.html60
-rw-r--r--phpBB/styles/subsilver2/template/mcp_logs.html46
-rw-r--r--phpBB/styles/subsilver2/template/mcp_message.html14
-rw-r--r--phpBB/styles/subsilver2/template/mcp_move.html46
-rw-r--r--phpBB/styles/subsilver2/template/mcp_notes_front.html22
-rw-r--r--phpBB/styles/subsilver2/template/mcp_notes_user.html125
-rw-r--r--phpBB/styles/subsilver2/template/mcp_post.html214
-rw-r--r--phpBB/styles/subsilver2/template/mcp_queue.html76
-rw-r--r--phpBB/styles/subsilver2/template/mcp_reports.html67
-rw-r--r--phpBB/styles/subsilver2/template/mcp_topic.html156
-rw-r--r--phpBB/styles/subsilver2/template/mcp_warn_front.html74
-rw-r--r--phpBB/styles/subsilver2/template/mcp_warn_list.html43
-rw-r--r--phpBB/styles/subsilver2/template/mcp_warn_post.html67
-rw-r--r--phpBB/styles/subsilver2/template/mcp_warn_user.html80
-rw-r--r--phpBB/styles/subsilver2/template/mcp_whois.html15
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_body.html117
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_email.html105
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_group.html17
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_im.html44
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_search.html129
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_team.html50
-rw-r--r--phpBB/styles/subsilver2/template/memberlist_view.html201
-rw-r--r--phpBB/styles/subsilver2/template/message_body.html16
-rw-r--r--phpBB/styles/subsilver2/template/overall_footer.html29
-rw-r--r--phpBB/styles/subsilver2/template/overall_header.html261
-rw-r--r--phpBB/styles/subsilver2/template/pagination.html11
-rw-r--r--phpBB/styles/subsilver2/template/posting_attach_body.html83
-rw-r--r--phpBB/styles/subsilver2/template/posting_body.html430
-rw-r--r--phpBB/styles/subsilver2/template/posting_buttons.html91
-rw-r--r--phpBB/styles/subsilver2/template/posting_poll_body.html37
-rw-r--r--phpBB/styles/subsilver2/template/posting_preview.html71
-rw-r--r--phpBB/styles/subsilver2/template/posting_progress_bar.html44
-rw-r--r--phpBB/styles/subsilver2/template/posting_review.html99
-rw-r--r--phpBB/styles/subsilver2/template/posting_smilies.html38
-rw-r--r--phpBB/styles/subsilver2/template/posting_topic_review.html110
-rw-r--r--phpBB/styles/subsilver2/template/profilefields/bool.html7
-rw-r--r--phpBB/styles/subsilver2/template/profilefields/date.html5
-rw-r--r--phpBB/styles/subsilver2/template/profilefields/dropdown.html5
-rw-r--r--phpBB/styles/subsilver2/template/profilefields/int.html3
-rw-r--r--phpBB/styles/subsilver2/template/profilefields/string.html3
-rw-r--r--phpBB/styles/subsilver2/template/profilefields/text.html3
-rw-r--r--phpBB/styles/subsilver2/template/profilefields/url.html3
-rw-r--r--phpBB/styles/subsilver2/template/quickreply_editor.html29
-rw-r--r--phpBB/styles/subsilver2/template/report_body.html49
-rw-r--r--phpBB/styles/subsilver2/template/search_body.html96
-rw-r--r--phpBB/styles/subsilver2/template/search_results.html164
-rw-r--r--phpBB/styles/subsilver2/template/searchbox.html1
-rw-r--r--phpBB/styles/subsilver2/template/simple_footer.html15
-rw-r--r--phpBB/styles/subsilver2/template/simple_header.html22
-rw-r--r--phpBB/styles/subsilver2/template/timezone.js21
-rw-r--r--phpBB/styles/subsilver2/template/timezone_option.html28
-rw-r--r--phpBB/styles/subsilver2/template/ucp_agreement.html87
-rw-r--r--phpBB/styles/subsilver2/template/ucp_attachments.html58
-rw-r--r--phpBB/styles/subsilver2/template/ucp_auth_link.html19
-rw-r--r--phpBB/styles/subsilver2/template/ucp_auth_link_oauth.html34
-rw-r--r--phpBB/styles/subsilver2/template/ucp_avatar_options_gravatar.html13
-rw-r--r--phpBB/styles/subsilver2/template/ucp_avatar_options_local.html38
-rw-r--r--phpBB/styles/subsilver2/template/ucp_avatar_options_remote.html10
-rw-r--r--phpBB/styles/subsilver2/template/ucp_avatar_options_upload.html12
-rw-r--r--phpBB/styles/subsilver2/template/ucp_footer.html13
-rw-r--r--phpBB/styles/subsilver2/template/ucp_groups_manage.html229
-rw-r--r--phpBB/styles/subsilver2/template/ucp_groups_membership.html93
-rw-r--r--phpBB/styles/subsilver2/template/ucp_header.html165
-rw-r--r--phpBB/styles/subsilver2/template/ucp_login_link.html74
-rw-r--r--phpBB/styles/subsilver2/template/ucp_main_bookmarks.html86
-rw-r--r--phpBB/styles/subsilver2/template/ucp_main_drafts.html96
-rw-r--r--phpBB/styles/subsilver2/template/ucp_main_front.html74
-rw-r--r--phpBB/styles/subsilver2/template/ucp_main_subscribed.html95
-rw-r--r--phpBB/styles/subsilver2/template/ucp_notifications.html141
-rw-r--r--phpBB/styles/subsilver2/template/ucp_pm_history.html86
-rw-r--r--phpBB/styles/subsilver2/template/ucp_pm_message_footer.html47
-rw-r--r--phpBB/styles/subsilver2/template/ucp_pm_message_header.html34
-rw-r--r--phpBB/styles/subsilver2/template/ucp_pm_options.html192
-rw-r--r--phpBB/styles/subsilver2/template/ucp_pm_viewfolder.html131
-rw-r--r--phpBB/styles/subsilver2/template/ucp_pm_viewmessage.html136
-rw-r--r--phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html121
-rw-r--r--phpBB/styles/subsilver2/template/ucp_prefs_personal.html71
-rw-r--r--phpBB/styles/subsilver2/template/ucp_prefs_post.html35
-rw-r--r--phpBB/styles/subsilver2/template/ucp_prefs_view.html77
-rw-r--r--phpBB/styles/subsilver2/template/ucp_profile_autologin_keys.html50
-rw-r--r--phpBB/styles/subsilver2/template/ucp_profile_avatar.html50
-rw-r--r--phpBB/styles/subsilver2/template/ucp_profile_profile_info.html44
-rw-r--r--phpBB/styles/subsilver2/template/ucp_profile_reg_details.html49
-rw-r--r--phpBB/styles/subsilver2/template/ucp_profile_signature.html132
-rw-r--r--phpBB/styles/subsilver2/template/ucp_register.html101
-rw-r--r--phpBB/styles/subsilver2/template/ucp_remind.html28
-rw-r--r--phpBB/styles/subsilver2/template/ucp_resend.html29
-rw-r--r--phpBB/styles/subsilver2/template/ucp_zebra_foes.html28
-rw-r--r--phpBB/styles/subsilver2/template/ucp_zebra_friends.html30
-rw-r--r--phpBB/styles/subsilver2/template/viewforum_body.html374
-rw-r--r--phpBB/styles/subsilver2/template/viewonline_body.html57
-rw-r--r--phpBB/styles/subsilver2/template/viewonline_whois.html12
-rw-r--r--phpBB/styles/subsilver2/template/viewtopic_body.html459
-rw-r--r--phpBB/styles/subsilver2/template/viewtopic_print.html135
-rw-r--r--phpBB/styles/subsilver2/theme/en/button_pm_new.gifbin1135 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/button_pm_reply.gifbin1667 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/button_topic_locked.gifbin1101 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/button_topic_new.gifbin1164 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/button_topic_reply.gifbin1234 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_contact_aim.gifbin580 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_contact_email.gifbin659 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_contact_icq.gifbin574 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_contact_jabber.gifbin674 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_contact_msnm.gifbin1503 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_contact_pm.gifbin706 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_contact_www.gifbin604 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_contact_yahoo.gifbin663 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_post_delete.gifbin314 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_post_edit.gifbin662 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_post_info.gifbin305 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_post_quote.gifbin666 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_post_report.gifbin308 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_user_offline.gifbin547 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_user_online.gifbin520 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_user_profile.gifbin667 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_user_search.gifbin608 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/icon_user_warn.gifbin673 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/en/stylesheet.css116
-rw-r--r--phpBB/styles/subsilver2/theme/images/announce_read.gifbin307 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/announce_read_locked.gifbin304 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/announce_read_locked_mine.gifbin324 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/announce_read_mine.gifbin328 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/announce_unread.gifbin289 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/announce_unread_locked.gifbin292 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/announce_unread_locked_mine.gifbin308 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/announce_unread_mine.gifbin305 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/background.gifbin666 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/cellpic.gifbin722 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/cellpic1.gifbin246 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/cellpic2.jpgbin480 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/cellpic2_rtl.jpgbin601 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/cellpic3.gifbin257 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/created_by.jpgbin15319 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/forum_link.gifbin714 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/forum_read.gifbin677 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/forum_read_locked.gifbin673 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/forum_read_subforum.gifbin705 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/forum_unread.gifbin663 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/forum_unread_locked.gifbin660 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/forum_unread_subforum.gifbin688 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_mini_faq.gifbin219 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_mini_groups.gifbin222 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_mini_login.gifbin233 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_mini_members.gifbin223 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_mini_message.gifbin232 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_mini_notification.gifbin543 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_mini_profile.gifbin238 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_mini_register.gifbin224 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_mini_search.gifbin238 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_post_target.gifbin122 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_post_target_unread.gifbin122 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_topic_attach.gifbin217 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_topic_deleted.pngbin1205 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_topic_latest.gifbin135 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_topic_newest.gifbin133 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_topic_reported.gifbin462 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/icon_topic_unapproved.gifbin334 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/index.htm16
-rw-r--r--phpBB/styles/subsilver2/theme/images/no_avatar.gifbin930 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/poll_center.gifbin92 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/poll_left.gifbin113 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/poll_right.gifbin113 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/site_logo.gifbin7151 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/spacer.gifbin43 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/sticky_read.gifbin344 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/sticky_read_locked.gifbin338 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/sticky_read_locked_mine.gifbin336 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/sticky_read_mine.gifbin352 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/sticky_unread.gifbin325 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/sticky_unread_locked.gifbin324 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/sticky_unread_locked_mine.gifbin336 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/sticky_unread_mine.gifbin339 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_moved.gifbin660 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_read.gifbin344 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_read_hot.gifbin1902 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_read_hot_mine.gifbin1903 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_read_locked.gifbin333 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_read_locked_mine.gifbin337 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_read_mine.gifbin350 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_unread.gifbin336 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_unread_hot.gifbin1888 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_unread_hot_mine.gifbin1895 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_unread_locked.gifbin459 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_unread_locked_mine.gifbin334 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/topic_unread_mine.gifbin350 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/upload_bar.gifbin12892 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/images/whosonline.gifbin929 -> 0 bytes
-rw-r--r--phpBB/styles/subsilver2/theme/stylesheet.css1250
-rw-r--r--phpBB/ucp.php16
-rw-r--r--phpBB/viewforum.php19
-rw-r--r--phpBB/viewonline.php35
-rw-r--r--phpBB/viewtopic.php39
794 files changed, 33963 insertions, 24055 deletions
diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php
index 519f6c8310..7dc8e4b13d 100644
--- a/phpBB/adm/index.php
+++ b/phpBB/adm/index.php
@@ -50,8 +50,8 @@ define('IN_ADMIN', true);
// Some oft used variables
$safe_mode = (@ini_get('safe_mode') == '1' || strtolower(@ini_get('safe_mode')) === 'on') ? true : false;
$file_uploads = (@ini_get('file_uploads') == '1' || strtolower(@ini_get('file_uploads')) === 'on') ? true : false;
-$module_id = request_var('i', '');
-$mode = request_var('mode', '');
+$module_id = $request->variable('i', '');
+$mode = $request->variable('mode', '');
// Set custom style for admin area
$template->set_custom_style(array(
diff --git a/phpBB/adm/style/acp_permissions.html b/phpBB/adm/style/acp_permissions.html
index 6dc9dca2e7..004027df41 100644
--- a/phpBB/adm/style/acp_permissions.html
+++ b/phpBB/adm/style/acp_permissions.html
@@ -327,14 +327,9 @@
<br class="responsive-hide" /><br class="responsive-hide" />
<!-- include tooltip file -->
- <script type="text/javascript" src="style/tooltip.js"></script>
- <script type="text/javascript">
- // <![CDATA[
- window.onload = function(){enable_tooltips_select('set-permissions', '{LA_ROLE_DESCRIPTION}', 'role')};
- // ]]>
- </script>
-
- <form id="set-permissions" method="post" action="{U_ACTION}">
+ <!-- INCLUDEJS tooltip.js -->
+
+ <form id="set-permissions" method="post" action="{U_ACTION}" data-role-description="{L_ROLE_DESCRIPTION}">
{S_HIDDEN_FIELDS}
diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css
index 396b21e3eb..23bd563ba0 100644
--- a/phpBB/adm/style/admin.css
+++ b/phpBB/adm/style/admin.css
@@ -1780,7 +1780,7 @@ li.pagination ul {
/* Action Highlighting
---------------------------------------- */
-.successbox, .errorbox {
+.successbox, .errorbox, .warningbox {
padding: 8px;
margin: 10px 0;
color: #FFFFFF;
@@ -1804,6 +1804,10 @@ li.pagination ul {
background-color: #BC2A4D;
}
+.warningbox {
+ background-color: #fca600;
+}
+
.successbox h3, .errorbox h3 {
color: #FFFFFF;
margin: 0 0 0.5em;
@@ -1862,6 +1866,7 @@ li.pagination ul {
color: #000;
text-align: center;
border: 1px solid #AAA;
+ opacity: .95;
}
.tooltip span.top {
@@ -2439,6 +2444,39 @@ fieldset.permissions .padding {
display: none !important;
}
+.roles-options > .dropdown {
+ left: auto;
+ top: 3em;
+ width: 250px;
+}
+
+.roles-options {
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ -o-user-select: none;
+ user-select: none;
+ width: 250px;
+}
+
+.roles-options > span {
+ border: 1px solid #DEDEDE;
+ border-radius: 3px;
+ padding: 4px;
+ width: 250px;
+ display: block;
+ background: url('../images/arrow_down.gif') no-repeat 245px .7em;
+}
+
+.roles-options li {
+ list-style: none;
+}
+
+.roles-highlight {
+ background-color: #1e90ff;
+ color: #fff;
+}
+
/* Classes for additional tasks
---------------------------------------- */
@@ -2487,3 +2525,30 @@ fieldset.permissions .padding {
clear: both;
display: block;
}
+
+#progress-bar {
+ position: relative;
+ width: 90%;
+ height: 25px;
+ margin: 20px auto;
+ border: 1px solid #cecece;
+}
+
+#progress-bar #progress-bar-text {
+ position: absolute;
+ top: 0;
+ width: 100%;
+ text-align: center;
+ line-height: 25px;
+ font-weight: bold;
+}
+
+#progress-bar #progress-bar-filler {
+ display: block;
+ position: relative;
+ top: 0;
+ left: 0;
+ background-color: #3c84ad;
+ width: 0;
+ height: 25px;
+}
diff --git a/phpBB/adm/style/installer_footer.html b/phpBB/adm/style/installer_footer.html
new file mode 100644
index 0000000000..617d3dc254
--- /dev/null
+++ b/phpBB/adm/style/installer_footer.html
@@ -0,0 +1,21 @@
+ </div>
+ </div><!-- /#main -->
+ </div>
+ </div><!-- /#acp -->
+ </div>
+
+ <div id="page-footer">
+ <div class="copyright">
+ Powered by <a href="https://www.phpbb.com/">phpBB</a>&reg; Forum Software &copy; phpBB Limited
+ </div>
+ </div>
+</div>
+
+<script type="text/javascript" src="{T_JQUERY_LINK}"></script>
+<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
+<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script>
+<!-- INCLUDEJS admin.js -->
+{$SCRIPTS}
+
+</body>
+</html>
diff --git a/phpBB/adm/style/installer_form.html b/phpBB/adm/style/installer_form.html
new file mode 100644
index 0000000000..669f7aa834
--- /dev/null
+++ b/phpBB/adm/style/installer_form.html
@@ -0,0 +1,56 @@
+<form id="<!-- IF FORM_ID -->{FORM_ID}<!-- ELSE -->install_install<!-- ENDIF -->" method="POST" action="{U_ACTION}">
+<!-- IF .options -->
+<!-- IF S_FORM_ELEM_COUNT > 1 -->
+<fieldset>
+<!-- ENDIF -->
+
+ <!-- BEGIN options -->
+ <!-- IF options.S_LEGEND -->
+ <!-- IF not options.S_FIRST_ROW -->
+ </fieldset>
+
+ <fieldset>
+ <!-- ENDIF -->
+ <legend>{options.LEGEND}</legend>
+ <!-- ELSE -->
+
+ <!-- IF options.TYPE <> 'submit' -->
+ <dl>
+ <dt><label for="{options.KEY}">{options.TITLE}{L_COLON}</label><!-- IF options.S_EXPLAIN --><br /><span class="explain">{options.TITLE_EXPLAIN}</span><!-- ENDIF --></dt>
+ <dd>
+ <!-- IF options.TYPE == 'text' -->
+ <input type="text" name="{options.KEY}" value="{options.DEFAULT}" />
+ <!-- ENDIF -->
+ <!-- IF options.TYPE == 'email' -->
+ <input type="email" name="{options.KEY}" value="{options.DEFAULT}" />
+ <!-- ENDIF -->
+ <!-- IF options.TYPE == 'password' -->
+ <input type="password" name="{options.KEY}" />
+ <!-- ENDIF -->
+ <!-- IF options.TYPE == 'select' -->
+ <select name="{options.KEY}">
+ <!-- BEGIN options.OPTIONS -->
+ <option value="{options.OPTIONS.value}"<!-- IF options.OPTIONS.selected --> selected<!-- ENDIF -->>{options.OPTIONS.label}</option>
+ <!-- END options.OPTIONS -->
+ </select>
+ <!-- ENDIF -->
+ <!-- IF options.TYPE == 'radio' -->
+ <!-- BEGIN options.OPTIONS -->
+ <input type="radio" name="{options.KEY}" value="{options.OPTIONS.value}" <!-- IF options.OPTIONS.selected -->checked<!-- ENDIF --> /> {options.OPTIONS.label}
+ <!-- END options.OPTIONS -->
+ <!-- ENDIF -->
+ </dd>
+ </dl>
+ <!-- ELSE -->
+<!-- IF S_FORM_ELEM_COUNT > 1 -->
+</fieldset>
+<!-- ENDIF -->
+ <fieldset class="submit-buttons">
+ <legend>{L_SUBMIT}</legend>
+ <input class="button1" type="submit" name="{options.KEY}" value="{options.TITLE}" />
+ </fieldset>
+ <!-- ENDIF -->
+ <!-- ENDIF-->
+ <!-- END options -->
+<!-- ENDIF -->
+</form>
diff --git a/phpBB/adm/style/installer_header.html b/phpBB/adm/style/installer_header.html
new file mode 100644
index 0000000000..775caa7c67
--- /dev/null
+++ b/phpBB/adm/style/installer_header.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<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>
+
+ <link href="{T_TEMPLATE_PATH}/admin.css" rel="stylesheet" type="text/css" media="screen" />
+</head>
+
+<body class="{S_CONTENT_DIRECTION} nojs">
+<div id="wrap">
+ <div id="page-header">
+ <h1>{L_INSTALL_PANEL}</h1>
+ <p id="skip"><a href="#acp">{L_SKIP}</a></p>
+ <!-- IF S_LANG_SELECT -->
+ <form method="post" action="#" id="language_selector">
+ <fieldset class="nobg">
+ <label for="language">{L_SELECT_LANG}{L_COLON}</label>
+ <select id="language" name="language">
+ <!-- BEGIN language_select_item -->
+ <option value="{language_select_item.VALUE}"<!-- IF language_select_item.SELECTED --> selected="selected"<!-- ENDIF -->>{language_select_item.NAME}</option>
+ <!-- END language_select_item -->
+ </select>
+ <input class="button1" type="submit" id="change_lang" name="change_lang" value="{L_CHANGE}" />
+ </fieldset>
+ </form>
+ <!-- ENDIF -->
+ </div>
+
+ <div id="page-body">
+ <div id="tabs">
+ <ul>
+ <!-- BEGIN t_block1 -->
+ <li class="tab<!-- IF t_block1.S_SELECTED --> activetab<!-- ENDIF -->"><a href="{t_block1.U_TITLE}">{t_block1.L_TITLE}</a></li>
+ <!-- END t_block1 -->
+ </ul>
+ </div>
+
+ <div id="acp">
+ <div id="content">
+ <div id="menu">
+ <div class="menu-block no-header">
+ <ul>
+ <!-- BEGIN l_block1 -->
+ <li<!-- IF l_block1.S_SELECTED --> id="activemenu"<!-- ENDIF -->><a href="{l_block1.U_TITLE}"><span>{l_block1.L_TITLE}</span></a></li>
+ <!-- END l_block1 -->
+ <!-- BEGIN l_block2 -->
+ <li<!-- IF l_block2.S_SELECTED --> id="activemenu"<!-- ENDIF -->><span<!-- IF l_block2.S_COMPLETE --> class="completed"<!-- ENDIF --> id="installer-stage-{l_block2.STAGE_NAME}">{l_block2.L_TITLE}</span></li>
+ <!-- END l_block2 -->
+ </ul>
+ </div>
+ </div>
+
+ <div id="main" class="install-body">
+ <div class="main">
diff --git a/phpBB/adm/style/installer_install.html b/phpBB/adm/style/installer_install.html
new file mode 100644
index 0000000000..53a91f2700
--- /dev/null
+++ b/phpBB/adm/style/installer_install.html
@@ -0,0 +1,13 @@
+<!-- INCLUDE installer_header.html -->
+<h1>{TITLE}</h1>
+<p>{CONTENT}</p>
+<!-- IF SHOW_INSTALL_START_FORM -->
+<form id="install_install" method="post" action="{U_ACTION}">
+ <fieldset class="submit-buttons">
+ <legend>{L_SUBMIT}</legend>
+ <input class="button1" name="install" type="submit" value="{L_INSTALL}" />
+ </fieldset>
+</form>
+<!-- ENDIF -->
+<!-- INCLUDEJS {T_ASSETS_PATH}/javascript/installer.js -->
+<!-- INCLUDE installer_footer.html -->
diff --git a/phpBB/adm/style/installer_main.html b/phpBB/adm/style/installer_main.html
new file mode 100644
index 0000000000..f14fe4da70
--- /dev/null
+++ b/phpBB/adm/style/installer_main.html
@@ -0,0 +1,6 @@
+<!-- INCLUDE installer_header.html -->
+
+ <h1>{TITLE}</h1>
+ <p>{BODY}</p>
+
+<!-- INCLUDE installer_footer.html -->
diff --git a/phpBB/adm/style/permission_mask.html b/phpBB/adm/style/permission_mask.html
index 7b5c071693..347da3181e 100644
--- a/phpBB/adm/style/permission_mask.html
+++ b/phpBB/adm/style/permission_mask.html
@@ -39,11 +39,23 @@
</div>
<dl class="permissions-simple">
<dt style="width: 20%"><label for="role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}">{L_ROLE}{L_COLON}</label></dt>
- <!-- IF p_mask.f_mask.S_ROLE_OPTIONS -->
- <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 20%"><select id="role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}" name="role[{p_mask.f_mask.UG_ID}][{p_mask.f_mask.FORUM_ID}]" onchange="set_role_settings(this.options[selectedIndex].value, 'advanced{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}'); init_colours('{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}')">{p_mask.f_mask.S_ROLE_OPTIONS}</select></dd>
- <!-- ELSE -->
+ {% if role_options %}
+ <dd style="margin-{S_CONTENT_FLOW_BEGIN}{L_COLON} 20%">
+ <div class="dropdown-container dropdown-button-control roles-options" data-alt-text="{LA_ROLE_DESCRIPTION}">
+ <span title="Roles" class="button icon-button tools-icon dropdown-trigger dropdown-select">{L_NO_ROLE_ASSIGNED}</span>
+ <div class="dropdown hidden">
+ <ul class="dropdown-contents" id="role{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}" >
+ {% for role in loops.role_options %}
+ <li data-id="{{ role.ID }}" data-target-id="advanced{p_mask.S_ROW_COUNT}{p_mask.f_mask.S_ROW_COUNT}" data-title="{{ role.TITLE }}"{% if role.SELECTED == true %} data-selected="{{ role.SELECTED }}"{% endif %}>{{ role.ROLE_NAME }}</li>
+ {% endfor %}
+ </ul>
+ </div>
+ <input type="hidden" name="role[{p_mask.f_mask.UG_ID}][{p_mask.f_mask.FORUM_ID}]"{% if S_ROLE_ID %}value="{{ S_ROLE_ID }}"{% endif %} />
+ </div>
+ </dd>
+ {% else %}
<dd>{L_NO_ROLE_AVAILABLE}</dd>
- <!-- ENDIF -->
+ {% endif %}
</dl>
<!-- ENDIF -->
diff --git a/phpBB/adm/style/tooltip.js b/phpBB/adm/style/tooltip.js
index 3a89008706..68964034f0 100644
--- a/phpBB/adm/style/tooltip.js
+++ b/phpBB/adm/style/tooltip.js
@@ -10,206 +10,196 @@ phpBB Development Team:
- further adjustements
*/
-var head_text, tooltip_mode;
+(function($) { // Avoid conflicts with other libraries
-/**
-* Enable tooltip replacements for links
-*/
-function enable_tooltips_link(id, headline, sub_id) {
- var links, i, hold;
-
- head_text = headline;
-
- if (!document.getElementById || !document.getElementsByTagName) {
- return;
- }
-
- hold = document.createElement('span');
- hold.id = '_tooltip_container';
- hold.setAttribute('id', '_tooltip_container');
- hold.style.position = 'absolute';
+'use strict';
- document.getElementsByTagName('body')[0].appendChild(hold);
-
- if (id === null) {
- links = document.getElementsByTagName('a');
- } else {
- links = document.getElementById(id).getElementsByTagName('a');
- }
-
- for (i = 0; i < links.length; i++) {
- if (sub_id) {
- if (links[i].id.substr(0, sub_id.length) === sub_id) {
- prepare(links[i]);
- }
- } else {
- prepare(links[i]);
- }
- }
-
- tooltip_mode = 'link';
-}
+var tooltips = [];
/**
-* Enable tooltip replacements for selects
+ * Enable tooltip replacements for selects
+ * @param {string} id ID tag of select
+ * @param {string} headline Text that should appear on top of tooltip
+ * @param {string} [subId] Sub ID that should only be using tooltips (optional)
*/
-function enable_tooltips_select(id, headline, sub_id) {
- var links, i, hold;
-
- head_text = headline;
-
- if (!document.getElementById || !document.getElementsByTagName) {
- return;
- }
+phpbb.enableTooltipsSelect = function (id, headline, subId) {
+ var $links, hold;
- hold = document.createElement('span');
- hold.id = '_tooltip_container';
- hold.setAttribute('id', '_tooltip_container');
- hold.style.position = 'absolute';
+ hold = $('<span />', {
+ id: '_tooltip_container',
+ css: {
+ position: 'absolute'
+ }
+ });
- document.getElementsByTagName('body')[0].appendChild(hold);
+ $('body').append(hold);
- if (id === null) {
- links = document.getElementsByTagName('option');
+ if (!id) {
+ $links = $('.roles-options li');
} else {
- links = document.getElementById(id).getElementsByTagName('option');
+ $links = $('.roles-options li', '#' + id);
}
- for (i = 0; i < links.length; i++) {
- if (sub_id) {
- if (links[i].parentNode.id.substr(0, sub_id.length) === sub_id) {
- prepare(links[i]);
+ $links.each(function () {
+ var $this = $(this);
+
+ if (subId) {
+ if ($this.parent().attr('id').substr(0, subId.length) === subId) {
+ phpbb.prepareTooltips($this, headline);
}
} else {
- prepare(links[i]);
+ phpbb.prepareTooltips($this, headline);
}
- }
-
- tooltip_mode = 'select';
-}
+ });
+};
/**
-* Prepare elements to replace
+ * Prepare elements to replace
+ *
+ * @param {jQuery} $element Element to prepare for tooltips
+ * @param {string} headText Text heading to display
*/
-function prepare(element) {
- var tooltip, text, desc, title;
+phpbb.prepareTooltips = function ($element, headText) {
+ var $tooltip, text, $desc, $title;
- text = element.getAttribute('title');
+ text = $element.attr('data-title');
if (text === null || text.length === 0) {
return;
}
- element.removeAttribute('title');
- tooltip = create_element('span', 'tooltip');
-
- title = create_element('span', 'top');
- title.appendChild(document.createTextNode(head_text));
- tooltip.appendChild(title);
-
- desc = create_element('span', 'bottom');
- desc.innerHTML = text;
- tooltip.appendChild(desc);
-
- set_opacity(tooltip);
+ $title = $('<span />', {
+ class: 'top',
+ css: {
+ display: 'block'
+ }
+ })
+ .append(document.createTextNode(headText));
+
+ $desc = $('<span />', {
+ class: 'bottom',
+ html: text,
+ css: {
+ display: 'block'
+ }
+ });
- element.tooltip = tooltip;
- element.onmouseover = show_tooltip;
- element.onmouseout = hide_tooltip;
+ $tooltip = $('<span />', {
+ class: 'tooltip',
+ css: {
+ display: 'block'
+ }
+ })
+ .append($title)
+ .append($desc);
- if (tooltip_mode === 'link') {
- element.onmousemove = locate;
- }
-}
+ tooltips[$element.attr('data-id')] = $tooltip;
+ $element.on('mouseover', phpbb.showTooltip);
+ $element.on('mouseout', phpbb.hideTooltip);
+};
/**
-* Show tooltip
+ * Show tooltip
+ *
+ * @param {object} $element Element passed by .on()
*/
-function show_tooltip(e) {
- document.getElementById('_tooltip_container').appendChild(this.tooltip);
- locate(this);
-}
+phpbb.showTooltip = function ($element) {
+ var $this = $($element.target);
+ $('#_tooltip_container').append(tooltips[$this.attr('data-id')]);
+ phpbb.positionTooltip($this);
+};
/**
-* Hide tooltip
+ * Hide tooltip
*/
-function hide_tooltip(e) {
+phpbb.hideTooltip = function () {
var d = document.getElementById('_tooltip_container');
if (d.childNodes.length > 0) {
d.removeChild(d.firstChild);
}
-}
+};
/**
-* Set opacity on tooltip element
+ * Correct positioning of tooltip container
+ *
+ * @param {jQuery} $element Tooltip element that should be positioned
*/
-function set_opacity(element) {
- element.style.filter = 'alpha(opacity:95)';
- element.style.KHTMLOpacity = '0.95';
- element.style.MozOpacity = '0.95';
- element.style.opacity = '0.95';
-}
+phpbb.positionTooltip = function ($element) {
+ var offset;
-/**
-* Create new element
-*/
-function create_element(tag, c) {
- var x = document.createElement(tag);
- x.className = c;
- x.style.display = 'block';
- return x;
-}
-
-/**
-* Correct positioning of tooltip container
-*/
-function locate(e) {
- var posx = 0;
- var posy = 0;
+ $element = $element.parent();
+ offset = $element.offset();
- e = e.parentNode;
+ $('#_tooltip_container').css({
+ top: offset.top + 30,
+ left: offset.left - 205
+ });
+};
- if (e.offsetParent) {
- for (posx = 0, posy = 0; e.offsetParent; e = e.offsetParent) {
- posx += e.offsetLeft;
- posy += e.offsetTop;
+/**
+ * Prepare roles drop down select
+ */
+phpbb.prepareRolesDropdown = function () {
+ var $options = $('.roles-options li');
+ var $rolesOptions = $options.closest('.roles-options');
+ var $span = $rolesOptions.children('span');
+
+ // Prepare highlighting of select options and settings update
+ $options.each(function () {
+ var $this = $(this);
+
+ // Correctly show selected option
+ if (typeof $this.attr('data-selected') !== 'undefined') {
+ $rolesOptions.closest('.roles-options')
+ .children('span')
+ .text($this.text())
+ .attr('data-default', $this.text())
+ .attr('data-default-val', $this.attr('data-id'));
}
- } else {
- posx = e.offsetLeft;
- posy = e.offsetTop;
- }
- if (tooltip_mode === 'link') {
- document.getElementById('_tooltip_container').style.top=(posy+20) + 'px';
- document.getElementById('_tooltip_container').style.left=(posx-20) + 'px';
- } else {
- document.getElementById('_tooltip_container').style.top=(posy+30) + 'px';
- document.getElementById('_tooltip_container').style.left=(posx-205) + 'px';
+ $this.on('mouseover', function () {
+ var $this = $(this);
+ $options.removeClass('roles-highlight');
+ $this.addClass('roles-highlight');
+ }).on('click', function () {
+ var $this = $(this);
+
+ // Update settings
+ set_role_settings($this.attr('data-id'), $this.attr('data-target-id'));
+ init_colours($this.attr('data-target-id').replace('advanced', ''));
+
+ // Set selected setting
+ $rolesOptions.children('span')
+ .text($this.text());
+ $rolesOptions.children('input[type=hidden]')
+ .val($this.attr('data-id'));
+
+ // Trigger hiding of selection options
+ $('body').trigger('click');
+ });
+ });
+
+ // Save default text of drop down if there is no default set yet
+ if (typeof $span.attr('data-default') === 'undefined') {
+ $span.attr('data-default', $span.text());
}
-/*
- if (e == null)
- {
- e = window.event;
- }
+ // Prepare resetting drop down on form reset
+ $options.closest('form').on('reset', function () {
+ $span.text($span.attr('data-default'));
+ $rolesOptions.children('input[type=hidden]')
+ .val($span.attr('data-id'));
+ });
- if (e.pageX || e.pageY)
- {
- posx = e.pageX;
- posy = e.pageY;
- }
- else if (e.clientX || e.clientY)
- {
- if (document.documentElement.scrollTop)
- {
- posx = e.clientX+document.documentElement.scrollLeft;
- posy = e.clientY+document.documentElement.scrollTop;
- }
- else
- {
- posx = e.clientX+document.body.scrollLeft;
- posy = e.clientY+document.body.scrollTop;
- }
- }
-*/
-}
+};
+
+// Run onload functions for RolesDropdown and tooltips
+$(function() {
+ // Enable tooltips
+ phpbb.enableTooltipsSelect('set-permissions', $('#set-permissions').attr('data-role-description'), 'role');
+
+ // Prepare dropdown
+ phpbb.prepareRolesDropdown();
+});
+
+})(jQuery); // Avoid conflicts with other libraries
diff --git a/phpBB/app.php b/phpBB/app.php
index d9250adc75..4873fb10c3 100644
--- a/phpBB/app.php
+++ b/phpBB/app.php
@@ -21,14 +21,16 @@ define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
-include($phpbb_root_path . 'includes/functions_url_matcher.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('app');
+/* @var $http_kernel \Symfony\Component\HttpKernel\HttpKernel */
$http_kernel = $phpbb_container->get('http_kernel');
+
+/* @var $symfony_request \phpbb\symfony_request */
$symfony_request = $phpbb_container->get('symfony_request');
$response = $http_kernel->handle($symfony_request);
$response->send();
diff --git a/phpBB/assets/javascript/editor.js b/phpBB/assets/javascript/editor.js
index 298526ab1f..df353bc29d 100644
--- a/phpBB/assets/javascript/editor.js
+++ b/phpBB/assets/javascript/editor.js
@@ -111,7 +111,6 @@ function bbfontstyle(bbopen, bbclose) {
}
textarea.focus();
- return;
}
/**
@@ -167,7 +166,7 @@ function attachInline(index, filename) {
/**
* Add quote text to message
*/
-function addquote(post_id, username, l_wrote) {
+function addquote(post_id, username, l_wrote, attributes) {
var message_name = 'message_' + post_id;
var theSelection = '';
var divarea = false;
@@ -177,6 +176,9 @@ function addquote(post_id, username, l_wrote) {
// Backwards compatibility
l_wrote = 'wrote';
}
+ if (typeof attributes !== 'object') {
+ attributes = {};
+ }
if (document.all) {
divarea = document.all[message_name];
@@ -213,7 +215,8 @@ function addquote(post_id, username, l_wrote) {
if (theSelection) {
if (bbcodeEnabled) {
- insert_text('[quote="' + username + '"]' + theSelection + '[/quote]');
+ attributes.author = username;
+ insert_text(generateQuote(theSelection, attributes));
} else {
insert_text(username + ' ' + l_wrote + ':' + '\n');
var lines = split_lines(theSelection);
@@ -222,8 +225,61 @@ function addquote(post_id, username, l_wrote) {
}
}
}
+}
- return;
+/**
+* Create a quote block for given text
+*
+* Possible attributes:
+* - author: author's name (usually a username)
+* - post_id: post_id of the post being quoted
+* - user_id: user_id of the user being quoted
+* - time: timestamp of the original message
+*
+* @param {!string} text Quote's text
+* @param {!Object} attributes Quote's attributes
+* @return {!string} Quote block to be used in a new post/text
+*/
+function generateQuote(text, attributes) {
+ text = text.replace(/^\s+/, '').replace(/\s+$/, '');
+ var quote = '[quote';
+ if (attributes.author) {
+ // Add the author as the BBCode's default attribute
+ quote += '=' + formatAttributeValue(attributes.author);
+ delete attributes.author;
+ }
+ for (var name in attributes) {
+ if (attributes.hasOwnProperty(name)) {
+ var value = attributes[name];
+ quote += ' ' + name + '=' + formatAttributeValue(value.toString());
+ }
+ }
+ quote += ']';
+ var newline = ((quote + text + '[/quote]').length > 80 || text.indexOf('\n') > -1) ? '\n' : '';
+ quote += newline + text + newline + '[/quote]';
+
+ return quote;
+}
+
+/**
+* Format given string to be used as an attribute value
+*
+* Will return the string as-is if it can be used in a BBCode without quotes. Otherwise,
+* it will use either single- or double- quotes depending on whichever requires less escaping.
+* Quotes and backslashes are escaped with backslashes where necessary
+*
+* @param {!string} str Original string
+* @return {!string} Same string if possible, escaped string within quotes otherwise
+*/
+function formatAttributeValue(str) {
+ if (!/[ "'\\\]]/.test(str)) {
+ // Return as-is if it contains none of: space, ' " \ or ]
+ return str;
+ }
+ var singleQuoted = "'" + str.replace(/[\\']/g, '\\$&') + "'",
+ doubleQuoted = '"' + str.replace(/[\\"]/g, '\\$&') + '"';
+
+ return (singleQuoted.length < doubleQuoted.length) ? singleQuoted : doubleQuoted;
}
function split_lines(text) {
diff --git a/phpBB/assets/javascript/installer.js b/phpBB/assets/javascript/installer.js
new file mode 100644
index 0000000000..56bfd6aea9
--- /dev/null
+++ b/phpBB/assets/javascript/installer.js
@@ -0,0 +1,400 @@
+/**
+ * Installer's AJAX frontend handler
+ */
+
+(function($) { // Avoid conflicts with other libraries
+ 'use strict';
+
+ // Installer variables
+ var pollTimer = null;
+ var nextReadPosition = 0;
+ var progressBarTriggered = false;
+ var progressTimer = null;
+ var currentProgress = 0;
+
+ // Template related variables
+ var $contentWrapper = $('.install-body').find('.main');
+
+ // Intercept form submits
+ interceptFormSubmit($('#install_install'));
+
+ /**
+ * Creates an XHR object
+ *
+ * jQuery cannot be used as the response is streamed, and
+ * as of now, jQuery does not provide access to the response until
+ * the connection is not closed.
+ *
+ * @return XMLHttpRequest
+ */
+ function createXhrObject() {
+ return new XMLHttpRequest();
+ }
+
+ /**
+ * Displays error, warning and log messages
+ *
+ * @param type
+ * @param messages
+ */
+ function addMessage(type, messages) {
+ // Get message containers
+ var $errorContainer = $('#error-container');
+ var $warningContainer = $('#warning-container');
+ var $logContainer = $('#log-container');
+
+ var $title, $description, $msgElement, arraySize = messages.length;
+ for (var i = 0; i < arraySize; i++) {
+ $msgElement = $('<div />');
+ $title = $('<strong />');
+ $title.text(messages[i].title);
+ $msgElement.append($title);
+
+ if (messages[i].hasOwnProperty('description')) {
+ $description = $('<p />');
+ $description.html(messages[i].description);
+ $msgElement.append($description);
+ }
+
+ switch (type) {
+ case 'error':
+ $msgElement.addClass('errorbox');
+ $errorContainer.append($msgElement);
+ break;
+ case 'warning':
+ $msgElement.addClass('warningbox');
+ $warningContainer.append($msgElement);
+ break;
+ case 'log':
+ $msgElement.addClass('log');
+ $logContainer.append($msgElement);
+ break;
+ case 'success':
+ $msgElement.addClass('successbox');
+ $errorContainer.prepend($msgElement);
+ break;
+ }
+ }
+ }
+
+ /**
+ * Displays a form from the response
+ *
+ * @param formHtml
+ */
+ function addForm(formHtml) {
+ var $formContainer = $('#content-container');
+ $formContainer.html(formHtml);
+ var $form = $('#install_install');
+ interceptFormSubmit($form);
+ }
+
+ /**
+ * Handles navigation status updates
+ *
+ * @param navObj
+ */
+ function updateNavbarStatus(navObj) {
+ var navID, $stage, $stageListItem, $active;
+ $active = $('#activemenu');
+
+ if (navObj.hasOwnProperty('finished')) {
+ // This should be an Array
+ var navItems = navObj.finished;
+
+ for (var i = 0; i < navItems.length; i++) {
+ navID = 'installer-stage-' + navItems[i];
+ $stage = $('#' + navID);
+ $stageListItem = $stage.parent();
+
+ if ($active.length && $active.is($stageListItem)) {
+ $active.removeAttr('id');
+ }
+
+ $stage.addClass('completed');
+ }
+ }
+
+ if (navObj.hasOwnProperty('active')) {
+ navID = 'installer-stage-' + navObj.active;
+ $stage = $('#' + navID);
+ $stageListItem = $stage.parent();
+
+ if ($active.length && !$active.is($stageListItem)) {
+ $active.removeAttr('id');
+ }
+
+ $stageListItem.attr('id', 'activemenu');
+ }
+ }
+
+ /**
+ * Renders progress bar
+ *
+ * @param progressObject
+ */
+ function setProgress(progressObject) {
+ var $statusText, $progressBar, $progressText, $progressFiller;
+
+ if (progressObject.task_name.length) {
+ if (!progressBarTriggered) {
+ // Create progress bar
+ var $contentContainer = $('#content-container');
+
+ // Create progress bar elements
+ $progressBar = $('<div />');
+ $progressBar.attr('id', 'progress-bar');
+ $progressText = $('<p />');
+ $progressText.attr('id', 'progress-bar-text');
+ $progressFiller = $('<span />');
+ $progressFiller.attr('id', 'progress-bar-filler');
+
+ $statusText = $('<p />');
+ $statusText.attr('id', 'progress-status-text');
+
+ $progressBar.append($progressFiller);
+ $progressBar.append($progressText);
+
+ $contentContainer.append($statusText);
+ $contentContainer.append($progressBar);
+
+ progressBarTriggered = true;
+ } else {
+ $statusText = $('#progress-status-text');
+ }
+
+ // Update progress bar
+ $statusText.text(progressObject.task_name + '…');
+ incrementProgressBar(Math.round(progressObject.task_num / progressObject.task_count * 100));
+ }
+ }
+
+ // Set cookies
+ function setCookies(cookies) {
+ var cookie;
+
+ for (var i = 0; i < cookies.length; i++) {
+ // Set cookie name and value
+ cookie = encodeURIComponent(cookies[i].name) + '=' + encodeURIComponent(cookies[i].value);
+ // Set path
+ cookie += '; path=/';
+ document.cookie = cookie;
+ }
+ }
+
+ /**
+ * Parse messages from the response object
+ *
+ * @param messageJSON
+ */
+ function parseMessage(messageJSON) {
+ $('#loading_indicator').css('display', 'none');
+
+ var responseObject = JSON.parse(messageJSON);
+
+ // Parse object
+ if (responseObject.hasOwnProperty('errors')) {
+ addMessage('error', responseObject.errors);
+ }
+
+ if (responseObject.hasOwnProperty('warnings')) {
+ addMessage('warning', responseObject.warnings);
+ }
+
+ if (responseObject.hasOwnProperty('logs')) {
+ addMessage('log', responseObject.logs);
+ }
+
+ if (responseObject.hasOwnProperty('success')) {
+ addMessage('success', responseObject.success);
+ }
+
+ if (responseObject.hasOwnProperty('form')) {
+ addForm(responseObject.form);
+ }
+
+ if (responseObject.hasOwnProperty('progress')) {
+ setProgress(responseObject.progress);
+ }
+
+ if (responseObject.hasOwnProperty('nav')) {
+ updateNavbarStatus(responseObject.nav);
+ }
+
+ if (responseObject.hasOwnProperty('cookies')) {
+ setCookies(responseObject.cookies);
+ }
+ }
+
+ /**
+ * Process updates in streamed response
+ *
+ * @param xhReq XHR object
+ */
+ function pollContent(xhReq) {
+ var messages = xhReq.responseText;
+ var msgSeparator = '}\n\n';
+ var unprocessed, messageEndIndex, endOfMessageIndex, message;
+
+ do {
+ unprocessed = messages.substring(nextReadPosition);
+ messageEndIndex = unprocessed.indexOf(msgSeparator);
+
+ if (messageEndIndex !== -1) {
+ endOfMessageIndex = messageEndIndex + msgSeparator.length;
+ message = unprocessed.substring(0, endOfMessageIndex);
+ parseMessage(message);
+ nextReadPosition += endOfMessageIndex;
+ }
+ } while (messageEndIndex !== -1);
+
+ if (xhReq.readyState === 4) {
+ $('#loading_indicator').css('display', 'none');
+ resetPolling();
+ }
+ }
+
+ /**
+ * Animates the progress bar
+ *
+ * @param $progressText
+ * @param $progressFiller
+ * @param progressLimit
+ */
+ function incrementFiller($progressText, $progressFiller, progressLimit) {
+ if (currentProgress >= progressLimit || currentProgress >= 100) {
+ clearInterval(progressTimer);
+ return;
+ }
+
+ currentProgress++;
+ $progressText.text(currentProgress + '%');
+ $progressFiller.css('width', currentProgress + '%');
+ }
+
+ /**
+ * Wrapper function for progress bar rendering and animating
+ *
+ * @param progressLimit
+ */
+ function incrementProgressBar(progressLimit) {
+ var $progressFiller = $('#progress-bar-filler');
+ var $progressText = $('#progress-bar-text');
+ var progressStart = $progressFiller.width() / $progressFiller.offsetParent().width() * 100;
+ currentProgress = Math.floor(progressStart);
+
+ clearInterval(progressTimer);
+ progressTimer = setInterval(function() {
+ incrementFiller($progressText, $progressFiller, progressLimit);
+ }, 10);
+ }
+
+ /**
+ * Resets the polling timer
+ */
+ function resetPolling() {
+ clearInterval(pollTimer);
+ nextReadPosition = 0;
+ }
+
+ /**
+ * Sets up timer for processing the streamed HTTP response
+ *
+ * @param xhReq
+ */
+ function startPolling(xhReq) {
+ resetPolling();
+ pollTimer = setInterval(function () {
+ pollContent(xhReq);
+ }, 250);
+ }
+
+ /**
+ * Renders the AJAX UI layout
+ */
+ function setupAjaxLayout() {
+ // Clear content
+ $contentWrapper.html('');
+
+ var $header = $('<div />');
+ $header.attr('id', 'header-container');
+ $contentWrapper.append($header);
+
+ var $description = $('<div />');
+ $description.attr('id', 'description-container');
+ $contentWrapper.append($description);
+
+ var $errorContainer = $('<div />');
+ $errorContainer.attr('id', 'error-container');
+ $contentWrapper.append($errorContainer);
+
+ var $warningContainer = $('<div />');
+ $warningContainer.attr('id', 'warning-container');
+ $contentWrapper.append($warningContainer);
+
+ var $installerContentWrapper = $('<div />');
+ $installerContentWrapper.attr('id', 'content-container');
+ $contentWrapper.append($installerContentWrapper);
+
+ var $logContainer = $('<div />');
+ $logContainer.attr('id', 'log-container');
+ $contentWrapper.append($logContainer);
+
+ var $spinner = $('<div />');
+ $spinner.attr('id', 'loading_indicator');
+ $spinner.html('&nbsp;');
+ $contentWrapper.append($spinner);
+ }
+
+ // Submits a form
+ function submitForm($form, $submitBtn) {
+ $form.css('display', 'none');
+
+ var xhReq = createXhrObject();
+ xhReq.open('POST', $form.attr('action'), true);
+ xhReq.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
+ xhReq.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
+ xhReq.send(getFormFields($form, $submitBtn));
+
+ // Disable language selector
+ $('#language_selector :input, label').css('display', 'none');
+
+ // Clear content
+ setupAjaxLayout();
+ $('#loading_indicator').css('display', 'block');
+
+ startPolling(xhReq);
+ }
+
+ /**
+ * Add submit button to the POST information
+ *
+ * @param $form
+ * @param $submitBtn
+ *
+ * @returns {*}
+ */
+ function getFormFields($form, $submitBtn) {
+ var formData = $form.serialize();
+ formData += ((formData.length) ? '&' : '') + encodeURIComponent($submitBtn.attr('name')) + '=';
+ formData += encodeURIComponent($submitBtn.attr('value'));
+
+ return formData;
+ }
+
+ /**
+ * Intercept form submit events and determine the submit button used
+ *
+ * @param $form
+ */
+ function interceptFormSubmit($form) {
+ if (!$form.length) {
+ return;
+ }
+
+ $form.find(':submit').bind('click', function (event) {
+ event.preventDefault();
+ submitForm($form, $(this));
+ });
+ }
+})(jQuery); // Avoid conflicts with other libraries
diff --git a/phpBB/bin/phpbbcli.php b/phpBB/bin/phpbbcli.php
index ca425ad0c4..e5992f7536 100755
--- a/phpBB/bin/phpbbcli.php
+++ b/phpBB/bin/phpbbcli.php
@@ -21,6 +21,7 @@ if (php_sapi_name() != 'cli')
}
define('IN_PHPBB', true);
+
$phpbb_root_path = __DIR__ . '/../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
require($phpbb_root_path . 'includes/startup.' . $phpEx);
@@ -32,36 +33,49 @@ $phpbb_class_loader->register();
$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);
extract($phpbb_config_php_file->get_all());
+if (!defined('PHPBB_ENVIRONMENT'))
+{
+ @define('PHPBB_ENVIRONMENT', 'production');
+}
+
require($phpbb_root_path . 'includes/constants.' . $phpEx);
require($phpbb_root_path . 'includes/functions.' . $phpEx);
require($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
-$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
-$phpbb_container_builder->set_dump_container(false);
+$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_root_path, $phpEx);
+$phpbb_container = $phpbb_container_builder->with_config($phpbb_config_php_file);
$input = new ArgvInput();
+if ($input->hasParameterOption(array('--env')))
+{
+ $phpbb_container_builder->with_environment($input->getParameterOption('--env'));
+}
+
if ($input->hasParameterOption(array('--safe-mode')))
{
- $phpbb_container_builder->set_use_extensions(false);
- $phpbb_container_builder->set_dump_container(false);
+ $phpbb_container_builder->without_extensions();
+ $phpbb_container_builder->without_cache();
}
else
{
$phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx);
$phpbb_class_loader_ext->register();
- phpbb_load_extensions_autoloaders($phpbb_root_path);
}
$phpbb_container = $phpbb_container_builder->get_container();
$phpbb_container->get('request')->enable_super_globals();
require($phpbb_root_path . 'includes/compatibility_globals.' . $phpEx);
+/* @var $user \phpbb\user */
$user = $phpbb_container->get('user');
$user->add_lang('acp/common');
$user->add_lang('cli');
-$application = new \phpbb\console\application('phpBB Console', PHPBB_VERSION, $user);
+/* @var $lang \phpbb\language\language */
+$lang = $phpbb_container->get('language');
+
+$application = new \phpbb\console\application('phpBB Console', PHPBB_VERSION, $lang);
$application->register_container_commands($phpbb_container->get('console.command_collection'));
$application->run($input);
diff --git a/phpBB/common.php b/phpBB/common.php
index 0782bd7321..0b898d9553 100644
--- a/phpBB/common.php
+++ b/phpBB/common.php
@@ -12,7 +12,7 @@
*/
/**
-* Minimum Requirement: PHP 5.3.3
+* Minimum Requirement: PHP 5.3.9
*/
if (!defined('IN_PHPBB'))
@@ -29,6 +29,11 @@ $phpbb_class_loader->register();
$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);
extract($phpbb_config_php_file->get_all());
+if (!defined('PHPBB_ENVIRONMENT'))
+{
+ @define('PHPBB_ENVIRONMENT', 'production');
+}
+
if (!defined('PHPBB_INSTALLED'))
{
// Redirect the user to the installer
@@ -54,7 +59,7 @@ if (!defined('PHPBB_INSTALLED'))
// Eliminate . and .. from the path
require($phpbb_root_path . 'phpbb/filesystem.' . $phpEx);
- $phpbb_filesystem = new phpbb\filesystem();
+ $phpbb_filesystem = new phpbb\filesystem\filesystem();
$script_path = $phpbb_filesystem->clean_path($script_path);
$url = (($secure) ? 'https://' : 'http://') . $server_name;
@@ -91,11 +96,19 @@ set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handle
$phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx);
$phpbb_class_loader_ext->register();
-phpbb_load_extensions_autoloaders($phpbb_root_path);
-
// Set up container
-$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
-$phpbb_container = $phpbb_container_builder->get_container();
+try
+{
+ $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_root_path, $phpEx);
+ $phpbb_container = $phpbb_container_builder->with_config($phpbb_config_php_file)->get_container();
+}
+catch (InvalidArgumentException $e)
+{
+ trigger_error(
+ 'The requested environment ' . PHPBB_ENVIRONMENT . ' is not available.',
+ E_USER_ERROR
+ );
+}
$phpbb_class_loader->set_cache($phpbb_container->get('cache.driver'));
$phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver'));
@@ -105,6 +118,8 @@ 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('template', 'display')));
+
+/* @var $phpbb_hook_finder \phpbb\hook\finder */
$phpbb_hook_finder = $phpbb_container->get('hook_finder');
foreach ($phpbb_hook_finder->find() as $hook)
diff --git a/phpBB/composer.json b/phpBB/composer.json
index af1cd2b329..70319fe3fb 100644
--- a/phpBB/composer.json
+++ b/phpBB/composer.json
@@ -25,15 +25,23 @@
"phpbb/phpbb-core": "self.version"
},
"require": {
- "php": ">=5.3.3",
"lusitanian/oauth": "0.2.*",
- "symfony/config": "2.3.*",
- "symfony/console": "2.3.*",
- "symfony/dependency-injection": "2.3.*",
- "symfony/event-dispatcher": "2.3.*",
- "symfony/http-kernel": "2.3.*",
- "symfony/routing": "2.3.*",
- "symfony/yaml": "2.3.*",
+ "marc1706/fast-image-size": "1.1.*",
+ "patchwork/utf8": "1.1.*",
+ "php": ">=5.3.9",
+ "s9e/text-formatter": "dev-release/php5.3",
+ "symfony/config": "2.8.*@dev",
+ "symfony/console": "2.8.*@dev",
+ "symfony/dependency-injection": "2.8.*@dev",
+ "symfony/event-dispatcher": "2.8.*@dev",
+ "symfony/filesystem": "2.8.*@dev",
+ "symfony/finder": "2.8.*@dev",
+ "symfony/http-kernel": "2.8.*@dev",
+ "symfony/routing": "2.8.*@dev",
+ "symfony/security-core": "2.8.*@dev",
+ "symfony/security-csrf": "2.8.*@dev",
+ "symfony/twig-bridge": "2.8.*@dev",
+ "symfony/yaml": "2.8.*@dev",
"twig/twig": "1.*"
},
"require-dev": {
@@ -43,13 +51,11 @@
"phpunit/phpunit": "4.1.*",
"sami/sami": "1.*",
"squizlabs/php_codesniffer": "2.*",
- "symfony/browser-kit": "2.3.*",
- "symfony/css-selector": "2.3.*",
- "symfony/debug": "2.3.*",
- "symfony/dom-crawler": "2.3.*",
- "symfony/filesystem": "2.3.*",
- "symfony/finder": "2.3.*",
- "symfony/http-foundation": "2.3.*",
- "symfony/process": "2.3.*"
+ "symfony/browser-kit": "2.8.*@dev",
+ "symfony/css-selector": "2.8.*@dev",
+ "symfony/debug": "2.8.*@dev",
+ "symfony/dom-crawler": "2.8.*@dev",
+ "symfony/http-foundation": "2.8.*@dev",
+ "symfony/process": "2.8.*@dev"
}
}
diff --git a/phpBB/composer.lock b/phpBB/composer.lock
index d24c163b70..7d45abc6e3 100644
--- a/phpBB/composer.lock
+++ b/phpBB/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "hash": "5864f5064e1ca81dd9817ee2674b5dfd",
+ "hash": "da690ad4ab4884661792b4b9d648934a",
"packages": [
{
"name": "lusitanian/oauth",
@@ -70,6 +70,113 @@
"time": "2013-08-29 21:40:04"
},
{
+ "name": "marc1706/fast-image-size",
+ "version": "v1.1.0",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/marc1706/fast-image-size.git",
+ "reference": "27467cfeca8fb2afd7ef3ffeea6d28a84f79df41"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/marc1706/fast-image-size/zipball/27467cfeca8fb2afd7ef3ffeea6d28a84f79df41",
+ "reference": "27467cfeca8fb2afd7ef3ffeea6d28a84f79df41",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "4.*"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "FastImageSize\\": "lib",
+ "FastImageSize\\tests\\": "tests"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Marc Alexander",
+ "email": "admin@m-a-styles.de",
+ "homepage": "https://www.m-a-styles.de",
+ "role": "Developer"
+ }
+ ],
+ "description": "fast-image-size is a PHP library that does almost everything PHP's getimagesize() does but without the large overhead of downloading the complete file.",
+ "homepage": "https://www.m-a-styles.de",
+ "keywords": [
+ "fast",
+ "getimagesize",
+ "image",
+ "imagesize",
+ "php",
+ "size"
+ ],
+ "time": "2015-08-21 11:40:30"
+ },
+ {
+ "name": "patchwork/utf8",
+ "version": "v1.1.26",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/tchwork/utf8.git",
+ "reference": "6b8e46603b49ee87ad6bceb314da94cc04ffcdce"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/tchwork/utf8/zipball/6b8e46603b49ee87ad6bceb314da94cc04ffcdce",
+ "reference": "6b8e46603b49ee87ad6bceb314da94cc04ffcdce",
+ "shasum": ""
+ },
+ "require": {
+ "lib-pcre": ">=7.3",
+ "php": ">=5.3.0"
+ },
+ "suggest": {
+ "ext-iconv": "Use iconv for best performance",
+ "ext-intl": "Use Intl for best performance",
+ "ext-mbstring": "Use Mbstring for best performance"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.1-dev"
+ }
+ },
+ "autoload": {
+ "psr-0": {
+ "Patchwork": "class/",
+ "Normalizer": "class/"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "(Apache-2.0 or GPL-2.0)"
+ ],
+ "authors": [
+ {
+ "name": "Nicolas Grekas",
+ "email": "p@tchwork.com"
+ }
+ ],
+ "description": "Portable and performant UTF-8, Unicode and Grapheme Clusters for PHP",
+ "homepage": "https://github.com/tchwork/utf8",
+ "keywords": [
+ "grapheme",
+ "i18n",
+ "unicode",
+ "utf-8",
+ "utf8"
+ ],
+ "time": "2014-11-08 10:13:25"
+ },
+ {
"name": "psr/log",
"version": "1.0.0",
"source": {
@@ -108,35 +215,93 @@
"time": "2012-12-21 11:40:51"
},
{
+ "name": "s9e/text-formatter",
+ "version": "dev-release/php5.3",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/s9e/TextFormatter.git",
+ "reference": "beee0e5693f7ca8ed16a94294acf53b6e6207e7c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/s9e/TextFormatter/zipball/fb39bdd38f6706b96422a7583b89c9283a58960f",
+ "reference": "beee0e5693f7ca8ed16a94294acf53b6e6207e7c",
+ "shasum": ""
+ },
+ "require": {
+ "ext-dom": "*",
+ "ext-filter": "*",
+ "lib-pcre": ">=7.2",
+ "php": ">=5.3.3"
+ },
+ "suggest": {
+ "ext-intl": "Allows international URLs to be accepted by the URL filter",
+ "ext-json": "Enables the generation of a JavaScript parser",
+ "ext-mbstring": "Enables some optimizations in the PHP renderer",
+ "ext-tokenizer": "Enables optimizations in the PHP renderer",
+ "ext-xsl": "Enables the XSLT renderer",
+ "ext-zlib": "Enables gzip compression when scraping content via the MediaEmbed plugin"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-4": {
+ "s9e\\TextFormatter\\": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "description": "Multi-purpose text formatting and markup library. Plugins offer support for BBCodes, Markdown, emoticons, HTML, embedding media (YouTube, etc...), enhanced typography and more.",
+ "homepage": "https://github.com/s9e/TextFormatter/",
+ "keywords": [
+ "bbcode",
+ "bbcodes",
+ "blog",
+ "censor",
+ "embed",
+ "emoji",
+ "emoticons",
+ "engine",
+ "forum",
+ "html",
+ "markdown",
+ "markup",
+ "media",
+ "parser",
+ "shortcodes"
+ ],
+ "time": "2015-07-12 16:53:32"
+ },
+ {
"name": "symfony/config",
- "version": "v2.3.32",
- "target-dir": "Symfony/Component/Config",
+ "version": "2.8.x-dev",
"source": {
"type": "git",
"url": "https://github.com/symfony/Config.git",
- "reference": "75ab3b117c690d4421d9e83f87df89755778d788"
+ "reference": "a3aa17e2dcec2dc1c764bedd21e69fdf888b8b55"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Config/zipball/75ab3b117c690d4421d9e83f87df89755778d788",
- "reference": "75ab3b117c690d4421d9e83f87df89755778d788",
+ "url": "https://api.github.com/repos/symfony/Config/zipball/a3aa17e2dcec2dc1c764bedd21e69fdf888b8b55",
+ "reference": "a3aa17e2dcec2dc1c764bedd21e69fdf888b8b55",
"shasum": ""
},
"require": {
- "php": ">=5.3.3",
- "symfony/filesystem": "~2.3"
+ "php": ">=5.3.9",
+ "symfony/filesystem": "~2.3|~3.0.0"
},
"require-dev": {
- "symfony/phpunit-bridge": "~2.7"
+ "symfony/phpunit-bridge": "~2.7|~3.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.8-dev"
}
},
"autoload": {
- "psr-0": {
+ "psr-4": {
"Symfony\\Component\\Config\\": ""
}
},
@@ -156,41 +321,44 @@
],
"description": "Symfony Config Component",
"homepage": "https://symfony.com",
- "time": "2015-07-15 17:51:32"
+ "time": "2015-08-27 18:34:50"
},
{
"name": "symfony/console",
- "version": "v2.3.32",
- "target-dir": "Symfony/Component/Console",
+ "version": "2.8.x-dev",
"source": {
"type": "git",
"url": "https://github.com/symfony/Console.git",
- "reference": "cb9006df9d50f1dd7b9dfa3e4ad8942acde9f76c"
+ "reference": "d31246d93cd99dc57858adb5da63841d56969928"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Console/zipball/cb9006df9d50f1dd7b9dfa3e4ad8942acde9f76c",
- "reference": "cb9006df9d50f1dd7b9dfa3e4ad8942acde9f76c",
+ "url": "https://api.github.com/repos/symfony/Console/zipball/d31246d93cd99dc57858adb5da63841d56969928",
+ "reference": "d31246d93cd99dc57858adb5da63841d56969928",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": ">=5.3.9"
},
"require-dev": {
- "symfony/event-dispatcher": "~2.1",
- "symfony/phpunit-bridge": "~2.7"
+ "psr/log": "~1.0",
+ "symfony/event-dispatcher": "~2.1|~3.0.0",
+ "symfony/phpunit-bridge": "~2.7|~3.0.0",
+ "symfony/process": "~2.1|~3.0.0"
},
"suggest": {
- "symfony/event-dispatcher": ""
+ "psr/log": "For using the console logger",
+ "symfony/event-dispatcher": "",
+ "symfony/process": ""
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.8-dev"
}
},
"autoload": {
- "psr-0": {
+ "psr-4": {
"Symfony\\Component\\Console\\": ""
}
},
@@ -210,47 +378,42 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
- "time": "2015-08-31 12:48:21"
+ "time": "2015-09-01 07:33:03"
},
{
"name": "symfony/debug",
- "version": "v2.3.32",
- "target-dir": "Symfony/Component/Debug",
+ "version": "2.8.x-dev",
"source": {
"type": "git",
"url": "https://github.com/symfony/Debug.git",
- "reference": "77d632fd7265fe55bd20882685998ec1f3415a64"
+ "reference": "3c14966b099b4ba807f146df4c6a7acffba2f793"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Debug/zipball/77d632fd7265fe55bd20882685998ec1f3415a64",
- "reference": "77d632fd7265fe55bd20882685998ec1f3415a64",
+ "url": "https://api.github.com/repos/symfony/Debug/zipball/3c14966b099b4ba807f146df4c6a7acffba2f793",
+ "reference": "3c14966b099b4ba807f146df4c6a7acffba2f793",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": ">=5.3.9",
+ "psr/log": "~1.0"
},
"conflict": {
"symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2"
},
"require-dev": {
- "symfony/http-foundation": "~2.1",
- "symfony/http-kernel": "~2.3.24|~2.5.9|~2.6,>=2.6.2",
- "symfony/phpunit-bridge": "~2.7"
- },
- "suggest": {
- "symfony/class-loader": "",
- "symfony/http-foundation": "",
- "symfony/http-kernel": ""
+ "symfony/class-loader": "~2.2|~3.0.0",
+ "symfony/http-kernel": "~2.3.24|~2.5.9|~2.6,>=2.6.2|~3.0.0",
+ "symfony/phpunit-bridge": "~2.7|~3.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.8-dev"
}
},
"autoload": {
- "psr-0": {
+ "psr-4": {
"Symfony\\Component\\Debug\\": ""
}
},
@@ -270,30 +433,33 @@
],
"description": "Symfony Debug Component",
"homepage": "https://symfony.com",
- "time": "2015-07-28 12:38:40"
+ "time": "2015-08-31 12:33:08"
},
{
"name": "symfony/dependency-injection",
- "version": "v2.3.32",
- "target-dir": "Symfony/Component/DependencyInjection",
+ "version": "2.8.x-dev",
"source": {
"type": "git",
"url": "https://github.com/symfony/DependencyInjection.git",
- "reference": "3f85e842b92c552f520ae2ea628be4aab2810fdb"
+ "reference": "99c05679526e9293783ce3a9059890b47da1d97e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/3f85e842b92c552f520ae2ea628be4aab2810fdb",
- "reference": "3f85e842b92c552f520ae2ea628be4aab2810fdb",
+ "url": "https://api.github.com/repos/symfony/DependencyInjection/zipball/99c05679526e9293783ce3a9059890b47da1d97e",
+ "reference": "99c05679526e9293783ce3a9059890b47da1d97e",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": ">=5.3.9"
+ },
+ "conflict": {
+ "symfony/expression-language": "<2.6"
},
"require-dev": {
- "symfony/config": "~2.2",
- "symfony/phpunit-bridge": "~2.7",
- "symfony/yaml": "~2.1"
+ "symfony/config": "~2.2|~3.0.0",
+ "symfony/expression-language": "~2.6|~3.0.0",
+ "symfony/phpunit-bridge": "~2.7|~3.0.0",
+ "symfony/yaml": "~2.1|~3.0.0"
},
"suggest": {
"symfony/config": "",
@@ -303,11 +469,11 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.8-dev"
}
},
"autoload": {
- "psr-0": {
+ "psr-4": {
"Symfony\\Component\\DependencyInjection\\": ""
}
},
@@ -327,29 +493,32 @@
],
"description": "Symfony DependencyInjection Component",
"homepage": "https://symfony.com",
- "time": "2015-08-01 07:45:23"
+ "time": "2015-08-24 07:31:10"
},
{
"name": "symfony/event-dispatcher",
- "version": "v2.3.32",
- "target-dir": "Symfony/Component/EventDispatcher",
+ "version": "2.8.x-dev",
"source": {
"type": "git",
"url": "https://github.com/symfony/EventDispatcher.git",
- "reference": "af8fba40bdab97fc666173a8c2087e02445c231c"
+ "reference": "d7246885b7fe4cb5a2786bda34362d2f0e40b730"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/af8fba40bdab97fc666173a8c2087e02445c231c",
- "reference": "af8fba40bdab97fc666173a8c2087e02445c231c",
+ "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/d7246885b7fe4cb5a2786bda34362d2f0e40b730",
+ "reference": "d7246885b7fe4cb5a2786bda34362d2f0e40b730",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": ">=5.3.9"
},
"require-dev": {
- "symfony/dependency-injection": "~2.0,>=2.0.5",
- "symfony/phpunit-bridge": "~2.7"
+ "psr/log": "~1.0",
+ "symfony/config": "~2.0,>=2.0.5|~3.0.0",
+ "symfony/dependency-injection": "~2.6|~3.0.0",
+ "symfony/expression-language": "~2.6|~3.0.0",
+ "symfony/phpunit-bridge": "~2.7|~3.0.0",
+ "symfony/stopwatch": "~2.3|~3.0.0"
},
"suggest": {
"symfony/dependency-injection": "",
@@ -358,11 +527,11 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.8-dev"
}
},
"autoload": {
- "psr-0": {
+ "psr-4": {
"Symfony\\Component\\EventDispatcher\\": ""
}
},
@@ -382,37 +551,36 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
- "time": "2015-05-15 13:28:34"
+ "time": "2015-06-24 15:32:32"
},
{
"name": "symfony/filesystem",
- "version": "v2.3.32",
- "target-dir": "Symfony/Component/Filesystem",
+ "version": "2.8.x-dev",
"source": {
"type": "git",
"url": "https://github.com/symfony/Filesystem.git",
- "reference": "2d4e4e21e2b5e4720555811fe8f4a8873cfa0f0f"
+ "reference": "b9fa06f1822de287e660130955b546777994597b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Filesystem/zipball/2d4e4e21e2b5e4720555811fe8f4a8873cfa0f0f",
- "reference": "2d4e4e21e2b5e4720555811fe8f4a8873cfa0f0f",
+ "url": "https://api.github.com/repos/symfony/Filesystem/zipball/b9fa06f1822de287e660130955b546777994597b",
+ "reference": "b9fa06f1822de287e660130955b546777994597b",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": ">=5.3.9"
},
"require-dev": {
- "symfony/phpunit-bridge": "~2.7"
+ "symfony/phpunit-bridge": "~2.7|~3.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.8-dev"
}
},
"autoload": {
- "psr-0": {
+ "psr-4": {
"Symfony\\Component\\Filesystem\\": ""
}
},
@@ -432,41 +600,90 @@
],
"description": "Symfony Filesystem Component",
"homepage": "https://symfony.com",
- "time": "2015-08-29 10:34:03"
+ "time": "2015-08-27 07:03:53"
+ },
+ {
+ "name": "symfony/finder",
+ "version": "2.8.x-dev",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/Finder.git",
+ "reference": "142440d48e10fd4b4f2ffb2d72fa0aad6f03cacf"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/Finder/zipball/142440d48e10fd4b4f2ffb2d72fa0aad6f03cacf",
+ "reference": "142440d48e10fd4b4f2ffb2d72fa0aad6f03cacf",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.9"
+ },
+ "require-dev": {
+ "symfony/phpunit-bridge": "~2.7|~3.0.0"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.8-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Finder\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Finder Component",
+ "homepage": "https://symfony.com",
+ "time": "2015-08-27 06:53:13"
},
{
"name": "symfony/http-foundation",
- "version": "v2.3.32",
- "target-dir": "Symfony/Component/HttpFoundation",
+ "version": "2.8.x-dev",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpFoundation.git",
- "reference": "fd351e4abb56b05ba05023f6ae4185873978da10"
+ "reference": "3f179ebcfc2f9cb82a47e890ed4622f48cfb4602"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/fd351e4abb56b05ba05023f6ae4185873978da10",
- "reference": "fd351e4abb56b05ba05023f6ae4185873978da10",
+ "url": "https://api.github.com/repos/symfony/HttpFoundation/zipball/3f179ebcfc2f9cb82a47e890ed4622f48cfb4602",
+ "reference": "3f179ebcfc2f9cb82a47e890ed4622f48cfb4602",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": ">=5.3.9"
},
"require-dev": {
- "symfony/phpunit-bridge": "~2.7"
+ "symfony/expression-language": "~2.4|~3.0.0",
+ "symfony/phpunit-bridge": "~2.7|~3.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.8-dev"
}
},
"autoload": {
- "psr-0": {
+ "psr-4": {
"Symfony\\Component\\HttpFoundation\\": ""
},
"classmap": [
- "Symfony/Component/HttpFoundation/Resources/stubs"
+ "Resources/stubs"
]
},
"notification-url": "https://packagist.org/downloads/",
@@ -485,44 +702,49 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com",
- "time": "2015-08-25 21:41:39"
+ "time": "2015-08-27 06:53:13"
},
{
"name": "symfony/http-kernel",
- "version": "v2.3.32",
- "target-dir": "Symfony/Component/HttpKernel",
+ "version": "2.8.x-dev",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpKernel.git",
- "reference": "15604f5b95a72ccdc38c318e14e9147e2e51bfa2"
+ "reference": "330079921340f2d273dd24df16fc129948614e77"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/15604f5b95a72ccdc38c318e14e9147e2e51bfa2",
- "reference": "15604f5b95a72ccdc38c318e14e9147e2e51bfa2",
+ "url": "https://api.github.com/repos/symfony/HttpKernel/zipball/330079921340f2d273dd24df16fc129948614e77",
+ "reference": "330079921340f2d273dd24df16fc129948614e77",
"shasum": ""
},
"require": {
- "php": ">=5.3.3",
+ "php": ">=5.3.9",
"psr/log": "~1.0",
- "symfony/debug": "~2.3.24|~2.5.9|~2.6,>=2.6.2",
- "symfony/event-dispatcher": "~2.1",
- "symfony/http-foundation": "~2.3,>=2.3.4"
+ "symfony/debug": "~2.6,>=2.6.2",
+ "symfony/event-dispatcher": "~2.6,>=2.6.7|~3.0.0",
+ "symfony/http-foundation": "~2.5,>=2.5.4|~3.0.0"
+ },
+ "conflict": {
+ "symfony/config": "<2.7"
},
"require-dev": {
- "symfony/browser-kit": "~2.3",
- "symfony/class-loader": "~2.1",
- "symfony/config": "~2.0,>=2.0.5",
- "symfony/console": "~2.2",
- "symfony/css-selector": "~2.0,>=2.0.5",
- "symfony/dependency-injection": "~2.2",
- "symfony/dom-crawler": "~2.0,>=2.0.5",
- "symfony/finder": "~2.0,>=2.0.5",
- "symfony/phpunit-bridge": "~2.7",
- "symfony/process": "~2.0,>=2.0.5",
- "symfony/routing": "~2.2",
- "symfony/stopwatch": "~2.3",
- "symfony/templating": "~2.2"
+ "symfony/browser-kit": "~2.3|~3.0.0",
+ "symfony/class-loader": "~2.1|~3.0.0",
+ "symfony/config": "~2.7",
+ "symfony/console": "~2.3|~3.0.0",
+ "symfony/css-selector": "~2.0,>=2.0.5|~3.0.0",
+ "symfony/dependency-injection": "~2.8|~3.0.0",
+ "symfony/dom-crawler": "~2.0,>=2.0.5|~3.0.0",
+ "symfony/expression-language": "~2.4|~3.0.0",
+ "symfony/finder": "~2.0,>=2.0.5|~3.0.0",
+ "symfony/phpunit-bridge": "~2.7|~3.0.0",
+ "symfony/process": "~2.0,>=2.0.5|~3.0.0",
+ "symfony/routing": "~2.8|~3.0.0",
+ "symfony/stopwatch": "~2.3|~3.0.0",
+ "symfony/templating": "~2.2|~3.0.0",
+ "symfony/translation": "~2.0,>=2.0.5|~3.0.0",
+ "symfony/var-dumper": "~2.6|~3.0.0"
},
"suggest": {
"symfony/browser-kit": "",
@@ -530,16 +752,17 @@
"symfony/config": "",
"symfony/console": "",
"symfony/dependency-injection": "",
- "symfony/finder": ""
+ "symfony/finder": "",
+ "symfony/var-dumper": ""
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.8-dev"
}
},
"autoload": {
- "psr-0": {
+ "psr-4": {
"Symfony\\Component\\HttpKernel\\": ""
}
},
@@ -559,47 +782,52 @@
],
"description": "Symfony HttpKernel Component",
"homepage": "https://symfony.com",
- "time": "2015-09-01 15:40:52"
+ "time": "2015-09-01 07:33:03"
},
{
"name": "symfony/routing",
- "version": "v2.3.32",
- "target-dir": "Symfony/Component/Routing",
+ "version": "2.8.x-dev",
"source": {
"type": "git",
"url": "https://github.com/symfony/Routing.git",
- "reference": "fbadda8d2a35bdec8187bd54f698b8b704649721"
+ "reference": "e9554bafc78c93b15ef56ce72c5aa2f3a511e683"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Routing/zipball/fbadda8d2a35bdec8187bd54f698b8b704649721",
- "reference": "fbadda8d2a35bdec8187bd54f698b8b704649721",
+ "url": "https://api.github.com/repos/symfony/Routing/zipball/e9554bafc78c93b15ef56ce72c5aa2f3a511e683",
+ "reference": "e9554bafc78c93b15ef56ce72c5aa2f3a511e683",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": ">=5.3.9"
+ },
+ "conflict": {
+ "symfony/config": "<2.7"
},
"require-dev": {
+ "doctrine/annotations": "~1.0",
"doctrine/common": "~2.2",
"psr/log": "~1.0",
- "symfony/config": "~2.2",
- "symfony/http-foundation": "~2.3",
- "symfony/phpunit-bridge": "~2.7",
- "symfony/yaml": "~2.0,>=2.0.5"
+ "symfony/config": "~2.7|~3.0.0",
+ "symfony/expression-language": "~2.4|~3.0.0",
+ "symfony/http-foundation": "~2.3|~3.0.0",
+ "symfony/phpunit-bridge": "~2.7|~3.0.0",
+ "symfony/yaml": "~2.0,>=2.0.5|~3.0.0"
},
"suggest": {
- "doctrine/common": "",
- "symfony/config": "",
- "symfony/yaml": ""
+ "doctrine/annotations": "For using the annotation loader",
+ "symfony/config": "For using the all-in-one router or any loader",
+ "symfony/expression-language": "For using expression matching",
+ "symfony/yaml": "For using the YAML loader"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.8-dev"
}
},
"autoload": {
- "psr-0": {
+ "psr-4": {
"Symfony\\Component\\Routing\\": ""
}
},
@@ -619,37 +847,197 @@
],
"description": "Symfony Routing Component",
"homepage": "https://symfony.com",
- "time": "2015-08-01 19:33:42"
+ "keywords": [
+ "router",
+ "routing",
+ "uri",
+ "url"
+ ],
+ "time": "2015-08-24 07:31:10"
+ },
+ {
+ "name": "symfony/security",
+ "version": "2.8.x-dev",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/Security.git",
+ "reference": "b57956299e1d75663d748645564d76efcb9e72f3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/Security/zipball/b57956299e1d75663d748645564d76efcb9e72f3",
+ "reference": "b57956299e1d75663d748645564d76efcb9e72f3",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.9",
+ "symfony/event-dispatcher": "~2.2|~3.0.0",
+ "symfony/http-foundation": "~2.1|~3.0.0",
+ "symfony/http-kernel": "~2.4|~3.0.0"
+ },
+ "replace": {
+ "symfony/security-acl": "self.version",
+ "symfony/security-core": "self.version",
+ "symfony/security-csrf": "self.version",
+ "symfony/security-http": "self.version"
+ },
+ "require-dev": {
+ "doctrine/common": "~2.2",
+ "doctrine/dbal": "~2.2",
+ "ircmaxell/password-compat": "~1.0",
+ "psr/log": "~1.0",
+ "symfony/expression-language": "~2.6|~3.0.0",
+ "symfony/intl": "~2.3|~3.0.0",
+ "symfony/phpunit-bridge": "~2.7|~3.0.0",
+ "symfony/routing": "~2.2|~3.0.0",
+ "symfony/translation": "~2.0,>=2.0.5|~3.0.0",
+ "symfony/validator": "~2.5,>=2.5.5|~3.0.0"
+ },
+ "suggest": {
+ "doctrine/dbal": "For using the built-in ACL implementation",
+ "ircmaxell/password-compat": "For using the BCrypt password encoder in PHP <5.5",
+ "symfony/class-loader": "For using the ACL generateSql script",
+ "symfony/expression-language": "For using the expression voter",
+ "symfony/finder": "For using the ACL generateSql script",
+ "symfony/routing": "For using the HttpUtils class to create sub-requests, redirect the user, and match URLs",
+ "symfony/validator": "For using the user password constraint"
+ },
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.8-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Component\\Security\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Security Component",
+ "homepage": "https://symfony.com",
+ "time": "2015-07-09 16:11:14"
+ },
+ {
+ "name": "symfony/twig-bridge",
+ "version": "2.8.x-dev",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/TwigBridge.git",
+ "reference": "f85dc88ede5943c63c8681c02d8ef6b4252be54c"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/symfony/TwigBridge/zipball/f85dc88ede5943c63c8681c02d8ef6b4252be54c",
+ "reference": "f85dc88ede5943c63c8681c02d8ef6b4252be54c",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.9",
+ "twig/twig": "~1.20|~2.0"
+ },
+ "require-dev": {
+ "symfony/asset": "~2.7|~3.0.0",
+ "symfony/console": "~2.7|~3.0.0",
+ "symfony/expression-language": "~2.4|~3.0.0",
+ "symfony/finder": "~2.3|~3.0.0",
+ "symfony/form": "~2.8",
+ "symfony/http-kernel": "~2.3|~3.0.0",
+ "symfony/intl": "~2.3|~3.0.0",
+ "symfony/phpunit-bridge": "~2.7|~3.0.0",
+ "symfony/routing": "~2.2|~3.0.0",
+ "symfony/security": "~2.6|~3.0.0",
+ "symfony/security-acl": "~2.6|~3.0.0",
+ "symfony/stopwatch": "~2.2|~3.0.0",
+ "symfony/templating": "~2.1|~3.0.0",
+ "symfony/translation": "~2.7|~3.0.0",
+ "symfony/var-dumper": "~2.6|~3.0.0",
+ "symfony/yaml": "~2.0,>=2.0.5|~3.0.0"
+ },
+ "suggest": {
+ "symfony/asset": "For using the AssetExtension",
+ "symfony/expression-language": "For using the ExpressionExtension",
+ "symfony/finder": "",
+ "symfony/form": "For using the FormExtension",
+ "symfony/http-kernel": "For using the HttpKernelExtension",
+ "symfony/routing": "For using the RoutingExtension",
+ "symfony/security": "For using the SecurityExtension",
+ "symfony/stopwatch": "For using the StopwatchExtension",
+ "symfony/templating": "For using the TwigEngine",
+ "symfony/translation": "For using the TranslationExtension",
+ "symfony/var-dumper": "For using the DumpExtension",
+ "symfony/yaml": "For using the YamlExtension"
+ },
+ "type": "symfony-bridge",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.8-dev"
+ }
+ },
+ "autoload": {
+ "psr-4": {
+ "Symfony\\Bridge\\Twig\\": ""
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "https://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Twig Bridge",
+ "homepage": "https://symfony.com",
+ "time": "2015-09-01 07:33:03"
},
{
"name": "symfony/yaml",
- "version": "v2.3.32",
- "target-dir": "Symfony/Component/Yaml",
+ "version": "2.8.x-dev",
"source": {
"type": "git",
"url": "https://github.com/symfony/Yaml.git",
- "reference": "162a8860e58bcd9d316e04e3af8ff96e63cb1cdb"
+ "reference": "1a0bd40f71908db4c9d44d308e0008cc44fc5f2f"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Yaml/zipball/162a8860e58bcd9d316e04e3af8ff96e63cb1cdb",
- "reference": "162a8860e58bcd9d316e04e3af8ff96e63cb1cdb",
+ "url": "https://api.github.com/repos/symfony/Yaml/zipball/1a0bd40f71908db4c9d44d308e0008cc44fc5f2f",
+ "reference": "1a0bd40f71908db4c9d44d308e0008cc44fc5f2f",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": ">=5.3.9"
},
"require-dev": {
- "symfony/phpunit-bridge": "~2.7"
+ "symfony/phpunit-bridge": "~2.7|~3.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.8-dev"
}
},
"autoload": {
- "psr-0": {
+ "psr-4": {
"Symfony\\Component\\Yaml\\": ""
}
},
@@ -669,7 +1057,7 @@
],
"description": "Symfony Yaml Component",
"homepage": "https://symfony.com",
- "time": "2015-08-11 07:25:28"
+ "time": "2015-08-24 07:18:02"
},
{
"name": "twig/twig",
@@ -2017,27 +2405,26 @@
},
{
"name": "symfony/browser-kit",
- "version": "v2.3.32",
- "target-dir": "Symfony/Component/BrowserKit",
+ "version": "2.8.x-dev",
"source": {
"type": "git",
"url": "https://github.com/symfony/BrowserKit.git",
- "reference": "85afdbfbc789709192a9c5f37268063b18fc861d"
+ "reference": "4f297d7e00c375b6ab03732e076f65799a73937d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/85afdbfbc789709192a9c5f37268063b18fc861d",
- "reference": "85afdbfbc789709192a9c5f37268063b18fc861d",
+ "url": "https://api.github.com/repos/symfony/BrowserKit/zipball/4f297d7e00c375b6ab03732e076f65799a73937d",
+ "reference": "4f297d7e00c375b6ab03732e076f65799a73937d",
"shasum": ""
},
"require": {
- "php": ">=5.3.3",
- "symfony/dom-crawler": "~2.0,>=2.0.5"
+ "php": ">=5.3.9",
+ "symfony/dom-crawler": "~2.0,>=2.0.5|~3.0.0"
},
"require-dev": {
- "symfony/css-selector": "~2.0,>=2.0.5",
- "symfony/phpunit-bridge": "~2.7",
- "symfony/process": "~2.0,>=2.0.5"
+ "symfony/css-selector": "~2.0,>=2.0.5|~3.0.0",
+ "symfony/phpunit-bridge": "~2.7|~3.0.0",
+ "symfony/process": "~2.0,>=2.0.5|~3.0.0"
},
"suggest": {
"symfony/process": ""
@@ -2045,11 +2432,11 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.8-dev"
}
},
"autoload": {
- "psr-0": {
+ "psr-4": {
"Symfony\\Component\\BrowserKit\\": ""
}
},
@@ -2069,37 +2456,36 @@
],
"description": "Symfony BrowserKit Component",
"homepage": "https://symfony.com",
- "time": "2015-07-05 14:01:47"
+ "time": "2015-07-09 16:11:14"
},
{
"name": "symfony/css-selector",
- "version": "v2.3.32",
- "target-dir": "Symfony/Component/CssSelector",
+ "version": "2.8.x-dev",
"source": {
"type": "git",
"url": "https://github.com/symfony/CssSelector.git",
- "reference": "75cc67b407df5617fd58c40caa872e9d81de38cc"
+ "reference": "6470dad1d5c3a926906b5660a7046bbd61bd7806"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/CssSelector/zipball/75cc67b407df5617fd58c40caa872e9d81de38cc",
- "reference": "75cc67b407df5617fd58c40caa872e9d81de38cc",
+ "url": "https://api.github.com/repos/symfony/CssSelector/zipball/6470dad1d5c3a926906b5660a7046bbd61bd7806",
+ "reference": "6470dad1d5c3a926906b5660a7046bbd61bd7806",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": ">=5.3.9"
},
"require-dev": {
- "symfony/phpunit-bridge": "~2.7"
+ "symfony/phpunit-bridge": "~2.7|~3.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.8-dev"
}
},
"autoload": {
- "psr-0": {
+ "psr-4": {
"Symfony\\Component\\CssSelector\\": ""
}
},
@@ -2123,29 +2509,28 @@
],
"description": "Symfony CssSelector Component",
"homepage": "https://symfony.com",
- "time": "2015-05-15 13:28:34"
+ "time": "2015-08-24 07:18:02"
},
{
"name": "symfony/dom-crawler",
- "version": "v2.3.32",
- "target-dir": "Symfony/Component/DomCrawler",
+ "version": "2.8.x-dev",
"source": {
"type": "git",
"url": "https://github.com/symfony/DomCrawler.git",
- "reference": "da19f268a3f6ec68b77706c06fd874ddbb073011"
+ "reference": "be577b3a5d4a06d8ce03db57222bd06b5a6509de"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/da19f268a3f6ec68b77706c06fd874ddbb073011",
- "reference": "da19f268a3f6ec68b77706c06fd874ddbb073011",
+ "url": "https://api.github.com/repos/symfony/DomCrawler/zipball/be577b3a5d4a06d8ce03db57222bd06b5a6509de",
+ "reference": "be577b3a5d4a06d8ce03db57222bd06b5a6509de",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": ">=5.3.9"
},
"require-dev": {
- "symfony/css-selector": "~2.0,>=2.0.5",
- "symfony/phpunit-bridge": "~2.7"
+ "symfony/css-selector": "~2.3|~3.0.0",
+ "symfony/phpunit-bridge": "~2.7|~3.0.0"
},
"suggest": {
"symfony/css-selector": ""
@@ -2153,11 +2538,11 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.8-dev"
}
},
"autoload": {
- "psr-0": {
+ "psr-4": {
"Symfony\\Component\\DomCrawler\\": ""
}
},
@@ -2177,87 +2562,36 @@
],
"description": "Symfony DomCrawler Component",
"homepage": "https://symfony.com",
- "time": "2015-08-25 21:41:39"
- },
- {
- "name": "symfony/finder",
- "version": "v2.3.32",
- "target-dir": "Symfony/Component/Finder",
- "source": {
- "type": "git",
- "url": "https://github.com/symfony/Finder.git",
- "reference": "87a0f52f6ec3061499a71e225145a031afa22511"
- },
- "dist": {
- "type": "zip",
- "url": "https://api.github.com/repos/symfony/Finder/zipball/87a0f52f6ec3061499a71e225145a031afa22511",
- "reference": "87a0f52f6ec3061499a71e225145a031afa22511",
- "shasum": ""
- },
- "require": {
- "php": ">=5.3.3"
- },
- "require-dev": {
- "symfony/phpunit-bridge": "~2.7"
- },
- "type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "2.3-dev"
- }
- },
- "autoload": {
- "psr-0": {
- "Symfony\\Component\\Finder\\": ""
- }
- },
- "notification-url": "https://packagist.org/downloads/",
- "license": [
- "MIT"
- ],
- "authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
- },
- {
- "name": "Symfony Community",
- "homepage": "https://symfony.com/contributors"
- }
- ],
- "description": "Symfony Finder Component",
- "homepage": "https://symfony.com",
- "time": "2015-08-26 16:41:06"
+ "time": "2015-08-27 06:53:13"
},
{
"name": "symfony/process",
- "version": "v2.3.32",
- "target-dir": "Symfony/Component/Process",
+ "version": "2.8.x-dev",
"source": {
"type": "git",
"url": "https://github.com/symfony/Process.git",
- "reference": "55aec78e1ff04c40ca2cbcb7a119581cdf4e5d82"
+ "reference": "fc18e378d05c6b81bcac39338bf334e053186efa"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/Process/zipball/55aec78e1ff04c40ca2cbcb7a119581cdf4e5d82",
- "reference": "55aec78e1ff04c40ca2cbcb7a119581cdf4e5d82",
+ "url": "https://api.github.com/repos/symfony/Process/zipball/fc18e378d05c6b81bcac39338bf334e053186efa",
+ "reference": "fc18e378d05c6b81bcac39338bf334e053186efa",
"shasum": ""
},
"require": {
- "php": ">=5.3.3"
+ "php": ">=5.3.9"
},
"require-dev": {
- "symfony/phpunit-bridge": "~2.7"
+ "symfony/phpunit-bridge": "~2.7|~3.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.3-dev"
+ "dev-master": "2.8-dev"
}
},
"autoload": {
- "psr-0": {
+ "psr-4": {
"Symfony\\Component\\Process\\": ""
}
},
@@ -2277,16 +2611,36 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
- "time": "2015-08-25 21:41:39"
+ "time": "2015-08-27 06:53:13"
}
],
"aliases": [],
"minimum-stability": "stable",
- "stability-flags": [],
+ "stability-flags": {
+ "s9e/text-formatter": 20,
+ "symfony/config": 20,
+ "symfony/console": 20,
+ "symfony/dependency-injection": 20,
+ "symfony/event-dispatcher": 20,
+ "symfony/filesystem": 20,
+ "symfony/finder": 20,
+ "symfony/http-kernel": 20,
+ "symfony/routing": 20,
+ "symfony/security-core": 20,
+ "symfony/security-csrf": 20,
+ "symfony/twig-bridge": 20,
+ "symfony/yaml": 20,
+ "symfony/browser-kit": 20,
+ "symfony/css-selector": 20,
+ "symfony/debug": 20,
+ "symfony/dom-crawler": 20,
+ "symfony/http-foundation": 20,
+ "symfony/process": 20
+ },
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
- "php": ">=5.3.3"
+ "php": ">=5.3.9"
},
"platform-dev": []
}
diff --git a/phpBB/config/default/config.yml b/phpBB/config/default/config.yml
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/phpBB/config/default/config.yml
diff --git a/phpBB/config/parameters.yml b/phpBB/config/default/container/parameters.yml
index 8ecc1428f4..8ecc1428f4 100644
--- a/phpBB/config/parameters.yml
+++ b/phpBB/config/default/container/parameters.yml
diff --git a/phpBB/config/services.yml b/phpBB/config/default/container/services.yml
index 8667cbbf84..288785201c 100644
--- a/phpBB/config/services.yml
+++ b/phpBB/config/default/container/services.yml
@@ -1,18 +1,30 @@
imports:
- - { 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: services_auth.yml }
+ - { resource: services_avatar.yml }
+ - { resource: services_captcha.yml }
+ - { resource: services_console.yml }
+ - { resource: services_content.yml }
+ - { resource: services_cron.yml }
+ - { resource: services_db.yml }
+ - { resource: services_event.yml }
+ - { resource: services_feed.yml }
+ - { resource: services_files.yml }
+ - { resource: services_help.yml }
+ - { resource: services_http.yml }
+ - { resource: services_language.yml }
+ - { resource: services_migrator.yml }
+ - { resource: services_mimetype_guesser.yml }
+ - { resource: services_module.yml }
+ - { resource: services_notification.yml }
+ - { resource: services_password.yml }
+ - { resource: services_php.yml }
+ - { resource: services_profilefield.yml }
+ - { resource: services_report.yml }
+ - { resource: services_routing.yml }
+ - { resource: services_text_formatter.yml }
+ - { resource: services_text_reparser.yml }
+ - { resource: services_twig.yml }
+ - { resource: services_user.yml }
- { resource: tables.yml }
- { resource: parameters.yml }
@@ -72,27 +84,17 @@ services:
- @template
- @user
- @config
- - @controller.provider
- - @ext.manager
- @symfony_request
- @request
- - @filesystem
- - %core.root_path%
- - %core.php_ext%
+ - @routing.helper
controller.resolver:
class: phpbb\controller\resolver
arguments:
- - @user
- @service_container
- %core.root_path%
- @template
- controller.provider:
- class: phpbb\controller\provider
- calls:
- - [find, [%core.root_path%]]
-
ext.manager:
class: phpbb\extension\manager
arguments:
@@ -100,23 +102,18 @@ services:
- @dbal.conn
- @config
- @filesystem
- - @user
- %tables.ext%
- %core.root_path%
- %core.php_ext%
- @cache.driver
- filesystem:
- class: phpbb\filesystem
-
file_downloader:
class: phpbb\file_downloader
- http_kernel:
- class: Symfony\Component\HttpKernel\HttpKernel
+ group_helper:
+ class: phpbb\group\helper
arguments:
- - @dispatcher
- - @controller.resolver
+ - @language
log:
class: phpbb\log\log
@@ -140,9 +137,6 @@ services:
- %core.php_ext%
- %core.adm_relative_path%
- php_ini:
- class: phpbb\php\ini
-
plupload:
class: phpbb\plupload\plupload
arguments:
@@ -153,30 +147,8 @@ services:
- @php_ini
- @mimetype.guesser
- request:
- class: phpbb\request\request
- arguments:
- - 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:
- - @request
-
- template:
- class: phpbb\template\twig\twig
- arguments:
- - @path_helper
- - @config
- - @user
- - @template_context
- - @ext.manager
-
- template_context:
- class: phpbb\template\context
+ upload_imagesize:
+ class: FastImageSize\FastImageSize
version_helper:
class: phpbb\version_helper
diff --git a/phpBB/config/auth.yml b/phpBB/config/default/container/services_auth.yml
index 88a90ca2d6..88a90ca2d6 100644
--- a/phpBB/config/auth.yml
+++ b/phpBB/config/default/container/services_auth.yml
diff --git a/phpBB/config/avatar.yml b/phpBB/config/default/container/services_avatar.yml
index b0dca137b0..1b0c109298 100644
--- a/phpBB/config/avatar.yml
+++ b/phpBB/config/default/container/services_avatar.yml
@@ -17,6 +17,7 @@ services:
class: phpbb\avatar\driver\gravatar
arguments:
- @config
+ - @upload_imagesize
- %core.root_path%
- %core.php_ext%
- @path_helper
@@ -30,6 +31,7 @@ services:
class: phpbb\avatar\driver\local
arguments:
- @config
+ - @upload_imagesize
- %core.root_path%
- %core.php_ext%
- @path_helper
@@ -43,6 +45,7 @@ services:
class: phpbb\avatar\driver\remote
arguments:
- @config
+ - @upload_imagesize
- %core.root_path%
- %core.php_ext%
- @path_helper
@@ -58,6 +61,7 @@ services:
- @config
- %core.root_path%
- %core.php_ext%
+ - @filesystem
- @path_helper
- @mimetype.guesser
- @dispatcher
diff --git a/phpBB/config/captcha.yml b/phpBB/config/default/container/services_captcha.yml
index e3f617e909..e3f617e909 100644
--- a/phpBB/config/captcha.yml
+++ b/phpBB/config/default/container/services_captcha.yml
diff --git a/phpBB/config/console.yml b/phpBB/config/default/container/services_console.yml
index 1e18a7dd37..aee3cbdee6 100644
--- a/phpBB/config/console.yml
+++ b/phpBB/config/default/container/services_console.yml
@@ -84,6 +84,7 @@ services:
- @config
- @cache
- @log
+ - @filesystem
- %core.root_path%
tags:
- { name: console.command }
@@ -139,3 +140,47 @@ services:
- @dbal.conn
tags:
- { name: console.command }
+
+ console.command.reparser.list:
+ class: phpbb\console\command\reparser\list_all
+ arguments:
+ - @user
+ - @text_reparser_collection
+ tags:
+ - { name: console.command }
+
+ console.command.reparser.reparse:
+ class: phpbb\console\command\reparser\reparse
+ arguments:
+ - @user
+ - @text_reparser_collection
+ - @config_text
+ tags:
+ - { name: console.command }
+
+ console.command.thumbnail.delete:
+ class: phpbb\console\command\thumbnail\delete
+ arguments:
+ - @user
+ - @dbal.conn
+ - %core.root_path%
+ tags:
+ - { name: console.command }
+
+ console.command.thumbnail.generate:
+ class: phpbb\console\command\thumbnail\generate
+ arguments:
+ - @user
+ - @dbal.conn
+ - @cache
+ - %core.root_path%
+ - %core.php_ext%
+ tags:
+ - { name: console.command }
+
+ console.command.thumbnail.recreate:
+ class: phpbb\console\command\thumbnail\recreate
+ arguments:
+ - @user
+ tags:
+ - { name: console.command }
diff --git a/phpBB/config/content.yml b/phpBB/config/default/container/services_content.yml
index 4d9ee31335..4d9ee31335 100644
--- a/phpBB/config/content.yml
+++ b/phpBB/config/default/container/services_content.yml
diff --git a/phpBB/config/cron.yml b/phpBB/config/default/container/services_cron.yml
index c5b88df181..c5b88df181 100644
--- a/phpBB/config/cron.yml
+++ b/phpBB/config/default/container/services_cron.yml
diff --git a/phpBB/config/default/container/services_db.yml b/phpBB/config/default/container/services_db.yml
new file mode 100644
index 0000000000..ed3f88c704
--- /dev/null
+++ b/phpBB/config/default/container/services_db.yml
@@ -0,0 +1,81 @@
+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%]]
+
+# ----- DB Tools -----
+ dbal.tools.factory:
+ class: phpbb\db\tools\factory
+
+ dbal.tools:
+ class: phpbb\db\tools\tools_interface
+ factory: ["@dbal.tools.factory", get]
+ arguments:
+ - @dbal.conn.driver
+
+# ----- DB Extractor -----
+ dbal.extractor.factory:
+ class: phpbb\db\extractor\factory
+ arguments:
+ - @dbal.conn.driver
+ - @service_container
+
+ dbal.extractor:
+ class: phpbb\db\extractor\extractor_interface
+ factory: ["@dbal.extractor.factory", get]
+
+# ----- DB Extractors for different drivers -----
+# Scope MUST be prototype for all the handlers to work correctly.
+ dbal.extractor.extractors.mssql_extractor:
+ class: phpbb\db\extractor\mssql_extractor
+ scope: prototype
+ arguments:
+ - %core.root_path%
+ - @request
+ - @dbal.conn.driver
+
+ dbal.extractor.extractors.mysql_extractor:
+ class: phpbb\db\extractor\mysql_extractor
+ scope: prototype
+ arguments:
+ - %core.root_path%
+ - @request
+ - @dbal.conn.driver
+
+ dbal.extractor.extractors.oracle_extractor:
+ class: phpbb\db\extractor\oracle_extractor
+ scope: prototype
+ arguments:
+ - %core.root_path%
+ - @request
+ - @dbal.conn.driver
+
+ dbal.extractor.extractors.postgres_extractor:
+ class: phpbb\db\extractor\postgres_extractor
+ scope: prototype
+ arguments:
+ - %core.root_path%
+ - @request
+ - @dbal.conn.driver
+
+ dbal.extractor.extractors.sqlite3_extractor:
+ class: phpbb\db\extractor\sqlite3_extractor
+ scope: prototype
+ arguments:
+ - %core.root_path%
+ - @request
+ - @dbal.conn.driver
+
+ dbal.extractor.extractors.sqlite_extractor:
+ class: phpbb\db\extractor\sqlite_extractor
+ scope: prototype
+ arguments:
+ - %core.root_path%
+ - @request
+ - @dbal.conn.driver
diff --git a/phpBB/config/event.yml b/phpBB/config/default/container/services_event.yml
index 599b3cbb40..1ccef78f9b 100644
--- a/phpBB/config/event.yml
+++ b/phpBB/config/default/container/services_event.yml
@@ -11,15 +11,6 @@ services:
- %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:
diff --git a/phpBB/config/feed.yml b/phpBB/config/default/container/services_feed.yml
index 48bd9fe76f..2133b3c489 100644
--- a/phpBB/config/feed.yml
+++ b/phpBB/config/default/container/services_feed.yml
@@ -1,18 +1,25 @@
services:
- feed.helper:
- class: phpbb\feed\helper
+ phpbb.feed.controller:
+ class: phpbb\feed\controller\feed
arguments:
+ - @template.twig.environment
+ - @symfony_request
+ - @controller.helper
- @config
+ - @dbal.conn
+ - @service_container
+ - @feed.helper
- @user
- - %core.root_path%
+ - @auth
- %core.php_ext%
- feed.factory:
- class: phpbb\feed\factory
+ feed.helper:
+ class: phpbb\feed\helper
arguments:
- - @service_container
- @config
- - @dbal.conn
+ - @user
+ - %core.root_path%
+ - %core.php_ext%
feed.forum:
class: phpbb\feed\forum
diff --git a/phpBB/config/default/container/services_files.yml b/phpBB/config/default/container/services_files.yml
new file mode 100644
index 0000000000..828f9076dd
--- /dev/null
+++ b/phpBB/config/default/container/services_files.yml
@@ -0,0 +1,3 @@
+services:
+ filesystem:
+ class: phpbb\filesystem\filesystem
diff --git a/phpBB/config/default/container/services_help.yml b/phpBB/config/default/container/services_help.yml
new file mode 100644
index 0000000000..8b9d497945
--- /dev/null
+++ b/phpBB/config/default/container/services_help.yml
@@ -0,0 +1,27 @@
+services:
+ phpbb.help.manager:
+ class: phpbb\help\manager
+ arguments:
+ - @dispatcher
+ - @language
+ - @template
+
+ phpbb.help.controller.bbcode:
+ class: phpbb\help\controller\bbcode
+ arguments:
+ - @controller.helper
+ - @phpbb.help.manager
+ - @template
+ - @language
+ - %core.root_path%
+ - %core.php_ext%
+
+ phpbb.help.controller.faq:
+ class: phpbb\help\controller\faq
+ arguments:
+ - @controller.helper
+ - @phpbb.help.manager
+ - @template
+ - @language
+ - %core.root_path%
+ - %core.php_ext%
diff --git a/phpBB/config/default/container/services_http.yml b/phpBB/config/default/container/services_http.yml
new file mode 100644
index 0000000000..1285fd1d88
--- /dev/null
+++ b/phpBB/config/default/container/services_http.yml
@@ -0,0 +1,23 @@
+services:
+ http_kernel:
+ class: Symfony\Component\HttpKernel\HttpKernel
+ arguments:
+ - @dispatcher
+ - @controller.resolver
+ - @request_stack
+
+ # 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:
+ - @request
+
+ request_stack:
+ class: Symfony\Component\HttpFoundation\RequestStack
+
+ request:
+ class: phpbb\request\request
+ arguments:
+ - null
+ - %core.disable_super_globals%
diff --git a/phpBB/config/default/container/services_language.yml b/phpBB/config/default/container/services_language.yml
new file mode 100644
index 0000000000..aa3631ded1
--- /dev/null
+++ b/phpBB/config/default/container/services_language.yml
@@ -0,0 +1,22 @@
+services:
+ language.helper.language_file:
+ class: phpbb\language\language_file_helper
+ arguments:
+ - %core.root_path%
+
+ language:
+ class: phpbb\language\language
+ arguments:
+ - @language.loader
+
+ language.loader_abstract:
+ abstract: true
+ class: phpbb\language\language_file_loader
+ arguments:
+ - %core.root_path%
+ - %core.php_ext%
+
+ language.loader:
+ parent: language.loader_abstract
+ calls:
+ - [set_extension_manager, ["@ext.manager"]]
diff --git a/phpBB/config/db.yml b/phpBB/config/default/container/services_migrator.yml
index d11669d8a3..01bd7d3a11 100644
--- a/phpBB/config/db.yml
+++ b/phpBB/config/default/container/services_migrator.yml
@@ -1,19 +1,4 @@
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
@@ -60,6 +45,7 @@ services:
- @dbal.conn
- @cache
- @user
+ - @module.manager
- %core.root_path%
- %core.php_ext%
- %tables.modules%
diff --git a/phpBB/config/mimetype_guesser.yml b/phpBB/config/default/container/services_mimetype_guesser.yml
index 2e89ed3c1f..2e89ed3c1f 100644
--- a/phpBB/config/mimetype_guesser.yml
+++ b/phpBB/config/default/container/services_mimetype_guesser.yml
diff --git a/phpBB/config/default/container/services_module.yml b/phpBB/config/default/container/services_module.yml
new file mode 100644
index 0000000000..513b71553a
--- /dev/null
+++ b/phpBB/config/default/container/services_module.yml
@@ -0,0 +1,10 @@
+services:
+ module.manager:
+ class: phpbb\module\module_manager
+ arguments:
+ - @cache.driver
+ - @dbal.conn
+ - @ext.manager
+ - %tables.modules%
+ - %core.root_path%
+ - %core.php_ext%
diff --git a/phpBB/config/default/container/services_notification.yml b/phpBB/config/default/container/services_notification.yml
new file mode 100644
index 0000000000..c842656575
--- /dev/null
+++ b/phpBB/config/default/container/services_notification.yml
@@ -0,0 +1,222 @@
+services:
+ notification_manager:
+ class: phpbb\notification\manager
+ arguments:
+ - @notification.type_collection
+ - @notification.method_collection
+ - @service_container
+ - @user_loader
+ - @dispatcher
+ - @dbal.conn
+ - @cache
+ - @user
+ - %tables.notification_types%
+ - %tables.user_notifications%
+
+# ----- 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.type }
+
+ notification.type.base:
+ abstract: true
+ arguments:
+ - @dbal.conn
+ - @user
+ - @auth
+ - %core.root_path%
+ - %core.php_ext%
+ - %tables.user_notifications%
+
+ notification.type.admin_activate_user:
+ class: phpbb\notification\type\admin_activate_user
+ scope: prototype
+ parent: notification.type.base
+ calls:
+ - [set_user_loader, [@user_loader]]
+ - [set_config, [@config]]
+ tags:
+ - { name: notification.type }
+
+ notification.type.approve_post:
+ class: phpbb\notification\type\approve_post
+ scope: prototype
+ parent: notification.type.post
+ tags:
+ - { name: notification.type }
+
+ notification.type.approve_topic:
+ class: phpbb\notification\type\approve_topic
+ scope: prototype
+ parent: notification.type.topic
+ tags:
+ - { name: notification.type }
+
+ notification.type.bookmark:
+ class: phpbb\notification\type\bookmark
+ scope: prototype
+ parent: notification.type.post
+ tags:
+ - { name: notification.type }
+
+ notification.type.disapprove_post:
+ class: phpbb\notification\type\disapprove_post
+ scope: prototype
+ parent: notification.type.post
+ tags:
+ - { name: notification.type }
+
+ notification.type.disapprove_topic:
+ class: phpbb\notification\type\disapprove_topic
+ scope: prototype
+ parent: notification.type.topic
+ tags:
+ - { name: notification.type }
+
+ notification.type.group_request:
+ class: phpbb\notification\type\group_request
+ scope: prototype
+ parent: notification.type.base
+ calls:
+ - [set_user_loader, [@user_loader]]
+ tags:
+ - { name: notification.type }
+
+ notification.type.group_request_approved:
+ class: phpbb\notification\type\group_request_approved
+ scope: prototype
+ parent: notification.type.base
+ tags:
+ - { name: notification.type }
+
+ notification.type.pm:
+ class: phpbb\notification\type\pm
+ scope: prototype
+ parent: notification.type.base
+ calls:
+ - [set_user_loader, [@user_loader]]
+ - [set_config, [@config]]
+ tags:
+ - { name: notification.type }
+
+ notification.type.post:
+ class: phpbb\notification\type\post
+ scope: prototype
+ parent: notification.type.base
+ calls:
+ - [set_user_loader, [@user_loader]]
+ - [set_config, [@config]]
+ tags:
+ - { name: notification.type }
+
+ notification.type.post_in_queue:
+ class: phpbb\notification\type\post_in_queue
+ scope: prototype
+ parent: notification.type.post
+ tags:
+ - { name: notification.type }
+
+ notification.type.quote:
+ class: phpbb\notification\type\quote
+ scope: prototype
+ parent: notification.type.post
+ calls:
+ - [set_utils, [@text_formatter.utils]]
+ tags:
+ - { name: notification.type }
+
+ notification.type.report_pm:
+ class: phpbb\notification\type\report_pm
+ scope: prototype
+ parent: notification.type.pm
+ tags:
+ - { name: notification.type }
+
+ notification.type.report_pm_closed:
+ class: phpbb\notification\type\report_pm_closed
+ scope: prototype
+ parent: notification.type.pm
+ tags:
+ - { name: notification.type }
+
+ notification.type.report_post:
+ class: phpbb\notification\type\report_post
+ scope: prototype
+ parent: notification.type.post
+ tags:
+ - { name: notification.type }
+
+ notification.type.report_post_closed:
+ class: phpbb\notification\type\report_post_closed
+ scope: prototype
+ parent: notification.type.post
+ tags:
+ - { name: notification.type }
+
+ notification.type.topic:
+ class: phpbb\notification\type\topic
+ scope: prototype
+ parent: notification.type.base
+ calls:
+ - [set_user_loader, [@user_loader]]
+ - [set_config, [@config]]
+ tags:
+ - { name: notification.type }
+
+ notification.type.topic_in_queue:
+ class: phpbb\notification\type\topic_in_queue
+ scope: prototype
+ parent: notification.type.topic
+ 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.board:
+ class: phpbb\notification\method\board
+ scope: prototype # scope MUST be prototype for this to work!
+ arguments:
+ - @user_loader
+ - @dbal.conn
+ - @cache.driver
+ - @user
+ - @config
+ - %tables.notification_types%
+ - %tables.notifications%
+ tags:
+ - { name: notification.method }
+
+ notification.method.email:
+ class: phpbb\notification\method\email
+ scope: prototype
+ arguments:
+ - @user_loader
+ - @user
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ tags:
+ - { name: notification.method }
+
+ notification.method.jabber:
+ class: phpbb\notification\method\jabber
+ scope: prototype
+ arguments:
+ - @user_loader
+ - @user
+ - @config
+ - %core.root_path%
+ - %core.php_ext%
+ tags:
+ - { name: notification.method }
diff --git a/phpBB/config/password.yml b/phpBB/config/default/container/services_password.yml
index cb45ec3d42..cb45ec3d42 100644
--- a/phpBB/config/password.yml
+++ b/phpBB/config/default/container/services_password.yml
diff --git a/phpBB/config/default/container/services_php.yml b/phpBB/config/default/container/services_php.yml
new file mode 100644
index 0000000000..8aabc7341f
--- /dev/null
+++ b/phpBB/config/default/container/services_php.yml
@@ -0,0 +1,3 @@
+services:
+ php_ini:
+ class: phpbb\php\ini
diff --git a/phpBB/config/profilefield.yml b/phpBB/config/default/container/services_profilefield.yml
index 5ccfef9148..5ccfef9148 100644
--- a/phpBB/config/profilefield.yml
+++ b/phpBB/config/default/container/services_profilefield.yml
diff --git a/phpBB/config/default/container/services_report.yml b/phpBB/config/default/container/services_report.yml
new file mode 100644
index 0000000000..4bf929429e
--- /dev/null
+++ b/phpBB/config/default/container/services_report.yml
@@ -0,0 +1,53 @@
+services:
+# ----- Report controller -----
+ phpbb.report.controller:
+ class: phpbb\report\controller\report
+ arguments:
+ - @config
+ - @user
+ - @template
+ - @controller.helper
+ - @request
+ - @captcha.factory
+ - @phpbb.report.handler_factory
+ - @phpbb.report.report_reason_list_provider
+ - %core.root_path%
+ - %core.php_ext%
+
+# ----- Report handler factory -----
+ phpbb.report.handler_factory:
+ class: phpbb\report\handler_factory
+ arguments:
+ - @service_container
+
+# ----- Report UI provider -----
+ phpbb.report.report_reason_list_provider:
+ class: phpbb\report\report_reason_list_provider
+ arguments:
+ - @dbal.conn.driver
+ - @template
+ - @user
+
+# ----- Report handlers -----
+# Scope MUST be prototype for all the handlers to work correctly.
+ phpbb.report.handlers.report_handler_pm:
+ class: phpbb\report\report_handler_pm
+ scope: prototype
+ arguments:
+ - @dbal.conn.driver
+ - @dispatcher
+ - @config
+ - @auth
+ - @user
+ - @notification_manager
+
+ phpbb.report.handlers.report_handler_post:
+ class: phpbb\report\report_handler_post
+ scope: prototype
+ arguments:
+ - @dbal.conn.driver
+ - @dispatcher
+ - @config
+ - @auth
+ - @user
+ - @notification_manager
diff --git a/phpBB/config/default/container/services_routing.yml b/phpBB/config/default/container/services_routing.yml
new file mode 100644
index 0000000000..ec5ccd3b89
--- /dev/null
+++ b/phpBB/config/default/container/services_routing.yml
@@ -0,0 +1,31 @@
+services:
+ router:
+ class: phpbb\routing\router
+ arguments:
+ - @service_container
+ - @filesystem
+ - %core.root_path%
+ - %core.php_ext%
+ - %core.environment%
+ - @ext.manager
+
+ router.listener:
+ class: Symfony\Component\HttpKernel\EventListener\RouterListener
+ arguments:
+ - @router
+ - null
+ - null
+ - @request_stack
+ tags:
+ - { name: kernel.event_subscriber }
+
+ routing.helper:
+ class: phpbb\routing\helper
+ arguments:
+ - @config
+ - @router
+ - @symfony_request
+ - @request
+ - @filesystem
+ - %core.root_path%
+ - %core.php_ext%
diff --git a/phpBB/config/default/container/services_text_formatter.yml b/phpBB/config/default/container/services_text_formatter.yml
new file mode 100644
index 0000000000..5a3307175f
--- /dev/null
+++ b/phpBB/config/default/container/services_text_formatter.yml
@@ -0,0 +1,69 @@
+parameters:
+ text_formatter.cache.dir: %core.root_path%cache/%core.environment%/
+ text_formatter.cache.parser.key: _text_formatter_parser
+ text_formatter.cache.renderer.key: _text_formatter_renderer
+
+services:
+ text_formatter.cache:
+ alias: text_formatter.s9e.factory
+
+ text_formatter.data_access:
+ class: phpbb\textformatter\data_access
+ arguments:
+ - @dbal.conn
+ - %tables.bbcodes%
+ - %tables.smilies%
+ - %tables.styles%
+ - %tables.words%
+ - %core.root_path%styles/
+
+ text_formatter.parser:
+ alias: text_formatter.s9e.parser
+
+ text_formatter.renderer:
+ alias: text_formatter.s9e.renderer
+
+ text_formatter.utils:
+ alias: text_formatter.s9e.utils
+
+ text_formatter.s9e.factory:
+ class: phpbb\textformatter\s9e\factory
+ arguments:
+ - @text_formatter.data_access
+ - @cache.driver
+ - @dispatcher
+ - @config
+ - %text_formatter.cache.dir%
+ - %text_formatter.cache.parser.key%
+ - %text_formatter.cache.renderer.key%
+
+ text_formatter.s9e.parser:
+ class: phpbb\textformatter\s9e\parser
+ arguments:
+ - @cache.driver
+ - %text_formatter.cache.parser.key%
+ - @text_formatter.s9e.factory
+ - @dispatcher
+
+ text_formatter.s9e.quote_helper:
+ class: phpbb\textformatter\s9e\quote_helper
+ arguments:
+ - @user
+ - %core.root_path%
+ - %core.php_ext%
+
+ text_formatter.s9e.renderer:
+ class: phpbb\textformatter\s9e\renderer
+ arguments:
+ - @cache.driver
+ - %text_formatter.cache.dir%
+ - %text_formatter.cache.renderer.key%
+ - @text_formatter.s9e.factory
+ - @dispatcher
+ calls:
+ - [configure_quote_helper, [@text_formatter.s9e.quote_helper]]
+ - [configure_smilies_path, [@config, @path_helper]]
+ - [configure_user, [@user, @config, @auth]]
+
+ text_formatter.s9e.utils:
+ class: phpbb\textformatter\s9e\utils
diff --git a/phpBB/config/default/container/services_text_reparser.yml b/phpBB/config/default/container/services_text_reparser.yml
new file mode 100644
index 0000000000..5d54e8dc82
--- /dev/null
+++ b/phpBB/config/default/container/services_text_reparser.yml
@@ -0,0 +1,70 @@
+services:
+ text_reparser_collection:
+ class: phpbb\di\service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: text_reparser.plugin }
+
+ text_reparser.contact_admin_info:
+ class: phpbb\textreparser\plugins\contact_admin_info
+ arguments:
+ - @config_text
+ tags:
+ - { name: text_reparser.plugin }
+
+ text_reparser.forum_description:
+ class: phpbb\textreparser\plugins\forum_description
+ arguments:
+ - @dbal.conn
+ tags:
+ - { name: text_reparser.plugin }
+
+ text_reparser.forum_rules:
+ class: phpbb\textreparser\plugins\forum_rules
+ arguments:
+ - @dbal.conn
+ tags:
+ - { name: text_reparser.plugin }
+
+ text_reparser.group_description:
+ class: phpbb\textreparser\plugins\group_description
+ arguments:
+ - @dbal.conn
+ tags:
+ - { name: text_reparser.plugin }
+
+ text_reparser.pm_text:
+ class: phpbb\textreparser\plugins\pm_text
+ arguments:
+ - @dbal.conn
+ tags:
+ - { name: text_reparser.plugin }
+
+ text_reparser.poll_option:
+ class: phpbb\textreparser\plugins\poll_option
+ arguments:
+ - @dbal.conn
+ tags:
+ - { name: text_reparser.plugin }
+
+ text_reparser.poll_title:
+ class: phpbb\textreparser\plugins\poll_title
+ arguments:
+ - @dbal.conn
+ tags:
+ - { name: text_reparser.plugin }
+
+ text_reparser.post_text:
+ class: phpbb\textreparser\plugins\post_text
+ arguments:
+ - @dbal.conn
+ tags:
+ - { name: text_reparser.plugin }
+
+ text_reparser.user_signature:
+ class: phpbb\textreparser\plugins\user_signature
+ arguments:
+ - @dbal.conn
+ tags:
+ - { name: text_reparser.plugin }
diff --git a/phpBB/config/default/container/services_twig.yml b/phpBB/config/default/container/services_twig.yml
new file mode 100644
index 0000000000..4132be49fa
--- /dev/null
+++ b/phpBB/config/default/container/services_twig.yml
@@ -0,0 +1,65 @@
+parameters:
+ core.template.cache_path: %core.root_path%cache/%core.environment%/twig/
+
+services:
+ template.twig.environment:
+ class: phpbb\template\twig\environment
+ arguments:
+ - @config
+ - @filesystem
+ - @path_helper
+ - @service_container
+ - %core.template.cache_path%
+ - @ext.manager
+ - @template.twig.loader
+ - []
+
+ template.twig.lexer:
+ class: phpbb\template\twig\lexer
+ arguments:
+ - @template.twig.environment
+
+ template.twig.loader:
+ class: phpbb\template\twig\loader
+ arguments:
+ - @filesystem
+
+ template.twig.extensions.collection:
+ class: phpbb\di\service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: twig.extension }
+
+ template.twig.extensions.phpbb:
+ class: phpbb\template\twig\extension
+ arguments:
+ - @template_context
+ - @language
+ tags:
+ - { name: twig.extension }
+
+ template.twig.extensions.routing:
+ class: phpbb\template\twig\extension\routing
+ arguments:
+ - @routing.helper
+ tags:
+ - { name: twig.extension }
+
+ template.twig.extensions.debug:
+ class: Twig_Extension_Debug
+
+ template:
+ class: phpbb\template\twig\twig
+ arguments:
+ - @path_helper
+ - @config
+ - @template_context
+ - @template.twig.environment
+ - %core.template.cache_path%
+ - @user
+ - @template.twig.extensions.collection
+ - @ext.manager
+
+ template_context:
+ class: phpbb\template\context
diff --git a/phpBB/config/user.yml b/phpBB/config/default/container/services_user.yml
index 1ca853ea45..ff114f022a 100644
--- a/phpBB/config/user.yml
+++ b/phpBB/config/default/container/services_user.yml
@@ -8,6 +8,7 @@ services:
user:
class: phpbb\user
arguments:
+ - @language
- %datetime.class%
user_loader:
diff --git a/phpBB/config/tables.yml b/phpBB/config/default/container/tables.yml
index 2fe2a33be8..c4b5ac2375 100644
--- a/phpBB/config/tables.yml
+++ b/phpBB/config/default/container/tables.yml
@@ -1,6 +1,7 @@
parameters:
tables.auth_provider_oauth_token_storage: %core.table_prefix%oauth_tokens
tables.auth_provider_oauth_account_assoc: %core.table_prefix%oauth_accounts
+ tables.bbcodes: %core.table_prefix%bbcodes
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
@@ -10,6 +11,7 @@ parameters:
tables.forums: %core.table_prefix%forums
tables.log: %core.table_prefix%log
tables.migrations: %core.table_prefix%migrations
+ tables.moderator_cache: %core.table_prefix%moderator_cache
tables.modules: %core.table_prefix%modules
tables.notification_types: %core.table_prefix%notification_types
tables.notifications: %core.table_prefix%notifications
@@ -18,6 +20,9 @@ parameters:
tables.profile_fields_options_language: %core.table_prefix%profile_fields_lang
tables.profile_fields_language: %core.table_prefix%profile_lang
tables.posts: %core.table_prefix%posts
+ tables.smilies: %core.table_prefix%smilies
+ tables.styles: %core.table_prefix%styles
tables.topics: %core.table_prefix%topics
tables.user_notifications: %core.table_prefix%user_notifications
tables.users: %core.table_prefix%users
+ tables.words: %core.table_prefix%words
diff --git a/phpBB/config/default/routing/feed.yml b/phpBB/config/default/routing/feed.yml
new file mode 100644
index 0000000000..22c9ea5755
--- /dev/null
+++ b/phpBB/config/default/routing/feed.yml
@@ -0,0 +1,35 @@
+phpbb_feed_forums:
+ path: /forums
+ defaults: { _controller: phpbb.feed.controller:forums }
+
+phpbb_feed_news:
+ path: /news
+ defaults: { _controller: phpbb.feed.controller:news }
+
+phpbb_feed_topics:
+ path: /topics
+ defaults: { _controller: phpbb.feed.controller:topics }
+
+phpbb_feed_topics_active:
+ path: /topics_active
+ defaults: { _controller: phpbb.feed.controller:topics_active }
+
+phpbb_feed_topics_new:
+ path: /topics_new
+ defaults: { _controller: phpbb.feed.controller:topics_new }
+
+phpbb_feed_forum:
+ path: /forum/{forum_id}
+ defaults: { _controller: phpbb.feed.controller:forum }
+ requirements:
+ forum_id: \d+
+
+phpbb_feed_topic:
+ path: /topic/{topic_id}
+ defaults: { _controller: phpbb.feed.controller:topic }
+ requirements:
+ topic_id: \d+
+
+phpbb_feed_overall:
+ path: /{mode}
+ defaults: { _controller: phpbb.feed.controller:overall }
diff --git a/phpBB/config/default/routing/help.yml b/phpBB/config/default/routing/help.yml
new file mode 100644
index 0000000000..8d43839d1e
--- /dev/null
+++ b/phpBB/config/default/routing/help.yml
@@ -0,0 +1,7 @@
+phpbb_help_bbcode_controller:
+ path: /bbcode
+ defaults: { _controller: phpbb.help.controller.bbcode:handle }
+
+phpbb_help_faq_controller:
+ path: /faq
+ defaults: { _controller: phpbb.help.controller.faq:handle }
diff --git a/phpBB/config/default/routing/report.yml b/phpBB/config/default/routing/report.yml
new file mode 100644
index 0000000000..dbe2d853c0
--- /dev/null
+++ b/phpBB/config/default/routing/report.yml
@@ -0,0 +1,17 @@
+phpbb_report_pm_controller:
+ path: /pm/{id}/report
+ methods: [GET, POST]
+ defaults:
+ _controller: phpbb.report.controller:handle
+ mode: "pm"
+ requirements:
+ id: \d+
+
+phpbb_report_post_controller:
+ path: /post/{id}/report
+ methods: [GET, POST]
+ defaults:
+ _controller: phpbb.report.controller:handle
+ mode: "post"
+ requirements:
+ id: \d+
diff --git a/phpBB/config/default/routing/routing.yml b/phpBB/config/default/routing/routing.yml
new file mode 100644
index 0000000000..073984841a
--- /dev/null
+++ b/phpBB/config/default/routing/routing.yml
@@ -0,0 +1,24 @@
+# Structure:
+#
+# foo_controller:
+# path: /foo
+# defaults: { _controller: foo_sevice:method }
+#
+# The above will be accessed via app.php?controller=foo and it will
+# instantiate the "foo_service" service and call the "method" method.
+#
+
+phpbb_feed_routing:
+ resource: "feed.yml"
+ prefix: /feed
+
+phpbb_feed_index:
+ path: /feed
+ defaults: { _controller: phpbb.feed.controller:overall }
+
+phpbb_help_routing:
+ resource: "help.yml"
+ prefix: /help
+
+phpbb_report_routing:
+ resource: "report.yml"
diff --git a/phpBB/config/development/config.yml b/phpBB/config/development/config.yml
new file mode 100644
index 0000000000..93ae07fb3f
--- /dev/null
+++ b/phpBB/config/development/config.yml
@@ -0,0 +1,10 @@
+imports:
+ - { resource: ../default/config.yml }
+
+core:
+ require_dev_dependencies: true
+
+ twig:
+ debug: true
+ auto_reload: true
+ enable_debug_extension: true
diff --git a/phpBB/config/development/container/environment.yml b/phpBB/config/development/container/environment.yml
new file mode 100644
index 0000000000..40a3c7a683
--- /dev/null
+++ b/phpBB/config/development/container/environment.yml
@@ -0,0 +1,3 @@
+imports:
+ - { resource: services.yml }
+ - { resource: parameters.yml }
diff --git a/phpBB/config/development/container/parameters.yml b/phpBB/config/development/container/parameters.yml
new file mode 100644
index 0000000000..0447646806
--- /dev/null
+++ b/phpBB/config/development/container/parameters.yml
@@ -0,0 +1,2 @@
+imports:
+ - { resource: ../../default/container/parameters.yml }
diff --git a/phpBB/config/development/container/services.yml b/phpBB/config/development/container/services.yml
new file mode 100644
index 0000000000..b302f0f966
--- /dev/null
+++ b/phpBB/config/development/container/services.yml
@@ -0,0 +1,2 @@
+imports:
+ - { resource: ../../default/container/services.yml }
diff --git a/phpBB/config/development/routing/environment.yml b/phpBB/config/development/routing/environment.yml
new file mode 100644
index 0000000000..0cddfb7521
--- /dev/null
+++ b/phpBB/config/development/routing/environment.yml
@@ -0,0 +1,2 @@
+core.default:
+ resource: "../../default/routing/routing.yml"
diff --git a/phpBB/config/installer/config.yml b/phpBB/config/installer/config.yml
new file mode 100644
index 0000000000..979dbbcdd9
--- /dev/null
+++ b/phpBB/config/installer/config.yml
@@ -0,0 +1,2 @@
+imports:
+ - { resource: ../default/config.yml }
diff --git a/phpBB/config/installer/container/environment.yml b/phpBB/config/installer/container/environment.yml
new file mode 100644
index 0000000000..40a3c7a683
--- /dev/null
+++ b/phpBB/config/installer/container/environment.yml
@@ -0,0 +1,3 @@
+imports:
+ - { resource: services.yml }
+ - { resource: parameters.yml }
diff --git a/phpBB/config/installer/container/parameters.yml b/phpBB/config/installer/container/parameters.yml
new file mode 100644
index 0000000000..0447646806
--- /dev/null
+++ b/phpBB/config/installer/container/parameters.yml
@@ -0,0 +1,2 @@
+imports:
+ - { resource: ../../default/container/parameters.yml }
diff --git a/phpBB/config/installer/container/services.yml b/phpBB/config/installer/container/services.yml
new file mode 100644
index 0000000000..8296bcc079
--- /dev/null
+++ b/phpBB/config/installer/container/services.yml
@@ -0,0 +1,70 @@
+imports:
+ - { resource: services_installer.yml }
+ - { resource: ../../default/container/services_files.yml }
+ - { resource: ../../default/container/services_http.yml }
+ - { resource: ../../default/container/services_language.yml }
+ - { resource: ../../default/container/services_php.yml }
+ - { resource: ../../default/container/services_routing.yml }
+ - { resource: ../../default/container/services_twig.yml }
+
+services:
+ config:
+ class: phpbb\config\config
+ arguments:
+ - []
+
+ controller.resolver:
+ class: phpbb\controller\resolver
+ arguments:
+ - @service_container
+ - %core.root_path%
+ - @template
+
+ dispatcher:
+ class: phpbb\event\dispatcher
+ arguments:
+ - @service_container
+
+ language.loader:
+ parent: language.loader_abstract
+
+ path_helper:
+ class: phpbb\path_helper
+ arguments:
+ - @symfony_request
+ - @filesystem
+ - @request
+ - %core.root_path%
+ - %core.php_ext%
+
+ router:
+ class: phpbb\routing\router
+ arguments:
+ - @service_container
+ - @filesystem
+ - %core.root_path%
+ - %core.php_ext%
+ - %core.environment%
+
+ template:
+ class: phpbb\template\twig\twig
+ arguments:
+ - @path_helper
+ - @config
+ - @template_context
+ - @template.twig.environment
+ - %core.template.cache_path%
+ - null
+ - @template.twig.extensions.collection
+
+ template.twig.environment:
+ class: phpbb\template\twig\environment
+ arguments:
+ - @config
+ - @filesystem
+ - @path_helper
+ - @service_container
+ - %core.template.cache_path%
+ - null
+ - @template.twig.loader
+ - []
diff --git a/phpBB/config/installer/container/services_install_console.yml b/phpBB/config/installer/container/services_install_console.yml
new file mode 100644
index 0000000000..1c1b819e82
--- /dev/null
+++ b/phpBB/config/installer/container/services_install_console.yml
@@ -0,0 +1,36 @@
+services:
+ console.installer.command_collection:
+ class: phpbb\di\service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: console.installer.command }
+
+ console.installer.command.install:
+ class: phpbb\install\console\command\install\install
+ arguments:
+ - @language
+ - @installer.helper.iohandler_factory
+ - @installer.installer.install
+ - @installer.helper.install_helper
+ tags:
+ - { name: console.installer.command }
+
+ console.installer.command.config.show:
+ class: phpbb\install\console\command\install\config\show
+ arguments:
+ - @language
+ - @installer.helper.iohandler_factory
+ - @installer.installer.install
+ tags:
+ - { name: console.installer.command }
+
+
+ console.installer.command.config.validate:
+ class: phpbb\install\console\command\install\config\validate
+ arguments:
+ - @language
+ - @installer.helper.iohandler_factory
+ - @installer.installer.install
+ tags:
+ - { name: console.installer.command }
diff --git a/phpBB/config/installer/container/services_install_controller.yml b/phpBB/config/installer/container/services_install_controller.yml
new file mode 100644
index 0000000000..a3595ff0a3
--- /dev/null
+++ b/phpBB/config/installer/container/services_install_controller.yml
@@ -0,0 +1,34 @@
+services:
+ phpbb.installer.controller.welcome:
+ class: phpbb\install\controller\installer_index
+ arguments:
+ - @phpbb.installer.controller.helper
+ - @language
+ - @template
+ - %core.root_path%
+
+ phpbb.installer.controller.helper:
+ class: phpbb\install\controller\helper
+ arguments:
+ - @language
+ - @language.helper.language_file
+ - @installer.navigation.provider
+ - @template
+ - @path_helper
+ - @request
+ - @symfony_request
+ - @router
+ - %core.root_path%
+
+ phpbb.installer.controller.install:
+ class: phpbb\install\controller\install
+ arguments:
+ - @phpbb.installer.controller.helper
+ - @installer.helper.config
+ - @installer.helper.iohandler_factory
+ - @installer.navigation.provider
+ - @language
+ - @template
+ - @request
+ - @installer.installer.install
+ - @installer.helper.install_helper
diff --git a/phpBB/config/installer/container/services_install_data.yml b/phpBB/config/installer/container/services_install_data.yml
new file mode 100644
index 0000000000..ea5b5a2c52
--- /dev/null
+++ b/phpBB/config/installer/container/services_install_data.yml
@@ -0,0 +1,44 @@
+services:
+ installer.install_data.add_bots:
+ class: phpbb\install\module\install_data\task\add_bots
+ arguments:
+ - @installer.helper.config
+ - @installer.helper.iohandler
+ - @installer.helper.container_factory
+ - @language
+ - %core.root_path%
+ - %core.php_ext%
+ tags:
+ - { name: install_data_install, order: 20 }
+
+ installer.install_data.add_languages:
+ class: phpbb\install\module\install_data\task\add_languages
+ arguments:
+ - @installer.helper.iohandler
+ - @installer.helper.container_factory
+ - @language.helper.language_file
+ tags:
+ - { name: install_data_install, order: 10 }
+
+ installer.install_data.add_modules:
+ class: phpbb\install\module\install_data\task\add_modules
+ arguments:
+ - @installer.helper.iohandler
+ - @installer.helper.container_factory
+ tags:
+ - { name: install_data_install, order: 30 }
+
+ installer.module.data_install_collection:
+ class: phpbb\di\ordered_service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: install_data_install, class_name_aware: true }
+
+ installer.module.data_install:
+ class: phpbb\install\module\install_data\module
+ parent: installer.module_base
+ arguments:
+ - @installer.module.data_install_collection
+ tags:
+ - { name: installer_install_module, order: 50 }
diff --git a/phpBB/config/installer/container/services_install_database.yml b/phpBB/config/installer/container/services_install_database.yml
new file mode 100644
index 0000000000..743d62bae5
--- /dev/null
+++ b/phpBB/config/installer/container/services_install_database.yml
@@ -0,0 +1,51 @@
+services:
+ installer.install_database.create_schema:
+ class: phpbb\install\module\install_database\task\create_schema
+ arguments:
+ - @installer.helper.config
+ - @installer.helper.database
+ - @filesystem
+ - @installer.helper.iohandler
+ - %core.root_path%
+ - %core.php_ext%
+ tags:
+ - { name: install_database_install, order: 10 }
+
+ installer.install_database.add_default_data:
+ class: phpbb\install\module\install_database\task\add_default_data
+ arguments:
+ - @installer.helper.database
+ - @installer.helper.config
+ - @installer.helper.iohandler
+ - @installer.helper.container_factory
+ - @language
+ - %core.root_path%
+ tags:
+ - { name: install_database_install, order: 20 }
+
+ installer.install_database.add_config_settings:
+ class: phpbb\install\module\install_database\task\add_config_settings
+ arguments:
+ - @filesystem
+ - @installer.helper.config
+ - @installer.helper.iohandler
+ - @installer.helper.container_factory
+ - @language
+ - %core.root_path%
+ tags:
+ - { name: install_database_install, order: 30 }
+
+ installer.module.install_database_collection:
+ class: phpbb\di\ordered_service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: install_database_install, class_name_aware: true }
+
+ installer.module.database_install:
+ class: phpbb\install\module\install_database\module
+ parent: installer.module_base
+ arguments:
+ - @installer.module.install_database_collection
+ tags:
+ - { name: installer_install_module, order: 40 }
diff --git a/phpBB/config/installer/container/services_install_filesystem.yml b/phpBB/config/installer/container/services_install_filesystem.yml
new file mode 100644
index 0000000000..776d7b9198
--- /dev/null
+++ b/phpBB/config/installer/container/services_install_filesystem.yml
@@ -0,0 +1,27 @@
+services:
+ installer.install_filesystem.create_config_file:
+ class: phpbb\install\module\install_filesystem\task\create_config_file
+ arguments:
+ - @filesystem
+ - @installer.helper.config
+ - @installer.helper.database
+ - @installer.helper.iohandler
+ - %core.root_path%
+ - %core.php_ext%
+ tags:
+ - { name: install_filesystem_install, order: 10 }
+
+ installer.module.install_filesystem_collection:
+ class: phpbb\di\ordered_service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: install_filesystem_install, class_name_aware: true }
+
+ installer.module.filesystem_install:
+ class: phpbb\install\module\install_filesystem\module
+ parent: installer.module_base
+ arguments:
+ - @installer.module.install_filesystem_collection
+ tags:
+ - { name: installer_install_module, order: 30 }
diff --git a/phpBB/config/installer/container/services_install_finish.yml b/phpBB/config/installer/container/services_install_finish.yml
new file mode 100644
index 0000000000..1dd280306a
--- /dev/null
+++ b/phpBB/config/installer/container/services_install_finish.yml
@@ -0,0 +1,33 @@
+services:
+ installer.install_finish.populate_migrations:
+ class: phpbb\install\module\install_finish\task\populate_migrations
+ arguments:
+ - @installer.helper.container_factory
+ tags:
+ - { name: install_finish, order: 10 }
+
+ installer.install_finish.notify_user:
+ class: phpbb\install\module\install_finish\task\notify_user
+ arguments:
+ - @installer.helper.container_factory
+ - @installer.helper.config
+ - @installer.helper.iohandler
+ - %core.root_path%
+ - %core.php_ext%
+ tags:
+ - { name: install_finish, order: 20 }
+
+ installer.module.install_finish_collection:
+ class: phpbb\di\ordered_service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: install_finish, class_name_aware: true }
+
+ installer.module.finish_install:
+ class: phpbb\install\module\install_filesystem\module
+ parent: installer.module_base
+ arguments:
+ - @installer.module.install_finish_collection
+ tags:
+ - { name: installer_install_module, order: 60 }
diff --git a/phpBB/config/installer/container/services_install_navigation.yml b/phpBB/config/installer/container/services_install_navigation.yml
new file mode 100644
index 0000000000..53e20e89cc
--- /dev/null
+++ b/phpBB/config/installer/container/services_install_navigation.yml
@@ -0,0 +1,27 @@
+services:
+ installer.navigation.provider:
+ class: phpbb\install\helper\navigation\navigation_provider
+ arguments:
+ - @installer.navigation.service_collection
+
+ installer.navigation.service_collection:
+ class: phpbb\di\service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: installer.navigation }
+
+ installer.navigation.main_navigation:
+ class: phpbb\install\helper\navigation\main_navigation
+ scope: prototype
+ tags:
+ - { name: installer.navigation }
+
+ installer.navigation.install_navigation:
+ class: phpbb\install\helper\navigation\install_navigation
+ arguments:
+ - @installer.helper.install_helper
+ scope: prototype
+ tags:
+ - { name: installer.navigation }
+
diff --git a/phpBB/config/installer/container/services_install_obtain_data.yml b/phpBB/config/installer/container/services_install_obtain_data.yml
new file mode 100644
index 0000000000..a1fab313c4
--- /dev/null
+++ b/phpBB/config/installer/container/services_install_obtain_data.yml
@@ -0,0 +1,66 @@
+services:
+ installer.obtain_data.obtain_admin_data:
+ class: phpbb\install\module\obtain_data\task\obtain_admin_data
+ arguments:
+ - @installer.helper.config
+ - @installer.helper.iohandler
+ tags:
+ - { name: install_obtain_data, order: 10 }
+
+ installer.obtain_data.obtain_board_data:
+ class: phpbb\install\module\obtain_data\task\obtain_board_data
+ arguments:
+ - @installer.helper.config
+ - @installer.helper.iohandler
+ - @language.helper.language_file
+ tags:
+ - { name: install_obtain_data, order: 50 }
+
+ installer.obtain_data.obtain_database_data:
+ class: phpbb\install\module\obtain_data\task\obtain_database_data
+ arguments:
+ - @installer.helper.database
+ - @installer.helper.config
+ - @installer.helper.iohandler
+ tags:
+ - { name: install_obtain_data, order: 20 }
+
+ installer.obtain_data.obtain_email_data:
+ class: phpbb\install\module\obtain_data\task\obtain_email_data
+ arguments:
+ - @installer.helper.config
+ - @installer.helper.iohandler
+ tags:
+ - { name: install_obtain_data, order: 40 }
+
+ installer.obtain_data.obtain_imagick_path:
+ class: phpbb\install\module\obtain_data\task\obtain_imagick_path
+ arguments:
+ - @installer.helper.config
+ tags:
+ - { name: install_obtain_data, order: 60 }
+
+ installer.obtain_data.obtain_server_data:
+ class: phpbb\install\module\obtain_data\task\obtain_server_data
+ arguments:
+ - @installer.helper.config
+ - @installer.helper.iohandler
+ tags:
+ - { name: install_obtain_data, order: 30 }
+
+ installer.module.install_obtain_data_collection:
+ class: phpbb\di\ordered_service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: install_obtain_data, class_name_aware: true }
+
+ installer.module.obtain_data_install:
+ class: phpbb\install\module\obtain_data\module
+ parent: installer.module_base
+ arguments:
+ - @installer.module.install_obtain_data_collection
+ - true
+ - false
+ tags:
+ - { name: installer_install_module, order: 20 }
diff --git a/phpBB/config/installer/container/services_install_requirements.yml b/phpBB/config/installer/container/services_install_requirements.yml
new file mode 100644
index 0000000000..f368031707
--- /dev/null
+++ b/phpBB/config/installer/container/services_install_requirements.yml
@@ -0,0 +1,36 @@
+services:
+ installer.requirements.check_filesystem:
+ class: phpbb\install\module\requirements\task\check_filesystem
+ arguments:
+ - @filesystem
+ - @installer.helper.iohandler
+ - %core.root_path%
+ - %core.php_ext%
+ tags:
+ - { name: installer_requirements, order: 10 }
+
+ installer.requirements.check_server_environment:
+ class: phpbb\install\module\requirements\task\check_server_environment
+ arguments:
+ - @installer.helper.database
+ - @installer.helper.iohandler
+ tags:
+ - { name: installer_requirements, order: 20 }
+
+ installer.module.install_requirements_collection:
+ class: phpbb\di\ordered_service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: installer_requirements, class_name_aware: true }
+
+# Please note, that the name of this module is hard coded in the installer service
+ installer.module.requirements_install:
+ class: phpbb\install\module\requirements\module
+ parent: installer.module_base
+ arguments:
+ - @installer.module.install_requirements_collection
+ - true
+ - false
+ tags:
+ - { name: installer_install_module, order: 10 }
diff --git a/phpBB/config/installer/container/services_installer.yml b/phpBB/config/installer/container/services_installer.yml
new file mode 100644
index 0000000000..62137aa9d8
--- /dev/null
+++ b/phpBB/config/installer/container/services_installer.yml
@@ -0,0 +1,87 @@
+imports:
+ - { resource: services_install_console.yml }
+ - { resource: services_install_controller.yml }
+ - { resource: services_install_data.yml }
+ - { resource: services_install_database.yml }
+ - { resource: services_install_filesystem.yml }
+ - { resource: services_install_finish.yml }
+ - { resource: services_install_navigation.yml }
+ - { resource: services_install_obtain_data.yml }
+ - { resource: services_install_requirements.yml }
+
+services:
+# -------- Installer helpers ------------------------
+ installer.helper.config:
+ class: phpbb\install\helper\config
+ arguments:
+ - @filesystem
+ - @php_ini
+ - %core.root_path%
+
+ installer.helper.database:
+ class: phpbb\install\helper\database
+ arguments:
+ - @filesystem
+ - %core.root_path%
+
+ installer.helper.iohandler_factory:
+ class: phpbb\install\helper\iohandler\factory
+ arguments:
+ - @service_container
+
+ installer.helper.iohandler_abstract:
+ abstract: true
+ calls:
+ - [set_language, ["@language"]]
+
+ installer.helper.iohandler_ajax:
+ class: phpbb\install\helper\iohandler\ajax_iohandler
+ parent: installer.helper.iohandler_abstract
+ arguments:
+ - @request
+ - @template
+
+ installer.helper.iohandler_cli:
+ class: phpbb\install\helper\iohandler\cli_iohandler
+ parent: installer.helper.iohandler_abstract
+
+ installer.helper.iohandler:
+ class: phpbb\install\helper\iohandler\iohandler_interface
+ factory: ["@installer.helper.iohandler_factory", get]
+
+ installer.helper.container_factory:
+ class: phpbb\install\helper\container_factory
+ arguments:
+ - @request
+ - %core.root_path%
+ - %core.php_ext%
+
+ installer.helper.install_helper:
+ class: phpbb\install\helper\install_helper
+ arguments:
+ - %core.root_path%
+ - %core.php_ext%
+
+# -------- Installer --------------------------------
+ installer.module_base:
+ abstract: true
+ calls:
+ - [setup, [@installer.helper.config, @installer.helper.iohandler]]
+
+ installer.installer.abstract:
+ class: phpbb\install\installer
+ abstract: true
+ arguments:
+ - @installer.helper.config
+
+ installer.install.module_collection:
+ class: phpbb\di\ordered_service_collection
+ arguments:
+ - @service_container
+ tags:
+ - { name: service_collection, tag: installer_install_module }
+
+ installer.installer.install:
+ parent: installer.installer.abstract
+ calls:
+ - [set_modules, [@installer.install.module_collection]]
diff --git a/phpBB/config/installer/routing/environment.yml b/phpBB/config/installer/routing/environment.yml
new file mode 100644
index 0000000000..60324c975b
--- /dev/null
+++ b/phpBB/config/installer/routing/environment.yml
@@ -0,0 +1,2 @@
+core.default:
+ resource: "installer.yml"
diff --git a/phpBB/config/installer/routing/installer.yml b/phpBB/config/installer/routing/installer.yml
new file mode 100644
index 0000000000..80a995ab6e
--- /dev/null
+++ b/phpBB/config/installer/routing/installer.yml
@@ -0,0 +1,22 @@
+phpbb_installer_index:
+ path: /
+ defaults:
+ _controller: phpbb.installer.controller.welcome:handle
+ mode: "intro"
+
+phpbb_installer_license:
+ path: /license
+ defaults:
+ _controller: phpbb.installer.controller.welcome:handle
+ mode: "license"
+
+phpbb_installer_support:
+ path: /support
+ defaults:
+ _controller: phpbb.installer.controller.welcome:handle
+ mode: "support"
+
+phpbb_installer_install:
+ path: /install
+ defaults:
+ _controller: phpbb.installer.controller.install:handle
diff --git a/phpBB/config/notification.yml b/phpBB/config/notification.yml
deleted file mode 100644
index b17a172fb5..0000000000
--- a/phpBB/config/notification.yml
+++ /dev/null
@@ -1,390 +0,0 @@
-services:
- notification_manager:
- class: phpbb\notification\manager
- arguments:
- - @notification.type_collection
- - @notification.method_collection
- - @service_container
- - @user_loader
- - @config
- - @dispatcher
- - @dbal.conn
- - @cache
- - @user
- - %core.root_path%
- - %core.php_ext%
- - %tables.notification_types%
- - %tables.notifications%
- - %tables.user_notifications%
-
-# ----- 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.type }
-
- notification.type.approve_post:
- class: phpbb\notification\type\approve_post
- scope: prototype
- arguments:
- - @user_loader
- - @dbal.conn
- - @cache.driver
- - @user
- - @auth
- - @config
- - %core.root_path%
- - %core.php_ext%
- - %tables.notification_types%
- - %tables.notifications%
- - %tables.user_notifications%
- tags:
- - { name: notification.type }
-
- notification.type.approve_topic:
- class: phpbb\notification\type\approve_topic
- scope: prototype
- arguments:
- - @user_loader
- - @dbal.conn
- - @cache.driver
- - @user
- - @auth
- - @config
- - %core.root_path%
- - %core.php_ext%
- - %tables.notification_types%
- - %tables.notifications%
- - %tables.user_notifications%
- tags:
- - { name: notification.type }
-
- notification.type.bookmark:
- class: phpbb\notification\type\bookmark
- scope: prototype
- arguments:
- - @user_loader
- - @dbal.conn
- - @cache.driver
- - @user
- - @auth
- - @config
- - %core.root_path%
- - %core.php_ext%
- - %tables.notification_types%
- - %tables.notifications%
- - %tables.user_notifications%
- tags:
- - { name: notification.type }
-
- notification.type.disapprove_post:
- class: phpbb\notification\type\disapprove_post
- scope: prototype
- arguments:
- - @user_loader
- - @dbal.conn
- - @cache.driver
- - @user
- - @auth
- - @config
- - %core.root_path%
- - %core.php_ext%
- - %tables.notification_types%
- - %tables.notifications%
- - %tables.user_notifications%
- tags:
- - { name: notification.type }
-
- notification.type.disapprove_topic:
- class: phpbb\notification\type\disapprove_topic
- scope: prototype
- arguments:
- - @user_loader
- - @dbal.conn
- - @cache.driver
- - @user
- - @auth
- - @config
- - %core.root_path%
- - %core.php_ext%
- - %tables.notification_types%
- - %tables.notifications%
- - %tables.user_notifications%
- tags:
- - { name: notification.type }
-
- notification.type.group_request:
- class: phpbb\notification\type\group_request
- scope: prototype
- arguments:
- - @user_loader
- - @dbal.conn
- - @cache.driver
- - @user
- - @auth
- - @config
- - %core.root_path%
- - %core.php_ext%
- - %tables.notification_types%
- - %tables.notifications%
- - %tables.user_notifications%
- tags:
- - { name: notification.type }
-
- notification.type.group_request_approved:
- class: phpbb\notification\type\group_request_approved
- scope: prototype
- arguments:
- - @user_loader
- - @dbal.conn
- - @cache.driver
- - @user
- - @auth
- - @config
- - %core.root_path%
- - %core.php_ext%
- - %tables.notification_types%
- - %tables.notifications%
- - %tables.user_notifications%
- tags:
- - { name: notification.type }
-
- notification.type.pm:
- class: phpbb\notification\type\pm
- scope: prototype
- arguments:
- - @user_loader
- - @dbal.conn
- - @cache.driver
- - @user
- - @auth
- - @config
- - %core.root_path%
- - %core.php_ext%
- - %tables.notification_types%
- - %tables.notifications%
- - %tables.user_notifications%
- tags:
- - { name: notification.type }
-
- notification.type.post:
- class: phpbb\notification\type\post
- scope: prototype
- arguments:
- - @user_loader
- - @dbal.conn
- - @cache.driver
- - @user
- - @auth
- - @config
- - %core.root_path%
- - %core.php_ext%
- - %tables.notification_types%
- - %tables.notifications%
- - %tables.user_notifications%
- tags:
- - { name: notification.type }
-
- notification.type.post_in_queue:
- class: phpbb\notification\type\post_in_queue
- scope: prototype
- arguments:
- - @user_loader
- - @dbal.conn
- - @cache.driver
- - @user
- - @auth
- - @config
- - %core.root_path%
- - %core.php_ext%
- - %tables.notification_types%
- - %tables.notifications%
- - %tables.user_notifications%
- tags:
- - { name: notification.type }
-
- notification.type.quote:
- class: phpbb\notification\type\quote
- scope: prototype
- arguments:
- - @user_loader
- - @dbal.conn
- - @cache.driver
- - @user
- - @auth
- - @config
- - %core.root_path%
- - %core.php_ext%
- - %tables.notification_types%
- - %tables.notifications%
- - %tables.user_notifications%
- tags:
- - { name: notification.type }
-
- notification.type.report_pm:
- class: phpbb\notification\type\report_pm
- scope: prototype
- arguments:
- - @user_loader
- - @dbal.conn
- - @cache.driver
- - @user
- - @auth
- - @config
- - %core.root_path%
- - %core.php_ext%
- - %tables.notification_types%
- - %tables.notifications%
- - %tables.user_notifications%
- tags:
- - { name: notification.type }
-
- notification.type.report_pm_closed:
- class: phpbb\notification\type\report_pm_closed
- scope: prototype
- arguments:
- - @user_loader
- - @dbal.conn
- - @cache.driver
- - @user
- - @auth
- - @config
- - %core.root_path%
- - %core.php_ext%
- - %tables.notification_types%
- - %tables.notifications%
- - %tables.user_notifications%
- tags:
- - { name: notification.type }
-
- notification.type.report_post:
- class: phpbb\notification\type\report_post
- scope: prototype
- arguments:
- - @user_loader
- - @dbal.conn
- - @cache.driver
- - @user
- - @auth
- - @config
- - %core.root_path%
- - %core.php_ext%
- - %tables.notification_types%
- - %tables.notifications%
- - %tables.user_notifications%
- tags:
- - { name: notification.type }
-
- notification.type.report_post_closed:
- class: phpbb\notification\type\report_post_closed
- scope: prototype
- arguments:
- - @user_loader
- - @dbal.conn
- - @cache.driver
- - @user
- - @auth
- - @config
- - %core.root_path%
- - %core.php_ext%
- - %tables.notification_types%
- - %tables.notifications%
- - %tables.user_notifications%
- tags:
- - { name: notification.type }
-
- notification.type.topic:
- class: phpbb\notification\type\topic
- scope: prototype
- arguments:
- - @user_loader
- - @dbal.conn
- - @cache.driver
- - @user
- - @auth
- - @config
- - %core.root_path%
- - %core.php_ext%
- - %tables.notification_types%
- - %tables.notifications%
- - %tables.user_notifications%
- tags:
- - { name: notification.type }
-
- notification.type.topic_in_queue:
- class: phpbb\notification\type\topic_in_queue
- scope: prototype
- arguments:
- - @user_loader
- - @dbal.conn
- - @cache.driver
- - @user
- - @auth
- - @config
- - %core.root_path%
- - %core.php_ext%
- - %tables.notification_types%
- - %tables.notifications%
- - %tables.user_notifications%
- tags:
- - { name: notification.type }
-
- notification.type.admin_activate_user:
- class: phpbb\notification\type\admin_activate_user
- scope: prototype
- arguments:
- - @user_loader
- - @dbal.conn
- - @cache.driver
- - @user
- - @auth
- - @config
- - %core.root_path%
- - %core.php_ext%
- - %tables.notification_types%
- - %tables.notifications%
- - %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
- arguments:
- - @user_loader
- - @dbal.conn
- - @cache.driver
- - @user
- - @auth
- - @config
- - %core.root_path%
- - %core.php_ext%
- tags:
- - { name: notification.method }
-
- notification.method.jabber:
- class: phpbb\notification\method\jabber
- scope: prototype
- arguments:
- - @user_loader
- - @dbal.conn
- - @cache.driver
- - @user
- - @auth
- - @config
- - %core.root_path%
- - %core.php_ext%
- tags:
- - { name: notification.method }
diff --git a/phpBB/config/production/config.yml b/phpBB/config/production/config.yml
new file mode 100644
index 0000000000..979dbbcdd9
--- /dev/null
+++ b/phpBB/config/production/config.yml
@@ -0,0 +1,2 @@
+imports:
+ - { resource: ../default/config.yml }
diff --git a/phpBB/config/production/container/environment.yml b/phpBB/config/production/container/environment.yml
new file mode 100644
index 0000000000..40a3c7a683
--- /dev/null
+++ b/phpBB/config/production/container/environment.yml
@@ -0,0 +1,3 @@
+imports:
+ - { resource: services.yml }
+ - { resource: parameters.yml }
diff --git a/phpBB/config/production/container/parameters.yml b/phpBB/config/production/container/parameters.yml
new file mode 100644
index 0000000000..0447646806
--- /dev/null
+++ b/phpBB/config/production/container/parameters.yml
@@ -0,0 +1,2 @@
+imports:
+ - { resource: ../../default/container/parameters.yml }
diff --git a/phpBB/config/production/container/services.yml b/phpBB/config/production/container/services.yml
new file mode 100644
index 0000000000..b302f0f966
--- /dev/null
+++ b/phpBB/config/production/container/services.yml
@@ -0,0 +1,2 @@
+imports:
+ - { resource: ../../default/container/services.yml }
diff --git a/phpBB/config/production/routing/environment.yml b/phpBB/config/production/routing/environment.yml
new file mode 100644
index 0000000000..0cddfb7521
--- /dev/null
+++ b/phpBB/config/production/routing/environment.yml
@@ -0,0 +1,2 @@
+core.default:
+ resource: "../../default/routing/routing.yml"
diff --git a/phpBB/config/routing.yml b/phpBB/config/routing.yml
deleted file mode 100644
index 94146e1ec2..0000000000
--- a/phpBB/config/routing.yml
+++ /dev/null
@@ -1,9 +0,0 @@
-# Structure:
-#
-# foo_controller:
-# path: /foo
-# defaults: { _controller: foo_sevice:method }
-#
-# The above will be accessed via app.php?controller=foo and it will
-# instantiate the "foo_service" service and call the "method" method.
-#
diff --git a/phpBB/config/test/config.yml b/phpBB/config/test/config.yml
new file mode 100644
index 0000000000..1c17b08931
--- /dev/null
+++ b/phpBB/config/test/config.yml
@@ -0,0 +1,5 @@
+imports:
+ - { resource: ../default/config.yml }
+
+core:
+ require_dev_dependencies: true
diff --git a/phpBB/config/test/container/environment.yml b/phpBB/config/test/container/environment.yml
new file mode 100644
index 0000000000..40a3c7a683
--- /dev/null
+++ b/phpBB/config/test/container/environment.yml
@@ -0,0 +1,3 @@
+imports:
+ - { resource: services.yml }
+ - { resource: parameters.yml }
diff --git a/phpBB/config/test/container/parameters.yml b/phpBB/config/test/container/parameters.yml
new file mode 100644
index 0000000000..0447646806
--- /dev/null
+++ b/phpBB/config/test/container/parameters.yml
@@ -0,0 +1,2 @@
+imports:
+ - { resource: ../../default/container/parameters.yml }
diff --git a/phpBB/config/test/container/services.yml b/phpBB/config/test/container/services.yml
new file mode 100644
index 0000000000..b302f0f966
--- /dev/null
+++ b/phpBB/config/test/container/services.yml
@@ -0,0 +1,2 @@
+imports:
+ - { resource: ../../default/container/services.yml }
diff --git a/phpBB/config/test/routing/environment.yml b/phpBB/config/test/routing/environment.yml
new file mode 100644
index 0000000000..0cddfb7521
--- /dev/null
+++ b/phpBB/config/test/routing/environment.yml
@@ -0,0 +1,2 @@
+core.default:
+ resource: "../../default/routing/routing.yml"
diff --git a/phpBB/cron.php b/phpBB/cron.php
index 3f022b1db8..e134dbbe4c 100644
--- a/phpBB/cron.php
+++ b/phpBB/cron.php
@@ -42,14 +42,16 @@ function output_image()
//
// Attempt to alleviate the problem by doing setup outside of the lock as much as possible.
-$cron_type = request_var('cron_type', '');
+$cron_type = $request->variable('cron_type', '');
// Comment this line out for debugging so the page does not return an image.
output_image();
+/* @var $cron_lock \phpbb\lock\db */
$cron_lock = $phpbb_container->get('cron.lock_db');
if ($cron_lock->acquire())
{
+ /* @var $cron \phpbb\cron\manager */
$cron = $phpbb_container->get('cron.manager');
$task = $cron->find_task($cron_type);
diff --git a/phpBB/develop/add_permissions.php b/phpBB/develop/add_permissions.php
index a5279f8f13..88c2c35ac0 100644
--- a/phpBB/develop/add_permissions.php
+++ b/phpBB/develop/add_permissions.php
@@ -64,6 +64,7 @@ $f_permissions = array(
'f_vote' => array(1, 0),
'f_votechg' => array(1, 0),
'f_announce'=> array(1, 0),
+ 'f_announce_global' => array(1, 0),
'f_sticky' => array(1, 0),
'f_attach' => array(1, 0),
'f_download'=> array(1, 0),
diff --git a/phpBB/develop/check_flash_bbcodes.php b/phpBB/develop/check_flash_bbcodes.php
index 6e1b415bb6..5dc112bfc0 100644
--- a/phpBB/develop/check_flash_bbcodes.php
+++ b/phpBB/develop/check_flash_bbcodes.php
@@ -140,8 +140,12 @@ function html_entity_decode_utf8($string)
static $trans_tbl;
// replace numeric entities
- $string = preg_replace('~&#x([0-9a-f]+);~ei', 'code2utf8(hexdec("\\1"))', $string);
- $string = preg_replace('~&#([0-9]+);~e', 'code2utf8(\\1)', $string);
+ $string = preg_replace_callback('~&#x([0-9a-f]+);~i', function ($match) {
+ return code2utf8(hexdec($match[1]));
+ }, $string);
+ $string = preg_replace_callback('~&#([0-9]+);~', function ($match) {
+ return code2utf8($match[1]);
+ }, $string);
// replace literal entities
if (!isset($trans_tbl))
diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php
index 60ffe04330..f6bfd6a52f 100644
--- a/phpBB/develop/create_schema_files.php
+++ b/phpBB/develop/create_schema_files.php
@@ -43,13 +43,16 @@ require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
$phpbb_class_loader->register();
-$finder = new \phpbb\finder(new \phpbb\filesystem(), $phpbb_root_path);
+$finder = new \phpbb\finder(new \phpbb\filesystem\filesystem(), $phpbb_root_path);
$classes = $finder->core_path('phpbb/')
->directory('/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);
+$factory = new \phpbb\db\tools\factory();
+$db_tools = $factory->get($db, true);
+
+$schema_generator = new \phpbb\db\migration\schema_generator($classes, new \phpbb\config\config(array()), $db, $db_tools, $phpbb_root_path, $phpEx, $table_prefix);
$schema_data = $schema_generator->get_schema();
$fp = fopen($schema_path . 'schema.json', 'wb');
diff --git a/phpBB/develop/create_search_index.php b/phpBB/develop/create_search_index.php
index 9b79a35a84..6ef200699c 100644
--- a/phpBB/develop/create_search_index.php
+++ b/phpBB/develop/create_search_index.php
@@ -132,7 +132,7 @@ else
$search->tidy();
-add_log('admin', 'LOG_SEARCH_INDEX_CREATED', $search_name);
+$phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_SEARCH_INDEX_CREATED', false, array($search_name));
echo $user->lang['SEARCH_INDEX_CREATED'] . "\n";
echo 'Peak Memory Usage: ' . get_formatted_filesize(memory_get_peak_usage()) . "\n";
diff --git a/phpBB/develop/fill.php b/phpBB/develop/fill.php
index 6d08e9c206..2aaafe1e38 100644
--- a/phpBB/develop/fill.php
+++ b/phpBB/develop/fill.php
@@ -42,8 +42,8 @@ $posts_per_topic = 500;
// general vars
-$mode = request_var('mode', 'generate');
-$start = request_var('start', 0);
+$mode = $request->variable('mode', 'generate');
+$start = $request->variable('start', 0);
switch ($mode)
{
diff --git a/phpBB/develop/generate_utf_tables.php b/phpBB/develop/generate_utf_tables.php
index 16a449679b..888c07676d 100644
--- a/phpBB/develop/generate_utf_tables.php
+++ b/phpBB/develop/generate_utf_tables.php
@@ -32,262 +32,11 @@ $phpbb_root_path = '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
echo "Checking for required files\n";
-download('http://www.unicode.org/Public/UNIDATA/CompositionExclusions.txt');
-download('http://www.unicode.org/Public/UNIDATA/DerivedNormalizationProps.txt');
download('http://www.unicode.org/Public/UNIDATA/UnicodeData.txt');
echo "\n";
-require_once($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
-$file_contents = array();
-
-/**
-* Generate some Hangul/Jamo stuff
-*/
-echo "\nGenerating Hangul and Jamo tables\n";
-for ($i = 0; $i < UNICODE_HANGUL_LCOUNT; ++$i)
-{
- $utf_char = cp_to_utf(UNICODE_HANGUL_LBASE + $i);
- $file_contents['utf_normalizer_common']['utf_jamo_index'][$utf_char] = $i * UNICODE_HANGUL_VCOUNT * UNICODE_HANGUL_TCOUNT + UNICODE_HANGUL_SBASE;
- $file_contents['utf_normalizer_common']['utf_jamo_type'][$utf_char] = UNICODE_JAMO_L;
-}
-
-for ($i = 0; $i < UNICODE_HANGUL_VCOUNT; ++$i)
-{
- $utf_char = cp_to_utf(UNICODE_HANGUL_VBASE + $i);
- $file_contents['utf_normalizer_common']['utf_jamo_index'][$utf_char] = $i * UNICODE_HANGUL_TCOUNT;
- $file_contents['utf_normalizer_common']['utf_jamo_type'][$utf_char] = UNICODE_JAMO_V;
-}
-
-for ($i = 0; $i < UNICODE_HANGUL_TCOUNT; ++$i)
-{
- $utf_char = cp_to_utf(UNICODE_HANGUL_TBASE + $i);
- $file_contents['utf_normalizer_common']['utf_jamo_index'][$utf_char] = $i;
- $file_contents['utf_normalizer_common']['utf_jamo_type'][$utf_char] = UNICODE_JAMO_T;
-}
-
-/**
-* Load the CompositionExclusions table
-*/
-echo "Loading CompositionExclusion\n";
-$fp = fopen('CompositionExclusions.txt', 'rt');
-
-$exclude = array();
-while (!feof($fp))
-{
- $line = fgets($fp, 1024);
-
- if (!strpos(' 0123456789ABCDEFabcdef', $line[0]))
- {
- continue;
- }
-
- $cp = strtok($line, ' ');
-
- if ($pos = strpos($cp, '..'))
- {
- $start = hexdec(substr($cp, 0, $pos));
- $end = hexdec(substr($cp, $pos + 2));
-
- for ($i = $start; $i < $end; ++$i)
- {
- $exclude[$i] = 1;
- }
- }
- else
- {
- $exclude[hexdec($cp)] = 1;
- }
-}
-fclose($fp);
-
-/**
-* Load QuickCheck tables
-*/
-echo "Generating QuickCheck tables\n";
-$fp = fopen('DerivedNormalizationProps.txt', 'rt');
-
-while (!feof($fp))
-{
- $line = fgets($fp, 1024);
-
- if (!strpos(' 0123456789ABCDEFabcdef', $line[0]))
- {
- continue;
- }
-
- $p = array_map('trim', explode(';', strtok($line, '#')));
-
- /**
- * Capture only NFC_QC, NFKC_QC
- */
- if (!preg_match('#^NFK?C_QC$#', $p[1]))
- {
- continue;
- }
-
- if ($pos = strpos($p[0], '..'))
- {
- $start = hexdec(substr($p[0], 0, $pos));
- $end = hexdec(substr($p[0], $pos + 2));
- }
- else
- {
- $start = $end = hexdec($p[0]);
- }
-
- if ($start >= UTF8_HANGUL_FIRST && $end <= UTF8_HANGUL_LAST)
- {
- /**
- * We do not store Hangul syllables in the array
- */
- continue;
- }
-
- if ($p[2] == 'M')
- {
- $val = UNICODE_QC_MAYBE;
- }
- else
- {
- $val = UNICODE_QC_NO;
- }
-
- if ($p[1] == 'NFKC_QC')
- {
- $file = 'utf_nfkc_qc';
- }
- else
- {
- $file = 'utf_nfc_qc';
- }
-
- for ($i = $start; $i <= $end; ++$i)
- {
- /**
- * The vars have the same name as the file: $utf_nfc_qc is in utf_nfc_qc.php
- */
- $file_contents[$file][$file][cp_to_utf($i)] = $val;
- }
-}
-fclose($fp);
-
/**
-* Do mappings
-*/
-echo "Loading Unicode decomposition mappings\n";
-$fp = fopen($phpbb_root_path . 'develop/UnicodeData.txt', 'rt');
-
-$map = array();
-while (!feof($fp))
-{
- $p = explode(';', fgets($fp, 1024));
- $cp = hexdec($p[0]);
-
- if (!empty($p[3]))
- {
- /**
- * Store combining class > 0
- */
- $file_contents['utf_normalizer_common']['utf_combining_class'][cp_to_utf($cp)] = (int) $p[3];
- }
-
- if (!isset($p[5]) || !preg_match_all('#[0-9A-F]+#', strip_tags($p[5]), $m))
- {
- continue;
- }
-
- if (strpos($p[5], '>'))
- {
- $map['NFKD'][$cp] = implode(' ', array_map('hexdec', $m[0]));
- }
- else
- {
- $map['NFD'][$cp] = $map['NFKD'][$cp] = implode(' ', array_map('hexdec', $m[0]));
- }
-}
-fclose($fp);
-
-/**
-* Build the canonical composition table
-*/
-echo "Generating the Canonical Composition table\n";
-foreach ($map['NFD'] as $cp => $decomp_seq)
-{
- if (!strpos($decomp_seq, ' ') || isset($exclude[$cp]))
- {
- /**
- * Singletons are excluded from canonical composition
- */
- continue;
- }
-
- $utf_seq = implode('', array_map('cp_to_utf', explode(' ', $decomp_seq)));
-
- if (!isset($file_contents['utf_canonical_comp']['utf_canonical_comp'][$utf_seq]))
- {
- $file_contents['utf_canonical_comp']['utf_canonical_comp'][$utf_seq] = cp_to_utf($cp);
- }
-}
-
-/**
-* Decompose the NF[K]D mappings recursively and prepare the file contents
-*/
-echo "Generating the Canonical and Compatibility Decomposition tables\n\n";
-foreach ($map as $type => $decomp_map)
-{
- foreach ($decomp_map as $cp => $decomp_seq)
- {
- $decomp_map[$cp] = decompose($decomp_map, $decomp_seq);
- }
- unset($decomp_seq);
-
- if ($type == 'NFKD')
- {
- $file = 'utf_compatibility_decomp';
- $var = 'utf_compatibility_decomp';
- }
- else
- {
- $file = 'utf_canonical_decomp';
- $var = 'utf_canonical_decomp';
- }
-
- /**
- * Generate the corresponding file
- */
- foreach ($decomp_map as $cp => $decomp_seq)
- {
- $file_contents[$file][$var][cp_to_utf($cp)] = implode('', array_map('cp_to_utf', explode(' ', $decomp_seq)));
- }
-}
-
-/**
-* Generate and/or alter the files
-*/
-foreach ($file_contents as $file => $contents)
-{
- /**
- * Generate a new file
- */
- echo "Writing to $file.$phpEx\n";
-
- if (!$fp = fopen($phpbb_root_path . 'includes/utf/data/' . $file . '.' . $phpEx, 'wb'))
- {
- trigger_error('Cannot open ' . $file . ' for write');
- }
-
- fwrite($fp, '<?php');
- foreach ($contents as $var => $val)
- {
- fwrite($fp, "\n\$GLOBALS[" . my_var_export($var) . ']=' . my_var_export($val) . ";");
- }
- fclose($fp);
-}
-
-echo "\n*** UTF-8 normalization tables done\n\n";
-
-/**
-* Now we'll generate the files needed by the search indexer
+* Generate the files needed by the search indexer
*/
echo "Generating search indexer tables\n";
@@ -425,32 +174,6 @@ die("\nAll done!\n");
////////////////////////////////////////////////////////////////////////////////
/**
-* Decompose a sequence recusively
-*
-* @param array $decomp_map Decomposition mapping, passed by reference
-* @param string $decomp_seq Decomposition sequence as decimal codepoints separated with a space
-* @return string Decomposition sequence, fully decomposed
-*/
-function decompose(&$decomp_map, $decomp_seq)
-{
- $ret = array();
- foreach (explode(' ', $decomp_seq) as $cp)
- {
- if (isset($decomp_map[$cp]))
- {
- $ret[] = decompose($decomp_map, $decomp_map[$cp]);
- }
- else
- {
- $ret[] = $cp;
- }
- }
-
- return implode(' ', $ret);
-}
-
-
-/**
* Return a parsable string representation of a variable
*
* This is function is limited to array/strings/integers
@@ -538,17 +261,6 @@ function hex_to_utf($hex)
}
/**
-* Return a UTF string formed from a sequence of codepoints in hexadecimal
-*
-* @param string $seq Sequence of codepoints, separated with a space
-* @return string UTF-8 string
-*/
-function hexseq_to_utf($seq)
-{
- return implode('', array_map('hex_to_utf', explode(' ', $seq)));
-}
-
-/**
* Convert a codepoint to a UTF-8 char
*
* @param integer $cp Unicode codepoint
diff --git a/phpBB/develop/imageset_to_css.php b/phpBB/develop/imageset_to_css.php
index d49fe9c741..bbe7c31c83 100644
--- a/phpBB/develop/imageset_to_css.php
+++ b/phpBB/develop/imageset_to_css.php
@@ -7,7 +7,7 @@
*/
$phpbb_root_path = '../';
-$style = 'subsilver2';
+$style = 'prosilver';
$imageset_path = $phpbb_root_path . 'styles/' . $style . '/imageset';
$theme_path = $phpbb_root_path . 'styles/' . $style . '/theme';
diff --git a/phpBB/develop/lang_duplicates.php b/phpBB/develop/lang_duplicates.php
index 5981882292..7a74b1088a 100644
--- a/phpBB/develop/lang_duplicates.php
+++ b/phpBB/develop/lang_duplicates.php
@@ -29,7 +29,7 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1);
$phpbb_root_path='./../';
include($phpbb_root_path . 'common.'.$phpEx);
-$mode = request_var('mode', '');
+$mode = $request->variable('mode', '');
$modules = find_modules($phpbb_root_path . 'language/en');
diff --git a/phpBB/develop/lang_migrate_help_lang.php b/phpBB/develop/lang_migrate_help_lang.php
new file mode 100644
index 0000000000..d5a2573ee0
--- /dev/null
+++ b/phpBB/develop/lang_migrate_help_lang.php
@@ -0,0 +1,312 @@
+<?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.
+ *
+ */
+
+//
+// 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");
+
+define('IN_PHPBB', true);
+$phpEx = substr(strrchr(__FILE__, '.'), 1);
+$phpbb_root_path='./../';
+include($phpbb_root_path . 'common.'.$phpEx);
+
+$help_bbcode = load_help('bbcode');
+$lang_bbcode = array(
+ 'HELP_BBCODE_BLOCK_INTRO' => $help_bbcode[0][1],
+ 'HELP_BBCODE_INTRO_BBCODE_QUESTION' => $help_bbcode[1][0],
+ 'HELP_BBCODE_INTRO_BBCODE_ANSWER' => $help_bbcode[1][1],
+
+ 'HELP_BBCODE_BLOCK_TEXT' => $help_bbcode[2][1],
+ 'HELP_BBCODE_TEXT_BASIC_QUESTION' => $help_bbcode[3][0],
+ 'HELP_BBCODE_TEXT_BASIC_ANSWER' => $help_bbcode[3][1],
+ 'HELP_BBCODE_TEXT_COLOR_QUESTION' => $help_bbcode[4][0],
+ 'HELP_BBCODE_TEXT_COLOR_ANSWER' => $help_bbcode[4][1],
+ 'HELP_BBCODE_TEXT_COMBINE_QUESTION' => $help_bbcode[5][0],
+ 'HELP_BBCODE_TEXT_COMBINE_ANSWER' => $help_bbcode[5][1],
+
+ 'HELP_BBCODE_BLOCK_QUOTES' => $help_bbcode[6][1],
+ 'HELP_BBCODE_QUOTES_TEXT_QUESTION' => $help_bbcode[7][0],
+ 'HELP_BBCODE_QUOTES_TEXT_ANSWER' => $help_bbcode[7][1],
+ 'HELP_BBCODE_QUOTES_CODE_QUESTION' => $help_bbcode[8][0],
+ 'HELP_BBCODE_QUOTES_CODE_ANSWER' => $help_bbcode[8][1],
+
+ 'HELP_BBCODE_BLOCK_LISTS' => $help_bbcode[9][1],
+ 'HELP_BBCODE_LISTS_UNORDERER_QUESTION' => $help_bbcode[10][0],
+ 'HELP_BBCODE_LISTS_UNORDERER_ANSWER' => $help_bbcode[10][1],
+ 'HELP_BBCODE_LISTS_ORDERER_QUESTION' => $help_bbcode[11][0],
+ 'HELP_BBCODE_LISTS_ORDERER_ANSWER' => $help_bbcode[11][1],
+
+ 'HELP_BBCODE_BLOCK_LINKS' => $help_bbcode[13][1],
+ 'HELP_BBCODE_LINKS_BASIC_QUESTION' => $help_bbcode[14][0],
+ 'HELP_BBCODE_LINKS_BASIC_ANSWER' => $help_bbcode[14][1],
+
+ 'HELP_BBCODE_BLOCK_IMAGES' => $help_bbcode[15][1],
+ 'HELP_BBCODE_IMAGES_BASIC_QUESTION' => $help_bbcode[16][0],
+ 'HELP_BBCODE_IMAGES_BASIC_ANSWER' => $help_bbcode[16][1],
+ 'HELP_BBCODE_IMAGES_ATTACHMENT_QUESTION' => $help_bbcode[17][0],
+ 'HELP_BBCODE_IMAGES_ATTACHMENT_ANSWER' => $help_bbcode[17][1],
+
+ 'HELP_BBCODE_BLOCK_OTHERS' => $help_bbcode[18][1],
+ 'HELP_BBCODE_OTHERS_CUSTOM_QUESTION' => $help_bbcode[19][0],
+ 'HELP_BBCODE_OTHERS_CUSTOM_ANSWER' => $help_bbcode[19][1],
+);
+write_help('bbcode', $lang_bbcode);
+
+$help_phpbb = load_help('faq');
+$lang_phpbb = array(
+ 'HELP_FAQ_BLOCK_LOGIN' => $help_phpbb[0][1],
+ 'HELP_FAQ_LOGIN_REGISTER_QUESTION' => $help_phpbb[1][0],
+ 'HELP_FAQ_LOGIN_REGISTER_ANSWER' => $help_phpbb[1][1],
+ 'HELP_FAQ_LOGIN_COPPA_QUESTION' => $help_phpbb[2][0],
+ 'HELP_FAQ_LOGIN_COPPA_ANSWER' => $help_phpbb[2][1],
+ 'HELP_FAQ_LOGIN_CANNOT_REGISTER_QUESTION' => $help_phpbb[3][0],
+ 'HELP_FAQ_LOGIN_CANNOT_REGISTER_ANSWER' => $help_phpbb[3][1],
+ 'HELP_FAQ_LOGIN_REGISTER_CONFIRM_QUESTION' => $help_phpbb[4][0],
+ 'HELP_FAQ_LOGIN_REGISTER_CONFIRM_ANSWER' => $help_phpbb[4][1],
+ 'HELP_FAQ_LOGIN_CANNOT_LOGIN_QUESTION' => $help_phpbb[5][0],
+ 'HELP_FAQ_LOGIN_CANNOT_LOGIN_ANSWER' => $help_phpbb[5][1],
+ 'HELP_FAQ_LOGIN_CANNOT_LOGIN_ANYMORE_QUESTION' => $help_phpbb[6][0],
+ 'HELP_FAQ_LOGIN_CANNOT_LOGIN_ANYMORE_ANSWER' => $help_phpbb[6][1],
+ 'HELP_FAQ_LOGIN_LOST_PASSWORD_QUESTION' => $help_phpbb[7][0],
+ 'HELP_FAQ_LOGIN_LOST_PASSWORD_ANSWER' => $help_phpbb[7][1],
+ 'HELP_FAQ_LOGIN_AUTO_LOGOUT_QUESTION' => $help_phpbb[8][0],
+ 'HELP_FAQ_LOGIN_AUTO_LOGOUT_ANSWER' => $help_phpbb[8][1],
+ 'HELP_FAQ_LOGIN_DELETE_COOKIES_QUESTION' => $help_phpbb[9][0],
+ 'HELP_FAQ_LOGIN_DELETE_COOKIES_ANSWER' => $help_phpbb[9][1],
+
+ 'HELP_FAQ_BLOCK_USERSETTINGS' => $help_phpbb[10][1],
+ 'HELP_FAQ_USERSETTINGS_CHANGE_SETTINGS_QUESTION' => $help_phpbb[11][0],
+ 'HELP_FAQ_USERSETTINGS_CHANGE_SETTINGS_ANSWER' => $help_phpbb[11][1],
+ 'HELP_FAQ_USERSETTINGS_HIDE_ONLINE_QUESTION' => $help_phpbb[12][0],
+ 'HELP_FAQ_USERSETTINGS_HIDE_ONLINE_ANSWER' => $help_phpbb[12][1],
+ 'HELP_FAQ_USERSETTINGS_TIMEZONE_QUESTION' => $help_phpbb[13][0],
+ 'HELP_FAQ_USERSETTINGS_TIMEZONE_ANSWER' => $help_phpbb[13][1],
+ 'HELP_FAQ_USERSETTINGS_SERVERTIME_QUESTION' => $help_phpbb[14][0],
+ 'HELP_FAQ_USERSETTINGS_SERVERTIME_ANSWER' => $help_phpbb[14][1],
+ 'HELP_FAQ_USERSETTINGS_LANGUAGE_QUESTION' => $help_phpbb[15][0],
+ 'HELP_FAQ_USERSETTINGS_LANGUAGE_ANSWER' => $help_phpbb[15][1],
+ 'HELP_FAQ_USERSETTINGS_AVATAR_QUESTION' => $help_phpbb[16][0],
+ 'HELP_FAQ_USERSETTINGS_AVATAR_ANSWER' => $help_phpbb[16][1],
+ 'HELP_FAQ_USERSETTINGS_AVATAR_DISPLAY_QUESTION' => $help_phpbb[17][0],
+ 'HELP_FAQ_USERSETTINGS_AVATAR_DISPLAY_ANSWER' => $help_phpbb[17][1],
+ 'HELP_FAQ_USERSETTINGS_RANK_QUESTION' => $help_phpbb[18][0],
+ 'HELP_FAQ_USERSETTINGS_RANK_ANSWER' => $help_phpbb[18][1],
+ 'HELP_FAQ_USERSETTINGS_EMAIL_LOGIN_QUESTION' => $help_phpbb[19][0],
+ 'HELP_FAQ_USERSETTINGS_EMAIL_LOGIN_ANSWER' => $help_phpbb[19][1],
+
+ 'HELP_FAQ_BLOCK_POSTING' => $help_phpbb[20][1],
+ 'HELP_FAQ_POSTING_CREATE_QUESTION' => $help_phpbb[21][0],
+ 'HELP_FAQ_POSTING_CREATE_ANSWER' => $help_phpbb[21][1],
+ 'HELP_FAQ_POSTING_EDIT_DELETE_QUESTION' => $help_phpbb[22][0],
+ 'HELP_FAQ_POSTING_EDIT_DELETE_ANSWER' => $help_phpbb[22][1],
+ 'HELP_FAQ_POSTING_SIGNATURE_QUESTION' => $help_phpbb[23][0],
+ 'HELP_FAQ_POSTING_SIGNATURE_ANSWER' => $help_phpbb[23][1],
+ 'HELP_FAQ_POSTING_POLL_CREATE_QUESTION' => $help_phpbb[24][0],
+ 'HELP_FAQ_POSTING_POLL_CREATE_ANSWER' => $help_phpbb[24][1],
+ 'HELP_FAQ_POSTING_POLL_ADD_QUESTION' => $help_phpbb[25][0],
+ 'HELP_FAQ_POSTING_POLL_ADD_ANSWER' => $help_phpbb[25][1],
+ 'HELP_FAQ_POSTING_POLL_EDIT_QUESTION' => $help_phpbb[26][0],
+ 'HELP_FAQ_POSTING_POLL_EDIT_ANSWER' => $help_phpbb[26][1],
+ 'HELP_FAQ_POSTING_FORUM_RESTRICTED_QUESTION' => $help_phpbb[27][0],
+ 'HELP_FAQ_POSTING_FORUM_RESTRICTED_ANSWER' => $help_phpbb[27][1],
+ 'HELP_FAQ_POSTING_NO_ATTACHMENTS_QUESTION' => $help_phpbb[28][0],
+ 'HELP_FAQ_POSTING_NO_ATTACHMENTS_ANSWER' => $help_phpbb[28][1],
+ 'HELP_FAQ_POSTING_WARNING_QUESTION' => $help_phpbb[29][0],
+ 'HELP_FAQ_POSTING_WARNING_ANSWER' => $help_phpbb[29][1],
+ 'HELP_FAQ_POSTING_REPORT_QUESTION' => $help_phpbb[30][0],
+ 'HELP_FAQ_POSTING_REPORT_ANSWER' => $help_phpbb[30][1],
+ 'HELP_FAQ_POSTING_DRAFT_QUESTION' => $help_phpbb[31][0],
+ 'HELP_FAQ_POSTING_DRAFT_ANSWER' => $help_phpbb[31][1],
+ 'HELP_FAQ_POSTING_QUEUE_QUESTION' => $help_phpbb[32][0],
+ 'HELP_FAQ_POSTING_QUEUE_ANSWER' => $help_phpbb[32][1],
+ 'HELP_FAQ_POSTING_BUMP_QUESTION' => $help_phpbb[33][0],
+ 'HELP_FAQ_POSTING_BUMP_ANSWER' => $help_phpbb[33][1],
+
+ 'HELP_FAQ_BLOCK_FORMATTING' => $help_phpbb[34][1],
+ 'HELP_FAQ_FORMATTING_BBOCDE_QUESTION' => $help_phpbb[35][0],
+ 'HELP_FAQ_FORMATTING_BBOCDE_ANSWER' => $help_phpbb[35][1],
+ 'HELP_FAQ_FORMATTING_HTML_QUESTION' => $help_phpbb[36][0],
+ 'HELP_FAQ_FORMATTING_HTML_ANSWER' => $help_phpbb[36][1],
+ 'HELP_FAQ_FORMATTING_SMILIES_QUESTION' => $help_phpbb[37][0],
+ 'HELP_FAQ_FORMATTING_SMILIES_ANSWER' => $help_phpbb[37][1],
+ 'HELP_FAQ_FORMATTING_IMAGES_QUESTION' => $help_phpbb[38][0],
+ 'HELP_FAQ_FORMATTING_IMAGES_ANSWER' => $help_phpbb[38][1],
+ 'HELP_FAQ_FORMATTING_GLOBAL_ANNOUNCE_QUESTION' => $help_phpbb[39][0],
+ 'HELP_FAQ_FORMATTING_GLOBAL_ANNOUNCE_ANSWER' => $help_phpbb[39][1],
+ 'HELP_FAQ_FORMATTING_ANNOUNCEMENT_QUESTION' => $help_phpbb[40][0],
+ 'HELP_FAQ_FORMATTING_ANNOUNCEMENT_ANSWER' => $help_phpbb[40][1],
+ 'HELP_FAQ_FORMATTING_STICKIES_QUESTION' => $help_phpbb[41][0],
+ 'HELP_FAQ_FORMATTING_STICKIES_ANSWER' => $help_phpbb[41][1],
+ 'HELP_FAQ_FORMATTING_LOCKED_QUESTION' => $help_phpbb[42][0],
+ 'HELP_FAQ_FORMATTING_LOCKED_ANSWER' => $help_phpbb[42][1],
+ 'HELP_FAQ_FORMATTING_ICONS_QUESTION' => $help_phpbb[43][0],
+ 'HELP_FAQ_FORMATTING_ICONS_ANSWER' => $help_phpbb[43][1],
+
+ 'HELP_FAQ_BLOCK_GROUPS' => $help_phpbb[45][1],
+ 'HELP_FAQ_GROUPS_ADMINISTRATORS_QUESTION' => $help_phpbb[46][0],
+ 'HELP_FAQ_GROUPS_ADMINISTRATORS_ANSWER' => $help_phpbb[46][1],
+ 'HELP_FAQ_GROUPS_MODERATORS_QUESTION' => $help_phpbb[47][0],
+ 'HELP_FAQ_GROUPS_MODERATORS_ANSWER' => $help_phpbb[47][1],
+ 'HELP_FAQ_GROUPS_USERGROUPS_QUESTION' => $help_phpbb[48][0],
+ 'HELP_FAQ_GROUPS_USERGROUPS_ANSWER' => $help_phpbb[48][1],
+ 'HELP_FAQ_GROUPS_USERGROUPS_JOIN_QUESTION' => $help_phpbb[49][0],
+ 'HELP_FAQ_GROUPS_USERGROUPS_JOIN_ANSWER' => $help_phpbb[49][1],
+ 'HELP_FAQ_GROUPS_USERGROUPS_LEAD_QUESTION' => $help_phpbb[50][0],
+ 'HELP_FAQ_GROUPS_USERGROUPS_LEAD_ANSWER' => $help_phpbb[50][1],
+ 'HELP_FAQ_GROUPS_COLORS_QUESTION' => $help_phpbb[51][0],
+ 'HELP_FAQ_GROUPS_COLORS_ANSWER' => $help_phpbb[51][1],
+ 'HELP_FAQ_GROUPS_DEFAULT_QUESTION' => $help_phpbb[52][0],
+ 'HELP_FAQ_GROUPS_DEFAULT_ANSWER' => $help_phpbb[52][1],
+ 'HELP_FAQ_GROUPS_TEAM_QUESTION' => $help_phpbb[53][0],
+ 'HELP_FAQ_GROUPS_TEAM_ANSWER' => $help_phpbb[53][1],
+
+ 'HELP_FAQ_BLOCK_PMS' => $help_phpbb[54][1],
+ 'HELP_FAQ_PMS_CANNOT_SEND_QUESTION' => $help_phpbb[55][0],
+ 'HELP_FAQ_PMS_CANNOT_SEND_ANSWER' => $help_phpbb[55][1],
+ 'HELP_FAQ_PMS_UNWANTED_QUESTION' => $help_phpbb[56][0],
+ 'HELP_FAQ_PMS_UNWANTED_ANSWER' => $help_phpbb[56][1],
+ 'HELP_FAQ_PMS_SPAM_QUESTION' => $help_phpbb[57][0],
+ 'HELP_FAQ_PMS_SPAM_ANSWER' => $help_phpbb[57][1],
+
+ 'HELP_FAQ_BLOCK_FRIENDS' => $help_phpbb[58][1],
+ 'HELP_FAQ_FRIENDS_BASIC_QUESTION' => $help_phpbb[59][0],
+ 'HELP_FAQ_FRIENDS_BASIC_ANSWER' => $help_phpbb[59][1],
+ 'HELP_FAQ_FRIENDS_MANAGE_QUESTION' => $help_phpbb[60][0],
+ 'HELP_FAQ_FRIENDS_MANAGE_ANSWER' => $help_phpbb[60][1],
+
+ 'HELP_FAQ_BLOCK_SEARCH' => $help_phpbb[61][1],
+ 'HELP_FAQ_SEARCH_FORUM_QUESTION' => $help_phpbb[62][0],
+ 'HELP_FAQ_SEARCH_FORUM_ANSWER' => $help_phpbb[62][1],
+ 'HELP_FAQ_SEARCH_NO_RESULT_QUESTION' => $help_phpbb[63][0],
+ 'HELP_FAQ_SEARCH_NO_RESULT_ANSWER' => $help_phpbb[63][1],
+ 'HELP_FAQ_SEARCH_BLANK_QUESTION' => $help_phpbb[64][0],
+ 'HELP_FAQ_SEARCH_BLANK_ANSWER' => $help_phpbb[64][1],
+ 'HELP_FAQ_SEARCH_MEMBERS_QUESTION' => $help_phpbb[65][0],
+ 'HELP_FAQ_SEARCH_MEMBERS_ANSWER' => $help_phpbb[65][1],
+ 'HELP_FAQ_SEARCH_OWN_QUESTION' => $help_phpbb[66][0],
+ 'HELP_FAQ_SEARCH_OWN_ANSWER' => $help_phpbb[66][1],
+
+ 'HELP_FAQ_BLOCK_BOOKMARKS' => $help_phpbb[67][1],
+ 'HELP_FAQ_BOOKMARKS_DIFFERENCE_QUESTION' => $help_phpbb[68][0],
+ 'HELP_FAQ_BOOKMARKS_DIFFERENCE_ANSWER' => $help_phpbb[68][1],
+ 'HELP_FAQ_BOOKMARKS_TOPIC_QUESTION' => $help_phpbb[69][0],
+ 'HELP_FAQ_BOOKMARKS_TOPIC_ANSWER' => $help_phpbb[69][1],
+ 'HELP_FAQ_BOOKMARKS_FORUM_QUESTION' => $help_phpbb[70][0],
+ 'HELP_FAQ_BOOKMARKS_FORUM_ANSWER' => $help_phpbb[70][1],
+ 'HELP_FAQ_BOOKMARKS_REMOVE_QUESTION' => $help_phpbb[71][0],
+ 'HELP_FAQ_BOOKMARKS_REMOVE_ANSWER' => $help_phpbb[71][1],
+
+ 'HELP_FAQ_BLOCK_ATTACHMENTS' => $help_phpbb[72][1],
+ 'HELP_FAQ_ATTACHMENTS_ALLOWED_QUESTION' => $help_phpbb[73][0],
+ 'HELP_FAQ_ATTACHMENTS_ALLOWED_ANSWER' => $help_phpbb[73][1],
+ 'HELP_FAQ_ATTACHMENTS_OWN_QUESTION' => $help_phpbb[74][0],
+ 'HELP_FAQ_ATTACHMENTS_OWN_ANSWER' => $help_phpbb[74][1],
+
+ 'HELP_FAQ_BLOCK_ISSUES' => $help_phpbb[75][1],
+ 'HELP_FAQ_ISSUES_WHOIS_PHPBB_QUESTION' => $help_phpbb[76][0],
+ 'HELP_FAQ_ISSUES_WHOIS_PHPBB_ANSWER' => $help_phpbb[76][1],
+ 'HELP_FAQ_ISSUES_FEATURE_QUESTION' => $help_phpbb[77][0],
+ 'HELP_FAQ_ISSUES_FEATURE_ANSWER' => $help_phpbb[77][1],
+ 'HELP_FAQ_ISSUES_LEGAL_QUESTION' => $help_phpbb[78][0],
+ 'HELP_FAQ_ISSUES_LEGAL_ANSWER' => $help_phpbb[78][1],
+ 'HELP_FAQ_ISSUES_ADMIN_QUESTION' => $help_phpbb[79][0],
+ 'HELP_FAQ_ISSUES_ADMIN_ANSWER' => $help_phpbb[79][1],
+
+);
+write_help('faq', $lang_phpbb);
+
+trigger_error('Successfully migrated help_bbcode and help_faq to help/bbcode and help/phpbb');
+
+/**
+ * @param string $help
+ * @return array
+ */
+function load_help($help)
+{
+ global $phpbb_root_path;
+ include($phpbb_root_path . 'language/en/help_' . $help . '.php');
+ return $help;
+}
+
+/**
+ * @param string $help
+ * @param array $lang
+ */
+function write_help($help, array $lang)
+{
+ global $phpbb_root_path;
+ $fp = fopen($phpbb_root_path . 'language/en/help/' . $help . '.php', 'wb');
+ fwrite($fp, get_language_file_header());
+ fwrite($fp, '$lang = array_merge($lang, array(' . "\n");
+
+ $last_key = '';
+ ksort($lang);
+ foreach ($lang as $key => $translation)
+ {
+ $key_sections = explode('_', $key, 4);
+ unset($key_sections[3]);
+ $key_start = implode('_', $key_sections);
+
+ if ($last_key !== '' && $key_start !== $last_key)
+ {
+ fwrite($fp, "\n");
+ }
+ fwrite($fp, "\t'" . $key . "'\t=> '" . $translation . "',\n");
+ $last_key = $key_start;
+ }
+
+ fwrite($fp, '));' . "\n");
+ #fwrite($fp, $lang);
+ fclose($fp);
+}
+
+/**
+ * @return string
+ */
+function get_language_file_header()
+{
+ return <<<EOT
+<?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.
+ *
+ */
+
+/**
+ * DO NOT CHANGE
+ */
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+if (empty(\$lang) || !is_array(\$lang))
+{
+ \$lang = array();
+}
+
+
+EOT;
+}
diff --git a/phpBB/develop/mysql_upgrader.php b/phpBB/develop/mysql_upgrader.php
index 698be9d303..276c010e84 100644
--- a/phpBB/develop/mysql_upgrader.php
+++ b/phpBB/develop/mysql_upgrader.php
@@ -62,14 +62,17 @@ echo "USE $dbname;$newline$newline";
@set_time_limit(0);
-$finder = new \phpbb\finder(new \phpbb\filesystem(), $phpbb_root_path);
+$finder = new \phpbb\finder(new \phpbb\filesystem\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);
+$factory = new \phpbb\db\tools\factory();
+$db_tools = $factory->get($db, true);
+
+$schema_generator = new \phpbb\db\migration\schema_generator($classes, $config, $db, $db_tools, $phpbb_root_path, $phpEx, $table_prefix);
$schema_data = $schema_generator->get_schema();
-$dbms_type_map = \phpbb\db\tools::get_dbms_type_map();
+$dbms_type_map = \phpbb\db\tools\tools::get_dbms_type_map();
foreach ($schema_data as $table_name => $table_data)
{
diff --git a/phpBB/develop/unicode_testing.php b/phpBB/develop/unicode_testing.php
index ec3c71d078..ca6d1b5f48 100644
--- a/phpBB/develop/unicode_testing.php
+++ b/phpBB/develop/unicode_testing.php
@@ -81,38 +81,3 @@ function utf8_to_unicode_callback($m)
{
return '\u' . str_pad(base_convert(utf8_ord($m[0]), 10, 16), 4, '0', STR_PAD_LEFT) . '';
}
-
-/**
-* A wrapper function for the normalizer which takes care of including the class if required and modifies the passed strings
-* to be in NFKC
-*
-* @param mixed $strings a string or an array of strings to normalize
-* @return mixed the normalized content, preserving array keys if array given.
-*/
-function utf8_normalize_nfkc($strings)
-{
- if (empty($strings))
- {
- return $strings;
- }
-
- if (!class_exists('utf_normalizer'))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
- }
-
- if (!is_array($strings))
- {
- utf_normalizer::nfkc($strings);
- }
- else if (is_array($strings))
- {
- foreach ($strings as $key => $string)
- {
- utf_normalizer::nfkc($strings[$key]);
- }
- }
-
- return $strings;
-}
diff --git a/phpBB/develop/update_email_hash.php b/phpBB/develop/update_email_hash.php
index 57aebe3ca0..c149900d64 100644
--- a/phpBB/develop/update_email_hash.php
+++ b/phpBB/develop/update_email_hash.php
@@ -19,7 +19,7 @@ $user->session_begin();
$auth->acl($user->data);
$user->setup();
-$start = request_var('start', 0);
+$start = $request->variable('start', 0);
$num_items = 1000;
echo '<br />Updating user email hashes' . "\n";
diff --git a/phpBB/develop/utf_normalizer_test.php b/phpBB/develop/utf_normalizer_test.php
deleted file mode 100644
index 27ff786db7..0000000000
--- a/phpBB/develop/utf_normalizer_test.php
+++ /dev/null
@@ -1,394 +0,0 @@
-<?php
-/**
-*
-* This file is part of the phpBB Forum Software package.
-*
-* @copyright (c) phpBB Limited <https://www.phpbb.com>
-* @license GNU General Public License, version 2 (GPL-2.0)
-*
-* For full copyright and license information, please see
-* the docs/CREDITS.txt file.
-*
-*/
-
-if (php_sapi_name() != 'cli')
-{
- die("This program must be run from the command line.\n");
-}
-
-//
-// 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");
-
-set_time_limit(0);
-error_reporting(E_ALL);
-
-define('IN_PHPBB', true);
-$phpbb_root_path = '../';
-$phpEx = substr(strrchr(__FILE__, '.'), 1);
-
-
-/**
-* Let's download some files we need
-*/
-download('http://www.unicode.org/Public/UNIDATA/NormalizationTest.txt');
-download('http://www.unicode.org/Public/UNIDATA/UnicodeData.txt');
-
-/**
-* Those are the tests we run
-*/
-$test_suite = array(
- /**
- * NFC
- * c2 == NFC(c1) == NFC(c2) == NFC(c3)
- * c4 == NFC(c4) == NFC(c5)
- */
- 'NFC' => array(
- 'c2' => array('c1', 'c2', 'c3'),
- 'c4' => array('c4', 'c5')
- ),
-
- /**
- * NFD
- * c3 == NFD(c1) == NFD(c2) == NFD(c3)
- * c5 == NFD(c4) == NFD(c5)
- */
- 'NFD' => array(
- 'c3' => array('c1', 'c2', 'c3'),
- 'c5' => array('c4', 'c5')
- ),
-
- /**
- * NFKC
- * c4 == NFKC(c1) == NFKC(c2) == NFKC(c3) == NFKC(c4) == NFKC(c5)
- */
- 'NFKC' => array(
- 'c4' => array('c1', 'c2', 'c3', 'c4', 'c5')
- ),
-
- /**
- * NFKD
- * c5 == NFKD(c1) == NFKD(c2) == NFKD(c3) == NFKD(c4) == NFKD(c5)
- */
- 'NFKD' => array(
- 'c5' => array('c1', 'c2', 'c3', 'c4', 'c5')
- )
-);
-
-require_once($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
-
-$i = $n = 0;
-$failed = false;
-$tested_chars = array();
-
-$fp = fopen($phpbb_root_path . 'develop/NormalizationTest.txt', 'rb');
-while (!feof($fp))
-{
- $line = fgets($fp);
- ++$n;
-
- if ($line[0] == '@')
- {
- if ($i)
- {
- echo "done\n";
- }
-
- $i = 0;
- echo "\n", substr($line, 1), "\n\n";
- continue;
- }
-
- if (!strpos(' 0123456789ABCDEF', $line[0]))
- {
- continue;
- }
-
- if (++$i % 100 == 0)
- {
- echo $i, ' ';
- }
-
- list($c1, $c2, $c3, $c4, $c5) = explode(';', $line);
-
- if (!strpos($c1, ' '))
- {
- /**
- * We are currently testing a single character, we add it to the list of
- * characters we have processed so that we can exclude it when testing
- * for invariants
- */
- $tested_chars[$c1] = 1;
- }
-
- foreach ($test_suite as $form => $serie)
- {
- foreach ($serie as $expected => $tests)
- {
- $hex_expected = ${$expected};
- $utf_expected = hexseq_to_utf($hex_expected);
-
- foreach ($tests as $test)
- {
- $utf_result = $utf_expected;
- call_user_func(array('utf_normalizer', $form), $utf_result);
-
- if (strcmp($utf_expected, $utf_result))
- {
- $failed = true;
- $hex_result = utf_to_hexseq($utf_result);
-
- echo "\nFAILED $expected == $form($test) ($hex_expected != $hex_result)";
- }
- }
- }
-
- if ($failed)
- {
- die("\n\nFailed at line $n\n");
- }
- }
-}
-fclose($fp);
-
-/**
-* Test for invariants
-*/
-echo "\n\nTesting for invariants...\n\n";
-
-$fp = fopen($phpbb_root_path . 'develop/UnicodeData.txt', 'rt');
-
-$n = 0;
-while (!feof($fp))
-{
- if (++$n % 100 == 0)
- {
- echo $n, ' ';
- }
-
- $line = fgets($fp, 1024);
-
- if (!$pos = strpos($line, ';'))
- {
- continue;
- }
-
- $hex_tested = $hex_expected = substr($line, 0, $pos);
-
- if (isset($tested_chars[$hex_tested]))
- {
- continue;
- }
-
- $utf_expected = hex_to_utf($hex_expected);
-
- if ($utf_expected >= UTF8_SURROGATE_FIRST
- && $utf_expected <= UTF8_SURROGATE_LAST)
- {
- /**
- * Surrogates are illegal on their own, we expect the normalizer
- * to return a replacement char
- */
- $utf_expected = UTF8_REPLACEMENT;
- $hex_expected = utf_to_hexseq($utf_expected);
- }
-
- foreach (array('nfc', 'nfkc', 'nfd', 'nfkd') as $form)
- {
- $utf_result = $utf_expected;
- utf_normalizer::$form($utf_result);
- $hex_result = utf_to_hexseq($utf_result);
-// echo "$form($utf_expected) == $utf_result\n";
-
- if (strcmp($utf_expected, $utf_result))
- {
- $failed = 1;
-
- echo "\nFAILED $hex_expected == $form($hex_tested) ($hex_expected != $hex_result)";
- }
- }
-
- if ($failed)
- {
- die("\n\nFailed at line $n\n");
- }
-}
-fclose($fp);
-
-die("\n\nALL TESTS PASSED SUCCESSFULLY\n");
-
-/**
-* Download a file to the develop/ dir
-*
-* @param string $url URL of the file to download
-* @return null
-*/
-function download($url)
-{
- global $phpbb_root_path;
-
- if (file_exists($phpbb_root_path . 'develop/' . basename($url)))
- {
- return;
- }
-
- echo 'Downloading from ', $url, ' ';
-
- if (!$fpr = fopen($url, 'rb'))
- {
- die("Can't download from $url\nPlease download it yourself and put it in the develop/ dir, kthxbai");
- }
-
- if (!$fpw = fopen($phpbb_root_path . 'develop/' . basename($url), 'wb'))
- {
- die("Can't open develop/" . basename($url) . " for output... please check your permissions or something");
- }
-
- $i = 0;
- $chunk = 32768;
- $done = '';
-
- while (!feof($fpr))
- {
- $i += fwrite($fpw, fread($fpr, $chunk));
- echo str_repeat("\x08", strlen($done));
-
- $done = ($i >> 10) . ' KiB';
- echo $done;
- }
- fclose($fpr);
- fclose($fpw);
-
- echo "\n";
-}
-
-/**
-* Convert a UTF string to a sequence of codepoints in hexadecimal
-*
-* @param string $utf UTF string
-* @return integer Unicode codepoints in hex
-*/
-function utf_to_hexseq($str)
-{
- $pos = 0;
- $len = strlen($str);
- $ret = array();
-
- while ($pos < $len)
- {
- $c = $str[$pos];
- switch ($c & "\xF0")
- {
- case "\xC0":
- case "\xD0":
- $utf_char = substr($str, $pos, 2);
- $pos += 2;
- break;
-
- case "\xE0":
- $utf_char = substr($str, $pos, 3);
- $pos += 3;
- break;
-
- case "\xF0":
- $utf_char = substr($str, $pos, 4);
- $pos += 4;
- break;
-
- default:
- $utf_char = $c;
- ++$pos;
- }
-
- $hex = dechex(utf_to_cp($utf_char));
-
- if (!isset($hex[3]))
- {
- $hex = substr('000' . $hex, -4);
- }
-
- $ret[] = $hex;
- }
-
- return strtr(implode(' ', $ret), 'abcdef', 'ABCDEF');
-}
-
-/**
-* Convert a UTF-8 char to its codepoint
-*
-* @param string $utf_char UTF-8 char
-* @return integer Unicode codepoint
-*/
-function utf_to_cp($utf_char)
-{
- switch (strlen($utf_char))
- {
- case 1:
- return ord($utf_char);
-
- case 2:
- return ((ord($utf_char[0]) & 0x1F) << 6) | (ord($utf_char[1]) & 0x3F);
-
- case 3:
- return ((ord($utf_char[0]) & 0x0F) << 12) | ((ord($utf_char[1]) & 0x3F) << 6) | (ord($utf_char[2]) & 0x3F);
-
- case 4:
- return ((ord($utf_char[0]) & 0x07) << 18) | ((ord($utf_char[1]) & 0x3F) << 12) | ((ord($utf_char[2]) & 0x3F) << 6) | (ord($utf_char[3]) & 0x3F);
-
- default:
- die('UTF-8 chars can only be 1-4 bytes long');
- }
-}
-
-/**
-* Return a UTF string formed from a sequence of codepoints in hexadecimal
-*
-* @param string $seq Sequence of codepoints, separated with a space
-* @return string UTF-8 string
-*/
-function hexseq_to_utf($seq)
-{
- return implode('', array_map('hex_to_utf', explode(' ', $seq)));
-}
-
-/**
-* Convert a codepoint in hexadecimal to a UTF-8 char
-*
-* @param string $hex Codepoint, in hexadecimal
-* @return string UTF-8 char
-*/
-function hex_to_utf($hex)
-{
- return cp_to_utf(hexdec($hex));
-}
-
-/**
-* Convert a codepoint to a UTF-8 char
-*
-* @param integer $cp Unicode codepoint
-* @return string UTF-8 string
-*/
-function cp_to_utf($cp)
-{
- if ($cp > 0xFFFF)
- {
- return chr(0xF0 | ($cp >> 18)) . chr(0x80 | (($cp >> 12) & 0x3F)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F));
- }
- else if ($cp > 0x7FF)
- {
- return chr(0xE0 | ($cp >> 12)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F));
- }
- else if ($cp > 0x7F)
- {
- return chr(0xC0 | ($cp >> 6)) . chr(0x80 | ($cp & 0x3F));
- }
- else
- {
- return chr($cp);
- }
-}
diff --git a/phpBB/docs/INSTALL.html b/phpBB/docs/INSTALL.html
index 132367dd0a..a0e63092f0 100644
--- a/phpBB/docs/INSTALL.html
+++ b/phpBB/docs/INSTALL.html
@@ -147,7 +147,7 @@
<li>Oracle</li>
</ul>
</li>
- <li><strong>PHP 5.3.3+</strong> with support for the database you intend to use.</li>
+ <li><strong>PHP 5.3.9+</strong> with support for the database you intend to use.</li>
<li>The following PHP modules are required:
<ul>
<li>json</li>
@@ -321,7 +321,7 @@
<p>If you have non-English language packs installed, you may want to see if a new version has been made available. A number of missing strings may have been added which, though not essential, may be beneficial to users. Please note that at this time not all language packs have been updated so you should be prepared to periodically check for updates.</p>
- <p>These update methods will only update the standard styles, <code>prosilver</code> and <code>subsilver2</code>, any other styles you have installed for your board will usually also need to be updated.</p>
+ <p>These update methods will only update the standard style <code>prosilver</code>, any other styles you have installed for your board will usually also need to be updated.</p>
</div>
diff --git a/phpBB/docs/README.html b/phpBB/docs/README.html
index 21639045a3..1d6530b4da 100644
--- a/phpBB/docs/README.html
+++ b/phpBB/docs/README.html
@@ -265,7 +265,7 @@
<ul>
<li>Your server type/version, e.g. Apache 2.2.3, IIS 7, Sambar, etc.</li>
- <li>PHP version and mode of operation, e.g. PHP 5.3.3 as a module, PHP 5.4.0 running as CGI, etc.</li>
+ <li>PHP version and mode of operation, e.g. PHP 5.3.9 as a module, PHP 5.4.0 running as CGI, etc.</li>
<li>DB type/version, e.g. MySQL 5.0.77, PostgreSQL 9.0.6, MSSQL Server 2000 SP1, etc.</li>
</ul>
@@ -323,7 +323,7 @@
<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>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.9.</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>
diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md
index b69cbf77c9..7203e7758e 100644
--- a/phpBB/docs/events.md
+++ b/phpBB/docs/events.md
@@ -294,7 +294,6 @@ attachment_file_after
===
* Locations:
+ styles/prosilver/template/attachment.html
- + styles/subsilver2/template/attachment.html
* Since: 3.1.6-RC1
* Purpose: Add content after the attachment.
@@ -302,7 +301,6 @@ attachment_file_append
===
* Locations:
+ styles/prosilver/template/attachment.html
- + styles/subsilver2/template/attachment.html
* Since: 3.1.6-RC1
* Purpose: Add custom attachment types displaying to the bottom of attachment block.
@@ -310,7 +308,6 @@ attachment_file_before
===
* Locations:
+ styles/prosilver/template/attachment.html
- + styles/subsilver2/template/attachment.html
* Since: 3.1.6-RC1
* Purpose: Add content before the attachment.
@@ -318,7 +315,6 @@ attachment_file_prepend
===
* Locations:
+ styles/prosilver/template/attachment.html
- + styles/subsilver2/template/attachment.html
* Since: 3.1.6-RC1
* Purpose: Add custom attachment types displaying to the top of attachment block.
@@ -326,7 +322,6 @@ forumlist_body_category_header_after
===
* Locations:
+ styles/prosilver/template/forumlist_body.html
- + styles/subsilver2/template/forumlist_body.html
* Since: 3.1.0-a4
* Purpose: Add content after the header of the category on the forum list.
@@ -334,7 +329,6 @@ forumlist_body_category_header_before
===
* Locations:
+ styles/prosilver/template/forumlist_body.html
- + styles/subsilver2/template/forumlist_body.html
* Since: 3.1.0-a4
* Purpose: Add content before the header of the category on the forum list.
@@ -356,7 +350,6 @@ 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.
@@ -364,7 +357,6 @@ 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.
@@ -372,7 +364,6 @@ 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.
@@ -380,7 +371,6 @@ 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.
@@ -388,7 +378,6 @@ forumlist_body_last_post_title_prepend
===
* Locations:
+ styles/prosilver/template/forumlist_body.html
- + styles/subsilver2/template/forumlist_body.html
* Since: 3.1.0-a1
* Purpose: Add content before the post title of the latest post in a forum on the forum list.
@@ -396,7 +385,6 @@ forumlist_body_subforums_after
===
* Locations:
+ styles/prosilver/template/forumlist_body.html
- + styles/subsilver2/template/forumlist_body.html
* Since: 3.1.0-a4
* Purpose: Add content after the list of subforums (if any) for each forum on the forum list.
@@ -404,7 +392,6 @@ forumlist_body_subforums_before
===
* Locations:
+ styles/prosilver/template/forumlist_body.html
- + styles/subsilver2/template/forumlist_body.html
* Since: 3.1.0-a4
* Purpose: Add content before the list of subforums (if any) for each forum on the forum list.
@@ -412,7 +399,6 @@ forumlist_body_last_row_after
===
* Locations:
+ styles/prosilver/template/forumlist_body.html
- + styles/subsilver2/template/forumlist_body.html
* Since: 3.1.0-b2
* Purpose: Add content after the very last row of the forum list.
@@ -420,7 +406,6 @@ index_body_block_birthday_append
===
* Locations:
+ styles/prosilver/template/index_body.html
- + styles/subsilver2/template/index_body.html
* Since: 3.1.0-b3
* Purpose: Append content to the birthday list on the Board index
@@ -428,7 +413,6 @@ index_body_block_birthday_prepend
===
* Locations:
+ styles/prosilver/template/index_body.html
- + styles/subsilver2/template/index_body.html
* Since: 3.1.0-b3
* Purpose: Prepend content to the birthday list on the Board index
@@ -436,7 +420,6 @@ index_body_block_online_append
===
* Locations:
+ styles/prosilver/template/index_body.html
- + styles/subsilver2/template/index_body.html
* Since: 3.1.0-b3
* Purpose: Append content to the online list on the Board index
@@ -444,7 +427,6 @@ index_body_block_online_prepend
===
* Locations:
+ styles/prosilver/template/index_body.html
- + styles/subsilver2/template/index_body.html
* Since: 3.1.0-b3
* Purpose: Prepend content to the online list on the Board index
@@ -452,7 +434,6 @@ index_body_block_stats_append
===
* Locations:
+ styles/prosilver/template/index_body.html
- + styles/subsilver2/template/index_body.html
* Since: 3.1.0-b3
* Purpose: Append content to the statistics list on the Board index
@@ -460,7 +441,6 @@ index_body_block_stats_prepend
===
* Locations:
+ styles/prosilver/template/index_body.html
- + styles/subsilver2/template/index_body.html
* Since: 3.1.0-b3
* Purpose: Prepend content to the statistics list on the Board index
@@ -468,7 +448,6 @@ 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
@@ -476,7 +455,6 @@ index_body_markforums_after
===
* Locations:
+ styles/prosilver/template/index_body.html
- + styles/subsilver2/template/index_body.html
* Since: 3.1.0-RC2
* Purpose: Add content after the mark-read link above the forum list on Board index
@@ -484,7 +462,6 @@ index_body_markforums_before
===
* Locations:
+ styles/prosilver/template/index_body.html
- + styles/subsilver2/template/index_body.html
* Since: 3.1.0-RC2
* Purpose: Add content before the mark-read link above the forum list on Board index
@@ -492,7 +469,6 @@ index_body_stat_blocks_after
===
* Locations:
+ styles/prosilver/template/index_body.html
- + styles/subsilver2/template/index_body.html
* Since: 3.1.0-b3
* Purpose: Add new statistic blocks below the Who Is Online and Board Statistics blocks
@@ -500,7 +476,6 @@ index_body_stat_blocks_before
===
* Locations:
+ styles/prosilver/template/index_body.html
- + styles/subsilver2/template/index_body.html
* Since: 3.1.0-a1
* Purpose: Add new statistic blocks above the Who Is Online and Board Statistics blocks
@@ -508,7 +483,6 @@ mcp_ban_fields_after
===
* Locations:
+ styles/prosilver/template/mcp_ban.html
- + styles/subsilver2/template/mcp_ban.html
* Since: 3.1.0-RC3
* Purpose: Add additional fields to the ban form in MCP
@@ -516,7 +490,6 @@ mcp_ban_fields_before
===
* Locations:
+ styles/prosilver/template/mcp_ban.html
- + styles/subsilver2/template/mcp_ban.html
* Since: 3.1.0-RC3
* Purpose: Add additional fields to the ban form in MCP
@@ -524,7 +497,6 @@ mcp_ban_unban_after
===
* Locations:
+ styles/prosilver/template/mcp_ban.html
- + styles/subsilver2/template/mcp_ban.html
* Since: 3.1.0-RC3
* Purpose: Add additional fields to the unban form in MCP
@@ -532,7 +504,6 @@ mcp_ban_unban_before
===
* Locations:
+ styles/prosilver/template/mcp_ban.html
- + styles/subsilver2/template/mcp_ban.html
* Since: 3.1.0-RC3
* Purpose: Add additional fields to the unban form in MCP
@@ -540,7 +511,6 @@ mcp_forum_topic_title_before
===
* Locations:
+ styles/prosilver/template/mcp_forum.html
- + styles/subsilver2/template/mcp_forum.html
* Since: 3.1.6-RC1
* Purpose: Add some information before the topic title
@@ -548,7 +518,6 @@ mcp_forum_topic_title_after
===
* Locations:
+ styles/prosilver/template/mcp_forum.html
- + styles/subsilver2/template/mcp_forum.html
* Since: 3.1.6-RC1
* Purpose: Add some information after the topic title
@@ -556,7 +525,6 @@ 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
@@ -564,7 +532,6 @@ 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
@@ -572,7 +539,6 @@ 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
@@ -580,7 +546,6 @@ 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
@@ -588,7 +553,6 @@ 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
@@ -596,7 +560,6 @@ mcp_post_additional_options
===
* Locations:
+ styles/prosilver/template/mcp_post.html
- + styles/subsilver2/template/mcp_post.html
* Since: 3.1.5-RC1
* Purpose: Add content within the list of post moderation actions
@@ -604,7 +567,6 @@ mcp_topic_options_after
===
* Locations:
+ styles/prosilver/template/mcp_topic.html
- + styles/subsilver2/template/mcp_topic.html
* Since: 3.1.6-RC1
* Purpose: Add some options (field, checkbox, ...) after the subject field when split a subject
@@ -612,7 +574,6 @@ mcp_topic_options_before
===
* Locations:
+ styles/prosilver/template/mcp_topic.html
- + styles/subsilver2/template/mcp_topic.html
* Since: 3.1.6-RC1
* Purpose: Add some options (field, checkbox, ...) before the subject field when split a subject
@@ -620,7 +581,6 @@ mcp_topic_topic_title_after
===
* Locations:
+ styles/prosilver/template/mcp_topic.html
- + styles/subsilver2/template/mcp_topic.html
* Since: 3.1.6-RC1
* Purpose: Add some information after the topic title
@@ -628,7 +588,6 @@ mcp_topic_topic_title_before
===
* Locations:
+ styles/prosilver/template/mcp_topic.html
- + styles/subsilver2/template/mcp_topic.html
* Since: 3.1.6-RC1
* Purpose: Add some information before the topic title
@@ -636,7 +595,6 @@ mcp_warn_post_add_warning_field_after
===
* Locations:
+ styles/prosilver/template/mcp_warn_post.html
- + styles/subsilver2/template/mcp_warn_post.html
* Since: 3.1.0-RC4
* Purpose: Add content during warning for a post - after add warning field.
@@ -644,7 +602,6 @@ mcp_warn_post_add_warning_field_before
===
* Locations:
+ styles/prosilver/template/mcp_warn_post.html
- + styles/subsilver2/template/mcp_warn_post.html
* Since: 3.1.0-RC4
* Purpose: Add content during warning for a post - before add warning field.
@@ -652,7 +609,6 @@ mcp_warn_user_add_warning_field_after
===
* Locations:
+ styles/prosilver/template/mcp_warn_user.html
- + styles/subsilver2/template/mcp_warn_user.html
* Since: 3.1.0-RC4
* Purpose: Add content during warning a user - after add warning field.
@@ -660,7 +616,6 @@ mcp_warn_user_add_warning_field_before
===
* Locations:
+ styles/prosilver/template/mcp_warn_user.html
- + styles/subsilver2/template/mcp_warn_user.html
* Since: 3.1.0-RC4
* Purpose: Add content during warning a user - before add warning field.
@@ -668,7 +623,6 @@ memberlist_body_rank_append
===
* Locations:
+ styles/prosilver/template/memberlist_body.html
- + styles/subsilver2/template/memberlist_body.html
* Since: 3.1.6-RC1
* Purpose: Add information after rank in memberlist. Works in
all display modes (leader, group and normal memberlist).
@@ -677,7 +631,6 @@ memberlist_body_rank_prepend
===
* Locations:
+ styles/prosilver/template/memberlist_body.html
- + styles/subsilver2/template/memberlist_body.html
* Since: 3.1.6-RC1
* Purpose: Add information before rank in memberlist. Works in
all display modes (leader, group and normal memberlist).
@@ -686,7 +639,6 @@ memberlist_body_username_append
===
* Locations:
+ styles/prosilver/template/memberlist_body.html
- + styles/subsilver2/template/memberlist_body.html
* Since: 3.1.0-a1
* Purpose: Add information after every username in the memberlist. Works in
all display modes (leader, group and normal memberlist).
@@ -695,7 +647,6 @@ memberlist_body_username_prepend
===
* Locations:
+ styles/prosilver/template/memberlist_body.html
- + styles/subsilver2/template/memberlist_body.html
* Since: 3.1.0-a1
* Purpose: Add information before every username in the memberlist. Works in
all display modes (leader, group and normal memberlist).
@@ -704,7 +655,6 @@ 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.
@@ -712,7 +662,6 @@ 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.
@@ -720,7 +669,6 @@ 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.
@@ -728,7 +676,6 @@ memberlist_view_contact_after
===
* Locations:
+ styles/prosilver/template/memberlist_view.html
- + styles/subsilver2/template/memberlist_view.html
* Since: 3.1.0-b2
* Purpose: Add content after the user contact part of any user profile
@@ -736,7 +683,6 @@ memberlist_view_contact_before
===
* Locations:
+ styles/prosilver/template/memberlist_view.html
- + styles/subsilver2/template/memberlist_view.html
* Since: 3.1.0-b2
* Purpose: Add content before the user contact part of any user profile
@@ -744,7 +690,6 @@ memberlist_view_content_append
===
* Locations:
+ styles/prosilver/template/memberlist_view.html
- + styles/subsilver2/template/memberlist_view.html
* Since: 3.1.0-b2
* Purpose: Add custom content to the user profile view after the main content
@@ -752,17 +697,9 @@ memberlist_view_content_prepend
===
* Locations:
+ styles/prosilver/template/memberlist_view.html
- + styles/subsilver2/template/memberlist_view.html
* Since: 3.1.0-b3
* Purpose: Add custom content to the user profile view before the main content
-memberlist_view_rank_after
-===
-* Locations:
- + styles/subsilver2/template/memberlist_view.html
-* Since: 3.1.6-RC1
-* Purpose: Add information after rank in memberlist
-
memberlist_view_rank_avatar_after
===
* Locations:
@@ -777,13 +714,6 @@ memberlist_view_rank_avatar_before
* Since: 3.1.6-RC1
* Purpose: Add information before rank in memberlist (with avatar)
-memberlist_view_rank_before
-===
-* Locations:
- + styles/subsilver2/template/memberlist_view.html
-* Since: 3.1.6-RC1
-* Purpose: Add information after rank in memberlist
-
memberlist_view_rank_no_avatar_after
===
* Locations:
@@ -802,7 +732,6 @@ memberlist_view_user_statistics_after
===
* Locations:
+ styles/prosilver/template/memberlist_view.html
- + styles/subsilver2/template/memberlist_view.html
* Since: 3.1.0-a1
* Purpose: Add entries after the user statistics part of any user profile
@@ -810,7 +739,6 @@ memberlist_view_user_statistics_before
===
* Locations:
+ styles/prosilver/template/memberlist_view.html
- + styles/subsilver2/template/memberlist_view.html
* Since: 3.1.0-a1
* Purpose: Add entries before the user statistics part of any user profile
@@ -867,7 +795,6 @@ overall_footer_after
===
* Locations:
+ styles/prosilver/template/overall_footer.html
- + styles/subsilver2/template/overall_footer.html
* Since: 3.1.0-a1
* Purpose: Add content at the end of the file, directly prior to the `</body>` tag
@@ -875,7 +802,6 @@ 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
@@ -883,7 +809,6 @@ overall_footer_breadcrumb_append
===
* Locations:
+ styles/prosilver/template/navbar_footer.html
- + styles/subsilver2/template/breadcrumbs.html
* Since: 3.1.0-a1
* Purpose: Add links to the list of breadcrumbs in the footer
@@ -891,7 +816,6 @@ overall_footer_breadcrumb_prepend
===
* Locations:
+ styles/prosilver/template/navbar_footer.html
- + styles/subsilver2/template/breadcrumbs.html
* Since: 3.1.0-RC3
* Purpose: Add links to the list of breadcrumbs in the footer (after site-home, but before board-index)
@@ -899,7 +823,6 @@ overall_footer_content_after
===
* Locations:
+ styles/prosilver/template/overall_footer.html
- + styles/subsilver2/template/overall_footer.html
* Since: 3.1.0-a3
* Purpose: Add content on all pages after the main content, before the footer
@@ -907,7 +830,6 @@ overall_footer_copyright_append
===
* Locations:
+ styles/prosilver/template/overall_footer.html
- + styles/subsilver2/template/overall_footer.html
* Since: 3.1.0-a1
* Purpose: Add content after the copyright line (no new line by default), before the ACP link
@@ -915,7 +837,6 @@ overall_footer_copyright_prepend
===
* Locations:
+ styles/prosilver/template/overall_footer.html
- + styles/subsilver2/template/overall_footer.html
* Since: 3.1.0-a1
* Purpose: Add content before the copyright line
@@ -923,7 +844,6 @@ overall_footer_page_body_after
===
* Locations:
+ styles/prosilver/template/overall_footer.html
- + styles/subsilver2/template/overall_footer.html
* Since: 3.1.0-b3
* Purpose: Add content after the page-body, but before the footer
@@ -931,7 +851,6 @@ overall_footer_teamlink_after
===
* Locations:
+ styles/prosilver/template/navbar_footer.html
- + styles/subsilver2/template/index_body.html
* Since: 3.1.0-b3
* Purpose: Add contents after the team-link in the footer
@@ -939,7 +858,6 @@ overall_footer_teamlink_before
===
* Locations:
+ styles/prosilver/template/navbar_footer.html
- + styles/subsilver2/template/index_body.html
* Since: 3.1.0-b3
* Purpose: Add contents before the team-link in the footer
@@ -947,7 +865,6 @@ overall_footer_timezone_after
===
* Locations:
+ styles/prosilver/template/navbar_footer.html
- + styles/subsilver2/template/breadcrumbs.html
* Since: 3.1.0-b3
* Purpose: Add content to the navbar in the page footer, after "Timezone"
@@ -955,7 +872,6 @@ overall_footer_timezone_before
===
* Locations:
+ styles/prosilver/template/navbar_footer.html
- + styles/subsilver2/template/breadcrumbs.html
* Since: 3.1.0-b3
* Purpose: Add content to the navbar in the page footer, before "Timezone"
@@ -963,7 +879,6 @@ overall_header_body_before
===
* Locations:
+ styles/prosilver/template/overall_header.html
- + styles/subsilver2/template/overall_header.html
* Since: 3.1.0-b2
* Purpose: Add content to the header body
@@ -971,7 +886,6 @@ overall_header_breadcrumb_append
===
* Locations:
+ styles/prosilver/template/navbar_header.html
- + styles/subsilver2/template/breadcrumbs.html
* Since: 3.1.0-a1
* Purpose: Add links to the list of breadcrumbs in the header
@@ -979,7 +893,6 @@ overall_header_breadcrumb_prepend
===
* Locations:
+ styles/prosilver/template/navbar_header.html
- + styles/subsilver2/template/breadcrumbs.html
* Since: 3.1.0-RC3
* Purpose: Add links to the list of breadcrumbs in the header (after site-home, but before board-index)
@@ -987,7 +900,6 @@ overall_header_breadcrumbs_after
===
* Locations:
+ styles/prosilver/template/navbar_header.html
- + styles/subsilver2/template/breadcrumbs.html
* Since: 3.1.0-RC3
* Purpose: Add content after the breadcrumbs (outside of the breadcrumbs container)
@@ -995,7 +907,6 @@ overall_header_breadcrumbs_before
===
* Locations:
+ styles/prosilver/template/navbar_header.html
- + styles/subsilver2/template/breadcrumbs.html
* Since: 3.1.0-RC3
* Purpose: Add content before the breadcrumbs (outside of the breadcrumbs container)
@@ -1003,7 +914,6 @@ overall_header_content_before
===
* Locations:
+ styles/prosilver/template/overall_header.html
- + styles/subsilver2/template/overall_header.html
* Since: 3.1.0-a3
* Purpose: Add content on all pages before the main content, after the header
@@ -1011,7 +921,6 @@ overall_header_feeds
===
* Locations:
+ styles/prosilver/template/overall_header.html
- + styles/subsilver2/template/overall_header.html
* Since: 3.1.6-RC1
* Purpose: Add custom feeds
@@ -1019,7 +928,6 @@ overall_header_head_append
===
* Locations:
+ styles/prosilver/template/overall_header.html
- + styles/subsilver2/template/overall_header.html
* Since: 3.1.0-a1
* Purpose: Add asset calls directly before the `</head>` tag
@@ -1027,7 +935,6 @@ 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
@@ -1035,7 +942,6 @@ overall_header_navigation_append
===
* Locations:
+ styles/prosilver/template/navbar_header.html
- + styles/subsilver2/template/overall_header.html
* Since: 3.1.0-a1
* Purpose: Add links after the navigation links in the header
@@ -1043,7 +949,6 @@ overall_header_navigation_prepend
===
* Locations:
+ styles/prosilver/template/navbar_header.html
- + styles/subsilver2/template/overall_header.html
* Since: 3.1.0-a1
* Purpose: Add links before the navigation links in the header
@@ -1051,7 +956,6 @@ overall_header_navlink_append
===
* Locations:
+ styles/prosilver/template/navbar_header.html
- + styles/subsilver2/template/breadcrumbs.html
* Since: 3.1.0-b3
* Purpose: Add content after each individual navlink (breadcrumb)
@@ -1059,7 +963,6 @@ overall_header_navlink_prepend
===
* Locations:
+ styles/prosilver/template/navbar_header.html
- + styles/subsilver2/template/breadcrumbs.html
* Since: 3.1.0-b3
* Purpose: Add content before each individual navlink (breadcrumb)
@@ -1067,7 +970,6 @@ overall_header_page_body_before
===
* Locations:
+ styles/prosilver/template/overall_header.html
- + styles/subsilver2/template/overall_header.html
* Since: 3.1.0-b3
* Purpose: Add content after the page-header, but before the page-body
@@ -1082,7 +984,6 @@ overall_header_stylesheets_after
===
* Locations:
+ styles/prosilver/template/overall_header.html
- + styles/subsilver2/template/overall_header.html
* Since: 3.1.0-RC3
* Purpose: Add asset calls after stylesheets within the `</head>` tag.
Note that INCLUDECSS will not work with this event.
@@ -1098,7 +999,6 @@ posting_editor_bbcode_status_after
===
* Locations:
+ styles/prosilver/template/posting_editor.html
- + styles/subsilver2/template/posting_body.html
* Since: 3.1.4-RC1
* Purpose: Add content after bbcode status
@@ -1106,7 +1006,6 @@ posting_editor_buttons_after
===
* Locations:
+ styles/prosilver/template/posting_buttons.html
- + styles/subsilver2/template/posting_buttons.html
* Since: 3.1.0-a3
* Purpose: Add content after the BBCode posting buttons
@@ -1114,7 +1013,6 @@ posting_editor_buttons_before
===
* Locations:
+ styles/prosilver/template/posting_buttons.html
- + styles/subsilver2/template/posting_buttons.html
* Since: 3.1.0-a3
* Purpose: Add content before the BBCode posting buttons
@@ -1122,7 +1020,6 @@ 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
@@ -1130,7 +1027,6 @@ posting_editor_message_after
===
* Locations:
+ styles/prosilver/template/posting_editor.html
- + styles/subsilver2/template/posting_body.html
* Since: 3.1.0-a2
* Purpose: Add field (e.g. textbox) to the posting screen after the message
@@ -1138,7 +1034,6 @@ posting_editor_message_before
===
* Locations:
+ styles/prosilver/template/posting_editor.html
- + styles/subsilver2/template/posting_body.html
* Since: 3.1.0-a2
* Purpose: Add field (e.g. textbox) to the posting screen before the message
@@ -1146,7 +1041,6 @@ posting_editor_options_prepend
===
* Locations:
+ styles/prosilver/template/posting_editor.html
- + styles/subsilver2/template/posting_body.html
* Since: 3.1.0-a1
* Purpose: Add posting options on the posting screen
@@ -1154,7 +1048,6 @@ posting_editor_smilies_after
===
* Locations:
+ styles/prosilver/template/posting_editor.html
- + styles/subsilver2/template/posting_body.html
* Since: 3.1.4-RC1
* Purpose: Add content after smilies
@@ -1162,7 +1055,6 @@ posting_editor_smilies_before
===
* Locations:
+ styles/prosilver/template/posting_editor.html
- + styles/subsilver2/template/posting_body.html
* Since: 3.1.4-RC1
* Purpose: Add content before the smilies
@@ -1170,7 +1062,6 @@ posting_editor_subject_after
===
* Locations:
+ styles/prosilver/template/posting_editor.html
- + styles/subsilver2/template/posting_body.html
* Since: 3.1.0-a2
* Purpose: Add field (e.g. textbox) to the posting screen after the subject
@@ -1178,7 +1069,6 @@ posting_editor_subject_before
===
* Locations:
+ styles/prosilver/template/posting_editor.html
- + styles/subsilver2/template/posting_body.html
* Since: 3.1.0-a2
* Purpose: Add field (e.g. textbox) to the posting screen before the subject
@@ -1186,7 +1076,6 @@ posting_editor_submit_buttons
===
* Locations:
+ styles/prosilver/template/posting_editor.html
- + styles/subsilver2/template/posting_body.html
* Since: 3.1.6-RC1
* Purpose: Add custom buttons in the posting editor
@@ -1201,7 +1090,6 @@ posting_pm_header_find_username_after
===
* Locations:
+ styles/prosilver/template/posting_pm_header.html
- + styles/subsilver2/template/ucp_header.html
* Since: 3.1.0-RC4
* Purpose: Add content after the find username link on composing pm
@@ -1209,7 +1097,6 @@ posting_pm_header_find_username_before
===
* Locations:
+ styles/prosilver/template/posting_pm_header.html
- + styles/subsilver2/template/ucp_header.html
* Since: 3.1.0-RC4
* Purpose: Add content before the find username link on composing pm
@@ -1231,7 +1118,6 @@ posting_poll_body_options_after
===
* Locations:
+ styles/prosilver/template/posting_poll_body.html
- + styles/subsilver2/template/posting_poll_body.html
* Since: 3.1.4-RC1
* Purpose: Add content after the poll options on creating a poll
@@ -1239,7 +1125,6 @@ posting_preview_poll_after
===
* Locations:
+ styles/prosilver/template/posting_preview.html
- + styles/subsilver2/template/posting_preview.html
* Since: 3.1.7-RC1
* Purpose: Add content after the poll preview block
@@ -1247,7 +1132,6 @@ posting_topic_title_before
===
* Locations:
+ styles/prosilver/template/posting_layout.html
- + styles/subsilver2/template/posting_body.html
* Since: 3.1.6-RC1
* Purpose: Allows to add some information on the left of the topic title in the posting form
@@ -1255,7 +1139,6 @@ quickreply_editor_panel_after
===
* Locations:
+ styles/prosilver/template/quickreply_editor.html
- + styles/subsilver2/template/quickreply_editor.html
* Since: 3.1.0-b2
* Purpose: Add content after the quick reply panel (but inside the form)
@@ -1263,7 +1146,6 @@ quickreply_editor_panel_before
===
* Locations:
+ styles/prosilver/template/quickreply_editor.html
- + styles/subsilver2/template/quickreply_editor.html
* Since: 3.1.0-b2
* Purpose: Add content before the quick reply panel (but inside the form)
@@ -1271,7 +1153,6 @@ quickreply_editor_message_after
===
* Locations:
+ styles/prosilver/template/quickreply_editor.html
- + styles/subsilver2/template/quickreply_editor.html
* Since: 3.1.0-a4
* Purpose: Add content after the quick reply textbox
@@ -1279,7 +1160,6 @@ quickreply_editor_message_before
===
* Locations:
+ styles/prosilver/template/quickreply_editor.html
- + styles/subsilver2/template/quickreply_editor.html
* Since: 3.1.0-a4
* Purpose: Add content before the quick reply textbox
@@ -1287,7 +1167,6 @@ search_body_form_before
===
* Locations:
+ styles/prosilver/template/search_body.html
- + styles/subsilver2/template/search_body.html
* Since: 3.1.5-RC1
* Purpose: Add content before the search form
@@ -1295,7 +1174,6 @@ 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
@@ -1303,7 +1181,6 @@ 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.
@@ -1311,7 +1188,6 @@ search_results_post_after
===
* Locations:
+ styles/prosilver/template/search_results.html
- + styles/subsilver2/template/search_results.html
* Since: 3.1.0-b3
* Purpose: Add data after search result posts
@@ -1319,7 +1195,6 @@ search_results_post_before
===
* Locations:
+ styles/prosilver/template/search_results.html
- + styles/subsilver2/template/search_results.html
* Since: 3.1.0-b3
* Purpose: Add data before search result posts
@@ -1341,7 +1216,6 @@ 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.
@@ -1349,7 +1223,6 @@ search_results_topic_after
===
* Locations:
+ styles/prosilver/template/search_results.html
- + styles/subsilver2/template/search_results.html
* Since: 3.1.0-b4
* Purpose: Add data after search result topics
@@ -1357,7 +1230,6 @@ search_results_topic_before
===
* Locations:
+ styles/prosilver/template/search_results.html
- + styles/subsilver2/template/search_results.html
* Since: 3.1.0-b4
* Purpose: Add data before search result topics
@@ -1365,7 +1237,6 @@ simple_footer_after
===
* Locations:
+ styles/prosilver/template/simple_footer.html
- + styles/subsilver2/template/simple_footer.html
* Since: 3.1.0-a1
* Purpose: Add content directly prior to the `</body>` tag of the simple footer
@@ -1373,7 +1244,6 @@ simple_header_body_before
===
* Locations:
+ styles/prosilver/template/simple_header.html
- + styles/subsilver2/template/simple_header.html
* Since: 3.1.0-b2
* Purpose: Add content to the header body
@@ -1381,7 +1251,6 @@ simple_header_head_append
===
* Locations:
+ styles/prosilver/template/simple_header.html
- + styles/subsilver2/template/simple_header.html
* Since: 3.1.0-b4
* Purpose: Add asset calls directly before the `</head>` tag
@@ -1389,7 +1258,6 @@ simple_header_stylesheets_after
===
* Locations:
+ styles/prosilver/template/simple_header.html
- + styles/subsilver2/template/simple_header.html
* Since: 3.1.0-RC3
* Purpose: Add asset calls after stylesheets within the `</head>` tag.
Note that INCLUDECSS will not work with this event.
@@ -1400,9 +1268,6 @@ topiclist_row_prepend
+ styles/prosilver/template/search_results.html
+ styles/prosilver/template/viewforum_body.html
+ styles/prosilver/template/mcp_forum.html
- + styles/subsilver2/template/search_results.html
- + styles/subsilver2/template/viewforum_body.html
- + styles/subsilver2/template/mcp_forum.html
* Since: 3.1.0-a1
* Changed: 3.1.6-RC1 Added event to mcp_forum.html
* Purpose: Add content into topic rows (inside the elements containing topic titles)
@@ -1413,9 +1278,6 @@ topiclist_row_append
+ styles/prosilver/template/search_results.html
+ styles/prosilver/template/viewforum_body.html
+ styles/prosilver/template/mcp_forum.html
- + styles/subsilver2/template/search_results.html
- + styles/subsilver2/template/viewforum_body.html
- + styles/subsilver2/template/mcp_forum.html
* Since: 3.1.0-a1
* Changed: 3.1.6-RC1 Added event to mcp_forum.html
* Purpose: Add content into topic rows (inside the elements containing topic titles)
@@ -1424,7 +1286,6 @@ ucp_agreement_terms_after
===
* Locations:
+ styles/prosilver/template/ucp_agreement.html
- + styles/subsilver2/template/ucp_agreement.html
* Since: 3.1.0-b3
* Purpose: Add content after the terms of agreement text at user registration
@@ -1432,7 +1293,6 @@ ucp_agreement_terms_before
===
* Locations:
+ styles/prosilver/template/ucp_agreement.html
- + styles/subsilver2/template/ucp_agreement.html
* Since: 3.1.0-b3
* Purpose: Add content before the terms of agreement text at user registration
@@ -1440,7 +1300,6 @@ ucp_main_front_user_activity_after
===
* Locations:
+ styles/prosilver/template/ucp_main_front.html
- + styles/subsilver2/template/ucp_main_front.html
* Since: 3.1.6-RC1
* Purpose: Add content right after the user activity info viewing UCP front page
@@ -1448,7 +1307,6 @@ ucp_main_front_user_activity_before
===
* Locations:
+ styles/prosilver/template/ucp_main_front.html
- + styles/subsilver2/template/ucp_main_front.html
* Since: 3.1.6-RC1
* Purpose: Add content right before the user activity info viewing UCP front page
@@ -1456,7 +1314,6 @@ ucp_pm_history_post_buttons_after
===
* Locations:
+ styles/prosilver/template/ucp_pm_history.html
- + styles/subsilver2/template/ucp_pm_history.html
* Since: 3.1.6-RC1
* Purpose: Add post button to private messages in history review (next to quote etc), at
the end of the list.
@@ -1465,7 +1322,6 @@ ucp_pm_history_post_buttons_before
===
* Locations:
+ styles/prosilver/template/ucp_pm_history.html
- + styles/subsilver2/template/ucp_pm_history.html
* Since: 3.1.6-RC1
* Purpose: Add post button to private messages in history review (next to quote etc), at
the start of the list.
@@ -1490,7 +1346,6 @@ ucp_pm_history_review_after
===
* Locations:
+ styles/prosilver/template/ucp_pm_history.html
- + styles/subsilver2/template/ucp_pm_history.html
* Since: 3.1.6-RC1
* Purpose: Add content after the private messages history review.
@@ -1498,7 +1353,6 @@ ucp_pm_history_review_before
===
* Locations:
+ styles/prosilver/template/ucp_pm_history.html
- + styles/subsilver2/template/ucp_pm_history.html
* Since: 3.1.6-RC1
* Purpose: Add content before the private messages history review.
@@ -1552,7 +1406,6 @@ ucp_pm_viewmessage_post_buttons_after
===
* Locations:
+ styles/prosilver/template/ucp_pm_viewmessage.html
- + styles/subsilver2/template/ucp_pm_viewmessage.html
* Since: 3.1.0-RC3
* Purpose: Add post button to private messages (next to edit, quote etc), at
the end of the list.
@@ -1561,7 +1414,6 @@ ucp_pm_viewmessage_post_buttons_before
===
* Locations:
+ styles/prosilver/template/ucp_pm_viewmessage.html
- + styles/subsilver2/template/ucp_pm_viewmessage.html
* Since: 3.1.0-RC3
* Purpose: Add post button to private messages (next to edit, quote etc), at
the start of the list.
@@ -1586,7 +1438,6 @@ ucp_pm_viewmessage_print_head_append
===
* Locations:
+ styles/prosilver/template/ucp_pm_viewmessage_print.html
- + styles/subsilver2/template/ucp_pm_viewmessage_print.html
* Since: 3.1.0-a1
* Purpose: Add asset calls directly before the `</head>` tag of the Print PM screen
@@ -1610,7 +1461,6 @@ ucp_prefs_personal_prepend
===
* Locations:
+ styles/prosilver/template/ucp_prefs_personal.html
- + styles/subsilver2/template/ucp_prefs_personal.html
* Since: 3.1.0-a1
* Purpose: Add user options to the top of the Edit Global Settings block
@@ -1618,7 +1468,6 @@ ucp_prefs_personal_append
===
* Locations:
+ styles/prosilver/template/ucp_prefs_personal.html
- + styles/subsilver2/template/ucp_prefs_personal.html
* Since: 3.1.0-a1
* Purpose: Add user options to the bottom of the Edit Global Settings block
@@ -1626,7 +1475,6 @@ ucp_prefs_post_prepend
===
* Locations:
+ styles/prosilver/template/ucp_prefs_post.html
- + styles/subsilver2/template/ucp_prefs_post.html
* Since: 3.1.0-a1
* Purpose: Add user options to the top of the Edit Posting Defaults block
@@ -1634,7 +1482,6 @@ ucp_prefs_post_append
===
* Locations:
+ styles/prosilver/template/ucp_prefs_post.html
- + styles/subsilver2/template/ucp_prefs_post.html
* Since: 3.1.0-a1
* Purpose: Add user options to the bottom of the Edit Posting Defaults block
@@ -1642,7 +1489,6 @@ ucp_prefs_view_radio_buttons_prepend
===
* Locations:
+ styles/prosilver/template/ucp_prefs_view.html
- + styles/subsilver2/template/ucp_prefs_view.html
* Since: 3.1.0-a1
* Purpose: Add options to the top of the radio buttons block of the Edit
Display Options screen
@@ -1651,7 +1497,6 @@ ucp_prefs_view_radio_buttons_append
===
* Locations:
+ styles/prosilver/template/ucp_prefs_view.html
- + styles/subsilver2/template/ucp_prefs_view.html
* Since: 3.1.0-a1
* Purpose: Add options to the bottom of the radio buttons block of the Edit
Display Options screen
@@ -1660,7 +1505,6 @@ ucp_prefs_view_select_menu_prepend
===
* Locations:
+ styles/prosilver/template/ucp_prefs_view.html
- + styles/subsilver2/template/ucp_prefs_view.html
* Since: 3.1.0-a1
* Purpose: Add options to the top of the drop-down lists block of the Edit
Display Options screen
@@ -1669,7 +1513,6 @@ ucp_prefs_view_select_menu_append
===
* Locations:
+ styles/prosilver/template/ucp_prefs_view.html
- + styles/subsilver2/template/ucp_prefs_view.html
* Since: 3.1.0-a1
* Purpose: Add options to the bottom of the drop-down lists block of the Edit
Display Options screen
@@ -1678,7 +1521,6 @@ 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.
@@ -1686,7 +1528,6 @@ 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.
@@ -1694,7 +1535,6 @@ 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.
@@ -1702,7 +1542,6 @@ 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.
@@ -1710,7 +1549,6 @@ ucp_register_credentials_before
===
* Locations:
+ styles/prosilver/template/ucp_register.html
- + styles/subsilver2/template/ucp_register.html
* Since: 3.1.0-b5
* Purpose: Add options in registration page fieldset - before first field.
@@ -1718,7 +1556,6 @@ ucp_register_profile_fields_after
===
* Locations:
+ styles/prosilver/template/ucp_register.html
- + styles/subsilver2/template/ucp_register.html
* Since: 3.1.0-b5
* Purpose: Add options in registration page fieldset - after last field.
@@ -1726,7 +1563,6 @@ ucp_register_credentials_after
===
* Locations:
+ styles/prosilver/template/ucp_register.html
- + styles/subsilver2/template/ucp_register.html
* Since: 3.1.0-b5
* Purpose: Add options in registration page fieldset - after password field.
@@ -1734,7 +1570,6 @@ ucp_register_options_before
===
* Locations:
+ styles/prosilver/template/ucp_register.html
- + styles/subsilver2/template/ucp_register.html
* Since: 3.1.0-b5
* Purpose: Add options in registration page fieldset - before language selector.
@@ -1742,7 +1577,6 @@ ucp_register_profile_fields_before
===
* Locations:
+ styles/prosilver/template/ucp_register.html
- + styles/subsilver2/template/ucp_register.html
* Since: 3.1.0-b5
* Purpose: Add options in registration page fieldset - before profile fields.
@@ -1750,7 +1584,6 @@ ucp_friend_list_before
===
* Locations:
+ styles/prosilver/template/ucp_zebra_friends.html
- + styles/subsilver2/template/ucp_zebra_friends.html
* Since: 3.1.0-a4
* Purpose: Add optional elements before list of friends in UCP
@@ -1758,7 +1591,6 @@ ucp_friend_list_after
===
* Locations:
+ styles/prosilver/template/ucp_zebra_friends.html
- + styles/subsilver2/template/ucp_zebra_friends.html
* Since: 3.1.0-a4
* Purpose: Add optional elements after list of friends in UCP
@@ -1766,7 +1598,6 @@ 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
@@ -1774,7 +1605,6 @@ 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
@@ -1782,7 +1612,6 @@ 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
@@ -1790,7 +1619,6 @@ 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
@@ -1798,7 +1626,6 @@ 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
@@ -1806,7 +1633,6 @@ 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
@@ -1814,7 +1640,6 @@ 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
@@ -1822,7 +1647,6 @@ 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
@@ -1844,7 +1668,6 @@ viewforum_forum_name_append
===
* Locations:
+ styles/prosilver/template/viewforum_body.html
- + styles/subsilver2/template/viewforum_body.html
* Since: 3.1.0-b3
* Purpose: Add content directly after the forum name link on the View forum screen
@@ -1852,7 +1675,6 @@ viewforum_forum_name_prepend
===
* Locations:
+ styles/prosilver/template/viewforum_body.html
- + styles/subsilver2/template/viewforum_body.html
* Since: 3.1.0-b3
* Purpose: Add content directly before the forum name link on the View forum screen
@@ -1860,7 +1682,6 @@ viewforum_forum_title_after
===
* Locations:
+ styles/prosilver/template/viewforum_body.html
- + styles/subsilver2/template/viewforum_body.html
* Since: 3.1.5-RC1
* Purpose: Add content directly after the forum title on the View forum screen
@@ -1868,7 +1689,6 @@ viewforum_forum_title_before
===
* Locations:
+ styles/prosilver/template/viewforum_body.html
- + styles/subsilver2/template/viewforum_body.html
* Since: 3.1.5-RC1
* Purpose: Add content directly before the forum title on the View forum screen
@@ -1876,7 +1696,6 @@ viewtopic_print_head_append
===
* Locations:
+ styles/prosilver/template/viewtopic_print.html
- + styles/subsilver2/template/viewtopic_print.html
* Since: 3.1.0-a1
* Purpose: Add asset calls directly before the `</head>` tag of the Print Topic screen
@@ -1884,7 +1703,6 @@ 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
@@ -1892,7 +1710,6 @@ viewtopic_body_avatar_after
===
* Locations:
+ styles/prosilver/template/viewtopic_body.html
- + styles/subsilver2/template/viewtopic_body.html
* Since: 3.1.0-RC3
* Purpose: Add content right after the avatar when viewing topics
@@ -1900,7 +1717,6 @@ viewtopic_body_avatar_before
===
* Locations:
+ styles/prosilver/template/viewtopic_body.html
- + styles/subsilver2/template/viewtopic_body.html
* Since: 3.1.0-RC3
* Purpose: Add content right before the avatar when viewing topics
@@ -1924,17 +1740,14 @@ viewtopic_body_footer_before
===
* Locations:
+ styles/prosilver/template/viewtopic_body.html
- + styles/subsilver2/template/viewtopic_body.html
* Since: 3.1.0-a1
* Purpose: Add content to the bottom of the View topic screen below the posts
-and quick reply, directly before the jumpbox in Prosilver, breadcrumbs in
-Subsilver2.
+and quick reply, directly before the jumpbox in Prosilver.
viewtopic_body_poll_after
===
* Locations:
+ styles/prosilver/template/viewtopic_body.html
- + styles/subsilver2/template/viewtopic_body.html
* Since: 3.1.6-RC1
* Purpose: Add content after the poll panel.
@@ -1942,7 +1755,6 @@ viewtopic_body_poll_before
===
* Locations:
+ styles/prosilver/template/viewtopic_body.html
- + styles/subsilver2/template/viewtopic_body.html
* Since: 3.1.6-RC1
* Purpose: Add content before the poll panel.
@@ -1950,7 +1762,6 @@ viewtopic_body_poll_option_after
===
* Locations:
+ styles/prosilver/template/viewtopic_body.html
- + styles/subsilver2/template/viewtopic_body.html
* Since: 3.1.0-b3
* Purpose: Add content after the poll option
the list.
@@ -1959,7 +1770,6 @@ viewtopic_body_poll_option_before
===
* Locations:
+ styles/prosilver/template/viewtopic_body.html
- + styles/subsilver2/template/viewtopic_body.html
* Since: 3.1.0-b3
* Purpose: Add content before the poll option
the list.
@@ -1968,7 +1778,6 @@ viewtopic_body_poll_question_append
===
* Locations:
+ styles/prosilver/template/viewtopic_body.html
- + styles/subsilver2/template/viewtopic_body.html
* Since: 3.1.0-b3
* Purpose: Add content directly after the poll question on the View topic screen
@@ -1976,7 +1785,6 @@ viewtopic_body_poll_question_prepend
===
* Locations:
+ styles/prosilver/template/viewtopic_body.html
- + styles/subsilver2/template/viewtopic_body.html
* Since: 3.1.0-b3
* Purpose: Add content directly before the poll question on the View topic screen
@@ -1984,7 +1792,6 @@ 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
@@ -1992,7 +1799,6 @@ 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
@@ -2000,7 +1806,6 @@ viewtopic_body_post_buttons_after
===
* Locations:
+ styles/prosilver/template/viewtopic_body.html
- + styles/subsilver2/template/viewtopic_body.html
* Since: 3.1.0-a1
* Purpose: Add post button to posts (next to edit, quote etc), at the end of
the list.
@@ -2009,7 +1814,6 @@ viewtopic_body_post_buttons_before
===
* Locations:
+ styles/prosilver/template/viewtopic_body.html
- + styles/subsilver2/template/viewtopic_body.html
* Since: 3.1.0-a1
* Purpose: Add post button to posts (next to edit, quote etc), at the start of
the list.
@@ -2034,7 +1838,6 @@ viewtopic_body_postrow_custom_fields_after
===
* Locations:
+ styles/prosilver/template/viewtopic_body.html
- + styles/subsilver2/template/viewtopic_body.html
* Since: 3.1.0-a1
* Purpose: Add data after the custom fields on the user profile when viewing
a post
@@ -2043,7 +1846,6 @@ viewtopic_body_postrow_custom_fields_before
===
* Locations:
+ styles/prosilver/template/viewtopic_body.html
- + styles/subsilver2/template/viewtopic_body.html
* Since: 3.1.0-a1
* Purpose: Add data before the custom fields on the user profile when viewing
a post
@@ -2052,7 +1854,6 @@ viewtopic_body_postrow_post_after
===
* Locations:
+ styles/prosilver/template/viewtopic_body.html
- + styles/subsilver2/template/viewtopic_body.html
* Since: 3.1.0-a4
* Purpose: Add data after posts
@@ -2060,7 +1861,6 @@ viewtopic_body_postrow_post_before
===
* Locations:
+ styles/prosilver/template/viewtopic_body.html
- + styles/subsilver2/template/viewtopic_body.html
* Since: 3.1.0-a4
* Purpose: Add data before posts
@@ -2068,7 +1868,6 @@ viewtopic_body_postrow_post_content_footer
===
* Locations:
+ styles/prosilver/template/viewtopic_body.html
- + styles/subsilver2/template/viewtopic_body.html
* Since: 3.1.0-RC4
* Purpose: Add data at the end of the posts.
@@ -2076,7 +1875,6 @@ 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
@@ -2084,7 +1882,6 @@ 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
@@ -2092,7 +1889,6 @@ viewtopic_body_postrow_post_notices_after
===
* Locations:
+ styles/prosilver/template/viewtopic_body.html
- + styles/subsilver2/template/viewtopic_body.html
* Since: 3.1.0-b2
* Purpose: Add posts specific custom notices at the notices bottom.
@@ -2100,7 +1896,6 @@ viewtopic_body_postrow_post_notices_before
===
* Locations:
+ styles/prosilver/template/viewtopic_body.html
- + styles/subsilver2/template/viewtopic_body.html
* Since: 3.1.0-b2
* Purpose: Add posts specific custom notices at the notices top.
@@ -2108,7 +1903,6 @@ viewtopic_body_postrow_rank_after
===
* Locations:
+ styles/prosilver/template/viewtopic_body.html
- + styles/subsilver2/template/viewtopic_body.html
* Since: 3.1.6-RC1
* Purpose: Add data after the rank on the user profile when viewing
a post
@@ -2117,7 +1911,6 @@ viewtopic_body_postrow_rank_before
===
* Locations:
+ styles/prosilver/template/viewtopic_body.html
- + styles/subsilver2/template/viewtopic_body.html
* Since: 3.1.6-RC1
* Purpose: Add data before the rank on the user profile when viewing
a post
@@ -2126,7 +1919,6 @@ viewtopic_body_topic_actions_before
===
* Locations:
+ styles/prosilver/template/viewtopic_body.html
- + styles/subsilver2/template/viewtopic_body.html
* Since: 3.1.0-a4
* Purpose: Add data before the topic actions buttons (after the posts sorting options)
@@ -2134,7 +1926,6 @@ viewtopic_topic_title_after
===
* Locations:
+ styles/prosilver/template/viewtopic_body.html
- + styles/subsilver2/template/viewtopic_body.html
* Since: 3.1.7-RC1
* Purpose: Add content directly after the topic title link on the View topic screen (outside of the h2 HTML tag)
@@ -2142,7 +1933,6 @@ viewtopic_topic_title_append
===
* Locations:
+ styles/prosilver/template/viewtopic_body.html
- + styles/subsilver2/template/viewtopic_body.html
* Since: 3.1.0-b3
* Purpose: Add content directly after the topic title link on the View topic screen
@@ -2150,7 +1940,6 @@ viewtopic_topic_title_prepend
===
* Locations:
+ styles/prosilver/template/viewtopic_body.html
- + styles/subsilver2/template/viewtopic_body.html
* Since: 3.1.0-a1
* Purpose: Add content directly before the topic title link on the View topic screen
diff --git a/phpBB/docs/install-config.sample.yml b/phpBB/docs/install-config.sample.yml
new file mode 100644
index 0000000000..d49e322a1f
--- /dev/null
+++ b/phpBB/docs/install-config.sample.yml
@@ -0,0 +1,35 @@
+installer:
+ admin:
+ name: admin
+ password: adminadmin
+ email: admin@example.org
+
+ board:
+ lang: en
+ name: My Board
+ description: My amazing new phpBB board
+
+ database:
+ dbms: sqlite3
+ dbhost: /tmp/phpbb.sqlite3
+ dbport: ~
+ dbuser: ~
+ dbpasswd: ~
+ dbname: ~
+ table_prefix: phpbb_
+
+ email:
+ enabled: false
+ smtp_delivery : ~
+ smtp_host: ~
+ smtp_auth: ~
+ smtp_user: ~
+ smtp_pass: ~
+
+ server:
+ cookie_secure: false
+ server_protocol: http://
+ force_server_vars: false
+ server_name: localhost
+ server_port: 80
+ script_path: /
diff --git a/phpBB/download/file.php b/phpBB/download/file.php
index 3e7965899f..fb2b9602cd 100644
--- a/phpBB/download/file.php
+++ b/phpBB/download/file.php
@@ -42,6 +42,11 @@ if (isset($_GET['avatar']))
$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);
extract($phpbb_config_php_file->get_all());
+ if (!defined('PHPBB_ENVIRONMENT'))
+ {
+ @define('PHPBB_ENVIRONMENT', 'production');
+ }
+
if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type))
{
exit;
@@ -56,40 +61,45 @@ if (isset($_GET['avatar']))
$phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/", $phpEx);
$phpbb_class_loader_ext->register();
- phpbb_load_extensions_autoloaders($phpbb_root_path);
-
// Set up container
- $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
- $phpbb_container = $phpbb_container_builder->get_container();
+ $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_root_path, $phpEx);
+ $phpbb_container = $phpbb_container_builder->with_config($phpbb_config_php_file)->get_container();
$phpbb_class_loader->set_cache($phpbb_container->get('cache.driver'));
$phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver'));
// set up caching
+ /* @var $cache \phpbb\cache\service */
$cache = $phpbb_container->get('cache');
+ /* @var $phpbb_dispatcher \phpbb\event\dispatcher */
$phpbb_dispatcher = $phpbb_container->get('dispatcher');
+
+ /* @var $request \phpbb\request\request_interface */
$request = $phpbb_container->get('request');
+
+ /* @var $db \phpbb\db\driver\driver_interface */
$db = $phpbb_container->get('dbal.conn');
+
+ /* @var $phpbb_log \phpbb\log\log_interface */
$phpbb_log = $phpbb_container->get('log');
unset($dbpasswd);
- request_var('', 0, false, false, $request);
-
+ /* @var $config \phpbb\config\config */
$config = $phpbb_container->get('config');
- set_config(null, null, null, $config);
- set_config_count(null, null, null, $config);
// load extensions
+ /* @var $phpbb_extension_manager \phpbb\extension\manager */
$phpbb_extension_manager = $phpbb_container->get('ext.manager');
// worst-case default
$browser = strtolower($request->header('User-Agent', 'msie 6.0'));
+ /* @var $phpbb_avatar_manager \phpbb\avatar\manager */
$phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
- $filename = request_var('avatar', '');
+ $filename = $request->variable('avatar', '');
$avatar_group = false;
$exit = false;
@@ -140,9 +150,9 @@ if (isset($_GET['avatar']))
include($phpbb_root_path . 'common.' . $phpEx);
require($phpbb_root_path . 'includes/functions_download' . '.' . $phpEx);
-$attach_id = request_var('id', 0);
-$mode = request_var('mode', '');
-$thumbnail = request_var('t', false);
+$attach_id = $request->variable('id', 0);
+$mode = $request->variable('mode', '');
+$thumbnail = $request->variable('t', false);
// Start session management, do not update session page.
$user->session_begin(false);
diff --git a/phpBB/faq.php b/phpBB/faq.php
index 5fe155eab0..36a33c97a8 100644
--- a/phpBB/faq.php
+++ b/phpBB/faq.php
@@ -24,90 +24,13 @@ $user->session_begin();
$auth->acl($user->data);
$user->setup();
-$mode = request_var('mode', '');
-
-// Load the appropriate faq file
-switch ($mode)
-{
- case 'bbcode':
- $l_title = $user->lang['BBCODE_GUIDE'];
- $user->add_lang('bbcode', false, true);
- break;
-
- default:
- $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;
-}
-
-// Pull the array data from the lang pack
-$switch_column = $found_switch = false;
-$help_blocks = array();
-foreach ($user->help as $help_ary)
-{
- if ($help_ary[0] == '--')
- {
- if ($help_ary[1] == '--')
- {
- $switch_column = true;
- $found_switch = true;
- continue;
- }
-
- $template->assign_block_vars('faq_block', array(
- 'BLOCK_TITLE' => $help_ary[1],
- 'SWITCH_COLUMN' => $switch_column,
- ));
-
- if ($switch_column)
- {
- $switch_column = false;
- }
- continue;
- }
-
- $template->assign_block_vars('faq_block.faq_row', array(
- 'FAQ_QUESTION' => $help_ary[0],
- 'FAQ_ANSWER' => $help_ary[1])
- );
-}
-
-// Lets build a page ...
-$template->assign_vars(array(
- 'L_FAQ_TITLE' => $l_title,
- 'L_BACK_TO_TOP' => $user->lang['BACK_TO_TOP'],
-
- 'SWITCH_COLUMN_MANUALLY' => (!$found_switch) ? true : false,
- 'S_IN_FAQ' => true,
-));
-
-page_header($l_title);
-
-$template->set_filenames(array(
- 'body' => 'faq_body.html')
+/** @var \phpbb\controller\helper $controller_helper */
+$controller_helper = $phpbb_container->get('controller.helper');
+
+$response = new \Symfony\Component\HttpFoundation\RedirectResponse(
+ $controller_helper->route(
+ $request->variable('mode', 'faq') === 'bbcode' ? 'phpbb_help_bbcode_controller' : 'phpbb_help_faq_controller'
+ ),
+ 301
);
-make_jumpbox(append_sid("{$phpbb_root_path}viewforum.$phpEx"));
-
-page_footer();
+$response->send();
diff --git a/phpBB/feed.php b/phpBB/feed.php
index e0c0b01db6..1480867d6c 100644
--- a/phpBB/feed.php
+++ b/phpBB/feed.php
@@ -16,6 +16,9 @@
*
**/
+use Symfony\Component\HttpFoundation\RedirectResponse;
+use Symfony\Component\Routing\Exception\InvalidParameterException;
+
/**
* @ignore
**/
@@ -23,220 +26,33 @@ define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
-include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
-
-if (!$config['feed_enable'])
-{
- trigger_error('NO_FEED_ENABLED');
-}
-
-// Start session
-$user->session_begin();
-
-if (!empty($config['feed_http_auth']) && request_var('auth', '') == 'http')
-{
- phpbb_http_login(array(
- 'auth_message' => 'Feed',
- 'viewonline' => request_var('viewonline', true),
- ));
-}
-
-$auth->acl($user->data);
-$user->setup('viewtopic');
-
-// Initial var setup
-$forum_id = request_var('f', 0);
-$topic_id = request_var('t', 0);
-$mode = request_var('mode', '');
-
-// We do not use a template, therefore we simply define the global template variables here
-$global_vars = $item_vars = array();
-$feed_updated_time = 0;
-
-// Generate params array for use in append_sid() to correctly link back to this page
-$params = false;
-if ($forum_id || $topic_id || $mode)
-{
- $params = array(
- 'f' => ($forum_id) ? $forum_id : NULL,
- 't' => ($topic_id) ? $topic_id : NULL,
- 'mode' => ($mode) ? $mode : NULL,
- );
-}
-
-// This boards URL
-$phpbb_feed_helper = $phpbb_container->get('feed.helper');
-$board_url = $phpbb_feed_helper->get_board_url();
-
-// Get correct feed object
-$phpbb_feed_factory = $phpbb_container->get('feed.factory');
-$feed = $phpbb_feed_factory->get_feed($mode, $forum_id, $topic_id);
-
-// No feed found
-if ($feed === false)
-{
- trigger_error('NO_FEED');
-}
-
-// Open Feed
-$feed->open();
-
-// Iterate through items
-while ($row = $feed->get_item())
-{
- // BBCode options to correctly disable urls, smilies, bbcode...
- if ($feed->get('options') === NULL)
- {
- // Allow all combinations
- $options = 7;
-
- if ($feed->get('enable_bbcode') !== NULL && $feed->get('enable_smilies') !== NULL && $feed->get('enable_magic_url') !== NULL)
- {
- $options = (($row[$feed->get('enable_bbcode')]) ? OPTION_FLAG_BBCODE : 0) + (($row[$feed->get('enable_smilies')]) ? OPTION_FLAG_SMILIES : 0) + (($row[$feed->get('enable_magic_url')]) ? OPTION_FLAG_LINKS : 0);
- }
- }
- else
- {
- $options = $row[$feed->get('options')];
- }
-
- $title = (isset($row[$feed->get('title')]) && $row[$feed->get('title')] !== '') ? $row[$feed->get('title')] : ((isset($row[$feed->get('title2')])) ? $row[$feed->get('title2')] : '');
-
- $published = ($feed->get('published') !== NULL) ? (int) $row[$feed->get('published')] : 0;
- $updated = ($feed->get('updated') !== NULL) ? (int) $row[$feed->get('updated')] : 0;
-
- $display_attachments = ($auth->acl_get('u_download') && $auth->acl_get('f_download', $row['forum_id']) && isset($row['post_attachment']) && $row['post_attachment']) ? true : false;
-
- $item_row = array(
- 'author' => ($feed->get('creator') !== NULL) ? $row[$feed->get('creator')] : '',
- 'published' => ($published > 0) ? $phpbb_feed_helper->format_date($published) : '',
- 'updated' => ($updated > 0) ? $phpbb_feed_helper->format_date($updated) : '',
- 'link' => '',
- 'title' => censor_text($title),
- 'category' => ($config['feed_item_statistics'] && !empty($row['forum_id'])) ? $board_url . '/viewforum.' . $phpEx . '?f=' . $row['forum_id'] : '',
- 'category_name' => ($config['feed_item_statistics'] && isset($row['forum_name'])) ? $row['forum_name'] : '',
- 'description' => censor_text($phpbb_feed_helper->generate_content($row[$feed->get('text')], $row[$feed->get('bbcode_uid')], $row[$feed->get('bitfield')], $options, $row['forum_id'], ($display_attachments ? $feed->get_attachments($row['post_id']) : array()))),
- 'statistics' => '',
- );
-
- // Adjust items, fill link, etc.
- $feed->adjust_item($item_row, $row);
-
- $item_vars[] = $item_row;
-
- $feed_updated_time = max($feed_updated_time, $published, $updated);
-}
-
-// If we do not have any items at all, sending the current time is better than sending no time.
-if (!$feed_updated_time)
-{
- $feed_updated_time = time();
-}
-
-// Some default assignments
-// FEED_IMAGE is not used (atom)
-$global_vars = array_merge($global_vars, array(
- 'FEED_IMAGE' => '',
- 'SELF_LINK' => $phpbb_feed_helper->append_sid('feed.' . $phpEx, $params),
- 'FEED_LINK' => $board_url . '/index.' . $phpEx,
- 'FEED_TITLE' => $config['sitename'],
- 'FEED_SUBTITLE' => $config['site_desc'],
- 'FEED_UPDATED' => $phpbb_feed_helper->format_date($feed_updated_time),
- 'FEED_LANG' => $user->lang['USER_LANG'],
- 'FEED_AUTHOR' => $config['sitename'],
-));
-$feed->close();
+/** @var \phpbb\controller\helper $controller_helper */
+$controller_helper = $phpbb_container->get('controller.helper');
-// Output page
+$forum_id = $request->variable('f', 0);
+$topic_id = $request->variable('t', 0);
+$mode = $request->variable('mode', '');
-// gzip_compression
-if ($config['gzip_compress'])
+if ($forum_id !== 0)
{
- if (@extension_loaded('zlib') && !headers_sent())
- {
- ob_start('ob_gzhandler');
- }
+ $url = $controller_helper->route('phpbb_feed_forum', array('forum_id' => $forum_id));
}
-
-// IF debug extra is enabled and admin want to "explain" the page we need to set other headers...
-if (defined('DEBUG') && request_var('explain', 0) && $auth->acl_get('a_'))
-{
- header('Content-type: text/html; charset=UTF-8');
- header('Cache-Control: private, no-cache="set-cookie"');
- header('Expires: ' . gmdate('D, d M Y H:i:s', time()) . ' GMT');
-
- $mtime = explode(' ', microtime());
- $totaltime = $mtime[0] + $mtime[1] - $starttime;
-
- if (method_exists($db, 'sql_report'))
- {
- $db->sql_report('display');
- }
-
- garbage_collection();
- exit_handler();
-}
-
-header("Content-Type: application/atom+xml; charset=UTF-8");
-header("Last-Modified: " . gmdate('D, d M Y H:i:s', $feed_updated_time) . ' GMT');
-
-if (!empty($user->data['is_bot']))
+else if ($topic_id !== 0)
{
- // Let reverse proxies know we detected a bot.
- header('X-PHPBB-IS-BOT: yes');
+ $url = $controller_helper->route('phpbb_feed_topic', array('topic_id' => $topic_id));
}
-
-echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
-echo '<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="' . $global_vars['FEED_LANG'] . '">' . "\n";
-echo '<link rel="self" type="application/atom+xml" href="' . $global_vars['SELF_LINK'] . '" />' . "\n\n";
-
-echo (!empty($global_vars['FEED_TITLE'])) ? '<title>' . $global_vars['FEED_TITLE'] . '</title>' . "\n" : '';
-echo (!empty($global_vars['FEED_SUBTITLE'])) ? '<subtitle>' . $global_vars['FEED_SUBTITLE'] . '</subtitle>' . "\n" : '';
-echo (!empty($global_vars['FEED_LINK'])) ? '<link href="' . $global_vars['FEED_LINK'] .'" />' . "\n" : '';
-echo '<updated>' . $global_vars['FEED_UPDATED'] . '</updated>' . "\n\n";
-
-echo '<author><name><![CDATA[' . $global_vars['FEED_AUTHOR'] . ']]></name></author>' . "\n";
-echo '<id>' . $global_vars['SELF_LINK'] . '</id>' . "\n";
-
-foreach ($item_vars as $row)
+else
{
- echo '<entry>' . "\n";
-
- if (!empty($row['author']))
+ try
{
- echo '<author><name><![CDATA[' . $row['author'] . ']]></name></author>' . "\n";
+ $url = $controller_helper->route('phpbb_feed_overall', array('mode' => $mode));
}
-
- echo '<updated>' . ((!empty($row['updated'])) ? $row['updated'] : $row['published']) . '</updated>' . "\n";
-
- if (!empty($row['published']))
+ catch (InvalidParameterException $e)
{
- echo '<published>' . $row['published'] . '</published>' . "\n";
+ $url = $controller_helper->route('phpbb_feed_index');
}
-
- echo '<id>' . $row['link'] . '</id>' . "\n";
- echo '<link href="' . $row['link'] . '"/>' . "\n";
- echo '<title type="html"><![CDATA[' . $row['title'] . ']]></title>' . "\n\n";
-
- if (!empty($row['category']) && isset($row['category_name']) && $row['category_name'] !== '')
- {
- echo '<category term="' . $row['category_name'] . '" scheme="' . $row['category'] . '" label="' . $row['category_name'] . '"/>' . "\n";
- }
-
- echo '<content type="html" xml:base="' . $row['link'] . '"><![CDATA[' . "\n";
- echo $row['description'];
-
- if (!empty($row['statistics']))
- {
- echo '<p>' . $user->lang['STATISTICS'] . ': ' . $row['statistics'] . '</p>';
- }
-
- echo '<hr />' . "\n" . ']]></content>' . "\n";
- echo '</entry>' . "\n";
}
-echo '</feed>';
-
-garbage_collection();
-exit_handler();
+$response = new RedirectResponse($url, 301);
+$response->send();
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php
index 67fba1094d..7ff9846a75 100644
--- a/phpBB/includes/acp/acp_attachments.php
+++ b/phpBB/includes/acp/acp_attachments.php
@@ -36,14 +36,17 @@ class acp_attachments
/** @var \phpbb\user */
protected $user;
+ /** @var \phpbb\filesystem\filesystem_interface */
+ protected $filesystem;
+
public $id;
public $u_action;
protected $new_config;
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache, $phpbb_container;
- global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $phpbb_container, $phpbb_filesystem;
+ global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx, $phpbb_log, $request;
$this->id = $id;
$this->db = $db;
@@ -51,12 +54,13 @@ class acp_attachments
$this->template = $template;
$this->user = $user;
$this->phpbb_container = $phpbb_container;
+ $this->filesystem = $phpbb_filesystem;
$user->add_lang(array('posting', 'viewtopic', 'acp/attachments'));
$error = $notify = array();
$submit = (isset($_POST['submit'])) ? true : false;
- $action = request_var('action', '');
+ $action = $request->variable('action', '');
$form_key = 'acp_attach';
add_form_key($form_key);
@@ -160,7 +164,7 @@ class acp_attachments
);
$this->new_config = $config;
- $cfg_array = (isset($_REQUEST['config'])) ? request_var('config', array('' => '')) : $this->new_config;
+ $cfg_array = (isset($_REQUEST['config'])) ? $request->variable('config', array('' => '')) : $this->new_config;
$error = array();
// We validate the complete config if whished
@@ -184,13 +188,13 @@ class acp_attachments
if (in_array($config_name, array('attachment_quota', 'max_filesize', 'max_filesize_pm')))
{
- $size_var = request_var($config_name, '');
+ $size_var = $request->variable($config_name, '');
$this->new_config[$config_name] = $config_value = ($size_var == 'kb') ? round($config_value * 1024) : (($size_var == 'mb') ? round($config_value * 1048576) : $config_value);
}
if ($submit)
{
- set_config($config_name, $config_value);
+ $config->set($config_name, $config_value);
}
}
@@ -198,7 +202,7 @@ class acp_attachments
if ($submit)
{
- add_log('admin', 'LOG_CONFIG_ATTACH');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_CONFIG_ATTACH');
// Check Settings
$this->test_upload($error, $this->new_config['upload_path'], false);
@@ -334,8 +338,8 @@ class acp_attachments
if ($submit)
{
// Change Extensions ?
- $extension_change_list = request_var('extension_change_list', array(0));
- $group_select_list = request_var('group_select', array(0));
+ $extension_change_list = $request->variable('extension_change_list', array(0));
+ $group_select_list = $request->variable('group_select', array(0));
// Generate correct Change List
$extensions = array();
@@ -359,13 +363,13 @@ class acp_attachments
WHERE extension_id = ' . $row['extension_id'];
$db->sql_query($sql);
- add_log('admin', 'LOG_ATTACH_EXT_UPDATE', $row['extension']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ATTACH_EXT_UPDATE', false, array($row['extension']));
}
}
$db->sql_freeresult($result);
// Delete Extension?
- $extension_id_list = request_var('extension_id_list', array(0));
+ $extension_id_list = $request->variable('extension_id_list', array(0));
if (sizeof($extension_id_list))
{
@@ -386,13 +390,13 @@ class acp_attachments
WHERE ' . $db->sql_in_set('extension_id', $extension_id_list);
$db->sql_query($sql);
- add_log('admin', 'LOG_ATTACH_EXT_DEL', $extension_list);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ATTACH_EXT_DEL', false, array($extension_list));
}
}
// Add Extension?
- $add_extension = strtolower(request_var('add_extension', ''));
- $add_extension_group = request_var('add_group_select', 0);
+ $add_extension = strtolower($request->variable('add_extension', ''));
+ $add_extension_group = $request->variable('add_group_select', 0);
$add = (isset($_POST['add_extension_check'])) ? true : false;
if ($add_extension && $add)
@@ -418,7 +422,8 @@ class acp_attachments
);
$db->sql_query('INSERT INTO ' . EXTENSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
- add_log('admin', 'LOG_ATTACH_EXT_ADD', $add_extension);
+
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ATTACH_EXT_ADD', false, array($add_extension));
}
}
}
@@ -475,8 +480,8 @@ class acp_attachments
if ($submit)
{
- $action = request_var('action', '');
- $group_id = request_var('g', 0);
+ $action = $request->variable('action', '');
+ $group_id = $request->variable('g', 0);
if ($action != 'add' && $action != 'edit')
{
@@ -507,7 +512,7 @@ class acp_attachments
$ext_row = array();
}
- $group_name = utf8_normalize_nfc(request_var('group_name', '', true));
+ $group_name = $request->variable('group_name', '', true);
$new_group_name = ($action == 'add') ? $group_name : (($ext_row['group_name'] != $group_name) ? $group_name : '');
if (!$group_name)
@@ -537,12 +542,12 @@ class acp_attachments
if (!sizeof($error))
{
// Ok, build the update/insert array
- $upload_icon = request_var('upload_icon', 'no_image');
- $size_select = request_var('size_select', 'b');
- $forum_select = request_var('forum_select', false);
- $allowed_forums = request_var('allowed_forums', array(0));
+ $upload_icon = $request->variable('upload_icon', 'no_image');
+ $size_select = $request->variable('size_select', 'b');
+ $forum_select = $request->variable('forum_select', false);
+ $allowed_forums = $request->variable('allowed_forums', array(0));
$allow_in_pm = (isset($_POST['allow_in_pm'])) ? true : false;
- $max_filesize = request_var('max_filesize', 0);
+ $max_filesize = $request->variable('max_filesize', 0);
$max_filesize = ($size_select == 'kb') ? round($max_filesize * 1024) : (($size_select == 'mb') ? round($max_filesize * 1048576) : $max_filesize);
$allow_group = (isset($_POST['allow_group'])) ? true : false;
@@ -558,7 +563,7 @@ class acp_attachments
$group_ary = array(
'group_name' => $group_name,
- 'cat_id' => request_var('special_category', ATTACHMENT_CATEGORY_NONE),
+ 'cat_id' => $request->variable('special_category', ATTACHMENT_CATEGORY_NONE),
'allow_group' => ($allow_group) ? 1 : 0,
'upload_icon' => ($upload_icon == 'no_image') ? '' : $upload_icon,
'max_filesize' => $max_filesize,
@@ -583,10 +588,10 @@ class acp_attachments
}
$group_name = (isset($user->lang['EXT_GROUP_' . $group_name])) ? $user->lang['EXT_GROUP_' . $group_name] : $group_name;
- add_log('admin', 'LOG_ATTACH_EXTGROUP_' . strtoupper($action), $group_name);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ATTACH_EXTGROUP_' . strtoupper($action), false, array($group_name));
}
- $extension_list = request_var('extensions', array(0));
+ $extension_list = $request->variable('extensions', array(0));
if ($action == 'edit' && sizeof($extension_list))
{
@@ -615,13 +620,10 @@ class acp_attachments
$cat_lang = array(
ATTACHMENT_CATEGORY_NONE => $user->lang['NO_FILE_CAT'],
ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'],
- ATTACHMENT_CATEGORY_WM => $user->lang['CAT_WM_FILES'],
- ATTACHMENT_CATEGORY_RM => $user->lang['CAT_RM_FILES'],
ATTACHMENT_CATEGORY_FLASH => $user->lang['CAT_FLASH_FILES'],
- ATTACHMENT_CATEGORY_QUICKTIME => $user->lang['CAT_QUICKTIME_FILES'],
);
- $group_id = request_var('g', 0);
+ $group_id = $request->variable('g', 0);
$action = (isset($_POST['add'])) ? 'add' : $action;
switch ($action)
@@ -648,7 +650,7 @@ class acp_attachments
WHERE group_id = $group_id";
$db->sql_query($sql);
- add_log('admin', 'LOG_ATTACH_EXTGROUP_DEL', $group_name);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ATTACH_EXTGROUP_DEL', false, array($group_name));
$cache->destroy('_extensions');
@@ -689,7 +691,7 @@ class acp_attachments
if ($action == 'add')
{
$ext_group_row = array(
- 'group_name' => utf8_normalize_nfc(request_var('group_name', '', true)),
+ 'group_name' => $request->variable('group_name', '', true),
'cat_id' => 0,
'allow_group' => 1,
'allow_in_pm' => 1,
@@ -905,9 +907,9 @@ class acp_attachments
if ($submit)
{
- $delete_files = (isset($_POST['delete'])) ? array_keys(request_var('delete', array('' => 0))) : array();
- $add_files = (isset($_POST['add'])) ? array_keys(request_var('add', array('' => 0))) : array();
- $post_ids = request_var('post_id', array('' => 0));
+ $delete_files = (isset($_POST['delete'])) ? array_keys($request->variable('delete', array('' => 0))) : array();
+ $add_files = (isset($_POST['add'])) ? array_keys($request->variable('add', array('' => 0))) : array();
+ $post_ids = $request->variable('post_id', array('' => 0));
if (sizeof($delete_files))
{
@@ -938,7 +940,7 @@ class acp_attachments
WHERE ' . $db->sql_in_set('attach_id', array_keys($delete_files));
$db->sql_query($sql);
- add_log('admin', 'LOG_ATTACH_ORPHAN_DEL', implode(', ', $delete_files));
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ATTACH_ORPHAN_DEL', false, array(implode(', ', $delete_files)));
$notify[] = sprintf($user->lang['LOG_ATTACH_ORPHAN_DEL'], implode($user->lang['COMMA_SEPARATOR'], $delete_files));
}
@@ -1029,14 +1031,14 @@ class acp_attachments
$space_taken += $row['filesize'];
$files_added++;
- add_log('admin', 'LOG_ATTACH_FILEUPLOAD', $post_row['post_id'], $row['real_filename']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ATTACH_FILEUPLOAD', false, array($post_row['post_id'], $row['real_filename']));
}
$db->sql_freeresult($result);
if ($files_added)
{
- set_config_count('upload_dir_size', $space_taken, true);
- set_config_count('num_files', $files_added, true);
+ $config->increment('upload_dir_size', $space_taken, false);
+ $config->increment('num_files', $files_added, false);
}
}
}
@@ -1073,7 +1075,7 @@ class acp_attachments
if ($submit)
{
- $delete_files = (isset($_POST['delete'])) ? array_keys(request_var('delete', array('' => 0))) : array();
+ $delete_files = (isset($_POST['delete'])) ? array_keys($request->variable('delete', array('' => 0))) : array();
if (sizeof($delete_files))
{
@@ -1095,7 +1097,8 @@ class acp_attachments
{
$error[] = $user->lang['FILES_GONE'];
}
- add_log('admin', 'LOG_ATTACHMENTS_DELETED', implode(', ', $deleted_filenames));
+
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ATTACHMENTS_DELETED', false, array(implode(', ', $deleted_filenames)));
$notify[] = sprintf($user->lang['LOG_ATTACHMENTS_DELETED'], implode($user->lang['COMMA_SEPARATOR'], $deleted_filenames));
}
else
@@ -1121,12 +1124,12 @@ class acp_attachments
'S_MANAGE' => true,
));
- $start = request_var('start', 0);
+ $start = $request->variable('start', 0);
// Sort keys
- $sort_days = request_var('st', 0);
- $sort_key = request_var('sk', 't');
- $sort_dir = request_var('sd', 'd');
+ $sort_days = $request->variable('st', 0);
+ $sort_key = $request->variable('sk', 't');
+ $sort_dir = $request->variable('sd', 'd');
// Sorting
$limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
@@ -1147,6 +1150,7 @@ class acp_attachments
$total_size = $stats['upload_dir_size'];
// Make sure $start is set to the last page if it exceeds the amount
+ /* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
$start = $pagination->validate_start($start, $attachments_per_page, $num_files);
@@ -1346,6 +1350,8 @@ class acp_attachments
else
{
$this->set_attachment_stats($this->get_attachment_stats());
+
+ /* @var $log \phpbb\log\log_interface */
$log = $this->phpbb_container->get('log');
$log->add('admin', $this->user->data['user_id'], $this->user->ip, 'LOG_RESYNC_FILES_STATS');
}
@@ -1362,10 +1368,7 @@ class acp_attachments
$types = array(
ATTACHMENT_CATEGORY_NONE => $user->lang['NO_FILE_CAT'],
ATTACHMENT_CATEGORY_IMAGE => $user->lang['CAT_IMAGES'],
- ATTACHMENT_CATEGORY_WM => $user->lang['CAT_WM_FILES'],
- ATTACHMENT_CATEGORY_RM => $user->lang['CAT_RM_FILES'],
ATTACHMENT_CATEGORY_FLASH => $user->lang['CAT_FLASH_FILES'],
- ATTACHMENT_CATEGORY_QUICKTIME => $user->lang['CAT_QUICKTIME_FILES'],
);
if ($group_id)
@@ -1496,7 +1499,15 @@ class acp_attachments
if (!file_exists($phpbb_root_path . $upload_dir))
{
@mkdir($phpbb_root_path . $upload_dir, 0777);
- phpbb_chmod($phpbb_root_path . $upload_dir, CHMOD_READ | CHMOD_WRITE);
+
+ try
+ {
+ $this->filesystem->phpbb_chmod($phpbb_root_path . $upload_dir, CHMOD_READ | CHMOD_WRITE);
+ }
+ catch (\phpbb\filesystem\exception\filesystem_exception $e)
+ {
+ // Do nothing
+ }
}
}
@@ -1512,7 +1523,7 @@ class acp_attachments
return;
}
- if (!phpbb_is_writable($phpbb_root_path . $upload_dir))
+ if (!$this->filesystem->is_writable($phpbb_root_path . $upload_dir))
{
$error[] = sprintf($user->lang['NO_WRITE_UPLOAD'], $upload_dir);
return;
@@ -1524,13 +1535,12 @@ class acp_attachments
*/
function perform_site_list()
{
- global $db, $user;
- global $request;
+ global $db, $user, $request, $phpbb_log;
if (isset($_REQUEST['securesubmit']))
{
// Grab the list of entries
- $ips = request_var('ips', '');
+ $ips = $request->variable('ips', '');
$ip_list = array_unique(explode("\n", $ips));
$ip_list_log = implode(', ', $ip_list);
@@ -1676,14 +1686,14 @@ class acp_attachments
{
// Update log
$log_entry = ($ip_exclude) ? 'LOG_DOWNLOAD_EXCLUDE_IP' : 'LOG_DOWNLOAD_IP';
- add_log('admin', $log_entry, $ip_list_log);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, $log_entry, false, array($ip_list_log));
}
trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCCESS'] . adm_back_link($this->u_action));
}
else if (isset($_POST['unsecuresubmit']))
{
- $unip_sql = request_var('unip', array(0));
+ $unip_sql = $request->variable('unip', array(0));
if (sizeof($unip_sql))
{
@@ -1705,7 +1715,7 @@ class acp_attachments
WHERE ' . $db->sql_in_set('site_id', $unip_sql);
$db->sql_query($sql);
- add_log('admin', 'LOG_DOWNLOAD_REMOVE_IP', $l_unip_list);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_DOWNLOAD_REMOVE_IP', false, array($l_unip_list));
}
trigger_error($user->lang['SECURE_DOWNLOAD_UPDATE_SUCCESS'] . adm_back_link($this->u_action));
diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php
index e245eea069..c9225a7eae 100644
--- a/phpBB/includes/acp/acp_bbcodes.php
+++ b/phpBB/includes/acp/acp_bbcodes.php
@@ -25,14 +25,14 @@ class acp_bbcodes
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache, $request, $phpbb_dispatcher;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $request, $phpbb_dispatcher, $phpbb_container;
+ global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_log;
$user->add_lang('acp/posting');
// Set up general vars
- $action = request_var('action', '');
- $bbcode_id = request_var('bbcode', 0);
+ $action = $request->variable('action', '');
+ $bbcode_id = $request->variable('bbcode', 0);
$this->tpl_name = 'acp_bbcodes';
$this->page_title = 'ACP_BBCODES';
@@ -83,11 +83,11 @@ class acp_bbcodes
// No break here
case 'create':
- $display_on_posting = request_var('display_on_posting', 0);
+ $display_on_posting = $request->variable('display_on_posting', 0);
- $bbcode_match = request_var('bbcode_match', '');
- $bbcode_tpl = htmlspecialchars_decode(utf8_normalize_nfc(request_var('bbcode_tpl', '', true)));
- $bbcode_helpline = utf8_normalize_nfc(request_var('bbcode_helpline', '', true));
+ $bbcode_match = $request->variable('bbcode_match', '');
+ $bbcode_tpl = htmlspecialchars_decode($request->variable('bbcode_tpl', '', true));
+ $bbcode_helpline = $request->variable('bbcode_helpline', '', true);
break;
}
@@ -269,6 +269,7 @@ class acp_bbcodes
$db->sql_query('INSERT INTO ' . BBCODES_TABLE . $db->sql_build_array('INSERT', $sql_ary));
$cache->destroy('sql', BBCODES_TABLE);
+ $phpbb_container->get('text_formatter.cache')->invalidate();
$lang = 'BBCODE_ADDED';
$log_action = 'LOG_BBCODE_ADD';
@@ -280,12 +281,13 @@ class acp_bbcodes
WHERE bbcode_id = ' . $bbcode_id;
$db->sql_query($sql);
$cache->destroy('sql', BBCODES_TABLE);
+ $phpbb_container->get('text_formatter.cache')->invalidate();
$lang = 'BBCODE_EDITED';
$log_action = 'LOG_BBCODE_EDIT';
}
- add_log('admin', $log_action, $data['bbcode_tag']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, $log_action, false, array($data['bbcode_tag']));
trigger_error($user->lang[$lang] . adm_back_link($this->u_action));
}
@@ -319,7 +321,8 @@ class acp_bbcodes
{
$db->sql_query('DELETE FROM ' . BBCODES_TABLE . " WHERE bbcode_id = $bbcode_id");
$cache->destroy('sql', BBCODES_TABLE);
- add_log('admin', 'LOG_BBCODE_DELETE', $row['bbcode_tag']);
+ $phpbb_container->get('text_formatter.cache')->invalidate();
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_BBCODE_DELETE', false, array($row['bbcode_tag']));
if ($request->is_ajax())
{
@@ -413,8 +416,6 @@ class acp_bbcodes
// 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();
-
$fp_match = preg_quote($bbcode_match, '!');
$fp_replace = preg_replace('#^\[(.*?)\]#', '[$1:$uid]', $bbcode_match);
$fp_replace = preg_replace('#\[/(.*?)\]$#', '[/$1:$uid]', $fp_replace);
@@ -445,7 +446,7 @@ class acp_bbcodes
'!([a-zA-Z0-9-+.,_ ]+)!' => "$1"
),
'INTTEXT' => array(
- ($utf8_pcre_properties) ? '!([\p{L}\p{N}\-+,_. ]+)!u' : '!([a-zA-Z0-9\-+,_. ]+)!u' => "$1"
+ '!([\p{L}\p{N}\-+,_. ]+)!u' => "$1"
),
'IDENTIFIER' => array(
'!([a-zA-Z0-9-_]+)!' => "$1"
@@ -465,7 +466,7 @@ class acp_bbcodes
'EMAIL' => '(' . get_preg_expression('email') . ')',
'TEXT' => '(.*?)',
'SIMPLETEXT' => '([a-zA-Z0-9-+.,_ ]+)',
- 'INTTEXT' => ($utf8_pcre_properties) ? '([\p{L}\p{N}\-+,_. ]+)' : '([a-zA-Z0-9\-+,_. ]+)',
+ 'INTTEXT' => '([\p{L}\p{N}\-+,_. ]+)',
'IDENTIFIER' => '([a-zA-Z0-9-_]+)',
'COLOR' => '([a-zA-Z]+|#[0-9abcdefABCDEF]+)',
'NUMBER' => '([0-9]+)',
@@ -473,7 +474,7 @@ class acp_bbcodes
$pad = 0;
$modifiers = 'i';
- $modifiers .= ($utf8 && $utf8_pcre_properties) ? 'u' : '';
+ $modifiers .= ($utf8) ? 'u' : '';
if (preg_match_all('/\{(' . implode('|', array_keys($tokens)) . ')[0-9]*\}/i', $bbcode_match, $m))
{
@@ -488,7 +489,9 @@ class acp_bbcodes
if (preg_match_all('/(?<!\\\\)\$([0-9]+)/', $replace, $repad))
{
$repad = $pad + sizeof(array_unique($repad[0]));
- $replace = preg_replace('/(?<!\\\\)\$([0-9]+)/e', "'\${' . (\$1 + \$pad) . '}'", $replace);
+ $replace = preg_replace_callback('/(?<!\\\\)\$([0-9]+)/', function ($match) use ($pad) {
+ return '${' . ($match[1] + $pad) . '}';
+ }, $replace);
$pad = $repad;
}
@@ -553,10 +556,18 @@ class acp_bbcodes
trigger_error($user->lang['BBCODE_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- $fp_match = preg_replace('#\[/?' . $bbcode_search . '#ie', "strtolower('\$0')", $fp_match);
- $fp_replace = preg_replace('#\[/?' . $bbcode_search . '#ie', "strtolower('\$0')", $fp_replace);
- $sp_match = preg_replace('#\[/?' . $bbcode_search . '#ie', "strtolower('\$0')", $sp_match);
- $sp_replace = preg_replace('#\[/?' . $bbcode_search . '#ie', "strtolower('\$0')", $sp_replace);
+ $fp_match = preg_replace_callback('#\[/?' . $bbcode_search . '#i', function ($match) {
+ return strtolower($match[0]);
+ }, $fp_match);
+ $fp_replace = preg_replace_callback('#\[/?' . $bbcode_search . '#i', function ($match) {
+ return strtolower($match[0]);
+ }, $fp_replace);
+ $sp_match = preg_replace_callback('#\[/?' . $bbcode_search . '#i', function ($match) {
+ return strtolower($match[0]);
+ }, $sp_match);
+ $sp_replace = preg_replace_callback('#\[/?' . $bbcode_search . '#i', function ($match) {
+ return strtolower($match[0]);
+ }, $sp_replace);
return array(
'bbcode_tag' => $bbcode_tag,
diff --git a/phpBB/includes/acp/acp_board.php b/phpBB/includes/acp/acp_board.php
index 4a1c74fd77..6e636d2f7d 100644
--- a/phpBB/includes/acp/acp_board.php
+++ b/phpBB/includes/acp/acp_board.php
@@ -30,13 +30,13 @@ class acp_board
function main($id, $mode)
{
- global $db, $user, $auth, $template;
+ global $db, $user, $auth, $template, $request;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
- global $cache, $phpbb_container, $phpbb_dispatcher;
+ global $cache, $phpbb_container, $phpbb_dispatcher, $phpbb_log;
$user->add_lang('acp/board');
- $action = request_var('action', '');
+ $action = $request->variable('action', '');
$submit = (isset($_POST['submit']) || isset($_POST['allow_quick_reply_enable'])) ? true : false;
$form_key = 'acp_board';
@@ -94,6 +94,7 @@ class acp_board
'allow_bbcode' => array('lang' => 'ALLOW_BBCODE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_smilies' => array('lang' => 'ALLOW_SMILIES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_sig' => array('lang' => 'ALLOW_SIG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
+ 'allow_board_notifications' => array('lang' => 'ALLOW_BOARD_NOTIFICATIONS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
'allow_nocensors' => array('lang' => 'ALLOW_NO_CENSORS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_bookmarks' => array('lang' => 'ALLOW_BOOKMARKS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_birthdays' => array('lang' => 'ALLOW_BIRTHDAYS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
@@ -115,6 +116,7 @@ class acp_board
break;
case 'avatar':
+ /* @var $phpbb_avatar_manager \phpbb\avatar\manager */
$phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
$avatar_drivers = $phpbb_avatar_manager->get_all_drivers();
@@ -483,7 +485,7 @@ class acp_board
}
$this->new_config = $config;
- $cfg_array = (isset($_REQUEST['config'])) ? utf8_normalize_nfc(request_var('config', array('' => ''), true)) : $this->new_config;
+ $cfg_array = (isset($_REQUEST['config'])) ? $request->variable('config', array('' => ''), true) : $this->new_config;
$error = array();
// We validate the complete config if wished
@@ -539,7 +541,7 @@ class acp_board
// send the password to the output
continue;
}
- set_config($config_name, $config_value);
+ $config->set($config_name, $config_value);
if ($config_name == 'allow_quick_reply' && isset($_POST['allow_quick_reply_enable']))
{
@@ -561,6 +563,7 @@ class acp_board
if ($mode == 'auth')
{
// Retrieve a list of auth plugins and check their config values
+ /* @var $auth_providers \phpbb\auth\provider_collection */
$auth_providers = $phpbb_container->get('auth.provider_collection');
$updated_auth_settings = false;
@@ -575,7 +578,7 @@ class acp_board
{
if (!isset($config[$field]))
{
- set_config($field, '');
+ $config->set($field, '');
}
if (!isset($cfg_array[$field]) || strpos($field, 'legend') !== false)
@@ -598,7 +601,7 @@ class acp_board
if ($submit)
{
$updated_auth_settings = true;
- set_config($field, $config_value);
+ $config->set($field, $config_value);
}
}
}
@@ -615,11 +618,11 @@ class acp_board
{
foreach ($old_auth_config as $config_name => $config_value)
{
- set_config($config_name, $config_value);
+ $config->set($config_name, $config_value);
}
trigger_error($error . adm_back_link($this->u_action), E_USER_WARNING);
}
- set_config('auth_method', basename($cfg_array['auth_method']));
+ $config->set('auth_method', basename($cfg_array['auth_method']));
}
else
{
@@ -630,7 +633,7 @@ class acp_board
if ($submit)
{
- add_log('admin', 'LOG_CONFIG_' . strtoupper($mode));
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_CONFIG_' . strtoupper($mode));
$message = $user->lang('CONFIG_UPDATED');
$message_type = E_USER_NOTICE;
@@ -737,8 +740,9 @@ class acp_board
{
global $phpbb_root_path, $phpEx, $phpbb_container;
- $auth_plugins = array();
+ /* @var $auth_providers \phpbb\auth\provider_collection */
$auth_providers = $phpbb_container->get('auth.provider_collection');
+ $auth_plugins = array();
foreach ($auth_providers as $key => $value)
{
@@ -1063,10 +1067,10 @@ class acp_board
function store_feed_forums($option, $key)
{
- global $db, $cache;
+ global $db, $cache, $request;
// Get key
- $values = request_var($key, array(0 => 0));
+ $values = $request->variable($key, array(0 => 0));
// Empty option bit for all forums
$sql = 'UPDATE ' . FORUMS_TABLE . '
diff --git a/phpBB/includes/acp/acp_bots.php b/phpBB/includes/acp/acp_bots.php
index 1ea320e674..e0220ad0c3 100644
--- a/phpBB/includes/acp/acp_bots.php
+++ b/phpBB/includes/acp/acp_bots.php
@@ -25,13 +25,13 @@ class acp_bots
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $cache, $request;
+ global $config, $db, $user, $auth, $template, $cache, $request, $phpbb_log;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
- $action = request_var('action', '');
+ $action = $request->variable('action', '');
$submit = (isset($_POST['submit'])) ? true : false;
- $mark = request_var('mark', array(0));
- $bot_id = request_var('id', 0);
+ $mark = $request->variable('mark', array(0));
+ $bot_id = $request->variable('id', 0);
if (isset($_POST['add']))
{
@@ -124,7 +124,7 @@ class acp_bots
$cache->destroy('_bots');
- add_log('admin', 'LOG_BOT_DELETE', implode(', ', $bot_name_ary));
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_BOT_DELETE', false, array(implode(', ', $bot_name_ary)));
trigger_error($user->lang['BOT_DELETED'] . adm_back_link($this->u_action));
}
else
@@ -144,12 +144,12 @@ class acp_bots
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
$bot_row = array(
- 'bot_name' => utf8_normalize_nfc(request_var('bot_name', '', true)),
- 'bot_agent' => request_var('bot_agent', ''),
- 'bot_ip' => request_var('bot_ip', ''),
- 'bot_active' => request_var('bot_active', true),
- 'bot_lang' => request_var('bot_lang', $config['default_lang']),
- 'bot_style' => request_var('bot_style' , $config['default_style']),
+ 'bot_name' => $request->variable('bot_name', '', true),
+ 'bot_agent' => $request->variable('bot_agent', ''),
+ 'bot_ip' => $request->variable('bot_ip', ''),
+ 'bot_active' => $request->variable('bot_active', true),
+ 'bot_lang' => $request->variable('bot_lang', $config['default_lang']),
+ 'bot_style' => $request->variable('bot_style' , $config['default_style']),
);
if ($submit)
@@ -292,7 +292,7 @@ class acp_bots
$cache->destroy('_bots');
- add_log('admin', 'LOG_BOT_' . $log, $bot_row['bot_name']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_BOT_' . $log, false, array($bot_row['bot_name']));
trigger_error($user->lang['BOT_' . $log] . adm_back_link($this->u_action));
}
diff --git a/phpBB/includes/acp/acp_captcha.php b/phpBB/includes/acp/acp_captcha.php
index fa8d8fb6a9..1f6fbc2cae 100644
--- a/phpBB/includes/acp/acp_captcha.php
+++ b/phpBB/includes/acp/acp_captcha.php
@@ -25,17 +25,18 @@ class acp_captcha
function main($id, $mode)
{
- global $db, $user, $auth, $template;
+ global $db, $user, $auth, $template, $phpbb_log, $request;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container;
$user->add_lang('acp/board');
+ /* @var $factory \phpbb\captcha\factory */
$factory = $phpbb_container->get('captcha.factory');
$captchas = $factory->get_captcha_types();
- $selected = request_var('select_captcha', $config['captcha_plugin']);
+ $selected = $request->variable('select_captcha', $config['captcha_plugin']);
$selected = (isset($captchas['available'][$selected]) || isset($captchas['unavailable'][$selected])) ? $selected : $config['captcha_plugin'];
- $configure = request_var('configure', false);
+ $configure = $request->variable('configure', false);
// Oh, they are just here for the view
if (isset($_GET['captcha_demo']))
@@ -64,13 +65,13 @@ class acp_captcha
$form_key = 'acp_captcha';
add_form_key($form_key);
- $submit = request_var('main_submit', false);
+ $submit = $request->variable('main_submit', false);
if ($submit && check_form_key($form_key))
{
foreach ($config_vars as $config_var => $options)
{
- set_config($config_var, request_var($config_var, $options['default']));
+ $config->set($config_var, $request->variable($config_var, $options['default']));
}
if ($selected !== $config['captcha_plugin'])
@@ -81,11 +82,11 @@ class acp_captcha
$old_captcha = $factory->get_instance($config['captcha_plugin']);
$old_captcha->uninstall();
- set_config('captcha_plugin', $selected);
+ $config->set('captcha_plugin', $selected);
$new_captcha = $factory->get_instance($config['captcha_plugin']);
$new_captcha->install();
- add_log('admin', 'LOG_CONFIG_VISUAL');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_CONFIG_VISUAL');
}
else
{
@@ -117,7 +118,7 @@ class acp_captcha
foreach ($config_vars as $config_var => $options)
{
- $template->assign_var($options['tpl'], (isset($_POST[$config_var])) ? request_var($config_var, $options['default']) : $config[$config_var]) ;
+ $template->assign_var($options['tpl'], (isset($_POST[$config_var])) ? $request->variable($config_var, $options['default']) : $config[$config_var]) ;
}
$template->assign_vars(array(
diff --git a/phpBB/includes/acp/acp_contact.php b/phpBB/includes/acp/acp_contact.php
index 4e46df21e0..1a4d5b95a3 100644
--- a/phpBB/includes/acp/acp_contact.php
+++ b/phpBB/includes/acp/acp_contact.php
@@ -48,6 +48,7 @@ class acp_contact
include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
}
+ /* @var $config_text \phpbb\config\db_text */
$config_text = $phpbb_container->get('config_text');
$contact_admin_data = $config_text->get_array(array(
@@ -104,6 +105,9 @@ class acp_contact
$contact_admin_edit = generate_text_for_edit($contact_admin_info, $contact_admin_info_uid, $contact_admin_info_flags);
+ /** @var \phpbb\controller\helper $controller_helper */
+ $controller_helper = $phpbb_container->get('controller.helper');
+
$template->assign_vars(array(
'ERRORS' => $error,
'CONTACT_ENABLED' => $config['contact_admin_form_enable'],
@@ -115,7 +119,7 @@ class acp_contact
'S_SMILIES_DISABLE_CHECKED' => !$contact_admin_edit['allow_smilies'],
'S_MAGIC_URL_DISABLE_CHECKED' => !$contact_admin_edit['allow_urls'],
- 'BBCODE_STATUS' => $user->lang('BBCODE_IS_ON', '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>'),
+ 'BBCODE_STATUS' => $user->lang('BBCODE_IS_ON', '<a href="' . $controller_helper->route('phpbb_help_bbcode_controller') . '">', '</a>'),
'SMILIES_STATUS' => $user->lang['SMILIES_ARE_ON'],
'IMG_STATUS' => $user->lang['IMAGES_ARE_ON'],
'FLASH_STATUS' => $user->lang['FLASH_IS_ON'],
diff --git a/phpBB/includes/acp/acp_database.php b/phpBB/includes/acp/acp_database.php
index 9666ac5b6e..984301a38f 100644
--- a/phpBB/includes/acp/acp_database.php
+++ b/phpBB/includes/acp/acp_database.php
@@ -26,17 +26,17 @@ class acp_database
function main($id, $mode)
{
- global $cache, $db, $user, $auth, $template, $table_prefix;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $cache, $db, $user, $template, $table_prefix, $request;
+ global $phpbb_root_path, $phpbb_container, $phpbb_log;
- $this->db_tools = new \phpbb\db\tools($db);
+ $this->db_tools = $phpbb_container->get('dbal.tools');
$user->add_lang('acp/database');
$this->tpl_name = 'acp_database';
$this->page_title = 'ACP_DATABASE';
- $action = request_var('action', '');
+ $action = $request->variable('action', '');
$submit = (isset($_POST['submit'])) ? true : false;
$template->assign_vars(array(
@@ -52,10 +52,10 @@ class acp_database
switch ($action)
{
case 'download':
- $type = request_var('type', '');
- $table = array_intersect($this->db_tools->sql_list_tables(), request_var('table', array('')));
- $format = request_var('method', '');
- $where = request_var('where', '');
+ $type = $request->variable('type', '');
+ $table = array_intersect($this->db_tools->sql_list_tables(), $request->variable('table', array('')));
+ $format = $request->variable('method', '');
+ $where = $request->variable('where', '');
if (!sizeof($table))
{
@@ -90,36 +90,9 @@ class acp_database
$time = time();
$filename = 'backup_' . $time . '_' . unique_id();
- switch ($db->get_sql_layer())
- {
- case 'mysqli':
- case 'mysql4':
- case 'mysql':
- $extractor = new mysql_extractor($format, $filename, $time, $download, $store);
- break;
-
- case 'sqlite':
- $extractor = new sqlite_extractor($format, $filename, $time, $download, $store);
- break;
- case 'sqlite3':
- $extractor = new sqlite3_extractor($format, $filename, $time, $download, $store);
- break;
-
- case 'postgres':
- $extractor = new postgres_extractor($format, $filename, $time, $download, $store);
- break;
-
- case 'oracle':
- $extractor = new oracle_extractor($format, $filename, $time, $download, $store);
- break;
-
- case 'mssql':
- case 'mssql_odbc':
- case 'mssqlnative':
- $extractor = new mssql_extractor($format, $filename, $time, $download, $store);
- break;
- }
+ $extractor = $phpbb_container->get('dbal.extractor');
+ $extractor->init_extractor($format, $filename, $time, $download, $store);
$extractor->write_start($table_prefix);
@@ -165,7 +138,7 @@ class acp_database
$extractor->write_end();
- add_log('admin', 'LOG_DB_BACKUP');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_DB_BACKUP');
if ($download == true)
{
@@ -221,9 +194,9 @@ class acp_database
switch ($action)
{
case 'submit':
- $delete = request_var('delete', '');
- $file = request_var('file', '');
- $download = request_var('download', '');
+ $delete = $request->variable('delete', '');
+ $file = $request->variable('file', '');
+ $download = $request->variable('download', '');
if (!preg_match('#^backup_\d{10,}_[a-z\d]{16}\.(sql(?:\.(?:gz|bz2))?)$#', $file, $matches))
{
@@ -242,7 +215,7 @@ class acp_database
if (confirm_box(true))
{
unlink($file_name);
- add_log('admin', 'LOG_DB_DELETE');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_DB_DELETE');
trigger_error($user->lang['BACKUP_DELETE'] . adm_back_link($this->u_action));
}
else
@@ -395,7 +368,7 @@ class acp_database
// Purge the cache due to updated data
$cache->purge();
- add_log('admin', 'LOG_DB_RESTORE');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_DB_RESTORE');
trigger_error($user->lang['RESTORE_SUCCESS'] . adm_back_link($this->u_action));
break;
}
@@ -461,1637 +434,6 @@ class acp_database
}
}
-class base_extractor
-{
- var $fh;
- var $fp;
- var $write;
- var $close;
- var $store;
- var $download;
- var $time;
- var $format;
- var $run_comp = false;
-
- function base_extractor($format, $filename, $time, $download = false, $store = false)
- {
- global $request;
-
- $this->download = $download;
- $this->store = $store;
- $this->time = $time;
- $this->format = $format;
-
- switch ($format)
- {
- case 'text':
- $ext = '.sql';
- $open = 'fopen';
- $this->write = 'fwrite';
- $this->close = 'fclose';
- $mimetype = 'text/x-sql';
- break;
- case 'bzip2':
- $ext = '.sql.bz2';
- $open = 'bzopen';
- $this->write = 'bzwrite';
- $this->close = 'bzclose';
- $mimetype = 'application/x-bzip2';
- break;
- case 'gzip':
- $ext = '.sql.gz';
- $open = 'gzopen';
- $this->write = 'gzwrite';
- $this->close = 'gzclose';
- $mimetype = 'application/x-gzip';
- break;
- }
-
- if ($download == true)
- {
- $name = $filename . $ext;
- header('Cache-Control: private, no-cache');
- header("Content-Type: $mimetype; name=\"$name\"");
- header("Content-disposition: attachment; filename=$name");
-
- switch ($format)
- {
- case 'bzip2':
- ob_start();
- break;
-
- case 'gzip':
- if (strpos($request->header('Accept-Encoding'), 'gzip') !== false && strpos(strtolower($request->header('User-Agent')), 'msie') === false)
- {
- ob_start('ob_gzhandler');
- }
- else
- {
- $this->run_comp = true;
- }
- break;
- }
- }
-
- if ($store == true)
- {
- global $phpbb_root_path;
- $file = $phpbb_root_path . 'store/' . $filename . $ext;
-
- $this->fp = $open($file, 'w');
-
- if (!$this->fp)
- {
- trigger_error('FILE_WRITE_FAIL', E_USER_ERROR);
- }
- }
- }
-
- function write_end()
- {
- static $close;
-
- if ($this->store)
- {
- if ($close === null)
- {
- $close = $this->close;
- }
- $close($this->fp);
- }
-
- // bzip2 must be written all the way at the end
- if ($this->download && $this->format === 'bzip2')
- {
- $c = ob_get_clean();
- echo bzcompress($c);
- }
- }
-
- function flush($data)
- {
- static $write;
- if ($this->store === true)
- {
- if ($write === null)
- {
- $write = $this->write;
- }
- $write($this->fp, $data);
- }
-
- if ($this->download === true)
- {
- if ($this->format === 'bzip2' || $this->format === 'text' || ($this->format === 'gzip' && !$this->run_comp))
- {
- echo $data;
- }
-
- // we can write the gzip data as soon as we get it
- if ($this->format === 'gzip')
- {
- if ($this->run_comp)
- {
- echo gzencode($data);
- }
- else
- {
- ob_flush();
- flush();
- }
- }
- }
- }
-}
-
-class mysql_extractor extends base_extractor
-{
- function write_start($table_prefix)
- {
- $sql_data = "#\n";
- $sql_data .= "# phpBB Backup Script\n";
- $sql_data .= "# Dump of tables for $table_prefix\n";
- $sql_data .= "# DATE : " . gmdate("d-m-Y H:i:s", $this->time) . " GMT\n";
- $sql_data .= "#\n";
- $this->flush($sql_data);
- }
-
- function write_table($table_name)
- {
- global $db;
- static $new_extract;
-
- if ($new_extract === null)
- {
- if ($db->get_sql_layer() === 'mysqli' || version_compare($db->sql_server_info(true), '3.23.20', '>='))
- {
- $new_extract = true;
- }
- else
- {
- $new_extract = false;
- }
- }
-
- if ($new_extract)
- {
- $this->new_write_table($table_name);
- }
- else
- {
- $this->old_write_table($table_name);
- }
- }
-
- function write_data($table_name)
- {
- global $db;
- if ($db->get_sql_layer() === 'mysqli')
- {
- $this->write_data_mysqli($table_name);
- }
- else
- {
- $this->write_data_mysql($table_name);
- }
- }
-
- function write_data_mysqli($table_name)
- {
- global $db;
- $sql = "SELECT *
- FROM $table_name";
- $result = mysqli_query($db->get_db_connect_id(), $sql, MYSQLI_USE_RESULT);
- if ($result != false)
- {
- $fields_cnt = mysqli_num_fields($result);
-
- // Get field information
- $field = mysqli_fetch_fields($result);
- $field_set = array();
-
- for ($j = 0; $j < $fields_cnt; $j++)
- {
- $field_set[] = $field[$j]->name;
- }
-
- $search = array("\\", "'", "\x00", "\x0a", "\x0d", "\x1a", '"');
- $replace = array("\\\\", "\\'", '\0', '\n', '\r', '\Z', '\\"');
- $fields = implode(', ', $field_set);
- $sql_data = 'INSERT INTO ' . $table_name . ' (' . $fields . ') VALUES ';
- $first_set = true;
- $query_len = 0;
- $max_len = get_usable_memory();
-
- while ($row = mysqli_fetch_row($result))
- {
- $values = array();
- if ($first_set)
- {
- $query = $sql_data . '(';
- }
- else
- {
- $query .= ',(';
- }
-
- for ($j = 0; $j < $fields_cnt; $j++)
- {
- if (!isset($row[$j]) || is_null($row[$j]))
- {
- $values[$j] = 'NULL';
- }
- else if (($field[$j]->flags & 32768) && !($field[$j]->flags & 1024))
- {
- $values[$j] = $row[$j];
- }
- else
- {
- $values[$j] = "'" . str_replace($search, $replace, $row[$j]) . "'";
- }
- }
- $query .= implode(', ', $values) . ')';
-
- $query_len += strlen($query);
- if ($query_len > $max_len)
- {
- $this->flush($query . ";\n\n");
- $query = '';
- $query_len = 0;
- $first_set = true;
- }
- else
- {
- $first_set = false;
- }
- }
- mysqli_free_result($result);
-
- // check to make sure we have nothing left to flush
- if (!$first_set && $query)
- {
- $this->flush($query . ";\n\n");
- }
- }
- }
-
- function write_data_mysql($table_name)
- {
- global $db;
- $sql = "SELECT *
- FROM $table_name";
- $result = mysql_unbuffered_query($sql, $db->get_db_connect_id());
-
- if ($result != false)
- {
- $fields_cnt = mysql_num_fields($result);
-
- // Get field information
- $field = array();
- for ($i = 0; $i < $fields_cnt; $i++)
- {
- $field[] = mysql_fetch_field($result, $i);
- }
- $field_set = array();
-
- for ($j = 0; $j < $fields_cnt; $j++)
- {
- $field_set[] = $field[$j]->name;
- }
-
- $search = array("\\", "'", "\x00", "\x0a", "\x0d", "\x1a", '"');
- $replace = array("\\\\", "\\'", '\0', '\n', '\r', '\Z', '\\"');
- $fields = implode(', ', $field_set);
- $sql_data = 'INSERT INTO ' . $table_name . ' (' . $fields . ') VALUES ';
- $first_set = true;
- $query_len = 0;
- $max_len = get_usable_memory();
-
- while ($row = mysql_fetch_row($result))
- {
- $values = array();
- if ($first_set)
- {
- $query = $sql_data . '(';
- }
- else
- {
- $query .= ',(';
- }
-
- for ($j = 0; $j < $fields_cnt; $j++)
- {
- if (!isset($row[$j]) || is_null($row[$j]))
- {
- $values[$j] = 'NULL';
- }
- else if ($field[$j]->numeric && ($field[$j]->type !== 'timestamp'))
- {
- $values[$j] = $row[$j];
- }
- else
- {
- $values[$j] = "'" . str_replace($search, $replace, $row[$j]) . "'";
- }
- }
- $query .= implode(', ', $values) . ')';
-
- $query_len += strlen($query);
- if ($query_len > $max_len)
- {
- $this->flush($query . ";\n\n");
- $query = '';
- $query_len = 0;
- $first_set = true;
- }
- else
- {
- $first_set = false;
- }
- }
- mysql_free_result($result);
-
- // check to make sure we have nothing left to flush
- if (!$first_set && $query)
- {
- $this->flush($query . ";\n\n");
- }
- }
- }
-
- function new_write_table($table_name)
- {
- global $db;
-
- $sql = 'SHOW CREATE TABLE ' . $table_name;
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
-
- $sql_data = '# Table: ' . $table_name . "\n";
- $sql_data .= "DROP TABLE IF EXISTS $table_name;\n";
- $this->flush($sql_data . $row['Create Table'] . ";\n\n");
-
- $db->sql_freeresult($result);
- }
-
- function old_write_table($table_name)
- {
- global $db;
-
- $sql_data = '# Table: ' . $table_name . "\n";
- $sql_data .= "DROP TABLE IF EXISTS $table_name;\n";
- $sql_data .= "CREATE TABLE $table_name(\n";
- $rows = array();
-
- $sql = "SHOW FIELDS
- FROM $table_name";
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $line = ' ' . $row['Field'] . ' ' . $row['Type'];
-
- if (!is_null($row['Default']))
- {
- $line .= " DEFAULT '{$row['Default']}'";
- }
-
- if ($row['Null'] != 'YES')
- {
- $line .= ' NOT NULL';
- }
-
- if ($row['Extra'] != '')
- {
- $line .= ' ' . $row['Extra'];
- }
-
- $rows[] = $line;
- }
- $db->sql_freeresult($result);
-
- $sql = "SHOW KEYS
- FROM $table_name";
-
- $result = $db->sql_query($sql);
-
- $index = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $kname = $row['Key_name'];
-
- if ($kname != 'PRIMARY')
- {
- if ($row['Non_unique'] == 0)
- {
- $kname = "UNIQUE|$kname";
- }
- }
-
- if ($row['Sub_part'])
- {
- $row['Column_name'] .= '(' . $row['Sub_part'] . ')';
- }
- $index[$kname][] = $row['Column_name'];
- }
- $db->sql_freeresult($result);
-
- foreach ($index as $key => $columns)
- {
- $line = ' ';
-
- if ($key == 'PRIMARY')
- {
- $line .= 'PRIMARY KEY (' . implode(', ', $columns) . ')';
- }
- else if (strpos($key, 'UNIQUE') === 0)
- {
- $line .= 'UNIQUE ' . substr($key, 7) . ' (' . implode(', ', $columns) . ')';
- }
- else if (strpos($key, 'FULLTEXT') === 0)
- {
- $line .= 'FULLTEXT ' . substr($key, 9) . ' (' . implode(', ', $columns) . ')';
- }
- else
- {
- $line .= "KEY $key (" . implode(', ', $columns) . ')';
- }
-
- $rows[] = $line;
- }
-
- $sql_data .= implode(",\n", $rows);
- $sql_data .= "\n);\n\n";
-
- $this->flush($sql_data);
- }
-}
-
-class sqlite_extractor extends base_extractor
-{
- function write_start($prefix)
- {
- $sql_data = "--\n";
- $sql_data .= "-- phpBB Backup Script\n";
- $sql_data .= "-- Dump of tables for $prefix\n";
- $sql_data .= "-- DATE : " . gmdate("d-m-Y H:i:s", $this->time) . " GMT\n";
- $sql_data .= "--\n";
- $sql_data .= "BEGIN TRANSACTION;\n";
- $this->flush($sql_data);
- }
-
- function write_table($table_name)
- {
- global $db;
- $sql_data = '-- Table: ' . $table_name . "\n";
- $sql_data .= "DROP TABLE $table_name;\n";
-
- $sql = "SELECT sql
- FROM sqlite_master
- WHERE type = 'table'
- AND name = '" . $db->sql_escape($table_name) . "'
- ORDER BY type DESC, name;";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- // Create Table
- $sql_data .= $row['sql'] . ";\n";
-
- $result = $db->sql_query("PRAGMA index_list('" . $db->sql_escape($table_name) . "');");
-
- $ar = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $ar[] = $row;
- }
- $db->sql_freeresult($result);
-
- foreach ($ar as $value)
- {
- if (strpos($value['name'], 'autoindex') !== false)
- {
- continue;
- }
-
- $result = $db->sql_query("PRAGMA index_info('" . $db->sql_escape($value['name']) . "');");
-
- $fields = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $fields[] = $row['name'];
- }
- $db->sql_freeresult($result);
-
- $sql_data .= 'CREATE ' . ($value['unique'] ? 'UNIQUE ' : '') . 'INDEX ' . $value['name'] . ' on ' . $table_name . ' (' . implode(', ', $fields) . ");\n";
- }
-
- $this->flush($sql_data . "\n");
- }
-
- function write_data($table_name)
- {
- global $db;
-
- $col_types = sqlite_fetch_column_types($db->get_db_connect_id(), $table_name);
-
- $sql = "SELECT *
- FROM $table_name";
- $result = sqlite_unbuffered_query($db->get_db_connect_id(), $sql);
- $rows = sqlite_fetch_all($result, SQLITE_ASSOC);
- $sql_insert = 'INSERT INTO ' . $table_name . ' (' . implode(', ', array_keys($col_types)) . ') VALUES (';
- foreach ($rows as $row)
- {
- foreach ($row as $column_name => $column_data)
- {
- if (is_null($column_data))
- {
- $row[$column_name] = 'NULL';
- }
- else if ($column_data == '')
- {
- $row[$column_name] = "''";
- }
- else if (strpos($col_types[$column_name], 'text') !== false || strpos($col_types[$column_name], 'char') !== false || strpos($col_types[$column_name], 'blob') !== false)
- {
- $row[$column_name] = sanitize_data_generic(str_replace("'", "''", $column_data));
- }
- }
- $this->flush($sql_insert . implode(', ', $row) . ");\n");
- }
- }
-
- function write_end()
- {
- $this->flush("COMMIT;\n");
- parent::write_end();
- }
-}
-
-class sqlite3_extractor extends base_extractor
-{
- function write_start($prefix)
- {
- $sql_data = "--\n";
- $sql_data .= "-- phpBB Backup Script\n";
- $sql_data .= "-- Dump of tables for $prefix\n";
- $sql_data .= "-- DATE : " . gmdate("d-m-Y H:i:s", $this->time) . " GMT\n";
- $sql_data .= "--\n";
- $sql_data .= "BEGIN TRANSACTION;\n";
- $this->flush($sql_data);
- }
-
- function write_table($table_name)
- {
- global $db;
- $sql_data = '-- Table: ' . $table_name . "\n";
- $sql_data .= "DROP TABLE $table_name;\n";
-
- $sql = "SELECT sql
- FROM sqlite_master
- WHERE type = 'table'
- AND name = '" . $db->sql_escape($table_name) . "'
- ORDER BY name ASC;";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- // Create Table
- $sql_data .= $row['sql'] . ";\n";
-
- $result = $db->sql_query("PRAGMA index_list('" . $db->sql_escape($table_name) . "');");
-
- while ($row = $db->sql_fetchrow($result))
- {
- if (strpos($row['name'], 'autoindex') !== false)
- {
- continue;
- }
-
- $result2 = $db->sql_query("PRAGMA index_info('" . $db->sql_escape($row['name']) . "');");
-
- $fields = array();
- while ($row2 = $db->sql_fetchrow($result2))
- {
- $fields[] = $row2['name'];
- }
- $db->sql_freeresult($result2);
-
- $sql_data .= 'CREATE ' . ($row['unique'] ? 'UNIQUE ' : '') . 'INDEX ' . $row['name'] . ' ON ' . $table_name . ' (' . implode(', ', $fields) . ");\n";
- }
- $db->sql_freeresult($result);
-
- $this->flush($sql_data . "\n");
- }
-
- function write_data($table_name)
- {
- global $db;
-
- $result = $db->sql_query("PRAGMA table_info('" . $db->sql_escape($table_name) . "');");
-
- $col_types = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $col_types[$row['name']] = $row['type'];
- }
- $db->sql_freeresult($result);
-
- $sql_insert = 'INSERT INTO ' . $table_name . ' (' . implode(', ', array_keys($col_types)) . ') VALUES (';
-
- $sql = "SELECT *
- FROM $table_name";
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- foreach ($row as $column_name => $column_data)
- {
- if (is_null($column_data))
- {
- $row[$column_name] = 'NULL';
- }
- else if ($column_data === '')
- {
- $row[$column_name] = "''";
- }
- else if (stripos($col_types[$column_name], 'text') !== false || stripos($col_types[$column_name], 'char') !== false || stripos($col_types[$column_name], 'blob') !== false)
- {
- $row[$column_name] = sanitize_data_generic(str_replace("'", "''", $column_data));
- }
- }
- $this->flush($sql_insert . implode(', ', $row) . ");\n");
- }
- }
-
- function write_end()
- {
- $this->flush("COMMIT;\n");
- parent::write_end();
- }
-}
-
-class postgres_extractor extends base_extractor
-{
- function write_start($prefix)
- {
- $sql_data = "--\n";
- $sql_data .= "-- phpBB Backup Script\n";
- $sql_data .= "-- Dump of tables for $prefix\n";
- $sql_data .= "-- DATE : " . gmdate("d-m-Y H:i:s", $this->time) . " GMT\n";
- $sql_data .= "--\n";
- $sql_data .= "BEGIN TRANSACTION;\n";
- $this->flush($sql_data);
- }
-
- function write_table($table_name)
- {
- global $db;
- static $domains_created = array();
-
- $sql = "SELECT a.domain_name, a.data_type, a.character_maximum_length, a.domain_default
- FROM INFORMATION_SCHEMA.domains a, INFORMATION_SCHEMA.column_domain_usage b
- WHERE a.domain_name = b.domain_name
- AND b.table_name = '{$table_name}'";
- $result = $db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
- {
- if (empty($domains_created[$row['domain_name']]))
- {
- $domains_created[$row['domain_name']] = true;
- //$sql_data = "DROP DOMAIN {$row['domain_name']};\n";
- $sql_data = "CREATE DOMAIN {$row['domain_name']} as {$row['data_type']}";
- if (!empty($row['character_maximum_length']))
- {
- $sql_data .= '(' . $row['character_maximum_length'] . ')';
- }
- $sql_data .= ' NOT NULL';
- if (!empty($row['domain_default']))
- {
- $sql_data .= ' DEFAULT ' . $row['domain_default'];
- }
- $this->flush($sql_data . ";\n");
- }
- }
- $db->sql_freeresult($result);
-
- $sql_data = '-- Table: ' . $table_name . "\n";
- $sql_data .= "DROP TABLE $table_name;\n";
- // PGSQL does not "tightly" bind sequences and tables, we must guess...
- $sql = "SELECT relname
- FROM pg_class
- WHERE relkind = 'S'
- AND relname = '{$table_name}_seq'";
- $result = $db->sql_query($sql);
- // We don't even care about storing the results. We already know the answer if we get rows back.
- if ($db->sql_fetchrow($result))
- {
- $sql_data .= "DROP SEQUENCE {$table_name}_seq;\n";
- $sql_data .= "CREATE SEQUENCE {$table_name}_seq;\n";
- }
- $db->sql_freeresult($result);
-
- $field_query = "SELECT a.attnum, a.attname as field, t.typname as type, a.attlen as length, a.atttypmod as lengthvar, a.attnotnull as notnull
- FROM pg_class c, pg_attribute a, pg_type t
- WHERE c.relname = '" . $db->sql_escape($table_name) . "'
- AND a.attnum > 0
- AND a.attrelid = c.oid
- AND a.atttypid = t.oid
- ORDER BY a.attnum";
- $result = $db->sql_query($field_query);
-
- $sql_data .= "CREATE TABLE $table_name(\n";
- $lines = array();
- while ($row = $db->sql_fetchrow($result))
- {
- // Get the data from the table
- $sql_get_default = "SELECT pg_get_expr(d.adbin, d.adrelid) as rowdefault
- FROM pg_attrdef d, pg_class c
- WHERE (c.relname = '" . $db->sql_escape($table_name) . "')
- AND (c.oid = d.adrelid)
- AND d.adnum = " . $row['attnum'];
- $def_res = $db->sql_query($sql_get_default);
- $def_row = $db->sql_fetchrow($def_res);
- $db->sql_freeresult($def_res);
-
- if (empty($def_row))
- {
- unset($row['rowdefault']);
- }
- else
- {
- $row['rowdefault'] = $def_row['rowdefault'];
- }
-
- if ($row['type'] == 'bpchar')
- {
- // Internally stored as bpchar, but isn't accepted in a CREATE TABLE statement.
- $row['type'] = 'char';
- }
-
- $line = ' ' . $row['field'] . ' ' . $row['type'];
-
- if (strpos($row['type'], 'char') !== false)
- {
- if ($row['lengthvar'] > 0)
- {
- $line .= '(' . ($row['lengthvar'] - 4) . ')';
- }
- }
-
- if (strpos($row['type'], 'numeric') !== false)
- {
- $line .= '(';
- $line .= sprintf("%s,%s", (($row['lengthvar'] >> 16) & 0xffff), (($row['lengthvar'] - 4) & 0xffff));
- $line .= ')';
- }
-
- if (isset($row['rowdefault']))
- {
- $line .= ' DEFAULT ' . $row['rowdefault'];
- }
-
- if ($row['notnull'] == 't')
- {
- $line .= ' NOT NULL';
- }
-
- $lines[] = $line;
- }
- $db->sql_freeresult($result);
-
- // Get the listing of primary keys.
- $sql_pri_keys = "SELECT ic.relname as index_name, bc.relname as tab_name, ta.attname as column_name, i.indisunique as unique_key, i.indisprimary as primary_key
- FROM pg_class bc, pg_class ic, pg_index i, pg_attribute ta, pg_attribute ia
- WHERE (bc.oid = i.indrelid)
- AND (ic.oid = i.indexrelid)
- AND (ia.attrelid = i.indexrelid)
- AND (ta.attrelid = bc.oid)
- AND (bc.relname = '" . $db->sql_escape($table_name) . "')
- AND (ta.attrelid = i.indrelid)
- AND (ta.attnum = i.indkey[ia.attnum-1])
- ORDER BY index_name, tab_name, column_name";
-
- $result = $db->sql_query($sql_pri_keys);
-
- $index_create = $index_rows = $primary_key = array();
-
- // We do this in two steps. It makes placing the comma easier
- while ($row = $db->sql_fetchrow($result))
- {
- if ($row['primary_key'] == 't')
- {
- $primary_key[] = $row['column_name'];
- $primary_key_name = $row['index_name'];
- }
- else
- {
- // We have to store this all this info because it is possible to have a multi-column key...
- // we can loop through it again and build the statement
- $index_rows[$row['index_name']]['table'] = $table_name;
- $index_rows[$row['index_name']]['unique'] = ($row['unique_key'] == 't') ? true : false;
- $index_rows[$row['index_name']]['column_names'][] = $row['column_name'];
- }
- }
- $db->sql_freeresult($result);
-
- if (!empty($index_rows))
- {
- foreach ($index_rows as $idx_name => $props)
- {
- $index_create[] = 'CREATE ' . ($props['unique'] ? 'UNIQUE ' : '') . "INDEX $idx_name ON $table_name (" . implode(', ', $props['column_names']) . ");";
- }
- }
-
- if (!empty($primary_key))
- {
- $lines[] = " CONSTRAINT $primary_key_name PRIMARY KEY (" . implode(', ', $primary_key) . ")";
- }
-
- // Generate constraint clauses for CHECK constraints
- $sql_checks = "SELECT conname as index_name, consrc
- FROM pg_constraint, pg_class bc
- WHERE conrelid = bc.oid
- AND bc.relname = '" . $db->sql_escape($table_name) . "'
- AND NOT EXISTS (
- SELECT *
- FROM pg_constraint as c, pg_inherits as i
- WHERE i.inhrelid = pg_constraint.conrelid
- AND c.conname = pg_constraint.conname
- AND c.consrc = pg_constraint.consrc
- AND c.conrelid = i.inhparent
- )";
- $result = $db->sql_query($sql_checks);
-
- // Add the constraints to the sql file.
- while ($row = $db->sql_fetchrow($result))
- {
- if (!is_null($row['consrc']))
- {
- $lines[] = ' CONSTRAINT ' . $row['index_name'] . ' CHECK ' . $row['consrc'];
- }
- }
- $db->sql_freeresult($result);
-
- $sql_data .= implode(", \n", $lines);
- $sql_data .= "\n);\n";
-
- if (!empty($index_create))
- {
- $sql_data .= implode("\n", $index_create) . "\n\n";
- }
- $this->flush($sql_data);
- }
-
- function write_data($table_name)
- {
- global $db;
- // Grab all of the data from current table.
- $sql = "SELECT *
- FROM $table_name";
- $result = $db->sql_query($sql);
-
- $i_num_fields = pg_num_fields($result);
- $seq = '';
-
- for ($i = 0; $i < $i_num_fields; $i++)
- {
- $ary_type[] = pg_field_type($result, $i);
- $ary_name[] = pg_field_name($result, $i);
-
- $sql = "SELECT pg_get_expr(d.adbin, d.adrelid) as rowdefault
- FROM pg_attrdef d, pg_class c
- WHERE (c.relname = '{$table_name}')
- AND (c.oid = d.adrelid)
- AND d.adnum = " . strval($i + 1);
- $result2 = $db->sql_query($sql);
- if ($row = $db->sql_fetchrow($result2))
- {
- // Determine if we must reset the sequences
- if (strpos($row['rowdefault'], "nextval('") === 0)
- {
- $seq .= "SELECT SETVAL('{$table_name}_seq',(select case when max({$ary_name[$i]})>0 then max({$ary_name[$i]})+1 else 1 end FROM {$table_name}));\n";
- }
- }
- }
-
- $this->flush("COPY $table_name (" . implode(', ', $ary_name) . ') FROM stdin;' . "\n");
- while ($row = $db->sql_fetchrow($result))
- {
- $schema_vals = array();
-
- // Build the SQL statement to recreate the data.
- for ($i = 0; $i < $i_num_fields; $i++)
- {
- $str_val = $row[$ary_name[$i]];
-
- if (preg_match('#char|text|bool|bytea#i', $ary_type[$i]))
- {
- $str_val = str_replace(array("\n", "\t", "\r", "\b", "\f", "\v"), array('\n', '\t', '\r', '\b', '\f', '\v'), addslashes($str_val));
- $str_empty = '';
- }
- else
- {
- $str_empty = '\N';
- }
-
- if (empty($str_val) && $str_val !== '0')
- {
- $str_val = $str_empty;
- }
-
- $schema_vals[] = $str_val;
- }
-
- // Take the ordered fields and their associated data and build it
- // into a valid sql statement to recreate that field in the data.
- $this->flush(implode("\t", $schema_vals) . "\n");
- }
- $db->sql_freeresult($result);
- $this->flush("\\.\n");
-
- // Write out the sequence statements
- $this->flush($seq);
- }
-
- function write_end()
- {
- $this->flush("COMMIT;\n");
- parent::write_end();
- }
-}
-
-class mssql_extractor extends base_extractor
-{
- function write_end()
- {
- $this->flush("COMMIT\nGO\n");
- parent::write_end();
- }
-
- function write_start($prefix)
- {
- $sql_data = "--\n";
- $sql_data .= "-- phpBB Backup Script\n";
- $sql_data .= "-- Dump of tables for $prefix\n";
- $sql_data .= "-- DATE : " . gmdate("d-m-Y H:i:s", $this->time) . " GMT\n";
- $sql_data .= "--\n";
- $sql_data .= "BEGIN TRANSACTION\n";
- $sql_data .= "GO\n";
- $this->flush($sql_data);
- }
-
- function write_table($table_name)
- {
- global $db;
- $sql_data = '-- Table: ' . $table_name . "\n";
- $sql_data .= "IF OBJECT_ID(N'$table_name', N'U') IS NOT NULL\n";
- $sql_data .= "DROP TABLE $table_name;\n";
- $sql_data .= "GO\n";
- $sql_data .= "\nCREATE TABLE [$table_name] (\n";
- $rows = array();
-
- $text_flag = false;
-
- $sql = "SELECT COLUMN_NAME, COLUMN_DEFAULT, IS_NULLABLE, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, COLUMNPROPERTY(object_id(TABLE_NAME), COLUMN_NAME, 'IsIdentity') as IS_IDENTITY
- FROM INFORMATION_SCHEMA.COLUMNS
- WHERE TABLE_NAME = '$table_name'";
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $line = "\t[{$row['COLUMN_NAME']}] [{$row['DATA_TYPE']}]";
-
- if ($row['DATA_TYPE'] == 'text')
- {
- $text_flag = true;
- }
-
- if ($row['IS_IDENTITY'])
- {
- $line .= ' IDENTITY (1 , 1)';
- }
-
- if ($row['CHARACTER_MAXIMUM_LENGTH'] && $row['DATA_TYPE'] !== 'text')
- {
- $line .= ' (' . $row['CHARACTER_MAXIMUM_LENGTH'] . ')';
- }
-
- if ($row['IS_NULLABLE'] == 'YES')
- {
- $line .= ' NULL';
- }
- else
- {
- $line .= ' NOT NULL';
- }
-
- if ($row['COLUMN_DEFAULT'])
- {
- $line .= ' DEFAULT ' . $row['COLUMN_DEFAULT'];
- }
-
- $rows[] = $line;
- }
- $db->sql_freeresult($result);
-
- $sql_data .= implode(",\n", $rows);
- $sql_data .= "\n) ON [PRIMARY]";
-
- if ($text_flag)
- {
- $sql_data .= " TEXTIMAGE_ON [PRIMARY]";
- }
-
- $sql_data .= "\nGO\n\n";
- $rows = array();
-
- $sql = "SELECT CONSTRAINT_NAME, COLUMN_NAME
- FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
- WHERE TABLE_NAME = '$table_name'";
- $result = $db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
- {
- if (!sizeof($rows))
- {
- $sql_data .= "ALTER TABLE [$table_name] WITH NOCHECK ADD\n";
- $sql_data .= "\tCONSTRAINT [{$row['CONSTRAINT_NAME']}] PRIMARY KEY CLUSTERED \n\t(\n";
- }
- $rows[] = "\t\t[{$row['COLUMN_NAME']}]";
- }
- if (sizeof($rows))
- {
- $sql_data .= implode(",\n", $rows);
- $sql_data .= "\n\t) ON [PRIMARY] \nGO\n";
- }
- $db->sql_freeresult($result);
-
- $index = array();
- $sql = "EXEC sp_statistics '$table_name'";
- $result = $db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
- {
- if ($row['TYPE'] == 3)
- {
- $index[$row['INDEX_NAME']][] = '[' . $row['COLUMN_NAME'] . ']';
- }
- }
- $db->sql_freeresult($result);
-
- foreach ($index as $index_name => $column_name)
- {
- $index[$index_name] = implode(', ', $column_name);
- }
-
- foreach ($index as $index_name => $columns)
- {
- $sql_data .= "\nCREATE INDEX [$index_name] ON [$table_name]($columns) ON [PRIMARY]\nGO\n";
- }
- $this->flush($sql_data);
- }
-
- function write_data($table_name)
- {
- global $db;
-
- if ($db->get_sql_layer() === 'mssql')
- {
- $this->write_data_mssql($table_name);
- }
- else if ($db->get_sql_layer() === 'mssqlnative')
- {
- $this->write_data_mssqlnative($table_name);
- }
- else
- {
- $this->write_data_odbc($table_name);
- }
- }
-
- function write_data_mssql($table_name)
- {
- global $db;
- $ary_type = $ary_name = array();
- $ident_set = false;
- $sql_data = '';
-
- // Grab all of the data from current table.
- $sql = "SELECT *
- FROM $table_name";
- $result = $db->sql_query($sql);
-
- $retrieved_data = mssql_num_rows($result);
-
- $i_num_fields = mssql_num_fields($result);
-
- for ($i = 0; $i < $i_num_fields; $i++)
- {
- $ary_type[$i] = mssql_field_type($result, $i);
- $ary_name[$i] = mssql_field_name($result, $i);
- }
-
- if ($retrieved_data)
- {
- $sql = "SELECT 1 as has_identity
- FROM INFORMATION_SCHEMA.COLUMNS
- WHERE COLUMNPROPERTY(object_id('$table_name'), COLUMN_NAME, 'IsIdentity') = 1";
- $result2 = $db->sql_query($sql);
- $row2 = $db->sql_fetchrow($result2);
- if (!empty($row2['has_identity']))
- {
- $sql_data .= "\nSET IDENTITY_INSERT $table_name ON\nGO\n";
- $ident_set = true;
- }
- $db->sql_freeresult($result2);
- }
-
- while ($row = $db->sql_fetchrow($result))
- {
- $schema_vals = $schema_fields = array();
-
- // Build the SQL statement to recreate the data.
- for ($i = 0; $i < $i_num_fields; $i++)
- {
- $str_val = $row[$ary_name[$i]];
-
- if (preg_match('#char|text|bool|varbinary#i', $ary_type[$i]))
- {
- $str_quote = '';
- $str_empty = "''";
- $str_val = sanitize_data_mssql(str_replace("'", "''", $str_val));
- }
- else if (preg_match('#date|timestamp#i', $ary_type[$i]))
- {
- if (empty($str_val))
- {
- $str_quote = '';
- }
- else
- {
- $str_quote = "'";
- }
- }
- else
- {
- $str_quote = '';
- $str_empty = 'NULL';
- }
-
- if (empty($str_val) && $str_val !== '0' && !(is_int($str_val) || is_float($str_val)))
- {
- $str_val = $str_empty;
- }
-
- $schema_vals[$i] = $str_quote . $str_val . $str_quote;
- $schema_fields[$i] = $ary_name[$i];
- }
-
- // Take the ordered fields and their associated data and build it
- // into a valid sql statement to recreate that field in the data.
- $sql_data .= "INSERT INTO $table_name (" . implode(', ', $schema_fields) . ') VALUES (' . implode(', ', $schema_vals) . ");\nGO\n";
-
- $this->flush($sql_data);
- $sql_data = '';
- }
- $db->sql_freeresult($result);
-
- if ($retrieved_data && $ident_set)
- {
- $sql_data .= "\nSET IDENTITY_INSERT $table_name OFF\nGO\n";
- }
- $this->flush($sql_data);
- }
-
- function write_data_mssqlnative($table_name)
- {
- global $db;
- $ary_type = $ary_name = array();
- $ident_set = false;
- $sql_data = '';
-
- // Grab all of the data from current table.
- $sql = "SELECT * FROM $table_name";
- $db->mssqlnative_set_query_options(array('Scrollable' => SQLSRV_CURSOR_STATIC));
- $result = $db->sql_query($sql);
-
- $retrieved_data = $db->mssqlnative_num_rows($result);
-
- if (!$retrieved_data)
- {
- $db->sql_freeresult($result);
- return;
- }
-
- $sql = "SELECT COLUMN_NAME, DATA_TYPE
- FROM INFORMATION_SCHEMA.COLUMNS
- WHERE INFORMATION_SCHEMA.COLUMNS.TABLE_NAME = '" . $db->sql_escape($table_name) . "'";
- $result_fields = $db->sql_query($sql);
-
- $i_num_fields = 0;
- while ($row = $db->sql_fetchrow($result_fields))
- {
- $ary_type[$i_num_fields] = $row['DATA_TYPE'];
- $ary_name[$i_num_fields] = $row['COLUMN_NAME'];
- $i_num_fields++;
- }
- $db->sql_freeresult($result_fields);
-
- $sql = "SELECT 1 as has_identity
- FROM INFORMATION_SCHEMA.COLUMNS
- WHERE COLUMNPROPERTY(object_id('$table_name'), COLUMN_NAME, 'IsIdentity') = 1";
- $result2 = $db->sql_query($sql);
- $row2 = $db->sql_fetchrow($result2);
-
- if (!empty($row2['has_identity']))
- {
- $sql_data .= "\nSET IDENTITY_INSERT $table_name ON\nGO\n";
- $ident_set = true;
- }
- $db->sql_freeresult($result2);
-
- while ($row = $db->sql_fetchrow($result))
- {
- $schema_vals = $schema_fields = array();
-
- // Build the SQL statement to recreate the data.
- for ($i = 0; $i < $i_num_fields; $i++)
- {
- $str_val = $row[$ary_name[$i]];
-
- // defaults to type number - better quote just to be safe, so check for is_int too
- if (is_int($ary_type[$i]) || preg_match('#char|text|bool|varbinary#i', $ary_type[$i]))
- {
- $str_quote = '';
- $str_empty = "''";
- $str_val = sanitize_data_mssql(str_replace("'", "''", $str_val));
- }
- else if (preg_match('#date|timestamp#i', $ary_type[$i]))
- {
- if (empty($str_val))
- {
- $str_quote = '';
- }
- else
- {
- $str_quote = "'";
- }
- }
- else
- {
- $str_quote = '';
- $str_empty = 'NULL';
- }
-
- if (empty($str_val) && $str_val !== '0' && !(is_int($str_val) || is_float($str_val)))
- {
- $str_val = $str_empty;
- }
-
- $schema_vals[$i] = $str_quote . $str_val . $str_quote;
- $schema_fields[$i] = $ary_name[$i];
- }
-
- // Take the ordered fields and their associated data and build it
- // into a valid sql statement to recreate that field in the data.
- $sql_data .= "INSERT INTO $table_name (" . implode(', ', $schema_fields) . ') VALUES (' . implode(', ', $schema_vals) . ");\nGO\n";
-
- $this->flush($sql_data);
- $sql_data = '';
- }
- $db->sql_freeresult($result);
-
- if ($ident_set)
- {
- $sql_data .= "\nSET IDENTITY_INSERT $table_name OFF\nGO\n";
- }
- $this->flush($sql_data);
- }
-
- function write_data_odbc($table_name)
- {
- global $db;
- $ary_type = $ary_name = array();
- $ident_set = false;
- $sql_data = '';
-
- // Grab all of the data from current table.
- $sql = "SELECT *
- FROM $table_name";
- $result = $db->sql_query($sql);
-
- $retrieved_data = odbc_num_rows($result);
-
- if ($retrieved_data)
- {
- $sql = "SELECT 1 as has_identity
- FROM INFORMATION_SCHEMA.COLUMNS
- WHERE COLUMNPROPERTY(object_id('$table_name'), COLUMN_NAME, 'IsIdentity') = 1";
- $result2 = $db->sql_query($sql);
- $row2 = $db->sql_fetchrow($result2);
- if (!empty($row2['has_identity']))
- {
- $sql_data .= "\nSET IDENTITY_INSERT $table_name ON\nGO\n";
- $ident_set = true;
- }
- $db->sql_freeresult($result2);
- }
-
- $i_num_fields = odbc_num_fields($result);
-
- for ($i = 0; $i < $i_num_fields; $i++)
- {
- $ary_type[$i] = odbc_field_type($result, $i + 1);
- $ary_name[$i] = odbc_field_name($result, $i + 1);
- }
-
- while ($row = $db->sql_fetchrow($result))
- {
- $schema_vals = $schema_fields = array();
-
- // Build the SQL statement to recreate the data.
- for ($i = 0; $i < $i_num_fields; $i++)
- {
- $str_val = $row[$ary_name[$i]];
-
- if (preg_match('#char|text|bool|varbinary#i', $ary_type[$i]))
- {
- $str_quote = '';
- $str_empty = "''";
- $str_val = sanitize_data_mssql(str_replace("'", "''", $str_val));
- }
- else if (preg_match('#date|timestamp#i', $ary_type[$i]))
- {
- if (empty($str_val))
- {
- $str_quote = '';
- }
- else
- {
- $str_quote = "'";
- }
- }
- else
- {
- $str_quote = '';
- $str_empty = 'NULL';
- }
-
- if (empty($str_val) && $str_val !== '0' && !(is_int($str_val) || is_float($str_val)))
- {
- $str_val = $str_empty;
- }
-
- $schema_vals[$i] = $str_quote . $str_val . $str_quote;
- $schema_fields[$i] = $ary_name[$i];
- }
-
- // Take the ordered fields and their associated data and build it
- // into a valid sql statement to recreate that field in the data.
- $sql_data .= "INSERT INTO $table_name (" . implode(', ', $schema_fields) . ') VALUES (' . implode(', ', $schema_vals) . ");\nGO\n";
-
- $this->flush($sql_data);
-
- $sql_data = '';
-
- }
- $db->sql_freeresult($result);
-
- if ($retrieved_data && $ident_set)
- {
- $sql_data .= "\nSET IDENTITY_INSERT $table_name OFF\nGO\n";
- }
- $this->flush($sql_data);
- }
-
-}
-
-class oracle_extractor extends base_extractor
-{
- function write_table($table_name)
- {
- global $db;
- $sql_data = '-- Table: ' . $table_name . "\n";
- $sql_data .= "DROP TABLE $table_name\n/\n";
- $sql_data .= "\nCREATE TABLE $table_name (\n";
-
- $sql = "SELECT COLUMN_NAME, DATA_TYPE, DATA_PRECISION, DATA_LENGTH, NULLABLE, DATA_DEFAULT
- FROM ALL_TAB_COLS
- WHERE table_name = '{$table_name}'";
- $result = $db->sql_query($sql);
-
- $rows = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $line = ' "' . $row['column_name'] . '" ' . $row['data_type'];
-
- if ($row['data_type'] !== 'CLOB')
- {
- if ($row['data_type'] !== 'VARCHAR2' && $row['data_type'] !== 'CHAR')
- {
- $line .= '(' . $row['data_precision'] . ')';
- }
- else
- {
- $line .= '(' . $row['data_length'] . ')';
- }
- }
-
- if (!empty($row['data_default']))
- {
- $line .= ' DEFAULT ' . $row['data_default'];
- }
-
- if ($row['nullable'] == 'N')
- {
- $line .= ' NOT NULL';
- }
- $rows[] = $line;
- }
- $db->sql_freeresult($result);
-
- $sql = "SELECT A.CONSTRAINT_NAME, A.COLUMN_NAME
- FROM USER_CONS_COLUMNS A, USER_CONSTRAINTS B
- WHERE A.CONSTRAINT_NAME = B.CONSTRAINT_NAME
- AND B.CONSTRAINT_TYPE = 'P'
- AND A.TABLE_NAME = '{$table_name}'";
- $result = $db->sql_query($sql);
-
- $primary_key = array();
- $contraint_name = '';
- while ($row = $db->sql_fetchrow($result))
- {
- $constraint_name = '"' . $row['constraint_name'] . '"';
- $primary_key[] = '"' . $row['column_name'] . '"';
- }
- $db->sql_freeresult($result);
-
- if (sizeof($primary_key))
- {
- $rows[] = " CONSTRAINT {$constraint_name} PRIMARY KEY (" . implode(', ', $primary_key) . ')';
- }
-
- $sql = "SELECT A.CONSTRAINT_NAME, A.COLUMN_NAME
- FROM USER_CONS_COLUMNS A, USER_CONSTRAINTS B
- WHERE A.CONSTRAINT_NAME = B.CONSTRAINT_NAME
- AND B.CONSTRAINT_TYPE = 'U'
- AND A.TABLE_NAME = '{$table_name}'";
- $result = $db->sql_query($sql);
-
- $unique = array();
- $contraint_name = '';
- while ($row = $db->sql_fetchrow($result))
- {
- $constraint_name = '"' . $row['constraint_name'] . '"';
- $unique[] = '"' . $row['column_name'] . '"';
- }
- $db->sql_freeresult($result);
-
- if (sizeof($unique))
- {
- $rows[] = " CONSTRAINT {$constraint_name} UNIQUE (" . implode(', ', $unique) . ')';
- }
-
- $sql_data .= implode(",\n", $rows);
- $sql_data .= "\n)\n/\n";
-
- $sql = "SELECT A.REFERENCED_NAME, C.*
- FROM USER_DEPENDENCIES A, USER_TRIGGERS B, USER_SEQUENCES C
- WHERE A.REFERENCED_TYPE = 'SEQUENCE'
- AND A.NAME = B.TRIGGER_NAME
- AND B.TABLE_NAME = '{$table_name}'
- AND C.SEQUENCE_NAME = A.REFERENCED_NAME";
- $result = $db->sql_query($sql);
-
- $type = request_var('type', '');
-
- while ($row = $db->sql_fetchrow($result))
- {
- $sql_data .= "\nDROP SEQUENCE \"{$row['referenced_name']}\"\n/\n";
- $sql_data .= "\nCREATE SEQUENCE \"{$row['referenced_name']}\"";
-
- if ($type == 'full')
- {
- $sql_data .= ' START WITH ' . $row['last_number'];
- }
-
- $sql_data .= "\n/\n";
- }
- $db->sql_freeresult($result);
-
- $sql = "SELECT DESCRIPTION, WHEN_CLAUSE, TRIGGER_BODY
- FROM USER_TRIGGERS
- WHERE TABLE_NAME = '{$table_name}'";
- $result = $db->sql_query($sql);
- while ($row = $db->sql_fetchrow($result))
- {
- $sql_data .= "\nCREATE OR REPLACE TRIGGER {$row['description']}WHEN ({$row['when_clause']})\n{$row['trigger_body']}\n/\n";
- }
- $db->sql_freeresult($result);
-
- $sql = "SELECT A.INDEX_NAME, B.COLUMN_NAME
- FROM USER_INDEXES A, USER_IND_COLUMNS B
- WHERE A.UNIQUENESS = 'NONUNIQUE'
- AND A.INDEX_NAME = B.INDEX_NAME
- AND B.TABLE_NAME = '{$table_name}'";
- $result = $db->sql_query($sql);
-
- $index = array();
-
- while ($row = $db->sql_fetchrow($result))
- {
- $index[$row['index_name']][] = $row['column_name'];
- }
-
- foreach ($index as $index_name => $column_names)
- {
- $sql_data .= "\nCREATE INDEX $index_name ON $table_name(" . implode(', ', $column_names) . ")\n/\n";
- }
- $db->sql_freeresult($result);
- $this->flush($sql_data);
- }
-
- function write_data($table_name)
- {
- global $db;
- $ary_type = $ary_name = array();
-
- // Grab all of the data from current table.
- $sql = "SELECT *
- FROM $table_name";
- $result = $db->sql_query($sql);
-
- $i_num_fields = ocinumcols($result);
-
- for ($i = 0; $i < $i_num_fields; $i++)
- {
- $ary_type[$i] = ocicolumntype($result, $i + 1);
- $ary_name[$i] = ocicolumnname($result, $i + 1);
- }
-
- $sql_data = '';
-
- while ($row = $db->sql_fetchrow($result))
- {
- $schema_vals = $schema_fields = array();
-
- // Build the SQL statement to recreate the data.
- for ($i = 0; $i < $i_num_fields; $i++)
- {
- // Oracle uses uppercase - we use lowercase
- $str_val = $row[strtolower($ary_name[$i])];
-
- if (preg_match('#char|text|bool|raw|clob#i', $ary_type[$i]))
- {
- $str_quote = '';
- $str_empty = "''";
- $str_val = sanitize_data_oracle($str_val);
- }
- else if (preg_match('#date|timestamp#i', $ary_type[$i]))
- {
- if (empty($str_val))
- {
- $str_quote = '';
- }
- else
- {
- $str_quote = "'";
- }
- }
- else
- {
- $str_quote = '';
- $str_empty = 'NULL';
- }
-
- if (empty($str_val) && $str_val !== '0')
- {
- $str_val = $str_empty;
- }
-
- $schema_vals[$i] = $str_quote . $str_val . $str_quote;
- $schema_fields[$i] = '"' . $ary_name[$i] . '"';
- }
-
- // Take the ordered fields and their associated data and build it
- // into a valid sql statement to recreate that field in the data.
- $sql_data = "INSERT INTO $table_name (" . implode(', ', $schema_fields) . ') VALUES (' . implode(', ', $schema_vals) . ")\n/\n";
-
- $this->flush($sql_data);
- }
- $db->sql_freeresult($result);
- }
-
- function write_start($prefix)
- {
- $sql_data = "--\n";
- $sql_data .= "-- phpBB Backup Script\n";
- $sql_data .= "-- Dump of tables for $prefix\n";
- $sql_data .= "-- DATE : " . gmdate("d-m-Y H:i:s", $this->time) . " GMT\n";
- $sql_data .= "--\n";
- $this->flush($sql_data);
- }
-}
-
// get how much space we allow for a chunk of data, very similar to phpMyAdmin's way of doing things ;-) (hey, we only do this for MySQL anyway :P)
function get_usable_memory()
{
diff --git a/phpBB/includes/acp/acp_disallow.php b/phpBB/includes/acp/acp_disallow.php
index 4c8f3cc65b..2c27616748 100644
--- a/phpBB/includes/acp/acp_disallow.php
+++ b/phpBB/includes/acp/acp_disallow.php
@@ -25,7 +25,7 @@ class acp_disallow
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
+ global $db, $user, $auth, $template, $cache, $phpbb_log, $request;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
@@ -49,7 +49,7 @@ class acp_disallow
if ($disallow)
{
- $disallowed_user = str_replace('*', '%', utf8_normalize_nfc(request_var('disallowed_user', '', true)));
+ $disallowed_user = str_replace('*', '%', $request->variable('disallowed_user', '', true));
if (!$disallowed_user)
{
@@ -74,13 +74,13 @@ class acp_disallow
$cache->destroy('_disallowed_usernames');
$message = $user->lang['DISALLOW_SUCCESSFUL'];
- add_log('admin', 'LOG_DISALLOW_ADD', str_replace('%', '*', $disallowed_user));
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_DISALLOW_ADD', false, array(str_replace('%', '*', $disallowed_user)));
trigger_error($message . adm_back_link($this->u_action));
}
else if ($allow)
{
- $disallowed_id = request_var('disallowed_id', 0);
+ $disallowed_id = $request->variable('disallowed_id', 0);
if (!$disallowed_id)
{
@@ -93,7 +93,7 @@ class acp_disallow
$cache->destroy('_disallowed_usernames');
- add_log('admin', 'LOG_DISALLOW_DELETE');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_DISALLOW_DELETE');
trigger_error($user->lang['DISALLOWED_DELETED'] . adm_back_link($this->u_action));
}
diff --git a/phpBB/includes/acp/acp_email.php b/phpBB/includes/acp/acp_email.php
index fda9d50779..ebc4a86de3 100644
--- a/phpBB/includes/acp/acp_email.php
+++ b/phpBB/includes/acp/acp_email.php
@@ -25,7 +25,7 @@ class acp_email
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $cache;
+ global $config, $db, $user, $auth, $template, $cache, $phpbb_log, $request;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $phpbb_dispatcher;
$user->add_lang('acp/email');
@@ -39,11 +39,11 @@ class acp_email
$submit = (isset($_POST['submit'])) ? true : false;
$error = array();
- $usernames = request_var('usernames', '', true);
+ $usernames = $request->variable('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));
+ $group_id = $request->variable('g', 0);
+ $subject = $request->variable('subject', '', true);
+ $message = $request->variable('message', '', true);
// Do the job ...
if ($submit)
@@ -51,7 +51,7 @@ class acp_email
// Error checking needs to go here ... if no subject and/or no message then skip
// over the send and return to the form
$use_queue = (isset($_POST['send_immediately'])) ? false : true;
- $priority = request_var('mail_priority_flag', MAIL_NORMAL_PRIORITY);
+ $priority = $request->variable('mail_priority_flag', MAIL_NORMAL_PRIORITY);
if (!check_form_key($form_key))
{
@@ -263,7 +263,7 @@ class acp_email
{
if (!empty($usernames))
{
- add_log('admin', 'LOG_MASS_EMAIL', implode(', ', utf8_normalize_nfc($usernames)));
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_MASS_EMAIL', false, array(implode(', ', utf8_normalize_nfc($usernames))));
}
else
{
@@ -277,7 +277,7 @@ class acp_email
$group_name = $user->lang['ALL_USERS'];
}
- add_log('admin', 'LOG_MASS_EMAIL', $group_name);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_MASS_EMAIL', false, array($group_name));
}
}
diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php
index 193483050c..0373a3b115 100644
--- a/phpBB/includes/acp/acp_extensions.php
+++ b/phpBB/includes/acp/acp_extensions.php
@@ -70,7 +70,7 @@ class acp_extensions
// If they've specified an extension, let's load the metadata manager and validate it.
if ($ext_name)
{
- $md_manager = new \phpbb\extension\metadata_manager($ext_name, $config, $phpbb_extension_manager, $template, $user, $phpbb_root_path);
+ $md_manager = new \phpbb\extension\metadata_manager($ext_name, $config, $phpbb_extension_manager, $template, $phpbb_root_path);
try
{
@@ -78,7 +78,8 @@ class acp_extensions
}
catch (\phpbb\extension\exception $e)
{
- trigger_error($e, E_USER_WARNING);
+ $message = call_user_func_array(array($this->user, 'lang'), array_merge(array($e->getMessage()), $e->get_parameters()));
+ trigger_error($message, E_USER_WARNING);
}
}
@@ -354,8 +355,9 @@ class acp_extensions
}
catch (\phpbb\extension\exception $e)
{
+ $message = call_user_func_array(array($this->user, 'lang'), array_merge(array($e->getMessage()), $e->get_parameters()));
$this->template->assign_block_vars('disabled', array(
- 'META_DISPLAY_NAME' => $this->user->lang('EXTENSION_INVALID_LIST', $name, $e),
+ 'META_DISPLAY_NAME' => $this->user->lang('EXTENSION_INVALID_LIST', $name, $message),
'S_VERSIONCHECK' => false,
));
}
@@ -410,8 +412,9 @@ class acp_extensions
}
catch (\phpbb\extension\exception $e)
{
+ $message = call_user_func_array(array($this->user, 'lang'), array_merge(array($e->getMessage()), $e->get_parameters()));
$this->template->assign_block_vars('disabled', array(
- 'META_DISPLAY_NAME' => $this->user->lang('EXTENSION_INVALID_LIST', $name, $e),
+ 'META_DISPLAY_NAME' => $this->user->lang('EXTENSION_INVALID_LIST', $name, $message),
'S_VERSIONCHECK' => false,
));
}
@@ -469,8 +472,9 @@ class acp_extensions
}
catch (\phpbb\extension\exception $e)
{
+ $message = call_user_func_array(array($this->user, 'lang'), array_merge(array($e->getMessage()), $e->get_parameters()));
$this->template->assign_block_vars('disabled', array(
- 'META_DISPLAY_NAME' => $this->user->lang('EXTENSION_INVALID_LIST', $name, $e),
+ 'META_DISPLAY_NAME' => $this->user->lang('EXTENSION_INVALID_LIST', $name, $message),
'S_VERSIONCHECK' => false,
));
}
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index 7e664c6263..f252f2a594 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -27,7 +27,7 @@ class acp_forums
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache, $request, $phpbb_dispatcher;
- global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
+ global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx, $phpbb_log;
$user->add_lang('acp/forums');
$this->tpl_name = 'acp_forums';
@@ -36,11 +36,11 @@ class acp_forums
$form_key = 'acp_forums';
add_form_key($form_key);
- $action = request_var('action', '');
+ $action = $request->variable('action', '');
$update = (isset($_POST['update'])) ? true : false;
- $forum_id = request_var('f', 0);
+ $forum_id = $request->variable('f', 0);
- $this->parent_id = request_var('parent_id', 0);
+ $this->parent_id = $request->variable('parent_id', 0);
$forum_data = $errors = array();
if ($update && !check_form_key($form_key))
{
@@ -52,8 +52,8 @@ class acp_forums
switch ($action)
{
case 'progress_bar':
- $start = request_var('start', 0);
- $total = request_var('total', 0);
+ $start = $request->variable('start', 0);
+ $total = $request->variable('total', 0);
$this->display_progress_bar($start, $total);
break;
@@ -83,10 +83,10 @@ class acp_forums
switch ($action)
{
case 'delete':
- $action_subforums = request_var('action_subforums', '');
- $subforums_to_id = request_var('subforums_to_id', 0);
- $action_posts = request_var('action_posts', '');
- $posts_to_id = request_var('posts_to_id', 0);
+ $action_subforums = $request->variable('action_subforums', '');
+ $subforums_to_id = $request->variable('subforums_to_id', 0);
+ $action_posts = $request->variable('action_posts', '');
+ $posts_to_id = $request->variable('posts_to_id', 0);
$errors = $this->delete_forum($forum_id, $action_posts, $action_subforums, $posts_to_id, $subforums_to_id);
@@ -112,45 +112,45 @@ class acp_forums
case 'add':
$forum_data += array(
- 'parent_id' => request_var('forum_parent_id', $this->parent_id),
- 'forum_type' => request_var('forum_type', FORUM_POST),
- 'type_action' => request_var('type_action', ''),
- 'forum_status' => request_var('forum_status', ITEM_UNLOCKED),
+ 'parent_id' => $request->variable('forum_parent_id', $this->parent_id),
+ 'forum_type' => $request->variable('forum_type', FORUM_POST),
+ 'type_action' => $request->variable('type_action', ''),
+ 'forum_status' => $request->variable('forum_status', ITEM_UNLOCKED),
'forum_parents' => '',
- 'forum_name' => utf8_normalize_nfc(request_var('forum_name', '', true)),
- 'forum_link' => request_var('forum_link', ''),
- 'forum_link_track' => request_var('forum_link_track', false),
- 'forum_desc' => utf8_normalize_nfc(request_var('forum_desc', '', true)),
+ 'forum_name' => $request->variable('forum_name', '', true),
+ 'forum_link' => $request->variable('forum_link', ''),
+ 'forum_link_track' => $request->variable('forum_link_track', false),
+ 'forum_desc' => $request->variable('forum_desc', '', true),
'forum_desc_uid' => '',
'forum_desc_options' => 7,
'forum_desc_bitfield' => '',
- 'forum_rules' => utf8_normalize_nfc(request_var('forum_rules', '', true)),
+ 'forum_rules' => $request->variable('forum_rules', '', true),
'forum_rules_uid' => '',
'forum_rules_options' => 7,
'forum_rules_bitfield' => '',
- 'forum_rules_link' => request_var('forum_rules_link', ''),
- 'forum_image' => request_var('forum_image', ''),
- 'forum_style' => request_var('forum_style', 0),
- 'display_subforum_list' => request_var('display_subforum_list', false),
- 'display_on_index' => request_var('display_on_index', false),
- 'forum_topics_per_page' => request_var('topics_per_page', 0),
- 'enable_indexing' => request_var('enable_indexing', true),
- 'enable_icons' => request_var('enable_icons', false),
- 'enable_prune' => request_var('enable_prune', false),
- 'enable_post_review' => request_var('enable_post_review', true),
- 'enable_quick_reply' => request_var('enable_quick_reply', false),
- 'enable_shadow_prune' => request_var('enable_shadow_prune', false),
- 'prune_days' => request_var('prune_days', 7),
- 'prune_viewed' => request_var('prune_viewed', 7),
- 'prune_freq' => request_var('prune_freq', 1),
- 'prune_old_polls' => request_var('prune_old_polls', false),
- 'prune_announce' => request_var('prune_announce', false),
- 'prune_sticky' => request_var('prune_sticky', false),
- 'prune_shadow_days' => request_var('prune_shadow_days', 7),
- 'prune_shadow_freq' => request_var('prune_shadow_freq', 1),
- 'forum_password' => request_var('forum_password', '', true),
- 'forum_password_confirm'=> request_var('forum_password_confirm', '', true),
- 'forum_password_unset' => request_var('forum_password_unset', false),
+ 'forum_rules_link' => $request->variable('forum_rules_link', ''),
+ 'forum_image' => $request->variable('forum_image', ''),
+ 'forum_style' => $request->variable('forum_style', 0),
+ 'display_subforum_list' => $request->variable('display_subforum_list', false),
+ 'display_on_index' => $request->variable('display_on_index', false),
+ 'forum_topics_per_page' => $request->variable('topics_per_page', 0),
+ 'enable_indexing' => $request->variable('enable_indexing', true),
+ 'enable_icons' => $request->variable('enable_icons', false),
+ 'enable_prune' => $request->variable('enable_prune', false),
+ 'enable_post_review' => $request->variable('enable_post_review', true),
+ 'enable_quick_reply' => $request->variable('enable_quick_reply', false),
+ 'enable_shadow_prune' => $request->variable('enable_shadow_prune', false),
+ 'prune_days' => $request->variable('prune_days', 7),
+ 'prune_viewed' => $request->variable('prune_viewed', 7),
+ 'prune_freq' => $request->variable('prune_freq', 1),
+ 'prune_old_polls' => $request->variable('prune_old_polls', false),
+ 'prune_announce' => $request->variable('prune_announce', false),
+ 'prune_sticky' => $request->variable('prune_sticky', false),
+ 'prune_shadow_days' => $request->variable('prune_shadow_days', 7),
+ 'prune_shadow_freq' => $request->variable('prune_shadow_freq', 1),
+ 'forum_password' => $request->variable('forum_password', '', true),
+ 'forum_password_confirm'=> $request->variable('forum_password_confirm', '', true),
+ 'forum_password_unset' => $request->variable('forum_password_unset', false),
);
/**
@@ -173,7 +173,7 @@ class acp_forums
// Use link_display_on_index setting if forum type is link
if ($forum_data['forum_type'] == FORUM_LINK)
{
- $forum_data['display_on_index'] = request_var('link_display_on_index', false);
+ $forum_data['display_on_index'] = $request->variable('link_display_on_index', false);
}
// Linked forums and categories are not able to be locked...
@@ -182,25 +182,25 @@ class acp_forums
$forum_data['forum_status'] = ITEM_UNLOCKED;
}
- $forum_data['show_active'] = ($forum_data['forum_type'] == FORUM_POST) ? request_var('display_recent', true) : request_var('display_active', false);
+ $forum_data['show_active'] = ($forum_data['forum_type'] == FORUM_POST) ? $request->variable('display_recent', true) : $request->variable('display_active', false);
// Get data for forum rules if specified...
if ($forum_data['forum_rules'])
{
- generate_text_for_storage($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], $forum_data['forum_rules_options'], request_var('rules_parse_bbcode', false), request_var('rules_parse_urls', false), request_var('rules_parse_smilies', false));
+ generate_text_for_storage($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], $forum_data['forum_rules_options'], $request->variable('rules_parse_bbcode', false), $request->variable('rules_parse_urls', false), $request->variable('rules_parse_smilies', false));
}
// Get data for forum description if specified
if ($forum_data['forum_desc'])
{
- generate_text_for_storage($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options'], request_var('desc_parse_bbcode', false), request_var('desc_parse_urls', false), request_var('desc_parse_smilies', false));
+ generate_text_for_storage($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options'], $request->variable('desc_parse_bbcode', false), $request->variable('desc_parse_urls', false), $request->variable('desc_parse_smilies', false));
}
$errors = $this->update_forum_data($forum_data);
if (!sizeof($errors))
{
- $forum_perm_from = request_var('forum_perm_from', 0);
+ $forum_perm_from = $request->variable('forum_perm_from', 0);
$cache->destroy('sql', FORUMS_TABLE);
$copied_permissions = false;
@@ -266,7 +266,7 @@ class acp_forums
if ($move_forum_name !== false)
{
- add_log('admin', 'LOG_FORUM_' . strtoupper($action), $row['forum_name'], $move_forum_name);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_FORUM_' . strtoupper($action), false, array($row['forum_name'], $move_forum_name));
$cache->destroy('sql', FORUMS_TABLE);
}
@@ -311,7 +311,7 @@ class acp_forums
$row2['min_topic_id'] = (int) $row2['min_topic_id'];
$row2['max_topic_id'] = (int) $row2['max_topic_id'];
- $start = request_var('start', $row2['min_topic_id']);
+ $start = $request->variable('start', $row2['min_topic_id']);
$batch_size = 2000;
$end = $start + $batch_size;
@@ -327,7 +327,7 @@ class acp_forums
WHERE forum_id = ' . $forum_id . '
AND topic_id BETWEEN ' . $start . ' AND ' . $end;
$result = $db->sql_query($sql);
- $topics_done = request_var('topics_done', 0) + (int) $db->sql_fetchfield('num_topics');
+ $topics_done = $request->variable('topics_done', 0) + (int) $db->sql_fetchfield('num_topics');
$db->sql_freeresult($result);
$start += $batch_size;
@@ -377,7 +377,8 @@ class acp_forums
sync('forum', 'forum_id', $forum_id, false, true);
- add_log('admin', 'LOG_FORUM_SYNC', $row['forum_name']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_FORUM_SYNC', false, array($row['forum_name']));
+
$cache->destroy('sql', FORUMS_TABLE);
$template->assign_var('L_FORUM_RESYNCED', sprintf($user->lang['FORUM_RESYNCED'], $row['forum_name']));
@@ -390,13 +391,13 @@ class acp_forums
if ($update)
{
$forum_data['forum_flags'] = 0;
- $forum_data['forum_flags'] += (request_var('forum_link_track', false)) ? FORUM_FLAG_LINK_TRACK : 0;
- $forum_data['forum_flags'] += (request_var('prune_old_polls', false)) ? FORUM_FLAG_PRUNE_POLL : 0;
- $forum_data['forum_flags'] += (request_var('prune_announce', false)) ? FORUM_FLAG_PRUNE_ANNOUNCE : 0;
- $forum_data['forum_flags'] += (request_var('prune_sticky', false)) ? FORUM_FLAG_PRUNE_STICKY : 0;
+ $forum_data['forum_flags'] += ($request->variable('forum_link_track', false)) ? FORUM_FLAG_LINK_TRACK : 0;
+ $forum_data['forum_flags'] += ($request->variable('prune_old_polls', false)) ? FORUM_FLAG_PRUNE_POLL : 0;
+ $forum_data['forum_flags'] += ($request->variable('prune_announce', false)) ? FORUM_FLAG_PRUNE_ANNOUNCE : 0;
+ $forum_data['forum_flags'] += ($request->variable('prune_sticky', false)) ? FORUM_FLAG_PRUNE_STICKY : 0;
$forum_data['forum_flags'] += ($forum_data['show_active']) ? FORUM_FLAG_ACTIVE_TOPICS : 0;
- $forum_data['forum_flags'] += (request_var('enable_post_review', true)) ? FORUM_FLAG_POST_REVIEW : 0;
- $forum_data['forum_flags'] += (request_var('enable_quick_reply', false)) ? FORUM_FLAG_QUICK_REPLY : 0;
+ $forum_data['forum_flags'] += ($request->variable('enable_post_review', true)) ? FORUM_FLAG_POST_REVIEW : 0;
+ $forum_data['forum_flags'] += ($request->variable('enable_quick_reply', false)) ? FORUM_FLAG_QUICK_REPLY : 0;
}
// Initialise $row, so we always have it in the event
@@ -444,7 +445,7 @@ class acp_forums
'parent_id' => $this->parent_id,
'forum_type' => FORUM_POST,
'forum_status' => ITEM_UNLOCKED,
- 'forum_name' => utf8_normalize_nfc(request_var('forum_name', '', true)),
+ 'forum_name' => $request->variable('forum_name', '', true),
'forum_link' => '',
'forum_link_track' => false,
'forum_desc' => '',
@@ -511,12 +512,12 @@ class acp_forums
{
if (!isset($forum_data['forum_rules_uid']))
{
- // Before we are able to display the preview and plane text, we need to parse our request_var()'d value...
+ // Before we are able to display the preview and plane text, we need to parse our $request->variable()'d value...
$forum_data['forum_rules_uid'] = '';
$forum_data['forum_rules_bitfield'] = '';
$forum_data['forum_rules_options'] = 0;
- generate_text_for_storage($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], $forum_data['forum_rules_options'], request_var('rules_allow_bbcode', false), request_var('rules_allow_urls', false), request_var('rules_allow_smilies', false));
+ generate_text_for_storage($forum_data['forum_rules'], $forum_data['forum_rules_uid'], $forum_data['forum_rules_bitfield'], $forum_data['forum_rules_options'], $request->variable('rules_allow_bbcode', false), $request->variable('rules_allow_urls', false), $request->variable('rules_allow_smilies', false));
}
// Generate preview content
@@ -531,12 +532,12 @@ class acp_forums
{
if (!isset($forum_data['forum_desc_uid']))
{
- // Before we are able to display the preview and plane text, we need to parse our request_var()'d value...
+ // Before we are able to display the preview and plane text, we need to parse our $request->variable()'d value...
$forum_data['forum_desc_uid'] = '';
$forum_data['forum_desc_bitfield'] = '';
$forum_data['forum_desc_options'] = 0;
- generate_text_for_storage($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options'], request_var('desc_allow_bbcode', false), request_var('desc_allow_urls', false), request_var('desc_allow_smilies', false));
+ generate_text_for_storage($forum_data['forum_desc'], $forum_data['forum_desc_uid'], $forum_data['forum_desc_bitfield'], $forum_data['forum_desc_options'], $request->variable('desc_allow_bbcode', false), $request->variable('desc_allow_urls', false), $request->variable('desc_allow_smilies', false));
}
// decode...
@@ -779,7 +780,7 @@ class acp_forums
break;
case 'copy_perm':
- $forum_perm_from = request_var('forum_perm_from', 0);
+ $forum_perm_from = $request->variable('forum_perm_from', 0);
// Copy permissions?
if (!empty($forum_perm_from) && $forum_perm_from != $forum_id)
@@ -945,7 +946,7 @@ class acp_forums
*/
function update_forum_data(&$forum_data)
{
- global $db, $user, $cache, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher;
+ global $db, $user, $cache, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher, $phpbb_log, $request;
$errors = array();
@@ -1050,6 +1051,7 @@ class acp_forums
else
{
// Instantiate passwords manager
+ /* @var $passwords_manager \phpbb\passwords\manager */
$passwords_manager = $phpbb_container->get('passwords.manager');
$forum_data_sql['forum_password'] = $passwords_manager->hash($forum_data_sql['forum_password']);
@@ -1126,7 +1128,7 @@ class acp_forums
$forum_data['forum_id'] = $db->sql_nextid();
- add_log('admin', 'LOG_FORUM_ADD', $forum_data['forum_name']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_FORUM_ADD', false, array($forum_data['forum_name']));
}
else
{
@@ -1144,7 +1146,7 @@ class acp_forums
// we're turning a postable forum into a non-postable forum
if ($forum_data_sql['type_action'] == 'move')
{
- $to_forum_id = request_var('to_forum_id', 0);
+ $to_forum_id = $request->variable('to_forum_id', 0);
if ($to_forum_id)
{
@@ -1174,8 +1176,8 @@ class acp_forums
if ($row['right_id'] - $row['left_id'] > 1)
{
// We are turning a category into a link - but need to decide what to do with the subforums.
- $action_subforums = request_var('action_subforums', '');
- $subforums_to_id = request_var('subforums_to_id', 0);
+ $action_subforums = $request->variable('action_subforums', '');
+ $subforums_to_id = $request->variable('subforums_to_id', 0);
if ($action_subforums == 'delete')
{
@@ -1343,7 +1345,7 @@ class acp_forums
// Add it back
$forum_data['forum_id'] = $forum_id;
- add_log('admin', 'LOG_FORUM_EDIT', $forum_data['forum_name']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_FORUM_EDIT', false, array($forum_data['forum_name']));
}
/**
@@ -1545,7 +1547,7 @@ class acp_forums
*/
function delete_forum($forum_id, $action_posts = 'delete', $action_subforums = 'delete', $posts_to_id = 0, $subforums_to_id = 0)
{
- global $db, $user, $cache;
+ global $db, $user, $cache, $phpbb_log;
$forum_data = $this->get_forum_info($forum_id);
@@ -1742,39 +1744,39 @@ class acp_forums
switch ($log_action)
{
case 'MOVE_POSTS_MOVE_FORUMS':
- add_log('admin', 'LOG_FORUM_DEL_MOVE_POSTS_MOVE_FORUMS', $posts_to_name, $subforums_to_name, $forum_data['forum_name']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_FORUM_DEL_MOVE_POSTS_MOVE_FORUMS', false, array($posts_to_name, $subforums_to_name, $forum_data['forum_name']));
break;
case 'MOVE_POSTS_FORUMS':
- add_log('admin', 'LOG_FORUM_DEL_MOVE_POSTS_FORUMS', $posts_to_name, $forum_data['forum_name']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_FORUM_DEL_MOVE_POSTS_FORUMS', false, array($posts_to_name, $forum_data['forum_name']));
break;
case 'POSTS_MOVE_FORUMS':
- add_log('admin', 'LOG_FORUM_DEL_POSTS_MOVE_FORUMS', $subforums_to_name, $forum_data['forum_name']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_FORUM_DEL_POSTS_MOVE_FORUMS', false, array($subforums_to_name, $forum_data['forum_name']));
break;
case '_MOVE_FORUMS':
- add_log('admin', 'LOG_FORUM_DEL_MOVE_FORUMS', $subforums_to_name, $forum_data['forum_name']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_FORUM_DEL_MOVE_FORUMS', false, array($subforums_to_name, $forum_data['forum_name']));
break;
case 'MOVE_POSTS_':
- add_log('admin', 'LOG_FORUM_DEL_MOVE_POSTS', $posts_to_name, $forum_data['forum_name']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_FORUM_DEL_MOVE_POSTS', false, array($posts_to_name, $forum_data['forum_name']));
break;
case 'POSTS_FORUMS':
- add_log('admin', 'LOG_FORUM_DEL_POSTS_FORUMS', $forum_data['forum_name']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_FORUM_DEL_POSTS_FORUMS', false, array($forum_data['forum_name']));
break;
case '_FORUMS':
- add_log('admin', 'LOG_FORUM_DEL_FORUMS', $forum_data['forum_name']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_FORUM_DEL_FORUMS', false, array($forum_data['forum_name']));
break;
case 'POSTS_':
- add_log('admin', 'LOG_FORUM_DEL_POSTS', $forum_data['forum_name']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_FORUM_DEL_POSTS', false, array($forum_data['forum_name']));
break;
default:
- add_log('admin', 'LOG_FORUM_DEL_FORUM', $forum_data['forum_name']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_FORUM_DEL_FORUM', false, array($forum_data['forum_name']));
break;
}
@@ -1978,7 +1980,7 @@ class acp_forums
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- set_config('num_posts', (int) $row['stat'], true);
+ $config->set('num_posts', (int) $row['stat'], false);
$sql = 'SELECT COUNT(topic_id) AS stat
FROM ' . TOPICS_TABLE . '
@@ -1987,7 +1989,7 @@ class acp_forums
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- set_config('num_topics', (int) $row['stat'], true);
+ $config->set('num_topics', (int) $row['stat'], false);
$sql = 'SELECT COUNT(attach_id) as stat
FROM ' . ATTACHMENTS_TABLE;
@@ -1995,7 +1997,7 @@ class acp_forums
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- set_config('num_files', (int) $row['stat'], true);
+ $config->set('num_files', (int) $row['stat'], false);
$sql = 'SELECT SUM(filesize) as stat
FROM ' . ATTACHMENTS_TABLE;
@@ -2003,7 +2005,7 @@ class acp_forums
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- set_config('upload_dir_size', (float) $row['stat'], true);
+ $config->set('upload_dir_size', (float) $row['stat'], false);
return array();
}
diff --git a/phpBB/includes/acp/acp_groups.php b/phpBB/includes/acp/acp_groups.php
index edfada1bf1..138234caee 100644
--- a/phpBB/includes/acp/acp_groups.php
+++ b/phpBB/includes/acp/acp_groups.php
@@ -45,15 +45,18 @@ class acp_groups
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
// Check and set some common vars
- $action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['addusers'])) ? 'addusers' : request_var('action', ''));
- $group_id = request_var('g', 0);
- $mark_ary = request_var('mark', array(0));
- $name_ary = request_var('usernames', '', true);
- $leader = request_var('leader', 0);
- $default = request_var('default', 0);
- $start = request_var('start', 0);
+ $action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['addusers'])) ? 'addusers' : $request->variable('action', ''));
+ $group_id = $request->variable('g', 0);
+ $mark_ary = $request->variable('mark', array(0));
+ $name_ary = $request->variable('usernames', '', true);
+ $leader = $request->variable('leader', 0);
+ $default = $request->variable('default', 0);
+ $start = $request->variable('start', 0);
$update = (isset($_POST['update'])) ? true : false;
+ /** @var \phpbb\group\helper $group_helper */
+ $group_helper = $phpbb_container->get('group_helper');
+
// Clear some vars
$group_row = array();
@@ -98,7 +101,7 @@ class acp_groups
}
// Approve, demote or promote
- $group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'];
+ $group_name = $group_helper->get_name($group_row['group_name']);
$error = group_user_attributes($action, $group_id, $mark_ary, false, $group_name);
if (!$error)
@@ -139,7 +142,7 @@ class acp_groups
if (confirm_box(true))
{
- $group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'];
+ $group_name = $group_helper->get_name($group_row['group_name']);
group_user_attributes('default', $group_id, $mark_ary, false, $group_name, $group_row);
trigger_error($user->lang['GROUP_DEFS_UPDATED'] . adm_back_link($this->u_action . '&amp;action=list&amp;g=' . $group_id));
}
@@ -158,7 +161,7 @@ class acp_groups
case 'set_default_on_all':
if (confirm_box(true))
{
- $group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'];
+ $group_name = $group_helper->get_name($group_row['group_name']);
$start = 0;
@@ -236,7 +239,7 @@ class acp_groups
break;
case 'deleteusers':
- $group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'];
+ $group_name = $group_helper->get_name($group_row['group_name']);
$error = group_user_del($group_id, $mark_ary, false, $group_name);
break;
}
@@ -280,7 +283,7 @@ class acp_groups
}
$name_ary = array_unique(explode("\n", $name_ary));
- $group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'];
+ $group_name = $group_helper->get_name($group_row['group_name']);
// Add user/s to group
if ($error = group_user_add($group_id, false, $name_ary, $group_name, $default, $leader, 0, $group_row))
@@ -320,6 +323,7 @@ class acp_groups
if ($config['allow_avatar'])
{
+ /* @var $phpbb_avatar_manager \phpbb\avatar\manager */
$phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
$avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers();
@@ -361,24 +365,24 @@ class acp_groups
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- $group_name = utf8_normalize_nfc(request_var('group_name', '', true));
- $group_desc = utf8_normalize_nfc(request_var('group_desc', '', true));
- $group_type = request_var('group_type', GROUP_FREE);
+ $group_name = $request->variable('group_name', '', true);
+ $group_desc = $request->variable('group_desc', '', true);
+ $group_type = $request->variable('group_type', GROUP_FREE);
- $allow_desc_bbcode = request_var('desc_parse_bbcode', false);
- $allow_desc_urls = request_var('desc_parse_urls', false);
- $allow_desc_smilies = request_var('desc_parse_smilies', false);
+ $allow_desc_bbcode = $request->variable('desc_parse_bbcode', false);
+ $allow_desc_urls = $request->variable('desc_parse_urls', false);
+ $allow_desc_smilies = $request->variable('desc_parse_smilies', false);
$submit_ary = array(
- 'colour' => request_var('group_colour', ''),
- 'rank' => request_var('group_rank', 0),
+ 'colour' => $request->variable('group_colour', ''),
+ 'rank' => $request->variable('group_rank', 0),
'receive_pm' => isset($_REQUEST['group_receive_pm']) ? 1 : 0,
'legend' => isset($_REQUEST['group_legend']) ? 1 : 0,
'teampage' => isset($_REQUEST['group_teampage']) ? 1 : 0,
- 'message_limit' => request_var('group_message_limit', 0),
- 'max_recipients' => request_var('group_max_recipients', 0),
+ 'message_limit' => $request->variable('group_message_limit', 0),
+ 'max_recipients' => $request->variable('group_max_recipients', 0),
'founder_manage' => 0,
- 'skip_auth' => request_var('group_skip_auth', 0),
+ 'skip_auth' => $request->variable('group_skip_auth', 0),
);
if ($user->data['user_type'] == USER_FOUNDER)
@@ -547,7 +551,7 @@ class acp_groups
if (!($error = group_create($group_id, $group_type, $group_name, $group_desc, $group_attributes, $allow_desc_bbcode, $allow_desc_urls, $allow_desc_smilies)))
{
- $group_perm_from = request_var('group_perm_from', 0);
+ $group_perm_from = $request->variable('group_perm_from', 0);
// Copy permissions?
// If the user has the a_authgroups permission and at least one additional permission ability set the permissions are fully transferred.
@@ -617,7 +621,7 @@ class acp_groups
}
else if (!$group_id)
{
- $group_name = utf8_normalize_nfc(request_var('group_name', '', true));
+ $group_name = $request->variable('group_name', '', true);
$group_desc_data = array(
'text' => '',
'allow_bbcode' => true,
@@ -695,12 +699,12 @@ class acp_groups
$error = array_merge($error, $phpbb_avatar_manager->localize_errors($user, $avatar_error));
}
- $back_link = request_var('back_link', '');
+ $back_link = $request->variable('back_link', '');
switch ($back_link)
{
case 'acp_users_groups':
- $u_back = append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&amp;mode=groups&amp;u=' . request_var('u', 0));
+ $u_back = append_sid("{$phpbb_admin_path}index.$phpEx", 'i=users&amp;mode=groups&amp;u=' . $request->variable('u', 0));
break;
default:
@@ -719,7 +723,7 @@ class acp_groups
'S_AVATARS_ENABLED' => ($config['allow_avatar'] && $avatars_enabled),
'ERROR_MSG' => (sizeof($error)) ? implode('<br />', $error) : '',
- 'GROUP_NAME' => ($group_type == GROUP_SPECIAL) ? $user->lang['G_' . $group_name] : $group_name,
+ 'GROUP_NAME' => $group_helper->get_name($group_name),
'GROUP_INTERNAL_NAME' => $group_name,
'GROUP_DESC' => $group_desc_data['text'],
'GROUP_RECEIVE_PM' => (isset($group_row['group_receive_pm']) && $group_row['group_receive_pm']) ? ' checked="checked"' : '',
@@ -801,8 +805,9 @@ class acp_groups
trigger_error($user->lang['NO_GROUP'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- $this->page_title = 'GROUP_MEMBERS';
+ /* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
+ $this->page_title = 'GROUP_MEMBERS';
// Grab the leaders - always, on every page...
$sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_regdate, u.user_colour, u.user_posts, u.group_id, ug.group_leader, ug.user_pending
@@ -853,7 +858,7 @@ class acp_groups
'S_GROUP_SPECIAL' => ($group_row['group_type'] == GROUP_SPECIAL) ? true : false,
'S_ACTION_OPTIONS' => $s_action_options,
- 'GROUP_NAME' => ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'],
+ 'GROUP_NAME' => $group_helper->get_name($group_row['group_name']),
'U_ACTION' => $this->u_action . "&amp;g=$group_id",
'U_BACK' => $this->u_action,
@@ -982,6 +987,9 @@ class acp_groups
$teampage_id = $request->variable('t', 0);
$category_id = $request->variable('c', 0);
+ /** @var \phpbb\group\helper $group_helper */
+ $group_helper = $phpbb_container->get('group_helper');
+
if ($field && !in_array($field, array('legend', 'teampage')))
{
// Invalid mode
@@ -989,7 +997,7 @@ class acp_groups
}
else if ($field && in_array($field, array('legend', 'teampage')))
{
-
+ /* @var $group_position \phpbb\groupposition\groupposition_interface */
$group_position = $phpbb_container->get('groupposition.' . $field);
}
@@ -1084,7 +1092,7 @@ class acp_groups
$s_group_select_legend = '';
while ($row = $db->sql_fetchrow($result))
{
- $group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
+ $group_name = $group_helper->get_name($row['group_name']);
if ($row['group_legend'])
{
$template->assign_block_vars('legend', array(
@@ -1132,7 +1140,7 @@ class acp_groups
if ($row['group_id'])
{
- $group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
+ $group_name = $group_helper->get_name($row['group_name']);
$group_type = $user->lang[\phpbb\groupposition\teampage::group_type_language($row['group_type'])];
}
else
@@ -1165,7 +1173,7 @@ class acp_groups
$s_group_select_teampage = '';
while ($row = $db->sql_fetchrow($result))
{
- $group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
+ $group_name = $group_helper->get_name($row['group_name']);
$template->assign_block_vars('add_teampage', array(
'GROUP_ID' => (int) $row['group_id'],
'GROUP_NAME' => $group_name,
diff --git a/phpBB/includes/acp/acp_icons.php b/phpBB/includes/acp/acp_icons.php
index 9265415dd1..5d1756de45 100644
--- a/phpBB/includes/acp/acp_icons.php
+++ b/phpBB/includes/acp/acp_icons.php
@@ -28,18 +28,18 @@ class acp_icons
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
+ global $db, $user, $auth, $template, $cache, $phpbb_container;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
global $request, $phpbb_container;
$user->add_lang('acp/posting');
// Set up general vars
- $action = request_var('action', '');
+ $action = $request->variable('action', '');
$action = (isset($_POST['add'])) ? 'add' : $action;
$action = (isset($_POST['edit'])) ? 'edit' : $action;
$action = (isset($_POST['import'])) ? 'import' : $action;
- $icon_id = request_var('id', 0);
+ $icon_id = $request->variable('id', 0);
$mode = ($mode == 'smilies') ? 'smilies' : 'icons';
@@ -326,24 +326,24 @@ class acp_icons
case 'modify':
// Get items to create/modify
- $images = (isset($_POST['image'])) ? array_keys(request_var('image', array('' => 0))) : array();
+ $images = (isset($_POST['image'])) ? array_keys($request->variable('image', array('' => 0))) : array();
// Now really get the items
- $image_id = (isset($_POST['id'])) ? request_var('id', array('' => 0)) : array();
- $image_order = (isset($_POST['order'])) ? request_var('order', array('' => 0)) : array();
- $image_width = (isset($_POST['width'])) ? request_var('width', array('' => 0)) : array();
- $image_height = (isset($_POST['height'])) ? request_var('height', array('' => 0)) : array();
- $image_add = (isset($_POST['add_img'])) ? request_var('add_img', array('' => 0)) : array();
- $image_emotion = utf8_normalize_nfc(request_var('emotion', array('' => ''), true));
- $image_code = utf8_normalize_nfc(request_var('code', array('' => ''), true));
- $image_display_on_posting = (isset($_POST['display_on_posting'])) ? request_var('display_on_posting', array('' => 0)) : array();
+ $image_id = (isset($_POST['id'])) ? $request->variable('id', array('' => 0)) : array();
+ $image_order = (isset($_POST['order'])) ? $request->variable('order', array('' => 0)) : array();
+ $image_width = (isset($_POST['width'])) ? $request->variable('width', array('' => 0)) : array();
+ $image_height = (isset($_POST['height'])) ? $request->variable('height', array('' => 0)) : array();
+ $image_add = (isset($_POST['add_img'])) ? $request->variable('add_img', array('' => 0)) : array();
+ $image_emotion = $request->variable('emotion', array('' => ''), true);
+ $image_code = $request->variable('code', array('' => ''), true);
+ $image_display_on_posting = (isset($_POST['display_on_posting'])) ? $request->variable('display_on_posting', array('' => 0)) : array();
// Ok, add the relevant bits if we are adding new codes to existing emoticons...
if ($request->variable('add_additional_code', false, false, \phpbb\request\request_interface::POST))
{
- $add_image = request_var('add_image', '');
- $add_code = utf8_normalize_nfc(request_var('add_code', '', true));
- $add_emotion = utf8_normalize_nfc(request_var('add_emotion', '', true));
+ $add_image = $request->variable('add_image', '');
+ $add_code = $request->variable('add_code', '', true);
+ $add_emotion = $request->variable('add_emotion', '', true);
if ($add_image && $add_emotion && $add_code)
{
@@ -352,15 +352,15 @@ class acp_icons
$image_code[$add_image] = $add_code;
$image_emotion[$add_image] = $add_emotion;
- $image_width[$add_image] = request_var('add_width', 0);
- $image_height[$add_image] = request_var('add_height', 0);
+ $image_width[$add_image] = $request->variable('add_width', 0);
+ $image_height[$add_image] = $request->variable('add_height', 0);
if ($request->variable('add_display_on_posting', false, false, \phpbb\request\request_interface::POST))
{
$image_display_on_posting[$add_image] = 1;
}
- $image_order[$add_image] = request_var('add_order', 0);
+ $image_order[$add_image] = $request->variable('add_order', 0);
}
}
@@ -486,6 +486,7 @@ class acp_icons
$cache->destroy('_icons');
$cache->destroy('sql', $table);
+ $phpbb_container->get('text_formatter.cache')->invalidate();
$level = ($icons_updated) ? E_USER_NOTICE : E_USER_WARNING;
$errormsgs = '';
@@ -506,8 +507,8 @@ class acp_icons
case 'import':
- $pak = request_var('pak', '');
- $current = request_var('current', '');
+ $pak = $request->variable('pak', '');
+ $current = $request->variable('current', '');
if ($pak != '')
{
@@ -661,6 +662,7 @@ class acp_icons
$cache->destroy('_icons');
$cache->destroy('sql', $table);
+ $phpbb_container->get('text_formatter.cache')->invalidate();
trigger_error($user->lang[$lang . '_IMPORT_SUCCESS'] . adm_back_link($this->u_action));
}
@@ -783,6 +785,7 @@ class acp_icons
$cache->destroy('_icons');
$cache->destroy('sql', $table);
+ $phpbb_container->get('text_formatter.cache')->invalidate();
if ($request->is_ajax())
{
@@ -848,6 +851,7 @@ class acp_icons
$cache->destroy('_icons');
$cache->destroy('sql', $table);
+ $phpbb_container->get('text_formatter.cache')->invalidate();
if ($request->is_ajax())
{
@@ -903,9 +907,10 @@ class acp_icons
)
);
- $spacer = false;
+ /* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
- $pagination_start = request_var('start', 0);
+ $pagination_start = $request->variable('start', 0);
+ $spacer = false;
$item_count = $this->item_count($table);
diff --git a/phpBB/includes/acp/acp_inactive.php b/phpBB/includes/acp/acp_inactive.php
index e96c42de05..3a72cf1fe6 100644
--- a/phpBB/includes/acp/acp_inactive.php
+++ b/phpBB/includes/acp/acp_inactive.php
@@ -31,31 +31,33 @@ class acp_inactive
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $phpbb_container;
+ global $config, $db, $user, $auth, $template, $phpbb_container, $phpbb_log, $request;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
$user->add_lang('memberlist');
- $action = request_var('action', '');
- $mark = (isset($_REQUEST['mark'])) ? request_var('mark', array(0)) : array();
- $start = request_var('start', 0);
+ $action = $request->variable('action', '');
+ $mark = (isset($_REQUEST['mark'])) ? $request->variable('mark', array(0)) : array();
+ $start = $request->variable('start', 0);
$submit = isset($_POST['submit']);
// Sort keys
- $sort_days = request_var('st', 0);
- $sort_key = request_var('sk', 'i');
- $sort_dir = request_var('sd', 'd');
+ $sort_days = $request->variable('st', 0);
+ $sort_key = $request->variable('sk', 'i');
+ $sort_dir = $request->variable('sd', 'd');
$form_key = 'acp_inactive';
add_form_key($form_key);
+
+ /* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
// We build the sort key and per page settings here, because they may be needed later
// Number of entries to display
- $per_page = request_var('users_per_page', (int) $config['topics_per_page']);
+ $per_page = $request->variable('users_per_page', (int) $config['topics_per_page']);
// Sorting
$limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
@@ -135,8 +137,10 @@ class acp_inactive
{
foreach ($inactive_users as $row)
{
- add_log('admin', 'LOG_USER_ACTIVE', $row['username']);
- add_log('user', $row['user_id'], 'LOG_USER_ACTIVE_USER');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_ACTIVE', false, array($row['username']));
+ $phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_ACTIVE_USER', false, array(
+ 'reportee_id' => $row['user_id']
+ ));
}
trigger_error(sprintf($user->lang['LOG_INACTIVE_ACTIVATE'], implode($user->lang['COMMA_SEPARATOR'], $user_affected) . ' ' . adm_back_link($this->u_action)));
@@ -159,7 +163,7 @@ class acp_inactive
user_delete('retain', $mark, true);
- add_log('admin', 'LOG_INACTIVE_' . strtoupper($action), implode(', ', $user_affected));
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_INACTIVE_' . strtoupper($action), false, array(implode(', ', $user_affected)));
trigger_error(sprintf($user->lang['LOG_INACTIVE_DELETE'], implode($user->lang['COMMA_SEPARATOR'], $user_affected) . ' ' . adm_back_link($this->u_action)));
}
@@ -231,7 +235,7 @@ class acp_inactive
WHERE ' . $db->sql_in_set('user_id', $user_ids);
$db->sql_query($sql);
- add_log('admin', 'LOG_INACTIVE_REMIND', implode(', ', $usernames));
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_INACTIVE_REMIND', false, array(implode(', ', $usernames)));
trigger_error(sprintf($user->lang['LOG_INACTIVE_REMIND'], implode($user->lang['COMMA_SEPARATOR'], $usernames) . ' ' . adm_back_link($this->u_action)));
}
diff --git a/phpBB/includes/acp/acp_jabber.php b/phpBB/includes/acp/acp_jabber.php
index 284543acd3..5058e9c769 100644
--- a/phpBB/includes/acp/acp_jabber.php
+++ b/phpBB/includes/acp/acp_jabber.php
@@ -29,14 +29,14 @@ class acp_jabber
function main($id, $mode)
{
- global $db, $user, $auth, $template;
+ global $db, $user, $auth, $template, $phpbb_log, $request;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang('acp/board');
include_once($phpbb_root_path . 'includes/functions_jabber.' . $phpEx);
- $action = request_var('action', '');
+ $action = $request->variable('action', '');
$submit = (isset($_POST['submit'])) ? true : false;
if ($mode != 'settings')
@@ -47,13 +47,13 @@ class acp_jabber
$this->tpl_name = 'acp_jabber';
$this->page_title = 'ACP_JABBER_SETTINGS';
- $jab_enable = request_var('jab_enable', (bool) $config['jab_enable']);
- $jab_host = request_var('jab_host', (string) $config['jab_host']);
- $jab_port = request_var('jab_port', (int) $config['jab_port']);
- $jab_username = request_var('jab_username', (string) $config['jab_username']);
- $jab_password = request_var('jab_password', (string) $config['jab_password']);
- $jab_package_size = request_var('jab_package_size', (int) $config['jab_package_size']);
- $jab_use_ssl = request_var('jab_use_ssl', (bool) $config['jab_use_ssl']);
+ $jab_enable = $request->variable('jab_enable', (bool) $config['jab_enable']);
+ $jab_host = $request->variable('jab_host', (string) $config['jab_host']);
+ $jab_port = $request->variable('jab_port', (int) $config['jab_port']);
+ $jab_username = $request->variable('jab_username', (string) $config['jab_username']);
+ $jab_password = $request->variable('jab_password', (string) $config['jab_password']);
+ $jab_package_size = $request->variable('jab_package_size', (int) $config['jab_package_size']);
+ $jab_use_ssl = $request->variable('jab_use_ssl', (bool) $config['jab_use_ssl']);
$form_name = 'acp_jabber';
add_form_key($form_name);
@@ -103,18 +103,18 @@ class acp_jabber
$db->sql_query($sql);
}
- set_config('jab_enable', $jab_enable);
- set_config('jab_host', $jab_host);
- set_config('jab_port', $jab_port);
- set_config('jab_username', $jab_username);
+ $config->set('jab_enable', $jab_enable);
+ $config->set('jab_host', $jab_host);
+ $config->set('jab_port', $jab_port);
+ $config->set('jab_username', $jab_username);
if ($jab_password !== '********')
{
- set_config('jab_password', $jab_password);
+ $config->set('jab_password', $jab_password);
}
- set_config('jab_package_size', $jab_package_size);
- set_config('jab_use_ssl', $jab_use_ssl);
+ $config->set('jab_package_size', $jab_package_size);
+ $config->set('jab_use_ssl', $jab_use_ssl);
- add_log('admin', 'LOG_' . $log);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_' . $log);
trigger_error($message . adm_back_link($this->u_action));
}
diff --git a/phpBB/includes/acp/acp_language.php b/phpBB/includes/acp/acp_language.php
index 60e338ae7c..e7ee7f47d6 100644
--- a/phpBB/includes/acp/acp_language.php
+++ b/phpBB/includes/acp/acp_language.php
@@ -31,7 +31,7 @@ class acp_language
function main($id, $mode)
{
- global $config, $db, $user, $template;
+ global $config, $db, $user, $template, $phpbb_log, $phpbb_container;
global $phpbb_root_path, $phpEx, $request;
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
@@ -41,14 +41,14 @@ class acp_language
$action = (isset($_POST['remove_store'])) ? 'details' : $action;
$submit = (empty($action) && !isset($_POST['update']) && !isset($_POST['test_connection'])) ? false : true;
- $action = (empty($action)) ? request_var('action', '') : $action;
+ $action = (empty($action)) ? $request->variable('action', '') : $action;
$form_name = 'acp_lang';
add_form_key('acp_lang');
- $lang_id = request_var('id', 0);
+ $lang_id = $request->variable('id', 0);
- $selected_lang_file = request_var('language_file', '|common.' . $phpEx);
+ $selected_lang_file = $request->variable('language_file', '|common.' . $phpEx);
list($this->language_directory, $this->language_file) = explode('|', $selected_lang_file);
@@ -81,16 +81,16 @@ class acp_language
$db->sql_freeresult($result);
$sql_ary = array(
- 'lang_english_name' => request_var('lang_english_name', $row['lang_english_name']),
- 'lang_local_name' => utf8_normalize_nfc(request_var('lang_local_name', $row['lang_local_name'], true)),
- 'lang_author' => utf8_normalize_nfc(request_var('lang_author', $row['lang_author'], true)),
+ 'lang_english_name' => $request->variable('lang_english_name', $row['lang_english_name']),
+ 'lang_local_name' => $request->variable('lang_local_name', $row['lang_local_name'], true),
+ 'lang_author' => $request->variable('lang_author', $row['lang_author'], true),
);
$db->sql_query('UPDATE ' . LANG_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
WHERE lang_id = ' . $lang_id);
- add_log('admin', 'LOG_LANGUAGE_PACK_UPDATED', $sql_ary['lang_english_name']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_LANGUAGE_PACK_UPDATED', false, array($sql_ary['lang_english_name']));
trigger_error($user->lang['LANGUAGE_DETAILS_UPDATED'] . adm_back_link($this->u_action));
break;
@@ -224,7 +224,7 @@ class acp_language
$sql = 'DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . ' WHERE lang_id = ' . $lang_id;
$db->sql_query($sql);
- add_log('admin', 'LOG_LANGUAGE_PACK_DELETED', $row['lang_english_name']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_LANGUAGE_PACK_DELETED', false, array($row['lang_english_name']));
trigger_error(sprintf($user->lang['LANGUAGE_PACK_DELETED'], $row['lang_english_name']) . adm_back_link($this->u_action));
}
@@ -241,7 +241,7 @@ class acp_language
break;
case 'install':
- $lang_iso = request_var('iso', '');
+ $lang_iso = $request->variable('iso', '');
$lang_iso = basename($lang_iso);
if (!$lang_iso || !file_exists("{$phpbb_root_path}language/$lang_iso/iso.txt"))
@@ -329,7 +329,7 @@ class acp_language
}
$db->sql_freeresult($result);
- add_log('admin', 'LOG_LANGUAGE_PACK_INSTALLED', $lang_pack['name']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_LANGUAGE_PACK_INSTALLED', false, array($lang_pack['name']));
$message = sprintf($user->lang['LANGUAGE_PACK_INSTALLED'], $lang_pack['name']);
$message .= ($notify_cpf_update) ? '<br /><br />' . $user->lang['LANGUAGE_PACK_CPF_UPDATE'] : '';
@@ -377,37 +377,19 @@ class acp_language
$db->sql_freeresult($result);
$new_ary = $iso = array();
- $dp = @opendir("{$phpbb_root_path}language");
- if ($dp)
+ /** @var \phpbb\language\language_file_helper $language_helper */
+ $language_helper = $phpbb_container->get('language.helper.language_file');
+ $iso = $language_helper->get_available_languages();
+
+ foreach ($iso as $lang_array)
{
- while (($file = readdir($dp)) !== false)
- {
- if ($file[0] == '.' || !is_dir($phpbb_root_path . 'language/' . $file))
- {
- continue;
- }
+ $lang_iso = $lang_array['iso'];
- if (file_exists("{$phpbb_root_path}language/$file/iso.txt"))
- {
- if (!in_array($file, $installed))
- {
- if ($iso = file("{$phpbb_root_path}language/$file/iso.txt"))
- {
- if (sizeof($iso) == 3)
- {
- $new_ary[$file] = array(
- 'iso' => $file,
- 'name' => trim($iso[0]),
- 'local_name'=> trim($iso[1]),
- 'author' => trim($iso[2])
- );
- }
- }
- }
- }
+ if (!in_array($lang_iso, $installed))
+ {
+ $new_ary[$lang_iso] = $lang_array;
}
- closedir($dp);
}
unset($installed);
diff --git a/phpBB/includes/acp/acp_logs.php b/phpBB/includes/acp/acp_logs.php
index 80dee1d620..56039ff302 100644
--- a/phpBB/includes/acp/acp_logs.php
+++ b/phpBB/includes/acp/acp_logs.php
@@ -32,21 +32,23 @@ class acp_logs
$user->add_lang('mcp');
// Set up general vars
- $action = request_var('action', '');
- $forum_id = request_var('f', 0);
- $topic_id = request_var('t', 0);
- $start = request_var('start', 0);
+ $action = $request->variable('action', '');
+ $forum_id = $request->variable('f', 0);
+ $topic_id = $request->variable('t', 0);
+ $start = $request->variable('start', 0);
$deletemark = $request->variable('delmarked', false, false, \phpbb\request\request_interface::POST);
$deleteall = $request->variable('delall', false, false, \phpbb\request\request_interface::POST);
- $marked = request_var('mark', array(0));
+ $marked = $request->variable('mark', array(0));
// Sort keys
- $sort_days = request_var('st', 0);
- $sort_key = request_var('sk', 't');
- $sort_dir = request_var('sd', 'd');
+ $sort_days = $request->variable('st', 0);
+ $sort_key = $request->variable('sk', 't');
+ $sort_dir = $request->variable('sd', 'd');
$this->tpl_name = 'acp_logs';
$this->log_type = constant('LOG_' . strtoupper($mode));
+
+ /* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
// Delete entries if requested and able
@@ -68,10 +70,11 @@ class acp_logs
$conditions['log_time'] = array('>=', time() - ($sort_days * 86400));
}
- $keywords = utf8_normalize_nfc(request_var('keywords', '', true));
+ $keywords = $request->variable('keywords', '', true);
$conditions['keywords'] = $keywords;
}
+ /* @var $phpbb_log \phpbb\log\log_interface */
$phpbb_log = $phpbb_container->get('log');
$phpbb_log->delete($mode, $conditions);
}
@@ -105,7 +108,7 @@ class acp_logs
$sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0;
$sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
- $keywords = utf8_normalize_nfc(request_var('keywords', '', true));
+ $keywords = $request->variable('keywords', '', true);
$keywords_param = !empty($keywords) ? '&amp;keywords=' . urlencode(htmlspecialchars_decode($keywords)) : '';
$l_title = $user->lang['ACP_' . strtoupper($mode) . '_LOGS'];
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php
index f6d728ffed..8a53edb8ee 100644
--- a/phpBB/includes/acp/acp_main.php
+++ b/phpBB/includes/acp/acp_main.php
@@ -25,8 +25,8 @@ class acp_main
function main($id, $mode)
{
- global $config, $db, $cache, $user, $auth, $template, $request;
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container, $phpbb_dispatcher;
+ global $config, $db, $cache, $user, $auth, $template, $request, $phpbb_log;
+ global $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container, $phpbb_dispatcher, $phpbb_filesystem;
// Show restore permissions notice
if ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm'))
@@ -53,7 +53,7 @@ class acp_main
return;
}
- $action = request_var('action', '');
+ $action = $request->variable('action', '');
if ($action)
{
@@ -121,9 +121,9 @@ class acp_main
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- set_config('record_online_users', 1, true);
- set_config('record_online_date', time(), true);
- add_log('admin', 'LOG_RESET_ONLINE');
+ $config->set('record_online_users', 1, false);
+ $config->set('record_online_date', time(), false);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_RESET_ONLINE');
if ($request->is_ajax())
{
@@ -141,35 +141,35 @@ class acp_main
FROM ' . POSTS_TABLE . '
WHERE post_visibility = ' . ITEM_APPROVED;
$result = $db->sql_query($sql);
- set_config('num_posts', (int) $db->sql_fetchfield('stat'), true);
+ $config->set('num_posts', (int) $db->sql_fetchfield('stat'), false);
$db->sql_freeresult($result);
$sql = 'SELECT COUNT(topic_id) AS stat
FROM ' . TOPICS_TABLE . '
WHERE topic_visibility = ' . ITEM_APPROVED;
$result = $db->sql_query($sql);
- set_config('num_topics', (int) $db->sql_fetchfield('stat'), true);
+ $config->set('num_topics', (int) $db->sql_fetchfield('stat'), false);
$db->sql_freeresult($result);
$sql = 'SELECT COUNT(user_id) AS stat
FROM ' . USERS_TABLE . '
WHERE user_type IN (' . USER_NORMAL . ',' . USER_FOUNDER . ')';
$result = $db->sql_query($sql);
- set_config('num_users', (int) $db->sql_fetchfield('stat'), true);
+ $config->set('num_users', (int) $db->sql_fetchfield('stat'), false);
$db->sql_freeresult($result);
$sql = 'SELECT COUNT(attach_id) as stat
FROM ' . ATTACHMENTS_TABLE . '
WHERE is_orphan = 0';
$result = $db->sql_query($sql);
- set_config('num_files', (int) $db->sql_fetchfield('stat'), true);
+ $config->set('num_files', (int) $db->sql_fetchfield('stat'), false);
$db->sql_freeresult($result);
$sql = 'SELECT SUM(filesize) as stat
FROM ' . ATTACHMENTS_TABLE . '
WHERE is_orphan = 0';
$result = $db->sql_query($sql);
- set_config('upload_dir_size', (float) $db->sql_fetchfield('stat'), true);
+ $config->set('upload_dir_size', (float) $db->sql_fetchfield('stat'), false);
$db->sql_freeresult($result);
if (!function_exists('update_last_username'))
@@ -178,7 +178,7 @@ class acp_main
}
update_last_username();
- add_log('admin', 'LOG_RESYNC_STATS');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_RESYNC_STATS');
if ($request->is_ajax())
{
@@ -215,7 +215,7 @@ class acp_main
// Still no maximum post id? Then we are finished
if (!$max_post_id)
{
- add_log('admin', 'LOG_RESYNC_POSTCOUNTS');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_RESYNC_POSTCOUNTS');
break;
}
@@ -245,7 +245,7 @@ class acp_main
$start += $step;
}
- add_log('admin', 'LOG_RESYNC_POSTCOUNTS');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_RESYNC_POSTCOUNTS');
if ($request->is_ajax())
{
@@ -259,8 +259,8 @@ class acp_main
trigger_error($user->lang['NO_AUTH_OPERATION'] . adm_back_link($this->u_action), E_USER_WARNING);
}
- set_config('board_startdate', time() - 1);
- add_log('admin', 'LOG_RESET_DATE');
+ $config->set('board_startdate', time() - 1);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_RESET_DATE');
if ($request->is_ajax())
{
@@ -340,7 +340,7 @@ class acp_main
}
}
- add_log('admin', 'LOG_RESYNC_POST_MARKING');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_RESYNC_POST_MARKING');
if ($request->is_ajax())
{
@@ -352,11 +352,16 @@ class acp_main
$config->increment('assets_version', 1);
$cache->purge();
+ // Remove old renderers from the text_formatter service. Since this
+ // operation is performed after the cache is purged, there is not "current"
+ // renderer and in effect all renderers will be purged
+ $phpbb_container->get('text_formatter.cache')->tidy();
+
// Clear permissions
$auth->acl_clear_prefetch();
phpbb_cache_moderators($db, $cache, $auth);
- add_log('admin', 'LOG_PURGE_CACHE');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_PURGE_CACHE');
if ($request->is_ajax())
{
@@ -407,7 +412,7 @@ class acp_main
$sql = 'INSERT INTO ' . SESSIONS_TABLE . ' ' . $db->sql_build_array('INSERT', $reinsert_ary);
$db->sql_query($sql);
- add_log('admin', 'LOG_PURGE_SESSIONS');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_PURGE_SESSIONS');
if ($request->is_ajax())
{
@@ -429,6 +434,7 @@ class acp_main
));
}
+ /* @var $version_helper \phpbb\version_helper */
$version_helper = $phpbb_container->get('version_helper');
try
{
@@ -643,7 +649,7 @@ class acp_main
}
}
- if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists($phpbb_root_path . 'config.' . $phpEx) && phpbb_is_writable($phpbb_root_path . 'config.' . $phpEx))
+ if (!defined('PHPBB_DISABLE_CONFIG_CHECK') && file_exists($phpbb_root_path . 'config.' . $phpEx) && $phpbb_filesystem->is_writable($phpbb_root_path . 'config.' . $phpEx))
{
// World-Writable? (000x)
$template->assign_var('S_WRITABLE_CONFIG', (bool) (@fileperms($phpbb_root_path . 'config.' . $phpEx) & 0x0002));
@@ -663,7 +669,7 @@ class acp_main
// Fill dbms version if not yet filled
if (empty($config['dbms_version']))
{
- set_config('dbms_version', $db->sql_server_info(true));
+ $config->set('dbms_version', $db->sql_server_info(true));
}
$this->tpl_name = 'acp_main';
diff --git a/phpBB/includes/acp/acp_modules.php b/phpBB/includes/acp/acp_modules.php
index ea6b388328..c2407f15b4 100644
--- a/phpBB/includes/acp/acp_modules.php
+++ b/phpBB/includes/acp/acp_modules.php
@@ -19,6 +19,8 @@ if (!defined('IN_PHPBB'))
exit;
}
+use phpbb\module\exception\module_exception;
+
/**
* - Able to check for new module versions (modes changed/adjusted/added/removed)
* Icons for:
@@ -37,8 +39,10 @@ class acp_modules
function main($id, $mode)
{
- global $db, $user, $auth, $template, $module, $request;
- global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
+ global $db, $user, $template, $module, $request, $phpbb_log, $phpbb_container;
+
+ /** @var \phpbb\module\module_manager $module_manager */
+ $module_manager = $phpbb_container->get('module.manager');
// Set a global define for modules we might include (the author is able to prevent execution of code by checking this constant)
define('MODULE_INCLUDE', true);
@@ -65,9 +69,9 @@ class acp_modules
$this->page_title = strtoupper($this->module_class);
- $this->parent_id = request_var('parent_id', 0);
- $module_id = request_var('m', 0);
- $action = request_var('action', '');
+ $this->parent_id = $request->variable('parent_id', 0);
+ $module_id = $request->variable('m', 0);
+ $action = $request->variable('action', '');
$errors = array();
switch ($action)
@@ -91,13 +95,20 @@ class acp_modules
$db->sql_freeresult($result);
}
- $errors = $this->delete_module($module_id);
-
- if (!sizeof($errors))
+ try
{
- $this->remove_cache_file();
- trigger_error($user->lang['MODULE_DELETED'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
+ $row = $module_manager->get_module_row($module_id, $this->module_class);
+ $module_manager->delete_module($module_id, $this->module_class);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_MODULE_REMOVED', false, array($user->lang($row['module_langname'])));
}
+ catch (module_exception $e)
+ {
+ $msg = $user->lang($e->getMessage());
+ trigger_error($msg . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
+ }
+
+ $module_manager->remove_cache_file($this->module_class);
+ trigger_error($user->lang['MODULE_DELETED'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
}
else
{
@@ -138,8 +149,8 @@ class acp_modules
AND module_id = $module_id";
$db->sql_query($sql);
- add_log('admin', 'LOG_MODULE_' . strtoupper($action), $this->lang_name($row['module_langname']));
- $this->remove_cache_file();
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_MODULE_' . strtoupper($action), false, array($user->lang($row['module_langname'])));
+ $module_manager->remove_cache_file($this->module_class);
break;
@@ -163,12 +174,16 @@ class acp_modules
trigger_error($user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
- $move_module_name = $this->move_module_by($row, $action, 1);
+ try
+ {
+ $move_module_name = $module_manager->move_module_by($row, $this->module_class, $action, 1);
- if ($move_module_name !== false)
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_MODULE_' . strtoupper($action), false, array($user->lang($row['module_langname']), $move_module_name));
+ $module_manager->remove_cache_file($this->module_class);
+ }
+ catch (module_exception $e)
{
- add_log('admin', 'LOG_MODULE_' . strtoupper($action), $this->lang_name($row['module_langname']), $move_module_name);
- $this->remove_cache_file();
+ // Do nothing
}
if ($request->is_ajax())
@@ -182,7 +197,7 @@ class acp_modules
break;
case 'quickadd':
- $quick_install = request_var('quick_install', '');
+ $quick_install = $request->variable('quick_install', '');
if (confirm_box(true))
{
@@ -194,7 +209,7 @@ class acp_modules
list($module_basename, $module_mode) = explode('::', $quick_install);
// Check if module name and mode exist...
- $fileinfo = $this->get_module_infos($module_basename);
+ $fileinfo = $module_manager->get_module_infos($this->module_class, $module_basename);
$fileinfo = $fileinfo[$module_basename];
if (isset($fileinfo['modes'][$module_mode]))
@@ -210,11 +225,20 @@ class acp_modules
'module_auth' => $fileinfo['modes'][$module_mode]['auth'],
);
- $errors = $this->update_module_data($module_data);
+ try
+ {
+ $module_manager->update_module_data($module_data);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_MODULE_ADD', false, array($user->lang($module_data['module_langname'])));
+ }
+ catch (\phpbb\module\exception\module_exception $e)
+ {
+ $msg = $user->lang($e->getMessage());
+ trigger_error($msg . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
+ }
if (!sizeof($errors))
{
- $this->remove_cache_file();
+ $module_manager->remove_cache_file($this->module_class);
trigger_error($user->lang['MODULE_ADDED'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
}
@@ -240,7 +264,15 @@ class acp_modules
trigger_error($user->lang['NO_MODULE_ID'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
- $module_row = $this->get_module_row($module_id);
+ try
+ {
+ $module_row = $module_manager->get_module_row($module_id, $this->module_class);
+ }
+ catch (\phpbb\module\exception\module_not_found_exception $e)
+ {
+ $msg = $user->lang($e->getMessage());
+ trigger_error($msg . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
+ }
// no break
@@ -253,7 +285,7 @@ class acp_modules
'module_enabled' => 0,
'module_display' => 1,
'parent_id' => 0,
- 'module_langname' => utf8_normalize_nfc(request_var('module_langname', '', true)),
+ 'module_langname' => $request->variable('module_langname', '', true),
'module_mode' => '',
'module_auth' => '',
);
@@ -261,13 +293,13 @@ class acp_modules
$module_data = array();
- $module_data['module_basename'] = request_var('module_basename', (string) $module_row['module_basename']);
- $module_data['module_enabled'] = request_var('module_enabled', (int) $module_row['module_enabled']);
- $module_data['module_display'] = request_var('module_display', (int) $module_row['module_display']);
- $module_data['parent_id'] = request_var('module_parent_id', (int) $module_row['parent_id']);
+ $module_data['module_basename'] = $request->variable('module_basename', (string) $module_row['module_basename']);
+ $module_data['module_enabled'] = $request->variable('module_enabled', (int) $module_row['module_enabled']);
+ $module_data['module_display'] = $request->variable('module_display', (int) $module_row['module_display']);
+ $module_data['parent_id'] = $request->variable('module_parent_id', (int) $module_row['parent_id']);
$module_data['module_class'] = $this->module_class;
- $module_data['module_langname'] = utf8_normalize_nfc(request_var('module_langname', (string) $module_row['module_langname'], true));
- $module_data['module_mode'] = request_var('module_mode', (string) $module_row['module_mode']);
+ $module_data['module_langname'] = $request->variable('module_langname', (string) $module_row['module_langname'], true);
+ $module_data['module_mode'] = $request->variable('module_mode', (string) $module_row['module_mode']);
$submit = (isset($_POST['submit'])) ? true : false;
@@ -278,7 +310,7 @@ class acp_modules
trigger_error($user->lang['NO_MODULE_LANGNAME'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
}
- $module_type = request_var('module_type', 'category');
+ $module_type = $request->variable('module_type', 'category');
if ($module_type == 'category')
{
@@ -294,15 +326,29 @@ class acp_modules
// Adjust auth row
if ($module_data['module_basename'] && $module_data['module_mode'])
{
- $fileinfo = $this->get_module_infos($module_data['module_basename']);
+ $fileinfo = $module_manager->get_module_infos($this->module_class, $module_data['module_basename']);
$module_data['module_auth'] = $fileinfo[$module_data['module_basename']]['modes'][$module_data['module_mode']]['auth'];
}
- $errors = $this->update_module_data($module_data);
+ try
+ {
+ $module_manager->update_module_data($module_data);
+ $phpbb_log->add('admin',
+ $user->data['user_id'],
+ $user->ip,
+ ($action === 'edit') ? 'LOG_MODULE_EDIT' : 'LOG_MODULE_ADD',
+ false,
+ array($user->lang($module_data['module_langname']))
+ ); }
+ catch (\phpbb\module\exception\module_exception $e)
+ {
+ $msg = $user->lang($e->getMessage());
+ trigger_error($msg . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
+ }
if (!sizeof($errors))
{
- $this->remove_cache_file();
+ $module_manager->remove_cache_file($this->module_class);
trigger_error((($action == 'add') ? $user->lang['MODULE_ADDED'] : $user->lang['MODULE_EDITED']) . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id));
}
@@ -312,7 +358,7 @@ class acp_modules
$is_cat = (!$module_data['module_basename']) ? true : false;
// Get module information
- $module_infos = $this->get_module_infos();
+ $module_infos = $module_manager->get_module_infos($this->module_class);
// Build name options
$s_name_options = $s_mode_options = '';
@@ -324,7 +370,7 @@ class acp_modules
}
// Name options
- $s_name_options .= '<option value="' . $option . '"' . (($option == $module_data['module_basename']) ? ' selected="selected"' : '') . '>' . $this->lang_name($values['title']) . ' [' . $option . ']</option>';
+ $s_name_options .= '<option value="' . $option . '"' . (($option == $module_data['module_basename']) ? ' selected="selected"' : '') . '>' . $user->lang($values['title']) . ' [' . $option . ']</option>';
$template->assign_block_vars('m_names', array('NAME' => $option, 'A_NAME' => addslashes($option)));
@@ -333,14 +379,14 @@ class acp_modules
{
if ($option == $module_data['module_basename'])
{
- $s_mode_options .= '<option value="' . $m_mode . '"' . (($m_mode == $module_data['module_mode']) ? ' selected="selected"' : '') . '>' . $this->lang_name($m_values['title']) . '</option>';
+ $s_mode_options .= '<option value="' . $m_mode . '"' . (($m_mode == $module_data['module_mode']) ? ' selected="selected"' : '') . '>' . $user->lang($m_values['title']) . '</option>';
}
$template->assign_block_vars('m_names.modes', array(
'OPTION' => $m_mode,
- 'VALUE' => $this->lang_name($m_values['title']),
+ 'VALUE' => $user->lang($m_values['title']),
'A_OPTION' => addslashes($m_mode),
- 'A_VALUE' => addslashes($this->lang_name($m_values['title'])))
+ 'A_VALUE' => addslashes($user->lang($m_values['title'])))
);
}
}
@@ -358,7 +404,7 @@ class acp_modules
'L_TITLE' => $user->lang[strtoupper($action) . '_MODULE'],
- 'MODULENAME' => $this->lang_name($module_data['module_langname']),
+ 'MODULENAME' => $user->lang($module_data['module_langname']),
'ACTION' => $action,
'MODULE_ID' => $module_id,
@@ -406,11 +452,11 @@ class acp_modules
{
$navigation = '<a href="' . $this->u_action . '">' . strtoupper($this->module_class) . '</a>';
- $modules_nav = $this->get_module_branch($this->parent_id, 'parents', 'descending');
+ $modules_nav = $module_manager->get_module_branch($this->parent_id, $this->module_class, 'parents');
foreach ($modules_nav as $row)
{
- $langname = $this->lang_name($row['module_langname']);
+ $langname = $user->lang($row['module_langname']);
if ($row['module_id'] == $this->parent_id)
{
@@ -437,7 +483,7 @@ class acp_modules
{
do
{
- $langname = $this->lang_name($row['module_langname']);
+ $langname = $user->lang($row['module_langname']);
if (!$row['module_enabled'])
{
@@ -472,7 +518,15 @@ class acp_modules
}
else if ($this->parent_id)
{
- $row = $this->get_module_row($this->parent_id);
+ try
+ {
+ $row = $module_manager->get_module_row($this->parent_id, $this->module_class);
+ }
+ catch (\phpbb\module\exception\module_not_found_exception $e)
+ {
+ $msg = $user->lang($e->getMessage());
+ trigger_error($msg . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
+ }
$url = $this->u_action . '&amp;parent_id=' . $this->parent_id . '&amp;m=' . $row['module_id'];
@@ -491,19 +545,19 @@ class acp_modules
$db->sql_freeresult($result);
// Quick adding module
- $module_infos = $this->get_module_infos();
+ $module_infos = $module_manager->get_module_infos($this->module_class);
// Build quick options
$s_install_options = '';
foreach ($module_infos as $option => $values)
{
// Name options
- $s_install_options .= '<optgroup label="' . $this->lang_name($values['title']) . ' [' . $option . ']">';
+ $s_install_options .= '<optgroup label="' . $user->lang($values['title']) . ' [' . $option . ']">';
// Build module modes
foreach ($values['modes'] as $m_mode => $m_values)
{
- $s_install_options .= '<option value="' . $option . '::' . $m_mode . '">&nbsp; &nbsp;' . $this->lang_name($m_values['title']) . '</option>';
+ $s_install_options .= '<option value="' . $option . '::' . $m_mode . '">&nbsp; &nbsp;' . $user->lang($m_values['title']) . '</option>';
}
$s_install_options .= '</optgroup>';
@@ -521,104 +575,6 @@ class acp_modules
}
/**
- * Get row for specified module
- */
- function get_module_row($module_id)
- {
- global $db, $user;
-
- $sql = 'SELECT *
- FROM ' . MODULES_TABLE . "
- WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
- AND module_id = $module_id";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$row)
- {
- trigger_error($user->lang['NO_MODULE'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
- }
-
- return $row;
- }
-
- /**
- * Get available module information from module files
- *
- * @param string $module
- * @param bool|string $module_class
- * @param bool $use_all_available Use all available instead of just all
- * enabled extensions
- * @return array
- */
- function get_module_infos($module = '', $module_class = false, $use_all_available = false)
- {
- global $phpbb_extension_manager, $phpbb_root_path, $phpEx;
-
- $module_class = ($module_class === false) ? $this->module_class : $module_class;
-
- $directory = $phpbb_root_path . 'includes/' . $module_class . '/info/';
- $fileinfo = array();
-
- $finder = $phpbb_extension_manager->get_finder($use_all_available);
-
- $modules = $finder
- ->extension_suffix('_module')
- ->extension_directory("/$module_class")
- ->core_path("includes/$module_class/info/")
- ->core_prefix($module_class . '_')
- ->get_classes(true);
-
- foreach ($modules as $cur_module)
- {
- // Skip entries we do not need if we know the module we are
- // looking for
- if ($module && strpos(str_replace('\\', '_', $cur_module), $module) === false && $module !== $cur_module)
- {
- continue;
- }
-
- $info_class = preg_replace('/_module$/', '_info', $cur_module);
-
- // If the class does not exist it might be following the old
- // format. phpbb_acp_info_acp_foo needs to be turned into
- // acp_foo_info and the respective file has to be included
- // manually because it does not support auto loading
- $old_info_class_file = str_replace("phpbb_{$module_class}_info_", '', $cur_module);
- $old_info_class = $old_info_class_file . '_info';
-
- if (class_exists($old_info_class))
- {
- $info_class = $old_info_class;
- }
- else if (!class_exists($info_class))
- {
- $info_class = $old_info_class;
- // need to check class exists again because previous checks triggered autoloading
- if (!class_exists($info_class) && file_exists($directory . $old_info_class_file . '.' . $phpEx))
- {
- include($directory . $old_info_class_file . '.' . $phpEx);
- }
- }
-
- if (class_exists($info_class))
- {
- $info = new $info_class();
- $module_info = $info->module();
-
- $main_class = (isset($module_info['filename'])) ? $module_info['filename'] : $cur_module;
-
- $fileinfo[$main_class] = $module_info;
- }
- }
-
- ksort($fileinfo);
-
- return $fileinfo;
- }
-
- /**
* Simple version of jumpbox, just lists modules
*/
function make_module_select($select_id = false, $ignore_id = false, $ignore_acl = false, $ignore_nonpost = false, $ignore_emptycat = true, $ignore_noncat = false)
@@ -678,7 +634,7 @@ class acp_modules
$selected = (is_array($select_id)) ? ((in_array($row['module_id'], $select_id)) ? ' selected="selected"' : '') : (($row['module_id'] == $select_id) ? ' selected="selected"' : '');
- $langname = $this->lang_name($row['module_langname']);
+ $langname = $user->lang($row['module_langname']);
$module_list .= '<option value="' . $row['module_id'] . '"' . $selected . ((!$row['module_enabled']) ? ' class="disabled"' : '') . '>' . $padding . $langname . '</option>';
$iteration++;
@@ -689,401 +645,4 @@ class acp_modules
return $module_list;
}
-
- /**
- * Get module branch
- */
- function get_module_branch($module_id, $type = 'all', $order = 'descending', $include_module = true)
- {
- global $db;
-
- switch ($type)
- {
- case 'parents':
- $condition = 'm1.left_id BETWEEN m2.left_id AND m2.right_id';
- break;
-
- case 'children':
- $condition = 'm2.left_id BETWEEN m1.left_id AND m1.right_id';
- break;
-
- default:
- $condition = 'm2.left_id BETWEEN m1.left_id AND m1.right_id OR m1.left_id BETWEEN m2.left_id AND m2.right_id';
- break;
- }
-
- $rows = array();
-
- $sql = 'SELECT m2.*
- FROM ' . MODULES_TABLE . ' m1
- LEFT JOIN ' . MODULES_TABLE . " m2 ON ($condition)
- WHERE m1.module_class = '" . $db->sql_escape($this->module_class) . "'
- AND m2.module_class = '" . $db->sql_escape($this->module_class) . "'
- AND m1.module_id = $module_id
- ORDER BY m2.left_id " . (($order == 'descending') ? 'ASC' : 'DESC');
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- if (!$include_module && $row['module_id'] == $module_id)
- {
- continue;
- }
-
- $rows[] = $row;
- }
- $db->sql_freeresult($result);
-
- return $rows;
- }
-
- /**
- * Remove modules cache file
- */
- function remove_cache_file()
- {
- global $phpbb_container;
-
- // Sanitise for future path use, it's escaped as appropriate for queries
- $p_class = str_replace(array('.', '/', '\\'), '', basename($this->module_class));
-
- $phpbb_container->get('cache.driver')->destroy('_modules_' . $p_class);
-
- // Additionally remove sql cache
- $phpbb_container->get('cache.driver')->destroy('sql', MODULES_TABLE);
- }
-
- /**
- * Return correct language name
- */
- function lang_name($module_langname)
- {
- global $user;
-
- return (!empty($user->lang[$module_langname])) ? $user->lang[$module_langname] : $module_langname;
- }
-
- /**
- * Update/Add module
- *
- * @param array &$module_data The module data
- * @param bool $run_inline if set to true errors will be returned and no logs being written
- */
- function update_module_data(&$module_data, $run_inline = false)
- {
- global $db, $user;
-
- if (!isset($module_data['module_id']))
- {
- // no module_id means we're creating a new category/module
- if ($module_data['parent_id'])
- {
- $sql = 'SELECT left_id, right_id
- FROM ' . MODULES_TABLE . "
- WHERE module_class = '" . $db->sql_escape($module_data['module_class']) . "'
- AND module_id = " . (int) $module_data['parent_id'];
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$row)
- {
- if ($run_inline)
- {
- return 'PARENT_NO_EXIST';
- }
-
- trigger_error($user->lang['PARENT_NO_EXIST'] . adm_back_link($this->u_action . '&amp;parent_id=' . $this->parent_id), E_USER_WARNING);
- }
-
- // Workaround
- $row['left_id'] = (int) $row['left_id'];
- $row['right_id'] = (int) $row['right_id'];
-
- $sql = 'UPDATE ' . MODULES_TABLE . "
- SET left_id = left_id + 2, right_id = right_id + 2
- WHERE module_class = '" . $db->sql_escape($module_data['module_class']) . "'
- AND left_id > {$row['right_id']}";
- $db->sql_query($sql);
-
- $sql = 'UPDATE ' . MODULES_TABLE . "
- SET right_id = right_id + 2
- WHERE module_class = '" . $db->sql_escape($module_data['module_class']) . "'
- AND {$row['left_id']} BETWEEN left_id AND right_id";
- $db->sql_query($sql);
-
- $module_data['left_id'] = (int) $row['right_id'];
- $module_data['right_id'] = (int) $row['right_id'] + 1;
- }
- else
- {
- $sql = 'SELECT MAX(right_id) AS right_id
- FROM ' . MODULES_TABLE . "
- WHERE module_class = '" . $db->sql_escape($module_data['module_class']) . "'";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- $module_data['left_id'] = (int) $row['right_id'] + 1;
- $module_data['right_id'] = (int) $row['right_id'] + 2;
- }
-
- $sql = 'INSERT INTO ' . MODULES_TABLE . ' ' . $db->sql_build_array('INSERT', $module_data);
- $db->sql_query($sql);
-
- $module_data['module_id'] = $db->sql_nextid();
-
- if (!$run_inline)
- {
- add_log('admin', 'LOG_MODULE_ADD', $this->lang_name($module_data['module_langname']));
- }
- }
- else
- {
- $row = $this->get_module_row($module_data['module_id']);
-
- if ($module_data['module_basename'] && !$row['module_basename'])
- {
- // we're turning a category into a module
- $branch = $this->get_module_branch($module_data['module_id'], 'children', 'descending', false);
-
- if (sizeof($branch))
- {
- return array($user->lang['NO_CATEGORY_TO_MODULE']);
- }
- }
-
- if ($row['parent_id'] != $module_data['parent_id'])
- {
- $this->move_module($module_data['module_id'], $module_data['parent_id']);
- }
-
- $update_ary = $module_data;
- unset($update_ary['module_id']);
-
- $sql = 'UPDATE ' . MODULES_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $update_ary) . "
- WHERE module_class = '" . $db->sql_escape($module_data['module_class']) . "'
- AND module_id = " . (int) $module_data['module_id'];
- $db->sql_query($sql);
-
- if (!$run_inline)
- {
- add_log('admin', 'LOG_MODULE_EDIT', $this->lang_name($module_data['module_langname']));
- }
- }
-
- return array();
- }
-
- /**
- * Move module around the tree
- */
- function move_module($from_module_id, $to_parent_id)
- {
- global $db;
-
- $moved_modules = $this->get_module_branch($from_module_id, 'children', 'descending');
- $from_data = $moved_modules[0];
- $diff = sizeof($moved_modules) * 2;
-
- $moved_ids = array();
- for ($i = 0; $i < sizeof($moved_modules); ++$i)
- {
- $moved_ids[] = $moved_modules[$i]['module_id'];
- }
-
- // Resync parents
- $sql = 'UPDATE ' . MODULES_TABLE . "
- SET right_id = right_id - $diff
- WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
- AND left_id < " . (int) $from_data['right_id'] . '
- AND right_id > ' . (int) $from_data['right_id'];
- $db->sql_query($sql);
-
- // Resync righthand side of tree
- $sql = 'UPDATE ' . MODULES_TABLE . "
- SET left_id = left_id - $diff, right_id = right_id - $diff
- WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
- AND left_id > " . (int) $from_data['right_id'];
- $db->sql_query($sql);
-
- if ($to_parent_id > 0)
- {
- $to_data = $this->get_module_row($to_parent_id);
-
- // Resync new parents
- $sql = 'UPDATE ' . MODULES_TABLE . "
- SET right_id = right_id + $diff
- WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
- AND " . (int) $to_data['right_id'] . ' BETWEEN left_id AND right_id
- AND ' . $db->sql_in_set('module_id', $moved_ids, true);
- $db->sql_query($sql);
-
- // Resync the righthand side of the tree
- $sql = 'UPDATE ' . MODULES_TABLE . "
- SET left_id = left_id + $diff, right_id = right_id + $diff
- WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
- AND left_id > " . (int) $to_data['right_id'] . '
- AND ' . $db->sql_in_set('module_id', $moved_ids, true);
- $db->sql_query($sql);
-
- // Resync moved branch
- $to_data['right_id'] += $diff;
- if ($to_data['right_id'] > $from_data['right_id'])
- {
- $diff = '+ ' . ($to_data['right_id'] - $from_data['right_id'] - 1);
- }
- else
- {
- $diff = '- ' . abs($to_data['right_id'] - $from_data['right_id'] - 1);
- }
- }
- else
- {
- $sql = 'SELECT MAX(right_id) AS right_id
- FROM ' . MODULES_TABLE . "
- WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
- AND " . $db->sql_in_set('module_id', $moved_ids, true);
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- $diff = '+ ' . (int) ($row['right_id'] - $from_data['left_id'] + 1);
- }
-
- $sql = 'UPDATE ' . MODULES_TABLE . "
- SET left_id = left_id $diff, right_id = right_id $diff
- WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
- AND " . $db->sql_in_set('module_id', $moved_ids);
- $db->sql_query($sql);
- }
-
- /**
- * Remove module from tree
- */
- function delete_module($module_id)
- {
- global $db, $user;
-
- $row = $this->get_module_row($module_id);
-
- $branch = $this->get_module_branch($module_id, 'children', 'descending', false);
-
- if (sizeof($branch))
- {
- return array($user->lang['CANNOT_REMOVE_MODULE']);
- }
-
- // If not move
- $diff = 2;
- $sql = 'DELETE FROM ' . MODULES_TABLE . "
- WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
- AND module_id = $module_id";
- $db->sql_query($sql);
-
- $row['right_id'] = (int) $row['right_id'];
- $row['left_id'] = (int) $row['left_id'];
-
- // Resync tree
- $sql = 'UPDATE ' . MODULES_TABLE . "
- SET right_id = right_id - $diff
- WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
- AND left_id < {$row['right_id']} AND right_id > {$row['right_id']}";
- $db->sql_query($sql);
-
- $sql = 'UPDATE ' . MODULES_TABLE . "
- SET left_id = left_id - $diff, right_id = right_id - $diff
- WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
- AND left_id > {$row['right_id']}";
- $db->sql_query($sql);
-
- add_log('admin', 'LOG_MODULE_REMOVED', $this->lang_name($row['module_langname']));
-
- return array();
-
- }
-
- /**
- * Move module position by $steps up/down
- */
- function move_module_by($module_row, $action = 'move_up', $steps = 1)
- {
- global $db;
-
- /**
- * Fetch all the siblings between the module's current spot
- * and where we want to move it to. If there are less than $steps
- * siblings between the current spot and the target then the
- * module will move as far as possible
- */
- $sql = 'SELECT module_id, left_id, right_id, module_langname
- FROM ' . MODULES_TABLE . "
- WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
- AND parent_id = " . (int) $module_row['parent_id'] . '
- AND ' . (($action == 'move_up') ? 'right_id < ' . (int) $module_row['right_id'] . ' ORDER BY right_id DESC' : 'left_id > ' . (int) $module_row['left_id'] . ' ORDER BY left_id ASC');
- $result = $db->sql_query_limit($sql, $steps);
-
- $target = array();
- while ($row = $db->sql_fetchrow($result))
- {
- $target = $row;
- }
- $db->sql_freeresult($result);
-
- if (!sizeof($target))
- {
- // The module is already on top or bottom
- return false;
- }
-
- /**
- * $left_id and $right_id define the scope of the nodes that are affected by the move.
- * $diff_up and $diff_down are the values to substract or add to each node's left_id
- * and right_id in order to move them up or down.
- * $move_up_left and $move_up_right define the scope of the nodes that are moving
- * up. Other nodes in the scope of ($left_id, $right_id) are considered to move down.
- */
- if ($action == 'move_up')
- {
- $left_id = (int) $target['left_id'];
- $right_id = (int) $module_row['right_id'];
-
- $diff_up = (int) ($module_row['left_id'] - $target['left_id']);
- $diff_down = (int) ($module_row['right_id'] + 1 - $module_row['left_id']);
-
- $move_up_left = (int) $module_row['left_id'];
- $move_up_right = (int) $module_row['right_id'];
- }
- else
- {
- $left_id = (int) $module_row['left_id'];
- $right_id = (int) $target['right_id'];
-
- $diff_up = (int) ($module_row['right_id'] + 1 - $module_row['left_id']);
- $diff_down = (int) ($target['right_id'] - $module_row['right_id']);
-
- $move_up_left = (int) ($module_row['right_id'] + 1);
- $move_up_right = (int) $target['right_id'];
- }
-
- // Now do the dirty job
- $sql = 'UPDATE ' . MODULES_TABLE . "
- SET left_id = left_id + CASE
- WHEN left_id BETWEEN {$move_up_left} AND {$move_up_right} THEN -{$diff_up}
- ELSE {$diff_down}
- END,
- right_id = right_id + CASE
- WHEN right_id BETWEEN {$move_up_left} AND {$move_up_right} THEN -{$diff_up}
- ELSE {$diff_down}
- END
- WHERE module_class = '" . $db->sql_escape($this->module_class) . "'
- AND left_id BETWEEN {$left_id} AND {$right_id}
- AND right_id BETWEEN {$left_id} AND {$right_id}";
- $db->sql_query($sql);
-
- $this->remove_cache_file();
-
- return $this->lang_name($target['module_langname']);
- }
}
diff --git a/phpBB/includes/acp/acp_permission_roles.php b/phpBB/includes/acp/acp_permission_roles.php
index cd3616208d..21c751b61a 100644
--- a/phpBB/includes/acp/acp_permission_roles.php
+++ b/phpBB/includes/acp/acp_permission_roles.php
@@ -28,7 +28,7 @@ class acp_permission_roles
{
global $db, $user, $auth, $template, $cache, $phpbb_container;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
- global $request;
+ global $request, $phpbb_log;
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
include_once($phpbb_root_path . 'includes/acp/auth.' . $phpEx);
@@ -41,8 +41,8 @@ class acp_permission_roles
$this->tpl_name = 'acp_permission_roles';
$submit = (isset($_POST['submit'])) ? true : false;
- $role_id = request_var('role_id', 0);
- $action = request_var('action', '');
+ $role_id = $request->variable('role_id', 0);
+ $action = $request->variable('action', '');
$action = (isset($_POST['add'])) ? 'add' : $action;
$form_name = 'acp_permissions';
@@ -109,7 +109,7 @@ class acp_permission_roles
$this->remove_role($role_id, $permission_type);
$role_name = (!empty($user->lang[$role_row['role_name']])) ? $user->lang[$role_row['role_name']] : $role_row['role_name'];
- add_log('admin', 'LOG_' . strtoupper($permission_type) . 'ROLE_REMOVED', $role_name);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_' . strtoupper($permission_type) . 'ROLE_REMOVED', false, array($role_name));
trigger_error($user->lang['ROLE_DELETED'] . adm_back_link($this->u_action));
}
else
@@ -148,9 +148,9 @@ class acp_permission_roles
trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING);
}
- $role_name = utf8_normalize_nfc(request_var('role_name', '', true));
- $role_description = utf8_normalize_nfc(request_var('role_description', '', true));
- $auth_settings = request_var('setting', array('' => 0));
+ $role_name = $request->variable('role_name', '', true);
+ $role_description = $request->variable('role_description', '', true);
+ $auth_settings = $request->variable('setting', array('' => 0));
if (!$role_name)
{
@@ -212,7 +212,7 @@ class acp_permission_roles
$this->auth_admin->acl_set_role($role_id, $auth_settings);
$role_name = (!empty($user->lang[$role_name])) ? $user->lang[$role_name] : $role_name;
- add_log('admin', 'LOG_' . strtoupper($permission_type) . 'ROLE_' . strtoupper($action), $role_name);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_' . strtoupper($permission_type) . 'ROLE_' . strtoupper($action), false, array($role_name));
trigger_error($user->lang['ROLE_' . strtoupper($action) . '_SUCCESS'] . adm_back_link($this->u_action));
@@ -225,11 +225,11 @@ class acp_permission_roles
{
case 'add':
- $options_from = request_var('options_from', 0);
+ $options_from = $request->variable('options_from', 0);
$role_row = array(
- 'role_name' => utf8_normalize_nfc(request_var('role_name', '', true)),
- 'role_description' => utf8_normalize_nfc(request_var('role_description', '', true)),
+ 'role_name' => $request->variable('role_name', '', true),
+ 'role_description' => $request->variable('role_description', '', true),
'role_type' => $permission_type,
);
@@ -299,6 +299,7 @@ class acp_permission_roles
trigger_error($user->lang['NO_ROLE_SELECTED'] . adm_back_link($this->u_action), E_USER_WARNING);
}
+ /* @var $phpbb_permissions \phpbb\permissions */
$phpbb_permissions = $phpbb_container->get('acl.permissions');
$template->assign_vars(array(
@@ -413,7 +414,7 @@ class acp_permission_roles
$db->sql_freeresult($result);
// Display assigned items?
- $display_item = request_var('display_item', 0);
+ $display_item = $request->variable('display_item', 0);
// Select existing roles
$sql = 'SELECT *
@@ -471,6 +472,7 @@ class acp_permission_roles
{
global $template, $user, $phpbb_container;
+ /* @var $phpbb_permissions \phpbb\permissions */
$phpbb_permissions = $phpbb_container->get('acl.permissions');
$content_array = $categories = array();
diff --git a/phpBB/includes/acp/acp_permissions.php b/phpBB/includes/acp/acp_permissions.php
index cb408e304f..1c54ce2c65 100644
--- a/phpBB/includes/acp/acp_permissions.php
+++ b/phpBB/includes/acp/acp_permissions.php
@@ -23,11 +23,15 @@ class acp_permissions
{
var $u_action;
var $permission_dropdown;
+
+ /**
+ * @var $phpbb_permissions \phpbb\permissions
+ */
protected $permissions;
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache, $phpbb_container;
+ global $db, $user, $auth, $template, $cache, $phpbb_container, $request;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
@@ -45,9 +49,9 @@ class acp_permissions
// Trace has other vars
if ($mode == 'trace')
{
- $user_id = request_var('u', 0);
- $forum_id = request_var('f', 0);
- $permission = request_var('auth', '');
+ $user_id = $request->variable('u', 0);
+ $forum_id = $request->variable('f', 0);
+ $permission = $request->variable('auth', '');
$this->tpl_name = 'permission_trace';
@@ -76,20 +80,20 @@ class acp_permissions
}
// Set some vars
- $action = request_var('action', array('' => 0));
+ $action = $request->variable('action', array('' => 0));
$action = key($action);
$action = (isset($_POST['psubmit'])) ? 'apply_permissions' : $action;
- $all_forums = request_var('all_forums', 0);
- $subforum_id = request_var('subforum_id', 0);
- $forum_id = request_var('forum_id', array(0));
+ $all_forums = $request->variable('all_forums', 0);
+ $subforum_id = $request->variable('subforum_id', 0);
+ $forum_id = $request->variable('forum_id', array(0));
- $username = request_var('username', array(''), true);
- $usernames = request_var('usernames', '', true);
- $user_id = request_var('user_id', array(0));
+ $username = $request->variable('username', array(''), true);
+ $usernames = $request->variable('usernames', '', true);
+ $user_id = $request->variable('user_id', array(0));
- $group_id = request_var('group_id', array(0));
- $select_all_groups = request_var('select_all_groups', 0);
+ $group_id = $request->variable('group_id', array(0));
+ $select_all_groups = $request->variable('select_all_groups', 0);
$form_name = 'acp_permissions';
add_form_key($form_name);
@@ -228,7 +232,7 @@ class acp_permissions
);
// Get permission type
- $permission_type = request_var('type', $this->permission_dropdown[0]);
+ $permission_type = $request->variable('type', $this->permission_dropdown[0]);
if (!in_array($permission_type, $this->permission_dropdown))
{
@@ -670,7 +674,7 @@ class acp_permissions
global $db, $cache, $user, $auth;
global $request;
- $psubmit = request_var('psubmit', array(0 => array(0 => 0)));
+ $psubmit = $request->variable('psubmit', array(0 => array(0 => 0)));
// User or group to be set?
$ug_type = (sizeof($user_id)) ? 'user' : 'group';
@@ -700,7 +704,7 @@ class acp_permissions
$assigned_role = (isset($roles[$ug_id][$forum_id])) ? (int) $roles[$ug_id][$forum_id] : 0;
// Do the admin want to set these permissions to other items too?
- $inherit = request_var('inherit', array(0 => array(0)));
+ $inherit = $request->variable('inherit', array(0 => array(0)));
$ug_id = array($ug_id);
$forum_id = array($forum_id);
@@ -905,7 +909,7 @@ class acp_permissions
*/
function log_action($mode, $action, $permission_type, $ug_type, $ug_id, $forum_id)
{
- global $db, $user;
+ global $db, $user, $phpbb_log, $phpbb_container;
if (!is_array($ug_id))
{
@@ -922,10 +926,14 @@ class acp_permissions
$sql .= $db->sql_in_set(($ug_type == 'group') ? 'group_id' : 'user_id', array_map('intval', $ug_id));
$result = $db->sql_query($sql);
+ /** @var \phpbb\group\helper $group_helper */
+ $group_helper = $phpbb_container->get('group_helper');
+
$l_ug_list = '';
while ($row = $db->sql_fetchrow($result))
{
- $l_ug_list .= (($l_ug_list != '') ? ', ' : '') . ((isset($row['group_type']) && $row['group_type'] == GROUP_SPECIAL) ? '<span class="sep">' . $user->lang['G_' . $row['name']] . '</span>' : $row['name']);
+ $group_name = $group_helper->get_name($row['name']);
+ $l_ug_list .= (($l_ug_list != '') ? ', ' : '') . ((isset($row['group_type']) && $row['group_type'] == GROUP_SPECIAL) ? '<span class="sep">' . $group_name . '</span>' : $group_name);
}
$db->sql_freeresult($result);
@@ -933,7 +941,7 @@ class acp_permissions
if ($forum_id[0] == 0)
{
- add_log('admin', 'LOG_ACL_' . strtoupper($action) . '_' . strtoupper($mode) . '_' . strtoupper($permission_type), $l_ug_list);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ACL_' . strtoupper($action) . '_' . strtoupper($mode) . '_' . strtoupper($permission_type), false, array($l_ug_list));
}
else
{
@@ -950,7 +958,7 @@ class acp_permissions
}
$db->sql_freeresult($result);
- add_log('admin', 'LOG_ACL_' . strtoupper($action) . '_' . strtoupper($mode) . '_' . strtoupper($permission_type), $l_forum_list, $l_ug_list);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ACL_' . strtoupper($action) . '_' . strtoupper($mode) . '_' . strtoupper($permission_type), false, array($l_forum_list, $l_ug_list));
}
}
@@ -959,7 +967,7 @@ class acp_permissions
*/
function permission_trace($user_id, $forum_id, $permission)
{
- global $db, $template, $user, $auth;
+ global $db, $template, $user, $auth, $request, $phpbb_container;
if ($user_id != $user->data['user_id'])
{
@@ -975,6 +983,9 @@ class acp_permissions
trigger_error('NO_USERS', E_USER_ERROR);
}
+ /** @var \phpbb\group\helper $group_helper */
+ $group_helper = $phpbb_container->get('group_helper');
+
$forum_name = false;
if ($forum_id)
@@ -987,7 +998,7 @@ class acp_permissions
$db->sql_freeresult($result);
}
- $back = request_var('back', 0);
+ $back = $request->variable('back', 0);
$template->assign_vars(array(
'PERMISSION' => $this->permissions->get_permission_lang($permission),
@@ -1021,7 +1032,7 @@ class acp_permissions
{
$groups[$row['group_id']] = array(
'auth_setting' => ACL_NO,
- 'group_name' => ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']
+ 'group_name' => $group_helper->get_name($row['group_name']),
);
}
$db->sql_freeresult($result);
@@ -1178,7 +1189,7 @@ class acp_permissions
*/
function copy_forum_permissions()
{
- global $db, $auth, $cache, $template, $user;
+ global $db, $auth, $cache, $template, $user, $request;
$user->add_lang('acp/forums');
@@ -1186,8 +1197,8 @@ class acp_permissions
if ($submit)
{
- $src = request_var('src_forum_id', 0);
- $dest = request_var('dest_forum_ids', array(0));
+ $src = $request->variable('src_forum_id', 0);
+ $dest = $request->variable('dest_forum_ids', array(0));
if (confirm_box(true))
{
@@ -1229,7 +1240,10 @@ class acp_permissions
*/
function retrieve_defined_user_groups($permission_scope, $forum_id, $permission_type)
{
- global $db, $user;
+ global $db, $phpbb_container;
+
+ /** @var \phpbb\group\helper $group_helper */
+ $group_helper = $phpbb_container->get('group_helper');
$sql_forum_id = ($permission_scope == 'global') ? 'AND a.forum_id = 0' : ((sizeof($forum_id)) ? 'AND ' . $db->sql_in_set('a.forum_id', $forum_id) : 'AND a.forum_id <> 0');
@@ -1304,7 +1318,7 @@ class acp_permissions
$defined_group_ids = array();
while ($row = $db->sql_fetchrow($result))
{
- $s_defined_group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
+ $s_defined_group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '">' . $group_helper->get_name($row['group_name']) . '</option>';
$defined_group_ids[] = $row['group_id'];
}
$db->sql_freeresult($result);
diff --git a/phpBB/includes/acp/acp_profile.php b/phpBB/includes/acp/acp_profile.php
index 43668b8ad5..9b4fdaf993 100644
--- a/phpBB/includes/acp/acp_profile.php
+++ b/phpBB/includes/acp/acp_profile.php
@@ -25,13 +25,17 @@ class acp_profile
var $edit_lang_id;
var $lang_defs;
+
+ /**
+ * @var \phpbb\di\service_collection
+ */
protected $type_collection;
function main($id, $mode)
{
global $config, $db, $user, $auth, $template, $cache;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix;
- global $request, $phpbb_container, $phpbb_dispatcher;
+ global $request, $phpbb_container, $phpbb_log, $phpbb_dispatcher;
include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
@@ -41,7 +45,7 @@ class acp_profile
$this->page_title = 'ACP_CUSTOM_PROFILE_FIELDS';
$field_id = $request->variable('field_id', 0);
- $action = (isset($_POST['create'])) ? 'create' : request_var('action', '');
+ $action = (isset($_POST['create'])) ? 'create' : $request->variable('action', '');
$error = array();
$s_hidden_fields = '';
@@ -51,6 +55,7 @@ class acp_profile
trigger_error($user->lang['NO_FIELD_ID'] . adm_back_link($this->u_action), E_USER_WARNING);
}
+ /* @var $cp \phpbb\profilefields\manager */
$cp = $phpbb_container->get('profilefields.manager');
$this->type_collection = $phpbb_container->get('profilefields.type_collection');
@@ -112,6 +117,7 @@ class acp_profile
$db->sql_query('DELETE FROM ' . PROFILE_FIELDS_LANG_TABLE . " WHERE field_id = $field_id");
$db->sql_query('DELETE FROM ' . PROFILE_LANG_TABLE . " WHERE field_id = $field_id");
+ /* @var $db_tools \phpbb\db\tools\tools_interface */
$db_tools = $phpbb_container->get('dbal.tools');
$db_tools->sql_column_remove(PROFILE_FIELDS_DATA_TABLE, 'pf_' . $field_ident);
@@ -137,7 +143,7 @@ class acp_profile
$db->sql_transaction('commit');
- add_log('admin', 'LOG_PROFILE_FIELD_REMOVED', $field_ident);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_PROFILE_FIELD_REMOVED', false, array($field_ident));
trigger_error($user->lang['REMOVED_PROFILE_FIELD'] . adm_back_link($this->u_action));
}
else
@@ -178,7 +184,7 @@ class acp_profile
$field_ident = (string) $db->sql_fetchfield('field_ident');
$db->sql_freeresult($result);
- add_log('admin', 'LOG_PROFILE_FIELD_ACTIVATE', $field_ident);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_PROFILE_FIELD_ACTIVATE', false, array($field_ident));
if ($request->is_ajax())
{
@@ -214,7 +220,7 @@ class acp_profile
));
}
- add_log('admin', 'LOG_PROFILE_FIELD_DEACTIVATE', $field_ident);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_PROFILE_FIELD_DEACTIVATE', false, array($field_ident));
trigger_error($user->lang['PROFILE_FIELD_DEACTIVATED'] . adm_back_link($this->u_action));
@@ -255,7 +261,7 @@ class acp_profile
case 'create':
case 'edit':
- $step = request_var('step', 1);
+ $step = $request->variable('step', 1);
$submit = (isset($_REQUEST['next']) || isset($_REQUEST['prev'])) ? true : false;
$save = (isset($_REQUEST['save'])) ? true : false;
@@ -319,7 +325,7 @@ class acp_profile
// We are adding a new field, define basic params
$lang_options = $field_row = array();
- $field_type = request_var('field_type', '');
+ $field_type = $request->variable('field_type', '');
if (!isset($this->type_collection[$field_type]))
{
@@ -328,7 +334,7 @@ class acp_profile
$profile_field = $this->type_collection[$field_type];
$field_row = array_merge($profile_field->get_default_option_values(), array(
- 'field_ident' => str_replace(' ', '_', utf8_clean_string(request_var('field_ident', '', true))),
+ 'field_ident' => str_replace(' ', '_', utf8_clean_string($request->variable('field_ident', '', true))),
'field_required' => 0,
'field_show_novalue'=> 0,
'field_hide' => 0,
@@ -341,7 +347,7 @@ class acp_profile
'field_is_contact' => 0,
'field_contact_desc'=> '',
'field_contact_url' => '',
- 'lang_name' => utf8_normalize_nfc(request_var('field_ident', '', true)),
+ 'lang_name' => $request->variable('field_ident', '', true),
'lang_explain' => '',
'lang_default_value'=> '')
);
@@ -397,7 +403,7 @@ class acp_profile
$options = $profile_field->prepare_options_form($exclude, $visibility_ary);
- $cp->vars['field_ident'] = ($action == 'create' && $step == 1) ? utf8_clean_string(request_var('field_ident', $field_row['field_ident'], true)) : request_var('field_ident', $field_row['field_ident']);
+ $cp->vars['field_ident'] = ($action == 'create' && $step == 1) ? utf8_clean_string($request->variable('field_ident', $field_row['field_ident'], true)) : $request->variable('field_ident', $field_row['field_ident']);
$cp->vars['lang_name'] = $request->variable('lang_name', $field_row['lang_name'], true);
$cp->vars['lang_explain'] = $request->variable('lang_explain', $field_row['lang_explain'], true);
$cp->vars['lang_default_value'] = $request->variable('lang_default_value', $field_row['lang_default_value'], true);
@@ -436,7 +442,7 @@ class acp_profile
// step 2
foreach ($exclude[2] as $key)
{
- $var = utf8_normalize_nfc(request_var($key, $field_row[$key], true));
+ $var = $request->variable($key, $field_row[$key], true);
$field_data = $cp->vars;
$var = $profile_field->get_excluded_options($key, $action, $var, $field_data, 2);
@@ -482,7 +488,7 @@ class acp_profile
foreach ($exclude[3] as $key)
{
- $cp->vars[$key] = utf8_normalize_nfc(request_var($key, array(0 => ''), true));
+ $cp->vars[$key] = $request->variable($key, array(0 => ''), true);
if (!$cp->vars[$key] && $action == 'edit')
{
@@ -766,7 +772,7 @@ class acp_profile
*/
function build_language_options(&$cp, $field_type, $action = 'create')
{
- global $user, $config, $db, $phpbb_container;
+ global $user, $config, $db, $phpbb_container, $request;
$default_lang_id = (!empty($this->edit_lang_id)) ? $this->edit_lang_id : $this->lang_defs['iso'][$config['default_lang']];
@@ -807,7 +813,7 @@ class acp_profile
$lang_options[$lang_id]['lang_iso'] = $lang_iso;
foreach ($options as $field => $field_type)
{
- $value = ($action == 'create') ? utf8_normalize_nfc(request_var('l_' . $field, array(0 => ''), true)) : $cp->vars['l_' . $field];
+ $value = ($action == 'create') ? $request->variable('l_' . $field, array(0 => ''), true) : $cp->vars['l_' . $field];
if ($field == 'lang_options')
{
$var = (!isset($cp->vars['l_lang_options'][$lang_id]) || !is_array($cp->vars['l_lang_options'][$lang_id])) ? $cp->vars['lang_options'] : $cp->vars['l_lang_options'][$lang_id];
@@ -863,9 +869,9 @@ class acp_profile
*/
function save_profile_field(&$cp, $field_type, $action = 'create')
{
- global $db, $config, $user, $phpbb_container, $phpbb_dispatcher;
+ global $db, $config, $user, $phpbb_container, $phpbb_log, $request, $phpbb_dispatcher;
- $field_id = request_var('field_id', 0);
+ $field_id = $request->variable('field_id', 0);
// Collect all information, if something is going wrong, abort the operation
$profile_sql = $profile_lang = $empty_lang = $profile_lang_fields = array();
@@ -952,7 +958,7 @@ class acp_profile
if ($action == 'create')
{
$field_ident = 'pf_' . $field_ident;
-
+ /* @var $db_tools \phpbb\db\tools\tools_interface */
$db_tools = $phpbb_container->get('dbal.tools');
$db_tools->sql_column_add(PROFILE_FIELDS_DATA_TABLE, $field_ident, array($profile_field->get_database_column_type(), null));
}
@@ -1151,12 +1157,12 @@ class acp_profile
if ($action == 'edit')
{
- add_log('admin', 'LOG_PROFILE_FIELD_EDIT', $cp->vars['field_ident'] . ':' . $cp->vars['lang_name']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_PROFILE_FIELD_EDIT', false, array($cp->vars['field_ident'] . ':' . $cp->vars['lang_name']));
trigger_error($user->lang['CHANGED_PROFILE_FIELD'] . adm_back_link($this->u_action));
}
else
{
- add_log('admin', 'LOG_PROFILE_FIELD_CREATE', substr($field_ident, 3) . ':' . $cp->vars['lang_name']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_PROFILE_FIELD_CREATE', false, array(substr($field_ident, 3) . ':' . $cp->vars['lang_name']));
trigger_error($user->lang['ADDED_PROFILE_FIELD'] . adm_back_link($this->u_action));
}
}
diff --git a/phpBB/includes/acp/acp_prune.php b/phpBB/includes/acp/acp_prune.php
index e17399e3d9..025ace9809 100644
--- a/phpBB/includes/acp/acp_prune.php
+++ b/phpBB/includes/acp/acp_prune.php
@@ -51,11 +51,11 @@ class acp_prune
*/
function prune_forums($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
+ global $db, $user, $auth, $template, $cache, $phpbb_log, $request;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
- $all_forums = request_var('all_forums', 0);
- $forum_id = request_var('f', array(0));
+ $all_forums = $request->variable('all_forums', 0);
+ $forum_id = $request->variable('f', array(0));
$submit = (isset($_POST['submit'])) ? true : false;
if ($all_forums)
@@ -77,14 +77,14 @@ class acp_prune
{
if (confirm_box(true))
{
- $prune_posted = request_var('prune_days', 0);
- $prune_viewed = request_var('prune_vieweddays', 0);
+ $prune_posted = $request->variable('prune_days', 0);
+ $prune_viewed = $request->variable('prune_vieweddays', 0);
$prune_all = (!$prune_posted && !$prune_viewed) ? true : false;
$prune_flags = 0;
- $prune_flags += (request_var('prune_old_polls', 0)) ? 2 : 0;
- $prune_flags += (request_var('prune_announce', 0)) ? 4 : 0;
- $prune_flags += (request_var('prune_sticky', 0)) ? 8 : 0;
+ $prune_flags += ($request->variable('prune_old_polls', 0)) ? 2 : 0;
+ $prune_flags += ($request->variable('prune_announce', 0)) ? 4 : 0;
+ $prune_flags += ($request->variable('prune_sticky', 0)) ? 8 : 0;
// Convert days to seconds for timestamp functions...
$prunedate_posted = time() - ($prune_posted * 86400);
@@ -153,7 +153,8 @@ class acp_prune
// Sync all pruned forums at once
sync('forum', 'forum_id', $prune_ids, true, true);
- add_log('admin', 'LOG_PRUNE', $log_data);
+
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_PRUNE', false, array($log_data));
}
$db->sql_freeresult($result);
@@ -168,11 +169,11 @@ class acp_prune
'all_forums' => $all_forums,
'f' => $forum_id,
- 'prune_days' => request_var('prune_days', 0),
- 'prune_vieweddays' => request_var('prune_vieweddays', 0),
- 'prune_old_polls' => request_var('prune_old_polls', 0),
- 'prune_announce' => request_var('prune_announce', 0),
- 'prune_sticky' => request_var('prune_sticky', 0),
+ 'prune_days' => $request->variable('prune_days', 0),
+ 'prune_vieweddays' => $request->variable('prune_vieweddays', 0),
+ 'prune_old_polls' => $request->variable('prune_old_polls', 0),
+ 'prune_announce' => $request->variable('prune_announce', 0),
+ 'prune_sticky' => $request->variable('prune_sticky', 0),
)));
}
}
@@ -228,8 +229,11 @@ class acp_prune
*/
function prune_users($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $db, $user, $auth, $template, $cache, $phpbb_log, $request;
+ global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container;
+
+ /** @var \phpbb\group\helper $group_helper */
+ $group_helper = $phpbb_container->get('group_helper');
$user->add_lang('memberlist');
@@ -237,8 +241,8 @@ class acp_prune
if ($prune)
{
- $action = request_var('action', 'deactivate');
- $deleteposts = request_var('deleteposts', 0);
+ $action = $request->variable('action', 'deactivate');
+ $deleteposts = $request->variable('deleteposts', 0);
if (confirm_box(true))
{
@@ -268,7 +272,7 @@ class acp_prune
}
}
- add_log('admin', $l_log, implode(', ', $usernames));
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, $l_log, false, array(implode(', ', $usernames)));
$msg = $user->lang['USER_' . strtoupper($action) . '_SUCCESS'];
}
else
@@ -310,8 +314,8 @@ class acp_prune
'mode' => $mode,
'prune' => 1,
- 'deleteposts' => request_var('deleteposts', 0),
- 'action' => request_var('action', ''),
+ 'deleteposts' => $request->variable('deleteposts', 0),
+ 'action' => $request->variable('action', ''),
)), 'confirm_body_prune.html');
}
}
@@ -341,7 +345,7 @@ class acp_prune
$s_group_list = '';
while ($row = $db->sql_fetchrow($result))
{
- $s_group_list .= '<option value="' . $row['group_id'] . '">' . $row['group_name'] . '</option>';
+ $s_group_list .= '<option value="' . $row['group_id'] . '">' . $group_helper->get_name($row['group_name']) . '</option>';
}
$db->sql_freeresult($result);
@@ -368,9 +372,9 @@ class acp_prune
{
global $user, $db, $request;
- $users_by_name = request_var('users', '', true);
- $users_by_id = request_var('user_ids', array(0));
- $group_id = request_var('group_id', 0);
+ $users_by_name = $request->variable('users', '', true);
+ $users_by_id = $request->variable('user_ids', array(0));
+ $group_id = $request->variable('group_id', 0);
$posts_on_queue = (trim($request->variable('posts_on_queue', '')) === '') ? false : $request->variable('posts_on_queue', 0);
if ($users_by_name)
@@ -387,15 +391,15 @@ class acp_prune
}
else
{
- $username = request_var('username', '', true);
- $email = request_var('email', '');
-
- $active_select = request_var('active_select', 'lt');
- $count_select = request_var('count_select', 'eq');
- $queue_select = request_var('queue_select', 'gt');
- $joined_before = request_var('joined_before', '');
- $joined_after = request_var('joined_after', '');
- $active = request_var('active', '');
+ $username = $request->variable('username', '', true);
+ $email = $request->variable('email', '');
+
+ $active_select = $request->variable('active_select', 'lt');
+ $count_select = $request->variable('count_select', 'eq');
+ $queue_select = $request->variable('queue_select', 'gt');
+ $joined_before = $request->variable('joined_before', '');
+ $joined_after = $request->variable('joined_after', '');
+ $active = $request->variable('active', '');
$count = ($request->variable('count', '') === '') ? false : $request->variable('count', 0);
diff --git a/phpBB/includes/acp/acp_ranks.php b/phpBB/includes/acp/acp_ranks.php
index 5885de57ec..2921d6500b 100644
--- a/phpBB/includes/acp/acp_ranks.php
+++ b/phpBB/includes/acp/acp_ranks.php
@@ -26,15 +26,15 @@ class acp_ranks
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache, $request, $phpbb_dispatcher;
- global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_log;
$user->add_lang('acp/posting');
// Set up general vars
- $action = request_var('action', '');
+ $action = $request->variable('action', '');
$action = (isset($_POST['add'])) ? 'add' : $action;
$action = (isset($_POST['save'])) ? 'save' : $action;
- $rank_id = request_var('id', 0);
+ $rank_id = $request->variable('id', 0);
$this->tpl_name = 'acp_ranks';
$this->page_title = 'ACP_MANAGE_RANKS';
@@ -50,10 +50,10 @@ class acp_ranks
{
trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING);
}
- $rank_title = utf8_normalize_nfc(request_var('title', '', true));
- $special_rank = request_var('special_rank', 0);
- $min_posts = ($special_rank) ? 0 : max(0, request_var('min_posts', 0));
- $rank_image = request_var('rank_image', '');
+ $rank_title = $request->variable('title', '', true);
+ $special_rank = $request->variable('special_rank', 0);
+ $min_posts = ($special_rank) ? 0 : max(0, $request->variable('min_posts', 0));
+ $rank_image = $request->variable('rank_image', '');
// The rank image has to be a jpg, gif or png
if ($rank_image != '' && !preg_match('#(\.gif|\.png|\.jpg|\.jpeg)$#i', $rank_image))
@@ -89,14 +89,14 @@ class acp_ranks
$sql = 'UPDATE ' . RANKS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . " WHERE rank_id = $rank_id";
$message = $user->lang['RANK_UPDATED'];
- add_log('admin', 'LOG_RANK_UPDATED', $rank_title);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_RANK_UPDATED', false, array($rank_title));
}
else
{
$sql = 'INSERT INTO ' . RANKS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
$message = $user->lang['RANK_ADDED'];
- add_log('admin', 'LOG_RANK_ADDED', $rank_title);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_RANK_ADDED', false, array($rank_title));
}
$db->sql_query($sql);
@@ -133,7 +133,7 @@ class acp_ranks
$cache->destroy('_ranks');
- add_log('admin', 'LOG_RANK_REMOVED', $rank_title);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_RANK_REMOVED', false, array($rank_title));
if ($request->is_ajax())
{
diff --git a/phpBB/includes/acp/acp_reasons.php b/phpBB/includes/acp/acp_reasons.php
index 3d7ccf422c..56f0296423 100644
--- a/phpBB/includes/acp/acp_reasons.php
+++ b/phpBB/includes/acp/acp_reasons.php
@@ -27,14 +27,14 @@ class acp_reasons
{
global $db, $user, $auth, $template, $cache;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
- global $request;
+ global $request, $phpbb_log;
$user->add_lang(array('mcp', 'acp/posting'));
// Set up general vars
- $action = request_var('action', '');
+ $action = $request->variable('action', '');
$submit = (isset($_POST['submit'])) ? true : false;
- $reason_id = request_var('id', 0);
+ $reason_id = $request->variable('id', 0);
$this->tpl_name = 'acp_reasons';
$this->page_title = 'ACP_REASONS';
@@ -50,8 +50,8 @@ class acp_reasons
case 'edit':
$reason_row = array(
- 'reason_title' => utf8_normalize_nfc(request_var('reason_title', '', true)),
- 'reason_description' => utf8_normalize_nfc(request_var('reason_description', '', true)),
+ 'reason_title' => $request->variable('reason_title', '', true),
+ 'reason_description' => $request->variable('reason_description', '', true),
);
if ($submit)
@@ -139,7 +139,7 @@ class acp_reasons
$log = 'UPDATED';
}
- add_log('admin', 'LOG_REASON_' . $log, $reason_row['reason_title']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_REASON_' . $log, false, array($reason_row['reason_title']));
trigger_error($user->lang['REASON_' . $log] . adm_back_link($this->u_action));
}
}
@@ -264,7 +264,7 @@ class acp_reasons
$db->sql_query('DELETE FROM ' . REPORTS_REASONS_TABLE . ' WHERE reason_id = ' . $reason_id);
- add_log('admin', 'LOG_REASON_REMOVED', $reason_row['reason_title']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_REASON_REMOVED', false, array($reason_row['reason_title']));
trigger_error($user->lang['REASON_REMOVED'] . adm_back_link($this->u_action));
}
else
diff --git a/phpBB/includes/acp/acp_search.php b/phpBB/includes/acp/acp_search.php
index abb8301507..25fc1ed8dc 100644
--- a/phpBB/includes/acp/acp_search.php
+++ b/phpBB/includes/acp/acp_search.php
@@ -50,7 +50,7 @@ class acp_search
function settings($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
+ global $db, $user, $auth, $template, $cache, $phpbb_log, $request;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$submit = (isset($_POST['submit'])) ? true : false;
@@ -104,8 +104,8 @@ class acp_search
unset($search);
unset($error);
- $cfg_array = (isset($_REQUEST['config'])) ? request_var('config', array('' => ''), true) : array();
- $updated = request_var('updated', false);
+ $cfg_array = (isset($_REQUEST['config'])) ? $request->variable('config', array('' => ''), true) : array();
+ $updated = $request->variable('updated', false);
foreach ($settings as $config_name => $var_type)
{
@@ -133,7 +133,7 @@ class acp_search
// only change config if anything was actually changed
if ($submit && ($config[$config_name] != $config_value))
{
- set_config($config_name, $config_value);
+ $config->set($config_name, $config_value);
$updated = true;
}
}
@@ -143,7 +143,7 @@ class acp_search
$extra_message = '';
if ($updated)
{
- add_log('admin', 'LOG_CONFIG_SEARCH');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_CONFIG_SEARCH');
}
if (isset($cfg_array['search_type']) && in_array($cfg_array['search_type'], $search_types, true) && ($cfg_array['search_type'] != $config['search_type']))
@@ -157,11 +157,11 @@ class acp_search
{
if (!method_exists($search, 'init') || !($error = $search->init()))
{
- set_config('search_type', $cfg_array['search_type']);
+ $config->set('search_type', $cfg_array['search_type']);
if (!$updated)
{
- add_log('admin', 'LOG_CONFIG_SEARCH');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_CONFIG_SEARCH');
}
$extra_message = '<br />' . $user->lang['SWITCHED_SEARCH_BACKEND'] . '<br /><a href="' . append_sid("{$phpbb_admin_path}index.$phpEx", 'i=search&amp;mode=index') . '">&raquo; ' . $user->lang['GO_TO_SEARCH_INDEX'] . '</a>';
}
@@ -232,10 +232,10 @@ class acp_search
function index($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
+ global $db, $user, $auth, $template, $cache, $phpbb_log, $request;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
- $action = request_var('action', '');
+ $action = $request->variable('action', '');
$this->state = explode(',', $config['search_indexing_state']);
if (isset($_POST['cancel']))
@@ -250,7 +250,7 @@ class acp_search
switch ($action)
{
case 'progress_bar':
- $type = request_var('type', '');
+ $type = $request->variable('type', '');
$this->display_progress_bar($type);
break;
@@ -269,7 +269,7 @@ class acp_search
if (empty($this->state[0]))
{
- $this->state[0] = request_var('search_type', '');
+ $this->state[0] = $request->variable('search_type', '');
}
$this->search = null;
@@ -303,8 +303,7 @@ class acp_search
}
else
{
- $starttime = explode(' ', microtime());
- $starttime = $starttime[1] + $starttime[0];
+ $starttime = microtime(true);
$row_count = 0;
while (still_on_time() && $post_counter <= $this->max_post_id)
{
@@ -336,8 +335,7 @@ class acp_search
if ($post_counter <= $this->max_post_id)
{
- $mtime = explode(' ', microtime());
- $totaltime = $mtime[0] + $mtime[1] - $starttime;
+ $totaltime = microtime(true) - $starttime;
$rows_per_second = $row_count / $totaltime;
meta_refresh(1, append_sid($this->u_action . '&amp;action=delete&amp;skip_rows=' . $post_counter));
trigger_error($user->lang('SEARCH_INDEX_DELETE_REDIRECT', (int) $row_count, $post_counter, $rows_per_second));
@@ -349,7 +347,7 @@ class acp_search
$this->state = array('');
$this->save_state();
- add_log('admin', 'LOG_SEARCH_INDEX_REMOVED', $name);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_SEARCH_INDEX_REMOVED', false, array($name));
trigger_error($user->lang['SEARCH_INDEX_REMOVED'] . adm_back_link($this->u_action) . $this->close_popup_js());
break;
@@ -376,8 +374,7 @@ class acp_search
}
$db->sql_freeresult($result);
- $starttime = explode(' ', microtime());
- $starttime = $starttime[1] + $starttime[0];
+ $starttime = microtime(true);
$row_count = 0;
while (still_on_time() && $post_counter <= $this->max_post_id)
{
@@ -426,8 +423,7 @@ class acp_search
if ($post_counter <= $this->max_post_id)
{
- $mtime = explode(' ', microtime());
- $totaltime = $mtime[0] + $mtime[1] - $starttime;
+ $totaltime = microtime(true) - $starttime;
$rows_per_second = $row_count / $totaltime;
meta_refresh(1, append_sid($this->u_action . '&amp;action=create&amp;skip_rows=' . $post_counter));
trigger_error($user->lang('SEARCH_INDEX_CREATE_REDIRECT', (int) $row_count, $post_counter) . $user->lang('SEARCH_INDEX_CREATE_REDIRECT_RATE', $rows_per_second));
@@ -439,7 +435,7 @@ class acp_search
$this->state = array('');
$this->save_state();
- add_log('admin', 'LOG_SEARCH_INDEX_CREATED', $name);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_SEARCH_INDEX_CREATED', false, array($name));
trigger_error($user->lang['SEARCH_INDEX_CREATED'] . adm_back_link($this->u_action) . $this->close_popup_js());
break;
}
@@ -581,6 +577,8 @@ class acp_search
function save_state($state = false)
{
+ global $config;
+
if ($state)
{
$this->state = $state;
@@ -588,7 +586,7 @@ class acp_search
ksort($this->state);
- set_config('search_indexing_state', implode(',', $this->state), true);
+ $config->set('search_indexing_state', implode(',', $this->state), true);
}
/**
diff --git a/phpBB/includes/acp/acp_send_statistics.php b/phpBB/includes/acp/acp_send_statistics.php
index d178be2fb0..4c5786dbe9 100644
--- a/phpBB/includes/acp/acp_send_statistics.php
+++ b/phpBB/includes/acp/acp_send_statistics.php
@@ -38,7 +38,7 @@ class acp_send_statistics
if (!isset($config['questionnaire_unique_id']))
{
$install_id = unique_id();
- set_config('questionnaire_unique_id', $install_id);
+ $config->set('questionnaire_unique_id', $install_id);
}
else
{
diff --git a/phpBB/includes/acp/acp_styles.php b/phpBB/includes/acp/acp_styles.php
index a36a6c1ecd..de3ca5f787 100644
--- a/phpBB/includes/acp/acp_styles.php
+++ b/phpBB/includes/acp/acp_styles.php
@@ -32,6 +32,9 @@ class acp_styles
protected $styles_list_cols = 0;
protected $reserved_style_names = array('adm', 'admin', 'all');
+ /** @var \phpbb\config\config */
+ protected $config;
+
/** @var \phpbb\db\driver\driver_interface */
protected $db;
@@ -50,6 +53,9 @@ class acp_styles
/** @var \phpbb\auth\auth */
protected $auth;
+ /** @var \phpbb\textformatter\cache_interface */
+ protected $text_formatter_cache;
+
/** @var string */
protected $phpbb_root_path;
@@ -58,7 +64,7 @@ class acp_styles
public function main($id, $mode)
{
- global $db, $user, $phpbb_admin_path, $phpbb_root_path, $phpEx, $template, $request, $cache, $auth, $config;
+ global $db, $user, $phpbb_admin_path, $phpbb_root_path, $phpEx, $template, $request, $cache, $auth, $config, $phpbb_container;
$this->db = $db;
$this->user = $user;
@@ -66,6 +72,7 @@ class acp_styles
$this->request = $request;
$this->cache = $cache;
$this->auth = $auth;
+ $this->text_formatter_cache = $phpbb_container->get('text_formatter.cache');
$this->config = $config;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $phpEx;
@@ -213,6 +220,12 @@ class acp_styles
}
}
+ // Invalidate the text formatter's cache for the new styles to take effect
+ if (!empty($installed_names))
+ {
+ $this->text_formatter_cache->invalidate();
+ }
+
// Show message
if (!count($messages))
{
@@ -260,6 +273,8 @@ class acp_styles
*/
protected function action_uninstall_confirmed($ids, $delete_files)
{
+ global $user, $phpbb_log;
+
$default = $this->default_style;
$uninstalled = array();
$messages = array();
@@ -319,7 +334,7 @@ class acp_styles
// Log action
if (count($uninstalled))
{
- add_log('admin', 'LOG_STYLE_DELETE', implode(', ', $uninstalled));
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_STYLE_DELETE', false, array(implode(', ', $uninstalled)));
}
// Clear cache
@@ -391,6 +406,8 @@ class acp_styles
*/
protected function action_details()
{
+ global $user, $phpbb_log;
+
$id = $this->request->variable('id', 0);
if (!$id)
{
@@ -522,7 +539,8 @@ class acp_styles
$this->cache->purge();
}
}
- add_log('admin', 'LOG_STYLE_EDIT_DETAILS', $style['style_name']);
+
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_STYLE_EDIT_DETAILS', false, array($style['style_name']));
}
// Update default style
@@ -533,7 +551,7 @@ class acp_styles
{
trigger_error($this->user->lang['STYLE_DEFAULT_CHANGE_INACTIVE'] . adm_back_link($update_action), E_USER_WARNING);
}
- set_config('default_style', $id);
+ $this->config->set('default_style', $id);
$this->cache->purge();
}
@@ -1119,6 +1137,8 @@ class acp_styles
*/
protected function install_style($style)
{
+ global $user, $phpbb_log;
+
// Generate row
$sql_ary = array();
foreach ($style as $key => $value)
@@ -1140,7 +1160,7 @@ class acp_styles
$this->db->sql_transaction('commit');
- add_log('admin', 'LOG_STYLE_ADD', $sql_ary['style_name']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_STYLE_ADD', false, array($sql_ary['style_name']));
return $id;
}
diff --git a/phpBB/includes/acp/acp_update.php b/phpBB/includes/acp/acp_update.php
index 0167a06dbb..83604b8261 100644
--- a/phpBB/includes/acp/acp_update.php
+++ b/phpBB/includes/acp/acp_update.php
@@ -33,6 +33,7 @@ class acp_update
$this->tpl_name = 'acp_update';
$this->page_title = 'ACP_VERSION_CHECK';
+ /* @var $version_helper \phpbb\version_helper */
$version_helper = $phpbb_container->get('version_helper');
try
{
diff --git a/phpBB/includes/acp/acp_users.php b/phpBB/includes/acp/acp_users.php
index 8c17fb6311..bbc8e73cb8 100644
--- a/phpBB/includes/acp/acp_users.php
+++ b/phpBB/includes/acp/acp_users.php
@@ -34,15 +34,15 @@ class acp_users
global $config, $db, $user, $auth, $template, $cache;
global $phpbb_root_path, $phpbb_admin_path, $phpEx, $table_prefix, $file_uploads;
global $phpbb_dispatcher, $request;
- global $phpbb_container;
+ global $phpbb_container, $phpbb_log;
$user->add_lang(array('posting', 'ucp', 'acp/users'));
$this->tpl_name = 'acp_users';
$error = array();
- $username = utf8_normalize_nfc(request_var('username', '', true));
- $user_id = request_var('u', 0);
- $action = request_var('action', '');
+ $username = $request->variable('username', '', true);
+ $user_id = $request->variable('u', 0);
+ $action = $request->variable('action', '');
$submit = (isset($_POST['update']) && !isset($_POST['cancel'])) ? true : false;
@@ -57,7 +57,7 @@ class acp_users
$this->page_title = 'WHOIS';
$this->tpl_name = 'simple_body';
- $user_ip = phpbb_ip_normalise(request_var('user_ip', ''));
+ $user_ip = phpbb_ip_normalise($request->variable('user_ip', ''));
$domain = gethostbyaddr($user_ip);
$ipwhois = user_ipwhois($user_ip);
@@ -169,9 +169,9 @@ class acp_users
$user->add_lang('acp/ban');
- $delete = request_var('delete', 0);
- $delete_type = request_var('delete_type', '');
- $ip = request_var('ip', 'ip');
+ $delete = $request->variable('delete', 0);
+ $delete_type = $request->variable('delete_type', '');
+ $ip = $request->variable('ip', 'ip');
/**
* Run code at beginning of ACP users overview
@@ -220,7 +220,7 @@ class acp_users
{
user_delete($delete_type, $user_id, $user_row['username']);
- add_log('admin', 'LOG_USER_DELETED', $user_row['username']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_DELETED', false, array($user_row['username']));
trigger_error($user->lang['USER_DELETED'] . adm_back_link($this->u_action));
}
else
@@ -304,8 +304,8 @@ class acp_users
break;
}
- $ban_reason = utf8_normalize_nfc(request_var('ban_reason', $user->lang[$reason], true));
- $ban_give_reason = utf8_normalize_nfc(request_var('ban_give_reason', '', true));
+ $ban_reason = $request->variable('ban_reason', $user->lang[$reason], true);
+ $ban_give_reason = $request->variable('ban_give_reason', '', true);
// Log not used at the moment, we simply utilize the ban function.
$result = user_ban(substr($action, 3), $ban, 0, 0, 0, $ban_reason, $ban_give_reason);
@@ -381,8 +381,10 @@ class acp_users
$messenger->send(NOTIFY_EMAIL);
- add_log('admin', 'LOG_USER_REACTIVATE', $user_row['username']);
- add_log('user', $user_id, 'LOG_USER_REACTIVATE_USER');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_REACTIVATE', false, array($user_row['username']));
+ $phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_REACTIVATE_USER', false, array(
+ 'reportee_id' => $user_id
+ ));
trigger_error($user->lang['FORCE_REACTIVATION_SUCCESS'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
}
@@ -418,6 +420,7 @@ class acp_users
{
if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
{
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
$phpbb_notifications->delete_notifications('notification.type.admin_activate_user', $user_row['user_id']);
@@ -442,8 +445,10 @@ class acp_users
$message = ($user_row['user_type'] == USER_INACTIVE) ? 'USER_ADMIN_ACTIVATED' : 'USER_ADMIN_DEACTIVED';
$log = ($user_row['user_type'] == USER_INACTIVE) ? 'LOG_USER_ACTIVE' : 'LOG_USER_INACTIVE';
- add_log('admin', $log, $user_row['username']);
- add_log('user', $user_id, $log . '_USER');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, $log, false, array($user_row['username']));
+ $phpbb_log->add('user', $user->data['user_id'], $user->ip, $log . '_USER', false, array(
+ 'reportee_id' => $user_id
+ ));
trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
@@ -466,8 +471,10 @@ class acp_users
WHERE user_id = $user_id";
$db->sql_query($sql);
- add_log('admin', 'LOG_USER_DEL_SIG', $user_row['username']);
- add_log('user', $user_id, 'LOG_USER_DEL_SIG_USER');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_DEL_SIG', false, array($user_row['username']));
+ $phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_DEL_SIG_USER', false, array(
+ 'reportee_id' => $user_id
+ ));
trigger_error($user->lang['USER_ADMIN_SIG_REMOVED'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
@@ -481,11 +488,14 @@ class acp_users
}
// Delete old avatar if present
+ /* @var $phpbb_avatar_manager \phpbb\avatar\manager */
$phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
$phpbb_avatar_manager->handle_avatar_delete($db, $user, $phpbb_avatar_manager->clean_row($user_row, 'user'), USERS_TABLE, 'user_');
- add_log('admin', 'LOG_USER_DEL_AVATAR', $user_row['username']);
- add_log('user', $user_id, 'LOG_USER_DEL_AVATAR_USER');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_DEL_AVATAR', false, array($user_row['username']));
+ $phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_DEL_AVATAR_USER', false, array(
+ 'reportee_id' => $user_id
+ ));
trigger_error($user->lang['USER_ADMIN_AVATAR_REMOVED'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
break;
@@ -497,7 +507,7 @@ class acp_users
// Delete posts, attachments, etc.
delete_posts('poster_id', $user_id);
- add_log('admin', 'LOG_USER_DEL_POSTS', $user_row['username']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_DEL_POSTS', false, array($user_row['username']));
trigger_error($user->lang['USER_POSTS_DELETED'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
}
else
@@ -519,7 +529,7 @@ class acp_users
{
delete_attachments('user', $user_id);
- add_log('admin', 'LOG_USER_DEL_ATTACH', $user_row['username']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_DEL_ATTACH', false, array($user_row['username']));
trigger_error($user->lang['USER_ATTACHMENTS_REMOVED'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
}
else
@@ -565,7 +575,7 @@ class acp_users
delete_pm($user_id, $msg_ids, PRIVMSGS_OUTBOX);
- add_log('admin', 'LOG_USER_DEL_OUTBOX', $user_row['username']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_DEL_OUTBOX', false, array($user_row['username']));
$lang = 'EMPTIED';
}
@@ -594,7 +604,7 @@ class acp_users
$user->add_lang('acp/forums');
- $new_forum_id = request_var('new_f', 0);
+ $new_forum_id = $request->variable('new_f', 0);
if (!$new_forum_id)
{
@@ -736,8 +746,11 @@ class acp_users
sync('forum', 'forum_id', $forum_id_ary, false, true);
}
- add_log('admin', 'LOG_USER_MOVE_POSTS', $user_row['username'], $forum_info['forum_name']);
- add_log('user', $user_id, 'LOG_USER_MOVE_POSTS_USER', $forum_info['forum_name']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_MOVE_POSTS', false, array($user_row['username'], $forum_info['forum_name']));
+ $phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_MOVE_POSTS_USER', false, array(
+ 'reportee_id' => $user_id,
+ $forum_info['forum_name']
+ ));
trigger_error($user->lang['USER_POSTS_MOVED'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
@@ -749,7 +762,7 @@ class acp_users
{
remove_newly_registered($user_id, $user_row);
- add_log('admin', 'LOG_USER_REMOVED_NR', $user_row['username']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_REMOVED_NR', false, array($user_row['username']));
trigger_error($user->lang['USER_LIFTED_NR'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
}
else
@@ -781,9 +794,9 @@ class acp_users
// Handle registration info updates
$data = array(
- 'username' => utf8_normalize_nfc(request_var('user', $user_row['username'], true)),
- 'user_founder' => request_var('user_founder', ($user_row['user_type'] == USER_FOUNDER) ? 1 : 0),
- 'email' => strtolower(request_var('user_email', $user_row['user_email'])),
+ 'username' => $request->variable('user', $user_row['username'], true),
+ 'user_founder' => $request->variable('user_founder', ($user_row['user_type'] == USER_FOUNDER) ? 1 : 0),
+ 'email' => strtolower($request->variable('user_email', $user_row['user_email'])),
'new_password' => $request->variable('new_password', '', true),
'password_confirm' => $request->variable('password_confirm', '', true),
);
@@ -831,6 +844,7 @@ class acp_users
}
// Instantiate passwords manager
+ /* @var $passwords_manager \phpbb\passwords\manager */
$passwords_manager = $phpbb_container->get('passwords.manager');
// Which updates do we need to do?
@@ -903,7 +917,11 @@ class acp_users
$sql_ary['username'] = $update_username;
$sql_ary['username_clean'] = utf8_clean_string($update_username);
- add_log('user', $user_id, 'LOG_USER_UPDATE_NAME', $user_row['username'], $update_username);
+ $phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_UPDATE_NAME', false, array(
+ 'reportee_id' => $user_id,
+ $user_row['username'],
+ $update_username
+ ));
}
if ($update_email !== false)
@@ -913,7 +931,12 @@ class acp_users
'user_email_hash' => phpbb_email_hash($update_email),
);
- add_log('user', $user_id, 'LOG_USER_UPDATE_EMAIL', $user_row['username'], $user_row['user_email'], $update_email);
+ $phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_UPDATE_EMAIL', false, array(
+ 'reportee_id' => $user_id,
+ $user_row['username'],
+ $user_row['user_email'],
+ $update_email
+ ));
}
if ($update_password)
@@ -924,7 +947,11 @@ class acp_users
);
$user->reset_login_keys($user_id);
- add_log('user', $user_id, 'LOG_USER_NEW_PASSWORD', $user_row['username']);
+
+ $phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_NEW_PASSWORD', false, array(
+ 'reportee_id' => $user_id,
+ $user_row['username']
+ ));
}
if (sizeof($sql_ary))
@@ -943,7 +970,7 @@ class acp_users
// Let the users permissions being updated
$auth->acl_clear_prefetch($user_id);
- add_log('admin', 'LOG_USER_USER_UPDATE', $data['username']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_USER_UPDATE', false, array($data['username']));
trigger_error($user->lang['USER_OVERVIEW_UPDATED'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
}
@@ -1100,17 +1127,19 @@ class acp_users
$user->add_lang('mcp');
// Set up general vars
- $start = request_var('start', 0);
+ $start = $request->variable('start', 0);
$deletemark = (isset($_POST['delmarked'])) ? true : false;
$deleteall = (isset($_POST['delall'])) ? true : false;
- $marked = request_var('mark', array(0));
- $message = utf8_normalize_nfc(request_var('message', '', true));
+ $marked = $request->variable('mark', array(0));
+ $message = $request->variable('message', '', true);
+
+ /* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
// Sort keys
- $sort_days = request_var('st', 0);
- $sort_key = request_var('sk', 't');
- $sort_dir = request_var('sd', 'd');
+ $sort_days = $request->variable('st', 0);
+ $sort_key = $request->variable('sk', 't');
+ $sort_dir = $request->variable('sd', 'd');
// Delete entries if requested and able
if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs'))
@@ -1140,7 +1169,7 @@ class acp_users
$where_sql";
$db->sql_query($sql);
- add_log('admin', 'LOG_CLEAR_USER', $user_row['username']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_CLEAR_USER', false, array($user_row['username']));
}
}
@@ -1151,9 +1180,16 @@ class acp_users
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
- add_log('admin', 'LOG_USER_FEEDBACK', $user_row['username']);
- add_log('mod', 0, 0, 'LOG_USER_FEEDBACK', $user_row['username']);
- add_log('user', $user_id, 'LOG_USER_GENERAL', $message);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_FEEDBACK', false, array($user_row['username']));
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_USER_FEEDBACK', false, array(
+ 'forum_id' => 0,
+ 'topic_id' => 0,
+ $user_row['username']
+ ));
+ $phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_GENERAL', false, array(
+ 'reportee_id' => $user_id,
+ $message
+ ));
trigger_error($user->lang['USER_FEEDBACK_ADDED'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
}
@@ -1204,17 +1240,17 @@ class acp_users
$user->add_lang('mcp');
// Set up general vars
- $start = request_var('start', 0);
+ $start = $request->variable('start', 0);
$deletemark = (isset($_POST['delmarked'])) ? true : false;
$deleteall = (isset($_POST['delall'])) ? true : false;
$confirm = (isset($_POST['confirm'])) ? true : false;
- $marked = request_var('mark', array(0));
- $message = utf8_normalize_nfc(request_var('message', '', true));
+ $marked = $request->variable('mark', array(0));
+ $message = $request->variable('message', '', true);
// Sort keys
- $sort_days = request_var('st', 0);
- $sort_key = request_var('sk', 't');
- $sort_dir = request_var('sd', 'd');
+ $sort_days = $request->variable('st', 0);
+ $sort_key = $request->variable('sk', 't');
+ $sort_dir = $request->variable('sd', 'd');
// Delete entries if requested and able
if ($deletemark || $deleteall || $confirm)
@@ -1222,8 +1258,8 @@ class acp_users
if (confirm_box(true))
{
$where_sql = '';
- $deletemark = request_var('delmarked', 0);
- $deleteall = request_var('delall', 0);
+ $deletemark = $request->variable('delmarked', 0);
+ $deleteall = $request->variable('delall', 0);
if ($deletemark && $marked)
{
$where_sql = ' AND ' . $db->sql_in_set('warning_id', array_values($marked));
@@ -1254,11 +1290,11 @@ class acp_users
if ($log_warnings)
{
- add_log('admin', 'LOG_WARNINGS_DELETED', $user_row['username'], $num_warnings);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_WARNINGS_DELETED', false, array($user_row['username'], $num_warnings));
}
else
{
- add_log('admin', 'LOG_WARNINGS_DELETED_ALL', $user_row['username']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_WARNINGS_DELETED_ALL', false, array($user_row['username']));
}
}
}
@@ -1347,6 +1383,7 @@ class acp_users
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+ /* @var $cp \phpbb\profilefields\manager */
$cp = $phpbb_container->get('profilefields.manager');
$cp_data = $cp_error = array();
@@ -1361,7 +1398,7 @@ class acp_users
$user_row['iso_lang_id'] = $row['lang_id'];
$data = array(
- 'jabber' => utf8_normalize_nfc(request_var('jabber', $user_row['user_jabber'], true)),
+ 'jabber' => $request->variable('jabber', $user_row['user_jabber'], true),
'bday_day' => 0,
'bday_month' => 0,
'bday_year' => 0,
@@ -1372,9 +1409,9 @@ class acp_users
list($data['bday_day'], $data['bday_month'], $data['bday_year']) = explode('-', $user_row['user_birthday']);
}
- $data['bday_day'] = request_var('bday_day', $data['bday_day']);
- $data['bday_month'] = request_var('bday_month', $data['bday_month']);
- $data['bday_year'] = request_var('bday_year', $data['bday_year']);
+ $data['bday_day'] = $request->variable('bday_day', $data['bday_day']);
+ $data['bday_month'] = $request->variable('bday_month', $data['bday_month']);
+ $data['bday_year'] = $request->variable('bday_year', $data['bday_year']);
$data['user_birthday'] = sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']);
/**
@@ -1507,36 +1544,36 @@ class acp_users
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
$data = array(
- 'dateformat' => utf8_normalize_nfc(request_var('dateformat', $user_row['user_dateformat'], true)),
- 'lang' => basename(request_var('lang', $user_row['user_lang'])),
- 'tz' => request_var('tz', $user_row['user_timezone']),
- 'style' => request_var('style', $user_row['user_style']),
- 'viewemail' => request_var('viewemail', $user_row['user_allow_viewemail']),
- 'massemail' => request_var('massemail', $user_row['user_allow_massemail']),
- 'hideonline' => request_var('hideonline', !$user_row['user_allow_viewonline']),
- 'notifymethod' => request_var('notifymethod', $user_row['user_notify_type']),
- 'notifypm' => request_var('notifypm', $user_row['user_notify_pm']),
- 'allowpm' => request_var('allowpm', $user_row['user_allow_pm']),
-
- 'topic_sk' => request_var('topic_sk', ($user_row['user_topic_sortby_type']) ? $user_row['user_topic_sortby_type'] : 't'),
- 'topic_sd' => request_var('topic_sd', ($user_row['user_topic_sortby_dir']) ? $user_row['user_topic_sortby_dir'] : 'd'),
- 'topic_st' => request_var('topic_st', ($user_row['user_topic_show_days']) ? $user_row['user_topic_show_days'] : 0),
-
- 'post_sk' => request_var('post_sk', ($user_row['user_post_sortby_type']) ? $user_row['user_post_sortby_type'] : 't'),
- 'post_sd' => request_var('post_sd', ($user_row['user_post_sortby_dir']) ? $user_row['user_post_sortby_dir'] : 'a'),
- 'post_st' => request_var('post_st', ($user_row['user_post_show_days']) ? $user_row['user_post_show_days'] : 0),
-
- 'view_images' => request_var('view_images', $this->optionget($user_row, 'viewimg')),
- 'view_flash' => request_var('view_flash', $this->optionget($user_row, 'viewflash')),
- 'view_smilies' => request_var('view_smilies', $this->optionget($user_row, 'viewsmilies')),
- 'view_sigs' => request_var('view_sigs', $this->optionget($user_row, 'viewsigs')),
- 'view_avatars' => request_var('view_avatars', $this->optionget($user_row, 'viewavatars')),
- 'view_wordcensor' => request_var('view_wordcensor', $this->optionget($user_row, 'viewcensors')),
-
- 'bbcode' => request_var('bbcode', $this->optionget($user_row, 'bbcode')),
- 'smilies' => request_var('smilies', $this->optionget($user_row, 'smilies')),
- 'sig' => request_var('sig', $this->optionget($user_row, 'attachsig')),
- 'notify' => request_var('notify', $user_row['user_notify']),
+ 'dateformat' => $request->variable('dateformat', $user_row['user_dateformat'], true),
+ 'lang' => basename($request->variable('lang', $user_row['user_lang'])),
+ 'tz' => $request->variable('tz', $user_row['user_timezone']),
+ 'style' => $request->variable('style', $user_row['user_style']),
+ 'viewemail' => $request->variable('viewemail', $user_row['user_allow_viewemail']),
+ 'massemail' => $request->variable('massemail', $user_row['user_allow_massemail']),
+ 'hideonline' => $request->variable('hideonline', !$user_row['user_allow_viewonline']),
+ 'notifymethod' => $request->variable('notifymethod', $user_row['user_notify_type']),
+ 'notifypm' => $request->variable('notifypm', $user_row['user_notify_pm']),
+ 'allowpm' => $request->variable('allowpm', $user_row['user_allow_pm']),
+
+ 'topic_sk' => $request->variable('topic_sk', ($user_row['user_topic_sortby_type']) ? $user_row['user_topic_sortby_type'] : 't'),
+ 'topic_sd' => $request->variable('topic_sd', ($user_row['user_topic_sortby_dir']) ? $user_row['user_topic_sortby_dir'] : 'd'),
+ 'topic_st' => $request->variable('topic_st', ($user_row['user_topic_show_days']) ? $user_row['user_topic_show_days'] : 0),
+
+ 'post_sk' => $request->variable('post_sk', ($user_row['user_post_sortby_type']) ? $user_row['user_post_sortby_type'] : 't'),
+ 'post_sd' => $request->variable('post_sd', ($user_row['user_post_sortby_dir']) ? $user_row['user_post_sortby_dir'] : 'a'),
+ 'post_st' => $request->variable('post_st', ($user_row['user_post_show_days']) ? $user_row['user_post_show_days'] : 0),
+
+ 'view_images' => $request->variable('view_images', $this->optionget($user_row, 'viewimg')),
+ 'view_flash' => $request->variable('view_flash', $this->optionget($user_row, 'viewflash')),
+ 'view_smilies' => $request->variable('view_smilies', $this->optionget($user_row, 'viewsmilies')),
+ 'view_sigs' => $request->variable('view_sigs', $this->optionget($user_row, 'viewsigs')),
+ 'view_avatars' => $request->variable('view_avatars', $this->optionget($user_row, 'viewavatars')),
+ 'view_wordcensor' => $request->variable('view_wordcensor', $this->optionget($user_row, 'viewcensors')),
+
+ 'bbcode' => $request->variable('bbcode', $this->optionget($user_row, 'bbcode')),
+ 'smilies' => $request->variable('smilies', $this->optionget($user_row, 'smilies')),
+ 'sig' => $request->variable('sig', $this->optionget($user_row, 'attachsig')),
+ 'notify' => $request->variable('notify', $user_row['user_notify']),
);
/**
@@ -1780,6 +1817,7 @@ class acp_users
if ($config['allow_avatar'])
{
+ /* @var $phpbb_avatar_manager \phpbb\avatar\manager */
$phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
$avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers();
@@ -1896,7 +1934,7 @@ class acp_users
trigger_error($user->lang['FORM_INVALID'] . adm_back_link($this->u_action . '&amp;u=' . $user_id), E_USER_WARNING);
}
- $rank_id = request_var('user_rank', 0);
+ $rank_id = $request->variable('user_rank', 0);
$sql = 'UPDATE ' . USERS_TABLE . "
SET user_rank = $rank_id
@@ -1930,50 +1968,54 @@ class acp_users
case 'sig':
- include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
include_once($phpbb_root_path . 'includes/functions_display.' . $phpEx);
- $enable_bbcode = ($config['allow_sig_bbcode']) ? (bool) $this->optionget($user_row, 'sig_bbcode') : false;
- $enable_smilies = ($config['allow_sig_smilies']) ? (bool) $this->optionget($user_row, 'sig_smilies') : false;
- $enable_urls = ($config['allow_sig_links']) ? (bool) $this->optionget($user_row, 'sig_links') : false;
- $signature = utf8_normalize_nfc(request_var('signature', (string) $user_row['user_sig'], true));
+ $enable_bbcode = ($config['allow_sig_bbcode']) ? $this->optionget($user_row, 'sig_bbcode') : false;
+ $enable_smilies = ($config['allow_sig_smilies']) ? $this->optionget($user_row, 'sig_smilies') : false;
+ $enable_urls = ($config['allow_sig_links']) ? $this->optionget($user_row, 'sig_links') : false;
- $preview = (isset($_POST['preview'])) ? true : false;
+ $decoded_message = generate_text_for_edit($user_row['user_sig'], $user_row['user_sig_bbcode_uid'], $user_row['user_sig_bbcode_bitfield']);
+ $signature = $request->variable('signature', $decoded_message['text'], true);
+ $signature_preview = '';
- if ($submit || $preview)
+ if ($submit || $request->is_set_post('preview'))
{
- include_once($phpbb_root_path . 'includes/message_parser.' . $phpEx);
-
- $enable_bbcode = ($config['allow_sig_bbcode']) ? ((request_var('disable_bbcode', false)) ? false : true) : false;
- $enable_smilies = ($config['allow_sig_smilies']) ? ((request_var('disable_smilies', false)) ? false : true) : false;
- $enable_urls = ($config['allow_sig_links']) ? ((request_var('disable_magic_url', false)) ? false : true) : false;
-
- $message_parser = new parse_message($signature);
-
- // Allowing Quote BBCode
- $message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, $config['allow_sig_links'], true, 'sig');
-
- if (sizeof($message_parser->warn_msg))
- {
- $error[] = implode('<br />', $message_parser->warn_msg);
- }
+ $enable_bbcode = ($config['allow_sig_bbcode']) ? !$request->variable('disable_bbcode', false) : false;
+ $enable_smilies = ($config['allow_sig_smilies']) ? !$request->variable('disable_smilies', false) : false;
+ $enable_urls = ($config['allow_sig_links']) ? !$request->variable('disable_magic_url', false) : false;
if (!check_form_key($form_name))
{
- $error = 'FORM_INVALID';
+ $error[] = 'FORM_INVALID';
}
+ }
- if (!sizeof($error) && $submit)
+ $bbcode_uid = $bbcode_bitfield = $bbcode_flags = '';
+ $warn_msg = generate_text_for_storage($signature, $bbcode_uid, $bbcode_bitfield, $bbcode_flags, $enable_bbcode, $enable_urls, $enable_smilies);
+
+ if (sizeof($warn_msg))
+ {
+ $error += $warn_msg;
+ }
+
+ if (!$submit)
+ {
+ // Parse it for displaying
+ $signature_preview = generate_text_for_display($signature, $bbcode_uid, $bbcode_bitfield, $bbcode_flags);
+ }
+ else
+ {
+ if (!sizeof($error))
{
$this->optionset($user_row, 'sig_bbcode', $enable_bbcode);
$this->optionset($user_row, 'sig_smilies', $enable_smilies);
$this->optionset($user_row, 'sig_links', $enable_urls);
$sql_ary = array(
- 'user_sig' => (string) $message_parser->message,
+ 'user_sig' => $signature,
'user_options' => $user_row['user_options'],
- 'user_sig_bbcode_uid' => (string) $message_parser->bbcode_uid,
- 'user_sig_bbcode_bitfield' => (string) $message_parser->bbcode_bitfield
+ 'user_sig_bbcode_uid' => $bbcode_uid,
+ 'user_sig_bbcode_bitfield' => $bbcode_bitfield,
);
$sql = 'UPDATE ' . USERS_TABLE . '
@@ -1983,33 +2025,27 @@ class acp_users
trigger_error($user->lang['USER_SIG_UPDATED'] . adm_back_link($this->u_action . '&amp;u=' . $user_id));
}
-
- // Replace "error" strings with their real, localised form
- $error = array_map(array($user, 'lang'), $error);
}
- $signature_preview = '';
+ // Replace "error" strings with their real, localised form
+ $error = array_map(array($user, 'lang'), $error);
- if ($preview)
- {
- // Now parse it for displaying
- $signature_preview = $message_parser->format_display($enable_bbcode, $enable_urls, $enable_smilies, false);
- unset($message_parser);
- }
+ $decoded_message = generate_text_for_edit($signature, $bbcode_uid, $bbcode_bitfield);
- decode_message($signature, $user_row['user_sig_bbcode_uid']);
+ /** @var \phpbb\controller\helper $controller_helper */
+ $controller_helper = $phpbb_container->get('controller.helper');
$template->assign_vars(array(
'S_SIGNATURE' => true,
- 'SIGNATURE' => $signature,
+ 'SIGNATURE' => $decoded_message['text'],
'SIGNATURE_PREVIEW' => $signature_preview,
'S_BBCODE_CHECKED' => (!$enable_bbcode) ? ' checked="checked"' : '',
'S_SMILIES_CHECKED' => (!$enable_smilies) ? ' checked="checked"' : '',
'S_MAGIC_URL_CHECKED' => (!$enable_urls) ? ' checked="checked"' : '',
- 'BBCODE_STATUS' => ($config['allow_sig_bbcode']) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>'),
+ 'BBCODE_STATUS' => $user->lang(($config['allow_sig_bbcode'] ? 'BBCODE_IS_ON' : 'BBCODE_IS_OFF'), '<a href="' . $controller_helper->route('phpbb_help_bbcode_controller') . '">', '</a>'),
'SMILIES_STATUS' => ($config['allow_sig_smilies']) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'],
'IMG_STATUS' => ($config['allow_sig_img']) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'],
'FLASH_STATUS' => ($config['allow_sig_flash']) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'],
@@ -2030,15 +2066,16 @@ class acp_users
break;
case 'attach':
+ /* @var $pagination \phpbb\pagination */
+ $pagination = $phpbb_container->get('pagination');
- $start = request_var('start', 0);
+ $start = $request->variable('start', 0);
$deletemark = (isset($_POST['delmarked'])) ? true : false;
- $marked = request_var('mark', array(0));
- $pagination = $phpbb_container->get('pagination');
+ $marked = $request->variable('mark', array(0));
// Sort keys
- $sort_key = request_var('sk', 'a');
- $sort_dir = request_var('sd', 'd');
+ $sort_key = $request->variable('sk', 'a');
+ $sort_dir = $request->variable('sd', 'd');
if ($deletemark && sizeof($marked))
{
@@ -2077,7 +2114,7 @@ class acp_users
$message = (sizeof($log_attachments) == 1) ? $user->lang['ATTACHMENT_DELETED'] : $user->lang['ATTACHMENTS_DELETED'];
- add_log('admin', 'LOG_ATTACHMENTS_DELETED', implode($user->lang['COMMA_SEPARATOR'], $log_attachments));
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ATTACHMENTS_DELETED', false, array(implode($user->lang['COMMA_SEPARATOR'], $log_attachments)));
trigger_error($message . adm_back_link($this->u_action . '&amp;u=' . $user_id));
}
else
@@ -2186,7 +2223,7 @@ class acp_users
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
$user->add_lang(array('groups', 'acp/groups'));
- $group_id = request_var('g', 0);
+ $group_id = $request->variable('g', 0);
if ($group_id)
{
@@ -2311,6 +2348,9 @@ class acp_users
$error = array();
}
+ /** @var \phpbb\group\helper $group_helper */
+ $group_helper = $phpbb_container->get('group_helper');
+
$sql = 'SELECT ug.*, g.*
FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . " ug
WHERE ug.user_id = $user_id
@@ -2355,7 +2395,7 @@ class acp_users
continue;
}
- $s_group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
+ $s_group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '">' . $group_helper->get_name($row['group_name']) . '</option>';
}
$db->sql_freeresult($result);
@@ -2406,7 +2446,7 @@ class acp_users
$user->add_lang('acp/permissions');
add_permission_language();
- $forum_id = request_var('f', 0);
+ $forum_id = $request->variable('f', 0);
// Global Permissions
if (!$forum_id)
diff --git a/phpBB/includes/acp/acp_words.php b/phpBB/includes/acp/acp_words.php
index 272d38bcc8..ea8d47a109 100644
--- a/phpBB/includes/acp/acp_words.php
+++ b/phpBB/includes/acp/acp_words.php
@@ -28,13 +28,13 @@ class acp_words
function main($id, $mode)
{
- global $db, $user, $auth, $template, $cache;
+ global $db, $user, $auth, $template, $cache, $phpbb_log, $request, $phpbb_container;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang('acp/posting');
// Set up general vars
- $action = request_var('action', '');
+ $action = $request->variable('action', '');
$action = (isset($_POST['add'])) ? 'add' : ((isset($_POST['save'])) ? 'save' : $action);
$s_hidden_fields = '';
@@ -50,7 +50,7 @@ class acp_words
{
case 'edit':
- $word_id = request_var('id', 0);
+ $word_id = $request->variable('id', 0);
if (!$word_id)
{
@@ -88,9 +88,9 @@ class acp_words
trigger_error($user->lang['FORM_INVALID']. adm_back_link($this->u_action), E_USER_WARNING);
}
- $word_id = request_var('id', 0);
- $word = utf8_normalize_nfc(request_var('word', '', true));
- $replacement = utf8_normalize_nfc(request_var('replacement', '', true));
+ $word_id = $request->variable('id', 0);
+ $word = $request->variable('word', '', true);
+ $replacement = $request->variable('replacement', '', true);
if ($word === '' || $replacement === '')
{
@@ -115,9 +115,11 @@ class acp_words
}
$cache->destroy('_word_censors');
+ $phpbb_container->get('text_formatter.cache')->invalidate();
$log_action = ($word_id) ? 'LOG_WORD_EDIT' : 'LOG_WORD_ADD';
- add_log('admin', $log_action, $word);
+
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, $log_action, false, array($word));
$message = ($word_id) ? $user->lang['WORD_UPDATED'] : $user->lang['WORD_ADDED'];
trigger_error($message . adm_back_link($this->u_action));
@@ -126,7 +128,7 @@ class acp_words
case 'delete':
- $word_id = request_var('id', 0);
+ $word_id = $request->variable('id', 0);
if (!$word_id)
{
@@ -147,8 +149,9 @@ class acp_words
$db->sql_query($sql);
$cache->destroy('_word_censors');
+ $phpbb_container->get('text_formatter.cache')->invalidate();
- add_log('admin', 'LOG_WORD_DELETE', $deleted_word);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_WORD_DELETE', false, array($deleted_word));
trigger_error($user->lang['WORD_REMOVED'] . adm_back_link($this->u_action));
}
diff --git a/phpBB/includes/acp/auth.php b/phpBB/includes/acp/auth.php
index 52c45499b2..027be03a00 100644
--- a/phpBB/includes/acp/auth.php
+++ b/phpBB/includes/acp/auth.php
@@ -267,8 +267,13 @@ class auth_admin extends \phpbb\auth\auth
function display_mask($mode, $permission_type, &$hold_ary, $user_mode = 'user', $local = false, $group_display = true)
{
global $template, $user, $db, $phpbb_root_path, $phpEx, $phpbb_container;
+
+ /* @var $phpbb_permissions \phpbb\permissions */
$phpbb_permissions = $phpbb_container->get('acl.permissions');
+ /** @var \phpbb\group\helper $group_helper */
+ $group_helper = $phpbb_container->get('group_helper');
+
// Define names for template loops, might be able to be set
$tpl_pmask = 'p_mask';
$tpl_fmask = 'f_mask';
@@ -300,7 +305,7 @@ class auth_admin extends \phpbb\auth\auth
$ug_names_ary = array();
while ($row = $db->sql_fetchrow($result))
{
- $ug_names_ary[$row['ug_id']] = ($user_mode == 'user') ? $row['ug_name'] : (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['ug_name']] : $row['ug_name']);
+ $ug_names_ary[$row['ug_id']] = ($user_mode == 'user') ? $row['ug_name'] : $group_helper->get_name($row['ug_name']);
}
$db->sql_freeresult($result);
@@ -408,14 +413,7 @@ class auth_admin extends \phpbb\auth\auth
{
foreach ($memberships as $row)
{
- if ($groups[$row['group_id']]['group_type'] == GROUP_SPECIAL)
- {
- $user_groups_default[$row['user_id']][] = $user->lang['G_' . $groups[$row['group_id']]['group_name']];
- }
- else
- {
- $user_groups_custom[$row['user_id']][] = $groups[$row['group_id']]['group_name'];
- }
+ $user_groups_default[$row['user_id']][] = $group_helper->get_name($groups[$row['group_id']]['group_name']);
}
}
unset($memberships, $groups);
@@ -468,7 +466,8 @@ class auth_admin extends \phpbb\auth\auth
// Build role dropdown options
$current_role_id = (isset($cur_roles[$ug_id][$forum_id])) ? $cur_roles[$ug_id][$forum_id] : 0;
- $s_role_options = '';
+ // Output current role id to template
+ $template->assign_var('S_ROLE_ID', $current_role_id);
@reset($roles);
while (list($role_id, $role_row) = each($roles))
@@ -476,13 +475,12 @@ class auth_admin extends \phpbb\auth\auth
$role_description = (!empty($user->lang[$role_row['role_description']])) ? $user->lang[$role_row['role_description']] : nl2br($role_row['role_description']);
$role_name = (!empty($user->lang[$role_row['role_name']])) ? $user->lang[$role_row['role_name']] : $role_row['role_name'];
- $title = ($role_description) ? ' title="' . $role_description . '"' : '';
- $s_role_options .= '<option value="' . $role_id . '"' . (($role_id == $current_role_id) ? ' selected="selected"' : '') . $title . '>' . $role_name . '</option>';
- }
-
- if ($s_role_options)
- {
- $s_role_options = '<option value="0"' . ((!$current_role_id) ? ' selected="selected"' : '') . ' title="' . htmlspecialchars($user->lang['NO_ROLE_ASSIGNED_EXPLAIN']) . '">' . $user->lang['NO_ROLE_ASSIGNED'] . '</option>' . $s_role_options;
+ $template->assign_block_vars('role_options', array(
+ 'ID' => $role_id,
+ 'ROLE_NAME' => $role_name,
+ 'TITLE' => $role_description,
+ 'SELECTED' => $role_id == $current_role_id,
+ ));
}
if (!$current_role_id && $mode != 'view')
@@ -505,7 +503,6 @@ class auth_admin extends \phpbb\auth\auth
$template->assign_block_vars($tpl_pmask . '.' . $tpl_fmask, array(
'NAME' => $ug_names_ary[$ug_id],
- 'S_ROLE_OPTIONS' => $s_role_options,
'UG_ID' => $ug_id,
'S_CUSTOM' => $s_custom_permissions,
'FORUM_ID' => $forum_id)
@@ -554,7 +551,8 @@ class auth_admin extends \phpbb\auth\auth
// Build role dropdown options
$current_role_id = (isset($cur_roles[$ug_id][$forum_id])) ? $cur_roles[$ug_id][$forum_id] : 0;
- $s_role_options = '';
+ // Output current role id to template
+ $template->assign_var('S_ROLE_ID', $current_role_id);
@reset($roles);
while (list($role_id, $role_row) = each($roles))
@@ -562,13 +560,12 @@ class auth_admin extends \phpbb\auth\auth
$role_description = (!empty($user->lang[$role_row['role_description']])) ? $user->lang[$role_row['role_description']] : nl2br($role_row['role_description']);
$role_name = (!empty($user->lang[$role_row['role_name']])) ? $user->lang[$role_row['role_name']] : $role_row['role_name'];
- $title = ($role_description) ? ' title="' . $role_description . '"' : '';
- $s_role_options .= '<option value="' . $role_id . '"' . (($role_id == $current_role_id) ? ' selected="selected"' : '') . $title . '>' . $role_name . '</option>';
- }
-
- if ($s_role_options)
- {
- $s_role_options = '<option value="0"' . ((!$current_role_id) ? ' selected="selected"' : '') . ' title="' . htmlspecialchars($user->lang['NO_ROLE_ASSIGNED_EXPLAIN']) . '">' . $user->lang['NO_ROLE_ASSIGNED'] . '</option>' . $s_role_options;
+ $template->assign_block_vars('role_options', array(
+ 'ID' => $role_id,
+ 'ROLE_NAME' => $role_name,
+ 'TITLE' => $role_description,
+ 'SELECTED' => $role_id == $current_role_id,
+ ));
}
if (!$current_role_id && $mode != 'view')
@@ -592,7 +589,6 @@ class auth_admin extends \phpbb\auth\auth
$template->assign_block_vars($tpl_pmask . '.' . $tpl_fmask, array(
'NAME' => ($forum_id == 0) ? $forum_names_ary[0] : $forum_names_ary[$forum_id]['forum_name'],
'PADDING' => ($forum_id == 0) ? '' : $forum_names_ary[$forum_id]['padding'],
- 'S_ROLE_OPTIONS' => $s_role_options,
'S_CUSTOM' => $s_custom_permissions,
'UG_ID' => $ug_id,
'FORUM_ID' => $forum_id)
@@ -612,12 +608,16 @@ class auth_admin extends \phpbb\auth\auth
function display_role_mask(&$hold_ary)
{
global $db, $template, $user, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $phpbb_container;
if (!sizeof($hold_ary))
{
return;
}
+ /** @var \phpbb\group\helper $group_helper */
+ $group_helper = $phpbb_container->get('group_helper');
+
// Get forum names
$sql = 'SELECT forum_id, forum_name
FROM ' . FORUMS_TABLE . '
@@ -673,7 +673,7 @@ class auth_admin extends \phpbb\auth\auth
{
$template->assign_block_vars('role_mask.groups', array(
'GROUP_ID' => $row['group_id'],
- 'GROUP_NAME' => ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'],
+ 'GROUP_NAME' => $group_helper->get_name($row['group_name']),
'U_PROFILE' => append_sid("{$phpbb_root_path}memberlist.$phpEx", "mode=group&amp;g={$row['group_id']}"))
);
}
@@ -1108,6 +1108,7 @@ class auth_admin extends \phpbb\auth\auth
{
global $template, $user, $phpbb_admin_path, $phpEx, $phpbb_container;
+ /* @var $phpbb_permissions \phpbb\permissions */
$phpbb_permissions = $phpbb_container->get('acl.permissions');
@reset($category_array);
@@ -1196,6 +1197,7 @@ class auth_admin extends \phpbb\auth\auth
{
global $user, $phpbb_container;
+ /* @var $phpbb_permissions \phpbb\permissions */
$phpbb_permissions = $phpbb_container->get('acl.permissions');
foreach ($key_sort_array as $forum_id)
diff --git a/phpBB/includes/acp/info/acp_attachments.php b/phpBB/includes/acp/info/acp_attachments.php
index ff6e342f77..057f08201e 100644
--- a/phpBB/includes/acp/info/acp_attachments.php
+++ b/phpBB/includes/acp/info/acp_attachments.php
@@ -18,7 +18,6 @@ class acp_attachments_info
return array(
'filename' => 'acp_attachments',
'title' => 'ACP_ATTACHMENTS',
- 'version' => '1.0.0',
'modes' => array(
'attach' => array('title' => 'ACP_ATTACHMENT_SETTINGS', 'auth' => 'acl_a_attach', 'cat' => array('ACP_BOARD_CONFIGURATION', 'ACP_ATTACHMENTS')),
'extensions' => array('title' => 'ACP_MANAGE_EXTENSIONS', 'auth' => 'acl_a_attach', 'cat' => array('ACP_ATTACHMENTS')),
diff --git a/phpBB/includes/acp/info/acp_ban.php b/phpBB/includes/acp/info/acp_ban.php
index 4959f4da41..c88f4c2ebb 100644
--- a/phpBB/includes/acp/info/acp_ban.php
+++ b/phpBB/includes/acp/info/acp_ban.php
@@ -18,7 +18,6 @@ class acp_ban_info
return array(
'filename' => 'acp_ban',
'title' => 'ACP_BAN',
- 'version' => '1.0.0',
'modes' => array(
'email' => array('title' => 'ACP_BAN_EMAILS', 'auth' => 'acl_a_ban', 'cat' => array('ACP_USER_SECURITY')),
'ip' => array('title' => 'ACP_BAN_IPS', 'auth' => 'acl_a_ban', 'cat' => array('ACP_USER_SECURITY')),
diff --git a/phpBB/includes/acp/info/acp_bbcodes.php b/phpBB/includes/acp/info/acp_bbcodes.php
index 2bca319cc3..dfcd43a8ac 100644
--- a/phpBB/includes/acp/info/acp_bbcodes.php
+++ b/phpBB/includes/acp/info/acp_bbcodes.php
@@ -18,7 +18,6 @@ class acp_bbcodes_info
return array(
'filename' => 'acp_bbcodes',
'title' => 'ACP_BBCODES',
- 'version' => '1.0.0',
'modes' => array(
'bbcodes' => array('title' => 'ACP_BBCODES', 'auth' => 'acl_a_bbcode', 'cat' => array('ACP_MESSAGES')),
),
diff --git a/phpBB/includes/acp/info/acp_board.php b/phpBB/includes/acp/info/acp_board.php
index 6838b4f8ba..1a3ee7b6be 100644
--- a/phpBB/includes/acp/info/acp_board.php
+++ b/phpBB/includes/acp/info/acp_board.php
@@ -18,7 +18,6 @@ class acp_board_info
return array(
'filename' => 'acp_board',
'title' => 'ACP_BOARD_MANAGEMENT',
- 'version' => '1.0.0',
'modes' => array(
'settings' => array('title' => 'ACP_BOARD_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
'features' => array('title' => 'ACP_BOARD_FEATURES', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
diff --git a/phpBB/includes/acp/info/acp_bots.php b/phpBB/includes/acp/info/acp_bots.php
index 9aa24927af..26782d8c0b 100644
--- a/phpBB/includes/acp/info/acp_bots.php
+++ b/phpBB/includes/acp/info/acp_bots.php
@@ -18,7 +18,6 @@ class acp_bots_info
return array(
'filename' => 'acp_bots',
'title' => 'ACP_BOTS',
- 'version' => '1.0.0',
'modes' => array(
'bots' => array('title' => 'ACP_BOTS', 'auth' => 'acl_a_bots', 'cat' => array('ACP_GENERAL_TASKS')),
),
diff --git a/phpBB/includes/acp/info/acp_captcha.php b/phpBB/includes/acp/info/acp_captcha.php
index 99dc5ce0e5..3f7bf0351d 100644
--- a/phpBB/includes/acp/info/acp_captcha.php
+++ b/phpBB/includes/acp/info/acp_captcha.php
@@ -18,7 +18,6 @@ class acp_captcha_info
return array(
'filename' => 'acp_captcha',
'title' => 'ACP_CAPTCHA',
- 'version' => '1.0.0',
'modes' => array(
'visual' => array('title' => 'ACP_VC_SETTINGS', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION')),
'img' => array('title' => 'ACP_VC_CAPTCHA_DISPLAY', 'auth' => 'acl_a_board', 'cat' => array('ACP_BOARD_CONFIGURATION'), 'display' => false)
diff --git a/phpBB/includes/acp/info/acp_database.php b/phpBB/includes/acp/info/acp_database.php
index 5cf9da24fb..815db53b67 100644
--- a/phpBB/includes/acp/info/acp_database.php
+++ b/phpBB/includes/acp/info/acp_database.php
@@ -18,7 +18,6 @@ class acp_database_info
return array(
'filename' => 'acp_database',
'title' => 'ACP_DATABASE',
- 'version' => '1.0.0',
'modes' => array(
'backup' => array('title' => 'ACP_BACKUP', 'auth' => 'acl_a_backup', 'cat' => array('ACP_CAT_DATABASE')),
'restore' => array('title' => 'ACP_RESTORE', 'auth' => 'acl_a_backup', 'cat' => array('ACP_CAT_DATABASE')),
diff --git a/phpBB/includes/acp/info/acp_disallow.php b/phpBB/includes/acp/info/acp_disallow.php
index ebd44b515c..df4765b6bb 100644
--- a/phpBB/includes/acp/info/acp_disallow.php
+++ b/phpBB/includes/acp/info/acp_disallow.php
@@ -18,7 +18,6 @@ class acp_disallow_info
return array(
'filename' => 'acp_disallow',
'title' => 'ACP_DISALLOW',
- 'version' => '1.0.0',
'modes' => array(
'usernames' => array('title' => 'ACP_DISALLOW_USERNAMES', 'auth' => 'acl_a_names', 'cat' => array('ACP_USER_SECURITY')),
),
diff --git a/phpBB/includes/acp/info/acp_email.php b/phpBB/includes/acp/info/acp_email.php
index 2f77fc617c..e85ef0923a 100644
--- a/phpBB/includes/acp/info/acp_email.php
+++ b/phpBB/includes/acp/info/acp_email.php
@@ -18,7 +18,6 @@ class acp_email_info
return array(
'filename' => 'acp_email',
'title' => 'ACP_MASS_EMAIL',
- 'version' => '1.0.0',
'modes' => array(
'email' => array('title' => 'ACP_MASS_EMAIL', 'auth' => 'acl_a_email && cfg_email_enable', 'cat' => array('ACP_GENERAL_TASKS')),
),
diff --git a/phpBB/includes/acp/info/acp_extensions.php b/phpBB/includes/acp/info/acp_extensions.php
index d4cf1b0ed5..9adcd543b9 100644
--- a/phpBB/includes/acp/info/acp_extensions.php
+++ b/phpBB/includes/acp/info/acp_extensions.php
@@ -18,7 +18,6 @@ class acp_extensions_info
return array(
'filename' => 'acp_extensions',
'title' => 'ACP_EXTENSION_MANAGEMENT',
- 'version' => '1.0.0',
'modes' => array(
'main' => array('title' => 'ACP_EXTENSIONS', 'auth' => 'acl_a_extensions', 'cat' => array('ACP_EXTENSION_MANAGEMENT')),
),
diff --git a/phpBB/includes/acp/info/acp_forums.php b/phpBB/includes/acp/info/acp_forums.php
index 647090c8c3..8b5ce7edc2 100644
--- a/phpBB/includes/acp/info/acp_forums.php
+++ b/phpBB/includes/acp/info/acp_forums.php
@@ -18,7 +18,6 @@ class acp_forums_info
return array(
'filename' => 'acp_forums',
'title' => 'ACP_FORUM_MANAGEMENT',
- 'version' => '1.0.0',
'modes' => array(
'manage' => array('title' => 'ACP_MANAGE_FORUMS', 'auth' => 'acl_a_forum', 'cat' => array('ACP_MANAGE_FORUMS')),
),
diff --git a/phpBB/includes/acp/info/acp_groups.php b/phpBB/includes/acp/info/acp_groups.php
index 6c5ad70d97..e0aafeca0d 100644
--- a/phpBB/includes/acp/info/acp_groups.php
+++ b/phpBB/includes/acp/info/acp_groups.php
@@ -18,7 +18,6 @@ class acp_groups_info
return array(
'filename' => 'acp_groups',
'title' => 'ACP_GROUPS_MANAGEMENT',
- 'version' => '1.0.0',
'modes' => array(
'manage' => array('title' => 'ACP_GROUPS_MANAGE', 'auth' => 'acl_a_group', 'cat' => array('ACP_GROUPS')),
'position' => array('title' => 'ACP_GROUPS_POSITION', 'auth' => 'acl_a_group', 'cat' => array('ACP_GROUPS')),
diff --git a/phpBB/includes/acp/info/acp_icons.php b/phpBB/includes/acp/info/acp_icons.php
index 001d6cb402..87eadddd8d 100644
--- a/phpBB/includes/acp/info/acp_icons.php
+++ b/phpBB/includes/acp/info/acp_icons.php
@@ -18,7 +18,6 @@ class acp_icons_info
return array(
'filename' => 'acp_icons',
'title' => 'ACP_ICONS_SMILIES',
- 'version' => '1.0.0',
'modes' => array(
'icons' => array('title' => 'ACP_ICONS', 'auth' => 'acl_a_icons', 'cat' => array('ACP_MESSAGES')),
'smilies' => array('title' => 'ACP_SMILIES', 'auth' => 'acl_a_icons', 'cat' => array('ACP_MESSAGES')),
diff --git a/phpBB/includes/acp/info/acp_inactive.php b/phpBB/includes/acp/info/acp_inactive.php
index 442eb13c30..38cb964735 100644
--- a/phpBB/includes/acp/info/acp_inactive.php
+++ b/phpBB/includes/acp/info/acp_inactive.php
@@ -18,7 +18,6 @@ class acp_inactive_info
return array(
'filename' => 'acp_inactive',
'title' => 'ACP_INACTIVE_USERS',
- 'version' => '1.0.0',
'modes' => array(
'list' => array('title' => 'ACP_INACTIVE_USERS', 'auth' => 'acl_a_user', 'cat' => array('ACP_CAT_USERS')),
),
diff --git a/phpBB/includes/acp/info/acp_jabber.php b/phpBB/includes/acp/info/acp_jabber.php
index c1dfb2aca7..660299a12d 100644
--- a/phpBB/includes/acp/info/acp_jabber.php
+++ b/phpBB/includes/acp/info/acp_jabber.php
@@ -18,7 +18,6 @@ class acp_jabber_info
return array(
'filename' => 'acp_jabber',
'title' => 'ACP_JABBER_SETTINGS',
- 'version' => '1.0.0',
'modes' => array(
'settings' => array('title' => 'ACP_JABBER_SETTINGS', 'auth' => 'acl_a_jabber', 'cat' => array('ACP_CLIENT_COMMUNICATION')),
),
diff --git a/phpBB/includes/acp/info/acp_language.php b/phpBB/includes/acp/info/acp_language.php
index b9efbbbd9a..1a5a2b6ba8 100644
--- a/phpBB/includes/acp/info/acp_language.php
+++ b/phpBB/includes/acp/info/acp_language.php
@@ -18,7 +18,6 @@ class acp_language_info
return array(
'filename' => 'acp_language',
'title' => 'ACP_LANGUAGE',
- 'version' => '1.0.0',
'modes' => array(
'lang_packs' => array('title' => 'ACP_LANGUAGE_PACKS', 'auth' => 'acl_a_language', 'cat' => array('ACP_LANGUAGE')),
),
diff --git a/phpBB/includes/acp/info/acp_logs.php b/phpBB/includes/acp/info/acp_logs.php
index e9e6034cd4..efa35b2118 100644
--- a/phpBB/includes/acp/info/acp_logs.php
+++ b/phpBB/includes/acp/info/acp_logs.php
@@ -18,7 +18,6 @@ class acp_logs_info
return array(
'filename' => 'acp_logs',
'title' => 'ACP_LOGGING',
- 'version' => '1.0.0',
'modes' => array(
'admin' => array('title' => 'ACP_ADMIN_LOGS', 'auth' => 'acl_a_viewlogs', 'cat' => array('ACP_FORUM_LOGS')),
'mod' => array('title' => 'ACP_MOD_LOGS', 'auth' => 'acl_a_viewlogs', 'cat' => array('ACP_FORUM_LOGS')),
diff --git a/phpBB/includes/acp/info/acp_main.php b/phpBB/includes/acp/info/acp_main.php
index 51259e3bd9..48d35da585 100644
--- a/phpBB/includes/acp/info/acp_main.php
+++ b/phpBB/includes/acp/info/acp_main.php
@@ -18,7 +18,6 @@ class acp_main_info
return array(
'filename' => 'acp_main',
'title' => 'ACP_INDEX',
- 'version' => '1.0.0',
'modes' => array(
'main' => array('title' => 'ACP_INDEX', 'auth' => '', 'cat' => array('ACP_CAT_GENERAL')),
),
diff --git a/phpBB/includes/acp/info/acp_modules.php b/phpBB/includes/acp/info/acp_modules.php
index a47cd4ad83..073e69c6a8 100644
--- a/phpBB/includes/acp/info/acp_modules.php
+++ b/phpBB/includes/acp/info/acp_modules.php
@@ -18,7 +18,6 @@ class acp_modules_info
return array(
'filename' => 'acp_modules',
'title' => 'ACP_MODULE_MANAGEMENT',
- 'version' => '1.0.0',
'modes' => array(
'acp' => array('title' => 'ACP', 'auth' => 'acl_a_modules', 'cat' => array('ACP_MODULE_MANAGEMENT')),
'ucp' => array('title' => 'UCP', 'auth' => 'acl_a_modules', 'cat' => array('ACP_MODULE_MANAGEMENT')),
diff --git a/phpBB/includes/acp/info/acp_permission_roles.php b/phpBB/includes/acp/info/acp_permission_roles.php
index e8aa13375d..34af693b7b 100644
--- a/phpBB/includes/acp/info/acp_permission_roles.php
+++ b/phpBB/includes/acp/info/acp_permission_roles.php
@@ -18,7 +18,6 @@ class acp_permission_roles_info
return array(
'filename' => 'acp_permission_roles',
'title' => 'ACP_PERMISSION_ROLES',
- 'version' => '1.0.0',
'modes' => array(
'admin_roles' => array('title' => 'ACP_ADMIN_ROLES', 'auth' => 'acl_a_roles && acl_a_aauth', 'cat' => array('ACP_PERMISSION_ROLES')),
'user_roles' => array('title' => 'ACP_USER_ROLES', 'auth' => 'acl_a_roles && acl_a_uauth', 'cat' => array('ACP_PERMISSION_ROLES')),
diff --git a/phpBB/includes/acp/info/acp_permissions.php b/phpBB/includes/acp/info/acp_permissions.php
index 3ec592a300..3d415f2b72 100644
--- a/phpBB/includes/acp/info/acp_permissions.php
+++ b/phpBB/includes/acp/info/acp_permissions.php
@@ -18,7 +18,6 @@ class acp_permissions_info
return array(
'filename' => 'acp_permissions',
'title' => 'ACP_PERMISSIONS',
- 'version' => '1.0.0',
'modes' => array(
'intro' => array('title' => 'ACP_PERMISSIONS', 'auth' => 'acl_a_authusers || acl_a_authgroups || acl_a_viewauth', 'cat' => array('ACP_CAT_PERMISSIONS')),
'trace' => array('title' => 'ACP_PERMISSION_TRACE', 'auth' => 'acl_a_viewauth', 'display' => false, 'cat' => array('ACP_PERMISSION_MASKS')),
diff --git a/phpBB/includes/acp/info/acp_php_info.php b/phpBB/includes/acp/info/acp_php_info.php
index af978e0daa..c5e60c7e66 100644
--- a/phpBB/includes/acp/info/acp_php_info.php
+++ b/phpBB/includes/acp/info/acp_php_info.php
@@ -18,7 +18,6 @@ class acp_php_info_info
return array(
'filename' => 'acp_php_info',
'title' => 'ACP_PHP_INFO',
- 'version' => '1.0.0',
'modes' => array(
'info' => array('title' => 'ACP_PHP_INFO', 'auth' => 'acl_a_phpinfo', 'cat' => array('ACP_GENERAL_TASKS')),
),
diff --git a/phpBB/includes/acp/info/acp_profile.php b/phpBB/includes/acp/info/acp_profile.php
index 307e711eee..ede34204b4 100644
--- a/phpBB/includes/acp/info/acp_profile.php
+++ b/phpBB/includes/acp/info/acp_profile.php
@@ -18,7 +18,6 @@ class acp_profile_info
return array(
'filename' => 'acp_profile',
'title' => 'ACP_CUSTOM_PROFILE_FIELDS',
- 'version' => '1.0.0',
'modes' => array(
'profile' => array('title' => 'ACP_CUSTOM_PROFILE_FIELDS', 'auth' => 'acl_a_profile', 'cat' => array('ACP_CAT_USERS')),
),
diff --git a/phpBB/includes/acp/info/acp_prune.php b/phpBB/includes/acp/info/acp_prune.php
index 58cb1ba9ab..74e5248aa9 100644
--- a/phpBB/includes/acp/info/acp_prune.php
+++ b/phpBB/includes/acp/info/acp_prune.php
@@ -18,7 +18,6 @@ class acp_prune_info
return array(
'filename' => 'acp_prune',
'title' => 'ACP_PRUNING',
- 'version' => '1.0.0',
'modes' => array(
'forums' => array('title' => 'ACP_PRUNE_FORUMS', 'auth' => 'acl_a_prune', 'cat' => array('ACP_MANAGE_FORUMS')),
'users' => array('title' => 'ACP_PRUNE_USERS', 'auth' => 'acl_a_userdel', 'cat' => array('ACP_CAT_USERS')),
diff --git a/phpBB/includes/acp/info/acp_ranks.php b/phpBB/includes/acp/info/acp_ranks.php
index 3cc9b4a428..9bf51eba3c 100644
--- a/phpBB/includes/acp/info/acp_ranks.php
+++ b/phpBB/includes/acp/info/acp_ranks.php
@@ -18,7 +18,6 @@ class acp_ranks_info
return array(
'filename' => 'acp_ranks',
'title' => 'ACP_RANKS',
- 'version' => '1.0.0',
'modes' => array(
'ranks' => array('title' => 'ACP_MANAGE_RANKS', 'auth' => 'acl_a_ranks', 'cat' => array('ACP_CAT_USERS')),
),
diff --git a/phpBB/includes/acp/info/acp_reasons.php b/phpBB/includes/acp/info/acp_reasons.php
index c48fd1aacd..55a0495d0f 100644
--- a/phpBB/includes/acp/info/acp_reasons.php
+++ b/phpBB/includes/acp/info/acp_reasons.php
@@ -18,7 +18,6 @@ class acp_reasons_info
return array(
'filename' => 'acp_reasons',
'title' => 'ACP_REASONS',
- 'version' => '1.0.0',
'modes' => array(
'main' => array('title' => 'ACP_MANAGE_REASONS', 'auth' => 'acl_a_reasons', 'cat' => array('ACP_GENERAL_TASKS')),
),
diff --git a/phpBB/includes/acp/info/acp_search.php b/phpBB/includes/acp/info/acp_search.php
index 5d681a7174..0635dd9edd 100644
--- a/phpBB/includes/acp/info/acp_search.php
+++ b/phpBB/includes/acp/info/acp_search.php
@@ -18,7 +18,6 @@ class acp_search_info
return array(
'filename' => 'acp_search',
'title' => 'ACP_SEARCH',
- 'version' => '1.0.0',
'modes' => array(
'settings' => array('title' => 'ACP_SEARCH_SETTINGS', 'auth' => 'acl_a_search', 'cat' => array('ACP_SERVER_CONFIGURATION')),
'index' => array('title' => 'ACP_SEARCH_INDEX', 'auth' => 'acl_a_search', 'cat' => array('ACP_CAT_DATABASE')),
diff --git a/phpBB/includes/acp/info/acp_send_statistics.php b/phpBB/includes/acp/info/acp_send_statistics.php
index a4f2ddc420..a0db1a48c4 100644
--- a/phpBB/includes/acp/info/acp_send_statistics.php
+++ b/phpBB/includes/acp/info/acp_send_statistics.php
@@ -18,7 +18,6 @@ class acp_send_statistics_info
return array(
'filename' => 'acp_send_statistics',
'title' => 'ACP_SEND_STATISTICS',
- 'version' => '1.0.0',
'modes' => array(
'send_statistics' => array('title' => 'ACP_SEND_STATISTICS', 'auth' => 'acl_a_server', 'cat' => array('ACP_SERVER_CONFIGURATION')),
),
diff --git a/phpBB/includes/acp/info/acp_styles.php b/phpBB/includes/acp/info/acp_styles.php
index c0ab005502..59b0a64899 100644
--- a/phpBB/includes/acp/info/acp_styles.php
+++ b/phpBB/includes/acp/info/acp_styles.php
@@ -18,7 +18,6 @@ class acp_styles_info
return array(
'filename' => 'acp_styles',
'title' => 'ACP_CAT_STYLES',
- 'version' => '2.0.0',
'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')),
diff --git a/phpBB/includes/acp/info/acp_update.php b/phpBB/includes/acp/info/acp_update.php
index ca00f6d305..7806fb4891 100644
--- a/phpBB/includes/acp/info/acp_update.php
+++ b/phpBB/includes/acp/info/acp_update.php
@@ -18,7 +18,6 @@ class acp_update_info
return array(
'filename' => 'acp_update',
'title' => 'ACP_UPDATE',
- 'version' => '1.0.0',
'modes' => array(
'version_check' => array('title' => 'ACP_VERSION_CHECK', 'auth' => 'acl_a_board', 'cat' => array('ACP_AUTOMATION')),
),
diff --git a/phpBB/includes/acp/info/acp_users.php b/phpBB/includes/acp/info/acp_users.php
index ab69523cde..cb59d24293 100644
--- a/phpBB/includes/acp/info/acp_users.php
+++ b/phpBB/includes/acp/info/acp_users.php
@@ -18,7 +18,6 @@ class acp_users_info
return array(
'filename' => 'acp_users',
'title' => 'ACP_USER_MANAGEMENT',
- 'version' => '1.0.0',
'modes' => array(
'overview' => array('title' => 'ACP_MANAGE_USERS', 'auth' => 'acl_a_user', 'cat' => array('ACP_CAT_USERS')),
'feedback' => array('title' => 'ACP_USER_FEEDBACK', 'auth' => 'acl_a_user', 'display' => false, 'cat' => array('ACP_CAT_USERS')),
diff --git a/phpBB/includes/acp/info/acp_words.php b/phpBB/includes/acp/info/acp_words.php
index 3c8c79f25f..8a6d0d7f20 100644
--- a/phpBB/includes/acp/info/acp_words.php
+++ b/phpBB/includes/acp/info/acp_words.php
@@ -18,7 +18,6 @@ class acp_words_info
return array(
'filename' => 'acp_words',
'title' => 'ACP_WORDS',
- 'version' => '1.0.0',
'modes' => array(
'words' => array('title' => 'ACP_WORDS', 'auth' => 'acl_a_words', 'cat' => array('ACP_MESSAGES')),
),
diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php
index 86390c0901..41d4ec40fe 100644
--- a/phpBB/includes/bbcode.php
+++ b/phpBB/includes/bbcode.php
@@ -110,7 +110,18 @@ class bbcode
$undid_bbcode_specialchars = true;
}
- $message = preg_replace($preg['search'], $preg['replace'], $message);
+ foreach ($preg['search'] as $key => $search)
+ {
+ if (is_callable($preg['replace'][$key]))
+ {
+ $message = preg_replace_callback($search, $preg['replace'][$key], $message);
+ }
+ else
+ {
+ $message = preg_replace($search, $preg['replace'][$key], $message);
+ }
+ }
+
$preg = array('search' => array(), 'replace' => array());
}
}
@@ -129,13 +140,33 @@ class bbcode
*/
function bbcode_cache_init()
{
- global $phpbb_root_path, $phpEx, $config, $user, $phpbb_dispatcher, $phpbb_extension_manager, $phpbb_path_helper;
+ global $phpbb_root_path, $phpEx, $config, $user, $phpbb_dispatcher, $phpbb_extension_manager, $phpbb_path_helper, $phpbb_container, $phpbb_filesystem;
if (empty($this->template_filename))
{
$this->template_bitfield = new bitfield($user->style['bbcode_bitfield']);
- $template = new phpbb\template\twig\twig($phpbb_path_helper, $config, $user, new phpbb\template\context(), $phpbb_extension_manager);
+ $template = new \phpbb\template\twig\twig(
+ $phpbb_container->get('path_helper'),
+ $phpbb_container->get('config'),
+ new \phpbb\template\context(),
+ new \phpbb\template\twig\environment(
+ $phpbb_container->get('config'),
+ $phpbb_container->get('filesystem'),
+ $phpbb_container->get('path_helper'),
+ $phpbb_container,
+ $phpbb_container->getParameter('core.root_path') . 'cache/',
+ $phpbb_container->get('ext.manager'),
+ new \phpbb\template\twig\loader(
+ $phpbb_filesystem
+ )
+ ),
+ $phpbb_container->getParameter('core.root_path') . 'cache/',
+ $phpbb_container->get('user'),
+ $phpbb_container->get('template.twig.extensions.collection'),
+ $phpbb_extension_manager
+ );
+
$template->set_style();
$template->set_filenames(array('bbcode.html' => 'bbcode.html'));
$this->template_filename = $template->get_source_file_for_handle('bbcode.html');
@@ -194,7 +225,9 @@ class bbcode
'[/quote:$uid]' => $this->bbcode_tpl('quote_close', $bbcode_id)
),
'preg' => array(
- '#\[quote(?:=&quot;(.*?)&quot;)?:$uid\]((?!\[quote(?:=&quot;.*?&quot;)?:$uid\]).)?#ise' => "\$this->bbcode_second_pass_quote('\$1', '\$2')"
+ '#\[quote(?:=&quot;(.*?)&quot;)?:$uid\]((?!\[quote(?:=&quot;.*?&quot;)?:$uid\]).)?#is' => function ($match) {
+ return $this->bbcode_second_pass_quote($match[1], $match[2]);
+ },
)
);
break;
@@ -273,7 +306,9 @@ class bbcode
case 8:
$this->bbcode_cache[$bbcode_id] = array(
'preg' => array(
- '#\[code(?:=([a-z]+))?:$uid\](.*?)\[/code:$uid\]#ise' => "\$this->bbcode_second_pass_code('\$1', '\$2')",
+ '#\[code(?:=([a-z]+))?:$uid\](.*?)\[/code:$uid\]#is' => function ($match) {
+ return $this->bbcode_second_pass_code($match[1], $match[2]);
+ },
)
);
break;
@@ -283,7 +318,9 @@ class bbcode
'preg' => array(
'#(\[\/?(list|\*):[mou]?:?$uid\])[\n]{1}#' => "\$1",
'#(\[list=([^\[]+):$uid\])[\n]{1}#' => "\$1",
- '#\[list=([^\[]+):$uid\]#e' => "\$this->bbcode_list('\$1')",
+ '#\[list=([^\[]+):$uid\]#' => function ($match) {
+ return $this->bbcode_list($match[1]);
+ },
),
'str' => array(
'[list:$uid]' => $this->bbcode_tpl('ulist_open_default', $bbcode_id),
@@ -367,7 +404,9 @@ class bbcode
}
// Replace {L_*} lang strings
- $bbcode_tpl = preg_replace('/{L_([A-Z0-9_]+)}/e', "(!empty(\$user->lang['\$1'])) ? \$user->lang['\$1'] : ucwords(strtolower(str_replace('_', ' ', '\$1')))", $bbcode_tpl);
+ $bbcode_tpl = preg_replace_callback('/{L_([A-Z0-9_]+)}/', function ($match) use ($user) {
+ return (!empty($user->lang[$match[1]])) ? $user->lang($match[1]) : ucwords(strtolower(str_replace('_', ' ', $match[1])));
+ }, $bbcode_tpl);
if (!empty($rowset[$bbcode_id]['second_pass_replace']))
{
@@ -491,7 +530,9 @@ class bbcode
'email' => array('{EMAIL}' => '$1', '{DESCRIPTION}' => '$2')
);
- $tpl = preg_replace('/{L_([A-Z0-9_]+)}/e', "(!empty(\$user->lang['\$1'])) ? \$user->lang['\$1'] : ucwords(strtolower(str_replace('_', ' ', '\$1')))", $tpl);
+ $tpl = preg_replace_callback('/{L_([A-Z0-9_]+)}/', function ($match) use ($user) {
+ return (!empty($user->lang[$match[1]])) ? $user->lang($match[1]) : ucwords(strtolower(str_replace('_', ' ', $match[1])));
+ }, $tpl);
if (!empty($replacements[$tpl_name]))
{
diff --git a/phpBB/includes/compatibility_globals.php b/phpBB/includes/compatibility_globals.php
index 54c9287c96..ae532c0f13 100644
--- a/phpBB/includes/compatibility_globals.php
+++ b/phpBB/includes/compatibility_globals.php
@@ -18,30 +18,62 @@ if (!defined('IN_PHPBB'))
exit;
}
-// set up caching
-$cache = $phpbb_container->get('cache');
+/**
+ * Sets compatibility globals in the global scope
+ *
+ * This function registers compatibility variables to the global
+ * variable scope. This is required to make it possible to include this file
+ * in a service.
+ */
+function register_compatibility_globals()
+{
+ global $phpbb_container;
+
+ global $cache, $phpbb_dispatcher, $request, $user, $auth, $db, $config, $phpbb_log;
+ global $symfony_request, $phpbb_filesystem, $phpbb_path_helper, $phpbb_extension_manager, $template;
+
+ // set up caching
+ /* @var $cache \phpbb\cache\service */
+ $cache = $phpbb_container->get('cache');
+
+ // Instantiate some basic classes
+ /* @var $phpbb_dispatcher \phpbb\event\dispatcher */
+ $phpbb_dispatcher = $phpbb_container->get('dispatcher');
+
+ /* @var $request \phpbb\request\request_interface */
+ $request = $phpbb_container->get('request');
-// Instantiate some basic classes
-$phpbb_dispatcher = $phpbb_container->get('dispatcher');
-$request = $phpbb_container->get('request');
-$user = $phpbb_container->get('user');
-$auth = $phpbb_container->get('auth');
-$db = $phpbb_container->get('dbal.conn');
+ /* @var $user \phpbb\user */
+ $user = $phpbb_container->get('user');
-// make sure request_var uses this request instance
-request_var('', 0, false, false, $request); // "dependency injection" for a function
+ /* @var $auth \phpbb\auth\auth */
+ $auth = $phpbb_container->get('auth');
-// Grab global variables, re-cache if necessary
-$config = $phpbb_container->get('config');
-set_config(null, null, null, $config);
-set_config_count(null, null, null, $config);
+ /* @var $db \phpbb\db\driver\driver_interface */
+ $db = $phpbb_container->get('dbal.conn');
-$phpbb_log = $phpbb_container->get('log');
-$symfony_request = $phpbb_container->get('symfony_request');
-$phpbb_filesystem = $phpbb_container->get('filesystem');
-$phpbb_path_helper = $phpbb_container->get('path_helper');
+ // Grab global variables, re-cache if necessary
+ /* @var $config phpbb\config\db */
+ $config = $phpbb_container->get('config');
-// load extensions
-$phpbb_extension_manager = $phpbb_container->get('ext.manager');
+ /* @var $phpbb_log \phpbb\log\log_interface */
+ $phpbb_log = $phpbb_container->get('log');
+
+ /* @var $symfony_request \phpbb\symfony_request */
+ $symfony_request = $phpbb_container->get('symfony_request');
+
+ /* @var $phpbb_filesystem \phpbb\filesystem\filesystem_interface */
+ $phpbb_filesystem = $phpbb_container->get('filesystem');
+
+ /* @var $phpbb_path_helper \phpbb\path_helper */
+ $phpbb_path_helper = $phpbb_container->get('path_helper');
+
+ // load extensions
+ /* @var $phpbb_extension_manager \phpbb\extension\manager */
+ $phpbb_extension_manager = $phpbb_container->get('ext.manager');
+
+ /* @var $template \phpbb\template\template */
+ $template = $phpbb_container->get('template');
+}
-$template = $phpbb_container->get('template');
+register_compatibility_globals();
diff --git a/phpBB/includes/constants.php b/phpBB/includes/constants.php
index ab943c2f86..bd73201290 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.7-dev');
+define('PHPBB_VERSION', '3.2.0-a1-dev');
// QA-related
// define('PHPBB_QA', 1);
@@ -171,11 +171,11 @@ define('CONFIRM_REPORT', 4);
// Categories - Attachments
define('ATTACHMENT_CATEGORY_NONE', 0);
define('ATTACHMENT_CATEGORY_IMAGE', 1); // Inline Images
-define('ATTACHMENT_CATEGORY_WM', 2); // Windows Media Files - Streaming
-define('ATTACHMENT_CATEGORY_RM', 3); // Real Media Files - Streaming
+define('ATTACHMENT_CATEGORY_WM', 2); // Windows Media Files - Streaming - @deprecated 3.2
+define('ATTACHMENT_CATEGORY_RM', 3); // Real Media Files - Streaming - @deprecated 3.2
define('ATTACHMENT_CATEGORY_THUMB', 4); // Not used within the database, only while displaying posts
define('ATTACHMENT_CATEGORY_FLASH', 5); // Flash/SWF files
-define('ATTACHMENT_CATEGORY_QUICKTIME', 6); // Quicktime/Mov files
+define('ATTACHMENT_CATEGORY_QUICKTIME', 6); // Quicktime/Mov files - @deprecated 3.2
// BBCode UID length
define('BBCODE_UID_LEN', 8);
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 80d6e22bb7..311208baf3 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -64,135 +64,6 @@ function set_var(&$result, $var, $type, $multibyte = false)
}
/**
-* Wrapper function of \phpbb\request\request::variable which exists for backwards compatability.
-* See {@link \phpbb\request\request_interface::variable \phpbb\request\request_interface::variable} for
-* documentation of this function's use.
-*
-* @deprecated
-* @param mixed $var_name The form variable's name from which data shall be retrieved.
-* If the value is an array this may be an array of indizes which will give
-* direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a")
-* then specifying array("var", 1) as the name will return "a".
-* If you pass an instance of {@link \phpbb\request\request_interface phpbb_request_interface}
-* as this parameter it will overwrite the current request class instance. If you do
-* not do so, it will create its own instance (but leave superglobals enabled).
-* @param mixed $default A default value that is returned if the variable was not set.
-* This function will always return a value of the same type as the default.
-* @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters
-* Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
-* @param bool $cookie This param is mapped to \phpbb\request\request_interface::COOKIE as the last param for
-* \phpbb\request\request_interface::variable for backwards compatability reasons.
-* @param \phpbb\request\request_interface|null|false If an instance of \phpbb\request\request_interface is given the instance is stored in
-* a static variable and used for all further calls where this parameters is null. Until
-* the function is called with an instance it automatically creates a new \phpbb\request\request
-* instance on every call. By passing false this per-call instantiation can be restored
-* after having passed in a \phpbb\request\request_interface instance.
-*
-* @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
-* the same as that of $default. If the variable is not set $default is returned.
-*/
-function request_var($var_name, $default, $multibyte = false, $cookie = false, $request = null)
-{
- // This is all just an ugly hack to add "Dependency Injection" to a function
- // the only real code is the function call which maps this function to a method.
- static $static_request = null;
-
- if ($request instanceof \phpbb\request\request_interface)
- {
- $static_request = $request;
-
- if (empty($var_name))
- {
- return;
- }
- }
- else if ($request === false)
- {
- $static_request = null;
-
- if (empty($var_name))
- {
- return;
- }
- }
-
- $tmp_request = $static_request;
-
- // no request class set, create a temporary one ourselves to keep backwards compatability
- if ($tmp_request === null)
- {
- // false param: enable super globals, so the created request class does not
- // make super globals inaccessible everywhere outside this function.
- $tmp_request = new \phpbb\request\request(new \phpbb\request\type_cast_helper(), false);
- }
-
- return $tmp_request->variable($var_name, $default, $multibyte, ($cookie) ? \phpbb\request\request_interface::COOKIE : \phpbb\request\request_interface::REQUEST);
-}
-
-/**
-* Sets a configuration option's value.
-*
-* Please note that this function does not update the is_dynamic value for
-* an already existing config option.
-*
-* @param string $config_name The configuration option's name
-* @param string $config_value New configuration value
-* @param bool $is_dynamic Whether this variable should be cached (false) or
-* if it changes too frequently (true) to be
-* efficiently cached.
-*
-* @return null
-*
-* @deprecated
-*/
-function set_config($config_name, $config_value, $is_dynamic = false, \phpbb\config\config $set_config = null)
-{
- static $config = null;
-
- if ($set_config !== null)
- {
- $config = $set_config;
-
- if (empty($config_name))
- {
- return;
- }
- }
-
- $config->set($config_name, $config_value, !$is_dynamic);
-}
-
-/**
-* Increments an integer config value directly in the database.
-*
-* @param string $config_name The configuration option's name
-* @param int $increment Amount to increment by
-* @param bool $is_dynamic Whether this variable should be cached (false) or
-* if it changes too frequently (true) to be
-* efficiently cached.
-*
-* @return null
-*
-* @deprecated
-*/
-function set_config_count($config_name, $increment, $is_dynamic = false, \phpbb\config\config $set_config = null)
-{
- static $config = null;
-
- if ($set_config !== null)
- {
- $config = $set_config;
-
- if (empty($config_name))
- {
- return;
- }
- }
-
- $config->increment($config_name, $increment, !$is_dynamic);
-}
-
-/**
* Generates an alphanumeric random string of given length
*
* @return string
@@ -235,8 +106,8 @@ function unique_id($extra = 'c')
if ($dss_seeded !== true && ($config['rand_seed_last_update'] < time() - rand(1,10)))
{
- set_config('rand_seed_last_update', time(), true);
- set_config('rand_seed', $config['rand_seed'], true);
+ $config->set('rand_seed_last_update', time(), false);
+ $config->set('rand_seed', $config['rand_seed'], false);
$dss_seeded = true;
}
@@ -376,8 +247,7 @@ function still_on_time($extra_time = 15)
{
static $max_execution_time, $start_time;
- $time = explode(' ', microtime());
- $current_time = $time[0] + $time[1];
+ $current_time = microtime(true);
if (empty($max_execution_time))
{
@@ -441,448 +311,6 @@ function phpbb_version_compare($version1, $version2, $operator = null)
}
}
-/**
-* Global function for chmodding directories and files for internal use
-*
-* This function determines owner and group whom the file belongs to and user and group of PHP and then set safest possible file permissions.
-* The function determines owner and group from common.php file and sets the same to the provided file.
-* The function uses bit fields to build the permissions.
-* The function sets the appropiate execute bit on directories.
-*
-* Supported constants representing bit fields are:
-*
-* CHMOD_ALL - all permissions (7)
-* CHMOD_READ - read permission (4)
-* CHMOD_WRITE - write permission (2)
-* CHMOD_EXECUTE - execute permission (1)
-*
-* NOTE: The function uses POSIX extension and fileowner()/filegroup() functions. If any of them is disabled, this function tries to build proper permissions, by calling is_readable() and is_writable() functions.
-*
-* @param string $filename The file/directory to be chmodded
-* @param int $perms Permissions to set
-*
-* @return bool true on success, otherwise false
-*/
-function phpbb_chmod($filename, $perms = CHMOD_READ)
-{
- static $_chmod_info;
-
- // Return if the file no longer exists.
- if (!file_exists($filename))
- {
- return false;
- }
-
- // Determine some common vars
- if (empty($_chmod_info))
- {
- if (!function_exists('fileowner') || !function_exists('filegroup'))
- {
- // No need to further determine owner/group - it is unknown
- $_chmod_info['process'] = false;
- }
- else
- {
- global $phpbb_root_path, $phpEx;
-
- // Determine owner/group of common.php file and the filename we want to change here
- $common_php_owner = @fileowner($phpbb_root_path . 'common.' . $phpEx);
- $common_php_group = @filegroup($phpbb_root_path . 'common.' . $phpEx);
-
- // And the owner and the groups PHP is running under.
- $php_uid = (function_exists('posix_getuid')) ? @posix_getuid() : false;
- $php_gids = (function_exists('posix_getgroups')) ? @posix_getgroups() : false;
-
- // If we are unable to get owner/group, then do not try to set them by guessing
- if (!$php_uid || empty($php_gids) || !$common_php_owner || !$common_php_group)
- {
- $_chmod_info['process'] = false;
- }
- else
- {
- $_chmod_info = array(
- 'process' => true,
- 'common_owner' => $common_php_owner,
- 'common_group' => $common_php_group,
- 'php_uid' => $php_uid,
- 'php_gids' => $php_gids,
- );
- }
- }
- }
-
- if ($_chmod_info['process'])
- {
- $file_uid = @fileowner($filename);
- $file_gid = @filegroup($filename);
-
- // Change owner
- if (@chown($filename, $_chmod_info['common_owner']))
- {
- clearstatcache();
- $file_uid = @fileowner($filename);
- }
-
- // Change group
- if (@chgrp($filename, $_chmod_info['common_group']))
- {
- clearstatcache();
- $file_gid = @filegroup($filename);
- }
-
- // If the file_uid/gid now match the one from common.php we can process further, else we are not able to change something
- if ($file_uid != $_chmod_info['common_owner'] || $file_gid != $_chmod_info['common_group'])
- {
- $_chmod_info['process'] = false;
- }
- }
-
- // Still able to process?
- if ($_chmod_info['process'])
- {
- if ($file_uid == $_chmod_info['php_uid'])
- {
- $php = 'owner';
- }
- else if (in_array($file_gid, $_chmod_info['php_gids']))
- {
- $php = 'group';
- }
- else
- {
- // Since we are setting the everyone bit anyway, no need to do expensive operations
- $_chmod_info['process'] = false;
- }
- }
-
- // We are not able to determine or change something
- if (!$_chmod_info['process'])
- {
- $php = 'other';
- }
-
- // Owner always has read/write permission
- $owner = CHMOD_READ | CHMOD_WRITE;
- if (is_dir($filename))
- {
- $owner |= CHMOD_EXECUTE;
-
- // Only add execute bit to the permission if the dir needs to be readable
- if ($perms & CHMOD_READ)
- {
- $perms |= CHMOD_EXECUTE;
- }
- }
-
- switch ($php)
- {
- case 'owner':
- $result = @chmod($filename, ($owner << 6) + (0 << 3) + (0 << 0));
-
- clearstatcache();
-
- if (is_readable($filename) && phpbb_is_writable($filename))
- {
- break;
- }
-
- case 'group':
- $result = @chmod($filename, ($owner << 6) + ($perms << 3) + (0 << 0));
-
- clearstatcache();
-
- if ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || phpbb_is_writable($filename)))
- {
- break;
- }
-
- case 'other':
- $result = @chmod($filename, ($owner << 6) + ($perms << 3) + ($perms << 0));
-
- clearstatcache();
-
- if ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || phpbb_is_writable($filename)))
- {
- break;
- }
-
- default:
- return false;
- break;
- }
-
- return $result;
-}
-
-/**
-* Test if a file/directory is writable
-*
-* This function calls the native is_writable() when not running under
-* Windows and it is not disabled.
-*
-* @param string $file Path to perform write test on
-* @return bool True when the path is writable, otherwise false.
-*/
-function phpbb_is_writable($file)
-{
- if (strtolower(substr(PHP_OS, 0, 3)) === 'win' || !function_exists('is_writable'))
- {
- if (file_exists($file))
- {
- // Canonicalise path to absolute path
- $file = phpbb_realpath($file);
-
- if (is_dir($file))
- {
- // Test directory by creating a file inside the directory
- $result = @tempnam($file, 'i_w');
-
- if (is_string($result) && file_exists($result))
- {
- unlink($result);
-
- // Ensure the file is actually in the directory (returned realpathed)
- return (strpos($result, $file) === 0) ? true : false;
- }
- }
- else
- {
- $handle = @fopen($file, 'r+');
-
- if (is_resource($handle))
- {
- fclose($handle);
- return true;
- }
- }
- }
- else
- {
- // file does not exist test if we can write to the directory
- $dir = dirname($file);
-
- if (file_exists($dir) && is_dir($dir) && phpbb_is_writable($dir))
- {
- return true;
- }
- }
-
- return false;
- }
- else
- {
- return is_writable($file);
- }
-}
-
-/**
-* Checks if a path ($path) is absolute or relative
-*
-* @param string $path Path to check absoluteness of
-* @return boolean
-*/
-function phpbb_is_absolute($path)
-{
- return (isset($path[0]) && $path[0] == '/' || preg_match('#^[a-z]:[/\\\]#i', $path)) ? true : false;
-}
-
-/**
-* @author Chris Smith <chris@project-minerva.org>
-* @copyright 2006 Project Minerva Team
-* @param string $path The path which we should attempt to resolve.
-* @return mixed
-*/
-function phpbb_own_realpath($path)
-{
- global $request;
-
- // Now to perform funky shizzle
-
- // Switch to use UNIX slashes
- $path = str_replace(DIRECTORY_SEPARATOR, '/', $path);
- $path_prefix = '';
-
- // Determine what sort of path we have
- if (phpbb_is_absolute($path))
- {
- $absolute = true;
-
- if ($path[0] == '/')
- {
- // Absolute path, *NIX style
- $path_prefix = '';
- }
- else
- {
- // Absolute path, Windows style
- // Remove the drive letter and colon
- $path_prefix = $path[0] . ':';
- $path = substr($path, 2);
- }
- }
- else
- {
- // Relative Path
- // Prepend the current working directory
- if (function_exists('getcwd'))
- {
- // This is the best method, hopefully it is enabled!
- $path = str_replace(DIRECTORY_SEPARATOR, '/', getcwd()) . '/' . $path;
- $absolute = true;
- if (preg_match('#^[a-z]:#i', $path))
- {
- $path_prefix = $path[0] . ':';
- $path = substr($path, 2);
- }
- else
- {
- $path_prefix = '';
- }
- }
- else if ($request->server('SCRIPT_FILENAME'))
- {
- // Warning: If chdir() has been used this will lie!
- // Warning: This has some problems sometime (CLI can create them easily)
- $filename = htmlspecialchars_decode($request->server('SCRIPT_FILENAME'));
- $path = str_replace(DIRECTORY_SEPARATOR, '/', dirname($filename)) . '/' . $path;
- $absolute = true;
- $path_prefix = '';
- }
- else
- {
- // We have no way of getting the absolute path, just run on using relative ones.
- $absolute = false;
- $path_prefix = '.';
- }
- }
-
- // Remove any repeated slashes
- $path = preg_replace('#/{2,}#', '/', $path);
-
- // Remove the slashes from the start and end of the path
- $path = trim($path, '/');
-
- // Break the string into little bits for us to nibble on
- $bits = explode('/', $path);
-
- // Remove any . in the path, renumber array for the loop below
- $bits = array_values(array_diff($bits, array('.')));
-
- // Lets get looping, run over and resolve any .. (up directory)
- for ($i = 0, $max = sizeof($bits); $i < $max; $i++)
- {
- // @todo Optimise
- if ($bits[$i] == '..' )
- {
- if (isset($bits[$i - 1]))
- {
- if ($bits[$i - 1] != '..')
- {
- // We found a .. and we are able to traverse upwards, lets do it!
- unset($bits[$i]);
- unset($bits[$i - 1]);
- $i -= 2;
- $max -= 2;
- $bits = array_values($bits);
- }
- }
- else if ($absolute) // ie. !isset($bits[$i - 1]) && $absolute
- {
- // We have an absolute path trying to descend above the root of the filesystem
- // ... Error!
- return false;
- }
- }
- }
-
- // Prepend the path prefix
- array_unshift($bits, $path_prefix);
-
- $resolved = '';
-
- $max = sizeof($bits) - 1;
-
- // Check if we are able to resolve symlinks, Windows cannot.
- $symlink_resolve = (function_exists('readlink')) ? true : false;
-
- foreach ($bits as $i => $bit)
- {
- if (@is_dir("$resolved/$bit") || ($i == $max && @is_file("$resolved/$bit")))
- {
- // Path Exists
- if ($symlink_resolve && is_link("$resolved/$bit") && ($link = readlink("$resolved/$bit")))
- {
- // Resolved a symlink.
- $resolved = $link . (($i == $max) ? '' : '/');
- continue;
- }
- }
- else
- {
- // Something doesn't exist here!
- // This is correct realpath() behaviour but sadly open_basedir and safe_mode make this problematic
- // return false;
- }
- $resolved .= $bit . (($i == $max) ? '' : '/');
- }
-
- // @todo If the file exists fine and open_basedir only has one path we should be able to prepend it
- // because we must be inside that basedir, the question is where...
- // @internal The slash in is_dir() gets around an open_basedir restriction
- if (!@file_exists($resolved) || (!@is_dir($resolved . '/') && !is_file($resolved)))
- {
- return false;
- }
-
- // Put the slashes back to the native operating systems slashes
- $resolved = str_replace('/', DIRECTORY_SEPARATOR, $resolved);
-
- // Check for DIRECTORY_SEPARATOR at the end (and remove it!)
- if (substr($resolved, -1) == DIRECTORY_SEPARATOR)
- {
- return substr($resolved, 0, -1);
- }
-
- return $resolved; // We got here, in the end!
-}
-
-if (!function_exists('realpath'))
-{
- /**
- * A wrapper for realpath
- * @ignore
- */
- function phpbb_realpath($path)
- {
- return phpbb_own_realpath($path);
- }
-}
-else
-{
- /**
- * A wrapper for realpath
- */
- function phpbb_realpath($path)
- {
- $realpath = realpath($path);
-
- // Strangely there are provider not disabling realpath but returning strange values. :o
- // We at least try to cope with them.
- if ($realpath === $path || $realpath === false)
- {
- return phpbb_own_realpath($path);
- }
-
- // Check for DIRECTORY_SEPARATOR at the end (and remove it!)
- if (substr($realpath, -1) == DIRECTORY_SEPARATOR)
- {
- $realpath = substr($realpath, 0, -1);
- }
-
- return $realpath;
- }
-}
-
// functions used for building option fields
/**
@@ -1192,11 +620,11 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
if ($forum_id === false || !sizeof($forum_id))
{
// Mark all forums read (index page)
-
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
// Mark all topic notifications read for this user
- $phpbb_notifications->mark_notifications_read(array(
+ $phpbb_notifications->mark_notifications(array(
'notification.type.topic',
'notification.type.quote',
'notification.type.bookmark',
@@ -1263,9 +691,10 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
$forum_id = array_unique($forum_id);
}
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
- $phpbb_notifications->mark_notifications_read_by_parent(array(
+ $phpbb_notifications->mark_notifications_by_parent(array(
'notification.type.topic',
'notification.type.approve_topic',
), $forum_id, $user->data['user_id'], $post_time);
@@ -1282,7 +711,7 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
}
$db->sql_freeresult($result);
- $phpbb_notifications->mark_notifications_read_by_parent(array(
+ $phpbb_notifications->mark_notifications_by_parent(array(
'notification.type.quote',
'notification.type.bookmark',
'notification.type.post',
@@ -1385,15 +814,16 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0, $
return;
}
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
// Mark post notifications read for this user in this topic
- $phpbb_notifications->mark_notifications_read(array(
+ $phpbb_notifications->mark_notifications(array(
'notification.type.topic',
'notification.type.approve_topic',
), $topic_id, $user->data['user_id'], $post_time);
- $phpbb_notifications->mark_notifications_read_by_parent(array(
+ $phpbb_notifications->mark_notifications_by_parent(array(
'notification.type.quote',
'notification.type.bookmark',
'notification.type.post',
@@ -1684,7 +1114,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 $config, $db, $user, $request;
global $phpbb_dispatcher;
$user_id = ($user_id === false) ? (int) $user->data['user_id'] : (int) $user_id;
@@ -1763,7 +1193,7 @@ function get_unread_topics($user_id = false, $sql_extra = '', $sql_sort = '', $s
if (empty($tracking_topics))
{
- $tracking_topics = request_var($config['cookie_name'] . '_track', '', false, true);
+ $tracking_topics = $request->variable($config['cookie_name'] . '_track', '', false, \phpbb\request\request_interface::COOKIE);
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
}
@@ -1855,6 +1285,7 @@ function update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_ti
// Handle update of unapproved topics info.
// Only update for moderators having m_approve permission for the forum.
+ /* @var $phpbb_content_visibility \phpbb\content_visibility */
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
// Check the forum for any left unread topics.
@@ -2292,7 +1723,7 @@ function redirect($url, $return = false, $disable_cd_check = false)
$failover_flag = false;
- if (empty($user->lang))
+ if (!$user->is_setup())
{
$user->add_lang('common');
}
@@ -2711,9 +2142,9 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
if ($check && $confirm)
{
- $user_id = request_var('confirm_uid', 0);
- $session_id = request_var('sess', '');
- $confirm_key = request_var('confirm_key', '');
+ $user_id = $request->variable('confirm_uid', 0);
+ $session_id = $request->variable('sess', '');
+ $confirm_key = $request->variable('confirm_key', '');
if ($user_id != $user->data['user_id'] || $session_id != $user->session_id || !$confirm_key || !$user->data['user_last_confirm_key'] || $confirm_key != $user->data['user_last_confirm_key'])
{
@@ -2755,7 +2186,7 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
);
// If activation key already exist, we better do not re-use the key (something very strange is going on...)
- if (request_var('confirm_key', ''))
+ if ($request->variable('confirm_key', ''))
{
// This should not occur, therefore we cancel the operation to safe the user
return false;
@@ -2811,12 +2242,12 @@ 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, $phpbb_dispatcher;
+ global $request, $phpbb_container, $phpbb_dispatcher, $phpbb_log;
$err = '';
// Make sure user->setup() has been called
- if (empty($user->lang))
+ if (!$user->is_setup())
{
$user->setup();
}
@@ -2828,7 +2259,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
// anonymous/inactive users are never able to go to the ACP even if they have the relevant permissions
if ($user->data['is_registered'])
{
- add_log('admin', 'LOG_ADMIN_AUTH_FAIL');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ADMIN_AUTH_FAIL');
}
trigger_error('NO_AUTH_ADMIN');
}
@@ -2838,13 +2269,13 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
// Get credential
if ($admin)
{
- $credential = request_var('credential', '');
+ $credential = $request->variable('credential', '');
if (strspn($credential, 'abcdef0123456789') !== strlen($credential) || strlen($credential) != 32)
{
if ($user->data['is_registered'])
{
- add_log('admin', 'LOG_ADMIN_AUTH_FAIL');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ADMIN_AUTH_FAIL');
}
trigger_error('NO_AUTH_ADMIN');
}
@@ -2856,7 +2287,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
$password = $request->untrimmed_variable('password', '', true);
}
- $username = request_var('username', '', true);
+ $username = $request->variable('username', '', true);
$autologin = $request->is_set_post('autologin');
$viewonline = (int) !$request->is_set_post('viewonline');
$admin = ($admin) ? 1 : 0;
@@ -2866,7 +2297,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
if ($admin && utf8_clean_string($username) != utf8_clean_string($user->data['username']))
{
// We log the attempt to use a different username...
- add_log('admin', 'LOG_ADMIN_AUTH_FAIL');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ADMIN_AUTH_FAIL');
trigger_error('NO_AUTH_ADMIN_USER_DIFFER');
}
@@ -2879,7 +2310,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
{
if ($result['status'] == LOGIN_SUCCESS)
{
- add_log('admin', 'LOG_ADMIN_AUTH_SUCCESS');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ADMIN_AUTH_SUCCESS');
}
else
{
@@ -2887,7 +2318,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
// anonymous/inactive users are never able to go to the ACP even if they have the relevant permissions
if ($user->data['is_registered'])
{
- add_log('admin', 'LOG_ADMIN_AUTH_FAIL');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ADMIN_AUTH_FAIL');
}
}
}
@@ -2895,7 +2326,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
// The result parameter is always an array, holding the relevant information...
if ($result['status'] == LOGIN_SUCCESS)
{
- $redirect = request_var('redirect', "{$phpbb_root_path}index.$phpEx");
+ $redirect = $request->variable('redirect', "{$phpbb_root_path}index.$phpEx");
/**
* This event allows an extension to modify the redirection when a user successfully logs in
@@ -2995,6 +2426,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
$s_hidden_fields['credential'] = $credential;
}
+ /* @var $provider_collection \phpbb\auth\provider_collection */
$provider_collection = $phpbb_container->get('auth.provider_collection');
$auth_provider = $provider_collection->get_provider();
@@ -3098,6 +2530,7 @@ function login_forum_box($forum_data)
}
$db->sql_freeresult($result);
+ /* @var $passwords_manager \phpbb\passwords\manager */
$passwords_manager = $phpbb_container->get('passwords.manager');
if ($passwords_manager->check($password, $forum_data['forum_password']))
@@ -3254,52 +2687,6 @@ function parse_cfg_file($filename, $lines = false)
}
/**
-* Add log entry
-*
-* @param string $mode The mode defines which log_type is used and from which log the entry is retrieved
-* @param int $forum_id Mode 'mod' ONLY: forum id of the related item, NOT INCLUDED otherwise
-* @param int $topic_id Mode 'mod' ONLY: topic id of the related item, NOT INCLUDED otherwise
-* @param int $reportee_id Mode 'user' ONLY: user id of the reportee, NOT INCLUDED otherwise
-* @param string $log_operation Name of the operation
-* @param array $additional_data More arguments can be added, depending on the log_type
-*
-* @return int|bool Returns the log_id, if the entry was added to the database, false otherwise.
-*
-* @deprecated Use $phpbb_log->add() instead
-*/
-function add_log()
-{
- global $phpbb_log, $user;
-
- $args = func_get_args();
- $mode = array_shift($args);
-
- // This looks kind of dirty, but add_log has some additional data before the log_operation
- $additional_data = array();
- switch ($mode)
- {
- case 'admin':
- case 'critical':
- break;
- case 'mod':
- $additional_data['forum_id'] = array_shift($args);
- $additional_data['topic_id'] = array_shift($args);
- break;
- case 'user':
- $additional_data['reportee_id'] = array_shift($args);
- break;
- }
-
- $log_operation = array_shift($args);
- $additional_data = array_merge($additional_data, $args);
-
- $user_id = (empty($user->data)) ? ANONYMOUS : $user->data['user_id'];
- $user_ip = (empty($user->ip)) ? '' : $user->ip;
-
- return $phpbb_log->add($mode, $user_id, $user_ip, $log_operation, time(), $additional_data);
-}
-
-/**
* Return a nicely formatted backtrace.
*
* Turns the array returned by debug_backtrace() into HTML markup.
@@ -3362,7 +2749,7 @@ function get_preg_expression($mode)
return array(
'#<!\-\- e \-\-><a href="mailto:(.*?)">.*?</a><!\-\- e \-\->#',
'#<!\-\- l \-\-><a (?:class="[\w-]+" )?href="(.*?)(?:(&amp;|\?)sid=[0-9a-f]{32})?">.*?</a><!\-\- l \-\->#',
- '#<!\-\- ([mw]) \-\-><a (?:class="[\w-]+" )?href="(.*?)">.*?</a><!\-\- \1 \-\->#',
+ '#<!\-\- ([mw]) \-\-><a (?:class="[\w-]+" )?href="(.*?)">(.*?)</a><!\-\- \1 \-\->#',
'#<!\-\- s(.*?) \-\-><img src="\{SMILIES_PATH\}\/.*? \/><!\-\- s\1 \-\->#',
'#<!\-\- .*? \-\->#s',
'#<.*?>#s',
@@ -3428,31 +2815,19 @@ function get_preg_expression($mode)
* Depends on whether installed PHP version supports unicode properties
*
* @param string $word word template to be replaced
-* @param bool $use_unicode whether or not to take advantage of PCRE supporting unicode
*
* @return string $preg_expr regex to use with word censor
*/
-function get_censor_preg_expression($word, $use_unicode = true)
+function get_censor_preg_expression($word)
{
// Unescape the asterisk to simplify further conversions
$word = str_replace('\*', '*', preg_quote($word, '#'));
- if ($use_unicode && phpbb_pcre_utf8_support())
- {
- // Replace asterisk(s) inside the pattern, at the start and at the end of it with regexes
- $word = preg_replace(array('#(?<=[\p{Nd}\p{L}_])\*+(?=[\p{Nd}\p{L}_])#iu', '#^\*+#', '#\*+$#'), array('([\x20]*?|[\p{Nd}\p{L}_-]*?)', '[\p{Nd}\p{L}_-]*?', '[\p{Nd}\p{L}_-]*?'), $word);
+ // Replace asterisk(s) inside the pattern, at the start and at the end of it with regexes
+ $word = preg_replace(array('#(?<=[\p{Nd}\p{L}_])\*+(?=[\p{Nd}\p{L}_])#iu', '#^\*+#', '#\*+$#'), array('([\x20]*?|[\p{Nd}\p{L}_-]*?)', '[\p{Nd}\p{L}_-]*?', '[\p{Nd}\p{L}_-]*?'), $word);
- // Generate the final substitution
- $preg_expr = '#(?<![\p{Nd}\p{L}_-])(' . $word . ')(?![\p{Nd}\p{L}_-])#iu';
- }
- else
- {
- // Replace the asterisk inside the pattern, at the start and at the end of it with regexes
- $word = preg_replace(array('#(?<=\S)\*+(?=\S)#iu', '#^\*+#', '#\*+$#'), array('(\x20*?\S*?)', '\S*?', '\S*?'), $word);
-
- // Generate the final substitution
- $preg_expr = '#(?<!\S)(' . $word . ')(?!\S)#iu';
- }
+ // Generate the final substitution
+ $preg_expr = '#(?<![\p{Nd}\p{L}_-])(' . $word . ')(?![\p{Nd}\p{L}_-])#iu';
return $preg_expr;
}
@@ -3700,38 +3075,12 @@ function phpbb_checkdnsrr($host, $type = 'MX')
return (@gethostbyname($host_fqdn) == $host_fqdn) ? false : true;
}
- // checkdnsrr() is available on Windows since PHP 5.3,
- // but until 5.3.3 it only works for MX records
- // See: http://bugs.php.net/bug.php?id=51844
-
- // Call checkdnsrr() if
- // we're looking for an MX record or
- // we're not on Windows or
- // we're running a PHP version where #51844 has been fixed
-
- // checkdnsrr() supports AAAA since 5.0.0
- // checkdnsrr() supports TXT since 5.2.4
- if (
- ($type == 'MX' || DIRECTORY_SEPARATOR != '\\' || version_compare(PHP_VERSION, '5.3.3', '>=')) &&
- ($type != 'AAAA' || version_compare(PHP_VERSION, '5.0.0', '>=')) &&
- ($type != 'TXT' || version_compare(PHP_VERSION, '5.2.4', '>=')) &&
- function_exists('checkdnsrr')
- )
+ if (function_exists('checkdnsrr'))
{
return checkdnsrr($host_fqdn, $type);
}
- // dns_get_record() is available since PHP 5; since PHP 5.3 also on Windows,
- // but on Windows it does not work reliable for AAAA records before PHP 5.3.1
-
- // Call dns_get_record() if
- // we're not looking for an AAAA record or
- // we're not on Windows or
- // we're running a PHP version where AAAA lookups work reliable
- if (
- ($type != 'AAAA' || DIRECTORY_SEPARATOR != '\\' || version_compare(PHP_VERSION, '5.3.1', '>=')) &&
- function_exists('dns_get_record')
- )
+ if (function_exists('dns_get_record'))
{
// dns_get_record() expects an integer as second parameter
// We have to convert the string $type to the corresponding integer constant.
@@ -3864,7 +3213,7 @@ function phpbb_checkdnsrr($host, $type = 'MX')
function msg_handler($errno, $msg_text, $errfile, $errline)
{
global $cache, $db, $auth, $template, $config, $user, $request;
- global $phpEx, $phpbb_root_path, $msg_title, $msg_long_text;
+ global $phpEx, $phpbb_root_path, $msg_title, $msg_long_text, $phpbb_log;
// Do not display notices if we suppress them via @
if (error_reporting() == 0 && $errno != E_USER_ERROR && $errno != E_USER_WARNING && $errno != E_USER_NOTICE)
@@ -3878,11 +3227,6 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
$msg_text = $msg_long_text;
}
- if (!defined('E_DEPRECATED'))
- {
- define('E_DEPRECATED', 8192);
- }
-
switch ($errno)
{
case E_NOTICE:
@@ -3905,7 +3249,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
// we are writing an image - the user won't see the debug, so let's place it in the log
if (defined('IMAGE_OUTPUT') || defined('IN_CRON'))
{
- add_log('critical', 'LOG_IMAGE_GENERATION_ERROR', $errfile, $errline, $msg_text);
+ $phpbb_log->add('critical', $user->data['user_id'], $user->ip, 'LOG_IMAGE_GENERATION_ERROR', false, array($errfile, $errline, $msg_text));
}
// echo '<br /><br />BACKTRACE<br />' . get_backtrace() . '<br />' . "\n";
}
@@ -3916,7 +3260,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
case E_USER_ERROR:
- if (!empty($user) && !empty($user->lang))
+ if (!empty($user) && $user->is_setup())
{
$msg_text = (!empty($user->lang[$msg_text])) ? $user->lang[$msg_text] : $msg_text;
$msg_title = (!isset($msg_title)) ? $user->lang['GENERAL_ERROR'] : ((!empty($user->lang[$msg_title])) ? $user->lang[$msg_title] : $msg_title);
@@ -3967,7 +3311,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
{
// let's avoid loops
$db->sql_return_on_error(true);
- add_log('critical', 'LOG_GENERAL_ERROR', $msg_title, $log_text);
+ $phpbb_log->add('critical', $user->data['user_id'], $user->ip, 'LOG_GENERAL_ERROR', false, array($msg_title, $log_text));
$db->sql_return_on_error(false);
}
@@ -4036,7 +3380,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
// We re-init the auth array to get correct results on login/logout
$auth->acl($user->data);
- if (empty($user->lang))
+ if (!$user->is_setup())
{
$user->setup();
}
@@ -4125,11 +3469,21 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
*/
function phpbb_filter_root_path($errfile)
{
+ global $phpbb_filesystem;
+
static $root_path;
if (empty($root_path))
{
- $root_path = phpbb_realpath(dirname(__FILE__) . '/../');
+ if ($phpbb_filesystem)
+ {
+ $root_path = $phpbb_filesystem->realpath(dirname(__FILE__) . '/../');
+ }
+ else
+ {
+ $filesystem = new \phpbb\filesystem\filesystem();
+ $root_path = $filesystem->realpath(dirname(__FILE__) . '/../');
+ }
}
return str_replace(array($root_path, '\\'), array('[ROOT]', '/'), $errfile);
@@ -4408,178 +3762,6 @@ function phpbb_optionset($bit, $set, $data)
}
/**
-* Determine which plural form we should use.
-* For some languages this is not as simple as for English.
-*
-* @param $rule int ID of the plural rule we want to use, see http://wiki.phpbb.com/Plural_Rules#Plural_Rules
-* @param $number int|float The number we want to get the plural case for. Float numbers are floored.
-* @return int The plural-case we need to use for the number plural-rule combination
-*/
-function phpbb_get_plural_form($rule, $number)
-{
- $number = (int) $number;
-
- if ($rule > 15 || $rule < 0)
- {
- trigger_error('INVALID_PLURAL_RULE');
- }
-
- /**
- * The following plural rules are based on a list published by the Mozilla Developer Network
- * https://developer.mozilla.org/en/Localization_and_Plurals
- */
- switch ($rule)
- {
- case 0:
- /**
- * Families: Asian (Chinese, Japanese, Korean, Vietnamese), Persian, Turkic/Altaic (Turkish), Thai, Lao
- * 1 - everything: 0, 1, 2, ...
- */
- return 1;
-
- case 1:
- /**
- * Families: Germanic (Danish, Dutch, English, Faroese, Frisian, German, Norwegian, Swedish), Finno-Ugric (Estonian, Finnish, Hungarian), Language isolate (Basque), Latin/Greek (Greek), Semitic (Hebrew), Romanic (Italian, Portuguese, Spanish, Catalan)
- * 1 - 1
- * 2 - everything else: 0, 2, 3, ...
- */
- return ($number == 1) ? 1 : 2;
-
- case 2:
- /**
- * Families: Romanic (French, Brazilian Portuguese)
- * 1 - 0, 1
- * 2 - everything else: 2, 3, ...
- */
- return (($number == 0) || ($number == 1)) ? 1 : 2;
-
- case 3:
- /**
- * Families: Baltic (Latvian)
- * 1 - 0
- * 2 - ends in 1, not 11: 1, 21, ... 101, 121, ...
- * 3 - everything else: 2, 3, ... 10, 11, 12, ... 20, 22, ...
- */
- return ($number == 0) ? 1 : ((($number % 10 == 1) && ($number % 100 != 11)) ? 2 : 3);
-
- case 4:
- /**
- * Families: Celtic (Scottish Gaelic)
- * 1 - is 1 or 11: 1, 11
- * 2 - is 2 or 12: 2, 12
- * 3 - others between 3 and 19: 3, 4, ... 10, 13, ... 18, 19
- * 4 - everything else: 0, 20, 21, ...
- */
- return ($number == 1 || $number == 11) ? 1 : (($number == 2 || $number == 12) ? 2 : (($number >= 3 && $number <= 19) ? 3 : 4));
-
- case 5:
- /**
- * Families: Romanic (Romanian)
- * 1 - 1
- * 2 - is 0 or ends in 01-19: 0, 2, 3, ... 19, 101, 102, ... 119, 201, ...
- * 3 - everything else: 20, 21, ...
- */
- return ($number == 1) ? 1 : ((($number == 0) || (($number % 100 > 0) && ($number % 100 < 20))) ? 2 : 3);
-
- case 6:
- /**
- * Families: Baltic (Lithuanian)
- * 1 - ends in 1, not 11: 1, 21, 31, ... 101, 121, ...
- * 2 - ends in 0 or ends in 10-20: 0, 10, 11, 12, ... 19, 20, 30, 40, ...
- * 3 - everything else: 2, 3, ... 8, 9, 22, 23, ... 29, 32, 33, ...
- */
- return (($number % 10 == 1) && ($number % 100 != 11)) ? 1 : ((($number % 10 < 2) || (($number % 100 >= 10) && ($number % 100 < 20))) ? 2 : 3);
-
- case 7:
- /**
- * Families: Slavic (Croatian, Serbian, Russian, Ukrainian)
- * 1 - ends in 1, not 11: 1, 21, 31, ... 101, 121, ...
- * 2 - ends in 2-4, not 12-14: 2, 3, 4, 22, 23, 24, 32, ...
- * 3 - everything else: 0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 26, ...
- */
- return (($number % 10 == 1) && ($number % 100 != 11)) ? 1 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 2 : 3);
-
- case 8:
- /**
- * Families: Slavic (Slovak, Czech)
- * 1 - 1
- * 2 - 2, 3, 4
- * 3 - everything else: 0, 5, 6, 7, ...
- */
- return ($number == 1) ? 1 : ((($number >= 2) && ($number <= 4)) ? 2 : 3);
-
- case 9:
- /**
- * Families: Slavic (Polish)
- * 1 - 1
- * 2 - ends in 2-4, not 12-14: 2, 3, 4, 22, 23, 24, 32, ... 104, 122, ...
- * 3 - everything else: 0, 5, 6, ... 11, 12, 13, 14, 15, ... 20, 21, 25, ...
- */
- return ($number == 1) ? 1 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 12) || ($number % 100 > 14))) ? 2 : 3);
-
- case 10:
- /**
- * Families: Slavic (Slovenian, Sorbian)
- * 1 - ends in 01: 1, 101, 201, ...
- * 2 - ends in 02: 2, 102, 202, ...
- * 3 - ends in 03-04: 3, 4, 103, 104, 203, 204, ...
- * 4 - everything else: 0, 5, 6, 7, 8, 9, 10, 11, ...
- */
- return ($number % 100 == 1) ? 1 : (($number % 100 == 2) ? 2 : ((($number % 100 == 3) || ($number % 100 == 4)) ? 3 : 4));
-
- case 11:
- /**
- * Families: Celtic (Irish Gaeilge)
- * 1 - 1
- * 2 - 2
- * 3 - is 3-6: 3, 4, 5, 6
- * 4 - is 7-10: 7, 8, 9, 10
- * 5 - everything else: 0, 11, 12, ...
- */
- return ($number == 1) ? 1 : (($number == 2) ? 2 : (($number >= 3 && $number <= 6) ? 3 : (($number >= 7 && $number <= 10) ? 4 : 5)));
-
- case 12:
- /**
- * Families: Semitic (Arabic)
- * 1 - 1
- * 2 - 2
- * 3 - ends in 03-10: 3, 4, ... 10, 103, 104, ... 110, 203, 204, ...
- * 4 - ends in 11-99: 11, ... 99, 111, 112, ...
- * 5 - everything else: 100, 101, 102, 200, 201, 202, ...
- * 6 - 0
- */
- return ($number == 1) ? 1 : (($number == 2) ? 2 : ((($number % 100 >= 3) && ($number % 100 <= 10)) ? 3 : ((($number % 100 >= 11) && ($number % 100 <= 99)) ? 4 : (($number != 0) ? 5 : 6))));
-
- case 13:
- /**
- * Families: Semitic (Maltese)
- * 1 - 1
- * 2 - is 0 or ends in 01-10: 0, 2, 3, ... 9, 10, 101, 102, ...
- * 3 - ends in 11-19: 11, 12, ... 18, 19, 111, 112, ...
- * 4 - everything else: 20, 21, ...
- */
- return ($number == 1) ? 1 : ((($number == 0) || (($number % 100 > 1) && ($number % 100 < 11))) ? 2 : ((($number % 100 > 10) && ($number % 100 < 20)) ? 3 : 4));
-
- case 14:
- /**
- * Families: Slavic (Macedonian)
- * 1 - ends in 1: 1, 11, 21, ...
- * 2 - ends in 2: 2, 12, 22, ...
- * 3 - everything else: 0, 3, 4, ... 10, 13, 14, ... 20, 23, ...
- */
- return ($number % 10 == 1) ? 1 : (($number % 10 == 2) ? 2 : 3);
-
- case 15:
- /**
- * Families: Icelandic
- * 1 - ends in 1, not 11: 1, 21, 31, ... 101, 121, 131, ...
- * 2 - everything else: 0, 2, 3, ... 10, 11, 12, ... 20, 22, ...
- */
- return (($number % 10 == 1) && ($number % 100 != 11)) ? 1 : 2;
- }
-}
-
-/**
* Login using http authenticate.
*
* @param array $param Parameter array, see $param_defaults array.
@@ -4836,6 +4018,7 @@ function phpbb_get_avatar($row, $alt, $ignore_config = false, $lazy = false)
'height' => $row['avatar_height'],
);
+ /* @var $phpbb_avatar_manager \phpbb\avatar\manager */
$phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
$driver = $phpbb_avatar_manager->get_driver($row['avatar_type'], !$ignore_config);
$html = '';
@@ -4999,8 +4182,8 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
if ($total_online_users > $config['record_online_users'])
{
- set_config('record_online_users', $total_online_users, true);
- set_config('record_online_date', time(), true);
+ $config->set('record_online_users', $total_online_users, false);
+ $config->set('record_online_date', time(), false);
}
$l_online_record = $user->lang('RECORD_ONLINE_USERS', (int) $config['record_online_users'], $user->format_date($config['record_online_date'], false, true));
@@ -5035,8 +4218,8 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
}
}
- $forum_id = request_var('f', 0);
- $topic_id = request_var('t', 0);
+ $forum_id = $request->variable('f', 0);
+ $topic_id = $request->variable('t', 0);
$s_feed_news = false;
@@ -5056,6 +4239,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
// This path is sent with the base template paths in the assign_vars()
// call below. We need to correct it in case we are accessing from a
// controller because the web paths will be incorrect otherwise.
+ /* @var $phpbb_path_helper \phpbb\path_helper */
$phpbb_path_helper = $phpbb_container->get('path_helper');
$corrected_path = $phpbb_path_helper->get_web_root_path();
$web_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? $board_url : $corrected_path;
@@ -5092,11 +4276,12 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
// Output the notifications
$notifications = false;
- if ($config['load_notifications'] && $user->data['user_id'] != ANONYMOUS && $user->data['user_type'] != USER_IGNORE)
+ if ($config['load_notifications'] && $config['allow_board_notifications'] && $user->data['user_id'] != ANONYMOUS && $user->data['user_type'] != USER_IGNORE)
{
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
- $notifications = $phpbb_notifications->load_notifications(array(
+ $notifications = $phpbb_notifications->load_notifications('notification.method.board', array(
'all_unread' => true,
'limit' => 5,
));
@@ -5107,6 +4292,8 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
}
}
+ /** @var \phpbb\controller\helper $controller_helper */
+ $controller_helper = $phpbb_container->get('controller.helper');
$notification_mark_hash = generate_link_hash('mark_all_notifications_read');
// The following assigns all _common_ variables that may be used at any point in a template.
@@ -5131,7 +4318,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
'U_VIEW_ALL_NOTIFICATIONS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=ucp_notifications'),
'U_MARK_ALL_NOTIFICATIONS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=ucp_notifications&amp;mode=notification_list&amp;mark=all&amp;token=' . $notification_mark_hash),
'U_NOTIFICATION_SETTINGS' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=ucp_notifications&amp;mode=notification_options'),
- 'S_NOTIFICATIONS_DISPLAY' => $config['load_notifications'],
+ 'S_NOTIFICATIONS_DISPLAY' => $config['load_notifications'] && $config['allow_board_notifications'],
'S_USER_NEW_PRIVMSG' => $user->data['user_new_privmsg'],
'S_USER_UNREAD_PRIVMSG' => $user->data['user_unread_privmsg'],
@@ -5160,7 +4347,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
'U_PROFILE' => append_sid("{$phpbb_root_path}ucp.$phpEx"),
'U_USER_PROFILE' => get_username_string('profile', $user->data['user_id'], $user->data['username'], $user->data['user_colour']),
'U_MODCP' => append_sid("{$phpbb_root_path}mcp.$phpEx", false, true, $user->session_id),
- 'U_FAQ' => append_sid("{$phpbb_root_path}faq.$phpEx"),
+ 'U_FAQ' => $controller_helper->route('phpbb_help_faq_controller'),
'U_SEARCH_SELF' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=egosearch'),
'U_SEARCH_NEW' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=newposts'),
'U_SEARCH_UNANSWERED' => append_sid("{$phpbb_root_path}search.$phpEx", 'search_id=unanswered'),
@@ -5172,7 +4359,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
'U_TERMS_USE' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=terms'),
'U_PRIVACY' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'),
'U_RESTORE_PERMISSIONS' => ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm')) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=restore_perm') : '',
- 'U_FEED' => generate_board_url() . "/feed.$phpEx",
+ 'U_FEED' => $controller_helper->route('phpbb_feed_index'),
'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS) ? true : false,
'S_AUTOLOGIN_ENABLED' => ($config['allow_autologin']) ? true : false,
@@ -5315,10 +4502,10 @@ function phpbb_generate_debug_output(\phpbb\db\driver\driver_interface $db, \php
if (isset($GLOBALS['starttime']))
{
$totaltime = microtime(true) - $GLOBALS['starttime'];
- $debug_info[] = sprintf('<abbr title="SQL time: %.3fs / PHP time: %.3fs">Time: %.3fs</abbr>', $db->get_sql_time(), ($totaltime - $db->get_sql_time()), $totaltime);
+ $debug_info[] = sprintf('<span title="SQL time: %.3fs / PHP time: %.3fs">Time: %.3fs</span>', $db->get_sql_time(), ($totaltime - $db->get_sql_time()), $totaltime);
}
- $debug_info[] = sprintf('<abbr title="Cached: %d">Queries: %d</abbr>', $db->sql_num_queries(true), $db->sql_num_queries());
+ $debug_info[] = sprintf('<span title="Cached: %d">Queries: %d</span>', $db->sql_num_queries(true), $db->sql_num_queries());
$memory_usage = memory_get_peak_usage();
if ($memory_usage)
@@ -5424,6 +4611,8 @@ function page_footer($run_cron = true, $display_template = true, $exit_handler =
if ($call_cron)
{
global $phpbb_container;
+
+ /* @var $cron \phpbb\cron\manager */
$cron = $phpbb_container->get('cron.manager');
$task = $cron->find_one_ready_task();
@@ -5540,22 +4729,6 @@ function phpbb_user_session_handler()
}
/**
-* Check if PCRE has UTF-8 support
-* PHP may not be linked with the bundled PCRE lib and instead with an older version
-*
-* @return bool Returns true if PCRE (the regular expressions library) supports UTF-8 encoding
-*/
-function phpbb_pcre_utf8_support()
-{
- static $utf8_pcre_properties = null;
- if (is_null($utf8_pcre_properties))
- {
- $utf8_pcre_properties = (@preg_match('/\p{L}/u', 'a') !== false);
- }
- return $utf8_pcre_properties;
-}
-
-/**
* Casts a numeric string $input to an appropriate numeric type (i.e. integer or float)
*
* @param string $input A numeric string.
diff --git a/phpBB/includes/functions_acp.php b/phpBB/includes/functions_acp.php
index d566336d26..eea18a0c47 100644
--- a/phpBB/includes/functions_acp.php
+++ b/phpBB/includes/functions_acp.php
@@ -410,7 +410,7 @@ function build_cfg_template($tpl_type, $key, &$new, $config_key, $vars)
*/
function validate_config_vars($config_vars, &$cfg_array, &$error)
{
- global $phpbb_root_path, $user, $phpbb_dispatcher;
+ global $phpbb_root_path, $user, $phpbb_dispatcher, $phpbb_filesystem;
$type = 0;
$min = 1;
@@ -591,7 +591,7 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
// Check if the path is writable
if ($config_definition['validate'] == 'wpath' || $config_definition['validate'] == 'rwpath' || $config_definition['validate'] === 'absolute_path_writable')
{
- if (file_exists($path) && !phpbb_is_writable($path))
+ if (file_exists($path) && !$phpbb_filesystem->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 afd3dce730..cd8dcc2734 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -171,7 +171,10 @@ function size_select_options($size_compare)
*/
function group_select_options($group_id, $exclude_ids = false, $manage_founder = false)
{
- global $db, $user, $config;
+ global $db, $config, $phpbb_container;
+
+ /** @var \phpbb\group\helper $group_helper */
+ $group_helper = $phpbb_container->get('group_helper');
$exclude_sql = ($exclude_ids !== false && sizeof($exclude_ids)) ? 'WHERE ' . $db->sql_in_set('group_id', array_map('intval', $exclude_ids), true) : '';
$sql_and = (!$config['coppa_enable']) ? (($exclude_sql) ? ' AND ' : ' WHERE ') . "group_name <> 'REGISTERED_COPPA'" : '';
@@ -189,7 +192,7 @@ function group_select_options($group_id, $exclude_ids = false, $manage_founder =
while ($row = $db->sql_fetchrow($result))
{
$selected = ($row['group_id'] == $group_id) ? ' selected="selected"' : '';
- $s_group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '"' . $selected . '>' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
+ $s_group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '"' . $selected . '>' . $group_helper->get_name($row['group_name']) . '</option>';
}
$db->sql_freeresult($result);
@@ -316,7 +319,7 @@ function get_forum_branch($forum_id, $type = 'all', $order = 'descending', $incl
*/
function copy_forum_permissions($src_forum_id, $dest_forum_ids, $clear_dest_perms = true, $add_log = true)
{
- global $db;
+ global $db, $user, $phpbb_log;
// Only one forum id specified
if (!is_array($dest_forum_ids))
@@ -439,7 +442,7 @@ function copy_forum_permissions($src_forum_id, $dest_forum_ids, $clear_dest_perm
if ($add_log)
{
- add_log('admin', 'LOG_FORUM_COPIED_PERMISSIONS', $src_forum_name, implode(', ', $dest_forum_names));
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_FORUM_COPIED_PERMISSIONS', false, array($src_forum_name, implode(', ', $dest_forum_names)));
}
$db->sql_transaction('commit');
@@ -759,9 +762,10 @@ function delete_topics($where_type, $where_ids, $auto_sync = true, $post_count_s
if ($approved_topics)
{
- set_config_count('num_topics', $approved_topics * (-1), true);
+ $config->increment('num_topics', $approved_topics * (-1), false);
}
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
$phpbb_notifications->delete_notifications(array(
@@ -1017,7 +1021,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
if ($approved_posts && $post_count_sync)
{
- set_config_count('num_posts', $approved_posts * (-1), true);
+ $config->increment('num_posts', $approved_posts * (-1), false);
}
// We actually remove topics now to not be inconsistent (the delete_topics function calls this function too)
@@ -1026,6 +1030,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
delete_topics('topic_id', $remove_topics, $auto_sync, $post_count_sync, false);
}
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
$phpbb_notifications->delete_notifications($delete_notifications_types, $post_ids);
@@ -1149,8 +1154,8 @@ function delete_attachments($mode, $ids, $resync = true)
if ($space_removed || $files_removed)
{
- set_config_count('upload_dir_size', $space_removed * (-1), true);
- set_config_count('num_files', $files_removed * (-1), true);
+ $config->increment('upload_dir_size', $space_removed * (-1), false);
+ $config->increment('num_files', $files_removed * (-1), false);
}
// If we do not resync, we do not need to adjust any message, post, topic or user entries
@@ -2454,7 +2459,7 @@ function prune($forum_id, $prune_mode, $prune_date, $prune_flags = 0, $auto_sync
*/
function auto_prune($forum_id, $prune_mode, $prune_flags, $prune_days, $prune_freq)
{
- global $db;
+ global $db, $user, $phpbb_log;
$sql = 'SELECT forum_name
FROM ' . FORUMS_TABLE . "
@@ -2475,7 +2480,7 @@ function auto_prune($forum_id, $prune_mode, $prune_flags, $prune_days, $prune_fr
WHERE forum_id = $forum_id";
$db->sql_query($sql);
- add_log('admin', 'LOG_AUTO_PRUNE', $row['forum_name']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_AUTO_PRUNE', false, array($row['forum_name']));
}
return;
@@ -3042,25 +3047,6 @@ function get_database_size()
return $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 $phpbb_container;
-
- // Get file downloader and assign $errstr and $errno
- $file_downloader = $phpbb_container->get('file_downloader');
-
- $file_data = $file_downloader->get($host, $directory, $filename, $port, $timeout);
- $errstr = $file_downloader->get_error_string();
- $errno = $file_downloader->get_error_number();
-
- return $file_data;
-}
-
/*
* Tidy Warnings
* Remove all warnings which have now expired from the database
@@ -3104,7 +3090,7 @@ function tidy_warnings()
$db->sql_transaction('commit');
}
- set_config('warnings_last_gc', time(), true);
+ $config->set('warnings_last_gc', time(), false);
}
/**
@@ -3112,7 +3098,7 @@ function tidy_warnings()
*/
function tidy_database()
{
- global $db;
+ global $config, $db;
// Here we check permission consistency
@@ -3137,7 +3123,7 @@ function tidy_database()
WHERE ' . $db->sql_in_set('forum_id', $forum_ids, true);
$db->sql_query($sql);
- set_config('database_last_gc', time(), true);
+ $config->set('database_last_gc', time(), false);
}
/**
diff --git a/phpBB/includes/functions_compatibility.php b/phpBB/includes/functions_compatibility.php
index b59c7376e9..4b085a6050 100644
--- a/phpBB/includes/functions_compatibility.php
+++ b/phpBB/includes/functions_compatibility.php
@@ -60,6 +60,7 @@ function phpbb_hash($password)
{
global $phpbb_container;
+ /* @var $passwords_manager \phpbb\passwords\manager */
$passwords_manager = $phpbb_container->get('passwords.manager');
return $passwords_manager->hash($password);
}
@@ -78,6 +79,7 @@ function phpbb_check_hash($password, $hash)
{
global $phpbb_container;
+ /* @var $passwords_manager \phpbb\passwords\manager */
$passwords_manager = $phpbb_container->get('passwords.manager');
return $passwords_manager->check($password, $hash);
}
@@ -90,7 +92,7 @@ function phpbb_check_hash($password, $hash)
* @param string $path Path to clean
* @return string Cleaned path
*
-* @deprecated
+* @deprecated 3.1.0 (To be removed: 3.3.0)
*/
function phpbb_clean_path($path)
{
@@ -98,6 +100,7 @@ function phpbb_clean_path($path)
if (!$phpbb_path_helper && $phpbb_container)
{
+ /* @var $phpbb_path_helper \phpbb\path_helper */
$phpbb_path_helper = $phpbb_container->get('path_helper');
}
else if (!$phpbb_path_helper)
@@ -115,7 +118,7 @@ function phpbb_clean_path($path)
new phpbb\symfony_request(
$request
),
- new phpbb\filesystem(),
+ new phpbb\filesystem\filesystem(),
$request,
$phpbb_root_path,
$phpEx
@@ -133,7 +136,7 @@ function phpbb_clean_path($path)
*
* @return string Returns the options for timezone selector only
*
-* @deprecated
+* @deprecated 3.1.0 (To be removed: 3.3.0)
*/
function tz_select($default = '', $truncate = false)
{
@@ -147,7 +150,7 @@ function tz_select($default = '', $truncate = false)
* via admin_permissions. Changes of usernames and group names
* must be carried through for the moderators table.
*
-* @deprecated 3.1
+* @deprecated 3.1.0 (To be removed: 3.3.0)
* @return null
*/
function cache_moderators()
@@ -159,7 +162,7 @@ function cache_moderators()
/**
* Removes moderators and administrators from foe lists.
*
-* @deprecated 3.1
+* @deprecated 3.1.0 (To be removed: 3.3.0)
* @param array|bool $group_id If an array, remove all members of this group from foe lists, or false to ignore
* @param array|bool $user_id If an array, remove this user from foe lists, or false to ignore
* @return null
@@ -196,3 +199,315 @@ function get_user_rank($user_rank, $user_posts, &$rank_title, &$rank_img, &$rank
$rank_img = $rank_data['img'];
$rank_img_src = $rank_data['img_src'];
}
+
+/**
+ * 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 $phpbb_container;
+
+ // Get file downloader and assign $errstr and $errno
+ /* @var $file_downloader \phpbb\file_downloader */
+ $file_downloader = $phpbb_container->get('file_downloader');
+
+ $file_data = $file_downloader->get($host, $directory, $filename, $port, $timeout);
+ $errstr = $file_downloader->get_error_string();
+ $errno = $file_downloader->get_error_number();
+
+ return $file_data;
+}
+
+/**
+ * Add log entry
+ *
+ * @param string $mode The mode defines which log_type is used and from which log the entry is retrieved
+ * @param int $forum_id Mode 'mod' ONLY: forum id of the related item, NOT INCLUDED otherwise
+ * @param int $topic_id Mode 'mod' ONLY: topic id of the related item, NOT INCLUDED otherwise
+ * @param int $reportee_id Mode 'user' ONLY: user id of the reportee, NOT INCLUDED otherwise
+ * @param string $log_operation Name of the operation
+ * @param array $additional_data More arguments can be added, depending on the log_type
+ *
+ * @return int|bool Returns the log_id, if the entry was added to the database, false otherwise.
+ *
+ * @deprecated 3.1.0 (To be removed: 3.3.0)
+ */
+function add_log()
+{
+ global $phpbb_log, $user;
+
+ $args = func_get_args();
+ $mode = array_shift($args);
+
+ // This looks kind of dirty, but add_log has some additional data before the log_operation
+ $additional_data = array();
+ switch ($mode)
+ {
+ case 'admin':
+ case 'critical':
+ break;
+ case 'mod':
+ $additional_data['forum_id'] = array_shift($args);
+ $additional_data['topic_id'] = array_shift($args);
+ break;
+ case 'user':
+ $additional_data['reportee_id'] = array_shift($args);
+ break;
+ }
+
+ $log_operation = array_shift($args);
+ $additional_data = array_merge($additional_data, $args);
+
+ $user_id = (empty($user->data)) ? ANONYMOUS : $user->data['user_id'];
+ $user_ip = (empty($user->ip)) ? '' : $user->ip;
+
+ return $phpbb_log->add($mode, $user_id, $user_ip, $log_operation, time(), $additional_data);
+}
+
+/**
+ * Sets a configuration option's value.
+ *
+ * Please note that this function does not update the is_dynamic value for
+ * an already existing config option.
+ *
+ * @param string $config_name The configuration option's name
+ * @param string $config_value New configuration value
+ * @param bool $is_dynamic Whether this variable should be cached (false) or
+ * if it changes too frequently (true) to be
+ * efficiently cached.
+ *
+ * @return null
+ *
+ * @deprecated 3.1.0 (To be removed: 3.3.0)
+ */
+function set_config($config_name, $config_value, $is_dynamic = false, \phpbb\config\config $set_config = null)
+{
+ static $config = null;
+
+ if ($set_config !== null)
+ {
+ $config = $set_config;
+
+ if (empty($config_name))
+ {
+ return;
+ }
+ }
+
+ $config->set($config_name, $config_value, !$is_dynamic);
+}
+
+/**
+ * Increments an integer config value directly in the database.
+ *
+ * @param string $config_name The configuration option's name
+ * @param int $increment Amount to increment by
+ * @param bool $is_dynamic Whether this variable should be cached (false) or
+ * if it changes too frequently (true) to be
+ * efficiently cached.
+ *
+ * @return null
+ *
+ * @deprecated 3.1.0 (To be removed: 3.3.0)
+ */
+function set_config_count($config_name, $increment, $is_dynamic = false, \phpbb\config\config $set_config = null)
+{
+ static $config = null;
+ if ($set_config !== null)
+ {
+ $config = $set_config;
+ if (empty($config_name))
+ {
+ return;
+ }
+ }
+ $config->increment($config_name, $increment, !$is_dynamic);
+}
+
+/**
+ * Wrapper function of \phpbb\request\request::variable which exists for backwards compatability.
+ * See {@link \phpbb\request\request_interface::variable \phpbb\request\request_interface::variable} for
+ * documentation of this function's use.
+ *
+ * @deprecated 3.1.0 (To be removed: 3.3.0)
+ * @param mixed $var_name The form variable's name from which data shall be retrieved.
+ * If the value is an array this may be an array of indizes which will give
+ * direct access to a value at any depth. E.g. if the value of "var" is array(1 => "a")
+ * then specifying array("var", 1) as the name will return "a".
+ * If you pass an instance of {@link \phpbb\request\request_interface phpbb_request_interface}
+ * as this parameter it will overwrite the current request class instance. If you do
+ * not do so, it will create its own instance (but leave superglobals enabled).
+ * @param mixed $default A default value that is returned if the variable was not set.
+ * This function will always return a value of the same type as the default.
+ * @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters
+ * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
+ * @param bool $cookie This param is mapped to \phpbb\request\request_interface::COOKIE as the last param for
+ * \phpbb\request\request_interface::variable for backwards compatability reasons.
+ * @param \phpbb\request\request_interface|null|false If an instance of \phpbb\request\request_interface is given the instance is stored in
+ * a static variable and used for all further calls where this parameters is null. Until
+ * the function is called with an instance it automatically creates a new \phpbb\request\request
+ * instance on every call. By passing false this per-call instantiation can be restored
+ * after having passed in a \phpbb\request\request_interface instance.
+ *
+ * @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
+ * the same as that of $default. If the variable is not set $default is returned.
+ */
+function request_var($var_name, $default, $multibyte = false, $cookie = false, $request = null)
+{
+ // This is all just an ugly hack to add "Dependency Injection" to a function
+ // the only real code is the function call which maps this function to a method.
+ static $static_request = null;
+ if ($request instanceof \phpbb\request\request_interface)
+ {
+ $static_request = $request;
+ if (empty($var_name))
+ {
+ return;
+ }
+ }
+ else if ($request === false)
+ {
+ $static_request = null;
+ if (empty($var_name))
+ {
+ return;
+ }
+ }
+ $tmp_request = $static_request;
+ // no request class set, create a temporary one ourselves to keep backwards compatibility
+ if ($tmp_request === null)
+ {
+ // false param: enable super globals, so the created request class does not
+ // make super globals inaccessible everywhere outside this function.
+ $tmp_request = new \phpbb\request\request(new \phpbb\request\type_cast_helper(), false);
+ }
+ return $tmp_request->variable($var_name, $default, $multibyte, ($cookie) ? \phpbb\request\request_interface::COOKIE : \phpbb\request\request_interface::REQUEST);
+}
+
+/**
+ * Get tables of a database
+ *
+ * @deprecated 3.1.0 (To be removed: 3.3.0)
+ */
+function get_tables(&$db)
+{
+ $db_tools_factory = new \phpbb\db\tools\factory();
+ $db_tools = $db_tools_factory->get($db);
+
+ return $db_tools->sql_list_tables();
+}
+
+/**
+ * Global function for chmodding directories and files for internal use
+ *
+ * This function determines owner and group whom the file belongs to and user and group of PHP and then set safest possible file permissions.
+ * The function determines owner and group from common.php file and sets the same to the provided file.
+ * The function uses bit fields to build the permissions.
+ * The function sets the appropiate execute bit on directories.
+ *
+ * Supported constants representing bit fields are:
+ *
+ * CHMOD_ALL - all permissions (7)
+ * CHMOD_READ - read permission (4)
+ * CHMOD_WRITE - write permission (2)
+ * CHMOD_EXECUTE - execute permission (1)
+ *
+ * NOTE: The function uses POSIX extension and fileowner()/filegroup() functions. If any of them is disabled, this function tries to build proper permissions, by calling is_readable() and is_writable() functions.
+ *
+ * @param string $filename The file/directory to be chmodded
+ * @param int $perms Permissions to set
+ *
+ * @return bool true on success, otherwise false
+ *
+ * @deprecated 3.2.0-dev use \phpbb\filesystem\filesystem::phpbb_chmod() instead
+ */
+function phpbb_chmod($filename, $perms = CHMOD_READ)
+{
+ global $phpbb_filesystem;
+
+ try
+ {
+ $phpbb_filesystem->phpbb_chmod($filename, $perms);
+ }
+ catch (\phpbb\filesystem\exception\filesystem_exception $e)
+ {
+ return false;
+ }
+
+ return true;
+}
+
+/**
+ * Test if a file/directory is writable
+ *
+ * This function calls the native is_writable() when not running under
+ * Windows and it is not disabled.
+ *
+ * @param string $file Path to perform write test on
+ * @return bool True when the path is writable, otherwise false.
+ *
+ * @deprecated 3.2.0-dev use \phpbb\filesystem\filesystem::is_writable() instead
+ */
+function phpbb_is_writable($file)
+{
+ global $phpbb_filesystem;
+
+ return $phpbb_filesystem->is_writable($file);
+}
+
+/**
+ * Checks if a path ($path) is absolute or relative
+ *
+ * @param string $path Path to check absoluteness of
+ * @return boolean
+ *
+ * @deprecated 3.2.0-dev use \phpbb\filesystem\filesystem::is_absolute_path() instead
+ */
+function phpbb_is_absolute($path)
+{
+ global $phpbb_filesystem;
+
+ return $phpbb_filesystem->is_absolute_path($path);
+}
+
+/**
+ * A wrapper for realpath
+ *
+ * @deprecated 3.2.0-dev use \phpbb\filesystem\filesystem::realpath() instead
+ */
+function phpbb_realpath($path)
+{
+ global $phpbb_filesystem;
+
+ return $phpbb_filesystem->realpath($path);
+}
+
+/**
+ * Determine which plural form we should use.
+ * For some languages this is not as simple as for English.
+ *
+ * @param $rule int ID of the plural rule we want to use, see http://wiki.phpbb.com/Plural_Rules#Plural_Rules
+ * @param $number int|float The number we want to get the plural case for. Float numbers are floored.
+ * @return int The plural-case we need to use for the number plural-rule combination
+ *
+ * @deprecated 3.2.0-dev (To be removed: 3.3.0)
+ */
+function phpbb_get_plural_form($rule, $number)
+{
+ global $phpbb_container;
+
+ /** @var \phpbb\language\language $language */
+ $language = $phpbb_container->get('language');
+ return $language->get_plural_form($number, $rule);
+}
+
+/**
+* @return bool Always true
+* @deprecated 3.2.0-dev
+*/
+function phpbb_pcre_utf8_support()
+{
+ return true;
+}
diff --git a/phpBB/includes/functions_compress.php b/phpBB/includes/functions_compress.php
index a7ee29dd91..e768a0f47b 100644
--- a/phpBB/includes/functions_compress.php
+++ b/phpBB/includes/functions_compress.php
@@ -184,7 +184,7 @@ class compress
}
/**
-* Zip creation class from phpMyAdmin 2.3.0 (c) Tobias Ratschiller, Olivier Müller, Loïc Chapeaux,
+* Zip creation class from phpMyAdmin 2.3.0 (c) Tobias Ratschiller, Olivier Müller, Loïc Chapeaux,
* Marc Delisle, http://www.phpmyadmin.net/
*
* Zip extraction function by Alexandre Tedeschi, alexandrebr at gmail dot com
@@ -204,11 +204,19 @@ class compress_zip extends compress
var $datasec_len = 0;
/**
+ * @var \phpbb\filesystem\filesystem_interface
+ */
+ protected $filesystem;
+
+ /**
* Constructor
*/
function compress_zip($mode, $file)
{
+ global $phpbb_filesystem;
+
$this->fp = @fopen($file, $mode . 'b');
+ $this->filesystem = ($phpbb_filesystem instanceof \phpbb\filesystem\filesystem_interface) ? $phpbb_filesystem : new \phpbb\filesystem\filesystem();
if (!$this->fp)
{
@@ -286,7 +294,15 @@ class compress_zip extends compress
{
trigger_error("Could not create directory $folder");
}
- phpbb_chmod($str, CHMOD_READ | CHMOD_WRITE);
+
+ try
+ {
+ $this->filesystem->phpbb_chmod($str, CHMOD_READ | CHMOD_WRITE);
+ }
+ catch (\phpbb\filesystem\exception\filesystem_exception $e)
+ {
+ // Do nothing
+ }
}
}
}
@@ -315,7 +331,15 @@ class compress_zip extends compress
{
trigger_error("Could not create directory $folder");
}
- phpbb_chmod($str, CHMOD_READ | CHMOD_WRITE);
+
+ try
+ {
+ $this->filesystem->phpbb_chmod($str, CHMOD_READ | CHMOD_WRITE);
+ }
+ catch (\phpbb\filesystem\exception\filesystem_exception $e)
+ {
+ // Do nothing
+ }
}
}
}
@@ -539,10 +563,17 @@ class compress_tar extends compress
var $wrote = false;
/**
+ * @var \phpbb\filesystem\filesystem_interface
+ */
+ protected $filesystem;
+
+ /**
* Constructor
*/
function compress_tar($mode, $file, $type = '')
{
+ global $phpbb_filesystem;
+
$type = (!$type) ? $file : $type;
$this->isgz = preg_match('#(\.tar\.gz|\.tgz)$#', $type);
$this->isbz = preg_match('#\.tar\.bz2$#', $type);
@@ -551,6 +582,8 @@ class compress_tar extends compress
$this->file = &$file;
$this->type = &$type;
$this->open();
+
+ $this->filesystem = ($phpbb_filesystem instanceof \phpbb\filesystem\filesystem_interface) ? $phpbb_filesystem : new \phpbb\filesystem\filesystem();
}
/**
@@ -601,7 +634,15 @@ class compress_tar extends compress
{
trigger_error("Could not create directory $folder");
}
- phpbb_chmod($str, CHMOD_READ | CHMOD_WRITE);
+
+ try
+ {
+ $this->filesystem->phpbb_chmod($str, CHMOD_READ | CHMOD_WRITE);
+ }
+ catch (\phpbb\filesystem\exception\filesystem_exception $e)
+ {
+ // Do nothing
+ }
}
}
}
@@ -628,7 +669,15 @@ class compress_tar extends compress
{
trigger_error("Could not create directory $folder");
}
- phpbb_chmod($str, CHMOD_READ | CHMOD_WRITE);
+
+ try
+ {
+ $this->filesystem->phpbb_chmod($str, CHMOD_READ | CHMOD_WRITE);
+ }
+ catch (\phpbb\filesystem\exception\filesystem_exception $e)
+ {
+ // Do nothing
+ }
}
}
@@ -637,7 +686,15 @@ class compress_tar extends compress
{
trigger_error("Couldn't create file $filename");
}
- phpbb_chmod($target_filename, CHMOD_READ);
+
+ try
+ {
+ $this->filesystem->phpbb_chmod($target_filename, CHMOD_READ);
+ }
+ catch (\phpbb\filesystem\exception\filesystem_exception $e)
+ {
+ // Do nothing
+ }
// Grab the file contents
fwrite($fp, ($filesize) ? $fzread($this->fp, ($filesize + 511) &~ 511) : '', $filesize);
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php
index 6f861b8607..345df1d47a 100644
--- a/phpBB/includes/functions_content.php
+++ b/phpBB/includes/functions_content.php
@@ -389,46 +389,68 @@ function phpbb_clean_search_string($search_string)
/**
* Decode text whereby text is coming from the db and expected to be pre-parsed content
* We are placing this outside of the message parser because we are often in need of it...
+*
+* NOTE: special chars are kept encoded
+*
+* @param string &$message Original message, passed by reference
+* @param string $bbcode_uid BBCode UID
+* @return null
*/
function decode_message(&$message, $bbcode_uid = '')
{
- global $config;
+ global $phpbb_container;
- if ($bbcode_uid)
+ if (preg_match('#^<[rt][ >]#', $message))
{
- $match = array('<br />', "[/*:m:$bbcode_uid]", ":u:$bbcode_uid", ":o:$bbcode_uid", ":$bbcode_uid");
- $replace = array("\n", '', '', '', '');
+ $message = htmlspecialchars($phpbb_container->get('text_formatter.utils')->unparse($message), ENT_COMPAT);
}
else
{
- $match = array('<br />');
- $replace = array("\n");
- }
+ if ($bbcode_uid)
+ {
+ $match = array('<br />', "[/*:m:$bbcode_uid]", ":u:$bbcode_uid", ":o:$bbcode_uid", ":$bbcode_uid");
+ $replace = array("\n", '', '', '', '');
+ }
+ else
+ {
+ $match = array('<br />');
+ $replace = array("\n");
+ }
- $message = str_replace($match, $replace, $message);
+ $message = str_replace($match, $replace, $message);
- $match = get_preg_expression('bbcode_htm');
- $replace = array('\1', '\1', '\2', '\1', '', '');
+ $match = get_preg_expression('bbcode_htm');
+ $replace = array('\1', '\1', '\3', '\1', '', '');
- $message = preg_replace($match, $replace, $message);
+ $message = preg_replace($match, $replace, $message);
+ }
}
/**
-* Strips all bbcode from a text and returns the plain content
+* Strips all bbcode from a text in place
*/
function strip_bbcode(&$text, $uid = '')
{
- if (!$uid)
+ global $phpbb_container;
+
+ if (preg_match('#^<[rt][ >]#', $text))
{
- $uid = '[0-9a-z]{5,}';
+ $text = $phpbb_container->get('text_formatter.utils')->clean_formatting($text);
}
+ else
+ {
+ if (!$uid)
+ {
+ $uid = '[0-9a-z]{5,}';
+ }
- $text = preg_replace("#\[\/?[a-z0-9\*\+\-]+(?:=(?:&quot;.*&quot;|[^\]]*))?(?::[a-z])?(\:$uid)\]#", ' ', $text);
+ $text = preg_replace("#\[\/?[a-z0-9\*\+\-]+(?:=(?:&quot;.*&quot;|[^\]]*))?(?::[a-z])?(\:$uid)\]#", ' ', $text);
- $match = get_preg_expression('bbcode_htm');
- $replace = array('\1', '\1', '\2', '\1', '', '');
+ $match = get_preg_expression('bbcode_htm');
+ $replace = array('\1', '\1', '\2', '\1', '', '');
- $text = preg_replace($match, $replace, $text);
+ $text = preg_replace($match, $replace, $text);
+ }
}
/**
@@ -438,7 +460,7 @@ function strip_bbcode(&$text, $uid = '')
function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text = true)
{
static $bbcode;
- global $phpbb_dispatcher;
+ global $phpbb_dispatcher, $phpbb_container;
if ($text === '')
{
@@ -459,34 +481,56 @@ function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text
$vars = array('text', 'uid', 'bitfield', 'flags', 'censor_text');
extract($phpbb_dispatcher->trigger_event('core.modify_text_for_display_before', compact($vars)));
- if ($censor_text)
+ if (preg_match('#^<[rt][ >]#', $text))
{
- $text = censor_text($text);
- }
+ $renderer = $phpbb_container->get('text_formatter.renderer');
- // Parse bbcode if bbcode uid stored and bbcode enabled
- if ($uid && ($flags & OPTION_FLAG_BBCODE))
- {
- if (!class_exists('bbcode'))
+ // Temporarily switch off viewcensors if applicable
+ $old_censor = $renderer->get_viewcensors();
+ if ($old_censor !== $censor_text)
{
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+ $renderer->set_viewcensors($censor_text);
}
- if (empty($bbcode))
+ $text = $renderer->render($text);
+
+ // Restore the previous value
+ if ($old_censor !== $censor_text)
{
- $bbcode = new bbcode($bitfield);
+ $renderer->set_viewcensors($old_censor);
}
- else
+ }
+ else
+ {
+ if ($censor_text)
{
- $bbcode->bbcode($bitfield);
+ $text = censor_text($text);
}
- $bbcode->bbcode_second_pass($text, $uid);
- }
+ // Parse bbcode if bbcode uid stored and bbcode enabled
+ if ($uid && ($flags & OPTION_FLAG_BBCODE))
+ {
+ if (!class_exists('bbcode'))
+ {
+ global $phpbb_root_path, $phpEx;
+ include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
+ }
+
+ if (empty($bbcode))
+ {
+ $bbcode = new bbcode($bitfield);
+ }
+ else
+ {
+ $bbcode->bbcode($bitfield);
+ }
- $text = bbcode_nl2br($text);
- $text = smiley_text($text, !($flags & OPTION_FLAG_SMILIES));
+ $bbcode->bbcode_second_pass($text, $uid);
+ }
+
+ $text = bbcode_nl2br($text);
+ $text = smiley_text($text, !($flags & OPTION_FLAG_SMILIES));
+ }
/**
* Use this event to modify the text after it is parsed
@@ -507,7 +551,7 @@ function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text
/**
* For parsing custom parsed text to be stored within the database.
* This function additionally returns the uid and bitfield that needs to be stored.
-* Expects $text to be the value directly from request_var() and in it's non-parsed form
+* Expects $text to be the value directly from $request->variable() and in it's non-parsed form
*
* @param string $text The text to be replaced with the parsed one
* @param string $uid The BBCode uid for this parse
@@ -516,10 +560,14 @@ function generate_text_for_display($text, $uid, $bitfield, $flags, $censor_text
* @param bool $allow_bbcode If BBCode is allowed (i.e. if BBCode is parsed)
* @param bool $allow_urls If urls is allowed
* @param bool $allow_smilies If smilies are allowed
+* @param bool $allow_img_bbcode
+* @param bool $allow_flash_bbcode
+* @param bool $allow_quote_bbcode
+* @param bool $allow_url_bbcode
*
* @return array An array of string with the errors that occurred while parsing
*/
-function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bbcode = false, $allow_urls = false, $allow_smilies = false)
+function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bbcode = false, $allow_urls = false, $allow_smilies = false, $allow_img_bbcode = true, $allow_flash_bbcode = true, $allow_quote_bbcode = true, $allow_url_bbcode = true)
{
global $phpbb_root_path, $phpEx, $phpbb_dispatcher;
@@ -534,6 +582,10 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb
* @var bool allow_bbcode Whether or not to parse BBCode
* @var bool allow_urls Whether or not to parse URLs
* @var bool allow_smilies Whether or not to parse Smilies
+ * @var bool allow_img_bbcode Whether or not to parse the [img] BBCode
+ * @var bool allow_flash_bbcode Whether or not to parse the [flash] BBCode
+ * @var bool allow_quote_bbcode Whether or not to parse the [quote] BBCode
+ * @var bool allow_url_bbcode Whether or not to parse the [url] BBCode
* @since 3.1.0-a1
*/
$vars = array(
@@ -544,24 +596,23 @@ function generate_text_for_storage(&$text, &$uid, &$bitfield, &$flags, $allow_bb
'allow_bbcode',
'allow_urls',
'allow_smilies',
+ 'allow_img_bbcode',
+ 'allow_flash_bbcode',
+ 'allow_quote_bbcode',
+ 'allow_url_bbcode',
);
extract($phpbb_dispatcher->trigger_event('core.modify_text_for_storage_before', compact($vars)));
$uid = $bitfield = '';
$flags = (($allow_bbcode) ? OPTION_FLAG_BBCODE : 0) + (($allow_smilies) ? OPTION_FLAG_SMILIES : 0) + (($allow_urls) ? OPTION_FLAG_LINKS : 0);
- if ($text === '')
- {
- return;
- }
-
if (!class_exists('parse_message'))
{
include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
}
$message_parser = new parse_message($text);
- $message_parser->parse($allow_bbcode, $allow_urls, $allow_smilies);
+ $message_parser->parse($allow_bbcode, $allow_urls, $allow_smilies, $allow_img_bbcode, $allow_flash_bbcode, $allow_quote_bbcode, $allow_url_bbcode);
$text = $message_parser->message;
$uid = $message_parser->bbcode_uid;
@@ -1120,38 +1171,6 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count,
$update_count[] = $attachment['attach_id'];
break;
- // Windows Media Streams
- case ATTACHMENT_CATEGORY_WM:
-
- // Giving the filename directly because within the wm object all variables are in local context making it impossible
- // to validate against a valid session (all params can differ)
- // $download_link = $filename;
-
- $block_array += array(
- 'U_FORUM' => generate_board_url(),
- 'ATTACH_ID' => $attachment['attach_id'],
- 'S_WM_FILE' => true,
- );
-
- // Viewed/Heared File ... update the download count
- $update_count[] = $attachment['attach_id'];
- break;
-
- // Real Media Streams
- case ATTACHMENT_CATEGORY_RM:
- case ATTACHMENT_CATEGORY_QUICKTIME:
-
- $block_array += array(
- 'S_RM_FILE' => ($display_cat == ATTACHMENT_CATEGORY_RM) ? true : false,
- 'S_QUICKTIME_FILE' => ($display_cat == ATTACHMENT_CATEGORY_QUICKTIME) ? true : false,
- 'U_FORUM' => generate_board_url(),
- 'ATTACH_ID' => $attachment['attach_id'],
- );
-
- // Viewed/Heared File ... update the download count
- $update_count[] = $attachment['attach_id'];
- break;
-
// Macromedia Flash Files
case ATTACHMENT_CATEGORY_FLASH:
list($width, $height) = @getimagesize($filename);
diff --git a/phpBB/includes/functions_convert.php b/phpBB/includes/functions_convert.php
index b380273f0c..0a25ae8c36 100644
--- a/phpBB/includes/functions_convert.php
+++ b/phpBB/includes/functions_convert.php
@@ -1312,7 +1312,7 @@ function restore_config($schema)
$config_value = truncate_string(utf8_htmlspecialchars($config_value), 255, 255, false);
}
- set_config($config_name, $config_value);
+ $config->set($config_name, $config_value);
}
}
}
@@ -1968,9 +1968,9 @@ function update_dynamic_config()
if ($row)
{
- set_config('newest_user_id', $row['user_id'], true);
- set_config('newest_username', $row['username'], true);
- set_config('newest_user_colour', $row['user_colour'], true);
+ $config->set('newest_user_id', $row['user_id'], false);
+ $config->set('newest_username', $row['username'], false);
+ $config->set('newest_user_colour', $row['user_colour'], false);
}
// Also do not reset record online user/date. There will be old data or the fresh data from the schema.
@@ -1984,7 +1984,7 @@ function update_dynamic_config()
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- set_config('num_posts', (int) $row['stat'], true);
+ $config->set('num_posts', (int) $row['stat'], false);
$sql = 'SELECT COUNT(topic_id) AS stat
FROM ' . TOPICS_TABLE . '
@@ -1993,7 +1993,7 @@ function update_dynamic_config()
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- set_config('num_topics', (int) $row['stat'], true);
+ $config->set('num_topics', (int) $row['stat'], false);
$sql = 'SELECT COUNT(user_id) AS stat
FROM ' . USERS_TABLE . '
@@ -2002,20 +2002,20 @@ function update_dynamic_config()
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- set_config('num_users', (int) $row['stat'], true);
+ $config->set('num_users', (int) $row['stat'], false);
$sql = 'SELECT COUNT(attach_id) as stat
FROM ' . ATTACHMENTS_TABLE . '
WHERE is_orphan = 0';
$result = $db->sql_query($sql);
- set_config('num_files', (int) $db->sql_fetchfield('stat'), true);
+ $config->set('num_files', (int) $db->sql_fetchfield('stat'), false);
$db->sql_freeresult($result);
$sql = 'SELECT SUM(filesize) as stat
FROM ' . ATTACHMENTS_TABLE . '
WHERE is_orphan = 0';
$result = $db->sql_query($sql);
- set_config('upload_dir_size', (float) $db->sql_fetchfield('stat'), true);
+ $config->set('upload_dir_size', (float) $db->sql_fetchfield('stat'), false);
$db->sql_freeresult($result);
/**
@@ -2316,7 +2316,10 @@ function convert_bbcode($message, $convert_size = true, $extended_bbcodes = fals
function copy_file($src, $trg, $overwrite = false, $die_on_failure = true, $source_relative_path = true)
{
- global $convert, $phpbb_root_path, $config, $user, $db;
+ global $convert, $phpbb_root_path, $config, $user, $db, $phpbb_filesystem;
+
+ /** @var \phpbb\filesystem\filesystem_interface $filesystem */
+ $filesystem = $phpbb_filesystem;
if (substr($trg, -1) == '/')
{
@@ -2349,7 +2352,7 @@ function copy_file($src, $trg, $overwrite = false, $die_on_failure = true, $sour
}
}
- if (!phpbb_is_writable($path))
+ if (!$filesystem->is_writable($path))
{
@chmod($path, 0777);
}
@@ -2370,7 +2373,10 @@ function copy_file($src, $trg, $overwrite = false, $die_on_failure = true, $sour
function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_failure = true, $source_relative_path = true)
{
- global $convert, $phpbb_root_path, $config, $user, $db;
+ global $convert, $phpbb_root_path, $config, $user, $db, $phpbb_filesystem;
+
+ /** @var \phpbb\filesystem\filesystem_interface $filesystem */
+ $filesystem = $phpbb_filesystem;
$dirlist = $filelist = $bad_dirs = array();
$src = path($src, $source_relative_path);
@@ -2384,7 +2390,7 @@ function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_
@chmod($trg_path, 0777);
}
- if (!phpbb_is_writable($trg_path))
+ if (!$filesystem->is_writable($trg_path))
{
$bad_dirs[] = path($config['script_path']) . $trg;
}
@@ -2451,7 +2457,7 @@ function copy_dir($src, $trg, $copy_subdirs = true, $overwrite = false, $die_on_
@chmod($trg_path . $dir, 0777);
}
- if (!phpbb_is_writable($trg_path . $dir))
+ if (!$filesystem->is_writable($trg_path . $dir))
{
$bad_dirs[] = $trg . $dir;
$bad_dirs[] = $trg_path . $dir;
diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php
index 4881dde6f5..3d61b5c098 100644
--- a/phpBB/includes/functions_display.php
+++ b/phpBB/includes/functions_display.php
@@ -33,7 +33,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
$sql_from = '';
// Mark forums read?
- $mark_read = request_var('mark', '');
+ $mark_read = $request->variable('mark', '');
if ($mark_read == 'all')
{
@@ -61,9 +61,9 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
$redirect = build_url(array('mark', 'hash', 'mark_time'));
meta_refresh(3, $redirect);
- if (check_link_hash(request_var('hash', ''), 'global'))
+ if (check_link_hash($request->variable('hash', ''), 'global'))
{
- markread('all', false, false, request_var('mark_time', 0));
+ markread('all', false, false, $request->variable('mark_time', 0));
if ($request->is_ajax())
{
@@ -153,6 +153,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
$forum_tracking_info = $valid_categories = array();
$branch_root_id = $root_data['forum_id'];
+ /* @var $phpbb_content_visibility \phpbb\content_visibility */
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
while ($row = $db->sql_fetchrow($result))
@@ -341,10 +342,10 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
if ($mark_read == 'forums')
{
$redirect = build_url(array('mark', 'hash', 'mark_time'));
- $token = request_var('hash', '');
+ $token = $request->variable('hash', '');
if (check_link_hash($token, 'global'))
{
- markread('topics', $forum_ids, false, request_var('mark_time', 0));
+ markread('topics', $forum_ids, false, $request->variable('mark_time', 0));
$message = sprintf($user->lang['RETURN_FORUM'], '<a href="' . $redirect . '">', '</a>');
meta_refresh(3, $redirect);
@@ -885,6 +886,7 @@ function get_forum_parents(&$forum_data)
function get_moderators(&$forum_moderators, $forum_id = false)
{
global $config, $template, $db, $phpbb_root_path, $phpEx, $user, $auth;
+ global $phpbb_container;
$forum_id_ary = array();
@@ -920,6 +922,9 @@ function get_moderators(&$forum_moderators, $forum_id = false)
'WHERE' => 'm.display_on_index = 1',
);
+ /** @var \phpbb\group\helper $group_helper */
+ $group_helper = $phpbb_container->get('group_helper');
+
// We query every forum here because for caching we should not have any parameter.
$sql = $db->sql_build_query('SELECT', $sql_array);
$result = $db->sql_query($sql, 3600);
@@ -939,7 +944,7 @@ function get_moderators(&$forum_moderators, $forum_id = false)
}
else
{
- $group_name = (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']);
+ $group_name = $group_helper->get_name($row['group_name']);
if ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile'))
{
@@ -1143,33 +1148,14 @@ function display_custom_bbcodes()
/**
* Display reasons
+*
+* @deprecated 3.2.0-dev
*/
function display_reasons($reason_id = 0)
{
- global $db, $user, $template;
-
- $sql = 'SELECT *
- FROM ' . REPORTS_REASONS_TABLE . '
- ORDER BY reason_order ASC';
- $result = $db->sql_query($sql);
-
- while ($row = $db->sql_fetchrow($result))
- {
- // If the reason is defined within the language file, we will use the localized version, else just use the database entry...
- if (isset($user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])]) && isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])]))
- {
- $row['reason_description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])];
- $row['reason_title'] = $user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])];
- }
+ global $phpbb_container;
- $template->assign_block_vars('reason', array(
- 'ID' => $row['reason_id'],
- 'TITLE' => $row['reason_title'],
- 'DESCRIPTION' => $row['reason_description'],
- 'S_SELECTED' => ($row['reason_id'] == $reason_id) ? true : false)
- );
- }
- $db->sql_freeresult($result);
+ $phpbb_container->get('phpbb.report.report_reason_list_provider')->display_reasons($reason_id);
}
/**
@@ -1203,6 +1189,7 @@ function display_user_activity(&$userdata)
$active_f_row = $active_t_row = array();
if (!empty($forum_ary))
{
+ /* @var $phpbb_content_visibility \phpbb\content_visibility */
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
// Obtain active forum
@@ -1334,8 +1321,8 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
{
if (isset($_GET['unwatch']))
{
- $uid = request_var('uid', 0);
- $token = request_var('hash', '');
+ $uid = $request->variable('uid', 0);
+ $token = $request->variable('hash', '');
if ($token && check_link_hash($token, "{$mode}_$match_id") || confirm_box(true))
{
@@ -1408,8 +1395,8 @@ function watch_topic_forum($mode, &$s_watching, $user_id, $forum_id, $topic_id,
{
if (isset($_GET['watch']))
{
- $uid = request_var('uid', 0);
- $token = request_var('hash', '');
+ $uid = $request->variable('uid', 0);
+ $token = $request->variable('hash', '');
if ($token && check_link_hash($token, "{$mode}_$match_id") || confirm_box(true))
{
diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php
index 254e65ae3d..6aabfdf641 100644
--- a/phpBB/includes/functions_download.php
+++ b/phpBB/includes/functions_download.php
@@ -123,7 +123,7 @@ function wrap_img_in_html($src, $title)
*/
function send_file_to_browser($attachment, $upload_dir, $category)
{
- global $user, $db, $config, $phpbb_root_path;
+ global $user, $db, $config, $phpbb_root_path, $request;
$filename = $phpbb_root_path . $upload_dir . '/' . $attachment['physical_filename'];
@@ -185,7 +185,7 @@ function send_file_to_browser($attachment, $upload_dir, $category)
header('X-Content-Type-Options: nosniff');
}
- if ($category == ATTACHMENT_CATEGORY_FLASH && request_var('view', 0) === 1)
+ if ($category == ATTACHMENT_CATEGORY_FLASH && $request->variable('view', 0) === 1)
{
// We use content-disposition: inline for flash files and view=1 to let it correctly play with flash player 10 - any other disposition will fail to play inline
header('Content-Disposition: inline');
diff --git a/phpBB/includes/functions_install.php b/phpBB/includes/functions_install.php
index 28cc603bdb..d9d073e984 100644
--- a/phpBB/includes/functions_install.php
+++ b/phpBB/includes/functions_install.php
@@ -182,18 +182,6 @@ function dbms_select($default = '', $only_20x_options = false)
}
/**
-* Get tables of a database
-*
-* @deprecated
-*/
-function get_tables(&$db)
-{
- $db_tools = new \phpbb\db\tools($db);
-
- return $db_tools->sql_list_tables();
-}
-
-/**
* Used to test whether we are able to connect to the database the user has specified
* and identify any problems (eg there are already tables with the names we want to use
* @param array $dbms should be of the format of an element of the array returned by {@link get_available_dbms get_available_dbms()}
@@ -201,7 +189,7 @@ function get_tables(&$db)
*/
function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix, $dbhost, $dbuser, $dbpasswd, $dbname, $dbport, $prefix_may_exist = false, $load_dbal = true, $unicode_check = true)
{
- global $phpbb_root_path, $phpEx, $config, $lang;
+ global $phpbb_root_path, $phpEx, $config, $lang, $phpbb_filesystem;
$dbms = $dbms_details['DRIVER'];
@@ -217,7 +205,7 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
}
// Make sure we don't have a daft user who thinks having the SQLite database in the forum directory is a good idea
- if (($dbms_details['DRIVER'] == 'phpbb\db\driver\sqlite' || $dbms_details['DRIVER'] == 'phpbb\db\driver\sqlite3') && stripos(phpbb_realpath($dbhost), phpbb_realpath('../')) === 0)
+ if (($dbms_details['DRIVER'] == 'phpbb\db\driver\sqlite' || $dbms_details['DRIVER'] == 'phpbb\db\driver\sqlite3') && stripos($phpbb_filesystem->realpath($dbhost), $phpbb_filesystem->realpath('../')) === 0)
{
$error[] = $lang['INST_ERR_DB_FORUM_PATH'];
return false;
@@ -276,7 +264,9 @@ function connect_check_db($error_connect, &$error, $dbms_details, $table_prefix,
$temp_prefix = strtolower($table_prefix);
$table_ary = array($temp_prefix . 'attachments', $temp_prefix . 'config', $temp_prefix . 'sessions', $temp_prefix . 'topics', $temp_prefix . 'users');
- $tables = get_tables($db);
+ $db_tools_factory = new \phpbb\db\tools\factory();
+ $db_tools = $db_tools_factory->get($db);
+ $tables = $db_tools->sql_list_tables();
$tables = array_map('strtolower', $tables);
$table_intersect = array_intersect($tables, $table_ary);
@@ -451,13 +441,17 @@ function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_cont
$config_data .= "\n@define('PHPBB_INSTALLED', true);\n";
$config_data .= "// @define('PHPBB_DISPLAY_LOAD_TIME', true);\n";
- if ($debug)
+ if ($debug_test)
+ {
+ $config_data .= "@define('PHPBB_ENVIRONMENT', 'test');\n";
+ }
+ else if ($debug)
{
- $config_data .= "@define('DEBUG', true);\n";
+ $config_data .= "@define('PHPBB_ENVIRONMENT', 'development');\n";
}
else
{
- $config_data .= "// @define('DEBUG', true);\n";
+ $config_data .= "@define('PHPBB_ENVIRONMENT', 'production');\n";
}
if ($debug_container)
@@ -472,6 +466,7 @@ function phpbb_create_config_file_data($data, $dbms, $debug = false, $debug_cont
if ($debug_test)
{
$config_data .= "@define('DEBUG_TEST', true);\n";
+ $config_data .= "@define('DEBUG', true);\n"; // Mandatory for the functional tests, will be removed by PHPBB3-12623
}
return $config_data;
diff --git a/phpBB/includes/functions_jabber.php b/phpBB/includes/functions_jabber.php
index bd2e9e93ac..a38888a861 100644
--- a/phpBB/includes/functions_jabber.php
+++ b/phpBB/includes/functions_jabber.php
@@ -87,8 +87,7 @@ class jabber
*/
static public function can_use_ssl()
{
- // Will not work with PHP >= 5.2.1 or < 5.2.3RC2 until timeout problem with ssl hasn't been fixed (http://bugs.php.net/41236)
- return ((version_compare(PHP_VERSION, '5.2.1', '<') || version_compare(PHP_VERSION, '5.2.3RC2', '>=')) && @extension_loaded('openssl')) ? true : false;
+ return @extension_loaded('openssl');
}
/**
diff --git a/phpBB/includes/functions_mcp.php b/phpBB/includes/functions_mcp.php
index ed96dcf338..46e85c5674 100644
--- a/phpBB/includes/functions_mcp.php
+++ b/phpBB/includes/functions_mcp.php
@@ -301,6 +301,7 @@ function phpbb_get_forum_data($forum_id, $acl_list = 'f_list', $read_tracking =
WHERE " . $db->sql_in_set('f.forum_id', $forum_id);
$result = $db->sql_query($sql);
+ /* @var $phpbb_content_visibility \phpbb\content_visibility */
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
while ($row = $db->sql_fetchrow($result))
@@ -368,9 +369,9 @@ 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, $phpbb_dispatcher;
+ global $db, $user, $auth, $template, $request, $phpbb_dispatcher;
- $sort_days = request_var('st', 0);
+ $sort_days = $request->variable('st', 0);
$min_time = ($sort_days) ? time() - ($sort_days * 86400) : 0;
switch ($mode)
@@ -511,8 +512,8 @@ function phpbb_mcp_sorting($mode, &$sort_days, &$sort_key, &$sort_dir, &$sort_by
break;
}
- $sort_key = request_var('sk', $default_key);
- $sort_dir = request_var('sd', $default_dir);
+ $sort_key = $request->variable('sk', $default_key);
+ $sort_dir = $request->variable('sd', $default_dir);
$sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']);
switch ($type)
diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php
index ae393739b9..810f2c0584 100644
--- a/phpBB/includes/functions_messenger.php
+++ b/phpBB/includes/functions_messenger.php
@@ -33,8 +33,6 @@ class messenger
/** @var \phpbb\template\template */
protected $template;
- var $eol = "\n";
-
/**
* Constructor
*/
@@ -44,10 +42,6 @@ class messenger
$this->use_queue = (!$config['email_package_size']) ? false : $use_queue;
$this->subject = '';
-
- // Determine EOL character (\n for UNIX, \r\n for Windows and \r for Mac)
- $this->eol = (!defined('PHP_EOL')) ? (($eol = strtolower(substr(PHP_OS, 0, 3))) == 'win') ? "\r\n" : (($eol == 'mac') ? "\r" : "\n") : PHP_EOL;
- $this->eol = (!$this->eol) ? "\n" : $this->eol;
}
/**
@@ -355,7 +349,7 @@ class messenger
*/
function error($type, $msg)
{
- global $user, $phpEx, $phpbb_root_path, $config, $request;
+ global $user, $phpEx, $phpbb_root_path, $config, $request, $phpbb_log;
// Session doesn't exist, create it
if (!isset($user->session_id) || $user->session_id === '')
@@ -378,7 +372,7 @@ class messenger
}
$message .= '<br /><em>' . htmlspecialchars($calling_page) . '</em><br /><br />' . $msg . '<br />';
- add_log('critical', 'LOG_ERROR_' . $type, $message);
+ $phpbb_log->add('critical', $user->data['user_id'], $user->ip, 'LOG_ERROR_' . $type, false, array($message));
}
/**
@@ -497,7 +491,7 @@ class messenger
$this->from = $board_contact;
}
- $encode_eol = ($config['smtp_delivery']) ? "\r\n" : $this->eol;
+ $encode_eol = ($config['smtp_delivery']) ? "\r\n" : PHP_EOL;
// Build to, cc and bcc strings
$to = $cc = $bcc = '';
@@ -529,7 +523,7 @@ class messenger
}
else
{
- $result = phpbb_mail($mail_to, $this->subject, $this->msg, $headers, $this->eol, $err_msg);
+ $result = phpbb_mail($mail_to, $this->subject, $this->msg, $headers, PHP_EOL, $err_msg);
}
if (!$result)
@@ -629,14 +623,33 @@ class messenger
*/
protected function setup_template()
{
- global $config, $phpbb_path_helper, $user, $phpbb_extension_manager;
+ global $config, $phpbb_path_helper, $user, $phpbb_extension_manager, $phpbb_container, $phpbb_filesystem;
if ($this->template instanceof \phpbb\template\template)
{
return;
}
- $this->template = new \phpbb\template\twig\twig($phpbb_path_helper, $config, $user, new \phpbb\template\context(), $phpbb_extension_manager);
+ $this->template = new \phpbb\template\twig\twig(
+ $phpbb_container->get('path_helper'),
+ $phpbb_container->get('config'),
+ new \phpbb\template\context(),
+ new \phpbb\template\twig\environment(
+ $phpbb_container->get('config'),
+ $phpbb_container->get('filesystem'),
+ $phpbb_container->get('path_helper'),
+ $phpbb_container,
+ $phpbb_container->getParameter('core.root_path') . 'cache/',
+ $phpbb_container->get('ext.manager'),
+ new \phpbb\template\twig\loader(
+ $phpbb_filesystem
+ )
+ ),
+ $phpbb_container->getParameter('core.root_path') . 'cache/',
+ $phpbb_container->get('user'),
+ $phpbb_container->get('template.twig.extensions.collection'),
+ $phpbb_extension_manager
+ );
}
/**
@@ -662,18 +675,20 @@ class queue
var $eol = "\n";
/**
+ * @var \phpbb\filesystem\filesystem_interface
+ */
+ protected $filesystem;
+
+ /**
* constructor
*/
function queue()
{
- global $phpEx, $phpbb_root_path;
+ global $phpEx, $phpbb_root_path, $phpbb_filesystem;
$this->data = array();
$this->cache_file = "{$phpbb_root_path}cache/queue.$phpEx";
-
- // Determine EOL character (\n for UNIX, \r\n for Windows and \r for Mac)
- $this->eol = (!defined('PHP_EOL')) ? (($eol = strtolower(substr(PHP_OS, 0, 3))) == 'win') ? "\r\n" : (($eol == 'mac') ? "\r" : "\n") : PHP_EOL;
- $this->eol = (!$this->eol) ? "\n" : $this->eol;
+ $this->filesystem = $phpbb_filesystem;
}
/**
@@ -711,14 +726,14 @@ class queue
{
if (!$have_cache_file)
{
- set_config('last_queue_run', time(), true);
+ $config->set('last_queue_run', time(), false);
}
$lock->release();
return;
}
- set_config('last_queue_run', time(), true);
+ $config->set('last_queue_run', time(), false);
include($this->cache_file);
@@ -806,7 +821,7 @@ class queue
}
else
{
- $result = phpbb_mail($to, $subject, $msg, $headers, $this->eol, $err_msg);
+ $result = phpbb_mail($to, $subject, $msg, $headers, PHP_EOL, $err_msg);
}
if (!$result)
@@ -859,7 +874,14 @@ class queue
fwrite($fp, "<?php\nif (!defined('IN_PHPBB')) exit;\n\$this->queue_data = unserialize(" . var_export(serialize($this->queue_data), true) . ");\n\n?>");
fclose($fp);
- phpbb_chmod($this->cache_file, CHMOD_READ | CHMOD_WRITE);
+ try
+ {
+ $this->filesystem->phpbb_chmod($this->cache_file, CHMOD_READ | CHMOD_WRITE);
+ }
+ catch (\phpbb\filesystem\exception\filesystem_exception $e)
+ {
+ // Do nothing
+ }
}
}
@@ -901,7 +923,14 @@ class queue
fwrite($fp, "<?php\nif (!defined('IN_PHPBB')) exit;\n\$this->queue_data = unserialize(" . var_export(serialize($this->data), true) . ");\n\n?>");
fclose($fp);
- phpbb_chmod($this->cache_file, CHMOD_READ | CHMOD_WRITE);
+ try
+ {
+ $this->filesystem->phpbb_chmod($this->cache_file, CHMOD_READ | CHMOD_WRITE);
+ }
+ catch (\phpbb\filesystem\exception\filesystem_exception $e)
+ {
+ // Do nothing
+ }
$this->data = array();
}
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php
index 90d59cfd1e..144e6b4e7c 100644
--- a/phpBB/includes/functions_module.php
+++ b/phpBB/includes/functions_module.php
@@ -480,13 +480,15 @@ class p_master
*/
function set_active($id = false, $mode = false)
{
+ global $request;
+
$icat = false;
$this->active_module = false;
- if (request_var('icat', ''))
+ if ($request->variable('icat', ''))
{
$icat = $id;
- $id = request_var('icat', '');
+ $id = $request->variable('icat', '');
}
// Restore the backslashes in class names
@@ -553,10 +555,10 @@ class p_master
*/
function load_active($mode = false, $module_url = false, $execute_module = true)
{
- global $phpbb_root_path, $phpbb_admin_path, $phpEx, $user, $template;
+ global $phpbb_root_path, $phpbb_admin_path, $phpEx, $user, $template, $request;
$module_path = $this->include_path . $this->p_class;
- $icat = request_var('icat', '');
+ $icat = $request->variable('icat', '');
if ($this->active_module === false)
{
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 75d77285a0..4206c87eb9 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -24,12 +24,13 @@ if (!defined('IN_PHPBB'))
*/
function generate_smilies($mode, $forum_id)
{
- global $db, $user, $config, $template, $phpbb_dispatcher;
+ global $db, $user, $config, $template, $phpbb_dispatcher, $request;
global $phpEx, $phpbb_root_path, $phpbb_container, $phpbb_path_helper;
- $base_url = append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=smilies&amp;f=' . $forum_id);
+ /* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
- $start = request_var('start', 0);
+ $base_url = append_sid("{$phpbb_root_path}posting.$phpEx", 'mode=smilies&amp;f=' . $forum_id);
+ $start = $request->variable('start', 0);
if ($mode == 'window')
{
@@ -337,18 +338,15 @@ function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL)
$toggle = false;
$topic_types = array(
- 'sticky' => array('const' => POST_STICKY, 'lang' => 'POST_STICKY'),
- 'announce' => array('const' => POST_ANNOUNCE, 'lang' => 'POST_ANNOUNCEMENT'),
- 'global' => array('const' => POST_GLOBAL, 'lang' => 'POST_GLOBAL')
+ 'sticky' => array('const' => POST_STICKY, 'lang' => 'POST_STICKY'),
+ 'announce' => array('const' => POST_ANNOUNCE, 'lang' => 'POST_ANNOUNCEMENT'),
+ 'announce_global' => array('const' => POST_GLOBAL, 'lang' => 'POST_GLOBAL')
);
$topic_type_array = array();
foreach ($topic_types as $auth_key => $topic_value)
{
- // We do not have a special post global announcement permission
- $auth_key = ($auth_key == 'global') ? 'announce' : $auth_key;
-
if ($auth->acl_get('f_' . $auth_key, $forum_id))
{
$toggle = true;
@@ -378,8 +376,8 @@ function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL)
$template->assign_vars(array(
'S_TOPIC_TYPE_STICKY' => ($auth->acl_get('f_sticky', $forum_id)),
- 'S_TOPIC_TYPE_ANNOUNCE' => ($auth->acl_get('f_announce', $forum_id)))
- );
+ 'S_TOPIC_TYPE_ANNOUNCE' => ($auth->acl_gets('f_announce', 'f_announce_global', $forum_id)),
+ ));
}
return $toggle;
@@ -407,14 +405,14 @@ function posting_gen_topic_types($forum_id, $cur_topic_type = POST_NORMAL)
function upload_attachment($form_name, $forum_id, $local = false, $local_storage = '', $is_message = false, $local_filedata = false, \phpbb\mimetype\guesser $mimetype_guesser = null, \phpbb\plupload\plupload $plupload = null)
{
global $auth, $user, $config, $db, $cache;
- global $phpbb_root_path, $phpEx, $phpbb_dispatcher;
+ global $phpbb_root_path, $phpEx, $phpbb_dispatcher, $phpbb_filesystem;
$filedata = array(
'error' => array()
);
include_once($phpbb_root_path . 'includes/functions_upload.' . $phpEx);
- $upload = new fileupload();
+ $upload = new fileupload($phpbb_filesystem);
if ($config['check_attachment_content'] && isset($config['mime_triggers']))
{
@@ -668,7 +666,7 @@ function get_supported_image_types($type = false)
*/
function create_thumbnail($source, $destination, $mimetype)
{
- global $config;
+ global $config, $phpbb_filesystem;
$min_filesize = (int) $config['img_min_thumb_filesize'];
$img_filesize = (file_exists($source)) ? @filesize($source) : false;
@@ -820,7 +818,14 @@ function create_thumbnail($source, $destination, $mimetype)
return false;
}
- phpbb_chmod($destination, CHMOD_READ | CHMOD_WRITE);
+ try
+ {
+ $phpbb_filesystem->phpbb_chmod($destination, CHMOD_READ | CHMOD_WRITE);
+ }
+ catch (\phpbb\filesystem\exception\filesystem_exception $e)
+ {
+ // Do nothing
+ }
return true;
}
@@ -1040,6 +1045,7 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
global $user, $auth, $db, $template, $cache;
global $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_dispatcher;
+ /* @var $phpbb_content_visibility \phpbb\content_visibility */
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
$sql_sort = ($mode == 'post_review') ? 'ASC' : 'DESC';
@@ -1185,6 +1191,8 @@ function topic_review($topic_id, $forum_id, $mode = 'topic_review', $cur_post_id
'MESSAGE' => $message,
'DECODED_MESSAGE' => $decoded_message,
'POST_ID' => $row['post_id'],
+ 'POST_TIME' => $row['post_time'],
+ 'USER_ID' => $row['user_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'])) : '',
@@ -1296,6 +1304,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data, $is_soft = false, $
$db->sql_freeresult($result);
}
+ /* @var $phpbb_content_visibility \phpbb\content_visibility */
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
// (Soft) delete the post
@@ -1509,7 +1518,7 @@ function delete_post($forum_id, $topic_id, $post_id, &$data, $is_soft = false, $
*/
function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $update_message = true, $update_search_index = true)
{
- global $db, $auth, $user, $config, $phpEx, $template, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher;
+ global $db, $auth, $user, $config, $phpEx, $template, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher, $phpbb_log, $request;
/**
* Modify the data for post submitting
@@ -1689,7 +1698,14 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
if ($user->data['user_id'] != $poster_id)
{
$log_subject = ($subject) ? $subject : $data['topic_title'];
- add_log('mod', $data['forum_id'], $data['topic_id'], 'LOG_POST_EDITED', $log_subject, (!empty($username)) ? $username : $user->lang['GUEST'], $data['post_edit_reason']);
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_POST_EDITED', false, array(
+ 'forum_id' => $data['forum_id'],
+ 'topic_id' => $data['topic_id'],
+ 'post_id' => $data['post_id'],
+ $log_subject,
+ (!empty($username)) ? $username : $user->lang['GUEST'],
+ $data['post_edit_reason']
+ ));
}
if (!isset($sql_data[POSTS_TABLE]['sql']))
@@ -1928,9 +1944,9 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
{
if ($post_mode == 'post')
{
- set_config_count('num_topics', 1, true);
+ $config->increment('num_topics', 1, false);
}
- set_config_count('num_posts', 1, true);
+ $config->increment('num_posts', 1, false);
$sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_id = ' . $data['post_id'];
$sql_data[FORUMS_TABLE]['stat'][] = "forum_last_post_subject = '" . $db->sql_escape($subject) . "'";
@@ -2103,8 +2119,8 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
if ($space_taken && $files_added)
{
- set_config_count('upload_dir_size', $space_taken, true);
- set_config_count('num_files', $files_added, true);
+ $config->increment('upload_dir_size', $space_taken, false);
+ $config->increment('num_files', $files_added, false);
}
}
@@ -2122,6 +2138,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
$is_starter = ($post_mode == 'edit_first_post' || $post_mode == 'edit_topic' || $data['post_visibility'] != ITEM_APPROVED);
$is_latest = ($post_mode == 'edit_last_post' || $post_mode == 'edit_topic' || $data['post_visibility'] != ITEM_APPROVED);
+ /* @var $phpbb_content_visibility \phpbb\content_visibility */
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
$phpbb_content_visibility->set_post_visibility($post_visibility, $data['post_id'], $data['topic_id'], $data['forum_id'], $user->data['user_id'], time(), '', $is_starter, $is_latest);
}
@@ -2197,7 +2214,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
$db->sql_transaction('commit');
// Delete draft if post was loaded...
- $draft_id = request_var('draft_loaded', 0);
+ $draft_id = $request->variable('draft_loaded', 0);
if ($draft_id)
{
$sql = 'DELETE FROM ' . DRAFTS_TABLE . "
@@ -2300,6 +2317,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
'post_subject' => $subject,
));
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
if ($post_visibility == ITEM_APPROVED)
@@ -2478,7 +2496,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
*/
function phpbb_bump_topic($forum_id, $topic_id, $post_data, $bump_time = false)
{
- global $config, $db, $user, $phpEx, $phpbb_root_path;
+ global $config, $db, $user, $phpEx, $phpbb_root_path, $phpbb_log;
if ($bump_time === false)
{
@@ -2557,7 +2575,11 @@ function phpbb_bump_topic($forum_id, $topic_id, $post_data, $bump_time = false)
update_forum_tracking_info($forum_id, $forum_last_post_time, $f_mark_time, false);
}
- add_log('mod', $forum_id, $topic_id, 'LOG_BUMP_TOPIC', $post_data['topic_title']);
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_BUMP_TOPIC', false, array(
+ 'forum_id' => $forum_id,
+ 'topic_id' => $topic_id,
+ $post_data['topic_title']
+ ));
$url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;p={$post_data['topic_last_post_id']}") . "#p{$post_data['topic_last_post_id']}";
@@ -2595,7 +2617,7 @@ function phpbb_upload_popup($forum_style = 0)
function phpbb_handle_post_delete($forum_id, $topic_id, $post_id, &$post_data, $is_soft = false, $delete_reason = '')
{
global $user, $auth, $config, $request;
- global $phpbb_root_path, $phpEx;
+ global $phpbb_root_path, $phpEx, $phpbb_log;
$perm_check = ($is_soft) ? 'softdelete' : 'delete';
@@ -2630,14 +2652,27 @@ function phpbb_handle_post_delete($forum_id, $topic_id, $post_id, &$post_data, $
if ($next_post_id === false)
{
- add_log('mod', $forum_id, $topic_id, (($is_soft) ? 'LOG_SOFTDELETE_TOPIC' : 'LOG_DELETE_TOPIC'), $post_data['topic_title'], $post_username, $delete_reason);
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, (($is_soft) ? 'LOG_SOFTDELETE_TOPIC' : 'LOG_DELETE_TOPIC'), false, array(
+ 'forum_id' => $forum_id,
+ 'topic_id' => $topic_id,
+ $post_data['topic_title'],
+ $post_username,
+ $delete_reason
+ ));
$meta_info = append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id");
$message = $user->lang['POST_DELETED'];
}
else
{
- add_log('mod', $forum_id, $topic_id, (($is_soft) ? 'LOG_SOFTDELETE_POST' : 'LOG_DELETE_POST'), $post_data['post_subject'], $post_username, $delete_reason);
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, (($is_soft) ? 'LOG_SOFTDELETE_POST' : 'LOG_DELETE_POST'), false, array(
+ 'forum_id' => $forum_id,
+ 'topic_id' => $topic_id,
+ 'post_id' => $post_id,
+ $post_data['post_subject'],
+ $post_username,
+ $delete_reason
+ ));
$meta_info = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;p=$next_post_id") . "#p$next_post_id";
$message = $user->lang['POST_DELETED'];
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 8e1561b842..7b6540cda7 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -881,9 +881,10 @@ function update_unread_status($unread, $msg_id, $user_id, $folder_id)
global $db, $user, $phpbb_container;
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
- $phpbb_notifications->mark_notifications_read('notification.type.pm', $msg_id, $user_id);
+ $phpbb_notifications->mark_notifications('notification.type.pm', $msg_id, $user_id);
$sql = 'UPDATE ' . PRIVMSGS_TO_TABLE . "
SET pm_unread = 0
@@ -937,10 +938,10 @@ function mark_folder_read($user_id, $folder_id)
*/
function handle_mark_actions($user_id, $mark_action)
{
- global $db, $user, $phpbb_root_path, $phpEx;
+ global $db, $user, $phpbb_root_path, $phpEx, $request;
- $msg_ids = request_var('marked_msg_id', array(0));
- $cur_folder_id = request_var('cur_folder_id', PRIVMSGS_NO_BOX);
+ $msg_ids = $request->variable('marked_msg_id', array(0));
+ $cur_folder_id = $request->variable('cur_folder_id', PRIVMSGS_NO_BOX);
$confirm = (isset($_POST['confirm'])) ? true : false;
if (!sizeof($msg_ids))
@@ -1130,6 +1131,7 @@ function delete_pm($user_id, $msg_ids, $folder_id)
$user->data['user_unread_privmsg'] -= $num_unread;
}
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
$phpbb_notifications->delete_notifications('notification.type.pm', array_keys($delete_rows));
@@ -1243,6 +1245,7 @@ function phpbb_delete_users_pms($user_ids)
$db->sql_transaction('begin');
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
if (!empty($undelivered_msg))
@@ -1433,7 +1436,10 @@ function rebuild_header($check_ary)
*/
function write_pm_addresses($check_ary, $author_id, $plaintext = false)
{
- global $db, $user, $template, $phpbb_root_path, $phpEx;
+ global $db, $user, $template, $phpbb_root_path, $phpEx, $phpbb_container;
+
+ /** @var \phpbb\group\helper $group_helper */
+ $group_helper = $phpbb_container->get('group_helper');
$addresses = array();
@@ -1494,7 +1500,7 @@ function write_pm_addresses($check_ary, $author_id, $plaintext = false)
{
if ($check_type == 'to' || $author_id == $user->data['user_id'] || $row['user_id'] == $user->data['user_id'])
{
- $address[] = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
+ $address[] = $group_helper->get_name($row['group_name']);
}
}
$db->sql_freeresult($result);
@@ -1514,7 +1520,7 @@ function write_pm_addresses($check_ary, $author_id, $plaintext = false)
{
if ($check_type == 'to' || $author_id == $user->data['user_id'] || $row['user_id'] == $user->data['user_id'])
{
- $row['group_name'] = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
+ $row['group_name'] = $group_helper->get_name($row['group_name']);
$address['group'][$row['group_id']] = array('name' => $row['group_name'], 'colour' => $row['group_colour']);
}
}
@@ -1608,7 +1614,7 @@ function get_folder_status($folder_id, $folder)
*/
function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
{
- global $db, $auth, $config, $phpEx, $template, $user, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher;
+ global $db, $auth, $config, $phpEx, $template, $user, $phpbb_root_path, $phpbb_container, $phpbb_dispatcher, $request;
// We do not handle erasing pms here
if ($mode == 'delete')
@@ -1902,13 +1908,13 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
if ($space_taken && $files_added)
{
- set_config_count('upload_dir_size', $space_taken, true);
- set_config_count('num_files', $files_added, true);
+ $config->increment('upload_dir_size', $space_taken, false);
+ $config->increment('num_files', $files_added, false);
}
}
// Delete draft if post was loaded...
- $draft_id = request_var('draft_loaded', 0);
+ $draft_id = $request->variable('draft_loaded', 0);
if ($draft_id)
{
$sql = 'DELETE FROM ' . DRAFTS_TABLE . "
@@ -1925,6 +1931,7 @@ function submit_pm($mode, $subject, &$data, $put_in_outbox = true)
'recipients' => $recipients,
));
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
if ($mode == 'edit')
@@ -2096,6 +2103,8 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
'S_IN_POST_MODE' => $in_post_mode,
'MSG_ID' => $row['msg_id'],
+ 'MESSAGE_TIME' => $row['message_time'],
+ 'USER_ID' => $row['user_id'],
'U_VIEW_MESSAGE' => "$url&amp;f=$folder_id&amp;p=" . $row['msg_id'],
'U_QUOTE' => (!$in_post_mode && $auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&amp;mode=compose&amp;action=quote&amp;f=" . $folder_id . "&amp;p=" . $row['msg_id'] : '',
'U_POST_REPLY_PM' => ($author_id != $user->data['user_id'] && $author_id != ANONYMOUS && $auth->acl_get('u_sendpm')) ? "$url&amp;mode=compose&amp;action=reply&amp;f=$folder_id&amp;p=" . $row['msg_id'] : '')
@@ -2123,17 +2132,42 @@ function set_user_message_limit()
{
global $user, $db, $config;
- // Get maximum about from user memberships - if it is 0, there is no limit set and we use the maximum value within the config.
- $sql = 'SELECT MAX(g.group_message_limit) as max_message_limit
+ // Get maximum about from user memberships
+ $message_limit = phpbb_get_max_setting_from_group($db, $user->data['user_id'], 'message_limit');
+
+ // If it is 0, there is no limit set and we use the maximum value within the config.
+ $user->data['message_limit'] = (!$message_limit) ? $config['pm_max_msgs'] : $message_limit;
+}
+
+/**
+ * Get the maximum PM setting for the groups of the user
+ *
+ * @param \phpbb\db\driver\driver_interface $db
+ * @param int $user_id
+ * @param string $setting Only 'max_recipients' and 'message_limit' are supported
+ * @return int The maximum setting for all groups of the user, unless one group has '0'
+ * @throws \InvalidArgumentException If selected group setting is not supported
+ */
+function phpbb_get_max_setting_from_group(\phpbb\db\driver\driver_interface $db, $user_id, $setting)
+{
+ if ($setting !== 'max_recipients' && $setting !== 'message_limit')
+ {
+ throw new InvalidArgumentException('Setting "' . $setting . '" is not supported');
+ }
+
+ // Get maximum number of allowed recipients
+ $sql = 'SELECT MIN(g.group_' . $setting . ') as min_setting, MAX(g.group_' . $setting . ') as max_setting
FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . ' ug
- WHERE ug.user_id = ' . $user->data['user_id'] . '
+ WHERE ug.user_id = ' . (int) $user_id . '
AND ug.user_pending = 0
AND ug.group_id = g.group_id';
$result = $db->sql_query($sql);
- $message_limit = (int) $db->sql_fetchfield('max_message_limit');
+ $row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
+ $max_setting = (int) $row['max_setting'];
+ $min_setting = (int) $row['min_setting'];
- $user->data['message_limit'] = (!$message_limit) ? $config['pm_max_msgs'] : $message_limit;
+ return ($min_setting > 0) ? $max_setting : 0;
}
/**
@@ -2147,7 +2181,10 @@ function set_user_message_limit()
*/
function get_recipient_strings($pm_by_id)
{
- global $db, $phpbb_root_path, $phpEx, $user;
+ global $db, $phpbb_root_path, $phpEx, $user, $phpbb_container;
+
+ /** @var \phpbb\group\helper $group_helper */
+ $group_helper = $phpbb_container->get('group_helper');
$address_list = $recipient_list = $address = array();
@@ -2193,7 +2230,7 @@ function get_recipient_strings($pm_by_id)
{
if ($ug_type == 'g')
{
- $row['name'] = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['name']] : $row['name'];
+ $row['name'] = $group_helper->get_name($row['name']);
}
$recipient_list[$ug_type][$row['id']] = array('name' => $row['name'], 'colour' => $row['colour']);
diff --git a/phpBB/includes/functions_upload.php b/phpBB/includes/functions_upload.php
index 89bc31fa25..3ab87ee794 100644
--- a/phpBB/includes/functions_upload.php
+++ b/phpBB/includes/functions_upload.php
@@ -47,6 +47,11 @@ class filespec
var $upload = '';
/**
+ * @var \phpbb\filesystem\filesystem_interface
+ */
+ protected $filesystem;
+
+ /**
* The plupload object
* @var \phpbb\plupload\plupload
*/
@@ -62,7 +67,7 @@ class filespec
* File Class
* @access private
*/
- function filespec($upload_ary, $upload_namespace, \phpbb\mimetype\guesser $mimetype_guesser = null, \phpbb\plupload\plupload $plupload = null)
+ function filespec($upload_ary, $upload_namespace, \phpbb\filesystem\filesystem_interface $phpbb_filesystem, \phpbb\mimetype\guesser $mimetype_guesser = null, \phpbb\plupload\plupload $plupload = null)
{
if (!isset($upload_ary))
{
@@ -97,6 +102,7 @@ class filespec
$this->upload = $upload_namespace;
$this->plupload = $plupload;
$this->mimetype_guesser = $mimetype_guesser;
+ $this->filesystem = $phpbb_filesystem;
}
/**
@@ -376,7 +382,14 @@ class filespec
return false;
}
- phpbb_chmod($this->destination_file, $chmod);
+ try
+ {
+ $this->filesystem->phpbb_chmod($this->destination_file, $chmod);
+ }
+ catch (\phpbb\filesystem\exception\filesystem_exception $e)
+ {
+ // Do nothing
+ }
}
// Try to get real filesize from destination folder
@@ -389,28 +402,28 @@ class filespec
{
$this->width = $this->height = 0;
- if (($this->image_info = @getimagesize($this->destination_file)) !== false)
- {
- $this->width = $this->image_info[0];
- $this->height = $this->image_info[1];
+ // Get imagesize class
+ $imagesize = new \FastImageSize\FastImageSize();
- if (!empty($this->image_info['mime']))
- {
- $this->mimetype = $this->image_info['mime'];
- }
+ $this->image_info = $imagesize->getImageSize($this->destination_file, $this->mimetype);
+
+ if ($this->image_info !== false)
+ {
+ $this->width = $this->image_info['width'];
+ $this->height = $this->image_info['height'];
// Check image type
$types = fileupload::image_types();
- if (!isset($types[$this->image_info[2]]) || !in_array($this->extension, $types[$this->image_info[2]]))
+ if (!isset($types[$this->image_info['type']]) || !in_array($this->extension, $types[$this->image_info['type']]))
{
- if (!isset($types[$this->image_info[2]]))
+ if (!isset($types[$this->image_info['type']]))
{
- $this->error[] = sprintf($user->lang['IMAGE_FILETYPE_INVALID'], $this->image_info[2], $this->mimetype);
+ $this->error[] = $user->lang('IMAGE_FILETYPE_INVALID', $this->image_info['type'], $this->mimetype);
}
else
{
- $this->error[] = sprintf($user->lang['IMAGE_FILETYPE_MISMATCH'], $types[$this->image_info[2]][0], $this->extension);
+ $this->error[] = $user->lang('IMAGE_FILETYPE_MISMATCH', $types[$this->image_info['type']][0], $this->extension);
}
}
@@ -502,8 +515,14 @@ class fileupload
var $upload_timeout = 6;
/**
+ * @var \phpbb\filesystem\filesystem_interface
+ */
+ protected $filesystem;
+
+ /**
* Init file upload class.
*
+ * @param \phpbb\filesystem\filesystem_interface $filesystem
* @param string $error_prefix Used error messages will get prefixed by this string
* @param array $allowed_extensions Array of allowed extensions, for example array('jpg', 'jpeg', 'gif', 'png')
* @param int $max_filesize Maximum filesize
@@ -515,13 +534,14 @@ class fileupload
* contain any of its values. Defaults to false.
*
*/
- function fileupload($error_prefix = '', $allowed_extensions = false, $max_filesize = false, $min_width = false, $min_height = false, $max_width = false, $max_height = false, $disallowed_content = false)
+ function fileupload(\phpbb\filesystem\filesystem_interface $filesystem, $error_prefix = '', $allowed_extensions = false, $max_filesize = false, $min_width = false, $min_height = false, $max_width = false, $max_height = false, $disallowed_content = false)
{
$this->set_allowed_extensions($allowed_extensions);
$this->set_max_filesize($max_filesize);
$this->set_allowed_dimensions($min_width, $min_height, $max_width, $max_height);
$this->set_error_prefix($error_prefix);
$this->set_disallowed_content($disallowed_content);
+ $this->filesystem = $filesystem;
}
/**
@@ -615,7 +635,7 @@ class fileupload
}
}
- $file = new filespec($upload, $this, $mimetype_guesser, $plupload);
+ $file = new filespec($upload, $this, $this->filesystem, $mimetype_guesser, $plupload);
if ($file->init_error)
{
@@ -696,7 +716,7 @@ class fileupload
$upload['type'] = $filedata['type'];
}
- $file = new filespec($upload, $this, $mimetype_guesser);
+ $file = new filespec($upload, $this, $this->filesystem, $mimetype_guesser);
if ($file->init_error)
{
@@ -934,7 +954,7 @@ class fileupload
$upload_ary['tmp_name'] = $filename;
- $file = new filespec($upload_ary, $this, $mimetype_guesser);
+ $file = new filespec($upload_ary, $this, $this->filesystem, $mimetype_guesser);
$this->common_checks($file);
return $file;
diff --git a/phpBB/includes/functions_url_matcher.php b/phpBB/includes/functions_url_matcher.php
deleted file mode 100644
index b965046aad..0000000000
--- a/phpBB/includes/functions_url_matcher.php
+++ /dev/null
@@ -1,112 +0,0 @@
-<?php
-/**
-*
-* This file is part of the phpBB Forum Software package.
-*
-* @copyright (c) phpBB Limited <https://www.phpbb.com>
-* @license GNU General Public License, version 2 (GPL-2.0)
-*
-* For full copyright and license information, please see
-* the docs/CREDITS.txt file.
-*
-*/
-
-use Symfony\Component\Routing\Matcher\Dumper\PhpMatcherDumper;
-use Symfony\Component\Routing\Matcher\UrlMatcher;
-use Symfony\Component\Routing\RequestContext;
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* Create a new UrlMatcher class and dump it into the cache file
-*
-* @param \phpbb\extension\manager $manager Extension manager
-* @param RequestContext $context Symfony RequestContext object
-* @param string $root_path Root path
-* @param string $php_ext PHP file extension
-* @return null
-*/
-function phpbb_get_url_matcher(\phpbb\extension\manager $manager, RequestContext $context, $root_path, $php_ext)
-{
- if (defined('DEBUG'))
- {
- return phpbb_create_url_matcher($manager, $context, $root_path);
- }
-
- if (!phpbb_url_matcher_dumped($root_path, $php_ext))
- {
- phpbb_create_dumped_url_matcher($manager, $root_path, $php_ext);
- }
-
- return phpbb_load_url_matcher($context, $root_path, $php_ext);
-}
-
-/**
-* Create a new UrlMatcher class and dump it into the cache file
-*
-* @param \phpbb\extension\manager $manager Extension manager
-* @param string $root_path Root path
-* @param string $php_ext PHP file extension
-* @return null
-*/
-function phpbb_create_dumped_url_matcher(\phpbb\extension\manager $manager, $root_path, $php_ext)
-{
- $provider = new \phpbb\controller\provider();
- $provider->find_routing_files($manager->get_finder());
- $routes = $provider->find($root_path)->get_routes();
- $dumper = new PhpMatcherDumper($routes);
- $cached_url_matcher_dump = $dumper->dump(array(
- 'class' => 'phpbb_url_matcher',
- ));
-
- file_put_contents($root_path . 'cache/url_matcher.' . $php_ext, $cached_url_matcher_dump);
-}
-
-/**
-* Create a non-cached UrlMatcher
-*
-* @param \phpbb\extension\manager $manager Extension manager
-* @param RequestContext $context Symfony RequestContext object
-* @return UrlMatcher
-*/
-function phpbb_create_url_matcher(\phpbb\extension\manager $manager, RequestContext $context, $root_path)
-{
- $provider = new \phpbb\controller\provider();
- $provider->find_routing_files($manager->get_finder());
- $routes = $provider->find($root_path)->get_routes();
- return new UrlMatcher($routes, $context);
-}
-
-/**
-* Load the cached phpbb_url_matcher class
-*
-* @param RequestContext $context Symfony RequestContext object
-* @param string $root_path Root path
-* @param string $php_ext PHP file extension
-* @return phpbb_url_matcher
-*/
-function phpbb_load_url_matcher(RequestContext $context, $root_path, $php_ext)
-{
- require($root_path . 'cache/url_matcher.' . $php_ext);
- return new phpbb_url_matcher($context);
-}
-
-/**
-* Determine whether we have our dumped URL matcher
-*
-* The class is automatically dumped to the cache directory
-*
-* @param string $root_path Root path
-* @param string $php_ext PHP file extension
-* @return bool True if it exists, false if not
-*/
-function phpbb_url_matcher_dumped($root_path, $php_ext)
-{
- return file_exists($root_path . 'cache/url_matcher.' . $php_ext);
-}
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index c46653db9e..98ffb4227d 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -89,7 +89,7 @@ function user_get_id_name(&$user_id_ary, &$username_ary, $user_type = false)
*/
function update_last_username()
{
- global $db;
+ global $config, $db;
// Get latest username
$sql = 'SELECT user_id, username, user_colour
@@ -102,9 +102,9 @@ function update_last_username()
if ($row)
{
- set_config('newest_user_id', $row['user_id'], true);
- set_config('newest_username', $row['username'], true);
- set_config('newest_user_colour', $row['user_colour'], true);
+ $config->set('newest_user_id', $row['user_id'], false);
+ $config->set('newest_username', $row['username'], false);
+ $config->set('newest_user_colour', $row['user_colour'], false);
}
}
@@ -138,7 +138,7 @@ function user_update_name($old_name, $new_name)
if ($config['newest_username'] == $old_name)
{
- set_config('newest_username', $new_name, true);
+ $config->set('newest_username', $new_name, false);
}
/**
@@ -281,6 +281,7 @@ function user_add($user_row, $cp_data = false, $notifications_data = null)
{
$cp_data['user_id'] = (int) $user_id;
+ /* @var $cp \phpbb\profilefields\manager */
$cp = $phpbb_container->get('profilefields.manager');
$sql = 'INSERT INTO ' . PROFILE_FIELDS_DATA_TABLE . ' ' .
$db->sql_build_array('INSERT', $cp->build_insert_sql_array($cp_data));
@@ -313,7 +314,7 @@ function user_add($user_row, $cp_data = false, $notifications_data = null)
{
global $phpbb_log;
- // Because these actions only fill the log unneccessarily we skip the add_log() entry.
+ // Because these actions only fill the log unnecessarily, we disable it
$phpbb_log->disable('admin');
// Add user to "newly registered users" group and set to default group if admin specified so.
@@ -334,9 +335,9 @@ function user_add($user_row, $cp_data = false, $notifications_data = null)
// set the newest user and adjust the user count if the user is a normal user and no activation mail is sent
if ($user_row['user_type'] == USER_NORMAL || $user_row['user_type'] == USER_FOUNDER)
{
- set_config('newest_user_id', $user_id, true);
- set_config('newest_username', $user_row['username'], true);
- set_config_count('num_users', 1, true);
+ $config->set('newest_user_id', $user_id, false);
+ $config->set('newest_username', $user_row['username'], false);
+ $config->increment('num_users', 1, false);
$sql = 'SELECT group_colour
FROM ' . GROUPS_TABLE . '
@@ -345,7 +346,7 @@ function user_add($user_row, $cp_data = false, $notifications_data = null)
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- set_config('newest_user_colour', $row['group_colour'], true);
+ $config->set('newest_user_colour', $row['group_colour'], false);
}
// Use default notifications settings if notifications_data is not set
@@ -366,6 +367,7 @@ function user_add($user_row, $cp_data = false, $notifications_data = null)
// Subscribe user to notifications if necessary
if (!empty($notifications_data))
{
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
foreach ($notifications_data as $subscription)
{
@@ -606,7 +608,7 @@ function user_delete($mode, $user_ids, $retain_username = true)
if ($num_users_delta != 0)
{
- set_config_count('num_users', $num_users_delta, true);
+ $config->increment('num_users', $num_users_delta, false);
}
// Now do the invariant tasks
@@ -839,12 +841,12 @@ function user_active_flip($mode, $user_id_ary, $reason = INACTIVE_MANUAL)
if ($deactivated)
{
- set_config_count('num_users', $deactivated * (-1), true);
+ $config->increment('num_users', $deactivated * (-1), false);
}
if ($activated)
{
- set_config_count('num_users', $activated, true);
+ $config->increment('num_users', $activated, false);
}
// Update latest username
@@ -864,7 +866,7 @@ function user_active_flip($mode, $user_id_ary, $reason = INACTIVE_MANUAL)
*/
function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reason, $ban_give_reason = '')
{
- global $db, $user, $auth, $cache;
+ global $db, $user, $auth, $cache, $phpbb_log;
// Delete stale bans
$sql = 'DELETE FROM ' . BANLIST_TABLE . '
@@ -1255,13 +1257,22 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
$log_entry = ($ban_exclude) ? 'LOG_BAN_EXCLUDE_' : 'LOG_BAN_';
// Add to admin log, moderator log and user notes
- add_log('admin', $log_entry . strtoupper($mode), $ban_reason, $ban_list_log);
- add_log('mod', 0, 0, $log_entry . strtoupper($mode), $ban_reason, $ban_list_log);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, $log_entry . strtoupper($mode), false, array($ban_reason, $ban_list_log));
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, $log_entry . strtoupper($mode), false, array(
+ 'forum_id' => 0,
+ 'topic_id' => 0,
+ $ban_reason,
+ $ban_list_log
+ ));
if ($mode == 'user')
{
foreach ($banlist_ary as $user_id)
{
- add_log('user', $user_id, $log_entry . strtoupper($mode), $ban_reason, $ban_list_log);
+ $phpbb_log->add('user', $user->data['user_id'], $user->ip, $log_entry . strtoupper($mode), false, array(
+ 'reportee_id' => $user_id,
+ $ban_reason,
+ $ban_list_log
+ ));
}
}
@@ -1281,7 +1292,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
*/
function user_unban($mode, $ban)
{
- global $db, $user, $auth, $cache;
+ global $db, $user, $auth, $cache, $phpbb_log;
// Delete stale bans
$sql = 'DELETE FROM ' . BANLIST_TABLE . '
@@ -1339,13 +1350,20 @@ function user_unban($mode, $ban)
$db->sql_query($sql);
// Add to moderator log, admin log and user notes
- add_log('admin', 'LOG_UNBAN_' . strtoupper($mode), $l_unban_list);
- add_log('mod', 0, 0, 'LOG_UNBAN_' . strtoupper($mode), $l_unban_list);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_UNBAN_' . strtoupper($mode), false, array($l_unban_list));
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_UNBAN_' . strtoupper($mode), false, array(
+ 'forum_id' => 0,
+ 'topic_id' => 0,
+ $l_unban_list
+ ));
if ($mode == 'user')
{
foreach ($user_ids_ary as $user_id)
{
- add_log('user', $user_id, 'LOG_UNBAN_' . strtoupper($mode), $l_unban_list);
+ $phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_UNBAN_' . strtoupper($mode), false, array(
+ 'reportee_id' => $user_id,
+ $l_unban_list
+ ));
}
}
}
@@ -1664,89 +1682,37 @@ function validate_username($username, $allowed_username = false)
return 'INVALID_CHARS';
}
- $mbstring = $pcre = false;
-
- // generic UTF-8 character types supported?
- if (phpbb_pcre_utf8_support())
- {
- $pcre = true;
- }
- else if (function_exists('mb_ereg_match'))
- {
- mb_regex_encoding('UTF-8');
- $mbstring = true;
- }
-
switch ($config['allow_name_chars'])
{
case 'USERNAME_CHARS_ANY':
- $pcre = true;
$regex = '.+';
break;
case 'USERNAME_ALPHA_ONLY':
- $pcre = true;
$regex = '[A-Za-z0-9]+';
break;
case 'USERNAME_ALPHA_SPACERS':
- $pcre = true;
$regex = '[A-Za-z0-9-[\]_+ ]+';
break;
case 'USERNAME_LETTER_NUM':
- if ($pcre)
- {
- $regex = '[\p{Lu}\p{Ll}\p{N}]+';
- }
- else if ($mbstring)
- {
- $regex = '[[:upper:][:lower:][:digit:]]+';
- }
- else
- {
- $pcre = true;
- $regex = '[a-zA-Z0-9]+';
- }
+ $regex = '[\p{Lu}\p{Ll}\p{N}]+';
break;
case 'USERNAME_LETTER_NUM_SPACERS':
- if ($pcre)
- {
- $regex = '[-\]_+ [\p{Lu}\p{Ll}\p{N}]+';
- }
- else if ($mbstring)
- {
- $regex = '[-\]_+ \[[:upper:][:lower:][:digit:]]+';
- }
- else
- {
- $pcre = true;
- $regex = '[-\]_+ [a-zA-Z0-9]+';
- }
+ $regex = '[-\]_+ [\p{Lu}\p{Ll}\p{N}]+';
break;
case 'USERNAME_ASCII':
default:
- $pcre = true;
$regex = '[\x01-\x7F]+';
break;
}
- if ($pcre)
+ if (!preg_match('#^' . $regex . '$#u', $username))
{
- if (!preg_match('#^' . $regex . '$#u', $username))
- {
- return 'INVALID_CHARS';
- }
- }
- else if ($mbstring)
- {
- mb_ereg_search_init($username, '^' . $regex . '$');
- if (!mb_ereg_search())
- {
- return 'INVALID_CHARS';
- }
+ return 'INVALID_CHARS';
}
$sql = 'SELECT username
@@ -1801,35 +1767,10 @@ function validate_password($password)
return false;
}
- $pcre = $mbstring = false;
-
- // generic UTF-8 character types supported?
- if (phpbb_pcre_utf8_support())
- {
- $upp = '\p{Lu}';
- $low = '\p{Ll}';
- $num = '\p{N}';
- $sym = '[^\p{Lu}\p{Ll}\p{N}]';
- $pcre = true;
- }
- else if (function_exists('mb_ereg_match'))
- {
- mb_regex_encoding('UTF-8');
- $upp = '[[:upper:]]';
- $low = '[[:lower:]]';
- $num = '[[:digit:]]';
- $sym = '[^[:upper:][:lower:][:digit:]]';
- $mbstring = true;
- }
- else
- {
- $upp = '[A-Z]';
- $low = '[a-z]';
- $num = '[0-9]';
- $sym = '[^A-Za-z0-9]';
- $pcre = true;
- }
-
+ $upp = '\p{Lu}';
+ $low = '\p{Ll}';
+ $num = '\p{N}';
+ $sym = '[^\p{Lu}\p{Ll}\p{N}]';
$chars = array();
switch ($config['pass_complex'])
@@ -1852,24 +1793,11 @@ function validate_password($password)
$chars[] = $upp;
}
- if ($pcre)
+ foreach ($chars as $char)
{
- foreach ($chars as $char)
+ if (!preg_match('#' . $char . '#u', $password))
{
- if (!preg_match('#' . $char . '#u', $password))
- {
- return 'INVALID_CHARS';
- }
- }
- }
- else if ($mbstring)
- {
- foreach ($chars as $char)
- {
- if (mb_ereg($char, $password) === false)
- {
- return 'INVALID_CHARS';
- }
+ return 'INVALID_CHARS';
}
}
@@ -2285,7 +2213,10 @@ function phpbb_avatar_explanation_string()
*/
function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow_desc_bbcode = false, $allow_desc_urls = false, $allow_desc_smilies = false)
{
- global $phpbb_root_path, $config, $db, $user, $file_upload, $phpbb_container;
+ global $phpbb_root_path, $config, $db, $user, $file_upload, $phpbb_container, $phpbb_log;
+
+ /** @var \phpbb\group\helper $group_helper */
+ $group_helper = $phpbb_container->get('group_helper');
$error = array();
@@ -2317,8 +2248,12 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
$current_legend = \phpbb\groupposition\legend::GROUP_DISABLED;
$current_teampage = \phpbb\groupposition\teampage::GROUP_DISABLED;
+ /* @var $legend \phpbb\groupposition\legend */
$legend = $phpbb_container->get('groupposition.legend');
+
+ /* @var $teampage \phpbb\groupposition\teampage */
$teampage = $phpbb_container->get('groupposition.teampage');
+
if ($group_id)
{
try
@@ -2534,8 +2469,8 @@ function group_create(&$group_id, $type, $name, $desc, $group_attributes, $allow
group_set_user_default($group_id, $user_ary, $sql_ary);
}
- $name = ($type == GROUP_SPECIAL) ? $user->lang['G_' . $name] : $name;
- add_log('admin', $log, $name);
+ $name = $group_helper->get_name($name);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, $log, false, array($name));
group_update_listings($group_id);
}
@@ -2588,7 +2523,7 @@ function avatar_remove_db($avatar_name)
*/
function group_delete($group_id, $group_name = false)
{
- global $db, $cache, $auth, $user, $phpbb_root_path, $phpEx, $phpbb_dispatcher, $phpbb_container;
+ global $db, $cache, $auth, $user, $phpbb_root_path, $phpEx, $phpbb_dispatcher, $phpbb_container, $phpbb_log;
if (!$group_name)
{
@@ -2632,6 +2567,7 @@ function group_delete($group_id, $group_name = false)
// Delete group from legend and teampage
try
{
+ /* @var $legend \phpbb\groupposition\legend */
$legend = $phpbb_container->get('groupposition.legend');
$legend->delete_group($group_id);
unset($legend);
@@ -2645,6 +2581,7 @@ function group_delete($group_id, $group_name = false)
try
{
+ /* @var $teampage \phpbb\groupposition\teampage */
$teampage = $phpbb_container->get('groupposition.teampage');
$teampage->delete_group($group_id);
unset($teampage);
@@ -2685,7 +2622,7 @@ function group_delete($group_id, $group_name = false)
phpbb_cache_moderators($db, $cache, $auth);
- add_log('admin', 'LOG_GROUP_DELETE', $group_name);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_GROUP_DELETE', false, array($group_name));
// Return false - no error
return false;
@@ -2698,7 +2635,7 @@ function group_delete($group_id, $group_name = false)
*/
function group_user_add($group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $default = false, $leader = 0, $pending = 0, $group_attributes = false)
{
- global $db, $auth, $phpbb_container;
+ global $db, $auth, $user, $phpbb_container, $phpbb_log;
// We need both username and user_id info
$result = user_get_id_name($user_id_ary, $username_ary);
@@ -2782,12 +2719,13 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false,
$log = ($leader) ? 'LOG_MODS_ADDED' : (($pending) ? 'LOG_USERS_PENDING' : 'LOG_USERS_ADDED');
- add_log('admin', $log, $group_name, implode(', ', $username_ary));
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, $log, false, array($group_name, implode(', ', $username_ary)));
group_update_listings($group_id);
if ($pending)
{
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
foreach ($add_id_ary as $user_id)
@@ -2813,7 +2751,7 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false,
*/
function group_user_del($group_id, $user_id_ary = false, $username_ary = false, $group_name = false)
{
- global $db, $auth, $config, $phpbb_dispatcher, $phpbb_container;
+ global $db, $auth, $config, $user, $phpbb_dispatcher, $phpbb_container, $phpbb_log;
if ($config['coppa_enable'])
{
@@ -2942,11 +2880,12 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false,
if ($group_name)
{
- add_log('admin', $log, $group_name, implode(', ', $username_ary));
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, $log, false, array($group_name, implode(', ', $username_ary)));
}
group_update_listings($group_id);
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
$phpbb_notifications->delete_notifications('notification.type.group_request', $user_id_ary, $group_id);
@@ -3040,7 +2979,7 @@ function remove_default_rank($group_id, $user_ids)
*/
function group_user_attributes($action, $group_id, $user_id_ary = false, $username_ary = false, $group_name = false, $group_attributes = false)
{
- global $db, $auth, $phpbb_root_path, $phpEx, $config, $phpbb_container;
+ global $db, $auth, $user, $phpbb_root_path, $phpEx, $config, $phpbb_container, $phpbb_log;
// We need both username and user_id info
$result = user_get_id_name($user_id_ary, $username_ary);
@@ -3111,6 +3050,7 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
AND " . $db->sql_in_set('user_id', $user_id_ary);
$db->sql_query($sql);
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
$phpbb_notifications->add_notifications('notification.type.group_request_approved', array(
@@ -3174,7 +3114,7 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
// Clear permissions cache of relevant users
$auth->acl_clear_prefetch($user_id_ary);
- add_log('admin', $log, $group_name, implode(', ', $username_ary));
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, $log, false, array($group_name, implode(', ', $username_ary)));
group_update_listings($group_id);
@@ -3234,7 +3174,7 @@ function group_validate_groupname($group_id, $group_name)
*/
function group_set_user_default($group_id, $user_id_ary, $group_attributes = false, $update_listing = false)
{
- global $phpbb_container, $db, $phpbb_dispatcher;
+ global $config, $phpbb_container, $db, $phpbb_dispatcher;
if (empty($user_id_ary))
{
@@ -3304,8 +3244,8 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal
if (isset($sql_ary[$avatar_option]))
{
$avatar_sql_ary[$avatar_option] = $sql_ary[$avatar_option];
- }
}
+ }
$sql = 'UPDATE ' . USERS_TABLE . '
SET ' . $db->sql_build_array('UPDATE', $avatar_sql_ary) . "
@@ -3346,11 +3286,9 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal
WHERE " . $db->sql_in_set('topic_last_poster_id', $user_id_ary);
$db->sql_query($sql);
- global $config;
-
if (in_array($config['newest_user_id'], $user_id_ary))
{
- set_config('newest_user_colour', $sql_ary['user_colour'], true);
+ $config->set('newest_user_colour', $sql_ary['user_colour'], false);
}
}
@@ -3385,7 +3323,7 @@ function group_set_user_default($group_id, $user_id_ary, $group_attributes = fal
*/
function get_group_name($group_id)
{
- global $db, $user;
+ global $db, $user, $phpbb_container;
$sql = 'SELECT group_name, group_type
FROM ' . GROUPS_TABLE . '
@@ -3394,12 +3332,15 @@ function get_group_name($group_id)
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- if (!$row || ($row['group_type'] == GROUP_SPECIAL && empty($user->lang)))
+ if (!$row)
{
return '';
}
- return ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
+ /** @var \phpbb\group\helper $group_helper */
+ $group_helper = $phpbb_container->get('group_helper');
+
+ return $group_helper->get_name($row['group_name']);
}
/**
diff --git a/phpBB/includes/mcp/info/mcp_ban.php b/phpBB/includes/mcp/info/mcp_ban.php
index 4aedbc8558..b4fd32792a 100644
--- a/phpBB/includes/mcp/info/mcp_ban.php
+++ b/phpBB/includes/mcp/info/mcp_ban.php
@@ -18,7 +18,6 @@ class mcp_ban_info
return array(
'filename' => 'mcp_ban',
'title' => 'MCP_BAN',
- 'version' => '1.0.0',
'modes' => array(
'user' => array('title' => 'MCP_BAN_USERNAMES', 'auth' => 'acl_m_ban', 'cat' => array('MCP_BAN')),
'ip' => array('title' => 'MCP_BAN_IPS', 'auth' => 'acl_m_ban', 'cat' => array('MCP_BAN')),
diff --git a/phpBB/includes/mcp/info/mcp_logs.php b/phpBB/includes/mcp/info/mcp_logs.php
index c6482c1255..7a0205fce9 100644
--- a/phpBB/includes/mcp/info/mcp_logs.php
+++ b/phpBB/includes/mcp/info/mcp_logs.php
@@ -18,7 +18,6 @@ class mcp_logs_info
return array(
'filename' => 'mcp_logs',
'title' => 'MCP_LOGS',
- 'version' => '1.0.0',
'modes' => array(
'front' => array('title' => 'MCP_LOGS_FRONT', 'auth' => 'acl_m_ || aclf_m_', 'cat' => array('MCP_LOGS')),
'forum_logs' => array('title' => 'MCP_LOGS_FORUM_VIEW', 'auth' => 'acl_m_,$id', 'cat' => array('MCP_LOGS')),
diff --git a/phpBB/includes/mcp/info/mcp_main.php b/phpBB/includes/mcp/info/mcp_main.php
index 81ccdbd1cd..c0f0363255 100644
--- a/phpBB/includes/mcp/info/mcp_main.php
+++ b/phpBB/includes/mcp/info/mcp_main.php
@@ -18,7 +18,6 @@ class mcp_main_info
return array(
'filename' => 'mcp_main',
'title' => 'MCP_MAIN',
- 'version' => '1.0.0',
'modes' => array(
'front' => array('title' => 'MCP_MAIN_FRONT', 'auth' => '', 'cat' => array('MCP_MAIN')),
'forum_view' => array('title' => 'MCP_MAIN_FORUM_VIEW', 'auth' => 'acl_m_,$id', 'cat' => array('MCP_MAIN')),
diff --git a/phpBB/includes/mcp/info/mcp_notes.php b/phpBB/includes/mcp/info/mcp_notes.php
index 4b8c255fe2..de4a41dd80 100644
--- a/phpBB/includes/mcp/info/mcp_notes.php
+++ b/phpBB/includes/mcp/info/mcp_notes.php
@@ -18,7 +18,6 @@ class mcp_notes_info
return array(
'filename' => 'mcp_notes',
'title' => 'MCP_NOTES',
- 'version' => '1.0.0',
'modes' => array(
'front' => array('title' => 'MCP_NOTES_FRONT', 'auth' => '', 'cat' => array('MCP_NOTES')),
'user_notes' => array('title' => 'MCP_NOTES_USER', 'auth' => '', 'cat' => array('MCP_NOTES')),
diff --git a/phpBB/includes/mcp/info/mcp_pm_reports.php b/phpBB/includes/mcp/info/mcp_pm_reports.php
index 8670b71084..6f8b8d9937 100644
--- a/phpBB/includes/mcp/info/mcp_pm_reports.php
+++ b/phpBB/includes/mcp/info/mcp_pm_reports.php
@@ -18,7 +18,6 @@ class mcp_pm_reports_info
return array(
'filename' => 'mcp_pm_reports',
'title' => 'MCP_PM_REPORTS',
- 'version' => '1.0.0',
'modes' => array(
'pm_reports' => array('title' => 'MCP_PM_REPORTS_OPEN', 'auth' => 'aclf_m_report', 'cat' => array('MCP_REPORTS')),
'pm_reports_closed' => array('title' => 'MCP_PM_REPORTS_CLOSED', 'auth' => 'aclf_m_report', 'cat' => array('MCP_REPORTS')),
diff --git a/phpBB/includes/mcp/info/mcp_queue.php b/phpBB/includes/mcp/info/mcp_queue.php
index 556c3902b0..d5605aa50e 100644
--- a/phpBB/includes/mcp/info/mcp_queue.php
+++ b/phpBB/includes/mcp/info/mcp_queue.php
@@ -18,7 +18,6 @@ class mcp_queue_info
return array(
'filename' => 'mcp_queue',
'title' => 'MCP_QUEUE',
- 'version' => '1.0.0',
'modes' => array(
'unapproved_topics' => array('title' => 'MCP_QUEUE_UNAPPROVED_TOPICS', 'auth' => 'aclf_m_approve', 'cat' => array('MCP_QUEUE')),
'unapproved_posts' => array('title' => 'MCP_QUEUE_UNAPPROVED_POSTS', 'auth' => 'aclf_m_approve', 'cat' => array('MCP_QUEUE')),
diff --git a/phpBB/includes/mcp/info/mcp_reports.php b/phpBB/includes/mcp/info/mcp_reports.php
index 31fee19d79..76e62efe9c 100644
--- a/phpBB/includes/mcp/info/mcp_reports.php
+++ b/phpBB/includes/mcp/info/mcp_reports.php
@@ -18,7 +18,6 @@ class mcp_reports_info
return array(
'filename' => 'mcp_reports',
'title' => 'MCP_REPORTS',
- 'version' => '1.0.0',
'modes' => array(
'reports' => array('title' => 'MCP_REPORTS_OPEN', 'auth' => 'aclf_m_report', 'cat' => array('MCP_REPORTS')),
'reports_closed' => array('title' => 'MCP_REPORTS_CLOSED', 'auth' => 'aclf_m_report', 'cat' => array('MCP_REPORTS')),
diff --git a/phpBB/includes/mcp/info/mcp_warn.php b/phpBB/includes/mcp/info/mcp_warn.php
index d85499f280..b4f83e77c6 100644
--- a/phpBB/includes/mcp/info/mcp_warn.php
+++ b/phpBB/includes/mcp/info/mcp_warn.php
@@ -18,7 +18,6 @@ class mcp_warn_info
return array(
'filename' => 'mcp_warn',
'title' => 'MCP_WARN',
- 'version' => '1.0.0',
'modes' => array(
'front' => array('title' => 'MCP_WARN_FRONT', 'auth' => 'aclf_m_warn', 'cat' => array('MCP_WARN')),
'list' => array('title' => 'MCP_WARN_LIST', 'auth' => 'aclf_m_warn', 'cat' => array('MCP_WARN')),
diff --git a/phpBB/includes/mcp/mcp_forum.php b/phpBB/includes/mcp/mcp_forum.php
index 6faf0de35b..f73973b81d 100644
--- a/phpBB/includes/mcp/mcp_forum.php
+++ b/phpBB/includes/mcp/mcp_forum.php
@@ -36,11 +36,11 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
$merge_select = ($action == 'merge_select' || $action == 'merge_topic' || $action == 'merge_topics') ? true : false;
$forum_id = $forum_info['forum_id'];
- $start = request_var('start', 0);
- $topic_id_list = request_var('topic_id_list', array(0));
- $post_id_list = request_var('post_id_list', array(0));
- $source_topic_ids = array(request_var('t', 0));
- $to_topic_id = request_var('to_topic_id', 0);
+ $start = $request->variable('start', 0);
+ $topic_id_list = $request->variable('topic_id_list', array(0));
+ $post_id_list = $request->variable('post_id_list', array(0));
+ $source_topic_ids = array($request->variable('t', 0));
+ $to_topic_id = $request->variable('to_topic_id', 0);
$url_extra = '';
$url_extra .= ($forum_id) ? "&amp;f=$forum_id" : '';
@@ -54,7 +54,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
switch ($action)
{
case 'resync':
- $topic_ids = request_var('topic_id_list', array(0));
+ $topic_ids = $request->variable('topic_id_list', array(0));
mcp_resync_topics($topic_ids);
break;
@@ -92,6 +92,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
);
extract($phpbb_dispatcher->trigger_event('core.mcp_forum_view_before', compact($vars)));
+ /* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
$selected_ids = '';
@@ -145,9 +146,10 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
'S_CAN_SYNC' => $auth->acl_get('m_', $forum_id),
'S_CAN_APPROVE' => $auth->acl_get('m_approve', $forum_id),
'S_MERGE_SELECT' => ($merge_select) ? true : false,
- 'S_CAN_MAKE_NORMAL' => $auth->acl_gets('f_sticky', 'f_announce', $forum_id),
+ 'S_CAN_MAKE_NORMAL' => $auth->acl_gets('f_sticky', 'f_announce', 'f_announce_global', $forum_id),
'S_CAN_MAKE_STICKY' => $auth->acl_get('f_sticky', $forum_id),
'S_CAN_MAKE_ANNOUNCE' => $auth->acl_get('f_announce', $forum_id),
+ 'S_CAN_MAKE_ANNOUNCE_GLOBAL' => $auth->acl_get('f_announce_global', $forum_id),
'U_VIEW_FORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id),
'U_VIEW_FORUM_LOGS' => ($auth->acl_gets('a_', 'm_', $forum_id) && $module->loaded('logs')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=logs&amp;mode=forum_logs&amp;f=' . $forum_id) : '',
@@ -172,6 +174,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
$read_tracking_join = $read_tracking_select = '';
}
+ /* @var $phpbb_content_visibility \phpbb\content_visibility */
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
$sql = 'SELECT t.topic_id
@@ -352,7 +355,7 @@ function mcp_forum_view($id, $mode, $action, $forum_info)
*/
function mcp_resync_topics($topic_ids)
{
- global $auth, $db, $template, $phpEx, $user, $phpbb_root_path;
+ global $auth, $db, $template, $phpEx, $user, $phpbb_root_path, $phpbb_log, $request;
if (!sizeof($topic_ids))
{
@@ -377,13 +380,17 @@ function mcp_resync_topics($topic_ids)
// Log this action
while ($row = $db->sql_fetchrow($result))
{
- add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_TOPIC_RESYNC', $row['topic_title']);
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_TOPIC_RESYNC', false, array(
+ 'forum_id' => $row['forum_id'],
+ 'topic_id' => $row['topic_id'],
+ $row['topic_title']
+ ));
}
$db->sql_freeresult($result);
$msg = (sizeof($topic_ids) == 1) ? $user->lang['TOPIC_RESYNC_SUCCESS'] : $user->lang['TOPICS_RESYNC_SUCCESS'];
- $redirect = request_var('redirect', $user->data['session_page']);
+ $redirect = $request->variable('redirect', $user->data['session_page']);
meta_refresh(3, $redirect);
trigger_error($msg . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $redirect . '">', '</a>'));
@@ -396,7 +403,7 @@ function mcp_resync_topics($topic_ids)
*/
function merge_topics($forum_id, $topic_ids, $to_topic_id)
{
- global $db, $template, $user, $phpEx, $phpbb_root_path, $auth;
+ global $db, $template, $user, $phpEx, $phpbb_root_path, $auth, $phpbb_log, $request;
if (!sizeof($topic_ids))
{
@@ -427,8 +434,8 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
$topic_data = $topic_data[$to_topic_id];
- $post_id_list = request_var('post_id_list', array(0));
- $start = request_var('start', 0);
+ $post_id_list = $request->variable('post_id_list', array(0));
+ $start = $request->variable('start', 0);
if (!sizeof($post_id_list) && sizeof($topic_ids))
{
@@ -456,7 +463,7 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
return;
}
- $redirect = request_var('redirect', build_url(array('quickmod')));
+ $redirect = $request->variable('redirect', build_url(array('quickmod')));
$s_hidden_fields = build_hidden_fields(array(
'i' => 'main',
@@ -476,7 +483,12 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
$to_forum_id = $topic_data['forum_id'];
move_posts($post_id_list, $to_topic_id, false);
- add_log('mod', $to_forum_id, $to_topic_id, 'LOG_MERGE', $topic_data['topic_title']);
+
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_MERGE', false, array(
+ 'forum_id' => $to_forum_id,
+ 'topic_id' => $to_topic_id,
+ $topic_data['topic_title']
+ ));
// Message and return links
$success_msg = 'POSTS_MERGED_SUCCESS';
@@ -500,7 +512,7 @@ function merge_topics($forum_id, $topic_ids, $to_topic_id)
// Link to the new topic
$return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
- $redirect = request_var('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&amp;t=$to_topic_id");
+ $redirect = $request->variable('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&amp;t=$to_topic_id");
$redirect = reapply_sid($redirect);
meta_refresh(3, $redirect);
diff --git a/phpBB/includes/mcp/mcp_front.php b/phpBB/includes/mcp/mcp_front.php
index 629b6fd275..0d03a37731 100644
--- a/phpBB/includes/mcp/mcp_front.php
+++ b/phpBB/includes/mcp/mcp_front.php
@@ -26,7 +26,7 @@ function mcp_front_view($id, $mode, $action)
{
global $phpEx, $phpbb_root_path, $config;
global $template, $db, $user, $auth, $module;
- global $phpbb_dispatcher;
+ global $phpbb_dispatcher, $request;
// Latest 5 unapproved
if ($module->loaded('queue'))
@@ -35,7 +35,7 @@ function mcp_front_view($id, $mode, $action)
$post_list = array();
$forum_names = array();
- $forum_id = request_var('f', 0);
+ $forum_id = $request->variable('f', 0);
$template->assign_var('S_SHOW_UNAPPROVED', (!empty($forum_list)) ? true : false);
diff --git a/phpBB/includes/mcp/mcp_logs.php b/phpBB/includes/mcp/mcp_logs.php
index 9c76f0df90..bf2d462801 100644
--- a/phpBB/includes/mcp/mcp_logs.php
+++ b/phpBB/includes/mcp/mcp_logs.php
@@ -35,12 +35,12 @@ class mcp_logs
function main($id, $mode)
{
- global $auth, $db, $user, $template;
+ global $auth, $db, $user, $template, $request;
global $config, $phpbb_root_path, $phpEx, $phpbb_container, $phpbb_log;
$user->add_lang('acp/common');
- $action = request_var('action', array('' => ''));
+ $action = $request->variable('action', array('' => ''));
if (is_array($action))
{
@@ -48,23 +48,24 @@ class mcp_logs
}
else
{
- $action = request_var('action', '');
+ $action = $request->variable('action', '');
}
// Set up general vars
- $start = request_var('start', 0);
+ $start = $request->variable('start', 0);
$deletemark = ($action == 'del_marked') ? true : false;
$deleteall = ($action == 'del_all') ? true : false;
- $marked = request_var('mark', array(0));
+ $marked = $request->variable('mark', array(0));
// Sort keys
- $sort_days = request_var('st', 0);
- $sort_key = request_var('sk', 't');
- $sort_dir = request_var('sd', 'd');
+ $sort_days = $request->variable('st', 0);
+ $sort_key = $request->variable('sk', 't');
+ $sort_dir = $request->variable('sd', 'd');
$this->tpl_name = 'mcp_logs';
$this->page_title = 'MCP_LOGS';
+ /* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
$forum_list = array_values(array_intersect(get_forum_list('f_read'), get_forum_list('m_')));
@@ -78,7 +79,7 @@ class mcp_logs
break;
case 'forum_logs':
- $forum_id = request_var('f', 0);
+ $forum_id = $request->variable('f', 0);
if (!in_array($forum_id, $forum_list))
{
@@ -89,7 +90,7 @@ class mcp_logs
break;
case 'topic_logs':
- $topic_id = request_var('t', 0);
+ $topic_id = $request->variable('t', 0);
$sql = 'SELECT forum_id
FROM ' . TOPICS_TABLE . '
@@ -123,7 +124,7 @@ class mcp_logs
}
else if ($deleteall)
{
- $keywords = utf8_normalize_nfc(request_var('keywords', '', true));
+ $keywords = $request->variable('keywords', '', true);
$conditions = array(
'forum_id' => array('IN' => $forum_list),
@@ -157,7 +158,7 @@ class mcp_logs
'sd' => $sort_dir,
'i' => $id,
'mode' => $mode,
- 'action' => request_var('action', array('' => ''))))
+ 'action' => $request->variable('action', array('' => ''))))
);
}
}
@@ -174,7 +175,7 @@ class mcp_logs
$sql_where = ($sort_days) ? (time() - ($sort_days * 86400)) : 0;
$sql_sort = $sort_by_sql[$sort_key] . ' ' . (($sort_dir == 'd') ? 'DESC' : 'ASC');
- $keywords = utf8_normalize_nfc(request_var('keywords', '', true));
+ $keywords = $request->variable('keywords', '', true);
$keywords_param = !empty($keywords) ? '&amp;keywords=' . urlencode(htmlspecialchars_decode($keywords)) : '';
// Grab log data
@@ -204,7 +205,7 @@ class mcp_logs
{
$data = array();
- $checks = array('viewtopic', 'viewforum');
+ $checks = array('viewpost', 'viewtopic', 'viewforum');
foreach ($checks as $check)
{
if (isset($row[$check]) && $row[$check])
diff --git a/phpBB/includes/mcp/mcp_main.php b/phpBB/includes/mcp/mcp_main.php
index fc28968101..b0579d8995 100644
--- a/phpBB/includes/mcp/mcp_main.php
+++ b/phpBB/includes/mcp/mcp_main.php
@@ -45,7 +45,7 @@ class mcp_main
{
case 'lock':
case 'unlock':
- $topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0));
+ $topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0));
if (!sizeof($topic_ids))
{
@@ -58,7 +58,7 @@ class mcp_main
case 'lock_post':
case 'unlock_post':
- $post_ids = (!$quickmod) ? request_var('post_id_list', array(0)) : array(request_var('p', 0));
+ $post_ids = (!$quickmod) ? $request->variable('post_id_list', array(0)) : array($request->variable('p', 0));
if (!sizeof($post_ids))
{
@@ -73,7 +73,7 @@ class mcp_main
case 'make_global':
case 'make_normal':
- $topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0));
+ $topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0));
if (!sizeof($topic_ids))
{
@@ -86,7 +86,7 @@ class mcp_main
case 'move':
$user->add_lang('viewtopic');
- $topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0));
+ $topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0));
if (!sizeof($topic_ids))
{
@@ -99,7 +99,7 @@ class mcp_main
case 'fork':
$user->add_lang('viewtopic');
- $topic_ids = (!$quickmod) ? request_var('topic_id_list', array(0)) : array(request_var('t', 0));
+ $topic_ids = (!$quickmod) ? $request->variable('topic_id_list', array(0)) : array($request->variable('t', 0));
if (!sizeof($topic_ids))
{
@@ -189,7 +189,7 @@ class mcp_main
$user->add_lang('viewforum');
- $forum_id = request_var('f', 0);
+ $forum_id = $request->variable('f', 0);
$forum_info = phpbb_get_forum_data($forum_id, 'm_', true);
@@ -262,7 +262,7 @@ class mcp_main
*/
function lock_unlock($action, $ids)
{
- global $auth, $user, $db, $phpEx, $phpbb_root_path, $request;
+ global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_log;
if ($action == 'lock' || $action == 'unlock')
{
@@ -298,7 +298,7 @@ function lock_unlock($action, $ids)
}
unset($orig_ids);
- $redirect = request_var('redirect', build_url(array('action', 'quickmod')));
+ $redirect = $request->variable('redirect', build_url(array('action', 'quickmod')));
$redirect = reapply_sid($redirect);
$s_hidden_fields = build_hidden_fields(array(
@@ -319,7 +319,12 @@ function lock_unlock($action, $ids)
foreach ($data as $id => $row)
{
- add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_' . strtoupper($action), $row['topic_title']);
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_' . strtoupper($action), false, array(
+ 'forum_id' => $row['forum_id'],
+ 'topic_id' => $row['topic_id'],
+ 'post_id' => isset($row['post_id']) ? $row['post_id'] : 0,
+ $row['topic_title']
+ ));
}
$success_msg = $l_prefix . ((sizeof($ids) == 1) ? '' : 'S') . '_' . (($action == 'lock' || $action == 'lock_post') ? 'LOCKED' : 'UNLOCKED') . '_SUCCESS';
@@ -346,7 +351,7 @@ function lock_unlock($action, $ids)
*/
function change_topic_type($action, $topic_ids)
{
- global $auth, $user, $db, $phpEx, $phpbb_root_path, $request;
+ global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_log;
switch ($action)
{
@@ -358,7 +363,7 @@ function change_topic_type($action, $topic_ids)
case 'make_global':
$new_topic_type = POST_GLOBAL;
- $check_acl = 'f_announce';
+ $check_acl = 'f_announce_global';
$l_new_type = (sizeof($topic_ids) == 1) ? 'MCP_MAKE_GLOBAL' : 'MCP_MAKE_GLOBALS';
break;
@@ -382,7 +387,7 @@ function change_topic_type($action, $topic_ids)
return;
}
- $redirect = request_var('redirect', build_url(array('action', 'quickmod')));
+ $redirect = $request->variable('redirect', build_url(array('action', 'quickmod')));
$redirect = reapply_sid($redirect);
$s_hidden_fields = array(
@@ -421,7 +426,11 @@ function change_topic_type($action, $topic_ids)
foreach ($data as $topic_id => $row)
{
- add_log('mod', $forum_id, $topic_id, 'LOG_TOPIC_TYPE_CHANGED', $row['topic_title']);
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_TOPIC_TYPE_CHANGED', false, array(
+ 'forum_id' => $forum_id,
+ 'topic_id' => $topic_id,
+ $row['topic_title']
+ ));
}
}
@@ -458,8 +467,8 @@ function mcp_move_topic($topic_ids)
return;
}
- $to_forum_id = request_var('to_forum_id', 0);
- $redirect = request_var('redirect', build_url(array('action', 'quickmod')));
+ $to_forum_id = $request->variable('to_forum_id', 0);
+ $redirect = $request->variable('redirect', build_url(array('action', 'quickmod')));
$additional_msg = $success_msg = '';
$s_hidden_fields = build_hidden_fields(array(
@@ -679,7 +688,7 @@ function mcp_move_topic($topic_ids)
confirm_box(false, 'MOVE_TOPIC' . ((sizeof($topic_ids) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_move.html');
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = $request->variable('redirect', "index.$phpEx");
$redirect = reapply_sid($redirect);
if (!$success_msg)
@@ -704,7 +713,7 @@ function mcp_move_topic($topic_ids)
*/
function mcp_restore_topic($topic_ids)
{
- global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container;
+ global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container, $phpbb_log;
if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_approve')))
{
@@ -728,13 +737,19 @@ function mcp_restore_topic($topic_ids)
$data = phpbb_get_topic_data($topic_ids);
+ /* @var $phpbb_content_visibility \phpbb\content_visibility */
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
foreach ($data as $topic_id => $row)
{
$return = $phpbb_content_visibility->set_topic_visibility(ITEM_APPROVED, $topic_id, $row['forum_id'], $user->data['user_id'], time(), '');
if (!empty($return))
{
- add_log('mod', $row['forum_id'], $topic_id, 'LOG_RESTORE_TOPIC', $row['topic_title'], $row['topic_first_poster_name']);
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_RESTORE_TOPIC', false, array(
+ 'forum_id' => $row['forum_id'],
+ 'topic_id' => $topic_id,
+ $row['topic_title'],
+ $row['topic_first_poster_name']
+ ));
}
}
}
@@ -777,7 +792,7 @@ function mcp_restore_topic($topic_ids)
*/
function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = '', $action = 'delete_topic')
{
- global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container;
+ global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container, $phpbb_log;
$check_permission = ($is_soft) ? 'm_softdelete' : 'm_delete';
if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array($check_permission)))
@@ -806,23 +821,40 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = ''
{
if ($row['topic_moved_id'])
{
- add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_SHADOW_TOPIC', $row['topic_title']);
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_DELETE_SHADOW_TOPIC', false, array(
+ 'forum_id' => $row['forum_id'],
+ 'topic_id' => $topic_id,
+ $row['topic_title']
+ ));
}
else
{
// Only soft delete non-shadow topics
if ($is_soft)
{
+ /* @var $phpbb_content_visibility \phpbb\content_visibility */
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
$return = $phpbb_content_visibility->set_topic_visibility(ITEM_DELETED, $topic_id, $row['forum_id'], $user->data['user_id'], time(), $soft_delete_reason);
if (!empty($return))
{
- add_log('mod', $row['forum_id'], $topic_id, 'LOG_SOFTDELETE_TOPIC', $row['topic_title'], $row['topic_first_poster_name'], $soft_delete_reason);
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_SOFTDELETE_TOPIC', false, array(
+ 'forum_id' => $row['forum_id'],
+ 'topic_id' => $topic_id,
+ $row['topic_title'],
+ $row['topic_first_poster_name'],
+ $soft_delete_reason
+ ));
}
}
else
{
- add_log('mod', $row['forum_id'], $topic_id, 'LOG_DELETE_TOPIC', $row['topic_title'], $row['topic_first_poster_name'], $soft_delete_reason);
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_DELETE_TOPIC', false, array(
+ 'forum_id' => $row['forum_id'],
+ 'topic_id' => $topic_id,
+ $row['topic_title'],
+ $row['topic_first_poster_name'],
+ $soft_delete_reason
+ ));
}
}
}
@@ -916,7 +948,7 @@ function mcp_delete_topic($topic_ids, $is_soft = false, $soft_delete_reason = ''
*/
function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '', $action = 'delete_post')
{
- global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container;
+ global $auth, $user, $db, $phpEx, $phpbb_root_path, $request, $phpbb_container, $phpbb_log;
$check_permission = ($is_soft) ? 'm_softdelete' : 'm_delete';
if (!phpbb_check_ids($post_ids, POSTS_TABLE, 'post_id', array($check_permission)))
@@ -973,6 +1005,7 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',
);
}
+ /* @var $phpbb_content_visibility \phpbb\content_visibility */
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
foreach ($topic_info as $topic_id => $topic_data)
{
@@ -987,7 +1020,14 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',
foreach ($approve_log as $row)
{
$post_username = ($row['poster_id'] == ANONYMOUS && !empty($row['post_username'])) ? $row['post_username'] : $row['username'];
- add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_SOFTDELETE_POST', $row['post_subject'], $post_username, $soft_delete_reason);
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_SOFTDELETE_POST', false, array(
+ 'forum_id' => $row['forum_id'],
+ 'topic_id' => $row['topic_id'],
+ 'post_id' => $row['post_id'],
+ $row['post_subject'],
+ $post_username,
+ $soft_delete_reason
+ ));
}
$topic_id = $request->variable('t', 0);
@@ -1030,7 +1070,14 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',
foreach ($post_data as $id => $row)
{
$post_username = ($row['poster_id'] == ANONYMOUS && !empty($row['post_username'])) ? $row['post_username'] : $row['username'];
- add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_DELETE_POST', $row['post_subject'], $post_username, $soft_delete_reason);
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_DELETE_POST', false, array(
+ 'forum_id' => $row['forum_id'],
+ 'topic_id' => $row['topic_id'],
+ 'post_id' => $row['post_id'],
+ $row['post_subject'],
+ $post_username,
+ $soft_delete_reason
+ ));
}
// Now delete the posts, topics and forums are automatically resync'ed
@@ -1144,16 +1191,16 @@ function mcp_delete_post($post_ids, $is_soft = false, $soft_delete_reason = '',
function mcp_fork_topic($topic_ids)
{
global $auth, $user, $db, $template, $config;
- global $phpEx, $phpbb_root_path, $phpbb_dispatcher;
+ global $phpEx, $phpbb_root_path, $phpbb_log, $request, $phpbb_dispatcher;
if (!phpbb_check_ids($topic_ids, TOPICS_TABLE, 'topic_id', array('m_')))
{
return;
}
- $to_forum_id = request_var('to_forum_id', 0);
- $forum_id = request_var('f', 0);
- $redirect = request_var('redirect', build_url(array('action', 'quickmod')));
+ $to_forum_id = $request->variable('to_forum_id', 0);
+ $forum_id = $request->variable('f', 0);
+ $redirect = $request->variable('redirect', build_url(array('action', 'quickmod')));
$additional_msg = $success_msg = '';
$counter = array();
@@ -1497,12 +1544,16 @@ function mcp_fork_topic($topic_ids)
sync('topic', 'topic_id', $new_topic_id_list);
sync('forum', 'forum_id', $to_forum_id);
- set_config_count('num_topics', sizeof($new_topic_id_list), true);
- set_config_count('num_posts', $total_posts, true);
+ $config->increment('num_topics', sizeof($new_topic_id_list), false);
+ $config->increment('num_posts', $total_posts, false);
foreach ($new_topic_id_list as $topic_id => $new_topic_id)
{
- add_log('mod', $to_forum_id, $new_topic_id, 'LOG_FORK', $topic_row['forum_name']);
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_FORK', false, array(
+ 'forum_id' => $to_forum_id,
+ 'topic_id' => $new_topic_id,
+ $topic_row['forum_name']
+ ));
}
$success_msg = (sizeof($topic_ids) == 1) ? 'TOPIC_FORKED_SUCCESS' : 'TOPICS_FORKED_SUCCESS';
@@ -1518,7 +1569,7 @@ function mcp_fork_topic($topic_ids)
confirm_box(false, 'FORK_TOPIC' . ((sizeof($topic_ids) == 1) ? '' : 'S'), $s_hidden_fields, 'mcp_move.html');
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = $request->variable('redirect', "index.$phpEx");
$redirect = reapply_sid($redirect);
if (!$success_msg)
diff --git a/phpBB/includes/mcp/mcp_notes.php b/phpBB/includes/mcp/mcp_notes.php
index 465ee63a98..502d4cb1e7 100644
--- a/phpBB/includes/mcp/mcp_notes.php
+++ b/phpBB/includes/mcp/mcp_notes.php
@@ -35,10 +35,10 @@ class mcp_notes
function main($id, $mode)
{
- global $auth, $db, $user, $template;
+ global $auth, $db, $user, $template, $request;
global $config, $phpbb_root_path, $phpEx;
- $action = request_var('action', array('' => ''));
+ $action = $request->variable('action', array('' => ''));
if (is_array($action))
{
@@ -74,15 +74,17 @@ class mcp_notes
*/
function mcp_notes_user_view($action)
{
- global $phpEx, $phpbb_root_path, $config;
+ global $phpEx, $phpbb_root_path, $config, $phpbb_log, $request;
global $template, $db, $user, $auth, $phpbb_container;
- $user_id = request_var('u', 0);
- $username = request_var('username', '', true);
- $start = request_var('start', 0);
- $st = request_var('st', 0);
- $sk = request_var('sk', 'b');
- $sd = request_var('sd', 'd');
+ $user_id = $request->variable('u', 0);
+ $username = $request->variable('username', '', true);
+ $start = $request->variable('start', 0);
+ $st = $request->variable('st', 0);
+ $sk = $request->variable('sk', 'b');
+ $sd = $request->variable('sd', 'd');
+
+ /* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
add_form_key('mcp_notes');
@@ -114,8 +116,8 @@ class mcp_notes
$deletemark = ($action == 'del_marked') ? true : false;
$deleteall = ($action == 'del_all') ? true : false;
- $marked = request_var('marknote', array(0));
- $usernote = utf8_normalize_nfc(request_var('usernote', '', true));
+ $marked = $request->variable('marknote', array(0));
+ $usernote = $request->variable('usernote', '', true);
// Handle any actions
if (($deletemark || $deleteall) && $auth->acl_get('a_clearlogs'))
@@ -142,7 +144,7 @@ class mcp_notes
$where_sql";
$db->sql_query($sql);
- add_log('admin', 'LOG_CLEAR_USER', $userrow['username']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_CLEAR_USER', false, array($userrow['username']));
$msg = ($deletemark) ? 'MARKED_NOTES_DELETED' : 'ALL_NOTES_DELETED';
}
@@ -160,10 +162,17 @@ class mcp_notes
{
if (check_form_key('mcp_notes'))
{
- add_log('admin', 'LOG_USER_FEEDBACK', $userrow['username']);
- add_log('mod', 0, 0, 'LOG_USER_FEEDBACK', $userrow['username']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_FEEDBACK', false, array($userrow['username']));
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_USER_FEEDBACK', false, array(
+ 'forum_id' => 0,
+ 'topic_id' => 0,
+ $userrow['username']
+ ));
+ $phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_GENERAL', false, array(
+ 'reportee_id' => $user_id,
+ $usernote
+ ));
- add_log('user', $user_id, 'LOG_USER_GENERAL', $usernote);
$msg = $user->lang['USER_FEEDBACK_ADDED'];
}
else
@@ -192,7 +201,7 @@ class mcp_notes
$sql_where = ($st) ? (time() - ($st * 86400)) : 0;
$sql_sort = $sort_by_sql[$sk] . ' ' . (($sd == 'd') ? 'DESC' : 'ASC');
- $keywords = utf8_normalize_nfc(request_var('keywords', '', true));
+ $keywords = $request->variable('keywords', '', true);
$keywords_param = !empty($keywords) ? '&amp;keywords=' . urlencode(htmlspecialchars_decode($keywords)) : '';
$log_data = array();
diff --git a/phpBB/includes/mcp/mcp_pm_reports.php b/phpBB/includes/mcp/mcp_pm_reports.php
index d76bedba98..6e1d594135 100644
--- a/phpBB/includes/mcp/mcp_pm_reports.php
+++ b/phpBB/includes/mcp/mcp_pm_reports.php
@@ -35,14 +35,15 @@ class mcp_pm_reports
function main($id, $mode)
{
- global $auth, $db, $user, $template, $cache;
+ global $auth, $db, $user, $template, $cache, $request;
global $config, $phpbb_root_path, $phpEx, $action, $phpbb_container;
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
include_once($phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx);
- $start = request_var('start', 0);
+ /* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
+ $start = $request->variable('start', 0);
$this->page_title = 'MCP_PM_REPORTS';
@@ -52,7 +53,7 @@ class mcp_pm_reports
case 'delete':
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
- $report_id_list = request_var('report_id_list', array(0));
+ $report_id_list = $request->variable('report_id_list', array(0));
if (!sizeof($report_id_list))
{
@@ -75,7 +76,7 @@ class mcp_pm_reports
$user->add_lang(array('posting', 'viewforum', 'viewtopic', 'ucp'));
- $report_id = request_var('r', 0);
+ $report_id = $request->variable('r', 0);
$sql = 'SELECT r.pm_id, r.user_id, r.report_id, r.report_closed, report_time, r.report_text, rr.reason_title, rr.reason_description, u.username, u.username_clean, u.user_colour
FROM ' . REPORTS_TABLE . ' r, ' . REPORTS_REASONS_TABLE . ' rr, ' . USERS_TABLE . ' u
@@ -93,9 +94,10 @@ class mcp_pm_reports
trigger_error('NO_REPORT');
}
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
- $phpbb_notifications->mark_notifications_read_by_parent('notification.type.report_pm', $report_id, $user->data['user_id']);
+ $phpbb_notifications->mark_notifications_by_parent('report_pm', $report_id, $user->data['user_id']);
$pm_id = $report['pm_id'];
$report_id = $report['report_id'];
@@ -199,7 +201,7 @@ class mcp_pm_reports
'POST_SUBJECT' => ($pm_info['message_subject']) ? $pm_info['message_subject'] : $user->lang['NO_SUBJECT'],
'POST_DATE' => $user->format_date($pm_info['message_time']),
'POST_IP' => $pm_info['author_ip'],
- 'POST_IPADDR' => ($auth->acl_getf_global('m_info') && request_var('lookup', '')) ? @gethostbyaddr($pm_info['author_ip']) : '',
+ 'POST_IPADDR' => ($auth->acl_getf_global('m_info') && $request->variable('lookup', '')) ? @gethostbyaddr($pm_info['author_ip']) : '',
'POST_ID' => $pm_info['msg_id'],
'U_LOOKUP_IP' => ($auth->acl_getf_global('m_info')) ? $this->u_action . '&amp;r=' . $report_id . '&amp;pm=' . $pm_id . '&amp;lookup=' . $pm_info['author_ip'] . '#ip' : '',
diff --git a/phpBB/includes/mcp/mcp_post.php b/phpBB/includes/mcp/mcp_post.php
index 7a93f73228..e59f0abb04 100644
--- a/phpBB/includes/mcp/mcp_post.php
+++ b/phpBB/includes/mcp/mcp_post.php
@@ -24,14 +24,14 @@ if (!defined('IN_PHPBB'))
*/
function mcp_post_details($id, $mode, $action)
{
- global $phpEx, $phpbb_root_path, $config;
+ global $phpEx, $phpbb_root_path, $config, $request;
global $template, $db, $user, $auth, $cache;
global $phpbb_dispatcher;
$user->add_lang('posting');
- $post_id = request_var('p', 0);
- $start = request_var('start', 0);
+ $post_id = $request->variable('p', 0);
+ $start = $request->variable('start', 0);
// Get post data
$post_info = phpbb_get_post_data(array($post_id), false, true);
@@ -52,7 +52,7 @@ function mcp_post_details($id, $mode, $action)
if ($auth->acl_get('m_info', $post_info['forum_id']))
{
- $ip = request_var('ip', '');
+ $ip = $request->variable('ip', '');
include($phpbb_root_path . 'includes/functions_user.' . $phpEx);
$template->assign_vars(array(
@@ -73,12 +73,12 @@ function mcp_post_details($id, $mode, $action)
if ($action == 'chgposter')
{
- $username = request_var('username', '', true);
+ $username = $request->variable('username', '', true);
$sql_where = "username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
}
else
{
- $new_user_id = request_var('u', 0);
+ $new_user_id = $request->variable('u', 0);
$sql_where = 'user_id = ' . $new_user_id;
}
@@ -260,7 +260,7 @@ function mcp_post_details($id, $mode, $action)
'POST_SUBJECT' => $post_info['post_subject'],
'POST_DATE' => $user->format_date($post_info['post_time']),
'POST_IP' => $post_info['poster_ip'],
- 'POST_IPADDR' => ($auth->acl_get('m_info', $post_info['forum_id']) && request_var('lookup', '')) ? @gethostbyaddr($post_info['poster_ip']) : '',
+ 'POST_IPADDR' => ($auth->acl_get('m_info', $post_info['forum_id']) && $request->variable('lookup', '')) ? @gethostbyaddr($post_info['poster_ip']) : '',
'POST_ID' => $post_info['post_id'],
'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? "$url&amp;i=$id&amp;mode=$mode&amp;lookup={$post_info['poster_ip']}#ip" : '',
@@ -355,7 +355,7 @@ function mcp_post_details($id, $mode, $action)
// Get IP
if ($auth->acl_get('m_info', $post_info['forum_id']))
{
- $rdns_ip_num = request_var('rdns', '');
+ $rdns_ip_num = $request->variable('rdns', '');
if ($rdns_ip_num != 'all')
{
@@ -461,7 +461,7 @@ function mcp_post_details($id, $mode, $action)
*/
function change_poster(&$post_info, $userdata)
{
- global $auth, $db, $config, $phpbb_root_path, $phpEx, $user, $phpbb_dispatcher;
+ global $auth, $db, $config, $phpbb_root_path, $phpEx, $user, $phpbb_log, $phpbb_dispatcher;
if (empty($userdata) || $userdata['user_id'] == $post_info['user_id'])
{
@@ -571,5 +571,12 @@ function change_poster(&$post_info, $userdata)
extract($phpbb_dispatcher->trigger_event('core.mcp_change_poster_after', compact($vars)));
// Now add log entry
- add_log('mod', $post_info['forum_id'], $post_info['topic_id'], 'LOG_MCP_CHANGE_POSTER', $post_info['topic_title'], $from_username, $to_username);
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_MCP_CHANGE_POSTER', false, array(
+ 'forum_id' => $post_info['forum_id'],
+ 'topic_id' => $post_info['topic_id'],
+ 'post_id' => $post_info['post_id'],
+ $post_info['topic_title'],
+ $from_username,
+ $to_username
+ ));
}
diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php
index 5fde63ecb4..ac82c9f2ad 100644
--- a/phpBB/includes/mcp/mcp_queue.php
+++ b/phpBB/includes/mcp/mcp_queue.php
@@ -41,8 +41,8 @@ class mcp_queue
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
- $forum_id = request_var('f', 0);
- $start = request_var('start', 0);
+ $forum_id = $request->variable('f', 0);
+ $start = $request->variable('start', 0);
$this->page_title = 'MCP_QUEUE';
@@ -153,9 +153,10 @@ class mcp_queue
$user->add_lang(array('posting', 'viewtopic'));
- $post_id = request_var('p', 0);
- $topic_id = request_var('t', 0);
+ $post_id = $request->variable('p', 0);
+ $topic_id = $request->variable('t', 0);
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
if ($topic_id)
@@ -165,7 +166,7 @@ class mcp_queue
{
$post_id = (int) $topic_info[$topic_id]['topic_first_post_id'];
- $phpbb_notifications->mark_notifications_read('notification.type.topic_in_queue', $topic_id, $user->data['user_id']);
+ $phpbb_notifications->mark_notifications('topic_in_queue', $topic_id, $user->data['user_id']);
}
else
{
@@ -173,7 +174,7 @@ class mcp_queue
}
}
- $phpbb_notifications->mark_notifications_read('notification.type.post_in_queue', $post_id, $user->data['user_id']);
+ $phpbb_notifications->mark_notifications('post_in_queue', $post_id, $user->data['user_id']);
$post_info = phpbb_get_post_data(array($post_id), 'm_approve', true);
@@ -318,7 +319,7 @@ class mcp_queue
'POST_SUBJECT' => $post_info['post_subject'],
'POST_DATE' => $user->format_date($post_info['post_time']),
'POST_IP' => $post_info['poster_ip'],
- 'POST_IPADDR' => ($auth->acl_get('m_info', $post_info['forum_id']) && request_var('lookup', '')) ? @gethostbyaddr($post_info['poster_ip']) : '',
+ 'POST_IPADDR' => ($auth->acl_get('m_info', $post_info['forum_id']) && $request->variable('lookup', '')) ? @gethostbyaddr($post_info['poster_ip']) : '',
'POST_ID' => $post_info['post_id'],
'S_FIRST_POST' => ($post_info['topic_first_post_id'] == $post_id),
@@ -340,6 +341,8 @@ class mcp_queue
$topic_id = $request->variable('t', 0);
$forum_info = array();
+
+ /* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
if ($topic_id)
@@ -617,7 +620,7 @@ class mcp_queue
static public function approve_posts($action, $post_id_list, $id, $mode)
{
global $db, $template, $user, $config, $request, $phpbb_container, $phpbb_dispatcher;
- global $phpEx, $phpbb_root_path;
+ global $phpEx, $phpbb_root_path, $phpbb_log;
if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))
{
@@ -675,10 +678,12 @@ class mcp_queue
$approve_log[] = array(
'forum_id' => $post_data['forum_id'],
'topic_id' => $post_data['topic_id'],
+ 'post_id' => $post_id,
'post_subject' => $post_data['post_subject'],
);
}
+ /* @var $phpbb_content_visibility \phpbb\content_visibility */
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
foreach ($topic_info as $topic_id => $topic_data)
{
@@ -687,12 +692,18 @@ class mcp_queue
foreach ($approve_log as $log_data)
{
- add_log('mod', $log_data['forum_id'], $log_data['topic_id'], 'LOG_POST_' . strtoupper($action) . 'D', $log_data['post_subject']);
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_POST_' . strtoupper($action) . 'D', false, array(
+ 'forum_id' => $log_data['forum_id'],
+ 'topic_id' => $log_data['topic_id'],
+ 'post_id' => $log_data['post_id'],
+ $log_data['post_subject']
+ ));
}
// Only send out the mails, when the posts are being approved
if ($action == 'approve')
{
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
// Handle notifications
@@ -729,7 +740,7 @@ class mcp_queue
$phpbb_notifications->add_notifications(array('notification.type.quote'), $post_data);
$phpbb_notifications->delete_notifications('notification.type.post_in_queue', $post_id);
- $phpbb_notifications->mark_notifications_read(array(
+ $phpbb_notifications->mark_notifications(array(
'notification.type.quote',
'notification.type.bookmark',
'notification.type.post',
@@ -863,7 +874,7 @@ class mcp_queue
*/
static public function approve_topics($action, $topic_id_list, $id, $mode)
{
- global $db, $template, $user, $config;
+ global $db, $template, $user, $config, $phpbb_log;
global $phpEx, $phpbb_root_path, $request, $phpbb_container, $phpbb_dispatcher;
if (!phpbb_check_ids($topic_id_list, TOPICS_TABLE, 'topic_id', array('m_approve')))
@@ -890,6 +901,7 @@ class mcp_queue
{
$notify_poster = ($action == 'approve' && isset($_REQUEST['notify_poster'])) ? true : false;
+ /* @var $phpbb_content_visibility \phpbb\content_visibility */
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
$first_post_ids = array();
@@ -914,7 +926,11 @@ class mcp_queue
foreach ($approve_log as $log_data)
{
- add_log('mod', $log_data['forum_id'], $log_data['topic_id'], 'LOG_TOPIC_' . strtoupper($action) . 'D', $log_data['topic_title']);
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_TOPIC_' . strtoupper($action) . 'D', false, array(
+ 'forum_id' => $log_data['forum_id'],
+ 'topic_id' => $log_data['topic_id'],
+ $log_data['topic_title']
+ ));
}
// Only send out the mails, when the posts are being approved
@@ -933,6 +949,7 @@ class mcp_queue
$db->sql_freeresult($result);
// Handle notifications
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
foreach ($topic_info as $topic_id => $topic_data)
@@ -959,8 +976,8 @@ class mcp_queue
), $topic_data);
}
- $phpbb_notifications->mark_notifications_read('notification.type.quote', $topic_data['post_id'], $user->data['user_id']);
- $phpbb_notifications->mark_notifications_read('notification.type.topic', $topic_id, $user->data['user_id']);
+ $phpbb_notifications->mark_notifications('quote', $topic_data['post_id'], $user->data['user_id']);
+ $phpbb_notifications->mark_notifications('topic', $topic_id, $user->data['user_id']);
if ($notify_poster)
{
@@ -1055,7 +1072,7 @@ class mcp_queue
static public function disapprove_posts($post_id_list, $id, $mode)
{
global $db, $template, $user, $config, $phpbb_container, $phpbb_dispatcher;
- global $phpEx, $phpbb_root_path, $request;
+ global $phpEx, $phpbb_root_path, $request, $phpbb_log;
if (!phpbb_check_ids($post_id_list, POSTS_TABLE, 'post_id', array('m_approve')))
{
@@ -1204,16 +1221,28 @@ class mcp_queue
if ($is_disapproving)
{
$l_log_message = ($log_data['type'] == 'topic') ? 'LOG_TOPIC_DISAPPROVED' : 'LOG_POST_DISAPPROVED';
- add_log('mod', $log_data['forum_id'], $log_data['topic_id'], $l_log_message, $log_data['post_subject'], $disapprove_reason, $log_data['post_username']);
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, $l_log_message, false, array(
+ 'forum_id' => $log_data['forum_id'],
+ 'topic_id' => $log_data['topic_id'],
+ $log_data['post_subject'],
+ $disapprove_reason,
+ $log_data['post_username']
+ ));
}
else
{
$l_log_message = ($log_data['type'] == 'topic') ? 'LOG_DELETE_TOPIC' : 'LOG_DELETE_POST';
- add_log('mod', $log_data['forum_id'], $log_data['topic_id'], $l_log_message, $log_data['post_subject'], $log_data['post_username']);
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, $l_log_message, false, array(
+ 'forum_id' => $log_data['forum_id'],
+ 'topic_id' => $log_data['topic_id'],
+ $log_data['post_subject'],
+ $log_data['post_username']
+ ));
}
}
}
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
$lang_reasons = array();
@@ -1375,11 +1404,6 @@ class mcp_queue
}
else
{
- if (!function_exists('display_reasons'))
- {
- include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
- }
-
$show_notify = false;
foreach ($post_info as $post_data)
@@ -1399,7 +1423,7 @@ class mcp_queue
$confirm_template = 'mcp_approve.html';
if ($is_disapproving)
{
- display_reasons($reason_id);
+ $phpbb_container->get('phpbb.report.report_reason_list_provider')->display_reasons($reason_id);
}
else
{
diff --git a/phpBB/includes/mcp/mcp_reports.php b/phpBB/includes/mcp/mcp_reports.php
index fa2fed842f..45265c89e7 100644
--- a/phpBB/includes/mcp/mcp_reports.php
+++ b/phpBB/includes/mcp/mcp_reports.php
@@ -35,13 +35,13 @@ class mcp_reports
function main($id, $mode)
{
- global $auth, $db, $user, $template, $cache;
+ global $auth, $db, $user, $template, $cache, $request;
global $config, $phpbb_root_path, $phpEx, $action, $phpbb_container, $phpbb_dispatcher;
include_once($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
- $forum_id = request_var('f', 0);
- $start = request_var('start', 0);
+ $forum_id = $request->variable('f', 0);
+ $start = $request->variable('start', 0);
$this->page_title = 'MCP_REPORTS';
@@ -51,7 +51,7 @@ class mcp_reports
case 'delete':
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
- $report_id_list = request_var('report_id_list', array(0));
+ $report_id_list = $request->variable('report_id_list', array(0));
if (!sizeof($report_id_list))
{
@@ -69,10 +69,11 @@ class mcp_reports
$user->add_lang(array('posting', 'viewforum', 'viewtopic'));
- $post_id = request_var('p', 0);
+ $post_id = $request->variable('p', 0);
// closed reports are accessed by report id
- $report_id = request_var('r', 0);
+ $report_id = $request->variable('r', 0);
+
$sql_ary = array(
'SELECT' => 'r.post_id, r.user_id, r.report_id, r.report_closed, report_time, r.report_text, r.reported_post_text, r.reported_post_uid, r.reported_post_bitfield, r.reported_post_enable_magic_url, r.reported_post_enable_smilies, r.reported_post_enable_bbcode, rr.reason_title, rr.reason_description, u.username, u.username_clean, u.user_colour',
@@ -138,9 +139,10 @@ class mcp_reports
trigger_error('NO_REPORT');
}
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
- $phpbb_notifications->mark_notifications_read('notification.type.report_post', $post_id, $user->data['user_id']);
+ $phpbb_notifications->mark_notifications('report_post', $post_id, $user->data['user_id']);
if (!$report_id && $report['report_closed'])
{
@@ -287,7 +289,7 @@ class mcp_reports
'POST_SUBJECT' => ($post_info['post_subject']) ? $post_info['post_subject'] : $user->lang['NO_SUBJECT'],
'POST_DATE' => $user->format_date($post_info['post_time']),
'POST_IP' => $post_info['poster_ip'],
- 'POST_IPADDR' => ($auth->acl_get('m_info', $post_info['forum_id']) && request_var('lookup', '')) ? @gethostbyaddr($post_info['poster_ip']) : '',
+ 'POST_IPADDR' => ($auth->acl_get('m_info', $post_info['forum_id']) && $request->variable('lookup', '')) ? @gethostbyaddr($post_info['poster_ip']) : '',
'POST_ID' => $post_info['post_id'],
'U_LOOKUP_IP' => ($auth->acl_get('m_info', $post_info['forum_id'])) ? $this->u_action . '&amp;r=' . $report_id . '&amp;p=' . $post_id . '&amp;f=' . $forum_id . '&amp;lookup=' . $post_info['poster_ip'] . '#ip' : '',
@@ -299,7 +301,7 @@ class mcp_reports
case 'reports':
case 'reports_closed':
- $topic_id = request_var('t', 0);
+ $topic_id = $request->variable('t', 0);
$forum_info = array();
$forum_list_reports = get_forum_list('m_report', false, true);
@@ -371,9 +373,10 @@ class mcp_reports
$forum_list = array($forum_id);
}
+ /* @var $pagination \phpbb\pagination */
+ $pagination = $phpbb_container->get('pagination');
$forum_list[] = 0;
$forum_data = array();
- $pagination = $phpbb_container->get('pagination');
$forum_options = '<option value="0"' . (($forum_id == 0) ? ' selected="selected"' : '') . '>' . $user->lang['ALL_FORUMS'] . '</option>';
foreach ($forum_list_reports as $row)
@@ -519,7 +522,7 @@ class mcp_reports
*/
function close_report($report_id_list, $mode, $action, $pm = false)
{
- global $db, $template, $user, $config, $auth;
+ global $db, $template, $user, $config, $auth, $phpbb_log, $request;
global $phpEx, $phpbb_root_path, $phpbb_container;
$pm_where = ($pm) ? ' AND r.post_id = 0 ' : ' AND r.pm_id = 0 ';
@@ -557,19 +560,19 @@ function close_report($report_id_list, $mode, $action, $pm = false)
if ($action == 'delete' && strpos($user->data['session_page'], 'mode=report_details') !== false)
{
- $redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&amp;mode=reports');
+ $redirect = $request->variable('redirect', build_url(array('mode', 'r', 'quickmod')) . '&amp;mode=reports');
}
else if ($action == 'delete' && strpos($user->data['session_page'], 'mode=pm_report_details') !== false)
{
- $redirect = request_var('redirect', build_url(array('mode', 'r', 'quickmod')) . '&amp;mode=pm_reports');
+ $redirect = $request->variable('redirect', build_url(array('mode', 'r', 'quickmod')) . '&amp;mode=pm_reports');
}
- else if ($action == 'close' && !request_var('r', 0))
+ else if ($action == 'close' && !$request->variable('r', 0))
{
- $redirect = request_var('redirect', build_url(array('mode', 'p', 'quickmod')) . '&amp;mode=' . $module);
+ $redirect = $request->variable('redirect', build_url(array('mode', 'p', 'quickmod')) . '&amp;mode=' . $module);
}
else
{
- $redirect = request_var('redirect', build_url(array('quickmod')));
+ $redirect = $request->variable('redirect', build_url(array('quickmod')));
}
$success_msg = '';
$forum_ids = array();
@@ -694,18 +697,28 @@ function close_report($report_id_list, $mode, $action, $pm = false)
}
unset($close_report_posts, $close_report_topics);
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
foreach ($reports as $report)
{
if ($pm)
{
- add_log('mod', 0, 0, 'LOG_PM_REPORT_' . strtoupper($action) . 'D', $post_info[$report['pm_id']]['message_subject']);
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_PM_REPORT_' . strtoupper($action) . 'D', false, array(
+ 'forum_id' => 0,
+ 'topic_id' => 0,
+ $post_info[$report['pm_id']]['message_subject']
+ ));
$phpbb_notifications->delete_notifications('notification.type.report_pm', $report['pm_id']);
}
else
{
- add_log('mod', $post_info[$report['post_id']]['forum_id'], $post_info[$report['post_id']]['topic_id'], 'LOG_REPORT_' . strtoupper($action) . 'D', $post_info[$report['post_id']]['post_subject']);
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_REPORT_' . strtoupper($action) . 'D', false, array(
+ 'forum_id' => $post_info[$report['post_id']]['forum_id'],
+ 'topic_id' => $post_info[$report['post_id']]['topic_id'],
+ 'post_id' => $report['post_id'],
+ $post_info[$report['post_id']]['post_subject']
+ ));
$phpbb_notifications->delete_notifications('notification.type.report_post', $report['post_id']);
}
}
@@ -758,7 +771,7 @@ function close_report($report_id_list, $mode, $action, $pm = false)
confirm_box(false, $user->lang[strtoupper($action) . "_{$pm_prefix}REPORT" . ((sizeof($report_id_list) == 1) ? '' : 'S') . '_CONFIRM'], $s_hidden_fields);
}
- $redirect = request_var('redirect', "index.$phpEx");
+ $redirect = $request->variable('redirect', "index.$phpEx");
$redirect = reapply_sid($redirect);
if (!$success_msg)
diff --git a/phpBB/includes/mcp/mcp_topic.php b/phpBB/includes/mcp/mcp_topic.php
index 8347830d0f..66bcdad72c 100644
--- a/phpBB/includes/mcp/mcp_topic.php
+++ b/phpBB/includes/mcp/mcp_topic.php
@@ -24,15 +24,16 @@ if (!defined('IN_PHPBB'))
*/
function mcp_topic_view($id, $mode, $action)
{
- global $phpEx, $phpbb_root_path, $config;
+ global $phpEx, $phpbb_root_path, $config, $request;
global $template, $db, $user, $auth, $cache, $phpbb_container, $phpbb_dispatcher;
$url = append_sid("{$phpbb_root_path}mcp.$phpEx?" . phpbb_extra_url());
- $user->add_lang('viewtopic');
+ /* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
+ $user->add_lang('viewtopic');
- $topic_id = request_var('t', 0);
+ $topic_id = $request->variable('t', 0);
$topic_info = phpbb_get_topic_data(array($topic_id), false, true);
if (!sizeof($topic_info))
@@ -43,16 +44,16 @@ function mcp_topic_view($id, $mode, $action)
$topic_info = $topic_info[$topic_id];
// Set up some vars
- $icon_id = request_var('icon', 0);
- $subject = utf8_normalize_nfc(request_var('subject', '', true));
- $start = request_var('start', 0);
- $sort_days_old = request_var('st_old', 0);
- $forum_id = request_var('f', 0);
- $to_topic_id = request_var('to_topic_id', 0);
- $to_forum_id = request_var('to_forum_id', 0);
+ $icon_id = $request->variable('icon', 0);
+ $subject = $request->variable('subject', '', true);
+ $start = $request->variable('start', 0);
+ $sort_days_old = $request->variable('st_old', 0);
+ $forum_id = $request->variable('f', 0);
+ $to_topic_id = $request->variable('to_topic_id', 0);
+ $to_forum_id = $request->variable('to_forum_id', 0);
$sort = isset($_POST['sort']) ? true : false;
- $submitted_id_list = request_var('post_ids', array(0));
- $checked_ids = $post_id_list = request_var('post_id_list', array(0));
+ $submitted_id_list = $request->variable('post_ids', array(0));
+ $checked_ids = $post_id_list = $request->variable('post_id_list', array(0));
// Resync Topic?
if ($action == 'resync')
@@ -116,15 +117,16 @@ function mcp_topic_view($id, $mode, $action)
$sort_by_sql = $sort_order_sql = array();
phpbb_mcp_sorting('viewtopic', $sort_days, $sort_key, $sort_dir, $sort_by_sql, $sort_order_sql, $total, $topic_info['forum_id'], $topic_id, $where_sql);
- $limit_time_sql = ($sort_days) ? 'AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
+ /* @var $phpbb_content_visibility \phpbb\content_visibility */
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
+ $limit_time_sql = ($sort_days) ? 'AND p.post_time >= ' . (time() - ($sort_days * 86400)) : '';
if ($total == -1)
{
$total = $phpbb_content_visibility->get_count('topic_posts', $topic_info, $topic_info['forum_id']);
}
- $posts_per_page = max(0, request_var('posts_per_page', intval($config['posts_per_page'])));
+ $posts_per_page = max(0, $request->variable('posts_per_page', intval($config['posts_per_page'])));
if ($posts_per_page == 0)
{
$posts_per_page = $total;
@@ -382,11 +384,11 @@ function mcp_topic_view($id, $mode, $action)
*/
function split_topic($action, $topic_id, $to_forum_id, $subject)
{
- global $db, $template, $user, $phpEx, $phpbb_root_path, $auth, $config;
+ global $db, $template, $user, $phpEx, $phpbb_root_path, $auth, $config, $phpbb_log, $request;
- $post_id_list = request_var('post_id_list', array(0));
- $forum_id = request_var('forum_id', 0);
- $start = request_var('start', 0);
+ $post_id_list = $request->variable('post_id_list', array(0));
+ $forum_id = $request->variable('forum_id', 0);
+ $start = $request->variable('start', 0);
if (!sizeof($post_id_list))
{
@@ -440,7 +442,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
return;
}
- $redirect = request_var('redirect', build_url(array('quickmod')));
+ $redirect = $request->variable('redirect', build_url(array('quickmod')));
$s_hidden_fields = build_hidden_fields(array(
'i' => 'main',
@@ -453,7 +455,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
'redirect' => $redirect,
'subject' => $subject,
'to_forum_id' => $to_forum_id,
- 'icon' => request_var('icon', 0))
+ 'icon' => $request->variable('icon', 0))
);
$success_msg = $return_link = '';
@@ -516,7 +518,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
trigger_error('NO_POST_SELECTED');
}
- $icon_id = request_var('icon', 0);
+ $icon_id = $request->variable('icon', 0);
$sql_ary = array(
'forum_id' => $to_forum_id,
@@ -534,8 +536,16 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
$topic_info = phpbb_get_topic_data(array($topic_id));
$topic_info = $topic_info[$topic_id];
- add_log('mod', $to_forum_id, $to_topic_id, 'LOG_SPLIT_DESTINATION', $subject);
- add_log('mod', $forum_id, $topic_id, 'LOG_SPLIT_SOURCE', $topic_info['topic_title']);
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_SPLIT_DESTINATION', false, array(
+ 'forum_id' => $to_forum_id,
+ 'topic_id' => $to_topic_id,
+ $subject
+ ));
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_SPLIT_SOURCE', false, array(
+ 'forum_id' => $forum_id,
+ 'topic_id' => $topic_id,
+ $topic_info['topic_title']
+ ));
// Change topic title of first post
$sql = 'UPDATE ' . POSTS_TABLE . "
@@ -589,11 +599,11 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
$success_msg = 'TOPIC_SPLIT_SUCCESS';
// Update forum statistics
- set_config_count('num_topics', 1, true);
+ $config->increment('num_topics', 1, false);
// Link back to both topics
$return_link = sprintf($user->lang['RETURN_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $post_info['forum_id'] . '&amp;t=' . $post_info['topic_id']) . '">', '</a>') . '<br /><br />' . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
- $redirect = request_var('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&amp;t=$to_topic_id");
+ $redirect = $request->variable('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&amp;t=$to_topic_id");
$redirect = reapply_sid($redirect);
meta_refresh(3, $redirect);
@@ -610,7 +620,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
*/
function merge_posts($topic_id, $to_topic_id)
{
- global $db, $template, $user, $phpEx, $phpbb_root_path, $auth;
+ global $db, $template, $user, $phpEx, $phpbb_root_path, $auth, $phpbb_log, $request;
if (!$to_topic_id)
{
@@ -636,8 +646,8 @@ function merge_posts($topic_id, $to_topic_id)
$topic_data = $topic_data[$to_topic_id];
- $post_id_list = request_var('post_id_list', array(0));
- $start = request_var('start', 0);
+ $post_id_list = $request->variable('post_id_list', array(0));
+ $start = $request->variable('start', 0);
if (!sizeof($post_id_list))
{
@@ -650,7 +660,7 @@ function merge_posts($topic_id, $to_topic_id)
return;
}
- $redirect = request_var('redirect', build_url(array('quickmod')));
+ $redirect = $request->variable('redirect', build_url(array('quickmod')));
$s_hidden_fields = build_hidden_fields(array(
'i' => 'main',
@@ -669,7 +679,12 @@ function merge_posts($topic_id, $to_topic_id)
$to_forum_id = $topic_data['forum_id'];
move_posts($post_id_list, $to_topic_id, false);
- add_log('mod', $to_forum_id, $to_topic_id, 'LOG_MERGE', $topic_data['topic_title']);
+
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_MERGE', false, array(
+ 'forum_id' => $to_forum_id,
+ 'topic_id' => $to_topic_id,
+ $topic_data['topic_title']
+ ));
// Message and return links
$success_msg = 'POSTS_MERGED_SUCCESS';
@@ -708,7 +723,7 @@ function merge_posts($topic_id, $to_topic_id)
// Link to the new topic
$return_link .= (($return_link) ? '<br /><br />' : '') . sprintf($user->lang['RETURN_NEW_TOPIC'], '<a href="' . append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'f=' . $to_forum_id . '&amp;t=' . $to_topic_id) . '">', '</a>');
- $redirect = request_var('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&amp;t=$to_topic_id");
+ $redirect = $request->variable('redirect', "{$phpbb_root_path}viewtopic.$phpEx?f=$to_forum_id&amp;t=$to_topic_id");
$redirect = reapply_sid($redirect);
meta_refresh(3, $redirect);
diff --git a/phpBB/includes/mcp/mcp_warn.php b/phpBB/includes/mcp/mcp_warn.php
index d724b8703b..d4c5486ed4 100644
--- a/phpBB/includes/mcp/mcp_warn.php
+++ b/phpBB/includes/mcp/mcp_warn.php
@@ -35,10 +35,10 @@ class mcp_warn
function main($id, $mode)
{
- global $auth, $db, $user, $template;
+ global $auth, $db, $user, $template, $request;
global $config, $phpbb_root_path, $phpEx;
- $action = request_var('action', array('' => ''));
+ $action = $request->variable('action', array('' => ''));
if (is_array($action))
{
@@ -132,15 +132,16 @@ class mcp_warn
function mcp_warn_list_view($action)
{
global $phpEx, $phpbb_root_path, $config, $phpbb_container;
- global $template, $db, $user, $auth;
+ global $template, $db, $user, $auth, $request;
- $user->add_lang('memberlist');
+ /* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
+ $user->add_lang('memberlist');
- $start = request_var('start', 0);
- $st = request_var('st', 0);
- $sk = request_var('sk', 'b');
- $sd = request_var('sd', 'd');
+ $start = $request->variable('start', 0);
+ $st = $request->variable('st', 0);
+ $sk = $request->variable('sk', 'b');
+ $sd = $request->variable('sd', 'd');
$limit_days = array(0 => $user->lang['ALL_ENTRIES'], 1 => $user->lang['1_DAY'], 7 => $user->lang['7_DAYS'], 14 => $user->lang['2_WEEKS'], 30 => $user->lang['1_MONTH'], 90 => $user->lang['3_MONTHS'], 180 => $user->lang['6_MONTHS'], 365 => $user->lang['1_YEAR']);
$sort_by_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_DATE'], 'c' => $user->lang['SORT_WARNINGS']);
@@ -189,13 +190,13 @@ class mcp_warn
*/
function mcp_warn_post_view($action)
{
- global $phpEx, $phpbb_root_path, $config;
+ global $phpEx, $phpbb_root_path, $config, $request;
global $template, $db, $user, $auth, $phpbb_dispatcher;
- $post_id = request_var('p', 0);
- $forum_id = request_var('f', 0);
+ $post_id = $request->variable('p', 0);
+ $forum_id = $request->variable('f', 0);
$notify = (isset($_REQUEST['notify_user'])) ? true : false;
- $warning = utf8_normalize_nfc(request_var('warning', '', true));
+ $warning = $request->variable('warning', '', true);
$sql = 'SELECT u.*, p.*
FROM ' . POSTS_TABLE . ' p, ' . USERS_TABLE . " u
@@ -369,13 +370,13 @@ class mcp_warn
*/
function mcp_warn_user_view($action)
{
- global $phpEx, $phpbb_root_path, $config, $module;
+ global $phpEx, $phpbb_root_path, $config, $module, $request;
global $template, $db, $user, $auth, $phpbb_dispatcher;
- $user_id = request_var('u', 0);
- $username = request_var('username', '', true);
+ $user_id = $request->variable('u', 0);
+ $username = $request->variable('username', '', true);
$notify = (isset($_REQUEST['notify_user'])) ? true : false;
- $warning = utf8_normalize_nfc(request_var('warning', '', true));
+ $warning = $request->variable('warning', '', true);
$sql_where = ($user_id) ? "user_id = $user_id" : "username_clean = '" . $db->sql_escape(utf8_clean_string($username)) . "'";
@@ -522,7 +523,7 @@ class mcp_warn
*/
function add_warning($user_row, $warning, $send_pm = true, $post_id = 0)
{
- global $phpEx, $phpbb_root_path, $config;
+ global $phpEx, $phpbb_root_path, $config, $phpbb_log;
global $template, $db, $user, $auth;
if ($send_pm)
@@ -556,8 +557,11 @@ function add_warning($user_row, $warning, $send_pm = true, $post_id = 0)
submit_pm('post', $user->lang('WARNING_PM_SUBJECT'), $pm_data, false);
}
- add_log('admin', 'LOG_USER_WARNING', $user_row['username']);
- $log_id = add_log('user', $user_row['user_id'], 'LOG_USER_WARNING_BODY', $warning);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_WARNING', false, array($user_row['username']));
+ $log_id = $phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_WARNING_BODY', false, array(
+ 'reportee_id' => $user_row['user_id'],
+ $warning
+ ));
$sql_ary = array(
'user_id' => $user_row['user_id'],
@@ -582,5 +586,10 @@ function add_warning($user_row, $warning, $send_pm = true, $post_id = 0)
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- add_log('mod', $row['forum_id'], $row['topic_id'], 'LOG_USER_WARNING', $user_row['username']);
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_USER_WARNING', false, array(
+ 'forum_id' => $row['forum_id'],
+ 'topic_id' => $row['topic_id'],
+ 'post_id' => $post_id,
+ $user_row['username']
+ ));
}
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index e63f6b822b..31fc1577a2 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -83,7 +83,14 @@ class bbcode_firstpass extends bbcode
// it should not demand recompilation
if (preg_match($regexp, $this->message))
{
- $this->message = preg_replace($regexp, $replacement, $this->message);
+ if (is_callable($replacement))
+ {
+ $this->message = preg_replace_callback($regexp, $replacement, $this->message);
+ }
+ else
+ {
+ $this->message = preg_replace($regexp, $replacement, $this->message);
+ }
$bitfield->set($bbcode_data['bbcode_id']);
}
}
@@ -123,6 +130,8 @@ class bbcode_firstpass extends bbcode
static $rowset;
+ $bbcode_class = $this;
+
// This array holds all bbcode data. BBCodes will be processed in this
// order, so it is important to keep [code] in first position and
// [quote] in second position.
@@ -132,19 +141,71 @@ class bbcode_firstpass extends bbcode
// To perform custom validation in extension, use $this->validate_bbcode_by_extension()
// method which accepts variable number of parameters
$this->bbcodes = array(
- 'code' => array('bbcode_id' => 8, 'regexp' => array('#\[code(?:=([a-z]+))?\](.+\[/code\])#uise' => "\$this->bbcode_code('\$1', '\$2')")),
- 'quote' => array('bbcode_id' => 0, 'regexp' => array('#\[quote(?:=&quot;(.*?)&quot;)?\](.+)\[/quote\]#uise' => "\$this->bbcode_quote('\$0')")),
- 'attachment' => array('bbcode_id' => 12, 'regexp' => array('#\[attachment=([0-9]+)\](.*?)\[/attachment\]#uise' => "\$this->bbcode_attachment('\$1', '\$2')")),
- 'b' => array('bbcode_id' => 1, 'regexp' => array('#\[b\](.*?)\[/b\]#uise' => "\$this->bbcode_strong('\$1')")),
- 'i' => array('bbcode_id' => 2, 'regexp' => array('#\[i\](.*?)\[/i\]#uise' => "\$this->bbcode_italic('\$1')")),
- 'url' => array('bbcode_id' => 3, 'regexp' => array('#\[url(=(.*))?\](?(1)((?s).*(?-s))|(.*))\[/url\]#uiUe' => "\$this->validate_url('\$2', ('\$3') ? '\$3' : '\$4')")),
- 'img' => array('bbcode_id' => 4, 'regexp' => array('#\[img\](.*)\[/img\]#uiUe' => "\$this->bbcode_img('\$1')")),
- 'size' => array('bbcode_id' => 5, 'regexp' => array('#\[size=([\-\+]?\d+)\](.*?)\[/size\]#uise' => "\$this->bbcode_size('\$1', '\$2')")),
- 'color' => array('bbcode_id' => 6, 'regexp' => array('!\[color=(#[0-9a-f]{3}|#[0-9a-f]{6}|[a-z\-]+)\](.*?)\[/color\]!uise' => "\$this->bbcode_color('\$1', '\$2')")),
- 'u' => array('bbcode_id' => 7, 'regexp' => array('#\[u\](.*?)\[/u\]#uise' => "\$this->bbcode_underline('\$1')")),
- 'list' => array('bbcode_id' => 9, 'regexp' => array('#\[list(?:=(?:[a-z0-9]|disc|circle|square))?].*\[/list]#uise' => "\$this->bbcode_parse_list('\$0')")),
- 'email' => array('bbcode_id' => 10, 'regexp' => array('#\[email=?(.*?)?\](.*?)\[/email\]#uise' => "\$this->validate_email('\$1', '\$2')")),
- 'flash' => array('bbcode_id' => 11, 'regexp' => array('#\[flash=([0-9]+),([0-9]+)\](.*?)\[/flash\]#uie' => "\$this->bbcode_flash('\$1', '\$2', '\$3')"))
+ 'code' => array('bbcode_id' => 8, 'regexp' => array('#\[code(?:=([a-z]+))?\](.+\[/code\])#uis' => function ($match) use($bbcode_class)
+ {
+ return $bbcode_class->bbcode_code($match[1], $match[2]);
+ }
+ )),
+ 'quote' => array('bbcode_id' => 0, 'regexp' => array('#\[quote(?:=&quot;(.*?)&quot;)?\](.+)\[/quote\]#uis' => function ($match) use($bbcode_class)
+ {
+ return $bbcode_class->bbcode_quote($match[0]);
+ }
+ )),
+ 'attachment' => array('bbcode_id' => 12, 'regexp' => array('#\[attachment=([0-9]+)\](.*?)\[/attachment\]#uis' => function ($match) use($bbcode_class)
+ {
+ return $bbcode_class->bbcode_attachment($match[1], $match[2]);
+ }
+ )),
+ 'b' => array('bbcode_id' => 1, 'regexp' => array('#\[b\](.*?)\[/b\]#uis' => function ($match) use($bbcode_class)
+ {
+ return $bbcode_class->bbcode_strong($match[1]);
+ }
+ )),
+ 'i' => array('bbcode_id' => 2, 'regexp' => array('#\[i\](.*?)\[/i\]#uis' => function ($match) use($bbcode_class)
+ {
+ return $bbcode_class->bbcode_italic($match[1]);
+ }
+ )),
+ 'url' => array('bbcode_id' => 3, 'regexp' => array('#\[url(=(.*))?\](?(1)((?s).*(?-s))|(.*))\[/url\]#uiU' => function ($match) use($bbcode_class)
+ {
+ return $bbcode_class->validate_url($match[2], ($match[3]) ? $match[3] : $match[4]);
+ }
+ )),
+ 'img' => array('bbcode_id' => 4, 'regexp' => array('#\[img\](.*)\[/img\]#uiU' => function ($match) use($bbcode_class)
+ {
+ return $bbcode_class->bbcode_img($match[1]);
+ }
+ )),
+ 'size' => array('bbcode_id' => 5, 'regexp' => array('#\[size=([\-\+]?\d+)\](.*?)\[/size\]#uis' => function ($match) use($bbcode_class)
+ {
+ return $bbcode_class->bbcode_size($match[1], $match[2]);
+ }
+ )),
+ 'color' => array('bbcode_id' => 6, 'regexp' => array('!\[color=(#[0-9a-f]{3}|#[0-9a-f]{6}|[a-z\-]+)\](.*?)\[/color\]!uis' => function ($match) use($bbcode_class)
+ {
+ return $bbcode_class->bbcode_color($match[1], $match[2]);
+ }
+ )),
+ 'u' => array('bbcode_id' => 7, 'regexp' => array('#\[u\](.*?)\[/u\]#uis' => function ($match) use($bbcode_class)
+ {
+ return $bbcode_class->bbcode_underline($match[1]);
+ }
+ )),
+ 'list' => array('bbcode_id' => 9, 'regexp' => array('#\[list(?:=(?:[a-z0-9]|disc|circle|square))?].*\[/list]#uis' => function ($match) use($bbcode_class)
+ {
+ return $bbcode_class->bbcode_parse_list($match[0]);
+ }
+ )),
+ 'email' => array('bbcode_id' => 10, 'regexp' => array('#\[email=?(.*?)?\](.*?)\[/email\]#uis' => function ($match) use($bbcode_class)
+ {
+ return $bbcode_class->validate_email($match[1], $match[2]);
+ }
+ )),
+ 'flash' => array('bbcode_id' => 11, 'regexp' => array('#\[flash=([0-9]+),([0-9]+)\](.*?)\[/flash\]#ui' => function ($match) use($bbcode_class)
+ {
+ return $bbcode_class->bbcode_flash($match[1], $match[2], $match[3]);
+ }
+ ))
);
// Zero the parsed items array
@@ -342,22 +403,23 @@ class bbcode_firstpass extends bbcode
if ($config['max_' . $this->mode . '_img_height'] || $config['max_' . $this->mode . '_img_width'])
{
- $stats = @getimagesize(htmlspecialchars_decode($in));
+ $imagesize = new \FastImageSize\FastImageSize();
+ $size_info = $imagesize->getImageSize(htmlspecialchars_decode($in));
- if ($stats === false)
+ if ($size_info === false)
{
$error = true;
$this->warn_msg[] = $user->lang['UNABLE_GET_IMAGE_SIZE'];
}
else
{
- if ($config['max_' . $this->mode . '_img_height'] && $config['max_' . $this->mode . '_img_height'] < $stats[1])
+ if ($config['max_' . $this->mode . '_img_height'] && $config['max_' . $this->mode . '_img_height'] < $size_info['height'])
{
$error = true;
$this->warn_msg[] = $user->lang('MAX_IMG_HEIGHT_EXCEEDED', (int) $config['max_' . $this->mode . '_img_height']);
}
- if ($config['max_' . $this->mode . '_img_width'] && $config['max_' . $this->mode . '_img_width'] < $stats[0])
+ if ($config['max_' . $this->mode . '_img_width'] && $config['max_' . $this->mode . '_img_width'] < $size_info['width'])
{
$error = true;
$this->warn_msg[] = $user->lang('MAX_IMG_WIDTH_EXCEEDED', (int) $config['max_' . $this->mode . '_img_width']);
@@ -746,7 +808,9 @@ class bbcode_firstpass extends bbcode
}
// To let the parser not catch tokens within quote_username quotes we encode them before we start this...
- $in = preg_replace('#quote=&quot;(.*?)&quot;\]#ie', "'quote=&quot;' . str_replace(array('[', ']', '\\\"'), array('&#91;', '&#93;', '\"'), '\$1') . '&quot;]'", $in);
+ $in = preg_replace_callback('#quote=&quot;(.*?)&quot;\]#i', function ($match) {
+ return 'quote=&quot;' . str_replace(array('[', ']', '\\\"'), array('&#91;', '&#93;', '\"'), $match[1]) . '&quot;]';
+ }, $in);
$tok = ']';
$out = '[';
@@ -1097,7 +1161,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, $phpbb_dispatcher;
+ global $config, $db, $user, $phpbb_dispatcher, $phpbb_container;
$this->mode = $mode;
@@ -1126,12 +1190,6 @@ class parse_message extends bbcode_firstpass
$this->decode_message();
}
- // Do some general 'cleanup' first before processing message,
- // e.g. remove excessive newlines(?), smilies(?)
- $match = array('#(script|about|applet|activex|chrome):#i');
- $replace = array("\\1&#058;");
- $this->message = preg_replace($match, $replace, trim($this->message));
-
// Store message length...
$message_length = ($mode == 'post') ? utf8_strlen($this->message) : utf8_strlen(preg_replace('#\[\/?[a-z\*\+\-]+(=[\S]+)?\]#ius', ' ', $this->message));
@@ -1204,56 +1262,29 @@ class parse_message extends bbcode_firstpass
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)
- {
- $this->bbcode_init();
- $disallow = array('img', 'flash', 'quote', 'url');
- foreach ($disallow as $bool)
- {
- if (!${'allow_' . $bool . '_bbcode'})
- {
- $this->bbcodes[$bool]['disabled'] = true;
- }
- }
-
- $this->prepare_bbcodes();
- }
+ // Get the parser
+ $parser = $phpbb_container->get('text_formatter.parser');
- // Parse smilies
- if ($allow_smilies)
- {
- $this->smilies($config['max_' . $mode . '_smilies']);
- }
+ // Set the parser's options
+ ($allow_bbcode) ? $parser->enable_bbcodes() : $parser->disable_bbcodes();
+ ($allow_magic_url) ? $parser->enable_magic_url() : $parser->disable_magic_url();
+ ($allow_smilies) ? $parser->enable_smilies() : $parser->disable_smilies();
+ ($allow_img_bbcode) ? $parser->enable_bbcode('img') : $parser->disable_bbcode('img');
+ ($allow_flash_bbcode) ? $parser->enable_bbcode('flash') : $parser->disable_bbcode('flash');
+ ($allow_quote_bbcode) ? $parser->enable_bbcode('quote') : $parser->disable_bbcode('quote');
+ ($allow_url_bbcode) ? $parser->enable_bbcode('url') : $parser->disable_bbcode('url');
- $num_urls = 0;
+ // Set some config values
+ $parser->set_vars(array(
+ 'max_font_size' => $config['max_' . $this->mode . '_font_size'],
+ 'max_img_height' => $config['max_' . $this->mode . '_img_height'],
+ 'max_img_width' => $config['max_' . $this->mode . '_img_width'],
+ 'max_smilies' => $config['max_' . $this->mode . '_smilies'],
+ 'max_urls' => $config['max_' . $this->mode . '_urls']
+ ));
- // Parse BBCode
- if ($allow_bbcode && strpos($this->message, '[') !== false)
- {
- $this->parse_bbcode();
- $num_urls += $this->parsed_items['url'];
- }
-
- // Parse URL's
- if ($allow_magic_url)
- {
- $this->magic_url(generate_board_url());
-
- if ($config['max_' . $mode . '_urls'])
- {
- $num_urls += preg_match_all('#\<!-- ([lmwe]) --\>.*?\<!-- \1 --\>#', $this->message, $matches);
- }
- }
-
- // Check for out-of-bounds characters that are currently
- // not supported by utf8_bin in MySQL
- if (preg_match_all('/[\x{10000}-\x{10FFFF}]/u', $this->message, $matches))
- {
- $character_list = implode('<br />', $matches[0]);
- $this->warn_msg[] = $user->lang('UNSUPPORTED_CHARACTERS_MESSAGE', $character_list);
- return $update_this_message ? $this->warn_msg : $return_message;
- }
+ // Parse this message
+ $this->message = $parser->parse(htmlspecialchars_decode($this->message, ENT_QUOTES));
// Remove quotes that are nested too deep
if ($config['max_quote_depth'] > 0)
@@ -1269,10 +1300,27 @@ class parse_message extends bbcode_firstpass
return (!$update_this_message) ? $return_message : $this->warn_msg;
}
- // Check number of links
- if ($config['max_' . $mode . '_urls'] && $num_urls > $config['max_' . $mode . '_urls'])
+ // Remove quotes that are nested too deep
+ if ($config['max_quote_depth'] > 0)
+ {
+ $this->message = $phpbb_container->get('text_formatter.utils')->remove_bbcode(
+ $this->message,
+ 'quote',
+ $config['max_quote_depth']
+ );
+ }
+
+ // Check for errors
+ $errors = $parser->get_errors();
+ if ($errors)
{
- $this->warn_msg[] = sprintf($user->lang['TOO_MANY_URLS'], $config['max_' . $mode . '_urls']);
+ foreach ($errors as $i => $args)
+ {
+ // Translate each error with $user->lang()
+ $errors[$i] = call_user_func_array(array($user, 'lang'), $args);
+ }
+ $this->warn_msg = array_merge($this->warn_msg, $errors);
+
return (!$update_this_message) ? $return_message : $this->warn_msg;
}
@@ -1292,7 +1340,7 @@ class parse_message extends bbcode_firstpass
*/
function format_display($allow_bbcode, $allow_magic_url, $allow_smilies, $update_this_message = true)
{
- global $phpbb_dispatcher;
+ global $phpbb_container, $phpbb_dispatcher;
// If false, then the parsed message get returned but internal message not processed.
if (!$update_this_message)
@@ -1324,26 +1372,25 @@ class parse_message extends bbcode_firstpass
$this->bbcode_uid = $uid;
unset($text, $uid);
- if ($this->message_status == 'plain')
+ // NOTE: message_status is unreliable for detecting unparsed text because some callers
+ // change $this->message without resetting $this->message_status to 'plain' so we
+ // inspect the message instead
+ //if ($this->message_status == 'plain')
+ if (!preg_match('/^<[rt][ >]/', $this->message))
{
// Force updating message - of course.
$this->parse($allow_bbcode, $allow_magic_url, $allow_smilies, $this->allow_img_bbcode, $this->allow_flash_bbcode, $this->allow_quote_bbcode, $this->allow_url_bbcode, true);
}
- // Replace naughty words such as farty pants
- $this->message = censor_text($this->message);
-
- // Parse BBcode
- if ($allow_bbcode)
+ // There's a bug when previewing a topic with no poll, because the empty title of the poll
+ // gets parsed but $this->message still ends up empty. This fixes it, until a proper fix is
+ // devised
+ if ($this->message === '')
{
- $this->bbcode_cache_init();
-
- // We are giving those parameters to be able to use the bbcode class on its own
- $this->bbcode_second_pass($this->message, $this->bbcode_uid);
+ $this->message = $phpbb_container->get('text_formatter.parser')->parse($this->message);
}
- $this->message = bbcode_nl2br($this->message);
- $this->message = smiley_text($this->message, !$allow_smilies);
+ $this->message = $phpbb_container->get('text_formatter.renderer')->render($this->message);
$text = $this->message;
$uid = $this->bbcode_uid;
@@ -1498,7 +1545,7 @@ class parse_message extends bbcode_firstpass
$error = array();
$num_attachments = sizeof($this->attachment_data);
- $this->filename_data['filecomment'] = utf8_normalize_nfc(request_var('filecomment', '', true));
+ $this->filename_data['filecomment'] = $request->variable('filecomment', '', true);
$upload = $request->file($form_name);
$upload_file = (!empty($upload) && $upload['name'] !== 'none' && trim($upload['name']));
@@ -1506,7 +1553,7 @@ class parse_message extends bbcode_firstpass
$delete_file = (isset($_POST['delete_file'])) ? true : false;
// First of all adjust comments if changed
- $actual_comment_list = utf8_normalize_nfc(request_var('comment_list', array(''), true));
+ $actual_comment_list = $request->variable('comment_list', array(''), true);
foreach ($actual_comment_list as $comment_key => $comment)
{
@@ -1559,7 +1606,9 @@ class parse_message extends bbcode_firstpass
);
$this->attachment_data = array_merge(array(0 => $new_entry), $this->attachment_data);
- $this->message = preg_replace('#\[attachment=([0-9]+)\](.*?)\[\/attachment\]#e', "'[attachment='.(\\1 + 1).']\\2[/attachment]'", $this->message);
+ $this->message = preg_replace_callback('#\[attachment=([0-9]+)\](.*?)\[\/attachment\]#', function ($match) {
+ return '[attachment='.($match[1] + 1).']' . $match[2] . '[/attachment]';
+ }, $this->message);
$this->filename_data['filecomment'] = '';
@@ -1592,7 +1641,7 @@ class parse_message extends bbcode_firstpass
{
include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
- $index = array_keys(request_var('delete_file', array(0 => 0)));
+ $index = array_keys($request->variable('delete_file', array(0 => 0)));
$index = (!empty($index)) ? $index[0] : false;
if ($index !== false && !empty($this->attachment_data[$index]))
@@ -1627,7 +1676,9 @@ class parse_message extends bbcode_firstpass
}
unset($this->attachment_data[$index]);
- $this->message = preg_replace('#\[attachment=([0-9]+)\](.*?)\[\/attachment\]#e', "(\\1 == \$index) ? '' : ((\\1 > \$index) ? '[attachment=' . (\\1 - 1) . ']\\2[/attachment]' : '\\0')", $this->message);
+ $this->message = preg_replace_callback('#\[attachment=([0-9]+)\](.*?)\[\/attachment\]#', function ($match) use($index) {
+ return ($match[1] == $index) ? '' : (($match[1] > $index) ? '[attachment=' . ($match[1] - 1) . ']' . $match[2] . '[/attachment]' : $match[0]);
+ }, $this->message);
// Reindex Array
$this->attachment_data = array_values($this->attachment_data);
@@ -1671,7 +1722,9 @@ class parse_message extends bbcode_firstpass
);
$this->attachment_data = array_merge(array(0 => $new_entry), $this->attachment_data);
- $this->message = preg_replace('#\[attachment=([0-9]+)\](.*?)\[\/attachment\]#e', "'[attachment='.(\\1 + 1).']\\2[/attachment]'", $this->message);
+ $this->message = preg_replace_callback('#\[attachment=([0-9]+)\](.*?)\[\/attachment\]#', function ($match) {
+ return '[attachment=' . ($match[1] + 1) . ']' . $match[2] . '[/attachment]';
+ }, $this->message);
$this->filename_data['filecomment'] = '';
if (isset($this->plupload) && $this->plupload->is_active())
@@ -1718,7 +1771,7 @@ class parse_message extends bbcode_firstpass
global $user, $db, $phpbb_root_path, $phpEx, $config;
global $request;
- $this->filename_data['filecomment'] = utf8_normalize_nfc(request_var('filecomment', '', true));
+ $this->filename_data['filecomment'] = $request->variable('filecomment', '', true);
$attachment_data = $request->variable('attachment_data', array(0 => array('' => '')), true, \phpbb\request\request_interface::POST);
$this->attachment_data = array();
@@ -1807,24 +1860,22 @@ class parse_message extends bbcode_firstpass
$poll_max_options = $poll['poll_max_options'];
- // Parse Poll Option text ;)
+ // Parse Poll Option text
$tmp_message = $this->message;
- $this->message = $poll['poll_option_text'];
- $bbcode_bitfield = $this->bbcode_bitfield;
- $poll['poll_option_text'] = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, false, $config['allow_post_links'], false, 'poll');
+ $poll['poll_options'] = explode("\n", trim($poll['poll_option_text']));
+ $poll['poll_options_size'] = sizeof($poll['poll_options']);
- $bbcode_bitfield = base64_encode(base64_decode($bbcode_bitfield) | base64_decode($this->bbcode_bitfield));
- $this->message = $tmp_message;
+ foreach ($poll['poll_options'] as &$poll_option)
+ {
+ $this->message = $poll_option;
+ $poll_option = $this->parse($poll['enable_bbcode'], ($config['allow_post_links']) ? $poll['enable_urls'] : false, $poll['enable_smilies'], $poll['img_status'], false, false, $config['allow_post_links'], false, 'poll');
+ }
+ unset($poll_option);
+ $poll['poll_option_text'] = implode("\n", $poll['poll_options']);
// Parse Poll Title
- $tmp_message = $this->message;
$this->message = $poll['poll_title'];
- $this->bbcode_bitfield = $bbcode_bitfield;
-
- $poll['poll_options'] = explode("\n", trim($poll['poll_option_text']));
- $poll['poll_options_size'] = sizeof($poll['poll_options']);
-
if (!$poll['poll_title'] && $poll['poll_options_size'])
{
$this->warn_msg[] = $user->lang['NO_POLL_TITLE'];
@@ -1842,10 +1893,6 @@ class parse_message extends bbcode_firstpass
}
}
- $this->bbcode_bitfield = base64_encode(base64_decode($bbcode_bitfield) | base64_decode($this->bbcode_bitfield));
- $this->message = $tmp_message;
- unset($tmp_message);
-
if (sizeof($poll['poll_options']) == 1)
{
$this->warn_msg[] = $user->lang['TOO_FEW_POLL_OPTIONS'];
@@ -1860,6 +1907,8 @@ class parse_message extends bbcode_firstpass
}
$poll['poll_max_options'] = ($poll['poll_max_options'] < 1) ? 1 : (($poll['poll_max_options'] > $config['max_poll_options']) ? $config['max_poll_options'] : $poll['poll_max_options']);
+
+ $this->message = $tmp_message;
}
/**
@@ -1870,6 +1919,19 @@ class parse_message extends bbcode_firstpass
*/
public function remove_nested_quotes($max_depth)
{
+ global $phpbb_container;
+
+ if (preg_match('#^<[rt][ >]#', $this->message))
+ {
+ $this->message = $phpbb_container->get('text_formatter.utils')->remove_bbcode(
+ $this->message,
+ 'quote',
+ $max_depth
+ );
+
+ return;
+ }
+
// Capture all [quote] and [/quote] tags
preg_match_all('(\\[/?quote(?:=&quot;(.*?)&quot;)?:' . $this->bbcode_uid . '\\])', $this->message, $matches, PREG_OFFSET_CAPTURE);
diff --git a/phpBB/includes/questionnaire/questionnaire.php b/phpBB/includes/questionnaire/questionnaire.php
index 63ea432863..8fe93735ee 100644
--- a/phpBB/includes/questionnaire/questionnaire.php
+++ b/phpBB/includes/questionnaire/questionnaire.php
@@ -230,7 +230,7 @@ class phpbb_questionnaire_phpbb_data_provider
if (empty($config['questionnaire_unique_id']))
{
$this->unique_id = unique_id();
- set_config('questionnaire_unique_id', $this->unique_id);
+ $config->set('questionnaire_unique_id', $this->unique_id);
}
else
{
diff --git a/phpBB/includes/startup.php b/phpBB/includes/startup.php
index 7353b90d99..5900016c39 100644
--- a/phpBB/includes/startup.php
+++ b/phpBB/includes/startup.php
@@ -19,10 +19,6 @@ if (!defined('IN_PHPBB'))
}
// Report all errors, except notices and deprecation messages
-if (!defined('E_DEPRECATED'))
-{
- define('E_DEPRECATED', 8192);
-}
$level = E_ALL & ~E_NOTICE & ~E_DEPRECATED;
error_reporting($level);
@@ -109,33 +105,21 @@ else
define('STRIP', (get_magic_quotes_gpc()) ? true : false);
}
-// Prevent date/time functions from throwing E_WARNING on PHP 5.3 by setting a default timezone
-if (function_exists('date_default_timezone_set') && function_exists('date_default_timezone_get'))
-{
- // For PHP 5.1.0 the date/time functions have been rewritten
- // and setting a timezone is required prior to calling any date/time function.
-
- // Since PHP 5.2.0 calls to date/time functions without having a timezone set
- // result in E_STRICT errors being thrown.
- // Note: We already exclude E_STRICT errors
- // (to be exact: they are not included in E_ALL in PHP 5.2)
-
- // In PHP 5.3.0 the error level has been raised to E_WARNING which causes problems
- // because we show E_WARNING errors and do not set a default timezone.
- // This is because we have our own timezone handling and work in UTC only anyway.
+// In PHP 5.3.0 the error level has been raised to E_WARNING which causes problems
+// because we show E_WARNING errors and do not set a default timezone.
+// This is because we have our own timezone handling and work in UTC only anyway.
- // So what we basically want to do is set our timezone to UTC,
- // but we don't know what other scripts (such as bridges) are involved,
- // so we check whether a timezone is already set by calling date_default_timezone_get().
+// So what we basically want to do is set our timezone to UTC,
+// but we don't know what other scripts (such as bridges) are involved,
+// so we check whether a timezone is already set by calling date_default_timezone_get().
- // Unfortunately, date_default_timezone_get() itself might throw E_WARNING
- // if no timezone has been set, so we have to keep it quiet with @.
+// Unfortunately, date_default_timezone_get() itself might throw E_WARNING
+// if no timezone has been set, so we have to keep it quiet with @.
- // date_default_timezone_get() tries to guess the correct timezone first
- // and then falls back to UTC when everything fails.
- // We just set the timezone to whatever date_default_timezone_get() returns.
- date_default_timezone_set(@date_default_timezone_get());
-}
+// date_default_timezone_get() tries to guess the correct timezone first
+// and then falls back to UTC when everything fails.
+// We just set the timezone to whatever date_default_timezone_get() returns.
+date_default_timezone_set(@date_default_timezone_get());
// Autoloading of dependencies.
// Three options are supported:
@@ -172,5 +156,4 @@ else
require($phpbb_root_path . 'vendor/autoload.php');
}
-$starttime = explode(' ', microtime());
-$starttime = $starttime[1] + $starttime[0];
+$starttime = microtime(true);
diff --git a/phpBB/includes/ucp/info/ucp_attachments.php b/phpBB/includes/ucp/info/ucp_attachments.php
index 2e20106f5c..96e7956db9 100644
--- a/phpBB/includes/ucp/info/ucp_attachments.php
+++ b/phpBB/includes/ucp/info/ucp_attachments.php
@@ -18,7 +18,6 @@ class ucp_attachments_info
return array(
'filename' => 'ucp_attachments',
'title' => 'UCP_ATTACHMENTS',
- 'version' => '1.0.0',
'modes' => array(
'attachments' => array('title' => 'UCP_MAIN_ATTACHMENTS', 'auth' => 'acl_u_attach', 'cat' => array('UCP_MAIN')),
),
diff --git a/phpBB/includes/ucp/info/ucp_auth_link.php b/phpBB/includes/ucp/info/ucp_auth_link.php
index 9ec4cb7b3a..57c9269c5e 100644
--- a/phpBB/includes/ucp/info/ucp_auth_link.php
+++ b/phpBB/includes/ucp/info/ucp_auth_link.php
@@ -18,7 +18,6 @@ class ucp_auth_link_info
return array(
'filename' => 'ucp_auth_link',
'title' => 'UCP_AUTH_LINK',
- 'version' => '1.0.0',
'modes' => array(
'auth_link' => array('title' => 'UCP_AUTH_LINK_MANAGE', 'auth' => 'authmethod_oauth', 'cat' => array('UCP_PROFILE')),
),
diff --git a/phpBB/includes/ucp/info/ucp_groups.php b/phpBB/includes/ucp/info/ucp_groups.php
index 6da2a4fe38..42eb285075 100644
--- a/phpBB/includes/ucp/info/ucp_groups.php
+++ b/phpBB/includes/ucp/info/ucp_groups.php
@@ -18,7 +18,6 @@ class ucp_groups_info
return array(
'filename' => 'ucp_groups',
'title' => 'UCP_USERGROUPS',
- 'version' => '1.0.0',
'modes' => array(
'membership' => array('title' => 'UCP_USERGROUPS_MEMBER', 'auth' => '', 'cat' => array('UCP_USERGROUPS')),
'manage' => array('title' => 'UCP_USERGROUPS_MANAGE', 'auth' => '', 'cat' => array('UCP_USERGROUPS')),
diff --git a/phpBB/includes/ucp/info/ucp_main.php b/phpBB/includes/ucp/info/ucp_main.php
index de8e7d5602..e967b8445f 100644
--- a/phpBB/includes/ucp/info/ucp_main.php
+++ b/phpBB/includes/ucp/info/ucp_main.php
@@ -18,7 +18,6 @@ class ucp_main_info
return array(
'filename' => 'ucp_main',
'title' => 'UCP_MAIN',
- 'version' => '1.0.0',
'modes' => array(
'front' => array('title' => 'UCP_MAIN_FRONT', 'auth' => '', 'cat' => array('UCP_MAIN')),
'subscribed' => array('title' => 'UCP_MAIN_SUBSCRIBED', 'auth' => '', 'cat' => array('UCP_MAIN')),
diff --git a/phpBB/includes/ucp/info/ucp_notifications.php b/phpBB/includes/ucp/info/ucp_notifications.php
index 0cc011d96e..94e0467ccb 100644
--- a/phpBB/includes/ucp/info/ucp_notifications.php
+++ b/phpBB/includes/ucp/info/ucp_notifications.php
@@ -18,10 +18,9 @@ class ucp_notifications_info
return array(
'filename' => 'ucp_notifications',
'title' => 'UCP_NOTIFICATION_OPTIONS',
- 'version' => '1.0.0',
'modes' => array(
'notification_options' => array('title' => 'UCP_NOTIFICATION_OPTIONS', 'auth' => '', 'cat' => array('UCP_PREFS')),
- 'notification_list' => array('title' => 'UCP_NOTIFICATION_LIST', 'auth' => '', 'cat' => array('UCP_MAIN')),
+ 'notification_list' => array('title' => 'UCP_NOTIFICATION_LIST', 'auth' => 'cfg_allow_board_notifications', 'cat' => array('UCP_MAIN')),
),
);
}
diff --git a/phpBB/includes/ucp/info/ucp_pm.php b/phpBB/includes/ucp/info/ucp_pm.php
index 6aa1669cb6..26bd670fc5 100644
--- a/phpBB/includes/ucp/info/ucp_pm.php
+++ b/phpBB/includes/ucp/info/ucp_pm.php
@@ -18,7 +18,6 @@ class ucp_pm_info
return array(
'filename' => 'ucp_pm',
'title' => 'UCP_PM',
- 'version' => '1.0.0',
'modes' => array(
'view' => array('title' => 'UCP_PM_VIEW', 'auth' => 'cfg_allow_privmsg', 'display' => false, 'cat' => array('UCP_PM')),
'compose' => array('title' => 'UCP_PM_COMPOSE', 'auth' => 'cfg_allow_privmsg', 'cat' => array('UCP_PM')),
diff --git a/phpBB/includes/ucp/info/ucp_prefs.php b/phpBB/includes/ucp/info/ucp_prefs.php
index 5c2d29ac73..4793aa2649 100644
--- a/phpBB/includes/ucp/info/ucp_prefs.php
+++ b/phpBB/includes/ucp/info/ucp_prefs.php
@@ -18,7 +18,6 @@ class ucp_prefs_info
return array(
'filename' => 'ucp_prefs',
'title' => 'UCP_PREFS',
- 'version' => '1.0.0',
'modes' => array(
'personal' => array('title' => 'UCP_PREFS_PERSONAL', 'auth' => '', 'cat' => array('UCP_PREFS')),
'post' => array('title' => 'UCP_PREFS_POST', 'auth' => '', 'cat' => array('UCP_PREFS')),
diff --git a/phpBB/includes/ucp/info/ucp_profile.php b/phpBB/includes/ucp/info/ucp_profile.php
index 919de99a96..fc2792224d 100644
--- a/phpBB/includes/ucp/info/ucp_profile.php
+++ b/phpBB/includes/ucp/info/ucp_profile.php
@@ -18,7 +18,6 @@ class ucp_profile_info
return array(
'filename' => 'ucp_profile',
'title' => 'UCP_PROFILE',
- 'version' => '1.0.0',
'modes' => array(
'profile_info' => array('title' => 'UCP_PROFILE_PROFILE_INFO', 'auth' => 'acl_u_chgprofileinfo', 'cat' => array('UCP_PROFILE')),
'signature' => array('title' => 'UCP_PROFILE_SIGNATURE', 'auth' => 'acl_u_sig', 'cat' => array('UCP_PROFILE')),
diff --git a/phpBB/includes/ucp/info/ucp_zebra.php b/phpBB/includes/ucp/info/ucp_zebra.php
index 99d4a4f4c0..69274c2866 100644
--- a/phpBB/includes/ucp/info/ucp_zebra.php
+++ b/phpBB/includes/ucp/info/ucp_zebra.php
@@ -18,7 +18,6 @@ class ucp_zebra_info
return array(
'filename' => 'ucp_zebra',
'title' => 'UCP_ZEBRA',
- 'version' => '1.0.0',
'modes' => array(
'friends' => array('title' => 'UCP_ZEBRA_FRIENDS', 'auth' => '', 'cat' => array('UCP_ZEBRA')),
'foes' => array('title' => 'UCP_ZEBRA_FOES', 'auth' => '', 'cat' => array('UCP_ZEBRA')),
diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php
index 1f5ce93277..5bfb688d3a 100644
--- a/phpBB/includes/ucp/ucp_activate.php
+++ b/phpBB/includes/ucp/ucp_activate.php
@@ -29,11 +29,11 @@ class ucp_activate
function main($id, $mode)
{
- global $config, $phpbb_root_path, $phpEx;
- global $db, $user, $auth, $template, $phpbb_container, $phpbb_dispatcher;
+ global $config, $phpbb_root_path, $phpEx, $request;
+ global $db, $user, $auth, $template, $phpbb_container, $phpbb_log, $phpbb_dispatcher;
- $user_id = request_var('u', 0);
- $key = request_var('k', '');
+ $user_id = $request->variable('u', 0);
+ $key = $request->variable('k', '');
$sql = 'SELECT user_id, username, user_type, user_email, user_newpasswd, user_lang, user_notify_type, user_actkey, user_inactive_reason
FROM ' . USERS_TABLE . "
@@ -86,7 +86,10 @@ class ucp_activate
WHERE user_id = ' . $user_row['user_id'];
$db->sql_query($sql);
- add_log('user', $user_row['user_id'], 'LOG_USER_NEW_PASSWORD', $user_row['username']);
+ $phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_NEW_PASSWORD', false, array(
+ 'reportee_id' => $user_row['user_id'],
+ $user_row['username']
+ ));
}
if (!$update_password)
@@ -101,15 +104,19 @@ class ucp_activate
$db->sql_query($sql);
// Create the correct logs
- add_log('user', $user_row['user_id'], 'LOG_USER_ACTIVE_USER');
+ $phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_ACTIVE_USER', false, array(
+ 'reportee_id' => $user_row['user_id']
+ ));
+
if ($auth->acl_get('a_user'))
{
- add_log('admin', 'LOG_USER_ACTIVE', $user_row['username']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_USER_ACTIVE', false, array($user_row['username']));
}
}
if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !$update_password)
{
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
$phpbb_notifications->delete_notifications('notification.type.admin_activate_user', $user_row['user_id']);
diff --git a/phpBB/includes/ucp/ucp_attachments.php b/phpBB/includes/ucp/ucp_attachments.php
index 42724209aa..639f308091 100644
--- a/phpBB/includes/ucp/ucp_attachments.php
+++ b/phpBB/includes/ucp/ucp_attachments.php
@@ -29,15 +29,15 @@ class ucp_attachments
function main($id, $mode)
{
- global $template, $user, $db, $config, $phpEx, $phpbb_root_path, $phpbb_container;
+ global $template, $user, $db, $config, $phpEx, $phpbb_root_path, $phpbb_container, $request;
- $start = request_var('start', 0);
- $sort_key = request_var('sk', 'a');
- $sort_dir = request_var('sd', 'a');
+ $start = $request->variable('start', 0);
+ $sort_key = $request->variable('sk', 'a');
+ $sort_dir = $request->variable('sd', 'a');
$delete = (isset($_POST['delete'])) ? true : false;
$confirm = (isset($_POST['confirm'])) ? true : false;
- $delete_ids = array_keys(request_var('attachment', array(0)));
+ $delete_ids = array_keys($request->variable('attachment', array(0)));
if ($delete && sizeof($delete_ids))
{
@@ -123,6 +123,7 @@ class ucp_attachments
$db->sql_freeresult($result);
// Ensure start is a valid value
+ /* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
$start = $pagination->validate_start($start, $config['topics_per_page'], $num_attachments);
diff --git a/phpBB/includes/ucp/ucp_auth_link.php b/phpBB/includes/ucp/ucp_auth_link.php
index 748f0fdec2..08aacdef3a 100644
--- a/phpBB/includes/ucp/ucp_auth_link.php
+++ b/phpBB/includes/ucp/ucp_auth_link.php
@@ -38,6 +38,7 @@ class ucp_auth_link
$error = array();
+ /* @var $provider_collection \phpbb\auth\provider_collection */
$provider_collection = $phpbb_container->get('auth.provider_collection');
$auth_provider = $provider_collection->get_provider();
diff --git a/phpBB/includes/ucp/ucp_confirm.php b/phpBB/includes/ucp/ucp_confirm.php
index 7392f8dea8..403f7d37d0 100644
--- a/phpBB/includes/ucp/ucp_confirm.php
+++ b/phpBB/includes/ucp/ucp_confirm.php
@@ -36,10 +36,10 @@ class ucp_confirm
function main($id, $mode)
{
- global $db, $user, $phpbb_root_path, $config, $phpEx, $phpbb_container;
+ global $db, $user, $phpbb_root_path, $config, $phpEx, $phpbb_container, $request;
$captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']);
- $captcha->init(request_var('type', 0));
+ $captcha->init($request->variable('type', 0));
$captcha->execute();
garbage_collection();
diff --git a/phpBB/includes/ucp/ucp_groups.php b/phpBB/includes/ucp/ucp_groups.php
index b9606945b4..2746e74ffe 100644
--- a/phpBB/includes/ucp/ucp_groups.php
+++ b/phpBB/includes/ucp/ucp_groups.php
@@ -30,17 +30,20 @@ class ucp_groups
{
global $config, $phpbb_root_path, $phpEx, $phpbb_admin_path;
global $db, $user, $auth, $cache, $template;
- global $request, $phpbb_container;
+ global $request, $phpbb_container, $phpbb_log;
$user->add_lang('groups');
$return_page = '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . $this->u_action . '">', '</a>');
- $mark_ary = request_var('mark', array(0));
+ $mark_ary = $request->variable('mark', array(0));
$submit = $request->variable('submit', false, false, \phpbb\request\request_interface::POST);
$delete = $request->variable('delete', false, false, \phpbb\request\request_interface::POST);
$error = $data = array();
+ /** @var \phpbb\group\helper $group_helper */
+ $group_helper = $phpbb_container->get('group_helper');
+
switch ($mode)
{
case 'membership':
@@ -49,8 +52,8 @@ class ucp_groups
if ($submit || isset($_POST['change_default']))
{
- $action = (isset($_POST['change_default'])) ? 'change_default' : request_var('action', '');
- $group_id = ($action == 'change_default') ? request_var('default', 0) : request_var('selected', 0);
+ $action = (isset($_POST['change_default'])) ? 'change_default' : $request->variable('action', '');
+ $group_id = ($action == 'change_default') ? $request->variable('default', 0) : $request->variable('selected', 0);
if (!$group_id)
{
@@ -65,7 +68,7 @@ class ucp_groups
$group_row = array();
while ($row = $db->sql_fetchrow($result))
{
- $row['group_name'] = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
+ $row['group_name'] = $group_helper->get_name($row['group_name']);
$group_row[$row['group_id']] = $row;
}
$db->sql_freeresult($result);
@@ -99,7 +102,10 @@ class ucp_groups
{
group_user_attributes('default', $group_id, $user->data['user_id']);
- add_log('user', $user->data['user_id'], 'LOG_USER_GROUP_CHANGE', sprintf($user->lang['USER_GROUP_CHANGE'], $group_row[$user->data['group_id']]['group_name'], $group_row[$group_id]['group_name']));
+ $phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_GROUP_CHANGE', false, array(
+ 'reportee_id' => $user->data['user_id'],
+ sprintf($user->lang['USER_GROUP_CHANGE'], $group_row[$user->data['group_id']]['group_name'], $group_row[$group_id]['group_name'])
+ ));
meta_refresh(3, $this->u_action);
trigger_error($user->lang['CHANGED_DEFAULT_GROUP'] . $return_page);
@@ -146,7 +152,10 @@ class ucp_groups
{
group_user_del($group_id, $user->data['user_id']);
- add_log('user', $user->data['user_id'], 'LOG_USER_GROUP_RESIGN', $group_row[$group_id]['group_name']);
+ $phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_GROUP_RESIGN', false, array(
+ 'reportee_id' => $user->data['user_id'],
+ $group_row[$group_id]['group_name']
+ ));
meta_refresh(3, $this->u_action);
trigger_error($user->lang[($row['user_pending']) ? 'GROUP_RESIGNED_PENDING' : 'GROUP_RESIGNED_MEMBERSHIP'] . $return_page);
@@ -202,7 +211,10 @@ class ucp_groups
group_user_add($group_id, $user->data['user_id'], false, false, false, 0, 1);
}
- add_log('user', $user->data['user_id'], 'LOG_USER_GROUP_JOIN' . (($group_row[$group_id]['group_type'] == GROUP_FREE) ? '' : '_PENDING'), $group_row[$group_id]['group_name']);
+ $phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_GROUP_JOIN' . (($group_row[$group_id]['group_type'] == GROUP_FREE) ? '' : '_PENDING'), false, array(
+ 'reportee_id' => $user->data['user_id'],
+ $group_row[$group_id]['group_name']
+ ));
meta_refresh(3, $this->u_action);
trigger_error($user->lang[($group_row[$group_id]['group_type'] == GROUP_FREE) ? 'GROUP_JOINED' : 'GROUP_JOINED_PENDING'] . $return_page);
@@ -237,7 +249,10 @@ class ucp_groups
{
group_user_attributes('demote', $group_id, $user->data['user_id']);
- add_log('user', $user->data['user_id'], 'LOG_USER_GROUP_DEMOTE', $group_row[$group_id]['group_name']);
+ $phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_GROUP_DEMOTE', false, array(
+ 'reportee_id' => $user->data['user_id'],
+ $group_row[$group_id]['group_name']
+ ));
meta_refresh(3, $this->u_action);
trigger_error($user->lang['USER_GROUP_DEMOTED'] . $return_page);
@@ -295,7 +310,7 @@ class ucp_groups
$template->assign_block_vars($block, array(
'GROUP_ID' => $row['group_id'],
- 'GROUP_NAME' => ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'],
+ 'GROUP_NAME' => $group_helper->get_name($row['group_name']),
'GROUP_DESC' => ($row['group_type'] <> GROUP_SPECIAL) ? generate_text_for_display($row['group_desc'], $row['group_desc_uid'], $row['group_desc_bitfield'], $row['group_desc_options']) : $user->lang['GROUP_IS_SPECIAL'],
'GROUP_SPECIAL' => ($row['group_type'] <> GROUP_SPECIAL) ? false : true,
'GROUP_STATUS' => $user->lang['GROUP_IS_' . $group_status],
@@ -349,7 +364,7 @@ class ucp_groups
$template->assign_block_vars('nonmember', array(
'GROUP_ID' => $row['group_id'],
- 'GROUP_NAME' => ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'],
+ 'GROUP_NAME' => $group_helper->get_name($row['group_name']),
'GROUP_DESC' => ($row['group_type'] <> GROUP_SPECIAL) ? generate_text_for_display($row['group_desc'], $row['group_desc_uid'], $row['group_desc_bitfield'], $row['group_desc_options']) : $user->lang['GROUP_IS_SPECIAL'],
'GROUP_SPECIAL' => ($row['group_type'] <> GROUP_SPECIAL) ? false : true,
'GROUP_CLOSED' => ($row['group_type'] <> GROUP_CLOSED || $auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel')) ? false : true,
@@ -379,8 +394,8 @@ class ucp_groups
case 'manage':
$this->page_title = 'UCP_USERGROUPS_MANAGE';
- $action = (isset($_POST['addusers'])) ? 'addusers' : request_var('action', '');
- $group_id = request_var('g', 0);
+ $action = (isset($_POST['addusers'])) ? 'addusers' : $request->variable('action', '');
+ $group_id = $request->variable('g', 0);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
@@ -414,7 +429,7 @@ class ucp_groups
$avatar = phpbb_get_group_avatar($group_row, 'GROUP_AVATAR', true);
$template->assign_vars(array(
- 'GROUP_NAME' => ($group_type == GROUP_SPECIAL) ? $user->lang['G_' . $group_name] : $group_name,
+ 'GROUP_NAME' => $group_helper->get_name($group_name),
'GROUP_INTERNAL_NAME' => $group_name,
'GROUP_COLOUR' => (isset($group_row['group_colour'])) ? $group_row['group_colour'] : '',
'GROUP_DESC_DISP' => generate_text_for_display($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_bitfield'], $group_row['group_desc_options']),
@@ -464,6 +479,7 @@ class ucp_groups
if ($config['allow_avatar'])
{
+ /* @var $phpbb_avatar_manager \phpbb\avatar\manager */
$phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
$avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers();
@@ -497,20 +513,20 @@ class ucp_groups
// Did we submit?
if ($update)
{
- $group_name = utf8_normalize_nfc(request_var('group_name', '', true));
- $group_desc = utf8_normalize_nfc(request_var('group_desc', '', true));
- $group_type = request_var('group_type', GROUP_FREE);
+ $group_name = $request->variable('group_name', '', true);
+ $group_desc = $request->variable('group_desc', '', true);
+ $group_type = $request->variable('group_type', GROUP_FREE);
- $allow_desc_bbcode = request_var('desc_parse_bbcode', false);
- $allow_desc_urls = request_var('desc_parse_urls', false);
- $allow_desc_smilies = request_var('desc_parse_smilies', false);
+ $allow_desc_bbcode = $request->variable('desc_parse_bbcode', false);
+ $allow_desc_urls = $request->variable('desc_parse_urls', false);
+ $allow_desc_smilies = $request->variable('desc_parse_smilies', false);
$submit_ary = array(
- 'colour' => request_var('group_colour', ''),
- 'rank' => request_var('group_rank', 0),
+ 'colour' => $request->variable('group_colour', ''),
+ 'rank' => $request->variable('group_rank', 0),
'receive_pm' => isset($_REQUEST['group_receive_pm']) ? 1 : 0,
- 'message_limit' => request_var('group_message_limit', 0),
- 'max_recipients'=> request_var('group_max_recipients', 0),
+ 'message_limit' => $request->variable('group_message_limit', 0),
+ 'max_recipients'=> $request->variable('group_max_recipients', 0),
'legend' => $group_row['group_legend'],
'teampage' => $group_row['group_teampage'],
);
@@ -608,7 +624,7 @@ class ucp_groups
}
else if (!$group_id)
{
- $group_name = utf8_normalize_nfc(request_var('group_name', '', true));
+ $group_name = $request->variable('group_name', '', true);
$group_desc_data = array(
'text' => '',
'allow_bbcode' => true,
@@ -737,7 +753,7 @@ class ucp_groups
}
$user->add_lang(array('acp/groups', 'acp/common'));
- $start = request_var('start', 0);
+ $start = $request->variable('start', 0);
// Grab the leaders - always, on every page...
$sql = 'SELECT u.user_id, u.username, u.username_clean, u.user_colour, u.user_regdate, u.user_posts, u.group_id, ug.group_leader, ug.user_pending
@@ -826,6 +842,7 @@ class ucp_groups
$s_action_options .= '<option value="' . $option . '">' . $user->lang['GROUP_' . $lang] . '</option>';
}
+ /* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
$base_url = $this->u_action . "&amp;action=$action&amp;g=$group_id";
$start = $pagination->validate_start($start, $config['topics_per_page'], $total_members);
@@ -887,7 +904,7 @@ class ucp_groups
trigger_error($user->lang['NOT_LEADER_OF_GROUP'] . $return_page);
}
- $group_row['group_name'] = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'];
+ $group_row['group_name'] = $group_helper->get_name($group_row['group_name']);
if (confirm_box(true))
{
@@ -966,7 +983,7 @@ class ucp_groups
trigger_error($user->lang['NOT_LEADER_OF_GROUP'] . $return_page);
}
- $group_row['group_name'] = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'];
+ $group_row['group_name'] = $group_helper->get_name($group_row['group_name']);
if (confirm_box(true))
{
@@ -1004,7 +1021,7 @@ class ucp_groups
$user->add_lang(array('acp/groups', 'acp/common'));
- $names = utf8_normalize_nfc(request_var('usernames', '', true));
+ $names = $request->variable('usernames', '', true);
if (!$group_id)
{
@@ -1028,9 +1045,9 @@ class ucp_groups
}
$name_ary = array_unique(explode("\n", $names));
- $group_name = ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'];
+ $group_name = $group_helper->get_name($group_row['group_name']);
- $default = request_var('default', 0);
+ $default = $request->variable('default', 0);
if (confirm_box(true))
{
@@ -1074,7 +1091,7 @@ class ucp_groups
while ($value = $db->sql_fetchrow($result))
{
$template->assign_block_vars('leader', array(
- 'GROUP_NAME' => ($value['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $value['group_name']] : $value['group_name'],
+ 'GROUP_NAME' => $group_helper->get_name($value['group_name']),
'GROUP_DESC' => generate_text_for_display($value['group_desc'], $value['group_desc_uid'], $value['group_desc_bitfield'], $value['group_desc_options']),
'GROUP_TYPE' => $value['group_type'],
'GROUP_ID' => $value['group_id'],
diff --git a/phpBB/includes/ucp/ucp_login_link.php b/phpBB/includes/ucp/ucp_login_link.php
index bfe4804286..902fbaafcf 100644
--- a/phpBB/includes/ucp/ucp_login_link.php
+++ b/phpBB/includes/ucp/ucp_login_link.php
@@ -57,6 +57,7 @@ class ucp_login_link
}
// Use the auth_provider requested even if different from configured
+ /* @var $provider_collection \phpbb\auth\provider_collection */
$provider_collection = $phpbb_container->get('auth.provider_collection');
$auth_provider = $provider_collection->get_provider($request->variable('auth_provider', ''));
diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php
index a1624e78ec..036025e84e 100644
--- a/phpBB/includes/ucp/ucp_main.php
+++ b/phpBB/includes/ucp/ucp_main.php
@@ -219,8 +219,8 @@ class ucp_main
{
if (check_form_key('ucp_front_subscribed'))
{
- $forums = array_keys(request_var('f', array(0 => 0)));
- $topics = array_keys(request_var('t', array(0 => 0)));
+ $forums = array_keys($request->variable('f', array(0 => 0)));
+ $topics = array_keys($request->variable('t', array(0 => 0)));
$msg = '';
if (sizeof($forums) || sizeof($topics))
@@ -401,7 +401,7 @@ class ucp_main
if (isset($_POST['unbookmark']))
{
$s_hidden_fields = array('unbookmark' => 1);
- $topics = (isset($_POST['t'])) ? array_keys(request_var('t', array(0 => 0))) : array();
+ $topics = (isset($_POST['t'])) ? array_keys($request->variable('t', array(0 => 0))) : array();
$url = $this->u_action;
if (!sizeof($topics))
@@ -457,7 +457,7 @@ class ucp_main
{
if (check_form_key('ucp_draft'))
{
- $drafts = array_keys(request_var('d', array(0 => 0)));
+ $drafts = array_keys($request->variable('d', array(0 => 0)));
if (sizeof($drafts))
{
@@ -480,8 +480,8 @@ class ucp_main
if ($submit && $edit)
{
- $draft_subject = utf8_normalize_nfc(request_var('subject', '', true));
- $draft_message = utf8_normalize_nfc(request_var('message', '', true));
+ $draft_subject = $request->variable('subject', '', true);
+ $draft_message = $request->variable('message', '', true);
if (check_form_key('ucp_draft'))
{
if ($draft_message && $draft_subject)
@@ -643,11 +643,12 @@ class ucp_main
*/
function assign_topiclist($mode = 'subscribed', $forbidden_forum_ary = array())
{
- global $user, $db, $template, $config, $cache, $auth, $phpbb_root_path, $phpEx, $phpbb_container;
+ global $user, $db, $template, $config, $cache, $auth, $phpbb_root_path, $phpEx, $phpbb_container, $request;
- $table = ($mode == 'subscribed') ? TOPICS_WATCH_TABLE : BOOKMARKS_TABLE;
- $start = request_var('start', 0);
+ /* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
+ $table = ($mode == 'subscribed') ? TOPICS_WATCH_TABLE : BOOKMARKS_TABLE;
+ $start = $request->variable('start', 0);
// Grab icons
$icons = $cache->obtain_icons();
@@ -769,6 +770,7 @@ class ucp_main
}
}
+ /* @var $phpbb_content_visibility \phpbb\content_visibility */
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
foreach ($topic_list as $topic_id)
diff --git a/phpBB/includes/ucp/ucp_notifications.php b/phpBB/includes/ucp/ucp_notifications.php
index 66dc651447..51bd77bd4c 100644
--- a/phpBB/includes/ucp/ucp_notifications.php
+++ b/phpBB/includes/ucp/ucp_notifications.php
@@ -34,7 +34,10 @@ class ucp_notifications
$form_time = $request->variable('form_time', 0);
$form_time = ($form_time <= 0 || $form_time > time()) ? time() : $form_time;
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
+
+ /* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
switch ($mode)
@@ -67,15 +70,6 @@ class ucp_notifications
$phpbb_notifications->delete_subscription($type, 0, $method_data['id']);
}
}
-
- if ($request->is_set_post(str_replace('.', '_', $type) . '_notification') && !isset($subscriptions[$type]))
- {
- $phpbb_notifications->add_subscription($type);
- }
- else if (!$request->is_set_post(str_replace('.', '_', $type) . '_notification') && isset($subscriptions[$type]))
- {
- $phpbb_notifications->delete_subscription($type);
- }
}
}
@@ -97,7 +91,7 @@ class ucp_notifications
// Mark all items read
if ($request->variable('mark', '') == 'all' && check_link_hash($request->variable('token', ''), 'mark_all_notifications_read'))
{
- $phpbb_notifications->mark_notifications_read(false, false, $user->data['user_id'], $form_time);
+ $phpbb_notifications->mark_notifications(false, false, $user->data['user_id'], $form_time);
meta_refresh(3, $this->u_action);
$message = $user->lang['NOTIFICATIONS_MARK_ALL_READ_SUCCESS'];
@@ -128,11 +122,11 @@ class ucp_notifications
if (!empty($mark_read))
{
- $phpbb_notifications->mark_notifications_read_by_id($mark_read, $form_time);
+ $phpbb_notifications->mark_notifications_by_id('notification.method.board', $mark_read, $form_time);
}
}
- $notifications = $phpbb_notifications->load_notifications(array(
+ $notifications = $phpbb_notifications->load_notifications('notification.method.board', array(
'start' => $start,
'limit' => $config['topics_per_page'],
'count_total' => true,
@@ -193,8 +187,6 @@ class ucp_notifications
'NAME' => $user->lang($data['lang']),
'EXPLAIN' => (isset($user->lang[$data['lang'] . '_EXPLAIN'])) ? $user->lang($data['lang'] . '_EXPLAIN') : '',
-
- 'SUBSCRIBED' => (isset($subscriptions[$type])) ? true : false,
));
foreach ($notification_methods as $method => $method_data)
diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php
index 425a56cf6c..5f24d05c8b 100644
--- a/phpBB/includes/ucp/ucp_pm.php
+++ b/phpBB/includes/ucp/ucp_pm.php
@@ -62,7 +62,7 @@ class ucp_pm
$template->assign_var('S_PRIVMSGS', true);
// Folder directly specified?
- $folder_specified = request_var('folder', '');
+ $folder_specified = $request->variable('folder', '');
if (!in_array($folder_specified, array('inbox', 'outbox', 'sentbox')))
{
@@ -75,7 +75,7 @@ class ucp_pm
if (!$folder_specified)
{
- $mode = (!$mode) ? request_var('mode', 'view') : $mode;
+ $mode = (!$mode) ? $request->variable('mode', 'view') : $mode;
}
else
{
@@ -88,7 +88,7 @@ class ucp_pm
{
// Compose message
case 'compose':
- $action = request_var('action', 'post');
+ $action = $request->variable('action', 'post');
$user_folders = get_folder($user->data['user_id']);
@@ -151,12 +151,12 @@ class ucp_pm
}
else
{
- $folder_id = request_var('f', PRIVMSGS_NO_BOX);
- $action = request_var('action', 'view_folder');
+ $folder_id = $request->variable('f', PRIVMSGS_NO_BOX);
+ $action = $request->variable('action', 'view_folder');
}
- $msg_id = request_var('p', 0);
- $view = request_var('view', '');
+ $msg_id = $request->variable('p', 0);
+ $view = $request->variable('view', '');
// View message if specified
if ($msg_id)
@@ -178,8 +178,8 @@ class ucp_pm
// First Handle Mark actions and moving messages
$submit_mark = (isset($_POST['submit_mark'])) ? true : false;
$move_pm = (isset($_POST['move_pm'])) ? true : false;
- $mark_option = request_var('mark_option', '');
- $dest_folder = request_var('dest_folder', PRIVMSGS_NO_BOX);
+ $mark_option = $request->variable('mark_option', '');
+ $dest_folder = $request->variable('dest_folder', PRIVMSGS_NO_BOX);
// Is moving PM triggered through mark options?
if (!in_array($mark_option, array('mark_important', 'delete_marked')) && $submit_mark)
@@ -192,8 +192,8 @@ class ucp_pm
// Move PM
if ($move_pm)
{
- $move_msg_ids = (isset($_POST['marked_msg_id'])) ? request_var('marked_msg_id', array(0)) : array();
- $cur_folder_id = request_var('cur_folder_id', PRIVMSGS_NO_BOX);
+ $move_msg_ids = (isset($_POST['marked_msg_id'])) ? $request->variable('marked_msg_id', array(0)) : array();
+ $cur_folder_id = $request->variable('cur_folder_id', PRIVMSGS_NO_BOX);
if (move_pm($user->data['user_id'], $user->data['message_limit'], $move_msg_ids, $dest_folder, $cur_folder_id))
{
@@ -201,7 +201,7 @@ class ucp_pm
if ($action == 'view_message')
{
$msg_id = 0;
- $folder_id = request_var('cur_folder_id', PRIVMSGS_NO_BOX);
+ $folder_id = $request->variable('cur_folder_id', PRIVMSGS_NO_BOX);
$action = 'view_folder';
}
}
@@ -215,7 +215,7 @@ class ucp_pm
// If new messages arrived, place them into the appropriate folder
$num_not_moved = $num_removed = 0;
- $release = request_var('release', 0);
+ $release = $request->variable('release', 0);
if ($user->data['user_new_privmsg'] && ($action == 'view_folder' || $action == 'view_message'))
{
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index 8b7d42e9c9..5c32a23ad6 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -44,14 +44,14 @@ function compose_pm($id, $mode, $action, $user_folders = array())
add_form_key('ucp_pm_compose');
// Grab only parameters needed here
- $to_user_id = request_var('u', 0);
- $to_group_id = request_var('g', 0);
- $msg_id = request_var('p', 0);
- $draft_id = request_var('d', 0);
- $lastclick = request_var('lastclick', 0);
+ $to_user_id = $request->variable('u', 0);
+ $to_group_id = $request->variable('g', 0);
+ $msg_id = $request->variable('p', 0);
+ $draft_id = $request->variable('d', 0);
+ $lastclick = $request->variable('lastclick', 0);
// Reply to all triggered (quote/reply)
- $reply_to_all = request_var('reply_to_all', 0);
+ $reply_to_all = $request->variable('reply_to_all', 0);
$address_list = $request->variable('address_list', array('' => array(0 => '')));
@@ -76,6 +76,9 @@ function compose_pm($id, $mode, $action, $user_folders = array())
$error = array();
$current_time = time();
+ /** @var \phpbb\group\helper $group_helper */
+ $group_helper = $phpbb_container->get('group_helper');
+
// Was cancel pressed? If so then redirect to the appropriate page
if ($cancel || ($current_time - $lastclick < 2 && $submit))
{
@@ -145,7 +148,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
$group_options = '';
while ($row = $db->sql_fetchrow($result))
{
- $group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
+ $group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '">' . $group_helper->get_name($row['group_name']) . '</option>';
}
$db->sql_freeresult($result);
}
@@ -484,8 +487,9 @@ function compose_pm($id, $mode, $action, $user_folders = array())
$icon_id = 0;
}
- $message_parser = new parse_message();
+ /* @var $plupload \phpbb\plupload\plupload */
$plupload = $phpbb_container->get('plupload');
+ $message_parser = new parse_message();
$message_parser->set_plupload($plupload);
$message_parser->message = ($action == 'reply') ? '' : $message_text;
@@ -498,7 +502,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
if ($action == 'delete')
{
// Folder id has been determined by the SQL Statement
- // $folder_id = request_var('f', PRIVMSGS_NO_BOX);
+ // $folder_id = $request->variable('f', PRIVMSGS_NO_BOX);
// Do we need to confirm ?
if (confirm_box(true))
@@ -529,15 +533,9 @@ function compose_pm($id, $mode, $action, $user_folders = array())
}
// Get maximum number of allowed recipients
- $sql = 'SELECT MAX(g.group_max_recipients) as max_recipients
- FROM ' . GROUPS_TABLE . ' g, ' . USER_GROUP_TABLE . ' ug
- WHERE ug.user_id = ' . $user->data['user_id'] . '
- AND ug.user_pending = 0
- AND ug.group_id = g.group_id';
- $result = $db->sql_query($sql);
- $max_recipients = (int) $db->sql_fetchfield('max_recipients');
- $db->sql_freeresult($result);
+ $max_recipients = phpbb_get_max_setting_from_group($db, $user->data['user_id'], 'max_recipients');
+ // If it is 0, there is no limit set and we use the maximum value within the config.
$max_recipients = (!$max_recipients) ? $config['pm_max_recipients'] : $max_recipients;
// If this is a quote/reply "to all"... we may increase the max_recpients to the number of original recipients
@@ -645,9 +643,9 @@ function compose_pm($id, $mode, $action, $user_folders = array())
// Save Draft
if ($save && $auth->acl_get('u_savedrafts'))
{
- $subject = utf8_normalize_nfc(request_var('subject', '', true));
+ $subject = $request->variable('subject', '', true);
$subject = (!$subject && $action != 'post') ? $user->lang['NEW_MESSAGE'] : $subject;
- $message = utf8_normalize_nfc(request_var('message', '', true));
+ $message = $request->variable('message', '', true);
if ($subject && $message)
{
@@ -741,10 +739,10 @@ function compose_pm($id, $mode, $action, $user_folders = array())
{
$error[] = $user->lang['FORM_INVALID'];
}
- $subject = utf8_normalize_nfc(request_var('subject', '', true));
- $message_parser->message = utf8_normalize_nfc(request_var('message', '', true));
+ $subject = $request->variable('subject', '', true);
+ $message_parser->message = $request->variable('message', '', true);
- $icon_id = request_var('icon', 0);
+ $icon_id = $request->variable('icon', 0);
$enable_bbcode = (!$bbcode_status || isset($_POST['disable_bbcode'])) ? false : true;
$enable_smilies = (!$smilies_status || isset($_POST['disable_smilies'])) ? false : true;
@@ -932,7 +930,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
{
if ($action == 'quotepost')
{
- $post_id = request_var('p', 0);
+ $post_id = $request->variable('p', 0);
if ($config['allow_post_links'])
{
$message_link = "[url=" . generate_board_url() . "/viewtopic.$phpEx?p={$post_id}#p{$post_id}]{$user->lang['SUBJECT']}{$user->lang['COLON']} {$message_subject}[/url]\n\n";
@@ -946,7 +944,20 @@ function compose_pm($id, $mode, $action, $user_folders = array())
{
$message_link = '';
}
- $message_parser->message = $message_link . '[quote=&quot;' . $quote_username . '&quot;]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
+ $quote_attributes = array(
+ 'author' => $quote_username,
+ 'time' => $post['message_time'],
+ 'user_id' => $post['author_id'],
+ );
+ if ($action === 'quotepost')
+ {
+ $quote_attributes['post_id'] = $post['msg_id'];
+ }
+ $quote_text = $phpbb_container->get('text_formatter.utils')->generate_quote(
+ censor_text($message_parser->message),
+ $quote_attributes
+ );
+ $message_parser->message = $message_link . $quote_text . "\n\n";
}
if (($action == 'reply' || $action == 'quote' || $action == 'quotepost') && !$preview && !$refresh)
@@ -974,7 +985,11 @@ function compose_pm($id, $mode, $action, $user_folders = array())
$forward_text[] = sprintf($user->lang['FWD_FROM'], $quote_username_text);
$forward_text[] = sprintf($user->lang['FWD_TO'], implode($user->lang['COMMA_SEPARATOR'], $fwd_to_field['to']));
- $message_parser->message = implode("\n", $forward_text) . "\n\n[quote=&quot;{$quote_username}&quot;]\n" . censor_text(trim($message_parser->message)) . "\n[/quote]";
+ $quote_text = $phpbb_container->get('text_formatter.utils')->generate_quote(
+ censor_text($message_parser->message),
+ array('author' => $quote_username)
+ );
+ $message_parser->message = implode("\n", $forward_text) . "\n\n" . $quote_text;
$message_subject = ((!preg_match('/^Fwd:/', $message_subject)) ? 'Fwd: ' : '') . censor_text($message_subject);
}
@@ -1047,7 +1062,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
{
if ($type == 'g')
{
- $row['name'] = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['name']] : $row['name'];
+ $row['name'] = $group_helper->get_name($row['name']);
}
${$type}[$row['id']] = array('name' => $row['name'], 'colour' => $row['colour']);
@@ -1145,6 +1160,9 @@ function compose_pm($id, $mode, $action, $user_folders = array())
$form_enctype = (@ini_get('file_uploads') == '0' || strtolower(@ini_get('file_uploads')) == 'off' || !$config['allow_pm_attach'] || !$auth->acl_get('u_pm_attach')) ? '' : ' enctype="multipart/form-data"';
+ /** @var \phpbb\controller\helper $controller_helper */
+ $controller_helper = $phpbb_container->get('controller.helper');
+
// Start assigning vars for main posting page ...
$template->assign_vars(array(
'L_POST_A' => $page_title,
@@ -1153,7 +1171,7 @@ function compose_pm($id, $mode, $action, $user_folders = array())
'SUBJECT' => (isset($message_subject)) ? $message_subject : '',
'MESSAGE' => $message_text,
- 'BBCODE_STATUS' => ($bbcode_status) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>'),
+ 'BBCODE_STATUS' => $user->lang(($bbcode_status ? 'BBCODE_IS_ON' : 'BBCODE_IS_OFF'), '<a href="' . $controller_helper->route('phpbb_help_bbcode_controller') . '">', '</a>'),
'IMG_STATUS' => ($img_status) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'],
'FLASH_STATUS' => ($flash_status) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'],
'SMILIES_STATUS' => ($smilies_status) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'],
@@ -1249,13 +1267,13 @@ function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove
}
// Add Selected Groups
- $group_list = request_var('group_list', array(0));
+ $group_list = $request->variable('group_list', array(0));
// Build usernames to add
- $usernames = request_var('username', '', true);
+ $usernames = $request->variable('username', '', true);
$usernames = (empty($usernames)) ? array() : array($usernames);
- $username_list = request_var('username_list', '', true);
+ $username_list = $request->variable('username_list', '', true);
if ($username_list)
{
$usernames = array_merge($usernames, explode("\n", $username_list));
@@ -1272,7 +1290,7 @@ function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove
$submit = false;
// Preview is only true if there was also a message entered
- if (request_var('message', ''))
+ if ($request->variable('message', ''))
{
$preview = true;
}
@@ -1404,7 +1422,7 @@ function handle_message_list_actions(&$address_list, &$error, $remove_u, $remove
}
/**
-* Build the hidden field for the recipients. Needed, as the variable is not read via request_var.
+* Build the hidden field for the recipients. Needed, as the variable is not read via $request->variable().
*/
function build_address_field($address_list)
{
diff --git a/phpBB/includes/ucp/ucp_pm_options.php b/phpBB/includes/ucp/ucp_pm_options.php
index d1fc9d2c62..2ccd4a7728 100644
--- a/phpBB/includes/ucp/ucp_pm_options.php
+++ b/phpBB/includes/ucp/ucp_pm_options.php
@@ -24,7 +24,7 @@ if (!defined('IN_PHPBB'))
*/
function message_options($id, $mode, $global_privmsgs_rules, $global_rule_conditions)
{
- global $phpbb_root_path, $phpEx, $user, $template, $auth, $config, $db;
+ global $phpbb_root_path, $phpEx, $user, $template, $auth, $config, $db, $request;
$redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&amp;mode=options");
@@ -37,7 +37,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
trigger_error('FORM_INVALID');
}
- $full_action = request_var('full_action', 0);
+ $full_action = $request->variable('full_action', 0);
$set_folder_id = 0;
switch ($full_action)
@@ -47,7 +47,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
break;
case 2:
- $set_folder_id = request_var('full_move_to', PRIVMSGS_INBOX);
+ $set_folder_id = $request->variable('full_move_to', PRIVMSGS_INBOX);
break;
case 3:
@@ -79,7 +79,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
{
if (check_form_key('ucp_pm_options'))
{
- $folder_name = utf8_normalize_nfc(request_var('foldername', '', true));
+ $folder_name = $request->variable('foldername', '', true);
$msg = '';
if ($folder_name)
@@ -135,8 +135,8 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
{
if (check_form_key('ucp_pm_options'))
{
- $new_folder_name = utf8_normalize_nfc(request_var('new_folder_name', '', true));
- $rename_folder_id= request_var('rename_folder_id', 0);
+ $new_folder_name = $request->variable('new_folder_name', '', true);
+ $rename_folder_id= $request->variable('rename_folder_id', 0);
if (!$new_folder_name)
{
@@ -178,11 +178,11 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
// Remove Folder
if (isset($_POST['remove_folder']))
{
- $remove_folder_id = request_var('remove_folder_id', 0);
+ $remove_folder_id = $request->variable('remove_folder_id', 0);
// Default to "move all messages to inbox"
- $remove_action = request_var('remove_action', 1);
- $move_to = request_var('move_to', PRIVMSGS_INBOX);
+ $remove_action = $request->variable('remove_action', 1);
+ $move_to = $request->variable('move_to', PRIVMSGS_INBOX);
// Move to same folder?
if ($remove_action == 1 && $remove_folder_id == $move_to)
@@ -291,13 +291,13 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
{
if (check_form_key('ucp_pm_options'))
{
- $check_option = request_var('check_option', 0);
- $rule_option = request_var('rule_option', 0);
- $cond_option = request_var('cond_option', '');
- $action_option = explode('|', request_var('action_option', ''));
- $rule_string = ($cond_option != 'none') ? utf8_normalize_nfc(request_var('rule_string', '', true)) : '';
- $rule_user_id = ($cond_option != 'none') ? request_var('rule_user_id', 0) : 0;
- $rule_group_id = ($cond_option != 'none') ? request_var('rule_group_id', 0) : 0;
+ $check_option = $request->variable('check_option', 0);
+ $rule_option = $request->variable('rule_option', 0);
+ $cond_option = $request->variable('cond_option', '');
+ $action_option = explode('|', $request->variable('action_option', ''));
+ $rule_string = ($cond_option != 'none') ? $request->variable('rule_string', '', true) : '';
+ $rule_user_id = ($cond_option != 'none') ? $request->variable('rule_user_id', 0) : 0;
+ $rule_group_id = ($cond_option != 'none') ? $request->variable('rule_group_id', 0) : 0;
$action = (int) $action_option[0];
$folder_id = (int) $action_option[1];
@@ -371,7 +371,7 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
// Remove Rule
if (isset($_POST['delete_rule']) && !isset($_POST['cancel']))
{
- $delete_id = array_keys(request_var('delete_rule', array(0 => 0)));
+ $delete_id = array_keys($request->variable('delete_rule', array(0 => 0)));
$delete_id = (!empty($delete_id[0])) ? $delete_id[0] : 0;
if (!$delete_id)
@@ -507,18 +507,20 @@ function message_options($id, $mode, $global_privmsgs_rules, $global_rule_condit
$rule_lang = $action_lang = $check_lang = array();
// Build all three language arrays
- preg_replace('#^((RULE|ACTION|CHECK)_([A-Z0-9_]+))$#e', "\${strtolower('\\2') . '_lang'}[constant('\\1')] = \$user->lang['PM_\\2']['\\3']", array_keys(get_defined_constants()));
+ preg_replace_callback('#^((RULE|ACTION|CHECK)_([A-Z0-9_]+))$#', function ($match) use(&$rule_lang, &$action_lang, &$check_lang, $user) {
+ ${strtolower($match[2]) . '_lang'}[constant($match[1])] = $user->lang['PM_' . $match[2]][$match[3]];
+ }, array_keys(get_defined_constants()));
/*
Rule Ordering:
-> CHECK_* -> RULE_* [IN $global_privmsgs_rules:CHECK_*] -> [IF $rule_conditions[RULE_*] [|text|bool|user|group|own_group]] -> ACTION_*
*/
- $check_option = request_var('check_option', 0);
- $rule_option = request_var('rule_option', 0);
- $cond_option = request_var('cond_option', '');
- $action_option = request_var('action_option', '');
- $back = (isset($_REQUEST['back'])) ? request_var('back', array('' => 0)) : array();
+ $check_option = $request->variable('check_option', 0);
+ $rule_option = $request->variable('rule_option', 0);
+ $cond_option = $request->variable('cond_option', '');
+ $action_option = $request->variable('action_option', '');
+ $back = (isset($_REQUEST['back'])) ? $request->variable('back', array('' => 0)) : array();
if (sizeof($back))
{
@@ -698,7 +700,10 @@ function define_rule_option($hardcoded, $rule_option, $rule_lang, $check_ary)
*/
function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule_conditions)
{
- global $db, $template, $auth, $user;
+ global $db, $template, $auth, $user, $request, $phpbb_container;
+
+ /** @var \phpbb\group\helper $group_helper */
+ $group_helper = $phpbb_container->get('group_helper');
$template->assign_vars(array(
'S_COND_DEFINED' => true,
@@ -722,7 +727,7 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
switch ($condition)
{
case 'text':
- $rule_string = utf8_normalize_nfc(request_var('rule_string', '', true));
+ $rule_string = $request->variable('rule_string', '', true);
$template->assign_vars(array(
'S_TEXT_CONDITION' => true,
@@ -735,8 +740,8 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
break;
case 'user':
- $rule_user_id = request_var('rule_user_id', 0);
- $rule_string = utf8_normalize_nfc(request_var('rule_string', '', true));
+ $rule_user_id = $request->variable('rule_user_id', 0);
+ $rule_string = $request->variable('rule_string', '', true);
if ($rule_string && !$rule_user_id)
{
@@ -778,8 +783,8 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
break;
case 'group':
- $rule_group_id = request_var('rule_group_id', 0);
- $rule_string = utf8_normalize_nfc(request_var('rule_string', '', true));
+ $rule_group_id = $request->variable('rule_group_id', 0);
+ $rule_string = $request->variable('rule_string', '', true);
$sql = 'SELECT g.group_id, g.group_name, g.group_type
FROM ' . GROUPS_TABLE . ' g ';
@@ -810,13 +815,13 @@ function define_cond_option($hardcoded, $cond_option, $rule_option, $global_rule
{
if ($rule_group_id && ($row['group_id'] == $rule_group_id))
{
- $rule_string = (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']);
+ $rule_string = $group_helper->get_name($row['group_name']);
}
$s_class = ($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '';
$s_selected = ($row['group_id'] == $rule_group_id) ? ' selected="selected"' : '';
- $s_group_options .= '<option value="' . $row['group_id'] . '"' . $s_class . $s_selected . '>' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
+ $s_group_options .= '<option value="' . $row['group_id'] . '"' . $s_class . $s_selected . '>' . $group_helper->get_name($row['group_name']) . '</option>';
}
$db->sql_freeresult($result);
diff --git a/phpBB/includes/ucp/ucp_pm_viewfolder.php b/phpBB/includes/ucp/ucp_pm_viewfolder.php
index 19acd9ecb9..e88e40a1cb 100644
--- a/phpBB/includes/ucp/ucp_pm_viewfolder.php
+++ b/phpBB/includes/ucp/ucp_pm_viewfolder.php
@@ -25,7 +25,7 @@ if (!defined('IN_PHPBB'))
*/
function view_folder($id, $mode, $folder_id, $folder)
{
- global $user, $template, $auth, $db, $cache;
+ global $user, $template, $auth, $db, $cache, $request;
global $phpbb_root_path, $config, $phpEx;
$submit_export = (isset($_POST['submit_export'])) ? true : false;
@@ -196,9 +196,9 @@ function view_folder($id, $mode, $folder_id, $folder)
}
else
{
- $export_type = request_var('export_option', '');
- $enclosure = request_var('enclosure', '');
- $delimiter = request_var('delimiter', '');
+ $export_type = $request->variable('export_option', '');
+ $enclosure = $request->variable('enclosure', '');
+ $delimiter = $request->variable('delimiter', '');
if ($export_type == 'CSV' && ($delimiter === '' || $enclosure === ''))
{
@@ -397,15 +397,16 @@ function view_folder($id, $mode, $folder_id, $folder)
*/
function get_pm_from($folder_id, $folder, $user_id)
{
- global $user, $db, $template, $config, $auth, $phpbb_container, $phpbb_root_path, $phpEx;
+ global $user, $db, $template, $config, $auth, $phpbb_container, $phpbb_root_path, $phpEx, $request;
- $start = request_var('start', 0);
+ $start = $request->variable('start', 0);
// Additional vars later, pm ordering is mostly different from post ordering. :/
- $sort_days = request_var('st', 0);
- $sort_key = request_var('sk', 't');
- $sort_dir = request_var('sd', 'd');
+ $sort_days = $request->variable('st', 0);
+ $sort_key = $request->variable('sk', 't');
+ $sort_dir = $request->variable('sd', 'd');
+ /* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
// PM ordering options
diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php
index d7b9b32dbf..3de3410ea8 100644
--- a/phpBB/includes/ucp/ucp_pm_viewmessage.php
+++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php
@@ -32,7 +32,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
$msg_id = (int) $msg_id;
$folder_id = (int) $folder_id;
$author_id = (int) $message_row['author_id'];
- $view = request_var('view', '');
+ $view = $request->variable('view', '');
// Not able to view message, it was deleted by the sender
if ($message_row['pm_deleted'])
@@ -56,6 +56,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
// Load the custom profile fields
if ($config['load_cpf_pm'])
{
+ /* @var $cp \phpbb\profilefields\manager */
$cp = $phpbb_container->get('profilefields.manager');
$profile_fields = $cp->grab_profile_fields_data($author_id);
@@ -231,7 +232,7 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
'U_DELETE' => ($auth->acl_get('u_pm_delete')) ? "$url&amp;mode=compose&amp;action=delete&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] : '',
'U_EMAIL' => $user_info['email'],
- 'U_REPORT' => ($config['allow_pm_report']) ? append_sid("{$phpbb_root_path}report.$phpEx", "pm=" . $message_row['msg_id']) : '',
+ 'U_REPORT' => ($config['allow_pm_report']) ? $phpbb_container->get('controller.helper')->route('phpbb_report_pm_controller', array('id' => $message_row['msg_id'])) : '',
'U_QUOTE' => ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&amp;mode=compose&amp;action=quote&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] : '',
'U_EDIT' => (($message_row['message_time'] > time() - ($config['pm_edit_time'] * 60) || !$config['pm_edit_time']) && $folder_id == PRIVMSGS_OUTBOX && $auth->acl_get('u_pm_edit')) ? "$url&amp;mode=compose&amp;action=edit&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] : '',
'U_POST_REPLY_PM' => ($auth->acl_get('u_sendpm') && $author_id != ANONYMOUS) ? "$url&amp;mode=compose&amp;action=reply&amp;f=$folder_id&amp;p=" . $message_row['msg_id'] : '',
diff --git a/phpBB/includes/ucp/ucp_prefs.php b/phpBB/includes/ucp/ucp_prefs.php
index 3c274b53c7..215a870007 100644
--- a/phpBB/includes/ucp/ucp_prefs.php
+++ b/phpBB/includes/ucp/ucp_prefs.php
@@ -29,7 +29,7 @@ class ucp_prefs
function main($id, $mode)
{
- global $config, $db, $user, $auth, $template, $phpbb_dispatcher, $phpbb_root_path, $phpEx;
+ global $config, $db, $user, $auth, $template, $phpbb_dispatcher, $phpbb_root_path, $phpEx, $request;
$submit = (isset($_POST['submit'])) ? true : false;
$error = $data = array();
@@ -40,16 +40,16 @@ class ucp_prefs
case 'personal':
add_form_key('ucp_prefs_personal');
$data = array(
- 'notifymethod' => request_var('notifymethod', $user->data['user_notify_type']),
- 'dateformat' => request_var('dateformat', $user->data['user_dateformat'], true),
- 'lang' => basename(request_var('lang', $user->data['user_lang'])),
- 'user_style' => request_var('user_style', (int) $user->data['user_style']),
- 'tz' => request_var('tz', $user->data['user_timezone']),
-
- 'viewemail' => request_var('viewemail', (bool) $user->data['user_allow_viewemail']),
- 'massemail' => request_var('massemail', (bool) $user->data['user_allow_massemail']),
- 'hideonline' => request_var('hideonline', (bool) !$user->data['user_allow_viewonline']),
- 'allowpm' => request_var('allowpm', (bool) $user->data['user_allow_pm']),
+ 'notifymethod' => $request->variable('notifymethod', $user->data['user_notify_type']),
+ 'dateformat' => $request->variable('dateformat', $user->data['user_dateformat'], true),
+ 'lang' => basename($request->variable('lang', $user->data['user_lang'])),
+ 'user_style' => $request->variable('user_style', (int) $user->data['user_style']),
+ 'tz' => $request->variable('tz', $user->data['user_timezone']),
+
+ 'viewemail' => $request->variable('viewemail', (bool) $user->data['user_allow_viewemail']),
+ 'massemail' => $request->variable('massemail', (bool) $user->data['user_allow_massemail']),
+ 'hideonline' => $request->variable('hideonline', (bool) !$user->data['user_allow_viewonline']),
+ 'allowpm' => $request->variable('allowpm', (bool) $user->data['user_allow_pm']),
);
if ($data['notifymethod'] == NOTIFY_IM && (!$config['jab_enable'] || !$user->data['user_jabber'] || !@extension_loaded('xml')))
@@ -221,20 +221,20 @@ class ucp_prefs
add_form_key('ucp_prefs_view');
$data = array(
- 'topic_sk' => request_var('topic_sk', (!empty($user->data['user_topic_sortby_type'])) ? $user->data['user_topic_sortby_type'] : 't'),
- 'topic_sd' => request_var('topic_sd', (!empty($user->data['user_topic_sortby_dir'])) ? $user->data['user_topic_sortby_dir'] : 'd'),
- 'topic_st' => request_var('topic_st', (!empty($user->data['user_topic_show_days'])) ? (int) $user->data['user_topic_show_days'] : 0),
-
- 'post_sk' => request_var('post_sk', (!empty($user->data['user_post_sortby_type'])) ? $user->data['user_post_sortby_type'] : 't'),
- 'post_sd' => request_var('post_sd', (!empty($user->data['user_post_sortby_dir'])) ? $user->data['user_post_sortby_dir'] : 'a'),
- 'post_st' => request_var('post_st', (!empty($user->data['user_post_show_days'])) ? (int) $user->data['user_post_show_days'] : 0),
-
- 'images' => request_var('images', (bool) $user->optionget('viewimg')),
- 'flash' => request_var('flash', (bool) $user->optionget('viewflash')),
- 'smilies' => request_var('smilies', (bool) $user->optionget('viewsmilies')),
- 'sigs' => request_var('sigs', (bool) $user->optionget('viewsigs')),
- 'avatars' => request_var('avatars', (bool) $user->optionget('viewavatars')),
- 'wordcensor' => request_var('wordcensor', (bool) $user->optionget('viewcensors')),
+ 'topic_sk' => $request->variable('topic_sk', (!empty($user->data['user_topic_sortby_type'])) ? $user->data['user_topic_sortby_type'] : 't'),
+ 'topic_sd' => $request->variable('topic_sd', (!empty($user->data['user_topic_sortby_dir'])) ? $user->data['user_topic_sortby_dir'] : 'd'),
+ 'topic_st' => $request->variable('topic_st', (!empty($user->data['user_topic_show_days'])) ? (int) $user->data['user_topic_show_days'] : 0),
+
+ 'post_sk' => $request->variable('post_sk', (!empty($user->data['user_post_sortby_type'])) ? $user->data['user_post_sortby_type'] : 't'),
+ 'post_sd' => $request->variable('post_sd', (!empty($user->data['user_post_sortby_dir'])) ? $user->data['user_post_sortby_dir'] : 'a'),
+ 'post_st' => $request->variable('post_st', (!empty($user->data['user_post_show_days'])) ? (int) $user->data['user_post_show_days'] : 0),
+
+ 'images' => $request->variable('images', (bool) $user->optionget('viewimg')),
+ 'flash' => $request->variable('flash', (bool) $user->optionget('viewflash')),
+ 'smilies' => $request->variable('smilies', (bool) $user->optionget('viewsmilies')),
+ 'sigs' => $request->variable('sigs', (bool) $user->optionget('viewsigs')),
+ 'avatars' => $request->variable('avatars', (bool) $user->optionget('viewavatars')),
+ 'wordcensor' => $request->variable('wordcensor', (bool) $user->optionget('viewcensors')),
);
/**
@@ -393,10 +393,10 @@ class ucp_prefs
case 'post':
$data = array(
- 'bbcode' => request_var('bbcode', $user->optionget('bbcode')),
- 'smilies' => request_var('smilies', $user->optionget('smilies')),
- 'sig' => request_var('sig', $user->optionget('attachsig')),
- 'notify' => request_var('notify', (bool) $user->data['user_notify']),
+ 'bbcode' => $request->variable('bbcode', $user->optionget('bbcode')),
+ 'smilies' => $request->variable('smilies', $user->optionget('smilies')),
+ 'sig' => $request->variable('sig', $user->optionget('attachsig')),
+ 'notify' => $request->variable('notify', (bool) $user->data['user_notify']),
);
add_form_key('ucp_prefs_post');
diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php
index 8d8d42e742..2f4d650ed0 100644
--- a/phpBB/includes/ucp/ucp_profile.php
+++ b/phpBB/includes/ucp/ucp_profile.php
@@ -32,11 +32,10 @@ class ucp_profile
function main($id, $mode)
{
global $cache, $config, $db, $user, $auth, $template, $phpbb_root_path, $phpEx;
- global $request, $phpbb_container, $phpbb_dispatcher;
+ global $request, $phpbb_container, $phpbb_log, $phpbb_dispatcher;
$user->add_lang('posting');
- $preview = $request->variable('preview', false, false, \phpbb\request\request_interface::POST);
$submit = $request->variable('submit', false, false, \phpbb\request\request_interface::POST);
$delete = $request->variable('delete', false, false, \phpbb\request\request_interface::POST);
$error = $data = array();
@@ -47,8 +46,8 @@ class ucp_profile
case 'reg_details':
$data = array(
- 'username' => utf8_normalize_nfc(request_var('username', $user->data['username'], true)),
- 'email' => strtolower(request_var('email', $user->data['user_email'])),
+ 'username' => $request->variable('username', $user->data['username'], true),
+ 'email' => strtolower($request->variable('email', $user->data['user_email'])),
'new_password' => $request->variable('new_password', '', true),
'cur_password' => $request->variable('cur_password', '', true),
'password_confirm' => $request->variable('password_confirm', '', true),
@@ -96,6 +95,7 @@ class ucp_profile
}
// Instantiate passwords manager
+ /* @var $passwords_manager \phpbb\passwords\manager */
$passwords_manager = $phpbb_container->get('passwords.manager');
// Only check the new password against the previous password if there have been no errors
@@ -139,18 +139,30 @@ class ucp_profile
if ($auth->acl_get('u_chgname') && $config['allow_namechange'] && $data['username'] != $user->data['username'])
{
- add_log('user', $user->data['user_id'], 'LOG_USER_UPDATE_NAME', $user->data['username'], $data['username']);
+ $phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_UPDATE_NAME', false, array(
+ 'reportee_id' => $user->data['user_id'],
+ $user->data['username'],
+ $data['username']
+ ));
}
if ($auth->acl_get('u_chgpasswd') && $data['new_password'] && !$passwords_manager->check($data['new_password'], $user->data['user_password']))
{
$user->reset_login_keys();
- add_log('user', $user->data['user_id'], 'LOG_USER_NEW_PASSWORD', $data['username']);
+ $phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_NEW_PASSWORD', false, array(
+ 'reportee_id' => $user->data['user_id'],
+ $user->data['username']
+ ));
}
if ($auth->acl_get('u_chgemail') && $data['email'] != $user->data['user_email'])
{
- add_log('user', $user->data['user_id'], 'LOG_USER_UPDATE_EMAIL', $data['username'], $user->data['user_email'], $data['email']);
+ $phpbb_log->add('user', $user->data['user_id'], $user->ip, 'LOG_USER_UPDATE_EMAIL', false, array(
+ 'reportee_id' => $user->data['user_id'],
+ $user->data['username'],
+ $data['user_email'],
+ $data['email']
+ ));
}
$message = 'PROFILE_UPDATED';
@@ -296,12 +308,13 @@ class ucp_profile
trigger_error('NO_AUTH_PROFILEINFO');
}
+ /* @var $cp \phpbb\profilefields\manager */
$cp = $phpbb_container->get('profilefields.manager');
$cp_data = $cp_error = array();
$data = array(
- 'jabber' => utf8_normalize_nfc(request_var('jabber', $user->data['user_jabber'], true)),
+ 'jabber' => $request->variable('jabber', $user->data['user_jabber'], true),
);
if ($config['allow_birthdays'])
@@ -313,9 +326,9 @@ class ucp_profile
list($data['bday_day'], $data['bday_month'], $data['bday_year']) = explode('-', $user->data['user_birthday']);
}
- $data['bday_day'] = request_var('bday_day', $data['bday_day']);
- $data['bday_month'] = request_var('bday_month', $data['bday_month']);
- $data['bday_year'] = request_var('bday_year', $data['bday_year']);
+ $data['bday_day'] = $request->variable('bday_day', $data['bday_day']);
+ $data['bday_month'] = $request->variable('bday_month', $data['bday_month']);
+ $data['bday_year'] = $request->variable('bday_year', $data['bday_year']);
$data['user_birthday'] = sprintf('%2d-%2d-%4d', $data['bday_day'], $data['bday_month'], $data['bday_year']);
}
@@ -484,86 +497,82 @@ class ucp_profile
include($phpbb_root_path . 'includes/functions_posting.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
- $enable_bbcode = ($config['allow_sig_bbcode']) ? (bool) $user->optionget('sig_bbcode') : false;
- $enable_smilies = ($config['allow_sig_smilies']) ? (bool) $user->optionget('sig_smilies') : false;
- $enable_urls = ($config['allow_sig_links']) ? (bool) $user->optionget('sig_links') : false;
+ $enable_bbcode = ($config['allow_sig_bbcode']) ? $user->optionget('sig_bbcode') : false;
+ $enable_smilies = ($config['allow_sig_smilies']) ? $user->optionget('sig_smilies') : false;
+ $enable_urls = ($config['allow_sig_links']) ? $user->optionget('sig_links') : false;
- $signature = utf8_normalize_nfc(request_var('signature', (string) $user->data['user_sig'], true));
+ $decoded_message = generate_text_for_edit($user->data['user_sig'], $user->data['user_sig_bbcode_uid'], $user->data['user_sig_bbcode_bitfield']);
+ $signature = $request->variable('signature', $decoded_message['text'], true);
+ $signature_preview = '';
- add_form_key('ucp_sig');
-
- if ($submit || $preview)
+ if ($submit || $request->is_set_post('preview'))
{
- include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
-
- $enable_bbcode = ($config['allow_sig_bbcode']) ? ((request_var('disable_bbcode', false)) ? false : true) : false;
- $enable_smilies = ($config['allow_sig_smilies']) ? ((request_var('disable_smilies', false)) ? false : true) : false;
- $enable_urls = ($config['allow_sig_links']) ? ((request_var('disable_magic_url', false)) ? false : true) : false;
+ $enable_bbcode = ($config['allow_sig_bbcode']) ? !$request->variable('disable_bbcode', false) : false;
+ $enable_smilies = ($config['allow_sig_smilies']) ? !$request->variable('disable_smilies', false) : false;
+ $enable_urls = ($config['allow_sig_links']) ? !$request->variable('disable_magic_url', false) : false;
- if (!sizeof($error))
+ if (!check_form_key('ucp_sig'))
{
- $message_parser = new parse_message($signature);
+ $error[] = 'FORM_INVALID';
+ }
+ }
- // Allowing Quote BBCode
- $message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, $config['allow_sig_links'], true, 'sig');
+ $bbcode_uid = $bbcode_bitfield = $bbcode_flags = '';
+ $warn_msg = generate_text_for_storage($signature, $bbcode_uid, $bbcode_bitfield, $bbcode_flags, $enable_bbcode, $enable_urls, $enable_smilies);
- if (sizeof($message_parser->warn_msg))
- {
- $error[] = implode('<br />', $message_parser->warn_msg);
- }
+ if (sizeof($warn_msg))
+ {
+ $error += $warn_msg;
+ }
- if (!check_form_key('ucp_sig'))
- {
- $error[] = 'FORM_INVALID';
- }
+ if (!$submit)
+ {
+ // Parse it for displaying
+ $signature_preview = generate_text_for_display($signature, $bbcode_uid, $bbcode_bitfield, $bbcode_flags);
+ }
+ else
+ {
+ if (!sizeof($error))
+ {
+ $user->optionset('sig_bbcode', $enable_bbcode);
+ $user->optionset('sig_smilies', $enable_smilies);
+ $user->optionset('sig_links', $enable_urls);
- if (!sizeof($error) && $submit)
- {
- $user->optionset('sig_bbcode', $enable_bbcode);
- $user->optionset('sig_smilies', $enable_smilies);
- $user->optionset('sig_links', $enable_urls);
-
- $sql_ary = array(
- 'user_sig' => (string) $message_parser->message,
- 'user_options' => $user->data['user_options'],
- 'user_sig_bbcode_uid' => (string) $message_parser->bbcode_uid,
- 'user_sig_bbcode_bitfield' => $message_parser->bbcode_bitfield
- );
+ $sql_ary = array(
+ 'user_sig' => $signature,
+ 'user_options' => $user->data['user_options'],
+ 'user_sig_bbcode_uid' => $bbcode_uid,
+ 'user_sig_bbcode_bitfield' => $bbcode_bitfield
+ );
- $sql = 'UPDATE ' . USERS_TABLE . '
- SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
- WHERE user_id = ' . $user->data['user_id'];
- $db->sql_query($sql);
+ $sql = 'UPDATE ' . USERS_TABLE . '
+ SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
+ WHERE user_id = ' . $user->data['user_id'];
+ $db->sql_query($sql);
- $message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
- trigger_error($message);
- }
+ $message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], '<a href="' . $this->u_action . '">', '</a>');
+ trigger_error($message);
}
-
- // Replace "error" strings with their real, localised form
- $error = array_map(array($user, 'lang'), $error);
}
- $signature_preview = '';
- if ($preview)
- {
- // Now parse it for displaying
- $signature_preview = $message_parser->format_display($enable_bbcode, $enable_urls, $enable_smilies, false);
- unset($message_parser);
- }
+ // Replace "error" strings with their real, localised form
+ $error = array_map(array($user, 'lang'), $error);
+
+ $decoded_message = generate_text_for_edit($signature, $bbcode_uid, $bbcode_bitfield);
- decode_message($signature, $user->data['user_sig_bbcode_uid']);
+ /** @var \phpbb\controller\helper $controller_helper */
+ $controller_helper = $phpbb_container->get('controller.helper');
$template->assign_vars(array(
'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
- 'SIGNATURE' => $signature,
+ 'SIGNATURE' => $decoded_message['text'],
'SIGNATURE_PREVIEW' => $signature_preview,
'S_BBCODE_CHECKED' => (!$enable_bbcode) ? ' checked="checked"' : '',
'S_SMILIES_CHECKED' => (!$enable_smilies) ? ' checked="checked"' : '',
'S_MAGIC_URL_CHECKED' => (!$enable_urls) ? ' checked="checked"' : '',
- 'BBCODE_STATUS' => ($config['allow_sig_bbcode']) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>'),
+ 'BBCODE_STATUS' => $user->lang(($config['allow_sig_bbcode'] ? 'BBCODE_IS_ON' : 'BBCODE_IS_OFF'), '<a href="' . $controller_helper->route('phpbb_help_bbcode_controller') . '">', '</a>'),
'SMILIES_STATUS' => ($config['allow_sig_smilies']) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'],
'IMG_STATUS' => ($config['allow_sig_img']) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'],
'FLASH_STATUS' => ($config['allow_sig_flash']) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'],
@@ -579,6 +588,8 @@ class ucp_profile
'S_LINKS_ALLOWED' => ($config['allow_sig_links']) ? true : false)
);
+ add_form_key('ucp_sig');
+
// Build custom bbcodes array
display_custom_bbcodes();
@@ -595,6 +606,7 @@ class ucp_profile
if ($config['allow_avatar'] && $auth->acl_get('u_chgavatar'))
{
+ /* @var $phpbb_avatar_manager \phpbb\avatar\manager */
$phpbb_avatar_manager = $phpbb_container->get('avatar.manager');
$avatar_drivers = $phpbb_avatar_manager->get_enabled_drivers();
@@ -713,7 +725,7 @@ class ucp_profile
if ($submit)
{
- $keys = request_var('keys', array(''));
+ $keys = $request->variable('keys', array(''));
if (!check_form_key('ucp_autologin_keys'))
{
diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php
index 3426af95d0..4f9639114f 100644
--- a/phpBB/includes/ucp/ucp_register.php
+++ b/phpBB/includes/ucp/ucp_register.php
@@ -42,8 +42,8 @@ class ucp_register
$coppa = $request->is_set('coppa') ? (int) $request->variable('coppa', false) : false;
$agreed = $request->variable('agreed', false);
$submit = $request->is_set_post('submit');
- $change_lang = request_var('change_lang', '');
- $user_lang = request_var('lang', $user->lang_name);
+ $change_lang = $request->variable('change_lang', '');
+ $user_lang = $request->variable('lang', $user->lang_name);
if ($agreed)
{
@@ -77,6 +77,7 @@ class ucp_register
}
}
+ /* @var $cp \phpbb\profilefields\manager */
$cp = $phpbb_container->get('profilefields.manager');
$error = $cp_data = $cp_error = array();
@@ -88,6 +89,7 @@ class ucp_register
if (!empty($login_link_data))
{
// Confirm that we have all necessary data
+ /* @var $provider_collection \phpbb\auth\provider_collection */
$provider_collection = $phpbb_container->get('auth.provider_collection');
$auth_provider = $provider_collection->get_provider($request->variable('auth_provider', ''));
@@ -113,10 +115,10 @@ class ucp_register
{
// We do not include the password
$s_hidden_fields = array_merge($s_hidden_fields, array(
- 'username' => utf8_normalize_nfc(request_var('username', '', true)),
- 'email' => strtolower(request_var('email', '')),
+ 'username' => $request->variable('username', '', true),
+ 'email' => strtolower($request->variable('email', '')),
'lang' => $user->lang_name,
- 'tz' => request_var('tz', $config['board_timezone']),
+ 'tz' => $request->variable('tz', $config['board_timezone']),
));
}
@@ -200,12 +202,12 @@ class ucp_register
$timezone = $config['board_timezone'];
$data = array(
- 'username' => utf8_normalize_nfc(request_var('username', '', true)),
+ 'username' => $request->variable('username', '', true),
'new_password' => $request->variable('new_password', '', true),
'password_confirm' => $request->variable('password_confirm', '', true),
- 'email' => strtolower(request_var('email', '')),
- 'lang' => basename(request_var('lang', $user->lang_name)),
- 'tz' => request_var('tz', $timezone),
+ 'email' => strtolower($request->variable('email', '')),
+ 'lang' => basename($request->variable('lang', $user->lang_name)),
+ 'tz' => $request->variable('tz', $timezone),
);
/**
* Add UCP register data before they are assigned to the template or submitted
@@ -334,6 +336,7 @@ class ucp_register
}
// Instantiate passwords manager
+ /* @var $passwords_manager \phpbb\passwords\manager */
$passwords_manager = $phpbb_container->get('passwords.manager');
$user_row = array(
@@ -439,6 +442,7 @@ class ucp_register
if ($config['require_activation'] == USER_ACTIVATION_ADMIN)
{
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
$phpbb_notifications->add_notifications('notification.type.admin_activate_user', array(
'user_id' => $user_id,
diff --git a/phpBB/includes/ucp/ucp_remind.php b/phpBB/includes/ucp/ucp_remind.php
index 415bf0e84d..2342aa2137 100644
--- a/phpBB/includes/ucp/ucp_remind.php
+++ b/phpBB/includes/ucp/ucp_remind.php
@@ -29,7 +29,7 @@ class ucp_remind
function main($id, $mode)
{
- global $config, $phpbb_root_path, $phpEx;
+ global $config, $phpbb_root_path, $phpEx, $request;
global $db, $user, $auth, $template, $phpbb_container;
if (!$config['allow_password_reset'])
@@ -37,8 +37,8 @@ class ucp_remind
trigger_error($user->lang('UCP_PASSWORD_RESET_DISABLED', '<a href="mailto:' . htmlspecialchars($config['board_contact']) . '">', '</a>'));
}
- $username = request_var('username', '', true);
- $email = strtolower(request_var('email', ''));
+ $username = $request->variable('username', '', true);
+ $email = strtolower($request->variable('email', ''));
$submit = (isset($_POST['submit'])) ? true : false;
if ($submit)
@@ -92,6 +92,7 @@ class ucp_remind
$user_actkey = gen_rand_string(mt_rand(6, 10));
// Instantiate passwords manager
+ /* @var $manager \phpbb\passwords\manager */
$passwords_manager = $phpbb_container->get('passwords.manager');
$sql = 'UPDATE ' . USERS_TABLE . "
diff --git a/phpBB/includes/ucp/ucp_resend.php b/phpBB/includes/ucp/ucp_resend.php
index 9fe8850000..44c54100cd 100644
--- a/phpBB/includes/ucp/ucp_resend.php
+++ b/phpBB/includes/ucp/ucp_resend.php
@@ -30,10 +30,10 @@ class ucp_resend
function main($id, $mode)
{
global $config, $phpbb_root_path, $phpEx;
- global $db, $user, $auth, $template;
+ global $db, $user, $auth, $template, $request;
- $username = request_var('username', '', true);
- $email = strtolower(request_var('email', ''));
+ $username = $request->variable('username', '', true);
+ $email = strtolower($request->variable('email', ''));
$submit = (isset($_POST['submit'])) ? true : false;
add_form_key('ucp_resend');
diff --git a/phpBB/includes/ucp/ucp_zebra.php b/phpBB/includes/ucp/ucp_zebra.php
index dbf8cf31c1..d4e7e70247 100644
--- a/phpBB/includes/ucp/ucp_zebra.php
+++ b/phpBB/includes/ucp/ucp_zebra.php
@@ -44,7 +44,7 @@ class ucp_zebra
foreach ($var_ary as $var => $default)
{
- $data[$var] = request_var($var, $default, true);
+ $data[$var] = $request->variable($var, $default, true);
}
if (!empty($data['add']) || sizeof($data['usernames']))
diff --git a/phpBB/includes/utf/data/utf_canonical_comp.php b/phpBB/includes/utf/data/utf_canonical_comp.php
deleted file mode 100644
index 2de3149ee8..0000000000
--- a/phpBB/includes/utf/data/utf_canonical_comp.php
+++ /dev/null
@@ -1,2 +0,0 @@
-<?php
-$GLOBALS['utf_canonical_comp']=array('AÌ€'=>'À','AÌ'=>'Ã','AÌ‚'=>'Â','Ã'=>'Ã','Ä'=>'Ä','AÌŠ'=>'Ã…','Ç'=>'Ç','EÌ€'=>'È','EÌ'=>'É','EÌ‚'=>'Ê','Ë'=>'Ë','IÌ€'=>'ÃŒ','IÌ'=>'Ã','IÌ‚'=>'ÃŽ','Ï'=>'Ã','Ñ'=>'Ñ','OÌ€'=>'Ã’','OÌ'=>'Ó','OÌ‚'=>'Ô','Õ'=>'Õ','Ö'=>'Ö','UÌ€'=>'Ù','UÌ'=>'Ú','UÌ‚'=>'Û','Ü'=>'Ãœ','YÌ'=>'Ã','aÌ€'=>'à','aÌ'=>'á','aÌ‚'=>'â','ã'=>'ã','ä'=>'ä','aÌŠ'=>'Ã¥','ç'=>'ç','eÌ€'=>'è','eÌ'=>'é','eÌ‚'=>'ê','ë'=>'ë','iÌ€'=>'ì','iÌ'=>'í','iÌ‚'=>'î','ï'=>'ï','ñ'=>'ñ','oÌ€'=>'ò','oÌ'=>'ó','oÌ‚'=>'ô','õ'=>'õ','ö'=>'ö','uÌ€'=>'ù','uÌ'=>'ú','uÌ‚'=>'û','ü'=>'ü','yÌ'=>'ý','ÿ'=>'ÿ','AÌ„'=>'Ä€','aÌ„'=>'Ä','Ă'=>'Ä‚','ă'=>'ă','Ą'=>'Ä„','ą'=>'Ä…','CÌ'=>'Ć','cÌ'=>'ć','CÌ‚'=>'Ĉ','cÌ‚'=>'ĉ','Ċ'=>'ÄŠ','ċ'=>'Ä‹','CÌŒ'=>'ÄŒ','cÌŒ'=>'Ä','DÌŒ'=>'ÄŽ','dÌŒ'=>'Ä','EÌ„'=>'Ä’','eÌ„'=>'Ä“','Ĕ'=>'Ä”','ĕ'=>'Ä•','Ė'=>'Ä–','ė'=>'Ä—','Ę'=>'Ę','ę'=>'Ä™','EÌŒ'=>'Äš','eÌŒ'=>'Ä›','GÌ‚'=>'Äœ','gÌ‚'=>'Ä','Ğ'=>'Äž','ğ'=>'ÄŸ','Ġ'=>'Ä ','ġ'=>'Ä¡','Ģ'=>'Ä¢','ģ'=>'Ä£','HÌ‚'=>'Ĥ','hÌ‚'=>'Ä¥','Ĩ'=>'Ĩ','ĩ'=>'Ä©','IÌ„'=>'Ī','iÌ„'=>'Ä«','Ĭ'=>'Ĭ','ĭ'=>'Ä­','Į'=>'Ä®','į'=>'į','İ'=>'Ä°','JÌ‚'=>'Ä´','jÌ‚'=>'ĵ','Ķ'=>'Ķ','ķ'=>'Ä·','LÌ'=>'Ĺ','lÌ'=>'ĺ','Ļ'=>'Ä»','ļ'=>'ļ','LÌŒ'=>'Ľ','lÌŒ'=>'ľ','NÌ'=>'Ń','nÌ'=>'Å„','Ņ'=>'Å…','ņ'=>'ņ','NÌŒ'=>'Ň','nÌŒ'=>'ň','OÌ„'=>'ÅŒ','oÌ„'=>'Å','Ŏ'=>'ÅŽ','ŏ'=>'Å','OÌ‹'=>'Å','oÌ‹'=>'Å‘','RÌ'=>'Å”','rÌ'=>'Å•','Ŗ'=>'Å–','ŗ'=>'Å—','RÌŒ'=>'Ř','rÌŒ'=>'Å™','SÌ'=>'Åš','sÌ'=>'Å›','SÌ‚'=>'Åœ','sÌ‚'=>'Å','Ş'=>'Åž','ş'=>'ÅŸ','SÌŒ'=>'Å ','sÌŒ'=>'Å¡','Ţ'=>'Å¢','ţ'=>'Å£','TÌŒ'=>'Ť','tÌŒ'=>'Å¥','Ũ'=>'Ũ','ũ'=>'Å©','UÌ„'=>'Ū','uÌ„'=>'Å«','Ŭ'=>'Ŭ','ŭ'=>'Å­','UÌŠ'=>'Å®','uÌŠ'=>'ů','UÌ‹'=>'Å°','uÌ‹'=>'ű','Ų'=>'Ų','ų'=>'ų','WÌ‚'=>'Å´','wÌ‚'=>'ŵ','YÌ‚'=>'Ŷ','yÌ‚'=>'Å·','Ÿ'=>'Ÿ','ZÌ'=>'Ź','zÌ'=>'ź','Ż'=>'Å»','ż'=>'ż','ZÌŒ'=>'Ž','zÌŒ'=>'ž','OÌ›'=>'Æ ','oÌ›'=>'Æ¡','UÌ›'=>'Ư','uÌ›'=>'Æ°','AÌŒ'=>'Ç','aÌŒ'=>'ÇŽ','IÌŒ'=>'Ç','iÌŒ'=>'Ç','OÌŒ'=>'Ç‘','oÌŒ'=>'Ç’','UÌŒ'=>'Ç“','uÌŒ'=>'Ç”','Ǖ'=>'Ç•','ǖ'=>'Ç–','ÃœÌ'=>'Ç—','üÌ'=>'ǘ','Ǚ'=>'Ç™','ǚ'=>'Çš','Ǜ'=>'Ç›','ǜ'=>'Çœ','Ǟ'=>'Çž','ǟ'=>'ÇŸ','Ǡ'=>'Ç ','ǡ'=>'Ç¡','Ǣ'=>'Ç¢','ǣ'=>'Ç£','GÌŒ'=>'Ǧ','gÌŒ'=>'ǧ','KÌŒ'=>'Ǩ','kÌŒ'=>'Ç©','Ǫ'=>'Ǫ','ǫ'=>'Ç«','Ǭ'=>'Ǭ','Ç«Ì„'=>'Ç­','Æ·ÌŒ'=>'Ç®','Ê’ÌŒ'=>'ǯ','jÌŒ'=>'Ç°','GÌ'=>'Ç´','gÌ'=>'ǵ','NÌ€'=>'Ǹ','nÌ€'=>'ǹ','Ã…Ì'=>'Ǻ','Ã¥Ì'=>'Ç»','ÆÌ'=>'Ǽ','æÌ'=>'ǽ','ØÌ'=>'Ǿ','øÌ'=>'Ç¿','AÌ'=>'È€','aÌ'=>'È','AÌ‘'=>'È‚','aÌ‘'=>'ȃ','EÌ'=>'È„','eÌ'=>'È…','EÌ‘'=>'Ȇ','eÌ‘'=>'ȇ','IÌ'=>'Ȉ','iÌ'=>'ȉ','IÌ‘'=>'ÈŠ','iÌ‘'=>'È‹','OÌ'=>'ÈŒ','oÌ'=>'È','OÌ‘'=>'ÈŽ','oÌ‘'=>'È','RÌ'=>'È','rÌ'=>'È‘','RÌ‘'=>'È’','rÌ‘'=>'È“','UÌ'=>'È”','uÌ'=>'È•','UÌ‘'=>'È–','uÌ‘'=>'È—','Ș'=>'Ș','ș'=>'È™','Ț'=>'Èš','ț'=>'È›','HÌŒ'=>'Èž','hÌŒ'=>'ÈŸ','Ȧ'=>'Ȧ','ȧ'=>'ȧ','Ȩ'=>'Ȩ','ȩ'=>'È©','Ȫ'=>'Ȫ','ȫ'=>'È«','Ȭ'=>'Ȭ','ȭ'=>'È­','Ȯ'=>'È®','ȯ'=>'ȯ','Ȱ'=>'È°','ȱ'=>'ȱ','YÌ„'=>'Ȳ','yÌ„'=>'ȳ','̈Ì'=>'Í„','¨Ì'=>'Î…','ΑÌ'=>'Ά','ΕÌ'=>'Έ','ΗÌ'=>'Ή','ΙÌ'=>'Ί','ΟÌ'=>'ÎŒ','Î¥Ì'=>'ÎŽ','ΩÌ'=>'Î','ÏŠÌ'=>'Î','Ϊ'=>'Ϊ','Ϋ'=>'Ϋ','αÌ'=>'ά','εÌ'=>'έ','ηÌ'=>'ή','ιÌ'=>'ί','Ï‹Ì'=>'ΰ','ϊ'=>'ÏŠ','ϋ'=>'Ï‹','οÌ'=>'ÏŒ','Ï…Ì'=>'Ï','ωÌ'=>'ÏŽ','Ï’Ì'=>'Ï“','ϔ'=>'Ï”','Ѐ'=>'Ѐ','Ё'=>'Ð','ГÌ'=>'Ѓ','Ї'=>'Ї','КÌ'=>'ÐŒ','Ѝ'=>'Ð','Ў'=>'ÐŽ','Й'=>'Й','й'=>'й','ѐ'=>'Ñ','ё'=>'Ñ‘','гÌ'=>'Ñ“','ї'=>'Ñ—','кÌ'=>'Ñœ','ѝ'=>'Ñ','ў'=>'Ñž','Ñ´Ì'=>'Ѷ','ѵÌ'=>'Ñ·','Ӂ'=>'Ó','ӂ'=>'Ó‚','Ð̆'=>'Ó','ӑ'=>'Ó‘','Ð̈'=>'Ó’','ӓ'=>'Ó“','Ӗ'=>'Ó–','ӗ'=>'Ó—','Ӛ'=>'Óš','ӛ'=>'Ó›','Ӝ'=>'Óœ','ӝ'=>'Ó','Ӟ'=>'Óž','ӟ'=>'ÓŸ','Ӣ'=>'Ó¢','ӣ'=>'Ó£','Ӥ'=>'Ó¤','ӥ'=>'Ó¥','Ӧ'=>'Ó¦','ӧ'=>'Ó§','Ӫ'=>'Óª','ӫ'=>'Ó«','Ӭ'=>'Ó¬','Ñ̈'=>'Ó­','Ӯ'=>'Ó®','ӯ'=>'Ó¯','Ӱ'=>'Ó°','ӱ'=>'Ó±','Ӳ'=>'Ó²','ӳ'=>'Ó³','Ӵ'=>'Ó´','ӵ'=>'Óµ','Ӹ'=>'Ó¸','ӹ'=>'Ó¹','آ'=>'Ø¢','أ'=>'Ø£','ÙˆÙ”'=>'ؤ','إ'=>'Ø¥','ÙŠÙ”'=>'ئ','Û•Ù”'=>'Û€','ÛÙ”'=>'Û‚','Û’Ù”'=>'Û“','ऩ'=>'ऩ','ऱ'=>'ऱ','ऴ'=>'ऴ','ো'=>'ো','ৌ'=>'ৌ','ୈ'=>'à­ˆ','ୋ'=>'à­‹','ୌ'=>'à­Œ','ஔ'=>'à®”','ொ'=>'ொ','ோ'=>'ோ','ௌ'=>'ௌ','ై'=>'ై','ೀ'=>'à³€','ೇ'=>'ೇ','ೈ'=>'ೈ','ೊ'=>'ೊ','ೋ'=>'ೋ','ൊ'=>'ൊ','ോ'=>'ോ','ൌ'=>'ൌ','ේ'=>'à·š','à·™à·'=>'à·œ','ෝ'=>'à·','ෞ'=>'à·ž','ཱི'=>'ཱི','ཱུ'=>'ཱུ','ཱྀ'=>'à¾','ဦ'=>'ဦ','ᬆ'=>'ᬆ','ᬈ'=>'ᬈ','ᬊ'=>'ᬊ','ᬌ'=>'ᬌ','á¬á¬µ'=>'ᬎ','ᬒ'=>'ᬒ','ᬻ'=>'ᬻ','ᬽ'=>'ᬽ','ᭀ'=>'á­€','ᭁ'=>'á­','ᭃ'=>'á­ƒ','AÌ¥'=>'Ḁ','aÌ¥'=>'á¸','Ḃ'=>'Ḃ','ḃ'=>'ḃ','BÌ£'=>'Ḅ','bÌ£'=>'ḅ','Ḇ'=>'Ḇ','ḇ'=>'ḇ','ÇÌ'=>'Ḉ','çÌ'=>'ḉ','Ḋ'=>'Ḋ','ḋ'=>'ḋ','DÌ£'=>'Ḍ','dÌ£'=>'á¸','Ḏ'=>'Ḏ','ḏ'=>'á¸','Ḑ'=>'á¸','ḑ'=>'ḑ','DÌ­'=>'Ḓ','dÌ­'=>'ḓ','Ä’Ì€'=>'Ḕ','Ä“Ì€'=>'ḕ','Ä’Ì'=>'Ḗ','Ä“Ì'=>'ḗ','EÌ­'=>'Ḙ','eÌ­'=>'ḙ','EÌ°'=>'Ḛ','eÌ°'=>'ḛ','Ḝ'=>'Ḝ','ḝ'=>'á¸','Ḟ'=>'Ḟ','ḟ'=>'ḟ','GÌ„'=>'Ḡ','gÌ„'=>'ḡ','Ḣ'=>'Ḣ','ḣ'=>'ḣ','HÌ£'=>'Ḥ','hÌ£'=>'ḥ','Ḧ'=>'Ḧ','ḧ'=>'ḧ','Ḩ'=>'Ḩ','ḩ'=>'ḩ','HÌ®'=>'Ḫ','hÌ®'=>'ḫ','IÌ°'=>'Ḭ','iÌ°'=>'ḭ','ÃÌ'=>'Ḯ','ïÌ'=>'ḯ','KÌ'=>'Ḱ','kÌ'=>'ḱ','KÌ£'=>'Ḳ','kÌ£'=>'ḳ','Ḵ'=>'Ḵ','ḵ'=>'ḵ','LÌ£'=>'Ḷ','lÌ£'=>'ḷ','Ḹ'=>'Ḹ','ḹ'=>'ḹ','Ḻ'=>'Ḻ','ḻ'=>'ḻ','LÌ­'=>'Ḽ','lÌ­'=>'ḽ','MÌ'=>'Ḿ','mÌ'=>'ḿ','Ṁ'=>'á¹€','ṁ'=>'á¹','MÌ£'=>'Ṃ','mÌ£'=>'ṃ','Ṅ'=>'Ṅ','ṅ'=>'á¹…','NÌ£'=>'Ṇ','nÌ£'=>'ṇ','Ṉ'=>'Ṉ','ṉ'=>'ṉ','NÌ­'=>'Ṋ','nÌ­'=>'ṋ','ÕÌ'=>'Ṍ','õÌ'=>'á¹','Ṏ'=>'Ṏ','ṏ'=>'á¹','Ṑ'=>'á¹','ÅÌ€'=>'ṑ','ÅŒÌ'=>'á¹’','ÅÌ'=>'ṓ','PÌ'=>'á¹”','pÌ'=>'ṕ','Ṗ'=>'á¹–','ṗ'=>'á¹—','Ṙ'=>'Ṙ','ṙ'=>'á¹™','RÌ£'=>'Ṛ','rÌ£'=>'á¹›','Ṝ'=>'Ṝ','ṝ'=>'á¹','Ṟ'=>'Ṟ','ṟ'=>'ṟ','Ṡ'=>'á¹ ','ṡ'=>'ṡ','SÌ£'=>'á¹¢','sÌ£'=>'á¹£','Ṥ'=>'Ṥ','ṥ'=>'á¹¥','Ṧ'=>'Ṧ','ṧ'=>'ṧ','Ṩ'=>'Ṩ','ṩ'=>'ṩ','Ṫ'=>'Ṫ','ṫ'=>'ṫ','TÌ£'=>'Ṭ','tÌ£'=>'á¹­','Ṯ'=>'á¹®','ṯ'=>'ṯ','TÌ­'=>'á¹°','tÌ­'=>'á¹±','Ṳ'=>'á¹²','ṳ'=>'á¹³','UÌ°'=>'á¹´','uÌ°'=>'á¹µ','UÌ­'=>'Ṷ','uÌ­'=>'á¹·','ŨÌ'=>'Ṹ','Å©Ì'=>'á¹¹','Ṻ'=>'Ṻ','ṻ'=>'á¹»','Ṽ'=>'á¹¼','ṽ'=>'á¹½','VÌ£'=>'á¹¾','vÌ£'=>'ṿ','WÌ€'=>'Ẁ','wÌ€'=>'áº','WÌ'=>'Ẃ','wÌ'=>'ẃ','Ẅ'=>'Ẅ','ẅ'=>'ẅ','Ẇ'=>'Ẇ','ẇ'=>'ẇ','WÌ£'=>'Ẉ','wÌ£'=>'ẉ','Ẋ'=>'Ẋ','ẋ'=>'ẋ','Ẍ'=>'Ẍ','ẍ'=>'áº','Ẏ'=>'Ẏ','ẏ'=>'áº','ZÌ‚'=>'áº','zÌ‚'=>'ẑ','ZÌ£'=>'Ẓ','zÌ£'=>'ẓ','Ẕ'=>'Ẕ','ẕ'=>'ẕ','ẖ'=>'ẖ','ẗ'=>'ẗ','wÌŠ'=>'ẘ','yÌŠ'=>'ẙ','ẛ'=>'ẛ','AÌ£'=>'Ạ','aÌ£'=>'ạ','Ả'=>'Ả','ả'=>'ả','ÂÌ'=>'Ấ','âÌ'=>'ấ','Ầ'=>'Ầ','ầ'=>'ầ','Ẩ'=>'Ẩ','ẩ'=>'ẩ','Ẫ'=>'Ẫ','ẫ'=>'ẫ','Ậ'=>'Ậ','ậ'=>'ậ','Ä‚Ì'=>'Ắ','ăÌ'=>'ắ','Ä‚Ì€'=>'Ằ','ằ'=>'ằ','Ẳ'=>'Ẳ','ẳ'=>'ẳ','Ẵ'=>'Ẵ','ẵ'=>'ẵ','Ặ'=>'Ặ','ặ'=>'ặ','EÌ£'=>'Ẹ','eÌ£'=>'ẹ','Ẻ'=>'Ẻ','ẻ'=>'ẻ','Ẽ'=>'Ẽ','ẽ'=>'ẽ','ÊÌ'=>'Ế','êÌ'=>'ế','Ề'=>'Ề','ề'=>'á»','Ể'=>'Ể','ể'=>'ể','Ễ'=>'Ễ','ễ'=>'á»…','Ệ'=>'Ệ','ệ'=>'ệ','Ỉ'=>'Ỉ','ỉ'=>'ỉ','IÌ£'=>'Ị','iÌ£'=>'ị','OÌ£'=>'Ọ','oÌ£'=>'á»','Ỏ'=>'Ỏ','ỏ'=>'á»','ÔÌ'=>'á»','ôÌ'=>'ố','Ồ'=>'á»’','ồ'=>'ồ','Ổ'=>'á»”','ổ'=>'ổ','Ỗ'=>'á»–','ỗ'=>'á»—','Ộ'=>'Ộ','á»Ì‚'=>'á»™','Æ Ì'=>'Ớ','Æ¡Ì'=>'á»›','Ờ'=>'Ờ','Æ¡Ì€'=>'á»','Ở'=>'Ở','ở'=>'ở','Ỡ'=>'á» ','ỡ'=>'ỡ','Ợ'=>'Ợ','Æ¡Ì£'=>'ợ','UÌ£'=>'Ụ','uÌ£'=>'ụ','Ủ'=>'Ủ','ủ'=>'ủ','ƯÌ'=>'Ứ','Æ°Ì'=>'ứ','Ừ'=>'Ừ','Æ°Ì€'=>'ừ','Ử'=>'Ử','ử'=>'á»­','Ữ'=>'á»®','ữ'=>'ữ','Ự'=>'á»°','Æ°Ì£'=>'á»±','YÌ€'=>'Ỳ','yÌ€'=>'ỳ','YÌ£'=>'á»´','yÌ£'=>'ỵ','Ỷ'=>'Ỷ','ỷ'=>'á»·','Ỹ'=>'Ỹ','ỹ'=>'ỹ','ἀ'=>'á¼€','ἁ'=>'á¼','ἂ'=>'ἂ','á¼Ì€'=>'ἃ','á¼€Ì'=>'ἄ','á¼Ì'=>'á¼…','ἆ'=>'ἆ','á¼Í‚'=>'ἇ','Ἀ'=>'Ἀ','Ἁ'=>'Ἁ','Ἂ'=>'Ἂ','Ἃ'=>'Ἃ','ἈÌ'=>'Ἄ','ἉÌ'=>'á¼','Ἆ'=>'Ἆ','Ἇ'=>'á¼','ἐ'=>'á¼','ἑ'=>'ἑ','á¼Ì€'=>'á¼’','ἓ'=>'ἓ','á¼Ì'=>'á¼”','ἑÌ'=>'ἕ','Ἐ'=>'Ἐ','Ἑ'=>'á¼™','Ἒ'=>'Ἒ','Ἓ'=>'á¼›','ἘÌ'=>'Ἔ','á¼™Ì'=>'á¼','ἠ'=>'á¼ ','ἡ'=>'ἡ','ἢ'=>'á¼¢','ἣ'=>'á¼£','á¼ Ì'=>'ἤ','ἡÌ'=>'á¼¥','á¼ Í‚'=>'ἦ','ἧ'=>'ἧ','Ἠ'=>'Ἠ','Ἡ'=>'Ἡ','Ἢ'=>'Ἢ','Ἣ'=>'Ἣ','ἨÌ'=>'Ἤ','ἩÌ'=>'á¼­','Ἦ'=>'á¼®','Ἧ'=>'Ἧ','ἰ'=>'á¼°','ἱ'=>'á¼±','á¼°Ì€'=>'á¼²','ἳ'=>'á¼³','á¼°Ì'=>'á¼´','á¼±Ì'=>'á¼µ','á¼°Í‚'=>'ἶ','ἷ'=>'á¼·','Ἰ'=>'Ἰ','Ἱ'=>'á¼¹','Ἲ'=>'Ἲ','Ἳ'=>'á¼»','ἸÌ'=>'á¼¼','á¼¹Ì'=>'á¼½','Ἶ'=>'á¼¾','Ἷ'=>'Ἷ','ὀ'=>'á½€','ὁ'=>'á½','ὂ'=>'ὂ','á½Ì€'=>'ὃ','á½€Ì'=>'ὄ','á½Ì'=>'á½…','Ὀ'=>'Ὀ','Ὁ'=>'Ὁ','Ὂ'=>'Ὂ','Ὃ'=>'Ὃ','ὈÌ'=>'Ὄ','ὉÌ'=>'á½','Ï…Ì“'=>'á½','Ï…Ì”'=>'ὑ','á½Ì€'=>'á½’','ὓ'=>'ὓ','á½Ì'=>'á½”','ὑÌ'=>'ὕ','á½Í‚'=>'á½–','ὗ'=>'á½—','Ὑ'=>'á½™','Ὓ'=>'á½›','á½™Ì'=>'á½','Ὗ'=>'Ὗ','ὠ'=>'á½ ','ὡ'=>'ὡ','ὢ'=>'á½¢','ὣ'=>'á½£','á½ Ì'=>'ὤ','ὡÌ'=>'á½¥','á½ Í‚'=>'ὦ','ὧ'=>'ὧ','Ὠ'=>'Ὠ','Ὡ'=>'Ὡ','Ὢ'=>'Ὢ','Ὣ'=>'Ὣ','ὨÌ'=>'Ὤ','ὩÌ'=>'á½­','Ὦ'=>'á½®','Ὧ'=>'Ὧ','ὰ'=>'á½°','ὲ'=>'á½²','ὴ'=>'á½´','ὶ'=>'ὶ','ὸ'=>'ὸ','Ï…Ì€'=>'ὺ','ὼ'=>'á½¼','ᾀ'=>'á¾€','á¼Í…'=>'á¾','ᾂ'=>'ᾂ','ᾃ'=>'ᾃ','ᾄ'=>'ᾄ','á¼…Í…'=>'á¾…','ᾆ'=>'ᾆ','ᾇ'=>'ᾇ','ᾈ'=>'ᾈ','ᾉ'=>'ᾉ','ᾊ'=>'ᾊ','ᾋ'=>'ᾋ','ᾌ'=>'ᾌ','á¼Í…'=>'á¾','ᾎ'=>'ᾎ','á¼Í…'=>'á¾','á¼ Í…'=>'á¾','ᾑ'=>'ᾑ','ᾒ'=>'á¾’','ᾓ'=>'ᾓ','ᾔ'=>'á¾”','ᾕ'=>'ᾕ','ᾖ'=>'á¾–','ᾗ'=>'á¾—','ᾘ'=>'ᾘ','ᾙ'=>'á¾™','ᾚ'=>'ᾚ','ᾛ'=>'á¾›','ᾜ'=>'ᾜ','á¼­Í…'=>'á¾','ᾞ'=>'ᾞ','ᾟ'=>'ᾟ','á½ Í…'=>'á¾ ','ᾡ'=>'ᾡ','ᾢ'=>'á¾¢','ᾣ'=>'á¾£','ᾤ'=>'ᾤ','ᾥ'=>'á¾¥','ᾦ'=>'ᾦ','ᾧ'=>'ᾧ','ᾨ'=>'ᾨ','ᾩ'=>'ᾩ','ᾪ'=>'ᾪ','ᾫ'=>'ᾫ','ᾬ'=>'ᾬ','á½­Í…'=>'á¾­','ᾮ'=>'á¾®','ᾯ'=>'ᾯ','ᾰ'=>'á¾°','ᾱ'=>'á¾±','á½°Í…'=>'á¾²','ᾳ'=>'á¾³','ᾴ'=>'á¾´','ᾶ'=>'ᾶ','ᾷ'=>'á¾·','Ᾰ'=>'Ᾰ','Ᾱ'=>'á¾¹','Ὰ'=>'Ὰ','ᾼ'=>'á¾¼','῁'=>'á¿','á½´Í…'=>'á¿‚','ῃ'=>'ῃ','ῄ'=>'á¿„','ῆ'=>'ῆ','ῇ'=>'ῇ','Ὲ'=>'Ὲ','Ὴ'=>'á¿Š','ῌ'=>'á¿Œ','῍'=>'á¿','᾿Ì'=>'á¿Ž','῏'=>'á¿','ῐ'=>'á¿','ῑ'=>'á¿‘','ÏŠÌ€'=>'á¿’','ῖ'=>'á¿–','ÏŠÍ‚'=>'á¿—','Ῐ'=>'Ῐ','Ῑ'=>'á¿™','Ὶ'=>'á¿š','῝'=>'á¿','῾Ì'=>'á¿ž','῟'=>'á¿Ÿ','ῠ'=>'á¿ ','Ï…Ì„'=>'á¿¡','Ï‹Ì€'=>'á¿¢','ÏÌ“'=>'ῤ','ÏÌ”'=>'á¿¥','Ï…Í‚'=>'ῦ','Ï‹Í‚'=>'ῧ','Ῠ'=>'Ῠ','Ῡ'=>'á¿©','Ὺ'=>'Ὺ','Ῥ'=>'Ῥ','῭'=>'á¿­','ῲ'=>'ῲ','ῳ'=>'ῳ','ÏŽÍ…'=>'á¿´','ῶ'=>'ῶ','ῷ'=>'á¿·','Ὸ'=>'Ὸ','Ὼ'=>'Ὼ','ῼ'=>'ῼ','â†Ì¸'=>'↚','↛'=>'↛','↮'=>'↮','â‡Ì¸'=>'â‡','⇎'=>'⇎','⇏'=>'â‡','∄'=>'∄','∉'=>'∉','∌'=>'∌','∤'=>'∤','∦'=>'∦','≁'=>'â‰','≄'=>'≄','≇'=>'≇','≉'=>'≉','≠'=>'≠','≢'=>'≢','â‰Ì¸'=>'≭','≮'=>'≮','≯'=>'≯','≰'=>'≰','≱'=>'≱','≴'=>'≴','≵'=>'≵','≸'=>'≸','≹'=>'≹','⊀'=>'⊀','⊁'=>'âŠ','⊄'=>'⊄','⊅'=>'⊅','⊈'=>'⊈','⊉'=>'⊉','⊬'=>'⊬','⊭'=>'⊭','⊮'=>'⊮','⊯'=>'⊯','⋠'=>'â‹ ','⋡'=>'â‹¡','⋢'=>'â‹¢','⋣'=>'â‹£','⋪'=>'⋪','⋫'=>'â‹«','⋬'=>'⋬','⋭'=>'â‹­','ã‹ã‚™'=>'ãŒ','ãã‚™'=>'ãŽ','ãã‚™'=>'ã','ã‘ã‚™'=>'ã’','ã“ã‚™'=>'ã”','ã•ã‚™'=>'ã–','ã—ã‚™'=>'ã˜','ã™ã‚™'=>'ãš','ã›ã‚™'=>'ãœ','ãã‚™'=>'ãž','ãŸã‚™'=>'ã ','ã¡ã‚™'=>'ã¢','ã¤ã‚™'=>'ã¥','ã¦ã‚™'=>'ã§','ã¨ã‚™'=>'ã©','ã¯ã‚™'=>'ã°','ã¯ã‚š'=>'ã±','ã²ã‚™'=>'ã³','ã²ã‚š'=>'ã´','ãµã‚™'=>'ã¶','ãµã‚š'=>'ã·','ã¸ã‚™'=>'ã¹','ã¸ã‚š'=>'ãº','ã»ã‚™'=>'ã¼','ã»ã‚š'=>'ã½','ã†ã‚™'=>'ã‚”','ã‚ã‚™'=>'ã‚ž','ã‚«ã‚™'=>'ガ','ã‚­ã‚™'=>'ã‚®','グ'=>'ã‚°','ゲ'=>'ゲ','ゴ'=>'ã‚´','ザ'=>'ザ','ã‚·ã‚™'=>'ジ','ズ'=>'ズ','ゼ'=>'ゼ','ゾ'=>'ゾ','ã‚¿ã‚™'=>'ダ','ãƒã‚™'=>'ヂ','ヅ'=>'ヅ','デ'=>'デ','ド'=>'ド','ãƒã‚™'=>'ãƒ','ãƒã‚š'=>'パ','ビ'=>'ビ','ピ'=>'ピ','ブ'=>'ブ','プ'=>'プ','ベ'=>'ベ','ペ'=>'ペ','ボ'=>'ボ','ポ'=>'ãƒ','ヴ'=>'ヴ','ヷ'=>'ヷ','ヸ'=>'ヸ','ヹ'=>'ヹ','ヺ'=>'ヺ','ヾ'=>'ヾ');
diff --git a/phpBB/includes/utf/data/utf_canonical_decomp.php b/phpBB/includes/utf/data/utf_canonical_decomp.php
deleted file mode 100644
index 9fb90803e2..0000000000
--- a/phpBB/includes/utf/data/utf_canonical_decomp.php
+++ /dev/null
@@ -1,2 +0,0 @@
-<?php
-$GLOBALS['utf_canonical_decomp']=array('À'=>'AÌ€','Ã'=>'AÌ','Â'=>'AÌ‚','Ã'=>'Ã','Ä'=>'Ä','Ã…'=>'AÌŠ','Ç'=>'Ç','È'=>'EÌ€','É'=>'EÌ','Ê'=>'EÌ‚','Ë'=>'Ë','ÃŒ'=>'IÌ€','Ã'=>'IÌ','ÃŽ'=>'IÌ‚','Ã'=>'Ï','Ñ'=>'Ñ','Ã’'=>'OÌ€','Ó'=>'OÌ','Ô'=>'OÌ‚','Õ'=>'Õ','Ö'=>'Ö','Ù'=>'UÌ€','Ú'=>'UÌ','Û'=>'UÌ‚','Ãœ'=>'Ü','Ã'=>'YÌ','à'=>'aÌ€','á'=>'aÌ','â'=>'aÌ‚','ã'=>'ã','ä'=>'ä','Ã¥'=>'aÌŠ','ç'=>'ç','è'=>'eÌ€','é'=>'eÌ','ê'=>'eÌ‚','ë'=>'ë','ì'=>'iÌ€','í'=>'iÌ','î'=>'iÌ‚','ï'=>'ï','ñ'=>'ñ','ò'=>'oÌ€','ó'=>'oÌ','ô'=>'oÌ‚','õ'=>'õ','ö'=>'ö','ù'=>'uÌ€','ú'=>'uÌ','û'=>'uÌ‚','ü'=>'ü','ý'=>'yÌ','ÿ'=>'ÿ','Ä€'=>'AÌ„','Ä'=>'aÌ„','Ä‚'=>'Ă','ă'=>'ă','Ä„'=>'Ą','Ä…'=>'ą','Ć'=>'CÌ','ć'=>'cÌ','Ĉ'=>'CÌ‚','ĉ'=>'cÌ‚','ÄŠ'=>'Ċ','Ä‹'=>'ċ','ÄŒ'=>'CÌŒ','Ä'=>'cÌŒ','ÄŽ'=>'DÌŒ','Ä'=>'dÌŒ','Ä’'=>'EÌ„','Ä“'=>'eÌ„','Ä”'=>'Ĕ','Ä•'=>'ĕ','Ä–'=>'Ė','Ä—'=>'ė','Ę'=>'Ę','Ä™'=>'ę','Äš'=>'EÌŒ','Ä›'=>'eÌŒ','Äœ'=>'GÌ‚','Ä'=>'gÌ‚','Äž'=>'Ğ','ÄŸ'=>'ğ','Ä '=>'Ġ','Ä¡'=>'ġ','Ä¢'=>'Ģ','Ä£'=>'ģ','Ĥ'=>'HÌ‚','Ä¥'=>'hÌ‚','Ĩ'=>'Ĩ','Ä©'=>'ĩ','Ī'=>'IÌ„','Ä«'=>'iÌ„','Ĭ'=>'Ĭ','Ä­'=>'ĭ','Ä®'=>'Į','į'=>'į','Ä°'=>'İ','Ä´'=>'JÌ‚','ĵ'=>'jÌ‚','Ķ'=>'Ķ','Ä·'=>'ķ','Ĺ'=>'LÌ','ĺ'=>'lÌ','Ä»'=>'Ļ','ļ'=>'ļ','Ľ'=>'LÌŒ','ľ'=>'lÌŒ','Ń'=>'NÌ','Å„'=>'nÌ','Å…'=>'Ņ','ņ'=>'ņ','Ň'=>'NÌŒ','ň'=>'nÌŒ','ÅŒ'=>'OÌ„','Å'=>'oÌ„','ÅŽ'=>'Ŏ','Å'=>'ŏ','Å'=>'OÌ‹','Å‘'=>'oÌ‹','Å”'=>'RÌ','Å•'=>'rÌ','Å–'=>'Ŗ','Å—'=>'ŗ','Ř'=>'RÌŒ','Å™'=>'rÌŒ','Åš'=>'SÌ','Å›'=>'sÌ','Åœ'=>'SÌ‚','Å'=>'sÌ‚','Åž'=>'Ş','ÅŸ'=>'ş','Å '=>'SÌŒ','Å¡'=>'sÌŒ','Å¢'=>'Ţ','Å£'=>'ţ','Ť'=>'TÌŒ','Å¥'=>'tÌŒ','Ũ'=>'Ũ','Å©'=>'ũ','Ū'=>'UÌ„','Å«'=>'uÌ„','Ŭ'=>'Ŭ','Å­'=>'ŭ','Å®'=>'UÌŠ','ů'=>'uÌŠ','Å°'=>'UÌ‹','ű'=>'uÌ‹','Ų'=>'Ų','ų'=>'ų','Å´'=>'WÌ‚','ŵ'=>'wÌ‚','Ŷ'=>'YÌ‚','Å·'=>'yÌ‚','Ÿ'=>'Ÿ','Ź'=>'ZÌ','ź'=>'zÌ','Å»'=>'Ż','ż'=>'ż','Ž'=>'ZÌŒ','ž'=>'zÌŒ','Æ '=>'OÌ›','Æ¡'=>'oÌ›','Ư'=>'UÌ›','Æ°'=>'uÌ›','Ç'=>'AÌŒ','ÇŽ'=>'aÌŒ','Ç'=>'IÌŒ','Ç'=>'iÌŒ','Ç‘'=>'OÌŒ','Ç’'=>'oÌŒ','Ç“'=>'UÌŒ','Ç”'=>'uÌŒ','Ç•'=>'Ǖ','Ç–'=>'ǖ','Ç—'=>'ÜÌ','ǘ'=>'üÌ','Ç™'=>'Ǚ','Çš'=>'ǚ','Ç›'=>'Ǜ','Çœ'=>'ǜ','Çž'=>'Ǟ','ÇŸ'=>'ǟ','Ç '=>'Ǡ','Ç¡'=>'ǡ','Ç¢'=>'Ǣ','Ç£'=>'ǣ','Ǧ'=>'GÌŒ','ǧ'=>'gÌŒ','Ǩ'=>'KÌŒ','Ç©'=>'kÌŒ','Ǫ'=>'Ǫ','Ç«'=>'ǫ','Ǭ'=>'Ǭ','Ç­'=>'ǭ','Ç®'=>'Æ·ÌŒ','ǯ'=>'Ê’ÌŒ','Ç°'=>'jÌŒ','Ç´'=>'GÌ','ǵ'=>'gÌ','Ǹ'=>'NÌ€','ǹ'=>'nÌ€','Ǻ'=>'AÌŠÌ','Ç»'=>'aÌŠÌ','Ǽ'=>'ÆÌ','ǽ'=>'æÌ','Ǿ'=>'ØÌ','Ç¿'=>'øÌ','È€'=>'AÌ','È'=>'aÌ','È‚'=>'AÌ‘','ȃ'=>'aÌ‘','È„'=>'EÌ','È…'=>'eÌ','Ȇ'=>'EÌ‘','ȇ'=>'eÌ‘','Ȉ'=>'IÌ','ȉ'=>'iÌ','ÈŠ'=>'IÌ‘','È‹'=>'iÌ‘','ÈŒ'=>'OÌ','È'=>'oÌ','ÈŽ'=>'OÌ‘','È'=>'oÌ‘','È'=>'RÌ','È‘'=>'rÌ','È’'=>'RÌ‘','È“'=>'rÌ‘','È”'=>'UÌ','È•'=>'uÌ','È–'=>'UÌ‘','È—'=>'uÌ‘','Ș'=>'Ș','È™'=>'ș','Èš'=>'Ț','È›'=>'ț','Èž'=>'HÌŒ','ÈŸ'=>'hÌŒ','Ȧ'=>'Ȧ','ȧ'=>'ȧ','Ȩ'=>'Ȩ','È©'=>'ȩ','Ȫ'=>'Ȫ','È«'=>'ȫ','Ȭ'=>'Ȭ','È­'=>'ȭ','È®'=>'Ȯ','ȯ'=>'ȯ','È°'=>'Ȱ','ȱ'=>'ȱ','Ȳ'=>'YÌ„','ȳ'=>'yÌ„','Í€'=>'Ì€','Í'=>'Ì','̓'=>'Ì“','Í„'=>'̈Ì','Í´'=>'ʹ',';'=>';','Î…'=>'¨Ì','Ά'=>'ΑÌ','·'=>'·','Έ'=>'ΕÌ','Ή'=>'ΗÌ','Ί'=>'ΙÌ','ÎŒ'=>'ΟÌ','ÎŽ'=>'Î¥Ì','Î'=>'ΩÌ','Î'=>'ϊÌ','Ϊ'=>'Ϊ','Ϋ'=>'Ϋ','ά'=>'αÌ','έ'=>'εÌ','ή'=>'ηÌ','ί'=>'ιÌ','ΰ'=>'ϋÌ','ÏŠ'=>'ϊ','Ï‹'=>'ϋ','ÏŒ'=>'οÌ','Ï'=>'Ï…Ì','ÏŽ'=>'ωÌ','Ï“'=>'Ï’Ì','Ï”'=>'ϔ','Ѐ'=>'Ѐ','Ð'=>'Ё','Ѓ'=>'ГÌ','Ї'=>'Ї','ÐŒ'=>'КÌ','Ð'=>'Ѝ','ÐŽ'=>'Ў','Й'=>'Й','й'=>'й','Ñ'=>'ѐ','Ñ‘'=>'ё','Ñ“'=>'гÌ','Ñ—'=>'ї','Ñœ'=>'кÌ','Ñ'=>'ѝ','Ñž'=>'ў','Ѷ'=>'Ñ´Ì','Ñ·'=>'ѵÌ','Ó'=>'Ӂ','Ó‚'=>'ӂ','Ó'=>'Ð̆','Ó‘'=>'ӑ','Ó’'=>'Ð̈','Ó“'=>'ӓ','Ó–'=>'Ӗ','Ó—'=>'ӗ','Óš'=>'Ӛ','Ó›'=>'ӛ','Óœ'=>'Ӝ','Ó'=>'ӝ','Óž'=>'Ӟ','ÓŸ'=>'ӟ','Ó¢'=>'Ӣ','Ó£'=>'ӣ','Ó¤'=>'Ӥ','Ó¥'=>'ӥ','Ó¦'=>'Ӧ','Ó§'=>'ӧ','Óª'=>'Ӫ','Ó«'=>'ӫ','Ó¬'=>'Ӭ','Ó­'=>'Ñ̈','Ó®'=>'Ӯ','Ó¯'=>'ӯ','Ó°'=>'Ӱ','Ó±'=>'ӱ','Ó²'=>'Ӳ','Ó³'=>'ӳ','Ó´'=>'Ӵ','Óµ'=>'ӵ','Ó¸'=>'Ӹ','Ó¹'=>'ӹ','Ø¢'=>'آ','Ø£'=>'أ','ؤ'=>'ÙˆÙ”','Ø¥'=>'إ','ئ'=>'ÙŠÙ”','Û€'=>'Û•Ù”','Û‚'=>'ÛÙ”','Û“'=>'Û’Ù”','ऩ'=>'ऩ','ऱ'=>'ऱ','ऴ'=>'ऴ','क़'=>'क़','ख़'=>'ख़','ग़'=>'ग़','ज़'=>'ज़','ड़'=>'ड़','à¥'=>'ढ़','फ़'=>'फ़','य़'=>'य़','ো'=>'ো','ৌ'=>'ৌ','ড়'=>'ড়','à§'=>'ঢ়','য়'=>'য়','ਲ਼'=>'ਲ਼','ਸ਼'=>'ਸ਼','à©™'=>'ਖ਼','à©š'=>'ਗ਼','à©›'=>'ਜ਼','à©ž'=>'ਫ਼','à­ˆ'=>'ୈ','à­‹'=>'ୋ','à­Œ'=>'ୌ','à­œ'=>'ଡ଼','à­'=>'ଢ଼','à®”'=>'ஔ','ொ'=>'ொ','ோ'=>'ோ','ௌ'=>'ௌ','ై'=>'ై','à³€'=>'ೀ','ೇ'=>'ೇ','ೈ'=>'ೈ','ೊ'=>'ೊ','ೋ'=>'ೋ','ൊ'=>'ൊ','ോ'=>'ോ','ൌ'=>'ൌ','à·š'=>'ේ','à·œ'=>'à·™à·','à·'=>'à·™à·à·Š','à·ž'=>'ෞ','གྷ'=>'གྷ','à½'=>'ཌྷ','དྷ'=>'དྷ','བྷ'=>'བྷ','ཛྷ'=>'ཛྷ','ཀྵ'=>'ཀྵ','ཱི'=>'ཱི','ཱུ'=>'ཱུ','ྲྀ'=>'ྲྀ','ླྀ'=>'ླྀ','à¾'=>'ཱྀ','ྒྷ'=>'ྒྷ','à¾'=>'ྜྷ','ྡྷ'=>'ྡྷ','ྦྷ'=>'ྦྷ','ྫྷ'=>'ྫྷ','ྐྵ'=>'à¾à¾µ','ဦ'=>'ဦ','ᬆ'=>'ᬆ','ᬈ'=>'ᬈ','ᬊ'=>'ᬊ','ᬌ'=>'ᬌ','ᬎ'=>'á¬á¬µ','ᬒ'=>'ᬒ','ᬻ'=>'ᬻ','ᬽ'=>'ᬽ','á­€'=>'ᭀ','á­'=>'ᭁ','á­ƒ'=>'ᭃ','Ḁ'=>'AÌ¥','á¸'=>'aÌ¥','Ḃ'=>'Ḃ','ḃ'=>'ḃ','Ḅ'=>'BÌ£','ḅ'=>'bÌ£','Ḇ'=>'Ḇ','ḇ'=>'ḇ','Ḉ'=>'ÇÌ','ḉ'=>'çÌ','Ḋ'=>'Ḋ','ḋ'=>'ḋ','Ḍ'=>'DÌ£','á¸'=>'dÌ£','Ḏ'=>'Ḏ','á¸'=>'ḏ','á¸'=>'Ḑ','ḑ'=>'ḑ','Ḓ'=>'DÌ­','ḓ'=>'dÌ­','Ḕ'=>'EÌ„Ì€','ḕ'=>'eÌ„Ì€','Ḗ'=>'EÌ„Ì','ḗ'=>'eÌ„Ì','Ḙ'=>'EÌ­','ḙ'=>'eÌ­','Ḛ'=>'EÌ°','ḛ'=>'eÌ°','Ḝ'=>'Ḝ','á¸'=>'ḝ','Ḟ'=>'Ḟ','ḟ'=>'ḟ','Ḡ'=>'GÌ„','ḡ'=>'gÌ„','Ḣ'=>'Ḣ','ḣ'=>'ḣ','Ḥ'=>'HÌ£','ḥ'=>'hÌ£','Ḧ'=>'Ḧ','ḧ'=>'ḧ','Ḩ'=>'Ḩ','ḩ'=>'ḩ','Ḫ'=>'HÌ®','ḫ'=>'hÌ®','Ḭ'=>'IÌ°','ḭ'=>'iÌ°','Ḯ'=>'ÏÌ','ḯ'=>'ïÌ','Ḱ'=>'KÌ','ḱ'=>'kÌ','Ḳ'=>'KÌ£','ḳ'=>'kÌ£','Ḵ'=>'Ḵ','ḵ'=>'ḵ','Ḷ'=>'LÌ£','ḷ'=>'lÌ£','Ḹ'=>'Ḹ','ḹ'=>'ḹ','Ḻ'=>'Ḻ','ḻ'=>'ḻ','Ḽ'=>'LÌ­','ḽ'=>'lÌ­','Ḿ'=>'MÌ','ḿ'=>'mÌ','á¹€'=>'Ṁ','á¹'=>'ṁ','Ṃ'=>'MÌ£','ṃ'=>'mÌ£','Ṅ'=>'Ṅ','á¹…'=>'ṅ','Ṇ'=>'NÌ£','ṇ'=>'nÌ£','Ṉ'=>'Ṉ','ṉ'=>'ṉ','Ṋ'=>'NÌ­','ṋ'=>'nÌ­','Ṍ'=>'ÕÌ','á¹'=>'õÌ','Ṏ'=>'Ṏ','á¹'=>'ṏ','á¹'=>'OÌ„Ì€','ṑ'=>'oÌ„Ì€','á¹’'=>'OÌ„Ì','ṓ'=>'oÌ„Ì','á¹”'=>'PÌ','ṕ'=>'pÌ','á¹–'=>'Ṗ','á¹—'=>'ṗ','Ṙ'=>'Ṙ','á¹™'=>'ṙ','Ṛ'=>'RÌ£','á¹›'=>'rÌ£','Ṝ'=>'Ṝ','á¹'=>'ṝ','Ṟ'=>'Ṟ','ṟ'=>'ṟ','á¹ '=>'Ṡ','ṡ'=>'ṡ','á¹¢'=>'SÌ£','á¹£'=>'sÌ£','Ṥ'=>'SÌ̇','á¹¥'=>'sÌ̇','Ṧ'=>'Ṧ','ṧ'=>'ṧ','Ṩ'=>'Ṩ','ṩ'=>'ṩ','Ṫ'=>'Ṫ','ṫ'=>'ṫ','Ṭ'=>'TÌ£','á¹­'=>'tÌ£','á¹®'=>'Ṯ','ṯ'=>'ṯ','á¹°'=>'TÌ­','á¹±'=>'tÌ­','á¹²'=>'Ṳ','á¹³'=>'ṳ','á¹´'=>'UÌ°','á¹µ'=>'uÌ°','Ṷ'=>'UÌ­','á¹·'=>'uÌ­','Ṹ'=>'ŨÌ','á¹¹'=>'ũÌ','Ṻ'=>'Ṻ','á¹»'=>'ṻ','á¹¼'=>'Ṽ','á¹½'=>'ṽ','á¹¾'=>'VÌ£','ṿ'=>'vÌ£','Ẁ'=>'WÌ€','áº'=>'wÌ€','Ẃ'=>'WÌ','ẃ'=>'wÌ','Ẅ'=>'Ẅ','ẅ'=>'ẅ','Ẇ'=>'Ẇ','ẇ'=>'ẇ','Ẉ'=>'WÌ£','ẉ'=>'wÌ£','Ẋ'=>'Ẋ','ẋ'=>'ẋ','Ẍ'=>'Ẍ','áº'=>'ẍ','Ẏ'=>'Ẏ','áº'=>'ẏ','áº'=>'ZÌ‚','ẑ'=>'zÌ‚','Ẓ'=>'ZÌ£','ẓ'=>'zÌ£','Ẕ'=>'Ẕ','ẕ'=>'ẕ','ẖ'=>'ẖ','ẗ'=>'ẗ','ẘ'=>'wÌŠ','ẙ'=>'yÌŠ','ẛ'=>'ẛ','Ạ'=>'AÌ£','ạ'=>'aÌ£','Ả'=>'Ả','ả'=>'ả','Ấ'=>'AÌ‚Ì','ấ'=>'aÌ‚Ì','Ầ'=>'AÌ‚Ì€','ầ'=>'aÌ‚Ì€','Ẩ'=>'Ẩ','ẩ'=>'ẩ','Ẫ'=>'Ẫ','ẫ'=>'ẫ','Ậ'=>'Ậ','ậ'=>'ậ','Ắ'=>'ĂÌ','ắ'=>'ăÌ','Ằ'=>'Ằ','ằ'=>'ằ','Ẳ'=>'Ẳ','ẳ'=>'ẳ','Ẵ'=>'Ẵ','ẵ'=>'ẵ','Ặ'=>'Ặ','ặ'=>'ặ','Ẹ'=>'EÌ£','ẹ'=>'eÌ£','Ẻ'=>'Ẻ','ẻ'=>'ẻ','Ẽ'=>'Ẽ','ẽ'=>'ẽ','Ế'=>'EÌ‚Ì','ế'=>'eÌ‚Ì','Ề'=>'EÌ‚Ì€','á»'=>'eÌ‚Ì€','Ể'=>'Ể','ể'=>'ể','Ễ'=>'Ễ','á»…'=>'ễ','Ệ'=>'Ệ','ệ'=>'ệ','Ỉ'=>'Ỉ','ỉ'=>'ỉ','Ị'=>'IÌ£','ị'=>'iÌ£','Ọ'=>'OÌ£','á»'=>'oÌ£','Ỏ'=>'Ỏ','á»'=>'ỏ','á»'=>'OÌ‚Ì','ố'=>'oÌ‚Ì','á»’'=>'OÌ‚Ì€','ồ'=>'oÌ‚Ì€','á»”'=>'Ổ','ổ'=>'ổ','á»–'=>'Ỗ','á»—'=>'ỗ','Ộ'=>'Ộ','á»™'=>'ộ','Ớ'=>'OÌ›Ì','á»›'=>'oÌ›Ì','Ờ'=>'Ờ','á»'=>'ờ','Ở'=>'Ở','ở'=>'ở','á» '=>'Ỡ','ỡ'=>'ỡ','Ợ'=>'Ợ','ợ'=>'ợ','Ụ'=>'UÌ£','ụ'=>'uÌ£','Ủ'=>'Ủ','ủ'=>'ủ','Ứ'=>'UÌ›Ì','ứ'=>'uÌ›Ì','Ừ'=>'Ừ','ừ'=>'ừ','Ử'=>'Ử','á»­'=>'ử','á»®'=>'Ữ','ữ'=>'ữ','á»°'=>'Ự','á»±'=>'ự','Ỳ'=>'YÌ€','ỳ'=>'yÌ€','á»´'=>'YÌ£','ỵ'=>'yÌ£','Ỷ'=>'Ỷ','á»·'=>'ỷ','Ỹ'=>'Ỹ','ỹ'=>'ỹ','á¼€'=>'ἀ','á¼'=>'ἁ','ἂ'=>'ἂ','ἃ'=>'ἃ','ἄ'=>'ἀÌ','á¼…'=>'ἁÌ','ἆ'=>'ἆ','ἇ'=>'ἇ','Ἀ'=>'Ἀ','Ἁ'=>'Ἁ','Ἂ'=>'Ἂ','Ἃ'=>'Ἃ','Ἄ'=>'ἈÌ','á¼'=>'ἉÌ','Ἆ'=>'Ἆ','á¼'=>'Ἇ','á¼'=>'ἐ','ἑ'=>'ἑ','á¼’'=>'ἒ','ἓ'=>'ἓ','á¼”'=>'ἐÌ','ἕ'=>'ἑÌ','Ἐ'=>'Ἐ','á¼™'=>'Ἑ','Ἒ'=>'Ἒ','á¼›'=>'Ἓ','Ἔ'=>'ἘÌ','á¼'=>'ἙÌ','á¼ '=>'ἠ','ἡ'=>'ἡ','á¼¢'=>'ἢ','á¼£'=>'ἣ','ἤ'=>'ἠÌ','á¼¥'=>'ἡÌ','ἦ'=>'ἦ','ἧ'=>'ἧ','Ἠ'=>'Ἠ','Ἡ'=>'Ἡ','Ἢ'=>'Ἢ','Ἣ'=>'Ἣ','Ἤ'=>'ἨÌ','á¼­'=>'ἩÌ','á¼®'=>'Ἦ','Ἧ'=>'Ἧ','á¼°'=>'ἰ','á¼±'=>'ἱ','á¼²'=>'ἲ','á¼³'=>'ἳ','á¼´'=>'ἰÌ','á¼µ'=>'ἱÌ','ἶ'=>'ἶ','á¼·'=>'ἷ','Ἰ'=>'Ἰ','á¼¹'=>'Ἱ','Ἲ'=>'Ἲ','á¼»'=>'Ἳ','á¼¼'=>'ἸÌ','á¼½'=>'ἹÌ','á¼¾'=>'Ἶ','Ἷ'=>'Ἷ','á½€'=>'ὀ','á½'=>'ὁ','ὂ'=>'ὂ','ὃ'=>'ὃ','ὄ'=>'ὀÌ','á½…'=>'ὁÌ','Ὀ'=>'Ὀ','Ὁ'=>'Ὁ','Ὂ'=>'Ὂ','Ὃ'=>'Ὃ','Ὄ'=>'ὈÌ','á½'=>'ὉÌ','á½'=>'Ï…Ì“','ὑ'=>'Ï…Ì”','á½’'=>'Ï…Ì“Ì€','ὓ'=>'ὓ','á½”'=>'Ï…Ì“Ì','ὕ'=>'Ï…Ì”Ì','á½–'=>'Ï…Ì“Í‚','á½—'=>'ὗ','á½™'=>'Ὑ','á½›'=>'Ὓ','á½'=>'ὙÌ','Ὗ'=>'Ὗ','á½ '=>'ὠ','ὡ'=>'ὡ','á½¢'=>'ὢ','á½£'=>'ὣ','ὤ'=>'ὠÌ','á½¥'=>'ὡÌ','ὦ'=>'ὦ','ὧ'=>'ὧ','Ὠ'=>'Ὠ','Ὡ'=>'Ὡ','Ὢ'=>'Ὢ','Ὣ'=>'Ὣ','Ὤ'=>'ὨÌ','á½­'=>'ὩÌ','á½®'=>'Ὦ','Ὧ'=>'Ὧ','á½°'=>'ὰ','á½±'=>'αÌ','á½²'=>'ὲ','á½³'=>'εÌ','á½´'=>'ὴ','á½µ'=>'ηÌ','ὶ'=>'ὶ','á½·'=>'ιÌ','ὸ'=>'ὸ','á½¹'=>'οÌ','ὺ'=>'Ï…Ì€','á½»'=>'Ï…Ì','á½¼'=>'ὼ','á½½'=>'ωÌ','á¾€'=>'ᾀ','á¾'=>'ᾁ','ᾂ'=>'ᾂ','ᾃ'=>'ᾃ','ᾄ'=>'ἀÌÍ…','á¾…'=>'ἁÌÍ…','ᾆ'=>'ᾆ','ᾇ'=>'ᾇ','ᾈ'=>'ᾈ','ᾉ'=>'ᾉ','ᾊ'=>'ᾊ','ᾋ'=>'ᾋ','ᾌ'=>'ἈÌÍ…','á¾'=>'ἉÌÍ…','ᾎ'=>'ᾎ','á¾'=>'ᾏ','á¾'=>'ᾐ','ᾑ'=>'ᾑ','á¾’'=>'ᾒ','ᾓ'=>'ᾓ','á¾”'=>'ἠÌÍ…','ᾕ'=>'ἡÌÍ…','á¾–'=>'ᾖ','á¾—'=>'ᾗ','ᾘ'=>'ᾘ','á¾™'=>'ᾙ','ᾚ'=>'ᾚ','á¾›'=>'ᾛ','ᾜ'=>'ἨÌÍ…','á¾'=>'ἩÌÍ…','ᾞ'=>'ᾞ','ᾟ'=>'ᾟ','á¾ '=>'ᾠ','ᾡ'=>'ᾡ','á¾¢'=>'ᾢ','á¾£'=>'ᾣ','ᾤ'=>'ὠÌÍ…','á¾¥'=>'ὡÌÍ…','ᾦ'=>'ᾦ','ᾧ'=>'ᾧ','ᾨ'=>'ᾨ','ᾩ'=>'ᾩ','ᾪ'=>'ᾪ','ᾫ'=>'ᾫ','ᾬ'=>'ὨÌÍ…','á¾­'=>'ὩÌÍ…','á¾®'=>'ᾮ','ᾯ'=>'ᾯ','á¾°'=>'ᾰ','á¾±'=>'ᾱ','á¾²'=>'ᾲ','á¾³'=>'ᾳ','á¾´'=>'αÌÍ…','ᾶ'=>'ᾶ','á¾·'=>'ᾷ','Ᾰ'=>'Ᾰ','á¾¹'=>'Ᾱ','Ὰ'=>'Ὰ','á¾»'=>'ΑÌ','á¾¼'=>'ᾼ','á¾¾'=>'ι','á¿'=>'῁','á¿‚'=>'ῂ','ῃ'=>'ῃ','á¿„'=>'ηÌÍ…','ῆ'=>'ῆ','ῇ'=>'ῇ','Ὲ'=>'Ὲ','Έ'=>'ΕÌ','á¿Š'=>'Ὴ','á¿‹'=>'ΗÌ','á¿Œ'=>'ῌ','á¿'=>'῍','á¿Ž'=>'᾿Ì','á¿'=>'῏','á¿'=>'ῐ','á¿‘'=>'ῑ','á¿’'=>'ῒ','á¿“'=>'ϊÌ','á¿–'=>'ῖ','á¿—'=>'ῗ','Ῐ'=>'Ῐ','á¿™'=>'Ῑ','á¿š'=>'Ὶ','á¿›'=>'ΙÌ','á¿'=>'῝','á¿ž'=>'῾Ì','á¿Ÿ'=>'῟','á¿ '=>'ῠ','á¿¡'=>'Ï…Ì„','á¿¢'=>'ῢ','á¿£'=>'ϋÌ','ῤ'=>'ÏÌ“','á¿¥'=>'ÏÌ”','ῦ'=>'Ï…Í‚','ῧ'=>'ῧ','Ῠ'=>'Ῠ','á¿©'=>'Ῡ','Ὺ'=>'Ὺ','á¿«'=>'Î¥Ì','Ῥ'=>'Ῥ','á¿­'=>'῭','á¿®'=>'¨Ì','`'=>'`','ῲ'=>'ῲ','ῳ'=>'ῳ','á¿´'=>'ωÌÍ…','ῶ'=>'ῶ','á¿·'=>'ῷ','Ὸ'=>'Ὸ','Ό'=>'ΟÌ','Ὼ'=>'Ὼ','á¿»'=>'ΩÌ','ῼ'=>'ῼ','´'=>'´',' '=>' ','â€'=>' ','Ω'=>'Ω','K'=>'K','â„«'=>'AÌŠ','↚'=>'â†Ì¸','↛'=>'↛','↮'=>'↮','â‡'=>'â‡Ì¸','⇎'=>'⇎','â‡'=>'⇏','∄'=>'∄','∉'=>'∉','∌'=>'∌','∤'=>'∤','∦'=>'∦','â‰'=>'≁','≄'=>'≄','≇'=>'≇','≉'=>'≉','≠'=>'≠','≢'=>'≢','≭'=>'â‰Ì¸','≮'=>'≮','≯'=>'≯','≰'=>'≰','≱'=>'≱','≴'=>'≴','≵'=>'≵','≸'=>'≸','≹'=>'≹','⊀'=>'⊀','âŠ'=>'⊁','⊄'=>'⊄','⊅'=>'⊅','⊈'=>'⊈','⊉'=>'⊉','⊬'=>'⊬','⊭'=>'⊭','⊮'=>'⊮','⊯'=>'⊯','â‹ '=>'⋠','â‹¡'=>'⋡','â‹¢'=>'⋢','â‹£'=>'⋣','⋪'=>'⋪','â‹«'=>'⋫','⋬'=>'⋬','â‹­'=>'⋭','〈'=>'〈','〉'=>'〉','â«œ'=>'â«Ì¸','ãŒ'=>'ã‹ã‚™','ãŽ'=>'ãã‚™','ã'=>'ãã‚™','ã’'=>'ã‘ã‚™','ã”'=>'ã“ã‚™','ã–'=>'ã•ã‚™','ã˜'=>'ã—ã‚™','ãš'=>'ã™ã‚™','ãœ'=>'ã›ã‚™','ãž'=>'ãã‚™','ã '=>'ãŸã‚™','ã¢'=>'ã¡ã‚™','ã¥'=>'ã¤ã‚™','ã§'=>'ã¦ã‚™','ã©'=>'ã¨ã‚™','ã°'=>'ã¯ã‚™','ã±'=>'ã¯ã‚š','ã³'=>'ã²ã‚™','ã´'=>'ã²ã‚š','ã¶'=>'ãµã‚™','ã·'=>'ãµã‚š','ã¹'=>'ã¸ã‚™','ãº'=>'ã¸ã‚š','ã¼'=>'ã»ã‚™','ã½'=>'ã»ã‚š','ã‚”'=>'ã†ã‚™','ã‚ž'=>'ã‚ã‚™','ガ'=>'ã‚«ã‚™','ã‚®'=>'ã‚­ã‚™','ã‚°'=>'グ','ゲ'=>'ゲ','ã‚´'=>'ゴ','ザ'=>'ザ','ジ'=>'ã‚·ã‚™','ズ'=>'ズ','ゼ'=>'ゼ','ゾ'=>'ゾ','ダ'=>'ã‚¿ã‚™','ヂ'=>'ãƒã‚™','ヅ'=>'ヅ','デ'=>'デ','ド'=>'ド','ãƒ'=>'ãƒã‚™','パ'=>'ãƒã‚š','ビ'=>'ビ','ピ'=>'ピ','ブ'=>'ブ','プ'=>'プ','ベ'=>'ベ','ペ'=>'ペ','ボ'=>'ボ','ãƒ'=>'ポ','ヴ'=>'ヴ','ヷ'=>'ヷ','ヸ'=>'ヸ','ヹ'=>'ヹ','ヺ'=>'ヺ','ヾ'=>'ヾ','豈'=>'豈','ï¤'=>'æ›´','車'=>'車','賈'=>'賈','滑'=>'滑','串'=>'串','句'=>'å¥','龜'=>'龜','龜'=>'龜','契'=>'契','金'=>'金','喇'=>'å–‡','奈'=>'奈','ï¤'=>'懶','癩'=>'癩','ï¤'=>'ç¾…','ï¤'=>'蘿','螺'=>'螺','裸'=>'裸','邏'=>'é‚','樂'=>'樂','洛'=>'æ´›','烙'=>'烙','珞'=>'çž','落'=>'è½','酪'=>'é…ª','駱'=>'駱','亂'=>'亂','卵'=>'åµ','ï¤'=>'欄','爛'=>'爛','蘭'=>'蘭','鸞'=>'鸞','嵐'=>'åµ','濫'=>'æ¿«','藍'=>'è—','襤'=>'襤','拉'=>'拉','臘'=>'臘','蠟'=>'è Ÿ','廊'=>'廊','朗'=>'朗','浪'=>'浪','狼'=>'狼','郎'=>'郎','來'=>'來','冷'=>'冷','勞'=>'å‹ž','擄'=>'æ“„','櫓'=>'æ«“','爐'=>'çˆ','盧'=>'盧','老'=>'è€','蘆'=>'蘆','虜'=>'虜','路'=>'è·¯','露'=>'露','魯'=>'é­¯','鷺'=>'é·º','碌'=>'碌','祿'=>'祿','綠'=>'綠','菉'=>'è‰','錄'=>'錄','鹿'=>'鹿','ï¥'=>'è«–','壟'=>'壟','弄'=>'弄','籠'=>'ç± ','聾'=>'è¾','牢'=>'牢','磊'=>'磊','賂'=>'賂','雷'=>'é›·','壘'=>'壘','屢'=>'å±¢','樓'=>'樓','ï¥'=>'æ·š','漏'=>'æ¼','ï¥'=>'ç´¯','ï¥'=>'縷','陋'=>'陋','勒'=>'å‹’','肋'=>'è‚‹','凜'=>'凜','凌'=>'凌','稜'=>'稜','綾'=>'綾','菱'=>'è±','陵'=>'陵','讀'=>'讀','拏'=>'æ‹','樂'=>'樂','ï¥'=>'諾','丹'=>'丹','寧'=>'寧','怒'=>'怒','率'=>'率','異'=>'ç•°','北'=>'北','磻'=>'磻','便'=>'便','復'=>'復','不'=>'ä¸','泌'=>'泌','數'=>'數','索'=>'ç´¢','參'=>'åƒ','塞'=>'å¡ž','省'=>'çœ','葉'=>'葉','說'=>'說','殺'=>'殺','辰'=>'è¾°','沈'=>'沈','拾'=>'拾','若'=>'è‹¥','掠'=>'掠','略'=>'ç•¥','亮'=>'亮','兩'=>'å…©','凉'=>'凉','梁'=>'æ¢','糧'=>'糧','良'=>'良','諒'=>'è«’','量'=>'é‡','勵'=>'勵','呂'=>'å‘‚','ï¦'=>'女','廬'=>'廬','旅'=>'æ—…','濾'=>'濾','礪'=>'礪','閭'=>'é–­','驪'=>'驪','麗'=>'麗','黎'=>'黎','力'=>'力','曆'=>'曆','歷'=>'æ­·','ï¦'=>'è½¢','年'=>'å¹´','ï¦'=>'æ†','ï¦'=>'戀','撚'=>'æ’š','漣'=>'æ¼£','煉'=>'ç…‰','璉'=>'ç’‰','秊'=>'秊','練'=>'ç·´','聯'=>'è¯','輦'=>'輦','蓮'=>'è“®','連'=>'連','鍊'=>'éŠ','列'=>'列','ï¦'=>'劣','咽'=>'å’½','烈'=>'烈','裂'=>'裂','說'=>'說','廉'=>'廉','念'=>'念','捻'=>'æ»','殮'=>'æ®®','簾'=>'ç°¾','獵'=>'çµ','令'=>'令','囹'=>'囹','寧'=>'寧','嶺'=>'嶺','怜'=>'怜','玲'=>'玲','瑩'=>'ç‘©','羚'=>'羚','聆'=>'è†','鈴'=>'鈴','零'=>'零','靈'=>'éˆ','領'=>'é ˜','例'=>'例','禮'=>'禮','醴'=>'醴','隸'=>'隸','惡'=>'惡','了'=>'了','僚'=>'僚','寮'=>'寮','尿'=>'å°¿','料'=>'æ–™','樂'=>'樂','燎'=>'燎','ï§'=>'療','蓼'=>'蓼','遼'=>'é¼','龍'=>'é¾','暈'=>'暈','阮'=>'阮','劉'=>'劉','杻'=>'æ»','柳'=>'柳','流'=>'æµ','溜'=>'溜','琉'=>'ç‰','ï§'=>'ç•™','硫'=>'ç¡«','ï§'=>'ç´','ï§'=>'é¡ž','六'=>'å…­','戮'=>'戮','陸'=>'陸','倫'=>'倫','崙'=>'å´™','淪'=>'æ·ª','輪'=>'輪','律'=>'律','慄'=>'æ…„','栗'=>'æ —','率'=>'率','隆'=>'隆','ï§'=>'利','吏'=>'å','履'=>'å±¥','易'=>'易','李'=>'æŽ','梨'=>'梨','泥'=>'æ³¥','理'=>'ç†','痢'=>'ç—¢','罹'=>'ç½¹','裏'=>'è£','裡'=>'裡','里'=>'里','離'=>'離','匿'=>'匿','溺'=>'溺','吝'=>'å','燐'=>'ç‡','璘'=>'ç’˜','藺'=>'è—º','隣'=>'隣','鱗'=>'é±—','麟'=>'麟','林'=>'æž—','淋'=>'æ·‹','臨'=>'臨','立'=>'ç«‹','笠'=>'笠','粒'=>'ç²’','狀'=>'ç‹€','炙'=>'ç‚™','識'=>'è­˜','什'=>'什','茶'=>'茶','刺'=>'刺','切'=>'切','ï¨'=>'度','拓'=>'æ‹“','糖'=>'ç³–','宅'=>'å®…','洞'=>'æ´ž','暴'=>'æš´','輻'=>'è¼»','行'=>'è¡Œ','降'=>'é™','見'=>'見','廓'=>'廓','兀'=>'å…€','ï¨'=>'å—€','ï¨'=>'å¡š','晴'=>'æ™´','凞'=>'凞','猪'=>'猪','益'=>'益','礼'=>'礼','神'=>'神','祥'=>'祥','福'=>'ç¦','靖'=>'é–','ï¨'=>'ç²¾','羽'=>'ç¾½','蘒'=>'蘒','諸'=>'諸','逸'=>'逸','都'=>'都','飯'=>'飯','飼'=>'飼','館'=>'館','鶴'=>'鶴','侮'=>'ä¾®','僧'=>'僧','免'=>'å…','勉'=>'勉','勤'=>'勤','卑'=>'å‘','喝'=>'å–','嘆'=>'嘆','器'=>'器','塀'=>'å¡€','墨'=>'墨','層'=>'層','屮'=>'å±®','悔'=>'æ‚”','慨'=>'æ…¨','憎'=>'憎','ï©€'=>'懲','ï©'=>'æ•','ï©‚'=>'æ—¢','暑'=>'æš‘','ï©„'=>'梅','ï©…'=>'æµ·','渚'=>'渚','漢'=>'æ¼¢','煮'=>'ç…®','爫'=>'爫','ï©Š'=>'ç¢','ï©‹'=>'碑','ï©Œ'=>'社','ï©'=>'祉','ï©Ž'=>'祈','ï©'=>'ç¥','ï©'=>'祖','ï©‘'=>'ç¥','ï©’'=>'ç¦','ï©“'=>'禎','ï©”'=>'ç©€','ï©•'=>'çª','ï©–'=>'節','ï©—'=>'ç·´','縉'=>'縉','ï©™'=>'ç¹','ï©š'=>'ç½²','ï©›'=>'者','ï©œ'=>'臭','ï©'=>'艹','ï©ž'=>'艹','ï©Ÿ'=>'è‘—','ï© '=>'è¤','ï©¡'=>'視','ï©¢'=>'è¬','ï©£'=>'謹','賓'=>'賓','ï©¥'=>'è´ˆ','辶'=>'辶','逸'=>'逸','難'=>'難','ï©©'=>'響','頻'=>'é »','ï©°'=>'並','况'=>'况','全'=>'å…¨','侀'=>'ä¾€','ï©´'=>'å……','冀'=>'冀','勇'=>'勇','ï©·'=>'勺','喝'=>'å–','啕'=>'å••','喙'=>'å–™','ï©»'=>'å—¢','塚'=>'å¡š','墳'=>'墳','奄'=>'奄','ï©¿'=>'奔','婢'=>'å©¢','ïª'=>'嬨','廒'=>'å»’','廙'=>'å»™','彩'=>'彩','徭'=>'å¾­','惘'=>'惘','慎'=>'æ…Ž','愈'=>'愈','憎'=>'憎','慠'=>'æ… ','懲'=>'懲','戴'=>'戴','ïª'=>'æ„','搜'=>'æœ','ïª'=>'æ‘’','ïª'=>'æ•–','晴'=>'æ™´','朗'=>'朗','望'=>'望','杖'=>'æ–','歹'=>'æ­¹','殺'=>'殺','流'=>'æµ','滛'=>'æ»›','滋'=>'滋','漢'=>'æ¼¢','瀞'=>'瀞','煮'=>'ç…®','ïª'=>'瞧','爵'=>'爵','犯'=>'犯','猪'=>'猪','瑱'=>'瑱','甆'=>'甆','画'=>'ç”»','瘝'=>'ç˜','瘟'=>'瘟','益'=>'益','盛'=>'ç››','直'=>'ç›´','睊'=>'çŠ','着'=>'ç€','磌'=>'磌','窱'=>'窱','節'=>'節','类'=>'ç±»','絛'=>'çµ›','練'=>'ç·´','缾'=>'ç¼¾','者'=>'者','荒'=>'è’','華'=>'è¯','蝹'=>'è¹','襁'=>'è¥','覆'=>'覆','視'=>'視','調'=>'調','諸'=>'諸','請'=>'è«‹','謁'=>'è¬','諾'=>'諾','諭'=>'è«­','謹'=>'謹','ï«€'=>'變','ï«'=>'è´ˆ','ï«‚'=>'輸','遲'=>'é²','ï«„'=>'醙','ï«…'=>'鉶','陼'=>'陼','難'=>'難','靖'=>'é–','韛'=>'韛','ï«Š'=>'響','ï«‹'=>'é ‹','ï«Œ'=>'é »','ï«'=>'鬒','ï«Ž'=>'龜','ï«'=>'𢡊','ï«'=>'𢡄','ï«‘'=>'ð£•','ï«’'=>'ã®','ï«“'=>'䀘','ï«”'=>'䀹','ï«•'=>'𥉉','ï«–'=>'ð¥³','ï«—'=>'𧻓','齃'=>'齃','ï«™'=>'龎','ï¬'=>'×™Ö´','ײַ'=>'ײַ','שׁ'=>'ש×','שׂ'=>'שׂ','שּׁ'=>'שּ×','שּׂ'=>'שּׂ','אַ'=>'×Ö·','אָ'=>'×Ö¸','אּ'=>'×Ö¼','בּ'=>'בּ','גּ'=>'×’Ö¼','דּ'=>'דּ','הּ'=>'×”Ö¼','וּ'=>'וּ','זּ'=>'×–Ö¼','טּ'=>'טּ','יּ'=>'×™Ö¼','ךּ'=>'ךּ','כּ'=>'×›Ö¼','לּ'=>'לּ','מּ'=>'מּ','ï­€'=>'× Ö¼','ï­'=>'סּ','ï­ƒ'=>'×£Ö¼','ï­„'=>'פּ','ï­†'=>'צּ','ï­‡'=>'קּ','ï­ˆ'=>'רּ','ï­‰'=>'שּ','ï­Š'=>'תּ','ï­‹'=>'וֹ','ï­Œ'=>'בֿ','ï­'=>'×›Ö¿','ï­Ž'=>'פֿ','ð…ž'=>'ð…—ð…¥','ð…Ÿ'=>'ð…˜ð…¥','ð… '=>'ð…˜ð…¥ð…®','ð…¡'=>'ð…˜ð…¥ð…¯','ð…¢'=>'ð…˜ð…¥ð…°','ð…£'=>'ð…˜ð…¥ð…±','ð…¤'=>'ð…˜ð…¥ð…²','ð†»'=>'ð†¹ð…¥','ð†¼'=>'ð†ºð…¥','ð†½'=>'ð†¹ð…¥ð…®','ð†¾'=>'ð†ºð…¥ð…®','ð†¿'=>'ð†¹ð…¥ð…¯','ð‡€'=>'ð†ºð…¥ð…¯','丽'=>'丽','ð¯ '=>'丸','乁'=>'ä¹','𠄢'=>'ð „¢','你'=>'ä½ ','侮'=>'ä¾®','侻'=>'ä¾»','倂'=>'倂','偺'=>'åº','備'=>'å‚™','僧'=>'僧','像'=>'åƒ','㒞'=>'ã’ž','ð¯ '=>'𠘺','免'=>'å…','ð¯ '=>'å…”','ð¯ '=>'å…¤','具'=>'å…·','𠔜'=>'𠔜','㒹'=>'ã’¹','內'=>'å…§','再'=>'å†','𠕋'=>'ð •‹','冗'=>'冗','冤'=>'冤','仌'=>'仌','冬'=>'冬','况'=>'况','𩇟'=>'𩇟','ð¯ '=>'凵','刃'=>'刃','㓟'=>'ã“Ÿ','刻'=>'刻','剆'=>'剆','割'=>'割','剷'=>'剷','㔕'=>'㔕','勇'=>'勇','勉'=>'勉','勤'=>'勤','勺'=>'勺','包'=>'包','匆'=>'匆','北'=>'北','卉'=>'å‰','卑'=>'å‘','博'=>'åš','即'=>'å³','卽'=>'å½','卿'=>'å¿','卿'=>'å¿','卿'=>'å¿','𠨬'=>'𠨬','灰'=>'ç°','及'=>'åŠ','叟'=>'åŸ','𠭣'=>'ð ­£','叫'=>'å«','叱'=>'å±','吆'=>'å†','咞'=>'å’ž','吸'=>'å¸','呈'=>'呈','周'=>'周','咢'=>'å’¢','ð¯¡'=>'哶','唐'=>'å”','啓'=>'å•“','啣'=>'å•£','善'=>'å–„','善'=>'å–„','喙'=>'å–™','喫'=>'å–«','喳'=>'å–³','嗂'=>'å—‚','圖'=>'圖','嘆'=>'嘆','ð¯¡'=>'圗','噑'=>'噑','ð¯¡'=>'å™´','ð¯¡'=>'切','壮'=>'壮','城'=>'城','埴'=>'埴','堍'=>'å ','型'=>'åž‹','堲'=>'å ²','報'=>'å ±','墬'=>'墬','𡓤'=>'𡓤','売'=>'売','壷'=>'壷','夆'=>'夆','ð¯¡'=>'多','夢'=>'夢','奢'=>'奢','𡚨'=>'𡚨','𡛪'=>'𡛪','姬'=>'姬','娛'=>'娛','娧'=>'娧','姘'=>'姘','婦'=>'婦','㛮'=>'ã›®','㛼'=>'㛼','嬈'=>'嬈','嬾'=>'嬾','嬾'=>'嬾','𡧈'=>'𡧈','寃'=>'寃','寘'=>'寘','寧'=>'寧','寳'=>'寳','𡬘'=>'𡬘','寿'=>'寿','将'=>'å°†','当'=>'当','尢'=>'å°¢','㞁'=>'ãž','屠'=>'å± ','屮'=>'å±®','峀'=>'å³€','岍'=>'å²','𡷤'=>'ð¡·¤','嵃'=>'嵃','𡷦'=>'ð¡·¦','嵮'=>'åµ®','嵫'=>'嵫','嵼'=>'åµ¼','ð¯¢'=>'å·¡','巢'=>'å·¢','㠯'=>'ã ¯','巽'=>'å·½','帨'=>'帨','帽'=>'帽','幩'=>'幩','㡢'=>'ã¡¢','𢆃'=>'𢆃','㡼'=>'㡼','庰'=>'庰','庳'=>'庳','ð¯¢'=>'庶','廊'=>'廊','ð¯¢'=>'𪎒','ð¯¢'=>'廾','𢌱'=>'𢌱','𢌱'=>'𢌱','舁'=>'èˆ','弢'=>'å¼¢','弢'=>'å¼¢','㣇'=>'㣇','𣊸'=>'𣊸','𦇚'=>'𦇚','形'=>'å½¢','彫'=>'彫','㣣'=>'㣣','徚'=>'徚','ð¯¢'=>'å¿','志'=>'å¿—','忹'=>'忹','悁'=>'æ‚','㤺'=>'㤺','㤜'=>'㤜','悔'=>'æ‚”','𢛔'=>'𢛔','惇'=>'惇','慈'=>'æ…ˆ','慌'=>'æ…Œ','慎'=>'æ…Ž','慌'=>'æ…Œ','慺'=>'æ…º','憎'=>'憎','憲'=>'憲','憤'=>'憤','憯'=>'憯','懞'=>'懞','懲'=>'懲','懶'=>'懶','成'=>'æˆ','戛'=>'戛','扝'=>'æ‰','抱'=>'抱','拔'=>'æ‹”','捐'=>'æ','𢬌'=>'𢬌','挽'=>'挽','拼'=>'拼','捨'=>'æ¨','掃'=>'掃','揤'=>'æ¤','𢯱'=>'𢯱','搢'=>'æ¢','揅'=>'æ…','ð¯£'=>'掩','㨮'=>'㨮','摩'=>'æ‘©','摾'=>'摾','撝'=>'æ’','摷'=>'æ‘·','㩬'=>'㩬','敏'=>'æ•','敬'=>'敬','𣀊'=>'𣀊','旣'=>'æ—£','書'=>'書','ð¯£'=>'晉','㬙'=>'㬙','ð¯£'=>'æš‘','ð¯£'=>'㬈','㫤'=>'㫤','冒'=>'冒','冕'=>'冕','最'=>'最','暜'=>'æšœ','肭'=>'è‚­','䏙'=>'ä™','朗'=>'朗','望'=>'望','朡'=>'朡','杞'=>'æž','杓'=>'æ“','ð¯£'=>'ð£ƒ','㭉'=>'ã­‰','柺'=>'柺','枅'=>'æž…','桒'=>'æ¡’','梅'=>'梅','𣑭'=>'𣑭','梎'=>'梎','栟'=>'æ Ÿ','椔'=>'椔','㮝'=>'ã®','楂'=>'楂','榣'=>'榣','槪'=>'槪','檨'=>'檨','𣚣'=>'𣚣','櫛'=>'æ«›','㰘'=>'ã°˜','次'=>'次','𣢧'=>'𣢧','歔'=>'æ­”','㱎'=>'㱎','歲'=>'æ­²','殟'=>'殟','殺'=>'殺','殻'=>'æ®»','𣪍'=>'ð£ª','𡴋'=>'ð¡´‹','𣫺'=>'𣫺','汎'=>'汎','𣲼'=>'𣲼','沿'=>'沿','泍'=>'æ³','汧'=>'汧','洖'=>'æ´–','派'=>'æ´¾','ð¯¤'=>'æµ·','流'=>'æµ','浩'=>'浩','浸'=>'浸','涅'=>'涅','𣴞'=>'𣴞','洴'=>'æ´´','港'=>'港','湮'=>'æ¹®','㴳'=>'ã´³','滋'=>'滋','滇'=>'滇','ð¯¤'=>'𣻑','淹'=>'æ·¹','ð¯¤'=>'æ½®','ð¯¤'=>'𣽞','𣾎'=>'𣾎','濆'=>'濆','瀹'=>'瀹','瀞'=>'瀞','瀛'=>'瀛','㶖'=>'㶖','灊'=>'çŠ','災'=>'ç½','灷'=>'ç·','炭'=>'ç‚­','𠔥'=>'𠔥','煅'=>'ç……','ð¯¤'=>'𤉣','熜'=>'熜','𤎫'=>'𤎫','爨'=>'爨','爵'=>'爵','牐'=>'ç‰','𤘈'=>'𤘈','犀'=>'犀','犕'=>'犕','𤜵'=>'𤜵','𤠔'=>'𤠔','獺'=>'çº','王'=>'王','㺬'=>'㺬','玥'=>'玥','㺸'=>'㺸','㺸'=>'㺸','瑇'=>'瑇','瑜'=>'ç‘œ','瑱'=>'瑱','璅'=>'ç’…','瓊'=>'ç“Š','㼛'=>'ã¼›','甤'=>'甤','𤰶'=>'𤰶','甾'=>'甾','𤲒'=>'𤲒','異'=>'ç•°','𢆟'=>'𢆟','瘐'=>'ç˜','𤾡'=>'𤾡','𤾸'=>'𤾸','𥁄'=>'ð¥„','㿼'=>'㿼','䀈'=>'䀈','直'=>'ç›´','ð¯¥'=>'𥃳','𥃲'=>'𥃲','𥄙'=>'𥄙','𥄳'=>'𥄳','眞'=>'眞','真'=>'真','真'=>'真','睊'=>'çŠ','䀹'=>'䀹','瞋'=>'çž‹','䁆'=>'ä†','䂖'=>'ä‚–','ð¯¥'=>'ð¥','硎'=>'ç¡Ž','ð¯¥'=>'碌','ð¯¥'=>'磌','䃣'=>'䃣','𥘦'=>'𥘦','祖'=>'祖','𥚚'=>'𥚚','𥛅'=>'𥛅','福'=>'ç¦','秫'=>'秫','䄯'=>'䄯','穀'=>'ç©€','穊'=>'ç©Š','穏'=>'ç©','𥥼'=>'𥥼','ð¯¥'=>'𥪧','𥪧'=>'𥪧','竮'=>'ç«®','䈂'=>'䈂','𥮫'=>'𥮫','篆'=>'篆','築'=>'築','䈧'=>'䈧','𥲀'=>'𥲀','糒'=>'ç³’','䊠'=>'䊠','糨'=>'糨','糣'=>'ç³£','紀'=>'ç´€','𥾆'=>'𥾆','絣'=>'çµ£','䌁'=>'äŒ','緇'=>'ç·‡','縂'=>'縂','繅'=>'ç¹…','䌴'=>'䌴','𦈨'=>'𦈨','𦉇'=>'𦉇','䍙'=>'ä™','𦋙'=>'𦋙','罺'=>'罺','𦌾'=>'𦌾','羕'=>'羕','翺'=>'翺','者'=>'者','𦓚'=>'𦓚','𦔣'=>'𦔣','聠'=>'è ','𦖨'=>'𦖨','聰'=>'è°','𣍟'=>'ð£Ÿ','ð¯¦'=>'ä•','育'=>'育','脃'=>'脃','䐋'=>'ä‹','脾'=>'脾','媵'=>'媵','𦞧'=>'𦞧','𦞵'=>'𦞵','𣎓'=>'𣎓','𣎜'=>'𣎜','舁'=>'èˆ','舄'=>'舄','ð¯¦'=>'辞','䑫'=>'ä‘«','ð¯¦'=>'芑','ð¯¦'=>'芋','芝'=>'èŠ','劳'=>'劳','花'=>'花','芳'=>'芳','芽'=>'芽','苦'=>'苦','𦬼'=>'𦬼','若'=>'è‹¥','茝'=>'èŒ','荣'=>'è£','莭'=>'莭','茣'=>'茣','ð¯¦'=>'莽','菧'=>'è§','著'=>'è‘—','荓'=>'è“','菊'=>'èŠ','菌'=>'èŒ','菜'=>'èœ','𦰶'=>'𦰶','𦵫'=>'𦵫','𦳕'=>'𦳕','䔫'=>'䔫','蓱'=>'蓱','蓳'=>'蓳','蔖'=>'è”–','𧏊'=>'ð§Š','蕤'=>'蕤','𦼬'=>'𦼬','䕝'=>'ä•','䕡'=>'ä•¡','𦾱'=>'𦾱','𧃒'=>'𧃒','䕫'=>'ä•«','虐'=>'è™','虜'=>'虜','虧'=>'虧','虩'=>'虩','蚩'=>'èš©','蚈'=>'蚈','蜎'=>'蜎','蛢'=>'蛢','蝹'=>'è¹','蜨'=>'蜨','蝫'=>'è«','螆'=>'螆','䗗'=>'ä——','蟡'=>'蟡','ð¯§'=>'è ','䗹'=>'ä—¹','衠'=>'è¡ ','衣'=>'è¡£','𧙧'=>'𧙧','裗'=>'裗','裞'=>'裞','䘵'=>'䘵','裺'=>'裺','㒻'=>'ã’»','𧢮'=>'𧢮','𧥦'=>'𧥦','ð¯§'=>'äš¾','䛇'=>'䛇','ð¯§'=>'誠','ð¯§'=>'è«­','變'=>'變','豕'=>'豕','𧲨'=>'𧲨','貫'=>'貫','賁'=>'è³','贛'=>'è´›','起'=>'èµ·','𧼯'=>'𧼯','𠠄'=>'ð  „','跋'=>'è·‹','趼'=>'趼','跰'=>'è·°','ð¯§'=>'𠣞','軔'=>'è»”','輸'=>'輸','𨗒'=>'𨗒','𨗭'=>'𨗭','邔'=>'é‚”','郱'=>'郱','鄑'=>'é„‘','𨜮'=>'𨜮','鄛'=>'é„›','鈸'=>'鈸','鋗'=>'é‹—','鋘'=>'鋘','鉼'=>'鉼','鏹'=>'é¹','鐕'=>'é•','𨯺'=>'𨯺','開'=>'é–‹','䦕'=>'䦕','閷'=>'é–·','𨵷'=>'𨵷','䧦'=>'䧦','雃'=>'雃','嶲'=>'嶲','霣'=>'霣','𩅅'=>'ð©……','𩈚'=>'𩈚','䩮'=>'ä©®','䩶'=>'䩶','韠'=>'韠','𩐊'=>'ð©Š','䪲'=>'䪲','𩒖'=>'ð©’–','頋'=>'é ‹','頋'=>'é ‹','頩'=>'é ©','ð¯¨'=>'ð©–¶','飢'=>'飢','䬳'=>'䬳','餩'=>'餩','馧'=>'馧','駂'=>'駂','駾'=>'駾','䯎'=>'䯎','𩬰'=>'𩬰','鬒'=>'鬒','鱀'=>'é±€','鳽'=>'é³½','ð¯¨'=>'䳎','䳭'=>'ä³­','ð¯¨'=>'鵧','ð¯¨'=>'𪃎','䳸'=>'䳸','𪄅'=>'𪄅','𪈎'=>'𪈎','𪊑'=>'𪊑','麻'=>'麻','䵖'=>'äµ–','黹'=>'黹','黾'=>'黾','鼅'=>'é¼…','鼏'=>'é¼','鼖'=>'é¼–','鼻'=>'é¼»','ð¯¨'=>'𪘀');
diff --git a/phpBB/includes/utf/data/utf_compatibility_decomp.php b/phpBB/includes/utf/data/utf_compatibility_decomp.php
deleted file mode 100644
index c62948e81a..0000000000
--- a/phpBB/includes/utf/data/utf_compatibility_decomp.php
+++ /dev/null
@@ -1,2 +0,0 @@
-<?php
-$GLOBALS['utf_compatibility_decomp']=array(' '=>' ','¨'=>' ̈','ª'=>'a','¯'=>' Ì„','²'=>'2','³'=>'3','´'=>' Ì','µ'=>'μ','¸'=>' ̧','¹'=>'1','º'=>'o','¼'=>'1â„4','½'=>'1â„2','¾'=>'3â„4','À'=>'AÌ€','Ã'=>'AÌ','Â'=>'AÌ‚','Ã'=>'Ã','Ä'=>'Ä','Ã…'=>'AÌŠ','Ç'=>'Ç','È'=>'EÌ€','É'=>'EÌ','Ê'=>'EÌ‚','Ë'=>'Ë','ÃŒ'=>'IÌ€','Ã'=>'IÌ','ÃŽ'=>'IÌ‚','Ã'=>'Ï','Ñ'=>'Ñ','Ã’'=>'OÌ€','Ó'=>'OÌ','Ô'=>'OÌ‚','Õ'=>'Õ','Ö'=>'Ö','Ù'=>'UÌ€','Ú'=>'UÌ','Û'=>'UÌ‚','Ãœ'=>'Ü','Ã'=>'YÌ','à'=>'aÌ€','á'=>'aÌ','â'=>'aÌ‚','ã'=>'ã','ä'=>'ä','Ã¥'=>'aÌŠ','ç'=>'ç','è'=>'eÌ€','é'=>'eÌ','ê'=>'eÌ‚','ë'=>'ë','ì'=>'iÌ€','í'=>'iÌ','î'=>'iÌ‚','ï'=>'ï','ñ'=>'ñ','ò'=>'oÌ€','ó'=>'oÌ','ô'=>'oÌ‚','õ'=>'õ','ö'=>'ö','ù'=>'uÌ€','ú'=>'uÌ','û'=>'uÌ‚','ü'=>'ü','ý'=>'yÌ','ÿ'=>'ÿ','Ä€'=>'AÌ„','Ä'=>'aÌ„','Ä‚'=>'Ă','ă'=>'ă','Ä„'=>'Ą','Ä…'=>'ą','Ć'=>'CÌ','ć'=>'cÌ','Ĉ'=>'CÌ‚','ĉ'=>'cÌ‚','ÄŠ'=>'Ċ','Ä‹'=>'ċ','ÄŒ'=>'CÌŒ','Ä'=>'cÌŒ','ÄŽ'=>'DÌŒ','Ä'=>'dÌŒ','Ä’'=>'EÌ„','Ä“'=>'eÌ„','Ä”'=>'Ĕ','Ä•'=>'ĕ','Ä–'=>'Ė','Ä—'=>'ė','Ę'=>'Ę','Ä™'=>'ę','Äš'=>'EÌŒ','Ä›'=>'eÌŒ','Äœ'=>'GÌ‚','Ä'=>'gÌ‚','Äž'=>'Ğ','ÄŸ'=>'ğ','Ä '=>'Ġ','Ä¡'=>'ġ','Ä¢'=>'Ģ','Ä£'=>'ģ','Ĥ'=>'HÌ‚','Ä¥'=>'hÌ‚','Ĩ'=>'Ĩ','Ä©'=>'ĩ','Ī'=>'IÌ„','Ä«'=>'iÌ„','Ĭ'=>'Ĭ','Ä­'=>'ĭ','Ä®'=>'Į','į'=>'į','Ä°'=>'İ','IJ'=>'IJ','ij'=>'ij','Ä´'=>'JÌ‚','ĵ'=>'jÌ‚','Ķ'=>'Ķ','Ä·'=>'ķ','Ĺ'=>'LÌ','ĺ'=>'lÌ','Ä»'=>'Ļ','ļ'=>'ļ','Ľ'=>'LÌŒ','ľ'=>'lÌŒ','Ä¿'=>'L·','Å€'=>'l·','Ń'=>'NÌ','Å„'=>'nÌ','Å…'=>'Ņ','ņ'=>'ņ','Ň'=>'NÌŒ','ň'=>'nÌŒ','ʼn'=>'ʼn','ÅŒ'=>'OÌ„','Å'=>'oÌ„','ÅŽ'=>'Ŏ','Å'=>'ŏ','Å'=>'OÌ‹','Å‘'=>'oÌ‹','Å”'=>'RÌ','Å•'=>'rÌ','Å–'=>'Ŗ','Å—'=>'ŗ','Ř'=>'RÌŒ','Å™'=>'rÌŒ','Åš'=>'SÌ','Å›'=>'sÌ','Åœ'=>'SÌ‚','Å'=>'sÌ‚','Åž'=>'Ş','ÅŸ'=>'ş','Å '=>'SÌŒ','Å¡'=>'sÌŒ','Å¢'=>'Ţ','Å£'=>'ţ','Ť'=>'TÌŒ','Å¥'=>'tÌŒ','Ũ'=>'Ũ','Å©'=>'ũ','Ū'=>'UÌ„','Å«'=>'uÌ„','Ŭ'=>'Ŭ','Å­'=>'ŭ','Å®'=>'UÌŠ','ů'=>'uÌŠ','Å°'=>'UÌ‹','ű'=>'uÌ‹','Ų'=>'Ų','ų'=>'ų','Å´'=>'WÌ‚','ŵ'=>'wÌ‚','Ŷ'=>'YÌ‚','Å·'=>'yÌ‚','Ÿ'=>'Ÿ','Ź'=>'ZÌ','ź'=>'zÌ','Å»'=>'Ż','ż'=>'ż','Ž'=>'ZÌŒ','ž'=>'zÌŒ','Å¿'=>'s','Æ '=>'OÌ›','Æ¡'=>'oÌ›','Ư'=>'UÌ›','Æ°'=>'uÌ›','Ç„'=>'DZÌŒ','Ç…'=>'DzÌŒ','dž'=>'dzÌŒ','LJ'=>'LJ','Lj'=>'Lj','lj'=>'lj','ÇŠ'=>'NJ','Ç‹'=>'Nj','ÇŒ'=>'nj','Ç'=>'AÌŒ','ÇŽ'=>'aÌŒ','Ç'=>'IÌŒ','Ç'=>'iÌŒ','Ç‘'=>'OÌŒ','Ç’'=>'oÌŒ','Ç“'=>'UÌŒ','Ç”'=>'uÌŒ','Ç•'=>'Ǖ','Ç–'=>'ǖ','Ç—'=>'ÜÌ','ǘ'=>'üÌ','Ç™'=>'Ǚ','Çš'=>'ǚ','Ç›'=>'Ǜ','Çœ'=>'ǜ','Çž'=>'Ǟ','ÇŸ'=>'ǟ','Ç '=>'Ǡ','Ç¡'=>'ǡ','Ç¢'=>'Ǣ','Ç£'=>'ǣ','Ǧ'=>'GÌŒ','ǧ'=>'gÌŒ','Ǩ'=>'KÌŒ','Ç©'=>'kÌŒ','Ǫ'=>'Ǫ','Ç«'=>'ǫ','Ǭ'=>'Ǭ','Ç­'=>'ǭ','Ç®'=>'Æ·ÌŒ','ǯ'=>'Ê’ÌŒ','Ç°'=>'jÌŒ','DZ'=>'DZ','Dz'=>'Dz','dz'=>'dz','Ç´'=>'GÌ','ǵ'=>'gÌ','Ǹ'=>'NÌ€','ǹ'=>'nÌ€','Ǻ'=>'AÌŠÌ','Ç»'=>'aÌŠÌ','Ǽ'=>'ÆÌ','ǽ'=>'æÌ','Ǿ'=>'ØÌ','Ç¿'=>'øÌ','È€'=>'AÌ','È'=>'aÌ','È‚'=>'AÌ‘','ȃ'=>'aÌ‘','È„'=>'EÌ','È…'=>'eÌ','Ȇ'=>'EÌ‘','ȇ'=>'eÌ‘','Ȉ'=>'IÌ','ȉ'=>'iÌ','ÈŠ'=>'IÌ‘','È‹'=>'iÌ‘','ÈŒ'=>'OÌ','È'=>'oÌ','ÈŽ'=>'OÌ‘','È'=>'oÌ‘','È'=>'RÌ','È‘'=>'rÌ','È’'=>'RÌ‘','È“'=>'rÌ‘','È”'=>'UÌ','È•'=>'uÌ','È–'=>'UÌ‘','È—'=>'uÌ‘','Ș'=>'Ș','È™'=>'ș','Èš'=>'Ț','È›'=>'ț','Èž'=>'HÌŒ','ÈŸ'=>'hÌŒ','Ȧ'=>'Ȧ','ȧ'=>'ȧ','Ȩ'=>'Ȩ','È©'=>'ȩ','Ȫ'=>'Ȫ','È«'=>'ȫ','Ȭ'=>'Ȭ','È­'=>'ȭ','È®'=>'Ȯ','ȯ'=>'ȯ','È°'=>'Ȱ','ȱ'=>'ȱ','Ȳ'=>'YÌ„','ȳ'=>'yÌ„','Ê°'=>'h','ʱ'=>'ɦ','ʲ'=>'j','ʳ'=>'r','Ê´'=>'ɹ','ʵ'=>'É»','ʶ'=>'Ê','Ê·'=>'w','ʸ'=>'y','˘'=>' ̆','Ë™'=>' ̇','Ëš'=>' ÌŠ','Ë›'=>' ̨','Ëœ'=>' ̃','Ë'=>' Ì‹','Ë '=>'É£','Ë¡'=>'l','Ë¢'=>'s','Ë£'=>'x','ˤ'=>'Ê•','Í€'=>'Ì€','Í'=>'Ì','̓'=>'Ì“','Í„'=>'̈Ì','Í´'=>'ʹ','ͺ'=>' Í…',';'=>';','΄'=>' Ì','Î…'=>' ̈Ì','Ά'=>'ΑÌ','·'=>'·','Έ'=>'ΕÌ','Ή'=>'ΗÌ','Ί'=>'ΙÌ','ÎŒ'=>'ΟÌ','ÎŽ'=>'Î¥Ì','Î'=>'ΩÌ','Î'=>'ϊÌ','Ϊ'=>'Ϊ','Ϋ'=>'Ϋ','ά'=>'αÌ','έ'=>'εÌ','ή'=>'ηÌ','ί'=>'ιÌ','ΰ'=>'ϋÌ','ÏŠ'=>'ϊ','Ï‹'=>'ϋ','ÏŒ'=>'οÌ','Ï'=>'Ï…Ì','ÏŽ'=>'ωÌ','Ï'=>'β','Ï‘'=>'θ','Ï’'=>'Î¥','Ï“'=>'Î¥Ì','Ï”'=>'Ϋ','Ï•'=>'φ','Ï–'=>'Ï€','Ï°'=>'κ','ϱ'=>'Ï','ϲ'=>'Ï‚','Ï´'=>'Θ','ϵ'=>'ε','Ϲ'=>'Σ','Ѐ'=>'Ѐ','Ð'=>'Ё','Ѓ'=>'ГÌ','Ї'=>'Ї','ÐŒ'=>'КÌ','Ð'=>'Ѝ','ÐŽ'=>'Ў','Й'=>'Й','й'=>'й','Ñ'=>'ѐ','Ñ‘'=>'ё','Ñ“'=>'гÌ','Ñ—'=>'ї','Ñœ'=>'кÌ','Ñ'=>'ѝ','Ñž'=>'ў','Ѷ'=>'Ñ´Ì','Ñ·'=>'ѵÌ','Ó'=>'Ӂ','Ó‚'=>'ӂ','Ó'=>'Ð̆','Ó‘'=>'ӑ','Ó’'=>'Ð̈','Ó“'=>'ӓ','Ó–'=>'Ӗ','Ó—'=>'ӗ','Óš'=>'Ӛ','Ó›'=>'ӛ','Óœ'=>'Ӝ','Ó'=>'ӝ','Óž'=>'Ӟ','ÓŸ'=>'ӟ','Ó¢'=>'Ӣ','Ó£'=>'ӣ','Ó¤'=>'Ӥ','Ó¥'=>'ӥ','Ó¦'=>'Ӧ','Ó§'=>'ӧ','Óª'=>'Ӫ','Ó«'=>'ӫ','Ó¬'=>'Ӭ','Ó­'=>'Ñ̈','Ó®'=>'Ӯ','Ó¯'=>'ӯ','Ó°'=>'Ӱ','Ó±'=>'ӱ','Ó²'=>'Ӳ','Ó³'=>'ӳ','Ó´'=>'Ӵ','Óµ'=>'ӵ','Ó¸'=>'Ӹ','Ó¹'=>'ӹ','Ö‡'=>'Õ¥Ö‚','Ø¢'=>'آ','Ø£'=>'أ','ؤ'=>'ÙˆÙ”','Ø¥'=>'إ','ئ'=>'ÙŠÙ”','Ùµ'=>'اٴ','Ù¶'=>'وٴ','Ù·'=>'Û‡Ù´','Ù¸'=>'يٴ','Û€'=>'Û•Ù”','Û‚'=>'ÛÙ”','Û“'=>'Û’Ù”','ऩ'=>'ऩ','ऱ'=>'ऱ','ऴ'=>'ऴ','क़'=>'क़','ख़'=>'ख़','ग़'=>'ग़','ज़'=>'ज़','ड़'=>'ड़','à¥'=>'ढ़','फ़'=>'फ़','य़'=>'य़','ো'=>'ো','ৌ'=>'ৌ','ড়'=>'ড়','à§'=>'ঢ়','য়'=>'য়','ਲ਼'=>'ਲ਼','ਸ਼'=>'ਸ਼','à©™'=>'ਖ਼','à©š'=>'ਗ਼','à©›'=>'ਜ਼','à©ž'=>'ਫ਼','à­ˆ'=>'ୈ','à­‹'=>'ୋ','à­Œ'=>'ୌ','à­œ'=>'ଡ଼','à­'=>'ଢ଼','à®”'=>'ஔ','ொ'=>'ொ','ோ'=>'ோ','ௌ'=>'ௌ','ై'=>'ై','à³€'=>'ೀ','ೇ'=>'ೇ','ೈ'=>'ೈ','ೊ'=>'ೊ','ೋ'=>'ೋ','ൊ'=>'ൊ','ോ'=>'ോ','ൌ'=>'ൌ','à·š'=>'ේ','à·œ'=>'à·™à·','à·'=>'à·™à·à·Š','à·ž'=>'ෞ','ำ'=>'à¹à¸²','ຳ'=>'à»àº²','ໜ'=>'ຫນ','à»'=>'ຫມ','༌'=>'་','གྷ'=>'གྷ','à½'=>'ཌྷ','དྷ'=>'དྷ','བྷ'=>'བྷ','ཛྷ'=>'ཛྷ','ཀྵ'=>'ཀྵ','ཱི'=>'ཱི','ཱུ'=>'ཱུ','ྲྀ'=>'ྲྀ','ཷ'=>'ྲཱྀ','ླྀ'=>'ླྀ','ཹ'=>'ླཱྀ','à¾'=>'ཱྀ','ྒྷ'=>'ྒྷ','à¾'=>'ྜྷ','ྡྷ'=>'ྡྷ','ྦྷ'=>'ྦྷ','ྫྷ'=>'ྫྷ','ྐྵ'=>'à¾à¾µ','ဦ'=>'ဦ','ჼ'=>'ნ','ᬆ'=>'ᬆ','ᬈ'=>'ᬈ','ᬊ'=>'ᬊ','ᬌ'=>'ᬌ','ᬎ'=>'á¬á¬µ','ᬒ'=>'ᬒ','ᬻ'=>'ᬻ','ᬽ'=>'ᬽ','á­€'=>'ᭀ','á­'=>'ᭁ','á­ƒ'=>'ᭃ','á´¬'=>'A','á´­'=>'Æ','á´®'=>'B','á´°'=>'D','á´±'=>'E','á´²'=>'ÆŽ','á´³'=>'G','á´´'=>'H','á´µ'=>'I','á´¶'=>'J','á´·'=>'K','á´¸'=>'L','á´¹'=>'M','á´º'=>'N','á´¼'=>'O','á´½'=>'È¢','á´¾'=>'P','á´¿'=>'R','áµ€'=>'T','áµ'=>'U','ᵂ'=>'W','ᵃ'=>'a','ᵄ'=>'É','áµ…'=>'É‘','ᵆ'=>'á´‚','ᵇ'=>'b','ᵈ'=>'d','ᵉ'=>'e','ᵊ'=>'É™','ᵋ'=>'É›','ᵌ'=>'Éœ','áµ'=>'g','áµ'=>'k','áµ'=>'m','ᵑ'=>'Å‹','áµ’'=>'o','ᵓ'=>'É”','áµ”'=>'á´–','ᵕ'=>'á´—','áµ–'=>'p','áµ—'=>'t','ᵘ'=>'u','áµ™'=>'á´','ᵚ'=>'ɯ','áµ›'=>'v','ᵜ'=>'á´¥','áµ'=>'β','ᵞ'=>'γ','ᵟ'=>'δ','áµ '=>'φ','ᵡ'=>'χ','áµ¢'=>'i','áµ£'=>'r','ᵤ'=>'u','áµ¥'=>'v','ᵦ'=>'β','ᵧ'=>'γ','ᵨ'=>'Ï','ᵩ'=>'φ','ᵪ'=>'χ','ᵸ'=>'н','ᶛ'=>'É’','ᶜ'=>'c','á¶'=>'É•','ᶞ'=>'ð','ᶟ'=>'Éœ','ᶠ'=>'f','ᶡ'=>'ÉŸ','ᶢ'=>'É¡','ᶣ'=>'É¥','ᶤ'=>'ɨ','ᶥ'=>'É©','ᶦ'=>'ɪ','ᶧ'=>'áµ»','ᶨ'=>'Ê','ᶩ'=>'É­','ᶪ'=>'ᶅ','ᶫ'=>'ÊŸ','ᶬ'=>'ɱ','ᶭ'=>'É°','ᶮ'=>'ɲ','ᶯ'=>'ɳ','ᶰ'=>'É´','ᶱ'=>'ɵ','ᶲ'=>'ɸ','ᶳ'=>'Ê‚','ᶴ'=>'ʃ','ᶵ'=>'Æ«','ᶶ'=>'ʉ','ᶷ'=>'ÊŠ','ᶸ'=>'á´œ','ᶹ'=>'Ê‹','ᶺ'=>'ÊŒ','ᶻ'=>'z','ᶼ'=>'Ê','ᶽ'=>'Ê‘','ᶾ'=>'Ê’','ᶿ'=>'θ','Ḁ'=>'AÌ¥','á¸'=>'aÌ¥','Ḃ'=>'Ḃ','ḃ'=>'ḃ','Ḅ'=>'BÌ£','ḅ'=>'bÌ£','Ḇ'=>'Ḇ','ḇ'=>'ḇ','Ḉ'=>'ÇÌ','ḉ'=>'çÌ','Ḋ'=>'Ḋ','ḋ'=>'ḋ','Ḍ'=>'DÌ£','á¸'=>'dÌ£','Ḏ'=>'Ḏ','á¸'=>'ḏ','á¸'=>'Ḑ','ḑ'=>'ḑ','Ḓ'=>'DÌ­','ḓ'=>'dÌ­','Ḕ'=>'EÌ„Ì€','ḕ'=>'eÌ„Ì€','Ḗ'=>'EÌ„Ì','ḗ'=>'eÌ„Ì','Ḙ'=>'EÌ­','ḙ'=>'eÌ­','Ḛ'=>'EÌ°','ḛ'=>'eÌ°','Ḝ'=>'Ḝ','á¸'=>'ḝ','Ḟ'=>'Ḟ','ḟ'=>'ḟ','Ḡ'=>'GÌ„','ḡ'=>'gÌ„','Ḣ'=>'Ḣ','ḣ'=>'ḣ','Ḥ'=>'HÌ£','ḥ'=>'hÌ£','Ḧ'=>'Ḧ','ḧ'=>'ḧ','Ḩ'=>'Ḩ','ḩ'=>'ḩ','Ḫ'=>'HÌ®','ḫ'=>'hÌ®','Ḭ'=>'IÌ°','ḭ'=>'iÌ°','Ḯ'=>'ÏÌ','ḯ'=>'ïÌ','Ḱ'=>'KÌ','ḱ'=>'kÌ','Ḳ'=>'KÌ£','ḳ'=>'kÌ£','Ḵ'=>'Ḵ','ḵ'=>'ḵ','Ḷ'=>'LÌ£','ḷ'=>'lÌ£','Ḹ'=>'Ḹ','ḹ'=>'ḹ','Ḻ'=>'Ḻ','ḻ'=>'ḻ','Ḽ'=>'LÌ­','ḽ'=>'lÌ­','Ḿ'=>'MÌ','ḿ'=>'mÌ','á¹€'=>'Ṁ','á¹'=>'ṁ','Ṃ'=>'MÌ£','ṃ'=>'mÌ£','Ṅ'=>'Ṅ','á¹…'=>'ṅ','Ṇ'=>'NÌ£','ṇ'=>'nÌ£','Ṉ'=>'Ṉ','ṉ'=>'ṉ','Ṋ'=>'NÌ­','ṋ'=>'nÌ­','Ṍ'=>'ÕÌ','á¹'=>'õÌ','Ṏ'=>'Ṏ','á¹'=>'ṏ','á¹'=>'OÌ„Ì€','ṑ'=>'oÌ„Ì€','á¹’'=>'OÌ„Ì','ṓ'=>'oÌ„Ì','á¹”'=>'PÌ','ṕ'=>'pÌ','á¹–'=>'Ṗ','á¹—'=>'ṗ','Ṙ'=>'Ṙ','á¹™'=>'ṙ','Ṛ'=>'RÌ£','á¹›'=>'rÌ£','Ṝ'=>'Ṝ','á¹'=>'ṝ','Ṟ'=>'Ṟ','ṟ'=>'ṟ','á¹ '=>'Ṡ','ṡ'=>'ṡ','á¹¢'=>'SÌ£','á¹£'=>'sÌ£','Ṥ'=>'SÌ̇','á¹¥'=>'sÌ̇','Ṧ'=>'Ṧ','ṧ'=>'ṧ','Ṩ'=>'Ṩ','ṩ'=>'ṩ','Ṫ'=>'Ṫ','ṫ'=>'ṫ','Ṭ'=>'TÌ£','á¹­'=>'tÌ£','á¹®'=>'Ṯ','ṯ'=>'ṯ','á¹°'=>'TÌ­','á¹±'=>'tÌ­','á¹²'=>'Ṳ','á¹³'=>'ṳ','á¹´'=>'UÌ°','á¹µ'=>'uÌ°','Ṷ'=>'UÌ­','á¹·'=>'uÌ­','Ṹ'=>'ŨÌ','á¹¹'=>'ũÌ','Ṻ'=>'Ṻ','á¹»'=>'ṻ','á¹¼'=>'Ṽ','á¹½'=>'ṽ','á¹¾'=>'VÌ£','ṿ'=>'vÌ£','Ẁ'=>'WÌ€','áº'=>'wÌ€','Ẃ'=>'WÌ','ẃ'=>'wÌ','Ẅ'=>'Ẅ','ẅ'=>'ẅ','Ẇ'=>'Ẇ','ẇ'=>'ẇ','Ẉ'=>'WÌ£','ẉ'=>'wÌ£','Ẋ'=>'Ẋ','ẋ'=>'ẋ','Ẍ'=>'Ẍ','áº'=>'ẍ','Ẏ'=>'Ẏ','áº'=>'ẏ','áº'=>'ZÌ‚','ẑ'=>'zÌ‚','Ẓ'=>'ZÌ£','ẓ'=>'zÌ£','Ẕ'=>'Ẕ','ẕ'=>'ẕ','ẖ'=>'ẖ','ẗ'=>'ẗ','ẘ'=>'wÌŠ','ẙ'=>'yÌŠ','ẚ'=>'aʾ','ẛ'=>'ṡ','Ạ'=>'AÌ£','ạ'=>'aÌ£','Ả'=>'Ả','ả'=>'ả','Ấ'=>'AÌ‚Ì','ấ'=>'aÌ‚Ì','Ầ'=>'AÌ‚Ì€','ầ'=>'aÌ‚Ì€','Ẩ'=>'Ẩ','ẩ'=>'ẩ','Ẫ'=>'Ẫ','ẫ'=>'ẫ','Ậ'=>'Ậ','ậ'=>'ậ','Ắ'=>'ĂÌ','ắ'=>'ăÌ','Ằ'=>'Ằ','ằ'=>'ằ','Ẳ'=>'Ẳ','ẳ'=>'ẳ','Ẵ'=>'Ẵ','ẵ'=>'ẵ','Ặ'=>'Ặ','ặ'=>'ặ','Ẹ'=>'EÌ£','ẹ'=>'eÌ£','Ẻ'=>'Ẻ','ẻ'=>'ẻ','Ẽ'=>'Ẽ','ẽ'=>'ẽ','Ế'=>'EÌ‚Ì','ế'=>'eÌ‚Ì','Ề'=>'EÌ‚Ì€','á»'=>'eÌ‚Ì€','Ể'=>'Ể','ể'=>'ể','Ễ'=>'Ễ','á»…'=>'ễ','Ệ'=>'Ệ','ệ'=>'ệ','Ỉ'=>'Ỉ','ỉ'=>'ỉ','Ị'=>'IÌ£','ị'=>'iÌ£','Ọ'=>'OÌ£','á»'=>'oÌ£','Ỏ'=>'Ỏ','á»'=>'ỏ','á»'=>'OÌ‚Ì','ố'=>'oÌ‚Ì','á»’'=>'OÌ‚Ì€','ồ'=>'oÌ‚Ì€','á»”'=>'Ổ','ổ'=>'ổ','á»–'=>'Ỗ','á»—'=>'ỗ','Ộ'=>'Ộ','á»™'=>'ộ','Ớ'=>'OÌ›Ì','á»›'=>'oÌ›Ì','Ờ'=>'Ờ','á»'=>'ờ','Ở'=>'Ở','ở'=>'ở','á» '=>'Ỡ','ỡ'=>'ỡ','Ợ'=>'Ợ','ợ'=>'ợ','Ụ'=>'UÌ£','ụ'=>'uÌ£','Ủ'=>'Ủ','ủ'=>'ủ','Ứ'=>'UÌ›Ì','ứ'=>'uÌ›Ì','Ừ'=>'Ừ','ừ'=>'ừ','Ử'=>'Ử','á»­'=>'ử','á»®'=>'Ữ','ữ'=>'ữ','á»°'=>'Ự','á»±'=>'ự','Ỳ'=>'YÌ€','ỳ'=>'yÌ€','á»´'=>'YÌ£','ỵ'=>'yÌ£','Ỷ'=>'Ỷ','á»·'=>'ỷ','Ỹ'=>'Ỹ','ỹ'=>'ỹ','á¼€'=>'ἀ','á¼'=>'ἁ','ἂ'=>'ἂ','ἃ'=>'ἃ','ἄ'=>'ἀÌ','á¼…'=>'ἁÌ','ἆ'=>'ἆ','ἇ'=>'ἇ','Ἀ'=>'Ἀ','Ἁ'=>'Ἁ','Ἂ'=>'Ἂ','Ἃ'=>'Ἃ','Ἄ'=>'ἈÌ','á¼'=>'ἉÌ','Ἆ'=>'Ἆ','á¼'=>'Ἇ','á¼'=>'ἐ','ἑ'=>'ἑ','á¼’'=>'ἒ','ἓ'=>'ἓ','á¼”'=>'ἐÌ','ἕ'=>'ἑÌ','Ἐ'=>'Ἐ','á¼™'=>'Ἑ','Ἒ'=>'Ἒ','á¼›'=>'Ἓ','Ἔ'=>'ἘÌ','á¼'=>'ἙÌ','á¼ '=>'ἠ','ἡ'=>'ἡ','á¼¢'=>'ἢ','á¼£'=>'ἣ','ἤ'=>'ἠÌ','á¼¥'=>'ἡÌ','ἦ'=>'ἦ','ἧ'=>'ἧ','Ἠ'=>'Ἠ','Ἡ'=>'Ἡ','Ἢ'=>'Ἢ','Ἣ'=>'Ἣ','Ἤ'=>'ἨÌ','á¼­'=>'ἩÌ','á¼®'=>'Ἦ','Ἧ'=>'Ἧ','á¼°'=>'ἰ','á¼±'=>'ἱ','á¼²'=>'ἲ','á¼³'=>'ἳ','á¼´'=>'ἰÌ','á¼µ'=>'ἱÌ','ἶ'=>'ἶ','á¼·'=>'ἷ','Ἰ'=>'Ἰ','á¼¹'=>'Ἱ','Ἲ'=>'Ἲ','á¼»'=>'Ἳ','á¼¼'=>'ἸÌ','á¼½'=>'ἹÌ','á¼¾'=>'Ἶ','Ἷ'=>'Ἷ','á½€'=>'ὀ','á½'=>'ὁ','ὂ'=>'ὂ','ὃ'=>'ὃ','ὄ'=>'ὀÌ','á½…'=>'ὁÌ','Ὀ'=>'Ὀ','Ὁ'=>'Ὁ','Ὂ'=>'Ὂ','Ὃ'=>'Ὃ','Ὄ'=>'ὈÌ','á½'=>'ὉÌ','á½'=>'Ï…Ì“','ὑ'=>'Ï…Ì”','á½’'=>'Ï…Ì“Ì€','ὓ'=>'ὓ','á½”'=>'Ï…Ì“Ì','ὕ'=>'Ï…Ì”Ì','á½–'=>'Ï…Ì“Í‚','á½—'=>'ὗ','á½™'=>'Ὑ','á½›'=>'Ὓ','á½'=>'ὙÌ','Ὗ'=>'Ὗ','á½ '=>'ὠ','ὡ'=>'ὡ','á½¢'=>'ὢ','á½£'=>'ὣ','ὤ'=>'ὠÌ','á½¥'=>'ὡÌ','ὦ'=>'ὦ','ὧ'=>'ὧ','Ὠ'=>'Ὠ','Ὡ'=>'Ὡ','Ὢ'=>'Ὢ','Ὣ'=>'Ὣ','Ὤ'=>'ὨÌ','á½­'=>'ὩÌ','á½®'=>'Ὦ','Ὧ'=>'Ὧ','á½°'=>'ὰ','á½±'=>'αÌ','á½²'=>'ὲ','á½³'=>'εÌ','á½´'=>'ὴ','á½µ'=>'ηÌ','ὶ'=>'ὶ','á½·'=>'ιÌ','ὸ'=>'ὸ','á½¹'=>'οÌ','ὺ'=>'Ï…Ì€','á½»'=>'Ï…Ì','á½¼'=>'ὼ','á½½'=>'ωÌ','á¾€'=>'ᾀ','á¾'=>'ᾁ','ᾂ'=>'ᾂ','ᾃ'=>'ᾃ','ᾄ'=>'ἀÌÍ…','á¾…'=>'ἁÌÍ…','ᾆ'=>'ᾆ','ᾇ'=>'ᾇ','ᾈ'=>'ᾈ','ᾉ'=>'ᾉ','ᾊ'=>'ᾊ','ᾋ'=>'ᾋ','ᾌ'=>'ἈÌÍ…','á¾'=>'ἉÌÍ…','ᾎ'=>'ᾎ','á¾'=>'ᾏ','á¾'=>'ᾐ','ᾑ'=>'ᾑ','á¾’'=>'ᾒ','ᾓ'=>'ᾓ','á¾”'=>'ἠÌÍ…','ᾕ'=>'ἡÌÍ…','á¾–'=>'ᾖ','á¾—'=>'ᾗ','ᾘ'=>'ᾘ','á¾™'=>'ᾙ','ᾚ'=>'ᾚ','á¾›'=>'ᾛ','ᾜ'=>'ἨÌÍ…','á¾'=>'ἩÌÍ…','ᾞ'=>'ᾞ','ᾟ'=>'ᾟ','á¾ '=>'ᾠ','ᾡ'=>'ᾡ','á¾¢'=>'ᾢ','á¾£'=>'ᾣ','ᾤ'=>'ὠÌÍ…','á¾¥'=>'ὡÌÍ…','ᾦ'=>'ᾦ','ᾧ'=>'ᾧ','ᾨ'=>'ᾨ','ᾩ'=>'ᾩ','ᾪ'=>'ᾪ','ᾫ'=>'ᾫ','ᾬ'=>'ὨÌÍ…','á¾­'=>'ὩÌÍ…','á¾®'=>'ᾮ','ᾯ'=>'ᾯ','á¾°'=>'ᾰ','á¾±'=>'ᾱ','á¾²'=>'ᾲ','á¾³'=>'ᾳ','á¾´'=>'αÌÍ…','ᾶ'=>'ᾶ','á¾·'=>'ᾷ','Ᾰ'=>'Ᾰ','á¾¹'=>'Ᾱ','Ὰ'=>'Ὰ','á¾»'=>'ΑÌ','á¾¼'=>'ᾼ','á¾½'=>' Ì“','á¾¾'=>'ι','᾿'=>' Ì“','á¿€'=>' Í‚','á¿'=>' ̈͂','á¿‚'=>'ῂ','ῃ'=>'ῃ','á¿„'=>'ηÌÍ…','ῆ'=>'ῆ','ῇ'=>'ῇ','Ὲ'=>'Ὲ','Έ'=>'ΕÌ','á¿Š'=>'Ὴ','á¿‹'=>'ΗÌ','á¿Œ'=>'ῌ','á¿'=>' Ì“Ì€','á¿Ž'=>' Ì“Ì','á¿'=>' Ì“Í‚','á¿'=>'ῐ','á¿‘'=>'ῑ','á¿’'=>'ῒ','á¿“'=>'ϊÌ','á¿–'=>'ῖ','á¿—'=>'ῗ','Ῐ'=>'Ῐ','á¿™'=>'Ῑ','á¿š'=>'Ὶ','á¿›'=>'ΙÌ','á¿'=>' ̔̀','á¿ž'=>' Ì”Ì','á¿Ÿ'=>' ̔͂','á¿ '=>'ῠ','á¿¡'=>'Ï…Ì„','á¿¢'=>'ῢ','á¿£'=>'ϋÌ','ῤ'=>'ÏÌ“','á¿¥'=>'ÏÌ”','ῦ'=>'Ï…Í‚','ῧ'=>'ῧ','Ῠ'=>'Ῠ','á¿©'=>'Ῡ','Ὺ'=>'Ὺ','á¿«'=>'Î¥Ì','Ῥ'=>'Ῥ','á¿­'=>' ̈̀','á¿®'=>' ̈Ì','`'=>'`','ῲ'=>'ῲ','ῳ'=>'ῳ','á¿´'=>'ωÌÍ…','ῶ'=>'ῶ','á¿·'=>'ῷ','Ὸ'=>'Ὸ','Ό'=>'ΟÌ','Ὼ'=>'Ὼ','á¿»'=>'ΩÌ','ῼ'=>'ῼ','´'=>' Ì','῾'=>' Ì”',' '=>' ','â€'=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ',' '=>' ','‑'=>'â€','‗'=>' ̳','․'=>'.','‥'=>'..','…'=>'...',' '=>' ','″'=>'′′','‴'=>'′′′','‶'=>'‵‵','‷'=>'‵‵‵','‼'=>'!!','‾'=>' Ì…','â‡'=>'??','âˆ'=>'?!','â‰'=>'!?','â—'=>'′′′′','âŸ'=>' ','â°'=>'0','â±'=>'i','â´'=>'4','âµ'=>'5','â¶'=>'6','â·'=>'7','â¸'=>'8','â¹'=>'9','âº'=>'+','â»'=>'−','â¼'=>'=','â½'=>'(','â¾'=>')','â¿'=>'n','â‚€'=>'0','â‚'=>'1','â‚‚'=>'2','₃'=>'3','â‚„'=>'4','â‚…'=>'5','₆'=>'6','₇'=>'7','₈'=>'8','₉'=>'9','â‚Š'=>'+','â‚‹'=>'−','â‚Œ'=>'=','â‚'=>'(','â‚Ž'=>')','â‚'=>'a','â‚‘'=>'e','â‚’'=>'o','â‚“'=>'x','â‚”'=>'É™','₨'=>'Rs','â„€'=>'a/c','â„'=>'a/s','â„‚'=>'C','℃'=>'°C','â„…'=>'c/o','℆'=>'c/u','ℇ'=>'Æ','℉'=>'°F','â„Š'=>'g','â„‹'=>'H','â„Œ'=>'H','â„'=>'H','â„Ž'=>'h','â„'=>'ħ','â„'=>'I','â„‘'=>'I','â„’'=>'L','â„“'=>'l','â„•'=>'N','â„–'=>'No','â„™'=>'P','â„š'=>'Q','â„›'=>'R','â„œ'=>'R','â„'=>'R','â„ '=>'SM','â„¡'=>'TEL','â„¢'=>'TM','ℤ'=>'Z','Ω'=>'Ω','ℨ'=>'Z','K'=>'K','â„«'=>'AÌŠ','ℬ'=>'B','â„­'=>'C','ℯ'=>'e','â„°'=>'E','ℱ'=>'F','ℳ'=>'M','â„´'=>'o','ℵ'=>'×','ℶ'=>'ב','â„·'=>'×’','ℸ'=>'ד','ℹ'=>'i','â„»'=>'FAX','ℼ'=>'Ï€','ℽ'=>'γ','ℾ'=>'Γ','â„¿'=>'Π','â…€'=>'∑','â……'=>'D','â…†'=>'d','â…‡'=>'e','â…ˆ'=>'i','â…‰'=>'j','â…“'=>'1â„3','â…”'=>'2â„3','â…•'=>'1â„5','â…–'=>'2â„5','â…—'=>'3â„5','â…˜'=>'4â„5','â…™'=>'1â„6','â…š'=>'5â„6','â…›'=>'1â„8','â…œ'=>'3â„8','â…'=>'5â„8','â…ž'=>'7â„8','â…Ÿ'=>'1â„','â… '=>'I','â…¡'=>'II','â…¢'=>'III','â…£'=>'IV','â…¤'=>'V','â…¥'=>'VI','â…¦'=>'VII','â…§'=>'VIII','â…¨'=>'IX','â…©'=>'X','â…ª'=>'XI','â…«'=>'XII','â…¬'=>'L','â…­'=>'C','â…®'=>'D','â…¯'=>'M','â…°'=>'i','â…±'=>'ii','â…²'=>'iii','â…³'=>'iv','â…´'=>'v','â…µ'=>'vi','â…¶'=>'vii','â…·'=>'viii','â…¸'=>'ix','â…¹'=>'x','â…º'=>'xi','â…»'=>'xii','â…¼'=>'l','â…½'=>'c','â…¾'=>'d','â…¿'=>'m','↚'=>'â†Ì¸','↛'=>'↛','↮'=>'↮','â‡'=>'â‡Ì¸','⇎'=>'⇎','â‡'=>'⇏','∄'=>'∄','∉'=>'∉','∌'=>'∌','∤'=>'∤','∦'=>'∦','∬'=>'∫∫','∭'=>'∫∫∫','∯'=>'∮∮','∰'=>'∮∮∮','â‰'=>'≁','≄'=>'≄','≇'=>'≇','≉'=>'≉','≠'=>'≠','≢'=>'≢','≭'=>'â‰Ì¸','≮'=>'≮','≯'=>'≯','≰'=>'≰','≱'=>'≱','≴'=>'≴','≵'=>'≵','≸'=>'≸','≹'=>'≹','⊀'=>'⊀','âŠ'=>'⊁','⊄'=>'⊄','⊅'=>'⊅','⊈'=>'⊈','⊉'=>'⊉','⊬'=>'⊬','⊭'=>'⊭','⊮'=>'⊮','⊯'=>'⊯','â‹ '=>'⋠','â‹¡'=>'⋡','â‹¢'=>'⋢','â‹£'=>'⋣','⋪'=>'⋪','â‹«'=>'⋫','⋬'=>'⋬','â‹­'=>'⋭','〈'=>'〈','〉'=>'〉','â‘ '=>'1','â‘¡'=>'2','â‘¢'=>'3','â‘£'=>'4','⑤'=>'5','â‘¥'=>'6','⑦'=>'7','⑧'=>'8','⑨'=>'9','â‘©'=>'10','⑪'=>'11','â‘«'=>'12','⑬'=>'13','â‘­'=>'14','â‘®'=>'15','⑯'=>'16','â‘°'=>'17','⑱'=>'18','⑲'=>'19','⑳'=>'20','â‘´'=>'(1)','⑵'=>'(2)','⑶'=>'(3)','â‘·'=>'(4)','⑸'=>'(5)','⑹'=>'(6)','⑺'=>'(7)','â‘»'=>'(8)','⑼'=>'(9)','⑽'=>'(10)','⑾'=>'(11)','â‘¿'=>'(12)','â’€'=>'(13)','â’'=>'(14)','â’‚'=>'(15)','â’ƒ'=>'(16)','â’„'=>'(17)','â’…'=>'(18)','â’†'=>'(19)','â’‡'=>'(20)','â’ˆ'=>'1.','â’‰'=>'2.','â’Š'=>'3.','â’‹'=>'4.','â’Œ'=>'5.','â’'=>'6.','â’Ž'=>'7.','â’'=>'8.','â’'=>'9.','â’‘'=>'10.','â’’'=>'11.','â’“'=>'12.','â’”'=>'13.','â’•'=>'14.','â’–'=>'15.','â’—'=>'16.','â’˜'=>'17.','â’™'=>'18.','â’š'=>'19.','â’›'=>'20.','â’œ'=>'(a)','â’'=>'(b)','â’ž'=>'(c)','â’Ÿ'=>'(d)','â’ '=>'(e)','â’¡'=>'(f)','â’¢'=>'(g)','â’£'=>'(h)','â’¤'=>'(i)','â’¥'=>'(j)','â’¦'=>'(k)','â’§'=>'(l)','â’¨'=>'(m)','â’©'=>'(n)','â’ª'=>'(o)','â’«'=>'(p)','â’¬'=>'(q)','â’­'=>'(r)','â’®'=>'(s)','â’¯'=>'(t)','â’°'=>'(u)','â’±'=>'(v)','â’²'=>'(w)','â’³'=>'(x)','â’´'=>'(y)','â’µ'=>'(z)','â’¶'=>'A','â’·'=>'B','â’¸'=>'C','â’¹'=>'D','â’º'=>'E','â’»'=>'F','â’¼'=>'G','â’½'=>'H','â’¾'=>'I','â’¿'=>'J','â“€'=>'K','â“'=>'L','â“‚'=>'M','Ⓝ'=>'N','â“„'=>'O','â“…'=>'P','Ⓠ'=>'Q','Ⓡ'=>'R','Ⓢ'=>'S','Ⓣ'=>'T','â“Š'=>'U','â“‹'=>'V','â“Œ'=>'W','â“'=>'X','â“Ž'=>'Y','â“'=>'Z','â“'=>'a','â“‘'=>'b','â“’'=>'c','â““'=>'d','â“”'=>'e','â“•'=>'f','â“–'=>'g','â“—'=>'h','ⓘ'=>'i','â“™'=>'j','â“š'=>'k','â“›'=>'l','â“œ'=>'m','â“'=>'n','â“ž'=>'o','â“Ÿ'=>'p','â“ '=>'q','â“¡'=>'r','â“¢'=>'s','â“£'=>'t','ⓤ'=>'u','â“¥'=>'v','ⓦ'=>'w','ⓧ'=>'x','ⓨ'=>'y','â“©'=>'z','⓪'=>'0','⨌'=>'∫∫∫∫','â©´'=>'::=','⩵'=>'==','⩶'=>'===','â«œ'=>'â«Ì¸','ⵯ'=>'ⵡ','⺟'=>'æ¯','⻳'=>'龟','â¼€'=>'一','â¼'=>'丨','⼂'=>'丶','⼃'=>'丿','⼄'=>'ä¹™','â¼…'=>'亅','⼆'=>'二','⼇'=>'亠','⼈'=>'人','⼉'=>'å„¿','⼊'=>'å…¥','⼋'=>'å…«','⼌'=>'冂','â¼'=>'冖','⼎'=>'冫','â¼'=>'几','â¼'=>'凵','⼑'=>'刀','â¼’'=>'力','⼓'=>'勹','â¼”'=>'匕','⼕'=>'匚','â¼–'=>'匸','â¼—'=>'å','⼘'=>'åœ','â¼™'=>'å©','⼚'=>'厂','â¼›'=>'厶','⼜'=>'åˆ','â¼'=>'å£','⼞'=>'å›—','⼟'=>'土','â¼ '=>'士','⼡'=>'夂','â¼¢'=>'夊','â¼£'=>'夕','⼤'=>'大','â¼¥'=>'女','⼦'=>'å­','⼧'=>'宀','⼨'=>'寸','⼩'=>'å°','⼪'=>'å°¢','⼫'=>'å°¸','⼬'=>'å±®','â¼­'=>'å±±','â¼®'=>'å·›','⼯'=>'å·¥','â¼°'=>'å·±','â¼±'=>'å·¾','â¼²'=>'å¹²','â¼³'=>'幺','â¼´'=>'广','â¼µ'=>'å»´','⼶'=>'廾','â¼·'=>'弋','⼸'=>'弓','â¼¹'=>'å½','⼺'=>'彡','â¼»'=>'å½³','â¼¼'=>'心','â¼½'=>'戈','â¼¾'=>'戶','⼿'=>'手','â½€'=>'支','â½'=>'æ”´','⽂'=>'æ–‡','⽃'=>'æ–—','⽄'=>'æ–¤','â½…'=>'æ–¹','⽆'=>'æ— ','⽇'=>'æ—¥','⽈'=>'æ›°','⽉'=>'月','⽊'=>'木','⽋'=>'欠','⽌'=>'æ­¢','â½'=>'æ­¹','⽎'=>'殳','â½'=>'毋','â½'=>'比','⽑'=>'毛','â½’'=>'æ°','⽓'=>'æ°”','â½”'=>'æ°´','⽕'=>'ç«','â½–'=>'爪','â½—'=>'父','⽘'=>'爻','â½™'=>'爿','⽚'=>'片','â½›'=>'牙','⽜'=>'牛','â½'=>'犬','⽞'=>'玄','⽟'=>'玉','â½ '=>'ç“œ','⽡'=>'瓦','â½¢'=>'甘','â½£'=>'生','⽤'=>'用','â½¥'=>'ç”°','⽦'=>'ç–‹','⽧'=>'ç–’','⽨'=>'癶','⽩'=>'白','⽪'=>'çš®','⽫'=>'çš¿','⽬'=>'ç›®','â½­'=>'矛','â½®'=>'矢','⽯'=>'石','â½°'=>'示','â½±'=>'禸','â½²'=>'禾','â½³'=>'ç©´','â½´'=>'ç«‹','â½µ'=>'竹','⽶'=>'ç±³','â½·'=>'糸','⽸'=>'缶','â½¹'=>'网','⽺'=>'羊','â½»'=>'ç¾½','â½¼'=>'è€','â½½'=>'而','â½¾'=>'耒','⽿'=>'耳','â¾€'=>'è¿','â¾'=>'肉','⾂'=>'臣','⾃'=>'自','⾄'=>'至','â¾…'=>'臼','⾆'=>'舌','⾇'=>'舛','⾈'=>'舟','⾉'=>'艮','⾊'=>'色','⾋'=>'艸','⾌'=>'è™','â¾'=>'虫','⾎'=>'è¡€','â¾'=>'è¡Œ','â¾'=>'è¡£','⾑'=>'襾','â¾’'=>'見','⾓'=>'角','â¾”'=>'言','⾕'=>'è°·','â¾–'=>'豆','â¾—'=>'豕','⾘'=>'豸','â¾™'=>'è²','⾚'=>'赤','â¾›'=>'èµ°','⾜'=>'足','â¾'=>'身','⾞'=>'車','⾟'=>'è¾›','â¾ '=>'è¾°','⾡'=>'è¾µ','â¾¢'=>'é‚‘','â¾£'=>'é…‰','⾤'=>'釆','â¾¥'=>'里','⾦'=>'金','⾧'=>'é•·','⾨'=>'é–€','⾩'=>'阜','⾪'=>'隶','⾫'=>'éš¹','⾬'=>'雨','â¾­'=>'é‘','â¾®'=>'éž','⾯'=>'é¢','â¾°'=>'é©','â¾±'=>'韋','â¾²'=>'韭','â¾³'=>'音','â¾´'=>'é ','â¾µ'=>'風','⾶'=>'飛','â¾·'=>'食','⾸'=>'首','â¾¹'=>'香','⾺'=>'馬','â¾»'=>'骨','â¾¼'=>'高','â¾½'=>'é«Ÿ','â¾¾'=>'鬥','⾿'=>'鬯','â¿€'=>'鬲','â¿'=>'鬼','â¿‚'=>'é­š','⿃'=>'é³¥','â¿„'=>'é¹µ','â¿…'=>'鹿','⿆'=>'麥','⿇'=>'麻','⿈'=>'黃','⿉'=>'é»','â¿Š'=>'黑','â¿‹'=>'黹','â¿Œ'=>'黽','â¿'=>'鼎','â¿Ž'=>'鼓','â¿'=>'é¼ ','â¿'=>'é¼»','â¿‘'=>'齊','â¿’'=>'é½’','â¿“'=>'é¾','â¿”'=>'龜','â¿•'=>'é¾ ',' '=>' ','〶'=>'〒','〸'=>'å','〹'=>'å„','〺'=>'å…','ãŒ'=>'ã‹ã‚™','ãŽ'=>'ãã‚™','ã'=>'ãã‚™','ã’'=>'ã‘ã‚™','ã”'=>'ã“ã‚™','ã–'=>'ã•ã‚™','ã˜'=>'ã—ã‚™','ãš'=>'ã™ã‚™','ãœ'=>'ã›ã‚™','ãž'=>'ãã‚™','ã '=>'ãŸã‚™','ã¢'=>'ã¡ã‚™','ã¥'=>'ã¤ã‚™','ã§'=>'ã¦ã‚™','ã©'=>'ã¨ã‚™','ã°'=>'ã¯ã‚™','ã±'=>'ã¯ã‚š','ã³'=>'ã²ã‚™','ã´'=>'ã²ã‚š','ã¶'=>'ãµã‚™','ã·'=>'ãµã‚š','ã¹'=>'ã¸ã‚™','ãº'=>'ã¸ã‚š','ã¼'=>'ã»ã‚™','ã½'=>'ã»ã‚š','ã‚”'=>'ã†ã‚™','ã‚›'=>' ã‚™','ã‚œ'=>' ã‚š','ã‚ž'=>'ã‚ã‚™','ã‚Ÿ'=>'より','ガ'=>'ã‚«ã‚™','ã‚®'=>'ã‚­ã‚™','ã‚°'=>'グ','ゲ'=>'ゲ','ã‚´'=>'ゴ','ザ'=>'ザ','ジ'=>'ã‚·ã‚™','ズ'=>'ズ','ゼ'=>'ゼ','ゾ'=>'ゾ','ダ'=>'ã‚¿ã‚™','ヂ'=>'ãƒã‚™','ヅ'=>'ヅ','デ'=>'デ','ド'=>'ド','ãƒ'=>'ãƒã‚™','パ'=>'ãƒã‚š','ビ'=>'ビ','ピ'=>'ピ','ブ'=>'ブ','プ'=>'プ','ベ'=>'ベ','ペ'=>'ペ','ボ'=>'ボ','ãƒ'=>'ポ','ヴ'=>'ヴ','ヷ'=>'ヷ','ヸ'=>'ヸ','ヹ'=>'ヹ','ヺ'=>'ヺ','ヾ'=>'ヾ','ヿ'=>'コト','ㄱ'=>'á„€','ㄲ'=>'á„','ㄳ'=>'ᆪ','ã„´'=>'á„‚','ㄵ'=>'ᆬ','ㄶ'=>'ᆭ','ã„·'=>'ᄃ','ㄸ'=>'á„„','ㄹ'=>'á„…','ㄺ'=>'ᆰ','ã„»'=>'ᆱ','ㄼ'=>'ᆲ','ㄽ'=>'ᆳ','ㄾ'=>'ᆴ','ã„¿'=>'ᆵ','ã…€'=>'á„š','ã…'=>'ᄆ','ã…‚'=>'ᄇ','ã…ƒ'=>'ᄈ','ã…„'=>'á„¡','ã……'=>'ᄉ','ã…†'=>'á„Š','ã…‡'=>'á„‹','ã…ˆ'=>'á„Œ','ã…‰'=>'á„','ã…Š'=>'á„Ž','ã…‹'=>'á„','ã…Œ'=>'á„','ã…'=>'á„‘','ã…Ž'=>'á„’','ã…'=>'á…¡','ã…'=>'á…¢','ã…‘'=>'á…£','ã…’'=>'á…¤','ã…“'=>'á…¥','ã…”'=>'á…¦','ã…•'=>'á…§','ã…–'=>'á…¨','ã…—'=>'á…©','ã…˜'=>'á…ª','ã…™'=>'á…«','ã…š'=>'á…¬','ã…›'=>'á…­','ã…œ'=>'á…®','ã…'=>'á…¯','ã…ž'=>'á…°','ã…Ÿ'=>'á…±','ã… '=>'á…²','ã…¡'=>'á…³','ã…¢'=>'á…´','ã…£'=>'á…µ','ã…¤'=>'á… ','ã…¥'=>'á„”','ã…¦'=>'á„•','ã…§'=>'ᇇ','ã…¨'=>'ᇈ','ã…©'=>'ᇌ','ã…ª'=>'ᇎ','ã…«'=>'ᇓ','ã…¬'=>'ᇗ','ã…­'=>'ᇙ','ã…®'=>'á„œ','ã…¯'=>'á‡','ã…°'=>'ᇟ','ã…±'=>'á„','ã…²'=>'á„ž','ã…³'=>'á„ ','ã…´'=>'á„¢','ã…µ'=>'á„£','ã…¶'=>'ᄧ','ã…·'=>'á„©','ã…¸'=>'á„«','ã…¹'=>'ᄬ','ã…º'=>'á„­','ã…»'=>'á„®','ã…¼'=>'ᄯ','ã…½'=>'ᄲ','ã…¾'=>'ᄶ','ã…¿'=>'á…€','ㆀ'=>'á…‡','ã†'=>'á…Œ','ㆂ'=>'ᇱ','ㆃ'=>'ᇲ','ㆄ'=>'á…—','ㆅ'=>'á…˜','ㆆ'=>'á…™','ㆇ'=>'ᆄ','ㆈ'=>'ᆅ','ㆉ'=>'ᆈ','ㆊ'=>'ᆑ','ㆋ'=>'ᆒ','ㆌ'=>'ᆔ','ã†'=>'ᆞ','ㆎ'=>'ᆡ','㆒'=>'一','㆓'=>'二','㆔'=>'三','㆕'=>'å››','㆖'=>'上','㆗'=>'中','㆘'=>'下','㆙'=>'甲','㆚'=>'ä¹™','㆛'=>'丙','㆜'=>'ä¸','ã†'=>'天','㆞'=>'地','㆟'=>'人','㈀'=>'(á„€)','ãˆ'=>'(á„‚)','㈂'=>'(ᄃ)','㈃'=>'(á„…)','㈄'=>'(ᄆ)','㈅'=>'(ᄇ)','㈆'=>'(ᄉ)','㈇'=>'(á„‹)','㈈'=>'(á„Œ)','㈉'=>'(á„Ž)','㈊'=>'(á„)','㈋'=>'(á„)','㈌'=>'(á„‘)','ãˆ'=>'(á„’)','㈎'=>'(가)','ãˆ'=>'(á„‚á…¡)','ãˆ'=>'(다)','㈑'=>'(á„…á…¡)','㈒'=>'(마)','㈓'=>'(바)','㈔'=>'(사)','㈕'=>'(á„‹á…¡)','㈖'=>'(자)','㈗'=>'(á„Žá…¡)','㈘'=>'(á„á…¡)','㈙'=>'(á„á…¡)','㈚'=>'(á„‘á…¡)','㈛'=>'(á„’á…¡)','㈜'=>'(주)','ãˆ'=>'(오전)','㈞'=>'(á„‹á…©á„’á…®)','㈠'=>'(一)','㈡'=>'(二)','㈢'=>'(三)','㈣'=>'(å››)','㈤'=>'(五)','㈥'=>'(å…­)','㈦'=>'(七)','㈧'=>'(å…«)','㈨'=>'(ä¹)','㈩'=>'(å)','㈪'=>'(月)','㈫'=>'(ç«)','㈬'=>'(æ°´)','㈭'=>'(木)','㈮'=>'(金)','㈯'=>'(土)','㈰'=>'(æ—¥)','㈱'=>'(æ ª)','㈲'=>'(有)','㈳'=>'(社)','㈴'=>'(å)','㈵'=>'(特)','㈶'=>'(財)','㈷'=>'(ç¥)','㈸'=>'(労)','㈹'=>'(代)','㈺'=>'(呼)','㈻'=>'(å­¦)','㈼'=>'(監)','㈽'=>'(ä¼)','㈾'=>'(資)','㈿'=>'(å”)','㉀'=>'(祭)','ã‰'=>'(休)','㉂'=>'(自)','㉃'=>'(至)','ã‰'=>'PTE','㉑'=>'21','㉒'=>'22','㉓'=>'23','㉔'=>'24','㉕'=>'25','㉖'=>'26','㉗'=>'27','㉘'=>'28','㉙'=>'29','㉚'=>'30','㉛'=>'31','㉜'=>'32','ã‰'=>'33','㉞'=>'34','㉟'=>'35','㉠'=>'á„€','㉡'=>'á„‚','㉢'=>'ᄃ','㉣'=>'á„…','㉤'=>'ᄆ','㉥'=>'ᄇ','㉦'=>'ᄉ','㉧'=>'á„‹','㉨'=>'á„Œ','㉩'=>'á„Ž','㉪'=>'á„','㉫'=>'á„','㉬'=>'á„‘','㉭'=>'á„’','㉮'=>'가','㉯'=>'á„‚á…¡','㉰'=>'다','㉱'=>'á„…á…¡','㉲'=>'마','㉳'=>'바','㉴'=>'사','㉵'=>'á„‹á…¡','㉶'=>'자','㉷'=>'á„Žá…¡','㉸'=>'á„á…¡','㉹'=>'á„á…¡','㉺'=>'á„‘á…¡','㉻'=>'á„’á…¡','㉼'=>'참고','㉽'=>'주의','㉾'=>'á„‹á…®','㊀'=>'一','ãŠ'=>'二','㊂'=>'三','㊃'=>'å››','㊄'=>'五','㊅'=>'å…­','㊆'=>'七','㊇'=>'å…«','㊈'=>'ä¹','㊉'=>'å','㊊'=>'月','㊋'=>'ç«','㊌'=>'æ°´','ãŠ'=>'木','㊎'=>'金','ãŠ'=>'土','ãŠ'=>'æ—¥','㊑'=>'æ ª','㊒'=>'有','㊓'=>'社','㊔'=>'å','㊕'=>'特','㊖'=>'財','㊗'=>'ç¥','㊘'=>'労','㊙'=>'秘','㊚'=>'ç”·','㊛'=>'女','㊜'=>'é©','ãŠ'=>'優','㊞'=>'å°','㊟'=>'注','㊠'=>'é …','㊡'=>'休','㊢'=>'写','㊣'=>'æ­£','㊤'=>'上','㊥'=>'中','㊦'=>'下','㊧'=>'å·¦','㊨'=>'å³','㊩'=>'医','㊪'=>'å®—','㊫'=>'å­¦','㊬'=>'監','㊭'=>'ä¼','㊮'=>'資','㊯'=>'å”','㊰'=>'夜','㊱'=>'36','㊲'=>'37','㊳'=>'38','㊴'=>'39','㊵'=>'40','㊶'=>'41','㊷'=>'42','㊸'=>'43','㊹'=>'44','㊺'=>'45','㊻'=>'46','㊼'=>'47','㊽'=>'48','㊾'=>'49','㊿'=>'50','ã‹€'=>'1月','ã‹'=>'2月','ã‹‚'=>'3月','㋃'=>'4月','ã‹„'=>'5月','ã‹…'=>'6月','㋆'=>'7月','㋇'=>'8月','㋈'=>'9月','㋉'=>'10月','ã‹Š'=>'11月','ã‹‹'=>'12月','ã‹Œ'=>'Hg','ã‹'=>'erg','ã‹Ž'=>'eV','ã‹'=>'LTD','ã‹'=>'ã‚¢','ã‹‘'=>'イ','ã‹’'=>'ウ','ã‹“'=>'エ','ã‹”'=>'オ','ã‹•'=>'ã‚«','ã‹–'=>'ã‚­','ã‹—'=>'ク','㋘'=>'ケ','ã‹™'=>'コ','ã‹š'=>'サ','ã‹›'=>'ã‚·','ã‹œ'=>'ス','ã‹'=>'ã‚»','ã‹ž'=>'ソ','ã‹Ÿ'=>'ã‚¿','ã‹ '=>'ãƒ','ã‹¡'=>'ツ','ã‹¢'=>'テ','ã‹£'=>'ト','㋤'=>'ナ','ã‹¥'=>'ニ','㋦'=>'ヌ','㋧'=>'ãƒ','㋨'=>'ノ','ã‹©'=>'ãƒ','㋪'=>'ヒ','ã‹«'=>'フ','㋬'=>'ヘ','ã‹­'=>'ホ','ã‹®'=>'マ','㋯'=>'ミ','ã‹°'=>'ム','㋱'=>'メ','㋲'=>'モ','㋳'=>'ヤ','ã‹´'=>'ユ','㋵'=>'ヨ','㋶'=>'ラ','ã‹·'=>'リ','㋸'=>'ル','㋹'=>'レ','㋺'=>'ロ','ã‹»'=>'ワ','㋼'=>'ヰ','㋽'=>'ヱ','㋾'=>'ヲ','㌀'=>'ã‚¢ãƒã‚šãƒ¼ãƒˆ','ãŒ'=>'アルファ','㌂'=>'アンペア','㌃'=>'アール','㌄'=>'イニング','㌅'=>'インãƒ','㌆'=>'ウォン','㌇'=>'エスクード','㌈'=>'エーカー','㌉'=>'オンス','㌊'=>'オーム','㌋'=>'カイリ','㌌'=>'カラット','ãŒ'=>'カロリー','㌎'=>'ガロン','ãŒ'=>'ガンマ','ãŒ'=>'ギガ','㌑'=>'ギニー','㌒'=>'キュリー','㌓'=>'ギルダー','㌔'=>'キロ','㌕'=>'キログラム','㌖'=>'キロメートル','㌗'=>'キロワット','㌘'=>'グラム','㌙'=>'グラムトン','㌚'=>'クルゼイロ','㌛'=>'クローãƒ','㌜'=>'ケース','ãŒ'=>'コルナ','㌞'=>'コーポ','㌟'=>'サイクル','㌠'=>'サンãƒãƒ¼ãƒ ','㌡'=>'シリング','㌢'=>'センãƒ','㌣'=>'セント','㌤'=>'ダース','㌥'=>'デシ','㌦'=>'ドル','㌧'=>'トン','㌨'=>'ナノ','㌩'=>'ノット','㌪'=>'ãƒã‚¤ãƒ„','㌫'=>'ãƒã‚šãƒ¼ã‚»ãƒ³ãƒˆ','㌬'=>'ãƒã‚šãƒ¼ãƒ„','㌭'=>'ãƒã‚™ãƒ¼ãƒ¬ãƒ«','㌮'=>'ピアストル','㌯'=>'ピクル','㌰'=>'ピコ','㌱'=>'ビル','㌲'=>'ファラッド','㌳'=>'フィート','㌴'=>'ブッシェル','㌵'=>'フラン','㌶'=>'ヘクタール','㌷'=>'ペソ','㌸'=>'ペニヒ','㌹'=>'ヘルツ','㌺'=>'ペンス','㌻'=>'ページ','㌼'=>'ベータ','㌽'=>'ポイント','㌾'=>'ボルト','㌿'=>'ホン','ã€'=>'ポンド','ã'=>'ホール','ã‚'=>'ホーン','ãƒ'=>'マイクロ','ã„'=>'マイル','ã…'=>'マッãƒ','ã†'=>'マルク','ã‡'=>'マンション','ãˆ'=>'ミクロン','ã‰'=>'ミリ','ãŠ'=>'ミリãƒã‚™ãƒ¼ãƒ«','ã‹'=>'メガ','ãŒ'=>'メガトン','ã'=>'メートル','ãŽ'=>'ヤード','ã'=>'ヤール','ã'=>'ユアン','ã‘'=>'リットル','ã’'=>'リラ','ã“'=>'ルピー','ã”'=>'ルーブル','ã•'=>'レム','ã–'=>'レントゲン','ã—'=>'ワット','ã˜'=>'0点','ã™'=>'1点','ãš'=>'2点','ã›'=>'3点','ãœ'=>'4点','ã'=>'5点','ãž'=>'6点','ãŸ'=>'7点','ã '=>'8点','ã¡'=>'9点','ã¢'=>'10点','ã£'=>'11点','ã¤'=>'12点','ã¥'=>'13点','ã¦'=>'14点','ã§'=>'15点','ã¨'=>'16点','ã©'=>'17点','ãª'=>'18点','ã«'=>'19点','ã¬'=>'20点','ã­'=>'21点','ã®'=>'22点','ã¯'=>'23点','ã°'=>'24点','ã±'=>'hPa','ã²'=>'da','ã³'=>'AU','ã´'=>'bar','ãµ'=>'oV','ã¶'=>'pc','ã·'=>'dm','ã¸'=>'dm2','ã¹'=>'dm3','ãº'=>'IU','ã»'=>'å¹³æˆ','ã¼'=>'昭和','ã½'=>'大正','ã¾'=>'明治','ã¿'=>'æ ªå¼ä¼šç¤¾','㎀'=>'pA','ãŽ'=>'nA','㎂'=>'μA','㎃'=>'mA','㎄'=>'kA','㎅'=>'KB','㎆'=>'MB','㎇'=>'GB','㎈'=>'cal','㎉'=>'kcal','㎊'=>'pF','㎋'=>'nF','㎌'=>'μF','ãŽ'=>'μg','㎎'=>'mg','ãŽ'=>'kg','ãŽ'=>'Hz','㎑'=>'kHz','㎒'=>'MHz','㎓'=>'GHz','㎔'=>'THz','㎕'=>'μl','㎖'=>'ml','㎗'=>'dl','㎘'=>'kl','㎙'=>'fm','㎚'=>'nm','㎛'=>'μm','㎜'=>'mm','ãŽ'=>'cm','㎞'=>'km','㎟'=>'mm2','㎠'=>'cm2','㎡'=>'m2','㎢'=>'km2','㎣'=>'mm3','㎤'=>'cm3','㎥'=>'m3','㎦'=>'km3','㎧'=>'m∕s','㎨'=>'m∕s2','㎩'=>'Pa','㎪'=>'kPa','㎫'=>'MPa','㎬'=>'GPa','㎭'=>'rad','㎮'=>'rad∕s','㎯'=>'rad∕s2','㎰'=>'ps','㎱'=>'ns','㎲'=>'μs','㎳'=>'ms','㎴'=>'pV','㎵'=>'nV','㎶'=>'μV','㎷'=>'mV','㎸'=>'kV','㎹'=>'MV','㎺'=>'pW','㎻'=>'nW','㎼'=>'μW','㎽'=>'mW','㎾'=>'kW','㎿'=>'MW','ã€'=>'kΩ','ã'=>'MΩ','ã‚'=>'a.m.','ãƒ'=>'Bq','ã„'=>'cc','ã…'=>'cd','ã†'=>'C∕kg','ã‡'=>'Co.','ãˆ'=>'dB','ã‰'=>'Gy','ãŠ'=>'ha','ã‹'=>'HP','ãŒ'=>'in','ã'=>'KK','ãŽ'=>'KM','ã'=>'kt','ã'=>'lm','ã‘'=>'ln','ã’'=>'log','ã“'=>'lx','ã”'=>'mb','ã•'=>'mil','ã–'=>'mol','ã—'=>'PH','ã˜'=>'p.m.','ã™'=>'PPM','ãš'=>'PR','ã›'=>'sr','ãœ'=>'Sv','ã'=>'Wb','ãž'=>'V∕m','ãŸ'=>'A∕m','ã '=>'1æ—¥','ã¡'=>'2æ—¥','ã¢'=>'3æ—¥','ã£'=>'4æ—¥','ã¤'=>'5æ—¥','ã¥'=>'6æ—¥','ã¦'=>'7æ—¥','ã§'=>'8æ—¥','ã¨'=>'9æ—¥','ã©'=>'10æ—¥','ãª'=>'11æ—¥','ã«'=>'12æ—¥','ã¬'=>'13æ—¥','ã­'=>'14æ—¥','ã®'=>'15æ—¥','ã¯'=>'16æ—¥','ã°'=>'17æ—¥','ã±'=>'18æ—¥','ã²'=>'19æ—¥','ã³'=>'20æ—¥','ã´'=>'21æ—¥','ãµ'=>'22æ—¥','ã¶'=>'23æ—¥','ã·'=>'24æ—¥','ã¸'=>'25æ—¥','ã¹'=>'26æ—¥','ãº'=>'27æ—¥','ã»'=>'28æ—¥','ã¼'=>'29æ—¥','ã½'=>'30æ—¥','ã¾'=>'31æ—¥','ã¿'=>'gal','豈'=>'豈','ï¤'=>'æ›´','車'=>'車','賈'=>'賈','滑'=>'滑','串'=>'串','句'=>'å¥','龜'=>'龜','龜'=>'龜','契'=>'契','金'=>'金','喇'=>'å–‡','奈'=>'奈','ï¤'=>'懶','癩'=>'癩','ï¤'=>'ç¾…','ï¤'=>'蘿','螺'=>'螺','裸'=>'裸','邏'=>'é‚','樂'=>'樂','洛'=>'æ´›','烙'=>'烙','珞'=>'çž','落'=>'è½','酪'=>'é…ª','駱'=>'駱','亂'=>'亂','卵'=>'åµ','ï¤'=>'欄','爛'=>'爛','蘭'=>'蘭','鸞'=>'鸞','嵐'=>'åµ','濫'=>'æ¿«','藍'=>'è—','襤'=>'襤','拉'=>'拉','臘'=>'臘','蠟'=>'è Ÿ','廊'=>'廊','朗'=>'朗','浪'=>'浪','狼'=>'狼','郎'=>'郎','來'=>'來','冷'=>'冷','勞'=>'å‹ž','擄'=>'æ“„','櫓'=>'æ«“','爐'=>'çˆ','盧'=>'盧','老'=>'è€','蘆'=>'蘆','虜'=>'虜','路'=>'è·¯','露'=>'露','魯'=>'é­¯','鷺'=>'é·º','碌'=>'碌','祿'=>'祿','綠'=>'綠','菉'=>'è‰','錄'=>'錄','鹿'=>'鹿','ï¥'=>'è«–','壟'=>'壟','弄'=>'弄','籠'=>'ç± ','聾'=>'è¾','牢'=>'牢','磊'=>'磊','賂'=>'賂','雷'=>'é›·','壘'=>'壘','屢'=>'å±¢','樓'=>'樓','ï¥'=>'æ·š','漏'=>'æ¼','ï¥'=>'ç´¯','ï¥'=>'縷','陋'=>'陋','勒'=>'å‹’','肋'=>'è‚‹','凜'=>'凜','凌'=>'凌','稜'=>'稜','綾'=>'綾','菱'=>'è±','陵'=>'陵','讀'=>'讀','拏'=>'æ‹','樂'=>'樂','ï¥'=>'諾','丹'=>'丹','寧'=>'寧','怒'=>'怒','率'=>'率','異'=>'ç•°','北'=>'北','磻'=>'磻','便'=>'便','復'=>'復','不'=>'ä¸','泌'=>'泌','數'=>'數','索'=>'ç´¢','參'=>'åƒ','塞'=>'å¡ž','省'=>'çœ','葉'=>'葉','說'=>'說','殺'=>'殺','辰'=>'è¾°','沈'=>'沈','拾'=>'拾','若'=>'è‹¥','掠'=>'掠','略'=>'ç•¥','亮'=>'亮','兩'=>'å…©','凉'=>'凉','梁'=>'æ¢','糧'=>'糧','良'=>'良','諒'=>'è«’','量'=>'é‡','勵'=>'勵','呂'=>'å‘‚','ï¦'=>'女','廬'=>'廬','旅'=>'æ—…','濾'=>'濾','礪'=>'礪','閭'=>'é–­','驪'=>'驪','麗'=>'麗','黎'=>'黎','力'=>'力','曆'=>'曆','歷'=>'æ­·','ï¦'=>'è½¢','年'=>'å¹´','ï¦'=>'æ†','ï¦'=>'戀','撚'=>'æ’š','漣'=>'æ¼£','煉'=>'ç…‰','璉'=>'ç’‰','秊'=>'秊','練'=>'ç·´','聯'=>'è¯','輦'=>'輦','蓮'=>'è“®','連'=>'連','鍊'=>'éŠ','列'=>'列','ï¦'=>'劣','咽'=>'å’½','烈'=>'烈','裂'=>'裂','說'=>'說','廉'=>'廉','念'=>'念','捻'=>'æ»','殮'=>'æ®®','簾'=>'ç°¾','獵'=>'çµ','令'=>'令','囹'=>'囹','寧'=>'寧','嶺'=>'嶺','怜'=>'怜','玲'=>'玲','瑩'=>'ç‘©','羚'=>'羚','聆'=>'è†','鈴'=>'鈴','零'=>'零','靈'=>'éˆ','領'=>'é ˜','例'=>'例','禮'=>'禮','醴'=>'醴','隸'=>'隸','惡'=>'惡','了'=>'了','僚'=>'僚','寮'=>'寮','尿'=>'å°¿','料'=>'æ–™','樂'=>'樂','燎'=>'燎','ï§'=>'療','蓼'=>'蓼','遼'=>'é¼','龍'=>'é¾','暈'=>'暈','阮'=>'阮','劉'=>'劉','杻'=>'æ»','柳'=>'柳','流'=>'æµ','溜'=>'溜','琉'=>'ç‰','ï§'=>'ç•™','硫'=>'ç¡«','ï§'=>'ç´','ï§'=>'é¡ž','六'=>'å…­','戮'=>'戮','陸'=>'陸','倫'=>'倫','崙'=>'å´™','淪'=>'æ·ª','輪'=>'輪','律'=>'律','慄'=>'æ…„','栗'=>'æ —','率'=>'率','隆'=>'隆','ï§'=>'利','吏'=>'å','履'=>'å±¥','易'=>'易','李'=>'æŽ','梨'=>'梨','泥'=>'æ³¥','理'=>'ç†','痢'=>'ç—¢','罹'=>'ç½¹','裏'=>'è£','裡'=>'裡','里'=>'里','離'=>'離','匿'=>'匿','溺'=>'溺','吝'=>'å','燐'=>'ç‡','璘'=>'ç’˜','藺'=>'è—º','隣'=>'隣','鱗'=>'é±—','麟'=>'麟','林'=>'æž—','淋'=>'æ·‹','臨'=>'臨','立'=>'ç«‹','笠'=>'笠','粒'=>'ç²’','狀'=>'ç‹€','炙'=>'ç‚™','識'=>'è­˜','什'=>'什','茶'=>'茶','刺'=>'刺','切'=>'切','ï¨'=>'度','拓'=>'æ‹“','糖'=>'ç³–','宅'=>'å®…','洞'=>'æ´ž','暴'=>'æš´','輻'=>'è¼»','行'=>'è¡Œ','降'=>'é™','見'=>'見','廓'=>'廓','兀'=>'å…€','ï¨'=>'å—€','ï¨'=>'å¡š','晴'=>'æ™´','凞'=>'凞','猪'=>'猪','益'=>'益','礼'=>'礼','神'=>'神','祥'=>'祥','福'=>'ç¦','靖'=>'é–','ï¨'=>'ç²¾','羽'=>'ç¾½','蘒'=>'蘒','諸'=>'諸','逸'=>'逸','都'=>'都','飯'=>'飯','飼'=>'飼','館'=>'館','鶴'=>'鶴','侮'=>'ä¾®','僧'=>'僧','免'=>'å…','勉'=>'勉','勤'=>'勤','卑'=>'å‘','喝'=>'å–','嘆'=>'嘆','器'=>'器','塀'=>'å¡€','墨'=>'墨','層'=>'層','屮'=>'å±®','悔'=>'æ‚”','慨'=>'æ…¨','憎'=>'憎','ï©€'=>'懲','ï©'=>'æ•','ï©‚'=>'æ—¢','暑'=>'æš‘','ï©„'=>'梅','ï©…'=>'æµ·','渚'=>'渚','漢'=>'æ¼¢','煮'=>'ç…®','爫'=>'爫','ï©Š'=>'ç¢','ï©‹'=>'碑','ï©Œ'=>'社','ï©'=>'祉','ï©Ž'=>'祈','ï©'=>'ç¥','ï©'=>'祖','ï©‘'=>'ç¥','ï©’'=>'ç¦','ï©“'=>'禎','ï©”'=>'ç©€','ï©•'=>'çª','ï©–'=>'節','ï©—'=>'ç·´','縉'=>'縉','ï©™'=>'ç¹','ï©š'=>'ç½²','ï©›'=>'者','ï©œ'=>'臭','ï©'=>'艹','ï©ž'=>'艹','ï©Ÿ'=>'è‘—','ï© '=>'è¤','ï©¡'=>'視','ï©¢'=>'è¬','ï©£'=>'謹','賓'=>'賓','ï©¥'=>'è´ˆ','辶'=>'辶','逸'=>'逸','難'=>'難','ï©©'=>'響','頻'=>'é »','ï©°'=>'並','况'=>'况','全'=>'å…¨','侀'=>'ä¾€','ï©´'=>'å……','冀'=>'冀','勇'=>'勇','ï©·'=>'勺','喝'=>'å–','啕'=>'å••','喙'=>'å–™','ï©»'=>'å—¢','塚'=>'å¡š','墳'=>'墳','奄'=>'奄','ï©¿'=>'奔','婢'=>'å©¢','ïª'=>'嬨','廒'=>'å»’','廙'=>'å»™','彩'=>'彩','徭'=>'å¾­','惘'=>'惘','慎'=>'æ…Ž','愈'=>'愈','憎'=>'憎','慠'=>'æ… ','懲'=>'懲','戴'=>'戴','ïª'=>'æ„','搜'=>'æœ','ïª'=>'æ‘’','ïª'=>'æ•–','晴'=>'æ™´','朗'=>'朗','望'=>'望','杖'=>'æ–','歹'=>'æ­¹','殺'=>'殺','流'=>'æµ','滛'=>'æ»›','滋'=>'滋','漢'=>'æ¼¢','瀞'=>'瀞','煮'=>'ç…®','ïª'=>'瞧','爵'=>'爵','犯'=>'犯','猪'=>'猪','瑱'=>'瑱','甆'=>'甆','画'=>'ç”»','瘝'=>'ç˜','瘟'=>'瘟','益'=>'益','盛'=>'ç››','直'=>'ç›´','睊'=>'çŠ','着'=>'ç€','磌'=>'磌','窱'=>'窱','節'=>'節','类'=>'ç±»','絛'=>'çµ›','練'=>'ç·´','缾'=>'ç¼¾','者'=>'者','荒'=>'è’','華'=>'è¯','蝹'=>'è¹','襁'=>'è¥','覆'=>'覆','視'=>'視','調'=>'調','諸'=>'諸','請'=>'è«‹','謁'=>'è¬','諾'=>'諾','諭'=>'è«­','謹'=>'謹','ï«€'=>'變','ï«'=>'è´ˆ','ï«‚'=>'輸','遲'=>'é²','ï«„'=>'醙','ï«…'=>'鉶','陼'=>'陼','難'=>'難','靖'=>'é–','韛'=>'韛','ï«Š'=>'響','ï«‹'=>'é ‹','ï«Œ'=>'é »','ï«'=>'鬒','ï«Ž'=>'龜','ï«'=>'𢡊','ï«'=>'𢡄','ï«‘'=>'ð£•','ï«’'=>'ã®','ï«“'=>'䀘','ï«”'=>'䀹','ï«•'=>'𥉉','ï«–'=>'ð¥³','ï«—'=>'𧻓','齃'=>'齃','ï«™'=>'龎','ff'=>'ff','ï¬'=>'fi','fl'=>'fl','ffi'=>'ffi','ffl'=>'ffl','ſt'=>'st','st'=>'st','ﬓ'=>'Õ´Õ¶','ﬔ'=>'Õ´Õ¥','ﬕ'=>'Õ´Õ«','ﬖ'=>'Õ¾Õ¶','ﬗ'=>'Õ´Õ­','ï¬'=>'×™Ö´','ײַ'=>'ײַ','ﬠ'=>'×¢','ﬡ'=>'×','ﬢ'=>'ד','ﬣ'=>'×”','ﬤ'=>'×›','ﬥ'=>'ל','ﬦ'=>'×','ﬧ'=>'ר','ﬨ'=>'ת','﬩'=>'+','שׁ'=>'ש×','שׂ'=>'שׂ','שּׁ'=>'שּ×','שּׂ'=>'שּׂ','אַ'=>'×Ö·','אָ'=>'×Ö¸','אּ'=>'×Ö¼','בּ'=>'בּ','גּ'=>'×’Ö¼','דּ'=>'דּ','הּ'=>'×”Ö¼','וּ'=>'וּ','זּ'=>'×–Ö¼','טּ'=>'טּ','יּ'=>'×™Ö¼','ךּ'=>'ךּ','כּ'=>'×›Ö¼','לּ'=>'לּ','מּ'=>'מּ','ï­€'=>'× Ö¼','ï­'=>'סּ','ï­ƒ'=>'×£Ö¼','ï­„'=>'פּ','ï­†'=>'צּ','ï­‡'=>'קּ','ï­ˆ'=>'רּ','ï­‰'=>'שּ','ï­Š'=>'תּ','ï­‹'=>'וֹ','ï­Œ'=>'בֿ','ï­'=>'×›Ö¿','ï­Ž'=>'פֿ','ï­'=>'×ל','ï­'=>'Ù±','ï­‘'=>'Ù±','ï­’'=>'Ù»','ï­“'=>'Ù»','ï­”'=>'Ù»','ï­•'=>'Ù»','ï­–'=>'Ù¾','ï­—'=>'Ù¾','ï­˜'=>'Ù¾','ï­™'=>'Ù¾','ï­š'=>'Ú€','ï­›'=>'Ú€','ï­œ'=>'Ú€','ï­'=>'Ú€','ï­ž'=>'Ùº','ï­Ÿ'=>'Ùº','ï­ '=>'Ùº','ï­¡'=>'Ùº','ï­¢'=>'Ù¿','ï­£'=>'Ù¿','ï­¤'=>'Ù¿','ï­¥'=>'Ù¿','ï­¦'=>'Ù¹','ï­§'=>'Ù¹','ï­¨'=>'Ù¹','ï­©'=>'Ù¹','ï­ª'=>'Ú¤','ï­«'=>'Ú¤','ï­¬'=>'Ú¤','ï­­'=>'Ú¤','ï­®'=>'Ú¦','ï­¯'=>'Ú¦','ï­°'=>'Ú¦','ï­±'=>'Ú¦','ï­²'=>'Ú„','ï­³'=>'Ú„','ï­´'=>'Ú„','ï­µ'=>'Ú„','ï­¶'=>'Úƒ','ï­·'=>'Úƒ','ï­¸'=>'Úƒ','ï­¹'=>'Úƒ','ï­º'=>'Ú†','ï­»'=>'Ú†','ï­¼'=>'Ú†','ï­½'=>'Ú†','ï­¾'=>'Ú‡','ï­¿'=>'Ú‡','ﮀ'=>'Ú‡','ï®'=>'Ú‡','ﮂ'=>'Ú','ﮃ'=>'Ú','ﮄ'=>'ÚŒ','ï®…'=>'ÚŒ','ﮆ'=>'ÚŽ','ﮇ'=>'ÚŽ','ﮈ'=>'Úˆ','ﮉ'=>'Úˆ','ﮊ'=>'Ú˜','ﮋ'=>'Ú˜','ﮌ'=>'Ú‘','ï®'=>'Ú‘','ﮎ'=>'Ú©','ï®'=>'Ú©','ï®'=>'Ú©','ﮑ'=>'Ú©','ï®’'=>'Ú¯','ﮓ'=>'Ú¯','ï®”'=>'Ú¯','ﮕ'=>'Ú¯','ï®–'=>'Ú³','ï®—'=>'Ú³','ﮘ'=>'Ú³','ï®™'=>'Ú³','ﮚ'=>'Ú±','ï®›'=>'Ú±','ﮜ'=>'Ú±','ï®'=>'Ú±','ﮞ'=>'Úº','ﮟ'=>'Úº','ï® '=>'Ú»','ﮡ'=>'Ú»','ﮢ'=>'Ú»','ﮣ'=>'Ú»','ﮤ'=>'Û•Ù”','ﮥ'=>'Û•Ù”','ﮦ'=>'Û','ﮧ'=>'Û','ﮨ'=>'Û','ﮩ'=>'Û','ﮪ'=>'Ú¾','ﮫ'=>'Ú¾','ﮬ'=>'Ú¾','ï®­'=>'Ú¾','ï®®'=>'Û’','ﮯ'=>'Û’','ï®°'=>'Û’Ù”','ï®±'=>'Û’Ù”','ﯓ'=>'Ú­','ﯔ'=>'Ú­','ﯕ'=>'Ú­','ﯖ'=>'Ú­','ﯗ'=>'Û‡','ﯘ'=>'Û‡','ﯙ'=>'Û†','ﯚ'=>'Û†','ﯛ'=>'Ûˆ','ﯜ'=>'Ûˆ','ï¯'=>'Û‡Ù´','ﯞ'=>'Û‹','ﯟ'=>'Û‹','ﯠ'=>'Û…','ﯡ'=>'Û…','ﯢ'=>'Û‰','ﯣ'=>'Û‰','ﯤ'=>'Û','ﯥ'=>'Û','ﯦ'=>'Û','ﯧ'=>'Û','ﯨ'=>'Ù‰','ﯩ'=>'Ù‰','ﯪ'=>'ئا','ﯫ'=>'ئا','ﯬ'=>'ÙŠÙ”Û•','ﯭ'=>'ÙŠÙ”Û•','ﯮ'=>'ÙŠÙ”Ùˆ','ﯯ'=>'ÙŠÙ”Ùˆ','ﯰ'=>'ÙŠÙ”Û‡','ﯱ'=>'ÙŠÙ”Û‡','ﯲ'=>'ÙŠÙ”Û†','ﯳ'=>'ÙŠÙ”Û†','ﯴ'=>'ÙŠÙ”Ûˆ','ﯵ'=>'ÙŠÙ”Ûˆ','ﯶ'=>'ÙŠÙ”Û','ﯷ'=>'ÙŠÙ”Û','ﯸ'=>'ÙŠÙ”Û','ﯹ'=>'ÙŠÙ”Ù‰','ﯺ'=>'ÙŠÙ”Ù‰','ﯻ'=>'ÙŠÙ”Ù‰','ﯼ'=>'ÛŒ','ﯽ'=>'ÛŒ','ﯾ'=>'ÛŒ','ﯿ'=>'ÛŒ','ï°€'=>'ئج','ï°'=>'ئح','ï°‚'=>'ÙŠÙ”Ù…','ï°ƒ'=>'ÙŠÙ”Ù‰','ï°„'=>'ÙŠÙ”ÙŠ','ï°…'=>'بج','ï°†'=>'بح','ï°‡'=>'بخ','ï°ˆ'=>'بم','ï°‰'=>'بى','ï°Š'=>'بي','ï°‹'=>'تج','ï°Œ'=>'تح','ï°'=>'تخ','ï°Ž'=>'تم','ï°'=>'تى','ï°'=>'تي','ï°‘'=>'ثج','ï°’'=>'ثم','ï°“'=>'ثى','ï°”'=>'ثي','ï°•'=>'جح','ï°–'=>'جم','ï°—'=>'حج','ï°˜'=>'حم','ï°™'=>'خج','ï°š'=>'خح','ï°›'=>'خم','ï°œ'=>'سج','ï°'=>'سح','ï°ž'=>'سخ','ï°Ÿ'=>'سم','ï° '=>'صح','ï°¡'=>'صم','ï°¢'=>'ضج','ï°£'=>'ضح','ï°¤'=>'ضخ','ï°¥'=>'ضم','ï°¦'=>'طح','ï°§'=>'طم','ï°¨'=>'ظم','ï°©'=>'عج','ï°ª'=>'عم','ï°«'=>'غج','ï°¬'=>'غم','ï°­'=>'Ùج','ï°®'=>'ÙØ­','ï°¯'=>'ÙØ®','ï°°'=>'ÙÙ…','ï°±'=>'ÙÙ‰','ï°²'=>'ÙÙŠ','ï°³'=>'قح','ï°´'=>'قم','ï°µ'=>'قى','ï°¶'=>'قي','ï°·'=>'كا','ï°¸'=>'كج','ï°¹'=>'كح','ï°º'=>'كخ','ï°»'=>'كل','ï°¼'=>'كم','ï°½'=>'كى','ï°¾'=>'كي','ï°¿'=>'لج','ï±€'=>'لح','ï±'=>'لخ','ﱂ'=>'لم','ﱃ'=>'لى','ﱄ'=>'لي','ï±…'=>'مج','ﱆ'=>'مح','ﱇ'=>'مخ','ﱈ'=>'مم','ﱉ'=>'مى','ﱊ'=>'مي','ﱋ'=>'نج','ﱌ'=>'نح','ï±'=>'نخ','ﱎ'=>'نم','ï±'=>'نى','ï±'=>'ني','ﱑ'=>'هج','ï±’'=>'هم','ﱓ'=>'هى','ï±”'=>'هي','ﱕ'=>'يج','ï±–'=>'يح','ï±—'=>'يخ','ﱘ'=>'يم','ï±™'=>'يى','ﱚ'=>'يي','ï±›'=>'ذٰ','ﱜ'=>'رٰ','ï±'=>'ىٰ','ﱞ'=>' ٌّ','ﱟ'=>' ÙÙ‘','ï± '=>' ÙŽÙ‘','ﱡ'=>' ÙÙ‘','ï±¢'=>' ÙÙ‘','ï±£'=>' ّٰ','ﱤ'=>'ئر','ï±¥'=>'ئز','ﱦ'=>'ÙŠÙ”Ù…','ﱧ'=>'ÙŠÙ”Ù†','ﱨ'=>'ÙŠÙ”Ù‰','ﱩ'=>'ÙŠÙ”ÙŠ','ﱪ'=>'بر','ﱫ'=>'بز','ﱬ'=>'بم','ï±­'=>'بن','ï±®'=>'بى','ﱯ'=>'بي','ï±°'=>'تر','ï±±'=>'تز','ï±²'=>'تم','ï±³'=>'تن','ï±´'=>'تى','ï±µ'=>'تي','ﱶ'=>'ثر','ï±·'=>'ثز','ﱸ'=>'ثم','ï±¹'=>'ثن','ﱺ'=>'ثى','ï±»'=>'ثي','ï±¼'=>'ÙÙ‰','ï±½'=>'ÙÙŠ','ï±¾'=>'قى','ﱿ'=>'قي','ï²€'=>'كا','ï²'=>'كل','ﲂ'=>'كم','ﲃ'=>'كى','ﲄ'=>'كي','ï²…'=>'لم','ﲆ'=>'لى','ﲇ'=>'لي','ﲈ'=>'ما','ﲉ'=>'مم','ﲊ'=>'نر','ﲋ'=>'نز','ﲌ'=>'نم','ï²'=>'نن','ﲎ'=>'نى','ï²'=>'ني','ï²'=>'ىٰ','ﲑ'=>'ير','ï²’'=>'يز','ﲓ'=>'يم','ï²”'=>'ين','ﲕ'=>'يى','ï²–'=>'يي','ï²—'=>'ئج','ﲘ'=>'ئح','ï²™'=>'ئخ','ﲚ'=>'ÙŠÙ”Ù…','ï²›'=>'ÙŠÙ”Ù‡','ﲜ'=>'بج','ï²'=>'بح','ﲞ'=>'بخ','ﲟ'=>'بم','ï² '=>'به','ﲡ'=>'تج','ï²¢'=>'تح','ï²£'=>'تخ','ﲤ'=>'تم','ï²¥'=>'ته','ﲦ'=>'ثم','ﲧ'=>'جح','ﲨ'=>'جم','ﲩ'=>'حج','ﲪ'=>'حم','ﲫ'=>'خج','ﲬ'=>'خم','ï²­'=>'سج','ï²®'=>'سح','ﲯ'=>'سخ','ï²°'=>'سم','ï²±'=>'صح','ï²²'=>'صخ','ï²³'=>'صم','ï²´'=>'ضج','ï²µ'=>'ضح','ﲶ'=>'ضخ','ï²·'=>'ضم','ﲸ'=>'طح','ï²¹'=>'ظم','ﲺ'=>'عج','ï²»'=>'عم','ï²¼'=>'غج','ï²½'=>'غم','ï²¾'=>'Ùج','ﲿ'=>'ÙØ­','ï³€'=>'ÙØ®','ï³'=>'ÙÙ…','ﳂ'=>'قح','ﳃ'=>'قم','ﳄ'=>'كج','ï³…'=>'كح','ﳆ'=>'كخ','ﳇ'=>'كل','ﳈ'=>'كم','ﳉ'=>'لج','ﳊ'=>'لح','ﳋ'=>'لخ','ﳌ'=>'لم','ï³'=>'له','ﳎ'=>'مج','ï³'=>'مح','ï³'=>'مخ','ﳑ'=>'مم','ï³’'=>'نج','ﳓ'=>'نح','ï³”'=>'نخ','ﳕ'=>'نم','ï³–'=>'نه','ï³—'=>'هج','ﳘ'=>'هم','ï³™'=>'هٰ','ﳚ'=>'يج','ï³›'=>'يح','ﳜ'=>'يخ','ï³'=>'يم','ﳞ'=>'يه','ﳟ'=>'ÙŠÙ”Ù…','ï³ '=>'ÙŠÙ”Ù‡','ﳡ'=>'بم','ï³¢'=>'به','ï³£'=>'تم','ﳤ'=>'ته','ï³¥'=>'ثم','ﳦ'=>'ثه','ﳧ'=>'سم','ﳨ'=>'سه','ﳩ'=>'شم','ﳪ'=>'شه','ﳫ'=>'كل','ﳬ'=>'كم','ï³­'=>'لم','ï³®'=>'نم','ﳯ'=>'نه','ï³°'=>'يم','ï³±'=>'يه','ï³²'=>'Ù€ÙŽÙ‘','ï³³'=>'Ù€ÙÙ‘','ï³´'=>'Ù€ÙÙ‘','ï³µ'=>'طى','ﳶ'=>'طي','ï³·'=>'عى','ﳸ'=>'عي','ï³¹'=>'غى','ﳺ'=>'غي','ï³»'=>'سى','ï³¼'=>'سي','ï³½'=>'شى','ï³¾'=>'شي','ﳿ'=>'حى','ï´€'=>'حي','ï´'=>'جى','ï´‚'=>'جي','ï´ƒ'=>'خى','ï´„'=>'خي','ï´…'=>'صى','ï´†'=>'صي','ï´‡'=>'ضى','ï´ˆ'=>'ضي','ï´‰'=>'شج','ï´Š'=>'شح','ï´‹'=>'شخ','ï´Œ'=>'شم','ï´'=>'شر','ï´Ž'=>'سر','ï´'=>'صر','ï´'=>'ضر','ï´‘'=>'طى','ï´’'=>'طي','ï´“'=>'عى','ï´”'=>'عي','ï´•'=>'غى','ï´–'=>'غي','ï´—'=>'سى','ï´˜'=>'سي','ï´™'=>'شى','ï´š'=>'شي','ï´›'=>'حى','ï´œ'=>'حي','ï´'=>'جى','ï´ž'=>'جي','ï´Ÿ'=>'خى','ï´ '=>'خي','ï´¡'=>'صى','ï´¢'=>'صي','ï´£'=>'ضى','ï´¤'=>'ضي','ï´¥'=>'شج','ï´¦'=>'شح','ï´§'=>'شخ','ï´¨'=>'شم','ï´©'=>'شر','ï´ª'=>'سر','ï´«'=>'صر','ï´¬'=>'ضر','ï´­'=>'شج','ï´®'=>'شح','ï´¯'=>'شخ','ï´°'=>'شم','ï´±'=>'سه','ï´²'=>'شه','ï´³'=>'طم','ï´´'=>'سج','ï´µ'=>'سح','ï´¶'=>'سخ','ï´·'=>'شج','ï´¸'=>'شح','ï´¹'=>'شخ','ï´º'=>'طم','ï´»'=>'ظم','ï´¼'=>'اً','ï´½'=>'اً','ïµ'=>'تجم','ﵑ'=>'تحج','ïµ’'=>'تحج','ﵓ'=>'تحم','ïµ”'=>'تخم','ﵕ'=>'تمج','ïµ–'=>'تمح','ïµ—'=>'تمخ','ﵘ'=>'جمح','ïµ™'=>'جمح','ﵚ'=>'حمي','ïµ›'=>'حمى','ﵜ'=>'سحج','ïµ'=>'سجح','ﵞ'=>'سجى','ﵟ'=>'سمح','ïµ '=>'سمح','ﵡ'=>'سمج','ïµ¢'=>'سمم','ïµ£'=>'سمم','ﵤ'=>'صحح','ïµ¥'=>'صحح','ﵦ'=>'صمم','ﵧ'=>'شحم','ﵨ'=>'شحم','ﵩ'=>'شجي','ﵪ'=>'شمخ','ﵫ'=>'شمخ','ﵬ'=>'شمم','ïµ­'=>'شمم','ïµ®'=>'ضحى','ﵯ'=>'ضخم','ïµ°'=>'ضخم','ïµ±'=>'طمح','ïµ²'=>'طمح','ïµ³'=>'طمم','ïµ´'=>'طمي','ïµµ'=>'عجم','ﵶ'=>'عمم','ïµ·'=>'عمم','ﵸ'=>'عمى','ïµ¹'=>'غمم','ﵺ'=>'غمي','ïµ»'=>'غمى','ïµ¼'=>'Ùخم','ïµ½'=>'Ùخم','ïµ¾'=>'قمح','ﵿ'=>'قمم','ﶀ'=>'لحم','ï¶'=>'لحي','ﶂ'=>'لحى','ﶃ'=>'لجج','ﶄ'=>'لجج','ﶅ'=>'لخم','ﶆ'=>'لخم','ﶇ'=>'لمح','ﶈ'=>'لمح','ﶉ'=>'محج','ﶊ'=>'محم','ﶋ'=>'محي','ﶌ'=>'مجح','ï¶'=>'مجم','ﶎ'=>'مخج','ï¶'=>'مخم','ﶒ'=>'مجخ','ﶓ'=>'همج','ﶔ'=>'همم','ﶕ'=>'نحم','ﶖ'=>'نحى','ﶗ'=>'نجم','ﶘ'=>'نجم','ﶙ'=>'نجى','ﶚ'=>'نمي','ﶛ'=>'نمى','ﶜ'=>'يمم','ï¶'=>'يمم','ﶞ'=>'بخي','ﶟ'=>'تجي','ﶠ'=>'تجى','ﶡ'=>'تخي','ﶢ'=>'تخى','ﶣ'=>'تمي','ﶤ'=>'تمى','ﶥ'=>'جمي','ﶦ'=>'جحى','ﶧ'=>'جمى','ﶨ'=>'سخى','ﶩ'=>'صحي','ﶪ'=>'شحي','ﶫ'=>'ضحي','ﶬ'=>'لجي','ﶭ'=>'لمي','ﶮ'=>'يحي','ﶯ'=>'يجي','ﶰ'=>'يمي','ﶱ'=>'ممي','ﶲ'=>'قمي','ﶳ'=>'نحي','ﶴ'=>'قمح','ﶵ'=>'لحم','ﶶ'=>'عمي','ﶷ'=>'كمي','ﶸ'=>'نجح','ﶹ'=>'مخي','ﶺ'=>'لجم','ﶻ'=>'كمم','ﶼ'=>'لجم','ﶽ'=>'نجح','ﶾ'=>'جحي','ﶿ'=>'حجي','ï·€'=>'مجي','ï·'=>'Ùمي','ï·‚'=>'بحي','ï·ƒ'=>'كمم','ï·„'=>'عجم','ï·…'=>'صمم','ï·†'=>'سخي','ï·‡'=>'نجي','ï·°'=>'صلے','ï·±'=>'قلے','ï·²'=>'الله','ï·³'=>'اكبر','ï·´'=>'محمد','ï·µ'=>'صلعم','ï·¶'=>'رسول','ï··'=>'عليه','ï·¸'=>'وسلم','ï·¹'=>'صلى','ï·º'=>'صلى الله عليه وسلم','ï·»'=>'جل جلاله','ï·¼'=>'ریال','ï¸'=>',','︑'=>'ã€','︒'=>'。','︓'=>':','︔'=>';','︕'=>'!','︖'=>'?','︗'=>'〖','︘'=>'〗','︙'=>'...','︰'=>'..','︱'=>'—','︲'=>'–','︳'=>'_','︴'=>'_','︵'=>'(','︶'=>')','︷'=>'{','︸'=>'}','︹'=>'〔','︺'=>'〕','︻'=>'ã€','︼'=>'】','︽'=>'《','︾'=>'》','︿'=>'〈','ï¹€'=>'〉','ï¹'=>'「','﹂'=>'ã€','﹃'=>'『','﹄'=>'ã€','﹇'=>'[','﹈'=>']','﹉'=>' Ì…','﹊'=>' Ì…','﹋'=>' Ì…','﹌'=>' Ì…','ï¹'=>'_','﹎'=>'_','ï¹'=>'_','ï¹'=>',','﹑'=>'ã€','ï¹’'=>'.','ï¹”'=>';','﹕'=>':','ï¹–'=>'?','ï¹—'=>'!','﹘'=>'—','ï¹™'=>'(','﹚'=>')','ï¹›'=>'{','﹜'=>'}','ï¹'=>'〔','﹞'=>'〕','﹟'=>'#','ï¹ '=>'&','﹡'=>'*','ï¹¢'=>'+','ï¹£'=>'-','﹤'=>'<','ï¹¥'=>'>','﹦'=>'=','﹨'=>'\\','﹩'=>'$','﹪'=>'%','﹫'=>'@','ï¹°'=>' Ù‹','ï¹±'=>'ـً','ï¹²'=>' ÙŒ','ï¹´'=>' Ù','ﹶ'=>' ÙŽ','ï¹·'=>'Ù€ÙŽ','ﹸ'=>' Ù','ï¹¹'=>'Ù€Ù','ﹺ'=>' Ù','ï¹»'=>'Ù€Ù','ï¹¼'=>' Ù‘','ï¹½'=>'ـّ','ï¹¾'=>' Ù’','ﹿ'=>'ـْ','ﺀ'=>'Ø¡','ïº'=>'آ','ﺂ'=>'آ','ﺃ'=>'أ','ﺄ'=>'أ','ﺅ'=>'ÙˆÙ”','ﺆ'=>'ÙˆÙ”','ﺇ'=>'إ','ﺈ'=>'إ','ﺉ'=>'ÙŠÙ”','ﺊ'=>'ÙŠÙ”','ﺋ'=>'ÙŠÙ”','ﺌ'=>'ÙŠÙ”','ïº'=>'ا','ﺎ'=>'ا','ïº'=>'ب','ïº'=>'ب','ﺑ'=>'ب','ﺒ'=>'ب','ﺓ'=>'Ø©','ﺔ'=>'Ø©','ﺕ'=>'ت','ﺖ'=>'ت','ﺗ'=>'ت','ﺘ'=>'ت','ﺙ'=>'Ø«','ﺚ'=>'Ø«','ﺛ'=>'Ø«','ﺜ'=>'Ø«','ïº'=>'ج','ﺞ'=>'ج','ﺟ'=>'ج','ﺠ'=>'ج','ﺡ'=>'Ø­','ﺢ'=>'Ø­','ﺣ'=>'Ø­','ﺤ'=>'Ø­','ﺥ'=>'Ø®','ﺦ'=>'Ø®','ﺧ'=>'Ø®','ﺨ'=>'Ø®','ﺩ'=>'د','ﺪ'=>'د','ﺫ'=>'Ø°','ﺬ'=>'Ø°','ﺭ'=>'ر','ﺮ'=>'ر','ﺯ'=>'ز','ﺰ'=>'ز','ﺱ'=>'س','ﺲ'=>'س','ﺳ'=>'س','ﺴ'=>'س','ﺵ'=>'Ø´','ﺶ'=>'Ø´','ﺷ'=>'Ø´','ﺸ'=>'Ø´','ﺹ'=>'ص','ﺺ'=>'ص','ﺻ'=>'ص','ﺼ'=>'ص','ﺽ'=>'ض','ﺾ'=>'ض','ﺿ'=>'ض','ﻀ'=>'ض','ï»'=>'Ø·','ﻂ'=>'Ø·','ﻃ'=>'Ø·','ﻄ'=>'Ø·','ï»…'=>'ظ','ﻆ'=>'ظ','ﻇ'=>'ظ','ﻈ'=>'ظ','ﻉ'=>'ع','ﻊ'=>'ع','ﻋ'=>'ع','ﻌ'=>'ع','ï»'=>'غ','ﻎ'=>'غ','ï»'=>'غ','ï»'=>'غ','ﻑ'=>'Ù','ï»’'=>'Ù','ﻓ'=>'Ù','ï»”'=>'Ù','ﻕ'=>'Ù‚','ï»–'=>'Ù‚','ï»—'=>'Ù‚','ﻘ'=>'Ù‚','ï»™'=>'Ùƒ','ﻚ'=>'Ùƒ','ï»›'=>'Ùƒ','ﻜ'=>'Ùƒ','ï»'=>'Ù„','ﻞ'=>'Ù„','ﻟ'=>'Ù„','ï» '=>'Ù„','ﻡ'=>'Ù…','ﻢ'=>'Ù…','ﻣ'=>'Ù…','ﻤ'=>'Ù…','ﻥ'=>'Ù†','ﻦ'=>'Ù†','ﻧ'=>'Ù†','ﻨ'=>'Ù†','ﻩ'=>'Ù‡','ﻪ'=>'Ù‡','ﻫ'=>'Ù‡','ﻬ'=>'Ù‡','ï»­'=>'Ùˆ','ï»®'=>'Ùˆ','ﻯ'=>'Ù‰','ï»°'=>'Ù‰','ï»±'=>'ÙŠ','ﻲ'=>'ÙŠ','ﻳ'=>'ÙŠ','ï»´'=>'ÙŠ','ﻵ'=>'لآ','ﻶ'=>'لآ','ï»·'=>'لأ','ﻸ'=>'لأ','ﻹ'=>'لإ','ﻺ'=>'لإ','ï»»'=>'لا','ﻼ'=>'لا','ï¼'=>'!','"'=>'"','#'=>'#','$'=>'$','ï¼…'=>'%','&'=>'&','''=>'\'','('=>'(',')'=>')','*'=>'*','+'=>'+',','=>',','ï¼'=>'-','.'=>'.','ï¼'=>'/','ï¼'=>'0','1'=>'1','ï¼’'=>'2','3'=>'3','ï¼”'=>'4','5'=>'5','ï¼–'=>'6','ï¼—'=>'7','8'=>'8','ï¼™'=>'9',':'=>':','ï¼›'=>';','<'=>'<','ï¼'=>'=','>'=>'>','?'=>'?','ï¼ '=>'@','A'=>'A','ï¼¢'=>'B','ï¼£'=>'C','D'=>'D','ï¼¥'=>'E','F'=>'F','G'=>'G','H'=>'H','I'=>'I','J'=>'J','K'=>'K','L'=>'L','ï¼­'=>'M','ï¼®'=>'N','O'=>'O','ï¼°'=>'P','ï¼±'=>'Q','ï¼²'=>'R','ï¼³'=>'S','ï¼´'=>'T','ï¼µ'=>'U','V'=>'V','ï¼·'=>'W','X'=>'X','ï¼¹'=>'Y','Z'=>'Z','ï¼»'=>'[','ï¼¼'=>'\\','ï¼½'=>']','ï¼¾'=>'^','_'=>'_','ï½€'=>'`','ï½'=>'a','b'=>'b','c'=>'c','d'=>'d','ï½…'=>'e','f'=>'f','g'=>'g','h'=>'h','i'=>'i','j'=>'j','k'=>'k','l'=>'l','ï½'=>'m','n'=>'n','ï½'=>'o','ï½'=>'p','q'=>'q','ï½’'=>'r','s'=>'s','ï½”'=>'t','u'=>'u','ï½–'=>'v','ï½—'=>'w','x'=>'x','ï½™'=>'y','z'=>'z','ï½›'=>'{','|'=>'|','ï½'=>'}','~'=>'~','⦅'=>'⦅','ï½ '=>'⦆','。'=>'。','ï½¢'=>'「','ï½£'=>'ã€','、'=>'ã€','ï½¥'=>'・','ヲ'=>'ヲ','ァ'=>'ã‚¡','ィ'=>'ã‚£','ゥ'=>'ã‚¥','ェ'=>'ェ','ォ'=>'ã‚©','ャ'=>'ャ','ï½­'=>'ュ','ï½®'=>'ョ','ッ'=>'ッ','ï½°'=>'ー','ï½±'=>'ã‚¢','ï½²'=>'イ','ï½³'=>'ウ','ï½´'=>'エ','ï½µ'=>'オ','カ'=>'ã‚«','ï½·'=>'ã‚­','ク'=>'ク','ï½¹'=>'ケ','コ'=>'コ','ï½»'=>'サ','ï½¼'=>'ã‚·','ï½½'=>'ス','ï½¾'=>'ã‚»','ソ'=>'ソ','ï¾€'=>'ã‚¿','ï¾'=>'ãƒ','ツ'=>'ツ','テ'=>'テ','ト'=>'ト','ï¾…'=>'ナ','ニ'=>'ニ','ヌ'=>'ヌ','ネ'=>'ãƒ','ノ'=>'ノ','ハ'=>'ãƒ','ヒ'=>'ヒ','フ'=>'フ','ï¾'=>'ヘ','ホ'=>'ホ','ï¾'=>'マ','ï¾'=>'ミ','ム'=>'ム','ï¾’'=>'メ','モ'=>'モ','ï¾”'=>'ヤ','ユ'=>'ユ','ï¾–'=>'ヨ','ï¾—'=>'ラ','リ'=>'リ','ï¾™'=>'ル','レ'=>'レ','ï¾›'=>'ロ','ワ'=>'ワ','ï¾'=>'ン','゙'=>'ã‚™','゚'=>'ã‚š','ï¾ '=>'á… ','ᄀ'=>'á„€','ï¾¢'=>'á„','ï¾£'=>'ᆪ','ᄂ'=>'á„‚','ï¾¥'=>'ᆬ','ᆭ'=>'ᆭ','ᄃ'=>'ᄃ','ᄄ'=>'á„„','ᄅ'=>'á„…','ᆰ'=>'ᆰ','ᆱ'=>'ᆱ','ᆲ'=>'ᆲ','ï¾­'=>'ᆳ','ï¾®'=>'ᆴ','ᆵ'=>'ᆵ','ï¾°'=>'á„š','ï¾±'=>'ᄆ','ï¾²'=>'ᄇ','ï¾³'=>'ᄈ','ï¾´'=>'á„¡','ï¾µ'=>'ᄉ','ᄊ'=>'á„Š','ï¾·'=>'á„‹','ᄌ'=>'á„Œ','ï¾¹'=>'á„','ᄎ'=>'á„Ž','ï¾»'=>'á„','ï¾¼'=>'á„','ï¾½'=>'á„‘','ï¾¾'=>'á„’','ï¿‚'=>'á…¡','ᅢ'=>'á…¢','ï¿„'=>'á…£','ï¿…'=>'á…¤','ᅥ'=>'á…¥','ᅦ'=>'á…¦','ï¿Š'=>'á…§','ï¿‹'=>'á…¨','ï¿Œ'=>'á…©','ï¿'=>'á…ª','ï¿Ž'=>'á…«','ï¿'=>'á…¬','ï¿’'=>'á…­','ï¿“'=>'á…®','ï¿”'=>'á…¯','ï¿•'=>'á…°','ï¿–'=>'á…±','ï¿—'=>'á…²','ï¿š'=>'á…³','ï¿›'=>'á…´','ï¿œ'=>'á…µ','ï¿ '=>'¢','ï¿¡'=>'£','ï¿¢'=>'¬','ï¿£'=>' Ì„','¦'=>'¦','ï¿¥'=>'Â¥','₩'=>'â‚©','│'=>'│','ï¿©'=>'â†','↑'=>'↑','ï¿«'=>'→','↓'=>'↓','ï¿­'=>'â– ','ï¿®'=>'â—‹','ð…ž'=>'ð…—ð…¥','ð…Ÿ'=>'ð…˜ð…¥','ð… '=>'ð…˜ð…¥ð…®','ð…¡'=>'ð…˜ð…¥ð…¯','ð…¢'=>'ð…˜ð…¥ð…°','ð…£'=>'ð…˜ð…¥ð…±','ð…¤'=>'ð…˜ð…¥ð…²','ð†»'=>'ð†¹ð…¥','ð†¼'=>'ð†ºð…¥','ð†½'=>'ð†¹ð…¥ð…®','ð†¾'=>'ð†ºð…¥ð…®','ð†¿'=>'ð†¹ð…¥ð…¯','ð‡€'=>'ð†ºð…¥ð…¯','ð€'=>'A','ð'=>'B','ð‚'=>'C','ðƒ'=>'D','ð„'=>'E','ð…'=>'F','ð†'=>'G','ð‡'=>'H','ðˆ'=>'I','ð‰'=>'J','ðŠ'=>'K','ð‹'=>'L','ðŒ'=>'M','ð'=>'N','ðŽ'=>'O','ð'=>'P','ð'=>'Q','ð‘'=>'R','ð’'=>'S','ð“'=>'T','ð”'=>'U','ð•'=>'V','ð–'=>'W','ð—'=>'X','ð˜'=>'Y','ð™'=>'Z','ðš'=>'a','ð›'=>'b','ðœ'=>'c','ð'=>'d','ðž'=>'e','ðŸ'=>'f','ð '=>'g','ð¡'=>'h','ð¢'=>'i','ð£'=>'j','ð¤'=>'k','ð¥'=>'l','ð¦'=>'m','ð§'=>'n','ð¨'=>'o','ð©'=>'p','ðª'=>'q','ð«'=>'r','ð¬'=>'s','ð­'=>'t','ð®'=>'u','ð¯'=>'v','ð°'=>'w','ð±'=>'x','ð²'=>'y','ð³'=>'z','ð´'=>'A','ðµ'=>'B','ð¶'=>'C','ð·'=>'D','ð¸'=>'E','ð¹'=>'F','ðº'=>'G','ð»'=>'H','ð¼'=>'I','ð½'=>'J','ð¾'=>'K','ð¿'=>'L','ð‘€'=>'M','ð‘'=>'N','ð‘‚'=>'O','ð‘ƒ'=>'P','ð‘„'=>'Q','ð‘…'=>'R','ð‘†'=>'S','ð‘‡'=>'T','ð‘ˆ'=>'U','ð‘‰'=>'V','ð‘Š'=>'W','ð‘‹'=>'X','ð‘Œ'=>'Y','ð‘'=>'Z','ð‘Ž'=>'a','ð‘'=>'b','ð‘'=>'c','ð‘‘'=>'d','ð‘’'=>'e','ð‘“'=>'f','ð‘”'=>'g','ð‘–'=>'i','ð‘—'=>'j','ð‘˜'=>'k','ð‘™'=>'l','ð‘š'=>'m','ð‘›'=>'n','ð‘œ'=>'o','ð‘'=>'p','ð‘ž'=>'q','ð‘Ÿ'=>'r','ð‘ '=>'s','ð‘¡'=>'t','ð‘¢'=>'u','ð‘£'=>'v','ð‘¤'=>'w','ð‘¥'=>'x','ð‘¦'=>'y','ð‘§'=>'z','ð‘¨'=>'A','ð‘©'=>'B','ð‘ª'=>'C','ð‘«'=>'D','ð‘¬'=>'E','ð‘­'=>'F','ð‘®'=>'G','ð‘¯'=>'H','ð‘°'=>'I','ð‘±'=>'J','ð‘²'=>'K','ð‘³'=>'L','ð‘´'=>'M','ð‘µ'=>'N','ð‘¶'=>'O','ð‘·'=>'P','ð‘¸'=>'Q','ð‘¹'=>'R','ð‘º'=>'S','ð‘»'=>'T','ð‘¼'=>'U','ð‘½'=>'V','ð‘¾'=>'W','ð‘¿'=>'X','ð’€'=>'Y','ð’'=>'Z','ð’‚'=>'a','ð’ƒ'=>'b','ð’„'=>'c','ð’…'=>'d','ð’†'=>'e','ð’‡'=>'f','ð’ˆ'=>'g','ð’‰'=>'h','ð’Š'=>'i','ð’‹'=>'j','ð’Œ'=>'k','ð’'=>'l','ð’Ž'=>'m','ð’'=>'n','ð’'=>'o','ð’‘'=>'p','ð’’'=>'q','ð’“'=>'r','ð’”'=>'s','ð’•'=>'t','ð’–'=>'u','ð’—'=>'v','ð’˜'=>'w','ð’™'=>'x','ð’š'=>'y','ð’›'=>'z','ð’œ'=>'A','ð’ž'=>'C','ð’Ÿ'=>'D','ð’¢'=>'G','ð’¥'=>'J','ð’¦'=>'K','ð’©'=>'N','ð’ª'=>'O','ð’«'=>'P','ð’¬'=>'Q','ð’®'=>'S','ð’¯'=>'T','ð’°'=>'U','ð’±'=>'V','ð’²'=>'W','ð’³'=>'X','ð’´'=>'Y','ð’µ'=>'Z','ð’¶'=>'a','ð’·'=>'b','ð’¸'=>'c','ð’¹'=>'d','ð’»'=>'f','ð’½'=>'h','ð’¾'=>'i','ð’¿'=>'j','ð“€'=>'k','ð“'=>'l','ð“‚'=>'m','ð“ƒ'=>'n','ð“…'=>'p','ð“†'=>'q','ð“‡'=>'r','ð“ˆ'=>'s','ð“‰'=>'t','ð“Š'=>'u','ð“‹'=>'v','ð“Œ'=>'w','ð“'=>'x','ð“Ž'=>'y','ð“'=>'z','ð“'=>'A','ð“‘'=>'B','ð“’'=>'C','ð““'=>'D','ð“”'=>'E','ð“•'=>'F','ð“–'=>'G','ð“—'=>'H','ð“˜'=>'I','ð“™'=>'J','ð“š'=>'K','ð“›'=>'L','ð“œ'=>'M','ð“'=>'N','ð“ž'=>'O','ð“Ÿ'=>'P','ð“ '=>'Q','ð“¡'=>'R','ð“¢'=>'S','ð“£'=>'T','ð“¤'=>'U','ð“¥'=>'V','ð“¦'=>'W','ð“§'=>'X','ð“¨'=>'Y','ð“©'=>'Z','ð“ª'=>'a','ð“«'=>'b','ð“¬'=>'c','ð“­'=>'d','ð“®'=>'e','ð“¯'=>'f','ð“°'=>'g','ð“±'=>'h','ð“²'=>'i','ð“³'=>'j','ð“´'=>'k','ð“µ'=>'l','ð“¶'=>'m','ð“·'=>'n','ð“¸'=>'o','ð“¹'=>'p','ð“º'=>'q','ð“»'=>'r','ð“¼'=>'s','ð“½'=>'t','ð“¾'=>'u','ð“¿'=>'v','ð”€'=>'w','ð”'=>'x','ð”‚'=>'y','ð”ƒ'=>'z','ð”„'=>'A','ð”…'=>'B','ð”‡'=>'D','ð”ˆ'=>'E','ð”‰'=>'F','ð”Š'=>'G','ð”'=>'J','ð”Ž'=>'K','ð”'=>'L','ð”'=>'M','ð”‘'=>'N','ð”’'=>'O','ð”“'=>'P','ð””'=>'Q','ð”–'=>'S','ð”—'=>'T','ð”˜'=>'U','ð”™'=>'V','ð”š'=>'W','ð”›'=>'X','ð”œ'=>'Y','ð”ž'=>'a','ð”Ÿ'=>'b','ð” '=>'c','ð”¡'=>'d','ð”¢'=>'e','ð”£'=>'f','ð”¤'=>'g','ð”¥'=>'h','ð”¦'=>'i','ð”§'=>'j','ð”¨'=>'k','ð”©'=>'l','ð”ª'=>'m','ð”«'=>'n','ð”¬'=>'o','ð”­'=>'p','ð”®'=>'q','ð”¯'=>'r','ð”°'=>'s','ð”±'=>'t','ð”²'=>'u','ð”³'=>'v','ð”´'=>'w','ð”µ'=>'x','ð”¶'=>'y','ð”·'=>'z','ð”¸'=>'A','ð”¹'=>'B','ð”»'=>'D','ð”¼'=>'E','ð”½'=>'F','ð”¾'=>'G','ð•€'=>'I','ð•'=>'J','ð•‚'=>'K','ð•ƒ'=>'L','ð•„'=>'M','ð•†'=>'O','ð•Š'=>'S','ð•‹'=>'T','ð•Œ'=>'U','ð•'=>'V','ð•Ž'=>'W','ð•'=>'X','ð•'=>'Y','ð•’'=>'a','ð•“'=>'b','ð•”'=>'c','ð••'=>'d','ð•–'=>'e','ð•—'=>'f','ð•˜'=>'g','ð•™'=>'h','ð•š'=>'i','ð•›'=>'j','ð•œ'=>'k','ð•'=>'l','ð•ž'=>'m','ð•Ÿ'=>'n','ð• '=>'o','ð•¡'=>'p','ð•¢'=>'q','ð•£'=>'r','ð•¤'=>'s','ð•¥'=>'t','ð•¦'=>'u','ð•§'=>'v','ð•¨'=>'w','ð•©'=>'x','ð•ª'=>'y','ð•«'=>'z','ð•¬'=>'A','ð•­'=>'B','ð•®'=>'C','ð•¯'=>'D','ð•°'=>'E','ð•±'=>'F','ð•²'=>'G','ð•³'=>'H','ð•´'=>'I','ð•µ'=>'J','ð•¶'=>'K','ð•·'=>'L','ð•¸'=>'M','ð•¹'=>'N','ð•º'=>'O','ð•»'=>'P','ð•¼'=>'Q','ð•½'=>'R','ð•¾'=>'S','ð•¿'=>'T','ð–€'=>'U','ð–'=>'V','ð–‚'=>'W','ð–ƒ'=>'X','ð–„'=>'Y','ð–…'=>'Z','ð–†'=>'a','ð–‡'=>'b','ð–ˆ'=>'c','ð–‰'=>'d','ð–Š'=>'e','ð–‹'=>'f','ð–Œ'=>'g','ð–'=>'h','ð–Ž'=>'i','ð–'=>'j','ð–'=>'k','ð–‘'=>'l','ð–’'=>'m','ð–“'=>'n','ð–”'=>'o','ð–•'=>'p','ð––'=>'q','ð–—'=>'r','ð–˜'=>'s','ð–™'=>'t','ð–š'=>'u','ð–›'=>'v','ð–œ'=>'w','ð–'=>'x','ð–ž'=>'y','ð–Ÿ'=>'z','ð– '=>'A','ð–¡'=>'B','ð–¢'=>'C','ð–£'=>'D','ð–¤'=>'E','ð–¥'=>'F','ð–¦'=>'G','ð–§'=>'H','ð–¨'=>'I','ð–©'=>'J','ð–ª'=>'K','ð–«'=>'L','ð–¬'=>'M','ð–­'=>'N','ð–®'=>'O','ð–¯'=>'P','ð–°'=>'Q','ð–±'=>'R','ð–²'=>'S','ð–³'=>'T','ð–´'=>'U','ð–µ'=>'V','ð–¶'=>'W','ð–·'=>'X','ð–¸'=>'Y','ð–¹'=>'Z','ð–º'=>'a','ð–»'=>'b','ð–¼'=>'c','ð–½'=>'d','ð–¾'=>'e','ð–¿'=>'f','ð—€'=>'g','ð—'=>'h','ð—‚'=>'i','ð—ƒ'=>'j','ð—„'=>'k','ð—…'=>'l','ð—†'=>'m','ð—‡'=>'n','ð—ˆ'=>'o','ð—‰'=>'p','ð—Š'=>'q','ð—‹'=>'r','ð—Œ'=>'s','ð—'=>'t','ð—Ž'=>'u','ð—'=>'v','ð—'=>'w','ð—‘'=>'x','ð—’'=>'y','ð—“'=>'z','ð—”'=>'A','ð—•'=>'B','ð—–'=>'C','ð——'=>'D','ð—˜'=>'E','ð—™'=>'F','ð—š'=>'G','ð—›'=>'H','ð—œ'=>'I','ð—'=>'J','ð—ž'=>'K','ð—Ÿ'=>'L','ð— '=>'M','ð—¡'=>'N','ð—¢'=>'O','ð—£'=>'P','ð—¤'=>'Q','ð—¥'=>'R','ð—¦'=>'S','ð—§'=>'T','ð—¨'=>'U','ð—©'=>'V','ð—ª'=>'W','ð—«'=>'X','ð—¬'=>'Y','ð—­'=>'Z','ð—®'=>'a','ð—¯'=>'b','ð—°'=>'c','ð—±'=>'d','ð—²'=>'e','ð—³'=>'f','ð—´'=>'g','ð—µ'=>'h','ð—¶'=>'i','ð—·'=>'j','ð—¸'=>'k','ð—¹'=>'l','ð—º'=>'m','ð—»'=>'n','ð—¼'=>'o','ð—½'=>'p','ð—¾'=>'q','ð—¿'=>'r','ð˜€'=>'s','ð˜'=>'t','ð˜‚'=>'u','ð˜ƒ'=>'v','ð˜„'=>'w','ð˜…'=>'x','ð˜†'=>'y','ð˜‡'=>'z','ð˜ˆ'=>'A','ð˜‰'=>'B','ð˜Š'=>'C','ð˜‹'=>'D','ð˜Œ'=>'E','ð˜'=>'F','ð˜Ž'=>'G','ð˜'=>'H','ð˜'=>'I','ð˜‘'=>'J','ð˜’'=>'K','ð˜“'=>'L','ð˜”'=>'M','ð˜•'=>'N','ð˜–'=>'O','ð˜—'=>'P','ð˜˜'=>'Q','ð˜™'=>'R','ð˜š'=>'S','ð˜›'=>'T','ð˜œ'=>'U','ð˜'=>'V','ð˜ž'=>'W','ð˜Ÿ'=>'X','ð˜ '=>'Y','ð˜¡'=>'Z','ð˜¢'=>'a','ð˜£'=>'b','ð˜¤'=>'c','ð˜¥'=>'d','ð˜¦'=>'e','ð˜§'=>'f','ð˜¨'=>'g','ð˜©'=>'h','ð˜ª'=>'i','ð˜«'=>'j','ð˜¬'=>'k','ð˜­'=>'l','ð˜®'=>'m','ð˜¯'=>'n','ð˜°'=>'o','ð˜±'=>'p','ð˜²'=>'q','ð˜³'=>'r','ð˜´'=>'s','ð˜µ'=>'t','ð˜¶'=>'u','ð˜·'=>'v','ð˜¸'=>'w','ð˜¹'=>'x','ð˜º'=>'y','ð˜»'=>'z','ð˜¼'=>'A','ð˜½'=>'B','ð˜¾'=>'C','ð˜¿'=>'D','ð™€'=>'E','ð™'=>'F','ð™‚'=>'G','ð™ƒ'=>'H','ð™„'=>'I','ð™…'=>'J','ð™†'=>'K','ð™‡'=>'L','ð™ˆ'=>'M','ð™‰'=>'N','ð™Š'=>'O','ð™‹'=>'P','ð™Œ'=>'Q','ð™'=>'R','ð™Ž'=>'S','ð™'=>'T','ð™'=>'U','ð™‘'=>'V','ð™’'=>'W','ð™“'=>'X','ð™”'=>'Y','ð™•'=>'Z','ð™–'=>'a','ð™—'=>'b','ð™˜'=>'c','ð™™'=>'d','ð™š'=>'e','ð™›'=>'f','ð™œ'=>'g','ð™'=>'h','ð™ž'=>'i','ð™Ÿ'=>'j','ð™ '=>'k','ð™¡'=>'l','ð™¢'=>'m','ð™£'=>'n','ð™¤'=>'o','ð™¥'=>'p','ð™¦'=>'q','ð™§'=>'r','ð™¨'=>'s','ð™©'=>'t','ð™ª'=>'u','ð™«'=>'v','ð™¬'=>'w','ð™­'=>'x','ð™®'=>'y','ð™¯'=>'z','ð™°'=>'A','ð™±'=>'B','ð™²'=>'C','ð™³'=>'D','ð™´'=>'E','ð™µ'=>'F','ð™¶'=>'G','ð™·'=>'H','ð™¸'=>'I','ð™¹'=>'J','ð™º'=>'K','ð™»'=>'L','ð™¼'=>'M','ð™½'=>'N','ð™¾'=>'O','ð™¿'=>'P','ðš€'=>'Q','ðš'=>'R','ðš‚'=>'S','ðšƒ'=>'T','ðš„'=>'U','ðš…'=>'V','ðš†'=>'W','ðš‡'=>'X','ðšˆ'=>'Y','ðš‰'=>'Z','ðšŠ'=>'a','ðš‹'=>'b','ðšŒ'=>'c','ðš'=>'d','ðšŽ'=>'e','ðš'=>'f','ðš'=>'g','ðš‘'=>'h','ðš’'=>'i','ðš“'=>'j','ðš”'=>'k','ðš•'=>'l','ðš–'=>'m','ðš—'=>'n','ðš˜'=>'o','ðš™'=>'p','ðšš'=>'q','ðš›'=>'r','ðšœ'=>'s','ðš'=>'t','ðšž'=>'u','ðšŸ'=>'v','ðš '=>'w','ðš¡'=>'x','ðš¢'=>'y','ðš£'=>'z','ðš¤'=>'ı','ðš¥'=>'È·','ðš¨'=>'Α','ðš©'=>'Î’','ðšª'=>'Γ','ðš«'=>'Δ','ðš¬'=>'Ε','ðš­'=>'Ζ','ðš®'=>'Η','ðš¯'=>'Θ','ðš°'=>'Ι','ðš±'=>'Κ','ðš²'=>'Λ','ðš³'=>'Îœ','ðš´'=>'Î','ðšµ'=>'Ξ','ðš¶'=>'Ο','ðš·'=>'Π','ðš¸'=>'Ρ','ðš¹'=>'Θ','ðšº'=>'Σ','ðš»'=>'Τ','ðš¼'=>'Î¥','ðš½'=>'Φ','ðš¾'=>'Χ','ðš¿'=>'Ψ','ð›€'=>'Ω','ð›'=>'∇','ð›‚'=>'α','ð›ƒ'=>'β','ð›„'=>'γ','ð›…'=>'δ','ð›†'=>'ε','ð›‡'=>'ζ','ð›ˆ'=>'η','ð›‰'=>'θ','ð›Š'=>'ι','ð›‹'=>'κ','ð›Œ'=>'λ','ð›'=>'μ','ð›Ž'=>'ν','ð›'=>'ξ','ð›'=>'ο','ð›‘'=>'Ï€','ð›’'=>'Ï','ð›“'=>'Ï‚','ð›”'=>'σ','ð›•'=>'Ï„','ð›–'=>'Ï…','ð›—'=>'φ','ð›˜'=>'χ','ð›™'=>'ψ','ð›š'=>'ω','ð››'=>'∂','ð›œ'=>'ε','ð›'=>'θ','ð›ž'=>'κ','ð›Ÿ'=>'φ','ð› '=>'Ï','ð›¡'=>'Ï€','ð›¢'=>'Α','ð›£'=>'Î’','ð›¤'=>'Γ','ð›¥'=>'Δ','ð›¦'=>'Ε','ð›§'=>'Ζ','ð›¨'=>'Η','ð›©'=>'Θ','ð›ª'=>'Ι','ð›«'=>'Κ','ð›¬'=>'Λ','ð›­'=>'Îœ','ð›®'=>'Î','ð›¯'=>'Ξ','ð›°'=>'Ο','ð›±'=>'Π','ð›²'=>'Ρ','ð›³'=>'Θ','ð›´'=>'Σ','ð›µ'=>'Τ','ð›¶'=>'Î¥','ð›·'=>'Φ','ð›¸'=>'Χ','ð›¹'=>'Ψ','ð›º'=>'Ω','ð›»'=>'∇','ð›¼'=>'α','ð›½'=>'β','ð›¾'=>'γ','ð›¿'=>'δ','ðœ€'=>'ε','ðœ'=>'ζ','ðœ‚'=>'η','ðœƒ'=>'θ','ðœ„'=>'ι','ðœ…'=>'κ','ðœ†'=>'λ','ðœ‡'=>'μ','ðœˆ'=>'ν','ðœ‰'=>'ξ','ðœŠ'=>'ο','ðœ‹'=>'Ï€','ðœŒ'=>'Ï','ðœ'=>'Ï‚','ðœŽ'=>'σ','ðœ'=>'Ï„','ðœ'=>'Ï…','ðœ‘'=>'φ','ðœ’'=>'χ','ðœ“'=>'ψ','ðœ”'=>'ω','ðœ•'=>'∂','ðœ–'=>'ε','ðœ—'=>'θ','ðœ˜'=>'κ','ðœ™'=>'φ','ðœš'=>'Ï','ðœ›'=>'Ï€','ðœœ'=>'Α','ðœ'=>'Î’','ðœž'=>'Γ','ðœŸ'=>'Δ','ðœ '=>'Ε','ðœ¡'=>'Ζ','ðœ¢'=>'Η','ðœ£'=>'Θ','ðœ¤'=>'Ι','ðœ¥'=>'Κ','ðœ¦'=>'Λ','ðœ§'=>'Îœ','ðœ¨'=>'Î','ðœ©'=>'Ξ','ðœª'=>'Ο','ðœ«'=>'Π','ðœ¬'=>'Ρ','ðœ­'=>'Θ','ðœ®'=>'Σ','ðœ¯'=>'Τ','ðœ°'=>'Î¥','ðœ±'=>'Φ','ðœ²'=>'Χ','ðœ³'=>'Ψ','ðœ´'=>'Ω','ðœµ'=>'∇','ðœ¶'=>'α','ðœ·'=>'β','ðœ¸'=>'γ','ðœ¹'=>'δ','ðœº'=>'ε','ðœ»'=>'ζ','ðœ¼'=>'η','ðœ½'=>'θ','ðœ¾'=>'ι','ðœ¿'=>'κ','ð€'=>'λ','ð'=>'μ','ð‚'=>'ν','ðƒ'=>'ξ','ð„'=>'ο','ð…'=>'Ï€','ð†'=>'Ï','ð‡'=>'Ï‚','ðˆ'=>'σ','ð‰'=>'Ï„','ðŠ'=>'Ï…','ð‹'=>'φ','ðŒ'=>'χ','ð'=>'ψ','ðŽ'=>'ω','ð'=>'∂','ð'=>'ε','ð‘'=>'θ','ð’'=>'κ','ð“'=>'φ','ð”'=>'Ï','ð•'=>'Ï€','ð–'=>'Α','ð—'=>'Î’','ð˜'=>'Γ','ð™'=>'Δ','ðš'=>'Ε','ð›'=>'Ζ','ðœ'=>'Η','ð'=>'Θ','ðž'=>'Ι','ðŸ'=>'Κ','ð '=>'Λ','ð¡'=>'Îœ','ð¢'=>'Î','ð£'=>'Ξ','ð¤'=>'Ο','ð¥'=>'Π','ð¦'=>'Ρ','ð§'=>'Θ','ð¨'=>'Σ','ð©'=>'Τ','ðª'=>'Î¥','ð«'=>'Φ','ð¬'=>'Χ','ð­'=>'Ψ','ð®'=>'Ω','ð¯'=>'∇','ð°'=>'α','ð±'=>'β','ð²'=>'γ','ð³'=>'δ','ð´'=>'ε','ðµ'=>'ζ','ð¶'=>'η','ð·'=>'θ','ð¸'=>'ι','ð¹'=>'κ','ðº'=>'λ','ð»'=>'μ','ð¼'=>'ν','ð½'=>'ξ','ð¾'=>'ο','ð¿'=>'Ï€','ðž€'=>'Ï','ðž'=>'Ï‚','ðž‚'=>'σ','ðžƒ'=>'Ï„','ðž„'=>'Ï…','ðž…'=>'φ','ðž†'=>'χ','ðž‡'=>'ψ','ðžˆ'=>'ω','ðž‰'=>'∂','ðžŠ'=>'ε','ðž‹'=>'θ','ðžŒ'=>'κ','ðž'=>'φ','ðžŽ'=>'Ï','ðž'=>'Ï€','ðž'=>'Α','ðž‘'=>'Î’','ðž’'=>'Γ','ðž“'=>'Δ','ðž”'=>'Ε','ðž•'=>'Ζ','ðž–'=>'Η','ðž—'=>'Θ','ðž˜'=>'Ι','ðž™'=>'Κ','ðžš'=>'Λ','ðž›'=>'Îœ','ðžœ'=>'Î','ðž'=>'Ξ','ðžž'=>'Ο','ðžŸ'=>'Π','ðž '=>'Ρ','ðž¡'=>'Θ','ðž¢'=>'Σ','ðž£'=>'Τ','ðž¤'=>'Î¥','ðž¥'=>'Φ','ðž¦'=>'Χ','ðž§'=>'Ψ','ðž¨'=>'Ω','ðž©'=>'∇','ðžª'=>'α','ðž«'=>'β','ðž¬'=>'γ','ðž­'=>'δ','ðž®'=>'ε','ðž¯'=>'ζ','ðž°'=>'η','ðž±'=>'θ','ðž²'=>'ι','ðž³'=>'κ','ðž´'=>'λ','ðžµ'=>'μ','ðž¶'=>'ν','ðž·'=>'ξ','ðž¸'=>'ο','ðž¹'=>'Ï€','ðžº'=>'Ï','ðž»'=>'Ï‚','ðž¼'=>'σ','ðž½'=>'Ï„','ðž¾'=>'Ï…','ðž¿'=>'φ','ðŸ€'=>'χ','ðŸ'=>'ψ','ðŸ‚'=>'ω','ðŸƒ'=>'∂','ðŸ„'=>'ε','ðŸ…'=>'θ','ðŸ†'=>'κ','ðŸ‡'=>'φ','ðŸˆ'=>'Ï','ðŸ‰'=>'Ï€','ðŸŠ'=>'Ïœ','ðŸ‹'=>'Ï','ðŸŽ'=>'0','ðŸ'=>'1','ðŸ'=>'2','ðŸ‘'=>'3','ðŸ’'=>'4','ðŸ“'=>'5','ðŸ”'=>'6','ðŸ•'=>'7','ðŸ–'=>'8','ðŸ—'=>'9','ðŸ˜'=>'0','ðŸ™'=>'1','ðŸš'=>'2','ðŸ›'=>'3','ðŸœ'=>'4','ðŸ'=>'5','ðŸž'=>'6','ðŸŸ'=>'7','ðŸ '=>'8','ðŸ¡'=>'9','ðŸ¢'=>'0','ðŸ£'=>'1','ðŸ¤'=>'2','ðŸ¥'=>'3','ðŸ¦'=>'4','ðŸ§'=>'5','ðŸ¨'=>'6','ðŸ©'=>'7','ðŸª'=>'8','ðŸ«'=>'9','ðŸ¬'=>'0','ðŸ­'=>'1','ðŸ®'=>'2','ðŸ¯'=>'3','ðŸ°'=>'4','ðŸ±'=>'5','ðŸ²'=>'6','ðŸ³'=>'7','ðŸ´'=>'8','ðŸµ'=>'9','ðŸ¶'=>'0','ðŸ·'=>'1','ðŸ¸'=>'2','ðŸ¹'=>'3','ðŸº'=>'4','ðŸ»'=>'5','ðŸ¼'=>'6','ðŸ½'=>'7','ðŸ¾'=>'8','ðŸ¿'=>'9','丽'=>'丽','ð¯ '=>'丸','乁'=>'ä¹','𠄢'=>'ð „¢','你'=>'ä½ ','侮'=>'ä¾®','侻'=>'ä¾»','倂'=>'倂','偺'=>'åº','備'=>'å‚™','僧'=>'僧','像'=>'åƒ','㒞'=>'ã’ž','ð¯ '=>'𠘺','免'=>'å…','ð¯ '=>'å…”','ð¯ '=>'å…¤','具'=>'å…·','𠔜'=>'𠔜','㒹'=>'ã’¹','內'=>'å…§','再'=>'å†','𠕋'=>'ð •‹','冗'=>'冗','冤'=>'冤','仌'=>'仌','冬'=>'冬','况'=>'况','𩇟'=>'𩇟','ð¯ '=>'凵','刃'=>'刃','㓟'=>'ã“Ÿ','刻'=>'刻','剆'=>'剆','割'=>'割','剷'=>'剷','㔕'=>'㔕','勇'=>'勇','勉'=>'勉','勤'=>'勤','勺'=>'勺','包'=>'包','匆'=>'匆','北'=>'北','卉'=>'å‰','卑'=>'å‘','博'=>'åš','即'=>'å³','卽'=>'å½','卿'=>'å¿','卿'=>'å¿','卿'=>'å¿','𠨬'=>'𠨬','灰'=>'ç°','及'=>'åŠ','叟'=>'åŸ','𠭣'=>'ð ­£','叫'=>'å«','叱'=>'å±','吆'=>'å†','咞'=>'å’ž','吸'=>'å¸','呈'=>'呈','周'=>'周','咢'=>'å’¢','ð¯¡'=>'哶','唐'=>'å”','啓'=>'å•“','啣'=>'å•£','善'=>'å–„','善'=>'å–„','喙'=>'å–™','喫'=>'å–«','喳'=>'å–³','嗂'=>'å—‚','圖'=>'圖','嘆'=>'嘆','ð¯¡'=>'圗','噑'=>'噑','ð¯¡'=>'å™´','ð¯¡'=>'切','壮'=>'壮','城'=>'城','埴'=>'埴','堍'=>'å ','型'=>'åž‹','堲'=>'å ²','報'=>'å ±','墬'=>'墬','𡓤'=>'𡓤','売'=>'売','壷'=>'壷','夆'=>'夆','ð¯¡'=>'多','夢'=>'夢','奢'=>'奢','𡚨'=>'𡚨','𡛪'=>'𡛪','姬'=>'姬','娛'=>'娛','娧'=>'娧','姘'=>'姘','婦'=>'婦','㛮'=>'ã›®','㛼'=>'㛼','嬈'=>'嬈','嬾'=>'嬾','嬾'=>'嬾','𡧈'=>'𡧈','寃'=>'寃','寘'=>'寘','寧'=>'寧','寳'=>'寳','𡬘'=>'𡬘','寿'=>'寿','将'=>'å°†','当'=>'当','尢'=>'å°¢','㞁'=>'ãž','屠'=>'å± ','屮'=>'å±®','峀'=>'å³€','岍'=>'å²','𡷤'=>'ð¡·¤','嵃'=>'嵃','𡷦'=>'ð¡·¦','嵮'=>'åµ®','嵫'=>'嵫','嵼'=>'åµ¼','ð¯¢'=>'å·¡','巢'=>'å·¢','㠯'=>'ã ¯','巽'=>'å·½','帨'=>'帨','帽'=>'帽','幩'=>'幩','㡢'=>'ã¡¢','𢆃'=>'𢆃','㡼'=>'㡼','庰'=>'庰','庳'=>'庳','ð¯¢'=>'庶','廊'=>'廊','ð¯¢'=>'𪎒','ð¯¢'=>'廾','𢌱'=>'𢌱','𢌱'=>'𢌱','舁'=>'èˆ','弢'=>'å¼¢','弢'=>'å¼¢','㣇'=>'㣇','𣊸'=>'𣊸','𦇚'=>'𦇚','形'=>'å½¢','彫'=>'彫','㣣'=>'㣣','徚'=>'徚','ð¯¢'=>'å¿','志'=>'å¿—','忹'=>'忹','悁'=>'æ‚','㤺'=>'㤺','㤜'=>'㤜','悔'=>'æ‚”','𢛔'=>'𢛔','惇'=>'惇','慈'=>'æ…ˆ','慌'=>'æ…Œ','慎'=>'æ…Ž','慌'=>'æ…Œ','慺'=>'æ…º','憎'=>'憎','憲'=>'憲','憤'=>'憤','憯'=>'憯','懞'=>'懞','懲'=>'懲','懶'=>'懶','成'=>'æˆ','戛'=>'戛','扝'=>'æ‰','抱'=>'抱','拔'=>'æ‹”','捐'=>'æ','𢬌'=>'𢬌','挽'=>'挽','拼'=>'拼','捨'=>'æ¨','掃'=>'掃','揤'=>'æ¤','𢯱'=>'𢯱','搢'=>'æ¢','揅'=>'æ…','ð¯£'=>'掩','㨮'=>'㨮','摩'=>'æ‘©','摾'=>'摾','撝'=>'æ’','摷'=>'æ‘·','㩬'=>'㩬','敏'=>'æ•','敬'=>'敬','𣀊'=>'𣀊','旣'=>'æ—£','書'=>'書','ð¯£'=>'晉','㬙'=>'㬙','ð¯£'=>'æš‘','ð¯£'=>'㬈','㫤'=>'㫤','冒'=>'冒','冕'=>'冕','最'=>'最','暜'=>'æšœ','肭'=>'è‚­','䏙'=>'ä™','朗'=>'朗','望'=>'望','朡'=>'朡','杞'=>'æž','杓'=>'æ“','ð¯£'=>'ð£ƒ','㭉'=>'ã­‰','柺'=>'柺','枅'=>'æž…','桒'=>'æ¡’','梅'=>'梅','𣑭'=>'𣑭','梎'=>'梎','栟'=>'æ Ÿ','椔'=>'椔','㮝'=>'ã®','楂'=>'楂','榣'=>'榣','槪'=>'槪','檨'=>'檨','𣚣'=>'𣚣','櫛'=>'æ«›','㰘'=>'ã°˜','次'=>'次','𣢧'=>'𣢧','歔'=>'æ­”','㱎'=>'㱎','歲'=>'æ­²','殟'=>'殟','殺'=>'殺','殻'=>'æ®»','𣪍'=>'ð£ª','𡴋'=>'ð¡´‹','𣫺'=>'𣫺','汎'=>'汎','𣲼'=>'𣲼','沿'=>'沿','泍'=>'æ³','汧'=>'汧','洖'=>'æ´–','派'=>'æ´¾','ð¯¤'=>'æµ·','流'=>'æµ','浩'=>'浩','浸'=>'浸','涅'=>'涅','𣴞'=>'𣴞','洴'=>'æ´´','港'=>'港','湮'=>'æ¹®','㴳'=>'ã´³','滋'=>'滋','滇'=>'滇','ð¯¤'=>'𣻑','淹'=>'æ·¹','ð¯¤'=>'æ½®','ð¯¤'=>'𣽞','𣾎'=>'𣾎','濆'=>'濆','瀹'=>'瀹','瀞'=>'瀞','瀛'=>'瀛','㶖'=>'㶖','灊'=>'çŠ','災'=>'ç½','灷'=>'ç·','炭'=>'ç‚­','𠔥'=>'𠔥','煅'=>'ç……','ð¯¤'=>'𤉣','熜'=>'熜','𤎫'=>'𤎫','爨'=>'爨','爵'=>'爵','牐'=>'ç‰','𤘈'=>'𤘈','犀'=>'犀','犕'=>'犕','𤜵'=>'𤜵','𤠔'=>'𤠔','獺'=>'çº','王'=>'王','㺬'=>'㺬','玥'=>'玥','㺸'=>'㺸','㺸'=>'㺸','瑇'=>'瑇','瑜'=>'ç‘œ','瑱'=>'瑱','璅'=>'ç’…','瓊'=>'ç“Š','㼛'=>'ã¼›','甤'=>'甤','𤰶'=>'𤰶','甾'=>'甾','𤲒'=>'𤲒','異'=>'ç•°','𢆟'=>'𢆟','瘐'=>'ç˜','𤾡'=>'𤾡','𤾸'=>'𤾸','𥁄'=>'ð¥„','㿼'=>'㿼','䀈'=>'䀈','直'=>'ç›´','ð¯¥'=>'𥃳','𥃲'=>'𥃲','𥄙'=>'𥄙','𥄳'=>'𥄳','眞'=>'眞','真'=>'真','真'=>'真','睊'=>'çŠ','䀹'=>'䀹','瞋'=>'çž‹','䁆'=>'ä†','䂖'=>'ä‚–','ð¯¥'=>'ð¥','硎'=>'ç¡Ž','ð¯¥'=>'碌','ð¯¥'=>'磌','䃣'=>'䃣','𥘦'=>'𥘦','祖'=>'祖','𥚚'=>'𥚚','𥛅'=>'𥛅','福'=>'ç¦','秫'=>'秫','䄯'=>'䄯','穀'=>'ç©€','穊'=>'ç©Š','穏'=>'ç©','𥥼'=>'𥥼','ð¯¥'=>'𥪧','𥪧'=>'𥪧','竮'=>'ç«®','䈂'=>'䈂','𥮫'=>'𥮫','篆'=>'篆','築'=>'築','䈧'=>'䈧','𥲀'=>'𥲀','糒'=>'ç³’','䊠'=>'䊠','糨'=>'糨','糣'=>'ç³£','紀'=>'ç´€','𥾆'=>'𥾆','絣'=>'çµ£','䌁'=>'äŒ','緇'=>'ç·‡','縂'=>'縂','繅'=>'ç¹…','䌴'=>'䌴','𦈨'=>'𦈨','𦉇'=>'𦉇','䍙'=>'ä™','𦋙'=>'𦋙','罺'=>'罺','𦌾'=>'𦌾','羕'=>'羕','翺'=>'翺','者'=>'者','𦓚'=>'𦓚','𦔣'=>'𦔣','聠'=>'è ','𦖨'=>'𦖨','聰'=>'è°','𣍟'=>'ð£Ÿ','ð¯¦'=>'ä•','育'=>'育','脃'=>'脃','䐋'=>'ä‹','脾'=>'脾','媵'=>'媵','𦞧'=>'𦞧','𦞵'=>'𦞵','𣎓'=>'𣎓','𣎜'=>'𣎜','舁'=>'èˆ','舄'=>'舄','ð¯¦'=>'辞','䑫'=>'ä‘«','ð¯¦'=>'芑','ð¯¦'=>'芋','芝'=>'èŠ','劳'=>'劳','花'=>'花','芳'=>'芳','芽'=>'芽','苦'=>'苦','𦬼'=>'𦬼','若'=>'è‹¥','茝'=>'èŒ','荣'=>'è£','莭'=>'莭','茣'=>'茣','ð¯¦'=>'莽','菧'=>'è§','著'=>'è‘—','荓'=>'è“','菊'=>'èŠ','菌'=>'èŒ','菜'=>'èœ','𦰶'=>'𦰶','𦵫'=>'𦵫','𦳕'=>'𦳕','䔫'=>'䔫','蓱'=>'蓱','蓳'=>'蓳','蔖'=>'è”–','𧏊'=>'ð§Š','蕤'=>'蕤','𦼬'=>'𦼬','䕝'=>'ä•','䕡'=>'ä•¡','𦾱'=>'𦾱','𧃒'=>'𧃒','䕫'=>'ä•«','虐'=>'è™','虜'=>'虜','虧'=>'虧','虩'=>'虩','蚩'=>'èš©','蚈'=>'蚈','蜎'=>'蜎','蛢'=>'蛢','蝹'=>'è¹','蜨'=>'蜨','蝫'=>'è«','螆'=>'螆','䗗'=>'ä——','蟡'=>'蟡','ð¯§'=>'è ','䗹'=>'ä—¹','衠'=>'è¡ ','衣'=>'è¡£','𧙧'=>'𧙧','裗'=>'裗','裞'=>'裞','䘵'=>'䘵','裺'=>'裺','㒻'=>'ã’»','𧢮'=>'𧢮','𧥦'=>'𧥦','ð¯§'=>'äš¾','䛇'=>'䛇','ð¯§'=>'誠','ð¯§'=>'è«­','變'=>'變','豕'=>'豕','𧲨'=>'𧲨','貫'=>'貫','賁'=>'è³','贛'=>'è´›','起'=>'èµ·','𧼯'=>'𧼯','𠠄'=>'ð  „','跋'=>'è·‹','趼'=>'趼','跰'=>'è·°','ð¯§'=>'𠣞','軔'=>'è»”','輸'=>'輸','𨗒'=>'𨗒','𨗭'=>'𨗭','邔'=>'é‚”','郱'=>'郱','鄑'=>'é„‘','𨜮'=>'𨜮','鄛'=>'é„›','鈸'=>'鈸','鋗'=>'é‹—','鋘'=>'鋘','鉼'=>'鉼','鏹'=>'é¹','鐕'=>'é•','𨯺'=>'𨯺','開'=>'é–‹','䦕'=>'䦕','閷'=>'é–·','𨵷'=>'𨵷','䧦'=>'䧦','雃'=>'雃','嶲'=>'嶲','霣'=>'霣','𩅅'=>'ð©……','𩈚'=>'𩈚','䩮'=>'ä©®','䩶'=>'䩶','韠'=>'韠','𩐊'=>'ð©Š','䪲'=>'䪲','𩒖'=>'ð©’–','頋'=>'é ‹','頋'=>'é ‹','頩'=>'é ©','ð¯¨'=>'ð©–¶','飢'=>'飢','䬳'=>'䬳','餩'=>'餩','馧'=>'馧','駂'=>'駂','駾'=>'駾','䯎'=>'䯎','𩬰'=>'𩬰','鬒'=>'鬒','鱀'=>'é±€','鳽'=>'é³½','ð¯¨'=>'䳎','䳭'=>'ä³­','ð¯¨'=>'鵧','ð¯¨'=>'𪃎','䳸'=>'䳸','𪄅'=>'𪄅','𪈎'=>'𪈎','𪊑'=>'𪊑','麻'=>'麻','䵖'=>'äµ–','黹'=>'黹','黾'=>'黾','鼅'=>'é¼…','鼏'=>'é¼','鼖'=>'é¼–','鼻'=>'é¼»','ð¯¨'=>'𪘀');
diff --git a/phpBB/includes/utf/data/utf_nfc_qc.php b/phpBB/includes/utf/data/utf_nfc_qc.php
deleted file mode 100644
index ff56357ea6..0000000000
--- a/phpBB/includes/utf/data/utf_nfc_qc.php
+++ /dev/null
@@ -1,2 +0,0 @@
-<?php
-$GLOBALS['utf_nfc_qc']=array('Í€'=>1,'Í'=>1,'̓'=>1,'Í„'=>1,'Í´'=>1,';'=>1,'·'=>1,'क़'=>1,'ख़'=>1,'ग़'=>1,'ज़'=>1,'ड़'=>1,'à¥'=>1,'फ़'=>1,'य़'=>1,'ড়'=>1,'à§'=>1,'য়'=>1,'ਲ਼'=>1,'ਸ਼'=>1,'à©™'=>1,'à©š'=>1,'à©›'=>1,'à©ž'=>1,'à­œ'=>1,'à­'=>1,'གྷ'=>1,'à½'=>1,'དྷ'=>1,'བྷ'=>1,'ཛྷ'=>1,'ཀྵ'=>1,'ཱི'=>1,'ཱུ'=>1,'ྲྀ'=>1,'ླྀ'=>1,'à¾'=>1,'ྒྷ'=>1,'à¾'=>1,'ྡྷ'=>1,'ྦྷ'=>1,'ྫྷ'=>1,'ྐྵ'=>1,'á½±'=>1,'á½³'=>1,'á½µ'=>1,'á½·'=>1,'á½¹'=>1,'á½»'=>1,'á½½'=>1,'á¾»'=>1,'á¾¾'=>1,'Έ'=>1,'á¿‹'=>1,'á¿“'=>1,'á¿›'=>1,'á¿£'=>1,'á¿«'=>1,'á¿®'=>1,'`'=>1,'Ό'=>1,'á¿»'=>1,'´'=>1,' '=>1,'â€'=>1,'Ω'=>1,'K'=>1,'â„«'=>1,'〈'=>1,'〉'=>1,'â«œ'=>1,'豈'=>1,'ï¤'=>1,'車'=>1,'賈'=>1,'滑'=>1,'串'=>1,'句'=>1,'龜'=>1,'龜'=>1,'契'=>1,'金'=>1,'喇'=>1,'奈'=>1,'ï¤'=>1,'癩'=>1,'ï¤'=>1,'ï¤'=>1,'螺'=>1,'裸'=>1,'邏'=>1,'樂'=>1,'洛'=>1,'烙'=>1,'珞'=>1,'落'=>1,'酪'=>1,'駱'=>1,'亂'=>1,'卵'=>1,'ï¤'=>1,'爛'=>1,'蘭'=>1,'鸞'=>1,'嵐'=>1,'濫'=>1,'藍'=>1,'襤'=>1,'拉'=>1,'臘'=>1,'蠟'=>1,'廊'=>1,'朗'=>1,'浪'=>1,'狼'=>1,'郎'=>1,'來'=>1,'冷'=>1,'勞'=>1,'擄'=>1,'櫓'=>1,'爐'=>1,'盧'=>1,'老'=>1,'蘆'=>1,'虜'=>1,'路'=>1,'露'=>1,'魯'=>1,'鷺'=>1,'碌'=>1,'祿'=>1,'綠'=>1,'菉'=>1,'錄'=>1,'鹿'=>1,'ï¥'=>1,'壟'=>1,'弄'=>1,'籠'=>1,'聾'=>1,'牢'=>1,'磊'=>1,'賂'=>1,'雷'=>1,'壘'=>1,'屢'=>1,'樓'=>1,'ï¥'=>1,'漏'=>1,'ï¥'=>1,'ï¥'=>1,'陋'=>1,'勒'=>1,'肋'=>1,'凜'=>1,'凌'=>1,'稜'=>1,'綾'=>1,'菱'=>1,'陵'=>1,'讀'=>1,'拏'=>1,'樂'=>1,'ï¥'=>1,'丹'=>1,'寧'=>1,'怒'=>1,'率'=>1,'異'=>1,'北'=>1,'磻'=>1,'便'=>1,'復'=>1,'不'=>1,'泌'=>1,'數'=>1,'索'=>1,'參'=>1,'塞'=>1,'省'=>1,'葉'=>1,'說'=>1,'殺'=>1,'辰'=>1,'沈'=>1,'拾'=>1,'若'=>1,'掠'=>1,'略'=>1,'亮'=>1,'兩'=>1,'凉'=>1,'梁'=>1,'糧'=>1,'良'=>1,'諒'=>1,'量'=>1,'勵'=>1,'呂'=>1,'ï¦'=>1,'廬'=>1,'旅'=>1,'濾'=>1,'礪'=>1,'閭'=>1,'驪'=>1,'麗'=>1,'黎'=>1,'力'=>1,'曆'=>1,'歷'=>1,'ï¦'=>1,'年'=>1,'ï¦'=>1,'ï¦'=>1,'撚'=>1,'漣'=>1,'煉'=>1,'璉'=>1,'秊'=>1,'練'=>1,'聯'=>1,'輦'=>1,'蓮'=>1,'連'=>1,'鍊'=>1,'列'=>1,'ï¦'=>1,'咽'=>1,'烈'=>1,'裂'=>1,'說'=>1,'廉'=>1,'念'=>1,'捻'=>1,'殮'=>1,'簾'=>1,'獵'=>1,'令'=>1,'囹'=>1,'寧'=>1,'嶺'=>1,'怜'=>1,'玲'=>1,'瑩'=>1,'羚'=>1,'聆'=>1,'鈴'=>1,'零'=>1,'靈'=>1,'領'=>1,'例'=>1,'禮'=>1,'醴'=>1,'隸'=>1,'惡'=>1,'了'=>1,'僚'=>1,'寮'=>1,'尿'=>1,'料'=>1,'樂'=>1,'燎'=>1,'ï§'=>1,'蓼'=>1,'遼'=>1,'龍'=>1,'暈'=>1,'阮'=>1,'劉'=>1,'杻'=>1,'柳'=>1,'流'=>1,'溜'=>1,'琉'=>1,'ï§'=>1,'硫'=>1,'ï§'=>1,'ï§'=>1,'六'=>1,'戮'=>1,'陸'=>1,'倫'=>1,'崙'=>1,'淪'=>1,'輪'=>1,'律'=>1,'慄'=>1,'栗'=>1,'率'=>1,'隆'=>1,'ï§'=>1,'吏'=>1,'履'=>1,'易'=>1,'李'=>1,'梨'=>1,'泥'=>1,'理'=>1,'痢'=>1,'罹'=>1,'裏'=>1,'裡'=>1,'里'=>1,'離'=>1,'匿'=>1,'溺'=>1,'吝'=>1,'燐'=>1,'璘'=>1,'藺'=>1,'隣'=>1,'鱗'=>1,'麟'=>1,'林'=>1,'淋'=>1,'臨'=>1,'立'=>1,'笠'=>1,'粒'=>1,'狀'=>1,'炙'=>1,'識'=>1,'什'=>1,'茶'=>1,'刺'=>1,'切'=>1,'ï¨'=>1,'拓'=>1,'糖'=>1,'宅'=>1,'洞'=>1,'暴'=>1,'輻'=>1,'行'=>1,'降'=>1,'見'=>1,'廓'=>1,'兀'=>1,'ï¨'=>1,'ï¨'=>1,'晴'=>1,'凞'=>1,'猪'=>1,'益'=>1,'礼'=>1,'神'=>1,'祥'=>1,'福'=>1,'靖'=>1,'ï¨'=>1,'羽'=>1,'蘒'=>1,'諸'=>1,'逸'=>1,'都'=>1,'飯'=>1,'飼'=>1,'館'=>1,'鶴'=>1,'侮'=>1,'僧'=>1,'免'=>1,'勉'=>1,'勤'=>1,'卑'=>1,'喝'=>1,'嘆'=>1,'器'=>1,'塀'=>1,'墨'=>1,'層'=>1,'屮'=>1,'悔'=>1,'慨'=>1,'憎'=>1,'ï©€'=>1,'ï©'=>1,'ï©‚'=>1,'暑'=>1,'ï©„'=>1,'ï©…'=>1,'渚'=>1,'漢'=>1,'煮'=>1,'爫'=>1,'ï©Š'=>1,'ï©‹'=>1,'ï©Œ'=>1,'ï©'=>1,'ï©Ž'=>1,'ï©'=>1,'ï©'=>1,'ï©‘'=>1,'ï©’'=>1,'ï©“'=>1,'ï©”'=>1,'ï©•'=>1,'ï©–'=>1,'ï©—'=>1,'縉'=>1,'ï©™'=>1,'ï©š'=>1,'ï©›'=>1,'ï©œ'=>1,'ï©'=>1,'ï©ž'=>1,'ï©Ÿ'=>1,'ï© '=>1,'ï©¡'=>1,'ï©¢'=>1,'ï©£'=>1,'賓'=>1,'ï©¥'=>1,'辶'=>1,'逸'=>1,'難'=>1,'ï©©'=>1,'頻'=>1,'ï©°'=>1,'况'=>1,'全'=>1,'侀'=>1,'ï©´'=>1,'冀'=>1,'勇'=>1,'ï©·'=>1,'喝'=>1,'啕'=>1,'喙'=>1,'ï©»'=>1,'塚'=>1,'墳'=>1,'奄'=>1,'ï©¿'=>1,'婢'=>1,'ïª'=>1,'廒'=>1,'廙'=>1,'彩'=>1,'徭'=>1,'惘'=>1,'慎'=>1,'愈'=>1,'憎'=>1,'慠'=>1,'懲'=>1,'戴'=>1,'ïª'=>1,'搜'=>1,'ïª'=>1,'ïª'=>1,'晴'=>1,'朗'=>1,'望'=>1,'杖'=>1,'歹'=>1,'殺'=>1,'流'=>1,'滛'=>1,'滋'=>1,'漢'=>1,'瀞'=>1,'煮'=>1,'ïª'=>1,'爵'=>1,'犯'=>1,'猪'=>1,'瑱'=>1,'甆'=>1,'画'=>1,'瘝'=>1,'瘟'=>1,'益'=>1,'盛'=>1,'直'=>1,'睊'=>1,'着'=>1,'磌'=>1,'窱'=>1,'節'=>1,'类'=>1,'絛'=>1,'練'=>1,'缾'=>1,'者'=>1,'荒'=>1,'華'=>1,'蝹'=>1,'襁'=>1,'覆'=>1,'視'=>1,'調'=>1,'諸'=>1,'請'=>1,'謁'=>1,'諾'=>1,'諭'=>1,'謹'=>1,'ï«€'=>1,'ï«'=>1,'ï«‚'=>1,'遲'=>1,'ï«„'=>1,'ï«…'=>1,'陼'=>1,'難'=>1,'靖'=>1,'韛'=>1,'ï«Š'=>1,'ï«‹'=>1,'ï«Œ'=>1,'ï«'=>1,'ï«Ž'=>1,'ï«'=>1,'ï«'=>1,'ï«‘'=>1,'ï«’'=>1,'ï«“'=>1,'ï«”'=>1,'ï«•'=>1,'ï«–'=>1,'ï«—'=>1,'齃'=>1,'ï«™'=>1,'ï¬'=>1,'ײַ'=>1,'שׁ'=>1,'שׂ'=>1,'שּׁ'=>1,'שּׂ'=>1,'אַ'=>1,'אָ'=>1,'אּ'=>1,'בּ'=>1,'גּ'=>1,'דּ'=>1,'הּ'=>1,'וּ'=>1,'זּ'=>1,'טּ'=>1,'יּ'=>1,'ךּ'=>1,'כּ'=>1,'לּ'=>1,'מּ'=>1,'ï­€'=>1,'ï­'=>1,'ï­ƒ'=>1,'ï­„'=>1,'ï­†'=>1,'ï­‡'=>1,'ï­ˆ'=>1,'ï­‰'=>1,'ï­Š'=>1,'ï­‹'=>1,'ï­Œ'=>1,'ï­'=>1,'ï­Ž'=>1,'ð…ž'=>1,'ð…Ÿ'=>1,'ð… '=>1,'ð…¡'=>1,'ð…¢'=>1,'ð…£'=>1,'ð…¤'=>1,'ð†»'=>1,'ð†¼'=>1,'ð†½'=>1,'ð†¾'=>1,'ð†¿'=>1,'ð‡€'=>1,'丽'=>1,'ð¯ '=>1,'乁'=>1,'𠄢'=>1,'你'=>1,'侮'=>1,'侻'=>1,'倂'=>1,'偺'=>1,'備'=>1,'僧'=>1,'像'=>1,'㒞'=>1,'ð¯ '=>1,'免'=>1,'ð¯ '=>1,'ð¯ '=>1,'具'=>1,'𠔜'=>1,'㒹'=>1,'內'=>1,'再'=>1,'𠕋'=>1,'冗'=>1,'冤'=>1,'仌'=>1,'冬'=>1,'况'=>1,'𩇟'=>1,'ð¯ '=>1,'刃'=>1,'㓟'=>1,'刻'=>1,'剆'=>1,'割'=>1,'剷'=>1,'㔕'=>1,'勇'=>1,'勉'=>1,'勤'=>1,'勺'=>1,'包'=>1,'匆'=>1,'北'=>1,'卉'=>1,'卑'=>1,'博'=>1,'即'=>1,'卽'=>1,'卿'=>1,'卿'=>1,'卿'=>1,'𠨬'=>1,'灰'=>1,'及'=>1,'叟'=>1,'𠭣'=>1,'叫'=>1,'叱'=>1,'吆'=>1,'咞'=>1,'吸'=>1,'呈'=>1,'周'=>1,'咢'=>1,'ð¯¡'=>1,'唐'=>1,'啓'=>1,'啣'=>1,'善'=>1,'善'=>1,'喙'=>1,'喫'=>1,'喳'=>1,'嗂'=>1,'圖'=>1,'嘆'=>1,'ð¯¡'=>1,'噑'=>1,'ð¯¡'=>1,'ð¯¡'=>1,'壮'=>1,'城'=>1,'埴'=>1,'堍'=>1,'型'=>1,'堲'=>1,'報'=>1,'墬'=>1,'𡓤'=>1,'売'=>1,'壷'=>1,'夆'=>1,'ð¯¡'=>1,'夢'=>1,'奢'=>1,'𡚨'=>1,'𡛪'=>1,'姬'=>1,'娛'=>1,'娧'=>1,'姘'=>1,'婦'=>1,'㛮'=>1,'㛼'=>1,'嬈'=>1,'嬾'=>1,'嬾'=>1,'𡧈'=>1,'寃'=>1,'寘'=>1,'寧'=>1,'寳'=>1,'𡬘'=>1,'寿'=>1,'将'=>1,'当'=>1,'尢'=>1,'㞁'=>1,'屠'=>1,'屮'=>1,'峀'=>1,'岍'=>1,'𡷤'=>1,'嵃'=>1,'𡷦'=>1,'嵮'=>1,'嵫'=>1,'嵼'=>1,'ð¯¢'=>1,'巢'=>1,'㠯'=>1,'巽'=>1,'帨'=>1,'帽'=>1,'幩'=>1,'㡢'=>1,'𢆃'=>1,'㡼'=>1,'庰'=>1,'庳'=>1,'ð¯¢'=>1,'廊'=>1,'ð¯¢'=>1,'ð¯¢'=>1,'𢌱'=>1,'𢌱'=>1,'舁'=>1,'弢'=>1,'弢'=>1,'㣇'=>1,'𣊸'=>1,'𦇚'=>1,'形'=>1,'彫'=>1,'㣣'=>1,'徚'=>1,'ð¯¢'=>1,'志'=>1,'忹'=>1,'悁'=>1,'㤺'=>1,'㤜'=>1,'悔'=>1,'𢛔'=>1,'惇'=>1,'慈'=>1,'慌'=>1,'慎'=>1,'慌'=>1,'慺'=>1,'憎'=>1,'憲'=>1,'憤'=>1,'憯'=>1,'懞'=>1,'懲'=>1,'懶'=>1,'成'=>1,'戛'=>1,'扝'=>1,'抱'=>1,'拔'=>1,'捐'=>1,'𢬌'=>1,'挽'=>1,'拼'=>1,'捨'=>1,'掃'=>1,'揤'=>1,'𢯱'=>1,'搢'=>1,'揅'=>1,'ð¯£'=>1,'㨮'=>1,'摩'=>1,'摾'=>1,'撝'=>1,'摷'=>1,'㩬'=>1,'敏'=>1,'敬'=>1,'𣀊'=>1,'旣'=>1,'書'=>1,'ð¯£'=>1,'㬙'=>1,'ð¯£'=>1,'ð¯£'=>1,'㫤'=>1,'冒'=>1,'冕'=>1,'最'=>1,'暜'=>1,'肭'=>1,'䏙'=>1,'朗'=>1,'望'=>1,'朡'=>1,'杞'=>1,'杓'=>1,'ð¯£'=>1,'㭉'=>1,'柺'=>1,'枅'=>1,'桒'=>1,'梅'=>1,'𣑭'=>1,'梎'=>1,'栟'=>1,'椔'=>1,'㮝'=>1,'楂'=>1,'榣'=>1,'槪'=>1,'檨'=>1,'𣚣'=>1,'櫛'=>1,'㰘'=>1,'次'=>1,'𣢧'=>1,'歔'=>1,'㱎'=>1,'歲'=>1,'殟'=>1,'殺'=>1,'殻'=>1,'𣪍'=>1,'𡴋'=>1,'𣫺'=>1,'汎'=>1,'𣲼'=>1,'沿'=>1,'泍'=>1,'汧'=>1,'洖'=>1,'派'=>1,'ð¯¤'=>1,'流'=>1,'浩'=>1,'浸'=>1,'涅'=>1,'𣴞'=>1,'洴'=>1,'港'=>1,'湮'=>1,'㴳'=>1,'滋'=>1,'滇'=>1,'ð¯¤'=>1,'淹'=>1,'ð¯¤'=>1,'ð¯¤'=>1,'𣾎'=>1,'濆'=>1,'瀹'=>1,'瀞'=>1,'瀛'=>1,'㶖'=>1,'灊'=>1,'災'=>1,'灷'=>1,'炭'=>1,'𠔥'=>1,'煅'=>1,'ð¯¤'=>1,'熜'=>1,'𤎫'=>1,'爨'=>1,'爵'=>1,'牐'=>1,'𤘈'=>1,'犀'=>1,'犕'=>1,'𤜵'=>1,'𤠔'=>1,'獺'=>1,'王'=>1,'㺬'=>1,'玥'=>1,'㺸'=>1,'㺸'=>1,'瑇'=>1,'瑜'=>1,'瑱'=>1,'璅'=>1,'瓊'=>1,'㼛'=>1,'甤'=>1,'𤰶'=>1,'甾'=>1,'𤲒'=>1,'異'=>1,'𢆟'=>1,'瘐'=>1,'𤾡'=>1,'𤾸'=>1,'𥁄'=>1,'㿼'=>1,'䀈'=>1,'直'=>1,'ð¯¥'=>1,'𥃲'=>1,'𥄙'=>1,'𥄳'=>1,'眞'=>1,'真'=>1,'真'=>1,'睊'=>1,'䀹'=>1,'瞋'=>1,'䁆'=>1,'䂖'=>1,'ð¯¥'=>1,'硎'=>1,'ð¯¥'=>1,'ð¯¥'=>1,'䃣'=>1,'𥘦'=>1,'祖'=>1,'𥚚'=>1,'𥛅'=>1,'福'=>1,'秫'=>1,'䄯'=>1,'穀'=>1,'穊'=>1,'穏'=>1,'𥥼'=>1,'ð¯¥'=>1,'𥪧'=>1,'竮'=>1,'䈂'=>1,'𥮫'=>1,'篆'=>1,'築'=>1,'䈧'=>1,'𥲀'=>1,'糒'=>1,'䊠'=>1,'糨'=>1,'糣'=>1,'紀'=>1,'𥾆'=>1,'絣'=>1,'䌁'=>1,'緇'=>1,'縂'=>1,'繅'=>1,'䌴'=>1,'𦈨'=>1,'𦉇'=>1,'䍙'=>1,'𦋙'=>1,'罺'=>1,'𦌾'=>1,'羕'=>1,'翺'=>1,'者'=>1,'𦓚'=>1,'𦔣'=>1,'聠'=>1,'𦖨'=>1,'聰'=>1,'𣍟'=>1,'ð¯¦'=>1,'育'=>1,'脃'=>1,'䐋'=>1,'脾'=>1,'媵'=>1,'𦞧'=>1,'𦞵'=>1,'𣎓'=>1,'𣎜'=>1,'舁'=>1,'舄'=>1,'ð¯¦'=>1,'䑫'=>1,'ð¯¦'=>1,'ð¯¦'=>1,'芝'=>1,'劳'=>1,'花'=>1,'芳'=>1,'芽'=>1,'苦'=>1,'𦬼'=>1,'若'=>1,'茝'=>1,'荣'=>1,'莭'=>1,'茣'=>1,'ð¯¦'=>1,'菧'=>1,'著'=>1,'荓'=>1,'菊'=>1,'菌'=>1,'菜'=>1,'𦰶'=>1,'𦵫'=>1,'𦳕'=>1,'䔫'=>1,'蓱'=>1,'蓳'=>1,'蔖'=>1,'𧏊'=>1,'蕤'=>1,'𦼬'=>1,'䕝'=>1,'䕡'=>1,'𦾱'=>1,'𧃒'=>1,'䕫'=>1,'虐'=>1,'虜'=>1,'虧'=>1,'虩'=>1,'蚩'=>1,'蚈'=>1,'蜎'=>1,'蛢'=>1,'蝹'=>1,'蜨'=>1,'蝫'=>1,'螆'=>1,'䗗'=>1,'蟡'=>1,'ð¯§'=>1,'䗹'=>1,'衠'=>1,'衣'=>1,'𧙧'=>1,'裗'=>1,'裞'=>1,'䘵'=>1,'裺'=>1,'㒻'=>1,'𧢮'=>1,'𧥦'=>1,'ð¯§'=>1,'䛇'=>1,'ð¯§'=>1,'ð¯§'=>1,'變'=>1,'豕'=>1,'𧲨'=>1,'貫'=>1,'賁'=>1,'贛'=>1,'起'=>1,'𧼯'=>1,'𠠄'=>1,'跋'=>1,'趼'=>1,'跰'=>1,'ð¯§'=>1,'軔'=>1,'輸'=>1,'𨗒'=>1,'𨗭'=>1,'邔'=>1,'郱'=>1,'鄑'=>1,'𨜮'=>1,'鄛'=>1,'鈸'=>1,'鋗'=>1,'鋘'=>1,'鉼'=>1,'鏹'=>1,'鐕'=>1,'𨯺'=>1,'開'=>1,'䦕'=>1,'閷'=>1,'𨵷'=>1,'䧦'=>1,'雃'=>1,'嶲'=>1,'霣'=>1,'𩅅'=>1,'𩈚'=>1,'䩮'=>1,'䩶'=>1,'韠'=>1,'𩐊'=>1,'䪲'=>1,'𩒖'=>1,'頋'=>1,'頋'=>1,'頩'=>1,'ð¯¨'=>1,'飢'=>1,'䬳'=>1,'餩'=>1,'馧'=>1,'駂'=>1,'駾'=>1,'䯎'=>1,'𩬰'=>1,'鬒'=>1,'鱀'=>1,'鳽'=>1,'ð¯¨'=>1,'䳭'=>1,'ð¯¨'=>1,'ð¯¨'=>1,'䳸'=>1,'𪄅'=>1,'𪈎'=>1,'𪊑'=>1,'麻'=>1,'䵖'=>1,'黹'=>1,'黾'=>1,'鼅'=>1,'鼏'=>1,'鼖'=>1,'鼻'=>1,'ð¯¨'=>1,'Ì€'=>0,'Ì'=>0,'Ì‚'=>0,'̃'=>0,'Ì„'=>0,'̆'=>0,'̇'=>0,'̈'=>0,'̉'=>0,'ÌŠ'=>0,'Ì‹'=>0,'ÌŒ'=>0,'Ì'=>0,'Ì‘'=>0,'Ì“'=>0,'Ì”'=>0,'Ì›'=>0,'Ì£'=>0,'̤'=>0,'Ì¥'=>0,'̦'=>0,'̧'=>0,'̨'=>0,'Ì­'=>0,'Ì®'=>0,'Ì°'=>0,'̱'=>0,'̸'=>0,'Í‚'=>0,'Í…'=>0,'Ù“'=>0,'Ù”'=>0,'Ù•'=>0,'़'=>0,'া'=>0,'ৗ'=>0,'ା'=>0,'à­–'=>0,'à­—'=>0,'ா'=>0,'ௗ'=>0,'à±–'=>0,'ೂ'=>0,'ೕ'=>0,'à³–'=>0,'à´¾'=>0,'ൗ'=>0,'à·Š'=>0,'à·'=>0,'à·Ÿ'=>0,'ီ'=>0,'á…¡'=>0,'á…¢'=>0,'á…£'=>0,'á…¤'=>0,'á…¥'=>0,'á…¦'=>0,'á…§'=>0,'á…¨'=>0,'á…©'=>0,'á…ª'=>0,'á…«'=>0,'á…¬'=>0,'á…­'=>0,'á…®'=>0,'á…¯'=>0,'á…°'=>0,'á…±'=>0,'á…²'=>0,'á…³'=>0,'á…´'=>0,'á…µ'=>0,'ᆨ'=>0,'ᆩ'=>0,'ᆪ'=>0,'ᆫ'=>0,'ᆬ'=>0,'ᆭ'=>0,'ᆮ'=>0,'ᆯ'=>0,'ᆰ'=>0,'ᆱ'=>0,'ᆲ'=>0,'ᆳ'=>0,'ᆴ'=>0,'ᆵ'=>0,'ᆶ'=>0,'ᆷ'=>0,'ᆸ'=>0,'ᆹ'=>0,'ᆺ'=>0,'ᆻ'=>0,'ᆼ'=>0,'ᆽ'=>0,'ᆾ'=>0,'ᆿ'=>0,'ᇀ'=>0,'á‡'=>0,'ᇂ'=>0,'ᬵ'=>0,'ã‚™'=>0,'ã‚š'=>0);
diff --git a/phpBB/includes/utf/data/utf_nfkc_qc.php b/phpBB/includes/utf/data/utf_nfkc_qc.php
deleted file mode 100644
index 181a07b351..0000000000
--- a/phpBB/includes/utf/data/utf_nfkc_qc.php
+++ /dev/null
@@ -1,2 +0,0 @@
-<?php
-$GLOBALS['utf_nfkc_qc']=array(' '=>1,'¨'=>1,'ª'=>1,'¯'=>1,'²'=>1,'³'=>1,'´'=>1,'µ'=>1,'¸'=>1,'¹'=>1,'º'=>1,'¼'=>1,'½'=>1,'¾'=>1,'IJ'=>1,'ij'=>1,'Ä¿'=>1,'Å€'=>1,'ʼn'=>1,'Å¿'=>1,'Ç„'=>1,'Ç…'=>1,'dž'=>1,'LJ'=>1,'Lj'=>1,'lj'=>1,'ÇŠ'=>1,'Ç‹'=>1,'ÇŒ'=>1,'DZ'=>1,'Dz'=>1,'dz'=>1,'Ê°'=>1,'ʱ'=>1,'ʲ'=>1,'ʳ'=>1,'Ê´'=>1,'ʵ'=>1,'ʶ'=>1,'Ê·'=>1,'ʸ'=>1,'˘'=>1,'Ë™'=>1,'Ëš'=>1,'Ë›'=>1,'Ëœ'=>1,'Ë'=>1,'Ë '=>1,'Ë¡'=>1,'Ë¢'=>1,'Ë£'=>1,'ˤ'=>1,'Í€'=>1,'Í'=>1,'̓'=>1,'Í„'=>1,'Í´'=>1,'ͺ'=>1,';'=>1,'΄'=>1,'Î…'=>1,'·'=>1,'Ï'=>1,'Ï‘'=>1,'Ï’'=>1,'Ï“'=>1,'Ï”'=>1,'Ï•'=>1,'Ï–'=>1,'Ï°'=>1,'ϱ'=>1,'ϲ'=>1,'Ï´'=>1,'ϵ'=>1,'Ϲ'=>1,'Ö‡'=>1,'Ùµ'=>1,'Ù¶'=>1,'Ù·'=>1,'Ù¸'=>1,'क़'=>1,'ख़'=>1,'ग़'=>1,'ज़'=>1,'ड़'=>1,'à¥'=>1,'फ़'=>1,'य़'=>1,'ড়'=>1,'à§'=>1,'য়'=>1,'ਲ਼'=>1,'ਸ਼'=>1,'à©™'=>1,'à©š'=>1,'à©›'=>1,'à©ž'=>1,'à­œ'=>1,'à­'=>1,'ำ'=>1,'ຳ'=>1,'ໜ'=>1,'à»'=>1,'༌'=>1,'གྷ'=>1,'à½'=>1,'དྷ'=>1,'བྷ'=>1,'ཛྷ'=>1,'ཀྵ'=>1,'ཱི'=>1,'ཱུ'=>1,'ྲྀ'=>1,'ཷ'=>1,'ླྀ'=>1,'ཹ'=>1,'à¾'=>1,'ྒྷ'=>1,'à¾'=>1,'ྡྷ'=>1,'ྦྷ'=>1,'ྫྷ'=>1,'ྐྵ'=>1,'ჼ'=>1,'á´¬'=>1,'á´­'=>1,'á´®'=>1,'á´°'=>1,'á´±'=>1,'á´²'=>1,'á´³'=>1,'á´´'=>1,'á´µ'=>1,'á´¶'=>1,'á´·'=>1,'á´¸'=>1,'á´¹'=>1,'á´º'=>1,'á´¼'=>1,'á´½'=>1,'á´¾'=>1,'á´¿'=>1,'áµ€'=>1,'áµ'=>1,'ᵂ'=>1,'ᵃ'=>1,'ᵄ'=>1,'áµ…'=>1,'ᵆ'=>1,'ᵇ'=>1,'ᵈ'=>1,'ᵉ'=>1,'ᵊ'=>1,'ᵋ'=>1,'ᵌ'=>1,'áµ'=>1,'áµ'=>1,'áµ'=>1,'ᵑ'=>1,'áµ’'=>1,'ᵓ'=>1,'áµ”'=>1,'ᵕ'=>1,'áµ–'=>1,'áµ—'=>1,'ᵘ'=>1,'áµ™'=>1,'ᵚ'=>1,'áµ›'=>1,'ᵜ'=>1,'áµ'=>1,'ᵞ'=>1,'ᵟ'=>1,'áµ '=>1,'ᵡ'=>1,'áµ¢'=>1,'áµ£'=>1,'ᵤ'=>1,'áµ¥'=>1,'ᵦ'=>1,'ᵧ'=>1,'ᵨ'=>1,'ᵩ'=>1,'ᵪ'=>1,'ᵸ'=>1,'ᶛ'=>1,'ᶜ'=>1,'á¶'=>1,'ᶞ'=>1,'ᶟ'=>1,'ᶠ'=>1,'ᶡ'=>1,'ᶢ'=>1,'ᶣ'=>1,'ᶤ'=>1,'ᶥ'=>1,'ᶦ'=>1,'ᶧ'=>1,'ᶨ'=>1,'ᶩ'=>1,'ᶪ'=>1,'ᶫ'=>1,'ᶬ'=>1,'ᶭ'=>1,'ᶮ'=>1,'ᶯ'=>1,'ᶰ'=>1,'ᶱ'=>1,'ᶲ'=>1,'ᶳ'=>1,'ᶴ'=>1,'ᶵ'=>1,'ᶶ'=>1,'ᶷ'=>1,'ᶸ'=>1,'ᶹ'=>1,'ᶺ'=>1,'ᶻ'=>1,'ᶼ'=>1,'ᶽ'=>1,'ᶾ'=>1,'ᶿ'=>1,'ẚ'=>1,'ẛ'=>1,'á½±'=>1,'á½³'=>1,'á½µ'=>1,'á½·'=>1,'á½¹'=>1,'á½»'=>1,'á½½'=>1,'á¾»'=>1,'á¾½'=>1,'á¾¾'=>1,'᾿'=>1,'á¿€'=>1,'á¿'=>1,'Έ'=>1,'á¿‹'=>1,'á¿'=>1,'á¿Ž'=>1,'á¿'=>1,'á¿“'=>1,'á¿›'=>1,'á¿'=>1,'á¿ž'=>1,'á¿Ÿ'=>1,'á¿£'=>1,'á¿«'=>1,'á¿­'=>1,'á¿®'=>1,'`'=>1,'Ό'=>1,'á¿»'=>1,'´'=>1,'῾'=>1,' '=>1,'â€'=>1,' '=>1,' '=>1,' '=>1,' '=>1,' '=>1,' '=>1,' '=>1,' '=>1,' '=>1,'‑'=>1,'‗'=>1,'․'=>1,'‥'=>1,'…'=>1,' '=>1,'″'=>1,'‴'=>1,'‶'=>1,'‷'=>1,'‼'=>1,'‾'=>1,'â‡'=>1,'âˆ'=>1,'â‰'=>1,'â—'=>1,'âŸ'=>1,'â°'=>1,'â±'=>1,'â´'=>1,'âµ'=>1,'â¶'=>1,'â·'=>1,'â¸'=>1,'â¹'=>1,'âº'=>1,'â»'=>1,'â¼'=>1,'â½'=>1,'â¾'=>1,'â¿'=>1,'â‚€'=>1,'â‚'=>1,'â‚‚'=>1,'₃'=>1,'â‚„'=>1,'â‚…'=>1,'₆'=>1,'₇'=>1,'₈'=>1,'₉'=>1,'â‚Š'=>1,'â‚‹'=>1,'â‚Œ'=>1,'â‚'=>1,'â‚Ž'=>1,'â‚'=>1,'â‚‘'=>1,'â‚’'=>1,'â‚“'=>1,'â‚”'=>1,'₨'=>1,'â„€'=>1,'â„'=>1,'â„‚'=>1,'℃'=>1,'â„…'=>1,'℆'=>1,'ℇ'=>1,'℉'=>1,'â„Š'=>1,'â„‹'=>1,'â„Œ'=>1,'â„'=>1,'â„Ž'=>1,'â„'=>1,'â„'=>1,'â„‘'=>1,'â„’'=>1,'â„“'=>1,'â„•'=>1,'â„–'=>1,'â„™'=>1,'â„š'=>1,'â„›'=>1,'â„œ'=>1,'â„'=>1,'â„ '=>1,'â„¡'=>1,'â„¢'=>1,'ℤ'=>1,'Ω'=>1,'ℨ'=>1,'K'=>1,'â„«'=>1,'ℬ'=>1,'â„­'=>1,'ℯ'=>1,'â„°'=>1,'ℱ'=>1,'ℳ'=>1,'â„´'=>1,'ℵ'=>1,'ℶ'=>1,'â„·'=>1,'ℸ'=>1,'ℹ'=>1,'â„»'=>1,'ℼ'=>1,'ℽ'=>1,'ℾ'=>1,'â„¿'=>1,'â…€'=>1,'â……'=>1,'â…†'=>1,'â…‡'=>1,'â…ˆ'=>1,'â…‰'=>1,'â…“'=>1,'â…”'=>1,'â…•'=>1,'â…–'=>1,'â…—'=>1,'â…˜'=>1,'â…™'=>1,'â…š'=>1,'â…›'=>1,'â…œ'=>1,'â…'=>1,'â…ž'=>1,'â…Ÿ'=>1,'â… '=>1,'â…¡'=>1,'â…¢'=>1,'â…£'=>1,'â…¤'=>1,'â…¥'=>1,'â…¦'=>1,'â…§'=>1,'â…¨'=>1,'â…©'=>1,'â…ª'=>1,'â…«'=>1,'â…¬'=>1,'â…­'=>1,'â…®'=>1,'â…¯'=>1,'â…°'=>1,'â…±'=>1,'â…²'=>1,'â…³'=>1,'â…´'=>1,'â…µ'=>1,'â…¶'=>1,'â…·'=>1,'â…¸'=>1,'â…¹'=>1,'â…º'=>1,'â…»'=>1,'â…¼'=>1,'â…½'=>1,'â…¾'=>1,'â…¿'=>1,'∬'=>1,'∭'=>1,'∯'=>1,'∰'=>1,'〈'=>1,'〉'=>1,'â‘ '=>1,'â‘¡'=>1,'â‘¢'=>1,'â‘£'=>1,'⑤'=>1,'â‘¥'=>1,'⑦'=>1,'⑧'=>1,'⑨'=>1,'â‘©'=>1,'⑪'=>1,'â‘«'=>1,'⑬'=>1,'â‘­'=>1,'â‘®'=>1,'⑯'=>1,'â‘°'=>1,'⑱'=>1,'⑲'=>1,'⑳'=>1,'â‘´'=>1,'⑵'=>1,'⑶'=>1,'â‘·'=>1,'⑸'=>1,'⑹'=>1,'⑺'=>1,'â‘»'=>1,'⑼'=>1,'⑽'=>1,'⑾'=>1,'â‘¿'=>1,'â’€'=>1,'â’'=>1,'â’‚'=>1,'â’ƒ'=>1,'â’„'=>1,'â’…'=>1,'â’†'=>1,'â’‡'=>1,'â’ˆ'=>1,'â’‰'=>1,'â’Š'=>1,'â’‹'=>1,'â’Œ'=>1,'â’'=>1,'â’Ž'=>1,'â’'=>1,'â’'=>1,'â’‘'=>1,'â’’'=>1,'â’“'=>1,'â’”'=>1,'â’•'=>1,'â’–'=>1,'â’—'=>1,'â’˜'=>1,'â’™'=>1,'â’š'=>1,'â’›'=>1,'â’œ'=>1,'â’'=>1,'â’ž'=>1,'â’Ÿ'=>1,'â’ '=>1,'â’¡'=>1,'â’¢'=>1,'â’£'=>1,'â’¤'=>1,'â’¥'=>1,'â’¦'=>1,'â’§'=>1,'â’¨'=>1,'â’©'=>1,'â’ª'=>1,'â’«'=>1,'â’¬'=>1,'â’­'=>1,'â’®'=>1,'â’¯'=>1,'â’°'=>1,'â’±'=>1,'â’²'=>1,'â’³'=>1,'â’´'=>1,'â’µ'=>1,'â’¶'=>1,'â’·'=>1,'â’¸'=>1,'â’¹'=>1,'â’º'=>1,'â’»'=>1,'â’¼'=>1,'â’½'=>1,'â’¾'=>1,'â’¿'=>1,'â“€'=>1,'â“'=>1,'â“‚'=>1,'Ⓝ'=>1,'â“„'=>1,'â“…'=>1,'Ⓠ'=>1,'Ⓡ'=>1,'Ⓢ'=>1,'Ⓣ'=>1,'â“Š'=>1,'â“‹'=>1,'â“Œ'=>1,'â“'=>1,'â“Ž'=>1,'â“'=>1,'â“'=>1,'â“‘'=>1,'â“’'=>1,'â““'=>1,'â“”'=>1,'â“•'=>1,'â“–'=>1,'â“—'=>1,'ⓘ'=>1,'â“™'=>1,'â“š'=>1,'â“›'=>1,'â“œ'=>1,'â“'=>1,'â“ž'=>1,'â“Ÿ'=>1,'â“ '=>1,'â“¡'=>1,'â“¢'=>1,'â“£'=>1,'ⓤ'=>1,'â“¥'=>1,'ⓦ'=>1,'ⓧ'=>1,'ⓨ'=>1,'â“©'=>1,'⓪'=>1,'⨌'=>1,'â©´'=>1,'⩵'=>1,'⩶'=>1,'â«œ'=>1,'ⵯ'=>1,'⺟'=>1,'⻳'=>1,'â¼€'=>1,'â¼'=>1,'⼂'=>1,'⼃'=>1,'⼄'=>1,'â¼…'=>1,'⼆'=>1,'⼇'=>1,'⼈'=>1,'⼉'=>1,'⼊'=>1,'⼋'=>1,'⼌'=>1,'â¼'=>1,'⼎'=>1,'â¼'=>1,'â¼'=>1,'⼑'=>1,'â¼’'=>1,'⼓'=>1,'â¼”'=>1,'⼕'=>1,'â¼–'=>1,'â¼—'=>1,'⼘'=>1,'â¼™'=>1,'⼚'=>1,'â¼›'=>1,'⼜'=>1,'â¼'=>1,'⼞'=>1,'⼟'=>1,'â¼ '=>1,'⼡'=>1,'â¼¢'=>1,'â¼£'=>1,'⼤'=>1,'â¼¥'=>1,'⼦'=>1,'⼧'=>1,'⼨'=>1,'⼩'=>1,'⼪'=>1,'⼫'=>1,'⼬'=>1,'â¼­'=>1,'â¼®'=>1,'⼯'=>1,'â¼°'=>1,'â¼±'=>1,'â¼²'=>1,'â¼³'=>1,'â¼´'=>1,'â¼µ'=>1,'⼶'=>1,'â¼·'=>1,'⼸'=>1,'â¼¹'=>1,'⼺'=>1,'â¼»'=>1,'â¼¼'=>1,'â¼½'=>1,'â¼¾'=>1,'⼿'=>1,'â½€'=>1,'â½'=>1,'⽂'=>1,'⽃'=>1,'⽄'=>1,'â½…'=>1,'⽆'=>1,'⽇'=>1,'⽈'=>1,'⽉'=>1,'⽊'=>1,'⽋'=>1,'⽌'=>1,'â½'=>1,'⽎'=>1,'â½'=>1,'â½'=>1,'⽑'=>1,'â½’'=>1,'⽓'=>1,'â½”'=>1,'⽕'=>1,'â½–'=>1,'â½—'=>1,'⽘'=>1,'â½™'=>1,'⽚'=>1,'â½›'=>1,'⽜'=>1,'â½'=>1,'⽞'=>1,'⽟'=>1,'â½ '=>1,'⽡'=>1,'â½¢'=>1,'â½£'=>1,'⽤'=>1,'â½¥'=>1,'⽦'=>1,'⽧'=>1,'⽨'=>1,'⽩'=>1,'⽪'=>1,'⽫'=>1,'⽬'=>1,'â½­'=>1,'â½®'=>1,'⽯'=>1,'â½°'=>1,'â½±'=>1,'â½²'=>1,'â½³'=>1,'â½´'=>1,'â½µ'=>1,'⽶'=>1,'â½·'=>1,'⽸'=>1,'â½¹'=>1,'⽺'=>1,'â½»'=>1,'â½¼'=>1,'â½½'=>1,'â½¾'=>1,'⽿'=>1,'â¾€'=>1,'â¾'=>1,'⾂'=>1,'⾃'=>1,'⾄'=>1,'â¾…'=>1,'⾆'=>1,'⾇'=>1,'⾈'=>1,'⾉'=>1,'⾊'=>1,'⾋'=>1,'⾌'=>1,'â¾'=>1,'⾎'=>1,'â¾'=>1,'â¾'=>1,'⾑'=>1,'â¾’'=>1,'⾓'=>1,'â¾”'=>1,'⾕'=>1,'â¾–'=>1,'â¾—'=>1,'⾘'=>1,'â¾™'=>1,'⾚'=>1,'â¾›'=>1,'⾜'=>1,'â¾'=>1,'⾞'=>1,'⾟'=>1,'â¾ '=>1,'⾡'=>1,'â¾¢'=>1,'â¾£'=>1,'⾤'=>1,'â¾¥'=>1,'⾦'=>1,'⾧'=>1,'⾨'=>1,'⾩'=>1,'⾪'=>1,'⾫'=>1,'⾬'=>1,'â¾­'=>1,'â¾®'=>1,'⾯'=>1,'â¾°'=>1,'â¾±'=>1,'â¾²'=>1,'â¾³'=>1,'â¾´'=>1,'â¾µ'=>1,'⾶'=>1,'â¾·'=>1,'⾸'=>1,'â¾¹'=>1,'⾺'=>1,'â¾»'=>1,'â¾¼'=>1,'â¾½'=>1,'â¾¾'=>1,'⾿'=>1,'â¿€'=>1,'â¿'=>1,'â¿‚'=>1,'⿃'=>1,'â¿„'=>1,'â¿…'=>1,'⿆'=>1,'⿇'=>1,'⿈'=>1,'⿉'=>1,'â¿Š'=>1,'â¿‹'=>1,'â¿Œ'=>1,'â¿'=>1,'â¿Ž'=>1,'â¿'=>1,'â¿'=>1,'â¿‘'=>1,'â¿’'=>1,'â¿“'=>1,'â¿”'=>1,'â¿•'=>1,' '=>1,'〶'=>1,'〸'=>1,'〹'=>1,'〺'=>1,'ã‚›'=>1,'ã‚œ'=>1,'ã‚Ÿ'=>1,'ヿ'=>1,'ㄱ'=>1,'ㄲ'=>1,'ㄳ'=>1,'ã„´'=>1,'ㄵ'=>1,'ㄶ'=>1,'ã„·'=>1,'ㄸ'=>1,'ㄹ'=>1,'ㄺ'=>1,'ã„»'=>1,'ㄼ'=>1,'ㄽ'=>1,'ㄾ'=>1,'ã„¿'=>1,'ã…€'=>1,'ã…'=>1,'ã…‚'=>1,'ã…ƒ'=>1,'ã…„'=>1,'ã……'=>1,'ã…†'=>1,'ã…‡'=>1,'ã…ˆ'=>1,'ã…‰'=>1,'ã…Š'=>1,'ã…‹'=>1,'ã…Œ'=>1,'ã…'=>1,'ã…Ž'=>1,'ã…'=>1,'ã…'=>1,'ã…‘'=>1,'ã…’'=>1,'ã…“'=>1,'ã…”'=>1,'ã…•'=>1,'ã…–'=>1,'ã…—'=>1,'ã…˜'=>1,'ã…™'=>1,'ã…š'=>1,'ã…›'=>1,'ã…œ'=>1,'ã…'=>1,'ã…ž'=>1,'ã…Ÿ'=>1,'ã… '=>1,'ã…¡'=>1,'ã…¢'=>1,'ã…£'=>1,'ã…¤'=>1,'ã…¥'=>1,'ã…¦'=>1,'ã…§'=>1,'ã…¨'=>1,'ã…©'=>1,'ã…ª'=>1,'ã…«'=>1,'ã…¬'=>1,'ã…­'=>1,'ã…®'=>1,'ã…¯'=>1,'ã…°'=>1,'ã…±'=>1,'ã…²'=>1,'ã…³'=>1,'ã…´'=>1,'ã…µ'=>1,'ã…¶'=>1,'ã…·'=>1,'ã…¸'=>1,'ã…¹'=>1,'ã…º'=>1,'ã…»'=>1,'ã…¼'=>1,'ã…½'=>1,'ã…¾'=>1,'ã…¿'=>1,'ㆀ'=>1,'ã†'=>1,'ㆂ'=>1,'ㆃ'=>1,'ㆄ'=>1,'ㆅ'=>1,'ㆆ'=>1,'ㆇ'=>1,'ㆈ'=>1,'ㆉ'=>1,'ㆊ'=>1,'ㆋ'=>1,'ㆌ'=>1,'ã†'=>1,'ㆎ'=>1,'㆒'=>1,'㆓'=>1,'㆔'=>1,'㆕'=>1,'㆖'=>1,'㆗'=>1,'㆘'=>1,'㆙'=>1,'㆚'=>1,'㆛'=>1,'㆜'=>1,'ã†'=>1,'㆞'=>1,'㆟'=>1,'㈀'=>1,'ãˆ'=>1,'㈂'=>1,'㈃'=>1,'㈄'=>1,'㈅'=>1,'㈆'=>1,'㈇'=>1,'㈈'=>1,'㈉'=>1,'㈊'=>1,'㈋'=>1,'㈌'=>1,'ãˆ'=>1,'㈎'=>1,'ãˆ'=>1,'ãˆ'=>1,'㈑'=>1,'㈒'=>1,'㈓'=>1,'㈔'=>1,'㈕'=>1,'㈖'=>1,'㈗'=>1,'㈘'=>1,'㈙'=>1,'㈚'=>1,'㈛'=>1,'㈜'=>1,'ãˆ'=>1,'㈞'=>1,'㈠'=>1,'㈡'=>1,'㈢'=>1,'㈣'=>1,'㈤'=>1,'㈥'=>1,'㈦'=>1,'㈧'=>1,'㈨'=>1,'㈩'=>1,'㈪'=>1,'㈫'=>1,'㈬'=>1,'㈭'=>1,'㈮'=>1,'㈯'=>1,'㈰'=>1,'㈱'=>1,'㈲'=>1,'㈳'=>1,'㈴'=>1,'㈵'=>1,'㈶'=>1,'㈷'=>1,'㈸'=>1,'㈹'=>1,'㈺'=>1,'㈻'=>1,'㈼'=>1,'㈽'=>1,'㈾'=>1,'㈿'=>1,'㉀'=>1,'ã‰'=>1,'㉂'=>1,'㉃'=>1,'ã‰'=>1,'㉑'=>1,'㉒'=>1,'㉓'=>1,'㉔'=>1,'㉕'=>1,'㉖'=>1,'㉗'=>1,'㉘'=>1,'㉙'=>1,'㉚'=>1,'㉛'=>1,'㉜'=>1,'ã‰'=>1,'㉞'=>1,'㉟'=>1,'㉠'=>1,'㉡'=>1,'㉢'=>1,'㉣'=>1,'㉤'=>1,'㉥'=>1,'㉦'=>1,'㉧'=>1,'㉨'=>1,'㉩'=>1,'㉪'=>1,'㉫'=>1,'㉬'=>1,'㉭'=>1,'㉮'=>1,'㉯'=>1,'㉰'=>1,'㉱'=>1,'㉲'=>1,'㉳'=>1,'㉴'=>1,'㉵'=>1,'㉶'=>1,'㉷'=>1,'㉸'=>1,'㉹'=>1,'㉺'=>1,'㉻'=>1,'㉼'=>1,'㉽'=>1,'㉾'=>1,'㊀'=>1,'ãŠ'=>1,'㊂'=>1,'㊃'=>1,'㊄'=>1,'㊅'=>1,'㊆'=>1,'㊇'=>1,'㊈'=>1,'㊉'=>1,'㊊'=>1,'㊋'=>1,'㊌'=>1,'ãŠ'=>1,'㊎'=>1,'ãŠ'=>1,'ãŠ'=>1,'㊑'=>1,'㊒'=>1,'㊓'=>1,'㊔'=>1,'㊕'=>1,'㊖'=>1,'㊗'=>1,'㊘'=>1,'㊙'=>1,'㊚'=>1,'㊛'=>1,'㊜'=>1,'ãŠ'=>1,'㊞'=>1,'㊟'=>1,'㊠'=>1,'㊡'=>1,'㊢'=>1,'㊣'=>1,'㊤'=>1,'㊥'=>1,'㊦'=>1,'㊧'=>1,'㊨'=>1,'㊩'=>1,'㊪'=>1,'㊫'=>1,'㊬'=>1,'㊭'=>1,'㊮'=>1,'㊯'=>1,'㊰'=>1,'㊱'=>1,'㊲'=>1,'㊳'=>1,'㊴'=>1,'㊵'=>1,'㊶'=>1,'㊷'=>1,'㊸'=>1,'㊹'=>1,'㊺'=>1,'㊻'=>1,'㊼'=>1,'㊽'=>1,'㊾'=>1,'㊿'=>1,'ã‹€'=>1,'ã‹'=>1,'ã‹‚'=>1,'㋃'=>1,'ã‹„'=>1,'ã‹…'=>1,'㋆'=>1,'㋇'=>1,'㋈'=>1,'㋉'=>1,'ã‹Š'=>1,'ã‹‹'=>1,'ã‹Œ'=>1,'ã‹'=>1,'ã‹Ž'=>1,'ã‹'=>1,'ã‹'=>1,'ã‹‘'=>1,'ã‹’'=>1,'ã‹“'=>1,'ã‹”'=>1,'ã‹•'=>1,'ã‹–'=>1,'ã‹—'=>1,'㋘'=>1,'ã‹™'=>1,'ã‹š'=>1,'ã‹›'=>1,'ã‹œ'=>1,'ã‹'=>1,'ã‹ž'=>1,'ã‹Ÿ'=>1,'ã‹ '=>1,'ã‹¡'=>1,'ã‹¢'=>1,'ã‹£'=>1,'㋤'=>1,'ã‹¥'=>1,'㋦'=>1,'㋧'=>1,'㋨'=>1,'ã‹©'=>1,'㋪'=>1,'ã‹«'=>1,'㋬'=>1,'ã‹­'=>1,'ã‹®'=>1,'㋯'=>1,'ã‹°'=>1,'㋱'=>1,'㋲'=>1,'㋳'=>1,'ã‹´'=>1,'㋵'=>1,'㋶'=>1,'ã‹·'=>1,'㋸'=>1,'㋹'=>1,'㋺'=>1,'ã‹»'=>1,'㋼'=>1,'㋽'=>1,'㋾'=>1,'㌀'=>1,'ãŒ'=>1,'㌂'=>1,'㌃'=>1,'㌄'=>1,'㌅'=>1,'㌆'=>1,'㌇'=>1,'㌈'=>1,'㌉'=>1,'㌊'=>1,'㌋'=>1,'㌌'=>1,'ãŒ'=>1,'㌎'=>1,'ãŒ'=>1,'ãŒ'=>1,'㌑'=>1,'㌒'=>1,'㌓'=>1,'㌔'=>1,'㌕'=>1,'㌖'=>1,'㌗'=>1,'㌘'=>1,'㌙'=>1,'㌚'=>1,'㌛'=>1,'㌜'=>1,'ãŒ'=>1,'㌞'=>1,'㌟'=>1,'㌠'=>1,'㌡'=>1,'㌢'=>1,'㌣'=>1,'㌤'=>1,'㌥'=>1,'㌦'=>1,'㌧'=>1,'㌨'=>1,'㌩'=>1,'㌪'=>1,'㌫'=>1,'㌬'=>1,'㌭'=>1,'㌮'=>1,'㌯'=>1,'㌰'=>1,'㌱'=>1,'㌲'=>1,'㌳'=>1,'㌴'=>1,'㌵'=>1,'㌶'=>1,'㌷'=>1,'㌸'=>1,'㌹'=>1,'㌺'=>1,'㌻'=>1,'㌼'=>1,'㌽'=>1,'㌾'=>1,'㌿'=>1,'ã€'=>1,'ã'=>1,'ã‚'=>1,'ãƒ'=>1,'ã„'=>1,'ã…'=>1,'ã†'=>1,'ã‡'=>1,'ãˆ'=>1,'ã‰'=>1,'ãŠ'=>1,'ã‹'=>1,'ãŒ'=>1,'ã'=>1,'ãŽ'=>1,'ã'=>1,'ã'=>1,'ã‘'=>1,'ã’'=>1,'ã“'=>1,'ã”'=>1,'ã•'=>1,'ã–'=>1,'ã—'=>1,'ã˜'=>1,'ã™'=>1,'ãš'=>1,'ã›'=>1,'ãœ'=>1,'ã'=>1,'ãž'=>1,'ãŸ'=>1,'ã '=>1,'ã¡'=>1,'ã¢'=>1,'ã£'=>1,'ã¤'=>1,'ã¥'=>1,'ã¦'=>1,'ã§'=>1,'ã¨'=>1,'ã©'=>1,'ãª'=>1,'ã«'=>1,'ã¬'=>1,'ã­'=>1,'ã®'=>1,'ã¯'=>1,'ã°'=>1,'ã±'=>1,'ã²'=>1,'ã³'=>1,'ã´'=>1,'ãµ'=>1,'ã¶'=>1,'ã·'=>1,'ã¸'=>1,'ã¹'=>1,'ãº'=>1,'ã»'=>1,'ã¼'=>1,'ã½'=>1,'ã¾'=>1,'ã¿'=>1,'㎀'=>1,'ãŽ'=>1,'㎂'=>1,'㎃'=>1,'㎄'=>1,'㎅'=>1,'㎆'=>1,'㎇'=>1,'㎈'=>1,'㎉'=>1,'㎊'=>1,'㎋'=>1,'㎌'=>1,'ãŽ'=>1,'㎎'=>1,'ãŽ'=>1,'ãŽ'=>1,'㎑'=>1,'㎒'=>1,'㎓'=>1,'㎔'=>1,'㎕'=>1,'㎖'=>1,'㎗'=>1,'㎘'=>1,'㎙'=>1,'㎚'=>1,'㎛'=>1,'㎜'=>1,'ãŽ'=>1,'㎞'=>1,'㎟'=>1,'㎠'=>1,'㎡'=>1,'㎢'=>1,'㎣'=>1,'㎤'=>1,'㎥'=>1,'㎦'=>1,'㎧'=>1,'㎨'=>1,'㎩'=>1,'㎪'=>1,'㎫'=>1,'㎬'=>1,'㎭'=>1,'㎮'=>1,'㎯'=>1,'㎰'=>1,'㎱'=>1,'㎲'=>1,'㎳'=>1,'㎴'=>1,'㎵'=>1,'㎶'=>1,'㎷'=>1,'㎸'=>1,'㎹'=>1,'㎺'=>1,'㎻'=>1,'㎼'=>1,'㎽'=>1,'㎾'=>1,'㎿'=>1,'ã€'=>1,'ã'=>1,'ã‚'=>1,'ãƒ'=>1,'ã„'=>1,'ã…'=>1,'ã†'=>1,'ã‡'=>1,'ãˆ'=>1,'ã‰'=>1,'ãŠ'=>1,'ã‹'=>1,'ãŒ'=>1,'ã'=>1,'ãŽ'=>1,'ã'=>1,'ã'=>1,'ã‘'=>1,'ã’'=>1,'ã“'=>1,'ã”'=>1,'ã•'=>1,'ã–'=>1,'ã—'=>1,'ã˜'=>1,'ã™'=>1,'ãš'=>1,'ã›'=>1,'ãœ'=>1,'ã'=>1,'ãž'=>1,'ãŸ'=>1,'ã '=>1,'ã¡'=>1,'ã¢'=>1,'ã£'=>1,'ã¤'=>1,'ã¥'=>1,'ã¦'=>1,'ã§'=>1,'ã¨'=>1,'ã©'=>1,'ãª'=>1,'ã«'=>1,'ã¬'=>1,'ã­'=>1,'ã®'=>1,'ã¯'=>1,'ã°'=>1,'ã±'=>1,'ã²'=>1,'ã³'=>1,'ã´'=>1,'ãµ'=>1,'ã¶'=>1,'ã·'=>1,'ã¸'=>1,'ã¹'=>1,'ãº'=>1,'ã»'=>1,'ã¼'=>1,'ã½'=>1,'ã¾'=>1,'ã¿'=>1,'豈'=>1,'ï¤'=>1,'車'=>1,'賈'=>1,'滑'=>1,'串'=>1,'句'=>1,'龜'=>1,'龜'=>1,'契'=>1,'金'=>1,'喇'=>1,'奈'=>1,'ï¤'=>1,'癩'=>1,'ï¤'=>1,'ï¤'=>1,'螺'=>1,'裸'=>1,'邏'=>1,'樂'=>1,'洛'=>1,'烙'=>1,'珞'=>1,'落'=>1,'酪'=>1,'駱'=>1,'亂'=>1,'卵'=>1,'ï¤'=>1,'爛'=>1,'蘭'=>1,'鸞'=>1,'嵐'=>1,'濫'=>1,'藍'=>1,'襤'=>1,'拉'=>1,'臘'=>1,'蠟'=>1,'廊'=>1,'朗'=>1,'浪'=>1,'狼'=>1,'郎'=>1,'來'=>1,'冷'=>1,'勞'=>1,'擄'=>1,'櫓'=>1,'爐'=>1,'盧'=>1,'老'=>1,'蘆'=>1,'虜'=>1,'路'=>1,'露'=>1,'魯'=>1,'鷺'=>1,'碌'=>1,'祿'=>1,'綠'=>1,'菉'=>1,'錄'=>1,'鹿'=>1,'ï¥'=>1,'壟'=>1,'弄'=>1,'籠'=>1,'聾'=>1,'牢'=>1,'磊'=>1,'賂'=>1,'雷'=>1,'壘'=>1,'屢'=>1,'樓'=>1,'ï¥'=>1,'漏'=>1,'ï¥'=>1,'ï¥'=>1,'陋'=>1,'勒'=>1,'肋'=>1,'凜'=>1,'凌'=>1,'稜'=>1,'綾'=>1,'菱'=>1,'陵'=>1,'讀'=>1,'拏'=>1,'樂'=>1,'ï¥'=>1,'丹'=>1,'寧'=>1,'怒'=>1,'率'=>1,'異'=>1,'北'=>1,'磻'=>1,'便'=>1,'復'=>1,'不'=>1,'泌'=>1,'數'=>1,'索'=>1,'參'=>1,'塞'=>1,'省'=>1,'葉'=>1,'說'=>1,'殺'=>1,'辰'=>1,'沈'=>1,'拾'=>1,'若'=>1,'掠'=>1,'略'=>1,'亮'=>1,'兩'=>1,'凉'=>1,'梁'=>1,'糧'=>1,'良'=>1,'諒'=>1,'量'=>1,'勵'=>1,'呂'=>1,'ï¦'=>1,'廬'=>1,'旅'=>1,'濾'=>1,'礪'=>1,'閭'=>1,'驪'=>1,'麗'=>1,'黎'=>1,'力'=>1,'曆'=>1,'歷'=>1,'ï¦'=>1,'年'=>1,'ï¦'=>1,'ï¦'=>1,'撚'=>1,'漣'=>1,'煉'=>1,'璉'=>1,'秊'=>1,'練'=>1,'聯'=>1,'輦'=>1,'蓮'=>1,'連'=>1,'鍊'=>1,'列'=>1,'ï¦'=>1,'咽'=>1,'烈'=>1,'裂'=>1,'說'=>1,'廉'=>1,'念'=>1,'捻'=>1,'殮'=>1,'簾'=>1,'獵'=>1,'令'=>1,'囹'=>1,'寧'=>1,'嶺'=>1,'怜'=>1,'玲'=>1,'瑩'=>1,'羚'=>1,'聆'=>1,'鈴'=>1,'零'=>1,'靈'=>1,'領'=>1,'例'=>1,'禮'=>1,'醴'=>1,'隸'=>1,'惡'=>1,'了'=>1,'僚'=>1,'寮'=>1,'尿'=>1,'料'=>1,'樂'=>1,'燎'=>1,'ï§'=>1,'蓼'=>1,'遼'=>1,'龍'=>1,'暈'=>1,'阮'=>1,'劉'=>1,'杻'=>1,'柳'=>1,'流'=>1,'溜'=>1,'琉'=>1,'ï§'=>1,'硫'=>1,'ï§'=>1,'ï§'=>1,'六'=>1,'戮'=>1,'陸'=>1,'倫'=>1,'崙'=>1,'淪'=>1,'輪'=>1,'律'=>1,'慄'=>1,'栗'=>1,'率'=>1,'隆'=>1,'ï§'=>1,'吏'=>1,'履'=>1,'易'=>1,'李'=>1,'梨'=>1,'泥'=>1,'理'=>1,'痢'=>1,'罹'=>1,'裏'=>1,'裡'=>1,'里'=>1,'離'=>1,'匿'=>1,'溺'=>1,'吝'=>1,'燐'=>1,'璘'=>1,'藺'=>1,'隣'=>1,'鱗'=>1,'麟'=>1,'林'=>1,'淋'=>1,'臨'=>1,'立'=>1,'笠'=>1,'粒'=>1,'狀'=>1,'炙'=>1,'識'=>1,'什'=>1,'茶'=>1,'刺'=>1,'切'=>1,'ï¨'=>1,'拓'=>1,'糖'=>1,'宅'=>1,'洞'=>1,'暴'=>1,'輻'=>1,'行'=>1,'降'=>1,'見'=>1,'廓'=>1,'兀'=>1,'ï¨'=>1,'ï¨'=>1,'晴'=>1,'凞'=>1,'猪'=>1,'益'=>1,'礼'=>1,'神'=>1,'祥'=>1,'福'=>1,'靖'=>1,'ï¨'=>1,'羽'=>1,'蘒'=>1,'諸'=>1,'逸'=>1,'都'=>1,'飯'=>1,'飼'=>1,'館'=>1,'鶴'=>1,'侮'=>1,'僧'=>1,'免'=>1,'勉'=>1,'勤'=>1,'卑'=>1,'喝'=>1,'嘆'=>1,'器'=>1,'塀'=>1,'墨'=>1,'層'=>1,'屮'=>1,'悔'=>1,'慨'=>1,'憎'=>1,'ï©€'=>1,'ï©'=>1,'ï©‚'=>1,'暑'=>1,'ï©„'=>1,'ï©…'=>1,'渚'=>1,'漢'=>1,'煮'=>1,'爫'=>1,'ï©Š'=>1,'ï©‹'=>1,'ï©Œ'=>1,'ï©'=>1,'ï©Ž'=>1,'ï©'=>1,'ï©'=>1,'ï©‘'=>1,'ï©’'=>1,'ï©“'=>1,'ï©”'=>1,'ï©•'=>1,'ï©–'=>1,'ï©—'=>1,'縉'=>1,'ï©™'=>1,'ï©š'=>1,'ï©›'=>1,'ï©œ'=>1,'ï©'=>1,'ï©ž'=>1,'ï©Ÿ'=>1,'ï© '=>1,'ï©¡'=>1,'ï©¢'=>1,'ï©£'=>1,'賓'=>1,'ï©¥'=>1,'辶'=>1,'逸'=>1,'難'=>1,'ï©©'=>1,'頻'=>1,'ï©°'=>1,'况'=>1,'全'=>1,'侀'=>1,'ï©´'=>1,'冀'=>1,'勇'=>1,'ï©·'=>1,'喝'=>1,'啕'=>1,'喙'=>1,'ï©»'=>1,'塚'=>1,'墳'=>1,'奄'=>1,'ï©¿'=>1,'婢'=>1,'ïª'=>1,'廒'=>1,'廙'=>1,'彩'=>1,'徭'=>1,'惘'=>1,'慎'=>1,'愈'=>1,'憎'=>1,'慠'=>1,'懲'=>1,'戴'=>1,'ïª'=>1,'搜'=>1,'ïª'=>1,'ïª'=>1,'晴'=>1,'朗'=>1,'望'=>1,'杖'=>1,'歹'=>1,'殺'=>1,'流'=>1,'滛'=>1,'滋'=>1,'漢'=>1,'瀞'=>1,'煮'=>1,'ïª'=>1,'爵'=>1,'犯'=>1,'猪'=>1,'瑱'=>1,'甆'=>1,'画'=>1,'瘝'=>1,'瘟'=>1,'益'=>1,'盛'=>1,'直'=>1,'睊'=>1,'着'=>1,'磌'=>1,'窱'=>1,'節'=>1,'类'=>1,'絛'=>1,'練'=>1,'缾'=>1,'者'=>1,'荒'=>1,'華'=>1,'蝹'=>1,'襁'=>1,'覆'=>1,'視'=>1,'調'=>1,'諸'=>1,'請'=>1,'謁'=>1,'諾'=>1,'諭'=>1,'謹'=>1,'ï«€'=>1,'ï«'=>1,'ï«‚'=>1,'遲'=>1,'ï«„'=>1,'ï«…'=>1,'陼'=>1,'難'=>1,'靖'=>1,'韛'=>1,'ï«Š'=>1,'ï«‹'=>1,'ï«Œ'=>1,'ï«'=>1,'ï«Ž'=>1,'ï«'=>1,'ï«'=>1,'ï«‘'=>1,'ï«’'=>1,'ï«“'=>1,'ï«”'=>1,'ï«•'=>1,'ï«–'=>1,'ï«—'=>1,'齃'=>1,'ï«™'=>1,'ff'=>1,'ï¬'=>1,'fl'=>1,'ffi'=>1,'ffl'=>1,'ſt'=>1,'st'=>1,'ﬓ'=>1,'ﬔ'=>1,'ﬕ'=>1,'ﬖ'=>1,'ﬗ'=>1,'ï¬'=>1,'ײַ'=>1,'ﬠ'=>1,'ﬡ'=>1,'ﬢ'=>1,'ﬣ'=>1,'ﬤ'=>1,'ﬥ'=>1,'ﬦ'=>1,'ﬧ'=>1,'ﬨ'=>1,'﬩'=>1,'שׁ'=>1,'שׂ'=>1,'שּׁ'=>1,'שּׂ'=>1,'אַ'=>1,'אָ'=>1,'אּ'=>1,'בּ'=>1,'גּ'=>1,'דּ'=>1,'הּ'=>1,'וּ'=>1,'זּ'=>1,'טּ'=>1,'יּ'=>1,'ךּ'=>1,'כּ'=>1,'לּ'=>1,'מּ'=>1,'ï­€'=>1,'ï­'=>1,'ï­ƒ'=>1,'ï­„'=>1,'ï­†'=>1,'ï­‡'=>1,'ï­ˆ'=>1,'ï­‰'=>1,'ï­Š'=>1,'ï­‹'=>1,'ï­Œ'=>1,'ï­'=>1,'ï­Ž'=>1,'ï­'=>1,'ï­'=>1,'ï­‘'=>1,'ï­’'=>1,'ï­“'=>1,'ï­”'=>1,'ï­•'=>1,'ï­–'=>1,'ï­—'=>1,'ï­˜'=>1,'ï­™'=>1,'ï­š'=>1,'ï­›'=>1,'ï­œ'=>1,'ï­'=>1,'ï­ž'=>1,'ï­Ÿ'=>1,'ï­ '=>1,'ï­¡'=>1,'ï­¢'=>1,'ï­£'=>1,'ï­¤'=>1,'ï­¥'=>1,'ï­¦'=>1,'ï­§'=>1,'ï­¨'=>1,'ï­©'=>1,'ï­ª'=>1,'ï­«'=>1,'ï­¬'=>1,'ï­­'=>1,'ï­®'=>1,'ï­¯'=>1,'ï­°'=>1,'ï­±'=>1,'ï­²'=>1,'ï­³'=>1,'ï­´'=>1,'ï­µ'=>1,'ï­¶'=>1,'ï­·'=>1,'ï­¸'=>1,'ï­¹'=>1,'ï­º'=>1,'ï­»'=>1,'ï­¼'=>1,'ï­½'=>1,'ï­¾'=>1,'ï­¿'=>1,'ﮀ'=>1,'ï®'=>1,'ﮂ'=>1,'ﮃ'=>1,'ﮄ'=>1,'ï®…'=>1,'ﮆ'=>1,'ﮇ'=>1,'ﮈ'=>1,'ﮉ'=>1,'ﮊ'=>1,'ﮋ'=>1,'ﮌ'=>1,'ï®'=>1,'ﮎ'=>1,'ï®'=>1,'ï®'=>1,'ﮑ'=>1,'ï®’'=>1,'ﮓ'=>1,'ï®”'=>1,'ﮕ'=>1,'ï®–'=>1,'ï®—'=>1,'ﮘ'=>1,'ï®™'=>1,'ﮚ'=>1,'ï®›'=>1,'ﮜ'=>1,'ï®'=>1,'ﮞ'=>1,'ﮟ'=>1,'ï® '=>1,'ﮡ'=>1,'ﮢ'=>1,'ﮣ'=>1,'ﮤ'=>1,'ﮥ'=>1,'ﮦ'=>1,'ﮧ'=>1,'ﮨ'=>1,'ﮩ'=>1,'ﮪ'=>1,'ﮫ'=>1,'ﮬ'=>1,'ï®­'=>1,'ï®®'=>1,'ﮯ'=>1,'ï®°'=>1,'ï®±'=>1,'ﯓ'=>1,'ﯔ'=>1,'ﯕ'=>1,'ﯖ'=>1,'ﯗ'=>1,'ﯘ'=>1,'ﯙ'=>1,'ﯚ'=>1,'ﯛ'=>1,'ﯜ'=>1,'ï¯'=>1,'ﯞ'=>1,'ﯟ'=>1,'ﯠ'=>1,'ﯡ'=>1,'ﯢ'=>1,'ﯣ'=>1,'ﯤ'=>1,'ﯥ'=>1,'ﯦ'=>1,'ﯧ'=>1,'ﯨ'=>1,'ﯩ'=>1,'ﯪ'=>1,'ﯫ'=>1,'ﯬ'=>1,'ﯭ'=>1,'ﯮ'=>1,'ﯯ'=>1,'ﯰ'=>1,'ﯱ'=>1,'ﯲ'=>1,'ﯳ'=>1,'ﯴ'=>1,'ﯵ'=>1,'ﯶ'=>1,'ﯷ'=>1,'ﯸ'=>1,'ﯹ'=>1,'ﯺ'=>1,'ﯻ'=>1,'ﯼ'=>1,'ﯽ'=>1,'ﯾ'=>1,'ﯿ'=>1,'ï°€'=>1,'ï°'=>1,'ï°‚'=>1,'ï°ƒ'=>1,'ï°„'=>1,'ï°…'=>1,'ï°†'=>1,'ï°‡'=>1,'ï°ˆ'=>1,'ï°‰'=>1,'ï°Š'=>1,'ï°‹'=>1,'ï°Œ'=>1,'ï°'=>1,'ï°Ž'=>1,'ï°'=>1,'ï°'=>1,'ï°‘'=>1,'ï°’'=>1,'ï°“'=>1,'ï°”'=>1,'ï°•'=>1,'ï°–'=>1,'ï°—'=>1,'ï°˜'=>1,'ï°™'=>1,'ï°š'=>1,'ï°›'=>1,'ï°œ'=>1,'ï°'=>1,'ï°ž'=>1,'ï°Ÿ'=>1,'ï° '=>1,'ï°¡'=>1,'ï°¢'=>1,'ï°£'=>1,'ï°¤'=>1,'ï°¥'=>1,'ï°¦'=>1,'ï°§'=>1,'ï°¨'=>1,'ï°©'=>1,'ï°ª'=>1,'ï°«'=>1,'ï°¬'=>1,'ï°­'=>1,'ï°®'=>1,'ï°¯'=>1,'ï°°'=>1,'ï°±'=>1,'ï°²'=>1,'ï°³'=>1,'ï°´'=>1,'ï°µ'=>1,'ï°¶'=>1,'ï°·'=>1,'ï°¸'=>1,'ï°¹'=>1,'ï°º'=>1,'ï°»'=>1,'ï°¼'=>1,'ï°½'=>1,'ï°¾'=>1,'ï°¿'=>1,'ï±€'=>1,'ï±'=>1,'ﱂ'=>1,'ﱃ'=>1,'ﱄ'=>1,'ï±…'=>1,'ﱆ'=>1,'ﱇ'=>1,'ﱈ'=>1,'ﱉ'=>1,'ﱊ'=>1,'ﱋ'=>1,'ﱌ'=>1,'ï±'=>1,'ﱎ'=>1,'ï±'=>1,'ï±'=>1,'ﱑ'=>1,'ï±’'=>1,'ﱓ'=>1,'ï±”'=>1,'ﱕ'=>1,'ï±–'=>1,'ï±—'=>1,'ﱘ'=>1,'ï±™'=>1,'ﱚ'=>1,'ï±›'=>1,'ﱜ'=>1,'ï±'=>1,'ﱞ'=>1,'ﱟ'=>1,'ï± '=>1,'ﱡ'=>1,'ï±¢'=>1,'ï±£'=>1,'ﱤ'=>1,'ï±¥'=>1,'ﱦ'=>1,'ﱧ'=>1,'ﱨ'=>1,'ﱩ'=>1,'ﱪ'=>1,'ﱫ'=>1,'ﱬ'=>1,'ï±­'=>1,'ï±®'=>1,'ﱯ'=>1,'ï±°'=>1,'ï±±'=>1,'ï±²'=>1,'ï±³'=>1,'ï±´'=>1,'ï±µ'=>1,'ﱶ'=>1,'ï±·'=>1,'ﱸ'=>1,'ï±¹'=>1,'ﱺ'=>1,'ï±»'=>1,'ï±¼'=>1,'ï±½'=>1,'ï±¾'=>1,'ﱿ'=>1,'ï²€'=>1,'ï²'=>1,'ﲂ'=>1,'ﲃ'=>1,'ﲄ'=>1,'ï²…'=>1,'ﲆ'=>1,'ﲇ'=>1,'ﲈ'=>1,'ﲉ'=>1,'ﲊ'=>1,'ﲋ'=>1,'ﲌ'=>1,'ï²'=>1,'ﲎ'=>1,'ï²'=>1,'ï²'=>1,'ﲑ'=>1,'ï²’'=>1,'ﲓ'=>1,'ï²”'=>1,'ﲕ'=>1,'ï²–'=>1,'ï²—'=>1,'ﲘ'=>1,'ï²™'=>1,'ﲚ'=>1,'ï²›'=>1,'ﲜ'=>1,'ï²'=>1,'ﲞ'=>1,'ﲟ'=>1,'ï² '=>1,'ﲡ'=>1,'ï²¢'=>1,'ï²£'=>1,'ﲤ'=>1,'ï²¥'=>1,'ﲦ'=>1,'ﲧ'=>1,'ﲨ'=>1,'ﲩ'=>1,'ﲪ'=>1,'ﲫ'=>1,'ﲬ'=>1,'ï²­'=>1,'ï²®'=>1,'ﲯ'=>1,'ï²°'=>1,'ï²±'=>1,'ï²²'=>1,'ï²³'=>1,'ï²´'=>1,'ï²µ'=>1,'ﲶ'=>1,'ï²·'=>1,'ﲸ'=>1,'ï²¹'=>1,'ﲺ'=>1,'ï²»'=>1,'ï²¼'=>1,'ï²½'=>1,'ï²¾'=>1,'ﲿ'=>1,'ï³€'=>1,'ï³'=>1,'ﳂ'=>1,'ﳃ'=>1,'ﳄ'=>1,'ï³…'=>1,'ﳆ'=>1,'ﳇ'=>1,'ﳈ'=>1,'ﳉ'=>1,'ﳊ'=>1,'ﳋ'=>1,'ﳌ'=>1,'ï³'=>1,'ﳎ'=>1,'ï³'=>1,'ï³'=>1,'ﳑ'=>1,'ï³’'=>1,'ﳓ'=>1,'ï³”'=>1,'ﳕ'=>1,'ï³–'=>1,'ï³—'=>1,'ﳘ'=>1,'ï³™'=>1,'ﳚ'=>1,'ï³›'=>1,'ﳜ'=>1,'ï³'=>1,'ﳞ'=>1,'ﳟ'=>1,'ï³ '=>1,'ﳡ'=>1,'ï³¢'=>1,'ï³£'=>1,'ﳤ'=>1,'ï³¥'=>1,'ﳦ'=>1,'ﳧ'=>1,'ﳨ'=>1,'ﳩ'=>1,'ﳪ'=>1,'ﳫ'=>1,'ﳬ'=>1,'ï³­'=>1,'ï³®'=>1,'ﳯ'=>1,'ï³°'=>1,'ï³±'=>1,'ï³²'=>1,'ï³³'=>1,'ï³´'=>1,'ï³µ'=>1,'ﳶ'=>1,'ï³·'=>1,'ﳸ'=>1,'ï³¹'=>1,'ﳺ'=>1,'ï³»'=>1,'ï³¼'=>1,'ï³½'=>1,'ï³¾'=>1,'ﳿ'=>1,'ï´€'=>1,'ï´'=>1,'ï´‚'=>1,'ï´ƒ'=>1,'ï´„'=>1,'ï´…'=>1,'ï´†'=>1,'ï´‡'=>1,'ï´ˆ'=>1,'ï´‰'=>1,'ï´Š'=>1,'ï´‹'=>1,'ï´Œ'=>1,'ï´'=>1,'ï´Ž'=>1,'ï´'=>1,'ï´'=>1,'ï´‘'=>1,'ï´’'=>1,'ï´“'=>1,'ï´”'=>1,'ï´•'=>1,'ï´–'=>1,'ï´—'=>1,'ï´˜'=>1,'ï´™'=>1,'ï´š'=>1,'ï´›'=>1,'ï´œ'=>1,'ï´'=>1,'ï´ž'=>1,'ï´Ÿ'=>1,'ï´ '=>1,'ï´¡'=>1,'ï´¢'=>1,'ï´£'=>1,'ï´¤'=>1,'ï´¥'=>1,'ï´¦'=>1,'ï´§'=>1,'ï´¨'=>1,'ï´©'=>1,'ï´ª'=>1,'ï´«'=>1,'ï´¬'=>1,'ï´­'=>1,'ï´®'=>1,'ï´¯'=>1,'ï´°'=>1,'ï´±'=>1,'ï´²'=>1,'ï´³'=>1,'ï´´'=>1,'ï´µ'=>1,'ï´¶'=>1,'ï´·'=>1,'ï´¸'=>1,'ï´¹'=>1,'ï´º'=>1,'ï´»'=>1,'ï´¼'=>1,'ï´½'=>1,'ïµ'=>1,'ﵑ'=>1,'ïµ’'=>1,'ﵓ'=>1,'ïµ”'=>1,'ﵕ'=>1,'ïµ–'=>1,'ïµ—'=>1,'ﵘ'=>1,'ïµ™'=>1,'ﵚ'=>1,'ïµ›'=>1,'ﵜ'=>1,'ïµ'=>1,'ﵞ'=>1,'ﵟ'=>1,'ïµ '=>1,'ﵡ'=>1,'ïµ¢'=>1,'ïµ£'=>1,'ﵤ'=>1,'ïµ¥'=>1,'ﵦ'=>1,'ﵧ'=>1,'ﵨ'=>1,'ﵩ'=>1,'ﵪ'=>1,'ﵫ'=>1,'ﵬ'=>1,'ïµ­'=>1,'ïµ®'=>1,'ﵯ'=>1,'ïµ°'=>1,'ïµ±'=>1,'ïµ²'=>1,'ïµ³'=>1,'ïµ´'=>1,'ïµµ'=>1,'ﵶ'=>1,'ïµ·'=>1,'ﵸ'=>1,'ïµ¹'=>1,'ﵺ'=>1,'ïµ»'=>1,'ïµ¼'=>1,'ïµ½'=>1,'ïµ¾'=>1,'ﵿ'=>1,'ﶀ'=>1,'ï¶'=>1,'ﶂ'=>1,'ﶃ'=>1,'ﶄ'=>1,'ﶅ'=>1,'ﶆ'=>1,'ﶇ'=>1,'ﶈ'=>1,'ﶉ'=>1,'ﶊ'=>1,'ﶋ'=>1,'ﶌ'=>1,'ï¶'=>1,'ﶎ'=>1,'ï¶'=>1,'ﶒ'=>1,'ﶓ'=>1,'ﶔ'=>1,'ﶕ'=>1,'ﶖ'=>1,'ﶗ'=>1,'ﶘ'=>1,'ﶙ'=>1,'ﶚ'=>1,'ﶛ'=>1,'ﶜ'=>1,'ï¶'=>1,'ﶞ'=>1,'ﶟ'=>1,'ﶠ'=>1,'ﶡ'=>1,'ﶢ'=>1,'ﶣ'=>1,'ﶤ'=>1,'ﶥ'=>1,'ﶦ'=>1,'ﶧ'=>1,'ﶨ'=>1,'ﶩ'=>1,'ﶪ'=>1,'ﶫ'=>1,'ﶬ'=>1,'ﶭ'=>1,'ﶮ'=>1,'ﶯ'=>1,'ﶰ'=>1,'ﶱ'=>1,'ﶲ'=>1,'ﶳ'=>1,'ﶴ'=>1,'ﶵ'=>1,'ﶶ'=>1,'ﶷ'=>1,'ﶸ'=>1,'ﶹ'=>1,'ﶺ'=>1,'ﶻ'=>1,'ﶼ'=>1,'ﶽ'=>1,'ﶾ'=>1,'ﶿ'=>1,'ï·€'=>1,'ï·'=>1,'ï·‚'=>1,'ï·ƒ'=>1,'ï·„'=>1,'ï·…'=>1,'ï·†'=>1,'ï·‡'=>1,'ï·°'=>1,'ï·±'=>1,'ï·²'=>1,'ï·³'=>1,'ï·´'=>1,'ï·µ'=>1,'ï·¶'=>1,'ï··'=>1,'ï·¸'=>1,'ï·¹'=>1,'ï·º'=>1,'ï·»'=>1,'ï·¼'=>1,'ï¸'=>1,'︑'=>1,'︒'=>1,'︓'=>1,'︔'=>1,'︕'=>1,'︖'=>1,'︗'=>1,'︘'=>1,'︙'=>1,'︰'=>1,'︱'=>1,'︲'=>1,'︳'=>1,'︴'=>1,'︵'=>1,'︶'=>1,'︷'=>1,'︸'=>1,'︹'=>1,'︺'=>1,'︻'=>1,'︼'=>1,'︽'=>1,'︾'=>1,'︿'=>1,'ï¹€'=>1,'ï¹'=>1,'﹂'=>1,'﹃'=>1,'﹄'=>1,'﹇'=>1,'﹈'=>1,'﹉'=>1,'﹊'=>1,'﹋'=>1,'﹌'=>1,'ï¹'=>1,'﹎'=>1,'ï¹'=>1,'ï¹'=>1,'﹑'=>1,'ï¹’'=>1,'ï¹”'=>1,'﹕'=>1,'ï¹–'=>1,'ï¹—'=>1,'﹘'=>1,'ï¹™'=>1,'﹚'=>1,'ï¹›'=>1,'﹜'=>1,'ï¹'=>1,'﹞'=>1,'﹟'=>1,'ï¹ '=>1,'﹡'=>1,'ï¹¢'=>1,'ï¹£'=>1,'﹤'=>1,'ï¹¥'=>1,'﹦'=>1,'﹨'=>1,'﹩'=>1,'﹪'=>1,'﹫'=>1,'ï¹°'=>1,'ï¹±'=>1,'ï¹²'=>1,'ï¹´'=>1,'ﹶ'=>1,'ï¹·'=>1,'ﹸ'=>1,'ï¹¹'=>1,'ﹺ'=>1,'ï¹»'=>1,'ï¹¼'=>1,'ï¹½'=>1,'ï¹¾'=>1,'ﹿ'=>1,'ﺀ'=>1,'ïº'=>1,'ﺂ'=>1,'ﺃ'=>1,'ﺄ'=>1,'ﺅ'=>1,'ﺆ'=>1,'ﺇ'=>1,'ﺈ'=>1,'ﺉ'=>1,'ﺊ'=>1,'ﺋ'=>1,'ﺌ'=>1,'ïº'=>1,'ﺎ'=>1,'ïº'=>1,'ïº'=>1,'ﺑ'=>1,'ﺒ'=>1,'ﺓ'=>1,'ﺔ'=>1,'ﺕ'=>1,'ﺖ'=>1,'ﺗ'=>1,'ﺘ'=>1,'ﺙ'=>1,'ﺚ'=>1,'ﺛ'=>1,'ﺜ'=>1,'ïº'=>1,'ﺞ'=>1,'ﺟ'=>1,'ﺠ'=>1,'ﺡ'=>1,'ﺢ'=>1,'ﺣ'=>1,'ﺤ'=>1,'ﺥ'=>1,'ﺦ'=>1,'ﺧ'=>1,'ﺨ'=>1,'ﺩ'=>1,'ﺪ'=>1,'ﺫ'=>1,'ﺬ'=>1,'ﺭ'=>1,'ﺮ'=>1,'ﺯ'=>1,'ﺰ'=>1,'ﺱ'=>1,'ﺲ'=>1,'ﺳ'=>1,'ﺴ'=>1,'ﺵ'=>1,'ﺶ'=>1,'ﺷ'=>1,'ﺸ'=>1,'ﺹ'=>1,'ﺺ'=>1,'ﺻ'=>1,'ﺼ'=>1,'ﺽ'=>1,'ﺾ'=>1,'ﺿ'=>1,'ﻀ'=>1,'ï»'=>1,'ﻂ'=>1,'ﻃ'=>1,'ﻄ'=>1,'ï»…'=>1,'ﻆ'=>1,'ﻇ'=>1,'ﻈ'=>1,'ﻉ'=>1,'ﻊ'=>1,'ﻋ'=>1,'ﻌ'=>1,'ï»'=>1,'ﻎ'=>1,'ï»'=>1,'ï»'=>1,'ﻑ'=>1,'ï»’'=>1,'ﻓ'=>1,'ï»”'=>1,'ﻕ'=>1,'ï»–'=>1,'ï»—'=>1,'ﻘ'=>1,'ï»™'=>1,'ﻚ'=>1,'ï»›'=>1,'ﻜ'=>1,'ï»'=>1,'ﻞ'=>1,'ﻟ'=>1,'ï» '=>1,'ﻡ'=>1,'ﻢ'=>1,'ﻣ'=>1,'ﻤ'=>1,'ﻥ'=>1,'ﻦ'=>1,'ﻧ'=>1,'ﻨ'=>1,'ﻩ'=>1,'ﻪ'=>1,'ﻫ'=>1,'ﻬ'=>1,'ï»­'=>1,'ï»®'=>1,'ﻯ'=>1,'ï»°'=>1,'ï»±'=>1,'ﻲ'=>1,'ﻳ'=>1,'ï»´'=>1,'ﻵ'=>1,'ﻶ'=>1,'ï»·'=>1,'ﻸ'=>1,'ﻹ'=>1,'ﻺ'=>1,'ï»»'=>1,'ﻼ'=>1,'ï¼'=>1,'"'=>1,'#'=>1,'$'=>1,'ï¼…'=>1,'&'=>1,'''=>1,'('=>1,')'=>1,'*'=>1,'+'=>1,','=>1,'ï¼'=>1,'.'=>1,'ï¼'=>1,'ï¼'=>1,'1'=>1,'ï¼’'=>1,'3'=>1,'ï¼”'=>1,'5'=>1,'ï¼–'=>1,'ï¼—'=>1,'8'=>1,'ï¼™'=>1,':'=>1,'ï¼›'=>1,'<'=>1,'ï¼'=>1,'>'=>1,'?'=>1,'ï¼ '=>1,'A'=>1,'ï¼¢'=>1,'ï¼£'=>1,'D'=>1,'ï¼¥'=>1,'F'=>1,'G'=>1,'H'=>1,'I'=>1,'J'=>1,'K'=>1,'L'=>1,'ï¼­'=>1,'ï¼®'=>1,'O'=>1,'ï¼°'=>1,'ï¼±'=>1,'ï¼²'=>1,'ï¼³'=>1,'ï¼´'=>1,'ï¼µ'=>1,'V'=>1,'ï¼·'=>1,'X'=>1,'ï¼¹'=>1,'Z'=>1,'ï¼»'=>1,'ï¼¼'=>1,'ï¼½'=>1,'ï¼¾'=>1,'_'=>1,'ï½€'=>1,'ï½'=>1,'b'=>1,'c'=>1,'d'=>1,'ï½…'=>1,'f'=>1,'g'=>1,'h'=>1,'i'=>1,'j'=>1,'k'=>1,'l'=>1,'ï½'=>1,'n'=>1,'ï½'=>1,'ï½'=>1,'q'=>1,'ï½’'=>1,'s'=>1,'ï½”'=>1,'u'=>1,'ï½–'=>1,'ï½—'=>1,'x'=>1,'ï½™'=>1,'z'=>1,'ï½›'=>1,'|'=>1,'ï½'=>1,'~'=>1,'⦅'=>1,'ï½ '=>1,'。'=>1,'ï½¢'=>1,'ï½£'=>1,'、'=>1,'ï½¥'=>1,'ヲ'=>1,'ァ'=>1,'ィ'=>1,'ゥ'=>1,'ェ'=>1,'ォ'=>1,'ャ'=>1,'ï½­'=>1,'ï½®'=>1,'ッ'=>1,'ï½°'=>1,'ï½±'=>1,'ï½²'=>1,'ï½³'=>1,'ï½´'=>1,'ï½µ'=>1,'カ'=>1,'ï½·'=>1,'ク'=>1,'ï½¹'=>1,'コ'=>1,'ï½»'=>1,'ï½¼'=>1,'ï½½'=>1,'ï½¾'=>1,'ソ'=>1,'ï¾€'=>1,'ï¾'=>1,'ツ'=>1,'テ'=>1,'ト'=>1,'ï¾…'=>1,'ニ'=>1,'ヌ'=>1,'ネ'=>1,'ノ'=>1,'ハ'=>1,'ヒ'=>1,'フ'=>1,'ï¾'=>1,'ホ'=>1,'ï¾'=>1,'ï¾'=>1,'ム'=>1,'ï¾’'=>1,'モ'=>1,'ï¾”'=>1,'ユ'=>1,'ï¾–'=>1,'ï¾—'=>1,'リ'=>1,'ï¾™'=>1,'レ'=>1,'ï¾›'=>1,'ワ'=>1,'ï¾'=>1,'゙'=>1,'゚'=>1,'ï¾ '=>1,'ᄀ'=>1,'ï¾¢'=>1,'ï¾£'=>1,'ᄂ'=>1,'ï¾¥'=>1,'ᆭ'=>1,'ᄃ'=>1,'ᄄ'=>1,'ᄅ'=>1,'ᆰ'=>1,'ᆱ'=>1,'ᆲ'=>1,'ï¾­'=>1,'ï¾®'=>1,'ᆵ'=>1,'ï¾°'=>1,'ï¾±'=>1,'ï¾²'=>1,'ï¾³'=>1,'ï¾´'=>1,'ï¾µ'=>1,'ᄊ'=>1,'ï¾·'=>1,'ᄌ'=>1,'ï¾¹'=>1,'ᄎ'=>1,'ï¾»'=>1,'ï¾¼'=>1,'ï¾½'=>1,'ï¾¾'=>1,'ï¿‚'=>1,'ᅢ'=>1,'ï¿„'=>1,'ï¿…'=>1,'ᅥ'=>1,'ᅦ'=>1,'ï¿Š'=>1,'ï¿‹'=>1,'ï¿Œ'=>1,'ï¿'=>1,'ï¿Ž'=>1,'ï¿'=>1,'ï¿’'=>1,'ï¿“'=>1,'ï¿”'=>1,'ï¿•'=>1,'ï¿–'=>1,'ï¿—'=>1,'ï¿š'=>1,'ï¿›'=>1,'ï¿œ'=>1,'ï¿ '=>1,'ï¿¡'=>1,'ï¿¢'=>1,'ï¿£'=>1,'¦'=>1,'ï¿¥'=>1,'₩'=>1,'│'=>1,'ï¿©'=>1,'↑'=>1,'ï¿«'=>1,'↓'=>1,'ï¿­'=>1,'ï¿®'=>1,'ð…ž'=>1,'ð…Ÿ'=>1,'ð… '=>1,'ð…¡'=>1,'ð…¢'=>1,'ð…£'=>1,'ð…¤'=>1,'ð†»'=>1,'ð†¼'=>1,'ð†½'=>1,'ð†¾'=>1,'ð†¿'=>1,'ð‡€'=>1,'ð€'=>1,'ð'=>1,'ð‚'=>1,'ðƒ'=>1,'ð„'=>1,'ð…'=>1,'ð†'=>1,'ð‡'=>1,'ðˆ'=>1,'ð‰'=>1,'ðŠ'=>1,'ð‹'=>1,'ðŒ'=>1,'ð'=>1,'ðŽ'=>1,'ð'=>1,'ð'=>1,'ð‘'=>1,'ð’'=>1,'ð“'=>1,'ð”'=>1,'ð•'=>1,'ð–'=>1,'ð—'=>1,'ð˜'=>1,'ð™'=>1,'ðš'=>1,'ð›'=>1,'ðœ'=>1,'ð'=>1,'ðž'=>1,'ðŸ'=>1,'ð '=>1,'ð¡'=>1,'ð¢'=>1,'ð£'=>1,'ð¤'=>1,'ð¥'=>1,'ð¦'=>1,'ð§'=>1,'ð¨'=>1,'ð©'=>1,'ðª'=>1,'ð«'=>1,'ð¬'=>1,'ð­'=>1,'ð®'=>1,'ð¯'=>1,'ð°'=>1,'ð±'=>1,'ð²'=>1,'ð³'=>1,'ð´'=>1,'ðµ'=>1,'ð¶'=>1,'ð·'=>1,'ð¸'=>1,'ð¹'=>1,'ðº'=>1,'ð»'=>1,'ð¼'=>1,'ð½'=>1,'ð¾'=>1,'ð¿'=>1,'ð‘€'=>1,'ð‘'=>1,'ð‘‚'=>1,'ð‘ƒ'=>1,'ð‘„'=>1,'ð‘…'=>1,'ð‘†'=>1,'ð‘‡'=>1,'ð‘ˆ'=>1,'ð‘‰'=>1,'ð‘Š'=>1,'ð‘‹'=>1,'ð‘Œ'=>1,'ð‘'=>1,'ð‘Ž'=>1,'ð‘'=>1,'ð‘'=>1,'ð‘‘'=>1,'ð‘’'=>1,'ð‘“'=>1,'ð‘”'=>1,'ð‘–'=>1,'ð‘—'=>1,'ð‘˜'=>1,'ð‘™'=>1,'ð‘š'=>1,'ð‘›'=>1,'ð‘œ'=>1,'ð‘'=>1,'ð‘ž'=>1,'ð‘Ÿ'=>1,'ð‘ '=>1,'ð‘¡'=>1,'ð‘¢'=>1,'ð‘£'=>1,'ð‘¤'=>1,'ð‘¥'=>1,'ð‘¦'=>1,'ð‘§'=>1,'ð‘¨'=>1,'ð‘©'=>1,'ð‘ª'=>1,'ð‘«'=>1,'ð‘¬'=>1,'ð‘­'=>1,'ð‘®'=>1,'ð‘¯'=>1,'ð‘°'=>1,'ð‘±'=>1,'ð‘²'=>1,'ð‘³'=>1,'ð‘´'=>1,'ð‘µ'=>1,'ð‘¶'=>1,'ð‘·'=>1,'ð‘¸'=>1,'ð‘¹'=>1,'ð‘º'=>1,'ð‘»'=>1,'ð‘¼'=>1,'ð‘½'=>1,'ð‘¾'=>1,'ð‘¿'=>1,'ð’€'=>1,'ð’'=>1,'ð’‚'=>1,'ð’ƒ'=>1,'ð’„'=>1,'ð’…'=>1,'ð’†'=>1,'ð’‡'=>1,'ð’ˆ'=>1,'ð’‰'=>1,'ð’Š'=>1,'ð’‹'=>1,'ð’Œ'=>1,'ð’'=>1,'ð’Ž'=>1,'ð’'=>1,'ð’'=>1,'ð’‘'=>1,'ð’’'=>1,'ð’“'=>1,'ð’”'=>1,'ð’•'=>1,'ð’–'=>1,'ð’—'=>1,'ð’˜'=>1,'ð’™'=>1,'ð’š'=>1,'ð’›'=>1,'ð’œ'=>1,'ð’ž'=>1,'ð’Ÿ'=>1,'ð’¢'=>1,'ð’¥'=>1,'ð’¦'=>1,'ð’©'=>1,'ð’ª'=>1,'ð’«'=>1,'ð’¬'=>1,'ð’®'=>1,'ð’¯'=>1,'ð’°'=>1,'ð’±'=>1,'ð’²'=>1,'ð’³'=>1,'ð’´'=>1,'ð’µ'=>1,'ð’¶'=>1,'ð’·'=>1,'ð’¸'=>1,'ð’¹'=>1,'ð’»'=>1,'ð’½'=>1,'ð’¾'=>1,'ð’¿'=>1,'ð“€'=>1,'ð“'=>1,'ð“‚'=>1,'ð“ƒ'=>1,'ð“…'=>1,'ð“†'=>1,'ð“‡'=>1,'ð“ˆ'=>1,'ð“‰'=>1,'ð“Š'=>1,'ð“‹'=>1,'ð“Œ'=>1,'ð“'=>1,'ð“Ž'=>1,'ð“'=>1,'ð“'=>1,'ð“‘'=>1,'ð“’'=>1,'ð““'=>1,'ð“”'=>1,'ð“•'=>1,'ð“–'=>1,'ð“—'=>1,'ð“˜'=>1,'ð“™'=>1,'ð“š'=>1,'ð“›'=>1,'ð“œ'=>1,'ð“'=>1,'ð“ž'=>1,'ð“Ÿ'=>1,'ð“ '=>1,'ð“¡'=>1,'ð“¢'=>1,'ð“£'=>1,'ð“¤'=>1,'ð“¥'=>1,'ð“¦'=>1,'ð“§'=>1,'ð“¨'=>1,'ð“©'=>1,'ð“ª'=>1,'ð“«'=>1,'ð“¬'=>1,'ð“­'=>1,'ð“®'=>1,'ð“¯'=>1,'ð“°'=>1,'ð“±'=>1,'ð“²'=>1,'ð“³'=>1,'ð“´'=>1,'ð“µ'=>1,'ð“¶'=>1,'ð“·'=>1,'ð“¸'=>1,'ð“¹'=>1,'ð“º'=>1,'ð“»'=>1,'ð“¼'=>1,'ð“½'=>1,'ð“¾'=>1,'ð“¿'=>1,'ð”€'=>1,'ð”'=>1,'ð”‚'=>1,'ð”ƒ'=>1,'ð”„'=>1,'ð”…'=>1,'ð”‡'=>1,'ð”ˆ'=>1,'ð”‰'=>1,'ð”Š'=>1,'ð”'=>1,'ð”Ž'=>1,'ð”'=>1,'ð”'=>1,'ð”‘'=>1,'ð”’'=>1,'ð”“'=>1,'ð””'=>1,'ð”–'=>1,'ð”—'=>1,'ð”˜'=>1,'ð”™'=>1,'ð”š'=>1,'ð”›'=>1,'ð”œ'=>1,'ð”ž'=>1,'ð”Ÿ'=>1,'ð” '=>1,'ð”¡'=>1,'ð”¢'=>1,'ð”£'=>1,'ð”¤'=>1,'ð”¥'=>1,'ð”¦'=>1,'ð”§'=>1,'ð”¨'=>1,'ð”©'=>1,'ð”ª'=>1,'ð”«'=>1,'ð”¬'=>1,'ð”­'=>1,'ð”®'=>1,'ð”¯'=>1,'ð”°'=>1,'ð”±'=>1,'ð”²'=>1,'ð”³'=>1,'ð”´'=>1,'ð”µ'=>1,'ð”¶'=>1,'ð”·'=>1,'ð”¸'=>1,'ð”¹'=>1,'ð”»'=>1,'ð”¼'=>1,'ð”½'=>1,'ð”¾'=>1,'ð•€'=>1,'ð•'=>1,'ð•‚'=>1,'ð•ƒ'=>1,'ð•„'=>1,'ð•†'=>1,'ð•Š'=>1,'ð•‹'=>1,'ð•Œ'=>1,'ð•'=>1,'ð•Ž'=>1,'ð•'=>1,'ð•'=>1,'ð•’'=>1,'ð•“'=>1,'ð•”'=>1,'ð••'=>1,'ð•–'=>1,'ð•—'=>1,'ð•˜'=>1,'ð•™'=>1,'ð•š'=>1,'ð•›'=>1,'ð•œ'=>1,'ð•'=>1,'ð•ž'=>1,'ð•Ÿ'=>1,'ð• '=>1,'ð•¡'=>1,'ð•¢'=>1,'ð•£'=>1,'ð•¤'=>1,'ð•¥'=>1,'ð•¦'=>1,'ð•§'=>1,'ð•¨'=>1,'ð•©'=>1,'ð•ª'=>1,'ð•«'=>1,'ð•¬'=>1,'ð•­'=>1,'ð•®'=>1,'ð•¯'=>1,'ð•°'=>1,'ð•±'=>1,'ð•²'=>1,'ð•³'=>1,'ð•´'=>1,'ð•µ'=>1,'ð•¶'=>1,'ð•·'=>1,'ð•¸'=>1,'ð•¹'=>1,'ð•º'=>1,'ð•»'=>1,'ð•¼'=>1,'ð•½'=>1,'ð•¾'=>1,'ð•¿'=>1,'ð–€'=>1,'ð–'=>1,'ð–‚'=>1,'ð–ƒ'=>1,'ð–„'=>1,'ð–…'=>1,'ð–†'=>1,'ð–‡'=>1,'ð–ˆ'=>1,'ð–‰'=>1,'ð–Š'=>1,'ð–‹'=>1,'ð–Œ'=>1,'ð–'=>1,'ð–Ž'=>1,'ð–'=>1,'ð–'=>1,'ð–‘'=>1,'ð–’'=>1,'ð–“'=>1,'ð–”'=>1,'ð–•'=>1,'ð––'=>1,'ð–—'=>1,'ð–˜'=>1,'ð–™'=>1,'ð–š'=>1,'ð–›'=>1,'ð–œ'=>1,'ð–'=>1,'ð–ž'=>1,'ð–Ÿ'=>1,'ð– '=>1,'ð–¡'=>1,'ð–¢'=>1,'ð–£'=>1,'ð–¤'=>1,'ð–¥'=>1,'ð–¦'=>1,'ð–§'=>1,'ð–¨'=>1,'ð–©'=>1,'ð–ª'=>1,'ð–«'=>1,'ð–¬'=>1,'ð–­'=>1,'ð–®'=>1,'ð–¯'=>1,'ð–°'=>1,'ð–±'=>1,'ð–²'=>1,'ð–³'=>1,'ð–´'=>1,'ð–µ'=>1,'ð–¶'=>1,'ð–·'=>1,'ð–¸'=>1,'ð–¹'=>1,'ð–º'=>1,'ð–»'=>1,'ð–¼'=>1,'ð–½'=>1,'ð–¾'=>1,'ð–¿'=>1,'ð—€'=>1,'ð—'=>1,'ð—‚'=>1,'ð—ƒ'=>1,'ð—„'=>1,'ð—…'=>1,'ð—†'=>1,'ð—‡'=>1,'ð—ˆ'=>1,'ð—‰'=>1,'ð—Š'=>1,'ð—‹'=>1,'ð—Œ'=>1,'ð—'=>1,'ð—Ž'=>1,'ð—'=>1,'ð—'=>1,'ð—‘'=>1,'ð—’'=>1,'ð—“'=>1,'ð—”'=>1,'ð—•'=>1,'ð—–'=>1,'ð——'=>1,'ð—˜'=>1,'ð—™'=>1,'ð—š'=>1,'ð—›'=>1,'ð—œ'=>1,'ð—'=>1,'ð—ž'=>1,'ð—Ÿ'=>1,'ð— '=>1,'ð—¡'=>1,'ð—¢'=>1,'ð—£'=>1,'ð—¤'=>1,'ð—¥'=>1,'ð—¦'=>1,'ð—§'=>1,'ð—¨'=>1,'ð—©'=>1,'ð—ª'=>1,'ð—«'=>1,'ð—¬'=>1,'ð—­'=>1,'ð—®'=>1,'ð—¯'=>1,'ð—°'=>1,'ð—±'=>1,'ð—²'=>1,'ð—³'=>1,'ð—´'=>1,'ð—µ'=>1,'ð—¶'=>1,'ð—·'=>1,'ð—¸'=>1,'ð—¹'=>1,'ð—º'=>1,'ð—»'=>1,'ð—¼'=>1,'ð—½'=>1,'ð—¾'=>1,'ð—¿'=>1,'ð˜€'=>1,'ð˜'=>1,'ð˜‚'=>1,'ð˜ƒ'=>1,'ð˜„'=>1,'ð˜…'=>1,'ð˜†'=>1,'ð˜‡'=>1,'ð˜ˆ'=>1,'ð˜‰'=>1,'ð˜Š'=>1,'ð˜‹'=>1,'ð˜Œ'=>1,'ð˜'=>1,'ð˜Ž'=>1,'ð˜'=>1,'ð˜'=>1,'ð˜‘'=>1,'ð˜’'=>1,'ð˜“'=>1,'ð˜”'=>1,'ð˜•'=>1,'ð˜–'=>1,'ð˜—'=>1,'ð˜˜'=>1,'ð˜™'=>1,'ð˜š'=>1,'ð˜›'=>1,'ð˜œ'=>1,'ð˜'=>1,'ð˜ž'=>1,'ð˜Ÿ'=>1,'ð˜ '=>1,'ð˜¡'=>1,'ð˜¢'=>1,'ð˜£'=>1,'ð˜¤'=>1,'ð˜¥'=>1,'ð˜¦'=>1,'ð˜§'=>1,'ð˜¨'=>1,'ð˜©'=>1,'ð˜ª'=>1,'ð˜«'=>1,'ð˜¬'=>1,'ð˜­'=>1,'ð˜®'=>1,'ð˜¯'=>1,'ð˜°'=>1,'ð˜±'=>1,'ð˜²'=>1,'ð˜³'=>1,'ð˜´'=>1,'ð˜µ'=>1,'ð˜¶'=>1,'ð˜·'=>1,'ð˜¸'=>1,'ð˜¹'=>1,'ð˜º'=>1,'ð˜»'=>1,'ð˜¼'=>1,'ð˜½'=>1,'ð˜¾'=>1,'ð˜¿'=>1,'ð™€'=>1,'ð™'=>1,'ð™‚'=>1,'ð™ƒ'=>1,'ð™„'=>1,'ð™…'=>1,'ð™†'=>1,'ð™‡'=>1,'ð™ˆ'=>1,'ð™‰'=>1,'ð™Š'=>1,'ð™‹'=>1,'ð™Œ'=>1,'ð™'=>1,'ð™Ž'=>1,'ð™'=>1,'ð™'=>1,'ð™‘'=>1,'ð™’'=>1,'ð™“'=>1,'ð™”'=>1,'ð™•'=>1,'ð™–'=>1,'ð™—'=>1,'ð™˜'=>1,'ð™™'=>1,'ð™š'=>1,'ð™›'=>1,'ð™œ'=>1,'ð™'=>1,'ð™ž'=>1,'ð™Ÿ'=>1,'ð™ '=>1,'ð™¡'=>1,'ð™¢'=>1,'ð™£'=>1,'ð™¤'=>1,'ð™¥'=>1,'ð™¦'=>1,'ð™§'=>1,'ð™¨'=>1,'ð™©'=>1,'ð™ª'=>1,'ð™«'=>1,'ð™¬'=>1,'ð™­'=>1,'ð™®'=>1,'ð™¯'=>1,'ð™°'=>1,'ð™±'=>1,'ð™²'=>1,'ð™³'=>1,'ð™´'=>1,'ð™µ'=>1,'ð™¶'=>1,'ð™·'=>1,'ð™¸'=>1,'ð™¹'=>1,'ð™º'=>1,'ð™»'=>1,'ð™¼'=>1,'ð™½'=>1,'ð™¾'=>1,'ð™¿'=>1,'ðš€'=>1,'ðš'=>1,'ðš‚'=>1,'ðšƒ'=>1,'ðš„'=>1,'ðš…'=>1,'ðš†'=>1,'ðš‡'=>1,'ðšˆ'=>1,'ðš‰'=>1,'ðšŠ'=>1,'ðš‹'=>1,'ðšŒ'=>1,'ðš'=>1,'ðšŽ'=>1,'ðš'=>1,'ðš'=>1,'ðš‘'=>1,'ðš’'=>1,'ðš“'=>1,'ðš”'=>1,'ðš•'=>1,'ðš–'=>1,'ðš—'=>1,'ðš˜'=>1,'ðš™'=>1,'ðšš'=>1,'ðš›'=>1,'ðšœ'=>1,'ðš'=>1,'ðšž'=>1,'ðšŸ'=>1,'ðš '=>1,'ðš¡'=>1,'ðš¢'=>1,'ðš£'=>1,'ðš¤'=>1,'ðš¥'=>1,'ðš¨'=>1,'ðš©'=>1,'ðšª'=>1,'ðš«'=>1,'ðš¬'=>1,'ðš­'=>1,'ðš®'=>1,'ðš¯'=>1,'ðš°'=>1,'ðš±'=>1,'ðš²'=>1,'ðš³'=>1,'ðš´'=>1,'ðšµ'=>1,'ðš¶'=>1,'ðš·'=>1,'ðš¸'=>1,'ðš¹'=>1,'ðšº'=>1,'ðš»'=>1,'ðš¼'=>1,'ðš½'=>1,'ðš¾'=>1,'ðš¿'=>1,'ð›€'=>1,'ð›'=>1,'ð›‚'=>1,'ð›ƒ'=>1,'ð›„'=>1,'ð›…'=>1,'ð›†'=>1,'ð›‡'=>1,'ð›ˆ'=>1,'ð›‰'=>1,'ð›Š'=>1,'ð›‹'=>1,'ð›Œ'=>1,'ð›'=>1,'ð›Ž'=>1,'ð›'=>1,'ð›'=>1,'ð›‘'=>1,'ð›’'=>1,'ð›“'=>1,'ð›”'=>1,'ð›•'=>1,'ð›–'=>1,'ð›—'=>1,'ð›˜'=>1,'ð›™'=>1,'ð›š'=>1,'ð››'=>1,'ð›œ'=>1,'ð›'=>1,'ð›ž'=>1,'ð›Ÿ'=>1,'ð› '=>1,'ð›¡'=>1,'ð›¢'=>1,'ð›£'=>1,'ð›¤'=>1,'ð›¥'=>1,'ð›¦'=>1,'ð›§'=>1,'ð›¨'=>1,'ð›©'=>1,'ð›ª'=>1,'ð›«'=>1,'ð›¬'=>1,'ð›­'=>1,'ð›®'=>1,'ð›¯'=>1,'ð›°'=>1,'ð›±'=>1,'ð›²'=>1,'ð›³'=>1,'ð›´'=>1,'ð›µ'=>1,'ð›¶'=>1,'ð›·'=>1,'ð›¸'=>1,'ð›¹'=>1,'ð›º'=>1,'ð›»'=>1,'ð›¼'=>1,'ð›½'=>1,'ð›¾'=>1,'ð›¿'=>1,'ðœ€'=>1,'ðœ'=>1,'ðœ‚'=>1,'ðœƒ'=>1,'ðœ„'=>1,'ðœ…'=>1,'ðœ†'=>1,'ðœ‡'=>1,'ðœˆ'=>1,'ðœ‰'=>1,'ðœŠ'=>1,'ðœ‹'=>1,'ðœŒ'=>1,'ðœ'=>1,'ðœŽ'=>1,'ðœ'=>1,'ðœ'=>1,'ðœ‘'=>1,'ðœ’'=>1,'ðœ“'=>1,'ðœ”'=>1,'ðœ•'=>1,'ðœ–'=>1,'ðœ—'=>1,'ðœ˜'=>1,'ðœ™'=>1,'ðœš'=>1,'ðœ›'=>1,'ðœœ'=>1,'ðœ'=>1,'ðœž'=>1,'ðœŸ'=>1,'ðœ '=>1,'ðœ¡'=>1,'ðœ¢'=>1,'ðœ£'=>1,'ðœ¤'=>1,'ðœ¥'=>1,'ðœ¦'=>1,'ðœ§'=>1,'ðœ¨'=>1,'ðœ©'=>1,'ðœª'=>1,'ðœ«'=>1,'ðœ¬'=>1,'ðœ­'=>1,'ðœ®'=>1,'ðœ¯'=>1,'ðœ°'=>1,'ðœ±'=>1,'ðœ²'=>1,'ðœ³'=>1,'ðœ´'=>1,'ðœµ'=>1,'ðœ¶'=>1,'ðœ·'=>1,'ðœ¸'=>1,'ðœ¹'=>1,'ðœº'=>1,'ðœ»'=>1,'ðœ¼'=>1,'ðœ½'=>1,'ðœ¾'=>1,'ðœ¿'=>1,'ð€'=>1,'ð'=>1,'ð‚'=>1,'ðƒ'=>1,'ð„'=>1,'ð…'=>1,'ð†'=>1,'ð‡'=>1,'ðˆ'=>1,'ð‰'=>1,'ðŠ'=>1,'ð‹'=>1,'ðŒ'=>1,'ð'=>1,'ðŽ'=>1,'ð'=>1,'ð'=>1,'ð‘'=>1,'ð’'=>1,'ð“'=>1,'ð”'=>1,'ð•'=>1,'ð–'=>1,'ð—'=>1,'ð˜'=>1,'ð™'=>1,'ðš'=>1,'ð›'=>1,'ðœ'=>1,'ð'=>1,'ðž'=>1,'ðŸ'=>1,'ð '=>1,'ð¡'=>1,'ð¢'=>1,'ð£'=>1,'ð¤'=>1,'ð¥'=>1,'ð¦'=>1,'ð§'=>1,'ð¨'=>1,'ð©'=>1,'ðª'=>1,'ð«'=>1,'ð¬'=>1,'ð­'=>1,'ð®'=>1,'ð¯'=>1,'ð°'=>1,'ð±'=>1,'ð²'=>1,'ð³'=>1,'ð´'=>1,'ðµ'=>1,'ð¶'=>1,'ð·'=>1,'ð¸'=>1,'ð¹'=>1,'ðº'=>1,'ð»'=>1,'ð¼'=>1,'ð½'=>1,'ð¾'=>1,'ð¿'=>1,'ðž€'=>1,'ðž'=>1,'ðž‚'=>1,'ðžƒ'=>1,'ðž„'=>1,'ðž…'=>1,'ðž†'=>1,'ðž‡'=>1,'ðžˆ'=>1,'ðž‰'=>1,'ðžŠ'=>1,'ðž‹'=>1,'ðžŒ'=>1,'ðž'=>1,'ðžŽ'=>1,'ðž'=>1,'ðž'=>1,'ðž‘'=>1,'ðž’'=>1,'ðž“'=>1,'ðž”'=>1,'ðž•'=>1,'ðž–'=>1,'ðž—'=>1,'ðž˜'=>1,'ðž™'=>1,'ðžš'=>1,'ðž›'=>1,'ðžœ'=>1,'ðž'=>1,'ðžž'=>1,'ðžŸ'=>1,'ðž '=>1,'ðž¡'=>1,'ðž¢'=>1,'ðž£'=>1,'ðž¤'=>1,'ðž¥'=>1,'ðž¦'=>1,'ðž§'=>1,'ðž¨'=>1,'ðž©'=>1,'ðžª'=>1,'ðž«'=>1,'ðž¬'=>1,'ðž­'=>1,'ðž®'=>1,'ðž¯'=>1,'ðž°'=>1,'ðž±'=>1,'ðž²'=>1,'ðž³'=>1,'ðž´'=>1,'ðžµ'=>1,'ðž¶'=>1,'ðž·'=>1,'ðž¸'=>1,'ðž¹'=>1,'ðžº'=>1,'ðž»'=>1,'ðž¼'=>1,'ðž½'=>1,'ðž¾'=>1,'ðž¿'=>1,'ðŸ€'=>1,'ðŸ'=>1,'ðŸ‚'=>1,'ðŸƒ'=>1,'ðŸ„'=>1,'ðŸ…'=>1,'ðŸ†'=>1,'ðŸ‡'=>1,'ðŸˆ'=>1,'ðŸ‰'=>1,'ðŸŠ'=>1,'ðŸ‹'=>1,'ðŸŽ'=>1,'ðŸ'=>1,'ðŸ'=>1,'ðŸ‘'=>1,'ðŸ’'=>1,'ðŸ“'=>1,'ðŸ”'=>1,'ðŸ•'=>1,'ðŸ–'=>1,'ðŸ—'=>1,'ðŸ˜'=>1,'ðŸ™'=>1,'ðŸš'=>1,'ðŸ›'=>1,'ðŸœ'=>1,'ðŸ'=>1,'ðŸž'=>1,'ðŸŸ'=>1,'ðŸ '=>1,'ðŸ¡'=>1,'ðŸ¢'=>1,'ðŸ£'=>1,'ðŸ¤'=>1,'ðŸ¥'=>1,'ðŸ¦'=>1,'ðŸ§'=>1,'ðŸ¨'=>1,'ðŸ©'=>1,'ðŸª'=>1,'ðŸ«'=>1,'ðŸ¬'=>1,'ðŸ­'=>1,'ðŸ®'=>1,'ðŸ¯'=>1,'ðŸ°'=>1,'ðŸ±'=>1,'ðŸ²'=>1,'ðŸ³'=>1,'ðŸ´'=>1,'ðŸµ'=>1,'ðŸ¶'=>1,'ðŸ·'=>1,'ðŸ¸'=>1,'ðŸ¹'=>1,'ðŸº'=>1,'ðŸ»'=>1,'ðŸ¼'=>1,'ðŸ½'=>1,'ðŸ¾'=>1,'ðŸ¿'=>1,'丽'=>1,'ð¯ '=>1,'乁'=>1,'𠄢'=>1,'你'=>1,'侮'=>1,'侻'=>1,'倂'=>1,'偺'=>1,'備'=>1,'僧'=>1,'像'=>1,'㒞'=>1,'ð¯ '=>1,'免'=>1,'ð¯ '=>1,'ð¯ '=>1,'具'=>1,'𠔜'=>1,'㒹'=>1,'內'=>1,'再'=>1,'𠕋'=>1,'冗'=>1,'冤'=>1,'仌'=>1,'冬'=>1,'况'=>1,'𩇟'=>1,'ð¯ '=>1,'刃'=>1,'㓟'=>1,'刻'=>1,'剆'=>1,'割'=>1,'剷'=>1,'㔕'=>1,'勇'=>1,'勉'=>1,'勤'=>1,'勺'=>1,'包'=>1,'匆'=>1,'北'=>1,'卉'=>1,'卑'=>1,'博'=>1,'即'=>1,'卽'=>1,'卿'=>1,'卿'=>1,'卿'=>1,'𠨬'=>1,'灰'=>1,'及'=>1,'叟'=>1,'𠭣'=>1,'叫'=>1,'叱'=>1,'吆'=>1,'咞'=>1,'吸'=>1,'呈'=>1,'周'=>1,'咢'=>1,'ð¯¡'=>1,'唐'=>1,'啓'=>1,'啣'=>1,'善'=>1,'善'=>1,'喙'=>1,'喫'=>1,'喳'=>1,'嗂'=>1,'圖'=>1,'嘆'=>1,'ð¯¡'=>1,'噑'=>1,'ð¯¡'=>1,'ð¯¡'=>1,'壮'=>1,'城'=>1,'埴'=>1,'堍'=>1,'型'=>1,'堲'=>1,'報'=>1,'墬'=>1,'𡓤'=>1,'売'=>1,'壷'=>1,'夆'=>1,'ð¯¡'=>1,'夢'=>1,'奢'=>1,'𡚨'=>1,'𡛪'=>1,'姬'=>1,'娛'=>1,'娧'=>1,'姘'=>1,'婦'=>1,'㛮'=>1,'㛼'=>1,'嬈'=>1,'嬾'=>1,'嬾'=>1,'𡧈'=>1,'寃'=>1,'寘'=>1,'寧'=>1,'寳'=>1,'𡬘'=>1,'寿'=>1,'将'=>1,'当'=>1,'尢'=>1,'㞁'=>1,'屠'=>1,'屮'=>1,'峀'=>1,'岍'=>1,'𡷤'=>1,'嵃'=>1,'𡷦'=>1,'嵮'=>1,'嵫'=>1,'嵼'=>1,'ð¯¢'=>1,'巢'=>1,'㠯'=>1,'巽'=>1,'帨'=>1,'帽'=>1,'幩'=>1,'㡢'=>1,'𢆃'=>1,'㡼'=>1,'庰'=>1,'庳'=>1,'ð¯¢'=>1,'廊'=>1,'ð¯¢'=>1,'ð¯¢'=>1,'𢌱'=>1,'𢌱'=>1,'舁'=>1,'弢'=>1,'弢'=>1,'㣇'=>1,'𣊸'=>1,'𦇚'=>1,'形'=>1,'彫'=>1,'㣣'=>1,'徚'=>1,'ð¯¢'=>1,'志'=>1,'忹'=>1,'悁'=>1,'㤺'=>1,'㤜'=>1,'悔'=>1,'𢛔'=>1,'惇'=>1,'慈'=>1,'慌'=>1,'慎'=>1,'慌'=>1,'慺'=>1,'憎'=>1,'憲'=>1,'憤'=>1,'憯'=>1,'懞'=>1,'懲'=>1,'懶'=>1,'成'=>1,'戛'=>1,'扝'=>1,'抱'=>1,'拔'=>1,'捐'=>1,'𢬌'=>1,'挽'=>1,'拼'=>1,'捨'=>1,'掃'=>1,'揤'=>1,'𢯱'=>1,'搢'=>1,'揅'=>1,'ð¯£'=>1,'㨮'=>1,'摩'=>1,'摾'=>1,'撝'=>1,'摷'=>1,'㩬'=>1,'敏'=>1,'敬'=>1,'𣀊'=>1,'旣'=>1,'書'=>1,'ð¯£'=>1,'㬙'=>1,'ð¯£'=>1,'ð¯£'=>1,'㫤'=>1,'冒'=>1,'冕'=>1,'最'=>1,'暜'=>1,'肭'=>1,'䏙'=>1,'朗'=>1,'望'=>1,'朡'=>1,'杞'=>1,'杓'=>1,'ð¯£'=>1,'㭉'=>1,'柺'=>1,'枅'=>1,'桒'=>1,'梅'=>1,'𣑭'=>1,'梎'=>1,'栟'=>1,'椔'=>1,'㮝'=>1,'楂'=>1,'榣'=>1,'槪'=>1,'檨'=>1,'𣚣'=>1,'櫛'=>1,'㰘'=>1,'次'=>1,'𣢧'=>1,'歔'=>1,'㱎'=>1,'歲'=>1,'殟'=>1,'殺'=>1,'殻'=>1,'𣪍'=>1,'𡴋'=>1,'𣫺'=>1,'汎'=>1,'𣲼'=>1,'沿'=>1,'泍'=>1,'汧'=>1,'洖'=>1,'派'=>1,'ð¯¤'=>1,'流'=>1,'浩'=>1,'浸'=>1,'涅'=>1,'𣴞'=>1,'洴'=>1,'港'=>1,'湮'=>1,'㴳'=>1,'滋'=>1,'滇'=>1,'ð¯¤'=>1,'淹'=>1,'ð¯¤'=>1,'ð¯¤'=>1,'𣾎'=>1,'濆'=>1,'瀹'=>1,'瀞'=>1,'瀛'=>1,'㶖'=>1,'灊'=>1,'災'=>1,'灷'=>1,'炭'=>1,'𠔥'=>1,'煅'=>1,'ð¯¤'=>1,'熜'=>1,'𤎫'=>1,'爨'=>1,'爵'=>1,'牐'=>1,'𤘈'=>1,'犀'=>1,'犕'=>1,'𤜵'=>1,'𤠔'=>1,'獺'=>1,'王'=>1,'㺬'=>1,'玥'=>1,'㺸'=>1,'㺸'=>1,'瑇'=>1,'瑜'=>1,'瑱'=>1,'璅'=>1,'瓊'=>1,'㼛'=>1,'甤'=>1,'𤰶'=>1,'甾'=>1,'𤲒'=>1,'異'=>1,'𢆟'=>1,'瘐'=>1,'𤾡'=>1,'𤾸'=>1,'𥁄'=>1,'㿼'=>1,'䀈'=>1,'直'=>1,'ð¯¥'=>1,'𥃲'=>1,'𥄙'=>1,'𥄳'=>1,'眞'=>1,'真'=>1,'真'=>1,'睊'=>1,'䀹'=>1,'瞋'=>1,'䁆'=>1,'䂖'=>1,'ð¯¥'=>1,'硎'=>1,'ð¯¥'=>1,'ð¯¥'=>1,'䃣'=>1,'𥘦'=>1,'祖'=>1,'𥚚'=>1,'𥛅'=>1,'福'=>1,'秫'=>1,'䄯'=>1,'穀'=>1,'穊'=>1,'穏'=>1,'𥥼'=>1,'ð¯¥'=>1,'𥪧'=>1,'竮'=>1,'䈂'=>1,'𥮫'=>1,'篆'=>1,'築'=>1,'䈧'=>1,'𥲀'=>1,'糒'=>1,'䊠'=>1,'糨'=>1,'糣'=>1,'紀'=>1,'𥾆'=>1,'絣'=>1,'䌁'=>1,'緇'=>1,'縂'=>1,'繅'=>1,'䌴'=>1,'𦈨'=>1,'𦉇'=>1,'䍙'=>1,'𦋙'=>1,'罺'=>1,'𦌾'=>1,'羕'=>1,'翺'=>1,'者'=>1,'𦓚'=>1,'𦔣'=>1,'聠'=>1,'𦖨'=>1,'聰'=>1,'𣍟'=>1,'ð¯¦'=>1,'育'=>1,'脃'=>1,'䐋'=>1,'脾'=>1,'媵'=>1,'𦞧'=>1,'𦞵'=>1,'𣎓'=>1,'𣎜'=>1,'舁'=>1,'舄'=>1,'ð¯¦'=>1,'䑫'=>1,'ð¯¦'=>1,'ð¯¦'=>1,'芝'=>1,'劳'=>1,'花'=>1,'芳'=>1,'芽'=>1,'苦'=>1,'𦬼'=>1,'若'=>1,'茝'=>1,'荣'=>1,'莭'=>1,'茣'=>1,'ð¯¦'=>1,'菧'=>1,'著'=>1,'荓'=>1,'菊'=>1,'菌'=>1,'菜'=>1,'𦰶'=>1,'𦵫'=>1,'𦳕'=>1,'䔫'=>1,'蓱'=>1,'蓳'=>1,'蔖'=>1,'𧏊'=>1,'蕤'=>1,'𦼬'=>1,'䕝'=>1,'䕡'=>1,'𦾱'=>1,'𧃒'=>1,'䕫'=>1,'虐'=>1,'虜'=>1,'虧'=>1,'虩'=>1,'蚩'=>1,'蚈'=>1,'蜎'=>1,'蛢'=>1,'蝹'=>1,'蜨'=>1,'蝫'=>1,'螆'=>1,'䗗'=>1,'蟡'=>1,'ð¯§'=>1,'䗹'=>1,'衠'=>1,'衣'=>1,'𧙧'=>1,'裗'=>1,'裞'=>1,'䘵'=>1,'裺'=>1,'㒻'=>1,'𧢮'=>1,'𧥦'=>1,'ð¯§'=>1,'䛇'=>1,'ð¯§'=>1,'ð¯§'=>1,'變'=>1,'豕'=>1,'𧲨'=>1,'貫'=>1,'賁'=>1,'贛'=>1,'起'=>1,'𧼯'=>1,'𠠄'=>1,'跋'=>1,'趼'=>1,'跰'=>1,'ð¯§'=>1,'軔'=>1,'輸'=>1,'𨗒'=>1,'𨗭'=>1,'邔'=>1,'郱'=>1,'鄑'=>1,'𨜮'=>1,'鄛'=>1,'鈸'=>1,'鋗'=>1,'鋘'=>1,'鉼'=>1,'鏹'=>1,'鐕'=>1,'𨯺'=>1,'開'=>1,'䦕'=>1,'閷'=>1,'𨵷'=>1,'䧦'=>1,'雃'=>1,'嶲'=>1,'霣'=>1,'𩅅'=>1,'𩈚'=>1,'䩮'=>1,'䩶'=>1,'韠'=>1,'𩐊'=>1,'䪲'=>1,'𩒖'=>1,'頋'=>1,'頋'=>1,'頩'=>1,'ð¯¨'=>1,'飢'=>1,'䬳'=>1,'餩'=>1,'馧'=>1,'駂'=>1,'駾'=>1,'䯎'=>1,'𩬰'=>1,'鬒'=>1,'鱀'=>1,'鳽'=>1,'ð¯¨'=>1,'䳭'=>1,'ð¯¨'=>1,'ð¯¨'=>1,'䳸'=>1,'𪄅'=>1,'𪈎'=>1,'𪊑'=>1,'麻'=>1,'䵖'=>1,'黹'=>1,'黾'=>1,'鼅'=>1,'鼏'=>1,'鼖'=>1,'鼻'=>1,'ð¯¨'=>1,'Ì€'=>0,'Ì'=>0,'Ì‚'=>0,'̃'=>0,'Ì„'=>0,'̆'=>0,'̇'=>0,'̈'=>0,'̉'=>0,'ÌŠ'=>0,'Ì‹'=>0,'ÌŒ'=>0,'Ì'=>0,'Ì‘'=>0,'Ì“'=>0,'Ì”'=>0,'Ì›'=>0,'Ì£'=>0,'̤'=>0,'Ì¥'=>0,'̦'=>0,'̧'=>0,'̨'=>0,'Ì­'=>0,'Ì®'=>0,'Ì°'=>0,'̱'=>0,'̸'=>0,'Í‚'=>0,'Í…'=>0,'Ù“'=>0,'Ù”'=>0,'Ù•'=>0,'़'=>0,'া'=>0,'ৗ'=>0,'ା'=>0,'à­–'=>0,'à­—'=>0,'ா'=>0,'ௗ'=>0,'à±–'=>0,'ೂ'=>0,'ೕ'=>0,'à³–'=>0,'à´¾'=>0,'ൗ'=>0,'à·Š'=>0,'à·'=>0,'à·Ÿ'=>0,'ီ'=>0,'á…¡'=>0,'á…¢'=>0,'á…£'=>0,'á…¤'=>0,'á…¥'=>0,'á…¦'=>0,'á…§'=>0,'á…¨'=>0,'á…©'=>0,'á…ª'=>0,'á…«'=>0,'á…¬'=>0,'á…­'=>0,'á…®'=>0,'á…¯'=>0,'á…°'=>0,'á…±'=>0,'á…²'=>0,'á…³'=>0,'á…´'=>0,'á…µ'=>0,'ᆨ'=>0,'ᆩ'=>0,'ᆪ'=>0,'ᆫ'=>0,'ᆬ'=>0,'ᆭ'=>0,'ᆮ'=>0,'ᆯ'=>0,'ᆰ'=>0,'ᆱ'=>0,'ᆲ'=>0,'ᆳ'=>0,'ᆴ'=>0,'ᆵ'=>0,'ᆶ'=>0,'ᆷ'=>0,'ᆸ'=>0,'ᆹ'=>0,'ᆺ'=>0,'ᆻ'=>0,'ᆼ'=>0,'ᆽ'=>0,'ᆾ'=>0,'ᆿ'=>0,'ᇀ'=>0,'á‡'=>0,'ᇂ'=>0,'ᬵ'=>0,'ã‚™'=>0,'ã‚š'=>0);
diff --git a/phpBB/includes/utf/data/utf_normalizer_common.php b/phpBB/includes/utf/data/utf_normalizer_common.php
deleted file mode 100644
index 2eb7feac69..0000000000
--- a/phpBB/includes/utf/data/utf_normalizer_common.php
+++ /dev/null
@@ -1,4 +0,0 @@
-<?php
-$GLOBALS['utf_jamo_index']=array('á„€'=>44032,'á„'=>44620,'á„‚'=>45208,'ᄃ'=>45796,'á„„'=>46384,'á„…'=>46972,'ᄆ'=>47560,'ᄇ'=>48148,'ᄈ'=>48736,'ᄉ'=>49324,'á„Š'=>49912,'á„‹'=>50500,'á„Œ'=>51088,'á„'=>51676,'á„Ž'=>52264,'á„'=>52852,'á„'=>53440,'á„‘'=>54028,'á„’'=>54616,'á…¡'=>0,'á…¢'=>28,'á…£'=>56,'á…¤'=>84,'á…¥'=>112,'á…¦'=>140,'á…§'=>168,'á…¨'=>196,'á…©'=>224,'á…ª'=>252,'á…«'=>280,'á…¬'=>308,'á…­'=>336,'á…®'=>364,'á…¯'=>392,'á…°'=>420,'á…±'=>448,'á…²'=>476,'á…³'=>504,'á…´'=>532,'á…µ'=>560,'ᆧ'=>0,'ᆨ'=>1,'ᆩ'=>2,'ᆪ'=>3,'ᆫ'=>4,'ᆬ'=>5,'ᆭ'=>6,'ᆮ'=>7,'ᆯ'=>8,'ᆰ'=>9,'ᆱ'=>10,'ᆲ'=>11,'ᆳ'=>12,'ᆴ'=>13,'ᆵ'=>14,'ᆶ'=>15,'ᆷ'=>16,'ᆸ'=>17,'ᆹ'=>18,'ᆺ'=>19,'ᆻ'=>20,'ᆼ'=>21,'ᆽ'=>22,'ᆾ'=>23,'ᆿ'=>24,'ᇀ'=>25,'á‡'=>26,'ᇂ'=>27);
-$GLOBALS['utf_jamo_type']=array('á„€'=>0,'á„'=>0,'á„‚'=>0,'ᄃ'=>0,'á„„'=>0,'á„…'=>0,'ᄆ'=>0,'ᄇ'=>0,'ᄈ'=>0,'ᄉ'=>0,'á„Š'=>0,'á„‹'=>0,'á„Œ'=>0,'á„'=>0,'á„Ž'=>0,'á„'=>0,'á„'=>0,'á„‘'=>0,'á„’'=>0,'á…¡'=>1,'á…¢'=>1,'á…£'=>1,'á…¤'=>1,'á…¥'=>1,'á…¦'=>1,'á…§'=>1,'á…¨'=>1,'á…©'=>1,'á…ª'=>1,'á…«'=>1,'á…¬'=>1,'á…­'=>1,'á…®'=>1,'á…¯'=>1,'á…°'=>1,'á…±'=>1,'á…²'=>1,'á…³'=>1,'á…´'=>1,'á…µ'=>1,'ᆧ'=>2,'ᆨ'=>2,'ᆩ'=>2,'ᆪ'=>2,'ᆫ'=>2,'ᆬ'=>2,'ᆭ'=>2,'ᆮ'=>2,'ᆯ'=>2,'ᆰ'=>2,'ᆱ'=>2,'ᆲ'=>2,'ᆳ'=>2,'ᆴ'=>2,'ᆵ'=>2,'ᆶ'=>2,'ᆷ'=>2,'ᆸ'=>2,'ᆹ'=>2,'ᆺ'=>2,'ᆻ'=>2,'ᆼ'=>2,'ᆽ'=>2,'ᆾ'=>2,'ᆿ'=>2,'ᇀ'=>2,'á‡'=>2,'ᇂ'=>2);
-$GLOBALS['utf_combining_class']=array('Ì€'=>230,'Ì'=>230,'Ì‚'=>230,'̃'=>230,'Ì„'=>230,'Ì…'=>230,'̆'=>230,'̇'=>230,'̈'=>230,'̉'=>230,'ÌŠ'=>230,'Ì‹'=>230,'ÌŒ'=>230,'Ì'=>230,'ÌŽ'=>230,'Ì'=>230,'Ì'=>230,'Ì‘'=>230,'Ì’'=>230,'Ì“'=>230,'Ì”'=>230,'Ì•'=>232,'Ì–'=>220,'Ì—'=>220,'̘'=>220,'Ì™'=>220,'Ìš'=>232,'Ì›'=>216,'Ìœ'=>220,'Ì'=>220,'Ìž'=>220,'ÌŸ'=>220,'Ì '=>220,'Ì¡'=>202,'Ì¢'=>202,'Ì£'=>220,'̤'=>220,'Ì¥'=>220,'̦'=>220,'̧'=>202,'̨'=>202,'Ì©'=>220,'̪'=>220,'Ì«'=>220,'̬'=>220,'Ì­'=>220,'Ì®'=>220,'̯'=>220,'Ì°'=>220,'̱'=>220,'̲'=>220,'̳'=>220,'Ì´'=>1,'̵'=>1,'̶'=>1,'Ì·'=>1,'̸'=>1,'̹'=>220,'̺'=>220,'Ì»'=>220,'̼'=>220,'̽'=>230,'̾'=>230,'Ì¿'=>230,'Í€'=>230,'Í'=>230,'Í‚'=>230,'̓'=>230,'Í„'=>230,'Í…'=>240,'͆'=>230,'͇'=>220,'͈'=>220,'͉'=>220,'ÍŠ'=>230,'Í‹'=>230,'ÍŒ'=>230,'Í'=>220,'ÍŽ'=>220,'Í'=>230,'Í‘'=>230,'Í’'=>230,'Í“'=>220,'Í”'=>220,'Í•'=>220,'Í–'=>220,'Í—'=>230,'͘'=>232,'Í™'=>220,'Íš'=>220,'Í›'=>230,'Íœ'=>233,'Í'=>234,'Íž'=>234,'ÍŸ'=>233,'Í '=>234,'Í¡'=>234,'Í¢'=>233,'Í£'=>230,'ͤ'=>230,'Í¥'=>230,'ͦ'=>230,'ͧ'=>230,'ͨ'=>230,'Í©'=>230,'ͪ'=>230,'Í«'=>230,'ͬ'=>230,'Í­'=>230,'Í®'=>230,'ͯ'=>230,'Òƒ'=>230,'Ò„'=>230,'Ò…'=>230,'Ò†'=>230,'Ö‘'=>220,'Ö’'=>230,'Ö“'=>230,'Ö”'=>230,'Ö•'=>230,'Ö–'=>220,'Ö—'=>230,'Ö˜'=>230,'Ö™'=>230,'Öš'=>222,'Ö›'=>220,'Öœ'=>230,'Ö'=>230,'Öž'=>230,'ÖŸ'=>230,'Ö '=>230,'Ö¡'=>230,'Ö¢'=>220,'Ö£'=>220,'Ö¤'=>220,'Ö¥'=>220,'Ö¦'=>220,'Ö§'=>220,'Ö¨'=>230,'Ö©'=>230,'Öª'=>220,'Ö«'=>230,'Ö¬'=>230,'Ö­'=>222,'Ö®'=>228,'Ö¯'=>230,'Ö°'=>10,'Ö±'=>11,'Ö²'=>12,'Ö³'=>13,'Ö´'=>14,'Öµ'=>15,'Ö¶'=>16,'Ö·'=>17,'Ö¸'=>18,'Ö¹'=>19,'Öº'=>19,'Ö»'=>20,'Ö¼'=>21,'Ö½'=>22,'Ö¿'=>23,'×'=>24,'ׂ'=>25,'ׄ'=>230,'×…'=>220,'ׇ'=>18,'Ø'=>230,'Ø‘'=>230,'Ø’'=>230,'Ø“'=>230,'Ø”'=>230,'Ø•'=>230,'Ù‹'=>27,'ÙŒ'=>28,'Ù'=>29,'ÙŽ'=>30,'Ù'=>31,'Ù'=>32,'Ù‘'=>33,'Ù’'=>34,'Ù“'=>230,'Ù”'=>230,'Ù•'=>220,'Ù–'=>220,'Ù—'=>230,'Ù˜'=>230,'Ù™'=>230,'Ùš'=>230,'Ù›'=>230,'Ùœ'=>220,'Ù'=>230,'Ùž'=>230,'Ù°'=>35,'Û–'=>230,'Û—'=>230,'Û˜'=>230,'Û™'=>230,'Ûš'=>230,'Û›'=>230,'Ûœ'=>230,'ÛŸ'=>230,'Û '=>230,'Û¡'=>230,'Û¢'=>230,'Û£'=>220,'Û¤'=>230,'Û§'=>230,'Û¨'=>230,'Ûª'=>220,'Û«'=>230,'Û¬'=>230,'Û­'=>220,'Ü‘'=>36,'Ü°'=>230,'ܱ'=>220,'ܲ'=>230,'ܳ'=>230,'Ü´'=>220,'ܵ'=>230,'ܶ'=>230,'Ü·'=>220,'ܸ'=>220,'ܹ'=>220,'ܺ'=>230,'Ü»'=>220,'ܼ'=>220,'ܽ'=>230,'ܾ'=>220,'Ü¿'=>230,'Ý€'=>230,'Ý'=>230,'Ý‚'=>220,'݃'=>230,'Ý„'=>220,'Ý…'=>230,'݆'=>220,'݇'=>230,'݈'=>220,'݉'=>230,'ÝŠ'=>230,'ß«'=>230,'߬'=>230,'ß­'=>230,'ß®'=>230,'߯'=>230,'ß°'=>230,'ß±'=>230,'ß²'=>220,'ß³'=>230,'़'=>7,'à¥'=>9,'॑'=>230,'॒'=>220,'॓'=>230,'॔'=>230,'়'=>7,'à§'=>9,'਼'=>7,'à©'=>9,'઼'=>7,'à«'=>9,'଼'=>7,'à­'=>9,'à¯'=>9,'à±'=>9,'ౕ'=>84,'à±–'=>91,'಼'=>7,'à³'=>9,'àµ'=>9,'à·Š'=>9,'ุ'=>103,'ู'=>103,'ฺ'=>9,'่'=>107,'้'=>107,'๊'=>107,'๋'=>107,'ຸ'=>118,'ູ'=>118,'່'=>122,'້'=>122,'໊'=>122,'໋'=>122,'༘'=>220,'༙'=>220,'༵'=>220,'༷'=>220,'༹'=>216,'ཱ'=>129,'ི'=>130,'ུ'=>132,'ེ'=>130,'ཻ'=>130,'ོ'=>130,'ཽ'=>130,'ྀ'=>130,'ྂ'=>230,'ྃ'=>230,'྄'=>9,'྆'=>230,'྇'=>230,'࿆'=>220,'့'=>7,'္'=>9,'áŸ'=>230,'᜔'=>9,'᜴'=>9,'្'=>9,'áŸ'=>230,'ᢩ'=>228,'᤹'=>222,'᤺'=>230,'᤻'=>220,'ᨗ'=>230,'ᨘ'=>220,'᬴'=>7,'á­„'=>9,'á­«'=>230,'á­¬'=>220,'á­­'=>230,'á­®'=>230,'á­¯'=>230,'á­°'=>230,'á­±'=>230,'á­²'=>230,'á­³'=>230,'á·€'=>230,'á·'=>230,'á·‚'=>220,'á·ƒ'=>230,'á·„'=>230,'á·…'=>230,'á·†'=>230,'á·‡'=>230,'á·ˆ'=>230,'á·‰'=>230,'á·Š'=>220,'á·¾'=>230,'á·¿'=>220,'âƒ'=>230,'⃑'=>230,'⃒'=>1,'⃓'=>1,'⃔'=>230,'⃕'=>230,'⃖'=>230,'⃗'=>230,'⃘'=>1,'⃙'=>1,'⃚'=>1,'⃛'=>230,'⃜'=>230,'⃡'=>230,'⃥'=>1,'⃦'=>1,'⃧'=>230,'⃨'=>220,'⃩'=>230,'⃪'=>1,'⃫'=>1,'⃬'=>220,'⃭'=>220,'⃮'=>220,'⃯'=>220,'〪'=>218,'〫'=>228,'〬'=>232,'〭'=>222,'〮'=>224,'〯'=>224,'ã‚™'=>8,'ã‚š'=>8,'ê †'=>9,'ﬞ'=>26,'︠'=>230,'︡'=>230,'︢'=>230,'︣'=>230,'ð¨'=>220,'ð¨'=>230,'ð¨¸'=>230,'ð¨¹'=>1,'ð¨º'=>220,'ð¨¿'=>9,'ð…¥'=>216,'ð…¦'=>216,'ð…§'=>1,'ð…¨'=>1,'ð…©'=>1,'ð…­'=>226,'ð…®'=>216,'ð…¯'=>216,'ð…°'=>216,'ð…±'=>216,'ð…²'=>216,'ð…»'=>220,'ð…¼'=>220,'ð…½'=>220,'ð…¾'=>220,'ð…¿'=>220,'ð†€'=>220,'ð†'=>220,'ð†‚'=>220,'ð†…'=>230,'ð††'=>230,'ð†‡'=>230,'ð†ˆ'=>230,'ð†‰'=>230,'ð†Š'=>220,'ð†‹'=>220,'ð†ª'=>230,'ð†«'=>230,'ð†¬'=>230,'ð†­'=>230,'ð‰‚'=>230,'ð‰ƒ'=>230,'ð‰„'=>230);
diff --git a/phpBB/includes/utf/utf_normalizer.php b/phpBB/includes/utf/utf_normalizer.php
deleted file mode 100644
index bbb23a6617..0000000000
--- a/phpBB/includes/utf/utf_normalizer.php
+++ /dev/null
@@ -1,1509 +0,0 @@
-<?php
-/**
-*
-* This file is part of the phpBB Forum Software package.
-*
-* @copyright (c) phpBB Limited <https://www.phpbb.com>
-* @license GNU General Public License, version 2 (GPL-2.0)
-*
-* For full copyright and license information, please see
-* the docs/CREDITS.txt file.
-*
-*/
-
-/**
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* Some Unicode characters encoded in UTF-8
-*
-* Preserved for compatibility
-*/
-define('UTF8_REPLACEMENT', "\xEF\xBF\xBD");
-define('UTF8_MAX', "\xF4\x8F\xBF\xBF");
-define('UTF8_FFFE', "\xEF\xBF\xBE");
-define('UTF8_FFFF', "\xEF\xBF\xBF");
-define('UTF8_SURROGATE_FIRST', "\xED\xA0\x80");
-define('UTF8_SURROGATE_LAST', "\xED\xBF\xBF");
-define('UTF8_HANGUL_FIRST', "\xEA\xB0\x80");
-define('UTF8_HANGUL_LAST', "\xED\x9E\xA3");
-
-define('UTF8_CJK_FIRST', "\xE4\xB8\x80");
-define('UTF8_CJK_LAST', "\xE9\xBE\xBB");
-define('UTF8_CJK_B_FIRST', "\xF0\xA0\x80\x80");
-define('UTF8_CJK_B_LAST', "\xF0\xAA\x9B\x96");
-
-// Unset global variables
-unset($GLOBALS['utf_jamo_index'], $GLOBALS['utf_jamo_type'], $GLOBALS['utf_nfc_qc'], $GLOBALS['utf_combining_class'], $GLOBALS['utf_canonical_comp'], $GLOBALS['utf_canonical_decomp'], $GLOBALS['utf_nfkc_qc'], $GLOBALS['utf_compatibility_decomp']);
-
-// NFC_QC and NFKC_QC values
-define('UNICODE_QC_MAYBE', 0);
-define('UNICODE_QC_NO', 1);
-
-// Contains all the ASCII characters appearing in UTF-8, sorted by frequency
-define('UTF8_ASCII_RANGE', "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F");
-
-// Contains all the tail bytes that can appear in the composition of a UTF-8 char
-define('UTF8_TRAILING_BYTES', "\xA9\xA0\xA8\x80\xAA\x99\xA7\xBB\xAB\x89\x94\x82\xB4\xA2\xAE\x83\xB0\xB9\xB8\x93\xAF\xBC\xB3\x81\xA4\xB2\x9C\xA1\xB5\xBE\xBD\xBA\x98\xAD\xB1\x84\x95\xA6\xB6\x88\x8D\x90\xB7\xBF\x92\x85\xA5\x97\x8C\x86\xA3\x8E\x9F\x8F\x87\x91\x9D\xAC\x9E\x8B\x96\x9B\x8A\x9A");
-
-// Constants used by the Hangul [de]composition algorithms
-define('UNICODE_HANGUL_SBASE', 0xAC00);
-define('UNICODE_HANGUL_LBASE', 0x1100);
-define('UNICODE_HANGUL_VBASE', 0x1161);
-define('UNICODE_HANGUL_TBASE', 0x11A7);
-define('UNICODE_HANGUL_SCOUNT', 11172);
-define('UNICODE_HANGUL_LCOUNT', 19);
-define('UNICODE_HANGUL_VCOUNT', 21);
-define('UNICODE_HANGUL_TCOUNT', 28);
-define('UNICODE_HANGUL_NCOUNT', 588);
-define('UNICODE_JAMO_L', 0);
-define('UNICODE_JAMO_V', 1);
-define('UNICODE_JAMO_T', 2);
-
-/**
-* Unicode normalization routines
-*/
-class utf_normalizer
-{
- /**
- * Validate, cleanup and normalize a string
- *
- * The ultimate convenience function! Clean up invalid UTF-8 sequences,
- * and convert to Normal Form C, canonical composition.
- *
- * @param string &$str The dirty string
- * @return string The same string, all shiny and cleaned-up
- */
- static function cleanup(&$str)
- {
- // The string below is the list of all autorized characters, sorted by frequency in latin text
- $pos = strspn($str, "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x0D");
- $len = strlen($str);
-
- if ($pos == $len)
- {
- // ASCII strings with no special chars return immediately
- return;
- }
-
- // Note: we do not check for $GLOBALS['utf_canonical_decomp']. It is assumed they are always loaded together
- if (!isset($GLOBALS['utf_nfc_qc']))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_nfc_qc.' . $phpEx);
- }
-
- if (!isset($GLOBALS['utf_canonical_decomp']))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_canonical_decomp.' . $phpEx);
- }
-
- // Replace any byte in the range 0x00..0x1F, except for \r, \n and \t
- // We replace those characters with a 0xFF byte, which is illegal in UTF-8 and will in turn be replaced with a UTF replacement char
- $str = strtr(
- $str,
- "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F",
- "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"
- );
-
- $str = utf_normalizer::recompose($str, $pos, $len, $GLOBALS['utf_nfc_qc'], $GLOBALS['utf_canonical_decomp']);
- }
-
- /**
- * Validate and normalize a UTF string to NFC
- *
- * @param string &$str Unchecked UTF string
- * @return string The string, validated and in normal form
- */
- static function nfc(&$str)
- {
- $pos = strspn($str, UTF8_ASCII_RANGE);
- $len = strlen($str);
-
- if ($pos == $len)
- {
- // ASCII strings return immediately
- return;
- }
-
- if (!isset($GLOBALS['utf_nfc_qc']))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_nfc_qc.' . $phpEx);
- }
-
- if (!isset($GLOBALS['utf_canonical_decomp']))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_canonical_decomp.' . $phpEx);
- }
-
- $str = utf_normalizer::recompose($str, $pos, $len, $GLOBALS['utf_nfc_qc'], $GLOBALS['utf_canonical_decomp']);
- }
-
- /**
- * Validate and normalize a UTF string to NFKC
- *
- * @param string &$str Unchecked UTF string
- * @return string The string, validated and in normal form
- */
- static function nfkc(&$str)
- {
- $pos = strspn($str, UTF8_ASCII_RANGE);
- $len = strlen($str);
-
- if ($pos == $len)
- {
- // ASCII strings return immediately
- return;
- }
-
- if (!isset($GLOBALS['utf_nfkc_qc']))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_nfkc_qc.' . $phpEx);
- }
-
- if (!isset($GLOBALS['utf_compatibility_decomp']))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_compatibility_decomp.' . $phpEx);
- }
-
- $str = utf_normalizer::recompose($str, $pos, $len, $GLOBALS['utf_nfkc_qc'], $GLOBALS['utf_compatibility_decomp']);
- }
-
- /**
- * Validate and normalize a UTF string to NFD
- *
- * @param string &$str Unchecked UTF string
- * @return string The string, validated and in normal form
- */
- static function nfd(&$str)
- {
- $pos = strspn($str, UTF8_ASCII_RANGE);
- $len = strlen($str);
-
- if ($pos == $len)
- {
- // ASCII strings return immediately
- return;
- }
-
- if (!isset($GLOBALS['utf_canonical_decomp']))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_canonical_decomp.' . $phpEx);
- }
-
- $str = utf_normalizer::decompose($str, $pos, $len, $GLOBALS['utf_canonical_decomp']);
- }
-
- /**
- * Validate and normalize a UTF string to NFKD
- *
- * @param string &$str Unchecked UTF string
- * @return string The string, validated and in normal form
- */
- static function nfkd(&$str)
- {
- $pos = strspn($str, UTF8_ASCII_RANGE);
- $len = strlen($str);
-
- if ($pos == $len)
- {
- // ASCII strings return immediately
- return;
- }
-
- if (!isset($GLOBALS['utf_compatibility_decomp']))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_compatibility_decomp.' . $phpEx);
- }
-
- $str = utf_normalizer::decompose($str, $pos, $len, $GLOBALS['utf_compatibility_decomp']);
- }
-
-
- /**
- * Recompose a UTF string
- *
- * @param string $str Unchecked UTF string
- * @param integer $pos Position of the first UTF char (in bytes)
- * @param integer $len Length of the string (in bytes)
- * @param array &$qc Quick-check array, passed by reference but never modified
- * @param array &$decomp_map Decomposition mapping, passed by reference but never modified
- * @return string The string, validated and recomposed
- *
- * @access private
- */
- static function recompose($str, $pos, $len, &$qc, &$decomp_map)
- {
- global $utf_combining_class, $utf_canonical_comp, $utf_jamo_type, $utf_jamo_index;
-
- // Load some commonly-used tables
- if (!isset($utf_jamo_index, $utf_jamo_type, $utf_combining_class))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_normalizer_common.' . $phpEx);
- }
-
- // Load the canonical composition table
- if (!isset($utf_canonical_comp))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_canonical_comp.' . $phpEx);
- }
-
- // Buffer the last ASCII char before the UTF-8 stuff if applicable
- $tmp = '';
- $i = $tmp_pos = $last_cc = 0;
-
- $buffer = ($pos) ? array(++$i => $str[$pos - 1]) : array();
-
- // UTF char length array
- // This array is used to determine the length of a UTF character.
- // Be $c the result of ($str[$pos] & "\xF0") --where $str is the string we're operating on and $pos
- // the position of the cursor--, if $utf_len_mask[$c] does not exist, the byte is an ASCII char.
- // Otherwise, if $utf_len_mask[$c] is greater than 0, we have a the leading byte of a multibyte character
- // whose length is $utf_len_mask[$c] and if it is equal to 0, the byte is a trailing byte.
- $utf_len_mask = array(
- // Leading bytes masks
- "\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4,
- // Trailing bytes masks
- "\x80" => 0, "\x90" => 0, "\xA0" => 0, "\xB0" => 0
- );
-
- $extra_check = array(
- "\xED" => 1, "\xEF" => 1, "\xC0" => 1, "\xC1" => 1, "\xE0" => 1, "\xF0" => 1,
- "\xF4" => 1, "\xF5" => 1, "\xF6" => 1, "\xF7" => 1, "\xF8" => 1, "\xF9" => 1,
- "\xFA" => 1, "\xFB" => 1, "\xFC" => 1, "\xFD" => 1, "\xFE" => 1, "\xFF" => 1
- );
-
- $utf_validation_mask = array(
- 2 => "\xE0\xC0",
- 3 => "\xF0\xC0\xC0",
- 4 => "\xF8\xC0\xC0\xC0"
- );
-
- $utf_validation_check = array(
- 2 => "\xC0\x80",
- 3 => "\xE0\x80\x80",
- 4 => "\xF0\x80\x80\x80"
- );
-
- // Main loop
- do
- {
- // STEP 0: Capture the current char and buffer it
- $c = $str[$pos];
- $c_mask = $c & "\xF0";
-
- if (isset($utf_len_mask[$c_mask]))
- {
- // Byte at $pos is either a leading byte or a missplaced trailing byte
- if ($utf_len = $utf_len_mask[$c_mask])
- {
- // Capture the char
- $buffer[++$i & 7] = $utf_char = substr($str, $pos, $utf_len);
-
- // Let's find out if a thorough check is needed
- if (isset($qc[$utf_char]))
- {
- // If the UTF char is in the qc array then it may not be in normal form. We do nothing here, the actual processing is below this "if" block
- }
- else if (isset($utf_combining_class[$utf_char]))
- {
- if ($utf_combining_class[$utf_char] < $last_cc)
- {
- // A combining character that is NOT canonically ordered
- }
- else
- {
- // A combining character that IS canonically ordered, skip to the next char
- $last_cc = $utf_combining_class[$utf_char];
-
- $pos += $utf_len;
- continue;
- }
- }
- else
- {
- // At this point, $utf_char holds a UTF char that we know is not a NF[K]C_QC and is not a combining character.
- // It can be a singleton, a canonical composite, a replacement char or an even an ill-formed bunch of bytes. Let's find out
- $last_cc = 0;
-
- // Check that we have the correct number of trailing bytes
- if (($utf_char & $utf_validation_mask[$utf_len]) != $utf_validation_check[$utf_len])
- {
- // Current char isn't well-formed or legal: either one or several trailing bytes are missing, or the Unicode char
- // has been encoded in a five- or six- byte sequence
- if ($utf_char[0] >= "\xF8")
- {
- if ($utf_char[0] < "\xFC")
- {
- $trailing_bytes = 4;
- }
- else if ($utf_char[0] > "\xFD")
- {
- $trailing_bytes = 0;
- }
- else
- {
- $trailing_bytes = 5;
- }
- }
- else
- {
- $trailing_bytes = $utf_len - 1;
- }
-
- $tmp .= substr($str, $tmp_pos, $pos - $tmp_pos) . UTF8_REPLACEMENT;
- $pos += strspn($str, UTF8_TRAILING_BYTES, ++$pos, $trailing_bytes);
- $tmp_pos = $pos;
-
- continue;
- }
-
- if (isset($extra_check[$c]))
- {
- switch ($c)
- {
- // Note: 0xED is quite common in Korean
- case "\xED":
- if ($utf_char >= "\xED\xA0\x80")
- {
- // Surrogates (U+D800..U+DFFF) are not allowed in UTF-8 (UTF sequence 0xEDA080..0xEDBFBF)
- $tmp .= substr($str, $tmp_pos, $pos - $tmp_pos) . UTF8_REPLACEMENT;
- $pos += $utf_len;
- $tmp_pos = $pos;
- continue 2;
- }
- break;
-
- // Note: 0xEF is quite common in Japanese
- case "\xEF":
- if ($utf_char == "\xEF\xBF\xBE" || $utf_char == "\xEF\xBF\xBF")
- {
- // U+FFFE and U+FFFF are explicitly disallowed (UTF sequence 0xEFBFBE..0xEFBFBF)
- $tmp .= substr($str, $tmp_pos, $pos - $tmp_pos) . UTF8_REPLACEMENT;
- $pos += $utf_len;
- $tmp_pos = $pos;
- continue 2;
- }
- break;
-
- case "\xC0":
- case "\xC1":
- if ($utf_char <= "\xC1\xBF")
- {
- // Overlong sequence: Unicode char U+0000..U+007F encoded as a double-byte UTF char
- $tmp .= substr($str, $tmp_pos, $pos - $tmp_pos) . UTF8_REPLACEMENT;
- $pos += $utf_len;
- $tmp_pos = $pos;
- continue 2;
- }
- break;
-
- case "\xE0":
- if ($utf_char <= "\xE0\x9F\xBF")
- {
- // Unicode char U+0000..U+07FF encoded in 3 bytes
- $tmp .= substr($str, $tmp_pos, $pos - $tmp_pos) . UTF8_REPLACEMENT;
- $pos += $utf_len;
- $tmp_pos = $pos;
- continue 2;
- }
- break;
-
- case "\xF0":
- if ($utf_char <= "\xF0\x8F\xBF\xBF")
- {
- // Unicode char U+0000..U+FFFF encoded in 4 bytes
- $tmp .= substr($str, $tmp_pos, $pos - $tmp_pos) . UTF8_REPLACEMENT;
- $pos += $utf_len;
- $tmp_pos = $pos;
- continue 2;
- }
- break;
-
- default:
- // Five- and six- byte sequences do not need being checked for here anymore
- if ($utf_char > UTF8_MAX)
- {
- // Out of the Unicode range
- if ($utf_char[0] < "\xF8")
- {
- $trailing_bytes = 3;
- }
- else if ($utf_char[0] < "\xFC")
- {
- $trailing_bytes = 4;
- }
- else if ($utf_char[0] > "\xFD")
- {
- $trailing_bytes = 0;
- }
- else
- {
- $trailing_bytes = 5;
- }
-
- $tmp .= substr($str, $tmp_pos, $pos - $tmp_pos) . UTF8_REPLACEMENT;
- $pos += strspn($str, UTF8_TRAILING_BYTES, ++$pos, $trailing_bytes);
- $tmp_pos = $pos;
- continue 2;
- }
- break;
- }
- }
-
- // The char is a valid starter, move the cursor and go on
- $pos += $utf_len;
- continue;
- }
- }
- else
- {
- // A trailing byte came out of nowhere, we will advance the cursor and treat the this byte and all following trailing bytes as if
- // each of them was a Unicode replacement char
- $spn = strspn($str, UTF8_TRAILING_BYTES, $pos);
- $tmp .= substr($str, $tmp_pos, $pos - $tmp_pos) . str_repeat(UTF8_REPLACEMENT, $spn);
-
- $pos += $spn;
- $tmp_pos = $pos;
- continue;
- }
-
- // STEP 1: Decompose current char
-
- // We have found a character that is either:
- // - in the NFC_QC/NFKC_QC list
- // - a non-starter char that is not canonically ordered
- //
- // We are going to capture the shortest UTF sequence that satisfies these two conditions:
- //
- // 1 - If the sequence does not start at the begginning of the string, it must begin with a starter,
- // and that starter must not have the NF[K]C_QC property equal to "MAYBE"
- //
- // 2 - If the sequence does not end at the end of the string, it must end with a non-starter and be
- // immediately followed by a starter that is not on the QC list
- //
- $utf_seq = array();
- $last_cc = 0;
- $lpos = $pos;
- $pos += $utf_len;
-
- if (isset($decomp_map[$utf_char]))
- {
- $_pos = 0;
- $_len = strlen($decomp_map[$utf_char]);
-
- do
- {
- $_utf_len =& $utf_len_mask[$decomp_map[$utf_char][$_pos] & "\xF0"];
-
- if (isset($_utf_len))
- {
- $utf_seq[] = substr($decomp_map[$utf_char], $_pos, $_utf_len);
- $_pos += $_utf_len;
- }
- else
- {
- $utf_seq[] = $decomp_map[$utf_char][$_pos];
- ++$_pos;
- }
- }
- while ($_pos < $_len);
- }
- else
- {
- // The char is not decomposable
- $utf_seq = array($utf_char);
- }
-
- // STEP 2: Capture the starter
-
- // Check out the combining class of the first character of the UTF sequence
- $k = 0;
- if (isset($utf_combining_class[$utf_seq[0]]) || $qc[$utf_char] == UNICODE_QC_MAYBE)
- {
- // Not a starter, inspect previous characters
- // The last 8 characters are kept in a buffer so that we don't have to capture them everytime.
- // This is enough for all real-life strings but even if it wasn't, we can capture characters in backward mode,
- // although it is slower than this method.
- //
- // In the following loop, $j starts at the previous buffered character ($i - 1, because current character is
- // at offset $i) and process them in backward mode until we find a starter.
- //
- // $k is the index on each UTF character inside of our UTF sequence. At this time, $utf_seq contains one or more
- // characters numbered 0 to n. $k starts at 0 and for each char we prepend we pre-decrement it and for numbering
- $starter_found = 0;
- $j_min = max(1, $i - 7);
-
- for ($j = $i - 1; $j >= $j_min && $lpos > $tmp_pos; --$j)
- {
- $utf_char = $buffer[$j & 7];
- $lpos -= strlen($utf_char);
-
- if (isset($decomp_map[$utf_char]))
- {
- // The char is a composite, decompose for storage
- $decomp_seq = array();
- $_pos = 0;
- $_len = strlen($decomp_map[$utf_char]);
-
- do
- {
- $c = $decomp_map[$utf_char][$_pos];
- $_utf_len =& $utf_len_mask[$c & "\xF0"];
-
- if (isset($_utf_len))
- {
- $decomp_seq[] = substr($decomp_map[$utf_char], $_pos, $_utf_len);
- $_pos += $_utf_len;
- }
- else
- {
- $decomp_seq[] = $c;
- ++$_pos;
- }
- }
- while ($_pos < $_len);
-
- // Prepend the UTF sequence with our decomposed sequence
- if (isset($decomp_seq[1]))
- {
- // The char expanded into several chars
- $decomp_cnt = sizeof($decomp_seq);
-
- foreach ($decomp_seq as $decomp_i => $decomp_char)
- {
- $utf_seq[$k + $decomp_i - $decomp_cnt] = $decomp_char;
- }
- $k -= $decomp_cnt;
- }
- else
- {
- // Decomposed to a single char, easier to prepend
- $utf_seq[--$k] = $decomp_seq[0];
- }
- }
- else
- {
- $utf_seq[--$k] = $utf_char;
- }
-
- if (!isset($utf_combining_class[$utf_seq[$k]]))
- {
- // We have found our starter
- $starter_found = 1;
- break;
- }
- }
-
- if (!$starter_found && $lpos > $tmp_pos)
- {
- // The starter was not found in the buffer, let's rewind some more
- do
- {
- // $utf_len_mask contains the masks of both leading bytes and trailing bytes. If $utf_en > 0 then it's a leading byte, otherwise it's a trailing byte.
- $c = $str[--$lpos];
- $c_mask = $c & "\xF0";
-
- if (isset($utf_len_mask[$c_mask]))
- {
- // UTF byte
- if ($utf_len = $utf_len_mask[$c_mask])
- {
- // UTF *leading* byte
- $utf_char = substr($str, $lpos, $utf_len);
-
- if (isset($decomp_map[$utf_char]))
- {
- // Decompose the character
- $decomp_seq = array();
- $_pos = 0;
- $_len = strlen($decomp_map[$utf_char]);
-
- do
- {
- $c = $decomp_map[$utf_char][$_pos];
- $_utf_len =& $utf_len_mask[$c & "\xF0"];
-
- if (isset($_utf_len))
- {
- $decomp_seq[] = substr($decomp_map[$utf_char], $_pos, $_utf_len);
- $_pos += $_utf_len;
- }
- else
- {
- $decomp_seq[] = $c;
- ++$_pos;
- }
- }
- while ($_pos < $_len);
-
- // Prepend the UTF sequence with our decomposed sequence
- if (isset($decomp_seq[1]))
- {
- // The char expanded into several chars
- $decomp_cnt = sizeof($decomp_seq);
- foreach ($decomp_seq as $decomp_i => $utf_char)
- {
- $utf_seq[$k + $decomp_i - $decomp_cnt] = $utf_char;
- }
- $k -= $decomp_cnt;
- }
- else
- {
- // Decomposed to a single char, easier to prepend
- $utf_seq[--$k] = $decomp_seq[0];
- }
- }
- else
- {
- $utf_seq[--$k] = $utf_char;
- }
- }
- }
- else
- {
- // ASCII char
- $utf_seq[--$k] = $c;
- }
- }
- while ($lpos > $tmp_pos);
- }
- }
-
- // STEP 3: Capture following combining modifiers
-
- while ($pos < $len)
- {
- $c_mask = $str[$pos] & "\xF0";
-
- if (isset($utf_len_mask[$c_mask]))
- {
- if ($utf_len = $utf_len_mask[$c_mask])
- {
- $utf_char = substr($str, $pos, $utf_len);
- }
- else
- {
- // A trailing byte came out of nowhere
- // Trailing bytes are replaced with Unicode replacement chars, we will just ignore it for now, break out of the loop
- // as if it was a starter (replacement chars ARE starters) and let the next loop replace it
- break;
- }
-
- if (isset($utf_combining_class[$utf_char]) || isset($qc[$utf_char]))
- {
- // Combining character, add it to the sequence and move the cursor
- if (isset($decomp_map[$utf_char]))
- {
- // Decompose the character
- $_pos = 0;
- $_len = strlen($decomp_map[$utf_char]);
-
- do
- {
- $c = $decomp_map[$utf_char][$_pos];
- $_utf_len =& $utf_len_mask[$c & "\xF0"];
-
- if (isset($_utf_len))
- {
- $utf_seq[] = substr($decomp_map[$utf_char], $_pos, $_utf_len);
- $_pos += $_utf_len;
- }
- else
- {
- $utf_seq[] = $c;
- ++$_pos;
- }
- }
- while ($_pos < $_len);
- }
- else
- {
- $utf_seq[] = $utf_char;
- }
-
- $pos += $utf_len;
- }
- else
- {
- // Combining class 0 and no QC, break out of the loop
- // Note: we do not know if that character is valid. If it's not, the next iteration will replace it
- break;
- }
- }
- else
- {
- // ASCII chars are starters
- break;
- }
- }
-
- // STEP 4: Sort and combine
-
- // Here we sort...
- $k_max = $k + sizeof($utf_seq);
-
- if (!$k && $k_max == 1)
- {
- // There is only one char in the UTF sequence, add it then jump to the next iteration of main loop
- // Note: the two commented lines below can be enabled under PHP5 for a very small performance gain in most cases
-// if (substr_compare($str, $utf_seq[0], $lpos, $pos - $lpos))
-// {
- $tmp .= substr($str, $tmp_pos, $lpos - $tmp_pos) . $utf_seq[0];
- $tmp_pos = $pos;
-// }
-
- continue;
- }
-
- // ...there we combine
- if (isset($utf_combining_class[$utf_seq[$k]]))
- {
- $starter = $nf_seq = '';
- }
- else
- {
- $starter = $utf_seq[$k++];
- $nf_seq = '';
- }
- $utf_sort = array();
-
- // We add an empty char at the end of the UTF char sequence. It will act as a starter and trigger the sort/combine routine
- // at the end of the string without altering it
- $utf_seq[] = '';
-
- do
- {
- $utf_char = $utf_seq[$k++];
-
- if (isset($utf_combining_class[$utf_char]))
- {
- $utf_sort[$utf_combining_class[$utf_char]][] = $utf_char;
- }
- else
- {
- if (empty($utf_sort))
- {
- // No combining characters... check for a composite of the two starters
- if (isset($utf_canonical_comp[$starter . $utf_char]))
- {
- // Good ol' composite character
- $starter = $utf_canonical_comp[$starter . $utf_char];
- }
- else if (isset($utf_jamo_type[$utf_char]))
- {
- // Current char is a composable jamo
- if (isset($utf_jamo_type[$starter]) && $utf_jamo_type[$starter] == UNICODE_JAMO_L && $utf_jamo_type[$utf_char] == UNICODE_JAMO_V)
- {
- // We have a L jamo followed by a V jamo, we are going to prefetch the next char to see if it's a T jamo
- if (isset($utf_jamo_type[$utf_seq[$k]]) && $utf_jamo_type[$utf_seq[$k]] == UNICODE_JAMO_T)
- {
- // L+V+T jamos, combine to a LVT Hangul syllable ($k is incremented)
- $cp = $utf_jamo_index[$starter] + $utf_jamo_index[$utf_char] + $utf_jamo_index[$utf_seq[$k]];
- ++$k;
- }
- else
- {
- // L+V jamos, combine to a LV Hangul syllable
- $cp = $utf_jamo_index[$starter] + $utf_jamo_index[$utf_char];
- }
-
- $starter = chr(0xE0 | ($cp >> 12)) . chr(0x80 | (($cp >> 6) & 0x3F)) . chr(0x80 | ($cp & 0x3F));
- }
- else
- {
- // Non-composable jamo, just add it to the sequence
- $nf_seq .= $starter;
- $starter = $utf_char;
- }
- }
- else
- {
- // No composite, just add the first starter to the sequence then continue with the other one
- $nf_seq .= $starter;
- $starter = $utf_char;
- }
- }
- else
- {
- ksort($utf_sort);
-
- // For each class of combining characters
- foreach ($utf_sort as $cc => $utf_chars)
- {
- $j = 0;
-
- do
- {
- // Look for a composite
- if (isset($utf_canonical_comp[$starter . $utf_chars[$j]]))
- {
- // Found a composite, replace the starter
- $starter = $utf_canonical_comp[$starter . $utf_chars[$j]];
- unset($utf_sort[$cc][$j]);
- }
- else
- {
- // No composite, all following characters in that class are blocked
- break;
- }
- }
- while (isset($utf_sort[$cc][++$j]));
- }
-
- // Add the starter to the normalized sequence, followed by non-starters in canonical order
- $nf_seq .= $starter;
-
- foreach ($utf_sort as $utf_chars)
- {
- if (!empty($utf_chars))
- {
- $nf_seq .= implode('', $utf_chars);
- }
- }
-
- // Reset the array and go on
- $utf_sort = array();
- $starter = $utf_char;
- }
- }
- }
- while ($k <= $k_max);
-
- $tmp .= substr($str, $tmp_pos, $lpos - $tmp_pos) . $nf_seq;
- $tmp_pos = $pos;
- }
- else
- {
- // Only a ASCII char can make the program get here
- //
- // First we skip the current byte with ++$pos, then we quickly skip following ASCII chars with strspn().
- //
- // The first two "if"'s here can be removed, with the consequences of being faster on latin text (lots of ASCII) and slower on
- // multi-byte text (where the only ASCII chars are spaces and punctuation)
- if (++$pos != $len)
- {
- if ($str[$pos] < "\x80")
- {
- $pos += strspn($str, UTF8_ASCII_RANGE, ++$pos);
- $buffer[++$i & 7] = $str[$pos - 1];
- }
- else
- {
- $buffer[++$i & 7] = $c;
- }
- }
- }
- }
- while ($pos < $len);
-
- // Now is time to return the string
- if ($tmp_pos)
- {
- // If the $tmp_pos cursor is not at the beggining of the string then at least one character was not in normal form. Replace $str with the fixed version
- if ($tmp_pos == $len)
- {
- // The $tmp_pos cursor is at the end of $str, therefore $tmp holds the whole $str
- return $tmp;
- }
- else
- {
- // The rightmost chunk of $str has not been appended to $tmp yet
- return $tmp . substr($str, $tmp_pos);
- }
- }
-
- // The string was already in normal form
- return $str;
- }
-
- /**
- * Decompose a UTF string
- *
- * @param string $str UTF string
- * @param integer $pos Position of the first UTF char (in bytes)
- * @param integer $len Length of the string (in bytes)
- * @param array &$decomp_map Decomposition mapping, passed by reference but never modified
- * @return string The string, decomposed and sorted canonically
- *
- * @access private
- */
- static function decompose($str, $pos, $len, &$decomp_map)
- {
- global $utf_combining_class;
-
- // Load some commonly-used tables
- if (!isset($utf_combining_class))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_normalizer_common.' . $phpEx);
- }
-
- // UTF char length array
- $utf_len_mask = array(
- // Leading bytes masks
- "\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4,
- // Trailing bytes masks
- "\x80" => 0, "\x90" => 0, "\xA0" => 0, "\xB0" => 0
- );
-
- // Some extra checks are triggered on the first byte of a UTF sequence
- $extra_check = array(
- "\xED" => 1, "\xEF" => 1, "\xC0" => 1, "\xC1" => 1, "\xE0" => 1, "\xF0" => 1,
- "\xF4" => 1, "\xF5" => 1, "\xF6" => 1, "\xF7" => 1, "\xF8" => 1, "\xF9" => 1,
- "\xFA" => 1, "\xFB" => 1, "\xFC" => 1, "\xFD" => 1, "\xFE" => 1, "\xFF" => 1
- );
-
- // These masks are used to check if a UTF sequence is well formed. Here are the only 3 lengths we acknowledge:
- // - 2-byte: 110? ???? 10?? ????
- // - 3-byte: 1110 ???? 10?? ???? 10?? ????
- // - 4-byte: 1111 0??? 10?? ???? 10?? ???? 10?? ????
- // Note that 5- and 6- byte sequences are automatically discarded
- $utf_validation_mask = array(
- 2 => "\xE0\xC0",
- 3 => "\xF0\xC0\xC0",
- 4 => "\xF8\xC0\xC0\xC0"
- );
-
- $utf_validation_check = array(
- 2 => "\xC0\x80",
- 3 => "\xE0\x80\x80",
- 4 => "\xF0\x80\x80\x80"
- );
-
- $tmp = '';
- $starter_pos = $pos;
- $tmp_pos = $last_cc = $sort = $dump = 0;
- $utf_sort = array();
-
- // Main loop
- do
- {
- // STEP 0: Capture the current char
-
- $cur_mask = $str[$pos] & "\xF0";
- if (isset($utf_len_mask[$cur_mask]))
- {
- if ($utf_len = $utf_len_mask[$cur_mask])
- {
- // Multibyte char
- $utf_char = substr($str, $pos, $utf_len);
- $pos += $utf_len;
- }
- else
- {
- // A trailing byte came out of nowhere, we will treat it and all following trailing bytes as if each of them was a Unicode
- // replacement char and we will advance the cursor
- $spn = strspn($str, UTF8_TRAILING_BYTES, $pos);
-
- if ($dump)
- {
- $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos);
-
- // Dump combiners
- if (!empty($utf_sort))
- {
- if ($sort)
- {
- ksort($utf_sort);
- }
-
- foreach ($utf_sort as $utf_chars)
- {
- $tmp .= implode('', $utf_chars);
- }
- }
-
- $tmp .= str_repeat(UTF8_REPLACEMENT, $spn);
- $dump = $sort = 0;
- }
- else
- {
- $tmp .= substr($str, $tmp_pos, $pos - $tmp_pos) . str_repeat(UTF8_REPLACEMENT, $spn);
- }
-
- $pos += $spn;
- $tmp_pos = $starter_pos = $pos;
-
- $utf_sort = array();
- $last_cc = 0;
-
- continue;
- }
-
- // STEP 1: Decide what to do with current char
-
- // Now, in that order:
- // - check if that character is decomposable
- // - check if that character is a non-starter
- // - check if that character requires extra checks to be performed
- if (isset($decomp_map[$utf_char]))
- {
- // Decompose the char
- $_pos = 0;
- $_len = strlen($decomp_map[$utf_char]);
-
- do
- {
- $c = $decomp_map[$utf_char][$_pos];
- $_utf_len =& $utf_len_mask[$c & "\xF0"];
-
- if (isset($_utf_len))
- {
- $_utf_char = substr($decomp_map[$utf_char], $_pos, $_utf_len);
- $_pos += $_utf_len;
-
- if (isset($utf_combining_class[$_utf_char]))
- {
- // The character decomposed to a non-starter, buffer it for sorting
- $utf_sort[$utf_combining_class[$_utf_char]][] = $_utf_char;
-
- if ($utf_combining_class[$_utf_char] < $last_cc)
- {
- // Not canonically ordered, will require sorting
- $sort = $dump = 1;
- }
- else
- {
- $dump = 1;
- $last_cc = $utf_combining_class[$_utf_char];
- }
- }
- else
- {
- // This character decomposition contains a starter, dump the buffer and continue
- if ($dump)
- {
- $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos);
-
- // Dump combiners
- if (!empty($utf_sort))
- {
- if ($sort)
- {
- ksort($utf_sort);
- }
-
- foreach ($utf_sort as $utf_chars)
- {
- $tmp .= implode('', $utf_chars);
- }
- }
-
- $tmp .= $_utf_char;
- $dump = $sort = 0;
- }
- else
- {
- $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos) . $_utf_char;
- }
-
- $tmp_pos = $starter_pos = $pos;
- $utf_sort = array();
- $last_cc = 0;
- }
- }
- else
- {
- // This character decomposition contains an ASCII char, which is a starter. Dump the buffer and continue
- ++$_pos;
-
- if ($dump)
- {
- $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos);
-
- // Dump combiners
- if (!empty($utf_sort))
- {
- if ($sort)
- {
- ksort($utf_sort);
- }
-
- foreach ($utf_sort as $utf_chars)
- {
- $tmp .= implode('', $utf_chars);
- }
- }
-
- $tmp .= $c;
- $dump = $sort = 0;
- }
- else
- {
- $tmp .= substr($str, $tmp_pos, $pos - $utf_len - $tmp_pos) . $c;
- }
-
- $tmp_pos = $starter_pos = $pos;
- $utf_sort = array();
- $last_cc = 0;
- }
- }
- while ($_pos < $_len);
- }
- else if (isset($utf_combining_class[$utf_char]))
- {
- // Combining character
- if ($utf_combining_class[$utf_char] < $last_cc)
- {
- // Not in canonical order
- $sort = $dump = 1;
- }
- else
- {
- $last_cc = $utf_combining_class[$utf_char];
- }
-
- $utf_sort[$utf_combining_class[$utf_char]][] = $utf_char;
- }
- else
- {
- // Non-decomposable starter, check out if it's a Hangul syllable
- if ($utf_char < UTF8_HANGUL_FIRST || $utf_char > UTF8_HANGUL_LAST)
- {
- // Nope, regular UTF char, check that we have the correct number of trailing bytes
- if (($utf_char & $utf_validation_mask[$utf_len]) != $utf_validation_check[$utf_len])
- {
- // Current char isn't well-formed or legal: either one or several trailing bytes are missing, or the Unicode char
- // has been encoded in a five- or six- byte sequence.
- // Move the cursor back to its original position then advance it to the position it should really be at
- $pos -= $utf_len;
- $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos);
-
- if (!empty($utf_sort))
- {
- ksort($utf_sort);
-
- foreach ($utf_sort as $utf_chars)
- {
- $tmp .= implode('', $utf_chars);
- }
- $utf_sort = array();
- }
-
- // Add a replacement char then another replacement char for every trailing byte.
- //
- // @todo I'm not entirely sure that's how we're supposed to mark invalidated byte sequences, check this
- $spn = strspn($str, UTF8_TRAILING_BYTES, ++$pos);
- $tmp .= str_repeat(UTF8_REPLACEMENT, $spn + 1);
-
- $dump = $sort = 0;
-
- $pos += $spn;
- $tmp_pos = $pos;
- continue;
- }
-
- if (isset($extra_check[$utf_char[0]]))
- {
- switch ($utf_char[0])
- {
- // Note: 0xED is quite common in Korean
- case "\xED":
- if ($utf_char >= "\xED\xA0\x80")
- {
- // Surrogates (U+D800..U+DFFF) are not allowed in UTF-8 (UTF sequence 0xEDA080..0xEDBFBF)
- $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos);
-
- if (!empty($utf_sort))
- {
- ksort($utf_sort);
-
- foreach ($utf_sort as $utf_chars)
- {
- $tmp .= implode('', $utf_chars);
- }
- $utf_sort = array();
- }
-
- $tmp .= UTF8_REPLACEMENT;
- $dump = $sort = 0;
-
- $tmp_pos = $starter_pos = $pos;
- continue 2;
- }
- break;
-
- // Note: 0xEF is quite common in Japanese
- case "\xEF":
- if ($utf_char == "\xEF\xBF\xBE" || $utf_char == "\xEF\xBF\xBF")
- {
- // U+FFFE and U+FFFF are explicitly disallowed (UTF sequence 0xEFBFBE..0xEFBFBF)
- $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos);
-
- if (!empty($utf_sort))
- {
- ksort($utf_sort);
-
- foreach ($utf_sort as $utf_chars)
- {
- $tmp .= implode('', $utf_chars);
- }
- $utf_sort = array();
- }
-
- $tmp .= UTF8_REPLACEMENT;
- $dump = $sort = 0;
-
- $tmp_pos = $starter_pos = $pos;
- continue 2;
- }
- break;
-
- case "\xC0":
- case "\xC1":
- if ($utf_char <= "\xC1\xBF")
- {
- // Overlong sequence: Unicode char U+0000..U+007F encoded as a double-byte UTF char
- $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos);
-
- if (!empty($utf_sort))
- {
- ksort($utf_sort);
-
- foreach ($utf_sort as $utf_chars)
- {
- $tmp .= implode('', $utf_chars);
- }
- $utf_sort = array();
- }
-
- $tmp .= UTF8_REPLACEMENT;
- $dump = $sort = 0;
-
- $tmp_pos = $starter_pos = $pos;
- continue 2;
- }
- break;
-
- case "\xE0":
- if ($utf_char <= "\xE0\x9F\xBF")
- {
- // Unicode char U+0000..U+07FF encoded in 3 bytes
- $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos);
-
- if (!empty($utf_sort))
- {
- ksort($utf_sort);
-
- foreach ($utf_sort as $utf_chars)
- {
- $tmp .= implode('', $utf_chars);
- }
- $utf_sort = array();
- }
-
- $tmp .= UTF8_REPLACEMENT;
- $dump = $sort = 0;
-
- $tmp_pos = $starter_pos = $pos;
- continue 2;
- }
- break;
-
- case "\xF0":
- if ($utf_char <= "\xF0\x8F\xBF\xBF")
- {
- // Unicode char U+0000..U+FFFF encoded in 4 bytes
- $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos);
-
- if (!empty($utf_sort))
- {
- ksort($utf_sort);
-
- foreach ($utf_sort as $utf_chars)
- {
- $tmp .= implode('', $utf_chars);
- }
- $utf_sort = array();
- }
-
- $tmp .= UTF8_REPLACEMENT;
- $dump = $sort = 0;
-
- $tmp_pos = $starter_pos = $pos;
- continue 2;
- }
- break;
-
- default:
- if ($utf_char > UTF8_MAX)
- {
- // Out of the Unicode range
- $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos);
-
- if (!empty($utf_sort))
- {
- ksort($utf_sort);
-
- foreach ($utf_sort as $utf_chars)
- {
- $tmp .= implode('', $utf_chars);
- }
- $utf_sort = array();
- }
-
- $tmp .= UTF8_REPLACEMENT;
- $dump = $sort = 0;
-
- $tmp_pos = $starter_pos = $pos;
- continue 2;
- }
- break;
- }
- }
- }
- else
- {
- // Hangul syllable
- $idx = (((ord($utf_char[0]) & 0x0F) << 12) | ((ord($utf_char[1]) & 0x3F) << 6) | (ord($utf_char[2]) & 0x3F)) - UNICODE_HANGUL_SBASE;
-
- // LIndex can only range from 0 to 18, therefore it cannot influence the first two bytes of the L Jamo, which allows us to hardcode them (based on LBase).
- //
- // The same goes for VIndex, but for TIndex there's a catch: the value of the third byte could exceed 0xBF and we would have to increment the second byte
- if ($t_index = $idx % UNICODE_HANGUL_TCOUNT)
- {
- if ($t_index < 25)
- {
- $utf_char = "\xE1\x84\x00\xE1\x85\x00\xE1\x86\x00";
- $utf_char[8] = chr(0xA7 + $t_index);
- }
- else
- {
- $utf_char = "\xE1\x84\x00\xE1\x85\x00\xE1\x87\x00";
- $utf_char[8] = chr(0x67 + $t_index);
- }
- }
- else
- {
- $utf_char = "\xE1\x84\x00\xE1\x85\x00";
- }
-
- $utf_char[2] = chr(0x80 + (int) ($idx / UNICODE_HANGUL_NCOUNT));
- $utf_char[5] = chr(0xA1 + (int) (($idx % UNICODE_HANGUL_NCOUNT) / UNICODE_HANGUL_TCOUNT));
-
- // Just like other decompositions, the resulting Jamos must be dumped to the tmp string
- $dump = 1;
- }
-
- // Do we need to dump stuff to the tmp string?
- if ($dump)
- {
- $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos);
-
- // Dump combiners
- if (!empty($utf_sort))
- {
- if ($sort)
- {
- ksort($utf_sort);
- }
-
- foreach ($utf_sort as $utf_chars)
- {
- $tmp .= implode('', $utf_chars);
- }
- }
-
- $tmp .= $utf_char;
- $dump = $sort = 0;
- $tmp_pos = $pos;
- }
-
- $last_cc = 0;
- $utf_sort = array();
- $starter_pos = $pos;
- }
- }
- else
- {
- // ASCII char, which happens to be a starter (as any other ASCII char)
- if ($dump)
- {
- $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos);
-
- // Dump combiners
- if (!empty($utf_sort))
- {
- if ($sort)
- {
- ksort($utf_sort);
- }
-
- foreach ($utf_sort as $utf_chars)
- {
- $tmp .= implode('', $utf_chars);
- }
- }
-
- $tmp .= $str[$pos];
- $dump = $sort = 0;
- $tmp_pos = ++$pos;
-
- $pos += strspn($str, UTF8_ASCII_RANGE, $pos);
- }
- else
- {
- $pos += strspn($str, UTF8_ASCII_RANGE, ++$pos);
- }
-
- $last_cc = 0;
- $utf_sort = array();
- $starter_pos = $pos;
- }
- }
- while ($pos < $len);
-
- // Now is time to return the string
- if ($dump)
- {
- $tmp .= substr($str, $tmp_pos, $starter_pos - $tmp_pos);
-
- // Dump combiners
- if (!empty($utf_sort))
- {
- if ($sort)
- {
- ksort($utf_sort);
- }
-
- foreach ($utf_sort as $utf_chars)
- {
- $tmp .= implode('', $utf_chars);
- }
- }
-
- return $tmp;
- }
- else if ($tmp_pos)
- {
- // If the $tmp_pos cursor was moved then at least one character was not in normal form. Replace $str with the fixed version
- if ($tmp_pos == $len)
- {
- // The $tmp_pos cursor is at the end of $str, therefore $tmp holds the whole $str
- return $tmp;
- }
- else
- {
- // The rightmost chunk of $str has not been appended to $tmp yet
- return $tmp . substr($str, $tmp_pos);
- }
- }
-
- // The string was already in normal form
- return $str;
- }
-}
diff --git a/phpBB/includes/utf/utf_tools.php b/phpBB/includes/utf/utf_tools.php
index e60a40a195..da241b2cbd 100644
--- a/phpBB/includes/utf/utf_tools.php
+++ b/phpBB/includes/utf/utf_tools.php
@@ -22,6 +22,13 @@ if (!defined('IN_PHPBB'))
setlocale(LC_CTYPE, 'C');
/**
+* Setup the UTF-8 portability layer
+*/
+Patchwork\Utf8\Bootup::initUtf8Encode();
+Patchwork\Utf8\Bootup::initMbstring();
+Patchwork\Utf8\Bootup::initIntl();
+
+/**
* UTF-8 tools
*
* Whenever possible, these functions will try to use PHP's built-in functions or
@@ -29,544 +36,85 @@ setlocale(LC_CTYPE, 'C');
*
*/
-if (!extension_loaded('xml'))
-{
- /**
- * Implementation of PHP's native utf8_encode for people without XML support
- * This function exploits some nice things that ISO-8859-1 and UTF-8 have in common
- *
- * @param string $str ISO-8859-1 encoded data
- * @return string UTF-8 encoded data
- */
- function utf8_encode($str)
- {
- $out = '';
- for ($i = 0, $len = strlen($str); $i < $len; $i++)
- {
- $letter = $str[$i];
- $num = ord($letter);
- if ($num < 0x80)
- {
- $out .= $letter;
- }
- else if ($num < 0xC0)
- {
- $out .= "\xC2" . $letter;
- }
- else
- {
- $out .= "\xC3" . chr($num - 64);
- }
- }
- return $out;
- }
-
- /**
- * Implementation of PHP's native utf8_decode for people without XML support
- *
- * @param string $str UTF-8 encoded data
- * @return string ISO-8859-1 encoded data
- */
- function utf8_decode($str)
- {
- $pos = 0;
- $len = strlen($str);
- $ret = '';
-
- while ($pos < $len)
- {
- $ord = ord($str[$pos]) & 0xF0;
- if ($ord === 0xC0 || $ord === 0xD0)
- {
- $charval = ((ord($str[$pos]) & 0x1F) << 6) | (ord($str[$pos + 1]) & 0x3F);
- $pos += 2;
- $ret .= (($charval < 256) ? chr($charval) : '?');
- }
- else if ($ord === 0xE0)
- {
- $ret .= '?';
- $pos += 3;
- }
- else if ($ord === 0xF0)
- {
- $ret .= '?';
- $pos += 4;
- }
- else
- {
- $ret .= $str[$pos];
- ++$pos;
- }
- }
- return $ret;
- }
-}
-
-// mbstring is old and has it's functions around for older versions of PHP.
-// if mbstring is not loaded, we go into native mode.
-if (extension_loaded('mbstring'))
+/**
+* UTF-8 aware alternative to strrpos
+* @ignore
+*/
+function utf8_strrpos($str, $needle, $offset = null)
{
- mb_internal_encoding('UTF-8');
-
- /**
- * UTF-8 aware alternative to strrpos
- * Find position of last occurrence of a char in a string
- */
- /**
- * UTF-8 aware alternative to strrpos
- * @ignore
- */
- function utf8_strrpos($str, $needle, $offset = null)
+ // Emulate behaviour of strrpos rather than raising warning
+ if (empty($str))
{
- // Emulate behaviour of strrpos rather than raising warning
- if (empty($str))
- {
- return false;
- }
-
- if (is_null($offset))
- {
- return mb_strrpos($str, $needle);
- }
- else
- {
- return mb_strrpos($str, $needle, $offset);
- }
- }
-
- /**
- * UTF-8 aware alternative to strpos
- * @ignore
- */
- function utf8_strpos($str, $needle, $offset = null)
- {
- if (is_null($offset))
- {
- return mb_strpos($str, $needle);
- }
- else
- {
- return mb_strpos($str, $needle, $offset);
- }
+ return false;
}
- /**
- * UTF-8 aware alternative to strtolower
- * @ignore
- */
- function utf8_strtolower($str)
+ if (is_null($offset))
{
- return mb_strtolower($str);
+ return mb_strrpos($str, $needle);
}
-
- /**
- * UTF-8 aware alternative to strtoupper
- * @ignore
- */
- function utf8_strtoupper($str)
+ else
{
- return mb_strtoupper($str);
+ return mb_strrpos($str, $needle, $offset);
}
+}
- /**
- * UTF-8 aware alternative to substr
- * @ignore
- */
- function utf8_substr($str, $offset, $length = null)
+/**
+* UTF-8 aware alternative to strpos
+* @ignore
+*/
+function utf8_strpos($str, $needle, $offset = null)
+{
+ if (is_null($offset))
{
- if (is_null($length))
- {
- return mb_substr($str, $offset);
- }
- else
- {
- return mb_substr($str, $offset, $length);
- }
+ return mb_strpos($str, $needle);
}
-
- /**
- * Return the length (in characters) of a UTF-8 string
- * @ignore
- */
- function utf8_strlen($text)
+ else
{
- return mb_strlen($text, 'utf-8');
+ return mb_strpos($str, $needle, $offset);
}
}
-else
-{
- /**
- * UTF-8 aware alternative to strrpos
- * Find position of last occurrence of a char in a string
- *
- * @author Harry Fuecks
- * @param string $str haystack
- * @param string $needle needle
- * @param integer $offset (optional) offset (from left)
- * @return mixed integer position or FALSE on failure
- */
- function utf8_strrpos($str, $needle, $offset = null)
- {
- if (is_null($offset))
- {
- $ar = explode($needle, $str);
-
- if (sizeof($ar) > 1)
- {
- // Pop off the end of the string where the last match was made
- array_pop($ar);
- $str = join($needle, $ar);
-
- return utf8_strlen($str);
- }
- return false;
- }
- else
- {
- if (!is_int($offset))
- {
- trigger_error('utf8_strrpos expects parameter 3 to be long', E_USER_ERROR);
- return false;
- }
-
- $str = utf8_substr($str, $offset);
-
- if (false !== ($pos = utf8_strrpos($str, $needle)))
- {
- return $pos + $offset;
- }
-
- return false;
- }
- }
- /**
- * UTF-8 aware alternative to strpos
- * Find position of first occurrence of a string
- *
- * @author Harry Fuecks
- * @param string $str haystack
- * @param string $needle needle
- * @param integer $offset offset in characters (from left)
- * @return mixed integer position or FALSE on failure
- */
- function utf8_strpos($str, $needle, $offset = null)
- {
- if (is_null($offset))
- {
- $ar = explode($needle, $str);
- if (sizeof($ar) > 1)
- {
- return utf8_strlen($ar[0]);
- }
- return false;
- }
- else
- {
- if (!is_int($offset))
- {
- trigger_error('utf8_strpos: Offset must be an integer', E_USER_ERROR);
- return false;
- }
-
- $str = utf8_substr($str, $offset);
-
- if (false !== ($pos = utf8_strpos($str, $needle)))
- {
- return $pos + $offset;
- }
+/**
+* UTF-8 aware alternative to strtolower
+* @ignore
+*/
+function utf8_strtolower($str)
+{
+ return mb_strtolower($str);
+}
- return false;
- }
- }
+/**
+* UTF-8 aware alternative to strtoupper
+* @ignore
+*/
+function utf8_strtoupper($str)
+{
+ return mb_strtoupper($str);
+}
- /**
- * UTF-8 aware alternative to strtolower
- * Make a string lowercase
- * Note: The concept of a characters "case" only exists is some alphabets
- * such as Latin, Greek, Cyrillic, Armenian and archaic Georgian - it does
- * not exist in the Chinese alphabet, for example. See Unicode Standard
- * Annex #21: Case Mappings
- *
- * @param string
- * @return string string in lowercase
- */
- function utf8_strtolower($string)
+/**
+* UTF-8 aware alternative to substr
+* @ignore
+*/
+function utf8_substr($str, $offset, $length = null)
+{
+ if (is_null($length))
{
- static $utf8_upper_to_lower = array(
- "\xC3\x80" => "\xC3\xA0", "\xC3\x81" => "\xC3\xA1",
- "\xC3\x82" => "\xC3\xA2", "\xC3\x83" => "\xC3\xA3", "\xC3\x84" => "\xC3\xA4", "\xC3\x85" => "\xC3\xA5",
- "\xC3\x86" => "\xC3\xA6", "\xC3\x87" => "\xC3\xA7", "\xC3\x88" => "\xC3\xA8", "\xC3\x89" => "\xC3\xA9",
- "\xC3\x8A" => "\xC3\xAA", "\xC3\x8B" => "\xC3\xAB", "\xC3\x8C" => "\xC3\xAC", "\xC3\x8D" => "\xC3\xAD",
- "\xC3\x8E" => "\xC3\xAE", "\xC3\x8F" => "\xC3\xAF", "\xC3\x90" => "\xC3\xB0", "\xC3\x91" => "\xC3\xB1",
- "\xC3\x92" => "\xC3\xB2", "\xC3\x93" => "\xC3\xB3", "\xC3\x94" => "\xC3\xB4", "\xC3\x95" => "\xC3\xB5",
- "\xC3\x96" => "\xC3\xB6", "\xC3\x98" => "\xC3\xB8", "\xC3\x99" => "\xC3\xB9", "\xC3\x9A" => "\xC3\xBA",
- "\xC3\x9B" => "\xC3\xBB", "\xC3\x9C" => "\xC3\xBC", "\xC3\x9D" => "\xC3\xBD", "\xC3\x9E" => "\xC3\xBE",
- "\xC4\x80" => "\xC4\x81", "\xC4\x82" => "\xC4\x83", "\xC4\x84" => "\xC4\x85", "\xC4\x86" => "\xC4\x87",
- "\xC4\x88" => "\xC4\x89", "\xC4\x8A" => "\xC4\x8B", "\xC4\x8C" => "\xC4\x8D", "\xC4\x8E" => "\xC4\x8F",
- "\xC4\x90" => "\xC4\x91", "\xC4\x92" => "\xC4\x93", "\xC4\x96" => "\xC4\x97", "\xC4\x98" => "\xC4\x99",
- "\xC4\x9A" => "\xC4\x9B", "\xC4\x9C" => "\xC4\x9D", "\xC4\x9E" => "\xC4\x9F", "\xC4\xA0" => "\xC4\xA1",
- "\xC4\xA2" => "\xC4\xA3", "\xC4\xA4" => "\xC4\xA5", "\xC4\xA6" => "\xC4\xA7", "\xC4\xA8" => "\xC4\xA9",
- "\xC4\xAA" => "\xC4\xAB", "\xC4\xAE" => "\xC4\xAF", "\xC4\xB4" => "\xC4\xB5", "\xC4\xB6" => "\xC4\xB7",
- "\xC4\xB9" => "\xC4\xBA", "\xC4\xBB" => "\xC4\xBC", "\xC4\xBD" => "\xC4\xBE", "\xC5\x81" => "\xC5\x82",
- "\xC5\x83" => "\xC5\x84", "\xC5\x85" => "\xC5\x86", "\xC5\x87" => "\xC5\x88", "\xC5\x8A" => "\xC5\x8B",
- "\xC5\x8C" => "\xC5\x8D", "\xC5\x90" => "\xC5\x91", "\xC5\x94" => "\xC5\x95", "\xC5\x96" => "\xC5\x97",
- "\xC5\x98" => "\xC5\x99", "\xC5\x9A" => "\xC5\x9B", "\xC5\x9C" => "\xC5\x9D", "\xC5\x9E" => "\xC5\x9F",
- "\xC5\xA0" => "\xC5\xA1", "\xC5\xA2" => "\xC5\xA3", "\xC5\xA4" => "\xC5\xA5", "\xC5\xA6" => "\xC5\xA7",
- "\xC5\xA8" => "\xC5\xA9", "\xC5\xAA" => "\xC5\xAB", "\xC5\xAC" => "\xC5\xAD", "\xC5\xAE" => "\xC5\xAF",
- "\xC5\xB0" => "\xC5\xB1", "\xC5\xB2" => "\xC5\xB3", "\xC5\xB4" => "\xC5\xB5", "\xC5\xB6" => "\xC5\xB7",
- "\xC5\xB8" => "\xC3\xBF", "\xC5\xB9" => "\xC5\xBA", "\xC5\xBB" => "\xC5\xBC", "\xC5\xBD" => "\xC5\xBE",
- "\xC6\xA0" => "\xC6\xA1", "\xC6\xAF" => "\xC6\xB0", "\xC8\x98" => "\xC8\x99", "\xC8\x9A" => "\xC8\x9B",
- "\xCE\x86" => "\xCE\xAC", "\xCE\x88" => "\xCE\xAD", "\xCE\x89" => "\xCE\xAE", "\xCE\x8A" => "\xCE\xAF",
- "\xCE\x8C" => "\xCF\x8C", "\xCE\x8E" => "\xCF\x8D", "\xCE\x8F" => "\xCF\x8E", "\xCE\x91" => "\xCE\xB1",
- "\xCE\x92" => "\xCE\xB2", "\xCE\x93" => "\xCE\xB3", "\xCE\x94" => "\xCE\xB4", "\xCE\x95" => "\xCE\xB5",
- "\xCE\x96" => "\xCE\xB6", "\xCE\x97" => "\xCE\xB7", "\xCE\x98" => "\xCE\xB8", "\xCE\x99" => "\xCE\xB9",
- "\xCE\x9A" => "\xCE\xBA", "\xCE\x9B" => "\xCE\xBB", "\xCE\x9C" => "\xCE\xBC", "\xCE\x9D" => "\xCE\xBD",
- "\xCE\x9E" => "\xCE\xBE", "\xCE\x9F" => "\xCE\xBF", "\xCE\xA0" => "\xCF\x80", "\xCE\xA1" => "\xCF\x81",
- "\xCE\xA3" => "\xCF\x83", "\xCE\xA4" => "\xCF\x84", "\xCE\xA5" => "\xCF\x85", "\xCE\xA6" => "\xCF\x86",
- "\xCE\xA7" => "\xCF\x87", "\xCE\xA8" => "\xCF\x88", "\xCE\xA9" => "\xCF\x89", "\xCE\xAA" => "\xCF\x8A",
- "\xCE\xAB" => "\xCF\x8B", "\xD0\x81" => "\xD1\x91", "\xD0\x82" => "\xD1\x92", "\xD0\x83" => "\xD1\x93",
- "\xD0\x84" => "\xD1\x94", "\xD0\x85" => "\xD1\x95", "\xD0\x86" => "\xD1\x96", "\xD0\x87" => "\xD1\x97",
- "\xD0\x88" => "\xD1\x98", "\xD0\x89" => "\xD1\x99", "\xD0\x8A" => "\xD1\x9A", "\xD0\x8B" => "\xD1\x9B",
- "\xD0\x8C" => "\xD1\x9C", "\xD0\x8E" => "\xD1\x9E", "\xD0\x8F" => "\xD1\x9F", "\xD0\x90" => "\xD0\xB0",
- "\xD0\x91" => "\xD0\xB1", "\xD0\x92" => "\xD0\xB2", "\xD0\x93" => "\xD0\xB3", "\xD0\x94" => "\xD0\xB4",
- "\xD0\x95" => "\xD0\xB5", "\xD0\x96" => "\xD0\xB6", "\xD0\x97" => "\xD0\xB7", "\xD0\x98" => "\xD0\xB8",
- "\xD0\x99" => "\xD0\xB9", "\xD0\x9A" => "\xD0\xBA", "\xD0\x9B" => "\xD0\xBB", "\xD0\x9C" => "\xD0\xBC",
- "\xD0\x9D" => "\xD0\xBD", "\xD0\x9E" => "\xD0\xBE", "\xD0\x9F" => "\xD0\xBF", "\xD0\xA0" => "\xD1\x80",
- "\xD0\xA1" => "\xD1\x81", "\xD0\xA2" => "\xD1\x82", "\xD0\xA3" => "\xD1\x83", "\xD0\xA4" => "\xD1\x84",
- "\xD0\xA5" => "\xD1\x85", "\xD0\xA6" => "\xD1\x86", "\xD0\xA7" => "\xD1\x87", "\xD0\xA8" => "\xD1\x88",
- "\xD0\xA9" => "\xD1\x89", "\xD0\xAA" => "\xD1\x8A", "\xD0\xAB" => "\xD1\x8B", "\xD0\xAC" => "\xD1\x8C",
- "\xD0\xAD" => "\xD1\x8D", "\xD0\xAE" => "\xD1\x8E", "\xD0\xAF" => "\xD1\x8F", "\xD2\x90" => "\xD2\x91",
- "\xE1\xB8\x82" => "\xE1\xB8\x83", "\xE1\xB8\x8A" => "\xE1\xB8\x8B", "\xE1\xB8\x9E" => "\xE1\xB8\x9F", "\xE1\xB9\x80" => "\xE1\xB9\x81",
- "\xE1\xB9\x96" => "\xE1\xB9\x97", "\xE1\xB9\xA0" => "\xE1\xB9\xA1", "\xE1\xB9\xAA" => "\xE1\xB9\xAB", "\xE1\xBA\x80" => "\xE1\xBA\x81",
- "\xE1\xBA\x82" => "\xE1\xBA\x83", "\xE1\xBA\x84" => "\xE1\xBA\x85", "\xE1\xBB\xB2" => "\xE1\xBB\xB3"
- );
-
- return strtr(strtolower($string), $utf8_upper_to_lower);
+ return mb_substr($str, $offset);
}
-
- /**
- * UTF-8 aware alternative to strtoupper
- * Make a string uppercase
- * Note: The concept of a characters "case" only exists is some alphabets
- * such as Latin, Greek, Cyrillic, Armenian and archaic Georgian - it does
- * not exist in the Chinese alphabet, for example. See Unicode Standard
- * Annex #21: Case Mappings
- *
- * @param string
- * @return string string in uppercase
- */
- function utf8_strtoupper($string)
+ else
{
- static $utf8_lower_to_upper = array(
- "\xC3\xA0" => "\xC3\x80", "\xC3\xA1" => "\xC3\x81",
- "\xC3\xA2" => "\xC3\x82", "\xC3\xA3" => "\xC3\x83", "\xC3\xA4" => "\xC3\x84", "\xC3\xA5" => "\xC3\x85",
- "\xC3\xA6" => "\xC3\x86", "\xC3\xA7" => "\xC3\x87", "\xC3\xA8" => "\xC3\x88", "\xC3\xA9" => "\xC3\x89",
- "\xC3\xAA" => "\xC3\x8A", "\xC3\xAB" => "\xC3\x8B", "\xC3\xAC" => "\xC3\x8C", "\xC3\xAD" => "\xC3\x8D",
- "\xC3\xAE" => "\xC3\x8E", "\xC3\xAF" => "\xC3\x8F", "\xC3\xB0" => "\xC3\x90", "\xC3\xB1" => "\xC3\x91",
- "\xC3\xB2" => "\xC3\x92", "\xC3\xB3" => "\xC3\x93", "\xC3\xB4" => "\xC3\x94", "\xC3\xB5" => "\xC3\x95",
- "\xC3\xB6" => "\xC3\x96", "\xC3\xB8" => "\xC3\x98", "\xC3\xB9" => "\xC3\x99", "\xC3\xBA" => "\xC3\x9A",
- "\xC3\xBB" => "\xC3\x9B", "\xC3\xBC" => "\xC3\x9C", "\xC3\xBD" => "\xC3\x9D", "\xC3\xBE" => "\xC3\x9E",
- "\xC3\xBF" => "\xC5\xB8", "\xC4\x81" => "\xC4\x80", "\xC4\x83" => "\xC4\x82", "\xC4\x85" => "\xC4\x84",
- "\xC4\x87" => "\xC4\x86", "\xC4\x89" => "\xC4\x88", "\xC4\x8B" => "\xC4\x8A", "\xC4\x8D" => "\xC4\x8C",
- "\xC4\x8F" => "\xC4\x8E", "\xC4\x91" => "\xC4\x90", "\xC4\x93" => "\xC4\x92", "\xC4\x97" => "\xC4\x96",
- "\xC4\x99" => "\xC4\x98", "\xC4\x9B" => "\xC4\x9A", "\xC4\x9D" => "\xC4\x9C", "\xC4\x9F" => "\xC4\x9E",
- "\xC4\xA1" => "\xC4\xA0", "\xC4\xA3" => "\xC4\xA2", "\xC4\xA5" => "\xC4\xA4", "\xC4\xA7" => "\xC4\xA6",
- "\xC4\xA9" => "\xC4\xA8", "\xC4\xAB" => "\xC4\xAA", "\xC4\xAF" => "\xC4\xAE", "\xC4\xB5" => "\xC4\xB4",
- "\xC4\xB7" => "\xC4\xB6", "\xC4\xBA" => "\xC4\xB9", "\xC4\xBC" => "\xC4\xBB", "\xC4\xBE" => "\xC4\xBD",
- "\xC5\x82" => "\xC5\x81", "\xC5\x84" => "\xC5\x83", "\xC5\x86" => "\xC5\x85", "\xC5\x88" => "\xC5\x87",
- "\xC5\x8B" => "\xC5\x8A", "\xC5\x8D" => "\xC5\x8C", "\xC5\x91" => "\xC5\x90", "\xC5\x95" => "\xC5\x94",
- "\xC5\x97" => "\xC5\x96", "\xC5\x99" => "\xC5\x98", "\xC5\x9B" => "\xC5\x9A", "\xC5\x9D" => "\xC5\x9C",
- "\xC5\x9F" => "\xC5\x9E", "\xC5\xA1" => "\xC5\xA0", "\xC5\xA3" => "\xC5\xA2", "\xC5\xA5" => "\xC5\xA4",
- "\xC5\xA7" => "\xC5\xA6", "\xC5\xA9" => "\xC5\xA8", "\xC5\xAB" => "\xC5\xAA", "\xC5\xAD" => "\xC5\xAC",
- "\xC5\xAF" => "\xC5\xAE", "\xC5\xB1" => "\xC5\xB0", "\xC5\xB3" => "\xC5\xB2", "\xC5\xB5" => "\xC5\xB4",
- "\xC5\xB7" => "\xC5\xB6", "\xC5\xBA" => "\xC5\xB9", "\xC5\xBC" => "\xC5\xBB", "\xC5\xBE" => "\xC5\xBD",
- "\xC6\xA1" => "\xC6\xA0", "\xC6\xB0" => "\xC6\xAF", "\xC8\x99" => "\xC8\x98", "\xC8\x9B" => "\xC8\x9A",
- "\xCE\xAC" => "\xCE\x86", "\xCE\xAD" => "\xCE\x88", "\xCE\xAE" => "\xCE\x89", "\xCE\xAF" => "\xCE\x8A",
- "\xCE\xB1" => "\xCE\x91", "\xCE\xB2" => "\xCE\x92", "\xCE\xB3" => "\xCE\x93", "\xCE\xB4" => "\xCE\x94",
- "\xCE\xB5" => "\xCE\x95", "\xCE\xB6" => "\xCE\x96", "\xCE\xB7" => "\xCE\x97", "\xCE\xB8" => "\xCE\x98",
- "\xCE\xB9" => "\xCE\x99", "\xCE\xBA" => "\xCE\x9A", "\xCE\xBB" => "\xCE\x9B", "\xCE\xBC" => "\xCE\x9C",
- "\xCE\xBD" => "\xCE\x9D", "\xCE\xBE" => "\xCE\x9E", "\xCE\xBF" => "\xCE\x9F", "\xCF\x80" => "\xCE\xA0",
- "\xCF\x81" => "\xCE\xA1", "\xCF\x83" => "\xCE\xA3", "\xCF\x84" => "\xCE\xA4", "\xCF\x85" => "\xCE\xA5",
- "\xCF\x86" => "\xCE\xA6", "\xCF\x87" => "\xCE\xA7", "\xCF\x88" => "\xCE\xA8", "\xCF\x89" => "\xCE\xA9",
- "\xCF\x8A" => "\xCE\xAA", "\xCF\x8B" => "\xCE\xAB", "\xCF\x8C" => "\xCE\x8C", "\xCF\x8D" => "\xCE\x8E",
- "\xCF\x8E" => "\xCE\x8F", "\xD0\xB0" => "\xD0\x90", "\xD0\xB1" => "\xD0\x91", "\xD0\xB2" => "\xD0\x92",
- "\xD0\xB3" => "\xD0\x93", "\xD0\xB4" => "\xD0\x94", "\xD0\xB5" => "\xD0\x95", "\xD0\xB6" => "\xD0\x96",
- "\xD0\xB7" => "\xD0\x97", "\xD0\xB8" => "\xD0\x98", "\xD0\xB9" => "\xD0\x99", "\xD0\xBA" => "\xD0\x9A",
- "\xD0\xBB" => "\xD0\x9B", "\xD0\xBC" => "\xD0\x9C", "\xD0\xBD" => "\xD0\x9D", "\xD0\xBE" => "\xD0\x9E",
- "\xD0\xBF" => "\xD0\x9F", "\xD1\x80" => "\xD0\xA0", "\xD1\x81" => "\xD0\xA1", "\xD1\x82" => "\xD0\xA2",
- "\xD1\x83" => "\xD0\xA3", "\xD1\x84" => "\xD0\xA4", "\xD1\x85" => "\xD0\xA5", "\xD1\x86" => "\xD0\xA6",
- "\xD1\x87" => "\xD0\xA7", "\xD1\x88" => "\xD0\xA8", "\xD1\x89" => "\xD0\xA9", "\xD1\x8A" => "\xD0\xAA",
- "\xD1\x8B" => "\xD0\xAB", "\xD1\x8C" => "\xD0\xAC", "\xD1\x8D" => "\xD0\xAD", "\xD1\x8E" => "\xD0\xAE",
- "\xD1\x8F" => "\xD0\xAF", "\xD1\x91" => "\xD0\x81", "\xD1\x92" => "\xD0\x82", "\xD1\x93" => "\xD0\x83",
- "\xD1\x94" => "\xD0\x84", "\xD1\x95" => "\xD0\x85", "\xD1\x96" => "\xD0\x86", "\xD1\x97" => "\xD0\x87",
- "\xD1\x98" => "\xD0\x88", "\xD1\x99" => "\xD0\x89", "\xD1\x9A" => "\xD0\x8A", "\xD1\x9B" => "\xD0\x8B",
- "\xD1\x9C" => "\xD0\x8C", "\xD1\x9E" => "\xD0\x8E", "\xD1\x9F" => "\xD0\x8F", "\xD2\x91" => "\xD2\x90",
- "\xE1\xB8\x83" => "\xE1\xB8\x82", "\xE1\xB8\x8B" => "\xE1\xB8\x8A", "\xE1\xB8\x9F" => "\xE1\xB8\x9E", "\xE1\xB9\x81" => "\xE1\xB9\x80",
- "\xE1\xB9\x97" => "\xE1\xB9\x96", "\xE1\xB9\xA1" => "\xE1\xB9\xA0", "\xE1\xB9\xAB" => "\xE1\xB9\xAA", "\xE1\xBA\x81" => "\xE1\xBA\x80",
- "\xE1\xBA\x83" => "\xE1\xBA\x82", "\xE1\xBA\x85" => "\xE1\xBA\x84", "\xE1\xBB\xB3" => "\xE1\xBB\xB2"
- );
-
- return strtr(strtoupper($string), $utf8_lower_to_upper);
- }
-
- /**
- * UTF-8 aware alternative to substr
- * Return part of a string given character offset (and optionally length)
- *
- * Note arguments: comparied to substr - if offset or length are
- * not integers, this version will not complain but rather massages them
- * into an integer.
- *
- * Note on returned values: substr documentation states false can be
- * returned in some cases (e.g. offset > string length)
- * mb_substr never returns false, it will return an empty string instead.
- * This adopts the mb_substr approach
- *
- * Note on implementation: PCRE only supports repetitions of less than
- * 65536, in order to accept up to MAXINT values for offset and length,
- * we'll repeat a group of 65535 characters when needed.
- *
- * Note on implementation: calculating the number of characters in the
- * string is a relatively expensive operation, so we only carry it out when
- * necessary. It isn't necessary for +ve offsets and no specified length
- *
- * @author Chris Smith<chris@jalakai.co.uk>
- * @param string $str
- * @param integer $offset number of UTF-8 characters offset (from left)
- * @param integer $length (optional) length in UTF-8 characters from offset
- * @return mixed string or FALSE if failure
- */
- function utf8_substr($str, $offset, $length = NULL)
- {
- // generates E_NOTICE
- // for PHP4 objects, but not PHP5 objects
- $str = (string) $str;
- $offset = (int) $offset;
- if (!is_null($length))
- {
- $length = (int) $length;
- }
-
- // handle trivial cases
- if ($length === 0 || ($offset < 0 && $length < 0 && $length < $offset))
- {
- return '';
- }
-
- // normalise negative offsets (we could use a tail
- // anchored pattern, but they are horribly slow!)
- if ($offset < 0)
- {
- // see notes
- $strlen = utf8_strlen($str);
- $offset = $strlen + $offset;
- if ($offset < 0)
- {
- $offset = 0;
- }
- }
-
- $op = '';
- $lp = '';
-
- // establish a pattern for offset, a
- // non-captured group equal in length to offset
- if ($offset > 0)
- {
- $ox = (int) ($offset / 65535);
- $oy = $offset % 65535;
-
- if ($ox)
- {
- $op = '(?:.{65535}){' . $ox . '}';
- }
-
- $op = '^(?:' . $op . '.{' . $oy . '})';
- }
- else
- {
- // offset == 0; just anchor the pattern
- $op = '^';
- }
-
- // establish a pattern for length
- if (is_null($length))
- {
- // the rest of the string
- $lp = '(.*)$';
- }
- else
- {
- if (!isset($strlen))
- {
- // see notes
- $strlen = utf8_strlen($str);
- }
-
- // another trivial case
- if ($offset > $strlen)
- {
- return '';
- }
-
- if ($length > 0)
- {
- // reduce any length that would
- // go passed the end of the string
- $length = min($strlen - $offset, $length);
-
- $lx = (int) ($length / 65535);
- $ly = $length % 65535;
-
- // negative length requires a captured group
- // of length characters
- if ($lx)
- {
- $lp = '(?:.{65535}){' . $lx . '}';
- }
- $lp = '(' . $lp . '.{'. $ly . '})';
- }
- else if ($length < 0)
- {
- if ($length < ($offset - $strlen))
- {
- return '';
- }
-
- $lx = (int) ((-$length) / 65535);
- $ly = (-$length) % 65535;
-
- // negative length requires ... capture everything
- // except a group of -length characters
- // anchored at the tail-end of the string
- if ($lx)
- {
- $lp = '(?:.{65535}){' . $lx . '}';
- }
- $lp = '(.*)(?:' . $lp . '.{' . $ly . '})$';
- }
- }
-
- if (!preg_match('#' . $op . $lp . '#us', $str, $match))
- {
- return '';
- }
-
- return $match[1];
+ return mb_substr($str, $offset, $length);
}
+}
- /**
- * Return the length (in characters) of a UTF-8 string
- *
- * @param string $text UTF-8 string
- * @return integer Length (in chars) of given string
- */
- function utf8_strlen($text)
- {
- // Since utf8_decode is replacing multibyte characters to ? strlen works fine
- return strlen(utf8_decode($text));
- }
+/**
+* Return the length (in characters) of a UTF-8 string
+* @ignore
+*/
+function utf8_strlen($text)
+{
+ return mb_strlen($text, 'utf-8');
}
/**
@@ -867,7 +415,6 @@ function utf8_recode($string, $encoding)
// Trigger an error?! Fow now just give bad data :-(
trigger_error('Unknown encoding: ' . $encoding, E_USER_ERROR);
- //return $string; // use utf_normalizer::cleanup() ?
}
/**
@@ -1611,14 +1158,8 @@ function utf8_case_fold_nfkc($text, $option = 'full')
// do the case fold
$text = utf8_case_fold($text, $option);
- if (!class_exists('utf_normalizer'))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
- }
-
// convert to NFKC
- utf_normalizer::nfkc($text);
+ Normalizer::normalize($text, Normalizer::NFKC);
// FC_NFKC_Closure, http://www.unicode.org/Public/5.0.0/ucd/DerivedNormalizationProps.txt
$text = strtr($text, $fc_nfkc_closure);
@@ -1714,106 +1255,56 @@ function utf8_case_fold_nfc($text, $option = 'full')
return $text;
}
-if (extension_loaded('intl'))
+/**
+* wrapper around PHP's native normalizer from intl
+* previously a PECL extension, included in the core since PHP 5.3.0
+* http://php.net/manual/en/normalizer.normalize.php
+*
+* @param mixed $strings a string or an array of strings to normalize
+* @return mixed the normalized content, preserving array keys if array given.
+*/
+function utf8_normalize_nfc($strings)
{
- /**
- * wrapper around PHP's native normalizer from intl
- * previously a PECL extension, included in the core since PHP 5.3.0
- * http://php.net/manual/en/normalizer.normalize.php
- *
- * @param mixed $strings a string or an array of strings to normalize
- * @return mixed the normalized content, preserving array keys if array given.
- */
- function utf8_normalize_nfc($strings)
+ if (empty($strings))
{
- if (empty($strings))
- {
- return $strings;
- }
-
- if (!is_array($strings))
- {
- if (Normalizer::isNormalized($strings))
- {
- return $strings;
- }
- return (string) Normalizer::normalize($strings);
- }
- else
- {
- foreach ($strings as $key => $string)
- {
- if (is_array($string))
- {
- foreach ($string as $_key => $_string)
- {
- if (Normalizer::isNormalized($strings[$key][$_key]))
- {
- continue;
- }
- $strings[$key][$_key] = (string) Normalizer::normalize($strings[$key][$_key]);
- }
- }
- else
- {
- if (Normalizer::isNormalized($strings[$key]))
- {
- continue;
- }
- $strings[$key] = (string) Normalizer::normalize($strings[$key]);
- }
- }
- }
-
return $strings;
}
-}
-else
-{
- /**
- * A wrapper function for the normalizer which takes care of including the class if
- * required and modifies the passed strings to be in NFC (Normalization Form Composition).
- *
- * @param mixed $strings a string or an array of strings to normalize
- * @return mixed the normalized content, preserving array keys if array given.
- */
- function utf8_normalize_nfc($strings)
+
+ if (!is_array($strings))
{
- if (empty($strings))
+ if (Normalizer::isNormalized($strings))
{
return $strings;
}
-
- if (!class_exists('utf_normalizer'))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
- }
-
- if (!is_array($strings))
- {
- utf_normalizer::nfc($strings);
- }
- else if (is_array($strings))
+ return (string) Normalizer::normalize($strings);
+ }
+ else
+ {
+ foreach ($strings as $key => $string)
{
- foreach ($strings as $key => $string)
+ if (is_array($string))
{
- if (is_array($string))
+ foreach ($string as $_key => $_string)
{
- foreach ($string as $_key => $_string)
+ if (Normalizer::isNormalized($strings[$key][$_key]))
{
- utf_normalizer::nfc($strings[$key][$_key]);
+ continue;
}
+ $strings[$key][$_key] = (string) Normalizer::normalize($strings[$key][$_key]);
}
- else
+ }
+ else
+ {
+ if (Normalizer::isNormalized($strings[$key]))
{
- utf_normalizer::nfc($strings[$key]);
+ continue;
}
+ $strings[$key] = (string) Normalizer::normalize($strings[$key]);
}
}
-
- return $strings;
}
+
+ return $strings;
}
/**
@@ -1959,50 +1450,3 @@ function utf8_basename($filename)
return $filename;
}
-
-/**
-* UTF8-safe str_replace() function
-*
-* @param string $search The value to search for
-* @param string $replace The replacement string
-* @param string $subject The target string
-* @return string The resultant string
-*/
-function utf8_str_replace($search, $replace, $subject)
-{
- if (!is_array($search))
- {
- $search = array($search);
- if (is_array($replace))
- {
- $replace = (string) $replace;
- trigger_error('Array to string conversion', E_USER_NOTICE);
- }
- }
-
- $length = sizeof($search);
-
- if (!is_array($replace))
- {
- $replace = array_fill(0, $length, $replace);
- }
- else
- {
- $replace = array_pad($replace, $length, '');
- }
-
- for ($i = 0; $i < $length; $i++)
- {
- $search_length = utf8_strlen($search[$i]);
- $replace_length = utf8_strlen($replace[$i]);
-
- $offset = 0;
- while (($start = utf8_strpos($subject, $search[$i], $offset)) !== false)
- {
- $subject = utf8_substr($subject, 0, $start) . $replace[$i] . utf8_substr($subject, $start + $search_length);
- $offset = $start + $replace_length;
- }
- }
-
- return $subject;
-}
diff --git a/phpBB/index.php b/phpBB/index.php
index df6932f6c0..73a5989bcb 100644
--- a/phpBB/index.php
+++ b/phpBB/index.php
@@ -42,9 +42,10 @@ if (($mark_notification = $request->variable('mark_notification', 0)))
if (check_link_hash($request->variable('hash', ''), 'mark_notification_read'))
{
+ /* @var $phpbb_notifications \phpbb\notification\manager */
$phpbb_notifications = $phpbb_container->get('notification_manager');
- $notification = $phpbb_notifications->load_notifications(array(
+ $notification = $phpbb_notifications->load_notifications('notification.method.board', array(
'notification_id' => $mark_notification,
));
@@ -99,11 +100,14 @@ else
}
$result = $db->sql_query($sql);
+/** @var \phpbb\group\helper $group_helper */
+$group_helper = $phpbb_container->get('group_helper');
+
$legend = array();
while ($row = $db->sql_fetchrow($result))
{
$colour_text = ($row['group_colour']) ? ' style="color:#' . $row['group_colour'] . '"' : '';
- $group_name = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
+ $group_name = $group_helper->get_name($row['group_name']);
if ($row['group_name'] == 'BOTS' || ($user->data['user_id'] != ANONYMOUS && !$auth->acl_get('u_viewprofile')))
{
diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php
index 3a5e58cabd..e75cb4622f 100644
--- a/phpBB/install/convertors/convert_phpbb20.php
+++ b/phpBB/install/convertors/convert_phpbb20.php
@@ -233,11 +233,11 @@ if (!$get_info)
$user_id = (int) $src_db->sql_fetchfield('max_user_id');
$src_db->sql_freeresult($result);
- set_config('increment_user_id', ($user_id + 1), true);
+ $config->set('increment_user_id', ($user_id + 1), false);
}
else
{
- set_config('increment_user_id', 0, true);
+ $config->set('increment_user_id', 0, false);
}
// Overwrite maximum avatar width/height
diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php
index 817c007274..aa2c59f28c 100644
--- a/phpBB/install/convertors/functions_phpbb20.php
+++ b/phpBB/install/convertors/functions_phpbb20.php
@@ -514,12 +514,12 @@ function phpbb_user_id($user_id)
// If there is a user id 1, we need to increment user ids. :/
if ($id === 1)
{
- set_config('increment_user_id', ($max_id + 1), true);
+ $config->set('increment_user_id', ($max_id + 1), false);
$config['increment_user_id'] = $max_id + 1;
}
else
{
- set_config('increment_user_id', 0, true);
+ $config->set('increment_user_id', 0, false);
$config['increment_user_id'] = 0;
}
}
@@ -661,7 +661,7 @@ function phpbb_convert_authentication($mode)
'auth_delete' => 'f_delete',
'auth_pollcreate' => 'f_poll',
'auth_vote' => 'f_vote',
- 'auth_announce' => 'f_announce',
+ 'auth_announce' => array('f_announce', 'f_announce_global'),
'auth_sticky' => 'f_sticky',
'auth_attachments' => array('f_attach', 'f_download'),
'auth_download' => 'f_download',
@@ -990,7 +990,7 @@ function phpbb_convert_authentication($mode)
// We make sure that they have at least standard access to the forums they moderate in addition to the moderating permissions
$mod_post_map = array(
- 'auth_announce' => 'f_announce',
+ 'auth_announce' => array('f_announce', 'f_announce_global'),
'auth_sticky' => 'f_sticky'
);
@@ -1682,29 +1682,29 @@ function phpbb_import_attach_config()
}
$src_db->sql_freeresult($result);
- set_config('allow_attachments', 1);
+ $config->set('allow_attachments', 1);
// old attachment mod? Must be very old if this entry do not exist...
if (!empty($attach_config['display_order']))
{
- set_config('display_order', $attach_config['display_order']);
- }
- set_config('max_filesize', $attach_config['max_filesize']);
- set_config('max_filesize_pm', $attach_config['max_filesize_pm']);
- set_config('attachment_quota', $attach_config['attachment_quota']);
- set_config('max_attachments', $attach_config['max_attachments']);
- set_config('max_attachments_pm', $attach_config['max_attachments_pm']);
- set_config('allow_pm_attach', $attach_config['allow_pm_attach']);
-
- set_config('img_display_inlined', $attach_config['img_display_inlined']);
- set_config('img_max_width', $attach_config['img_max_width']);
- set_config('img_max_height', $attach_config['img_max_height']);
- set_config('img_link_width', $attach_config['img_link_width']);
- set_config('img_link_height', $attach_config['img_link_height']);
- set_config('img_create_thumbnail', $attach_config['img_create_thumbnail']);
- set_config('img_max_thumb_width', 400);
- set_config('img_min_thumb_filesize', $attach_config['img_min_thumb_filesize']);
- set_config('img_imagick', $attach_config['img_imagick']);
+ $config->set('display_order', $attach_config['display_order']);
+ }
+ $config->set('max_filesize', $attach_config['max_filesize']);
+ $config->set('max_filesize_pm', $attach_config['max_filesize_pm']);
+ $config->set('attachment_quota', $attach_config['attachment_quota']);
+ $config->set('max_attachments', $attach_config['max_attachments']);
+ $config->set('max_attachments_pm', $attach_config['max_attachments_pm']);
+ $config->set('allow_pm_attach', $attach_config['allow_pm_attach']);
+
+ $config->set('img_display_inlined', $attach_config['img_display_inlined']);
+ $config->set('img_max_width', $attach_config['img_max_width']);
+ $config->set('img_max_height', $attach_config['img_max_height']);
+ $config->set('img_link_width', $attach_config['img_link_width']);
+ $config->set('img_link_height', $attach_config['img_link_height']);
+ $config->set('img_create_thumbnail', $attach_config['img_create_thumbnail']);
+ $config->set('img_max_thumb_width', 400);
+ $config->set('img_min_thumb_filesize', $attach_config['img_min_thumb_filesize']);
+ $config->set('img_imagick', $attach_config['img_imagick']);
}
/**
@@ -1926,7 +1926,9 @@ function phpbb_check_username_collisions()
function phpbb_convert_timezone($timezone)
{
global $config, $db, $phpbb_root_path, $phpEx, $table_prefix;
- $timezone_migration = new \phpbb\db\migration\data\v310\timezone($config, $db, new \phpbb\db\tools($db), $phpbb_root_path, $phpEx, $table_prefix);
+
+ $factory = new \phpbb\db\tools\factory();
+ $timezone_migration = new \phpbb\db\migration\data\v310\timezone($config, $db, $factory->get($db), $phpbb_root_path, $phpEx, $table_prefix);
return $timezone_migration->convert_phpbb30_timezone($timezone, 0);
}
@@ -1974,6 +1976,7 @@ function phpbb_convert_password_hash($hash)
{
global $phpbb_container;
+ /* @var $manager \phpbb\passwords\manager */
$manager = $phpbb_container->get('passwords.manager');
$hash = $manager->hash($hash, '$H$');
diff --git a/phpBB/install/data/confusables.php b/phpBB/install/data/confusables.php
index e3e8c41e62..992207c1ef 100644
--- a/phpBB/install/data/confusables.php
+++ b/phpBB/install/data/confusables.php
@@ -633,14 +633,8 @@ function utf8_new_case_fold_nfkc($text, $option = 'full')
// do the case fold
$text = utf8_new_case_fold($text, $option);
- if (!class_exists('utf_normalizer'))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
- }
-
// convert to NFKC
- utf_new_normalizer::nfkc($text);
+ $text = Normalizer::normalize($text, Normalizer::NFKC);
// FC_NFKC_Closure, http://www.unicode.org/Public/5.0.0/ucd/DerivedNormalizationProps.txt
$text = strtr($text, $fc_nfkc_closure);
diff --git a/phpBB/install/data/new_normalizer.php b/phpBB/install/data/new_normalizer.php
deleted file mode 100644
index 52652a4f6d..0000000000
--- a/phpBB/install/data/new_normalizer.php
+++ /dev/null
@@ -1,197 +0,0 @@
-<?php
-/**
-*
-* This file is part of the phpBB Forum Software package.
-*
-* @copyright (c) phpBB Limited <https://www.phpbb.com>
-* @license GNU General Public License, version 2 (GPL-2.0)
-*
-* For full copyright and license information, please see
-* the docs/CREDITS.txt file.
-*
-*/
-
-/**
-* @ignore
-*/
-if (!defined('IN_PHPBB'))
-{
- exit;
-}
-
-/**
-* A wrapper function for the normalizer which takes care of including the class if required and modifies the passed strings
-* to be in NFC (Normalization Form Composition).
-*
-* @param mixed $strings a string or an array of strings to normalize
-* @return mixed the normalized content, preserving array keys if array given.
-*/
-function utf8_new_normalize_nfc($strings)
-{
- if (empty($strings))
- {
- return $strings;
- }
-
- if (!is_array($strings))
- {
- utf_new_normalizer::nfc($strings);
- }
- else if (is_array($strings))
- {
- foreach ($strings as $key => $string)
- {
- if (is_array($string))
- {
- foreach ($string as $_key => $_string)
- {
- utf_new_normalizer::nfc($strings[$key][$_key]);
- }
- }
- else
- {
- utf_new_normalizer::nfc($strings[$key]);
- }
- }
- }
-
- return $strings;
-}
-
-class utf_new_normalizer
-{
- /**
- * Validate, cleanup and normalize a string
- *
- * The ultimate convenience function! Clean up invalid UTF-8 sequences,
- * and convert to Normal Form C, canonical composition.
- *
- * @param string &$str The dirty string
- * @return string The same string, all shiny and cleaned-up
- */
- function cleanup(&$str)
- {
- // The string below is the list of all autorized characters, sorted by frequency in latin text
- $pos = strspn($str, "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x0D");
- $len = strlen($str);
-
- if ($pos == $len)
- {
- // ASCII strings with no special chars return immediately
- return;
- }
-
- // Note: we do not check for $GLOBALS['utf_canonical_decomp']. It is assumed they are always loaded together
- if (!isset($GLOBALS['utf_nfc_qc']))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_nfc_qc.' . $phpEx);
- }
-
- if (!isset($GLOBALS['utf_canonical_decomp']))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_canonical_decomp.' . $phpEx);
- }
-
- // Replace any byte in the range 0x00..0x1F, except for \r, \n and \t
- // We replace those characters with a 0xFF byte, which is illegal in UTF-8 and will in turn be replaced with a UTF replacement char
- $str = strtr(
- $str,
- "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F",
- "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF"
- );
-
- $str = utf_new_normalizer::recompose($str, $pos, $len, $GLOBALS['utf_nfc_qc'], $GLOBALS['utf_canonical_decomp']);
- }
-
- /**
- * Validate and normalize a UTF string to NFC
- *
- * @param string &$str Unchecked UTF string
- * @return string The string, validated and in normal form
- */
- function nfc(&$str)
- {
- $pos = strspn($str, UTF8_ASCII_RANGE);
- $len = strlen($str);
-
- if ($pos == $len)
- {
- // ASCII strings return immediately
- return;
- }
-
- if (!isset($GLOBALS['utf_nfc_qc']))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_nfc_qc.' . $phpEx);
- }
-
- if (!isset($GLOBALS['utf_canonical_decomp']))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_canonical_decomp.' . $phpEx);
- }
-
- $str = utf_new_normalizer::recompose($str, $pos, $len, $GLOBALS['utf_nfc_qc'], $GLOBALS['utf_canonical_decomp']);
- }
-
- /**
- * Validate and normalize a UTF string to NFKC
- *
- * @param string &$str Unchecked UTF string
- * @return string The string, validated and in normal form
- */
- function nfkc(&$str)
- {
- $pos = strspn($str, UTF8_ASCII_RANGE);
- $len = strlen($str);
-
- if ($pos == $len)
- {
- // ASCII strings return immediately
- return;
- }
-
- if (!isset($GLOBALS['utf_nfkc_qc']))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_nfkc_qc.' . $phpEx);
- }
-
- if (!isset($GLOBALS['utf_compatibility_decomp']))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_compatibility_decomp.' . $phpEx);
- }
-
- $str = utf_new_normalizer::recompose($str, $pos, $len, $GLOBALS['utf_nfkc_qc'], $GLOBALS['utf_compatibility_decomp']);
- }
-
- /**
- * Recompose a UTF string
- *
- * @param string $str Unchecked UTF string
- * @param integer $pos Position of the first UTF char (in bytes)
- * @param integer $len Length of the string (in bytes)
- * @param array &$qc Quick-check array, passed by reference but never modified
- * @param array &$decomp_map Decomposition mapping, passed by reference but never modified
- * @return string The string, validated and recomposed
- *
- * @access private
- */
- function recompose($str, $pos, $len, &$qc, &$decomp_map)
- {
- global $utf_canonical_comp;
-
- // Load the canonical composition table
- if (!isset($utf_canonical_comp))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/utf/data/utf_canonical_comp.' . $phpEx);
- }
-
- return utf_normalizer::recompose($str, $pos, $len, $qc, $decomp_map);
- }
-}
diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php
index 80fd40a944..853848d637 100644
--- a/phpBB/install/database_update.php
+++ b/phpBB/install/database_update.php
@@ -74,37 +74,46 @@ require($phpbb_root_path . 'includes/functions.' . $phpEx);
require($phpbb_root_path . 'includes/functions_content.' . $phpEx);
require($phpbb_root_path . 'includes/constants.' . $phpEx);
-include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);
require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
// Set PHP error handler to ours
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
// Set up container (must be done here because extensions table may not exist)
-$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
-$phpbb_container_builder->set_use_extensions(false);
-$phpbb_container_builder->set_use_kernel_pass(false);
-$phpbb_container_builder->set_dump_container(false);
-$phpbb_container = $phpbb_container_builder->get_container();
+$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_root_path, $phpEx);
+$phpbb_container = $phpbb_container_builder
+ ->with_config($phpbb_config_php_file)
+ ->without_extensions()
+ ->without_cache()
+ ->get_container()
+;
// set up caching
+/* @var $cache \phpbb\cache\service */
$cache = $phpbb_container->get('cache');
// Instantiate some basic classes
+/* @var $phpbb_dispatcher \phpbb\event\dispatcher */
$phpbb_dispatcher = $phpbb_container->get('dispatcher');
+
+/* @var $request \phpbb\request\request_interface */
$request = $phpbb_container->get('request');
+
+/* @var $user \phpbb\user */
$user = $phpbb_container->get('user');
+
+/* @var $auth \phpbb\auth\auth */
$auth = $phpbb_container->get('auth');
+
+/* @var $db \phpbb\db\driver\driver_interface */
$db = $phpbb_container->get('dbal.conn');
-$phpbb_log = $phpbb_container->get('log');
-// make sure request_var uses this request instance
-request_var('', 0, false, false, $request); // "dependency injection" for a function
+/* @var $phpbb_log \phpbb\log\log_interface */
+$phpbb_log = $phpbb_container->get('log');
// Grab global variables, re-cache if necessary
+/* @var $config \phpbb\config\config */
$config = $phpbb_container->get('config');
-set_config(null, null, null, $config);
-set_config_count(null, null, null, $config);
if (!isset($config['version_update_from']))
{
@@ -121,6 +130,7 @@ if (file_exists($phpbb_root_path . 'includes/hooks/index.' . $phpEx))
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
+ /* @var $phpbb_hook_finder \phpbb\hook\finder */
$phpbb_hook_finder = $phpbb_container->get('hook_finder');
foreach ($phpbb_hook_finder->find() as $hook)
{
@@ -173,11 +183,16 @@ define('IN_DB_UPDATE', true);
// End startup code
+/* @var $migrator \phpbb\db\migrator */
$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'));
+
+/** @var \phpbb\filesystem\filesystem_interface $phpbb_filesystem */
+$phpbb_filesystem = $phpbb_container->get('filesystem');
+$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', $phpbb_filesystem));
$migrator->create_migrations_table();
+/* @var $phpbb_extension_manager \phpbb\extension\manager */
$phpbb_extension_manager = $phpbb_container->get('ext.manager');
$migrations = $phpbb_extension_manager
@@ -231,7 +246,7 @@ while (!$migrator->finished())
if ($orig_version != $config['version'])
{
- add_log('admin', 'LOG_UPDATE_DATABASE', $orig_version, $config['version']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_UPDATE_DATABASE', false, array($orig_version, $config['version']));
}
echo $user->lang['DATABASE_UPDATE_COMPLETE'] . '<br />';
diff --git a/phpBB/install/index.php b/phpBB/install/index.php
index 5c16421499..3559a10971 100644
--- a/phpBB/install/index.php
+++ b/phpBB/install/index.php
@@ -16,14 +16,15 @@
*/
define('IN_PHPBB', true);
define('IN_INSTALL', true);
+define('PHPBB_ENVIRONMENT', 'production');
/**#@-*/
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
-if (version_compare(PHP_VERSION, '5.3.3') < 0)
+if (version_compare(PHP_VERSION, '5.3.9') < 0)
{
- die('You are running an unsupported PHP version. Please upgrade to PHP 5.3.3 or higher before trying to install phpBB 3.1');
+ die('You are running an unsupported PHP version. Please upgrade to PHP 5.3.9 or higher before trying to install phpBB 3.1');
}
function phpbb_require_updated($path, $optional = false)
@@ -102,7 +103,6 @@ phpbb_require_updated('includes/functions.' . $phpEx);
phpbb_require_updated('includes/functions_content.' . $phpEx, true);
phpbb_include_updated('includes/functions_admin.' . $phpEx);
-phpbb_include_updated('includes/utf/utf_normalizer.' . $phpEx);
phpbb_include_updated('includes/utf/utf_tools.' . $phpEx);
phpbb_require_updated('includes/functions_install.' . $phpEx);
@@ -116,18 +116,18 @@ $phpbb_class_loader_ext->register();
// Set up container
$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx);
-$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
-$phpbb_container_builder->set_use_extensions(false);
-$phpbb_container_builder->set_dump_container(false);
-$phpbb_container_builder->set_use_custom_pass(false);
-$phpbb_container_builder->set_inject_config(false);
-$phpbb_container_builder->set_compile_container(false);
+$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_root_path, $phpEx);
+$phpbb_container_builder
+ ->without_extensions()
+ ->without_cache()
+ ->without_compiled_container()
+;
$other_config_path = $phpbb_root_path . 'install/update/new/config/';
$config_path = file_exists($other_config_path . 'services.yml') ? $other_config_path : $phpbb_root_path . 'config/';
-$phpbb_container_builder->set_config_path($config_path);
+$phpbb_container_builder->with_config_path($config_path);
-$phpbb_container_builder->set_custom_parameters(array(
+$phpbb_container_builder->with_custom_parameters(array(
'core.root_path' => $phpbb_root_path,
'core.adm_relative_path' => $phpbb_adm_relative_path,
'core.php_ext' => $phpEx,
@@ -137,16 +137,18 @@ $phpbb_container_builder->set_custom_parameters(array(
$phpbb_container = $phpbb_container_builder->get_container();
$phpbb_container->register('dbal.conn.driver')->setSynthetic(true);
+$phpbb_container->register('template.twig.environment')->setSynthetic(true);
+$phpbb_container->register('language.loader')->setSynthetic(true);
$phpbb_container->compile();
$phpbb_class_loader->set_cache($phpbb_container->get('cache.driver'));
$phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver'));
+/* @var $phpbb_dispatcher \phpbb\event\dispatcher */
$phpbb_dispatcher = $phpbb_container->get('dispatcher');
-$request = $phpbb_container->get('request');
-// make sure request_var uses this request instance
-request_var('', 0, false, false, $request); // "dependency injection" for a function
+/* @var $request \phpbb\request\request_interface */
+$request = $phpbb_container->get('request');
// Try and load an appropriate language if required
$language = basename($request->variable('language', ''));
@@ -240,7 +242,8 @@ $sub = $request->variable('sub', '');
// Set PHP error handler to ours
set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
-$user = new \phpbb\user('\phpbb\datetime');
+$lang_service = new \phpbb\language\language(new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx));
+$user = new \phpbb\user($lang_service, '\phpbb\datetime');
$auth = new \phpbb\auth\auth();
// Add own hook handler, if present. :o
@@ -249,6 +252,7 @@ if (file_exists($phpbb_root_path . 'includes/hooks/index.' . $phpEx))
require($phpbb_root_path . 'includes/hooks/index.' . $phpEx);
$phpbb_hook = new phpbb_hook(array('exit_handler', 'phpbb_user_session_handler', 'append_sid', array('template', 'display')));
+ /* @var $phpbb_hook_finder \phpbb\hook\finder */
$phpbb_hook_finder = $phpbb_container->get('hook_finder');
foreach ($phpbb_hook_finder->find() as $hook)
{
@@ -265,10 +269,40 @@ $config = new \phpbb\config\config(array(
'load_tplcompile' => '1'
));
+/* @var $symfony_request \phpbb\symfony_request */
$symfony_request = $phpbb_container->get('symfony_request');
+
+/* @var $phpbb_filesystem \phpbb\filesystem\filesystem_interface */
$phpbb_filesystem = $phpbb_container->get('filesystem');
+
+/* @var $phpbb_path_helper \phpbb\path_helper */
$phpbb_path_helper = $phpbb_container->get('path_helper');
-$template = new \phpbb\template\twig\twig($phpbb_path_helper, $config, $user, new \phpbb\template\context());
+$cache_path = $phpbb_root_path . 'cache/';
+
+$twig_environment = new \phpbb\template\twig\environment(
+ $config,
+ $phpbb_filesystem,
+ $phpbb_path_helper,
+ $phpbb_container,
+ $cache_path,
+ null,
+ $phpbb_container->get('template.twig.loader')
+);
+
+$language_loader = new \phpbb\language\language_file_loader($phpbb_root_path, $phpEx);
+$phpbb_container->set('template.twig.environment', $twig_environment);
+$phpbb_container->set('language.loader', $language_loader);
+$twig_context = new \phpbb\template\context();
+$template = new \phpbb\template\twig\twig(
+ $phpbb_path_helper,
+ $config,
+ $twig_context,
+ $twig_environment,
+ $cache_path,
+ $user,
+ array($phpbb_container->get('template.twig.extensions.phpbb'))
+);
+
$paths = array($phpbb_root_path . 'install/update/new/adm/style', $phpbb_admin_path . 'style');
$paths = array_filter($paths, 'is_dir');
$template->set_custom_style(array(
diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php
index a0f8a928de..d72ee1a633 100644
--- a/phpBB/install/install_convert.php
+++ b/phpBB/install/install_convert.php
@@ -96,6 +96,9 @@ class install_convert extends module
/** @var string */
protected $php_ext;
+ /** @var \phpbb\filesystem\filesystem_interface */
+ protected $filesystem;
+
/**
* Variables used while converting, they are accessible from the global variable $convert
*/
@@ -116,6 +119,7 @@ class install_convert extends module
$this->template = $template;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $phpEx;
+ $this->filesystem = new \phpbb\filesystem\filesystem();
if (!$this->check_phpbb_installed())
{
@@ -127,10 +131,11 @@ class install_convert extends module
// Enable super globals to prevent issues with the new \phpbb\request\request object
$request->enable_super_globals();
// Create a normal container now
- $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
- $phpbb_container = $phpbb_container_builder->get_container();
+ $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_root_path, $phpEx);
+ $phpbb_container = $phpbb_container_builder->with_config($phpbb_config_php_file)->get_container();
// Create cache
+ /* @var $cache \phpbb\cache\service */
$cache = $phpbb_container->get('cache');
switch ($sub)
@@ -148,13 +153,11 @@ class install_convert extends module
unset($dbpasswd);
// We need to fill the config to let internal functions correctly work
- $config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
- set_config(null, null, null, $config);
- set_config_count(null, null, null, $config);
+ $config = new \phpbb\config\db($db, new \phpbb\cache\driver\dummy, CONFIG_TABLE);
// Detect if there is already a conversion in progress at this point and offer to resume
// It's quite possible that the user will get disconnected during a large conversion so they need to be able to resume it
- $new_conversion = request_var('new_conv', 0);
+ $new_conversion = $request->variable('new_conv', 0);
if ($new_conversion)
{
@@ -389,11 +392,9 @@ class install_convert extends module
$this->page_title = $lang['STAGE_SETTINGS'];
// We need to fill the config to let internal functions correctly work
- $config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
- set_config(null, null, null, $config);
- set_config_count(null, null, null, $config);
+ $config = new \phpbb\config\db($db, new \phpbb\cache\driver\dummy, CONFIG_TABLE);
- $convertor_tag = request_var('tag', '');
+ $convertor_tag = $request->variable('tag', '');
if (empty($convertor_tag))
{
@@ -418,20 +419,20 @@ class install_convert extends module
$submit = (isset($_POST['submit'])) ? true : false;
- $src_dbms = request_var('src_dbms', $convertor_data['dbms']);
- $src_dbhost = request_var('src_dbhost', $convertor_data['dbhost']);
- $src_dbport = request_var('src_dbport', $convertor_data['dbport']);
- $src_dbuser = request_var('src_dbuser', $convertor_data['dbuser']);
- $src_dbpasswd = request_var('src_dbpasswd', $convertor_data['dbpasswd']);
- $src_dbname = request_var('src_dbname', $convertor_data['dbname']);
- $src_table_prefix = request_var('src_table_prefix', $convertor_data['table_prefix']);
- $forum_path = request_var('forum_path', $convertor_data['forum_path']);
- $refresh = request_var('refresh', 1);
+ $src_dbms = $request->variable('src_dbms', $convertor_data['dbms']);
+ $src_dbhost = $request->variable('src_dbhost', $convertor_data['dbhost']);
+ $src_dbport = $request->variable('src_dbport', $convertor_data['dbport']);
+ $src_dbuser = $request->variable('src_dbuser', $convertor_data['dbuser']);
+ $src_dbpasswd = $request->variable('src_dbpasswd', $convertor_data['dbpasswd']);
+ $src_dbname = $request->variable('src_dbname', $convertor_data['dbname']);
+ $src_table_prefix = $request->variable('src_table_prefix', $convertor_data['table_prefix']);
+ $forum_path = $request->variable('forum_path', $convertor_data['forum_path']);
+ $refresh = $request->variable('refresh', 1);
// Default URL of the old board
// @todo Are we going to use this for attempting to convert URL references in posts, or should we remove it?
// -> We should convert old urls to the new relative urls format
- // $src_url = request_var('src_url', 'Not in use at the moment');
+ // $src_url = $request->variable('src_url', 'Not in use at the moment');
// strip trailing slash from old forum path
$forum_path = (strlen($forum_path) && $forum_path[strlen($forum_path) - 1] == '/') ? substr($forum_path, 0, -1) : $forum_path;
@@ -494,7 +495,9 @@ class install_convert extends module
{
$prefixes = array();
- $tables_existing = get_tables($src_db);
+ $db_tools_factory = new \phpbb\db\tools\factory();
+ $db_tools = $db_tools_factory->get($src_db);
+ $tables_existing = $db_tools->sql_list_tables();
$tables_existing = array_map('strtolower', $tables_existing);
foreach ($tables_existing as $table_name)
{
@@ -533,24 +536,27 @@ class install_convert extends module
if (!sizeof($error))
{
// Save convertor Status
- set_config('convert_progress', serialize(array(
+ $config->set('convert_progress', serialize(array(
'step' => '',
'table_prefix' => $src_table_prefix,
'tag' => $convertor_tag,
- )), true);
- set_config('convert_db_server', serialize(array(
+ )), false);
+ $config->set('convert_db_server', serialize(array(
'dbms' => $src_dbms,
'dbhost' => $src_dbhost,
'dbport' => $src_dbport,
'dbname' => $src_dbname,
- )), true);
- set_config('convert_db_user', serialize(array(
+ )), false);
+ $config->set('convert_db_user', serialize(array(
'dbuser' => $src_dbuser,
'dbpasswd' => $src_dbpasswd,
- )), true);
+ )), false);
// Save options
- set_config('convert_options', serialize(array('forum_path' => './../' . $forum_path, 'refresh' => $refresh)), true);
+ $config->set('convert_options', serialize(array(
+ 'forum_path' => './../' . $forum_path,
+ 'refresh' => $refresh
+ )), false);
$template->assign_block_vars('checks', array(
'TITLE' => $lang['VERIFY_OPTIONS'],
@@ -633,9 +639,7 @@ class install_convert extends module
unset($dbpasswd);
// We need to fill the config to let internal functions correctly work
- $config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
- set_config(null, null, null, $config);
- set_config_count(null, null, null, $config);
+ $config = new \phpbb\config\db($db, new \phpbb\cache\driver\dummy, CONFIG_TABLE);
// Override a couple of config variables for the duration
$config['max_quote_depth'] = 0;
@@ -787,7 +791,7 @@ class install_convert extends module
if (!class_exists($search_type))
{
$search_type = '\phpbb\search\fulltext_native';
- set_config('search_type', $search_type);
+ $config->set('search_type', $search_type);
}
if (!class_exists($search_type))
@@ -806,10 +810,10 @@ class install_convert extends module
include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
$message_parser = new parse_message();
- $jump = request_var('jump', 0);
- $final_jump = request_var('final_jump', 0);
- $sync_batch = request_var('sync_batch', -1);
- $last_statement = request_var('last', 0);
+ $jump = $request->variable('jump', 0);
+ $final_jump = $request->variable('final_jump', 0);
+ $sync_batch = $request->variable('sync_batch', -1);
+ $last_statement = $request->variable('last', 0);
// We are running sync...
if ($sync_batch >= 0)
@@ -830,9 +834,9 @@ class install_convert extends module
return;
}
- $current_table = request_var('current_table', 0);
+ $current_table = $request->variable('current_table', 0);
$old_current_table = min(-1, $current_table - 1);
- $skip_rows = request_var('skip_rows', 0);
+ $skip_rows = $request->variable('skip_rows', 0);
if (!$current_table && !$skip_rows)
{
@@ -859,7 +863,7 @@ class install_convert extends module
$this->p_master->error($user->lang['DEV_NO_TEST_FILE'], __LINE__, __FILE__);
}
- if (!$local_path || !phpbb_is_writable($phpbb_root_path . $local_path))
+ if (!$local_path || !$this->filesystem->is_writable($phpbb_root_path . $local_path))
{
if (!$local_path)
{
@@ -1560,26 +1564,26 @@ class install_convert extends module
*/
function save_convert_progress($step)
{
- global $convert, $language;
+ global $config, $convert, $language;
// Save convertor Status
- set_config('convert_progress', serialize(array(
+ $config->set('convert_progress', serialize(array(
'step' => $step,
'table_prefix' => $convert->src_table_prefix,
'tag' => $convert->convertor_tag,
- )), true);
+ )), false);
- set_config('convert_db_server', serialize(array(
+ $config->set('convert_db_server', serialize(array(
'dbms' => $convert->src_dbms,
'dbhost' => $convert->src_dbhost,
'dbport' => $convert->src_dbport,
'dbname' => $convert->src_dbname,
- )), true);
+ )), false);
- set_config('convert_db_user', serialize(array(
+ $config->set('convert_db_user', serialize(array(
'dbuser' => $convert->src_dbuser,
'dbpasswd' => $convert->src_dbpasswd,
- )), true);
+ )), false);
return $this->p_master->module_url . "?mode={$this->mode}&amp;sub=in_progress&amp;tag={$convert->convertor_tag}$step&amp;language=$language";
}
@@ -1603,8 +1607,7 @@ class install_convert extends module
phpbb_cache_moderators($db, $cache, $auth);
// And finally, add a note to the log
- $phpbb_log = $phpbb_container->get('log');
- add_log('admin', 'LOG_INSTALL_CONVERTED', $convert->convertor_data['forum_name'], $config['version']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_INSTALL_CONVERTED', false, array($convert->convertor_data['forum_name'], $config['version']));
$url = $this->p_master->module_url . "?mode={$this->mode}&amp;sub=final&amp;language=$language";
@@ -1759,7 +1762,7 @@ class install_convert extends module
if (!isset($config['board_startdate']) || ($row['board_startdate'] < $config['board_startdate'] && $row['board_startdate'] > 0))
{
- set_config('board_startdate', $row['board_startdate']);
+ $config->set('board_startdate', $row['board_startdate']);
$db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_regdate = ' . $row['board_startdate'] . ' WHERE user_id = ' . ANONYMOUS);
}
diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php
index 5b818f9475..0e223866b1 100644
--- a/phpBB/install/install_install.php
+++ b/phpBB/install/install_install.php
@@ -43,9 +43,15 @@ if (!empty($setmodules))
*/
class install_install extends module
{
+ /**
+ * @var \phpbb\filesystem\filesystem_interface
+ */
+ protected $filesystem;
+
function install_install(&$p_master)
{
$this->p_master = &$p_master;
+ $this->filesystem = new \phpbb\filesystem\filesystem();
}
function main($mode, $sub)
@@ -104,11 +110,14 @@ class install_install extends module
$request->enable_super_globals();
// Create a normal container now
- $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
- $phpbb_container = $phpbb_container_builder->get_container();
+ $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_root_path, $phpEx);
+ $phpbb_container = $phpbb_container_builder->with_config($phpbb_config_php_file)->get_container();
// Sets the global variables
+ /* @var $cache \phpbb\cache\service */
$cache = $phpbb_container->get('cache');
+
+ /* @var $phpbb_log \phpbb\log\log_interface */
$phpbb_log = $phpbb_container->get('log');
$this->build_search_index($mode, $sub);
@@ -154,7 +163,7 @@ class install_install extends module
// Test the minimum PHP version
$php_version = PHP_VERSION;
- if (version_compare($php_version, '5.3.3') < 0)
+ if (version_compare($php_version, '5.3.9') < 0)
{
$result = '<strong style="color:red">' . $lang['NO'] . '</strong>';
}
@@ -463,13 +472,29 @@ class install_install extends module
if (!file_exists($phpbb_root_path . $dir))
{
@mkdir($phpbb_root_path . $dir, 0777);
- phpbb_chmod($phpbb_root_path . $dir, CHMOD_READ | CHMOD_WRITE);
+
+ try
+ {
+ $this->filesystem->phpbb_chmod($phpbb_root_path . $dir, CHMOD_READ | CHMOD_WRITE);
+ }
+ catch (\phpbb\filesystem\exception\filesystem_exception $e)
+ {
+ // Do nothing
+ }
}
// Now really check
if (file_exists($phpbb_root_path . $dir) && is_dir($phpbb_root_path . $dir))
{
- phpbb_chmod($phpbb_root_path . $dir, CHMOD_READ | CHMOD_WRITE);
+ try
+ {
+ $this->filesystem->phpbb_chmod($phpbb_root_path . $dir, CHMOD_READ | CHMOD_WRITE);
+ }
+ catch (\phpbb\filesystem\exception\filesystem_exception $e)
+ {
+ // Do nothing
+ }
+
$exists = true;
}
@@ -511,7 +536,7 @@ class install_install extends module
$write = $exists = true;
if (file_exists($phpbb_root_path . $dir))
{
- if (!phpbb_is_writable($phpbb_root_path . $dir))
+ if (!$this->filesystem->is_writable($phpbb_root_path . $dir))
{
$write = false;
}
@@ -889,7 +914,7 @@ class install_install extends module
$config_data = phpbb_create_config_file_data($data, $available_dbms[$data['dbms']]['DRIVER']);
// Attempt to write out the config file directly. If it works, this is the easiest way to do it ...
- if ((file_exists($phpbb_root_path . 'config.' . $phpEx) && phpbb_is_writable($phpbb_root_path . 'config.' . $phpEx)) || phpbb_is_writable($phpbb_root_path))
+ if ((file_exists($phpbb_root_path . 'config.' . $phpEx) && $this->filesystem->is_writable($phpbb_root_path . 'config.' . $phpEx)) || $this->filesystem->is_writable($phpbb_root_path))
{
// Assume it will work ... if nothing goes wrong below
$written = true;
@@ -911,7 +936,14 @@ class install_install extends module
if ($written)
{
// We may revert back to chmod() if we see problems with users not able to change their config.php file directly
- phpbb_chmod($phpbb_root_path . 'config.' . $phpEx, CHMOD_READ);
+ try
+ {
+ $this->filesystem->phpbb_chmod($phpbb_root_path . 'config.' . $phpEx, CHMOD_READ);
+ }
+ catch (\phpbb\filesystem\exception\filesystem_exception $e)
+ {
+ // Do nothing
+ }
}
}
@@ -1190,12 +1222,14 @@ class install_install extends module
include($phpbb_root_path . 'includes/constants.' . $phpEx);
}
- $finder = new \phpbb\finder(new \phpbb\filesystem(), $phpbb_root_path, null, $phpEx);
+ $finder = new \phpbb\finder(new \phpbb\filesystem\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);
+ $factory = new \phpbb\db\tools\factory();
+ $db_tools = $factory->get($sqlite_db, true);
+ $schema_generator = new \phpbb\db\migration\schema_generator($classes, new \phpbb\config\config(array()), $sqlite_db, $db_tools, $phpbb_root_path, $phpEx, $table_prefix);
$db_table_schema = $schema_generator->get_schema();
}
@@ -1207,7 +1241,8 @@ class install_install extends module
define('CONFIG_TABLE', $data['table_prefix'] . 'config');
}
- $db_tools = new \phpbb\db\tools($db);
+ $factory = new \phpbb\db\tools\factory();
+ $db_tools = $factory->get($db);
foreach ($db_table_schema as $table_name => $table_data)
{
$db_tools->sql_create_table(
@@ -1487,9 +1522,7 @@ class install_install extends module
include_once($phpbb_root_path . 'phpbb/search/fulltext_native.' . $phpEx);
// We need to fill the config to let internal functions correctly work
- $config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
- set_config(null, null, null, $config);
- set_config_count(null, null, null, $config);
+ $config = new \phpbb\config\db($db, new \phpbb\cache\driver\dummy, CONFIG_TABLE);
$error = false;
$search = new \phpbb\search\fulltext_native($error, $phpbb_root_path, $phpEx, $auth, $config, $db, $user, $phpbb_dispatcher);
@@ -1515,12 +1548,18 @@ class install_install extends module
// modules require an extension manager
if (empty($phpbb_extension_manager))
{
+ /* @var $phpbb_extension_manager \phpbb\extension\manager */
$phpbb_extension_manager = $phpbb_container->get('ext.manager');
}
- include_once($phpbb_root_path . 'includes/acp/acp_modules.' . $phpEx);
-
- $_module = new acp_modules();
+ $_module = new \phpbb\module\module_manager(
+ new \phpbb\cache\driver\dummy(),
+ $db,
+ $phpbb_extension_manager,
+ MODULES_TABLE,
+ $phpbb_root_path,
+ $phpEx
+ );
$module_classes = array('acp', 'mcp', 'ucp');
// Add categories
@@ -1551,7 +1590,7 @@ class install_install extends module
);
// Add category
- $_module->update_module_data($module_data, true);
+ $_module->update_module_data($module_data);
// Check for last sql error happened
if ($db->get_sql_error_triggered())
@@ -1585,7 +1624,7 @@ class install_install extends module
'module_auth' => '',
);
- $_module->update_module_data($module_data, true);
+ $_module->update_module_data($module_data);
// Check for last sql error happened
if ($db->get_sql_error_triggered())
@@ -1601,7 +1640,7 @@ class install_install extends module
}
// Get the modules we want to add... returned sorted by name
- $module_info = $_module->get_module_infos('', $module_class);
+ $module_info = $_module->get_module_infos($module_class);
foreach ($module_info as $module_basename => $fileinfo)
{
@@ -1625,7 +1664,7 @@ class install_install extends module
'module_auth' => $row['auth'],
);
- $_module->update_module_data($module_data, true);
+ $_module->update_module_data($module_data);
// Check for last sql error happened
if ($db->get_sql_error_triggered())
@@ -1650,7 +1689,7 @@ class install_install extends module
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- $_module->move_module_by($row, 'move_up', 4);
+ $_module->move_module_by($row, 'acp', 'move_up', 4);
// Move permissions intro screen module 4 up...
$sql = 'SELECT *
@@ -1662,7 +1701,7 @@ class install_install extends module
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- $_module->move_module_by($row, 'move_up', 4);
+ $_module->move_module_by($row, 'acp', 'move_up', 4);
// Move manage users screen module 5 up...
$sql = 'SELECT *
@@ -1674,7 +1713,7 @@ class install_install extends module
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- $_module->move_module_by($row, 'move_up', 5);
+ $_module->move_module_by($row, 'acp', 'move_up', 5);
// Move extension management module 1 up...
$sql = 'SELECT *
@@ -1687,7 +1726,7 @@ class install_install extends module
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- $_module->move_module_by($row, 'move_up', 1);
+ $_module->move_module_by($row, 'acp', 'move_up', 1);
}
if ($module_class == 'mcp')
@@ -1702,7 +1741,7 @@ class install_install extends module
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- $_module->move_module_by($row, 'move_down', 3);
+ $_module->move_module_by($row, 'mcp', 'move_down', 3);
// Move closed pm reports module 3 down...
$sql = 'SELECT *
@@ -1714,7 +1753,7 @@ class install_install extends module
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- $_module->move_module_by($row, 'move_down', 3);
+ $_module->move_module_by($row, 'mcp', 'move_down', 3);
// Move open pm reports module 3 down...
$sql = 'SELECT *
@@ -1726,7 +1765,7 @@ class install_install extends module
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- $_module->move_module_by($row, 'move_down', 3);
+ $_module->move_module_by($row, 'mcp', 'move_down', 3);
}
if ($module_class == 'ucp')
@@ -1741,7 +1780,7 @@ class install_install extends module
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- $_module->move_module_by($row, 'move_down', 4);
+ $_module->move_module_by($row, 'ucp', 'move_down', 4);
// Move notification options module 4 down...
$sql = 'SELECT *
@@ -1753,7 +1792,7 @@ class install_install extends module
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- $_module->move_module_by($row, 'move_down', 4);
+ $_module->move_module_by($row, 'ucp', 'move_down', 4);
// Move OAuth module 5 down...
$sql = 'SELECT *
@@ -1765,7 +1804,7 @@ class install_install extends module
$row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- $_module->move_module_by($row, 'move_down', 5);
+ $_module->move_module_by($row, 'ucp', 'move_down', 5);
}
// And now for the special ones
@@ -1804,7 +1843,7 @@ class install_install extends module
'module_auth' => $row['module_auth'],
);
- $_module->update_module_data($module_data, true);
+ $_module->update_module_data($module_data);
// Check for last sql error happened
if ($db->get_sql_error_triggered())
@@ -1816,7 +1855,7 @@ class install_install extends module
}
}
- $_module->remove_cache_file();
+ $_module->remove_cache_file($module_class);
}
}
@@ -1903,9 +1942,7 @@ class install_install extends module
$data = $this->get_submitted_data();
// We need to fill the config to let internal functions correctly work
- $config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
- set_config(null, null, null, $config);
- set_config_count(null, null, null, $config);
+ $config = new \phpbb\config\db($db, new \phpbb\cache\driver\dummy, CONFIG_TABLE);
$sql = 'SELECT group_id
FROM ' . GROUPS_TABLE . "
@@ -1969,7 +2006,7 @@ class install_install extends module
*/
function email_admin($mode, $sub)
{
- global $auth, $config, $db, $lang, $template, $user, $phpbb_root_path, $phpbb_admin_path, $phpEx;
+ global $auth, $config, $db, $lang, $template, $user, $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_log;
$this->page_title = $lang['STAGE_FINAL'];
@@ -1977,9 +2014,7 @@ class install_install extends module
$data = $this->get_submitted_data();
// We need to fill the config to let internal functions correctly work
- $config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
- set_config(null, null, null, $config);
- set_config_count(null, null, null, $config);
+ $config = new \phpbb\config\db($db, new \phpbb\cache\driver\dummy, CONFIG_TABLE);
$user->session_begin();
$auth->login($data['admin_name'], $data['admin_pass1'], false, true, true);
@@ -2010,7 +2045,7 @@ class install_install extends module
}
// And finally, add a note to the log
- add_log('admin', 'LOG_INSTALL_INSTALLED', $config['version']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_INSTALL_INSTALLED', false, array($config['version']));
$template->assign_vars(array(
'TITLE' => $lang['INSTALL_CONGRATS'],
@@ -2026,12 +2061,12 @@ class install_install extends module
*/
function disable_avatars_if_unwritable()
{
- global $phpbb_root_path;
+ global $config, $phpbb_root_path;
- if (!phpbb_is_writable($phpbb_root_path . 'images/avatars/upload/'))
+ if (!$this->filesystem->is_writable($phpbb_root_path . 'images/avatars/upload/'))
{
- set_config('allow_avatar', 0);
- set_config('allow_avatar_upload', 0);
+ $config->set('allow_avatar', 0);
+ $config->set('allow_avatar_upload', 0);
}
}
@@ -2078,36 +2113,38 @@ class install_install extends module
*/
function get_submitted_data()
{
+ global $request;
+
return array(
- 'language' => basename(request_var('language', '')),
- 'dbms' => request_var('dbms', ''),
- 'dbhost' => request_var('dbhost', '', true),
- 'dbport' => request_var('dbport', ''),
- 'dbuser' => request_var('dbuser', ''),
- 'dbpasswd' => request_var('dbpasswd', '', true),
- 'dbname' => request_var('dbname', ''),
- 'table_prefix' => request_var('table_prefix', ''),
- 'default_lang' => basename(request_var('default_lang', '')),
- 'admin_name' => utf8_normalize_nfc(request_var('admin_name', '', true)),
- 'admin_pass1' => request_var('admin_pass1', '', true),
- 'admin_pass2' => request_var('admin_pass2', '', true),
- 'board_email' => strtolower(request_var('board_email', '')),
- 'img_imagick' => request_var('img_imagick', ''),
- 'ftp_path' => request_var('ftp_path', ''),
- 'ftp_user' => request_var('ftp_user', ''),
- 'ftp_pass' => request_var('ftp_pass', ''),
- 'email_enable' => request_var('email_enable', ''),
- 'smtp_delivery' => request_var('smtp_delivery', ''),
- 'smtp_host' => request_var('smtp_host', ''),
- 'smtp_auth' => request_var('smtp_auth', ''),
- 'smtp_user' => request_var('smtp_user', ''),
- 'smtp_pass' => request_var('smtp_pass', ''),
- 'cookie_secure' => request_var('cookie_secure', ''),
- 'force_server_vars' => request_var('force_server_vars', ''),
- 'server_protocol' => request_var('server_protocol', ''),
- 'server_name' => request_var('server_name', ''),
- 'server_port' => request_var('server_port', ''),
- 'script_path' => request_var('script_path', ''),
+ 'language' => basename($request->variable('language', '')),
+ 'dbms' => $request->variable('dbms', ''),
+ 'dbhost' => $request->variable('dbhost', ''),
+ 'dbport' => $request->variable('dbport', ''),
+ 'dbuser' => $request->variable('dbuser', ''),
+ 'dbpasswd' => $request->variable('dbpasswd', '', true),
+ 'dbname' => $request->variable('dbname', ''),
+ 'table_prefix' => $request->variable('table_prefix', ''),
+ 'default_lang' => basename($request->variable('default_lang', '')),
+ 'admin_name' => $request->variable('admin_name', '', true),
+ 'admin_pass1' => $request->variable('admin_pass1', '', true),
+ 'admin_pass2' => $request->variable('admin_pass2', '', true),
+ 'board_email' => strtolower($request->variable('board_email', '')),
+ 'img_imagick' => $request->variable('img_imagick', ''),
+ 'ftp_path' => $request->variable('ftp_path', ''),
+ 'ftp_user' => $request->variable('ftp_user', ''),
+ 'ftp_pass' => $request->variable('ftp_pass', ''),
+ 'email_enable' => $request->variable('email_enable', ''),
+ 'smtp_delivery' => $request->variable('smtp_delivery', ''),
+ 'smtp_host' => $request->variable('smtp_host', ''),
+ 'smtp_auth' => $request->variable('smtp_auth', ''),
+ 'smtp_user' => $request->variable('smtp_user', ''),
+ 'smtp_pass' => $request->variable('smtp_pass', ''),
+ 'cookie_secure' => $request->variable('cookie_secure', ''),
+ 'force_server_vars' => $request->variable('force_server_vars', ''),
+ 'server_protocol' => $request->variable('server_protocol', ''),
+ 'server_name' => $request->variable('server_name', ''),
+ 'server_port' => $request->variable('server_port', ''),
+ 'script_path' => $request->variable('script_path', ''),
);
}
diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php
index 82ca0fc18d..d9ba2e7fe9 100644
--- a/phpBB/install/install_update.php
+++ b/phpBB/install/install_update.php
@@ -55,6 +55,8 @@ class install_update extends module
var $update_to_version;
+ protected $filesystem;
+
// Set to false
var $test_update = false;
@@ -74,18 +76,25 @@ class install_update extends module
$request->enable_super_globals();
// Create a normal container now
- $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx);
- $phpbb_container_builder->set_dump_container(false);
- $phpbb_container_builder->set_use_extensions(false);
+ $phpbb_container_builder = new \phpbb\di\container_builder($phpbb_root_path, $phpEx);
+ $phpbb_container = $phpbb_container_builder
+ ->with_config($phpbb_config_php_file)
+ ->without_cache()
+ ->without_extensions()
+ ;
+
if (file_exists($phpbb_root_path . 'install/update/new/config'))
{
- $phpbb_container_builder->set_config_path($phpbb_root_path . 'install/update/new/config');
+ $phpbb_container_builder->with_config_path($phpbb_root_path . 'install/update/new/config');
}
$phpbb_container = $phpbb_container_builder->get_container();
// Writes into global $cache
+ /* @var $cache \phpbb\cache\service */
$cache = $phpbb_container->get('cache');
+ $this->filesystem = $phpbb_container->get('filesystem');
+
$this->tpl_name = 'install_update';
$this->page_title = 'UPDATE_INSTALLATION';
@@ -113,9 +122,7 @@ class install_update extends module
unset($dbpasswd);
// We need to fill the config to let internal functions correctly work
- $config = new \phpbb\config\db($db, new \phpbb\cache\driver\null, CONFIG_TABLE);
- set_config(null, null, null, $config);
- set_config_count(null, null, null, $config);
+ $config = new \phpbb\config\db($db, new \phpbb\cache\driver\dummy, CONFIG_TABLE);
// Force template recompile
$config['load_tplcompile'] = 1;
@@ -161,6 +168,7 @@ class install_update extends module
));
// Get current and latest version
+ /* @var $version_helper \phpbb\version_helper */
$version_helper = $phpbb_container->get('version_helper');
try
{
@@ -234,7 +242,7 @@ class install_update extends module
// Fill DB version
if (empty($config['dbms_version']))
{
- set_config('dbms_version', $db->sql_server_info(true));
+ $config->set('dbms_version', $db->sql_server_info(true));
}
if ($this->test_update === false)
@@ -351,7 +359,7 @@ class install_update extends module
$this->page_title = 'STAGE_FILE_CHECK';
// Now make sure our update list is correct if the admin refreshes
- $action = request_var('action', '');
+ $action = $request->variable('action', '');
// We are directly within an update. To make sure our update list is correct we check its status.
$update_list = ($request->variable('check_again', false, false, \phpbb\request\request_interface::POST)) ? false : $cache->get('_update_list');
@@ -519,6 +527,8 @@ class install_update extends module
if ($all_up_to_date)
{
global $phpbb_container;
+
+ /* @var $phpbb_log \phpbb\log\log_interface */
$phpbb_log = $phpbb_container->get('log');
// Add database update to log
@@ -539,8 +549,8 @@ class install_update extends module
$s_hidden_fields = '';
$params = array();
- $conflicts = request_var('conflict', array('' => 0));
- $modified = request_var('modified', array('' => 0));
+ $conflicts = $request->variable('conflict', array('' => 0));
+ $modified = $request->variable('modified', array('' => 0));
foreach ($conflicts as $filename => $merge_option)
{
@@ -558,7 +568,7 @@ class install_update extends module
$params[] = 'modified[' . urlencode($filename) . ']=' . urlencode($merge_option);
}
- $no_update = request_var('no_update', array(0 => ''));
+ $no_update = $request->variable('no_update', array(0 => ''));
foreach ($no_update as $index => $filename)
{
@@ -793,7 +803,7 @@ class install_update extends module
{
$this->include_file('includes/functions_compress.' . $phpEx);
- $use_method = request_var('use_method', '');
+ $use_method = $request->variable('use_method', '');
$methods = array('.tar');
$available_methods = array('.tar.gz' => 'zlib', '.tar.bz2' => 'bz2', '.zip' => 'zlib');
@@ -864,9 +874,9 @@ class install_update extends module
$this->include_file('includes/functions_transfer.' . $phpEx);
// Choose FTP, if not available use fsock...
- $method = basename(request_var('method', ''));
+ $method = basename($request->variable('method', ''));
$submit = (isset($_POST['submit'])) ? true : false;
- $test_ftp_connection = request_var('test_connection', '');
+ $test_ftp_connection = $request->variable('test_connection', '');
if (!$method || !class_exists($method))
{
@@ -883,12 +893,12 @@ class install_update extends module
if ($test_ftp_connection || $submit)
{
$transfer = new $method(
- request_var('host', ''),
- request_var('username', ''),
+ $request->variable('host', ''),
+ $request->variable('username', ''),
htmlspecialchars_decode($request->untrimmed_variable('password', '')),
- request_var('root_path', ''),
- request_var('port', ''),
- request_var('timeout', '')
+ $request->variable('root_path', ''),
+ $request->variable('port', ''),
+ $request->variable('timeout', '')
);
$test_connection = $transfer->open_session();
@@ -959,7 +969,7 @@ class install_update extends module
// Now init the connection
if ($update_mode == 'download')
{
- if (function_exists('phpbb_is_writable') && !phpbb_is_writable($phpbb_root_path . 'store/'))
+ if ($this->filesystem->is_writable($phpbb_root_path . 'store/'))
{
trigger_error(sprintf('The directory “%s†is not writable.', $phpbb_root_path . 'store/'), E_USER_ERROR);
}
@@ -976,12 +986,12 @@ class install_update extends module
else
{
$transfer = new $method(
- request_var('host', ''),
- request_var('username', ''),
+ $request->variable('host', ''),
+ $request->variable('username', ''),
htmlspecialchars_decode($request->untrimmed_variable('password', '')),
- request_var('root_path', ''),
- request_var('port', ''),
- request_var('timeout', '')
+ $request->variable('root_path', ''),
+ $request->variable('port', ''),
+ $request->variable('timeout', '')
);
$transfer->open_session();
}
@@ -1105,15 +1115,15 @@ class install_update extends module
*/
function show_diff(&$update_list)
{
- global $phpbb_root_path, $template, $user, $phpbb_adm_relative_path;
+ global $phpbb_root_path, $template, $user, $request, $phpbb_adm_relative_path;
$this->tpl_name = 'install_update_diff';
$this->page_title = 'VIEWING_FILE_DIFF';
- $status = request_var('status', '');
- $file = request_var('file', '');
- $diff_mode = request_var('diff_mode', 'inline');
+ $status = $request->variable('status', '');
+ $file = $request->variable('file', '');
+ $diff_mode = $request->variable('diff_mode', 'inline');
// First of all make sure the file is within our file update list with the correct status
$found_entry = array();
@@ -1142,7 +1152,7 @@ class install_update extends module
switch ($status)
{
case 'conflict':
- $option = request_var('op', 0);
+ $option = $request->variable('op', 0);
switch ($option)
{
@@ -1193,7 +1203,7 @@ class install_update extends module
break;
case 'modified':
- $option = request_var('op', 0);
+ $option = $request->variable('op', 0);
switch ($option)
{
@@ -1689,7 +1699,7 @@ class install_update extends module
// Get custom installed styles...
$sql = 'SELECT style_name, style_path
FROM ' . STYLES_TABLE . "
- WHERE LOWER(style_name) NOT IN ('subsilver2', 'prosilver')";
+ WHERE LOWER(style_name) NOT IN ('prosilver')";
$result = $db->sql_query($sql);
$templates = array();
diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql
index 9af2bc13f7..6c993d7d68 100644
--- a/phpBB/install/schemas/schema_data.sql
+++ b/phpBB/install/schemas/schema_data.sql
@@ -41,6 +41,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_pm', '1'
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_smilies', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_smilies', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_topic_notify', '1');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('allowed_schemes_links', 'http,https,ftp');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('assets_version', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('attachment_quota', '52428800');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_bbcode_pm', '1');
@@ -107,6 +108,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_max_chunk_si
INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_package_size', '20');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_confirm', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_mod_rewrite', '0');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_board_notifications', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_pm_icons', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('enable_post_confirm', '1');
INSERT INTO phpbb_config (config_name, config_value) VALUES ('feed_enable', '1');
@@ -273,7 +275,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.7-dev');
+INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.2.0-a1-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');
@@ -309,6 +311,7 @@ INSERT INTO phpbb_config_text (config_name, config_value) VALUES ('contact_admin
# -- Forum related auth options
INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_', 1);
INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_announce', 1);
+INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_announce_global', 1);
INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_attach', 1);
INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_bbcode', 1);
INSERT INTO phpbb_acl_options (auth_option, is_local) VALUES ('f_bump', 1);
@@ -551,7 +554,7 @@ INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 14, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%';
# Standard Access (f_)
-INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 15, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_flash', 'f_ignoreflood', 'f_poll', 'f_sticky', 'f_user_lock');
+INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 15, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_announce_global', 'f_flash', 'f_ignoreflood', 'f_poll', 'f_sticky', 'f_user_lock');
# No Access (f_)
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 16, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option = 'f_';
@@ -560,20 +563,20 @@ INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 17, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_', 'f_download', 'f_list', 'f_read', 'f_search', 'f_subscribe', 'f_print');
# Limited Access (f_)
-INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 18, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_attach', 'f_bump', 'f_delete', 'f_flash', 'f_icons', 'f_ignoreflood', 'f_poll', 'f_sticky', 'f_user_lock', 'f_votechg');
+INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 18, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_announce_global', 'f_attach', 'f_bump', 'f_delete', 'f_flash', 'f_icons', 'f_ignoreflood', 'f_poll', 'f_sticky', 'f_user_lock', 'f_votechg');
# Bot Access (f_)
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 19, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_', 'f_download', 'f_list', 'f_read', 'f_print');
# On Moderation Queue (f_)
-INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 20, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_bump', 'f_delete', 'f_flash', 'f_icons', 'f_ignoreflood', 'f_poll', 'f_sticky', 'f_user_lock', 'f_votechg', 'f_noapprove');
+INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 20, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_announce_global', 'f_bump', 'f_delete', 'f_flash', 'f_icons', 'f_ignoreflood', 'f_poll', 'f_sticky', 'f_user_lock', 'f_votechg', 'f_noapprove');
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 20, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option IN ('f_noapprove');
# Standard Access + Polls (f_)
-INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 21, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_flash', 'f_ignoreflood', 'f_sticky', 'f_user_lock');
+INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 21, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_announce_global', 'f_flash', 'f_ignoreflood', 'f_sticky', 'f_user_lock');
# Limited Access + Polls (f_)
-INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 22, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_attach', 'f_bump', 'f_delete', 'f_flash', 'f_icons', 'f_ignoreflood', 'f_sticky', 'f_user_lock', 'f_votechg');
+INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 22, auth_option_id, 1 FROM phpbb_acl_options WHERE auth_option LIKE 'f_%' AND auth_option NOT IN ('f_announce', 'f_announce_global', 'f_attach', 'f_bump', 'f_delete', 'f_flash', 'f_icons', 'f_ignoreflood', 'f_sticky', 'f_user_lock', 'f_votechg');
# New Member (u_)
INSERT INTO phpbb_acl_roles_data (role_id, auth_option_id, auth_setting) SELECT 23, auth_option_id, 0 FROM phpbb_acl_options WHERE auth_option LIKE 'u_%' AND auth_option IN ('u_sendpm', 'u_masspm', 'u_masspm_group', 'u_chgprofileinfo');
@@ -715,10 +718,7 @@ INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mo
INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('ARCHIVES', 0, 1, 1, '', 0, '');
INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('PLAIN_TEXT', 0, 0, 1, '', 0, '');
INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('DOCUMENTS', 0, 0, 1, '', 0, '');
-INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('REAL_MEDIA', 3, 0, 1, '', 0, '');
-INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('WINDOWS_MEDIA', 2, 0, 1, '', 0, '');
INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('FLASH_FILES', 5, 0, 1, '', 0, '');
-INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('QUICKTIME_MEDIA', 6, 0, 1, '', 0, '');
INSERT INTO phpbb_extension_groups (group_name, cat_id, allow_group, download_mode, upload_icon, max_filesize, allowed_forums) VALUES ('DOWNLOADABLE_FILES', 0, 0, 1, '', 0, '');
# -- extensions
@@ -775,27 +775,13 @@ INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'ods');
INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'odt');
INSERT INTO phpbb_extensions (group_id, extension) VALUES (4, 'rtf');
-INSERT INTO phpbb_extensions (group_id, extension) VALUES (5, 'rm');
-INSERT INTO phpbb_extensions (group_id, extension) VALUES (5, 'ram');
+INSERT INTO phpbb_extensions (group_id, extension) VALUES (5, 'swf');
-INSERT INTO phpbb_extensions (group_id, extension) VALUES (6, 'wma');
-INSERT INTO phpbb_extensions (group_id, extension) VALUES (6, 'wmv');
-
-INSERT INTO phpbb_extensions (group_id, extension) VALUES (7, 'swf');
-
-INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, 'mov');
-INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, 'm4v');
-INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, 'm4a');
-INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, 'mp4');
-INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, '3gp');
-INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, '3g2');
-INSERT INTO phpbb_extensions (group_id, extension) VALUES (8, 'qt');
-
-INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'mpeg');
-INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'mpg');
-INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'mp3');
-INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'ogg');
-INSERT INTO phpbb_extensions (group_id, extension) VALUES (9, 'ogm');
+INSERT INTO phpbb_extensions (group_id, extension) VALUES (6, 'mp3');
+INSERT INTO phpbb_extensions (group_id, extension) VALUES (6, 'mpeg');
+INSERT INTO phpbb_extensions (group_id, extension) VALUES (6, 'mpg');
+INSERT INTO phpbb_extensions (group_id, extension) VALUES (6, 'ogg');
+INSERT INTO phpbb_extensions (group_id, extension) VALUES (6, 'ogm');
# Add default profile fields
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_location', 'profilefields.type.string', 'phpbb_location', '20', '2', '100', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 0, '', '');
@@ -813,9 +799,9 @@ 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_googleplus', 'profilefields.type.googleplus', 'phpbb_googleplus', '20', '3', '255', '', '', '[\w]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 13, 1, 'VIEW_GOOGLEPLUS_PROFILE', 'http://plus.google.com/%s');
# User Notification Options (for first user)
-INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('notification.type.post', 0, 2, '');
+INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('notification.type.post', 0, 2, 'notification.method.board');
INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('notification.type.post', 0, 2, 'notification.method.email');
-INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('notification.type.topic', 0, 2, '');
+INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('notification.type.topic', 0, 2, 'notification.method.board');
INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('notification.type.topic', 0, 2, 'notification.method.email');
# POSTGRES COMMIT #
diff --git a/phpBB/install_new/app.php b/phpBB/install_new/app.php
new file mode 100644
index 0000000000..b173f40dfc
--- /dev/null
+++ b/phpBB/install_new/app.php
@@ -0,0 +1,79 @@
+<?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.
+ *
+ */
+
+/**
+ * @ignore
+ */
+define('IN_PHPBB', true);
+define('IN_INSTALL', true);
+define('PHPBB_ENVIRONMENT', 'production');
+$phpbb_root_path = '../';
+$phpEx = substr(strrchr(__FILE__, '.'), 1);
+
+//
+// Let's do the common.php logic
+//
+require($phpbb_root_path . 'includes/startup.' . $phpEx);
+require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
+
+$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
+$phpbb_class_loader->register();
+
+// In case $phpbb_adm_relative_path is not set (in case of an update), use the default.
+$phpbb_adm_relative_path = (isset($phpbb_adm_relative_path)) ? $phpbb_adm_relative_path : 'adm/';
+$phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : $phpbb_root_path . $phpbb_adm_relative_path;
+
+// Include files
+require($phpbb_root_path . 'includes/functions.' . $phpEx);
+require($phpbb_root_path . 'includes/functions_content.' . $phpEx);
+include($phpbb_root_path . 'includes/functions_compatibility.' . $phpEx);
+require($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
+
+// Set PHP error handler to ours
+set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
+
+$phpbb_installer_container_builder = new \phpbb\di\container_builder($phpbb_root_path, $phpEx);
+$phpbb_installer_container = $phpbb_installer_container_builder
+ ->with_environment('installer')
+ ->without_extensions()
+ ->get_container();
+
+// Path to templates
+$paths = array($phpbb_root_path . 'install/update/new/adm/style', $phpbb_admin_path . 'style');
+$paths = array_filter($paths, 'is_dir');
+
+/** @var \phpbb\filesystem\filesystem $phpbb_filesystem */
+$phpbb_filesystem = $phpbb_installer_container->get('filesystem');
+
+/** @var \phpbb\template\template $template */
+$template = $phpbb_installer_container->get('template');
+$template->set_custom_style(array(
+ array(
+ 'name' => 'adm',
+ 'ext_path' => 'adm/style/',
+ ),
+), $paths);
+
+/** @var \phpbb\language\language $language */
+$language = $phpbb_installer_container->get('language');
+$language->add_lang(array('common', 'acp/common', 'acp/board', 'install_new', 'posting'));
+
+/* @var $http_kernel \Symfony\Component\HttpKernel\HttpKernel */
+$http_kernel = $phpbb_installer_container->get('http_kernel');
+
+/* @var $symfony_request \phpbb\symfony_request */
+$symfony_request = $phpbb_installer_container->get('symfony_request');
+$response = $http_kernel->handle($symfony_request);
+$response->send();
+$http_kernel->terminate($symfony_request, $response);
diff --git a/phpBB/install_new/phpbbcli.php b/phpBB/install_new/phpbbcli.php
new file mode 100644
index 0000000000..508d051945
--- /dev/null
+++ b/phpBB/install_new/phpbbcli.php
@@ -0,0 +1,66 @@
+#!/usr/bin/env php
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+if (php_sapi_name() !== 'cli')
+{
+ echo 'This program must be run from the command line.' . PHP_EOL;
+ exit(1);
+}
+
+define('IN_PHPBB', true);
+define('IN_INSTALL', true);
+define('PHPBB_ENVIRONMENT', 'production');
+$phpbb_root_path = __DIR__ . '/../';
+$phpEx = substr(strrchr(__FILE__, '.'), 1);
+
+//
+// Let's do the common.php logic
+//
+require($phpbb_root_path . 'includes/startup.' . $phpEx);
+require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx);
+
+$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx);
+$phpbb_class_loader->register();
+
+// In case $phpbb_adm_relative_path is not set (in case of an update), use the default.
+$phpbb_adm_relative_path = (isset($phpbb_adm_relative_path)) ? $phpbb_adm_relative_path : 'adm/';
+$phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : $phpbb_root_path . $phpbb_adm_relative_path;
+
+// Include files
+require($phpbb_root_path . 'includes/functions.' . $phpEx);
+require($phpbb_root_path . 'includes/functions_content.' . $phpEx);
+include($phpbb_root_path . 'includes/functions_compatibility.' . $phpEx);
+require($phpbb_root_path . 'includes/functions_user.' . $phpEx);
+require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);
+
+// Set PHP error handler to ours
+set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler');
+
+$phpbb_installer_container_builder = new \phpbb\di\container_builder($phpbb_root_path, $phpEx);
+$phpbb_installer_container = $phpbb_installer_container_builder
+ ->with_environment('installer')
+ ->without_extensions()
+ ->without_cache()
+ ->get_container();
+
+/** @var \phpbb\filesystem\filesystem $phpbb_filesystem */
+$phpbb_filesystem = $phpbb_installer_container->get('filesystem');
+
+/** @var \phpbb\language\language $language */
+$language = $phpbb_installer_container->get('language');
+$language->add_lang(array('common', 'acp/common', 'acp/board', 'install_new', 'posting', 'cli'));
+
+$application = new \phpbb\console\application('phpBB Installer', PHPBB_VERSION, $language);
+$application->register_container_commands($phpbb_installer_container->get('console.installer.command_collection'));
+$application->run($input);
diff --git a/phpBB/language/en/acp/attachments.php b/phpBB/language/en/acp/attachments.php
index cf2f0a45d2..5ff904f9fc 100644
--- a/phpBB/language/en/acp/attachments.php
+++ b/phpBB/language/en/acp/attachments.php
@@ -70,9 +70,6 @@ $lang = array_merge($lang, array(
'CAT_FLASH_FILES' => 'Flash files',
'CAT_IMAGES' => 'Images',
- 'CAT_QUICKTIME_FILES' => 'Quicktime media files',
- 'CAT_RM_FILES' => 'RealMedia media files',
- 'CAT_WM_FILES' => 'Windows Media media files',
'CHECK_CONTENT' => 'Check attachment files',
'CHECK_CONTENT_EXPLAIN' => 'Some browsers can be tricked to assume an incorrect mimetype for uploaded files. This option ensures that such files likely to cause this are rejected.',
'CREATE_GROUP' => 'Create new group',
@@ -105,9 +102,6 @@ $lang = array_merge($lang, array(
'EXT_GROUP_FLASH_FILES' => 'Flash Files',
'EXT_GROUP_IMAGES' => 'Images',
'EXT_GROUP_PLAIN_TEXT' => 'Plain Text',
- 'EXT_GROUP_QUICKTIME_MEDIA' => 'Quicktime Media',
- 'EXT_GROUP_REAL_MEDIA' => 'Real Media',
- 'EXT_GROUP_WINDOWS_MEDIA' => 'Windows Media',
'FILES_GONE' => 'Some of the attachments you selected for deletion do not exist. They may have been already deleted. Attachments that did exist were deleted.',
'FILES_STATS_WRONG' => 'Your file statistics are likely inaccurate and need to be resynchronised. Actual values: number of attachments = %1$d, total size of attachments = %2$s.<br />Click %3$shere%4$s to resynchronise them.',
diff --git a/phpBB/language/en/acp/board.php b/phpBB/language/en/acp/board.php
index 8d6c1c141d..001775349a 100644
--- a/phpBB/language/en/acp/board.php
+++ b/phpBB/language/en/acp/board.php
@@ -99,6 +99,7 @@ $lang = array_merge($lang, array(
'ALLOW_TOPIC_NOTIFY' => 'Allow subscribing to topics',
'BOARD_PM' => 'Private messaging',
'BOARD_PM_EXPLAIN' => 'Enable private messaging for all users.',
+ 'ALLOW_BOARD_NOTIFICATIONS' => 'Allow board notifications',
));
// Avatar Settings
diff --git a/phpBB/language/en/acp/groups.php b/phpBB/language/en/acp/groups.php
index a7700ed681..421075ce5e 100644
--- a/phpBB/language/en/acp/groups.php
+++ b/phpBB/language/en/acp/groups.php
@@ -83,7 +83,7 @@ $lang = array_merge($lang, array(
'GROUP_MEMBERS' => 'Group members',
'GROUP_MEMBERS_EXPLAIN' => 'This is a complete listing of all the members of this usergroup. It includes separate sections for leaders, pending and existing members. From here you can manage all aspects of who has membership of this group and what their role is. To remove a leader but keep them in the group use Demote rather than delete. Similarly use Promote to make an existing member a leader.',
'GROUP_MESSAGE_LIMIT' => 'Group private message limit per folder',
- 'GROUP_MESSAGE_LIMIT_EXPLAIN' => 'This setting overrides the per-user folder message limit. A value of 0 means the user default limit will be used.',
+ 'GROUP_MESSAGE_LIMIT_EXPLAIN' => 'This setting overrides the per-user folder message limit. The maximum for all groups of the user is used to determine the actual value.<br />Set this value to 0 to overwrite the setting for all users of this group with the board-wide setting.',
'GROUP_MODS_ADDED' => 'New group leaders added successfully.',
'GROUP_MODS_DEMOTED' => 'Group leaders demoted successfully.',
'GROUP_MODS_PROMOTED' => 'Group members promoted successfully.',
@@ -92,7 +92,7 @@ $lang = array_merge($lang, array(
'GROUP_OPEN' => 'Open',
'GROUP_PENDING' => 'Pending members',
'GROUP_MAX_RECIPIENTS' => 'Maximum number of allowed recipients per private message',
- 'GROUP_MAX_RECIPIENTS_EXPLAIN' => 'The maximum number of allowed recipients in a private message. If 0 is entered, the board-wide setting is used.',
+ 'GROUP_MAX_RECIPIENTS_EXPLAIN' => 'The maximum number of allowed recipients in a private message. The maximum for all groups of the user is used to determine the actual value.<br />Set this value to 0 to overwrite the setting for all users of this group with the board-wide setting.',
'GROUP_OPTIONS_SAVE' => 'Group wide options',
'GROUP_PROMOTE' => 'Promote to group leader',
'GROUP_RANK' => 'Group rank',
diff --git a/phpBB/language/en/acp/permissions_phpbb.php b/phpBB/language/en/acp/permissions_phpbb.php
index b9aeed8fcb..8d826e4cbf 100644
--- a/phpBB/language/en/acp/permissions_phpbb.php
+++ b/phpBB/language/en/acp/permissions_phpbb.php
@@ -120,6 +120,7 @@ $lang = array_merge($lang, array(
'ACL_F_POST' => 'Can start new topics',
'ACL_F_STICKY' => 'Can post stickies',
'ACL_F_ANNOUNCE' => 'Can post announcements',
+ 'ACL_F_ANNOUNCE_GLOBAL' => 'Can post global announcements',
'ACL_F_REPLY' => 'Can reply to topics',
'ACL_F_EDIT' => 'Can edit own posts',
'ACL_F_DELETE' => 'Can permanently delete own posts',
diff --git a/phpBB/language/en/cli.php b/phpBB/language/en/cli.php
index 6989f26f72..9aa8b7fcc2 100644
--- a/phpBB/language/en/cli.php
+++ b/phpBB/language/en/cli.php
@@ -58,13 +58,28 @@ $lang = array_merge($lang, array(
'CLI_DESCRIPTION_GET_CONFIG' => 'Gets a configuration option’s value',
'CLI_DESCRIPTION_INCREMENT_CONFIG' => 'Increments a configuration option’s integer value',
'CLI_DESCRIPTION_LIST_EXTENSIONS' => 'Lists all extensions in the database and on the filesystem.',
+
+ 'CLI_DESCRIPTION_OPTION_ENV' => 'The Environment name.',
'CLI_DESCRIPTION_OPTION_SAFE_MODE' => 'Run in Safe Mode (without extensions).',
'CLI_DESCRIPTION_OPTION_SHELL' => 'Launch the shell.',
+
'CLI_DESCRIPTION_PURGE_EXTENSION' => 'Purges the specified extension.',
+ 'CLI_DESCRIPTION_REPARSER_LIST' => 'Lists the types of text that can be reparsed.',
+ 'CLI_DESCRIPTION_REPARSER_REPARSE' => 'Reparses stored text with the current text_formatter services.',
+ 'CLI_DESCRIPTION_REPARSER_REPARSE_ARG_1' => 'Type of text to reparse. Leave blank to reparse everything.',
+ 'CLI_DESCRIPTION_REPARSER_REPARSE_OPT_DRY_RUN' => 'Do not save any changes; just print what would happen',
+ 'CLI_DESCRIPTION_REPARSER_REPARSE_OPT_RANGE_MIN' => 'Lowest record ID to process',
+ 'CLI_DESCRIPTION_REPARSER_REPARSE_OPT_RANGE_MAX' => 'Highest record ID to process',
+ 'CLI_DESCRIPTION_REPARSER_REPARSE_OPT_RANGE_SIZE' => 'Approximate number of records to process at a time',
+ 'CLI_DESCRIPTION_REPARSER_REPARSE_OPT_RESUME' => 'Start reparsing where the last execution stopped',
'CLI_DESCRIPTION_RECALCULATE_EMAIL_HASH' => 'Recalculates the user_email_hash column of the users table.',
'CLI_DESCRIPTION_SET_ATOMIC_CONFIG' => 'Sets a configuration option’s value only if the old matches the current value',
'CLI_DESCRIPTION_SET_CONFIG' => 'Sets a configuration option’s value',
+ 'CLI_DESCRIPTION_THUMBNAIL_DELETE' => 'Delete all existing thumbnails.',
+ 'CLI_DESCRIPTION_THUMBNAIL_GENERATE' => 'Generate all missing thumbnails.',
+ 'CLI_DESCRIPTION_THUMBNAIL_RECREATE' => 'Recreate all thumbnails.',
+
'CLI_EXTENSION_DISABLE_FAILURE' => 'Could not disable extension %s',
'CLI_EXTENSION_DISABLE_SUCCESS' => 'Successfully disabled extension %s',
'CLI_EXTENSION_ENABLE_FAILURE' => 'Could not enable extension %s',
@@ -78,6 +93,23 @@ $lang = array_merge($lang, array(
'CLI_EXTENSIONS_ENABLED' => 'Enabled',
'CLI_FIXUP_RECALCULATE_EMAIL_HASH_SUCCESS' => 'Successfully recalculated all email hashes.',
+
+ 'CLI_REPARSER_REPARSE_REPARSING' => 'Reparsing %1$s (range %2$d..%3$d)',
+ 'CLI_REPARSER_REPARSE_REPARSING_START' => 'Reparsing %s...',
+ 'CLI_REPARSER_REPARSE_SUCCESS' => 'Reparsing ended with success',
+
+ // In all the case %1$s is the logical name of the file and %2$s the real name on the filesystem
+ // eg: big_image.png (2_a51529ae7932008cf8454a95af84cacd) generated.
+ 'CLI_THUMBNAIL_DELETED' => '%1$s (%2$s) deleted.',
+ 'CLI_THUMBNAIL_DELETING' => 'Deleting thumbnails',
+ 'CLI_THUMBNAIL_SKIPPED' => '%1$s (%2$s) skipped.',
+ 'CLI_THUMBNAIL_GENERATED' => '%1$s (%2$s) generated.',
+ 'CLI_THUMBNAIL_GENERATING' => 'Generating thumbnails',
+ 'CLI_THUMBNAIL_GENERATING_DONE' => 'All thumbnails have been regenerated.',
+ 'CLI_THUMBNAIL_DELETING_DONE' => 'All thumbnails have been deleted.',
+
+ 'CLI_THUMBNAIL_NOTHING_TO_GENERATE' => 'No thumbnails to generate.',
+ 'CLI_THUMBNAIL_NOTHING_TO_DELETE' => 'No thumbnails to delete.',
));
// Additional help for commands.
diff --git a/phpBB/language/en/common.php b/phpBB/language/en/common.php
index 79d504a67d..bde9a91267 100644
--- a/phpBB/language/en/common.php
+++ b/phpBB/language/en/common.php
@@ -81,7 +81,7 @@ $lang = array_merge($lang, array(
'ALL_FORUMS' => 'All forums',
'ALL_MESSAGES' => 'All messages',
'ALL_POSTS' => 'All posts',
- 'ALL_TIMES' => 'All times are <abbr title="%2$s">%1$s</abbr>',
+ 'ALL_TIMES' => 'All times are <span title="%2$s">%1$s</span>',
'ALL_TOPICS' => 'All Topics',
'AND' => 'And',
'ARE_WATCHING_FORUM' => 'You have subscribed to be notified of new posts in this forum.',
@@ -229,6 +229,7 @@ $lang = array_merge($lang, array(
'FACEBOOK' => 'Facebook',
'FAQ' => 'FAQ',
'FAQ_EXPLAIN' => 'Frequently Asked Questions',
+ 'FEATURE_NOT_AVAILABLE' => 'The requested feature is not available on this board.',
'FILENAME' => 'Filename',
'FILESIZE' => 'File size',
'FILEDATE' => 'File date',
@@ -447,6 +448,7 @@ $lang = array_merge($lang, array(
'NOTIFICATION_FORUM' => '<em>Forum:</em> %1$s',
'NOTIFICATION_GROUP_REQUEST' => '<strong>Group request</strong> from %1$s to join the group %2$s.',
'NOTIFICATION_GROUP_REQUEST_APPROVED' => '<strong>Group request approved</strong> to join the group %1$s.',
+ 'NOTIFICATION_METHOD_INVALID' => 'The method "%s" does not refer to a valid notification method.',
'NOTIFICATION_PM' => '<strong>Private Message</strong> from %1$s:',
'NOTIFICATION_POST' => array(
1 => '<strong>Reply</strong> from %1$s in topic:',
@@ -552,7 +554,6 @@ $lang = array_merge($lang, array(
1 => '%d pixel',
2 => '%d pixels',
),
- 'PLAY_QUICKTIME_FILE' => 'Play Quicktime file',
'PLEASE_WAIT' => 'Please wait.',
'PM' => 'PM',
'PM_REPORTED' => 'Click to view report',
@@ -690,6 +691,7 @@ $lang = array_merge($lang, array(
'SKYPE' => 'Skype',
'SMTP_NO_AUTH_SUPPORT' => 'SMTP server does not support authentication.',
'SORRY_AUTH_READ' => 'You are not authorised to read this forum.',
+ 'SORRY_AUTH_READ_TOPIC' => 'You are not authorised to read this topic.',
'SORRY_AUTH_VIEW_ATTACH' => 'You are not authorised to download this attachment.',
'SORT_BY' => 'Sort by',
'SORT_JOINED' => 'Joined date',
diff --git a/phpBB/language/en/help/bbcode.php b/phpBB/language/en/help/bbcode.php
new file mode 100644
index 0000000000..d3b36d8015
--- /dev/null
+++ b/phpBB/language/en/help/bbcode.php
@@ -0,0 +1,66 @@
+<?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.
+ *
+ */
+
+/**
+ * DO NOT CHANGE
+ */
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+if (empty($lang) || !is_array($lang))
+{
+ $lang = array();
+}
+
+$lang = array_merge($lang, array(
+ 'HELP_BBCODE_BLOCK_IMAGES' => 'Showing images in posts',
+ 'HELP_BBCODE_BLOCK_INTRO' => 'Introduction',
+ 'HELP_BBCODE_BLOCK_LINKS' => 'Creating Links',
+ 'HELP_BBCODE_BLOCK_LISTS' => 'Generating lists',
+ 'HELP_BBCODE_BLOCK_OTHERS' => 'Other matters',
+ 'HELP_BBCODE_BLOCK_QUOTES' => 'Quoting and outputting fixed-width text',
+ 'HELP_BBCODE_BLOCK_TEXT' => 'Text Formatting',
+
+ 'HELP_BBCODE_IMAGES_ATTACHMENT_ANSWER' => 'Attachments can now be placed in any part of a post by using the new <strong>[attachment=][/attachment]</strong> BBCode, if the attachments functionality has been enabled by a board administrator and if you are given the appropriate permissions to create attachments. Within the posting screen is a drop-down box (respectively a button) for placing attachments inline.',
+ 'HELP_BBCODE_IMAGES_ATTACHMENT_QUESTION' => 'Adding attachments into a post',
+ 'HELP_BBCODE_IMAGES_BASIC_ANSWER' => 'phpBB BBCode incorporates a tag for including images in your posts. Two very important things to remember when using this tag are: many users do not appreciate lots of images being shown in posts and secondly the image you display must already be available on the internet (it cannot exist only on your computer for example, unless you run a webserver!). To display an image you must surround the URL pointing to the image with <strong>[img][/img]</strong> tags. For example:<br /><br /><strong>[img]</strong>http://www.phpbb.com/theme/images/logos/blue/160x52.png<strong>[/img]</strong><br /><br />As noted in the URL section above you can wrap an image in a <strong>[url][/url]</strong> tag if you wish, e.g.<br /><br /><strong>[url=http://www.phpbb.com/][img]</strong>http://www.phpbb.com/theme/images/logos/blue/160x52.png<strong>[/img][/url]</strong><br /><br />would generate:<br /><br /><a href="http://www.phpbb.com/"><img src="http://www.phpbb.com/theme/images/logos/blue/160x52.png" alt="" /></a>',
+ 'HELP_BBCODE_IMAGES_BASIC_QUESTION' => 'Adding an image to a post',
+
+ 'HELP_BBCODE_INTRO_BBCODE_ANSWER' => 'BBCode is a special implementation of HTML. Whether you can actually use BBCode in your posts on the forum is determined by the administrator. In addition you can disable BBCode on a per post basis via the posting form. BBCode itself is similar in style to HTML, tags are enclosed in square brackets [ and ] rather than &lt; and &gt; and it offers greater control over what and how something is displayed. Depending on the template you are using you may find adding BBCode to your posts is made much easier through a clickable interface above the message area on the posting form. Even with this you may find the following guide useful.',
+ 'HELP_BBCODE_INTRO_BBCODE_QUESTION' => 'What is BBCode?',
+
+ 'HELP_BBCODE_LINKS_BASIC_ANSWER' => 'phpBB BBCode supports a number of ways of creating URIs (Uniform Resource Indicators) better known as URLs.<ul><li>The first of these uses the <strong>[url=][/url]</strong> tag, whatever you type after the = sign will cause the contents of that tag to act as a URL. For example to link to phpBB.com you could use:<br /><br /><strong>[url=http://www.phpbb.com/]</strong>Visit phpBB!<strong>[/url]</strong><br /><br />This would generate the following link, <a href="http://www.phpbb.com/">Visit phpBB!</a> Please notice that the link opens in the same window or a new window depending on the users browser preferences.</li><li>If you want the URL itself displayed as the link you can do this by simply using:<br /><br /><strong>[url]</strong>http://www.phpbb.com/<strong>[/url]</strong><br /><br />This would generate the following link, <a href="http://www.phpbb.com/">http://www.phpbb.com/</a></li><li>Additionally, phpBB features something called <i>Magic Links</i>, this will turn any syntactically correct URL into a link without you needing to specify any tags or even the leading http://. For example typing www.phpbb.com into your message will automatically lead to <a href="http://www.phpbb.com/">www.phpbb.com</a> being output when you view the message.</li><li>The same thing applies equally to email addresses, you can either specify an address explicitly for example:<br /><br /><strong>[email]</strong>no.one@domain.adr<strong>[/email]</strong><br /><br />which will output <a href="mailto:no.one@domain.adr">no.one@domain.adr</a> or you can just type no.one@domain.adr into your message and it will be automatically converted when you view.</li></ul>As with all the BBCode tags you can wrap URLs around any of the other tags such as <strong>[img][/img]</strong> (see next entry), <strong>[b][/b]</strong>, etc. As with the formatting tags it is up to you to ensure the correct open and close order is following, for example:<br /><br /><strong>[url=http://www.phpbb.com/][img]</strong>http://www.phpbb.com/theme/images/logos/blue/160x52.png<strong>[/url][/img]</strong><br /><br />is <span style="text-decoration: underline">not</span> correct which may lead to your post being deleted so take care.',
+ 'HELP_BBCODE_LINKS_BASIC_QUESTION' => 'Linking to another site',
+
+ 'HELP_BBCODE_LISTS_ORDERER_ANSWER' => 'The second type of list, an ordered list, gives you control over what is output before each item. To create an ordered list you use <strong>[list=1][/list]</strong> to create a numbered list or alternatively <strong>[list=a][/list]</strong> for an alphabetical list. As with the unordered list, items are specified using <strong>[*]</strong>. For example:<br /><br /><strong>[list=1]</strong><br /><strong>[*]</strong>Go to the shops<br /><strong>[*]</strong>Buy a new computer<br /><strong>[*]</strong>Swear at computer when it crashes<br /><strong>[/list]</strong><br /><br />will generate the following:<ol style="list-style-type: decimal;"><li>Go to the shops</li><li>Buy a new computer</li><li>Swear at computer when it crashes</li></ol>Whereas for an alphabetical list you would use:<br /><br /><strong>[list=a]</strong><br /><strong>[*]</strong>The first possible answer<br /><strong>[*]</strong>The second possible answer<br /><strong>[*]</strong>The third possible answer<br /><strong>[/list]</strong><br /><br />giving<ol style="list-style-type: lower-alpha"><li>The first possible answer</li><li>The second possible answer</li><li>The third possible answer</li></ol>',
+ 'HELP_BBCODE_LISTS_ORDERER_QUESTION' => 'Creating an Ordered list',
+ 'HELP_BBCODE_LISTS_UNORDERER_ANSWER' => 'BBCode supports two types of lists, unordered and ordered. They are essentially the same as their HTML equivalents. An unordered list outputs each item in your list sequentially one after the other indenting each with a bullet character. To create an unordered list you use <strong>[list][/list]</strong> and define each item within the list using <strong>[*]</strong>. For example to list your favourite colours you could use:<br /><br /><strong>[list]</strong><br /><strong>[*]</strong>Red<br /><strong>[*]</strong>Blue<br /><strong>[*]</strong>Yellow<br /><strong>[/list]</strong><br /><br />This would generate the following list:<ul><li>Red</li><li>Blue</li><li>Yellow</li></ul>',
+ 'HELP_BBCODE_LISTS_UNORDERER_QUESTION' => 'Creating an Unordered list',
+
+ 'HELP_BBCODE_OTHERS_CUSTOM_ANSWER' => 'If you are an administrator on this board and have the proper permissions, you can add further BBCodes through the Custom BBCodes section.',
+ 'HELP_BBCODE_OTHERS_CUSTOM_QUESTION' => 'Can I add my own tags?',
+
+ 'HELP_BBCODE_QUOTES_CODE_ANSWER' => 'If you want to output a piece of code or in fact anything that requires a fixed width, e.g. Courier type font you should enclose the text in <strong>[code][/code]</strong> tags, e.g.<br /><br /><strong>[code]</strong>echo &quot;This is some code&quot;;<strong>[/code]</strong><br /><br />All formatting used within <strong>[code][/code]</strong> tags is retained when you later view it. PHP syntax highlighting can be enabled using <strong>[code=php][/code]</strong> and is recommended when posting PHP code samples as it improves readability.',
+ 'HELP_BBCODE_QUOTES_CODE_QUESTION' => 'Outputting code or fixed width data',
+ 'HELP_BBCODE_QUOTES_TEXT_ANSWER' => 'There are two ways you can quote text, with a reference or without.<ul><li>When you utilise the Quote function to reply to a post on the board you should notice that the post text is added to the message window enclosed in a <strong>[quote=&quot;&quot;][/quote]</strong> block. This method allows you to quote with a reference to a person or whatever else you choose to put! For example to quote a piece of text Mr. Blobby wrote you would enter:<br /><br /><strong>[quote=&quot;Mr. Blobby&quot;]</strong>The text Mr. Blobby wrote would go here<strong>[/quote]</strong><br /><br />The resulting output will automatically add &quot;Mr. Blobby wrote:&quot; before the actual text. Remember you <strong>must</strong> include the quotation marks &quot;&quot; around the name you are quoting, they are not optional.</li><li>The second method allows you to blindly quote something. To utilise this enclose the text in <strong>[quote][/quote]</strong> tags. When you view the message it will simply show the text within a quotation block.</li></ul>',
+ 'HELP_BBCODE_QUOTES_TEXT_QUESTION' => 'Quoting text in replies',
+
+ 'HELP_BBCODE_TEXT_BASIC_ANSWER' => 'BBCode includes tags to allow you to quickly change the basic style of your text. This is achieved in the following ways: <ul><li>To make a piece of text bold enclose it in <strong>[b][/b]</strong>, e.g. <br /><br /><strong>[b]</strong>Hello<strong>[/b]</strong><br /><br />will become <strong>Hello</strong></li><li>For underlining use <strong>[u][/u]</strong>, for example:<br /><br /><strong>[u]</strong>Good Morning<strong>[/u]</strong><br /><br />becomes <span style="text-decoration: underline">Good Morning</span></li><li>To italicise text use <strong>[i][/i]</strong>, e.g.<br /><br />This is <strong>[i]</strong>Great!<strong>[/i]</strong><br /><br />would give This is <i>Great!</i></li></ul>',
+ 'HELP_BBCODE_TEXT_BASIC_QUESTION' => 'How to create bold, italic and underlined text',
+ 'HELP_BBCODE_TEXT_COLOR_ANSWER' => 'To alter the colour or size of your text the following tags can be used. Keep in mind that how the output appears will depend on the viewers browser and system: <ul><li>Changing the colour of text is achieved by wrapping it in <strong>[color=][/color]</strong>. You can specify either a recognised colour name (eg. red, blue, yellow, etc.) or the hexadecimal triplet alternative, e.g. #FFFFFF, #000000. For example, to create red text you could use:<br /><br /><strong>[color=red]</strong>Hello!<strong>[/color]</strong><br /><br />or<br /><br /><strong>[color=#FF0000]</strong>Hello!<strong>[/color]</strong><br /><br />Both will output <span style="color:red">Hello!</span></li><li>Changing the text size is achieved in a similar way using <strong>[size=][/size]</strong>. This tag is dependent on the template the user has selected but the recommended format is a numerical value representing the text size in percent, starting at 20 (very small) through to 200 (very large) by default. For example:<br /><br /><strong>[size=30]</strong>SMALL<strong>[/size]</strong><br /><br />will generally be <span style="font-size:30%;">SMALL</span><br /><br />whereas:<br /><br /><strong>[size=200]</strong>HUGE!<strong>[/size]</strong><br /><br />will be <span style="font-size:200%;">HUGE!</span></li></ul>',
+ 'HELP_BBCODE_TEXT_COLOR_QUESTION' => 'How to change the text colour or size',
+ 'HELP_BBCODE_TEXT_COMBINE_ANSWER' => 'Yes, of course you can, for example to get someones attention you may write:<br /><br /><strong>[size=200][color=red][b]</strong>LOOK AT ME!<strong>[/b][/color][/size]</strong><br /><br />this would output <span style="color:red;font-size:200%;"><strong>LOOK AT ME!</strong></span><br /><br />We don’t recommend you output lots of text that looks like this though! Remember it is up to you, the poster, to ensure tags are closed correctly. For example the following is incorrect:<br /><br /><strong>[b][u]</strong>This is wrong<strong>[/b][/u]</strong>',
+ 'HELP_BBCODE_TEXT_COMBINE_QUESTION' => 'Can I combine formatting tags?',
+));
diff --git a/phpBB/language/en/help/faq.php b/phpBB/language/en/help/faq.php
new file mode 100644
index 0000000000..e59d950948
--- /dev/null
+++ b/phpBB/language/en/help/faq.php
@@ -0,0 +1,186 @@
+<?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.
+ *
+ */
+
+/**
+ * DO NOT CHANGE
+ */
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+if (empty($lang) || !is_array($lang))
+{
+ $lang = array();
+}
+
+$lang = array_merge($lang, array(
+ 'HELP_FAQ_ATTACHMENTS_ALLOWED_ANSWER' => 'Each board administrator can allow or disallow certain attachment types. If you are unsure what is allowed to be uploaded, contact the board administrator for assistance.',
+ 'HELP_FAQ_ATTACHMENTS_ALLOWED_QUESTION' => 'What attachments are allowed on this board?',
+ 'HELP_FAQ_ATTACHMENTS_OWN_ANSWER' => 'To find your list of attachments that you have uploaded, go to your User Control Panel and follow the links to the attachments section.',
+ 'HELP_FAQ_ATTACHMENTS_OWN_QUESTION' => 'How do I find all my attachments?',
+
+ 'HELP_FAQ_BLOCK_ATTACHMENTS' => 'Attachments',
+ 'HELP_FAQ_BLOCK_BOOKMARKS' => 'Subscriptions and Bookmarks',
+ 'HELP_FAQ_BLOCK_FORMATTING' => 'Formatting and Topic Types',
+ 'HELP_FAQ_BLOCK_FRIENDS' => 'Friends and Foes',
+ 'HELP_FAQ_BLOCK_GROUPS' => 'User Levels and Groups',
+ 'HELP_FAQ_BLOCK_ISSUES' => 'phpBB Issues',
+ 'HELP_FAQ_BLOCK_LOGIN' => 'Login and Registration Issues',
+ 'HELP_FAQ_BLOCK_PMS' => 'Private Messaging',
+ 'HELP_FAQ_BLOCK_POSTING' => 'Posting Issues',
+ 'HELP_FAQ_BLOCK_SEARCH' => 'Searching the Forums',
+ 'HELP_FAQ_BLOCK_USERSETTINGS' => 'User Preferences and settings',
+
+ 'HELP_FAQ_BOOKMARKS_DIFFERENCE_ANSWER' => '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â€.',
+ 'HELP_FAQ_BOOKMARKS_DIFFERENCE_QUESTION' => 'What is the difference between bookmarking and subscribing?',
+ 'HELP_FAQ_BOOKMARKS_FORUM_ANSWER' => 'To subscribe to a specific forum, click the “Subscribe forum†link, at the bottom of page, upon entering the forum.',
+ 'HELP_FAQ_BOOKMARKS_FORUM_QUESTION' => 'How do I subscribe to specific forums?',
+ 'HELP_FAQ_BOOKMARKS_REMOVE_ANSWER' => 'To remove your subscriptions, go to your User Control Panel and follow the links to your subscriptions.',
+ 'HELP_FAQ_BOOKMARKS_REMOVE_QUESTION' => 'How do I remove my subscriptions?',
+ 'HELP_FAQ_BOOKMARKS_TOPIC_ANSWER' => '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.',
+ 'HELP_FAQ_BOOKMARKS_TOPIC_QUESTION' => 'How do I bookmark or subscribe to specific topics?',
+
+ 'HELP_FAQ_FORMATTING_ANNOUNCEMENT_ANSWER' => 'Announcements often contain important information for the forum you are currently reading and you should read them whenever possible. Announcements appear at the top of every page in the forum to which they are posted. As with global announcements, announcement permissions are granted by the board administrator.',
+ 'HELP_FAQ_FORMATTING_ANNOUNCEMENT_QUESTION' => 'What are announcements?',
+ 'HELP_FAQ_FORMATTING_BBOCDE_ANSWER' => 'BBCode is a special implementation of HTML, offering great formatting control on particular objects in a post. The use of BBCode is granted by the administrator, but it can also be disabled on a per post basis from the posting form. BBCode itself is similar in style to HTML, but tags are enclosed in square brackets [ and ] rather than &lt; and &gt;. For more information on BBCode see the guide which can be accessed from the posting page.',
+ 'HELP_FAQ_FORMATTING_BBOCDE_QUESTION' => 'What is BBCode?',
+ 'HELP_FAQ_FORMATTING_GLOBAL_ANNOUNCE_ANSWER' => 'Global announcements contain important information and you should read them whenever possible. They will appear at the top of every forum and within your User Control Panel. Global announcement permissions are granted by the board administrator.',
+ 'HELP_FAQ_FORMATTING_GLOBAL_ANNOUNCE_QUESTION' => 'What are global announcements?',
+ 'HELP_FAQ_FORMATTING_HTML_ANSWER' => 'No. It is not possible to post HTML on this board and have it rendered as HTML. Most formatting which can be carried out using HTML can be applied using BBCode instead.',
+ 'HELP_FAQ_FORMATTING_HTML_QUESTION' => 'Can I use HTML?',
+ 'HELP_FAQ_FORMATTING_ICONS_ANSWER' => 'Topic icons are author chosen images associated with posts to indicate their content. The ability to use topic icons depends on the permissions set by the board administrator.',
+ 'HELP_FAQ_FORMATTING_ICONS_QUESTION' => 'What are topic icons?',
+ 'HELP_FAQ_FORMATTING_IMAGES_ANSWER' => 'Yes, images can be shown in your posts. If the administrator has allowed attachments, you may be able to upload the image to the board. Otherwise, you must link to an image stored on a publicly accessible web server, e.g. http://www.example.com/my-picture.gif. You cannot link to pictures stored on your own PC (unless it is a publicly accessible server) nor images stored behind authentication mechanisms, e.g. hotmail or yahoo mailboxes, password protected sites, etc. To display the image use the BBCode [img] tag.',
+ 'HELP_FAQ_FORMATTING_IMAGES_QUESTION' => 'Can I post images?',
+ 'HELP_FAQ_FORMATTING_LOCKED_ANSWER' => 'Locked topics are topics where users can no longer reply and any poll it contained was automatically ended. Topics may be locked for many reasons and were set this way by either the forum moderator or board administrator. You may also be able to lock your own topics depending on the permissions you are granted by the board administrator.',
+ 'HELP_FAQ_FORMATTING_LOCKED_QUESTION' => 'What are locked topics?',
+ 'HELP_FAQ_FORMATTING_SMILIES_ANSWER' => 'Smilies, or Emoticons, are small images which can be used to express a feeling using a short code, e.g. :) denotes happy, while :( denotes sad. The full list of emoticons can be seen in the posting form. Try not to overuse smilies, however, as they can quickly render a post unreadable and a moderator may edit them out or remove the post altogether. The board administrator may also have set a limit to the number of smilies you may use within a post.',
+ 'HELP_FAQ_FORMATTING_SMILIES_QUESTION' => 'What are Smilies?',
+ 'HELP_FAQ_FORMATTING_STICKIES_ANSWER' => 'Sticky topics within the forum appear below announcements and only on the first page. They are often quite important so you should read them whenever possible. As with announcements and global announcements, sticky topic permissions are granted by the board administrator.',
+ 'HELP_FAQ_FORMATTING_STICKIES_QUESTION' => 'What are sticky topics?',
+
+ 'HELP_FAQ_FRIENDS_BASIC_ANSWER' => 'You can use these lists to organise other members of the board. Members added to your friends list will be listed within your User Control Panel for quick access to see their online status and to send them private messages. Subject to template support, posts from these users may also be highlighted. If you add a user to your foes list, any posts they make will be hidden by default.',
+ 'HELP_FAQ_FRIENDS_BASIC_QUESTION' => 'What are my Friends and Foes lists?',
+ 'HELP_FAQ_FRIENDS_MANAGE_ANSWER' => 'You can add users to your list in two ways. Within each user’s profile, there is a link to add them to either your Friend or Foe list. Alternatively, from your User Control Panel, you can directly add users by entering their member name. You may also remove users from your list using the same page.',
+ 'HELP_FAQ_FRIENDS_MANAGE_QUESTION' => 'How can I add / remove users to my Friends or Foes list?',
+
+ 'HELP_FAQ_GROUPS_ADMINISTRATORS_ANSWER' => 'Administrators are members assigned with the highest level of control over the entire board. These members can control all facets of board operation, including setting permissions, banning users, creating usergroups or moderators, etc., dependent upon the board founder and what permissions he or she has given the other administrators. They may also have full moderator capabilities in all forums, depending on the settings put forth by the board founder.',
+ 'HELP_FAQ_GROUPS_ADMINISTRATORS_QUESTION' => 'What are Administrators?',
+ 'HELP_FAQ_GROUPS_COLORS_ANSWER' => 'It is possible for the board administrator to assign a colour to the members of a usergroup to make it easy to identify the members of this group.',
+ 'HELP_FAQ_GROUPS_COLORS_QUESTION' => 'Why do some usergroups appear in a different colour?',
+ 'HELP_FAQ_GROUPS_DEFAULT_ANSWER' => 'If you are a member of more than one usergroup, your default is used to determine which group colour and group rank should be shown for you by default. The board administrator may grant you permission to change your default usergroup via your User Control Panel.',
+ 'HELP_FAQ_GROUPS_DEFAULT_QUESTION' => 'What is a “Default usergroup�',
+ 'HELP_FAQ_GROUPS_MODERATORS_ANSWER' => 'Moderators are individuals (or groups of individuals) who look after the forums from day to day. They have the authority to edit or delete posts and lock, unlock, move, delete and split topics in the forum they moderate. Generally, moderators are present to prevent users from going off-topic or posting abusive or offensive material.',
+ 'HELP_FAQ_GROUPS_MODERATORS_QUESTION' => 'What are Moderators?',
+ 'HELP_FAQ_GROUPS_TEAM_ANSWER' => 'This page provides you with a list of board staff, including board administrators and moderators and other details such as the forums they moderate.',
+ 'HELP_FAQ_GROUPS_TEAM_QUESTION' => 'What is “The team†link?',
+ 'HELP_FAQ_GROUPS_USERGROUPS_ANSWER' => 'Usergroups are groups of users that divide the community into manageable sections board administrators can work with. Each user can belong to several groups and each group can be assigned individual permissions. This provides an easy way for administrators to change permissions for many users at once, such as changing moderator permissions or granting users access to a private forum.',
+ 'HELP_FAQ_GROUPS_USERGROUPS_JOIN_ANSWER' => 'You can view all usergroups via the “Usergroups†link within your User Control Panel. If you would like to join one, proceed by clicking the appropriate button. Not all groups have open access, however. Some may require approval to join, some may be closed and some may even have hidden memberships. If the group is open, you can join it by clicking the appropriate button. If a group requires approval to join you may request to join by clicking the appropriate button. The user group leader will need to approve your request and may ask why you want to join the group. Please do not harass a group leader if they reject your request; they will have their reasons.',
+ 'HELP_FAQ_GROUPS_USERGROUPS_JOIN_QUESTION' => 'Where are the usergroups and how do I join one?',
+ 'HELP_FAQ_GROUPS_USERGROUPS_LEAD_ANSWER' => 'A usergroup leader is usually assigned when usergroups are initially created by a board administrator. If you are interested in creating a usergroup, your first point of contact should be an administrator; try sending a private message.',
+ 'HELP_FAQ_GROUPS_USERGROUPS_LEAD_QUESTION' => 'How do I become a usergroup leader?',
+ 'HELP_FAQ_GROUPS_USERGROUPS_QUESTION' => 'What are usergroups?',
+
+ 'HELP_FAQ_ISSUES_ADMIN_ANSWER' => '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.',
+ 'HELP_FAQ_ISSUES_ADMIN_QUESTION' => 'How do I contact a board administrator?',
+ 'HELP_FAQ_ISSUES_FEATURE_ANSWER' => 'This software was written by and licensed through phpBB Limited. If you believe a feature needs to be added please visit the <a href="https://www.phpbb.com/ideas/">phpBB Ideas Centre</a>, where you can upvote existing ideas or suggest new features.',
+ 'HELP_FAQ_ISSUES_FEATURE_QUESTION' => 'Why isn’t X feature available?',
+ 'HELP_FAQ_ISSUES_LEGAL_ANSWER' => '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.',
+ 'HELP_FAQ_ISSUES_LEGAL_QUESTION' => 'Who do I contact about abusive and/or legal matters related to this board?',
+ 'HELP_FAQ_ISSUES_WHOIS_PHPBB_ANSWER' => '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.',
+ 'HELP_FAQ_ISSUES_WHOIS_PHPBB_QUESTION' => 'Who wrote this bulletin board?',
+
+ 'HELP_FAQ_LOGIN_AUTO_LOGOUT_ANSWER' => '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.',
+ 'HELP_FAQ_LOGIN_AUTO_LOGOUT_QUESTION' => 'Why do I get logged off automatically?',
+ 'HELP_FAQ_LOGIN_CANNOT_LOGIN_ANSWER' => '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.',
+ 'HELP_FAQ_LOGIN_CANNOT_LOGIN_ANYMORE_ANSWER' => '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.',
+ 'HELP_FAQ_LOGIN_CANNOT_LOGIN_ANYMORE_QUESTION' => 'I registered in the past but cannot login any more?!',
+ 'HELP_FAQ_LOGIN_CANNOT_LOGIN_QUESTION' => 'Why can’t I login?',
+ 'HELP_FAQ_LOGIN_CANNOT_REGISTER_ANSWER' => '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.',
+ 'HELP_FAQ_LOGIN_CANNOT_REGISTER_QUESTION' => 'Why can’t I register?',
+ 'HELP_FAQ_LOGIN_COPPA_ANSWER' => '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?â€.',
+ 'HELP_FAQ_LOGIN_COPPA_QUESTION' => 'What is COPPA?',
+ 'HELP_FAQ_LOGIN_DELETE_COOKIES_ANSWER' => '“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.',
+ 'HELP_FAQ_LOGIN_DELETE_COOKIES_QUESTION' => 'What does the “Delete all board cookies†do?',
+ 'HELP_FAQ_LOGIN_LOST_PASSWORD_ANSWER' => '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.',
+ 'HELP_FAQ_LOGIN_LOST_PASSWORD_QUESTION' => 'I’ve lost my password!',
+ 'HELP_FAQ_LOGIN_REGISTER_ANSWER' => '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.',
+ 'HELP_FAQ_LOGIN_REGISTER_CONFIRM_ANSWER' => '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.',
+ 'HELP_FAQ_LOGIN_REGISTER_CONFIRM_QUESTION' => 'I registered but cannot login!',
+ 'HELP_FAQ_LOGIN_REGISTER_QUESTION' => 'Why do I need to register?',
+
+ 'HELP_FAQ_PMS_CANNOT_SEND_ANSWER' => 'There are three reasons for this; you are not registered and/or not logged on, the board administrator has disabled private messaging for the entire board, or the board administrator has prevented you from sending messages. Contact a board administrator for more information.',
+ 'HELP_FAQ_PMS_CANNOT_SEND_QUESTION' => 'I cannot send private messages!',
+ 'HELP_FAQ_PMS_SPAM_ANSWER' => 'We are sorry to hear that. The email form feature of this board includes safeguards to try and track users who send such posts, so email the board administrator with a full copy of the email you received. It is very important that this includes the headers that contain the details of the user that sent the email. The board administrator can then take action.',
+ 'HELP_FAQ_PMS_SPAM_QUESTION' => 'I have received a spamming or abusive email from someone on this board!',
+ 'HELP_FAQ_PMS_UNWANTED_ANSWER' => 'You can automatically delete private messages from a user by using message rules within your User Control Panel. If you are receiving abusive private messages from a particular user, report the messages to the moderators; they have the power to prevent a user from sending private messages.',
+ 'HELP_FAQ_PMS_UNWANTED_QUESTION' => 'I keep getting unwanted private messages!',
+
+ 'HELP_FAQ_POSTING_BUMP_ANSWER' => 'By clicking the “Bump topic†link when you are viewing it, you can “bump†the topic to the top of the forum on the first page. However, if you do not see this, then topic bumping may be disabled or the time allowance between bumps has not yet been reached. It is also possible to bump the topic simply by replying to it, however, be sure to follow the board rules when doing so.',
+ 'HELP_FAQ_POSTING_BUMP_QUESTION' => 'How do I bump my topic?',
+ 'HELP_FAQ_POSTING_CREATE_ANSWER' => '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.',
+ 'HELP_FAQ_POSTING_CREATE_QUESTION' => 'How do I create a new topic or post a reply?',
+ 'HELP_FAQ_POSTING_DRAFT_ANSWER' => 'This allows you to save drafts to be completed and submitted at a later date. To reload a saved draft, visit the User Control Panel.',
+ 'HELP_FAQ_POSTING_DRAFT_QUESTION' => 'What is the “Save†button for in topic posting?',
+ 'HELP_FAQ_POSTING_EDIT_DELETE_ANSWER' => 'Unless you are a board administrator or moderator, you can only edit or delete your own posts. You can edit a post by clicking the edit button for the relevant post, sometimes for only a limited time after the post was made. If someone has already replied to the post, you will find a small piece of text output below the post when you return to the topic which lists the number of times you edited it along with the date and time. This will only appear if someone has made a reply; it will not appear if a moderator or administrator edited the post, though they may leave a note as to why they’ve edited the post at their own discretion. Please note that normal users cannot delete a post once someone has replied.',
+ 'HELP_FAQ_POSTING_EDIT_DELETE_QUESTION' => 'How do I edit or delete a post?',
+ 'HELP_FAQ_POSTING_FORUM_RESTRICTED_ANSWER' => 'Some forums may be limited to certain users or groups. To view, read, post or perform another action you may need special permissions. Contact a moderator or board administrator to grant you access.',
+ 'HELP_FAQ_POSTING_FORUM_RESTRICTED_QUESTION' => 'Why can’t I access a forum?',
+ 'HELP_FAQ_POSTING_NO_ATTACHMENTS_ANSWER' => 'Attachment permissions are granted on a per forum, per group, or per user basis. The board administrator may not have allowed attachments to be added for the specific forum you are posting in, or perhaps only certain groups can post attachments. Contact the board administrator if you are unsure about why you are unable to add attachments.',
+ 'HELP_FAQ_POSTING_NO_ATTACHMENTS_QUESTION' => 'Why can’t I add attachments?',
+ 'HELP_FAQ_POSTING_POLL_ADD_ANSWER' => 'The limit for poll options is set by the board administrator. If you feel you need to add more options to your poll than the allowed amount, contact the board administrator.',
+ 'HELP_FAQ_POSTING_POLL_ADD_QUESTION' => 'Why can’t I add more poll options?',
+ 'HELP_FAQ_POSTING_POLL_CREATE_ANSWER' => 'When posting a new topic or editing the first post of a topic, click the “Poll creation†tab below the main posting form; if you cannot see this, you do not have appropriate permissions to create polls. Enter a title and at least two options in the appropriate fields, making sure each option is on a separate line in the textarea. You can also set the number of options users may select during voting under “Options per userâ€, a time limit in days for the poll (0 for infinite duration) and lastly the option to allow users to amend their votes.',
+ 'HELP_FAQ_POSTING_POLL_CREATE_QUESTION' => 'How do I create a poll?',
+ 'HELP_FAQ_POSTING_POLL_EDIT_ANSWER' => 'As with posts, polls can only be edited by the original poster, a moderator or an administrator. To edit a poll, click to edit the first post in the topic; this always has the poll associated with it. If no one has cast a vote, users can delete the poll or edit any poll option. However, if members have already placed votes, only moderators or administrators can edit or delete it. This prevents the poll’s options from being changed mid-way through a poll.',
+ 'HELP_FAQ_POSTING_POLL_EDIT_QUESTION' => 'How do I edit or delete a poll?',
+ 'HELP_FAQ_POSTING_QUEUE_ANSWER' => 'The board administrator may have decided that posts in the forum you are posting to require review before submission. It is also possible that the administrator has placed you in a group of users whose posts require review before submission. Please contact the board administrator for further details.',
+ 'HELP_FAQ_POSTING_QUEUE_QUESTION' => 'Why does my post need to be approved?',
+ 'HELP_FAQ_POSTING_REPORT_ANSWER' => 'If the board administrator has allowed it, you should see a button for reporting posts next to the post you wish to report. Clicking this will walk you through the steps necessary to report the post.',
+ 'HELP_FAQ_POSTING_REPORT_QUESTION' => 'How can I report posts to a moderator?',
+ 'HELP_FAQ_POSTING_SIGNATURE_ANSWER' => 'To add a signature to a post you must first create one via your User Control Panel. Once created, you can check the <em>Attach a signature</em> box on the posting form to add your signature. You can also add a signature by default to all your posts by checking the appropriate radio button in the User Control Panel. If you do so, you can still prevent a signature being added to individual posts by un-checking the add signature box within the posting form.',
+ 'HELP_FAQ_POSTING_SIGNATURE_QUESTION' => 'How do I add a signature to my post?',
+ 'HELP_FAQ_POSTING_WARNING_ANSWER' => 'Each board administrator has their own set of rules for their site. If you have broken a rule, you may be issued a warning. Please note that this is the board administrator’s decision, and the phpBB Limited has nothing to do with the warnings on the given site. Contact the board administrator if you are unsure about why you were issued a warning.',
+ 'HELP_FAQ_POSTING_WARNING_QUESTION' => 'Why did I receive a warning?',
+
+ 'HELP_FAQ_SEARCH_BLANK_ANSWER' => 'Your search returned too many results for the webserver to handle. Use “Advanced search†and be more specific in the terms used and forums that are to be searched.',
+ 'HELP_FAQ_SEARCH_BLANK_QUESTION' => 'Why does my search return a blank page!?',
+ 'HELP_FAQ_SEARCH_FORUM_ANSWER' => 'Enter a search term in the search box located on the index, forum or topic pages. Advanced search can be accessed by clicking the “Advance Search†link which is available on all pages on the forum. How to access the search may depend on the style used.',
+ 'HELP_FAQ_SEARCH_FORUM_QUESTION' => 'How can I search a forum or forums?',
+ 'HELP_FAQ_SEARCH_MEMBERS_ANSWER' => 'Visit to the “Members†page and click the “Find a member†link.',
+ 'HELP_FAQ_SEARCH_MEMBERS_QUESTION' => 'How do I search for members?',
+ 'HELP_FAQ_SEARCH_NO_RESULT_ANSWER' => '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.',
+ 'HELP_FAQ_SEARCH_NO_RESULT_QUESTION' => 'Why does my search return no results?',
+ 'HELP_FAQ_SEARCH_OWN_ANSWER' => '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.',
+ 'HELP_FAQ_SEARCH_OWN_QUESTION' => 'How can I find my own posts and topics?',
+
+ 'HELP_FAQ_USERSETTINGS_AVATAR_ANSWER' => '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.',
+ 'HELP_FAQ_USERSETTINGS_AVATAR_DISPLAY_ANSWER' => '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.',
+ 'HELP_FAQ_USERSETTINGS_AVATAR_DISPLAY_QUESTION' => 'How do I display an avatar?',
+ 'HELP_FAQ_USERSETTINGS_AVATAR_QUESTION' => 'What are the images next to my username?',
+ 'HELP_FAQ_USERSETTINGS_CHANGE_SETTINGS_ANSWER' => '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.',
+ 'HELP_FAQ_USERSETTINGS_CHANGE_SETTINGS_QUESTION' => 'How do I change my settings?',
+ 'HELP_FAQ_USERSETTINGS_EMAIL_LOGIN_ANSWER' => 'Only registered users can send email to other users via the built-in email form, and only if the administrator has enabled this feature. This is to prevent malicious use of the email system by anonymous users.',
+ 'HELP_FAQ_USERSETTINGS_EMAIL_LOGIN_QUESTION' => 'When I click the email link for a user it asks me to login?',
+ 'HELP_FAQ_USERSETTINGS_HIDE_ONLINE_ANSWER' => '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.',
+ 'HELP_FAQ_USERSETTINGS_HIDE_ONLINE_QUESTION' => 'How do I prevent my username appearing in the online user listings?',
+ 'HELP_FAQ_USERSETTINGS_LANGUAGE_ANSWER' => '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.',
+ 'HELP_FAQ_USERSETTINGS_LANGUAGE_QUESTION' => 'My language is not in the list!',
+ 'HELP_FAQ_USERSETTINGS_RANK_ANSWER' => 'Ranks, which appear below your username, indicate the number of posts you have made or identify certain users, e.g. moderators and administrators. In general, you cannot directly change the wording of any board ranks as they are set by the board administrator. Please do not abuse the board by posting unnecessarily just to increase your rank. Most boards will not tolerate this and the moderator or administrator will simply lower your post count.',
+ 'HELP_FAQ_USERSETTINGS_RANK_QUESTION' => 'What is my rank and how do I change it?',
+ 'HELP_FAQ_USERSETTINGS_SERVERTIME_ANSWER' => 'If you are sure you have set the timezone correctly and the time is still incorrect, then the time stored on the server clock is incorrect. Please notify an administrator to correct the problem.',
+ 'HELP_FAQ_USERSETTINGS_SERVERTIME_QUESTION' => 'I changed the timezone and the time is still wrong!',
+ 'HELP_FAQ_USERSETTINGS_TIMEZONE_ANSWER' => 'It is possible the time displayed is from a timezone different from the one you are in. If this is the case, visit your User Control Panel and change your timezone to match your particular area, e.g. London, Paris, New York, Sydney, etc. Please note that changing the timezone, like most settings, can only be done by registered users. If you are not registered, this is a good time to do so.',
+ 'HELP_FAQ_USERSETTINGS_TIMEZONE_QUESTION' => 'The times are not correct!',
+));
diff --git a/phpBB/language/en/install.php b/phpBB/language/en/install.php
index dd22e84fcb..a776a539ed 100644
--- a/phpBB/language/en/install.php
+++ b/phpBB/language/en/install.php
@@ -301,10 +301,10 @@ $lang = array_merge($lang, array(
'PHP_REGISTER_GLOBALS_EXPLAIN' => 'phpBB will still run if this setting is enabled, but if possible, it is recommended that register_globals is disabled on your PHP install for security reasons.',
'PHP_SAFE_MODE' => 'Safe mode',
'PHP_SETTINGS' => 'PHP version and settings',
- 'PHP_SETTINGS_EXPLAIN' => '<strong>Required</strong> - You must be running at least version 5.3.3 of PHP in order to install phpBB. If <var>safe mode</var> is displayed below your PHP installation is running in that mode. This will impose limitations on remote administration and similar features.',
+ 'PHP_SETTINGS_EXPLAIN' => '<strong>Required</strong> - You must be running at least version 5.3.9 of PHP in order to install phpBB. If <var>safe mode</var> is displayed below your PHP installation is running in that mode. This will impose limitations on remote administration and similar features.',
'PHP_URL_FOPEN_SUPPORT' => 'PHP setting <var>allow_url_fopen</var> is enabled',
'PHP_URL_FOPEN_SUPPORT_EXPLAIN' => '<strong>Optional</strong> - This setting is optional, however certain phpBB functions like off-site avatars will not work properly without it.',
- 'PHP_VERSION_REQD' => 'PHP version >= 5.3.3',
+ 'PHP_VERSION_REQD' => 'PHP version >= 5.3.9',
'POST_ID' => 'Post ID',
'PREFIX_FOUND' => 'A scan of your tables has shown a valid installation using <strong>%s</strong> as table prefix.',
'PREPROCESS_STEP' => 'Executing pre-processing functions/queries',
@@ -318,10 +318,7 @@ $lang = array_merge($lang, array(
'RETRY_WRITE' => 'Retry writing config',
'RETRY_WRITE_EXPLAIN' => 'If you wish you can change the permissions on config.php to allow phpBB to write to it. Should you wish to do that you can click Retry below to try again. Remember to return the permissions on config.php after phpBB has finished installation.',
- 'SCRIPT_PATH' => 'Script path',
- 'SCRIPT_PATH_EXPLAIN' => 'The path where phpBB is located relative to the domain name, e.g. <samp>/phpBB3</samp>.',
'SELECT_LANG' => 'Select language',
- 'SERVER_CONFIG' => 'Server configuration',
'SEARCH_INDEX_UNCONVERTED' => 'Search index was not converted',
'SEARCH_INDEX_UNCONVERTED_EXPLAIN' => 'Your old search index was not converted. Searching will always yield an empty result. To create a new search index go to the Administration Control Panel, select Maintenance and then choose Search index from the submenu.',
'SELECT_FORUM_GA' => 'In phpBB 3.1 the global announcements are linked to forums. Select a forum for your current global announcements (can be moved later):',
diff --git a/phpBB/language/en/install_new.php b/phpBB/language/en/install_new.php
new file mode 100644
index 0000000000..35153973de
--- /dev/null
+++ b/phpBB/language/en/install_new.php
@@ -0,0 +1,315 @@
+<?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.
+*
+*/
+
+/**
+* DO NOT CHANGE
+*/
+if (!defined('IN_PHPBB'))
+{
+ exit;
+}
+
+if (empty($lang) || !is_array($lang))
+{
+ $lang = array();
+}
+
+// DEVELOPERS PLEASE NOTE
+//
+// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
+//
+// Placeholders can now contain order information, e.g. instead of
+// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
+// translators to re-order the output of data while ensuring it remains correct
+//
+// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
+// equally where a string contains only two placeholders which are used to wrap text
+// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
+
+// Common installer pages
+$lang = array_merge($lang, array(
+ 'INSTALL_PANEL' => 'Installation Panel',
+ 'SELECT_LANG' => 'Select language',
+
+ 'STAGE_INSTALL' => 'Installing phpBB',
+
+ // Introduction page
+ 'INTRODUCTION_TITLE' => 'Introduction',
+ 'INTRODUCTION_BODY' => 'Welcome to phpBB3!<br /><br />phpBB® is the most widely used open source bulletin board solution in the world. phpBB3 is the latest installment in a package line started in 2000. Like its predecessors, phpBB3 is feature-rich, user-friendly, and fully supported by the phpBB Team. phpBB3 greatly improves on what made phpBB2 popular, and adds commonly requested features that were not present in previous versions. We hope it exceeds your expectations.<br /><br />This installation system will guide you through installing phpBB3, updating to the latest version of phpBB3 from past releases, as well as converting to phpBB3 from a different discussion board system (including phpBB2). For more information, we encourage you to read <a href="../docs/INSTALL.html">the installation guide</a>.<br /><br />To read the phpBB3 license or learn about obtaining support and our stance on it, please select the respective options from the side menu. To continue, please select the appropriate tab above.',
+
+ // Support page
+ 'SUPPORT_TITLE' => 'Support',
+ '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 />',
+
+ // License
+ 'LICENSE_TITLE' => 'General Public License',
+
+ // Install page
+ '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>
+
+ <ul>
+ <li>The Database Type - the database you will be using.</li>
+ <li>The Database server hostname or DSN - the address of the database server.</li>
+ <li>The Database server port - the port of the database server (most of the time this is not needed).</li>
+ <li>The Database name - the name of the database on the server.</li>
+ <li>The Database username and Database password - the login data to access the database.</li>
+ </ul>
+
+ <p><strong>Note:</strong> if you are installing using SQLite, you should enter the full path to your database file in the DSN field and leave the username and password fields blank. For security reasons, you should make sure that the database file is not stored in a location accessible from the web.</p>
+
+ <p>phpBB3 supports the following databases:</p>
+ <ul>
+ <li>MySQL 3.23 or above (MySQLi supported)</li>
+ <li>PostgreSQL 8.3+</li>
+ <li>SQLite 2.8.2+</li>
+ <li>SQLite 3.6.15+</li>
+ <li>MS SQL Server 2000 or above (directly or via ODBC)</li>
+ <li>MS SQL Server 2005 or above (native)</li>
+ <li>Oracle</li>
+ </ul>
+
+ <p>Only those databases supported on your server will be displayed.',
+
+ 'ACP_LINK' => 'Take me to <a href="%1$s">the ACP</a>',
+));
+
+// Requirements translation
+$lang = array_merge($lang, array(
+ // Filesystem requirements
+ 'FILE_NOT_EXISTS' => 'File not exists',
+ 'FILE_NOT_EXISTS_EXPLAIN' => 'To be able to install phpBB %1$s file need to exist.',
+ 'FILE_NOT_WRITABLE' => 'File not writable',
+ 'FILE_NOT_WRITABLE_EXPLAIN' => 'To be able to install phpBB %1$s file need to be writable.',
+
+ 'DIRECTORY_NOT_EXISTS' => 'Directory not exists',
+ 'DIRECTORY_NOT_EXISTS_EXPLAIN' => 'To be able to install phpBB %1$s directory need to exist.',
+ 'DIRECTORY_NOT_WRITABLE' => 'Directory not writable',
+ 'DIRECTORY_NOT_WRITABLE_EXPLAIN' => 'To be able to install phpBB %1$s directory need to be writable.',
+
+ // Server requirements
+ 'PHP_VERSION_REQD' => 'PHP version',
+ 'PHP_VERSION_REQD_EXPLAIN' => 'phpBB requires PHP version 5.3.9 or higher.',
+ 'PHP_GETIMAGESIZE_SUPPORT' => 'PHP getimagesize() function is required',
+ 'PHP_GETIMAGESIZE_SUPPORT_EXPLAIN' => 'In order for phpBB to function correctly, the getimagesize function needs to be available.',
+ 'PCRE_UTF_SUPPORT' => 'PCRE UTF-8 support',
+ 'PCRE_UTF_SUPPORT_EXPLAIN' => 'phpBB will not run if your PHP installation is not compiled with UTF-8 support in the PCRE extension.',
+ 'PHP_JSON_SUPPORT' => 'PHP JSON support',
+ 'PHP_JSON_SUPPORT_EXPLAIN' => 'In order for phpBB to function correctly, the PHP JSON extension needs to be available.',
+ 'PHP_SUPPORTED_DB' => 'Supported databases',
+ 'PHP_SUPPORTED_DB_EXPLAIN' => 'You must have support for at least one compatible database within PHP. If no database modules are shown as available you should contact your hosting provider or review the relevant PHP installation documentation for advice.',
+
+ 'RETEST_REQUIREMENTS' => 'Retest requirements',
+
+ 'STAGE_REQUIREMENTS' => 'Check requirements'
+));
+
+// General error messages
+$lang = array_merge($lang, array(
+ 'INST_ERR_MISSING_DATA' => 'You must fill out all fields in this block.',
+ 'PHPBB_ALREADY_INSTALLED' => 'phpBB is already installed.'
+));
+
+// Data obtaining translations
+$lang = array_merge($lang, array(
+ 'STAGE_OBTAIN_DATA' => 'Set installation data',
+
+ //
+ // Admin data
+ //
+ 'STAGE_ADMINISTRATOR' => 'Administrator details',
+
+ // Form labels
+ 'ADMIN_CONFIG' => 'Administrator configuration',
+ 'ADMIN_PASSWORD' => 'Administrator password',
+ 'ADMIN_PASSWORD_CONFIRM' => 'Confirm administrator password',
+ 'ADMIN_PASSWORD_EXPLAIN' => 'Please enter a password between 6 and 30 characters in length.',
+ 'ADMIN_USERNAME' => 'Administrator username',
+ 'ADMIN_USERNAME_EXPLAIN' => 'Please enter a username between 3 and 20 characters in length.',
+
+ // Errors
+ 'INST_ERR_EMAIL_INVALID' => 'The email address you entered is invalid.',
+ 'INST_ERR_PASSWORD_MISMATCH' => 'The passwords you entered did not match.',
+ 'INST_ERR_PASSWORD_TOO_LONG' => 'The password you entered is too long. The maximum length is 30 characters.',
+ 'INST_ERR_PASSWORD_TOO_SHORT' => 'The password you entered is too short. The minimum length is 6 characters.',
+ 'INST_ERR_USER_TOO_LONG' => 'The username you entered is too long. The maximum length is 20 characters.',
+ 'INST_ERR_USER_TOO_SHORT' => 'The username you entered is too short. The minimum length is 3 characters.',
+
+ //
+ // Board data
+ //
+ // Form labels
+ 'BOARD_CONFIG' => 'Bulletin board configuration',
+ 'DEFAULT_LANGUAGE' => 'Default language',
+ 'BOARD_NAME' => 'Title of the board',
+ 'BOARD_DESCRIPTION' => 'Short description of the board',
+
+ //
+ // Database data
+ //
+ 'STAGE_DATABASE' => 'Database settings',
+
+ // Form labels
+ 'DB_CONFIG' => 'Database configuration',
+ 'DBMS' => 'Database type',
+ 'DB_HOST' => 'Database server hostname or DSN',
+ 'DB_HOST_EXPLAIN' => 'DSN stands for Data Source Name and is relevant only for ODBC installs. On PostgreSQL, use localhost to connect to the local server via UNIX domain socket and 127.0.0.1 to connect via TCP. For SQLite, enter the full path to your database file.',
+ 'DB_PORT' => 'Database server port',
+ 'DB_PORT_EXPLAIN' => 'Leave this blank unless you know the server operates on a non-standard port.',
+ 'DB_PASSWORD' => 'Database password',
+ 'DB_NAME' => 'Database name',
+ 'DB_USERNAME' => 'Database username',
+ 'TABLE_PREFIX' => 'Prefix for tables in database',
+ 'TABLE_PREFIX_EXPLAIN' => 'The prefix must start with a letter and must only contain letters, numbers and underscores.',
+
+ // Database options
+ 'DB_OPTION_MSSQL' => 'MSSQL Server 2000+',
+ 'DB_OPTION_MSSQL_ODBC' => 'MSSQL Server 2000+ via ODBC',
+ 'DB_OPTION_MSSQLNATIVE' => 'MSSQL Server 2005+ [ Native ]',
+ 'DB_OPTION_MYSQL' => 'MySQL',
+ 'DB_OPTION_MYSQLI' => 'MySQL with MySQLi Extension',
+ 'DB_OPTION_ORACLE' => 'Oracle',
+ 'DB_OPTION_POSTGRES' => 'PostgreSQL',
+ 'DB_OPTION_SQLITE' => 'SQLite 2',
+ 'DB_OPTION_SQLITE3' => 'SQLite 3',
+
+ // Errors
+ 'INST_ERR_NO_DB' => 'Cannot load the PHP module for the selected database type.',
+ 'INST_ERR_DB_INVALID_PREFIX' => 'The prefix you entered is invalid. It must start with a letter and must only contain letters, numbers and underscores.',
+ 'INST_ERR_PREFIX_TOO_LONG' => 'The table prefix you have specified is too long. The maximum length is %d characters.',
+ 'INST_ERR_DB_NO_NAME' => 'No database name specified.',
+ 'INST_ERR_DB_FORUM_PATH' => 'The database file specified is within your board directory tree. You should put this file in a non web-accessible location.',
+ 'INST_ERR_DB_CONNECT' => 'Could not connect to the database, see error message below.',
+ 'INST_ERR_DB_NO_ERROR' => 'No error message given.',
+ 'INST_ERR_PREFIX' => 'Tables with the specified prefix already exist, please choose an alternative.',
+ 'INST_ERR_DB_NO_MYSQLI' => 'The version of MySQL installed on this machine is incompatible with the “MySQL with MySQLi Extension†option you have selected. Please try the “MySQL†option instead.',
+ 'INST_ERR_DB_NO_SQLITE' => 'The version of the SQLite extension you have installed is too old, it must be upgraded to at least 2.8.2.',
+ 'INST_ERR_DB_NO_SQLITE3' => 'The version of the SQLite extension you have installed is too old, it must be upgraded to at least 3.6.15.',
+ 'INST_ERR_DB_NO_ORACLE' => 'The version of Oracle installed on this machine requires you to set the <var>NLS_CHARACTERSET</var> parameter to <var>UTF8</var>. Either upgrade your installation to 9.2+ or change the parameter.',
+ 'INST_ERR_DB_NO_POSTGRES' => 'The database you have selected was not created in <var>UNICODE</var> or <var>UTF8</var> encoding. Try installing with a database in <var>UNICODE</var> or <var>UTF8</var> encoding.',
+
+ //
+ // Email data
+ //
+ 'EMAIL_CONFIG' => 'E-mail configuration',
+
+ //
+ // Server data
+ //
+ // Form labels
+ 'SERVER_CONFIG' => 'Server configuration',
+ 'SCRIPT_PATH' => 'Script path',
+ 'SCRIPT_PATH_EXPLAIN' => 'The path where phpBB is located relative to the domain name, e.g. <samp>/phpBB3</samp>.',
+));
+
+// Default database schema entries...
+$lang = array_merge($lang, array(
+ 'CONFIG_BOARD_EMAIL_SIG' => 'Thanks, The Management',
+ 'CONFIG_SITE_DESC' => 'A short text to describe your forum',
+ 'CONFIG_SITENAME' => 'yourdomain.com',
+
+ 'DEFAULT_INSTALL_POST' => 'This is an example post in your phpBB3 installation. Everything seems to be working. You may delete this post if you like and continue to set up your board. During the installation process your first category and your first forum are assigned an appropriate set of permissions for the predefined usergroups administrators, bots, global moderators, guests, registered users and registered COPPA users. If you also choose to delete your first category and your first forum, do not forget to assign permissions for all these usergroups for all new categories and forums you create. It is recommended to rename your first category and your first forum and copy permissions from these while creating new categories and forums. Have fun!',
+
+ 'FORUMS_FIRST_CATEGORY' => 'Your first category',
+ 'FORUMS_TEST_FORUM_DESC' => 'Description of your first forum.',
+ 'FORUMS_TEST_FORUM_TITLE' => 'Your first forum',
+
+ 'RANKS_SITE_ADMIN_TITLE' => 'Site Admin',
+ 'REPORT_WAREZ' => 'The post contains links to illegal or pirated software.',
+ 'REPORT_SPAM' => 'The reported post has the only purpose to advertise for a website or another product.',
+ 'REPORT_OFF_TOPIC' => 'The reported post is off topic.',
+ 'REPORT_OTHER' => 'The reported post does not fit into any other category, please use the further information field.',
+
+ 'SMILIES_ARROW' => 'Arrow',
+ 'SMILIES_CONFUSED' => 'Confused',
+ 'SMILIES_COOL' => 'Cool',
+ 'SMILIES_CRYING' => 'Crying or Very Sad',
+ 'SMILIES_EMARRASSED' => 'Embarrassed',
+ 'SMILIES_EVIL' => 'Evil or Very Mad',
+ 'SMILIES_EXCLAMATION' => 'Exclamation',
+ 'SMILIES_GEEK' => 'Geek',
+ 'SMILIES_IDEA' => 'Idea',
+ 'SMILIES_LAUGHING' => 'Laughing',
+ 'SMILIES_MAD' => 'Mad',
+ 'SMILIES_MR_GREEN' => 'Mr. Green',
+ 'SMILIES_NEUTRAL' => 'Neutral',
+ 'SMILIES_QUESTION' => 'Question',
+ 'SMILIES_RAZZ' => 'Razz',
+ 'SMILIES_ROLLING_EYES' => 'Rolling Eyes',
+ 'SMILIES_SAD' => 'Sad',
+ 'SMILIES_SHOCKED' => 'Shocked',
+ 'SMILIES_SMILE' => 'Smile',
+ 'SMILIES_SURPRISED' => 'Surprised',
+ 'SMILIES_TWISTED_EVIL' => 'Twisted Evil',
+ 'SMILIES_UBER_GEEK' => 'Uber Geek',
+ 'SMILIES_VERY_HAPPY' => 'Very Happy',
+ 'SMILIES_WINK' => 'Wink',
+
+ 'TOPICS_TOPIC_TITLE' => 'Welcome to phpBB3',
+));
+
+// Common navigation items' translation
+$lang = array_merge($lang, array(
+ 'MENU_OVERVIEW' => 'Overview',
+ 'MENU_INTRO' => 'Introduction',
+ 'MENU_LICENSE' => 'License',
+ 'MENU_SUPPORT' => 'Support',
+));
+
+// Task names
+$lang = array_merge($lang, array(
+ // Install filesystem
+ 'TASK_CREATE_CONFIG_FILE' => 'Creating configuration file',
+
+ // Install database
+ 'TASK_ADD_CONFIG_SETTINGS' => 'Adding configuration settings',
+ 'TASK_ADD_DEFAULT_DATA' => 'Adding default settings to the database',
+ 'TASK_CREATE_DATABASE_SCHEMA' => 'Creating database schema',
+
+ // Install data
+ 'TASK_ADD_BOTS' => 'Registering bots',
+ 'TASK_ADD_LANGUAGES' => 'Installing available languages',
+ 'TASK_ADD_MODULES' => 'Installing modules',
+
+ // Install finish tasks
+ 'TASK_NOTIFY_USER' => 'Sending notification e-mail',
+ 'TASK_POPULATE_MIGRATIONS' => 'Populating migrations',
+
+ // Installer general progress messages
+ 'INSTALLER_FINISHED' => 'The installer has finished successfully',
+));
+
+// Installer's general messages
+$lang = array_merge($lang, array(
+ 'MODULE_NOT_FOUND' => 'Module not found',
+ 'MODULE_NOT_FOUND_DESCRIPTION' => 'No module is found under the service definition “%s†is not defined.',
+
+ 'TASK_NOT_FOUND' => 'Task not found',
+ 'TASK_NOT_FOUND_DESCRIPTION' => 'No task is found under the service definition “%s†is not defined.',
+
+ 'SKIP_MODULE' => 'Skip “%s†module',
+ 'SKIP_TASK' => 'Skip “%s†task',
+
+ 'TASK_SERVICE_INSTALLER_MISSING' => 'All installer task services should start with “installerâ€',
+ 'TASK_CLASS_NOT_FOUND' => 'Installer task service definition is invalid. Service name “%1$s†given, the expected class namespace is “%2$s†for that. For more information please see the documentation of task_interface.',
+
+ 'INSTALLER_CONFIG_NOT_WRITABLE' => 'The installer config file is not writable.',
+));
+
+// CLI messages
+$lang = array_merge($lang, array(
+ 'CLI_INSTALL_BOARD' => 'Install phpBB',
+ 'CLI_INSTALL_SHOW_CONFIG' => 'Show the configuration which will be used',
+ 'CLI_INSTALL_VALIDATE_CONFIG' => 'Validate a configuration file',
+ 'CLI_CONFIG_FILE' => 'Config file to use',
+));
diff --git a/phpBB/language/en/mcp.php b/phpBB/language/en/mcp.php
index a961068657..b196a1d658 100644
--- a/phpBB/language/en/mcp.php
+++ b/phpBB/language/en/mcp.php
@@ -135,6 +135,7 @@ $lang = array_merge($lang, array(
'LOCK_TOPICS_CONFIRM' => 'Are you sure you want to lock all selected topics?',
'LOGS_CURRENT_TOPIC' => 'Currently viewing logs of:',
'LOGIN_EXPLAIN_MCP' => 'To moderate this forum you must login.',
+ 'LOGVIEW_VIEWPOST' => 'View post',
'LOGVIEW_VIEWTOPIC' => 'View topic',
'LOGVIEW_VIEWLOGS' => 'View topic log',
'LOGVIEW_VIEWFORUM' => 'View forum',
diff --git a/phpBB/language/en/ucp.php b/phpBB/language/en/ucp.php
index 07751d1f7f..b346051108 100644
--- a/phpBB/language/en/ucp.php
+++ b/phpBB/language/en/ucp.php
@@ -327,6 +327,7 @@ $lang = array_merge($lang, array(
'NOTIFICATION_GROUP_MODERATION' => 'Moderation Notifications',
'NOTIFICATION_GROUP_ADMINISTRATION' => 'Administration Notifications',
'NOTIFICATION_GROUP_POSTING' => 'Posting Notifications',
+ 'NOTIFICATION_METHOD_BOARD' => 'Notifications',
'NOTIFICATION_METHOD_EMAIL' => 'Email',
'NOTIFICATION_METHOD_JABBER' => 'Jabber',
'NOTIFICATION_TYPE' => 'Notification type',
diff --git a/phpBB/mcp.php b/phpBB/mcp.php
index f9d46db528..a5fa09ba2b 100644
--- a/phpBB/mcp.php
+++ b/phpBB/mcp.php
@@ -33,10 +33,10 @@ $module = new p_master();
$template->assign_var('S_IN_MCP', true);
// Basic parameter data
-$id = request_var('i', '');
+$id = $request->variable('i', '');
-$mode = request_var('mode', array(''));
-$mode = sizeof($mode) ? array_shift($mode) : request_var('mode', '');
+$mode = $request->variable('mode', array(''));
+$mode = sizeof($mode) ? array_shift($mode) : $request->variable('mode', '');
// Only Moderators can go beyond this point
if (!$user->data['is_registered'])
@@ -50,10 +50,10 @@ if (!$user->data['is_registered'])
}
$quickmod = (isset($_REQUEST['quickmod'])) ? true : false;
-$action = request_var('action', '');
-$action_ary = request_var('action', array('' => 0));
+$action = $request->variable('action', '');
+$action_ary = $request->variable('action', array('' => 0));
-$forum_action = request_var('forum_action', '');
+$forum_action = $request->variable('forum_action', '');
if ($forum_action !== '' && $request->variable('sort', false, false, \phpbb\request\request_interface::POST))
{
$action = $forum_action;
@@ -71,12 +71,12 @@ if ($mode == 'topic_logs')
$quickmod = false;
}
-$post_id = request_var('p', 0);
-$topic_id = request_var('t', 0);
-$forum_id = request_var('f', 0);
-$report_id = request_var('r', 0);
-$user_id = request_var('u', 0);
-$username = utf8_normalize_nfc(request_var('username', '', true));
+$post_id = $request->variable('p', 0);
+$topic_id = $request->variable('t', 0);
+$forum_id = $request->variable('f', 0);
+$report_id = $request->variable('r', 0);
+$user_id = $request->variable('u', 0);
+$username = $request->variable('username', '', true);
if ($post_id)
{
@@ -111,8 +111,8 @@ if (!$auth->acl_getf_global('m_'))
'lock' => 'f_user_lock',
'make_sticky' => 'f_sticky',
'make_announce' => 'f_announce',
- 'make_global' => 'f_announce',
- 'make_normal' => array('f_announce', 'f_sticky')
+ 'make_global' => 'f_announce_global',
+ 'make_normal' => array('f_announce', 'f_announce_global', 'f_sticky')
);
$allow_user = false;
@@ -192,7 +192,7 @@ if ($quickmod)
case 'topic_logs':
// Reset start parameter if we jumped from the quickmod dropdown
- if (request_var('start', 0))
+ if ($request->variable('start', 0))
{
$request->overwrite('start', 0);
}
diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php
index e64dab635b..eaaae4aaab 100644
--- a/phpBB/memberlist.php
+++ b/phpBB/memberlist.php
@@ -20,7 +20,7 @@ $phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
-$mode = request_var('mode', '');
+$mode = $request->variable('mode', '');
if ($mode === 'contactadmin')
{
@@ -37,11 +37,11 @@ $user->setup(array('memberlist', 'groups'));
$template->assign_var('S_IN_MEMBERLIST', true);
// Grab data
-$action = request_var('action', '');
-$user_id = request_var('u', ANONYMOUS);
-$username = request_var('un', '', true);
-$group_id = request_var('g', 0);
-$topic_id = request_var('t', 0);
+$action = $request->variable('action', '');
+$user_id = $request->variable('u', ANONYMOUS);
+$username = $request->variable('un', '', true);
+$group_id = $request->variable('g', 0);
+$topic_id = $request->variable('t', 0);
// Redirect when old mode is used
if ($mode == 'leaders')
@@ -83,12 +83,15 @@ switch ($mode)
break;
}
-$start = request_var('start', 0);
+/** @var \phpbb\group\helper $group_helper */
+$group_helper = $phpbb_container->get('group_helper');
+
+$start = $request->variable('start', 0);
$submit = (isset($_POST['submit'])) ? true : false;
$default_key = 'c';
-$sort_key = request_var('sk', $default_key);
-$sort_dir = request_var('sd', 'a');
+$sort_key = $request->variable('sk', $default_key);
+$sort_dir = $request->variable('sd', 'a');
// What do you want to do today? ... oops, I think that line is taken ...
switch ($mode)
@@ -136,7 +139,7 @@ switch ($mode)
}
else
{
- $row['group_name'] = ($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name'];
+ $row['group_name'] = $group_helper->get_name($row['group_name']);
$row['u_group'] = append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']);
}
@@ -411,7 +414,7 @@ switch ($mode)
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
$subject = sprintf($user->lang['IM_JABBER_SUBJECT'], $user->data['username'], $config['server_name']);
- $message = utf8_normalize_nfc(request_var('message', '', true));
+ $message = $request->variable('message', '', true);
if (empty($message))
{
@@ -536,20 +539,14 @@ switch ($mode)
$group_data = $group_sort = array();
foreach ($profile_groups as $row)
{
- if ($row['group_type'] == GROUP_SPECIAL)
- {
- // Lookup group name in language dictionary
- if (isset($user->lang['G_' . $row['group_name']]))
- {
- $row['group_name'] = $user->lang['G_' . $row['group_name']];
- }
- }
- else if (!$auth_hidden_groups && $row['group_type'] == GROUP_HIDDEN && !isset($user_groups[$row['group_id']]))
+ if (!$auth_hidden_groups && $row['group_type'] == GROUP_HIDDEN && !isset($user_groups[$row['group_id']]))
{
// Skip over hidden groups the user cannot see
continue;
}
+ $row['group_name'] = $group_helper->get_name($row['group_name']);
+
$group_sort[$row['group_id']] = utf8_clean_string($row['group_name']);
$group_data[$row['group_id']] = $row;
}
@@ -638,6 +635,7 @@ switch ($mode)
$profile_fields = array();
if ($config['load_cpf_viewprofile'])
{
+ /* @var $cp \phpbb\profilefields\manager */
$cp = $phpbb_container->get('profilefields.manager');
$profile_fields = $cp->grab_profile_fields_data($user_id);
$profile_fields = (isset($profile_fields[$user_id])) ? $cp->generate_profile_fields_template_data($profile_fields[$user_id]) : array();
@@ -786,8 +784,8 @@ switch ($mode)
include($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
}
- $user_id = request_var('u', 0);
- $topic_id = request_var('t', 0);
+ $user_id = $request->variable('u', 0);
+ $topic_id = $request->variable('t', 0);
if ($user_id)
{
@@ -805,6 +803,8 @@ switch ($mode)
{
trigger_error('NO_EMAIL');
}
+
+ /** @var $form \phpbb\message\form */
$form = $phpbb_container->get('message.form.' . $form_name);
$form->bind($request);
@@ -860,6 +860,8 @@ switch ($mode)
// The basic memberlist
$page_title = $user->lang['MEMBERLIST'];
$template_html = 'memberlist_body.html';
+
+ /* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
// Sorting
@@ -908,9 +910,9 @@ switch ($mode)
$sql_select = $sql_where_data = $sql_from = $sql_where = $order_by = '';
- $form = request_var('form', '');
- $field = request_var('field', '');
- $select_single = request_var('select_single', false);
+ $form = $request->variable('form', '');
+ $field = $request->variable('field', '');
+ $select_single = $request->variable('select_single', false);
// Search URL parameters, if any of these are in the URL we do a search
$search_params = array('username', 'email', 'jabber', 'search_group_id', 'joined_select', 'active_select', 'count_select', 'joined', 'active', 'count', 'ip');
@@ -920,20 +922,20 @@ switch ($mode)
$field = (!preg_match('/^[a-z0-9_-]+$/i', $field)) ? '' : $field;
if ((($mode == '' || $mode == 'searchuser') || sizeof(array_intersect($request->variable_names(\phpbb\request\request_interface::GET), $search_params)) > 0) && ($config['load_search'] || $auth->acl_get('a_')))
{
- $username = request_var('username', '', true);
- $email = strtolower(request_var('email', ''));
- $jabber = request_var('jabber', '');
- $search_group_id = request_var('search_group_id', 0);
+ $username = $request->variable('username', '', true);
+ $email = strtolower($request->variable('email', ''));
+ $jabber = $request->variable('jabber', '');
+ $search_group_id = $request->variable('search_group_id', 0);
// when using these, make sure that we actually have values defined in $find_key_match
- $joined_select = request_var('joined_select', 'lt');
- $active_select = request_var('active_select', 'lt');
- $count_select = request_var('count_select', 'eq');
+ $joined_select = $request->variable('joined_select', 'lt');
+ $active_select = $request->variable('active_select', 'lt');
+ $count_select = $request->variable('count_select', 'eq');
- $joined = explode('-', request_var('joined', ''));
- $active = explode('-', request_var('active', ''));
- $count = (request_var('count', '') !== '') ? request_var('count', 0) : '';
- $ipdomain = request_var('ip', '');
+ $joined = explode('-', $request->variable('joined', ''));
+ $active = explode('-', $request->variable('active', ''));
+ $count = ($request->variable('count', '') !== '') ? $request->variable('count', 0) : '';
+ $ipdomain = $request->variable('ip', '');
$find_key_match = array('lt' => '<', 'gt' => '>', 'eq' => '=');
@@ -1050,7 +1052,7 @@ switch ($mode)
}
}
- $first_char = request_var('first_char', '');
+ $first_char = $request->variable('first_char', '');
if ($first_char == 'other')
{
@@ -1131,7 +1133,7 @@ switch ($mode)
$template->assign_vars(array(
'GROUP_DESC' => generate_text_for_display($group_row['group_desc'], $group_row['group_desc_uid'], $group_row['group_desc_bitfield'], $group_row['group_desc_options']),
- 'GROUP_NAME' => ($group_row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $group_row['group_name']] : $group_row['group_name'],
+ 'GROUP_NAME' => $group_helper->get_name($group_row['group_name']),
'GROUP_COLOR' => $group_row['group_colour'],
'GROUP_TYPE' => $user->lang['GROUP_IS_' . $group_row['l_group_type']],
'GROUP_RANK' => $user_rank_data['title'],
@@ -1184,7 +1186,7 @@ switch ($mode)
// Build a relevant pagination_url
$params = $sort_params = array();
- // We do not use request_var() here directly to save some calls (not all variables are set)
+ // We do not use $request->variable() here directly to save some calls (not all variables are set)
$check_params = array(
'g' => array('g', 0),
'sk' => array('sk', $default_key),
@@ -1201,7 +1203,7 @@ switch ($mode)
'count_select' => array('count_select', 'eq'),
'joined' => array('joined', ''),
'active' => array('active', ''),
- 'count' => (request_var('count', '') !== '') ? array('count', 0) : array('count', ''),
+ 'count' => ($request->variable('count', '') !== '') ? array('count', 0) : array('count', ''),
'ip' => array('ip', ''),
'first_char' => array('first_char', ''),
);
@@ -1214,7 +1216,7 @@ switch ($mode)
continue;
}
- $param = call_user_func_array('request_var', $call);
+ $param = call_user_func_array(array($request, 'variable'), $call);
$param = urlencode($key) . '=' . ((is_string($param)) ? urlencode($param) : $param);
$params[] = $param;
@@ -1266,7 +1268,7 @@ switch ($mode)
// Some search user specific data
if (($mode == '' || $mode == 'searchuser') && ($config['load_search'] || $auth->acl_get('a_')))
{
- $group_selected = request_var('search_group_id', 0);
+ $group_selected = $request->variable('search_group_id', 0);
$s_group_select = '<option value="0"' . ((!$group_selected) ? ' selected="selected"' : '') . '>&nbsp;</option>';
$group_ids = array();
@@ -1310,7 +1312,7 @@ switch ($mode)
while ($row = $db->sql_fetchrow($result))
{
$group_ids[] = $row['group_id'];
- $s_group_select .= '<option value="' . $row['group_id'] . '"' . (($group_selected == $row['group_id']) ? ' selected="selected"' : '') . '>' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
+ $s_group_select .= '<option value="' . $row['group_id'] . '"' . (($group_selected == $row['group_id']) ? ' selected="selected"' : '') . '>' . $group_helper->get_name($row['group_name']) . '</option>';
}
$db->sql_freeresult($result);
@@ -1366,6 +1368,7 @@ switch ($mode)
// Load custom profile fields
if ($config['load_cpf_memberlist'])
{
+ /* @var $cp \phpbb\profilefields\manager */
$cp = $phpbb_container->get('profilefields.manager');
$cp_row = $cp->generate_profile_fields_template_headlines('field_show_on_ml');
diff --git a/phpBB/phpbb/auth/auth.php b/phpBB/phpbb/auth/auth.php
index b59f0e60ec..92c19fd5f7 100644
--- a/phpBB/phpbb/auth/auth.php
+++ b/phpBB/phpbb/auth/auth.php
@@ -929,6 +929,7 @@ class auth
{
global $db, $user, $phpbb_root_path, $phpEx, $phpbb_container;
+ /* @var $provider_collection \phpbb\auth\provider_collection */
$provider_collection = $phpbb_container->get('auth.provider_collection');
$provider = $provider_collection->get_provider();
diff --git a/phpBB/phpbb/auth/provider/db.php b/phpBB/phpbb/auth/provider/db.php
index d8c5fb72de..1adf85ee05 100644
--- a/phpBB/phpbb/auth/provider/db.php
+++ b/phpBB/phpbb/auth/provider/db.php
@@ -155,6 +155,7 @@ class db extends \phpbb\auth\provider\base
// Every auth module is able to define what to do by itself...
if ($show_captcha)
{
+ /* @var $captcha_factory \phpbb\captcha\factory */
$captcha_factory = $this->phpbb_container->get('captcha.factory');
$captcha = $captcha_factory->get_instance($this->config['captcha_plugin']);
$captcha->init(CONFIRM_LOGIN);
diff --git a/phpBB/phpbb/avatar/driver/driver.php b/phpBB/phpbb/avatar/driver/driver.php
index b3ced7edf7..c849533166 100644
--- a/phpBB/phpbb/avatar/driver/driver.php
+++ b/phpBB/phpbb/avatar/driver/driver.php
@@ -30,6 +30,9 @@ abstract class driver implements \phpbb\avatar\driver\driver_interface
*/
protected $config;
+ /** @var \FastImageSize\FastImageSize */
+ protected $imagesize;
+
/**
* Current $phpbb_root_path
* @var string
@@ -73,14 +76,16 @@ abstract class driver implements \phpbb\avatar\driver\driver_interface
* Construct a driver object
*
* @param \phpbb\config\config $config phpBB configuration
+ * @param \FastImageSize\FastImageSize $imagesize FastImageSize class
* @param string $phpbb_root_path Path to the phpBB root
* @param string $php_ext PHP file extension
* @param \phpbb\path_helper $path_helper phpBB path helper
* @param \phpbb\cache\driver\driver_interface $cache Cache driver
*/
- public function __construct(\phpbb\config\config $config, $phpbb_root_path, $php_ext, \phpbb\path_helper $path_helper, \phpbb\cache\driver\driver_interface $cache = null)
+ public function __construct(\phpbb\config\config $config, \FastImageSize\FastImageSize $imagesize, $phpbb_root_path, $php_ext, \phpbb\path_helper $path_helper, \phpbb\cache\driver\driver_interface $cache = null)
{
$this->config = $config;
+ $this->imagesize = $imagesize;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
$this->path_helper = $path_helper;
diff --git a/phpBB/phpbb/avatar/driver/gravatar.php b/phpBB/phpbb/avatar/driver/gravatar.php
index 2082e0fd02..badbd9421d 100644
--- a/phpBB/phpbb/avatar/driver/gravatar.php
+++ b/phpBB/phpbb/avatar/driver/gravatar.php
@@ -98,8 +98,8 @@ class gravatar extends \phpbb\avatar\driver\driver
return false;
}
- // Make sure getimagesize works...
- if (function_exists('getimagesize') && ($row['avatar_width'] <= 0 || $row['avatar_height'] <= 0))
+ // Get image dimensions if they are not set
+ if ($row['avatar_width'] <= 0 || $row['avatar_height'] <= 0)
{
/**
* default to the minimum of the maximum allowed avatar size if the size
@@ -108,20 +108,20 @@ class gravatar extends \phpbb\avatar\driver\driver
$row['avatar_width'] = $row['avatar_height'] = min($this->config['avatar_max_width'], $this->config['avatar_max_height']);
$url = $this->get_gravatar_url($row);
- if (($row['avatar_width'] <= 0 || $row['avatar_height'] <= 0) && (($image_data = getimagesize($url)) === false))
+ if (($row['avatar_width'] <= 0 || $row['avatar_height'] <= 0) && (($image_data = $this->imagesize->getImageSize($url)) === false))
{
$error[] = 'UNABLE_GET_IMAGE_SIZE';
return false;
}
- if (!empty($image_data) && ($image_data[0] <= 0 || $image_data[1] <= 0))
+ if (!empty($image_data) && ($image_data['width'] <= 0 || $image_data['width'] <= 0))
{
$error[] = 'AVATAR_NO_SIZE';
return false;
}
- $row['avatar_width'] = ($row['avatar_width'] && $row['avatar_height']) ? $row['avatar_width'] : $image_data[0];
- $row['avatar_height'] = ($row['avatar_width'] && $row['avatar_height']) ? $row['avatar_height'] : $image_data[1];
+ $row['avatar_width'] = ($row['avatar_width'] && $row['avatar_height']) ? $row['avatar_width'] : $image_data['width'];
+ $row['avatar_height'] = ($row['avatar_width'] && $row['avatar_height']) ? $row['avatar_height'] : $image_data['height'];
}
if ($row['avatar_width'] <= 0 || $row['avatar_height'] <= 0)
diff --git a/phpBB/phpbb/avatar/driver/local.php b/phpBB/phpbb/avatar/driver/local.php
index 36087f8ba0..88a139f81e 100644
--- a/phpBB/phpbb/avatar/driver/local.php
+++ b/phpBB/phpbb/avatar/driver/local.php
@@ -172,13 +172,15 @@ class local extends \phpbb\avatar\driver\driver
// Match all images in the gallery folder
if (preg_match('#^[^&\'"<>]+\.(?:' . implode('|', $this->allowed_extensions) . ')$#i', $image) && is_file($file_path . '/' . $image))
{
- if (function_exists('getimagesize'))
+ $dims = $this->imagesize->getImageSize($file_path . '/' . $image);
+
+ if ($dims === false)
{
- $dims = getimagesize($file_path . '/' . $image);
+ $dims = array(0, 0);
}
else
{
- $dims = array(0, 0);
+ $dims = array($dims['width'], $dims['height']);
}
$cat = ($path == $file_path) ? $user->lang['NO_AVATAR_CATEGORY'] : str_replace("$path/", '', $file_path);
$avatar_list[$cat][$image] = array(
diff --git a/phpBB/phpbb/avatar/driver/remote.php b/phpBB/phpbb/avatar/driver/remote.php
index 4b0ee3f06f..90443c9b4e 100644
--- a/phpBB/phpbb/avatar/driver/remote.php
+++ b/phpBB/phpbb/avatar/driver/remote.php
@@ -92,25 +92,22 @@ class remote extends \phpbb\avatar\driver\driver
return false;
}
- // Make sure getimagesize works...
- if (function_exists('getimagesize'))
+ // Get image dimensions
+ if (($width <= 0 || $height <= 0) && (($image_data = $this->imagesize->getImageSize($url)) === false))
{
- if (($width <= 0 || $height <= 0) && (($image_data = @getimagesize($url)) === false))
- {
- $error[] = 'UNABLE_GET_IMAGE_SIZE';
- return false;
- }
-
- if (!empty($image_data) && ($image_data[0] <= 0 || $image_data[1] <= 0))
- {
- $error[] = 'AVATAR_NO_SIZE';
- return false;
- }
+ $error[] = 'UNABLE_GET_IMAGE_SIZE';
+ return false;
+ }
- $width = ($width && $height) ? $width : $image_data[0];
- $height = ($width && $height) ? $height : $image_data[1];
+ if (!empty($image_data) && ($image_data['width'] <= 0 || $image_data['height'] <= 0))
+ {
+ $error[] = 'AVATAR_NO_SIZE';
+ return false;
}
+ $width = ($width && $height) ? $width : $image_data['width'];
+ $height = ($width && $height) ? $height : $image_data['height'];
+
if ($width <= 0 || $height <= 0)
{
$error[] = 'AVATAR_NO_SIZE';
@@ -172,15 +169,15 @@ class remote extends \phpbb\avatar\driver\driver
return false;
}
- if (!empty($image_data) && (!isset($types[$image_data[2]]) || !in_array($extension, $types[$image_data[2]])))
+ if (!empty($image_data) && (!isset($types[$image_data['type']]) || !in_array($extension, $types[$image_data['type']])))
{
- if (!isset($types[$image_data[2]]))
+ if (!isset($types[$image_data['type']]))
{
$error[] = 'UNABLE_GET_IMAGE_SIZE';
}
else
{
- $error[] = array('IMAGE_FILETYPE_MISMATCH', $types[$image_data[2]][0], $extension);
+ $error[] = array('IMAGE_FILETYPE_MISMATCH', $types[$image_data['type']][0], $extension);
}
return false;
diff --git a/phpBB/phpbb/avatar/driver/upload.php b/phpBB/phpbb/avatar/driver/upload.php
index e44157294c..b31609b982 100644
--- a/phpBB/phpbb/avatar/driver/upload.php
+++ b/phpBB/phpbb/avatar/driver/upload.php
@@ -19,6 +19,11 @@ namespace phpbb\avatar\driver;
class upload extends \phpbb\avatar\driver\driver
{
/**
+ * @var \phpbb\filesystem\filesystem_interface
+ */
+ protected $filesystem;
+
+ /**
* @var \phpbb\mimetype\guesser
*/
protected $mimetype_guesser;
@@ -34,16 +39,18 @@ class upload extends \phpbb\avatar\driver\driver
* @param \phpbb\config\config $config phpBB configuration
* @param string $phpbb_root_path Path to the phpBB root
* @param string $php_ext PHP file extension
- * @param \phpbb_path_helper $path_helper phpBB path helper
+ * @param \phpbb\filesystem\filesystem_interface phpBB filesystem helper
+ * @param \phpbb\path_helper $path_helper phpBB path helper
* @param \phpbb\mimetype\guesser $mimetype_guesser Mimetype guesser
* @param \phpbb\event\dispatcher_interface $dispatcher phpBB Event dispatcher object
* @param \phpbb\cache\driver\driver_interface $cache Cache driver
*/
- public function __construct(\phpbb\config\config $config, $phpbb_root_path, $php_ext, \phpbb\path_helper $path_helper, \phpbb\mimetype\guesser $mimetype_guesser, \phpbb\event\dispatcher_interface $dispatcher, \phpbb\cache\driver\driver_interface $cache = null)
+ public function __construct(\phpbb\config\config $config, $phpbb_root_path, $php_ext, \phpbb\filesystem\filesystem_interface $filesystem, \phpbb\path_helper $path_helper, \phpbb\mimetype\guesser $mimetype_guesser, \phpbb\event\dispatcher_interface $dispatcher, \phpbb\cache\driver\driver_interface $cache = null)
{
$this->config = $config;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
+ $this->filesystem = $filesystem;
$this->path_helper = $path_helper;
$this->mimetype_guesser = $mimetype_guesser;
$this->dispatcher = $dispatcher;
@@ -97,7 +104,7 @@ class upload extends \phpbb\avatar\driver\driver
include($this->phpbb_root_path . 'includes/functions_upload.' . $this->php_ext);
}
- $upload = new \fileupload('AVATAR_', $this->allowed_extensions, $this->config['avatar_filesize'], $this->config['avatar_min_width'], $this->config['avatar_min_height'], $this->config['avatar_max_width'], $this->config['avatar_max_height'], (isset($this->config['mime_triggers']) ? explode('|', $this->config['mime_triggers']) : false));
+ $upload = new \fileupload($this->filesystem, 'AVATAR_', $this->allowed_extensions, $this->config['avatar_filesize'], $this->config['avatar_min_width'], $this->config['avatar_min_height'], $this->config['avatar_max_width'], $this->config['avatar_max_height'], (isset($this->config['mime_triggers']) ? explode('|', $this->config['mime_triggers']) : false));
$url = $request->variable('avatar_upload_url', '');
$upload_file = $request->file('avatar_upload_file');
@@ -278,6 +285,6 @@ class upload extends \phpbb\avatar\driver\driver
*/
protected function can_upload()
{
- return (file_exists($this->phpbb_root_path . $this->config['avatar_path']) && phpbb_is_writable($this->phpbb_root_path . $this->config['avatar_path']) && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on'));
+ return (file_exists($this->phpbb_root_path . $this->config['avatar_path']) && $this->filesystem->is_writable($this->phpbb_root_path . $this->config['avatar_path']) && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on'));
}
}
diff --git a/phpBB/phpbb/cache/driver/base.php b/phpBB/phpbb/cache/driver/base.php
index 4c20ad916d..55cd4668de 100644
--- a/phpBB/phpbb/cache/driver/base.php
+++ b/phpBB/phpbb/cache/driver/base.php
@@ -50,6 +50,7 @@ abstract class base implements \phpbb\cache\driver\driver_interface
}
else if (strpos($filename, 'container_') === 0 ||
strpos($filename, 'url_matcher') === 0 ||
+ strpos($filename, 'url_generator') === 0 ||
strpos($filename, 'sql_') === 0 ||
strpos($filename, 'data_') === 0)
{
@@ -90,14 +91,14 @@ abstract class base implements \phpbb\cache\driver\driver_interface
{
// Remove extra spaces and tabs
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
+ $query_id = md5($query);
- if (($rowset = $this->_read('sql_' . md5($query))) === false)
+ if (($result = $this->_read('sql_' . $query_id)) === false)
{
return false;
}
- $query_id = sizeof($this->sql_rowset);
- $this->sql_rowset[$query_id] = $rowset;
+ $this->sql_rowset[$query_id] = $result;
$this->sql_row_pointer[$query_id] = 0;
return $query_id;
@@ -176,13 +177,9 @@ abstract class base implements \phpbb\cache\driver\driver_interface
*/
function remove_file($filename, $check = false)
{
- if (!function_exists('phpbb_is_writable'))
- {
- global $phpbb_root_path, $phpEx;
- include($phpbb_root_path . 'includes/functions.' . $phpEx);
- }
+ global $phpbb_filesystem;
- if ($check && !phpbb_is_writable($this->cache_dir))
+ if ($check && !$phpbb_filesystem->is_writable($this->cache_dir))
{
// E_USER_ERROR - not using language entry - intended.
trigger_error('Unable to remove files within ' . $this->cache_dir . '. Please check directory permissions.', E_USER_ERROR);
diff --git a/phpBB/phpbb/cache/driver/null.php b/phpBB/phpbb/cache/driver/dummy.php
index a45cf97862..1f74f6dd77 100644
--- a/phpBB/phpbb/cache/driver/null.php
+++ b/phpBB/phpbb/cache/driver/dummy.php
@@ -14,9 +14,9 @@
namespace phpbb\cache\driver;
/**
-* ACM Null Caching
+* ACM dummy Caching
*/
-class null extends \phpbb\cache\driver\base
+class dummy extends \phpbb\cache\driver\base
{
/**
* Set cache path
@@ -52,8 +52,10 @@ class null extends \phpbb\cache\driver\base
*/
function tidy()
{
+ global $config;
+
// This cache always has a tidy room.
- set_config('cache_last_gc', time(), true);
+ $config->set('cache_last_gc', time(), false);
}
/**
diff --git a/phpBB/phpbb/cache/driver/eaccelerator.php b/phpBB/phpbb/cache/driver/eaccelerator.php
index 1697758acc..740855144f 100644
--- a/phpBB/phpbb/cache/driver/eaccelerator.php
+++ b/phpBB/phpbb/cache/driver/eaccelerator.php
@@ -44,9 +44,11 @@ class eaccelerator extends \phpbb\cache\driver\memory
*/
function tidy()
{
+ global $config;
+
eaccelerator_gc();
- set_config('cache_last_gc', time(), true);
+ $config->set('cache_last_gc', time(), false);
}
/**
diff --git a/phpBB/phpbb/cache/driver/file.php b/phpBB/phpbb/cache/driver/file.php
index 9a7c4aec7f..bb055d3acf 100644
--- a/phpBB/phpbb/cache/driver/file.php
+++ b/phpBB/phpbb/cache/driver/file.php
@@ -21,14 +21,26 @@ class file extends \phpbb\cache\driver\base
var $var_expires = array();
/**
+ * @var \phpbb\filesystem\filesystem_interface
+ */
+ protected $filesystem;
+
+ /**
* Set cache path
*
* @param string $cache_dir Define the path to the cache directory (default: $phpbb_root_path . 'cache/')
*/
function __construct($cache_dir = null)
{
- global $phpbb_root_path;
- $this->cache_dir = !is_null($cache_dir) ? $cache_dir : $phpbb_root_path . 'cache/';
+ global $phpbb_root_path, $phpbb_container;
+
+ $this->cache_dir = !is_null($cache_dir) ? $cache_dir : $phpbb_root_path . 'cache/' . $phpbb_container->getParameter('core.environment') . '/';
+ $this->filesystem = new \phpbb\filesystem\filesystem();
+
+ if (!is_dir($this->cache_dir))
+ {
+ @mkdir($this->cache_dir, 0777, true);
+ }
}
/**
@@ -63,14 +75,8 @@ class file extends \phpbb\cache\driver\base
if (!$this->_write('data_global'))
{
- if (!function_exists('phpbb_is_writable'))
- {
- global $phpbb_root_path;
- include($phpbb_root_path . 'includes/functions.' . $phpEx);
- }
-
// Now, this occurred how often? ... phew, just tell the user then...
- if (!phpbb_is_writable($this->cache_dir))
+ if (!$this->filesystem->is_writable($this->cache_dir))
{
// We need to use die() here, because else we may encounter an infinite loop (the message handler calls $cache->unload())
die('Fatal: ' . $this->cache_dir . ' is NOT writable.');
@@ -89,7 +95,7 @@ class file extends \phpbb\cache\driver\base
*/
function tidy()
{
- global $phpEx;
+ global $config, $phpEx;
$dir = @opendir($this->cache_dir);
@@ -143,7 +149,7 @@ class file extends \phpbb\cache\driver\base
}
}
- set_config('cache_last_gc', time(), true);
+ $config->set('cache_last_gc', time(), false);
}
/**
@@ -306,7 +312,7 @@ class file extends \phpbb\cache\driver\base
// Remove extra spaces and tabs
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
- $query_id = sizeof($this->sql_rowset);
+ $query_id = md5($query);
$this->sql_rowset[$query_id] = array();
$this->sql_row_pointer[$query_id] = 0;
@@ -316,7 +322,7 @@ class file extends \phpbb\cache\driver\base
}
$db->sql_freeresult($query_result);
- if ($this->_write('sql_' . md5($query), $this->sql_rowset[$query_id], $ttl + time(), $query))
+ if ($this->_write('sql_' . $query_id, $this->sql_rowset[$query_id], $ttl + time(), $query))
{
return $query_id;
}
@@ -568,13 +574,14 @@ class file extends \phpbb\cache\driver\base
fclose($handle);
- if (!function_exists('phpbb_chmod'))
+ try
{
- global $phpbb_root_path;
- include($phpbb_root_path . 'includes/functions.' . $phpEx);
+ $this->filesystem->phpbb_chmod($file, CHMOD_READ | CHMOD_WRITE);
+ }
+ catch (\phpbb\filesystem\exception\filesystem_exception $e)
+ {
+ // Do nothing
}
-
- phpbb_chmod($file, CHMOD_READ | CHMOD_WRITE);
$return_value = true;
}
diff --git a/phpBB/phpbb/cache/driver/memory.php b/phpBB/phpbb/cache/driver/memory.php
index 0b0e323e3d..baae22d809 100644
--- a/phpBB/phpbb/cache/driver/memory.php
+++ b/phpBB/phpbb/cache/driver/memory.php
@@ -81,9 +81,10 @@ abstract class memory extends \phpbb\cache\driver\base
*/
function tidy()
{
- // cache has auto GC, no need to have any code here :)
+ global $config;
- set_config('cache_last_gc', time(), true);
+ // cache has auto GC, no need to have any code here :)
+ $config->set('cache_last_gc', time(), false);
}
/**
@@ -203,7 +204,7 @@ abstract class memory extends \phpbb\cache\driver\base
{
// Remove extra spaces and tabs
$query = preg_replace('/[\n\r\s\t]+/', ' ', $query);
- $hash = md5($query);
+ $query_id = md5($query);
// determine which tables this query belongs to
// Some queries use backticks, namely the get_database_size() query
@@ -244,14 +245,13 @@ abstract class memory extends \phpbb\cache\driver\base
$temp = array();
}
- $temp[$hash] = true;
+ $temp[$query_id] = true;
// This must never expire
$this->_write('sql_' . $table_name, $temp, 0);
}
// store them in the right place
- $query_id = sizeof($this->sql_rowset);
$this->sql_rowset[$query_id] = array();
$this->sql_row_pointer[$query_id] = 0;
@@ -261,7 +261,7 @@ abstract class memory extends \phpbb\cache\driver\base
}
$db->sql_freeresult($query_result);
- $this->_write('sql_' . $hash, $this->sql_rowset[$query_id], $ttl);
+ $this->_write('sql_' . $query_id, $this->sql_rowset[$query_id], $ttl);
return $query_id;
}
diff --git a/phpBB/phpbb/captcha/plugins/captcha_abstract.php b/phpBB/phpbb/captcha/plugins/captcha_abstract.php
index 24ed7f939d..b29f144f97 100644
--- a/phpBB/phpbb/captcha/plugins/captcha_abstract.php
+++ b/phpBB/phpbb/captcha/plugins/captcha_abstract.php
@@ -34,12 +34,12 @@ abstract class captcha_abstract
function init($type)
{
- global $config, $db, $user;
+ global $config, $db, $user, $request;
// read input
- $this->confirm_id = request_var('confirm_id', '');
- $this->confirm_code = request_var('confirm_code', '');
- $refresh = request_var('refresh_vc', false) && $config['confirm_refresh'];
+ $this->confirm_id = $request->variable('confirm_id', '');
+ $this->confirm_code = $request->variable('confirm_code', '');
+ $refresh = $request->variable('refresh_vc', false) && $config['confirm_refresh'];
$this->type = (int) $type;
@@ -117,7 +117,7 @@ abstract class captcha_abstract
function get_demo_template($id)
{
- global $config, $user, $template, $phpbb_admin_path, $phpEx;
+ global $config, $user, $template, $request, $phpbb_admin_path, $phpEx;
$variables = '';
@@ -125,7 +125,7 @@ abstract class captcha_abstract
{
foreach ($this->captcha_vars as $captcha_var => $template_var)
{
- $variables .= '&amp;' . rawurlencode($captcha_var) . '=' . request_var($captcha_var, (int) $config[$captcha_var]);
+ $variables .= '&amp;' . rawurlencode($captcha_var) . '=' . $request->variable($captcha_var, (int) $config[$captcha_var]);
}
}
@@ -195,7 +195,7 @@ abstract class captcha_abstract
{
global $config, $db, $user;
- if (empty($user->lang))
+ if (!$user->is_setup())
{
$user->setup();
}
@@ -350,7 +350,9 @@ abstract class captcha_abstract
function is_solved()
{
- if (request_var('confirm_code', false) && $this->solved === 0)
+ global $request;
+
+ if ($request->variable('confirm_code', false) && $this->solved === 0)
{
$this->validate();
}
diff --git a/phpBB/phpbb/captcha/plugins/gd.php b/phpBB/phpbb/captcha/plugins/gd.php
index f6200b5b2f..1727dcc1bb 100644
--- a/phpBB/phpbb/captcha/plugins/gd.php
+++ b/phpBB/phpbb/captcha/plugins/gd.php
@@ -53,7 +53,7 @@ class gd extends captcha_abstract
function acp_page($id, &$module)
{
- global $db, $user, $auth, $template;
+ global $db, $user, $auth, $template, $phpbb_log, $request;
global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx;
$user->add_lang('acp/board');
@@ -70,21 +70,21 @@ class gd extends captcha_abstract
$form_key = 'acp_captcha';
add_form_key($form_key);
- $submit = request_var('submit', '');
+ $submit = $request->variable('submit', '');
if ($submit && check_form_key($form_key))
{
$captcha_vars = array_keys($this->captcha_vars);
foreach ($captcha_vars as $captcha_var)
{
- $value = request_var($captcha_var, 0);
+ $value = $request->variable($captcha_var, 0);
if ($value >= 0)
{
- set_config($captcha_var, $value);
+ $config->set($captcha_var, $value);
}
}
- add_log('admin', 'LOG_CONFIG_VISUAL');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_CONFIG_VISUAL');
trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($module->u_action));
}
else if ($submit)
@@ -95,7 +95,7 @@ class gd extends captcha_abstract
{
foreach ($this->captcha_vars as $captcha_var => $template_var)
{
- $var = (isset($_REQUEST[$captcha_var])) ? request_var($captcha_var, 0) : $config[$captcha_var];
+ $var = (isset($_REQUEST[$captcha_var])) ? $request->variable($captcha_var, 0) : $config[$captcha_var];
$template->assign_var($template_var, $var);
}
@@ -109,7 +109,7 @@ class gd extends captcha_abstract
function execute_demo()
{
- global $config;
+ global $config, $request;
$config_old = $config;
@@ -121,7 +121,7 @@ class gd extends captcha_abstract
foreach ($this->captcha_vars as $captcha_var => $template_var)
{
- $config->set($captcha_var, request_var($captcha_var, (int) $config[$captcha_var]));
+ $config->set($captcha_var, $request->variable($captcha_var, (int) $config[$captcha_var]));
}
parent::execute_demo();
$config = $config_old;
diff --git a/phpBB/phpbb/captcha/plugins/qa.php b/phpBB/phpbb/captcha/plugins/qa.php
index 2771369e57..4df8a86432 100644
--- a/phpBB/phpbb/captcha/plugins/qa.php
+++ b/phpBB/phpbb/captcha/plugins/qa.php
@@ -58,14 +58,14 @@ class qa
*/
function init($type)
{
- global $config, $db, $user;
+ global $config, $db, $user, $request;
// load our language file
$user->add_lang('captcha_qa');
// read input
- $this->confirm_id = request_var('qa_confirm_id', '');
- $this->answer = utf8_normalize_nfc(request_var('qa_answer', '', true));
+ $this->confirm_id = $request->variable('qa_confirm_id', '');
+ $this->answer = $request->variable('qa_answer', '', true);
$this->type = (int) $type;
$this->question_lang = $user->lang_name;
@@ -113,9 +113,9 @@ class qa
*/
public function is_installed()
{
- global $db;
+ global $phpbb_container;
- $db_tool = new \phpbb\db\tools($db);
+ $db_tool = $phpbb_container->get('dbal.tools');
return $db_tool->sql_table_exists($this->table_captcha_questions);
}
@@ -306,10 +306,9 @@ class qa
*/
function install()
{
- global $db;
-
- $db_tool = new \phpbb\db\tools($db);
+ global $phpbb_container;
+ $db_tool = $phpbb_container->get('dbal.tools');
$schemas = array(
$this->table_captcha_questions => array (
'COLUMNS' => array(
@@ -542,9 +541,9 @@ class qa
*/
function check_answer()
{
- global $db;
+ global $db, $request;
- $answer = ($this->question_strict) ? utf8_normalize_nfc(request_var('qa_answer', '', true)) : utf8_clean_string(utf8_normalize_nfc(request_var('qa_answer', '', true)));
+ $answer = ($this->question_strict) ? $request->variable('qa_answer', '', true) : utf8_clean_string($request->variable('qa_answer', '', true));
$sql = 'SELECT answer_text
FROM ' . $this->table_captcha_answers . '
@@ -596,7 +595,9 @@ class qa
*/
function is_solved()
{
- if (request_var('qa_answer', false) && $this->solved === 0)
+ global $request;
+
+ if ($request->variable('qa_answer', false) && $this->solved === 0)
{
$this->validate();
}
@@ -609,8 +610,7 @@ class qa
*/
function acp_page($id, &$module)
{
- global $user, $template;
- global $config;
+ global $config, $request, $phpbb_log, $template, $user;
$user->add_lang('acp/board');
$user->add_lang('captcha_qa');
@@ -625,9 +625,9 @@ class qa
$form_key = 'acp_captcha';
add_form_key($form_key);
- $submit = request_var('submit', false);
- $question_id = request_var('question_id', 0);
- $action = request_var('action', '');
+ $submit = $request->variable('submit', false);
+ $question_id = $request->variable('question_id', 0);
+ $action = $request->variable('action', '');
// we have two pages, so users might want to navigate from one to the other
$list_url = $module->u_action . "&amp;configure=1&amp;select_captcha=" . $this->get_service_name();
@@ -732,7 +732,7 @@ class qa
$this->acp_add_question($question_input);
}
- add_log('admin', 'LOG_CONFIG_VISUAL');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_CONFIG_VISUAL');
trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($list_url));
}
}
@@ -818,7 +818,9 @@ class qa
*/
function acp_get_question_input()
{
- $answers = utf8_normalize_nfc(request_var('answers', '', true));
+ global $request;
+
+ $answers = $request->variable('answers', '', true);
// Convert answers into array and filter if answers are set
if (strlen($answers))
@@ -829,9 +831,9 @@ class qa
}
$question = array(
- 'question_text' => request_var('question_text', '', true),
- 'strict' => request_var('strict', false),
- 'lang_iso' => request_var('lang_iso', ''),
+ 'question_text' => $request->variable('question_text', '', true),
+ 'strict' => $request->variable('strict', false),
+ 'lang_iso' => $request->variable('lang_iso', ''),
'answers' => $answers,
);
return $question;
diff --git a/phpBB/phpbb/captcha/plugins/recaptcha.php b/phpBB/phpbb/captcha/plugins/recaptcha.php
index 584f3afec1..98132ab47d 100644
--- a/phpBB/phpbb/captcha/plugins/recaptcha.php
+++ b/phpBB/phpbb/captcha/plugins/recaptcha.php
@@ -37,12 +37,12 @@ class recaptcha extends captcha_abstract
function init($type)
{
- global $config, $db, $user;
+ global $config, $db, $user, $request;
$user->add_lang('captcha_recaptcha');
parent::init($type);
- $this->challenge = request_var('recaptcha_challenge_field', '');
- $this->response = request_var('recaptcha_response_field', '');
+ $this->challenge = $request->variable('recaptcha_challenge_field', '');
+ $this->response = $request->variable('recaptcha_response_field', '');
}
public function is_available()
@@ -75,7 +75,7 @@ class recaptcha extends captcha_abstract
function acp_page($id, &$module)
{
- global $config, $db, $template, $user;
+ global $config, $db, $template, $user, $phpbb_log, $request;
$captcha_vars = array(
'recaptcha_pubkey' => 'RECAPTCHA_PUBKEY',
@@ -87,21 +87,21 @@ class recaptcha extends captcha_abstract
$form_key = 'acp_captcha';
add_form_key($form_key);
- $submit = request_var('submit', '');
+ $submit = $request->variable('submit', '');
if ($submit && check_form_key($form_key))
{
$captcha_vars = array_keys($captcha_vars);
foreach ($captcha_vars as $captcha_var)
{
- $value = request_var($captcha_var, '');
+ $value = $request->variable($captcha_var, '');
if ($value)
{
- set_config($captcha_var, $value);
+ $config->set($captcha_var, $value);
}
}
- add_log('admin', 'LOG_CONFIG_VISUAL');
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_CONFIG_VISUAL');
trigger_error($user->lang['CONFIG_UPDATED'] . adm_back_link($module->u_action));
}
else if ($submit)
@@ -112,7 +112,7 @@ class recaptcha extends captcha_abstract
{
foreach ($captcha_vars as $captcha_var => $template_var)
{
- $var = (isset($_REQUEST[$captcha_var])) ? request_var($captcha_var, '') : ((isset($config[$captcha_var])) ? $config[$captcha_var] : '');
+ $var = (isset($_REQUEST[$captcha_var])) ? $request->variable($captcha_var, '') : ((isset($config[$captcha_var])) ? $config[$captcha_var] : '');
$template->assign_var($template_var, $var);
}
diff --git a/phpBB/phpbb/composer.json b/phpBB/phpbb/composer.json
index 513d7e4559..175be4b0ab 100644
--- a/phpBB/phpbb/composer.json
+++ b/phpBB/phpbb/composer.json
@@ -22,6 +22,6 @@
"classmap": [""]
},
"require": {
- "php": ">=5.3.3"
+ "php": ">=5.3.9"
}
}
diff --git a/phpBB/phpbb/console/application.php b/phpBB/phpbb/console/application.php
index bc4897af18..dc9b8016b2 100644
--- a/phpBB/phpbb/console/application.php
+++ b/phpBB/phpbb/console/application.php
@@ -13,6 +13,7 @@
namespace phpbb\console;
+use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Shell;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
@@ -26,18 +27,18 @@ class application extends \Symfony\Component\Console\Application
protected $in_shell = false;
/**
- * @var \phpbb\user User object
+ * @var \phpbb\language\language User object
*/
- protected $user;
+ protected $language;
/**
- * @param string $name The name of the application
- * @param string $version The version of the application
- * @param \phpbb\user $user The user which runs the application (used for translation)
+ * @param string $name The name of the application
+ * @param string $version The version of the application
+ * @param \phpbb\language\language $language The user which runs the application (used for translation)
*/
- public function __construct($name, $version, \phpbb\user $user)
+ public function __construct($name, $version, \phpbb\language\language $language)
{
- $this->user = $user;
+ $this->language = $language;
parent::__construct($name, $version);
}
@@ -49,12 +50,7 @@ class application extends \Symfony\Component\Console\Application
{
$input_definition = parent::getDefaultInputDefinition();
- $input_definition->addOption(new InputOption(
- 'safe-mode',
- null,
- InputOption::VALUE_NONE,
- $this->user->lang('CLI_DESCRIPTION_OPTION_SAFE_MODE')
- ));
+ $this->register_global_options($input_definition);
return $input_definition;
}
@@ -76,12 +72,20 @@ class application extends \Symfony\Component\Console\Application
return parent::getHelp();
}
- $this->getDefinition()->addOption(new InputOption(
- '--shell',
- '-s',
- InputOption::VALUE_NONE,
- $this->user->lang('CLI_DESCRIPTION_OPTION_SHELL')
- ));
+ try
+ {
+ $definition = $this->getDefinition();
+ $definition->addOption(new InputOption(
+ '--shell',
+ '-s',
+ InputOption::VALUE_NONE,
+ $this->language->lang('CLI_DESCRIPTION_OPTION_SHELL')
+ ));
+ }
+ catch (\LogicException $e)
+ {
+ // Do nothing
+ }
return parent::getHelp();
}
@@ -117,4 +121,33 @@ class application extends \Symfony\Component\Console\Application
return parent::doRun($input, $output);
}
+
+ /**
+ * Register global options
+ *
+ * @param InputDefinition $definition An InputDefinition instance
+ */
+ protected function register_global_options(InputDefinition $definition)
+ {
+ try
+ {
+ $definition->addOption(new InputOption(
+ 'safe-mode',
+ null,
+ InputOption::VALUE_NONE,
+ $this->language->lang('CLI_DESCRIPTION_OPTION_SAFE_MODE')
+ ));
+
+ $definition->addOption(new InputOption(
+ 'env',
+ 'e',
+ InputOption::VALUE_REQUIRED,
+ $this->language->lang('CLI_DESCRIPTION_OPTION_ENV')
+ ));
+ }
+ catch (\LogicException $e)
+ {
+ // Do nothing
+ }
+ }
}
diff --git a/phpBB/phpbb/console/command/db/migrate.php b/phpBB/phpbb/console/command/db/migrate.php
index 87c2a057d1..2490bf1310 100644
--- a/phpBB/phpbb/console/command/db/migrate.php
+++ b/phpBB/phpbb/console/command/db/migrate.php
@@ -35,13 +35,17 @@ class migrate extends \phpbb\console\command\command
/** @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)
+ /** @var \phpbb\filesystem\filesystem_interface */
+ protected $filesystem;
+
+ 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\filesystem\filesystem_interface $filesystem, $phpbb_root_path)
{
$this->migrator = $migrator;
$this->extension_manager = $extension_manager;
$this->config = $config;
$this->cache = $cache;
$this->log = $log;
+ $this->filesystem = $filesystem;
$this->phpbb_root_path = $phpbb_root_path;
parent::__construct($user);
$this->user->add_lang(array('common', 'install', 'migrator'));
@@ -57,7 +61,7 @@ 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->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->filesystem));
$this->migrator->create_migrations_table();
diff --git a/phpBB/phpbb/console/command/reparser/list_all.php b/phpBB/phpbb/console/command/reparser/list_all.php
new file mode 100644
index 0000000000..e42c3ac782
--- /dev/null
+++ b/phpBB/phpbb/console/command/reparser/list_all.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\reparser;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class list_all extends \phpbb\console\command\command
+{
+ /**
+ * @var string[] Names of the reparser services
+ */
+ protected $reparser_names;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\user $user
+ * @param \phpbb\di\service_collection $reparsers
+ */
+ public function __construct(\phpbb\user $user, \phpbb\di\service_collection $reparsers)
+ {
+ parent::__construct($user);
+ $this->reparser_names = array();
+ foreach ($reparsers as $name => $reparser)
+ {
+ // Store the names without the "text_reparser." prefix
+ $this->reparser_names[] = preg_replace('(^text_reparser\\.)', '', $name);
+ }
+ }
+
+ /**
+ * Sets the command name and description
+ *
+ * @return null
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('reparser:list')
+ ->setDescription($this->user->lang('CLI_DESCRIPTION_REPARSER_LIST'))
+ ;
+ }
+
+ /**
+ * Executes the command reparser:reparse
+ *
+ * @param InputInterface $input
+ * @param OutputInterface $output
+ * @return integer
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $output->writeln('<info>' . implode(', ', $this->reparser_names) . '</info>');
+
+ return 0;
+ }
+}
diff --git a/phpBB/phpbb/console/command/reparser/reparse.php b/phpBB/phpbb/console/command/reparser/reparse.php
new file mode 100644
index 0000000000..63124b4b8c
--- /dev/null
+++ b/phpBB/phpbb/console/command/reparser/reparse.php
@@ -0,0 +1,305 @@
+<?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\reparser;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputOption;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Style\SymfonyStyle;
+
+class reparse extends \phpbb\console\command\command
+{
+ /**
+ * @var \phpbb\config\db_text
+ */
+ protected $config_text;
+
+ /**
+ * @var InputInterface
+ */
+ protected $input;
+
+ /**
+ * @var SymfonyStyle
+ */
+ protected $io;
+
+ /**
+ * @var OutputInterface
+ */
+ protected $output;
+
+ /**
+ * @var \phpbb\di\service_collection
+ */
+ protected $reparsers;
+
+ /**
+ * @var array Reparser names as keys, and their last $current ID as values
+ */
+ protected $resume_data;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\user $user
+ * @param \phpbb\di\service_collection $reparsers
+ * @param \phpbb\config\db_text $config_text
+ */
+ public function __construct(\phpbb\user $user, \phpbb\di\service_collection $reparsers, \phpbb\config\db_text $config_text)
+ {
+ require_once __DIR__ . '/../../../../includes/functions_content.php';
+
+ $this->config_text = $config_text;
+ $this->reparsers = $reparsers;
+ parent::__construct($user);
+ }
+
+ /**
+ * Sets the command name and description
+ *
+ * @return null
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('reparser:reparse')
+ ->setDescription($this->user->lang('CLI_DESCRIPTION_REPARSER_REPARSE'))
+ ->addArgument('reparser-name', InputArgument::OPTIONAL, $this->user->lang('CLI_DESCRIPTION_REPARSER_REPARSE_ARG_1'))
+ ->addOption(
+ 'dry-run',
+ null,
+ InputOption::VALUE_NONE,
+ $this->user->lang('CLI_DESCRIPTION_REPARSER_REPARSE_OPT_DRY_RUN')
+ )
+ ->addOption(
+ 'resume',
+ null,
+ InputOption::VALUE_NONE,
+ $this->user->lang('CLI_DESCRIPTION_REPARSER_REPARSE_OPT_RESUME')
+ )
+ ->addOption(
+ 'range-min',
+ null,
+ InputOption::VALUE_REQUIRED,
+ $this->user->lang('CLI_DESCRIPTION_REPARSER_REPARSE_OPT_RANGE_MIN'),
+ 1
+ )
+ ->addOption(
+ 'range-max',
+ null,
+ InputOption::VALUE_REQUIRED,
+ $this->user->lang('CLI_DESCRIPTION_REPARSER_REPARSE_OPT_RANGE_MAX')
+ )
+ ->addOption(
+ 'range-size',
+ null,
+ InputOption::VALUE_REQUIRED,
+ $this->user->lang('CLI_DESCRIPTION_REPARSER_REPARSE_OPT_RANGE_SIZE'),
+ 100
+ );
+ ;
+ }
+
+ /**
+ * Create a styled progress bar
+ *
+ * @param integer $max Max value for the progress bar
+ * @return \Symfony\Component\Console\Helper\ProgressBar
+ */
+ protected function create_progress_bar($max)
+ {
+ $progress = $this->io->createProgressBar($max);
+ if ($this->output->getVerbosity() === OutputInterface::VERBOSITY_VERBOSE)
+ {
+ $progress->setFormat('<info>[%percent:3s%%]</info> %message%');
+ $progress->setOverwrite(false);
+ }
+ else if ($this->output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE)
+ {
+ $progress->setFormat('<info>[%current:s%/%max:s%]</info><comment>[%elapsed%/%estimated%][%memory%]</comment> %message%');
+ $progress->setOverwrite(false);
+ }
+ else
+ {
+ $this->io->newLine(2);
+ $progress->setFormat(
+ " %current:s%/%max:s% %bar% %percent:3s%%\n" .
+ " %message% %elapsed:6s%/%estimated:-6s% %memory:6s%\n");
+ $progress->setBarWidth(60);
+ }
+
+ if (!defined('PHP_WINDOWS_VERSION_BUILD'))
+ {
+ $progress->setEmptyBarCharacter('â–‘'); // light shade character \u2591
+ $progress->setProgressCharacter('');
+ $progress->setBarCharacter('â–“'); // dark shade character \u2593
+ }
+
+ return $progress;
+ }
+
+ /**
+ * Executes the command reparser:reparse
+ *
+ * @param InputInterface $input
+ * @param OutputInterface $output
+ * @return integer
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $this->input = $input;
+ $this->output = $output;
+ $this->io = new SymfonyStyle($input, $output);
+ $this->load_resume_data();
+
+ $name = $input->getArgument('reparser-name');
+ if (isset($name))
+ {
+ // Allow "post_text" to be an alias for "text_reparser.post_text"
+ if (!isset($this->reparsers[$name]))
+ {
+ $name = 'text_reparser.' . $name;
+ }
+ $this->reparse($name);
+ }
+ else
+ {
+ foreach ($this->reparsers as $name => $service)
+ {
+ $this->reparse($name);
+ }
+ }
+
+ $this->io->success($this->user->lang('CLI_REPARSER_REPARSE_SUCCESS'));
+
+ return 0;
+ }
+
+ /**
+ * Get an option value, adjusted for given reparser
+ *
+ * Will use the last saved value if --resume is set and the option was not specified
+ * on the command line
+ *
+ * @param string $reparser_name Reparser name
+ * @param string $option_name Option name
+ * @return integer
+ */
+ protected function get_option($reparser_name, $option_name)
+ {
+ // Return the option from the resume_data if applicable
+ if ($this->input->getOption('resume') && isset($this->resume_data[$reparser_name][$option_name]) && !$this->input->hasParameterOption('--' . $option_name))
+ {
+ return $this->resume_data[$reparser_name][$option_name];
+ }
+
+ $value = $this->input->getOption($option_name);
+
+ // range-max has no default value, it must be computed for each reparser
+ if ($option_name === 'range-max' && $value === null)
+ {
+ $value = $this->reparsers[$reparser_name]->get_max_id();
+ }
+
+ return $value;
+ }
+
+ /**
+ * Load the resume data from the database
+ */
+ protected function load_resume_data()
+ {
+ $resume_data = $this->config_text->get('reparser_resume');
+ $this->resume_data = (empty($resume_data)) ? array() : unserialize($resume_data);
+ }
+
+ /**
+ * Reparse all text handled by given reparser within given range
+ *
+ * @param string $name Reparser name
+ */
+ protected function reparse($name)
+ {
+ $reparser = $this->reparsers[$name];
+ if ($this->input->getOption('dry-run'))
+ {
+ $reparser->disable_save();
+ }
+ else
+ {
+ $reparser->enable_save();
+ }
+
+ // Start at range-max if specified or at the highest ID otherwise
+ $max = $this->get_option($name, 'range-max');
+ $min = $this->get_option($name, 'range-min');
+ $size = $this->get_option($name, 'range-size');
+
+ if ($max < $min)
+ {
+ return;
+ }
+
+ $this->io->section($this->user->lang('CLI_REPARSER_REPARSE_REPARSING', preg_replace('(^text_reparser\\.)', '', $name), $min, $max));
+
+ $progress = $this->create_progress_bar($max);
+ $progress->setMessage($this->user->lang('CLI_REPARSER_REPARSE_REPARSING_START', preg_replace('(^text_reparser\\.)', '', $name)));
+ $progress->start();
+
+ // Start from $max and decrement $current by $size until we reach $min
+ $current = $max;
+ while ($current >= $min)
+ {
+ $start = max($min, $current + 1 - $size);
+ $end = max($min, $current);
+
+ $progress->setMessage($this->user->lang('CLI_REPARSER_REPARSE_REPARSING', preg_replace('(^text_reparser\\.)', '', $name), $start, $end));
+ $reparser->reparse_range($start, $end);
+
+ $current = $start - 1;
+ $progress->setProgress($max + 1 - $start);
+
+ $this->update_resume_data($name, $current);
+ }
+ $progress->finish();
+
+ $this->io->newLine(2);
+ }
+
+ /**
+ * Save the resume data to the database
+ */
+ protected function save_resume_data()
+ {
+ $this->config_text->set('reparser_resume', serialize($this->resume_data));
+ }
+
+ /**
+ * Save the resume data to the database
+ *
+ * @param string $name Reparser name
+ * @param string $current Current ID
+ */
+ protected function update_resume_data($name, $current)
+ {
+ $this->resume_data[$name] = array(
+ 'range-min' => $this->get_option($name, 'range-min'),
+ 'range-max' => $current,
+ 'range-size' => $this->get_option($name, 'range-size'),
+ );
+ $this->save_resume_data();
+ }
+}
diff --git a/phpBB/phpbb/console/command/thumbnail/delete.php b/phpBB/phpbb/console/command/thumbnail/delete.php
new file mode 100644
index 0000000000..e8e4cf568e
--- /dev/null
+++ b/phpBB/phpbb/console/command/thumbnail/delete.php
@@ -0,0 +1,178 @@
+<?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\thumbnail;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Style\SymfonyStyle;
+
+class delete extends \phpbb\console\command\command
+{
+ /**
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * phpBB root path
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\user $user The user object (used to get language information)
+ * @param \phpbb\db\driver\driver_interface $db Database connection
+ * @param string $phpbb_root_path Root path
+ */
+ public function __construct(\phpbb\user $user, \phpbb\db\driver\driver_interface $db, $phpbb_root_path)
+ {
+ $this->db = $db;
+ $this->phpbb_root_path = $phpbb_root_path;
+
+ parent::__construct($user);
+ }
+
+ /**
+ * Sets the command name and description
+ *
+ * @return null
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('thumbnail:delete')
+ ->setDescription($this->user->lang('CLI_DESCRIPTION_THUMBNAIL_DELETE'))
+ ;
+ }
+
+ /**
+ * Executes the command thumbnail:delete.
+ *
+ * Deletes all existing thumbnails and updates the database accordingly.
+ *
+ * @param InputInterface $input The input stream used to get the argument and verbose option.
+ * @param OutputInterface $output The output stream, used for printing verbose-mode and error information.
+ *
+ * @return int 0 if all is ok, 1 if a thumbnail couldn't be deleted.
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $io = new SymfonyStyle($input, $output);
+
+ $io->section($this->user->lang('CLI_THUMBNAIL_DELETING'));
+
+ $sql = 'SELECT COUNT(*) AS nb_missing_thumbnails
+ FROM ' . ATTACHMENTS_TABLE . '
+ WHERE thumbnail = 1';
+ $result = $this->db->sql_query($sql);
+ $nb_missing_thumbnails = (int) $this->db->sql_fetchfield('nb_missing_thumbnails');
+ $this->db->sql_freeresult($result);
+
+ if ($nb_missing_thumbnails === 0)
+ {
+ $io->warning($this->user->lang('CLI_THUMBNAIL_NOTHING_TO_DELETE'));
+ return 0;
+ }
+
+ $sql = 'SELECT attach_id, physical_filename, extension, real_filename, mimetype
+ FROM ' . ATTACHMENTS_TABLE . '
+ WHERE thumbnail = 1';
+ $result = $this->db->sql_query($sql);
+
+ $progress = $io->createProgressBar($nb_missing_thumbnails);
+ if ($output->getVerbosity() === OutputInterface::VERBOSITY_VERBOSE)
+ {
+ $progress->setFormat('<info>[%percent:3s%%]</info> %message%');
+ $progress->setOverwrite(false);
+ }
+ else if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE)
+ {
+ $progress->setFormat('<info>[%current:s%/%max:s%]</info><comment>[%elapsed%/%estimated%][%memory%]</comment> %message%');
+ $progress->setOverwrite(false);
+ }
+ else
+ {
+ $io->newLine(2);
+ $progress->setFormat(
+ " %current:s%/%max:s% %bar% %percent:3s%%\n" .
+ " %elapsed:6s%/%estimated:-6s% %memory:6s%\n");
+ $progress->setBarWidth(60);
+ }
+
+ if (!defined('PHP_WINDOWS_VERSION_BUILD'))
+ {
+ $progress->setEmptyBarCharacter('â–‘'); // light shade character \u2591
+ $progress->setProgressCharacter('');
+ $progress->setBarCharacter('â–“'); // dark shade character \u2593
+ }
+
+ $progress->setMessage($this->user->lang('CLI_THUMBNAIL_DELETING'));
+
+ $progress->start();
+
+ $thumbnail_deleted = array();
+ $return = 0;
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $thumbnail_path = $this->phpbb_root_path . 'files/thumb_' . $row['physical_filename'];
+
+ if (@unlink($thumbnail_path))
+ {
+ $thumbnail_deleted[] = $row['attach_id'];
+
+ if (sizeof($thumbnail_deleted) === 250)
+ {
+ $this->commit_changes($thumbnail_deleted);
+ $thumbnail_deleted = array();
+ }
+
+ $progress->setMessage($this->user->lang('CLI_THUMBNAIL_DELETED', $row['real_filename'], $row['physical_filename']));
+ }
+ else
+ {
+ $return = 1;
+ $progress->setMessage('<error>' . $this->user->lang('CLI_THUMBNAIL_SKIPPED', $row['real_filename'], $row['physical_filename']) . '</error>');
+ }
+
+ $progress->advance();
+ }
+ $this->db->sql_freeresult($result);
+
+ if (!empty($thumbnail_deleted))
+ {
+ $this->commit_changes($thumbnail_deleted);
+ }
+
+ $progress->finish();
+
+ $io->newLine(2);
+ $io->success($this->user->lang('CLI_THUMBNAIL_DELETING_DONE'));
+
+ return $return;
+ }
+
+ /**
+ * Commits the changes to the database
+ *
+ * @param array $thumbnail_deleted
+ */
+ protected function commit_changes(array $thumbnail_deleted)
+ {
+ $sql = 'UPDATE ' . ATTACHMENTS_TABLE . '
+ SET thumbnail = 0
+ WHERE ' . $this->db->sql_in_set('attach_id', $thumbnail_deleted);
+ $this->db->sql_query($sql);
+ }
+}
diff --git a/phpBB/phpbb/console/command/thumbnail/generate.php b/phpBB/phpbb/console/command/thumbnail/generate.php
new file mode 100644
index 0000000000..e677db3a97
--- /dev/null
+++ b/phpBB/phpbb/console/command/thumbnail/generate.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.
+*
+*/
+
+namespace phpbb\console\command\thumbnail;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Style\SymfonyStyle;
+
+class generate extends \phpbb\console\command\command
+{
+ /**
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * @var \phpbb\cache\service
+ */
+ protected $cache;
+
+ /**
+ * phpBB root path
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * PHP extension.
+ *
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\user $user The user object (used to get language information)
+ * @param \phpbb\db\driver\driver_interface $db Database connection
+ * @param \phpbb\cache\service $cache The cache service
+ * @param string $phpbb_root_path Root path
+ * @param string $php_ext PHP extension
+ */
+ public function __construct(\phpbb\user $user, \phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, $phpbb_root_path, $php_ext)
+ {
+ $this->db = $db;
+ $this->cache = $cache;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+
+ parent::__construct($user);
+ }
+
+ /**
+ * Sets the command name and description
+ *
+ * @return null
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('thumbnail:generate')
+ ->setDescription($this->user->lang('CLI_DESCRIPTION_THUMBNAIL_GENERATE'))
+ ;
+ }
+
+ /**
+ * Executes the command thumbnail:generate.
+ *
+ * Generate a thumbnail for all attachments which need one and don't have it yet.
+ *
+ * @param InputInterface $input The input stream used to get the argument and verboe option.
+ * @param OutputInterface $output The output stream, used for printing verbose-mode and error information.
+ *
+ * @return int 0.
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $io = new SymfonyStyle($input, $output);
+
+ $io->section($this->user->lang('CLI_THUMBNAIL_GENERATING'));
+
+ $sql = 'SELECT COUNT(*) AS nb_missing_thumbnails
+ FROM ' . ATTACHMENTS_TABLE . '
+ WHERE thumbnail = 0';
+ $result = $this->db->sql_query($sql);
+ $nb_missing_thumbnails = (int) $this->db->sql_fetchfield('nb_missing_thumbnails');
+ $this->db->sql_freeresult($result);
+
+ if ($nb_missing_thumbnails === 0)
+ {
+ $io->warning($this->user->lang('CLI_THUMBNAIL_NOTHING_TO_GENERATE'));
+ return 0;
+ }
+
+ $extensions = $this->cache->obtain_attach_extensions(true);
+
+ $sql = 'SELECT attach_id, physical_filename, extension, real_filename, mimetype
+ FROM ' . ATTACHMENTS_TABLE . '
+ WHERE thumbnail = 0';
+ $result = $this->db->sql_query($sql);
+
+ if (!function_exists('create_thumbnail'))
+ {
+ require($this->phpbb_root_path . 'includes/functions_posting.' . $this->php_ext);
+ }
+
+ $progress = $io->createProgressBar($nb_missing_thumbnails);
+ if ($output->getVerbosity() === OutputInterface::VERBOSITY_VERBOSE)
+ {
+ $progress->setFormat('<info>[%percent:3s%%]</info> %message%');
+ $progress->setOverwrite(false);
+ }
+ else if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERY_VERBOSE)
+ {
+ $progress->setFormat('<info>[%current:s%/%max:s%]</info><comment>[%elapsed%/%estimated%][%memory%]</comment> %message%');
+ $progress->setOverwrite(false);
+ }
+ else
+ {
+ $io->newLine(2);
+ $progress->setFormat(
+ " %current:s%/%max:s% %bar% %percent:3s%%\n" .
+ " %elapsed:6s%/%estimated:-6s% %memory:6s%\n");
+ $progress->setBarWidth(60);
+ }
+
+ if (!defined('PHP_WINDOWS_VERSION_BUILD'))
+ {
+ $progress->setEmptyBarCharacter('â–‘'); // light shade character \u2591
+ $progress->setProgressCharacter('');
+ $progress->setBarCharacter('â–“'); // dark shade character \u2593
+ }
+
+ $progress->setMessage($this->user->lang('CLI_THUMBNAIL_GENERATING'));
+
+ $progress->start();
+
+ $thumbnail_created = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (isset($extensions[$row['extension']]['display_cat']) && $extensions[$row['extension']]['display_cat'] == ATTACHMENT_CATEGORY_IMAGE)
+ {
+ $source = $this->phpbb_root_path . 'files/' . $row['physical_filename'];
+ $destination = $this->phpbb_root_path . 'files/thumb_' . $row['physical_filename'];
+
+ if (create_thumbnail($source, $destination, $row['mimetype']))
+ {
+ $thumbnail_created[] = (int) $row['attach_id'];
+
+ if (count($thumbnail_created) === 250)
+ {
+ $this->commit_changes($thumbnail_created);
+ $thumbnail_created = array();
+ }
+
+ $progress->setMessage($this->user->lang('CLI_THUMBNAIL_GENERATED', $row['real_filename'], $row['physical_filename']));
+ }
+ else
+ {
+ $progress->setMessage('<info>' . $this->user->lang('CLI_THUMBNAIL_SKIPPED', $row['real_filename'], $row['physical_filename']) . '</info>');
+ }
+ }
+
+ $progress->advance();
+ }
+ $this->db->sql_freeresult($result);
+
+ if (!empty($thumbnail_created))
+ {
+ $this->commit_changes($thumbnail_created);
+ }
+
+ $progress->finish();
+
+ $io->newLine(2);
+ $io->success($this->user->lang('CLI_THUMBNAIL_GENERATING_DONE'));
+
+ return 0;
+ }
+
+ /**
+ * Commits the changes to the database
+ *
+ * @param array $thumbnail_created
+ */
+ protected function commit_changes(array $thumbnail_created)
+ {
+ $sql = 'UPDATE ' . ATTACHMENTS_TABLE . '
+ SET thumbnail = 1
+ WHERE ' . $this->db->sql_in_set('attach_id', $thumbnail_created);
+ $this->db->sql_query($sql);
+ }
+}
diff --git a/phpBB/phpbb/console/command/thumbnail/recreate.php b/phpBB/phpbb/console/command/thumbnail/recreate.php
new file mode 100644
index 0000000000..382da290bf
--- /dev/null
+++ b/phpBB/phpbb/console/command/thumbnail/recreate.php
@@ -0,0 +1,72 @@
+<?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\thumbnail;
+
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\ArrayInput;
+use Symfony\Component\Console\Output\OutputInterface;
+
+class recreate extends \phpbb\console\command\command
+{
+ /**
+ * Sets the command name and description
+ *
+ * @return null
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('thumbnail:recreate')
+ ->setDescription($this->user->lang('CLI_DESCRIPTION_THUMBNAIL_RECREATE'))
+ ;
+ }
+
+ /**
+ * Executes the command thumbnail:recreate.
+ *
+ * This command is a "macro" to execute thumbnail:delete and then thumbnail:generate.
+ *
+ * @param InputInterface $input The input stream used to get the argument and verboe option.
+ * @param OutputInterface $output The output stream, used for printing verbose-mode and error information.
+ *
+ * @return int 0 if all is ok, 1 if a thumbnail couldn't be deleted.
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $parameters = array(
+ 'command' => 'thumbnail:delete'
+ );
+
+ if ($input->getOption('verbose'))
+ {
+ $parameters['-' . str_repeat('v', $output->getVerbosity() - 1)] = true;
+ }
+
+ $this->getApplication()->setAutoExit(false);
+
+ $input_delete = new ArrayInput($parameters);
+ $return = $this->getApplication()->run($input_delete, $output);
+
+ if ($return === 0)
+ {
+ $parameters['command'] = 'thumbnail:generate';
+
+ $input_create = new ArrayInput($parameters);
+ $return = $this->getApplication()->run($input_create, $output);
+ }
+
+ $this->getApplication()->setAutoExit(true);
+
+ return $return;
+ }
+}
diff --git a/phpBB/phpbb/controller/exception.php b/phpBB/phpbb/controller/exception.php
index 437558b06a..e227c7c37b 100644
--- a/phpBB/phpbb/controller/exception.php
+++ b/phpBB/phpbb/controller/exception.php
@@ -16,6 +16,6 @@ namespace phpbb\controller;
/**
* Controller exception class
*/
-class exception extends \RuntimeException
+class exception extends \phpbb\exception\runtime_exception
{
}
diff --git a/phpBB/phpbb/controller/helper.php b/phpBB/phpbb/controller/helper.php
index 79378c2434..e98de0e771 100644
--- a/phpBB/phpbb/controller/helper.php
+++ b/phpBB/phpbb/controller/helper.php
@@ -15,9 +15,7 @@ namespace phpbb\controller;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
-use Symfony\Component\Routing\Generator\UrlGenerator;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
-use Symfony\Component\Routing\RequestContext;
/**
* Controller helper class, contains methods that do things for controllers
@@ -49,21 +47,9 @@ class helper
protected $request;
/**
- * @var \phpbb\filesystem The filesystem object
- */
- protected $filesystem;
-
- /**
- * phpBB root path
- * @var string
- */
- protected $phpbb_root_path;
-
- /**
- * PHP file extension
- * @var string
- */
- protected $php_ext;
+ * @var \phpbb\routing\helper
+ */
+ protected $routing_helper;
/**
* Constructor
@@ -71,26 +57,18 @@ class helper
* @param \phpbb\template\template $template Template object
* @param \phpbb\user $user User object
* @param \phpbb\config\config $config Config object
- * @param \phpbb\controller\provider $provider Path provider
- * @param \phpbb\extension\manager $manager Extension manager object
* @param \phpbb\symfony_request $symfony_request Symfony Request object
* @param \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
+ * @param \phpbb\routing\helper $routing_helper Helper to generate the routes
*/
- public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, \phpbb\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)
+ public function __construct(\phpbb\template\template $template, \phpbb\user $user, \phpbb\config\config $config, \phpbb\symfony_request $symfony_request, \phpbb\request\request_interface $request, \phpbb\routing\helper $routing_helper)
{
$this->template = $template;
$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;
- $provider->find_routing_files($manager->get_finder());
- $this->route_collection = $provider->find($phpbb_root_path)->get_routes();
+ $this->routing_helper = $routing_helper;
}
/**
@@ -130,61 +108,7 @@ class helper
*/
public function route($route, array $params = array(), $is_amp = true, $session_id = false, $reference_type = UrlGeneratorInterface::ABSOLUTE_PATH)
{
- $anchor = '';
- if (isset($params['#']))
- {
- $anchor = '#' . $params['#'];
- unset($params['#']);
- }
-
- $context = new RequestContext();
- $context->fromRequest($this->symfony_request);
-
- $script_name = $this->symfony_request->getScriptName();
- $page_name = substr($script_name, -1, 1) == '/' ? '' : utf8_basename($script_name);
-
- $base_url = $context->getBaseUrl();
-
- // Append page name if base URL does not contain it
- if (!empty($page_name) && strpos($base_url, '/' . $page_name) === false)
- {
- $base_url .= '/' . $page_name;
- }
-
- // 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 the current script is not app.php
- if ($page_name !== 'app.php')
- {
- 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->request->escape($this->filesystem->clean_path($base_url), true);
-
- $context->setBaseUrl($base_url);
-
- $url_generator = new UrlGenerator($this->route_collection, $context);
- $route_url = $url_generator->generate($route, $params, $reference_type);
-
- if ($is_amp)
- {
- $route_url = str_replace(array('&amp;', '&'), array('&', '&amp;'), $route_url);
- }
-
- if ($reference_type === UrlGeneratorInterface::RELATIVE_PATH && empty($this->config['enable_mod_rewrite']))
- {
- $route_url = 'app.' . $this->php_ext . '/' . $route_url;
- }
-
- return append_sid($route_url . $anchor, false, $is_amp, $session_id, true);
+ return $this->routing_helper->route($route, $params, $is_amp, $session_id, $reference_type);
}
/**
@@ -243,6 +167,20 @@ class helper
}
/**
+ * Assigns automatic refresh time meta tag in template
+ *
+ * @param int $time time in seconds, when redirection should occur
+ * @param string $url the URL where the user should be redirected
+ * @return null
+ */
+ public function assign_meta_refresh_var($time, $url)
+ {
+ $this->template->assign_vars(array(
+ 'META' => '<meta http-equiv="refresh" content="' . $time . '; url=' . $url . '" />',
+ ));
+ }
+
+ /**
* Return the current url
*
* @return string
diff --git a/phpBB/phpbb/controller/provider.php b/phpBB/phpbb/controller/provider.php
deleted file mode 100644
index 7e26848290..0000000000
--- a/phpBB/phpbb/controller/provider.php
+++ /dev/null
@@ -1,92 +0,0 @@
-<?php
-/**
-*
-* This file is part of the phpBB Forum Software package.
-*
-* @copyright (c) phpBB Limited <https://www.phpbb.com>
-* @license GNU General Public License, version 2 (GPL-2.0)
-*
-* For full copyright and license information, please see
-* the docs/CREDITS.txt file.
-*
-*/
-
-namespace phpbb\controller;
-
-use Symfony\Component\Routing\RouteCollection;
-use Symfony\Component\Routing\Loader\YamlFileLoader;
-use Symfony\Component\Config\FileLocator;
-
-/**
-* Controller interface
-*/
-class provider
-{
- /**
- * YAML file(s) containing route information
- * @var array
- */
- protected $routing_files;
-
- /**
- * Collection of the routes in phpBB and all found extensions
- * @var RouteCollection
- */
- protected $routes;
-
- /**
- * Construct method
- *
- * @param array $routing_files Array of strings containing paths
- * to YAML files holding route information
- */
- public function __construct($routing_files = array())
- {
- $this->routing_files = $routing_files;
- }
-
- /**
- * Find the list of routing files
- *
- * @param \phpbb\finder $finder
- * @return null
- */
- public function find_routing_files(\phpbb\finder $finder)
- {
- // We hardcode the path to the core config directory
- // because the finder cannot find it
- $this->routing_files = array_merge($this->routing_files, array('config/routing.yml'), array_keys($finder
- ->directory('/config')
- ->suffix('routing.yml')
- ->find()
- ));
- }
-
- /**
- * Find a list of controllers
- *
- * @param string $base_path Base path to prepend to file paths
- * @return provider
- */
- public function find($base_path = '')
- {
- $this->routes = new RouteCollection;
- foreach ($this->routing_files as $file_path)
- {
- $loader = new YamlFileLoader(new FileLocator(phpbb_realpath($base_path)));
- $this->routes->addCollection($loader->load($file_path));
- }
-
- return $this;
- }
-
- /**
- * Get the list of routes
- *
- * @return RouteCollection Get the route collection
- */
- public function get_routes()
- {
- return $this->routes;
- }
-}
diff --git a/phpBB/phpbb/controller/resolver.php b/phpBB/phpbb/controller/resolver.php
index 948a6a218c..4f432c3323 100644
--- a/phpBB/phpbb/controller/resolver.php
+++ b/phpBB/phpbb/controller/resolver.php
@@ -23,12 +23,6 @@ use Symfony\Component\HttpFoundation\Request;
class resolver implements ControllerResolverInterface
{
/**
- * User object
- * @var \phpbb\user
- */
- protected $user;
-
- /**
* ContainerInterface object
* @var ContainerInterface
*/
@@ -55,14 +49,12 @@ class resolver implements ControllerResolverInterface
/**
* Construct method
*
- * @param \phpbb\user $user User Object
* @param ContainerInterface $container ContainerInterface object
* @param string $phpbb_root_path Relative path to phpBB root
* @param \phpbb\template\template $template
*/
- public function __construct(\phpbb\user $user, ContainerInterface $container, $phpbb_root_path, \phpbb\template\template $template = null)
+ public function __construct(ContainerInterface $container, $phpbb_root_path, \phpbb\template\template $template = null)
{
- $this->user = $user;
$this->container = $container;
$this->template = $template;
$this->type_cast_helper = new \phpbb\request\type_cast_helper();
@@ -82,20 +74,20 @@ class resolver implements ControllerResolverInterface
if (!$controller)
{
- throw new \phpbb\controller\exception($this->user->lang['CONTROLLER_NOT_SPECIFIED']);
+ throw new \phpbb\controller\exception('CONTROLLER_NOT_SPECIFIED');
}
// Require a method name along with the service name
if (stripos($controller, ':') === false)
{
- throw new \phpbb\controller\exception($this->user->lang['CONTROLLER_METHOD_NOT_SPECIFIED']);
+ throw new \phpbb\controller\exception('CONTROLLER_METHOD_NOT_SPECIFIED');
}
list($service, $method) = explode(':', $controller);
if (!$this->container->has($service))
{
- throw new \phpbb\controller\exception($this->user->lang('CONTROLLER_SERVICE_UNDEFINED', $service));
+ throw new \phpbb\controller\exception('CONTROLLER_SERVICE_UNDEFINED', array($service));
}
$controller_object = $this->container->get($service);
@@ -166,7 +158,7 @@ class resolver implements ControllerResolverInterface
}
else
{
- throw new \phpbb\controller\exception($this->user->lang('CONTROLLER_ARGUMENT_VALUE_MISSING', $param->getPosition() + 1, get_class($object) . ':' . $method, $param->name));
+ throw new \phpbb\controller\exception('CONTROLLER_ARGUMENT_VALUE_MISSING', array($param->getPosition() + 1, get_class($object) . ':' . $method, $param->name));
}
}
diff --git a/phpBB/phpbb/cron/task/core/prune_forum.php b/phpBB/phpbb/cron/task/core/prune_forum.php
index ba68565197..abf91aee19 100644
--- a/phpBB/phpbb/cron/task/core/prune_forum.php
+++ b/phpBB/phpbb/cron/task/core/prune_forum.php
@@ -31,7 +31,7 @@ class prune_forum extends \phpbb\cron\task\base implements \phpbb\cron\task\para
* If $forum_data is given, it is assumed to contain necessary information
* about a single forum that is to be pruned.
*
- * If $forum_data is not given, forum id will be retrieved via request_var
+ * If $forum_data is not given, forum id will be retrieved via $request->variable()
* and a database query will be performed to load the necessary information
* about the forum.
*/
diff --git a/phpBB/phpbb/cron/task/core/prune_shadow_topics.php b/phpBB/phpbb/cron/task/core/prune_shadow_topics.php
index 97a4b0ea86..0ab59f9ed5 100644
--- a/phpBB/phpbb/cron/task/core/prune_shadow_topics.php
+++ b/phpBB/phpbb/cron/task/core/prune_shadow_topics.php
@@ -33,7 +33,7 @@ class prune_shadow_topics extends \phpbb\cron\task\base implements \phpbb\cron\t
* If $forum_data is given, it is assumed to contain necessary information
* about a single forum that is to be pruned.
*
- * If $forum_data is not given, forum id will be retrieved via request_var
+ * If $forum_data is not given, forum id will be retrieved via $request->variable()
* and a database query will be performed to load the necessary information
* about the forum.
*/
diff --git a/phpBB/phpbb/cron/task/core/tidy_plupload.php b/phpBB/phpbb/cron/task/core/tidy_plupload.php
index b6aeecf4b4..d7364374af 100644
--- a/phpBB/phpbb/cron/task/core/tidy_plupload.php
+++ b/phpBB/phpbb/cron/task/core/tidy_plupload.php
@@ -67,6 +67,8 @@ class tidy_plupload extends \phpbb\cron\task\base
*/
public function run()
{
+ global $user, $phpbb_log;
+
// Remove old temporary file (perhaps failed uploads?)
$last_valid_timestamp = time() - $this->max_file_age;
try
@@ -88,13 +90,11 @@ class tidy_plupload extends \phpbb\cron\task\base
}
catch (\UnexpectedValueException $e)
{
- add_log(
- 'critical',
- 'LOG_PLUPLOAD_TIDY_FAILED',
+ $phpbb_log->add('critical', $user->data['user_id'], $user->ip, 'LOG_PLUPLOAD_TIDY_FAILED', false, array(
$this->plupload_upload_path,
$e->getMessage(),
$e->getTraceAsString()
- );
+ ));
}
$this->config->set('plupload_last_gc', time(), true);
diff --git a/phpBB/phpbb/db/driver/driver.php b/phpBB/phpbb/db/driver/driver.php
index 1b49775b32..2925765e94 100644
--- a/phpBB/phpbb/db/driver/driver.php
+++ b/phpBB/phpbb/db/driver/driver.php
@@ -271,7 +271,7 @@ abstract class driver implements driver_interface
$query_id = $this->query_result;
}
- if ($query_id !== false)
+ if ($query_id)
{
$result = array();
while ($row = $this->sql_fetchrow($query_id))
@@ -302,7 +302,7 @@ abstract class driver implements driver_interface
return $cache->sql_rowseek($rownum, $query_id);
}
- if ($query_id === false)
+ if (!$query_id)
{
return false;
}
@@ -310,7 +310,7 @@ abstract class driver implements driver_interface
$this->sql_freeresult($query_id);
$query_id = $this->sql_query($this->last_query_text);
- if ($query_id === false)
+ if (!$query_id)
{
return false;
}
@@ -339,7 +339,7 @@ abstract class driver implements driver_interface
$query_id = $this->query_result;
}
- if ($query_id !== false)
+ if ($query_id)
{
if ($rownum !== false)
{
@@ -363,8 +363,8 @@ abstract class driver implements driver_interface
*/
function sql_like_expression($expression)
{
- $expression = utf8_str_replace(array('_', '%'), array("\_", "\%"), $expression);
- $expression = utf8_str_replace(array(chr(0) . "\_", chr(0) . "\%"), array('_', '%'), $expression);
+ $expression = str_replace(array('_', '%'), array("\_", "\%"), $expression);
+ $expression = str_replace(array(chr(0) . "\_", chr(0) . "\%"), array('_', '%'), $expression);
return $this->_sql_like_expression('LIKE \'' . $this->sql_escape($expression) . '\'');
}
@@ -374,8 +374,8 @@ abstract class driver implements driver_interface
*/
function sql_not_like_expression($expression)
{
- $expression = utf8_str_replace(array('_', '%'), array("\_", "\%"), $expression);
- $expression = utf8_str_replace(array(chr(0) . "\_", chr(0) . "\%"), array('_', '%'), $expression);
+ $expression = str_replace(array('_', '%'), array("\_", "\%"), $expression);
+ $expression = str_replace(array(chr(0) . "\_", chr(0) . "\%"), array('_', '%'), $expression);
return $this->_sql_not_like_expression('NOT LIKE \'' . $this->sql_escape($expression) . '\'');
}
diff --git a/phpBB/phpbb/db/driver/mssql.php b/phpBB/phpbb/db/driver/mssql.php
index f9ea884ce2..dfdbfe15e6 100644
--- a/phpBB/phpbb/db/driver/mssql.php
+++ b/phpBB/phpbb/db/driver/mssql.php
@@ -71,8 +71,8 @@ class mssql extends \phpbb\db\driver\driver
$row = false;
if ($result_id)
{
- $row = @mssql_fetch_assoc($result_id);
- @mssql_free_result($result_id);
+ $row = mssql_fetch_assoc($result_id);
+ mssql_free_result($result_id);
}
$this->sql_server_version = ($row) ? trim(implode(' ', $row)) : 0;
@@ -161,12 +161,17 @@ class mssql extends \phpbb\db\driver\driver
$this->sql_time += microtime(true) - $this->curtime;
}
+ if (!$this->query_result)
+ {
+ return false;
+ }
+
if ($cache && $cache_ttl)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
$this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
}
- else if (strpos($query, 'SELECT') === 0 && $this->query_result)
+ else if (strpos($query, 'SELECT') === 0 && $this->query_result !== true)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
}
@@ -241,12 +246,12 @@ class mssql extends \phpbb\db\driver\driver
return $cache->sql_fetchrow($query_id);
}
- if ($query_id === false)
+ if (!$query_id || $query_id === true)
{
return false;
}
- $row = @mssql_fetch_assoc($query_id);
+ $row = mssql_fetch_assoc($query_id);
// I hope i am able to remove this later... hopefully only a PHP or MSSQL bug
if ($row)
@@ -272,12 +277,17 @@ class mssql extends \phpbb\db\driver\driver
$query_id = $this->query_result;
}
+ if ($query_id === true)
+ {
+ return false;
+ }
+
if ($cache && $cache->sql_exists($query_id))
{
return $cache->sql_rowseek($rownum, $query_id);
}
- return ($query_id !== false) ? @mssql_data_seek($query_id, $rownum) : false;
+ return ($query_id) ? @mssql_data_seek($query_id, $rownum) : false;
}
/**
@@ -288,12 +298,12 @@ class mssql extends \phpbb\db\driver\driver
$result_id = @mssql_query('SELECT SCOPE_IDENTITY()', $this->db_connect_id);
if ($result_id)
{
- if ($row = @mssql_fetch_assoc($result_id))
+ if ($row = mssql_fetch_assoc($result_id))
{
- @mssql_free_result($result_id);
+ mssql_free_result($result_id);
return $row['computed'];
}
- @mssql_free_result($result_id);
+ mssql_free_result($result_id);
}
return false;
@@ -311,6 +321,11 @@ class mssql extends \phpbb\db\driver\driver
$query_id = $this->query_result;
}
+ if ($query_id === true)
+ {
+ return false;
+ }
+
if ($cache && !is_object($query_id) && $cache->sql_exists($query_id))
{
return $cache->sql_freeresult($query_id);
@@ -319,7 +334,7 @@ class mssql extends \phpbb\db\driver\driver
if (isset($this->open_queries[(int) $query_id]))
{
unset($this->open_queries[(int) $query_id]);
- return @mssql_free_result($query_id);
+ return mssql_free_result($query_id);
}
return false;
@@ -376,9 +391,9 @@ class mssql extends \phpbb\db\driver\driver
$result_id = @mssql_query('SELECT @@ERROR as code', $this->db_connect_id);
if ($result_id)
{
- $row = @mssql_fetch_assoc($result_id);
+ $row = mssql_fetch_assoc($result_id);
$error['code'] = $row['code'];
- @mssql_free_result($result_id);
+ mssql_free_result($result_id);
}
// Get full error message if possible
@@ -389,12 +404,12 @@ class mssql extends \phpbb\db\driver\driver
if ($result_id)
{
- $row = @mssql_fetch_assoc($result_id);
+ $row = mssql_fetch_assoc($result_id);
if (!empty($row['message']))
{
$error['message'] .= '<br />' . $row['message'];
}
- @mssql_free_result($result_id);
+ mssql_free_result($result_id);
}
}
else
@@ -440,13 +455,13 @@ class mssql extends \phpbb\db\driver\driver
if ($result = @mssql_query($query, $this->db_connect_id))
{
@mssql_next_result($result);
- while ($row = @mssql_fetch_row($result))
+ while ($row = mssql_fetch_row($result))
{
$html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
}
}
@mssql_query('SET SHOWPLAN_TEXT OFF;', $this->db_connect_id);
- @mssql_free_result($result);
+ mssql_free_result($result);
if ($html_table)
{
@@ -459,11 +474,14 @@ class mssql extends \phpbb\db\driver\driver
$endtime = $endtime[0] + $endtime[1];
$result = @mssql_query($query, $this->db_connect_id);
- while ($void = @mssql_fetch_assoc($result))
+ if ($result)
{
- // Take the time spent on parsing rows into account
+ while ($void = mssql_fetch_assoc($result))
+ {
+ // Take the time spent on parsing rows into account
+ }
+ mssql_free_result($result);
}
- @mssql_free_result($result);
$splittime = explode(' ', microtime());
$splittime = $splittime[0] + $splittime[1];
diff --git a/phpBB/phpbb/db/driver/mssql_odbc.php b/phpBB/phpbb/db/driver/mssql_odbc.php
index 8e5d4c7a4c..9d9ad603e0 100644
--- a/phpBB/phpbb/db/driver/mssql_odbc.php
+++ b/phpBB/phpbb/db/driver/mssql_odbc.php
@@ -98,8 +98,8 @@ class mssql_odbc extends \phpbb\db\driver\mssql_base
$row = false;
if ($result_id)
{
- $row = @odbc_fetch_array($result_id);
- @odbc_free_result($result_id);
+ $row = odbc_fetch_array($result_id);
+ odbc_free_result($result_id);
}
$this->sql_server_version = ($row) ? trim(implode(' ', $row)) : 0;
@@ -181,12 +181,17 @@ class mssql_odbc extends \phpbb\db\driver\mssql_base
$this->sql_time += microtime(true) - $this->curtime;
}
+ if (!$this->query_result)
+ {
+ return false;
+ }
+
if ($cache && $cache_ttl)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
$this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
}
- else if (strpos($query, 'SELECT') === 0 && $this->query_result)
+ else if (strpos($query, 'SELECT') === 0)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
}
@@ -261,7 +266,7 @@ class mssql_odbc extends \phpbb\db\driver\mssql_base
return $cache->sql_fetchrow($query_id);
}
- return ($query_id !== false) ? @odbc_fetch_array($query_id) : false;
+ return ($query_id) ? odbc_fetch_array($query_id) : false;
}
/**
@@ -273,13 +278,13 @@ class mssql_odbc extends \phpbb\db\driver\mssql_base
if ($result_id)
{
- if (@odbc_fetch_array($result_id))
+ if (odbc_fetch_array($result_id))
{
- $id = @odbc_result($result_id, 1);
- @odbc_free_result($result_id);
+ $id = odbc_result($result_id, 1);
+ odbc_free_result($result_id);
return $id;
}
- @odbc_free_result($result_id);
+ odbc_free_result($result_id);
}
return false;
@@ -305,7 +310,7 @@ class mssql_odbc extends \phpbb\db\driver\mssql_base
if (isset($this->open_queries[(int) $query_id]))
{
unset($this->open_queries[(int) $query_id]);
- return @odbc_free_result($query_id);
+ return odbc_free_result($query_id);
}
return false;
@@ -360,11 +365,14 @@ class mssql_odbc extends \phpbb\db\driver\mssql_base
$endtime = $endtime[0] + $endtime[1];
$result = @odbc_exec($this->db_connect_id, $query);
- while ($void = @odbc_fetch_array($result))
+ if ($result)
{
- // Take the time spent on parsing rows into account
+ while ($void = odbc_fetch_array($result))
+ {
+ // Take the time spent on parsing rows into account
+ }
+ odbc_free_result($result);
}
- @odbc_free_result($result);
$splittime = explode(' ', microtime());
$splittime = $splittime[0] + $splittime[1];
diff --git a/phpBB/phpbb/db/driver/mssqlnative.php b/phpBB/phpbb/db/driver/mssqlnative.php
index 46a9b3a477..50dce35baa 100644
--- a/phpBB/phpbb/db/driver/mssqlnative.php
+++ b/phpBB/phpbb/db/driver/mssqlnative.php
@@ -154,12 +154,17 @@ class mssqlnative extends \phpbb\db\driver\mssql_base
$this->sql_time += microtime(true) - $this->curtime;
}
+ if (!$this->query_result)
+ {
+ return false;
+ }
+
if ($cache && $cache_ttl)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
$this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
}
- else if (strpos($query, 'SELECT') === 0 && $this->query_result)
+ else if (strpos($query, 'SELECT') === 0)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
}
@@ -242,12 +247,12 @@ class mssqlnative extends \phpbb\db\driver\mssql_base
return $cache->sql_fetchrow($query_id);
}
- if ($query_id === false)
+ if (!$query_id)
{
return false;
}
- $row = @sqlsrv_fetch_array($query_id, SQLSRV_FETCH_ASSOC);
+ $row = sqlsrv_fetch_array($query_id, SQLSRV_FETCH_ASSOC);
if ($row)
{
@@ -272,11 +277,11 @@ class mssqlnative extends \phpbb\db\driver\mssql_base
{
$result_id = @sqlsrv_query($this->db_connect_id, 'SELECT @@IDENTITY');
- if ($result_id !== false)
+ if ($result_id)
{
- $row = @sqlsrv_fetch_array($result_id);
+ $row = sqlsrv_fetch_array($result_id);
$id = $row[0];
- @sqlsrv_free_stmt($result_id);
+ sqlsrv_free_stmt($result_id);
return $id;
}
else
@@ -305,7 +310,7 @@ class mssqlnative extends \phpbb\db\driver\mssql_base
if (isset($this->open_queries[(int) $query_id]))
{
unset($this->open_queries[(int) $query_id]);
- return @sqlsrv_free_stmt($query_id);
+ return sqlsrv_free_stmt($query_id);
}
return false;
@@ -378,14 +383,14 @@ class mssqlnative extends \phpbb\db\driver\mssql_base
@sqlsrv_query($this->db_connect_id, 'SET SHOWPLAN_TEXT ON;');
if ($result = @sqlsrv_query($this->db_connect_id, $query))
{
- @sqlsrv_next_result($result);
- while ($row = @sqlsrv_fetch_array($result))
+ sqlsrv_next_result($result);
+ while ($row = sqlsrv_fetch_array($result))
{
$html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
}
+ sqlsrv_free_stmt($result);
}
@sqlsrv_query($this->db_connect_id, 'SET SHOWPLAN_TEXT OFF;');
- @sqlsrv_free_stmt($result);
if ($html_table)
{
@@ -398,11 +403,14 @@ class mssqlnative extends \phpbb\db\driver\mssql_base
$endtime = $endtime[0] + $endtime[1];
$result = @sqlsrv_query($this->db_connect_id, $query);
- while ($void = @sqlsrv_fetch_array($result))
+ if ($result)
{
- // Take the time spent on parsing rows into account
+ while ($void = sqlsrv_fetch_array($result))
+ {
+ // Take the time spent on parsing rows into account
+ }
+ sqlsrv_free_stmt($result);
}
- @sqlsrv_free_stmt($result);
$splittime = explode(' ', microtime());
$splittime = $splittime[0] + $splittime[1];
diff --git a/phpBB/phpbb/db/driver/mysql.php b/phpBB/phpbb/db/driver/mysql.php
index e93c7239e8..a94e88b331 100644
--- a/phpBB/phpbb/db/driver/mysql.php
+++ b/phpBB/phpbb/db/driver/mysql.php
@@ -70,9 +70,16 @@ class mysql extends \phpbb\db\driver\mysql_base
if (version_compare($this->sql_server_info(true), '5.0.2', '>='))
{
$result = @mysql_query('SELECT @@session.sql_mode AS sql_mode', $this->db_connect_id);
- $row = @mysql_fetch_assoc($result);
- @mysql_free_result($result);
- $modes = array_map('trim', explode(',', $row['sql_mode']));
+ if ($result)
+ {
+ $row = mysql_fetch_assoc($result);
+ mysql_free_result($result);
+ $modes = array_map('trim', explode(',', $row['sql_mode']));
+ }
+ else
+ {
+ $modes = array();
+ }
// TRADITIONAL includes STRICT_ALL_TABLES and STRICT_TRANS_TABLES
if (!in_array('TRADITIONAL', $modes))
@@ -114,14 +121,17 @@ class mysql extends \phpbb\db\driver\mysql_base
if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mysql_version')) === false)
{
$result = @mysql_query('SELECT VERSION() AS version', $this->db_connect_id);
- $row = @mysql_fetch_assoc($result);
- @mysql_free_result($result);
+ if ($result)
+ {
+ $row = mysql_fetch_assoc($result);
+ mysql_free_result($result);
- $this->sql_server_version = $row['version'];
+ $this->sql_server_version = $row['version'];
- if (!empty($cache) && $use_cache)
- {
- $cache->put('mysql_version', $this->sql_server_version);
+ if (!empty($cache) && $use_cache)
+ {
+ $cache->put('mysql_version', $this->sql_server_version);
+ }
}
}
@@ -190,12 +200,17 @@ class mysql extends \phpbb\db\driver\mysql_base
$this->sql_time += microtime(true) - $this->curtime;
}
+ if (!$this->query_result)
+ {
+ return false;
+ }
+
if ($cache && $cache_ttl)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
$this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
}
- else if (strpos($query, 'SELECT') === 0 && $this->query_result)
+ else if (strpos($query, 'SELECT') === 0)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
}
@@ -257,7 +272,7 @@ class mysql extends \phpbb\db\driver\mysql_base
return $cache->sql_fetchrow($query_id);
}
- return ($query_id !== false) ? @mysql_fetch_assoc($query_id) : false;
+ return ($query_id) ? mysql_fetch_assoc($query_id) : false;
}
/**
@@ -308,7 +323,7 @@ class mysql extends \phpbb\db\driver\mysql_base
if (isset($this->open_queries[(int) $query_id]))
{
unset($this->open_queries[(int) $query_id]);
- return @mysql_free_result($query_id);
+ return mysql_free_result($query_id);
}
return false;
@@ -411,12 +426,12 @@ class mysql extends \phpbb\db\driver\mysql_base
if ($result = @mysql_query("EXPLAIN $explain_query", $this->db_connect_id))
{
- while ($row = @mysql_fetch_assoc($result))
+ while ($row = mysql_fetch_assoc($result))
{
$html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
}
+ mysql_free_result($result);
}
- @mysql_free_result($result);
if ($html_table)
{
@@ -431,7 +446,7 @@ class mysql extends \phpbb\db\driver\mysql_base
if ($result = @mysql_query('SHOW PROFILE ALL;', $this->db_connect_id))
{
$this->html_hold .= '<br />';
- while ($row = @mysql_fetch_assoc($result))
+ while ($row = mysql_fetch_assoc($result))
{
// make <unknown> HTML safe
if (!empty($row['Source_function']))
@@ -449,8 +464,8 @@ class mysql extends \phpbb\db\driver\mysql_base
}
$html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
}
+ mysql_free_result($result);
}
- @mysql_free_result($result);
if ($html_table)
{
@@ -468,11 +483,14 @@ class mysql extends \phpbb\db\driver\mysql_base
$endtime = $endtime[0] + $endtime[1];
$result = @mysql_query($query, $this->db_connect_id);
- while ($void = @mysql_fetch_assoc($result))
+ if ($result)
{
- // Take the time spent on parsing rows into account
+ while ($void = mysql_fetch_assoc($result))
+ {
+ // Take the time spent on parsing rows into account
+ }
+ mysql_free_result($result);
}
- @mysql_free_result($result);
$splittime = explode(' ', microtime());
$splittime = $splittime[0] + $splittime[1];
diff --git a/phpBB/phpbb/db/driver/mysqli.php b/phpBB/phpbb/db/driver/mysqli.php
index c0ddfbf76c..d43e201526 100644
--- a/phpBB/phpbb/db/driver/mysqli.php
+++ b/phpBB/phpbb/db/driver/mysqli.php
@@ -74,9 +74,10 @@ class mysqli extends \phpbb\db\driver\mysql_base
if (version_compare($this->sql_server_info(true), '5.0.2', '>='))
{
$result = @mysqli_query($this->db_connect_id, 'SELECT @@session.sql_mode AS sql_mode');
- if ($result !== null)
+ if ($result)
{
- $row = @mysqli_fetch_assoc($result);
+ $row = mysqli_fetch_assoc($result);
+ mysqli_free_result($result);
$modes = array_map('trim', explode(',', $row['sql_mode']));
}
@@ -84,7 +85,6 @@ class mysqli extends \phpbb\db\driver\mysql_base
{
$modes = array();
}
- @mysqli_free_result($result);
// TRADITIONAL includes STRICT_ALL_TABLES and STRICT_TRANS_TABLES
if (!in_array('TRADITIONAL', $modes))
@@ -119,9 +119,10 @@ class mysqli extends \phpbb\db\driver\mysql_base
if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('mysqli_version')) === false)
{
$result = @mysqli_query($this->db_connect_id, 'SELECT VERSION() AS version');
- if ($result !== null)
+ if ($result)
{
- $row = @mysqli_fetch_assoc($result);
+ $row = mysqli_fetch_assoc($result);
+ mysqli_free_result($result);
$this->sql_server_version = $row['version'];
@@ -130,7 +131,6 @@ class mysqli extends \phpbb\db\driver\mysql_base
$cache->put('mysqli_version', $this->sql_server_version);
}
}
- @mysqli_free_result($result);
}
return ($raw) ? $this->sql_server_version : 'MySQL(i) ' . $this->sql_server_version;
@@ -202,6 +202,11 @@ class mysqli extends \phpbb\db\driver\mysql_base
$this->sql_time += microtime(true) - $this->curtime;
}
+ if (!$this->query_result)
+ {
+ return false;
+ }
+
if ($cache && $cache_ttl)
{
$this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
@@ -245,9 +250,9 @@ class mysqli extends \phpbb\db\driver\mysql_base
return $cache->sql_fetchrow($query_id);
}
- if ($query_id !== false && $query_id !== null)
+ if ($query_id)
{
- $result = @mysqli_fetch_assoc($query_id);
+ $result = mysqli_fetch_assoc($query_id);
return $result !== null ? $result : false;
}
@@ -271,7 +276,7 @@ class mysqli extends \phpbb\db\driver\mysql_base
return $cache->sql_rowseek($rownum, $query_id);
}
- return ($query_id !== false) ? @mysqli_data_seek($query_id, $rownum) : false;
+ return ($query_id) ? @mysqli_data_seek($query_id, $rownum) : false;
}
/**
@@ -299,7 +304,17 @@ class mysqli extends \phpbb\db\driver\mysql_base
return $cache->sql_freeresult($query_id);
}
- return @mysqli_free_result($query_id);
+ if (!$query_id)
+ {
+ return false;
+ }
+
+ if ($query_id === true)
+ {
+ return true;
+ }
+
+ return mysqli_free_result($query_id);
}
/**
@@ -398,12 +413,12 @@ class mysqli extends \phpbb\db\driver\mysql_base
if ($result = @mysqli_query($this->db_connect_id, "EXPLAIN $explain_query"))
{
- while ($row = @mysqli_fetch_assoc($result))
+ while ($row = mysqli_fetch_assoc($result))
{
$html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
}
+ mysqli_free_result($result);
}
- @mysqli_free_result($result);
if ($html_table)
{
@@ -418,7 +433,7 @@ class mysqli extends \phpbb\db\driver\mysql_base
if ($result = @mysqli_query($this->db_connect_id, 'SHOW PROFILE ALL;'))
{
$this->html_hold .= '<br />';
- while ($row = @mysqli_fetch_assoc($result))
+ while ($row = mysqli_fetch_assoc($result))
{
// make <unknown> HTML safe
if (!empty($row['Source_function']))
@@ -436,8 +451,8 @@ class mysqli extends \phpbb\db\driver\mysql_base
}
$html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
}
+ mysqli_free_result($result);
}
- @mysqli_free_result($result);
if ($html_table)
{
@@ -455,14 +470,14 @@ class mysqli extends \phpbb\db\driver\mysql_base
$endtime = $endtime[0] + $endtime[1];
$result = @mysqli_query($this->db_connect_id, $query);
- if ($result !== null)
+ if ($result)
{
- while ($void = @mysqli_fetch_assoc($result))
+ while ($void = mysqli_fetch_assoc($result))
{
// Take the time spent on parsing rows into account
}
+ mysqli_free_result($result);
}
- @mysqli_free_result($result);
$splittime = explode(' ', microtime());
$splittime = $splittime[0] + $splittime[1];
diff --git a/phpBB/phpbb/db/driver/oracle.php b/phpBB/phpbb/db/driver/oracle.php
index 6dcab5dd7d..89e1b68aac 100644
--- a/phpBB/phpbb/db/driver/oracle.php
+++ b/phpBB/phpbb/db/driver/oracle.php
@@ -439,12 +439,17 @@ class oracle extends \phpbb\db\driver\driver
$this->sql_time += microtime(true) - $this->curtime;
}
+ if (!$this->query_result)
+ {
+ return false;
+ }
+
if ($cache && $cache_ttl)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
$this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
}
- else if (strpos($query, 'SELECT') === 0 && $this->query_result)
+ else if (strpos($query, 'SELECT') === 0)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
}
@@ -499,10 +504,10 @@ class oracle extends \phpbb\db\driver\driver
return $cache->sql_fetchrow($query_id);
}
- if ($query_id !== false)
+ if ($query_id)
{
$row = array();
- $result = @ocifetchinto($query_id, $row, OCI_ASSOC + OCI_RETURN_NULLS);
+ $result = ocifetchinto($query_id, $row, OCI_ASSOC + OCI_RETURN_NULLS);
if (!$result || !$row)
{
@@ -550,7 +555,7 @@ class oracle extends \phpbb\db\driver\driver
return $cache->sql_rowseek($rownum, $query_id);
}
- if ($query_id === false)
+ if (!$query_id)
{
return false;
}
@@ -583,18 +588,24 @@ class oracle extends \phpbb\db\driver\driver
{
$query = 'SELECT ' . $tablename[1] . '_seq.currval FROM DUAL';
$stmt = @ociparse($this->db_connect_id, $query);
- @ociexecute($stmt, OCI_DEFAULT);
+ if ($stmt)
+ {
+ $success = @ociexecute($stmt, OCI_DEFAULT);
- $temp_result = @ocifetchinto($stmt, $temp_array, OCI_ASSOC + OCI_RETURN_NULLS);
- @ocifreestatement($stmt);
+ if ($success)
+ {
+ $temp_result = ocifetchinto($stmt, $temp_array, OCI_ASSOC + OCI_RETURN_NULLS);
+ ocifreestatement($stmt);
- if ($temp_result)
- {
- return $temp_array['CURRVAL'];
- }
- else
- {
- return false;
+ if ($temp_result)
+ {
+ return $temp_array['CURRVAL'];
+ }
+ else
+ {
+ return false;
+ }
+ }
}
}
}
@@ -622,7 +633,7 @@ class oracle extends \phpbb\db\driver\driver
if (isset($this->open_queries[(int) $query_id]))
{
unset($this->open_queries[(int) $query_id]);
- return @ocifreestatement($query_id);
+ return ocifreestatement($query_id);
}
return false;
@@ -787,14 +798,20 @@ class oracle extends \phpbb\db\driver\driver
$endtime = $endtime[0] + $endtime[1];
$result = @ociparse($this->db_connect_id, $query);
- $success = @ociexecute($result, OCI_DEFAULT);
- $row = array();
-
- while (@ocifetchinto($result, $row, OCI_ASSOC + OCI_RETURN_NULLS))
+ if ($result)
{
- // Take the time spent on parsing rows into account
+ $success = @ociexecute($result, OCI_DEFAULT);
+ if ($success)
+ {
+ $row = array();
+
+ while (ocifetchinto($result, $row, OCI_ASSOC + OCI_RETURN_NULLS))
+ {
+ // Take the time spent on parsing rows into account
+ }
+ @ocifreestatement($result);
+ }
}
- @ocifreestatement($result);
$splittime = explode(' ', microtime());
$splittime = $splittime[0] + $splittime[1];
diff --git a/phpBB/phpbb/db/driver/postgres.php b/phpBB/phpbb/db/driver/postgres.php
index a3b9aa4c6b..44476612c3 100644
--- a/phpBB/phpbb/db/driver/postgres.php
+++ b/phpBB/phpbb/db/driver/postgres.php
@@ -123,14 +123,17 @@ class postgres extends \phpbb\db\driver\driver
if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('pgsql_version')) === false)
{
$query_id = @pg_query($this->db_connect_id, 'SELECT VERSION() AS version');
- $row = @pg_fetch_assoc($query_id, null);
- @pg_free_result($query_id);
+ if ($query_id)
+ {
+ $row = pg_fetch_assoc($query_id, null);
+ pg_free_result($query_id);
- $this->sql_server_version = (!empty($row['version'])) ? trim(substr($row['version'], 10)) : 0;
+ $this->sql_server_version = (!empty($row['version'])) ? trim(substr($row['version'], 10)) : 0;
- if (!empty($cache) && $use_cache)
- {
- $cache->put('pgsql_version', $this->sql_server_version);
+ if (!empty($cache) && $use_cache)
+ {
+ $cache->put('pgsql_version', $this->sql_server_version);
+ }
}
}
@@ -200,12 +203,17 @@ class postgres extends \phpbb\db\driver\driver
$this->sql_time += microtime(true) - $this->curtime;
}
+ if (!$this->query_result)
+ {
+ return false;
+ }
+
if ($cache && $cache_ttl)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
$this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
}
- else if (strpos($query, 'SELECT') === 0 && $this->query_result)
+ else if (strpos($query, 'SELECT') === 0)
{
$this->open_queries[(int) $this->query_result] = $this->query_result;
}
@@ -275,7 +283,7 @@ class postgres extends \phpbb\db\driver\driver
return $cache->sql_fetchrow($query_id);
}
- return ($query_id !== false) ? @pg_fetch_assoc($query_id, null) : false;
+ return ($query_id) ? pg_fetch_assoc($query_id, null) : false;
}
/**
@@ -295,7 +303,7 @@ class postgres extends \phpbb\db\driver\driver
return $cache->sql_rowseek($rownum, $query_id);
}
- return ($query_id !== false) ? @pg_result_seek($query_id, $rownum) : false;
+ return ($query_id) ? @pg_result_seek($query_id, $rownum) : false;
}
/**
@@ -317,8 +325,8 @@ class postgres extends \phpbb\db\driver\driver
return false;
}
- $temp_result = @pg_fetch_assoc($temp_q_id, null);
- @pg_free_result($query_id);
+ $temp_result = pg_fetch_assoc($temp_q_id, null);
+ pg_free_result($query_id);
return ($temp_result) ? $temp_result['last_value'] : false;
}
@@ -347,7 +355,7 @@ class postgres extends \phpbb\db\driver\driver
if (isset($this->open_queries[(int) $query_id]))
{
unset($this->open_queries[(int) $query_id]);
- return @pg_free_result($query_id);
+ return pg_free_result($query_id);
}
return false;
@@ -453,12 +461,12 @@ class postgres extends \phpbb\db\driver\driver
if ($result = @pg_query($this->db_connect_id, "EXPLAIN $explain_query"))
{
- while ($row = @pg_fetch_assoc($result, null))
+ while ($row = pg_fetch_assoc($result, null))
{
$html_table = $this->sql_report('add_select_row', $query, $html_table, $row);
}
+ pg_free_result($result);
}
- @pg_free_result($result);
if ($html_table)
{
@@ -473,11 +481,14 @@ class postgres extends \phpbb\db\driver\driver
$endtime = $endtime[0] + $endtime[1];
$result = @pg_query($this->db_connect_id, $query);
- while ($void = @pg_fetch_assoc($result, null))
+ if ($result)
{
- // Take the time spent on parsing rows into account
+ while ($void = pg_fetch_assoc($result, null))
+ {
+ // Take the time spent on parsing rows into account
+ }
+ pg_free_result($result);
}
- @pg_free_result($result);
$splittime = explode(' ', microtime());
$splittime = $splittime[0] + $splittime[1];
diff --git a/phpBB/phpbb/db/driver/sqlite.php b/phpBB/phpbb/db/driver/sqlite.php
index d5da0e2438..8e205ebb81 100644
--- a/phpBB/phpbb/db/driver/sqlite.php
+++ b/phpBB/phpbb/db/driver/sqlite.php
@@ -70,13 +70,16 @@ class sqlite extends \phpbb\db\driver\driver
if (!$use_cache || empty($cache) || ($this->sql_server_version = $cache->get('sqlite_version')) === false)
{
$result = @sqlite_query('SELECT sqlite_version() AS version', $this->db_connect_id);
- $row = @sqlite_fetch_array($result, SQLITE_ASSOC);
+ if ($result)
+ {
+ $row = sqlite_fetch_array($result, SQLITE_ASSOC);
- $this->sql_server_version = (!empty($row['version'])) ? $row['version'] : 0;
+ $this->sql_server_version = (!empty($row['version'])) ? $row['version'] : 0;
- if (!empty($cache) && $use_cache)
- {
- $cache->put('sqlite_version', $this->sql_server_version);
+ if (!empty($cache) && $use_cache)
+ {
+ $cache->put('sqlite_version', $this->sql_server_version);
+ }
}
}
@@ -145,14 +148,14 @@ class sqlite extends \phpbb\db\driver\driver
$this->sql_time += microtime(true) - $this->curtime;
}
- if ($cache && $cache_ttl)
+ if (!$this->query_result)
{
- $this->open_queries[(int) $this->query_result] = $this->query_result;
- $this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
+ return false;
}
- else if (strpos($query, 'SELECT') === 0 && $this->query_result)
+
+ if ($cache && $cache_ttl)
{
- $this->open_queries[(int) $this->query_result] = $this->query_result;
+ $this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
}
}
else if (defined('DEBUG'))
@@ -211,7 +214,7 @@ class sqlite extends \phpbb\db\driver\driver
return $cache->sql_fetchrow($query_id);
}
- return ($query_id !== false) ? @sqlite_fetch_array($query_id, SQLITE_ASSOC) : false;
+ return ($query_id) ? sqlite_fetch_array($query_id, SQLITE_ASSOC) : false;
}
/**
@@ -231,7 +234,7 @@ class sqlite extends \phpbb\db\driver\driver
return $cache->sql_rowseek($rownum, $query_id);
}
- return ($query_id !== false) ? @sqlite_seek($query_id, $rownum) : false;
+ return ($query_id) ? @sqlite_seek($query_id, $rownum) : false;
}
/**
@@ -362,9 +365,12 @@ class sqlite extends \phpbb\db\driver\driver
$endtime = $endtime[0] + $endtime[1];
$result = @sqlite_query($query, $this->db_connect_id);
- while ($void = @sqlite_fetch_array($result, SQLITE_ASSOC))
+ if ($result)
{
- // Take the time spent on parsing rows into account
+ while ($void = sqlite_fetch_array($result, SQLITE_ASSOC))
+ {
+ // Take the time spent on parsing rows into account
+ }
}
$splittime = explode(' ', microtime());
diff --git a/phpBB/phpbb/db/driver/sqlite3.php b/phpBB/phpbb/db/driver/sqlite3.php
index cc3352af34..b7f6e60337 100644
--- a/phpBB/phpbb/db/driver/sqlite3.php
+++ b/phpBB/phpbb/db/driver/sqlite3.php
@@ -148,6 +148,11 @@ class sqlite3 extends \phpbb\db\driver\driver
$this->sql_time += microtime(true) - $this->curtime;
}
+ if (!$this->query_result)
+ {
+ return false;
+ }
+
if ($cache && $cache_ttl)
{
$this->query_result = $cache->sql_save($this, $query, $this->query_result, $cache_ttl);
@@ -389,9 +394,12 @@ class sqlite3 extends \phpbb\db\driver\driver
$endtime = $endtime[0] + $endtime[1];
$result = $this->dbo->query($query);
- while ($void = $result->fetchArray(SQLITE3_ASSOC))
+ if ($result)
{
- // Take the time spent on parsing rows into account
+ while ($void = $result->fetchArray(SQLITE3_ASSOC))
+ {
+ // Take the time spent on parsing rows into account
+ }
}
$splittime = explode(' ', microtime());
diff --git a/phpBB/phpbb/db/extractor/base_extractor.php b/phpBB/phpbb/db/extractor/base_extractor.php
new file mode 100644
index 0000000000..547c85f066
--- /dev/null
+++ b/phpBB/phpbb/db/extractor/base_extractor.php
@@ -0,0 +1,252 @@
+<?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\extractor;
+
+use phpbb\db\extractor\exception\invalid_format_exception;
+use phpbb\db\extractor\exception\extractor_not_initialized_exception;
+
+/**
+ * Abstract base class for database extraction
+ */
+abstract class base_extractor implements extractor_interface
+{
+ /**
+ * @var string phpBB root path
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * @var \phpbb\request\request_interface
+ */
+ protected $request;
+
+ /**
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * @var bool
+ */
+ protected $download;
+
+ /**
+ * @var bool
+ */
+ protected $store;
+
+ /**
+ * @var int
+ */
+ protected $time;
+
+ /**
+ * @var string
+ */
+ protected $format;
+
+ /**
+ * @var resource
+ */
+ protected $fp;
+
+ /**
+ * @var string
+ */
+ protected $write;
+
+ /**
+ * @var string
+ */
+ protected $close;
+
+ /**
+ * @var bool
+ */
+ protected $run_comp;
+
+ /**
+ * @var bool
+ */
+ protected $is_initialized;
+
+ /**
+ * Constructor
+ *
+ * @param string $phpbb_root_path
+ * @param \phpbb\request\request_interface $request
+ * @param \phpbb\db\driver\driver_interface $db
+ */
+ public function __construct($phpbb_root_path, \phpbb\request\request_interface $request, \phpbb\db\driver\driver_interface $db)
+ {
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->request = $request;
+ $this->db = $db;
+ $this->fp = null;
+
+ $this->is_initialized = false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function init_extractor($format, $filename, $time, $download = false, $store = false)
+ {
+ $this->download = $download;
+ $this->store = $store;
+ $this->time = $time;
+ $this->format = $format;
+
+ switch ($format)
+ {
+ case 'text':
+ $ext = '.sql';
+ $open = 'fopen';
+ $this->write = 'fwrite';
+ $this->close = 'fclose';
+ $mimetype = 'text/x-sql';
+ break;
+ case 'bzip2':
+ $ext = '.sql.bz2';
+ $open = 'bzopen';
+ $this->write = 'bzwrite';
+ $this->close = 'bzclose';
+ $mimetype = 'application/x-bzip2';
+ break;
+ case 'gzip':
+ $ext = '.sql.gz';
+ $open = 'gzopen';
+ $this->write = 'gzwrite';
+ $this->close = 'gzclose';
+ $mimetype = 'application/x-gzip';
+ break;
+ default:
+ throw new invalid_format_exception();
+ break;
+ }
+
+ if ($download === true)
+ {
+ $name = $filename . $ext;
+ header('Cache-Control: private, no-cache');
+ header("Content-Type: $mimetype; name=\"$name\"");
+ header("Content-disposition: attachment; filename=$name");
+
+ switch ($format)
+ {
+ case 'bzip2':
+ ob_start();
+ break;
+
+ case 'gzip':
+ if (strpos($this->request->header('Accept-Encoding'), 'gzip') !== false && strpos(strtolower($this->request->header('User-Agent')), 'msie') === false)
+ {
+ ob_start('ob_gzhandler');
+ }
+ else
+ {
+ $this->run_comp = true;
+ }
+ break;
+ }
+ }
+
+ if ($store === true)
+ {
+ $file = $this->phpbb_root_path . 'store/' . $filename . $ext;
+
+ $this->fp = $open($file, 'w');
+
+ if (!$this->fp)
+ {
+ trigger_error('FILE_WRITE_FAIL', E_USER_ERROR);
+ }
+ }
+
+ $this->is_initialized = true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write_end()
+ {
+ static $close;
+
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ if ($this->store)
+ {
+ if ($close === null)
+ {
+ $close = $this->close;
+ }
+ $close($this->fp);
+ }
+
+ // bzip2 must be written all the way at the end
+ if ($this->download && $this->format === 'bzip2')
+ {
+ $c = ob_get_clean();
+ echo bzcompress($c);
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function flush($data)
+ {
+ static $write;
+
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ if ($this->store === true)
+ {
+ if ($write === null)
+ {
+ $write = $this->write;
+ }
+ $write($this->fp, $data);
+ }
+
+ if ($this->download === true)
+ {
+ if ($this->format === 'bzip2' || $this->format === 'text' || ($this->format === 'gzip' && !$this->run_comp))
+ {
+ echo $data;
+ }
+
+ // we can write the gzip data as soon as we get it
+ if ($this->format === 'gzip')
+ {
+ if ($this->run_comp)
+ {
+ echo gzencode($data);
+ }
+ else
+ {
+ ob_flush();
+ flush();
+ }
+ }
+ }
+ }
+}
diff --git a/phpBB/phpbb/db/extractor/exception/extractor_not_initialized_exception.php b/phpBB/phpbb/db/extractor/exception/extractor_not_initialized_exception.php
new file mode 100644
index 0000000000..62eb434be1
--- /dev/null
+++ b/phpBB/phpbb/db/extractor/exception/extractor_not_initialized_exception.php
@@ -0,0 +1,24 @@
+<?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\extractor\exception;
+
+use phpbb\exception\runtime_exception;
+
+/**
+* This exception is thrown when invalid format is given to the extractor
+*/
+class extractor_not_initialized_exception extends runtime_exception
+{
+
+}
diff --git a/phpBB/phpbb/db/extractor/exception/invalid_format_exception.php b/phpBB/phpbb/db/extractor/exception/invalid_format_exception.php
new file mode 100644
index 0000000000..6be24cb5dc
--- /dev/null
+++ b/phpBB/phpbb/db/extractor/exception/invalid_format_exception.php
@@ -0,0 +1,22 @@
+<?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\extractor\exception;
+
+/**
+* This exception is thrown when invalid format is given to the extractor
+*/
+class invalid_format_exception extends \InvalidArgumentException
+{
+
+}
diff --git a/phpBB/phpbb/db/extractor/extractor_interface.php b/phpBB/phpbb/db/extractor/extractor_interface.php
new file mode 100644
index 0000000000..ff45df9bb7
--- /dev/null
+++ b/phpBB/phpbb/db/extractor/extractor_interface.php
@@ -0,0 +1,80 @@
+<?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\extractor;
+
+/**
+* Database extractor interface
+*/
+interface extractor_interface
+{
+ /**
+ * Start the extraction of the database
+ *
+ * This function initialize the database extraction. It is required to call this
+ * function before calling any other extractor functions.
+ *
+ * @param string $format
+ * @param string $filename
+ * @param int $time
+ * @param bool $download
+ * @param bool $store
+ * @return null
+ * @throws \phpbb\db\extractor\exception\invalid_format_exception when $format is invalid
+ */
+ public function init_extractor($format, $filename, $time, $download = false, $store = false);
+
+ /**
+ * Writes header comments to the database backup
+ *
+ * @param string $table_prefix prefix of phpBB database tables
+ * @return null
+ * @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor()
+ */
+ public function write_start($table_prefix);
+
+ /**
+ * Closes file and/or dumps download data
+ *
+ * @return null
+ * @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor()
+ */
+ public function write_end();
+
+ /**
+ * Extracts database table structure
+ *
+ * @param string $table_name name of the database table
+ * @return null
+ * @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor()
+ */
+ public function write_table($table_name);
+
+ /**
+ * Extracts data from database table
+ *
+ * @param string $table_name name of the database table
+ * @return null
+ * @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor()
+ */
+ public function write_data($table_name);
+
+ /**
+ * Writes data to file/download content
+ *
+ * @param string $data
+ * @return null
+ * @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor()
+ */
+ public function flush($data);
+}
diff --git a/phpBB/phpbb/db/extractor/factory.php b/phpBB/phpbb/db/extractor/factory.php
new file mode 100644
index 0000000000..a1ffb65595
--- /dev/null
+++ b/phpBB/phpbb/db/extractor/factory.php
@@ -0,0 +1,79 @@
+<?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\extractor;
+
+/**
+* A factory which serves the suitable extractor instance for the given dbal
+*/
+class factory
+{
+ /**
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * @var \Symfony\Component\DependencyInjection\ContainerInterface
+ */
+ protected $container;
+
+ /**
+ * Extractor factory constructor
+ *
+ * @param \phpbb\db\driver\driver_interface $db
+ * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
+ */
+ public function __construct(\phpbb\db\driver\driver_interface $db, \Symfony\Component\DependencyInjection\ContainerInterface $container)
+ {
+ $this->db = $db;
+ $this->container = $container;
+ }
+
+ /**
+ * DB extractor factory getter
+ *
+ * @return \phpbb\db\extractor\extractor_interface an appropriate instance of the database extractor for the used database driver
+ * @throws \InvalidArgumentException when the database driver is unknown
+ */
+ public function get()
+ {
+ // Return the appropriate DB extractor
+ if ($this->db instanceof \phpbb\db\driver\mssql || $this->db instanceof \phpbb\db\driver\mssql_base)
+ {
+ return $this->container->get('dbal.extractor.extractors.mssql_extractor');
+ }
+ else if ($this->db instanceof \phpbb\db\driver\mysql_base)
+ {
+ return $this->container->get('dbal.extractor.extractors.mysql_extractor');
+ }
+ else if ($this->db instanceof \phpbb\db\driver\oracle)
+ {
+ return $this->container->get('dbal.extractor.extractors.oracle_extractor');
+ }
+ else if ($this->db instanceof \phpbb\db\driver\postgres)
+ {
+ return $this->container->get('dbal.extractor.extractors.postgres_extractor');
+ }
+ else if ($this->db instanceof \phpbb\db\driver\sqlite)
+ {
+ return $this->container->get('dbal.extractor.extractors.sqlite_extractor');
+ }
+ else if ($this->db instanceof \phpbb\db\driver\sqlite3)
+ {
+ return $this->container->get('dbal.extractor.extractors.sqlite3_extractor');
+ }
+
+ throw new \InvalidArgumentException('Invalid database driver given');
+ }
+}
diff --git a/phpBB/phpbb/db/extractor/mssql_extractor.php b/phpBB/phpbb/db/extractor/mssql_extractor.php
new file mode 100644
index 0000000000..fc30f4789d
--- /dev/null
+++ b/phpBB/phpbb/db/extractor/mssql_extractor.php
@@ -0,0 +1,524 @@
+<?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\extractor;
+
+use phpbb\db\extractor\exception\extractor_not_initialized_exception;
+
+class mssql_extractor extends base_extractor
+{
+ /**
+ * Writes closing line(s) to database backup
+ *
+ * @return null
+ * @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor()
+ */
+ public function write_end()
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ $this->flush("COMMIT\nGO\n");
+ parent::write_end();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write_start($table_prefix)
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ $sql_data = "--\n";
+ $sql_data .= "-- phpBB Backup Script\n";
+ $sql_data .= "-- Dump of tables for $table_prefix\n";
+ $sql_data .= "-- DATE : " . gmdate("d-m-Y H:i:s", $this->time) . " GMT\n";
+ $sql_data .= "--\n";
+ $sql_data .= "BEGIN TRANSACTION\n";
+ $sql_data .= "GO\n";
+ $this->flush($sql_data);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write_table($table_name)
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ $sql_data = '-- Table: ' . $table_name . "\n";
+ $sql_data .= "IF OBJECT_ID(N'$table_name', N'U') IS NOT NULL\n";
+ $sql_data .= "DROP TABLE $table_name;\n";
+ $sql_data .= "GO\n";
+ $sql_data .= "\nCREATE TABLE [$table_name] (\n";
+ $rows = array();
+
+ $text_flag = false;
+
+ $sql = "SELECT COLUMN_NAME, COLUMN_DEFAULT, IS_NULLABLE, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH, COLUMNPROPERTY(object_id(TABLE_NAME), COLUMN_NAME, 'IsIdentity') as IS_IDENTITY
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE TABLE_NAME = '$table_name'";
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $line = "\t[{$row['COLUMN_NAME']}] [{$row['DATA_TYPE']}]";
+
+ if ($row['DATA_TYPE'] == 'text')
+ {
+ $text_flag = true;
+ }
+
+ if ($row['IS_IDENTITY'])
+ {
+ $line .= ' IDENTITY (1 , 1)';
+ }
+
+ if ($row['CHARACTER_MAXIMUM_LENGTH'] && $row['DATA_TYPE'] !== 'text')
+ {
+ $line .= ' (' . $row['CHARACTER_MAXIMUM_LENGTH'] . ')';
+ }
+
+ if ($row['IS_NULLABLE'] == 'YES')
+ {
+ $line .= ' NULL';
+ }
+ else
+ {
+ $line .= ' NOT NULL';
+ }
+
+ if ($row['COLUMN_DEFAULT'])
+ {
+ $line .= ' DEFAULT ' . $row['COLUMN_DEFAULT'];
+ }
+
+ $rows[] = $line;
+ }
+ $this->db->sql_freeresult($result);
+
+ $sql_data .= implode(",\n", $rows);
+ $sql_data .= "\n) ON [PRIMARY]";
+
+ if ($text_flag)
+ {
+ $sql_data .= " TEXTIMAGE_ON [PRIMARY]";
+ }
+
+ $sql_data .= "\nGO\n\n";
+ $rows = array();
+
+ $sql = "SELECT CONSTRAINT_NAME, COLUMN_NAME
+ FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
+ WHERE TABLE_NAME = '$table_name'";
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (!sizeof($rows))
+ {
+ $sql_data .= "ALTER TABLE [$table_name] WITH NOCHECK ADD\n";
+ $sql_data .= "\tCONSTRAINT [{$row['CONSTRAINT_NAME']}] PRIMARY KEY CLUSTERED \n\t(\n";
+ }
+ $rows[] = "\t\t[{$row['COLUMN_NAME']}]";
+ }
+ if (sizeof($rows))
+ {
+ $sql_data .= implode(",\n", $rows);
+ $sql_data .= "\n\t) ON [PRIMARY] \nGO\n";
+ }
+ $this->db->sql_freeresult($result);
+
+ $index = array();
+ $sql = "EXEC sp_statistics '$table_name'";
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if ($row['TYPE'] == 3)
+ {
+ $index[$row['INDEX_NAME']][] = '[' . $row['COLUMN_NAME'] . ']';
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ foreach ($index as $index_name => $column_name)
+ {
+ $index[$index_name] = implode(', ', $column_name);
+ }
+
+ foreach ($index as $index_name => $columns)
+ {
+ $sql_data .= "\nCREATE INDEX [$index_name] ON [$table_name]($columns) ON [PRIMARY]\nGO\n";
+ }
+ $this->flush($sql_data);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write_data($table_name)
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ if ($this->db->get_sql_layer() === 'mssql')
+ {
+ $this->write_data_mssql($table_name);
+ }
+ else if ($this->db->get_sql_layer() === 'mssqlnative')
+ {
+ $this->write_data_mssqlnative($table_name);
+ }
+ else
+ {
+ $this->write_data_odbc($table_name);
+ }
+ }
+
+ /**
+ * Extracts data from database table (for MSSQL driver)
+ *
+ * @param string $table_name name of the database table
+ * @return null
+ * @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor()
+ */
+ protected function write_data_mssql($table_name)
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ $ary_type = $ary_name = array();
+ $ident_set = false;
+ $sql_data = '';
+
+ // Grab all of the data from current table.
+ $sql = "SELECT *
+ FROM $table_name";
+ $result = $this->db->sql_query($sql);
+
+ $retrieved_data = mssql_num_rows($result);
+
+ $i_num_fields = mssql_num_fields($result);
+
+ for ($i = 0; $i < $i_num_fields; $i++)
+ {
+ $ary_type[$i] = mssql_field_type($result, $i);
+ $ary_name[$i] = mssql_field_name($result, $i);
+ }
+
+ if ($retrieved_data)
+ {
+ $sql = "SELECT 1 as has_identity
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE COLUMNPROPERTY(object_id('$table_name'), COLUMN_NAME, 'IsIdentity') = 1";
+ $result2 = $this->db->sql_query($sql);
+ $row2 = $this->db->sql_fetchrow($result2);
+ if (!empty($row2['has_identity']))
+ {
+ $sql_data .= "\nSET IDENTITY_INSERT $table_name ON\nGO\n";
+ $ident_set = true;
+ }
+ $this->db->sql_freeresult($result2);
+ }
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $schema_vals = $schema_fields = array();
+
+ // Build the SQL statement to recreate the data.
+ for ($i = 0; $i < $i_num_fields; $i++)
+ {
+ $str_val = $row[$ary_name[$i]];
+
+ if (preg_match('#char|text|bool|varbinary#i', $ary_type[$i]))
+ {
+ $str_quote = '';
+ $str_empty = "''";
+ $str_val = sanitize_data_mssql(str_replace("'", "''", $str_val));
+ }
+ else if (preg_match('#date|timestamp#i', $ary_type[$i]))
+ {
+ if (empty($str_val))
+ {
+ $str_quote = '';
+ }
+ else
+ {
+ $str_quote = "'";
+ }
+ }
+ else
+ {
+ $str_quote = '';
+ $str_empty = 'NULL';
+ }
+
+ if (empty($str_val) && $str_val !== '0' && !(is_int($str_val) || is_float($str_val)))
+ {
+ $str_val = $str_empty;
+ }
+
+ $schema_vals[$i] = $str_quote . $str_val . $str_quote;
+ $schema_fields[$i] = $ary_name[$i];
+ }
+
+ // Take the ordered fields and their associated data and build it
+ // into a valid sql statement to recreate that field in the data.
+ $sql_data .= "INSERT INTO $table_name (" . implode(', ', $schema_fields) . ') VALUES (' . implode(', ', $schema_vals) . ");\nGO\n";
+
+ $this->flush($sql_data);
+ $sql_data = '';
+ }
+ $this->db->sql_freeresult($result);
+
+ if ($retrieved_data && $ident_set)
+ {
+ $sql_data .= "\nSET IDENTITY_INSERT $table_name OFF\nGO\n";
+ }
+ $this->flush($sql_data);
+ }
+
+ /**
+ * Extracts data from database table (for MSSQL Native driver)
+ *
+ * @param string $table_name name of the database table
+ * @return null
+ * @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor()
+ */
+ protected function write_data_mssqlnative($table_name)
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ $ary_type = $ary_name = array();
+ $ident_set = false;
+ $sql_data = '';
+
+ // Grab all of the data from current table.
+ $sql = "SELECT * FROM $table_name";
+ $this->db->mssqlnative_set_query_options(array('Scrollable' => SQLSRV_CURSOR_STATIC));
+ $result = $this->db->sql_query($sql);
+
+ $retrieved_data = $this->db->mssqlnative_num_rows($result);
+
+ if (!$retrieved_data)
+ {
+ $this->db->sql_freeresult($result);
+ return;
+ }
+
+ $sql = "SELECT COLUMN_NAME, DATA_TYPE
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE INFORMATION_SCHEMA.COLUMNS.TABLE_NAME = '" . $this->db->sql_escape($table_name) . "'";
+ $result_fields = $this->db->sql_query($sql);
+
+ $i_num_fields = 0;
+ while ($row = $this->db->sql_fetchrow($result_fields))
+ {
+ $ary_type[$i_num_fields] = $row['DATA_TYPE'];
+ $ary_name[$i_num_fields] = $row['COLUMN_NAME'];
+ $i_num_fields++;
+ }
+ $this->db->sql_freeresult($result_fields);
+
+ $sql = "SELECT 1 as has_identity
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE COLUMNPROPERTY(object_id('$table_name'), COLUMN_NAME, 'IsIdentity') = 1";
+ $result2 = $this->db->sql_query($sql);
+ $row2 = $this->db->sql_fetchrow($result2);
+
+ if (!empty($row2['has_identity']))
+ {
+ $sql_data .= "\nSET IDENTITY_INSERT $table_name ON\nGO\n";
+ $ident_set = true;
+ }
+ $this->db->sql_freeresult($result2);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $schema_vals = $schema_fields = array();
+
+ // Build the SQL statement to recreate the data.
+ for ($i = 0; $i < $i_num_fields; $i++)
+ {
+ $str_val = $row[$ary_name[$i]];
+
+ // defaults to type number - better quote just to be safe, so check for is_int too
+ if (is_int($ary_type[$i]) || preg_match('#char|text|bool|varbinary#i', $ary_type[$i]))
+ {
+ $str_quote = '';
+ $str_empty = "''";
+ $str_val = sanitize_data_mssql(str_replace("'", "''", $str_val));
+ }
+ else if (preg_match('#date|timestamp#i', $ary_type[$i]))
+ {
+ if (empty($str_val))
+ {
+ $str_quote = '';
+ }
+ else
+ {
+ $str_quote = "'";
+ }
+ }
+ else
+ {
+ $str_quote = '';
+ $str_empty = 'NULL';
+ }
+
+ if (empty($str_val) && $str_val !== '0' && !(is_int($str_val) || is_float($str_val)))
+ {
+ $str_val = $str_empty;
+ }
+
+ $schema_vals[$i] = $str_quote . $str_val . $str_quote;
+ $schema_fields[$i] = $ary_name[$i];
+ }
+
+ // Take the ordered fields and their associated data and build it
+ // into a valid sql statement to recreate that field in the data.
+ $sql_data .= "INSERT INTO $table_name (" . implode(', ', $schema_fields) . ') VALUES (' . implode(', ', $schema_vals) . ");\nGO\n";
+
+ $this->flush($sql_data);
+ $sql_data = '';
+ }
+ $this->db->sql_freeresult($result);
+
+ if ($ident_set)
+ {
+ $sql_data .= "\nSET IDENTITY_INSERT $table_name OFF\nGO\n";
+ }
+ $this->flush($sql_data);
+ }
+
+ /**
+ * Extracts data from database table (for ODBC driver)
+ *
+ * @param string $table_name name of the database table
+ * @return null
+ * @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor()
+ */
+ protected function write_data_odbc($table_name)
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ $ary_type = $ary_name = array();
+ $ident_set = false;
+ $sql_data = '';
+
+ // Grab all of the data from current table.
+ $sql = "SELECT *
+ FROM $table_name";
+ $result = $this->db->sql_query($sql);
+
+ $retrieved_data = odbc_num_rows($result);
+
+ if ($retrieved_data)
+ {
+ $sql = "SELECT 1 as has_identity
+ FROM INFORMATION_SCHEMA.COLUMNS
+ WHERE COLUMNPROPERTY(object_id('$table_name'), COLUMN_NAME, 'IsIdentity') = 1";
+ $result2 = $this->db->sql_query($sql);
+ $row2 = $this->db->sql_fetchrow($result2);
+ if (!empty($row2['has_identity']))
+ {
+ $sql_data .= "\nSET IDENTITY_INSERT $table_name ON\nGO\n";
+ $ident_set = true;
+ }
+ $this->db->sql_freeresult($result2);
+ }
+
+ $i_num_fields = odbc_num_fields($result);
+
+ for ($i = 0; $i < $i_num_fields; $i++)
+ {
+ $ary_type[$i] = odbc_field_type($result, $i + 1);
+ $ary_name[$i] = odbc_field_name($result, $i + 1);
+ }
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $schema_vals = $schema_fields = array();
+
+ // Build the SQL statement to recreate the data.
+ for ($i = 0; $i < $i_num_fields; $i++)
+ {
+ $str_val = $row[$ary_name[$i]];
+
+ if (preg_match('#char|text|bool|varbinary#i', $ary_type[$i]))
+ {
+ $str_quote = '';
+ $str_empty = "''";
+ $str_val = sanitize_data_mssql(str_replace("'", "''", $str_val));
+ }
+ else if (preg_match('#date|timestamp#i', $ary_type[$i]))
+ {
+ if (empty($str_val))
+ {
+ $str_quote = '';
+ }
+ else
+ {
+ $str_quote = "'";
+ }
+ }
+ else
+ {
+ $str_quote = '';
+ $str_empty = 'NULL';
+ }
+
+ if (empty($str_val) && $str_val !== '0' && !(is_int($str_val) || is_float($str_val)))
+ {
+ $str_val = $str_empty;
+ }
+
+ $schema_vals[$i] = $str_quote . $str_val . $str_quote;
+ $schema_fields[$i] = $ary_name[$i];
+ }
+
+ // Take the ordered fields and their associated data and build it
+ // into a valid sql statement to recreate that field in the data.
+ $sql_data .= "INSERT INTO $table_name (" . implode(', ', $schema_fields) . ') VALUES (' . implode(', ', $schema_vals) . ");\nGO\n";
+
+ $this->flush($sql_data);
+
+ $sql_data = '';
+
+ }
+ $this->db->sql_freeresult($result);
+
+ if ($retrieved_data && $ident_set)
+ {
+ $sql_data .= "\nSET IDENTITY_INSERT $table_name OFF\nGO\n";
+ }
+ $this->flush($sql_data);
+ }
+}
diff --git a/phpBB/phpbb/db/extractor/mysql_extractor.php b/phpBB/phpbb/db/extractor/mysql_extractor.php
new file mode 100644
index 0000000000..34e309c19e
--- /dev/null
+++ b/phpBB/phpbb/db/extractor/mysql_extractor.php
@@ -0,0 +1,403 @@
+<?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\extractor;
+
+use phpbb\db\extractor\exception\extractor_not_initialized_exception;
+
+class mysql_extractor extends base_extractor
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function write_start($table_prefix)
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ $sql_data = "#\n";
+ $sql_data .= "# phpBB Backup Script\n";
+ $sql_data .= "# Dump of tables for $table_prefix\n";
+ $sql_data .= "# DATE : " . gmdate("d-m-Y H:i:s", $this->time) . " GMT\n";
+ $sql_data .= "#\n";
+ $this->flush($sql_data);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write_table($table_name)
+ {
+ static $new_extract;
+
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ if ($new_extract === null)
+ {
+ if ($this->db->get_sql_layer() === 'mysqli' || version_compare($this->db->sql_server_info(true), '3.23.20', '>='))
+ {
+ $new_extract = true;
+ }
+ else
+ {
+ $new_extract = false;
+ }
+ }
+
+ if ($new_extract)
+ {
+ $this->new_write_table($table_name);
+ }
+ else
+ {
+ $this->old_write_table($table_name);
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write_data($table_name)
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ if ($this->db->get_sql_layer() === 'mysqli')
+ {
+ $this->write_data_mysqli($table_name);
+ }
+ else
+ {
+ $this->write_data_mysql($table_name);
+ }
+ }
+
+ /**
+ * Extracts data from database table (for MySQLi driver)
+ *
+ * @param string $table_name name of the database table
+ * @return null
+ * @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor()
+ */
+ protected function write_data_mysqli($table_name)
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ $sql = "SELECT *
+ FROM $table_name";
+ $result = mysqli_query($this->db->get_db_connect_id(), $sql, MYSQLI_USE_RESULT);
+ if ($result != false)
+ {
+ $fields_cnt = mysqli_num_fields($result);
+
+ // Get field information
+ $field = mysqli_fetch_fields($result);
+ $field_set = array();
+
+ for ($j = 0; $j < $fields_cnt; $j++)
+ {
+ $field_set[] = $field[$j]->name;
+ }
+
+ $search = array("\\", "'", "\x00", "\x0a", "\x0d", "\x1a", '"');
+ $replace = array("\\\\", "\\'", '\0', '\n', '\r', '\Z', '\\"');
+ $fields = implode(', ', $field_set);
+ $sql_data = 'INSERT INTO ' . $table_name . ' (' . $fields . ') VALUES ';
+ $first_set = true;
+ $query_len = 0;
+ $max_len = get_usable_memory();
+
+ while ($row = mysqli_fetch_row($result))
+ {
+ $values = array();
+ if ($first_set)
+ {
+ $query = $sql_data . '(';
+ }
+ else
+ {
+ $query .= ',(';
+ }
+
+ for ($j = 0; $j < $fields_cnt; $j++)
+ {
+ if (!isset($row[$j]) || is_null($row[$j]))
+ {
+ $values[$j] = 'NULL';
+ }
+ else if (($field[$j]->flags & 32768) && !($field[$j]->flags & 1024))
+ {
+ $values[$j] = $row[$j];
+ }
+ else
+ {
+ $values[$j] = "'" . str_replace($search, $replace, $row[$j]) . "'";
+ }
+ }
+ $query .= implode(', ', $values) . ')';
+
+ $query_len += strlen($query);
+ if ($query_len > $max_len)
+ {
+ $this->flush($query . ";\n\n");
+ $query = '';
+ $query_len = 0;
+ $first_set = true;
+ }
+ else
+ {
+ $first_set = false;
+ }
+ }
+ mysqli_free_result($result);
+
+ // check to make sure we have nothing left to flush
+ if (!$first_set && $query)
+ {
+ $this->flush($query . ";\n\n");
+ }
+ }
+ }
+
+ /**
+ * Extracts data from database table (for MySQL driver)
+ *
+ * @param string $table_name name of the database table
+ * @return null
+ * @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor()
+ */
+ protected function write_data_mysql($table_name)
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ $sql = "SELECT *
+ FROM $table_name";
+ $result = mysql_unbuffered_query($sql, $this->db->get_db_connect_id());
+
+ if ($result != false)
+ {
+ $fields_cnt = mysql_num_fields($result);
+
+ // Get field information
+ $field = array();
+ for ($i = 0; $i < $fields_cnt; $i++)
+ {
+ $field[] = mysql_fetch_field($result, $i);
+ }
+ $field_set = array();
+
+ for ($j = 0; $j < $fields_cnt; $j++)
+ {
+ $field_set[] = $field[$j]->name;
+ }
+
+ $search = array("\\", "'", "\x00", "\x0a", "\x0d", "\x1a", '"');
+ $replace = array("\\\\", "\\'", '\0', '\n', '\r', '\Z', '\\"');
+ $fields = implode(', ', $field_set);
+ $sql_data = 'INSERT INTO ' . $table_name . ' (' . $fields . ') VALUES ';
+ $first_set = true;
+ $query_len = 0;
+ $max_len = get_usable_memory();
+
+ while ($row = mysql_fetch_row($result))
+ {
+ $values = array();
+ if ($first_set)
+ {
+ $query = $sql_data . '(';
+ }
+ else
+ {
+ $query .= ',(';
+ }
+
+ for ($j = 0; $j < $fields_cnt; $j++)
+ {
+ if (!isset($row[$j]) || is_null($row[$j]))
+ {
+ $values[$j] = 'NULL';
+ }
+ else if ($field[$j]->numeric && ($field[$j]->type !== 'timestamp'))
+ {
+ $values[$j] = $row[$j];
+ }
+ else
+ {
+ $values[$j] = "'" . str_replace($search, $replace, $row[$j]) . "'";
+ }
+ }
+ $query .= implode(', ', $values) . ')';
+
+ $query_len += strlen($query);
+ if ($query_len > $max_len)
+ {
+ $this->flush($query . ";\n\n");
+ $query = '';
+ $query_len = 0;
+ $first_set = true;
+ }
+ else
+ {
+ $first_set = false;
+ }
+ }
+ mysql_free_result($result);
+
+ // check to make sure we have nothing left to flush
+ if (!$first_set && $query)
+ {
+ $this->flush($query . ";\n\n");
+ }
+ }
+ }
+
+ /**
+ * Extracts database table structure (for MySQLi or MySQL 3.23.20+)
+ *
+ * @param string $table_name name of the database table
+ * @return null
+ * @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor()
+ */
+ protected function new_write_table($table_name)
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ $sql = 'SHOW CREATE TABLE ' . $table_name;
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+
+ $sql_data = '# Table: ' . $table_name . "\n";
+ $sql_data .= "DROP TABLE IF EXISTS $table_name;\n";
+ $this->flush($sql_data . $row['Create Table'] . ";\n\n");
+
+ $this->db->sql_freeresult($result);
+ }
+
+ /**
+ * Extracts database table structure (for MySQL verisons older than 3.23.20)
+ *
+ * @param string $table_name name of the database table
+ * @return null
+ * @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor()
+ */
+ protected function old_write_table($table_name)
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ $sql_data = '# Table: ' . $table_name . "\n";
+ $sql_data .= "DROP TABLE IF EXISTS $table_name;\n";
+ $sql_data .= "CREATE TABLE $table_name(\n";
+ $rows = array();
+
+ $sql = "SHOW FIELDS
+ FROM $table_name";
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $line = ' ' . $row['Field'] . ' ' . $row['Type'];
+
+ if (!is_null($row['Default']))
+ {
+ $line .= " DEFAULT '{$row['Default']}'";
+ }
+
+ if ($row['Null'] != 'YES')
+ {
+ $line .= ' NOT NULL';
+ }
+
+ if ($row['Extra'] != '')
+ {
+ $line .= ' ' . $row['Extra'];
+ }
+
+ $rows[] = $line;
+ }
+ $this->db->sql_freeresult($result);
+
+ $sql = "SHOW KEYS
+ FROM $table_name";
+
+ $result = $this->db->sql_query($sql);
+
+ $index = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $kname = $row['Key_name'];
+
+ if ($kname != 'PRIMARY')
+ {
+ if ($row['Non_unique'] == 0)
+ {
+ $kname = "UNIQUE|$kname";
+ }
+ }
+
+ if ($row['Sub_part'])
+ {
+ $row['Column_name'] .= '(' . $row['Sub_part'] . ')';
+ }
+ $index[$kname][] = $row['Column_name'];
+ }
+ $this->db->sql_freeresult($result);
+
+ foreach ($index as $key => $columns)
+ {
+ $line = ' ';
+
+ if ($key == 'PRIMARY')
+ {
+ $line .= 'PRIMARY KEY (' . implode(', ', $columns) . ')';
+ }
+ else if (strpos($key, 'UNIQUE') === 0)
+ {
+ $line .= 'UNIQUE ' . substr($key, 7) . ' (' . implode(', ', $columns) . ')';
+ }
+ else if (strpos($key, 'FULLTEXT') === 0)
+ {
+ $line .= 'FULLTEXT ' . substr($key, 9) . ' (' . implode(', ', $columns) . ')';
+ }
+ else
+ {
+ $line .= "KEY $key (" . implode(', ', $columns) . ')';
+ }
+
+ $rows[] = $line;
+ }
+
+ $sql_data .= implode(",\n", $rows);
+ $sql_data .= "\n);\n\n";
+
+ $this->flush($sql_data);
+ }
+}
diff --git a/phpBB/phpbb/db/extractor/oracle_extractor.php b/phpBB/phpbb/db/extractor/oracle_extractor.php
new file mode 100644
index 0000000000..05f7b8ac95
--- /dev/null
+++ b/phpBB/phpbb/db/extractor/oracle_extractor.php
@@ -0,0 +1,265 @@
+<?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\extractor;
+
+use phpbb\db\extractor\exception\extractor_not_initialized_exception;
+
+class oracle_extractor extends base_extractor
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function write_table($table_name)
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ $sql_data = '-- Table: ' . $table_name . "\n";
+ $sql_data .= "DROP TABLE $table_name\n/\n";
+ $sql_data .= "\nCREATE TABLE $table_name (\n";
+
+ $sql = "SELECT COLUMN_NAME, DATA_TYPE, DATA_PRECISION, DATA_LENGTH, NULLABLE, DATA_DEFAULT
+ FROM ALL_TAB_COLS
+ WHERE table_name = '{$table_name}'";
+ $result = $this->db->sql_query($sql);
+
+ $rows = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $line = ' "' . $row['column_name'] . '" ' . $row['data_type'];
+
+ if ($row['data_type'] !== 'CLOB')
+ {
+ if ($row['data_type'] !== 'VARCHAR2' && $row['data_type'] !== 'CHAR')
+ {
+ $line .= '(' . $row['data_precision'] . ')';
+ }
+ else
+ {
+ $line .= '(' . $row['data_length'] . ')';
+ }
+ }
+
+ if (!empty($row['data_default']))
+ {
+ $line .= ' DEFAULT ' . $row['data_default'];
+ }
+
+ if ($row['nullable'] == 'N')
+ {
+ $line .= ' NOT NULL';
+ }
+ $rows[] = $line;
+ }
+ $this->db->sql_freeresult($result);
+
+ $sql = "SELECT A.CONSTRAINT_NAME, A.COLUMN_NAME
+ FROM USER_CONS_COLUMNS A, USER_CONSTRAINTS B
+ WHERE A.CONSTRAINT_NAME = B.CONSTRAINT_NAME
+ AND B.CONSTRAINT_TYPE = 'P'
+ AND A.TABLE_NAME = '{$table_name}'";
+ $result = $this->db->sql_query($sql);
+
+ $primary_key = array();
+ $constraint_name = '';
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $constraint_name = '"' . $row['constraint_name'] . '"';
+ $primary_key[] = '"' . $row['column_name'] . '"';
+ }
+ $this->db->sql_freeresult($result);
+
+ if (sizeof($primary_key))
+ {
+ $rows[] = " CONSTRAINT {$constraint_name} PRIMARY KEY (" . implode(', ', $primary_key) . ')';
+ }
+
+ $sql = "SELECT A.CONSTRAINT_NAME, A.COLUMN_NAME
+ FROM USER_CONS_COLUMNS A, USER_CONSTRAINTS B
+ WHERE A.CONSTRAINT_NAME = B.CONSTRAINT_NAME
+ AND B.CONSTRAINT_TYPE = 'U'
+ AND A.TABLE_NAME = '{$table_name}'";
+ $result = $this->db->sql_query($sql);
+
+ $unique = array();
+ $constraint_name = '';
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $constraint_name = '"' . $row['constraint_name'] . '"';
+ $unique[] = '"' . $row['column_name'] . '"';
+ }
+ $this->db->sql_freeresult($result);
+
+ if (sizeof($unique))
+ {
+ $rows[] = " CONSTRAINT {$constraint_name} UNIQUE (" . implode(', ', $unique) . ')';
+ }
+
+ $sql_data .= implode(",\n", $rows);
+ $sql_data .= "\n)\n/\n";
+
+ $sql = "SELECT A.REFERENCED_NAME, C.*
+ FROM USER_DEPENDENCIES A, USER_TRIGGERS B, USER_SEQUENCES C
+ WHERE A.REFERENCED_TYPE = 'SEQUENCE'
+ AND A.NAME = B.TRIGGER_NAME
+ AND B.TABLE_NAME = '{$table_name}'
+ AND C.SEQUENCE_NAME = A.REFERENCED_NAME";
+ $result = $this->db->sql_query($sql);
+
+ $type = $this->request->variable('type', '');
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $sql_data .= "\nDROP SEQUENCE \"{$row['referenced_name']}\"\n/\n";
+ $sql_data .= "\nCREATE SEQUENCE \"{$row['referenced_name']}\"";
+
+ if ($type == 'full')
+ {
+ $sql_data .= ' START WITH ' . $row['last_number'];
+ }
+
+ $sql_data .= "\n/\n";
+ }
+ $this->db->sql_freeresult($result);
+
+ $sql = "SELECT DESCRIPTION, WHEN_CLAUSE, TRIGGER_BODY
+ FROM USER_TRIGGERS
+ WHERE TABLE_NAME = '{$table_name}'";
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $sql_data .= "\nCREATE OR REPLACE TRIGGER {$row['description']}WHEN ({$row['when_clause']})\n{$row['trigger_body']}\n/\n";
+ }
+ $this->db->sql_freeresult($result);
+
+ $sql = "SELECT A.INDEX_NAME, B.COLUMN_NAME
+ FROM USER_INDEXES A, USER_IND_COLUMNS B
+ WHERE A.UNIQUENESS = 'NONUNIQUE'
+ AND A.INDEX_NAME = B.INDEX_NAME
+ AND B.TABLE_NAME = '{$table_name}'";
+ $result = $this->db->sql_query($sql);
+
+ $index = array();
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $index[$row['index_name']][] = $row['column_name'];
+ }
+
+ foreach ($index as $index_name => $column_names)
+ {
+ $sql_data .= "\nCREATE INDEX $index_name ON $table_name(" . implode(', ', $column_names) . ")\n/\n";
+ }
+ $this->db->sql_freeresult($result);
+ $this->flush($sql_data);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write_data($table_name)
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ $ary_type = $ary_name = array();
+
+ // Grab all of the data from current table.
+ $sql = "SELECT *
+ FROM $table_name";
+ $result = $this->db->sql_query($sql);
+
+ $i_num_fields = ocinumcols($result);
+
+ for ($i = 0; $i < $i_num_fields; $i++)
+ {
+ $ary_type[$i] = ocicolumntype($result, $i + 1);
+ $ary_name[$i] = ocicolumnname($result, $i + 1);
+ }
+
+ $sql_data = '';
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $schema_vals = $schema_fields = array();
+
+ // Build the SQL statement to recreate the data.
+ for ($i = 0; $i < $i_num_fields; $i++)
+ {
+ // Oracle uses uppercase - we use lowercase
+ $str_val = $row[strtolower($ary_name[$i])];
+
+ if (preg_match('#char|text|bool|raw|clob#i', $ary_type[$i]))
+ {
+ $str_quote = '';
+ $str_empty = "''";
+ $str_val = sanitize_data_oracle($str_val);
+ }
+ else if (preg_match('#date|timestamp#i', $ary_type[$i]))
+ {
+ if (empty($str_val))
+ {
+ $str_quote = '';
+ }
+ else
+ {
+ $str_quote = "'";
+ }
+ }
+ else
+ {
+ $str_quote = '';
+ $str_empty = 'NULL';
+ }
+
+ if (empty($str_val) && $str_val !== '0')
+ {
+ $str_val = $str_empty;
+ }
+
+ $schema_vals[$i] = $str_quote . $str_val . $str_quote;
+ $schema_fields[$i] = '"' . $ary_name[$i] . '"';
+ }
+
+ // Take the ordered fields and their associated data and build it
+ // into a valid sql statement to recreate that field in the data.
+ $sql_data = "INSERT INTO $table_name (" . implode(', ', $schema_fields) . ') VALUES (' . implode(', ', $schema_vals) . ")\n/\n";
+
+ $this->flush($sql_data);
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write_start($table_prefix)
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ $sql_data = "--\n";
+ $sql_data .= "-- phpBB Backup Script\n";
+ $sql_data .= "-- Dump of tables for $table_prefix\n";
+ $sql_data .= "-- DATE : " . gmdate("d-m-Y H:i:s", $this->time) . " GMT\n";
+ $sql_data .= "--\n";
+ $this->flush($sql_data);
+ }
+}
diff --git a/phpBB/phpbb/db/extractor/postgres_extractor.php b/phpBB/phpbb/db/extractor/postgres_extractor.php
new file mode 100644
index 0000000000..a98e39621c
--- /dev/null
+++ b/phpBB/phpbb/db/extractor/postgres_extractor.php
@@ -0,0 +1,339 @@
+<?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\extractor;
+
+use phpbb\db\extractor\exception\extractor_not_initialized_exception;
+
+class postgres_extractor extends base_extractor
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function write_start($table_prefix)
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ $sql_data = "--\n";
+ $sql_data .= "-- phpBB Backup Script\n";
+ $sql_data .= "-- Dump of tables for $table_prefix\n";
+ $sql_data .= "-- DATE : " . gmdate("d-m-Y H:i:s", $this->time) . " GMT\n";
+ $sql_data .= "--\n";
+ $sql_data .= "BEGIN TRANSACTION;\n";
+ $this->flush($sql_data);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write_table($table_name)
+ {
+ static $domains_created = array();
+
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ $sql = "SELECT a.domain_name, a.data_type, a.character_maximum_length, a.domain_default
+ FROM INFORMATION_SCHEMA.domains a, INFORMATION_SCHEMA.column_domain_usage b
+ WHERE a.domain_name = b.domain_name
+ AND b.table_name = '{$table_name}'";
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (empty($domains_created[$row['domain_name']]))
+ {
+ $domains_created[$row['domain_name']] = true;
+ //$sql_data = "DROP DOMAIN {$row['domain_name']};\n";
+ $sql_data = "CREATE DOMAIN {$row['domain_name']} as {$row['data_type']}";
+ if (!empty($row['character_maximum_length']))
+ {
+ $sql_data .= '(' . $row['character_maximum_length'] . ')';
+ }
+ $sql_data .= ' NOT NULL';
+ if (!empty($row['domain_default']))
+ {
+ $sql_data .= ' DEFAULT ' . $row['domain_default'];
+ }
+ $this->flush($sql_data . ";\n");
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ $sql_data = '-- Table: ' . $table_name . "\n";
+ $sql_data .= "DROP TABLE $table_name;\n";
+ // PGSQL does not "tightly" bind sequences and tables, we must guess...
+ $sql = "SELECT relname
+ FROM pg_class
+ WHERE relkind = 'S'
+ AND relname = '{$table_name}_seq'";
+ $result = $this->db->sql_query($sql);
+ // We don't even care about storing the results. We already know the answer if we get rows back.
+ if ($this->db->sql_fetchrow($result))
+ {
+ $sql_data .= "DROP SEQUENCE {$table_name}_seq;\n";
+ $sql_data .= "CREATE SEQUENCE {$table_name}_seq;\n";
+ }
+ $this->db->sql_freeresult($result);
+
+ $field_query = "SELECT a.attnum, a.attname as field, t.typname as type, a.attlen as length, a.atttypmod as lengthvar, a.attnotnull as notnull
+ FROM pg_class c, pg_attribute a, pg_type t
+ WHERE c.relname = '" . $this->db->sql_escape($table_name) . "'
+ AND a.attnum > 0
+ AND a.attrelid = c.oid
+ AND a.atttypid = t.oid
+ ORDER BY a.attnum";
+ $result = $this->db->sql_query($field_query);
+
+ $sql_data .= "CREATE TABLE $table_name(\n";
+ $lines = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ // Get the data from the table
+ $sql_get_default = "SELECT pg_get_expr(d.adbin, d.adrelid) as rowdefault
+ FROM pg_attrdef d, pg_class c
+ WHERE (c.relname = '" . $this->db->sql_escape($table_name) . "')
+ AND (c.oid = d.adrelid)
+ AND d.adnum = " . $row['attnum'];
+ $def_res = $this->db->sql_query($sql_get_default);
+ $def_row = $this->db->sql_fetchrow($def_res);
+ $this->db->sql_freeresult($def_res);
+
+ if (empty($def_row))
+ {
+ unset($row['rowdefault']);
+ }
+ else
+ {
+ $row['rowdefault'] = $def_row['rowdefault'];
+ }
+
+ if ($row['type'] == 'bpchar')
+ {
+ // Internally stored as bpchar, but isn't accepted in a CREATE TABLE statement.
+ $row['type'] = 'char';
+ }
+
+ $line = ' ' . $row['field'] . ' ' . $row['type'];
+
+ if (strpos($row['type'], 'char') !== false)
+ {
+ if ($row['lengthvar'] > 0)
+ {
+ $line .= '(' . ($row['lengthvar'] - 4) . ')';
+ }
+ }
+
+ if (strpos($row['type'], 'numeric') !== false)
+ {
+ $line .= '(';
+ $line .= sprintf("%s,%s", (($row['lengthvar'] >> 16) & 0xffff), (($row['lengthvar'] - 4) & 0xffff));
+ $line .= ')';
+ }
+
+ if (isset($row['rowdefault']))
+ {
+ $line .= ' DEFAULT ' . $row['rowdefault'];
+ }
+
+ if ($row['notnull'] == 't')
+ {
+ $line .= ' NOT NULL';
+ }
+
+ $lines[] = $line;
+ }
+ $this->db->sql_freeresult($result);
+
+ // Get the listing of primary keys.
+ $sql_pri_keys = "SELECT ic.relname as index_name, bc.relname as tab_name, ta.attname as column_name, i.indisunique as unique_key, i.indisprimary as primary_key
+ FROM pg_class bc, pg_class ic, pg_index i, pg_attribute ta, pg_attribute ia
+ WHERE (bc.oid = i.indrelid)
+ AND (ic.oid = i.indexrelid)
+ AND (ia.attrelid = i.indexrelid)
+ AND (ta.attrelid = bc.oid)
+ AND (bc.relname = '" . $this->db->sql_escape($table_name) . "')
+ AND (ta.attrelid = i.indrelid)
+ AND (ta.attnum = i.indkey[ia.attnum-1])
+ ORDER BY index_name, tab_name, column_name";
+
+ $result = $this->db->sql_query($sql_pri_keys);
+
+ $index_create = $index_rows = $primary_key = array();
+
+ // We do this in two steps. It makes placing the comma easier
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if ($row['primary_key'] == 't')
+ {
+ $primary_key[] = $row['column_name'];
+ $primary_key_name = $row['index_name'];
+ }
+ else
+ {
+ // We have to store this all this info because it is possible to have a multi-column key...
+ // we can loop through it again and build the statement
+ $index_rows[$row['index_name']]['table'] = $table_name;
+ $index_rows[$row['index_name']]['unique'] = ($row['unique_key'] == 't') ? true : false;
+ $index_rows[$row['index_name']]['column_names'][] = $row['column_name'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ if (!empty($index_rows))
+ {
+ foreach ($index_rows as $idx_name => $props)
+ {
+ $index_create[] = 'CREATE ' . ($props['unique'] ? 'UNIQUE ' : '') . "INDEX $idx_name ON $table_name (" . implode(', ', $props['column_names']) . ");";
+ }
+ }
+
+ if (!empty($primary_key))
+ {
+ $lines[] = " CONSTRAINT $primary_key_name PRIMARY KEY (" . implode(', ', $primary_key) . ")";
+ }
+
+ // Generate constraint clauses for CHECK constraints
+ $sql_checks = "SELECT conname as index_name, consrc
+ FROM pg_constraint, pg_class bc
+ WHERE conrelid = bc.oid
+ AND bc.relname = '" . $this->db->sql_escape($table_name) . "'
+ AND NOT EXISTS (
+ SELECT *
+ FROM pg_constraint as c, pg_inherits as i
+ WHERE i.inhrelid = pg_constraint.conrelid
+ AND c.conname = pg_constraint.conname
+ AND c.consrc = pg_constraint.consrc
+ AND c.conrelid = i.inhparent
+ )";
+ $result = $this->db->sql_query($sql_checks);
+
+ // Add the constraints to the sql file.
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (!is_null($row['consrc']))
+ {
+ $lines[] = ' CONSTRAINT ' . $row['index_name'] . ' CHECK ' . $row['consrc'];
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ $sql_data .= implode(", \n", $lines);
+ $sql_data .= "\n);\n";
+
+ if (!empty($index_create))
+ {
+ $sql_data .= implode("\n", $index_create) . "\n\n";
+ }
+ $this->flush($sql_data);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write_data($table_name)
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ // Grab all of the data from current table.
+ $sql = "SELECT *
+ FROM $table_name";
+ $result = $this->db->sql_query($sql);
+
+ $i_num_fields = pg_num_fields($result);
+ $seq = '';
+
+ for ($i = 0; $i < $i_num_fields; $i++)
+ {
+ $ary_type[] = pg_field_type($result, $i);
+ $ary_name[] = pg_field_name($result, $i);
+
+ $sql = "SELECT pg_get_expr(d.adbin, d.adrelid) as rowdefault
+ FROM pg_attrdef d, pg_class c
+ WHERE (c.relname = '{$table_name}')
+ AND (c.oid = d.adrelid)
+ AND d.adnum = " . strval($i + 1);
+ $result2 = $this->db->sql_query($sql);
+ if ($row = $this->db->sql_fetchrow($result2))
+ {
+ // Determine if we must reset the sequences
+ if (strpos($row['rowdefault'], "nextval('") === 0)
+ {
+ $seq .= "SELECT SETVAL('{$table_name}_seq',(select case when max({$ary_name[$i]})>0 then max({$ary_name[$i]})+1 else 1 end FROM {$table_name}));\n";
+ }
+ }
+ }
+
+ $this->flush("COPY $table_name (" . implode(', ', $ary_name) . ') FROM stdin;' . "\n");
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $schema_vals = array();
+
+ // Build the SQL statement to recreate the data.
+ for ($i = 0; $i < $i_num_fields; $i++)
+ {
+ $str_val = $row[$ary_name[$i]];
+
+ if (preg_match('#char|text|bool|bytea#i', $ary_type[$i]))
+ {
+ $str_val = str_replace(array("\n", "\t", "\r", "\b", "\f", "\v"), array('\n', '\t', '\r', '\b', '\f', '\v'), addslashes($str_val));
+ $str_empty = '';
+ }
+ else
+ {
+ $str_empty = '\N';
+ }
+
+ if (empty($str_val) && $str_val !== '0')
+ {
+ $str_val = $str_empty;
+ }
+
+ $schema_vals[] = $str_val;
+ }
+
+ // Take the ordered fields and their associated data and build it
+ // into a valid sql statement to recreate that field in the data.
+ $this->flush(implode("\t", $schema_vals) . "\n");
+ }
+ $this->db->sql_freeresult($result);
+ $this->flush("\\.\n");
+
+ // Write out the sequence statements
+ $this->flush($seq);
+ }
+
+ /**
+ * Writes closing line(s) to database backup
+ *
+ * @return null
+ * @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor()
+ */
+ public function write_end()
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ $this->flush("COMMIT;\n");
+ parent::write_end();
+ }
+}
diff --git a/phpBB/phpbb/db/extractor/sqlite3_extractor.php b/phpBB/phpbb/db/extractor/sqlite3_extractor.php
new file mode 100644
index 0000000000..ce8da6a652
--- /dev/null
+++ b/phpBB/phpbb/db/extractor/sqlite3_extractor.php
@@ -0,0 +1,151 @@
+<?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\extractor;
+
+use phpbb\db\extractor\exception\extractor_not_initialized_exception;
+
+class sqlite3_extractor extends base_extractor
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function write_start($table_prefix)
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ $sql_data = "--\n";
+ $sql_data .= "-- phpBB Backup Script\n";
+ $sql_data .= "-- Dump of tables for $table_prefix\n";
+ $sql_data .= "-- DATE : " . gmdate("d-m-Y H:i:s", $this->time) . " GMT\n";
+ $sql_data .= "--\n";
+ $sql_data .= "BEGIN TRANSACTION;\n";
+ $this->flush($sql_data);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write_table($table_name)
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ $sql_data = '-- Table: ' . $table_name . "\n";
+ $sql_data .= "DROP TABLE $table_name;\n";
+
+ $sql = "SELECT sql
+ FROM sqlite_master
+ WHERE type = 'table'
+ AND name = '" . $this->db->sql_escape($table_name) . "'
+ ORDER BY name ASC;";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ // Create Table
+ $sql_data .= $row['sql'] . ";\n";
+
+ $result = $this->db->sql_query("PRAGMA index_list('" . $this->db->sql_escape($table_name) . "');");
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (strpos($row['name'], 'autoindex') !== false)
+ {
+ continue;
+ }
+
+ $result2 = $this->db->sql_query("PRAGMA index_info('" . $this->db->sql_escape($row['name']) . "');");
+
+ $fields = array();
+ while ($row2 = $this->db->sql_fetchrow($result2))
+ {
+ $fields[] = $row2['name'];
+ }
+ $this->db->sql_freeresult($result2);
+
+ $sql_data .= 'CREATE ' . ($row['unique'] ? 'UNIQUE ' : '') . 'INDEX ' . $row['name'] . ' ON ' . $table_name . ' (' . implode(', ', $fields) . ");\n";
+ }
+ $this->db->sql_freeresult($result);
+
+ $this->flush($sql_data . "\n");
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write_data($table_name)
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ $result = $this->db->sql_query("PRAGMA table_info('" . $this->db->sql_escape($table_name) . "');");
+
+ $col_types = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $col_types[$row['name']] = $row['type'];
+ }
+ $this->db->sql_freeresult($result);
+
+ $sql_insert = 'INSERT INTO ' . $table_name . ' (' . implode(', ', array_keys($col_types)) . ') VALUES (';
+
+ $sql = "SELECT *
+ FROM $table_name";
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ foreach ($row as $column_name => $column_data)
+ {
+ if (is_null($column_data))
+ {
+ $row[$column_name] = 'NULL';
+ }
+ else if ($column_data === '')
+ {
+ $row[$column_name] = "''";
+ }
+ else if (stripos($col_types[$column_name], 'text') !== false || stripos($col_types[$column_name], 'char') !== false || stripos($col_types[$column_name], 'blob') !== false)
+ {
+ $row[$column_name] = sanitize_data_generic(str_replace("'", "''", $column_data));
+ }
+ }
+ $this->flush($sql_insert . implode(', ', $row) . ");\n");
+ }
+ }
+
+ /**
+ * Writes closing line(s) to database backup
+ *
+ * @return null
+ * @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor()
+ */
+ public function write_end()
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ $this->flush("COMMIT;\n");
+ parent::write_end();
+ }
+}
diff --git a/phpBB/phpbb/db/extractor/sqlite_extractor.php b/phpBB/phpbb/db/extractor/sqlite_extractor.php
new file mode 100644
index 0000000000..2734e23235
--- /dev/null
+++ b/phpBB/phpbb/db/extractor/sqlite_extractor.php
@@ -0,0 +1,149 @@
+<?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\extractor;
+
+use phpbb\db\extractor\exception\extractor_not_initialized_exception;
+
+class sqlite_extractor extends base_extractor
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function write_start($table_prefix)
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ $sql_data = "--\n";
+ $sql_data .= "-- phpBB Backup Script\n";
+ $sql_data .= "-- Dump of tables for $table_prefix\n";
+ $sql_data .= "-- DATE : " . gmdate("d-m-Y H:i:s", $this->time) . " GMT\n";
+ $sql_data .= "--\n";
+ $sql_data .= "BEGIN TRANSACTION;\n";
+ $this->flush($sql_data);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write_table($table_name)
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ $sql_data = '-- Table: ' . $table_name . "\n";
+ $sql_data .= "DROP TABLE $table_name;\n";
+
+ $sql = "SELECT sql
+ FROM sqlite_master
+ WHERE type = 'table'
+ AND name = '" . $this->db->sql_escape($table_name) . "'
+ ORDER BY type DESC, name;";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ // Create Table
+ $sql_data .= $row['sql'] . ";\n";
+
+ $result = $this->db->sql_query("PRAGMA index_list('" . $this->db->sql_escape($table_name) . "');");
+
+ $ar = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $ar[] = $row;
+ }
+ $this->db->sql_freeresult($result);
+
+ foreach ($ar as $value)
+ {
+ if (strpos($value['name'], 'autoindex') !== false)
+ {
+ continue;
+ }
+
+ $result = $this->db->sql_query("PRAGMA index_info('" . $this->db->sql_escape($value['name']) . "');");
+
+ $fields = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $fields[] = $row['name'];
+ }
+ $this->db->sql_freeresult($result);
+
+ $sql_data .= 'CREATE ' . ($value['unique'] ? 'UNIQUE ' : '') . 'INDEX ' . $value['name'] . ' on ' . $table_name . ' (' . implode(', ', $fields) . ");\n";
+ }
+
+ $this->flush($sql_data . "\n");
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function write_data($table_name)
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ $col_types = sqlite_fetch_column_types($this->db->get_db_connect_id(), $table_name);
+
+ $sql = "SELECT *
+ FROM $table_name";
+ $result = sqlite_unbuffered_query($this->db->get_db_connect_id(), $sql);
+ $rows = sqlite_fetch_all($result, SQLITE_ASSOC);
+ $sql_insert = 'INSERT INTO ' . $table_name . ' (' . implode(', ', array_keys($col_types)) . ') VALUES (';
+ foreach ($rows as $row)
+ {
+ foreach ($row as $column_name => $column_data)
+ {
+ if (is_null($column_data))
+ {
+ $row[$column_name] = 'NULL';
+ }
+ else if ($column_data == '')
+ {
+ $row[$column_name] = "''";
+ }
+ else if (strpos($col_types[$column_name], 'text') !== false || strpos($col_types[$column_name], 'char') !== false || strpos($col_types[$column_name], 'blob') !== false)
+ {
+ $row[$column_name] = sanitize_data_generic(str_replace("'", "''", $column_data));
+ }
+ }
+ $this->flush($sql_insert . implode(', ', $row) . ");\n");
+ }
+ }
+
+ /**
+ * Writes closing line(s) to database backup
+ *
+ * @return null
+ * @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor()
+ */
+ public function write_end()
+ {
+ if (!$this->is_initialized)
+ {
+ throw new extractor_not_initialized_exception();
+ }
+
+ $this->flush("COMMIT;\n");
+ parent::write_end();
+ }
+}
diff --git a/phpBB/phpbb/db/log_wrapper_migrator_output_handler.php b/phpBB/phpbb/db/log_wrapper_migrator_output_handler.php
index 94c293dc45..4c85bf4d67 100644
--- a/phpBB/phpbb/db/log_wrapper_migrator_output_handler.php
+++ b/phpBB/phpbb/db/log_wrapper_migrator_output_handler.php
@@ -38,16 +38,23 @@ class log_wrapper_migrator_output_handler implements migrator_output_handler_int
protected $file_handle = false;
/**
+ * @var \phpbb\filesystem\filesystem_interface
+ */
+ protected $filesystem;
+
+ /**
* Constructor
*
* @param user $user User object
* @param migrator_output_handler_interface $migrator Migrator output handler
* @param string $log_file File to log to
+ * @param \phpbb\filesystem\filesystem_interface phpBB filesystem object
*/
- public function __construct(user $user, migrator_output_handler_interface $migrator, $log_file)
+ public function __construct(user $user, migrator_output_handler_interface $migrator, $log_file, \phpbb\filesystem\filesystem_interface $filesystem)
{
$this->user = $user;
$this->migrator = $migrator;
+ $this->filesystem = $filesystem;
$this->file_open($log_file);
}
@@ -58,7 +65,7 @@ class log_wrapper_migrator_output_handler implements migrator_output_handler_int
*/
protected function file_open($file)
{
- if (phpbb_is_writable(dirname($file)))
+ if ($this->filesystem->is_writable(dirname($file)))
{
$this->file_handle = fopen($file, 'w');
}
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 003ccf8f18..9f6e3efb91 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
@@ -57,7 +57,9 @@ class release_3_0_5_rc1 extends container_aware_migration
public function hash_old_passwords()
{
+ /* @var $passwords_manager \phpbb\passwords\manager */
$passwords_manager = $this->container->get('passwords.manager');
+
$sql = 'SELECT user_id, user_password
FROM ' . $this->table_prefix . 'users
WHERE user_pass_convert = 1';
diff --git a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php
index 06e46d522f..5f928df47c 100644
--- a/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php
+++ b/phpBB/phpbb/db/migration/data/v30x/release_3_0_9_rc1.php
@@ -34,7 +34,7 @@ class release_3_0_9_rc1 extends \phpbb\db\migration\migration
// this column was removed from the database updater
// after 3.0.9-RC3 was released. It might still exist
// in 3.0.9-RCX installations and has to be dropped as
- // soon as the db_tools class is capable of properly
+ // soon as the \phpbb\db\tools\tools class is capable of properly
// removing a primary key.
// 'attempt_id' => array('UINT', NULL, 'auto_increment'),
'attempt_ip' => array('VCHAR:40', ''),
diff --git a/phpBB/phpbb/db/migration/data/v310/acp_prune_users_module.php b/phpBB/phpbb/db/migration/data/v310/acp_prune_users_module.php
index 0ca4f2f19c..725c57ca86 100644
--- a/phpBB/phpbb/db/migration/data/v310/acp_prune_users_module.php
+++ b/phpBB/phpbb/db/migration/data/v310/acp_prune_users_module.php
@@ -13,7 +13,7 @@
namespace phpbb\db\migration\data\v310;
-class acp_prune_users_module extends \phpbb\db\migration\migration
+class acp_prune_users_module extends \phpbb\db\migration\container_aware_migration
{
public function effectively_installed()
{
@@ -70,12 +70,7 @@ class acp_prune_users_module extends \phpbb\db\migration\migration
$acp_cat_users_id = (int) $this->db->sql_fetchfield('module_id');
$this->db->sql_freeresult($result);
- if (!class_exists('\acp_modules'))
- {
- include($this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext);
- }
- $module_manager = new \acp_modules();
- $module_manager->module_class = 'acp';
- $module_manager->move_module($acp_prune_users_id, $acp_cat_users_id);
+ $module_manager = $this->container->get('module.manager');
+ $module_manager->move_module($acp_prune_users_id, $acp_cat_users_id, 'acp');
}
}
diff --git a/phpBB/phpbb/db/migration/data/v310/dev.php b/phpBB/phpbb/db/migration/data/v310/dev.php
index f037191c2a..250258eea7 100644
--- a/phpBB/phpbb/db/migration/data/v310/dev.php
+++ b/phpBB/phpbb/db/migration/data/v310/dev.php
@@ -13,7 +13,7 @@
namespace phpbb\db\migration\data\v310;
-class dev extends \phpbb\db\migration\migration
+class dev extends \phpbb\db\migration\container_aware_migration
{
public function effectively_installed()
{
@@ -204,18 +204,13 @@ class dev extends \phpbb\db\migration\migration
$language_management_module_id = $this->db->sql_fetchfield('module_id');
$this->db->sql_freeresult($result);
- if (!class_exists('acp_modules'))
- {
- include($this->phpbb_root_path . 'includes/acp/acp_modules.' . $this->php_ext);
- }
// acp_modules calls adm_back_link, which is undefined at this point
if (!function_exists('adm_back_link'))
{
include($this->phpbb_root_path . 'includes/functions_acp.' . $this->php_ext);
}
- $module_manager = new \acp_modules();
- $module_manager->module_class = 'acp';
- $module_manager->move_module($language_module_id, $language_management_module_id);
+ $module_manager = $this->container->get('module.manager');
+ $module_manager->move_module($language_module_id, $language_management_module_id, 'acp');
}
public function update_ucp_pm_basename()
diff --git a/phpBB/phpbb/db/migration/data/v310/notifications_board.php b/phpBB/phpbb/db/migration/data/v310/notifications_board.php
new file mode 100644
index 0000000000..525d94e984
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v310/notifications_board.php
@@ -0,0 +1,73 @@
+<?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 notifications_board extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\notifications');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('allow_board_notifications', 1)),
+ array('custom', array(array($this, 'update_user_subscriptions'))),
+ array('custom', array(array($this, 'update_module'))),
+ );
+ }
+
+ public function update_module()
+ {
+ $sql = 'UPDATE ' . MODULES_TABLE . "
+ SET auth = 'cfg_allow_board_notifications'
+ WHERE module_basename = 'ucp_notifications'
+ AND module_mode = 'notification_list'";
+ $this->sql_query($sql);
+ }
+
+ public function update_user_subscriptions()
+ {
+ $sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . "
+ SET method = 'notification.method.board'
+ WHERE method = ''";
+ $this->sql_query($sql);
+ }
+
+ public function revert_data()
+ {
+ return array(
+ array('custom', array(array($this, 'revert_user_subscriptions'))),
+ array('custom', array(array($this, 'revert_module'))),
+ );
+ }
+
+ public function revert_user_subscriptions()
+ {
+ $sql = 'UPDATE ' . USER_NOTIFICATIONS_TABLE . "
+ SET method = ''
+ WHERE method = 'notification.method.board'";
+ $this->sql_query($sql);
+ }
+
+ public function revert_module()
+ {
+ $sql = 'UPDATE ' . MODULES_TABLE . "
+ SET auth = ''
+ WHERE module_basename = 'ucp_notifications'
+ AND module_mode = 'notification_list'";
+ $this->sql_query($sql);
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v320/allowed_schemes_links.php b/phpBB/phpbb/db/migration/data/v320/allowed_schemes_links.php
new file mode 100644
index 0000000000..de127e3745
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v320/allowed_schemes_links.php
@@ -0,0 +1,24 @@
+<?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\v320;
+
+class allowed_schemes_links extends \phpbb\db\migration\migration
+{
+ public function update_data()
+ {
+ return array(
+ array('config.add', array('allowed_schemes_links', 'http,https,ftp')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v320/announce_global_permission.php b/phpBB/phpbb/db/migration/data/v320/announce_global_permission.php
new file mode 100644
index 0000000000..fe30a1c1b8
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v320/announce_global_permission.php
@@ -0,0 +1,41 @@
+<?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\v320;
+
+class announce_global_permission extends \phpbb\db\migration\migration
+{
+ public function effectively_installed()
+ {
+ $sql = 'SELECT auth_option_id
+ FROM ' . ACL_OPTIONS_TABLE . "
+ WHERE auth_option = 'f_announce_global'";
+ $result = $this->db->sql_query($sql);
+ $auth_option_id = $this->db->sql_fetchfield('auth_option_id');
+ $this->db->sql_freeresult($result);
+
+ return $auth_option_id !== false;
+ }
+
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\rc2');
+ }
+
+ public function update_data()
+ {
+ return array(
+ array('permission.add', array('f_announce_global', false, 'f_announce')),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v320/log_post_id.php b/phpBB/phpbb/db/migration/data/v320/log_post_id.php
new file mode 100644
index 0000000000..0f155d543c
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v320/log_post_id.php
@@ -0,0 +1,44 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\db\migration\data\v320;
+
+class log_post_id extends \phpbb\db\migration\migration
+{
+ static public function depends_on()
+ {
+ return array('\phpbb\db\migration\data\v310\dev');
+ }
+
+ public function update_schema()
+ {
+ return array(
+ 'add_columns' => array(
+ $this->table_prefix . 'log' => array(
+ 'post_id' => array('UINT', 0, 'after' => 'topic_id'),
+ ),
+ ),
+ );
+ }
+
+ public function revert_schema()
+ {
+ return array(
+ 'drop_columns' => array(
+ $this->table_prefix . 'log' => array(
+ 'post_id',
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php b/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php
new file mode 100644
index 0000000000..59208be4dc
--- /dev/null
+++ b/phpBB/phpbb/db/migration/data/v320/remove_outdated_media.php
@@ -0,0 +1,83 @@
+<?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\v320;
+
+class remove_outdated_media extends \phpbb\db\migration\migration
+{
+ protected $cat_id = array(
+ ATTACHMENT_CATEGORY_WM,
+ ATTACHMENT_CATEGORY_RM,
+ ATTACHMENT_CATEGORY_QUICKTIME,
+ );
+
+ public function update_data()
+ {
+ return array(
+ array('custom', array(array($this, 'change_extension_group'))),
+ );
+ }
+
+ public function change_extension_group()
+ {
+ // select group ids of outdated media
+ $sql = 'SELECT group_id
+ FROM ' . EXTENSION_GROUPS_TABLE . '
+ WHERE ' . $this->db->sql_in_set('cat_id', $this->cat_id);
+ $result = $this->db->sql_query($sql);
+
+ $group_ids = array();
+ while ($group_id = (int) $this->db->sql_fetchfield('group_id'))
+ {
+ $group_ids[] = $group_id;
+ }
+ $this->db->sql_freeresult($result);
+
+ // nothing to do, admin has removed all the outdated media extension groups
+ if (empty($group_ids))
+ {
+ return true;
+ }
+
+ // get the group id of downloadable files
+ $sql = 'SELECT group_id
+ FROM ' . EXTENSION_GROUPS_TABLE . "
+ WHERE group_name = 'DOWNLOADABLE_FILES'";
+ $result = $this->db->sql_query($sql);
+ $download_id = (int) $this->db->sql_fetchfield('group_id');
+ $this->db->sql_freeresult($result);
+
+ if (empty($download_id))
+ {
+ $sql = 'UPDATE ' . EXTENSIONS_TABLE . '
+ SET group_id = 0
+ WHERE ' . $this->db->sql_in_set('group_id', $group_ids);
+ }
+ else
+ {
+ // move outdated media extensions to downloadable files
+ $sql = 'UPDATE ' . EXTENSIONS_TABLE . "
+ SET group_id = $download_id" . '
+ WHERE ' . $this->db->sql_in_set('group_id', $group_ids);
+ }
+
+ $result = $this->db->sql_query($sql);
+ $this->db->sql_freeresult($result);
+
+ // delete the now empty, outdated media extension groups
+ $sql = 'DELETE FROM ' . EXTENSION_GROUPS_TABLE . '
+ WHERE ' . $this->db->sql_in_set('group_id', $group_ids);
+ $result = $this->db->sql_query($sql);
+ $this->db->sql_freeresult($result);
+ }
+}
diff --git a/phpBB/phpbb/db/migration/migration.php b/phpBB/phpbb/db/migration/migration.php
index 5f120333e1..2304c8e44c 100644
--- a/phpBB/phpbb/db/migration/migration.php
+++ b/phpBB/phpbb/db/migration/migration.php
@@ -28,7 +28,7 @@ abstract class migration
/** @var \phpbb\db\driver\driver_interface */
protected $db;
- /** @var \phpbb\db\tools */
+ /** @var \phpbb\db\tools\tools_interface */
protected $db_tools;
/** @var string */
@@ -51,12 +51,12 @@ abstract class migration
*
* @param \phpbb\config\config $config
* @param \phpbb\db\driver\driver_interface $db
- * @param \phpbb\db\tools $db_tools
+ * @param \phpbb\db\tools\tools_interface $db_tools
* @param string $phpbb_root_path
* @param string $php_ext
* @param string $table_prefix
*/
- public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\db\tools $db_tools, $phpbb_root_path, $php_ext, $table_prefix)
+ public function __construct(\phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\db\tools\tools_interface $db_tools, $phpbb_root_path, $php_ext, $table_prefix)
{
$this->config = $config;
$this->db = $db;
diff --git a/phpBB/phpbb/db/migration/profilefield_base_migration.php b/phpBB/phpbb/db/migration/profilefield_base_migration.php
index da1a38e2fa..3f26a4998c 100644
--- a/phpBB/phpbb/db/migration/profilefield_base_migration.php
+++ b/phpBB/phpbb/db/migration/profilefield_base_migration.php
@@ -237,6 +237,7 @@ abstract class profilefield_base_migration extends container_aware_migration
if ($profile_row === null)
{
+ /* @var $manager \phpbb\profilefields\manager */
$manager = $this->container->get('profilefields.manager');
$profile_row = $manager->build_insert_sql_array(array());
}
diff --git a/phpBB/phpbb/db/migration/schema_generator.php b/phpBB/phpbb/db/migration/schema_generator.php
index 91d8307d91..7003844bc4 100644
--- a/phpBB/phpbb/db/migration/schema_generator.php
+++ b/phpBB/phpbb/db/migration/schema_generator.php
@@ -24,7 +24,7 @@ class schema_generator
/** @var \phpbb\db\driver\driver_interface */
protected $db;
- /** @var \phpbb\db\tools */
+ /** @var \phpbb\db\tools\tools_interface */
protected $db_tools;
/** @var array */
@@ -48,7 +48,7 @@ class schema_generator
/**
* Constructor
*/
- public function __construct(array $class_names, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\db\tools $db_tools, $phpbb_root_path, $php_ext, $table_prefix)
+ public function __construct(array $class_names, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\db\tools\tools_interface $db_tools, $phpbb_root_path, $php_ext, $table_prefix)
{
$this->config = $config;
$this->db = $db;
diff --git a/phpBB/phpbb/db/migration/tool/module.php b/phpBB/phpbb/db/migration/tool/module.php
index 035625b095..69ac71abb7 100644
--- a/phpBB/phpbb/db/migration/tool/module.php
+++ b/phpBB/phpbb/db/migration/tool/module.php
@@ -13,6 +13,8 @@
namespace phpbb\db\migration\tool;
+use phpbb\module\exception\module_exception;
+
/**
* Migration module management tool
*/
@@ -27,6 +29,9 @@ class module implements \phpbb\db\migration\tool\tool_interface
/** @var \phpbb\user */
protected $user;
+ /** @var \phpbb\module\module_manager */
+ protected $module_manager;
+
/** @var string */
protected $phpbb_root_path;
@@ -42,15 +47,17 @@ class module implements \phpbb\db\migration\tool\tool_interface
* @param \phpbb\db\driver\driver_interface $db
* @param \phpbb\cache\service $cache
* @param \phpbb\user $user
+ * @param \phpbb\module\module_manager $module_manager
* @param string $phpbb_root_path
* @param string $php_ext
* @param string $modules_table
*/
- public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, \phpbb\user $user, $phpbb_root_path, $php_ext, $modules_table)
+ public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, \phpbb\user $user, \phpbb\module\module_manager $module_manager, $phpbb_root_path, $php_ext, $modules_table)
{
$this->db = $db;
$this->cache = $cache;
$this->user = $user;
+ $this->module_manager = $module_manager;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
$this->modules_table = $modules_table;
@@ -171,6 +178,8 @@ class module implements \phpbb\db\migration\tool\tool_interface
*/
public function add($class, $parent = 0, $data = array())
{
+ global $user, $phpbb_log;
+
// Allows '' to be sent as 0
$parent = $parent ?: 0;
@@ -186,7 +195,6 @@ class module implements \phpbb\db\migration\tool\tool_interface
$basename = (isset($data['module_basename'])) ? $data['module_basename'] : '';
$module = $this->get_module_info($class, $basename);
- $result = '';
foreach ($module['modes'] as $mode => $module_info)
{
if (!isset($data['modes']) || in_array($mode, $data['modes']))
@@ -237,13 +245,6 @@ class module implements \phpbb\db\migration\tool\tool_interface
return;
}
- 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_data = array(
'module_enabled' => (isset($data['module_enabled'])) ? $data['module_enabled'] : 1,
'module_display' => (isset($data['module_display'])) ? $data['module_display'] : 1,
@@ -254,19 +255,14 @@ class module implements \phpbb\db\migration\tool\tool_interface
'module_mode' => (isset($data['module_mode'])) ? $data['module_mode'] : '',
'module_auth' => (isset($data['module_auth'])) ? $data['module_auth'] : '',
);
- $result = $acp_modules->update_module_data($module_data, true);
- // update_module_data can either return a string or an empty array...
- if (is_string($result))
- {
- // Error
- throw new \phpbb\db\migration\exception('MODULE_ERROR', $result);
- }
- else
+ try
{
+ $this->module_manager->update_module_data($module_data);
+
// Success
$module_log_name = ((isset($this->user->lang[$data['module_langname']])) ? $this->user->lang[$data['module_langname']] : $data['module_langname']);
- add_log('admin', 'LOG_MODULE_ADD', $module_log_name);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_MODULE_ADD', false, array($module_log_name));
// Move the module if requested above/below an existing one
if (isset($data['before']) && $data['before'])
@@ -316,6 +312,11 @@ class module implements \phpbb\db\migration\tool\tool_interface
$this->db->sql_query($sql);
}
}
+ catch (module_exception $e)
+ {
+ // Error
+ throw new \phpbb\db\migration\exception('MODULE_ERROR', $e->getMessage());
+ }
// Clear the Modules Cache
$this->cache->destroy("_modules_$class");
@@ -415,21 +416,9 @@ class module implements \phpbb\db\migration\tool\tool_interface
$module_ids[] = (int) $module;
}
- 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();
- $acp_modules->module_class = $class;
-
foreach ($module_ids as $module_id)
{
- $result = $acp_modules->delete_module($module_id);
- if (!empty($result))
- {
- return;
- }
+ $this->module_manager->delete_module($module_id, $class);
}
$this->cache->destroy("_modules_$class");
@@ -472,13 +461,7 @@ class module implements \phpbb\db\migration\tool\tool_interface
*/
protected function get_module_info($class, $basename)
{
- 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);
+ $module = $this->module_manager->get_module_infos($class, $basename, true);
if (empty($module))
{
diff --git a/phpBB/phpbb/db/migrator.php b/phpBB/phpbb/db/migrator.php
index 7fc3e787e2..6902913c64 100644
--- a/phpBB/phpbb/db/migrator.php
+++ b/phpBB/phpbb/db/migrator.php
@@ -32,7 +32,7 @@ class migrator
/** @var \phpbb\db\driver\driver_interface */
protected $db;
- /** @var \phpbb\db\tools */
+ /** @var \phpbb\db\tools\tools_interface */
protected $db_tools;
/** @var \phpbb\db\migration\helper */
@@ -92,7 +92,7 @@ class migrator
/**
* Constructor of the database migrator
*/
- 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)
+ public function __construct(ContainerInterface $container, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\db\tools\tools_interface $db_tools, $migrations_table, $phpbb_root_path, $php_ext, $table_prefix, $tools, \phpbb\db\migration\helper $helper)
{
$this->container = $container;
$this->config = $config;
diff --git a/phpBB/phpbb/db/tools/factory.php b/phpBB/phpbb/db/tools/factory.php
new file mode 100644
index 0000000000..d204451a63
--- /dev/null
+++ b/phpBB/phpbb/db/tools/factory.php
@@ -0,0 +1,43 @@
+<?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\tools;
+
+/**
+ * A factory which serves the suitable tools instance for the given dbal
+ */
+class factory
+{
+ /**
+ * @param mixed $db_driver
+ * @param bool $return_statements
+ * @return \phpbb\db\tools\tools_interface
+ */
+ public function get($db_driver, $return_statements = false)
+ {
+ if ($db_driver instanceof \phpbb\db\driver\mssql || $db_driver instanceof \phpbb\db\driver\mssql_base)
+ {
+ return new \phpbb\db\tools\mssql($db_driver, $return_statements);
+ }
+ else if ($db_driver instanceof \phpbb\db\driver\postgres)
+ {
+ return new \phpbb\db\tools\postgres($db_driver, $return_statements);
+ }
+ else if ($db_driver instanceof \phpbb\db\driver\driver_interface)
+ {
+ return new \phpbb\db\tools\tools($db_driver, $return_statements);
+ }
+
+ throw new \InvalidArgumentException('Invalid database driver given');
+ }
+}
diff --git a/phpBB/phpbb/db/tools/mssql.php b/phpBB/phpbb/db/tools/mssql.php
new file mode 100644
index 0000000000..6e58171040
--- /dev/null
+++ b/phpBB/phpbb/db/tools/mssql.php
@@ -0,0 +1,793 @@
+<?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\tools;
+
+/**
+ * Database Tools for handling cross-db actions such as altering columns, etc.
+ * Currently not supported is returning SQL for creating tables.
+ */
+class mssql extends tools
+{
+ /**
+ * Is the used MS SQL Server a SQL Server 2000?
+ * @var bool
+ */
+ protected $is_sql_server_2000;
+
+ /**
+ * Get the column types for mssql based databases
+ *
+ * @return array
+ */
+ public static function get_dbms_type_map()
+ {
+ return array(
+ 'mssql' => array(
+ 'INT:' => '[int]',
+ 'BINT' => '[float]',
+ 'UINT' => '[int]',
+ 'UINT:' => '[int]',
+ 'TINT:' => '[int]',
+ 'USINT' => '[int]',
+ 'BOOL' => '[int]',
+ 'VCHAR' => '[varchar] (255)',
+ 'VCHAR:' => '[varchar] (%d)',
+ 'CHAR:' => '[char] (%d)',
+ 'XSTEXT' => '[varchar] (1000)',
+ 'STEXT' => '[varchar] (3000)',
+ 'TEXT' => '[varchar] (8000)',
+ 'MTEXT' => '[text]',
+ 'XSTEXT_UNI'=> '[varchar] (100)',
+ 'STEXT_UNI' => '[varchar] (255)',
+ 'TEXT_UNI' => '[varchar] (4000)',
+ 'MTEXT_UNI' => '[text]',
+ 'TIMESTAMP' => '[int]',
+ 'DECIMAL' => '[float]',
+ 'DECIMAL:' => '[float]',
+ 'PDECIMAL' => '[float]',
+ 'PDECIMAL:' => '[float]',
+ 'VCHAR_UNI' => '[varchar] (255)',
+ 'VCHAR_UNI:'=> '[varchar] (%d)',
+ 'VCHAR_CI' => '[varchar] (255)',
+ 'VARBINARY' => '[varchar] (255)',
+ ),
+
+ 'mssqlnative' => array(
+ 'INT:' => '[int]',
+ 'BINT' => '[float]',
+ 'UINT' => '[int]',
+ 'UINT:' => '[int]',
+ 'TINT:' => '[int]',
+ 'USINT' => '[int]',
+ 'BOOL' => '[int]',
+ 'VCHAR' => '[varchar] (255)',
+ 'VCHAR:' => '[varchar] (%d)',
+ 'CHAR:' => '[char] (%d)',
+ 'XSTEXT' => '[varchar] (1000)',
+ 'STEXT' => '[varchar] (3000)',
+ 'TEXT' => '[varchar] (8000)',
+ 'MTEXT' => '[text]',
+ 'XSTEXT_UNI'=> '[varchar] (100)',
+ 'STEXT_UNI' => '[varchar] (255)',
+ 'TEXT_UNI' => '[varchar] (4000)',
+ 'MTEXT_UNI' => '[text]',
+ 'TIMESTAMP' => '[int]',
+ 'DECIMAL' => '[float]',
+ 'DECIMAL:' => '[float]',
+ 'PDECIMAL' => '[float]',
+ 'PDECIMAL:' => '[float]',
+ 'VCHAR_UNI' => '[varchar] (255)',
+ 'VCHAR_UNI:'=> '[varchar] (%d)',
+ 'VCHAR_CI' => '[varchar] (255)',
+ 'VARBINARY' => '[varchar] (255)',
+ ),
+ );
+ }
+
+ /**
+ * Constructor. Set DB Object and set {@link $return_statements return_statements}.
+ *
+ * @param \phpbb\db\driver\driver_interface $db Database connection
+ * @param bool $return_statements True if only statements should be returned and no SQL being executed
+ */
+ public function __construct(\phpbb\db\driver\driver_interface $db, $return_statements = false)
+ {
+ parent::__construct($db, $return_statements);
+
+ // Determine mapping database type
+ switch ($this->db->get_sql_layer())
+ {
+ case 'mssql':
+ case 'mssql_odbc':
+ $this->sql_layer = 'mssql';
+ break;
+
+ case 'mssqlnative':
+ $this->sql_layer = 'mssqlnative';
+ break;
+ }
+
+ $this->dbms_type_map = self::get_dbms_type_map();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_list_tables()
+ {
+ $sql = "SELECT name
+ FROM sysobjects
+ WHERE type='U'";
+ $result = $this->db->sql_query($sql);
+
+ $tables = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $name = current($row);
+ $tables[$name] = $name;
+ }
+ $this->db->sql_freeresult($result);
+
+ return $tables;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_create_table($table_name, $table_data)
+ {
+ // holds the DDL for a column
+ $columns = $statements = array();
+
+ if ($this->sql_table_exists($table_name))
+ {
+ return $this->_sql_run_sql($statements);
+ }
+
+ // Begin transaction
+ $statements[] = 'begin';
+
+ // Determine if we have created a PRIMARY KEY in the earliest
+ $primary_key_gen = false;
+
+ // Determine if the table requires a sequence
+ $create_sequence = false;
+
+ // Begin table sql statement
+ $table_sql = 'CREATE TABLE [' . $table_name . '] (' . "\n";
+
+ if (!isset($table_data['PRIMARY_KEY']))
+ {
+ $table_data['COLUMNS']['mssqlindex'] = array('UINT', null, 'auto_increment');
+ $table_data['PRIMARY_KEY'] = 'mssqlindex';
+ }
+
+ // Iterate through the columns to create a table
+ foreach ($table_data['COLUMNS'] as $column_name => $column_data)
+ {
+ // here lies an array, filled with information compiled on the column's data
+ $prepared_column = $this->sql_prepare_column_data($table_name, $column_name, $column_data);
+
+ if (isset($prepared_column['auto_increment']) && $prepared_column['auto_increment'] && strlen($column_name) > 26) // "${column_name}_gen"
+ {
+ trigger_error("Index name '${column_name}_gen' on table '$table_name' is too long. The maximum auto increment column length is 26 characters.", E_USER_ERROR);
+ }
+
+ // here we add the definition of the new column to the list of columns
+ $columns[] = "\t [{$column_name}] " . $prepared_column['column_type_sql_default'];
+
+ // see if we have found a primary key set due to a column definition if we have found it, we can stop looking
+ if (!$primary_key_gen)
+ {
+ $primary_key_gen = isset($prepared_column['primary_key_set']) && $prepared_column['primary_key_set'];
+ }
+
+ // create sequence DDL based off of the existance of auto incrementing columns
+ if (!$create_sequence && isset($prepared_column['auto_increment']) && $prepared_column['auto_increment'])
+ {
+ $create_sequence = $column_name;
+ }
+ }
+
+ // this makes up all the columns in the create table statement
+ $table_sql .= implode(",\n", $columns);
+
+ // Close the table for two DBMS and add to the statements
+ $table_sql .= "\n);";
+ $statements[] = $table_sql;
+
+ // we have yet to create a primary key for this table,
+ // this means that we can add the one we really wanted instead
+ if (!$primary_key_gen)
+ {
+ // Write primary key
+ if (isset($table_data['PRIMARY_KEY']))
+ {
+ if (!is_array($table_data['PRIMARY_KEY']))
+ {
+ $table_data['PRIMARY_KEY'] = array($table_data['PRIMARY_KEY']);
+ }
+
+ // We need the data here
+ $old_return_statements = $this->return_statements;
+ $this->return_statements = true;
+
+ $primary_key_stmts = $this->sql_create_primary_key($table_name, $table_data['PRIMARY_KEY']);
+ foreach ($primary_key_stmts as $pk_stmt)
+ {
+ $statements[] = $pk_stmt;
+ }
+
+ $this->return_statements = $old_return_statements;
+ }
+ }
+
+ // Write Keys
+ if (isset($table_data['KEYS']))
+ {
+ foreach ($table_data['KEYS'] as $key_name => $key_data)
+ {
+ if (!is_array($key_data[1]))
+ {
+ $key_data[1] = array($key_data[1]);
+ }
+
+ $old_return_statements = $this->return_statements;
+ $this->return_statements = true;
+
+ $key_stmts = ($key_data[0] == 'UNIQUE') ? $this->sql_create_unique_index($table_name, $key_name, $key_data[1]) : $this->sql_create_index($table_name, $key_name, $key_data[1]);
+
+ foreach ($key_stmts as $key_stmt)
+ {
+ $statements[] = $key_stmt;
+ }
+
+ $this->return_statements = $old_return_statements;
+ }
+ }
+
+ // Commit Transaction
+ $statements[] = 'commit';
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_list_columns($table_name)
+ {
+ $columns = array();
+
+ $sql = "SELECT c.name
+ FROM syscolumns c
+ LEFT JOIN sysobjects o ON c.id = o.id
+ WHERE o.name = '{$table_name}'";
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $column = strtolower(current($row));
+ $columns[$column] = $column;
+ }
+ $this->db->sql_freeresult($result);
+
+ return $columns;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_index_exists($table_name, $index_name)
+ {
+ $sql = "EXEC sp_statistics '$table_name'";
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if ($row['TYPE'] == 3)
+ {
+ if (strtolower($row['INDEX_NAME']) == strtolower($index_name))
+ {
+ $this->db->sql_freeresult($result);
+ return true;
+ }
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_unique_index_exists($table_name, $index_name)
+ {
+ $sql = "EXEC sp_statistics '$table_name'";
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ // Usually NON_UNIQUE is the column we want to check, but we allow for both
+ if ($row['TYPE'] == 3)
+ {
+ if (strtolower($row['INDEX_NAME']) == strtolower($index_name))
+ {
+ $this->db->sql_freeresult($result);
+ return true;
+ }
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_prepare_column_data($table_name, $column_name, $column_data)
+ {
+ if (strlen($column_name) > 30)
+ {
+ trigger_error("Column name '$column_name' on table '$table_name' is too long. The maximum is 30 characters.", E_USER_ERROR);
+ }
+
+ // Get type
+ list($column_type, ) = $this->get_column_type($column_data[0]);
+
+ // Adjust default value if db-dependent specified
+ if (is_array($column_data[1]))
+ {
+ $column_data[1] = (isset($column_data[1][$this->sql_layer])) ? $column_data[1][$this->sql_layer] : $column_data[1]['default'];
+ }
+
+ $sql = '';
+
+ $return_array = array();
+
+ $sql .= " {$column_type} ";
+ $sql_default = " {$column_type} ";
+
+ // For adding columns we need the default definition
+ if (!is_null($column_data[1]))
+ {
+ // For hexadecimal values do not use single quotes
+ if (strpos($column_data[1], '0x') === 0)
+ {
+ $return_array['default'] = 'DEFAULT (' . $column_data[1] . ') ';
+ $sql_default .= $return_array['default'];
+ }
+ else
+ {
+ $return_array['default'] = 'DEFAULT (' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ') ';
+ $sql_default .= $return_array['default'];
+ }
+ }
+
+ if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
+ {
+ // $sql .= 'IDENTITY (1, 1) ';
+ $sql_default .= 'IDENTITY (1, 1) ';
+ }
+
+ $return_array['textimage'] = $column_type === '[text]';
+
+ if (!is_null($column_data[1]) || (isset($column_data[2]) && $column_data[2] == 'auto_increment'))
+ {
+ $sql .= 'NOT NULL';
+ $sql_default .= 'NOT NULL';
+ }
+ else
+ {
+ $sql .= 'NULL';
+ $sql_default .= 'NULL';
+ }
+
+ $return_array['column_type_sql_default'] = $sql_default;
+
+ $return_array['column_type_sql'] = $sql;
+
+ return $return_array;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_column_add($table_name, $column_name, $column_data, $inline = false)
+ {
+ $column_data = $this->sql_prepare_column_data($table_name, $column_name, $column_data);
+ $statements = array();
+
+ // Does not support AFTER, only through temporary table
+ $statements[] = 'ALTER TABLE [' . $table_name . '] ADD [' . $column_name . '] ' . $column_data['column_type_sql_default'];
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_column_remove($table_name, $column_name, $inline = false)
+ {
+ $statements = array();
+
+ // We need the data here
+ $old_return_statements = $this->return_statements;
+ $this->return_statements = true;
+
+ $indexes = $this->get_existing_indexes($table_name, $column_name);
+ $indexes = array_merge($indexes, $this->get_existing_indexes($table_name, $column_name, true));
+
+ // Drop any indexes
+ $recreate_indexes = array();
+ if (!empty($indexes))
+ {
+ foreach ($indexes as $index_name => $index_data)
+ {
+ $result = $this->sql_index_drop($table_name, $index_name);
+ $statements = array_merge($statements, $result);
+ if (sizeof($index_data) > 1)
+ {
+ // Remove this column from the index and recreate it
+ $recreate_indexes[$index_name] = array_diff($index_data, array($column_name));
+ }
+ }
+ }
+
+ // Drop default value constraint
+ $result = $this->mssql_get_drop_default_constraints_queries($table_name, $column_name);
+ $statements = array_merge($statements, $result);
+
+ // Remove the column
+ $statements[] = 'ALTER TABLE [' . $table_name . '] DROP COLUMN [' . $column_name . ']';
+
+ if (!empty($recreate_indexes))
+ {
+ // Recreate indexes after we removed the column
+ foreach ($recreate_indexes as $index_name => $index_data)
+ {
+ $result = $this->sql_create_index($table_name, $index_name, $index_data);
+ $statements = array_merge($statements, $result);
+ }
+ }
+
+ $this->return_statements = $old_return_statements;
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_index_drop($table_name, $index_name)
+ {
+ $statements = array();
+
+ $statements[] = 'DROP INDEX ' . $table_name . '.' . $index_name;
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_table_drop($table_name)
+ {
+ $statements = array();
+
+ if (!$this->sql_table_exists($table_name))
+ {
+ return $this->_sql_run_sql($statements);
+ }
+
+ // the most basic operation, get rid of the table
+ $statements[] = 'DROP TABLE ' . $table_name;
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_create_primary_key($table_name, $column, $inline = false)
+ {
+ $statements = array();
+
+ $sql = "ALTER TABLE [{$table_name}] WITH NOCHECK ADD ";
+ $sql .= "CONSTRAINT [PK_{$table_name}] PRIMARY KEY CLUSTERED (";
+ $sql .= '[' . implode("],\n\t\t[", $column) . ']';
+ $sql .= ')';
+
+ $statements[] = $sql;
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_create_unique_index($table_name, $index_name, $column)
+ {
+ $statements = array();
+
+ $this->check_index_name_length($table_name, $index_name);
+
+ $statements[] = 'CREATE UNIQUE INDEX [' . $index_name . '] ON [' . $table_name . ']([' . implode('], [', $column) . '])';
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_create_index($table_name, $index_name, $column)
+ {
+ $statements = array();
+
+ $this->check_index_name_length($table_name, $index_name);
+
+ // remove index length
+ $column = preg_replace('#:.*$#', '', $column);
+
+ $statements[] = 'CREATE INDEX [' . $index_name . '] ON [' . $table_name . ']([' . implode('], [', $column) . '])';
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_list_index($table_name)
+ {
+ $index_array = array();
+ $sql = "EXEC sp_statistics '$table_name'";
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if ($row['TYPE'] == 3)
+ {
+ $index_array[] = strtolower($row['INDEX_NAME']);
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ return $index_array;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_column_change($table_name, $column_name, $column_data, $inline = false)
+ {
+ $column_data = $this->sql_prepare_column_data($table_name, $column_name, $column_data);
+ $statements = array();
+
+ // We need the data here
+ $old_return_statements = $this->return_statements;
+ $this->return_statements = true;
+
+ $indexes = $this->get_existing_indexes($table_name, $column_name);
+ $unique_indexes = $this->get_existing_indexes($table_name, $column_name, true);
+
+ // Drop any indexes
+ if (!empty($indexes) || !empty($unique_indexes))
+ {
+ $drop_indexes = array_merge(array_keys($indexes), array_keys($unique_indexes));
+ foreach ($drop_indexes as $index_name)
+ {
+ $result = $this->sql_index_drop($table_name, $index_name);
+ $statements = array_merge($statements, $result);
+ }
+ }
+
+ // Drop default value constraint
+ $result = $this->mssql_get_drop_default_constraints_queries($table_name, $column_name);
+ $statements = array_merge($statements, $result);
+
+ // Change the column
+ $statements[] = 'ALTER TABLE [' . $table_name . '] ALTER COLUMN [' . $column_name . '] ' . $column_data['column_type_sql'];
+
+ if (!empty($column_data['default']))
+ {
+ // Add new default value constraint
+ $statements[] = 'ALTER TABLE [' . $table_name . '] ADD CONSTRAINT [DF_' . $table_name . '_' . $column_name . '_1] ' . $this->db->sql_escape($column_data['default']) . ' FOR [' . $column_name . ']';
+ }
+
+ if (!empty($indexes))
+ {
+ // Recreate indexes after we changed the column
+ foreach ($indexes as $index_name => $index_data)
+ {
+ $result = $this->sql_create_index($table_name, $index_name, $index_data);
+ $statements = array_merge($statements, $result);
+ }
+ }
+
+ if (!empty($unique_indexes))
+ {
+ // Recreate unique indexes after we changed the column
+ foreach ($unique_indexes as $index_name => $index_data)
+ {
+ $result = $this->sql_create_unique_index($table_name, $index_name, $index_data);
+ $statements = array_merge($statements, $result);
+ }
+ }
+
+ $this->return_statements = $old_return_statements;
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * Get queries to drop the default constraints of a column
+ *
+ * We need to drop the default constraints of a column,
+ * before being able to change their type or deleting them.
+ *
+ * @param string $table_name
+ * @param string $column_name
+ * @return array Array with SQL statements
+ */
+ protected function mssql_get_drop_default_constraints_queries($table_name, $column_name)
+ {
+ $statements = array();
+ if ($this->mssql_is_sql_server_2000())
+ {
+ // http://msdn.microsoft.com/en-us/library/aa175912%28v=sql.80%29.aspx
+ // Deprecated in SQL Server 2005
+ $sql = "SELECT so.name AS def_name
+ FROM sysobjects so
+ JOIN sysconstraints sc ON so.id = sc.constid
+ WHERE object_name(so.parent_obj) = '{$table_name}'
+ AND so.xtype = 'D'
+ AND sc.colid = (SELECT colid FROM syscolumns
+ WHERE id = object_id('{$table_name}')
+ AND name = '{$column_name}')";
+ }
+ else
+ {
+ $sql = "SELECT dobj.name AS def_name
+ FROM sys.columns col
+ LEFT OUTER JOIN sys.objects dobj ON (dobj.object_id = col.default_object_id AND dobj.type = 'D')
+ WHERE col.object_id = object_id('{$table_name}')
+ AND col.name = '{$column_name}'
+ AND dobj.name IS NOT NULL";
+ }
+
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $statements[] = 'ALTER TABLE [' . $table_name . '] DROP CONSTRAINT [' . $row['def_name'] . ']';
+ }
+ $this->db->sql_freeresult($result);
+
+ return $statements;
+ }
+
+ /**
+ * Get a list with existing indexes for the column
+ *
+ * @param string $table_name
+ * @param string $column_name
+ * @param bool $unique Should we get unique indexes or normal ones
+ * @return array Array with Index name => columns
+ */
+ public function get_existing_indexes($table_name, $column_name, $unique = false)
+ {
+ $existing_indexes = array();
+ if ($this->mssql_is_sql_server_2000())
+ {
+ // http://msdn.microsoft.com/en-us/library/aa175912%28v=sql.80%29.aspx
+ // Deprecated in SQL Server 2005
+ $sql = "SELECT DISTINCT ix.name AS phpbb_index_name
+ FROM sysindexes ix
+ INNER JOIN sysindexkeys ixc
+ ON ixc.id = ix.id
+ AND ixc.indid = ix.indid
+ INNER JOIN syscolumns cols
+ ON cols.colid = ixc.colid
+ AND cols.id = ix.id
+ WHERE ix.id = object_id('{$table_name}')
+ AND cols.name = '{$column_name}'
+ AND INDEXPROPERTY(ix.id, ix.name, 'IsUnique') = " . ($unique ? '1' : '0');
+ }
+ else
+ {
+ $sql = "SELECT DISTINCT ix.name AS phpbb_index_name
+ FROM sys.indexes ix
+ INNER JOIN sys.index_columns ixc
+ ON ixc.object_id = ix.object_id
+ AND ixc.index_id = ix.index_id
+ INNER JOIN sys.columns cols
+ ON cols.column_id = ixc.column_id
+ AND cols.object_id = ix.object_id
+ WHERE ix.object_id = object_id('{$table_name}')
+ AND cols.name = '{$column_name}'
+ AND ix.is_unique = " . ($unique ? '1' : '0');
+ }
+
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (!isset($row['is_unique']) || ($unique && $row['is_unique'] == 'UNIQUE') || (!$unique && $row['is_unique'] == 'NONUNIQUE'))
+ {
+ $existing_indexes[$row['phpbb_index_name']] = array();
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ if (empty($existing_indexes))
+ {
+ return array();
+ }
+
+ if ($this->mssql_is_sql_server_2000())
+ {
+ $sql = "SELECT DISTINCT ix.name AS phpbb_index_name, cols.name AS phpbb_column_name
+ FROM sysindexes ix
+ INNER JOIN sysindexkeys ixc
+ ON ixc.id = ix.id
+ AND ixc.indid = ix.indid
+ INNER JOIN syscolumns cols
+ ON cols.colid = ixc.colid
+ AND cols.id = ix.id
+ WHERE ix.id = object_id('{$table_name}')
+ AND " . $this->db->sql_in_set('ix.name', array_keys($existing_indexes));
+ }
+ else
+ {
+ $sql = "SELECT DISTINCT ix.name AS phpbb_index_name, cols.name AS phpbb_column_name
+ FROM sys.indexes ix
+ INNER JOIN sys.index_columns ixc
+ ON ixc.object_id = ix.object_id
+ AND ixc.index_id = ix.index_id
+ INNER JOIN sys.columns cols
+ ON cols.column_id = ixc.column_id
+ AND cols.object_id = ix.object_id
+ WHERE ix.object_id = object_id('{$table_name}')
+ AND " . $this->db->sql_in_set('ix.name', array_keys($existing_indexes));
+ }
+
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $existing_indexes[$row['phpbb_index_name']][] = $row['phpbb_column_name'];
+ }
+ $this->db->sql_freeresult($result);
+
+ return $existing_indexes;
+ }
+
+ /**
+ * Is the used MS SQL Server a SQL Server 2000?
+ *
+ * @return bool
+ */
+ protected function mssql_is_sql_server_2000()
+ {
+ if ($this->is_sql_server_2000 === null)
+ {
+ $sql = "SELECT CAST(SERVERPROPERTY('productversion') AS VARCHAR(25)) AS mssql_version";
+ $result = $this->db->sql_query($sql);
+ $properties = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+ $this->is_sql_server_2000 = $properties['mssql_version'][0] == '8';
+ }
+
+ return $this->is_sql_server_2000;
+ }
+
+}
diff --git a/phpBB/phpbb/db/tools/postgres.php b/phpBB/phpbb/db/tools/postgres.php
new file mode 100644
index 0000000000..8b61625c3c
--- /dev/null
+++ b/phpBB/phpbb/db/tools/postgres.php
@@ -0,0 +1,613 @@
+<?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\tools;
+
+/**
+ * Database Tools for handling cross-db actions such as altering columns, etc.
+ * Currently not supported is returning SQL for creating tables.
+ */
+class postgres extends tools
+{
+ /**
+ * Get the column types for postgres only
+ *
+ * @return array
+ */
+ public static function get_dbms_type_map()
+ {
+ return array(
+ 'postgres' => array(
+ 'INT:' => 'INT4',
+ 'BINT' => 'INT8',
+ 'UINT' => 'INT4', // unsigned
+ 'UINT:' => 'INT4', // unsigned
+ 'USINT' => 'INT2', // unsigned
+ 'BOOL' => 'INT2', // unsigned
+ 'TINT:' => 'INT2',
+ 'VCHAR' => 'varchar(255)',
+ 'VCHAR:' => 'varchar(%d)',
+ 'CHAR:' => 'char(%d)',
+ 'XSTEXT' => 'varchar(1000)',
+ 'STEXT' => 'varchar(3000)',
+ 'TEXT' => 'varchar(8000)',
+ 'MTEXT' => 'TEXT',
+ 'XSTEXT_UNI'=> 'varchar(100)',
+ 'STEXT_UNI' => 'varchar(255)',
+ 'TEXT_UNI' => 'varchar(4000)',
+ 'MTEXT_UNI' => 'TEXT',
+ 'TIMESTAMP' => 'INT4', // unsigned
+ 'DECIMAL' => 'decimal(5,2)',
+ 'DECIMAL:' => 'decimal(%d,2)',
+ 'PDECIMAL' => 'decimal(6,3)',
+ 'PDECIMAL:' => 'decimal(%d,3)',
+ 'VCHAR_UNI' => 'varchar(255)',
+ 'VCHAR_UNI:'=> 'varchar(%d)',
+ 'VCHAR_CI' => 'varchar_ci',
+ 'VARBINARY' => 'bytea',
+ ),
+ );
+ }
+
+ /**
+ * Constructor. Set DB Object and set {@link $return_statements return_statements}.
+ *
+ * @param \phpbb\db\driver\driver_interface $db Database connection
+ * @param bool $return_statements True if only statements should be returned and no SQL being executed
+ */
+ public function __construct(\phpbb\db\driver\driver_interface $db, $return_statements = false)
+ {
+ parent::__construct($db, $return_statements);
+
+ // Determine mapping database type
+ $this->sql_layer = 'postgres';
+
+ $this->dbms_type_map = self::get_dbms_type_map();
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_list_tables()
+ {
+ $sql = 'SELECT relname
+ FROM pg_stat_user_tables';
+ $result = $this->db->sql_query($sql);
+
+ $tables = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $name = current($row);
+ $tables[$name] = $name;
+ }
+ $this->db->sql_freeresult($result);
+
+ return $tables;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_create_table($table_name, $table_data)
+ {
+ // holds the DDL for a column
+ $columns = $statements = array();
+
+ if ($this->sql_table_exists($table_name))
+ {
+ return $this->_sql_run_sql($statements);
+ }
+
+ // Begin transaction
+ $statements[] = 'begin';
+
+ // Determine if we have created a PRIMARY KEY in the earliest
+ $primary_key_gen = false;
+
+ // Determine if the table requires a sequence
+ $create_sequence = false;
+
+ // Begin table sql statement
+ $table_sql = 'CREATE TABLE ' . $table_name . ' (' . "\n";
+
+ // Iterate through the columns to create a table
+ foreach ($table_data['COLUMNS'] as $column_name => $column_data)
+ {
+ // here lies an array, filled with information compiled on the column's data
+ $prepared_column = $this->sql_prepare_column_data($table_name, $column_name, $column_data);
+
+ if (isset($prepared_column['auto_increment']) && $prepared_column['auto_increment'] && strlen($column_name) > 26) // "${column_name}_gen"
+ {
+ trigger_error("Index name '${column_name}_gen' on table '$table_name' is too long. The maximum auto increment column length is 26 characters.", E_USER_ERROR);
+ }
+
+ // here we add the definition of the new column to the list of columns
+ $columns[] = "\t {$column_name} " . $prepared_column['column_type_sql'];
+
+ // see if we have found a primary key set due to a column definition if we have found it, we can stop looking
+ if (!$primary_key_gen)
+ {
+ $primary_key_gen = isset($prepared_column['primary_key_set']) && $prepared_column['primary_key_set'];
+ }
+
+ // create sequence DDL based off of the existance of auto incrementing columns
+ if (!$create_sequence && isset($prepared_column['auto_increment']) && $prepared_column['auto_increment'])
+ {
+ $create_sequence = $column_name;
+ }
+ }
+
+ // this makes up all the columns in the create table statement
+ $table_sql .= implode(",\n", $columns);
+
+ // we have yet to create a primary key for this table,
+ // this means that we can add the one we really wanted instead
+ if (!$primary_key_gen)
+ {
+ // Write primary key
+ if (isset($table_data['PRIMARY_KEY']))
+ {
+ if (!is_array($table_data['PRIMARY_KEY']))
+ {
+ $table_data['PRIMARY_KEY'] = array($table_data['PRIMARY_KEY']);
+ }
+
+ $table_sql .= ",\n\t PRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . ')';
+ }
+ }
+
+ // do we need to add a sequence for auto incrementing columns?
+ if ($create_sequence)
+ {
+ $statements[] = "CREATE SEQUENCE {$table_name}_seq;";
+ }
+
+ // close the table
+ $table_sql .= "\n);";
+ $statements[] = $table_sql;
+
+ // Write Keys
+ if (isset($table_data['KEYS']))
+ {
+ foreach ($table_data['KEYS'] as $key_name => $key_data)
+ {
+ if (!is_array($key_data[1]))
+ {
+ $key_data[1] = array($key_data[1]);
+ }
+
+ $old_return_statements = $this->return_statements;
+ $this->return_statements = true;
+
+ $key_stmts = ($key_data[0] == 'UNIQUE') ? $this->sql_create_unique_index($table_name, $key_name, $key_data[1]) : $this->sql_create_index($table_name, $key_name, $key_data[1]);
+
+ foreach ($key_stmts as $key_stmt)
+ {
+ $statements[] = $key_stmt;
+ }
+
+ $this->return_statements = $old_return_statements;
+ }
+ }
+
+ // Commit Transaction
+ $statements[] = 'commit';
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_list_columns($table_name)
+ {
+ $columns = array();
+
+ $sql = "SELECT a.attname
+ FROM pg_class c, pg_attribute a
+ WHERE c.relname = '{$table_name}'
+ AND a.attnum > 0
+ AND a.attrelid = c.oid";
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $column = strtolower(current($row));
+ $columns[$column] = $column;
+ }
+ $this->db->sql_freeresult($result);
+
+ return $columns;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_index_exists($table_name, $index_name)
+ {
+ $sql = "SELECT ic.relname as index_name
+ FROM pg_class bc, pg_class ic, pg_index i
+ WHERE (bc.oid = i.indrelid)
+ AND (ic.oid = i.indexrelid)
+ AND (bc.relname = '" . $table_name . "')
+ AND (i.indisunique != 't')
+ AND (i.indisprimary != 't')";
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ // This DBMS prefixes index names with the table name
+ $row['index_name'] = $this->strip_table_name_from_index_name($table_name, $row['index_name']);
+
+ if (strtolower($row['index_name']) == strtolower($index_name))
+ {
+ $this->db->sql_freeresult($result);
+ return true;
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_unique_index_exists($table_name, $index_name)
+ {
+ $sql = "SELECT ic.relname as index_name, i.indisunique
+ FROM pg_class bc, pg_class ic, pg_index i
+ WHERE (bc.oid = i.indrelid)
+ AND (ic.oid = i.indexrelid)
+ AND (bc.relname = '" . $table_name . "')
+ AND (i.indisprimary != 't')";
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if ($row['indisunique'] != 't')
+ {
+ continue;
+ }
+
+ // This DBMS prefixes index names with the table name
+ $row['index_name'] = $this->strip_table_name_from_index_name($table_name, $row['index_name']);
+
+ if (strtolower($row['index_name']) == strtolower($index_name))
+ {
+ $this->db->sql_freeresult($result);
+ return true;
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ return false;
+ }
+
+ /**
+ * Function to prepare some column information for better usage
+ * @access private
+ */
+ function sql_prepare_column_data($table_name, $column_name, $column_data)
+ {
+ if (strlen($column_name) > 30)
+ {
+ trigger_error("Column name '$column_name' on table '$table_name' is too long. The maximum is 30 characters.", E_USER_ERROR);
+ }
+
+ // Get type
+ list($column_type, $orig_column_type) = $this->get_column_type($column_data[0]);
+
+ // Adjust default value if db-dependent specified
+ if (is_array($column_data[1]))
+ {
+ $column_data[1] = (isset($column_data[1][$this->sql_layer])) ? $column_data[1][$this->sql_layer] : $column_data[1]['default'];
+ }
+
+ $sql = " {$column_type} ";
+
+ $return_array = array(
+ 'column_type' => $column_type,
+ 'auto_increment' => false,
+ );
+
+ if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
+ {
+ $default_val = "nextval('{$table_name}_seq')";
+ $return_array['auto_increment'] = true;
+ }
+ else if (!is_null($column_data[1]))
+ {
+ $default_val = "'" . $column_data[1] . "'";
+ $return_array['null'] = 'NOT NULL';
+ $sql .= 'NOT NULL ';
+ }
+ else
+ {
+ // 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 ';
+ }
+
+ $return_array['default'] = $default_val;
+
+ $sql .= "DEFAULT {$default_val}";
+
+ // Unsigned? Then add a CHECK contraint
+ if (in_array($orig_column_type, $this->unsigned_types))
+ {
+ $return_array['constraint'] = "CHECK ({$column_name} >= 0)";
+ $sql .= " CHECK ({$column_name} >= 0)";
+ }
+
+ $return_array['column_type_sql'] = $sql;
+
+ return $return_array;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_column_add($table_name, $column_name, $column_data, $inline = false)
+ {
+ $column_data = $this->sql_prepare_column_data($table_name, $column_name, $column_data);
+ $statements = array();
+
+ // Does not support AFTER, only through temporary table
+ if (version_compare($this->db->sql_server_info(true), '8.0', '>='))
+ {
+ $statements[] = 'ALTER TABLE ' . $table_name . ' ADD COLUMN "' . $column_name . '" ' . $column_data['column_type_sql'];
+ }
+ else
+ {
+ // old versions cannot add columns with default and null information
+ $statements[] = 'ALTER TABLE ' . $table_name . ' ADD COLUMN "' . $column_name . '" ' . $column_data['column_type'] . ' ' . $column_data['constraint'];
+
+ if (isset($column_data['null']))
+ {
+ if ($column_data['null'] == 'NOT NULL')
+ {
+ $statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' SET NOT NULL';
+ }
+ }
+
+ if (isset($column_data['default']))
+ {
+ $statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' SET DEFAULT ' . $column_data['default'];
+ }
+ }
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_column_remove($table_name, $column_name, $inline = false)
+ {
+ $statements = array();
+
+ $statements[] = 'ALTER TABLE ' . $table_name . ' DROP COLUMN "' . $column_name . '"';
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_index_drop($table_name, $index_name)
+ {
+ $statements = array();
+
+ $statements[] = 'DROP INDEX ' . $table_name . '_' . $index_name;
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_table_drop($table_name)
+ {
+ $statements = array();
+
+ if (!$this->sql_table_exists($table_name))
+ {
+ return $this->_sql_run_sql($statements);
+ }
+
+ // the most basic operation, get rid of the table
+ $statements[] = 'DROP TABLE ' . $table_name;
+
+ // PGSQL does not "tightly" bind sequences and tables, we must guess...
+ $sql = "SELECT relname
+ FROM pg_class
+ WHERE relkind = 'S'
+ AND relname = '{$table_name}_seq'";
+ $result = $this->db->sql_query($sql);
+
+ // We don't even care about storing the results. We already know the answer if we get rows back.
+ if ($this->db->sql_fetchrow($result))
+ {
+ $statements[] = "DROP SEQUENCE {$table_name}_seq;\n";
+ }
+ $this->db->sql_freeresult($result);
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_create_primary_key($table_name, $column, $inline = false)
+ {
+ $statements = array();
+
+ $statements[] = 'ALTER TABLE ' . $table_name . ' ADD PRIMARY KEY (' . implode(', ', $column) . ')';
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_create_unique_index($table_name, $index_name, $column)
+ {
+ $statements = array();
+
+ $this->check_index_name_length($table_name, $index_name);
+
+ $statements[] = 'CREATE UNIQUE INDEX ' . $table_name . '_' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')';
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_create_index($table_name, $index_name, $column)
+ {
+ $statements = array();
+
+ $this->check_index_name_length($table_name, $index_name);
+
+ // remove index length
+ $column = preg_replace('#:.*$#', '', $column);
+
+ $statements[] = 'CREATE INDEX ' . $table_name . '_' . $index_name . ' ON ' . $table_name . '(' . implode(', ', $column) . ')';
+
+ return $this->_sql_run_sql($statements);
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_list_index($table_name)
+ {
+ $index_array = array();
+
+ $sql = "SELECT ic.relname as index_name
+ FROM pg_class bc, pg_class ic, pg_index i
+ WHERE (bc.oid = i.indrelid)
+ AND (ic.oid = i.indexrelid)
+ AND (bc.relname = '" . $table_name . "')
+ AND (i.indisunique != 't')
+ AND (i.indisprimary != 't')";
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $row['index_name'] = $this->strip_table_name_from_index_name($table_name, $row['index_name']);
+
+ $index_array[] = $row['index_name'];
+ }
+ $this->db->sql_freeresult($result);
+
+ return array_map('strtolower', $index_array);
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ function sql_column_change($table_name, $column_name, $column_data, $inline = false)
+ {
+ $column_data = $this->sql_prepare_column_data($table_name, $column_name, $column_data);
+ $statements = array();
+
+ $sql = 'ALTER TABLE ' . $table_name . ' ';
+
+ $sql_array = array();
+ $sql_array[] = 'ALTER COLUMN ' . $column_name . ' TYPE ' . $column_data['column_type'];
+
+ if (isset($column_data['null']))
+ {
+ if ($column_data['null'] == 'NOT NULL')
+ {
+ $sql_array[] = 'ALTER COLUMN ' . $column_name . ' SET NOT NULL';
+ }
+ else if ($column_data['null'] == 'NULL')
+ {
+ $sql_array[] = 'ALTER COLUMN ' . $column_name . ' DROP NOT NULL';
+ }
+ }
+
+ if (isset($column_data['default']))
+ {
+ $sql_array[] = 'ALTER COLUMN ' . $column_name . ' SET DEFAULT ' . $column_data['default'];
+ }
+
+ // we don't want to double up on constraints if we change different number data types
+ if (isset($column_data['constraint']))
+ {
+ $constraint_sql = "SELECT consrc as constraint_data
+ FROM pg_constraint, pg_class bc
+ WHERE conrelid = bc.oid
+ AND bc.relname = '{$table_name}'
+ AND NOT EXISTS (
+ SELECT *
+ FROM pg_constraint as c, pg_inherits as i
+ WHERE i.inhrelid = pg_constraint.conrelid
+ AND c.conname = pg_constraint.conname
+ AND c.consrc = pg_constraint.consrc
+ AND c.conrelid = i.inhparent
+ )";
+
+ $constraint_exists = false;
+
+ $result = $this->db->sql_query($constraint_sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (trim($row['constraint_data']) == trim($column_data['constraint']))
+ {
+ $constraint_exists = true;
+ break;
+ }
+ }
+ $this->db->sql_freeresult($result);
+
+ if (!$constraint_exists)
+ {
+ $sql_array[] = 'ADD ' . $column_data['constraint'];
+ }
+ }
+
+ $sql .= implode(', ', $sql_array);
+
+ $statements[] = $sql;
+
+ return $this->_sql_run_sql($statements);
+ }
+
+ /**
+ * Get a list with existing indexes for the column
+ *
+ * @param string $table_name
+ * @param string $column_name
+ * @param bool $unique Should we get unique indexes or normal ones
+ * @return array Array with Index name => columns
+ */
+ public function get_existing_indexes($table_name, $column_name, $unique = false)
+ {
+ // Not supported
+ throw new \Exception('DBMS is not supported');
+ }
+}
diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools/tools.php
index 775deccc30..1d7b2ddfff 100644
--- a/phpBB/phpbb/db/tools.php
+++ b/phpBB/phpbb/db/tools/tools.php
@@ -11,13 +11,13 @@
*
*/
-namespace phpbb\db;
+namespace phpbb\db\tools;
/**
* Database Tools for handling cross-db actions such as altering columns, etc.
* Currently not supported is returning SQL for creating tables.
*/
-class tools
+class tools implements tools_interface
{
/**
* Current sql layer
@@ -36,17 +36,11 @@ class tools
var $dbms_type_map = array();
/**
- * Is the used MS SQL Server a SQL Server 2000?
- * @var bool
- */
- protected $is_sql_server_2000;
-
- /**
* Get the column types for every database we support
*
* @return array
*/
- public static function get_dbms_type_map()
+ static public function get_dbms_type_map()
{
return array(
'mysql_41' => array(
@@ -109,66 +103,6 @@ class tools
'VARBINARY' => 'varbinary(255)',
),
- 'mssql' => array(
- 'INT:' => '[int]',
- 'BINT' => '[float]',
- 'UINT' => '[int]',
- 'UINT:' => '[int]',
- 'TINT:' => '[int]',
- 'USINT' => '[int]',
- 'BOOL' => '[int]',
- 'VCHAR' => '[varchar] (255)',
- 'VCHAR:' => '[varchar] (%d)',
- 'CHAR:' => '[char] (%d)',
- 'XSTEXT' => '[varchar] (1000)',
- 'STEXT' => '[varchar] (3000)',
- 'TEXT' => '[varchar] (8000)',
- 'MTEXT' => '[text]',
- 'XSTEXT_UNI'=> '[varchar] (100)',
- 'STEXT_UNI' => '[varchar] (255)',
- 'TEXT_UNI' => '[varchar] (4000)',
- 'MTEXT_UNI' => '[text]',
- 'TIMESTAMP' => '[int]',
- 'DECIMAL' => '[float]',
- 'DECIMAL:' => '[float]',
- 'PDECIMAL' => '[float]',
- 'PDECIMAL:' => '[float]',
- 'VCHAR_UNI' => '[varchar] (255)',
- 'VCHAR_UNI:'=> '[varchar] (%d)',
- 'VCHAR_CI' => '[varchar] (255)',
- 'VARBINARY' => '[varchar] (255)',
- ),
-
- 'mssqlnative' => array(
- 'INT:' => '[int]',
- 'BINT' => '[float]',
- 'UINT' => '[int]',
- 'UINT:' => '[int]',
- 'TINT:' => '[int]',
- 'USINT' => '[int]',
- 'BOOL' => '[int]',
- 'VCHAR' => '[varchar] (255)',
- 'VCHAR:' => '[varchar] (%d)',
- 'CHAR:' => '[char] (%d)',
- 'XSTEXT' => '[varchar] (1000)',
- 'STEXT' => '[varchar] (3000)',
- 'TEXT' => '[varchar] (8000)',
- 'MTEXT' => '[text]',
- 'XSTEXT_UNI'=> '[varchar] (100)',
- 'STEXT_UNI' => '[varchar] (255)',
- 'TEXT_UNI' => '[varchar] (4000)',
- 'MTEXT_UNI' => '[text]',
- 'TIMESTAMP' => '[int]',
- 'DECIMAL' => '[float]',
- 'DECIMAL:' => '[float]',
- 'PDECIMAL' => '[float]',
- 'PDECIMAL:' => '[float]',
- 'VCHAR_UNI' => '[varchar] (255)',
- 'VCHAR_UNI:'=> '[varchar] (%d)',
- 'VCHAR_CI' => '[varchar] (255)',
- 'VARBINARY' => '[varchar] (255)',
- ),
-
'oracle' => array(
'INT:' => 'number(%d)',
'BINT' => 'number(20)',
@@ -258,36 +192,6 @@ class tools
'VCHAR_CI' => 'VARCHAR(255)',
'VARBINARY' => 'BLOB',
),
-
- 'postgres' => array(
- 'INT:' => 'INT4',
- 'BINT' => 'INT8',
- 'UINT' => 'INT4', // unsigned
- 'UINT:' => 'INT4', // unsigned
- 'USINT' => 'INT2', // unsigned
- 'BOOL' => 'INT2', // unsigned
- 'TINT:' => 'INT2',
- 'VCHAR' => 'varchar(255)',
- 'VCHAR:' => 'varchar(%d)',
- 'CHAR:' => 'char(%d)',
- 'XSTEXT' => 'varchar(1000)',
- 'STEXT' => 'varchar(3000)',
- 'TEXT' => 'varchar(8000)',
- 'MTEXT' => 'TEXT',
- 'XSTEXT_UNI'=> 'varchar(100)',
- 'STEXT_UNI' => 'varchar(255)',
- 'TEXT_UNI' => 'varchar(4000)',
- 'MTEXT_UNI' => 'TEXT',
- 'TIMESTAMP' => 'INT4', // unsigned
- 'DECIMAL' => 'decimal(5,2)',
- 'DECIMAL:' => 'decimal(%d,2)',
- 'PDECIMAL' => 'decimal(6,3)',
- 'PDECIMAL:' => 'decimal(%d,3)',
- 'VCHAR_UNI' => 'varchar(255)',
- 'VCHAR_UNI:'=> 'varchar(%d)',
- 'VCHAR_CI' => 'varchar_ci',
- 'VARBINARY' => 'bytea',
- ),
);
}
@@ -298,12 +202,6 @@ class tools
var $unsigned_types = array('UINT', 'UINT:', 'USINT', 'BOOL', 'TIMESTAMP');
/**
- * A list of supported DBMS. We change this class to support more DBMS, the DBMS itself only need to follow some rules.
- * @var array
- */
- var $supported_dbms = array('mssql', 'mssqlnative', 'mysql_40', 'mysql_41', 'oracle', 'postgres', 'sqlite', 'sqlite3');
-
- /**
* This is set to true if user only wants to return the 'to-be-executed' SQL statement(s) (as an array).
* This mode has no effect on some methods (inserting of data for example). This is expressed within the methods command.
*/
@@ -344,15 +242,6 @@ class tools
$this->sql_layer = 'mysql_41';
break;
- case 'mssql':
- case 'mssql_odbc':
- $this->sql_layer = 'mssql';
- break;
-
- case 'mssqlnative':
- $this->sql_layer = 'mssqlnative';
- break;
-
default:
$this->sql_layer = $this->db->get_sql_layer();
break;
@@ -371,10 +260,8 @@ class tools
}
/**
- * Gets a list of tables in the database.
- *
- * @return array Array of table names (all lower case)
- */
+ * {@inheritDoc}
+ */
function sql_list_tables()
{
switch ($this->db->get_sql_layer())
@@ -398,19 +285,6 @@ class tools
AND name <> "sqlite_sequence"';
break;
- case 'mssql':
- case 'mssql_odbc':
- case 'mssqlnative':
- $sql = "SELECT name
- FROM sysobjects
- WHERE type='U'";
- break;
-
- case 'postgres':
- $sql = 'SELECT relname
- FROM pg_stat_user_tables';
- break;
-
case 'oracle':
$sql = 'SELECT table_name
FROM USER_TABLES';
@@ -431,12 +305,8 @@ class tools
}
/**
- * Check if table exists
- *
- *
- * @param string $table_name The table name to check for
- * @return bool true if table exists, else false
- */
+ * {@inheritDoc}
+ */
function sql_table_exists($table_name)
{
$this->db->sql_return_on_error(true);
@@ -453,12 +323,8 @@ class tools
}
/**
- * Create SQL Table
- *
- * @param string $table_name The table name to create
- * @param array $table_data Array containing table data.
- * @return array Statements if $return_statements is true.
- */
+ * {@inheritDoc}
+ */
function sql_create_table($table_name, $table_data)
{
// holds the DDL for a column
@@ -479,26 +345,7 @@ class tools
$create_sequence = false;
// Begin table sql statement
- switch ($this->sql_layer)
- {
- case 'mssql':
- case 'mssqlnative':
- $table_sql = 'CREATE TABLE [' . $table_name . '] (' . "\n";
- break;
-
- default:
- $table_sql = 'CREATE TABLE ' . $table_name . ' (' . "\n";
- break;
- }
-
- if ($this->sql_layer == 'mssql' || $this->sql_layer == 'mssqlnative')
- {
- if (!isset($table_data['PRIMARY_KEY']))
- {
- $table_data['COLUMNS']['mssqlindex'] = array('UINT', null, 'auto_increment');
- $table_data['PRIMARY_KEY'] = 'mssqlindex';
- }
- }
+ $table_sql = 'CREATE TABLE ' . $table_name . ' (' . "\n";
// Iterate through the columns to create a table
foreach ($table_data['COLUMNS'] as $column_name => $column_data)
@@ -512,17 +359,7 @@ class tools
}
// here we add the definition of the new column to the list of columns
- switch ($this->sql_layer)
- {
- case 'mssql':
- case 'mssqlnative':
- $columns[] = "\t [{$column_name}] " . $prepared_column['column_type_sql_default'];
- break;
-
- default:
- $columns[] = "\t {$column_name} " . $prepared_column['column_type_sql'];
- break;
- }
+ $columns[] = "\t {$column_name} " . $prepared_column['column_type_sql'];
// see if we have found a primary key set due to a column definition if we have found it, we can stop looking
if (!$primary_key_gen)
@@ -540,16 +377,6 @@ class tools
// this makes up all the columns in the create table statement
$table_sql .= implode(",\n", $columns);
- // Close the table for two DBMS and add to the statements
- switch ($this->sql_layer)
- {
- case 'mssql':
- case 'mssqlnative':
- $table_sql .= "\n);";
- $statements[] = $table_sql;
- break;
- }
-
// we have yet to create a primary key for this table,
// this means that we can add the one we really wanted instead
if (!$primary_key_gen)
@@ -566,27 +393,11 @@ class tools
{
case 'mysql_40':
case 'mysql_41':
- case 'postgres':
case 'sqlite':
case 'sqlite3':
$table_sql .= ",\n\t PRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . ')';
break;
- case 'mssql':
- case 'mssqlnative':
- // We need the data here
- $old_return_statements = $this->return_statements;
- $this->return_statements = true;
-
- $primary_key_stmts = $this->sql_create_primary_key($table_name, $table_data['PRIMARY_KEY']);
- foreach ($primary_key_stmts as $pk_stmt)
- {
- $statements[] = $pk_stmt;
- }
-
- $this->return_statements = $old_return_statements;
- break;
-
case 'oracle':
$table_sql .= ",\n\t CONSTRAINT pk_{$table_name} PRIMARY KEY (" . implode(', ', $table_data['PRIMARY_KEY']) . ')';
break;
@@ -610,17 +421,6 @@ class tools
$statements[] = $table_sql;
break;
- case 'postgres':
- // do we need to add a sequence for auto incrementing columns?
- if ($create_sequence)
- {
- $statements[] = "CREATE SEQUENCE {$table_name}_seq;";
- }
-
- $table_sql .= "\n);";
- $statements[] = $table_sql;
- break;
-
case 'oracle':
$table_sql .= "\n)";
$statements[] = $table_sql;
@@ -679,27 +479,8 @@ class tools
}
/**
- * Handle passed database update array.
- * Expected structure...
- * Key being one of the following
- * drop_tables: Drop tables
- * add_tables: Add tables
- * change_columns: Column changes (only type, not name)
- * add_columns: Add columns to a table
- * drop_keys: Dropping keys
- * drop_columns: Removing/Dropping columns
- * add_primary_keys: adding primary keys
- * add_unique_index: adding an unique index
- * add_index: adding an index (can be column:index_size if you need to provide size)
- *
- * The values are in this format:
- * {TABLE NAME} => array(
- * {COLUMN NAME} => array({COLUMN TYPE}, {DEFAULT VALUE}, {OPTIONAL VARIABLES}),
- * {KEY/INDEX NAME} => array({COLUMN NAMES}),
- * )
- *
- * For more information have a look at /develop/create_schema_files.php (only available through SVN)
- */
+ * {@inheritDoc}
+ */
function perform_schema_changes($schema_changes)
{
if (empty($schema_changes))
@@ -1079,13 +860,9 @@ class tools
}
/**
- * Gets a list of columns of a table.
- *
- * @param string $table Table name
- *
- * @return array Array of column names (all lower case)
- */
- function sql_list_columns($table)
+ * {@inheritDoc}
+ */
+ function sql_list_columns($table_name)
{
$columns = array();
@@ -1093,33 +870,13 @@ class tools
{
case 'mysql_40':
case 'mysql_41':
- $sql = "SHOW COLUMNS FROM $table";
- break;
-
- // PostgreSQL has a way of doing this in a much simpler way but would
- // not allow us to support all versions of PostgreSQL
- case 'postgres':
- $sql = "SELECT a.attname
- FROM pg_class c, pg_attribute a
- WHERE c.relname = '{$table}'
- AND a.attnum > 0
- AND a.attrelid = c.oid";
- break;
-
- // same deal with PostgreSQL, we must perform more complex operations than
- // we technically could
- case 'mssql':
- case 'mssqlnative':
- $sql = "SELECT c.name
- FROM syscolumns c
- LEFT JOIN sysobjects o ON c.id = o.id
- WHERE o.name = '{$table}'";
+ $sql = "SHOW COLUMNS FROM $table_name";
break;
case 'oracle':
$sql = "SELECT column_name
FROM user_tab_columns
- WHERE LOWER(table_name) = '" . strtolower($table) . "'";
+ WHERE LOWER(table_name) = '" . strtolower($table_name) . "'";
break;
case 'sqlite':
@@ -1127,7 +884,7 @@ class tools
$sql = "SELECT sql
FROM sqlite_master
WHERE type = 'table'
- AND name = '{$table}'";
+ AND name = '{$table_name}'";
$result = $this->db->sql_query($sql);
@@ -1173,64 +930,22 @@ class tools
}
/**
- * Check whether a specified column exist in a table
- *
- * @param string $table Table to check
- * @param string $column_name Column to check
- *
- * @return bool True if column exists, false otherwise
- */
- function sql_column_exists($table, $column_name)
+ * {@inheritDoc}
+ */
+ function sql_column_exists($table_name, $column_name)
{
- $columns = $this->sql_list_columns($table);
+ $columns = $this->sql_list_columns($table_name);
return isset($columns[$column_name]);
}
/**
- * Check if a specified index exists in table. Does not return PRIMARY KEY and UNIQUE indexes.
- *
- * @param string $table_name Table to check the index at
- * @param string $index_name The index name to check
- *
- * @return bool True if index exists, else false
- */
+ * {@inheritDoc}
+ */
function sql_index_exists($table_name, $index_name)
{
- if ($this->sql_layer == 'mssql' || $this->sql_layer == 'mssqlnative')
- {
- $sql = "EXEC sp_statistics '$table_name'";
- $result = $this->db->sql_query($sql);
-
- while ($row = $this->db->sql_fetchrow($result))
- {
- if ($row['TYPE'] == 3)
- {
- if (strtolower($row['INDEX_NAME']) == strtolower($index_name))
- {
- $this->db->sql_freeresult($result);
- return true;
- }
- }
- }
- $this->db->sql_freeresult($result);
-
- return false;
- }
-
switch ($this->sql_layer)
{
- case 'postgres':
- $sql = "SELECT ic.relname as index_name
- FROM pg_class bc, pg_class ic, pg_index i
- WHERE (bc.oid = i.indrelid)
- AND (ic.oid = i.indexrelid)
- AND (bc.relname = '" . $table_name . "')
- AND (i.indisunique != 't')
- AND (i.indisprimary != 't')";
- $col = 'index_name';
- break;
-
case 'mysql_40':
case 'mysql_41':
$sql = 'SHOW KEYS
@@ -1266,7 +981,6 @@ class tools
switch ($this->sql_layer)
{
case 'oracle':
- case 'postgres':
case 'sqlite':
case 'sqlite3':
$row[$col] = substr($row[$col], strlen($table_name) + 1);
@@ -1285,48 +999,12 @@ class tools
}
/**
- * Check if a specified index exists in table. Does not return PRIMARY KEY indexes.
- *
- * @param string $table_name Table to check the index at
- * @param string $index_name The index name to check
- *
- * @return bool True if index exists, else false
- */
+ * {@inheritDoc}
+ */
function sql_unique_index_exists($table_name, $index_name)
{
- if ($this->sql_layer == 'mssql' || $this->sql_layer == 'mssqlnative')
- {
- $sql = "EXEC sp_statistics '$table_name'";
- $result = $this->db->sql_query($sql);
-
- while ($row = $this->db->sql_fetchrow($result))
- {
- // Usually NON_UNIQUE is the column we want to check, but we allow for both
- if ($row['TYPE'] == 3)
- {
- if (strtolower($row['INDEX_NAME']) == strtolower($index_name))
- {
- $this->db->sql_freeresult($result);
- return true;
- }
- }
- }
- $this->db->sql_freeresult($result);
- return false;
- }
-
switch ($this->sql_layer)
{
- case 'postgres':
- $sql = "SELECT ic.relname as index_name, i.indisunique
- FROM pg_class bc, pg_class ic, pg_index i
- WHERE (bc.oid = i.indrelid)
- AND (ic.oid = i.indexrelid)
- AND (bc.relname = '" . $table_name . "')
- AND (i.indisprimary != 't')";
- $col = 'index_name';
- break;
-
case 'mysql_40':
case 'mysql_41':
$sql = 'SHOW KEYS
@@ -1363,11 +1041,6 @@ class tools
continue;
}
- if ($this->sql_layer == 'postgres' && $row['indisunique'] != 't')
- {
- continue;
- }
-
// These DBMS prefix index name with the table name
switch ($this->sql_layer)
{
@@ -1383,7 +1056,6 @@ class tools
}
break;
- case 'postgres':
case 'sqlite':
case 'sqlite3':
$row[$col] = substr($row[$col], strlen($table_name) + 1);
@@ -1458,50 +1130,6 @@ class tools
switch ($this->sql_layer)
{
- case 'mssql':
- case 'mssqlnative':
- $sql .= " {$column_type} ";
- $sql_default = " {$column_type} ";
-
- // For adding columns we need the default definition
- if (!is_null($column_data[1]))
- {
- // For hexadecimal values do not use single quotes
- if (strpos($column_data[1], '0x') === 0)
- {
- $return_array['default'] = 'DEFAULT (' . $column_data[1] . ') ';
- $sql_default .= $return_array['default'];
- }
- else
- {
- $return_array['default'] = 'DEFAULT (' . ((is_numeric($column_data[1])) ? $column_data[1] : "'{$column_data[1]}'") . ') ';
- $sql_default .= $return_array['default'];
- }
- }
-
- if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
- {
-// $sql .= 'IDENTITY (1, 1) ';
- $sql_default .= 'IDENTITY (1, 1) ';
- }
-
- $return_array['textimage'] = $column_type === '[text]';
-
- if (!is_null($column_data[1]) || (isset($column_data[2]) && $column_data[2] == 'auto_increment'))
- {
- $sql .= 'NOT NULL';
- $sql_default .= 'NOT NULL';
- }
- else
- {
- $sql .= 'NULL';
- $sql_default .= 'NULL';
- }
-
- $return_array['column_type_sql_default'] = $sql_default;
-
- break;
-
case 'mysql_40':
case 'mysql_41':
$sql .= " {$column_type} ";
@@ -1555,51 +1183,6 @@ class tools
break;
- case 'postgres':
- $return_array['column_type'] = $column_type;
-
- $sql .= " {$column_type} ";
-
- $return_array['auto_increment'] = false;
- if (isset($column_data[2]) && $column_data[2] == 'auto_increment')
- {
- $default_val = "nextval('{$table_name}_seq')";
- $return_array['auto_increment'] = true;
- }
- else if (!is_null($column_data[1]))
- {
- $default_val = "'" . $column_data[1] . "'";
- $return_array['null'] = 'NOT NULL';
- $sql .= 'NOT NULL ';
- }
- else
- {
- // 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 ';
- }
-
- $return_array['default'] = $default_val;
-
- $sql .= "DEFAULT {$default_val}";
-
- // Unsigned? Then add a CHECK contraint
- if (in_array($orig_column_type, $this->unsigned_types))
- {
- $return_array['constraint'] = "CHECK ({$column_name} >= 0)";
- $sql .= " CHECK ({$column_name} >= 0)";
- }
-
- break;
-
case 'sqlite':
case 'sqlite3':
$return_array['primary_key_set'] = false;
@@ -1641,6 +1224,7 @@ class tools
*/
function get_column_type($column_map_type)
{
+ $column_type = '';
if (strpos($column_map_type, ':') !== false)
{
list($orig_column_type, $column_length) = explode(':', $column_map_type);
@@ -1692,8 +1276,8 @@ class tools
}
/**
- * Add new column
- */
+ * {@inheritDoc}
+ */
function sql_column_add($table_name, $column_name, $column_data, $inline = false)
{
$column_data = $this->sql_prepare_column_data($table_name, $column_name, $column_data);
@@ -1701,12 +1285,6 @@ class tools
switch ($this->sql_layer)
{
- case 'mssql':
- case 'mssqlnative':
- // Does not support AFTER, only through temporary table
- $statements[] = 'ALTER TABLE [' . $table_name . '] ADD [' . $column_name . '] ' . $column_data['column_type_sql_default'];
- break;
-
case 'mysql_40':
case 'mysql_41':
$after = (!empty($column_data['after'])) ? ' AFTER ' . $column_data['after'] : '';
@@ -1718,33 +1296,6 @@ class tools
$statements[] = 'ALTER TABLE ' . $table_name . ' ADD ' . $column_name . ' ' . $column_data['column_type_sql'];
break;
- case 'postgres':
- // Does not support AFTER, only through temporary table
- if (version_compare($this->db->sql_server_info(true), '8.0', '>='))
- {
- $statements[] = 'ALTER TABLE ' . $table_name . ' ADD COLUMN "' . $column_name . '" ' . $column_data['column_type_sql'];
- }
- else
- {
- // old versions cannot add columns with default and null information
- $statements[] = 'ALTER TABLE ' . $table_name . ' ADD COLUMN "' . $column_name . '" ' . $column_data['column_type'] . ' ' . $column_data['constraint'];
-
- if (isset($column_data['null']))
- {
- if ($column_data['null'] == 'NOT NULL')
- {
- $statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' SET NOT NULL';
- }
- }
-
- if (isset($column_data['default']))
- {
- $statements[] = 'ALTER TABLE ' . $table_name . ' ALTER COLUMN ' . $column_name . ' SET DEFAULT ' . $column_data['default'];
- }
- }
-
- break;
-
case 'sqlite':
if ($inline && $this->return_statements)
{
@@ -1810,59 +1361,14 @@ class tools
}
/**
- * Drop column
- */
+ * {@inheritDoc}
+ */
function sql_column_remove($table_name, $column_name, $inline = false)
{
$statements = array();
switch ($this->sql_layer)
{
- case 'mssql':
- case 'mssqlnative':
- // We need the data here
- $old_return_statements = $this->return_statements;
- $this->return_statements = true;
-
- $indexes = $this->get_existing_indexes($table_name, $column_name);
- $indexes = array_merge($indexes, $this->get_existing_indexes($table_name, $column_name, true));
-
- // Drop any indexes
- $recreate_indexes = array();
- if (!empty($indexes))
- {
- foreach ($indexes as $index_name => $index_data)
- {
- $result = $this->sql_index_drop($table_name, $index_name);
- $statements = array_merge($statements, $result);
- if (sizeof($index_data) > 1)
- {
- // Remove this column from the index and recreate it
- $recreate_indexes[$index_name] = array_diff($index_data, array($column_name));
- }
- }
- }
-
- // Drop default value constraint
- $result = $this->mssql_get_drop_default_constraints_queries($table_name, $column_name);
- $statements = array_merge($statements, $result);
-
- // Remove the column
- $statements[] = 'ALTER TABLE [' . $table_name . '] DROP COLUMN [' . $column_name . ']';
-
- if (!empty($recreate_indexes))
- {
- // Recreate indexes after we removed the column
- foreach ($recreate_indexes as $index_name => $index_data)
- {
- $result = $this->sql_create_index($table_name, $index_name, $index_data);
- $statements = array_merge($statements, $result);
- }
- }
-
- $this->return_statements = $old_return_statements;
- break;
-
case 'mysql_40':
case 'mysql_41':
$statements[] = 'ALTER TABLE `' . $table_name . '` DROP COLUMN `' . $column_name . '`';
@@ -1872,10 +1378,6 @@ class tools
$statements[] = 'ALTER TABLE ' . $table_name . ' DROP COLUMN ' . $column_name;
break;
- case 'postgres':
- $statements[] = 'ALTER TABLE ' . $table_name . ' DROP COLUMN "' . $column_name . '"';
- break;
-
case 'sqlite':
case 'sqlite3':
@@ -1939,26 +1441,20 @@ class tools
}
/**
- * Drop Index
- */
+ * {@inheritDoc}
+ */
function sql_index_drop($table_name, $index_name)
{
$statements = array();
switch ($this->sql_layer)
{
- case 'mssql':
- case 'mssqlnative':
- $statements[] = 'DROP INDEX ' . $table_name . '.' . $index_name;
- break;
-
case 'mysql_40':
case 'mysql_41':
$statements[] = 'DROP INDEX ' . $index_name . ' ON ' . $table_name;
break;
case 'oracle':
- case 'postgres':
case 'sqlite':
case 'sqlite3':
$statements[] = 'DROP INDEX ' . $table_name . '_' . $index_name;
@@ -1969,8 +1465,8 @@ class tools
}
/**
- * Drop Table
- */
+ * {@inheritDoc}
+ */
function sql_table_drop($table_name)
{
$statements = array();
@@ -2000,52 +1496,25 @@ class tools
}
$this->db->sql_freeresult($result);
break;
-
- case 'postgres':
- // PGSQL does not "tightly" bind sequences and tables, we must guess...
- $sql = "SELECT relname
- FROM pg_class
- WHERE relkind = 'S'
- AND relname = '{$table_name}_seq'";
- $result = $this->db->sql_query($sql);
-
- // We don't even care about storing the results. We already know the answer if we get rows back.
- if ($this->db->sql_fetchrow($result))
- {
- $statements[] = "DROP SEQUENCE {$table_name}_seq;\n";
- }
- $this->db->sql_freeresult($result);
- break;
}
return $this->_sql_run_sql($statements);
}
/**
- * Add primary key
- */
+ * {@inheritDoc}
+ */
function sql_create_primary_key($table_name, $column, $inline = false)
{
$statements = array();
switch ($this->sql_layer)
{
- case 'postgres':
case 'mysql_40':
case 'mysql_41':
$statements[] = 'ALTER TABLE ' . $table_name . ' ADD PRIMARY KEY (' . implode(', ', $column) . ')';
break;
- case 'mssql':
- case 'mssqlnative':
- $sql = "ALTER TABLE [{$table_name}] WITH NOCHECK ADD ";
- $sql .= "CONSTRAINT [PK_{$table_name}] PRIMARY KEY CLUSTERED (";
- $sql .= '[' . implode("],\n\t\t[", $column) . ']';
- $sql .= ')';
-
- $statements[] = $sql;
- break;
-
case 'oracle':
$statements[] = 'ALTER TABLE ' . $table_name . ' add CONSTRAINT pk_' . $table_name . ' PRIMARY KEY (' . implode(', ', $column) . ')';
break;
@@ -2106,22 +1575,16 @@ class tools
}
/**
- * Add unique index
- */
+ * {@inheritDoc}
+ */
function sql_create_unique_index($table_name, $index_name, $column)
{
$statements = array();
- $table_prefix = substr(CONFIG_TABLE, 0, -6); // strlen(config)
- if (strlen($table_name . '_' . $index_name) - strlen($table_prefix) > 24)
- {
- $max_length = strlen($table_prefix) + 24;
- trigger_error("Index name '{$table_name}_$index_name' on table '$table_name' is too long. The maximum is $max_length characters.", E_USER_ERROR);
- }
+ $this->check_index_name_length($table_name, $index_name);
switch ($this->sql_layer)
{
- case 'postgres':
case 'oracle':
case 'sqlite':
case 'sqlite3':
@@ -2132,29 +1595,19 @@ class tools
case 'mysql_41':
$statements[] = 'ALTER TABLE ' . $table_name . ' ADD UNIQUE INDEX ' . $index_name . '(' . implode(', ', $column) . ')';
break;
-
- case 'mssql':
- case 'mssqlnative':
- $statements[] = 'CREATE UNIQUE INDEX [' . $index_name . '] ON [' . $table_name . ']([' . implode('], [', $column) . '])';
- break;
}
return $this->_sql_run_sql($statements);
}
/**
- * Add index
- */
+ * {@inheritDoc}
+ */
function sql_create_index($table_name, $index_name, $column)
{
$statements = array();
- $table_prefix = substr(CONFIG_TABLE, 0, -6); // strlen(config)
- if (strlen($table_name . $index_name) - strlen($table_prefix) > 24)
- {
- $max_length = strlen($table_prefix) + 24;
- trigger_error("Index name '{$table_name}_$index_name' on table '$table_name' is too long. The maximum is $max_length characters.", E_USER_ERROR);
- }
+ $this->check_index_name_length($table_name, $index_name);
// remove index length unless MySQL4
if ('mysql_40' != $this->sql_layer)
@@ -2164,7 +1617,6 @@ class tools
switch ($this->sql_layer)
{
- case 'postgres':
case 'oracle':
case 'sqlite':
case 'sqlite3':
@@ -2185,99 +1637,79 @@ class tools
case 'mysql_41':
$statements[] = 'ALTER TABLE ' . $table_name . ' ADD INDEX ' . $index_name . ' (' . implode(', ', $column) . ')';
break;
-
- case 'mssql':
- case 'mssqlnative':
- $statements[] = 'CREATE INDEX [' . $index_name . '] ON [' . $table_name . ']([' . implode('], [', $column) . '])';
- break;
}
return $this->_sql_run_sql($statements);
}
/**
- * List all of the indices that belong to a table,
- * does not count:
- * * UNIQUE indices
- * * PRIMARY keys
- */
+ * Check whether the index name is too long
+ *
+ * @param string $table_name
+ * @param string $index_name
+ */
+ protected function check_index_name_length($table_name, $index_name)
+ {
+ $table_prefix = substr(CONFIG_TABLE, 0, -6); // strlen(config)
+ if (strlen($table_name . $index_name) - strlen($table_prefix) > 24)
+ {
+ $max_length = strlen($table_prefix) + 24;
+ trigger_error("Index name '{$table_name}_$index_name' on table '$table_name' is too long. The maximum is $max_length characters.", E_USER_ERROR);
+ }
+ }
+
+ /**
+ * {@inheritDoc}
+ */
function sql_list_index($table_name)
{
$index_array = array();
- if ($this->sql_layer == 'mssql' || $this->sql_layer == 'mssqlnative')
- {
- $sql = "EXEC sp_statistics '$table_name'";
- $result = $this->db->sql_query($sql);
- while ($row = $this->db->sql_fetchrow($result))
- {
- if ($row['TYPE'] == 3)
- {
- $index_array[] = $row['INDEX_NAME'];
- }
- }
- $this->db->sql_freeresult($result);
- }
- else
+ switch ($this->sql_layer)
{
- switch ($this->sql_layer)
- {
- case 'postgres':
- $sql = "SELECT ic.relname as index_name
- FROM pg_class bc, pg_class ic, pg_index i
- WHERE (bc.oid = i.indrelid)
- AND (ic.oid = i.indexrelid)
- AND (bc.relname = '" . $table_name . "')
- AND (i.indisunique != 't')
- AND (i.indisprimary != 't')";
- $col = 'index_name';
+ case 'mysql_40':
+ case 'mysql_41':
+ $sql = 'SHOW KEYS
+ FROM ' . $table_name;
+ $col = 'Key_name';
break;
- case 'mysql_40':
- case 'mysql_41':
- $sql = 'SHOW KEYS
- FROM ' . $table_name;
- $col = 'Key_name';
+ case 'oracle':
+ $sql = "SELECT index_name
+ FROM user_indexes
+ WHERE table_name = '" . strtoupper($table_name) . "'
+ AND generated = 'N'
+ AND uniqueness = 'NONUNIQUE'";
+ $col = 'index_name';
break;
- case 'oracle':
- $sql = "SELECT index_name
- FROM user_indexes
- WHERE table_name = '" . strtoupper($table_name) . "'
- AND generated = 'N'
- AND uniqueness = 'NONUNIQUE'";
- $col = 'index_name';
+ case 'sqlite':
+ case 'sqlite3':
+ $sql = "PRAGMA index_info('" . $table_name . "');";
+ $col = 'name';
break;
+ }
- case 'sqlite':
- case 'sqlite3':
- $sql = "PRAGMA index_info('" . $table_name . "');";
- $col = 'name';
- break;
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (($this->sql_layer == 'mysql_40' || $this->sql_layer == 'mysql_41') && !$row['Non_unique'])
+ {
+ continue;
}
- $result = $this->db->sql_query($sql);
- while ($row = $this->db->sql_fetchrow($result))
+ switch ($this->sql_layer)
{
- if (($this->sql_layer == 'mysql_40' || $this->sql_layer == 'mysql_41') && !$row['Non_unique'])
- {
- continue;
- }
-
- switch ($this->sql_layer)
- {
- case 'oracle':
- case 'postgres':
- case 'sqlite':
- case 'sqlite3':
- $row[$col] = substr($row[$col], strlen($table_name) + 1);
+ case 'oracle':
+ case 'sqlite':
+ case 'sqlite3':
+ $row[$col] = substr($row[$col], strlen($table_name) + 1);
break;
- }
-
- $index_array[] = $row[$col];
}
- $this->db->sql_freeresult($result);
+
+ $index_array[] = $row[$col];
}
+ $this->db->sql_freeresult($result);
return array_map('strtolower', $index_array);
}
@@ -2295,8 +1727,8 @@ class tools
}
/**
- * Change column type (not name!)
- */
+ * {@inheritDoc}
+ */
function sql_column_change($table_name, $column_name, $column_data, $inline = false)
{
$original_column_data = $column_data;
@@ -2305,62 +1737,6 @@ class tools
switch ($this->sql_layer)
{
- case 'mssql':
- case 'mssqlnative':
- // We need the data here
- $old_return_statements = $this->return_statements;
- $this->return_statements = true;
-
- $indexes = $this->get_existing_indexes($table_name, $column_name);
- $unique_indexes = $this->get_existing_indexes($table_name, $column_name, true);
-
- // Drop any indexes
- if (!empty($indexes) || !empty($unique_indexes))
- {
- $drop_indexes = array_merge(array_keys($indexes), array_keys($unique_indexes));
- foreach ($drop_indexes as $index_name)
- {
- $result = $this->sql_index_drop($table_name, $index_name);
- $statements = array_merge($statements, $result);
- }
- }
-
- // Drop default value constraint
- $result = $this->mssql_get_drop_default_constraints_queries($table_name, $column_name);
- $statements = array_merge($statements, $result);
-
- // Change the column
- $statements[] = 'ALTER TABLE [' . $table_name . '] ALTER COLUMN [' . $column_name . '] ' . $column_data['column_type_sql'];
-
- if (!empty($column_data['default']))
- {
- // Add new default value constraint
- $statements[] = 'ALTER TABLE [' . $table_name . '] ADD CONSTRAINT [DF_' . $table_name . '_' . $column_name . '_1] ' . $this->db->sql_escape($column_data['default']) . ' FOR [' . $column_name . ']';
- }
-
- if (!empty($indexes))
- {
- // Recreate indexes after we changed the column
- foreach ($indexes as $index_name => $index_data)
- {
- $result = $this->sql_create_index($table_name, $index_name, $index_data);
- $statements = array_merge($statements, $result);
- }
- }
-
- if (!empty($unique_indexes))
- {
- // Recreate unique indexes after we changed the column
- foreach ($unique_indexes as $index_name => $index_data)
- {
- $result = $this->sql_create_unique_index($table_name, $index_name, $index_data);
- $statements = array_merge($statements, $result);
- }
- }
-
- $this->return_statements = $old_return_statements;
- break;
-
case 'mysql_40':
case 'mysql_41':
$statements[] = 'ALTER TABLE `' . $table_name . '` CHANGE `' . $column_name . '` `' . $column_name . '` ' . $column_data['column_type_sql'];
@@ -2432,69 +1808,6 @@ class tools
$this->return_statements = $old_return_statements;
break;
- case 'postgres':
- $sql = 'ALTER TABLE ' . $table_name . ' ';
-
- $sql_array = array();
- $sql_array[] = 'ALTER COLUMN ' . $column_name . ' TYPE ' . $column_data['column_type'];
-
- if (isset($column_data['null']))
- {
- if ($column_data['null'] == 'NOT NULL')
- {
- $sql_array[] = 'ALTER COLUMN ' . $column_name . ' SET NOT NULL';
- }
- else if ($column_data['null'] == 'NULL')
- {
- $sql_array[] = 'ALTER COLUMN ' . $column_name . ' DROP NOT NULL';
- }
- }
-
- if (isset($column_data['default']))
- {
- $sql_array[] = 'ALTER COLUMN ' . $column_name . ' SET DEFAULT ' . $column_data['default'];
- }
-
- // we don't want to double up on constraints if we change different number data types
- if (isset($column_data['constraint']))
- {
- $constraint_sql = "SELECT consrc as constraint_data
- FROM pg_constraint, pg_class bc
- WHERE conrelid = bc.oid
- AND bc.relname = '{$table_name}'
- AND NOT EXISTS (
- SELECT *
- FROM pg_constraint as c, pg_inherits as i
- WHERE i.inhrelid = pg_constraint.conrelid
- AND c.conname = pg_constraint.conname
- AND c.consrc = pg_constraint.consrc
- AND c.conrelid = i.inhparent
- )";
-
- $constraint_exists = false;
-
- $result = $this->db->sql_query($constraint_sql);
- while ($row = $this->db->sql_fetchrow($result))
- {
- if (trim($row['constraint_data']) == trim($column_data['constraint']))
- {
- $constraint_exists = true;
- break;
- }
- }
- $this->db->sql_freeresult($result);
-
- if (!$constraint_exists)
- {
- $sql_array[] = 'ADD ' . $column_data['constraint'];
- }
- }
-
- $sql .= implode(', ', $sql_array);
-
- $statements[] = $sql;
- break;
-
case 'sqlite':
case 'sqlite3':
@@ -2563,52 +1876,6 @@ class tools
}
/**
- * Get queries to drop the default constraints of a column
- *
- * We need to drop the default constraints of a column,
- * before being able to change their type or deleting them.
- *
- * @param string $table_name
- * @param string $column_name
- * @return array Array with SQL statements
- */
- protected function mssql_get_drop_default_constraints_queries($table_name, $column_name)
- {
- $statements = array();
- if ($this->mssql_is_sql_server_2000())
- {
- // http://msdn.microsoft.com/en-us/library/aa175912%28v=sql.80%29.aspx
- // Deprecated in SQL Server 2005
- $sql = "SELECT so.name AS def_name
- FROM sysobjects so
- JOIN sysconstraints sc ON so.id = sc.constid
- WHERE object_name(so.parent_obj) = '{$table_name}'
- AND so.xtype = 'D'
- AND sc.colid = (SELECT colid FROM syscolumns
- WHERE id = object_id('{$table_name}')
- AND name = '{$column_name}')";
- }
- else
- {
- $sql = "SELECT dobj.name AS def_name
- FROM sys.columns col
- LEFT OUTER JOIN sys.objects dobj ON (dobj.object_id = col.default_object_id AND dobj.type = 'D')
- WHERE col.object_id = object_id('{$table_name}')
- AND col.name = '{$column_name}'
- AND dobj.name IS NOT NULL";
- }
-
- $result = $this->db->sql_query($sql);
- while ($row = $this->db->sql_fetchrow($result))
- {
- $statements[] = 'ALTER TABLE [' . $table_name . '] DROP CONSTRAINT [' . $row['def_name'] . ']';
- }
- $this->db->sql_freeresult($result);
-
- return $statements;
- }
-
- /**
* Get a list with existing indexes for the column
*
* @param string $table_name
@@ -2622,7 +1889,6 @@ class tools
{
case 'mysql_40':
case 'mysql_41':
- case 'postgres':
case 'sqlite':
case 'sqlite3':
// Not supported
@@ -2635,40 +1901,6 @@ class tools
switch ($this->sql_layer)
{
- case 'mssql':
- case 'mssqlnative':
- if ($this->mssql_is_sql_server_2000())
- {
- // http://msdn.microsoft.com/en-us/library/aa175912%28v=sql.80%29.aspx
- // Deprecated in SQL Server 2005
- $sql = "SELECT DISTINCT ix.name AS phpbb_index_name
- FROM sysindexes ix
- INNER JOIN sysindexkeys ixc
- ON ixc.id = ix.id
- AND ixc.indid = ix.indid
- INNER JOIN syscolumns cols
- ON cols.colid = ixc.colid
- AND cols.id = ix.id
- WHERE ix.id = object_id('{$table_name}')
- AND cols.name = '{$column_name}'
- AND INDEXPROPERTY(ix.id, ix.name, 'IsUnique') = " . ($unique ? '1' : '0');
- }
- else
- {
- $sql = "SELECT DISTINCT ix.name AS phpbb_index_name
- FROM sys.indexes ix
- INNER JOIN sys.index_columns ixc
- ON ixc.object_id = ix.object_id
- AND ixc.index_id = ix.index_id
- INNER JOIN sys.columns cols
- ON cols.column_id = ixc.column_id
- AND cols.object_id = ix.object_id
- WHERE ix.object_id = object_id('{$table_name}')
- AND cols.name = '{$column_name}'
- AND ix.is_unique = " . ($unique ? '1' : '0');
- }
- break;
-
case 'oracle':
$sql = "SELECT ix.index_name AS phpbb_index_name, ix.uniqueness AS is_unique
FROM all_ind_columns ixc, all_indexes ix
@@ -2695,36 +1927,6 @@ class tools
switch ($this->sql_layer)
{
- case 'mssql':
- case 'mssqlnative':
- if ($this->mssql_is_sql_server_2000())
- {
- $sql = "SELECT DISTINCT ix.name AS phpbb_index_name, cols.name AS phpbb_column_name
- FROM sysindexes ix
- INNER JOIN sysindexkeys ixc
- ON ixc.id = ix.id
- AND ixc.indid = ix.indid
- INNER JOIN syscolumns cols
- ON cols.colid = ixc.colid
- AND cols.id = ix.id
- WHERE ix.id = object_id('{$table_name}')
- AND " . $this->db->sql_in_set('ix.name', array_keys($existing_indexes));
- }
- else
- {
- $sql = "SELECT DISTINCT ix.name AS phpbb_index_name, cols.name AS phpbb_column_name
- FROM sys.indexes ix
- INNER JOIN sys.index_columns ixc
- ON ixc.object_id = ix.object_id
- AND ixc.index_id = ix.index_id
- INNER JOIN sys.columns cols
- ON cols.column_id = ixc.column_id
- AND cols.object_id = ix.object_id
- WHERE ix.object_id = object_id('{$table_name}')
- AND " . $this->db->sql_in_set('ix.name', array_keys($existing_indexes));
- }
- break;
-
case 'oracle':
$sql = "SELECT index_name AS phpbb_index_name, column_name AS phpbb_column_name
FROM all_ind_columns
@@ -2744,25 +1946,6 @@ class tools
}
/**
- * Is the used MS SQL Server a SQL Server 2000?
- *
- * @return bool
- */
- protected function mssql_is_sql_server_2000()
- {
- if ($this->is_sql_server_2000 === null)
- {
- $sql = "SELECT CAST(SERVERPROPERTY('productversion') AS VARCHAR(25)) AS mssql_version";
- $result = $this->db->sql_query($sql);
- $properties = $this->db->sql_fetchrow($result);
- $this->db->sql_freeresult($result);
- $this->is_sql_server_2000 = $properties['mssql_version'][0] == '8';
- }
-
- return $this->is_sql_server_2000;
- }
-
- /**
* Returns the Queries which are required to recreate a table including indexes
*
* @param string $table_name
diff --git a/phpBB/phpbb/db/tools/tools_interface.php b/phpBB/phpbb/db/tools/tools_interface.php
new file mode 100644
index 0000000000..f153f73a54
--- /dev/null
+++ b/phpBB/phpbb/db/tools/tools_interface.php
@@ -0,0 +1,202 @@
+<?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\tools;
+
+/**
+ * Interface for a Database Tools for handling cross-db actions such as altering columns, etc.
+ */
+interface tools_interface
+{
+ /**
+ * Handle passed database update array.
+ * Expected structure...
+ * Key being one of the following
+ * drop_tables: Drop tables
+ * add_tables: Add tables
+ * change_columns: Column changes (only type, not name)
+ * add_columns: Add columns to a table
+ * drop_keys: Dropping keys
+ * drop_columns: Removing/Dropping columns
+ * add_primary_keys: adding primary keys
+ * add_unique_index: adding an unique index
+ * add_index: adding an index (can be column:index_size if you need to provide size)
+ *
+ * The values are in this format:
+ * {TABLE NAME} => array(
+ * {COLUMN NAME} => array({COLUMN TYPE}, {DEFAULT VALUE}, {OPTIONAL VARIABLES}),
+ * {KEY/INDEX NAME} => array({COLUMN NAMES}),
+ * )
+ *
+ *
+ * @param array $schema_changes
+ * @return null
+ */
+ public function perform_schema_changes($schema_changes);
+
+ /**
+ * Gets a list of tables in the database.
+ *
+ * @return array Array of table names (all lower case)
+ */
+ public function sql_list_tables();
+
+ /**
+ * Check if table exists
+ *
+ * @param string $table_name The table name to check for
+ * @return bool true if table exists, else false
+ */
+ public function sql_table_exists($table_name);
+
+ /**
+ * Create SQL Table
+ *
+ * @param string $table_name The table name to create
+ * @param array $table_data Array containing table data.
+ * @return array|true Statements to run, or true if the statements have been executed
+ */
+ public function sql_create_table($table_name, $table_data);
+
+ /**
+ * Drop Table
+ *
+ * @param string $table_name The table name to drop
+ * @return array|true Statements to run, or true if the statements have been executed
+ */
+ public function sql_table_drop($table_name);
+
+ /**
+ * Gets a list of columns of a table.
+ *
+ * @param string $table_name Table name
+ * @return array Array of column names (all lower case)
+ */
+ public function sql_list_columns($table_name);
+
+ /**
+ * Check whether a specified column exist in a table
+ *
+ * @param string $table_name Table to check
+ * @param string $column_name Column to check
+ * @return bool True if column exists, false otherwise
+ */
+ public function sql_column_exists($table_name, $column_name);
+
+ /**
+ * Add new column
+ *
+ * @param string $table_name Table to modify
+ * @param string $column_name Name of the column to add
+ * @param array $column_data Column data
+ * @param bool $inline Whether the query should actually be run,
+ * or return a string for adding the column
+ * @return array|true Statements to run, or true if the statements have been executed
+ */
+ public function sql_column_add($table_name, $column_name, $column_data, $inline = false);
+
+ /**
+ * Change column type (not name!)
+ *
+ * @param string $table_name Table to modify
+ * @param string $column_name Name of the column to modify
+ * @param array $column_data Column data
+ * @param bool $inline Whether the query should actually be run,
+ * or return a string for modifying the column
+ * @return array|true Statements to run, or true if the statements have been executed
+ */
+ public function sql_column_change($table_name, $column_name, $column_data, $inline = false);
+
+ /**
+ * Drop column
+ *
+ * @param string $table_name Table to modify
+ * @param string $column_name Name of the column to drop
+ * @param bool $inline Whether the query should actually be run,
+ * or return a string for deleting the column
+ * @return array|true Statements to run, or true if the statements have been executed
+ */
+ public function sql_column_remove($table_name, $column_name, $inline = false);
+
+ /**
+ * List all of the indices that belong to a table
+ *
+ * NOTE: does not list
+ * - UNIQUE indices
+ * - PRIMARY keys
+ *
+ * @param string $table_name Table to check
+ * @return array Array with index names
+ */
+ public function sql_list_index($table_name);
+
+ /**
+ * Check if a specified index exists in table. Does not return PRIMARY KEY and UNIQUE indexes.
+ *
+ * @param string $table_name Table to check the index at
+ * @param string $index_name The index name to check
+ * @return bool True if index exists, else false
+ */
+ public function sql_index_exists($table_name, $index_name);
+
+ /**
+ * Add index
+ *
+ * @param string $table_name Table to modify
+ * @param string $index_name Name of the index to create
+ * @param string|array $column Either a string with a column name, or an array with columns
+ * @return array|true Statements to run, or true if the statements have been executed
+ */
+ public function sql_create_index($table_name, $index_name, $column);
+
+ /**
+ * Drop Index
+ *
+ * @param string $table_name Table to modify
+ * @param string $index_name Name of the index to delete
+ * @return array|true Statements to run, or true if the statements have been executed
+ */
+ public function sql_index_drop($table_name, $index_name);
+
+ /**
+ * Check if a specified index exists in table.
+ *
+ * NOTE: Does not return normal and PRIMARY KEY indexes
+ *
+ * @param string $table_name Table to check the index at
+ * @param string $index_name The index name to check
+ * @return bool True if index exists, else false
+ */
+ public function sql_unique_index_exists($table_name, $index_name);
+
+ /**
+ * Add unique index
+ *
+ * @param string $table_name Table to modify
+ * @param string $index_name Name of the unique index to create
+ * @param string|array $column Either a string with a column name, or an array with columns
+ * @return array|true Statements to run, or true if the statements have been executed
+ */
+ public function sql_create_unique_index($table_name, $index_name, $column);
+
+ /**
+ * Add primary key
+ *
+ * @param string $table_name Table to modify
+ * @param string|array $column Either a string with a column name, or an array with columns
+ * @param bool $inline Whether the query should actually be run,
+ * or return a string for creating the key
+ * @return array|true Statements to run, or true if the statements have been executed
+ */
+ public function sql_create_primary_key($table_name, $column, $inline = false);
+}
diff --git a/phpBB/phpbb/di/container_builder.php b/phpBB/phpbb/di/container_builder.php
index a214356ac3..fb391760ce 100644
--- a/phpBB/phpbb/di/container_builder.php
+++ b/phpBB/phpbb/di/container_builder.php
@@ -13,392 +13,502 @@
namespace phpbb\di;
+use phpbb\filesystem\filesystem;
+use Symfony\Component\Config\ConfigCache;
+use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
-use Symfony\Component\HttpKernel\DependencyInjection\RegisterListenersPass;
+use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
+use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
+use Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass;
+use Symfony\Component\Filesystem\Exception\IOException;
+use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;
class container_builder
{
- /** @var string phpBB Root Path */
- protected $phpbb_root_path;
-
- /** @var string php file extension */
- protected $php_ext;
-
/**
- * The container under construction
- *
- * @var ContainerBuilder
- */
- protected $container;
+ * @var string The environment to use.
+ */
+ protected $environment;
/**
- * @var \phpbb\db\driver\driver_interface
- */
- protected $dbal_connection = null;
+ * @var string phpBB Root Path
+ */
+ protected $phpbb_root_path;
/**
- * @var array the installed extensions
- */
- protected $installed_exts = null;
+ * @var string php file extension
+ */
+ protected $php_ext;
/**
- * Indicates whether the php config file should be injected into the container (default to true).
- *
- * @var bool
- */
- protected $inject_config = true;
+ * The container under construction
+ *
+ * @var ContainerBuilder
+ */
+ protected $container;
/**
- * Indicates whether extensions should be used (default to true).
- *
- * @var bool
- */
+ * Indicates whether extensions should be used (default to true).
+ *
+ * @var bool
+ */
protected $use_extensions = true;
/**
- * Defines a custom path to find the configuration of the container (default to $this->phpbb_root_path . 'config')
- *
- * @var string
- */
+ * Defines a custom path to find the configuration of the container (default to $this->phpbb_root_path . 'config')
+ *
+ * @var string
+ */
protected $config_path = null;
/**
- * Indicates whether the phpBB compile pass should be used (default to true).
- *
- * @var bool
- */
- protected $use_custom_pass = true;
+ * Indicates whether the container should be dumped to the filesystem (default to true).
+ *
+ * If DEBUG_CONTAINER is set this option is ignored and a new container is build.
+ *
+ * @var bool
+ */
+ protected $use_cache = true;
/**
- * Indicates whether the kernel compile pass should be used (default to true).
- *
- * @var bool
- */
- protected $use_kernel_pass = true;
+ * Indicates if the container should be compiled automatically (default to true).
+ *
+ * @var bool
+ */
+ protected $compile_container = true;
/**
- * Indicates whether the container should be dumped to the filesystem (default to true).
- *
- * If DEBUG_CONTAINER is set this option is ignored and a new container is build.
- *
- * @var bool
- */
- protected $dump_container = true;
+ * Custom parameters to inject into the container.
+ *
+ * Default to:
+ * array(
+ * 'core.root_path', $this->phpbb_root_path,
+ * 'core.php_ext', $this->php_ext,
+ * );
+ *
+ * @var array
+ */
+ protected $custom_parameters = null;
/**
- * Indicates if the container should be compiled automatically (default to true).
- *
- * @var bool
- */
- protected $compile_container = true;
+ * @var \phpbb\config_php_file
+ */
+ protected $config_php_file;
/**
- * Custom parameters to inject into the container.
- *
- * Default to true:
- * array(
- * 'core.root_path', $this->phpbb_root_path,
- * 'core.php_ext', $this->php_ext,
- * );
- *
- * @var array
- */
- protected $custom_parameters = null;
+ * @var string
+ */
+ protected $cache_dir;
/**
- * @var \phpbb\config_php_file
- */
- protected $config_php_file;
+ * @var array
+ */
+ private $container_extensions;
/**
- * Constructor
- *
- * @param \phpbb\config_php_file $config_php_file
- * @param string $phpbb_root_path Path to the phpbb includes directory.
- * @param string $php_ext php file extension
- */
- function __construct(\phpbb\config_php_file $config_php_file, $phpbb_root_path, $php_ext)
+ * Constructor
+ *
+ * @param string $phpbb_root_path Path to the phpbb includes directory.
+ * @param string $php_ext php file extension
+ */
+ function __construct($phpbb_root_path, $php_ext)
{
- $this->config_php_file = $config_php_file;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
}
/**
- * Build and return a new Container respecting the current configuration
- *
- * @return \phpbb_cache_container|ContainerBuilder
- */
+ * Build and return a new Container respecting the current configuration
+ *
+ * @return \phpbb_cache_container|ContainerBuilder
+ */
public function get_container()
{
$container_filename = $this->get_container_filename();
- if (!defined('DEBUG_CONTAINER') && $this->dump_container && file_exists($container_filename))
+ $config_cache = new ConfigCache($container_filename, defined('DEBUG'));
+ if ($this->use_cache && $config_cache->isFresh())
{
- require($container_filename);
+ require($config_cache->getPath());
$this->container = new \phpbb_cache_container();
}
else
{
- if ($this->config_path === null)
- {
- $this->config_path = $this->phpbb_root_path . 'config';
- }
- $container_extensions = array(new \phpbb\di\extension\core($this->config_path));
+ $this->container_extensions = array(new extension\core($this->get_config_path()));
if ($this->use_extensions)
{
- $installed_exts = $this->get_installed_extensions();
- $container_extensions[] = new \phpbb\di\extension\ext($installed_exts);
+ $this->load_extensions();
}
- if ($this->inject_config)
+ // Inject the config
+ if ($this->config_php_file)
{
- $container_extensions[] = new \phpbb\di\extension\config($this->config_php_file);
+ $this->container_extensions[] = new extension\config($this->config_php_file);
}
- $this->container = $this->create_container($container_extensions);
+ $this->container = $this->create_container($this->container_extensions);
- if ($this->use_custom_pass)
- {
- // Symfony Kernel Listeners
- $this->container->addCompilerPass(new \phpbb\di\pass\collection_pass());
- $this->container->addCompilerPass(new RegisterListenersPass('dispatcher', 'event.listener_listener', 'event.listener'));
+ // Easy collections through tags
+ $this->container->addCompilerPass(new pass\collection_pass());
- if ($this->use_kernel_pass)
- {
- $this->container->addCompilerPass(new RegisterListenersPass('dispatcher'));
- }
- }
+ // Event listeners "phpBB style"
+ $this->container->addCompilerPass(new RegisterListenersPass('dispatcher', 'event.listener_listener', 'event.listener'));
+
+ // Event listeners "Symfony style"
+ $this->container->addCompilerPass(new RegisterListenersPass('dispatcher'));
+
+ $filesystem = new filesystem();
+ $loader = new YamlFileLoader($this->container, new FileLocator($filesystem->realpath($this->get_config_path())));
+ $loader->load($this->container->getParameter('core.environment') . '/config.yml');
$this->inject_custom_parameters();
if ($this->compile_container)
{
$this->container->compile();
- }
- if ($this->dump_container && !defined('DEBUG_CONTAINER'))
- {
- $this->dump_container($container_filename);
+ if ($this->use_cache)
+ {
+ $this->dump_container($config_cache);
+ }
}
}
- $this->container->set('config.php', $this->config_php_file);
-
- if ($this->compile_container)
+ if ($this->compile_container && $this->config_php_file)
{
- $this->inject_dbal();
+ $this->container->set('config.php', $this->config_php_file);
}
return $this->container;
}
/**
- * Set if the extensions should be used.
- *
- * @param bool $use_extensions
- */
- public function set_use_extensions($use_extensions)
+ * Enable the extensions.
+ *
+ * @param string $environment The environment to use
+ * @return $this
+ */
+ public function with_environment($environment)
+ {
+ $this->environment = $environment;
+
+ return $this;
+ }
+
+ /**
+ * Enable the extensions.
+ *
+ * @return $this
+ */
+ public function with_extensions()
{
- $this->use_extensions = $use_extensions;
+ $this->use_extensions = true;
+
+ return $this;
}
/**
- * Set if the phpBB compile pass have to be used.
- *
- * @param bool $use_custom_pass
- */
- public function set_use_custom_pass($use_custom_pass)
+ * Disable the extensions.
+ *
+ * @return $this
+ */
+ public function without_extensions()
{
- $this->use_custom_pass = $use_custom_pass;
+ $this->use_extensions = false;
+
+ return $this;
}
/**
- * Set if the kernel compile pass have to be used.
- *
- * @param bool $use_kernel_pass
- */
- public function set_use_kernel_pass($use_kernel_pass)
+ * Enable the caching of the container.
+ *
+ * If DEBUG_CONTAINER is set this option is ignored and a new container is build.
+ *
+ * @return $this
+ */
+ public function with_cache()
{
- $this->use_kernel_pass = $use_kernel_pass;
+ $this->use_cache = true;
+
+ return $this;
}
/**
- * Set if the php config file should be injecting into the container.
- *
- * @param bool $inject_config
- */
- public function set_inject_config($inject_config)
+ * Disable the caching of the container.
+ *
+ * @return $this
+ */
+ public function without_cache()
{
- $this->inject_config = $inject_config;
+ $this->use_cache = false;
+
+ return $this;
}
/**
- * Set if a dump container should be used.
- *
- * If DEBUG_CONTAINER is set this option is ignored and a new container is build.
- *
- * @var bool $dump_container
- */
- public function set_dump_container($dump_container)
+ * Set the cache directory.
+ *
+ * @param string $cache_dir The cache directory.
+ * @return $this
+ */
+ public function with_cache_dir($cache_dir)
{
- $this->dump_container = $dump_container;
+ $this->cache_dir = $cache_dir;
+
+ return $this;
}
/**
- * Set if the container should be compiled automatically (default to true).
- *
- * @var bool $dump_container
- */
- public function set_compile_container($compile_container)
+ * Enable the compilation of the container.
+ *
+ * @return $this
+ */
+ public function with_compiled_container()
{
- $this->compile_container = $compile_container;
+ $this->compile_container = true;
+
+ return $this;
+ }
+
+ /**
+ * Disable the compilation of the container.
+ *
+ * @return $this
+ */
+ public function without_compiled_container()
+ {
+ $this->compile_container = false;
+
+ return $this;
}
/**
- * Set a custom path to find the configuration of the container
- *
- * @param string $config_path
- */
- public function set_config_path($config_path)
+ * Set a custom path to find the configuration of the container.
+ *
+ * @param string $config_path
+ * @return $this
+ */
+ public function with_config_path($config_path)
{
$this->config_path = $config_path;
+
+ return $this;
}
/**
- * Set custom parameters to inject into the container.
- *
- * @param array $custom_parameters
- */
- public function set_custom_parameters($custom_parameters)
+ * Set custom parameters to inject into the container.
+ *
+ * @param array $custom_parameters
+ * @return $this
+ */
+ public function with_custom_parameters($custom_parameters)
{
$this->custom_parameters = $custom_parameters;
+
+ return $this;
}
/**
- * Dump the container to the disk.
- *
- * @param string $container_filename The name of the file.
- */
- protected function dump_container($container_filename)
+ * Set custom parameters to inject into the container.
+ *
+ * @param \phpbb\config_php_file $config_php_file
+ * @return $this
+ */
+ public function with_config(\phpbb\config_php_file $config_php_file)
{
- $dumper = new PhpDumper($this->container);
- $cached_container_dump = $dumper->dump(array(
- 'class' => 'phpbb_cache_container',
- 'base_class' => 'Symfony\\Component\\DependencyInjection\\ContainerBuilder',
- ));
+ $this->config_php_file = $config_php_file;
- file_put_contents($container_filename, $cached_container_dump);
+ return $this;
}
/**
- * Inject the connection into the container if one was opened.
- */
- protected function inject_dbal()
+ * Returns the path to the container configuration (default: root_path/config)
+ *
+ * @return string
+ */
+ protected function get_config_path()
{
- if ($this->dbal_connection !== null)
- {
- $this->container->get('dbal.conn')->set_driver($this->dbal_connection);
- }
+ return $this->config_path ?: $this->phpbb_root_path . 'config';
}
/**
- * Get DB connection.
- *
- * @return \phpbb\db\driver\driver_interface
- */
- protected function get_dbal_connection()
+ * Returns the path to the cache directory (default: root_path/cache/environment).
+ *
+ * @return string Path to the cache directory.
+ */
+ protected function get_cache_dir()
{
- if ($this->dbal_connection === null)
- {
- $dbal_driver_class = $this->config_php_file->convert_30_dbms_to_31($this->config_php_file->get('dbms'));
- $this->dbal_connection = new $dbal_driver_class();
- $this->dbal_connection->sql_connect(
- $this->config_php_file->get('dbhost'),
- $this->config_php_file->get('dbuser'),
- $this->config_php_file->get('dbpasswd'),
- $this->config_php_file->get('dbname'),
- $this->config_php_file->get('dbport'),
- defined('PHPBB_DB_NEW_LINK') && PHPBB_DB_NEW_LINK
- );
- }
-
- return $this->dbal_connection;
+ return $this->cache_dir ?: $this->phpbb_root_path . 'cache/' . $this->get_environment() . '/';
}
/**
- * Get enabled extensions.
- *
- * @return array enabled extensions
- */
- protected function get_installed_extensions()
+ * Load the enabled extensions.
+ */
+ protected function load_extensions()
{
- $db = $this->get_dbal_connection();
- $extension_table = $this->config_php_file->get('table_prefix') . 'ext';
+ if ($this->config_php_file !== null)
+ {
+ // Build an intermediate container to load the ext list from the database
+ $container_builder = new container_builder($this->phpbb_root_path, $this->php_ext);
+ $ext_container = $container_builder
+ ->without_cache()
+ ->without_extensions()
+ ->with_config($this->config_php_file)
+ ->with_environment('production')
+ ->without_compiled_container()
+ ->get_container()
+ ;
+
+ $ext_container->register('cache.driver', '\\phpbb\\cache\\driver\\dummy');
+ $ext_container->compile();
+
+ $extensions = $ext_container->get('ext.manager')->all_enabled();
+
+ // Load each extension found
+ foreach ($extensions as $ext_name => $path)
+ {
+ $extension_class = '\\' . str_replace('/', '\\', $ext_name) . '\\di\\extension';
- $sql = 'SELECT *
- FROM ' . $extension_table . '
- WHERE ext_active = 1';
+ if (!class_exists($extension_class))
+ {
+ $extension_class = '\\phpbb\\extension\\di\\extension_base';
+ }
- $result = $db->sql_query($sql);
- $rows = $db->sql_fetchrowset($result);
- $db->sql_freeresult($result);
+ $this->container_extensions[] = new $extension_class($ext_name, $path);
- $exts = array();
- foreach ($rows as $row)
+ // Load extension autoloader
+ $filename = $path . 'vendor/autoload.php';
+ if (file_exists($filename))
+ {
+ require $filename;
+ }
+ }
+ }
+ else
{
- $exts[$row['ext_name']] = $this->phpbb_root_path . 'ext/' . $row['ext_name'] . '/';
+ // To load the extensions we need the database credentials.
+ // Automatically disable the extensions if we don't have them.
+ $this->use_extensions = false;
}
+ }
+
+ /**
+ * Dump the container to the disk.
+ *
+ * @param ConfigCache $cache The config cache
+ */
+ protected function dump_container($cache)
+ {
+ try
+ {
+ $dumper = new PhpDumper($this->container);
+ $cached_container_dump = $dumper->dump(array(
+ 'class' => 'phpbb_cache_container',
+ 'base_class' => 'Symfony\\Component\\DependencyInjection\\ContainerBuilder',
+ ));
- return $exts;
+ $cache->write($cached_container_dump, $this->container->getResources());
+ }
+ catch (IOException $e)
+ {
+ // Don't fail if the cache isn't writeable
+ }
}
/**
- * Create the ContainerBuilder object
- *
- * @param array $extensions Array of Container extension objects
- * @return ContainerBuilder object
- */
+ * Create the ContainerBuilder object
+ *
+ * @param array $extensions Array of Container extension objects
+ * @return ContainerBuilder object
+ */
protected function create_container(array $extensions)
{
- $container = new ContainerBuilder();
+ $container = new ContainerBuilder(new ParameterBag($this->get_core_parameters()));
+
+ $extensions_alias = array();
foreach ($extensions as $extension)
{
$container->registerExtension($extension);
- $container->loadFromExtension($extension->getAlias());
+ $extensions_alias[] = $extension->getAlias();
}
+ $container->getCompilerPassConfig()->setMergePass(new MergeExtensionConfigurationPass($extensions_alias));
+
return $container;
}
/**
- * Inject the customs parameters into the container
- */
+ * Inject the customs parameters into the container
+ */
protected function inject_custom_parameters()
{
- if ($this->custom_parameters === null)
+ if ($this->custom_parameters !== null)
{
- $this->custom_parameters = array(
- 'core.root_path' => $this->phpbb_root_path,
- 'core.php_ext' => $this->php_ext,
- );
+ foreach ($this->custom_parameters as $key => $value)
+ {
+ $this->container->setParameter($key, $value);
+ }
}
+ }
- foreach ($this->custom_parameters as $key => $value)
+ /**
+ * Returns the core parameters.
+ *
+ * @return array An array of core parameters
+ */
+ protected function get_core_parameters()
+ {
+ return array_merge(
+ array(
+ 'core.root_path' => $this->phpbb_root_path,
+ 'core.php_ext' => $this->php_ext,
+ 'core.environment' => $this->get_environment(),
+ 'core.debug' => defined('DEBUG') ? DEBUG : false,
+ ),
+ $this->get_env_parameters()
+ );
+ }
+
+ /**
+ * Gets the environment parameters.
+ *
+ * Only the parameters starting with "PHPBB__" are considered.
+ *
+ * @return array An array of parameters
+ */
+ protected function get_env_parameters()
+ {
+ $parameters = array();
+ foreach ($_SERVER as $key => $value)
{
- $this->container->setParameter($key, $value);
+ if (0 === strpos($key, 'PHPBB__'))
+ {
+ $parameters[strtolower(str_replace('__', '.', substr($key, 9)))] = $value;
+ }
}
+
+ return $parameters;
}
/**
- * Get the filename under which the dumped container will be stored.
- *
- * @return string Path for dumped container
- */
+ * Get the filename under which the dumped container will be stored.
+ *
+ * @return string Path for dumped container
+ */
protected function get_container_filename()
{
- return $this->phpbb_root_path . 'cache/container_' . md5($this->phpbb_root_path) . '.' . $this->php_ext;
+ return $this->get_cache_dir() . 'container_' . md5($this->phpbb_root_path) . '.' . $this->php_ext;
+ }
+
+ /**
+ * Return the name of the current environment.
+ *
+ * @return string
+ */
+ protected function get_environment()
+ {
+ return $this->environment ?: PHPBB_ENVIRONMENT;
}
}
diff --git a/phpBB/phpbb/di/extension/container_configuration.php b/phpBB/phpbb/di/extension/container_configuration.php
new file mode 100644
index 0000000000..4cc7c7c0d1
--- /dev/null
+++ b/phpBB/phpbb/di/extension/container_configuration.php
@@ -0,0 +1,46 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\di\extension;
+
+use Symfony\Component\Config\Definition\Builder\TreeBuilder;
+use Symfony\Component\Config\Definition\ConfigurationInterface;
+
+class container_configuration implements ConfigurationInterface
+{
+
+ /**
+ * Generates the configuration tree builder.
+ *
+ * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder
+ */
+ public function getConfigTreeBuilder()
+ {
+ $treeBuilder = new TreeBuilder();
+ $rootNode = $treeBuilder->root('core');
+ $rootNode
+ ->children()
+ ->booleanNode('require_dev_dependencies')->defaultValue(false)->end()
+ ->arrayNode('twig')
+ ->addDefaultsIfNotSet()
+ ->children()
+ ->booleanNode('debug')->defaultValue(null)->end()
+ ->booleanNode('auto_reload')->defaultValue(null)->end()
+ ->booleanNode('enable_debug_extension')->defaultValue(false)->end()
+ ->end()
+ ->end()
+ ->end()
+ ;
+ return $treeBuilder;
+ }
+}
diff --git a/phpBB/phpbb/di/extension/core.php b/phpBB/phpbb/di/extension/core.php
index ca4fa5c082..91b321a684 100644
--- a/phpBB/phpbb/di/extension/core.php
+++ b/phpBB/phpbb/di/extension/core.php
@@ -13,10 +13,11 @@
namespace phpbb\di\extension;
+use Symfony\Component\Config\FileLocator;
+use Symfony\Component\Config\Resource\FileResource;
use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
-use Symfony\Component\Config\FileLocator;
+use Symfony\Component\HttpKernel\DependencyInjection\Extension;
/**
* Container core extension
@@ -24,42 +25,89 @@ use Symfony\Component\Config\FileLocator;
class core extends Extension
{
/**
- * Config path
- * @var string
- */
+ * Config path
+ * @var string
+ */
protected $config_path;
/**
- * Constructor
- *
- * @param string $config_path Config path
- */
+ * Constructor
+ *
+ * @param string $config_path Config path
+ */
public function __construct($config_path)
{
$this->config_path = $config_path;
}
/**
- * Loads a specific configuration.
- *
- * @param array $config An array of configuration values
- * @param ContainerBuilder $container A ContainerBuilder instance
- *
- * @throws \InvalidArgumentException When provided tag is not defined in this extension
- */
- public function load(array $config, ContainerBuilder $container)
+ * Loads a specific configuration.
+ *
+ * @param array $configs An array of configuration values
+ * @param ContainerBuilder $container A ContainerBuilder instance
+ *
+ * @throws \InvalidArgumentException When provided tag is not defined in this extension
+ */
+ public function load(array $configs, ContainerBuilder $container)
{
- $loader = new YamlFileLoader($container, new FileLocator(phpbb_realpath($this->config_path)));
- $loader->load('services.yml');
+ $filesystem = new \phpbb\filesystem\filesystem();
+ $loader = new YamlFileLoader($container, new FileLocator($filesystem->realpath($this->config_path)));
+ $loader->load($container->getParameter('core.environment') . '/container/environment.yml');
+
+ $config = $this->getConfiguration($configs, $container);
+ $config = $this->processConfiguration($config, $configs);
+
+ if ($config['require_dev_dependencies'])
+ {
+ if (!class_exists('Goutte\Client', true))
+ {
+ trigger_error(
+ 'Composer development dependencies have not been set up for the ' . $container->getParameter('core.environment') . ' environment yet, run ' .
+ "'php ../composer.phar install --dev' from the phpBB directory to do so.",
+ E_USER_ERROR
+ );
+ }
+ }
+
+ // Set the Twig options if defined in the environment
+ $definition = $container->getDefinition('template.twig.environment');
+ $twig_environment_options = $definition->getArgument(7);
+ if ($config['twig']['debug'])
+ {
+ $twig_environment_options['debug'] = true;
+ }
+ if ($config['twig']['auto_reload'])
+ {
+ $twig_environment_options['auto_reload'] = true;
+ }
+ // Replace the 8th argument, the options passed to the environment
+ $definition->replaceArgument(7, $twig_environment_options);
+
+ if ($config['twig']['enable_debug_extension'])
+ {
+ $definition = $container->getDefinition('template.twig.extensions.debug');
+ $definition->addTag('twig.extension');
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getConfiguration(array $config, ContainerBuilder $container)
+ {
+ $r = new \ReflectionClass('\phpbb\di\extension\container_configuration');
+ $container->addResource(new FileResource($r->getFileName()));
+
+ return new container_configuration();
}
/**
- * Returns the recommended alias to use in XML.
- *
- * This alias is also the mandatory prefix to use when using YAML.
- *
- * @return string The alias
- */
+ * Returns the recommended alias to use in XML.
+ *
+ * This alias is also the mandatory prefix to use when using YAML.
+ *
+ * @return string The alias
+ */
public function getAlias()
{
return 'core';
diff --git a/phpBB/phpbb/di/extension/ext.php b/phpBB/phpbb/di/extension/ext.php
deleted file mode 100644
index 718c992d2e..0000000000
--- a/phpBB/phpbb/di/extension/ext.php
+++ /dev/null
@@ -1,67 +0,0 @@
-<?php
-/**
-*
-* This file is part of the phpBB Forum Software package.
-*
-* @copyright (c) phpBB Limited <https://www.phpbb.com>
-* @license GNU General Public License, version 2 (GPL-2.0)
-*
-* For full copyright and license information, please see
-* the docs/CREDITS.txt file.
-*
-*/
-
-namespace phpbb\di\extension;
-
-use Symfony\Component\DependencyInjection\ContainerBuilder;
-use Symfony\Component\HttpKernel\DependencyInjection\Extension;
-use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
-use Symfony\Component\Config\FileLocator;
-
-/**
-* Container ext extension
-*/
-class ext extends Extension
-{
- protected $paths = array();
-
- public function __construct($enabled_extensions)
- {
- foreach ($enabled_extensions as $ext => $path)
- {
- $this->paths[] = $path;
- }
- }
-
- /**
- * Loads a specific configuration.
- *
- * @param array $config An array of configuration values
- * @param ContainerBuilder $container A ContainerBuilder instance
- *
- * @throws \InvalidArgumentException When provided tag is not defined in this extension
- */
- public function load(array $config, ContainerBuilder $container)
- {
- foreach ($this->paths as $path)
- {
- if (file_exists($path . '/config/services.yml'))
- {
- $loader = new YamlFileLoader($container, new FileLocator(phpbb_realpath($path . '/config')));
- $loader->load('services.yml');
- }
- }
- }
-
- /**
- * Returns the recommended alias to use in XML.
- *
- * This alias is also the mandatory prefix to use when using YAML.
- *
- * @return string The alias
- */
- public function getAlias()
- {
- return 'ext';
- }
-}
diff --git a/phpBB/phpbb/di/ordered_service_collection.php b/phpBB/phpbb/di/ordered_service_collection.php
new file mode 100644
index 0000000000..046012ae5b
--- /dev/null
+++ b/phpBB/phpbb/di/ordered_service_collection.php
@@ -0,0 +1,117 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+namespace phpbb\di;
+
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+/**
+ * Collection of services in a specified order
+ */
+class ordered_service_collection extends service_collection
+{
+ /**
+ * @var bool
+ */
+ protected $is_ordered;
+
+ /**
+ * @var array
+ */
+ protected $service_ids;
+
+ /**
+ * Constructor
+ *
+ * @param ContainerInterface $container Container object
+ */
+ public function __construct(ContainerInterface $container)
+ {
+ $this->is_ordered = false;
+ $this->service_ids = array();
+
+ parent::__construct($container);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getIterator()
+ {
+ if (!$this->is_ordered)
+ {
+ $this->sort_services();
+ }
+
+ return new service_collection_iterator($this);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function offsetExists($index)
+ {
+ if (!$this->is_ordered)
+ {
+ $this->sort_services();
+ }
+
+ return parent::offsetExists($index);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function offsetGet($index)
+ {
+ if (!$this->is_ordered)
+ {
+ $this->sort_services();
+ }
+
+ return parent::offsetGet($index);
+ }
+
+ /**
+ * Adds a service ID to the collection
+ *
+ * @param string $service_id
+ * @param int $order
+ */
+ public function add($service_id, $order = 0)
+ {
+ $order = (int) $order;
+ $this->service_ids[$order][] = $service_id;
+ $this->is_ordered = false;
+ }
+
+ protected function sort_services()
+ {
+ if ($this->is_ordered)
+ {
+ return;
+ }
+
+ $this->exchangeArray(array());
+ ksort($this->service_ids);
+ foreach ($this->service_ids as $service_order_group)
+ {
+ foreach ($service_order_group as $service_id)
+ {
+ $this->offsetSet($service_id, null);
+ }
+ }
+
+ $this->is_ordered = true;
+ }
+}
diff --git a/phpBB/phpbb/di/pass/collection_pass.php b/phpBB/phpbb/di/pass/collection_pass.php
index a5c054674e..341f88518d 100644
--- a/phpBB/phpbb/di/pass/collection_pass.php
+++ b/phpBB/phpbb/di/pass/collection_pass.php
@@ -34,10 +34,30 @@ class collection_pass implements CompilerPassInterface
foreach ($container->findTaggedServiceIds('service_collection') as $id => $data)
{
$definition = $container->getDefinition($id);
+ $is_ordered_collection = (substr($definition->getClass(), -strlen('ordered_service_collection')) === 'ordered_service_collection');
+ $is_class_name_aware = (isset($data[0]['class_name_aware']) && $data[0]['class_name_aware']);
foreach ($container->findTaggedServiceIds($data[0]['tag']) as $service_id => $service_data)
{
- $definition->addMethodCall('add', array($service_id));
+ if ($is_ordered_collection)
+ {
+ $arguments = array($service_id, $service_data[0]['order']);
+ }
+ else
+ {
+ $arguments = array($service_id);
+ }
+
+ if ($is_class_name_aware)
+ {
+ $service_definition = $container->getDefinition($service_id);
+ $definition->addMethodCall('add_service_class', array(
+ $service_id,
+ $service_definition->getClass()
+ ));
+ }
+
+ $definition->addMethodCall('add', $arguments);
}
}
}
diff --git a/phpBB/phpbb/di/service_collection.php b/phpBB/phpbb/di/service_collection.php
index 82ca9bf679..8e9175e204 100644
--- a/phpBB/phpbb/di/service_collection.php
+++ b/phpBB/phpbb/di/service_collection.php
@@ -26,6 +26,11 @@ class service_collection extends \ArrayObject
protected $container;
/**
+ * @var array
+ */
+ protected $service_classes;
+
+ /**
* Constructor
*
* @param ContainerInterface $container Container object
@@ -33,6 +38,7 @@ class service_collection extends \ArrayObject
public function __construct(ContainerInterface $container)
{
$this->container = $container;
+ $this->service_classes = array();
}
/**
@@ -76,4 +82,25 @@ class service_collection extends \ArrayObject
{
$this->offsetSet($name, null);
}
+
+ /**
+ * Add a service's class to the collection
+ *
+ * @param string $service_id
+ * @param string $class
+ */
+ public function add_service_class($service_id, $class)
+ {
+ $this->service_classes[$service_id] = $class;
+ }
+
+ /**
+ * Get services' classes
+ *
+ * @return array
+ */
+ public function get_service_classes()
+ {
+ return $this->service_classes;
+ }
}
diff --git a/phpBB/phpbb/di/service_collection_iterator.php b/phpBB/phpbb/di/service_collection_iterator.php
index 0d031ab52d..31bc156e99 100644
--- a/phpBB/phpbb/di/service_collection_iterator.php
+++ b/phpBB/phpbb/di/service_collection_iterator.php
@@ -32,7 +32,7 @@ class service_collection_iterator extends \ArrayIterator
*/
public function __construct(service_collection $collection, $flags = 0)
{
- parent::__construct($collection, $flags);
+ parent::__construct($collection->getArrayCopy(), $flags);
$this->collection = $collection;
}
diff --git a/phpBB/phpbb/event/kernel_exception_subscriber.php b/phpBB/phpbb/event/kernel_exception_subscriber.php
index eb7831ad34..0a8a0183dc 100644
--- a/phpBB/phpbb/event/kernel_exception_subscriber.php
+++ b/phpBB/phpbb/event/kernel_exception_subscriber.php
@@ -106,7 +106,7 @@ class kernel_exception_subscriber implements EventSubscriberInterface
$event->setResponse($response);
}
- public static function getSubscribedEvents()
+ static public function getSubscribedEvents()
{
return array(
KernelEvents::EXCEPTION => 'on_kernel_exception',
diff --git a/phpBB/phpbb/event/kernel_request_subscriber.php b/phpBB/phpbb/event/kernel_request_subscriber.php
deleted file mode 100644
index ee9f29a59d..0000000000
--- a/phpBB/phpbb/event/kernel_request_subscriber.php
+++ /dev/null
@@ -1,82 +0,0 @@
-<?php
-/**
-*
-* This file is part of the phpBB Forum Software package.
-*
-* @copyright (c) phpBB Limited <https://www.phpbb.com>
-* @license GNU General Public License, version 2 (GPL-2.0)
-*
-* For full copyright and license information, please see
-* the docs/CREDITS.txt file.
-*
-*/
-
-namespace phpbb\event;
-
-use Symfony\Component\EventDispatcher\EventSubscriberInterface;
-use Symfony\Component\HttpKernel\KernelEvents;
-use Symfony\Component\HttpKernel\Event\GetResponseEvent;
-use Symfony\Component\HttpKernel\EventListener\RouterListener;
-use Symfony\Component\Routing\RequestContext;
-
-class kernel_request_subscriber implements EventSubscriberInterface
-{
- /**
- * Extension manager object
- * @var \phpbb\extension\manager
- */
- protected $manager;
-
- /**
- * PHP file extension
- * @var string
- */
- protected $php_ext;
-
- /**
- * Root path
- * @var string
- */
- protected $root_path;
-
- /**
- * Construct method
- *
- * @param \phpbb\extension\manager $manager Extension manager object
- * @param string $root_path Root path
- * @param string $php_ext PHP file extension
- */
- public function __construct(\phpbb\extension\manager $manager, $root_path, $php_ext)
- {
- $this->root_path = $root_path;
- $this->php_ext = $php_ext;
- $this->manager = $manager;
- }
-
- /**
- * This listener is run when the KernelEvents::REQUEST event is triggered
- *
- * This is responsible for setting up the routing information
- *
- * @param GetResponseEvent $event
- * @throws \BadMethodCallException
- * @return null
- */
- public function on_kernel_request(GetResponseEvent $event)
- {
- $request = $event->getRequest();
- $context = new RequestContext();
- $context->fromRequest($request);
-
- $matcher = phpbb_get_url_matcher($this->manager, $context, $this->root_path, $this->php_ext);
- $router_listener = new RouterListener($matcher, $context);
- $router_listener->onKernelRequest($event);
- }
-
- public static function getSubscribedEvents()
- {
- return array(
- KernelEvents::REQUEST => 'on_kernel_request',
- );
- }
-}
diff --git a/phpBB/phpbb/event/kernel_terminate_subscriber.php b/phpBB/phpbb/event/kernel_terminate_subscriber.php
index 3a709f73fd..f0d0a2f595 100644
--- a/phpBB/phpbb/event/kernel_terminate_subscriber.php
+++ b/phpBB/phpbb/event/kernel_terminate_subscriber.php
@@ -32,7 +32,7 @@ class kernel_terminate_subscriber implements EventSubscriberInterface
exit_handler();
}
- public static function getSubscribedEvents()
+ static public function getSubscribedEvents()
{
return array(
KernelEvents::TERMINATE => array('on_kernel_terminate', ~PHP_INT_MAX),
diff --git a/phpBB/phpbb/event/md_exporter.php b/phpBB/phpbb/event/md_exporter.php
index 02c2a1b9d6..e042d0a5d1 100644
--- a/phpBB/phpbb/event/md_exporter.php
+++ b/phpBB/phpbb/event/md_exporter.php
@@ -99,7 +99,7 @@ class md_exporter
{
$this->crawl_eventsmd($md_file, 'styles');
- $styles = array('prosilver', 'subsilver2');
+ $styles = array('prosilver');
foreach ($styles as $style)
{
$file_list = $this->get_recursive_file_list(
@@ -266,7 +266,7 @@ class md_exporter
$wiki_page = '= Template Events =' . "\n";
}
$wiki_page .= '{| class="zebra sortable" cellspacing="0" cellpadding="5"' . "\n";
- $wiki_page .= '! Identifier !! Prosilver Placement (If applicable) !! Subsilver Placement (If applicable) !! Added in Release !! Explanation' . "\n";
+ $wiki_page .= '! Identifier !! Prosilver Placement (If applicable) !! Added in Release !! Explanation' . "\n";
}
foreach ($this->events as $event_name => $event)
@@ -280,7 +280,7 @@ class md_exporter
}
else
{
- $wiki_page .= implode(', ', $event['files']['prosilver']) . ' || ' . implode(', ', $event['files']['subsilver2']);
+ $wiki_page .= implode(', ', $event['files']['prosilver']);
}
$wiki_page .= " || {$event['since']} || " . str_replace("\n", ' ', $event['description']) . "\n";
@@ -371,7 +371,6 @@ class md_exporter
{
$files_list = array(
'prosilver' => array(),
- 'subsilver2' => array(),
'adm' => array(),
);
@@ -391,10 +390,6 @@ class md_exporter
{
$files_list['prosilver'][] = substr($file, strlen('styles/prosilver/template/'));
}
- else if (($this->filter !== 'adm') && strpos($file, 'styles/subsilver2/template/') === 0)
- {
- $files_list['subsilver2'][] = substr($file, strlen('styles/subsilver2/template/'));
- }
else if (($this->filter === 'adm') && strpos($file, 'adm/style/') === 0)
{
$files_list['adm'][] = substr($file, strlen('adm/style/'));
diff --git a/phpBB/phpbb/extension/di/extension_base.php b/phpBB/phpbb/extension/di/extension_base.php
new file mode 100644
index 0000000000..ba74615e70
--- /dev/null
+++ b/phpBB/phpbb/extension/di/extension_base.php
@@ -0,0 +1,138 @@
+<?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\extension\di;
+
+use Symfony\Component\Config\FileLocator;
+use Symfony\Component\Config\Resource\FileResource;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
+use Symfony\Component\HttpKernel\DependencyInjection\Extension;
+
+/**
+ * Container core extension
+ */
+class extension_base extends Extension
+{
+ /**
+ * Name of the extension (vendor/name)
+ *
+ * @var string
+ */
+ protected $extension_name;
+
+ /**
+ * Path to the extension.
+ *
+ * @var string
+ */
+ protected $ext_path;
+
+ /**
+ * Constructor
+ *
+ * @param string $extension_name Name of the extension (vendor/name)
+ * @param string $ext_path Path to the extension
+ */
+ public function __construct($extension_name, $ext_path)
+ {
+ $this->extension_name = $extension_name;
+ $this->ext_path = $ext_path;
+ }
+
+ /**
+ * Loads a specific configuration.
+ *
+ * @param array $configs An array of configuration values
+ * @param ContainerBuilder $container A ContainerBuilder instance
+ *
+ * @throws \InvalidArgumentException When provided tag is not defined in this extension
+ */
+ public function load(array $configs, ContainerBuilder $container)
+ {
+ $this->load_services($container);
+ }
+
+ /**
+ * Loads the services.yml file.
+ *
+ * @param ContainerBuilder $container A ContainerBuilder instance
+ */
+ protected function load_services(ContainerBuilder $container)
+ {
+ $services_directory = false;
+ $services_file = false;
+
+ if (file_exists($this->ext_path . 'config/' . $container->getParameter('core.environment') . '/container/environment.yml'))
+ {
+ $services_directory = $this->ext_path . 'config/' . $container->getParameter('core.environment') . '/container/';
+ $services_file = 'environment.yml';
+ }
+ else if (!is_dir($this->ext_path . 'config/' . $container->getParameter('core.environment')))
+ {
+ if (file_exists($this->ext_path . 'config/default/container/environment.yml'))
+ {
+ $services_directory = $this->ext_path . 'config/default/container/';
+ $services_file = 'environment.yml';
+ }
+ else if (!is_dir($this->ext_path . 'config/default') && file_exists($this->ext_path . '/config/services.yml'))
+ {
+ $services_directory = $this->ext_path . 'config';
+ $services_file = 'services.yml';
+ }
+ }
+
+ if ($services_directory && $services_file)
+ {
+ $filesystem = new \phpbb\filesystem\filesystem();
+ $loader = new YamlFileLoader($container, new FileLocator($filesystem->realpath($services_directory)));
+ $loader->load($services_file);
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getConfiguration(array $config, ContainerBuilder $container)
+ {
+ $reflected = new \ReflectionClass($this);
+ $namespace = $reflected->getNamespaceName();
+
+ $class = $namespace . '\\di\configuration';
+ if (class_exists($class))
+ {
+ $r = new \ReflectionClass($class);
+ $container->addResource(new FileResource($r->getFileName()));
+
+ if (!method_exists($class, '__construct'))
+ {
+ $configuration = new $class();
+
+ return $configuration;
+ }
+ }
+
+ }
+
+ /**
+ * Returns the recommended alias to use in XML.
+ *
+ * This alias is also the mandatory prefix to use when using YAML.
+ *
+ * @return string The alias
+ */
+ public function getAlias()
+ {
+ return str_replace('/', '_', $this->extension_name);
+ }
+}
diff --git a/phpBB/phpbb/extension/exception.php b/phpBB/phpbb/extension/exception.php
index 3f7d251a4e..9050449bf1 100644
--- a/phpBB/phpbb/extension/exception.php
+++ b/phpBB/phpbb/extension/exception.php
@@ -16,10 +16,6 @@ namespace phpbb\extension;
/**
* Exception class for metadata
*/
-class exception extends \UnexpectedValueException
+class exception extends \phpbb\exception\runtime_exception
{
- public function __toString()
- {
- return $this->getMessage();
- }
}
diff --git a/phpBB/phpbb/extension/manager.php b/phpBB/phpbb/extension/manager.php
index 76f0e3558e..98d2d27278 100644
--- a/phpBB/phpbb/extension/manager.php
+++ b/phpBB/phpbb/extension/manager.php
@@ -26,7 +26,6 @@ class manager
protected $db;
protected $config;
protected $cache;
- protected $user;
protected $php_ext;
protected $extensions;
protected $extension_table;
@@ -39,15 +38,14 @@ class manager
* @param ContainerInterface $container A container
* @param \phpbb\db\driver\driver_interface $db A database connection
* @param \phpbb\config\config $config Config object
- * @param \phpbb\filesystem $filesystem
- * @param \phpbb\user $user User object
+ * @param \phpbb\filesystem\filesystem_interface $filesystem
* @param string $extension_table The name of the table holding extensions
* @param string $phpbb_root_path Path to the phpbb includes directory.
* @param string $php_ext php file extension, defaults to php
* @param \phpbb\cache\driver\driver_interface $cache A cache instance or null
* @param string $cache_name The name of the cache variable, defaults to _ext
*/
- public function __construct(ContainerInterface $container, \phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\filesystem $filesystem, \phpbb\user $user, $extension_table, $phpbb_root_path, $php_ext = 'php', \phpbb\cache\driver\driver_interface $cache = null, $cache_name = '_ext')
+ public function __construct(ContainerInterface $container, \phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\filesystem\filesystem_interface $filesystem, $extension_table, $phpbb_root_path, $php_ext = 'php', \phpbb\cache\driver\driver_interface $cache = null, $cache_name = '_ext')
{
$this->cache = $cache;
$this->cache_name = $cache_name;
@@ -58,7 +56,6 @@ class manager
$this->filesystem = $filesystem;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
- $this->user = $user;
$this->extensions = ($this->cache) ? $this->cache->get($this->cache_name) : false;
@@ -154,7 +151,7 @@ class manager
*/
public function create_extension_metadata_manager($name, \phpbb\template\template $template)
{
- return new \phpbb\extension\metadata_manager($name, $this->config, $this, $template, $this->user, $this->phpbb_root_path);
+ return new \phpbb\extension\metadata_manager($name, $this->config, $this, $template, $this->phpbb_root_path);
}
/**
@@ -464,15 +461,17 @@ class manager
* All enabled and disabled extensions are considered configured. A purged
* extension that is no longer in the database is not configured.
*
+ * @param bool $phpbb_relative Whether the path should be relative to phpbb root
+ *
* @return array An array with extension names as keys and and the
* database stored extension information as values
*/
- public function all_configured()
+ public function all_configured($phpbb_relative = true)
{
$configured = array();
foreach ($this->extensions as $name => $data)
{
- $data['ext_path'] = $this->phpbb_root_path . $data['ext_path'];
+ $data['ext_path'] = ($phpbb_relative ? $this->phpbb_root_path : '') . $data['ext_path'];
$configured[$name] = $data;
}
return $configured;
@@ -480,18 +479,19 @@ class manager
/**
* Retrieves all enabled extensions.
+ * @param bool $phpbb_relative Whether the path should be relative to phpbb root
*
* @return array An array with extension names as keys and and the
* database stored extension information as values
*/
- public function all_enabled()
+ public function all_enabled($phpbb_relative = true)
{
$enabled = array();
foreach ($this->extensions as $name => $data)
{
if ($data['ext_active'])
{
- $enabled[$name] = $this->phpbb_root_path . $data['ext_path'];
+ $enabled[$name] = ($phpbb_relative ? $this->phpbb_root_path : '') . $data['ext_path'];
}
}
return $enabled;
@@ -500,17 +500,19 @@ class manager
/**
* Retrieves all disabled extensions.
*
+ * @param bool $phpbb_relative Whether the path should be relative to phpbb root
+ *
* @return array An array with extension names as keys and and the
* database stored extension information as values
*/
- public function all_disabled()
+ public function all_disabled($phpbb_relative = true)
{
$disabled = array();
foreach ($this->extensions as $name => $data)
{
if (!$data['ext_active'])
{
- $disabled[$name] = $this->phpbb_root_path . $data['ext_path'];
+ $disabled[$name] = ($phpbb_relative ? $this->phpbb_root_path : '') . $data['ext_path'];
}
}
return $disabled;
diff --git a/phpBB/phpbb/extension/metadata_manager.php b/phpBB/phpbb/extension/metadata_manager.php
index a64d88fe39..4f080647c8 100644
--- a/phpBB/phpbb/extension/metadata_manager.php
+++ b/phpBB/phpbb/extension/metadata_manager.php
@@ -37,12 +37,6 @@ class metadata_manager
protected $template;
/**
- * phpBB User instance
- * @var \phpbb\user
- */
- protected $user;
-
- /**
* phpBB root path
* @var string
*/
@@ -73,15 +67,13 @@ class metadata_manager
* @param \phpbb\config\config $config phpBB Config instance
* @param \phpbb\extension\manager $extension_manager An instance of the phpBB extension manager
* @param \phpbb\template\template $template phpBB Template instance
- * @param \phpbb\user $user User instance
* @param string $phpbb_root_path Path to the phpbb includes directory.
*/
- public function __construct($ext_name, \phpbb\config\config $config, \phpbb\extension\manager $extension_manager, \phpbb\template\template $template, \phpbb\user $user, $phpbb_root_path)
+ public function __construct($ext_name, \phpbb\config\config $config, \phpbb\extension\manager $extension_manager, \phpbb\template\template $template, $phpbb_root_path)
{
$this->config = $config;
$this->extension_manager = $extension_manager;
$this->template = $template;
- $this->user = $user;
$this->phpbb_root_path = $phpbb_root_path;
$this->ext_name = $ext_name;
@@ -149,7 +141,7 @@ class metadata_manager
if (!file_exists($this->metadata_file))
{
- throw new \phpbb\extension\exception($this->user->lang('FILE_NOT_FOUND', $this->metadata_file));
+ throw new \phpbb\extension\exception('FILE_NOT_FOUND', array($this->metadata_file));
}
}
@@ -163,18 +155,18 @@ class metadata_manager
{
if (!file_exists($this->metadata_file))
{
- throw new \phpbb\extension\exception($this->user->lang('FILE_NOT_FOUND', $this->metadata_file));
+ throw new \phpbb\extension\exception('FILE_NOT_FOUND', array($this->metadata_file));
}
else
{
if (!($file_contents = file_get_contents($this->metadata_file)))
{
- throw new \phpbb\extension\exception($this->user->lang('FILE_CONTENT_ERR', $this->metadata_file));
+ throw new \phpbb\extension\exception('FILE_CONTENT_ERR', array($this->metadata_file));
}
if (($metadata = json_decode($file_contents, true)) === null)
{
- throw new \phpbb\extension\exception($this->user->lang('FILE_JSON_DECODE_ERR', $this->metadata_file));
+ throw new \phpbb\extension\exception('FILE_JSON_DECODE_ERR', array($this->metadata_file));
}
array_walk_recursive($metadata, array($this, 'sanitize_json'));
@@ -246,12 +238,12 @@ class metadata_manager
{
if (!isset($this->metadata[$name]))
{
- throw new \phpbb\extension\exception($this->user->lang('META_FIELD_NOT_SET', $name));
+ throw new \phpbb\extension\exception('META_FIELD_NOT_SET', array($name));
}
if (!preg_match($fields[$name], $this->metadata[$name]))
{
- throw new \phpbb\extension\exception($this->user->lang('META_FIELD_INVALID', $name));
+ throw new \phpbb\extension\exception('META_FIELD_INVALID', array($name));
}
}
break;
@@ -270,14 +262,14 @@ class metadata_manager
{
if (empty($this->metadata['authors']))
{
- throw new \phpbb\extension\exception($this->user->lang('META_FIELD_NOT_SET', 'authors'));
+ throw new \phpbb\extension\exception('META_FIELD_NOT_SET', array('authors'));
}
foreach ($this->metadata['authors'] as $author)
{
if (!isset($author['name']))
{
- throw new \phpbb\extension\exception($this->user->lang('META_FIELD_NOT_SET', 'author name'));
+ throw new \phpbb\extension\exception('META_FIELD_NOT_SET', array('author name'));
}
}
diff --git a/phpBB/phpbb/feed/attachments_base.php b/phpBB/phpbb/feed/attachments_base.php
index 04812f1570..b14dafe15a 100644
--- a/phpBB/phpbb/feed/attachments_base.php
+++ b/phpBB/phpbb/feed/attachments_base.php
@@ -16,7 +16,7 @@ namespace phpbb\feed;
/**
* Abstract class for feeds displaying attachments
*/
-abstract class attachments_base extends \phpbb\feed\base
+abstract class attachments_base extends base
{
/**
* Attachments that may be displayed
diff --git a/phpBB/phpbb/feed/base.php b/phpBB/phpbb/feed/base.php
index 322e2ee9f1..188d229515 100644
--- a/phpBB/phpbb/feed/base.php
+++ b/phpBB/phpbb/feed/base.php
@@ -1,27 +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.
-*
-*/
+ *
+ * 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\feed;
/**
-* Base class with some generic functions and settings.
-*/
-abstract class base
+ * Base class with some generic functions and settings.
+ */
+abstract class base implements feed_interface
{
/**
- * Feed helper object
- * @var \phpbb\feed\helper
- */
+ * Feed helper object
+ * @var \phpbb\feed\helper
+ */
protected $helper;
/** @var \phpbb\config\config */
@@ -43,46 +43,46 @@ abstract class base
protected $phpEx;
/**
- * SQL Query to be executed to get feed items
- */
- var $sql = array();
+ * SQL Query to be executed to get feed items
+ */
+ protected $sql = array();
/**
- * Keys specified for retrieval of title, content, etc.
- */
- var $keys = array();
+ * Keys specified for retrieval of title, content, etc.
+ */
+ protected $keys = array();
/**
- * Number of items to fetch. Usually overwritten by $config['feed_something']
- */
- var $num_items = 15;
+ * Number of items to fetch. Usually overwritten by $config['feed_something']
+ */
+ protected $num_items = 15;
/**
- * Separator for title elements to separate items (for example forum / topic)
- */
- var $separator = "\xE2\x80\xA2"; // &bull;
+ * Separator for title elements to separate items (for example forum / topic)
+ */
+ protected $separator = "\xE2\x80\xA2"; // &bull;
/**
- * Separator for the statistics row (Posted by, post date, replies, etc.)
- */
- var $separator_stats = "\xE2\x80\x94"; // &mdash;
+ * Separator for the statistics row (Posted by, post date, replies, etc.)
+ */
+ protected $separator_stats = "\xE2\x80\x94"; // &mdash;
/** @var mixed Query result handle */
protected $result;
/**
- * Constructor
- *
- * @param \phpbb\feed\helper $helper Feed helper
- * @param \phpbb\config\config $config Config object
- * @param \phpbb\db\driver\driver_interface $db Database connection
- * @param \phpbb\cache\driver\driver_interface $cache Cache object
- * @param \phpbb\user $user User object
- * @param \phpbb\auth\auth $auth Auth object
- * @param \phpbb\content_visibility $content_visibility Auth object
- * @param string $phpEx php file extension
- */
- function __construct(\phpbb\feed\helper $helper, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\cache\driver\driver_interface $cache, \phpbb\user $user, \phpbb\auth\auth $auth, \phpbb\content_visibility $content_visibility, $phpEx)
+ * Constructor
+ *
+ * @param \phpbb\feed\helper $helper Feed helper
+ * @param \phpbb\config\config $config Config object
+ * @param \phpbb\db\driver\driver_interface $db Database connection
+ * @param \phpbb\cache\driver\driver_interface $cache Cache object
+ * @param \phpbb\user $user User object
+ * @param \phpbb\auth\auth $auth Auth object
+ * @param \phpbb\content_visibility $content_visibility Auth object
+ * @param string $phpEx php file extension
+ */
+ public function __construct(\phpbb\feed\helper $helper, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db, \phpbb\cache\driver\driver_interface $cache, \phpbb\user $user, \phpbb\auth\auth $auth, \phpbb\content_visibility $content_visibility, $phpEx)
{
$this->config = $config;
$this->helper = $helper;
@@ -109,23 +109,23 @@ abstract class base
}
/**
- * Set keys.
- */
- function set_keys()
+ * {@inheritdoc}
+ */
+ public function set_keys()
{
}
/**
- * Open feed
- */
- function open()
+ * {@inheritdoc}
+ */
+ public function open()
{
}
/**
- * Close feed
- */
- function close()
+ * {@inheritdoc}
+ */
+ public function close()
{
if (!empty($this->result))
{
@@ -134,28 +134,47 @@ abstract class base
}
/**
- * Set key
- *
- * @param string $key Key
- * @param mixed $value Value
- */
- function set($key, $value)
+ * {@inheritdoc}
+ */
+ public function set($key, $value)
{
$this->keys[$key] = $value;
}
/**
- * Get key
- *
- * @param string $key Key
- * @return mixed
- */
- function get($key)
+ * {@inheritdoc}
+ */
+ public function get($key)
{
return (isset($this->keys[$key])) ? $this->keys[$key] : null;
}
- function get_readable_forums()
+ /**
+ * {@inheritdoc}
+ */
+ public function get_item()
+ {
+ if (!isset($this->result))
+ {
+ if (!$this->get_sql())
+ {
+ return false;
+ }
+
+ // Query database
+ $sql = $this->db->sql_build_query('SELECT', $this->sql);
+ $this->result = $this->db->sql_query_limit($sql, $this->num_items);
+ }
+
+ return $this->db->sql_fetchrow($this->result);
+ }
+
+ /**
+ * Returns the ids of the forums readable by the current user.
+ *
+ * @return int[]
+ */
+ protected function get_readable_forums()
{
static $forum_ids;
@@ -167,7 +186,12 @@ abstract class base
return $forum_ids;
}
- function get_moderator_approve_forums()
+ /**
+ * Returns the ids of the forum for which the current user can approve the post in the moderation queue.
+ *
+ * @return int[]
+ */
+ protected function get_moderator_approve_forums()
{
static $forum_ids;
@@ -179,7 +203,13 @@ abstract class base
return $forum_ids;
}
- function is_moderator_approve_forum($forum_id)
+ /**
+ * Returns true if the current user can approve the post of the given forum
+ *
+ * @param int $forum_id Forum id to check
+ * @return bool
+ */
+ protected function is_moderator_approve_forum($forum_id)
{
static $forum_ids;
@@ -191,7 +221,12 @@ abstract class base
return (isset($forum_ids[$forum_id])) ? true : false;
}
- function get_excluded_forums()
+ /**
+ * Returns the ids of the forum excluded from the feeds
+ *
+ * @return int[]
+ */
+ protected function get_excluded_forums()
{
static $forum_ids;
@@ -218,36 +253,35 @@ abstract class base
return $forum_ids;
}
- function is_excluded_forum($forum_id)
+ /**
+ * Returns true if the given id is in the excluded forums list.
+ *
+ * @param int $forum_id Id to check
+ * @return bool
+ */
+ protected function is_excluded_forum($forum_id)
{
$forum_ids = $this->get_excluded_forums();
return isset($forum_ids[$forum_id]) ? true : false;
}
- function get_passworded_forums()
+ /**
+ * Returns all password protected forum ids the current user is currently NOT authenticated for.
+ *
+ * @return array Array of forum ids
+ */
+ protected function get_passworded_forums()
{
return $this->user->get_passworded_forums();
}
- function get_item()
- {
- if (!isset($this->result))
- {
- if (!$this->get_sql())
- {
- return false;
- }
-
- // Query database
- $sql = $this->db->sql_build_query('SELECT', $this->sql);
- $this->result = $this->db->sql_query_limit($sql, $this->num_items);
- }
-
- return $this->db->sql_fetchrow($this->result);
- }
-
- function user_viewprofile($row)
+ /**
+ * Returns the link to the user profile.
+ *
+ * @return string
+ */
+ protected function user_viewprofile($row)
{
$author_id = (int) $row[$this->get('author_id')];
@@ -260,4 +294,11 @@ abstract class base
return '<a href="' . $this->helper->append_sid('memberlist.' . $this->phpEx, 'mode=viewprofile&amp;u=' . $author_id) . '">' . $row[$this->get('creator')] . '</a>';
}
+
+ /**
+ * Returns the SQL query used to retrieve the posts of the feed.
+ *
+ * @return string SQL SELECT query
+ */
+ protected abstract function get_sql();
}
diff --git a/phpBB/phpbb/feed/controller/feed.php b/phpBB/phpbb/feed/controller/feed.php
new file mode 100644
index 0000000000..31476b7317
--- /dev/null
+++ b/phpBB/phpbb/feed/controller/feed.php
@@ -0,0 +1,389 @@
+<?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\feed\controller;
+
+use phpbb\auth\auth;
+use phpbb\config\config;
+use phpbb\db\driver\driver_interface;
+use phpbb\exception\http_exception;
+use phpbb\feed\feed_interface;
+use phpbb\feed\exception\feed_unavailable_exception;
+use phpbb\feed\exception\unauthorized_exception;
+use phpbb\feed\helper as feed_helper;
+use phpbb\controller\helper as controller_helper;
+use phpbb\symfony_request;
+use phpbb\user;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
+
+class feed
+{
+ /**
+ * @var \Twig_Environment
+ */
+ protected $template;
+
+ /**
+ * @var symfony_request
+ */
+ protected $request;
+
+ /**
+ * @var controller_helper
+ */
+ protected $controller_helper;
+
+ /**
+ * @var config
+ */
+ protected $config;
+
+ /**
+ * @var driver_interface
+ */
+ protected $db;
+
+ /**
+ * @var ContainerInterface
+ */
+ protected $container;
+
+ /**
+ * @var feed_helper
+ */
+ protected $feed_helper;
+
+ /**
+ * @var user
+ */
+ protected $user;
+
+ /**
+ * @var auth
+ */
+ protected $auth;
+
+ /**
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * Constructor
+ *
+ * @param \Twig_Environment $twig
+ * @param symfony_request $request
+ * @param controller_helper $controller_helper
+ * @param config $config
+ * @param driver_interface $db
+ * @param ContainerInterface $container
+ * @param feed_helper $feed_helper
+ * @param user $user
+ * @param auth $auth
+ * @param string $php_ext
+ */
+ public function __construct(\Twig_Environment $twig, symfony_request $request, controller_helper $controller_helper, config $config, driver_interface $db, ContainerInterface $container, feed_helper $feed_helper, user $user, auth $auth, $php_ext)
+ {
+ $this->request = $request;
+ $this->controller_helper = $controller_helper;
+ $this->config = $config;
+ $this->db = $db;
+ $this->container = $container;
+ $this->feed_helper = $feed_helper;
+ $this->user = $user;
+ $this->auth = $auth;
+ $this->php_ext = $php_ext;
+ $this->template = $twig;
+ }
+
+ /**
+ * Controller for /feed/forums route
+ *
+ * @return Response
+ *
+ * @throws http_exception when the feed is disabled
+ */
+ public function forums()
+ {
+ if (!$this->config['feed_overall_forums'])
+ {
+ $this->send_unavailable();
+ }
+
+ return $this->send_feed($this->container->get('feed.forums'));
+ }
+
+ /**
+ * Controller for /feed/news route
+ *
+ * @return Response
+ *
+ * @throws http_exception when the feed is disabled
+ */
+ public function news()
+ {
+ // Get at least one news forum
+ $sql = 'SELECT forum_id
+ FROM ' . FORUMS_TABLE . '
+ WHERE ' . $this->db->sql_bit_and('forum_options', FORUM_OPTION_FEED_NEWS, '<> 0');
+ $result = $this->db->sql_query_limit($sql, 1, 0, 600);
+ $s_feed_news = (int) $this->db->sql_fetchfield('forum_id');
+ $this->db->sql_freeresult($result);
+
+ if (!$s_feed_news)
+ {
+ $this->send_unavailable();
+ }
+
+ return $this->send_feed($this->container->get('feed.news'));
+ }
+
+ /**
+ * Controller for /feed/topics route
+ *
+ * @return Response
+ *
+ * @throws http_exception when the feed is disabled
+ */
+ public function topics()
+ {
+ if (!$this->config['feed_topics_new'])
+ {
+ $this->send_unavailable();
+ }
+
+ return $this->send_feed($this->container->get('feed.topics'));
+ }
+
+ /**
+ * Controller for /feed/topics_new route
+ *
+ * @return Response
+ *
+ * @throws http_exception when the feed is disabled
+ */
+ public function topics_new()
+ {
+ return $this->topics();
+ }
+
+ /**
+ * Controller for /feed/topics_active route
+ *
+ * @return Response
+ *
+ * @throws http_exception when the feed is disabled
+ */
+ public function topics_active()
+ {
+ if (!$this->config['feed_topics_active'])
+ {
+ $this->send_unavailable();
+ }
+
+ return $this->send_feed($this->container->get('feed.topics_active'));
+ }
+
+ /**
+ * Controller for /feed/forum/{forum_id} route
+ *
+ * @param int $forum_id
+ *
+ * @return Response
+ *
+ * @throws http_exception when the feed is disabled
+ */
+ public function forum($forum_id)
+ {
+ if (!$this->config['feed_forum'])
+ {
+ $this->send_unavailable();
+ }
+
+ return $this->send_feed($this->container->get('feed.forum')->set_forum_id($forum_id));
+ }
+
+ /**
+ * Controller for /feed/topic/{topic_id} route
+ *
+ * @param int $topic_id
+ *
+ * @return Response
+ *
+ * @throws http_exception when the feed is disabled
+ */
+ public function topic($topic_id)
+ {
+ if (!$this->config['feed_topic'])
+ {
+ $this->send_unavailable();
+ }
+
+ return $this->send_feed($this->container->get('feed.topic')->set_topic_id($topic_id));
+ }
+
+ /**
+ * Controller for /feed/{mode] route
+ *
+ * @return Response
+ *
+ * @throws http_exception when the feed is disabled
+ */
+ public function overall()
+ {
+ if (!$this->config['feed_overall'])
+ {
+ $this->send_unavailable();
+ }
+
+ return $this->send_feed($this->container->get('feed.overall'));
+ }
+
+ /**
+ * Display a given feed
+ *
+ * @param feed_interface $feed
+ *
+ * @return Response
+ */
+ protected function send_feed(feed_interface $feed)
+ {
+ try
+ {
+ return $this->send_feed_do($feed);
+ }
+ catch (feed_unavailable_exception $e)
+ {
+ throw new http_exception(Response::HTTP_NOT_FOUND, $e->getMessage(), $e->get_parameters(), $e);
+ }
+ catch (unauthorized_exception $e)
+ {
+ throw new http_exception(Response::HTTP_FORBIDDEN, $e->getMessage(), $e->get_parameters(), $e);
+ }
+ }
+
+ /**
+ * Really send the feed
+ *
+ * @param feed_interface $feed
+ *
+ * @return Response
+ *
+ * @throw exception\feed_exception
+ */
+ protected function send_feed_do(feed_interface $feed)
+ {
+ $feed_updated_time = 0;
+ $item_vars = array();
+
+ $board_url = $this->feed_helper->get_board_url();
+
+ // Open Feed
+ $feed->open();
+
+ // Iterate through items
+ while ($row = $feed->get_item())
+ {
+ // BBCode options to correctly disable urls, smilies, bbcode...
+ if ($feed->get('options') === null)
+ {
+ // Allow all combinations
+ $options = 7;
+
+ if ($feed->get('enable_bbcode') !== null && $feed->get('enable_smilies') !== null && $feed->get('enable_magic_url') !== null)
+ {
+ $options = (($row[$feed->get('enable_bbcode')]) ? OPTION_FLAG_BBCODE : 0) + (($row[$feed->get('enable_smilies')]) ? OPTION_FLAG_SMILIES : 0) + (($row[$feed->get('enable_magic_url')]) ? OPTION_FLAG_LINKS : 0);
+ }
+ }
+ else
+ {
+ $options = $row[$feed->get('options')];
+ }
+
+ $title = (isset($row[$feed->get('title')]) && $row[$feed->get('title')] !== '') ? $row[$feed->get('title')] : ((isset($row[$feed->get('title2')])) ? $row[$feed->get('title2')] : '');
+
+ $published = ($feed->get('published') !== null) ? (int) $row[$feed->get('published')] : 0;
+ $updated = ($feed->get('updated') !== null) ? (int) $row[$feed->get('updated')] : 0;
+
+ $display_attachments = ($this->auth->acl_get('u_download') && $this->auth->acl_get('f_download', $row['forum_id']) && isset($row['post_attachment']) && $row['post_attachment']) ? true : false;
+
+ $item_row = array(
+ 'author' => ($feed->get('creator') !== null) ? $row[$feed->get('creator')] : '',
+ 'published' => ($published > 0) ? $this->feed_helper->format_date($published) : '',
+ 'updated' => ($updated > 0) ? $this->feed_helper->format_date($updated) : '',
+ 'link' => '',
+ 'title' => censor_text($title),
+ 'category' => ($this->config['feed_item_statistics'] && !empty($row['forum_id'])) ? $board_url . '/viewforum.' . $this->php_ext . '?f=' . $row['forum_id'] : '',
+ 'category_name' => ($this->config['feed_item_statistics'] && isset($row['forum_name'])) ? $row['forum_name'] : '',
+ 'description' => censor_text($this->feed_helper->generate_content($row[$feed->get('text')], $row[$feed->get('bbcode_uid')], $row[$feed->get('bitfield')], $options, $row['forum_id'], ($display_attachments ? $feed->get_attachments($row['post_id']) : array()))),
+ 'statistics' => '',
+ );
+
+ // Adjust items, fill link, etc.
+ $feed->adjust_item($item_row, $row);
+
+ $item_vars[] = $item_row;
+
+ $feed_updated_time = max($feed_updated_time, $published, $updated);
+ }
+
+ // If we do not have any items at all, sending the current time is better than sending no time.
+ if (!$feed_updated_time)
+ {
+ $feed_updated_time = time();
+ }
+
+ $feed->close();
+
+ $content = $this->template->render('feed.xml.twig', array(
+ // Some default assignments
+ // FEED_IMAGE is not used (atom)
+ 'FEED_IMAGE' => '',
+ 'SELF_LINK' => $this->controller_helper->route($this->request->attributes->get('_route'), $this->request->attributes->get('_route_params'), true, '', UrlGeneratorInterface::ABSOLUTE_URL),
+ 'FEED_LINK' => $board_url . '/index.' . $this->php_ext,
+ 'FEED_TITLE' => $this->config['sitename'],
+ 'FEED_SUBTITLE' => $this->config['site_desc'],
+ 'FEED_UPDATED' => $this->feed_helper->format_date($feed_updated_time),
+ 'FEED_LANG' => $this->user->lang['USER_LANG'],
+ 'FEED_AUTHOR' => $this->config['sitename'],
+
+ // Feed entries
+ 'FEED_ROWS' => $item_vars,
+ ));
+
+ $response = new Response($content);
+ $response->headers->set('Content-Type', 'application/atom+xml');
+ $response->setCharset('UTF-8');
+ $response->setLastModified(new \DateTime('@' . $feed_updated_time));
+
+ if (!empty($this->user->data['is_bot']))
+ {
+ // Let reverse proxies know we detected a bot.
+ $response->headers->set('X-PHPBB-IS-BOT', 'yes');
+ }
+
+ return $response;
+ }
+
+ /**
+ * Throw and exception saying that the feed isn't available
+ *
+ * @throw http_exception
+ */
+ protected function send_unavailable()
+ {
+ throw new http_exception(404, 'FEATURE_NOT_AVAILABLE');
+ }
+}
diff --git a/phpBB/phpbb/feed/exception/feed_exception.php b/phpBB/phpbb/feed/exception/feed_exception.php
new file mode 100644
index 0000000000..c9c888211e
--- /dev/null
+++ b/phpBB/phpbb/feed/exception/feed_exception.php
@@ -0,0 +1,21 @@
+<?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\feed\exception;
+
+use phpbb\exception\runtime_exception;
+
+abstract class feed_exception extends runtime_exception
+{
+
+}
diff --git a/phpBB/phpbb/feed/exception/feed_unavailable_exception.php b/phpBB/phpbb/feed/exception/feed_unavailable_exception.php
new file mode 100644
index 0000000000..4b6605b47d
--- /dev/null
+++ b/phpBB/phpbb/feed/exception/feed_unavailable_exception.php
@@ -0,0 +1,19 @@
+<?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\feed\exception;
+
+abstract class feed_unavailable_exception extends feed_exception
+{
+
+}
diff --git a/phpBB/phpbb/feed/exception/no_feed_exception.php b/phpBB/phpbb/feed/exception/no_feed_exception.php
new file mode 100644
index 0000000000..af6357b74c
--- /dev/null
+++ b/phpBB/phpbb/feed/exception/no_feed_exception.php
@@ -0,0 +1,22 @@
+<?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\feed\exception;
+
+class no_feed_exception extends feed_unavailable_exception
+{
+ public function __construct(\Exception $previous = null, $code = 0)
+ {
+ parent::__construct('NO_FEED', array(), $previous, $code);
+ }
+}
diff --git a/phpBB/phpbb/feed/exception/no_forum_exception.php b/phpBB/phpbb/feed/exception/no_forum_exception.php
new file mode 100644
index 0000000000..a60832957a
--- /dev/null
+++ b/phpBB/phpbb/feed/exception/no_forum_exception.php
@@ -0,0 +1,22 @@
+<?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\feed\exception;
+
+class no_forum_exception extends feed_unavailable_exception
+{
+ public function __construct($forum_id, \Exception $previous = null, $code = 0)
+ {
+ parent::__construct('NO_FORUM', array($forum_id), $previous, $code);
+ }
+}
diff --git a/phpBB/phpbb/feed/exception/no_topic_exception.php b/phpBB/phpbb/feed/exception/no_topic_exception.php
new file mode 100644
index 0000000000..b961a65d1c
--- /dev/null
+++ b/phpBB/phpbb/feed/exception/no_topic_exception.php
@@ -0,0 +1,22 @@
+<?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\feed\exception;
+
+class no_topic_exception extends feed_unavailable_exception
+{
+ public function __construct($topic_id, \Exception $previous = null, $code = 0)
+ {
+ parent::__construct('NO_TOPIC', array($topic_id), $previous, $code);
+ }
+}
diff --git a/phpBB/phpbb/feed/exception/unauthorized_exception.php b/phpBB/phpbb/feed/exception/unauthorized_exception.php
new file mode 100644
index 0000000000..7868975779
--- /dev/null
+++ b/phpBB/phpbb/feed/exception/unauthorized_exception.php
@@ -0,0 +1,19 @@
+<?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\feed\exception;
+
+abstract class unauthorized_exception extends feed_exception
+{
+
+}
diff --git a/phpBB/phpbb/feed/exception/unauthorized_forum_exception.php b/phpBB/phpbb/feed/exception/unauthorized_forum_exception.php
new file mode 100644
index 0000000000..4384c7b39b
--- /dev/null
+++ b/phpBB/phpbb/feed/exception/unauthorized_forum_exception.php
@@ -0,0 +1,22 @@
+<?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\feed\exception;
+
+class unauthorized_forum_exception extends unauthorized_exception
+{
+ public function __construct($forum_id, \Exception $previous = null, $code = 0)
+ {
+ parent::__construct('SORRY_AUTH_READ', array($forum_id), $previous, $code);
+ }
+}
diff --git a/phpBB/phpbb/feed/exception/unauthorized_topic_exception.php b/phpBB/phpbb/feed/exception/unauthorized_topic_exception.php
new file mode 100644
index 0000000000..f49f0a0476
--- /dev/null
+++ b/phpBB/phpbb/feed/exception/unauthorized_topic_exception.php
@@ -0,0 +1,22 @@
+<?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\feed\exception;
+
+class unauthorized_topic_exception extends unauthorized_exception
+{
+ public function __construct($topic_id, \Exception $previous = null, $code = 0)
+ {
+ parent::__construct('SORRY_AUTH_READ_TOPIC', array($topic_id), $previous, $code);
+ }
+}
diff --git a/phpBB/phpbb/feed/factory.php b/phpBB/phpbb/feed/factory.php
deleted file mode 100644
index f364f06d03..0000000000
--- a/phpBB/phpbb/feed/factory.php
+++ /dev/null
@@ -1,127 +0,0 @@
-<?php
-/**
-*
-* This file is part of the phpBB Forum Software package.
-*
-* @copyright (c) phpBB Limited <https://www.phpbb.com>
-* @license GNU General Public License, version 2 (GPL-2.0)
-*
-* For full copyright and license information, please see
-* the docs/CREDITS.txt file.
-*
-*/
-
-namespace phpbb\feed;
-
-use Symfony\Component\DependencyInjection\ContainerInterface;
-
-/**
-* Factory class to return correct object
-*/
-class factory
-{
- /**
- * Service container object
- * @var ContainerInterface
- */
- protected $container;
-
- /** @var \phpbb\config\config */
- protected $config;
-
- /** @var \phpbb\db\driver\driver_interface */
- protected $db;
-
- /**
- * Constructor
- *
- * @param ContainerInterface $container Container object
- * @param \phpbb\config\config $config Config object
- * @param \phpbb\db\driver\driver_interface $db Database connection
- */
- public function __construct(ContainerInterface $container, \phpbb\config\config $config, \phpbb\db\driver\driver_interface $db)
- {
- $this->container = $container;
- $this->config = $config;
- $this->db = $db;
- }
-
- /**
- * Return correct object for specified mode
- *
- * @param string $mode The feeds mode.
- * @param int $forum_id Forum id specified by the script if forum feed provided.
- * @param int $topic_id Topic id specified by the script if topic feed provided.
- *
- * @return object Returns correct feeds object for specified mode.
- */
- function get_feed($mode, $forum_id, $topic_id)
- {
- switch ($mode)
- {
- case 'forums':
- if (!$this->config['feed_overall_forums'])
- {
- return false;
- }
-
- return $this->container->get('feed.forums');
- break;
-
- case 'topics':
- case 'topics_new':
- if (!$this->config['feed_topics_new'])
- {
- return false;
- }
-
- return $this->container->get('feed.topics');
- break;
-
- case 'topics_active':
- if (!$this->config['feed_topics_active'])
- {
- return false;
- }
-
- return $this->container->get('feed.topics_active');
- break;
-
- case 'news':
- // Get at least one news forum
- $sql = 'SELECT forum_id
- FROM ' . FORUMS_TABLE . '
- WHERE ' . $this->db->sql_bit_and('forum_options', FORUM_OPTION_FEED_NEWS, '<> 0');
- $result = $this->db->sql_query_limit($sql, 1, 0, 600);
- $s_feed_news = (int) $this->db->sql_fetchfield('forum_id');
- $this->db->sql_freeresult($result);
-
- if (!$s_feed_news)
- {
- return false;
- }
-
- return $this->container->get('feed.news');
- break;
-
- default:
- if ($topic_id && $this->config['feed_topic'])
- {
- return $this->container->get('feed.topic')
- ->set_topic_id($topic_id);
- }
- else if ($forum_id && $this->config['feed_forum'])
- {
- return $this->container->get('feed.forum')
- ->set_forum_id($forum_id);
- }
- else if ($this->config['feed_overall'])
- {
- return $this->container->get('feed.overall');
- }
-
- return false;
- break;
- }
- }
-}
diff --git a/phpBB/phpbb/feed/feed_interface.php b/phpBB/phpbb/feed/feed_interface.php
new file mode 100644
index 0000000000..c185cd249c
--- /dev/null
+++ b/phpBB/phpbb/feed/feed_interface.php
@@ -0,0 +1,67 @@
+<?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\feed;
+
+/**
+ * Interface implemented by all feeds types
+ */
+interface feed_interface
+{
+ /**
+ * Set keys.
+ */
+ public function set_keys();
+
+ /**
+ * Open feed
+ */
+ public function open();
+
+ /**
+ * Close feed
+ */
+ public function close();
+
+ /**
+ * Set key
+ *
+ * @param string $key Key
+ * @param mixed $value Value
+ */
+ public function set($key, $value);
+
+ /**
+ * Get key
+ *
+ * @param string $key Key
+ * @return mixed
+ */
+ public function get($key);
+
+ /**
+ * Get the next post in the feed
+ *
+ * @return array
+ */
+ public function get_item();
+
+ /**
+ * Adjust a feed entry
+ *
+ * @param $item_row
+ * @param $row
+ * @return array
+ */
+ public function adjust_item(&$item_row, &$row);
+}
diff --git a/phpBB/phpbb/feed/forum.php b/phpBB/phpbb/feed/forum.php
index 7a2087c1cd..6701c4d9e7 100644
--- a/phpBB/phpbb/feed/forum.php
+++ b/phpBB/phpbb/feed/forum.php
@@ -1,35 +1,39 @@
<?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.
-*
-*/
+ *
+ * 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\feed;
+use phpbb\feed\exception\no_feed_exception;
+use phpbb\feed\exception\no_forum_exception;
+use phpbb\feed\exception\unauthorized_forum_exception;
+
/**
-* Forum feed
-*
-* This will give you the last {$this->num_items} posts made
-* within a specific forum.
-*/
-class forum extends \phpbb\feed\post_base
+ * Forum feed
+ *
+ * This will give you the last {$this->num_items} posts made
+ * within a specific forum.
+ */
+class forum extends post_base
{
- var $forum_id = 0;
- var $forum_data = array();
+ protected $forum_id = 0;
+ protected $forum_data = array();
/**
- * Set the Forum ID
- *
- * @param int $forum_id Forum ID
- * @return \phpbb\feed\forum
- */
+ * Set the Forum ID
+ *
+ * @param int $forum_id Forum ID
+ * @return \phpbb\feed\forum
+ */
public function set_forum_id($forum_id)
{
$this->forum_id = (int) $forum_id;
@@ -37,7 +41,10 @@ class forum extends \phpbb\feed\post_base
return $this;
}
- function open()
+ /**
+ * {@inheritdoc}
+ */
+ public function open()
{
// Check if forum exists
$sql = 'SELECT forum_id, forum_name, forum_password, forum_type, forum_options
@@ -49,25 +56,25 @@ class forum extends \phpbb\feed\post_base
if (empty($this->forum_data))
{
- trigger_error('NO_FORUM');
+ throw new no_forum_exception($this->forum_id);
}
// Forum needs to be postable
if ($this->forum_data['forum_type'] != FORUM_POST)
{
- trigger_error('NO_FEED');
+ throw new no_feed_exception();
}
// Make sure forum is not excluded from feed
if (phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $this->forum_data['forum_options']))
{
- trigger_error('NO_FEED');
+ throw new no_feed_exception();
}
// Make sure we can read this forum
if (!$this->auth->acl_get('f_read', $this->forum_id))
{
- trigger_error('SORRY_AUTH_READ');
+ throw new unauthorized_forum_exception($this->forum_id);
}
// Make sure forum is not passworded or user is authed
@@ -77,7 +84,7 @@ class forum extends \phpbb\feed\post_base
if (isset($forum_ids_passworded[$this->forum_id]))
{
- trigger_error('SORRY_AUTH_READ');
+ throw new unauthorized_forum_exception($this->forum_id);
}
unset($forum_ids_passworded);
@@ -86,7 +93,10 @@ class forum extends \phpbb\feed\post_base
parent::open();
}
- function get_sql()
+ /**
+ * {@inheritdoc}
+ */
+ protected function get_sql()
{
// Determine topics with recent activity
$sql = 'SELECT topic_id, topic_last_post_time
@@ -114,7 +124,7 @@ class forum extends \phpbb\feed\post_base
$this->sql = array(
'SELECT' => 'p.post_id, p.topic_id, p.post_time, p.post_edit_time, p.post_visibility, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment, ' .
- 'u.username, u.user_id',
+ 'u.username, u.user_id',
'FROM' => array(
POSTS_TABLE => 'p',
USERS_TABLE => 'u',
@@ -129,7 +139,10 @@ class forum extends \phpbb\feed\post_base
return true;
}
- function adjust_item(&$item_row, &$row)
+ /**
+ * {@inheritdoc}
+ */
+ public function adjust_item(&$item_row, &$row)
{
parent::adjust_item($item_row, $row);
@@ -137,7 +150,10 @@ class forum extends \phpbb\feed\post_base
$item_row['forum_id'] = $this->forum_id;
}
- function get_item()
+ /**
+ * {@inheritdoc}
+ */
+ public function get_item()
{
return ($row = parent::get_item()) ? array_merge($this->forum_data, $row) : $row;
}
diff --git a/phpBB/phpbb/feed/forums.php b/phpBB/phpbb/feed/forums.php
index ee14a5bc76..92f2b2dd4d 100644
--- a/phpBB/phpbb/feed/forums.php
+++ b/phpBB/phpbb/feed/forums.php
@@ -1,29 +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.
-*
-*/
+ *
+ * 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\feed;
/**
-* 'All Forums' feed
-*
-* This will give you a list of all postable forums where feeds are enabled
-* including forum description, topic stats and post stats
-*/
-class forums extends \phpbb\feed\base
+ * 'All Forums' feed
+ *
+ * This will give you a list of all postable forums where feeds are enabled
+ * including forum description, topic stats and post stats
+ */
+class forums extends base
{
- var $num_items = 0;
+ protected $num_items = 0;
- function set_keys()
+ /**
+ * {@inheritdoc}
+ */
+ public function set_keys()
{
$this->set('title', 'forum_name');
$this->set('text', 'forum_desc');
@@ -33,7 +36,10 @@ class forums extends \phpbb\feed\base
$this->set('options', 'forum_desc_options');
}
- function get_sql()
+ /**
+ * {@inheritdoc}
+ */
+ public function get_sql()
{
$in_fid_ary = array_diff($this->get_readable_forums(), $this->get_excluded_forums());
if (empty($in_fid_ary))
@@ -55,7 +61,10 @@ class forums extends \phpbb\feed\base
return true;
}
- function adjust_item(&$item_row, &$row)
+ /**
+ * {@inheritdoc}
+ */
+ public function adjust_item(&$item_row, &$row)
{
$item_row['link'] = $this->helper->append_sid('viewforum.' . $this->phpEx, 'f=' . $row['forum_id']);
diff --git a/phpBB/phpbb/feed/helper.php b/phpBB/phpbb/feed/helper.php
index f2030f5ced..e15d1e131e 100644
--- a/phpBB/phpbb/feed/helper.php
+++ b/phpBB/phpbb/feed/helper.php
@@ -1,21 +1,21 @@
<?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.
-*
-*/
+ *
+ * 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\feed;
/**
-* Class with some helpful functions used in feeds
-*/
+ * Class with some helpful functions used in feeds
+ */
class helper
{
/** @var \phpbb\config\config */
@@ -31,13 +31,13 @@ class helper
protected $phpEx;
/**
- * Constructor
- *
- * @param \phpbb\config\config $config Config object
- * @param \phpbb\user $user User object
- * @param string $phpbb_root_path Root path
- * @param string $phpEx PHP file extension
- */
+ * Constructor
+ *
+ * @param \phpbb\config\config $config Config object
+ * @param \phpbb\user $user User object
+ * @param string $phpbb_root_path Root path
+ * @param string $phpEx PHP file extension
+ */
public function __construct(\phpbb\config\config $config, \phpbb\user $user, $phpbb_root_path, $phpEx)
{
$this->config = $config;
@@ -47,8 +47,8 @@ class helper
}
/**
- * Run links through append_sid(), prepend generate_board_url() and remove session id
- */
+ * Run links through append_sid(), prepend generate_board_url() and remove session id
+ */
public function get_board_url()
{
static $board_url;
@@ -62,16 +62,16 @@ class helper
}
/**
- * Run links through append_sid(), prepend generate_board_url() and remove session id
- */
+ * Run links through append_sid(), prepend generate_board_url() and remove session id
+ */
public function append_sid($url, $params)
{
return append_sid($this->get_board_url() . '/' . $url, $params, true, '');
}
/**
- * Generate ISO 8601 date string (RFC 3339)
- */
+ * Generate ISO 8601 date string (RFC 3339)
+ */
public function format_date($time)
{
static $zone_offset;
@@ -87,16 +87,16 @@ class helper
}
/**
- * Generate text content
- *
- * @param string $content is feed text content
- * @param string $uid is bbcode_uid
- * @param string $bitfield is bbcode bitfield
- * @param int $options bbcode flag options
- * @param int $forum_id is the forum id
- * @param array $post_attachments is an array containing the attachments and their respective info
- * @return string the html content to be printed for the feed
- */
+ * Generate text content
+ *
+ * @param string $content is feed text content
+ * @param string $uid is bbcode_uid
+ * @param string $bitfield is bbcode bitfield
+ * @param int $options bbcode flag options
+ * @param int $forum_id is the forum id
+ * @param array $post_attachments is an array containing the attachments and their respective info
+ * @return string the html content to be printed for the feed
+ */
public function generate_content($content, $uid, $bitfield, $options, $forum_id, $post_attachments)
{
if (empty($content))
@@ -122,16 +122,16 @@ class helper
// Firefox does not support CSS for feeds, though
// Remove font sizes
- // $content = preg_replace('#<span style="font-size: [0-9]+%; line-height: [0-9]+%;">([^>]+)</span>#iU', '\1', $content);
+ // $content = preg_replace('#<span style="font-size: [0-9]+%; line-height: [0-9]+%;">([^>]+)</span>#iU', '\1', $content);
// Make text strong :P
- // $content = preg_replace('#<span style="font-weight: bold?">(.*?)</span>#iU', '<strong>\1</strong>', $content);
+ // $content = preg_replace('#<span style="font-weight: bold?">(.*?)</span>#iU', '<strong>\1</strong>', $content);
// Italic
- // $content = preg_replace('#<span style="font-style: italic?">([^<]+)</span>#iU', '<em>\1</em>', $content);
+ // $content = preg_replace('#<span style="font-style: italic?">([^<]+)</span>#iU', '<em>\1</em>', $content);
// Underline
- // $content = preg_replace('#<span style="text-decoration: underline?">([^<]+)</span>#iU', '<u>\1</u>', $content);
+ // $content = preg_replace('#<span style="text-decoration: underline?">([^<]+)</span>#iU', '<u>\1</u>', $content);
// Remove embed Windows Media Streams
$content = preg_replace( '#<\!--\[if \!IE\]>-->([^[]+)<\!--<!\[endif\]-->#si', '', $content);
diff --git a/phpBB/phpbb/feed/news.php b/phpBB/phpbb/feed/news.php
index a02c199d85..fb6fa09278 100644
--- a/phpBB/phpbb/feed/news.php
+++ b/phpBB/phpbb/feed/news.php
@@ -1,27 +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.
-*
-*/
+ *
+ * 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\feed;
/**
-* News feed
-*
-* This will give you {$this->num_items} first posts
-* of all topics in the selected news forums.
-*/
-class news extends \phpbb\feed\topic_base
+ * News feed
+ *
+ * This will give you {$this->num_items} first posts
+ * of all topics in the selected news forums.
+ */
+class news extends topic_base
{
- function get_news_forums()
+ /**
+ * Returns the ids of the 'news forums'
+ * @return int[]
+ */
+ private function get_news_forums()
{
static $forum_ids;
@@ -48,7 +52,10 @@ class news extends \phpbb\feed\topic_base
return $forum_ids;
}
- function get_sql()
+ /**
+ * {@inheritdoc}
+ */
+ protected function get_sql()
{
// Determine forum ids
$in_fid_ary = array_intersect($this->get_news_forums(), $this->get_readable_forums());
diff --git a/phpBB/phpbb/feed/overall.php b/phpBB/phpbb/feed/overall.php
index ab452f5386..40cf94ace0 100644
--- a/phpBB/phpbb/feed/overall.php
+++ b/phpBB/phpbb/feed/overall.php
@@ -1,27 +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.
-*
-*/
+ *
+ * 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\feed;
/**
-* Board wide feed (aka overall feed)
-*
-* This will give you the newest {$this->num_items} posts
-* from the whole board.
-*/
-class overall extends \phpbb\feed\post_base
+ * Board wide feed (aka overall feed)
+ *
+ * This will give you the newest {$this->num_items} posts
+ * from the whole board.
+ */
+class overall extends post_base
{
- function get_sql()
+ /**
+ * {@inheritdoc}
+ */
+ protected function get_sql()
{
$forum_ids = array_diff($this->get_readable_forums(), $this->get_excluded_forums(), $this->get_passworded_forums());
if (empty($forum_ids))
@@ -55,8 +58,8 @@ class overall extends \phpbb\feed\post_base
// Get the actual data
$this->sql = array(
'SELECT' => 'f.forum_id, f.forum_name, ' .
- 'p.post_id, p.topic_id, p.post_time, p.post_edit_time, p.post_visibility, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment, ' .
- 'u.username, u.user_id',
+ 'p.post_id, p.topic_id, p.post_time, p.post_edit_time, p.post_visibility, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment, ' .
+ 'u.username, u.user_id',
'FROM' => array(
USERS_TABLE => 'u',
POSTS_TABLE => 'p',
@@ -77,7 +80,10 @@ class overall extends \phpbb\feed\post_base
return true;
}
- function adjust_item(&$item_row, &$row)
+ /**
+ * {@inheritdoc}
+ */
+ public function adjust_item(&$item_row, &$row)
{
parent::adjust_item($item_row, $row);
diff --git a/phpBB/phpbb/feed/post_base.php b/phpBB/phpbb/feed/post_base.php
index 011775b6af..f6dc39cbec 100644
--- a/phpBB/phpbb/feed/post_base.php
+++ b/phpBB/phpbb/feed/post_base.php
@@ -1,27 +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.
-*
-*/
+ *
+ * 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\feed;
/**
-* Abstract class for post based feeds
-*/
-abstract class post_base extends \phpbb\feed\attachments_base
+ * Abstract class for post based feeds
+ */
+abstract class post_base extends attachments_base
{
- var $num_items = 'feed_limit_post';
- var $attachments = array();
+ protected $num_items = 'feed_limit_post';
- function set_keys()
+ /**
+ * {@inheritdoc}
+ */
+ public function set_keys()
{
$this->set('title', 'post_subject');
$this->set('title2', 'topic_title');
@@ -40,7 +42,10 @@ abstract class post_base extends \phpbb\feed\attachments_base
$this->set('enable_magic_url', 'enable_magic_url');
}
- function adjust_item(&$item_row, &$row)
+ /**
+ * {@inheritdoc}
+ */
+ public function adjust_item(&$item_row, &$row)
{
$item_row['link'] = $this->helper->append_sid('viewtopic.' . $this->phpEx, "t={$row['topic_id']}&amp;p={$row['post_id']}#p{$row['post_id']}");
diff --git a/phpBB/phpbb/feed/topic.php b/phpBB/phpbb/feed/topic.php
index 66c49e55cf..f029c2b00e 100644
--- a/phpBB/phpbb/feed/topic.php
+++ b/phpBB/phpbb/feed/topic.php
@@ -1,35 +1,40 @@
<?php
/**
-*
-* This file is part of the phpBB Forum Software package.
-*
-* @copyright (c) phpBB Limited <https://www.phpbb.com>
-* @license GNU General Public License, version 2 (GPL-2.0)
-*
-* For full copyright and license information, please see
-* the docs/CREDITS.txt file.
-*
-*/
+ *
+ * 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\feed;
+use phpbb\feed\exception\no_feed_exception;
+use phpbb\feed\exception\no_topic_exception;
+use phpbb\feed\exception\unauthorized_forum_exception;
+use phpbb\feed\exception\unauthorized_topic_exception;
+
/**
-* Topic feed for a specific topic
-*
-* This will give you the last {$this->num_items} posts made within this topic.
-*/
-class topic extends \phpbb\feed\post_base
+ * Topic feed for a specific topic
+ *
+ * This will give you the last {$this->num_items} posts made within this topic.
+ */
+class topic extends post_base
{
- var $topic_id = 0;
- var $forum_id = 0;
- var $topic_data = array();
+ protected $topic_id = 0;
+ protected $forum_id = 0;
+ protected $topic_data = array();
/**
- * Set the Topic ID
- *
- * @param int $topic_id Topic ID
- * @return \phpbb\feed\topic
- */
+ * Set the Topic ID
+ *
+ * @param int $topic_id Topic ID
+ * @return \phpbb\feed\topic
+ */
public function set_topic_id($topic_id)
{
$this->topic_id = (int) $topic_id;
@@ -37,7 +42,10 @@ class topic extends \phpbb\feed\post_base
return $this;
}
- function open()
+ /**
+ * {@inheritdoc}
+ */
+ public function open()
{
$sql = 'SELECT f.forum_options, f.forum_password, t.topic_id, t.forum_id, t.topic_visibility, t.topic_title, t.topic_time, t.topic_views, t.topic_posts_approved, t.topic_type
FROM ' . TOPICS_TABLE . ' t
@@ -50,7 +58,7 @@ class topic extends \phpbb\feed\post_base
if (empty($this->topic_data))
{
- trigger_error('NO_TOPIC');
+ throw new no_topic_exception($this->topic_id);
}
$this->forum_id = (int) $this->topic_data['forum_id'];
@@ -58,19 +66,19 @@ class topic extends \phpbb\feed\post_base
// Make sure topic is either approved or user authed
if ($this->topic_data['topic_visibility'] != ITEM_APPROVED && !$this->auth->acl_get('m_approve', $this->forum_id))
{
- trigger_error('SORRY_AUTH_READ');
+ throw new unauthorized_topic_exception($this->topic_id);
}
// Make sure forum is not excluded from feed
if (phpbb_optionget(FORUM_OPTION_FEED_EXCLUDE, $this->topic_data['forum_options']))
{
- trigger_error('NO_FEED');
+ throw new no_feed_exception();
}
// Make sure we can read this forum
if (!$this->auth->acl_get('f_read', $this->forum_id))
{
- trigger_error('SORRY_AUTH_READ');
+ throw new unauthorized_forum_exception($this->forum_id);
}
// Make sure forum is not passworded or user is authed
@@ -80,7 +88,7 @@ class topic extends \phpbb\feed\post_base
if (isset($forum_ids_passworded[$this->forum_id]))
{
- trigger_error('SORRY_AUTH_READ');
+ throw new unauthorized_forum_exception($this->forum_id);
}
unset($forum_ids_passworded);
@@ -89,11 +97,14 @@ class topic extends \phpbb\feed\post_base
parent::open();
}
- function get_sql()
+ /**
+ * {@inheritdoc}
+ */
+ protected function get_sql()
{
$this->sql = array(
'SELECT' => 'p.post_id, p.post_time, p.post_edit_time, p.post_visibility, p.post_subject, p.post_text, p.bbcode_bitfield, p.bbcode_uid, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.post_attachment, ' .
- 'u.username, u.user_id',
+ 'u.username, u.user_id',
'FROM' => array(
POSTS_TABLE => 'p',
USERS_TABLE => 'u',
@@ -107,14 +118,20 @@ class topic extends \phpbb\feed\post_base
return true;
}
- function adjust_item(&$item_row, &$row)
+ /**
+ * {@inheritdoc}
+ */
+ public function adjust_item(&$item_row, &$row)
{
parent::adjust_item($item_row, $row);
$item_row['forum_id'] = $this->forum_id;
}
- function get_item()
+ /**
+ * {@inheritdoc}
+ */
+ public function get_item()
{
return ($row = parent::get_item()) ? array_merge($this->topic_data, $row) : $row;
}
diff --git a/phpBB/phpbb/feed/topic_base.php b/phpBB/phpbb/feed/topic_base.php
index f9ff368cba..0f1a9ccb70 100644
--- a/phpBB/phpbb/feed/topic_base.php
+++ b/phpBB/phpbb/feed/topic_base.php
@@ -1,26 +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.
-*
-*/
+ *
+ * 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\feed;
/**
-* Abstract class for topic based feeds
-*/
-abstract class topic_base extends \phpbb\feed\attachments_base
+ * Abstract class for topic based feeds
+ */
+abstract class topic_base extends attachments_base
{
- var $num_items = 'feed_limit_topic';
+ protected $num_items = 'feed_limit_topic';
- function set_keys()
+ /**
+ * {@inheritdoc}
+ */
+ public function set_keys()
{
$this->set('title', 'topic_title');
$this->set('title2', 'forum_name');
@@ -39,7 +42,10 @@ abstract class topic_base extends \phpbb\feed\attachments_base
$this->set('enable_magic_url', 'enable_magic_url');
}
- function adjust_item(&$item_row, &$row)
+ /**
+ * {@inheritdoc}
+ */
+ public function adjust_item(&$item_row, &$row)
{
$item_row['link'] = $this->helper->append_sid('viewtopic.' . $this->phpEx, 't=' . $row['topic_id'] . '&amp;p=' . $row['post_id'] . '#p' . $row['post_id']);
diff --git a/phpBB/phpbb/feed/topics.php b/phpBB/phpbb/feed/topics.php
index 2b9cb3501a..cf4a2e579e 100644
--- a/phpBB/phpbb/feed/topics.php
+++ b/phpBB/phpbb/feed/topics.php
@@ -1,27 +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.
-*
-*/
+ *
+ * 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\feed;
/**
-* New Topics feed
-*
-* This will give you the last {$this->num_items} created topics
-* including the first post.
-*/
-class topics extends \phpbb\feed\topic_base
+ * New Topics feed
+ *
+ * This will give you the last {$this->num_items} created topics
+ * including the first post.
+ */
+class topics extends topic_base
{
- function get_sql()
+ /**
+ * {@inheritdoc}
+ */
+ protected function get_sql()
{
$forum_ids_read = $this->get_readable_forums();
if (empty($forum_ids_read))
@@ -77,7 +80,10 @@ class topics extends \phpbb\feed\topic_base
return true;
}
- function adjust_item(&$item_row, &$row)
+ /**
+ * {@inheritdoc}
+ */
+ public function adjust_item(&$item_row, &$row)
{
parent::adjust_item($item_row, $row);
diff --git a/phpBB/phpbb/feed/topics_active.php b/phpBB/phpbb/feed/topics_active.php
index 6d5eddfc16..52340dc2d5 100644
--- a/phpBB/phpbb/feed/topics_active.php
+++ b/phpBB/phpbb/feed/topics_active.php
@@ -1,30 +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.
-*
-*/
+ *
+ * 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\feed;
/**
-* Active Topics feed
-*
-* This will give you the last {$this->num_items} topics
-* with replies made withing the last {$this->sort_days} days
-* including the last post.
-*/
-class topics_active extends \phpbb\feed\topic_base
+ * Active Topics feed
+ *
+ * This will give you the last {$this->num_items} topics
+ * with replies made withing the last {$this->sort_days} days
+ * including the last post.
+ */
+class topics_active extends topic_base
{
- var $sort_days = 7;
+ protected $sort_days = 7;
- function set_keys()
+ /**
+ * {@inheritdoc}
+ */
+ public function set_keys()
{
parent::set_keys();
@@ -32,7 +35,10 @@ class topics_active extends \phpbb\feed\topic_base
$this->set('creator', 'topic_last_poster_name');
}
- function get_sql()
+ /**
+ * {@inheritdoc}
+ */
+ protected function get_sql()
{
$forum_ids_read = $this->get_readable_forums();
if (empty($forum_ids_read))
@@ -94,7 +100,12 @@ class topics_active extends \phpbb\feed\topic_base
return true;
}
- function get_forum_ids()
+ /**
+ * Returns the ids of the forums not excluded from the active list
+ *
+ * @return int[]
+ */
+ private function get_forum_ids()
{
static $forum_ids;
@@ -122,7 +133,10 @@ class topics_active extends \phpbb\feed\topic_base
return $forum_ids;
}
- function adjust_item(&$item_row, &$row)
+ /**
+ * {@inheritdoc}
+ */
+ public function adjust_item(&$item_row, &$row)
{
parent::adjust_item($item_row, $row);
diff --git a/phpBB/phpbb/filesystem.php b/phpBB/phpbb/filesystem.php
index 77517082e5..af56d78845 100644
--- a/phpBB/phpbb/filesystem.php
+++ b/phpBB/phpbb/filesystem.php
@@ -14,37 +14,8 @@
namespace phpbb;
/**
-* A class with various functions that are related to paths, files and the filesystem
-*/
-class filesystem
+ * @deprecated 3.2.0-dev (To be removed 3.3.0) use \phpbb\filesystem\filesystem instead
+ */
+class filesystem extends \phpbb\filesystem\filesystem
{
- /**
- * Eliminates useless . and .. components from specified path.
- *
- * @param string $path Path to clean
- * @return string Cleaned path
- */
- public function clean_path($path)
- {
- $exploded = explode('/', $path);
- $filtered = array();
- foreach ($exploded as $part)
- {
- if ($part === '.' && !empty($filtered))
- {
- continue;
- }
-
- if ($part === '..' && !empty($filtered) && $filtered[sizeof($filtered) - 1] !== '.' && $filtered[sizeof($filtered) - 1] !== '..')
- {
- array_pop($filtered);
- }
- else
- {
- $filtered[] = $part;
- }
- }
- $path = implode('/', $filtered);
- return $path;
- }
}
diff --git a/phpBB/phpbb/filesystem/exception/filesystem_exception.php b/phpBB/phpbb/filesystem/exception/filesystem_exception.php
new file mode 100644
index 0000000000..d68fa9adf3
--- /dev/null
+++ b/phpBB/phpbb/filesystem/exception/filesystem_exception.php
@@ -0,0 +1,42 @@
+<?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\filesystem\exception;
+
+class filesystem_exception extends \phpbb\exception\runtime_exception
+{
+ /**
+ * Constructor
+ *
+ * @param string $message The Exception message to throw (must be a language variable).
+ * @param string $filename The file that caused the error.
+ * @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 = "", $filename = '', $parameters = array(), \Exception $previous = null, $code = 0)
+ {
+ parent::__construct($message, array_merge(array('filename' => $filename), $parameters), $previous, $code);
+ }
+
+ /**
+ * Returns the filename that triggered the error
+ *
+ * @return string
+ */
+ public function get_filename()
+ {
+ $parameters = parent::get_parameters();
+ return $parameters['filename'];
+ }
+}
diff --git a/phpBB/phpbb/filesystem/filesystem.php b/phpBB/phpbb/filesystem/filesystem.php
new file mode 100644
index 0000000000..2112882d1d
--- /dev/null
+++ b/phpBB/phpbb/filesystem/filesystem.php
@@ -0,0 +1,916 @@
+<?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\filesystem;
+
+use phpbb\filesystem\exception\filesystem_exception;
+
+/**
+ * A class with various functions that are related to paths, files and the filesystem
+ */
+class filesystem implements filesystem_interface
+{
+ /**
+ * Store some information about file ownership for phpBB's chmod function
+ *
+ * @var array
+ */
+ protected $chmod_info;
+
+ /**
+ * Stores current working directory
+ *
+ * @var string|bool current working directory or false if it cannot be recovered
+ */
+ protected $working_directory;
+
+ /**
+ * Symfony's Filesystem component
+ *
+ * @var \Symfony\Component\Filesystem\Filesystem
+ */
+ protected $symfony_filesystem;
+
+ /**
+ * Constructor
+ */
+ public function __construct()
+ {
+ $this->chmod_info = array();
+ $this->symfony_filesystem = new \Symfony\Component\Filesystem\Filesystem();
+ $this->working_directory = null;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function chgrp($files, $group, $recursive = false)
+ {
+ try
+ {
+ $this->symfony_filesystem->chgrp($files, $group, $recursive);
+ }
+ catch (\Symfony\Component\Filesystem\Exception\IOException $e)
+ {
+ // Try to recover filename
+ // By the time this is written that is at the end of the message
+ $error = trim($e->getMessage());
+ $file = substr($error, strrpos($error, ' '));
+
+ throw new filesystem_exception('CANNOT_CHANGE_FILE_GROUP', $file, array(), $e);
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function chmod($files, $perms = null, $recursive = false, $force_chmod_link = false)
+ {
+ if (is_null($perms))
+ {
+ // Default to read permission for compatibility reasons
+ $perms = self::CHMOD_READ;
+ }
+
+ // Check if we got a permission flag
+ if ($perms > self::CHMOD_ALL)
+ {
+ $file_perm = $perms;
+
+ // Extract permissions
+ //$owner = ($file_perm >> 6) & 7; // This will be ignored
+ $group = ($file_perm >> 3) & 7;
+ $other = ($file_perm >> 0) & 7;
+
+ // Does any permissions provided? if so we add execute bit for directories
+ $group = ($group !== 0) ? ($group | self::CHMOD_EXECUTE) : $group;
+ $other = ($other !== 0) ? ($other | self::CHMOD_EXECUTE) : $other;
+
+ // Compute directory permissions
+ $dir_perm = (self::CHMOD_ALL << 6) + ($group << 3) + ($other << 3);
+ }
+ else
+ {
+ // Add execute bit to owner if execute bit is among perms
+ $owner_perm = (self::CHMOD_READ | self::CHMOD_WRITE) | ($perms & self::CHMOD_EXECUTE);
+ $file_perm = ($owner_perm << 6) + ($perms << 3) + ($perms << 0);
+
+ // Compute directory permissions
+ $perm = ($perms !== 0) ? ($perms | self::CHMOD_EXECUTE) : $perms;
+ $dir_perm = (($owner_perm | self::CHMOD_EXECUTE) << 6) + ($perm << 3) + ($perm << 0);
+ }
+
+ // Symfony's filesystem component does not support extra execution flags on directories
+ // so we need to implement it again
+ foreach ($this->to_iterator($files) as $file)
+ {
+ if ($recursive && is_dir($file) && !is_link($file))
+ {
+ $this->chmod(new \FilesystemIterator($file), $perms, true);
+ }
+
+ // Don't chmod links as mostly those require 0777 and that cannot be changed
+ if (is_dir($file) || (is_link($file) && $force_chmod_link))
+ {
+ if (true !== @chmod($file, $dir_perm))
+ {
+ throw new filesystem_exception('CANNOT_CHANGE_FILE_PERMISSIONS', $file, array());
+ }
+ }
+ else if (is_file($file))
+ {
+ if (true !== @chmod($file, $file_perm))
+ {
+ throw new filesystem_exception('CANNOT_CHANGE_FILE_PERMISSIONS', $file, array());
+ }
+ }
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function chown($files, $user, $recursive = false)
+ {
+ try
+ {
+ $this->symfony_filesystem->chown($files, $user, $recursive);
+ }
+ catch (\Symfony\Component\Filesystem\Exception\IOException $e)
+ {
+ // Try to recover filename
+ // By the time this is written that is at the end of the message
+ $error = trim($e->getMessage());
+ $file = substr($error, strrpos($error, ' '));
+
+ throw new filesystem_exception('CANNOT_CHANGE_FILE_GROUP', $file, array(), $e);
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function clean_path($path)
+ {
+ $exploded = explode('/', $path);
+ $filtered = array();
+ foreach ($exploded as $part)
+ {
+ if ($part === '.' && !empty($filtered))
+ {
+ continue;
+ }
+
+ if ($part === '..' && !empty($filtered) && $filtered[sizeof($filtered) - 1] !== '.' && $filtered[sizeof($filtered) - 1] !== '..')
+ {
+ array_pop($filtered);
+ }
+ else
+ {
+ $filtered[] = $part;
+ }
+ }
+ $path = implode('/', $filtered);
+ return $path;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function copy($origin_file, $target_file, $override = false)
+ {
+ try
+ {
+ $this->symfony_filesystem->copy($origin_file, $target_file, $override);
+ }
+ catch (\Symfony\Component\Filesystem\Exception\IOException $e)
+ {
+ throw new filesystem_exception('CANNOT_COPY_FILES', '', array(), $e);
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function dump_file($filename, $content)
+ {
+ try
+ {
+ $this->symfony_filesystem->dumpFile($filename, $content);
+ }
+ catch (\Symfony\Component\Filesystem\Exception\IOException $e)
+ {
+ throw new filesystem_exception('CANNOT_DUMP_FILE', $filename, array(), $e);
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function exists($files)
+ {
+ return $this->symfony_filesystem->exists($files);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_absolute_path($path)
+ {
+ return (isset($path[0]) && $path[0] === '/' || preg_match('#^[a-z]:[/\\\]#i', $path)) ? true : false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_readable($files, $recursive = false)
+ {
+ foreach ($this->to_iterator($files) as $file)
+ {
+ if ($recursive && is_dir($file) && !is_link($file))
+ {
+ if (!$this->is_readable(new \FilesystemIterator($file), true))
+ {
+ return false;
+ }
+ }
+
+ if (!is_readable($file))
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_writable($files, $recursive = false)
+ {
+ if (defined('PHP_WINDOWS_VERSION_MAJOR') || !function_exists('is_writable'))
+ {
+ foreach ($this->to_iterator($files) as $file)
+ {
+ if ($recursive && is_dir($file) && !is_link($file))
+ {
+ if (!$this->is_writable(new \FilesystemIterator($file), true))
+ {
+ return false;
+ }
+ }
+
+ if (!$this->phpbb_is_writable($file))
+ {
+ return false;
+ }
+ }
+ }
+ else
+ {
+ // use built in is_writable
+ foreach ($this->to_iterator($files) as $file)
+ {
+ if ($recursive && is_dir($file) && !is_link($file))
+ {
+ if (!$this->is_writable(new \FilesystemIterator($file), true))
+ {
+ return false;
+ }
+ }
+
+ if (!is_writable($file))
+ {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function make_path_relative($end_path, $start_path)
+ {
+ return $this->symfony_filesystem->makePathRelative($end_path, $start_path);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function mirror($origin_dir, $target_dir, \Traversable $iterator = null, $options = array())
+ {
+ try
+ {
+ $this->symfony_filesystem->mirror($origin_dir, $target_dir, $iterator, $options);
+ }
+ catch (\Symfony\Component\Filesystem\Exception\IOException $e)
+ {
+ $msg = $e->getMessage();
+ $filename = substr($msg, strpos($msg, '"'), strrpos($msg, '"'));
+
+ throw new filesystem_exception('CANNOT_MIRROR_DIRECTORY', $filename, array(), $e);
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function mkdir($dirs, $mode = 0777)
+ {
+ try
+ {
+ $this->symfony_filesystem->mkdir($dirs, $mode);
+ }
+ catch (\Symfony\Component\Filesystem\Exception\IOException $e)
+ {
+ $msg = $e->getMessage();
+ $filename = substr($msg, strpos($msg, '"'), strrpos($msg, '"'));
+
+ throw new filesystem_exception('CANNOT_CREATE_DIRECTORY', $filename, array(), $e);
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function phpbb_chmod($files, $perms = null, $recursive = false, $force_chmod_link = false)
+ {
+ if (is_null($perms))
+ {
+ // Default to read permission for compatibility reasons
+ $perms = self::CHMOD_READ;
+ }
+
+ if (empty($this->chmod_info))
+ {
+ if (!function_exists('fileowner') || !function_exists('filegroup'))
+ {
+ $this->chmod_info['process'] = false;
+ }
+ else
+ {
+ $common_php_owner = @fileowner(__FILE__);
+ $common_php_group = @filegroup(__FILE__);
+
+ // And the owner and the groups PHP is running under.
+ $php_uid = (function_exists('posic_getuid')) ? @posix_getuid() : false;
+ $php_gids = (function_exists('posix_getgroups')) ? @posix_getgroups() : false;
+
+ // If we are unable to get owner/group, then do not try to set them by guessing
+ if (!$php_uid || empty($php_gids) || !$common_php_owner || !$common_php_group)
+ {
+ $this->chmod_info['process'] = false;
+ }
+ else
+ {
+ $this->chmod_info = array(
+ 'process' => true,
+ 'common_owner' => $common_php_owner,
+ 'common_group' => $common_php_group,
+ 'php_uid' => $php_uid,
+ 'php_gids' => $php_gids,
+ );
+ }
+ }
+ }
+
+ if ($this->chmod_info['process'])
+ {
+ try
+ {
+ foreach ($this->to_iterator($files) as $file)
+ {
+ $file_uid = @fileowner($file);
+ $file_gid = @filegroup($file);
+
+ // Change owner
+ if ($file_uid !== $this->chmod_info['common_owner'])
+ {
+ $this->chown($file, $this->chmod_info['common_owner'], $recursive);
+ }
+
+ // Change group
+ if ($file_gid !== $this->chmod_info['common_group'])
+ {
+ $this->chgrp($file, $this->chmod_info['common_group'], $recursive);
+ }
+
+ clearstatcache();
+ $file_uid = @fileowner($file);
+ $file_gid = @filegroup($file);
+ }
+ }
+ catch (filesystem_exception $e)
+ {
+ $this->chmod_info['process'] = false;
+ }
+ }
+
+ // Still able to process?
+ if ($this->chmod_info['process'])
+ {
+ if ($file_uid === $this->chmod_info['php_uid'])
+ {
+ $php = 'owner';
+ }
+ else if (in_array($file_gid, $this->chmod_info['php_gids']))
+ {
+ $php = 'group';
+ }
+ else
+ {
+ // Since we are setting the everyone bit anyway, no need to do expensive operations
+ $this->chmod_info['process'] = false;
+ }
+ }
+
+ // We are not able to determine or change something
+ if (!$this->chmod_info['process'])
+ {
+ $php = 'other';
+ }
+
+ switch ($php)
+ {
+ case 'owner':
+ try
+ {
+ $this->chmod($files, $perms, $recursive, $force_chmod_link);
+ clearstatcache();
+ if ($this->is_readable($files) && $this->is_writable($files))
+ {
+ break;
+ }
+ }
+ catch (filesystem_exception $e)
+ {
+ // Do nothing
+ }
+ case 'group':
+ try
+ {
+ $this->chmod($files, $perms, $recursive, $force_chmod_link);
+ clearstatcache();
+ if ((!($perms & self::CHMOD_READ) || $this->is_readable($files, $recursive)) && (!($perms & self::CHMOD_WRITE) || $this->is_writable($files, $recursive)))
+ {
+ break;
+ }
+ }
+ catch (filesystem_exception $e)
+ {
+ // Do nothing
+ }
+ case 'other':
+ default:
+ $this->chmod($files, $perms, $recursive, $force_chmod_link);
+ break;
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function realpath($path)
+ {
+ if (!function_exists('realpath'))
+ {
+ return $this->phpbb_own_realpath($path);
+ }
+
+ $realpath = realpath($path);
+
+ // Strangely there are provider not disabling realpath but returning strange values. :o
+ // We at least try to cope with them.
+ if ((!$this->is_absolute_path($path) && $realpath === $path) || $realpath === false)
+ {
+ return $this->phpbb_own_realpath($path);
+ }
+
+ // Check for DIRECTORY_SEPARATOR at the end (and remove it!)
+ if (substr($realpath, -1) === DIRECTORY_SEPARATOR)
+ {
+ $realpath = substr($realpath, 0, -1);
+ }
+
+ return $realpath;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function remove($files)
+ {
+ try
+ {
+ $this->symfony_filesystem->remove($files);
+ }
+ catch (\Symfony\Component\Filesystem\Exception\IOException $e)
+ {
+ // Try to recover filename
+ // By the time this is written that is at the end of the message
+ $error = trim($e->getMessage());
+ $file = substr($error, strrpos($error, ' '));
+
+ throw new filesystem_exception('CANNOT_DELETE_FILES', $file, array(), $e);
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function rename($origin, $target, $overwrite = false)
+ {
+ try
+ {
+ $this->symfony_filesystem->rename($origin, $target, $overwrite);
+ }
+ catch (\Symfony\Component\Filesystem\Exception\IOException $e)
+ {
+ $msg = $e->getMessage();
+ $filename = substr($msg, strpos($msg, '"'), strrpos($msg, '"'));
+
+ throw new filesystem_exception('CANNOT_RENAME_FILE', $filename, array(), $e);
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function symlink($origin_dir, $target_dir, $copy_on_windows = false)
+ {
+ try
+ {
+ $this->symfony_filesystem->symlink($origin_dir, $target_dir, $copy_on_windows);
+ }
+ catch (\Symfony\Component\Filesystem\Exception\IOException $e)
+ {
+ throw new filesystem_exception('CANNOT_CREATE_SYMLINK', $origin_dir, array(), $e);
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function touch($files, $time = null, $access_time = null)
+ {
+ try
+ {
+ $this->symfony_filesystem->touch($files, $time, $access_time);
+ }
+ catch (\Symfony\Component\Filesystem\Exception\IOException $e)
+ {
+ // Try to recover filename
+ // By the time this is written that is at the end of the message
+ $error = trim($e->getMessage());
+ $file = substr($error, strrpos($error, ' '));
+
+ throw new filesystem_exception('CANNOT_TOUCH_FILES', $file, array(), $e);
+ }
+ }
+
+ /**
+ * phpBB's implementation of is_writable
+ *
+ * @todo Investigate if is_writable is still buggy
+ *
+ * @param string $file file/directory to check if writable
+ *
+ * @return bool true if the given path is writable
+ */
+ protected function phpbb_is_writable($file)
+ {
+ if (file_exists($file))
+ {
+ // Canonicalise path to absolute path
+ $file = $this->realpath($file);
+
+ if (is_dir($file))
+ {
+ // Test directory by creating a file inside the directory
+ $result = @tempnam($file, 'i_w');
+
+ if (is_string($result) && file_exists($result))
+ {
+ unlink($result);
+
+ // Ensure the file is actually in the directory (returned realpathed)
+ return (strpos($result, $file) === 0) ? true : false;
+ }
+ }
+ else
+ {
+ $handle = @fopen($file, 'c');
+
+ if (is_resource($handle))
+ {
+ fclose($handle);
+ return true;
+ }
+ }
+ }
+ else
+ {
+ // file does not exist test if we can write to the directory
+ $dir = dirname($file);
+
+ if (file_exists($dir) && is_dir($dir) && $this->phpbb_is_writable($dir))
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Try to resolve real path when PHP's realpath failes to do so
+ *
+ * @param string $path
+ * @return bool|string
+ */
+ protected function phpbb_own_realpath($path)
+ {
+ // Replace all directory separators with '/'
+ $path = str_replace(DIRECTORY_SEPARATOR, '/', $path);
+
+ $is_absolute_path = false;
+ $path_prefix = '';
+
+ if ($this->is_absolute_path($path))
+ {
+ $is_absolute_path = true;
+ }
+ else
+ {
+ // Resolve working directory and store it
+ if (is_null($this->working_directory))
+ {
+ if (function_exists('getcwd'))
+ {
+ $this->working_directory = str_replace(DIRECTORY_SEPARATOR, '/', getcwd());
+ }
+
+ //
+ // From this point on we really just guessing
+ // If chdir were called we screwed
+ //
+ else if (function_exists('debug_backtrace'))
+ {
+ $call_stack = debug_backtrace(0);
+ $this->working_directory = str_replace(DIRECTORY_SEPARATOR, '/', dirname($call_stack[sizeof($call_stack) - 1]['file']));
+ }
+ else
+ {
+ //
+ // Assuming that the working directory is phpBB root
+ // we could use this as a fallback, when phpBB will use controllers
+ // everywhere this will be a safe assumption
+ //
+ //$dir_parts = explode(DIRECTORY_SEPARATOR, __DIR__);
+ //$namespace_parts = explode('\\', trim(__NAMESPACE__, '\\'));
+
+ //$namespace_part_count = sizeof($namespace_parts);
+
+ // Check if we still loading from root
+ //if (array_slice($dir_parts, -$namespace_part_count) === $namespace_parts)
+ //{
+ // $this->working_directory = implode('/', array_slice($dir_parts, 0, -$namespace_part_count));
+ //}
+ //else
+ //{
+ // $this->working_directory = false;
+ //}
+
+ $this->working_directory = false;
+ }
+ }
+
+ if ($this->working_directory !== false)
+ {
+ $is_absolute_path = true;
+ $path = $this->working_directory . '/' . $path;
+ }
+ }
+
+ if ($is_absolute_path)
+ {
+ if (defined('PHP_WINDOWS_VERSION_MAJOR'))
+ {
+ $path_prefix = $path[0] . ':';
+ $path = substr($path, 2);
+ }
+ else
+ {
+ $path_prefix = '';
+ }
+ }
+
+ $resolved_path = $this->resolve_path($path, $path_prefix, $is_absolute_path);
+ if ($resolved_path === false)
+ {
+ return false;
+ }
+
+ if (!@file_exists($resolved_path) || (!@is_dir($resolved_path . '/') && !is_file($resolved_path)))
+ {
+ return false;
+ }
+
+ // Return OS specific directory separators
+ $resolved = str_replace('/', DIRECTORY_SEPARATOR, $resolved_path);
+
+ // Check for DIRECTORY_SEPARATOR at the end (and remove it!)
+ if (substr($resolved, -1) === DIRECTORY_SEPARATOR)
+ {
+ return substr($resolved, 0, -1);
+ }
+
+ return $resolved;
+ }
+
+ /**
+ * Convert file(s) to \Traversable object
+ *
+ * This is the same function as Symfony's toIterator, but that is private
+ * so we cannot use it.
+ *
+ * @param string|array|\Traversable $files filename/list of filenames
+ * @return \Traversable
+ */
+ protected function to_iterator($files)
+ {
+ if (!$files instanceof \Traversable)
+ {
+ $files = new \ArrayObject(is_array($files) ? $files : array($files));
+ }
+
+ return $files;
+ }
+
+ /**
+ * Try to resolve symlinks in path
+ *
+ * @param string $path The path to resolve
+ * @param string $prefix The path prefix (on windows the drive letter)
+ * @param bool $absolute Whether or not the path is absolute
+ * @param bool $return_array Whether or not to return path parts
+ *
+ * @return string|array|bool returns the resolved path or an array of parts of the path if $return_array is true
+ * or false if path cannot be resolved
+ */
+ protected function resolve_path($path, $prefix = '', $absolute = false, $return_array = false)
+ {
+ if ($return_array)
+ {
+ $path = str_replace(DIRECTORY_SEPARATOR, '/', $path);
+ }
+
+ trim ($path, '/');
+ $path_parts = explode('/', $path);
+ $resolved = array();
+ $resolved_path = $prefix;
+ $file_found = false;
+
+ foreach ($path_parts as $path_part)
+ {
+ if ($file_found)
+ {
+ return false;
+ }
+
+ if (empty($path_part) || ($path_part === '.' && ($absolute || !empty($resolved))))
+ {
+ continue;
+ }
+ else if ($absolute && $path_part === '..')
+ {
+ if (empty($resolved))
+ {
+ // No directories above root
+ return false;
+ }
+
+ array_pop($resolved);
+ $resolved_path = false;
+ }
+ else if ($path_part === '..' && !empty($resolved) && !in_array($resolved[sizeof($resolved) - 1], array('.', '..')))
+ {
+ array_pop($resolved);
+ $resolved_path = false;
+ }
+ else
+ {
+ if ($resolved_path === false)
+ {
+ if (empty($resolved))
+ {
+ $resolved_path = ($absolute) ? $prefix . '/' . $path_part : $path_part;
+ }
+ else
+ {
+ $tmp_array = $resolved;
+ if ($absolute)
+ {
+ array_unshift($tmp_array, $prefix);
+ }
+
+ $resolved_path = implode('/', $tmp_array);
+ }
+ }
+
+ $current_path = $resolved_path . '/' . $path_part;
+
+ // Resolve symlinks
+ if (is_link($current_path))
+ {
+ if (!function_exists('readlink'))
+ {
+ return false;
+ }
+
+ $link = readlink($current_path);
+
+ // Is link has an absolute path in it?
+ if ($this->is_absolute_path($link))
+ {
+ if (defined('PHP_WINDOWS_VERSION_MAJOR'))
+ {
+ $prefix = $link[0] . ':';
+ $link = substr($link, 2);
+ }
+ else
+ {
+ $prefix = '';
+ }
+
+ $resolved = $this->resolve_path($link, $prefix, true, true);
+ $absolute = true;
+ }
+ else
+ {
+ $resolved = $this->resolve_path($resolved_path . '/' . $link, $prefix, $absolute, true);
+ }
+
+ if (!$resolved)
+ {
+ return false;
+ }
+
+ $resolved_path = false;
+ }
+ else if (is_dir($current_path . '/'))
+ {
+ $resolved[] = $path_part;
+ $resolved_path = $current_path;
+ }
+ else if (is_file($current_path))
+ {
+ $resolved[] = $path_part;
+ $resolved_path = $current_path;
+ $file_found = true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+ }
+
+ // If at the end of the path there were a .. or .
+ // we need to build the path again.
+ // Only doing this when a string is expected in return
+ if ($resolved_path === false && $return_array === false)
+ {
+ if (empty($resolved))
+ {
+ $resolved_path = ($absolute) ? $prefix . '/' : './';
+ }
+ else
+ {
+ $tmp_array = $resolved;
+ if ($absolute)
+ {
+ array_unshift($tmp_array, $prefix);
+ }
+
+ $resolved_path = implode('/', $tmp_array);
+ }
+ }
+
+ return ($return_array) ? $resolved : $resolved_path;
+ }
+}
diff --git a/phpBB/phpbb/filesystem/filesystem_interface.php b/phpBB/phpbb/filesystem/filesystem_interface.php
new file mode 100644
index 0000000000..1093be2499
--- /dev/null
+++ b/phpBB/phpbb/filesystem/filesystem_interface.php
@@ -0,0 +1,284 @@
+<?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\filesystem;
+
+/**
+ * Interface for phpBB's filesystem service
+ */
+interface filesystem_interface
+{
+ /**
+ * chmod all permissions flag
+ *
+ * @var int
+ */
+ const CHMOD_ALL = 7;
+
+ /**
+ * chmod read permissions flag
+ *
+ * @var int
+ */
+ const CHMOD_READ = 4;
+
+ /**
+ * chmod write permissions flag
+ *
+ * @var int
+ */
+ const CHMOD_WRITE = 2;
+
+ /**
+ * chmod execute permissions flag
+ *
+ * @var int
+ */
+ const CHMOD_EXECUTE = 1;
+
+ /**
+ * Change owner group of files/directories
+ *
+ * @param string|array|\Traversable $files The file(s)/directorie(s) to change group
+ * @param string $group The group that should own the files/directories
+ * @param bool $recursive If the group should be changed recursively
+ * @throws \phpbb\filesystem\exception\filesystem_exception the filename which triggered the error can be
+ * retrieved by filesystem_exception::get_filename()
+ */
+ public function chgrp($files, $group, $recursive = false);
+
+ /**
+ * Global function for chmodding directories and files for internal use
+ *
+ * The function accepts filesystem_interface::CHMOD_ flags in the permission argument
+ * or the user can specify octal values (or any integer if it makes sense). All directories will have
+ * an execution bit appended, if the user group (owner, group or other) has any bit specified.
+ *
+ * @param string|array|\Traversable $files The file/directory to be chmodded
+ * @param int $perms Permissions to set
+ * @param bool $recursive If the permissions should be changed recursively
+ * @param bool $force_chmod_link Try to apply permissions to symlinks as well
+ *
+ * @throws \phpbb\filesystem\exception\filesystem_exception the filename which triggered the error can be
+ * retrieved by filesystem_exception::get_filename()
+ */
+ public function chmod($files, $perms = null, $recursive = false, $force_chmod_link = false);
+
+ /**
+ * Change owner group of files/directories
+ *
+ * @param string|array|\Traversable $files The file(s)/directorie(s) to change group
+ * @param string $user The owner user name
+ * @param bool $recursive Whether change the owner recursively or not
+ *
+ * @throws \phpbb\filesystem\exception\filesystem_exception the filename which triggered the error can be
+ * retrieved by filesystem_exception::get_filename()
+ */
+ public function chown($files, $user, $recursive = false);
+
+ /**
+ * Eliminates useless . and .. components from specified path.
+ *
+ * @param string $path Path to clean
+ *
+ * @return string Cleaned path
+ */
+ public function clean_path($path);
+
+ /**
+ * Copies a file.
+ *
+ * This method only copies the file if the origin file is newer than the target file.
+ *
+ * By default, if the target already exists, it is not overridden.
+ *
+ * @param string $origin_file The original filename
+ * @param string $target_file The target filename
+ * @param bool $override Whether to override an existing file or not
+ *
+ * @throws \phpbb\filesystem\exception\filesystem_exception When the file cannot be copied
+ */
+ public function copy($origin_file, $target_file, $override = false);
+
+ /**
+ * Atomically dumps content into a file.
+ *
+ * @param string $filename The file to be written to.
+ * @param string $content The data to write into the file.
+ *
+ * @throws \phpbb\filesystem\exception\filesystem_exception When the file cannot be written
+ */
+ public function dump_file($filename, $content);
+
+ /**
+ * Checks the existence of files or directories.
+ *
+ * @param string|array|\Traversable $files files/directories to check
+ *
+ * @return bool Returns true if all files/directories exist, false otherwise
+ */
+ public function exists($files);
+
+ /**
+ * Checks if a path is absolute or not
+ *
+ * @param string $path Path to check
+ *
+ * @return bool true if the path is absolute, false otherwise
+ */
+ public function is_absolute_path($path);
+
+ /**
+ * Checks if files/directories are readable
+ *
+ * @param string|array|\Traversable $files files/directories to check
+ * @param bool $recursive Whether or not directories should be checked recursively
+ *
+ * @return bool True when the files/directories are readable, otherwise false.
+ */
+ public function is_readable($files, $recursive = false);
+
+ /**
+ * Test if a file/directory is writable
+ *
+ * @param string|array|\Traversable $files files/directories to perform write test on
+ * @param bool $recursive Whether or not directories should be checked recursively
+ *
+ * @return bool True when the files/directories are writable, otherwise false.
+ */
+ public function is_writable($files, $recursive = false);
+
+ /**
+ * Given an existing path, convert it to a path relative to a given starting path
+ *
+ * @param string $end_path Absolute path of target
+ * @param string $start_path Absolute path where traversal begins
+ *
+ * @return string Path of target relative to starting path
+ */
+ public function make_path_relative($end_path, $start_path);
+
+ /**
+ * Mirrors a directory to another.
+ *
+ * @param string $origin_dir The origin directory
+ * @param string $target_dir The target directory
+ * @param \Traversable $iterator A Traversable instance
+ * @param array $options An array of boolean options
+ * Valid options are:
+ * - $options['override'] Whether to override an existing file on copy or not (see copy())
+ * - $options['copy_on_windows'] Whether to copy files instead of links on Windows (see symlink())
+ * - $options['delete'] Whether to delete files that are not in the source directory (defaults to false)
+ *
+ * @throws \phpbb\filesystem\exception\filesystem_exception When the file cannot be copied.
+ * The filename which triggered the error can be
+ * retrieved by filesystem_exception::get_filename()
+ */
+ public function mirror($origin_dir, $target_dir, \Traversable $iterator = null, $options = array());
+
+ /**
+ * Creates a directory recursively.
+ *
+ * @param string|array|\Traversable $dirs The directory path
+ * @param int $mode The directory mode
+ *
+ * @throws \phpbb\filesystem\exception\filesystem_exception On any directory creation failure
+ * The filename which triggered the error can be
+ * retrieved by filesystem_exception::get_filename()
+ */
+ public function mkdir($dirs, $mode = 0777);
+
+ /**
+ * Global function for chmodding directories and files for internal use
+ *
+ * This function determines owner and group whom the file belongs to and user and group of PHP and then set safest possible file permissions.
+ * The function determines owner and group from common.php file and sets the same to the provided file.
+ * The function uses bit fields to build the permissions.
+ * The function sets the appropiate execute bit on directories.
+ *
+ * Supported constants representing bit fields are:
+ *
+ * filesystem_interface::CHMOD_ALL - all permissions (7)
+ * filesystem_interface::CHMOD_READ - read permission (4)
+ * filesystem_interface::CHMOD_WRITE - write permission (2)
+ * filesystem_interface::CHMOD_EXECUTE - execute permission (1)
+ *
+ * NOTE: The function uses POSIX extension and fileowner()/filegroup() functions. If any of them is disabled, this function tries to build proper permissions, by calling is_readable() and is_writable() functions.
+ *
+ * @param string|array|\Traversable $file The file/directory to be chmodded
+ * @param int $perms Permissions to set
+ * @param bool $recursive If the permissions should be changed recursively
+ * @param bool $force_chmod_link Try to apply permissions to symlinks as well
+ *
+ * @throws \phpbb\filesystem\exception\filesystem_exception the filename which triggered the error can be
+ * retrieved by filesystem_exception::get_filename()
+ */
+ public function phpbb_chmod($file, $perms = null, $recursive = false, $force_chmod_link = false);
+
+ /**
+ * A wrapper for PHP's realpath
+ *
+ * Try to resolve realpath when PHP's realpath is not available, or
+ * known to be buggy.
+ *
+ * @param string $path Path to resolve
+ *
+ * @return string Resolved path
+ */
+ public function realpath($path);
+
+ /**
+ * Removes files or directories.
+ *
+ * @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to remove
+ *
+ * @throws \phpbb\filesystem\exception\filesystem_exception When removal fails.
+ * The filename which triggered the error can be
+ * retrieved by filesystem_exception::get_filename()
+ */
+ public function remove($files);
+
+ /**
+ * Renames a file or a directory.
+ *
+ * @param string $origin The origin filename or directory
+ * @param string $target The new filename or directory
+ * @param bool $overwrite Whether to overwrite the target if it already exists
+ *
+ * @throws \phpbb\filesystem\exception\filesystem_exception When target file or directory already exists,
+ * or origin cannot be renamed.
+ */
+ public function rename($origin, $target, $overwrite = false);
+
+ /**
+ * Creates a symbolic link or copy a directory.
+ *
+ * @param string $origin_dir The origin directory path
+ * @param string $target_dir The symbolic link name
+ * @param bool $copy_on_windows Whether to copy files if on Windows
+ *
+ * @throws \phpbb\filesystem\exception\filesystem_exception When symlink fails
+ */
+ public function symlink($origin_dir, $target_dir, $copy_on_windows = false);
+
+ /**
+ * Sets access and modification time of file.
+ *
+ * @param string|array|\Traversable $files A filename, an array of files, or a \Traversable instance to create
+ * @param int $time The touch time as a Unix timestamp
+ * @param int $access_time The access time as a Unix timestamp
+ *
+ * @throws \phpbb\filesystem\exception\filesystem_exception When touch fails
+ */
+ public function touch($files, $time = null, $access_time = null);
+}
diff --git a/phpBB/phpbb/finder.php b/phpBB/phpbb/finder.php
index 28f28825ba..58bc27084e 100644
--- a/phpBB/phpbb/finder.php
+++ b/phpBB/phpbb/finder.php
@@ -48,14 +48,14 @@ class finder
/**
* Creates a new finder instance with its dependencies
*
- * @param \phpbb\filesystem $filesystem Filesystem instance
+ * @param \phpbb\filesystem\filesystem_interface $filesystem Filesystem instance
* @param string $phpbb_root_path Path to the phpbb root directory
* @param \phpbb\cache\driver\driver_interface $cache A cache instance or null
* @param string $php_ext php file extension
* @param string $cache_name The name of the cache variable, defaults to
* _ext_finder
*/
- public function __construct(\phpbb\filesystem $filesystem, $phpbb_root_path = '', \phpbb\cache\driver\driver_interface $cache = null, $php_ext = 'php', $cache_name = '_ext_finder')
+ public function __construct(\phpbb\filesystem\filesystem_interface $filesystem, $phpbb_root_path = '', \phpbb\cache\driver\driver_interface $cache = null, $php_ext = 'php', $cache_name = '_ext_finder')
{
$this->filesystem = $filesystem;
$this->phpbb_root_path = $phpbb_root_path;
diff --git a/phpBB/phpbb/group/helper.php b/phpBB/phpbb/group/helper.php
new file mode 100644
index 0000000000..5befddfc53
--- /dev/null
+++ b/phpBB/phpbb/group/helper.php
@@ -0,0 +1,40 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+namespace phpbb\group;
+
+class helper
+{
+ /** @var \phpbb\language\language */
+ protected $language;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\language\language $language Language object
+ */
+ public function __construct(\phpbb\language\language $language)
+ {
+ $this->language = $language;
+ }
+
+ /**
+ * @param $group_name string The stored group name
+ *
+ * @return string Group name or translated group name if it exists
+ */
+ public function get_name($group_name)
+ {
+ return $this->language->is_set('G_' . utf8_strtoupper($group_name)) ? $this->language->lang('G_' . utf8_strtoupper($group_name)) : $group_name;
+ }
+}
diff --git a/phpBB/phpbb/help/controller/bbcode.php b/phpBB/phpbb/help/controller/bbcode.php
new file mode 100644
index 0000000000..e16f99023d
--- /dev/null
+++ b/phpBB/phpbb/help/controller/bbcode.php
@@ -0,0 +1,85 @@
+<?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\help\controller;
+
+/**
+ * BBCode help page
+ */
+class bbcode extends controller
+{
+ /**
+ * @return string The title of the page
+ */
+ public function display()
+ {
+ $this->language->add_lang('help/bbcode');
+
+ $this->manager->add_block(
+ 'HELP_BBCODE_BLOCK_INTRO',
+ false,
+ array(
+ 'HELP_BBCODE_INTRO_BBCODE_QUESTION' => 'HELP_BBCODE_INTRO_BBCODE_ANSWER',
+ )
+ );
+ $this->manager->add_block(
+ 'HELP_BBCODE_BLOCK_TEXT',
+ false,
+ array(
+ 'HELP_BBCODE_TEXT_BASIC_QUESTION' => 'HELP_BBCODE_TEXT_BASIC_ANSWER',
+ 'HELP_BBCODE_TEXT_COLOR_QUESTION' => 'HELP_BBCODE_TEXT_COLOR_ANSWER',
+ 'HELP_BBCODE_TEXT_COMBINE_QUESTION' => 'HELP_BBCODE_TEXT_COMBINE_ANSWER',
+ )
+ );
+ $this->manager->add_block(
+ 'HELP_BBCODE_BLOCK_QUOTES',
+ false,
+ array(
+ 'HELP_BBCODE_QUOTES_TEXT_QUESTION' => 'HELP_BBCODE_QUOTES_TEXT_ANSWER',
+ 'HELP_BBCODE_QUOTES_CODE_QUESTION' => 'HELP_BBCODE_QUOTES_CODE_ANSWER',
+ )
+ );
+ $this->manager->add_block(
+ 'HELP_BBCODE_BLOCK_LISTS',
+ false,
+ array(
+ 'HELP_BBCODE_LISTS_UNORDERER_QUESTION' => 'HELP_BBCODE_LISTS_UNORDERER_ANSWER',
+ 'HELP_BBCODE_LISTS_ORDERER_QUESTION' => 'HELP_BBCODE_LISTS_ORDERER_ANSWER',
+ )
+ );
+ $this->manager->add_block(
+ 'HELP_BBCODE_BLOCK_LINKS',
+ true,
+ array(
+ 'HELP_BBCODE_LINKS_BASIC_QUESTION' => 'HELP_BBCODE_LINKS_BASIC_ANSWER',
+ )
+ );
+ $this->manager->add_block(
+ 'HELP_BBCODE_BLOCK_IMAGES',
+ false,
+ array(
+ 'HELP_BBCODE_IMAGES_BASIC_QUESTION' => 'HELP_BBCODE_IMAGES_BASIC_ANSWER',
+ 'HELP_BBCODE_IMAGES_ATTACHMENT_QUESTION' => 'HELP_BBCODE_IMAGES_ATTACHMENT_ANSWER',
+ )
+ );
+ $this->manager->add_block(
+ 'HELP_BBCODE_BLOCK_OTHERS',
+ false,
+ array(
+ 'HELP_BBCODE_OTHERS_CUSTOM_QUESTION' => 'HELP_BBCODE_OTHERS_CUSTOM_ANSWER',
+ )
+ );
+
+ return $this->language->lang('BBCODE_GUIDE');
+ }
+}
diff --git a/phpBB/phpbb/help/controller/controller.php b/phpBB/phpbb/help/controller/controller.php
new file mode 100644
index 0000000000..29494205a9
--- /dev/null
+++ b/phpBB/phpbb/help/controller/controller.php
@@ -0,0 +1,76 @@
+<?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\help\controller;
+
+/**
+ * BBCode help page
+ */
+abstract class controller
+{
+ /** @var \phpbb\controller\helper */
+ protected $helper;
+
+ /** @var \phpbb\help\manager */
+ protected $manager;
+
+ /** @var \phpbb\template\template */
+ protected $template;
+
+ /** @var \phpbb\language\language */
+ protected $language;
+
+ /** @var string */
+ protected $root_path;
+
+ /** @var string */
+ protected $php_ext;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\controller\helper $helper
+ * @param \phpbb\help\manager $manager
+ * @param \phpbb\template\template $template
+ * @param \phpbb\language\language $language
+ * @param string $root_path
+ * @param string $php_ext
+ */
+ public function __construct(\phpbb\controller\helper $helper, \phpbb\help\manager $manager, \phpbb\template\template $template, \phpbb\language\language $language, $root_path, $php_ext)
+ {
+ $this->helper = $helper;
+ $this->manager = $manager;
+ $this->template = $template;
+ $this->language = $language;
+ $this->root_path = $root_path;
+ $this->php_ext = $php_ext;
+ }
+
+ /**
+ * @return string
+ */
+ abstract protected function display();
+
+ public function handle()
+ {
+ $title = $this->display();
+
+ $this->template->assign_vars(array(
+ 'L_FAQ_TITLE' => $title,
+ 'S_IN_FAQ' => true,
+ ));
+
+ make_jumpbox(append_sid("{$this->root_path}viewforum.{$this->php_ext}"));
+ return $this->helper->render('faq_body.html', $title);
+ }
+}
diff --git a/phpBB/phpbb/help/controller/faq.php b/phpBB/phpbb/help/controller/faq.php
new file mode 100644
index 0000000000..5e45cfe667
--- /dev/null
+++ b/phpBB/phpbb/help/controller/faq.php
@@ -0,0 +1,165 @@
+<?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\help\controller;
+
+/**
+ * FAQ help page
+ */
+class faq extends controller
+{
+ /**
+ * @return string The title of the page
+ */
+ public function display()
+ {
+ $this->language->add_lang('help/faq');
+
+ $this->manager->add_block(
+ 'HELP_FAQ_BLOCK_LOGIN',
+ false,
+ array(
+ 'HELP_FAQ_LOGIN_REGISTER_QUESTION' => 'HELP_FAQ_LOGIN_REGISTER_ANSWER',
+ 'HELP_FAQ_LOGIN_COPPA_QUESTION' => 'HELP_FAQ_LOGIN_COPPA_ANSWER',
+ 'HELP_FAQ_LOGIN_CANNOT_REGISTER_QUESTION' => 'HELP_FAQ_LOGIN_CANNOT_REGISTER_ANSWER',
+ 'HELP_FAQ_LOGIN_REGISTER_CONFIRM_QUESTION' => 'HELP_FAQ_LOGIN_REGISTER_CONFIRM_ANSWER',
+ 'HELP_FAQ_LOGIN_CANNOT_LOGIN_QUESTION' => 'HELP_FAQ_LOGIN_CANNOT_LOGIN_ANSWER',
+ 'HELP_FAQ_LOGIN_CANNOT_LOGIN_ANYMORE_QUESTION' => 'HELP_FAQ_LOGIN_CANNOT_LOGIN_ANYMORE_ANSWER',
+ 'HELP_FAQ_LOGIN_LOST_PASSWORD_QUESTION' => 'HELP_FAQ_LOGIN_LOST_PASSWORD_ANSWER',
+ 'HELP_FAQ_LOGIN_AUTO_LOGOUT_QUESTION' => 'HELP_FAQ_LOGIN_AUTO_LOGOUT_ANSWER',
+ 'HELP_FAQ_LOGIN_DELETE_COOKIES_QUESTION' => 'HELP_FAQ_LOGIN_DELETE_COOKIES_ANSWER',
+ )
+ );
+ $this->manager->add_block(
+ 'HELP_FAQ_BLOCK_USERSETTINGS',
+ false,
+ array(
+ 'HELP_FAQ_USERSETTINGS_CHANGE_SETTINGS_QUESTION' => 'HELP_FAQ_USERSETTINGS_CHANGE_SETTINGS_ANSWER',
+ 'HELP_FAQ_USERSETTINGS_HIDE_ONLINE_QUESTION' => 'HELP_FAQ_USERSETTINGS_HIDE_ONLINE_ANSWER',
+ 'HELP_FAQ_USERSETTINGS_TIMEZONE_QUESTION' => 'HELP_FAQ_USERSETTINGS_TIMEZONE_ANSWER',
+ 'HELP_FAQ_USERSETTINGS_SERVERTIME_QUESTION' => 'HELP_FAQ_USERSETTINGS_SERVERTIME_ANSWER',
+ 'HELP_FAQ_USERSETTINGS_LANGUAGE_QUESTION' => 'HELP_FAQ_USERSETTINGS_LANGUAGE_ANSWER',
+ 'HELP_FAQ_USERSETTINGS_AVATAR_QUESTION' => 'HELP_FAQ_USERSETTINGS_AVATAR_ANSWER',
+ 'HELP_FAQ_USERSETTINGS_AVATAR_DISPLAY_QUESTION' => 'HELP_FAQ_USERSETTINGS_AVATAR_DISPLAY_ANSWER',
+ 'HELP_FAQ_USERSETTINGS_RANK_QUESTION' => 'HELP_FAQ_USERSETTINGS_RANK_ANSWER',
+ 'HELP_FAQ_USERSETTINGS_EMAIL_LOGIN_QUESTION' => 'HELP_FAQ_USERSETTINGS_EMAIL_LOGIN_ANSWER',
+ )
+ );
+ $this->manager->add_block(
+ 'HELP_FAQ_BLOCK_POSTING',
+ false,
+ array(
+ 'HELP_FAQ_POSTING_CREATE_QUESTION' => 'HELP_FAQ_POSTING_CREATE_ANSWER',
+ 'HELP_FAQ_POSTING_EDIT_DELETE_QUESTION' => 'HELP_FAQ_POSTING_EDIT_DELETE_ANSWER',
+ 'HELP_FAQ_POSTING_SIGNATURE_QUESTION' => 'HELP_FAQ_POSTING_SIGNATURE_ANSWER',
+ 'HELP_FAQ_POSTING_POLL_CREATE_QUESTION' => 'HELP_FAQ_POSTING_POLL_CREATE_ANSWER',
+ 'HELP_FAQ_POSTING_POLL_ADD_QUESTION' => 'HELP_FAQ_POSTING_POLL_ADD_ANSWER',
+ 'HELP_FAQ_POSTING_POLL_EDIT_QUESTION' => 'HELP_FAQ_POSTING_POLL_EDIT_ANSWER',
+ 'HELP_FAQ_POSTING_FORUM_RESTRICTED_QUESTION' => 'HELP_FAQ_POSTING_FORUM_RESTRICTED_ANSWER',
+ 'HELP_FAQ_POSTING_NO_ATTACHMENTS_QUESTION' => 'HELP_FAQ_POSTING_NO_ATTACHMENTS_ANSWER',
+ 'HELP_FAQ_POSTING_WARNING_QUESTION' => 'HELP_FAQ_POSTING_WARNING_ANSWER',
+ 'HELP_FAQ_POSTING_REPORT_QUESTION' => 'HELP_FAQ_POSTING_REPORT_ANSWER',
+ 'HELP_FAQ_POSTING_DRAFT_QUESTION' => 'HELP_FAQ_POSTING_DRAFT_ANSWER',
+ 'HELP_FAQ_POSTING_QUEUE_QUESTION' => 'HELP_FAQ_POSTING_QUEUE_ANSWER',
+ 'HELP_FAQ_POSTING_BUMP_QUESTION' => 'HELP_FAQ_POSTING_BUMP_ANSWER',
+ )
+ );
+ $this->manager->add_block(
+ 'HELP_FAQ_BLOCK_FORMATTING',
+ false,
+ array(
+ 'HELP_FAQ_FORMATTING_BBOCDE_QUESTION' => 'HELP_FAQ_FORMATTING_BBOCDE_ANSWER',
+ 'HELP_FAQ_FORMATTING_HTML_QUESTION' => 'HELP_FAQ_FORMATTING_HTML_ANSWER',
+ 'HELP_FAQ_FORMATTING_SMILIES_QUESTION' => 'HELP_FAQ_FORMATTING_SMILIES_ANSWER',
+ 'HELP_FAQ_FORMATTING_IMAGES_QUESTION' => 'HELP_FAQ_FORMATTING_IMAGES_ANSWER',
+ 'HELP_FAQ_FORMATTING_GLOBAL_ANNOUNCE_QUESTION' => 'HELP_FAQ_FORMATTING_GLOBAL_ANNOUNCE_ANSWER',
+ 'HELP_FAQ_FORMATTING_ANNOUNCEMENT_QUESTION' => 'HELP_FAQ_FORMATTING_ANNOUNCEMENT_ANSWER',
+ 'HELP_FAQ_FORMATTING_STICKIES_QUESTION' => 'HELP_FAQ_FORMATTING_STICKIES_ANSWER',
+ 'HELP_FAQ_FORMATTING_LOCKED_QUESTION' => 'HELP_FAQ_FORMATTING_LOCKED_ANSWER',
+ 'HELP_FAQ_FORMATTING_ICONS_QUESTION' => 'HELP_FAQ_FORMATTING_ICONS_ANSWER',
+ )
+ );
+ $this->manager->add_block(
+ 'HELP_FAQ_BLOCK_GROUPS',
+ true,
+ array(
+ 'HELP_FAQ_GROUPS_ADMINISTRATORS_QUESTION' => 'HELP_FAQ_GROUPS_ADMINISTRATORS_ANSWER',
+ 'HELP_FAQ_GROUPS_MODERATORS_QUESTION' => 'HELP_FAQ_GROUPS_MODERATORS_ANSWER',
+ 'HELP_FAQ_GROUPS_USERGROUPS_QUESTION' => 'HELP_FAQ_GROUPS_USERGROUPS_ANSWER',
+ 'HELP_FAQ_GROUPS_USERGROUPS_JOIN_QUESTION' => 'HELP_FAQ_GROUPS_USERGROUPS_JOIN_ANSWER',
+ 'HELP_FAQ_GROUPS_USERGROUPS_LEAD_QUESTION' => 'HELP_FAQ_GROUPS_USERGROUPS_LEAD_ANSWER',
+ 'HELP_FAQ_GROUPS_COLORS_QUESTION' => 'HELP_FAQ_GROUPS_COLORS_ANSWER',
+ 'HELP_FAQ_GROUPS_DEFAULT_QUESTION' => 'HELP_FAQ_GROUPS_DEFAULT_ANSWER',
+ 'HELP_FAQ_GROUPS_TEAM_QUESTION' => 'HELP_FAQ_GROUPS_TEAM_ANSWER',
+ )
+ );
+ $this->manager->add_block(
+ 'HELP_FAQ_BLOCK_PMS',
+ false,
+ array(
+ 'HELP_FAQ_PMS_CANNOT_SEND_QUESTION' => 'HELP_FAQ_PMS_CANNOT_SEND_ANSWER',
+ 'HELP_FAQ_PMS_UNWANTED_QUESTION' => 'HELP_FAQ_PMS_UNWANTED_ANSWER',
+ 'HELP_FAQ_PMS_SPAM_QUESTION' => 'HELP_FAQ_PMS_SPAM_ANSWER',
+ )
+ );
+ $this->manager->add_block(
+ 'HELP_FAQ_BLOCK_FRIENDS',
+ false,
+ array(
+ 'HELP_FAQ_FRIENDS_BASIC_QUESTION' => 'HELP_FAQ_FRIENDS_BASIC_ANSWER',
+ 'HELP_FAQ_FRIENDS_MANAGE_QUESTION' => 'HELP_FAQ_FRIENDS_MANAGE_ANSWER',
+ )
+ );
+ $this->manager->add_block(
+ 'HELP_FAQ_BLOCK_SEARCH',
+ false,
+ array(
+ 'HELP_FAQ_SEARCH_FORUM_QUESTION' => 'HELP_FAQ_SEARCH_FORUM_ANSWER',
+ 'HELP_FAQ_SEARCH_NO_RESULT_QUESTION' => 'HELP_FAQ_SEARCH_NO_RESULT_ANSWER',
+ 'HELP_FAQ_SEARCH_BLANK_QUESTION' => 'HELP_FAQ_SEARCH_BLANK_ANSWER',
+ 'HELP_FAQ_SEARCH_MEMBERS_QUESTION' => 'HELP_FAQ_SEARCH_MEMBERS_ANSWER',
+ 'HELP_FAQ_SEARCH_OWN_QUESTION' => 'HELP_FAQ_SEARCH_OWN_ANSWER',
+ )
+ );
+ $this->manager->add_block(
+ 'HELP_FAQ_BLOCK_BOOKMARKS',
+ false,
+ array(
+ 'HELP_FAQ_BOOKMARKS_DIFFERENCE_QUESTION' => 'HELP_FAQ_BOOKMARKS_DIFFERENCE_ANSWER',
+ 'HELP_FAQ_BOOKMARKS_TOPIC_QUESTION' => 'HELP_FAQ_BOOKMARKS_TOPIC_ANSWER',
+ 'HELP_FAQ_BOOKMARKS_FORUM_QUESTION' => 'HELP_FAQ_BOOKMARKS_FORUM_ANSWER',
+ 'HELP_FAQ_BOOKMARKS_REMOVE_QUESTION' => 'HELP_FAQ_BOOKMARKS_REMOVE_ANSWER',
+ )
+ );
+ $this->manager->add_block(
+ 'HELP_FAQ_BLOCK_ATTACHMENTS',
+ false,
+ array(
+ 'HELP_FAQ_ATTACHMENTS_ALLOWED_QUESTION' => 'HELP_FAQ_ATTACHMENTS_ALLOWED_ANSWER',
+ 'HELP_FAQ_ATTACHMENTS_OWN_QUESTION' => 'HELP_FAQ_ATTACHMENTS_OWN_ANSWER',
+ )
+ );
+ $this->manager->add_block(
+ 'HELP_FAQ_BLOCK_ISSUES',
+ false,
+ array(
+ 'HELP_FAQ_ISSUES_WHOIS_PHPBB_QUESTION' => 'HELP_FAQ_ISSUES_WHOIS_PHPBB_ANSWER',
+ 'HELP_FAQ_ISSUES_FEATURE_QUESTION' => 'HELP_FAQ_ISSUES_FEATURE_ANSWER',
+ 'HELP_FAQ_ISSUES_LEGAL_QUESTION' => 'HELP_FAQ_ISSUES_LEGAL_ANSWER',
+ 'HELP_FAQ_ISSUES_ADMIN_QUESTION' => 'HELP_FAQ_ISSUES_ADMIN_ANSWER',
+ )
+ );
+
+ return $this->language->lang('FAQ_EXPLAIN');
+ }
+}
diff --git a/phpBB/phpbb/help/controller/help.php b/phpBB/phpbb/help/controller/help.php
new file mode 100644
index 0000000000..9cc3b0c8b4
--- /dev/null
+++ b/phpBB/phpbb/help/controller/help.php
@@ -0,0 +1,160 @@
+<?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\help\controller;
+
+use phpbb\exception\http_exception;
+
+class help
+{
+ /** @var \phpbb\controller\helper */
+ protected $helper;
+
+ /** @var \phpbb\event\dispatcher_interface */
+ protected $dispatcher;
+
+ /** @var \phpbb\template\template */
+ protected $template;
+
+ /** @var \phpbb\user */
+ protected $user;
+
+ /** @var string */
+ protected $root_path;
+
+ /** @var string */
+ protected $php_ext;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\controller\helper $helper
+ * @param \phpbb\event\dispatcher_interface $dispatcher
+ * @param \phpbb\template\template $template
+ * @param \phpbb\user $user
+ * @param string $root_path
+ * @param string $php_ext
+ */
+ public function __construct(\phpbb\controller\helper $helper, \phpbb\event\dispatcher_interface $dispatcher, \phpbb\template\template $template, \phpbb\user $user, $root_path, $php_ext)
+ {
+ $this->helper = $helper;
+ $this->dispatcher = $dispatcher;
+ $this->template = $template;
+ $this->user = $user;
+ $this->root_path = $root_path;
+ $this->php_ext = $php_ext;
+ }
+
+ /**
+ * Controller for /help/{mode} routes
+ *
+ * @param string $mode
+ * @return \Symfony\Component\HttpFoundation\Response A Symfony Response object
+ * @throws http_exception when the $mode is not known by any extension
+ */
+ public function handle($mode)
+ {
+ switch ($mode)
+ {
+ case 'faq':
+ case 'bbcode':
+ $page_title = ($mode === 'faq') ? $this->user->lang['FAQ_EXPLAIN'] : $this->user->lang['BBCODE_GUIDE'];
+ $this->user->add_lang($mode, false, true);
+ break;
+
+ default:
+ $page_title = $this->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($this->dispatcher->trigger_event('core.faq_mode_validation', compact($vars)));
+
+ if ($ext_name === '' || $lang_file === '')
+ {
+ throw new http_exception(404, 'Not Found');
+ }
+
+ $this->user->add_lang($lang_file, false, true, $ext_name);
+ break;
+
+ }
+
+ $this->template->assign_vars(array(
+ 'L_FAQ_TITLE' => $page_title,
+ 'S_IN_FAQ' => true,
+ ));
+
+ $this->assign_to_template($this->user->help);
+
+ make_jumpbox(append_sid("{$this->root_path}viewforum.{$this->php_ext}"));
+ return $this->helper->render('faq_body.html', $page_title);
+ }
+
+ /**
+ * Assigns the help data to the template blocks
+ *
+ * @param array $help_data
+ * @return null
+ */
+ protected function assign_to_template(array $help_data)
+ {
+ // Pull the array data from the lang pack
+ $switch_column = $found_switch = false;
+ foreach ($help_data as $help_ary)
+ {
+ if ($help_ary[0] == '--')
+ {
+ if ($help_ary[1] == '--')
+ {
+ $switch_column = true;
+ $found_switch = true;
+ continue;
+ }
+
+ $this->template->assign_block_vars('faq_block', array(
+ 'BLOCK_TITLE' => $help_ary[1],
+ 'SWITCH_COLUMN' => $switch_column,
+ ));
+
+ if ($switch_column)
+ {
+ $switch_column = false;
+ }
+ continue;
+ }
+
+ $this->template->assign_block_vars('faq_block.faq_row', array(
+ 'FAQ_QUESTION' => $help_ary[0],
+ 'FAQ_ANSWER' => $help_ary[1],
+ ));
+ }
+
+ $this->template->assign_var('SWITCH_COLUMN_MANUALLY', !$found_switch);
+ }
+}
diff --git a/phpBB/phpbb/help/manager.php b/phpBB/phpbb/help/manager.php
new file mode 100644
index 0000000000..39f52d343b
--- /dev/null
+++ b/phpBB/phpbb/help/manager.php
@@ -0,0 +1,137 @@
+<?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\help;
+
+/**
+ * Class help page manager
+ */
+class manager
+{
+ /** @var \phpbb\event\dispatcher */
+ protected $dispatcher;
+
+ /** @var \phpbb\language\language */
+ protected $language;
+
+ /** @var \phpbb\template\template */
+ protected $template;
+
+ /** @var bool */
+ protected $switched_column;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\event\dispatcher $dispatcher
+ * @param \phpbb\language\language $language
+ * @param \phpbb\template\template $template
+ */
+ public function __construct(\phpbb\event\dispatcher $dispatcher, \phpbb\language\language $language, \phpbb\template\template $template)
+ {
+ $this->dispatcher = $dispatcher;
+ $this->language = $language;
+ $this->template = $template;
+ }
+
+ /**
+ * Add a new faq block
+ *
+ * @param string $block_name Name or language key with the name of the block
+ * @param bool $switch_column Switch the column of the menu
+ * @param array $questions Array of frequently asked questions
+ */
+ public function add_block($block_name, $switch_column = false, $questions = array())
+ {
+ /**
+ * You can use this event to add a block before the current one.
+ *
+ * @event core.help_manager_add_block_before
+ * @var string block_name Language key of the block headline
+ * @var bool switch_column Should we switch the menu column before this headline
+ * @var array questions Array with questions
+ * @since 3.2.0-a1
+ */
+ $vars = array('block_name', 'switch_column', 'questions');
+ extract($this->dispatcher->trigger_event('core.help_manager_add_block_before', compact($vars)));
+
+ $this->template->assign_block_vars('faq_block', array(
+ 'BLOCK_TITLE' => $this->language->lang($block_name),
+ 'SWITCH_COLUMN' => !$this->switched_column && $switch_column,
+ ));
+
+ foreach ($questions as $question => $answer)
+ {
+ $this->add_question($question, $answer);
+ }
+
+ $this->switched_column = $this->switched_column || $switch_column;
+
+ /**
+ * You can use this event to add a block after the current one.
+ *
+ * @event core.help_manager_add_block_after
+ * @var string block_name Language key of the block headline
+ * @var bool switch_column Should we switch the menu column before this headline
+ * @var array questions Array with questions
+ * @since 3.2.0-a1
+ */
+ $vars = array('block_name', 'switch_column', 'questions');
+ extract($this->dispatcher->trigger_event('core.help_manager_add_block_after', compact($vars)));
+ }
+
+ /**
+ * Add a new faq question
+ *
+ * @param string $question Question or language key with the question of the block
+ * @param string $answer Answer or language key with the answer of the block
+ */
+ public function add_question($question, $answer)
+ {
+ /**
+ * You can use this event to add a question before the current one.
+ *
+ * @event core.help_manager_add_question_before
+ * @var string question Language key of the question
+ * @var string answer Language key of the answer
+ * @since 3.2.0-a1
+ */
+ $vars = array('question', 'answer');
+ extract($this->dispatcher->trigger_event('core.help_manager_add_question_before', compact($vars)));
+
+ $this->template->assign_block_vars('faq_block.faq_row', array(
+ 'FAQ_QUESTION' => $this->language->lang($question),
+ 'FAQ_ANSWER' => $this->language->lang($answer),
+ ));
+
+ /**
+ * You can use this event to add a question after the current one.
+ *
+ * @event core.help_manager_add_question_after
+ * @var string question Language key of the question
+ * @var string answer Language key of the answer
+ * @since 3.2.0-a1
+ */
+ $vars = array('question', 'answer');
+ extract($this->dispatcher->trigger_event('core.help_manager_add_question_after', compact($vars)));
+ }
+
+ /**
+ * Returns whether the block titles switched side
+ * @return bool
+ */
+ public function switched_column()
+ {
+ return $this->switched_column;
+ }
+}
diff --git a/phpBB/phpbb/install/console/command/install/config/show.php b/phpBB/phpbb/install/console/command/install/config/show.php
new file mode 100644
index 0000000000..4155440fc3
--- /dev/null
+++ b/phpBB/phpbb/install/console/command/install/config/show.php
@@ -0,0 +1,131 @@
+<?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\install\console\command\install\config;
+
+use phpbb\install\helper\iohandler\factory;
+use phpbb\install\installer;
+use phpbb\install\installer_configuration;
+use phpbb\language\language;
+use Symfony\Component\Config\Definition\Exception\Exception;
+use Symfony\Component\Config\Definition\Processor;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Style\SymfonyStyle;
+use Symfony\Component\Yaml\Exception\ParseException;
+use Symfony\Component\Yaml\Yaml;
+
+class show extends \phpbb\console\command\command
+{
+ /**
+ * @var factory
+ */
+ protected $iohandler_factory;
+
+ /**
+ * @var installer
+ */
+ protected $installer;
+
+ /**
+ * @var language
+ */
+ protected $language;
+
+ /**
+ * Constructor
+ *
+ * @param language $language
+ * @param factory $factory
+ * @param installer $installer
+ */
+ public function __construct(language $language, factory $factory, installer $installer)
+ {
+ $this->iohandler_factory = $factory;
+ $this->installer = $installer;
+ $this->language = $language;
+
+ parent::__construct(new \phpbb\user($language, 'datetime'));
+ }
+
+ /**
+ *
+ * {@inheritdoc}
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('install:config:show')
+ ->addArgument(
+ 'config-file',
+ InputArgument::REQUIRED,
+ $this->language->lang('CLI_CONFIG_FILE'))
+ ->setDescription($this->language->lang('CLI_INSTALL_SHOW_CONFIG'))
+ ;
+ }
+
+ /**
+ * Show the validated configuration
+ *
+ * @param InputInterface $input An InputInterface instance
+ * @param OutputInterface $output An OutputInterface instance
+ *
+ * @return null
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $this->iohandler_factory->set_environment('cli');
+
+ /** @var \phpbb\install\helper\iohandler\cli_iohandler $iohandler */
+ $iohandler = $this->iohandler_factory->get();
+ $style = new SymfonyStyle($input, $output);
+ $iohandler->set_style($style, $output);
+
+ $config_file = $input->getArgument('config-file');
+
+ if (!is_file($config_file))
+ {
+ $iohandler->add_error_message(array('MISSING_FILE', array($config_file)));
+
+ return;
+ }
+
+ try
+ {
+ $config = Yaml::parse(file_get_contents($config_file), true, false);
+ }
+ catch (ParseException $e)
+ {
+ $iohandler->add_error_message('INVALID_YAML_FILE');
+
+ return;
+ }
+
+ $processor = new Processor();
+ $configuration = new installer_configuration();
+
+ try
+ {
+ $config = $processor->processConfiguration($configuration, $config);
+ }
+ catch (Exception $e)
+ {
+ $iohandler->add_error_message('INVALID_CONFIGURATION', $e->getMessage());
+
+ return;
+ }
+
+ $iohandler->add_log_message(Yaml::dump(array('installer' => $config), 10, 4, true, false));
+ }
+}
diff --git a/phpBB/phpbb/install/console/command/install/config/validate.php b/phpBB/phpbb/install/console/command/install/config/validate.php
new file mode 100644
index 0000000000..19b6f99a8b
--- /dev/null
+++ b/phpBB/phpbb/install/console/command/install/config/validate.php
@@ -0,0 +1,132 @@
+<?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\install\console\command\install\config;
+
+use phpbb\install\helper\iohandler\factory;
+use phpbb\install\installer;
+use phpbb\install\installer_configuration;
+use phpbb\language\language;
+use Symfony\Component\Config\Definition\Exception\Exception;
+use Symfony\Component\Config\Definition\Processor;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Style\SymfonyStyle;
+use Symfony\Component\Yaml\Exception\ParseException;
+use Symfony\Component\Yaml\Yaml;
+
+class validate extends \phpbb\console\command\command
+{
+ /**
+ * @var factory
+ */
+ protected $iohandler_factory;
+
+ /**
+ * @var installer
+ */
+ protected $installer;
+
+ /**
+ * @var language
+ */
+ protected $language;
+
+ /**
+ * Constructor
+ *
+ * @param language $language
+ * @param factory $factory
+ * @param installer $installer
+ */
+ public function __construct(language $language, factory $factory, installer $installer)
+ {
+ $this->iohandler_factory = $factory;
+ $this->installer = $installer;
+ $this->language = $language;
+
+ parent::__construct(new \phpbb\user($language, 'datetime'));
+ }
+
+ /**
+ *
+ * {@inheritdoc}
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('install:config:validate')
+ ->addArgument(
+ 'config-file',
+ InputArgument::REQUIRED,
+ $this->language->lang('CLI_CONFIG_FILE'))
+ ->setDescription($this->language->lang('CLI_INSTALL_VALIDATE_CONFIG'))
+ ;
+ }
+
+ /**
+ * Validate the configuration file
+ *
+ * @param InputInterface $input An InputInterface instance
+ * @param OutputInterface $output An OutputInterface instance
+ *
+ * @return null
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $this->iohandler_factory->set_environment('cli');
+
+ /** @var \phpbb\install\helper\iohandler\cli_iohandler $iohandler */
+ $iohandler = $this->iohandler_factory->get();
+ $style = new SymfonyStyle($input, $output);
+ $iohandler->set_style($style, $output);
+
+ $config_file = $input->getArgument('config-file');
+
+ if (!is_file($config_file))
+ {
+ $iohandler->add_error_message(array('MISSING_FILE', array($config_file)));
+
+ return 1;
+ }
+
+ try
+ {
+ $config = Yaml::parse(file_get_contents($config_file), true, false);
+ }
+ catch (ParseException $e)
+ {
+ $iohandler->add_error_message('INVALID_YAML_FILE');
+
+ return 1;
+ }
+
+ $processor = new Processor();
+ $configuration = new installer_configuration();
+
+ try
+ {
+ $config = $processor->processConfiguration($configuration, $config);
+ }
+ catch (Exception $e)
+ {
+ $iohandler->add_error_message('INVALID_CONFIGURATION', $e->getMessage());
+
+ return 1;
+ }
+
+ $iohandler->add_success_message('CONFIGURATION_VALID');
+ return 0;
+ }
+}
diff --git a/phpBB/phpbb/install/console/command/install/install.php b/phpBB/phpbb/install/console/command/install/install.php
new file mode 100644
index 0000000000..81ad1039f6
--- /dev/null
+++ b/phpBB/phpbb/install/console/command/install/install.php
@@ -0,0 +1,206 @@
+<?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\install\console\command\install;
+
+use phpbb\install\exception\installer_exception;
+use phpbb\install\helper\install_helper;
+use phpbb\install\helper\iohandler\cli_iohandler;
+use phpbb\install\helper\iohandler\factory;
+use phpbb\install\installer;
+use phpbb\install\installer_configuration;
+use phpbb\language\language;
+use Symfony\Component\Config\Definition\Exception\Exception;
+use Symfony\Component\Config\Definition\Processor;
+use Symfony\Component\Console\Input\InputArgument;
+use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Style\SymfonyStyle;
+use Symfony\Component\Yaml\Exception\ParseException;
+use Symfony\Component\Yaml\Yaml;
+
+class install extends \phpbb\console\command\command
+{
+ /**
+ * @var factory
+ */
+ protected $iohandler_factory;
+
+ /**
+ * @var installer
+ */
+ protected $installer;
+
+ /**
+ * @var install_helper
+ */
+ protected $install_helper;
+
+ /**
+ * @var language
+ */
+ protected $language;
+
+ /**
+ * Constructor
+ *
+ * @param language $language
+ * @param factory $factory
+ * @param installer $installer
+ * @param install_helper $install_helper
+ */
+ public function __construct(language $language, factory $factory, installer $installer, install_helper $install_helper)
+ {
+ $this->iohandler_factory = $factory;
+ $this->installer = $installer;
+ $this->language = $language;
+ $this->install_helper = $install_helper;
+
+ parent::__construct(new \phpbb\user($language, 'datetime'));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function configure()
+ {
+ $this
+ ->setName('install')
+ ->addArgument(
+ 'config-file',
+ InputArgument::REQUIRED,
+ $this->language->lang('CLI_CONFIG_FILE'))
+ ->setDescription($this->language->lang('CLI_INSTALL_BOARD'))
+ ;
+ }
+
+ /**
+ * Executes the command install.
+ *
+ * Install the board
+ *
+ * @param InputInterface $input An InputInterface instance
+ * @param OutputInterface $output An OutputInterface instance
+ *
+ * @return null
+ */
+ protected function execute(InputInterface $input, OutputInterface $output)
+ {
+ $this->iohandler_factory->set_environment('cli');
+
+ /** @var \phpbb\install\helper\iohandler\cli_iohandler $iohandler */
+ $iohandler = $this->iohandler_factory->get();
+ $style = new SymfonyStyle($input, $output);
+ $iohandler->set_style($style, $output);
+
+ $this->installer->set_iohandler($iohandler);
+
+ $config_file = $input->getArgument('config-file');
+
+ if ($this->install_helper->is_phpbb_installed())
+ {
+ $iohandler->add_error_message('PHPBB_ALREADY_INSTALLED');
+
+ return 1;
+ }
+
+ if (!is_file($config_file))
+ {
+ $iohandler->add_error_message(array('MISSING_FILE', array($config_file)));
+
+ return 1;
+ }
+
+ try
+ {
+ $config = Yaml::parse(file_get_contents($config_file), true, false);
+ }
+ catch (ParseException $e)
+ {
+ $iohandler->add_error_message('INVALID_YAML_FILE');
+
+ return 1;
+ }
+
+ $processor = new Processor();
+ $configuration = new installer_configuration();
+
+ try
+ {
+ $config = $processor->processConfiguration($configuration, $config);
+ }
+ catch (Exception $e)
+ {
+ $iohandler->add_error_message('INVALID_CONFIGURATION', $e->getMessage());
+
+ return 1;
+ }
+
+ $this->register_configuration($iohandler, $config);
+
+ try
+ {
+ $this->installer->run();
+ }
+ catch (installer_exception $e)
+ {
+ $iohandler->add_error_message($e->getMessage());
+ return 1;
+ }
+ }
+
+ /**
+ * Register the configuration to simulate the forms.
+ *
+ * @param cli_iohandler $iohandler
+ * @param array $config
+ */
+ private function register_configuration(cli_iohandler $iohandler, $config)
+ {
+ $iohandler->set_input('admin_name', $config['admin']['name']);
+ $iohandler->set_input('admin_pass1', $config['admin']['password']);
+ $iohandler->set_input('admin_pass2', $config['admin']['password']);
+ $iohandler->set_input('board_email', $config['admin']['email']);
+ $iohandler->set_input('submit_admin', 'submit');
+
+ $iohandler->set_input('default_lang', $config['board']['lang']);
+ $iohandler->set_input('board_name', $config['board']['name']);
+ $iohandler->set_input('board_description', $config['board']['description']);
+ $iohandler->set_input('submit_board', 'submit');
+
+ $iohandler->set_input('dbms', $config['database']['dbms']);
+ $iohandler->set_input('dbhost', $config['database']['dbhost']);
+ $iohandler->set_input('dbport', $config['database']['dbport']);
+ $iohandler->set_input('dbuser', $config['database']['dbuser']);
+ $iohandler->set_input('dbpasswd', $config['database']['dbpasswd']);
+ $iohandler->set_input('dbname', $config['database']['dbname']);
+ $iohandler->set_input('table_prefix', $config['database']['table_prefix']);
+ $iohandler->set_input('submit_database', 'submit');
+
+ $iohandler->set_input('email_enable', $config['email']['enabled']);
+ $iohandler->set_input('smtp_delivery', $config['email']['smtp_delivery']);
+ $iohandler->set_input('smtp_host', $config['email']['smtp_host']);
+ $iohandler->set_input('smtp_auth', $config['email']['smtp_auth']);
+ $iohandler->set_input('smtp_user', $config['email']['smtp_user']);
+ $iohandler->set_input('smtp_pass', $config['email']['smtp_pass']);
+ $iohandler->set_input('submit_email', 'submit');
+
+ $iohandler->set_input('cookie_secure', $config['server']['cookie_secure']);
+ $iohandler->set_input('server_protocol', $config['server']['server_protocol']);
+ $iohandler->set_input('force_server_vars', $config['server']['force_server_vars']);
+ $iohandler->set_input('server_name', $config['server']['server_name']);
+ $iohandler->set_input('server_port', $config['server']['server_port']);
+ $iohandler->set_input('script_path', $config['server']['script_path']);
+ $iohandler->set_input('submit_server', 'submit');
+ }
+}
diff --git a/phpBB/phpbb/install/controller/helper.php b/phpBB/phpbb/install/controller/helper.php
new file mode 100644
index 0000000000..fdfa6821ed
--- /dev/null
+++ b/phpBB/phpbb/install/controller/helper.php
@@ -0,0 +1,362 @@
+<?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\install\controller;
+
+use phpbb\install\helper\navigation\navigation_provider;
+use phpbb\language\language;
+use phpbb\language\language_file_helper;
+use phpbb\path_helper;
+use phpbb\request\request;
+use phpbb\request\request_interface;
+use phpbb\routing\router;
+use phpbb\symfony_request;
+use phpbb\template\template;
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\HttpFoundation\Cookie;
+
+/**
+ * A duplicate of \phpbb\controller\helper
+ *
+ * This class is necessary because of controller\helper's legacy function calls
+ * to page_header() page_footer() functions which has unavailable dependencies.
+ */
+class helper
+{
+ /**
+ * @var \phpbb\language\language
+ */
+ protected $language;
+
+ /**
+ * @var bool|string
+ */
+ protected $language_cookie;
+
+ /**
+ * @var \phpbb\language\language_file_helper
+ */
+ protected $lang_helper;
+
+ /**
+ * @var \phpbb\install\helper\navigation\navigation_provider
+ */
+ protected $navigation_provider;
+
+ /**
+ * @var \phpbb\template\template
+ */
+ protected $template;
+
+ /**
+ * @var \phpbb\path_helper
+ */
+ protected $path_helper;
+
+ /**
+ * @var \phpbb\request\request
+ */
+ protected $phpbb_request;
+
+ /**
+ * @var \phpbb\symfony_request
+ */
+ protected $request;
+
+ /**
+ * @var \phpbb\routing\router
+ */
+ protected $router;
+
+ /**
+ * @var string
+ */
+ protected $phpbb_admin_path;
+
+ /**
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * Constructor
+ *
+ * @param language $language
+ * @param language_file_helper $lang_helper
+ * @param navigation_provider $nav
+ * @param template $template
+ * @param path_helper $path_helper
+ * @param request $phpbb_request
+ * @param symfony_request $request
+ * @param router $router
+ * @param string $phpbb_root_path
+ */
+ public function __construct(language $language, language_file_helper $lang_helper, navigation_provider $nav, template $template, path_helper $path_helper, request $phpbb_request, symfony_request $request, router $router, $phpbb_root_path)
+ {
+ $this->language = $language;
+ $this->language_cookie = false;
+ $this->lang_helper = $lang_helper;
+ $this->navigation_provider = $nav;
+ $this->template = $template;
+ $this->path_helper = $path_helper;
+ $this->phpbb_request = $phpbb_request;
+ $this->request = $request;
+ $this->router = $router;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->phpbb_admin_path = $phpbb_root_path . 'adm/';
+ }
+
+ /**
+ * Automate setting up the page and creating the response object.
+ *
+ * @param string $template_file The template handle to render
+ * @param string $page_title The title of the page to output
+ * @param bool $selected_language True to enable language selector it, false otherwise
+ * @param int $status_code The status code to be sent to the page header
+ *
+ * @return Response object containing rendered page
+ */
+ public function render($template_file, $page_title = '', $selected_language = false, $status_code = 200)
+ {
+ $this->page_header($page_title, $selected_language);
+
+ $this->template->set_filenames(array(
+ 'body' => $template_file,
+ ));
+
+ $response = new Response($this->template->assign_display('body'), $status_code);
+
+ // Set language cookie
+ if ($this->language_cookie !== false)
+ {
+ $cookie = new Cookie('lang', $this->language_cookie, time() + 3600);
+ $response->headers->setCookie($cookie);
+
+ $this->language_cookie = false;
+ }
+
+ return $response;
+ }
+
+ /**
+ * Returns path from route name
+ *
+ * @param string $route_name
+ *
+ * @return string
+ */
+ public function route($route_name)
+ {
+ $url = $this->router->generate($route_name);
+
+ return $url;
+ }
+
+ /**
+ * Handles language selector form
+ */
+ public function handle_language_select()
+ {
+ $lang = null;
+
+ // Check if language form has been submited
+ $submit = $this->phpbb_request->variable('change_lang', '');
+ if (!empty($submit))
+ {
+ $lang = $this->phpbb_request->variable('language', '');
+
+ if (!empty($lang))
+ {
+ $this->language_cookie = $lang;
+ }
+ }
+
+ // Retrieve language from cookie
+ $lang_cookie = $this->phpbb_request->variable('lang', '', false, request_interface::COOKIE);
+ if (empty($lang) && !empty($lang_cookie))
+ {
+ $lang = $lang_cookie;
+ $this->language_cookie = $lang;
+ }
+
+ $lang = (!empty($lang) && strpos($lang, '/')) ? $lang : null;
+
+ $this->render_language_select($lang);
+
+ if ($lang !== null)
+ {
+ $this->language->set_user_language($lang, true);
+ }
+ }
+
+ /**
+ * Set default template variables
+ *
+ * @param string $page_title Title of the page
+ * @param bool $selected_language True to enable language selector it, false otherwise
+ */
+ protected function page_header($page_title, $selected_language = false)
+ {
+ $this->template->assign_vars(array(
+ 'L_CHANGE' => $this->language->lang('CHANGE'),
+ 'L_COLON' => $this->language->lang('COLON'),
+ 'L_INSTALL_PANEL' => $this->language->lang('INSTALL_PANEL'),
+ 'L_SELECT_LANG' => $this->language->lang('SELECT_LANG'),
+ 'L_SKIP' => $this->language->lang('SKIP'),
+ 'PAGE_TITLE' => $this->language->lang($page_title),
+ 'T_IMAGE_PATH' => htmlspecialchars($this->phpbb_admin_path) . 'images/',
+ 'T_JQUERY_LINK' => $this->path_helper->get_web_root_path() . 'assets/javascript/jquery.min.js',
+ 'T_TEMPLATE_PATH' => $this->path_helper->get_web_root_path() . 'adm/style',
+ 'T_ASSETS_PATH' => $this->path_helper->get_web_root_path() . 'assets/',
+
+ 'S_CONTENT_DIRECTION' => $this->language->lang('DIRECTION'),
+ 'S_CONTENT_FLOW_BEGIN' => ($this->language->lang('DIRECTION') === 'ltr') ? 'left' : 'right',
+ 'S_CONTENT_FLOW_END' => ($this->language->lang('DIRECTION') === 'ltr') ? 'right' : 'left',
+ 'S_CONTENT_ENCODING' => 'UTF-8',
+ 'S_LANG_SELECT' => $selected_language,
+
+ 'S_USER_LANG' => $this->language->lang('USER_LANG'),
+ )
+ );
+
+ $this->render_navigation();
+ }
+
+ /**
+ * Render navigation
+ */
+ protected function render_navigation()
+ {
+ // Get navigation items
+ $nav_array = $this->navigation_provider->get();
+ $nav_array = $this->sort_navigation_level($nav_array);
+
+ $active_main_menu = $this->get_active_main_menu($nav_array);
+
+ // Pass navigation to template
+ foreach ($nav_array as $key => $entry)
+ {
+ $this->template->assign_block_vars('t_block1', array(
+ 'L_TITLE' => $this->language->lang($entry['label']),
+ 'S_SELECTED' => ($active_main_menu === $key),
+ 'U_TITLE' => $this->route($entry['route']),
+ ));
+
+ if (is_array($entry[0]) && $active_main_menu === $key)
+ {
+ $entry[0] = $this->sort_navigation_level($entry[0]);
+
+ foreach ($entry[0] as $name => $sub_entry)
+ {
+ if (isset($sub_entry['stage']) && $sub_entry['stage'] === true)
+ {
+ $this->template->assign_block_vars('l_block2', array(
+ 'L_TITLE' => $this->language->lang($sub_entry['label']),
+ 'S_SELECTED' => (isset($sub_entry['selected']) && $sub_entry['selected'] === true),
+ 'S_COMPLETE' => (isset($sub_entry['completed']) && $sub_entry['completed'] === true),
+ 'STAGE_NAME' => $name,
+ ));
+ }
+ else
+ {
+ $this->template->assign_block_vars('l_block1', array(
+ 'L_TITLE' => $this->language->lang($sub_entry['label']),
+ 'S_SELECTED' => (isset($sub_entry['route']) && $sub_entry['route'] === $this->request->get('_route')),
+ 'U_TITLE' => $this->route($sub_entry['route']),
+ ));
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Render language select form
+ *
+ * @param string $selected_language
+ */
+ protected function render_language_select($selected_language = null)
+ {
+ $langs = $this->lang_helper->get_available_languages();
+ foreach ($langs as $lang)
+ {
+ $this->template->assign_block_vars('language_select_item', array(
+ 'VALUE' => $lang['iso'],
+ 'NAME' => $lang['local_name'],
+ 'SELECTED' => ($lang['iso'] === $selected_language),
+ ));
+ }
+ }
+
+ /**
+ * Returns the name of the active main menu item
+ *
+ * @param array $nav_array
+ *
+ * @return string|bool Returns the name of the active main menu element, if the element not found, returns false
+ */
+ protected function get_active_main_menu($nav_array)
+ {
+ $active_route = $this->request->get('_route');
+
+ foreach ($nav_array as $nav_name => $nav_options)
+ {
+ $current_menu = $nav_name;
+
+ if (isset($nav_options['route']) && $nav_options['route'] === $active_route)
+ {
+ return $nav_name;
+ }
+
+ if (is_array($nav_options[0]))
+ {
+ foreach ($nav_options[0] as $sub_menus)
+ {
+ if (isset($sub_menus['route']) && $sub_menus['route'] === $active_route)
+ {
+ return $current_menu;
+ }
+ }
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Sorts the top level of navigation array
+ *
+ * @param array $nav_array Navigation array
+ *
+ * @return array
+ */
+ protected function sort_navigation_level($nav_array)
+ {
+ $sorted = array();
+ foreach ($nav_array as $key => $nav)
+ {
+ $order = (isset($nav['order'])) ? $nav['order'] : 0;
+ $sorted[$order][$key] = $nav;
+ }
+
+ // Linearization of navigation array
+ $nav_array = array();
+ ksort($sorted);
+ foreach ($sorted as $nav)
+ {
+ $nav_array = array_merge($nav_array, $nav);
+ }
+
+ return $nav_array;
+ }
+}
diff --git a/phpBB/phpbb/install/controller/install.php b/phpBB/phpbb/install/controller/install.php
new file mode 100644
index 0000000000..80f6651a39
--- /dev/null
+++ b/phpBB/phpbb/install/controller/install.php
@@ -0,0 +1,202 @@
+<?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\install\controller;
+
+use phpbb\install\helper\config;
+use phpbb\install\helper\install_helper;
+use phpbb\install\helper\navigation\navigation_provider;
+use Symfony\Component\HttpFoundation\StreamedResponse;
+use Symfony\Component\HttpFoundation\Response;
+use phpbb\install\helper\iohandler\factory;
+use phpbb\install\controller\helper;
+use phpbb\template\template;
+use phpbb\request\request_interface;
+use phpbb\install\installer;
+use phpbb\language\language;
+
+/**
+ * Controller for installing phpBB
+ */
+class install
+{
+ /**
+ * @var helper
+ */
+ protected $controller_helper;
+
+ /**
+ * @var config
+ */
+ protected $installer_config;
+
+ /**
+ * @var factory
+ */
+ protected $iohandler_factory;
+
+ /**
+ * @var navigation_provider
+ */
+ protected $menu_provider;
+
+ /**
+ * @var language
+ */
+ protected $language;
+
+ /**
+ * @var template
+ */
+ protected $template;
+
+ /**
+ * @var request_interface
+ */
+ protected $request;
+
+ /**
+ * @var installer
+ */
+ protected $installer;
+
+ /**
+ * @var install_helper
+ */
+ protected $install_helper;
+
+ /**
+ * Constructor
+ *
+ * @param helper $helper
+ * @param config $install_config
+ * @param factory $factory
+ * @param navigation_provider $nav_provider
+ * @param language $language
+ * @param template $template
+ * @param request_interface $request
+ * @param installer $installer
+ * @param install_helper $install_helper
+ */
+ public function __construct(helper $helper, config $install_config, factory $factory, navigation_provider $nav_provider, language $language, template $template, request_interface $request, installer $installer, install_helper $install_helper)
+ {
+ $this->controller_helper = $helper;
+ $this->installer_config = $install_config;
+ $this->iohandler_factory = $factory;
+ $this->menu_provider = $nav_provider;
+ $this->language = $language;
+ $this->template = $template;
+ $this->request = $request;
+ $this->installer = $installer;
+ $this->install_helper = $install_helper;
+ }
+
+ /**
+ * Controller logic
+ *
+ * @return Response|StreamedResponse
+ */
+ public function handle()
+ {
+ if ($this->install_helper->is_phpbb_installed())
+ {
+ die ('phpBB is already installed');
+ }
+
+ $this->template->assign_vars(array(
+ 'U_ACTION' => $this->controller_helper->route('phpbb_installer_install'),
+ ));
+
+ // Set up input-output handler
+ if ($this->request->is_ajax())
+ {
+ $this->iohandler_factory->set_environment('ajax');
+ }
+ else
+ {
+ $this->iohandler_factory->set_environment('nojs');
+ }
+
+ // Set the appropriate input-output handler
+ $this->installer->set_iohandler($this->iohandler_factory->get());
+
+ // Set up navigation
+ $nav_data = $this->installer_config->get_navigation_data();
+ /** @var \phpbb\install\helper\iohandler\iohandler_interface $iohandler */
+ $iohandler = $this->iohandler_factory->get();
+
+ // Set active navigation stage
+ if (isset($nav_data['active']) && is_array($nav_data['active']))
+ {
+ $iohandler->set_active_stage_menu($nav_data['active']);
+ $this->menu_provider->set_nav_property($nav_data['active'], array(
+ 'selected' => true,
+ 'completed' => false,
+ ));
+ }
+
+ // Set finished navigation stages
+ if (isset($nav_data['finished']) && is_array($nav_data['finished']))
+ {
+ foreach ($nav_data['finished'] as $finished_stage)
+ {
+ $iohandler->set_finished_stage_menu($finished_stage);
+ $this->menu_provider->set_nav_property($finished_stage, array(
+ 'selected' => false,
+ 'completed' => true,
+ ));
+ }
+ }
+
+ if ($this->request->is_ajax())
+ {
+ $installer = $this->installer;
+ $response = new StreamedResponse();
+ $response->setCallback(function() use ($installer) {
+ $installer->run();
+ });
+
+ // Try to bypass any server output buffers
+ $response->headers->set('X-Accel-Buffering', 'no');
+
+ return $response;
+ }
+ else
+ {
+ // Determine whether the installation was started or not
+ if (true)
+ {
+ $this->controller_helper->handle_language_select();
+
+ // Set active stage
+ $this->menu_provider->set_nav_property(
+ array('install', 0, 'introduction'),
+ array(
+ 'selected' => true,
+ 'completed' => false,
+ )
+ );
+
+ // If not, let's render the welcome page
+ $this->template->assign_vars(array(
+ 'SHOW_INSTALL_START_FORM' => true,
+ 'TITLE' => $this->language->lang('INSTALL_INTRO'),
+ 'CONTENT' => $this->language->lang('INSTALL_INTRO_BODY'),
+ ));
+ return $this->controller_helper->render('installer_install.html', 'INSTALL', true);
+ }
+
+ // @todo: implement no js controller logic
+ }
+ }
+}
diff --git a/phpBB/phpbb/install/controller/installer_index.php b/phpBB/phpbb/install/controller/installer_index.php
new file mode 100644
index 0000000000..c2d9572284
--- /dev/null
+++ b/phpBB/phpbb/install/controller/installer_index.php
@@ -0,0 +1,81 @@
+<?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\install\controller;
+
+class installer_index
+{
+ /**
+ * @var helper
+ */
+ protected $helper;
+
+ /**
+ * @var \phpbb\language\language
+ */
+ protected $language;
+
+ /**
+ * @var \phpbb\template\template
+ */
+ protected $template;
+
+ /**
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * Constructor
+ *
+ * @param helper $helper
+ * @param \phpbb\language\language $language
+ * @param \phpbb\template\template $template
+ * @param string $phpbb_root_path
+ */
+ public function __construct(helper $helper, \phpbb\language\language $language, \phpbb\template\template $template, $phpbb_root_path)
+ {
+ $this->helper = $helper;
+ $this->language = $language;
+ $this->template = $template;
+ $this->phpbb_root_path = $phpbb_root_path;
+ }
+
+ public function handle($mode)
+ {
+ $this->helper->handle_language_select();
+
+ switch ($mode)
+ {
+ case "intro":
+ $title = $this->language->lang('INTRODUCTION_TITLE');
+ $body = $this->language->lang('INTRODUCTION_BODY');
+ break;
+ case "support":
+ $title = $this->language->lang('SUPPORT_TITLE');
+ $body = $this->language->lang('SUPPORT_BODY');
+ break;
+ case "license":
+ $title = $this->language->lang('LICENSE_TITLE');
+ $body = implode("<br/>\n", file($this->phpbb_root_path . 'docs/LICENSE.txt'));
+ break;
+ }
+
+ $this->template->assign_vars(array(
+ 'TITLE' => $title,
+ 'BODY' => $body,
+ ));
+
+ return $this->helper->render('installer_main.html', $title, true);
+ }
+}
diff --git a/phpBB/phpbb/install/exception/cannot_build_container_exception.php b/phpBB/phpbb/install/exception/cannot_build_container_exception.php
new file mode 100644
index 0000000000..6cf12b008b
--- /dev/null
+++ b/phpBB/phpbb/install/exception/cannot_build_container_exception.php
@@ -0,0 +1,22 @@
+<?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\install\exception;
+
+/**
+ * Thrown when the container cannot be built
+ */
+class cannot_build_container_exception extends installer_exception
+{
+
+}
diff --git a/phpBB/phpbb/install/exception/installer_config_not_writable_exception.php b/phpBB/phpbb/install/exception/installer_config_not_writable_exception.php
new file mode 100644
index 0000000000..51864c5dca
--- /dev/null
+++ b/phpBB/phpbb/install/exception/installer_config_not_writable_exception.php
@@ -0,0 +1,22 @@
+<?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\install\exception;
+
+/**
+ * Thrown when installer config is not writable to disk
+ */
+class installer_config_not_writable_exception extends installer_exception
+{
+
+}
diff --git a/phpBB/phpbb/install/exception/installer_exception.php b/phpBB/phpbb/install/exception/installer_exception.php
new file mode 100644
index 0000000000..f17dca8f17
--- /dev/null
+++ b/phpBB/phpbb/install/exception/installer_exception.php
@@ -0,0 +1,24 @@
+<?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\install\exception;
+
+use phpbb\exception\runtime_exception;
+
+/**
+ * Installer's base exception
+ */
+class installer_exception extends runtime_exception
+{
+
+}
diff --git a/phpBB/phpbb/install/exception/invalid_dbms_exception.php b/phpBB/phpbb/install/exception/invalid_dbms_exception.php
new file mode 100644
index 0000000000..38de5f613a
--- /dev/null
+++ b/phpBB/phpbb/install/exception/invalid_dbms_exception.php
@@ -0,0 +1,22 @@
+<?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\install\exception;
+
+/**
+ * Thrown when an unavailable DBMS has been selected
+ */
+class invalid_dbms_exception extends installer_exception
+{
+
+}
diff --git a/phpBB/phpbb/install/exception/resource_limit_reached_exception.php b/phpBB/phpbb/install/exception/resource_limit_reached_exception.php
new file mode 100644
index 0000000000..025e09fbd3
--- /dev/null
+++ b/phpBB/phpbb/install/exception/resource_limit_reached_exception.php
@@ -0,0 +1,22 @@
+<?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\install\exception;
+
+/**
+ * Thrown when the installer is out of memory or time
+ */
+class resource_limit_reached_exception extends installer_exception
+{
+
+}
diff --git a/phpBB/phpbb/install/exception/user_interaction_required_exception.php b/phpBB/phpbb/install/exception/user_interaction_required_exception.php
new file mode 100644
index 0000000000..d65a448841
--- /dev/null
+++ b/phpBB/phpbb/install/exception/user_interaction_required_exception.php
@@ -0,0 +1,25 @@
+<?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\install\exception;
+
+/**
+ * This exception should be thrown when user interaction is inevitable
+ *
+ * Note: Please note that the output should already be setup for the user
+ * when you use throw this exception
+ */
+class user_interaction_required_exception extends installer_exception
+{
+
+}
diff --git a/phpBB/phpbb/install/helper/config.php b/phpBB/phpbb/install/helper/config.php
new file mode 100644
index 0000000000..b0480e7e5b
--- /dev/null
+++ b/phpBB/phpbb/install/helper/config.php
@@ -0,0 +1,386 @@
+<?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\install\helper;
+
+use phpbb\install\exception\installer_config_not_writable_exception;
+
+/**
+ * Stores common settings and installation status
+ */
+class config
+{
+ /**
+ * @var \phpbb\filesystem\filesystem_interface
+ */
+ protected $filesystem;
+
+ /**
+ * Array which contains config settings for the installer
+ *
+ * The array will also store all the user input, as well as any
+ * data that is passed to other tasks by a task.
+ *
+ * @var array
+ */
+ protected $installer_config;
+
+ /**
+ * @var string
+ */
+ protected $install_config_file;
+
+ /**
+ * @var \phpbb\php\ini
+ */
+ protected $php_ini;
+
+ /**
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * Array containing progress information
+ *
+ * @var array
+ */
+ protected $progress_data;
+
+ /**
+ * Array containing system information
+ *
+ * The array contains run time and memory limitations.
+ *
+ * @var array
+ */
+ protected $system_data;
+
+ /**
+ * Array containing navigation bar information
+ *
+ * @var array
+ */
+ protected $navigation_data;
+
+ /**
+ * Flag indicating that config file should be cleaned up
+ *
+ * @var bool
+ */
+ protected $do_clean_up;
+
+ /**
+ * Constructor
+ */
+ public function __construct(\phpbb\filesystem\filesystem_interface $filesystem, \phpbb\php\ini $php_ini, $phpbb_root_path)
+ {
+ $this->filesystem = $filesystem;
+ $this->php_ini = $php_ini;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->do_clean_up = false;
+
+ // Set up data arrays
+ $this->navigation_data = array();
+ $this->installer_config = array();
+ $this->system_data = array();
+ $this->progress_data = array(
+ 'last_task_module_name' => '', // Stores the service name of the latest finished module
+ 'last_task_name' => '', // Stores the service name of the latest finished task
+ 'max_task_progress' => 0,
+ 'current_task_progress' => 0,
+ );
+
+ $this->install_config_file = $this->phpbb_root_path . 'store/install_config.php';
+
+ $this->setup_system_data();
+ }
+
+ /**
+ * Returns data for a specified parameter
+ *
+ * @param string $param_name Name of the parameter to return
+ * @param mixed $default Default value to return when the specified data
+ * does not exist.
+ *
+ * @return mixed value of the specified parameter or the default value if the data
+ * cannot be recovered.
+ */
+ public function get($param_name, $default = false)
+ {
+ return (isset($this->installer_config[$param_name])) ? $this->installer_config[$param_name] : $default;
+ }
+
+ /**
+ * Sets a parameter in installer_config
+ *
+ * @param string $param_name Name of the parameter
+ * @param mixed $value Values to set the parameter
+ */
+ public function set($param_name, $value)
+ {
+ $this->installer_config = array_merge($this->installer_config, array(
+ $param_name => $value,
+ ));
+ }
+
+ /**
+ * Returns system parameter
+ *
+ * @param string $param_name Name of the parameter
+ *
+ * @return mixed Returns system parameter if it is defined, false otherwise
+ */
+ public function system_get($param_name)
+ {
+ return (isset($this->system_data[$param_name])) ? $this->system_data[$param_name] : false;
+ }
+
+ /**
+ * Returns remaining time until the run time limit
+ *
+ * @return int Remaining time until the run time limit in seconds
+ */
+ public function get_time_remaining()
+ {
+ if ($this->system_data['max_execution_time'] <= 0)
+ {
+ return 1;
+ }
+
+ return ($this->system_data['start_time'] + $this->system_data['max_execution_time']) - time();
+ }
+
+ /**
+ * Returns remaining memory available for PHP
+ *
+ * @return int Remaining memory until reaching the limit
+ */
+ public function get_memory_remaining()
+ {
+ if ($this->system_data['memory_limit'] <= 0)
+ {
+ return 1;
+ }
+
+ if (function_exists('memory_get_usage'))
+ {
+ return ($this->system_data['memory_limit'] - memory_get_usage());
+ }
+
+ // If we cannot get the information then just return a positive number (and cross fingers)
+ return 1;
+ }
+
+ /**
+ * Saves the latest executed task
+ *
+ * @param string $task_service_name Name of the installer task service
+ */
+ public function set_finished_task($task_service_name)
+ {
+ $this->progress_data['last_task_name'] = $task_service_name;
+ }
+
+ /**
+ * Set active module
+ *
+ * @param string $module_service_name Name of the installer module service
+ */
+ public function set_active_module($module_service_name)
+ {
+ $this->progress_data['last_task_module_name'] = $module_service_name;
+ }
+
+ /**
+ * Getter for progress data
+ *
+ * @return array
+ */
+ public function get_progress_data()
+ {
+ return $this->progress_data;
+ }
+
+ /**
+ * Recovers install configuration from file
+ */
+ public function load_config()
+ {
+ if (!$this->filesystem->exists($this->install_config_file))
+ {
+ return;
+ }
+
+ $file_content = @file_get_contents($this->install_config_file);
+ $serialized_data = trim(substr($file_content, 8));
+
+ $this->installer_config = array();
+ $this->progress_data = array();
+ $this->navigation_data = array();
+
+ if (!empty($serialized_data))
+ {
+ $unserialized_data = json_decode($serialized_data, true);
+
+ $this->installer_config = (is_array($unserialized_data['installer_config'])) ? $unserialized_data['installer_config'] : array();
+ $this->progress_data = (is_array($unserialized_data['progress_data'])) ? $unserialized_data['progress_data'] : array();
+ $this->navigation_data = (is_array($unserialized_data['navigation_data'])) ? $unserialized_data['navigation_data'] : array();
+ }
+ }
+
+ /**
+ * Dumps install configuration to disk
+ */
+ public function save_config()
+ {
+ if ($this->do_clean_up)
+ {
+ @unlink($this->install_config_file);
+ return;
+ }
+
+ // Create array to save
+ $save_array = array(
+ 'installer_config' => $this->installer_config,
+ 'progress_data' => $this->progress_data,
+ 'navigation_data' => $this->navigation_data,
+ );
+
+ // Create file content
+ $file_content = '<?php // ';
+ $file_content .= json_encode($save_array);
+ $file_content .= "\n";
+
+ // Dump file_content to disk
+ $fp = @fopen($this->install_config_file, 'w');
+ if (!$fp)
+ {
+ throw new installer_config_not_writable_exception();
+ }
+
+ fwrite($fp, $file_content);
+ fclose($fp);
+ }
+
+ /**
+ * Increments the task progress
+ *
+ * @param int $increment_by The amount to increment by
+ */
+ public function increment_current_task_progress($increment_by = 1)
+ {
+ $this->progress_data['current_task_progress'] += $increment_by;
+
+ if ($this->progress_data['current_task_progress'] > $this->progress_data['max_task_progress'])
+ {
+ $this->progress_data['current_task_progress'] = $this->progress_data['max_task_progress'];
+ }
+ }
+
+ /**
+ * Sets the task progress to a specific number
+ *
+ * @param int $task_progress The task progress number to be set
+ */
+ public function set_current_task_progress($task_progress)
+ {
+ $this->progress_data['current_task_progress'] = $task_progress;
+ }
+
+ /**
+ * Sets the number of tasks belonging to the installer in the current mode.
+ *
+ * @param int $task_progress_count Number of tasks
+ */
+ public function set_task_progress_count($task_progress_count)
+ {
+ $this->progress_data['max_task_progress'] = $task_progress_count;
+ }
+
+ /**
+ * Returns the number of the current task being executed
+ *
+ * @return int
+ */
+ public function get_current_task_progress()
+ {
+ return $this->progress_data['current_task_progress'];
+ }
+
+ /**
+ * Returns the number of tasks belonging to the installer in the current mode.
+ *
+ * @return int
+ */
+ public function get_task_progress_count()
+ {
+ return $this->progress_data['max_task_progress'];
+ }
+
+ /**
+ * Marks stage as completed in the navigation bar
+ *
+ * @param array $nav_path Array to the navigation elem
+ */
+ public function set_finished_navigation_stage($nav_path)
+ {
+ $this->navigation_data['finished'][] = $nav_path;
+ }
+
+ /**
+ * Marks stage as active in the navigation bar
+ *
+ * @param array $nav_path Array to the navigation elem
+ */
+ public function set_active_navigation_stage($nav_path)
+ {
+ $this->navigation_data['active'] = $nav_path;
+ }
+
+ /**
+ * Returns navigation data
+ *
+ * @return array
+ */
+ public function get_navigation_data()
+ {
+ return $this->navigation_data;
+ }
+
+ /**
+ * Removes install config file
+ */
+ public function clean_up_config_file()
+ {
+ $this->do_clean_up = true;
+ @unlink($this->install_config_file);
+ }
+
+ /**
+ * Filling up system_data array
+ */
+ protected function setup_system_data()
+ {
+ // Query maximum runtime from php.ini
+ $execution_time = $this->php_ini->get_int('max_execution_time');
+ $execution_time = min(15, $execution_time / 2);
+ $this->system_data['max_execution_time'] = $execution_time;
+
+ // Set start time
+ $this->system_data['start_time'] = time();
+
+ // Get memory limit
+ $this->system_data['memory_limit'] = $this->php_ini->get_bytes('memory_limit');
+ }
+}
diff --git a/phpBB/phpbb/install/helper/container_factory.php b/phpBB/phpbb/install/helper/container_factory.php
new file mode 100644
index 0000000000..dc0eef6485
--- /dev/null
+++ b/phpBB/phpbb/install/helper/container_factory.php
@@ -0,0 +1,162 @@
+<?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\install\helper;
+
+use phpbb\cache\driver\dummy;
+use phpbb\install\exception\cannot_build_container_exception;
+
+class container_factory
+{
+ /**
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * @var \phpbb\request\request
+ */
+ protected $request;
+
+ /**
+ * The full phpBB container
+ *
+ * @var \Symfony\Component\DependencyInjection\ContainerInterface
+ */
+ protected $container;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\request\request $request Request interface
+ * @param string $phpbb_root_path Path to phpBB's root
+ * @param string $php_ext Extension of PHP files
+ */
+ public function __construct(\phpbb\request\request $request, $phpbb_root_path, $php_ext)
+ {
+ $this->request = $request;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ $this->container = null;
+ }
+
+ /**
+ * Container getter
+ *
+ * @param null|string $service_name Name of the service to return
+ *
+ * @return \Symfony\Component\DependencyInjection\ContainerInterface|Object phpBB's dependency injection container
+ * or the service specified in $service_name
+ *
+ * @throws \phpbb\install\exception\cannot_build_container_exception When container cannot be built
+ * @throws \Symfony\Component\DependencyInjection\Exception\InvalidArgumentException If the service is not defined
+ * @throws \Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException When a circular reference is detected
+ * @throws \Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException When the service is not defined
+ */
+ public function get($service_name = null)
+ {
+ // Check if container was built, if not try to build it
+ if ($this->container === null)
+ {
+ $this->build_container();
+ }
+
+ return ($service_name === null) ? $this->container : $this->container->get($service_name);
+ }
+
+ /**
+ * Returns the specified parameter from the container
+ *
+ * @param string $param_name
+ *
+ * @return mixed
+ *
+ * @throws \phpbb\install\exception\cannot_build_container_exception When container cannot be built
+ */
+ public function get_parameter($param_name)
+ {
+ // Check if container was built, if not try to build it
+ if ($this->container === null)
+ {
+ $this->build_container();
+ }
+
+ return $this->container->getParameter($param_name);
+ }
+
+ /**
+ * Build dependency injection container
+ *
+ * @throws \phpbb\install\exception\cannot_build_container_exception When container cannot be built
+ */
+ protected function build_container()
+ {
+ // If the container has been already built just return.
+ // Although this should never happen
+ if ($this->container instanceof \Symfony\Component\DependencyInjection\ContainerInterface)
+ {
+ return;
+ }
+
+ // Check whether container can be built
+ // We need config.php for that so let's check if it has been set up yet
+ if (!filesize($this->phpbb_root_path . 'config.' . $this->php_ext))
+ {
+ throw new cannot_build_container_exception();
+ }
+
+ $phpbb_config_php_file = new \phpbb\config_php_file($this->phpbb_root_path, $this->php_ext);
+ $phpbb_container_builder = new \phpbb\di\container_builder($this->phpbb_root_path, $this->php_ext);
+
+ // For BC with functions that we need during install
+ global $phpbb_container;
+
+ $disable_super_globals = $this->request->super_globals_disabled();
+
+ // This is needed because container_builder::get_env_parameters() uses $_SERVER
+ if ($disable_super_globals)
+ {
+ $this->request->enable_super_globals();
+ }
+
+ $this->container = $phpbb_container = $phpbb_container_builder
+ ->with_config($phpbb_config_php_file)
+ ->without_cache()
+ ->without_compiled_container()
+ ->get_container();
+
+ // Setting request is required for the compatibility globals as those are generated from
+ // this container
+ $this->container->register('request')->setSynthetic(true);
+ $this->container->set('request', $this->request);
+
+ // Replace cache service, as config gets cached, and we don't want that
+ $this->container->register('cache.driver')->setSynthetic(true);
+ $this->container->set('cache.driver', new dummy());
+ $this->container->compile();
+
+ // Restore super globals to previous state
+ if ($disable_super_globals)
+ {
+ $this->request->disable_super_globals();
+ }
+
+ // Get compatibilty globals
+ require ($this->phpbb_root_path . 'includes/compatibility_globals.' . $this->php_ext);
+ }
+}
diff --git a/phpBB/phpbb/install/helper/database.php b/phpBB/phpbb/install/helper/database.php
new file mode 100644
index 0000000000..627e9ea9b0
--- /dev/null
+++ b/phpBB/phpbb/install/helper/database.php
@@ -0,0 +1,456 @@
+<?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\install\helper;
+
+use phpbb\install\exception\invalid_dbms_exception;
+
+/**
+ * Database related general functionality for installer
+ */
+class database
+{
+ /**
+ * @var \phpbb\filesystem\filesystem_interface
+ */
+ protected $filesystem;
+
+ /**
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * @var array
+ */
+ protected $supported_dbms = array(
+ // Note: php 5.5 alpha 2 deprecated mysql.
+ // Keep mysqli before mysql in this list.
+ 'mysqli' => array(
+ 'LABEL' => 'MySQL with MySQLi Extension',
+ 'SCHEMA' => 'mysql_41',
+ 'MODULE' => 'mysqli',
+ 'DELIM' => ';',
+ 'DRIVER' => 'phpbb\db\driver\mysqli',
+ 'AVAILABLE' => true,
+ '2.0.x' => true,
+ ),
+ 'mysql' => array(
+ 'LABEL' => 'MySQL',
+ 'SCHEMA' => 'mysql',
+ 'MODULE' => 'mysql',
+ 'DELIM' => ';',
+ 'DRIVER' => 'phpbb\db\driver\mysql',
+ 'AVAILABLE' => true,
+ '2.0.x' => true,
+ ),
+ 'mssql' => array(
+ 'LABEL' => 'MS SQL Server 2000+',
+ 'SCHEMA' => 'mssql',
+ 'MODULE' => 'mssql',
+ 'DELIM' => 'GO',
+ 'DRIVER' => 'phpbb\db\driver\mssql',
+ 'AVAILABLE' => true,
+ '2.0.x' => true,
+ ),
+ 'mssql_odbc'=> array(
+ 'LABEL' => 'MS SQL Server [ ODBC ]',
+ 'SCHEMA' => 'mssql',
+ 'MODULE' => 'odbc',
+ 'DELIM' => 'GO',
+ 'DRIVER' => 'phpbb\db\driver\mssql_odbc',
+ 'AVAILABLE' => true,
+ '2.0.x' => true,
+ ),
+ 'mssqlnative' => array(
+ 'LABEL' => 'MS SQL Server 2005+ [ Native ]',
+ 'SCHEMA' => 'mssql',
+ 'MODULE' => 'sqlsrv',
+ 'DELIM' => 'GO',
+ 'DRIVER' => 'phpbb\db\driver\mssqlnative',
+ 'AVAILABLE' => true,
+ '2.0.x' => false,
+ ),
+ 'oracle' => array(
+ 'LABEL' => 'Oracle',
+ 'SCHEMA' => 'oracle',
+ 'MODULE' => 'oci8',
+ 'DELIM' => '/',
+ 'DRIVER' => 'phpbb\db\driver\oracle',
+ 'AVAILABLE' => true,
+ '2.0.x' => false,
+ ),
+ 'postgres' => array(
+ 'LABEL' => 'PostgreSQL 8.3+',
+ 'SCHEMA' => 'postgres',
+ 'MODULE' => 'pgsql',
+ 'DELIM' => ';',
+ 'DRIVER' => 'phpbb\db\driver\postgres',
+ 'AVAILABLE' => true,
+ '2.0.x' => true,
+ ),
+ 'sqlite' => array(
+ 'LABEL' => 'SQLite',
+ 'SCHEMA' => 'sqlite',
+ 'MODULE' => 'sqlite',
+ 'DELIM' => ';',
+ 'DRIVER' => 'phpbb\db\driver\sqlite',
+ 'AVAILABLE' => true,
+ '2.0.x' => false,
+ ),
+ 'sqlite3' => array(
+ 'LABEL' => 'SQLite3',
+ 'SCHEMA' => 'sqlite',
+ 'MODULE' => 'sqlite3',
+ 'DELIM' => ';',
+ 'DRIVER' => 'phpbb\db\driver\sqlite3',
+ 'AVAILABLE' => true,
+ '2.0.x' => false,
+ ),
+ );
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\filesystem\filesystem_interface $filesystem Filesystem interface
+ * @param string $phpbb_root_path Path to phpBB's root
+ */
+ public function __construct(\phpbb\filesystem\filesystem_interface $filesystem, $phpbb_root_path)
+ {
+ $this->filesystem = $filesystem;
+ $this->phpbb_root_path = $phpbb_root_path;
+ }
+
+ /**
+ * Returns an array of available DBMS supported by phpBB
+ *
+ * If a DBMS is specified it will only return data for that DBMS
+ * and will load its extension if necessary.
+ *
+ * @param mixed $dbms name of the DBMS that's info is required or false for all DBMS info
+ * @param bool $return_unavailable set it to true if you expect unavailable but supported DBMS
+ * returned as well
+ * @param bool $only_20x_options set it to true if you only want to recover 2.0.x options
+ *
+ * @return array Array of available and supported DBMS
+ */
+ public function get_available_dbms($dbms = false, $return_unavailable = false, $only_20x_options = false)
+ {
+ $available_dbms = $this->supported_dbms;
+
+ if ($dbms)
+ {
+ if (isset($this->supported_dbms[$dbms]))
+ {
+ $available_dbms = array($dbms => $this->supported_dbms[$dbms]);
+ }
+ else
+ {
+ return array();
+ }
+ }
+
+ $any_dbms_available = false;
+ foreach ($available_dbms as $db_name => $db_array)
+ {
+ if ($only_20x_options && !$db_array['2.0.x'])
+ {
+ if ($return_unavailable)
+ {
+ $available_dbms[$db_name]['AVAILABLE'] = false;
+ }
+ else
+ {
+ unset($available_dbms[$db_name]);
+ }
+
+ continue;
+ }
+
+ $dll = $db_array['MODULE'];
+ if (!@extension_loaded($dll))
+ {
+ if ($return_unavailable)
+ {
+ $available_dbms[$db_name]['AVAILABLE'] = false;
+ }
+ else
+ {
+ unset($available_dbms[$db_name]);
+ }
+
+ continue;
+ }
+
+ $any_dbms_available = true;
+ }
+
+ if ($return_unavailable)
+ {
+ $available_dbms['ANY_DB_SUPPORT'] = $any_dbms_available;
+ }
+
+ return $available_dbms;
+ }
+
+ /**
+ * Removes "/* style" as well as "# style" comments from $input.
+ *
+ * @param string $sql_query Input string
+ *
+ * @return string Input string with comments removed
+ */
+ public function remove_comments($sql_query)
+ {
+ // Remove /* */ comments (http://ostermiller.org/findcomment.html)
+ $sql_query = preg_replace('#/\*(.|[\r\n])*?\*/#', "\n", $sql_query);
+
+ // Remove # style comments
+ $sql_query = preg_replace('/\n{2,}/', "\n", preg_replace('/^#.*$/m', "\n", $sql_query));
+
+ return $sql_query;
+ }
+
+ /**
+ * split_sql_file() will split an uploaded sql file into single sql statements.
+ *
+ * Note: expects trim() to have already been run on $sql.
+ *
+ * @param string $sql SQL statements
+ * @param string $delimiter Delimiter between sql statements
+ *
+ * @return array Array of sql statements
+ */
+ public function split_sql_file($sql, $delimiter)
+ {
+ $sql = str_replace("\r" , '', $sql);
+ $data = preg_split('/' . preg_quote($delimiter, '/') . '$/m', $sql);
+
+ $data = array_map('trim', $data);
+
+ // The empty case
+ $end_data = end($data);
+
+ if (empty($end_data))
+ {
+ unset($data[key($data)]);
+ }
+
+ return $data;
+ }
+
+ /**
+ * Validates table prefix
+ *
+ * @param string $dbms The selected dbms
+ * @param string $table_prefix The table prefix to validate
+ *
+ * @return bool|array true if table prefix is valid, array of errors otherwise
+ *
+ * @throws \phpbb\install\exception\invalid_dbms_exception When $dbms is not a valid
+ */
+ public function validate_table_prefix($dbms, $table_prefix)
+ {
+ $errors = array();
+
+ if (!preg_match('#^[a-zA-Z][a-zA-Z0-9_]*$#', $table_prefix))
+ {
+ $errors[] = array(
+ 'title' => 'INST_ERR_DB_INVALID_PREFIX',
+ );
+ }
+
+ // Do dbms specific checks
+ $dbms_info = $this->get_available_dbms($dbms);
+ switch ($dbms_info[$dbms]['SCHEMA'])
+ {
+ case 'mysql':
+ case 'mysql_41':
+ $prefix_length = 36;
+ break;
+ case 'mssql':
+ $prefix_length = 90;
+ break;
+ case 'oracle':
+ $prefix_length = 6;
+ break;
+ case 'postgres':
+ $prefix_length = 36;
+ break;
+ case 'sqlite':
+ $prefix_length = 200;
+ break;
+ default:
+ throw new invalid_dbms_exception();
+ break;
+ }
+
+ // Check the prefix length to ensure that index names are not too long
+ if (strlen($table_prefix) > $prefix_length)
+ {
+ $errors[] = array(
+ 'title' => array('INST_ERR_PREFIX_TOO_LONG', $prefix_length),
+ );
+ }
+
+ return (empty($errors)) ? true : $errors;
+ }
+
+ /**
+ * Check if the user provided database parameters are correct
+ *
+ * This function checks the database connection data and also checks for
+ * any other problems that could cause an error during the installation
+ * such as if there is any database table names conflicting.
+ *
+ * Note: The function assumes that $table_prefix has been already validated
+ * with validate_table_prefix().
+ *
+ * @param string $dbms Selected database type
+ * @param string $dbhost Database host address
+ * @param int $dbport Database port number
+ * @param string $dbuser Database username
+ * @param string $dbpass Database password
+ * @param string $dbname Database name
+ * @param string $table_prefix Database table prefix
+ *
+ * @return array|bool Returns true if test is successful, array of errors otherwise
+ */
+ public function check_database_connection($dbms, $dbhost, $dbport, $dbuser, $dbpass, $dbname, $table_prefix)
+ {
+ $dbms_info = $this->get_available_dbms($dbms);
+ $dbms_info = $dbms_info[$dbms];
+ $errors = array();
+
+ // Instantiate it and set return on error true
+ /** @var \phpbb\db\driver\driver_interface $db */
+ $db = new $dbms_info['DRIVER'];
+ $db->sql_return_on_error(true);
+
+ // Check that we actually have a database name before going any further
+ if (!in_array($dbms_info['SCHEMA'], array('sqlite', 'oracle')) && $dbname === '')
+ {
+ $errors[] = array(
+ 'title' => 'INST_ERR_DB_NO_NAME',
+ );
+ }
+
+ // Make sure we don't have a daft user who thinks having the SQLite database in the forum directory is a good idea
+ if ($dbms_info['SCHEMA'] === 'sqlite'
+ && stripos($this->filesystem->realpath($dbhost), $this->filesystem->realpath($this->phpbb_root_path) === 0))
+ {
+ $errors[] = array(
+ 'title' =>'INST_ERR_DB_FORUM_PATH',
+ );
+ }
+
+ // Try to connect to db
+ if (is_array($db->sql_connect($dbhost, $dbuser, $dbpass, $dbname, $dbport, false, true)))
+ {
+ $db_error = $db->sql_error();
+ $errors[] = array(
+ 'title' => 'INST_ERR_DB_CONNECT',
+ 'description' => ($db_error['message']) ? utf8_convert_message($db_error['message']) : 'INST_ERR_DB_NO_ERROR',
+ );
+ }
+ else
+ {
+ // Check if there is any table name collisions
+ $temp_prefix = strtolower($table_prefix);
+ $table_ary = array(
+ $temp_prefix . 'attachments',
+ $temp_prefix . 'config',
+ $temp_prefix . 'sessions',
+ $temp_prefix . 'topics',
+ $temp_prefix . 'users',
+ );
+
+ $db_tools_factory = new \phpbb\db\tools\factory();
+ $db_tools = $db_tools_factory->get($db);
+ $tables = $db_tools->sql_list_tables();
+ $tables = array_map('strtolower', $tables);
+ $table_intersect = array_intersect($tables, $table_ary);
+
+ if (sizeof($table_intersect))
+ {
+ $errors[] = array(
+ 'title' => 'INST_ERR_PREFIX',
+ );
+ }
+
+ // Check if database version is supported
+ switch ($dbms)
+ {
+ case 'mysqli':
+ if (version_compare($db->sql_server_info(true), '4.1.3', '<'))
+ {
+ $errors[] = array(
+ 'title' => 'INST_ERR_DB_NO_MYSQLI',
+ );
+ }
+ break;
+ case 'sqlite':
+ if (version_compare($db->sql_server_info(true), '2.8.2', '<'))
+ {
+ $errors[] = array(
+ 'title' => 'INST_ERR_DB_NO_SQLITE',
+ );
+ }
+ break;
+ case 'sqlite3':
+ if (version_compare($db->sql_server_info(true), '3.6.15', '<'))
+ {
+ $errors[] = array(
+ 'title' => 'INST_ERR_DB_NO_SQLITE3',
+ );
+ }
+ break;
+ case 'oracle':
+ $sql = "SELECT *
+ FROM NLS_DATABASE_PARAMETERS
+ WHERE PARAMETER = 'NLS_RDBMS_VERSION'
+ OR PARAMETER = 'NLS_CHARACTERSET'";
+ $result = $db->sql_query($sql);
+
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $stats[$row['parameter']] = $row['value'];
+ }
+ $db->sql_freeresult($result);
+
+ if (version_compare($stats['NLS_RDBMS_VERSION'], '9.2', '<') && $stats['NLS_CHARACTERSET'] !== 'UTF8')
+ {
+ $errors[] = array(
+ 'title' => 'INST_ERR_DB_NO_ORACLE',
+ );
+ }
+ break;
+ case 'postgres':
+ $sql = "SHOW server_encoding;";
+ $result = $db->sql_query($sql);
+ $row = $db->sql_fetchrow($result);
+ $db->sql_freeresult($result);
+
+ if ($row['server_encoding'] !== 'UNICODE' && $row['server_encoding'] !== 'UTF8')
+ {
+ $errors[] = array(
+ 'title' => 'INST_ERR_DB_NO_POSTGRES',
+ );
+ }
+ break;
+ }
+ }
+
+ return (empty($errors)) ? true : $errors;
+ }
+}
diff --git a/phpBB/phpbb/install/helper/install_helper.php b/phpBB/phpbb/install/helper/install_helper.php
new file mode 100644
index 0000000000..ffe36cd645
--- /dev/null
+++ b/phpBB/phpbb/install/helper/install_helper.php
@@ -0,0 +1,60 @@
+<?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\install\helper;
+
+/**
+ * General helper functionality for the installer
+ */
+class install_helper
+{
+ /**
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * Constructor
+ *
+ * @param string $phpbb_root_path path to phpBB's root
+ * @param string $php_ext Extension of PHP files
+ */
+ public function __construct($phpbb_root_path, $php_ext)
+ {
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ }
+
+ /**
+ * Check whether phpBB is installed.
+ *
+ * @return bool
+ */
+ public function is_phpbb_installed()
+ {
+ $config_path = $this->phpbb_root_path . 'config.' . $this->php_ext;
+ $install_lock_path = $this->phpbb_root_path . 'cache/install_lock';
+
+ if (file_exists($config_path) && !file_exists($install_lock_path) && filesize($config_path))
+ {
+ return true;
+ }
+
+ return false;
+ }
+}
diff --git a/phpBB/phpbb/install/helper/iohandler/ajax_iohandler.php b/phpBB/phpbb/install/helper/iohandler/ajax_iohandler.php
new file mode 100644
index 0000000000..fa628f3365
--- /dev/null
+++ b/phpBB/phpbb/install/helper/iohandler/ajax_iohandler.php
@@ -0,0 +1,293 @@
+<?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\install\helper\iohandler;
+
+/**
+ * Input-Output handler for the AJAX frontend
+ */
+class ajax_iohandler extends iohandler_base
+{
+ /**
+ * @var \phpbb\request\request_interface
+ */
+ protected $request;
+
+ /**
+ * @var \phpbb\template\template
+ */
+ protected $template;
+
+ /**
+ * @var string
+ */
+ protected $form;
+
+ /**
+ * @var bool
+ */
+ protected $request_client_refresh;
+
+ /**
+ * @var array
+ */
+ protected $nav_data;
+
+ /**
+ * @var array
+ */
+ protected $cookies;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\request\request_interface $request HTTP request interface
+ * @param \phpbb\template\template $template Template engine
+ */
+ public function __construct(\phpbb\request\request_interface $request, \phpbb\template\template $template)
+ {
+ $this->request = $request;
+ $this->template = $template;
+ $this->form = '';
+ $this->nav_data = array();
+ $this->cookies = array();
+
+ parent::__construct();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_input($name, $default, $multibyte = false)
+ {
+ return $this->request->variable($name, $default, $multibyte);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_server_variable($name, $default = '')
+ {
+ return $this->request->server($name, $default);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_header_variable($name, $default = '')
+ {
+ return $this->request->header($name, $default);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_secure()
+ {
+ return $this->request->is_secure();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function add_user_form_group($title, $form)
+ {
+ $this->template->assign_var('S_FORM_ELEM_COUNT', sizeof($form));
+
+ $this->template->assign_block_vars('options', array(
+ 'LEGEND' => $this->language->lang($title),
+ 'S_LEGEND' => true,
+ ));
+
+ foreach ($form as $input_name => $input_options)
+ {
+ if (!isset($input_options['type']))
+ {
+ continue;
+ }
+
+ $tpl_ary = array();
+
+ $tpl_ary['TYPE'] = $input_options['type'];
+ $tpl_ary['TITLE'] = $this->language->lang($input_options['label']);
+ $tpl_ary['KEY'] = $input_name;
+ $tpl_ary['S_EXPLAIN'] = false;
+
+ if (isset($input_options['default']))
+ {
+ $default = $input_options['default'];
+ $default = preg_replace_callback('#\{L_([A-Z0-9\-_]*)\}#s', array($this, 'lang_replace_callback'), $default);
+ $tpl_ary['DEFAULT'] = $default;
+ }
+
+ if (isset($input_options['description']))
+ {
+ $tpl_ary['TITLE_EXPLAIN'] = $this->language->lang($input_options['description']);
+ $tpl_ary['S_EXPLAIN'] = true;
+ }
+
+ if (in_array($input_options['type'], array('select', 'radio')))
+ {
+ for ($i = 0, $total = sizeof($input_options['options']); $i < $total; $i++)
+ {
+ if (isset($input_options['options'][$i]['label']))
+ {
+ $input_options['options'][$i]['label'] = $this->language->lang($input_options['options'][$i]['label']);
+ }
+ }
+
+ $tpl_ary['OPTIONS'] = $input_options['options'];
+ }
+
+ $this->template->assign_block_vars('options', $tpl_ary);
+ }
+
+ $this->template->set_filenames(array(
+ 'form_install' => 'installer_form.html',
+ ));
+
+ $this->form = $this->template->assign_display('form_install');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function send_response()
+ {
+ $json_data_array = $this->prepare_json_array();
+ $json_data = json_encode($json_data_array);
+
+ // Try to push content to the browser
+ print(str_pad(' ', 4096) . "\n");
+ print($json_data . "\n\n");
+ flush();
+ }
+
+ /**
+ * Prepares iohandler's data to be sent out to the client.
+ *
+ * @return array
+ */
+ protected function prepare_json_array()
+ {
+ $json_array = array(
+ 'errors' => $this->errors,
+ 'warnings' => $this->warnings,
+ 'logs' => $this->logs,
+ 'success' => $this->success,
+ );
+
+ if (!empty($this->form))
+ {
+ $json_array['form'] = $this->form;
+ $this->form = '';
+ }
+
+ // If current task name is set, we push progress message to the client side
+ if (!empty($this->current_task_name))
+ {
+ $json_array['progress'] = array(
+ 'task_name' => $this->current_task_name,
+ 'task_num' => $this->current_task_progress,
+ 'task_count' => $this->task_progress_count,
+ );
+ }
+
+ if (!empty($this->nav_data))
+ {
+ $json_array['nav'] = $this->nav_data;
+ }
+
+ $this->errors = array();
+ $this->warnings = array();
+ $this->logs = array();
+ $this->success = array();
+ $this->nav_data = array();
+
+ if ($this->request_client_refresh)
+ {
+ $json_array['refresh'] = true;
+ $this->request_client_refresh = false;
+ }
+
+ if (!empty($this->cookies))
+ {
+ $json_array['cookies'] = $this->cookies;
+ $this->cookies = array();
+ }
+
+ return $json_array;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set_progress($task_lang_key, $task_number)
+ {
+ parent::set_progress($task_lang_key, $task_number);
+ $this->send_response();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function request_refresh()
+ {
+ $this->request_client_refresh = true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set_active_stage_menu($menu_path)
+ {
+ $this->nav_data['active'] = $menu_path[sizeof($menu_path) - 1];
+ $this->send_response();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set_finished_stage_menu($menu_path)
+ {
+ $this->nav_data['finished'][] = $menu_path[sizeof($menu_path) - 1];
+ $this->send_response();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set_cookie($cookie_name, $cookie_value)
+ {
+ $this->cookies[] = array(
+ 'name' => $cookie_name,
+ 'value' => $cookie_value
+ );
+ }
+
+ /**
+ * Callback function for language replacing
+ *
+ * @param array $matches
+ * @return string
+ */
+ public function lang_replace_callback($matches)
+ {
+ if (!empty($matches[1]))
+ {
+ return $this->language->lang($matches[1]);
+ }
+
+ return '';
+ }
+}
diff --git a/phpBB/phpbb/install/helper/iohandler/cli_iohandler.php b/phpBB/phpbb/install/helper/iohandler/cli_iohandler.php
new file mode 100644
index 0000000000..c5b2bb06bc
--- /dev/null
+++ b/phpBB/phpbb/install/helper/iohandler/cli_iohandler.php
@@ -0,0 +1,265 @@
+<?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\install\helper\iohandler;
+
+use phpbb\install\exception\installer_exception;
+use Symfony\Component\Console\Output\OutputInterface;
+use Symfony\Component\Console\Style\OutputStyle;
+
+/**
+ * Input-Output handler for the CLI frontend
+ */
+class cli_iohandler extends iohandler_base
+{
+ /**
+ * @var OutputInterface
+ */
+ protected $output;
+
+ /**
+ * @var OutputStyle
+ */
+ protected $io;
+
+ /**
+ * @var array
+ */
+ protected $input_values = array();
+
+ /**
+ * @var \Symfony\Component\Console\Helper\ProgressBar
+ */
+ protected $progress_bar;
+
+ /**
+ * Set the style and output used to display feedback;
+ *
+ * @param OutputStyle $style
+ * @param OutputInterface $output
+ */
+ public function set_style(OutputStyle $style, OutputInterface $output)
+ {
+ $this->io = $style;
+ $this->output = $output;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_input($name, $default, $multibyte = false)
+ {
+ $result = $default;
+
+ if (isset($this->input_values[$name]))
+ {
+ $result = $this->input_values[$name];
+ }
+
+ if ($multibyte)
+ {
+ return utf8_normalize_nfc($result);
+ }
+
+ return $result;
+ }
+
+ public function set_input($name, $value)
+ {
+ $this->input_values[$name] = $value;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_server_variable($name, $default = '')
+ {
+ return $default;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_header_variable($name, $default = '')
+ {
+ return $default;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_secure()
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function add_user_form_group($title, $form)
+ {
+ throw new installer_exception('MISSING_DATA');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function send_response()
+ {
+ }
+
+ /**
+ * {@inheritdoc
+ */
+ public function add_error_message($error_title, $error_description = false)
+ {
+ $this->io->newLine();
+
+ $message = $this->translate_message($error_title, $error_description);
+ $this->io->error($message['title'] . "\n" . $message['description']);
+
+ if ($this->progress_bar !== null)
+ {
+ $this->io->newLine(2);
+ $this->progress_bar->display();
+ }
+ }
+
+ /**
+ * {@inheritdoc
+ */
+ public function add_warning_message($warning_title, $warning_description = false)
+ {
+ $this->io->newLine();
+
+ $message = $this->translate_message($warning_title, $warning_description);
+ $this->io->warning($message['title'] . "\n" . $message['description']);
+
+ if ($this->progress_bar !== null)
+ {
+ $this->io->newLine(2);
+ $this->progress_bar->display();
+ }
+ }
+
+ /**
+ * {@inheritdoc
+ */
+ public function add_log_message($log_title, $log_description = false)
+ {
+ if ($this->output->getVerbosity() > OutputInterface::VERBOSITY_NORMAL)
+ {
+ $message = $this->translate_message($log_title, $log_description);
+ $this->output->writeln(sprintf('[%3d/%-3d] ---- %s', $this->current_task_progress, $this->task_progress_count, $message['title']));
+ }
+ }
+
+ /**
+ * {@inheritdoc
+ */
+ public function add_success_message($error_title, $error_description = false)
+ {
+ $this->io->newLine();
+
+ $message = $this->translate_message($error_title, $error_description);
+ $this->io->success($message['title'] . "\n" . $message['description']);
+
+ if ($this->progress_bar !== null)
+ {
+ $this->io->newLine(2);
+ $this->progress_bar->display();
+ }
+ }
+
+ public function set_task_count($task_count)
+ {
+ parent::set_task_count($task_count);
+
+ if ($this->output->getVerbosity() === OutputInterface::VERBOSITY_NORMAL)
+ {
+ $this->progress_bar = $this->io->createProgressBar($task_count);
+ $this->progress_bar->setFormat(
+ " %current:3s%/%max:-3s% %bar% %percent:3s%%\n" .
+ " %message%\n");
+ $this->progress_bar->setBarWidth(60);
+
+ if (!defined('PHP_WINDOWS_VERSION_BUILD'))
+ {
+ $this->progress_bar->setEmptyBarCharacter('â–‘'); // light shade character \u2591
+ $this->progress_bar->setProgressCharacter('');
+ $this->progress_bar->setBarCharacter('â–“'); // dark shade character \u2593
+ }
+
+ $this->progress_bar->setMessage('');
+ $this->io->newLine(2);
+ $this->progress_bar->start();
+ }
+ }
+
+ public function set_progress($task_lang_key, $task_number)
+ {
+ parent::set_progress($task_lang_key, $task_number);
+
+ if ($this->progress_bar !== null)
+ {
+ $this->progress_bar->setProgress($this->current_task_progress);
+ $this->progress_bar->setMessage($this->current_task_name);
+ }
+ else
+ {
+ $this->output->writeln(sprintf('[%3d/%-3d] %s', $this->current_task_progress, $this->task_progress_count, $this->current_task_name));
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function finish_progress($message_lang_key)
+ {
+ parent::finish_progress($message_lang_key);
+
+ if ($this->progress_bar !== null)
+ {
+ $this->progress_bar->finish();
+ $this->progress_bar = null;
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function request_refresh()
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set_active_stage_menu($menu_path)
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set_finished_stage_menu($menu_path)
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set_cookie($cookie_name, $cookie_value)
+ {
+ }
+}
diff --git a/phpBB/phpbb/install/helper/iohandler/exception/iohandler_not_implemented_exception.php b/phpBB/phpbb/install/helper/iohandler/exception/iohandler_not_implemented_exception.php
new file mode 100644
index 0000000000..f2ddeda6f7
--- /dev/null
+++ b/phpBB/phpbb/install/helper/iohandler/exception/iohandler_not_implemented_exception.php
@@ -0,0 +1,19 @@
+<?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\install\helper\iohandler\exception;
+
+class iohandler_not_implemented_exception extends \Exception
+{
+
+}
diff --git a/phpBB/phpbb/install/helper/iohandler/factory.php b/phpBB/phpbb/install/helper/iohandler/factory.php
new file mode 100644
index 0000000000..52d24e49b2
--- /dev/null
+++ b/phpBB/phpbb/install/helper/iohandler/factory.php
@@ -0,0 +1,81 @@
+<?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\install\helper\iohandler;
+
+use phpbb\install\helper\iohandler\exception\iohandler_not_implemented_exception;
+
+/**
+ * Input-output handler factory
+ */
+class factory
+{
+ /**
+ * @var \Symfony\Component\DependencyInjection\ContainerInterface
+ */
+ protected $container;
+
+ /**
+ * @var string
+ */
+ protected $environment;
+
+ /**
+ * Constructor
+ *
+ * @param \Symfony\Component\DependencyInjection\ContainerInterface $container Dependency injection container
+ */
+ public function __construct(\Symfony\Component\DependencyInjection\ContainerInterface $container)
+ {
+ $this->container = $container;
+ $this->environment = null;
+ }
+
+ /**
+ * @param string $environment The name of the input-output handler to use
+ */
+ public function set_environment($environment)
+ {
+ $this->environment = $environment;
+ }
+
+ /**
+ * Factory getter for iohandler
+ *
+ * @return \phpbb\install\helper\iohandler\iohandler_interface
+ *
+ * @throws \phpbb\install\helper\iohandler\exception\iohandler_not_implemented_exception
+ * When the specified iohandler_interface does not exists
+ */
+ public function get()
+ {
+ switch ($this->environment)
+ {
+ case 'ajax':
+ return $this->container->get('installer.helper.iohandler_ajax');
+ break;
+ case 'nojs':
+ // @todo replace this
+ return $this->container->get('installer.helper.iohandler_ajax');
+ break;
+ case 'cli':
+ return $this->container->get('installer.helper.iohandler_cli');
+ break;
+ default:
+ throw new iohandler_not_implemented_exception();
+ break;
+ }
+
+ throw new iohandler_not_implemented_exception();
+ }
+}
diff --git a/phpBB/phpbb/install/helper/iohandler/iohandler_base.php b/phpBB/phpbb/install/helper/iohandler/iohandler_base.php
new file mode 100644
index 0000000000..006411f1e3
--- /dev/null
+++ b/phpBB/phpbb/install/helper/iohandler/iohandler_base.php
@@ -0,0 +1,190 @@
+<?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\install\helper\iohandler;
+
+/**
+ * Base class for installer input-output handlers
+ */
+abstract class iohandler_base implements iohandler_interface
+{
+ /**
+ * Array of errors
+ *
+ * Errors should be added, when the installation cannot continue without
+ * user interaction. If the aim is to notify the user about something, please
+ * use a warning instead.
+ *
+ * @var array
+ */
+ protected $errors;
+
+ /**
+ * Array of warnings
+ *
+ * @var array
+ */
+ protected $warnings;
+
+ /**
+ * Array of logs
+ *
+ * @var array
+ */
+ protected $logs;
+
+ /**
+ * Array of success messages
+ *
+ * @var array
+ */
+ protected $success;
+
+ /**
+ * @var \phpbb\language\language
+ */
+ protected $language;
+
+ /**
+ * @var int
+ */
+ protected $task_progress_count;
+
+ /**
+ * @var int
+ */
+ protected $current_task_progress;
+
+ /**
+ * @var string
+ */
+ protected $current_task_name;
+
+ /**
+ * Constructor
+ */
+ public function __construct()
+ {
+ $this->errors = array();
+ $this->warnings = array();
+ $this->logs = array();
+ $this->success = array();
+
+ $this->task_progress_count = 0;
+ $this->current_task_progress = 0;
+ $this->current_task_name = '';
+ }
+
+ /**
+ * Set language service
+ *
+ * @param \phpbb\language\language $language
+ */
+ public function set_language(\phpbb\language\language $language)
+ {
+ $this->language = $language;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function add_error_message($error_title, $error_description = false)
+ {
+ $this->errors[] = $this->translate_message($error_title, $error_description);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function add_warning_message($warning_title, $warning_description = false)
+ {
+ $this->warnings[] = $this->translate_message($warning_title, $warning_description);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function add_log_message($log_title, $log_description = false)
+ {
+ $this->logs[] = $this->translate_message($log_title, $log_description);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function add_success_message($success_title, $success_description = false)
+ {
+ $this->success[] = $this->translate_message($success_title, $success_description);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set_task_count($task_count)
+ {
+ $this->task_progress_count = $task_count;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set_progress($task_lang_key, $task_number)
+ {
+ $this->current_task_name = '';
+
+ if (!empty($task_lang_key))
+ {
+ $this->current_task_name = $this->language->lang($task_lang_key);
+ }
+
+ $this->current_task_progress = $task_number;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function finish_progress($message_lang_key)
+ {
+ if (!empty($message_lang_key))
+ {
+ $this->current_task_name = $this->language->lang($message_lang_key);
+ }
+
+ $this->current_task_progress = $this->task_progress_count;
+ }
+
+ /**
+ * Localize message.
+ *
+ * Note: When an array is passed into the parameters below, it will be
+ * resolved as printf($param[0], $param[1], ...).
+ *
+ * @param array|string $title Title of the message
+ * @param array|string|bool $description Description of the message
+ *
+ * @return array Localized message in an array
+ */
+ protected function translate_message($title, $description)
+ {
+ $message_array = array();
+
+ $message_array['title'] = call_user_func_array(array($this->language, 'lang'), (array) $title);
+
+ if ($description !== false)
+ {
+ $message_array['description'] = call_user_func_array(array($this->language, 'lang'), (array) $description);
+ }
+
+ return $message_array;
+ }
+}
diff --git a/phpBB/phpbb/install/helper/iohandler/iohandler_interface.php b/phpBB/phpbb/install/helper/iohandler/iohandler_interface.php
new file mode 100644
index 0000000000..5f5f8499d6
--- /dev/null
+++ b/phpBB/phpbb/install/helper/iohandler/iohandler_interface.php
@@ -0,0 +1,174 @@
+<?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\install\helper\iohandler;
+
+/**
+ * Input-Output handler interface for the installer
+ */
+interface iohandler_interface
+{
+ /**
+ * Renders or returns response message
+ */
+ public function send_response();
+
+ /**
+ * Returns input variable
+ *
+ * @param string $name Name of the input variable to obtain
+ * @param mixed $default A default value that is returned if the variable was not set.
+ * This function will always return a value of the same type as the default.
+ * @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters
+ * Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
+ *
+ * @return mixed Value of the input variable
+ */
+ public function get_input($name, $default, $multibyte = false);
+
+ /**
+ * Returns server variable
+ *
+ * This function should work the same as request_interterface::server().
+ *
+ * @param string $name Name of the server variable
+ * @param mixed $default Default value to return when the requested variable does not exist
+ *
+ * @return mixed Value of the server variable
+ */
+ public function get_server_variable($name, $default = '');
+
+ /**
+ * Wrapper function for request_interterface::header()
+ *
+ * @param string $name Name of the request header variable
+ * @param mixed $default Default value to return when the requested variable does not exist
+ *
+ * @return mixed
+ */
+ public function get_header_variable($name, $default = '');
+
+ /**
+ * Returns true if the connection is encrypted
+ *
+ * @return bool
+ */
+ public function is_secure();
+
+ /**
+ * Adds an error message to the rendering queue
+ *
+ * Note: When an array is passed into the parameters below, it will be
+ * resolved as printf($param[0], $param[1], ...).
+ *
+ * @param string|array $error_title Title of the error message.
+ * @param string|bool|array $error_description Description of the error (and possibly guidelines to resolve it),
+ * or false if the error description is not available.
+ */
+ public function add_error_message($error_title, $error_description = false);
+
+ /**
+ * Adds a warning message to the rendering queue
+ *
+ * Note: When an array is passed into the parameters below, it will be
+ * resolved as printf($param[0], $param[1], ...).
+ *
+ * @param string|array $warning_title Title of the warning message
+ * @param string|bool|array $warning_description Description of the warning (and possibly guidelines to resolve it),
+ * or false if the warning description is not available
+ */
+ public function add_warning_message($warning_title, $warning_description = false);
+
+ /**
+ * Adds a log message to the rendering queue
+ *
+ * Note: When an array is passed into the parameters below, it will be
+ * resolved as printf($param[0], $param[1], ...).
+ *
+ * @param string|array $log_title Title of the log message
+ * @param string|bool|array $log_description Description of the log,
+ * or false if the log description is not available
+ */
+ public function add_log_message($log_title, $log_description = false);
+
+ /**
+ * Adds a success message to the rendering queue
+ *
+ * Note: When an array is passed into the parameters below, it will be
+ * resolved as printf($param[0], $param[1], ...).
+ *
+ * @param string|array $success_title Title of the success message
+ * @param string|bool|array $success_description Description of the success,
+ * or false if the success description is not available
+ *
+ * @return null
+ */
+ public function add_success_message($success_title, $success_description = false);
+
+ /**
+ * Adds a requested data group to the rendering queue
+ *
+ * @param string $title Language variable with the title of the form
+ * @param array $form An array describing the required data (options etc)
+ */
+ public function add_user_form_group($title, $form);
+
+ /**
+ * Sets the number of tasks belonging to the installer in the current mode.
+ *
+ * @param int $task_count Number of tasks
+ */
+ public function set_task_count($task_count);
+
+ /**
+ * Sets the progress information
+ *
+ * @param string $task_lang_key Language key for the name of the task
+ * @param int $task_number Position of the current task in the task queue
+ */
+ public function set_progress($task_lang_key, $task_number);
+
+ /**
+ * Sends refresh request to the client
+ */
+ public function request_refresh();
+
+ /**
+ * Marks stage as active in the navigation bar
+ *
+ * @param array $menu_path Array to the navigation elem
+ */
+ public function set_active_stage_menu($menu_path);
+
+ /**
+ * Marks stage as completed in the navigation bar
+ *
+ * @param array $menu_path Array to the navigation elem
+ */
+ public function set_finished_stage_menu($menu_path);
+
+ /**
+ * Finish the progress bar
+ *
+ * @param string $message_lang_key Language key for the message
+ */
+ public function finish_progress($message_lang_key);
+
+ /**
+ * Sends and sets cookies
+ *
+ * @param string $cookie_name Name of the cookie to set
+ * @param string $cookie_value Value of the cookie to set
+ */
+ public function set_cookie($cookie_name, $cookie_value);
+}
diff --git a/phpBB/phpbb/install/helper/navigation/install_navigation.php b/phpBB/phpbb/install/helper/navigation/install_navigation.php
new file mode 100644
index 0000000000..f690f8de76
--- /dev/null
+++ b/phpBB/phpbb/install/helper/navigation/install_navigation.php
@@ -0,0 +1,75 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+namespace phpbb\install\helper\navigation;
+
+use phpbb\install\helper\install_helper;
+
+class install_navigation implements navigation_interface
+{
+ /**
+ * @var install_helper
+ */
+ private $install_helper;
+
+ /**
+ * Constructor
+ *
+ * @param install_helper $install_helper
+ */
+ public function __construct(install_helper $install_helper)
+ {
+ $this->install_helper = $install_helper;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get()
+ {
+ if ($this->install_helper->is_phpbb_installed())
+ {
+ return array();
+ }
+
+ return array(
+ 'install' => array(
+ 'label' => 'INSTALL',
+ 'route' => 'phpbb_installer_install',
+ 'order' => 1,
+ array(
+ 'introduction' => array(
+ 'label' => 'INTRODUCTION_TITLE',
+ 'stage' => true,
+ 'order' => 0,
+ ),
+ 'requirements' => array(
+ 'label' => 'STAGE_REQUIREMENTS',
+ 'stage' => true,
+ 'order' => 1,
+ ),
+ 'obtain_data' => array(
+ 'label' => 'STAGE_OBTAIN_DATA',
+ 'stage' => true,
+ 'order' => 2,
+ ),
+ 'install' => array(
+ 'label' => 'STAGE_INSTALL',
+ 'stage' => true,
+ 'order' => 3,
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/install/helper/navigation/main_navigation.php b/phpBB/phpbb/install/helper/navigation/main_navigation.php
new file mode 100644
index 0000000000..214bb04963
--- /dev/null
+++ b/phpBB/phpbb/install/helper/navigation/main_navigation.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\install\helper\navigation;
+
+class main_navigation implements navigation_interface
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function get()
+ {
+ return array(
+ 'overview' => array(
+ 'label' => 'MENU_OVERVIEW',
+ 'route' => 'phpbb_installer_index',
+ 'order' => 0,
+ array(
+ 'introduction' => array(
+ 'label' => 'MENU_INTRO',
+ 'route' => 'phpbb_installer_index',
+ 'order' => 0,
+ ),
+ 'support' => array(
+ 'label' => 'MENU_SUPPORT',
+ 'route' => 'phpbb_installer_support',
+ 'order' => 1,
+ ),
+ 'license' => array(
+ 'label' => 'MENU_LICENSE',
+ 'route' => 'phpbb_installer_license',
+ 'order' => 2,
+ ),
+ ),
+ ),
+ );
+ }
+}
diff --git a/phpBB/phpbb/install/helper/navigation/navigation_interface.php b/phpBB/phpbb/install/helper/navigation/navigation_interface.php
new file mode 100644
index 0000000000..eebdbe923f
--- /dev/null
+++ b/phpBB/phpbb/install/helper/navigation/navigation_interface.php
@@ -0,0 +1,43 @@
+<?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\install\helper\navigation;
+
+/**
+ * Interface for installer's navigation defining services
+ */
+interface navigation_interface
+{
+ /**
+ * Returns an array with the navigation items
+ *
+ * The returned array should have the following format:
+ * <code>
+ * array(
+ * 'parent_nav_name' => array(
+ * 'nav_name' => array(
+ * 'label' => 'MY_MENU',
+ * 'route' => 'phpbb_route_name',
+ * )
+ * )
+ * )
+ * </code>
+ *
+ * Navigation item setting options:
+ * - label: The language variable name
+ * - route: Name of the route which it is belongs to
+ *
+ * @return array
+ */
+ public function get();
+}
diff --git a/phpBB/phpbb/install/helper/navigation/navigation_provider.php b/phpBB/phpbb/install/helper/navigation/navigation_provider.php
new file mode 100644
index 0000000000..d52aec8999
--- /dev/null
+++ b/phpBB/phpbb/install/helper/navigation/navigation_provider.php
@@ -0,0 +1,121 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+namespace phpbb\install\helper\navigation;
+
+use phpbb\di\service_collection;
+
+/**
+ * Installers navigation provider
+ */
+class navigation_provider
+{
+ /**
+ * @var array
+ */
+ private $menu_collection;
+
+ /**
+ * Constructor
+ *
+ * @param service_collection $plugins
+ */
+ public function __construct(service_collection $plugins)
+ {
+ $this->menu_collection = array();
+
+ foreach ($plugins as $plugin => $plugin_instance)
+ {
+ $this->register($plugin_instance);
+ }
+ }
+
+ /**
+ * Returns navigation array
+ *
+ * @return array
+ */
+ public function get()
+ {
+ return $this->menu_collection;
+ }
+
+ /**
+ * Registers a navigation provider's navigation items
+ *
+ * @param navigation_interface $navigation
+ */
+ public function register(navigation_interface $navigation)
+ {
+ $nav_arry = $navigation->get();
+ $this->menu_collection = $this->merge($nav_arry, $this->menu_collection);
+ }
+
+ /**
+ * Set a property in the navigation array
+ *
+ * @param array $nav_element Array to the navigation elem
+ * @param array $property_array Array with the properties to set
+ */
+ public function set_nav_property($nav_element, $property_array)
+ {
+ $array_pointer = array();
+ $array_root_pointer = &$array_pointer;
+ foreach ($nav_element as $array_path)
+ {
+ $array_pointer[$array_path] = array();
+ $array_pointer = &$array_pointer[$array_path];
+ }
+
+ $array_pointer = $property_array;
+
+ $this->menu_collection = $this->merge($array_root_pointer, $this->menu_collection);
+ }
+
+ /**
+ * Recursive array merge
+ *
+ * This function is necessary to be able to replace the options of
+ * already set navigation items.
+ *
+ * @param array $array_to_merge
+ * @param array $array_to_merge_into
+ *
+ * @return array Merged array
+ */
+ private function merge($array_to_merge, $array_to_merge_into)
+ {
+ $merged_array = $array_to_merge_into;
+
+ foreach ($array_to_merge as $key => $value)
+ {
+ if (isset($array_to_merge_into[$key]))
+ {
+ if (is_array($array_to_merge_into[$key]) && is_array($value))
+ {
+ $merged_array[$key] = $this->merge($value, $array_to_merge_into[$key]);
+ }
+ else
+ {
+ $merged_array[$key] = $value;
+ }
+ }
+ else
+ {
+ $merged_array[$key] = $value;
+ }
+ }
+
+ return $merged_array;
+ }
+}
diff --git a/phpBB/phpbb/install/installer.php b/phpBB/phpbb/install/installer.php
new file mode 100644
index 0000000000..755edb5297
--- /dev/null
+++ b/phpBB/phpbb/install/installer.php
@@ -0,0 +1,264 @@
+<?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\install;
+
+use phpbb\di\ordered_service_collection;
+use phpbb\install\exception\installer_config_not_writable_exception;
+use phpbb\install\exception\resource_limit_reached_exception;
+use phpbb\install\exception\user_interaction_required_exception;
+use phpbb\install\helper\config;
+use phpbb\install\helper\iohandler\cli_iohandler;
+use phpbb\install\helper\iohandler\iohandler_interface;
+
+class installer
+{
+ /**
+ * @var config
+ */
+ protected $install_config;
+
+ /**
+ * @var array
+ */
+ protected $installer_modules;
+
+ /**
+ * @var iohandler_interface
+ */
+ protected $iohandler;
+
+ /**
+ * Stores the number of steps that a given module has
+ *
+ * @var array
+ */
+ protected $module_step_count;
+
+ /**
+ * Constructor
+ *
+ * @param config $config Installer config handler
+ */
+ public function __construct(config $config)
+ {
+ $this->install_config = $config;
+ $this->installer_modules = null;
+ }
+
+ /**
+ * Sets modules to execute
+ *
+ * Note: The installer will run modules in the order they are set in
+ * the array.
+ *
+ * @param ordered_service_collection $modules Service collection of module service names
+ */
+ public function set_modules(ordered_service_collection $modules)
+ {
+ $this->installer_modules = $modules;
+ }
+
+ /**
+ * Sets input-output handler objects
+ *
+ * @param iohandler_interface $iohandler
+ */
+ public function set_iohandler(iohandler_interface $iohandler)
+ {
+ $this->iohandler = $iohandler;
+ }
+
+ /**
+ * Run phpBB installer
+ */
+ public function run()
+ {
+ // Load install progress
+ $this->install_config->load_config();
+
+ // Recover install progress
+ $module_name = $this->recover_progress();
+ $module_found = false;
+
+ // Variable used to check if the install process have been finished
+ $install_finished = false;
+ $fail_cleanup = false;
+
+ // We are installing something, so the introduction stage can go now...
+ $this->install_config->set_finished_navigation_stage(array('install', 0, 'introduction'));
+ $this->iohandler->set_finished_stage_menu(array('install', 0, 'introduction'));
+
+ if ($this->install_config->get_task_progress_count() === 0)
+ {
+ // Count all tasks in the current installer modules
+ $step_count = 0;
+
+ /** @var \phpbb\install\module_interface $module */
+ foreach ($this->installer_modules as $name => $module)
+ {
+ $module_step_count = $module->get_step_count();
+ $step_count += $module_step_count;
+ $this->module_step_count[$name] = $module_step_count;
+ }
+
+ // Set task count
+ $this->install_config->set_task_progress_count($step_count);
+ }
+
+ // Set up progress information
+ $this->iohandler->set_task_count(
+ $this->install_config->get_task_progress_count()
+ );
+
+ try
+ {
+ foreach ($this->installer_modules as $name => $module)
+ {
+ // Skip forward until the current task is reached
+ if (!$module_found)
+ {
+ if ($module_name === $name || empty($module_name))
+ {
+ $module_found = true;
+ }
+ else
+ {
+ continue;
+ }
+ }
+
+ // Log progress
+ $this->install_config->set_active_module($name);
+
+ // Run until there are available resources
+ if ($this->install_config->get_time_remaining() <= 0 && $this->install_config->get_memory_remaining() <= 0)
+ {
+ throw new resource_limit_reached_exception();
+ }
+
+ // Check if module should be executed
+ if (!$module->is_essential() && !$module->check_requirements())
+ {
+ $this->install_config->set_finished_navigation_stage($module->get_navigation_stage_path());
+ $this->iohandler->set_finished_stage_menu($module->get_navigation_stage_path());
+
+ $this->iohandler->add_log_message(array(
+ 'SKIP_MODULE',
+ $name,
+ ));
+ $this->install_config->increment_current_task_progress($this->module_step_count[$name]);
+ continue;
+ }
+
+ // Set the correct stage in the navigation bar
+ $this->install_config->set_active_navigation_stage($module->get_navigation_stage_path());
+ $this->iohandler->set_active_stage_menu($module->get_navigation_stage_path());
+
+ $module->run();
+
+ $this->install_config->set_finished_navigation_stage($module->get_navigation_stage_path());
+ $this->iohandler->set_finished_stage_menu($module->get_navigation_stage_path());
+ }
+
+ // Installation finished
+ $install_finished = true;
+
+ if ($this->iohandler instanceof cli_iohandler)
+ {
+ $this->iohandler->add_success_message('INSTALLER_FINISHED');
+ }
+ else
+ {
+ global $SID;
+
+ // Construct ACP url
+ $acp_url = $protocol = $this->install_config->get('server_protocol');
+ $acp_url .= $this->install_config->get('server_name');
+ $port = $this->install_config->get('server_port');
+
+ if (!((strpos($protocol, 'https:') === 0 && $port === 443)
+ || (strpos($protocol, 'http:') === 0 && $port === 80)))
+ {
+ $acp_url .= ':' . $port;
+ }
+
+ $acp_url .= $this->install_config->get('script_path');
+ $acp_url .= '/adm/index.php' . $SID;
+
+ $this->iohandler->add_success_message('INSTALLER_FINISHED', array(
+ 'ACP_LINK',
+ $acp_url,
+ ));
+ }
+ }
+ catch (user_interaction_required_exception $e)
+ {
+ // Do nothing
+ }
+ catch (resource_limit_reached_exception $e)
+ {
+ // Do nothing
+ }
+ catch (\Exception $e)
+ {
+ $this->iohandler->add_error_message($e->getMessage());
+ $this->iohandler->send_response();
+ $fail_cleanup = true;
+ }
+
+ if ($install_finished)
+ {
+ // Send install finished message
+ $this->iohandler->set_progress('INSTALLER_FINISHED', $this->install_config->get_task_progress_count());
+ }
+ else if (!$fail_cleanup)
+ {
+ $this->iohandler->request_refresh();
+ }
+
+ // Save install progress
+ try
+ {
+ if ($install_finished || $fail_cleanup)
+ {
+ $this->install_config->clean_up_config_file();
+ }
+ else
+ {
+ $this->install_config->save_config();
+ }
+ }
+ catch (installer_config_not_writable_exception $e)
+ {
+ // It is allowed to fail this test during requirements testing
+ $progress_data = $this->install_config->get_progress_data();
+
+ if ($progress_data['last_task_module_name'] !== 'installer.module.requirements_install')
+ {
+ $this->iohandler->add_error_message('INSTALLER_CONFIG_NOT_WRITABLE');
+ }
+ }
+ }
+
+ /**
+ * Recover install progress
+ *
+ * @return string Index of the next installer module to execute
+ */
+ protected function recover_progress()
+ {
+ $progress_array = $this->install_config->get_progress_data();
+ return $progress_array['last_task_module_name'];
+ }
+}
diff --git a/phpBB/phpbb/install/installer_configuration.php b/phpBB/phpbb/install/installer_configuration.php
new file mode 100644
index 0000000000..ab02da8686
--- /dev/null
+++ b/phpBB/phpbb/install/installer_configuration.php
@@ -0,0 +1,140 @@
+<?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\install;
+
+use Symfony\Component\Config\Definition\Builder\TreeBuilder;
+use Symfony\Component\Config\Definition\ConfigurationInterface;
+
+class installer_configuration implements ConfigurationInterface
+{
+
+ /**
+ * Generates the configuration tree builder.
+ *
+ * @return \Symfony\Component\Config\Definition\Builder\TreeBuilder The tree builder
+ */
+ public function getConfigTreeBuilder()
+ {
+ $treeBuilder = new TreeBuilder();
+ $rootNode = $treeBuilder->root('installer');
+ $rootNode
+ ->children()
+ ->arrayNode('admin')
+ ->children()
+ ->scalarNode('name')->defaultValue('admin')->cannotBeEmpty()->end()
+ ->scalarNode('password')->defaultValue('adminadmin')->cannotBeEmpty()->end()
+ ->scalarNode('email')->defaultValue('admin@example.org')->cannotBeEmpty()->end()
+ ->end()
+ ->end()
+ ->arrayNode('board')
+ ->children()
+ ->scalarNode('lang')
+ ->defaultValue('en')
+ ->cannotBeEmpty()
+ ->end()
+ ->scalarNode('name')
+ ->defaultValue('My Board')
+ ->cannotBeEmpty()
+ ->end()
+ ->scalarNode('description')
+ ->defaultValue('My amazing new phpBB board')
+ ->cannotBeEmpty()
+ ->end()
+ ->end()
+ ->end()
+ ->arrayNode('database')
+ ->children()
+ ->scalarNode('dbms')
+ ->defaultValue('sqlite3')
+ ->cannotBeEmpty()
+ ->isRequired()
+ ->end()
+ ->scalarNode('dbhost')
+ ->defaultValue(null)
+ ->end()
+ ->scalarNode('dbport')
+ ->defaultValue(null)
+ ->end()
+ ->scalarNode('dbuser')
+ ->defaultValue(null)
+ ->end()
+ ->scalarNode('dbpasswd')
+ ->defaultValue(null)
+ ->end()
+ ->scalarNode('dbname')
+ ->defaultValue(null)
+ ->end()
+ ->scalarNode('table_prefix')
+ ->defaultValue('phpbb_')
+ ->cannotBeEmpty()
+ ->isRequired()
+ ->end()
+ ->end()
+ ->end()
+ ->arrayNode('email')
+ ->canBeEnabled()
+ ->addDefaultsIfNotSet()
+ ->children()
+ ->booleanNode('smtp_delivery')
+ ->defaultValue(false)
+ ->treatNullLike(false)
+ ->end()
+ ->scalarNode('smtp_host')
+ ->defaultValue(null)
+ ->end()
+ ->scalarNode('smtp_auth')
+ ->defaultValue(null)
+ ->end()
+ ->scalarNode('smtp_user')
+ ->defaultValue(null)
+ ->end()
+ ->scalarNode('smtp_pass')
+ ->defaultValue(null)
+ ->end()
+ ->end()
+ ->end()
+ ->arrayNode('server')
+ ->children()
+ ->booleanNode('cookie_secure')
+ ->defaultValue(false)
+ ->treatNullLike(false)
+ ->end()
+ ->scalarNode('server_protocol')
+ ->defaultValue('http://')
+ ->cannotBeEmpty()
+ ->end()
+ ->booleanNode('force_server_vars')
+ ->defaultValue(false)
+ ->treatNullLike(false)
+ ->end()
+ ->scalarNode('server_name')
+ ->defaultValue('localhost')
+ ->cannotBeEmpty()
+ ->end()
+ ->integerNode('server_port')
+ ->defaultValue(80)
+ ->min(1)
+ ->cannotBeEmpty()
+ ->end()
+ ->scalarNode('script_path')
+ ->defaultValue('/')
+ ->cannotBeEmpty()
+ ->end()
+ ->end()
+ ->end()
+ ->end()
+ ;
+ return $treeBuilder;
+ }
+}
diff --git a/phpBB/phpbb/install/module/install_data/module.php b/phpBB/phpbb/install/module/install_data/module.php
new file mode 100644
index 0000000000..77f1f73f1f
--- /dev/null
+++ b/phpBB/phpbb/install/module/install_data/module.php
@@ -0,0 +1,28 @@
+<?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\install\module\install_data;
+
+/**
+ * Installer module for recovering and installing default data installation
+ */
+class module extends \phpbb\install\module_base
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function get_navigation_stage_path()
+ {
+ return array('install', 0, 'install');
+ }
+}
diff --git a/phpBB/phpbb/install/module/install_data/task/add_bots.php b/phpBB/phpbb/install/module/install_data/task/add_bots.php
new file mode 100644
index 0000000000..b45d3808db
--- /dev/null
+++ b/phpBB/phpbb/install/module/install_data/task/add_bots.php
@@ -0,0 +1,237 @@
+<?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\install\module\install_data\task;
+
+class add_bots extends \phpbb\install\task_base
+{
+ /**
+ * A list of the web-crawlers/bots we recognise by default
+ *
+ * Candidates but not included:
+ * 'Accoona [Bot]' 'Accoona-AI-Agent/'
+ * 'ASPseek [Crawler]' 'ASPseek/'
+ * 'Boitho [Crawler]' 'boitho.com-dc/'
+ * 'Bunnybot [Bot]' 'powered by www.buncat.de'
+ * 'Cosmix [Bot]' 'cfetch/'
+ * 'Crawler Search [Crawler]' '.Crawler-Search.de'
+ * 'Findexa [Crawler]' 'Findexa Crawler ('
+ * 'GBSpider [Spider]' 'GBSpider v'
+ * 'genie [Bot]' 'genieBot ('
+ * 'Hogsearch [Bot]' 'oegp v. 1.3.0'
+ * 'Insuranco [Bot]' 'InsurancoBot'
+ * 'IRLbot [Bot]' 'http://irl.cs.tamu.edu/crawler'
+ * 'ISC Systems [Bot]' 'ISC Systems iRc Search'
+ * 'Jyxobot [Bot]' 'Jyxobot/'
+ * 'Kraehe [Metasuche]' '-DIE-KRAEHE- META-SEARCH-ENGINE/'
+ * 'LinkWalker' 'LinkWalker'
+ * 'MMSBot [Bot]' 'http://www.mmsweb.at/bot.html'
+ * 'Naver [Bot]' 'nhnbot@naver.com)'
+ * 'NetResearchServer' 'NetResearchServer/'
+ * 'Nimble [Crawler]' 'NimbleCrawler'
+ * 'Ocelli [Bot]' 'Ocelli/'
+ * 'Onsearch [Bot]' 'onCHECK-Robot'
+ * 'Orange [Spider]' 'OrangeSpider'
+ * 'Sproose [Bot]' 'http://www.sproose.com/bot'
+ * 'Susie [Sync]' '!Susie (http://www.sync2it.com/susie)'
+ * 'Tbot [Bot]' 'Tbot/'
+ * 'Thumbshots [Capture]' 'thumbshots-de-Bot'
+ * 'Vagabondo [Crawler]' 'http://webagent.wise-guys.nl/'
+ * 'Walhello [Bot]' 'appie 1.1 (www.walhello.com)'
+ * 'WissenOnline [Bot]' 'WissenOnline-Bot'
+ * 'WWWeasel [Bot]' 'WWWeasel Robot v'
+ * 'Xaldon [Spider]' 'Xaldon WebSpider'
+ *
+ * @var array
+ */
+ protected $bot_list = array(
+ 'AdsBot [Google]' => array('AdsBot-Google', ''),
+ 'Alexa [Bot]' => array('ia_archiver', ''),
+ 'Alta Vista [Bot]' => array('Scooter/', ''),
+ 'Ask Jeeves [Bot]' => array('Ask Jeeves', ''),
+ 'Baidu [Spider]' => array('Baiduspider', ''),
+ 'Bing [Bot]' => array('bingbot/', ''),
+ 'Exabot [Bot]' => array('Exabot', ''),
+ 'FAST Enterprise [Crawler]' => array('FAST Enterprise Crawler', ''),
+ 'FAST WebCrawler [Crawler]' => array('FAST-WebCrawler/', ''),
+ 'Francis [Bot]' => array('http://www.neomo.de/', ''),
+ 'Gigabot [Bot]' => array('Gigabot/', ''),
+ 'Google Adsense [Bot]' => array('Mediapartners-Google', ''),
+ 'Google Desktop' => array('Google Desktop', ''),
+ 'Google Feedfetcher' => array('Feedfetcher-Google', ''),
+ 'Google [Bot]' => array('Googlebot', ''),
+ 'Heise IT-Markt [Crawler]' => array('heise-IT-Markt-Crawler', ''),
+ 'Heritrix [Crawler]' => array('heritrix/1.', ''),
+ 'IBM Research [Bot]' => array('ibm.com/cs/crawler', ''),
+ 'ICCrawler - ICjobs' => array('ICCrawler - ICjobs', ''),
+ 'ichiro [Crawler]' => array('ichiro/', ''),
+ 'Majestic-12 [Bot]' => array('MJ12bot/', ''),
+ 'Metager [Bot]' => array('MetagerBot/', ''),
+ 'MSN NewsBlogs' => array('msnbot-NewsBlogs/', ''),
+ 'MSN [Bot]' => array('msnbot/', ''),
+ 'MSNbot Media' => array('msnbot-media/', ''),
+ 'Nutch [Bot]' => array('http://lucene.apache.org/nutch/', ''),
+ 'Online link [Validator]' => array('online link validator', ''),
+ 'psbot [Picsearch]' => array('psbot/0', ''),
+ 'Sensis [Crawler]' => array('Sensis Web Crawler', ''),
+ 'SEO Crawler' => array('SEO search Crawler/', ''),
+ 'Seoma [Crawler]' => array('Seoma [SEO Crawler]', ''),
+ 'SEOSearch [Crawler]' => array('SEOsearch/', ''),
+ 'Snappy [Bot]' => array('Snappy/1.1 ( http://www.urltrends.com/ )', ''),
+ 'Steeler [Crawler]' => array('http://www.tkl.iis.u-tokyo.ac.jp/~crawler/', ''),
+ 'Telekom [Bot]' => array('crawleradmin.t-info@telekom.de', ''),
+ 'TurnitinBot [Bot]' => array('TurnitinBot/', ''),
+ 'Voyager [Bot]' => array('voyager/', ''),
+ 'W3 [Sitesearch]' => array('W3 SiteSearch Crawler', ''),
+ 'W3C [Linkcheck]' => array('W3C-checklink/', ''),
+ 'W3C [Validator]' => array('W3C_Validator', ''),
+ 'YaCy [Bot]' => array('yacybot', ''),
+ 'Yahoo MMCrawler [Bot]' => array('Yahoo-MMCrawler/', ''),
+ 'Yahoo Slurp [Bot]' => array('Yahoo! DE Slurp', ''),
+ 'Yahoo [Bot]' => array('Yahoo! Slurp', ''),
+ 'YahooSeeker [Bot]' => array('YahooSeeker/', ''),
+ );
+
+ /**
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * @var \phpbb\install\helper\config
+ */
+ protected $install_config;
+
+ /**
+ * @var \phpbb\install\helper\iohandler\iohandler_interface
+ */
+ protected $io_handler;
+
+ /**
+ * @var \phpbb\language\language
+ */
+ protected $language;
+
+ /**
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\install\helper\config $install_config Installer's config
+ * @param \phpbb\install\helper\iohandler\iohandler_interface $iohandler Input-output handler for the installer
+ * @param \phpbb\install\helper\container_factory $container Installer's DI container
+ * @param \phpbb\language\language $language Language provider
+ * @param string $phpbb_root_path Relative path to phpBB root
+ * @param string $php_ext PHP extension
+ */
+ public function __construct(\phpbb\install\helper\config $install_config,
+ \phpbb\install\helper\iohandler\iohandler_interface $iohandler,
+ \phpbb\install\helper\container_factory $container,
+ \phpbb\language\language $language,
+ $phpbb_root_path,
+ $php_ext)
+ {
+ parent::__construct(true);
+
+ $this->db = $container->get('dbal.conn');
+ $this->install_config = $install_config;
+ $this->io_handler = $iohandler;
+ $this->language = $language;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function run()
+ {
+ $this->db->sql_return_on_error(true);
+
+ $sql = 'SELECT group_id
+ FROM ' . GROUPS_TABLE . "
+ WHERE group_name = 'BOTS'";
+ $result = $this->db->sql_query($sql);
+ $group_id = (int) $this->db->sql_fetchfield('group_id');
+ $this->db->sql_freeresult($result);
+
+ if (!$group_id)
+ {
+ // If we reach this point then something has gone very wrong
+ $this->io_handler->add_error_message('NO_GROUP');
+ }
+
+ foreach ($this->bot_list as $bot_name => $bot_ary)
+ {
+ $user_row = array(
+ 'user_type' => USER_IGNORE,
+ 'group_id' => $group_id,
+ 'username' => $bot_name,
+ 'user_regdate' => time(),
+ 'user_password' => '',
+ 'user_colour' => '9E8DA7',
+ 'user_email' => '',
+ 'user_lang' => $this->install_config->get('default_lang'),
+ 'user_style' => 1,
+ 'user_timezone' => 'UTC',
+ 'user_dateformat' => $this->language->lang('default_dateformat'),
+ 'user_allow_massemail' => 0,
+ 'user_allow_pm' => 0,
+ );
+
+ $user_id = user_add($user_row);
+
+ if (!$user_id)
+ {
+ // If we can't insert this user then continue to the next one to avoid inconsistent data
+ $this->io_handler->add_error_message('CONV_ERROR_INSERT_BOT');
+
+ continue;
+ }
+
+ $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_ary[0],
+ 'bot_ip' => (string) $bot_ary[1],
+ ));
+
+ $this->db->sql_query($sql);
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ static public function get_step_count()
+ {
+ return 1;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_task_lang_name()
+ {
+ return 'TASK_ADD_BOTS';
+ }
+}
diff --git a/phpBB/phpbb/install/module/install_data/task/add_languages.php b/phpBB/phpbb/install/module/install_data/task/add_languages.php
new file mode 100644
index 0000000000..7ffdf4f276
--- /dev/null
+++ b/phpBB/phpbb/install/module/install_data/task/add_languages.php
@@ -0,0 +1,121 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+namespace phpbb\install\module\install_data\task;
+
+class add_languages extends \phpbb\install\task_base
+{
+ /**
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * @var \phpbb\install\helper\iohandler\iohandler_interface
+ */
+ protected $iohandler;
+
+ /**
+ * @var \phpbb\language\language_file_helper
+ */
+ protected $language_helper;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\install\helper\iohandler\iohandler_interface $iohandler Installer's input-output handler
+ * @param \phpbb\install\helper\container_factory $container Installer's DI container
+ * @param \phpbb\language\language_file_helper $language_helper Language file helper service
+ */
+ public function __construct(\phpbb\install\helper\iohandler\iohandler_interface $iohandler,
+ \phpbb\install\helper\container_factory $container,
+ \phpbb\language\language_file_helper $language_helper)
+ {
+ $this->db = $container->get('dbal.conn');
+ $this->iohandler = $iohandler;
+ $this->language_helper = $language_helper;
+
+ parent::__construct(true);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function run()
+ {
+ $this->db->sql_return_on_error(true);
+
+ $languages = $this->language_helper->get_available_languages();
+ $installed_languages = array();
+
+ foreach ($languages as $lang_info)
+ {
+ $lang_pack = array(
+ 'lang_iso' => $lang_info['iso'],
+ 'lang_dir' => $lang_info['iso'],
+ 'lang_english_name' => htmlspecialchars($lang_info['name']),
+ 'lang_local_name' => htmlspecialchars($lang_info['local_name'], ENT_COMPAT, 'UTF-8'),
+ 'lang_author' => htmlspecialchars($lang_info['author'], ENT_COMPAT, 'UTF-8'),
+ );
+
+ $this->db->sql_query('INSERT INTO ' . LANG_TABLE . ' ' . $this->db->sql_build_array('INSERT', $lang_pack));
+
+ $installed_languages[] = (int) $this->db->sql_nextid();
+ if ($this->db->get_sql_error_triggered())
+ {
+ $error = $this->db->sql_error($this->db->get_sql_error_sql());
+ $this->iohandler->add_error_message($error['message']);
+ }
+ }
+
+ $sql = 'SELECT * FROM ' . PROFILE_FIELDS_TABLE;
+ $result = $this->db->sql_query($sql);
+
+ $insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, PROFILE_LANG_TABLE);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ foreach ($installed_languages as $lang_id)
+ {
+ $insert_buffer->insert(array(
+ 'field_id' => $row['field_id'],
+ 'lang_id' => $lang_id,
+
+ // Remove phpbb_ from field name
+ 'lang_name' => strtoupper(substr($row['field_name'], 6)),
+ 'lang_explain' => '',
+ 'lang_default_value' => '',
+ ));
+ }
+ }
+
+ $this->db->sql_freeresult($result);
+
+ $insert_buffer->flush();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ static public function get_step_count()
+ {
+ return 1;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_task_lang_name()
+ {
+ return 'TASK_ADD_LANGUAGES';
+ }
+}
diff --git a/phpBB/phpbb/install/module/install_data/task/add_modules.php b/phpBB/phpbb/install/module/install_data/task/add_modules.php
new file mode 100644
index 0000000000..bfbe6282bc
--- /dev/null
+++ b/phpBB/phpbb/install/module/install_data/task/add_modules.php
@@ -0,0 +1,462 @@
+<?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\install\module\install_data\task;
+
+class add_modules extends \phpbb\install\task_base
+{
+ /**
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * @var \phpbb\extension\manager
+ */
+ protected $extension_manager;
+
+ /**
+ * @var \phpbb\install\helper\iohandler\iohandler_interface
+ */
+ protected $iohandler;
+
+ /**
+ * @var \phpbb\module\module_manager
+ */
+ protected $module_manager;
+
+ /**
+ * Define the module structure so that we can populate the database without
+ * needing to hard-code module_id values
+ *
+ * @var array
+ */
+ protected $module_categories = array(
+ 'acp' => array(
+ 'ACP_CAT_GENERAL' => array(
+ 'ACP_QUICK_ACCESS',
+ 'ACP_BOARD_CONFIGURATION',
+ 'ACP_CLIENT_COMMUNICATION',
+ 'ACP_SERVER_CONFIGURATION',
+ ),
+ 'ACP_CAT_FORUMS' => array(
+ 'ACP_MANAGE_FORUMS',
+ 'ACP_FORUM_BASED_PERMISSIONS',
+ ),
+ 'ACP_CAT_POSTING' => array(
+ 'ACP_MESSAGES',
+ 'ACP_ATTACHMENTS',
+ ),
+ 'ACP_CAT_USERGROUP' => array(
+ 'ACP_CAT_USERS',
+ 'ACP_GROUPS',
+ 'ACP_USER_SECURITY',
+ ),
+ 'ACP_CAT_PERMISSIONS' => array(
+ 'ACP_GLOBAL_PERMISSIONS',
+ 'ACP_FORUM_BASED_PERMISSIONS',
+ 'ACP_PERMISSION_ROLES',
+ 'ACP_PERMISSION_MASKS',
+ ),
+ 'ACP_CAT_CUSTOMISE' => array(
+ 'ACP_STYLE_MANAGEMENT',
+ 'ACP_EXTENSION_MANAGEMENT',
+ 'ACP_LANGUAGE',
+ ),
+ 'ACP_CAT_MAINTENANCE' => array(
+ 'ACP_FORUM_LOGS',
+ 'ACP_CAT_DATABASE',
+ ),
+ 'ACP_CAT_SYSTEM' => array(
+ 'ACP_AUTOMATION',
+ 'ACP_GENERAL_TASKS',
+ 'ACP_MODULE_MANAGEMENT',
+ ),
+ 'ACP_CAT_DOT_MODS' => null,
+ ),
+ 'mcp' => array(
+ 'MCP_MAIN' => null,
+ 'MCP_QUEUE' => null,
+ 'MCP_REPORTS' => null,
+ 'MCP_NOTES' => null,
+ 'MCP_WARN' => null,
+ 'MCP_LOGS' => null,
+ 'MCP_BAN' => null,
+ ),
+ 'ucp' => array(
+ 'UCP_MAIN' => null,
+ 'UCP_PROFILE' => null,
+ 'UCP_PREFS' => null,
+ 'UCP_PM' => null,
+ 'UCP_USERGROUPS' => null,
+ 'UCP_ZEBRA' => null,
+ ),
+ );
+
+ /**
+ * @var array
+ */
+ protected $module_categories_basenames = array(
+ 'UCP_PM' => 'ucp_pm',
+ );
+
+ /**
+ * @var array
+ */
+ protected $module_extras = array(
+ 'acp' => array(
+ 'ACP_QUICK_ACCESS' => array(
+ 'ACP_MANAGE_USERS',
+ 'ACP_GROUPS_MANAGE',
+ 'ACP_MANAGE_FORUMS',
+ 'ACP_MOD_LOGS',
+ 'ACP_BOTS',
+ 'ACP_PHP_INFO',
+ ),
+ 'ACP_FORUM_BASED_PERMISSIONS' => array(
+ 'ACP_FORUM_PERMISSIONS',
+ 'ACP_FORUM_PERMISSIONS_COPY',
+ 'ACP_FORUM_MODERATORS',
+ 'ACP_USERS_FORUM_PERMISSIONS',
+ 'ACP_GROUPS_FORUM_PERMISSIONS',
+ ),
+ ),
+ );
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\install\helper\iohandler\iohandler_interface $iohandler Installer's input-output handler
+ * @param \phpbb\install\helper\container_factory $container Installer's DI container
+ */
+ public function __construct(\phpbb\install\helper\iohandler\iohandler_interface $iohandler,
+ \phpbb\install\helper\container_factory $container)
+ {
+ $this->db = $container->get('dbal.conn');
+ $this->extension_manager = $container->get('ext.manager');
+ $this->iohandler = $iohandler;
+ $this->module_manager = $container->get('module.manager');
+
+ parent::__construct(true);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function run()
+ {
+ $this->db->sql_return_on_error(true);
+
+ $module_classes = array('acp', 'mcp', 'ucp');
+ foreach ($module_classes as $module_class)
+ {
+ $categories = array();
+
+ foreach ($this->module_categories[$module_class] as $cat_name => $subs)
+ {
+ // Check if this sub-category has a basename. If it has, use it.
+ $basename = (isset($this->module_categories_basenames[$cat_name])) ? $this->module_categories_basenames[$cat_name] : '';
+
+ $module_data = array(
+ 'module_basename' => $basename,
+ 'module_enabled' => 1,
+ 'module_display' => 1,
+ 'parent_id' => 0,
+ 'module_class' => $module_class,
+ 'module_langname' => $cat_name,
+ 'module_mode' => '',
+ 'module_auth' => '',
+ );
+
+ $this->module_manager->update_module_data($module_data);
+
+ // Check for last sql error happened
+ if ($this->db->get_sql_error_triggered())
+ {
+ $error = $this->db->sql_error($this->db->get_sql_error_sql());
+ $this->iohandler->add_error_message('INST_ERR_DB', $error['message']);
+ }
+
+ $categories[$cat_name]['id'] = (int) $module_data['module_id'];
+ $categories[$cat_name]['parent_id'] = 0;
+
+ if (is_array($subs))
+ {
+ foreach ($subs as $level2_name)
+ {
+ // Check if this sub-category has a basename. If it has, use it.
+ $basename = (isset($this->module_categories_basenames[$level2_name])) ? $this->module_categories_basenames[$level2_name] : '';
+
+ $module_data = array(
+ 'module_basename' => $basename,
+ 'module_enabled' => 1,
+ 'module_display' => 1,
+ 'parent_id' => (int) $categories[$cat_name]['id'],
+ 'module_class' => $module_class,
+ 'module_langname' => $level2_name,
+ 'module_mode' => '',
+ 'module_auth' => '',
+ );
+
+ $this->module_manager->update_module_data($module_data);
+
+ // Check for last sql error happened
+ if ($this->db->get_sql_error_triggered())
+ {
+ $error = $this->db->sql_error($this->db->get_sql_error_sql());
+ $this->iohandler->add_error_message('INST_ERR_DB', $error['message']);
+ }
+
+ $categories[$level2_name]['id'] = (int) $module_data['module_id'];
+ $categories[$level2_name]['parent_id'] = (int) $categories[$cat_name]['id'];
+ }
+ }
+ }
+
+ // Get the modules we want to add... returned sorted by name
+ $module_info = $this->module_manager->get_module_infos($module_class);
+
+ foreach ($module_info as $module_basename => $fileinfo)
+ {
+ foreach ($fileinfo['modes'] as $module_mode => $row)
+ {
+ foreach ($row['cat'] as $cat_name)
+ {
+ if (!isset($categories[$cat_name]))
+ {
+ continue;
+ }
+
+ $module_data = array(
+ 'module_basename' => $module_basename,
+ 'module_enabled' => 1,
+ 'module_display' => (isset($row['display'])) ? (int) $row['display'] : 1,
+ 'parent_id' => (int) $categories[$cat_name]['id'],
+ 'module_class' => $module_class,
+ 'module_langname' => $row['title'],
+ 'module_mode' => $module_mode,
+ 'module_auth' => $row['auth'],
+ );
+
+ $this->module_manager->update_module_data($module_data);
+
+ // Check for last sql error happened
+ if ($this->db->get_sql_error_triggered())
+ {
+ $error = $this->db->sql_error($this->db->get_sql_error_sql());
+ $this->iohandler->add_error_message('INST_ERR_DB', $error['message']);
+ }
+ }
+ }
+ }
+
+ // Move some of the modules around since the code above will put them in the wrong place
+ if ($module_class === 'acp')
+ {
+ // Move main module 4 up...
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_basename = 'acp_main'
+ AND module_class = 'acp'
+ AND module_mode = 'main'";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $this->module_manager->move_module_by($row, 'acp', 'move_up', 4);
+
+ // Move permissions intro screen module 4 up...
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_basename = 'acp_permissions'
+ AND module_class = 'acp'
+ AND module_mode = 'intro'";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $this->module_manager->move_module_by($row, 'acp', 'move_up', 4);
+
+ // Move manage users screen module 5 up...
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_basename = 'acp_users'
+ AND module_class = 'acp'
+ AND module_mode = 'overview'";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $this->module_manager->move_module_by($row, 'acp', '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 = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $this->module_manager->move_module_by($row, 'acp', 'move_up', 1);
+ }
+
+ if ($module_class == 'mcp')
+ {
+ // Move pm report details module 3 down...
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_basename = 'mcp_pm_reports'
+ AND module_class = 'mcp'
+ AND module_mode = 'pm_report_details'";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $this->module_manager->move_module_by($row, 'mcp', 'move_down', 3);
+
+ // Move closed pm reports module 3 down...
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_basename = 'mcp_pm_reports'
+ AND module_class = 'mcp'
+ AND module_mode = 'pm_reports_closed'";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $this->module_manager->move_module_by($row, 'mcp', 'move_down', 3);
+
+ // Move open pm reports module 3 down...
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_basename = 'mcp_pm_reports'
+ AND module_class = 'mcp'
+ AND module_mode = 'pm_reports'";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $this->module_manager->move_module_by($row, 'mcp', 'move_down', 3);
+ }
+
+ if ($module_class == 'ucp')
+ {
+ // Move attachment module 4 down...
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_basename = 'ucp_attachments'
+ AND module_class = 'ucp'
+ AND module_mode = 'attachments'";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $this->module_manager->move_module_by($row, 'ucp', 'move_down', 4);
+
+ // Move notification options module 4 down...
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_basename = 'ucp_notifications'
+ AND module_class = 'ucp'
+ AND module_mode = 'notification_options'";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $this->module_manager->move_module_by($row, 'ucp', 'move_down', 4);
+
+ // Move OAuth module 5 down...
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_basename = 'ucp_auth_link'
+ AND module_class = 'ucp'
+ AND module_mode = 'auth_link'";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $this->module_manager->move_module_by($row, 'ucp', 'move_down', 5);
+ }
+
+ // And now for the special ones
+ // (these are modules which appear in multiple categories and thus get added manually
+ // to some for more control)
+ if (isset($this->module_extras[$module_class]))
+ {
+ foreach ($this->module_extras[$module_class] as $cat_name => $mods)
+ {
+ $sql = 'SELECT module_id, left_id, right_id
+ FROM ' . MODULES_TABLE . "
+ WHERE module_langname = '" . $this->db->sql_escape($cat_name) . "'
+ AND module_class = '" . $this->db->sql_escape($module_class) . "'";
+ $result = $this->db->sql_query_limit($sql, 1);
+ $row2 = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ foreach ($mods as $mod_name)
+ {
+ $sql = 'SELECT *
+ FROM ' . MODULES_TABLE . "
+ WHERE module_langname = '" . $this->db->sql_escape($mod_name) . "'
+ AND module_class = '" . $this->db->sql_escape($module_class) . "'
+ AND module_basename <> ''";
+ $result = $this->db->sql_query_limit($sql, 1);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $module_data = array(
+ 'module_basename' => $row['module_basename'],
+ 'module_enabled' => (int) $row['module_enabled'],
+ 'module_display' => (int) $row['module_display'],
+ 'parent_id' => (int) $row2['module_id'],
+ 'module_class' => $row['module_class'],
+ 'module_langname' => $row['module_langname'],
+ 'module_mode' => $row['module_mode'],
+ 'module_auth' => $row['module_auth'],
+ );
+
+ $this->module_manager->update_module_data($module_data);
+
+ // Check for last sql error happened
+ if ($this->db->get_sql_error_triggered())
+ {
+ $error = $this->db->sql_error($this->db->get_sql_error_sql());
+ $this->iohandler->add_error_message('INST_ERR_DB', $error['message']);
+ }
+ }
+ }
+ }
+
+ $this->module_manager->remove_cache_file($module_class);
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ static public function get_step_count()
+ {
+ return 1;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_task_lang_name()
+ {
+ return 'TASK_ADD_MODULES';
+ }
+}
diff --git a/phpBB/phpbb/install/module/install_database/module.php b/phpBB/phpbb/install/module/install_database/module.php
new file mode 100644
index 0000000000..0d8b33087f
--- /dev/null
+++ b/phpBB/phpbb/install/module/install_database/module.php
@@ -0,0 +1,28 @@
+<?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\install\module\install_database;
+
+/**
+ * Installer module for database installation
+ */
+class module extends \phpbb\install\module_base
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function get_navigation_stage_path()
+ {
+ return array('install', 0, 'install');
+ }
+}
diff --git a/phpBB/phpbb/install/module/install_database/task/add_config_settings.php b/phpBB/phpbb/install/module/install_database/task/add_config_settings.php
new file mode 100644
index 0000000000..25da36e01d
--- /dev/null
+++ b/phpBB/phpbb/install/module/install_database/task/add_config_settings.php
@@ -0,0 +1,341 @@
+<?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\install\module\install_database\task;
+
+/**
+ * Create database schema
+ */
+class add_config_settings extends \phpbb\install\task_base
+{
+ /**
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * @var \phpbb\filesystem\filesystem_interface
+ */
+ protected $filesystem;
+
+ /**
+ * @var \phpbb\install\helper\config
+ */
+ protected $install_config;
+
+ /**
+ * @var \phpbb\install\helper\iohandler\iohandler_interface
+ */
+ protected $iohandler;
+
+ /**
+ * @var \phpbb\language\language
+ */
+ protected $language;
+
+ /**
+ * @var \phpbb\passwords\manager
+ */
+ protected $password_manager;
+
+ /**
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * @var string
+ */
+ protected $config_table;
+
+ /**
+ * @var string
+ */
+ protected $user_table;
+
+ /**
+ * @var string
+ */
+ protected $topics_table;
+
+ /**
+ * @var string
+ */
+ protected $forums_table;
+
+ /**
+ * @var string
+ */
+ protected $posts_table;
+
+ /**
+ * @var string
+ */
+ protected $moderator_cache_table;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\filesystem\filesystem_interface $filesystem Filesystem service
+ * @param \phpbb\install\helper\config $install_config Installer's config helper
+ * @param \phpbb\install\helper\iohandler\iohandler_interface $iohandler Installer's input-output handler
+ * @param \phpbb\install\helper\container_factory $container Installer's DI container
+ * @param \phpbb\language\language $language Language service
+ * @param string $phpbb_root_path Path to phpBB's root
+ */
+ public function __construct(\phpbb\filesystem\filesystem_interface $filesystem,
+ \phpbb\install\helper\config $install_config,
+ \phpbb\install\helper\iohandler\iohandler_interface $iohandler,
+ \phpbb\install\helper\container_factory $container,
+ \phpbb\language\language $language,
+ $phpbb_root_path)
+ {
+ $this->db = $container->get('dbal.conn');
+ $this->filesystem = $filesystem;
+ $this->install_config = $install_config;
+ $this->iohandler = $iohandler;
+ $this->language = $language;
+ $this->password_manager = $container->get('passwords.manager');
+ $this->phpbb_root_path = $phpbb_root_path;
+
+ // Table names
+ $this->config_table = $container->get_parameter('tables.config');
+ $this->forums_table = $container->get_parameter('tables.forums');
+ $this->topics_table = $container->get_parameter('tables.topics');
+ $this->user_table = $container->get_parameter('tables.users');
+ $this->moderator_cache_table = $container->get_parameter('tables.moderator_cache');
+ $this->posts_table = $container->get_parameter('tables.posts');
+
+ parent::__construct(true);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function run()
+ {
+ $this->db->sql_return_on_error(true);
+
+ $server_name = $this->install_config->get('server_name');
+ $cookie_domain = $this->install_config->get('cookie_domain');
+ $current_time = time();
+ $user_ip = phpbb_ip_normalise($this->iohandler->get_server_variable('REMOTE_ADDR'));
+ $user_ip = ($user_ip === false) ? '' : $user_ip;
+ $referer = $this->iohandler->get_server_variable('REFERER');
+
+ // Set default config and post data, this applies to all DB's
+ $sql_ary = array(
+ 'INSERT INTO ' . $this->config_table . " (config_name, config_value)
+ VALUES ('board_startdate', '$current_time')",
+
+ 'INSERT INTO ' . $this->config_table . " (config_name, config_value)
+ VALUES ('default_lang', '" . $this->db->sql_escape($this->install_config->get('default_lang')) . "')",
+
+ 'UPDATE ' . $this->config_table . "
+ SET config_value = '" . $this->db->sql_escape($this->install_config->get('img_imagick')) . "'
+ WHERE config_name = 'img_imagick'",
+
+ 'UPDATE ' . $this->config_table . "
+ SET config_value = '" . $this->db->sql_escape($this->install_config->get('server_name')) . "'
+ WHERE config_name = 'server_name'",
+
+ 'UPDATE ' . $this->config_table . "
+ SET config_value = '" . $this->db->sql_escape($this->install_config->get('server_port')) . "'
+ WHERE config_name = 'server_port'",
+
+ 'UPDATE ' . $this->config_table . "
+ SET config_value = '" . $this->db->sql_escape($this->install_config->get('board_email')) . "'
+ WHERE config_name = 'board_email'",
+
+ 'UPDATE ' . $this->config_table . "
+ SET config_value = '" . $this->db->sql_escape($this->install_config->get('board_email')) . "'
+ WHERE config_name = 'board_contact'",
+
+ 'UPDATE ' . $this->config_table . "
+ SET config_value = '" . $this->db->sql_escape($cookie_domain) . "'
+ WHERE config_name = 'cookie_domain'",
+
+ 'UPDATE ' . $this->config_table . "
+ SET config_value = '" . $this->db->sql_escape($this->language->lang('default_dateformat')) . "'
+ WHERE config_name = 'default_dateformat'",
+
+ 'UPDATE ' . $this->config_table . "
+ SET config_value = '" . $this->db->sql_escape($this->install_config->get('email_enable')) . "'
+ WHERE config_name = 'email_enable'",
+
+ 'UPDATE ' . $this->config_table . "
+ SET config_value = '" . $this->db->sql_escape($this->install_config->get('smtp_delivery')) . "'
+ WHERE config_name = 'smtp_delivery'",
+
+ 'UPDATE ' . $this->config_table . "
+ SET config_value = '" . $this->db->sql_escape($this->install_config->get('smtp_host')) . "'
+ WHERE config_name = 'smtp_host'",
+
+ 'UPDATE ' . $this->config_table . "
+ SET config_value = '" . $this->db->sql_escape($this->install_config->get('smtp_auth')) . "'
+ WHERE config_name = 'smtp_auth_method'",
+
+ 'UPDATE ' . $this->config_table . "
+ SET config_value = '" . $this->db->sql_escape($this->install_config->get('smtp_user')) . "'
+ WHERE config_name = 'smtp_username'",
+
+ 'UPDATE ' . $this->config_table . "
+ SET config_value = '" . $this->db->sql_escape($this->install_config->get('smtp_pass')) . "'
+ WHERE config_name = 'smtp_password'",
+
+ 'UPDATE ' . $this->config_table . "
+ SET config_value = '" . $this->db->sql_escape($this->install_config->get('cookie_secure')) . "'
+ WHERE config_name = 'cookie_secure'",
+
+ 'UPDATE ' . $this->config_table . "
+ SET config_value = '" . $this->db->sql_escape($this->install_config->get('force_server_vars')) . "'
+ WHERE config_name = 'force_server_vars'",
+
+ 'UPDATE ' . $this->config_table . "
+ SET config_value = '" . $this->db->sql_escape($this->install_config->get('script_path')) . "'
+ WHERE config_name = 'script_path'",
+
+ 'UPDATE ' . $this->config_table . "
+ SET config_value = '" . $this->db->sql_escape($this->install_config->get('server_protocol')) . "'
+ WHERE config_name = 'server_protocol'",
+
+ 'UPDATE ' . $this->config_table . "
+ SET config_value = '" . $this->db->sql_escape($this->install_config->get('admin_name')) . "'
+ WHERE config_name = 'newest_username'",
+
+ 'UPDATE ' . $this->config_table . "
+ SET config_value = '" . md5(mt_rand()) . "'
+ WHERE config_name = 'avatar_salt'",
+
+ 'UPDATE ' . $this->config_table . "
+ SET config_value = '" . md5(mt_rand()) . "'
+ WHERE config_name = 'plupload_salt'",
+
+ 'UPDATE ' . $this->config_table . "
+ SET config_value = '" . $this->db->sql_escape($this->install_config->get('board_name')) . "'
+ WHERE config_name = 'sitename'",
+
+ 'UPDATE ' . $this->config_table . "
+ SET config_value = '" . $this->db->sql_escape($this->install_config->get('board_description')) . "'
+ WHERE config_name = 'site_desc'",
+
+ 'UPDATE ' . $this->user_table . "
+ SET username = '" . $this->db->sql_escape($this->install_config->get('admin_name')) . "',
+ user_password='" . $this->password_manager->hash($this->install_config->get('admin_passwd')) . "',
+ user_ip = '" . $this->db->sql_escape($user_ip) . "',
+ user_lang = '" . $this->db->sql_escape($this->install_config->get('language')) . "',
+ user_email='" . $this->db->sql_escape($this->install_config->get('board_email')) . "',
+ user_dateformat='" . $this->db->sql_escape($this->language->lang('default_dateformat')) . "',
+ user_email_hash = " . $this->db->sql_escape(phpbb_email_hash($this->install_config->get('board_email'))) . ",
+ username_clean = '" . $this->db->sql_escape(utf8_clean_string($this->install_config->get('admin_name'))) . "'
+ WHERE username = 'Admin'",
+
+ 'UPDATE ' . $this->moderator_cache_table . "
+ SET username = '" . $this->db->sql_escape($this->install_config->get('admin_name')) . "'
+ WHERE username = 'Admin'",
+
+ 'UPDATE ' . $this->forums_table . "
+ SET forum_last_poster_name = '" . $this->db->sql_escape($this->install_config->get('admin_name')) . "'
+ WHERE forum_last_poster_name = 'Admin'",
+
+ 'UPDATE ' . $this->topics_table . "
+ SET topic_first_poster_name = '" . $this->db->sql_escape($this->install_config->get('admin_name')) . "',
+ topic_last_poster_name = '" . $this->db->sql_escape($this->install_config->get('admin_name')) . "'
+ WHERE topic_first_poster_name = 'Admin'
+ OR topic_last_poster_name = 'Admin'",
+
+ 'UPDATE ' . $this->user_table . "
+ SET user_regdate = $current_time",
+
+ 'UPDATE ' . $this->posts_table . "
+ SET post_time = $current_time, poster_ip = '" . $this->db->sql_escape($user_ip) . "'",
+
+ 'UPDATE ' . $this->topics_table . "
+ SET topic_time = $current_time, topic_last_post_time = $current_time",
+
+ 'UPDATE ' . $this->forums_table . "
+ SET forum_last_post_time = $current_time",
+
+ 'UPDATE ' . $this->config_table . "
+ SET config_value = '" . $this->db->sql_escape($this->db->sql_server_info(true)) . "'
+ WHERE config_name = 'dbms_version'",
+ );
+
+ if (@extension_loaded('gd'))
+ {
+ $sql_ary[] = 'UPDATE ' . $this->config_table . "
+ SET config_value = 'core.captcha.plugins.gd'
+ WHERE config_name = 'captcha_plugin'";
+
+ $sql_ary[] = 'UPDATE ' . $this->config_table . "
+ SET config_value = '1'
+ WHERE config_name = 'captcha_gd'";
+ }
+
+ $ref = substr($referer, strpos($referer, '://') + 3);
+ if (!(stripos($ref, $server_name) === 0))
+ {
+ $sql_ary[] = 'UPDATE ' . $this->config_table . "
+ SET config_value = '0'
+ WHERE config_name = 'referer_validation'";
+ }
+
+ // We set a (semi-)unique cookie name to bypass login issues related to the cookie name.
+ $cookie_name = 'phpbb3_';
+ $rand_str = md5(mt_rand());
+ $rand_str = str_replace('0', 'z', base_convert($rand_str, 16, 35));
+ $rand_str = substr($rand_str, 0, 5);
+ $cookie_name .= strtolower($rand_str);
+
+ $sql_ary[] = 'UPDATE ' . $this->config_table . "
+ SET config_value = '" . $this->db->sql_escape($cookie_name) . "'
+ WHERE config_name = 'cookie_name'";
+
+ // Disable avatars if upload directory is not writable
+ if (!$this->filesystem->is_writable($this->phpbb_root_path . 'images/avatars/upload/'))
+ {
+ $sql_ary[] = 'UPDATE ' . $this->config_table . "
+ SET config_value = '0'
+ WHERE config_name = 'allow_avatar'";
+
+ $sql_ary[] = 'UPDATE ' . $this->config_table . "
+ SET config_value = '0'
+ WHERE config_name = 'allow_avatar_upload'";
+ }
+
+ foreach ($sql_ary as $sql)
+ {
+ if (!$this->db->sql_query($sql))
+ {
+ $error = $this->db->sql_error($this->db->get_sql_error_sql());
+ $this->iohandler->add_error_message('INST_ERR_DB', $error['message']);
+ }
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ static public function get_step_count()
+ {
+ return 1;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_task_lang_name()
+ {
+ return 'TASK_ADD_CONFIG_SETTINGS';
+ }
+}
diff --git a/phpBB/phpbb/install/module/install_database/task/add_default_data.php b/phpBB/phpbb/install/module/install_database/task/add_default_data.php
new file mode 100644
index 0000000000..3d73a74618
--- /dev/null
+++ b/phpBB/phpbb/install/module/install_database/task/add_default_data.php
@@ -0,0 +1,163 @@
+<?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\install\module\install_database\task;
+
+/**
+ * Create database schema
+ */
+class add_default_data extends \phpbb\install\task_base
+{
+ /**
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * @var \phpbb\install\helper\database
+ */
+ protected $database_helper;
+
+ /**
+ * @var \phpbb\install\helper\config
+ */
+ protected $config;
+
+ /**
+ * @var \phpbb\install\helper\iohandler\iohandler_interface
+ */
+ protected $iohandler;
+
+ /**
+ * @var \phpbb\language\language
+ */
+ protected $language;
+
+ /**
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\install\helper\database $db_helper Installer's database helper
+ * @param \phpbb\install\helper\config $config Installer config
+ * @param \phpbb\install\helper\iohandler\iohandler_interface $iohandler Installer's input-output handler
+ * @param \phpbb\install\helper\container_factory $container Installer's DI container
+ * @param \phpbb\language\language $language Language service
+ * @param string $root_path Root path of phpBB
+ */
+ public function __construct(\phpbb\install\helper\database $db_helper,
+ \phpbb\install\helper\config $config,
+ \phpbb\install\helper\iohandler\iohandler_interface $iohandler,
+ \phpbb\install\helper\container_factory $container,
+ \phpbb\language\language $language,
+ $root_path)
+ {
+ $this->db = $container->get('dbal.conn.driver');
+ $this->database_helper = $db_helper;
+ $this->config = $config;
+ $this->iohandler = $iohandler;
+ $this->language = $language;
+ $this->phpbb_root_path = $root_path;
+
+ parent::__construct(true);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function run()
+ {
+ $this->db->sql_return_on_error(true);
+
+ $table_prefix = $this->config->get('table_prefix');
+ $dbms = $this->config->get('dbms');
+ $dbms_info = $this->database_helper->get_available_dbms($dbms);
+
+ // Get schema data from file
+ $sql_query = @file_get_contents($this->phpbb_root_path . 'install/schemas/schema_data.sql');
+
+ // Clean up SQL
+ $sql_query = $this->replace_dbms_specific_sql($sql_query);
+ $sql_query = preg_replace('# phpbb_([^\s]*) #i', ' ' . $table_prefix . '\1 ', $sql_query);
+ $sql_query = preg_replace_callback('#\{L_([A-Z0-9\-_]*)\}#s', array($this, 'lang_replace_callback'), $sql_query);
+ $sql_query = $this->database_helper->remove_comments($sql_query);
+ $sql_query = $this->database_helper->split_sql_file($sql_query, $dbms_info[$dbms]['DELIM']);
+
+ foreach ($sql_query as $sql)
+ {
+ if (!$this->db->sql_query($sql))
+ {
+ $error = $this->db->sql_error($this->db->get_sql_error_sql());
+ $this->iohandler->add_error_message('INST_ERR_DB', $error['message']);
+ }
+ }
+ }
+
+ /**
+ * Process DB specific SQL
+ *
+ * @return string
+ */
+ protected function replace_dbms_specific_sql($query)
+ {
+ if ($this->db instanceof \phpbb\db\driver\mssql_base || $this->db instanceof \phpbb\db\driver\mssql)
+ {
+ $query = preg_replace('#\# MSSQL IDENTITY (phpbb_[a-z_]+) (ON|OFF) \##s', 'SET IDENTITY_INSERT \1 \2;', $query);
+ }
+ else if ($this->db instanceof \phpbb\db\driver\postgres)
+ {
+ $query = preg_replace('#\# POSTGRES (BEGIN|COMMIT) \##s', '\1; ', $query);
+ }
+ else if ($this->db instanceof \phpbb\db\driver\mysql_base)
+ {
+ $query = str_replace('\\', '\\\\', $query);
+ }
+
+ return $query;
+ }
+
+ /**
+ * Callback function for language replacing
+ *
+ * @param array $matches
+ * @return string
+ */
+ public function lang_replace_callback($matches)
+ {
+ if (!empty($matches[1]))
+ {
+ return $this->db->sql_escape($this->language->lang($matches[1]));
+ }
+
+ return '';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ static public function get_step_count()
+ {
+ return 1;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_task_lang_name()
+ {
+ return 'TASK_ADD_DEFAULT_DATA';
+ }
+}
diff --git a/phpBB/phpbb/install/module/install_database/task/create_schema.php b/phpBB/phpbb/install/module/install_database/task/create_schema.php
new file mode 100644
index 0000000000..7cc521eee8
--- /dev/null
+++ b/phpBB/phpbb/install/module/install_database/task/create_schema.php
@@ -0,0 +1,214 @@
+<?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\install\module\install_database\task;
+
+/**
+ * Create database schema
+ */
+class create_schema extends \phpbb\install\task_base
+{
+ /**
+ * @var \phpbb\install\helper\config
+ */
+ protected $config;
+
+ /**
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * @var \phpbb\db\tools\tools_interface
+ */
+ protected $db_tools;
+
+ /**
+ * @var \phpbb\install\helper\database
+ */
+ protected $database_helper;
+
+ /**
+ * @var \phpbb\filesystem\filesystem_interface
+ */
+ protected $filesystem;
+
+ /**
+ * @var \phpbb\install\helper\iohandler\iohandler_interface
+ */
+ protected $iohandler;
+
+ /**
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\install\helper\config $config Installer's config provider
+ * @param \phpbb\install\helper\database $db_helper Installer's database helper
+ * @param \phpbb\filesystem\filesystem_interface $filesystem Filesystem service
+ * @param \phpbb\install\helper\iohandler\iohandler_interface $iohandler Installer's input-output handler
+ * @param string $phpbb_root_path Path phpBB's root
+ * @param string $php_ext Extension of PHP files
+ */
+ public function __construct(\phpbb\install\helper\config $config,
+ \phpbb\install\helper\database $db_helper,
+ \phpbb\filesystem\filesystem_interface $filesystem,
+ \phpbb\install\helper\iohandler\iohandler_interface $iohandler,
+ $phpbb_root_path,
+ $php_ext)
+ {
+ $dbms = $db_helper->get_available_dbms($config->get('dbms'));
+ $dbms = $dbms[$config->get('dbms')]['DRIVER'];
+ $factory = new \phpbb\db\tools\factory();
+
+ $this->db = new $dbms();
+ $this->config = $config;
+ $this->db_tools = $factory->get($this->db);
+ $this->database_helper = $db_helper;
+ $this->filesystem = $filesystem;
+ $this->iohandler = $iohandler;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+
+ parent::__construct(true);
+
+ // Connect to DB
+ $this->db->sql_connect($config->get('dbhost'), $config->get('dbuser'), $config->get('dbpasswd'), $config->get('dbname'), $config->get('dbport'), false, false);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function run()
+ {
+ $this->db->sql_return_on_error(true);
+
+ $dbms = $this->config->get('dbms');
+ $dbms_info = $this->database_helper->get_available_dbms($dbms);
+ $schema_name = $dbms_info[$dbms]['SCHEMA'];
+ $delimiter = $dbms_info[$dbms]['DELIM'];
+ $table_prefix = $this->config->get('table_prefix');
+
+ if ($dbms === 'mysql')
+ {
+ if (version_compare($this->db->sql_server_info(true), '4.1.3', '>='))
+ {
+ $schema_name .= '_41';
+ }
+ else
+ {
+ $schema_name .= '_40';
+ }
+ }
+
+ $db_schema_path = $this->phpbb_root_path . 'install/schemas/' . $schema_name . '_schema.sql';
+
+ // Load database vendor specific code if there is any
+ if ($this->filesystem->exists($db_schema_path))
+ {
+ $sql_query = @file_get_contents($db_schema_path);
+ $sql_query = preg_replace('#phpbb_#i', $table_prefix, $sql_query);
+ $sql_query = $this->database_helper->remove_comments($sql_query);
+ $sql_query = $this->database_helper->split_sql_file($sql_query, $delimiter);
+
+ foreach ($sql_query as $sql)
+ {
+ if (!$this->db->sql_query($sql))
+ {
+ $error = $this->db->sql_error($this->db->get_sql_error_sql());
+ $this->iohandler->add_error_message('INST_ERR_DB', $error['message']);
+ }
+ }
+
+ unset($sql_query);
+ }
+
+ $change_prefix = false;
+
+ // Generate database schema
+ if ($this->filesystem->exists($this->phpbb_root_path . 'install/schemas/schema.json'))
+ {
+ $db_table_schema = @file_get_contents($this->phpbb_root_path . 'install/schemas/schema.json');
+ $db_table_schema = json_decode($db_table_schema, true);
+ $change_prefix = true;
+ }
+ else
+ {
+ global $table_prefix;
+
+ $table_prefix = $this->config->get('table_prefix');
+
+ 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 ($this->phpbb_root_path . 'includes/constants.' . $this->php_ext);
+ }
+
+ $finder = new \phpbb\finder($this->filesystem, $this->phpbb_root_path, null, $this->php_ext);
+ $migrator_classes = $finder->core_path('phpbb/db/migration/data/')->get_classes();
+ $factory = new \phpbb\db\tools\factory();
+ $db_tools = $factory->get($this->db, true);
+ $schema_generator = new \phpbb\db\migration\schema_generator(
+ $migrator_classes,
+ new \phpbb\config\config(array()),
+ $this->db,
+ $db_tools,
+ $this->phpbb_root_path,
+ $this->php_ext,
+ $table_prefix
+ );
+ $db_table_schema = $schema_generator->get_schema();
+ }
+
+ if (!defined('CONFIG_TABLE'))
+ {
+ // CONFIG_TABLE is required by sql_create_index() to check the
+ // length of index names. However table_prefix is not defined
+ // here yet, so we need to create the constant ourselves.
+ define('CONFIG_TABLE', $table_prefix . 'config');
+ }
+
+ foreach ($db_table_schema as $table_name => $table_data)
+ {
+ $this->db_tools->sql_create_table(
+ ( ($change_prefix) ? ($table_prefix . substr($table_name, 6)) : $table_name ),
+ $table_data
+ );
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ static public function get_step_count()
+ {
+ return 1;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_task_lang_name()
+ {
+ return 'TASK_CREATE_DATABASE_SCHEMA';
+ }
+}
diff --git a/phpBB/phpbb/install/module/install_filesystem/module.php b/phpBB/phpbb/install/module/install_filesystem/module.php
new file mode 100644
index 0000000000..7215449664
--- /dev/null
+++ b/phpBB/phpbb/install/module/install_filesystem/module.php
@@ -0,0 +1,28 @@
+<?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\install\module\install_filesystem;
+
+/**
+ * Installer module for filesystem installation
+ */
+class module extends \phpbb\install\module_base
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function get_navigation_stage_path()
+ {
+ return array('install', 0, 'install');
+ }
+}
diff --git a/phpBB/phpbb/install/module/install_filesystem/task/create_config_file.php b/phpBB/phpbb/install/module/install_filesystem/task/create_config_file.php
new file mode 100644
index 0000000000..337d401216
--- /dev/null
+++ b/phpBB/phpbb/install/module/install_filesystem/task/create_config_file.php
@@ -0,0 +1,235 @@
+<?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\install\module\install_filesystem\task;
+
+use phpbb\install\exception\user_interaction_required_exception;
+
+/**
+ * Dumps config file
+ */
+class create_config_file extends \phpbb\install\task_base
+{
+ /**
+ * @var \phpbb\filesystem\filesystem_interface
+ */
+ protected $filesystem;
+
+ /**
+ * @var \phpbb\install\helper\database
+ */
+ protected $db_helper;
+
+ /**
+ * @var \phpbb\install\helper\config
+ */
+ protected $install_config;
+
+ /**
+ * @var \phpbb\install\helper\iohandler\iohandler_interface
+ */
+ protected $iohandler;
+
+ /**
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\filesystem\filesystem_interface $filesystem
+ * @param \phpbb\install\helper\config $install_config
+ * @param \phpbb\install\helper\database $db_helper
+ * @param \phpbb\install\helper\iohandler\iohandler_interface $iohandler
+ * @param string $phpbb_root_path
+ * @param string $php_ext
+ */
+ public function __construct(\phpbb\filesystem\filesystem_interface $filesystem,
+ \phpbb\install\helper\config $install_config,
+ \phpbb\install\helper\database $db_helper,
+ \phpbb\install\helper\iohandler\iohandler_interface $iohandler,
+ $phpbb_root_path,
+ $php_ext)
+ {
+ $this->install_config = $install_config;
+ $this->db_helper = $db_helper;
+ $this->filesystem = $filesystem;
+ $this->iohandler = $iohandler;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+
+ parent::__construct(true);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function run()
+ {
+ $config_written = true;
+
+ // Create config.php
+ $path_to_config = $this->phpbb_root_path . 'config.' . $this->php_ext;
+
+ $fp = @fopen($path_to_config, 'w');
+ if (!$fp)
+ {
+ $config_written = false;
+ }
+
+ $config_content = $this->get_config_data();
+
+ if (!@fwrite($fp, $config_content))
+ {
+ $config_written = false;
+ }
+
+ @fclose($fp);
+
+ // chmod config.php to be only readable
+ if ($config_written)
+ {
+ try
+ {
+ $this->filesystem->phpbb_chmod($path_to_config, \phpbb\filesystem\filesystem_interface::CHMOD_READ);
+ }
+ catch (\phpbb\filesystem\exception\filesystem_exception $e)
+ {
+ // Do nothing, the user will get a notice later
+ }
+ }
+ else
+ {
+ $this->iohandler->add_error_message('UNABLE_TO_WRITE_CONFIG_FILE');
+ $this->iohandler->send_response();
+ throw new user_interaction_required_exception();
+ }
+
+ // Create a lock file to indicate that there is an install in progress
+ $fp = @fopen($this->phpbb_root_path . 'cache/install_lock', 'wb');
+ if ($fp === false)
+ {
+ // We were unable to create the lock file - abort
+ $this->iohandler->add_error_message('UNABLE_TO_WRITE_LOCK');
+ $this->iohandler->send_response();
+ throw new user_interaction_required_exception();
+ }
+ @fclose($fp);
+
+ try
+ {
+ $this->filesystem->phpbb_chmod($this->phpbb_root_path . 'cache/install_lock', 0777);
+ }
+ catch (\phpbb\filesystem\exception\filesystem_exception $e)
+ {
+ // Do nothing, the user will get a notice later
+ }
+ }
+
+ /**
+ * Returns the content which should be dumped to config.php
+ *
+ * @param bool $debug If the debug constants should be enabled by default or not
+ * @param bool $debug_container If the container should be compiled on
+ * every page load or not
+ * @param bool $debug_test If the DEBUG_TEST constant should be added
+ * NOTE: Only for use within the testing framework
+ *
+ * @return string content to be written to the config file
+ */
+ protected function get_config_data($debug = false, $debug_container = false, $debug_test = false)
+ {
+ $config_content = "<?php\n";
+ $config_content .= "// phpBB 3.2.x auto-generated configuration file\n// Do not change anything in this file!\n";
+
+ $dbms = $this->install_config->get('dbms');
+ $db_driver = $this->db_helper->get_available_dbms($dbms);
+ $db_driver = $db_driver[$dbms]['DRIVER'];
+
+ $config_data_array = array(
+ 'dbms' => $db_driver,
+ 'dbhost' => $this->install_config->get('dbhost'),
+ 'dbport' => $this->install_config->get('dbport'),
+ 'dbname' => $this->install_config->get('dbname'),
+ 'dbuser' => $this->install_config->get('dbuser'),
+ 'dbpasswd' => $this->install_config->get('dbpasswd'),
+ 'table_prefix' => $this->install_config->get('table_prefix'),
+
+ 'phpbb_adm_relative_path' => 'adm/',
+
+ 'acm_type' => 'phpbb\cache\driver\file',
+ );
+
+ foreach ($config_data_array as $key => $value)
+ {
+ $config_content .= "\${$key} = '" . str_replace("'", "\\'", str_replace('\\', '\\\\', $value)) . "';\n";
+ }
+
+ $config_content .= "\n@define('PHPBB_INSTALLED', true);\n";
+ $config_content .= "// @define('PHPBB_DISPLAY_LOAD_TIME', true);\n";
+
+ if ($debug_test)
+ {
+ $config_content .= "@define('PHPBB_ENVIRONMENT', 'test');\n";
+ }
+ else if ($debug)
+ {
+ $config_content .= "@define('PHPBB_ENVIRONMENT', 'development');\n";
+ }
+ else
+ {
+ $config_content .= "@define('PHPBB_ENVIRONMENT', 'production');\n";
+ }
+
+ if ($debug_container)
+ {
+ $config_content .= "@define('DEBUG_CONTAINER', true);\n";
+ }
+ else
+ {
+ $config_content .= "// @define('DEBUG_CONTAINER', true);\n";
+ }
+
+ if ($debug_test)
+ {
+ $config_content .= "@define('DEBUG_TEST', true);\n";
+
+ // Mandatory for the functional tests, will be removed by PHPBB3-12623
+ $config_content .= "@define('DEBUG', true);\n";
+ }
+
+ return $config_content;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ static public function get_step_count()
+ {
+ return 1;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_task_lang_name()
+ {
+ return 'TASK_CREATE_CONFIG_FILE';
+ }
+}
diff --git a/phpBB/phpbb/install/module/install_finish/module.php b/phpBB/phpbb/install/module/install_finish/module.php
new file mode 100644
index 0000000000..3a7544b84f
--- /dev/null
+++ b/phpBB/phpbb/install/module/install_finish/module.php
@@ -0,0 +1,28 @@
+<?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\install\module\install_finish;
+
+/**
+ * Installer module for filesystem installation
+ */
+class module extends \phpbb\install\module_base
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function get_navigation_stage_path()
+ {
+ return array('install', 0, 'install');
+ }
+}
diff --git a/phpBB/phpbb/install/module/install_finish/task/notify_user.php b/phpBB/phpbb/install/module/install_finish/task/notify_user.php
new file mode 100644
index 0000000000..0af76f6f60
--- /dev/null
+++ b/phpBB/phpbb/install/module/install_finish/task/notify_user.php
@@ -0,0 +1,157 @@
+<?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\install\module\install_finish\task;
+
+use phpbb\config\db;
+
+/**
+ * Logs installation and sends an email to the admin
+ */
+class notify_user extends \phpbb\install\task_base
+{
+ /**
+ * @var \phpbb\install\helper\config
+ */
+ protected $install_config;
+
+ /**
+ * @var \phpbb\install\helper\iohandler\iohandler_interface
+ */
+ protected $iohandler;
+
+ /**
+ * @var \phpbb\auth\auth
+ */
+ protected $auth;
+
+ /**
+ * @var \phpbb\config\db
+ */
+ protected $config;
+
+ /**
+ * @var \phpbb\log\log_interface
+ */
+ protected $log;
+
+ /**
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\install\helper\container_factory $container
+ * @param \phpbb\install\helper\config $install_config
+ * @param \phpbb\install\helper\iohandler\iohandler_interface $iohandler
+ * @param string $phpbb_root_path
+ * @param string $php_ext
+ */
+ public function __construct(\phpbb\install\helper\container_factory $container, \phpbb\install\helper\config $install_config, \phpbb\install\helper\iohandler\iohandler_interface $iohandler, $phpbb_root_path, $php_ext)
+ {
+ $this->install_config = $install_config;
+ $this->iohandler = $iohandler;
+
+ $this->auth = $container->get('auth');
+ $this->log = $container->get('log');
+ $this->user = $container->get('user');
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+
+ // We need to reload config for cases when it doesn't have all values
+ $this->config = new db(
+ $container->get('dbal.conn'),
+ $container->get('cache.driver'),
+ $container->get_parameter('tables.config')
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function run()
+ {
+ $this->user->session_begin();
+ $this->user->setup('common');
+
+ if ($this->config['email_enable'])
+ {
+ include ($this->phpbb_root_path . 'includes/functions_messenger.' . $this->php_ext);
+
+ $messenger = new \messenger(false);
+ $messenger->template('installed', $this->install_config->get('language'));
+ $messenger->to($this->config['board_email'], $this->install_config->get('admin_name'));
+ $messenger->anti_abuse_headers($this->config, $this->user);
+ $messenger->assign_vars(array(
+ 'USERNAME' => htmlspecialchars_decode($this->install_config->get('admin_name')),
+ 'PASSWORD' => htmlspecialchars_decode($this->install_config->get('admin_passwd')))
+ );
+ $messenger->send(NOTIFY_EMAIL);
+ }
+
+ // Login admin
+ // Ugly but works
+ $this->auth->login(
+ $this->install_config->get('admin_name'),
+ $this->install_config->get('admin_passwd'),
+ false,
+ true,
+ true
+ );
+
+ $this->iohandler->set_cookie($this->config['cookie_name'] . '_sid', $this->user->session_id);
+ $this->iohandler->set_cookie($this->config['cookie_name'] . '_u', $this->user->cookie_data['u']);
+ $this->iohandler->set_cookie($this->config['cookie_name'] . '_k', $this->user->cookie_data['k']);
+
+ // Create log
+ $this->log->add(
+ 'admin',
+ $this->user->data['user_id'],
+ $this->user->ip,
+ 'LOG_INSTALL_INSTALLED',
+ false,
+ array($this->config['version'])
+ );
+
+ // Remove install_lock
+ @unlink($this->phpbb_root_path . 'cache/install_lock');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ static public function get_step_count()
+ {
+ return 1;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_task_lang_name()
+ {
+ return 'TASK_NOTIFY_USER';
+ }
+}
diff --git a/phpBB/phpbb/install/module/install_finish/task/populate_migrations.php b/phpBB/phpbb/install/module/install_finish/task/populate_migrations.php
new file mode 100644
index 0000000000..b2a4800f86
--- /dev/null
+++ b/phpBB/phpbb/install/module/install_finish/task/populate_migrations.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\install\module\install_finish\task;
+
+/**
+ * Populates migrations
+ */
+class populate_migrations extends \phpbb\install\task_base
+{
+ /**
+ * @var \phpbb\extension\manager
+ */
+ protected $extension_manager;
+
+ /**
+ * @var \phpbb\db\migrator
+ */
+ protected $migrator;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\install\helper\container_factory $container phpBB's DI contianer
+ */
+ public function __construct(\phpbb\install\helper\container_factory $container)
+ {
+ $this->extension_manager = $container->get('ext.manager');
+ $this->migrator = $container->get('migrator');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function run()
+ {
+ $finder = $this->extension_manager->get_finder();
+
+ $migrations = $finder
+ ->core_path('phpbb/db/migration/data/')
+ ->get_classes();
+ $this->migrator->populate_migrations($migrations);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ static public function get_step_count()
+ {
+ return 1;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_task_lang_name()
+ {
+ return 'TASK_POPULATE_MIGRATIONS';
+ }
+}
diff --git a/phpBB/phpbb/install/module/obtain_data/module.php b/phpBB/phpbb/install/module/obtain_data/module.php
new file mode 100644
index 0000000000..0e008796c5
--- /dev/null
+++ b/phpBB/phpbb/install/module/obtain_data/module.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\install\module\obtain_data;
+
+class module extends \phpbb\install\module_base
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function get_navigation_stage_path()
+ {
+ return array('install', 0, 'obtain_data');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_step_count()
+ {
+ return 0;
+ }
+}
diff --git a/phpBB/phpbb/install/module/obtain_data/task/obtain_admin_data.php b/phpBB/phpbb/install/module/obtain_data/task/obtain_admin_data.php
new file mode 100644
index 0000000000..b2250e524b
--- /dev/null
+++ b/phpBB/phpbb/install/module/obtain_data/task/obtain_admin_data.php
@@ -0,0 +1,219 @@
+<?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\install\module\obtain_data\task;
+
+use phpbb\install\exception\user_interaction_required_exception;
+
+/**
+ * This class requests and validates admin account data from the user
+ */
+class obtain_admin_data extends \phpbb\install\task_base implements \phpbb\install\task_interface
+{
+ /**
+ * @var \phpbb\install\helper\config
+ */
+ protected $install_config;
+
+ /**
+ * @var \phpbb\install\helper\iohandler\iohandler_interface
+ */
+ protected $io_handler;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\install\helper\config $install_config Installer's config helper
+ * @param \phpbb\install\helper\iohandler\iohandler_interface $iohandler Installer's input-output handler
+ */
+ public function __construct(\phpbb\install\helper\config $install_config,
+ \phpbb\install\helper\iohandler\iohandler_interface $iohandler)
+ {
+ $this->install_config = $install_config;
+ $this->io_handler = $iohandler;
+
+ parent::__construct(true);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function run()
+ {
+ // Check if data is sent
+ if ($this->io_handler->get_input('submit_admin', false))
+ {
+ $this->process_form();
+ }
+ else
+ {
+ $this->request_form_data();
+ }
+ }
+
+ /**
+ * Process form data
+ */
+ protected function process_form()
+ {
+ // Admin data
+ $admin_name = $this->io_handler->get_input('admin_name', '', true);
+ $admin_pass1 = $this->io_handler->get_input('admin_pass1', '', true);
+ $admin_pass2 = $this->io_handler->get_input('admin_pass2', '', true);
+ $board_email = $this->io_handler->get_input('board_email', '');
+
+ $admin_data_valid = $this->check_admin_data($admin_name, $admin_pass1, $admin_pass2, $board_email);
+
+ if ($admin_data_valid)
+ {
+ $this->install_config->set('admin_name', $admin_name);
+ $this->install_config->set('admin_passwd', $admin_pass1);
+ $this->install_config->set('board_email', $board_email);
+ }
+ else
+ {
+ $this->request_form_data(true);
+ }
+ }
+
+ /**
+ * Request data from the user
+ *
+ * @param bool $use_request_data Whether to use submited data
+ *
+ * @throws \phpbb\install\exception\user_interaction_required_exception When the user is required to provide data
+ */
+ protected function request_form_data($use_request_data = false)
+ {
+ if ($use_request_data)
+ {
+ $admin_username = $this->io_handler->get_input('admin_name', '', true);
+ $admin_email = $this->io_handler->get_input('board_email', '', true);
+ }
+ else
+ {
+ $admin_username = '';
+ $admin_email = '';
+ }
+
+ $admin_form = array(
+ 'admin_name' => array(
+ 'label' => 'ADMIN_USERNAME',
+ 'description' => 'ADMIN_USERNAME_EXPLAIN',
+ 'type' => 'text',
+ 'default' => $admin_username,
+ ),
+ 'board_email' => array(
+ 'label' => 'CONTACT_EMAIL',
+ 'type' => 'email',
+ 'default' => $admin_email,
+ ),
+ 'admin_pass1' => array(
+ 'label' => 'ADMIN_PASSWORD',
+ 'description' => 'ADMIN_PASSWORD_EXPLAIN',
+ 'type' => 'password',
+ ),
+ 'admin_pass2' => array(
+ 'label' => 'ADMIN_PASSWORD_CONFIRM',
+ 'type' => 'password',
+ ),
+ 'submit_admin' => array(
+ 'label' => 'SUBMIT',
+ 'type' => 'submit',
+ ),
+ );
+
+ $this->io_handler->add_user_form_group('ADMIN_CONFIG', $admin_form);
+
+ // Require user interaction
+ $this->io_handler->send_response();
+ throw new user_interaction_required_exception();
+ }
+
+ /**
+ * Check admin data
+ *
+ * @param string $username Admin username
+ * @param string $pass1 Admin password
+ * @param string $pass2 Admin password confirmation
+ * @param string $email Admin e-mail address
+ *
+ * @return bool True if data is valid, false otherwise
+ */
+ protected function check_admin_data($username, $pass1, $pass2, $email)
+ {
+ $data_valid = true;
+
+ // Check if none of admin data is empty
+ if (in_array('', array($username, $pass1, $pass2, $email)))
+ {
+ $this->io_handler->add_error_message('INST_ERR_MISSING_DATA');
+ $data_valid = false;
+ }
+
+ if (utf8_strlen($username) < 3)
+ {
+ $this->io_handler->add_error_message('INST_ERR_USER_TOO_SHORT');
+ $data_valid = false;
+ }
+
+ if (utf8_strlen($username) > 20)
+ {
+ $this->io_handler->add_error_message('INST_ERR_USER_TOO_LONG');
+ $data_valid = false;
+ }
+
+ if ($pass1 !== $pass2 && $pass1 !== '')
+ {
+ $this->io_handler->add_error_message('INST_ERR_PASSWORD_MISMATCH');
+ $data_valid = false;
+ }
+
+ // Test against the default password rules
+ if (utf8_strlen($pass1) < 6)
+ {
+ $this->io_handler->add_error_message('INST_ERR_PASSWORD_TOO_SHORT');
+ $data_valid = false;
+ }
+
+ if (utf8_strlen($pass1) > 30)
+ {
+ $this->io_handler->add_error_message('INST_ERR_PASSWORD_TOO_LONG');
+ $data_valid = false;
+ }
+
+ if (!preg_match('/^' . get_preg_expression('email') . '$/i', $email))
+ {
+ $this->io_handler->add_error_message('INST_ERR_EMAIL_INVALID');
+ $data_valid = false;
+ }
+
+ return $data_valid;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ static public function get_step_count()
+ {
+ return 0;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_task_lang_name()
+ {
+ return '';
+ }
+}
diff --git a/phpBB/phpbb/install/module/obtain_data/task/obtain_board_data.php b/phpBB/phpbb/install/module/obtain_data/task/obtain_board_data.php
new file mode 100644
index 0000000000..821c221123
--- /dev/null
+++ b/phpBB/phpbb/install/module/obtain_data/task/obtain_board_data.php
@@ -0,0 +1,186 @@
+<?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\install\module\obtain_data\task;
+
+use phpbb\install\exception\user_interaction_required_exception;
+
+/**
+ * This class obtains default data from the user related to board (Board name, Board descritpion, etc...)
+ */
+class obtain_board_data extends \phpbb\install\task_base implements \phpbb\install\task_interface
+{
+ /**
+ * @var \phpbb\install\helper\config
+ */
+ protected $install_config;
+
+ /**
+ * @var \phpbb\install\helper\iohandler\iohandler_interface
+ */
+ protected $io_handler;
+
+ /**
+ * @var \phpbb\language\language_file_helper
+ */
+ protected $language_helper;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\install\helper\config $config Installer's config
+ * @param \phpbb\install\helper\iohandler\iohandler_interface $iohandler Installer's input-output handler
+ * @param \phpbb\language\language_file_helper $lang_helper Language file helper
+ */
+ public function __construct(\phpbb\install\helper\config $config,
+ \phpbb\install\helper\iohandler\iohandler_interface $iohandler,
+ \phpbb\language\language_file_helper $lang_helper)
+ {
+ $this->install_config = $config;
+ $this->io_handler = $iohandler;
+ $this->language_helper = $lang_helper;
+
+ parent::__construct(true);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function run()
+ {
+ // Check if data is sent
+ if ($this->io_handler->get_input('submit_board', false))
+ {
+ $this->process_form();
+ }
+ else
+ {
+ $this->request_form_data();
+ }
+ }
+
+ /**
+ * Process form data
+ */
+ protected function process_form()
+ {
+ // Board data
+ $default_lang = $this->io_handler->get_input('default_lang', '');
+ $board_name = $this->io_handler->get_input('board_name', '');
+ $board_desc = $this->io_handler->get_input('board_description', '');
+
+ // Check default lang
+ $langs = $this->language_helper->get_available_languages();
+ $lang_valid = false;
+
+ foreach ($langs as $lang)
+ {
+ if ($lang['iso'] === $default_lang)
+ {
+ $lang_valid = true;
+ break;
+ }
+ }
+
+ $this->install_config->set('board_name', $board_name);
+ $this->install_config->set('board_description', $board_desc);
+
+ if ($lang_valid)
+ {
+ $this->install_config->set('default_lang', $default_lang);
+ }
+ else
+ {
+ $this->request_form_data(true);
+ }
+ }
+
+ /**
+ * Request data from the user
+ *
+ * @param bool $use_request_data Whether to use submited data
+ *
+ * @throws \phpbb\install\exception\user_interaction_required_exception When the user is required to provide data
+ */
+ protected function request_form_data($use_request_data = false)
+ {
+ if ($use_request_data)
+ {
+ $board_name = $this->io_handler->get_input('board_name', '');
+ $board_desc = $this->io_handler->get_input('board_description', '');
+ }
+ else
+ {
+ $board_name = '{L_CONFIG_SITENAME}';
+ $board_desc = '{L_CONFIG_SITE_DESC}';
+ }
+
+ // Use language because we only check this to be valid
+ $default_lang = $this->install_config->get('language', '');
+
+ $langs = $this->language_helper->get_available_languages();
+ $lang_options = array();
+
+ foreach ($langs as $lang)
+ {
+ $lang_options[] = array(
+ 'value' => $lang['iso'],
+ 'label' => $lang['local_name'],
+ 'selected' => ($default_lang === $lang['iso']),
+ );
+ }
+
+ $board_form = array(
+ 'default_lang' => array(
+ 'label' => 'DEFAULT_LANGUAGE',
+ 'type' => 'select',
+ 'options' => $lang_options,
+ ),
+ 'board_name' => array(
+ 'label' => 'BOARD_NAME',
+ 'type' => 'text',
+ 'default' => $board_name,
+ ),
+ 'board_description' => array(
+ 'label' => 'BOARD_DESCRIPTION',
+ 'type' => 'text',
+ 'default' => $board_desc,
+ ),
+ 'submit_board' => array(
+ 'label' => 'SUBMIT',
+ 'type' => 'submit',
+ ),
+ );
+
+ $this->io_handler->add_user_form_group('BOARD_CONFIG', $board_form);
+
+ $this->io_handler->send_response();
+ throw new user_interaction_required_exception;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ static public function get_step_count()
+ {
+ return 0;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_task_lang_name()
+ {
+ return '';
+ }
+}
diff --git a/phpBB/phpbb/install/module/obtain_data/task/obtain_database_data.php b/phpBB/phpbb/install/module/obtain_data/task/obtain_database_data.php
new file mode 100644
index 0000000000..f0e7f1f686
--- /dev/null
+++ b/phpBB/phpbb/install/module/obtain_data/task/obtain_database_data.php
@@ -0,0 +1,271 @@
+<?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\install\module\obtain_data\task;
+
+use phpbb\install\exception\user_interaction_required_exception;
+
+/**
+ * This class requests and validates database information from the user
+ */
+class obtain_database_data extends \phpbb\install\task_base implements \phpbb\install\task_interface
+{
+ /**
+ * @var \phpbb\install\helper\database
+ */
+ protected $database_helper;
+
+ /**
+ * @var \phpbb\install\helper\config
+ */
+ protected $install_config;
+
+ /**
+ * @var \phpbb\install\helper\iohandler\iohandler_interface
+ */
+ protected $io_handler;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\install\helper\database $database_helper Installer's database helper
+ * @param \phpbb\install\helper\config $install_config Installer's config helper
+ * @param \phpbb\install\helper\iohandler\iohandler_interface $iohandler Installer's input-output handler
+ */
+ public function __construct(\phpbb\install\helper\database $database_helper,
+ \phpbb\install\helper\config $install_config,
+ \phpbb\install\helper\iohandler\iohandler_interface $iohandler)
+ {
+ $this->database_helper = $database_helper;
+ $this->install_config = $install_config;
+ $this->io_handler = $iohandler;
+
+ parent::__construct(true);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function run()
+ {
+ // Check if data is sent
+ if ($this->io_handler->get_input('submit_database', false))
+ {
+ $this->process_form();
+ }
+ else
+ {
+ $this->request_form_data();
+ }
+ }
+
+ /**
+ * Process form data
+ */
+ protected function process_form()
+ {
+ // Collect database data
+ $dbms = $this->io_handler->get_input('dbms', '');
+ $dbhost = $this->io_handler->get_input('dbhost', '');
+ $dbport = $this->io_handler->get_input('dbport', '');
+ $dbuser = $this->io_handler->get_input('dbuser', '');
+ $dbpasswd = $this->io_handler->get_input('dbpasswd', '', true);
+ $dbname = $this->io_handler->get_input('dbname', '');
+ $table_prefix = $this->io_handler->get_input('table_prefix', '');
+
+ // Check database data
+ $user_data_vaild = $this->check_database_data($dbms, $dbhost, $dbport, $dbuser, $dbpasswd, $dbname, $table_prefix);
+
+ // Save database data if it is correct
+ if ($user_data_vaild)
+ {
+ $this->install_config->set('dbms', $dbms);
+ $this->install_config->set('dbhost', $dbhost);
+ $this->install_config->set('dbport', $dbport);
+ $this->install_config->set('dbuser', $dbuser);
+ $this->install_config->set('dbpasswd', $dbpasswd);
+ $this->install_config->set('dbname', $dbname);
+ $this->install_config->set('table_prefix', $table_prefix);
+ }
+ else
+ {
+ $this->request_form_data(true);
+ }
+ }
+
+ /**
+ * Request data from the user
+ *
+ * @param bool $use_request_data Whether to use submited data
+ *
+ * @throws \phpbb\install\exception\user_interaction_required_exception When the user is required to provide data
+ */
+ protected function request_form_data($use_request_data = false)
+ {
+ if ($use_request_data)
+ {
+ $dbms = $this->io_handler->get_input('dbms', '');
+ $dbhost = $this->io_handler->get_input('dbhost', '');
+ $dbport = $this->io_handler->get_input('dbport', '');
+ $dbuser = $this->io_handler->get_input('dbuser', '');
+ $dbname = $this->io_handler->get_input('dbname', '');
+ $table_prefix = $this->io_handler->get_input('table_prefix', 'phpbb_');
+ }
+ else
+ {
+ $dbms = '';
+ $dbhost = '';
+ $dbport = '';
+ $dbuser = '';
+ $dbname = '';
+ $table_prefix = 'phpbb_';
+ }
+
+ $dbms_select = array();
+ foreach ($this->database_helper->get_available_dbms() as $dbms_key => $dbms_array)
+ {
+ $dbms_select[] = array(
+ 'value' => $dbms_key,
+ 'label' => 'DB_OPTION_' . strtoupper($dbms_key),
+ 'selected' => ($dbms_key === $dbms),
+ );
+ }
+
+ $database_form = array(
+ 'dbms' => array(
+ 'label' => 'DBMS',
+ 'type' => 'select',
+ 'options' => $dbms_select,
+ ),
+ 'dbhost' => array(
+ 'label' => 'DB_HOST',
+ 'description' => 'DB_HOST_EXPLAIN',
+ 'type' => 'text',
+ 'default' => $dbhost,
+ ),
+ 'dbport' => array(
+ 'label' => 'DB_PORT',
+ 'description' => 'DB_PORT_EXPLAIN',
+ 'type' => 'text',
+ 'default' => $dbport,
+ ),
+ 'dbuser' => array(
+ 'label' => 'DB_USERNAME',
+ 'type' => 'text',
+ 'default' => $dbuser,
+ ),
+ 'dbpasswd' => array(
+ 'label' => 'DB_PASSWORD',
+ 'type' => 'password',
+ ),
+ 'dbname' => array(
+ 'label' => 'DB_NAME',
+ 'type' => 'text',
+ 'default' => $dbname,
+ ),
+ 'table_prefix' => array(
+ 'label' => 'TABLE_PREFIX',
+ 'description' => 'TABLE_PREFIX_EXPLAIN',
+ 'type' => 'text',
+ 'default' => $table_prefix,
+ ),
+ 'submit_database' => array(
+ 'label' => 'SUBMIT',
+ 'type' => 'submit',
+ ),
+ );
+
+ $this->io_handler->add_user_form_group('DB_CONFIG', $database_form);
+
+ // Require user interaction
+ $this->io_handler->send_response();
+ throw new user_interaction_required_exception();
+ }
+
+ /**
+ * Check database data
+ *
+ * @param string $dbms Selected database type
+ * @param string $dbhost Database host address
+ * @param int $dbport Database port number
+ * @param string $dbuser Database username
+ * @param string $dbpass Database password
+ * @param string $dbname Database name
+ * @param string $table_prefix Database table prefix
+ *
+ * @return bool True if database data is correct, false otherwise
+ */
+ protected function check_database_data($dbms, $dbhost, $dbport, $dbuser, $dbpass, $dbname, $table_prefix)
+ {
+ $available_dbms = $this->database_helper->get_available_dbms();
+ $data_valid = true;
+
+ // Check if PHP has the database extensions for the specified DBMS
+ if (!isset($available_dbms[$dbms]))
+ {
+ $this->io_handler->add_error_message('INST_ERR_NO_DB');
+ $data_valid = false;
+ }
+
+ // Validate table prefix
+ $prefix_valid = $this->database_helper->validate_table_prefix($dbms, $table_prefix);
+ if (is_array($prefix_valid))
+ {
+ foreach ($prefix_valid as $error)
+ {
+ $this->io_handler->add_error_message(
+ $error['title'],
+ (isset($error['description'])) ? $error['description'] : false
+ );
+ }
+
+ $data_valid = false;
+ }
+
+ // Try to connect to database if all provided data is valid
+ if ($data_valid)
+ {
+ $connect_test = $this->database_helper->check_database_connection($dbms, $dbhost, $dbport, $dbuser, $dbpass, $dbname, $table_prefix);
+ if (is_array($connect_test))
+ {
+ foreach ($connect_test as $error)
+ {
+ $this->io_handler->add_error_message(
+ $error['title'],
+ (isset($error['description'])) ? $error['description'] : false
+ );
+ }
+
+ $data_valid = false;
+ }
+ }
+
+ return $data_valid;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ static public function get_step_count()
+ {
+ return 0;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_task_lang_name()
+ {
+ return '';
+ }
+}
diff --git a/phpBB/phpbb/install/module/obtain_data/task/obtain_email_data.php b/phpBB/phpbb/install/module/obtain_data/task/obtain_email_data.php
new file mode 100644
index 0000000000..ae7526a9e3
--- /dev/null
+++ b/phpBB/phpbb/install/module/obtain_data/task/obtain_email_data.php
@@ -0,0 +1,167 @@
+<?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\install\module\obtain_data\task;
+
+use phpbb\install\exception\user_interaction_required_exception;
+
+class obtain_email_data extends \phpbb\install\task_base implements \phpbb\install\task_interface
+{
+ /**
+ * @var \phpbb\install\helper\config
+ */
+ protected $install_config;
+
+ /**
+ * @var \phpbb\install\helper\iohandler\iohandler_interface
+ */
+ protected $io_handler;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\install\helper\config $config Installer's config
+ * @param \phpbb\install\helper\iohandler\iohandler_interface $iohandler Installer's input-output handler
+ */
+ public function __construct(\phpbb\install\helper\config $config,
+ \phpbb\install\helper\iohandler\iohandler_interface $iohandler)
+ {
+ $this->install_config = $config;
+ $this->io_handler = $iohandler;
+
+ parent::__construct(true);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function run()
+ {
+ // E-mail data
+ $email_enable = $this->io_handler->get_input('email_enable', true);
+ $smtp_delivery = $this->io_handler->get_input('smtp_delivery', '');
+ $smtp_host = $this->io_handler->get_input('smtp_host', '');
+ $smtp_auth = $this->io_handler->get_input('smtp_auth', '');
+ $smtp_user = $this->io_handler->get_input('smtp_user', '');
+ $smtp_passwd = $this->io_handler->get_input('smtp_pass', '');
+
+ $auth_methods = array('PLAIN', 'LOGIN', 'CRAM-MD5', 'DIGEST-MD5', 'POP-BEFORE-SMTP');
+
+ // Check if data is sent
+ if ($this->io_handler->get_input('submit_email', false))
+ {
+ $this->install_config->set('email_enable', $email_enable);
+ $this->install_config->set('smtp_delivery', $smtp_delivery);
+ $this->install_config->set('smtp_host', $smtp_host);
+ $this->install_config->set('smtp_auth', $smtp_auth);
+ $this->install_config->set('smtp_user', $smtp_user);
+ $this->install_config->set('smtp_pass', $smtp_passwd);
+ }
+ else
+ {
+ $auth_options = array();
+ foreach ($auth_methods as $method)
+ {
+ $auth_options[] = array(
+ 'value' => $method,
+ 'label' => 'SMTP_' . str_replace('-', '_', $method),
+ 'selected' => false,
+ );
+ }
+
+ $email_form = array(
+ 'email_enable' => array(
+ 'label' => 'ENABLE_EMAIL',
+ 'description' => 'COOKIE_SECURE_EXPLAIN',
+ 'type' => 'radio',
+ 'options' => array(
+ array(
+ 'value' => 1,
+ 'label' => 'ENABLE',
+ 'selected' => true,
+ ),
+ array(
+ 'value' => 0,
+ 'label' => 'DISABLE',
+ 'selected' => false,
+ ),
+ ),
+ ),
+ 'smtp_delivery' => array(
+ 'label' => 'USE_SMTP',
+ 'description' => 'USE_SMTP_EXPLAIN',
+ 'type' => 'radio',
+ 'options' => array(
+ array(
+ 'value' => 0,
+ 'label' => 'NO',
+ 'selected' => true,
+ ),
+ array(
+ 'value' => 1,
+ 'label' => 'YES',
+ 'selected' => false,
+ ),
+ ),
+ ),
+ 'smtp_host' => array(
+ 'label' => 'SMTP_SERVER',
+ 'description' => 'SMTP_SERVER_EXPLAIN',
+ 'type' => 'text',
+ 'default' => $smtp_host,
+ ),
+ 'smtp_auth' => array(
+ 'label' => 'SMTP_AUTH_METHOD',
+ 'type' => 'select',
+ 'options' => $auth_options,
+ ),
+ 'smtp_user' => array(
+ 'label' => 'SMTP_USERNAME',
+ 'description' => 'SMTP_USERNAME_EXPLAIN',
+ 'type' => 'text',
+ 'default' => $smtp_user,
+ ),
+ 'smtp_pass' => array(
+ 'label' => 'SMTP_PASSWORD',
+ 'description' => 'SMTP_PASSWORD_EXPLAIN',
+ 'type' => 'password',
+ ),
+ 'submit_email' => array(
+ 'label' => 'SUBMIT',
+ 'type' => 'submit',
+ ),
+ );
+
+ $this->io_handler->add_user_form_group('EMAIL_CONFIG', $email_form);
+
+ $this->io_handler->send_response();
+ throw new user_interaction_required_exception();
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ static public function get_step_count()
+ {
+ return 0;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_task_lang_name()
+ {
+ return '';
+ }
+}
diff --git a/phpBB/phpbb/install/module/obtain_data/task/obtain_imagick_path.php b/phpBB/phpbb/install/module/obtain_data/task/obtain_imagick_path.php
new file mode 100644
index 0000000000..9f74b61770
--- /dev/null
+++ b/phpBB/phpbb/install/module/obtain_data/task/obtain_imagick_path.php
@@ -0,0 +1,89 @@
+<?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\install\module\obtain_data\task;
+
+class obtain_imagick_path extends \phpbb\install\task_base implements \phpbb\install\task_interface
+{
+ /**
+ * @var \phpbb\install\helper\config
+ */
+ protected $config;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\install\helper\config $config Installer's config
+ */
+ public function __construct(\phpbb\install\helper\config $config)
+ {
+ $this->config = $config;
+
+ parent::__construct(true);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function run()
+ {
+ // Can we find Imagemagick anywhere on the system?
+ $exe = (DIRECTORY_SEPARATOR == '\\') ? '.exe' : '';
+
+ $magic_home = getenv('MAGICK_HOME');
+ $img_imagick = '';
+ if (empty($magic_home))
+ {
+ $locations = array('C:/WINDOWS/', 'C:/WINNT/', 'C:/WINDOWS/SYSTEM/', 'C:/WINNT/SYSTEM/', 'C:/WINDOWS/SYSTEM32/', 'C:/WINNT/SYSTEM32/', '/usr/bin/', '/usr/sbin/', '/usr/local/bin/', '/usr/local/sbin/', '/opt/', '/usr/imagemagick/', '/usr/bin/imagemagick/');
+ $path_locations = str_replace('\\', '/', (explode(($exe) ? ';' : ':', getenv('PATH'))));
+
+ $locations = array_merge($path_locations, $locations);
+ foreach ($locations as $location)
+ {
+ // The path might not end properly, fudge it
+ if (substr($location, -1, 1) !== '/')
+ {
+ $location .= '/';
+ }
+
+ if (@file_exists($location) && @is_readable($location . 'mogrify' . $exe) && @filesize($location . 'mogrify' . $exe) > 3000)
+ {
+ $img_imagick = str_replace('\\', '/', $location);
+ continue;
+ }
+ }
+ }
+ else
+ {
+ $img_imagick = str_replace('\\', '/', $magic_home);
+ }
+
+ $this->config->set('img_imagick', $img_imagick);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ static public function get_step_count()
+ {
+ return 0;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_task_lang_name()
+ {
+ return '';
+ }
+}
diff --git a/phpBB/phpbb/install/module/obtain_data/task/obtain_server_data.php b/phpBB/phpbb/install/module/obtain_data/task/obtain_server_data.php
new file mode 100644
index 0000000000..654b5534a9
--- /dev/null
+++ b/phpBB/phpbb/install/module/obtain_data/task/obtain_server_data.php
@@ -0,0 +1,203 @@
+<?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\install\module\obtain_data\task;
+
+use phpbb\install\exception\user_interaction_required_exception;
+
+/**
+ * This class requests and saves some information about the server
+ */
+class obtain_server_data extends \phpbb\install\task_base implements \phpbb\install\task_interface
+{
+ /**
+ * @var \phpbb\install\helper\config
+ */
+ protected $install_config;
+
+ /**
+ * @var \phpbb\install\helper\iohandler\iohandler_interface
+ */
+ protected $io_handler;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\install\helper\config $config Installer's config
+ * @param \phpbb\install\helper\iohandler\iohandler_interface $iohandler Installer's input-output handler
+ */
+ public function __construct(\phpbb\install\helper\config $config,
+ \phpbb\install\helper\iohandler\iohandler_interface $iohandler)
+ {
+ $this->install_config = $config;
+ $this->io_handler = $iohandler;
+
+ parent::__construct(true);
+ }
+ /**
+ * {@inheritdoc}
+ */
+ public function run()
+ {
+ $cookie_secure = $this->io_handler->is_secure();
+ $server_protocol = ($this->io_handler->is_secure()) ? 'https://' : 'http://';
+ $server_port = $this->io_handler->get_server_variable('SERVER_PORT', 0);
+
+ // HTTP_HOST is having the correct browser url in most cases...
+ $server_name = strtolower(htmlspecialchars_decode($this->io_handler->get_header_variable(
+ 'Host',
+ $this->io_handler->get_server_variable('SERVER_NAME')
+ )));
+
+ // HTTP HOST can carry a port number...
+ if (strpos($server_name, ':') !== false)
+ {
+ $server_name = substr($server_name, 0, strpos($server_name, ':'));
+ }
+
+ $script_path = htmlspecialchars_decode($this->io_handler->get_server_variable('PHP_SELF'));
+
+ if (!$script_path)
+ {
+ $script_path = htmlspecialchars_decode($this->io_handler->get_server_variable('REQUEST_URI'));
+ }
+
+ $script_path = str_replace(array('\\', '//'), '/', $script_path);
+ $script_path = trim(dirname(dirname(dirname($script_path)))); // Because we are in install/app.php/route_name
+
+ // Server data
+ $cookie_secure = $this->io_handler->get_input('cookie_secure', $cookie_secure);
+ $server_protocol = $this->io_handler->get_input('server_protocol', $server_protocol);
+ $force_server_vars = $this->io_handler->get_input('force_server_vars', 0);
+ $server_name = $this->io_handler->get_input('server_name', $server_name);
+ $server_port = $this->io_handler->get_input('server_port', $server_port);
+ $script_path = $this->io_handler->get_input('script_path', $script_path);
+
+ // Clean up script path
+ if ($script_path !== '/')
+ {
+ // Adjust destination path (no trailing slash)
+ if (substr($script_path, -1) === '/')
+ {
+ $script_path = substr($script_path, 0, -1);
+ }
+
+ $script_path = str_replace(array('../', './'), '', $script_path);
+
+ if ($script_path[0] !== '/')
+ {
+ $script_path = '/' . $script_path;
+ }
+ }
+
+ // Check if data is sent
+ if ($this->io_handler->get_input('submit_server', false))
+ {
+ $this->install_config->set('cookie_secure', $cookie_secure);
+ $this->install_config->set('server_protocol', $server_protocol);
+ $this->install_config->set('force_server_vars', $force_server_vars);
+ $this->install_config->set('server_name', $server_name);
+ $this->install_config->set('server_port', $server_port);
+ $this->install_config->set('script_path', $script_path);
+ }
+ else
+ {
+ // Render form
+ $server_form = array(
+ 'cookie_secure' => array(
+ 'label' => 'COOKIE_SECURE',
+ 'description' => 'COOKIE_SECURE_EXPLAIN',
+ 'type' => 'radio',
+ 'options' => array(
+ array(
+ 'value' => 0,
+ 'label' => 'NO',
+ 'selected' => (!$cookie_secure),
+ ),
+ array(
+ 'value' => 1,
+ 'label' => 'YES',
+ 'selected' => ($cookie_secure),
+ ),
+ ),
+ ),
+ 'force_server_vars' => array(
+ 'label' => 'FORCE_SERVER_VARS',
+ 'description' => 'FORCE_SERVER_VARS_EXPLAIN',
+ 'type' => 'radio',
+ 'options' => array(
+ array(
+ 'value' => 0,
+ 'label' => 'NO',
+ 'selected' => true,
+ ),
+ array(
+ 'value' => 1,
+ 'label' => 'YES',
+ 'selected' => false,
+ ),
+ ),
+ ),
+ 'server_protocol' => array(
+ 'label' => 'SERVER_PROTOCOL',
+ 'description' => 'SERVER_PROTOCOL_EXPLAIN',
+ 'type' => 'text',
+ 'default' => $server_protocol,
+ ),
+ 'server_name' => array(
+ 'label' => 'SERVER_NAME',
+ 'description' => 'SERVER_NAME_EXPLAIN',
+ 'type' => 'text',
+ 'default' => $server_name,
+ ),
+ 'server_port' => array(
+ 'label' => 'SERVER_PORT',
+ 'description' => 'SERVER_PORT_EXPLAIN',
+ 'type' => 'text',
+ 'default' => $server_port,
+ ),
+ 'script_path' => array(
+ 'label' => 'SCRIPT_PATH',
+ 'description' => 'SCRIPT_PATH_EXPLAIN',
+ 'type' => 'text',
+ 'default' => $script_path,
+ ),
+ 'submit_server' => array(
+ 'label' => 'SUBMIT',
+ 'type' => 'submit',
+ )
+ );
+
+ $this->io_handler->add_user_form_group('SERVER_CONFIG', $server_form);
+
+ $this->io_handler->send_response();
+ throw new user_interaction_required_exception();
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ static public function get_step_count()
+ {
+ return 0;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_task_lang_name()
+ {
+ return '';
+ }
+}
diff --git a/phpBB/phpbb/install/module/requirements/module.php b/phpBB/phpbb/install/module/requirements/module.php
new file mode 100644
index 0000000000..79a031bad9
--- /dev/null
+++ b/phpBB/phpbb/install/module/requirements/module.php
@@ -0,0 +1,110 @@
+<?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\install\module\requirements;
+
+use phpbb\install\exception\resource_limit_reached_exception;
+use phpbb\install\exception\user_interaction_required_exception;
+
+class module extends \phpbb\install\module_base
+{
+ public function run()
+ {
+ $tests_passed = true;
+
+ // Recover install progress
+ $task_name = $this->recover_progress();
+ $task_found = false;
+
+ /**
+ * @var string $name ID of the service
+ * @var \phpbb\install\task_interface $task Task object
+ */
+ foreach ($this->task_collection as $name => $task)
+ {
+ // Run until there are available resources
+ if ($this->install_config->get_time_remaining() <= 0 && $this->install_config->get_memory_remaining() <= 0)
+ {
+ throw new resource_limit_reached_exception();
+ }
+
+ // Skip forward until the next task is reached
+ if (!$task_found)
+ {
+ if ($name === $task_name || empty($task_name))
+ {
+ $task_found = true;
+
+ if ($name === $task_name)
+ {
+ continue;
+ }
+ }
+ else
+ {
+ continue;
+ }
+ }
+
+ // Check if we can run the task
+ if (!$task->is_essential() && !$task->check_requirements())
+ {
+ continue;
+ }
+
+ if ($this->allow_progress_bar)
+ {
+ $this->install_config->increment_current_task_progress();
+ }
+
+ $test_result = $task->run();
+ $tests_passed = ($tests_passed) ? $test_result : false;
+ }
+
+ // Module finished, so clear task progress
+ $this->install_config->set_finished_task('');
+
+ // Check if tests have failed
+ if (!$tests_passed)
+ {
+ // If requirements are not met, exit form installer
+ // Set up UI for retesting
+ $this->iohandler->add_user_form_group('', array(
+ 'install' => array(
+ 'label' => 'RETEST_REQUIREMENTS',
+ 'type' => 'submit',
+ ),
+ ));
+
+ // Send the response and quit
+ $this->iohandler->send_response();
+ throw new user_interaction_required_exception();
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_step_count()
+ {
+ return 0;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_navigation_stage_path()
+ {
+ return array('install', 0, 'requirements');
+ }
+}
diff --git a/phpBB/phpbb/install/module/requirements/task/check_filesystem.php b/phpBB/phpbb/install/module/requirements/task/check_filesystem.php
new file mode 100644
index 0000000000..ab6b1091e2
--- /dev/null
+++ b/phpBB/phpbb/install/module/requirements/task/check_filesystem.php
@@ -0,0 +1,273 @@
+<?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\install\module\requirements\task;
+
+/**
+ * Checks filesystem requirements
+ */
+class check_filesystem extends \phpbb\install\task_base
+{
+ /**
+ * @var \phpbb\filesystem\filesystem_interface
+ */
+ protected $filesystem;
+
+ /**
+ * @var array
+ */
+ protected $files_to_check;
+
+ /**
+ * @var bool
+ */
+ protected $tests_passed;
+
+ /**
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * @var \phpbb\install\helper\iohandler\iohandler_interface
+ */
+ protected $response;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\filesystem\filesystem_interface $filesystem filesystem handler
+ * @param \phpbb\install\helper\iohandler\iohandler_interface $response response helper
+ * @param string $phpbb_root_path relative path to phpBB's root
+ * @param string $php_ext extension of php files
+ */
+ public function __construct(\phpbb\filesystem\filesystem_interface $filesystem,
+ \phpbb\install\helper\iohandler\iohandler_interface $response,
+ $phpbb_root_path,
+ $php_ext)
+ {
+ parent::__construct(true);
+
+ $this->filesystem = $filesystem;
+ $this->response = $response;
+ $this->phpbb_root_path = $phpbb_root_path;
+
+ $this->tests_passed = false;
+
+ // Files/Directories to check
+ // All file/directory names must be relative to phpBB's root path
+ $this->files_to_check = array(
+ array(
+ 'path' => 'cache/',
+ 'failable' => false,
+ 'is_file' => false,
+ ),
+ array(
+ 'path' => 'store/',
+ 'failable' => false,
+ 'is_file' => false,
+ ),
+ array(
+ 'path' => 'files/',
+ 'failable' => false,
+ 'is_file' => false,
+ ),
+ array(
+ 'path' => 'images/avatars/upload/',
+ 'failable' => true,
+ 'is_file' => false,
+ ),
+ array(
+ 'path' => "config.$php_ext",
+ 'failable' => false,
+ 'is_file' => true,
+ ),
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function run()
+ {
+ $this->tests_passed = true;
+
+ // Check files/directories to be writable
+ foreach ($this->files_to_check as $file)
+ {
+ if ($file['is_file'])
+ {
+ $this->check_file($file['path'], $file['failable']);
+ }
+ else
+ {
+ $this->check_dir($file['path'], $file['failable']);
+ }
+ }
+
+ return $this->tests_passed;
+ }
+
+ /**
+ * Sets $this->tests_passed
+ *
+ * @param bool $is_passed
+ */
+ protected function set_test_passed($is_passed)
+ {
+ // If one test failed, tests_passed should be false
+ $this->tests_passed = (!$this->tests_passed) ? false : $is_passed;
+ }
+
+ /**
+ * Check if a file is readable and writable
+ *
+ * @param string $file Filename
+ * @param bool $failable Whether failing test should interrupt installation process
+ */
+ protected function check_file($file, $failable = false)
+ {
+ $path = $this->phpbb_root_path . $file;
+ $exists = $writable = true;
+
+ // Try to create file if it does not exists
+ if (!file_exists($path))
+ {
+ $fp = @fopen($path, 'w');
+ @fclose($fp);
+ try
+ {
+ $this->filesystem->phpbb_chmod($path,
+ \phpbb\filesystem\filesystem_interface::CHMOD_READ | \phpbb\filesystem\filesystem_interface::CHMOD_WRITE
+ );
+ $exists = true;
+ }
+ catch (\phpbb\filesystem\exception\filesystem_exception $e)
+ {
+ // Do nothing
+ }
+ }
+
+ if (file_exists($path))
+ {
+ if (!$this->filesystem->is_writable($path))
+ {
+ $writable = false;
+ }
+ }
+ else
+ {
+ $exists = $writable = false;
+ }
+
+ $this->set_test_passed(($exists && $writable) || $failable);
+
+ if (!($exists && $writable))
+ {
+ $title = ($exists) ? 'FILE_NOT_WRITABLE' : 'FILE_NOT_EXISTS';
+ $description = array($title . '_EXPLAIN', $file);
+
+ if ($failable)
+ {
+ $this->response->add_warning_message($title, $description);
+ }
+ else
+ {
+ $this->response->add_error_message($title, $description);
+ }
+ }
+ }
+
+ /**
+ * Check if a directory is readable and writable
+ *
+ * @param string $dir Filename
+ * @param bool $failable Whether failing test should abort the installation process
+ */
+ protected function check_dir($dir, $failable = false)
+ {
+ $path = $this->phpbb_root_path . $dir;
+ $exists = $writable = false;
+
+ // Try to create the directory if it does not exist
+ if (!file_exists($path))
+ {
+ try
+ {
+ $this->filesystem->mkdir($path, 0777);
+ $this->filesystem->phpbb_chmod($path,
+ \phpbb\filesystem\filesystem_interface::CHMOD_READ | \phpbb\filesystem\filesystem_interface::CHMOD_WRITE
+ );
+ $exists = true;
+ }
+ catch (\phpbb\filesystem\exception\filesystem_exception $e)
+ {
+ // Do nothing
+ }
+ }
+
+ // Now really check
+ if (file_exists($path) && is_dir($path))
+ {
+ try
+ {
+ $exists = true;
+ $this->filesystem->phpbb_chmod($path,
+ \phpbb\filesystem\filesystem_interface::CHMOD_READ | \phpbb\filesystem\filesystem_interface::CHMOD_WRITE
+ );
+ }
+ catch (\phpbb\filesystem\exception\filesystem_exception $e)
+ {
+ // Do nothing
+ }
+ }
+
+ if ($this->filesystem->is_writable($path))
+ {
+ $writable = true;
+ }
+
+ $this->set_test_passed(($exists && $writable) || $failable);
+
+ if (!($exists && $writable))
+ {
+ $title = ($exists) ? 'DIRECTORY_NOT_WRITABLE' : 'DIRECTORY_NOT_EXISTS';
+ $description = array($title . '_EXPLAIN', $dir);
+
+ if ($failable)
+ {
+ $this->response->add_warning_message($title, $description);
+ }
+ else
+ {
+ $this->response->add_error_message($title, $description);
+ }
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ static public function get_step_count()
+ {
+ return 0;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_task_lang_name()
+ {
+ return '';
+ }
+}
diff --git a/phpBB/phpbb/install/module/requirements/task/check_server_environment.php b/phpBB/phpbb/install/module/requirements/task/check_server_environment.php
new file mode 100644
index 0000000000..50efdc55a2
--- /dev/null
+++ b/phpBB/phpbb/install/module/requirements/task/check_server_environment.php
@@ -0,0 +1,190 @@
+<?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\install\module\requirements\task;
+
+/**
+ * Installer task that checks if the server meats phpBB requirements
+ */
+class check_server_environment extends \phpbb\install\task_base
+{
+ /**
+ * @var \phpbb\install\helper\database
+ */
+ protected $database_helper;
+
+ /**
+ * @var \phpbb\install\helper\iohandler\iohandler_interface
+ */
+ protected $response_helper;
+
+ /**
+ * @var bool
+ */
+ protected $tests_passed;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\install\helper\database $database_helper
+ * @param \phpbb\install\helper\iohandler\iohandler_interface $response
+ */
+ public function __construct(\phpbb\install\helper\database $database_helper,
+ \phpbb\install\helper\iohandler\iohandler_interface $response)
+ {
+ $this->database_helper = $database_helper;
+ $this->response_helper = $response;
+ $this->tests_passed = true;
+
+ parent::__construct(true);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function run()
+ {
+ //
+ // Check requirements
+ // The error messages should be set in the check_ functions
+ //
+
+ // Check PHP version
+ $this->check_php_version();
+
+ // Check for getimagesize()
+ $this->check_image_size();
+
+ // Check for PCRE support
+ $this->check_pcre();
+
+ // Check for JSON support
+ $this->check_json();
+
+ // Check for dbms support
+ $this->check_available_dbms();
+
+ return $this->tests_passed;
+ }
+
+ /**
+ * Sets $this->tests_passed
+ *
+ * @param bool $is_passed
+ */
+ protected function set_test_passed($is_passed)
+ {
+ // If one test failed, tests_passed should be false
+ $this->tests_passed = (!$this->tests_passed) ? false : $is_passed;
+ }
+
+ /**
+ * Check if the requirements for PHP version is met
+ */
+ protected function check_php_version()
+ {
+ $php_version = PHP_VERSION;
+
+ if (version_compare($php_version, '5.3.9') < 0)
+ {
+ $this->response_helper->add_error_message('PHP_VERSION_REQD', 'PHP_VERSION_REQD_EXPLAIN');
+
+ $this->set_test_passed(false);
+ return;
+ }
+
+ $this->set_test_passed(true);
+ }
+
+ /**
+ * Checks if the installed PHP has getimagesize() available
+ */
+ protected function check_image_size()
+ {
+ if (!@function_exists('getimagesize'))
+ {
+ $this->response_helper->add_error_message('PHP_GETIMAGESIZE_SUPPORT', 'PHP_GETIMAGESIZE_SUPPORT_EXPLAIN');
+
+ $this->set_test_passed(false);
+ return;
+ }
+
+ $this->set_test_passed(true);
+ }
+
+ /**
+ * Checks if the installed PHP supports PCRE
+ */
+ protected function check_pcre()
+ {
+ if (@preg_match('//u', ''))
+ {
+ $this->set_test_passed(true);
+ return;
+ }
+
+ $this->response_helper->add_error_message('PCRE_UTF_SUPPORT', 'PCRE_UTF_SUPPORT_EXPLAIN');
+
+ $this->set_test_passed(false);
+ }
+
+ /**
+ * Checks whether PHP's JSON extension is available or not
+ */
+ protected function check_json()
+ {
+ if (@extension_loaded('json'))
+ {
+ $this->set_test_passed(true);
+ return;
+ }
+
+ $this->response_helper->add_error_message('PHP_JSON_SUPPORT', 'PHP_JSON_SUPPORT_EXPLAIN');
+
+ $this->set_test_passed(false);
+ }
+
+ /**
+ * Check if any supported DBMS is available
+ */
+ protected function check_available_dbms()
+ {
+ $available_dbms = $this->database_helper->get_available_dbms(false, true);
+
+ if ($available_dbms['ANY_DB_SUPPORT'])
+ {
+ $this->set_test_passed(true);
+ return;
+ }
+
+ $this->response_helper->add_error_message('PHP_SUPPORTED_DB', 'PHP_SUPPORTED_DB_EXPLAIN');
+
+ $this->set_test_passed(false);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ static public function get_step_count()
+ {
+ return 0;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_task_lang_name()
+ {
+ return '';
+ }
+}
diff --git a/phpBB/phpbb/install/module_base.php b/phpBB/phpbb/install/module_base.php
new file mode 100644
index 0000000000..a933d4987c
--- /dev/null
+++ b/phpBB/phpbb/install/module_base.php
@@ -0,0 +1,218 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+namespace phpbb\install;
+
+use phpbb\di\ordered_service_collection;
+use phpbb\install\exception\resource_limit_reached_exception;
+use phpbb\install\helper\config;
+use phpbb\install\helper\iohandler\iohandler_interface;
+
+/**
+ * Base class for installer module
+ */
+abstract class module_base implements module_interface
+{
+ /**
+ * @var config
+ */
+ protected $install_config;
+
+ /**
+ * @var iohandler_interface
+ */
+ protected $iohandler;
+
+ /**
+ * @var bool
+ */
+ protected $is_essential;
+
+ /**
+ * Array of tasks for installer module
+ *
+ * @var ordered_service_collection
+ */
+ protected $task_collection;
+
+ /**
+ * @var array
+ */
+ protected $task_step_count;
+
+ /**
+ * @var bool
+ */
+ protected $allow_progress_bar;
+
+ /**
+ * Installer module constructor
+ *
+ * @param ordered_service_collection $tasks array of installer tasks for installer module
+ * @param bool $essential flag indicating whether the module is essential or not
+ * @param bool $allow_progress_bar flag indicating whether or not to send progress information from within the module
+ */
+ public function __construct(ordered_service_collection $tasks, $essential = true, $allow_progress_bar = true)
+ {
+ $this->task_collection = $tasks;
+ $this->is_essential = $essential;
+ $this->allow_progress_bar = $allow_progress_bar;
+ }
+
+ /**
+ * Dependency getter
+ *
+ * @param config $config
+ * @param iohandler_interface $iohandler
+ */
+ public function setup(config $config, iohandler_interface $iohandler)
+ {
+ $this->install_config = $config;
+ $this->iohandler = $iohandler;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_essential()
+ {
+ return $this->is_essential;
+ }
+
+ /**
+ * {@inheritdoc}
+ *
+ * Overwrite this method if your task is non-essential!
+ */
+ public function check_requirements()
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function run()
+ {
+ // Recover install progress
+ $task_name = $this->recover_progress();
+ $task_found = false;
+
+ /**
+ * @var string $name ID of the service
+ * @var \phpbb\install\task_interface $task Task object
+ */
+ foreach ($this->task_collection as $name => $task)
+ {
+ // Run until there are available resources
+ if ($this->install_config->get_time_remaining() <= 0 && $this->install_config->get_memory_remaining() <= 0)
+ {
+ throw new resource_limit_reached_exception();
+ }
+
+ // Skip forward until the next task is reached
+ if (!$task_found)
+ {
+ if ($name === $task_name || empty($task_name))
+ {
+ $task_found = true;
+
+ if ($name === $task_name)
+ {
+ continue;
+ }
+ }
+ else
+ {
+ continue;
+ }
+ }
+
+ // Send progress information
+ if ($this->allow_progress_bar)
+ {
+ $this->iohandler->set_progress(
+ $task->get_task_lang_name(),
+ $this->install_config->get_current_task_progress()
+ );
+ }
+
+ // Check if we can run the task
+ if (!$task->is_essential() && !$task->check_requirements())
+ {
+ $this->iohandler->add_log_message(array(
+ 'SKIP_TASK',
+ $name,
+ ));
+
+ $this->install_config->increment_current_task_progress($this->task_step_count[$name]);
+ continue;
+ }
+
+ if ($this->allow_progress_bar)
+ {
+ // Only increment progress by one, as if a task has more than one steps
+ // then that should be incremented in the task itself
+ $this->install_config->increment_current_task_progress();
+ }
+
+ $task->run();
+
+ // Log install progress
+ $this->install_config->set_finished_task($name);
+
+ // Send progress information
+ if ($this->allow_progress_bar)
+ {
+ $this->iohandler->set_progress(
+ $task->get_task_lang_name(),
+ $this->install_config->get_current_task_progress()
+ );
+ }
+
+ $this->iohandler->send_response();
+ }
+
+ // Module finished, so clear task progress
+ $this->install_config->set_finished_task('');
+ }
+
+ /**
+ * Returns the next task's name
+ *
+ * @return string Index of the array element of the next task
+ */
+ protected function recover_progress()
+ {
+ $progress_array = $this->install_config->get_progress_data();
+ return $progress_array['last_task_name'];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_step_count()
+ {
+ $task_step_count = 0;
+ $task_class_names = $this->task_collection->get_service_classes();
+
+ foreach ($task_class_names as $name => $task_class)
+ {
+ $step_count = $task_class::get_step_count();
+ $task_step_count += $step_count;
+ $this->task_step_count[$name] = $step_count;
+ }
+
+ return $task_step_count;
+ }
+}
diff --git a/phpBB/phpbb/install/module_interface.php b/phpBB/phpbb/install/module_interface.php
new file mode 100644
index 0000000000..a2d61e3958
--- /dev/null
+++ b/phpBB/phpbb/install/module_interface.php
@@ -0,0 +1,63 @@
+<?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\install;
+
+/**
+ * Interface for installer modules
+ *
+ * An installer module is a task collection which executes installer tasks.
+ */
+interface module_interface
+{
+ /**
+ * Checks if the execution of the module is essential to install phpBB or it can be skipped
+ *
+ * Note: Please note that all the non-essential modules have to implement check_requirements()
+ * method.
+ *
+ * @return bool true if the module is essential, false otherwise
+ */
+ public function is_essential();
+
+ /**
+ * Checks requirements for the tasks
+ *
+ * Note: Only need to be implemented for non-essential tasks, as essential tasks
+ * requirements should be checked in the requirements install module.
+ *
+ * @return bool true if the task's requirements are met
+ */
+ public function check_requirements();
+
+ /**
+ * Executes the task
+ *
+ * @return null
+ */
+ public function run();
+
+ /**
+ * Returns the number of tasks in the module
+ *
+ * @return int
+ */
+ public function get_step_count();
+
+ /**
+ * Returns an array to the correct navigation stage
+ *
+ * @return array
+ */
+ public function get_navigation_stage_path();
+}
diff --git a/phpBB/phpbb/install/task_base.php b/phpBB/phpbb/install/task_base.php
new file mode 100644
index 0000000000..5946be8c52
--- /dev/null
+++ b/phpBB/phpbb/install/task_base.php
@@ -0,0 +1,53 @@
+<?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\install;
+
+/**
+ * Base class for installer task
+ */
+abstract class task_base implements task_interface
+{
+ /**
+ * @var bool
+ */
+ protected $is_essential;
+
+ /**
+ * Constructor
+ *
+ * @param bool $essential
+ */
+ public function __construct($essential = true)
+ {
+ $this->is_essential = $essential;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_essential()
+ {
+ return $this->is_essential;
+ }
+
+ /**
+ * {@inheritdoc}
+ *
+ * Overwrite this method if your task is non-essential!
+ */
+ public function check_requirements()
+ {
+ return true;
+ }
+}
diff --git a/phpBB/phpbb/install/task_interface.php b/phpBB/phpbb/install/task_interface.php
new file mode 100644
index 0000000000..794cb16482
--- /dev/null
+++ b/phpBB/phpbb/install/task_interface.php
@@ -0,0 +1,61 @@
+<?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\install;
+
+/**
+ * Interface for installer tasks
+ */
+interface task_interface
+{
+ /**
+ * Returns the number of steps the task contains
+ *
+ * This is a helper method to provide a better progress bar for the front-end.
+ *
+ * @return int The number of steps that the task contains
+ */
+ static public function get_step_count();
+
+ /**
+ * Checks if the task is essential to install phpBB or it can be skipped
+ *
+ * Note: Please note that all the non-essential modules have to implement check_requirements()
+ * method.
+ *
+ * @return bool true if the task is essential, false otherwise
+ */
+ public function is_essential();
+
+ /**
+ * Checks requirements for the tasks
+ *
+ * Note: Only need to be implemented for non-essential tasks, as essential tasks
+ * requirements should be checked in the requirements install module.
+ *
+ * @return bool true if the task's requirements are met
+ */
+ public function check_requirements();
+
+ /**
+ * Executes the task
+ */
+ public function run();
+
+ /**
+ * Returns the language key of the name of the task
+ *
+ * @return string
+ */
+ public function get_task_lang_name();
+}
diff --git a/phpBB/phpbb/language/exception/invalid_plural_rule_exception.php b/phpBB/phpbb/language/exception/invalid_plural_rule_exception.php
new file mode 100644
index 0000000000..94e3466208
--- /dev/null
+++ b/phpBB/phpbb/language/exception/invalid_plural_rule_exception.php
@@ -0,0 +1,22 @@
+<?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\language\exception;
+
+/**
+ * Thrown when nonexistent plural rule is specified
+ */
+class invalid_plural_rule_exception extends language_exception
+{
+
+}
diff --git a/phpBB/phpbb/language/exception/language_exception.php b/phpBB/phpbb/language/exception/language_exception.php
new file mode 100644
index 0000000000..b1258414aa
--- /dev/null
+++ b/phpBB/phpbb/language/exception/language_exception.php
@@ -0,0 +1,22 @@
+<?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\language\exception;
+
+/**
+ * Base exception class for language exceptions
+ */
+class language_exception extends \phpbb\exception\runtime_exception
+{
+
+}
diff --git a/phpBB/phpbb/language/exception/language_file_not_found.php b/phpBB/phpbb/language/exception/language_file_not_found.php
new file mode 100644
index 0000000000..89364267eb
--- /dev/null
+++ b/phpBB/phpbb/language/exception/language_file_not_found.php
@@ -0,0 +1,22 @@
+<?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\language\exception;
+
+/**
+ * This exception is thrown when the language file is not found
+ */
+class language_file_not_found extends language_exception
+{
+
+}
diff --git a/phpBB/phpbb/language/language.php b/phpBB/phpbb/language/language.php
new file mode 100644
index 0000000000..3ffb466c19
--- /dev/null
+++ b/phpBB/phpbb/language/language.php
@@ -0,0 +1,632 @@
+<?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\language;
+
+use phpbb\language\exception\invalid_plural_rule_exception;
+
+/**
+ * Wrapper class for loading translations
+ */
+class language
+{
+ /**
+ * Global fallback language
+ *
+ * ISO code of the language to fallback to when the specified language entries
+ * cannot be found.
+ *
+ * @var string
+ */
+ const FALLBACK_LANGUAGE = 'en';
+
+ /**
+ * @var array List of common language files
+ */
+ protected $common_language_files;
+
+ /**
+ * @var bool
+ */
+ protected $common_language_files_loaded;
+
+ /**
+ * @var string ISO code of the default board language
+ */
+ protected $default_language;
+
+ /**
+ * @var string ISO code of the User's language
+ */
+ protected $user_language;
+
+ /**
+ * @var array Language fallback array (the order is important)
+ */
+ protected $language_fallback;
+
+ /**
+ * @var array Array of language variables
+ */
+ protected $lang;
+
+ /**
+ * @var array Loaded language sets
+ */
+ protected $loaded_language_sets;
+
+ /**
+ * @var \phpbb\language\language_file_loader Language file loader
+ */
+ protected $loader;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\language\language_file_loader $loader Language file loader
+ * @param array|null $common_modules Array of common language modules to load (optional)
+ */
+ public function __construct(language_file_loader $loader, $common_modules = null)
+ {
+ $this->loader = $loader;
+
+ // Set up default information
+ $this->user_language = false;
+ $this->default_language = false;
+ $this->lang = array();
+ $this->loaded_language_sets = array(
+ 'core' => array(),
+ 'ext' => array(),
+ );
+
+ // Common language files
+ if (is_array($common_modules))
+ {
+ $this->common_language_files = $common_modules;
+ }
+ else
+ {
+ $this->common_language_files = array(
+ 'common',
+ );
+ }
+
+ $this->common_language_files_loaded = false;
+
+ $this->language_fallback = array(self::FALLBACK_LANGUAGE);
+ }
+
+ /**
+ * Function to set user's language to display.
+ *
+ * @param string $user_lang_iso ISO code of the User's language
+ * @param bool $reload Whether or not to reload language files
+ */
+ public function set_user_language($user_lang_iso, $reload = false)
+ {
+ $this->user_language = $user_lang_iso;
+
+ $this->set_fallback_array($reload);
+ }
+
+ /**
+ * Function to set the board's default language to display.
+ *
+ * @param string $default_lang_iso ISO code of the board's default language
+ * @param bool $reload Whether or not to reload language files
+ */
+ public function set_default_language($default_lang_iso, $reload = false)
+ {
+ $this->default_language = $default_lang_iso;
+
+ $this->set_fallback_array($reload);
+ }
+
+ /**
+ * Returns language array
+ *
+ * Note: This function is needed for the BC purposes, until \phpbb\user::lang[] is
+ * not removed.
+ *
+ * @return array Array of loaded language strings
+ */
+ public function get_lang_array()
+ {
+ // Load common language files if they not loaded yet
+ if (!$this->common_language_files_loaded)
+ {
+ $this->load_common_language_files();
+ }
+
+ return $this->lang;
+ }
+
+ /**
+ * Add Language Items
+ *
+ * Examples:
+ * <code>
+ * $component = array('posting');
+ * $component = array('posting', 'viewtopic')
+ * $component = 'posting'
+ * </code>
+ *
+ * @param string|array $component The name of the language component to load
+ * @param string|null $extension_name Name of the extension to load component from, or null for core file
+ */
+ public function add_lang($component, $extension_name = null)
+ {
+ // Load common language files if they not loaded yet
+ // This needs to be here to correctly merge language arrays
+ if (!$this->common_language_files_loaded)
+ {
+ $this->load_common_language_files();
+ }
+
+ if (!is_array($component))
+ {
+ if (!is_null($extension_name))
+ {
+ $this->load_extension($extension_name, $component);
+ }
+ else
+ {
+ $this->load_core_file($component);
+ }
+ }
+ else
+ {
+ foreach ($component as $lang_file)
+ {
+ $this->add_lang($lang_file, $extension_name);
+ }
+ }
+ }
+
+ /**
+ * @param $key array|string The language key we want to know more about. Can be string or array.
+ *
+ * @return bool Returns whether the language key is set.
+ */
+ public function is_set($key)
+ {
+ // Load common language files if they not loaded yet
+ if (!$this->common_language_files_loaded)
+ {
+ $this->load_common_language_files();
+ }
+
+ if (is_array($key))
+ {
+ $lang = &$this->lang[array_shift($key)];
+
+ foreach ($key as $_key)
+ {
+ $lang = &$lang[$_key];
+ }
+ }
+ else
+ {
+ $lang = &$this->lang[$key];
+ }
+
+ return isset($lang);
+ }
+
+ /**
+ * Advanced language substitution
+ *
+ * Function to mimic sprintf() with the possibility of using phpBB's language system to substitute nullar/singular/plural forms.
+ * Params are the language key and the parameters to be substituted.
+ * This function/functionality is inspired by SHS` and Ashe.
+ *
+ * Example call: <samp>$user->lang('NUM_POSTS_IN_QUEUE', 1);</samp>
+ *
+ * If the first parameter is an array, the elements are used as keys and subkeys to get the language entry:
+ * Example: <samp>$user->lang(array('datetime', 'AGO'), 1)</samp> uses $user->lang['datetime']['AGO'] as language entry.
+ *
+ * @return string Return localized string or the language key if the translation is not available
+ */
+ public function lang()
+ {
+ // Load common language files if they not loaded yet
+ if (!$this->common_language_files_loaded)
+ {
+ $this->load_common_language_files();
+ }
+
+ $args = func_get_args();
+ $key = $args[0];
+
+ if (is_array($key))
+ {
+ $lang = &$this->lang[array_shift($key)];
+
+ foreach ($key as $_key)
+ {
+ $lang = &$lang[$_key];
+ }
+ }
+ else
+ {
+ $lang = &$this->lang[$key];
+ }
+
+ // Return if language string does not exist
+ if (!isset($lang) || (!is_string($lang) && !is_array($lang)))
+ {
+ return $key;
+ }
+
+ // If the language entry is a string, we simply mimic sprintf() behaviour
+ if (is_string($lang))
+ {
+ if (sizeof($args) == 1)
+ {
+ return $lang;
+ }
+
+ // Replace key with language entry and simply pass along...
+ $args[0] = $lang;
+ return call_user_func_array('sprintf', $args);
+ }
+ else if (sizeof($lang) == 0)
+ {
+ // If the language entry is an empty array, we just return the language key
+ return $args[0];
+ }
+
+ // It is an array... now handle different nullar/singular/plural forms
+ $key_found = false;
+
+ // We now get the first number passed and will select the key based upon this number
+ for ($i = 1, $num_args = sizeof($args); $i < $num_args; $i++)
+ {
+ if (is_int($args[$i]) || is_float($args[$i]))
+ {
+ if ($args[$i] == 0 && isset($lang[0]))
+ {
+ // We allow each translation using plural forms to specify a version for the case of 0 things,
+ // so that "0 users" may be displayed as "No users".
+ $key_found = 0;
+ break;
+ }
+ else
+ {
+ $use_plural_form = $this->get_plural_form($args[$i]);
+ if (isset($lang[$use_plural_form]))
+ {
+ // The key we should use exists, so we use it.
+ $key_found = $use_plural_form;
+ }
+ else
+ {
+ // If the key we need to use does not exist, we fall back to the previous one.
+ $numbers = array_keys($lang);
+
+ foreach ($numbers as $num)
+ {
+ if ($num > $use_plural_form)
+ {
+ break;
+ }
+
+ $key_found = $num;
+ }
+ }
+ break;
+ }
+ }
+ }
+
+ // Ok, let's check if the key was found, else use the last entry (because it is mostly the plural form)
+ if ($key_found === false)
+ {
+ $numbers = array_keys($lang);
+ $key_found = end($numbers);
+ }
+
+ // Use the language string we determined and pass it to sprintf()
+ $args[0] = $lang[$key_found];
+ return call_user_func_array('sprintf', $args);
+ }
+
+ /**
+ * Loads common language files
+ */
+ protected function load_common_language_files()
+ {
+ if (!$this->common_language_files_loaded)
+ {
+ foreach ($this->common_language_files as $lang_file)
+ {
+ $this->load_core_file($lang_file);
+ }
+
+ $this->common_language_files_loaded = true;
+ }
+ }
+
+ /**
+ * Determine which plural form we should use.
+ *
+ * For some languages this is not as simple as for English.
+ *
+ * @param int|float $number The number we want to get the plural case for. Float numbers are floored.
+ * @param int|bool $force_rule False to use the plural rule of the language package
+ * or an integer to force a certain plural rule
+ *
+ * @return int The plural-case we need to use for the number plural-rule combination
+ *
+ * @throws \phpbb\language\exception\invalid_plural_rule_exception When $force_rule has an invalid value
+ */
+ public function get_plural_form($number, $force_rule = false)
+ {
+ $number = (int) $number;
+ $plural_rule = ($force_rule !== false) ? $force_rule : ((isset($this->lang['PLURAL_RULE'])) ? $this->lang['PLURAL_RULE'] : 1);
+
+ if ($plural_rule > 15 || $plural_rule < 0)
+ {
+ throw new invalid_plural_rule_exception('INVALID_PLURAL_RULE', array(
+ 'plural_rule' => $plural_rule,
+ ));
+ }
+
+ /**
+ * The following plural rules are based on a list published by the Mozilla Developer Network
+ * https://developer.mozilla.org/en/Localization_and_Plurals
+ */
+ switch ($plural_rule)
+ {
+ case 0:
+ /**
+ * Families: Asian (Chinese, Japanese, Korean, Vietnamese), Persian, Turkic/Altaic (Turkish), Thai, Lao
+ * 1 - everything: 0, 1, 2, ...
+ */
+ return 1;
+
+ case 1:
+ /**
+ * Families: Germanic (Danish, Dutch, English, Faroese, Frisian, German, Norwegian, Swedish), Finno-Ugric (Estonian, Finnish, Hungarian), Language isolate (Basque), Latin/Greek (Greek), Semitic (Hebrew), Romanic (Italian, Portuguese, Spanish, Catalan)
+ * 1 - 1
+ * 2 - everything else: 0, 2, 3, ...
+ */
+ return ($number === 1) ? 1 : 2;
+
+ case 2:
+ /**
+ * Families: Romanic (French, Brazilian Portuguese)
+ * 1 - 0, 1
+ * 2 - everything else: 2, 3, ...
+ */
+ return (($number === 0) || ($number === 1)) ? 1 : 2;
+
+ case 3:
+ /**
+ * Families: Baltic (Latvian)
+ * 1 - 0
+ * 2 - ends in 1, not 11: 1, 21, ... 101, 121, ...
+ * 3 - everything else: 2, 3, ... 10, 11, 12, ... 20, 22, ...
+ */
+ return ($number === 0) ? 1 : ((($number % 10 === 1) && ($number % 100 != 11)) ? 2 : 3);
+
+ case 4:
+ /**
+ * Families: Celtic (Scottish Gaelic)
+ * 1 - is 1 or 11: 1, 11
+ * 2 - is 2 or 12: 2, 12
+ * 3 - others between 3 and 19: 3, 4, ... 10, 13, ... 18, 19
+ * 4 - everything else: 0, 20, 21, ...
+ */
+ return ($number === 1 || $number === 11) ? 1 : (($number === 2 || $number === 12) ? 2 : (($number >= 3 && $number <= 19) ? 3 : 4));
+
+ case 5:
+ /**
+ * Families: Romanic (Romanian)
+ * 1 - 1
+ * 2 - is 0 or ends in 01-19: 0, 2, 3, ... 19, 101, 102, ... 119, 201, ...
+ * 3 - everything else: 20, 21, ...
+ */
+ return ($number === 1) ? 1 : ((($number === 0) || (($number % 100 > 0) && ($number % 100 < 20))) ? 2 : 3);
+
+ case 6:
+ /**
+ * Families: Baltic (Lithuanian)
+ * 1 - ends in 1, not 11: 1, 21, 31, ... 101, 121, ...
+ * 2 - ends in 0 or ends in 10-20: 0, 10, 11, 12, ... 19, 20, 30, 40, ...
+ * 3 - everything else: 2, 3, ... 8, 9, 22, 23, ... 29, 32, 33, ...
+ */
+ return (($number % 10 === 1) && ($number % 100 != 11)) ? 1 : ((($number % 10 < 2) || (($number % 100 >= 10) && ($number % 100 < 20))) ? 2 : 3);
+
+ case 7:
+ /**
+ * Families: Slavic (Croatian, Serbian, Russian, Ukrainian)
+ * 1 - ends in 1, not 11: 1, 21, 31, ... 101, 121, ...
+ * 2 - ends in 2-4, not 12-14: 2, 3, 4, 22, 23, 24, 32, ...
+ * 3 - everything else: 0, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 25, 26, ...
+ */
+ return (($number % 10 === 1) && ($number % 100 != 11)) ? 1 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 2 : 3);
+
+ case 8:
+ /**
+ * Families: Slavic (Slovak, Czech)
+ * 1 - 1
+ * 2 - 2, 3, 4
+ * 3 - everything else: 0, 5, 6, 7, ...
+ */
+ return ($number === 1) ? 1 : ((($number >= 2) && ($number <= 4)) ? 2 : 3);
+
+ case 9:
+ /**
+ * Families: Slavic (Polish)
+ * 1 - 1
+ * 2 - ends in 2-4, not 12-14: 2, 3, 4, 22, 23, 24, 32, ... 104, 122, ...
+ * 3 - everything else: 0, 5, 6, ... 11, 12, 13, 14, 15, ... 20, 21, 25, ...
+ */
+ return ($number === 1) ? 1 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 12) || ($number % 100 > 14))) ? 2 : 3);
+
+ case 10:
+ /**
+ * Families: Slavic (Slovenian, Sorbian)
+ * 1 - ends in 01: 1, 101, 201, ...
+ * 2 - ends in 02: 2, 102, 202, ...
+ * 3 - ends in 03-04: 3, 4, 103, 104, 203, 204, ...
+ * 4 - everything else: 0, 5, 6, 7, 8, 9, 10, 11, ...
+ */
+ return ($number % 100 === 1) ? 1 : (($number % 100 === 2) ? 2 : ((($number % 100 === 3) || ($number % 100 === 4)) ? 3 : 4));
+
+ case 11:
+ /**
+ * Families: Celtic (Irish Gaeilge)
+ * 1 - 1
+ * 2 - 2
+ * 3 - is 3-6: 3, 4, 5, 6
+ * 4 - is 7-10: 7, 8, 9, 10
+ * 5 - everything else: 0, 11, 12, ...
+ */
+ return ($number === 1) ? 1 : (($number === 2) ? 2 : (($number >= 3 && $number <= 6) ? 3 : (($number >= 7 && $number <= 10) ? 4 : 5)));
+
+ case 12:
+ /**
+ * Families: Semitic (Arabic)
+ * 1 - 1
+ * 2 - 2
+ * 3 - ends in 03-10: 3, 4, ... 10, 103, 104, ... 110, 203, 204, ...
+ * 4 - ends in 11-99: 11, ... 99, 111, 112, ...
+ * 5 - everything else: 100, 101, 102, 200, 201, 202, ...
+ * 6 - 0
+ */
+ return ($number === 1) ? 1 : (($number === 2) ? 2 : ((($number % 100 >= 3) && ($number % 100 <= 10)) ? 3 : ((($number % 100 >= 11) && ($number % 100 <= 99)) ? 4 : (($number != 0) ? 5 : 6))));
+
+ case 13:
+ /**
+ * Families: Semitic (Maltese)
+ * 1 - 1
+ * 2 - is 0 or ends in 01-10: 0, 2, 3, ... 9, 10, 101, 102, ...
+ * 3 - ends in 11-19: 11, 12, ... 18, 19, 111, 112, ...
+ * 4 - everything else: 20, 21, ...
+ */
+ return ($number === 1) ? 1 : ((($number === 0) || (($number % 100 > 1) && ($number % 100 < 11))) ? 2 : ((($number % 100 > 10) && ($number % 100 < 20)) ? 3 : 4));
+
+ case 14:
+ /**
+ * Families: Slavic (Macedonian)
+ * 1 - ends in 1: 1, 11, 21, ...
+ * 2 - ends in 2: 2, 12, 22, ...
+ * 3 - everything else: 0, 3, 4, ... 10, 13, 14, ... 20, 23, ...
+ */
+ return ($number % 10 === 1) ? 1 : (($number % 10 === 2) ? 2 : 3);
+
+ case 15:
+ /**
+ * Families: Icelandic
+ * 1 - ends in 1, not 11: 1, 21, 31, ... 101, 121, 131, ...
+ * 2 - everything else: 0, 2, 3, ... 10, 11, 12, ... 20, 22, ...
+ */
+ return (($number % 10 === 1) && ($number % 100 != 11)) ? 1 : 2;
+ }
+ }
+
+ /**
+ * Returns language fallback data
+ *
+ * @param bool $reload Whether or not to reload language files
+ *
+ * @return array
+ */
+ protected function set_fallback_array($reload = false)
+ {
+ $fallback_array = array();
+
+ if ($this->user_language !== false)
+ {
+ $fallback_array[] = $this->user_language;
+ }
+
+ if ($this->default_language !== false)
+ {
+ $fallback_array[] = $this->default_language;
+ }
+
+ $fallback_array[] = self::FALLBACK_LANGUAGE;
+
+ $this->language_fallback = $fallback_array;
+
+ if ($reload)
+ {
+ $this->reload_language_files();
+ }
+ }
+
+ /**
+ * Load core language file
+ *
+ * @param string $component Name of the component to load
+ */
+ protected function load_core_file($component)
+ {
+ // Check if the component is already loaded
+ if (isset($this->loaded_language_sets['core'][$component]))
+ {
+ return;
+ }
+
+ $this->loader->load($component, $this->language_fallback, $this->lang);
+ $this->loaded_language_sets['core'][$component] = true;
+ }
+
+ /**
+ * Load extension language file
+ *
+ * @param string $extension_name Name of the extension to load language from
+ * @param string $component Name of the component to load
+ */
+ protected function load_extension($extension_name, $component)
+ {
+ // Check if the component is already loaded
+ if (isset($this->loaded_language_sets['ext'][$extension_name][$component]))
+ {
+ return;
+ }
+
+ $this->loader->load_extension($extension_name, $component, $this->language_fallback, $this->lang);
+ $this->loaded_language_sets['ext'][$extension_name][$component] = true;
+ }
+
+ /**
+ * Reload language files
+ */
+ protected function reload_language_files()
+ {
+ $loaded_files = $this->loaded_language_sets;
+ $this->loaded_language_sets = array(
+ 'core' => array(),
+ 'ext' => array(),
+ );
+
+ // Reload core files
+ foreach ($loaded_files['core'] as $component => $value)
+ {
+ $this->load_core_file($component);
+ }
+
+ // Reload extension files
+ foreach ($loaded_files['ext'] as $ext_name => $ext_info)
+ {
+ foreach ($ext_info as $ext_component => $value)
+ {
+ $this->load_extension($ext_name, $ext_component);
+ }
+ }
+ }
+}
diff --git a/phpBB/phpbb/language/language_file_helper.php b/phpBB/phpbb/language/language_file_helper.php
new file mode 100644
index 0000000000..18d7b62e21
--- /dev/null
+++ b/phpBB/phpbb/language/language_file_helper.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.
+ *
+ */
+
+namespace phpbb\language;
+
+use Symfony\Component\Finder\Finder;
+
+/**
+ * Helper class for language file related functions
+ */
+class language_file_helper
+{
+ /**
+ * @var string Path to phpBB's root
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * Constructor
+ *
+ * @param string $phpbb_root_path Path to phpBB's root
+ */
+ public function __construct($phpbb_root_path)
+ {
+ $this->phpbb_root_path = $phpbb_root_path;
+ }
+
+ /**
+ * Returns available languages
+ *
+ * @return array
+ */
+ public function get_available_languages()
+ {
+ // Find available language packages
+ $finder = new Finder();
+ $finder->files()
+ ->name('iso.txt')
+ ->depth('== 1')
+ ->in($this->phpbb_root_path . 'language');
+
+ $available_languages = array();
+ foreach ($finder as $file)
+ {
+ $path = $file->getRelativePath();
+ $info = explode("\n", $file->getContents());
+
+ $available_languages[] = array(
+ // Get the name of the directory containing iso.txt
+ 'iso' => $path,
+
+ // Recover data from file
+ 'name' => trim($info[0]),
+ 'local_name' => trim($info[1]),
+ 'author' => trim($info[2])
+ );
+ }
+
+ return $available_languages;
+ }
+}
diff --git a/phpBB/phpbb/language/language_file_loader.php b/phpBB/phpbb/language/language_file_loader.php
new file mode 100644
index 0000000000..359202fd63
--- /dev/null
+++ b/phpBB/phpbb/language/language_file_loader.php
@@ -0,0 +1,206 @@
+<?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\language;
+
+use \phpbb\language\exception\language_file_not_found;
+
+/**
+ * Language file loader
+ */
+class language_file_loader
+{
+ /**
+ * @var string Path to phpBB's root
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * @var string Extension of PHP files
+ */
+ protected $php_ext;
+
+ /**
+ * @var \phpbb\extension\manager Extension manager
+ */
+ protected $extension_manager;
+
+ /**
+ * Constructor
+ *
+ * @param string $phpbb_root_path Path to phpBB's root
+ * @param string $php_ext Extension of PHP files
+ */
+ public function __construct($phpbb_root_path, $php_ext)
+ {
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+
+ $this->extension_manager = null;
+ }
+
+ /**
+ * Extension manager setter
+ *
+ * @param \phpbb\extension\manager $extension_manager Extension manager
+ */
+ public function set_extension_manager(\phpbb\extension\manager $extension_manager)
+ {
+ $this->extension_manager = $extension_manager;
+ }
+
+ /**
+ * Loads language array for the given component
+ *
+ * @param string $component Name of the language component
+ * @param string|array $locale ISO code of the language to load, or array of ISO codes if you want to
+ * specify additional language fallback steps
+ * @param array $lang Array reference containing language strings
+ */
+ public function load($component, $locale, &$lang)
+ {
+ $locale = (array) $locale;
+
+ // Determine path to language directory
+ $path = $this->phpbb_root_path . 'language/';
+
+ $this->load_file($path, $component, $locale, $lang);
+ }
+
+ /**
+ * Loads language array for the given extension component
+ *
+ * @param string $extension Name of the extension
+ * @param string $component Name of the language component
+ * @param string|array $locale ISO code of the language to load, or array of ISO codes if you want to
+ * specify additional language fallback steps
+ * @param array $lang Array reference containing language strings
+ */
+ public function load_extension($extension, $component, $locale, &$lang)
+ {
+ // Check if extension manager was loaded
+ if ($this->extension_manager === null)
+ {
+ // If not, let's return
+ return;
+ }
+
+ $locale = (array) $locale;
+
+ // Determine path to language directory
+ $path = $this->extension_manager->get_extension_path($extension, true) . 'language/';
+
+ $this->load_file($path, $component, $locale, $lang);
+ }
+
+ /**
+ * Prepares language file loading
+ *
+ * @param string $path Path to search for file in
+ * @param string $component Name of the language component
+ * @param array $locale Array containing language fallback options
+ * @param array $lang Array reference of language strings
+ */
+ protected function load_file($path, $component, $locale, &$lang)
+ {
+ // This is BC stuff and not the best idea as it makes language fallback
+ // implementation quite hard like below.
+ if (strpos($this->phpbb_root_path . $component, $path) === 0)
+ {
+ // Filter out the path
+ $path_diff = str_replace($path, '', dirname($this->phpbb_root_path . $component));
+ $language_file = basename($component, '.' . $this->php_ext);
+ $component = '';
+
+ // This step is needed to resolve language/en/subdir style $component
+ // $path already points to the language base directory so we need to eliminate
+ // the first directory from the path (that should be the language directory)
+ $path_diff_parts = explode('/', $path_diff);
+
+ if (sizeof($path_diff_parts) > 1)
+ {
+ array_shift($path_diff_parts);
+ $component = implode('/', $path_diff_parts) . '/';
+ }
+
+ $component .= $language_file;
+ }
+
+ // Determine filename
+ $filename = $component . '.' . $this->php_ext;
+
+ // Determine path to file
+ $file_path = $this->get_language_file_path($path, $filename, $locale);
+
+ // Load language array
+ $this->load_language_file($file_path, $lang);
+ }
+
+ /**
+ * This function implements language fallback logic
+ *
+ * @param string $path Path to language directory
+ * @param string $filename Filename to load language strings from
+ *
+ * @return string Relative path to language file
+ *
+ * @throws language_file_not_found When the path to the file cannot be resolved
+ */
+ protected function get_language_file_path($path, $filename, $locales)
+ {
+ $language_file_path = $filename;
+
+ // Language fallback logic
+ foreach ($locales as $locale)
+ {
+ $language_file_path = $path . $locale . '/' . $filename;
+
+ // If we are in install, try to use the updated version, when available
+ if (defined('IN_INSTALL'))
+ {
+ $install_language_path = str_replace('language/', 'install/update/new/language/', $language_file_path);
+ if (file_exists($install_language_path))
+ {
+ return $install_language_path;
+ }
+ }
+
+ if (file_exists($language_file_path))
+ {
+ return $language_file_path;
+ }
+ }
+
+ // The language file is not exist
+ throw new language_file_not_found('Language file ' . $language_file_path . ' couldn\'t be opened.');
+ }
+
+ /**
+ * Loads language file
+ *
+ * @param string $path Path to language file to load
+ * @param array $lang Reference of the array of language strings
+ */
+ protected function load_language_file($path, &$lang)
+ {
+ // Do not suppress error if in DEBUG mode
+ if (defined('DEBUG'))
+ {
+ include $path;
+ }
+ else
+ {
+ @include $path;
+ }
+ }
+}
diff --git a/phpBB/phpbb/log/null.php b/phpBB/phpbb/log/dummy.php
index baa78895ea..5c2d145e15 100644
--- a/phpBB/phpbb/log/null.php
+++ b/phpBB/phpbb/log/dummy.php
@@ -14,9 +14,9 @@
namespace phpbb\log;
/**
-* Null logger
+* Dummy logger
*/
-class null implements log_interface
+class dummy implements log_interface
{
/**
* {@inheritdoc}
diff --git a/phpBB/phpbb/log/log.php b/phpBB/phpbb/log/log.php
index 3d995b4e4a..f0ba120625 100644
--- a/phpBB/phpbb/log/log.php
+++ b/phpBB/phpbb/log/log.php
@@ -27,7 +27,7 @@ class log implements \phpbb\log\log_interface
/**
* An array with the disabled log types. Logs of such types will not be
- * added when add_log() is called.
+ * added when add() is called.
* @var array
*/
protected $disabled_types;
@@ -223,14 +223,14 @@ class log implements \phpbb\log\log_interface
return false;
}
- if ($log_time == false)
+ if ($log_time === false)
{
$log_time = time();
}
$sql_ary = array(
- 'user_id' => $user_id,
- 'log_ip' => $log_ip,
+ 'user_id' => $user_id ? (int) $user_id : ANONYMOUS,
+ 'log_ip' => empty($log_ip) ? '' : $log_ip,
'log_time' => $log_time,
'log_operation' => $log_operation,
);
@@ -249,10 +249,13 @@ class log implements \phpbb\log\log_interface
unset($additional_data['forum_id']);
$topic_id = isset($additional_data['topic_id']) ? (int) $additional_data['topic_id'] : 0;
unset($additional_data['topic_id']);
+ $post_id = isset($additional_data['post_id']) ? (int) $additional_data['post_id'] : 0;
+ unset($additional_data['post_id']);
$sql_ary += array(
'log_type' => LOG_MOD,
'forum_id' => $forum_id,
'topic_id' => $topic_id,
+ 'post_id' => $post_id,
'log_data' => (!empty($additional_data)) ? serialize($additional_data) : '',
);
break;
@@ -417,7 +420,7 @@ class log implements \phpbb\log\log_interface
$this->entry_count = 0;
$this->last_page_offset = $offset;
- $topic_id_list = $reportee_id_list = array();
+ $post_id_list = $topic_id_list = $reportee_id_list = array();
$profile_url = ($this->get_is_admin() && $this->phpbb_admin_path) ? append_sid("{$this->phpbb_admin_path}index.{$this->php_ext}", 'i=users&amp;mode=overview') : append_sid("{$this->phpbb_root_path}memberlist.{$this->php_ext}", 'mode=viewprofile');
@@ -643,6 +646,7 @@ class log implements \phpbb\log\log_interface
'time' => (int) $row['log_time'],
'forum_id' => (int) $row['forum_id'],
'topic_id' => (int) $row['topic_id'],
+ 'post_id' => (int) $row['post_id'],
'viewforum' => ($row['forum_id'] && $this->auth->acl_get('f_read', $row['forum_id'])) ? append_sid("{$this->phpbb_root_path}viewforum.{$this->php_ext}", 'f=' . $row['forum_id']) : false,
'action' => (isset($this->user->lang[$row['log_operation']])) ? $row['log_operation'] : '{' . ucfirst(str_replace('_', ' ', $row['log_operation'])) . '}',
@@ -743,6 +747,7 @@ class log implements \phpbb\log\log_interface
foreach ($log as $key => $row)
{
$log[$key]['viewtopic'] = (isset($topic_auth['f_read'][$row['topic_id']])) ? append_sid("{$this->phpbb_root_path}viewtopic.{$this->php_ext}", 'f=' . $topic_auth['f_read'][$row['topic_id']] . '&amp;t=' . $row['topic_id']) : false;
+ $log[$key]['viewpost'] = (isset($topic_auth['f_read'][$row['topic_id']]) && $row['post_id']) ? append_sid("{$this->phpbb_root_path}viewtopic.{$this->php_ext}", 'f=' . $topic_auth['f_read'][$row['topic_id']] . '&amp;t=' . $row['topic_id'] . '&amp;p=' . $row['post_id']) : false;
$log[$key]['viewlogs'] = (isset($topic_auth['m_'][$row['topic_id']])) ? append_sid("{$this->phpbb_root_path}mcp.{$this->php_ext}", 'i=logs&amp;mode=topic_logs&amp;t=' . $row['topic_id'], true, $this->user->session_id) : false;
}
}
diff --git a/phpBB/phpbb/log/log_interface.php b/phpBB/phpbb/log/log_interface.php
index 5932f722aa..86286e6f88 100644
--- a/phpBB/phpbb/log/log_interface.php
+++ b/phpBB/phpbb/log/log_interface.php
@@ -32,8 +32,8 @@ interface log_interface
* Disable log
*
* This function allows disabling the log system or parts of it, for this
- * page call. When add_log is called and the type is disabled,
- * the log will not be added to the database.
+ * page call. When add() is called and the type is disabled, the log will
+ * not be added to the database.
*
* @param mixed $type The log type we want to disable. Empty to
* disable all logs. Can also be an array of types.
@@ -57,12 +57,12 @@ interface log_interface
/**
* Adds a log entry to the database
*
- * @param string $mode The mode defines which log_type is used and from which log the entry is retrieved
- * @param int $user_id User ID of the user
- * @param string $log_ip IP address of the user
- * @param string $log_operation Name of the operation
- * @param int $log_time Timestamp when the log entry was added, if empty time() will be used
- * @param array $additional_data More arguments can be added, depending on the log_type
+ * @param string $mode The mode defines which log_type is used and from which log the entry is retrieved
+ * @param int $user_id User ID of the user
+ * @param string $log_ip IP address of the user
+ * @param string $log_operation Name of the operation
+ * @param int|bool $log_time Timestamp when the log entry was added. If false, time() will be used
+ * @param array $additional_data More arguments can be added, depending on the log_type
*
* @return int|bool Returns the log_id, if the entry was added to the database, false otherwise.
*/
diff --git a/phpBB/phpbb/module/exception/module_exception.php b/phpBB/phpbb/module/exception/module_exception.php
new file mode 100644
index 0000000000..8ad75112bc
--- /dev/null
+++ b/phpBB/phpbb/module/exception/module_exception.php
@@ -0,0 +1,19 @@
+<?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\module\exception;
+
+class module_exception extends \phpbb\exception\runtime_exception
+{
+
+}
diff --git a/phpBB/phpbb/module/exception/module_not_found_exception.php b/phpBB/phpbb/module/exception/module_not_found_exception.php
new file mode 100644
index 0000000000..2d485e7b35
--- /dev/null
+++ b/phpBB/phpbb/module/exception/module_not_found_exception.php
@@ -0,0 +1,19 @@
+<?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\module\exception;
+
+class module_not_found_exception extends module_exception
+{
+
+}
diff --git a/phpBB/phpbb/module/module_manager.php b/phpBB/phpbb/module/module_manager.php
new file mode 100644
index 0000000000..a812d06736
--- /dev/null
+++ b/phpBB/phpbb/module/module_manager.php
@@ -0,0 +1,564 @@
+<?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\module;
+
+use phpbb\module\exception\module_exception;
+use phpbb\module\exception\module_not_found_exception;
+
+class module_manager
+{
+ /**
+ * @var \phpbb\cache\driver\driver_interface
+ */
+ protected $cache;
+
+ /**
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * @var \phpbb\extension\manager
+ */
+ protected $extension_manager;
+
+ /**
+ * @var string
+ */
+ protected $modules_table;
+
+ /**
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\cache\driver\driver_interface $cache Cache driver
+ * @param \phpbb\db\driver\driver_interface $db Database driver
+ * @param \phpbb\extension\manager $ext_manager Extension manager
+ * @param string $modules_table Module database table's name
+ * @param string $phpbb_root_path Path to phpBB's root
+ * @param string $php_ext Extension of PHP files
+ */
+ public function __construct(\phpbb\cache\driver\driver_interface $cache, \phpbb\db\driver\driver_interface $db, \phpbb\extension\manager $ext_manager, $modules_table, $phpbb_root_path, $php_ext)
+ {
+ $this->cache = $cache;
+ $this->db = $db;
+ $this->extension_manager = $ext_manager;
+ $this->modules_table = $modules_table;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ }
+
+ /**
+ * Get row for specified module
+ *
+ * @param int $module_id ID of the module
+ * @param string $module_class Class of the module (acp, ucp, mcp etc...)
+ *
+ * @return array Array of data fetched from the database
+ *
+ * @throws \phpbb\module\exception\module_not_found_exception When there is no module with $module_id
+ */
+ public function get_module_row($module_id, $module_class)
+ {
+ $module_id = (int) $module_id;
+
+ $sql = 'SELECT *
+ FROM ' . $this->modules_table . "
+ WHERE module_class = '" . $this->db->sql_escape($module_class) . "'
+ AND module_id = $module_id";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if (!$row)
+ {
+ throw new module_not_found_exception('NO_MODULE');
+ }
+
+ return $row;
+ }
+
+ /**
+ * Get available module information from module files
+ *
+ * @param string $module_class Class of the module (acp, ucp, mcp etc...)
+ * @param string $module ID of module
+ * @param bool $use_all_available Use all available instead of just all
+ * enabled extensions
+ *
+ * @return array Array with module information gathered from module info files.
+ */
+ public function get_module_infos($module_class, $module = '', $use_all_available = false)
+ {
+ $directory = $this->phpbb_root_path . 'includes/' . $module_class . '/info/';
+ $fileinfo = array();
+
+ $finder = $this->extension_manager->get_finder($use_all_available);
+
+ $modules = $finder
+ ->extension_suffix('_module')
+ ->extension_directory("/$module_class")
+ ->core_path("includes/$module_class/info/")
+ ->core_prefix($module_class . '_')
+ ->get_classes(true);
+
+ foreach ($modules as $cur_module)
+ {
+ // Skip entries we do not need if we know the module we are
+ // looking for
+ if ($module && strpos(str_replace('\\', '_', $cur_module), $module) === false && $module !== $cur_module)
+ {
+ continue;
+ }
+
+ $info_class = preg_replace('/_module$/', '_info', $cur_module);
+
+ // If the class does not exist it might be following the old
+ // format. phpbb_acp_info_acp_foo needs to be turned into
+ // acp_foo_info and the respective file has to be included
+ // manually because it does not support auto loading
+ $old_info_class_file = str_replace("phpbb_{$module_class}_info_", '', $cur_module);
+ $old_info_class = $old_info_class_file . '_info';
+
+ if (class_exists($old_info_class))
+ {
+ $info_class = $old_info_class;
+ }
+ else if (!class_exists($info_class))
+ {
+ $info_class = $old_info_class;
+
+ // need to check class exists again because previous checks triggered autoloading
+ if (!class_exists($info_class) && file_exists($directory . $old_info_class_file . '.' . $this->php_ext))
+ {
+ include($directory . $old_info_class_file . '.' . $this->php_ext);
+ }
+ }
+
+ if (class_exists($info_class))
+ {
+ $info = new $info_class();
+ $module_info = $info->module();
+
+ $main_class = (isset($module_info['filename'])) ? $module_info['filename'] : $cur_module;
+
+ $fileinfo[$main_class] = $module_info;
+ }
+ }
+
+ ksort($fileinfo);
+
+ return $fileinfo;
+ }
+
+ /**
+ * Get module branch
+ *
+ * @param int $module_id ID of the module
+ * @param string $module_class Class of the module (acp, ucp, mcp etc...)
+ * @param string $type Type of branch (Expected values: all, parents or children)
+ * @param bool $include_module Whether or not to include the specified module with $module_id
+ *
+ * @return array Returns an array containing the modules in the specified branch type.
+ */
+ public function get_module_branch($module_id, $module_class, $type = 'all', $include_module = true)
+ {
+ $module_id = (int) $module_id;
+
+ switch ($type)
+ {
+ case 'parents':
+ $condition = 'm1.left_id BETWEEN m2.left_id AND m2.right_id';
+ break;
+
+ case 'children':
+ $condition = 'm2.left_id BETWEEN m1.left_id AND m1.right_id';
+ break;
+
+ default:
+ $condition = 'm2.left_id BETWEEN m1.left_id AND m1.right_id OR m1.left_id BETWEEN m2.left_id AND m2.right_id';
+ break;
+ }
+
+ $rows = array();
+
+ $sql = 'SELECT m2.*
+ FROM ' . $this->modules_table . ' m1
+ LEFT JOIN ' . $this->modules_table . " m2 ON ($condition)
+ WHERE m1.module_class = '" . $this->db->sql_escape($module_class) . "'
+ AND m2.module_class = '" . $this->db->sql_escape($module_class) . "'
+ AND m1.module_id = $module_id
+ ORDER BY m2.left_id DESC";
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ if (!$include_module && $row['module_id'] == $module_id)
+ {
+ continue;
+ }
+
+ $rows[] = $row;
+ }
+ $this->db->sql_freeresult($result);
+
+ return $rows;
+ }
+
+ /**
+ * Remove modules cache file
+ *
+ * @param string $module_class Class of the module (acp, ucp, mcp etc...)
+ */
+ public function remove_cache_file($module_class)
+ {
+ // Sanitise for future path use, it's escaped as appropriate for queries
+ $cache_class = str_replace(array('.', '/', '\\'), '', basename($module_class));
+ $this->cache->destroy('_modules_' . $cache_class);
+ $this->cache->destroy('sql', $this->modules_table);
+ }
+
+ /**
+ * Update/Add module
+ *
+ * @param array &$module_data The module data
+ *
+ * @throws \phpbb\module\exception\module_not_found_exception When parent module or the category is not exist
+ */
+ public function update_module_data(&$module_data)
+ {
+ if (!isset($module_data['module_id']))
+ {
+ // no module_id means we're creating a new category/module
+ if ($module_data['parent_id'])
+ {
+ $sql = 'SELECT left_id, right_id
+ FROM ' . $this->modules_table . "
+ WHERE module_class = '" . $this->db->sql_escape($module_data['module_class']) . "'
+ AND module_id = " . (int) $module_data['parent_id'];
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if (!$row)
+ {
+ throw new module_not_found_exception('PARENT_NOT_EXIST');
+ }
+
+ // Workaround
+ $row['left_id'] = (int) $row['left_id'];
+ $row['right_id'] = (int) $row['right_id'];
+
+ $sql = 'UPDATE ' . $this->modules_table . "
+ SET left_id = left_id + 2, right_id = right_id + 2
+ WHERE module_class = '" . $this->db->sql_escape($module_data['module_class']) . "'
+ AND left_id > {$row['right_id']}";
+ $this->db->sql_query($sql);
+
+ $sql = 'UPDATE ' . $this->modules_table . "
+ SET right_id = right_id + 2
+ WHERE module_class = '" . $this->db->sql_escape($module_data['module_class']) . "'
+ AND {$row['left_id']} BETWEEN left_id AND right_id";
+ $this->db->sql_query($sql);
+
+ $module_data['left_id'] = (int) $row['right_id'];
+ $module_data['right_id'] = (int) $row['right_id'] + 1;
+ }
+ else
+ {
+ $sql = 'SELECT MAX(right_id) AS right_id
+ FROM ' . $this->modules_table . "
+ WHERE module_class = '" . $this->db->sql_escape($module_data['module_class']) . "'";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $module_data['left_id'] = (int) $row['right_id'] + 1;
+ $module_data['right_id'] = (int) $row['right_id'] + 2;
+ }
+
+ $sql = 'INSERT INTO ' . $this->modules_table . ' ' . $this->db->sql_build_array('INSERT', $module_data);
+ $this->db->sql_query($sql);
+
+ $module_data['module_id'] = $this->db->sql_nextid();
+ }
+ else
+ {
+ $row = $this->get_module_row($module_data['module_id'], $module_data['module_class']);
+
+ if ($module_data['module_basename'] && !$row['module_basename'])
+ {
+ // we're turning a category into a module
+ $branch = $this->get_module_branch($module_data['module_id'], $module_data['module_class'], 'children', false);
+
+ if (sizeof($branch))
+ {
+ throw new module_not_found_exception('NO_CATEGORY_TO_MODULE');
+ }
+ }
+
+ if ($row['parent_id'] != $module_data['parent_id'])
+ {
+ $this->move_module($module_data['module_id'], $module_data['parent_id'], $module_data['module_class']);
+ }
+
+ $update_ary = $module_data;
+ unset($update_ary['module_id']);
+
+ $sql = 'UPDATE ' . $this->modules_table . '
+ SET ' . $this->db->sql_build_array('UPDATE', $update_ary) . "
+ WHERE module_class = '" . $this->db->sql_escape($module_data['module_class']) . "'
+ AND module_id = " . (int) $module_data['module_id'];
+ $this->db->sql_query($sql);
+ }
+ }
+
+ /**
+ * Move module around the tree
+ *
+ * @param int $from_module_id ID of the current parent module
+ * @param int $to_parent_id ID of the target parent module
+ * @param string $module_class Class of the module (acp, ucp, mcp etc...)
+ *
+ * @throws \phpbb\module\exception\module_not_found_exception If the module specified to move modules from does not
+ * have any children.
+ */
+ public function move_module($from_module_id, $to_parent_id, $module_class)
+ {
+ $moved_modules = $this->get_module_branch($from_module_id, $module_class, 'children');
+
+ if (empty($moved_modules))
+ {
+ throw new module_not_found_exception();
+ }
+
+ $from_data = $moved_modules[0];
+ $diff = sizeof($moved_modules) * 2;
+
+ $moved_ids = array();
+ for ($i = 0; $i < sizeof($moved_modules); ++$i)
+ {
+ $moved_ids[] = $moved_modules[$i]['module_id'];
+ }
+
+ // Resync parents
+ $sql = 'UPDATE ' . $this->modules_table . "
+ SET right_id = right_id - $diff
+ WHERE module_class = '" . $this->db->sql_escape($module_class) . "'
+ AND left_id < " . (int) $from_data['right_id'] . '
+ AND right_id > ' . (int) $from_data['right_id'];
+ $this->db->sql_query($sql);
+
+ // Resync righthand side of tree
+ $sql = 'UPDATE ' . $this->modules_table . "
+ SET left_id = left_id - $diff, right_id = right_id - $diff
+ WHERE module_class = '" . $this->db->sql_escape($module_class) . "'
+ AND left_id > " . (int) $from_data['right_id'];
+ $this->db->sql_query($sql);
+
+ if ($to_parent_id > 0)
+ {
+ $to_data = $this->get_module_row($to_parent_id, $module_class);
+
+ // Resync new parents
+ $sql = 'UPDATE ' . $this->modules_table . "
+ SET right_id = right_id + $diff
+ WHERE module_class = '" . $this->db->sql_escape($module_class) . "'
+ AND " . (int) $to_data['right_id'] . ' BETWEEN left_id AND right_id
+ AND ' . $this->db->sql_in_set('module_id', $moved_ids, true);
+ $this->db->sql_query($sql);
+
+ // Resync the righthand side of the tree
+ $sql = 'UPDATE ' . $this->modules_table . "
+ SET left_id = left_id + $diff, right_id = right_id + $diff
+ WHERE module_class = '" . $this->db->sql_escape($module_class) . "'
+ AND left_id > " . (int) $to_data['right_id'] . '
+ AND ' . $this->db->sql_in_set('module_id', $moved_ids, true);
+ $this->db->sql_query($sql);
+
+ // Resync moved branch
+ $to_data['right_id'] += $diff;
+ if ($to_data['right_id'] > $from_data['right_id'])
+ {
+ $diff = '+ ' . ($to_data['right_id'] - $from_data['right_id'] - 1);
+ }
+ else
+ {
+ $diff = '- ' . abs($to_data['right_id'] - $from_data['right_id'] - 1);
+ }
+ }
+ else
+ {
+ $sql = 'SELECT MAX(right_id) AS right_id
+ FROM ' . $this->modules_table . "
+ WHERE module_class = '" . $this->db->sql_escape($module_class) . "'
+ AND " . $this->db->sql_in_set('module_id', $moved_ids, true);
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ $diff = '+ ' . (int) ($row['right_id'] - $from_data['left_id'] + 1);
+ }
+
+ $sql = 'UPDATE ' . $this->modules_table . "
+ SET left_id = left_id $diff, right_id = right_id $diff
+ WHERE module_class = '" . $this->db->sql_escape($module_class) . "'
+ AND " . $this->db->sql_in_set('module_id', $moved_ids);
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * Remove module from tree
+ *
+ * @param int $module_id ID of the module to delete
+ * @param string $module_class Class of the module (acp, ucp, mcp etc...)
+ *
+ * @throws \phpbb\module\exception\module_exception When the specified module cannot be removed
+ */
+ public function delete_module($module_id, $module_class)
+ {
+ $module_id = (int) $module_id;
+
+ $row = $this->get_module_row($module_id, $module_class);
+
+ $branch = $this->get_module_branch($module_id, $module_class, 'children', false);
+
+ if (sizeof($branch))
+ {
+ throw new module_exception('CANNOT_REMOVE_MODULE');
+ }
+
+ // If not move
+ $diff = 2;
+ $sql = 'DELETE FROM ' . $this->modules_table . "
+ WHERE module_class = '" . $this->db->sql_escape($module_class) . "'
+ AND module_id = $module_id";
+ $this->db->sql_query($sql);
+
+ $row['right_id'] = (int) $row['right_id'];
+ $row['left_id'] = (int) $row['left_id'];
+
+ // Resync tree
+ $sql = 'UPDATE ' . $this->modules_table . "
+ SET right_id = right_id - $diff
+ WHERE module_class = '" . $this->db->sql_escape($module_class) . "'
+ AND left_id < {$row['right_id']} AND right_id > {$row['right_id']}";
+ $this->db->sql_query($sql);
+
+ $sql = 'UPDATE ' . $this->modules_table . "
+ SET left_id = left_id - $diff, right_id = right_id - $diff
+ WHERE module_class = '" . $this->db->sql_escape($module_class) . "'
+ AND left_id > {$row['right_id']}";
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * Move module position by $steps up/down
+ *
+ * @param array $module_row Array of module data
+ * @param string $module_class Class of the module (acp, ucp, mcp etc...)
+ * @param string $action Direction of moving (valid values: move_up or move_down)
+ * @param int $steps Number of steps to move module
+ *
+ * @return string Returns the language name of the module
+ *
+ * @throws \phpbb\module\exception\module_not_found_exception When the specified module does not exists
+ */
+ public function move_module_by($module_row, $module_class, $action = 'move_up', $steps = 1)
+ {
+ /**
+ * Fetch all the siblings between the module's current spot
+ * and where we want to move it to. If there are less than $steps
+ * siblings between the current spot and the target then the
+ * module will move as far as possible
+ */
+ $sql = 'SELECT module_id, left_id, right_id, module_langname
+ FROM ' . $this->modules_table . "
+ WHERE module_class = '" . $this->db->sql_escape($module_class) . "'
+ AND parent_id = " . (int) $module_row['parent_id'] . '
+ AND ' . (($action == 'move_up') ? 'right_id < ' . (int) $module_row['right_id'] . ' ORDER BY right_id DESC' : 'left_id > ' . (int) $module_row['left_id'] . ' ORDER BY left_id ASC');
+ $result = $this->db->sql_query_limit($sql, $steps);
+
+ $target = array();
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $target = $row;
+ }
+ $this->db->sql_freeresult($result);
+
+ if (!sizeof($target))
+ {
+ // The module is already on top or bottom
+ throw new module_not_found_exception();
+ }
+
+ /**
+ * $left_id and $right_id define the scope of the nodes that are affected by the move.
+ * $diff_up and $diff_down are the values to substract or add to each node's left_id
+ * and right_id in order to move them up or down.
+ * $move_up_left and $move_up_right define the scope of the nodes that are moving
+ * up. Other nodes in the scope of ($left_id, $right_id) are considered to move down.
+ */
+ if ($action == 'move_up')
+ {
+ $left_id = (int) $target['left_id'];
+ $right_id = (int) $module_row['right_id'];
+
+ $diff_up = (int) ($module_row['left_id'] - $target['left_id']);
+ $diff_down = (int) ($module_row['right_id'] + 1 - $module_row['left_id']);
+
+ $move_up_left = (int) $module_row['left_id'];
+ $move_up_right = (int) $module_row['right_id'];
+ }
+ else
+ {
+ $left_id = (int) $module_row['left_id'];
+ $right_id = (int) $target['right_id'];
+
+ $diff_up = (int) ($module_row['right_id'] + 1 - $module_row['left_id']);
+ $diff_down = (int) ($target['right_id'] - $module_row['right_id']);
+
+ $move_up_left = (int) ($module_row['right_id'] + 1);
+ $move_up_right = (int) $target['right_id'];
+ }
+
+ // Now do the dirty job
+ $sql = 'UPDATE ' . $this->modules_table . "
+ SET left_id = left_id + CASE
+ WHEN left_id BETWEEN {$move_up_left} AND {$move_up_right} THEN -{$diff_up}
+ ELSE {$diff_down}
+ END,
+ right_id = right_id + CASE
+ WHEN right_id BETWEEN {$move_up_left} AND {$move_up_right} THEN -{$diff_up}
+ ELSE {$diff_down}
+ END
+ WHERE module_class = '" . $this->db->sql_escape($module_class) . "'
+ AND left_id BETWEEN {$left_id} AND {$right_id}
+ AND right_id BETWEEN {$left_id} AND {$right_id}";
+ $this->db->sql_query($sql);
+
+ $this->remove_cache_file($module_class);
+
+ return $target['module_langname'];
+ }
+}
diff --git a/phpBB/phpbb/notification/exception.php b/phpBB/phpbb/notification/exception.php
index 83c4526df7..e416438061 100644
--- a/phpBB/phpbb/notification/exception.php
+++ b/phpBB/phpbb/notification/exception.php
@@ -17,10 +17,6 @@ namespace phpbb\notification;
* Notifications exception
*/
-class exception extends \Exception
+class exception extends \phpbb\exception\runtime_exception
{
- public function __toString()
- {
- return $this->getMessage();
- }
}
diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php
index db92170dd8..4be678ac91 100644
--- a/phpBB/phpbb/notification/manager.php
+++ b/phpBB/phpbb/notification/manager.php
@@ -26,7 +26,7 @@ class manager
/** @var array */
protected $subscription_types;
- /** @var array */
+ /** @var method\method_interface[] */
protected $notification_methods;
/** @var ContainerInterface */
@@ -35,9 +35,6 @@ class manager
/** @var \phpbb\user_loader */
protected $user_loader;
- /** @var \phpbb\config\config */
- protected $config;
-
/** @var \phpbb\event\dispatcher_interface */
protected $phpbb_dispatcher;
@@ -51,18 +48,9 @@ class manager
protected $user;
/** @var string */
- protected $phpbb_root_path;
-
- /** @var string */
- protected $php_ext;
-
- /** @var string */
protected $notification_types_table;
/** @var string */
- protected $notifications_table;
-
- /** @var string */
protected $user_notifications_table;
/**
@@ -72,43 +60,35 @@ class manager
* @param array $notification_methods
* @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
- * @param string $phpbb_root_path
- * @param string $php_ext
* @param string $notification_types_table
- * @param string $notifications_table
* @param string $user_notifications_table
*
* @return \phpbb\notification\manager
*/
- 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)
+ public function __construct($notification_types, $notification_methods, ContainerInterface $phpbb_container, \phpbb\user_loader $user_loader, \phpbb\event\dispatcher_interface $phpbb_dispatcher, \phpbb\db\driver\driver_interface $db, \phpbb\cache\service $cache, \phpbb\user $user, $notification_types_table, $user_notifications_table)
{
$this->notification_types = $notification_types;
$this->notification_methods = $notification_methods;
$this->phpbb_container = $phpbb_container;
$this->user_loader = $user_loader;
- $this->config = $config;
$this->phpbb_dispatcher = $phpbb_dispatcher;
$this->db = $db;
$this->cache = $cache;
$this->user = $user;
- $this->phpbb_root_path = $phpbb_root_path;
- $this->php_ext = $php_ext;
-
$this->notification_types_table = $notification_types_table;
- $this->notifications_table = $notifications_table;
$this->user_notifications_table = $user_notifications_table;
}
/**
- * Load the user's notifications
+ * Load the user's notifications for a given method
*
+ * @param string $method_name
* @param array $options Optional options to control what notifications are loaded
* notification_id Notification id to load (or array of notification ids)
* user_id User id to load notifications for (Default: $user->data['user_id'])
@@ -123,27 +103,21 @@ class manager
* 'notifications' array of notification type objects
* 'unread_count' number of unread notifications the user has if count_unread is true in the options
* 'total_count' number of notifications the user has if count_total is true in the options
+ * @throws \phpbb\notification\exception when the method doesn't refer to a class extending \phpbb\notification\method\method_interface
*/
- public function load_notifications(array $options = array())
+ public function load_notifications($method_name, array $options = array())
{
- // Merge default options
- $options = array_merge(array(
- 'notification_id' => false,
- 'user_id' => $this->user->data['user_id'],
- 'order_by' => 'notification_time',
- 'order_dir' => 'DESC',
- 'limit' => 0,
- 'start' => 0,
- 'all_unread' => false,
- 'count_unread' => false,
- 'count_total' => false,
- ), $options);
-
- // If all_unread, count_unread must be true
- $options['count_unread'] = ($options['all_unread']) ? true : $options['count_unread'];
+ $method = $this->get_method_class($method_name);
- // Anonymous users and bots never receive notifications
- if ($options['user_id'] == $this->user->data['user_id'] && ($this->user->data['user_id'] == ANONYMOUS || $this->user->data['user_type'] == USER_IGNORE))
+ if (! $method instanceof \phpbb\notification\method\method_interface)
+ {
+ throw new \phpbb\notification\exception($this->user->lang('NOTIFICATION_METHOD_INVALID', $method_name));
+ }
+ else if ($method->is_available())
+ {
+ return $method->load_notifications($options);
+ }
+ else
{
return array(
'notifications' => array(),
@@ -151,172 +125,111 @@ class manager
'total_count' => 0,
);
}
+ }
- $notifications = $user_ids = array();
- $load_special = array();
- $total_count = $unread_count = 0;
+ /**
+ * Mark notifications read or unread for all available methods
+ *
+ * @param bool|string|array $notification_type_name Type identifier or array of item types (only acceptable if the $data is identical for the specified types). False to mark read for all item types
+ * @param bool|int|array $item_id Item id or array of item ids. False to mark read for all item ids
+ * @param bool|int|array $user_id User id or array of user ids. False to mark read for all user ids
+ * @param bool|int $time Time at which to mark all notifications prior to as read. False to mark all as read. (Default: False)
+ *
+ * @deprecated since 3.2
+ */
+ public function mark_notifications_read($notification_type_name, $item_id, $user_id, $time = false)
+ {
+ $this->mark_notifications($notification_type_name, $item_id, $user_id, $time);
+ }
- if ($options['count_unread'])
+ /**
+ * Mark notifications read or unread for all available methods
+ *
+ * @param bool|string|array $notification_type_name Type identifier or array of item types (only acceptable if the $data is identical for the specified types). False to mark read for all item types
+ * @param bool|int|array $item_id Item id or array of item ids. False to mark read for all item ids
+ * @param bool|int|array $user_id User id or array of user ids. False to mark read for all user ids
+ * @param bool|int $time Time at which to mark all notifications prior to as read. False to mark all as read. (Default: False)
+ * @param bool $mark_read Define if the notification as to be set to True or False. (Default: True)
+ */
+ public function mark_notifications($notification_type_name, $item_id, $user_id, $time = false, $mark_read = true)
+ {
+ if (is_array($notification_type_name))
{
- // Get the total number of unread notifications
- $sql = 'SELECT COUNT(n.notification_id) AS unread_count
- FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
- WHERE n.user_id = ' . (int) $options['user_id'] . '
- AND n.notification_read = 0
- AND nt.notification_type_id = n.notification_type_id
- AND nt.notification_type_enabled = 1';
- $result = $this->db->sql_query($sql);
- $unread_count = (int) $this->db->sql_fetchfield('unread_count');
- $this->db->sql_freeresult($result);
+ $notification_type_id = $this->get_notification_type_ids($notification_type_name);
}
-
- if ($options['count_total'])
+ else if ($notification_type_name !== false)
{
- // Get the total number of notifications
- $sql = 'SELECT COUNT(n.notification_id) AS total_count
- FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
- WHERE n.user_id = ' . (int) $options['user_id'] . '
- AND nt.notification_type_id = n.notification_type_id
- AND nt.notification_type_enabled = 1';
- $result = $this->db->sql_query($sql);
- $total_count = (int) $this->db->sql_fetchfield('total_count');
- $this->db->sql_freeresult($result);
+ $notification_type_id = $this->get_notification_type_id($notification_type_name);
}
-
- if (!$options['count_total'] || $total_count)
+ else
{
- $rowset = array();
-
- // Get the main notifications
- $sql = 'SELECT n.*, nt.notification_type_name
- FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
- WHERE n.user_id = ' . (int) $options['user_id'] .
- (($options['notification_id']) ? ((is_array($options['notification_id'])) ? ' AND ' . $this->db->sql_in_set('n.notification_id', $options['notification_id']) : ' AND n.notification_id = ' . (int) $options['notification_id']) : '') . '
- AND nt.notification_type_id = n.notification_type_id
- AND nt.notification_type_enabled = 1
- ORDER BY n.' . $this->db->sql_escape($options['order_by']) . ' ' . $this->db->sql_escape($options['order_dir']);
- $result = $this->db->sql_query_limit($sql, $options['limit'], $options['start']);
-
- while ($row = $this->db->sql_fetchrow($result))
- {
- $rowset[$row['notification_id']] = $row;
- }
- $this->db->sql_freeresult($result);
-
- // Get all unread notifications
- if ($unread_count && $options['all_unread'] && !empty($rowset))
- {
- $sql = 'SELECT n.*, nt.notification_type_name
- FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
- WHERE n.user_id = ' . (int) $options['user_id'] . '
- AND n.notification_read = 0
- AND ' . $this->db->sql_in_set('n.notification_id', array_keys($rowset), true) . '
- AND nt.notification_type_id = n.notification_type_id
- AND nt.notification_type_enabled = 1
- ORDER BY n.' . $this->db->sql_escape($options['order_by']) . ' ' . $this->db->sql_escape($options['order_dir']);
- $result = $this->db->sql_query_limit($sql, $options['limit'], $options['start']);
-
- while ($row = $this->db->sql_fetchrow($result))
- {
- $rowset[$row['notification_id']] = $row;
- }
- $this->db->sql_freeresult($result);
- }
-
- foreach ($rowset as $row)
- {
- $notification = $this->get_item_type_class($row['notification_type_name'], $row);
-
- // Array of user_ids to query all at once
- $user_ids = array_merge($user_ids, $notification->users_to_query());
-
- // Some notification types also require querying additional tables themselves
- if (!isset($load_special[$row['notification_type_name']]))
- {
- $load_special[$row['notification_type_name']] = array();
- }
- $load_special[$row['notification_type_name']] = array_merge($load_special[$row['notification_type_name']], $notification->get_load_special());
-
- $notifications[$row['notification_id']] = $notification;
- }
-
- $this->user_loader->load_users($user_ids);
-
- // Allow each type to load its own special items
- foreach ($load_special as $item_type => $data)
- {
- $item_class = $this->get_item_type_class($item_type);
-
- $item_class->load_special($data, $notifications);
- }
+ $notification_type_id = false;
}
- return array(
- 'notifications' => $notifications,
- 'unread_count' => $unread_count,
- 'total_count' => $total_count,
- );
+ /** @var method_interface $method */
+ foreach ($this->get_available_subscription_methods() as $method)
+ {
+ $method->mark_notifications($notification_type_id, $item_id, $user_id, $time, $mark_read);
+ }
}
/**
- * Mark notifications read
- *
- * @param bool|string|array $notification_type_name Type identifier or array of item types (only acceptable if the $data is identical for the specified types). False to mark read for all item types
- * @param bool|int|array $item_id Item id or array of item ids. False to mark read for all item ids
- * @param bool|int|array $user_id User id or array of user ids. False to mark read for all user ids
- * @param bool|int $time Time at which to mark all notifications prior to as read. False to mark all as read. (Default: False)
- */
- public function mark_notifications_read($notification_type_name, $item_id, $user_id, $time = false)
+ * Mark notifications read or unread from a parent identifier for all available methods
+ *
+ * @param string|array $notification_type_name Type identifier or array of item types (only acceptable if the $data is identical for the specified types)
+ * @param bool|int|array $item_parent_id Item parent id or array of item parent ids. False to mark read for all item parent ids
+ * @param bool|int|array $user_id User id or array of user ids. False to mark read for all user ids
+ * @param bool|int $time Time at which to mark all notifications prior to as read. False to mark all as read. (Default: False)
+ *
+ * @deprecated since 3.2
+ */
+ public function mark_notifications_read_by_parent($notification_type_name, $item_parent_id, $user_id, $time = false)
{
- $time = ($time !== false) ? $time : time();
-
- $sql = 'UPDATE ' . $this->notifications_table . "
- SET notification_read = 1
- 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)) : '') .
- (($user_id !== false) ? ' AND ' . (is_array($user_id) ? $this->db->sql_in_set('user_id', $user_id) : 'user_id = ' . (int) $user_id) : '') .
- (($item_id !== false) ? ' AND ' . (is_array($item_id) ? $this->db->sql_in_set('item_id', $item_id) : 'item_id = ' . (int) $item_id) : '');
- $this->db->sql_query($sql);
+ $this->mark_notifications_by_parent($notification_type_name, $item_parent_id, $user_id, $time);
}
/**
- * Mark notifications read from a parent identifier
+ * Mark notifications read or unread from a parent identifier for all available methods
*
* @param string|array $notification_type_name Type identifier or array of item types (only acceptable if the $data is identical for the specified types)
* @param bool|int|array $item_parent_id Item parent id or array of item parent ids. False to mark read for all item parent ids
* @param bool|int|array $user_id User id or array of user ids. False to mark read for all user ids
* @param bool|int $time Time at which to mark all notifications prior to as read. False to mark all as read. (Default: False)
+ * @param bool $mark_read Define if the notification as to be set to True or False. (Default: True)
*/
- public function mark_notifications_read_by_parent($notification_type_name, $item_parent_id, $user_id, $time = false)
+ public function mark_notifications_by_parent($notification_type_name, $item_parent_id, $user_id, $time = false, $mark_read = true)
{
- $time = ($time !== false) ? $time : time();
-
- $sql = 'UPDATE ' . $this->notifications_table . "
- SET notification_read = 1
- 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, 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);
+ if (is_array($notification_type_name))
+ {
+ $notification_type_id = $this->get_notification_type_ids($notification_type_name);
+ }
+ else
+ {
+ $notification_type_id = $this->get_notification_type_id($notification_type_name);
+ }
+
+ foreach ($this->get_available_subscription_methods() as $method)
+ {
+ $method->mark_notifications_by_parent($notification_type_id, $item_parent_id, $user_id, $time, $mark_read);
+ }
}
/**
- * Mark notifications read
+ * Mark notifications read or unread for a given method
*
+ * @param string $method_name
* @param int|array $notification_id Notification id or array of notification ids.
* @param bool|int $time Time at which to mark all notifications prior to as read. False to mark all as read. (Default: False)
+ * @param bool $mark_read Define if the notification as to be set to True or False. (Default: True)
*/
- public function mark_notifications_read_by_id($notification_id, $time = false)
+ public function mark_notifications_by_id($method_name, $notification_id, $time = false, $mark_read = true)
{
- $time = ($time !== false) ? $time : time();
+ $method = $this->get_method_class($method_name);
- $sql = 'UPDATE ' . $this->notifications_table . "
- SET notification_read = 1
- WHERE notification_time <= " . (int) $time . '
- AND ' . ((is_array($notification_id)) ? $this->db->sql_in_set('notification_id', $notification_id) : 'notification_id = ' . (int) $notification_id);
- $this->db->sql_query($sql);
+ if ($method instanceof \phpbb\notification\method\method_interface && $method->is_available())
+ {
+ $method->mark_notifications_by_id($notification_id, $time, $mark_read);
+ }
}
/**
@@ -411,18 +324,15 @@ class manager
// Make sure not to send new notifications to users who've already been notified about this item
// This may happen when an item was added, but now new users are able to see the item
- $sql = 'SELECT n.user_id
- FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
- WHERE n.notification_type_id = ' . (int) $notification_type_id . '
- AND n.item_id = ' . (int) $item_id . '
- AND nt.notification_type_id = n.notification_type_id
- AND nt.notification_type_enabled = 1';
- $result = $this->db->sql_query($sql);
- while ($row = $this->db->sql_fetchrow($result))
+ // We remove each user which was already notified by at least one method.
+ foreach ($this->get_subscription_methods_instances() as $method)
{
- unset($notify_users[$row['user_id']]);
+ $notified_users = $method->get_notified_users($notification_type_id, array('item_id' => $item_id));
+ foreach ($notified_users as $user => $notifications)
+ {
+ unset($notify_users[$user]);
+ }
}
- $this->db->sql_freeresult($result);
if (!sizeof($notify_users))
{
@@ -434,8 +344,6 @@ class manager
$pre_create_data = $notification->pre_create_insert_array($data, $notify_users);
unset($notification);
- $insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, $this->notifications_table);
-
// Go through each user so we can insert a row in the DB and then notify them by their desired means
foreach ($notify_users as $user => $methods)
{
@@ -443,8 +351,8 @@ class manager
$notification->user_id = (int) $user;
- // Insert notification row using buffer.
- $insert_buffer->insert($notification->create_insert_array($data, $pre_create_data));
+ // Generate the insert_array
+ $notification->create_insert_array($data, $pre_create_data);
// Users are needed to send notifications
$user_ids = array_merge($user_ids, $notification->users_to_query());
@@ -452,20 +360,15 @@ class manager
foreach ($methods as $method)
{
// setup the notification methods and add the notification to the queue
- if ($method) // blank means we just insert it as a notification, but do not notify them by any other means
+ if (!isset($notification_methods[$method]))
{
- if (!isset($notification_methods[$method]))
- {
- $notification_methods[$method] = $this->get_method_class($method);
- }
-
- $notification_methods[$method]->add_to_queue($notification);
+ $notification_methods[$method] = $this->get_method_class($method);
}
+
+ $notification_methods[$method]->add_to_queue($notification);
}
}
- $insert_buffer->flush();
-
// We need to load all of the users to send notifications
$this->user_loader->load_users($user_ids);
@@ -477,12 +380,13 @@ class manager
}
/**
- * Update a notification
+ * Update notification
*
* @param string|array $notification_type_name Type identifier or array of item types (only acceptable if the $data is identical for the specified types)
* @param array $data Data specific for this type that will be updated
+ * @param array $options
*/
- public function update_notifications($notification_type_name, $data)
+ public function update_notifications($notification_type_name, array $data, array $options = array())
{
if (is_array($notification_type_name))
{
@@ -494,27 +398,27 @@ class manager
return;
}
- $notification = $this->get_item_type_class($notification_type_name);
+ $this->update_notification($this->get_item_type_class($notification_type_name), $data, $options);
+ }
- // Allow the notifications class to over-ride the update_notifications functionality
- if (method_exists($notification, 'update_notifications'))
+ /**
+ * Update a notification
+ *
+ * @param \phpbb\notification\type\type_interface $notification The notification
+ * @param array $data Data specific for this type that will be updated
+ * @param array $options
+ */
+ public function update_notification(\phpbb\notification\type\type_interface $notification, array $data, array $options = array())
+ {
+ if (empty($options))
{
- // Return False to over-ride the rest of the update
- if ($notification->update_notifications($data) === false)
- {
- return;
- }
+ $options['item_id'] = $notification->get_item_id($data);
}
- $notification_type_id = $this->get_notification_type_id($notification_type_name);
- $item_id = $notification->get_item_id($data);
- $update_array = $notification->create_update_array($data);
-
- $sql = 'UPDATE ' . $this->notifications_table . '
- SET ' . $this->db->sql_build_array('UPDATE', $update_array) . '
- WHERE notification_type_id = ' . (int) $notification_type_id . '
- AND item_id = ' . (int) $item_id;
- $this->db->sql_query($sql);
+ foreach ($this->get_available_subscription_methods() as $method)
+ {
+ $method->update_notification($notification, $data, $options);
+ }
}
/**
@@ -523,14 +427,15 @@ class manager
* @param string|array $notification_type_name Type identifier or array of item types (only acceptable if the $item_id is identical for the specified types)
* @param int|array $item_id Identifier within the type (or array of ids)
* @param mixed $parent_id Parent identifier within the type (or array of ids), used in combination with item_id if specified (Default: false; not checked)
+ * @param mixed $user_id User id (Default: false; not checked)
*/
- public function delete_notifications($notification_type_name, $item_id, $parent_id = false)
+ public function delete_notifications($notification_type_name, $item_id, $parent_id = false, $user_id = false)
{
if (is_array($notification_type_name))
{
foreach ($notification_type_name as $type)
{
- $this->delete_notifications($type, $item_id, $parent_id);
+ $this->delete_notifications($type, $item_id, $parent_id, $user_id);
}
return;
@@ -538,11 +443,10 @@ class manager
$notification_type_id = $this->get_notification_type_id($notification_type_name);
- $sql = 'DELETE FROM ' . $this->notifications_table . '
- WHERE notification_type_id = ' . (int) $notification_type_id . '
- AND ' . (is_array($item_id) ? $this->db->sql_in_set('item_id', $item_id) : 'item_id = ' . (int) $item_id) .
- (($parent_id !== false) ? ' AND ' . ((is_array($parent_id) ? $this->db->sql_in_set('item_parent_id', $parent_id) : 'item_parent_id = ' . (int) $parent_id)) : '');
- $this->db->sql_query($sql);
+ foreach ($this->get_available_subscription_methods() as $method)
+ {
+ $method->delete_notifications($notification_type_id, $item_id, $parent_id, $user_id);
+ }
}
/**
@@ -593,16 +497,53 @@ class manager
{
$subscription_methods = array();
+ foreach ($this->get_available_subscription_methods() as $method_name => $method)
+ {
+ $subscription_methods[$method_name] = array(
+ 'id' => $method->get_type(),
+ 'lang' => str_replace('.', '_', strtoupper($method->get_type())),
+ );
+ }
+
+ return $subscription_methods;
+ }
+
+ /**
+ * Get all of the subscription methods
+ *
+ * @return array Array of method's instances
+ */
+ private function get_subscription_methods_instances()
+ {
+ $subscription_methods = array();
+
foreach ($this->notification_methods as $method_name => $data)
{
$method = $this->get_method_class($method_name);
- if ($method instanceof \phpbb\notification\method\method_interface && $method->is_available())
+ if ($method instanceof \phpbb\notification\method\method_interface)
{
- $subscription_methods[$method_name] = array(
- 'id' => $method->get_type(),
- 'lang' => str_replace('.', '_', strtoupper($method->get_type())),
- );
+ $subscription_methods[$method_name] = $method;
+ }
+ }
+
+ return $subscription_methods;
+ }
+
+ /**
+ * Get all of the available subscription methods
+ *
+ * @return array Array of method's instances
+ */
+ private function get_available_subscription_methods()
+ {
+ $subscription_methods = array();
+
+ foreach ($this->get_subscription_methods_instances() as $method_name => $method)
+ {
+ if ($method->is_available())
+ {
+ $subscription_methods[$method_name] = $method;
}
}
@@ -646,9 +587,10 @@ class manager
*/
public function get_global_subscriptions($user_id = false)
{
- $user_id = ($user_id === false) ? $this->user->data['user_id'] : $user_id;
+ $user_id = $user_id ?: $this->user->data['user_id'];
$subscriptions = array();
+ $default_methods = $this->get_default_methods();
$user_notifications = $this->get_user_notifications($user_id);
@@ -656,29 +598,32 @@ class manager
{
foreach ($types as $id => $type)
{
-
- if (empty($user_notifications[$id]))
- {
- // No rows at all, default to ''
- $subscriptions[$id] = array('');
- }
- else
+ $type_subscriptions = $default_methods;
+ if (!empty($user_notifications[$id]))
{
foreach ($user_notifications[$id] as $user_notification)
{
+ $key = array_search($user_notification['method'], $type_subscriptions, true);
if (!$user_notification['notify'])
{
+ if ($key !== false)
+ {
+ unset($type_subscriptions[$key]);
+ }
+
continue;
}
-
- if (!isset($subscriptions[$id]))
+ else if ($key === false)
{
- $subscriptions[$id] = array();
+ $type_subscriptions[] = $user_notification['method'];
}
-
- $subscriptions[$id][] = $user_notification['method'];
}
}
+
+ if (!empty($type_subscriptions))
+ {
+ $subscriptions[$id] = $type_subscriptions;
+ }
}
}
@@ -690,15 +635,20 @@ class manager
*
* @param string $item_type Type identifier of the subscription
* @param int $item_id The id of the item
- * @param string $method The method of the notification e.g. '', 'email', or 'jabber'
+ * @param string $method The method of the notification e.g. 'board', 'email', or 'jabber'
+ * (if null a subscription will be added for all the defaults methods)
* @param bool|int $user_id The user_id to add the subscription for (bool false for current user)
*/
- public function add_subscription($item_type, $item_id = 0, $method = '', $user_id = false)
+ public function add_subscription($item_type, $item_id = 0, $method = null, $user_id = false)
{
- if ($method !== '')
+ if ($method === null)
{
- // Make sure to subscribe them to the base subscription
- $this->add_subscription($item_type, $item_id, '', $user_id);
+ foreach ($this->get_default_methods() as $method_name)
+ {
+ $this->add_subscription($item_type, $item_id, $method_name, $user_id);
+ }
+
+ return;
}
$user_id = ($user_id === false) ? $this->user->data['user_id'] : $user_id;
@@ -742,33 +692,23 @@ class manager
*
* @param string $item_type Type identifier of the subscription
* @param int $item_id The id of the item
- * @param string $method The method of the notification e.g. '', 'email', or 'jabber'
+ * @param string $method The method of the notification e.g. 'board', 'email', or 'jabber'
* @param bool|int $user_id The user_id to add the subscription for (bool false for current user)
*/
- public function delete_subscription($item_type, $item_id = 0, $method = '', $user_id = false)
+ public function delete_subscription($item_type, $item_id = 0, $method = null, $user_id = false)
{
- $user_id = ($user_id === false) ? $this->user->data['user_id'] : $user_id;
-
- // If no method, make sure that no other notification methods for this item are selected before deleting
- if ($method === '')
+ if ($method === null)
{
- $sql = 'SELECT COUNT(*) as num_notifications
- FROM ' . $this->user_notifications_table . "
- WHERE item_type = '" . $this->db->sql_escape($item_type) . "'
- AND item_id = " . (int) $item_id . '
- AND user_id = ' .(int) $user_id . "
- AND method <> ''
- AND notify = 1";
- $this->db->sql_query($sql);
- $num_notifications = $this->db->sql_fetchfield('num_notifications');
- $this->db->sql_freeresult();
-
- if ($num_notifications)
+ foreach ($this->get_default_methods() as $method_name)
{
- return;
+ $this->delete_subscription($item_type, $item_id, $method_name, $user_id);
}
+
+ return;
}
+ $user_id = $user_id ?: $this->user->data['user_id'];
+
$sql = 'UPDATE ' . $this->user_notifications_table . "
SET notify = 0
WHERE item_type = '" . $this->db->sql_escape($item_type) . "'
@@ -828,15 +768,11 @@ class manager
{
$notification_type_id = $this->get_notification_type_id($notification_type_name);
- $sql = 'DELETE FROM ' . $this->notifications_table . '
- WHERE notification_type_id = ' . (int) $notification_type_id;
- $this->db->sql_query($sql);
-
- $sql = 'DELETE FROM ' . $this->notification_types_table . '
- WHERE notification_type_id = ' . (int) $notification_type_id;
- $this->db->sql_query($sql);
+ foreach ($this->get_available_subscription_methods() as $method)
+ {
+ $method->purge_notifications($notification_type_id);
+ }
- $this->cache->destroy('notification_type_ids');
}
catch (\phpbb\notification\exception $e)
{
@@ -869,17 +805,37 @@ class manager
*/
public function prune_notifications($timestamp, $only_read = true)
{
- $sql = 'DELETE FROM ' . $this->notifications_table . '
- WHERE notification_time < ' . (int) $timestamp .
- (($only_read) ? ' AND notification_read = 1' : '');
- $this->db->sql_query($sql);
+ foreach ($this->get_available_subscription_methods() as $method)
+ {
+ $method->prune_notifications($timestamp, $only_read);
+ }
+ }
- $this->config->set('read_notification_last_gc', time(), false);
+ /**
+ * Helper to get the list of methods enabled by default
+ *
+ * @return method\method_interface[]
+ */
+ public function get_default_methods()
+ {
+ $default_methods = array();
+
+ foreach ($this->notification_methods as $method)
+ {
+ if ($method->is_enabled_by_default() && $method->is_available())
+ {
+ $default_methods[] = $method->get_type();
+ }
+ }
+
+ return $default_methods;
}
/**
- * Helper to get the notifications item type class and set it up
- */
+ * Helper to get the notifications item type class and set it up
+ *
+ * @return type\type_interface
+ */
public function get_item_type_class($notification_type_name, $data = array())
{
$item = $this->load_object($notification_type_name);
@@ -890,16 +846,20 @@ class manager
}
/**
- * Helper to get the notifications method class and set it up
- */
+ * Helper to get the notifications method class and set it up
+ *
+ * @return method\method_interface
+ */
public function get_method_class($method_name)
{
return $this->load_object($method_name);
}
/**
- * Helper to load objects (notification types/methods)
- */
+ * Helper to load objects (notification types/methods)
+ *
+ * @return method\method_interface|type\type_interface
+ */
protected function load_object($object_name)
{
$object = $this->phpbb_container->get($object_name);
@@ -943,7 +903,7 @@ class manager
{
if (!isset($this->notification_types[$notification_type_name]) && !isset($this->notification_types['notification.type.' . $notification_type_name]))
{
- throw new \phpbb\notification\exception($this->user->lang('NOTIFICATION_TYPE_NOT_EXIST', $notification_type_name));
+ throw new \phpbb\notification\exception('NOTIFICATION_TYPE_NOT_EXIST', array($notification_type_name));
}
$sql = 'INSERT INTO ' . $this->notification_types_table . ' ' . $this->db->sql_build_array('INSERT', array(
@@ -977,4 +937,24 @@ class manager
return $notification_type_ids;
}
+
+ /**
+ * Find the users which are already notified
+ *
+ * @param bool|string|array $notification_type_name Type identifier or array of item types (only acceptable if the $data is identical for the specified types). False to retrieve all item types
+ * @param array $options
+ * @return array The list of the notified users
+ */
+ public function get_notified_users($notification_type_name, array $options)
+ {
+ $notification_type_id = $this->get_notification_type_id($notification_type_name);
+
+ $notified_users = array();
+ foreach ($this->get_available_subscription_methods() as $method)
+ {
+ $notified_users = $notified_users + $method->get_notified_users($notification_type_id, $options);
+ }
+
+ return $notified_users;
+ }
}
diff --git a/phpBB/phpbb/notification/method/base.php b/phpBB/phpbb/notification/method/base.php
index 6ee1d2984a..4a183ca508 100644
--- a/phpBB/phpbb/notification/method/base.php
+++ b/phpBB/phpbb/notification/method/base.php
@@ -21,36 +21,6 @@ abstract class base implements \phpbb\notification\method\method_interface
/** @var \phpbb\notification\manager */
protected $notification_manager;
- /** @var \phpbb\user_loader */
- protected $user_loader;
-
- /** @var \phpbb\db\driver\driver_interface */
- protected $db;
-
- /** @var \phpbb\cache\driver\driver_interface */
- protected $cache;
-
- /** @var \phpbb\template\template */
- protected $template;
-
- /** @var \phpbb\extension\manager */
- protected $extension_manager;
-
- /** @var \phpbb\user */
- protected $user;
-
- /** @var \phpbb\auth\auth */
- protected $auth;
-
- /** @var \phpbb\config\config */
- protected $config;
-
- /** @var string */
- protected $phpbb_root_path;
-
- /** @var string */
- protected $php_ext;
-
/**
* Queue of messages to be sent
*
@@ -59,38 +29,43 @@ abstract class base implements \phpbb\notification\method\method_interface
protected $queue = array();
/**
- * Notification Method Base Constructor
+ * Set notification manager (required)
*
- * @param \phpbb\user_loader $user_loader
- * @param \phpbb\db\driver\driver_interface $db
- * @param \phpbb\cache\driver\driver_interface $cache
- * @param \phpbb\user $user
- * @param \phpbb\auth\auth $auth
- * @param \phpbb\config\config $config
- * @param string $phpbb_root_path
- * @param string $php_ext
- * @return \phpbb\notification\method\base
+ * @param \phpbb\notification\manager $notification_manager
*/
- public function __construct(\phpbb\user_loader $user_loader, \phpbb\db\driver\driver_interface $db, \phpbb\cache\driver\driver_interface $cache, $user, \phpbb\auth\auth $auth, \phpbb\config\config $config, $phpbb_root_path, $php_ext)
+ public function set_notification_manager(\phpbb\notification\manager $notification_manager)
{
- $this->user_loader = $user_loader;
- $this->db = $db;
- $this->cache = $cache;
- $this->user = $user;
- $this->auth = $auth;
- $this->config = $config;
- $this->phpbb_root_path = $phpbb_root_path;
- $this->php_ext = $php_ext;
+ $this->notification_manager = $notification_manager;
}
/**
- * Set notification manager (required)
+ * Is the method enable by default?
*
- * @param \phpbb\notification\manager $notification_manager
+ * @return bool
*/
- public function set_notification_manager(\phpbb\notification\manager $notification_manager)
+ public function is_enabled_by_default()
{
- $this->notification_manager = $notification_manager;
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_notified_users($notification_type_id, array $options)
+ {
+ return array();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function load_notifications(array $options = array())
+ {
+ return array(
+ 'notifications' => array(),
+ 'unread_count' => 0,
+ 'total_count' => 0,
+ );
}
/**
@@ -104,6 +79,55 @@ abstract class base implements \phpbb\notification\method\method_interface
}
/**
+ * {@inheritdoc}
+ */
+ public function update_notification($notification, array $data, array $options)
+ {
+ }
+
+ /**
+ * {@inheritdoc
+ */
+ public function mark_notifications($notification_type_id, $item_id, $user_id, $time = false, $mark_read = true)
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function mark_notifications_by_parent($notification_type_id, $item_parent_id, $user_id, $time = false, $mark_read = true)
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function mark_notifications_by_id($notification_id, $time = false, $mark_read = true)
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function delete_notifications($notification_type_id, $item_id, $parent_id = false, $user_id = false)
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function prune_notifications($timestamp, $only_read = true)
+ {
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function purge_notifications($notification_type_id)
+ {
+ }
+
+ /**
* Empty the queue
*/
protected function empty_queue()
diff --git a/phpBB/phpbb/notification/method/board.php b/phpBB/phpbb/notification/method/board.php
new file mode 100644
index 0000000000..c45f3a8caa
--- /dev/null
+++ b/phpBB/phpbb/notification/method/board.php
@@ -0,0 +1,398 @@
+<?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\notification\method;
+
+/**
+* In Board notification method class
+* This class handles in board notifications. This method is enabled by default.
+*
+* @package notifications
+*/
+class board extends \phpbb\notification\method\base
+{
+ /** @var \phpbb\user_loader */
+ protected $user_loader;
+
+ /** @var \phpbb\db\driver\driver_interface */
+ protected $db;
+
+ /** @var \phpbb\cache\driver\driver_interface */
+ protected $cache;
+
+ /** @var \phpbb\user */
+ protected $user;
+
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ /** @var string */
+ protected $notification_types_table;
+
+ /** @var string */
+ protected $notifications_table;
+
+ /**
+ * Notification Method Board Constructor
+ *
+ * @param \phpbb\user_loader $user_loader
+ * @param \phpbb\db\driver\driver_interface $db
+ * @param \phpbb\cache\driver\driver_interface $cache
+ * @param \phpbb\user $user
+ * @param \phpbb\config\config $config
+ * @param string $notification_types_table
+ * @param string $notifications_table
+ */
+ public function __construct(\phpbb\user_loader $user_loader, \phpbb\db\driver\driver_interface $db, \phpbb\cache\driver\driver_interface $cache, \phpbb\user $user, \phpbb\config\config $config, $notification_types_table, $notifications_table)
+ {
+ $this->user_loader = $user_loader;
+ $this->db = $db;
+ $this->cache = $cache;
+ $this->user = $user;
+ $this->config = $config;
+ $this->notification_types_table = $notification_types_table;
+ $this->notifications_table = $notifications_table;
+
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function add_to_queue(\phpbb\notification\type\type_interface $notification)
+ {
+ $this->queue[] = $notification;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_type()
+ {
+ return 'notification.method.board';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_available()
+ {
+ return $this->config['allow_board_notifications'];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function is_enabled_by_default()
+ {
+ return true;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_notified_users($notification_type_id, array $options)
+ {
+ $notified_users = array();
+ $sql = 'SELECT n.*
+ FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
+ WHERE n.notification_type_id = ' . (int) $notification_type_id .
+ (isset($options['item_id']) ? ' AND n.item_id = ' . (int) $options['item_id'] : '') .
+ (isset($options['item_parent_id']) ? ' AND n.item_parent_id = ' . (int) $options['item_parent_id'] : '') .
+ (isset($options['user_id']) ? ' AND n.user_id = ' . (int) $options['user_id'] : '') .
+ (isset($options['read']) ? ' AND n.notification_read = ' . (int) $options['read'] : '') .'
+ AND nt.notification_type_id = n.notification_type_id
+ AND nt.notification_type_enabled = 1';
+ $result = $this->db->sql_query($sql);
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $notified_users[$row['user_id']] = $row;
+ }
+ $this->db->sql_freeresult($result);
+
+ return $notified_users;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function load_notifications(array $options = array())
+ {
+ // Merge default options
+ $options = array_merge(array(
+ 'notification_id' => false,
+ 'user_id' => $this->user->data['user_id'],
+ 'order_by' => 'notification_time',
+ 'order_dir' => 'DESC',
+ 'limit' => 0,
+ 'start' => 0,
+ 'all_unread' => false,
+ 'count_unread' => false,
+ 'count_total' => false,
+ ), $options);
+
+ // If all_unread, count_unread must be true
+ $options['count_unread'] = ($options['all_unread']) ? true : $options['count_unread'];
+
+ // Anonymous users and bots never receive notifications
+ if ($options['user_id'] == $this->user->data['user_id'] && ($this->user->data['user_id'] == ANONYMOUS || $this->user->data['user_type'] == USER_IGNORE))
+ {
+ return array(
+ 'notifications' => array(),
+ 'unread_count' => 0,
+ 'total_count' => 0,
+ );
+ }
+
+ $notifications = $user_ids = array();
+ $load_special = array();
+ $total_count = $unread_count = 0;
+
+ if ($options['count_unread'])
+ {
+ // Get the total number of unread notifications
+ $sql = 'SELECT COUNT(n.notification_id) AS unread_count
+ FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
+ WHERE n.user_id = ' . (int) $options['user_id'] . '
+ AND n.notification_read = 0
+ AND nt.notification_type_id = n.notification_type_id
+ AND nt.notification_type_enabled = 1';
+ $result = $this->db->sql_query($sql);
+ $unread_count = (int) $this->db->sql_fetchfield('unread_count');
+ $this->db->sql_freeresult($result);
+ }
+
+ if ($options['count_total'])
+ {
+ // Get the total number of notifications
+ $sql = 'SELECT COUNT(n.notification_id) AS total_count
+ FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
+ WHERE n.user_id = ' . (int) $options['user_id'] . '
+ AND nt.notification_type_id = n.notification_type_id
+ AND nt.notification_type_enabled = 1';
+ $result = $this->db->sql_query($sql);
+ $total_count = (int) $this->db->sql_fetchfield('total_count');
+ $this->db->sql_freeresult($result);
+ }
+
+ if (!$options['count_total'] || $total_count)
+ {
+ $rowset = array();
+
+ // Get the main notifications
+ $sql = 'SELECT n.*, nt.notification_type_name
+ FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
+ WHERE n.user_id = ' . (int) $options['user_id'] .
+ (($options['notification_id']) ? ((is_array($options['notification_id'])) ? ' AND ' . $this->db->sql_in_set('n.notification_id', $options['notification_id']) : ' AND n.notification_id = ' . (int) $options['notification_id']) : '') . '
+ AND nt.notification_type_id = n.notification_type_id
+ AND nt.notification_type_enabled = 1
+ ORDER BY n.' . $this->db->sql_escape($options['order_by']) . ' ' . $this->db->sql_escape($options['order_dir']);
+ $result = $this->db->sql_query_limit($sql, $options['limit'], $options['start']);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $rowset[$row['notification_id']] = $row;
+ }
+ $this->db->sql_freeresult($result);
+
+ // Get all unread notifications
+ if ($unread_count && $options['all_unread'] && !empty($rowset))
+ {
+ $sql = 'SELECT n.*, nt.notification_type_name
+ FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
+ WHERE n.user_id = ' . (int) $options['user_id'] . '
+ AND n.notification_read = 0
+ AND ' . $this->db->sql_in_set('n.notification_id', array_keys($rowset), true) . '
+ AND nt.notification_type_id = n.notification_type_id
+ AND nt.notification_type_enabled = 1
+ ORDER BY n.' . $this->db->sql_escape($options['order_by']) . ' ' . $this->db->sql_escape($options['order_dir']);
+ $result = $this->db->sql_query_limit($sql, $options['limit'], $options['start']);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ $rowset[$row['notification_id']] = $row;
+ }
+ $this->db->sql_freeresult($result);
+ }
+
+ foreach ($rowset as $row)
+ {
+ $notification = $this->notification_manager->get_item_type_class($row['notification_type_name'], $row);
+
+ // Array of user_ids to query all at once
+ $user_ids = array_merge($user_ids, $notification->users_to_query());
+
+ // Some notification types also require querying additional tables themselves
+ if (!isset($load_special[$row['notification_type_name']]))
+ {
+ $load_special[$row['notification_type_name']] = array();
+ }
+ $load_special[$row['notification_type_name']] = array_merge($load_special[$row['notification_type_name']], $notification->get_load_special());
+
+ $notifications[$row['notification_id']] = $notification;
+ }
+
+ $this->user_loader->load_users($user_ids);
+
+ // Allow each type to load its own special items
+ foreach ($load_special as $item_type => $data)
+ {
+ $item_class = $this->notification_manager->get_item_type_class($item_type);
+
+ $item_class->load_special($data, $notifications);
+ }
+ }
+
+ return array(
+ 'notifications' => $notifications,
+ 'unread_count' => $unread_count,
+ 'total_count' => $total_count,
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function notify()
+ {
+ $insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, $this->notifications_table);
+
+ foreach ($this->queue as $notification)
+ {
+ $data = $notification->get_insert_array();
+ $insert_buffer->insert($data);
+ }
+
+ $insert_buffer->flush();
+
+ // We're done, empty the queue
+ $this->empty_queue();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function update_notification($notification, array $data, array $options)
+ {
+ // Allow the notifications class to over-ride the update_notifications functionality
+ if (method_exists($notification, 'update_notifications'))
+ {
+ // Return False to over-ride the rest of the update
+ if ($notification->update_notifications($data) === false)
+ {
+ return;
+ }
+ }
+
+ $notification_type_id = $this->notification_manager->get_notification_type_id($notification->get_type());
+ $update_array = $notification->create_update_array($data);
+
+ $sql = 'UPDATE ' . $this->notifications_table . '
+ SET ' . $this->db->sql_build_array('UPDATE', $update_array) . '
+ WHERE notification_type_id = ' . (int) $notification_type_id .
+ (isset($options['item_id']) ? ' AND item_id = ' . (int) $options['item_id'] : '') .
+ (isset($options['item_parent_id']) ? ' AND item_parent_id = ' . (int) $options['item_parent_id'] : '') .
+ (isset($options['user_id']) ? ' AND user_id = ' . (int) $options['user_id'] : '') .
+ (isset($options['read']) ? ' AND notification_read = ' . (int) $options['read'] : '');
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function mark_notifications($notification_type_id, $item_id, $user_id, $time = false, $mark_read = true)
+ {
+ $time = ($time !== false) ? $time : time();
+
+ $sql = 'UPDATE ' . $this->notifications_table . '
+ SET notification_read = ' . ($mark_read ? 1 : 0) . '
+ WHERE notification_time <= ' . (int) $time .
+ (($notification_type_id !== false) ? ' AND ' .
+ (is_array($notification_type_id) ? $this->db->sql_in_set('notification_type_id', $notification_type_id) : 'notification_type_id = ' . $notification_type_id) : '') .
+ (($user_id !== false) ? ' AND ' . (is_array($user_id) ? $this->db->sql_in_set('user_id', $user_id) : 'user_id = ' . (int) $user_id) : '') .
+ (($item_id !== false) ? ' AND ' . (is_array($item_id) ? $this->db->sql_in_set('item_id', $item_id) : 'item_id = ' . (int) $item_id) : '');
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function mark_notifications_by_parent($notification_type_id, $item_parent_id, $user_id, $time = false, $mark_read = true)
+ {
+ $time = ($time !== false) ? $time : time();
+
+ $sql = 'UPDATE ' . $this->notifications_table . '
+ SET notification_read = ' . ($mark_read ? 1 : 0) . '
+ WHERE notification_time <= ' . (int) $time .
+ (($notification_type_id !== false) ? ' AND ' .
+ (is_array($notification_type_id) ? $this->db->sql_in_set('notification_type_id', $notification_type_id) : 'notification_type_id = ' . $notification_type_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);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function mark_notifications_by_id($notification_id, $time = false, $mark_read = true)
+ {
+ $time = ($time !== false) ? $time : time();
+
+ $sql = 'UPDATE ' . $this->notifications_table . '
+ SET notification_read = ' . ($mark_read ? 1 : 0) . '
+ WHERE notification_time <= ' . (int) $time . '
+ AND ' . ((is_array($notification_id)) ? $this->db->sql_in_set('notification_id', $notification_id) : 'notification_id = ' . (int) $notification_id);
+ $this->db->sql_query($sql);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function delete_notifications($notification_type_id, $item_id, $parent_id = false, $user_id = false)
+ {
+ $sql = 'DELETE FROM ' . $this->notifications_table . '
+ WHERE notification_type_id = ' . (int) $notification_type_id . '
+ AND ' . (is_array($item_id) ? $this->db->sql_in_set('item_id', $item_id) : 'item_id = ' . (int) $item_id) .
+ (($parent_id !== false) ? ' AND ' . ((is_array($parent_id) ? $this->db->sql_in_set('item_parent_id', $parent_id) : 'item_parent_id = ' . (int) $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);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function prune_notifications($timestamp, $only_read = true)
+ {
+ $sql = 'DELETE FROM ' . $this->notifications_table . '
+ WHERE notification_time < ' . (int) $timestamp .
+ (($only_read) ? ' AND notification_read = 1' : '');
+ $this->db->sql_query($sql);
+
+ $this->config->set('read_notification_last_gc', time(), false);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function purge_notifications($notification_type_id)
+ {
+ $sql = 'DELETE FROM ' . $this->notifications_table . '
+ WHERE notification_type_id = ' . (int) $notification_type_id;
+ $this->db->sql_query($sql);
+
+ $sql = 'DELETE FROM ' . $this->notification_types_table . '
+ WHERE notification_type_id = ' . (int) $notification_type_id;
+ $this->db->sql_query($sql);
+
+ $this->cache->destroy('notification_type_ids');
+ }
+}
diff --git a/phpBB/phpbb/notification/method/email.php b/phpBB/phpbb/notification/method/email.php
index a4b93bc85c..21a6559012 100644
--- a/phpBB/phpbb/notification/method/email.php
+++ b/phpBB/phpbb/notification/method/email.php
@@ -20,6 +20,29 @@ namespace phpbb\notification\method;
class email extends \phpbb\notification\method\messenger_base
{
+ /** @var \phpbb\user */
+ protected $user;
+
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ /**
+ * Notification Method email Constructor
+ *
+ * @param \phpbb\user_loader $user_loader
+ * @param \phpbb\user $user
+ * @param \phpbb\config\config $config
+ * @param string $phpbb_root_path
+ * @param string $php_ext
+ */
+ public function __construct(\phpbb\user_loader $user_loader, \phpbb\user $user, \phpbb\config\config $config, $phpbb_root_path, $php_ext)
+ {
+ parent::__construct($user_loader, $phpbb_root_path, $php_ext);
+
+ $this->user = $user;
+ $this->config = $config;
+ }
+
/**
* Get notification method name
*
diff --git a/phpBB/phpbb/notification/method/jabber.php b/phpBB/phpbb/notification/method/jabber.php
index 09f186e3ca..509c6b432c 100644
--- a/phpBB/phpbb/notification/method/jabber.php
+++ b/phpBB/phpbb/notification/method/jabber.php
@@ -20,6 +20,29 @@ namespace phpbb\notification\method;
class jabber extends \phpbb\notification\method\messenger_base
{
+ /** @var \phpbb\user */
+ protected $user;
+
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ /**
+ * Notification Method jabber Constructor
+ *
+ * @param \phpbb\user_loader $user_loader
+ * @param \phpbb\user $user
+ * @param \phpbb\config\config $config
+ * @param string $phpbb_root_path
+ * @param string $php_ext
+ */
+ public function __construct(\phpbb\user_loader $user_loader, \phpbb\user $user, \phpbb\config\config $config, $phpbb_root_path, $php_ext)
+ {
+ parent::__construct($user_loader, $phpbb_root_path, $php_ext);
+
+ $this->user = $user;
+ $this->config = $config;
+ }
+
/**
* Get notification method name
*
@@ -61,6 +84,6 @@ class jabber extends \phpbb\notification\method\messenger_base
return;
}
- return $this->notify_using_messenger(NOTIFY_IM, 'short/');
+ $this->notify_using_messenger(NOTIFY_IM, 'short/');
}
}
diff --git a/phpBB/phpbb/notification/method/messenger_base.php b/phpBB/phpbb/notification/method/messenger_base.php
index c3aee088f9..61119b9882 100644
--- a/phpBB/phpbb/notification/method/messenger_base.php
+++ b/phpBB/phpbb/notification/method/messenger_base.php
@@ -19,6 +19,29 @@ namespace phpbb\notification\method;
*/
abstract class messenger_base extends \phpbb\notification\method\base
{
+ /** @var \phpbb\user_loader */
+ protected $user_loader;
+
+ /** @var string */
+ protected $phpbb_root_path;
+
+ /** @var string */
+ protected $php_ext;
+
+ /**
+ * Notification Method Board Constructor
+ *
+ * @param \phpbb\user_loader $user_loader
+ * @param string $phpbb_root_path
+ * @param string $php_ext
+ */
+ public function __construct(\phpbb\user_loader $user_loader, $phpbb_root_path, $php_ext)
+ {
+ $this->user_loader = $user_loader;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ }
+
/**
* Notify using phpBB messenger
*
@@ -57,7 +80,6 @@ abstract class messenger_base extends \phpbb\notification\method\base
include($this->phpbb_root_path . 'includes/functions_messenger.' . $this->php_ext);
}
$messenger = new \messenger();
- $board_url = generate_board_url();
// Time to go through the queue and send emails
foreach ($this->queue as $notification)
diff --git a/phpBB/phpbb/notification/method/method_interface.php b/phpBB/phpbb/notification/method/method_interface.php
index 76b0de179c..c2e4940485 100644
--- a/phpBB/phpbb/notification/method/method_interface.php
+++ b/phpBB/phpbb/notification/method/method_interface.php
@@ -26,12 +26,48 @@ interface method_interface
public function get_type();
/**
+ * Is the method enable by default?
+ *
+ * @return bool
+ */
+ public function is_enabled_by_default();
+
+ /**
* Is this method available for the user?
* This is checked on the notifications options
*/
public function is_available();
/**
+ * Return the list of the users already notified
+ *
+ * @param int $notification_type_id Type of the notification
+ * @param array $options
+ * @return array User
+ */
+ public function get_notified_users($notification_type_id, array $options);
+
+ /**
+ * Load the user's notifications
+ *
+ * @param array $options Optional options to control what notifications are loaded
+ * notification_id Notification id to load (or array of notification ids)
+ * user_id User id to load notifications for (Default: $user->data['user_id'])
+ * order_by Order by (Default: notification_time)
+ * order_dir Order direction (Default: DESC)
+ * limit Number of notifications to load (Default: 5)
+ * start Notifications offset (Default: 0)
+ * all_unread Load all unread notifications? If set to true, count_unread is set to true (Default: false)
+ * count_unread Count all unread notifications? (Default: false)
+ * count_total Count all notifications? (Default: false)
+ * @return array Array of information based on the request with keys:
+ * 'notifications' array of notification type objects
+ * 'unread_count' number of unread notifications the user has if count_unread is true in the options
+ * 'total_count' number of notifications the user has if count_total is true in the options
+ */
+ public function load_notifications(array $options = array());
+
+ /**
* Add a notification to the queue
*
* @param \phpbb\notification\type\type_interface $notification
@@ -42,4 +78,72 @@ interface method_interface
* Parse the queue and notify the users
*/
public function notify();
+
+ /**
+ * Update a notification
+ *
+ * @param \phpbb\notification\type\type_interface $notification Notification to update
+ * @param array $data Data specific for this type that will be updated
+ * @param array $options
+ */
+ public function update_notification($notification, array $data, array $options);
+
+ /**
+ * Mark notifications read or unread
+ *
+ * @param bool|string $notification_type_id Type identifier of item types. False to mark read for all item types
+ * @param bool|int|array $item_id Item id or array of item ids. False to mark read for all item ids
+ * @param bool|int|array $user_id User id or array of user ids. False to mark read for all user ids
+ * @param bool|int $time Time at which to mark all notifications prior to as read. False to mark all as read. (Default: False)
+ * @param bool $mark_read Define if the notification as to be set to True or False. (Default: True)
+ */
+ public function mark_notifications($notification_type_id, $item_id, $user_id, $time = false, $mark_read = true);
+
+ /**
+ * Mark notifications read or unread from a parent identifier
+ *
+ * @param string $notification_type_id Type identifier of item types
+ * @param bool|int|array $item_parent_id Item parent id or array of item parent ids. False to mark read for all item parent ids
+ * @param bool|int|array $user_id User id or array of user ids. False to mark read for all user ids
+ * @param bool|int $time Time at which to mark all notifications prior to as read. False to mark all as read. (Default: False)
+ * @param bool $mark_read Define if the notification as to be set to True or False. (Default: True)
+ */
+ public function mark_notifications_by_parent($notification_type_id, $item_parent_id, $user_id, $time = false, $mark_read = true);
+
+ /**
+ * Mark notifications read or unread
+ *
+ * @param int $notification_id Notification id of notification ids.
+ * @param bool|int $time Time at which to mark all notifications prior to as read. False to mark all as read. (Default: False)
+ * @param bool $mark_read Define if the notification as to be set to True or False. (Default: True)
+ */
+ public function mark_notifications_by_id($notification_id, $time = false, $mark_read = true);
+
+ /**
+ * Delete a notification
+ *
+ * @param string $notification_type_id Type identifier of item types
+ * @param int|array $item_id Identifier within the type (or array of ids)
+ * @param mixed $parent_id Parent identifier within the type (or array of ids), used in combination with item_id if specified (Default: false; not checked)
+ * @param mixed $user_id User id (Default: false; not checked)
+ */
+ public function delete_notifications($notification_type_id, $item_id, $parent_id = false, $user_id = false);
+
+ /**
+ * Delete all notifications older than a certain time
+ *
+ * @param int $timestamp Unix timestamp to delete all notifications that were created before
+ * @param bool $only_read True (default) to only prune read notifications
+ */
+ public function prune_notifications($timestamp, $only_read = true);
+
+ /**
+ * Purge all notifications of a certain type
+ *
+ * This should be called when an extension which has notification types
+ * is purged so that all those notifications are removed
+ *
+ * @param string $notification_type_id Type identifier of the subscription
+ */
+ public function purge_notifications($notification_type_id);
}
diff --git a/phpBB/phpbb/notification/type/admin_activate_user.php b/phpBB/phpbb/notification/type/admin_activate_user.php
index 7c5c18aa47..b191fa62ae 100644
--- a/phpBB/phpbb/notification/type/admin_activate_user.php
+++ b/phpBB/phpbb/notification/type/admin_activate_user.php
@@ -36,11 +36,27 @@ class admin_activate_user extends \phpbb\notification\type\base
/**
* {@inheritdoc}
*/
- public static $notification_option = array(
+ static public $notification_option = array(
'lang' => 'NOTIFICATION_TYPE_ADMIN_ACTIVATE_USER',
'group' => 'NOTIFICATION_GROUP_ADMINISTRATION',
);
+ /** @var \phpbb\user_loader */
+ protected $user_loader;
+
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ public function set_config(\phpbb\config\config $config)
+ {
+ $this->config = $config;
+ }
+
+ public function set_user_loader(\phpbb\user_loader $user_loader)
+ {
+ $this->user_loader = $user_loader;
+ }
+
/**
* {@inheritdoc}
*/
@@ -52,7 +68,7 @@ class admin_activate_user extends \phpbb\notification\type\base
/**
* {@inheritdoc}
*/
- public static function get_item_id($user)
+ static public function get_item_id($user)
{
return (int) $user['user_id'];
}
@@ -60,7 +76,7 @@ class admin_activate_user extends \phpbb\notification\type\base
/**
* {@inheritdoc}
*/
- public static function get_item_parent_id($post)
+ static public function get_item_parent_id($post)
{
return 0;
}
@@ -164,6 +180,6 @@ class admin_activate_user extends \phpbb\notification\type\base
$this->set_data('user_actkey', $user['user_actkey']);
$this->notification_time = $user['user_regdate'];
- return parent::create_insert_array($user, $pre_create_data);
+ parent::create_insert_array($user, $pre_create_data);
}
}
diff --git a/phpBB/phpbb/notification/type/approve_post.php b/phpBB/phpbb/notification/type/approve_post.php
index a9e635b41a..9666647bd8 100644
--- a/phpBB/phpbb/notification/type/approve_post.php
+++ b/phpBB/phpbb/notification/type/approve_post.php
@@ -50,7 +50,7 @@ class approve_post extends \phpbb\notification\type\post
* @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group')
*/
- public static $notification_option = array(
+ static public $notification_option = array(
'id' => 'moderation_queue',
'lang' => 'NOTIFICATION_TYPE_MODERATION_QUEUE',
'group' => 'NOTIFICATION_GROUP_POSTING',
@@ -79,7 +79,7 @@ class approve_post extends \phpbb\notification\type\post
), $options);
$users = array();
- $users[$post['poster_id']] = array('');
+ $users[$post['poster_id']] = $this->notification_manager->get_default_methods();
return $this->get_authorised_recipients(array_keys($users), $post['forum_id'], array_merge($options, array(
'item_type' => self::$notification_option['id'],
@@ -107,21 +107,24 @@ class approve_post extends \phpbb\notification\type\post
}
/**
- * Function for preparing the data for insertion in an SQL query
- * (The service handles insertion)
- *
- * @param array $post Data from submit_post
- * @param array $pre_create_data Data from pre_create_insert_array()
- *
- * @return array Array of data ready to be inserted into the database
+ * {@inheritdoc}
*/
public function create_insert_array($post, $pre_create_data = array())
{
$this->set_data('post_subject', $post['post_subject']);
- $data = parent::create_insert_array($post, $pre_create_data);
+ parent::create_insert_array($post, $pre_create_data);
+
+ $this->notification_time = time();
+ }
- $this->notification_time = $data['notification_time'] = time();
+ /**
+ * {@inheritdoc}
+ */
+ public function get_insert_array()
+ {
+ $data = parent::get_insert_array();
+ $data['notification_time'] = $this->notification_time;
return $data;
}
diff --git a/phpBB/phpbb/notification/type/approve_topic.php b/phpBB/phpbb/notification/type/approve_topic.php
index 2f4678359c..e9f4c32852 100644
--- a/phpBB/phpbb/notification/type/approve_topic.php
+++ b/phpBB/phpbb/notification/type/approve_topic.php
@@ -50,7 +50,7 @@ class approve_topic extends \phpbb\notification\type\topic
* @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group')
*/
- public static $notification_option = array(
+ static public $notification_option = array(
'id' => 'moderation_queue',
'lang' => 'NOTIFICATION_TYPE_MODERATION_QUEUE',
'group' => 'NOTIFICATION_GROUP_POSTING',
@@ -79,7 +79,7 @@ class approve_topic extends \phpbb\notification\type\topic
), $options);
$users = array();
- $users[$post['poster_id']] = array('');
+ $users[$post['poster_id']] = $this->notification_manager->get_default_methods();
return $this->get_authorised_recipients(array_keys($users), $post['forum_id'], array_merge($options, array(
'item_type' => self::$notification_option['id'],
@@ -107,19 +107,23 @@ class approve_topic extends \phpbb\notification\type\topic
}
/**
- * Function for preparing the data for insertion in an SQL query
- * (The service handles insertion)
- *
- * @param array $post Data from submit_post
- * @param array $pre_create_data Data from pre_create_insert_array()
- *
- * @return array Array of data ready to be inserted into the database
+ * {@inheritdoc}
*/
public function create_insert_array($post, $pre_create_data = array())
{
- $data = parent::create_insert_array($post, $pre_create_data);
- $this->notification_time = $data['notification_time'] = time();
+ parent::create_insert_array($post, $pre_create_data);
+
+ $this->notification_time = time();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_insert_array()
+ {
+ $data = parent::get_insert_array();
+ $data['notification_time'] = $this->notification_time;
return $data;
}
diff --git a/phpBB/phpbb/notification/type/base.php b/phpBB/phpbb/notification/type/base.php
index 4ead06071e..31e853d7d9 100644
--- a/phpBB/phpbb/notification/type/base.php
+++ b/phpBB/phpbb/notification/type/base.php
@@ -21,27 +21,15 @@ abstract class base implements \phpbb\notification\type\type_interface
/** @var \phpbb\notification\manager */
protected $notification_manager;
- /** @var \phpbb\user_loader */
- protected $user_loader;
-
/** @var \phpbb\db\driver\driver_interface */
protected $db;
- /** @var \phpbb\cache\driver\driver_interface */
- protected $cache;
-
- /** @var \phpbb\template\template */
- protected $template;
-
/** @var \phpbb\user */
protected $user;
/** @var \phpbb\auth\auth */
protected $auth;
- /** @var \phpbb\config\config */
- protected $config;
-
/** @var string */
protected $phpbb_root_path;
@@ -49,12 +37,6 @@ abstract class base implements \phpbb\notification\type\type_interface
protected $php_ext;
/** @var string */
- protected $notification_types_table;
-
- /** @var string */
- protected $notifications_table;
-
- /** @var string */
protected $user_notifications_table;
/**
@@ -63,7 +45,7 @@ abstract class base implements \phpbb\notification\type\type_interface
* @var bool|array False if the service should use its default data
* Array of data (including keys 'id', 'lang', and 'group')
*/
- public static $notification_option = false;
+ static public $notification_option = false;
/**
* The notification_type_id, set upon creation of the class
@@ -91,33 +73,23 @@ abstract class base implements \phpbb\notification\type\type_interface
/**
* Notification Type Base Constructor
*
- * @param \phpbb\user_loader $user_loader
* @param \phpbb\db\driver\driver_interface $db
- * @param \phpbb\cache\driver\driver_interface $cache
* @param \phpbb\user $user
* @param \phpbb\auth\auth $auth
- * @param \phpbb\config\config $config
* @param string $phpbb_root_path
* @param string $php_ext
- * @param string $notification_types_table
- * @param string $notifications_table
* @param string $user_notifications_table
* @return \phpbb\notification\type\base
*/
- public function __construct(\phpbb\user_loader $user_loader, \phpbb\db\driver\driver_interface $db, \phpbb\cache\driver\driver_interface $cache, $user, \phpbb\auth\auth $auth, \phpbb\config\config $config, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table)
+ public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\user $user, \phpbb\auth\auth $auth, $phpbb_root_path, $php_ext, $user_notifications_table)
{
- $this->user_loader = $user_loader;
$this->db = $db;
- $this->cache = $cache;
$this->user = $user;
$this->auth = $auth;
- $this->config = $config;
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
- $this->notification_types_table = $notification_types_table;
- $this->notifications_table = $notifications_table;
$this->user_notifications_table = $user_notifications_table;
}
@@ -207,12 +179,7 @@ abstract class base implements \phpbb\notification\type\type_interface
}
/**
- * Function for preparing the data for insertion in an SQL query
- * (The service handles insertion)
- *
- * @param array $type_data Data unique to this notification type
- * @param array $pre_create_data Data from pre_create_insert_array()
- * @return array Array of data ready to be inserted into the database
+ * {@inheritdoc}
*/
public function create_insert_array($type_data, $pre_create_data = array())
{
@@ -227,7 +194,13 @@ abstract class base implements \phpbb\notification\type\type_interface
'notification_data' => array(),
), $this->data);
+ }
+ /**
+ * {@inheritdoc}
+ */
+ public function get_insert_array()
+ {
$data = $this->data;
$data['notification_data'] = serialize($data['notification_data']);
@@ -244,7 +217,8 @@ abstract class base implements \phpbb\notification\type\type_interface
*/
public function create_update_array($type_data)
{
- $data = $this->create_insert_array($type_data);
+ $this->create_insert_array($type_data);
+ $data = $this->get_insert_array();
// Unset data unique to each row
unset(
@@ -497,8 +471,8 @@ abstract class base implements \phpbb\notification\type\type_interface
{
if (!in_array($user_id, $resulting_user_ids) && !isset($options['ignore_users'][$user_id]))
{
- // No rows at all for this user, default to ''
- $rowset[$user_id] = array('');
+ // No rows at all for this user, use the default methods
+ $rowset[$user_id] = $this->notification_manager->get_default_methods();
}
}
@@ -516,22 +490,21 @@ abstract class base implements \phpbb\notification\type\type_interface
{
$this->notification_read = (bool) !$unread;
- $where = array(
- 'notification_type_id = ' . (int) $this->notification_type_id,
- 'item_id = ' . (int) $this->item_id,
- 'user_id = ' . (int) $this->user_id,
- );
- $where = implode(' AND ', $where);
-
if ($return)
{
+ $where = array(
+ 'notification_type_id = ' . (int) $this->notification_type_id,
+ 'item_id = ' . (int) $this->item_id,
+ 'user_id = ' . (int) $this->user_id,
+ );
+
+ $where = implode(' AND ', $where);
return $where;
}
-
- $sql = 'UPDATE ' . $this->notifications_table . '
- SET notification_read = ' . (int) $this->notification_read . '
- WHERE ' . $where;
- $this->db->sql_query($sql);
+ else
+ {
+ $this->notification_manager->mark_notifications($this->get_type(), (int) $this->item_id, (int) $this->user_id, false, $this->notification_read);
+ }
}
/**
diff --git a/phpBB/phpbb/notification/type/bookmark.php b/phpBB/phpbb/notification/type/bookmark.php
index 4f2d34cb60..5b3fc3a1f2 100644
--- a/phpBB/phpbb/notification/type/bookmark.php
+++ b/phpBB/phpbb/notification/type/bookmark.php
@@ -43,7 +43,7 @@ class bookmark extends \phpbb\notification\type\post
* @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group')
*/
- public static $notification_option = array(
+ static public $notification_option = array(
'lang' => 'NOTIFICATION_TYPE_BOOKMARK',
'group' => 'NOTIFICATION_GROUP_POSTING',
);
@@ -91,31 +91,27 @@ class bookmark extends \phpbb\notification\type\post
}
// Try to find the users who already have been notified about replies and have not read the topic since and just update their notifications
- $update_notifications = array();
- $sql = 'SELECT n.*
- FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
- WHERE n.notification_type_id = ' . (int) $this->notification_type_id . '
- AND n.item_parent_id = ' . (int) self::get_item_parent_id($post) . '
- AND n.notification_read = 0
- AND nt.notification_type_id = n.notification_type_id
- AND nt.notification_type_enabled = 1';
- $result = $this->db->sql_query($sql);
- while ($row = $this->db->sql_fetchrow($result))
+ $notified_users = $this->notification_manager->get_notified_users($this->get_type(), array(
+ 'item_parent_id' => self::get_item_parent_id($post),
+ 'read' => 0,
+ ));
+
+ foreach ($notified_users as $user => $notification_data)
{
- // Do not create a new notification
- unset($notify_users[$row['user_id']]);
+ unset($notify_users[$user]);
- $notification = $this->notification_manager->get_item_type_class($this->get_type(), $row);
+ /** @var bookmark $notification */
+ $notification = $this->notification_manager->get_item_type_class($this->get_type(), $notification_data);
$update_responders = $notification->add_responders($post);
if (!empty($update_responders))
{
- $sql = 'UPDATE ' . $this->notifications_table . '
- SET ' . $this->db->sql_build_array('UPDATE', $update_responders) . '
- WHERE notification_id = ' . $row['notification_id'];
- $this->db->sql_query($sql);
+ $this->notification_manager->update_notification($notification, $update_responders, array(
+ 'item_parent_id' => self::get_item_parent_id($post),
+ 'read' => 0,
+ 'user_id' => $user,
+ ));
}
}
- $this->db->sql_freeresult($result);
return $notify_users;
}
diff --git a/phpBB/phpbb/notification/type/disapprove_post.php b/phpBB/phpbb/notification/type/disapprove_post.php
index 6c7bcbcaee..21338bddb7 100644
--- a/phpBB/phpbb/notification/type/disapprove_post.php
+++ b/phpBB/phpbb/notification/type/disapprove_post.php
@@ -60,7 +60,7 @@ class disapprove_post extends \phpbb\notification\type\approve_post
* @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group')
*/
- public static $notification_option = array(
+ static public $notification_option = array(
'id' => 'moderation_queue',
'lang' => 'NOTIFICATION_TYPE_MODERATION_QUEUE',
'group' => 'NOTIFICATION_GROUP_POSTING',
@@ -125,21 +125,24 @@ class disapprove_post extends \phpbb\notification\type\approve_post
}
/**
- * Function for preparing the data for insertion in an SQL query
- * (The service handles insertion)
- *
- * @param array $post Data from submit_post
- * @param array $pre_create_data Data from pre_create_insert_array()
- *
- * @return array Array of data ready to be inserted into the database
+ * {@inheritdoc}
*/
public function create_insert_array($post, $pre_create_data = array())
{
$this->set_data('disapprove_reason', $post['disapprove_reason']);
- $data = parent::create_insert_array($post);
+ parent::create_insert_array($post, $pre_create_data);
+
+ $this->notification_time = time();
+ }
- $this->notification_time = $data['notification_time'] = time();
+ /**
+ * {@inheritdoc}
+ */
+ public function get_insert_array()
+ {
+ $data = parent::get_insert_array();
+ $data['notification_time'] = $this->notification_time;
return $data;
}
diff --git a/phpBB/phpbb/notification/type/disapprove_topic.php b/phpBB/phpbb/notification/type/disapprove_topic.php
index efa5eb7ecd..30a23a83fe 100644
--- a/phpBB/phpbb/notification/type/disapprove_topic.php
+++ b/phpBB/phpbb/notification/type/disapprove_topic.php
@@ -60,7 +60,7 @@ class disapprove_topic extends \phpbb\notification\type\approve_topic
* @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group')
*/
- public static $notification_option = array(
+ static public $notification_option = array(
'id' => 'moderation_queue',
'lang' => 'NOTIFICATION_TYPE_MODERATION_QUEUE',
'group' => 'NOTIFICATION_GROUP_POSTING',
@@ -125,21 +125,24 @@ class disapprove_topic extends \phpbb\notification\type\approve_topic
}
/**
- * Function for preparing the data for insertion in an SQL query
- * (The service handles insertion)
- *
- * @param array $post Data from submit_post
- * @param array $pre_create_data Data from pre_create_insert_array()
- *
- * @return array Array of data ready to be inserted into the database
+ * {@inheritdoc}
*/
public function create_insert_array($post, $pre_create_data = array())
{
$this->set_data('disapprove_reason', $post['disapprove_reason']);
- $data = parent::create_insert_array($post, $pre_create_data);
+ parent::create_insert_array($post, $pre_create_data);
+
+ $this->notification_time = time();
+ }
- $this->notification_time = $data['notification_time'] = time();
+ /**
+ * {@inheritdoc}
+ */
+ public function get_insert_array()
+ {
+ $data = parent::get_insert_array();
+ $data['notification_time'] = $this->notification_time;
return $data;
}
diff --git a/phpBB/phpbb/notification/type/group_request.php b/phpBB/phpbb/notification/type/group_request.php
index 96bfc86322..8a0027bfec 100644
--- a/phpBB/phpbb/notification/type/group_request.php
+++ b/phpBB/phpbb/notification/type/group_request.php
@@ -26,10 +26,18 @@ class group_request extends \phpbb\notification\type\base
/**
* {@inheritdoc}
*/
- public static $notification_option = array(
+ static public $notification_option = array(
'lang' => 'NOTIFICATION_TYPE_GROUP_REQUEST',
);
+ /** @var \phpbb\user_loader */
+ protected $user_loader;
+
+ public function set_user_loader(\phpbb\user_loader $user_loader)
+ {
+ $this->user_loader = $user_loader;
+ }
+
/**
* {@inheritdoc}
*/
@@ -50,7 +58,7 @@ class group_request extends \phpbb\notification\type\base
/**
* {@inheritdoc}
*/
- public static function get_item_id($group)
+ static public function get_item_id($group)
{
return (int) $group['user_id'];
}
@@ -58,7 +66,7 @@ class group_request extends \phpbb\notification\type\base
/**
* {@inheritdoc}
*/
- public static function get_item_parent_id($group)
+ static public function get_item_parent_id($group)
{
// Group id is the parent
return (int) $group['group_id'];
@@ -156,6 +164,6 @@ class group_request extends \phpbb\notification\type\base
{
$this->set_data('group_name', $group['group_name']);
- return parent::create_insert_array($group, $pre_create_data);
+ parent::create_insert_array($group, $pre_create_data);
}
}
diff --git a/phpBB/phpbb/notification/type/group_request_approved.php b/phpBB/phpbb/notification/type/group_request_approved.php
index d284046ffa..dc353f3380 100644
--- a/phpBB/phpbb/notification/type/group_request_approved.php
+++ b/phpBB/phpbb/notification/type/group_request_approved.php
@@ -34,7 +34,7 @@ class group_request_approved extends \phpbb\notification\type\base
/**
* {@inheritdoc}
*/
- public static function get_item_id($group)
+ static public function get_item_id($group)
{
return (int) $group['group_id'];
}
@@ -42,7 +42,7 @@ class group_request_approved extends \phpbb\notification\type\base
/**
* {@inheritdoc}
*/
- public static function get_item_parent_id($group)
+ static public function get_item_parent_id($group)
{
return 0;
}
@@ -58,7 +58,7 @@ class group_request_approved extends \phpbb\notification\type\base
foreach ($group['user_ids'] as $user_id)
{
- $users[$user_id] = array('');
+ $users[$user_id] = $this->notification_manager->get_default_methods();
}
return $users;
@@ -87,7 +87,7 @@ class group_request_approved extends \phpbb\notification\type\base
{
$this->set_data('group_name', $group['group_name']);
- return parent::create_insert_array($group, $pre_create_data);
+ parent::create_insert_array($group, $pre_create_data);
}
/**
diff --git a/phpBB/phpbb/notification/type/pm.php b/phpBB/phpbb/notification/type/pm.php
index d2f34f95d0..2de2dcfa0b 100644
--- a/phpBB/phpbb/notification/type/pm.php
+++ b/phpBB/phpbb/notification/type/pm.php
@@ -36,10 +36,26 @@ class pm extends \phpbb\notification\type\base
* @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group')
*/
- public static $notification_option = array(
+ static public $notification_option = array(
'lang' => 'NOTIFICATION_TYPE_PM',
);
+ /** @var \phpbb\user_loader */
+ protected $user_loader;
+
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ public function set_config(\phpbb\config\config $config)
+ {
+ $this->config = $config;
+ }
+
+ public function set_user_loader(\phpbb\user_loader $user_loader)
+ {
+ $this->user_loader = $user_loader;
+ }
+
/**
* Is available
*/
@@ -53,7 +69,7 @@ class pm extends \phpbb\notification\type\base
*
* @param array $pm The data from the private message
*/
- public static function get_item_id($pm)
+ static public function get_item_id($pm)
{
return (int) $pm['msg_id'];
}
@@ -63,7 +79,7 @@ class pm extends \phpbb\notification\type\base
*
* @param array $pm The data from the pm
*/
- public static function get_item_parent_id($pm)
+ static public function get_item_parent_id($pm)
{
// No parent
return 0;
@@ -176,13 +192,7 @@ class pm extends \phpbb\notification\type\base
}
/**
- * Function for preparing the data for insertion in an SQL query
- * (The service handles insertion)
- *
- * @param array $pm Data from submit_post
- * @param array $pre_create_data Data from pre_create_insert_array()
- *
- * @return array Array of data ready to be inserted into the database
+ * {@inheritdoc}
*/
public function create_insert_array($pm, $pre_create_data = array())
{
@@ -190,6 +200,6 @@ class pm extends \phpbb\notification\type\base
$this->set_data('message_subject', $pm['message_subject']);
- return parent::create_insert_array($pm, $pre_create_data);
+ parent::create_insert_array($pm, $pre_create_data);
}
}
diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php
index e25fdcd808..f3dd6d531a 100644
--- a/phpBB/phpbb/notification/type/post.php
+++ b/phpBB/phpbb/notification/type/post.php
@@ -50,11 +50,27 @@ class post extends \phpbb\notification\type\base
* @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group')
*/
- public static $notification_option = array(
+ static public $notification_option = array(
'lang' => 'NOTIFICATION_TYPE_POST',
'group' => 'NOTIFICATION_GROUP_POSTING',
);
+ /** @var \phpbb\user_loader */
+ protected $user_loader;
+
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ public function set_config(\phpbb\config\config $config)
+ {
+ $this->config = $config;
+ }
+
+ public function set_user_loader(\phpbb\user_loader $user_loader)
+ {
+ $this->user_loader = $user_loader;
+ }
+
/**
* Is available
*/
@@ -68,7 +84,7 @@ class post extends \phpbb\notification\type\base
*
* @param array $post The data from the post
*/
- public static function get_item_id($post)
+ static public function get_item_id($post)
{
return (int) $post['post_id'];
}
@@ -78,7 +94,7 @@ class post extends \phpbb\notification\type\base
*
* @param array $post The data from the post
*/
- public static function get_item_parent_id($post)
+ static public function get_item_parent_id($post)
{
return (int) $post['topic_id'];
}
@@ -131,31 +147,27 @@ class post extends \phpbb\notification\type\base
}
// Try to find the users who already have been notified about replies and have not read the topic since and just update their notifications
- $update_notifications = array();
- $sql = 'SELECT n.*
- FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
- WHERE n.notification_type_id = ' . (int) $this->notification_type_id . '
- AND n.item_parent_id = ' . (int) self::get_item_parent_id($post) . '
- AND n.notification_read = 0
- AND nt.notification_type_id = n.notification_type_id
- AND nt.notification_type_enabled = 1';
- $result = $this->db->sql_query($sql);
- while ($row = $this->db->sql_fetchrow($result))
+ $notified_users = $this->notification_manager->get_notified_users($this->get_type(), array(
+ 'item_parent_id' => self::get_item_parent_id($post),
+ 'read' => 0,
+ ));
+
+ foreach ($notified_users as $user => $notification_data)
{
- // Do not create a new notification
- unset($notify_users[$row['user_id']]);
+ unset($notify_users[$user]);
- $notification = $this->notification_manager->get_item_type_class($this->get_type(), $row);
+ /** @var post $notification */
+ $notification = $this->notification_manager->get_item_type_class($this->get_type(), $notification_data);
$update_responders = $notification->add_responders($post);
if (!empty($update_responders))
{
- $sql = 'UPDATE ' . $this->notifications_table . '
- SET ' . $this->db->sql_build_array('UPDATE', $update_responders) . '
- WHERE notification_id = ' . $row['notification_id'];
- $this->db->sql_query($sql);
+ $this->notification_manager->update_notification($notification, $update_responders, array(
+ 'item_parent_id' => self::get_item_parent_id($post),
+ 'read' => 0,
+ 'user_id' => $user,
+ ));
}
}
- $this->db->sql_freeresult($result);
return $notify_users;
}
@@ -363,13 +375,7 @@ class post extends \phpbb\notification\type\base
}
/**
- * Function for preparing the data for insertion in an SQL query
- * (The service handles insertion)
- *
- * @param array $post Data from submit_post
- * @param array $pre_create_data Data from pre_create_insert_array()
- *
- * @return array Array of data ready to be inserted into the database
+ * {@inheritdoc}
*/
public function create_insert_array($post, $pre_create_data = array())
{
@@ -394,7 +400,7 @@ class post extends \phpbb\notification\type\base
$this->notification_read = true;
}
- return parent::create_insert_array($post, $pre_create_data);
+ parent::create_insert_array($post, $pre_create_data);
}
/**
diff --git a/phpBB/phpbb/notification/type/post_in_queue.php b/phpBB/phpbb/notification/type/post_in_queue.php
index 315b8b0243..8b21d77cdd 100644
--- a/phpBB/phpbb/notification/type/post_in_queue.php
+++ b/phpBB/phpbb/notification/type/post_in_queue.php
@@ -43,7 +43,7 @@ class post_in_queue extends \phpbb\notification\type\post
* @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group')
*/
- public static $notification_option = array(
+ static public $notification_option = array(
'id' => 'notification.type.needs_approval',
'lang' => 'NOTIFICATION_TYPE_IN_MODERATION_QUEUE',
'group' => 'NOTIFICATION_GROUP_MODERATION',
@@ -131,19 +131,22 @@ class post_in_queue extends \phpbb\notification\type\post
}
/**
- * Function for preparing the data for insertion in an SQL query
- * (The service handles insertion)
- *
- * @param array $post Data from submit_post
- * @param array $pre_create_data Data from pre_create_insert_array()
- *
- * @return array Array of data ready to be inserted into the database
+ * {@inheritdoc}
*/
public function create_insert_array($post, $pre_create_data = array())
{
- $data = parent::create_insert_array($post, $pre_create_data);
+ parent::create_insert_array($post, $pre_create_data);
+
+ $this->notification_time = time();
+ }
- $this->notification_time = $data['notification_time'] = time();
+ /**
+ * {@inheritdoc}
+ */
+ public function get_insert_array()
+ {
+ $data = parent::get_insert_array();
+ $data['notification_time'] = $this->notification_time;
return $data;
}
diff --git a/phpBB/phpbb/notification/type/quote.php b/phpBB/phpbb/notification/type/quote.php
index 508ca92fa0..57f77bba83 100644
--- a/phpBB/phpbb/notification/type/quote.php
+++ b/phpBB/phpbb/notification/type/quote.php
@@ -21,6 +21,11 @@ namespace phpbb\notification\type;
class quote extends \phpbb\notification\type\post
{
/**
+ * @var \phpbb\textformatter\utils_interface
+ */
+ protected $utils;
+
+ /**
* Get notification type name
*
* @return string
@@ -31,13 +36,6 @@ class quote extends \phpbb\notification\type\post
}
/**
- * regular expression to match to find usernames
- *
- * @var string
- */
- protected static $regular_expression_match = '#\[quote=&quot;(.+?)&quot;#';
-
- /**
* Language key used to output the text
*
* @var string
@@ -50,7 +48,7 @@ class quote extends \phpbb\notification\type\post
* @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group')
*/
- public static $notification_option = array(
+ static public $notification_option = array(
'lang' => 'NOTIFICATION_TYPE_QUOTE',
'group' => 'NOTIFICATION_GROUP_POSTING',
);
@@ -77,17 +75,16 @@ class quote extends \phpbb\notification\type\post
'ignore_users' => array(),
), $options);
- $usernames = false;
- preg_match_all(self::$regular_expression_match, $post['post_text'], $usernames);
+ $usernames = $this->utils->get_outermost_quote_authors($post['post_text']);
- if (empty($usernames[1]))
+ if (empty($usernames))
{
return array();
}
- $usernames[1] = array_unique($usernames[1]);
+ $usernames = array_unique($usernames);
- $usernames = array_map('utf8_clean_string', $usernames[1]);
+ $usernames = array_map('utf8_clean_string', $usernames);
$users = array();
@@ -112,22 +109,12 @@ class quote extends \phpbb\notification\type\post
*/
public function update_notifications($post)
{
- $old_notifications = array();
- $sql = 'SELECT n.user_id
- FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
- WHERE n.notification_type_id = ' . (int) $this->notification_type_id . '
- AND n.item_id = ' . self::get_item_id($post) . '
- AND nt.notification_type_id = n.notification_type_id
- AND nt.notification_type_enabled = 1';
- $result = $this->db->sql_query($sql);
- while ($row = $this->db->sql_fetchrow($result))
- {
- $old_notifications[] = $row['user_id'];
- }
- $this->db->sql_freeresult($result);
+ $old_notifications = $this->notification_manager->get_notified_users($this->get_type(), array(
+ 'item_id' => self::get_item_id($post),
+ ));
// Find the new users to notify
- $notifications = $this->find_users_for_notification($post);
+ $notifications = array_keys($this->find_users_for_notification($post));
// Find the notifications we must delete
$remove_notifications = array_diff($old_notifications, array_keys($notifications));
@@ -145,11 +132,7 @@ class quote extends \phpbb\notification\type\post
// Remove the necessary notifications
if (!empty($remove_notifications))
{
- $sql = 'DELETE FROM ' . $this->notifications_table . '
- WHERE notification_type_id = ' . (int) $this->notification_type_id . '
- AND item_id = ' . self::get_item_id($post) . '
- AND ' . $this->db->sql_in_set('user_id', $remove_notifications);
- $this->db->sql_query($sql);
+ $this->notification_manager->delete_notifications($this->get_type(), self::get_item_id($post), false, $remove_notifications);
}
// return true to continue with the update code in the notifications service (this will update the rest of the notifications)
@@ -187,4 +170,14 @@ class quote extends \phpbb\notification\type\post
'AUTHOR_NAME' => htmlspecialchars_decode($user_data['username']),
));
}
+
+ /**
+ * Set the utils service used to retrieve quote authors
+ *
+ * @param \phpbb\textformatter\utils_interface $utils
+ */
+ public function set_utils(\phpbb\textformatter\utils_interface $utils)
+ {
+ $this->utils = $utils;
+ }
}
diff --git a/phpBB/phpbb/notification/type/report_pm.php b/phpBB/phpbb/notification/type/report_pm.php
index 749cfe0b8e..0f7dce0a68 100644
--- a/phpBB/phpbb/notification/type/report_pm.php
+++ b/phpBB/phpbb/notification/type/report_pm.php
@@ -60,7 +60,7 @@ class report_pm extends \phpbb\notification\type\pm
* @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group')
*/
- public static $notification_option = array(
+ static public $notification_option = array(
'id' => 'notification.type.report',
'lang' => 'NOTIFICATION_TYPE_REPORT',
'group' => 'NOTIFICATION_GROUP_MODERATION',
@@ -71,7 +71,7 @@ class report_pm extends \phpbb\notification\type\pm
*
* @param array $pm The data from the pm
*/
- public static function get_item_parent_id($pm)
+ static public function get_item_parent_id($pm)
{
return (int) $pm['report_id'];
}
@@ -141,6 +141,8 @@ class report_pm extends \phpbb\notification\type\pm
*/
public function get_email_template_variables()
{
+ $user_data = $this->user_loader->get_username($this->get_data('reporter_id'), 'no_profile');
+
return array(
'AUTHOR_NAME' => htmlspecialchars_decode($user_data['username']),
'SUBJECT' => htmlspecialchars_decode(censor_text($this->get_data('message_subject'))),
@@ -237,13 +239,7 @@ class report_pm extends \phpbb\notification\type\pm
}
/**
- * Function for preparing the data for insertion in an SQL query
- * (The service handles insertion)
- *
- * @param array $post Data from submit_post
- * @param array $pre_create_data Data from pre_create_insert_array()
- *
- * @return array Array of data ready to be inserted into the database
+ * {@inheritdoc}
*/
public function create_insert_array($post, $pre_create_data = array())
{
@@ -252,6 +248,6 @@ class report_pm extends \phpbb\notification\type\pm
$this->set_data('reason_description', $post['reason_description']);
$this->set_data('report_text', $post['report_text']);
- return parent::create_insert_array($post, $pre_create_data);
+ parent::create_insert_array($post, $pre_create_data);
}
}
diff --git a/phpBB/phpbb/notification/type/report_pm_closed.php b/phpBB/phpbb/notification/type/report_pm_closed.php
index 1c99db60c3..f793c7df9a 100644
--- a/phpBB/phpbb/notification/type/report_pm_closed.php
+++ b/phpBB/phpbb/notification/type/report_pm_closed.php
@@ -64,7 +64,7 @@ class report_pm_closed extends \phpbb\notification\type\pm
return array();
}
- return array($pm['reporter'] => array(''));
+ return array($pm['reporter'] => $this->notification_manager->get_default_methods());
}
/**
@@ -144,21 +144,24 @@ class report_pm_closed extends \phpbb\notification\type\pm
}
/**
- * Function for preparing the data for insertion in an SQL query
- * (The service handles insertion)
- *
- * @param array $pm PM Data
- * @param array $pre_create_data Data from pre_create_insert_array()
- *
- * @return array Array of data ready to be inserted into the database
+ * {@inheritdoc}
*/
public function create_insert_array($pm, $pre_create_data = array())
{
$this->set_data('closer_id', $pm['closer_id']);
- $data = parent::create_insert_array($pm, $pre_create_data);
+ parent::create_insert_array($pm, $pre_create_data);
+
+ $this->notification_time = time();
+ }
- $this->notification_time = $data['notification_time'] = time();
+ /**
+ * {@inheritdoc}
+ */
+ public function get_insert_array()
+ {
+ $data = parent::get_insert_array();
+ $data['notification_time'] = $this->notification_time;
return $data;
}
diff --git a/phpBB/phpbb/notification/type/report_post.php b/phpBB/phpbb/notification/type/report_post.php
index aed31e8642..6eefd53832 100644
--- a/phpBB/phpbb/notification/type/report_post.php
+++ b/phpBB/phpbb/notification/type/report_post.php
@@ -66,7 +66,7 @@ class report_post extends \phpbb\notification\type\post_in_queue
* @var bool|array False if the service should use it's default data
* Array of data (including keys 'id' and 'lang')
*/
- public static $notification_option = array(
+ static public $notification_option = array(
'id' => 'notification.type.report',
'lang' => 'NOTIFICATION_TYPE_REPORT',
'group' => 'NOTIFICATION_GROUP_MODERATION',
@@ -210,13 +210,7 @@ class report_post extends \phpbb\notification\type\post_in_queue
}
/**
- * Function for preparing the data for insertion in an SQL query
- * (The service handles insertion)
- *
- * @param array $post Data from submit_post
- * @param array $pre_create_data Data from pre_create_insert_array()
- *
- * @return array Array of data ready to be inserted into the database
+ * {@inheritdoc}
*/
public function create_insert_array($post, $pre_create_data = array())
{
@@ -225,6 +219,6 @@ class report_post extends \phpbb\notification\type\post_in_queue
$this->set_data('reason_description', $post['reason_description']);
$this->set_data('report_text', $post['report_text']);
- return parent::create_insert_array($post, $pre_create_data);
+ parent::create_insert_array($post, $pre_create_data);
}
}
diff --git a/phpBB/phpbb/notification/type/report_post_closed.php b/phpBB/phpbb/notification/type/report_post_closed.php
index 3f4378628b..6327011f2d 100644
--- a/phpBB/phpbb/notification/type/report_post_closed.php
+++ b/phpBB/phpbb/notification/type/report_post_closed.php
@@ -71,7 +71,7 @@ class report_post_closed extends \phpbb\notification\type\post
return array();
}
- return array($post['reporter'] => array(''));
+ return array($post['reporter'] => $this->notification_manager->get_default_methods());
}
/**
@@ -151,21 +151,24 @@ class report_post_closed extends \phpbb\notification\type\post
}
/**
- * Function for preparing the data for insertion in an SQL query
- * (The service handles insertion)
- *
- * @param array $post Data from submit_post
- * @param array $pre_create_data Data from pre_create_insert_array()
- *
- * @return array Array of data ready to be inserted into the database
+ * {@inheritdoc}
*/
public function create_insert_array($post, $pre_create_data = array())
{
$this->set_data('closer_id', $post['closer_id']);
- $data = parent::create_insert_array($post, $pre_create_data);
+ parent::create_insert_array($post, $pre_create_data);
+
+ $this->notification_time = time();
+ }
- $this->notification_time = $data['notification_time'] = time();
+ /**
+ * {@inheritdoc}
+ */
+ public function get_insert_array()
+ {
+ $data = parent::get_insert_array();
+ $data['notification_time'] = $this->notification_time;
return $data;
}
diff --git a/phpBB/phpbb/notification/type/topic.php b/phpBB/phpbb/notification/type/topic.php
index fb08a9eee1..4812e8b5af 100644
--- a/phpBB/phpbb/notification/type/topic.php
+++ b/phpBB/phpbb/notification/type/topic.php
@@ -50,11 +50,27 @@ class topic extends \phpbb\notification\type\base
* @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group')
*/
- public static $notification_option = array(
+ static public $notification_option = array(
'lang' => 'NOTIFICATION_TYPE_TOPIC',
'group' => 'NOTIFICATION_GROUP_POSTING',
);
+ /** @var \phpbb\user_loader */
+ protected $user_loader;
+
+ /** @var \phpbb\config\config */
+ protected $config;
+
+ public function set_config(\phpbb\config\config $config)
+ {
+ $this->config = $config;
+ }
+
+ public function set_user_loader(\phpbb\user_loader $user_loader)
+ {
+ $this->user_loader = $user_loader;
+ }
+
/**
* Is available
*/
@@ -68,7 +84,7 @@ class topic extends \phpbb\notification\type\base
*
* @param array $post The data from the post
*/
- public static function get_item_id($post)
+ static public function get_item_id($post)
{
return (int) $post['topic_id'];
}
@@ -78,7 +94,7 @@ class topic extends \phpbb\notification\type\base
*
* @param array $post The data from the post
*/
- public static function get_item_parent_id($post)
+ static public function get_item_parent_id($post)
{
return (int) $post['forum_id'];
}
@@ -263,13 +279,7 @@ class topic extends \phpbb\notification\type\base
}
/**
- * Function for preparing the data for insertion in an SQL query
- * (The service handles insertion)
- *
- * @param array $post Data from submit_post
- * @param array $pre_create_data Data from pre_create_insert_array()
- *
- * @return array Array of data ready to be inserted into the database
+ * {@inheritdoc}
*/
public function create_insert_array($post, $pre_create_data = array())
{
@@ -290,6 +300,6 @@ class topic extends \phpbb\notification\type\base
$this->notification_read = true;
}
- return parent::create_insert_array($post, $pre_create_data);
+ parent::create_insert_array($post, $pre_create_data);
}
}
diff --git a/phpBB/phpbb/notification/type/topic_in_queue.php b/phpBB/phpbb/notification/type/topic_in_queue.php
index 4c60c6b858..ad2961525e 100644
--- a/phpBB/phpbb/notification/type/topic_in_queue.php
+++ b/phpBB/phpbb/notification/type/topic_in_queue.php
@@ -43,7 +43,7 @@ class topic_in_queue extends \phpbb\notification\type\topic
* @var bool|array False if the service should use it's default data
* Array of data (including keys 'id', 'lang', and 'group')
*/
- public static $notification_option = array(
+ static public $notification_option = array(
'id' => 'notification.type.needs_approval',
'lang' => 'NOTIFICATION_TYPE_IN_MODERATION_QUEUE',
'group' => 'NOTIFICATION_GROUP_MODERATION',
@@ -123,19 +123,22 @@ class topic_in_queue extends \phpbb\notification\type\topic
}
/**
- * Function for preparing the data for insertion in an SQL query
- * (The service handles insertion)
- *
- * @param array $topic Data from submit_post
- * @param array $pre_create_data Data from pre_create_insert_array()
- *
- * @return array Array of data ready to be inserted into the database
+ * {@inheritdoc}
*/
public function create_insert_array($topic, $pre_create_data = array())
{
- $data = parent::create_insert_array($topic, $pre_create_data);
+ parent::create_insert_array($topic, $pre_create_data);
+
+ $this->notification_time = time();
+ }
- $this->notification_time = $data['notification_time'] = time();
+ /**
+ * {@inheritdoc}
+ */
+ public function get_insert_array()
+ {
+ $data = parent::get_insert_array();
+ $data['notification_time'] = $this->notification_time;
return $data;
}
diff --git a/phpBB/phpbb/notification/type/type_interface.php b/phpBB/phpbb/notification/type/type_interface.php
index 5c5a110836..f9f832bdda 100644
--- a/phpBB/phpbb/notification/type/type_interface.php
+++ b/phpBB/phpbb/notification/type/type_interface.php
@@ -37,14 +37,14 @@ interface type_interface
*
* @param array $type_data The type specific data
*/
- public static function get_item_id($type_data);
+ static public function get_item_id($type_data);
/**
* Get the id of the parent
*
* @param array $type_data The type specific data
*/
- public static function get_item_parent_id($type_data);
+ static public function get_item_parent_id($type_data);
/**
* Is this type available to the current user (defines whether or not it will be shown in the UCP Edit notification options)
@@ -177,14 +177,18 @@ interface type_interface
/**
* Function for preparing the data for insertion in an SQL query
- * (The service handles insertion)
*
* @param array $type_data The type specific data
* @param array $pre_create_data Data from pre_create_insert_array()
+ */
+ public function create_insert_array($type_data, $pre_create_data);
+
+ /**
+ * Function for getting the data for insertion in an SQL query
*
* @return array Array of data ready to be inserted into the database
*/
- public function create_insert_array($type_data, $pre_create_data);
+ public function get_insert_array();
/**
* Function for preparing the data for update in an SQL query
@@ -202,7 +206,7 @@ interface type_interface
* @param bool $return True to return a string containing the SQL code to update this item, False to execute it (Default: False)
* @return string
*/
- public function mark_read($return);
+ public function mark_read($return = false);
/**
* Mark this item unread
@@ -210,5 +214,5 @@ interface type_interface
* @param bool $return True to return a string containing the SQL code to update this item, False to execute it (Default: False)
* @return string
*/
- public function mark_unread($return);
+ public function mark_unread($return = false);
}
diff --git a/phpBB/phpbb/path_helper.php b/phpBB/phpbb/path_helper.php
index 5400c1c5a6..7b0d6f0fba 100644
--- a/phpBB/phpbb/path_helper.php
+++ b/phpBB/phpbb/path_helper.php
@@ -21,7 +21,7 @@ class path_helper
/** @var \phpbb\symfony_request */
protected $symfony_request;
- /** @var \phpbb\filesystem */
+ /** @var \phpbb\filesystem\filesystem_interface */
protected $filesystem;
/** @var \phpbb\request\request_interface */
@@ -43,13 +43,13 @@ class path_helper
* Constructor
*
* @param \phpbb\symfony_request $symfony_request
- * @param \phpbb\filesystem $filesystem
+ * @param \phpbb\filesystem\filesystem_interface $filesystem
* @param \phpbb\request\request_interface $request
* @param string $phpbb_root_path Relative path to phpBB root
* @param string $php_ext PHP file extension
* @param mixed $adm_relative_path Relative path admin path to adm/ root
*/
- public function __construct(\phpbb\symfony_request $symfony_request, \phpbb\filesystem $filesystem, \phpbb\request\request_interface $request, $phpbb_root_path, $php_ext, $adm_relative_path = null)
+ public function __construct(\phpbb\symfony_request $symfony_request, \phpbb\filesystem\filesystem_interface $filesystem, \phpbb\request\request_interface $request, $phpbb_root_path, $php_ext, $adm_relative_path = null)
{
$this->symfony_request = $symfony_request;
$this->filesystem = $filesystem;
diff --git a/phpBB/phpbb/permissions.php b/phpBB/phpbb/permissions.php
index 42bbe443d1..0c6fad295c 100644
--- a/phpBB/phpbb/permissions.php
+++ b/phpBB/phpbb/permissions.php
@@ -273,6 +273,7 @@ class permissions
'f_post' => array('lang' => 'ACL_F_POST', 'cat' => 'post'),
'f_sticky' => array('lang' => 'ACL_F_STICKY', 'cat' => 'post'),
'f_announce' => array('lang' => 'ACL_F_ANNOUNCE', 'cat' => 'post'),
+ 'f_announce_global' => array('lang' => 'ACL_F_ANNOUNCE_GLOBAL', 'cat' => 'post'),
'f_reply' => array('lang' => 'ACL_F_REPLY', 'cat' => 'post'),
'f_edit' => array('lang' => 'ACL_F_EDIT', 'cat' => 'post'),
'f_delete' => array('lang' => 'ACL_F_DELETE', 'cat' => 'post'),
diff --git a/phpBB/phpbb/profilefields/type/type_date.php b/phpBB/phpbb/profilefields/type/type_date.php
index 90ac9a6703..414484920b 100644
--- a/phpBB/phpbb/profilefields/type/type_date.php
+++ b/phpBB/phpbb/profilefields/type/type_date.php
@@ -72,7 +72,7 @@ class type_date extends type_base
'lang_options' => $field_data['lang_options'],
);
- $always_now = request_var('always_now', -1);
+ $always_now = $request->variable('always_now', -1);
if ($always_now == -1)
{
$s_checked = ($field_data['field_default_value'] == 'now') ? true : false;
diff --git a/phpBB/phpbb/report/controller/report.php b/phpBB/phpbb/report/controller/report.php
new file mode 100644
index 0000000000..f703d1cc60
--- /dev/null
+++ b/phpBB/phpbb/report/controller/report.php
@@ -0,0 +1,319 @@
+<?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\report\controller;
+
+use phpbb\exception\http_exception;
+use Symfony\Component\HttpFoundation\RedirectResponse;
+
+class report
+{
+ /**
+ * @var \phpbb\config\db
+ */
+ protected $config;
+
+ /**
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * @var \phpbb\template\template
+ */
+ protected $template;
+
+ /**
+ * @var \phpbb\controller\helper
+ */
+ protected $helper;
+
+ /**
+ * @var \phpbb\request\request_interface
+ */
+ protected $request;
+
+ /**
+ * @var \phpbb\captcha\factory
+ */
+ protected $captcha_factory;
+
+ /**
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * @var \phpbb\report\report_handler_interface
+ */
+ protected $report_handler;
+
+ /**
+ * @var \phpbb\report\report_reason_list_provider
+ */
+ protected $report_reason_provider;
+
+ public function __construct(\phpbb\config\db $config, \phpbb\user $user, \phpbb\template\template $template, \phpbb\controller\helper $helper, \phpbb\request\request_interface $request, \phpbb\captcha\factory $captcha_factory, \phpbb\report\handler_factory $report_factory, \phpbb\report\report_reason_list_provider $ui_provider, $phpbb_root_path, $php_ext)
+ {
+ $this->config = $config;
+ $this->user = $user;
+ $this->template = $template;
+ $this->helper = $helper;
+ $this->request = $request;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ $this->captcha_factory = $captcha_factory;
+ $this->report_handler = $report_factory;
+
+ // User interface factory
+ $this->report_reason_provider = $ui_provider;
+ }
+
+ /**
+ * Controller for /path_to_entities/{id}/report routes
+ *
+ * Because of how phpBB organizes routes $mode must be set in the route config.
+ *
+ * @param int $id ID of the entity to report
+ * @param string $mode
+ * @return \Symfony\Component\HttpFoundation\Response a Symfony response object
+ * @throws \phpbb\exception\http_exception when $mode or $id is invalid for some reason
+ */
+ public function handle($id, $mode)
+ {
+ // Get report handler
+ $this->report_handler = $this->report_handler->get_instance($mode);
+
+ $this->user->add_lang('mcp');
+
+ $user_notify = ($this->user->data['is_registered']) ? $this->request->variable('notify', 0) : false;
+ $reason_id = $this->request->variable('reason_id', 0);
+ $report_text = $this->request->variable('report_text', '', true);
+
+ $submit = $this->request->variable('submit', '');
+ $cancel = $this->request->variable('cancel', '');
+
+ $error = array();
+ $s_hidden_fields = '';
+
+ $redirect_url = append_sid(
+ $this->phpbb_root_path . ( ($mode === 'pm') ? 'ucp' : 'viewtopic' ) . ".{$this->php_ext}",
+ ($mode == 'pm') ? "i=pm&mode=view&p=$id" : "p=$id"
+ );
+ $redirect_url .= ($mode === 'post') ? "#p$id" : '';
+
+ // Set up CAPTCHA if necessary
+ if ($this->config['enable_post_confirm'] && !$this->user->data['is_registered'])
+ {
+ $captcha = $this->captcha_factory->get_instance($this->config['captcha_plugin']);
+ $captcha->init(CONFIRM_REPORT);
+ }
+
+ //Has the report been cancelled?
+ if (!empty($cancel))
+ {
+ return new RedirectResponse($redirect_url, 302);
+ }
+
+ // Check CAPTCHA, if the form was submited
+ if (!empty($submit) && isset($captcha))
+ {
+ $captcha_template_array = $this->check_captcha($captcha);
+ $error = $captcha_template_array['error'];
+ $s_hidden_fields = $captcha_template_array['hidden_fields'];
+ }
+
+ // Handle request
+ try
+ {
+ if (!empty($submit) && sizeof($error) === 0)
+ {
+ $this->report_handler->add_report(
+ (int) $id,
+ (int) $reason_id,
+ (string) $report_text,
+ (int) $user_notify
+ );
+
+ // Send success message
+ switch ($mode)
+ {
+ case 'pm':
+ $lang_return = $this->user->lang['RETURN_PM'];
+ $lang_success = $this->user->lang['PM_REPORTED_SUCCESS'];
+ break;
+ case 'post':
+ $lang_return = $this->user->lang['RETURN_TOPIC'];
+ $lang_success = $this->user->lang['POST_REPORTED_SUCCESS'];
+ break;
+ }
+
+ $this->helper->assign_meta_refresh_var(3, $redirect_url);
+ $message = $lang_success . '<br /><br />' . sprintf($lang_return, '<a href="' . $redirect_url . '">', '</a>');
+ return $this->helper->message($message);
+ }
+ else
+ {
+ $this->report_handler->validate_report_request($id);
+ }
+ }
+ catch (\phpbb\report\exception\pm_reporting_disabled_exception $exception)
+ {
+ throw new http_exception(404, 'PAGE_NOT_FOUND');
+ }
+ catch (\phpbb\report\exception\already_reported_exception $exception)
+ {
+ switch ($mode)
+ {
+ case 'pm':
+ $message = $this->user->lang['ALREADY_REPORTED_PM'];
+ $message .= '<br /><br />' . sprintf($this->user->lang['RETURN_PM'], '<a href="' . $redirect_url . '">', '</a>');
+ break;
+ case 'post':
+ $message = $this->user->lang['ALREADY_REPORTED'];
+ $message .= '<br /><br />' . sprintf($this->user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>');
+ break;
+ }
+
+ return $this->helper->message($message);
+ }
+ catch (\phpbb\report\exception\report_permission_denied_exception $exception)
+ {
+ $message = $exception->getMessage();
+ if (isset($this->user->lang[$message]))
+ {
+ $message = $this->user->lang[$message];
+ }
+
+ throw new http_exception(403, $message);
+ }
+ catch (\phpbb\report\exception\entity_not_found_exception $exception)
+ {
+ $message = $exception->getMessage();
+ if (isset($this->user->lang[$message]))
+ {
+ $message = $this->user->lang[$message];
+ }
+
+ throw new http_exception(404, $message);
+ }
+ catch (\phpbb\report\exception\empty_report_exception $exception)
+ {
+ $error[] = $this->user->lang['EMPTY_REPORT'];
+ }
+ catch (\phpbb\report\exception\invalid_report_exception $exception)
+ {
+ return $this->helper->message($exception->getMessage());
+ }
+
+ // Setting up an rendering template
+ $page_title = ($mode === 'pm') ? $this->user->lang['REPORT_MESSAGE'] : $this->user->lang['REPORT_POST'];
+ $this->assign_template_data(
+ $mode,
+ $id,
+ $reason_id,
+ $report_text,
+ $user_notify,
+ $error,
+ $s_hidden_fields,
+ ( isset($captcha) ? $captcha : false )
+ );
+
+ return $this->helper->render('report_body.html', $page_title);
+ }
+
+ /**
+ * Assigns template variables
+ *
+ * @param int $mode
+ * @param int $id
+ * @param int $reason_id
+ * @param string $report_text
+ * @param mixed $user_notify
+ * @param array $error
+ * @param string $s_hidden_fields
+ * @param mixed $captcha
+ * @return null
+ */
+ protected function assign_template_data($mode, $id, $reason_id, $report_text, $user_notify, $error = array(), $s_hidden_fields = '', $captcha = false)
+ {
+ if ($captcha !== false && $captcha->is_solved() === false)
+ {
+ $this->template->assign_vars(array(
+ 'S_CONFIRM_CODE' => true,
+ 'CAPTCHA_TEMPLATE' => $captcha->get_template(),
+ ));
+ }
+
+ $this->report_reason_provider->display_reasons($reason_id);
+
+ switch ($mode)
+ {
+ case 'pm':
+ $report_route = $this->helper->route('phpbb_report_pm_controller', array('id' => $id));
+ break;
+ case 'post':
+ $report_route = $this->helper->route('phpbb_report_post_controller', array('id' => $id));
+ break;
+ }
+
+ $this->template->assign_vars(array(
+ 'ERROR' => (sizeof($error) > 0) ? implode('<br />', $error) : '',
+ 'S_REPORT_POST' => ($mode === 'pm') ? false : true,
+ 'REPORT_TEXT' => $report_text,
+ 'S_HIDDEN_FIELDS' => (!empty($s_hidden_fields)) ? $s_hidden_fields : null,
+ 'S_REPORT_ACTION' => $report_route,
+
+ 'S_NOTIFY' => $user_notify,
+ 'S_CAN_NOTIFY' => ($this->user->data['is_registered']) ? true : false,
+ 'S_IN_REPORT' => true,
+ ));
+ }
+
+ /**
+ * Check CAPTCHA
+ *
+ * @param object $captcha A phpBB CAPTCHA object
+ * @return array template variables which ensures that CAPTCHA's work correctly
+ */
+ protected function check_captcha($captcha)
+ {
+ $error = array();
+ $captcha_hidden_fields = '';
+
+ $visual_confirmation_response = $captcha->validate();
+ if ($visual_confirmation_response)
+ {
+ $error[] = $visual_confirmation_response;
+ }
+
+ if (sizeof($error) === 0)
+ {
+ $captcha->reset();
+ }
+ else if ($captcha->is_solved() !== false)
+ {
+ $captcha_hidden_fields = build_hidden_fields($captcha->get_hidden_fields());
+ }
+
+ return array(
+ 'error' => $error,
+ 'hidden_fields' => $captcha_hidden_fields,
+ );
+ }
+}
diff --git a/phpBB/phpbb/report/exception/already_reported_exception.php b/phpBB/phpbb/report/exception/already_reported_exception.php
new file mode 100644
index 0000000000..54174044fe
--- /dev/null
+++ b/phpBB/phpbb/report/exception/already_reported_exception.php
@@ -0,0 +1,19 @@
+<?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\report\exception;
+
+class already_reported_exception extends invalid_report_exception
+{
+
+}
diff --git a/phpBB/phpbb/report/exception/empty_report_exception.php b/phpBB/phpbb/report/exception/empty_report_exception.php
new file mode 100644
index 0000000000..8c968dca80
--- /dev/null
+++ b/phpBB/phpbb/report/exception/empty_report_exception.php
@@ -0,0 +1,22 @@
+<?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\report\exception;
+
+class empty_report_exception extends invalid_report_exception
+{
+ public function __construct()
+ {
+ parent::__construct('EMPTY_REPORT');
+ }
+}
diff --git a/phpBB/phpbb/report/exception/entity_not_found_exception.php b/phpBB/phpbb/report/exception/entity_not_found_exception.php
new file mode 100644
index 0000000000..732aa58a13
--- /dev/null
+++ b/phpBB/phpbb/report/exception/entity_not_found_exception.php
@@ -0,0 +1,19 @@
+<?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\report\exception;
+
+class entity_not_found_exception extends invalid_report_exception
+{
+
+}
diff --git a/phpBB/phpbb/report/exception/factory_invalid_argument_exception.php b/phpBB/phpbb/report/exception/factory_invalid_argument_exception.php
new file mode 100644
index 0000000000..19de91eea3
--- /dev/null
+++ b/phpBB/phpbb/report/exception/factory_invalid_argument_exception.php
@@ -0,0 +1,21 @@
+<?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\report\exception;
+
+use \phpbb\exception\runtime_exception;
+
+class factory_invalid_argument_exception extends runtime_exception
+{
+
+}
diff --git a/phpBB/phpbb/report/exception/invalid_report_exception.php b/phpBB/phpbb/report/exception/invalid_report_exception.php
new file mode 100644
index 0000000000..03ff0a872d
--- /dev/null
+++ b/phpBB/phpbb/report/exception/invalid_report_exception.php
@@ -0,0 +1,21 @@
+<?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\report\exception;
+
+use \phpbb\exception\runtime_exception;
+
+class invalid_report_exception extends runtime_exception
+{
+
+}
diff --git a/phpBB/phpbb/report/exception/pm_reporting_disabled_exception.php b/phpBB/phpbb/report/exception/pm_reporting_disabled_exception.php
new file mode 100644
index 0000000000..2c8ab8cf84
--- /dev/null
+++ b/phpBB/phpbb/report/exception/pm_reporting_disabled_exception.php
@@ -0,0 +1,22 @@
+<?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\report\exception;
+
+class pm_reporting_disabled_exception extends invalid_report_exception
+{
+ public function __construct()
+ {
+
+ }
+}
diff --git a/phpBB/phpbb/report/exception/report_permission_denied_exception.php b/phpBB/phpbb/report/exception/report_permission_denied_exception.php
new file mode 100644
index 0000000000..c7069288b8
--- /dev/null
+++ b/phpBB/phpbb/report/exception/report_permission_denied_exception.php
@@ -0,0 +1,19 @@
+<?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\report\exception;
+
+class report_permission_denied_exception extends invalid_report_exception
+{
+
+}
diff --git a/phpBB/phpbb/report/handler_factory.php b/phpBB/phpbb/report/handler_factory.php
new file mode 100644
index 0000000000..ec229aac54
--- /dev/null
+++ b/phpBB/phpbb/report/handler_factory.php
@@ -0,0 +1,56 @@
+<?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\report;
+
+use phpbb\report\exception\factory_invalid_argument_exception;
+
+class handler_factory
+{
+ /**
+ * @var \Symfony\Component\DependencyInjection\ContainerInterface
+ */
+ protected $container;
+
+ /**
+ * Constructor
+ *
+ * @param \Symfony\Component\DependencyInjection\ContainerInterface $container
+ */
+ public function __construct(\Symfony\Component\DependencyInjection\ContainerInterface $container)
+ {
+ $this->container = $container;
+ }
+
+ /**
+ * Return a new instance of an appropriate report handler
+ *
+ * @param string $type
+ * @return \phpbb\report\report_handler_interface
+ * @throws \phpbb\report\exception\factory_invalid_argument_exception if $type is not valid
+ */
+ public function get_instance($type)
+ {
+ switch ($type)
+ {
+ case 'pm':
+ return $this->container->get('phpbb.report.handlers.report_handler_pm');
+ break;
+ case 'post':
+ return $this->container->get('phpbb.report.handlers.report_handler_post');
+ break;
+ }
+
+ throw new factory_invalid_argument_exception();
+ }
+}
diff --git a/phpBB/phpbb/report/report_handler.php b/phpBB/phpbb/report/report_handler.php
new file mode 100644
index 0000000000..126a206dbf
--- /dev/null
+++ b/phpBB/phpbb/report/report_handler.php
@@ -0,0 +1,104 @@
+<?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\report;
+
+abstract class report_handler implements report_handler_interface
+{
+ /**
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * @var \phpbb\event\dispatcher_interface
+ */
+ protected $dispatcher;
+
+ /**
+ * @var \phpbb\config\db
+ */
+ protected $config;
+
+ /**
+ * @var \phpbb\auth\auth
+ */
+ protected $auth;
+
+ /**
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * @var \phpbb\notification\manager
+ */
+ protected $notifications;
+
+ /**
+ * @var array
+ */
+ protected $report_data;
+
+ /**
+ * Construtor
+ *
+ * @param \phpbb\db\driver\driver_interface $db
+ * @param \phpbb\event\dispatcher_interface $dispatcher
+ * @param \phpbb\config\db $config
+ * @param \phpbb\auth\auth $auth
+ * @param \phpbb\user $user
+ * @param \phpbb\notification\manager $notification
+ */
+ public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\event\dispatcher_interface $dispatcher, \phpbb\config\db $config, \phpbb\auth\auth $auth, \phpbb\user $user, \phpbb\notification\manager $notification)
+ {
+ $this->db = $db;
+ $this->dispatcher = $dispatcher;
+ $this->config = $config;
+ $this->auth = $auth;
+ $this->user = $user;
+ $this->notifications = $notification;
+ $this->report_data = array();
+ }
+
+ /**
+ * Creates a report entity in the database
+ *
+ * @param array $report_data
+ * @return int the ID of the created entity
+ */
+ protected function create_report(array $report_data)
+ {
+ $sql_ary = array(
+ 'reason_id' => (int) $report_data['reason_id'],
+ 'post_id' => $report_data['post_id'],
+ 'pm_id' => $report_data['pm_id'],
+ 'user_id' => (int) $this->user->data['user_id'],
+ 'user_notify' => (int) $report_data['user_notify'],
+ 'report_closed' => 0,
+ 'report_time' => (int) time(),
+ 'report_text' => (string) $report_data['report_text'],
+ 'reported_post_text' => $report_data['reported_post_text'],
+ 'reported_post_uid' => $report_data['reported_post_uid'],
+ 'reported_post_bitfield' => $report_data['reported_post_bitfield'],
+ 'reported_post_enable_bbcode' => $report_data['reported_post_enable_bbcode'],
+ 'reported_post_enable_smilies' => $report_data['reported_post_enable_smilies'],
+ 'reported_post_enable_magic_url' => $report_data['reported_post_enable_magic_url'],
+ );
+
+ $sql = 'INSERT INTO ' . REPORTS_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary);
+ $this->db->sql_query($sql);
+
+ return $this->db->sql_nextid();
+ }
+}
diff --git a/phpBB/phpbb/report/report_handler_interface.php b/phpBB/phpbb/report/report_handler_interface.php
new file mode 100644
index 0000000000..8dafc392d0
--- /dev/null
+++ b/phpBB/phpbb/report/report_handler_interface.php
@@ -0,0 +1,43 @@
+<?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\report;
+
+interface report_handler_interface
+{
+ /**
+ * Reports a message
+ *
+ * @param int $id
+ * @param int $reason_id
+ * @param string $report_text
+ * @param int $user_notify
+ * @return null
+ * @throws \phpbb\report\exception\empty_report_exception when the given report is empty
+ * @throws \phpbb\report\exception\already_reported_exception when the entity is already reported
+ * @throws \phpbb\report\exception\entity_not_found_exception when the entity does not exist or the user does not have viewing permissions for it
+ * @throws \phpbb\report\exception\invalid_report_exception when the entity cannot be reported for some other reason
+ */
+ public function add_report($id, $reason_id, $report_text, $user_notify);
+
+ /**
+ * Checks if the message is reportable
+ *
+ * @param int $id
+ * @return null
+ * @throws \phpbb\report\exception\already_reported_exception when the entity is already reported
+ * @throws \phpbb\report\exception\entity_not_found_exception when the entity does not exist or the user does not have viewing permissions for it
+ * @throws \phpbb\report\exception\invalid_report_exception when the entity cannot be reported for some other reason
+ */
+ public function validate_report_request($id);
+}
diff --git a/phpBB/phpbb/report/report_handler_pm.php b/phpBB/phpbb/report/report_handler_pm.php
new file mode 100644
index 0000000000..2f2a697efc
--- /dev/null
+++ b/phpBB/phpbb/report/report_handler_pm.php
@@ -0,0 +1,137 @@
+<?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\report;
+
+use phpbb\report\exception\empty_report_exception;
+use phpbb\report\exception\already_reported_exception;
+use phpbb\report\exception\pm_reporting_disabled_exception;
+use phpbb\report\exception\entity_not_found_exception;
+
+class report_handler_pm extends report_handler
+{
+ /**
+ * {@inheritdoc}
+ * @throws \phpbb\report\exception\pm_reporting_disabled_exception when PM reporting is disabled on the board
+ */
+ public function add_report($id, $reason_id, $report_text, $user_notify)
+ {
+ // Cast the input variables
+ $id = (int) $id;
+ $reason_id = (int) $reason_id;
+ $report_text = (string) $report_text;
+ $user_notify = (int) $user_notify;
+
+ $this->validate_report_request($id);
+
+ $sql = 'SELECT *
+ FROM ' . REPORTS_REASONS_TABLE . "
+ WHERE reason_id = $reason_id";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if (!$row || (empty($report_text) && strtolower($row['reason_title']) === 'other'))
+ {
+ throw new empty_report_exception();
+ }
+
+ $report_data = array(
+ 'reason_id' => $reason_id,
+ 'post_id' => 0,
+ 'pm_id' => $id,
+ 'user_notify' => $user_notify,
+ 'report_text' => $report_text,
+ 'reported_post_text' => $this->report_data['message_text'],
+ 'reported_post_uid' => $this->report_data['bbcode_bitfield'],
+ 'reported_post_bitfield' => $this->report_data['bbcode_uid'],
+ 'reported_post_enable_bbcode' => $this->report_data['enable_bbcode'],
+ 'reported_post_enable_smilies' => $this->report_data['enable_smilies'],
+ 'reported_post_enable_magic_url' => $this->report_data['enable_magic_url'],
+ );
+
+ $report_id = $this->create_report($report_data);
+
+ $sql = 'UPDATE ' . PRIVMSGS_TABLE . '
+ SET message_reported = 1
+ WHERE msg_id = ' . $id;
+ $this->db->sql_query($sql);
+
+ $sql_ary = array(
+ 'msg_id' => $id,
+ 'user_id' => ANONYMOUS,
+ 'author_id' => (int) $this->report_data['author_id'],
+ 'pm_deleted' => 0,
+ 'pm_new' => 0,
+ 'pm_unread' => 0,
+ 'pm_replied' => 0,
+ 'pm_marked' => 0,
+ 'pm_forwarded' => 0,
+ 'folder_id' => PRIVMSGS_INBOX,
+ );
+
+ $sql = 'INSERT INTO ' . PRIVMSGS_TO_TABLE . ' ' . $this->db->sql_build_array('INSERT', $sql_ary);
+ $this->db->sql_query($sql);
+
+ $this->notifications->add_notifications('notification.type.report_pm', array_merge($this->report_data, $row, array(
+ 'report_text' => $report_text,
+ 'from_user_id' => $this->report_data['author_id'],
+ 'report_id' => $report_id,
+ )));
+ }
+
+ /**
+ * {@inheritdoc}
+ * @throws \phpbb\report\exception\pm_reporting_disabled_exception when PM reporting is disabled on the board
+ */
+ public function validate_report_request($id)
+ {
+ $id = (int) $id;
+
+ // Check if reporting PMs is enabled
+ if (!$this->config['allow_pm_report'])
+ {
+ throw new pm_reporting_disabled_exception();
+ }
+ else if ($id <= 0)
+ {
+ throw new entity_not_found_exception('NO_POST_SELECTED');
+ }
+
+ // Grab all relevant data
+ $sql = 'SELECT p.*, pt.*
+ FROM ' . PRIVMSGS_TABLE . ' p, ' . PRIVMSGS_TO_TABLE . " pt
+ WHERE p.msg_id = $id
+ AND p.msg_id = pt.msg_id
+ AND (p.author_id = " . $this->user->data['user_id'] . "
+ OR pt.user_id = " . $this->user->data['user_id'] . ")";
+ $result = $this->db->sql_query($sql);
+ $report_data = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ // Check if message exists
+ if (!$report_data)
+ {
+ $this->user->add_lang('ucp');
+ throw new entity_not_found_exception('NO_MESSAGE');
+ }
+
+ // Check if message is already reported
+ if ($report_data['message_reported'])
+ {
+ throw new already_reported_exception();
+ }
+
+ $this->report_data = $report_data;
+ }
+}
diff --git a/phpBB/phpbb/report/report_handler_post.php b/phpBB/phpbb/report/report_handler_post.php
new file mode 100644
index 0000000000..ce4ed67d27
--- /dev/null
+++ b/phpBB/phpbb/report/report_handler_post.php
@@ -0,0 +1,175 @@
+<?php
+/**
+ *
+ * This file is part of the phpBB Forum Software package.
+ *
+ * @copyright (c) phpBB Limited <https://www.phpbb.com>
+ * @license GNU General Public License, version 2 (GPL-2.0)
+ *
+ * For full copyright and license information, please see
+ * the docs/CREDITS.txt file.
+ *
+ */
+
+namespace phpbb\report;
+
+use phpbb\report\exception\invalid_report_exception;
+use phpbb\report\exception\empty_report_exception;
+use phpbb\report\exception\already_reported_exception;
+use phpbb\report\exception\entity_not_found_exception;
+use phpbb\report\exception\report_permission_denied_exception;
+
+class report_handler_post extends report_handler
+{
+ /**
+ * @var array
+ */
+ protected $forum_data;
+
+ /**
+ * {@inheritdoc}
+ * @throws \phpbb\report\exception\report_permission_denied_exception when the user does not have permission to report the post
+ */
+ public function add_report($id, $reason_id, $report_text, $user_notify)
+ {
+ // Cast the input variables
+ $id = (int) $id;
+ $reason_id = (int) $reason_id;
+ $report_text = (string) $report_text;
+ $user_notify = (int) $user_notify;
+
+ $this->validate_report_request($id);
+
+ $sql = 'SELECT *
+ FROM ' . REPORTS_REASONS_TABLE . "
+ WHERE reason_id = $reason_id";
+ $result = $this->db->sql_query($sql);
+ $row = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if (!$row || (empty($report_text) && strtolower($row['reason_title']) === 'other'))
+ {
+ throw new empty_report_exception();
+ }
+
+ $report_data = array(
+ 'reason_id' => $reason_id,
+ 'post_id' => $id,
+ 'pm_id' => 0,
+ 'user_notify' => $user_notify,
+ 'report_text' => $report_text,
+ 'reported_post_text' => $this->report_data['post_text'],
+ 'reported_post_uid' => $this->report_data['bbcode_bitfield'],
+ 'reported_post_bitfield' => $this->report_data['bbcode_uid'],
+ 'reported_post_enable_bbcode' => $this->report_data['enable_bbcode'],
+ 'reported_post_enable_smilies' => $this->report_data['enable_smilies'],
+ 'reported_post_enable_magic_url' => $this->report_data['enable_magic_url'],
+ );
+
+ $report_id = $this->create_report($report_data);
+
+ $sql = 'UPDATE ' . POSTS_TABLE . '
+ SET post_reported = 1
+ WHERE post_id = ' . $id;
+ $this->db->sql_query($sql);
+
+ if (!$this->report_data['topic_reported'])
+ {
+ $sql = 'UPDATE ' . TOPICS_TABLE . '
+ SET topic_reported = 1
+ WHERE topic_id = ' . $this->report_data['topic_id'] . '
+ OR topic_moved_id = ' . $this->report_data['topic_id'];
+ $this->db->sql_query($sql);
+ }
+
+ $this->notifications->add_notifications('notification.type.report_post', array_merge($this->report_data, $row, $this->forum_data, array(
+ 'report_text' => $report_text,
+ )));
+ }
+
+ /**
+ * {@inheritdoc}
+ * @throws \phpbb\report\exception\report_permission_denied_exception when the user does not have permission to report the post
+ */
+ public function validate_report_request($id)
+ {
+ $id = (int) $id;
+
+ // Check if id is valid
+ if ($id <= 0)
+ {
+ throw new entity_not_found_exception('NO_POST_SELECTED');
+ }
+
+ // Grab all relevant data
+ $sql = 'SELECT t.*, p.*
+ FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
+ WHERE p.post_id = $id
+ AND p.topic_id = t.topic_id";
+ $result = $this->db->sql_query($sql);
+ $report_data = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if (!$report_data)
+ {
+ throw new entity_not_found_exception('POST_NOT_EXIST');
+ }
+
+ $forum_id = (int) $report_data['forum_id'];
+
+ $sql = 'SELECT *
+ FROM ' . FORUMS_TABLE . '
+ WHERE forum_id = ' . $forum_id;
+ $result = $this->db->sql_query($sql);
+ $forum_data = $this->db->sql_fetchrow($result);
+ $this->db->sql_freeresult($result);
+
+ if (!$forum_data)
+ {
+ throw new invalid_report_exception('FORUM_NOT_EXIST');
+ }
+
+ $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($this->dispatcher->trigger_event('core.report_post_auth', compact($vars)));
+
+ $this->auth->acl($this->user->data);
+
+ foreach ($acl_check_ary as $acl => $error)
+ {
+ if (!$this->auth->acl_get($acl, $forum_id))
+ {
+ throw new report_permission_denied_exception($error);
+ }
+ }
+ unset($acl_check_ary);
+
+ if ($report_data['post_reported'])
+ {
+ throw new already_reported_exception();
+ }
+
+ $this->report_data = $report_data;
+ $this->forum_data = $forum_data;
+ }
+}
diff --git a/phpBB/phpbb/report/report_reason_list_provider.php b/phpBB/phpbb/report/report_reason_list_provider.php
new file mode 100644
index 0000000000..388a61d577
--- /dev/null
+++ b/phpBB/phpbb/report/report_reason_list_provider.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.
+ *
+ */
+
+namespace phpbb\report;
+
+class report_reason_list_provider
+{
+ /**
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * @var \phpbb\template\template
+ */
+ protected $template;
+
+ /**
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\db\driver\driver_interface $db
+ * @param \phpbb\template\template $template
+ * @param \phpbb\user $user
+ */
+ public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\template\template $template, \phpbb\user $user)
+ {
+ $this->db = $db;
+ $this->template = $template;
+ $this->user = $user;
+ }
+
+ /**
+ * Sets template variables to render report reasons select HTML input
+ *
+ * @param int $reason_id
+ * @return null
+ */
+ public function display_reasons($reason_id = 0)
+ {
+ $sql = 'SELECT *
+ FROM ' . REPORTS_REASONS_TABLE . '
+ ORDER BY reason_order ASC';
+ $result = $this->db->sql_query($sql);
+
+ while ($row = $this->db->sql_fetchrow($result))
+ {
+ // If the reason is defined within the language file, we will use the localized version, else just use the database entry...
+ if (isset($this->user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])]) && isset($this->user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])]))
+ {
+ $row['reason_description'] = $this->user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])];
+ $row['reason_title'] = $this->user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])];
+ }
+
+ $this->template->assign_block_vars('reason', array(
+ 'ID' => $row['reason_id'],
+ 'TITLE' => $row['reason_title'],
+ 'DESCRIPTION' => $row['reason_description'],
+ 'S_SELECTED' => ($row['reason_id'] == $reason_id) ? true : false,
+ ));
+ }
+ $this->db->sql_freeresult($result);
+ }
+}
diff --git a/phpBB/phpbb/request/deactivated_super_global.php b/phpBB/phpbb/request/deactivated_super_global.php
index b6cad59be4..ab56240b14 100644
--- a/phpBB/phpbb/request/deactivated_super_global.php
+++ b/phpBB/phpbb/request/deactivated_super_global.php
@@ -56,7 +56,7 @@ class deactivated_super_global implements \ArrayAccess, \Countable, \IteratorAgg
$file = '';
$line = 0;
- $message = 'Illegal use of $' . $this->name . '. You must use the request class or request_var() to access input data. Found in %s on line %d. This error message was generated by deactivated_super_global.';
+ $message = 'Illegal use of $' . $this->name . '. You must use the request class to access input data. Found in %s on line %d. This error message was generated by deactivated_super_global.';
$backtrace = debug_backtrace();
if (isset($backtrace[1]))
diff --git a/phpBB/phpbb/routing/helper.php b/phpBB/phpbb/routing/helper.php
new file mode 100644
index 0000000000..f56974a354
--- /dev/null
+++ b/phpBB/phpbb/routing/helper.php
@@ -0,0 +1,153 @@
+<?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\routing;
+
+use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
+use Symfony\Component\Routing\RequestContext;
+
+/**
+* Controller helper class, contains methods that do things for controllers
+*/
+class helper
+{
+ /**
+ * config object
+ * @var \phpbb\config\config
+ */
+ protected $config;
+
+ /**
+ * phpBB router
+ * @var \phpbb\routing\router
+ */
+ protected $router;
+
+ /**
+ * @var \phpbb\symfony_request
+ */
+ protected $symfony_request;
+
+ /**
+ * @var \phpbb\request\request_interface
+ */
+ protected $request;
+
+ /**
+ * @var \phpbb\filesystem The filesystem object
+ */
+ protected $filesystem;
+
+ /**
+ * phpBB root path
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * PHP file extension
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\config\config $config Config object
+ * @param \phpbb\routing\router $router phpBB router
+ * @param \phpbb\symfony_request $symfony_request Symfony Request object
+ * @param \phpbb\request\request_interface $request phpBB request object
+ * @param \phpbb\filesystem\filesystem $filesystem The filesystem object
+ * @param string $phpbb_root_path phpBB root path
+ * @param string $php_ext PHP file extension
+ */
+ public function __construct(\phpbb\config\config $config, \phpbb\routing\router $router, \phpbb\symfony_request $symfony_request, \phpbb\request\request_interface $request, \phpbb\filesystem\filesystem $filesystem, $phpbb_root_path, $php_ext)
+ {
+ $this->config = $config;
+ $this->router = $router;
+ $this->symfony_request = $symfony_request;
+ $this->request = $request;
+ $this->filesystem = $filesystem;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ }
+
+ /**
+ * Generate a URL to a route
+ *
+ * @param string $route Name of the route to travel
+ * @param array $params String or array of additional url parameters
+ * @param bool $is_amp Is url using &amp; (true) or & (false)
+ * @param string|bool $session_id Possibility to use a custom session id instead of the global one
+ * @param bool|string $reference_type The type of reference to be generated (one of the constants)
+ * @return string The URL already passed through append_sid()
+ */
+ public function route($route, array $params = array(), $is_amp = true, $session_id = false, $reference_type = UrlGeneratorInterface::ABSOLUTE_PATH)
+ {
+ $anchor = '';
+ if (isset($params['#']))
+ {
+ $anchor = '#' . $params['#'];
+ unset($params['#']);
+ }
+
+ $context = new RequestContext();
+ $context->fromRequest($this->symfony_request);
+
+ $script_name = $this->symfony_request->getScriptName();
+ $page_name = substr($script_name, -1, 1) == '/' ? '' : utf8_basename($script_name);
+
+ $base_url = $context->getBaseUrl();
+
+ // Append page name if base URL does not contain it
+ if (!empty($page_name) && strpos($base_url, '/' . $page_name) === false)
+ {
+ $base_url .= '/' . $page_name;
+ }
+
+ // 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 the current script is not app.php
+ if ($page_name !== 'app.php')
+ {
+ 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->request->escape($this->filesystem->clean_path($base_url), true);
+
+ $context->setBaseUrl($base_url);
+
+ $this->router->setContext($context);
+ $route_url = $this->router->generate($route, $params, $reference_type);
+
+ if ($is_amp)
+ {
+ $route_url = str_replace(array('&amp;', '&'), array('&', '&amp;'), $route_url);
+ }
+
+ if ($reference_type === UrlGeneratorInterface::RELATIVE_PATH && empty($this->config['enable_mod_rewrite']))
+ {
+ $route_url = 'app.' . $this->php_ext . '/' . $route_url;
+ }
+
+ return append_sid($route_url . $anchor, false, $is_amp, $session_id, true);
+ }
+}
diff --git a/phpBB/phpbb/routing/router.php b/phpBB/phpbb/routing/router.php
new file mode 100644
index 0000000000..5af005769f
--- /dev/null
+++ b/phpBB/phpbb/routing/router.php
@@ -0,0 +1,460 @@
+<?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\routing;
+
+use Symfony\Component\Config\ConfigCache;
+use Symfony\Component\Filesystem\Exception\IOException;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException;
+use Symfony\Component\DependencyInjection\Exception\RuntimeException;
+use Symfony\Component\Routing\Matcher\Dumper\PhpMatcherDumper;
+use Symfony\Component\Routing\Generator\Dumper\PhpGeneratorDumper;
+use Symfony\Component\Routing\Matcher\UrlMatcher;
+use Symfony\Component\Routing\Generator\UrlGenerator;
+use Symfony\Component\Routing\RequestContext;
+use Symfony\Component\Routing\RouteCollection;
+use Symfony\Component\Routing\RouterInterface;
+use Symfony\Component\Routing\Loader\YamlFileLoader;
+use Symfony\Component\Config\FileLocator;
+use phpbb\extension\manager;
+
+/**
+ * Integration of all pieces of the routing system for easier use.
+ */
+class router implements RouterInterface
+{
+ /**
+ * Extension manager
+ *
+ * @var manager
+ */
+ protected $extension_manager;
+
+ /**
+ * phpBB root path
+ *
+ * @var string
+ */
+ protected $phpbb_root_path;
+
+ /**
+ * PHP file extensions
+ *
+ * @var string
+ */
+ protected $php_ext;
+
+ /**
+ * Name of the current environment
+ *
+ * @var string
+ */
+ protected $environment;
+
+ /**
+ * YAML file(s) containing route information
+ *
+ * @var array
+ */
+ protected $routing_files;
+
+ /**
+ * @var \Symfony\Component\Routing\Matcher\UrlMatcherInterface|null
+ */
+ protected $matcher;
+
+ /**
+ * @var \Symfony\Component\Routing\Generator\UrlGeneratorInterface|null
+ */
+ protected $generator;
+
+ /**
+ * @var RequestContext
+ */
+ protected $context;
+
+ /**
+ * @var RouteCollection|null
+ */
+ protected $route_collection;
+
+ /**
+ * @var \phpbb\filesystem\filesystem_interface
+ */
+ protected $filesystem;
+
+ /**
+ * @var ContainerInterface
+ */
+ protected $container;
+
+ /**
+ * Construct method
+ *
+ * @param ContainerInterface $container DI container
+ * @param \phpbb\filesystem\filesystem_interface $filesystem Filesystem helper
+ * @param string $phpbb_root_path phpBB root path
+ * @param string $php_ext PHP file extension
+ * @param string $environment Name of the current environment
+ * @param manager $extension_manager Extension manager
+ * @param array $routing_files Array of strings containing paths to YAML files holding route information
+ */
+ public function __construct(ContainerInterface $container, \phpbb\filesystem\filesystem_interface $filesystem, $phpbb_root_path, $php_ext, $environment, manager $extension_manager = null, $routing_files = array())
+ {
+ $this->container = $container;
+ $this->filesystem = $filesystem;
+ $this->extension_manager = $extension_manager;
+ $this->routing_files = $routing_files;
+ $this->phpbb_root_path = $phpbb_root_path;
+ $this->php_ext = $php_ext;
+ $this->environment = $environment;
+ $this->context = new RequestContext();
+ }
+
+ /**
+ * Find the list of routing files
+ *
+ * @param array $paths Array of paths where to look for routing files (they must be relative to the phpBB root path).
+ * @return router
+ */
+ public function find_routing_files(array $paths)
+ {
+ $this->routing_files = array('config/' . $this->environment . '/routing/environment.yml');
+ foreach ($paths as $path)
+ {
+ if (file_exists($this->phpbb_root_path . $path . 'config/' . $this->environment . '/routing/environment.yml'))
+ {
+ $this->routing_files[] = $path . 'config/' . $this->environment . '/routing/environment.yml';
+ }
+ else if (!is_dir($this->phpbb_root_path . $path . 'config/' . $this->environment))
+ {
+ if (file_exists($this->phpbb_root_path . $path . 'config/default/routing/environment.yml'))
+ {
+ $this->routing_files[] = $path . 'config/default/routing/environment.yml';
+ }
+ else if (!is_dir($this->phpbb_root_path . $path . 'config/default/routing') && file_exists($this->phpbb_root_path . $path . 'config/routing.yml'))
+ {
+ $this->routing_files[] = $path . 'config/routing.yml';
+ }
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Find a list of controllers
+ *
+ * @param string $base_path Base path to prepend to file paths
+ * @return router
+ */
+ public function find($base_path = '')
+ {
+ if ($this->route_collection === null || $this->route_collection->count() === 0)
+ {
+ $this->route_collection = new RouteCollection;
+ foreach ($this->routing_files as $file_path)
+ {
+ $loader = new YamlFileLoader(new FileLocator($this->filesystem->realpath($base_path)));
+ $this->route_collection->addCollection($loader->load($file_path));
+ }
+ }
+
+ $this->resolveParameters($this->route_collection);
+
+ return $this;
+ }
+
+ /**
+ * Replaces placeholders with service container parameter values in:
+ * - the route defaults,
+ * - the route requirements,
+ * - the route path,
+ * - the route host,
+ * - the route schemes,
+ * - the route methods.
+ *
+ * @param RouteCollection $collection
+ */
+ private function resolveParameters(RouteCollection $collection)
+ {
+ foreach ($collection as $route)
+ {
+ foreach ($route->getDefaults() as $name => $value)
+ {
+ $route->setDefault($name, $this->resolve($value));
+ }
+
+ $requirements = $route->getRequirements();
+ unset($requirements['_scheme']);
+ unset($requirements['_method']);
+
+ foreach ($requirements as $name => $value)
+ {
+ $route->setRequirement($name, $this->resolve($value));
+ }
+
+ $route->setPath($this->resolve($route->getPath()));
+ $route->setHost($this->resolve($route->getHost()));
+
+ $schemes = array();
+ foreach ($route->getSchemes() as $scheme)
+ {
+ $schemes = array_merge($schemes, explode('|', $this->resolve($scheme)));
+ }
+
+ $route->setSchemes($schemes);
+ $methods = array();
+ foreach ($route->getMethods() as $method)
+ {
+ $methods = array_merge($methods, explode('|', $this->resolve($method)));
+ }
+
+ $route->setMethods($methods);
+ $route->setCondition($this->resolve($route->getCondition()));
+ }
+ }
+
+ /**
+ * Recursively replaces placeholders with the service container parameters.
+ *
+ * @param mixed $value The source which might contain "%placeholders%"
+ *
+ * @return mixed The source with the placeholders replaced by the container
+ * parameters. Arrays are resolved recursively.
+ *
+ * @throws ParameterNotFoundException When a placeholder does not exist as a container parameter
+ * @throws RuntimeException When a container value is not a string or a numeric value
+ */
+ private function resolve($value)
+ {
+ if (is_array($value))
+ {
+ foreach ($value as $key => $val)
+ {
+ $value[$key] = $this->resolve($val);
+ }
+
+ return $value;
+ }
+
+ if (!is_string($value))
+ {
+ return $value;
+ }
+
+ $container = $this->container;
+ $escapedValue = preg_replace_callback('/%%|%([^%\s]++)%/', function ($match) use ($container, $value)
+ {
+ // skip %%
+ if (!isset($match[1]))
+ {
+ return '%%';
+ }
+
+ $resolved = $container->getParameter($match[1]);
+ if (is_string($resolved) || is_numeric($resolved))
+ {
+ return (string) $resolved;
+ }
+
+ throw new RuntimeException(sprintf(
+ 'The container parameter "%s", used in the route configuration value "%s", '.
+ 'must be a string or numeric, but it is of type %s.',
+ $match[1],
+ $value,
+ gettype($resolved)
+ )
+ );
+ }, $value);
+
+ return str_replace('%%', '%', $escapedValue);
+ }
+
+ /**
+ * Get the list of routes
+ *
+ * @return RouteCollection Get the route collection
+ */
+ public function get_routes()
+ {
+ if ($this->route_collection == null || empty($this->routing_files))
+ {
+ $this->find_routing_files(
+ ($this->extension_manager !== null) ? $this->extension_manager->all_enabled(false) : array()
+ )
+ ->find($this->phpbb_root_path);
+ }
+
+ return $this->route_collection;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getRouteCollection()
+ {
+ return $this->get_routes();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setContext(RequestContext $context)
+ {
+ $this->context = $context;
+
+ if ($this->matcher !== null)
+ {
+ $this->get_matcher()->setContext($context);
+ }
+ if ($this->generator !== null)
+ {
+ $this->get_generator()->setContext($context);
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getContext()
+ {
+ return $this->context;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH)
+ {
+ return $this->get_generator()->generate($name, $parameters, $referenceType);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function match($pathinfo)
+ {
+ return $this->get_matcher()->match($pathinfo);
+ }
+
+ /**
+ * Gets the UrlMatcher instance associated with this Router.
+ *
+ * @return \Symfony\Component\Routing\Matcher\UrlMatcherInterface A UrlMatcherInterface instance
+ */
+ public function get_matcher()
+ {
+ if ($this->matcher !== null)
+ {
+ return $this->matcher;
+ }
+
+ $this->create_dumped_url_matcher();
+
+ return $this->matcher;
+ }
+ /**
+ * Creates a new dumped URL Matcher (dump it if necessary)
+ */
+ protected function create_dumped_url_matcher()
+ {
+ try
+ {
+ $cache = new ConfigCache("{$this->phpbb_root_path}cache/{$this->environment}/url_matcher.{$this->php_ext}", defined('DEBUG'));
+ if (!$cache->isFresh())
+ {
+ $dumper = new PhpMatcherDumper($this->get_routes());
+
+ $options = array(
+ 'class' => 'phpbb_url_matcher',
+ 'base_class' => 'Symfony\\Component\\Routing\\Matcher\\UrlMatcher',
+ );
+
+ $cache->write($dumper->dump($options), $this->get_routes()->getResources());
+ }
+
+ require_once($cache->getPath());
+
+ $this->matcher = new \phpbb_url_matcher($this->context);
+ }
+ catch (IOException $e)
+ {
+ $this->create_new_url_matcher();
+ }
+ }
+
+ /**
+ * Creates a new URL Matcher
+ */
+ protected function create_new_url_matcher()
+ {
+ $this->matcher = new UrlMatcher($this->get_routes(), $this->context);
+ }
+
+ /**
+ * Gets the UrlGenerator instance associated with this Router.
+ *
+ * @return \Symfony\Component\Routing\Generator\UrlGeneratorInterface A UrlGeneratorInterface instance
+ */
+ public function get_generator()
+ {
+ if ($this->generator !== null)
+ {
+ return $this->generator;
+ }
+
+ $this->create_dumped_url_generator();
+
+ return $this->generator;
+ }
+
+ /**
+ * Creates a new dumped URL Generator (dump it if necessary)
+ */
+ protected function create_dumped_url_generator()
+ {
+ try
+ {
+ $cache = new ConfigCache("{$this->phpbb_root_path}cache/{$this->environment}/url_generator.{$this->php_ext}", defined('DEBUG'));
+ if (!$cache->isFresh())
+ {
+ $dumper = new PhpGeneratorDumper($this->get_routes());
+
+ $options = array(
+ 'class' => 'phpbb_url_generator',
+ 'base_class' => 'Symfony\\Component\\Routing\\Generator\\UrlGenerator',
+ );
+
+ $cache->write($dumper->dump($options), $this->get_routes()->getResources());
+ }
+
+ require_once($cache->getPath());
+
+ $this->generator = new \phpbb_url_generator($this->context);
+ }
+ catch (IOException $e)
+ {
+ $this->create_new_url_generator();
+ }
+ }
+
+ /**
+ * Creates a new URL Generator
+ */
+ protected function create_new_url_generator()
+ {
+ $this->generator = new UrlGenerator($this->get_routes(), $this->context);
+ }
+}
diff --git a/phpBB/phpbb/search/fulltext_mysql.php b/phpBB/phpbb/search/fulltext_mysql.php
index bad2003000..ba9f5f3a77 100644
--- a/phpBB/phpbb/search/fulltext_mysql.php
+++ b/phpBB/phpbb/search/fulltext_mysql.php
@@ -196,8 +196,8 @@ class fulltext_mysql extends \phpbb\search\base
}
$this->db->sql_freeresult($result);
- set_config('fulltext_mysql_max_word_len', $mysql_info['ft_max_word_len']);
- set_config('fulltext_mysql_min_word_len', $mysql_info['ft_min_word_len']);
+ $this->config->set('fulltext_mysql_max_word_len', $mysql_info['ft_max_word_len']);
+ $this->config->set('fulltext_mysql_min_word_len', $mysql_info['ft_min_word_len']);
return false;
}
@@ -855,7 +855,7 @@ class fulltext_mysql extends \phpbb\search\base
// destroy too old cached search results
$this->destroy_cache(array());
- set_config('search_last_gc', time(), true);
+ $this->config->set('search_last_gc', time(), false);
}
/**
diff --git a/phpBB/phpbb/search/fulltext_native.php b/phpBB/phpbb/search/fulltext_native.php
index 02337cbf98..41d3434c7d 100644
--- a/phpBB/phpbb/search/fulltext_native.php
+++ b/phpBB/phpbb/search/fulltext_native.php
@@ -18,6 +18,13 @@ namespace phpbb\search;
*/
class fulltext_native extends \phpbb\search\base
{
+ const UTF8_HANGUL_FIRST = "\xEA\xB0\x80";
+ const UTF8_HANGUL_LAST = "\xED\x9E\xA3";
+ const UTF8_CJK_FIRST = "\xE4\xB8\x80";
+ const UTF8_CJK_LAST = "\xE9\xBE\xBB";
+ const UTF8_CJK_B_FIRST = "\xF0\xA0\x80\x80";
+ const UTF8_CJK_B_LAST = "\xF0\xAA\x9B\x96";
+
/**
* Associative array holding index stats
* @var array
@@ -99,7 +106,7 @@ class fulltext_native extends \phpbb\search\base
protected $user;
/**
- * Initialises the fulltext_native search backend with min/max word length and makes sure the UTF-8 normalizer is loaded
+ * Initialises the fulltext_native search backend with min/max word length
*
* @param boolean|string &$error is passed by reference and should either be set to false on success or an error message on failure
* @param \phpbb\event\dispatcher_interface $phpbb_dispatcher Event dispatcher object
@@ -118,10 +125,6 @@ class fulltext_native extends \phpbb\search\base
/**
* Load the UTF tools
*/
- if (!class_exists('utf_normalizer'))
- {
- include($this->phpbb_root_path . 'includes/utf/utf_normalizer.' . $this->php_ext);
- }
if (!function_exists('utf8_decode_ncr'))
{
include($this->phpbb_root_path . 'includes/utf/utf_tools.' . $this->php_ext);
@@ -1291,9 +1294,9 @@ class fulltext_native extends \phpbb\search\base
* Note: this could be optimized. If the codepoint is lower than Hangul's range
* we know that it will also be lower than CJK ranges
*/
- if ((strncmp($word, UTF8_HANGUL_FIRST, 3) < 0 || strncmp($word, UTF8_HANGUL_LAST, 3) > 0)
- && (strncmp($word, UTF8_CJK_FIRST, 3) < 0 || strncmp($word, UTF8_CJK_LAST, 3) > 0)
- && (strncmp($word, UTF8_CJK_B_FIRST, 4) < 0 || strncmp($word, UTF8_CJK_B_LAST, 4) > 0))
+ if ((strncmp($word, self::UTF8_HANGUL_FIRST, 3) < 0 || strncmp($word, self::UTF8_HANGUL_LAST, 3) > 0)
+ && (strncmp($word, self::UTF8_CJK_FIRST, 3) < 0 || strncmp($word, self::UTF8_CJK_LAST, 3) > 0)
+ && (strncmp($word, self::UTF8_CJK_B_FIRST, 4) < 0 || strncmp($word, self::UTF8_CJK_B_LAST, 4) > 0))
{
$word = strtok(' ');
continue;
@@ -1538,7 +1541,7 @@ class fulltext_native extends \phpbb\search\base
// carry on ... it's okay ... I know when I'm not wanted boo hoo
if (!$this->config['fulltext_native_load_upd'])
{
- set_config('search_last_gc', time(), true);
+ $this->config->set('search_last_gc', time(), false);
return;
}
@@ -1573,7 +1576,7 @@ class fulltext_native extends \phpbb\search\base
// by setting search_last_gc to the new time here we make sure that if a user reloads because the
// following query takes too long, he won't run into it again
- set_config('search_last_gc', time(), true);
+ $this->config->set('search_last_gc', time(), false);
// Delete the matches
$sql = 'DELETE FROM ' . SEARCH_WORDMATCH_TABLE . '
@@ -1589,7 +1592,7 @@ class fulltext_native extends \phpbb\search\base
$this->destroy_cache(array_unique($destroy_cache_words));
}
- set_config('search_last_gc', time(), true);
+ $this->config->set('search_last_gc', time(), false);
}
/**
@@ -1660,8 +1663,6 @@ class fulltext_native extends \phpbb\search\base
* @param string $allowed_chars String of special chars to allow
* @param string $encoding Text encoding
* @return string Cleaned up text, only alphanumeric chars are left
- *
- * @todo \normalizer::cleanup being able to be used?
*/
protected function cleanup($text, $allowed_chars = null, $encoding = 'utf-8')
{
@@ -1688,12 +1689,9 @@ class fulltext_native extends \phpbb\search\base
$text = htmlspecialchars_decode(utf8_decode_ncr($text), ENT_QUOTES);
/**
- * Load the UTF-8 normalizer
- *
- * If we use it more widely, an instance of that class should be held in a
- * a global variable instead
+ * Normalize to NFC
*/
- \utf_normalizer::nfc($text);
+ $text = \Normalizer::normalize($text);
/**
* The first thing we do is:
@@ -1786,9 +1784,9 @@ class fulltext_native extends \phpbb\search\base
$utf_char = substr($text, $pos, $utf_len);
$pos += $utf_len;
- if (($utf_char >= UTF8_HANGUL_FIRST && $utf_char <= UTF8_HANGUL_LAST)
- || ($utf_char >= UTF8_CJK_FIRST && $utf_char <= UTF8_CJK_LAST)
- || ($utf_char >= UTF8_CJK_B_FIRST && $utf_char <= UTF8_CJK_B_LAST))
+ if (($utf_char >= self::UTF8_HANGUL_FIRST && $utf_char <= self::UTF8_HANGUL_LAST)
+ || ($utf_char >= self::UTF8_CJK_FIRST && $utf_char <= self::UTF8_CJK_LAST)
+ || ($utf_char >= self::UTF8_CJK_B_FIRST && $utf_char <= self::UTF8_CJK_B_LAST))
{
/**
* All characters within these ranges are valid
diff --git a/phpBB/phpbb/search/fulltext_postgres.php b/phpBB/phpbb/search/fulltext_postgres.php
index d17b26be8f..8fe80a39a3 100644
--- a/phpBB/phpbb/search/fulltext_postgres.php
+++ b/phpBB/phpbb/search/fulltext_postgres.php
@@ -852,7 +852,7 @@ class fulltext_postgres extends \phpbb\search\base
// destroy too old cached search results
$this->destroy_cache(array());
- set_config('search_last_gc', time(), true);
+ $this->config->set('search_last_gc', time(), false);
}
/**
diff --git a/phpBB/phpbb/search/fulltext_sphinx.php b/phpBB/phpbb/search/fulltext_sphinx.php
index cd7add72f0..937292fd38 100644
--- a/phpBB/phpbb/search/fulltext_sphinx.php
+++ b/phpBB/phpbb/search/fulltext_sphinx.php
@@ -85,7 +85,7 @@ class fulltext_sphinx
/**
* Database Tools object
- * @var \phpbb\db\tools
+ * @var \phpbb\db\tools\tools_interface
*/
protected $db_tools;
@@ -143,12 +143,13 @@ class fulltext_sphinx
$this->db = $db;
$this->auth = $auth;
- // Initialize \phpbb\db\tools object
- $this->db_tools = new \phpbb\db\tools($this->db);
+ // Initialize \phpbb\db\tools\tools object
+ global $phpbb_container; // TODO inject into object
+ $this->db_tools = $phpbb_container->get('dbal.tools');
if (!$this->config['fulltext_sphinx_id'])
{
- set_config('fulltext_sphinx_id', unique_id());
+ $this->config->set('fulltext_sphinx_id', unique_id());
}
$this->id = $this->config['fulltext_sphinx_id'];
$this->indexes = 'index_phpbb_' . $this->id . '_delta;index_phpbb_' . $this->id . '_main';
@@ -219,7 +220,7 @@ class fulltext_sphinx
}
// Move delta to main index each hour
- set_config('search_gc', 3600);
+ $this->config->set('search_gc', 3600);
return false;
}
@@ -462,6 +463,8 @@ class fulltext_sphinx
*/
public function keyword_search($type, $fields, $terms, $sort_by_sql, $sort_key, $sort_dir, $sort_days, $ex_fid_ary, $post_visibility, $topic_id, $author_ary, $author_name, &$id_ary, &$start, $per_page)
{
+ global $user, $phpbb_log;
+
// No keywords? No posts.
if (!strlen($this->search_query) && !sizeof($author_ary))
{
@@ -609,7 +612,7 @@ class fulltext_sphinx
if ($this->sphinx->GetLastError())
{
- add_log('critical', 'LOG_SPHINX_ERROR', $this->sphinx->GetLastError());
+ $phpbb_log->add('critical', $user->data['user_id'], $user->ip, 'LOG_SPHINX_ERROR', false, array($this->sphinx->GetLastError()));
if ($this->auth->acl_get('a_'))
{
trigger_error($this->user->lang('SPHINX_SEARCH_FAILED', $this->sphinx->GetLastError()));
@@ -763,7 +766,7 @@ class fulltext_sphinx
*/
public function tidy($create = false)
{
- set_config('search_last_gc', time(), true);
+ $this->config->set('search_last_gc', time(), false);
}
/**
diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php
index a5c8f264e0..120142e64c 100644
--- a/phpBB/phpbb/session.php
+++ b/phpBB/phpbb/session.php
@@ -92,8 +92,8 @@ class session
}
// current directory within the phpBB root (for example: adm)
- $root_dirs = explode('/', str_replace('\\', '/', phpbb_realpath($root_path)));
- $page_dirs = explode('/', str_replace('\\', '/', phpbb_realpath('./')));
+ $root_dirs = explode('/', str_replace('\\', '/', $phpbb_filesystem->realpath($root_path)));
+ $page_dirs = explode('/', str_replace('\\', '/', $phpbb_filesystem->realpath('./')));
$intersection = array_intersect_assoc($root_dirs, $page_dirs);
$root_dirs = array_diff_assoc($root_dirs, $intersection);
@@ -219,7 +219,7 @@ class session
function session_begin($update_session_page = true)
{
global $phpEx, $SID, $_SID, $_EXTRA_URL, $db, $config, $phpbb_root_path;
- global $request, $phpbb_container;
+ global $request, $phpbb_container, $user, $phpbb_log;
// Give us some basic information
$this->time_now = time();
@@ -257,23 +257,23 @@ class session
if ($request->is_set($config['cookie_name'] . '_sid', \phpbb\request\request_interface::COOKIE) || $request->is_set($config['cookie_name'] . '_u', \phpbb\request\request_interface::COOKIE))
{
- $this->cookie_data['u'] = request_var($config['cookie_name'] . '_u', 0, false, true);
- $this->cookie_data['k'] = request_var($config['cookie_name'] . '_k', '', false, true);
- $this->session_id = request_var($config['cookie_name'] . '_sid', '', false, true);
+ $this->cookie_data['u'] = $request->variable($config['cookie_name'] . '_u', 0, false, \phpbb\request\request_interface::COOKIE);
+ $this->cookie_data['k'] = $request->variable($config['cookie_name'] . '_k', '', false, \phpbb\request\request_interface::COOKIE);
+ $this->session_id = $request->variable($config['cookie_name'] . '_sid', '', false, \phpbb\request\request_interface::COOKIE);
$SID = (defined('NEED_SID')) ? '?sid=' . $this->session_id : '?sid=';
$_SID = (defined('NEED_SID')) ? $this->session_id : '';
if (empty($this->session_id))
{
- $this->session_id = $_SID = request_var('sid', '');
+ $this->session_id = $_SID = $request->variable('sid', '');
$SID = '?sid=' . $this->session_id;
$this->cookie_data = array('u' => 0, 'k' => '');
}
}
else
{
- $this->session_id = $_SID = request_var('sid', '');
+ $this->session_id = $_SID = $request->variable('sid', '');
$SID = '?sid=' . $this->session_id;
}
@@ -349,8 +349,8 @@ class session
}
else
{
- set_config('limit_load', '0');
- set_config('limit_search_load', '0');
+ $config->set('limit_load', '0');
+ $config->set('limit_search_load', '0');
}
}
@@ -413,6 +413,7 @@ class session
$session_expired = false;
// Check whether the session is still valid if we have one
+ /* @var $provider_collection \phpbb\auth\provider_collection */
$provider_collection = $phpbb_container->get('auth.provider_collection');
$provider = $provider_collection->get_provider();
@@ -493,11 +494,18 @@ class session
{
if ($referer_valid)
{
- add_log('critical', 'LOG_IP_BROWSER_FORWARDED_CHECK', $u_ip, $s_ip, $u_browser, $s_browser, htmlspecialchars($u_forwarded_for), htmlspecialchars($s_forwarded_for));
+ $phpbb_log->add('critical', $user->data['user_id'], $user->ip, 'LOG_IP_BROWSER_FORWARDED_CHECK', false, array(
+ $u_ip,
+ $s_ip,
+ $u_browser,
+ $s_browser,
+ htmlspecialchars($u_forwarded_for),
+ htmlspecialchars($s_forwarded_for)
+ ));
}
else
{
- add_log('critical', 'LOG_REFERER_INVALID', $this->referer);
+ $phpbb_log->add('critical', $user->data['user_id'], $user->ip, 'LOG_REFERER_INVALID', false, array($this->referer));
}
}
}
@@ -582,6 +590,7 @@ class session
}
}
+ /* @var $provider_collection \phpbb\auth\provider_collection */
$provider_collection = $phpbb_container->get('auth.provider_collection');
$provider = $provider_collection->get_provider();
$this->data = $provider->autologin();
@@ -944,6 +953,7 @@ class session
unset($session_id);
// Allow connecting logout with external auth method logout
+ /* @var $provider_collection \phpbb\auth\provider_collection */
$provider_collection = $phpbb_container->get('auth.provider_collection');
$provider = $provider_collection->get_provider();
$provider->logout($this->data, $new_session);
@@ -1060,7 +1070,7 @@ class session
{
// Less than 10 users, update gc timer ... else we want gc
// called again to delete other sessions
- set_config('session_last_gc', $this->time_now, true);
+ $config->set('session_last_gc', $this->time_now, false);
if ($config['max_autologin_time'])
{
@@ -1070,6 +1080,7 @@ class session
}
// only called from CRON; should be a safe workaround until the infrastructure gets going
+ /* @var $captcha_factory \phpbb\captcha\factory */
$captcha_factory = $phpbb_container->get('captcha.factory');
$captcha_factory->garbage_collect($config['captcha_plugin']);
@@ -1103,6 +1114,12 @@ class session
{
global $config;
+ // If headers are already set, we just return
+ if (headers_sent())
+ {
+ return;
+ }
+
$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'] == '127.0.0.1' || strpos($config['cookie_domain'], '.') === false) ? '' : '; domain=' . $config['cookie_domain'];
diff --git a/phpBB/phpbb/template/asset.php b/phpBB/phpbb/template/asset.php
index ff9366af4a..cb00f16549 100644
--- a/phpBB/phpbb/template/asset.php
+++ b/phpBB/phpbb/template/asset.php
@@ -20,15 +20,20 @@ class asset
/** @var \phpbb\path_helper **/
protected $path_helper;
+ /** @var \phpbb\filesystem\filesystem */
+ protected $filesystem;
+
/**
* Constructor
*
* @param string $url URL
* @param \phpbb\path_helper $path_helper Path helper object
+ * @param \phpbb\filesystem\filesystem $filesystem
*/
- public function __construct($url, \phpbb\path_helper $path_helper)
+ public function __construct($url, \phpbb\path_helper $path_helper, \phpbb\filesystem\filesystem $filesystem)
{
$this->path_helper = $path_helper;
+ $this->filesystem = $filesystem;
$this->set_url($url);
}
@@ -152,18 +157,18 @@ class asset
*/
public function set_path($path, $urlencode = false)
{
- // Since 1.7.0 Twig returns the real path of the file. We need it to be relative to the working directory.
- $real_root_path = realpath($this->path_helper->get_phpbb_root_path()) . DIRECTORY_SEPARATOR;
+ // Since 1.7.0 Twig returns the real path of the file. We need it to be relative.
+ $real_root_path = $this->filesystem->realpath($this->path_helper->get_phpbb_root_path()) . DIRECTORY_SEPARATOR;
// If the asset is under the phpBB root path we need to remove its path and then prepend $phpbb_root_path
- if (substr($path . DIRECTORY_SEPARATOR, 0, strlen($real_root_path)) === $real_root_path)
+ if ($real_root_path && substr($path . DIRECTORY_SEPARATOR, 0, strlen($real_root_path)) === $real_root_path)
{
$path = $this->path_helper->get_phpbb_root_path() . str_replace('\\', '/', substr($path, strlen($real_root_path)));
}
else
{
// Else we make the path relative to the current working directory
- $real_root_path = realpath('.') . DIRECTORY_SEPARATOR;
+ $real_root_path = $this->filesystem->realpath('.') . DIRECTORY_SEPARATOR;
if ($real_root_path && substr($path . DIRECTORY_SEPARATOR, 0, strlen($real_root_path)) === $real_root_path)
{
$path = str_replace('\\', '/', substr($path, strlen($real_root_path)));
diff --git a/phpBB/phpbb/template/exception/user_object_not_available.php b/phpBB/phpbb/template/exception/user_object_not_available.php
new file mode 100644
index 0000000000..62fd2743c1
--- /dev/null
+++ b/phpBB/phpbb/template/exception/user_object_not_available.php
@@ -0,0 +1,22 @@
+<?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\template\exception;
+
+/**
+ * This exception is thrown when the user object was not set but it is required by the called method
+ */
+class user_object_not_available extends \phpbb\exception\runtime_exception
+{
+
+}
diff --git a/phpBB/phpbb/template/twig/environment.php b/phpBB/phpbb/template/twig/environment.php
index 476ffd935e..6e75403159 100644
--- a/phpBB/phpbb/template/twig/environment.php
+++ b/phpBB/phpbb/template/twig/environment.php
@@ -18,9 +18,15 @@ class environment extends \Twig_Environment
/** @var \phpbb\config\config */
protected $phpbb_config;
+ /** @var \phpbb\filesystem\filesystem */
+ protected $filesystem;
+
/** @var \phpbb\path_helper */
protected $phpbb_path_helper;
+ /** @var \Symfony\Component\DependencyInjection\ContainerInterface */
+ protected $container;
+
/** @var \phpbb\extension\manager */
protected $extension_manager;
@@ -37,25 +43,52 @@ class environment extends \Twig_Environment
* Constructor
*
* @param \phpbb\config\config $phpbb_config The phpBB configuration
+ * @param \phpbb\filesystem\filesystem $filesystem
* @param \phpbb\path_helper $path_helper phpBB path helper
+ * @param \Symfony\Component\DependencyInjection\ContainerInterface $container The dependency injection container
+ * @param string $cache_path The path to the cache directory
* @param \phpbb\extension\manager $extension_manager phpBB extension manager
* @param \Twig_LoaderInterface $loader Twig loader interface
* @param array $options Array of options to pass to Twig
*/
- public function __construct($phpbb_config, \phpbb\path_helper $path_helper, \phpbb\extension\manager $extension_manager = null, \Twig_LoaderInterface $loader = null, $options = array())
+ public function __construct(\phpbb\config\config $phpbb_config, \phpbb\filesystem\filesystem $filesystem, \phpbb\path_helper $path_helper, \Symfony\Component\DependencyInjection\ContainerInterface $container, $cache_path, \phpbb\extension\manager $extension_manager = null, \Twig_LoaderInterface $loader = null, $options = array())
{
$this->phpbb_config = $phpbb_config;
+ $this->filesystem = $filesystem;
$this->phpbb_path_helper = $path_helper;
$this->extension_manager = $extension_manager;
+ $this->container = $container;
$this->phpbb_root_path = $this->phpbb_path_helper->get_phpbb_root_path();
$this->web_root_path = $this->phpbb_path_helper->get_web_root_path();
+ $options = array_merge(array(
+ 'cache' => (defined('IN_INSTALL')) ? false : $cache_path,
+ 'debug' => false,
+ 'auto_reload' => (bool) $this->phpbb_config['load_tplcompile'],
+ 'autoescape' => false,
+ ), $options);
+
return parent::__construct($loader, $options);
}
/**
+ * {@inheritdoc}
+ */
+ public function getLexer()
+ {
+ if (null === $this->lexer)
+ {
+ $this->lexer = $this->container->get('template.twig.lexer');
+ $this->lexer->set_environment($this);
+ }
+
+ return $this->lexer;
+ }
+
+
+ /**
* Get the list of enabled phpBB extensions
*
* Used in EVENT node
@@ -78,16 +111,26 @@ class environment extends \Twig_Environment
}
/**
- * Get the phpBB root path
- *
- * @return string
- */
+ * Get the phpBB root path
+ *
+ * @return string
+ */
public function get_phpbb_root_path()
{
return $this->phpbb_root_path;
}
/**
+ * Get the filesystem object
+ *
+ * @return \phpbb\filesystem\filesystem
+ */
+ public function get_filesystem()
+ {
+ return $this->filesystem;
+ }
+
+ /**
* Get the web root path
*
* @return string
diff --git a/phpBB/phpbb/template/twig/extension.php b/phpBB/phpbb/template/twig/extension.php
index 3a983491b9..92f87a0331 100644
--- a/phpBB/phpbb/template/twig/extension.php
+++ b/phpBB/phpbb/template/twig/extension.php
@@ -18,20 +18,20 @@ class extension extends \Twig_Extension
/** @var \phpbb\template\context */
protected $context;
- /** @var \phpbb\user */
- protected $user;
+ /** @var \phpbb\language\language */
+ protected $language;
/**
* Constructor
*
* @param \phpbb\template\context $context
- * @param \phpbb\user $user
+ * @param \phpbb\language\language $language
* @return \phpbb\template\twig\extension
*/
- public function __construct(\phpbb\template\context $context, $user)
+ public function __construct(\phpbb\template\context $context, $language)
{
$this->context = $context;
- $this->user = $user;
+ $this->language = $language;
}
/**
@@ -71,6 +71,7 @@ class extension extends \Twig_Extension
{
return array(
new \Twig_SimpleFilter('subset', array($this, 'loop_subset'), array('needs_environment' => true)),
+ // @deprecated 3.2.0 Uses twig's JS escape method instead of addslashes
new \Twig_SimpleFilter('addslashes', 'addslashes'),
);
}
@@ -177,9 +178,9 @@ class extension extends \Twig_Extension
return $context_vars['L_' . $key];
}
- // LA_ is transformed into lang(\'$1\')|addslashes, so we should not
+ // LA_ is transformed into lang(\'$1\')|escape('js'), so we should not
// need to check for it
- return call_user_func_array(array($this->user, 'lang'), $args);
+ return call_user_func_array(array($this->language, 'lang'), $args);
}
}
diff --git a/phpBB/phpbb/template/twig/extension/routing.php b/phpBB/phpbb/template/twig/extension/routing.php
new file mode 100644
index 0000000000..829ce738eb
--- /dev/null
+++ b/phpBB/phpbb/template/twig/extension/routing.php
@@ -0,0 +1,43 @@
+<?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\template\twig\extension;
+
+use Symfony\Bridge\Twig\Extension\RoutingExtension;
+use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
+
+class routing extends RoutingExtension
+{
+ /** @var \phpbb\controller\helper */
+ protected $helper;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\routing\helper $helper
+ */
+ public function __construct(\phpbb\routing\helper $helper)
+ {
+ $this->helper = $helper;
+ }
+
+ public function getPath($name, $parameters = array(), $relative = false)
+ {
+ return $this->helper->route($name, $parameters, true, false, $relative ? UrlGeneratorInterface::RELATIVE_PATH : UrlGeneratorInterface::ABSOLUTE_PATH);
+ }
+
+ public function getUrl($name, $parameters = array(), $schemeRelative = false)
+ {
+ return $this->helper->route($name, $parameters, true, false, $schemeRelative ? UrlGeneratorInterface::NETWORK_PATH : UrlGeneratorInterface::ABSOLUTE_URL);
+ }
+}
diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php
index c5dc7273ba..f1542109a4 100644
--- a/phpBB/phpbb/template/twig/lexer.php
+++ b/phpBB/phpbb/template/twig/lexer.php
@@ -15,6 +15,11 @@ namespace phpbb\template\twig;
class lexer extends \Twig_Lexer
{
+ public function set_environment(\Twig_Environment $env)
+ {
+ $this->env = $env;
+ }
+
public function tokenize($code, $filename = null)
{
// Our phpBB tags
@@ -112,9 +117,9 @@ class lexer extends \Twig_Lexer
// Appends any filters after lang()
$code = preg_replace('#{L_([a-zA-Z0-9_\.]+)(\|[^}]+?)?}#', '{{ lang(\'$1\')$2 }}', $code);
- // Replace all of our escaped language variables, {LA_VARNAME}, with Twig style, {{ lang('NAME')|addslashes }}
- // Appends any filters after lang(), but before addslashes
- $code = preg_replace('#{LA_([a-zA-Z0-9_\.]+)(\|[^}]+?)?}#', '{{ lang(\'$1\')$2|addslashes }}', $code);
+ // Replace all of our escaped language variables, {LA_VARNAME}, with Twig style, {{ lang('NAME')|escape('js') }}
+ // Appends any filters after lang(), but before escape('js')
+ $code = preg_replace('#{LA_([a-zA-Z0-9_\.]+)(\|[^}]+?)?}#', '{{ lang(\'$1\')$2|escape(\'js\') }}', $code);
// Replace all of our variables, {VARNAME}, with Twig style, {{ VARNAME }}
// Appends any filters
diff --git a/phpBB/phpbb/template/twig/loader.php b/phpBB/phpbb/template/twig/loader.php
index 139a413b70..8b12188a77 100644
--- a/phpBB/phpbb/template/twig/loader.php
+++ b/phpBB/phpbb/template/twig/loader.php
@@ -21,6 +21,24 @@ class loader extends \Twig_Loader_Filesystem
protected $safe_directories = array();
/**
+ * @var \phpbb\filesystem\filesystem_interface
+ */
+ protected $filesystem;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\filesystem\filesystem_interface $filesystem
+ * @param string|array $paths
+ */
+ public function __construct(\phpbb\filesystem\filesystem_interface $filesystem, $paths = array())
+ {
+ $this->filesystem = $filesystem;
+
+ parent::__construct($paths);
+ }
+
+ /**
* Set safe directories
*
* @param array $directories Array of directories that are safe (empty to clear)
@@ -49,7 +67,7 @@ class loader extends \Twig_Loader_Filesystem
*/
public function addSafeDirectory($directory)
{
- $directory = phpbb_realpath($directory);
+ $directory = $this->filesystem->realpath($directory);
if ($directory !== false)
{
@@ -119,7 +137,7 @@ class loader extends \Twig_Loader_Filesystem
// can now check if we're within a "safe" directory
// Find the real path of the directory the file is in
- $directory = phpbb_realpath(dirname($file));
+ $directory = $this->filesystem->realpath(dirname($file));
if ($directory === false)
{
diff --git a/phpBB/phpbb/template/twig/node/includeasset.php b/phpBB/phpbb/template/twig/node/includeasset.php
index 15195a226b..324823b8d7 100644
--- a/phpBB/phpbb/template/twig/node/includeasset.php
+++ b/phpBB/phpbb/template/twig/node/includeasset.php
@@ -39,7 +39,7 @@ abstract class includeasset extends \Twig_Node
->write("\$asset_file = ")
->subcompile($this->getNode('expr'))
->raw(";\n")
- ->write("\$asset = new \phpbb\\template\\asset(\$asset_file, \$this->getEnvironment()->get_path_helper());\n")
+ ->write("\$asset = new \phpbb\\template\\asset(\$asset_file, \$this->getEnvironment()->get_path_helper(), \$this->getEnvironment()->get_filesystem());\n")
->write("if (substr(\$asset_file, 0, 2) !== './' && \$asset->is_relative()) {\n")
->indent()
->write("\$asset_path = \$asset->get_path();")
diff --git a/phpBB/phpbb/template/twig/twig.php b/phpBB/phpbb/template/twig/twig.php
index bd754d9bbd..6b3cf32bc8 100644
--- a/phpBB/phpbb/template/twig/twig.php
+++ b/phpBB/phpbb/template/twig/twig.php
@@ -13,6 +13,8 @@
namespace phpbb\template\twig;
+use phpbb\template\exception\user_object_not_available;
+
/**
* Twig Template class.
*/
@@ -76,11 +78,14 @@ class twig extends \phpbb\template\base
*
* @param \phpbb\path_helper $path_helper
* @param \phpbb\config\config $config
- * @param \phpbb\user $user
* @param \phpbb\template\context $context template context
+ * @param \phpbb\template\twig\environment $twig_environment
+ * @param string $cache_path
+ * @param \phpbb\user|null $user
+ * @param array|\ArrayAccess $extensions
* @param \phpbb\extension\manager $extension_manager extension manager, if null then template events will not be invoked
*/
- public function __construct(\phpbb\path_helper $path_helper, $config, $user, \phpbb\template\context $context, \phpbb\extension\manager $extension_manager = null)
+ public function __construct(\phpbb\path_helper $path_helper, $config, \phpbb\template\context $context, \phpbb\template\twig\environment $twig_environment, $cache_path, \phpbb\user $user = null, $extensions = array(), \phpbb\extension\manager $extension_manager = null)
{
$this->path_helper = $path_helper;
$this->phpbb_root_path = $path_helper->get_phpbb_root_path();
@@ -89,41 +94,14 @@ class twig extends \phpbb\template\base
$this->user = $user;
$this->context = $context;
$this->extension_manager = $extension_manager;
+ $this->cachepath = $cache_path;
+ $this->twig = $twig_environment;
- $this->cachepath = $this->phpbb_root_path . 'cache/twig/';
-
- // Initiate the loader, __main__ namespace paths will be setup later in set_style_names()
- $loader = new \phpbb\template\twig\loader('');
-
- $this->twig = new \phpbb\template\twig\environment(
- $this->config,
- $this->path_helper,
- $this->extension_manager,
- $loader,
- array(
- 'cache' => (defined('IN_INSTALL')) ? false : $this->cachepath,
- 'debug' => defined('DEBUG'),
- 'auto_reload' => (bool) $this->config['load_tplcompile'],
- 'autoescape' => false,
- )
- );
-
- $this->twig->addExtension(
- new \phpbb\template\twig\extension(
- $this->context,
- $this->user
- )
- );
-
- if (defined('DEBUG'))
+ foreach ($extensions as $extension)
{
- $this->twig->addExtension(new \Twig_Extension_Debug());
+ $this->twig->addExtension($extension);
}
- $lexer = new \phpbb\template\twig\lexer($this->twig);
-
- $this->twig->setLexer($lexer);
-
// Add admin namespace
if ($this->path_helper->get_adm_relative_path() !== null && is_dir($this->phpbb_root_path . $this->path_helper->get_adm_relative_path() . 'style/'))
{
@@ -150,9 +128,16 @@ class twig extends \phpbb\template\base
* Get the style tree of the style preferred by the current user
*
* @return array Style tree, most specific first
+ *
+ * @throws \phpbb\template\exception\user_object_not_available When user service was not set
*/
public function get_user_style()
{
+ if ($this->user === null)
+ {
+ throw new user_object_not_available();
+ }
+
$style_list = array(
$this->user->style['style_path'],
);
@@ -368,14 +353,24 @@ class twig extends \phpbb\template\base
$context_vars['.'][0], // To get normal vars
array(
'definition' => new \phpbb\template\twig\definition(),
- 'user' => $this->user,
'loops' => $context_vars, // To get loops
)
);
+ if ($this->user instanceof \phpbb\user)
+ {
+ $vars['user'] = $this->user;
+ }
+
// cleanup
unset($vars['loops']['.']);
+ // Inject in the main context the value added by assign_block_vars() to be able to use directly the Twig loops.
+ foreach ($vars['loops'] as $key => &$value)
+ {
+ $vars[$key] = $value;
+ }
+
return $vars;
}
diff --git a/phpBB/phpbb/textformatter/cache_interface.php b/phpBB/phpbb/textformatter/cache_interface.php
new file mode 100644
index 0000000000..f6b5f195c7
--- /dev/null
+++ b/phpBB/phpbb/textformatter/cache_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\textformatter;
+
+/**
+* Currently only used to signal that something that could effect the rendering has changed.
+* BBCodes, smilies, censored words, templates, etc...
+*/
+interface cache_interface
+{
+ /**
+ * Invalidate and/or regenerate this text formatter's cache(s)
+ */
+ public function invalidate();
+
+ /**
+ * Tidy/prune this text formatter's cache(s)
+ */
+ public function tidy();
+}
diff --git a/phpBB/phpbb/textformatter/data_access.php b/phpBB/phpbb/textformatter/data_access.php
new file mode 100644
index 0000000000..2103bf8e60
--- /dev/null
+++ b/phpBB/phpbb/textformatter/data_access.php
@@ -0,0 +1,228 @@
+<?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\textformatter;
+
+/**
+* Data access layer that fetchs BBCodes, smilies and censored words from the database.
+* To be extended to include insert/update/delete operations.
+*
+* Also used to get templates.
+*/
+class data_access
+{
+ /**
+ * @var string Name of the BBCodes table
+ */
+ protected $bbcodes_table;
+
+ /**
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * @var string Name of the smilies table
+ */
+ protected $smilies_table;
+
+ /**
+ * @var string Name of the styles table
+ */
+ protected $styles_table;
+
+ /**
+ * @var string Path to the styles dir
+ */
+ protected $styles_path;
+
+ /**
+ * @var string Name of the words table
+ */
+ protected $words_table;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\db\driver\driver_interface $db Database connection
+ * @param string $bbcodes_table Name of the BBCodes table
+ * @param string $smilies_table Name of the smilies table
+ * @param string $styles_table Name of the styles table
+ * @param string $words_table Name of the words table
+ * @param string $styles_path Path to the styles dir
+ */
+ public function __construct(\phpbb\db\driver\driver_interface $db, $bbcodes_table, $smilies_table, $styles_table, $words_table, $styles_path)
+ {
+ $this->db = $db;
+
+ $this->bbcodes_table = $bbcodes_table;
+ $this->smilies_table = $smilies_table;
+ $this->styles_table = $styles_table;
+ $this->words_table = $words_table;
+
+ $this->styles_path = $styles_path;
+ }
+
+ /**
+ * Return the list of custom BBCodes
+ *
+ * @return array
+ */
+ public function get_bbcodes()
+ {
+ $sql = 'SELECT bbcode_match, bbcode_tpl FROM ' . $this->bbcodes_table;
+ $result = $this->db->sql_query($sql);
+ $rows = $this->db->sql_fetchrowset($result);
+ $this->db->sql_freeresult($result);
+
+ return $rows;
+ }
+
+ /**
+ * Return the list of smilies
+ *
+ * @return array
+ */
+ public function get_smilies()
+ {
+ // NOTE: smilies that are displayed on the posting page are processed first because they're
+ // typically the most used smilies and it ends up producing a slightly more efficient
+ // renderer
+ $sql = 'SELECT code, emotion, smiley_url, smiley_width, smiley_height
+ FROM ' . $this->smilies_table . '
+ ORDER BY display_on_posting DESC';
+ $result = $this->db->sql_query($sql);
+ $rows = $this->db->sql_fetchrowset($result);
+ $this->db->sql_freeresult($result);
+
+ return $rows;
+ }
+
+ /**
+ * Return the list of installed styles
+ *
+ * @return array
+ */
+ protected function get_styles()
+ {
+ $sql = 'SELECT style_id, style_path, style_parent_id, bbcode_bitfield FROM ' . $this->styles_table;
+ $result = $this->db->sql_query($sql);
+ $rows = $this->db->sql_fetchrowset($result);
+ $this->db->sql_freeresult($result);
+
+ return $rows;
+ }
+
+ /**
+ * Return the bbcode.html template for every installed style
+ *
+ * @return array 2D array. style_id as keys, each element is an array with a "template" element that contains the style's bbcode.html and a "bbcodes" element that contains the name of each BBCode that is to be stylised
+ */
+ public function get_styles_templates()
+ {
+ $templates = array();
+
+ $bbcode_ids = array(
+ 'quote' => 0,
+ 'b' => 1,
+ 'i' => 2,
+ 'url' => 3,
+ 'img' => 4,
+ 'size' => 5,
+ 'color' => 6,
+ 'u' => 7,
+ 'code' => 8,
+ 'list' => 9,
+ '*' => 9,
+ 'email' => 10,
+ 'flash' => 11,
+ 'attachment' => 12,
+ );
+
+ $styles = array();
+ foreach ($this->get_styles() as $row)
+ {
+ $styles[$row['style_id']] = $row;
+ }
+
+ foreach ($styles as $style_id => $style)
+ {
+ $bbcodes = array();
+
+ // Collect the name of the BBCodes whose bit is set in the style's bbcode_bitfield
+ $template_bitfield = new \bitfield($style['bbcode_bitfield']);
+ foreach ($bbcode_ids as $bbcode_name => $bit)
+ {
+ if ($template_bitfield->get($bit))
+ {
+ $bbcodes[] = $bbcode_name;
+ }
+ }
+
+ $filename = $this->resolve_style_filename($styles, $style);
+ if ($filename === false)
+ {
+ // Ignore this style, it will use the default templates
+ continue;
+ }
+
+ $templates[$style_id] = array(
+ 'bbcodes' => $bbcodes,
+ 'template' => file_get_contents($filename),
+ );
+ }
+
+ return $templates;
+ }
+
+ /**
+ * Resolve inheritance for given style and return the path to their bbcode.html file
+ *
+ * @param array $styles Associative array of [style_id => style] containing all styles
+ * @param array $style Style for which we resolve
+ * @return string|bool Path to this style's bbcode.html, or FALSE
+ */
+ protected function resolve_style_filename(array $styles, array $style)
+ {
+ // Look for a bbcode.html in this style's dir
+ $filename = $this->styles_path . $style['style_path'] . '/template/bbcode.html';
+ if (file_exists($filename))
+ {
+ return $filename;
+ }
+
+ // Resolve using this style's parent
+ $parent_id = $style['style_parent_id'];
+ if ($parent_id && !empty($styles[$parent_id]))
+ {
+ return $this->resolve_style_filename($styles, $styles[$parent_id]);
+ }
+
+ return false;
+ }
+
+ /**
+ * Return the list of censored words
+ *
+ * @return array
+ */
+ public function get_censored_words()
+ {
+ $sql = 'SELECT word, replacement FROM ' . $this->words_table;
+ $result = $this->db->sql_query($sql);
+ $rows = $this->db->sql_fetchrowset($result);
+ $this->db->sql_freeresult($result);
+
+ return $rows;
+ }
+}
diff --git a/phpBB/phpbb/textformatter/parser_interface.php b/phpBB/phpbb/textformatter/parser_interface.php
new file mode 100644
index 0000000000..ad611fb5b4
--- /dev/null
+++ b/phpBB/phpbb/textformatter/parser_interface.php
@@ -0,0 +1,112 @@
+<?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\textformatter;
+
+interface parser_interface
+{
+ /**
+ * Parse given text
+ *
+ * @param string $text
+ * @return string
+ */
+ public function parse($text);
+
+ /**
+ * Disable a specific BBCode
+ *
+ * @param string $name BBCode name
+ * @return null
+ */
+ public function disable_bbcode($name);
+
+ /**
+ * Disable BBCodes in general
+ */
+ public function disable_bbcodes();
+
+ /**
+ * Disable the censor
+ */
+ public function disable_censor();
+
+ /**
+ * Disable magic URLs
+ */
+ public function disable_magic_url();
+
+ /**
+ * Disable smilies
+ */
+ public function disable_smilies();
+
+ /**
+ * Enable a specific BBCode
+ *
+ * @param string $name BBCode name
+ * @return null
+ */
+ public function enable_bbcode($name);
+
+ /**
+ * Enable BBCodes in general
+ */
+ public function enable_bbcodes();
+
+ /**
+ * Enable the censor
+ */
+ public function enable_censor();
+
+ /**
+ * Enable magic URLs
+ */
+ public function enable_magic_url();
+
+ /**
+ * Enable smilies
+ */
+ public function enable_smilies();
+
+ /**
+ * Get the list of errors that were generated during last parsing
+ *
+ * @return array[] Array of arrays. Each array contains a lang string at index 0 plus any number
+ * of optional parameters
+ */
+ public function get_errors();
+
+ /**
+ * Set a variable to be used by the parser
+ *
+ * - max_font_size
+ * - max_img_height
+ * - max_img_width
+ * - max_smilies
+ * - max_urls
+ *
+ * @param string $name
+ * @param mixed $value
+ * @return null
+ */
+ public function set_var($name, $value);
+
+ /**
+ * Set multiple variables to be used by the parser
+ *
+ * @param array $vars Associative array of [name => value]
+ * @return null
+ */
+ public function set_vars(array $vars);
+}
diff --git a/phpBB/phpbb/textformatter/renderer_interface.php b/phpBB/phpbb/textformatter/renderer_interface.php
new file mode 100644
index 0000000000..609b0bb642
--- /dev/null
+++ b/phpBB/phpbb/textformatter/renderer_interface.php
@@ -0,0 +1,92 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\textformatter;
+
+interface renderer_interface
+{
+ /**
+ * Render given text
+ *
+ * @param string $text Text, as parsed by something that implements \phpbb\textformatter\parser
+ * @return string
+ */
+ public function render($text);
+
+ /**
+ * Set the smilies' path
+ *
+ * @return null
+ */
+ public function set_smilies_path($path);
+
+ /**
+ * Return the value of the "viewcensors" option
+ *
+ * @return bool Option's value
+ */
+ public function get_viewcensors();
+
+ /**
+ * Return the value of the "viewflash" option
+ *
+ * @return bool Option's value
+ */
+ public function get_viewflash();
+
+ /**
+ * Return the value of the "viewimg" option
+ *
+ * @return bool Option's value
+ */
+ public function get_viewimg();
+
+ /**
+ * Return the value of the "viewsmilies" option
+ *
+ * @return bool Option's value
+ */
+ public function get_viewsmilies();
+
+ /**
+ * Set the "viewcensors" option
+ *
+ * @param bool $value Option's value
+ * @return null
+ */
+ public function set_viewcensors($value);
+
+ /**
+ * Set the "viewflash" option
+ *
+ * @param bool $value Option's value
+ * @return null
+ */
+ public function set_viewflash($value);
+
+ /**
+ * Set the "viewimg" option
+ *
+ * @param bool $value Option's value
+ * @return null
+ */
+ public function set_viewimg($value);
+
+ /**
+ * Set the "viewsmilies" option
+ *
+ * @param bool $value Option's value
+ * @return null
+ */
+ public function set_viewsmilies($value);
+}
diff --git a/phpBB/phpbb/textformatter/s9e/factory.php b/phpBB/phpbb/textformatter/s9e/factory.php
new file mode 100644
index 0000000000..63b23d2fd0
--- /dev/null
+++ b/phpBB/phpbb/textformatter/s9e/factory.php
@@ -0,0 +1,570 @@
+<?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\textformatter\s9e;
+
+use s9e\TextFormatter\Configurator;
+use s9e\TextFormatter\Configurator\Items\AttributeFilters\RegexpFilter;
+use s9e\TextFormatter\Configurator\Items\UnsafeTemplate;
+
+/**
+* Creates s9e\TextFormatter objects
+*/
+class factory implements \phpbb\textformatter\cache_interface
+{
+ /**
+ * @var \phpbb\cache\driver\driver_interface
+ */
+ protected $cache;
+
+ /**
+ * @var string Path to the cache dir
+ */
+ protected $cache_dir;
+
+ /**
+ * @var string Cache key used for the parser
+ */
+ protected $cache_key_parser;
+
+ /**
+ * @var string Cache key used for the renderer
+ */
+ protected $cache_key_renderer;
+
+ /**
+ * @var \phpbb\config\config
+ */
+ protected $config;
+
+ /**
+ * @var array Custom tokens used in bbcode.html and their corresponding token from the definition
+ */
+ protected $custom_tokens = array(
+ 'email' => array('{DESCRIPTION}' => '{TEXT}'),
+ 'flash' => array('{WIDTH}' => '{NUMBER1}', '{HEIGHT}' => '{NUMBER2}'),
+ 'img' => array('{URL}' => '{IMAGEURL}'),
+ 'list' => array('{LIST_TYPE}' => '{HASHMAP}'),
+ 'quote' => array('{USERNAME}' => '{TEXT1}'),
+ 'size' => array('{SIZE}' => '{FONTSIZE}'),
+ 'url' => array('{DESCRIPTION}' => '{TEXT}'),
+ );
+
+ /**
+ * @var \phpbb\textformatter\data_access
+ */
+ protected $data_access;
+
+ /**
+ * @var array Default BBCode definitions
+ */
+ protected $default_definitions = array(
+ 'attachment' => '[ATTACHMENT index={NUMBER} filename={TEXT;useContent}]',
+ 'b' => '[B]{TEXT}[/B]',
+ 'code' => '[CODE lang={IDENTIFIER;optional}]{TEXT}[/CODE]',
+ 'color' => '[COLOR={COLOR}]{TEXT}[/COLOR]',
+ 'email' => '[EMAIL={EMAIL;useContent} subject={TEXT;optional;postFilter=rawurlencode} body={TEXT;optional;postFilter=rawurlencode}]{TEXT}[/EMAIL]',
+ 'flash' => '[FLASH={NUMBER1},{NUMBER2} width={NUMBER1;postFilter=#flashwidth} height={NUMBER2;postFilter=#flashheight} url={URL;useContent} /]',
+ 'i' => '[I]{TEXT}[/I]',
+ 'img' => '[IMG src={IMAGEURL;useContent}]',
+ 'list' => '[LIST type={HASHMAP=1:decimal,a:lower-alpha,A:upper-alpha,i:lower-roman,I:upper-roman;optional;postFilter=#simpletext}]{TEXT}[/LIST]',
+ 'li' => '[* $tagName=LI]{TEXT}[/*]',
+ 'quote' =>
+ "[QUOTE
+ author={TEXT1;optional}
+ post_id={UINT;optional}
+ post_url={URL;optional;postFilter=#false}
+ profile_url={URL;optional;postFilter=#false}
+ time={UINT;optional}
+ url={URL;optional}
+ user_id={UINT;optional}
+ author={PARSE=/^\\[url=(?'url'.*?)](?'author'.*)\\[\\/url]$/i}
+ author={PARSE=/^\\[url](?'author'(?'url'.*?))\\[\\/url]$/i}
+ author={PARSE=/(?'url'https?:\\/\\/[^[\\]]+)/i}
+ ]{TEXT2}[/QUOTE]",
+ 'size' => '[SIZE={FONTSIZE}]{TEXT}[/SIZE]',
+ 'u' => '[U]{TEXT}[/U]',
+ 'url' => '[URL={URL;useContent}]{TEXT}[/URL]',
+ );
+
+ /**
+ * @var array Default templates, taken from bbcode::bbcode_tpl()
+ */
+ protected $default_templates = array(
+ 'b' => '<span style="font-weight: bold"><xsl:apply-templates/></span>',
+ 'i' => '<span style="font-style: italic"><xsl:apply-templates/></span>',
+ 'u' => '<span style="text-decoration: underline"><xsl:apply-templates/></span>',
+ 'img' => '<img src="{IMAGEURL}" class="postimage" alt="{L_IMAGE}"/>',
+ 'size' => '<span style="font-size: {FONTSIZE}%; line-height: normal"><xsl:apply-templates/></span>',
+ 'color' => '<span style="color: {COLOR}"><xsl:apply-templates/></span>',
+ 'email' => '<a>
+ <xsl:attribute name="href">
+ <xsl:text>mailto:</xsl:text>
+ <xsl:value-of select="@email"/>
+ <xsl:if test="@subject or @body">
+ <xsl:text>?</xsl:text>
+ <xsl:if test="@subject">subject=<xsl:value-of select="@subject"/></xsl:if>
+ <xsl:if test="@body"><xsl:if test="@subject">&amp;</xsl:if>body=<xsl:value-of select="@body"/></xsl:if>
+ </xsl:if>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </a>',
+ );
+
+ /**
+ * @var \phpbb\event\dispatcher_interface
+ */
+ protected $dispatcher;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\textformatter\data_access $data_access
+ * @param \phpbb\cache\driver\driver_interface $cache
+ * @param \phpbb\event\dispatcher_interface $dispatcher
+ * @param \phpbb\config\config $config
+ * @param string $cache_dir Path to the cache dir
+ * @param string $cache_key_parser Cache key used for the parser
+ * @param string $cache_key_renderer Cache key used for the renderer
+ */
+ public function __construct(\phpbb\textformatter\data_access $data_access, \phpbb\cache\driver\driver_interface $cache, \phpbb\event\dispatcher_interface $dispatcher, \phpbb\config\config $config, $cache_dir, $cache_key_parser, $cache_key_renderer)
+ {
+ $this->cache = $cache;
+ $this->cache_dir = $cache_dir;
+ $this->cache_key_parser = $cache_key_parser;
+ $this->cache_key_renderer = $cache_key_renderer;
+ $this->config = $config;
+ $this->data_access = $data_access;
+ $this->dispatcher = $dispatcher;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function invalidate()
+ {
+ $this->regenerate();
+ }
+
+ /**
+ * {@inheritdoc}
+ *
+ * Will remove old renderers from the cache dir but won't touch the current renderer
+ */
+ public function tidy()
+ {
+ // Get the name of current renderer
+ $renderer_data = $this->cache->get($this->cache_key_renderer);
+ $renderer_file = ($renderer_data) ? $renderer_data['class'] . '.php' : null;
+
+ foreach (glob($this->cache_dir . 's9e_*') as $filename)
+ {
+ // Only remove the file if it's not the current renderer
+ if (!$renderer_file || substr($filename, -strlen($renderer_file)) !== $renderer_file)
+ {
+ unlink($filename);
+ }
+ }
+ }
+
+ /**
+ * Generate and return a new configured instance of s9e\TextFormatter\Configurator
+ *
+ * @return Configurator
+ */
+ public function get_configurator()
+ {
+ // Create a new Configurator
+ $configurator = new Configurator;
+
+ /**
+ * Modify the s9e\TextFormatter configurator before the default settings are set
+ *
+ * @event core.text_formatter_s9e_configure_before
+ * @var \s9e\TextFormatter\Configurator configurator Configurator instance
+ * @since 3.2.0-a1
+ */
+ $vars = array('configurator');
+ extract($this->dispatcher->trigger_event('core.text_formatter_s9e_configure_before', compact($vars)));
+
+ // Reset the list of allowed schemes
+ foreach ($configurator->urlConfig->getAllowedSchemes() as $scheme)
+ {
+ $configurator->urlConfig->disallowScheme($scheme);
+ }
+ foreach (explode(',', $this->config['allowed_schemes_links']) as $scheme)
+ {
+ $configurator->urlConfig->allowScheme(trim($scheme));
+ }
+
+ // Convert newlines to br elements by default
+ $configurator->rootRules->enableAutoLineBreaks();
+
+ // Don't automatically ignore text in places where text is not allowed
+ $configurator->rulesGenerator->remove('IgnoreTextIfDisallowed');
+
+ // Don't remove comments and instead convert them to xsl:comment elements
+ $configurator->templateNormalizer->remove('RemoveComments');
+ $configurator->templateNormalizer->add('TransposeComments');
+
+ // Set the rendering engine and configure it to save to the cache dir
+ $configurator->rendering->engine = 'PHP';
+ $configurator->rendering->engine->cacheDir = $this->cache_dir;
+ $configurator->rendering->engine->defaultClassPrefix = 's9e_renderer_';
+ $configurator->rendering->engine->enableQuickRenderer = true;
+
+ // Create custom filters for BBCode tokens that are supported in phpBB but not in
+ // s9e\TextFormatter
+ $filter = new RegexpFilter('#^' . get_preg_expression('relative_url') . '$#Du');
+ $configurator->attributeFilters->add('#local_url', $filter);
+ $configurator->attributeFilters->add('#relative_url', $filter);
+
+ // INTTEXT regexp from acp_bbcodes
+ $filter = new RegexpFilter('!^([\p{L}\p{N}\-+,_. ]+)$!Du');
+ $configurator->attributeFilters->add('#inttext', $filter);
+
+ // Create custom filters for Flash restrictions, which use the same values as the image
+ // restrictions but have their own error message
+ $configurator->attributeFilters
+ ->add('#flashheight', __NAMESPACE__ . '\\parser::filter_flash_height')
+ ->addParameterByName('max_img_height')
+ ->addParameterByName('logger');
+
+ $configurator->attributeFilters
+ ->add('#flashwidth', __NAMESPACE__ . '\\parser::filter_flash_width')
+ ->addParameterByName('max_img_width')
+ ->addParameterByName('logger');
+
+ // Create a custom filter for phpBB's per-mode font size limits
+ $configurator->attributeFilters
+ ->add('#fontsize', __NAMESPACE__ . '\\parser::filter_font_size')
+ ->addParameterByName('max_font_size')
+ ->addParameterByName('logger')
+ ->markAsSafeInCSS();
+
+ // Create a custom filter for image URLs
+ $configurator->attributeFilters
+ ->add('#imageurl', __NAMESPACE__ . '\\parser::filter_img_url')
+ ->addParameterByName('urlConfig')
+ ->addParameterByName('logger')
+ ->addParameterByName('max_img_height')
+ ->addParameterByName('max_img_width')
+ ->markAsSafeAsURL();
+
+ // Add default BBCodes
+ foreach ($this->get_default_bbcodes($configurator) as $bbcode)
+ {
+ $configurator->BBCodes->addCustom($bbcode['usage'], $bbcode['template']);
+ }
+
+ // Modify the template to disable images/flash depending on user's settings
+ foreach (array('FLASH', 'IMG') as $name)
+ {
+ $tag = $configurator->tags[$name];
+ $tag->template = '<xsl:choose><xsl:when test="$S_VIEW' . $name . '">' . $tag->template . '</xsl:when><xsl:otherwise><xsl:apply-templates/></xsl:otherwise></xsl:choose>';
+ }
+
+ // Load custom BBCodes
+ foreach ($this->data_access->get_bbcodes() as $row)
+ {
+ // Insert the board's URL before {LOCAL_URL} tokens
+ $tpl = preg_replace_callback(
+ '#\\{LOCAL_URL\\d*\\}#',
+ function ($m)
+ {
+ return generate_board_url() . '/' . $m[0];
+ },
+ $row['bbcode_tpl']
+ );
+
+ try
+ {
+ $configurator->BBCodes->addCustom($row['bbcode_match'], new UnsafeTemplate($tpl));
+ }
+ catch (\Exception $e)
+ {
+ /**
+ * @todo log an error?
+ */
+ }
+ }
+
+ // Load smilies
+ foreach ($this->data_access->get_smilies() as $row)
+ {
+ $configurator->Emoticons->add(
+ $row['code'],
+ '<img class="smilies" src="{$T_SMILIES_PATH}/' . htmlspecialchars($row['smiley_url']) . '" alt="{.}" title="' . htmlspecialchars($row['emotion']) . '"/>'
+ );
+ }
+
+ if (isset($configurator->Emoticons))
+ {
+ // Force emoticons to be rendered as text if $S_VIEWSMILIES is not set
+ $configurator->Emoticons->notIfCondition = 'not($S_VIEWSMILIES)';
+
+ // Only parse emoticons at the beginning of the text or if they're preceded by any
+ // one of: a new line, a space, a dot, or a right square bracket
+ $configurator->Emoticons->notAfter = '[^\\n .\\]]';
+ }
+
+ // Load the censored words
+ $censor = $this->data_access->get_censored_words();
+ if (!empty($censor))
+ {
+ // Use a namespaced tag to avoid collisions
+ $configurator->plugins->load('Censor', array('tagName' => 'censor:tag'));
+ foreach ($censor as $row)
+ {
+ // NOTE: words are stored as HTML, we need to decode them to plain text
+ $configurator->Censor->add(htmlspecialchars_decode($row['word']), htmlspecialchars_decode($row['replacement']));
+ }
+ }
+
+ // Load the magic links plugins. We do that after BBCodes so that they use the same tags
+ $configurator->plugins->load('Autoemail');
+ $configurator->plugins->load('Autolink', array('matchWww' => true));
+
+ // Register some vars with a default value. Those should be set at runtime by whatever calls
+ // the parser
+ $configurator->registeredVars['max_font_size'] = 0;
+ $configurator->registeredVars['max_img_height'] = 0;
+ $configurator->registeredVars['max_img_width'] = 0;
+
+ // Load the Emoji plugin and modify its tag's template to obey viewsmilies
+ $configurator->Emoji->setImageSize(18);
+ $tag = $configurator->Emoji->getTag();
+ $tag->template = '<xsl:choose><xsl:when test="$S_VIEWSMILIES">' . str_replace('class="emoji"', 'class="smilies"', $tag->template) . '</xsl:when><xsl:otherwise><xsl:value-of select="."/></xsl:otherwise></xsl:choose>';
+
+ /**
+ * Modify the s9e\TextFormatter configurator after the default settings are set
+ *
+ * @event core.text_formatter_s9e_configure_after
+ * @var \s9e\TextFormatter\Configurator configurator Configurator instance
+ * @since 3.2.0-a1
+ */
+ $vars = array('configurator');
+ extract($this->dispatcher->trigger_event('core.text_formatter_s9e_configure_after', compact($vars)));
+
+ return $configurator;
+ }
+
+ /**
+ * Regenerate and cache a new parser and renderer
+ *
+ * @return array Associative array with at least two elements: "parser" and "renderer"
+ */
+ public function regenerate()
+ {
+ $configurator = $this->get_configurator();
+
+ // Get the censor helper and remove the Censor plugin if applicable
+ if (isset($configurator->Censor))
+ {
+ $censor = $configurator->Censor->getHelper();
+ unset($configurator->Censor);
+ unset($configurator->tags['censor:tag']);
+ }
+
+ $objects = $configurator->finalize();
+ $parser = $objects['parser'];
+ $renderer = $objects['renderer'];
+
+ // Cache the parser as-is
+ $this->cache->put($this->cache_key_parser, $parser);
+
+ // We need to cache the name of the renderer's generated class
+ $renderer_data = array('class' => get_class($renderer));
+ if (isset($censor))
+ {
+ $renderer_data['censor'] = $censor;
+ }
+ $this->cache->put($this->cache_key_renderer, $renderer_data);
+
+ return array('parser' => $parser, 'renderer' => $renderer);
+ }
+
+ /**
+ * Return the default BBCodes configuration
+ *
+ * @return array 2D array. Each element has a 'usage' key, a 'template' key, and an optional 'options' key
+ */
+ protected function get_default_bbcodes($configurator)
+ {
+ // For each BBCode, build an associative array matching style_ids to their template
+ $templates = array();
+ foreach ($this->data_access->get_styles_templates() as $style_id => $data)
+ {
+ foreach ($this->extract_templates($data['template']) as $bbcode_name => $template)
+ {
+ $templates[$bbcode_name][$style_id] = $template;
+ }
+
+ // Add default templates wherever missing, or for BBCodes that were not specified in
+ // this template's bitfield. For instance, prosilver has a custom template for b but its
+ // bitfield does not enable it so the default template is used instead
+ foreach ($this->default_templates as $bbcode_name => $template)
+ {
+ if (!isset($templates[$bbcode_name][$style_id]) || !in_array($bbcode_name, $data['bbcodes'], true))
+ {
+ $templates[$bbcode_name][$style_id] = $template;
+ }
+ }
+ }
+
+ // Replace custom tokens and normalize templates
+ foreach ($templates as $bbcode_name => $style_templates)
+ {
+ foreach ($style_templates as $i => $template)
+ {
+ if (isset($this->custom_tokens[$bbcode_name]))
+ {
+ $template = strtr($template, $this->custom_tokens[$bbcode_name]);
+ }
+
+ $templates[$bbcode_name][$i] = $configurator->templateNormalizer->normalizeTemplate($template);
+ }
+ }
+
+ $bbcodes = array();
+ foreach ($this->default_definitions as $bbcode_name => $usage)
+ {
+ $bbcodes[$bbcode_name] = array(
+ 'usage' => $usage,
+ 'template' => $this->merge_templates($templates[$bbcode_name]),
+ );
+ }
+
+ return $bbcodes;
+ }
+
+ /**
+ * Extract and recompose individual BBCode templates from a style's template file
+ *
+ * @param string $template Style template (bbcode.html)
+ * @return array Associative array matching BBCode names to their template
+ */
+ protected function extract_templates($template)
+ {
+ // Capture the template fragments
+ preg_match_all('#<!-- BEGIN (.*?) -->(.*?)<!-- END .*? -->#s', $template, $matches, PREG_SET_ORDER);
+
+ $fragments = array();
+ foreach ($matches as $match)
+ {
+ // Normalize the whitespace
+ $fragment = preg_replace('#>\\n\\t*<#', '><', trim($match[2]));
+
+ $fragments[$match[1]] = $fragment;
+ }
+
+ // Automatically recompose templates split between *_open and *_close
+ foreach ($fragments as $fragment_name => $fragment)
+ {
+ if (preg_match('#^(\\w+)_close$#', $fragment_name, $match))
+ {
+ $bbcode_name = $match[1];
+
+ if (isset($fragments[$bbcode_name . '_open']))
+ {
+ $templates[$bbcode_name] = $fragments[$bbcode_name . '_open'] . '<xsl:apply-templates/>' . $fragment;
+ }
+ }
+ }
+
+ // Manually recompose and overwrite irregular templates
+ $templates['list'] =
+ '<xsl:choose>
+ <xsl:when test="not(@type)">
+ ' . $fragments['ulist_open_default'] . '<xsl:apply-templates/>' . $fragments['ulist_close'] . '
+ </xsl:when>
+ <xsl:when test="contains(\'upperlowerdecim\',substring(@type,1,5))">
+ ' . $fragments['olist_open'] . '<xsl:apply-templates/>' . $fragments['olist_close'] . '
+ </xsl:when>
+ <xsl:otherwise>
+ ' . $fragments['ulist_open'] . '<xsl:apply-templates/>' . $fragments['ulist_close'] . '
+ </xsl:otherwise>
+ </xsl:choose>';
+
+ $templates['li'] = $fragments['listitem'] . '<xsl:apply-templates/>' . $fragments['listitem_close'];
+
+ // Replace the regular quote template with the extended quote template if available
+ if (isset($fragments['quote_extended']))
+ {
+ $templates['quote'] = $fragments['quote_extended'];
+ }
+
+ // The [attachment] BBCode uses the inline_attachment template to output a comment that
+ // is post-processed by parse_attachments()
+ $templates['attachment'] = $fragments['inline_attachment_open'] . '<xsl:comment> ia<xsl:value-of select="@index"/> </xsl:comment><xsl:value-of select="@filename"/><xsl:comment> ia<xsl:value-of select="@index"/> </xsl:comment>' . $fragments['inline_attachment_close'];
+
+ // Add fragments as templates
+ foreach ($fragments as $fragment_name => $fragment)
+ {
+ if (preg_match('#^\\w+$#', $fragment_name))
+ {
+ $templates[$fragment_name] = $fragment;
+ }
+ }
+
+ // Keep only templates that are named after an existing BBCode
+ $templates = array_intersect_key($templates, $this->default_definitions);
+
+ return $templates;
+ }
+
+ /**
+ * Merge the templates from any number of styles into one BBCode template
+ *
+ * When multiple templates are available for the same BBCode (because of multiple styles) we
+ * merge them into a single template that uses an xsl:choose construct that determines which
+ * style to use at rendering time.
+ *
+ * @param array $style_templates Associative array matching style_ids to their template
+ * @return string
+ */
+ protected function merge_templates(array $style_templates)
+ {
+ // Return the template as-is if there's only one style or all styles share the same template
+ if (count(array_unique($style_templates)) === 1)
+ {
+ return end($style_templates);
+ }
+
+ // Group identical templates together
+ $grouped_templates = array();
+ foreach ($style_templates as $style_id => $style_template)
+ {
+ $grouped_templates[$style_template][] = '$STYLE_ID=' . $style_id;
+ }
+
+ // Sort templates by frequency descending
+ $templates_cnt = array_map('sizeof', $grouped_templates);
+ array_multisort($grouped_templates, $templates_cnt);
+
+ // Remove the most frequent template from the list; It becomes the default
+ reset($grouped_templates);
+ $default_template = key($grouped_templates);
+ unset($grouped_templates[$default_template]);
+
+ // Build an xsl:choose switch
+ $template = '<xsl:choose>';
+ foreach ($grouped_templates as $style_template => $exprs)
+ {
+ $template .= '<xsl:when test="' . implode(' or ', $exprs) . '">' . $style_template . '</xsl:when>';
+ }
+ $template .= '<xsl:otherwise>' . $default_template . '</xsl:otherwise></xsl:choose>';
+
+ return $template;
+ }
+}
diff --git a/phpBB/phpbb/textformatter/s9e/parser.php b/phpBB/phpbb/textformatter/s9e/parser.php
new file mode 100644
index 0000000000..ffaffbc63c
--- /dev/null
+++ b/phpBB/phpbb/textformatter/s9e/parser.php
@@ -0,0 +1,396 @@
+<?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\textformatter\s9e;
+
+use s9e\TextFormatter\Parser\BuiltInFilters;
+use s9e\TextFormatter\Parser\Logger;
+
+/**
+* s9e\TextFormatter\Parser adapter
+*/
+class parser implements \phpbb\textformatter\parser_interface
+{
+ /**
+ * @var \phpbb\event\dispatcher_interface
+ */
+ protected $dispatcher;
+
+ /**
+ * @var \s9e\TextFormatter\Parser
+ */
+ protected $parser;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\cache\driver_interface $cache
+ * @param string $key Cache key
+ * @param factory $factory
+ * @param \phpbb\event\dispatcher_interface $dispatcher
+ */
+ public function __construct(\phpbb\cache\driver\driver_interface $cache, $key, factory $factory, \phpbb\event\dispatcher_interface $dispatcher)
+ {
+ $parser = $cache->get($key);
+ if (!$parser)
+ {
+ $objects = $factory->regenerate();
+ $parser = $objects['parser'];
+ }
+
+ $this->dispatcher = $dispatcher;
+ $this->parser = $parser;
+ $parser = $this;
+
+ /**
+ * Configure the parser service
+ *
+ * Can be used to:
+ * - toggle features or BBCodes
+ * - register variables or custom parsers in the s9e\TextFormatter parser
+ * - configure the s9e\TextFormatter parser's runtime settings
+ *
+ * @event core.text_formatter_s9e_parser_setup
+ * @var \phpbb\textformatter\s9e\parser parser This parser service
+ * @since 3.2.0-a1
+ */
+ $vars = array('parser');
+ extract($dispatcher->trigger_event('core.text_formatter_s9e_parser_setup', compact($vars)));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function parse($text)
+ {
+ $parser = $this;
+
+ /**
+ * Modify a text before it is parsed
+ *
+ * @event core.text_formatter_s9e_parse_before
+ * @var \phpbb\textformatter\s9e\parser parser This parser service
+ * @var string text The original text
+ * @since 3.2.0-a1
+ */
+ $vars = array('parser', 'text');
+ extract($this->dispatcher->trigger_event('core.text_formatter_s9e_parse_before', compact($vars)));
+
+ $xml = $this->parser->parse($text);
+
+ /**
+ * Modify a parsed text in its XML form
+ *
+ * @event core.text_formatter_s9e_parse_after
+ * @var \phpbb\textformatter\s9e\parser parser This parser service
+ * @var string xml The parsed text, in XML
+ * @since 3.2.0-a1
+ */
+ $vars = array('parser', 'xml');
+ extract($this->dispatcher->trigger_event('core.text_formatter_s9e_parse_after', compact($vars)));
+
+ return $xml;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function disable_bbcode($name)
+ {
+ $this->parser->disableTag(strtoupper($name));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function disable_bbcodes()
+ {
+ $this->parser->disablePlugin('BBCodes');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function disable_censor()
+ {
+ $this->parser->disablePlugin('Censor');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function disable_magic_url()
+ {
+ $this->parser->disablePlugin('Autoemail');
+ $this->parser->disablePlugin('Autolink');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function disable_smilies()
+ {
+ $this->parser->disablePlugin('Emoticons');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function enable_bbcode($name)
+ {
+ $this->parser->enableTag(strtoupper($name));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function enable_bbcodes()
+ {
+ $this->parser->enablePlugin('BBCodes');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function enable_censor()
+ {
+ $this->parser->enablePlugin('Censor');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function enable_magic_url()
+ {
+ $this->parser->enablePlugin('Autoemail');
+ $this->parser->enablePlugin('Autolink');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function enable_smilies()
+ {
+ $this->parser->enablePlugin('Emoticons');
+ }
+
+ /**
+ * {@inheritdoc}
+ *
+ * This will convert the log entries found in s9e\TextFormatter's logger into phpBB error
+ * messages
+ */
+ public function get_errors()
+ {
+ $errors = array();
+ foreach ($this->parser->getLogger()->get() as $entry)
+ {
+ list($type, $msg, $context) = $entry;
+
+ if ($msg === 'Tag limit exceeded')
+ {
+ if ($context['tagName'] === 'E')
+ {
+ $errors[] = array('TOO_MANY_SMILIES', $context['tagLimit']);
+ }
+ else if ($context['tagName'] === 'URL')
+ {
+ $errors[] = array('TOO_MANY_URLS', $context['tagLimit']);
+ }
+ }
+ else if ($msg === 'MAX_FONT_SIZE_EXCEEDED')
+ {
+ $errors[] = array($msg, $context['max_size']);
+ }
+ else if (preg_match('/^MAX_(?:FLASH|IMG)_(HEIGHT|WIDTH)_EXCEEDED$/D', $msg, $m))
+ {
+ $errors[] = array($msg, $context['max_' . strtolower($m[1])]);
+ }
+ else if ($msg === 'Tag is disabled')
+ {
+ $name = strtolower($context['tag']->getName());
+ $errors[] = array('UNAUTHORISED_BBCODE', '[' . $name . ']');
+ }
+ else if ($msg === 'UNABLE_GET_IMAGE_SIZE')
+ {
+ $errors[] = array($msg);
+ }
+ }
+
+ // Deduplicate error messages. array_unique() only works on strings so we have to serialize
+ if (!empty($errors))
+ {
+ $errors = array_map('unserialize', array_unique(array_map('serialize', $errors)));
+ }
+
+ return $errors;
+ }
+
+ /**
+ * Return the instance of s9e\TextFormatter\Parser used by this object
+ *
+ * @return \s9e\TextFormatter\Parser
+ */
+ public function get_parser()
+ {
+ return $this->parser;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set_var($name, $value)
+ {
+ if ($name === 'max_smilies')
+ {
+ $this->parser->setTagLimit('E', $value ?: PHP_INT_MAX);
+ }
+ else if ($name === 'max_urls')
+ {
+ $this->parser->setTagLimit('URL', $value ?: PHP_INT_MAX);
+ }
+ else
+ {
+ $this->parser->registeredVars[$name] = $value;
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set_vars(array $vars)
+ {
+ foreach ($vars as $name => $value)
+ {
+ $this->set_var($name, $value);
+ }
+ }
+
+ /**
+ * Filter a flash object's height
+ *
+ * @see bbcode_firstpass::bbcode_flash()
+ *
+ * @param string $height
+ * @param integer $max_height
+ * @param Logger $logger
+ * @return mixed Original value if valid, FALSE otherwise
+ */
+ static public function filter_flash_height($height, $max_height, Logger $logger)
+ {
+ if ($max_height && $height > $max_height)
+ {
+ $logger->err('MAX_FLASH_HEIGHT_EXCEEDED', array('max_height' => $max_height));
+
+ return false;
+ }
+
+ return $height;
+ }
+
+ /**
+ * Filter a flash object's width
+ *
+ * @see bbcode_firstpass::bbcode_flash()
+ *
+ * @param string $width
+ * @param integer $max_width
+ * @param Logger $logger
+ * @return mixed Original value if valid, FALSE otherwise
+ */
+ static public function filter_flash_width($width, $max_width, Logger $logger)
+ {
+ if ($max_width && $width > $max_width)
+ {
+ $logger->err('MAX_FLASH_WIDTH_EXCEEDED', array('max_width' => $max_width));
+
+ return false;
+ }
+
+ return $width;
+ }
+
+ /**
+ * Filter the value used in a [size] BBCode
+ *
+ * @see bbcode_firstpass::bbcode_size()
+ *
+ * @param string $size Original size
+ * @param integer $max_size Maximum allowed size
+ * @param Logger $logger
+ * @return mixed Original value if valid, FALSE otherwise
+ */
+ static public function filter_font_size($size, $max_size, Logger $logger)
+ {
+ if ($max_size && $size > $max_size)
+ {
+ $logger->err('MAX_FONT_SIZE_EXCEEDED', array('max_size' => $max_size));
+
+ return false;
+ }
+
+ if ($size < 1)
+ {
+ return false;
+ }
+
+ return $size;
+ }
+
+ /**
+ * Filter an image's URL to enforce restrictions on its dimensions
+ *
+ * @see bbcode_firstpass::bbcode_img()
+ *
+ * @param string $url Original URL
+ * @param array $url_config Config used by the URL filter
+ * @param Logger $logger
+ * @param integer $max_height Maximum height allowed
+ * @param integer $max_width Maximum width allowed
+ * @return string|bool Original value if valid, FALSE otherwise
+ */
+ static public function filter_img_url($url, array $url_config, Logger $logger, $max_height, $max_width)
+ {
+ // Validate the URL
+ $url = BuiltInFilters::filterUrl($url, $url_config, $logger);
+ if ($url === false)
+ {
+ return false;
+ }
+
+ if ($max_height || $max_width)
+ {
+ $imagesize = new \FastImageSize\FastImageSize();
+ $size_info = $imagesize->getImageSize($url);
+ if ($size_info === false)
+ {
+ $logger->err('UNABLE_GET_IMAGE_SIZE');
+ return false;
+ }
+
+ if ($max_height && $max_height < $size_info['height'])
+ {
+ $logger->err('MAX_IMG_HEIGHT_EXCEEDED', array('max_height' => $max_height));
+ return false;
+ }
+
+ if ($max_width && $max_width < $size_info['width'])
+ {
+ $logger->err('MAX_IMG_WIDTH_EXCEEDED', array('max_width' => $max_width));
+ return false;
+ }
+ }
+
+ return $url;
+ }
+}
diff --git a/phpBB/phpbb/textformatter/s9e/quote_helper.php b/phpBB/phpbb/textformatter/s9e/quote_helper.php
new file mode 100644
index 0000000000..24109ac8cc
--- /dev/null
+++ b/phpBB/phpbb/textformatter/s9e/quote_helper.php
@@ -0,0 +1,81 @@
+<?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\textformatter\s9e;
+
+class quote_helper
+{
+ /**
+ * @var string Base URL for a post link, uses {POST_ID} as placeholder
+ */
+ protected $post_url;
+
+ /**
+ * @var string Base URL for a profile link, uses {USER_ID} as placeholder
+ */
+ protected $profile_url;
+
+ /**
+ * @var \phpbb\user
+ */
+ protected $user;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\user $user
+ * @param string $root_path
+ * @param string $php_ext
+ */
+ public function __construct(\phpbb\user $user, $root_path, $php_ext)
+ {
+ $this->post_url = append_sid($root_path . 'viewtopic.' . $php_ext, 'p={POST_ID}#p{POST_ID}');
+ $this->profile_url = append_sid($root_path . 'memberlist.' . $php_ext, 'mode=viewprofile&u={USER_ID}');
+ $this->user = $user;
+ }
+
+ /**
+ * Inject dynamic metadata into QUOTE tags in given XML
+ *
+ * @param string $xml Original XML
+ * @return string Modified XML
+ */
+ public function inject_metadata($xml)
+ {
+ $post_url = $this->post_url;
+ $profile_url = $this->profile_url;
+ $user = $this->user;
+
+ return \s9e\TextFormatter\Utils::replaceAttributes(
+ $xml,
+ 'QUOTE',
+ function ($attributes) use ($post_url, $profile_url, $user)
+ {
+ if (isset($attributes['post_id']))
+ {
+ $attributes['post_url'] = str_replace('{POST_ID}', $attributes['post_id'], $post_url);
+ }
+ if (isset($attributes['time']))
+ {
+ $attributes['date'] = $user->format_date($attributes['time']);
+ }
+ if (isset($attributes['user_id']))
+ {
+ $attributes['profile_url'] = str_replace('{USER_ID}', $attributes['user_id'], $profile_url);
+ }
+
+ return $attributes;
+ }
+ );
+ }
+}
diff --git a/phpBB/phpbb/textformatter/s9e/renderer.php b/phpBB/phpbb/textformatter/s9e/renderer.php
new file mode 100644
index 0000000000..2206605ba2
--- /dev/null
+++ b/phpBB/phpbb/textformatter/s9e/renderer.php
@@ -0,0 +1,314 @@
+<?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\textformatter\s9e;
+
+/**
+* s9e\TextFormatter\Renderer adapter
+*/
+class renderer implements \phpbb\textformatter\renderer_interface
+{
+ /**
+ * @var \s9e\TextFormatter\Plugins\Censor\Helper
+ */
+ protected $censor;
+
+ /**
+ * @var \phpbb\event\dispatcher_interface
+ */
+ protected $dispatcher;
+
+ /**
+ * @var quote_helper
+ */
+ protected $quote_helper;
+
+ /**
+ * @var \s9e\TextFormatter\Renderer
+ */
+ protected $renderer;
+
+ /**
+ * @var bool Status of the viewcensors option
+ */
+ protected $viewcensors = false;
+
+ /**
+ * @var bool Status of the viewflash option
+ */
+ protected $viewflash = false;
+
+ /**
+ * @var bool Status of the viewimg option
+ */
+ protected $viewimg = false;
+
+ /**
+ * @var bool Status of the viewsmilies option
+ */
+ protected $viewsmilies = false;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\cache\driver\driver_interface $cache
+ * @param string $cache_dir Path to the cache dir
+ * @param string $key Cache key
+ * @param factory $factory
+ * @param \phpbb\event\dispatcher_interface $dispatcher
+ */
+ public function __construct(\phpbb\cache\driver\driver_interface $cache, $cache_dir, $key, factory $factory, \phpbb\event\dispatcher_interface $dispatcher)
+ {
+ $renderer_data = $cache->get($key);
+ if ($renderer_data)
+ {
+ $class = $renderer_data['class'];
+ if (!class_exists($class, false))
+ {
+ // Try to load the renderer class from its cache file
+ $cache_file = $cache_dir . $class . '.php';
+
+ if (file_exists($cache_file))
+ {
+ include($cache_file);
+ }
+ }
+ if (class_exists($class, false))
+ {
+ $renderer = new $class;
+ }
+ if (isset($renderer_data['censor']))
+ {
+ $censor = $renderer_data['censor'];
+ }
+ }
+ if (!isset($renderer))
+ {
+ $objects = $factory->regenerate();
+ $renderer = $objects['renderer'];
+ }
+
+ if (isset($censor))
+ {
+ $this->censor = $censor;
+ }
+ $this->dispatcher = $dispatcher;
+ $this->renderer = $renderer;
+ $renderer = $this;
+
+ /**
+ * Configure the renderer service
+ *
+ * @event core.text_formatter_s9e_renderer_setup
+ * @var \phpbb\textformatter\s9e\renderer renderer This renderer service
+ * @since 3.2.0-a1
+ */
+ $vars = array('renderer');
+ extract($dispatcher->trigger_event('core.text_formatter_s9e_renderer_setup', compact($vars)));
+ }
+
+ /**
+ * Configure the quote_helper object used to display extended information in quotes
+ *
+ * @param quote_helper $quote_helper
+ */
+ public function configure_quote_helper(quote_helper $quote_helper)
+ {
+ $this->quote_helper = $quote_helper;
+ }
+
+ /**
+ * Automatically set the smilies path based on config
+ *
+ * @param \phpbb\config\config $config
+ * @param \phpbb\path_helper $path_helper
+ * @return null
+ */
+ public function configure_smilies_path(\phpbb\config\config $config, \phpbb\path_helper $path_helper)
+ {
+ /**
+ * @see smiley_text()
+ */
+ $root_path = (defined('PHPBB_USE_BOARD_URL_PATH') && PHPBB_USE_BOARD_URL_PATH) ? generate_board_url() . '/' : $path_helper->get_web_root_path();
+
+ $this->set_smilies_path($root_path . $config['smilies_path']);
+ }
+
+ /**
+ * Configure this renderer as per the user's settings
+ *
+ * Should set the locale as well as the viewcensor/viewflash/viewimg/viewsmilies options.
+ *
+ * @param \phpbb\user $user
+ * @param \phpbb\config\config $config
+ * @param \phpbb\auth\auth $auth
+ * @return null
+ */
+ public function configure_user(\phpbb\user $user, \phpbb\config\config $config, \phpbb\auth\auth $auth)
+ {
+ $censor = $user->optionget('viewcensors') || !$config['allow_nocensors'] || !$auth->acl_get('u_chgcensors');
+
+ $this->set_viewcensors($censor);
+ $this->set_viewflash($user->optionget('viewflash'));
+ $this->set_viewimg($user->optionget('viewimg'));
+ $this->set_viewsmilies($user->optionget('viewsmilies'));
+
+ // Set the stylesheet parameters
+ foreach (array_keys($this->renderer->getParameters()) as $param_name)
+ {
+ if (strpos($param_name, 'L_') === 0)
+ {
+ // L_FOO is set to $user->lang('FOO')
+ $this->renderer->setParameter($param_name, $user->lang(substr($param_name, 2)));
+ }
+ }
+
+ // Set this user's style id and other parameters
+ $this->renderer->setParameters(array(
+ 'S_IS_BOT' => $user->data['is_bot'],
+ 'S_REGISTERED_USER' => $user->data['is_registered'],
+ 'S_USER_LOGGED_IN' => ($user->data['user_id'] != ANONYMOUS),
+ 'STYLE_ID' => $user->style['style_id'],
+ ));
+ }
+
+ /**
+ * Return the instance of s9e\TextFormatter\Renderer used by this object
+ *
+ * @return \s9e\TextFormatter\Renderer
+ */
+ public function get_renderer()
+ {
+ return $this->renderer;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_viewcensors()
+ {
+ return $this->viewcensors;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_viewflash()
+ {
+ return $this->viewflash;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_viewimg()
+ {
+ return $this->viewimg;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_viewsmilies()
+ {
+ return $this->viewsmilies;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function render($xml)
+ {
+ if (isset($this->quote_helper))
+ {
+ $xml = $this->quote_helper->inject_metadata($xml);
+ }
+ $renderer = $this;
+
+ /**
+ * Modify a parsed text before it is rendered
+ *
+ * @event core.text_formatter_s9e_render_before
+ * @var \phpbb\textformatter\s9e\renderer renderer This renderer service
+ * @var string xml The parsed text, in its XML form
+ * @since 3.2.0-a1
+ */
+ $vars = array('renderer', 'xml');
+ extract($this->dispatcher->trigger_event('core.text_formatter_s9e_render_before', compact($vars)));
+
+ if (isset($this->censor) && $this->viewcensors)
+ {
+ // NOTE: censorHtml() is XML-safe
+ $xml = $this->censor->censorHtml($xml, true);
+ }
+
+ $html = $this->renderer->render($xml);
+
+ /**
+ * Modify a rendered text
+ *
+ * @event core.text_formatter_s9e_render_after
+ * @var string html The rendered text's HTML
+ * @var \phpbb\textformatter\s9e\renderer renderer This renderer service
+ * @since 3.2.0-a1
+ */
+ $vars = array('html', 'renderer');
+ extract($this->dispatcher->trigger_event('core.text_formatter_s9e_render_after', compact($vars)));
+
+ return $html;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set_smilies_path($path)
+ {
+ $this->renderer->setParameter('T_SMILIES_PATH', $path);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set_viewcensors($value)
+ {
+ $this->viewcensors = $value;
+ $this->renderer->setParameter('S_VIEWCENSORS', $value);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set_viewflash($value)
+ {
+ $this->viewflash = $value;
+ $this->renderer->setParameter('S_VIEWFLASH', $value);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set_viewimg($value)
+ {
+ $this->viewimg = $value;
+ $this->renderer->setParameter('S_VIEWIMG', $value);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function set_viewsmilies($value)
+ {
+ $this->viewsmilies = $value;
+ $this->renderer->setParameter('S_VIEWSMILIES', $value);
+ }
+}
diff --git a/phpBB/phpbb/textformatter/s9e/utils.php b/phpBB/phpbb/textformatter/s9e/utils.php
new file mode 100644
index 0000000000..b317fe4a8d
--- /dev/null
+++ b/phpBB/phpbb/textformatter/s9e/utils.php
@@ -0,0 +1,139 @@
+<?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\textformatter\s9e;
+
+/**
+* Text manipulation utilities
+*/
+class utils implements \phpbb\textformatter\utils_interface
+{
+ /**
+ * Replace BBCodes and other formatting elements with whitespace
+ *
+ * NOTE: preserves smilies as text
+ *
+ * @param string $xml Parsed text
+ * @return string Plain text
+ */
+ public function clean_formatting($xml)
+ {
+ // Insert a space before <s> and <e> then remove formatting
+ $xml = preg_replace('#<[es]>#', ' $0', $xml);
+
+ return \s9e\TextFormatter\Utils::removeFormatting($xml);
+ }
+
+ /**
+ * Format given string to be used as an attribute value
+ *
+ * Will return the string as-is if it can be used in a BBCode without quotes. Otherwise,
+ * it will use either single- or double- quotes depending on whichever requires less escaping.
+ * Quotes and backslashes are escaped with backslashes where necessary
+ *
+ * @param string $str Original string
+ * @return string Same string if possible, escaped string within quotes otherwise
+ */
+ protected function format_attribute_value($str)
+ {
+ if (!preg_match('/[ "\'\\\\\\]]/', $str))
+ {
+ // Return as-is if it contains none of: space, ' " \ or ]
+ return $str;
+ }
+ $singleQuoted = "'" . addcslashes($str, "\\'") . "'";
+ $doubleQuoted = '"' . addcslashes($str, '\\"') . '"';
+
+ return (strlen($singleQuoted) < strlen($doubleQuoted)) ? $singleQuoted : $doubleQuoted;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function generate_quote($text, array $attributes = array())
+ {
+ $text = trim($text);
+ $quote = '[quote';
+ if (isset($attributes['author']))
+ {
+ // Add the author as the BBCode's default attribute
+ $quote .= '=' . $this->format_attribute_value($attributes['author']);
+ unset($attributes['author']);
+ }
+
+ if (isset($attributes['user_id']) && $attributes['user_id'] == ANONYMOUS)
+ {
+ unset($attributes['user_id']);
+ }
+
+ ksort($attributes);
+ foreach ($attributes as $name => $value)
+ {
+ $quote .= ' ' . $name . '=' . $this->format_attribute_value($value);
+ }
+ $quote .= ']';
+ $newline = (strlen($quote . $text . '[/quote]') > 80 || strpos($text, "\n") !== false) ? "\n" : '';
+ $quote .= $newline . $text . $newline . '[/quote]';
+
+ return $quote;
+ }
+
+ /**
+ * Get a list of quote authors, limited to the outermost quotes
+ *
+ * @param string $xml Parsed text
+ * @return string[] List of authors
+ */
+ public function get_outermost_quote_authors($xml)
+ {
+ $authors = array();
+ if (strpos($xml, '<QUOTE ') === false)
+ {
+ return $authors;
+ }
+
+ $dom = new \DOMDocument;
+ $dom->loadXML($xml);
+ $xpath = new \DOMXPath($dom);
+ foreach ($xpath->query('//QUOTE[not(ancestor::QUOTE)]/@author') as $author)
+ {
+ $authors[] = $author->textContent;
+ }
+
+ return $authors;
+ }
+
+ /**
+ * Remove given BBCode and its content, at given nesting depth
+ *
+ * @param string $xml Parsed text
+ * @param string $bbcode_name BBCode's name
+ * @param integer $depth Minimum nesting depth (number of parents of the same name)
+ * @return string Parsed text
+ */
+ public function remove_bbcode($xml, $bbcode_name, $depth = 0)
+ {
+ return \s9e\TextFormatter\Utils::removeTag($xml, strtoupper($bbcode_name), $depth);
+ }
+
+ /**
+ * Return a parsed text to its original form
+ *
+ * @param string $xml Parsed text
+ * @return string Original plain text
+ */
+ public function unparse($xml)
+ {
+ return \s9e\TextFormatter\Unparser::unparse($xml);
+ }
+}
diff --git a/phpBB/phpbb/textformatter/utils_interface.php b/phpBB/phpbb/textformatter/utils_interface.php
new file mode 100644
index 0000000000..4810453cd1
--- /dev/null
+++ b/phpBB/phpbb/textformatter/utils_interface.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.
+*
+*/
+
+namespace phpbb\textformatter;
+
+/**
+* Used to manipulate a parsed text
+*/
+interface utils_interface
+{
+ /**
+ * Replace BBCodes and other formatting elements with whitespace
+ *
+ * NOTE: preserves smilies as text
+ *
+ * @param string $text Parsed text
+ * @return string Plain text
+ */
+ public function clean_formatting($text);
+
+ /**
+ * Create a quote block for given text
+ *
+ * Possible attributes:
+ * - author: author's name (usually a username)
+ * - post_id: post_id of the post being quoted
+ * - user_id: user_id of the user being quoted
+ * - time: timestamp of the original message
+ *
+ * @param string $text Quote's text
+ * @param array $attributes Quote's attributes
+ * @return string Quote block to be used in a new post/text
+ */
+ public function generate_quote($text, array $attributes = array());
+
+ /**
+ * Get a list of quote authors, limited to the outermost quotes
+ *
+ * @param string $text Parsed text
+ * @return string[] List of authors
+ */
+ public function get_outermost_quote_authors($text);
+
+ /**
+ * Remove given BBCode and its content, at given nesting depth
+ *
+ * @param string $text Parsed text
+ * @param string $bbcode_name BBCode's name
+ * @param integer $depth Minimum nesting depth (number of parents of the same name)
+ * @return string Parsed text
+ */
+ public function remove_bbcode($text, $bbcode_name, $depth = 0);
+
+ /**
+ * Return a parsed text to its original form
+ *
+ * @param string $text Parsed text
+ * @return string Original plain text
+ */
+ public function unparse($text);
+}
diff --git a/phpBB/phpbb/textreparser/base.php b/phpBB/phpbb/textreparser/base.php
new file mode 100644
index 0000000000..3e5ee248a1
--- /dev/null
+++ b/phpBB/phpbb/textreparser/base.php
@@ -0,0 +1,243 @@
+<?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\textreparser;
+
+abstract class base implements reparser_interface
+{
+ /**
+ * @var bool Whether to save changes to the database
+ */
+ protected $save_changes = true;
+
+ /**
+ * {@inheritdoc}
+ */
+ abstract public function get_max_id();
+
+ /**
+ * Return all records in given range
+ *
+ * @param integer $min_id Lower bound
+ * @param integer $max_id Upper bound
+ * @return array Array of records
+ */
+ abstract protected function get_records_by_range($min_id, $max_id);
+
+ /**
+ * {@inheritdoc}
+ */
+ abstract protected function save_record(array $record);
+
+ /**
+ * Add fields to given record, if applicable
+ *
+ * The enable_* fields are not always saved to the database. Sometimes we need to guess their
+ * original value based on the text content or possibly other fields
+ *
+ * @param array $record Original record
+ * @return array Complete record
+ */
+ protected function add_missing_fields(array $record)
+ {
+ if (!isset($record['enable_bbcode'], $record['enable_smilies'], $record['enable_magic_url']))
+ {
+ if (isset($record['options']))
+ {
+ $record += array(
+ 'enable_bbcode' => (bool) ($record['options'] & OPTION_FLAG_BBCODE),
+ 'enable_smilies' => (bool) ($record['options'] & OPTION_FLAG_SMILIES),
+ 'enable_magic_url' => (bool) ($record['options'] & OPTION_FLAG_LINKS),
+ );
+ }
+ else
+ {
+ $record += array(
+ 'enable_bbcode' => $this->guess_bbcodes($record),
+ 'enable_smilies' => $this->guess_smilies($record),
+ 'enable_magic_url' => $this->guess_magic_url($record),
+ );
+ }
+ }
+
+ // Those BBCodes are disabled based on context and user permissions and that value is never
+ // stored in the database. Here we test whether they were used in the original text.
+ $bbcodes = array('flash', 'img', 'quote', 'url');
+ foreach ($bbcodes as $bbcode)
+ {
+ $field_name = 'enable_' . $bbcode . '_bbcode';
+ $record[$field_name] = $this->guess_bbcode($record, $bbcode);
+ }
+
+ // Magic URLs are tied to the URL BBCode, that's why if magic URLs are enabled we make sure
+ // that the URL BBCode is also enabled
+ if ($record['enable_magic_url'])
+ {
+ $record['enable_url_bbcode'] = true;
+ }
+
+ return $record;
+ }
+
+ /**
+ * Disable saving changes to the database
+ */
+ public function disable_save()
+ {
+ $this->save_changes = false;
+ }
+
+ /**
+ * Enable saving changes to the database
+ */
+ public function enable_save()
+ {
+ $this->save_changes = true;
+ }
+
+ /**
+ * Guess whether given BBCode is in use in given record
+ *
+ * @param array $record
+ * @param string $bbcode
+ * @return bool
+ */
+ protected function guess_bbcode(array $record, $bbcode)
+ {
+ if (!empty($record['bbcode_uid']))
+ {
+ // Look for the closing tag, e.g. [/url]
+ $match = '[/' . $bbcode . ':' . $record['bbcode_uid'];
+ if (strpos($record['text'], $match) !== false)
+ {
+ return true;
+ }
+ }
+
+ if (substr($record['text'], 0, 2) === '<r')
+ {
+ // Look for the closing tag inside of a e element, in an element of the same name, e.g.
+ // <e>[/url]</e></URL>
+ $match = '<e>[/' . $bbcode . ']</e></' . strtoupper($bbcode) . '>';
+ if (strpos($record['text'], $match) !== false)
+ {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Guess whether any BBCode is in use in given record
+ *
+ * @param array $record
+ * @return bool
+ */
+ protected function guess_bbcodes(array $record)
+ {
+ if (!empty($record['bbcode_uid']))
+ {
+ // Test whether the bbcode_uid is in use
+ $match = ':' . $record['bbcode_uid'];
+ if (strpos($record['text'], $match) !== false)
+ {
+ return true;
+ }
+ }
+
+ if (substr($record['text'], 0, 2) === '<r')
+ {
+ // Look for a closing tag inside of an e element
+ return (bool) preg_match('(<e>\\[/\\w+\\]</e>)', $match);
+ }
+
+ return false;
+ }
+
+ /**
+ * Guess whether magic URLs are in use in given record
+ *
+ * @param array $record
+ * @return bool
+ */
+ protected function guess_magic_url(array $record)
+ {
+ // Look for <!-- m --> or for a URL tag that's not immediately followed by <s>
+ return (strpos($record['text'], '<!-- m -->') !== false || preg_match('(<URL [^>]++>(?!<s>))', $record['text']));
+ }
+
+ /**
+ * Guess whether smilies are in use in given record
+ *
+ * @param array $record
+ * @return bool
+ */
+ protected function guess_smilies(array $record)
+ {
+ return (strpos($record['text'], '<!-- s') !== false || strpos($record['text'], '<E>') !== false);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function reparse_range($min_id, $max_id)
+ {
+ foreach ($this->get_records_by_range($min_id, $max_id) as $record)
+ {
+ $this->reparse_record($record);
+ }
+ }
+
+ /**
+ * Reparse given record
+ *
+ * @param array $record Associative array containing the record's data
+ */
+ protected function reparse_record(array $record)
+ {
+ $record = $this->add_missing_fields($record);
+ $flags = ($record['enable_bbcode']) ? OPTION_FLAG_BBCODE : 0;
+ $flags |= ($record['enable_smilies']) ? OPTION_FLAG_SMILIES : 0;
+ $flags |= ($record['enable_magic_url']) ? OPTION_FLAG_LINKS : 0;
+ $unparsed = array_merge(
+ $record,
+ generate_text_for_edit($record['text'], $record['bbcode_uid'], $flags)
+ );
+
+ // generate_text_for_edit() and decode_message() actually return the text as HTML. It has to
+ // be decoded to plain text before it can be reparsed
+ $text = html_entity_decode($unparsed['text'], ENT_QUOTES, 'UTF-8');
+ $bitfield = $flags = null;
+ generate_text_for_storage(
+ $text,
+ $unparsed['bbcode_uid'],
+ $bitfield,
+ $flags,
+ $unparsed['enable_bbcode'],
+ $unparsed['enable_magic_url'],
+ $unparsed['enable_smilies'],
+ $unparsed['enable_img_bbcode'],
+ $unparsed['enable_flash_bbcode'],
+ $unparsed['enable_quote_bbcode'],
+ $unparsed['enable_url_bbcode']
+ );
+
+ // Save the new text if it has changed and it's not a dry run
+ if ($text !== $record['text'] && $this->save_changes)
+ {
+ $record['text'] = $text;
+ $this->save_record($record);
+ }
+ }
+}
diff --git a/phpBB/phpbb/textreparser/plugins/contact_admin_info.php b/phpBB/phpbb/textreparser/plugins/contact_admin_info.php
new file mode 100644
index 0000000000..8910f2256b
--- /dev/null
+++ b/phpBB/phpbb/textreparser/plugins/contact_admin_info.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\textreparser\plugins;
+
+class contact_admin_info extends \phpbb\textreparser\base
+{
+ /**
+ * @var \phpbb\config\db_text
+ */
+ protected $config_text;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\config\db_text $config_text
+ */
+ public function __construct(\phpbb\config\db_text $config_text)
+ {
+ $this->config_text = $config_text;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_max_id()
+ {
+ return 1;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function get_records_by_range($min_id, $max_id)
+ {
+ $values = $this->config_text->get_array(array(
+ 'contact_admin_info',
+ 'contact_admin_info_uid',
+ 'contact_admin_info_flags',
+ ));
+
+ return array(array(
+ 'id' => 1,
+ 'text' => $values['contact_admin_info'],
+ 'bbcode_uid' => $values['contact_admin_info_uid'],
+ 'enable_bbcode' => $values['contact_admin_info_flags'] & OPTION_FLAG_BBCODE,
+ 'enable_magic_url' => $values['contact_admin_info_flags'] & OPTION_FLAG_LINKS,
+ 'enable_smilies' => $values['contact_admin_info_flags'] & OPTION_FLAG_SMILIES,
+ ));
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function save_record(array $record)
+ {
+ $this->config_text->set('contact_admin_info', $record['text']);
+ }
+}
diff --git a/phpBB/phpbb/textreparser/plugins/forum_description.php b/phpBB/phpbb/textreparser/plugins/forum_description.php
new file mode 100644
index 0000000000..0302dc3082
--- /dev/null
+++ b/phpBB/phpbb/textreparser/plugins/forum_description.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\textreparser\plugins;
+
+class forum_description extends \phpbb\textreparser\row_based_plugin
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function get_columns()
+ {
+ return array(
+ 'id' => 'forum_id',
+ 'text' => 'forum_desc',
+ 'bbcode_uid' => 'forum_desc_uid',
+ 'options' => 'forum_desc_options',
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_table_name()
+ {
+ return FORUMS_TABLE;
+ }
+}
diff --git a/phpBB/phpbb/textreparser/plugins/forum_rules.php b/phpBB/phpbb/textreparser/plugins/forum_rules.php
new file mode 100644
index 0000000000..ce550225f2
--- /dev/null
+++ b/phpBB/phpbb/textreparser/plugins/forum_rules.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\textreparser\plugins;
+
+class forum_rules extends \phpbb\textreparser\row_based_plugin
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function get_columns()
+ {
+ return array(
+ 'id' => 'forum_id',
+ 'text' => 'forum_rules',
+ 'bbcode_uid' => 'forum_rules_uid',
+ 'options' => 'forum_rules_options',
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_table_name()
+ {
+ return FORUMS_TABLE;
+ }
+}
diff --git a/phpBB/phpbb/textreparser/plugins/group_description.php b/phpBB/phpbb/textreparser/plugins/group_description.php
new file mode 100644
index 0000000000..3346ccf25e
--- /dev/null
+++ b/phpBB/phpbb/textreparser/plugins/group_description.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\textreparser\plugins;
+
+class group_description extends \phpbb\textreparser\row_based_plugin
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function get_columns()
+ {
+ return array(
+ 'id' => 'group_id',
+ 'text' => 'group_desc',
+ 'bbcode_uid' => 'group_desc_uid',
+ 'options' => 'group_desc_options',
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_table_name()
+ {
+ return GROUPS_TABLE;
+ }
+}
diff --git a/phpBB/phpbb/textreparser/plugins/pm_text.php b/phpBB/phpbb/textreparser/plugins/pm_text.php
new file mode 100644
index 0000000000..4d06a2878b
--- /dev/null
+++ b/phpBB/phpbb/textreparser/plugins/pm_text.php
@@ -0,0 +1,40 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\textreparser\plugins;
+
+class pm_text extends \phpbb\textreparser\row_based_plugin
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function get_columns()
+ {
+ return array(
+ 'id' => 'msg_id',
+ 'enable_bbcode' => 'enable_bbcode',
+ 'enable_smilies' => 'enable_smilies',
+ 'enable_magic_url' => 'enable_magic_url',
+ 'text' => 'message_text',
+ 'bbcode_uid' => 'bbcode_uid',
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_table_name()
+ {
+ return PRIVMSGS_TABLE;
+ }
+}
diff --git a/phpBB/phpbb/textreparser/plugins/poll_option.php b/phpBB/phpbb/textreparser/plugins/poll_option.php
new file mode 100644
index 0000000000..44cacfae62
--- /dev/null
+++ b/phpBB/phpbb/textreparser/plugins/poll_option.php
@@ -0,0 +1,74 @@
+<?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\textreparser\plugins;
+
+class poll_option extends \phpbb\textreparser\base
+{
+ /**
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\db\driver\driver_interface $db Database connection
+ */
+ public function __construct(\phpbb\db\driver\driver_interface $db)
+ {
+ $this->db = $db;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_max_id()
+ {
+ $sql = 'SELECT MAX(topic_id) AS max_id FROM ' . POLL_OPTIONS_TABLE;
+ $result = $this->db->sql_query($sql);
+ $max_id = (int) $this->db->sql_fetchfield('max_id');
+ $this->db->sql_freeresult($result);
+
+ return $max_id;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function get_records_by_range($min_id, $max_id)
+ {
+ $sql = 'SELECT o.topic_id, o.poll_option_id, o.poll_option_text AS text, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.bbcode_uid
+ FROM ' . POLL_OPTIONS_TABLE . ' o, ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p
+ WHERE o.topic_id BETWEEN ' . $min_id . ' AND ' . $max_id .'
+ AND t.topic_id = o.topic_id
+ AND p.post_id = t.topic_first_post_id';
+ $result = $this->db->sql_query($sql);
+ $records = $this->db->sql_fetchrowset($result);
+ $this->db->sql_freeresult($result);
+
+ return $records;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function save_record(array $record)
+ {
+ $sql = 'UPDATE ' . POLL_OPTIONS_TABLE . "
+ SET poll_option_text = '" . $this->db->sql_escape($record['text']) . "'
+ WHERE topic_id = " . $record['topic_id'] . '
+ AND poll_option_id = ' . $record['poll_option_id'];
+ $this->db->sql_query($sql);
+ }
+}
diff --git a/phpBB/phpbb/textreparser/plugins/poll_title.php b/phpBB/phpbb/textreparser/plugins/poll_title.php
new file mode 100644
index 0000000000..038ae0c366
--- /dev/null
+++ b/phpBB/phpbb/textreparser/plugins/poll_title.php
@@ -0,0 +1,50 @@
+<?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\textreparser\plugins;
+
+class poll_title extends \phpbb\textreparser\row_based_plugin
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function get_columns()
+ {
+ return array(
+ 'id' => 'topic_id',
+ 'text' => 'poll_title',
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function get_records_by_range_query($min_id, $max_id)
+ {
+ $sql = 'SELECT t.topic_id AS id, t.poll_title AS text, p.enable_bbcode, p.enable_smilies, p.enable_magic_url, p.bbcode_uid
+ FROM ' . TOPICS_TABLE . ' t, ' . POSTS_TABLE . ' p
+ WHERE t.topic_id BETWEEN ' . $min_id . ' AND ' . $max_id .'
+ AND t.poll_max_options > 0
+ AND p.post_id = t.topic_first_post_id';
+
+ return $sql;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_table_name()
+ {
+ return TOPICS_TABLE;
+ }
+}
diff --git a/phpBB/phpbb/textreparser/plugins/post_text.php b/phpBB/phpbb/textreparser/plugins/post_text.php
new file mode 100644
index 0000000000..4a07c98cea
--- /dev/null
+++ b/phpBB/phpbb/textreparser/plugins/post_text.php
@@ -0,0 +1,40 @@
+<?php
+/**
+*
+* This file is part of the phpBB Forum Software package.
+*
+* @copyright (c) phpBB Limited <https://www.phpbb.com>
+* @license GNU General Public License, version 2 (GPL-2.0)
+*
+* For full copyright and license information, please see
+* the docs/CREDITS.txt file.
+*
+*/
+
+namespace phpbb\textreparser\plugins;
+
+class post_text extends \phpbb\textreparser\row_based_plugin
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function get_columns()
+ {
+ return array(
+ 'id' => 'post_id',
+ 'enable_bbcode' => 'enable_bbcode',
+ 'enable_smilies' => 'enable_smilies',
+ 'enable_magic_url' => 'enable_magic_url',
+ 'text' => 'post_text',
+ 'bbcode_uid' => 'bbcode_uid',
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_table_name()
+ {
+ return POSTS_TABLE;
+ }
+}
diff --git a/phpBB/phpbb/textreparser/plugins/user_signature.php b/phpBB/phpbb/textreparser/plugins/user_signature.php
new file mode 100644
index 0000000000..f657a45d38
--- /dev/null
+++ b/phpBB/phpbb/textreparser/plugins/user_signature.php
@@ -0,0 +1,73 @@
+<?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\textreparser\plugins;
+
+class user_signature extends \phpbb\textreparser\row_based_plugin
+{
+ /**
+ * @var array Bit numbers used for user options
+ * @see \phpbb\user
+ */
+ protected $keyoptions;
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function add_missing_fields(array $row)
+ {
+ if (!isset($this->keyoptions))
+ {
+ $this->save_keyoptions();
+ }
+
+ $options = $row['user_options'];
+ $row += array(
+ 'enable_bbcode' => phpbb_optionget($this->keyoptions['sig_bbcode'], $options),
+ 'enable_smilies' => phpbb_optionget($this->keyoptions['sig_smilies'], $options),
+ 'enable_magic_url' => phpbb_optionget($this->keyoptions['sig_links'], $options),
+ );
+
+ return parent::add_missing_fields($row);
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_columns()
+ {
+ return array(
+ 'id' => 'user_id',
+ 'text' => 'user_sig',
+ 'bbcode_uid' => 'user_sig_bbcode_uid',
+ 'user_options' => 'user_options',
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_table_name()
+ {
+ return USERS_TABLE;
+ }
+
+ /**
+ * Save the keyoptions var from \phpbb\user
+ */
+ protected function save_keyoptions()
+ {
+ $class_vars = get_class_vars('phpbb\\user');
+ $this->keyoptions = $class_vars['keyoptions'];
+ }
+}
diff --git a/phpBB/phpbb/textreparser/reparser_interface.php b/phpBB/phpbb/textreparser/reparser_interface.php
new file mode 100644
index 0000000000..9ea1732870
--- /dev/null
+++ b/phpBB/phpbb/textreparser/reparser_interface.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\textreparser;
+
+interface reparser_interface
+{
+ /**
+ * Return the highest ID for all existing records
+ *
+ * @return integer
+ */
+ public function get_max_id();
+
+ /**
+ * Reparse all records in given range
+ *
+ * @param integer $min_id Lower bound
+ * @param integer $max_id Upper bound
+ */
+ public function reparse_range($min_id, $max_id);
+}
diff --git a/phpBB/phpbb/textreparser/row_based_plugin.php b/phpBB/phpbb/textreparser/row_based_plugin.php
new file mode 100644
index 0000000000..d3ca334591
--- /dev/null
+++ b/phpBB/phpbb/textreparser/row_based_plugin.php
@@ -0,0 +1,117 @@
+<?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\textreparser;
+
+abstract class row_based_plugin extends base
+{
+ /**
+ * @var \phpbb\db\driver\driver_interface
+ */
+ protected $db;
+
+ /**
+ * Constructor
+ *
+ * @param \phpbb\db\driver\driver_interface $db Database connection
+ */
+ public function __construct(\phpbb\db\driver\driver_interface $db)
+ {
+ $this->db = $db;
+ }
+
+ /**
+ * Return the name of the column that correspond to each field
+ *
+ * @return array
+ */
+ abstract public function get_columns();
+
+ /**
+ * Return the name of the table used by this plugin
+ *
+ * @return string
+ */
+ abstract public function get_table_name();
+
+ /**
+ * {@inheritdoc}
+ */
+ public function get_max_id()
+ {
+ $columns = $this->get_columns();
+
+ $sql = 'SELECT MAX(' . $columns['id'] . ') AS max_id FROM ' . $this->get_table_name();
+ $result = $this->db->sql_query($sql);
+ $max_id = (int) $this->db->sql_fetchfield('max_id');
+ $this->db->sql_freeresult($result);
+
+ return $max_id;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function get_records_by_range($min_id, $max_id)
+ {
+ $sql = $this->get_records_by_range_query($min_id, $max_id);
+ $result = $this->db->sql_query($sql);
+ $records = $this->db->sql_fetchrowset($result);
+ $this->db->sql_freeresult($result);
+
+ return $records;
+ }
+
+ /**
+ * Generate the query that retrieves all records for given range
+ *
+ * @param integer $min_id Lower bound
+ * @param integer $max_id Upper bound
+ * @return string SQL query
+ */
+ protected function get_records_by_range_query($min_id, $max_id)
+ {
+ $columns = $this->get_columns();
+ $fields = array();
+ foreach ($columns as $field_name => $column_name)
+ {
+ if ($column_name === $field_name)
+ {
+ $fields[] = $column_name;
+ }
+ else
+ {
+ $fields[] = $column_name . ' AS ' . $field_name;
+ }
+ }
+
+ $sql = 'SELECT ' . implode(', ', $fields) . '
+ FROM ' . $this->get_table_name() . '
+ WHERE ' . $columns['id'] . ' BETWEEN ' . $min_id . ' AND ' . $max_id;
+
+ return $sql;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function save_record(array $record)
+ {
+ $columns = $this->get_columns();
+
+ $sql = 'UPDATE ' . $this->get_table_name() . '
+ SET ' . $columns['text'] . " = '" . $this->db->sql_escape($record['text']) . "'
+ WHERE " . $columns['id'] . ' = ' . $record['id'];
+ $this->db->sql_query($sql);
+ }
+}
diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php
index f5ad5096bb..173b20ee53 100644
--- a/phpBB/phpbb/user.php
+++ b/phpBB/phpbb/user.php
@@ -21,8 +21,11 @@ namespace phpbb;
*/
class user extends \phpbb\session
{
- var $lang = array();
- var $help = array();
+ /**
+ * @var \phpbb\language\language
+ */
+ protected $language;
+
var $style = array();
var $date_format;
@@ -42,35 +45,63 @@ class user extends \phpbb\session
var $img_lang;
var $img_array = array();
+ /** @var bool */
+ protected $is_setup_flag;
+
// Able to add new options (up to id 31)
var $keyoptions = array('viewimg' => 0, 'viewflash' => 1, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'bbcode' => 8, 'smilies' => 9, 'sig_bbcode' => 15, 'sig_smilies' => 16, 'sig_links' => 17);
/**
* Constructor to set the lang path
- * @param string $datetime_class Class name of datetime class
+ *
+ * @param \phpbb\language\language $lang phpBB's Language loader
+ * @param string $datetime_class Class name of datetime class
*/
- function __construct($datetime_class)
+ function __construct(\phpbb\language\language $lang, $datetime_class)
{
global $phpbb_root_path;
$this->lang_path = $phpbb_root_path . 'language/';
+ $this->language = $lang;
$this->datetime = $datetime_class;
+
+ $this->is_setup_flag = false;
}
/**
- * Function to set custom language path (able to use directory outside of phpBB)
- *
- * @param string $lang_path New language path used.
- * @access public
- */
- function set_custom_lang_path($lang_path)
+ * Returns whether user::setup was called
+ *
+ * @return bool
+ */
+ public function is_setup()
{
- $this->lang_path = $lang_path;
+ return $this->is_setup_flag;
+ }
- if (substr($this->lang_path, -1) != '/')
+ /**
+ * Magic getter for BC compatibility
+ *
+ * Implement array access for user::lang.
+ *
+ * @param string $param_name Name of the BC component the user want to access
+ *
+ * @return array The appropriate array
+ *
+ * @deprecated 3.2.0-dev (To be removed: 4.0.0)
+ */
+ public function __get($param_name)
+ {
+ if ($param_name === 'lang')
+ {
+ return $this->language->get_lang_array();
+ }
+ else if ($param_name === 'help')
{
- $this->lang_path .= '/';
+ $help_array = $this->language->get_lang_array();
+ return $help_array['__help'];
}
+
+ return array();
}
/**
@@ -81,6 +112,8 @@ class user extends \phpbb\session
global $db, $request, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache;
global $phpbb_dispatcher;
+ $this->language->set_default_language($config['default_lang']);
+
if ($this->data['user_id'] != ANONYMOUS)
{
$user_lang_name = (file_exists($this->lang_path . $this->data['user_lang'] . "/common.$phpEx")) ? $this->data['user_lang'] : basename($config['default_lang']);
@@ -98,6 +131,7 @@ class user extends \phpbb\session
{
$lang_override = $request->variable($config['cookie_name'] . '_lang', '', true, \phpbb\request\request_interface::COOKIE);
}
+
if ($lang_override)
{
$use_lang = basename($lang_override);
@@ -108,6 +142,7 @@ class user extends \phpbb\session
{
$user_lang_name = basename($config['default_lang']);
}
+
$user_date_format = $config['default_dateformat'];
$user_timezone = $config['board_timezone'];
@@ -187,6 +222,8 @@ class user extends \phpbb\session
$this->lang_name = $user_lang_name;
$this->date_format = $user_date_format;
+ $this->language->set_user_language($user_lang_name);
+
try
{
$this->timezone = new \DateTimeZone($user_timezone);
@@ -197,17 +234,6 @@ class user extends \phpbb\session
$this->timezone = new \DateTimeZone('UTC');
}
- // We include common language file here to not load it every time a custom language file is included
- $lang = &$this->lang;
-
- // Do not suppress error if in DEBUG mode
- $include_result = (defined('DEBUG')) ? (include $this->lang_path . $this->lang_name . "/common.$phpEx") : (@include $this->lang_path . $this->lang_name . "/common.$phpEx");
-
- if ($include_result === false)
- {
- die('Language file ' . $this->lang_path . $this->lang_name . "/common.$phpEx" . " couldn't be opened.");
- }
-
$this->add_lang($lang_set);
unset($lang_set);
@@ -401,6 +427,8 @@ class user extends \phpbb\session
}
}
+ $this->is_setup_flag = true;
+
return;
}
@@ -414,103 +442,13 @@ class user extends \phpbb\session
*
* If the first parameter is an array, the elements are used as keys and subkeys to get the language entry:
* Example: <samp>$user->lang(array('datetime', 'AGO'), 1)</samp> uses $user->lang['datetime']['AGO'] as language entry.
+ *
+ * @deprecated 3.2.0-dev (To be removed 4.0.0)
*/
function lang()
{
$args = func_get_args();
- $key = $args[0];
-
- if (is_array($key))
- {
- $lang = &$this->lang[array_shift($key)];
-
- foreach ($key as $_key)
- {
- $lang = &$lang[$_key];
- }
- }
- else
- {
- $lang = &$this->lang[$key];
- }
-
- // Return if language string does not exist
- if (!isset($lang) || (!is_string($lang) && !is_array($lang)))
- {
- return $key;
- }
-
- // If the language entry is a string, we simply mimic sprintf() behaviour
- if (is_string($lang))
- {
- if (sizeof($args) == 1)
- {
- return $lang;
- }
-
- // Replace key with language entry and simply pass along...
- $args[0] = $lang;
- return call_user_func_array('sprintf', $args);
- }
- else if (sizeof($lang) == 0)
- {
- // If the language entry is an empty array, we just return the language key
- return $args[0];
- }
-
- // It is an array... now handle different nullar/singular/plural forms
- $key_found = false;
-
- // We now get the first number passed and will select the key based upon this number
- for ($i = 1, $num_args = sizeof($args); $i < $num_args; $i++)
- {
- if (is_int($args[$i]) || is_float($args[$i]))
- {
- if ($args[$i] == 0 && isset($lang[0]))
- {
- // We allow each translation using plural forms to specify a version for the case of 0 things,
- // so that "0 users" may be displayed as "No users".
- $key_found = 0;
- break;
- }
- else
- {
- $use_plural_form = $this->get_plural_form($args[$i]);
- if (isset($lang[$use_plural_form]))
- {
- // The key we should use exists, so we use it.
- $key_found = $use_plural_form;
- }
- else
- {
- // If the key we need to use does not exist, we fall back to the previous one.
- $numbers = array_keys($lang);
-
- foreach ($numbers as $num)
- {
- if ($num > $use_plural_form)
- {
- break;
- }
-
- $key_found = $num;
- }
- }
- break;
- }
- }
- }
-
- // Ok, let's check if the key was found, else use the last entry (because it is mostly the plural form)
- if ($key_found === false)
- {
- $numbers = array_keys($lang);
- $key_found = end($numbers);
- }
-
- // Use the language string we determined and pass it to sprintf()
- $args[0] = $lang[$key_found];
- return call_user_func_array('sprintf', $args);
+ return call_user_func_array(array($this->language, 'lang'), $args);
}
/**
@@ -520,24 +458,22 @@ class user extends \phpbb\session
* @param $number int|float The number we want to get the plural case for. Float numbers are floored.
* @param $force_rule mixed False to use the plural rule of the language package
* or an integer to force a certain plural rule
- * @return int The plural-case we need to use for the number plural-rule combination
+ * @return int|bool The plural-case we need to use for the number plural-rule combination, false if $force_rule
+ * was invalid.
+ *
+ * @deprecated: 3.2.0-dev (To be removed: 3.3.0)
*/
function get_plural_form($number, $force_rule = false)
{
- $number = (int) $number;
-
- // Default to English system
- $plural_rule = ($force_rule !== false) ? $force_rule : ((isset($this->lang['PLURAL_RULE'])) ? $this->lang['PLURAL_RULE'] : 1);
-
- return phpbb_get_plural_form($plural_rule, $number);
+ return $this->language->get_plural_form($number, $force_rule);
}
/**
* Add Language Items - use_db and use_help are assigned where needed (only use them to force inclusion)
*
* @param mixed $lang_set specifies the language entries to include
- * @param bool $use_db internal variable for recursion, do not use
- * @param bool $use_help internal variable for recursion, do not use
+ * @param bool $use_db internal variable for recursion, do not use @deprecated 3.2.0-dev (To be removed: 3.3.0)
+ * @param bool $use_help internal variable for recursion, do not use @deprecated 3.2.0-dev (To be removed: 3.3.0)
* @param string $ext_name The extension to load language from, or empty for core files
*
* Examples:
@@ -548,11 +484,14 @@ class user extends \phpbb\session
* $lang_set = 'posting'
* $lang_set = array('help' => 'faq', 'db' => array('help:faq', 'posting'))
* </code>
+ *
+ * Note: $use_db and $use_help should be removed. The old function was kept for BC purposes,
+ * so the BC logic is handled here.
+ *
+ * @deprecated: 3.2.0-dev (To be removed: 3.3.0)
*/
function add_lang($lang_set, $use_db = false, $use_help = false, $ext_name = '')
{
- global $phpEx;
-
if (is_array($lang_set))
{
foreach ($lang_set as $key => $lang_file)
@@ -563,6 +502,7 @@ class user extends \phpbb\session
if ($key == 'db')
{
+ // This is never used
$this->add_lang($lang_file, true, $use_help, $ext_name);
}
else if ($key == 'help')
@@ -571,7 +511,7 @@ class user extends \phpbb\session
}
else if (!is_array($lang_file))
{
- $this->set_lang($this->lang, $this->help, $lang_file, $use_db, $use_help, $ext_name);
+ $this->set_lang($lang_file, $use_help, $ext_name);
}
else
{
@@ -582,8 +522,37 @@ class user extends \phpbb\session
}
else if ($lang_set)
{
- $this->set_lang($this->lang, $this->help, $lang_set, $use_db, $use_help, $ext_name);
+ $this->set_lang($lang_set, $use_help, $ext_name);
+ }
+ }
+
+ /**
+ * BC function for loading language files
+ *
+ * @deprecated 3.2.0-dev (To be removed: 3.3.0)
+ */
+ private function set_lang($lang_set, $use_help, $ext_name)
+ {
+ if (empty($ext_name))
+ {
+ $ext_name = null;
+ }
+
+ if ($use_help && strpos($lang_set, '/') !== false)
+ {
+ $component = dirname($lang_set) . '/help_' . basename($lang_set);
+
+ if ($component[0] === '/')
+ {
+ $component = substr($component, 1);
+ }
+ }
+ else
+ {
+ $component = (($use_help) ? 'help_' : '') . $lang_set;
}
+
+ $this->language->add_lang($component, $ext_name);
}
/**
@@ -593,6 +562,10 @@ class user extends \phpbb\session
* @param mixed $lang_set specifies the language entries to include
* @param bool $use_db internal variable for recursion, do not use
* @param bool $use_help internal variable for recursion, do not use
+ *
+ * Note: $use_db and $use_help should be removed. Kept for BC purposes.
+ *
+ * @deprecated: 3.2.0-dev (To be removed: 3.3.0)
*/
function add_lang_ext($ext_name, $lang_set, $use_db = false, $use_help = false)
{
@@ -605,109 +578,6 @@ class user extends \phpbb\session
}
/**
- * Set language entry (called by add_lang)
- * @access private
- */
- function set_lang(&$lang, &$help, $lang_file, $use_db = false, $use_help = false, $ext_name = '')
- {
- global $phpbb_root_path, $phpEx;
-
- // Make sure the language name is set (if the user setup did not happen it is not set)
- if (!$this->lang_name)
- {
- global $config;
- $this->lang_name = basename($config['default_lang']);
- }
-
- // $lang == $this->lang
- // $help == $this->help
- // - add appropriate variables here, name them as they are used within the language file...
- if (!$use_db)
- {
- if ($use_help && strpos($lang_file, '/') !== false)
- {
- $filename = dirname($lang_file) . '/help_' . basename($lang_file);
- }
- else
- {
- $filename = (($use_help) ? 'help_' : '') . $lang_file;
- }
-
- if ($ext_name)
- {
- global $phpbb_extension_manager;
- $ext_path = $phpbb_extension_manager->get_extension_path($ext_name, true);
-
- $lang_path = $ext_path . 'language/';
- }
- else
- {
- $lang_path = $this->lang_path;
- }
-
- if (strpos($phpbb_root_path . $filename, $lang_path) === 0)
- {
- $language_filename = $phpbb_root_path . $filename;
- }
- else
- {
- $language_filename = $lang_path . $this->lang_name . '/' . $filename . '.' . $phpEx;
- }
-
- // If we are in install, try to use the updated version, when available
- $install_language_filename = str_replace('language/', 'install/update/new/language/', $language_filename);
- if (defined('IN_INSTALL') && file_exists($install_language_filename))
- {
- $language_filename = $install_language_filename;
- }
-
- if (!file_exists($language_filename))
- {
- global $config;
-
- if ($this->lang_name == 'en')
- {
- // The user's selected language is missing the file, the board default's language is missing the file, and the file doesn't exist in /en.
- $language_filename = str_replace($lang_path . 'en', $lang_path . $this->data['user_lang'], $language_filename);
- trigger_error('Language file ' . $language_filename . ' couldn\'t be opened.', E_USER_ERROR);
- }
- else if ($this->lang_name == basename($config['default_lang']))
- {
- // Fall back to the English Language
- $reset_lang_name = $this->lang_name;
- $this->lang_name = 'en';
- $this->set_lang($lang, $help, $lang_file, $use_db, $use_help, $ext_name);
- $this->lang_name = $reset_lang_name;
- }
- else if ($this->lang_name == $this->data['user_lang'])
- {
- // Fall back to the board default language
- $reset_lang_name = $this->lang_name;
- $this->lang_name = basename($config['default_lang']);
- $this->set_lang($lang, $help, $lang_file, $use_db, $use_help, $ext_name);
- $this->lang_name = $reset_lang_name;
- }
-
- return;
- }
-
- // Do not suppress error if in DEBUG mode
- $include_result = (defined('DEBUG')) ? (include $language_filename) : (@include $language_filename);
-
- if ($include_result === false)
- {
- trigger_error('Language file ' . $language_filename . ' couldn\'t be opened.', E_USER_ERROR);
- }
- }
- else if ($use_db)
- {
- // Get Database Language Strings
- // Put them into $lang if nothing is prefixed, put them into $help if help: is prefixed
- // For example: help:faq, posting
- }
- }
-
- /**
* Format user date
*
* @param int $gmepoch unix timestamp
@@ -816,7 +686,7 @@ class user extends \phpbb\session
if ($alt)
{
- $alt = $this->lang($alt);
+ $alt = $this->language->lang($alt);
$title = ' title="' . $alt . '"';
}
return '<span class="imageset ' . $img . '"' . $title . '>' . $alt . '</span>';
diff --git a/phpBB/phpbb/user_loader.php b/phpBB/phpbb/user_loader.php
index 5ce8ca2d4d..cdd28329db 100644
--- a/phpBB/phpbb/user_loader.php
+++ b/phpBB/phpbb/user_loader.php
@@ -175,7 +175,7 @@ class user_loader
/**
* Get avatar
*
- * @param int $user_id User ID of the user you want to retreive the avatar for
+ * @param int $user_id User ID of the user you want to retrieve the avatar for
* @param bool $query Should we query the database if this user has not yet been loaded?
* Typically this should be left as false and you should make sure
* you load users ahead of time with load_users()
@@ -189,12 +189,14 @@ class user_loader
return '';
}
- if (!function_exists('get_user_avatar'))
- {
- include($this->phpbb_root_path . 'includes/functions_display.' . $this->php_ext);
- }
+ $row = array(
+ 'avatar' => $user['user_avatar'],
+ 'avatar_type' => $user['user_avatar_type'],
+ 'avatar_width' => $user['user_avatar_width'],
+ 'avatar_height' => $user['user_avatar_height'],
+ );
- return get_user_avatar($user['user_avatar'], $user['user_avatar_type'], $user['user_avatar_width'], $user['user_avatar_height'], 'USER_AVATAR', false, $lazy);
+ return phpbb_get_avatar($row, 'USER_AVATAR', false, $lazy);
}
/**
diff --git a/phpBB/phpbb/viewonline_helper.php b/phpBB/phpbb/viewonline_helper.php
index b722f9d911..89915f2228 100644
--- a/phpBB/phpbb/viewonline_helper.php
+++ b/phpBB/phpbb/viewonline_helper.php
@@ -18,13 +18,13 @@ namespace phpbb;
*/
class viewonline_helper
{
- /** @var \phpbb\filesystem */
+ /** @var \phpbb\filesystem\filesystem_interface */
protected $filesystem;
/**
- * @param \phpbb\filesystem $filesystem
+ * @param \phpbb\filesystem\filesystem_interface $filesystem phpBB's filesystem service
*/
- public function __construct(\phpbb\filesystem $filesystem)
+ public function __construct(\phpbb\filesystem\filesystem_interface $filesystem)
{
$this->filesystem = $filesystem;
}
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 2bd3a1a1d2..47fdb2d378 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -29,11 +29,11 @@ $auth->acl($user->data);
// Grab only parameters needed here
-$post_id = request_var('p', 0);
-$topic_id = request_var('t', 0);
-$forum_id = request_var('f', 0);
-$draft_id = request_var('d', 0);
-$lastclick = request_var('lastclick', 0);
+$post_id = $request->variable('p', 0);
+$topic_id = $request->variable('t', 0);
+$forum_id = $request->variable('f', 0);
+$draft_id = $request->variable('d', 0);
+$lastclick = $request->variable('lastclick', 0);
$preview = (isset($_POST['preview'])) ? true : false;
$save = (isset($_POST['save'])) ? true : false;
@@ -43,7 +43,7 @@ $cancel = (isset($_POST['cancel']) && !isset($_POST['save'])) ? true : false;
$refresh = (isset($_POST['add_file']) || isset($_POST['delete_file']) || isset($_POST['cancel_unglobalise']) || $save || $load || $preview);
$submit = $request->is_set_post('post') && !$refresh && !$preview;
-$mode = request_var('mode', '');
+$mode = $request->variable('mode', '');
// If the user is not allowed to delete the post, we try to soft delete it, so we overwrite the mode here.
if ($mode == 'delete' && (($confirm && !$request->is_set_post('delete_permanent')) || !$auth->acl_gets('f_delete', 'm_delete', $forum_id)))
@@ -116,6 +116,7 @@ if (in_array($mode, array('post', 'reply', 'quote', 'edit', 'delete')) && !$foru
trigger_error('NO_FORUM');
}
+/* @var $phpbb_content_visibility \phpbb\content_visibility */
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
// We need to know some basic information in all cases before we do anything.
@@ -489,7 +490,7 @@ if ($mode == 'delete' || $mode == 'soft_delete')
if ($mode == 'bump')
{
if ($bump_time = bump_topic_allowed($forum_id, $post_data['topic_bumped'], $post_data['topic_last_post_time'], $post_data['topic_poster'], $post_data['topic_last_poster_id'])
- && check_link_hash(request_var('hash', ''), "topic_{$post_data['topic_id']}"))
+ && check_link_hash($request->variable('hash', ''), "topic_{$post_data['topic_id']}"))
{
$meta_url = phpbb_bump_topic($forum_id, $topic_id, $post_data, $current_time);
meta_refresh(3, $meta_url);
@@ -564,7 +565,10 @@ if ($mode == 'edit')
$orig_poll_options_size = sizeof($post_data['poll_options']);
$message_parser = new parse_message();
+/* @var $plupload \phpbb\plupload\plupload */
$plupload = $phpbb_container->get('plupload');
+
+/* @var $mimetype_guesser \phpbb\mimetype\guesser */
$mimetype_guesser = $phpbb_container->get('mimetype.guesser');
$message_parser->set_plupload($plupload);
$message_parser->set_mimetype_guesser($mimetype_guesser);
@@ -680,9 +684,9 @@ $quote_status = true;
// Save Draft
if ($save && $user->data['is_registered'] && $auth->acl_get('u_savedrafts') && ($mode == 'reply' || $mode == 'post' || $mode == 'quote'))
{
- $subject = utf8_normalize_nfc(request_var('subject', '', true));
+ $subject = $request->variable('subject', '', true);
$subject = (!$subject && $mode != 'post') ? $post_data['topic_title'] : $subject;
- $message = utf8_normalize_nfc(request_var('message', '', true));
+ $message = $request->variable('message', '', true);
if ($subject && $message)
{
@@ -752,11 +756,11 @@ if ($save && $user->data['is_registered'] && $auth->acl_get('u_savedrafts') && (
if (is_bool($default))
{
// Use the string representation
- $hidden_fields[$name] = request_var($name, '');
+ $hidden_fields[$name] = $request->variable($name, '');
}
else
{
- $hidden_fields[$name] = request_var($name, $default);
+ $hidden_fields[$name] = $request->variable($name, $default);
}
}
@@ -813,20 +817,20 @@ if ($load && ($mode == 'reply' || $mode == 'quote' || $mode == 'post') && $post_
if ($submit || $preview || $refresh)
{
- $post_data['topic_cur_post_id'] = request_var('topic_cur_post_id', 0);
- $post_data['post_subject'] = utf8_normalize_nfc(request_var('subject', '', true));
- $message_parser->message = utf8_normalize_nfc(request_var('message', '', true));
+ $post_data['topic_cur_post_id'] = $request->variable('topic_cur_post_id', 0);
+ $post_data['post_subject'] = $request->variable('subject', '', true);
+ $message_parser->message = $request->variable('message', '', true);
- $post_data['username'] = utf8_normalize_nfc(request_var('username', $post_data['username'], true));
- $post_data['post_edit_reason'] = ($request->variable('edit_reason', false, false, \phpbb\request\request_interface::POST) && $mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? utf8_normalize_nfc(request_var('edit_reason', '', true)) : '';
+ $post_data['username'] = $request->variable('username', $post_data['username'], true);
+ $post_data['post_edit_reason'] = ($request->variable('edit_reason', false, false, \phpbb\request\request_interface::POST) && $mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? $request->variable('edit_reason', '', true) : '';
$post_data['orig_topic_type'] = $post_data['topic_type'];
- $post_data['topic_type'] = request_var('topic_type', (($mode != 'post') ? (int) $post_data['topic_type'] : POST_NORMAL));
- $post_data['topic_time_limit'] = request_var('topic_time_limit', (($mode != 'post') ? (int) $post_data['topic_time_limit'] : 0));
+ $post_data['topic_type'] = $request->variable('topic_type', (($mode != 'post') ? (int) $post_data['topic_type'] : POST_NORMAL));
+ $post_data['topic_time_limit'] = $request->variable('topic_time_limit', (($mode != 'post') ? (int) $post_data['topic_time_limit'] : 0));
if ($post_data['enable_icons'] && $auth->acl_get('f_icons', $forum_id))
{
- $post_data['icon_id'] = request_var('icon', (int) $post_data['icon_id']);
+ $post_data['icon_id'] = $request->variable('icon', (int) $post_data['icon_id']);
}
$post_data['enable_bbcode'] = (!$bbcode_status || isset($_POST['disable_bbcode'])) ? false : true;
@@ -891,10 +895,10 @@ if ($submit || $preview || $refresh)
}
else
{
- $post_data['poll_title'] = utf8_normalize_nfc(request_var('poll_title', '', true));
- $post_data['poll_length'] = request_var('poll_length', 0);
- $post_data['poll_option_text'] = utf8_normalize_nfc(request_var('poll_option_text', '', true));
- $post_data['poll_max_options'] = request_var('poll_max_options', 1);
+ $post_data['poll_title'] = $request->variable('poll_title', '', true);
+ $post_data['poll_length'] = $request->variable('poll_length', 0);
+ $post_data['poll_option_text'] = $request->variable('poll_option_text', '', true);
+ $post_data['poll_max_options'] = $request->variable('poll_max_options', 1);
$post_data['poll_vote_change'] = ($auth->acl_get('f_votechg', $forum_id) && $auth->acl_get('f_vote', $forum_id) && isset($_POST['poll_vote_change'])) ? 1 : 0;
}
@@ -963,8 +967,8 @@ if ($submit || $preview || $refresh)
// Notify and show user the changed post
if ($mode == 'edit' && $post_data['forum_flags'] & FORUM_FLAG_POST_REVIEW)
{
- $edit_post_message_checksum = request_var('edit_post_message_checksum', '');
- $edit_post_subject_checksum = request_var('edit_post_subject_checksum', '');
+ $edit_post_message_checksum = $request->variable('edit_post_message_checksum', '');
+ $edit_post_subject_checksum = $request->variable('edit_post_subject_checksum', '');
// $post_data['post_checksum'] is the checksum of the post submitted in the meantime
// $message_md5 is the checksum of the post we're about to submit
@@ -1078,9 +1082,9 @@ if ($submit || $preview || $refresh)
if ($config['enable_post_confirm'] && !$user->data['is_registered'] && in_array($mode, array('quote', 'post', 'reply')))
{
$captcha_data = array(
- 'message' => utf8_normalize_nfc(request_var('message', '', true)),
- 'subject' => utf8_normalize_nfc(request_var('subject', '', true)),
- 'username' => utf8_normalize_nfc(request_var('username', '', true)),
+ 'message' => $request->variable('message', '', true),
+ 'subject' => $request->variable('subject', '', true),
+ 'username' => $request->variable('username', '', true),
);
$vc_response = $captcha->validate($captcha_data);
if ($vc_response)
@@ -1198,6 +1202,9 @@ if ($submit || $preview || $refresh)
switch ($post_data['topic_type'])
{
case POST_GLOBAL:
+ $auth_option = 'f_announce_global';
+ break;
+
case POST_ANNOUNCE:
$auth_option = 'f_announce';
break;
@@ -1300,7 +1307,11 @@ if ($submit || $preview || $refresh)
$user_lock = ($auth->acl_get('f_user_lock', $forum_id) && $user->data['is_registered'] && $user->data['user_id'] == $post_data['topic_poster']) ? 'USER_' : '';
- add_log('mod', $forum_id, $topic_id, 'LOG_' . $user_lock . (($change_topic_status == ITEM_LOCKED) ? 'LOCK' : 'UNLOCK'), $post_data['topic_title']);
+ $phpbb_log->add('mod', $user->data['user_id'], $user->ip, 'LOG_' . $user_lock . (($change_topic_status == ITEM_LOCKED) ? 'LOCK' : 'UNLOCK'), false, array(
+ 'forum_id' => $forum_id,
+ 'topic_id' => $topic_id,
+ $post_data['topic_title']
+ ));
}
// Lock/Unlock Post Edit
@@ -1481,14 +1492,11 @@ if (!sizeof($error) && $preview)
// Signature
if ($post_data['enable_sig'] && $config['allow_sig'] && $preview_signature && $auth->acl_get('f_sigs', $forum_id))
{
- $parse_sig = new parse_message($preview_signature);
- $parse_sig->bbcode_uid = $preview_signature_uid;
- $parse_sig->bbcode_bitfield = $preview_signature_bitfield;
-
- // Not sure about parameters for bbcode/smilies/urls... in signatures
- $parse_sig->format_display($config['allow_sig_bbcode'], $config['allow_sig_links'], $config['allow_sig_smilies']);
- $preview_signature = $parse_sig->message;
- unset($parse_sig);
+ $flags = ($config['allow_sig_bbcode']) ? OPTION_FLAG_BBCODE : 0;
+ $flags |= ($config['allow_sig_links']) ? OPTION_FLAG_LINKS : 0;
+ $flags |= ($config['allow_sig_smilies']) ? OPTION_FLAG_SMILIES : 0;
+
+ $preview_signature = generate_text_for_display($preview_signature, $preview_signature_uid, $preview_signature_bitfield, $flags, false);
}
else
{
@@ -1590,7 +1598,16 @@ if ($generate_quote)
{
if ($config['allow_bbcode'])
{
- $message_parser->message = '[quote=&quot;' . $post_data['quote_username'] . '&quot;]' . censor_text(trim($message_parser->message)) . "[/quote]\n";
+ $message_parser->message = $phpbb_container->get('text_formatter.utils')->generate_quote(
+ censor_text($message_parser->message),
+ array(
+ 'author' => $post_data['quote_username'],
+ 'post_id' => $post_data['post_id'],
+ 'time' => $post_data['post_time'],
+ 'user_id' => $post_data['poster_id'],
+ )
+ );
+ $message_parser->message .= "\n\n";
}
else
{
@@ -1712,7 +1729,7 @@ if ($config['enable_post_confirm'] && !$user->data['is_registered'] && (isset($c
$s_hidden_fields = ($mode == 'reply' || $mode == 'quote') ? '<input type="hidden" name="topic_cur_post_id" value="' . $post_data['topic_last_post_id'] . '" />' : '';
$s_hidden_fields .= '<input type="hidden" name="lastclick" value="' . $current_time . '" />';
-$s_hidden_fields .= ($draft_id || isset($_REQUEST['draft_loaded'])) ? '<input type="hidden" name="draft_loaded" value="' . request_var('draft_loaded', $draft_id) . '" />' : '';
+$s_hidden_fields .= ($draft_id || isset($_REQUEST['draft_loaded'])) ? '<input type="hidden" name="draft_loaded" value="' . $request->variable('draft_loaded', $draft_id) . '" />' : '';
if ($mode == 'edit')
{
@@ -1731,6 +1748,8 @@ if (isset($captcha) && $captcha->is_solved() !== false)
$form_enctype = (@ini_get('file_uploads') == '0' || strtolower(@ini_get('file_uploads')) == 'off' || !$config['allow_attachments'] || !$auth->acl_get('u_attach') || !$auth->acl_get('f_attach', $forum_id)) ? '' : ' enctype="multipart/form-data"';
add_form_key('posting');
+/** @var \phpbb\controller\helper $controller_helper */
+$controller_helper = $phpbb_container->get('controller.helper');
// Build array of variables for main posting page
$page_data = array(
@@ -1745,7 +1764,7 @@ $page_data = array(
'USERNAME' => ((!$preview && $mode != 'quote') || $preview) ? $post_data['username'] : '',
'SUBJECT' => $post_data['post_subject'],
'MESSAGE' => $post_data['post_text'],
- 'BBCODE_STATUS' => ($bbcode_status) ? sprintf($user->lang['BBCODE_IS_ON'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>') : sprintf($user->lang['BBCODE_IS_OFF'], '<a href="' . append_sid("{$phpbb_root_path}faq.$phpEx", 'mode=bbcode') . '">', '</a>'),
+ 'BBCODE_STATUS' => $user->lang(($bbcode_status ? 'BBCODE_IS_ON' : 'BBCODE_IS_OFF'), '<a href="' . $controller_helper->route('phpbb_help_bbcode_controller') . '">', '</a>'),
'IMG_STATUS' => ($img_status) ? $user->lang['IMAGES_ARE_ON'] : $user->lang['IMAGES_ARE_OFF'],
'FLASH_STATUS' => ($flash_status) ? $user->lang['FLASH_IS_ON'] : $user->lang['FLASH_IS_OFF'],
'SMILIES_STATUS' => ($smilies_status) ? $user->lang['SMILIES_ARE_ON'] : $user->lang['SMILIES_ARE_OFF'],
diff --git a/phpBB/report.php b/phpBB/report.php
index 3ea6bb40c5..bb26b972aa 100644
--- a/phpBB/report.php
+++ b/phpBB/report.php
@@ -11,6 +11,8 @@
*
*/
+use Symfony\Component\HttpFoundation\RedirectResponse;
+
/**
* @ignore
*/
@@ -18,321 +20,22 @@ define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
-include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
-$user->setup('mcp');
-
-$forum_id = request_var('f', 0);
-$post_id = request_var('p', 0);
-$pm_id = request_var('pm', 0);
-$reason_id = request_var('reason_id', 0);
-$report_text = utf8_normalize_nfc(request_var('report_text', '', true));
-$user_notify = ($user->data['is_registered']) ? request_var('notify', 0) : false;
-
-$submit = (isset($_POST['submit'])) ? true : false;
-
-if (!$post_id && (!$pm_id || !$config['allow_pm_report']))
-{
- trigger_error('NO_POST_SELECTED');
-}
-
-if ($post_id)
-{
- $redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;p=$post_id") . "#p$post_id";
- $return_forum_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", "f=$forum_id");
- $pm_id = 0;
-}
-else
-{
- $redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=pm&mode=view&p=$pm_id");
- $return_forum_url = '';
- $post_id = 0;
- $forum_id = 0;
-}
-
-// Has the report been cancelled?
-if (isset($_POST['cancel']))
-{
- redirect($redirect_url);
-}
-
-if ($post_id)
-{
- // Grab all relevant data
- $sql = 'SELECT t.*, p.*
- FROM ' . POSTS_TABLE . ' p, ' . TOPICS_TABLE . " t
- WHERE p.post_id = $post_id
- AND p.topic_id = t.topic_id";
- $result = $db->sql_query($sql);
- $report_data = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$report_data)
- {
- trigger_error('POST_NOT_EXIST');
- }
-
- $forum_id = (int) $report_data['forum_id'];
- $topic_id = (int) $report_data['topic_id'];
- $reported_post_text = $report_data['post_text'];
- $reported_post_bitfield = $report_data['bbcode_bitfield'];
- $reported_post_uid = $report_data['bbcode_uid'];
- $reported_post_enable_bbcode = $report_data['enable_bbcode'];
- $reported_post_enable_smilies = $report_data['enable_smilies'];
- $reported_post_enable_magic_url = $report_data['enable_magic_url'];
-
- $sql = 'SELECT *
- FROM ' . FORUMS_TABLE . '
- WHERE forum_id = ' . $forum_id;
- $result = $db->sql_query($sql);
- $forum_data = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$forum_data)
- {
- trigger_error('FORUM_NOT_EXIST');
- }
-
- // 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))
- {
- trigger_error($error);
- }
- }
- unset($acl_check_ary);
-
- if ($report_data['post_reported'])
- {
- $message = $user->lang['ALREADY_REPORTED'];
- $message .= '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>');
- $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . $return_forum_url . '">', '</a>');
- trigger_error($message);
- }
-}
-else
-{
- // Grab all relevant data
- $sql = 'SELECT p.*, pt.*
- FROM ' . PRIVMSGS_TABLE . ' p, ' . PRIVMSGS_TO_TABLE . " pt
- WHERE p.msg_id = $pm_id
- AND p.msg_id = pt.msg_id
- AND (p.author_id = " . $user->data['user_id'] . " OR pt.user_id = " . $user->data['user_id'] . ")";
- $result = $db->sql_query($sql);
- $report_data = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
-
- if (!$report_data)
- {
- $user->add_lang('ucp');
- trigger_error('NO_MESSAGE');
- }
-
- if ($report_data['message_reported'])
- {
- $message = $user->lang['ALREADY_REPORTED_PM'];
- $message .= '<br /><br />' . sprintf($user->lang['RETURN_PM'], '<a href="' . $redirect_url . '">', '</a>');
- trigger_error($message);
- }
-
- $reported_post_text = $report_data['message_text'];
- $reported_post_bitfield = $report_data['bbcode_bitfield'];
- $reported_post_uid = $report_data['bbcode_uid'];
- $reported_post_enable_bbcode = $report_data['enable_bbcode'];
- $reported_post_enable_smilies = $report_data['enable_smilies'];
- $reported_post_enable_magic_url = $report_data['enable_magic_url'];
-}
-
-if ($config['enable_post_confirm'] && !$user->data['is_registered'])
-{
- $captcha = $phpbb_container->get('captcha.factory')->get_instance($config['captcha_plugin']);
- $captcha->init(CONFIRM_REPORT);
-}
-
-$error = array();
-$s_hidden_fields = '';
-
-// Submit report?
-if ($submit && $reason_id)
-{
- if (isset($captcha))
- {
- $visual_confirmation_response = $captcha->validate();
- if ($visual_confirmation_response)
- {
- $error[] = $visual_confirmation_response;
- }
- }
-
- $sql = 'SELECT *
- FROM ' . REPORTS_REASONS_TABLE . "
- WHERE reason_id = $reason_id";
- $result = $db->sql_query($sql);
- $row = $db->sql_fetchrow($result);
- $db->sql_freeresult($result);
- if (!$row || (!$report_text && strtolower($row['reason_title']) == 'other'))
- {
- $error[] = $user->lang('EMPTY_REPORT');
- }
+$post_id = $request->variable('p', 0);
+$pm_id = $request->variable('pm', 0);
- if (!sizeof($error))
- {
- if (isset($captcha))
- {
- $captcha->reset();
- }
+$redirect_route_name = ($pm_id === 0) ? 'phpbb_report_post_controller' : 'phpbb_report_pm_controller';
- $sql_ary = array(
- 'reason_id' => (int) $reason_id,
- 'post_id' => $post_id,
- 'pm_id' => $pm_id,
- 'user_id' => (int) $user->data['user_id'],
- 'user_notify' => (int) $user_notify,
- 'report_closed' => 0,
- 'report_time' => (int) time(),
- 'report_text' => (string) $report_text,
- 'reported_post_text' => $reported_post_text,
- 'reported_post_uid' => $reported_post_uid,
- 'reported_post_bitfield' => $reported_post_bitfield,
- 'reported_post_enable_bbcode' => $reported_post_enable_bbcode,
- 'reported_post_enable_smilies' => $reported_post_enable_smilies,
- 'reported_post_enable_magic_url' => $reported_post_enable_magic_url,
- );
-
- $sql = 'INSERT INTO ' . REPORTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
- $db->sql_query($sql);
- $report_id = $db->sql_nextid();
-
- $phpbb_notifications = $phpbb_container->get('notification_manager');
-
- if ($post_id)
- {
- $sql = 'UPDATE ' . POSTS_TABLE . '
- SET post_reported = 1
- WHERE post_id = ' . $post_id;
- $db->sql_query($sql);
-
- if (!$report_data['topic_reported'])
- {
- $sql = 'UPDATE ' . TOPICS_TABLE . '
- SET topic_reported = 1
- WHERE topic_id = ' . $report_data['topic_id'] . '
- OR topic_moved_id = ' . $report_data['topic_id'];
- $db->sql_query($sql);
- }
-
- $lang_return = $user->lang['RETURN_TOPIC'];
- $lang_success = $user->lang['POST_REPORTED_SUCCESS'];
-
- $phpbb_notifications->add_notifications('notification.type.report_post', array_merge($report_data, $row, $forum_data, array(
- 'report_text' => $report_text,
- )));
- }
- else
- {
- $sql = 'UPDATE ' . PRIVMSGS_TABLE . '
- SET message_reported = 1
- WHERE msg_id = ' . $pm_id;
- $db->sql_query($sql);
-
- $sql_ary = array(
- 'msg_id' => $pm_id,
- 'user_id' => ANONYMOUS,
- 'author_id' => (int) $report_data['author_id'],
- 'pm_deleted' => 0,
- 'pm_new' => 0,
- 'pm_unread' => 0,
- 'pm_replied' => 0,
- 'pm_marked' => 0,
- 'pm_forwarded' => 0,
- 'folder_id' => PRIVMSGS_INBOX,
- );
-
- $sql = 'INSERT INTO ' . PRIVMSGS_TO_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
- $db->sql_query($sql);
-
- $lang_return = $user->lang['RETURN_PM'];
- $lang_success = $user->lang['PM_REPORTED_SUCCESS'];
-
- $phpbb_notifications->add_notifications('notification.type.report_pm', array_merge($report_data, $row, array(
- 'report_text' => $report_text,
- 'from_user_id' => $report_data['author_id'],
- 'report_id' => $report_id,
- )));
- }
-
- meta_refresh(3, $redirect_url);
-
- $message = $lang_success . '<br /><br />' . sprintf($lang_return, '<a href="' . $redirect_url . '">', '</a>');
- if ($return_forum_url)
- {
- $message .= '<br /><br />' . sprintf($user->lang['RETURN_FORUM'], '<a href="' . $return_forum_url . '">', '</a>');
- }
- trigger_error($message);
- }
- else if (isset($captcha) && $captcha->is_solved() !== false)
- {
- $s_hidden_fields .= build_hidden_fields($captcha->get_hidden_fields());
- }
-}
-
-// Generate the reasons
-display_reasons($reason_id);
-
-$page_title = ($pm_id) ? $user->lang['REPORT_MESSAGE'] : $user->lang['REPORT_POST'];
-
-if (isset($captcha) && $captcha->is_solved() === false)
-{
- $template->assign_vars(array(
- 'S_CONFIRM_CODE' => true,
- 'CAPTCHA_TEMPLATE' => $captcha->get_template(),
- ));
-}
-
-$template->assign_vars(array(
- 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '',
- 'S_REPORT_POST' => ($pm_id) ? false : true,
- 'REPORT_TEXT' => $report_text,
- 'S_REPORT_ACTION' => append_sid("{$phpbb_root_path}report.$phpEx", 'f=' . $forum_id . '&amp;p=' . $post_id . '&amp;pm=' . $pm_id),
- 'S_HIDDEN_FIELDS' => (sizeof($s_hidden_fields)) ? $s_hidden_fields : null,
-
- 'S_NOTIFY' => $user_notify,
- 'S_CAN_NOTIFY' => ($user->data['is_registered']) ? true : false,
- 'S_IN_REPORT' => true,
-));
-
-generate_forum_nav($forum_data);
-
-// Start output of page
-page_header($page_title);
-
-$template->set_filenames(array(
- 'body' => 'report_body.html')
+/** @var \phpbb\controller\helper $controller_helper */
+$controller_helper = $phpbb_container->get('controller.helper');
+$response = new RedirectResponse(
+ $controller_helper->route($redirect_route_name, array(
+ 'id' => ($pm_id === 0) ? $post_id : $pm_id,
+ )),
+ 301
);
-
-page_footer();
+$response->send();
diff --git a/phpBB/search.php b/phpBB/search.php
index d8f0bd1426..a211b113c0 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -25,30 +25,30 @@ $auth->acl($user->data);
$user->setup('search');
// Define initial vars
-$mode = request_var('mode', '');
-$search_id = request_var('search_id', '');
-$start = max(request_var('start', 0), 0);
-$post_id = request_var('p', 0);
-$topic_id = request_var('t', 0);
-$view = request_var('view', '');
-
-$submit = request_var('submit', false);
-$keywords = utf8_normalize_nfc(request_var('keywords', '', true));
-$add_keywords = utf8_normalize_nfc(request_var('add_keywords', '', true));
-$author = request_var('author', '', true);
-$author_id = request_var('author_id', 0);
-$show_results = ($topic_id) ? 'posts' : request_var('sr', 'posts');
+$mode = $request->variable('mode', '');
+$search_id = $request->variable('search_id', '');
+$start = max($request->variable('start', 0), 0);
+$post_id = $request->variable('p', 0);
+$topic_id = $request->variable('t', 0);
+$view = $request->variable('view', '');
+
+$submit = $request->variable('submit', false);
+$keywords = $request->variable('keywords', '', true);
+$add_keywords = $request->variable('add_keywords', '', true);
+$author = $request->variable('author', '', true);
+$author_id = $request->variable('author_id', 0);
+$show_results = ($topic_id) ? 'posts' : $request->variable('sr', 'posts');
$show_results = ($show_results == 'posts') ? 'posts' : 'topics';
-$search_terms = request_var('terms', 'all');
-$search_fields = request_var('sf', 'all');
-$search_child = request_var('sc', true);
+$search_terms = $request->variable('terms', 'all');
+$search_fields = $request->variable('sf', 'all');
+$search_child = $request->variable('sc', true);
-$sort_days = request_var('st', 0);
-$sort_key = request_var('sk', 't');
-$sort_dir = request_var('sd', 'd');
+$sort_days = $request->variable('st', 0);
+$sort_key = $request->variable('sk', 't');
+$sort_dir = $request->variable('sd', 'd');
-$return_chars = request_var('ch', ($topic_id) ? -1 : 300);
-$search_forum = request_var('fid', array(0));
+$return_chars = $request->variable('ch', ($topic_id) ? -1 : 300);
+$search_forum = $request->variable('fid', array(0));
// We put login boxes for the case if search_id is newposts, egosearch or unreadposts
// because a guest should be able to log in even if guests search is not permitted
@@ -123,7 +123,10 @@ $sort_by_text = array('a' => $user->lang['SORT_AUTHOR'], 't' => $user->lang['SOR
$s_limit_days = $s_sort_key = $s_sort_dir = $u_sort_param = '';
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
+/* @var $phpbb_content_visibility \phpbb\content_visibility */
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
+
+/* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
if ($keywords || $author || $author_id || $search_id || $submit)
@@ -304,7 +307,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
if (!$keywords && sizeof($author_id_ary))
{
// if it is an author search we want to show topics by default
- $show_results = ($topic_id) ? 'posts' : request_var('sr', ($search_id == 'egosearch') ? 'topics' : 'posts');
+ $show_results = ($topic_id) ? 'posts' : $request->variable('sr', ($search_id == 'egosearch') ? 'topics' : 'posts');
$show_results = ($show_results == 'posts') ? 'posts' : 'topics';
}
@@ -343,7 +346,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
$show_results = 'topics';
$sort_key = 't';
$sort_dir = 'd';
- $sort_days = request_var('st', 7);
+ $sort_days = $request->variable('st', 7);
$sort_by_sql['t'] = 't.topic_last_post_time';
gen_sort_selects($limit_days, $sort_by_text, $sort_days, $sort_key, $sort_dir, $s_limit_days, $s_sort_key, $s_sort_dir, $u_sort_param);
@@ -363,7 +366,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
case 'unanswered':
$l_search_title = $user->lang['SEARCH_UNANSWERED'];
- $show_results = request_var('sr', 'topics');
+ $show_results = $request->variable('sr', 'topics');
$show_results = ($show_results == 'posts') ? 'posts' : 'topics';
$sort_by_sql['t'] = ($show_results == 'posts') ? 'p.post_time' : 't.topic_last_post_time';
$sort_by_sql['s'] = ($show_results == 'posts') ? 'p.post_subject' : 't.topic_title';
@@ -432,7 +435,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
case 'newposts':
$l_search_title = $user->lang['SEARCH_NEW'];
// force sorting
- $show_results = (request_var('sr', 'topics') == 'posts') ? 'posts' : 'topics';
+ $show_results = ($request->variable('sr', 'topics') == 'posts') ? 'posts' : 'topics';
$sort_key = 't';
$sort_dir = 'd';
$sort_by_sql['t'] = ($show_results == 'posts') ? 'p.post_time' : 't.topic_last_post_time';
diff --git a/phpBB/styles/all/template/feed.xml.twig b/phpBB/styles/all/template/feed.xml.twig
new file mode 100644
index 0000000000..91467c62cd
--- /dev/null
+++ b/phpBB/styles/all/template/feed.xml.twig
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ FEED_LANG }}">
+ <link rel="self" type="application/atom+xml" href="{{ SELF_LINK }}" />
+
+ {% if not FEED_TITLE is empty %}<title>{{ FEED_TITLE }}</title>{% endif %}
+
+ {% if not FEED_SUBTITLE is empty %}<subtitle>{{ FEED_SUBTITLE }}</subtitle>{% endif %}
+
+ {% if not FEED_LINK is empty %}<link href="{{ FEED_LINK }}" />{% endif %}
+
+ <updated>{{ FEED_UPDATED }}</updated>
+
+ <author><name><![CDATA[{{ FEED_AUTHOR }}]]></name></author>
+ <id>{{ SELF_LINK }}</id>
+
+ {% for row in FEED_ROWS %}
+ <entry>
+ {% if not row.author is empty %}<author><name><![CDATA[{{ row.author }}]]></name></author>{% endif %}
+
+ <updated>{% if not row.updated is empty %}{{ row.updated }} {% else %}{{ row.published }}{% endif %}</updated>
+
+ {% if not row.published is empty %}<published>{{ row.published }}</published>{% endif %}
+
+ <id>{{ row.link }}</id>
+ <link href="{{ row.link }}"/>
+ <title type="html"><![CDATA[{{ row.title }}]]></title>
+
+ {% if not row.category is empty and row.category_name is defined and row.category_name != '' %}
+ <category term="{{ row.category_name }}" scheme="{{ row.category }}" label="{{ row.category_name }}"/>
+ {% endif %}
+
+ <content type="html" xml:base="{{ row.link }}"><![CDATA[
+{{ row.description }}{% if not row.statistics is empty %}<p>{{ lang('STATISTICS') }}: {{ row.statistics }}</p>{% endif %}<hr />
+]]></content>
+ </entry>
+ {% endfor %}
+</feed>
diff --git a/phpBB/styles/prosilver/style.cfg b/phpBB/styles/prosilver/style.cfg
index 13433c389f..481b80d912 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.6
-phpbb_version = 3.1.6
+style_version = 3.2.0-a1-dev
+phpbb_version = 3.2.0-a1-dev
# Defining a different template bitfield
# template_bitfield = lNg=
diff --git a/phpBB/styles/prosilver/template/attachment.html b/phpBB/styles/prosilver/template/attachment.html
index 4546f53d6c..0978d9189e 100644
--- a/phpBB/styles/prosilver/template/attachment.html
+++ b/phpBB/styles/prosilver/template/attachment.html
@@ -29,36 +29,7 @@
</dl>
<!-- ENDIF -->
- <!-- IF _file.S_WM_FILE -->
- <!-- method used here from http://alistapart.com/articles/byebyeembed / autosizing seems to not work always, this will not fix -->
- <object width="320" height="285" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" id="wmstream_{_file.ATTACH_ID}">
- <param name="url" value="{_file.U_DOWNLOAD_LINK}" />
- <param name="showcontrols" value="1" />
- <param name="showdisplay" value="0" />
- <param name="showstatusbar" value="0" />
- <param name="autosize" value="1" />
- <param name="autostart" value="0" />
- <param name="visible" value="1" />
- <param name="animationstart" value="0" />
- <param name="loop" value="0" />
- <param name="src" value="{_file.U_DOWNLOAD_LINK}" />
- <!--[if !IE]>-->
- <object width="320" height="285" type="video/x-ms-wmv" data="{_file.U_DOWNLOAD_LINK}">
- <param name="src" value="{_file.U_DOWNLOAD_LINK}" />
- <param name="controller" value="1" />
- <param name="showcontrols" value="1" />
- <param name="showdisplay" value="0" />
- <param name="showstatusbar" value="0" />
- <param name="autosize" value="1" />
- <param name="autostart" value="0" />
- <param name="visible" value="1" />
- <param name="animationstart" value="0" />
- <param name="loop" value="0" />
- </object>
- <!--<![endif]-->
- </object>
-
- <!-- ELSEIF _file.S_FLASH_FILE -->
+ <!-- IF _file.S_FLASH_FILE -->
<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=5,0,0,0" width="{_file.WIDTH}" height="{_file.HEIGHT}">
<param name="movie" value="{_file.U_VIEW_LINK}" />
<param name="play" value="true" />
@@ -68,53 +39,7 @@
<param name="allowNetworking" value="internal" />
<embed src="{_file.U_VIEW_LINK}" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" width="{_file.WIDTH}" height="{_file.HEIGHT}" play="true" loop="true" quality="high" allowscriptaccess="never" allownetworking="internal"></embed>
</object>
- <!-- ELSEIF _file.S_QUICKTIME_FILE -->
- <object id="qtstream_{_file.ATTACH_ID}" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0" width="320" height="285">
- <param name="src" value="{_file.U_DOWNLOAD_LINK}" />
- <param name="controller" value="true" />
- <param name="autoplay" value="false" />
- <param name="type" value="video/quicktime" />
- <embed name="qtstream_{_file.ATTACH_ID}" src="{_file.U_DOWNLOAD_LINK}" pluginspage="http://www.apple.com/quicktime/download/" enablejavascript="true" controller="true" width="320" height="285" type="video/quicktime" autoplay="false"></embed>
- </object>
- <!-- ELSEIF _file.S_RM_FILE -->
- <object id="rmstream_{_file.ATTACH_ID}" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="200" height="50">
- <param name="src" value="{_file.U_DOWNLOAD_LINK}" />
- <param name="autostart" value="false" />
- <param name="controls" value="ImageWindow" />
- <param name="console" value="ctrls_{_file.ATTACH_ID}" />
- <param name="prefetch" value="false" />
- <embed name="rmstream_{_file.ATTACH_ID}" type="audio/x-pn-realaudio-plugin" src="{_file.U_DOWNLOAD_LINK}" width="0" height="0" autostart="false" controls="ImageWindow" console="ctrls_{_file.ATTACH_ID}" prefetch="false"></embed>
- </object>
- <br />
- <object id="ctrls_{_file.ATTACH_ID}" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="0" height="36">
- <param name="controls" value="ControlPanel" />
- <param name="console" value="ctrls_{_file.ATTACH_ID}" />
- <embed name="ctrls_{_file.ATTACH_ID}" type="audio/x-pn-realaudio-plugin" width="200" height="36" controls="ControlPanel" console="ctrls_{_file.ATTACH_ID}"></embed>
- </object>
-
- <script type="text/javascript">
- // <![CDATA[
- if (document.rmstream_{_file.ATTACH_ID}.GetClipWidth)
- {
- while (!document.rmstream_{_file.ATTACH_ID}.GetClipWidth())
- {
- }
-
- var width = document.rmstream_{_file.ATTACH_ID}.GetClipWidth();
- var height = document.rmstream_{_file.ATTACH_ID}.GetClipHeight();
-
- document.rmstream_{_file.ATTACH_ID}.width = width;
- document.rmstream_{_file.ATTACH_ID}.height = height;
- document.ctrls_{_file.ATTACH_ID}.width = width;
- }
- // ]]>
- </script>
- <!-- ENDIF -->
-
- <!-- IF _file.S_WM_FILE or _file.S_RM_FILE or _file.S_FLASH_FILE or _file.S_QUICKTIME_FILE -->
- <p>
- <!-- IF _file.S_QUICKTIME_FILE --><a href="#" onclick="play_qt_file(document.qtstream_{_file.ATTACH_ID}); return false;">[ {L_PLAY_QUICKTIME_FILE} ]</a> <!-- ENDIF -->
- <a href="{_file.U_DOWNLOAD_LINK}">{_file.DOWNLOAD_NAME}</a> [ {_file.FILESIZE} {_file.SIZE_LANG} | {_file.L_DOWNLOAD_COUNT} ]</p>
+ <p><a href="{_file.U_DOWNLOAD_LINK}">{_file.DOWNLOAD_NAME}</a> [ {_file.FILESIZE} {_file.SIZE_LANG} | {_file.L_DOWNLOAD_COUNT} ]</p>
<!-- ENDIF -->
<!-- EVENT attachment_file_append -->
diff --git a/phpBB/styles/prosilver/template/bbcode.html b/phpBB/styles/prosilver/template/bbcode.html
index 3e38d13a32..8c4e941092 100644
--- a/phpBB/styles/prosilver/template/bbcode.html
+++ b/phpBB/styles/prosilver/template/bbcode.html
@@ -11,9 +11,44 @@
<!-- BEGIN quote_username_open --><blockquote><div><cite>{USERNAME} {L_WROTE}{L_COLON}</cite><!-- END quote_username_open -->
<!-- BEGIN quote_open --><blockquote class="uncited"><div><!-- END quote_open -->
<!-- BEGIN quote_close --></div></blockquote><!-- END quote_close -->
+<!-- BEGIN quote_extended -->
+<blockquote>
+ <xsl:if test="not(@author)">
+ <xsl:attribute name="class">uncited</xsl:attribute>
+ </xsl:if>
+ <div>
+ <xsl:if test="@author">
+ <cite>
+ <xsl:choose>
+ <xsl:when test="@url">
+ <a href="{@url}" class="postlink"><xsl:value-of select="@author"/></a>
+ </xsl:when>
+ <xsl:when test="@profile_url">
+ <a href="{@profile_url}"><xsl:value-of select="@author"/></a>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="@author"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="$L_WROTE"/>
+ <xsl:value-of select="$L_COLON"/>
+ <xsl:if test="@post_url">
+ <xsl:text> </xsl:text>
+ <a href="{@post_url}" data-post-id="{@post_id}" onclick="if(document.getElementById(hash.substr(1)))href=hash">&#8593;</a>
+ </xsl:if>
+ <xsl:if test="@date">
+ <div class="responsive-hide"><xsl:value-of select="@date"/></div>
+ </xsl:if>
+ </cite>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </div>
+</blockquote>
+<!-- END quote_extended -->
-<!-- BEGIN code_open --><div class="codebox"><p>{L_CODE}{L_COLON} <a href="#" onclick="selectCode(this); return false;">{L_SELECT_ALL_CODE}</a></p><code><!-- END code_open -->
-<!-- BEGIN code_close --></code></div><!-- END code_close -->
+<!-- BEGIN code_open --><div class="codebox"><p>{L_CODE}{L_COLON} <a href="#" onclick="selectCode(this); return false;">{L_SELECT_ALL_CODE}</a></p><pre><code><!-- END code_open -->
+<!-- BEGIN code_close --></code></pre></div><!-- END code_close -->
<!-- BEGIN inline_attachment_open --><div class="inline-attachment"><!-- END inline_attachment_open -->
<!-- BEGIN inline_attachment_close --></div><!-- END inline_attachment_close -->
diff --git a/phpBB/styles/prosilver/template/captcha_recaptcha.html b/phpBB/styles/prosilver/template/captcha_recaptcha.html
index fee0f7423e..d3c0ea95d6 100644
--- a/phpBB/styles/prosilver/template/captcha_recaptcha.html
+++ b/phpBB/styles/prosilver/template/captcha_recaptcha.html
@@ -29,7 +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>
+ <a href="http://www.google.com/intl/{L_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/jumpbox.html b/phpBB/styles/prosilver/template/jumpbox.html
index 3096d08318..15c69aeed2 100644
--- a/phpBB/styles/prosilver/template/jumpbox.html
+++ b/phpBB/styles/prosilver/template/jumpbox.html
@@ -11,7 +11,7 @@
<!-- IF S_DISPLAY_JUMPBOX -->
- <div class="dropdown-container dropdown-container-{S_CONTENT_FLOW_END}<!-- IF not S_IN_MCP --> dropdown-up<!-- ENDIF --> dropdown-{S_CONTENT_FLOW_BEGIN} dropdown-button-control" id="jumpbox">
+ <div class="jumpbox dropdown-container dropdown-container-{S_CONTENT_FLOW_END}<!-- IF not S_IN_MCP --> dropdown-up<!-- ENDIF --> dropdown-{S_CONTENT_FLOW_BEGIN} dropdown-button-control" id="jumpbox">
<span title="<!-- IF S_IN_MCP and S_MERGE_SELECT -->{L_SELECT_TOPICS_FROM}<!-- ELSEIF S_IN_MCP -->{L_MODERATE_FORUM}<!-- ELSE -->{L_JUMP_TO}<!-- ENDIF -->" class="dropdown-trigger button dropdown-select">
<!-- IF S_IN_MCP and S_MERGE_SELECT -->{L_SELECT_TOPICS_FROM}<!-- ELSEIF S_IN_MCP -->{L_MODERATE_FORUM}<!-- ELSE -->{L_JUMP_TO}<!-- ENDIF -->
</span>
@@ -20,7 +20,7 @@
<ul class="dropdown-contents">
<!-- BEGIN jumpbox_forums -->
<!-- IF jumpbox_forums.FORUM_ID neq -1 -->
- <li><!-- BEGIN level -->&nbsp; &nbsp;<!-- END level --><a href="{jumpbox_forums.LINK}">{jumpbox_forums.FORUM_NAME}</a></li>
+ <li><a href="{jumpbox_forums.LINK}" class="<!-- IF jumpbox_forums.level -->jumpbox-sub-link<!-- ELSEIF jumpbox_forums.S_IS_CAT -->jumpbox-cat-link<!-- ELSE -->jumpbox-forum-link<!-- ENDIF -->"><!-- BEGIN level --><span class="spacer"></span><!-- END level --> <span><!-- IF jumpbox_forums.level --> &#8627; &nbsp;<!-- ENDIF --> {jumpbox_forums.FORUM_NAME}</span></a></li>
<!-- ENDIF -->
<!-- END jumpbox_forums -->
</ul>
@@ -29,4 +29,4 @@
<!-- ELSE -->
<br /><br />
-<!-- ENDIF -->
+<!-- ENDIF --> \ No newline at end of file
diff --git a/phpBB/styles/prosilver/template/mcp_forum.html b/phpBB/styles/prosilver/template/mcp_forum.html
index 9b472ccd30..0758dd6f27 100644
--- a/phpBB/styles/prosilver/template/mcp_forum.html
+++ b/phpBB/styles/prosilver/template/mcp_forum.html
@@ -133,10 +133,8 @@
<!-- IF S_CAN_SYNC --><option value="resync">{L_RESYNC}</option><!-- ENDIF -->
<!-- IF S_CAN_MAKE_NORMAL --><option value="make_normal">{L_MAKE_NORMAL}</option><!-- ENDIF -->
<!-- IF S_CAN_MAKE_STICKY --><option value="make_sticky">{L_MAKE_STICKY}</option><!-- ENDIF -->
- <!-- IF S_CAN_MAKE_ANNOUNCE -->
- <option value="make_announce">{L_MAKE_ANNOUNCE}</option>
- <option value="make_global">{L_MAKE_GLOBAL}</option>
- <!-- ENDIF -->
+ <!-- IF S_CAN_MAKE_ANNOUNCE --><option value="make_announce">{L_MAKE_ANNOUNCE}</option><!-- ENDIF -->
+ <!-- IF S_CAN_MAKE_ANNOUNCE_GLOBAL --><option value="make_global">{L_MAKE_GLOBAL}</option><!-- ENDIF -->
</select>
<input class="button2" type="submit" value="{L_SUBMIT}" />
<div><a href="#" onclick="marklist('mcp', 'topic_id_list', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp', 'topic_id_list', false); return false;">{L_UNMARK_ALL}</a></div>
diff --git a/phpBB/styles/prosilver/template/memberlist_body.html b/phpBB/styles/prosilver/template/memberlist_body.html
index 414569019e..3d61b7656f 100644
--- a/phpBB/styles/prosilver/template/memberlist_body.html
+++ b/phpBB/styles/prosilver/template/memberlist_body.html
@@ -25,7 +25,7 @@
<div class="action-bar top">
<div class="member-search panel">
- <!-- IF U_FIND_MEMBER and not S_SEARCH_USER --><a href="{U_FIND_MEMBER}" id="member_search" data-alt-text="{LA_HIDE_MEMBER_SEARCH}">{L_FIND_USERNAME}</a> &bull; <!-- ELSEIF S_SEARCH_USER and U_HIDE_FIND_MEMBER and not S_IN_SEARCH_POPUP --><a href="{U_HIDE_FIND_MEMBER}" id="member_search" data-alt-text="{LA_FIND_USERNAME}">{L_HIDE_MEMBER_SEARCH}</a> &bull; <!-- ENDIF -->
+ <!-- IF U_FIND_MEMBER and not S_SEARCH_USER --><a href="{U_FIND_MEMBER}" id="member_search" data-alt-text="{L_HIDE_MEMBER_SEARCH}">{L_FIND_USERNAME}</a> &bull; <!-- ELSEIF S_SEARCH_USER and U_HIDE_FIND_MEMBER and not S_IN_SEARCH_POPUP --><a href="{U_HIDE_FIND_MEMBER}" id="member_search" data-alt-text="{L_FIND_USERNAME}">{L_HIDE_MEMBER_SEARCH}</a> &bull; <!-- ENDIF -->
<strong>
<!-- BEGIN first_char -->
<a href="{first_char.U_SORT}">{first_char.DESC}</a>&nbsp;
diff --git a/phpBB/styles/prosilver/template/overall_header.html b/phpBB/styles/prosilver/template/overall_header.html
index 45f8eaa1c9..40e735c5c2 100644
--- a/phpBB/styles/prosilver/template/overall_header.html
+++ b/phpBB/styles/prosilver/template/overall_header.html
@@ -7,13 +7,13 @@
<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>
<!-- IF S_ENABLE_FEEDS -->
- <!-- IF S_ENABLE_FEEDS_OVERALL --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {SITENAME}" href="{U_FEED}"><!-- ENDIF -->
- <!-- IF S_ENABLE_FEEDS_NEWS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_NEWS}" href="{U_FEED}?mode=news"><!-- ENDIF -->
- <!-- IF S_ENABLE_FEEDS_FORUMS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_ALL_FORUMS}" href="{U_FEED}?mode=forums"><!-- ENDIF -->
- <!-- IF S_ENABLE_FEEDS_TOPICS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_TOPICS_NEW}" href="{U_FEED}?mode=topics"><!-- ENDIF -->
- <!-- IF S_ENABLE_FEEDS_TOPICS_ACTIVE --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_TOPICS_ACTIVE}" href="{U_FEED}?mode=topics_active"><!-- ENDIF -->
- <!-- IF S_ENABLE_FEEDS_FORUM and S_FORUM_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FORUM} - {FORUM_NAME}" href="{U_FEED}?f={S_FORUM_ID}"><!-- ENDIF -->
- <!-- IF S_ENABLE_FEEDS_TOPIC and S_TOPIC_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_TOPIC} - {TOPIC_TITLE}" href="{U_FEED}?f={S_FORUM_ID}&amp;t={S_TOPIC_ID}"><!-- ENDIF -->
+ <!-- IF S_ENABLE_FEEDS_OVERALL --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {SITENAME}" href="{{ path('phpbb_feed_index') }}"><!-- ENDIF -->
+ <!-- IF S_ENABLE_FEEDS_NEWS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_NEWS}" href="{{ path('phpbb_feed_news') }}"><!-- ENDIF -->
+ <!-- IF S_ENABLE_FEEDS_FORUMS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_ALL_FORUMS}" href="{{ path('phpbb_feed_forums') }}"><!-- ENDIF -->
+ <!-- IF S_ENABLE_FEEDS_TOPICS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_TOPICS_NEW}" href="{{ path('phpbb_feed_topics') }}"><!-- ENDIF -->
+ <!-- IF S_ENABLE_FEEDS_TOPICS_ACTIVE --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_TOPICS_ACTIVE}" href="{{ path('phpbb_feed_topics_active') }}"><!-- ENDIF -->
+ <!-- IF S_ENABLE_FEEDS_FORUM and S_FORUM_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FORUM} - {FORUM_NAME}" href="{{ path('phpbb_feed_forum', { forum_id : S_FORUM_ID } ) }}"><!-- ENDIF -->
+ <!-- IF S_ENABLE_FEEDS_TOPIC and S_TOPIC_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_TOPIC} - {TOPIC_TITLE}" href="{{ path('phpbb_feed_topic', { topic_id : S_TOPIC_ID } ) }}"><!-- ENDIF -->
<!-- EVENT overall_header_feeds -->
<!-- ENDIF -->
@@ -46,7 +46,7 @@
<!-- ENDIF -->
<link href="{T_STYLESHEET_LINK}" rel="stylesheet">
<link href="{T_STYLESHEET_LANG_LINK}" rel="stylesheet">
-<link href="{T_THEME_PATH}/responsive.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet" media="all and (max-width: 700px), all and (max-device-width: 700px)">
+<link href="{T_THEME_PATH}/responsive.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet" media="all and (max-width: 700px), all and (max-device-width: 700px)" />
<!-- IF S_CONTENT_DIRECTION eq 'rtl' -->
<link href="{T_THEME_PATH}/bidi.css?assets_version={T_ASSETS_VERSION}" rel="stylesheet">
diff --git a/phpBB/styles/prosilver/template/posting_topic_review.html b/phpBB/styles/prosilver/template/posting_topic_review.html
index 6909877196..fc7d0a2c63 100644
--- a/phpBB/styles/prosilver/template/posting_topic_review.html
+++ b/phpBB/styles/prosilver/template/posting_topic_review.html
@@ -35,7 +35,7 @@
<!-- ENDIF -->
<!-- IF topic_review_row.POSTER_QUOTE and topic_review_row.DECODED_MESSAGE -->
<li>
- <a href="#postingbox" onclick="addquote({topic_review_row.POST_ID}, '{topic_review_row.POSTER_QUOTE}', '{LA_WROTE}');" title="{L_QUOTE} {topic_review_row.POST_AUTHOR}" class="button icon-button quote-icon">
+ <a href="#postingbox" onclick="addquote({topic_review_row.POST_ID}, '{topic_review_row.POSTER_QUOTE}', '{LA_WROTE}', {post_id:{topic_review_row.POST_ID},time:{topic_review_row.POST_TIME},user_id:{topic_review_row.USER_ID}});" title="{L_QUOTE} {topic_review_row.POST_AUTHOR}" class="button icon-button quote-icon">
<span>{L_QUOTE} {topic_review_row.POST_AUTHOR}</span>
</a>
</li>
diff --git a/phpBB/styles/prosilver/template/ucp_notifications.html b/phpBB/styles/prosilver/template/ucp_notifications.html
index 500bae0c47..1255d7a0d0 100644
--- a/phpBB/styles/prosilver/template/ucp_notifications.html
+++ b/phpBB/styles/prosilver/template/ucp_notifications.html
@@ -16,7 +16,6 @@
<!-- BEGIN notification_methods -->
<th class="mark">{notification_methods.NAME}</th>
<!-- END notification_methods -->
- <th class="mark">{L_NOTIFICATIONS}</th>
</tr>
</thead>
<tbody>
@@ -34,7 +33,6 @@
<!-- BEGIN notification_methods -->
<td class="mark"><input type="checkbox" name="{notification_types.TYPE}_{notification_methods.METHOD}"<!-- IF notification_methods.SUBSCRIBED --> checked="checked"<!-- ENDIF --> /></td>
<!-- END notification_methods -->
- <td class="mark"><input type="checkbox" name="{notification_types.TYPE}_notification"<!-- IF notification_types.SUBSCRIBED --> checked="checked"<!-- ENDIF --> /></td>
</tr>
<!-- ENDIF -->
<!-- END notification_types -->
diff --git a/phpBB/styles/prosilver/template/ucp_pm_history.html b/phpBB/styles/prosilver/template/ucp_pm_history.html
index 28f217ef66..f4dc1c3b34 100644
--- a/phpBB/styles/prosilver/template/ucp_pm_history.html
+++ b/phpBB/styles/prosilver/template/ucp_pm_history.html
@@ -25,7 +25,7 @@
<!-- EVENT ucp_pm_history_post_buttons_before -->
<!-- IF history_row.U_QUOTE or history_row.MESSAGE_AUTHOR_QUOTE -->
<li>
- <a <!-- IF history_row.U_QUOTE -->href="{history_row.U_QUOTE}"<!-- ELSE -->href="#postingbox" onclick="addquote({history_row.MSG_ID}, '{history_row.MESSAGE_AUTHOR_QUOTE}', '{LA_WROTE}');"<!-- ENDIF --> title="{L_QUOTE} {history_row.MESSAGE_AUTHOR}" class="button icon-button quote-icon">
+ <a <!-- IF history_row.U_QUOTE -->href="{history_row.U_QUOTE}"<!-- ELSE -->href="#postingbox" onclick="addquote({history_row.MSG_ID}, '{history_row.MESSAGE_AUTHOR_QUOTE}', '{LA_WROTE}', {time:{history_row.MESSAGE_TIME},user_id:{history_row.USER_ID}});"<!-- ENDIF --> title="{L_QUOTE} {history_row.MESSAGE_AUTHOR}" class="button icon-button quote-icon">
<span>{L_QUOTE} {history_row.MESSAGE_AUTHOR}</span>
</a>
</li>
diff --git a/phpBB/styles/prosilver/theme/base.css b/phpBB/styles/prosilver/theme/base.css
new file mode 100644
index 0000000000..88f591492a
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/base.css
@@ -0,0 +1,115 @@
+/* --------------------------------------------------------------
+ $Base
+-------------------------------------------------------------- */
+
+/** {
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+*:before,
+*:after {
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}*/
+
+/* Define your base font-size here; most elements will inherit this. _NO__DOTCOMMA__AFTER__*/
+html {
+ font-size: 1em; /* Assuming 16px... */
+ line-height: 1.5; /* 24px (This is now our magic number; all subsequent margin-bottoms and line-heights want to be a multiple of this number in order to maintain vertical rhythm.) _NO__DOTCOMMA__AFTER__*/
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
+}
+
+body {
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
+ color: #333333;
+ background-color: #ffffff;
+}
+
+input,
+button,
+select,
+textarea {
+ font-family: inherit;
+ font-size: inherit;
+ line-height: inherit;
+}
+
+figure { margin: 0 }
+img { vertical-align: middle }
+
+hr {
+ margin-top: 20px;
+ margin-bottom: 20px;
+ border: 0;
+ border-top: 1px solid #e5e5e5;
+}
+
+a {
+ color: #428bca;
+ text-decoration: none;
+}
+
+a:hover,
+a:focus,
+a:active {
+ color: #2a6496;
+ text-decoration: underline;
+}
+
+blockquote,
+dl,
+dd,
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+figure,
+p,
+pre { margin: 0 }
+button {
+ background: transparent;
+ border: 0;
+ padding: 0;
+}
+
+/**
+ * Work around a Firefox/IE bug where the transparent `button` background
+ * results in a loss of the default `button` focus styles.
+ */
+button:focus {
+ outline: 1px dotted;
+ outline: 5px auto -webkit-focus-ring-color;
+}
+
+fieldset {
+ border: 0;
+ margin: 0;
+ padding: 0;
+}
+
+iframe { border: 0 }
+ol,
+ul {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+}
+
+/**
+ * Suppress the focus outline on links that cannot be accessed via keyboard.
+ * This prevents an unwanted focus outline from appearing around elements that
+ * might still respond to pointer events.
+ */
+[tabindex="-1"]:focus { outline: none !important }
+
+/**
+ * Remove double underline from recent version of firefox
+ */
+abbr[title] {
+ text-decoration: none;
+}
+
diff --git a/phpBB/styles/prosilver/theme/buttons.css b/phpBB/styles/prosilver/theme/buttons.css
index a816c7f7f2..c62ee832f2 100644
--- a/phpBB/styles/prosilver/theme/buttons.css
+++ b/phpBB/styles/prosilver/theme/buttons.css
@@ -4,7 +4,6 @@
.button {
cursor: pointer;
display: inline-block;
- height: 18px;
font-size: 1.2em;
white-space: nowrap;
border: 1px solid transparent;
@@ -28,7 +27,6 @@
display: inline-block;
float: right;
height: 12px;
- margin: 3px 0 0 2px;
width: 12px;
}
@@ -55,6 +53,10 @@
float: left;
}
+.buttons .button:before {
+ margin: 3px 0 0 2px;
+}
+
.buttons .button, .dropdown-select {
margin-right: 5px;
}
@@ -194,7 +196,7 @@ ul.linklist.bulletin > li.small-icon:before {
}
.post-buttons .icon-button {
- padding: 0 5px;
+ padding: 5px;
}
.hastouch .post-buttons .icon-button {
diff --git a/phpBB/styles/prosilver/theme/colours.css b/phpBB/styles/prosilver/theme/colours.css
index 29cf641df2..a4c1925cc7 100644
--- a/phpBB/styles/prosilver/theme/colours.css
+++ b/phpBB/styles/prosilver/theme/colours.css
@@ -48,23 +48,25 @@ hr {
}
.headerbar {
- background-color: #12A3EB;
- background-image: url("./images/bg_header.gif");
color: #FFFFFF;
}
-.navbar {
- background-color: #cadceb;
+.headerbar, .forumbg {
+ background-color: #12A3EB;
+ background-image: -webkit-linear-gradient(top, #6ACEFF 0%, #0076B1 2px, #12A3EB 92px, #12A3EB 100%);
+ background-image: linear-gradient(to bottom, #6ACEFF 0%,#0076B1 2px,#12A3EB 92px,#12A3EB 100%);
+ background-repeat: repeat-x;
}
.forabg {
- background-color: #0076b1;
- background-image: url("./images/bg_list.gif");
+ background-color: #0076B1;
+ background-image: -webkit-linear-gradient(top, #6ACEFF 0%, #12A3EB 2px, #0076B1 92px, #0076B1 100%);
+ background-image: linear-gradient(to bottom, #6ACEFF 0%,#12A3EB 2px,#0076B1 92px,#0076B1 100%);
+ background-repeat: repeat-x;
}
-.forumbg {
- background-color: #12A3EB;
- background-image: url("./images/bg_header.gif");
+.navbar {
+ background-color: #CADCEB;
}
.panel {
@@ -89,15 +91,15 @@ table.zebra-list tr:nth-child(odd) td, ul.zebra-list li:nth-child(odd) {
}
.bg2 {
- background-color: #e1ebf2;
+ background-color: #E1EBF2;
}
table.zebra-list tr:nth-child(even) td, ul.zebra-list li:nth-child(even) {
- background-color: #e1ebf2;
+ background-color: #E1EBF2;
}
.bg3 {
- background-color: #cadceb;
+ background-color: #CADCEB;
}
.ucprowbg {
@@ -197,6 +199,42 @@ dl.details dd {
background-image: url("./images/icon_pages.gif");
}
+.jumpbox .dropdown li {
+ border-top-color: #CCCCCC;
+}
+
+.jumpbox-cat-link {
+ background-color: #0076b1;
+ border-top-color: #0076B1;
+ color: #FFFFFF;
+}
+
+.jumpbox-cat-link:hover {
+ background-color: #12A3EB;
+ border-top-color: #12A3EB;
+ color: #FFFFFF;
+}
+
+.jumpbox-forum-link {
+ background-color: #E1EBF2;
+}
+
+.jumpbox-forum-link:hover {
+ background-color: #F6F4D0;
+}
+
+.jumpbox .dropdown .pointer-inner {
+ border-color: #E1EBF2 transparent;
+}
+
+.jumpbox-sub-link {
+ background-color: #E1EBF2;
+}
+
+.jumpbox-sub-link:hover {
+ background-color: #F1F8FF;
+}
+
/* Miscellaneous styles
---------------------------------------- */
@@ -316,8 +354,10 @@ Colours and backgrounds for content.css
-------------------------------------------------------------- */
ul.forums {
- background-color: #eef5f9;
- background-image: url("./images/gradient.gif");
+ background-color: #EEF5F9; /* Old browsers */ /* FF3.6+ */
+ background-image: -webkit-linear-gradient(top, #D2E0EB 0%, #EEF5F9 100%);
+ background-image: linear-gradient(to bottom, #D2E0EB 0%,#EEF5F9 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#D2E0EB', endColorstr='#EEF5F9',GradientType=0 ); /* IE6-9 */
}
ul.topiclist li {
@@ -329,7 +369,7 @@ ul.topiclist dd {
}
.rtl ul.topiclist dd {
- border-right-color: #fff;
+ border-right-color: #FFFFFF;
border-left-color: transparent;
}
@@ -600,12 +640,10 @@ Colours and backgrounds for buttons.css
-------------------------------------------------------------- */
.button {
border-color: #C7C3BF;
- background-color: #FFFFFF;
- background-image: -moz-linear-gradient(top, #FFFFFF, #E9E9E9);
- background-image: -webkit-linear-gradient(top, #FFFFFF, #E9E9E9);
- background-image: -o-linear-gradient(top, #FFFFFF, #E9E9E9);
- background-image: linear-gradient(to bottom, #FFFFFF, #E9E9E9);
- -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#FFFFFF', EndColorStr='#E9E9E9')";
+ background-color: #E9E9E9; /* Old browsers */ /* FF3.6+ */
+ background-image: -webkit-linear-gradient(top, #FFFFFF 0%, #E9E9E9 100%);
+ background-image: linear-gradient(to bottom, #FFFFFF 0%,#E9E9E9 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#FFFFFF', endColorstr='#E9E9E9',GradientType=0 ); /* IE6-9 */
box-shadow: 0 0 0 1px #FFFFFF inset;
-webkit-box-shadow: 0 0 0 1px #FFFFFF inset;
color: #D31141;
@@ -616,12 +654,11 @@ Colours and backgrounds for buttons.css
}
.button:hover, .dropdown-visible .dropdown-select, .nojs .dropdown-container:hover .dropdown-select {
- border-color: #0a8ed0;
- background-image: -moz-linear-gradient(top, #E9E9E9, #FFFFFF);
- background-image: -webkit-linear-gradient(top, #E9E9E9, #FFFFFF);
- background-image: -o-linear-gradient(top, #E9E9E9, #FFFFFF);
- background-image: linear-gradient(to bottom, #E9E9E9, #FFFFFF);
- -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorStr='#E9E9E9', EndColorStr='#FFFFFF')";
+ border-color: #0A8ED0;
+ background-color: #FFFFFF; /* Old browsers */ /* FF3.6+ */
+ background-image: -webkit-linear-gradient(top, #E9E9E9 0%, #FFFFFF 100%);
+ background-image: linear-gradient(to bottom, #E9E9E9 0%,#FFFFFF 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#E9E9E9', endColorstr='#FFFFFF',GradientType=0 ); /* IE6-9 */
text-shadow: 1px 1px 0 #FFFFFF, -1px -1px 0 #FFFFFF, -1px -1px 0 rgba(188, 42, 77, 0.2);
}
@@ -638,35 +675,36 @@ Colours and backgrounds for buttons.css
/* Icon images
---------------------------------------- */
-.icon-acp { background-image: url("./images/icon_acp.gif"); }
-.icon-bookmark { background-image: url("./images/icon_bookmark.gif"); }
-.icon-bump { background-image: url("./images/icon_bump.gif"); }
-.icon-contact { background-image: url("./images/icon_pm.gif"); }
-.icon-delete-cookies { background-image: url("./images/icon_delete_cookies.gif"); }
-.icon-download { background-image: url("./images/icon_download.gif"); }
-.icon-faq { background-image: url("./images/icon_faq.gif"); }
-.icon-home { background-image: url("./images/icon_home.gif"); }
-.icon-logout { background-image: url("./images/icon_logout.gif"); }
-.icon-mark { background-image: url("./images/icon_mark.gif"); }
-.icon-mcp { background-image: url("./images/icon_mcp.gif"); }
-.icon-members { background-image: url("./images/icon_members.gif"); }
-.icon-notification { background-image: url("./images/icon_notification.gif"); }
-.icon-pages { background-image: url("./images/icon_pages.gif"); }
-.icon-pm { background-image: url("./images/icon_pm.gif"); }
-.icon-print { background-image: url("./images/icon_print.gif"); }
-.icon-profile { background-image: url("./images/icon_profile.gif"); }
-.icon-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-new { background-image: url("./images/subforum_unread.gif"); }
-.icon-search-self { background-image: url("./images/icon_topic_latest.gif"); }
-.icon-search-unanswered { background-image: url("./images/icon_post_target.gif"); }
-.icon-search-unread { background-image: url("./images/subforum_unread.gif"); }
-.icon-sendemail { background-image: url("./images/icon_sendemail.gif"); }
-.icon-subscribe { background-image: url("./images/icon_subscribe.gif"); }
-.icon-team { background-image: url("./images/icon_team.gif"); }
-.icon-ucp { background-image: url("./images/icon_ucp.gif"); }
-.icon-unsubscribe { background-image: url("./images/icon_unsubscribe.gif"); }
+.icon-acp { background-image: url("./images/icon_acp.gif"); }
+.icon-bookmark { background-image: url("./images/icon_bookmark.gif"); }
+.icon-bump { background-image: url("./images/icon_bump.gif"); }
+.icon-contact { background-image: url("./images/icon_pm.gif"); }
+.icon-delete-cookies { background-image: url("./images/icon_delete_cookies.gif"); }
+.icon-download { background-image: url("./images/icon_download.gif"); }
+.icon-faq { background-image: url("./images/icon_faq.gif"); }
+.icon-home { background-image: url("./images/icon_home.gif"); }
+.icon-logout { background-image: url("./images/icon_logout.gif"); }
+.icon-mark { background-image: url("./images/icon_mark.gif"); }
+.icon-mcp { background-image: url("./images/icon_mcp.gif"); }
+.icon-members { background-image: url("./images/icon_members.gif"); }
+.icon-notification { background-image: url("./images/icon_notification.gif"); }
+.icon-pages { background-image: url("./images/icon_pages.gif"); }
+.icon-pm { background-image: url("./images/icon_pm.gif"); }
+.icon-print { background-image: url("./images/icon_print.gif"); }
+.icon-profile { background-image: url("./images/icon_profile.gif"); }
+.icon-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-new { background-image: url("./images/subforum_unread.gif"); }
+.icon-search-self { background-image: url("./images/icon_topic_latest.gif"); }
+.icon-search-unanswered { background-image: url("./images/icon_post_target.gif"); }
+.icon-search-unread { background-image: url("./images/subforum_unread.gif"); }
+.icon-sendemail { background-image: url("./images/icon_sendemail.gif"); }
+.icon-subscribe { background-image: url("./images/icon_subscribe.gif"); }
+.icon-team { background-image: url("./images/icon_team.gif"); }
+.icon-ucp { background-image: url("./images/icon_ucp.gif"); }
+.icon-unsubscribe { background-image: url("./images/icon_unsubscribe.gif"); }
/* Profile & navigation icons */
.contact-icon { background-image: url("./images/icons_contact.png"); }
@@ -774,14 +812,10 @@ ul.cplist {
#tabs .activetab > a,
#tabs .activetab > a:hover {
- background: #CADCEB;
- background: -moz-linear-gradient(top, #E2F2FF 0%, #CADCEB 100%);
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #E2F2FF), color-stop(100%, #CADCEB));
- background: -webkit-linear-gradient(top, #E2F2FF 0%, #CADCEB 100%);
- background: -o-linear-gradient(top, #E2F2FF 0%, #CADCEB 100%);
- background: -ms-linear-gradient(top, #E2F2FF 0%, #CADCEB 100%);
- background: linear-gradient(to bottom, #E2F2FF 0%, #CADCEB 100%);
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#E2F2FF', endColorstr='#CADCEB', GradientType=0 );
+ background-color: #CADCEB; /* Old browsers */ /* FF3.6+ */
+ background-image: -webkit-linear-gradient(top, #E2F2FF 0%, #CADCEB 100%);
+ background-image: linear-gradient(to bottom, #E2F2FF 0%,#CADCEB 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#E2F2FF', endColorstr='#CADCEB',GradientType=0 ); /* IE6-9 */
border-color: #CADCEB;
box-shadow: 0 1px 1px #F2F9FF inset;
color: #333333;
@@ -819,25 +853,17 @@ ul.cplist {
/* Link styles for the sub-section links */
#navigation a {
color: #333;
- background: #B4C4D1;
- background: -moz-linear-gradient(left, #B4C4D1 50%, #CADCEB 100%);
- background: -webkit-gradient(left top, right top, color-stop(50%, #B4C4D1), color-stop(100%, #CADCEB));
+ background: #CADCEB; /* Old browsers */ /* FF3.6+ */
background: -webkit-linear-gradient(left, #B4C4D1 50%, #CADCEB 100%);
- background: -o-linear-gradient(left, #B4C4D1 50%, #CADCEB 100%);
- background: -ms-linear-gradient(left, #B4C4D1 50%, #CADCEB 100%);
- background: linear-gradient(to right, #B4C4D1 50%, #CADCEB 100%);
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#B4C4D1', endColorstr='#CADCEB', GradientType=1 );
+ background: linear-gradient(to right, #B4C4D1 50%,#CADCEB 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#B4C4D1', endColorstr='#CADCEB',GradientType=1 ); /* IE6-9 */
}
.rtl #navigation a {
- background: #B4C4D1;
- background: -moz-linear-gradient(left, #CADCEB 0%, #B4C4D1 50%);
- background: -webkit-gradient(left top, right top, color-stop(0%, #CADCEB), color-stop(50%, #B4C4D1));
- background: -webkit-linear-gradient(left, #CADCEB 0%, #B4C4D1 50%);
- background: -o-linear-gradient(left, #CADCEB 0%, #B4C4D1 50%);
- background: -ms-linear-gradient(left, #CADCEB 0%, #B4C4D1 50%);
- background: linear-gradient(to right, #CADCEB 0%, #B4C4D1 50%);
- filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#CADCEB', endColorstr='#B4C4D1', GradientType=1 );
+ background: #B4C4D1; /* Old browsers */ /* FF3.6+ */
+ background: -webkit-linear-gradient(left, #CADCEB 50%, #B4C4D1 100%);
+ background: linear-gradient(to right, #CADCEB 50%,#B4C4D1 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#CADCEB', endColorstr='#B4C4D1',GradientType=1 ); /* IE6-9 */
}
#navigation a:hover {
@@ -879,7 +905,7 @@ ul.cplist {
/* Friends list */
.cp-mini {
- background-color: #eef5f9;
+ background-color: #EEF5F9;
}
dl.mini dt {
@@ -1024,8 +1050,10 @@ fieldset.quick-login input.inputbox {
a.button1, input.button1, input.button3, a.button2, input.button2 {
color: #000;
- background-color: #FAFAFA;
- background-image: url("./images/bg_button.gif");
+ background-color: #EFEFEF; /* Old browsers */ /* FF3.6+ */
+ background-image: -webkit-linear-gradient(top, #D2D2D2 0%, #EFEFEF 100%);
+ background-image: linear-gradient(to bottom, #D2D2D2 0%,#EFEFEF 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#D2D2D2', endColorstr='#EFEFEF',GradientType=0 ); /* IE6-9 */
}
a.button1, input.button1 {
@@ -1048,8 +1076,12 @@ a.button1, a.button2 {
/* Hover states */
a.button1:hover, input.button1:hover, a.button2:hover, input.button2:hover, input.button3:hover {
- border-color: #BC2A4D;
- color: #BC2A4D;
+ border-color: #D31141;
+ color: #D31141;
+ background-color: #D2D2D2; /* Old browsers */ /* FF3.6+ */
+ background-image: -webkit-linear-gradient(top, #EFEFEF 0%, #D2D2D2 100%);
+ background-image: linear-gradient(to bottom, #EFEFEF 0%,#D2D2D2 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#EFEFEF', endColorstr='#D2D2D2',GradientType=0 ); /* IE6-9 */
}
/* Focus states */
@@ -1104,13 +1136,10 @@ input.disabled {
}
.dropdown-extended .header {
- background: #F1F8FF;
- background: -moz-linear-gradient(top, #F1F8FF 0%, #CADCEB 100%);
- background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #F1F8FF), color-stop(100%, #CADCEB));
- background: -webkit-linear-gradient(top, #F1F8FF 0%, #CADCEB 100%);
- background: -o-linear-gradient(top, #F1F8FF 0%, #CADCEB 100%);
- background: -ms-linear-gradient(top, #F1F8FF 0%, #CADCEB 100%);
- background: linear-gradient(to bottom, #F1F8FF 0%, #CADCEB 100%);
+ background-color: #F1F8FF; /* Old browsers */ /* FF3.6+ */
+ background-image: -webkit-linear-gradient(top, #F1F8FF 0%, #CADCEB 100%);
+ background-image: linear-gradient(to bottom, #F1F8FF 0%,#CADCEB 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#F1F8FF', endColorstr='#CADCEB',GradientType=0 ); /* IE6-9 */
}
.dropdown .pointer {
@@ -1135,7 +1164,7 @@ ul.linklist li.responsive-menu a.responsive-menu-link:hover:before, ul.linklist
.dropdown .dropdown-contents {
background: #fff;
- border-color: #b9b9b9;
+ border-color: #B9B9B9;
box-shadow: 1px 3px 5px rgba(0, 0, 0, 0.2);
}
diff --git a/phpBB/styles/prosilver/theme/common.css b/phpBB/styles/prosilver/theme/common.css
index 19b0f65a2d..33293edf02 100644
--- a/phpBB/styles/prosilver/theme/common.css
+++ b/phpBB/styles/prosilver/theme/common.css
@@ -1,52 +1,3 @@
-/* CSS Reset http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126
----------------------------------------- */
-html, body, div, span, applet, object, iframe,
-h1, h2, h3, h4, h5, h6, p, blockquote, pre,
-a, abbr, acronym, address, big, cite, code,
-del, dfn, em, img, ins, kbd, q, s, samp,
-small, strike, strong, sub, sup, tt, var,
-b, u, i, center,
-dl, dt, dd, ol, ul, li,
-fieldset, form, label, legend,
-table, caption, tbody, tfoot, thead, tr, th, td,
-article, aside, canvas, details, embed,
-figure, figcaption, footer, header, hgroup,
-menu, nav, output, ruby, section, summary,
-time, mark, audio, video {
- margin: 0;
- padding: 0;
- border: 0;
- font-size: 100%;
- font: inherit;
- vertical-align: baseline;
-}
-/* HTML5 display-role reset for older browsers */
-article, aside, details, figcaption, figure,
-footer, header, hgroup, menu, nav, section {
- display: block;
-}
-body {
- line-height: 1;
-}
-ol, ul {
- list-style: none;
-}
-blockquote, q {
- quotes: none;
-}
-blockquote:before, blockquote:after,
-q:before, q:after {
- content: '';
- content: none;
-}
-table {
- border-collapse: collapse;
- border-spacing: 0;
-}
-abbr {
- text-decoration: none;
-}
-
/* General Markup Styles
---------------------------------------- */
html {
@@ -226,7 +177,6 @@ ol ol ul, ol ul ul, ul ol ul, ul ul ul {
/* Round cornered boxes and backgrounds
---------------------------------------- */
.headerbar {
- background: transparent none repeat-x 0 0;
margin-bottom: 4px;
padding: 5px;
border-radius: 7px;
@@ -238,7 +188,6 @@ ol ol ul, ol ul ul, ul ol ul, ul ul ul {
}
.forabg {
- background: transparent none repeat-x 0 0;
margin-bottom: 4px;
padding: 5px;
clear: both;
@@ -246,7 +195,6 @@ ol ol ul, ol ul ul, ul ol ul, ul ul ul {
}
.forumbg {
- background: transparent none repeat-x 0 0;
margin-bottom: 4px;
padding: 5px;
clear: both;
@@ -342,7 +290,7 @@ ul.linklist li.responsive-menu a.responsive-menu-link:before {
position: absolute;
left: 0;
top: 7px;
- height: .125em;
+ height: 2px;
width: 14px;
border-bottom: 0.125em solid transparent;
border-top: 0.375em double transparent;
@@ -536,9 +484,45 @@ ul.linklist.bulletin > li.no-bulletin:before {
position: relative;
min-width: 40px;
max-height: 300px;
- -webkit-box-sizing: border-box;
- -moz-box-sizing: border-box;
- box-sizing: border-box;
+}
+
+.dropdown-contents a {
+ display: block;
+ padding: 5px;
+}
+
+
+.jumpbox .dropdown li {
+ border-top: 1px solid transparent;
+}
+
+.jumpbox .dropdown-select {
+ margin: 0;
+}
+
+.jumpbox .dropdown-contents {
+ padding: 0;
+ text-decoration: none;
+}
+
+.jumpbox .dropdown-contents li {
+ padding: 0;
+}
+
+.jumpbox .dropdown-contents a {
+ margin-right: 20px;
+ padding: 5px 10px;
+ text-decoration: none;
+ width: 100%;
+}
+
+.jumpbox .spacer {
+ display: inline-block;
+ width: 0px;
+}
+
+.jumpbox .spacer + .spacer {
+ width: 20px;
}
.dropdown li {
@@ -841,9 +825,9 @@ fieldset.fields1 dl.pmlist dd.recipients {
border: 1px solid transparent;
border-radius: 2px;
display: block;
- font-size: 0.9em;
+ font-size: 10px;
font-weight: normal;
- line-height: 1.4em;
+ line-height: 14px;
min-width: 10px;
padding: 3px;
text-align: center;
@@ -862,7 +846,7 @@ fieldset.fields1 dl.pmlist dd.recipients {
.pagination li.page-jump a, .pagination li.next a, .pagination li.previous a {
background-repeat: no-repeat;
font-size: 0;
- height: 13px;
+ height: 14px;
width: 11px;
}
@@ -880,15 +864,15 @@ fieldset.fields1 dl.pmlist dd.recipients {
}
.pagination li.page-jump a:hover, .pagination .dropdown-visible a.dropdown-trigger, .nojs .pagination .dropdown-container:hover a.dropdown-trigger { background-position: 0 -18px; }
-.pagination li.next a:hover { background-position: -50px -18px; }
-.pagination li.previous a:hover { background-position: -30px -18px; }
+.pagination li.next a:hover { background-position: -48px -16px; }
+.pagination li.previous a:hover { background-position: -29px -16px; }
/* Pagination in viewforum for multipage topics */
.row .pagination {
display: block;
margin-top: 0;
padding: 1px 0 1px 15px;
- font-size: 0.9em;
+ font-size: 10px;
background: none 0 50% no-repeat;
}
@@ -1173,6 +1157,11 @@ ul.linklist:after,
text-transform: none;
}
+.dropdown-extended .header .header_settings a {
+ display: inline-block;
+ padding: 0 5px;
+}
+
.dropdown-extended .footer {
text-align: center;
font-size: 1.1em;
diff --git a/phpBB/styles/prosilver/theme/content.css b/phpBB/styles/prosilver/theme/content.css
index 380b285b83..758cc8a771 100644
--- a/phpBB/styles/prosilver/theme/content.css
+++ b/phpBB/styles/prosilver/theme/content.css
@@ -7,10 +7,6 @@ ul.topiclist {
margin: 0;
}
-ul.forums {
- background: transparent none repeat-x 0 0;
-}
-
ul.topiclist li {
display: block;
list-style-type: none;
@@ -383,8 +379,7 @@ dl.faq dt {
}
.content ul, .content ol {
- margin-bottom: 1em;
- margin-left: 3em;
+ margin: 0.8em 0 0.9em 3em;
}
.posthilit {
@@ -430,8 +425,7 @@ dd .signature {
}
.signature ul, .signature ol {
- margin-bottom: 1em;
- margin-left: 3em;
+ margin: 0.8em 0 0.9em 3em;
}
/* Post noticies */
@@ -460,7 +454,7 @@ blockquote {
background: transparent none 6px 8px no-repeat;
border: 1px solid transparent;
font-size: 0.95em;
- margin: 0.5em 1px 0 25px;
+ margin: 1em 1px 1em 25px;
overflow: hidden;
padding: 5px;
}
@@ -468,7 +462,7 @@ blockquote {
blockquote blockquote {
/* Nested quotes */
font-size: 1em;
- margin: 0.5em 1px 0 15px;
+ margin: 1em 1px 1em 15px;
}
blockquote cite {
@@ -488,11 +482,17 @@ blockquote.uncited {
padding-top: 25px;
}
+blockquote cite > div {
+ float: right;
+ font-weight: normal;
+}
+
/* Code block */
.codebox {
padding: 3px;
border: 1px solid transparent;
font-size: 1em;
+ margin: 1em 0 1.2em 0;
}
.codebox p {
@@ -513,7 +513,6 @@ blockquote .codebox {
display: block;
height: auto;
max-height: 200px;
- white-space: normal;
padding-top: 5px;
font: 0.9em Monaco, "Andale Mono","Courier New", Courier, mono;
line-height: 1.3em;
diff --git a/phpBB/styles/prosilver/theme/forms.css b/phpBB/styles/prosilver/theme/forms.css
index 777f011c35..27b33f74aa 100644
--- a/phpBB/styles/prosilver/theme/forms.css
+++ b/phpBB/styles/prosilver/theme/forms.css
@@ -353,7 +353,6 @@ a.button1, a.button1:link, a.button1:visited, a.button1:active, a.button2, a.but
/* Hover states */
a.button1:hover, input.button1:hover, a.button2:hover, input.button2:hover, input.button3:hover {
border: 1px solid transparent;
- background-position: 0 100%;
}
input.disabled {
diff --git a/phpBB/styles/prosilver/theme/images/bg_button.gif b/phpBB/styles/prosilver/theme/images/bg_button.gif
deleted file mode 100644
index 03172ff5c6..0000000000
--- a/phpBB/styles/prosilver/theme/images/bg_button.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/images/gradient.gif b/phpBB/styles/prosilver/theme/images/gradient.gif
deleted file mode 100644
index 21dc11f13b..0000000000
--- a/phpBB/styles/prosilver/theme/images/gradient.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/prosilver/theme/links.css b/phpBB/styles/prosilver/theme/links.css
index a2f512443c..7cf45a69ca 100644
--- a/phpBB/styles/prosilver/theme/links.css
+++ b/phpBB/styles/prosilver/theme/links.css
@@ -58,6 +58,10 @@ li.breadcrumbs span:first-child > a {
width: 40px;
}
+.jumpbox-cat-link,
+.jumpbox-forum-link { font-weight: bold; }
+
+
/* Links for forum/topic lists */
a.forumtitle {
font-family: "Trebuchet MS", Helvetica, Arial, Sans-serif;
diff --git a/phpBB/styles/prosilver/theme/normalize.css b/phpBB/styles/prosilver/theme/normalize.css
new file mode 100644
index 0000000000..a7ebfad424
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/normalize.css
@@ -0,0 +1,424 @@
+/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */
+
+/**
+ * 1. Set default font family to sans-serif.
+ * 2. Prevent iOS and IE text size adjust after device orientation change,
+ * without disabling user zoom.
+ */
+
+html {
+ font-family: sans-serif; /* 1 */
+ -ms-text-size-adjust: 100%; /* 2 */
+ -webkit-text-size-adjust: 100%; /* 2 */
+}
+
+/**
+ * Remove default margin.
+ */
+
+body {
+ margin: 0;
+}
+
+/* HTML5 display definitions
+ ========================================================================== */
+
+/**
+ * Correct `block` display not defined for any HTML5 element in IE 8/9.
+ * Correct `block` display not defined for `details` or `summary` in IE 10/11
+ * and Firefox.
+ * Correct `block` display not defined for `main` in IE 11.
+ */
+
+article,
+aside,
+details,
+figcaption,
+figure,
+footer,
+header,
+hgroup,
+main,
+menu,
+nav,
+section,
+summary {
+ display: block;
+}
+
+/**
+ * 1. Correct `inline-block` display not defined in IE 8/9.
+ * 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
+ */
+
+audio,
+canvas,
+progress,
+video {
+ display: inline-block; /* 1 */
+ vertical-align: baseline; /* 2 */
+}
+
+/**
+ * Prevent modern browsers from displaying `audio` without controls.
+ * Remove excess height in iOS 5 devices.
+ */
+
+audio:not([controls]) {
+ display: none;
+ height: 0;
+}
+
+/**
+ * Address `[hidden]` styling not present in IE 8/9/10.
+ * Hide the `template` element in IE 8/9/10/11, Safari, and Firefox < 22.
+ */
+
+[hidden],
+template {
+ display: none;
+}
+
+/* Links
+ ========================================================================== */
+
+/**
+ * Remove the gray background color from active links in IE 10.
+ */
+
+a {
+ background-color: transparent;
+}
+
+/**
+ * Improve readability of focused elements when they are also in an
+ * active/hover state.
+ */
+
+a:active,
+a:hover {
+ outline: 0;
+}
+
+/* Text-level semantics
+ ========================================================================== */
+
+/**
+ * Address styling not present in IE 8/9/10/11, Safari, and Chrome.
+ */
+
+abbr[title] {
+ border-bottom: 1px dotted;
+}
+
+/**
+ * Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
+ */
+
+b,
+strong {
+ font-weight: bold;
+}
+
+/**
+ * Address styling not present in Safari and Chrome.
+ */
+
+dfn {
+ font-style: italic;
+}
+
+/**
+ * Address variable `h1` font-size and margin within `section` and `article`
+ * contexts in Firefox 4+, Safari, and Chrome.
+ */
+
+h1 {
+ font-size: 2em;
+ margin: 0.67em 0;
+}
+
+/**
+ * Address styling not present in IE 8/9.
+ */
+
+mark {
+ background: #ff0;
+ color: #000;
+}
+
+/**
+ * Address inconsistent and variable font size in all browsers.
+ */
+
+small {
+ font-size: 80%;
+}
+
+/**
+ * Prevent `sub` and `sup` affecting `line-height` in all browsers.
+ */
+
+sub,
+sup {
+ font-size: 75%;
+ line-height: 0;
+ position: relative;
+ vertical-align: baseline;
+}
+
+sup {
+ top: -0.5em;
+}
+
+sub {
+ bottom: -0.25em;
+}
+
+/* Embedded content
+ ========================================================================== */
+
+/**
+ * Remove border when inside `a` element in IE 8/9/10.
+ */
+
+img {
+ border: 0;
+}
+
+/**
+ * Correct overflow not hidden in IE 9/10/11.
+ */
+
+svg:not(:root) {
+ overflow: hidden;
+}
+
+/* Grouping content
+ ========================================================================== */
+
+/**
+ * Address margin not present in IE 8/9 and Safari.
+ */
+
+figure {
+ margin: 1em 40px;
+}
+
+/**
+ * Address differences between Firefox and other browsers.
+ */
+
+hr {
+ box-sizing: content-box;
+ height: 0;
+}
+
+/**
+ * Contain overflow in all browsers.
+ */
+
+pre {
+ overflow: auto;
+}
+
+/**
+ * Address odd `em`-unit font size rendering in all browsers.
+ */
+
+code,
+kbd,
+pre,
+samp {
+ font-family: monospace, monospace;
+ font-size: 1em;
+}
+
+/* Forms
+ ========================================================================== */
+
+/**
+ * Known limitation: by default, Chrome and Safari on OS X allow very limited
+ * styling of `select`, unless a `border` property is set.
+ */
+
+/**
+ * 1. Correct color not being inherited.
+ * Known issue: affects color of disabled elements.
+ * 2. Correct font properties not being inherited.
+ * 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
+ */
+
+button,
+input,
+optgroup,
+select,
+textarea {
+ color: inherit; /* 1 */
+ font: inherit; /* 2 */
+ margin: 0; /* 3 */
+}
+
+/**
+ * Address `overflow` set to `hidden` in IE 8/9/10/11.
+ */
+
+button {
+ overflow: visible;
+}
+
+/**
+ * Address inconsistent `text-transform` inheritance for `button` and `select`.
+ * All other form control elements do not inherit `text-transform` values.
+ * Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
+ * Correct `select` style inheritance in Firefox.
+ */
+
+button,
+select {
+ text-transform: none;
+}
+
+/**
+ * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
+ * and `video` controls.
+ * 2. Correct inability to style clickable `input` types in iOS.
+ * 3. Improve usability and consistency of cursor style between image-type
+ * `input` and others.
+ */
+
+button,
+html input[type="button"], /* 1 */
+input[type="reset"],
+input[type="submit"] {
+ -webkit-appearance: button; /* 2 */
+ cursor: pointer; /* 3 */
+}
+
+/**
+ * Re-set default cursor for disabled elements.
+ */
+
+button[disabled],
+html input[disabled] {
+ cursor: default;
+}
+
+/**
+ * Remove inner padding and border in Firefox 4+.
+ */
+
+button::-moz-focus-inner,
+input::-moz-focus-inner {
+ border: 0;
+ padding: 0;
+}
+
+/**
+ * Address Firefox 4+ setting `line-height` on `input` using `!important` in
+ * the UA stylesheet.
+ */
+
+input {
+ line-height: normal;
+}
+
+/**
+ * It's recommended that you don't attempt to style these elements.
+ * Firefox's implementation doesn't respect box-sizing, padding, or width.
+ *
+ * 1. Address box sizing set to `content-box` in IE 8/9/10.
+ * 2. Remove excess padding in IE 8/9/10.
+ */
+
+input[type="checkbox"],
+input[type="radio"] {
+ box-sizing: border-box; /* 1 */
+ padding: 0; /* 2 */
+}
+
+/**
+ * Fix the cursor style for Chrome's increment/decrement buttons. For certain
+ * `font-size` values of the `input`, it causes the cursor style of the
+ * decrement button to change from `default` to `text`.
+ */
+
+input[type="number"]::-webkit-inner-spin-button,
+input[type="number"]::-webkit-outer-spin-button {
+ height: auto;
+}
+
+/**
+ * 1. Address `appearance` set to `searchfield` in Safari and Chrome.
+ * 2. Address `box-sizing` set to `border-box` in Safari and Chrome.
+ */
+
+input[type="search"] {
+ -webkit-appearance: textfield; /* 1 */
+ box-sizing: content-box; /* 2 */
+}
+
+/**
+ * Remove inner padding and search cancel button in Safari and Chrome on OS X.
+ * Safari (but not Chrome) clips the cancel button when the search input has
+ * padding (and `textfield` appearance).
+ */
+
+input[type="search"]::-webkit-search-cancel-button,
+input[type="search"]::-webkit-search-decoration {
+ -webkit-appearance: none;
+}
+
+/**
+ * Define consistent border, margin, and padding.
+ */
+
+fieldset {
+ border: 1px solid #c0c0c0;
+ margin: 0 2px;
+ padding: 0.35em 0.625em 0.75em;
+}
+
+/**
+ * 1. Correct `color` not being inherited in IE 8/9/10/11.
+ * 2. Remove padding so people aren't caught out if they zero out fieldsets.
+ */
+
+legend {
+ border: 0; /* 1 */
+ padding: 0; /* 2 */
+}
+
+/**
+ * Remove default vertical scrollbar in IE 8/9/10/11.
+ */
+
+textarea {
+ overflow: auto;
+}
+
+/**
+ * Don't inherit the `font-weight` (applied by a rule above).
+ * NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
+ */
+
+optgroup {
+ font-weight: bold;
+}
+
+/* Tables
+ ========================================================================== */
+
+/**
+ * Remove most spacing between table cells.
+ */
+
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+
+td,
+th {
+ padding: 0;
+} \ No newline at end of file
diff --git a/phpBB/styles/prosilver/theme/stylesheet.css b/phpBB/styles/prosilver/theme/stylesheet.css
index 77c7c88b07..78fb2e4bbe 100644
--- a/phpBB/styles/prosilver/theme/stylesheet.css
+++ b/phpBB/styles/prosilver/theme/stylesheet.css
@@ -7,6 +7,9 @@
--------------------------------------------------------------
*/
+@import url("normalize.css");
+@import url("base.css");
+@import url("utilities.css");
@import url("common.css");
@import url("links.css");
@import url("content.css");
diff --git a/phpBB/styles/prosilver/theme/tweaks.css b/phpBB/styles/prosilver/theme/tweaks.css
index d2dad9e299..4bd9d2099f 100644
--- a/phpBB/styles/prosilver/theme/tweaks.css
+++ b/phpBB/styles/prosilver/theme/tweaks.css
@@ -27,3 +27,15 @@ dd label input { vertical-align: text-bottom\9; }
.search-header, .search-header .inputbox, .search-header a.button {
border-radius: 0;
}
+
+.headerbar, .forumbg {
+ background-image: url("./images/bg_header.gif");
+}
+
+.forabg {
+ background-image: url("./images/bg_list.gif");
+}
+
+#tabs .tab > a {
+ border-radius: 0;
+}
diff --git a/phpBB/styles/prosilver/theme/utilities.css b/phpBB/styles/prosilver/theme/utilities.css
new file mode 100644
index 0000000000..811291ac58
--- /dev/null
+++ b/phpBB/styles/prosilver/theme/utilities.css
@@ -0,0 +1,57 @@
+/* --------------------------------------------------------------
+ $Utilities
+-------------------------------------------------------------- */
+
+.sr-only {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ margin: -1px;
+ padding: 0;
+ overflow: hidden;
+ clip: rect(0, 0, 0, 0);
+ border: 0;
+}
+
+.clearfix:before,
+.clearfix:after,
+.container:before,
+.container:after,
+.container-fluid:before,
+.container-fluid:after,
+.row:before,
+.row:after {
+ content: " ";
+ display: table;
+}
+.clearfix:after,
+.container:after,
+.container-fluid:after,
+.row:after { clear: both }
+
+.center-block {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.pull-right { float: right !important }
+.pull-left { float: left !important }
+.hide { display: none !important }
+.show { display: block !important }
+.invisible { visibility: hidden }
+
+.text-hide {
+ font: 0/0 a;
+ color: transparent;
+ text-shadow: none;
+ background-color: transparent;
+ border: 0;
+}
+
+/*.hidden {
+ display: none !important;
+ visibility: hidden !important;
+}*/
+
+.affix { position: fixed }
diff --git a/phpBB/styles/subsilver2/style.cfg b/phpBB/styles/subsilver2/style.cfg
deleted file mode 100644
index 8077c1d51e..0000000000
--- a/phpBB/styles/subsilver2/style.cfg
+++ /dev/null
@@ -1,32 +0,0 @@
-#
-# phpBB Style Configuration File
-#
-# 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.
-#
-# At the left is the name, please do not change this
-# At the right the value is entered
-#
-# Values get trimmed, if you want to add a space in front or at the end of
-# the value, then enclose the value with single or double quotes.
-# Single and double quotes do not need to be escaped.
-#
-#
-
-# General Information about this style
-name = subsilver2
-copyright = © 2005 phpBB Limited
-style_version = 3.1.6
-phpbb_version = 3.1.6
-
-# Defining a different template bitfield
-# template_bitfield = lNg=
-
-# Parent style
-# Set value to empty or to this style's name if this style does not have a parent style
-parent = subsilver2
diff --git a/phpBB/styles/subsilver2/template/attachment.html b/phpBB/styles/subsilver2/template/attachment.html
deleted file mode 100644
index 65a28aead4..0000000000
--- a/phpBB/styles/subsilver2/template/attachment.html
+++ /dev/null
@@ -1,125 +0,0 @@
-<!-- EVENT attachment_file_before -->
-
-<!-- BEGIN _file -->
-
- <!-- IF _file.S_DENIED -->
- <span class="genmed">[{_file.DENIED_MESSAGE}]</span><br />
- <!-- ELSE -->
- <!-- EVENT attachment_file_prepend -->
-
- <!-- IF _file.COMMENT -->
- <span class="gensmall"><b>{L_FILE_COMMENT}{L_COLON}</b> {_file.COMMENT}</span><br />
- <!-- ENDIF -->
-
- <!-- IF _file.S_THUMBNAIL -->
- <a href="{_file.U_DOWNLOAD_LINK}"><img src="{_file.THUMB_IMAGE}" class="postimage" alt="{_file.DOWNLOAD_NAME}" /></a><br />
- <span class="gensmall">{_file.DOWNLOAD_NAME} [ {_file.FILESIZE} {_file.SIZE_LANG} | {_file.L_DOWNLOAD_COUNT} ]</span>
- <!-- ENDIF -->
-
- <!-- IF _file.S_IMAGE -->
- <img src="{_file.U_INLINE_LINK}" class="postimage" alt="{_file.DOWNLOAD_NAME}" /><br />
- <span class="gensmall">{_file.DOWNLOAD_NAME} [ {_file.FILESIZE} {_file.SIZE_LANG} | {_file.L_DOWNLOAD_COUNT} ]</span>
- <!-- ENDIF -->
-
- <!-- IF _file.S_FILE -->
- <span class="genmed">
- <!-- IF _file.UPLOAD_ICON -->{_file.UPLOAD_ICON} <!-- ENDIF -->
- <a href="{_file.U_DOWNLOAD_LINK}">{_file.DOWNLOAD_NAME}</a> [{_file.FILESIZE} {_file.SIZE_LANG}]
- </span><br />
- <span class="gensmall">{_file.L_DOWNLOAD_COUNT}</span>
- <!-- ENDIF -->
-
- <!-- IF _file.S_WM_FILE -->
- <!-- method used here from http://alistapart.com/articles/byebyeembed / autosizing seems to not work always, this will not fix -->
- <object width="320" height="285" classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" id="wmstream_{_file.ATTACH_ID}">
- <param name="url" value="{_file.U_DOWNLOAD_LINK}" />
- <param name="showcontrols" value="1" />
- <param name="showdisplay" value="0" />
- <param name="showstatusbar" value="0" />
- <param name="autosize" value="1" />
- <param name="autostart" value="0" />
- <param name="visible" value="1" />
- <param name="animationstart" value="0" />
- <param name="loop" value="0" />
- <param name="src" value="{_file.U_DOWNLOAD_LINK}" />
- <!--[if !IE]>-->
- <object width="320" height="285" type="video/x-ms-wmv" data="{_file.U_DOWNLOAD_LINK}">
- <param name="src" value="{_file.U_DOWNLOAD_LINK}" />
- <param name="controller" value="1" />
- <param name="showcontrols" value="1" />
- <param name="showdisplay" value="0" />
- <param name="showstatusbar" value="0" />
- <param name="autosize" value="1" />
- <param name="autostart" value="0" />
- <param name="visible" value="1" />
- <param name="animationstart" value="0" />
- <param name="loop" value="0" />
- </object>
- <!--<![endif]-->
- </object>
-
- <!-- ELSEIF _file.S_FLASH_FILE -->
- <object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=5,0,0,0" width="{_file.WIDTH}" height="{_file.HEIGHT}">
- <param name="movie" value="{_file.U_VIEW_LINK}" />
- <param name="play" value="true" />
- <param name="loop" value="true" />
- <param name="quality" value="high" />
- <param name="allowScriptAccess" value="never" />
- <param name="allowNetworking" value="internal" />
- <embed src="{_file.U_VIEW_LINK}" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" width="{_file.WIDTH}" height="{_file.HEIGHT}" play="true" loop="true" quality="high" allowscriptaccess="never" allownetworking="internal"></embed>
- </object>
- <!-- ELSEIF _file.S_QUICKTIME_FILE -->
- <object id="qtstream_{_file.ATTACH_ID}" classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0" width="320" height="285">
- <param name="src" value="{_file.U_DOWNLOAD_LINK}">
- <param name="controller" value="true">
- <param name="autoplay" value="false" />
- <param name="type" value="video/quicktime">
- <embed name="qtstream_{_file.ATTACH_ID}" src="{_file.U_DOWNLOAD_LINK}" pluginspage="http://www.apple.com/quicktime/download/" enablejavascript="true" controller="true" width="320" height="285" type="video/quicktime" autoplay="false"></embed>
- </object>
- <!-- ELSEIF _file.S_RM_FILE -->
- <object id="rmstream_{_file.ATTACH_ID}" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="200" height="50">
- <param name="src" value="{_file.U_DOWNLOAD_LINK}">
- <param name="autostart" value="false">
- <param name="controls" value="ImageWindow">
- <param name="console" value="ctrls_{_file.ATTACH_ID}">
- <param name="prefetch" value="false">
- <embed name="rmstream_{_file.ATTACH_ID}" type="audio/x-pn-realaudio-plugin" src="{_file.U_DOWNLOAD_LINK}" width="0" height="0" autostart="false" controls="ImageWindow" console="ctrls_{_file.ATTACH_ID}" prefetch="false"></embed>
- </object>
- <br />
- <object id="ctrls_{_file.ATTACH_ID}" classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="0" height="36">
- <param name="controls" value="ControlPanel">
- <param name="console" value="ctrls_{_file.ATTACH_ID}">
- <embed name="ctrls_{_file.ATTACH_ID}" type="audio/x-pn-realaudio-plugin" width="200" height="36" controls="ControlPanel" console="ctrls_{_file.ATTACH_ID}"></embed>
- </object>
-
- <script type="text/javascript">
- // <![CDATA[
- if (document.rmstream_{_file.ATTACH_ID}.GetClipWidth)
- {
- while (!document.rmstream_{_file.ATTACH_ID}.GetClipWidth())
- {
- }
-
- var width = document.rmstream_{_file.ATTACH_ID}.GetClipWidth();
- var height = document.rmstream_{_file.ATTACH_ID}.GetClipHeight();
-
- document.rmstream_{_file.ATTACH_ID}.width = width;
- document.rmstream_{_file.ATTACH_ID}.height = height;
- document.ctrls_{_file.ATTACH_ID}.width = width;
- }
- // ]]>
- </script>
- <!-- ENDIF -->
-
- <!-- IF _file.S_WM_FILE or _file.S_RM_FILE or _file.S_FLASH_FILE or _file.S_QUICKTIME_FILE -->
- <br />
- <!-- IF _file.S_QUICKTIME_FILE --><a href="#" onclick="play_qt_file(document.qtstream_{_file.ATTACH_ID}); return false;">[ {L_PLAY_QUICKTIME_FILE} ]</a> <!-- ENDIF -->
- <span class="gensmall"><a href="{_file.U_DOWNLOAD_LINK}">{_file.DOWNLOAD_NAME}</a> [ {_file.FILESIZE} {_file.SIZE_LANG} | {_file.L_DOWNLOAD_COUNT} ]</span>
- <!-- ENDIF -->
-
- <!-- EVENT attachment_file_append -->
- <br />
- <!-- ENDIF -->
-
-<!-- END _file -->
-<!-- EVENT attachment_file_after -->
diff --git a/phpBB/styles/subsilver2/template/bbcode.html b/phpBB/styles/subsilver2/template/bbcode.html
deleted file mode 100644
index 9ee5acec34..0000000000
--- a/phpBB/styles/subsilver2/template/bbcode.html
+++ /dev/null
@@ -1,69 +0,0 @@
-<!-- BEGIN ulist_open --><ul style="list-style-type: {LIST_TYPE}"><!-- END ulist_open -->
-<!-- BEGIN ulist_open_default --><ul><!-- END ulist_open_default -->
-<!-- BEGIN ulist_close --></ul><!-- END ulist_close -->
-
-<!-- BEGIN olist_open --><ol style="list-style-type: {LIST_TYPE}"><!-- END olist_open -->
-<!-- BEGIN olist_close --></ol><!-- END olist_close -->
-
-<!-- BEGIN listitem --><li><!-- END listitem -->
-<!-- BEGIN listitem_close --></li><!-- END listitem_close -->
-
-<!-- BEGIN quote_username_open -->
-<div class="quotetitle">{USERNAME} {L_WROTE}{L_COLON}</div><div class="quotecontent">
-<!-- END quote_username_open -->
-
-<!-- BEGIN quote_open -->
-<div class="quotetitle"><b>{L_QUOTE}{L_COLON}</b></div><div class="quotecontent">
-<!-- END quote_open -->
-
-<!-- BEGIN quote_close -->
-</div>
-<!-- END quote_close -->
-
-<!-- BEGIN code_open -->
-<div class="codetitle"><b>{L_CODE}{L_COLON}</b></div><pre class="codecontent">
-<!-- END code_open -->
-
-<!-- BEGIN code_close -->
-</pre>
-<!-- END code_close -->
-
-<!-- BEGIN inline_attachment_open -->
-<div class="attachtitle">{L_ATTACHMENT}{L_COLON}</div><div class="attachcontent">
-<!-- END inline_attachment_open -->
-
-<!-- BEGIN inline_attachment_close -->
-</div>
-<!-- END inline_attachment_close -->
-
-
-<!-- BEGIN b_open --><strong><!-- END b_open -->
-<!-- BEGIN b_close --></strong><!-- END b_close -->
-
-<!-- BEGIN u_open --><span style="text-decoration: underline"><!-- END u_open -->
-<!-- BEGIN u_close --></span><!-- END u_close -->
-
-<!-- BEGIN i_open --><em><!-- END i_open -->
-<!-- BEGIN i_close --></em><!-- END i_close -->
-
-<!-- BEGIN color --><span style="color: {COLOR}">{TEXT}</span><!-- END color -->
-
-<!-- BEGIN size --><span style="font-size: {SIZE}%; line-height: normal">{TEXT}</span><!-- END size -->
-
-<!-- BEGIN img --><img src="{URL}" class="postimage" alt="{L_IMAGE}" /><!-- END img -->
-
-<!-- BEGIN url --><a href="{URL}" class="postlink">{DESCRIPTION}</a><!-- END url -->
-
-<!-- BEGIN email --><a href="mailto:{EMAIL}">{DESCRIPTION}</a><!-- END email -->
-
-<!-- BEGIN flash -->
- <object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=5,0,0,0" width="{WIDTH}" height="{HEIGHT}">
- <param name="movie" value="{URL}" />
- <param name="play" value="false" />
- <param name="loop" value="false" />
- <param name="quality" value="high" />
- <param name="allowScriptAccess" value="never" />
- <param name="allowNetworking" value="internal" />
- <embed src="{URL}" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" width="{WIDTH}" height="{HEIGHT}" play="false" loop="false" quality="high" allowscriptaccess="never" allownetworking="internal"></embed>
- </object>
-<!-- END flash -->
diff --git a/phpBB/styles/subsilver2/template/breadcrumbs.html b/phpBB/styles/subsilver2/template/breadcrumbs.html
deleted file mode 100644
index 36983a5d88..0000000000
--- a/phpBB/styles/subsilver2/template/breadcrumbs.html
+++ /dev/null
@@ -1,14 +0,0 @@
- <!-- IF $S_MICRODATA --><!-- DEFINE $MICRODATA = ' itemtype="http://data-vocabulary.org/Breadcrumb" itemscope=""' --><!-- ELSE --><!-- DEFINE $MICRODATA = '' --><!-- ENDIF -->
- <table class="tablebg" width="100%" cellspacing="1" cellpadding="0" style="margin-top: 5px;">
- <tr>
- <td class="row1">
- <!-- EVENT overall_header_breadcrumbs_before -->
- <p class="breadcrumbs"><!-- IF U_SITE_HOME --><span{$MICRODATA}><a href="{U_SITE_HOME}" data-navbar-reference="home" itemprop="url"><span itemprop="title">{L_SITE_HOME}</span></a></span> <strong>&#187;</strong> <!-- ENDIF --><!-- IF $OVERALL_HEADER_BREADCRUMBS --><!-- EVENT overall_header_breadcrumb_prepend --><!-- ELSE --><!-- EVENT overall_footer_breadcrumb_prepend --><!-- ENDIF --><span{$MICRODATA}><a href="{U_INDEX}" data-navbar-reference="index" itemprop="url"><span itemprop="title">{L_INDEX}</span></a></span><!-- BEGIN navlinks --><!-- EVENT overall_header_navlink_prepend --> &#187; <span{$MICRODATA}<!-- IF navlinks.MICRODATA --> {navlinks.MICRODATA}<!-- ENDIF -->><a href="{navlinks.U_VIEW_FORUM}" itemprop="url"><span itemprop="title">{navlinks.FORUM_NAME}</span></a></span><!-- EVENT overall_header_navlink_append --><!-- END navlinks -->
- <!-- IF $OVERALL_HEADER_BREADCRUMBS --><!-- EVENT overall_header_breadcrumb_append --><!-- ELSE --><!-- EVENT overall_footer_breadcrumb_append --><!-- ENDIF --></p>
- <!-- EVENT overall_header_breadcrumbs_after -->
- <!-- EVENT overall_footer_timezone_before -->
- <p class="datetime">{S_TIMEZONE}</p>
- <!-- EVENT overall_footer_timezone_after -->
- </td>
- </tr>
- </table>
diff --git a/phpBB/styles/subsilver2/template/captcha_default.html b/phpBB/styles/subsilver2/template/captcha_default.html
deleted file mode 100644
index 1be25403ce..0000000000
--- a/phpBB/styles/subsilver2/template/captcha_default.html
+++ /dev/null
@@ -1,17 +0,0 @@
- <tr>
- <th colspan="2" valign="middle">{L_CONFIRM_CODE}</th>
- </tr>
- <!-- IF S_TYPE == 1 -->
- <tr>
- <td class="row3" colspan="2"><span class="gensmall">{L_CONFIRM_EXPLAIN}</span></td>
- </tr>
- <!-- ENDIF -->
- <tr>
- <td class="row1" colspan="2" align="center"><img src="{CONFIRM_IMAGE_LINK}" alt="{L_CONFIRM_CODE}" />
- <input type="hidden" name="confirm_id" id="confirm_id" value="{CONFIRM_ID}" /></td>
- </tr>
- <tr>
- <td class="row1"><b class="genmed">{L_CONFIRM_CODE}{L_COLON}</b><br /><span class="gensmall">{L_CONFIRM_CODE_EXPLAIN}</span></td>
- <td class="row2"><input class="post" type="text" name="confirm_code" size="8" maxlength="8"<!-- IF $CAPTCHA_TAB_INDEX --> tabindex="{$CAPTCHA_TAB_INDEX}"<!-- ENDIF --> />
- <!-- IF S_CONFIRM_REFRESH --><input type="submit" name="refresh_vc" id="refresh_vc" class="btnlite" value="{L_VC_REFRESH}" /><!-- ENDIF --></td>
- </tr>
diff --git a/phpBB/styles/subsilver2/template/captcha_qa.html b/phpBB/styles/subsilver2/template/captcha_qa.html
deleted file mode 100644
index 90a6492400..0000000000
--- a/phpBB/styles/subsilver2/template/captcha_qa.html
+++ /dev/null
@@ -1,8 +0,0 @@
- <tr>
- <th colspan="2" valign="middle">{L_CONFIRM_QUESTION}</th>
- </tr>
- <tr>
- <td class="row1"><b class="genmed">{QA_CONFIRM_QUESTION}{L_COLON}</b><br /><span class="gensmall">{L_CONFIRM_QUESTION_EXPLAIN}</span></td>
- <td class="row2"><input class="post" type="text" name="qa_answer" size="80"<!-- IF $CAPTCHA_TAB_INDEX --> tabindex="{$CAPTCHA_TAB_INDEX}"<!-- ENDIF --> />
- <input type="hidden" name="qa_confirm_id" id="confirm_id" value="{QA_CONFIRM_ID}" /></td>
- </tr>
diff --git a/phpBB/styles/subsilver2/template/captcha_recaptcha.html b/phpBB/styles/subsilver2/template/captcha_recaptcha.html
deleted file mode 100644
index 0d116b361f..0000000000
--- a/phpBB/styles/subsilver2/template/captcha_recaptcha.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<!-- IF S_RECAPTCHA_AVAILABLE -->
- <tr>
- <th colspan="2" valign="middle">{L_CONFIRM_CODE}</th>
- </tr>
- <tr>
- <td class="row1"><b class="genmed">{L_CONFIRM_CODE}{L_COLON}</b><br /><span class="gensmall">{L_RECAPTCHA_EXPLAIN}</span></td>
- <td class="row2">
- <script type="text/javascript">
- // <![CDATA[
- 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>
-
- <noscript>
- <iframe src="{RECAPTCHA_SERVER}/noscript?k={RECAPTCHA_PUBKEY}{RECAPTCHA_ERRORGET}" height="300" width="500" frameborder="0"></iframe><br />
- <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
- <input type="hidden" name="recaptcha_response_field" value="manual_challenge" />
- </noscript>
- </td>
- </tr>
-
-<!-- ELSE -->
-{L_RECAPTCHA_NOT_AVAILABLE}
-<!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/confirm_body.html b/phpBB/styles/subsilver2/template/confirm_body.html
deleted file mode 100644
index 1712017c38..0000000000
--- a/phpBB/styles/subsilver2/template/confirm_body.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<div id="pagecontent">
-
- <form name="confirm" action="{S_CONFIRM_ACTION}" method="post">
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th>{MESSAGE_TITLE}</th>
- </tr>
- <tr>
- <td class="row1" align="center"><br /><p class="gen">{MESSAGE_TEXT}</p><br />{S_HIDDEN_FIELDS}<input type="submit" name="confirm" value="{YES_VALUE}" class="btnlite" />&nbsp;&nbsp;<input type="submit" name="cancel" value="{L_NO}" class="btnlite" /></td>
- </tr>
- </table>
-
- </form>
-
-</div>
-
-<br clear="all" />
-
-<!-- INCLUDE breadcrumbs.html -->
-
-<br clear="all" />
-
-<div align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></div>
-
-<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/confirm_delete_body.html b/phpBB/styles/subsilver2/template/confirm_delete_body.html
deleted file mode 100644
index 44aec9b60a..0000000000
--- a/phpBB/styles/subsilver2/template/confirm_delete_body.html
+++ /dev/null
@@ -1,55 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<div id="pagecontent">
-
- <form name="confirm" action="{S_CONFIRM_ACTION}" method="post">
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th>{MESSAGE_TITLE}</th>
- </tr>
- <tr>
- <td class="row1" align="center">
- <br />
- <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>
- <td class="row1" width="22%"><b class="gen">{L_DELETE_PERMANENTLY}{L_COLON}</b></td>
- <td class="row1" width="78%">
- <input id="delete_permanent" name="delete_permanent" type="checkbox" value="1" {S_CHECKED_PERMANENT} />
- <!-- IF S_TOPIC_MODE -->{L_DELETE_TOPIC_PERMANENTLY}<!-- ELSE -->{L_DELETE_POST_PERMANENTLY}<!-- ENDIF -->
- </td>
- </tr>
- <!-- ENDIF -->
- <tr>
- <td class="row1" valign="top"><span class="gen"><b>{L_DELETE_REASON}{L_COLON}</b></span><br /><span class="gensmall">{L_DELETE_REASON_EXPLAIN}</span></td>
- <td class="row1"><input type="text" name="delete_reason" value="" class="inputbox autowidth" maxlength="120" size="45" /></td>
- </tr>
- </table>
- <br />
- <!-- ENDIF -->
-
- {S_HIDDEN_FIELDS}
- <input type="submit" name="confirm" value="{L_YES}" class="btnmain" />&nbsp;&nbsp;
- <input type="submit" name="cancel" value="{L_NO}" class="btnlite" />
- </td>
- </tr>
- </table>
-
- </form>
-
-</div>
-
-<br clear="all" />
-
-<!-- INCLUDE breadcrumbs.html -->
-
-<br clear="all" />
-
-<div align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></div>
-
-<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/faq_body.html b/phpBB/styles/subsilver2/template/faq_body.html
deleted file mode 100644
index b3c41e932a..0000000000
--- a/phpBB/styles/subsilver2/template/faq_body.html
+++ /dev/null
@@ -1,63 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<a name="faqtop" class="anchor"></a>
-
-<div id="pagecontent">
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th>{L_FAQ_TITLE}</th>
- </tr>
- <tr>
- <td class="row1">
- <!-- BEGIN faq_block -->
- <span class="gen"><b>{faq_block.BLOCK_TITLE}</b></span><br />
- <!-- BEGIN faq_row -->
- <span class="gen"><a href="#f{faq_block.S_ROW_COUNT}r{faq_block.faq_row.S_ROW_COUNT}">{faq_block.faq_row.FAQ_QUESTION}</a></span><br />
- <!-- END faq_row -->
- <br />
- <!-- END faq_block -->
- </td>
- </tr>
- <tr>
- <td class="cat">&nbsp;</td>
- </tr>
- </table>
-
- <br clear="all" />
-
- <!-- BEGIN faq_block -->
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <td class="cat" align="center"><h4>{faq_block.BLOCK_TITLE}</h4></td>
- </tr>
- <!-- BEGIN faq_row -->
- <tr>
- <!-- IF faq_block.faq_row.S_ROW_COUNT is even -->
- <td class="row1" valign="top">
- <!-- ELSE -->
- <td class="row2" valign="top">
- <!-- ENDIF -->
- <div class="postbody"><a name="f{faq_block.S_ROW_COUNT}r{faq_block.faq_row.S_ROW_COUNT}" class="anchor"></a><b>&#187; {faq_block.faq_row.FAQ_QUESTION}</b></div>
- <div class="postbody">{faq_block.faq_row.FAQ_ANSWER}</div>
- <p class="gensmall"><a href="#faqtop">{L_BACK_TO_TOP}</a></p>
- </td>
- </tr>
- <tr>
- <td class="spacer" height="1"><img src="images/spacer.gif" alt="" width="1" height="1" /></td>
- </tr>
- <!-- END faq_row -->
- </table>
-
- <br clear="all" />
- <!-- END faq_block -->
-
-</div>
-
-<!-- INCLUDE breadcrumbs.html -->
-
-<br clear="all" />
-
-<div align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></div>
-
-<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/forumlist_body.html b/phpBB/styles/subsilver2/template/forumlist_body.html
deleted file mode 100644
index 6c9b64827a..0000000000
--- a/phpBB/styles/subsilver2/template/forumlist_body.html
+++ /dev/null
@@ -1,98 +0,0 @@
-<table class="tablebg" cellspacing="1" width="100%">
-<tr>
- <td class="cat" colspan="5" align="{S_CONTENT_FLOW_END}"><!-- IF not S_IS_BOT and U_MARK_FORUMS --><a class="nav" href="{U_MARK_FORUMS}">{L_MARK_FORUMS_READ}</a><!-- ENDIF -->&nbsp;</td>
-</tr>
-<tr>
- <th colspan="2">&nbsp;{L_FORUM}&nbsp;</th>
- <th width="50">&nbsp;{L_TOPICS}&nbsp;</th>
- <th width="50">&nbsp;{L_POSTS}&nbsp;</th>
- <th>&nbsp;{L_LAST_POST}&nbsp;</th>
-</tr>
-<!-- BEGIN forumrow -->
- <!-- EVENT forumlist_body_category_header_before -->
- <!-- IF forumrow.S_IS_CAT -->
- <tr>
- <td class="cat" colspan="2"><h4><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a></h4></td>
- <td class="catdiv" colspan="3">&nbsp;</td>
- </tr>
- <!-- EVENT forumlist_body_category_header_after -->
- <!-- ELSEIF forumrow.S_IS_LINK -->
- <tr>
- <td class="row1" width="50" align="center">{forumrow.FORUM_FOLDER_IMG}</td>
- <td class="row1">
- <!-- IF forumrow.FORUM_IMAGE -->
- <div style="float: {S_CONTENT_FLOW_BEGIN}; margin-{S_CONTENT_FLOW_END}{L_COLON} 5px;">{forumrow.FORUM_IMAGE}</div>
- <!-- ENDIF -->
- <a class="forumlink" href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a>
- <p class="forumdesc">{forumrow.FORUM_DESC}</p>
- </td>
- <!-- IF forumrow.CLICKS -->
- <td class="row2" colspan="3" align="center"><span class="genmed">{L_REDIRECTS}{L_COLON} {forumrow.CLICKS}</span></td>
- <!-- ELSE -->
- <td class="row2" colspan="3" align="center">&nbsp;</td>
- <!-- ENDIF -->
- </tr>
- <!-- ELSE -->
- <!-- IF forumrow.S_NO_CAT -->
- <tr>
- <td class="cat" colspan="2"><h4>{L_FORUM}</h4></td>
- <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 -->
- <div style="float: {S_CONTENT_FLOW_BEGIN}; margin-{S_CONTENT_FLOW_END}{L_COLON} 5px;">{forumrow.FORUM_IMAGE}</div>
- <!-- ENDIF -->
- <a class="forumlink" href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a>
- <p class="forumdesc">{forumrow.FORUM_DESC}</p>
- <!-- IF forumrow.MODERATORS -->
- <p class="forumdesc"><strong>{forumrow.L_MODERATOR_STR}{L_COLON}</strong> {forumrow.MODERATORS}</p>
- <!-- ENDIF -->
- <!-- IF .forumrow.subforum and forumrow.S_LIST_SUBFORUMS -->
- <!-- 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.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 -->
- <!-- ENDIF -->
- </td>
- <td class="row2" align="center"><p class="topicdetails">{forumrow.TOPICS}</p></td>
- <td class="row2" align="center"><p class="topicdetails">{forumrow.POSTS}</p></td>
- <td class="row2" align="center" nowrap="nowrap">
- <!-- IF forumrow.LAST_POST_TIME -->
- <!-- IF forumrow.S_DISPLAY_SUBJECT -->
- <!-- EVENT forumlist_body_last_post_title_prepend -->
- <p class="topicdetails"><a href="{forumrow.U_LAST_POST}" title="{forumrow.LAST_POST_SUBJECT}" class="lastsubject">{forumrow.LAST_POST_SUBJECT_TRUNCATED}</a></p>
- <!-- ENDIF -->
- <p class="topicdetails">
- <!-- IF forumrow.U_UNAPPROVED_TOPICS -->
- <a href="{forumrow.U_UNAPPROVED_TOPICS}" class="imageset">{UNAPPROVED_IMG}</a>&nbsp;
- <!-- ELSEIF forumrow.U_UNAPPROVED_POSTS -->
- <a href="{forumrow.U_UNAPPROVED_POSTS}" class="imageset">{UNAPPROVED_POST_IMG}</a>&nbsp;
- <!-- ENDIF -->
- {forumrow.LAST_POST_TIME}
- </p>
- <p class="topicdetails">{forumrow.LAST_POSTER_FULL}
- <!-- IF not S_IS_BOT --><a href="{forumrow.U_LAST_POST}" class="imageset">{LAST_POST_IMG}</a><!-- ENDIF -->
- </p>
- <!-- ELSE -->
- <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 -->
- <tr>
- <td class="row1" colspan="5" align="center"><p class="gensmall">{L_NO_FORUMS}</p></td>
- </tr>
-<!-- END forumrow -->
-</table>
diff --git a/phpBB/styles/subsilver2/template/index.htm b/phpBB/styles/subsilver2/template/index.htm
deleted file mode 100644
index a1356823e2..0000000000
--- a/phpBB/styles/subsilver2/template/index.htm
+++ /dev/null
@@ -1,16 +0,0 @@
-<html>
-<head>
-<title>subSilver created by subBlue Design</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-</head>
-
-<body bgcolor="#FFFFFF" text="#000000">
-
-<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
- <tr>
- <td align="center" valign="middle"><a href="http://www.subblue.com/" target="_new"><img src="images/created_by.jpg" width="400" height="300" alt="Created by subBlue Design" /></a></td>
- </tr>
-</table>
-
-</body>
-</html> \ No newline at end of file
diff --git a/phpBB/styles/subsilver2/template/index_body.html b/phpBB/styles/subsilver2/template/index_body.html
deleted file mode 100644
index c0a8d5fd57..0000000000
--- a/phpBB/styles/subsilver2/template/index_body.html
+++ /dev/null
@@ -1,142 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<!-- EVENT index_body_markforums_before -->
-
-<!-- IF U_MCP or U_ACP -->
- <div id="pageheader">
- <p class="linkmcp">[&nbsp;<!-- IF U_ACP --><a href="{U_ACP}">{L_ACP}</a><!-- IF U_MCP -->&nbsp;|&nbsp;<!-- ENDIF --><!-- ENDIF --><!-- IF U_MCP --><a href="{U_MCP}">{L_MCP}</a><!-- ENDIF -->&nbsp;]</p>
- </div>
-
- <br clear="all" /><br />
-<!-- ENDIF -->
-
-<!-- EVENT index_body_markforums_after -->
-
-<!-- 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 -->
- <!-- IF not S_IS_BOT and U_TEAM --> | <!-- ENDIF -->
- <!-- EVENT overall_footer_teamlink_before -->
- <!-- IF U_TEAM --><a href="{U_TEAM}">{L_THE_TEAM}</a><!-- ENDIF -->
- <!-- IF U_CONTACT_US -->
- <!-- IF U_TEAM --> | <!-- ENDIF -->
- <a href="{U_CONTACT_US}">{L_CONTACT_US}</a>
- <!-- ENDIF -->
- <!-- EVENT overall_footer_teamlink_after -->
-</span>
-<!-- ENDIF -->
-<br />
-
-<br clear="all" />
-
-<!-- INCLUDE breadcrumbs.html -->
-
-<!-- EVENT index_body_stat_blocks_before -->
-
-<!-- IF S_DISPLAY_ONLINE_LIST -->
- <br clear="all" />
-
- <table class="tablebg stat-block online-list" width="100%" cellspacing="1">
- <tr>
- <td class="cat" colspan="2"><!-- IF U_VIEWONLINE --><h4><a href="{U_VIEWONLINE}">{L_WHO_IS_ONLINE}</a></h4><!-- ELSE --><h4>{L_WHO_IS_ONLINE}</h4><!-- ENDIF --></td>
- </tr>
- <tr>
- <!-- IF LEGEND -->
- <td class="row1" rowspan="2" align="center" valign="middle"><img src="{T_THEME_PATH}/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td>
- <!-- ELSE -->
- <td class="row1" align="center" valign="middle"><img src="{T_THEME_PATH}/images/whosonline.gif" alt="{L_WHO_IS_ONLINE}" /></td>
- <!-- ENDIF -->
- <td class="row1" width="100%">
- <span class="genmed">
- <!-- EVENT index_body_block_online_prepend -->
- {TOTAL_USERS_ONLINE} ({L_ONLINE_EXPLAIN})<br />{RECORD_USERS}<br /><br />{LOGGED_IN_USER_LIST}
- <!-- EVENT index_body_block_online_append -->
- </span>
- </td>
- </tr>
- <!-- IF LEGEND -->
- <tr>
- <td class="row1"><b class="gensmall">{L_LEGEND} :: {LEGEND}</b></td>
- </tr>
- <!-- ENDIF -->
- </table>
-<!-- ENDIF -->
-
-<!-- IF S_DISPLAY_BIRTHDAY_LIST -->
- <br clear="all" />
-
- <table class="tablebg stat-block birthday-list" width="100%" cellspacing="1">
- <tr>
- <td class="cat" colspan="2"><h4>{L_BIRTHDAYS}</h4></td>
- </tr>
- <tr>
- <td class="row1" align="center" valign="middle"><img src="{T_THEME_PATH}/images/whosonline.gif" alt="{L_BIRTHDAYS}" /></td>
- <td class="row1" width="100%">
- <p class="genmed">
- <!-- EVENT index_body_block_birthday_prepend -->
- <!-- IF .birthdays -->{L_CONGRATULATIONS}{L_COLON} <b><!-- BEGIN birthdays -->{birthdays.USERNAME}<!-- IF birthdays.AGE !== '' --> ({birthdays.AGE})<!-- ENDIF --><!-- IF not birthdays.S_LAST_ROW -->, <!-- ENDIF --><!-- END birthdays --></b><!-- ELSE -->{L_NO_BIRTHDAYS}<!-- ENDIF -->
- <!-- EVENT index_body_block_birthday_append -->
- </p>
- </td>
- </tr>
- </table>
-<!-- ENDIF -->
-
-<br clear="all" />
-
-<table class="tablebg stat-block statistics" width="100%" cellspacing="1">
-<tr>
- <td class="cat" colspan="2"><h4>{L_STATISTICS}</h4></td>
-</tr>
-<tr>
- <td class="row1"><img src="{T_THEME_PATH}/images/whosonline.gif" alt="{L_STATISTICS}" /></td>
- <td class="row1" width="100%" valign="middle">
- <p class="genmed">
- <!-- EVENT index_body_block_stats_prepend -->
- {TOTAL_POSTS} | {TOTAL_TOPICS} | {TOTAL_USERS} | {NEWEST_USER}
- <!-- EVENT index_body_block_stats_append -->
- </p>
- </td>
-</tr>
-</table>
-
-<!-- EVENT index_body_stat_blocks_after -->
-
-<!-- IF not S_USER_LOGGED_IN and not S_IS_BOT -->
- <br clear="all" />
-
- <form method="post" action="{S_LOGIN_ACTION}">
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <td class="cat"><h4><a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a></h4></td>
- </tr>
- <tr>
- <td class="row1" align="center"><span class="genmed">{L_USERNAME}{L_COLON}</span> <input class="post" type="text" name="username" size="10" />&nbsp; <span class="genmed">{L_PASSWORD}{L_COLON}</span> <input class="post" type="password" name="password" size="10" autocomplete="off" />&nbsp; <!-- IF U_SEND_PASSWORD --><a href="{U_SEND_PASSWORD}">{L_FORGOT_PASS}</a>&nbsp; <!-- ENDIF --> <!-- IF S_AUTOLOGIN_ENABLED --> <span class="gensmall">{L_LOG_ME_IN}</span> <input type="checkbox" class="radio" name="autologin" /><!-- ENDIF -->&nbsp; <input type="submit" class="btnmain" name="login" value="{L_LOGIN}" /></td>
- </tr>
- </table>
- {S_LOGIN_REDIRECT}
- {S_FORM_TOKEN}
- </form>
-<!-- ENDIF -->
-
-<br clear="all" />
-
-<table class="legend">
-<tr>
- <td width="20" align="center">{FORUM_UNREAD_IMG}</td>
- <td><span class="gensmall">{L_UNREAD_POSTS}</span></td>
- <td>&nbsp;&nbsp;</td>
- <td width="20" align="center">{FORUM_IMG}</td>
- <td><span class="gensmall">{L_NO_UNREAD_POSTS}</span></td>
- <td>&nbsp;&nbsp;</td>
- <td width="20" align="center">{FORUM_LOCKED_IMG}</td>
- <td><span class="gensmall">{L_FORUM_LOCKED}</span></td>
-</tr>
-</table>
-
-<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/jumpbox.html b/phpBB/styles/subsilver2/template/jumpbox.html
deleted file mode 100644
index e0603c6a6e..0000000000
--- a/phpBB/styles/subsilver2/template/jumpbox.html
+++ /dev/null
@@ -1,19 +0,0 @@
-
-<!-- IF S_DISPLAY_JUMPBOX -->
- <form method="get" name="jumpbox" action="{S_JUMPBOX_ACTION}" onsubmit="if(document.jumpbox.f.value == -1){return false;}">
-
- <table cellspacing="0" cellpadding="0" border="0">
- <tr>
- <td nowrap="nowrap">{HIDDEN_FIELDS_FOR_JUMPBOX}<span class="gensmall"><!-- IF S_IN_MCP and S_MERGE_SELECT -->{L_SELECT_TOPICS_FROM}<!-- ELSEIF S_IN_MCP -->{L_MODERATE_FORUM}<!-- ELSE -->{L_JUMP_TO}<!-- ENDIF -->{L_COLON}</span>&nbsp;<select name="f" onchange="if(this.options[this.selectedIndex].value != -1){ document.forms['jumpbox'].submit() }">
-
- <!-- BEGIN jumpbox_forums -->
- <!-- IF jumpbox_forums.S_FORUM_COUNT eq 1 --><option value="-1">------------------</option><!-- ENDIF -->
- <option value="{jumpbox_forums.FORUM_ID}"{jumpbox_forums.SELECTED}><!-- BEGIN level -->&nbsp; &nbsp;<!-- END level -->{jumpbox_forums.FORUM_NAME}</option>
- <!-- END jumpbox_forums -->
-
- </select>&nbsp;<input class="btnlite" type="submit" value="{L_GO}" /></td>
- </tr>
- </table>
-
- </form>
-<!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/login_body.html b/phpBB/styles/subsilver2/template/login_body.html
deleted file mode 100644
index 1067f3738d..0000000000
--- a/phpBB/styles/subsilver2/template/login_body.html
+++ /dev/null
@@ -1,111 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<form action="{S_LOGIN_ACTION}" method="post">
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <!-- IF not S_ADMIN_AUTH -->
- <th colspan="2">{L_LOGIN}</th>
- <!-- ELSE -->
- <th>{LOGIN_EXPLAIN}</th>
- <!-- ENDIF -->
-</tr>
-<!-- IF LOGIN_EXPLAIN && not S_ADMIN_AUTH -->
- <tr>
- <td class="row3" colspan="2" align="center"><span class="gensmall">{LOGIN_EXPLAIN}</span></td>
- </tr>
-<!-- ENDIF -->
-<tr><!-- IF not S_ADMIN_AUTH and S_REGISTER_ENABLED -->
- <td class="row1" width="50%">
- <p class="genmed">{L_LOGIN_INFO}</p>
-
- <p class="genmed" align="center">
- <a href="{U_TERMS_USE}">{L_TERMS_USE}</a> | <a href="{U_PRIVACY}">{L_PRIVACY}</a>
- </p>
- </td>
- <!-- ENDIF -->
- <td <!-- IF not S_ADMIN_AUTH -->class="row2"<!-- ELSE -->class="row1"<!-- ENDIF -->>
-
- <table align="center" cellspacing="1" cellpadding="4" style="width: 100%;">
- <!-- IF LOGIN_ERROR -->
- <tr>
- <td class="gensmall" colspan="2" align="center"><span class="error">{LOGIN_ERROR}</span></td>
- </tr>
- <!-- ENDIF -->
-
- <tr>
- <td valign="top" <!-- IF S_ADMIN_AUTH -->style="width: 50%; text-align: {S_CONTENT_FLOW_END};"<!-- ENDIF -->><b class="gensmall">{L_USERNAME}{L_COLON}</b></td>
- <td><input class="post" type="text" name="{USERNAME_CREDENTIAL}" size="25" value="{USERNAME}" tabindex="1" />
- <!-- IF not S_ADMIN_AUTH and S_REGISTER_ENABLED -->
- <br /><a class="gensmall" href="{U_REGISTER}">{L_REGISTER}</a>
- <!-- ENDIF -->
- </td>
- </tr>
- <tr>
- <td valign="top" <!-- IF S_ADMIN_AUTH -->style="width: 50%; text-align: {S_CONTENT_FLOW_END};"<!-- ENDIF -->><b class="gensmall">{L_PASSWORD}{L_COLON}</b></td>
- <td>
- <input class="post" type="password" name="{PASSWORD_CREDENTIAL}" size="25" tabindex="2" autocomplete="off" />
- <!-- IF U_SEND_PASSWORD --><br /><a class="gensmall" href="{U_SEND_PASSWORD}">{L_FORGOT_PASS}</a><!-- ENDIF -->
- <!-- IF U_RESEND_ACTIVATION and not S_ADMIN_AUTH --><br /><a class="gensmall" href="{U_RESEND_ACTIVATION}">{L_RESEND_ACTIVATION}</a><!-- ENDIF -->
- </td>
- </tr>
- <!-- IF S_DISPLAY_FULL_LOGIN -->
- <!-- IF S_AUTOLOGIN_ENABLED -->
- <tr>
- <td>&nbsp;</td>
- <td><input type="checkbox" class="radio" name="autologin" tabindex="3" /> <span class="gensmall">{L_LOG_ME_IN}</span></td>
- </tr>
- <!-- ENDIF -->
- <tr>
- <td>&nbsp;</td>
- <td><input type="checkbox" class="radio" name="viewonline" tabindex="4" /> <span class="gensmall">{L_HIDE_ME}</span></td>
- </tr>
- <!-- ENDIF -->
- <!-- IF not S_ADMIN_AUTH and PROVIDER_TEMPLATE_FILE -->
- <!-- INCLUDE {PROVIDER_TEMPLATE_FILE} -->
- <!-- ENDIF -->
- </table>
- </td>
-</tr>
-
-<!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
-</table>
-<table class="tablebg" width="100%" cellspacing="1">
- <!-- DEFINE $CAPTCHA_TAB_INDEX = 4 -->
- <!-- INCLUDE {CAPTCHA_TEMPLATE} -->
-<!-- ENDIF -->
-
-{S_LOGIN_REDIRECT}
-<tr>
- <td class="cat" <!-- IF not S_ADMIN_AUTH or S_CONFIRM_CODE -->colspan="2"<!-- ENDIF --> align="center">{S_HIDDEN_FIELDS}<input type="submit" name="login" class="btnmain" value="{L_LOGIN}" tabindex="5" /></td>
-</tr>
-</table>
-{S_FORM_TOKEN}
-</form>
-
-<br clear="all" />
-
-<!-- INCLUDE breadcrumbs.html -->
-
-<br clear="all" />
-
-<div align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></div>
-
-<script type="text/javascript">
-// <![CDATA[
- (function()
- {
- var elements = document.getElementsByName("<!-- IF S_ADMIN_AUTH -->{PASSWORD_CREDENTIAL}<!-- ELSE -->{USERNAME_CREDENTIAL}<!-- ENDIF -->");
- for (var i = 0; i < elements.length; ++i)
- {
- if (elements[i].tagName.toLowerCase() == 'input')
- {
- elements[i].focus();
- break;
- }
- }
- })();
-// ]]>
-</script>
-
-<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/login_body_oauth.html b/phpBB/styles/subsilver2/template/login_body_oauth.html
deleted file mode 100644
index 6f374fa4f2..0000000000
--- a/phpBB/styles/subsilver2/template/login_body_oauth.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<!-- BEGIN oauth -->
- <tr>
- <td>
- <a href="{oauth.REDIRECT_URL}">{oauth.SERVICE_NAME}</a>
- </td>
- </tr>
-<!-- END oauth -->
diff --git a/phpBB/styles/subsilver2/template/login_forum.html b/phpBB/styles/subsilver2/template/login_forum.html
deleted file mode 100644
index 2cda9f3452..0000000000
--- a/phpBB/styles/subsilver2/template/login_forum.html
+++ /dev/null
@@ -1,56 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<!-- IF FORUM_NAME -->
- <div id="pageheader">
- <h2><a class="titles" href="{U_VIEW_FORUM}">{FORUM_NAME}</a></h2>
- </div>
-
- <br clear="all" /><br />
-<!-- ENDIF -->
-
-<div id="pagecontent">
-
- <form name="login_forum" method="post" action="{S_LOGIN_ACTION}">
-
- <table class="tablebg" width="100%" cellspacing="1" align="center">
- <tr>
- <th>{L_LOGIN}</th>
- </tr>
- <tr>
- <td class="row3" align="center"><span class="gensmall">{L_LOGIN_FORUM}</span></td>
- </tr>
- <tr>
- <td class="row1" align="center">
-
- <table cellspacing="1" cellpadding="4" border="0">
- <!-- IF LOGIN_ERROR -->
- <tr>
- <td class="gensmall" colspan="2" align="center"><span class="error">{LOGIN_ERROR}</span></td>
- </tr>
- <!-- ENDIF -->
- <tr>
- <td class="gensmall"><b>{L_PASSWORD}{L_COLON}</b></td>
- <td><input class="post" type="password" name="password" size="25" tabindex="2" autocomplete="off" /></td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input type="submit" name="login" class="btnmain" value="{L_LOGIN}" tabindex="3" /></td>
- </tr>
- </table>
- {S_FORM_TOKEN}
- {S_LOGIN_REDIRECT}
- </form>
-
-</div>
-
-<br clear="all" />
-
-<!-- INCLUDE breadcrumbs.html -->
-
-<br clear="all" />
-
-<div align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></div>
-
-<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_approve.html b/phpBB/styles/subsilver2/template/mcp_approve.html
deleted file mode 100644
index 8c2ef0806b..0000000000
--- a/phpBB/styles/subsilver2/template/mcp_approve.html
+++ /dev/null
@@ -1,49 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<div id="pagecontent">
-
- <form name="confirm" action="{S_CONFIRM_ACTION}" method="post">
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th>{MESSAGE_TITLE}</th>
- </tr>
- <tr>
- <td class="row1" align="center">
- <!-- IF ADDITIONAL_MSG -->
- <span class="gen error">{ADDITIONAL_MSG}</span><br />
- <!-- ENDIF -->
- <!-- IF S_NOTIFY_POSTER -->
- <input type="checkbox" class="radio" name="notify_poster" checked="checked" /><span class="gen"><!-- IF S_APPROVE -->{L_NOTIFY_POSTER_APPROVAL}<!-- ELSE -->{L_NOTIFY_POSTER_DISAPPROVAL}<!-- ENDIF --></span><br />
- <!-- ENDIF -->
- <!-- IF not S_APPROVE and not S_RESTORE and .reason -->
- <br />
- <table border="0" width="90%" cellspacing="2" cellpadding="1">
- <tr>
- <td class="row1" width="22%"><b class="gen">{L_DISAPPROVE_REASON}{L_COLON}</b></td>
- <td class="row1" width="78%"><select name="reason_id"><!-- BEGIN reason --><option value="{reason.ID}"<!-- IF reason.S_SELECTED --> selected="selected"<!-- ENDIF -->>{reason.DESCRIPTION}</option><!-- END reason --></select></td>
- </tr>
- <tr>
- <td class="row1" valign="top"><span class="gen"><b>{L_MORE_INFO}{L_COLON}</b></span><br /><span class="gensmall">{L_CAN_LEAVE_BLANK}</span></td>
- <td class="row1"><textarea class="post" style="width:500px" name="reason" rows="10" cols="40">{REASON}</textarea></td>
- </tr>
- </table>
- <br />
- <!-- ENDIF -->
- <br />{S_HIDDEN_FIELDS}<span class="gen">{MESSAGE_TEXT}</span><br /><br />
- <input type="submit" name="confirm" value="{YES_VALUE}" class="btnmain" />&nbsp;&nbsp;<input type="submit" name="cancel" value="{L_NO}" class="btnlite" /></span>
- </td>
- </tr>
- </table>
- {S_FORM_TOKEN}
- </form>
-
-</div>
-
-<br clear="all" />
-
-<!-- INCLUDE breadcrumbs.html -->
-
-<br clear="all" />
-
-<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_ban.html b/phpBB/styles/subsilver2/template/mcp_ban.html
deleted file mode 100644
index cc24d21d73..0000000000
--- a/phpBB/styles/subsilver2/template/mcp_ban.html
+++ /dev/null
@@ -1,120 +0,0 @@
-<!-- INCLUDE mcp_header.html -->
-
-<script type="text/javascript">
-// <![CDATA[
-
- var ban_length = new Array();
- ban_length[-1] = '';
- var ban_reason = new Array();
- ban_reason[-1] = '';
- var ban_give_reason = new Array();
- ban_give_reason[-1] = '';
-
- <!-- BEGIN bans -->
- ban_length['{bans.BAN_ID}'] = '{bans.A_LENGTH}';
- <!-- IF bans.A_REASON -->
- ban_reason['{bans.BAN_ID}'] = '{bans.A_REASON}';
- <!-- ENDIF -->
- <!-- IF bans.A_GIVE_REASON -->
- ban_give_reason['{bans.BAN_ID}'] = '{bans.A_GIVE_REASON}';
- <!-- ENDIF -->
- <!-- END bans -->
-
- function display_details(option)
- {
- document.getElementById('mcp_ban').unbanlength.value = ban_length[option];
- if (option in ban_reason) {
- document.getElementById('mcp_ban').unbanreason.value = ban_reason[option];
- } else {
- document.getElementById('mcp_ban').unbanreason.value = '';
- }
- if (option in ban_give_reason) {
- document.getElementById('mcp_ban').unbangivereason.value = ban_give_reason[option];
- } else {
- document.getElementById('mcp_ban').unbangivereason.value = '';
- }
- }
-
-// ]]>
-</script>
-
-<form id="mcp_ban" method="post" action="{U_ACTION}">
-
-<table width="100%" class="tablebg" cellspacing="1" cellpadding="4" border="0">
-<tr>
- <th colspan="2" nowrap="nowrap">{L_TITLE}</th>
-</tr>
-<tr>
- <td class="row3" colspan="2">{L_EXPLAIN}</td>
-</tr>
-<!-- EVENT mcp_ban_fields_before -->
-<tr>
- <td class="row1" width="45%" valign="top"><b>{L_BAN_CELL}{L_COLON}</b></td>
- <td class="row2">
- <textarea name="ban" id="ban" cols="40" rows="3" class="post">{USERNAMES}</textarea>
- <!-- IF S_USERNAME_BAN --><br />[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]<!-- ENDIF -->
- </td>
-</tr>
-<tr>
- <td class="row1" valign="top"><b>{L_BAN_LENGTH}{L_COLON}</b></td>
- <td class="row2"><select name="banlength">{S_BAN_END_OPTIONS}</select><br /><input type="text" name="banlengthother" class="post" /> {L_YEAR_MONTH_DAY}</td>
-</tr>
-<tr>
- <td class="row1" valign="top"><b>{L_BAN_EXCLUDE}{L_COLON}</b><br /><span class="gensmall">{L_BAN_EXCLUDE_EXPLAIN}</span></td>
- <td class="row2"><input type="radio" class="radio" name="banexclude" value="1" /> {L_YES} &nbsp; <input type="radio" class="radio" name="banexclude" value="0" checked="checked" /> {L_NO}</td>
-</tr>
-<tr>
- <td class="row1" valign="top"><b>{L_BAN_REASON}{L_COLON}</b></td>
- <td class="row2"><input name="banreason" type="text" class="post" maxlength="255" /></td>
-</tr>
-<tr>
- <td class="row1" valign="top"><b>{L_BAN_GIVE_REASON}{L_COLON}</b></td>
- <td class="row2"><input name="bangivereason" type="text" class="post" maxlength="255" /></td>
-</tr>
-<!-- EVENT mcp_ban_fields_after -->
-<tr>
- <td class="cat" colspan="2" align="center"><input type="submit" name="bansubmit" value="{L_SUBMIT}" class="btnmain" />&nbsp; <input type="reset" value="{L_RESET}" class="btnlite" />&nbsp;</td>
-</tr>
-</table>
-
-<br /><br />
-
-<table width="100%" class="tablebg" cellspacing="1" cellpadding="4" border="0">
-<tr>
- <th colspan="2" nowrap="nowrap">{L_UNBAN_TITLE}</th>
-</tr>
-<tr>
- <td class="row3" colspan="2">{L_UNBAN_EXPLAIN}</td>
-</tr>
-<!-- IF S_BANNED_OPTIONS -->
- <!-- EVENT mcp_ban_unban_before -->
- <tr>
- <td class="row1" valign="top" width="45%"><b>{L_BAN_CELL}{L_COLON}</b></td>
- <td class="row2"><select name="unban[]" multiple="multiple" size="10" style="width: 50%" onchange="if (this.selectedIndex > -1) display_details(this.options[this.selectedIndex].value); else display_details(-1);">{BANNED_OPTIONS}</select></td>
- </tr>
- <tr>
- <td class="row1" valign="top"><b>{L_BAN_LENGTH}{L_COLON}</b></td>
- <td class="row2"><input style="border: 0; width: 100%" type="text" name="unbanlength" readonly="readonly" /></td>
- </tr>
- <tr>
- <td class="row1" valign="top"><b>{L_BAN_REASON}{L_COLON}</b></td>
- <td class="row2"><textarea style="border: 0; width: 100%" name="unbanreason" readonly="readonly" rows="5" cols="80">&nbsp;</textarea></td>
- </tr>
- <tr>
- <td class="row1" valign="top"><b>{L_BAN_GIVE_REASON}{L_COLON}</b></td>
- <td class="row2"><textarea style="border: 0; width: 100%" name="unbangivereason" readonly="readonly" rows="5" cols="80">&nbsp;</textarea></td>
- </tr>
- <!-- EVENT mcp_ban_unban_after -->
- <tr>
- <td class="cat" colspan="2" align="center"><input type="submit" name="unbansubmit" value="{L_SUBMIT}" class="btnmain" />&nbsp; <input type="reset" value="{L_RESET}" class="btnlite" />&nbsp;</td>
- </tr>
-<!-- ELSE -->
- <tr>
- <td class="row1" colspan="2"><b>{L_NO_BAN_CELL}</b></td>
- </tr>
-<!-- ENDIF -->
-</table>
-{S_FORM_TOKEN}
-</form>
-
-<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_footer.html b/phpBB/styles/subsilver2/template/mcp_footer.html
deleted file mode 100644
index 280920b148..0000000000
--- a/phpBB/styles/subsilver2/template/mcp_footer.html
+++ /dev/null
@@ -1,27 +0,0 @@
-
- </td>
- </tr>
- </table>
-
- <!-- IF .pagination -->
- <table width="80%" align="{S_CONTENT_FLOW_END}" cellspacing="1">
- <tr>
- <td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}<br /></td>
- <td class="gensmall" nowrap="nowrap">&nbsp;[ <!-- IF TOTAL_TOPICS -->{TOTAL_TOPICS}<!-- ELSEIF TOTAL_POSTS -->{TOTAL_POSTS}<!-- ELSE -->{TOTAL}<!-- ENDIF --> ]&nbsp;</td>
- <td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- INCLUDE pagination.html --></td>
- </tr>
- </table>
- <br />
- <!-- ENDIF -->
-
-</div>
-
-<br clear="all" />
-
-<!-- INCLUDE breadcrumbs.html -->
-
-<br clear="all" />
-
-<div align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></div>
-
-<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_forum.html b/phpBB/styles/subsilver2/template/mcp_forum.html
deleted file mode 100644
index 8a20b96538..0000000000
--- a/phpBB/styles/subsilver2/template/mcp_forum.html
+++ /dev/null
@@ -1,95 +0,0 @@
-<!-- INCLUDE mcp_header.html -->
-
-<!-- IF S_MERGE_SELECT --><div style="float: {S_CONTENT_FLOW_END};"><!-- INCLUDE jumpbox.html --></div><!-- ENDIF -->
-
-<!-- IF U_VIEW_FORUM_LOGS --><a href="{U_VIEW_FORUM_LOGS}">{L_VIEW_FORUM_LOGS}</a><!-- ENDIF -->
-
-<!-- IF S_MERGE_SELECT --><br clear="{S_CONTENT_FLOW_END}" /><!-- ENDIF -->
-
-<form method="post" id="mcp" action="{S_MCP_ACTION}">
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <td class="cat" colspan="6" align="center"><span class="gensmall">{L_DISPLAY_TOPICS}{L_COLON}</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td>
-</tr>
-<tr>
- <th width="4%" nowrap="nowrap">&nbsp;</th>
- <th nowrap="nowrap">&nbsp;{L_TOPICS}&nbsp;</th>
- <th width="8%" nowrap="nowrap">&nbsp;{L_REPLIES}&nbsp;</th>
- <th width="17%" nowrap="nowrap">&nbsp;{L_LAST_POST}&nbsp;</th>
- <th width="5%" nowrap="nowrap">&nbsp;{L_MARK}&nbsp;</th>
-</tr>
-<!-- BEGIN topicrow -->
- <tr>
- <td class="row1" width="25" align="center">{topicrow.TOPIC_FOLDER_IMG}</td>
- <!-- IF S_TOPIC_ICONS -->
- <!-- td class="row1" width="25" align="center">{topicrow.TOPIC_ICON_IMG}</td -->
- <!-- ENDIF -->
- <td class="row1">
- <!-- EVENT topiclist_row_prepend -->
- <!-- IF topicrow.S_SELECT_TOPIC -->
- <span class="genmed">[ <a href="{topicrow.U_SELECT_TOPIC}">{L_SELECT_MERGE}</a> ]&nbsp;</span>
- <!-- ENDIF -->
- <p class="topictitle">{NEWEST_POST_IMG} {topicrow.ATTACH_ICON_IMG} <!-- EVENT mcp_forum_topic_title_before --><a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a><!-- EVENT mcp_forum_topic_title_after -->
- <!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED -->
- <a href="{topicrow.U_MCP_QUEUE}" class="imageset">{topicrow.UNAPPROVED_IMG}</a>&nbsp;
- <!-- ENDIF -->
- <!-- IF topicrow.S_TOPIC_DELETED or topicrow.S_POSTS_DELETED -->
- <a href="{topicrow.U_MCP_QUEUE}" class="imageset">{topicrow.DELETED_IMG}</a>&nbsp;
- <!-- ENDIF -->
- <!-- IF topicrow.S_TOPIC_REPORTED and topicrow.U_MCP_REPORT -->
- <a href="{topicrow.U_MCP_REPORT}" class="imageset">{REPORTED_IMG}</a>&nbsp;
- <!-- ENDIF -->
- <!-- IF topicrow.S_MOVED_TOPIC and S_CAN_DELETE -->
- [ <a href="{topicrow.U_DELETE_TOPIC}">{L_DELETE_SHADOW_TOPIC}</a> ]&nbsp;
- <!-- ENDIF -->
- </p>
- <!-- EVENT topiclist_row_append -->
- </td>
- <td class="row1" width="50" align="center"><p class="topicdetails">{topicrow.REPLIES}</p></td>
- <td class="row1" width="120" align="center"><p class="topicdetails">{topicrow.LAST_POST_TIME}</p></td>
- <td class="row2" align="center">
- <!-- IF not topicrow.S_MOVED_TOPIC and not S_MERGE_SELECT --><input type="checkbox" class="radio" name="topic_id_list[]" value="{topicrow.TOPIC_ID}"<!-- IF topicrow.S_TOPIC_CHECKED --> checked="checked"<!-- ENDIF --> /><!-- ELSE -->&nbsp;<!-- ENDIF -->
- </td>
- </tr>
-<!-- BEGINELSE -->
- <tr>
- <td class="row1" colspan="8" align="center"><p class="gen">{L_NO_TOPICS}</p></td>
- </tr>
-<!-- END topicrow -->
-<!-- IF not S_MERGE_SELECT -->
-<tr>
- <td class="cat" colspan="6" align="{S_CONTENT_FLOW_END}">
- <select name="action">
- <option value="" selected="selected">{L_SELECT_ACTION}</option>
- <!-- IF S_CAN_DELETE --><option value="delete_topic">{L_DELETE}</option><!-- ENDIF -->
- <!-- IF S_CAN_RESTORE --><option value="restore_topic">{L_RESTORE}</option><!-- ENDIF -->
- <!-- IF S_CAN_MERGE --><option value="merge_topics">{L_MERGE}</option><!-- ENDIF -->
- <!-- IF S_CAN_MOVE --><option value="move">{L_MOVE}</option><!-- ENDIF -->
- <!-- IF S_CAN_FORK --><option value="fork">{L_FORK}</option><!-- ENDIF -->
- <!-- IF S_CAN_LOCK --><option value="lock">{L_LOCK}</option><option value="unlock">{L_UNLOCK}</option><!-- ENDIF -->
- <!-- IF S_CAN_SYNC --><option value="resync">{L_RESYNC}</option><!-- ENDIF -->
- <!-- IF S_CAN_MAKE_NORMAL --><option value="make_normal">{L_MAKE_NORMAL}</option><!-- ENDIF -->
- <!-- IF S_CAN_MAKE_STICKY --><option value="make_sticky">{L_MAKE_STICKY}</option><!-- ENDIF -->
- <!-- IF S_CAN_MAKE_ANNOUNCE -->
- <option value="make_announce">{L_MAKE_ANNOUNCE}</option>
- <option value="make_global">{L_MAKE_GLOBAL}</option>
- <!-- ENDIF -->
- </select>
- <input class="btnmain" type="submit" value="{L_SUBMIT}" />
- </td>
-</tr>
-<!-- ENDIF -->
-</table>
-{S_FORM_TOKEN}
-</form>
-
-<!-- IF not S_MERGE_SELECT -->
-<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
-<tr>
- <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="gensmall"><a href="#" onclick="marklist('mcp', 'topic_id_list', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp', 'topic_id_list', false); return false;">{L_UNMARK_ALL}</a></b></td>
-</tr>
-</table>
-<!-- ENDIF -->
-
-<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_front.html b/phpBB/styles/subsilver2/template/mcp_front.html
deleted file mode 100644
index 55adb3b550..0000000000
--- a/phpBB/styles/subsilver2/template/mcp_front.html
+++ /dev/null
@@ -1,147 +0,0 @@
-<!-- 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}">
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <td class="row3" colspan="6" align="center"><b class="gen">{L_LATEST_UNAPPROVED}</b></td>
- </tr>
- <tr>
- <th>&nbsp;{L_FORUM}&nbsp;</th>
- <th>&nbsp;{L_TOPIC}&nbsp;</th>
- <th>&nbsp;{L_SUBJECT}&nbsp;</th>
- <th>&nbsp;{L_AUTHOR}&nbsp;</th>
- <th>&nbsp;{L_POST_TIME}&nbsp;</th>
- <th width="5%">&nbsp;{L_SELECT}&nbsp;</th>
- </tr>
- <!-- BEGIN unapproved -->
- <tr>
- <td class="row1" width="15%" valign="top"><span class="gen"><!-- IF unapproved.U_FORUM --><a href="{unapproved.U_FORUM}">{unapproved.FORUM_NAME}</a><!-- ELSE -->{unapproved.FORUM_NAME}<!-- ENDIF --></span><!-- IF unapproved.U_MCP_FORUM --><br /><span class="gensmall">[ <a href="{unapproved.U_MCP_FORUM}">{L_MODERATE}</a> ]</span><!-- ENDIF --></td>
- <td class="row2" valign="top"><span class="gen"><a href="{unapproved.U_TOPIC}">{unapproved.TOPIC_TITLE}</a></span><br /><span class="gensmall">[ <a href="{unapproved.U_MCP_TOPIC}">{L_MODERATE}</a> ]</span></td>
- <td class="row1" valign="top">{unapproved.ATTACH_ICON_IMG} <span class="gen">{unapproved.SUBJECT}</span><br /><span class="gensmall">[ <a href="{unapproved.U_POST_DETAILS}">{L_VIEW_DETAILS}</a> ]</span></td>
- <td class="row2" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gen">{unapproved.AUTHOR_FULL}</span></td>
- <td class="row1" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gensmall">{unapproved.POST_TIME}</span></td>
- <td class="row2" align="center"><input type="checkbox" class="radio" name="post_id_list[]" value="{unapproved.POST_ID}" /></td>
- </tr>
- <!-- END unapproved -->
- <tr>
- <td class="row3" colspan="6"><span class="gensmall">{L_UNAPPROVED_TOTAL}</span></td>
- </tr>
- <tr>
- <td class="cat" colspan="6" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="action[approve]" value="{L_APPROVE}" />&nbsp;&nbsp;<input class="btnlite" type="submit" name="action[disapprove]" value="{L_DISAPPROVE}" /></td>
- </tr>
- </table>
- {S_FORM_TOKEN}
- </form>
-
- <table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
- <tr>
- <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="gensmall"><a href="#" onclick="marklist('mcp_queue', '', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp_queue', '', false); return false;">{L_UNMARK_ALL}</a></b></td>
- </tr>
- </table>
-
- <br clear="all" /><br />
-<!-- ENDIF -->
-
-<!-- EVENT mcp_front_latest_reported_before -->
-
-<!-- IF S_SHOW_REPORTS -->
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <td class="row3" colspan="5" align="center"><b class="gen">{L_LATEST_REPORTED}</b></td>
- </tr>
- <tr>
- <th>&nbsp;{L_FORUM}&nbsp;</th>
- <th>&nbsp;{L_TOPIC}&nbsp;</th>
- <th>&nbsp;{L_SUBJECT}&nbsp;</th>
- <th>&nbsp;{L_REPORTER}&nbsp;</th>
- <th>&nbsp;{L_REPORT_TIME}&nbsp;</th>
- </tr>
- <!-- BEGIN report -->
- <tr>
- <td class="row1" width="15%" valign="top"><span class="gen"><!-- IF report.U_FORUM --><a href="{report.U_FORUM}">{report.FORUM_NAME}</a><!-- ELSE -->{report.FORUM_NAME}<!-- ENDIF --></span><!-- IF report.U_MCP_FORUM --><br /><span class="gensmall">[ <a href="{report.U_MCP_FORUM}">{L_MODERATE}</a> ]</span><!-- ENDIF --></td>
- <td class="row2" valign="top"><span class="gen"><a href="{report.U_TOPIC}">{report.TOPIC_TITLE}</a></span><br /><span class="gensmall">[ <a href="{report.U_MCP_TOPIC}">{L_MODERATE}</a> ]</span></td>
- <td class="row1" valign="top">{report.ATTACH_ICON_IMG} <span class="gen">{report.SUBJECT}</span><br /><span class="gensmall">[ <a href="{report.U_POST_DETAILS}">{L_VIEW_DETAILS}</a> ]</span></td>
- <td class="row2" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gen">{report.REPORTER_FULL}</span></td>
- <td class="row1" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gensmall">{report.REPORT_TIME}</span></td>
- </tr>
- <!-- END report -->
- <tr>
- <td class="row3" colspan="5"><span class="gensmall">{L_REPORTS_TOTAL}</span></td>
- </tr>
- </table>
-
- <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>
- <td class="row3" colspan="6" align="center"><b class="gen">{L_LATEST_REPORTED_PMS}</b></td>
- </tr>
- <tr>
- <th>&nbsp;{L_PM_SUBJECT}&nbsp;</th>
- <th>&nbsp;{L_PM_FROM}&nbsp;</th>
- <th>&nbsp;{L_TO} &amp; {L_BCC}&nbsp;</th>
- <th>&nbsp;{L_SENT_AT}&nbsp;</th>
- <th>&nbsp;{L_REPORTER}&nbsp;</th>
- <th>&nbsp;{L_REPORT_TIME}&nbsp;</th>
- </tr>
- <!-- BEGIN pm_report -->
- <tr>
- <td class="row1" valign="top">{pm_report.ATTACH_ICON_IMG} <span class="gen">{pm_report.PM_SUBJECT}</span><br /><span class="gensmall">[ <a href="{pm_report.U_PM_DETAILS}">{L_VIEW_DETAILS}</a> ]</span></td>
- <td class="row2" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gen">{pm_report.PM_AUTHOR_FULL}</span></td>
- <td class="row1" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gen">{pm_report.RECIPIENTS}</span></td>
- <td class="row2" align="center" width="10%" nowrap="nowrap" valign="top"><span class="gensmall">{pm_report.PM_TIME}</span></td>
- <td class="row1" align="center" width="15%" nowrap="nowrap" valign="top"><span class="gen">{pm_report.REPORTER_FULL}</span></td>
- <td class="row2" align="center" width="10%" nowrap="nowrap" valign="top"><span class="gensmall">{pm_report.REPORT_TIME}</span></td>
- </tr>
- <!-- END pm_report -->
- <tr>
- <td class="row3" colspan="6"><span class="gensmall">{L_PM_REPORTS_TOTAL}</span></td>
- </tr>
- </table>
-
- <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>
- <td class="row3" colspan="5" align="center"><b class="gen">{L_LATEST_LOGS}</b></td>
- </tr>
- <tr>
- <th width="15%" nowrap="nowrap">{L_USERNAME}</th>
- <th width="12%" nowrap="nowrap">{L_IP}</th>
- <th width="45%" nowrap="nowrap">{L_ACTION}</th>
- <th nowrap="nowrap"></th>
- <th width="18%" nowrap="nowrap">{L_TIME}</th>
- </tr>
- <!-- BEGIN log -->
- <tr>
- <td class="row1" nowrap="nowrap"><span class="gen">{log.USERNAME}</span></td>
- <td class="row1" align="center" nowrap="nowrap"><span class="gen">{log.IP}</span></td>
- <td class="row1"><span class="genmed">{log.ACTION}</span></td>
- <td class="row1" align="center" nowrap="nowrap"><span class="gensmall"><!-- IF log.U_VIEW_TOPIC --><a href="{log.U_VIEW_TOPIC}">{L_VIEW_TOPIC}</a><!-- IF log.U_VIEWLOGS --> | <!-- ENDIF --><!-- ENDIF --><!-- IF log.U_VIEWLOGS --><a href="{log.U_VIEWLOGS}">{L_VIEW_TOPIC_LOGS}</a><!-- ENDIF --></span></td>
- <td class="row1" align="center" nowrap="nowrap"><span class="gensmall">{log.TIME}</span></td>
- </tr>
- <!-- BEGINELSE -->
- <tr>
- <td class="row1" colspan="5" align="center"><span class="gen">{L_NO_ENTRIES}</span></td>
- </tr>
- <!-- END log -->
- </table>
-
- <br clear="all" />
-<!-- ENDIF -->
-
-<!-- EVENT mcp_front_latest_logs_after -->
-
-<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_header.html b/phpBB/styles/subsilver2/template/mcp_header.html
deleted file mode 100644
index 7144750ed4..0000000000
--- a/phpBB/styles/subsilver2/template/mcp_header.html
+++ /dev/null
@@ -1,60 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<div id="pageheader">
- <!-- IF U_MCP -->
- <p class="linkmcp">
- [<!-- IF U_ACP -->&nbsp;<a href="{U_ACP}">{L_ACP}</a>&nbsp;|<!-- ENDIF -->&nbsp;<a href="{U_MCP}">{L_MCP}</a><!-- IF U_MCP_FORUM -->&nbsp;|&nbsp;<a href="{U_MCP_FORUM}">{L_MODERATE_FORUM}</a><!-- ENDIF --><!-- IF U_MCP_TOPIC -->&nbsp;|&nbsp;<a href="{U_MCP_TOPIC}">{L_MODERATE_TOPIC}</a><!-- ENDIF --><!-- IF U_MCP_POST -->&nbsp;|&nbsp;<a href="{U_MCP_POST}">{L_MODERATE_POST}</a><!-- ENDIF -->&nbsp;]
- </p>
- <!-- ENDIF -->
-
- <!-- IF TOPIC_TITLE or FORUM_NAME -->
- <h2><!-- IF TOPIC_TITLE --><a class="titles" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a><!-- ELSE --><a class="titles" href="{U_VIEW_FORUM}">{FORUM_NAME}</a><!-- ENDIF --></h2>
- <!-- ENDIF -->
-</div>
-
-<br clear="all" />
-
-<div id="pagecontent">
-
- <table width="100%" cellspacing="0" cellpadding="0" border="0">
- <tr>
- <td width="20%" valign="top">
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th>{L_OPTIONS}</th>
- </tr>
- <!-- BEGIN l_block1 -->
- <tr>
- <!-- IF l_block1.S_SELECTED -->
- <td class="row1"><b class="nav">{l_block1.L_TITLE}</b>
-
- <ul class="nav" style="margin: 0; padding: 0; list-style-type: none; line-height: 175%;">
- <!-- BEGIN l_block2 -->
- <li>&#187; <!-- IF l_block1.l_block2.S_SELECTED --><b>{l_block1.l_block2.L_TITLE}</b><!-- ELSE --><a href="{l_block1.l_block2.U_TITLE}">{l_block1.l_block2.L_TITLE}</a><!-- ENDIF --></li>
- <!-- END l_block2 -->
- </ul>
- <!-- ELSE -->
- <td class="row2" nowrap="nowrap" onmouseover="this.className='row1'" onmouseout="this.className='row2'" onclick="location.href=this.firstChild.href;"><a class="nav" href="{l_block1.U_TITLE}">{l_block1.L_TITLE}</a>
- <!-- ENDIF -->
- </td>
- </tr>
- <!-- END l_block1 -->
- </table>
-
- </td>
- <td><img src="images/spacer.gif" width="4" alt="" /></td>
- <td width="80%" valign="top">
-
- <!-- IF MESSAGE -->
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th>{L_MESSAGE}</th>
- </tr>
- <tr>
- <td class="row1" align="center"><br /><span class="gen">{MESSAGE}<br /><br /><!-- BEGIN return_links -->{return_links.MESSAGE_LINK}<br /><br /><!-- END return_links --></span></td>
- </tr>
- </table>
-
- <br />
- <!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/mcp_logs.html b/phpBB/styles/subsilver2/template/mcp_logs.html
deleted file mode 100644
index 64f2a6a64d..0000000000
--- a/phpBB/styles/subsilver2/template/mcp_logs.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<!-- INCLUDE mcp_header.html -->
-
-<form method="post" name="mcp" action="{U_POST_ACTION}">
-
-<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
-<tr>
- <th>{L_USERNAME}</th>
- <th>{L_IP}</th>
- <th>{L_TIME}</th>
- <th>{L_ACTION}</th>
- <!-- IF S_CLEAR_ALLOWED --><th>{L_MARK}</th><!-- ENDIF -->
-</tr>
-<!-- IF S_LOGS -->
-
- <!-- BEGIN log -->
- <!-- IF log.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <td class="genmed">{log.USERNAME}</td>
- <td class="genmed" style="text-align: center;">{log.IP}</td>
- <td class="genmed" style="text-align: center;">{log.DATE}</td>
- <td class="genmed">{log.ACTION}<br />{log.DATA}</td>
- <!-- IF S_CLEAR_ALLOWED --><td width="5%" align="center"><input type="checkbox" class="radio" name="mark[]" value="{log.ID}" /></td><!-- ENDIF -->
- </tr>
- <!-- END log -->
- <tr align="center">
- <td class="row3" colspan="<!-- IF S_CLEAR_ALLOWED -->5<!-- ELSE -->4<!-- ENDIF -->"><span class="gensmall">{L_SEARCH_KEYWORDS}{L_COLON}</span> <input type="text" name="keywords" value="{S_KEYWORDS}" />&nbsp;<input type="submit" class="btnlite" name="filter" value="{L_SEARCH}" /></td>
- </tr>
- <tr align="center">
- <td class="row3" colspan="<!-- IF S_CLEAR_ALLOWED -->5<!-- ELSE -->4<!-- ENDIF -->"><span class="gensmall">{L_DISPLAY_LOG}{L_COLON}</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" value="{L_GO}" name="sort" /></td>
- </tr>
- <!-- IF S_CLEAR_ALLOWED -->
- <tr>
- <td class="cat" colspan="5" align="center"><input class="btnlite" type="submit" name="action[del_all]" value="{L_DELETE_ALL}" />&nbsp; <input class="btnlite" type="submit" name="action[del_marked]" value="{L_DELETE_MARKED}" /></td>
- </tr>
- <!-- ENDIF -->
-<!-- ELSE -->
- <tr>
- <td class="row1" colspan="<!-- IF S_CLEAR_ALLOWED -->5<!-- ELSE -->4<!-- ENDIF -->" align="center"><span class="gen">{L_NO_ENTRIES}</span></td>
- </tr>
-<!-- ENDIF -->
-</table>
-{S_FORM_TOKEN}
-</form>
-
-<br clear="all" /><br />
-
-<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_message.html b/phpBB/styles/subsilver2/template/mcp_message.html
deleted file mode 100644
index 5699dd54af..0000000000
--- a/phpBB/styles/subsilver2/template/mcp_message.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!-- INCLUDE mcp_header.html -->
-
-<table class="tablebg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center">
-<tr>
- <th><b>{MESSAGE_TITLE}</b></th>
-</tr>
-<tr>
- <td class="row1" align="center"><br /><span class="gen">{MESSAGE_TEXT}</span><br /><br /></td>
-</tr>
-</table>
-
-<br clear="all" />
-
-<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_move.html b/phpBB/styles/subsilver2/template/mcp_move.html
deleted file mode 100644
index b8958187e6..0000000000
--- a/phpBB/styles/subsilver2/template/mcp_move.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<div id="pagecontent">
-
- <form name="confirm" action="{S_CONFIRM_ACTION}" method="post">
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th>{MESSAGE_TITLE}</th>
- </tr>
- <tr>
- <td class="row1" align="center">
- <!-- IF ADDITIONAL_MSG -->
- <span class="gen error">{ADDITIONAL_MSG}</span><br />
- <!-- ENDIF -->
- <!-- IF S_FORUM_SELECT -->
- <span class="gen"><br />{L_SELECT_DESTINATION_FORUM}&nbsp;&nbsp;</span>
- <select name="to_forum_id">{S_FORUM_SELECT}</select><br />
- <!-- IF S_CAN_LEAVE_SHADOW -->
- <input type="checkbox" class="radio" name="move_leave_shadow" /><span class="gen">{L_LEAVE_SHADOW}</span><br />
- <!-- ENDIF -->
- <!-- IF S_CAN_LOCK_TOPIC -->
- <input type="checkbox" class="radio" name="move_lock_topics" /><span class="gen">{L_LOCK_TOPIC}</span><br />
- <!-- ENDIF -->
- <br />{S_HIDDEN_FIELDS}<span class="gen">{MESSAGE_TEXT}</span><br /><br />
- <input type="submit" name="confirm" value="{YES_VALUE}" class="btnmain" />&nbsp;&nbsp;<input type="submit" name="cancel" value="{L_NO}" class="btnlite" />
- <!-- ELSE -->
- <span class="gen">{L_NO_DESTINATION_FORUM}</span><br /><br />
- {S_HIDDEN_FIELDS}
- <input type="submit" name="cancel" value="{L_CANCEL}" class="btnlite" />
- <!-- ENDIF -->
- </td>
- </tr>
- </table>
- {S_FORM_TOKEN}
- </form>
-
-</div>
-
-<br clear="all" />
-
-<!-- INCLUDE breadcrumbs.html -->
-
-<br clear="all" />
-
-<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_notes_front.html b/phpBB/styles/subsilver2/template/mcp_notes_front.html
deleted file mode 100644
index e2e14e0150..0000000000
--- a/phpBB/styles/subsilver2/template/mcp_notes_front.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!-- INCLUDE mcp_header.html -->
-
-<form method="post" name="mcp" action="{U_POST_ACTION}">
-
-<table class="tablebg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center">
-<tr>
- <th colspan="2"align="center">{L_SELECT_USER}</th>
-</tr>
-<tr>
- <td class="row1" width="40%"><b class="gen">{L_FIND_USERNAME}{L_COLON} </b><br /><span class="gensmall">[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</span></td>
- <td class="row2"><input type="text" class="post" name="username" size="20" /></td>
-</tr>
-<tr>
- <td class="cat" colspan="2" align="center"><input type="submit" name="submituser" value="{L_SUBMIT}" class="btnmain" /></td>
-</tr>
-</table>
-{S_FORM_TOKEN}
-</form>
-
-<br clear="all" /><br />
-
-<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_notes_user.html b/phpBB/styles/subsilver2/template/mcp_notes_user.html
deleted file mode 100644
index 4bd8de6862..0000000000
--- a/phpBB/styles/subsilver2/template/mcp_notes_user.html
+++ /dev/null
@@ -1,125 +0,0 @@
-<!-- INCLUDE mcp_header.html -->
-
-<form method="post" name="mcp" action="{U_POST_ACTION}">
-
-<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
-<tr>
- <th colspan="2" align="center">{USERNAME}</th>
-</tr>
-<tr>
- <td class="row1" align="center">
- <table cellspacing="1" cellpadding="2" border="0">
- <tr>
- <td class="gen" align="center"><b>{USERNAME_FULL}</b></td>
- </tr>
- <!-- IF RANK_TITLE -->
- <tr>
- <td class="postdetails" align="center">{RANK_TITLE}</td>
- </tr>
- <!-- ENDIF -->
- <!-- IF RANK_IMG -->
- <tr>
- <td align="center">{RANK_IMG}</td>
- </tr>
- <!-- ENDIF -->
- <tr>
- <td align="center"><!-- IF AVATAR_IMG -->{AVATAR_IMG}<!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" alt="" /><!-- ENDIF --></td>
- </tr>
- </table>
- </td>
- <td class="row1">
- <table width="100%" cellspacing="1" cellpadding="2" border="0">
- <tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_JOINED}{L_COLON} </td>
- <td width="100%"><b class="gen">{JOINED}</b></td>
- </tr>
- <tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_TOTAL_POSTS}{L_COLON} </td>
- <td><b class="gen">{POSTS}</b></td>
- </tr>
- <tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_WARNINGS}{L_COLON} </td>
- <td><b class="gen">{WARNINGS}</b></td>
- </tr>
- </table>
- </td>
-</tr>
-</table>
-
-<br />
-
-<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
-<tr>
- <th colspan="5" align="center">{L_FEEDBACK}</th>
-</tr>
-<!-- IF S_USER_NOTES -->
-
- <tr align="center">
- <td colspan="5" class="row3"><span class="gensmall">{L_SEARCH_KEYWORDS}{L_COLON}</span> <input type="text" name="keywords" value="{S_KEYWORDS}" />&nbsp;<input type="submit" class="btnlite" name="filter" value="{L_SEARCH}" /></td>
- </tr>
- <tr align="center">
- <td colspan="5" class="row3"><span class="gensmall">{L_DISPLAY_LOG}{L_COLON}</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}{L_COLON}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" value="{L_GO}" name="sort" /></td>
- </tr>
- <tr>
- <th>{L_REPORT_BY}</th>
- <th>{L_IP}</th>
- <th>{L_TIME}</th>
- <th>{L_ACTION}</th>
- <th><!-- IF S_CLEAR_ALLOWED -->{L_MARK}<!-- ENDIF --></th>
- </tr>
-
- <!-- BEGIN usernotes -->
- <!-- IF usernotes.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <td class="gen">{usernotes.REPORT_BY}</td>
- <td style="text-align: center;">{usernotes.IP}</td>
- <td style="text-align: center;">{usernotes.REPORT_AT}</td>
- <td class="gen">
- {usernotes.ACTION}
- <!-- IF usernotes.DATA --><br />&#187; <span class="gensmall">[ {usernotes.DATA} ]</span><!-- ENDIF -->
- </td>
- <td style="text-align: center;"><!-- IF S_CLEAR_ALLOWED --><input type="checkbox" class="radio" name="marknote[]" value="{usernotes.ID}" /><!-- ENDIF --></td>
- </tr>
- <!-- END usernotes -->
-
- <!-- IF S_CLEAR_ALLOWED -->
- <tr>
- <td class="cat" colspan="5" align="center"><input class="btnlite" type="submit" name="action[del_all]" value="{L_DELETE_ALL}" />&nbsp; <input class="btnlite" type="submit" name="action[del_marked]" value="{L_DELETE_MARKED}" /></td>
- </tr>
- <!-- ENDIF -->
-
-<!-- ELSE -->
- <tr>
- <td class="row1" colspan="2" align="center"><span class="gen">{L_NO_FEEDBACK}</span></td>
- </tr>
-<!-- ENDIF -->
-</table>
-
-<br clear="all" />
-
-<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
-<tr>
- <th colspan="2" align="center">{L_ADD_FEEDBACK}</th>
-</tr>
-<tr>
- <td class="row3" align="center" colspan="2"><span class="genmed">{L_ADD_FEEDBACK_EXPLAIN}</span></td>
-</tr>
-<tr>
- <td colspan="2" class="row1" align="center"><textarea name="usernote" rows="10" cols="76"></textarea></td>
-</tr>
-<tr>
- <td class="cat" colspan="2" align="center"><input class="btnmain" type="submit" name="action[add_feedback]" value="{L_SUBMIT}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" /></td>
-</tr>
-</table>
-
-<table width="100%" cellspacing="0" cellpadding="0">
-<tr>
- <td class="pagination">{PAGE_NUMBER} [ {TOTAL_REPORTS} ]</td>
- <td align="{S_CONTENT_FLOW_END}"><span class="pagination"><!-- INCLUDE pagination.html --></span></td>
-</tr>
-</table>
-{S_FORM_TOKEN}
-</form>
-
-<br clear="all" /><br />
-
-<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_post.html b/phpBB/styles/subsilver2/template/mcp_post.html
deleted file mode 100644
index 1a29df94b0..0000000000
--- a/phpBB/styles/subsilver2/template/mcp_post.html
+++ /dev/null
@@ -1,214 +0,0 @@
-<!-- INCLUDE mcp_header.html -->
-
-<!-- IF S_MCP_REPORT -->
- <form method="post" name="mcp_report" action="{S_CLOSE_ACTION}">
-
- <table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
- <tr>
- <th colspan="2" align="center"><!-- IF S_PM -->{L_PM_REPORT_DETAILS}<!-- ELSE -->{L_REPORT_DETAILS}<!-- ENDIF --></th>
- </tr>
- <tr>
- <td class="row1"><b class="gen">{L_REPORT_REASON}{L_COLON} </b></td>
- <td class="row2"><span class="gen">{REPORT_REASON_TITLE} &raquo; {REPORT_REASON_DESCRIPTION}</span></td>
- </tr>
- <tr>
- <td class="row1" width="20%"><b class="gen">{L_REPORTER}{L_COLON} </b></td>
- <td class="row2" width="80%"><span class="gen"<!-- IF REPORTER_COLOUR --> style="font-weight: bold; color: {REPORTER_COLOUR};"<!-- ENDIF -->>{REPORTER_NAME}</span> &nbsp; <span class="gen">[ <!-- IF U_VIEW_REPORTER_PROFILE --><a href="{U_VIEW_REPORTER_PROFILE}">{L_READ_PROFILE}</a><!-- ENDIF --><!-- IF S_USER_NOTES --><!-- IF U_VIEW_REPORTER_PROFILE --> | <!-- ENDIF --><a href="{U_MCP_REPORTER_NOTES}">{L_VIEW_NOTES}</a> | <a href="{U_MCP_WARN_REPORTER}">{L_WARN_USER}</a><!-- ENDIF --> ]</span></td>
- </tr>
- <tr>
- <td class="row1"><b class="gen">{L_REPORTED}{L_COLON} </b></td>
- <td class="row2"><span class="postdetails">{REPORT_DATE}</span></td>
- </tr>
- <!-- IF REPORT_TEXT -->
- <tr>
- <th colspan="2" align="center">{L_MORE_INFO}</th>
- </tr>
- <tr>
- <td class="row1" colspan="2"><div class="gen" style="overflow: auto; width: 100%; height: 80pt; border: 1px;">{REPORT_TEXT}</div></td>
- </tr>
- <!-- ENDIF -->
- <tr>
- <td class="cat" align="center" colspan="2"><!-- IF not S_REPORT_CLOSED --><input class="btnmain" type="submit" value="{L_CLOSE_REPORT}" name="action[close]" /><!-- ELSE -->{L_REPORT_CLOSED}<!-- ENDIF --> &nbsp; <input class="btnlite" type="submit" value="{L_DELETE_REPORT}" name="action[delete]" /></td>
- </tr>
- </table>
-
- <input type="hidden" name="report_id_list[]" value="{REPORT_ID}" />
- {S_FORM_TOKEN}
- </form>
-
- <br clear="all"/>
-<!-- ENDIF -->
-
-<!-- IF S_MCP_QUEUE --><form method="post" name="mcp_approve" action="{U_APPROVE_ACTION}"><!-- ELSE --><form method="post" name="mcp_report_details" action="{S_CLOSE_ACTION}"><!-- ENDIF -->
-
-<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
-<tr>
- <th colspan="2" align="center"><!-- IF S_PM -->{L_PM}<!-- ELSE -->{L_POST_DETAILS}<!-- ENDIF --></th>
-</tr>
-<tr>
- <td class="row3" colspan="2" align="center"><span class="gensmall"><!-- IF S_MCP_QUEUE -->{RETURN_QUEUE} | {RETURN_TOPIC_SIMPLE} | {RETURN_POST}<!-- ELSEIF S_MCP_REPORT -->{RETURN_REPORTS}<!-- IF not S_PM --> | <a href="{U_VIEW_POST}">{L_VIEW_POST}</a> | <a href="{U_VIEW_TOPIC}">{L_VIEW_TOPIC}</a> | <a href="{U_VIEW_FORUM}">{L_VIEW_FORUM}</a><!-- ENDIF --><!-- ELSE -->{RETURN_TOPIC}<!-- ENDIF --></span></td>
-</tr>
-<tr>
- <td class="row1"><b class="gen"><!-- IF S_PM -->{L_PM_SUBJECT}<!-- ELSE -->{L_POST_SUBJECT}<!-- ENDIF -->{L_COLON} </b></td>
- <td class="row2">
- <span class="gen">{POST_SUBJECT}</span>
- <!-- IF S_POST_UNAPPROVED --><span class="postapprove">{UNAPPROVED_IMG} <a href="{U_MCP_APPROVE}">{L_POST_UNAPPROVED}</a></span> <!-- ENDIF -->
- <!-- IF S_POST_DELETED --><span class="postapprove">{DELETED_IMG} <a href="{U_MCP_APPROVE}">{L_POST_DELETED}</a></span> <!-- ENDIF -->
- <!-- IF S_POST_REPORTED and not S_MCP_REPORT --><span class="postreported">{REPORTED_IMG} <a href="{U_MCP_REPORT}">{L_POST_REPORTED}</a></span><!-- ENDIF -->
- </td>
-</tr>
-<tr>
- <td class="row1" width="20%"><b class="gen"><!-- IF S_PM -->{L_PM_FROM}<!-- ELSE -->{L_POSTER}<!-- ENDIF -->{L_COLON} </b></td>
- <td class="row2" width="80%"><span class="gen"<!-- IF POST_AUTHOR_COLOUR --> style="font-weight: bold; color: {POST_AUTHOR_COLOUR}"<!-- ENDIF -->>{POST_AUTHOR}</span><span class="gen"> &nbsp; [ <!-- IF U_POST_AUTHOR --><a href="{U_POST_AUTHOR}">{L_READ_PROFILE}</a><!-- ENDIF --><!-- IF S_USER_NOTES --><!-- IF U_POST_AUTHOR --> | <!-- ENDIF --><a href="{U_MCP_USER_NOTES}">{L_VIEW_NOTES}</a> <!-- IF U_MCP_WARN_USER -->| <a href="{U_MCP_WARN_USER}">{L_WARN_USER}</a><!-- ENDIF --><!-- ENDIF --> ]</span></td>
-</tr>
-<!-- IF S_CAN_VIEWIP -->
- <tr>
- <td class="row1"><b class="gen"><!-- IF S_PM -->{L_THIS_PM_IP}<!-- ELSE -->{L_THIS_POST_IP}<!-- ENDIF -->{L_COLON} </b></td>
- <td class="row2"><span class="gen">
- <!-- IF U_WHOIS -->
- <a href="{U_WHOIS}"><!-- IF POST_IPADDR -->{POST_IPADDR}<!-- ELSE -->{POST_IP}<!-- ENDIF --></a> (<!-- IF POST_IPADDR -->{POST_IP}<!-- ELSE --><a href="{U_LOOKUP_IP}">{L_LOOKUP_IP}</a><!-- ENDIF -->)
- <!-- ELSE -->
- <!-- IF POST_IPADDR -->{POST_IPADDR} ({POST_IP})<!-- ELSE -->{POST_IP}<!-- IF U_LOOKUP_IP --> (<a href="{U_LOOKUP_IP}">{L_LOOKUP_IP}</a>)<!-- ENDIF --><!-- ENDIF -->
- <!-- ENDIF -->
- </span></td>
- </tr>
-<!-- ENDIF -->
-<tr>
- <td class="row1"><b class="gen"><!-- IF S_PM -->{L_SENT_AT}<!-- ELSE -->{L_POSTED}<!-- ENDIF -->{L_COLON} </b></td>
- <td class="row2"><span class="postdetails">{POST_DATE}</span></td>
-</tr>
-<!-- IF S_TO_RECIPIENT -->
- <tr>
- <td class="row1" nowrap="nowrap" width="150"><b class="gen">{L_TO}{L_COLON}</b></td>
- <td class="row2 gen">
- <!-- BEGIN to_recipient -->
- <!-- IF to_recipient.IS_GROUP --><span class="sep"><a href="{to_recipient.U_VIEW}">{to_recipient.NAME}</a></span><!-- ELSE -->{to_recipient.NAME_FULL}&nbsp;<!-- ENDIF -->
- <!-- END to_recipient -->
- </td>
- </tr>
-<!-- ENDIF -->
-
-<!-- IF S_BCC_RECIPIENT -->
- <tr>
- <td class="row1" nowrap="nowrap" width="150"><b class="gen">{L_BCC}{L_COLON}</b></td>
- <td class="row2 gen">
- <!-- BEGIN bcc_recipient -->
- <!-- IF bcc_recipient.IS_GROUP --><span class="sep"><a href="{bcc_recipient.U_VIEW}">{bcc_recipient.NAME}</a></span><!-- ELSE -->{bcc_recipient.NAME_FULL}&nbsp;<!-- ENDIF -->
- <!-- END bcc_recipient -->
- </td>
- </tr>
-<!-- ENDIF -->
-<tr>
- <th colspan="2" align="center">{L_PREVIEW}</th>
-</tr>
-<tr>
- <td class="row1" colspan="2">
- <!-- IF U_EDIT --><div class="gen" style="float: {S_CONTENT_FLOW_END};"><a href="{U_EDIT}" class="imageset">{EDIT_IMG}</a></div><!-- ENDIF -->
-
- <div class="postbody">{POST_PREVIEW}</div>
-
- <!-- IF S_HAS_ATTACHMENTS -->
- <br clear="all" /><br />
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <td class="row3"><b class="genmed">{L_ATTACHMENTS}{L_COLON} </b></td>
- </tr>
- <!-- BEGIN attachment -->
- <tr>
- <!-- IF attachment.S_ROW_COUNT is even --><td class="row2"><!-- ELSE --><td class="row1"><!-- ENDIF -->{attachment.DISPLAY_ATTACHMENT}</td>
- </tr>
- <!-- END attachment -->
- </table>
- <!-- ENDIF -->
-
- </td>
-</tr>
-<!-- IF S_POST_UNAPPROVED and S_MCP_QUEUE -->
- <tr>
- <td class="cat" align="center" colspan="2"><input class="btnmain" type="submit" value="{L_APPROVE}" name="action[approve]" /> &nbsp; <input class="btnlite" type="submit" value="{L_DISAPPROVE}" name="action[disapprove]" /></td>
- </tr>
- <input type="hidden" name="post_id_list[]" value="{POST_ID}" />
-<!-- ENDIF -->
-</table>
-{S_FORM_TOKEN}
-</form>
-
-<!-- IF S_MCP_QUEUE -->
- <br clear="all" />
-
- <!-- IF S_TOPIC_REVIEW --><!-- INCLUDE posting_topic_review.html --><!-- ENDIF -->
-<!-- ELSEIF S_MCP_REPORT -->
- <br clear="all" />
-
- <!-- IF S_TOPIC_REVIEW --><!-- INCLUDE posting_topic_review.html --><!-- ENDIF -->
-<!-- ELSE -->
- <!-- IF S_CAN_LOCK_POST or S_CAN_DELETE_POST or S_CAN_CHGPOSTER or S_MCP_POST_ADDITIONAL_OPTS -->
- <br /><a name="mod" class="anchor"></a>
-
- <table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
- <tr>
- <th colspan="2" align="center">{L_MOD_OPTIONS}</th>
- </tr>
- <!-- IF S_CAN_CHGPOSTER -->
- <tr>
- <td class="row1" valign="top"><b class="gen">{L_CHANGE_POSTER}</b></td>
- <td class="row2"><form method="post" name="mcp_chgposter" action="{U_POST_ACTION}"><input class="post" type="text" name="username" value="" /> <input class="btnmain" type="submit" value="{L_CONFIRM}" name="action[chgposter]" /><br /><span class="gensmall">[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</span><!-- IF S_USER_SELECT --><br /><select name="u">{S_USER_SELECT}</select> <input type="submit" class="btnmain" name="action[chgposter_ip]" value="{L_CONFIRM}" /><!-- ENDIF -->{S_FORM_TOKEN}</form></td>
- </tr>
- <!-- ENDIF -->
-
- <!-- EVENT mcp_post_additional_options -->
-
- <!-- IF S_CAN_LOCK_POST or S_CAN_DELETE_POST -->
- <tr>
- <td class="row1" valign="top"><b class="gen">{L_MOD_OPTIONS}</b></td>
- <td class="row2"><form method="post" name="mcp" action="{U_MCP_ACTION}"><select name="action"><!-- IF S_CAN_LOCK_POST --><!-- IF S_POST_LOCKED --><option value="unlock_post">{L_UNLOCK_POST} [{L_UNLOCK_POST_EXPLAIN}]</option><!-- ELSE --><option value="lock_post">{L_LOCK_POST} [{L_LOCK_POST_EXPLAIN}]</option><!-- ENDIF --><!-- ENDIF --><!-- IF S_CAN_DELETE_POST --><option value="delete_post">{L_DELETE_POST}</option><!-- ENDIF --></select> <input class="btnmain" type="submit" value="{L_SUBMIT}" /> {S_FORM_TOKEN}</form></td>
- </tr>
- <!-- ENDIF -->
- </table>
- <!-- ENDIF -->
-
- <!-- IF S_CAN_VIEWIP -->
- <br /><a name="ip" class="anchor"></a>
-
- <table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
- <tr>
- <th colspan="2" align="center">{L_IP_INFO}</th>
- </tr>
- <tr>
- <td colspan="2" class="cat"><b class="gen">{L_OTHER_USERS}</b></td>
- </tr>
- <!-- BEGIN userrow -->
- <!-- IF userrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <td><span class="gen"><!-- IF userrow.U_PROFILE --><a href="{userrow.U_PROFILE}">{userrow.USERNAME}</a><!-- ELSE -->{userrow.USERNAME}<!-- ENDIF --> [ {userrow.NUM_POSTS} {userrow.L_POST_S} ]</span></td>
- <td align="center"><a href="{userrow.U_SEARCHPOSTS}" class="imageset">{SEARCH_IMG}</a></td>
- </tr>
- <!-- BEGINELSE -->
- <tr class="row1">
- <td colspan="2" align="center"><span class="gen">{L_NO_MATCHES_FOUND}</span></td>
- </tr>
- <!-- END userrow -->
- <tr>
- <td class="cat"><b class="gen">{L_IPS_POSTED_FROM}</b></td>
- <td class="cat" width="10%" nowrap="nowrap"><!-- IF U_LOOKUP_ALL --><span class="gen">[ <a href="{U_LOOKUP_ALL}">{L_LOOKUP_ALL}</a> ]</span><!-- ENDIF --></td>
- </tr>
- <!-- BEGIN iprow -->
- <!-- IF iprow.S_ROW_COUNT is even -->
- <tr class="row1">
- <!-- ELSE -->
- <tr class="row2">
- <!-- ENDIF -->
- <td><span class="gen"><!-- IF iprow.HOSTNAME --><a href="{iprow.U_WHOIS}">{iprow.HOSTNAME}</a> ({iprow.IP})<!-- ELSE --><a href="{iprow.U_WHOIS}">{iprow.IP}</a><!-- ENDIF --> [ {iprow.NUM_POSTS} {iprow.L_POST_S} ]</span></td>
- <td align="center"><!-- IF iprow.U_LOOKUP_IP --><span class="gen">[ <a href="{iprow.U_LOOKUP_IP}">{L_LOOKUP_IP}</a> ]</span><!-- ENDIF --></td>
- </tr>
- <!-- BEGINELSE -->
- <tr class="row1">
- <td colspan="2" align="center"><span class="gen">{L_NO_MATCHES_FOUND}</span></td>
- </tr>
- <!-- END iprow -->
- </table>
- <!-- ENDIF -->
-
-<!-- ENDIF -->
-
-<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_queue.html b/phpBB/styles/subsilver2/template/mcp_queue.html
deleted file mode 100644
index 7ca659b5da..0000000000
--- a/phpBB/styles/subsilver2/template/mcp_queue.html
+++ /dev/null
@@ -1,76 +0,0 @@
-<!-- INCLUDE mcp_header.html -->
-
-<form name="mcp" id="mcp" method="post" action="{S_MCP_ACTION}">
-
-<table width="100%" class="tablebg" cellspacing="1" cellpadding="4" border="0">
-<tr>
- <th colspan="4" nowrap="nowrap">{L_DISPLAY_OPTIONS}</th>
-</tr>
-<tr>
- <td colspan="4" class="cat" align="center"><span class="gensmall">{L_DISPLAY_ITEMS}{L_COLON}</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<span class="gensmall">{L_FORUM}</span> <select name="f">{S_FORUM_OPTIONS}</select> &nbsp; <!-- IF TOPIC_ID --><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" />&nbsp; <b>{L_ONLY_TOPIC}</b> &nbsp; <!-- ENDIF --><input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td>
-</tr>
-<tr>
- <th>&nbsp;<!-- IF S_TOPICS -->{L_TOPIC}<!-- ELSE -->{L_POST}<!-- ENDIF -->&nbsp;</th>
- <th>&nbsp;{L_AUTHOR}&nbsp;</th>
- <th>&nbsp;{L_POST_TIME}&nbsp;</th>
- <th width="5%">&nbsp;{L_SELECT}&nbsp;</th>
-</tr>
-<!-- BEGIN postrow -->
-
- <!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <td style="padding: 4px;"><p class="topictitle">{postrow.ATTACH_ICON_IMG} <a href="{postrow.U_VIEWPOST}">{postrow.POST_SUBJECT}</a></p>
- <span class="gensmall"><!-- IF postrow.U_VIEWFORUM -->{L_FORUM}{L_COLON} <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a><!-- ELSE -->{postrow.FORUM_NAME}<!-- ENDIF --></span></td>
- <td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap"><span class="gen">{postrow.POST_AUTHOR_FULL}</span><br />
- <span class="gensmall">[ <a href="{postrow.U_VIEW_DETAILS}">{L_VIEW_DETAILS}</a> ]</span></td>
- <td class="postdetails" style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap">{postrow.POST_TIME}</td>
- <td align="center">
- <!-- IF S_TOPICS -->
- <input type="checkbox" class="radio" name="topic_id_list[]" value="{postrow.TOPIC_ID}" />
- <!-- ELSE -->
- <input type="checkbox" class="radio" name="post_id_list[]" value="{postrow.POST_ID}" />
- <!-- ENDIF -->
- </td>
- </tr>
-<!-- BEGINELSE -->
- <tr>
- <td class="row1" colspan="4" height="30" align="center" valign="middle">
- <span class="gen">
- <!-- IF S_RESTORE -->
- <!-- IF S_TOPICS -->{L_NO_TOPICS_DELETED}<!-- ELSE -->{L_NO_POSTS_DELETED}<!-- ENDIF -->
- <!-- ELSE -->
- <!-- IF S_TOPICS -->{L_NO_TOPICS_QUEUE}<!-- ELSE -->{L_NO_POSTS_QUEUE}<!-- ENDIF -->
- <!-- ENDIF -->
- </span>
- </td>
- </tr>
-<!-- END postrow -->
-<tr>
- <td class="cat" colspan="4" align="center">
- <!-- IF S_RESTORE -->
- <input class="btnlite" type="submit" name="action[delete]" value="{L_DELETE}" />&nbsp;&nbsp;
- <input class="btnmain" type="submit" name="action[restore]" value="{L_RESTORE}" />
- <!-- ELSE -->
- <input class="btnmain" type="submit" name="action[approve]" value="{L_APPROVE}" />&nbsp;&nbsp;
- <input class="btnlite" type="submit" name="action[disapprove]" value="{L_DISAPPROVE}" />
- <!-- ENDIF -->
- </td>
-</tr>
-</table>
-{S_FORM_TOKEN}
-</form>
-
-<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
-<tr>
- <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">
- <b class="gensmall">
- <!-- IF S_TOPICS -->
- <a href="#" onclick="marklist('mcp', 'topic_id_list', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp', 'topic_id_list', false); return false;">{L_UNMARK_ALL}</a>
- <!-- ELSE -->
- <a href="#" onclick="marklist('mcp', 'post_id_list', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp', 'post_id_list', false); return false;">{L_UNMARK_ALL}</a>
- <!-- ENDIF -->
- </b>
- </td>
-</tr>
-</table>
-
-<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_reports.html b/phpBB/styles/subsilver2/template/mcp_reports.html
deleted file mode 100644
index 158f9c2603..0000000000
--- a/phpBB/styles/subsilver2/template/mcp_reports.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<!-- INCLUDE mcp_header.html -->
-
-<form name="mcp" id="mcp" method="post" action="{S_MCP_ACTION}">
-
-<table width="100%" class="tablebg" cellspacing="1" cellpadding="4" border="0">
-<tr>
- <th colspan="5" nowrap="nowrap">{L_DISPLAY_OPTIONS}</th>
-</tr>
-<tr>
- <td colspan="5" class="cat" align="center"><span class="gensmall">{L_DISPLAY_POSTS}{L_COLON}</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}<!-- IF not S_PM -->&nbsp;<span class="gensmall">{L_FORUM}</span> <select name="f">{S_FORUM_OPTIONS}</select> &nbsp; <!-- IF TOPIC_ID --><input type="checkbox" class="radio" name="t" value="{TOPIC_ID}" checked="checked" />&nbsp; <b>{L_ONLY_TOPIC}</b> &nbsp; <!-- ENDIF --><!-- ENDIF --><input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td>
-</tr>
-<tr>
- <!-- IF S_PM -->
- <th>&nbsp;{L_PM}&nbsp;</th>
- <th>&nbsp;{L_TO} &amp; {L_BCC}&nbsp;</th>
- <!-- ELSE -->
- <th>&nbsp;{L_POST}&nbsp;</th>
- <th>&nbsp;{L_AUTHOR}&nbsp;</th>
- <!-- ENDIF -->
- <th>&nbsp;{L_REPORTER}&nbsp;</th>
- <th>&nbsp;{L_REPORT_TIME}&nbsp;</th>
- <th width="5%">&nbsp;{L_SELECT}&nbsp;</th>
-</tr>
-<!-- BEGIN postrow -->
-
- <!-- IF postrow.S_ROW_ is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <!-- IF S_PM -->
- <td style="padding: 4px;"><p class="topictitle">{postrow.ATTACH_ICON_IMG} <a href="{postrow.U_VIEW_DETAILS}">{postrow.PM_SUBJECT}</a></p>
- <span class="gensmall">{L_PM_FROM}{L_COLON} {postrow.PM_AUTHOR_FULL}</span></td>
- <td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><span class="gen">{postrow.RECIPIENTS}</span><br />
- <span class="gensmall">{L_SENT_AT}{L_COLON} {postrow.PM_TIME}</span></td>
- <!-- ELSE -->
- <td style="padding: 4px;"><p class="topictitle">{postrow.ATTACH_ICON_IMG} <a href="{postrow.U_VIEWPOST}">{postrow.POST_SUBJECT}</a></p>
- <span class="gensmall"><!-- IF postrow.U_VIEWFORUM -->{L_FORUM}{L_COLON} <a href="{postrow.U_VIEWFORUM}">{postrow.FORUM_NAME}</a><!-- ELSE -->{postrow.FORUM_NAME}<!-- ENDIF --></span></td>
- <td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap"><span class="gen">{postrow.POST_AUTHOR_FULL}</span><br />
- <span class="gensmall">{postrow.POST_TIME}</span></td>
- <!-- ENDIF -->
- <td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap"><span class="gen">{postrow.REPORTER_FULL}</span></td>
- <td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap"><span class="gen">{postrow.REPORT_TIME}</span><br />
- <span class="gensmall">[ <a href="{postrow.U_VIEW_DETAILS}">{L_VIEW_DETAILS}</a> ]</span></td>
- <td align="center"><input type="checkbox" class="radio" name="report_id_list[]" value="{postrow.REPORT_ID}" /></td>
- </tr>
-<!-- BEGINELSE -->
- <tr>
- <td class="row1" colspan="5" height="30" align="center" valign="middle"><span class="gen">{L_NO_POSTS}</span></td>
- </tr>
-<!-- END postrow -->
-<tr>
- <td class="cat" colspan="5" align="center">
- <!-- IF S_CLOSED -->
- <input class="btnmain" type="submit" value="{L_DELETE_REPORTS}" name="action[delete]" />
- <!-- ELSE -->
- <input class="btnmain" type="submit" name="action[close]" value="{L_CLOSE_REPORTS}" /> &nbsp; <input class="btnlite" type="submit" value="{L_DELETE_REPORTS}" name="action[delete]" />
- <!-- ENDIF -->
- </td>
-</tr>
-</table>
-{S_FORM_TOKEN}
-</form>
-
-<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
-<tr>
- <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="gensmall"><a href="#" onclick="marklist('mcp', '', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp', '', false); return false;">{L_UNMARK_ALL}</a></b></td>
-</tr>
-</table>
-
-<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_topic.html b/phpBB/styles/subsilver2/template/mcp_topic.html
deleted file mode 100644
index 7d54510cee..0000000000
--- a/phpBB/styles/subsilver2/template/mcp_topic.html
+++ /dev/null
@@ -1,156 +0,0 @@
-<!-- INCLUDE mcp_header.html -->
-
-<form name="mcp" id="mcp" method="post" action="{S_MCP_ACTION}">
-
-<table class="tablebg" width="100%" cellspacing="1">
-<!-- IF S_CAN_SPLIT -->
- <tr>
- <th colspan="3" nowrap="nowrap">{L_SPLIT_TOPIC}</th>
- </tr>
- <tr>
- <td class="row2" colspan="3" align="center"><span class="gensmall">{L_SPLIT_TOPIC_EXPLAIN}</span></td>
- </tr>
- <!-- EVENT mcp_topic_options_before -->
- <tr>
- <td class="row1" nowrap="nowrap"><span class="gen">{L_SPLIT_SUBJECT}</span></td>
- <td class="row2" colspan="2"><input class="post" style="width: 350px" type="text" size="35" maxlength="124" name="subject" value="{SPLIT_SUBJECT}" /></td>
- </tr>
- <!-- EVENT mcp_topic_options_after -->
- <tr>
- <td class="row1" nowrap="nowrap"><span class="gen">{L_SPLIT_FORUM}</span></td>
- <td class="row2" colspan="2"><select name="to_forum_id">{S_FORUM_SELECT}</select></td>
- </tr>
-
- <!-- IF S_SHOW_TOPIC_ICONS -->
- <tr>
- <td class="row1"><span class="gen">{L_TOPIC_ICON}</span></td>
- <td class="row2" colspan="2">
- <table width="100%" cellspacing="0" cellpadding="0" border="0">
- <tr>
- <td><span class="genmed nowrap"><input type="radio" class="radio" name="icon" value="0"<!-- IF not S_TOPIC_ICON --> checked="checked"<!-- ENDIF --> />{L_NO_TOPIC_ICON}</span> <!-- BEGIN topic_icon --><span class="nowrap"><input type="radio" class="radio" name="icon" value="{topic_icon.ICON_ID}"<!-- IF topic_icon.S_CHECKED --> checked="checked"<!-- ENDIF --> /><img src="{topic_icon.ICON_IMG}" width="{topic_icon.ICON_WIDTH}" height="{topic_icon.ICON_HEIGHT}" alt="" title="" hspace="2" vspace="2" /></span> <!-- END topic_icon --></td>
- </tr>
- </table>
- </td>
- </tr>
- <!-- ENDIF -->
-<!-- ENDIF -->
-
-<!-- IF S_CAN_MERGE -->
- <tr>
- <th colspan="3" nowrap="nowrap">{L_MERGE_POSTS}</th>
- </tr>
- <tr>
- <td class="row2" colspan="3" align="center"><span class="gensmall">{L_MERGE_TOPIC_EXPLAIN}</span></td>
- </tr>
- <tr>
- <td class="row1" nowrap="nowrap"><span class="gen">{L_MERGE_TOPIC_ID}</span></td>
- <td class="row2" colspan="2"><input class="post" type="number" min="0" size="6" name="to_topic_id" value="{TO_TOPIC_ID}" /> <a href="{U_SELECT_TOPIC}">{L_SELECT_TOPIC}</a></td>
- </tr>
- <!-- IF TO_TOPIC_INFO -->
- <tr>
- <td class="row3" colspan="3" align="center"><b class="gen">{TO_TOPIC_INFO}</b></td>
- </tr>
- <!-- ENDIF -->
-<!-- ENDIF -->
-<tr>
- <th colspan="3" nowrap="nowrap">{L_DISPLAY_OPTIONS}</th>
-</tr>
-<tr>
- <td class="row1" nowrap="nowrap"><span class="gen">{L_POSTS_PER_PAGE}</span><br /><span class="gensmall">{L_POSTS_PER_PAGE_EXPLAIN}</span></td>
- <td class="row2" colspan="2"><input class="post" type="number" min="0" name="posts_per_page" size="6" value="{POSTS_PER_PAGE}" /></td>
-</tr>
-<tr>
- <td class="cat" colspan="3" align="center"><span class="gensmall">{L_DISPLAY_POSTS}{L_COLON}</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" name="sort" value="{L_GO}" /></td>
-</tr>
-<tr>
- <th nowrap="nowrap" colspan="3">{L_TOPIC_REVIEW}{L_COLON} <!-- EVENT mcp_topic_topic_title_before -->{TOPIC_TITLE}<!-- EVENT mcp_topic_topic_title_after --></th>
-</tr>
-<tr>
- <td class="row3" colspan="3" align="center"><span class="gensmall">{RETURN_TOPIC}</span></td>
-</tr>
-<!-- BEGIN postrow -->
-
- <!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
-
- <td align="center"><b class="postauthor">{postrow.POST_AUTHOR_FULL}</b></td>
- <td width="100%">
- <table width="100%" cellspacing="0" cellpadding="0" border="0">
- <tr style="vertical-align: top;">
- <td class="gensmall" nowrap="nowrap">&nbsp;<b>{L_POST_SUBJECT}{L_COLON}</b>&nbsp;</td>
- <td class="gensmall" width="100%">{postrow.POST_SUBJECT}</td>
- </tr>
- </table>
- </td>
- <td width="5%" align="center"><a href="{postrow.U_POST_DETAILS}" class="imageset">{INFO_IMG}</a></td>
- </tr>
-
- <!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
-
- <td width="100%" valign="top" colspan="2">
- <table width="100%" cellspacing="0" cellpadding="2" border="0">
- <tr>
- <td valign="top">
- <div class="postbody">{postrow.MESSAGE}</div>
- <!-- IF postrow.S_HAS_ATTACHMENTS -->
- <br clear="all" /><br />
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <td class="row3"><b class="genmed">{L_ATTACHMENTS}{L_COLON} </b></td>
- </tr>
- <!-- BEGIN attachment -->
- <tr>
- <!-- IF postrow.attachment.S_ROW_COUNT is even --><td class="row2"><!-- ELSE --><td class="row1"><!-- ENDIF -->{postrow.attachment.DISPLAY_ATTACHMENT}</td>
- </tr>
- <!-- END attachment -->
- </table>
- <!-- ENDIF -->
-
- </td>
- </tr>
- <tr>
- <td valign="bottom">
- <table width="100%" cellspacing="0" cellpadding="0" border="0">
- <tr valign="middle">
- <td width="100%">
- <!-- IF postrow.S_POST_UNAPPROVED and postrow.U_MCP_APPROVE --><span class="postapprove">{UNAPPROVED_IMG} <a href="{postrow.U_MCP_APPROVE}">{L_POST_UNAPPROVED}</a></span><br /><!-- ENDIF -->
- <!-- IF postrow.S_POST_DELETED and postrow.U_MCP_APPROVE --><span class="postapprove">{DELETED_IMG} <a href="{postrow.U_MCP_APPROVE}">{L_POST_DELETED}</a></span><br /><!-- ENDIF -->
- <!-- IF postrow.S_POST_REPORTED and postrow.U_MCP_REPORT --><span class="postreported">{REPORTED_IMG} <a href="{postrow.U_MCP_REPORT}">{L_POST_REPORTED}</a></span><!-- ENDIF -->
- </td>
- <td width="10" nowrap="nowrap">{postrow.MINI_POST_IMG}</td>
- <td class="gensmall" nowrap="nowrap"><b>{L_POSTED}{L_COLON}</b> {postrow.POST_DATE}</td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- <td width="5%" align="center"><input type="checkbox" class="radio" name="post_id_list[]" value="{postrow.POST_ID}"<!-- IF postrow.S_CHECKED --> checked="checked"<!-- ENDIF --> /></td>
- </tr>
- <tr>
- <td class="row3" colspan="3" height="1"><img src="images/spacer.gif" width="1" height="1" alt="" /></td>
- </tr>
-<!-- END postrow -->
-<tr>
- <td class="cat" colspan="3" align="center"><select name="action"><option value="" selected="selected">{L_SELECT_ACTION}</option>
- <!-- IF S_CAN_APPROVE --><option value="approve">{L_APPROVE_POSTS}</option><!-- ENDIF -->
- <!-- IF S_CAN_LOCK --><option value="lock_post">{L_LOCK_POST_POSTS} [ {L_LOCK_POST_EXPLAIN} ]</option><option value="unlock_post">{L_UNLOCK_POST_POSTS}</option><!-- ENDIF -->
- <!-- IF S_CAN_DELETE --><option value="delete_post">{L_DELETE_POSTS}</option><!-- ENDIF -->
- <!-- IF S_CAN_RESTORE --><option value="restore">{L_RESTORE_POSTS}</option><!-- ENDIF -->
- <!-- IF S_CAN_MERGE --><option value="merge_posts"<!-- IF ACTION eq 'merge' --> selected="selected"<!-- ENDIF -->>{L_MERGE_POSTS}</option><!-- ENDIF -->
- <!-- IF S_CAN_SPLIT --><option value="split_all"<!-- IF ACTION eq 'split' --> selected="selected"<!-- ENDIF -->>{L_SPLIT_POSTS}</option><option value="split_beyond">{L_SPLIT_AFTER}</option><!-- ENDIF -->
- <!-- IF S_CAN_SYNC --><option value="resync">{L_RESYNC}</option><!-- ENDIF -->
- </select>&nbsp;<input class="btnmain" type="submit" name="mcp_topic_submit" value="{L_SUBMIT}" /></td>
-</tr>
-</table>
-{S_HIDDEN_FIELDS}
-{S_FORM_TOKEN}
-</form>
-
-<table width="100%" cellspacing="2" cellpadding="2" border="0" align="center">
-<tr>
- <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="gensmall"><a href="#" onclick="marklist('mcp', '', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('mcp', '', false); return false;">{L_UNMARK_ALL}</a></b></td>
-</tr>
-</table>
-
-<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_warn_front.html b/phpBB/styles/subsilver2/template/mcp_warn_front.html
deleted file mode 100644
index f6daec9cc5..0000000000
--- a/phpBB/styles/subsilver2/template/mcp_warn_front.html
+++ /dev/null
@@ -1,74 +0,0 @@
-<!-- INCLUDE mcp_header.html -->
-
-<form method="post" name="mcp" action="{U_POST_ACTION}">
-
-<table class="tablebg" width="100%" cellspacing="1" border="0" align="center">
-<tr>
- <th colspan="2"align="center">{L_SELECT_USER}</th>
-</tr>
-<tr>
- <td class="row1" width="40%"><b class="gen">{L_FIND_USERNAME}{L_COLON} </b><br /><span class="gensmall">[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</span></td>
- <td class="row2"><input type="text" class="post" name="username" size="20" /></td>
-</tr>
-<tr>
- <td class="cat" colspan="2" align="center"><input type="submit" name="submituser" value="{L_SUBMIT}" class="btnmain" /></td>
-</tr>
-</table>
-{S_FORM_TOKEN}
-</form>
-
-<br clear="all" /><br />
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <td class="row3" colspan="4" align="center"><b class="gen">{L_MOST_WARNINGS}</b></td>
-</tr>
-<tr>
- <th>&nbsp;{L_USERNAME}&nbsp;</th>
- <th>&nbsp;{L_WARNINGS}&nbsp;</th>
- <th>&nbsp;{L_LATEST_WARNING_TIME}&nbsp;</th>
- <th>&nbsp;</th>
-</tr>
-<!-- BEGIN highest -->
- <tr>
- <td class="row1" width="15%" valign="top"><span class="gen">{highest.USERNAME_FULL}</span></td>
- <td class="row2" width="15%" valign="top"><span class="gen">{highest.WARNINGS}</span></td>
- <td class="row1" width="15%" valign="top"><span class="gen">{highest.WARNING_TIME}</span></td>
- <td class="row2" width="15%" valign="top"><span class="gen"><a href="{highest.U_NOTES}">{L_VIEW_NOTES}</a></span></td>
- </tr>
-<!-- BEGINELSE -->
- <tr>
- <td class="row1" colspan="4" align="center"><span class="gen">{L_NO_WARNINGS}</span></td>
- </tr>
-<!-- END highest -->
-</table>
-
-<br clear="all" /><br />
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <td class="row3" colspan="4" align="center"><b class="gen">{L_LATEST_WARNINGS}</b></td>
-</tr>
-<tr>
- <th>&nbsp;{L_USERNAME}&nbsp;</th>
- <th>&nbsp;{L_TIME}&nbsp;</th>
- <th>&nbsp;{L_TOTAL_WARNINGS}&nbsp;</th>
- <th>&nbsp;</th>
-</tr>
-<!-- BEGIN latest -->
- <tr>
- <td class="row1" width="15%" valign="top"><span class="gen">{latest.USERNAME_FULL}</span></td>
- <td class="row2" width="15%" valign="top"><span class="gen">{latest.WARNING_TIME}</span></td>
- <td class="row1" width="15%" valign="top"><span class="gen">{latest.WARNINGS}</span></td>
- <td class="row2" width="15%" valign="top"><span class="gen"><a href="{latest.U_NOTES}">{L_VIEW_NOTES}</a></span></td>
- </tr>
-<!-- BEGINELSE -->
- <tr>
- <td class="row1" colspan="4" align="center"><span class="gen">{L_NO_WARNINGS}</span></td>
- </tr>
-<!-- END latest -->
-</table>
-
-<br clear="all" /><br />
-
-<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_warn_list.html b/phpBB/styles/subsilver2/template/mcp_warn_list.html
deleted file mode 100644
index 6e263b6403..0000000000
--- a/phpBB/styles/subsilver2/template/mcp_warn_list.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<!-- INCLUDE mcp_header.html -->
-
-<form method="post" name="mcp" action="{U_POST_ACTION}">
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <td class="row3" colspan="4" align="center"><b class="gen">{L_WARNED_USERS}</b></td>
-</tr>
-<tr>
- <th>&nbsp;{L_USERNAME}&nbsp;</th>
- <th>&nbsp;{L_WARNINGS}&nbsp;</th>
- <th>&nbsp;{L_LATEST_WARNING_TIME}&nbsp;</th>
- <th>&nbsp;</th>
-</tr>
-<!-- BEGIN user -->
- <tr>
- <td class="row1" width="15%" valign="top"><span class="gen">{user.USERNAME_FULL}</span></td>
- <td class="row2" width="15%" valign="top"><span class="gen">{user.WARNINGS}</span></td>
- <td class="row1" width="15%" valign="top"><span class="gen">{user.WARNING_TIME}</span></td>
- <td class="row2" width="15%" valign="top"><span class="gen"><a href="{user.U_NOTES}">{L_VIEW_NOTES}</a></span></td>
- </tr>
-<!-- BEGINELSE -->
- <tr>
- <td class="row1" colspan="4" align="center"><span class="gen">{L_NO_WARNINGS}</span></td>
- </tr>
-<!-- END user -->
-<tr align="center">
- <td class="row3" colspan="4"><span class="gensmall">{L_DISPLAY_POSTS}{L_COLON}</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" value="{L_GO}" name="sort" /></td>
-</tr>
-</table>
-
-<table width="100%" cellspacing="0" cellpadding="0">
-<tr>
- <td class="pagination">{PAGE_NUMBER} [ {TOTAL_USERS} ]</td>
- <td align="{S_CONTENT_FLOW_END}"><span class="pagination"><!-- INCLUDE pagination.html --></span></td>
-</tr>
-</table>
-{S_FORM_TOKEN}
-</form>
-
-<br clear="all" /><br />
-
-<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_warn_post.html b/phpBB/styles/subsilver2/template/mcp_warn_post.html
deleted file mode 100644
index 68715eff2d..0000000000
--- a/phpBB/styles/subsilver2/template/mcp_warn_post.html
+++ /dev/null
@@ -1,67 +0,0 @@
-<!-- INCLUDE mcp_header.html -->
-
-<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
-<tr>
- <th colspan="2" align="center">{L_POST}</th>
-</tr>
-<tr>
- <td class="row1" align="center">
- <table cellspacing="1" cellpadding="2" border="0">
- <tr>
- <td class="gen" align="center"><!-- IF USER_COLOR --><b style="color: #{USER_COLOR}"><!-- ELSE --><b><!-- ENDIF -->{USERNAME}</b></td>
- </tr>
- <!-- IF RANK_TITLE -->
- <tr>
- <td class="postdetails" align="center">{RANK_TITLE}</td>
- </tr>
- <!-- ENDIF -->
- <!-- IF RANK_IMG -->
- <tr>
- <td align="center">{RANK_IMG}</td>
- </tr>
- <!-- ENDIF -->
- <tr>
- <td align="center"><!-- IF AVATAR_IMG -->{AVATAR_IMG}<!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" alt="" /><!-- ENDIF --></td>
- </tr>
- </table>
- </td>
- <td class="row1">
- <span class="gen">{POST}</span>
- </td>
-</tr>
-</table>
-
-<br clear="all" /><br />
-
-<form method="post" name="mcp" action="{U_POST_ACTION}">
-
-<!-- EVENT mcp_warn_post_add_warning_field_before -->
-
-<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
-<tr>
- <th align="center">{L_ADD_WARNING}</th>
-</tr>
-<tr>
- <td class="row3" align="center"><span class="genmed">{L_ADD_WARNING_EXPLAIN}</span></td>
-</tr>
-<tr>
- <td class="row1" align="center"><textarea name="warning" rows="10" cols="76">{L_WARNING_POST_DEFAULT}</textarea></td>
-</tr>
-<!-- IF S_CAN_NOTIFY -->
-<tr>
- <td class="row1" align="center"><input type="checkbox" class="radio" name="notify_user" checked="checked" /><span class="genmed">{L_NOTIFY_USER_WARN}</span></td>
-</tr>
-<!-- ENDIF -->
-<tr>
- <td class="cat" align="center"><input class="btnmain" type="submit" name="action[add_warning]" value="{L_SUBMIT}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" /></td>
-</tr>
-</table>
-
-<!-- EVENT mcp_warn_post_add_warning_field_after -->
-
-{S_FORM_TOKEN}
-</form>
-
-<br clear="all" /><br />
-
-<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_warn_user.html b/phpBB/styles/subsilver2/template/mcp_warn_user.html
deleted file mode 100644
index 20b57c6837..0000000000
--- a/phpBB/styles/subsilver2/template/mcp_warn_user.html
+++ /dev/null
@@ -1,80 +0,0 @@
-<!-- INCLUDE mcp_header.html -->
-
-<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
-<tr>
- <th colspan="2" align="center">{USERNAME}</th>
-</tr>
-<tr>
- <td class="row1" align="center">
- <table cellspacing="1" cellpadding="2" border="0">
- <tr>
- <td class="gen" align="center"><b>{USERNAME_FULL}</b></td>
- </tr>
- <!-- IF RANK_TITLE -->
- <tr>
- <td class="postdetails" align="center">{RANK_TITLE}</td>
- </tr>
- <!-- ENDIF -->
- <!-- IF RANK_IMG -->
- <tr>
- <td align="center">{RANK_IMG}</td>
- </tr>
- <!-- ENDIF -->
- <tr>
- <td align="center"><!-- IF AVATAR_IMG -->{AVATAR_IMG}<!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" alt="" /><!-- ENDIF --></td>
- </tr>
- </table>
- </td>
- <td class="row1">
- <table width="100%" cellspacing="1" cellpadding="2" border="0">
- <tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_JOINED}{L_COLON} </td>
- <td width="100%"><b class="gen">{JOINED}</b></td>
- </tr>
- <tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_TOTAL_POSTS}{L_COLON} </td>
- <td><b class="gen">{POSTS}</b></td>
- </tr>
- <tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_WARNINGS}{L_COLON} </td>
- <td><b class="gen">{WARNINGS}</b></td>
- </tr>
- </table>
- </td>
-</tr>
-</table>
-
-<br clear="all" /><br />
-
-<form method="post" name="mcp" action="{U_POST_ACTION}">
-
-<!-- EVENT mcp_warn_user_add_warning_field_before -->
-
-<table width="100%" cellpadding="3" cellspacing="1" border="0" class="tablebg">
-<tr>
- <th align="center">{L_ADD_WARNING}</th>
-</tr>
-<tr>
- <td class="row3" align="center"><span class="genmed">{L_ADD_WARNING_EXPLAIN}</span></td>
-</tr>
-<tr>
- <td class="row1" align="center"><textarea name="warning" rows="10" cols="76"></textarea></td>
-</tr>
-<!-- IF S_CAN_NOTIFY -->
-<tr>
- <td class="row1" align="center"><input type="checkbox" class="radio" name="notify_user" checked="checked" /><span class="genmed">{L_NOTIFY_USER_WARN}</span></td>
-</tr>
-<!-- ENDIF -->
-<tr>
- <td class="cat" align="center"><input class="btnmain" type="submit" name="action[add_warning]" value="{L_SUBMIT}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" /></td>
-</tr>
-</table>
-
-<!-- EVENT mcp_warn_user_add_warning_field_after -->
-
-{S_FORM_TOKEN}
-</form>
-
-<br clear="all" /><br />
-
-<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/mcp_whois.html b/phpBB/styles/subsilver2/template/mcp_whois.html
deleted file mode 100644
index 3e3b983059..0000000000
--- a/phpBB/styles/subsilver2/template/mcp_whois.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!-- INCLUDE mcp_header.html -->
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th>{L_WHOIS}</th>
-</tr>
-<tr>
- <td class="row3" align="center"><span class="gensmall">{RETURN_POST}</span></td>
-</tr>
-<tr>
- <td class="row1"><pre>{WHOIS}</pre></td>
-</tr>
-</table>
-
-<!-- INCLUDE mcp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/memberlist_body.html b/phpBB/styles/subsilver2/template/memberlist_body.html
deleted file mode 100644
index 79b78f32a4..0000000000
--- a/phpBB/styles/subsilver2/template/memberlist_body.html
+++ /dev/null
@@ -1,117 +0,0 @@
-<!-- IF S_IN_SEARCH_POPUP -->
- <!-- INCLUDE simple_header.html -->
-<!-- ELSE -->
- <!-- INCLUDE overall_header.html -->
-<!-- ENDIF -->
-
-<!-- IF S_SEARCH_USER -->
- <!-- INCLUDE memberlist_search.html -->
-<!-- ENDIF -->
-
-<!-- IF S_SHOW_GROUP --><!-- INCLUDE memberlist_group.html --><!-- ENDIF -->
-
-<!-- IF not S_SHOW_GROUP -->
- <form method="post" name="charsearch" action="{S_MODE_ACTION}">
- <table width="100%" cellspacing="1">
- <tr>
- <td align="{S_CONTENT_FLOW_BEGIN}"><span class="genmed">{L_USERNAME_BEGINS_WITH}{L_COLON} </span>
- <select name="first_char" onchange="this.form.submit();">
- <!-- BEGIN first_char -->
- <option value="{first_char.VALUE}"<!-- IF first_char.S_SELECTED --> selected="selected"<!-- ENDIF -->>{first_char.DESC}</option>
- <!-- END first_char -->
- </select>&nbsp;<input type="submit" name="char" value="{L_DISPLAY}" class="btnlite" /></td>
- <!-- IF U_FIND_MEMBER and not S_SEARCH_USER -->
- <td class="genmed" align="{S_CONTENT_FLOW_END}"><a href="{U_FIND_MEMBER}">{L_FIND_USERNAME}</a></td>
- <!-- ELSEIF S_SEARCH_USER and U_HIDE_FIND_MEMBER and not S_IN_SEARCH_POPUP -->
- <td class="genmed" align="{S_CONTENT_FLOW_END}"><a href="{U_HIDE_FIND_MEMBER}">{L_HIDE_MEMBER_SEARCH}</a></td>
- <!-- ENDIF -->
- </tr>
- </table>
- {S_FORM_TOKEN}
- </form>
-<!-- ENDIF -->
-
-<!-- IF S_IN_SEARCH_POPUP -->
- <form method="post" name="results" action="{S_MODE_ACTION}" onsubmit="insert_marked(this.user);return false">
-<!-- ELSE -->
- <form method="post" action="{S_MODE_ACTION}">
-<!-- ENDIF -->
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th nowrap="nowrap">#</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%"><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>
-<!-- BEGIN memberrow -->
-
- <!-- IF S_SHOW_GROUP -->
- <!-- IF memberrow.S_FIRST_ROW and memberrow.S_GROUP_LEADER -->
- <tr class="row3">
- <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="7"><b class="gensmall">{L_GROUP_MEMBERS}</b></td>
- </tr>
- <!-- DEFINE $S_MEMBER_HEADER = 1 -->
- <!-- ENDIF -->
- <!-- ENDIF -->
-
- <!-- IF memberrow.S_ROW_COUNT is even --><tr class="row2"><!-- ELSE --> <tr class="row1"><!-- ENDIF -->
-
- <td class="gen" align="center">&nbsp;{memberrow.ROW_NUMBER}&nbsp;</td>
- <td class="genmed" align="{S_CONTENT_FLOW_BEGIN}"><!-- EVENT memberlist_body_username_prepend -->{memberrow.USERNAME_FULL}<!-- EVENT memberlist_body_username_append --><!-- IF S_SELECT_SINGLE --> [&nbsp;<a href="#" onclick="insert_single('{memberrow.A_USERNAME}'); return false;">{L_SELECT}</a>&nbsp;]<!-- ENDIF --></td>
- <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"><!-- EVENT memberlist_body_rank_prepend --><!-- IF memberrow.RANK_IMG -->{memberrow.RANK_IMG}<!-- ELSE -->{memberrow.RANK_TITLE}<!-- ENDIF --><!-- EVENT memberlist_body_rank_append --></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. -->
- <td class="gen" align="center">&nbsp;{memberrow.PROFILE_FIELD1_VALUE}</td>
- <!-- ENDIF -->
- <!-- IF S_IN_SEARCH_POPUP and not S_SELECT_SINGLE --><td align="center"><input type="checkbox" class="radio" name="user" value="{memberrow.USERNAME}" /></td><!-- ENDIF -->
- </tr>
-
-<!-- BEGINELSE -->
-
- <tr>
- <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>
-
-<!-- END memberrow -->
-
-<tr>
- <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}
-
-</form>
-
-<table width="100%" cellspacing="0" cellpadding="0">
-<tr>
- <td class="pagination">{PAGE_NUMBER} [ {TOTAL_USERS} ]</td>
- <td align="{S_CONTENT_FLOW_END}"><!-- IF S_IN_SEARCH_POPUP and not S_SELECT_SINGLE --><b class="nav"><a href="#" onclick="marklist('results', 'user', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('results', 'user', false); return false;">{L_UNMARK_ALL}</a></b><br /><!-- ENDIF --><span class="pagination"><!-- INCLUDE pagination.html --></span></td>
-</tr>
-</table>
-
-
-
-<!-- IF S_IN_SEARCH_POPUP -->
- <!-- INCLUDE simple_footer.html -->
-<!-- ELSE -->
- <br clear="all" />
-
- <!-- INCLUDE breadcrumbs.html -->
-
- <br clear="all" />
-
- <div align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></div>
- <!-- INCLUDE overall_footer.html -->
-<!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/memberlist_email.html b/phpBB/styles/subsilver2/template/memberlist_email.html
deleted file mode 100644
index 78ab3e4b8d..0000000000
--- a/phpBB/styles/subsilver2/template/memberlist_email.html
+++ /dev/null
@@ -1,105 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<div id="pagecontent">
-
- <form action="{S_POST_ACTION}" method="post" name="postform">
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <!-- IF S_CONTACT_ADMIN-->
- <th colspan="2">{L_CONTACT_ADMIN}</th>
- <!-- ELSEIF S_SEND_USER -->
- <th colspan="2">{L_SEND_EMAIL_USER}</th>
- <!-- ELSE -->
- <th colspan="2">{L_EMAIL_TOPIC}</th>
- <!-- ENDIF -->
- </tr>
- <!-- IF ERROR_MESSAGE -->
- <tr>
- <td class="row3" colspan="2" align="center"><span class="error">{ERROR_MESSAGE}</span></td>
- </tr>
- <!-- ENDIF -->
- <!-- IF CONTACT_INFO -->
- <tr>
- <td class="row1" colspan="2">{CONTACT_INFO}</td>
- </tr>
- <!-- ENDIF -->
- <!-- IF S_SEND_USER -->
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_RECIPIENT}</b></td>
- <td class="row2" width="65%"><b class="genmed">{USERNAME}</b></td>
- </tr>
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_SUBJECT}</b></td>
- <td class="row2"><input class="post" type="text" name="subject" size="50" tabindex="2" value="{SUBJECT}" /></td>
- </tr>
- <!-- ELSEIF S_CONTACT_ADMIN-->
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_RECIPIENT}</b></td>
- <td class="row2" width="65%"><b class="genmed">{L_ADMINISTRATOR}</b></td>
- </tr>
- <!-- IF not S_IS_REGISTERED -->
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_SENDER_EMAIL_ADDRESS}</b></td>
- <td class="row2"><input class="post" type="text" name="email" size="50" maxlength="100" value="{EMAIL}" /></td>
- </tr>
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_SENDER_NAME}</b></td>
- <td class="row2"><input class="post" type="text" name="name" size="50" value="{NAME}" /></td>
- </tr>
- <!-- ENDIF -->
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_SUBJECT}</b></td>
- <td class="row2"><input class="post" type="text" name="subject" size="50" tabindex="2" value="{SUBJECT}" /></td>
- </tr>
- <!-- ELSE -->
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_EMAIL_ADDRESS}</b></td>
- <td class="row2"><input class="post" type="email" name="email" size="50" maxlength="100" value="{EMAIL}" /></td>
- </tr>
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_REAL_NAME}</b></td>
- <td class="row2"><input class="post" type="text" name="name" size="50" value="{NAME}" /></td>
- </tr>
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_DEST_LANG}</b><br /><span class="gensmall">{L_DEST_LANG_EXPLAIN}</span></td>
- <td class="row2"><select name="lang">{S_LANG_OPTIONS}</select></td>
- </tr>
- <!-- ENDIF -->
- <tr>
- <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_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>
- </table>
-
- {S_FORM_TOKEN}
-
- </form>
-
-</div>
-
-<br clear="all" />
-
-<!-- INCLUDE breadcrumbs.html -->
-
-<br clear="all" />
-
-<div style="float: {S_CONTENT_FLOW_END};"><!-- INCLUDE jumpbox.html --></div>
-
-<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/memberlist_group.html b/phpBB/styles/subsilver2/template/memberlist_group.html
deleted file mode 100644
index 4140c8cdbf..0000000000
--- a/phpBB/styles/subsilver2/template/memberlist_group.html
+++ /dev/null
@@ -1,17 +0,0 @@
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th colspan="3">{L_GROUP_INFORMATION}</th>
-</tr>
-<tr>
- <td class="row1" width="20%"><b class="genmed">{L_GROUP_NAME}{L_COLON}</b></td>
- <td class="row2"><b class="gen"<!-- IF GROUP_COLOR --> style="color:#{GROUP_COLOR}"<!-- ENDIF -->>{GROUP_NAME}</b></td>
-<!-- IF AVATAR_IMG or RANK_IMG or GROUP_RANK or U_PM -->
- <td class="row1" width="33%" rowspan="2" align="center"><!-- IF AVATAR_IMG -->{AVATAR_IMG}<br /><!-- ENDIF --><!-- IF RANK_IMG -->{RANK_IMG}<!-- ENDIF --><!-- IF GROUP_RANK --><span class="gensmall">{GROUP_RANK}</span><br /><br /><!-- ENDIF --><!-- IF U_PM --><a href="{U_PM}" class="imageset">{PM_IMG}</a><!-- ENDIF --></td>
-<!-- ENDIF -->
-</tr>
-<tr>
- <td class="row1" width="20%"><b class="genmed">{L_GROUP_DESC}{L_COLON}</b></td>
- <td class="row2"><span class="gen">{GROUP_DESC}</span><p class="forumdesc">{GROUP_TYPE}</p></td>
-</tr>
-</table>
diff --git a/phpBB/styles/subsilver2/template/memberlist_im.html b/phpBB/styles/subsilver2/template/memberlist_im.html
deleted file mode 100644
index a19229605a..0000000000
--- a/phpBB/styles/subsilver2/template/memberlist_im.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<!-- INCLUDE simple_header.html -->
-
-<br clear="all" />
-
-<form method="post" action="{S_IM_ACTION}">
- <table class="tablebg" width="95%" cellspacing="1" cellpadding="4" border="0" align="center">
- <tr>
- <th colspan="2">{L_SEND_IM}</th>
- </tr>
- <tr>
- <td class="row3" colspan="2"><span class="gensmall">{L_SEND_IM_EXPLAIN}</span></td>
- </tr>
- <tr>
- <td class="row1"><b class="genmed">{L_IM_RECIPIENT}{L_COLON} </b></td>
- <td class="row2"><span class="gen"><b>{USERNAME}</b><!-- IF S_NO_SEND_JABBER --> [ {IM_CONTACT} ]<!-- ENDIF --></span> <!-- IF PRESENCE_IMG -->{PRESENCE_IMG}<!-- ENDIF --></td>
- </tr>
-
- <!-- IF S_SEND_JABBER -->
- <tr>
- <td class="row1"><b class="genmed">{L_IM_MESSAGE}{L_COLON} </b></td>
- <td class="row2"><textarea class="post" name="message" rows="5" cols="45"></textarea></td>
- </tr>
- <tr>
- <td class="cat" colspan="2" align="center"><input class="btnmain" name="submit" type="submit" value="{L_IM_SEND}" /></td>
- </tr>
- <tr>
- <td class="row1" colspan="2" align="center"><span class="gen">{L_IM_SENT_JABBER}</span></td>
- </tr>
- <tr>
- <td class="cat" colspan="2" align="center"></td>
- </tr>
- <!-- ELSEIF S_NO_SEND_JABBER -->
- <tr>
- <td class="row1" colspan="2"><span class="genmed">{L_IM_NO_JABBER}</span></td>
- </tr>
- <!-- ENDIF -->
-
- </table>
-{S_FORM_TOKEN}
-</form>
-
-<a class="nav" href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a>
-
-<!-- INCLUDE simple_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/memberlist_search.html b/phpBB/styles/subsilver2/template/memberlist_search.html
deleted file mode 100644
index 2096062607..0000000000
--- a/phpBB/styles/subsilver2/template/memberlist_search.html
+++ /dev/null
@@ -1,129 +0,0 @@
-<!-- You should retain this javascript in your own template! -->
-
-<!-- IF S_IN_SEARCH_POPUP -->
- <script type="text/javascript">
- // <![CDATA[
- function insert_user(user)
- {
- opener.document.forms['{S_FORM_NAME}'].{S_FIELD_NAME}.value = ( opener.document.forms['{S_FORM_NAME}'].{S_FIELD_NAME}.value.length && opener.document.forms['{S_FORM_NAME}'].{S_FIELD_NAME}.type == "textarea" ) ? opener.document.forms['{S_FORM_NAME}'].{S_FIELD_NAME}.value + "\n" + user : user;
- }
-
- function insert_marked(users)
- {
- if (typeof(users.length) == "undefined")
- {
- if (users.checked)
- {
- insert_user(users.value);
- }
- }
- else if (users.length > 0)
- {
- for (i = 0; i < users.length; i++)
- {
- if (users[i].checked)
- {
- insert_user(users[i].value);
- }
- }
- }
-
- self.close();
- }
-
- function insert_single(user)
- {
- opener.document.forms['{S_FORM_NAME}'].{S_FIELD_NAME}.value = user;
- self.close();
- }
-
- /**
- * Mark/unmark checklist
- * id = ID of parent container, name = name prefix, state = state [true/false]
- */
- function marklist(id, name, state)
- {
- var parent = document.getElementById(id) || document[id];
-
- if (!parent)
- {
- return;
- }
-
- var rb = parent.getElementsByTagName('input');
-
- for (var r = 0; r < rb.length; r++)
- {
- if (rb[r].name.substr(0, name.length) == name)
- {
- rb[r].checked = state;
- }
- }
- }
- // ]]>
- </script>
-<!-- ENDIF -->
-
-<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>
-</tr>
-<tr>
- <td class="row3" colspan="4"><span class="gensmall">{L_FIND_USERNAME_EXPLAIN}</span></td>
-</tr>
-<tr>
- <td class="row1"><b class="genmed">{L_USERNAME}{L_COLON}</b></td>
- <td class="row2"><input class="post" type="text" name="username" value="{USERNAME}" /></td>
- <!-- IF S_EMAIL_SEARCH_ALLOWED -->
- <td class="row1"><b class="genmed">{L_EMAIL}{L_COLON}</b></td>
- <td class="row2"><input class="post" type="email" name="email" value="{EMAIL}" /></td>
- <!-- ELSE -->
- <td colspan="2" class="row1">&nbsp;</td>
- <!-- ENDIF -->
-</tr>
-<tr>
- <td class="row1"><b class="genmed">{L_JOINED}{L_COLON}</b></td>
- <td class="row2"><select name="joined_select">{S_JOINED_TIME_OPTIONS}</select> <input class="post" type="text" name="joined" value="{JOINED}" /></td>
- <td class="row1"><b class="genmed">{L_POSTS}{L_COLON}</b></td>
- <td class="row2"><select name="count_select">{S_COUNT_OPTIONS}</select> <input class="post" type="number" min="0" name="count" value="{COUNT}" /></td>
-</tr>
-<!-- IF S_VIEWONLINE -->
-<tr>
- <td class="row1"><b class="genmed">{L_LAST_ACTIVE}{L_COLON}</b></td>
- <td class="row2"><select name="active_select">{S_ACTIVE_TIME_OPTIONS}</select> <input class="post" type="text" name="active" value="{ACTIVE}" /></td>
- <!-- IF S_IP_SEARCH_ALLOWED -->
- <td class="row1"><b class="genmed">{L_POST_IP}{L_COLON}</b></td>
- <td class="row2"><input class="post" type="text" name="ip" value="{IP}" /></td>
- <!-- ELSE -->
- <td colspan="2" class="row1">&nbsp;</td>
- <!-- ENDIF -->
-</tr>
-<!-- ENDIF -->
-<tr>
- <td class="row1"><b class="genmed">{L_GROUP}{L_COLON}</b></td>
- <td class="row2" nowrap="nowrap"><select name="search_group_id">{S_GROUP_SELECT}</select></td>
- <!-- IF S_JABBER_ENABLED -->
- <td class="row1"><b class="genmed">{L_JABBER}{L_COLON}</b></td>
- <td class="row2"><input class="post" type="text" name="jabber" value="{JABBER}" /></td>
- <!-- ELSE -->
- <td colspan="2" class="row1">&nbsp;</td>
- <!-- ENDIF -->
-</tr>
-<!-- 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>
- <td colspan="2" class="row1">&nbsp;</td>
-</tr>
-<tr>
- <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>
-
-<br clear="all" />
diff --git a/phpBB/styles/subsilver2/template/memberlist_team.html b/phpBB/styles/subsilver2/template/memberlist_team.html
deleted file mode 100644
index a4f38aafc4..0000000000
--- a/phpBB/styles/subsilver2/template/memberlist_team.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<form method="post" action="{S_MODE_ACTION}">
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th nowrap="nowrap" width="20%">{L_USERNAME}</th>
- <!-- IF S_DISPLAY_MODERATOR_FORUMS --><th nowrap="nowrap" width="25%">{L_FORUMS}</th><!-- ENDIF -->
- <th nowrap="nowrap" width="20%">{L_PRIMARY_GROUP}</th>
- <th nowrap="nowrap" width="15%">{L_RANK}</th>
- <th nowrap="nowrap" width="11%">{L_SEND_MESSAGE}</th>
-</tr>
-<!-- BEGIN group -->
-<tr class="row3">
- <td colspan="5"><b class="gensmall"><!-- IF group.U_GROUP --><a href="{group.U_GROUP}">{group.GROUP_NAME}</a><!-- ELSE -->{group.GROUP_NAME}<!-- ENDIF --></b></td>
-</tr>
-<!-- BEGIN user -->
- <!-- IF group.user.S_ROW_COUNT is even --><tr class="row2"><!-- ELSE --><tr class="row1"><!-- ENDIF -->
-
- <td class="gen" align="center"><strong>{group.user.USERNAME_FULL}</strong></td>
- <!-- IF S_DISPLAY_MODERATOR_FORUMS --><td class="gensmall" align="center"><!-- IF group.user.FORUM_OPTIONS --><select style="width: 100%;">{group.user.FORUMS}</select><!-- ELSEIF group.user.FORUMS -->{group.user.FORUMS}<!-- ELSE -->-<!-- ENDIF --></td><!-- ENDIF -->
- <td class="gensmall" align="center" nowrap="nowrap">&nbsp;
- <!-- IF group.user.U_GROUP -->
- <a<!-- IF group.user.GROUP_COLOR --> style="font-weight: bold; color:#{group.user.GROUP_COLOR}"<!-- ENDIF --> href="{group.user.U_GROUP}">{group.user.GROUP_NAME}</a>
- <!-- ELSE -->
- {group.user.GROUP_NAME}
- <!-- ENDIF -->
- &nbsp;</td>
- <td class="gen" align="center"><!-- IF group.user.RANK_IMG -->{group.user.RANK_IMG}<!-- ELSE -->{group.user.RANK_TITLE}<!-- ENDIF --></td>
- <td class="gen" align="center">&nbsp;<!-- IF group.user.U_PM --><a href="{group.user.U_PM}" class="imageset">{PM_IMG}</a><!-- ENDIF -->&nbsp;</td>
-</tr>
-<!-- BEGINELSE -->
- <tr>
- <td class="row1" colspan="5" align="center"><span class="gen">{L_NO_MEMBERS}</span></td>
- </tr>
-<!-- END user -->
-<!-- END group -->
-</table>
-
-</form>
-
-<br clear="all" />
-
-<!-- INCLUDE breadcrumbs.html -->
-
-<br clear="all" />
-
-<div style="float: {S_CONTENT_FLOW_END};"><!-- INCLUDE jumpbox.html --></div>
-
-<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/memberlist_view.html b/phpBB/styles/subsilver2/template/memberlist_view.html
deleted file mode 100644
index 24e96c412c..0000000000
--- a/phpBB/styles/subsilver2/template/memberlist_view.html
+++ /dev/null
@@ -1,201 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<div id="pagecontent">
-
- <!-- EVENT memberlist_view_content_prepend -->
-
- <form method="post" action="{S_PROFILE_ACTION}">
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th colspan="2" nowrap="nowrap">{L_VIEWING_PROFILE}</th>
- </tr>
- <tr>
- <td class="cat" width="40%" align="center"><h4>{L_USER_PRESENCE}</h4></td>
- <td class="cat" width="60%" align="center"><h4>{L_USER_FORUM}</h4></td>
- </tr>
- <tr>
- <td class="row1" align="center">
-
- <table cellspacing="1" cellpadding="2" border="0">
- <!-- IF S_USER_INACTIVE -->
- <tr>
- <td align="center"><b class="gen inactive">{L_USER_IS_INACTIVE}</b><br />{L_INACTIVE_REASON}{L_COLON} {USER_INACTIVE_REASON}<br /><br /></td>
- </tr>
- <!-- ENDIF -->
- <tr>
- <td align="center"><!-- IF USER_COLOR --><b class="gen" style="color: {USER_COLOR}"><!-- ELSE --><b class="gen"><!-- ENDIF -->{USERNAME}</b><!-- IF U_USER_BAN --><span class="genmed"> [ <a href="{U_USER_BAN}">{L_USER_BAN}</a> ]</span><!-- ENDIF --><!-- IF U_USER_ADMIN --><span class="genmed"> [ <a href="{U_USER_ADMIN}">{L_USER_ADMIN}</a> ]</span><!-- ENDIF --></td>
- </tr>
- <!-- EVENT memberlist_view_rank_before -->
- <!-- IF RANK_TITLE -->
- <tr>
- <td class="postdetails" align="center">{RANK_TITLE}</td>
- </tr>
- <!-- ENDIF -->
- <!-- IF RANK_IMG -->
- <tr>
- <td align="center">{RANK_IMG}</td>
- </tr>
- <!-- ENDIF -->
- <!-- EVENT memberlist_view_rank_after -->
- <!-- IF AVATAR_IMG -->
- <tr>
- <td align="center">{AVATAR_IMG}</td>
- </tr>
- <!-- ENDIF -->
- <!-- IF ONLINE_IMG -->
- <tr>
- <td align="center">{ONLINE_IMG}</td>
- </tr>
- <!-- ENDIF -->
- <!-- IF U_SWITCH_PERMISSIONS -->
- <tr>
- <td class="genmed" align="center">[ <a href="{U_SWITCH_PERMISSIONS}">{L_USE_PERMISSIONS}</a> ]</td>
- </tr>
- <!-- ENDIF -->
- <!-- IF S_USER_LOGGED_IN and S_ZEBRA -->
- <tr>
- <td class="genmed" align="center">[
- <!-- IF U_REMOVE_FRIEND -->
- <a href="{U_REMOVE_FRIEND}">{L_REMOVE_FRIEND}</a>
- <!-- ELSEIF U_REMOVE_FOE -->
- <a href="{U_REMOVE_FOE}">{L_REMOVE_FOE}</a>
- <!-- ELSE -->
- <!-- IF U_ADD_FRIEND --><a href="{U_ADD_FRIEND}">{L_ADD_FRIEND}</a><!-- ENDIF --><!-- IF U_ADD_FOE --><!-- IF U_ADD_FRIEND --> | <!-- ENDIF --><a href="{U_ADD_FOE}">{L_ADD_FOE}</a><!-- ENDIF -->
- <!-- ENDIF -->
- ]</td>
- </tr>
- <!-- ENDIF -->
- </table>
- </td>
- <td class="row1">
- <table width="100%" cellspacing="1" cellpadding="2" border="0">
- <!-- EVENT memberlist_view_user_statistics_before -->
- <tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_JOINED}{L_COLON} </td>
- <td width="100%"><b class="gen">{JOINED}</b></td>
- </tr>
- <tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_LAST_ACTIVE}{L_COLON} </td>
- <td width="100%"><b class="gen">{LAST_ACTIVE}</b></td>
- </tr>
- <!-- IF S_WARNINGS -->
- <tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_WARNINGS}{L_COLON} </td>
- <td width="100%"><b class="gen">{WARNINGS}</b><!-- IF U_NOTES or U_WARN --><br /><span class="genmed"> [ <!-- IF U_NOTES --><a href="{U_NOTES}">{L_VIEW_NOTES}</a><!-- ENDIF --> <!-- IF U_WARN --><!-- IF U_NOTES --> | <!-- ENDIF --><a href="{U_WARN}">{L_WARN_USER}</a><!-- ENDIF --> ]</span><!-- ENDIF --></td>
- </tr>
- <!-- ENDIF -->
- <tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_TOTAL_POSTS}{L_COLON} </td>
- <td><b class="gen">{POSTS}</b><span class="genmed"><!-- IF POSTS_PCT --><br />[{POSTS_PCT} / {POSTS_DAY}]<!-- ENDIF -->
- <!-- IF POSTS_IN_QUEUE and U_MCP_QUEUE --><br />[<a href="{U_MCP_QUEUE}">{L_POSTS_IN_QUEUE}</a>]<!-- ELSEIF POSTS_IN_QUEUE --><br />[{L_POSTS_IN_QUEUE}]<!-- ENDIF -->
- <!-- IF S_DISPLAY_SEARCH --><br /><a href="{U_SEARCH_USER}">{L_SEARCH_USER_POSTS}</a><!-- ENDIF --></span></td>
- </tr>
- <!-- IF S_SHOW_ACTIVITY -->
- <tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_ACTIVE_IN_FORUM}{L_COLON} </td>
- <td><!-- IF ACTIVE_FORUM != '' --><b><a class="gen" href="{U_ACTIVE_FORUM}">{ACTIVE_FORUM}</a></b><br /><span class="genmed">[ {ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT} ]</span><!-- ELSE --><span class="gen">-</span><!-- ENDIF --></td>
- </tr>
- <tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap">{L_ACTIVE_IN_TOPIC}{L_COLON} </td>
- <td><!-- IF ACTIVE_TOPIC != '' --><b><a class="gen" href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></b><br /><span class="genmed">[ {ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT} ]</span><!-- ELSE --><span class="gen">-</span><!-- ENDIF --></td>
- </tr>
- <!-- ENDIF -->
- <!-- EVENT memberlist_view_user_statistics_after -->
- </table>
- </td>
- </tr>
- <tr>
- <td class="cat" align="center"><h4>{L_CONTACT}</h4></td>
- <td class="cat" align="center"><h4>{L_ABOUT_USER}</h4></td>
- </tr>
- <!-- EVENT memberlist_view_contact_before -->
- <tr>
- <td class="row1">
- <table width="100%" cellspacing="1" cellpadding="2" border="0">
- <tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_EMAIL_ADDRESS}{L_COLON} </td>
- <td width="100%"><!-- IF U_EMAIL --><a href="{U_EMAIL}" class="imageset">{EMAIL_IMG}</a><!-- ENDIF --></td>
- </tr>
- <!-- IF U_PM -->
- <tr>
- <td class="gen" nowrap="nowrap" align="{S_CONTENT_FLOW_END}">{L_PM}{L_COLON} </td>
- <td><a href="{U_PM}" class="imageset">{PM_IMG}</a></td>
- </tr>
- <!-- ENDIF -->
- <!-- IF S_JABBER_ENABLED -->
- <tr>
- <td class="gen" nowrap="nowrap" align="{S_CONTENT_FLOW_END}">{L_JABBER}{L_COLON} </td>
- <td><!-- IF U_JABBER --><a href="{U_JABBER}" onclick="popup(this.href, 550, 320); return false" class="imageset">{JABBER_IMG}</a><!-- ELSEIF USER_JABBER -->{USER_JABBER_IMG}<!-- ENDIF --></td>
- </tr>
- <!-- ENDIF -->
- <!-- BEGIN custom_fields -->
- <!-- IF custom_fields.S_PROFILE_CONTACT -->
- <tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{custom_fields.PROFILE_FIELD_NAME}{L_COLON} </td>
- <!-- IF custom_fields.PROFILE_FIELD_CONTACT -->
- <td><a href="{custom_fields.PROFILE_FIELD_CONTACT}"><span class="imageset {custom_fields.PROFILE_FIELD_IDENT}-icon">{custom_fields.PROFILE_FIELD_DESC}</span></a></td>
- <!-- ELSE -->
- <td><b class="genmed">{custom_fields.PROFILE_FIELD_VALUE}</b></td>
- <!-- ENDIF -->
- </tr>
- <!-- ENDIF -->
- <!-- END custom_fields -->
- </table>
- </td>
- <td class="row1">
- <table cellspacing="1" cellpadding="2" border="0">
- <tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_USERGROUPS}{L_COLON} </td>
- <td><select name="g">{S_GROUP_OPTIONS}</select> <input class="btnlite" type="submit" name="submit" value="{L_GO}" /></td>
- </tr>
- <!-- IF AGE !== '' -->
- <tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{L_AGE}{L_COLON} </td>
- <td><b class="genmed">{AGE}</b></td>
- </tr>
- <!-- ENDIF -->
- <!-- IF S_PROFILE_FIELD1 -->
- <!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
- <tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{PROFILE_FIELD1_NAME}{L_COLON} </td>
- <td><b class="genmed">{PROFILE_FIELD1_VALUE}</b></td>
- </tr>
- <!-- ENDIF -->
- <!-- BEGIN custom_fields -->
- <!-- IF not custom_fields.S_PROFILE_CONTACT -->
- <tr>
- <td class="gen" align="{S_CONTENT_FLOW_END}" nowrap="nowrap">{custom_fields.PROFILE_FIELD_NAME}{L_COLON} </td>
- <td><b class="genmed">{custom_fields.PROFILE_FIELD_VALUE}</b></td>
- </tr>
- <!-- ENDIF -->
- <!-- END custom_fields -->
- </table>
- </td>
- </tr>
- <!-- EVENT memberlist_view_contact_after -->
- <!-- IF SIGNATURE -->
- <tr>
- <td class="cat" colspan="2" align="center"><h4>{L_SIGNATURE}</h4></td>
- </tr>
- <tr>
- <td class="row1" colspan="2"><div class="postbody" style="padding: 10px;">{SIGNATURE}</div></td>
- </tr>
- <!-- ENDIF -->
- </table>
-
- </form>
-
- <!-- EVENT memberlist_view_content_append -->
-
-</div>
-
-<br clear="all" />
-
-<!-- INCLUDE breadcrumbs.html -->
-
-<br clear="all" />
-
-<div style="float: {S_CONTENT_FLOW_END};"><!-- INCLUDE jumpbox.html --></div>
-
-<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/message_body.html b/phpBB/styles/subsilver2/template/message_body.html
deleted file mode 100644
index b9b502a57f..0000000000
--- a/phpBB/styles/subsilver2/template/message_body.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th>{MESSAGE_TITLE}</th>
-</tr>
-<tr>
- <td class="row1" align="center"><br /><p class="gen">{MESSAGE_TEXT}</p><br /></td>
-</tr>
-</table>
-
-<br clear="all" />
-
-<!-- INCLUDE breadcrumbs.html -->
-
-<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/overall_footer.html b/phpBB/styles/subsilver2/template/overall_footer.html
deleted file mode 100644
index 176110c58d..0000000000
--- a/phpBB/styles/subsilver2/template/overall_footer.html
+++ /dev/null
@@ -1,29 +0,0 @@
- <!-- EVENT overall_footer_content_after -->
-
- <!-- IF not S_IS_BOT -->{RUN_CRON_TASK}<!-- ENDIF -->
-</div>
-
-<!-- EVENT overall_footer_page_body_after -->
-
-<div id="wrapfooter">
- <!-- IF U_ACP --><span class="gensmall">[ <a href="{U_ACP}">{L_ACP}</a> ]</span><br /><br /><!-- ENDIF -->
- <span class="copyright">
- <!-- EVENT overall_footer_copyright_prepend -->
- {CREDIT_LINE}
- <!-- IF TRANSLATION_INFO --><br />{TRANSLATION_INFO}<!-- ENDIF -->
- <!-- EVENT overall_footer_copyright_append -->
- <!-- IF DEBUG_OUTPUT --><br /><bdo dir="ltr">[ {DEBUG_OUTPUT} ]</bdo><!-- ENDIF --></span>
-</div>
-
-<script type="text/javascript" src="{T_JQUERY_LINK}"></script>
-<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
-<script type="text/javascript" src="{T_ASSETS_PATH}/javascript/core.js?assets_version={T_ASSETS_VERSION}"></script>
-
-<!-- EVENT overall_footer_after -->
-
-{$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
deleted file mode 100644
index 7648edc35a..0000000000
--- a/phpBB/styles/subsilver2/template/overall_header.html
+++ /dev/null
@@ -1,261 +0,0 @@
-<!DOCTYPE html>
-<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
-<head>
-<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>
-
-<!-- IF S_ENABLE_FEEDS -->
- <!-- IF S_ENABLE_FEEDS_OVERALL --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {SITENAME}" href="{U_FEED}" /><!-- ENDIF -->
- <!-- IF S_ENABLE_FEEDS_NEWS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_NEWS}" href="{U_FEED}?mode=news" /><!-- ENDIF -->
- <!-- IF S_ENABLE_FEEDS_FORUMS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_ALL_FORUMS}" href="{U_FEED}?mode=forums" /><!-- ENDIF -->
- <!-- IF S_ENABLE_FEEDS_TOPICS --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_TOPICS_NEW}" href="{U_FEED}?mode=topics" /><!-- ENDIF -->
- <!-- IF S_ENABLE_FEEDS_TOPICS_ACTIVE --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FEED_TOPICS_ACTIVE}" href="{U_FEED}?mode=topics_active" /><!-- ENDIF -->
- <!-- IF S_ENABLE_FEEDS_FORUM and S_FORUM_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_FORUM} - {FORUM_NAME}" href="{U_FEED}?f={S_FORUM_ID}" /><!-- ENDIF -->
- <!-- IF S_ENABLE_FEEDS_TOPIC and S_TOPIC_ID --><link rel="alternate" type="application/atom+xml" title="{L_FEED} - {L_TOPIC} - {TOPIC_TITLE}" href="{U_FEED}?f={S_FORUM_ID}&amp;t={S_TOPIC_ID}" /><!-- ENDIF -->
- <!-- EVENT overall_header_feeds -->
-<!-- ENDIF -->
-
-<!-- IF U_CANONICAL -->
- <link rel="canonical" href="{U_CANONICAL}" />
-<!-- ENDIF -->
-
-<link rel="stylesheet" href="{T_STYLESHEET_LINK}" type="text/css" />
-<link rel="stylesheet" href="{T_STYLESHEET_LANG_LINK}" type="text/css" />
-
-<script type="text/javascript">
-// <![CDATA[
-
-function popup(url, width, height, name)
-{
- if (!name)
- {
- name = '_popup';
- }
-
- window.open(url.replace(/&amp;/g, '&'), name, 'height=' + height + ',resizable=yes,scrollbars=yes,width=' + width);
- return false;
-}
-
-function jumpto()
-{
- var page = prompt('{LA_JUMP_PAGE}{L_COLON}', '{CURRENT_PAGE}');
- var per_page = '{PER_PAGE}';
- var base_url = '{BASE_URL|e('js')}';
-
- if (page !== null && !isNaN(page) && page == Math.floor(page) && page > 0)
- {
- if (base_url.indexOf('?') == -1)
- {
- document.location.href = base_url + '?start=' + ((page - 1) * per_page);
- }
- else
- {
- document.location.href = base_url.replace(/&amp;/g, '&') + '&start=' + ((page - 1) * per_page);
- }
- }
-}
-
-/**
-* Find a member
-*/
-function find_username(url)
-{
- popup(url, 760, 570, '_usersearch');
- return false;
-}
-
-/**
-* Mark/unmark checklist
-* id = ID of parent container, name = name prefix, state = state [true/false]
-*/
-function marklist(id, name, state)
-{
- var parent = document.getElementById(id) || document[id];
-
- if (!parent)
- {
- return;
- }
-
- var rb = parent.getElementsByTagName('input');
-
- for (var r = 0; r < rb.length; r++)
- {
- if (rb[r].name.substr(0, name.length) == name)
- {
- rb[r].checked = state;
- }
- }
-}
-
-<!-- IF ._file -->
-
- /**
- * Play quicktime file by determining it's width/height
- * from the displayed rectangle area
- *
- * Only defined if there is a file block present.
- */
- function play_qt_file(obj)
- {
- var rectangle = obj.GetRectangle();
-
- if (rectangle)
- {
- rectangle = rectangle.split(',')
- var x1 = parseInt(rectangle[0]);
- var x2 = parseInt(rectangle[2]);
- var y1 = parseInt(rectangle[1]);
- var y2 = parseInt(rectangle[3]);
-
- var width = (x1 < 0) ? (x1 * -1) + x2 : x2 - x1;
- var height = (y1 < 0) ? (y1 * -1) + y2 : y2 - y1;
- }
- else
- {
- var width = 200;
- var height = 0;
- }
-
- obj.width = width;
- obj.height = height + 16;
-
- obj.SetControllerVisible(true);
-
- obj.Play();
- }
-<!-- ENDIF -->
-
-// ]]>
-</script>
-
-<!-- EVENT overall_header_head_append -->
-
-{$STYLESHEETS}
-
-<!-- EVENT overall_header_stylesheets_after -->
-
-</head>
-<body class="{S_CONTENT_DIRECTION} {BODY_CLASS}">
-
-<!-- EVENT overall_header_body_before -->
-
-<a name="top" class="anchor"></a>
-
-<div id="wrapheader">
-
- <div id="logodesc">
- <table width="100%" cellspacing="0">
- <tr>
- <td><a href="<!-- IF U_SITE_HOME -->{U_SITE_HOME}<!-- ELSE -->{U_INDEX}<!-- ENDIF -->" class="imageset">{SITE_LOGO_IMG}</a></td>
- <td width="100%" align="center"><h1>{SITENAME}</h1><span class="gen">{SITE_DESCRIPTION}</span></td>
- </tr>
- </table>
- </div>
- <!-- EVENT overall_header_navbar_before -->
- <div id="menubar">
- <table width="100%" cellspacing="0">
- <tr>
- <td class="genmed dropdown-container">
- <!-- IF S_NOTIFICATIONS_DISPLAY and not S_IS_BOT and S_USER_LOGGED_IN -->
- <a href="{U_VIEW_ALL_NOTIFICATIONS}" id="notification_list_button" class="dropdown-trigger">
- <img src="{T_THEME_PATH}/images/icon_mini_notification.gif" width="12" height="13" alt="*" />
- {L_NOTIFICATIONS} [<strong>{NOTIFICATIONS_COUNT}</strong>]
- </a>&nbsp;
- <div id="notification_list" class="notification_list dropdown">
- <div class="row1 header">
- {L_NOTIFICATIONS}
- <span class="header_settings"><a href="{U_NOTIFICATION_SETTINGS}">{L_SETTINGS}</a></span>
- </div>
-
- <div class="notification_scroll">
- <table class="tablebg" cellspacing="1">
- <!-- BEGIN notifications -->
- <tr class="row<!-- IF notifications.UNREAD -->2<!-- ELSE -->1<!-- ENDIF -->">
- <td width="50">
- <!-- IF notifications.AVATAR -->{notifications.AVATAR}<!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" alt="" /><!-- ENDIF -->
- </td>
- <td valign="top">
- <div class="notification_title">
- <!-- IF notifications.URL --><a href="<!-- IF notifications.UNREAD -->{notifications.U_MARK_READ}<!-- ELSE -->{notifications.URL}<!-- ENDIF -->"><!-- ENDIF -->
- {notifications.FORMATTED_TITLE}
- <!-- IF notifications.URL --></a><!-- ENDIF -->
-
- <!-- IF notifications.REFERENCE --><br /><span class="notification-reference">{notifications.REFERENCE}</span><!-- ENDIF -->
- <!-- IF notifications.FORUM --><br /><span class="notification-forum">{notifications.FORUM}</span><!-- ENDIF -->
- <!-- IF notifications.REASON --><br /><span class="notification-reason">{notifications.REASON}</span><!-- ENDIF -->
- <br /><span class="notification-time">{notifications.TIME}</span>
- <!-- IF not notifications.URL and notifications.UNREAD -->
- <br /><a href="{notifications.U_MARK_READ}">{L_MARK_READ}</a>
- <!-- ENDIF -->
- </div>
- </td>
- </tr>
- <!-- END notifications -->
- </table>
- </div>
-
- <div class="row1 footer">
- <a href="{U_VIEW_ALL_NOTIFICATIONS}"><span>{L_SEE_ALL}</span></a>
- </div>
- </div>
- <!-- ENDIF -->
- <!-- IF not S_IS_BOT -->
- <!-- IF S_USER_LOGGED_IN -->
- <!-- IF S_DISPLAY_PM --> &nbsp;<a href="{U_PRIVATEMSGS}"><img src="{T_THEME_PATH}/images/icon_mini_message.gif" width="12" height="13" alt="*" /> {L_PRIVATE_MESSAGES} [<strong>{PRIVATE_MESSAGE_COUNT}</strong>]</a><!-- ENDIF -->
- <!-- ELSEIF S_REGISTER_ENABLED and not (S_SHOW_COPPA or S_REGISTRATION) --> &nbsp;<a href="{U_REGISTER}"><img src="{T_THEME_PATH}/images/icon_mini_register.gif" width="12" height="13" alt="*" /> {L_REGISTER}</a>
- <!-- ENDIF -->
- <!-- ENDIF -->
- <!-- IF not S_IS_BOT --> &nbsp;<a href="{U_LOGIN_LOGOUT}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" alt="*" /> {L_LOGIN_LOGOUT}</a>&nbsp;<!-- ENDIF -->
- <!-- IF U_RESTORE_PERMISSIONS --> &nbsp;<a href="{U_RESTORE_PERMISSIONS}"><img src="{T_THEME_PATH}/images/icon_mini_login.gif" width="12" height="13" alt="*" /> {L_RESTORE_PERMISSIONS}</a><!-- ENDIF -->
- <!-- IF S_BOARD_DISABLED and S_USER_LOGGED_IN --> &nbsp;<span class="error">{L_BOARD_DISABLED}</span><!-- ENDIF -->
- </td>
- <td class="genmed" align="{S_CONTENT_FLOW_END}">
- <!-- EVENT overall_header_navigation_prepend -->
- <a href="{U_FAQ}" rel="help"><img src="{T_THEME_PATH}/images/icon_mini_faq.gif" width="12" height="13" alt="*" /> {L_FAQ}</a>
- <!-- IF S_DISPLAY_SEARCH -->&nbsp; &nbsp;<a href="{U_SEARCH}"><img src="{T_THEME_PATH}/images/icon_mini_search.gif" width="12" height="13" alt="*" /> {L_SEARCH}</a><!-- ENDIF -->
- <!-- IF not S_IS_BOT -->
- <!-- IF S_DISPLAY_MEMBERLIST -->&nbsp; &nbsp;<a href="{U_MEMBERLIST}"><img src="{T_THEME_PATH}/images/icon_mini_members.gif" width="12" height="13" alt="*" /> {L_MEMBERLIST}</a><!-- ENDIF -->
- <!-- IF S_USER_LOGGED_IN -->&nbsp; &nbsp;<a href="{U_PROFILE}"><img src="{T_THEME_PATH}/images/icon_mini_profile.gif" width="12" height="13" alt="*" /> {L_PROFILE}</a><!-- ENDIF -->
- <!-- ENDIF -->
- <!-- EVENT overall_header_navigation_append -->
- </td>
- </tr>
- </table>
- </div>
-
- <div id="datebar">
- <table width="100%" cellspacing="0">
- <tr>
- <td class="gensmall"><!-- IF S_USER_LOGGED_IN -->{LAST_VISIT_DATE}<!-- ENDIF --></td>
- <td class="gensmall" align="{S_CONTENT_FLOW_END}">{CURRENT_TIME}<br /></td>
- </tr>
- </table>
- </div>
-
-</div>
-
-<!-- EVENT overall_header_page_body_before -->
-
-<div id="wrapcentre">
-
- <!-- IF S_DISPLAY_SEARCH -->
- <p class="searchbar">
- <span style="float: {S_CONTENT_FLOW_BEGIN};"><a href="{U_SEARCH_UNANSWERED}">{L_SEARCH_UNANSWERED}</a> | <a href="{U_SEARCH_ACTIVE_TOPICS}">{L_SEARCH_ACTIVE_TOPICS}</a></span>
- <!-- IF S_USER_LOGGED_IN or S_LOAD_UNREADS -->
- <span style="float: {S_CONTENT_FLOW_END};"><!-- IF S_LOAD_UNREADS --><a href="{U_SEARCH_UNREAD}">{L_SEARCH_UNREAD}</a><!-- IF S_USER_LOGGED_IN --> | <!-- ENDIF --><!-- ENDIF --><!-- IF S_USER_LOGGED_IN --><a href="{U_SEARCH_NEW}">{L_SEARCH_NEW}</a> | <a href="{U_SEARCH_SELF}">{L_SEARCH_SELF}</a><!-- ENDIF --></span>
- <!-- ENDIF -->
- </p>
- <!-- ENDIF -->
-
- <br style="clear: both;" />
-
- <!-- DEFINE $S_MICRODATA = 1 -->
- <!-- DEFINE $OVERALL_HEADER_BREADCRUMBS = 1 -->
- <!-- INCLUDE breadcrumbs.html -->
- <!-- UNDEFINE $OVERALL_HEADER_BREADCRUMBS -->
- <!-- DEFINE $S_MICRODATA = 0 -->
-
- <br />
- <!-- EVENT overall_header_content_before -->
diff --git a/phpBB/styles/subsilver2/template/pagination.html b/phpBB/styles/subsilver2/template/pagination.html
deleted file mode 100644
index b1c1d0e6c9..0000000000
--- a/phpBB/styles/subsilver2/template/pagination.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!-- IF .pagination -->
- <!-- IF BASE_URL --><b><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE_CLICK}">{L_GOTO_PAGE}</a></b><!-- ENDIF -->
- <!-- BEGIN pagination -->
- <!-- IF pagination.S_IS_PREV --><a href="{pagination.PAGE_URL}">{L_PREVIOUS}</a>
- <!-- ELSEIF pagination.S_IS_CURRENT --><strong>{pagination.PAGE_NUMBER}</strong>
- <!-- ELSEIF pagination.S_IS_ELLIPSIS --> {L_ELLIPSIS}
- <!-- ELSEIF pagination.S_IS_NEXT --><a href="{pagination.PAGE_URL}">{L_NEXT}</a>
- <!-- ELSE --><a href="{pagination.PAGE_URL}">{pagination.PAGE_NUMBER}</a>
- <!-- ENDIF -->
- <!-- END pagination -->
-<!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/posting_attach_body.html b/phpBB/styles/subsilver2/template/posting_attach_body.html
deleted file mode 100644
index 8c70e4c831..0000000000
--- a/phpBB/styles/subsilver2/template/posting_attach_body.html
+++ /dev/null
@@ -1,83 +0,0 @@
-<tr>
- <th colspan="2">
- <script type="text/javascript">
- // <![CDATA[
- /**
- * Show upload progress bar
- */
- function popup_progress_bar()
- {
- close_waitscreen = 0;
- // no scrollbars
- popup('{UA_PROGRESS_BAR}', 400, 200, '_upload');
- }
- // ]]>
- </script>
-
- <!-- IF S_CLOSE_PROGRESS_WINDOW -->
- <script type="text/javascript">
- // <![CDATA[
- close_waitscreen = 1;
- // ]]>
- </script>
- <!-- ENDIF -->
-
- {L_ADD_ATTACHMENT}
- </th>
-</tr>
-<tr>
- <td class="row3" colspan="2"><span class="gensmall">{L_ADD_ATTACHMENT_EXPLAIN}</span></td>
-</tr>
-
-<tr>
- <td class="row1"><b class="genmed">{L_FILENAME}</b></td>
- <td class="row2"><input type="file" name="fileupload" size="40" maxlength="{FILESIZE}" value="" class="btnfile" /></td>
-</tr>
-<tr>
- <td class="row1"><b class="genmed">{L_FILE_COMMENT}</b></td>
- <td class="row2">
- <table border="0" cellspacing="0" cellpadding="2">
- <tr>
- <td><textarea class="post" name="filecomment" rows="3" cols="35">{FILE_COMMENT}</textarea>&nbsp;</td>
- <td valign="top">
- <table border="0" cellspacing="4" cellpadding="0">
- <tr>
- <td><input class="btnlite" type="submit" style="width:150px" name="add_file" value="{L_ADD_FILE}" onclick="popup_progress_bar();" /></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
-</tr>
-
-<!-- IF S_HAS_ATTACHMENTS -->
- <tr>
- <th colspan="2">{L_POSTED_ATTACHMENTS}</th>
- </tr>
-
- <!-- BEGIN attach_row -->
- <tr>
- <td class="row1"><b class="genmed">{L_FILENAME}</b></td>
- <td class="row2"><a class="genmed" href="{attach_row.U_VIEW_ATTACHMENT}" target="_blank">{attach_row.FILENAME}</a></td>
- </tr>
- <tr>
- <td class="row1"><b class="genmed">{L_FILE_COMMENT}</b></td>
- <td class="row2">{attach_row.S_HIDDEN}
- <table border="0" cellspacing="0" cellpadding="2">
- <tr>
- <td><textarea class="post" name="comment_list[{attach_row.ASSOC_INDEX}]" rows="3" cols="35" wrap="virtual">{attach_row.FILE_COMMENT}</textarea>&nbsp;</td>
- <td valign="top">
- <table border="0" cellspacing="4" cellpadding="0">
- <tr>
- <td><input class="btnlite" type="submit" style="width:150px" name="delete_file[{attach_row.ASSOC_INDEX}]" value="{L_DELETE_FILE}" /></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <!-- END attach_row -->
-
-<!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/posting_body.html b/phpBB/styles/subsilver2/template/posting_body.html
deleted file mode 100644
index 93f7214f88..0000000000
--- a/phpBB/styles/subsilver2/template/posting_body.html
+++ /dev/null
@@ -1,430 +0,0 @@
-<!-- IF S_PRIVMSGS -->
- <!-- INCLUDE ucp_header.html -->
-<!-- ELSE -->
- <!-- INCLUDE overall_header.html -->
-<!-- ENDIF -->
-
-<!-- IF S_FORUM_RULES -->
- <div class="forumrules<!-- IF U_FORUM_RULES --> rules-link<!-- ENDIF -->">
- <!-- IF U_FORUM_RULES -->
- <h3>{L_FORUM_RULES}</h3><br />
- <a href="{U_FORUM_RULES}"><b>{L_FORUM_RULES_LINK}</b></a>
- <!-- ELSE -->
- <h3>{L_FORUM_RULES}</h3><br />
- {FORUM_RULES}
- <!-- ENDIF -->
- </div>
-
- <br clear="all" />
-<!-- ENDIF -->
-
-<!-- IF not S_PRIVMSGS -->
- <div id="pageheader">
- <h2><!-- IF TOPIC_TITLE --><!-- EVENT posting_topic_title_before --><a class="titles" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a><!-- ELSE --><a class="titles" href="{U_VIEW_FORUM}">{FORUM_NAME}</a><!-- ENDIF --></h2>
-
- <!-- IF MODERATORS -->
- <p class="moderators">{L_MODERATORS}{L_COLON} {MODERATORS}</p>
- <!-- ENDIF -->
- <!-- IF U_MCP or U_ACP -->
- <p class="linkmcp">[&nbsp;<!-- IF U_ACP --><a href="{U_ACP}">{L_ACP}</a><!-- IF U_MCP -->&nbsp;|&nbsp;<!-- ENDIF --><!-- ENDIF --><!-- IF U_MCP --><a href="{U_MCP}">{L_MCP}</a><!-- ENDIF -->&nbsp;]</p>
- <!-- ENDIF -->
- </div>
-
- <br clear="all" /><br />
-<!-- ENDIF -->
-
-<!-- IF not S_SHOW_PM_BOX -->
- <form action="{S_POST_ACTION}" method="post" name="postform"{S_FORM_ENCTYPE}>
-<!-- ENDIF -->
-
-<!-- IF S_DRAFT_LOADED -->
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th align="center">{L_INFORMATION}</th>
- </tr>
- <tr>
- <td class="row1" align="center"><span class="gen"><!-- IF S_PRIVMSGS -->{L_DRAFT_LOADED_PM}<!-- ELSE -->{L_DRAFT_LOADED}<!-- ENDIF --></span></td>
- </tr>
- </table>
-
- <br clear="all" />
-<!-- ENDIF -->
-
-<!-- IF S_SHOW_DRAFTS -->
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th colspan="3" align="center">{L_LOAD_DRAFT}</th>
- </tr>
- <tr>
- <td class="row1" colspan="3" align="center"><span class="gen">{L_LOAD_DRAFT_EXPLAIN}</span></td>
- </tr>
- <tr>
- <th>{L_SAVE_DATE}</th>
- <th>{L_DRAFT_TITLE}</th>
- <th>{L_OPTIONS}</th>
- </tr>
- <!-- BEGIN draftrow -->
-
- <!-- IF draftrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
-
- <td class="postdetails" style="padding: 4px;">{draftrow.DATE}</td>
- <td style="padding: 4px;"><b class="gen">{draftrow.DRAFT_SUBJECT}</b>
- <!-- IF draftrow.S_LINK_TOPIC --><br /><span class="gensmall">{L_TOPIC}{L_COLON} <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span>
- <!-- ELSEIF draftrow.S_LINK_FORUM --><br /><span class="gensmall">{L_FORUM}{L_COLON} <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span>
- <!-- ELSEIF draftrow.S_LINK_PM --><br /><span class="gensmall">{L_PRIVATE_MESSAGE}</span>
- <!-- ELSE --><br /><span class="gensmall">{L_NO_TOPIC_FORUM}</span><!-- ENDIF -->
- </td>
- <td style="padding: 4px;" align="center"><span class="gen"><a href="{draftrow.U_INSERT}">{L_LOAD_DRAFT}</a></span></td>
- </tr>
- <!-- END draftrow -->
- </table>
-
- <br clear="all" />
-<!-- ENDIF -->
-
-
-<!-- IF S_POST_REVIEW --><!-- INCLUDE posting_review.html --><!-- ENDIF -->
-<!-- IF S_DISPLAY_PREVIEW --><!-- INCLUDE posting_preview.html --><!-- ENDIF -->
-
-
-<!-- IF not S_PRIVMSGS and S_UNGLOBALISE -->
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th>{L_MOVE}</th>
- </tr>
- <tr>
- <td class="spacer" colspan="2"><img src="images/spacer.gif" alt="" width="1" height="1" /></td>
- </tr>
- <tr>
- <td class="row2" align="center"><span class="gen">{L_UNGLOBALISE_EXPLAIN}<br /><br />{L_SELECT_DESTINATION_FORUM}&nbsp;&nbsp;</span><select name="to_forum_id">{S_FORUM_SELECT}</select><br /><br /><input class="btnmain" type="submit" name="post" value="{L_CONFIRM}" />&nbsp;&nbsp; <input class="btnlite" type="submit" name="cancel_unglobalise" value="{L_CANCEL}" /></td>
- </tr>
- </table>
-
- <br clear="all" />
-<!-- ENDIF -->
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th colspan="2"><b>{L_POST_A}</b></th>
-</tr>
-
-<!-- IF ERROR -->
- <tr>
- <td class="row2" colspan="2" align="center"><span class="genmed error">{ERROR}</span></td>
- </tr>
-<!-- ENDIF -->
-
-<!-- IF S_SHOW_TOPIC_ICONS or S_SHOW_PM_ICONS -->
- <tr>
- <td class="row1"><b class="genmed">{L_ICON}{L_COLON}</b></td>
- <td class="row2">
- <table width="100%" cellspacing="0" cellpadding="0" border="0">
- <tr>
- <td><input type="radio" class="radio" name="icon" value="0"{S_NO_ICON_CHECKED} tabindex="1" /><span class="genmed"><!-- IF S_SHOW_TOPIC_ICONS -->{L_NO_TOPIC_ICON}<!-- ELSE -->{L_NO_PM_ICON}<!-- ENDIF --></span> <!-- BEGIN topic_icon --><span style="white-space: nowrap;"><input type="radio" class="radio" name="icon" value="{topic_icon.ICON_ID}"{topic_icon.S_ICON_CHECKED} tabindex="1" /><img src="{topic_icon.ICON_IMG}" width="{topic_icon.ICON_WIDTH}" height="{topic_icon.ICON_HEIGHT}" alt="{topic_icon.ICON_NAME}" title="" hspace="2" vspace="2" /></span> <!-- END topic_icon --></td>
- </tr>
- </table>
- </td>
- </tr>
-<!-- ENDIF -->
-
-<!-- IF not S_PRIVMSGS and S_DISPLAY_USERNAME -->
- <tr>
- <td class="row1"><b class="genmed">{L_USERNAME}{L_COLON}</b></td>
- <td class="row2"><input class="post" type="text" tabindex="1" name="username" size="25" value="{USERNAME}" /></td>
- </tr>
-<!-- ENDIF -->
-
-<!-- IF S_PRIVMSGS -->
- <tr>
- <td class="row1"><b class="genmed">{L_TO}{L_COLON}</b></td>
- <td class="row2">
- {S_HIDDEN_ADDRESS_FIELD}
- <!-- BEGIN to_recipient -->
- <span style="display: block; float: {S_CONTENT_FLOW_BEGIN};" class="nowrap genmed"><strong>
- <!-- IF to_recipient.IS_GROUP --><a href="{to_recipient.U_VIEW}"><span class="sep">{to_recipient.NAME}</span></a><!-- ELSE -->{to_recipient.NAME_FULL}<!-- ENDIF --></strong>&nbsp;<!-- IF not S_EDIT_POST --><input class="post" type="submit" name="remove_{to_recipient.TYPE}[{to_recipient.UG_ID}]" value="{L_REMOVE}" />&nbsp;<!-- ENDIF -->
- </span>
- <!-- BEGINELSE -->
- <span class="genmed">{L_NO_TO_RECIPIENT}</span>
- <!-- END to_recipient -->
- </td>
- </tr>
- <!-- IF S_ALLOW_MASS_PM -->
- <tr>
- <td class="row1"><b class="genmed">{L_BCC}{L_COLON}</b></td>
- <td class="row2">
- <!-- BEGIN bcc_recipient -->
- <span class="genmed nowrap"><strong>
- <!-- IF bcc_recipient.IS_GROUP --><a href="{bcc_recipient.U_VIEW}"><span class="sep">{bcc_recipient.NAME}</span></a><!-- ELSE -->{bcc_recipient.NAME_FULL}<!-- ENDIF --></strong>&nbsp;<!-- IF not S_EDIT_POST --><input class="post" type="submit" name="remove_{bcc_recipient.TYPE}[{bcc_recipient.UG_ID}]" value="{L_REMOVE}" />&nbsp;<!-- ENDIF -->
- </span>
- <!-- BEGINELSE -->
- <span class="genmed">{L_NO_BCC_RECIPIENT}</span>
- <!-- END bcc_recipient -->
- </td>
- </tr>
- <!-- ENDIF -->
-<!-- ENDIF -->
-<!-- EVENT posting_editor_subject_before -->
-<tr>
- <td class="row1" width="22%"><b class="genmed">{L_SUBJECT}{L_COLON}</b></td>
- <td class="row2" width="78%"><input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="<!-- IF S_NEW_MESSAGE -->120<!-- ELSE -->124<!-- ENDIF -->" tabindex="2" value="{SUBJECT}" /></td>
-</tr>
-<!-- EVENT posting_editor_subject_after -->
-<tr>
- <td class="row1" valign="top"><b class="genmed">{L_MESSAGE_BODY}{L_COLON}</b><br /><span class="gensmall">{L_MESSAGE_BODY_EXPLAIN}&nbsp;</span><br /><br />
- <!-- EVENT posting_editor_smilies_before -->
- <!-- IF S_SMILIES_ALLOWED -->
- <table width="100%" cellspacing="5" cellpadding="0" border="0" align="center">
- <tr>
- <td class="gensmall" align="center"><b>{L_SMILIES}</b></td>
- </tr>
- <tr>
- <td align="center">
- <!-- BEGIN smiley -->
- <a href="#" onclick="insert_text('{smiley.A_SMILEY_CODE}', true); return false;" style="line-height: 20px;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" hspace="2" vspace="2" /></a>
- <!-- END smiley -->
- </td>
- </tr>
-
- <!-- IF S_SHOW_SMILEY_LINK -->
- <tr>
- <td align="center"><a class="nav" href="{U_MORE_SMILIES}" onclick="popup(this.href, 300, 350, '_phpbbsmilies'); return false;">{L_MORE_SMILIES}</a></td>
- </tr>
- <!-- ENDIF -->
-
- </table>
- <!-- ENDIF -->
- <!-- EVENT posting_editor_smilies_after -->
- </td>
- <td class="row2" valign="top">
- <script type="text/javascript">
- // <![CDATA[
- var form_name = 'postform';
- var text_name = 'message';
- // ]]>
- </script>
-
- <table width="100%" cellspacing="0" cellpadding="0" border="0">
- <!-- INCLUDE posting_buttons.html -->
- <!-- EVENT posting_editor_message_before -->
- <tr>
- <td valign="top" style="width: 100%;"><textarea name="message" rows="15" cols="76" tabindex="3" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onfocus="initInsertions();" style="width: 700px; height: 270px; min-width: 98%; max-width: 98%;">{MESSAGE}</textarea></td>
- <!-- IF S_BBCODE_ALLOWED -->
- <td width="80" align="center" valign="top" id="color_palette_placeholder" data-orientation="v" data-width="11" data-height="10" data-bbcode="true">
- </td>
- <!-- ENDIF -->
- </tr>
- <!-- EVENT posting_editor_message_after -->
- </table>
- </td>
-</tr>
-
-<!-- IF S_INLINE_ATTACHMENT_OPTIONS -->
- <tr>
- <td class="row1"><b class="genmed">{L_ATTACHMENTS}{L_COLON}</b></td>
- <td class="row2"><select name="attachments">{S_INLINE_ATTACHMENT_OPTIONS}</select>&nbsp;<input type="button" class="btnbbcode" accesskey="a" value="{L_PLACE_INLINE}" name="attachinline" onclick="attach_form = document.forms[form_name].elements['attachments']; attachInline(attach_form.value, attach_form.options[attach_form.selectedIndex].text);" onmouseover="helpline('a')" onmouseout="helpline('tip')" />
- </td>
- </tr>
-<!-- ENDIF -->
-
-<tr>
- <td class="row1" valign="top"><b class="genmed">{L_OPTIONS}{L_COLON}</b><br />
- <table cellspacing="2" cellpadding="0" border="0">
- <tr>
- <td class="gensmall">{BBCODE_STATUS}</td>
- </tr>
- <!-- IF S_BBCODE_ALLOWED -->
- <tr>
- <td class="gensmall">{IMG_STATUS}</td>
- </tr>
- <tr>
- <td class="gensmall">{FLASH_STATUS}</td>
- </tr>
- <tr>
- <td class="gensmall">{URL_STATUS}</td>
- </tr>
- <!-- ENDIF -->
- <tr>
- <td class="gensmall">{SMILIES_STATUS}</td>
- </tr>
- </table>
- </td>
- <!-- EVENT posting_editor_bbcode_status_after -->
- <td class="row2">
- <table cellpadding="1">
- <!-- EVENT posting_editor_options_prepend -->
- <!-- IF S_BBCODE_ALLOWED -->
- <tr>
- <td><input type="checkbox" class="radio" name="disable_bbcode"{S_BBCODE_CHECKED} /></td>
- <td class="gen">{L_DISABLE_BBCODE}</td>
- </tr>
- <!-- ENDIF -->
-
- <!-- IF S_SMILIES_ALLOWED -->
- <tr>
- <td><input type="checkbox" class="radio" name="disable_smilies"{S_SMILIES_CHECKED} /></td>
- <td class="gen">{L_DISABLE_SMILIES}</td>
- </tr>
- <!-- ENDIF -->
-
- <!-- IF S_LINKS_ALLOWED -->
- <tr>
- <td><input type="checkbox" class="radio" name="disable_magic_url"{S_MAGIC_URL_CHECKED} /></td>
- <td class="gen">{L_DISABLE_MAGIC_URL}</td>
- </tr>
- <!-- ENDIF -->
-
- <!-- IF S_SIG_ALLOWED -->
- <tr>
- <td><input type="checkbox" class="radio" name="attach_sig"{S_SIGNATURE_CHECKED} /></td>
- <td class="gen">{L_ATTACH_SIG}</td>
- </tr>
- <!-- ENDIF -->
-
- <!-- IF S_NOTIFY_ALLOWED -->
- <tr>
- <td><input type="checkbox" class="radio" name="notify"{S_NOTIFY_CHECKED} /></td>
- <td class="gen">{L_NOTIFY_REPLY}</td>
- </tr>
- <!-- ENDIF -->
-
- <!-- IF not S_PRIVMSGS -->
- <!-- IF S_LOCK_TOPIC_ALLOWED -->
- <tr>
- <td><input type="checkbox" class="radio" name="lock_topic"{S_LOCK_TOPIC_CHECKED} /></td>
- <td class="gen">{L_LOCK_TOPIC}</td>
- </tr>
- <!-- ENDIF -->
-
- <!-- IF S_LOCK_POST_ALLOWED -->
- <tr>
- <td><input type="checkbox" class="radio" name="lock_post"{S_LOCK_POST_CHECKED} /></td>
- <td class="gen">{L_LOCK_POST} [{L_LOCK_POST_EXPLAIN}]</td>
- </tr>
- <!-- ENDIF -->
-
- <!-- IF S_TYPE_TOGGLE -->
- <tr>
- <td></td>
- <td class="gen"><!-- IF S_EDIT_POST -->{L_CHANGE_TOPIC_TO}<!-- ELSE -->{L_POST_TOPIC_AS}<!-- ENDIF -->{L_COLON} <!-- BEGIN topic_type --><input type="radio" class="radio" name="topic_type" value="{topic_type.VALUE}"{topic_type.S_CHECKED} />{topic_type.L_TOPIC_TYPE}&nbsp;&nbsp;<!-- END topic_type --></td>
- </tr>
- <!-- ENDIF -->
- <!-- ENDIF -->
- </table>
- </td>
-</tr>
-
-<!-- IF S_SOFTDELETE_ALLOWED or S_DELETE_ALLOWED -->
- <tr>
- <td class="row1" valign="top"><b class="genmed">{L_DELETE_POST}{L_COLON}</b></td>
- <td class="row2">
- <table cellpadding="1">
- <tr>
- <td><input type="checkbox" class="radio" name="delete" /></td>
- <td class="gen">{L_DELETE_POST_WARN}</td>
- </tr>
- <!-- IF S_SOFTDELETE_ALLOWED and S_DELETE_ALLOWED -->
- <tr>
- <td><input type="checkbox" class="radio" name="delete_permanent" /></td>
- <td class="gen">{L_DELETE_POST_PERMANENTLY}</td>
- </tr>
- <!-- ENDIF -->
- </table>
- </td>
- </tr>
-<!-- ENDIF -->
-
-<!-- IF S_TOPIC_TYPE_ANNOUNCE or S_TOPIC_TYPE_STICKY -->
- <tr>
- <td class="row1"><b class="genmed">{L_STICK_TOPIC_FOR}{L_COLON}</b><br /><span class="gensmall">{L_STICKY_ANNOUNCE_TIME_LIMIT}</span></td>
- <td class="row2"><input class="post" type="number" min="0" max="999" name="topic_time_limit" size="3" maxlength="3" value="{TOPIC_TIME_LIMIT}" />&nbsp;<b class="gen">{L_DAYS}</b> <span class="gensmall">{L_STICK_TOPIC_FOR_EXPLAIN}</span></td>
- </tr>
-<!-- ENDIF -->
-
-<!-- IF S_EDIT_REASON -->
- <tr>
- <td class="row1" valign="top"><b class="genmed">{L_EDIT_REASON}{L_COLON}</b></td>
- <td class="row2"><input class="post" type="text" name="edit_reason" size="50" value="{EDIT_REASON}" /></td>
- </tr>
-<!-- ENDIF -->
-
- <!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
- <!-- DEFINE $CAPTCHA_TAB_INDEX = 4 -->
- <!-- INCLUDE {CAPTCHA_TEMPLATE} -->
- <!-- ENDIF -->
-
-
-<!-- IF S_SHOW_ATTACH_BOX or S_SHOW_POLL_BOX -->
- <tr>
- <td class="cat" colspan="2" align="center">
- <input class="btnlite" type="submit" tabindex="5" name="preview" value="{L_PREVIEW}" />
- &nbsp; <input class="btnmain" type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" />
- <!-- IF S_SAVE_ALLOWED -->&nbsp; <input class="btnlite" type="submit" accesskey="k" tabindex="7" name="save" value="{L_SAVE_DRAFT}" /><!-- ENDIF -->
- <!-- IF S_HAS_DRAFTS -->&nbsp; <input class="btnlite" type="submit" accesskey="d" tabindex="8" name="load" value="{L_LOAD_DRAFT}" /><!-- ENDIF -->
- &nbsp; <input class="btnlite" type="submit" accesskey="c" tabindex="9" name="cancel" value="{L_CANCEL}" />
- </td>
- </tr>
-
- <!-- IF S_SHOW_ATTACH_BOX --><!-- INCLUDE posting_attach_body.html --><!-- ENDIF -->
-
- <!-- IF S_SHOW_POLL_BOX -->
- <!-- INCLUDE posting_poll_body.html -->
- <!-- ELSEIF S_POLL_DELETE -->
- <tr>
- <td class="row1"><span class="genmed"><b>{L_POLL_DELETE}{L_COLON}</b></span></td>
- <td class="row2"><input type="checkbox" class="radio" name="poll_delete" /></td>
- </tr>
- <!-- ENDIF -->
-<!-- ENDIF -->
-
-<tr>
- <td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}
- <input class="btnlite" type="submit" tabindex="10" name="preview" value="{L_PREVIEW}" />
- &nbsp; <input class="btnmain" type="submit" accesskey="s" tabindex="11" name="post" value="{L_SUBMIT}" />
- <!-- EVENT posting_editor_submit_buttons -->
- <!-- IF not S_SHOW_ATTACH_BOX and not S_SHOW_POLL_BOX -->
- <!-- IF S_SAVE_ALLOWED -->&nbsp; <input class="btnlite" type="submit" accesskey="k" tabindex="12" name="save" value="{L_SAVE_DRAFT}" /><!-- ENDIF -->
- <!-- IF S_HAS_DRAFTS -->&nbsp; <input class="btnlite" type="submit" accesskey="d" tabindex="13" name="load" value="{L_LOAD_DRAFT}" /><!-- ENDIF -->
- <!-- ENDIF -->
- &nbsp; <input class="btnlite" type="submit" accesskey="c" tabindex="14" name="cancel" value="{L_CANCEL}" />
- </td>
-</tr>
-</table>
-<!-- IF not S_PRIVMSGS -->
- {S_FORM_TOKEN}
- </form>
-<!-- ENDIF -->
-<br clear="all" />
-
-<!-- IF S_DISPLAY_REVIEW --><!-- INCLUDE posting_topic_review.html --><!-- ENDIF -->
-<!-- IF S_DISPLAY_HISTORY --><!-- INCLUDE ucp_pm_history.html --><!-- ENDIF -->
-
-<!-- IF S_PRIVMSGS -->
- <!-- INCLUDE ucp_footer.html -->
-<!-- ELSE -->
-
- <!-- INCLUDE breadcrumbs.html -->
-
-
- <!-- IF S_DISPLAY_ONLINE_LIST -->
- <br clear="all" />
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <td class="cat"><h4>{L_WHO_IS_ONLINE}</h4></td>
- </tr>
- <tr>
- <td class="row1"><span class="gensmall">{LOGGED_IN_USER_LIST}</span></td>
- </tr>
- </table>
- <!-- ENDIF -->
-
- <br clear="all" />
-
- <table width="100%" cellspacing="1">
- <tr>
- <td align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></td>
- </tr>
- </table>
-
- <!-- INCLUDE overall_footer.html -->
-<!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/posting_buttons.html b/phpBB/styles/subsilver2/template/posting_buttons.html
deleted file mode 100644
index 516cd0922b..0000000000
--- a/phpBB/styles/subsilver2/template/posting_buttons.html
+++ /dev/null
@@ -1,91 +0,0 @@
-<tr valign="middle" align="{S_CONTENT_FLOW_BEGIN}">
- <td colspan="2">
- <script type="text/javascript">
- // <![CDATA[
-
- // Define the bbCode tags
- var bbcode = new Array();
- var bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[flash=]', '[/flash]','[size=]','[/size]'<!-- BEGIN custom_tags -->, {custom_tags.BBCODE_NAME}<!-- END custom_tags -->);
- var imageTag = false;
-
- // Helpline messages
- var help_line = {
- b: '{LA_BBCODE_B_HELP}',
- i: '{LA_BBCODE_I_HELP}',
- u: '{LA_BBCODE_U_HELP}',
- q: '{LA_BBCODE_Q_HELP}',
- c: '{LA_BBCODE_C_HELP}',
- l: '{LA_BBCODE_L_HELP}',
- e: '{LA_BBCODE_LISTITEM_HELP}',
- o: '{LA_BBCODE_O_HELP}',
- p: '{LA_BBCODE_P_HELP}',
- w: '{LA_BBCODE_W_HELP}',
- a: '{LA_BBCODE_A_HELP}',
- s: '{LA_BBCODE_S_HELP}',
- f: '{LA_BBCODE_F_HELP}',
- y: '{LA_BBCODE_Y_HELP}',
- d: '{LA_BBCODE_D_HELP}',
- tip: '{L_STYLES_TIP}'
- <!-- BEGIN custom_tags -->
- ,cb_{custom_tags.BBCODE_ID}: '{custom_tags.A_BBCODE_HELPLINE}'
- <!-- END custom_tags -->
- }
-
- // ]]>
- </script>
- <!-- INCLUDEJS {T_ASSETS_PATH}/javascript/editor.js -->
-
-<!-- IF S_BBCODE_ALLOWED -->
- <!-- EVENT posting_editor_buttons_before -->
- <div id="core-bbcode-buttons">
- <input type="button" class="btnbbcode bbcode-b" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px;" onclick="bbstyle(0)" onmouseover="helpline('b')" onmouseout="helpline('tip')" />
- <input type="button" class="btnbbcode bbcode-i" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px;" onclick="bbstyle(2)" onmouseover="helpline('i')" onmouseout="helpline('tip')" />
- <input type="button" class="btnbbcode bbcode-u" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px;" onclick="bbstyle(4)" onmouseover="helpline('u')" onmouseout="helpline('tip')" />
- <!-- IF S_BBCODE_QUOTE -->
- <input type="button" class="btnbbcode bbcode-quote" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" onmouseover="helpline('q')" onmouseout="helpline('tip')" />
- <!-- ENDIF -->
- <input type="button" class="btnbbcode bbcode-code" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" onmouseout="helpline('tip')" />
- <input type="button" class="btnbbcode bbcode-list" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" onmouseout="helpline('tip')" />
- <input type="button" class="btnbbcode bbcode-list-" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" onmouseout="helpline('tip')" />
- <input type="button" class="btnbbcode bbcode-asterisk" accesskey="y" name="addlistitem" value="[*]" style="width: 40px" onclick="bbstyle(-1)" onmouseover="helpline('e')" onmouseout="helpline('tip')" />
- <!-- IF S_BBCODE_IMG -->
- <input type="button" class="btnbbcode bbcode-img" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" onmouseover="helpline('p')" onmouseout="helpline('tip')" />
- <!-- ENDIF -->
- <!-- IF S_LINKS_ALLOWED -->
- <input type="button" class="btnbbcode bbcode-url" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" onmouseout="helpline('tip')" />
- <!-- ENDIF -->
- <!-- IF S_BBCODE_FLASH -->
- <input type="button" class="btnbbcode bbcode-flash" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" onmouseover="helpline('d')" onmouseout="helpline('tip')" />
- <!-- ENDIF -->
- <span class="genmed nowrap">{L_FONT_SIZE}{L_COLON} <select class="gensmall bbcode-size" name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" onmouseover="helpline('f')" onmouseout="helpline('tip')">
- <option value="50">{L_FONT_TINY}</option>
- <option value="85">{L_FONT_SMALL}</option>
- <option value="100" selected="selected">{L_FONT_NORMAL}</option>
- <!-- IF not MAX_FONT_SIZE or MAX_FONT_SIZE >= 150 -->
- <option value="150">{L_FONT_LARGE}</option>
- <!-- IF not MAX_FONT_SIZE or MAX_FONT_SIZE >= 200 -->
- <option value="200">{L_FONT_HUGE}</option>
- <!-- ENDIF -->
- <!-- ENDIF -->
- </select></span>
- </div>
- <!-- EVENT posting_editor_buttons_custom_tags_before -->
- <!-- IF .custom_tags -->
- <div id="custom-bbcode-buttons">
- <!-- 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 -->
- </div>
- <!-- 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>
- <!-- IF not $S_SIGNATURE and not S_EDIT_DRAFT -->
- <td class="genmed" align="center">{L_FONT_COLOR}</td>
- <!-- ENDIF -->
-</tr>
-<!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/posting_poll_body.html b/phpBB/styles/subsilver2/template/posting_poll_body.html
deleted file mode 100644
index 07cb6d527e..0000000000
--- a/phpBB/styles/subsilver2/template/posting_poll_body.html
+++ /dev/null
@@ -1,37 +0,0 @@
-
-<tr>
- <th colspan="2">{L_ADD_POLL}</th>
-</tr>
-<tr>
- <td class="row3" colspan="2"><span class="gensmall">{L_ADD_POLL_EXPLAIN}</span></td>
-</tr>
-<tr>
- <td class="row1"><b class="genmed">{L_POLL_QUESTION}{L_COLON}</b></td>
- <td class="row2"><input class="post" type="text" name="poll_title" size="50" maxlength="255" value="{POLL_TITLE}" /></td>
-</tr>
-<tr>
- <td class="row1"><b class="genmed">{L_POLL_OPTIONS}{L_COLON}</b><br /><span class="gensmall">{L_POLL_OPTIONS_EXPLAIN}</span></td>
- <td class="row2"><textarea style="width:450px" name="poll_option_text" rows="5" cols="35">{POLL_OPTIONS}</textarea></td>
-</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="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>
- <td class="row2"><input class="post" type="number" min="0" max="999" name="poll_length" size="3" maxlength="3" value="{POLL_LENGTH}" />&nbsp;<b class="gen">{L_DAYS}</b> <span class="gensmall">{L_POLL_FOR_EXPLAIN}</span></td>
-</tr>
-<!-- IF S_POLL_VOTE_CHANGE -->
- <tr>
- <td class="row1"><b class="genmed">{L_POLL_VOTE_CHANGE}{L_COLON}</b><br /><span class="gensmall">{L_POLL_VOTE_CHANGE_EXPLAIN}</span></td>
- <td class="row2"><input type="checkbox" class="radio" name="poll_vote_change"{VOTE_CHANGE_CHECKED} /></td>
- </tr>
-<!-- ENDIF -->
-<!-- EVENT posting_poll_body_options_after -->
-
-<!-- IF S_POLL_DELETE -->
- <tr>
- <td class="row1"><b class="genmed">{L_POLL_DELETE}{L_COLON}</b></td>
- <td class="row2"><input type="checkbox" class="radio" name="poll_delete"<!-- IF S_POLL_DELETE_CHECKED --> checked="checked"<!-- ENDIF --> /></td>
- </tr>
-<!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/posting_preview.html b/phpBB/styles/subsilver2/template/posting_preview.html
deleted file mode 100644
index c451e4c871..0000000000
--- a/phpBB/styles/subsilver2/template/posting_preview.html
+++ /dev/null
@@ -1,71 +0,0 @@
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th>{L_PREVIEW}</th>
-</tr>
-<tr>
- <td class="row1">{MINI_POST_IMG}<span class="postdetails">{L_POSTED}{L_COLON} {POST_DATE} &nbsp;&nbsp;&nbsp; {L_POST_SUBJECT}{L_COLON} {PREVIEW_SUBJECT}</span></td>
-</tr>
-<!-- IF S_HAS_POLL_OPTIONS -->
- <tr>
- <td class="row2" colspan="2" align="center"><br clear="all" />
- <table cellspacing="0" cellpadding="4" border="0" align="center">
- <tr>
- <td align="center"><span class="gen"><b>{POLL_QUESTION}</b></span><br /><span class="gensmall">{L_POLL_LENGTH}</span></td>
- </tr>
- <tr>
- <td align="center">
- <table cellspacing="0" cellpadding="2" border="0">
- <!-- BEGIN poll_option -->
- <tr>
- <td>
- <!-- IF S_IS_MULTI_CHOICE -->
- <input type="checkbox" class="radio" name="vote_id" value="" />
- <!-- ELSE -->
- <input type="radio" class="radio" name="vote_id" value="" />
- <!-- ENDIF -->
- </td>
- <td><span class="gen">{poll_option.POLL_OPTION_CAPTION}</span></td>
- </tr>
- <!-- END poll_option -->
- </table>
- </td>
- </tr>
- <tr>
- <td align="center"><span class="gensmall">{L_MAX_VOTES}</span></td>
- </tr>
- </table>
- </td>
- </tr>
-<!-- ENDIF -->
-<!-- EVENT posting_preview_poll_after -->
-<tr>
- <td class="row1">
- <table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td><div class="postbody">{PREVIEW_MESSAGE}</div>
- <!-- IF .attachment -->
- <br clear="all" /><br />
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <td class="row3"><b class="genmed">{L_ATTACHMENTS}{L_COLON} </b></td>
- </tr>
- <!-- BEGIN attachment -->
- <tr>
- <td class="row2">{attachment.DISPLAY_ATTACHMENT}</td>
- </tr>
- <!-- END attachment -->
- </table>
- <!-- ENDIF -->
- <!-- IF PREVIEW_SIGNATURE --><span class="postbody"><br />_________________<br />{PREVIEW_SIGNATURE}</span><!-- ENDIF --></td>
- </tr>
- </table>
- </td>
-</tr>
-<tr>
- <td class="spacer"><img src="images/spacer.gif" alt="" width="1" height="1" /></td>
-</tr>
-</table>
-
-<br clear="all" />
diff --git a/phpBB/styles/subsilver2/template/posting_progress_bar.html b/phpBB/styles/subsilver2/template/posting_progress_bar.html
deleted file mode 100644
index f9decc506b..0000000000
--- a/phpBB/styles/subsilver2/template/posting_progress_bar.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<!-- INCLUDE simple_header.html -->
-<script type="text/javascript">
-// <![CDATA[
- /**
- * Close upload popup
- */
- function close_popup()
- {
- if (opener != null)
- {
- if (opener.close_waitscreen != null)
- {
- if (opener.close_waitscreen == 1)
- {
- opener.close_waitscreen = 0;
- self.close();
- return 0;
- }
- }
- }
- setTimeout("close_popup()", 1000);
- return 0;
- }
-// ]]>
-</script>
-
-<table width="100%" border="0" cellspacing="0" cellpadding="10">
-<tr>
- <td>
- <table width="100%" border="0" cellspacing="1" cellpadding="4">
- <tr>
- <td valign="top" class="row1" align="center"><br /><span class="genmed">{L_UPLOAD_IN_PROGRESS}</span><br /><br /><div style="align:center">{PROGRESS_BAR}</div><br /><br /><span class="genmed"><a href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a></span><br /><br /></td>
- </tr>
- </table>
- </td>
-</tr>
-</table>
-
-<script type="text/javascript">
-// <![CDATA[
- close_popup();
-// ]]>
-</script>
-<!-- INCLUDE simple_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/posting_review.html b/phpBB/styles/subsilver2/template/posting_review.html
deleted file mode 100644
index c118499564..0000000000
--- a/phpBB/styles/subsilver2/template/posting_review.html
+++ /dev/null
@@ -1,99 +0,0 @@
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th align="center">{L_POST_REVIEW}</th>
-</tr>
-<tr>
- <td class="row1" align="center"><span class="gen">{L_POST_REVIEW_EXPLAIN}</span></td>
-</tr>
-<tr>
- <td class="spacer"><img src="images/spacer.gif" alt="" width="1" height="1" /></td>
-</tr>
-<tr>
- <td class="row1">
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th width="22%">{L_AUTHOR}</th>
- <th>{L_MESSAGE}</th>
- </tr>
- <!-- BEGIN post_review_row -->
-
- <!-- IF post_review_row.S_ROW_COUNT is even --> <tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <!-- IF post_review_row.S_IGNORE_POST -->
- <td colspan="2">{post_review_row.L_IGNORE_POST}</td>
- <!-- ELSE -->
-
- <td rowspan="2" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><a id="pr{post_review_row.POST_ID}" class="anchor"></a>
- <table width="150" cellspacing="0" cellpadding="4" border="0">
- <tr>
- <td align="center"><b class="postauthor">{post_review_row.POST_AUTHOR_FULL}</b></td>
- </tr>
- </table>
- </td>
- <td width="100%">
- <table width="100%" cellspacing="0" cellpadding="0" border="0">
- <tr>
- <td>&nbsp;</td>
- <td class="gensmall" valign="middle" nowrap="nowrap"><b>{L_POST_SUBJECT}{L_COLON}</b>&nbsp;</td>
- <td class="gensmall" width="100%" valign="middle">{post_review_row.POST_SUBJECT}</td>
- <td>&nbsp;</td>
- </tr>
- </table>
- </td>
- </tr>
-
- <!-- IF post_review_row.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
-
- <td valign="top">
- <table width="100%" cellspacing="0">
- <tr>
- <td valign="top">
- <table width="100%" cellspacing="0" cellpadding="2">
- <tr>
- <td><div class="postbody">{post_review_row.MESSAGE}</div>
-
- <!-- IF post_review_row.S_HAS_ATTACHMENTS -->
- <br clear="all" /><br />
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <td class="row3"><b class="genmed">{L_ATTACHMENTS}{L_COLON} </b></td>
- </tr>
- <!-- BEGIN attachment -->
- <tr>
- <!-- IF post_review_row.attachment.S_ROW_COUNT is even --><td class="row2"><!-- ELSE --><td class="row1"><!-- ENDIF -->{post_review_row.attachment.DISPLAY_ATTACHMENT}</td>
- </tr>
- <!-- END attachment -->
- </table>
- <!-- ENDIF -->
-
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td>
- <table width="100%" cellspacing="0" cellpadding="0" border="0">
- <tr valign="middle">
- <td width="100%">&nbsp;</td>
- <td width="10" nowrap="nowrap"><!-- IF S_IS_BOT -->{post_review_row.MINI_POST_IMG}<!-- ELSE --><a href="{post_review_row.U_MINI_POST}" class="imageset">{post_review_row.MINI_POST_IMG}</a><!-- ENDIF --></td>
- <td class="gensmall" nowrap="nowrap"><b>{L_POSTED}{L_COLON}</b> {post_review_row.POST_DATE}</td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- <!-- ENDIF -->
- </tr>
- <tr>
- <td class="spacer" colspan="2" height="1"><img src="images/spacer.gif" alt="" width="1" height="1" /></td>
- </tr>
- <!-- END post_review_row -->
- </table>
- </td>
-</tr>
-</table>
-
-<br clear="all" />
diff --git a/phpBB/styles/subsilver2/template/posting_smilies.html b/phpBB/styles/subsilver2/template/posting_smilies.html
deleted file mode 100644
index 7087414fa8..0000000000
--- a/phpBB/styles/subsilver2/template/posting_smilies.html
+++ /dev/null
@@ -1,38 +0,0 @@
-<!-- INCLUDE simple_header.html -->
-
-<script type="text/javascript">
-// <![CDATA[
- var form_name = opener.form_name;
- var text_name = opener.text_name;
-// ]]>
-</script>
-<!-- INCLUDEJS {T_ASSETS_PATH}/javascript/editor.js -->
-
-<table width="100%" cellspacing="1" cellpadding="4" border="0">
-<tr>
- <td>
- <table class="tablebg" width="95%" cellspacing="1" cellpadding="4" border="0">
- <tr>
- <th>{L_SMILIES}</th>
- </tr>
- <tr>
- <td class="row1" align="center" valign="middle"><!-- BEGIN smiley --> <a href="#" onclick="initInsertions(); insert_text('{smiley.A_SMILEY_CODE}', true, true); return false;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" hspace="2" vspace="2" /></a> <!-- END smiley --><br />
- <!-- IF .pagination -->
- <b><a href="#" onclick="jumpto(); return false;" title="{L_JUMP_TO_PAGE_CLICK}">{L_GOTO_PAGE}</a>
- <!-- BEGIN pagination -->
- <!-- IF pagination.S_IS_PREV --><a href="{pagination.PAGE_URL}">{pagination.PAGE_NUMBER}</a>
- <!-- ELSEIF pagination.S_IS_CURRENT --><strong>{pagination.PAGE_NUMBER}</strong>
- <!-- ELSEIF pagination.S_IS_ELLIPSIS --> {L_ELLIPSIS}
- <!-- ELSEIF pagination.S_IS_NEXT --><a href="{pagination.PAGE_URL}">{pagination.PAGE_NUMBER}</a>
- <!-- ELSE --><a href="{pagination.PAGE_URL}">{pagination.PAGE_NUMBER}</a>
- <!-- ENDIF -->
- <!-- END pagination -->
- <br />
- <!-- ENDIF -->
- <a class="nav" href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a></td>
- </tr>
- </table>
- </td>
-</tr>
-</table>
-<!-- INCLUDE simple_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/posting_topic_review.html b/phpBB/styles/subsilver2/template/posting_topic_review.html
deleted file mode 100644
index 20976861fc..0000000000
--- a/phpBB/styles/subsilver2/template/posting_topic_review.html
+++ /dev/null
@@ -1,110 +0,0 @@
-<script type="text/javascript">
-// <![CDATA[
- bbcodeEnabled = {S_BBCODE_ALLOWED};
-// ]]>
-</script>
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th align="center">{L_TOPIC_REVIEW} - {TOPIC_TITLE}</th>
-</tr>
-<tr>
- <td class="row1"><div style="overflow: auto; width: 100%; height: 300px;">
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th width="22%">{L_AUTHOR}</th>
- <th>{L_MESSAGE}</th>
- </tr>
- <!-- BEGIN topic_review_row -->
-
- <!-- IF topic_review_row.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
-
- <!-- IF topic_review_row.S_IGNORE_POST -->
- <td colspan="2">{topic_review_row.L_IGNORE_POST}</td>
- <!-- ELSE -->
- <td rowspan="2" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><a id="pr{topic_review_row.POST_ID}" class="anchor"></a>
- <table width="150" cellspacing="0">
- <tr>
- <td align="center"><b class="postauthor"<!-- IF topic_review_row.POST_AUTHOR_COLOUR --> style="color: {topic_review_row.POST_AUTHOR_COLOUR}"<!-- ENDIF -->>{topic_review_row.POST_AUTHOR}</b></td>
- </tr>
- </table>
- </td>
- <td width="100%">
- <table width="100%" cellspacing="0">
- <tr>
- <td>&nbsp;</td>
- <td class="gensmall" valign="middle" nowrap="nowrap"><b>{L_POST_SUBJECT}{L_COLON}</b>&nbsp;</td>
- <td class="gensmall" width="100%" valign="middle">{topic_review_row.POST_SUBJECT}</td>
- <td valign="top" nowrap="nowrap">&nbsp;<!-- IF topic_review_row.POSTER_QUOTE and topic_review_row.DECODED_MESSAGE --><a href="#" onclick="addquote({topic_review_row.POST_ID},'{topic_review_row.POSTER_QUOTE}', '{LA_WROTE}'); return false;" class="imageset">{QUOTE_IMG}</a><!-- ENDIF --></td>
- </tr>
- </table>
- </td>
- </tr>
-
- <!-- IF topic_review_row.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
-
- <td valign="top">
- <table width="100%" cellspacing="0">
- <tr>
- <td valign="top">
- <table width="100%" cellspacing="0" cellpadding="2">
- <tr>
- <td>
- <!-- IF topic_review_row.POST_ID == REPORTED_POST_ID -->
- <table width="100%" cellspacing="0">
- <tr>
- <span class="postreported">{REPORTED_IMG}</span>
- </tr>
- </table>
- <!-- ENDIF -->
- <div class="postbody">{topic_review_row.MESSAGE}</div>
-
- <!-- IF topic_review_row.S_HAS_ATTACHMENTS -->
- <br clear="all" /><br />
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <td class="row3"><b class="genmed">{L_ATTACHMENTS}{L_COLON} </b></td>
- </tr>
- <!-- BEGIN attachment -->
- <tr>
- <!-- IF topic_review_row.attachment.S_ROW_COUNT is even --><td class="row2"><!-- ELSE --><td class="row1"><!-- ENDIF -->{topic_review_row.attachment.DISPLAY_ATTACHMENT}</td>
- </tr>
- <!-- END attachment -->
- </table>
- <!-- ENDIF -->
-
- <!-- IF topic_review_row.POSTER_QUOTE and topic_review_row.DECODED_MESSAGE -->
- <div id="message_{topic_review_row.POST_ID}" style="display: none;">{topic_review_row.DECODED_MESSAGE}</div>
- <!-- ENDIF -->
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td>
- <table width="100%" cellspacing="0">
- <tr valign="middle">
- <td width="100%" align="{S_CONTENT_FLOW_BEGIN}"><span class="gensmall"><!-- IF topic_review_row.U_MCP_DETAILS -->[ <a href="{topic_review_row.U_MCP_DETAILS}">{L_POST_DETAILS}</a> ]<!-- ENDIF --></span></td>
- <td width="10" nowrap="nowrap"><!-- IF S_IS_BOT -->{topic_review_row.MINI_POST_IMG}<!-- ELSE --><a href="{topic_review_row.U_MINI_POST}" class="imageset">{topic_review_row.MINI_POST_IMG}</a><!-- ENDIF --></td>
- <td class="gensmall" nowrap="nowrap"><b>{L_POSTED}{L_COLON}</b> {topic_review_row.POST_DATE}</td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- <!-- ENDIF -->
- </tr>
- <tr>
- <td class="spacer" colspan="2"><img src="images/spacer.gif" alt="" width="1" height="1" /></td>
- </tr>
- <!-- END topic_review_row -->
- </table>
- </div></td>
-</tr>
-</table>
-
-<br clear="all" />
diff --git a/phpBB/styles/subsilver2/template/profilefields/bool.html b/phpBB/styles/subsilver2/template/profilefields/bool.html
deleted file mode 100644
index f57bd4e4da..0000000000
--- a/phpBB/styles/subsilver2/template/profilefields/bool.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<!-- BEGIN bool -->
- <!-- IF bool.FIELD_LENGTH eq 1 -->
- <!-- BEGIN options --><input type="radio" class="radio" name="{bool.FIELD_IDENT}" value="{bool.options.OPTION_ID}"{bool.options.CHECKED} /><span class="genmed">{bool.options.VALUE}</span>&nbsp; &nbsp;<!-- END options -->
- <!-- ELSE -->
- <input type="checkbox" class="radio" name="{bool.FIELD_IDENT}" value="1"<!-- IF bool.FIELD_VALUE eq 1 --> checked="checked"<!-- ENDIF --> />
- <!-- ENDIF -->
-<!-- END bool -->
diff --git a/phpBB/styles/subsilver2/template/profilefields/date.html b/phpBB/styles/subsilver2/template/profilefields/date.html
deleted file mode 100644
index e2da2463a5..0000000000
--- a/phpBB/styles/subsilver2/template/profilefields/date.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<!-- BEGIN date -->
-<span class="genmed">{L_DAY}{L_COLON}</span> <select name="{date.FIELD_IDENT}_day">{date.S_DAY_OPTIONS}</select>
-<span class="genmed">{L_MONTH}{L_COLON}</span> <select name="{date.FIELD_IDENT}_month">{date.S_MONTH_OPTIONS}</select>
-<span class="genmed">{L_YEAR}{L_COLON}</span> <select name="{date.FIELD_IDENT}_year">{date.S_YEAR_OPTIONS}</select>
-<!-- END date -->
diff --git a/phpBB/styles/subsilver2/template/profilefields/dropdown.html b/phpBB/styles/subsilver2/template/profilefields/dropdown.html
deleted file mode 100644
index 16242da895..0000000000
--- a/phpBB/styles/subsilver2/template/profilefields/dropdown.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<!-- BEGIN dropdown -->
-<select name="{dropdown.FIELD_IDENT}">
- <!-- BEGIN options --><option value="{dropdown.options.OPTION_ID}"{dropdown.options.SELECTED}>{dropdown.options.VALUE}</option><!-- END options -->
-</select>
-<!-- END dropdown -->
diff --git a/phpBB/styles/subsilver2/template/profilefields/int.html b/phpBB/styles/subsilver2/template/profilefields/int.html
deleted file mode 100644
index 067921e320..0000000000
--- a/phpBB/styles/subsilver2/template/profilefields/int.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<!-- BEGIN int -->
- <input type="number" min="{int.FIELD_MINLEN}" max="{int.FIELD_MAXLEN}" class="post" name="{int.FIELD_IDENT}" size="{int.FIELD_LENGTH}" value="{int.FIELD_VALUE}" />
-<!-- END int -->
diff --git a/phpBB/styles/subsilver2/template/profilefields/string.html b/phpBB/styles/subsilver2/template/profilefields/string.html
deleted file mode 100644
index 5a98562e2a..0000000000
--- a/phpBB/styles/subsilver2/template/profilefields/string.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<!-- BEGIN string -->
- <input type="text" class="post" name="{string.FIELD_IDENT}" size="{string.FIELD_LENGTH}" maxlength="{string.FIELD_MAXLEN}" value="{string.FIELD_VALUE}" />
-<!-- END string -->
diff --git a/phpBB/styles/subsilver2/template/profilefields/text.html b/phpBB/styles/subsilver2/template/profilefields/text.html
deleted file mode 100644
index df2474ad3e..0000000000
--- a/phpBB/styles/subsilver2/template/profilefields/text.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<!-- BEGIN text -->
-<textarea name="{text.FIELD_IDENT}" rows="{text.FIELD_ROWS}" cols="{text.FIELD_COLS}">{text.FIELD_VALUE}</textarea>
-<!-- END text -->
diff --git a/phpBB/styles/subsilver2/template/profilefields/url.html b/phpBB/styles/subsilver2/template/profilefields/url.html
deleted file mode 100644
index 42805aa98d..0000000000
--- a/phpBB/styles/subsilver2/template/profilefields/url.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<!-- BEGIN url -->
- <input type="url" class="post" name="{url.FIELD_IDENT}" id="{url.FIELD_IDENT}" size="{url.FIELD_LENGTH}" maxlength="{url.FIELD_MAXLEN}" value="{url.FIELD_VALUE}" />
-<!-- END url -->
diff --git a/phpBB/styles/subsilver2/template/quickreply_editor.html b/phpBB/styles/subsilver2/template/quickreply_editor.html
deleted file mode 100644
index 5afc723f48..0000000000
--- a/phpBB/styles/subsilver2/template/quickreply_editor.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<form method="post" action="{U_QR_ACTION}">
-<!-- EVENT quickreply_editor_panel_before -->
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th align="center" colspan="2">{L_QUICKREPLY}</th>
- </tr>
- <tr>
- <td class="row1" width="22%"><b class="genmed">{L_SUBJECT}{L_COLON}</b></td>
- <td class="row2" width="78%"><input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="124" tabindex="2" value="{SUBJECT}" /></td>
- </tr>
- <!-- EVENT quickreply_editor_message_before -->
- <tr>
- <td class="row1" width="22%"><b class="genmed">{L_MESSAGE}{L_COLON}</b></td>
- <td class="row2" valign="top" align="left" width="78%"><textarea name="message" rows="7" cols="76" tabindex="3" style="width: 700px; height: 130px; min-width: 98%; max-width: 98%;"></textarea> </td>
- </tr>
- <!-- EVENT quickreply_editor_message_after -->
- <tr>
- <td class="cat" colspan="2" align="center">
- <input class="btnlite" type="submit" accesskey="f" tabindex="6" name="preview" value="{L_FULL_EDITOR}" />&nbsp;
- <input class="btnmain" type="submit" accesskey="s" tabindex="7" name="post" value="{L_SUBMIT}" />
-
- {S_FORM_TOKEN}
- {QR_HIDDEN_FIELDS}
- </td>
- </tr>
- </table>
-<!-- EVENT quickreply_editor_panel_after -->
-</form>
-<br clear="all" />
diff --git a/phpBB/styles/subsilver2/template/report_body.html b/phpBB/styles/subsilver2/template/report_body.html
deleted file mode 100644
index 906a957ef4..0000000000
--- a/phpBB/styles/subsilver2/template/report_body.html
+++ /dev/null
@@ -1,49 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<form method="post" id="report" action="{S_REPORT_ACTION}">
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th colspan="2"><!-- IF S_REPORT_POST -->{L_REPORT_POST}<!-- ELSE -->{L_REPORT_MESSAGE}<!-- ENDIF --></th>
-</tr>
-<!-- IF ERROR -->
- <tr>
- <td class="row3" colspan="2" align="center"><span class="genmed error">{ERROR}</span></td>
- </tr>
-<!-- ENDIF -->
-<tr>
- <td class="row3" colspan="2"><span class="gensmall"><!-- IF S_REPORT_POST -->{L_REPORT_POST_EXPLAIN}<!-- ELSE -->{L_REPORT_MESSAGE_EXPLAIN}<!-- ENDIF --></span></td>
-</tr>
-<tr>
- <td class="row1" width="22%"><b class="gen">{L_REASON}{L_COLON}</b></td>
- <td class="row2" width="78%"><select name="reason_id">
- <!-- BEGIN reason --><option value="{reason.ID}"<!-- IF reason.S_SELECTED --> selected="selected"<!-- ENDIF -->>{reason.TITLE} &raquo; {reason.DESCRIPTION}</option><!-- END reason -->
- </select></td>
-</tr>
-<!-- IF S_CAN_NOTIFY -->
- <tr>
- <td class="row1"><span class="gen"><b>{L_REPORT_NOTIFY}{L_COLON}</b></span><br /><span class="gensmall">{L_REPORT_NOTIFY_EXPLAIN}</span></td>
- <td class="row2"><span class="gen"><input type="radio" class="radio" name="notify" value="1"<!-- IF S_NOTIFY --> checked="checked"<!-- ENDIF --> />&nbsp; {L_YES} &nbsp;<input type="radio" class="radio" name="notify" value="0"<!-- IF not S_NOTIFY --> checked="checked"<!-- ENDIF --> />&nbsp; {L_NO}</span></td>
- </tr>
-<!-- ENDIF -->
-<tr>
- <td class="row1" valign="top"><span class="gen"><b>{L_MORE_INFO}{L_COLON}</b></span><br /><span class="gensmall">{L_CAN_LEAVE_BLANK}</span></td>
- <td class="row2"><textarea class="post" name="report_text" rows="10" cols="50">{REPORT_TEXT}</textarea></td>
-</tr>
-<!-- IF CAPTCHA_TEMPLATE -->
- <!-- INCLUDE {CAPTCHA_TEMPLATE} -->
-<!-- ENDIF -->
-<tr>
- <td class="cat" colspan="2" align="center"><input type="submit" name="submit" class="btnmain" value="{L_SUBMIT}" />&nbsp;<input type="submit" name="cancel" class="btnlite" value="{L_CANCEL}" /></td>
-</tr>
-</table>
-{S_FORM_TOKEN}
-</form>
-
-<br clear="all" />
-
-<!-- INCLUDE breadcrumbs.html -->
-
-<div style="float: {S_CONTENT_FLOW_END};"><!-- INCLUDE jumpbox.html --></div>
-
-<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/search_body.html b/phpBB/styles/subsilver2/template/search_body.html
deleted file mode 100644
index d3aa758b43..0000000000
--- a/phpBB/styles/subsilver2/template/search_body.html
+++ /dev/null
@@ -1,96 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<div id="pagecontent">
-
- <!-- EVENT search_body_form_before -->
- <form method="get" action="{S_SEARCH_ACTION}">
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th colspan="4">{L_SEARCH_QUERY}</th>
- </tr>
- <tr>
- <td class="row1" colspan="2" width="50%"><b class="genmed">{L_SEARCH_KEYWORDS}{L_COLON} </b><br /><span class="gensmall">{L_SEARCH_KEYWORDS_EXPLAIN}</span></td>
- <td class="row2" colspan="2" valign="top"><input type="text" style="width: 300px" class="post" name="keywords" size="30" /><br /><input type="radio" class="radio" name="terms" value="all" checked="checked" /> <span class="genmed">{L_SEARCH_ALL_TERMS}</span><br /><input type="radio" class="radio" name="terms" value="any" /> <span class="genmed">{L_SEARCH_ANY_TERMS}</span></td>
- </tr>
- <tr>
- <td class="row1" colspan="2"><b class="genmed">{L_SEARCH_AUTHOR}{L_COLON}</b><br /><span class="gensmall">{L_SEARCH_AUTHOR_EXPLAIN}</span></td>
- <td class="row2" colspan="2" valign="middle"><input type="text" style="width: 300px" class="post" name="author" size="30" /></td>
- </tr>
- <tr>
- <td class="row1" colspan="2"><b class="genmed">{L_SEARCH_FORUMS}{L_COLON} </b><br /><span class="gensmall">{L_SEARCH_FORUMS_EXPLAIN}</span></td>
- <td class="row2" colspan="2"><select name="fid[]" multiple="multiple" size="5">{S_FORUM_OPTIONS}</select></td>
- </tr>
- <tr>
- <th colspan="4">{L_SEARCH_OPTIONS}</th>
- </tr>
- <tr>
- <td class="row1" width="25%" nowrap="nowrap"><b class="genmed">{L_SEARCH_SUBFORUMS}{L_COLON} </b></td>
- <td class="row2" width="25%" nowrap="nowrap"><input type="radio" class="radio" name="sc" value="1" checked="checked" /> <span class="genmed">{L_YES}</span>&nbsp;&nbsp;<input type="radio" class="radio" name="sc" value="0" /> <span class="genmed">{L_NO}</span></td>
- <td class="row1" width="25%" nowrap="nowrap"><b class="genmed">{L_SEARCH_WITHIN}{L_COLON} </b></td>
- <td class="row2" width="25%" nowrap="nowrap"><input type="radio" class="radio" name="sf" value="all" checked="checked" /> <span class="genmed">{L_SEARCH_TITLE_MSG}</span><br /><input type="radio" class="radio" name="sf" value="msgonly" /> <span class="genmed">{L_SEARCH_MSG_ONLY}</span> <br /><input type="radio" class="radio" name="sf" value="titleonly" /> <span class="genmed">{L_SEARCH_TITLE_ONLY}</span> <br /><input type="radio" class="radio" name="sf" value="firstpost" /> <span class="genmed">{L_SEARCH_FIRST_POST}</span></td>
- </tr>
- <tr>
- <td class="row1"><b class="genmed">{L_RESULT_SORT}{L_COLON} </b></td>
- <td class="row2" nowrap="nowrap">{S_SELECT_SORT_KEY}<br /><input type="radio" class="radio" name="sd" value="a" /> <span class="genmed">{L_SORT_ASCENDING}</span><br /><input type="radio" class="radio" name="sd" value="d" checked="checked" /> <span class="genmed">{L_SORT_DESCENDING}</span></td>
- <td class="row1" nowrap="nowrap"><b class="genmed">{L_DISPLAY_RESULTS}{L_COLON} </b></td>
- <td class="row2" nowrap="nowrap"><input type="radio" class="radio" name="sr" value="posts" checked="checked" /> <span class="genmed">{L_POSTS}</span>&nbsp;&nbsp;<input type="radio" class="radio" name="sr" value="topics" /> <span class="genmed">{L_TOPICS}</span></td>
- </tr>
- <tr>
- <td class="row1" width="25%"><b class="genmed">{L_RESULT_DAYS}{L_COLON} </b></td>
- <td class="row2" width="25%" nowrap="nowrap">{S_SELECT_SORT_DAYS}</td>
- <td class="row1" nowrap="nowrap"><b class="genmed">{L_RETURN_FIRST}{L_COLON} </b></td>
- <td class="row2" nowrap="nowrap"><select name="ch">{S_CHARACTER_OPTIONS}</select> <span class="genmed">{L_POST_CHARACTERS}</span></td>
- </tr>
- <tr>
- <td class="cat" colspan="4" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" name="submit" type="submit" value="{L_SEARCH}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" /></td>
- </tr>
- </table>
-
- </form>
-
- <br clear="all" />
-
- <!-- IF .recentsearch -->
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th colspan="2">{L_RECENT_SEARCHES}</th>
- </tr>
- <!-- BEGIN recentsearch -->
- <!-- IF recentsearch.S_ROW_COUNT is even --><tr class="row2"><!-- ELSE --><tr class="row1"><!-- ENDIF -->
-
- <td class="genmed" style="padding: 4px;" width="70%"><a href="{recentsearch.U_KEYWORDS}">{recentsearch.KEYWORDS}</a></td>
- <td class="genmed" style="padding: 4px;" width="30%" align="center">{recentsearch.TIME}</td>
- </tr>
- <!-- END recentsearch -->
- </table>
-
- <br clear="all" />
- <!-- ENDIF -->
-
- </div>
-
- <!-- INCLUDE breadcrumbs.html -->
-
- <br clear="all" />
-
- <div align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></div>
-
-<script type="text/javascript">
-// <![CDATA[
- (function()
- {
- var elements = document.getElementsByName("keywords");
- for (var i = 0; i < elements.length; ++i)
- {
- if (elements[i].tagName.toLowerCase() == 'input')
- {
- elements[i].focus();
- break;
- }
- }
- })();
-// ]]>
-</script>
-
-<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/search_results.html b/phpBB/styles/subsilver2/template/search_results.html
deleted file mode 100644
index 6f651b2618..0000000000
--- a/phpBB/styles/subsilver2/template/search_results.html
+++ /dev/null
@@ -1,164 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<!-- EVENT search_results_header_before -->
-
-<form method="post" action="{S_SEARCH_ACTION}">
-
-<table width="100%" cellspacing="1">
-<tr>
- <td colspan="2"><span class="titles"><!-- IF SEARCH_TITLE -->{SEARCH_TITLE}<!-- ELSE -->{SEARCH_MATCHES}<!-- ENDIF --></span><br /></td>
-</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}"><!-- 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 -->
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th width="4%" nowrap="nowrap">&nbsp;</th>
- <th colspan="2" nowrap="nowrap">&nbsp;{L_TOPICS}&nbsp;</th>
- <th nowrap="nowrap">&nbsp;{L_AUTHOR}&nbsp;</th>
- <th nowrap="nowrap">&nbsp;{L_REPLIES}&nbsp;</th>
- <th nowrap="nowrap">&nbsp;{L_VIEWS}&nbsp;</th>
- <th nowrap="nowrap">&nbsp;{L_LAST_POST}&nbsp;</th>
- </tr>
- <!-- BEGIN searchresults -->
- <!-- EVENT search_results_topic_before -->
- <tr valign="middle">
- <td class="row1" width="25" align="center">{searchresults.TOPIC_FOLDER_IMG}</td>
- <td class="row1" width="25" align="center">
- <!-- IF searchresults.TOPIC_ICON_IMG -->
- <img src="{T_ICONS_PATH}{searchresults.TOPIC_ICON_IMG}" width="{searchresults.TOPIC_ICON_IMG_WIDTH}" height="{searchresults.TOPIC_ICON_IMG_HEIGHT}" alt="" title="" />
- <!-- ENDIF -->
- </td>
- <td class="row1">
- <!-- EVENT topiclist_row_prepend -->
- <!-- IF searchresults.S_UNREAD_TOPIC --><a href="{searchresults.U_NEWEST_POST}" class="imageset">{NEWEST_POST_IMG}</a><!-- ENDIF -->
- {searchresults.ATTACH_ICON_IMG} <a href="{searchresults.U_VIEW_TOPIC}" class="topictitle">{searchresults.TOPIC_TITLE}</a>
- <!-- IF searchresults.S_TOPIC_UNAPPROVED or searchresults.S_POSTS_UNAPPROVED -->
- <a href="{searchresults.U_MCP_QUEUE}" class="imageset">{searchresults.UNAPPROVED_IMG}</a>&nbsp;
- <!-- ENDIF -->
- <!-- IF searchresults.S_TOPIC_DELETED -->
- <a href="{searchresults.U_MCP_QUEUE}" class="imageset">{DELETED_IMG}</a>&nbsp;
- <!-- ENDIF -->
- <!-- IF searchresults.S_TOPIC_REPORTED -->
- <a href="{searchresults.U_MCP_REPORT}" class="imageset">{REPORTED_IMG}</a>&nbsp;
- <!-- ENDIF -->
- <!-- IF .searchresults.pagination -->
- <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}{L_COLON}
- <!-- BEGIN pagination -->
- <!-- IF searchresults.pagination.S_IS_PREV -->
- <!-- ELSEIF searchresults.pagination.S_IS_CURRENT --><strong>{searchresults.pagination.PAGE_NUMBER}</strong>
- <!-- ELSEIF searchresults.pagination.S_IS_ELLIPSIS --> {L_ELLIPSIS}
- <!-- ELSEIF searchresults.pagination.S_IS_NEXT -->
- <!-- ELSE --><a href="{searchresults.pagination.PAGE_URL}">{searchresults.pagination.PAGE_NUMBER}</a>
- <!-- ENDIF -->
- <!-- END pagination -->
- ] </p>
- <!-- ENDIF -->
- <p class="gensmall">{L_IN} <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a></p>
- <!-- EVENT topiclist_row_append -->
- </td>
- <td class="row2" width="100" align="center"><p class="topicauthor">{searchresults.TOPIC_AUTHOR_FULL}</p></td>
- <td class="row1" width="50" align="center"><p class="topicdetails">{searchresults.TOPIC_REPLIES}</p></td>
- <td class="row2" width="50" align="center"><p class="topicdetails">{searchresults.TOPIC_VIEWS}</p></td>
- <td class="row1" width="120" align="center">
- <p class="topicdetails">{searchresults.LAST_POST_TIME}</p>
- <p class="topicdetails">{searchresults.LAST_POST_AUTHOR_FULL}
- <a href="{searchresults.U_LAST_POST}" class="imageset">{LAST_POST_IMG}</a>
- </p>
- </td>
- </tr>
- <!-- EVENT search_results_topic_after -->
- <!-- BEGINELSE -->
- <tr valign="middle">
- <td colspan="7" class="row3" align="center">{L_NO_SEARCH_RESULTS}</td>
- </tr>
- <!-- END searchresults -->
- <tr>
- <td class="cat" colspan="7" valign="middle" align="center"><!-- IF S_SELECT_SORT_DAYS or S_SELECT_SORT_KEY --><span class="gensmall">{L_DISPLAY_POSTS}{L_COLON}</span> {S_SELECT_SORT_DAYS}<!-- IF S_SELECT_SORT_KEY -->&nbsp;<span class="gensmall">{L_SORT_BY}{L_COLON}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}<!-- ENDIF -->&nbsp;<input class="btnlite" type="submit" value="{L_GO}" name="sort" /><!-- ENDIF --></td>
- </tr>
- </table>
-
-<!-- ELSE -->
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th width="150" nowrap="nowrap">{L_AUTHOR}</th>
- <th width="100%" nowrap="nowrap">{L_MESSAGE}</th>
- </tr>
-
- <!-- BEGIN searchresults -->
- <tr class="row2">
- <!-- EVENT search_results_post_before -->
- <!-- IF searchresults.S_IGNORE_POST -->
- <td class="gensmall" colspan="2" height="25" align="center">{searchresults.L_IGNORE_POST}</td>
- <!-- ELSE -->
- <td colspan="2" height="25"><p class="topictitle"><a name="p{searchresults.POST_ID}" id="p{searchresults.POST_ID}" class="anchor"></a>&nbsp;{L_FORUM}{L_COLON} <a href="{searchresults.U_VIEW_FORUM}">{searchresults.FORUM_TITLE}</a> &nbsp; {L_TOPIC}{L_COLON} <a href="{searchresults.U_VIEW_TOPIC}">{searchresults.TOPIC_TITLE}</a> </p></td>
- </tr>
- <tr class="row1">
- <td width="150" align="center" valign="middle"><b class="postauthor">{searchresults.POST_AUTHOR_FULL}</b></td>
- <td height="25">
- <table width="100%" cellspacing="0" cellpadding="0" border="0">
- <tr>
- <td class="gensmall">
- <div style="float: {S_CONTENT_FLOW_BEGIN};">
- <!-- IF searchresults.POST_SUBJECT neq "" -->
- &nbsp;<b>{L_POST_SUBJECT}{L_COLON}</b> <a href="{searchresults.U_VIEW_POST}">{searchresults.POST_SUBJECT}</a>
- <!-- ELSE -->
- [ <a href="{searchresults.U_VIEW_POST}">{L_JUMP_TO_POST}</a> ]
- <!-- ENDIF -->
- </div>
- <div style="float: {S_CONTENT_FLOW_END};"><b>{L_POSTED}{L_COLON}</b> {searchresults.POST_DATE}&nbsp;</div>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr class="row1">
- <td width="150" align="center" valign="top"><br /><span class="postdetails">{L_REPLIES}{L_COLON} <b>{searchresults.TOPIC_REPLIES}</b><br />{L_VIEWS}{L_COLON} <b>{searchresults.TOPIC_VIEWS}</b></span><br /><br /></td>
- <td valign="top">
- <table width="100%" cellspacing="5">
- <tr>
- <td class="postbody">{searchresults.MESSAGE}</td>
- </tr>
- </table>
- </td>
- </tr>
- <!-- ENDIF -->
- <!-- EVENT search_results_post_after -->
- <tr>
- <td class="spacer" colspan="2"><img src="images/spacer.gif" height="1" alt="" /></td>
- </tr>
- <!-- BEGINELSE -->
- <tr valign="middle">
- <td colspan="2" class="row3" align="center">{L_NO_SEARCH_RESULTS}</td>
- </tr>
- <!-- END searchresults -->
- <tr>
- <td class="cat" colspan="2" align="center"><!-- IF S_SELECT_SORT_KEY --><span class="gensmall">{L_SORT_BY}{L_COLON}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" name="sort" value="{L_GO}" /><!-- ENDIF --></td>
- </tr>
- </table>
-<!-- ENDIF -->
-
-</form>
-
-<div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};"><span class="nav">{PAGE_NUMBER}</span> [ {SEARCH_MATCHES} ]</div>
-<div class="nav" style="float: {S_CONTENT_FLOW_END};"><!-- INCLUDE pagination.html --></div>
-
-<br clear="all" /><br />
-
-<!-- INCLUDE breadcrumbs.html -->
-
-<br clear="all" />
-
-<div align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></div>
-
-<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/searchbox.html b/phpBB/styles/subsilver2/template/searchbox.html
deleted file mode 100644
index 49de299ea2..0000000000
--- a/phpBB/styles/subsilver2/template/searchbox.html
+++ /dev/null
@@ -1 +0,0 @@
-<form method="get" name="search" action="{S_SEARCHBOX_ACTION}"><span class="gensmall">{L_SEARCH_FOR}{L_COLON}</span> <input class="post" type="text" name="keywords" size="20" /> <input class="btnlite" type="submit" value="{L_GO}" />{S_SEARCH_LOCAL_HIDDEN_FIELDS}</form>
diff --git a/phpBB/styles/subsilver2/template/simple_footer.html b/phpBB/styles/subsilver2/template/simple_footer.html
deleted file mode 100644
index d69c56fb8c..0000000000
--- a/phpBB/styles/subsilver2/template/simple_footer.html
+++ /dev/null
@@ -1,15 +0,0 @@
-
-</div>
-
-<div id="wrapfooter">
- <span class="copyright">{CREDIT_LINE}</span>
-</div>
-
-<script type="text/javascript" src="{T_JQUERY_LINK}"></script>
-<!-- IF S_ALLOW_CDN --><script type="text/javascript">window.jQuery || document.write(unescape('%3Cscript src="{T_ASSETS_PATH}/javascript/jquery.min.js?assets_version={T_ASSETS_VERSION}" type="text/javascript"%3E%3C/script%3E'));</script><!-- ENDIF -->
-
-<!-- EVENT simple_footer_after -->
-
-{$SCRIPTS}
-</body>
-</html>
diff --git a/phpBB/styles/subsilver2/template/simple_header.html b/phpBB/styles/subsilver2/template/simple_header.html
deleted file mode 100644
index 3abf89719f..0000000000
--- a/phpBB/styles/subsilver2/template/simple_header.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE html>
-<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
-<head>
-<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>
-
-<link rel="stylesheet" href="{T_STYLESHEET_LINK}" type="text/css" />
-<link rel="stylesheet" href="{T_STYLESHEET_LANG_LINK}" type="text/css" />
-
-<!-- EVENT simple_header_head_append -->
-
-{$STYLESHEETS}
-
-<!-- EVENT simple_header_stylesheets_after -->
-
-</head>
-
-<body class="{S_CONTENT_DIRECTION} {BODY_CLASS}">
-<!-- EVENT simple_header_body_before -->
-<a name="top" class="anchor"></a>
-<div id="wrapcentre">
diff --git a/phpBB/styles/subsilver2/template/timezone.js b/phpBB/styles/subsilver2/template/timezone.js
deleted file mode 100644
index c5829c0bb1..0000000000
--- a/phpBB/styles/subsilver2/template/timezone.js
+++ /dev/null
@@ -1,21 +0,0 @@
-(function($) { // Avoid conflicts with other libraries
-
-"use strict";
-
-$('#tz_date').change(function() {
- phpbb.timezoneSwitchDate(false);
-});
-
-$('#tz_select_date_suggest').click(function(){
- phpbb.timezonePreselectSelect(true);
-});
-
-$(document).ready(
- phpbb.timezoneEnableDateSelection
-);
-
-$(document).ready(
- phpbb.timezonePreselectSelect($('#tz_select_date_suggest').attr('timezone-preselect') == 'true')
-);
-
-})(jQuery); // Avoid conflicts with other libraries
diff --git a/phpBB/styles/subsilver2/template/timezone_option.html b/phpBB/styles/subsilver2/template/timezone_option.html
deleted file mode 100644
index 3fc7467d16..0000000000
--- a/phpBB/styles/subsilver2/template/timezone_option.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_BOARD_TIMEZONE}{L_COLON}</b></td>
- <td class="row2">
- <!-- IF .timezone_date -->
- <div id="tz_select_date" style="display: none;">
- <select name="tz_date" id="tz_date" class="autowidth tz_select">
- <option value="">{L_SELECT_CURRENT_TIME}</option>
- <!-- BEGIN timezone_date -->
- <option value="{timezone_date.VALUE}"<!-- IF timezone_date.SELECTED --> selected="selected"<!-- ENDIF -->>{timezone_date.TITLE}</option>
- <!-- END timezone_date -->
- </select><br />
- <input type="button" id="tz_select_date_suggest" class="btnlite" style="display: none;" timezone-preselect="<!-- IF S_TZ_PRESELECT -->true<!-- ELSE -->false<!-- ENDIF -->" data-l-suggestion="{L_TIMEZONE_DATE_SUGGESTION}" value="{L_TIMEZONE_DATE_SUGGESTION}" />
- </div>
- <!-- ENDIF -->
- <select name="tz" id="timezone" class="autowidth tz_select">
- <option value="">{L_SELECT_TIMEZONE}</option>
- <!-- BEGIN timezone_select -->
- <optgroup label="{timezone_select.LABEL}" data-tz-value="{timezone_select.VALUE}">
- <!-- BEGIN timezone_options -->
- <option title="{timezone_select.timezone_options.TITLE}" value="{timezone_select.timezone_options.VALUE}"<!-- IF timezone_select.timezone_options.SELECTED --> selected="selected"<!-- ENDIF -->>{timezone_select.timezone_options.LABEL}</option>
- <!-- END timezone_options -->
- </optgroup>
- <!-- END timezone_select -->
- </select>
-
- <!-- INCLUDEJS timezone.js -->
- </td>
-</tr>
diff --git a/phpBB/styles/subsilver2/template/ucp_agreement.html b/phpBB/styles/subsilver2/template/ucp_agreement.html
deleted file mode 100644
index fca7eb2368..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_agreement.html
+++ /dev/null
@@ -1,87 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<!-- IF S_SHOW_COPPA or S_REGISTRATION -->
-
-<!-- IF S_LANG_OPTIONS -->
-<script type="text/javascript">
-// <![CDATA[
- /**
- * Change language
- */
- function change_language(lang_iso)
- {
- document.cookie = '{COOKIE_NAME}_lang=' + lang_iso + '; path={COOKIE_PATH}';
- document.forms['register'].change_lang.value = lang_iso;
- document.forms['register'].submit();
- }
-
-// ]]>
-</script>
-
- <form method="post" action="{S_UCP_ACTION}" id="register">
- <table width="100%" cellspacing="0">
- <tr>
- <td class="gensmall" align="{S_CONTENT_FLOW_END}">{L_LANGUAGE}{L_COLON} <select name="lang" id="lang" onchange="change_language(this.value); return false;" title="{L_LANGUAGE}">{S_LANG_OPTIONS}</select></td>
- </tr>
- </table>
- {S_HIDDEN_FIELDS}
- </form>
-<!-- ENDIF -->
-
- <form method="post" action="{S_UCP_ACTION}">
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th height="25">{SITENAME} - {L_REGISTRATION}</th>
- </tr>
- <tr>
- <td class="row1" align="center">
- <table width="90%" cellspacing="2" cellpadding="2" border="0" align="center">
- <tr>
- <!-- IF S_SHOW_COPPA -->
- <td class="gen" align="center"><br />{L_COPPA_BIRTHDAY}<br /><br /><a href="{U_COPPA_NO}">{L_COPPA_NO}</a> :: <a href="{U_COPPA_YES}">{L_COPPA_YES}</a><br /><br /></td>
- <!-- ELSE -->
- <td>
- <!-- EVENT ucp_agreement_terms_before -->
- <span class="genmed"><br />{L_TERMS_OF_USE}<br /><br /></span>
- <!-- EVENT ucp_agreement_terms_after -->
- <div align="center">
- <input class="btnlite" type="submit" id="agreed" name="agreed" value="{L_AGREE}" /><br /><br />
- <input class="btnlite" type="submit" name="not_agreed" value="{L_NOT_AGREE}" />
- </div>
- </td>
- <!-- ENDIF -->
- </tr>
- </table>
- </td>
- </tr>
- </table>
- {S_HIDDEN_FIELDS}
- {S_FORM_TOKEN}
- </form>
-
-<!-- ELSEIF S_AGREEMENT -->
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th height="25">{SITENAME} - {AGREEMENT_TITLE}</th>
- </tr>
- <tr>
- <td class="row1" align="center">
- <table width="90%" cellspacing="2" cellpadding="2" border="0" align="center">
- <tr>
- <td>
- <span class="genmed"><br />{AGREEMENT_TEXT}<br /><br /></span>
- <div align="center">
- <a href="{U_BACK}">{L_BACK}</a>
- </div>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
-
-<!-- ENDIF -->
-
-<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_attachments.html b/phpBB/styles/subsilver2/template/ucp_attachments.html
deleted file mode 100644
index c513f933c0..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_attachments.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<!-- INCLUDE ucp_header.html -->
-
-<!-- IF S_ATTACHMENT_ROWS -->
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th nowrap="nowrap">#</th>
- <th nowrap="nowrap" width="15%"><a href="{U_SORT_FILENAME}">{L_FILENAME}</a></th>
- <th nowrap="nowrap" width="5%"><a href="{U_SORT_POST_TIME}">{L_POST_TIME}</a></th>
- <th nowrap="nowrap" width="5%"><a href="{U_SORT_FILESIZE}">{L_FILESIZE}</a></th>
- <th nowrap="nowrap" width="5%"><a href="{U_SORT_DOWNLOADS}">{L_DOWNLOADS}</a></th>
- <th width="2%" nowrap="nowrap">{L_DELETE}</th>
- </tr>
- <!-- IF TOTAL_ATTACHMENTS -->
- <tr>
- <td class="row3" colspan="6">
- <table width="100%" cellspacing="1">
- <tr>
- <td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}<br /></td>
- <td class="gensmall" nowrap="nowrap">&nbsp;[ {NUM_ATTACHMENTS} ]&nbsp;</td>
- <td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- INCLUDE pagination.html --></td>
- </tr>
- </table>
- </td>
- </tr>
- <!-- ENDIF -->
- <!-- BEGIN attachrow -->
- <!-- IF attachrow.S_ROW_COUNT is even --><tr class="row2"><!-- ELSE --><tr class="row1"><!-- ENDIF -->
-
- <td class="genmed" style="padding: 4px;" align="center" width="2%">&nbsp;{attachrow.ROW_NUMBER}&nbsp;</td>
- <td style="padding: 4px;"><a class="gen" href="{attachrow.U_VIEW_ATTACHMENT}">{attachrow.FILENAME}</a><br /><span class="gensmall"><!-- IF attachrow.S_IN_MESSAGE --><b>{L_PM}{L_COLON} </b><!-- ELSE --><b>{L_TOPIC}{L_COLON} </b><!-- ENDIF --><a href="{attachrow.U_VIEW_TOPIC}">{attachrow.TOPIC_TITLE}</a></span></td>
- <td class="gensmall" style="padding: 4px;" align="center" valign="middle" nowrap="nowrap">&nbsp;{attachrow.POST_TIME}&nbsp;</td>
- <td class="genmed" style="padding: 4px;" align="center" valign="middle" nowrap="nowrap">{attachrow.SIZE}</td>
- <td class="genmed" style="padding: 4px;" align="center">{attachrow.DOWNLOAD_COUNT}</td>
- <td style="padding: 4px;" align="center" valign="middle"><input type="checkbox" class="radio" name="attachment[{attachrow.ATTACH_ID}]" value="1" /></td>
- </tr>
- <!-- END attachrow -->
- <tr>
- <td class="cat" colspan="6"><div style="float: {S_CONTENT_FLOW_BEGIN};"><span class="gensmall">{L_SORT_BY}{L_COLON} </span><select name="sk">{S_SORT_OPTIONS}</select> <select name="sd">{S_ORDER_SELECT}</select>&nbsp;<input class="btnlite" type="submit" name="sort" value="{L_SORT}" /></div><div style="float: {S_CONTENT_FLOW_END};"><input class="btnlite" type="submit" name="delete" value="{L_DELETE_MARKED}" />&nbsp;</div></td>
- </tr>
- </table>
-
- <div style="float: {S_CONTENT_FLOW_END};"><b class="gensmall"><a href="#" onclick="marklist('ucp', 'attachment', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('ucp', 'attachment', false); return false;">{L_UNMARK_ALL}</a></b></div>
-
-<!-- ELSE -->
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th>{L_TITLE}</th>
- </tr>
- <tr class="row1">
- <td align="center"><b class="genmed">{L_UCP_NO_ATTACHMENTS}</b></td>
- </tr>
- </table>
-
-<!-- ENDIF -->
-
-<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_auth_link.html b/phpBB/styles/subsilver2/template/ucp_auth_link.html
deleted file mode 100644
index 75e3133fcf..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_auth_link.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!-- INCLUDE ucp_header.html -->
-
-<table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th colspan="4">{L_UCP_AUTH_LINK_TITLE}</th>
- </tr>
-
- <!-- IF ERROR -->
- <tr>
- <td class="row1" colspan="2" align="center"><span class="genmed error">{ERROR}</span></td>
- </tr>
- <!-- ENDIF -->
-
- <!-- IF PROVIDER_TEMPLATE_FILE -->
- <!-- INCLUDE {PROVIDER_TEMPLATE_FILE} -->
- <!-- ENDIF -->
-</table>
-
-<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_auth_link_oauth.html b/phpBB/styles/subsilver2/template/ucp_auth_link_oauth.html
deleted file mode 100644
index 80564d207b..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_auth_link_oauth.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!-- BEGIN oauth -->
- <tr>
- <th>{oauth.SERVICE_NAME}</th>
- </tr>
-
- <tr>
- <td class="row1">
- <form id="ucp" method="post" action="{S_UCP_ACTION}">
- <table>
- <!-- IF oauth.UNIQUE_ID -->
- <tr>
- <td class="row1">{L_UCP_AUTH_LINK_ID}{L_COLON}</td>
- <td class="row1">{oauth.UNIQUE_ID}</td>
- </tr>
- <tr>
- <td class="row1">&nbsp;</td>
- <td class="row1"><input type="submit" name="submit" tabindex="6" value="{L_UCP_AUTH_LINK_UNLINK}" class="button1" /></td>
- </tr>
- <!-- ELSE -->
- <tr>
- <td class="row1">{L_UCP_AUTH_LINK_ASK}</td>
- </tr>
- <tr>
- <td class="row1"><input type="submit" name="submit" tabindex="6" value="{L_UCP_AUTH_LINK_LINK}" class="button1" /></td>
- </tr>
- <!-- ENDIF -->
- </table>
- {oauth.HIDDEN_FIELDS}
- {S_HIDDEN_FIELDS}
- {S_FORM_TOKEN}
- </form>
- </td>
- </tr>
-<!-- END oauth -->
diff --git a/phpBB/styles/subsilver2/template/ucp_avatar_options_gravatar.html b/phpBB/styles/subsilver2/template/ucp_avatar_options_gravatar.html
deleted file mode 100644
index b8840e0aab..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_avatar_options_gravatar.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_GRAVATAR_AVATAR_EMAIL}{L_COLON}</b><br /><span class="gensmall">{L_GRAVATAR_AVATAR_EMAIL_EXPLAIN}</span></td>
- <td class="row2"><input type="text" name="avatar_gravatar_email" id="avatar_gravatar_email" value="{AVATAR_GRAVATAR_EMAIL}" class="inputbox" /></td>
- </tr>
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_GRAVATAR_AVATAR_SIZE}{L_COLON}</b><br /><span class="gensmall">{L_GRAVATAR_AVATAR_SIZE_EXPLAIN}</span></td>
- <td class="row2">
- <input type="text" name="avatar_gravatar_width" id="avatar_gravatar_width" size="3" value="{AVATAR_GRAVATAR_WIDTH}" class="inputbox autowidth" /> {L_PIXEL} &times;&nbsp;
- <input type="text" name="avatar_gravatar_height" id="avatar_gravatar_height" size="3" value="{AVATAR_GRAVATAR_HEIGHT}" class="inputbox autowidth" /> {L_PIXEL}
- </td>
- </tr>
-</table>
diff --git a/phpBB/styles/subsilver2/template/ucp_avatar_options_local.html b/phpBB/styles/subsilver2/template/ucp_avatar_options_local.html
deleted file mode 100644
index 919cf49e44..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_avatar_options_local.html
+++ /dev/null
@@ -1,38 +0,0 @@
-<table class="tablebg" width="100%" cellspacing="1">
- <!-- IF .avatar_local_cats -->
- <tr>
- <td class="cat" colspan="2" align="center" valign="middle"><span class="genmed">{L_AVATAR_CATEGORY}{L_COLON} </span><select name="avatar_local_cat" id="category">
- <!-- BEGIN avatar_local_cats -->
- <option value="{avatar_local_cats.NAME}"<!-- IF avatar_local_cats.SELECTED --> selected="selected"<!-- ENDIF -->>{avatar_local_cats.NAME}</option>
- <!-- END avatar_local_cats -->
- </select>&nbsp; <input class="btnlite" tabindex="0" type="submit" value="{L_GO}" name="avatar_local_go" />
- </td>
- </tr>
- <tr>
- <td class="row1" colspan="2" align="center">
- <table cellspacing="1" cellpadding="4" border="0">
- <!-- BEGIN avatar_local_row -->
- <tr>
- <!-- BEGIN avatar_local_col -->
- <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" 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_row -->
- </table>
- </td>
- </tr>
- <!-- ELSE -->
- <tr>
- <td class="row1" colspan="2"><strong>{L_NO_AVATARS}</strong></td>
- </tr>
- <!-- ENDIF -->
-</table>
diff --git a/phpBB/styles/subsilver2/template/ucp_avatar_options_remote.html b/phpBB/styles/subsilver2/template/ucp_avatar_options_remote.html
deleted file mode 100644
index 50ebb9b93d..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_avatar_options_remote.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_LINK_REMOTE_AVATAR}{L_COLON} </b><br /><span class="gensmall">{L_LINK_REMOTE_AVATAR_EXPLAIN}</span></td>
- <td class="row2"><input class="post" type="text" name="avatar_remote_url" size="40" value="{AVATAR_REMOTE_URL}" /></td>
- </tr>
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_LINK_REMOTE_SIZE}{L_COLON} </b><br /><span class="gensmall">{L_LINK_REMOTE_SIZE_EXPLAIN}</span></td>
- <td class="row2"><input class="post" type="text" name="avatar_remote_width" size="3" value="{AVATAR_REMOTE_WIDTH}" /> <span class="gen">{L_PIXEL} &times; </span> <input class="post" type="text" name="avatar_remote_height" size="3" value="{AVATAR_REMOTE_HEIGHT}" /> <span class="gen">{L_PIXEL}</span></td>
- </tr>
-</table>
diff --git a/phpBB/styles/subsilver2/template/ucp_avatar_options_upload.html b/phpBB/styles/subsilver2/template/ucp_avatar_options_upload.html
deleted file mode 100644
index 6b813baeaa..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_avatar_options_upload.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_UPLOAD_AVATAR_FILE}{L_COLON} </b></td>
- <td class="row2"><input type="hidden" name="MAX_FILE_SIZE" value="{AVATAR_SIZE}" /><input class="post" type="file" name="avatar_upload_file" /></td>
- </tr>
-<!-- IF S_UPLOAD_AVATAR_URL -->
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_UPLOAD_AVATAR_URL}{L_COLON} </b><br /><span class="gensmall">{L_UPLOAD_AVATAR_URL_EXPLAIN}</span></td>
- <td class="row2"><input class="post" type="text" name="avatar_upload_url" size="40" value="" /></td>
- </tr>
-<!-- ENDIF -->
-</table>
diff --git a/phpBB/styles/subsilver2/template/ucp_footer.html b/phpBB/styles/subsilver2/template/ucp_footer.html
deleted file mode 100644
index 57adb2da97..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_footer.html
+++ /dev/null
@@ -1,13 +0,0 @@
-
- <!-- IF not S_PRIVMSGS or S_SHOW_DRAFTS --> {S_FORM_TOKEN}</form><!-- ENDIF --></td>
-</tr>
-</table>
-<!-- IF (S_SHOW_PM_BOX or S_EDIT_POST) and S_POST_ACTION -->{S_FORM_TOKEN}</form><!-- ENDIF -->
-
-<br clear="all" />
-
-<!-- INCLUDE breadcrumbs.html -->
-
-<div align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></div>
-
-<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_groups_manage.html b/phpBB/styles/subsilver2/template/ucp_groups_manage.html
deleted file mode 100644
index 09d59c8ec0..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_groups_manage.html
+++ /dev/null
@@ -1,229 +0,0 @@
-<!-- INCLUDE ucp_header.html -->
-
-<!-- IF S_EDIT -->
-
- <!-- IF S_ERROR -->
- <div class="errorbox">
- <h3>{L_WARNING}</h3>
- <p>{ERROR_MSG}</p>
- </div>
- <!-- ENDIF -->
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th colspan="2">{L_USERGROUPS}</th>
- </tr>
- <tr>
- <td class="row1" colspan="2"><span class="genmed">{L_GROUPS_EXPLAIN}</span></td>
- </tr>
-
- <tr>
- <th colspan="2">{L_GROUP_DETAILS}</th>
- </tr>
- <tr>
- <td class="row1" width="35%"><label<!-- IF not S_SPECIAL_GROUP --> for="group_name"<!-- ENDIF -->>{L_GROUP_NAME}{L_COLON}</label></td>
- <td class="row2"><!-- IF S_SPECIAL_GROUP --><b<!-- IF GROUP_COLOUR --> style="color: #{GROUP_COLOUR};"<!-- ENDIF -->>{GROUP_NAME}</b><!-- ENDIF --><input name="group_name" type="<!-- IF S_SPECIAL_GROUP -->hidden<!-- ELSE -->text<!-- ENDIF -->" id="group_name" value="{GROUP_INTERNAL_NAME}" /></td>
- </tr>
- <tr>
- <td class="row1" width="35%"><label for="group_desc">{L_GROUP_DESC}{L_COLON}</label></td>
- <td class="row2"><textarea id="group_desc" name="group_desc" rows="5" cols="45">{GROUP_DESC}</textarea>
- <br /><input type="checkbox" class="radio" name="desc_parse_bbcode"<!-- IF S_DESC_BBCODE_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_BBCODE} &nbsp; <input type="checkbox" class="radio" name="desc_parse_smilies"<!-- IF S_DESC_SMILIES_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_SMILIES} &nbsp; <input type="checkbox" class="radio" name="desc_parse_urls"<!-- IF S_DESC_URLS_CHECKED --> checked="checked"<!-- ENDIF --> /> {L_PARSE_URLS}
- </td>
- </tr>
- <!-- IF not S_SPECIAL_GROUP -->
- <tr>
- <td class="row1" width="35%"><label for="group_type">{L_GROUP_TYPE}{L_COLON}</label><br /><span>{L_GROUP_TYPE_EXPLAIN}</span></td>
- <td class="row2">
- <input name="group_type" type="radio" class="radio" id="group_type" value="{GROUP_TYPE_FREE}"{GROUP_FREE} /> {L_GROUP_OPEN} &nbsp;
- <input name="group_type" type="radio" class="radio" value="{GROUP_TYPE_OPEN}"{GROUP_OPEN} /> {L_GROUP_REQUEST} &nbsp;
- <input name="group_type" type="radio" class="radio" value="{GROUP_TYPE_CLOSED}"{GROUP_CLOSED} /> {L_GROUP_CLOSED} &nbsp;
- <input name="group_type" type="radio" class="radio" value="{GROUP_TYPE_HIDDEN}"{GROUP_HIDDEN} /> {L_GROUP_HIDDEN}
- </td>
- </tr>
- <!-- ELSE -->
- <tr style="display:none;"><td><input name="group_type" type="hidden" value="{GROUP_TYPE_SPECIAL}" /></td></tr>
- <!-- ENDIF -->
-
- <tr>
- <th colspan="2">{L_GROUP_SETTINGS_SAVE}</th>
- </tr>
- <tr>
- <td class="row1" width="35%"><label for="group_colour">{L_GROUP_COLOR}{L_COLON}</label><br /><span>{L_GROUP_COLOR_EXPLAIN}</span></td>
- <td class="row2">
- <input name="group_colour" type="text" id="group_colour" value="{GROUP_COLOUR}" size="6" maxlength="6" />&nbsp;&nbsp;
- <span>[ <a href="#" id="color_palette_toggle">{L_COLOUR_SWATCH}</a> ]</span>
- <div id="color_palette_placeholder" style="display: none;" data-orientation="h" data-height="12" data-width="15" data-target="#group_colour"></div>
- </td>
- </tr>
- <tr>
- <td class="row1" width="35%"><label for="group_rank">{L_GROUP_RANK}{L_COLON}</label></td>
- <td class="row2"><select name="group_rank" id="group_rank">{S_RANK_OPTIONS}</select></td>
- </tr>
- <tr>
- <th colspan="2">{L_GROUP_AVATAR}</th>
- </tr>
- <tr>
- <td class="row1" width="35%"><label>{L_CURRENT_IMAGE}{L_COLON}</label><br /><span>{L_AVATAR_EXPLAIN}</span></td>
- <td class="row2">{AVATAR_IMAGE}<br /><br /><input type="checkbox" class="radio" name="avatar_delete" />&nbsp;<span>{L_DELETE_AVATAR}</span></td>
- </tr>
-<!-- IF not S_AVATARS_ENABLED -->
- <tr>
- <td class="row3" colspan="2" align="center">{L_AVATAR_FEATURES_DISABLED}</td>
- </tr>
-<!-- ENDIF -->
- <tr>
- <th colspan="2">{L_AVATAR_SELECT}</th>
- </tr>
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_AVATAR_TYPE}{L_COLON}</b></td>
- <td class="row2">
- <select name="avatar_driver" id="avatar_driver">
- <!-- BEGIN avatar_drivers -->
- <option value="{avatar_drivers.DRIVER}"<!-- IF avatar_drivers.SELECTED --> selected="selected"<!-- ENDIF -->>{avatar_drivers.L_TITLE}</option>
- <!-- END avatar_drivers -->
- </select></td>
- </tr>
-<!-- BEGIN avatar_drivers -->
- <tr class="avatar_option_{avatar_drivers.DRIVER}">
- <td class="row1" width="35%" colspan="2"><noscript><b class="genmed">{avatar_drivers.L_TITLE} </b><br /></noscript>{avatar_drivers.L_EXPLAIN}</span></td>
- </tr>
- <tr class="avatar_option_{avatar_drivers.DRIVER}">
- <td colspan="2" style="padding: 0">{avatar_drivers.OUTPUT}</td>
- </tr>
-<!-- END avatar_drivers -->
-
- <tr>
- <td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input class="btnlite" type="submit" id="submit" name="update" value="{L_SUBMIT}" />&nbsp;
- <input class="btnmain" type="reset" id="reset" name="reset" value="{L_RESET}" /></td>
- </tr>
- </table>
-
-<!-- INCLUDEJS avatars.js -->
-
-<!-- ELSEIF S_LIST -->
-
- <h1>{L_GROUP_MEMBERS}</h1>
-
- <p>{L_GROUP_MEMBERS_EXPLAIN}</p>
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th>{L_USERNAME}</th>
- <th>{L_GROUP_DEFAULT}</th>
- <th>{L_JOINED}</th>
- <th>{L_POSTS}</th>
- <th>{L_MARK}</th>
- </tr>
-
- <tr>
- <td class="row3" colspan="5"><b>{L_GROUP_LEAD}</b></td>
- </tr>
- <!-- BEGIN leader -->
- <!-- IF leader.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <td>{leader.USERNAME_FULL}</td>
- <td style="text-align: center;"><!-- IF leader.S_GROUP_DEFAULT -->{L_YES}<!-- ELSE -->{L_NO}<!-- ENDIF --></td>
- <td style="text-align: center;">{leader.JOINED}</td>
- <td style="text-align: center;">{leader.USER_POSTS}</td>
- <td style="text-align: center;"></td>
- </tr>
- <!-- END leader -->
-
- <!-- BEGIN member -->
- <!-- IF member.S_PENDING -->
- <tr>
- <td class="row3" colspan="5"><b>{L_GROUP_PENDING}</b></td>
- </tr>
- <!-- ELSEIF member.S_APPROVED -->
- <tr>
- <td class="row3" colspan="5"><b>{L_GROUP_APPROVED}</b></td>
- </tr>
- <!-- ELSE -->
- <!-- IF member.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <td>{member.USERNAME_FULL}</td>
- <td style="text-align: center;"><!-- IF member.S_GROUP_DEFAULT -->{L_YES}<!-- ELSE -->{L_NO}<!-- ENDIF --></td>
- <td style="text-align: center;">{member.JOINED}</td>
- <td style="text-align: center;">{member.USER_POSTS}</td>
- <td style="text-align: center;"><input type="checkbox" class="radio" name="mark[]" value="{member.USER_ID}" /></td>
- </tr>
- <!-- ENDIF -->
- <!-- BEGINELSE -->
- <tr>
- <td class="row1" colspan="5" style="text-align: center;">{L_GROUPS_NO_MEMBERS}</td>
- </tr>
- <!-- END member -->
- <tr>
- <td class="cat" colspan="5" align="center"><div style="float: {S_CONTENT_FLOW_END};"><span class="small"><a href="#" onclick="marklist('ucp', 'mark', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('ucp', 'mark', false); return false;">{L_UNMARK_ALL}</a></span></div><div style="float: {S_CONTENT_FLOW_BEGIN};"><select name="action"><option class="sep" value="">{L_SELECT_OPTION}</option>{S_ACTION_OPTIONS}</select> <input class="btnmain" type="submit" name="update" value="{L_SUBMIT}" /></div></td>
- </tr>
- </table>
-
- <div class="pagination" style="float: {S_CONTENT_FLOW_BEGIN};">
- <!-- IF .pagination -->
- <!-- INCLUDE pagination.html -->
- <!-- ELSE -->
- {PAGE_NUMBER}
- <!-- ENDIF -->
- </div>
-
- <br />
- <br />
-
- <h1>{L_ADD_USERS}</h1>
-
- <p>{L_ADD_USERS_UCP_EXPLAIN}</p>
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th colspan="2">{L_ADD_USERS}</th>
- </tr>
- <tr>
- <td class="row1"><label for="default">{L_USER_GROUP_DEFAULT}{L_COLON}</label><br /><span>{L_USER_GROUP_DEFAULT_EXPLAIN}</span></td>
- <td class="row2"><input name="default" type="radio" class="radio" value="1" /> {L_YES} &nbsp; <input name="default" type="radio" class="radio" id="default" value="0" checked="checked" /> {L_NO}</td>
- </tr>
- <tr>
- <td class="row1"><label for="usernames">{L_USERNAME}{L_COLON}</label><br /><span>{L_USERNAMES_EXPLAIN}</span></td>
- <td class="row2"><textarea id="usernames" name="usernames" cols="40" rows="5"></textarea><br />[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</td>
- </tr>
- <tr>
- <td class="cat" colspan="2" align="center"><input class="btnmain" type="submit" name="addusers" value="{L_SUBMIT}" /></td>
- </tr>
- </table>
-
-<!-- ELSE -->
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th colspan="3">{L_USERGROUPS}</th>
- </tr>
- <tr>
- <td class="row1" colspan="3"><span class="genmed">{L_GROUPS_EXPLAIN}</span></td>
- </tr>
-
- <tr>
- <th>{L_GROUP_DETAILS}</th>
- <th colspan="2">{L_OPTIONS}</th>
- </tr>
- <tr>
- <td class="row3" colspan="3"><b class="gensmall">{L_GROUP_LEADER}</b></td>
- </tr>
- <!-- BEGIN leader -->
- <!-- IF leader.S_ROW_COUNT is odd --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
-
- <td><b class="genmed"<!-- IF leader.GROUP_COLOUR --> style="color: #{leader.GROUP_COLOUR};"<!-- ENDIF -->>{leader.GROUP_NAME}</b><!-- IF leader.GROUP_DESC --><p class="forumdesc">{leader.GROUP_DESC}</p><!-- ENDIF --></td>
- <td style="text-align: center;"><a href="{leader.U_EDIT}">{L_EDIT}</a></td>
- <td style="text-align: center;"><a href="{leader.U_LIST}">{L_GROUP_LIST}</a></td>
-
- </tr>
- <!-- BEGINELSE -->
- <tr>
- <td class="row2" align="center" colspan="3"><b class="genmed">{L_NO_LEADERS}</b></td>
- </tr>
- <!-- END leader -->
-
- <tr>
- <td class="cat" align="{S_CONTENT_FLOW_END}" colspan="3">&nbsp;</td>
- </tr>
- </table>
-
-<!-- ENDIF -->
-
-<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_groups_membership.html b/phpBB/styles/subsilver2/template/ucp_groups_membership.html
deleted file mode 100644
index 846d48007e..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_groups_membership.html
+++ /dev/null
@@ -1,93 +0,0 @@
-<!-- INCLUDE ucp_header.html -->
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th colspan="3">{L_USERGROUPS}</th>
-</tr>
-<tr>
- <td class="row1" colspan="3"><span class="genmed">{L_GROUPS_EXPLAIN}</span></td>
-</tr>
-
-<tr>
- <th colspan="2">{L_GROUP_DETAILS}</th>
- <th>{L_SELECT}</th>
-</tr>
-
-<!-- BEGIN leader -->
- <!-- IF leader.S_FIRST_ROW -->
- <tr>
- <td class="row3" colspan="3"><b class="gensmall">{L_GROUP_LEADER}</b></td>
- </tr>
- <!-- ENDIF -->
-
- <!-- IF leader.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <td width="6%" align="center" nowrap="nowrap"><!-- IF S_CHANGE_DEFAULT --><input type="radio" class="radio" name="default"<!-- IF leader.S_GROUP_DEFAULT --> checked="checked"<!-- ENDIF --> value="{leader.GROUP_ID}" /><!-- ENDIF --></td>
- <td>
- <b class="genmed"><a href="{leader.U_VIEW_GROUP}"<!-- IF leader.GROUP_COLOUR --> style="color: #{leader.GROUP_COLOUR};"<!-- ENDIF -->>{leader.GROUP_NAME}</a></b>
- <!-- IF leader.GROUP_DESC --><br /><span class="genmed">{leader.GROUP_DESC}</span><!-- ENDIF -->
- <!-- IF not leader.GROUP_SPECIAL --><br /><i class="gensmall">{leader.GROUP_STATUS}</i><!-- ENDIF -->
- </td>
- <td width="6%" align="center" nowrap="nowrap"><!-- IF not leader.GROUP_SPECIAL --><input type="radio" class="radio" name="selected" value="{leader.GROUP_ID}" /><!-- ENDIF --></td>
- </tr>
-<!-- END leader -->
-
-<!-- BEGIN member -->
- <!-- IF member.S_FIRST_ROW -->
- <tr>
- <td class="row3" colspan="3"><b class="gensmall">{L_GROUP_MEMBER}</b></td>
- </tr>
- <!-- ENDIF -->
-
- <!-- IF member.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <td width="6%" align="center" nowrap="nowrap"><!-- IF S_CHANGE_DEFAULT --><input type="radio" class="radio" name="default"<!-- IF member.S_GROUP_DEFAULT --> checked="checked"<!-- ENDIF --> value="{member.GROUP_ID}" /><!-- ENDIF --></td>
- <td>
- <b class="genmed"><a href="{member.U_VIEW_GROUP}"<!-- IF member.GROUP_COLOUR --> style="color: #{member.GROUP_COLOUR};"<!-- ENDIF -->>{member.GROUP_NAME}</a></b>
- <!-- IF member.GROUP_DESC --><br /><span class="genmed">{member.GROUP_DESC}</span><!-- ENDIF -->
- <!-- IF not member.GROUP_SPECIAL --><br /><i class="gensmall">{member.GROUP_STATUS}</i><!-- ENDIF -->
- </td>
- <td width="6%" align="center" nowrap="nowrap"><!-- IF not member.GROUP_SPECIAL --><input type="radio" class="radio" name="selected" value="{member.GROUP_ID}" /><!-- ENDIF --></td>
- </tr>
-<!-- END member -->
-
-<!-- BEGIN pending -->
- <!-- IF pending.S_FIRST_ROW -->
- <tr>
- <td class="row3" colspan="3"><b class="gensmall">{L_GROUP_PENDING}</b></td>
- </tr>
- <!-- ENDIF -->
-
- <!-- IF pending.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <td width="6%" align="center" nowrap="nowrap">&nbsp;</td>
- <td>
- <b class="genmed"><a href="{pending.U_VIEW_GROUP}"<!-- IF pending.GROUP_COLOUR --> style="color: #{pending.GROUP_COLOUR};"<!-- ENDIF -->>{pending.GROUP_NAME}</a></b>
- <!-- IF pending.GROUP_DESC --><br /><span class="genmed">{pending.GROUP_DESC}</span><!-- ENDIF -->
- <!-- IF not pending.GROUP_SPECIAL --><br /><i class="gensmall">{pending.GROUP_STATUS}</i><!-- ENDIF -->
- </td>
- <td width="6%" align="center" nowrap="nowrap"><!-- IF not pending.GROUP_SPECIAL --><input type="radio" class="radio" name="selected" value="{pending.GROUP_ID}" /><!-- ENDIF --></td>
- </tr>
-<!-- END pending -->
-
-<!-- BEGIN nonmember -->
- <!-- IF nonmember.S_FIRST_ROW -->
- <tr>
- <td class="row3" colspan="3"><b class="gensmall">{L_GROUP_NONMEMBER}</b></td>
- </tr>
- <!-- ENDIF -->
-
- <!-- IF nonmember.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <td width="6%" align="center" nowrap="nowrap">&nbsp;</td>
- <td>
- <b class="genmed"><a href="{nonmember.U_VIEW_GROUP}"<!-- IF nonmember.GROUP_COLOUR --> style="color: #{nonmember.GROUP_COLOUR};"<!-- ENDIF -->>{nonmember.GROUP_NAME}</a></b>
- <!-- IF nonmember.GROUP_DESC --><br /><span class="genmed">{nonmember.GROUP_DESC}</span><!-- ENDIF -->
- <!-- IF not nonmember.GROUP_SPECIAL --><br /><i class="gensmall">{nonmember.GROUP_STATUS}</i><!-- ENDIF -->
- </td>
- <td width="6%" align="center" nowrap="nowrap"><!-- IF nonmember.S_CAN_JOIN --><input type="radio" class="radio" name="selected" value="{nonmember.GROUP_ID}" /><!-- ENDIF --></td>
- </tr>
-<!-- END nonmember -->
-
-<tr>
- <td class="cat" colspan="3"><!-- IF S_CHANGE_DEFAULT --><div style="float: {S_CONTENT_FLOW_BEGIN};"><input class="btnlite" type="submit" name="change_default" value="{L_CHANGE_DEFAULT_GROUP}" /></div><!-- ENDIF --><div style="float: {S_CONTENT_FLOW_END};"><span class="genmed">{L_SELECT}{L_COLON} </span><select name="action"><option value="join">{L_JOIN_SELECTED}</option><option value="resign">{L_RESIGN_SELECTED}</option><option value="demote">{L_DEMOTE_SELECTED}</option></select>&nbsp;<input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" />&nbsp;</div></td>
-</tr>
-</table>
-
-<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_header.html b/phpBB/styles/subsilver2/template/ucp_header.html
deleted file mode 100644
index dff2841b54..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_header.html
+++ /dev/null
@@ -1,165 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-
-<!-- IF S_SHOW_PM_BOX and S_POST_ACTION -->
- <form action="{S_POST_ACTION}" method="post" name="postform"{S_FORM_ENCTYPE}>
-<!-- ENDIF -->
-<table width="100%" cellspacing="0" cellpadding="0" border="0">
-<tr>
- <td width="20%" valign="top">
-
-<!-- IF S_SHOW_PM_BOX and S_POST_ACTION -->
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th>{L_PM_TO}</th>
- </tr>
- <!-- IF not S_ALLOW_MASS_PM -->
- <tr>
- <td class="row1"><b class="genmed">{L_USERNAME}{L_COLON}</b><br />[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</td>
- </tr>
-
- <tr>
- <td class="row2"><input class="post" type="text" name="username_list" size="20" value="" />&nbsp;<input class="post" type="submit" name="add_to" value="{L_ADD}" /></td>
- </tr>
- <!-- ELSE -->
- <tr>
- <td class="row1"><b class="genmed">{L_USERNAMES}{L_COLON}</b></td>
- </tr>
- <!-- EVENT posting_pm_header_find_username_before -->
- <tr>
- <td class="row2"><textarea name="username_list" rows="5" cols="22" tabindex="1"></textarea><br />
- [ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]
- </td>
- </tr>
- <!-- EVENT posting_pm_header_find_username_after -->
- <!-- ENDIF -->
- <!-- IF S_GROUP_OPTIONS -->
- <tr>
- <td class="row1"><b class="genmed">{L_USERGROUPS}{L_COLON}</b></td>
- </tr>
- <tr>
- <td class="row2"><select name="group_list[]" multiple="multiple" size="5" style="width:150px">{S_GROUP_OPTIONS}</select></td>
- </tr>
- <!-- ENDIF -->
- <!-- IF S_ALLOW_MASS_PM -->
- <tr>
- <td class="row1"><div style="float: {S_CONTENT_FLOW_BEGIN};">&nbsp;<input class="post" type="submit" name="add_bcc" value="{L_ADD_BCC}" tabindex="1" />&nbsp;</div><div style="float: {S_CONTENT_FLOW_END};">&nbsp;<input class="post" type="submit" name="add_to" value="{L_ADD_TO}" tabindex="1" />&nbsp;</div></td>
- </tr>
- <!-- ENDIF -->
- </table>
- <div style="padding: 2px;"></div>
-<!-- ENDIF -->
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th>{L_OPTIONS}</th>
-</tr>
-
-<!-- BEGIN l_block1 -->
- <tr>
- <!-- IF l_block1.S_SELECTED -->
- <td class="row1"><b class="nav">{l_block1.L_TITLE}</b>
-
- <!-- IF S_PRIVMSGS -->
-
- <!-- the ! at the beginning of the loop name forces the loop to be not a nested one of l_block1 (it gets parsed separately) -->
- <!-- BEGIN !folder -->
- <!-- IF folder.S_FIRST_ROW -->
- <ul class="nav" style="margin: 0; padding: 0; list-style-type: none; line-height: 175%;">
- <!-- ENDIF -->
-
- <!-- IF folder.S_CUR_FOLDER -->
- <li class="row2" style="padding: 1px 0;">&#187; <a href="{folder.U_FOLDER}">{folder.FOLDER_NAME}<!-- IF folder.S_UNREAD_MESSAGES --> ({folder.UNREAD_MESSAGES})<!-- ENDIF --></a></li>
- <!-- ELSE -->
- <li>&#187; <a href="{folder.U_FOLDER}">{folder.FOLDER_NAME}<!-- IF folder.S_UNREAD_MESSAGES --> ({folder.UNREAD_MESSAGES})<!-- ENDIF --></a></li>
- <!-- ENDIF -->
-
- <!-- IF folder.S_LAST_ROW -->
- </ul>
- <hr />
- <!-- ENDIF -->
- <!-- END !folder -->
-
- <!-- ENDIF -->
-
- <ul class="nav" style="margin: 0; padding: 0; list-style-type: none; line-height: 175%;">
- <!-- BEGIN l_block2 -->
- <li>&#187; <!-- IF l_block1.l_block2.S_SELECTED --><b>{l_block1.l_block2.L_TITLE}</b><!-- ELSE --><a href="{l_block1.l_block2.U_TITLE}">{l_block1.l_block2.L_TITLE}</a><!-- ENDIF --></li>
- <!-- END l_block2 -->
- </ul>
- <!-- ELSE -->
- <td class="row2" nowrap="nowrap" onmouseover="this.className='row1'" onmouseout="this.className='row2'" onclick="location.href=this.firstChild.href;"><a class="nav" href="{l_block1.U_TITLE}">{l_block1.L_TITLE}</a>
- <!-- ENDIF -->
- </td>
- </tr>
-<!-- END l_block1 -->
-</table>
-
-<div style="padding: 2px;"></div>
-
-<!-- IF S_SHOW_COLOUR_LEGEND -->
- <table class="tablebg" width="100%" cellspacing="1" cellpadding="0">
- <tr>
- <th colspan="2">{L_MESSAGE_COLOURS}</th>
- </tr>
- <!-- BEGIN pm_colour_info -->
- <tr>
- <!-- IF not pm_colour_info.IMG -->
- <td class="row1 {pm_colour_info.CLASS}" width="5"><img src="images/spacer.gif" width="5" alt="{pm_colour_info.LANG}" /></td>
- <!-- ELSE -->
- <td class="row1" width="25" align="center">{pm_colour_info.IMG}</td>
- <!-- ENDIF -->
- <td class="row1"><span class="genmed">{pm_colour_info.LANG}</span></td>
- </tr>
- <!-- END pm_colour_info -->
- </table>
-
- <div style="padding: 2px;"></div>
-<!-- ENDIF -->
-
-<!-- IF S_ZEBRA_ENABLED and S_ZEBRA_FRIENDS_ENABLED -->
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th>{L_FRIENDS}</th>
- </tr>
- <tr>
- <td class="row1" align="center">
-
- <b class="genmed online">{L_FRIENDS_ONLINE}</b>
-
- <ul class="nav" style="margin: 0; padding: 0; list-style-type: none; line-height: 175%;">
- <!-- BEGIN friends_online -->
- <li>{friends_online.USERNAME_FULL}
- <!-- IF S_SHOW_PM_BOX -->
- &nbsp;[ <input class="post" style="font-size: 90%;" type="submit" name="add_to[{friends_online.USER_ID}]" value="{L_ADD}" /> ]
- <!-- ENDIF -->
- </li>
- <!-- BEGINELSE -->
- <li>{L_NO_FRIENDS_ONLINE}</li>
- <!-- END friends_online -->
- </ul>
-
- <hr />
-
- <b class="genmed offline">{L_FRIENDS_OFFLINE}</b>
-
- <ul class="nav" style="margin: 0; padding: 0; list-style-type: none; line-height: 175%;">
- <!-- BEGIN friends_offline -->
- <li>{friends_offline.USERNAME_FULL}
- <!-- IF S_SHOW_PM_BOX -->
- &nbsp;[ <input class="post" style="font-size: 90%;" type="submit" name="add_to[{friends_offline.USER_ID}]" value="{L_ADD}" /> ]
- <!-- ENDIF -->
- </li>
- <!-- BEGINELSE -->
- <li>{L_NO_FRIENDS_OFFLINE}</li>
- <!-- END friends_offline -->
- </ul>
-
- </td>
- </tr>
- </table>
-<!-- ENDIF -->
-
-</td>
-<td><img src="images/spacer.gif" width="4" alt="" /></td>
-<td width="80%" valign="top"><!-- IF not S_PRIVMSGS or S_SHOW_DRAFTS --><form name="ucp" id="ucp" method="post" action="{S_UCP_ACTION}"{S_FORM_ENCTYPE}><!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/ucp_login_link.html b/phpBB/styles/subsilver2/template/ucp_login_link.html
deleted file mode 100644
index 6db9890d8c..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_login_link.html
+++ /dev/null
@@ -1,74 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th>{SITENAME} - {L_LOGIN_LINK}</th>
- </tr>
-
- <tr>
- <td class="row1" align="center"><span class="genmed">{L_LOGIN_LINK_EXPLAIN}</span></td>
- </tr>
-
- <!-- IF LOGIN_LINK_ERROR -->
- <tr>
- <td class="row1" align="center"><span class="genmed error">{LOGIN_LINK_ERROR}</span></td>
- </tr>
- <!-- ENDIF -->
-
- <tr>
- <td class="row1">
- <form action="{REGISTER_ACTION}" method="post" id="register">
- <table width="100%" cellspacing="1">
- <tr>
- <th colspan="2">{L_REGISTER}</th>
- </tr>
-
- <tr>
- <td>{S_HIDDEN_FIELDS}<input type="submit" name="register" tabindex="1" value="{L_REGISTER}" class="button1" /></td>
- </tr>
- </table>
- </form>
- </td>
- </tr>
-
- <tr>
- <td class="row1">
- <form action="{LOGIN_ACTION}" method="post" id="login">
- <table width="100%" cellspacing="1">
- <tr>
- <th colspan="2">{L_LOGIN}</th>
- </tr>
-
- <!-- IF LOGIN_ERROR -->
- <tr>
- <td class="row1" align="center" colspan="2"><span class="genmed error">{LOGIN_ERROR}</span></td>
- </tr>
- <!-- ENDIF -->
-
- <tr>
- <td><label for="{USERNAME_CREDENTIAL}">{L_USERNAME}{L_COLON}</label></td>
- <td><input type="text" tabindex="2" name="{USERNAME_CREDENTIAL}" id="{USERNAME_CREDENTIAL}" size="25" value="{LOGIN_USERNAME}" class="inputbox autowidth" /></td>
- </tr>
-
- <tr>
- <td><label for="{PASSWORD_CREDENTIAL}">{L_PASSWORD}{L_COLON}</label></td>
- <td><input type="password" tabindex="3" id="{PASSWORD_CREDENTIAL}" name="{PASSWORD_CREDENTIAL}" size="25" class="inputbox autowidth" autocomplete="off" /></td>
- </tr>
-
- <!-- IF CAPTCHA_TEMPLATE and S_CONFIRM_CODE -->
- <!-- DEFINE $CAPTCHA_TAB_INDEX = 4 -->
- <!-- INCLUDE {CAPTCHA_TEMPLATE} -->
- <!-- ENDIF -->
-
- {S_LOGIN_REDIRECT}
- <tr>
- <td>&nbsp;</td>
- <td>{S_HIDDEN_FIELDS}<input type="submit" name="login" tabindex="5" value="{L_LOGIN}" class="button1" /></td>
- </tr>
- </table>
- </form>
- </td>
- </tr>
-</table>
-
-<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_main_bookmarks.html b/phpBB/styles/subsilver2/template/ucp_main_bookmarks.html
deleted file mode 100644
index e91417503f..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_main_bookmarks.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!-- INCLUDE ucp_header.html -->
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th colspan="4">{L_UCP}</th>
-</tr>
-<tr>
- <td class="row1" colspan="4" align="center"><span class="genmed">{L_BOOKMARKS_EXPLAIN}</span></td>
-</tr>
-<!-- IF .topicrow -->
-<tr>
- <th colspan="4">{L_BOOKMARKS}</th>
-</tr>
-<!-- ENDIF -->
-
-<!-- IF S_NO_DISPLAY_BOOKMARKS -->
- <tr class="row1">
- <td colspan="4" align="center"><b class="genmed">{L_BOOKMARKS_DISABLED}</b></td>
- </tr>
-<!-- ELSE -->
-
- <!-- IF TOTAL_TOPICS -->
- <tr>
- <td class="row3" colspan="4">
- <table width="100%" cellspacing="1">
- <tr>
- <td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}<br /></td>
- <td class="gensmall" nowrap="nowrap">&nbsp;[ {TOTAL_TOPICS} ]&nbsp;</td>
- <td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- INCLUDE pagination.html --></td>
- </tr>
- </table>
- </td>
- </tr>
- <!-- ENDIF -->
-
- <!-- BEGIN topicrow -->
-
- <!-- IF topicrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <td style="padding: 4px;" width="20" align="center" valign="middle">{topicrow.TOPIC_FOLDER_IMG}</td>
- <!-- IF topicrow.S_DELETED_TOPIC -->
- <td class="postdetails" style="padding: 4px" width="100%" colspan="2">{L_DELETED_TOPIC}</td>
- <!-- ELSE -->
- <td style="padding: 4px;" width="100%" valign="top">
- <p class="topictitle"><!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF -->{topicrow.ATTACH_ICON_IMG} <a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a></p>
- <!-- IF topicrow.S_GLOBAL_TOPIC --><span class="gensmall">{L_GLOBAL_ANNOUNCEMENT}</span><!-- ELSE --><span class="gensmall"><b>{L_FORUM}{L_COLON} </b><a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a></span><!-- ENDIF -->
- <!-- IF .topicrow.pagination -->
- <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}{L_COLON}
- <!-- BEGIN pagination -->
- <!-- IF topicrow.pagination.S_IS_PREV -->
- <!-- ELSEIF topicrow.pagination.S_IS_CURRENT --><strong>{topicrow.pagination.PAGE_NUMBER}</strong>
- <!-- ELSEIF topicrow.pagination.S_IS_ELLIPSIS --> {L_ELLIPSIS}
- <!-- ELSEIF topicrow.pagination.S_IS_NEXT -->
- <!-- ELSE --><a href="{topicrow.pagination.PAGE_URL}">{topicrow.pagination.PAGE_NUMBER}</a>
- <!-- ENDIF -->
- <!-- END pagination -->
- ] </p>
- <!-- ENDIF -->
- </td>
- <td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap">
- <p class="topicdetails">{topicrow.LAST_POST_TIME}</p>
- <p class="topicdetails">{topicrow.LAST_POST_AUTHOR_FULL}
- <a href="{topicrow.U_LAST_POST}">{LAST_POST_IMG}</a>
- </p>
- </td>
- <!-- ENDIF -->
- <td style="padding: 4px;"> <input type="checkbox" class="radio" name="t[{topicrow.TOPIC_ID}]" /> </td>
- </tr>
- <!-- BEGINELSE -->
- <tr class="row1">
- <td colspan="4" align="center"><b class="genmed">{L_NO_BOOKMARKS}</b></td>
- </tr>
- <!-- END topicrow -->
-
- <!-- IF .topicrow -->
- <tr>
- <td class="cat" colspan="5" align="{S_CONTENT_FLOW_END}"><input class="btnlite" type="submit" name="unbookmark" value="{L_REMOVE_BOOKMARK_MARKED}" />&nbsp;</td>
- </tr>
- <!-- ENDIF -->
- <!-- ENDIF -->
-</table>
-
-<!-- IF not S_NO_DISPLAY_BOOKMARKS and .topicrow -->
- <div class="gensmall" style="float: {S_CONTENT_FLOW_END}; padding-top: 2px;"><b><a href="#" onclick="marklist('ucp', 't', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('ucp', 't', false); return false;">{L_UNMARK_ALL}</a></b></div>
-<!-- ENDIF -->
-
-<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_main_drafts.html b/phpBB/styles/subsilver2/template/ucp_main_drafts.html
deleted file mode 100644
index d63d678250..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_main_drafts.html
+++ /dev/null
@@ -1,96 +0,0 @@
-<!-- INCLUDE ucp_header.html -->
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th colspan="4">{L_UCP}</th>
-</tr>
-<tr>
- <td class="row1" colspan="4" align="center"><span class="genmed">{L_DRAFTS_EXPLAIN}</span></td>
-</tr>
-
-<!-- IF ERROR -->
- <tr>
- <td class="row1" colspan="2" align="center"><span class="genmed error">{ERROR}</span></td>
- </tr>
-<!-- ENDIF -->
-
-<!-- IF not S_EDIT_DRAFT -->
-
- <!-- IF S_DRAFT_ROWS -->
- <tr>
- <th>{L_SAVE_DATE}</th>
- <th>{L_DRAFT_TITLE}</th>
- <th>{L_OPTIONS}</th>
- <th>{L_DELETE}</th>
- </tr>
- <!-- ENDIF -->
-
- <!-- BEGIN draftrow -->
-
- <!-- IF draftrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
-
- <td class="postdetails" style="padding: 4px;" nowrap="nowrap">{draftrow.DATE}</td>
- <td style="padding: 4px;" valign="top" width="100%">
- <p class="topictitle">{draftrow.DRAFT_SUBJECT}</p>
- <!-- IF draftrow.S_LINK_TOPIC --><span class="gensmall">{L_TOPIC}{L_COLON} <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span>
- <!-- ELSEIF draftrow.S_LINK_FORUM --><span class="gensmall">{L_FORUM}{L_COLON} <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span>
- <!-- ELSEIF draftrow.S_LINK_PM --><span class="gensmall">{L_PRIVATE_MESSAGE}</span>
- <!-- ELSE --><span class="gensmall">{L_NO_TOPIC_FORUM}</span><!-- ENDIF -->
- </td>
- <td style="padding: 4px;" align="center" nowrap="nowrap"><span class="genmed"><!-- IF draftrow.U_INSERT --><a href="{draftrow.U_INSERT}">{L_LOAD_DRAFT}</a><br /><!-- ENDIF --><a href="{draftrow.U_VIEW_EDIT}">{L_VIEW_EDIT}</a></span></td>
- <td style="padding: 4px;" align="center"><input type="checkbox" class="radio" name="d[{draftrow.DRAFT_ID}]" /></td>
- </tr>
- <!-- BEGINELSE -->
- <tr>
- <td class="row1" colspan="4" align="center"><b class="genmed">{L_NO_SAVED_DRAFTS}</b></td>
- </tr>
- <!-- END draftrow -->
-
- <!-- IF S_DRAFT_ROWS -->
- <tr>
- <td class="cat" colspan="4" align="{S_CONTENT_FLOW_END}"><input class="btnlite" type="submit" name="delete" value="{L_DELETE_MARKED}" />&nbsp;</td>
- </tr>
- <!-- ENDIF -->
-
-<!-- ELSEIF S_EDIT_DRAFT -->
- <tr>
- <td class="row1" width="22%"><b class="genmed">{L_SUBJECT}{L_COLON}</b></td>
- <td class="row2"><input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="64" tabindex="2" value="{DRAFT_SUBJECT}" /></td>
- </tr>
- <tr>
- <td class="row1" width="22%"><b class="genmed">{L_MESSAGE}{L_COLON} </b><br /><span class="gensmall">{L_EDIT_DRAFT_EXPLAIN}</span></td>
- <td class="row2">
- <script type="text/javascript">
- // <![CDATA[
- var form_name = 'ucp';
- var text_name = 'message';
- // ]]>
- </script>
- <table cellspacing="0" cellpadding="2" border="0">
- <!-- INCLUDE posting_buttons.html -->
- <tr>
- <td colspan="9"><textarea class="post" name="message" rows="10" cols="70" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onfocus="initInsertions();">{DRAFT_MESSAGE}</textarea></td>
- </tr>
- <tr>
- <td colspan="9">
- <table cellspacing="0" cellpadding="0" border="0" width="100%">
- <tr>
- <td align="{S_CONTENT_FLOW_BEGIN}" id="color_palette_placeholder" data-orientation="h" data-width="11" data-height="10" data-bbcode="true">
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr class="row1">
- <td colspan="9" align="{S_CONTENT_FLOW_BEGIN}"><p class="topictitle"><a href="{S_UCP_ACTION}">{L_BACK_TO_DRAFTS}</a></p></td>
- </tr>
- <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>
-<!-- ENDIF -->
-</table>
-
-<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_main_front.html b/phpBB/styles/subsilver2/template/ucp_main_front.html
deleted file mode 100644
index 7fc906a126..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_main_front.html
+++ /dev/null
@@ -1,74 +0,0 @@
-<!-- INCLUDE ucp_header.html -->
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th colspan="3">{L_UCP}</th>
-</tr>
-<tr>
- <td class="row1" colspan="3" align="center"><p class="genmed">{L_UCP_WELCOME}</p></td>
-</tr>
-<tr>
- <th colspan="3">{L_IMPORTANT_NEWS}</th>
-</tr>
-
-<!-- BEGIN topicrow -->
-
- <!-- IF topicrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <td class="row1" width="25" align="center">{topicrow.TOPIC_FOLDER_IMG}</td>
- <td class="row1" width="100%">
- <p class="topictitle"><!-- IF topicrow.S_UNREAD --><a href="{topicrow.U_NEWEST_POST}">{NEWEST_POST_IMG}</a> <!-- ENDIF -->{topicrow.ATTACH_ICON_IMG} <a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a></p><p class="gensmall">{topicrow.GOTO_PAGE}</p>
- </td>
- <td class="row1" width="120" align="center" nowrap="nowrap">
- <p class="topicdetails">{topicrow.LAST_POST_TIME}</p>
- <p class="topicdetails">{topicrow.LAST_POST_AUTHOR_FULL}
- <a href="{topicrow.U_LAST_POST}">{LAST_POST_IMG}</a>
- </p>
- </td>
- </tr>
-<!-- BEGINELSE -->
- <tr class="row1">
- <td align="center" colspan="3"><b class="gen">{L_NO_IMPORTANT_NEWS}</b></td>
- </tr>
-<!-- END topicrow -->
-
-<tr>
- <th colspan="3">{L_YOUR_DETAILS}</th>
-</tr>
-<tr>
-<!-- EVENT ucp_main_front_user_activity_before -->
- <td class="row1" colspan="3">
- <table width="100%" cellspacing="1" cellpadding="4">
- <tr>
- <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="genmed">{L_JOINED}{L_COLON} </b></td>
- <td width="100%"><b class="gen">{JOINED}</b></td>
- </tr>
- <tr>
- <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="genmed">{L_TOTAL_POSTS}{L_COLON} </b></td>
- <td><!-- IF POSTS_PCT --><b class="gen">{POSTS}</b><br /><span class="genmed">[{POSTS_PCT} / {POSTS_DAY}]<!-- IF S_DISPLAY_SEARCH --><br /><a href="{U_SEARCH_SELF}">{L_SEARCH_YOUR_POSTS}</a><!-- ENDIF --></span><!-- ELSE --><b class="gen">{POSTS}<b><!-- ENDIF --></td>
- </tr>
- <!-- IF S_SHOW_ACTIVITY -->
- <tr>
- <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="genmed">{L_ACTIVE_IN_FORUM}{L_COLON} </b></td>
- <td><!-- IF ACTIVE_FORUM != '' --><b><a class="gen" href="{U_ACTIVE_FORUM}">{ACTIVE_FORUM}</a></b><br /><span class="genmed">[ {ACTIVE_FORUM_POSTS} / {ACTIVE_FORUM_PCT} ]</span><!-- ELSE --><span class="gen">-</span><!-- ENDIF --></td>
- </tr>
- <tr>
- <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><b class="genmed">{L_ACTIVE_IN_TOPIC}{L_COLON} </b></td>
- <td><!-- IF ACTIVE_TOPIC != '' --><b><a class="gen" href="{U_ACTIVE_TOPIC}">{ACTIVE_TOPIC}</a></b><br /><span class="genmed">[ {ACTIVE_TOPIC_POSTS} / {ACTIVE_TOPIC_PCT} ]</span><!-- ELSE --><span class="gen">-</span><!-- ENDIF --></td>
- </tr>
- <!-- ENDIF -->
- <!-- IF WARNINGS -->
- <tr>
- <td align="{S_CONTENT_FLOW_END}" valign="middle" nowrap="nowrap"><b class="genmed">{L_YOUR_WARNINGS}{L_COLON} </b></td>
- <td class="genmed">{WARNING_IMG} [ <b>{WARNINGS}</b> ]</td>
- </tr>
- <!-- ENDIF -->
- </table>
- </td>
-<!-- EVENT ucp_main_front_user_activity_after -->
-</tr>
-<tr>
- <td class="cat" colspan="3">&nbsp;</td>
-</tr>
-</table>
-
-<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_main_subscribed.html b/phpBB/styles/subsilver2/template/ucp_main_subscribed.html
deleted file mode 100644
index c6ae1b6cab..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_main_subscribed.html
+++ /dev/null
@@ -1,95 +0,0 @@
-<!-- INCLUDE ucp_header.html -->
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th colspan="4">{L_UCP}</th>
-</tr>
-<tr>
- <td class="row1" colspan="4" align="center"><span class="genmed">{L_WATCHED_EXPLAIN}</span></td>
-</tr>
-<!-- IF S_FORUM_NOTIFY -->
- <tr>
- <th colspan="4">{L_WATCHED_FORUMS}</th>
- </tr>
-
- <!-- BEGIN forumrow -->
-
- <!-- IF forumrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <td style="padding: 4px;" width="20" align="center" valign="middle">{forumrow.FORUM_FOLDER_IMG}</td>
- <td style="padding: 4px;" width="100%"><p class="topictitle"><a href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a></p></td>
- <td class="gensmall" style="padding: 4px;" align="center" valign="middle" nowrap="nowrap"><!-- IF forumrow.LAST_POST_TIME -->{forumrow.LAST_POST_TIME}<br />{forumrow.LAST_POST_AUTHOR_FULL} <a href="{forumrow.U_LAST_POST}" class="imageset">{LAST_POST_IMG}</a><!-- ELSE -->{L_NO_POSTS}<!-- ENDIF --></td>
- <td style="padding: 4px;"> <input type="checkbox" class="radio" name="f[{forumrow.FORUM_ID}]" /> </td>
- </tr>
- <!-- BEGINELSE -->
- <tr class="row1">
- <td colspan="4" align="center"><b class="genmed">{L_NO_WATCHED_FORUMS}</b></td>
- </tr>
- <!-- END forumrow -->
-<!-- ENDIF -->
-<!-- IF S_TOPIC_NOTIFY -->
- <tr>
- <th colspan="4">{L_WATCHED_TOPICS}</th>
- </tr>
-
- <!-- IF TOTAL_TOPICS -->
- <tr>
- <td class="row3" colspan="4">
- <table width="100%" cellspacing="1">
- <tr>
- <td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}<br /></td>
- <td class="gensmall" nowrap="nowrap">&nbsp;[ {TOTAL_TOPICS} ]&nbsp;</td>
- <td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- INCLUDE pagination.html --></td>
- </tr>
- </table>
- </td>
- </tr>
- <!-- ENDIF -->
-
- <!-- BEGIN topicrow -->
-
- <!-- IF topicrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <td style="padding: 4px;" width="20" align="center" valign="middle">{topicrow.TOPIC_FOLDER_IMG}</td>
- <td style="padding: 4px;" width="100%" valign="top">
- <p class="topictitle">
- <!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}" class="imageset">{NEWEST_POST_IMG}</a> <!-- ENDIF -->{topicrow.ATTACH_ICON_IMG}<a href="{topicrow.U_VIEW_TOPIC}">{topicrow.TOPIC_TITLE}</a>
- </p>
- <!-- IF topicrow.S_GLOBAL_TOPIC --><span class="gensmall">{L_GLOBAL_ANNOUNCEMENT}</span><!-- ELSE --><span class="gensmall"><b>{L_FORUM}{L_COLON} </b><a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a></span><!-- ENDIF -->
- <!-- IF .topicrow.pagination -->
- <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}{L_COLON}
- <!-- BEGIN pagination -->
- <!-- IF topicrow.pagination.S_IS_PREV -->
- <!-- ELSEIF topicrow.pagination.S_IS_CURRENT --><strong>{topicrow.pagination.PAGE_NUMBER}</strong>
- <!-- ELSEIF topicrow.pagination.S_IS_ELLIPSIS --> {L_ELLIPSIS}
- <!-- ELSEIF topicrow.pagination.S_IS_NEXT -->
- <!-- ELSE --><a href="{topicrow.pagination.PAGE_URL}">{topicrow.pagination.PAGE_NUMBER}</a>
- <!-- ENDIF -->
- <!-- END pagination -->
- ] </p>
- <!-- ENDIF -->
- </td>
- <td style="padding: 4px;" align="{S_CONTENT_FLOW_BEGIN}" valign="top" nowrap="nowrap">
- <p class="topicdetails">{topicrow.LAST_POST_TIME}</p>
- <p class="topicdetails">{topicrow.LAST_POST_AUTHOR_FULL}
- <a href="{topicrow.U_LAST_POST}" class="imageset">{LAST_POST_IMG}</a>
- </p>
- </td>
- <td style="padding: 4px;"> <input type="checkbox" class="radio" name="t[{topicrow.TOPIC_ID}]" /> </td>
- </tr>
- <!-- BEGINELSE -->
- <tr class="row1">
- <td colspan="4" align="center"><b class="genmed">{L_NO_WATCHED_TOPICS}</b></td>
- </tr>
- <!-- END topicrow -->
-<!-- ENDIF -->
-
-<!-- IF .topicrow or .forumrow -->
-<tr>
- <td class="cat" colspan="4" align="{S_CONTENT_FLOW_END}"><input class="btnlite" type="submit" name="unwatch" value="{L_UNWATCH_MARKED}" />&nbsp;</td>
-</tr>
-<!-- ENDIF -->
-</table>
-<!-- IF .topicrow or .forumrow -->
-<div class="gensmall" style="float: {S_CONTENT_FLOW_END}; padding-top: 2px;"><b><a href="#" onclick="marklist('ucp', 't', true); marklist('ucp', 'f', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('ucp', 't', false);marklist('ucp', 'f', false); return false;">{L_UNMARK_ALL}</a></b></div>
-<!-- ENDIF -->
-
-<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_notifications.html b/phpBB/styles/subsilver2/template/ucp_notifications.html
deleted file mode 100644
index b0d2925b68..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_notifications.html
+++ /dev/null
@@ -1,141 +0,0 @@
-<!-- INCLUDE ucp_header.html -->
-
-<form id="ucp" method="post" action="{S_UCP_ACTION}"{S_FORM_ENCTYPE}>
-
-<!-- IF MODE == 'notification_options' -->
- <table width="100%" cellspacing="1">
- <tr>
- <th colspan="{NOTIFICATION_TYPES_COLS}">{TITLE}</th>
- </tr>
- <tr>
- <td class="row1" colspan="{NOTIFICATION_TYPES_COLS}" align="center"><span class="genmed">{TITLE_EXPLAIN}</span></td>
- </tr>
- <tr>
- <th>{L_NOTIFICATION_TYPE}</th>
- <th width="10%">{L_NOTIFICATIONS}</th>
- <!-- BEGIN notification_methods -->
- <th width="10%">{notification_methods.NAME}</th>
- <!-- END notification_methods -->
- </tr>
-
- <!-- BEGIN notification_types -->
- <!-- IF notification_types.GROUP_NAME -->
- <tr>
- <td class="row3" colspan="{NOTIFICATION_TYPES_COLS}">{notification_types.GROUP_NAME}</td>
- </tr>
- <!-- ELSE -->
- <!-- IF notification_types.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <td>
- {notification_types.NAME}
- <!-- IF notification_types.EXPLAIN --><br />&nbsp; &nbsp;{notification_types.EXPLAIN}<!-- ENDIF -->
- </td>
- <td align="center"><input type="checkbox" name="{notification_types.TYPE}_notification"<!-- IF notification_types.SUBSCRIBED --> checked="checked"<!-- ENDIF --> /></td>
- <!-- BEGIN notification_methods -->
- <td align="center"><input type="checkbox" name="{notification_types.TYPE}_{notification_methods.METHOD}"<!-- IF notification_methods.SUBSCRIBED --> checked="checked"<!-- ENDIF --> /></td>
- <!-- END notification_methods -->
- </tr>
- <!-- ENDIF -->
- <!-- END notification_types -->
- <tr>
- <td class="cat" colspan="{NOTIFICATION_TYPES_COLS}" align="center">
- <input type="hidden" name="form_time" value="{FORM_TIME}" />
- {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" />
- {S_FORM_TOKEN}
- </td>
- </tr>
- </table>
-<!-- ELSE -->
- <table class="tablebg" width="100%" cellspacing="1" cellpadding="0">
- <tr>
- <td class="row1">
- <table border="0" cellspacing="0" cellpadding="0" width="100%">
- <tr>
- <td align="{S_CONTENT_FLOW_BEGIN}">
- <!-- IF TOTAL_COUNT -->
- <table width="100%" cellspacing="1">
- <tr>
- <td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}</td>
- <td class="gensmall" nowrap="nowrap" width="100%">&nbsp;{L_NOTIFICATIONS} [ <b>{TOTAL_COUNT}</b> ]&nbsp;</td>
- </tr>
- </table>
- <!-- ENDIF -->
- </td>
- <td align="{S_CONTENT_FLOW_END}"><!-- INCLUDE pagination.html --></td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
-
- <div class="notification_list">
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <td class="cat" colspan="3">
- <table width="100%" cellspacing="0">
- <tr class="nav">
- <td align="{S_CONTENT_FLOW_END}" valign="middle"><!-- IF U_MARK_ALL --><a href="{U_MARK_ALL}">{L_NOTIFICATIONS_MARK_ALL_READ}</a><!-- ENDIF --></td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <th colspan="2">{L_NOTIFICATIONS}</th>
- <th width="15%">{L_MARK_READ}</th>
- </tr>
- <!-- BEGIN notification_list -->
- <tr class="row<!-- IF notification_list.UNREAD -->3<!-- ELSEIF notification_list.S_ROW_COUNT is even -->1<!-- ELSE -->2<!-- ENDIF -->">
- <td width="50">
- <!-- IF notification_list.AVATAR -->{notification_list.AVATAR}<!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" alt="" /><!-- ENDIF -->
- </td>
- <td valign="top">
- <span class="gen">
- <!-- IF notification_list.URL --><a href="<!-- IF notification_list.UNREAD -->{notification_list.U_MARK_READ}<!-- ELSE -->{notification_list.URL}<!-- ENDIF -->"><!-- ENDIF -->
- {notification_list.FORMATTED_TITLE}<!-- IF notification_list.REFERENCE --> {notification_list.REFERENCE}<!-- ENDIF -->
- <!-- IF notification_list.URL --></a><!-- ENDIF --><br />
- <!-- IF notification_list.FORUM --><span class="notifications_forum">{notification_list.FORUM}</span><br /><!-- ENDIF -->
- <!-- IF notification_list.REASON --><span class="notifications_reason">{notification_list.REASON}</span><br /><!-- ENDIF -->
- <span class="notifications_time">{notification_list.TIME}</span>
- </span>
- </td>
- <td align="center">
- <input type="checkbox" name="mark[]" value="{notification_list.NOTIFICATION_ID}"<!-- IF not notification_list.UNREAD --> disabled="disabled"<!-- ENDIF --> />
- </td>
- </tr>
- <!-- END notification_list -->
- <tr>
- <td class="cat" colspan="3" align="center">
- <input type="hidden" name="form_time" value="{FORM_TIME}" />
- {S_HIDDEN_FIELDS}
- <input class="btnmain" type="submit" name="submit" value="{L_MARK_READ}" />
- {S_FORM_TOKEN}
- </td>
- </tr>
- </table>
- </div>
-
- <!-- IF .pagination -->
- <table class="tablebg" width="100%" cellspacing="1" cellpadding="0">
- <tr>
- <td class="row1">
- <table border="0" cellspacing="0" cellpadding="0" width="100%">
- <tr>
- <td align="{S_CONTENT_FLOW_BEGIN}">
- <!-- INCLUDE pagination.html -->
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <!-- ENDIF -->
-<!-- ENDIF -->
-
-<!-- IF .notifications -->
-<div class="gensmall" style="float: {S_CONTENT_FLOW_END}; padding-top: 2px;"><b><a href="#" onclick="$('#ucp input:checkbox').prop('checked', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="$('#ucp input:checkbox').prop('checked', false); return false;">{L_UNMARK_ALL}</a></b></div>
-<!-- ENDIF -->
-
-</form>
-
-<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_pm_history.html b/phpBB/styles/subsilver2/template/ucp_pm_history.html
deleted file mode 100644
index b478431fa5..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_pm_history.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!-- EVENT ucp_pm_history_review_before -->
-<script type="text/javascript">
-// <![CDATA[
- bbcodeEnabled = {S_BBCODE_ALLOWED};
-// ]]>
-</script>
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th align="center">{L_MESSAGE_HISTORY}</th>
-</tr>
-<tr>
- <td class="row1"><div style="overflow: auto; width: 100%; height: 300px;">
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th width="22%">{L_AUTHOR}</th>
- <th>{L_MESSAGE}</th>
- </tr>
- <!-- BEGIN history_row -->
- <!-- IF history_row.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <td rowspan="2" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><a name="{history_row.MSG_ID}" class="anchor"></a>
- <table width="150" cellspacing="0">
- <tr>
- <td align="center" colspan="2"><span class="postauthor">{history_row.MESSAGE_AUTHOR_FULL}</span></td>
- </tr>
- </table>
- </td>
- <td width="100%"<!-- IF history_row.S_CURRENT_MSG --> class="current"<!-- ENDIF -->>
- <div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};"><b>{L_PM_SUBJECT}{L_COLON}</b>&nbsp;{history_row.SUBJECT}</div><div class="gensmall" style="float: {S_CONTENT_FLOW_END};"><b>{L_FOLDER}{L_COLON}</b>&nbsp;{history_row.FOLDER}</div>
- </td>
- </tr>
-
- <!-- IF history_row.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <td valign="top">
- <table width="100%" cellspacing="0">
- <tr>
- <td valign="top">
- <table width="100%" cellspacing="0" cellpadding="2">
- <tr>
- <td><div class="postbody"><!-- IF history_row.MESSAGE -->{history_row.MESSAGE}<!-- ELSE --><span class="error">{L_MESSAGE_REMOVED_FROM_OUTBOX}</span><!-- ENDIF --></div><div id="message_{history_row.MSG_ID}" style="display: none;">{history_row.DECODED_MESSAGE}</div></td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td>
- <table width="100%" cellspacing="0">
- <tr valign="middle">
- <td width="100%">&nbsp;</td>
- <td width="10" nowrap="nowrap">{history_row.MINI_POST_IMG}</td>
- <td class="gensmall" nowrap="nowrap"><b>{L_SENT_AT}{L_COLON}</b> {history_row.SENT_DATE}</td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
-
- <!-- IF history_row.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
- <td class="gensmall"><a href="{history_row.U_VIEW_MESSAGE}">{L_VIEW_PM}</a></td>
- <td>
- <div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};">
- &nbsp;<!-- IF history_row.U_PROFILE --><a href="{history_row.U_PROFILE}" class="imageset">{PROFILE_IMG}</a> <!-- ENDIF -->
- <!-- IF history_row.U_EMAIL --><a href="{history_row.U_EMAIL}" class="imageset">{EMAIL_IMG}</a> <!-- ENDIF -->&nbsp;
- </div>
- <div class="gensmall" style="float: {S_CONTENT_FLOW_END};">
- <!-- EVENT ucp_pm_history_post_buttons_before -->
- <!-- IF history_row.U_QUOTE or history_row.MESSAGE_AUTHOR_QUOTE --> <a <!-- IF history_row.U_QUOTE -->href="{history_row.U_QUOTE}"<!-- ELSE -->href="#" onclick="addquote({history_row.MSG_ID}, '{history_row.MESSAGE_AUTHOR_QUOTE}', '{LA_WROTE}'); return false;"<!-- ENDIF --> class="imageset">{QUOTE_IMG}</a> <!-- ENDIF -->
- <!-- IF history_row.U_POST_REPLY_PM --><a href="{history_row.U_POST_REPLY_PM}" class="imageset">{REPLY_IMG}</a><!-- ENDIF -->&nbsp;
- <!-- EVENT ucp_pm_history_post_buttons_after -->
- </div>
- </td>
- </tr>
- <tr>
- <td class="spacer" colspan="2"><img src="images/spacer.gif" alt="" width="1" height="1" /></td>
- </tr>
- <!-- END history_row -->
- </table>
- </div></td>
-</tr>
-</table>
-<!-- EVENT ucp_pm_history_review_after -->
-
-<br clear="all" />
diff --git a/phpBB/styles/subsilver2/template/ucp_pm_message_footer.html b/phpBB/styles/subsilver2/template/ucp_pm_message_footer.html
deleted file mode 100644
index 20c5c7fe9f..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_pm_message_footer.html
+++ /dev/null
@@ -1,47 +0,0 @@
-
-<!-- IF not S_VIEW_MESSAGE -->
- {S_FORM_TOKEN}
- </form>
-<!-- ENDIF -->
-
-<table class="tablebg" width="100%" cellspacing="1" cellpadding="0">
-<tr>
- <td class="row1">
- <table border="0" cellspacing="0" cellpadding="0" width="100%">
- <tr>
- <td align="{S_CONTENT_FLOW_BEGIN}"><!-- INCLUDE pagination.html -->
- <!-- IF S_VIEW_MESSAGE -->
- <span class="gensmall">
- <!-- IF U_PRINT_PM --><a href="{U_PRINT_PM}" title="{L_PRINT_PM}">{L_PRINT_PM}</a><!-- IF U_FORWARD_PM --> | <!-- ENDIF --><!-- ENDIF -->
- <!-- IF U_FORWARD_PM --><a href="{U_FORWARD_PM}" title="{L_FORWARD_PM}">{L_FORWARD_PM}</a><!-- ENDIF -->
- <!-- IF U_POST_REPLY_PM and S_PM_RECIPIENTS gt 1 --><!-- IF U_PRINT_PM or U_FORWARD_PM --> | <!-- ENDIF --><a title="{L_REPLY_TO_ALL}" href="{U_POST_REPLY_ALL}">{L_REPLY_TO_ALL}</a><!-- ENDIF -->
- </span>
- <!-- ENDIF -->
- </td>
- <td align="{S_CONTENT_FLOW_END}" nowrap="nowrap">
- <!-- IF S_VIEW_MESSAGE -->
- <!-- IF not S_SPECIAL_FOLDER -->
- <form name="movepm" method="post" action="{S_PM_ACTION}" style="margin:0px">
- <input type="hidden" name="marked_msg_id[]" value="{MSG_ID}" />
- <input type="hidden" name="cur_folder_id" value="{CUR_FOLDER_ID}" />
- <input type="hidden" name="p" value="{MSG_ID}" />
- <select name="dest_folder">{S_TO_FOLDER_OPTIONS}</select>&nbsp;<input class="btnlite" type="submit" name="move_pm" value="{L_MOVE_TO_FOLDER}" />
- {S_FORM_TOKEN}
- </form>
- <!-- ENDIF -->
- <!-- ELSE -->
- <form name="sortmsg" method="post" action="{S_PM_ACTION}" style="margin:0px">
- <span class="gensmall">{L_DISPLAY_MESSAGES}{L_COLON}</span> {S_SELECT_SORT_DAYS} <span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR} <input class="btnlite" type="submit" name="sort" value="{L_GO}" />
- {S_FORM_TOKEN}
- </form>
- <!-- ENDIF -->
- </td>
- </tr>
- </table>
- </td>
-</tr>
-</table>
-
-<!-- IF not S_VIEW_MESSAGE -->
- <div style="float: {S_CONTENT_FLOW_END};"><b class="gensmall"><a href="#" onclick="marklist('viewfolder', 'marked_msg_id', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('viewfolder', 'marked_msg_id', false); return false;">{L_UNMARK_ALL}</a></b></div>
-<!-- ENDIF -->
diff --git a/phpBB/styles/subsilver2/template/ucp_pm_message_header.html b/phpBB/styles/subsilver2/template/ucp_pm_message_header.html
deleted file mode 100644
index 370fa673dd..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_pm_message_header.html
+++ /dev/null
@@ -1,34 +0,0 @@
-
-<table class="tablebg" width="100%" cellspacing="1" cellpadding="0">
-<tr>
- <td class="row1">
- <table border="0" cellspacing="0" cellpadding="0" width="100%">
- <tr>
- <td align="{S_CONTENT_FLOW_BEGIN}">
- <!-- IF TOTAL_MESSAGES -->
- <table width="100%" cellspacing="1">
- <tr>
- <td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}<br /></td>
- <!-- IF FOLDER_MAX_MESSAGES neq 0 -->
- <td class="gensmall" nowrap="nowrap" width="100%">&nbsp;[ <b>{FOLDER_CUR_MESSAGES}</b>/{FOLDER_MAX_MESSAGES} {L_MESSAGES} ({FOLDER_PERCENT}%) ]&nbsp;</td>
- <!-- ELSE -->
- <td class="gensmall" nowrap="nowrap" width="100%">&nbsp;[ <b>{FOLDER_CUR_MESSAGES}</b> {L_MESSAGES} ]&nbsp;</td>
- <!-- ENDIF -->
- </tr>
- </table>
- <!-- ENDIF -->
-
- <!-- IF S_VIEW_MESSAGE -->
- <span class="gensmall">
- <!-- IF S_DISPLAY_HISTORY -->
- <!-- IF U_VIEW_PREVIOUS_HISTORY --><a href="{U_VIEW_PREVIOUS_HISTORY}">{L_VIEW_PREVIOUS_HISTORY}</a> | <!-- ENDIF --><!-- IF U_VIEW_NEXT_HISTORY --><a href="{U_VIEW_NEXT_HISTORY}">{L_VIEW_NEXT_HISTORY}</a> | <!-- ENDIF -->
- <!-- ENDIF --><a href="{U_PREVIOUS_PM}">{L_VIEW_PREVIOUS_PM}</a> | <a href="{U_NEXT_PM}">{L_VIEW_NEXT_PM}</a>&nbsp;
- </span>
- <!-- ENDIF -->
- </td>
- <td align="{S_CONTENT_FLOW_END}"><!-- INCLUDE pagination.html --></td>
- </tr>
- </table>
- </td>
-</tr>
-</table>
diff --git a/phpBB/styles/subsilver2/template/ucp_pm_options.html b/phpBB/styles/subsilver2/template/ucp_pm_options.html
deleted file mode 100644
index beb867c75a..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_pm_options.html
+++ /dev/null
@@ -1,192 +0,0 @@
-<!-- INCLUDE ucp_header.html -->
-
-<!-- IF ERROR_MESSAGE or NOTIFICATION_MESSAGE -->
- <table border="0" cellspacing="0" cellpadding="0" width="100%">
- <tr>
- <td class="row3" align="center">
- <!-- IF ERROR_MESSAGE --><span class="genmed error">{ERROR_MESSAGE}</span><!-- ENDIF -->
- <!-- IF NOTIFICATION_MESSAGE --><span class="genmed error">{NOTIFICATION_MESSAGE}</span><!-- ENDIF -->
- </td>
- </tr>
- </table>
- <div style="padding: 2px;"></div>
-<!-- ENDIF -->
-
-<form name="ucp" method="post" action="{S_UCP_ACTION}">
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th colspan="3">{L_ADD_NEW_RULE}</th>
-</tr>
-<!-- IF S_CHECK_DEFINED -->
- <tr>
- <td class="row1" width="50" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><b class="gen">{L_IF}{L_COLON}</b></td>
- <td class="row2" align="center" valign="top"><!-- IF S_CHECK_SELECT --><select name="check_option">{S_CHECK_OPTIONS}</select><!-- ELSE --><b class="gen">{CHECK_CURRENT}</b><input type="hidden" name="check_option" value="{CHECK_OPTION}" /><!-- ENDIF --></td>
- <td class="row1" width="50" align="{S_CONTENT_FLOW_END}" valign="top"><!-- IF S_CHECK_SELECT --><input type="submit" name="next" value="{L_NEXT_STEP}" class="btnlite" /><!-- ELSE -->&nbsp;<!-- ENDIF --></td>
- </tr>
-<!-- ENDIF -->
-<!-- IF S_RULE_DEFINED -->
- <tr>
- <td class="row1" width="50" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><!-- IF S_RULE_SELECT --><input type="submit" name="back[rule]" value="{L_PREVIOUS_STEP}" class="btnlite" /><!-- ELSE -->&nbsp;<!-- ENDIF --></td>
- <td class="row2" align="center" valign="top"><!-- IF S_RULE_SELECT --><select name="rule_option">{S_RULE_OPTIONS}</select><!-- ELSE --><b class="gen">{RULE_CURRENT}</b><input type="hidden" name="rule_option" value="{RULE_OPTION}" /><!-- ENDIF --></td>
- <td class="row1" width="50" align="{S_CONTENT_FLOW_END}" valign="top"><!-- IF S_RULE_SELECT --><input type="submit" name="next" value="{L_NEXT_STEP}" class="btnlite" /><!-- ELSE -->&nbsp;<!-- ENDIF --></td>
- </tr>
-<!-- ENDIF -->
-
-<!-- IF S_COND_DEFINED -->
- <!-- IF S_COND_SELECT or COND_CURRENT -->
- <tr>
- <td class="row1" width="50" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><!-- IF S_COND_SELECT --><input type="submit" name="back[cond]" value="{L_PREVIOUS_STEP}" class="btnlite" /><!-- ELSE -->&nbsp;<!-- ENDIF --></td>
- <td class="row2" align="center" valign="top">
- <!-- IF S_COND_SELECT -->
- <!-- IF S_TEXT_CONDITION -->
- <input type="text" name="rule_string" value="{CURRENT_STRING}" size="30" maxlength="250" class="post" />
- <!-- ELSEIF S_USER_CONDITION -->
- <input type="text" class="post" name="rule_string" value="{CURRENT_STRING}" size="20" />&nbsp;<span class="gensmall">[ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</span>
- <!-- ELSEIF S_GROUP_CONDITION -->
- <input type="hidden" name="rule_string" value="{CURRENT_STRING}" /><!-- IF S_GROUP_OPTIONS --><select name="rule_group_id">{S_GROUP_OPTIONS}</select><!-- ELSE -->{L_NO_GROUPS}<!-- ENDIF -->
- <!-- ENDIF -->
- <!-- ELSE -->
- <b class="gen">{COND_CURRENT}</b>
- <input type="hidden" name="rule_string" value="{CURRENT_STRING}" /><input type="hidden" name="rule_user_id" value="{CURRENT_USER_ID}" /><input type="hidden" name="rule_group_id" value="{CURRENT_GROUP_ID}" />
- <!-- ENDIF -->
- </td>
- <td class="row1" width="50" align="{S_CONTENT_FLOW_END}" valign="top"><!-- IF S_COND_SELECT --><input type="submit" name="next" value="{L_NEXT_STEP}" class="btnlite" /><!-- ELSE -->&nbsp;<!-- ENDIF --></td>
- </tr>
- <!-- ENDIF -->
- <input type="hidden" name="cond_option" value="{COND_OPTION}" />
-<!-- ENDIF -->
-
-<!-- IF NONE_CONDITION --><input type="hidden" name="cond_option" value="none" /><!-- ENDIF -->
-
-<!-- IF S_ACTION_DEFINED -->
- <tr>
- <td class="row1" width="50" align="{S_CONTENT_FLOW_BEGIN}" valign="top"><!-- IF S_ACTION_SELECT --><input type="submit" name="back[action]" value="{L_PREVIOUS_STEP}" class="btnlite" /><!-- ELSE -->&nbsp;<!-- ENDIF --></td>
- <td class="row2" align="center" valign="top"><!-- IF S_ACTION_SELECT --><select name="action_option">{S_ACTION_OPTIONS}</select><!-- ELSE --><b class="gen">{ACTION_CURRENT}</b><input type="hidden" name="action_option" value="{ACTION_OPTION}" /><!-- ENDIF --></td>
- <td class="row1" width="50" align="{S_CONTENT_FLOW_END}" valign="top"><!-- IF S_ACTION_SELECT --><input type="submit" name="add_rule" value="{L_ADD_RULE}" class="btnlite" /><!-- ELSE -->&nbsp;<!-- ENDIF --></td>
- </tr>
-<!-- ENDIF -->
-</table>
-
-<div style="padding: 2px;"></div>
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th colspan="6">{L_DEFINED_RULES}</th>
-</tr>
-<!-- BEGIN rule -->
- <tr>
- <td class="row1" width="25" align="center"><span class="gen">#{rule.COUNT}</span></td>
- <td class="row2" width="120"><span class="gen"><strong>{L_IF}</strong> {rule.CHECK}</span></td>
- <td class="row1" width="120"><span class="gen">{rule.RULE}</span></td>
- <td class="row2" width="120"><span class="gen"><!-- IF rule.STRING -->{rule.STRING}<!-- ENDIF --></span></td>
- <td class="row1"><span class="gen">{rule.ACTION}<!-- IF rule.FOLDER --> -&gt; {rule.FOLDER}<!-- ENDIF --></span></td>
- <td class="row2" width="25"><input type="submit" name="delete_rule[{rule.RULE_ID}]" value="{L_DELETE_RULE}" class="btnlite" /></td>
- </tr>
-<!-- BEGINELSE -->
- <tr>
- <td colspan="6" class="row3" align="center"><span class="gen">{L_NO_RULES_DEFINED}</span></td>
- </tr>
-<!-- END rule -->
-</table>
-
-<div style="padding: 2px;"></div>
-
-<!-- IF S_FOLDER_OPTIONS -->
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th colspan="2">{L_RENAME_FOLDER}</th>
- </tr>
- <tr>
- <td class="row1" width="200"><b class="gen">{L_RENAME_FOLDER}{L_COLON} </b></td>
- <td class="row1"><select name="rename_folder_id">{S_FOLDER_OPTIONS}</select></td>
- </tr>
- <tr>
- <td class="row1" width="200"><b class="gen">{L_NEW_FOLDER_NAME}{L_COLON} </b></td>
- <td class="row1"><input type="text" class="post" name="new_folder_name" size="30" maxlength="30" /></td>
- </tr>
- <tr>
- <td class="row1" align="{S_CONTENT_FLOW_END}" colspan="2"><input class="btnlite" style="width:150px" type="submit" name="rename_folder" value="{L_RENAME}" /></td>
- </tr>
- </table>
-
- <div style="padding: 2px;"></div>
-<!-- ENDIF -->
-
-<!-- IF not S_MAX_FOLDER_ZERO -->
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th colspan="2">{L_ADD_FOLDER}</th>
-</tr>
-<!-- IF S_MAX_FOLDER_REACHED -->
- <tr>
- <td colspan="2">{L_MAX_FOLDER_REACHED}</td>
- </tr>
-<!-- ELSE -->
- <tr>
- <td class="row1" width="200"><b class="gen">{L_ADD_FOLDER}{L_COLON} </b></td>
- <td class="row1"><input type="text" class="post" name="foldername" size="30" maxlength="30" /></td>
- </tr>
- <tr>
- <td class="row1" align="{S_CONTENT_FLOW_END}" colspan="2"><input class="btnlite" style="width:150px" type="submit" name="addfolder" value="{L_ADD}" /></td>
- </tr>
-<!-- ENDIF -->
-</table>
-<!-- ENDIF -->
-
-<div style="padding: 2px;"></div>
-
-<!-- IF S_FOLDER_OPTIONS -->
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <th colspan="3">{L_REMOVE_FOLDER}</th>
- </tr>
- <tr>
- <td class="row1" width="200"><b class="gen">{L_REMOVE_FOLDER}{L_COLON} </b></td>
- <td class="row1"><select name="remove_folder_id">{S_FOLDER_OPTIONS}</select></td>
- <td class="row1"><b class="genmed">{L_AND}</b></td>
- </tr>
- <tr>
- <td class="row2" width="200">&nbsp;</td>
- <td class="row2" colspan="2"><input type="radio" class="radio" name="remove_action" value="1" checked="checked" />&nbsp;<span class="genmed">{L_MOVE_DELETED_MESSAGES_TO} </span>&nbsp;<select name="move_to">{S_TO_FOLDER_OPTIONS}</select></td>
- </tr>
- <tr>
- <td class="row2" width="200">&nbsp;</td>
- <td class="row2" colspan="2"><input type="radio" class="radio" name="remove_action" value="2" />&nbsp;<span class="genmed">{L_DELETE_MESSAGES_IN_FOLDER}</span></td>
- </tr>
- <tr>
- <td class="row2" width="200">&nbsp;</td>
- <td class="row2" colspan="2" align="{S_CONTENT_FLOW_END}"><input class="btnlite" style="width:150px" type="submit" name="remove_folder" value="{L_REMOVE}" /></td>
- </tr>
- </table>
-
- <div style="padding: 2px;"></div>
-<!-- ENDIF -->
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th colspan="2">{L_FOLDER_OPTIONS}</th>
-</tr>
-<tr>
- <td class="row1" width="200"><span><b class="genmed">{L_IF_FOLDER_FULL}{L_COLON} </b></span></td>
- <td class="row1"><input type="radio" class="radio" name="full_action" value="1"{S_DELETE_CHECKED} />&nbsp;<span class="genmed">{L_DELETE_OLDEST_MESSAGES}</span></td>
-</tr>
-<tr>
- <td class="row1" width="200">&nbsp;</td>
- <td class="row1"><input type="radio" class="radio" name="full_action" value="2"{S_MOVE_CHECKED} />&nbsp;<span class="genmed">{L_MOVE_TO_FOLDER}{L_COLON} </span><select name="full_move_to">{S_FULL_FOLDER_OPTIONS}</select></td>
-</tr>
-<tr>
- <td class="row1" width="200">&nbsp;</td>
- <td class="row1"><input type="radio" class="radio" name="full_action" value="3"{S_HOLD_CHECKED} />&nbsp;<span class="genmed">{L_HOLD_NEW_MESSAGES}</span></td>
-</tr>
-<tr>
- <td class="row2" width="200"><b class="genmed">{L_DEFAULT_ACTION}{L_COLON} </b><br /><span class="gensmall">{L_DEFAULT_ACTION_EXPLAIN}</span></td>
- <td class="row2"><span class="genmed">{DEFAULT_ACTION}</span></td>
-</tr>
-<tr>
- <td class="row1" colspan="2" align="{S_CONTENT_FLOW_END}"><input class="btnlite" style="width:150px" type="submit" name="fullfolder" value="{L_CHANGE}" /></td>
-</tr>
-</table>
-{S_FORM_TOKEN}
-</form>
-<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_pm_viewfolder.html b/phpBB/styles/subsilver2/template/ucp_pm_viewfolder.html
deleted file mode 100644
index 6ab32df255..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_pm_viewfolder.html
+++ /dev/null
@@ -1,131 +0,0 @@
-<!-- INCLUDE ucp_header.html -->
-
-<div id="pagecontent">
-
-<!-- IF not PROMPT -->
- <!-- INCLUDE ucp_pm_message_header.html -->
-<!-- ENDIF -->
-
-<div style="padding: 2px;"></div>
-
-<!-- IF S_PM_ICONS -->
- <!-- DEFINE $COLSPAN = 6 -->
-<!-- ELSE -->
- <!-- DEFINE $COLSPAN = 5 -->
-<!-- ENDIF -->
-
-<form name="viewfolder" method="post" action="{S_PM_ACTION}" style="margin:0px">
-
-<!-- IF PROMPT -->
- <table class="tablebg" width="100%" cellspacing="1" cellpadding="0" border="0">
- <tr>
- <th colspan="2" valign="middle">{L_OPTIONS}</th>
- </tr>
- <tr>
- <td class="row1" width="35%">{L_DELIMITER}{L_COLON} </td>
- <td class="row2"><input class="post" type="text" name="delimiter" value="," /></td>
- </tr>
- <tr>
- <td class="row1" width="35%">{L_ENCLOSURE}{L_COLON} </td>
- <td class="row2"><input class="post" type="text" name="enclosure" value="&#034;" /></td>
- </tr>
- <tr>
- <td class="cat" colspan="2" align="center"><input type="hidden" name="export_option" value="CSV" /><input class="btnmain" type="submit" name="submit_export" value="{L_EXPORT_FOLDER}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" name="reset" /></td>
- </tr>
- </table>
- {S_FORM_TOKEN}
-
-</form>
-<!-- ELSE -->
-
- <table class="tablebg" width="100%" cellspacing="1" cellpadding="0" border="0">
- <!-- IF NUM_NOT_MOVED or NUM_REMOVED -->
- <tr>
- <td class="row3" colspan="{$COLSPAN}" align="center"><span class="gen">
- <!-- IF NUM_REMOVED -->
- {RULE_REMOVED_MESSAGES}
- <!-- IF NUM_NOT_MOVED --><br /><!-- ENDIF -->
- <!-- ENDIF -->
- <!-- IF NUM_NOT_MOVED -->
- {NOT_MOVED_MESSAGES}<br />{RELEASE_MESSAGE_INFO}
- <!-- ENDIF -->
- </span></td>
- </tr>
- <!-- ENDIF -->
- <tr>
- <th colspan="<!-- IF S_PM_ICONS -->3<!-- ELSE -->2<!-- ENDIF -->">&nbsp;{L_SUBJECT}&nbsp;</th>
- <th>&nbsp;<!-- IF S_SHOW_RECIPIENTS -->{L_RECIPIENTS}<!-- ELSE -->{L_AUTHOR}<!-- ENDIF -->&nbsp;</th>
- <th>&nbsp;{L_SENT_AT}&nbsp;</th>
- <th>&nbsp;{L_MARK}&nbsp;</th>
- </tr>
-
- <!-- BEGIN messagerow -->
- <tr>
- <td class="row1" width="25" align="center" nowrap="nowrap">{messagerow.FOLDER_IMG}</td>
- <!-- IF S_PM_ICONS -->
- <td class="row1" width="25" align="center">{messagerow.PM_ICON_IMG}</td>
- <!-- ENDIF -->
-
- <!-- IF messagerow.S_PM_DELETED --><td class="row3"><!-- ELSE --><td class="row1"><!-- ENDIF -->
- <!-- IF not messagerow.PM_IMG and messagerow.PM_CLASS -->
- <span class="{messagerow.PM_CLASS}" style="float: {S_CONTENT_FLOW_BEGIN};"><img src="images/spacer.gif" width="10" height="10" alt="" /></span>&nbsp;
- <!-- ELSEIF messagerow.PM_IMG -->
- {messagerow.PM_IMG}&nbsp;
- <!-- ENDIF -->
-
- <span class="topictitle">
- {messagerow.ATTACH_ICON_IMG}
- <!-- IF messagerow.S_PM_DELETED -->
- {L_MESSAGE_REMOVED_FROM_OUTBOX}<br />
- <a href="{messagerow.U_REMOVE_PM}" style="float: {S_CONTENT_FLOW_END};">{L_DELETE_MESSAGE}</a>
- <!-- ELSE -->
- <a href="{messagerow.U_VIEW_PM}">{messagerow.SUBJECT}</a>
- <!-- ENDIF -->
- <!-- IF messagerow.S_PM_REPORTED -->
- <a href="{messagerow.U_MCP_REPORT}" class="imageset">{REPORTED_IMG}</a>&nbsp;
- <!-- ENDIF -->
- <!-- IF messagerow.S_AUTHOR_DELETED -->
- <br /><em class="gensmall">{L_PM_FROM_REMOVED_AUTHOR}</em>
- <!-- ENDIF -->
- </span></td>
-
- <td class="row1" width="100" align="center"><p class="topicauthor"><!-- IF S_SHOW_RECIPIENTS -->{messagerow.RECIPIENTS}<!-- ELSE -->{messagerow.MESSAGE_AUTHOR_FULL}<!-- ENDIF --></p></td>
- <td class="row1" width="120" align="center"><p class="topicdetails">{messagerow.SENT_TIME}</p></td>
- <td class="row1" width="20" align="center"><p class="topicdetails"><input type="checkbox" class="radio" name="marked_msg_id[]" value="{messagerow.MESSAGE_ID}" /></p></td>
- </tr>
- <!-- BEGINELSE -->
- <tr>
- <td class="row1" colspan="{$COLSPAN}" height="30" align="center" valign="middle"><span class="gen">
- <!-- IF S_COMPOSE_PM_VIEW and S_NO_AUTH_SEND_MESSAGE -->
- <!-- IF S_USER_NEW -->{L_USER_NEW_PERMISSION_DISALLOWED}<!-- ELSE -->{L_NO_AUTH_SEND_MESSAGE}<!-- ENDIF -->
- <!-- ELSE -->
- {L_NO_MESSAGES}
- <!-- ENDIF -->
- </span></td>
- </tr>
- <!-- END messagerow -->
-</table>
-
-<input type="hidden" name="cur_folder_id" value="{CUR_FOLDER_ID}" />
-
-<table border="0" cellspacing="0" cellpadding="0" width="100%">
-<tr>
- <td class="cat">
-<!-- IF .messagerow -->
- <div style="float: {S_CONTENT_FLOW_BEGIN};"><select name="export_option"><option value="CSV">{L_EXPORT_AS_CSV}</option><option value="CSV_EXCEL">{L_EXPORT_AS_CSV_EXCEL}</option><option value="XML">{L_EXPORT_AS_XML}</option></select>&nbsp;<input class="btnlite" type="submit" name="submit_export" value="{L_EXPORT_FOLDER}" /></div>
- <div style="float: {S_CONTENT_FLOW_END};"><select name="mark_option">{S_MARK_OPTIONS}{S_MOVE_MARKED_OPTIONS}</select>&nbsp;<input class="btnlite" type="submit" name="submit_mark" value="{L_GO}" />&nbsp;</div>
-<!-- ENDIF -->
- </td>
-</tr>
-</table>
-
-<div style="padding: 2px;"></div>
-<!-- INCLUDE ucp_pm_message_footer.html -->
-
-<!-- ENDIF -->
-
-<br clear="all" />
-
-</div>
-
-<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_pm_viewmessage.html b/phpBB/styles/subsilver2/template/ucp_pm_viewmessage.html
deleted file mode 100644
index 9536b1f8c5..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_pm_viewmessage.html
+++ /dev/null
@@ -1,136 +0,0 @@
-<!-- INCLUDE ucp_header.html -->
-
-<div id="pagecontent">
-
-<!-- INCLUDE ucp_pm_message_header.html -->
-<div style="padding: 2px;"></div>
-
-<table class="tablebg" width="100%" cellspacing="1" cellpadding="4">
-
-<tr class="row1">
- <td class="genmed" nowrap="nowrap" width="150"><b>{L_PM_SUBJECT}{L_COLON}</b></td>
- <td class="gen">{SUBJECT}</td>
-</tr>
-
-<tr class="row1">
- <td class="genmed" nowrap="nowrap" width="150"><b>{L_PM_FROM}{L_COLON}</b></td>
- <td class="gen">{MESSAGE_AUTHOR_FULL}</td>
-</tr>
-
-<tr class="row1">
- <td class="genmed" nowrap="nowrap" width="150"><b>{L_SENT_AT}{L_COLON}</b></td>
- <td class="gen">{SENT_DATE}</td>
-</tr>
-
-<!-- IF S_TO_RECIPIENT -->
- <tr class="row1">
- <td class="genmed" nowrap="nowrap" width="150"><b>{L_TO}{L_COLON}</b></td>
- <td class="gen">
- <!-- BEGIN to_recipient -->
- <!-- IF to_recipient.IS_GROUP --><span class="sep"><a href="{to_recipient.U_VIEW}">{to_recipient.NAME}</a></span><!-- ELSE -->{to_recipient.NAME_FULL}&nbsp;<!-- ENDIF -->
- <!-- END to_recipient -->
- </td>
- </tr>
-<!-- ENDIF -->
-
-<!-- IF S_BCC_RECIPIENT -->
- <tr class="row1">
- <td class="genmed" nowrap="nowrap" width="150"><b>{L_BCC}{L_COLON}</b></td>
- <td class="gen">
- <!-- BEGIN bcc_recipient -->
- <!-- IF bcc_recipient.IS_GROUP --><span class="sep"><a href="{bcc_recipient.U_VIEW}">{bcc_recipient.NAME}</a></span><!-- ELSE -->{bcc_recipient.NAME_FULL}&nbsp;<!-- ENDIF -->
- <!-- END bcc_recipient -->
- </td>
- </tr>
-<!-- ENDIF -->
-</table>
-
-<div style="padding: 2px;"></div>
-
-<table class="tablebg" width="100%" cellspacing="1" cellpadding="0">
-
-<tr>
- <th nowrap="nowrap">{L_MESSAGE}</th>
-</tr>
-
-<tr>
- <td class="spacer" height="1"><img src="images/spacer.gif" alt="" width="1" height="1" /></td>
-</tr>
-
-<tr class="row1">
- <td valign="top">
- <table width="100%" cellspacing="5">
- <tr>
- <td>
- <div class="postbody">{MESSAGE}</div>
-
- <!-- IF S_HAS_ATTACHMENTS -->
- <br clear="all" /><br />
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <td class="row3"><b class="genmed">{L_ATTACHMENTS}{L_COLON} </b></td>
- </tr>
- <!-- BEGIN attachment -->
- <tr>
- <td class="row2">{attachment.DISPLAY_ATTACHMENT}</td>
- </tr>
- <!-- END attachment -->
- </table>
- <!-- ENDIF -->
-
- <!-- IF S_DISPLAY_NOTICE -->
- <span class="gensmall error"><br /><br />{L_DOWNLOAD_NOTICE}</span>
- <!-- ENDIF -->
- <!-- IF SIGNATURE -->
- <span class="postbody"><br />_________________<br />{SIGNATURE}</span>
- <!-- ENDIF -->
- <!-- IF EDITED_MESSAGE -->
- <span class="gensmall">{EDITED_MESSAGE}</span>
- <!-- ENDIF -->
-
- <!-- IF not S_HAS_ATTACHMENTS --><br clear="all" /><br /><!-- ENDIF -->
-
- <table width="100%" cellspacing="0">
- <tr valign="middle">
- <td class="gensmall" align="{S_CONTENT_FLOW_END}"> <!-- IF U_REPORT --><a href="{U_REPORT}" class="imageset">{REPORT_IMG}</a> <!-- ENDIF --><!-- IF U_DELETE --><a href="{U_DELETE}" class="imageset">{DELETE_IMG}</a> <!-- ENDIF --></td>
- </tr>
- </table>
-
- </td>
- </tr>
- </table>
- </td>
-</tr>
-
-<tr class="row1">
- <td>
- <div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};">
- &nbsp;<!-- IF U_MESSAGE_AUTHOR --><a href="{U_MESSAGE_AUTHOR}" class="imageset">{PROFILE_IMG}</a> <!-- ENDIF -->
- <!-- IF U_EMAIL --><a href="{U_EMAIL}" class="imageset">{EMAIL_IMG}</a> <!-- ENDIF -->
- &nbsp;</div>
- <div class="gensmall" style="float: {S_CONTENT_FLOW_END};">
- <!-- EVENT ucp_pm_viewmessage_post_buttons_before -->
- <!-- IF U_EDIT --><a href="{U_EDIT}" class="imageset">{EDIT_IMG}</a> <!-- ENDIF -->
- <!-- IF U_QUOTE --><a href="{U_QUOTE}" class="imageset">{QUOTE_IMG}</a> <!-- ENDIF -->
- <!-- IF U_POST_REPLY_PM --><a href="{U_POST_REPLY_PM}" class="imageset">{REPLY_IMG}</a><!-- ENDIF -->
- <!-- EVENT ucp_pm_viewmessage_post_buttons_after -->
- &nbsp;</div>
- </td>
-</tr>
-
-<tr>
- <td class="spacer" height="1"><img src="images/spacer.gif" alt="" width="1" height="1" /></td>
-</tr>
-</table>
-
-<div style="padding: 2px;"></div>
-<!-- INCLUDE ucp_pm_message_footer.html -->
-
-<br clear="all" />
-
-</div>
-
-<!-- IF S_DISPLAY_HISTORY --><!-- INCLUDE ucp_pm_history.html --><!-- ENDIF -->
-
-<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html b/phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html
deleted file mode 100644
index fd5e390d83..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_pm_viewmessage_print.html
+++ /dev/null
@@ -1,121 +0,0 @@
-<!DOCTYPE html>
-<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
-<head>
-<meta charset="utf-8" />
-<meta name="robots" content="noindex" />
-<title>{SITENAME} :: {PAGE_TITLE}</title>
-
-<style type="text/css">
-<!--
-
-body {
- font-family: Verdana,serif;
- font-size: 10pt;
-}
-
-td {
- font-family: Verdana,serif;
- font-size: 10pt;
- line-height: 150%;
-}
-
-.code,
-.quote {
- font-size: smaller;
- border: black solid 1px;
-}
-
-.forum {
- font-family: Arial,Helvetica,sans-serif;
- font-weight: bold;
- font-size: 18pt;
-}
-
-.topic {
- font-family: Arial,Helvetica,sans-serif;
- font-size: 14pt;
- font-weight: bold;
-}
-
-.gensmall {
- font-size: 8pt;
-}
-
-hr {
- color: #888;
- height: 3px;
- border-style: solid;
-}
-
-hr.sep {
- color: #aaa;
- height: 1px;
- border-style: dashed;
-}
-//-->
-</style>
-<!-- EVENT ucp_pm_viewmessage_print_head_append -->
-</head>
-<body>
-
-<table width="85%" cellspacing="3" cellpadding="0" border="0" align="center">
-<tr>
- <td colspan="2" align="center"><span class="Forum">{SITENAME}</span><br /><span class="gensmall">{L_PRIVATE_MESSAGING}</span></td>
-</tr>
-<tr>
- <td colspan="2"><br /></td>
-</tr>
-<tr>
- <td><span class="topic">{SUBJECT}</span><br /></td>
- <td align="{S_CONTENT_FLOW_END}" valign="bottom"><span class="gensmall">{PAGE_NUMBER}</span></td>
-</tr>
-</table>
-
-<hr width="85%" />
-
-<table width="85%" cellspacing="3" cellpadding="0" border="0" align="center">
-<tr>
- <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>
- <td>
- <!-- BEGIN to_recipient -->
- <span<!-- IF to_recipient.IS_GROUP --> class="sep"<!-- ENDIF -->>{to_recipient.NAME}</span>&nbsp;
- <!-- END to_recipient -->
- </td>
- </tr>
-<!-- ENDIF -->
-
-<!-- IF S_BCC_RECIPIENT -->
- <tr>
- <td width="10%" nowrap="nowrap">{L_BCC}{L_COLON}</td>
- <td>
- <!-- BEGIN bcc_recipient -->
- <!-- IF bcc_recipient.COLOUR --><span style="color:{bcc_recipient.COLOUR}"><!-- ELSE --><span<!-- IF bcc_recipient.IS_GROUP --> class="sep"<!-- ENDIF -->><!-- ENDIF -->{bcc_recipient.NAME}</span>&nbsp;
- <!-- END bcc_recipient -->
- </td>
- </tr>
-<!-- ENDIF -->
-<tr>
- <td colspan="2"><hr class="sep" />{MESSAGE}</td>
-</tr>
-</table>
-
-<hr width="85%" />
-
-<table width="85%" cellspacing="3" cellpadding="0" border="0" align="center">
-<tr>
- <td><span class="gensmall">{PAGE_NUMBER}</span></td>
- <td align="{S_CONTENT_FLOW_END}"><span class="gensmall">{S_TIMEZONE}</span></td>
-</tr>
-<tr>
- <td colspan="2" align="center"><span class="gensmall">Powered by phpBB&reg; Forum Software &copy; phpBB Limited<br />https://www.phpbb.com/</span></td>
-</tr>
-</table>
-
-</body>
-</html>
diff --git a/phpBB/styles/subsilver2/template/ucp_prefs_personal.html b/phpBB/styles/subsilver2/template/ucp_prefs_personal.html
deleted file mode 100644
index 1c76e3226d..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_prefs_personal.html
+++ /dev/null
@@ -1,71 +0,0 @@
-<!-- INCLUDE ucp_header.html -->
-
-<script type="text/javascript">
-// <![CDATA[
- var default_dateformat = '{A_DEFAULT_DATEFORMAT}';
-// ]]>
-</script>
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th colspan="2" valign="middle">{L_TITLE}</th>
-</tr>
-<!-- IF ERROR -->
- <tr>
- <td class="row3" colspan="2" align="center"><span class="gensmall error">{ERROR}</span></td>
- </tr>
-<!-- ENDIF -->
-<!-- EVENT ucp_prefs_personal_prepend -->
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_SHOW_EMAIL}{L_COLON}</b></td>
- <td class="row2"><input type="radio" class="radio" name="viewemail" value="1"<!-- IF S_VIEW_EMAIL --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_YES}</span>&nbsp;&nbsp;<input type="radio" class="radio" name="viewemail" value="0"<!-- IF not S_VIEW_EMAIL --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NO}</span></td>
-</tr>
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_ADMIN_EMAIL}{L_COLON}</b></td>
- <td class="row2"><input type="radio" class="radio" name="massemail" value="1"<!-- IF S_MASS_EMAIL --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_YES}</span>&nbsp;&nbsp;<input type="radio" class="radio" name="massemail" value="0"<!-- IF not S_MASS_EMAIL --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NO}</span></td>
-</tr>
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_ALLOW_PM}{L_COLON}</b><br /><span class="gensmall">{L_ALLOW_PM_EXPLAIN}</span></td>
- <td class="row2"><input type="radio" class="radio" name="allowpm" value="1"<!-- IF S_ALLOW_PM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_YES}</span>&nbsp;&nbsp;<input type="radio" class="radio" name="allowpm" value="0"<!-- IF not S_ALLOW_PM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NO}</span></td>
-</tr>
-<!-- IF S_CAN_HIDE_ONLINE -->
- <tr>
- <td class="row1" width="50%"><b class="genmed">{L_HIDE_ONLINE}{L_COLON}</b><br /><span class="gensmall">{L_HIDE_ONLINE_EXPLAIN}</span></td>
- <td class="row2"><input type="radio" class="radio" name="hideonline" value="1"<!-- IF S_HIDE_ONLINE --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_YES}</span>&nbsp;&nbsp;<input type="radio" class="radio" name="hideonline" value="0"<!-- IF not S_HIDE_ONLINE --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NO}</span></td>
- </tr>
-<!-- ENDIF -->
-<!-- IF S_SELECT_NOTIFY -->
- <tr>
- <td class="row1" width="50%"><b class="genmed">{L_NOTIFY_METHOD}{L_COLON}</b><br /><span class="gensmall">{L_NOTIFY_METHOD_EXPLAIN}</span></td>
- <td class="row2"><input type="radio" class="radio" name="notifymethod" value="0"<!-- IF S_NOTIFY_EMAIL --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NOTIFY_METHOD_EMAIL}</span>&nbsp;&nbsp;<input type="radio" class="radio" name="notifymethod" value="1"<!-- IF S_NOTIFY_IM --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NOTIFY_METHOD_IM}</span>&nbsp;&nbsp;<input type="radio" class="radio" name="notifymethod" value="2"<!-- IF S_NOTIFY_BOTH --> checked="checked"<!-- ENDIF --> /><span class="genmed">{L_NOTIFY_METHOD_BOTH}</span></td>
- </tr>
-<!-- ENDIF -->
-<!-- IF S_MORE_LANGUAGES -->
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_BOARD_LANGUAGE}{L_COLON}</b></td>
- <td class="row2"><select name="lang">{S_LANG_OPTIONS}</select></td>
-</tr>
-<!-- ENDIF -->
-<!-- IF S_STYLE_OPTIONS and S_MORE_STYLES -->
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_BOARD_STYLE}{L_COLON}</b></td>
- <td class="row2"><select name="user_style">{S_STYLE_OPTIONS}</select></td>
-</tr>
-<!-- ENDIF -->
-<!-- INCLUDE timezone_option.html -->
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_BOARD_DATE_FORMAT}{L_COLON}</b><br /><span class="gensmall">{L_BOARD_DATE_FORMAT_EXPLAIN}</span></td>
- <td class="row2">
- <select name="dateoptions" id="dateoptions" onchange="if(this.value=='custom'){phpbb.toggleDisplay('custom_date',1);}else{phpbb.toggleDisplay('custom_date',-1);} if (this.value == 'custom') { document.getElementById('dateformat').value = default_dateformat; } else { document.getElementById('dateformat').value = this.value; }">
- {S_DATEFORMAT_OPTIONS}
- </select>
- <div id="custom_date"<!-- IF not S_CUSTOM_DATEFORMAT --> style="display:none;"<!-- ENDIF -->><input type="text" name="dateformat" id="dateformat" value="{DATE_FORMAT}" maxlength="30" class="post" style="margin-top: 3px;" /></div>
- </td>
-</tr>
-<!-- EVENT ucp_prefs_personal_append -->
-<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>
-</table>
-
-<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_prefs_post.html b/phpBB/styles/subsilver2/template/ucp_prefs_post.html
deleted file mode 100644
index 0a558b863c..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_prefs_post.html
+++ /dev/null
@@ -1,35 +0,0 @@
-<!-- INCLUDE ucp_header.html -->
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th colspan="2" valign="middle">{L_TITLE}</th>
-</tr>
-<!-- IF ERROR -->
- <tr>
- <td class="row3" colspan="2" align="center"><span class="gensmall error">{ERROR}</span></td>
- </tr>
-<!-- ENDIF -->
-<!-- EVENT ucp_prefs_post_prepend -->
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_DEFAULT_BBCODE}{L_COLON}</b></td>
- <td class="row2"><input type="radio" class="radio" name="bbcode" value="1"<!-- IF S_BBCODE --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span>&nbsp; &nbsp;<input type="radio" class="radio" name="bbcode" value="0"<!-- IF not S_BBCODE --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
-</tr>
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_DEFAULT_SMILIES}{L_COLON}</b></td>
- <td class="row2"><input type="radio" class="radio" name="smilies" value="1"<!-- IF S_SMILIES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span>&nbsp; &nbsp;<input type="radio" class="radio" name="smilies" value="0"<!-- IF not S_SMILIES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
-</tr>
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_DEFAULT_ADD_SIG}{L_COLON}</b></td>
- <td class="row2"><input type="radio" class="radio" name="sig" value="1"<!-- IF S_SIG --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span>&nbsp; &nbsp;<input type="radio" class="radio" name="sig" value="0"<!-- IF not S_SIG --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
-</tr>
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_DEFAULT_NOTIFY}{L_COLON}</b></td>
- <td class="row2"><input type="radio" class="radio" name="notify" value="1"<!-- IF S_NOTIFY --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span>&nbsp; &nbsp;<input type="radio" class="radio" name="notify" value="0"<!-- IF not S_NOTIFY --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
-</tr>
-<!-- EVENT ucp_prefs_post_append -->
-<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>
-</table>
-
-<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_prefs_view.html b/phpBB/styles/subsilver2/template/ucp_prefs_view.html
deleted file mode 100644
index c10c458627..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_prefs_view.html
+++ /dev/null
@@ -1,77 +0,0 @@
-<!-- INCLUDE ucp_header.html -->
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th colspan="2" valign="middle">{L_TITLE}</th>
-</tr>
-<!-- IF ERROR -->
- <tr>
- <td class="row3" colspan="2" align="center"><span class="gensmall error">{ERROR}</span></td>
- </tr>
-<!-- ENDIF -->
-<!-- EVENT ucp_prefs_view_radio_buttons_prepend -->
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_VIEW_IMAGES}{L_COLON}</b></td>
- <td class="row2"><input type="radio" class="radio" name="images" value="1"<!-- IF S_IMAGES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span>&nbsp; &nbsp;<input type="radio" class="radio" name="images" value="0"<!-- IF not S_IMAGES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
-</tr>
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_VIEW_FLASH}{L_COLON}</b></td>
- <td class="row2"><input type="radio" class="radio" name="flash" value="1"<!-- IF S_FLASH --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span>&nbsp; &nbsp;<input type="radio" class="radio" name="flash" value="0"<!-- IF not S_FLASH --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
-</tr>
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_VIEW_SMILIES}{L_COLON}</b></td>
- <td class="row2"><input type="radio" class="radio" name="smilies" value="1"<!-- IF S_SMILIES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span>&nbsp; &nbsp;<input type="radio" class="radio" name="smilies" value="0"<!-- IF not S_SMILIES --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
-</tr>
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_VIEW_SIGS}{L_COLON}</b></td>
- <td class="row2"><input type="radio" class="radio" name="sigs" value="1"<!-- IF S_SIGS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span>&nbsp; &nbsp;<input type="radio" class="radio" name="sigs" value="0"<!-- IF not S_SIGS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
-</tr>
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_VIEW_AVATARS}{L_COLON}</b></td>
- <td class="row2"><input type="radio" class="radio" name="avatars" value="1"<!-- IF S_AVATARS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span>&nbsp; &nbsp;<input type="radio" class="radio" name="avatars" value="0"<!-- IF not S_AVATARS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
-</tr>
-<!-- IF S_CHANGE_CENSORS -->
- <tr>
- <td class="row1" width="50%"><b class="genmed">{L_DISABLE_CENSORS}{L_COLON}</b></td>
- <td class="row2"><input type="radio" class="radio" name="wordcensor" value="1"<!-- IF S_DISABLE_CENSORS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_YES}</span>&nbsp; &nbsp;<input type="radio" class="radio" name="wordcensor" value="0"<!-- IF not S_DISABLE_CENSORS --> checked="checked"<!-- ENDIF --> /><span class="gen">{L_NO}</span></td>
- </tr>
-<!-- ENDIF -->
-<!-- EVENT ucp_prefs_view_radio_buttons_append -->
-<tr>
- <td colspan="2" class="spacer"></td>
-</tr>
-<!-- EVENT ucp_prefs_view_select_menu_prepend -->
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_VIEW_TOPICS_DAYS}{L_COLON}</b></td>
- <td class="row2">{S_TOPIC_SORT_DAYS}</td>
-</tr>
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_VIEW_TOPICS_KEY}{L_COLON}</b></td>
- <td class="row2">{S_TOPIC_SORT_KEY}</td>
-</tr>
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_VIEW_TOPICS_DIR}{L_COLON}</b></td>
- <td class="row2">{S_TOPIC_SORT_DIR}</td>
-</tr>
-<tr>
- <td colspan="2" class="spacer"></td>
-</tr>
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_VIEW_POSTS_DAYS}{L_COLON}</b></td>
- <td class="row2">{S_POST_SORT_DAYS}</td>
-</tr>
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_VIEW_POSTS_KEY}{L_COLON}</b></td>
- <td class="row2">{S_POST_SORT_KEY}</td>
-</tr>
-<tr>
- <td class="row1" width="50%"><b class="genmed">{L_VIEW_POSTS_DIR}{L_COLON}</b></td>
- <td class="row2">{S_POST_SORT_DIR}</td>
-</tr>
-<!-- EVENT ucp_prefs_view_select_menu_append -->
-<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>
-</table>
-
-<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_profile_autologin_keys.html b/phpBB/styles/subsilver2/template/ucp_profile_autologin_keys.html
deleted file mode 100644
index 087ae89743..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_profile_autologin_keys.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<!-- INCLUDE ucp_header.html -->
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th colspan="4">{L_TITLE}</th>
-</tr>
-
-<!-- IF ERROR -->
- <tr>
- <td class="row3" colspan="4" align="center"><span class="genmed error">{ERROR}</span></td>
- </tr>
-<!-- ENDIF -->
-
-<tr>
- <td colspan="4" class="row1">{L_PROFILE_AUTOLOGIN_KEYS}</td>
-</tr>
-<tr>
- <th>{L_LOGIN_KEY}</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 -->
- <td class="genmed"><label for="{sessions.KEY}">{sessions.KEY}</label></td>
- <td class="genmed" style="text-align: center">{sessions.IP}</td>
- <td class="genmed" style="text-align: center">{sessions.LOGIN_TIME}</td>
- <td class="genmed" style="text-align: center"><input type="checkbox" name="keys[]" value="{sessions.KEY}" id="{sessions.KEY}"/></td>
- </tr>
-<!-- BEGINELSE -->
- <tr>
- <td colspan="4" class="row1" style="text-align: center">{L_PROFILE_NO_AUTOLOGIN_KEYS}</td>
- </tr>
-<!-- END sessions -->
-
-<!-- IF .sessions -->
- <tr>
- <td class="cat" colspan="4" align="{S_CONTENT_FLOW_END}">
- {S_HIDDEN_FIELDS}<input class="btnlite" type="submit" name="submit" value="{L_DELETE_MARKED}" />
- {S_FORM_TOKEN}
- </td>
- </tr>
-<!-- ENDIF -->
-</table>
-
-<!-- IF .sessions -->
- <div class="gensmall" style="float: {S_CONTENT_FLOW_END}; padding-top: 2px;"><b><a href="#" onclick="marklist('ucp', 'keys', true); return false;">{L_MARK_ALL}</a> :: <a href="#" onclick="marklist('ucp', 'keys', false); return false;">{L_UNMARK_ALL}</a></b></div>
-<!-- ENDIF -->
-
-<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_profile_avatar.html b/phpBB/styles/subsilver2/template/ucp_profile_avatar.html
deleted file mode 100644
index 8b1e8cffac..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_profile_avatar.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<!-- INCLUDE ucp_header.html -->
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th colspan="2" valign="middle">{L_TITLE}</th>
-</tr>
-<!-- IF ERROR -->
- <tr>
- <td class="row3" colspan="2" align="center"><span class="gensmall error">{ERROR}</span></td>
- </tr>
-<!-- ENDIF -->
-<tr>
- <td class="row1" width="35%"><b class="genmed">{L_CURRENT_IMAGE}{L_COLON} </b><br /><span class="gensmall">{L_AVATAR_EXPLAIN}</span></td>
- <td class="row2" align="center"><br />
- <!-- IF AVATAR -->{AVATAR}<br /><br /><input type="checkbox" class="radio" name="avatar_delete" />&nbsp;<span class="gensmall">{L_DELETE_AVATAR}</span>
- <!-- ELSE --><img src="{T_THEME_PATH}/images/no_avatar.gif" alt="" />
- <!-- ENDIF --></td>
-</tr>
-<!-- IF not S_AVATARS_ENABLED -->
- <tr>
- <td class="row3" colspan="2" align="center">{L_AVATAR_FEATURES_DISABLED}</td>
- </tr>
-<!-- ENDIF -->
- <tr>
- <th colspan="2">{L_AVATAR_SELECT}</th>
- </tr>
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_AVATAR_TYPE}{L_COLON}</b></td>
- <td class="row2">
- <select name="avatar_driver" id="avatar_driver" data-togglable-settings="true">
- <!-- BEGIN avatar_drivers -->
- <option value="{avatar_drivers.DRIVER}"<!-- IF avatar_drivers.SELECTED --> selected="selected"<!-- ENDIF --> data-toggle-setting=".avatar_option_{avatar_drivers.DRIVER}">{avatar_drivers.L_TITLE}</option>
- <!-- END avatar_drivers -->
- </select></td>
- </tr>
-<!-- BEGIN avatar_drivers -->
- <tr class="avatar_option_{avatar_drivers.DRIVER}">
- <td class="row1" width="35%" colspan="2"><noscript><b class="genmed">{avatar_drivers.L_TITLE} </b><br /></noscript>{avatar_drivers.L_EXPLAIN}</span></td>
- </tr>
- <tr class="avatar_option_{avatar_drivers.DRIVER}">
- <td colspan="2" style="padding: 0">{avatar_drivers.OUTPUT}</td>
- </tr>
-<!-- END avatar_drivers -->
-
- <tr>
- <td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" />&nbsp;&nbsp;<!-- IF S_IN_AVATAR_GALLERY --><input class="btnlite" type="submit" name="cancel" value="{L_CANCEL}" /><!-- ELSE --><input class="btnlite" type="reset" value="{L_RESET}" name="reset" /><!-- ENDIF --></td>
- </tr>
-</table>
-
-<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html b/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html
deleted file mode 100644
index bfc2dd0244..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_profile_profile_info.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<!-- INCLUDE ucp_header.html -->
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th colspan="2" valign="middle">{L_TITLE}</th>
-</tr>
-<!-- IF ERROR -->
- <tr>
- <td class="row3" colspan="2" align="center"><span class="gensmall error">{ERROR}</span></td>
- </tr>
-<!-- ENDIF -->
-<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>
- <td class="row2"><input class="post" type="text" name="jabber" size="30" maxlength="255" value="{JABBER}" /></td>
-</tr>
-<!-- ENDIF -->
-<!-- IF S_BIRTHDAYS_ENABLED -->
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_BIRTHDAY}{L_COLON} </b><br /><span class="gensmall">{L_BIRTHDAY_EXPLAIN}</span></td>
- <td class="row2"><span class="genmed">{L_DAY}{L_COLON}</span> <select name="bday_day">{S_BIRTHDAY_DAY_OPTIONS}</select> <span class="genmed">{L_MONTH}{L_COLON}</span> <select name="bday_month">{S_BIRTHDAY_MONTH_OPTIONS}</select> <span class="genmed">{L_YEAR}{L_COLON}</span> <select name="bday_year">{S_BIRTHDAY_YEAR_OPTIONS}</select></td>
- </tr>
-<!-- ENDIF -->
-<!-- BEGIN profile_fields -->
- <tr>
- <td class="row1" width="35%">
- <b class="genmed">{profile_fields.LANG_NAME}{L_COLON} </b>
- <!-- IF profile_fields.S_REQUIRED --><b>*</b><!-- ENDIF -->
- <!-- IF profile_fields.LANG_EXPLAIN --><br /><span class="gensmall">{profile_fields.LANG_EXPLAIN}</span><!-- ENDIF -->
- </td>
- <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>
-</table>
-
-<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html b/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html
deleted file mode 100644
index 862956a1d0..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_profile_reg_details.html
+++ /dev/null
@@ -1,49 +0,0 @@
-<!-- INCLUDE ucp_header.html -->
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th colspan="2" valign="middle">{L_TITLE}</th>
-</tr>
-<!-- IF S_FORCE_PASSWORD -->
- <tr>
- <td class="row3" colspan="2" align="center"><span class="gensmall error">{L_FORCE_PASSWORD_EXPLAIN}</span></td>
- </tr>
-<!-- ENDIF -->
-<!-- IF ERROR -->
- <tr>
- <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>
-</tr>
-<tr>
- <td class="row1" width="35%"><b class="genmed">{L_EMAIL_ADDRESS}{L_COLON} </b></td>
- <td class="row2"><!-- IF S_CHANGE_EMAIL --><input type="email" class="post" name="email" size="30" maxlength="100" value="{EMAIL}" autocomplete="off" /><!-- ELSE --><b class="gen">{EMAIL}</b><!-- ENDIF --></td>
-</tr>
-<!-- IF S_CHANGE_PASSWORD -->
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_NEW_PASSWORD}{L_COLON} </b><br /><span class="gensmall">{L_CHANGE_PASSWORD_EXPLAIN}</span></td>
- <td class="row2"><input type="password" class="post" name="new_password" size="30" maxlength="255" value="{NEW_PASSWORD}" autocomplete="off" /></td>
- </tr>
- <tr>
- <td class="row1" width="35%"><b class="genmed">{L_CONFIRM_PASSWORD}{L_COLON} </b><br /><span class="gensmall">{L_CONFIRM_PASSWORD_EXPLAIN}</span></td>
- <td class="row2"><input type="password" class="post" name="password_confirm" size="30" maxlength="255" value="{PASSWORD_CONFIRM}" autocomplete="off" /></td>
- </tr>
-<!-- ENDIF -->
-<!-- EVENT ucp_profile_register_details_after -->
-<tr>
- <th colspan="2">{L_CONFIRM_CHANGES}</th>
-</tr>
-<tr>
- <td class="row1" width="35%"><b class="genmed">{L_CURRENT_PASSWORD}{L_COLON} </b><br /><span class="gensmall"><!-- IF S_CHANGE_PASSWORD -->{L_CURRENT_CHANGE_PASSWORD_EXPLAIN}<!-- ELSE -->{L_CURRENT_PASSWORD_EXPLAIN}<!-- ENDIF --></span></td>
- <td class="row2"><input type="password" class="post" name="cur_password" size="30" maxlength="255" value="{CUR_PASSWORD}" autocomplete="off" /></td>
-</tr>
-<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>
-</table>
-
-<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_profile_signature.html b/phpBB/styles/subsilver2/template/ucp_profile_signature.html
deleted file mode 100644
index 5a2690edda..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_profile_signature.html
+++ /dev/null
@@ -1,132 +0,0 @@
-<!-- INCLUDE ucp_header.html -->
-
-<script type="text/javascript">
-// <![CDATA[
- var form_name = 'ucp';
- var text_name = 'signature';
-// ]]>
-</script>
-
-<!-- DEFINE $S_SIGNATURE = 1 -->
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th colspan="2">{L_TITLE}</th>
-</tr>
-<!-- IF not S_SMILIES_ALLOWED -->
-<tr>
- <td colspan="2" class="row1">{L_SIGNATURE_EXPLAIN}</td>
-</tr>
-<!-- ENDIF -->
-
-<!-- IF ERROR -->
- <tr>
- <td class="row3" colspan="2" align="center"><span class="genmed error">{ERROR}</span></td>
- </tr>
-<!-- ENDIF -->
-
-<tr>
- <!-- IF S_SMILIES_ALLOWED -->
- <td class="row1" width="22%" valign="top">
- {L_SIGNATURE_EXPLAIN}
- <table width="100%" cellspacing="5" cellpadding="0" border="0" align="center">
- <tr>
- <td class="gensmall" align="center"><b>{L_SMILIES}</b></td>
- </tr>
- <tr>
- <td align="center">
- <!-- BEGIN smiley -->
- <a href="#" onclick="insert_text('{smiley.A_SMILEY_CODE}', true); return false;" style="line-height: 20px;"><img src="{smiley.SMILEY_IMG}" width="{smiley.SMILEY_WIDTH}" height="{smiley.SMILEY_HEIGHT}" alt="{smiley.SMILEY_CODE}" title="{smiley.SMILEY_DESC}" hspace="2" vspace="2" /></a>
- <!-- END smiley -->
- </td>
- </tr>
- <!-- IF S_SHOW_SMILEY_LINK -->
- <tr>
- <td align="center"><a class="nav" href="{U_MORE_SMILIES}" onclick="popup(this.href, 300, 350, '_phpbbsmilies'); return false;">{L_MORE_SMILIES}</a></td>
- </tr>
- <!-- ENDIF -->
- </table>
- </td>
- <td class="row2">
- <!-- ELSE -->
- <td class="row2" colspan="2">
- <!-- ENDIF -->
-
- <table cellspacing="0" cellpadding="2" border="0" width="99%">
- <!-- INCLUDE posting_buttons.html -->
- <tr>
- <td colspan="2"><textarea class="post" name="signature" rows="10" cols="76" style="width: 90%;" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onfocus="initInsertions();">{SIGNATURE}</textarea></td>
- </tr>
- <!-- IF S_BBCODE_ALLOWED -->
- <tr>
- <td colspan="2">
- <table cellspacing="0" cellpadding="0" border="0" width="100%">
- <tr>
- <td align="{S_CONTENT_FLOW_BEGIN}" id="color_palette_placeholder" data-orientation="h" data-width="11" data-height="10">
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <!-- ENDIF -->
- </table>
- </td>
-</tr>
-<tr>
- <td class="row1" valign="top"><b class="genmed">{L_OPTIONS}</b><br />
- <table cellspacing="2" cellpadding="0" border="0">
- <tr>
- <td class="gensmall">{BBCODE_STATUS}</td>
- </tr>
- <tr>
- <td class="gensmall">{IMG_STATUS}</td>
- </tr>
- <tr>
- <td class="gensmall">{FLASH_STATUS}</td>
- </tr>
- <tr>
- <td class="gensmall">{URL_STATUS}</td>
- </tr>
- <tr>
- <td class="gensmall">{SMILIES_STATUS}</td>
- </tr>
- </table>
- </td>
- <td class="row2" valign="top">
- <table cellspacing="0" cellpadding="1" border="0">
- <!-- IF S_BBCODE_ALLOWED -->
- <tr>
- <td><input type="checkbox" class="radio" name="disable_bbcode"{S_BBCODE_CHECKED} /></td>
- <td class="gen">{L_DISABLE_BBCODE}</td>
- </tr>
- <!-- ENDIF -->
- <!-- IF S_SMILIES_ALLOWED -->
- <tr>
- <td><input type="checkbox" class="radio" name="disable_smilies"{S_SMILIES_CHECKED} /></td>
- <td class="gen">{L_DISABLE_SMILIES}</td>
- </tr>
- <!-- ENDIF -->
- <!-- IF S_LINKS_ALLOWED -->
- <tr>
- <td><input type="checkbox" class="radio" name="disable_magic_url"{S_MAGIC_URL_CHECKED} /></td>
- <td class="gen">{L_DISABLE_MAGIC_URL}</td>
- </tr>
- <!-- ENDIF -->
- </table>
- </td>
-</tr>
-
-<!-- IF SIGNATURE_PREVIEW != '' -->
- <tr>
- <th colspan="2" valign="middle">{L_SIGNATURE_PREVIEW}</th>
- </tr>
- <tr>
- <td class="row1" colspan="2"><div class="postbody" style="padding: 6px;">{SIGNATURE_PREVIEW}</div></td>
- </tr>
-<!-- ENDIF -->
-
-<tr>
- <td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input class="btnlite" type="submit" name="preview" value="{L_PREVIEW}" />&nbsp;&nbsp;<input class="btnmain" type="submit" name="submit" value="{L_SUBMIT}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" name="reset" /></td>
-</tr>
-</table>
-
-<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_register.html b/phpBB/styles/subsilver2/template/ucp_register.html
deleted file mode 100644
index 9b9e164df4..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_register.html
+++ /dev/null
@@ -1,101 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<script type="text/javascript">
-// <![CDATA[
- /**
- * Change language
- */
- function change_language(lang_iso)
- {
- document.cookie = '{COOKIE_NAME}_lang=' + lang_iso + '; path={COOKIE_PATH}';
- document.forms['register'].change_lang.value = lang_iso;
- document.forms['register'].submit.click();
- }
-
-// ]]>
-</script>
-
-<form name="register" method="post" action="{S_UCP_ACTION}">
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th colspan="2" valign="middle">{L_REGISTRATION}</th>
-</tr>
-
-<!-- IF ERROR -->
- <tr>
- <td class="row3" colspan="2" align="center"><span class="gensmall error">{ERROR}</span></td>
- </tr>
-<!-- ENDIF -->
-
-<!-- IF L_REG_COND -->
- <tr>
- <td class="row2" colspan="2"><span class="gensmall">{L_REG_COND}</span></td>
- </tr>
-<!-- ENDIF -->
-
-<!-- EVENT ucp_register_credentials_before -->
-<tr>
- <td class="row1" width="38%"><b class="genmed">{L_USERNAME}{L_COLON} </b><br /><span class="gensmall">{L_USERNAME_EXPLAIN}</span></td>
- <td class="row2"><input class="post" type="text" name="username" size="25" value="{USERNAME}" /></td>
-</tr>
-<tr>
- <td class="row1"><b class="genmed">{L_EMAIL_ADDRESS}{L_COLON} </b></td>
- <td class="row2"><input class="post" type="email" name="email" size="25" maxlength="100" value="{EMAIL}" autocomplete="off" /></td>
-</tr>
-<tr>
- <td class="row1"><b class="genmed">{L_PASSWORD}{L_COLON} </b><br /><span class="gensmall">{L_PASSWORD_EXPLAIN}</span></td>
- <td class="row2"><input class="post" type="password" name="new_password" size="25" value="{PASSWORD}" autocomplete="off" /></td>
-</tr>
-<tr>
- <td class="row1"><b class="genmed">{L_CONFIRM_PASSWORD}{L_COLON} </b></td>
- <td class="row2"><input class="post" type="password" name="password_confirm" size="25" value="{PASSWORD_CONFIRM}" autocomplete="off" /></td>
-</tr>
-<!-- EVENT ucp_register_credentials_after -->
-<!-- EVENT ucp_register_options_before -->
-<tr>
- <td class="row1"><b class="genmed">{L_LANGUAGE}{L_COLON} </b></td>
- <td class="row2"><select name="lang" onchange="change_language(this.value); return false;">{S_LANG_OPTIONS}</select></td>
-</tr>
-
-<!-- INCLUDE timezone_option.html -->
-
-<!-- EVENT ucp_register_profile_fields_before -->
-<!-- IF .profile_fields -->
- <tr>
- <td class="row2" colspan="2"><span class="gensmall">{L_ITEMS_REQUIRED}</span></td>
- </tr>
-<!-- BEGIN profile_fields -->
- <tr>
- <td class="row1" width="35%">
- <b class="genmed">{profile_fields.LANG_NAME}{L_COLON} </b>
- <!-- IF profile_fields.S_REQUIRED --><b>*</b><!-- ENDIF -->
- <!-- IF profile_fields.LANG_EXPLAIN --><br /><span class="gensmall">{profile_fields.LANG_EXPLAIN}</span><!-- ENDIF -->
- </td>
- <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 -->
-<!-- ENDIF -->
-<!-- EVENT ucp_register_profile_fields_after -->
- <!-- IF CAPTCHA_TEMPLATE -->
- <!-- INCLUDE {CAPTCHA_TEMPLATE} -->
- <!-- ENDIF -->
-
-<!-- IF S_COPPA -->
- <tr>
- <th colspan="2" valign="middle">{L_COPPA_COMPLIANCE}</th>
- </tr>
- <tr>
- <td class="row3" colspan="2"><span class="gensmall">{L_COPPA_EXPLAIN}</span></td>
- </tr>
-<!-- ENDIF -->
-
-<tr>
- <td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input class="btnmain" type="submit" name="submit" id="submit" value="{L_SUBMIT}" />&nbsp;&nbsp;<input class="btnlite" type="reset" value="{L_RESET}" name="reset" /></td>
-</tr>
-</table>
-{S_FORM_TOKEN}
-</form>
-
-<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_remind.html b/phpBB/styles/subsilver2/template/ucp_remind.html
deleted file mode 100644
index f7fde4b3be..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_remind.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<div align="center">
-
-<form action="{S_PROFILE_ACTION}" method="post">
-
-<table class="tablebg" width="50%" cellspacing="1" cellpadding="4" border="0">
-<tr>
- <th colspan="2">{L_SEND_PASSWORD}</th>
-</tr>
-<tr>
- <td class="row1" width="38%"><b class="genmed">{L_USERNAME}{L_COLON} </b></td>
- <td class="row2"><input type="text" class="post" name="username" size="25" value="{USERNAME}" /></td>
-</tr>
-<tr>
- <td class="row1"><b class="genmed">{L_EMAIL_ADDRESS}{L_COLON} </b><br /><span class="gensmall">{L_EMAIL_REMIND}</span></td>
- <td class="row2"><input type="email" class="post" name="email" size="25" maxlength="100" value="{EMAIL}" /></td>
-</tr>
-<tr>
- <td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input type="submit" name="submit" value="{L_SUBMIT}" class="btnmain" />&nbsp;&nbsp;<input type="reset" value="{L_RESET}" name="reset" class="btnlite" /></td>
-</tr>
-</table>
-{S_FORM_TOKEN}
-</form>
-
-</div>
-
-<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_resend.html b/phpBB/styles/subsilver2/template/ucp_resend.html
deleted file mode 100644
index 62e7e96d6b..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_resend.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<div align="center">
-
-<form action="{S_PROFILE_ACTION}" method="post">
-
-<table class="tablebg" width="50%" cellspacing="1" cellpadding="4" border="0">
-<tr>
- <th colspan="2">{L_UCP_RESEND}</th>
-</tr>
-<tr>
- <td class="row1" width="38%"><b class="genmed">{L_USERNAME}{L_COLON} </b></td>
- <td class="row2"><input type="text" class="post" name="username" size="25" value="{USERNAME}" /></td>
-</tr>
-<tr>
- <td class="row1"><b class="genmed">{L_EMAIL_ADDRESS}{L_COLON} </b><br /><span class="gensmall">{L_EMAIL_REMIND}</span></td>
- <td class="row2"><input type="email" class="post" name="email" size="25" maxlength="100" value="{EMAIL}" /></td>
-</tr>
-<tr>
- <td class="cat" colspan="2" align="center">{S_HIDDEN_FIELDS}<input type="submit" name="submit" value="{L_SUBMIT}" class="btnmain" />&nbsp;&nbsp;<input type="reset" value="{L_RESET}" name="reset" class="btnlite" /></td>
-</tr>
-</table>
-{S_FORM_TOKEN}
-
-</form>
-
-</div>
-
-<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_zebra_foes.html b/phpBB/styles/subsilver2/template/ucp_zebra_foes.html
deleted file mode 100644
index 6149a80e69..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_zebra_foes.html
+++ /dev/null
@@ -1,28 +0,0 @@
-<!-- INCLUDE ucp_header.html -->
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th colspan="2" valign="middle">{L_TITLE}</th>
-</tr>
-<tr>
- <td class="row3" colspan="2"><span class="gensmall">{L_FOES_EXPLAIN}</span></td>
-</tr>
-<!-- IF ERROR -->
- <tr>
- <td class="row3" colspan="2" align="center"><span class="gensmall error">{ERROR}</span></td>
- </tr>
-<!-- ENDIF -->
-<tr>
- <td class="row1" width="40%"><b class="genmed">{L_YOUR_FOES}{L_COLON}</b><br /><span class="gensmall">{L_YOUR_FOES_EXPLAIN}</span></td>
- <td class="row2" align="center"><!-- IF S_USERNAME_OPTIONS --><select name="usernames[]" multiple="multiple" size="5">{S_USERNAME_OPTIONS}</select><!-- ELSE --><b class="genmed">{L_NO_FOES}</b><!-- ENDIF --></td>
-</tr>
-<tr>
- <td class="row1"><b class="genmed">{L_ADD_FOES}{L_COLON}</b><br /><span class="gensmall">{L_ADD_FOES_EXPLAIN} [ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</span></td>
- <td class="row2" align="center"><textarea name="add" rows="5" cols="30">{USERNAMES}</textarea><br /></td>
-</tr>
-<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>
-</table>
-
-<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/ucp_zebra_friends.html b/phpBB/styles/subsilver2/template/ucp_zebra_friends.html
deleted file mode 100644
index 3e18af9969..0000000000
--- a/phpBB/styles/subsilver2/template/ucp_zebra_friends.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!-- INCLUDE ucp_header.html -->
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th colspan="2" valign="middle">{L_TITLE}</th>
-</tr>
-<!-- EVENT ucp_friend_list_before -->
-<tr>
- <td class="row3" colspan="2"><span class="gensmall">{L_FRIENDS_EXPLAIN}</span></td>
-</tr>
-<!-- IF ERROR -->
- <tr>
- <td class="row3" colspan="2" align="center"><span class="gensmall error">{ERROR}</span></td>
- </tr>
-<!-- ENDIF -->
-<tr>
- <td class="row1" width="40%"><b class="genmed">{L_YOUR_FRIENDS}{L_COLON}</b><br /><span class="gensmall">{L_YOUR_FRIENDS_EXPLAIN}</span></td>
- <td class="row2" align="center"><!-- IF S_USERNAME_OPTIONS --><select name="usernames[]" multiple="multiple" size="5">{S_USERNAME_OPTIONS}</select><!-- ELSE --><b class="genmed">{L_NO_FRIENDS}</b><!-- ENDIF --></td>
-</tr>
-<!-- EVENT ucp_friend_list_after -->
-<tr>
- <td class="row1"><b class="genmed">{L_ADD_FRIENDS}{L_COLON}</b><br /><span class="gensmall">{L_ADD_FRIENDS_EXPLAIN} [ <a href="{U_FIND_USERNAME}" onclick="find_username(this.href); return false;">{L_FIND_USERNAME}</a> ]</span></td>
- <td class="row2" align="center"><textarea name="add" rows="5" cols="30">{USERNAMES}</textarea><br /></td>
-</tr>
-<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>
-</table>
-
-<!-- INCLUDE ucp_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/viewforum_body.html b/phpBB/styles/subsilver2/template/viewforum_body.html
deleted file mode 100644
index 83b01b9f6d..0000000000
--- a/phpBB/styles/subsilver2/template/viewforum_body.html
+++ /dev/null
@@ -1,374 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<!-- IF S_FORUM_RULES -->
- <div class="forumrules<!-- IF U_FORUM_RULES --> rules-link<!-- ENDIF -->">
- <!-- IF U_FORUM_RULES -->
- <h3>{L_FORUM_RULES}</h3><br />
- <a href="{U_FORUM_RULES}"><b>{L_FORUM_RULES_LINK}</b></a>
- <!-- ELSE -->
- <h3>{L_FORUM_RULES}</h3><br />
- {FORUM_RULES}
- <!-- ENDIF -->
- </div>
-
- <br clear="all" />
-<!-- ENDIF -->
-
-<!-- IF S_DISPLAY_ACTIVE -->
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <td class="cat" colspan="<!-- IF S_TOPIC_ICONS -->7<!-- ELSE -->6<!-- ENDIF -->"><span class="nav">{L_ACTIVE_TOPICS}</span></td>
- </tr>
-
- <tr>
- <!-- IF S_TOPIC_ICONS -->
- <th colspan="3">&nbsp;{L_TOPICS}&nbsp;</th>
- <!-- ELSE -->
- <th colspan="2">&nbsp;{L_TOPICS}&nbsp;</th>
- <!-- ENDIF -->
- <th>&nbsp;{L_AUTHOR}&nbsp;</th>
- <th>&nbsp;{L_REPLIES}&nbsp;</th>
- <th>&nbsp;{L_VIEWS}&nbsp;</th>
- <th>&nbsp;{L_LAST_POST}&nbsp;</th>
- </tr>
-
- <!-- BEGIN topicrow -->
-
- <tr>
- <td class="row1" width="25" align="center">{topicrow.TOPIC_FOLDER_IMG}</td>
- <!-- IF S_TOPIC_ICONS -->
- <td class="row1" width="25" align="center"><!-- IF topicrow.TOPIC_ICON_IMG --><img src="{T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}" width="{topicrow.TOPIC_ICON_IMG_WIDTH}" height="{topicrow.TOPIC_ICON_IMG_HEIGHT}" alt="" title="" /><!-- ENDIF --></td>
- <!-- ENDIF -->
- <td class="row1">
- <!-- EVENT topiclist_row_prepend -->
- <!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}" class="imageset">{NEWEST_POST_IMG}</a><!-- ENDIF -->
- {topicrow.ATTACH_ICON_IMG} <!-- IF topicrow.S_HAS_POLL or topicrow.S_TOPIC_MOVED --><b>{topicrow.TOPIC_TYPE}</b> <!-- ENDIF --><a title="{L_POSTED}{L_COLON} {topicrow.FIRST_POST_TIME}" href="{topicrow.U_VIEW_TOPIC}"class="topictitle">{topicrow.TOPIC_TITLE}</a>
- <!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED -->
- <a href="{topicrow.U_MCP_QUEUE}" class="imageset">{topicrow.UNAPPROVED_IMG}</a>&nbsp;
- <!-- ENDIF -->
- <!-- IF topicrow.S_TOPIC_DELETED -->
- <a href="{topicrow.U_MCP_QUEUE}" class="imageset">{DELETED_IMG}</a>&nbsp;
- <!-- ENDIF -->
- <!-- IF topicrow.S_TOPIC_REPORTED -->
- <a href="{topicrow.U_MCP_REPORT}" class="imageset">{REPORTED_IMG}</a>&nbsp;
- <!-- ENDIF -->
- <!-- IF .topicrow.pagination -->
- <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}{L_COLON}
- <!-- BEGIN pagination -->
- <!-- IF topicrow.pagination.S_IS_PREV -->
- <!-- ELSEIF topicrow.pagination.S_IS_CURRENT --><strong>{topicrow.pagination.PAGE_NUMBER}</strong>
- <!-- ELSEIF topicrow.pagination.S_IS_ELLIPSIS --> {L_ELLIPSIS}
- <!-- ELSEIF topicrow.pagination.S_IS_NEXT -->
- <!-- ELSE --><a href="{topicrow.pagination.PAGE_URL}">{topicrow.pagination.PAGE_NUMBER}</a>
- <!-- ENDIF -->
- <!-- END pagination -->
- ] </p>
- <!-- ENDIF -->
- <!-- EVENT topiclist_row_append -->
- </td>
- <td class="row2" width="130" align="center"><p class="topicauthor">{topicrow.TOPIC_AUTHOR_FULL}</p></td>
- <td class="row1" width="50" align="center"><p class="topicdetails">{topicrow.REPLIES}</p></td>
- <td class="row2" width="50" align="center"><p class="topicdetails">{topicrow.VIEWS}</p></td>
- <td class="row1" width="140" align="center">
- <p class="topicdetails" style="white-space: nowrap;">{topicrow.LAST_POST_TIME}</p>
- <p class="topicdetails">{topicrow.LAST_POST_AUTHOR_FULL}
- <!-- IF not S_IS_BOT --><a href="{topicrow.U_LAST_POST}" class="imageset">{LAST_POST_IMG}</a><!-- ENDIF -->
- </p>
- </td>
- </tr>
-
- <!-- BEGINELSE -->
-
- <tr>
- <!-- IF S_TOPIC_ICONS -->
- <td class="row1" colspan="7" height="30" align="center" valign="middle"><span class="gen"><!-- IF not S_SORT_DAYS -->{L_NO_TOPICS}<!-- ELSE -->{L_NO_TOPICS_TIME_FRAME}<!-- ENDIF --></span></td>
- <!-- ELSE -->
- <td class="row1" colspan="6" height="30" align="center" valign="middle"><span class="gen"><!-- IF not S_SORT_DAYS -->{L_NO_TOPICS}<!-- ELSE -->{L_NO_TOPICS_TIME_FRAME}<!-- ENDIF --></span></td>
- <!-- ENDIF -->
- </tr>
- <!-- END topicrow -->
-
- <tr align="center">
- <td class="cat" colspan="<!-- IF S_TOPIC_ICONS -->7<!-- ELSE -->6<!-- ENDIF -->">&nbsp;</td>
- </tr>
- </table>
-
- <br clear="all" />
-<!-- ENDIF -->
-
-<!-- IF S_HAS_SUBFORUM -->
- <!-- INCLUDE forumlist_body.html -->
- <br clear="all" />
-<!-- ENDIF -->
-
-<!-- IF S_IS_POSTABLE or S_NO_READ_ACCESS -->
- <div id="pageheader">
- <!-- EVENT viewforum_forum_title_before -->
- <h2><!-- EVENT viewforum_forum_name_prepend --><a class="titles" href="{U_VIEW_FORUM}">{FORUM_NAME}</a><!-- EVENT viewforum_forum_name_append --></h2>
- <!-- EVENT viewforum_forum_title_after -->
- <!-- IF MODERATORS -->
- <p class="moderators"><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->{L_COLON} {MODERATORS}</p>
- <!-- ENDIF -->
- <!-- IF U_MCP -->
- <p class="linkmcp">[&nbsp;<!-- IF U_ACP --><a href="{U_ACP}">{L_ACP}</a><!-- IF U_MCP -->&nbsp;|&nbsp;<!-- ENDIF --><!-- ENDIF --><!-- IF U_MCP --><a href="{U_MCP}">{L_MCP}</a><!-- ENDIF -->&nbsp;]</p>
- <!-- ENDIF -->
- </div>
-
- <br clear="all" /><br />
-<!-- ENDIF -->
-
-<div id="pagecontent">
-
-<!-- IF S_NO_READ_ACCESS -->
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <td class="row1" height="30" align="center" valign="middle"><span class="gen">{L_NO_READ_ACCESS}</span></td>
- </tr>
- </table>
-
- <!-- IF not S_USER_LOGGED_IN and not S_IS_BOT -->
-
- <br /><br />
-
- <form method="post" action="{S_LOGIN_ACTION}">
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <td class="cat"><h4><a href="{U_LOGIN_LOGOUT}">{L_LOGIN_LOGOUT}</a></h4></td>
- </tr>
- <tr>
- <td class="row1" align="center"><span class="genmed">{L_USERNAME}{L_COLON}</span> <input class="post" type="text" name="username" size="10" />&nbsp; <span class="genmed">{L_PASSWORD}{L_COLON}</span> <input class="post" type="password" name="password" size="10" autocomplete="off" /><!-- IF S_AUTOLOGIN_ENABLED -->&nbsp; <span class="gensmall">{L_LOG_ME_IN}</span> <input type="checkbox" class="radio" name="autologin" /><!-- ENDIF -->&nbsp; <input type="submit" class="btnmain" name="login" value="{L_LOGIN}" /></td>
- </tr>
- </table>
- {S_LOGIN_REDIRECT}
- </form>
-
- <!-- ENDIF -->
-
- <br clear="all" />
-<!-- ENDIF -->
-
- <!-- 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 -->
- <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>
- <td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- INCLUDE pagination.html --></td>
- <!-- ENDIF -->
- </tr>
- </table>
- <!-- ENDIF -->
-
- <!-- IF not S_DISPLAY_ACTIVE and (S_IS_POSTABLE or .topicrow) -->
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <td class="cat" colspan="<!-- IF S_TOPIC_ICONS -->7<!-- ELSE -->6<!-- ENDIF -->">
- <table width="100%" cellspacing="0">
- <tr class="nav">
- <td valign="middle">&nbsp;<!-- IF U_WATCH_FORUM_LINK and not S_IS_BOT --><a href="{U_WATCH_FORUM_LINK}">{S_WATCH_FORUM_TITLE}</a><!-- ENDIF --></td>
- <td align="{S_CONTENT_FLOW_END}" valign="middle"><!-- IF not S_IS_BOT and U_MARK_TOPICS and .topicrow --><a href="{U_MARK_TOPICS}">{L_MARK_TOPICS_READ}</a><!-- ENDIF -->&nbsp;</td>
- </tr>
- </table>
- </td>
- </tr>
-
- <tr>
- <!-- IF S_TOPIC_ICONS -->
- <th colspan="3">&nbsp;{L_TOPICS}&nbsp;</th>
- <!-- ELSE -->
- <th colspan="2">&nbsp;{L_TOPICS}&nbsp;</th>
- <!-- ENDIF -->
- <th>&nbsp;{L_AUTHOR}&nbsp;</th>
- <th>&nbsp;{L_REPLIES}&nbsp;</th>
- <th>&nbsp;{L_VIEWS}&nbsp;</th>
- <th>&nbsp;{L_LAST_POST}&nbsp;</th>
- </tr>
-
- <!-- BEGIN topicrow -->
-
- <!-- IF topicrow.S_TOPIC_TYPE_SWITCH eq 1 -->
- <tr>
- <td class="row3" colspan="<!-- IF S_TOPIC_ICONS -->7<!-- ELSE -->6<!-- ENDIF -->"><b class="gensmall">{L_ANNOUNCEMENTS}</b></td>
- </tr>
- <!-- ELSEIF topicrow.S_TOPIC_TYPE_SWITCH eq 0 -->
- <tr>
- <td class="row3" colspan="<!-- IF S_TOPIC_ICONS -->7<!-- ELSE -->6<!-- ENDIF -->"><b class="gensmall">{L_TOPICS}</b></td>
- </tr>
- <!-- ENDIF -->
-
- <tr>
- <td class="row1" width="25" align="center">{topicrow.TOPIC_FOLDER_IMG}</td>
- <!-- IF S_TOPIC_ICONS -->
- <td class="row1" width="25" align="center"><!-- IF topicrow.TOPIC_ICON_IMG --><img src="{T_ICONS_PATH}{topicrow.TOPIC_ICON_IMG}" width="{topicrow.TOPIC_ICON_IMG_WIDTH}" height="{topicrow.TOPIC_ICON_IMG_HEIGHT}" alt="" title="" /><!-- ENDIF --></td>
- <!-- ENDIF -->
- <td class="row1">
- <!-- EVENT topiclist_row_prepend -->
- <!-- IF topicrow.S_UNREAD_TOPIC --><a href="{topicrow.U_NEWEST_POST}" class="imageset">{NEWEST_POST_IMG}</a><!-- ENDIF -->
- {topicrow.ATTACH_ICON_IMG} <!-- IF topicrow.S_HAS_POLL or topicrow.S_TOPIC_MOVED --><b>{topicrow.TOPIC_TYPE}</b> <!-- ENDIF -->
- <a title="{L_POSTED}{L_COLON} {topicrow.FIRST_POST_TIME}" href="{topicrow.U_VIEW_TOPIC}" class="topictitle">{topicrow.TOPIC_TITLE}</a>
- <!-- IF topicrow.S_TOPIC_UNAPPROVED or topicrow.S_POSTS_UNAPPROVED -->
- <a href="{topicrow.U_MCP_QUEUE}" class="imageset">{topicrow.UNAPPROVED_IMG}</a>&nbsp;
- <!-- ENDIF -->
- <!-- IF topicrow.S_TOPIC_DELETED -->
- <a href="{topicrow.U_MCP_QUEUE}" class="imageset">{DELETED_IMG}</a>&nbsp;
- <!-- ENDIF -->
- <!-- IF topicrow.S_TOPIC_REPORTED -->
- <a href="{topicrow.U_MCP_REPORT}" class="imageset">{REPORTED_IMG}</a>&nbsp;
- <!-- ENDIF -->
- <!-- IF .topicrow.pagination -->
- <p class="gensmall"> [ {GOTO_PAGE_IMG}{L_GOTO_PAGE}{L_COLON}
- <!-- BEGIN pagination -->
- <!-- IF topicrow.pagination.S_IS_PREV -->
- <!-- ELSEIF topicrow.pagination.S_IS_CURRENT --><strong>{topicrow.pagination.PAGE_NUMBER}</strong>
- <!-- ELSEIF topicrow.pagination.S_IS_ELLIPSIS --> {L_ELLIPSIS}
- <!-- ELSEIF topicrow.pagination.S_IS_NEXT -->
- <!-- ELSE --><a href="{topicrow.pagination.PAGE_URL}">{topicrow.pagination.PAGE_NUMBER}</a>
- <!-- ENDIF -->
- <!-- END pagination -->
- ] </p>
- <!-- ENDIF -->
- <!-- IF topicrow.S_POST_GLOBAL and FORUM_ID != topicrow.FORUM_ID --><p class="gensmall">{L_IN} <a href="{topicrow.U_VIEW_FORUM}">{topicrow.FORUM_NAME}</a></p><!-- ENDIF -->
- <!-- EVENT topiclist_row_append -->
- </td>
- <td class="row2" width="130" align="center"><p class="topicauthor">{topicrow.TOPIC_AUTHOR_FULL}</p></td>
- <td class="row1" width="50" align="center"><p class="topicdetails">{topicrow.REPLIES}</p></td>
- <td class="row2" width="50" align="center"><p class="topicdetails">{topicrow.VIEWS}</p></td>
- <td class="row1" width="140" align="center">
- <p class="topicdetails" style="white-space: nowrap;">{topicrow.LAST_POST_TIME}</p>
- <p class="topicdetails">{topicrow.LAST_POST_AUTHOR_FULL}
- <!-- IF not S_IS_BOT --><a href="{topicrow.U_LAST_POST}" class="imageset">{LAST_POST_IMG}</a><!-- ENDIF -->
- </p>
- </td>
- </tr>
-
- <!-- BEGINELSE -->
- <!-- IF S_IS_POSTABLE -->
- <tr>
- <!-- IF S_TOPIC_ICONS -->
- <td class="row1" colspan="7" height="30" align="center" valign="middle"><span class="gen"><!-- IF not S_SORT_DAYS -->{L_NO_TOPICS}<!-- ELSE -->{L_NO_TOPICS_TIME_FRAME}<!-- ENDIF --></span></td>
- <!-- ELSE -->
- <td class="row1" colspan="6" height="30" align="center" valign="middle"><span class="gen"><!-- IF not S_SORT_DAYS -->{L_NO_TOPICS}<!-- ELSE -->{L_NO_TOPICS_TIME_FRAME}<!-- ENDIF --></span></td>
- <!-- ENDIF -->
- </tr>
- <!-- ENDIF -->
- <!-- END topicrow -->
-
- <!-- IF not S_IS_BOT -->
- <tr align="center">
- <!-- IF S_TOPIC_ICONS -->
- <td class="cat" colspan="7">
- <!-- ELSE -->
- <td class="cat" colspan="6">
- <!-- ENDIF -->
- <form method="post" action="{S_FORUM_ACTION}"><span class="gensmall">{L_DISPLAY_TOPICS}{L_COLON}</span>&nbsp;{S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" name="sort" value="{L_GO}" /></form>
- </td>
- </tr>
- <!-- ENDIF -->
- </table>
- <!-- ENDIF -->
-
- <!-- 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 -->
- <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>
- <td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- INCLUDE pagination.html --></td>
- <!-- ENDIF -->
- </tr>
- </table>
- <!-- ENDIF -->
-
- <br clear="all" />
-</div>
-
-<!-- INCLUDE breadcrumbs.html -->
-
-<!-- IF S_DISPLAY_ONLINE_LIST -->
- <br clear="all" />
-
- <table class="tablebg stat-block online-list" width="100%" cellspacing="1">
- <tr>
- <td class="cat"><h4>{L_WHO_IS_ONLINE}</h4></td>
- </tr>
- <tr>
- <td class="row1"><p class="gensmall">{LOGGED_IN_USER_LIST}</p></td>
- </tr>
- </table>
-<!-- ENDIF -->
-
-<!-- IF S_DISPLAY_POST_INFO -->
- <br clear="all" />
-
- <table width="100%" cellspacing="0">
- <tr>
- <td align="{S_CONTENT_FLOW_BEGIN}" valign="top">
- <table cellspacing="3" cellpadding="0" border="0">
- <tr>
- <td width="20" style="text-align: center;">{FOLDER_UNREAD_IMG}</td>
- <td class="gensmall">{L_UNREAD_POSTS}</td>
- <td>&nbsp;&nbsp;</td>
- <td width="20" style="text-align: center;">{FOLDER_IMG}</td>
- <td class="gensmall">{L_NO_UNREAD_POSTS}</td>
- <td>&nbsp;&nbsp;</td>
- <td width="20" style="text-align: center;">{FOLDER_ANNOUNCE_IMG}</td>
- <td class="gensmall">{L_ICON_ANNOUNCEMENT}</td>
- </tr>
- <tr>
- <td style="text-align: center;">{FOLDER_HOT_UNREAD_IMG}</td>
- <td class="gensmall">{L_UNREAD_POSTS_HOT}</td>
- <td>&nbsp;&nbsp;</td>
- <td style="text-align: center;">{FOLDER_HOT_IMG}</td>
- <td class="gensmall">{L_NO_UNREAD_POSTS_HOT}</td>
- <td>&nbsp;&nbsp;</td>
- <td style="text-align: center;">{FOLDER_STICKY_IMG}</td>
- <td class="gensmall">{L_ICON_STICKY}</td>
- </tr>
- <tr>
- <td style="text-align: center;">{FOLDER_LOCKED_UNREAD_IMG}</td>
- <td class="gensmall">{L_UNREAD_POSTS_LOCKED}</td>
- <td>&nbsp;&nbsp;</td>
- <td style="text-align: center;">{FOLDER_LOCKED_IMG}</td>
- <td class="gensmall">{L_NO_UNREAD_POSTS_LOCKED}</td>
- <td>&nbsp;&nbsp;</td>
- <td style="text-align: center;">{FOLDER_MOVED_IMG}</td>
- <td class="gensmall">{L_TOPIC_MOVED}</td>
- </tr>
- </table>
- </td>
- <td align="{S_CONTENT_FLOW_END}"><span class="gensmall"><!-- BEGIN rules -->{rules.RULE}<br /><!-- END rules --></span></td>
- </tr>
- </table>
-<!-- ENDIF -->
-
-<br clear="all" />
-
-<table width="100%" cellspacing="0">
-<tr>
- <td><!-- IF S_DISPLAY_SEARCHBOX --><!-- INCLUDE searchbox.html --><!-- ENDIF --></td>
- <td align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></td>
-</tr>
-</table>
-
-<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/viewonline_body.html b/phpBB/styles/subsilver2/template/viewonline_body.html
deleted file mode 100644
index 70b8b52efa..0000000000
--- a/phpBB/styles/subsilver2/template/viewonline_body.html
+++ /dev/null
@@ -1,57 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<h4>{TOTAL_REGISTERED_USERS_ONLINE}</h4>
-<h4>{TOTAL_GUEST_USERS_ONLINE}<!-- IF S_SWITCH_GUEST_DISPLAY --> [ <a href="{U_SWITCH_GUEST_DISPLAY}">{L_SWITCH_GUEST_DISPLAY}</a> ]<!-- ENDIF --></h4>
-<br />
-
-<!-- IF .pagination -->
- <table width="100%" cellspacing="1">
- <tr>
- <td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}<br /></td>
- <td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- INCLUDE pagination.html --></td>
- </tr>
- </table>
-<!-- ENDIF -->
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th width="40%"><a href="{U_SORT_USERNAME}">{L_USERNAME}</a></th>
- <th width="20%"><a href="{U_SORT_UPDATED}">{L_LAST_UPDATED}</a></th>
- <th width="40%"><a href="{U_SORT_LOCATION}">{L_FORUM_LOCATION}</a></th>
-</tr>
-<!-- BEGIN user_row -->
- <tr>
- <td class="row1"><p class="gen">{user_row.USERNAME_FULL}</p><!-- IF user_row.USER_IP --><p class="gensmall">{L_IP}{L_COLON} <a href="{user_row.U_USER_IP}">{user_row.USER_IP}</a> &#187; <a href="{user_row.U_WHOIS}" onclick="popup(this.href, 750, 500); return false;">{L_WHOIS}</a></p><!-- ENDIF -->
- <!-- IF user_row.USER_BROWSER -->{user_row.USER_BROWSER}<!-- ENDIF --></td>
- <td class="row2" align="center" nowrap="nowrap"><p class="genmed">&nbsp;{user_row.LASTUPDATE}</p></td>
- <td class="row1"><p class="genmed"><a href="{user_row.U_FORUM_LOCATION}">{user_row.FORUM_LOCATION}</a></p></td>
- </tr>
-<!-- END user_row -->
-
-<!-- IF LEGEND -->
- <tr>
- <td class="row1" colspan="3"><b class="gensmall">{L_LEGEND} :: {LEGEND}</b></td>
- </tr>
-<!-- ENDIF -->
-</table>
-
-<!-- IF .pagination -->
- <table width="100%" cellspacing="1">
- <tr>
- <td class="nav" valign="middle" nowrap="nowrap">&nbsp;{PAGE_NUMBER}<br /></td>
- <td class="gensmall" width="100%" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><!-- INCLUDE pagination.html --></td>
- </tr>
- </table>
-<!-- ENDIF -->
-
-<div class="gensmall" align="{S_CONTENT_FLOW_END}">{L_ONLINE_EXPLAIN}</div>
-
-<br clear="all" />
-
-<!-- INCLUDE breadcrumbs.html -->
-
-<br clear="all" />
-
-<div align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></div>
-
-<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/viewonline_whois.html b/phpBB/styles/subsilver2/template/viewonline_whois.html
deleted file mode 100644
index ca5b326df8..0000000000
--- a/phpBB/styles/subsilver2/template/viewonline_whois.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<!-- INCLUDE simple_header.html -->
-
-<table class="tablebg" width="100%" cellspacing="1">
-<tr>
- <th>{L_WHOIS}</th>
-</tr>
-<tr>
- <td class="row1"><pre>{WHOIS}</pre><br /><a class="nav" href="#" onclick="window.close(); return false;">{L_CLOSE_WINDOW}</a></td>
-</tr>
-</table>
-
-<!-- INCLUDE simple_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/viewtopic_body.html b/phpBB/styles/subsilver2/template/viewtopic_body.html
deleted file mode 100644
index ea64bc837f..0000000000
--- a/phpBB/styles/subsilver2/template/viewtopic_body.html
+++ /dev/null
@@ -1,459 +0,0 @@
-<!-- INCLUDE overall_header.html -->
-
-<!-- IF S_FORUM_RULES -->
- <div class="forumrules<!-- IF U_FORUM_RULES --> rules-link<!-- ENDIF -->">
- <!-- IF U_FORUM_RULES -->
- <h3>{L_FORUM_RULES}</h3><br />
- <a href="{U_FORUM_RULES}"><b>{L_FORUM_RULES_LINK}</b></a>
- <!-- ELSE -->
- <h3>{L_FORUM_RULES}</h3><br />
- {FORUM_RULES}
- <!-- ENDIF -->
- </div>
-
- <br clear="all" />
-<!-- ENDIF -->
-
-<div id="pageheader">
- <h2><!-- EVENT viewtopic_topic_title_prepend --><a class="titles" href="{U_VIEW_TOPIC}">{TOPIC_TITLE}</a><!-- EVENT viewtopic_topic_title_append --></h2>
- <!-- EVENT viewtopic_topic_title_after -->
-
-<!-- IF MODERATORS -->
- <p class="moderators"><!-- IF S_SINGLE_MODERATOR -->{L_MODERATOR}<!-- ELSE -->{L_MODERATORS}<!-- ENDIF -->{L_COLON} {MODERATORS}</p>
-<!-- ENDIF -->
-<!-- IF U_MCP -->
- <p class="linkmcp">[&nbsp;<!-- IF U_ACP --><a href="{U_ACP}">{L_ACP}</a><!-- IF U_MCP -->&nbsp;|&nbsp;<!-- ENDIF --><!-- ENDIF --><!-- IF U_MCP --><a href="{U_MCP}">{L_MCP}</a><!-- ENDIF -->&nbsp;]</p>
-<!-- ENDIF -->
-</div>
-
-<br clear="all" /><br />
-
-<div id="pagecontent">
-
- <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 --><!-- EVENT viewtopic_body_pagination_top_after --></td>
- <!-- ENDIF -->
- </tr>
- </table>
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <td class="cat">
- <table width="100%" cellspacing="0">
- <tr>
- <td class="nav" nowrap="nowrap">&nbsp;
- <!-- IF not S_IS_BOT -->
- <!-- IF U_WATCH_TOPIC --><a href="{U_WATCH_TOPIC}" title="{S_WATCH_TOPIC_TITLE}">{S_WATCH_TOPIC_TITLE}</a><!-- IF U_PRINT_TOPIC or U_EMAIL_TOPIC or U_BUMP_TOPIC or U_BOOKMARK_TOPIC --> | <!-- ENDIF --><!-- ENDIF -->
- <!-- IF U_BOOKMARK_TOPIC --><a href="{U_BOOKMARK_TOPIC}" title="{S_BOOKMARK_TOPIC}">{S_BOOKMARK_TOPIC}</a><!-- IF U_PRINT_TOPIC or U_EMAIL_TOPIC or U_BUMP_TOPIC --> | <!-- ENDIF --><!-- ENDIF -->
- <!-- IF U_PRINT_TOPIC --><a href="{U_PRINT_TOPIC}" title="{L_PRINT_TOPIC}">{L_PRINT_TOPIC}</a><!-- IF U_EMAIL_TOPIC or U_BUMP_TOPIC --> | <!-- ENDIF --><!-- ENDIF -->
- <!-- IF U_EMAIL_TOPIC --><a href="{U_EMAIL_TOPIC}" title="{L_EMAIL_TOPIC}">{L_EMAIL_TOPIC}</a><!-- IF U_BUMP_TOPIC --> | <!-- ENDIF --><!-- ENDIF -->
- <!-- IF U_BUMP_TOPIC --><a href="{U_BUMP_TOPIC}" title="{L_BUMP_TOPIC}">{L_BUMP_TOPIC}</a><!-- ENDIF -->
- <!-- ENDIF -->
- </td>
- <td class="nav" align="{S_CONTENT_FLOW_END}" nowrap="nowrap"><a href="{U_VIEW_OLDER_TOPIC}">{L_VIEW_PREVIOUS_TOPIC}</a><!-- IF U_VIEW_UNREAD_POST and not S_IS_BOT --> | <a href="{U_VIEW_UNREAD_POST}">{L_VIEW_UNREAD_POST}</a><!-- ENDIF --> | <a href="{U_VIEW_NEWER_TOPIC}">{L_VIEW_NEXT_TOPIC}</a>&nbsp;</td>
- </tr>
- </table>
- </td>
- </tr>
-<!-- EVENT viewtopic_body_poll_before -->
-<!-- IF S_HAS_POLL -->
- <tr>
- <td class="row2" colspan="2" align="center"><br clear="all" />
-
- <form method="post" action="{S_POLL_ACTION}">
-
- <table cellspacing="0" cellpadding="4" border="0" align="center">
- <tr>
- <td align="center"><span class="gen"><!-- EVENT viewtopic_body_poll_question_prepend --><b>{POLL_QUESTION}</b><!-- EVENT viewtopic_body_poll_question_append --></span><br /><span class="gensmall">{L_POLL_LENGTH}</span></td>
- </tr>
- <tr>
- <td align="{S_CONTENT_FLOW_BEGIN}">
- <table cellspacing="0" cellpadding="2" border="0">
- <!-- BEGIN poll_option -->
- <tr>
- <!-- EVENT viewtopic_body_poll_option_before -->
- <!-- IF S_CAN_VOTE -->
- <td<!-- IF poll_option.POLL_OPTION_MOST_VOTES --> class="most-votes"<!-- ENDIF -->>
- <!-- IF S_IS_MULTI_CHOICE -->
- <input type="checkbox" class="radio" name="vote_id[]" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> />
- <!-- ELSE -->
- <input type="radio" class="radio" name="vote_id[]" value="{poll_option.POLL_OPTION_ID}"<!-- IF poll_option.POLL_OPTION_VOTED --> checked="checked"<!-- ENDIF --> />
- <!-- ENDIF -->
- </td>
- <!-- ENDIF -->
- <td><span class="gen">{poll_option.POLL_OPTION_CAPTION}</span></td>
- <!-- IF S_DISPLAY_RESULTS -->
- <td dir="ltr">{POLL_LEFT_CAP_IMG}<span class="imageset poll_center" style="width: {poll_option.POLL_OPTION_WIDTH}px; background-repeat: repeat-x;">{poll_option.POLL_OPTION_PERCENT}</span>{POLL_RIGHT_CAP_IMG}</td>
- <td class="gen" align="{S_CONTENT_FLOW_END}"><b>&nbsp;{poll_option.POLL_OPTION_PERCENT}&nbsp;</b></td>
- <td class="gen" align="center">[ {poll_option.POLL_OPTION_RESULT} ]</td>
- <!-- IF poll_option.POLL_OPTION_VOTED -->
- <td class="gensmall" valign="top"><b title="{L_POLL_VOTED_OPTION}">x</b></td>
- <!-- ENDIF -->
- <!-- ENDIF -->
- <!-- EVENT viewtopic_body_poll_option_after -->
- </tr>
- <!-- END poll_option -->
- </table>
- </td>
- </tr>
- <!-- IF S_CAN_VOTE -->
- <tr>
- <td align="center"><span class="gensmall">{L_MAX_VOTES}</span><br /><br /><input type="submit" name="update" value="{L_SUBMIT_VOTE}" class="btnlite" /></td>
- </tr>
- <!-- ENDIF -->
- <!-- IF S_DISPLAY_RESULTS -->
- <tr>
- <td class="gensmall" colspan="4" align="center"><b>{L_TOTAL_VOTES}{L_COLON} {TOTAL_VOTES}</b></td>
- </tr>
- <!-- ELSE -->
- <tr>
- <td align="center"><span class="gensmall"><b><a href="{U_VIEW_RESULTS}">{L_VIEW_RESULTS}</a></b></span></td>
- </tr>
- <!-- ENDIF -->
- </table>
- {S_HIDDEN_FIELDS}
- {S_FORM_TOKEN}
- </form>
-
- </td>
- </tr>
-<!-- ENDIF -->
-<!-- EVENT viewtopic_body_poll_after -->
- </table>
-
-<!-- BEGIN postrow -->
- <!-- EVENT viewtopic_body_postrow_post_before -->
- <table class="tablebg" width="100%" cellspacing="1">
- <!-- IF postrow.S_FIRST_ROW -->
- <tr>
- <th>{L_AUTHOR}</th>
- <th>{L_MESSAGE}</th>
- </tr>
- <!-- ENDIF -->
- <!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
-
- <!-- IF postrow.S_POST_HIDDEN -->
- <td class="gensmall" colspan="2" height="25" align="center">
- <!-- IF postrow.S_FIRST_UNREAD --><a id="unread" class="anchor" data-url="{postrow.U_MINI_POST}"></a><!-- ENDIF -->
- <a name="p{postrow.POST_ID}" class="anchor"></a>
- <!-- IF postrow.S_POST_HIDDEN -->
- <!-- IF postrow.S_POST_DELETED -->
- {postrow.L_POST_DELETED_MESSAGE}
- <!-- ELSEIF postrow.S_IGNORE_POST -->
- {postrow.L_IGNORE_POST}
- <!-- ENDIF -->
- <br />{postrow.L_POST_DISPLAY}
- <!-- ENDIF -->
- </td>
- <!-- ELSE -->
-
- <td align="center" valign="middle">
- <!-- IF postrow.S_FIRST_UNREAD -->
- <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>
- <!-- IF postrow.POST_ICON_IMG -->
- <td><img src="{T_ICONS_PATH}{postrow.POST_ICON_IMG}" width="{postrow.POST_ICON_IMG_WIDTH}" height="{postrow.POST_ICON_IMG_HEIGHT}" alt="" title="" /></td>
- <!-- ENDIF -->
- <td class="gensmall" width="100%"><div style="float: {S_CONTENT_FLOW_BEGIN};">&nbsp;<b>{L_POST_SUBJECT}{L_COLON}</b> <a href="#p{postrow.POST_ID}">{postrow.POST_SUBJECT}</a></div><div style="float: {S_CONTENT_FLOW_END};"><!-- IF S_IS_BOT -->{postrow.MINI_POST_IMG}<!-- ELSE --><a href="{postrow.U_MINI_POST}" class="imageset">{postrow.MINI_POST_IMG}</a><!-- ENDIF --><b>{L_POSTED}{L_COLON}</b> {postrow.POST_DATE}&nbsp;</div></td>
- </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 -->
-
- <td valign="top" class="profile">
- <table cellspacing="4" align="center" width="150">
- <!-- IF postrow.ONLINE_IMG -->
- <tr>
- <td>{postrow.ONLINE_IMG}</td>
- </tr>
- <!-- ENDIF -->
- <!-- EVENT viewtopic_body_postrow_rank_before -->
- <!-- IF postrow.RANK_TITLE -->
- <tr>
- <td class="postdetails">{postrow.RANK_TITLE}</td>
- </tr>
- <!-- ENDIF -->
- <!-- IF postrow.RANK_IMG -->
- <tr>
- <td>{postrow.RANK_IMG}</td>
- </tr>
- <!-- ENDIF -->
- <!-- EVENT viewtopic_body_postrow_rank_after -->
-
- <!-- EVENT viewtopic_body_avatar_before -->
- <!-- IF postrow.POSTER_AVATAR -->
- <tr>
- <td>{postrow.POSTER_AVATAR}</td>
- </tr>
- <!-- ENDIF -->
- <!-- EVENT viewtopic_body_avatar_after -->
-
- <!-- IF not (postrow.ONLINE_IMG or postrow.RANK_TITLE or postrow.RANK_IMG or postrow.POSTER_AVATAR) -->
- <tr>
- <td></td>
- </tr>
- <!-- ENDIF -->
- </table>
-
- <span class="postdetails">
- <!-- IF postrow.POSTER_JOINED --><br /><b>{L_JOINED}{L_COLON}</b> {postrow.POSTER_JOINED}<!-- ENDIF -->
- <!-- IF postrow.POSTER_POSTS != '' --><br /><b>{L_POSTS}{L_COLON}</b> {postrow.POSTER_POSTS}<!-- ENDIF -->
- <!-- IF postrow.POSTER_WARNINGS --><br /><b>{L_WARNINGS}{L_COLON}</b> {postrow.POSTER_WARNINGS}<!-- ENDIF -->
-
- <!-- IF postrow.S_PROFILE_FIELD1 -->
- <!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
- <br /><b>{postrow.PROFILE_FIELD1_NAME}{L_COLON}</b> {postrow.PROFILE_FIELD1_VALUE}
- <!-- ENDIF -->
-
- <!-- EVENT viewtopic_body_postrow_custom_fields_before -->
- <!-- BEGIN custom_fields -->
- <!-- IF not postrow.custom_fields.S_PROFILE_CONTACT -->
- <br /><b>{postrow.custom_fields.PROFILE_FIELD_NAME}{L_COLON}</b> {postrow.custom_fields.PROFILE_FIELD_VALUE}
- <!-- ENDIF -->
- <!-- END custom_fields -->
- <!-- EVENT viewtopic_body_postrow_custom_fields_after -->
- </span>
-
- </td>
- <td valign="top">
- <table width="100%" cellspacing="5">
- <tr>
- <td>
- <!-- IF postrow.S_POST_UNAPPROVED or postrow.S_POST_DELETED or postrow.S_POST_REPORTED -->
- <table width="100%" cellspacing="0">
- <tr>
- <td class="gensmall">
- <!-- IF postrow.S_POST_UNAPPROVED --><span class="postapprove">{UNAPPROVED_IMG} <a href="{postrow.U_MCP_APPROVE}">{L_POST_UNAPPROVED}</a></span><br /> <!-- ENDIF -->
- <!-- IF postrow.S_POST_DELETED --><span class="postapprove">{DELETED_IMG} <a href="{postrow.U_MCP_RESTORE}">{L_POST_DELETED}</a></span><br /> <!-- ENDIF -->
- <!-- IF postrow.S_POST_REPORTED --><span class="postreported">{REPORTED_IMG} <a href="{postrow.U_MCP_REPORT}">{L_POST_REPORTED}</a></span><!-- ENDIF -->
- </td>
- </tr>
- </table>
-
- <br clear="all" />
- <!-- ENDIF -->
-
- <div class="postbody">{postrow.MESSAGE}</div>
-
- <!-- IF postrow.S_HAS_ATTACHMENTS -->
- <br clear="all" /><br />
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <td class="row3"><b class="genmed">{L_ATTACHMENTS}{L_COLON} </b></td>
- </tr>
- <!-- BEGIN attachment -->
- <tr>
- <!-- IF postrow.attachment.S_ROW_COUNT is even --><td class="row2"><!-- ELSE --><td class="row1"><!-- ENDIF -->{postrow.attachment.DISPLAY_ATTACHMENT}</td>
- </tr>
- <!-- END attachment -->
- </table>
- <!-- ENDIF -->
-
- <!-- IF postrow.S_DISPLAY_NOTICE -->
- <span class="gensmall error"><br /><br />{L_DOWNLOAD_NOTICE}</span>
- <!-- ENDIF -->
- <!-- IF postrow.SIGNATURE -->
- <div class="postbody"><br />_________________<br />{postrow.SIGNATURE}</div>
- <!-- ENDIF -->
-
- <!-- EVENT viewtopic_body_postrow_post_notices_before -->
- <!-- IF postrow.DELETED_MESSAGE or postrow.DELETE_REASON -->
- <!-- IF postrow.DELETE_REASON -->
- <br /><br />
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <td class="row3"><span class="gensmall">{postrow.DELETED_MESSAGE}</span></td>
- </tr>
- <tr>
- <td class="row2"><span class="genmed">{postrow.DELETE_REASON}</span></td>
- </tr>
- </table>
- <!-- ELSE -->
- <br /><br />
- <span class="gensmall">{postrow.DELETED_MESSAGE}</span>
- <!-- ENDIF -->
- <!-- ELSEIF postrow.EDITED_MESSAGE or postrow.EDIT_REASON -->
- <!-- IF postrow.EDIT_REASON -->
- <br /><br />
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <td class="row3"><span class="gensmall">{postrow.EDITED_MESSAGE}</span></td>
- </tr>
- <tr>
- <td class="row2"><span class="genmed">{postrow.EDIT_REASON}</span></td>
- </tr>
- </table>
- <!-- ELSE -->
- <br /><br />
- <span class="gensmall">{postrow.EDITED_MESSAGE}</span>
- <!-- ENDIF -->
- <!-- ENDIF -->
-
- <!-- IF postrow.BUMPED_MESSAGE -->
- <span class="gensmall"><br /><br />{postrow.BUMPED_MESSAGE}</span>
- <!-- ENDIF -->
- <!-- EVENT viewtopic_body_postrow_post_notices_after -->
-
- <!-- EVENT viewtopic_body_postrow_post_content_footer -->
-
- <!-- IF not postrow.S_HAS_ATTACHMENTS --><br clear="all" /><br /><!-- ENDIF -->
-
- <table width="100%" cellspacing="0">
- <tr valign="middle">
- <td class="gensmall" align="{S_CONTENT_FLOW_END}">
- <!-- IF not S_IS_BOT -->
- <!-- IF postrow.U_REPORT --><a href="{postrow.U_REPORT}" class="imageset">{REPORT_IMG}</a> <!-- ENDIF -->
- <!-- IF postrow.U_INFO --><a href="{postrow.U_INFO}" class="imageset">{INFO_IMG}</a> <!-- ENDIF -->
- <!-- IF postrow.U_WARN --><a href="{postrow.U_WARN}" class="imageset">{WARN_IMG}</a> <!-- ENDIF -->
- <!-- IF postrow.U_DELETE --><a href="{postrow.U_DELETE}" class="imageset">{DELETE_IMG}</a> <!-- ENDIF -->
- <!-- ENDIF -->
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
-
- <!-- IF postrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF -->
-
- <td class="profile"><strong><a href="#wrapheader">{L_BACK_TO_TOP}</a></strong></td>
- <td>
- <div class="gensmall" style="float: {S_CONTENT_FLOW_BEGIN};">
- &nbsp;<!-- IF postrow.U_POST_AUTHOR --><a href="{postrow.U_POST_AUTHOR}" class="imageset">{PROFILE_IMG}</a><!-- ENDIF -->
- <!-- IF postrow.U_PM --><a href="{postrow.U_PM}" class="imageset">{PM_IMG}</a><!-- ENDIF -->
- <!-- IF postrow.U_EMAIL --><a href="{postrow.U_EMAIL}" class="imageset">{EMAIL_IMG}</a><!-- ENDIF -->
- &nbsp;</div>
- <div class="gensmall" style="float: {S_CONTENT_FLOW_END};">
- <!-- EVENT viewtopic_body_post_buttons_before -->
- <!-- IF not S_IS_BOT -->
- <!-- IF postrow.U_EDIT --><a href="{postrow.U_EDIT}" class="imageset">{EDIT_IMG}</a><!-- ENDIF -->
- <!-- IF postrow.U_QUOTE --><a href="{postrow.U_QUOTE}" class="imageset">{QUOTE_IMG}</a><!-- ENDIF -->
- <!-- ENDIF -->
- <!-- EVENT viewtopic_body_post_buttons_after -->
- &nbsp;</div>
- </td>
- <!-- ENDIF -->
- </tr>
-
- <tr>
- <td class="spacer" colspan="2" height="1"><img src="images/spacer.gif" alt="" width="1" height="1" /></td>
- </tr>
- </table>
- <!-- EVENT viewtopic_body_postrow_post_after -->
-<!-- END postrow -->
-
- <!-- IF not S_IS_BOT -->
- <table width="100%" cellspacing="1" class="tablebg">
- <tr align="center">
- <td class="cat"><form name="viewtopic" method="post" action="{S_TOPIC_ACTION}"><span class="gensmall">{L_DISPLAY_POSTS}{L_COLON}</span> {S_SELECT_SORT_DAYS}&nbsp;<span class="gensmall">{L_SORT_BY}</span> {S_SELECT_SORT_KEY} {S_SELECT_SORT_DIR}&nbsp;<input class="btnlite" type="submit" value="{L_GO}" name="sort" /></form></td>
- </tr>
- </table>
- <!-- ENDIF -->
-
- <!-- EVENT viewtopic_body_topic_actions_before -->
-
- <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>
- <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>
- <!-- ENDIF -->
- </tr>
- </table>
-
-</div>
-
-<div id="pagefooter"></div>
-
-<br clear="all" />
-<!-- IF S_QUICK_REPLY -->
-<!-- INCLUDE quickreply_editor.html -->
-<!-- ENDIF -->
-
-<!-- EVENT viewtopic_body_footer_before -->
-<!-- INCLUDE breadcrumbs.html -->
-
-<!-- IF S_DISPLAY_ONLINE_LIST -->
- <br clear="all" />
-
- <table class="tablebg stat-block online-list" width="100%" cellspacing="1">
- <tr>
- <td class="cat"><h4>{L_WHO_IS_ONLINE}</h4></td>
- </tr>
- <tr>
- <td class="row1"><p class="gensmall">{LOGGED_IN_USER_LIST}</p></td>
- </tr>
- </table>
-<!-- ENDIF -->
-
-<br clear="all" />
-
-<table width="100%" cellspacing="1">
-<tr>
- <td width="40%" valign="top" nowrap="nowrap" align="{S_CONTENT_FLOW_BEGIN}">
- <!-- IF .quickmod -->
- <form method="post" action="{S_MOD_ACTION}">
- <span class="gensmall">{L_QUICK_MOD}{L_COLON}</span>
- <select name="action" id="quick-mod-select">
- <!-- BEGIN quickmod -->
- <option value="{quickmod.VALUE}">{quickmod.TITLE}</option>
- <!-- END quickmod -->
- </select>
- <input class="btnlite" type="submit" value="{L_GO}" />
- </form>
- <!-- ENDIF -->
- </td>
- <td align="{S_CONTENT_FLOW_END}" valign="top" nowrap="nowrap"><span class="gensmall"><!-- BEGIN rules -->{rules.RULE}<br /><!-- END rules --></span></td>
-</tr>
-</table>
-
-<br clear="all" />
-
-<table width="100%" cellspacing="0">
-<tr>
- <td><!-- IF S_DISPLAY_SEARCHBOX --><!-- INCLUDE searchbox.html --><!-- ENDIF --></td>
- <td align="{S_CONTENT_FLOW_END}"><!-- INCLUDE jumpbox.html --></td>
-</tr>
-</table>
-
-<!-- INCLUDE overall_footer.html -->
diff --git a/phpBB/styles/subsilver2/template/viewtopic_print.html b/phpBB/styles/subsilver2/template/viewtopic_print.html
deleted file mode 100644
index 9497fda121..0000000000
--- a/phpBB/styles/subsilver2/template/viewtopic_print.html
+++ /dev/null
@@ -1,135 +0,0 @@
-<!DOCTYPE html>
-<html dir="{S_CONTENT_DIRECTION}" lang="{S_USER_LANG}">
-<head>
-<meta charset="utf-8" />
-<meta name="robots" content="noindex" />
-<title>{SITENAME} :: {PAGE_TITLE}</title>
-
-<style type="text/css">
-<!--
-
-body {
- font-family: Verdana,serif;
- font-size: 10pt;
-}
-
-img {
- border: 0;
-}
-
-td {
- font-family: Verdana,serif;
- font-size: 10pt;
- line-height: 150%;
-}
-
-.code, .codecontent,
-.quote, .quotecontent {
- margin: 0 5px 0 5px;
- padding: 5px;
- font-size: smaller;
- border: black solid 1px;
-}
-
-.quotetitle {
- color: black;
- display : block;
- font-weight: bold;
-}
-
-.forum {
- font-family: Arial,Helvetica,sans-serif;
- font-weight: bold;
- font-size: 18pt;
-}
-
-.topic {
- font-family: Arial,Helvetica,sans-serif;
- font-size: 14pt;
- font-weight: bold;
-}
-
-.gensmall {
- font-size: 8pt;
-}
-
-hr {
- color: #888;
- height: 3px;
- border-style: solid;
-}
-
-hr.sep {
- color: #aaa;
- height: 1px;
- border-style: dashed;
-}
-//-->
-</style>
-<!-- EVENT viewtopic_print_head_append -->
-</head>
-<body>
-
-<table width="85%" cellspacing="3" cellpadding="0" border="0" align="center">
-<tr>
- <td colspan="2" align="center"><span class="Forum">{SITENAME}</span><br /><span class="gensmall"><a href="{U_FORUM}">{U_FORUM}</a></span></td>
-</tr>
-<tr>
- <td colspan="2"><br /></td>
-</tr>
-<tr>
- <td><span class="topic">{TOPIC_TITLE}</span><br /><span class="gensmall"><a href="{U_TOPIC}">{U_TOPIC}</a></span></td>
- <td align="{S_CONTENT_FLOW_END}" valign="bottom"><span class="gensmall">{PAGE_NUMBER}</span></td>
-</tr>
-</table>
-
-<!-- BEGIN postrow -->
-
- <hr width="85%" />
-
- <table width="85%" cellspacing="3" cellpadding="0" border="0" align="center">
- <tr>
- <td width="10%" nowrap="nowrap">{L_AUTHOR}{L_COLON}&nbsp;</td>
- <td><b>{postrow.POST_AUTHOR}</b> [ {postrow.POST_DATE} ]</td>
- </tr>
- <tr>
- <td width="10%" nowrap="nowrap">{L_POST_SUBJECT}{L_COLON}&nbsp;</td>
- <td><b>{postrow.POST_SUBJECT}</b></td>
- </tr>
- <tr>
- <td colspan="2"><hr class="sep" />{postrow.MESSAGE}
-
- <!-- IF postrow.S_HAS_ATTACHMENTS -->
- <br clear="all" /><br />
-
- <table class="tablebg" width="100%" cellspacing="1">
- <tr>
- <td><b class="genmed">{L_ATTACHMENTS}{L_COLON} </b></td>
- </tr>
- <!-- BEGIN attachment -->
- <tr>
- <td>{postrow.attachment.DISPLAY_ATTACHMENT}</td>
- </tr>
- <!-- END attachment -->
- </table>
- <!-- ENDIF -->
-
- </td>
- </tr>
- </table>
-<!-- END postrow -->
-
-<hr width="85%" />
-
-<table width="85%" cellspacing="3" cellpadding="0" border="0" align="center">
-<tr>
- <td><span class="gensmall">{PAGE_NUMBER}</span></td>
- <td align="{S_CONTENT_FLOW_END}"><span class="gensmall">{S_TIMEZONE}</span></td>
-</tr>
-<tr>
- <td colspan="2" align="center"><span class="gensmall">Powered by phpBB&reg; Forum Software &copy; phpBB Limited<br />https://www.phpbb.com/</span></td>
-</tr>
-</table>
-
-</body>
-</html>
diff --git a/phpBB/styles/subsilver2/theme/en/button_pm_new.gif b/phpBB/styles/subsilver2/theme/en/button_pm_new.gif
deleted file mode 100644
index 07df748d3a..0000000000
--- a/phpBB/styles/subsilver2/theme/en/button_pm_new.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/en/button_pm_reply.gif b/phpBB/styles/subsilver2/theme/en/button_pm_reply.gif
deleted file mode 100644
index c476f06a44..0000000000
--- a/phpBB/styles/subsilver2/theme/en/button_pm_reply.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/en/button_topic_locked.gif b/phpBB/styles/subsilver2/theme/en/button_topic_locked.gif
deleted file mode 100644
index 124a2d4a7d..0000000000
--- a/phpBB/styles/subsilver2/theme/en/button_topic_locked.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/en/button_topic_new.gif b/phpBB/styles/subsilver2/theme/en/button_topic_new.gif
deleted file mode 100644
index 66e1007129..0000000000
--- a/phpBB/styles/subsilver2/theme/en/button_topic_new.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/en/button_topic_reply.gif b/phpBB/styles/subsilver2/theme/en/button_topic_reply.gif
deleted file mode 100644
index e8fe5115a0..0000000000
--- a/phpBB/styles/subsilver2/theme/en/button_topic_reply.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/en/icon_contact_aim.gif b/phpBB/styles/subsilver2/theme/en/icon_contact_aim.gif
deleted file mode 100644
index c6533e2817..0000000000
--- a/phpBB/styles/subsilver2/theme/en/icon_contact_aim.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/en/icon_contact_email.gif b/phpBB/styles/subsilver2/theme/en/icon_contact_email.gif
deleted file mode 100644
index f126a1960d..0000000000
--- a/phpBB/styles/subsilver2/theme/en/icon_contact_email.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/en/icon_contact_icq.gif b/phpBB/styles/subsilver2/theme/en/icon_contact_icq.gif
deleted file mode 100644
index ba3fa12436..0000000000
--- a/phpBB/styles/subsilver2/theme/en/icon_contact_icq.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/en/icon_contact_jabber.gif b/phpBB/styles/subsilver2/theme/en/icon_contact_jabber.gif
deleted file mode 100644
index be2e53f9c2..0000000000
--- a/phpBB/styles/subsilver2/theme/en/icon_contact_jabber.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/en/icon_contact_msnm.gif b/phpBB/styles/subsilver2/theme/en/icon_contact_msnm.gif
deleted file mode 100644
index 1bf681e9a2..0000000000
--- a/phpBB/styles/subsilver2/theme/en/icon_contact_msnm.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/en/icon_contact_pm.gif b/phpBB/styles/subsilver2/theme/en/icon_contact_pm.gif
deleted file mode 100644
index 26ac558c2f..0000000000
--- a/phpBB/styles/subsilver2/theme/en/icon_contact_pm.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/en/icon_contact_www.gif b/phpBB/styles/subsilver2/theme/en/icon_contact_www.gif
deleted file mode 100644
index 14a33b36a5..0000000000
--- a/phpBB/styles/subsilver2/theme/en/icon_contact_www.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/en/icon_contact_yahoo.gif b/phpBB/styles/subsilver2/theme/en/icon_contact_yahoo.gif
deleted file mode 100644
index d11711789f..0000000000
--- a/phpBB/styles/subsilver2/theme/en/icon_contact_yahoo.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/en/icon_post_delete.gif b/phpBB/styles/subsilver2/theme/en/icon_post_delete.gif
deleted file mode 100644
index e008e5ff9f..0000000000
--- a/phpBB/styles/subsilver2/theme/en/icon_post_delete.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/en/icon_post_edit.gif b/phpBB/styles/subsilver2/theme/en/icon_post_edit.gif
deleted file mode 100644
index 1511ee34d3..0000000000
--- a/phpBB/styles/subsilver2/theme/en/icon_post_edit.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/en/icon_post_info.gif b/phpBB/styles/subsilver2/theme/en/icon_post_info.gif
deleted file mode 100644
index 166de2724f..0000000000
--- a/phpBB/styles/subsilver2/theme/en/icon_post_info.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/en/icon_post_quote.gif b/phpBB/styles/subsilver2/theme/en/icon_post_quote.gif
deleted file mode 100644
index 4cf103280c..0000000000
--- a/phpBB/styles/subsilver2/theme/en/icon_post_quote.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/en/icon_post_report.gif b/phpBB/styles/subsilver2/theme/en/icon_post_report.gif
deleted file mode 100644
index 9a3f65b1e3..0000000000
--- a/phpBB/styles/subsilver2/theme/en/icon_post_report.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/en/icon_user_offline.gif b/phpBB/styles/subsilver2/theme/en/icon_user_offline.gif
deleted file mode 100644
index 3065f4d7fe..0000000000
--- a/phpBB/styles/subsilver2/theme/en/icon_user_offline.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/en/icon_user_online.gif b/phpBB/styles/subsilver2/theme/en/icon_user_online.gif
deleted file mode 100644
index b950612c57..0000000000
--- a/phpBB/styles/subsilver2/theme/en/icon_user_online.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/en/icon_user_profile.gif b/phpBB/styles/subsilver2/theme/en/icon_user_profile.gif
deleted file mode 100644
index d9cf7f4c4a..0000000000
--- a/phpBB/styles/subsilver2/theme/en/icon_user_profile.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/en/icon_user_search.gif b/phpBB/styles/subsilver2/theme/en/icon_user_search.gif
deleted file mode 100644
index 46475fbf4c..0000000000
--- a/phpBB/styles/subsilver2/theme/en/icon_user_search.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/en/icon_user_warn.gif b/phpBB/styles/subsilver2/theme/en/icon_user_warn.gif
deleted file mode 100644
index 44cbcc953a..0000000000
--- a/phpBB/styles/subsilver2/theme/en/icon_user_warn.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/en/stylesheet.css b/phpBB/styles/subsilver2/theme/en/stylesheet.css
deleted file mode 100644
index 57f9fce26d..0000000000
--- a/phpBB/styles/subsilver2/theme/en/stylesheet.css
+++ /dev/null
@@ -1,116 +0,0 @@
-/* EN Language Pack */
-.imageset.phpbb_aol-icon, .imageset.icon_contact_aim {
- background-image: url("./icon_contact_aim.gif");
- padding-left: 72px;
- padding-top: 20px;
-}
-.imageset.icon_contact_email {
- background-image: url("./icon_contact_email.gif");
- padding-left: 72px;
- padding-top: 20px;
-}
-.imageset.phpbb_icq-icon, .imageset.icon_contact_icq {
- background-image: url("./icon_contact_icq.gif");
- padding-left: 72px;
- padding-top: 20px;
-}
-.imageset.icon_contact_jabber {
- background-image: url("./icon_contact_jabber.gif");
- padding-left: 72px;
- padding-top: 20px;
-}
-.imageset.phpbb_wlm-icon, .imageset.icon_contact_msnm {
- background-image: url("./icon_contact_msnm.gif");
- padding-left: 72px;
- padding-top: 20px;
-}
-.imageset.icon_contact_pm {
- background-image: url("./icon_contact_pm.gif");
- padding-left: 72px;
- padding-top: 20px;
-}
-.imageset.phpbb_yahoo-icon, .imageset.icon_contact_yahoo {
- background-image: url("./icon_contact_yahoo.gif");
- padding-left: 72px;
- padding-top: 20px;
-}
-.imageset.phpbb_website-icon, .imageset.icon_contact_www {
- background-image: url("./icon_contact_www.gif");
- padding-left: 72px;
- padding-top: 20px;
-}
-.imageset.icon_post_delete {
- background-image: url("./icon_post_delete.gif");
- padding-left: 20px;
- padding-top: 20px;
-}
-.imageset.icon_post_edit {
- background-image: url("./icon_post_edit.gif");
- padding-left: 90px;
- padding-top: 20px;
-}
-.imageset.icon_post_info {
- background-image: url("./icon_post_info.gif");
- padding-left: 20px;
- padding-top: 20px;
-}
-.imageset.icon_post_quote {
- background-image: url("./icon_post_quote.gif");
- padding-left: 90px;
- padding-top: 20px;
-}
-.imageset.icon_post_report {
- background-image: url("./icon_post_report.gif");
- padding-left: 20px;
- padding-top: 20px;
-}
-.imageset.icon_user_online {
- background-image: url("./icon_user_online.gif");
- padding-left: 72px;
- padding-top: 20px;
-}
-.imageset.icon_user_offline {
- background-image: url("./icon_user_offline.gif");
- padding-left: 72px;
- padding-top: 20px;
-}
-.imageset.icon_user_profile {
- background-image: url("./icon_user_profile.gif");
- padding-left: 72px;
- padding-top: 20px;
-}
-.imageset.icon_user_search {
- background-image: url("./icon_user_search.gif");
- padding-left: 72px;
- padding-top: 20px;
-}
-.imageset.icon_user_warn {
- background-image: url("./icon_user_warn.gif");
- padding-left: 20px;
- padding-top: 20px;
-}
-.imageset.button_pm_new {
- background-image: url("./button_pm_new.gif");
- padding-left: 97px;
- padding-top: 27px;
-}
-.imageset.button_pm_reply {
- background-image: url("./button_pm_reply.gif");
- padding-left: 90px;
- padding-top: 20px;
-}
-.imageset.button_topic_locked {
- background-image: url("./button_topic_locked.gif");
- padding-left: 97px;
- padding-top: 27px;
-}
-.imageset.button_topic_new {
- background-image: url("./button_topic_new.gif");
- padding-left: 97px;
- padding-top: 27px;
-}
-.imageset.button_topic_reply {
- background-image: url("./button_topic_reply.gif");
- padding-left: 97px;
- padding-top: 27px;
-}
diff --git a/phpBB/styles/subsilver2/theme/images/announce_read.gif b/phpBB/styles/subsilver2/theme/images/announce_read.gif
deleted file mode 100644
index 0589feb14f..0000000000
--- a/phpBB/styles/subsilver2/theme/images/announce_read.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/announce_read_locked.gif b/phpBB/styles/subsilver2/theme/images/announce_read_locked.gif
deleted file mode 100644
index a738616e06..0000000000
--- a/phpBB/styles/subsilver2/theme/images/announce_read_locked.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/announce_read_locked_mine.gif b/phpBB/styles/subsilver2/theme/images/announce_read_locked_mine.gif
deleted file mode 100644
index f7ffe7f8dd..0000000000
--- a/phpBB/styles/subsilver2/theme/images/announce_read_locked_mine.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/announce_read_mine.gif b/phpBB/styles/subsilver2/theme/images/announce_read_mine.gif
deleted file mode 100644
index 636d353867..0000000000
--- a/phpBB/styles/subsilver2/theme/images/announce_read_mine.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/announce_unread.gif b/phpBB/styles/subsilver2/theme/images/announce_unread.gif
deleted file mode 100644
index 56b2702b17..0000000000
--- a/phpBB/styles/subsilver2/theme/images/announce_unread.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/announce_unread_locked.gif b/phpBB/styles/subsilver2/theme/images/announce_unread_locked.gif
deleted file mode 100644
index 37033da653..0000000000
--- a/phpBB/styles/subsilver2/theme/images/announce_unread_locked.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/announce_unread_locked_mine.gif b/phpBB/styles/subsilver2/theme/images/announce_unread_locked_mine.gif
deleted file mode 100644
index d91f2520ca..0000000000
--- a/phpBB/styles/subsilver2/theme/images/announce_unread_locked_mine.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/announce_unread_mine.gif b/phpBB/styles/subsilver2/theme/images/announce_unread_mine.gif
deleted file mode 100644
index e1dd23a0bf..0000000000
--- a/phpBB/styles/subsilver2/theme/images/announce_unread_mine.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/background.gif b/phpBB/styles/subsilver2/theme/images/background.gif
deleted file mode 100644
index 5c731e4fc2..0000000000
--- a/phpBB/styles/subsilver2/theme/images/background.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/cellpic.gif b/phpBB/styles/subsilver2/theme/images/cellpic.gif
deleted file mode 100644
index 47457ef5f7..0000000000
--- a/phpBB/styles/subsilver2/theme/images/cellpic.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/cellpic1.gif b/phpBB/styles/subsilver2/theme/images/cellpic1.gif
deleted file mode 100644
index 715b8d4aa8..0000000000
--- a/phpBB/styles/subsilver2/theme/images/cellpic1.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/cellpic2.jpg b/phpBB/styles/subsilver2/theme/images/cellpic2.jpg
deleted file mode 100644
index a0ca7e89d3..0000000000
--- a/phpBB/styles/subsilver2/theme/images/cellpic2.jpg
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/cellpic2_rtl.jpg b/phpBB/styles/subsilver2/theme/images/cellpic2_rtl.jpg
deleted file mode 100644
index 201e063725..0000000000
--- a/phpBB/styles/subsilver2/theme/images/cellpic2_rtl.jpg
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/cellpic3.gif b/phpBB/styles/subsilver2/theme/images/cellpic3.gif
deleted file mode 100644
index ecf70e1fd1..0000000000
--- a/phpBB/styles/subsilver2/theme/images/cellpic3.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/created_by.jpg b/phpBB/styles/subsilver2/theme/images/created_by.jpg
deleted file mode 100644
index f27472781e..0000000000
--- a/phpBB/styles/subsilver2/theme/images/created_by.jpg
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/forum_link.gif b/phpBB/styles/subsilver2/theme/images/forum_link.gif
deleted file mode 100644
index d5e86d47d7..0000000000
--- a/phpBB/styles/subsilver2/theme/images/forum_link.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/forum_read.gif b/phpBB/styles/subsilver2/theme/images/forum_read.gif
deleted file mode 100644
index 9b2bc47c67..0000000000
--- a/phpBB/styles/subsilver2/theme/images/forum_read.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/forum_read_locked.gif b/phpBB/styles/subsilver2/theme/images/forum_read_locked.gif
deleted file mode 100644
index 436f3d21c8..0000000000
--- a/phpBB/styles/subsilver2/theme/images/forum_read_locked.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/forum_read_subforum.gif b/phpBB/styles/subsilver2/theme/images/forum_read_subforum.gif
deleted file mode 100644
index 9179303e7f..0000000000
--- a/phpBB/styles/subsilver2/theme/images/forum_read_subforum.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/forum_unread.gif b/phpBB/styles/subsilver2/theme/images/forum_unread.gif
deleted file mode 100644
index 5eec565b38..0000000000
--- a/phpBB/styles/subsilver2/theme/images/forum_unread.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/forum_unread_locked.gif b/phpBB/styles/subsilver2/theme/images/forum_unread_locked.gif
deleted file mode 100644
index 58a79c376c..0000000000
--- a/phpBB/styles/subsilver2/theme/images/forum_unread_locked.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/forum_unread_subforum.gif b/phpBB/styles/subsilver2/theme/images/forum_unread_subforum.gif
deleted file mode 100644
index af3c93b1a1..0000000000
--- a/phpBB/styles/subsilver2/theme/images/forum_unread_subforum.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/icon_mini_faq.gif b/phpBB/styles/subsilver2/theme/images/icon_mini_faq.gif
deleted file mode 100644
index fc50e7ca30..0000000000
--- a/phpBB/styles/subsilver2/theme/images/icon_mini_faq.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/icon_mini_groups.gif b/phpBB/styles/subsilver2/theme/images/icon_mini_groups.gif
deleted file mode 100644
index a4d1c7bb70..0000000000
--- a/phpBB/styles/subsilver2/theme/images/icon_mini_groups.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/icon_mini_login.gif b/phpBB/styles/subsilver2/theme/images/icon_mini_login.gif
deleted file mode 100644
index c7590a423f..0000000000
--- a/phpBB/styles/subsilver2/theme/images/icon_mini_login.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/icon_mini_members.gif b/phpBB/styles/subsilver2/theme/images/icon_mini_members.gif
deleted file mode 100644
index d636089b38..0000000000
--- a/phpBB/styles/subsilver2/theme/images/icon_mini_members.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/icon_mini_message.gif b/phpBB/styles/subsilver2/theme/images/icon_mini_message.gif
deleted file mode 100644
index b8aea1eafb..0000000000
--- a/phpBB/styles/subsilver2/theme/images/icon_mini_message.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/icon_mini_notification.gif b/phpBB/styles/subsilver2/theme/images/icon_mini_notification.gif
deleted file mode 100644
index f165d3cb27..0000000000
--- a/phpBB/styles/subsilver2/theme/images/icon_mini_notification.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/icon_mini_profile.gif b/phpBB/styles/subsilver2/theme/images/icon_mini_profile.gif
deleted file mode 100644
index 1ec7c649e9..0000000000
--- a/phpBB/styles/subsilver2/theme/images/icon_mini_profile.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/icon_mini_register.gif b/phpBB/styles/subsilver2/theme/images/icon_mini_register.gif
deleted file mode 100644
index b49ac31ec9..0000000000
--- a/phpBB/styles/subsilver2/theme/images/icon_mini_register.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/icon_mini_search.gif b/phpBB/styles/subsilver2/theme/images/icon_mini_search.gif
deleted file mode 100644
index 2bd1a648c0..0000000000
--- a/phpBB/styles/subsilver2/theme/images/icon_mini_search.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/icon_post_target.gif b/phpBB/styles/subsilver2/theme/images/icon_post_target.gif
deleted file mode 100644
index d172abb060..0000000000
--- a/phpBB/styles/subsilver2/theme/images/icon_post_target.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/icon_post_target_unread.gif b/phpBB/styles/subsilver2/theme/images/icon_post_target_unread.gif
deleted file mode 100644
index 8ec44a1787..0000000000
--- a/phpBB/styles/subsilver2/theme/images/icon_post_target_unread.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/icon_topic_attach.gif b/phpBB/styles/subsilver2/theme/images/icon_topic_attach.gif
deleted file mode 100644
index 1c9c89bc70..0000000000
--- a/phpBB/styles/subsilver2/theme/images/icon_topic_attach.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/icon_topic_deleted.png b/phpBB/styles/subsilver2/theme/images/icon_topic_deleted.png
deleted file mode 100644
index 494b4fb563..0000000000
--- a/phpBB/styles/subsilver2/theme/images/icon_topic_deleted.png
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/icon_topic_latest.gif b/phpBB/styles/subsilver2/theme/images/icon_topic_latest.gif
deleted file mode 100644
index b45e57aedb..0000000000
--- a/phpBB/styles/subsilver2/theme/images/icon_topic_latest.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/icon_topic_newest.gif b/phpBB/styles/subsilver2/theme/images/icon_topic_newest.gif
deleted file mode 100644
index eca2861836..0000000000
--- a/phpBB/styles/subsilver2/theme/images/icon_topic_newest.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/icon_topic_reported.gif b/phpBB/styles/subsilver2/theme/images/icon_topic_reported.gif
deleted file mode 100644
index 026092854a..0000000000
--- a/phpBB/styles/subsilver2/theme/images/icon_topic_reported.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/icon_topic_unapproved.gif b/phpBB/styles/subsilver2/theme/images/icon_topic_unapproved.gif
deleted file mode 100644
index 2ccaf19c23..0000000000
--- a/phpBB/styles/subsilver2/theme/images/icon_topic_unapproved.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/index.htm b/phpBB/styles/subsilver2/theme/images/index.htm
deleted file mode 100644
index 957f68a803..0000000000
--- a/phpBB/styles/subsilver2/theme/images/index.htm
+++ /dev/null
@@ -1,16 +0,0 @@
-<html>
-<head>
-<title>subSilver created by subBlue Design</title>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-</head>
-
-<body bgcolor="#FFFFFF" text="#000000">
-
-<table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
- <tr>
- <td align="center" valign="middle"><a href="http://www.subblue.com/" target="_new"><img src="created_by.jpg" width="400" height="300" alt="Created by subBlue Design" /></a></td>
- </tr>
-</table>
-
-</body>
-</html> \ No newline at end of file
diff --git a/phpBB/styles/subsilver2/theme/images/no_avatar.gif b/phpBB/styles/subsilver2/theme/images/no_avatar.gif
deleted file mode 100644
index ad73330e71..0000000000
--- a/phpBB/styles/subsilver2/theme/images/no_avatar.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/poll_center.gif b/phpBB/styles/subsilver2/theme/images/poll_center.gif
deleted file mode 100644
index 99473151ec..0000000000
--- a/phpBB/styles/subsilver2/theme/images/poll_center.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/poll_left.gif b/phpBB/styles/subsilver2/theme/images/poll_left.gif
deleted file mode 100644
index 269088b81d..0000000000
--- a/phpBB/styles/subsilver2/theme/images/poll_left.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/poll_right.gif b/phpBB/styles/subsilver2/theme/images/poll_right.gif
deleted file mode 100644
index f9584e23a1..0000000000
--- a/phpBB/styles/subsilver2/theme/images/poll_right.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/site_logo.gif b/phpBB/styles/subsilver2/theme/images/site_logo.gif
deleted file mode 100644
index abce3cd51d..0000000000
--- a/phpBB/styles/subsilver2/theme/images/site_logo.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/spacer.gif b/phpBB/styles/subsilver2/theme/images/spacer.gif
deleted file mode 100644
index 5bfd67a2d6..0000000000
--- a/phpBB/styles/subsilver2/theme/images/spacer.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/sticky_read.gif b/phpBB/styles/subsilver2/theme/images/sticky_read.gif
deleted file mode 100644
index 09861a996c..0000000000
--- a/phpBB/styles/subsilver2/theme/images/sticky_read.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/sticky_read_locked.gif b/phpBB/styles/subsilver2/theme/images/sticky_read_locked.gif
deleted file mode 100644
index 24bca303d6..0000000000
--- a/phpBB/styles/subsilver2/theme/images/sticky_read_locked.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/sticky_read_locked_mine.gif b/phpBB/styles/subsilver2/theme/images/sticky_read_locked_mine.gif
deleted file mode 100644
index 3fd04ec3a9..0000000000
--- a/phpBB/styles/subsilver2/theme/images/sticky_read_locked_mine.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/sticky_read_mine.gif b/phpBB/styles/subsilver2/theme/images/sticky_read_mine.gif
deleted file mode 100644
index 381634c364..0000000000
--- a/phpBB/styles/subsilver2/theme/images/sticky_read_mine.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/sticky_unread.gif b/phpBB/styles/subsilver2/theme/images/sticky_unread.gif
deleted file mode 100644
index dd2e366543..0000000000
--- a/phpBB/styles/subsilver2/theme/images/sticky_unread.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/sticky_unread_locked.gif b/phpBB/styles/subsilver2/theme/images/sticky_unread_locked.gif
deleted file mode 100644
index 608f4822e3..0000000000
--- a/phpBB/styles/subsilver2/theme/images/sticky_unread_locked.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/sticky_unread_locked_mine.gif b/phpBB/styles/subsilver2/theme/images/sticky_unread_locked_mine.gif
deleted file mode 100644
index fe5e115312..0000000000
--- a/phpBB/styles/subsilver2/theme/images/sticky_unread_locked_mine.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/sticky_unread_mine.gif b/phpBB/styles/subsilver2/theme/images/sticky_unread_mine.gif
deleted file mode 100644
index b5fc3b3627..0000000000
--- a/phpBB/styles/subsilver2/theme/images/sticky_unread_mine.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/topic_moved.gif b/phpBB/styles/subsilver2/theme/images/topic_moved.gif
deleted file mode 100644
index fe758f02ca..0000000000
--- a/phpBB/styles/subsilver2/theme/images/topic_moved.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/topic_read.gif b/phpBB/styles/subsilver2/theme/images/topic_read.gif
deleted file mode 100644
index c16bfa75d5..0000000000
--- a/phpBB/styles/subsilver2/theme/images/topic_read.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/topic_read_hot.gif b/phpBB/styles/subsilver2/theme/images/topic_read_hot.gif
deleted file mode 100644
index a7a7e8fc78..0000000000
--- a/phpBB/styles/subsilver2/theme/images/topic_read_hot.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/topic_read_hot_mine.gif b/phpBB/styles/subsilver2/theme/images/topic_read_hot_mine.gif
deleted file mode 100644
index 853452a74b..0000000000
--- a/phpBB/styles/subsilver2/theme/images/topic_read_hot_mine.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/topic_read_locked.gif b/phpBB/styles/subsilver2/theme/images/topic_read_locked.gif
deleted file mode 100644
index 10eb776972..0000000000
--- a/phpBB/styles/subsilver2/theme/images/topic_read_locked.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/topic_read_locked_mine.gif b/phpBB/styles/subsilver2/theme/images/topic_read_locked_mine.gif
deleted file mode 100644
index 3f24928b48..0000000000
--- a/phpBB/styles/subsilver2/theme/images/topic_read_locked_mine.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/topic_read_mine.gif b/phpBB/styles/subsilver2/theme/images/topic_read_mine.gif
deleted file mode 100644
index 560927aa06..0000000000
--- a/phpBB/styles/subsilver2/theme/images/topic_read_mine.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/topic_unread.gif b/phpBB/styles/subsilver2/theme/images/topic_unread.gif
deleted file mode 100644
index 4e56157dce..0000000000
--- a/phpBB/styles/subsilver2/theme/images/topic_unread.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/topic_unread_hot.gif b/phpBB/styles/subsilver2/theme/images/topic_unread_hot.gif
deleted file mode 100644
index ceef4919d5..0000000000
--- a/phpBB/styles/subsilver2/theme/images/topic_unread_hot.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/topic_unread_hot_mine.gif b/phpBB/styles/subsilver2/theme/images/topic_unread_hot_mine.gif
deleted file mode 100644
index 1c748f708a..0000000000
--- a/phpBB/styles/subsilver2/theme/images/topic_unread_hot_mine.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/topic_unread_locked.gif b/phpBB/styles/subsilver2/theme/images/topic_unread_locked.gif
deleted file mode 100644
index 720e210289..0000000000
--- a/phpBB/styles/subsilver2/theme/images/topic_unread_locked.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/topic_unread_locked_mine.gif b/phpBB/styles/subsilver2/theme/images/topic_unread_locked_mine.gif
deleted file mode 100644
index 90873431ef..0000000000
--- a/phpBB/styles/subsilver2/theme/images/topic_unread_locked_mine.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/topic_unread_mine.gif b/phpBB/styles/subsilver2/theme/images/topic_unread_mine.gif
deleted file mode 100644
index 34fd2ec179..0000000000
--- a/phpBB/styles/subsilver2/theme/images/topic_unread_mine.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/upload_bar.gif b/phpBB/styles/subsilver2/theme/images/upload_bar.gif
deleted file mode 100644
index 75cf61c59e..0000000000
--- a/phpBB/styles/subsilver2/theme/images/upload_bar.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/images/whosonline.gif b/phpBB/styles/subsilver2/theme/images/whosonline.gif
deleted file mode 100644
index b450927432..0000000000
--- a/phpBB/styles/subsilver2/theme/images/whosonline.gif
+++ /dev/null
Binary files differ
diff --git a/phpBB/styles/subsilver2/theme/stylesheet.css b/phpBB/styles/subsilver2/theme/stylesheet.css
deleted file mode 100644
index 784643a5b9..0000000000
--- a/phpBB/styles/subsilver2/theme/stylesheet.css
+++ /dev/null
@@ -1,1250 +0,0 @@
-/* phpBB3 Style Sheet
- --------------------------------------------------------------
- Style name: subsilver2
- Based on style: subSilver (the default phpBB 2.0.x style)
- Original author: Tom Beddard ( http://www.subblue.com/ )
- Modified by: phpBB Limited ( https://www.phpbb.com/ )
- --------------------------------------------------------------
-*/
-
-/* Layout
- ------------ */
-* {
- /* Reset browsers default margin, padding and font sizes */
- margin: 0;
- padding: 0;
-}
-
-abbr {
- text-decoration: none;
-}
-
-html {
- font-size: 100%;
-}
-
-body {
- /* Text-Sizing with ems: http://www.clagnut.com/blog/348/ */
- font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif;
- color: #323D4F;
- background-color: #FFFFFF;
- font-size: 62.5%; /* This sets the default font size to be equivalent to 10px */
- margin: 0;
-}
-
-#wrapheader {
- height: auto !important;
- padding: 0;
-}
-
-#wrapcentre {
- margin: 15px 25px 0 25px;
-}
-
-#wrapfooter {
- text-align: center;
- clear: both;
-}
-
-#wrapnav {
- width: 100%;
- margin: 0;
- background-color: #ECECEC;
- border-width: 1px;
- border-style: solid;
- border-color: #A9B8C2;
-}
-
-#logodesc {
- background-color: #C1CAD2;
- background-image: url('./images/background.gif');
- background-repeat: repeat-x;
- background-position: center bottom;
- padding: 0 25px 15px 25px;
-}
-
-#menubar {
- margin: 0 25px;
-}
-
-#datebar {
- margin: 10px 25px 0 25px;
-}
-
-#findbar {
- width: 100%;
- margin: 0;
- padding: 0;
- border: 0;
-}
-
-.forumrules {
- background-color: #F9CC79;
- border-width: 1px;
- border-style: solid;
- border-color: #BB9860;
- padding: 4px;
- font-weight: normal;
- font-size: 1.1em;
- font-family: "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
-}
-
-.forumrules h3 {
- color: red;
-}
-
-#pageheader { }
-#pagecontent { }
-#pagefooter { }
-
-#poll { }
-#postrow { }
-#postdata { }
-
-
-/* Text
- --------------------- */
-h1 {
- color: black;
- font-family: "Lucida Grande", "Trebuchet MS", Verdana, sans-serif;
- font-weight: bold;
- font-size: 1.8em;
- text-decoration: none;
-}
-
-h2 {
- font-family: Arial, Helvetica, sans-serif;
- font-weight: bold;
- font-size: 1.5em;
- text-decoration: none;
- line-height: 120%;
-}
-
-h3 {
- font-size: 1.3em;
- font-weight: bold;
- font-family: Arial, Helvetica, sans-serif;
- line-height: 120%;
-}
-
-h4 {
- margin: 0;
- font-size: 1.1em;
- font-weight: bold;
-}
-
-p {
- font-size: 1.1em;
-}
-
-p.moderators {
- margin: 0;
- float: left;
- color: black;
- font-weight: bold;
-}
-
-.rtl p.moderators {
- float: right;
-}
-
-p.linkmcp {
- margin: 0;
- float: right;
- white-space: nowrap;
-}
-
-.rtl p.linkmcp {
- float: left;
-}
-
-p.breadcrumbs {
- margin: 0;
- float: left;
- color: black;
- font-weight: bold;
- white-space: normal;
- font-size: 1em;
-}
-
-.rtl p.breadcrumbs {
- float: right;
-}
-
-p.datetime {
- margin: 0;
- float: right;
- white-space: nowrap;
- font-size: 1em;
-}
-
-.rtl p.datetime {
- float: left;
-}
-
-p.searchbar {
- padding: 2px 0;
- white-space: nowrap;
-}
-
-p.searchbarreg {
- margin: 0;
- float: right;
- white-space: nowrap;
-}
-
-.rtl p.searchbarreg {
- float: left;
-}
-
-p.forumdesc {
- padding-bottom: 4px;
-}
-
-p.topicauthor {
- margin: 1px 0;
-}
-
-p.topicdetails {
- margin: 1px 0;
-}
-
-.postreported, .postreported a:link, .postreported a:visited, .postreported a:hover, .postreported a:active {
- margin: 1px 0;
- color: red;
- font-weight:bold;
-}
-
-.postapprove, .postapprove a:link, .postapprove a:visited, .postapprove a:hover, .postapprove a:active {
- color: green;
- font-weight:bold;
-}
-
-.postapprove img, .postreported img {
- vertical-align: bottom;
- padding-top: 5px;
-}
-
-.postauthor {
- color: #000000;
-}
-
-.postdetails {
- color: #000000;
-}
-
-.postbody {
- font-size: 1.3em;
- line-height: 1.4em;
- font-family: "Lucida Grande", "Trebuchet MS", Helvetica, Arial, sans-serif;
-}
-
-.postbody li, ol, ul {
- margin: 0 0 0 1.5em;
-}
-
-.rtl .postbody li, .rtl ol, .rtl ul {
- margin: 0 1.5em 0 0;
-}
-
-.posthilit {
- background-color: yellow;
-}
-
-.nav {
- margin: 0;
- color: black;
- font-weight: bold;
-}
-
-.pagination {
- padding: 4px;
- color: black;
- font-size: 1em;
- font-weight: bold;
-}
-
-.cattitle {
-
-}
-
-.gen {
- margin: 1px 1px;
- font-size: 1.2em;
-}
-
-.genmed {
- margin: 1px 1px;
- font-size: 1.1em;
-}
-
-.gensmall {
- margin: 1px 1px;
- font-size: 1em;
-}
-
-.copyright {
- color: #444;
- font-weight: normal;
- font-family: "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
-}
-
-.titles {
- font-family: "Lucida Grande", Helvetica, Arial, sans-serif;
- font-weight: bold;
- font-size: 1.3em;
- text-decoration: none;
-}
-
-.online {
- color: green;
-}
-
-.offline, .error, .inactive {
- color: red;
-}
-
-
-/* Tables
- ------------ */
-#color_palette_placeholder table {
- border-collapse: separate;
- border-spacing: 1px;
-}
-
-#color_palette_placeholder td {
- padding: 0;
-}
-
-th {
- color: #FFA34F;
- font-size: 1.1em;
- font-weight: bold;
- background-color: #006699;
- background-image: url('./images/cellpic3.gif');
- white-space: nowrap;
- padding: 7px 5px;
-}
-
-th.center {
- text-align: center;
-}
-
-td {
- padding: 2px;
-}
-td.profile {
- padding: 4px;
-}
-
-.tablebg {
- background-color: #A9B8C2;
-}
-
-.catdiv {
- height: 28px;
- margin: 0;
- padding: 0;
- border: 0;
- background: white url('./images/cellpic2.jpg') repeat-y scroll top left;
-}
-.rtl .catdiv {
- background: white url('./images/cellpic2_rtl.jpg') repeat-y scroll top right;
-}
-
-.cat {
- height: 28px;
- margin: 0;
- padding: 0;
- border: 0;
- background-color: #C7D0D7;
- background-image: url('./images/cellpic1.gif');
- text-indent: 4px;
-}
-
-.row1 {
- background-color: #ECECEC;
- padding: 4px;
-}
-
-.row2 {
- background-color: #DCE1E5;
- padding: 4px;
-}
-
-.row3 {
- background-color: #C0C8D0;
- padding: 4px;
-}
-
-.spacer {
- background-color: #D1D7DC;
-}
-
-.current {
- background-color: lightblue;
-}
-
-hr {
- height: 1px;
- border-width: 0;
- background-color: #D1D7DC;
- color: #D1D7DC;
-}
-
-.legend {
- text-align:center;
- margin: 0 auto;
-}
-
-/* Links
- ------------ */
-
-/* Links adjustment to correctly display an order of rtl/ltr mixed content */
-.rtl a {
- direction: rtl;
- unicode-bidi: embed;
-}
-
-/* CSS spec requires a:link, a:visited, a:hover and a:active rules to be specified in this order. */
-/* See http://www.phpbb.com/bugs/phpbb3/59685 */
-a:link {
- color: #006597;
- text-decoration: none;
-}
-
-a:visited {
- color: #005784;
- text-decoration: none;
-}
-
-a:hover {
- color: #D46400;
- text-decoration: underline;
-}
-
-a:active {
- color: #005784;
- text-decoration: none;
-}
-
-a.forumlink {
- color: #069;
- font-weight: bold;
- font-family: "Lucida Grande", Helvetica, Arial, sans-serif;
- font-size: 1.2em;
-}
-
-a.topictitle {
- margin: 1px 0;
- font-family: "Lucida Grande", Helvetica, Arial, sans-serif;
- font-weight: bold;
- font-size: 1.2em;
-}
-
-a.topictitle:visited {
- color: #5493B4;
- text-decoration: none;
-}
-
-a.lastsubject {
- font-weight: bold;
- text-decoration: none;
-}
-
-a.lastsubject:hover {
- text-decoration: underline;
-}
-
-th a,
-th a:visited {
- color: #FFA34F !important;
- text-decoration: none;
-}
-
-th a:hover {
- text-decoration: underline;
-}
-
-a.anchor {
- display: block;
-}
-
-
-/* Form Elements
- ------------ */
-form {
- margin: 0;
- padding: 0;
- border: 0;
-}
-
-input {
- color: #333333;
- font-family: "Lucida Grande", Verdana, Helvetica, sans-serif;
- font-size: 1.1em;
- font-weight: normal;
- padding: 1px;
- border: 1px solid #A9B8C2;
- background-color: #FAFAFA;
-}
-
-textarea {
- background-color: #FAFAFA;
- color: #333333;
- font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif;
- font-size: 1.3em;
- line-height: 1.4em;
- font-weight: normal;
- border: 1px solid #A9B8C2;
- padding: 2px;
-}
-
-select {
- color: #333333;
- background-color: #FAFAFA;
- font-family: "Lucida Grande", Verdana, Helvetica, sans-serif;
- font-size: 1.1em;
- font-weight: normal;
- border: 1px solid #A9B8C2;
- padding: 1px;
-}
-
-option {
- padding: 0 1em 0 0;
-}
-
-option.disabled-option {
- color: graytext;
-}
-
-.rtl option {
- padding: 0 0 0 1em;
-}
-
-input.radio {
- border: none;
- background-color: transparent;
-}
-
-.post {
- background-color: white;
- border-style: solid;
- border-width: 1px;
-}
-
-.btnbbcode {
- color: #000000;
- font-weight: normal;
- font-size: 1.1em;
- font-family: "Lucida Grande", Verdana, Helvetica, sans-serif;
- background-color: #EFEFEF;
- border: 1px solid #666666;
-}
-
-.btnmain {
- font-weight: bold;
- background-color: #ECECEC;
- border: 1px solid #A9B8C2;
- cursor: pointer;
- padding: 1px 5px;
- font-size: 1.1em;
-}
-
-.btnlite {
- font-weight: normal;
- background-color: #ECECEC;
- border: 1px solid #A9B8C2;
- cursor: pointer;
- padding: 1px 5px;
- font-size: 1.1em;
-}
-
-.btnfile {
- font-weight: normal;
- background-color: #ECECEC;
- border: 1px solid #A9B8C2;
- padding: 1px 5px;
- font-size: 1.1em;
-}
-
-.helpline {
- background-color: #DEE3E7;
- border-style: none;
-}
-
-input:focus, select:focus, textarea:focus {
- outline-style: none;
-}
-
-/* BBCode
- ------------ */
-.quotetitle, .attachtitle {
- margin: 10px 5px 0 5px;
- padding: 4px;
- border-width: 1px 1px 0 1px;
- border-style: solid;
- border-color: #A9B8C2;
- color: #333333;
- background-color: #A9B8C2;
- font-size: 0.85em;
- font-weight: bold;
-}
-
-.quotetitle .quotetitle {
- font-size: 1em;
-}
-
-.quotecontent, .attachcontent {
- margin: 0 5px 10px 5px;
- padding: 5px;
- border-color: #A9B8C2;
- border-width: 0 1px 1px 1px;
- border-style: solid;
- font-weight: normal;
- font-size: 1em;
- line-height: 1.4em;
- font-family: "Lucida Grande", "Trebuchet MS", Helvetica, Arial, sans-serif;
- background-color: #FAFAFA;
- color: #4B5C77;
-}
-
-.attachcontent {
- font-size: 0.85em;
-}
-
-.codetitle {
- margin: 10px 5px 0 5px;
- padding: 2px 4px;
- border-width: 1px 1px 0 1px;
- border-style: solid;
- border-color: #A9B8C2;
- color: #333333;
- background-color: #A9B8C2;
- font-family: "Lucida Grande", Verdana, Helvetica, Arial, sans-serif;
- font-size: 0.8em;
-}
-
-.codecontent {
- direction: ltr;
- margin: 0 5px 10px 5px;
- padding: 5px;
- border-color: #A9B8C2;
- border-width: 0 1px 1px 1px;
- border-style: solid;
- font-weight: normal;
- color: #006600;
- font-size: 0.85em;
- font-family: Monaco, 'Courier New', monospace;
- background-color: #FAFAFA;
-}
-
-.postimage {
- max-width: 100%;
-}
-
-.syntaxbg {
- color: #FFFFFF;
-}
-
-.syntaxcomment {
- color: #FF8000;
-}
-
-.syntaxdefault {
- color: #0000BB;
-}
-
-.syntaxhtml {
- color: #000000;
-}
-
-.syntaxkeyword {
- color: #007700;
-}
-
-.syntaxstring {
- color: #DD0000;
-}
-
-
-/* Private messages
- ------------------ */
-.pm_marked_colour {
- background-color: #000000;
-}
-
-.pm_replied_colour {
- background-color: #A9B8C2;
-}
-
-.pm_friend_colour {
- background-color: #007700;
-}
-
-.pm_foe_colour {
- background-color: #DD0000;
-}
-
-
-/* Misc
- ------------ */
-img {
- border: none;
-}
-
-.sep {
- color: black;
- background-color: #FFA34F;
-}
-
-table.colortable td {
- padding: 0;
-}
-
-pre {
- font-size: 1.1em;
- font-family: Monaco, 'Courier New', monospace;
-}
-
-.nowrap {
- white-space: nowrap;
-}
-
-.username-coloured {
- font-weight: bold;
-}
-
-
-/* Former imageset */
-span.imageset {
- display: inline-block;
- background: transparent none 0 0 no-repeat;
- margin: 0;
- padding: 0;
- width: 0;
- height: 0;
- overflow: hidden;
-}
-a.imageset {
- text-decoration: none !important;
-}
-
-/* Global imageset items */
-.imageset.site_logo {
- background-image: url("./images/site_logo.gif");
- padding-left: 170px;
- padding-top: 94px;
-}
-.imageset.upload_bar {
- background-image: url("./images/upload_bar.gif");
- padding-left: 280px;
- padding-top: 16px;
-}
-.imageset.poll_left {
- background-image: url("./images/poll_left.gif");
- padding-left: 4px;
- padding-top: 12px;
-}
-.imageset.poll_center {
- background-image: url("./images/poll_center.gif");
- padding-left: 1px;
- padding-top: 12px;
-}
-.imageset.poll_right {
- background-image: url("./images/poll_right.gif");
- padding-left: 4px;
- padding-top: 12px;
-}
-.imageset.forum_link {
- background-image: url("./images/forum_link.gif");
- padding-left: 46px;
- padding-top: 25px;
-}
-.imageset.forum_read {
- background-image: url("./images/forum_read.gif");
- padding-left: 46px;
- padding-top: 25px;
-}
-.imageset.forum_read_locked {
- background-image: url("./images/forum_read_locked.gif");
- padding-left: 46px;
- padding-top: 25px;
-}
-.imageset.forum_read_subforum {
- background-image: url("./images/forum_read_subforum.gif");
- padding-left: 46px;
- padding-top: 25px;
-}
-.imageset.forum_unread {
- background-image: url("./images/forum_unread.gif");
- padding-left: 46px;
- padding-top: 25px;
-}
-.imageset.forum_unread_locked {
- background-image: url("./images/forum_unread_locked.gif");
- padding-left: 46px;
- padding-top: 25px;
-}
-.imageset.forum_unread_subforum {
- background-image: url("./images/forum_unread_subforum.gif");
- padding-left: 46px;
- padding-top: 25px;
-}
-.imageset.topic_moved {
- background-image: url("./images/topic_moved.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.topic_read {
- background-image: url("./images/topic_read.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.topic_read_mine {
- background-image: url("./images/topic_read_mine.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.topic_read_hot {
- background-image: url("./images/topic_read_hot.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.topic_read_hot_mine {
- background-image: url("./images/topic_read_hot_mine.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.topic_read_locked {
- background-image: url("./images/topic_read_locked.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.topic_read_locked_mine {
- background-image: url("./images/topic_read_locked_mine.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.topic_unread {
- background-image: url("./images/topic_unread.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.topic_unread_mine {
- background-image: url("./images/topic_unread_mine.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.topic_unread_hot {
- background-image: url("./images/topic_unread_hot.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.topic_unread_hot_mine {
- background-image: url("./images/topic_unread_hot_mine.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.topic_unread_locked {
- background-image: url("./images/topic_unread_locked.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.topic_unread_locked_mine {
- background-image: url("./images/topic_unread_locked_mine.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.sticky_read {
- background-image: url("./images/sticky_read.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.sticky_read_mine {
- background-image: url("./images/sticky_read_mine.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.sticky_read_locked {
- background-image: url("./images/sticky_read_locked.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.sticky_read_locked_mine {
- background-image: url("./images/sticky_read_locked_mine.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.sticky_unread {
- background-image: url("./images/sticky_unread.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.sticky_unread_mine {
- background-image: url("./images/sticky_unread_mine.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.sticky_unread_locked {
- background-image: url("./images/sticky_unread_locked.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.sticky_unread_locked_mine {
- background-image: url("./images/sticky_unread_locked_mine.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.announce_read {
- background-image: url("./images/announce_read.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.announce_read_mine {
- background-image: url("./images/announce_read_mine.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.announce_read_locked {
- background-image: url("./images/announce_read_locked.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.announce_read_locked_mine {
- background-image: url("./images/announce_read_locked_mine.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.announce_unread {
- background-image: url("./images/announce_unread.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.announce_unread_mine {
- background-image: url("./images/announce_unread_mine.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.announce_unread_locked {
- background-image: url("./images/announce_unread_locked.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.announce_unread_locked_mine {
- background-image: url("./images/announce_unread_locked_mine.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.global_read {
- background-image: url("./images/announce_read.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.global_read_mine {
- background-image: url("./images/announce_read_mine.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.global_read_locked {
- background-image: url("./images/announce_read_locked.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.global_read_locked_mine {
- background-image: url("./images/announce_read_locked_mine.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.global_unread {
- background-image: url("./images/announce_unread.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.global_unread_mine {
- background-image: url("./images/announce_unread_mine.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.global_unread_locked {
- background-image: url("./images/announce_unread_locked.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.global_unread_locked_mine {
- background-image: url("./images/announce_unread_locked_mine.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.pm_read {
- background-image: url("./images/topic_read.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.pm_unread {
- background-image: url("./images/topic_unread.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.icon_post_target {
- background-image: url("./images/icon_post_target.gif");
- padding-left: 12px;
- padding-top: 9px;
-}
-.imageset.icon_post_target_unread {
- background-image: url("./images/icon_post_target_unread.gif");
- padding-left: 12px;
- padding-top: 9px;
-}
-.imageset.icon_topic_attach {
- background-image: url("./images/icon_topic_attach.gif");
- padding-left: 14px;
- padding-top: 18px;
-}
-.imageset.icon_topic_latest {
- background-image: url("./images/icon_topic_latest.gif");
- padding-left: 18px;
- padding-top: 9px;
-}
-.imageset.icon_topic_newest {
- background-image: url("./images/icon_topic_newest.gif");
- padding-left: 18px;
- padding-top: 9px;
-}
-.imageset.icon_topic_reported {
- background-image: url("./images/icon_topic_reported.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.icon_topic_unapproved {
- background-image: url("./images/icon_topic_unapproved.gif");
- padding-left: 19px;
- padding-top: 18px;
-}
-.imageset.icon_topic_deleted {
- background-image: url("./images/icon_topic_deleted.png");
- padding-left: 14px;
- padding-top: 14px;
-}
-
-
-/* English images for fallback */
-.imageset.phpbb_aol-icon, .imageset.icon_contact_aim {
- background-image: url("./en/icon_contact_aim.gif");
- padding-left: 72px;
- padding-top: 20px;
-}
-.imageset.icon_contact_email {
- background-image: url("./en/icon_contact_email.gif");
- padding-left: 72px;
- padding-top: 20px;
-}
-.imageset.phpbb_icq-icon, .imageset.icon_contact_icq {
- background-image: url("./en/icon_contact_icq.gif");
- padding-left: 72px;
- padding-top: 20px;
-}
-.imageset.icon_contact_jabber {
- background-image: url("./en/icon_contact_jabber.gif");
- padding-left: 72px;
- padding-top: 20px;
-}
-.imageset.phpbb_wlm-icon, .imageset.icon_contact_msnm {
- background-image: url("./en/icon_contact_msnm.gif");
- padding-left: 72px;
- padding-top: 20px;
-}
-.imageset.icon_contact_pm {
- background-image: url("./en/icon_contact_pm.gif");
- padding-left: 72px;
- padding-top: 20px;
-}
-.imageset.phpbb_yahoo-icon, .imageset.icon_contact_yahoo {
- background-image: url("./en/icon_contact_yahoo.gif");
- padding-left: 72px;
- padding-top: 20px;
-}
-.imageset.phpbb_website-icon, .imageset.icon_contact_www {
- background-image: url("./en/icon_contact_www.gif");
- padding-left: 72px;
- padding-top: 20px;
-}
-.imageset.icon_post_delete {
- background-image: url("./en/icon_post_delete.gif");
- padding-left: 20px;
- padding-top: 20px;
-}
-.imageset.icon_post_edit {
- background-image: url("./en/icon_post_edit.gif");
- padding-left: 90px;
- padding-top: 20px;
-}
-.imageset.icon_post_info {
- background-image: url("./en/icon_post_info.gif");
- padding-left: 20px;
- padding-top: 20px;
-}
-.imageset.icon_post_quote {
- background-image: url("./en/icon_post_quote.gif");
- padding-left: 90px;
- padding-top: 20px;
-}
-.imageset.icon_post_report {
- background-image: url("./en/icon_post_report.gif");
- padding-left: 20px;
- padding-top: 20px;
-}
-.imageset.icon_user_online {
- background-image: url("./en/icon_user_online.gif");
- padding-left: 72px;
- padding-top: 20px;
-}
-.imageset.icon_user_offline {
- background-image: url("./en/icon_user_offline.gif");
- padding-left: 72px;
- padding-top: 20px;
-}
-.imageset.icon_user_profile {
- background-image: url("./en/icon_user_profile.gif");
- padding-left: 72px;
- padding-top: 20px;
-}
-.imageset.icon_user_search {
- background-image: url("./en/icon_user_search.gif");
- padding-left: 72px;
- padding-top: 20px;
-}
-.imageset.icon_user_warn {
- background-image: url("./en/icon_user_warn.gif");
- padding-left: 20px;
- padding-top: 20px;
-}
-.imageset.button_pm_new {
- background-image: url("./en/button_pm_new.gif");
- padding-left: 97px;
- padding-top: 27px;
-}
-.imageset.button_pm_reply {
- background-image: url("./en/button_pm_reply.gif");
- padding-left: 90px;
- padding-top: 20px;
-}
-.imageset.button_topic_locked {
- background-image: url("./en/button_topic_locked.gif");
- padding-left: 97px;
- padding-top: 27px;
-}
-.imageset.button_topic_new {
- background-image: url("./en/button_topic_new.gif");
- padding-left: 97px;
- padding-top: 27px;
-}
-.imageset.button_topic_reply {
- background-image: url("./en/button_topic_reply.gif");
- padding-left: 97px;
- padding-top: 27px;
-}
-
-/* RTL imageset entries */
-.rtl .imageset.site_logo {
- padding-right: 170px;
- padding-left: 0;
-}
-.rtl .imageset.upload_bar {
- padding-right: 280px;
- padding-left: 0;
-}
-.rtl .imageset.poll_left, .rtl .imageset.poll_right {
- padding-right: 4px;
- padding-left: 0;
-}
-.rtl .imageset.poll_center {
- padding-right: 1px;
- padding-left: 0;
-}
-.rtl .imageset.forum_link, .rtl .imageset.forum_read, .rtl .imageset.forum_read_locked, .rtl .imageset.forum_read_subforum, .rtl .imageset.forum_unread, .rtl .imageset.forum_unread_locked, .rtl .imageset.forum_unread_subforum {
- padding-right: 46px;
- padding-left: 0;
-}
-.rtl .imageset.topic_moved, .rtl .imageset.topic_read, .rtl .imageset.topic_read_mine, .rtl .imageset.topic_read_hot, .rtl .imageset.topic_read_hot_mine, .rtl .imageset.topic_read_locked, .rtl .imageset.topic_read_locked_mine, .rtl .imageset.topic_unread, .rtl .imageset.topic_unread_mine, .rtl .imageset.topic_unread_hot, .rtl .imageset.topic_unread_hot_mine, .rtl .imageset.topic_unread_locked, .rtl .imageset.topic_unread_locked_mine, .rtl .imageset.sticky_read, .rtl .imageset.sticky_read_mine, .rtl .imageset.sticky_read_locked, .rtl .imageset.sticky_read_locked_mine, .rtl .imageset.sticky_unread, .rtl .imageset.sticky_unread_mine, .rtl .imageset.sticky_unread_locked, .rtl .imageset.sticky_unread_locked_mine, .rtl .imageset.announce_read, .rtl .imageset.announce_read_mine, .rtl .imageset.announce_read_locked, .rtl .imageset.announce_read_locked_mine, .rtl .imageset.announce_unread, .rtl .imageset.announce_unread_mine, .rtl .imageset.announce_unread_locked, .rtl .imageset.announce_unread_locked_mine, .rtl .imageset.global_read, .rtl .imageset.global_read_mine, .rtl .imageset.global_read_locked, .rtl .imageset.global_read_locked_mine, .rtl .imageset.global_unread, .rtl .imageset.global_unread_mine, .rtl .imageset.global_unread_locked, .rtl .imageset.global_unread_locked_mine, .rtl .imageset.pm_read, .rtl .imageset.pm_unread, .rtl .imageset.icon_topic_reported, .rtl .imageset.icon_topic_unapproved {
- padding-right: 19px;
- padding-left: 0;
-}
-.rtl .imageset.icon_post_target, .rtl .imageset.icon_post_target_unread {
- padding-right: 12px;
- padding-left: 0;
-}
-.rtl .imageset.icon_topic_attach {
- padding-right: 14px;
- padding-left: 0;
-}
-.rtl .imageset.icon_topic_latest, .rtl .imageset.icon_topic_newest {
- padding-right: 18px;
- padding-left: 0;
-}
-
-#notification_list {
- display: none;
- position: absolute;
- width: 310px;
- z-index: 1;
- box-shadow: 3px 3px 5px darkgray;
-}
-
-#notification_list .notification_scroll {
- max-height: 350px;
- overflow-y: auto;
- overflow-x: hidden;
-}
-
-#notification_list table {
- width: 100%;
-}
-
-#notification_list .notification_title {
- padding: 3px;
-}
-
-#notification_list .notification_title:after {
- clear: both;
- content: '';
- display: block;
-}
-
-#notification_list .header {
- padding: 5px;
- font-weight: bold;
- border: 1px solid #A9B8C2;
- border-bottom: 0;
-}
-
-#notification_list > .header > .header_settings {
- float: right;
- font-weight: normal;
- text-transform: none;
-}
-
-#notification_list .footer {
- text-align: center;
- font-size: 1.2em;
- border: 1px solid #A9B8C2;
- border-top: 0;
-}
-
-.notification_list img {
- max-width: 50px;
- max-height: 50px;
-}
-
-#notification_list .footer > a {
- display: block;
-}
-
-#notification_list .notification-time {
- font-size: 0.9em;
- float: right;
-}
-
-.notification_list .notifications_time {
- font-size: 0.8em;
-}
diff --git a/phpBB/ucp.php b/phpBB/ucp.php
index 8c74ca1f3c..720b56ae8b 100644
--- a/phpBB/ucp.php
+++ b/phpBB/ucp.php
@@ -22,8 +22,8 @@ require($phpbb_root_path . 'includes/functions_user.' . $phpEx);
require($phpbb_root_path . 'includes/functions_module.' . $phpEx);
// Basic parameter data
-$id = request_var('i', '');
-$mode = request_var('mode', '');
+$id = $request->variable('i', '');
+$mode = $request->variable('mode', '');
if (in_array($mode, array('login', 'login_link', 'logout', 'confirm', 'sendpassword', 'activate')))
{
@@ -81,7 +81,7 @@ switch ($mode)
redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
}
- login_box(request_var('redirect', "index.$phpEx"));
+ login_box($request->variable('redirect', "index.$phpEx"));
break;
case 'login_link':
@@ -212,7 +212,7 @@ switch ($mode)
case 'switch_perm':
- $user_id = request_var('u', 0);
+ $user_id = $request->variable('u', 0);
$sql = 'SELECT *
FROM ' . USERS_TABLE . '
@@ -221,7 +221,7 @@ switch ($mode)
$user_row = $db->sql_fetchrow($result);
$db->sql_freeresult($result);
- if (!$auth->acl_get('a_switchperm') || !$user_row || $user_id == $user->data['user_id'] || !check_link_hash(request_var('hash', ''), 'switchperm'))
+ if (!$auth->acl_get('a_switchperm') || !$user_row || $user_id == $user->data['user_id'] || !check_link_hash($request->variable('hash', ''), 'switchperm'))
{
redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
}
@@ -234,7 +234,7 @@ switch ($mode)
redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
}
- add_log('admin', 'LOG_ACL_TRANSFER_PERMISSIONS', $user_row['username']);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ACL_TRANSFER_PERMISSIONS', false, array($user_row['username']));
$message = sprintf($user->lang['PERMISSIONS_TRANSFERRED'], $user_row['username']) . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
trigger_error($message);
@@ -257,7 +257,7 @@ switch ($mode)
$username = $db->sql_fetchfield('username');
$db->sql_freeresult($result);
- add_log('admin', 'LOG_ACL_RESTORE_PERMISSIONS', $username);
+ $phpbb_log->add('admin', $user->data['user_id'], $user->ip, 'LOG_ACL_RESTORE_PERMISSIONS', false, array($username));
$message = $user->lang['PERMISSIONS_RESTORED'] . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
trigger_error($message);
@@ -285,7 +285,7 @@ if (!$user->data['is_registered'])
if ($id == 'pm' && $mode == 'view' && isset($_GET['p']))
{
- $redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx?i=pm&p=" . request_var('p', 0));
+ $redirect_url = append_sid("{$phpbb_root_path}ucp.$phpEx?i=pm&p=" . $request->variable('p', 0));
login_box($redirect_url, $user->lang['LOGIN_EXPLAIN_UCP']);
}
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index cd55114bad..3e9eb019bc 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -25,18 +25,19 @@ $user->session_begin();
$auth->acl($user->data);
// Start initial var setup
-$forum_id = request_var('f', 0);
-$mark_read = request_var('mark', '');
-$start = request_var('start', 0);
+$forum_id = $request->variable('f', 0);
+$mark_read = $request->variable('mark', '');
+$start = $request->variable('start', 0);
$default_sort_days = (!empty($user->data['user_topic_show_days'])) ? $user->data['user_topic_show_days'] : 0;
$default_sort_key = (!empty($user->data['user_topic_sortby_type'])) ? $user->data['user_topic_sortby_type'] : 't';
$default_sort_dir = (!empty($user->data['user_topic_sortby_dir'])) ? $user->data['user_topic_sortby_dir'] : 'd';
-$sort_days = request_var('st', $default_sort_days);
-$sort_key = request_var('sk', $default_sort_key);
-$sort_dir = request_var('sd', $default_sort_dir);
+$sort_days = $request->variable('st', $default_sort_days);
+$sort_key = $request->variable('sk', $default_sort_key);
+$sort_dir = $request->variable('sd', $default_sort_dir);
+/* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
// Check if the user has actually sent a forum ID with his/her request
@@ -146,6 +147,7 @@ else
}
}
+/* @var $phpbb_content_visibility \phpbb\content_visibility */
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
// Dump out the page header and load viewforum template
@@ -184,10 +186,10 @@ if (!$auth->acl_get('f_read', $forum_id))
// Handle marking posts
if ($mark_read == 'topics')
{
- $token = request_var('hash', '');
+ $token = $request->variable('hash', '');
if (check_link_hash($token, 'global'))
{
- markread('topics', array($forum_id), false, request_var('mark_time', 0));
+ markread('topics', array($forum_id), false, $request->variable('mark_time', 0));
}
$redirect_url = append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $forum_id);
meta_refresh(3, $redirect_url);
@@ -218,6 +220,7 @@ if ($forum_data['forum_topics_per_page'])
// Do the forum Prune thang - cron type job ...
if (!$config['use_system_cron'])
{
+ /* @var $cron \phpbb\cron\manager */
$cron = $phpbb_container->get('cron.manager');
$task = $cron->find_task('cron.task.core.prune_forum');
diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php
index 583e297682..a44a4b218e 100644
--- a/phpBB/viewonline.php
+++ b/phpBB/viewonline.php
@@ -25,12 +25,12 @@ $auth->acl($user->data);
$user->setup('memberlist');
// Get and set some variables
-$mode = request_var('mode', '');
-$session_id = request_var('s', '');
-$start = request_var('start', 0);
-$sort_key = request_var('sk', 'b');
-$sort_dir = request_var('sd', 'd');
-$show_guests = ($config['load_online_guests']) ? request_var('sg', 0) : 0;
+$mode = $request->variable('mode', '');
+$session_id = $request->variable('s', '');
+$start = $request->variable('start', 0);
+$sort_key = $request->variable('sk', 'b');
+$sort_dir = $request->variable('sd', 'd');
+$show_guests = ($config['load_online_guests']) ? $request->variable('sg', 0) : 0;
// Can this user view profiles/memberlist?
if (!$auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel'))
@@ -43,7 +43,10 @@ if (!$auth->acl_gets('u_viewprofile', 'a_user', 'a_useradd', 'a_userdel'))
login_box('', $user->lang['LOGIN_EXPLAIN_VIEWONLINE']);
}
+/* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
+
+/* @var $viewonline_helper \phpbb\viewonline_helper */
$viewonline_helper = $phpbb_container->get('viewonline_helper');
$sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_JOINED'], 'c' => $user->lang['SORT_LOCATION']);
@@ -176,6 +179,12 @@ $result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary));
$prev_id = $prev_ip = $user_list = array();
$logged_visible_online = $logged_hidden_online = $counter = 0;
+/** @var \phpbb\controller\helper $controller_helper */
+$controller_helper = $phpbb_container->get('controller.helper');
+
+/** @var \phpbb\group\helper $group_helper */
+$group_helper = $phpbb_container->get('group_helper');
+
while ($row = $db->sql_fetchrow($result))
{
if ($row['user_id'] != ANONYMOUS && !isset($prev_id[$row['user_id']]))
@@ -300,11 +309,6 @@ while ($row = $db->sql_fetchrow($result))
$location_url = append_sid("{$phpbb_root_path}search.$phpEx");
break;
- case 'faq':
- $location = $user->lang['VIEWING_FAQ'];
- $location_url = append_sid("{$phpbb_root_path}faq.$phpEx");
- break;
-
case 'viewonline':
$location = $user->lang['VIEWING_ONLINE'];
$location_url = append_sid("{$phpbb_root_path}viewonline.$phpEx");
@@ -370,6 +374,13 @@ while ($row = $db->sql_fetchrow($result))
default:
$location = $user->lang['INDEX'];
$location_url = append_sid("{$phpbb_root_path}index.$phpEx");
+
+ if ($row['session_page'] === 'app.' . $phpEx . '/help/faq' ||
+ $row['session_page'] === 'app.' . $phpEx . '/help/bbcode')
+ {
+ $location = $user->lang['VIEWING_FAQ'];
+ $location_url = $controller_helper->route('phpbb_help_faq_controller');
+ }
break;
}
@@ -459,7 +470,7 @@ while ($row = $db->sql_fetchrow($result))
}
else
{
- $legend .= (($legend != '') ? ', ' : '') . '<a style="color:#' . $row['group_colour'] . '" href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']) . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</a>';
+ $legend .= (($legend != '') ? ', ' : '') . '<a style="color:#' . $row['group_colour'] . '" href="' . append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=group&amp;g=' . $row['group_id']) . '">' . $group_helper->get_name($row['group_name']) . '</a>';
}
}
$db->sql_freeresult($result);
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index 26524283e1..b9cb226920 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -27,34 +27,35 @@ $user->session_begin();
$auth->acl($user->data);
// Initial var setup
-$forum_id = request_var('f', 0);
-$topic_id = request_var('t', 0);
-$post_id = request_var('p', 0);
-$voted_id = request_var('vote_id', array('' => 0));
+$forum_id = $request->variable('f', 0);
+$topic_id = $request->variable('t', 0);
+$post_id = $request->variable('p', 0);
+$voted_id = $request->variable('vote_id', array('' => 0));
$voted_id = (sizeof($voted_id) > 1) ? array_unique($voted_id) : $voted_id;
-$start = request_var('start', 0);
-$view = request_var('view', '');
+$start = $request->variable('start', 0);
+$view = $request->variable('view', '');
$default_sort_days = (!empty($user->data['user_post_show_days'])) ? $user->data['user_post_show_days'] : 0;
$default_sort_key = (!empty($user->data['user_post_sortby_type'])) ? $user->data['user_post_sortby_type'] : 't';
$default_sort_dir = (!empty($user->data['user_post_sortby_dir'])) ? $user->data['user_post_sortby_dir'] : 'a';
-$sort_days = request_var('st', $default_sort_days);
-$sort_key = request_var('sk', $default_sort_key);
-$sort_dir = request_var('sd', $default_sort_dir);
+$sort_days = $request->variable('st', $default_sort_days);
+$sort_key = $request->variable('sk', $default_sort_key);
+$sort_dir = $request->variable('sd', $default_sort_dir);
-$update = request_var('update', false);
+$update = $request->variable('update', false);
+/* @var $pagination \phpbb\pagination */
$pagination = $phpbb_container->get('pagination');
$s_can_vote = false;
/**
* @todo normalize?
*/
-$hilit_words = request_var('hilit', '', true);
+$hilit_words = $request->variable('hilit', '', true);
// Do we have a topic or post id?
if (!$topic_id && !$post_id)
@@ -62,6 +63,7 @@ if (!$topic_id && !$post_id)
trigger_error('NO_TOPIC');
}
+/* @var $phpbb_content_visibility \phpbb\content_visibility */
$phpbb_content_visibility = $phpbb_container->get('content.visibility');
// Find topic id if user requested a newer or older topic
@@ -496,9 +498,9 @@ if ($config['allow_topic_notify'])
}
// Bookmarks
-if ($config['allow_bookmarks'] && $user->data['is_registered'] && request_var('bookmark', 0))
+if ($config['allow_bookmarks'] && $user->data['is_registered'] && $request->variable('bookmark', 0))
{
- if (check_link_hash(request_var('hash', ''), "topic_$topic_id"))
+ if (check_link_hash($request->variable('hash', ''), "topic_$topic_id"))
{
if (!$topic_data['bookmarked'])
{
@@ -581,10 +583,10 @@ $quickmod_array = array(
'merge' => array('MERGE_POSTS', $auth->acl_get('m_merge', $forum_id)),
'merge_topic' => array('MERGE_TOPIC', $auth->acl_get('m_merge', $forum_id)),
'fork' => array('FORK_TOPIC', $auth->acl_get('m_move', $forum_id)),
- 'make_normal' => array('MAKE_NORMAL', ($allow_change_type && $auth->acl_gets('f_sticky', 'f_announce', $forum_id) && $topic_data['topic_type'] != POST_NORMAL)),
+ 'make_normal' => array('MAKE_NORMAL', ($allow_change_type && $auth->acl_gets('f_sticky', 'f_announce', 'f_announce_global', $forum_id) && $topic_data['topic_type'] != POST_NORMAL)),
'make_sticky' => array('MAKE_STICKY', ($allow_change_type && $auth->acl_get('f_sticky', $forum_id) && $topic_data['topic_type'] != POST_STICKY)),
'make_announce' => array('MAKE_ANNOUNCE', ($allow_change_type && $auth->acl_get('f_announce', $forum_id) && $topic_data['topic_type'] != POST_ANNOUNCE)),
- 'make_global' => array('MAKE_GLOBAL', ($allow_change_type && $auth->acl_get('f_announce', $forum_id) && $topic_data['topic_type'] != POST_GLOBAL)),
+ 'make_global' => array('MAKE_GLOBAL', ($allow_change_type && $auth->acl_get('f_announce_global', $forum_id) && $topic_data['topic_type'] != POST_GLOBAL)),
'topic_logs' => array('VIEW_TOPIC_LOGS', $auth->acl_get('m_', $forum_id)),
);
@@ -1404,6 +1406,7 @@ $db->sql_freeresult($result);
// Load custom profile fields
if ($config['load_cpf_viewtopic'])
{
+ /* @var $cp \phpbb\profilefields\manager */
$cp = $phpbb_container->get('profilefields.manager');
// Grab all profile fields from users in id cache for later use - similar to the poster cache
@@ -1896,7 +1899,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
'U_JABBER' => $user_cache[$poster_id]['jabber'],
'U_APPROVE_ACTION' => append_sid("{$phpbb_root_path}mcp.$phpEx", "i=queue&amp;p={$row['post_id']}&amp;f=$forum_id&amp;redirect=" . urlencode(str_replace('&amp;', '&', $viewtopic_url . '&amp;p=' . $row['post_id'] . '#p' . $row['post_id']))),
- 'U_REPORT' => ($auth->acl_get('f_report', $forum_id)) ? append_sid("{$phpbb_root_path}report.$phpEx", 'f=' . $forum_id . '&amp;p=' . $row['post_id']) : '',
+ 'U_REPORT' => ($auth->acl_get('f_report', $forum_id)) ? $phpbb_container->get('controller.helper')->route('phpbb_report_post_controller', array('id' => $row['post_id'])) : '',
'U_MCP_REPORT' => ($auth->acl_get('m_report', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&amp;mode=report_details&amp;f=' . $forum_id . '&amp;p=' . $row['post_id'], true, $user->session_id) : '',
'U_MCP_APPROVE' => ($auth->acl_get('m_approve', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=approve_details&amp;f=' . $forum_id . '&amp;p=' . $row['post_id'], true, $user->session_id) : '',
'U_MCP_RESTORE' => ($auth->acl_get('m_approve', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&amp;mode=' . (($topic_data['topic_visibility'] != ITEM_DELETED) ? 'deleted_posts' : 'deleted_topics') . '&amp;f=' . $forum_id . '&amp;p=' . $row['post_id'], true, $user->session_id) : '',
@@ -2189,13 +2192,13 @@ if ($s_can_vote || $s_quick_reply)
// We overwrite $_REQUEST['f'] if there is no forum specified
// to be able to display the correct online list.
// One downside is that the user currently viewing this topic/post is not taken into account.
-if (!request_var('f', 0))
+if (!$request->variable('f', 0))
{
$request->overwrite('f', $forum_id);
}
// We need to do the same with the topic_id. See #53025.
-if (!request_var('t', 0) && !empty($topic_id))
+if (!$request->variable('t', 0) && !empty($topic_id))
{
$request->overwrite('t', $topic_id);
}